ZAP by Checkmarx Scanning Report

Generated with ZAP on Thu 24 Oct 2024, at 03:15:50

ZAP Version: 2.15.0

ZAP by Checkmarx

Contents

About this report

Report description

Sample testinng on Standard Notes from local host and standard notes.com

Report parameters

Contexts

No contexts were selected, so all contexts were included by default.

Sites

The following sites were included:

  • http://localhost:3001
  • https://app.standardnotes.com

(If no sites were selected, all sites were included by default.)

An included site must also be within one of the included contexts for its data to be included in the report.

Risk levels

Included: High, Medium, Low, Informational

Excluded: None

Confidence levels

Included: User Confirmed, High, Medium, Low

Excluded: User Confirmed, High, Medium, Low, False Positive

Summaries

Alert counts by risk and confidence

This table shows the number of alerts for each level of risk and confidence included in the report.

(The percentages in brackets represent the count as a percentage of the total number of alerts included in the report, rounded to one decimal place.)

Confidence
User Confirmed High Medium Low Total
Risk High 0
(0.0%)
0
(0.0%)
0
(0.0%)
1
(7.7%)
1
(7.7%)
Medium 0
(0.0%)
3
(23.1%)
1
(7.7%)
0
(0.0%)
4
(30.8%)
Low 0
(0.0%)
0
(0.0%)
3
(23.1%)
1
(7.7%)
4
(30.8%)
Informational 0
(0.0%)
0
(0.0%)
2
(15.4%)
2
(15.4%)
4
(30.8%)
Total 0
(0.0%)
3
(23.1%)
6
(46.2%)
4
(30.8%)
13
(100%)

Alert counts by site and risk

This table shows, for each site for which one or more alerts were raised, the number of alerts raised at each risk level.

Alerts with a confidence level of "False Positive" have been excluded from these counts.

(The numbers in brackets are the number of alerts raised for the site at or above that risk level.)

Risk
High
(= High)
Medium
(>= Medium)
Low
(>= Low)
Informational
(>= Informational)
Site http://localhost:3001 1
(1)
1
(2)
2
(4)
0
(4)
https://app.standardnotes.com 0
(0)
3
(3)
2
(5)
4
(9)

Alert counts by alert type

This table shows the number of alerts of each alert type, together with the alert type's risk level.

(The percentages in brackets represent each count as a percentage, rounded to one decimal place, of the total number of alerts included in this report.)

Alert type Risk Count
Cloud Metadata Potentially Exposed High 1
(7.7%)
CSP: Wildcard Directive Medium 6
(46.2%)
CSP: script-src unsafe-eval Medium 1
(7.7%)
CSP: style-src unsafe-hashes Medium 3
(23.1%)
Cross-Domain Misconfiguration Medium 17
(130.8%)
Private IP Disclosure Low 1
(7.7%)
Server Leaks Information via "X-Powered-By" HTTP Response Header Field(s) Low 9
(69.2%)
Timestamp Disclosure - Unix Low 38
(292.3%)
X-Content-Type-Options Header Missing Low 7
(53.8%)
Information Disclosure - Suspicious Comments Informational 3
(23.1%)
Modern Web Application Informational 2
(15.4%)
Re-examine Cache-control Directives Informational 3
(23.1%)
Retrieved from Cache Informational 8
(61.5%)
Total 13

Alerts

  1. Risk=High, Confidence=Low (1)

    1. http://localhost:3001 (1)

      1. Cloud Metadata Potentially Exposed (1)
        1. GET http://localhost:3001/latest/meta-data/
          Alert tags
          Alert description

          The Cloud Metadata Attack attempts to abuse a misconfigured NGINX server in order to access the instance metadata maintained by cloud service providers such as AWS, GCP and Azure.

          All of these providers provide metadata via an internal unroutable IP address '169.254.169.254' - this can be exposed by incorrectly configured NGINX servers and accessed by using this IP address in the Host header field.

          Other info

          Based on the successful response status code cloud metadata may have been returned in the response. Check the response data to see if any cloud metadata has been returned.

          The meta data returned can include information that would allow an attacker to completely compromise the system.

          Request
          Request line and header section (216 bytes)
          GET http://localhost:3001/latest/meta-data/ HTTP/1.1
          host: aws.zaproxy.org
          user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0
          pragma: no-cache
          cache-control: no-cache
          
          
          Request body (0 bytes)
          Response
          Status line and header section (228 bytes)
          HTTP/1.1 200 OK
          X-Powered-By: Express
          Content-Type: text/html; charset=utf-8
          Content-Length: 19
          ETag: W/"13-OxsTL6IB85fkJxv9HO8uum0slCI"
          Date: Thu, 24 Oct 2024 00:04:49 GMT
          Connection: keep-alive
          Keep-Alive: timeout=5
          
          
          Response body (19 bytes)
          Invalid Host header
          Attack
          aws.zaproxy.org
          Solution

          Do not trust any user data in NGINX configs. In this case it is probably the use of the $host variable which is set from the 'Host' header and can be controlled by an attacker.

  2. Risk=Medium, Confidence=High (3)

    1. http://localhost:3001 (1)

      1. CSP: script-src unsafe-eval (1)
        1. GET http://localhost:3001/
          Alert tags
          Alert description

          Content Security Policy (CSP) is an added layer of security that helps to detect and mitigate certain types of attacks. Including (but not limited to) Cross Site Scripting (XSS), and data injection attacks. These attacks are used for everything from data theft to site defacement or distribution of malware. CSP provides a set of standard HTTP headers that allow website owners to declare approved sources of content that browsers should be allowed to load on that page — covered types are JavaScript, CSS, HTML frames, fonts, images and embeddable objects such as Java applets, ActiveX, audio and video files.

          Other info

          script-src includes unsafe-eval.

          Request
          Request line and header section (198 bytes)
          GET http://localhost:3001/ HTTP/1.1
          host: localhost:3001
          user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0
          pragma: no-cache
          cache-control: no-cache
          
          
          Request body (0 bytes)
          Response
          Status line and header section (759 bytes)
          HTTP/1.1 200 OK
          X-Powered-By: Express
          Access-Control-Allow-Origin: *
          Content-Security-Policy: default-src https: 'self'; base-uri 'self'; child-src * blob:; connect-src * blob:; font-src * data:; form-action 'self'; frame-ancestors * file:; frame-src * blob:; img-src 'self' * data: blob:; manifest-src 'self'; media-src 'self' blob: *.standardnotes.com; object-src 'self' blob: *.standardnotes.com; script-src 'self' 'sha256-r26E+iPOhx7KM7cKn4trOSoD8u5E7wL7wwJ8UrR+rGs=' 'unsafe-eval' 'wasm-unsafe-eval'; style-src *;
          Content-Type: text/html; charset=utf-8
          Accept-Ranges: bytes
          Content-Length: 2575
          ETag: W/"a0f-5gVCjcWMu95t09y6MQ6NXZo929g"
          Vary: Accept-Encoding
          Date: Thu, 24 Oct 2024 00:04:44 GMT
          Connection: keep-alive
          Keep-Alive: timeout=5
          
          
          Response body (2575 bytes)
          <!DOCTYPE html>
          <html>
            <head>
              <meta charset="utf-8"/>
              <meta content="IE=edge" http-equiv="X-UA-Compatible"/>
              <meta content="viewport-fit=cover, width=device-width, initial-scale=1" name="viewport"/>
          
              <link rel="canonical" href="https://app.standardnotes.com" />
          
              <link href="favicon/apple-touch-icon.png" rel="apple-touch-icon" sizes="180x180"></link>
              <link href="favicon/favicon-32x32.png" rel="icon" sizes="32x32" type="image/png"></link>
              <link href="favicon/favicon-16x16.png" rel="icon" sizes="16x16" type="image/png"></link>
              <link href="manifest.webmanifest" rel="manifest"></link>
          
              <link color="#5bbad5" href="favicon/safari-pinned-tab.svg" rel="mask-icon"></link>
              <meta name="theme-color" content="#ffffff">
          
              <meta content="Standard Notes" name="apple-mobile-web-app-title"/>
              <meta content="Standard Notes" name="application-name"/>
              <base href="/"></base>
          
              <title>Notes · Standard Notes</title>
              <meta name="description" content="Standard Notes is an easy-to-use encrypted note-taking app for digitalists and professionals. Capture your notes, documents, and life's work all in one place."/>
          
              <meta name="twitter:title" content="Standard Notes, an end-to-end encrypted notes app."/>
              <meta name="twitter:description" content="Standard Notes is an easy-to-use encrypted note-taking app for digitalists and professionals. Capture your notes, documents, and life's work all in one place."/>
              <meta name="twitter:site" content="@standardnotes"/>
              <meta name="twitter:card" content="summary"/>
          
              <meta name="og:title" content="Standard Notes, an end-to-end encrypted notes app."/>
              <meta name="og:description" content="Standard Notes is an easy-to-use encrypted note-taking app for digitalists and professionals. Capture your notes, documents, and life's work all in one place."/>
          
              <!-- CSP script-src hash: sha256-r26E+iPOhx7KM7cKn4trOSoD8u5E7wL7wwJ8UrR+rGs= -->
              <script>
                window.defaultSyncServer = "https://api.standardnotes.com";
                window.defaultFilesHost = "https://files.standardnotes.com";
                window.enabledUnfinishedFeatures = false;
                window.websocketUrl = "wss://sockets.standardnotes.com";
                window.purchaseUrl = "https://standardnotes.com/purchase";
                window.plansUrl = "https://standardnotes.com/plans";
                window.dashboardUrl = "https://standardnotes.com/dashboard";
              </script>
          
              <script src="./app.js" debug="false"></script>
              <link rel="stylesheet" media="all" href="./app.css" debug="false" />
            </head>
            <body>
            </body>
          </html>
          
          Parameter
          Content-Security-Policy
          Evidence
          default-src https: 'self'; base-uri 'self'; child-src * blob:; connect-src * blob:; font-src * data:; form-action 'self'; frame-ancestors * file:; frame-src * blob:; img-src 'self' * data: blob:; manifest-src 'self'; media-src 'self' blob: *.standardnotes.com; object-src 'self' blob: *.standardnotes.com; script-src 'self' 'sha256-r26E+iPOhx7KM7cKn4trOSoD8u5E7wL7wwJ8UrR+rGs=' 'unsafe-eval' 'wasm-unsafe-eval'; style-src *;
          Solution

          Ensure that your web server, application server, load balancer, etc. is properly configured to set the Content-Security-Policy header.

    2. https://app.standardnotes.com (2)

      1. CSP: Wildcard Directive (1)
        1. GET https://app.standardnotes.com/sitemap.xml
          Alert tags
          Alert description

          Content Security Policy (CSP) is an added layer of security that helps to detect and mitigate certain types of attacks. Including (but not limited to) Cross Site Scripting (XSS), and data injection attacks. These attacks are used for everything from data theft to site defacement or distribution of malware. CSP provides a set of standard HTTP headers that allow website owners to declare approved sources of content that browsers should be allowed to load on that page — covered types are JavaScript, CSS, HTML frames, fonts, images and embeddable objects such as Java applets, ActiveX, audio and video files.

          Other info

          The following directives either allow wildcard sources (or ancestors), are not defined, or are overly broadly defined:

          style-src, img-src, frame-src, frame-ancestors, font-src, worker-src

          The directive(s): frame-ancestors are among the directives that do not fallback to default-src, missing/excluding them is the same as allowing anything.

          Request
          Request line and header section (224 bytes)
          GET https://app.standardnotes.com/sitemap.xml HTTP/1.1
          host: app.standardnotes.com
          user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0
          pragma: no-cache
          cache-control: no-cache
          
          
          Request body (0 bytes)
          Response
          Status line and header section (1364 bytes)
          HTTP/1.1 404 Not Found
          Date: Thu, 24 Oct 2024 00:02:56 GMT
          Content-Type: text/html
          Connection: keep-alive
          last-modified: Mon, 14 Oct 2024 13:09:55 GMT
          x-frame-options: SAMEORIGIN
          referrer-policy: no-referrer-when-downgrade
          content-security-policy: default-src https: 'self'; base-uri 'self'; child-src * blob:; connect-src api.standardnotes.com sync.standardnotes.org files.standardnotes.com ws://sockets.standardnotes.com raw.githubusercontent.com listed.to blob:; font-src * data:; form-action 'self'; frame-ancestors * file:; frame-src * blob:; img-src 'self' * data: blob:; manifest-src 'self'; media-src 'self' blob: *.standardnotes.com; object-src 'self' blob: *.standardnotes.com; script-src 'self' 'sha256-r26E+iPOhx7KM7cKn4trOSoD8u5E7wL7wwJ8UrR+rGs=' 'wasm-unsafe-eval'; style-src * 'unsafe-hashes' 'sha256-jpJOxTrdc58x4woq2mVygDDIvjIAGNkLZ2yfx4ppdXo=' 'sha256-tbWZ4NP1341cpcrZVDn7B3o9bt/muXgduILAnC0Zbaw=';
          x-content-type-options: nosniff
          strict-transport-security: max-age=31536000; includeSubDomains; preload
          vary: Accept-Encoding
          x-cache: Error from cloudfront
          via: 1.1 486e34c9a7512d6a57a32ef8a8030870.cloudfront.net (CloudFront)
          x-amz-cf-pop: ATL59-P3
          x-amz-cf-id: S5cHkECqUqsAViZafNaL_ue49ygVvLszO-JAbc7WCZIGLizXutzDQQ==
          Age: 34951
          cf-cache-status: DYNAMIC
          Server: cloudflare
          CF-RAY: 8d75b36aff60139b-ATL
          content-length: 1564
          
          
          Response body (1564 bytes)
          <!DOCTYPE html>
          <html>
          <head>
            <title>The page you were looking for doesn't exist (404)</title>
            <meta name="viewport" content="width=device-width,initial-scale=1">
            <style>
            body {
              background-color: #EFEFEF;
              color: #2E2F30;
              text-align: center;
              font-family: arial, sans-serif;
              margin: 0;
            }
          
            div.dialog {
              width: 95%;
              max-width: 33em;
              margin: 4em auto 0;
            }
          
            div.dialog > div {
              border: 1px solid #CCC;
              border-right-color: #999;
              border-left-color: #999;
              border-bottom-color: #BBB;
              border-top: #B00100 solid 4px;
              border-top-left-radius: 9px;
              border-top-right-radius: 9px;
              background-color: white;
              padding: 7px 12% 0;
              box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
            }
          
            h1 {
              font-size: 100%;
              color: #730E15;
              line-height: 1.5em;
            }
          
            div.dialog > p {
              margin: 0 0 1em;
              padding: 1em;
              background-color: #F7F7F7;
              border: 1px solid #CCC;
              border-right-color: #999;
              border-left-color: #999;
              border-bottom-color: #999;
              border-bottom-left-radius: 4px;
              border-bottom-right-radius: 4px;
              border-top-color: #DADADA;
              color: #666;
              box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
            }
            </style>
          </head>
          
          <body>
            <!-- This file lives in public/404.html -->
            <div class="dialog">
              <div>
                <h1>The page you were looking for doesn't exist.</h1>
                <p>You may have mistyped the address or the page may have moved.</p>
              </div>
              <p>If you are the application owner check the logs for more information.</p>
            </div>
          </body>
          </html>
          
          Parameter
          content-security-policy
          Evidence
          default-src https: 'self'; base-uri 'self'; child-src * blob:; connect-src api.standardnotes.com sync.standardnotes.org files.standardnotes.com ws://sockets.standardnotes.com raw.githubusercontent.com listed.to blob:; font-src * data:; form-action 'self'; frame-ancestors * file:; frame-src * blob:; img-src 'self' * data: blob:; manifest-src 'self'; media-src 'self' blob: *.standardnotes.com; object-src 'self' blob: *.standardnotes.com; script-src 'self' 'sha256-r26E+iPOhx7KM7cKn4trOSoD8u5E7wL7wwJ8UrR+rGs=' 'wasm-unsafe-eval'; style-src * 'unsafe-hashes' 'sha256-jpJOxTrdc58x4woq2mVygDDIvjIAGNkLZ2yfx4ppdXo=' 'sha256-tbWZ4NP1341cpcrZVDn7B3o9bt/muXgduILAnC0Zbaw=';
          Solution

          Ensure that your web server, application server, load balancer, etc. is properly configured to set the Content-Security-Policy header.

      2. CSP: style-src unsafe-hashes (1)
        1. GET https://app.standardnotes.com/sitemap.xml
          Alert tags
          Alert description

          Content Security Policy (CSP) is an added layer of security that helps to detect and mitigate certain types of attacks. Including (but not limited to) Cross Site Scripting (XSS), and data injection attacks. These attacks are used for everything from data theft to site defacement or distribution of malware. CSP provides a set of standard HTTP headers that allow website owners to declare approved sources of content that browsers should be allowed to load on that page — covered types are JavaScript, CSS, HTML frames, fonts, images and embeddable objects such as Java applets, ActiveX, audio and video files.

          Other info

          style-src includes unsafe-hashes, an attacker will be able to use any of the code covered by such hashes.

          Request
          Request line and header section (224 bytes)
          GET https://app.standardnotes.com/sitemap.xml HTTP/1.1
          host: app.standardnotes.com
          user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0
          pragma: no-cache
          cache-control: no-cache
          
          
          Request body (0 bytes)
          Response
          Status line and header section (1364 bytes)
          HTTP/1.1 404 Not Found
          Date: Thu, 24 Oct 2024 00:02:56 GMT
          Content-Type: text/html
          Connection: keep-alive
          last-modified: Mon, 14 Oct 2024 13:09:55 GMT
          x-frame-options: SAMEORIGIN
          referrer-policy: no-referrer-when-downgrade
          content-security-policy: default-src https: 'self'; base-uri 'self'; child-src * blob:; connect-src api.standardnotes.com sync.standardnotes.org files.standardnotes.com ws://sockets.standardnotes.com raw.githubusercontent.com listed.to blob:; font-src * data:; form-action 'self'; frame-ancestors * file:; frame-src * blob:; img-src 'self' * data: blob:; manifest-src 'self'; media-src 'self' blob: *.standardnotes.com; object-src 'self' blob: *.standardnotes.com; script-src 'self' 'sha256-r26E+iPOhx7KM7cKn4trOSoD8u5E7wL7wwJ8UrR+rGs=' 'wasm-unsafe-eval'; style-src * 'unsafe-hashes' 'sha256-jpJOxTrdc58x4woq2mVygDDIvjIAGNkLZ2yfx4ppdXo=' 'sha256-tbWZ4NP1341cpcrZVDn7B3o9bt/muXgduILAnC0Zbaw=';
          x-content-type-options: nosniff
          strict-transport-security: max-age=31536000; includeSubDomains; preload
          vary: Accept-Encoding
          x-cache: Error from cloudfront
          via: 1.1 486e34c9a7512d6a57a32ef8a8030870.cloudfront.net (CloudFront)
          x-amz-cf-pop: ATL59-P3
          x-amz-cf-id: S5cHkECqUqsAViZafNaL_ue49ygVvLszO-JAbc7WCZIGLizXutzDQQ==
          Age: 34951
          cf-cache-status: DYNAMIC
          Server: cloudflare
          CF-RAY: 8d75b36aff60139b-ATL
          content-length: 1564
          
          
          Response body (1564 bytes)
          <!DOCTYPE html>
          <html>
          <head>
            <title>The page you were looking for doesn't exist (404)</title>
            <meta name="viewport" content="width=device-width,initial-scale=1">
            <style>
            body {
              background-color: #EFEFEF;
              color: #2E2F30;
              text-align: center;
              font-family: arial, sans-serif;
              margin: 0;
            }
          
            div.dialog {
              width: 95%;
              max-width: 33em;
              margin: 4em auto 0;
            }
          
            div.dialog > div {
              border: 1px solid #CCC;
              border-right-color: #999;
              border-left-color: #999;
              border-bottom-color: #BBB;
              border-top: #B00100 solid 4px;
              border-top-left-radius: 9px;
              border-top-right-radius: 9px;
              background-color: white;
              padding: 7px 12% 0;
              box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
            }
          
            h1 {
              font-size: 100%;
              color: #730E15;
              line-height: 1.5em;
            }
          
            div.dialog > p {
              margin: 0 0 1em;
              padding: 1em;
              background-color: #F7F7F7;
              border: 1px solid #CCC;
              border-right-color: #999;
              border-left-color: #999;
              border-bottom-color: #999;
              border-bottom-left-radius: 4px;
              border-bottom-right-radius: 4px;
              border-top-color: #DADADA;
              color: #666;
              box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
            }
            </style>
          </head>
          
          <body>
            <!-- This file lives in public/404.html -->
            <div class="dialog">
              <div>
                <h1>The page you were looking for doesn't exist.</h1>
                <p>You may have mistyped the address or the page may have moved.</p>
              </div>
              <p>If you are the application owner check the logs for more information.</p>
            </div>
          </body>
          </html>
          
          Parameter
          content-security-policy
          Evidence
          default-src https: 'self'; base-uri 'self'; child-src * blob:; connect-src api.standardnotes.com sync.standardnotes.org files.standardnotes.com ws://sockets.standardnotes.com raw.githubusercontent.com listed.to blob:; font-src * data:; form-action 'self'; frame-ancestors * file:; frame-src * blob:; img-src 'self' * data: blob:; manifest-src 'self'; media-src 'self' blob: *.standardnotes.com; object-src 'self' blob: *.standardnotes.com; script-src 'self' 'sha256-r26E+iPOhx7KM7cKn4trOSoD8u5E7wL7wwJ8UrR+rGs=' 'wasm-unsafe-eval'; style-src * 'unsafe-hashes' 'sha256-jpJOxTrdc58x4woq2mVygDDIvjIAGNkLZ2yfx4ppdXo=' 'sha256-tbWZ4NP1341cpcrZVDn7B3o9bt/muXgduILAnC0Zbaw=';
          Solution

          Ensure that your web server, application server, load balancer, etc. is properly configured to set the Content-Security-Policy header.

  3. Risk=Medium, Confidence=Medium (1)

    1. https://app.standardnotes.com (1)

      1. Cross-Domain Misconfiguration (1)
        1. GET https://app.standardnotes.com/favicon/apple-touch-icon.png
          Alert tags
          Alert description

          Web browser data loading may be possible, due to a Cross Origin Resource Sharing (CORS) misconfiguration on the web server.

          Other info

          The CORS misconfiguration on the web server permits cross-domain read requests from arbitrary third party domains, using unauthenticated APIs on this domain. Web browser implementations do not permit arbitrary third parties to read the response from authenticated APIs, however. This reduces the risk somewhat. This misconfiguration could be used by an attacker to access data that is available in an unauthenticated manner, but which uses some other form of security, such as IP address white-listing.

          Request
          Request line and header section (282 bytes)
          GET https://app.standardnotes.com/favicon/apple-touch-icon.png HTTP/1.1
          host: app.standardnotes.com
          user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0
          pragma: no-cache
          cache-control: no-cache
          referer: https://app.standardnotes.com/
          
          
          Request body (0 bytes)
          Response
          Status line and header section (1616 bytes)
          HTTP/1.1 200 OK
          Date: Thu, 24 Oct 2024 00:02:56 GMT
          Content-Type: image/png
          Content-Length: 1200
          Connection: keep-alive
          x-amz-id-2: FxkY/Xer4NherVqdqri2DzU9AoD0ssvAM1aRhobk8FnM3HaJkcNIQDzTDnPzOPL2s445jzi8Kqs=
          x-amz-request-id: P3RR729HJ8SZTV0P
          last-modified: Sat, 14 Sep 2024 09:57:21 GMT
          etag: "4fb4a113e0c95af8365b24d71ee58d37"
          vary: Accept-Encoding
          vary: Origin
          x-frame-options: SAMEORIGIN
          referrer-policy: no-referrer-when-downgrade
          content-security-policy: default-src https: 'self'; base-uri 'self'; child-src * blob:; connect-src api.standardnotes.com sync.standardnotes.org files.standardnotes.com ws://sockets.standardnotes.com raw.githubusercontent.com listed.to blob:; font-src * data:; form-action 'self'; frame-ancestors * file:; frame-src * blob:; img-src 'self' * data: blob:; manifest-src 'self'; media-src 'self' blob: *.standardnotes.com; object-src 'self' blob: *.standardnotes.com; script-src 'self' 'sha256-r26E+iPOhx7KM7cKn4trOSoD8u5E7wL7wwJ8UrR+rGs=' 'wasm-unsafe-eval'; style-src * 'unsafe-hashes' 'sha256-jpJOxTrdc58x4woq2mVygDDIvjIAGNkLZ2yfx4ppdXo=' 'sha256-tbWZ4NP1341cpcrZVDn7B3o9bt/muXgduILAnC0Zbaw=';
          x-content-type-options: nosniff
          strict-transport-security: max-age=31536000; includeSubDomains; preload
          access-control-allow-origin: *
          x-cache: Hit from cloudfront
          via: 1.1 d42a2acf7d37cb697e14666acd5e1866.cloudfront.net (CloudFront)
          x-amz-cf-pop: ATL59-P3
          x-amz-cf-id: uuHvN6DXdZW_FYnNMeF6H9bkcE95RAf04g1vYp23CP9iqdF_1x6GWA==
          Age: 2264
          Cache-Control: max-age=14400
          CF-Cache-Status: HIT
          Accept-Ranges: bytes
          Server: cloudflare
          CF-RAY: 8d75b36c9d146777-ATL
          
          
          Response body (1200 bytes)
          ‰PNG
          
          
          IHDR´´
          ögAMA±üa cHRMz&€„ú€èu0ê`:˜pœºQ<ÒPLTE	pÛ	jØpܒ¥	nÜx×eÓnÛÿÿÿm×oÚoÚoÚoÚm×
          hÖoÚoÙnØn×	oÚoÚoÙ	pÙ	pÛnØ	oÚnÙmÔoÚn×ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿmÖm×	kÕ_“áùúýÿÿÿûûû÷÷÷øøøþþþùùùòòòôôôúúúõõõýýýóóóüüüöööÈVB3tRNS	>ŠÇéú5 èýházó5à þúéNJþ>è 5àhózáý	ø-èbKGD	ñÙ¥ì	pHYsšœtIMEã:F!$IDATxÚíÝÙRâP€áv÷Ȧ¢¸+‹l‚ë0
          Šˆóþ¯$¥W–椒tGÿÿ	¾‹TõY*uDޚ[ËdsùÂÃò¹lfmNޛ_ߨ,ni«¾o«¸¹±>?3/l—vzÚ `õvJÛSòâÒîÞ¾6&xû{»K‹²¼RJ‘yª.­,ËêÁ¡¶Ã¯ÃƒU9:NÉ÷ü^ïøH2Em…oŌdO´¾d%§mð/'ym‚y1=»?¯ ڂ0
          Ú@ Aƒ6hР
          4h
          Ú@ Aƒ6hР
          4hNý7…Ém
          “»&ý4h
          Ú@ Aƒ6hÐáЃ{͆¡Ð#͞@ƒ
          4hÐáÑãgÍîáûCÕúáÐf
          ´¾@¿bk艎o"þ¤=
          4hРAbã/ƒI\Å·`²hпméL)0zü”lÿ«
          š>ƒ
          4hРG_ßFO’í1¨ùÇ-MíôoB'½õ‹Õqœ$:ª‰|h€
          4hР#BGõŸË$I´Ý@ƒm РA4hНº¬-ð¯,m‚©jü«JíTÛàÛiMê
          m„oº4[ÚßZMqí3m…_gm'ÎuºÚŸº÷†>¿H‘º{q>E‹¸fçRÛ´ËNÓÍwWíVãZÛó}׍VûÊ}¼íînêµjÅôD/Wªµú͌ü
          70RØ…ø%tEXtdate:create2019-05-12T01:29:20+02:00{]úí%tEXtdate:modify2019-05-12T01:29:20+02:00
          BQWzTXtRaw profile type iptcxœãòqV((ÊOËÌIåR#.c#K“ D€4Ãd#³T ËØÔÈÄÌÄÄˀH J.êtòB5•IEND®B`‚
          Evidence
          access-control-allow-origin: *
          Solution

          Ensure that sensitive data is not available in an unauthenticated manner (using IP address white-listing, for instance).

          Configure the "Access-Control-Allow-Origin" HTTP header to a more restrictive set of domains, or remove all CORS headers entirely, to allow the web browser to enforce the Same Origin Policy (SOP) in a more restrictive manner.

  4. Risk=Low, Confidence=Medium (3)

    1. http://localhost:3001 (2)

      1. Server Leaks Information via "X-Powered-By" HTTP Response Header Field(s) (1)
        1. GET http://localhost:3001/robots.txt
          Alert tags
          Alert description

          The web/application server is leaking information via one or more "X-Powered-By" HTTP response headers. Access to such information may facilitate attackers identifying other frameworks/components your web application is reliant upon and the vulnerabilities such components may be subject to.

          Request
          Request line and header section (208 bytes)
          GET http://localhost:3001/robots.txt HTTP/1.1
          host: localhost:3001
          user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0
          pragma: no-cache
          cache-control: no-cache
          
          
          Request body (0 bytes)
          Response
          Status line and header section (757 bytes)
          HTTP/1.1 200 OK
          X-Powered-By: Express
          Access-Control-Allow-Origin: *
          Content-Security-Policy: default-src https: 'self'; base-uri 'self'; child-src * blob:; connect-src * blob:; font-src * data:; form-action 'self'; frame-ancestors * file:; frame-src * blob:; img-src 'self' * data: blob:; manifest-src 'self'; media-src 'self' blob: *.standardnotes.com; object-src 'self' blob: *.standardnotes.com; script-src 'self' 'sha256-r26E+iPOhx7KM7cKn4trOSoD8u5E7wL7wwJ8UrR+rGs=' 'unsafe-eval' 'wasm-unsafe-eval'; style-src *;
          Content-Type: text/plain; charset=utf-8
          Accept-Ranges: bytes
          Content-Length: 30
          ETag: W/"1e-ZZs8C+SHMj4Oj6pzemNCbI0Qd5c"
          Vary: Accept-Encoding
          Date: Thu, 24 Oct 2024 00:04:44 GMT
          Connection: keep-alive
          Keep-Alive: timeout=5
          
          
          Response body (30 bytes)
          # User-agent: *
          # Disallow: /
          
          Evidence
          X-Powered-By: Express
          Solution

          Ensure that your web server, application server, load balancer, etc. is configured to suppress "X-Powered-By" headers.

      2. X-Content-Type-Options Header Missing (1)
        1. GET http://localhost:3001/robots.txt
          Alert tags
          Alert description

          The Anti-MIME-Sniffing header X-Content-Type-Options was not set to 'nosniff'. This allows older versions of Internet Explorer and Chrome to perform MIME-sniffing on the response body, potentially causing the response body to be interpreted and displayed as a content type other than the declared content type. Current (early 2014) and legacy versions of Firefox will use the declared content type (if one is set), rather than performing MIME-sniffing.

          Other info

          This issue still applies to error type pages (401, 403, 500, etc.) as those pages are often still affected by injection issues, in which case there is still concern for browsers sniffing pages away from their actual content type.

          At "High" threshold this scan rule will not alert on client or server error responses.

          Request
          Request line and header section (208 bytes)
          GET http://localhost:3001/robots.txt HTTP/1.1
          host: localhost:3001
          user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0
          pragma: no-cache
          cache-control: no-cache
          
          
          Request body (0 bytes)
          Response
          Status line and header section (757 bytes)
          HTTP/1.1 200 OK
          X-Powered-By: Express
          Access-Control-Allow-Origin: *
          Content-Security-Policy: default-src https: 'self'; base-uri 'self'; child-src * blob:; connect-src * blob:; font-src * data:; form-action 'self'; frame-ancestors * file:; frame-src * blob:; img-src 'self' * data: blob:; manifest-src 'self'; media-src 'self' blob: *.standardnotes.com; object-src 'self' blob: *.standardnotes.com; script-src 'self' 'sha256-r26E+iPOhx7KM7cKn4trOSoD8u5E7wL7wwJ8UrR+rGs=' 'unsafe-eval' 'wasm-unsafe-eval'; style-src *;
          Content-Type: text/plain; charset=utf-8
          Accept-Ranges: bytes
          Content-Length: 30
          ETag: W/"1e-ZZs8C+SHMj4Oj6pzemNCbI0Qd5c"
          Vary: Accept-Encoding
          Date: Thu, 24 Oct 2024 00:04:44 GMT
          Connection: keep-alive
          Keep-Alive: timeout=5
          
          
          Response body (30 bytes)
          # User-agent: *
          # Disallow: /
          
          Parameter
          x-content-type-options
          Solution

          Ensure that the application/web server sets the Content-Type header appropriately, and that it sets the X-Content-Type-Options header to 'nosniff' for all web pages.

          If possible, ensure that the end user uses a standards-compliant and modern web browser that does not perform MIME-sniffing at all, or that can be directed by the web application/web server to not perform MIME-sniffing.

    2. https://app.standardnotes.com (1)

      1. Private IP Disclosure (1)
        1. GET https://app.standardnotes.com/app.js
          Alert tags
          Alert description

          A private IP (such as 10.x.x.x, 172.x.x.x, 192.168.x.x) or an Amazon EC2 private hostname (for example, ip-10-0-56-78) has been found in the HTTP response body. This information might be helpful for further attacks targeting internal systems.

          Other info

          10.0.2.2

          Request
          Request line and header section (260 bytes)
          GET https://app.standardnotes.com/app.js HTTP/1.1
          host: app.standardnotes.com
          user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0
          pragma: no-cache
          cache-control: no-cache
          referer: https://app.standardnotes.com/
          
          
          Request body (0 bytes)
          Response
          Status line and header section (1606 bytes)
          HTTP/1.1 200 OK
          Date: Thu, 24 Oct 2024 00:02:56 GMT
          Content-Type: text/javascript
          Connection: keep-alive
          x-amz-id-2: qygA8vqkoNTnay5obYKWvx2TTfUFFuJ6HnW7q7ycQNKH5oFANqGBpn9vlJtqmjaNXKqno6Dz0Pc=
          x-amz-request-id: QH1GAMYCF6WH7AQV
          last-modified: Mon, 14 Oct 2024 13:09:55 GMT
          etag: W/"80832e08f7c979c6dd306e2efaf221b2"
          vary: Accept-Encoding
          vary: Origin
          x-frame-options: SAMEORIGIN
          referrer-policy: no-referrer-when-downgrade
          content-security-policy: default-src https: 'self'; base-uri 'self'; child-src * blob:; connect-src api.standardnotes.com sync.standardnotes.org files.standardnotes.com ws://sockets.standardnotes.com raw.githubusercontent.com listed.to blob:; font-src * data:; form-action 'self'; frame-ancestors * file:; frame-src * blob:; img-src 'self' * data: blob:; manifest-src 'self'; media-src 'self' blob: *.standardnotes.com; object-src 'self' blob: *.standardnotes.com; script-src 'self' 'sha256-r26E+iPOhx7KM7cKn4trOSoD8u5E7wL7wwJ8UrR+rGs=' 'wasm-unsafe-eval'; style-src * 'unsafe-hashes' 'sha256-jpJOxTrdc58x4woq2mVygDDIvjIAGNkLZ2yfx4ppdXo=' 'sha256-tbWZ4NP1341cpcrZVDn7B3o9bt/muXgduILAnC0Zbaw=';
          x-content-type-options: nosniff
          strict-transport-security: max-age=31536000; includeSubDomains; preload
          access-control-allow-origin: *
          x-cache: Miss from cloudfront
          via: 1.1 d6ada58e0613f9fa5d29f16dca3993b6.cloudfront.net (CloudFront)
          x-amz-cf-pop: ATL59-P3
          x-amz-cf-id: Gc04d9jFioWz-VXXZuLY1Hpy6o_Cy-bNjlkDIks2aTyTmf06FgiiHg==
          Cache-Control: max-age=14400
          CF-Cache-Status: HIT
          Age: 6865
          Server: cloudflare
          CF-RAY: 8d75b36cef4cbd03-ATL
          content-length: 4045834
          
          
          Response body (4045834 bytes)
          /*! For license information please see app.js.LICENSE.txt */
          (()=>{var e,t,n,r,i={87244:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContentDecoder=void 0,t.ContentDecoder=class{decode(e,t=3){try{const n=t>0?e.substring(t):e,r=Buffer.from(n,"base64").toString();return JSON.parse(r)}catch(e){return{}}}encode(e,t=3){const n=JSON.stringify(e),r=Buffer.from(n).toString("base64");return r.padStart(r.length+t,"0")}}},21467:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},35411:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},30717:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},97936:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},79955:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},85413:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EmailMessageIdentifier=void 0,(n=t.EmailMessageIdentifier||(t.EmailMessageIdentifier={})).WELCOME_EMAIL="WELCOME_EMAIL",n.ACCOUNT_CLAIM="ACCOUNT_CLAIM",n.ACCOUNT_RESET="ACCOUNT_RESET",n.ACTIVATION_CODE="ACTIVATION_CODE",n.VERSION_ADOPTION_REPORT="VERSION_ADOPTION_REPORT",n.FAILED_DROPBOX_BACKUP="FAILED_DROPBOX_BACKUP",n.FAILED_GOOGLE_DRIVE_BACKUP="FAILED_GOOGLE_DRIVE_BACKUP",n.FAILED_ONE_DRIVE_BACKUP="FAILED_ONE_DRIVE_BACKUP",n.DATA_BACKUP="DATA_BACKUP",n.FAILED_BACKUP_ATTACHMENT_TOO_BIG="FAILED_BACKUP_ATTACHMENT_TOO_BIG",n.OFFLINE_SUBSCRIPTION_ACCESS="OFFLINE_SUBSCRIPTION_ACCESS",n.SIGN_IN="SIGN_IN",n.SHARED_SUBSCRIPTION_INVITATION="SHARED_SUBSCRIPTION_INVITATION",n.ENCOURAGE_EMAIL_BACKUPS="ENCOURAGE_EMAIL_BACKUPS",n.ENCOURAGE_SUBSCRIPTION_PURCHASING="ENCOURAGE_SUBSCRIPTION_PURCHASING",n.EXIT_INTERVIEW="EXIT_INTERVIEW",n.STUDENT_DISCOUNT_REQUESTED="STUDENT_DISCOUNT_REQUESTED",n.STUDENT_DISCOUNT_APPROVED="STUDENT_DISCOUNT_APPROVED",n.MARKETING_CAMPAIGN_FILES="MARKETING_CAMPAIGN_FILES",n.MARKETING_BLACK_FRIDAY_2022="MARKETING_BLACK_FRIDAY_2022",n.MARKETING_BLACK_FRIDAY_2022_REMINDER="MARKETING_BLACK_FRIDAY_2022_REMINDER",n.PAYMENT_FAILED="PAYMENT_FAILED",n.SEND_INVOICE="SEND_INVOICE",n.DISCOUNT_NOTICE="DISCOUNT_NOTICE",n.REFUND_NOTICE="REFUND_NOTICE",n.REFUND_REQUESTED="REFUND_REQUESTED",n.RATE_ADJUSTMENT_NOTICE="RATE_ADJUSTMENT_NOTICE",n.EXIT_DISCOUNT="EXIT_DISCOUNT",n.SUBSCRIPTION_CANCELLED="SUBSCRIPTION_CANCELLED"},35219:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},89125:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},86070:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},68597:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},38427:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},45551:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9650:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.KeyParamsOrigination=void 0,(n=t.KeyParamsOrigination||(t.KeyParamsOrigination={})).Registration="registration",n.EmailChange="email-change",n.PasswordChange="password-change",n.ProtocolUpgrade="protocol-upgrade",n.PasscodeCreate="passcode-create",n.PasscodeChange="passcode-change"},32806:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PaymentType=void 0,(n=t.PaymentType||(t.PaymentType={})).Initial="initial",n.Renewal="renewal"},56253:(e,t)=>{"use strict";var n;function r(e,t){return Number(e)-Number(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.isVersionLessThanOrEqualTo=t.leftVersionGreaterThanOrEqualToRight=t.compareVersions=t.protocolVersionFromEncryptedString=t.ProtocolVersionLength=t.isProtocolVersionExpired=t.ProtocolExpirationDates=t.ProtocolVersionLastNonrootItemsKey=t.ProtocolVersionLatest=t.ProtocolVersion=void 0,function(e){e.V001="001",e.V002="002",e.V003="003",e.V004="004"}(n=t.ProtocolVersion||(t.ProtocolVersion={})),t.ProtocolVersionLatest=n.V004,t.ProtocolVersionLastNonrootItemsKey=n.V003,t.ProtocolExpirationDates=Object.freeze({[n.V001]:Date.parse("2018-01-01"),[n.V002]:Date.parse("2020-01-01")}),t.isProtocolVersionExpired=function(e){const n=t.ProtocolExpirationDates[e];return!!n&&(new Date).getTime()>n},t.ProtocolVersionLength=3,t.protocolVersionFromEncryptedString=function(e){const r=e.substring(0,t.ProtocolVersionLength);if(Object.values(n).includes(r))return r;throw Error(`Unrecognized protocol version ${r}`)},t.compareVersions=r,t.leftVersionGreaterThanOrEqualToRight=function(e,t){return r(e,t)>=0},t.isVersionLessThanOrEqualTo=function(e,t){return r(e,t)<=0}},52410:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionBillingFrequency=void 0,(n=t.SubscriptionBillingFrequency||(t.SubscriptionBillingFrequency={}))[n.Monthly=1]="Monthly",n[n.Annual=12]="Annual",n[n.FiveYear=60]="FiveYear"},74911:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionName=void 0,(n=t.SubscriptionName||(t.SubscriptionName={})).PlusPlan="PLUS_PLAN",n.ProPlan="PRO_PLAN"},83402:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},62665:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},90235:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserRequestType=void 0,(t.UserRequestType||(t.UserRequestType={})).ExitDiscount="exit-discount"},25560:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(87244),t),i(n(21467),t),i(n(35411),t),i(n(97936),t),i(n(79955),t),i(n(30717),t),i(n(85413),t),i(n(35219),t),i(n(89125),t),i(n(86070),t),i(n(68597),t),i(n(38427),t),i(n(45551),t),i(n(9650),t),i(n(32806),t),i(n(56253),t),i(n(52410),t),i(n(74911),t),i(n(83402),t),i(n(62665),t),i(n(90235),t)},20875:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(25560),t)},50569:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LegacySession=void 0;const r=n(93461),i=n(33969),o=n(42544);class s extends r.ValueObject{get accessToken(){return this.props.token}constructor(e){super(e)}static create(e){return o.Validator.isNotEmpty(e).isFailed()?i.Result.fail("Could not create legacy session. Token value is empty"):i.Result.ok(new s({token:e}))}}t.LegacySession=s},89957:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},87879:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Session=void 0;const r=n(93461),i=n(33969);class o extends r.ValueObject{get accessToken(){return this.props.accessToken}get refreshToken(){return this.props.refreshToken}isReadOnly(){return this.props.readonlyAccess||!1}constructor(e){super(e)}static create(e,t,n){return i.Result.ok(new o({accessToken:e,refreshToken:t,readonlyAccess:n}))}}t.Session=o},92932:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},65085:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionToken=void 0;const r=n(93461),i=n(33969),o=n(42544);class s extends r.ValueObject{get value(){return this.props.value}get expiresAt(){return this.props.expiresAt}constructor(e){super(e)}static create(e,t){return o.Validator.isNotEmpty(e).isFailed()?i.Result.fail("Could not create session token. Token value is empty"):o.Validator.isNotEmpty(t).isFailed()?i.Result.fail("Could not create session token. Token expiration is empty"):i.Result.ok(new s({value:e,expiresAt:t}))}}t.SessionToken=s},38487:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43324:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CacheEntry=void 0;const r=n(77546),i=n(33969);class o extends r.Entity{constructor(e,t){super(e,t)}static create(e,t){return i.Result.ok(new o(e,t))}}t.CacheEntry=o},78881:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},67794:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},84287:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContentType=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get value(){return this.props.value}constructor(e){super(e),this.displayNamesMap={[o.TYPES.ActionsExtension]:"action-based extension",[o.TYPES.Component]:"component",[o.TYPES.Editor]:"editor",[o.TYPES.File]:"file",[o.TYPES.FilesafeCredentials]:"FileSafe credential",[o.TYPES.FilesafeFileMetadata]:"FileSafe file",[o.TYPES.FilesafeIntegration]:"FileSafe integration",[o.TYPES.ItemsKey]:"encryption key",[o.TYPES.Note]:"note",[o.TYPES.SmartView]:"smart view",[o.TYPES.Tag]:"tag",[o.TYPES.Theme]:"theme",[o.TYPES.UserPrefs]:"user preferences"}}static create(e){return null===e?r.Result.ok(new o({value:null})):Object.values(this.TYPES).includes(e)?r.Result.ok(new o({value:e})):r.Result.fail(`Invalid content type: ${e}`)}getDisplayName(){return this.value?this.displayNamesMap[this.value]||this.value:null}}o.TYPES={Any:"*",Item:"SF|Item",KeySystemItemsKey:"SN|KeySystemItemsKey",KeySystemRootKey:"SN|KeySystemRootKey",TrustedContact:"SN|TrustedContact",VaultListing:"SN|VaultListing",RootKey:"SN|RootKey|NoSync",ItemsKey:"SN|ItemsKey",EncryptedStorage:"SN|EncryptedStorage",Note:"Note",Tag:"Tag",SmartView:"SN|SmartTag",Component:"SN|Component",Editor:"SN|Editor",ActionsExtension:"Extension",UserPrefs:"SN|UserPreferences",HistorySession:"SN|HistorySession",Theme:"SN|Theme",File:"SN|File",FilesafeCredentials:"SN|FileSafe|Credentials",FilesafeFileMetadata:"SN|FileSafe|FileMetadata",FilesafeIntegration:"SN|FileSafe|Integration",ExtensionRepo:"SN|ExtensionRepo"},t.ContentType=o},4273:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},92339:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Dates=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get createdAt(){return this.props.createdAt}get updatedAt(){return this.props.updatedAt}constructor(e){super(e)}static create(e,t){return e instanceof Date?t instanceof Date?r.Result.ok(new o({createdAt:e,updatedAt:t})):r.Result.fail(`Could not create Dates. Update date should be a date object, given: ${t}`):r.Result.fail(`Could not create Dates. Creation date should be a date object, given: ${e}`)}}t.Dates=o},57154:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},63666:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Email=void 0;const r=n(93461),i=n(33969),o=n(42544);class s extends r.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){if(o.Validator.isString(e).isFailed())return i.Result.fail("Email must be a string");const t=e.trim().toLowerCase(),n=o.Validator.isValidEmail(t);return n.isFailed()?i.Result.fail(n.getError()):i.Result.ok(new s({value:t}))}}t.Email=s},63931:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},65180:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RoleName=void 0;const r=n(93461),i=n(33969);class o extends r.ValueObject{get value(){return this.props.value}hasMoreOrEqualPowerTo(e){switch(this.value){case o.NAMES.InternalTeamUser:return!0;case o.NAMES.ProUser:return[o.NAMES.CoreUser,o.NAMES.PlusUser,o.NAMES.ProUser].includes(e.value);case o.NAMES.PlusUser:return[o.NAMES.CoreUser,o.NAMES.PlusUser].includes(e.value);case o.NAMES.CoreUser:case o.NAMES.VaultsUser:return[o.NAMES.CoreUser].includes(e.value);default:throw new Error(`Invalid role name: ${this.value}`)}}constructor(e){super(e)}static create(e){return Object.values(this.NAMES).includes(e)?i.Result.ok(new o({value:e})):i.Result.fail(`Invalid role name: ${e}`)}}o.NAMES={CoreUser:"CORE_USER",PlusUser:"PLUS_USER",ProUser:"PRO_USER",InternalTeamUser:"INTERNAL_TEAM_USER",VaultsUser:"VAULTS_USER"},t.RoleName=o},60216:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RoleNameCollection=void 0;const r=n(93461),i=n(33969),o=n(65180);class s extends r.ValueObject{get value(){return this.props.value}includes(e){for(const t of this.props.value)if(t.value===e.value)return!0;return!1}hasARoleNameWithMoreOrEqualPowerTo(e){for(const t of this.props.value)if(t.hasMoreOrEqualPowerTo(e))return!0;return!1}equals(e){if(this.props.value.length!==e.value.length)return!1;for(const t of e.value)if(!this.includes(t))return!1;return!0}constructor(e){super(e)}static create(e){const t=[];for(const n of e){const e=o.RoleName.create(n);if(e.isFailed())return i.Result.fail(e.getError());t.push(e.getValue())}return i.Result.ok(new s({value:t}))}}t.RoleNameCollection=s},78060:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},49565:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},77803:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Timestamps=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get createdAt(){return this.props.createdAt}get updatedAt(){return this.props.updatedAt}constructor(e){super(e)}static create(e,t){return isNaN(e)||"number"!=typeof e?r.Result.fail(`Could not create Timestamps. Creation date should be a number, given: ${e}`):isNaN(t)||"number"!=typeof t?r.Result.fail(`Could not create Timestamps. Update date should be a number, given: ${t}`):r.Result.ok(new o({createdAt:e,updatedAt:t}))}}t.Timestamps=o},95332:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},96806:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Username=void 0;const r=n(93461),i=n(33969),o=n(42544);class s extends r.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){if(o.Validator.isString(e).isFailed())return i.Result.fail("Username must be a string");const t=e.trim().toLowerCase();return o.Validator.isNotEmpty(t).isFailed()?i.Result.fail("Username cannot be empty"):i.Result.ok(new s({value:t}))}isPotentiallyAPrivateUsernameAccount(){return 64===this.value.length&&!this.value.includes("@")}}t.Username=s},29835:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},26477:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Uuid=void 0;const r=n(93461),i=n(33969),o=n(42544);class s extends r.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){const t=o.Validator.isValidUuid(e);return t.isFailed()?i.Result.fail(t.getError()):i.Result.ok(new s({value:e}))}}t.Uuid=s},55928:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},69838:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Aggregate=void 0;const r=n(77546);class i extends r.Entity{constructor(){super(...arguments),this.changesOnAggregateRoot=[]}addChange(e){this.changesOnAggregateRoot.push(e)}flushChanges(){this.changesOnAggregateRoot=[]}getChanges(){return this.changesOnAggregateRoot}}t.Aggregate=i},39653:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Change=void 0;const r=n(33969);class i{constructor(e){this.props=Object.freeze(e)}static create(e){return Object.values(i.TYPES).includes(e.changeType)?r.Result.ok(new i(e)):r.Result.fail("Invalid change type")}}i.TYPES={Add:"add",Remove:"remove",Modify:"modify"},t.Change=i},24128:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},77546:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Entity=void 0;const r=n(85193);class i{constructor(e,t){this.props=e,this._id=t||new r.UniqueEntityId}get id(){return this._id}equals(e){return null!=e&&null!=e&&(this===e||e instanceof i&&this._id.equals(e._id))}}t.Entity=i},2602:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Id=void 0,t.Id=class{constructor(e){this.value=e}equals(e){return null!=e&&e instanceof this.constructor&&e.toValue()===this.value}toString(){return String(this.value)}toValue(){return this.value}}},33969:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Result=void 0;class n{constructor(e,t,n){this.isSuccess=e,this.error=t,this.value=n,Object.freeze(this)}isFailed(){return!this.isSuccess}getValue(){if(!this.isSuccess)throw new Error(`Cannot get value of an unsuccessfull result: ${this.error}`);return this.value}getError(){if(this.isSuccess||void 0===this.error)throw new Error("Cannot get an error of a successfull result");return this.error}static ok(e){return new n(!0,void 0,e)}static fail(e){return new n(!1,e)}}t.Result=n},85193:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueEntityId=void 0;const r=n(60130),i=n(2602);class o extends i.Id{constructor(e){super(e||(0,r.v4)())}}t.UniqueEntityId=o},42544:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Validator=void 0;const r=n(33969);class i{static isValidUuid(e){return null!==String(e).toLowerCase().match(i.UUID_ANY_VERSION_AND_VARIANT_REGEX)?r.Result.ok():r.Result.fail(`Given value is not a valid uuid: ${e}`)}static isValidEmail(e){return null!==String(e).toLowerCase().match(i.EMAIL_REGEX)?r.Result.ok():r.Result.fail(`Given value is not a valid email address: ${e}`)}static isString(e){return"string"==typeof e?r.Result.ok():r.Result.fail("Given value is not a string: "+typeof e)}static isNotEmpty(e){return e instanceof Array&&0===e.length||null==e||""===e?r.Result.fail(`Given value is empty: ${e}`):r.Result.ok()}static isNotEmptyString(e){const t=i.isString(e);if(t.isFailed())return t;const n=i.isNotEmpty(e);return n.isFailed()?n:r.Result.ok()}}i.UUID_ANY_VERSION_AND_VARIANT_REGEX=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,i.EMAIL_REGEX=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,t.Validator=i},93461:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueObject=void 0,t.ValueObject=class{constructor(e){this.props=Object.freeze(e)}equals(e){return null!=e&&JSON.stringify(this.props)===JSON.stringify(e.props)}}},21797:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},82806:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ControllerContainer=void 0,t.ControllerContainer=class{constructor(){this.controllerMethodsMap=new Map}register(e,t){this.controllerMethodsMap.set(e,t)}get(e){return this.controllerMethodsMap.get(e)}}},30048:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},95951:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmailLevel=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){return Object.values(this.LEVELS).includes(e)?r.Result.ok(new o({value:e})):r.Result.fail(`Invalid subscription rejection level: ${e}`)}}o.LEVELS={System:"SYSTEM",SignIn:"SIGN_IN",Marketing:"MARKETING",FailedCloudBackup:"FAILED_CLOUD_BACKUP",FailedEmailBackup:"FAILED_EMAIL_BACKUP"},t.EmailLevel=o},78690:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},12677:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractEnv=void 0,t.AbstractEnv=class{constructor(e={}){this.env={},this.overrides=e}get(e,t=!1){if(this.env||this.load(),this.overrides[e])return this.overrides[e];if(!process.env[e]&&!t)throw new Error(`Environment variable ${e} not set`);return process.env[e]}getAll(){return this.env||this.load(),this.env}}},49321:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},26112:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationPayload=void 0;const r=n(93461),i=n(33969),o=n(1166),s=n(26477),a=n(63011);class l extends r.ValueObject{constructor(e){super(e)}toString(){var e,t;return JSON.stringify({version:this.props.version,type:this.props.type.value,primaryIdentifier:this.props.primaryIdentifier.value,primaryIndentifierType:this.props.primaryIndentifierType.value,secondaryIdentifier:null===(e=this.props.secondaryIdentifier)||void 0===e?void 0:e.value,secondaryIdentifierType:null===(t=this.props.secondaryIdentifierType)||void 0===t?void 0:t.value})}static createFromString(e){try{const t=JSON.parse(e),n=o.NotificationType.create(t.type);if(n.isFailed())return i.Result.fail(n.getError());const r=n.getValue(),c=s.Uuid.create(t.primaryIdentifier);if(c.isFailed())return i.Result.fail(c.getError());const u=c.getValue(),d=a.NotificationPayloadIdentifierType.create(t.primaryIndentifierType);if(d.isFailed())return i.Result.fail(d.getError());const h=d.getValue();let p,f;if(t.secondaryIdentifier){const e=s.Uuid.create(t.secondaryIdentifier);if(e.isFailed())return i.Result.fail(e.getError());p=e.getValue()}if(t.secondaryIdentifierType){const e=a.NotificationPayloadIdentifierType.create(t.secondaryIdentifierType);if(e.isFailed())return i.Result.fail(e.getError());f=e.getValue()}return l.create({version:t.version,type:r,primaryIdentifier:u,primaryIndentifierType:h,secondaryIdentifier:p,secondaryIdentifierType:f})}catch(e){return i.Result.fail(e.message)}}static create(e){return void 0===e.secondaryIdentifier&&e.type.equals(o.NotificationType.create(o.NotificationType.TYPES.SharedVaultItemRemoved).getValue())?i.Result.fail(`Item uuid is required for ${o.NotificationType.TYPES.SharedVaultItemRemoved} notification type`):i.Result.ok(new l(e))}}t.NotificationPayload=l},63011:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationPayloadIdentifierType=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{constructor(e){super(e)}get value(){return this.props.value}static create(e){return Object.values(this.TYPES).includes(e)?r.Result.ok(new o({value:e})):r.Result.fail(`Invalid notification payload identifier type: ${e}`)}}o.TYPES={SharedVaultUuid:"shared_vault_uuid",UserUuid:"user_uuid",SharedVaultInviteUuid:"shared_vault_invite_uuid",ItemUuid:"item_uuid"},t.NotificationPayloadIdentifierType=o},33980:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},98719:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1166:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationType=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){return Object.values(this.TYPES).includes(e)?r.Result.ok(new o({value:e})):r.Result.fail(`Invalid notification type: ${e}`)}}o.TYPES={SharedVaultItemRemoved:"shared_vault_item_removed",SelfRemovedFromSharedVault:"self_removed_from_shared_vault",UserRemovedFromSharedVault:"user_removed_from_shared_vault",UserDesignatedAsSurvivor:"user_designated_as_survivor",UserAddedToSharedVault:"user_added_to_shared_vault",SharedVaultInviteCanceled:"shared_vault_invite_canceled",SharedVaultFileUploaded:"shared_vault_file_uploaded",SharedVaultFileRemoved:"shared_vault_file_removed"},t.NotificationType=o},33479:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},98401:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},93738:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceContainer=void 0,t.ServiceContainer=class{constructor(){this.serviceMap=new Map}register(e,t){this.serviceMap.set(e.value,t)}get(e){return this.serviceMap.get(e.value)}}},19055:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5775:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceIdentifier=void 0;const r=n(93461),i=n(33969);class o extends r.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){return Object.values(this.NAMES).includes(e)?i.Result.ok(new o({value:e})):i.Result.fail(`Invalid subscription plan name: ${e}`)}}o.NAMES={AnalyticsWorker:"AnalyticsWorker",AnalyticsScheduledTask:"AnalyticsScheduledTask",ApiGateway:"ApiGateway",Auth:"Auth",AuthWorker:"AuthWorker",AuthScheduledTask:"AuthScheduledTask",SyncingServer:"SyncingServer",SyncingServerWorker:"SyncingServerWorker",Revisions:"Revisions",RevisionsWorker:"RevisionsWorker",Files:"Files",FilesWorker:"FilesWorker",SchedulerWorker:"SchedulerWorker",SchedulerScheduledTask:"SchedulerScheduledTask",Email:"Email",EmailWorker:"EmailWorker",EmailBounceProcessor:"EmailBounceProcessor",EmailScheduledTask:"EmailScheduledTask",Websockets:"Websockets",WebsocketsWorker:"WebsocketsWorker"},t.ServiceIdentifier=o},55334:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},35491:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},41406:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SettingName=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get value(){return this.props.value}isSensitive(){return[o.NAMES.MfaSecret,o.NAMES.ExtensionKey].includes(this.props.value)}isASubscriptionSetting(){return[o.NAMES.FileUploadBytesLimit,o.NAMES.FileUploadBytesUsed,o.NAMES.MuteSignInEmails].includes(this.props.value)}isARegularOnlySubscriptionSetting(){return[o.NAMES.FileUploadBytesLimit,o.NAMES.FileUploadBytesUsed].includes(this.props.value)}isASharedAndRegularOnlySubscriptionSetting(){return[o.NAMES.MuteSignInEmails].includes(this.props.value)}constructor(e){super(e)}static create(e){return Object.values(this.NAMES).includes(e)?r.Result.ok(new o({value:e})):r.Result.fail(`Invalid setting name: ${e}`)}}o.NAMES={MfaSecret:"MFA_SECRET",ExtensionKey:"EXTENSION_KEY",EmailBackupFrequency:"EMAIL_BACKUP_FREQUENCY",DropboxBackupFrequency:"DROPBOX_BACKUP_FREQUENCY",DropboxBackupToken:"DROPBOX_BACKUP_TOKEN",OneDriveBackupFrequency:"ONE_DRIVE_BACKUP_FREQUENCY",OneDriveBackupToken:"ONE_DRIVE_BACKUP_TOKEN",GoogleDriveBackupFrequency:"GOOGLE_DRIVE_BACKUP_FREQUENCY",GoogleDriveBackupToken:"GOOGLE_DRIVE_BACKUP_TOKEN",MuteFailedBackupsEmails:"MUTE_FAILED_BACKUPS_EMAILS",MuteFailedCloudBackupsEmails:"MUTE_FAILED_CLOUD_BACKUPS_EMAILS",MuteSignInEmails:"MUTE_SIGN_IN_EMAILS",MuteMarketingEmails:"MUTE_MARKETING_EMAILS",ListedAuthorSecrets:"LISTED_AUTHOR_SECRETS",LogSessionUserAgent:"LOG_SESSION_USER_AGENT",RecoveryCodes:"RECOVERY_CODES",FileUploadBytesLimit:"FILE_UPLOAD_BYTES_LIMIT",FileUploadBytesUsed:"FILE_UPLOAD_BYTES_USED"},t.SettingName=o},10262:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},94478:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultUser=void 0;const r=n(77546),i=n(33969);class o extends r.Entity{constructor(e,t){super(e,t)}static create(e,t){return i.Result.ok(new o(e,t))}}t.SharedVaultUser=o},95626:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultUserPermission=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){return Object.values(this.PERMISSIONS).includes(e)?r.Result.ok(new o({value:e})):r.Result.fail(`Invalid shared vault user permission ${e}`)}}o.PERMISSIONS={Read:"read",Write:"write",Admin:"admin"},t.SharedVaultUserPermission=o},27369:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},76226:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},96829:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionPlanName=void 0;const r=n(93461),i=n(33969);class o extends r.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){return Object.values(this.NAMES).includes(e)?i.Result.ok(new o({value:e})):i.Result.fail(`Invalid subscription plan name: ${e}`)}}o.NAMES={PlusPlan:"PLUS_PLAN",ProPlan:"PRO_PLAN"},t.SubscriptionPlanName=o},13709:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},11829:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},17505:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},69749:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(50569),t),i(n(89957),t),i(n(87879),t),i(n(92932),t),i(n(65085),t),i(n(38487),t),i(n(43324),t),i(n(78881),t),i(n(67794),t),i(n(84287),t),i(n(4273),t),i(n(92339),t),i(n(57154),t),i(n(63666),t),i(n(63931),t),i(n(65180),t),i(n(49565),t),i(n(60216),t),i(n(78060),t),i(n(77803),t),i(n(95332),t),i(n(96806),t),i(n(29835),t),i(n(26477),t),i(n(55928),t),i(n(69838),t),i(n(39653),t),i(n(24128),t),i(n(77546),t),i(n(2602),t),i(n(33969),t),i(n(85193),t),i(n(42544),t),i(n(93461),t),i(n(21797),t),i(n(82806),t),i(n(30048),t),i(n(95951),t),i(n(78690),t),i(n(12677),t),i(n(49321),t),i(n(26112),t),i(n(63011),t),i(n(33980),t),i(n(98719),t),i(n(1166),t),i(n(33479),t),i(n(98401),t),i(n(93738),t),i(n(19055),t),i(n(5775),t),i(n(55334),t),i(n(35491),t),i(n(41406),t),i(n(10262),t),i(n(94478),t),i(n(95626),t),i(n(27369),t),i(n(76226),t),i(n(96829),t),i(n(13709),t),i(n(11829),t),i(n(17505),t)},82648:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(69749),t)},26927:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ApiVersion=void 0,function(e){e.v0="20200115",e.v1="20240226"}(n||(t.ApiVersion=n={}))},57819:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(26927),t)},7941:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.AuthApiOperations=void 0,function(e){e[e.GenerateRecoveryCodes=0]="GenerateRecoveryCodes",e[e.GetRecoveryKeyParams=1]="GetRecoveryKeyParams",e[e.SignInWithRecoveryCodes=2]="SignInWithRecoveryCodes"}(n||(t.AuthApiOperations=n={}))},80605:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AuthApiService=void 0;const i=n(29898),o=n(38130),s=n(7941);t.AuthApiService=class{constructor(e,t){this.authServer=e,this.apiVersion=t,this.operationsInProgress=new Map}generateRecoveryCodes(){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthApiOperations.GenerateRecoveryCodes))throw new i.ApiCallError(o.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthApiOperations.GenerateRecoveryCodes,!0);try{return yield this.authServer.generateRecoveryCodes()}catch(e){throw new i.ApiCallError(o.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthApiOperations.GenerateRecoveryCodes,!1)}}))}recoveryKeyParams(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthApiOperations.GetRecoveryKeyParams))throw new i.ApiCallError(o.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthApiOperations.GetRecoveryKeyParams,!0);try{return yield this.authServer.recoveryKeyParams({api_version:this.apiVersion,code_challenge:e.codeChallenge,recovery_codes:e.recoveryCodes,username:e.username})}catch(e){throw new i.ApiCallError(o.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthApiOperations.GetRecoveryKeyParams,!1)}}))}signInWithRecoveryCodes(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthApiOperations.SignInWithRecoveryCodes))throw new i.ApiCallError(o.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthApiOperations.SignInWithRecoveryCodes,!0);try{return yield this.authServer.signInWithRecoveryCodes({api_version:this.apiVersion,code_verifier:e.codeVerifier,password:e.password,recovery_codes:e.recoveryCodes,username:e.username,hvm_token:e.hvmToken})}catch(e){throw new i.ApiCallError(o.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthApiOperations.SignInWithRecoveryCodes,!1)}}))}}},73987:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},66527:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.AuthenticatorApiOperations=void 0,function(e){e[e.List=0]="List",e[e.Delete=1]="Delete",e[e.GenerateRegistrationOptions=2]="GenerateRegistrationOptions",e[e.GenerateAuthenticationOptions=3]="GenerateAuthenticationOptions",e[e.VerifyRegistrationResponse=4]="VerifyRegistrationResponse"}(n||(t.AuthenticatorApiOperations=n={}))},60356:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AuthenticatorApiService=void 0;const i=n(38130),o=n(29898),s=n(66527);t.AuthenticatorApiService=class{constructor(e){this.authenticatorServer=e,this.operationsInProgress=new Map}list(){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthenticatorApiOperations.List))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthenticatorApiOperations.List,!0);try{return yield this.authenticatorServer.list({})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthenticatorApiOperations.List,!1)}}))}delete(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthenticatorApiOperations.Delete))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthenticatorApiOperations.Delete,!0);try{return yield this.authenticatorServer.delete({authenticatorId:e})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthenticatorApiOperations.Delete,!1)}}))}generateRegistrationOptions(){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthenticatorApiOperations.GenerateRegistrationOptions))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthenticatorApiOperations.GenerateRegistrationOptions,!0);try{return yield this.authenticatorServer.generateRegistrationOptions()}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthenticatorApiOperations.GenerateRegistrationOptions,!1)}}))}verifyRegistrationResponse(e,t,n){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthenticatorApiOperations.VerifyRegistrationResponse))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthenticatorApiOperations.VerifyRegistrationResponse,!0);try{return yield this.authenticatorServer.verifyRegistrationResponse({userUuid:e,name:t,attestationResponse:n})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthenticatorApiOperations.VerifyRegistrationResponse,!1)}}))}generateAuthenticationOptions(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthenticatorApiOperations.GenerateAuthenticationOptions))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthenticatorApiOperations.GenerateAuthenticationOptions,!0);try{return yield this.authenticatorServer.generateAuthenticationOptions({username:e})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthenticatorApiOperations.GenerateAuthenticationOptions,!1)}}))}}},4405:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},23624:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.RevisionApiOperations=void 0,function(e){e[e.List=0]="List",e[e.Delete=1]="Delete",e[e.Get=2]="Get"}(n||(t.RevisionApiOperations=n={}))},33416:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RevisionApiService=void 0;const i=n(38130),o=n(29898),s=n(23624);t.RevisionApiService=class{constructor(e){this.revisionServer=e,this.operationsInProgress=new Map}listRevisions(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.RevisionApiOperations.List))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.RevisionApiOperations.List,!0);try{return yield this.revisionServer.listRevisions({itemUuid:e})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.RevisionApiOperations.List,!1)}}))}getRevision(e,t){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.RevisionApiOperations.Get))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.RevisionApiOperations.Get,!0);try{return yield this.revisionServer.getRevision({itemUuid:e,revisionUuid:t})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.RevisionApiOperations.Get,!1)}}))}deleteRevision(e,t){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.RevisionApiOperations.Delete))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.RevisionApiOperations.Delete,!0);try{return yield this.revisionServer.deleteRevision({itemUuid:e,revisionUuid:t})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.RevisionApiOperations.Delete,!1)}}))}}},68888:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},17737:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionApiOperations=void 0,function(e){e[e.Inviting=0]="Inviting",e[e.CancelingInvite=1]="CancelingInvite",e[e.ListingInvites=2]="ListingInvites",e[e.AcceptingInvite=3]="AcceptingInvite",e[e.ConfirmAppleIAP=4]="ConfirmAppleIAP",e[e.GetSubscription=5]="GetSubscription",e[e.GetAvailableSubscriptions=6]="GetAvailableSubscriptions"}(n||(t.SubscriptionApiOperations=n={}))},37856:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionApiService=void 0;const i=n(38130),o=n(29898),s=n(95658),a=n(17737);t.SubscriptionApiService=class{constructor(e,t){this.subscriptionServer=e,this.apiVersion=t,this.operationsInProgress=new Map}listInvites(){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.ListingInvites))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.ListingInvites,!0);try{return yield this.subscriptionServer.listInvites({[s.ApiEndpointParam.ApiVersion]:this.apiVersion})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.ListingInvites,!1)}}))}cancelInvite(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.CancelingInvite))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.CancelingInvite,!0);try{return yield this.subscriptionServer.cancelInvite({[s.ApiEndpointParam.ApiVersion]:this.apiVersion,inviteUuid:e})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.CancelingInvite,!1)}}))}invite(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.Inviting))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.Inviting,!0);try{return yield this.subscriptionServer.invite({[s.ApiEndpointParam.ApiVersion]:this.apiVersion,identifier:e})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.Inviting,!1)}}))}acceptInvite(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.AcceptingInvite))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.AcceptingInvite,!0);try{return yield this.subscriptionServer.acceptInvite({inviteUuid:e})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.AcceptingInvite,!1)}}))}confirmAppleIAP(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.ConfirmAppleIAP))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.ConfirmAppleIAP,!0);try{return yield this.subscriptionServer.confirmAppleIAP(e)}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.ConfirmAppleIAP,!1)}}))}getUserSubscription(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.GetSubscription))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.GetSubscription,!0);try{return yield this.subscriptionServer.getUserSubscription(e)}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.GetSubscription,!1)}}))}getAvailableSubscriptions(){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.GetAvailableSubscriptions))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.GetAvailableSubscriptions,!0);try{return yield this.subscriptionServer.getAvailableSubscriptions()}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.GetAvailableSubscriptions,!1)}}))}}},57898:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},13167:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.UserApiOperations=void 0,function(e){e[e.Registering=0]="Registering",e[e.SubmittingRequest=1]="SubmittingRequest",e[e.DeletingAccount=2]="DeletingAccount",e[e.UpdatingUser=3]="UpdatingUser"}(n||(t.UserApiOperations=n={}))},45869:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.UserApiService=void 0;const i=n(38130),o=n(29898),s=n(95658),a=n(13167);t.UserApiService=class{constructor(e,t,n){this.userServer=e,this.userRequestServer=t,this.apiVersion=n,this.operationsInProgress=new Map}deleteAccount(e){return r(this,void 0,void 0,(function*(){this.lockOperation(a.UserApiOperations.DeletingAccount);try{const t=yield this.userServer.deleteAccount({userUuid:e});return this.unlockOperation(a.UserApiOperations.DeletingAccount),t}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}}))}submitUserRequest(e){return r(this,void 0,void 0,(function*(){this.lockOperation(a.UserApiOperations.SubmittingRequest);try{const t=yield this.userRequestServer.submitUserRequest({userUuid:e.userUuid,requestType:e.requestType});return this.unlockOperation(a.UserApiOperations.SubmittingRequest),t}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}}))}register(e){return r(this,void 0,void 0,(function*(){this.lockOperation(a.UserApiOperations.Registering);try{const t=yield this.userServer.register(Object.assign({[s.ApiEndpointParam.ApiVersion]:this.apiVersion,password:e.serverPassword,email:e.email,hvm_token:e.hvmToken,ephemeral:e.ephemeral},e.keyParams.getPortableValue()));return this.unlockOperation(a.UserApiOperations.Registering),t}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericRegistrationFail)}}))}updateUser(e){return r(this,void 0,void 0,(function*(){this.lockOperation(a.UserApiOperations.UpdatingUser);try{const t=yield this.userServer.update({[s.ApiEndpointParam.ApiVersion]:this.apiVersion,user_uuid:e.userUuid});return this.unlockOperation(a.UserApiOperations.UpdatingUser),t}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}}))}lockOperation(e){if(this.operationsInProgress.get(e))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(e,!0)}unlockOperation(e){this.operationsInProgress.set(e,!1)}}},56824:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},67958:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.WebSocketApiOperations=void 0,function(e){e[e.CreatingConnectionToken=0]="CreatingConnectionToken"}(n||(t.WebSocketApiOperations=n={}))},62984:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.WebSocketApiService=void 0;const i=n(38130),o=n(29898),s=n(67958);t.WebSocketApiService=class{constructor(e){this.webSocketServer=e,this.operationsInProgress=new Map}createConnectionToken(){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.WebSocketApiOperations.CreatingConnectionToken))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.WebSocketApiOperations.CreatingConnectionToken,!0);try{const e=yield this.webSocketServer.createConnectionToken({});return this.operationsInProgress.set(s.WebSocketApiOperations.CreatingConnectionToken,!1),e}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}}))}}},95736:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},37729:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7941),t),i(n(80605),t),i(n(73987),t),i(n(66527),t),i(n(60356),t),i(n(4405),t),i(n(23624),t),i(n(33416),t),i(n(68888),t),i(n(17737),t),i(n(37856),t),i(n(57898),t),i(n(13167),t),i(n(45869),t),i(n(56824),t),i(n(62984),t),i(n(95736),t)},29898:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ApiCallError=void 0;class n extends Error{constructor(e){super(e),Object.setPrototypeOf(this,n.prototype)}}t.ApiCallError=n},38130:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorMessage=void 0,function(e){e.RegistrationInProgress="An existing registration request is already in progress.",e.GenericRegistrationFail="A server error occurred while trying to register. Please try again.",e.RateLimited="Too many successive server requests. Please wait a few minutes and try again.",e.InsufficientPasswordMessage="Your password must be at least %LENGTH% characters in length. For your security, please choose a longer password or, ideally, a passphrase, and try again.",e.PasscodeRequired="Your passcode is required in order to register for an account.",e.GenericInProgress="An existing request is already in progress.",e.GenericFail="A server error occurred. Please try again."}(n||(t.ErrorMessage=n={}))},65148:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(29898),t),i(n(38130),t)},60256:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.FetchRequestHandler=void 0;const i=n(95658),o=n(22325),s=n(76635),a=n(65148);t.FetchRequestHandler=class{constructor(e,t,n,r){this.snjsVersion=e,this.appVersion=t,this.environment=n,this.logger=r}handleRequest(e){return r(this,void 0,void 0,(function*(){const t=this.createRequest(e);return yield this.runRequest(t,this.createRequestBody(e))}))}createRequest(e){e.params&&e.verb===i.HttpVerb.Get&&Object.keys(e.params).length>0&&(e.url=this.urlForUrlAndParams(e.url,e.params));const t={};if(!e.external){t["X-SNJS-Version"]=this.snjsVersion;const n=`${o.Environment[this.environment]}-${this.appVersion}`;t["X-Application-Version"]=n,e.authentication&&(t.Authorization="Bearer "+e.authentication)}let n=!1;return e.customHeaders&&e.customHeaders.length>0&&e.customHeaders.forEach((({key:e,value:r})=>{t[e]=r,"Content-Type"===e&&(n=!0)})),n||e.external||(t["Content-Type"]="application/json"),new Request(e.url,{method:e.verb,headers:t,credentials:"include"})}runRequest(e,t){return r(this,void 0,void 0,(function*(){try{const n=yield fetch(e,{body:t});return yield this.handleFetchResponse(n)}catch(e){return{status:i.HttpStatusCode.InternalServerError,headers:new Map,data:{error:{message:"message"in e?e.message:"Unknown error"}}}}}))}handleFetchResponse(e){var t,n;return r(this,void 0,void 0,(function*(){const r=e.status,o={status:r,headers:new Map,data:{}};e.headers.forEach(((e,t)=>{o.headers.set(t,e)}));try{if(r!==i.HttpStatusCode.NoContent){let r;const i=(null===(t=o.headers)||void 0===t?void 0:t.get("content-type"))||(null===(n=o.headers)||void 0===n?void 0:n.get("Content-Type"));r=(null==i?void 0:i.includes("application/json"))?JSON.parse(yield e.text()):yield e.arrayBuffer(),r.data||(o.data=r),(0,s.isString)(r)||Object.assign(o,r)}}catch(e){this.logger.error(JSON.stringify(e))}if(r>=i.HttpStatusCode.Success&&r<i.HttpStatusCode.InternalServerError)return r===i.HttpStatusCode.Forbidden&&(0,i.isErrorResponse)(o)&&(o.data.error?o.data.error.message=a.ErrorMessage.RateLimited:o.data.error={message:a.ErrorMessage.RateLimited}),o;{const e=o;return e.data||(e.data={error:{message:"Unknown error"}}),(0,s.isString)(e.data)&&(e.data={error:{message:e.data}}),e.data.error||(e.data.error={message:"Unknown error"}),e}}))}urlForUrlAndParams(e,t){const n=Object.keys(t).map((e=>e+"="+encodeURIComponent(t[e]))).join("&");return e.includes("?")?e+"&"+n:e+"?"+n}createRequestBody(e){return void 0!==e.params&&[i.HttpVerb.Post,i.HttpVerb.Put,i.HttpVerb.Patch,i.HttpVerb.Delete].includes(e.verb)?JSON.stringify(e.params):e.rawBytes}}},56176:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},93763:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.HttpService=void 0;const i=n(87901),o=n(82648),s=n(95658),a=n(41325),l=n(60256);t.HttpService=class{constructor(e,t,n,r,i){this.environment=e,this.appVersion=t,this.snjsVersion=n,this.apiVersion=r,this.logger=i,this.__simulateNextSessionRefreshResponseDrop=!1,this.loggingEnabled=!1,this.requestHandler=new l.FetchRequestHandler(this.snjsVersion,this.appVersion,this.environment,this.logger)}setCallbacks(e,t){this.updateMetaCallback=e,this.refreshSessionCallback=t}deinit(){this.session=void 0,this.updateMetaCallback=void 0,this.refreshSessionCallback=void 0}setSession(e){this.session=e}setHost(e){this.host=e}getHost(){return this.host}getSessionAccessToken(){if(this.session)return this.session instanceof o.Session?this.session.accessToken.value:this.session.accessToken}get(e,t,n){var o;return r(this,void 0,void 0,(function*(){if(!this.host)throw new Error("Attempting to make network request before host is set");return this.runHttp({url:(0,i.joinPaths)(this.host,e),params:t,verb:s.HttpVerb.Get,authentication:null!==(o=null==n?void 0:n.authentication)&&void 0!==o?o:this.getSessionAccessToken()})}))}getExternal(e,t){return r(this,void 0,void 0,(function*(){return this.runHttp({url:e,params:t,verb:s.HttpVerb.Get,external:!0})}))}post(e,t,n){var o;return r(this,void 0,void 0,(function*(){if(!this.host)throw new Error("Attempting to make network request before host is set");return this.runHttp({url:(0,i.joinPaths)(this.host,e),params:t,verb:s.HttpVerb.Post,authentication:null!==(o=null==n?void 0:n.authentication)&&void 0!==o?o:this.getSessionAccessToken(),customHeaders:null==n?void 0:n.headers})}))}put(e,t,n){var o;return r(this,void 0,void 0,(function*(){return this.runHttp({url:(0,i.joinPaths)(this.host,e),params:t,verb:s.HttpVerb.Put,authentication:null!==(o=null==n?void 0:n.authentication)&&void 0!==o?o:this.getSessionAccessToken()})}))}patch(e,t,n){var o;return r(this,void 0,void 0,(function*(){return this.runHttp({url:(0,i.joinPaths)(this.host,e),params:t,verb:s.HttpVerb.Patch,authentication:null!==(o=null==n?void 0:n.authentication)&&void 0!==o?o:this.getSessionAccessToken()})}))}delete(e,t,n){var o;return r(this,void 0,void 0,(function*(){return this.runHttp({url:(0,i.joinPaths)(this.host,e),params:t,verb:s.HttpVerb.Delete,authentication:null!==(o=null==n?void 0:n.authentication)&&void 0!==o?o:this.getSessionAccessToken()})}))}runHttp(e){var t;return r(this,void 0,void 0,(function*(){this.__latencySimulatorMs&&(yield(0,i.sleep)(this.__latencySimulatorMs,!0)),e.params=e.params?this.params(e.params):void 0;const n=e.url===(0,i.joinPaths)(this.host,a.Paths.v1.refreshSession);this.inProgressRefreshSessionPromise&&!n&&(yield this.inProgressRefreshSessionPromise,e.authentication=this.getSessionAccessToken());const r=yield this.requestHandler.handleRequest(e);if(this.loggingEnabled&&(0,s.isErrorResponse)(r)&&this.logger.error("Request failed",e,r),r.meta&&!e.external&&(null===(t=this.updateMetaCallback)||void 0===t||t.call(this,r.meta)),r.status===s.HttpStatusCode.ExpiredAccessToken&&!n&&!e.external){if(this.inProgressRefreshSessionPromise)yield this.inProgressRefreshSessionPromise;else if(e.authentication===this.getSessionAccessToken()){this.inProgressRefreshSessionPromise=this.refreshSession();const e=yield this.inProgressRefreshSessionPromise;let t=!1;if(e.isFailed()||(t=!(0,s.isErrorResponse)(e.getValue())),this.inProgressRefreshSessionPromise=void 0,!t)return r}return e.authentication=this.getSessionAccessToken(),this.runHttp(e)}return r}))}refreshSession(){var e;return r(this,void 0,void 0,(function*(){if(!this.session)return o.Result.fail("No session to refresh");if(this.session instanceof o.LegacySession)return o.Result.fail("Cannot refresh legacy session");const t=yield this.post(a.Paths.v1.refreshSession,{access_token:this.session.accessToken.value,refresh_token:this.session.refreshToken.value});if(this.__simulateNextSessionRefreshResponseDrop)return this.__simulateNextSessionRefreshResponseDrop=!1,o.Result.fail("Simulating a dropped response");if((0,s.isErrorResponse)(t))return o.Result.ok(t);t.meta&&(null===(e=this.updateMetaCallback)||void 0===e||e.call(this,t.meta));const n=o.SessionToken.create(t.data.session.access_token,t.data.session.access_expiration);if(n.isFailed())return o.Result.fail(n.getError());const r=n.getValue(),i=o.SessionToken.create(t.data.session.refresh_token,t.data.session.refresh_expiration);if(i.isFailed())return o.Result.fail(i.getError());const l=i.getValue(),c=o.Session.create(r,l,t.data.session.readonly_access);return c.isFailed()?o.Result.fail(c.getError()):(this.setSession(c.getValue()),this.refreshSessionCallback(this.session),o.Result.ok(t))}))}params(e){return Object.assign(Object.assign({},e),{[s.ApiEndpointParam.ApiVersion]:this.apiVersion})}}},11751:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},23792:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.XMLHttpRequestState=void 0,function(e){e[e.Completed=4]="Completed"}(n||(t.XMLHttpRequestState=n={}))},59774:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(93763),t),i(n(60256),t),i(n(56176),t),i(n(11751),t),i(n(23792),t)},6813:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4960:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8433:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},72548:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},37280:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},25618:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1179:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},68805:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},90327:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},57726:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},75146:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},45512:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(95658)},15829:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(95658)},609:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(95658)},79329:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(95658)},30163:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},33488:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(95658)},19298:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(95658)},57826:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},74815:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},72816:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(6813),t),i(n(4960),t),i(n(8433),t),i(n(72548),t),i(n(37280),t),i(n(25618),t),i(n(1179),t),i(n(68805),t),i(n(90327),t),i(n(57726),t),i(n(75146),t),i(n(45512),t),i(n(15829),t),i(n(609),t),i(n(79329),t),i(n(30163),t),i(n(33488),t),i(n(19298),t),i(n(57826),t),i(n(74815),t)},63404:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},62299:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},30785:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},86237:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},89996:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},27528:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},98259:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},51109:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},89304:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9712:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6605:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},25513:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},99614:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},68533:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},66722:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6497:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},96741:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5209:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5918:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},39761:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(63404),t),i(n(62299),t),i(n(30785),t),i(n(86237),t),i(n(89996),t),i(n(27528),t),i(n(98259),t),i(n(51109),t),i(n(89304),t),i(n(98259),t),i(n(51109),t),i(n(89304),t),i(n(9712),t),i(n(6605),t),i(n(25513),t),i(n(99614),t),i(n(68533),t),i(n(66722),t),i(n(6497),t),i(n(96741),t),i(n(5209),t),i(n(5918),t)},1807:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AsymmetricMessageServer=void 0;const r=n(18109);t.AsymmetricMessageServer=class{constructor(e){this.httpService=e}createMessage(e){return this.httpService.post(r.AsymmetricMessagesPaths.createMessage,{recipient_uuid:e.recipientUuid,encrypted_message:e.encryptedMessage,replaceability_identifier:e.replaceabilityIdentifier})}getInboundUserMessages(){return this.httpService.get(r.AsymmetricMessagesPaths.getInboundUserMessages())}getOutboundUserMessages(){return this.httpService.get(r.AsymmetricMessagesPaths.getOutboundUserMessages())}getMessages(){return this.httpService.get(r.AsymmetricMessagesPaths.getMessages)}deleteMessage(e){return this.httpService.delete(r.AsymmetricMessagesPaths.deleteMessage(e.messageUuid))}deleteAllInboundMessages(){return this.httpService.delete(r.AsymmetricMessagesPaths.deleteAllInboundMessages)}}},71101:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},18109:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AsymmetricMessagesPaths=void 0,t.AsymmetricMessagesPaths={createMessage:"/v1/messages",getMessages:"/v1/messages",updateMessage:e=>`/v1/messages/${e}`,getInboundUserMessages:()=>"/v1/messages",getOutboundUserMessages:()=>"/v1/messages/outbound",deleteMessage:e=>`/v1/messages/${e}`,deleteAllInboundMessages:"/v1/messages/inbound"}},8982:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AuthServer=void 0;const i=n(41325);t.AuthServer=class{constructor(e){this.httpService=e}generateRecoveryCodes(){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.generateRecoveryCodes)}))}recoveryKeyParams(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.recoveryKeyParams,e)}))}signInWithRecoveryCodes(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.signInWithRecoveryCodes,e)}))}}},75325:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},41325:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v1:Object.assign(Object.assign({},{refreshSession:"/v1/sessions/refresh"}),{generateRecoveryCodes:"/v1/recovery/codes",recoveryKeyParams:"/v1/recovery/login-params",signInWithRecoveryCodes:"/v1/recovery/login"})}},24610:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AuthenticatorServer=void 0;const i=n(35821);t.AuthenticatorServer=class{constructor(e){this.httpService=e}list(e){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v1.listAuthenticators,e)}))}delete(e){return r(this,void 0,void 0,(function*(){return this.httpService.delete(i.Paths.v1.deleteAuthenticator(e.authenticatorId),e)}))}generateRegistrationOptions(){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v1.generateRegistrationOptions)}))}verifyRegistrationResponse(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.verifyRegistrationResponse,e)}))}generateAuthenticationOptions(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.generateAuthenticationOptions,e)}))}}},1471:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},35821:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v1:Object.assign({},{listAuthenticators:"/v1/authenticators",deleteAuthenticator:e=>`/v1/authenticators/${e}`,generateRegistrationOptions:"/v1/authenticators/generate-registration-options",verifyRegistrationResponse:"/v1/authenticators/verify-registration",generateAuthenticationOptions:"/v1/authenticators/generate-authentication-options"})}},92272:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v2:Object.assign({},{listRevisions:e=>`/v2/items/${e}/revisions`,getRevision:(e,t)=>`/v2/items/${e}/revisions/${t}`,deleteRevision:(e,t)=>`/v2/items/${e}/revisions/${t}`})}},9784:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RevisionServer=void 0;const i=n(92272);t.RevisionServer=class{constructor(e){this.httpService=e}listRevisions(e){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v2.listRevisions(e.itemUuid))}))}getRevision(e){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v2.getRevision(e.itemUuid,e.revisionUuid))}))}deleteRevision(e){return r(this,void 0,void 0,(function*(){return this.httpService.delete(i.Paths.v2.deleteRevision(e.itemUuid,e.revisionUuid))}))}}},35213:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},83625:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultsPaths=void 0,t.SharedVaultsPaths={getSharedVaults:"/v1/shared-vaults",createSharedVault:"/v1/shared-vaults",deleteSharedVault:e=>`/v1/shared-vaults/${e}`,updateSharedVault:e=>`/v1/shared-vaults/${e}`,createSharedVaultFileValetToken:e=>`/v1/shared-vaults/${e}/valet-tokens`}},29497:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultServer=void 0;const r=n(83625);t.SharedVaultServer=class{constructor(e){this.httpService=e}getSharedVaults(){return this.httpService.get(r.SharedVaultsPaths.getSharedVaults)}createSharedVault(){return this.httpService.post(r.SharedVaultsPaths.createSharedVault)}deleteSharedVault(e){return this.httpService.delete(r.SharedVaultsPaths.deleteSharedVault(e.sharedVaultUuid))}createSharedVaultFileValetToken(e){let t;return e.sharedVaultOwnerUuid&&(t=[{key:"x-shared-vault-owner-context",value:e.sharedVaultOwnerUuid}]),this.httpService.post(r.SharedVaultsPaths.createSharedVaultFileValetToken(e.sharedVaultUuid),{file_uuid:e.fileUuid,remote_identifier:e.remoteIdentifier,operation:e.operation,unencrypted_file_size:e.unencryptedFileSize,move_operation_type:e.moveOperationType,shared_vault_to_shared_vault_move_target_uuid:e.sharedVaultToSharedVaultMoveTargetUuid},{headers:t})}}},41773:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},39593:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultInvitesPaths=void 0,t.SharedVaultInvitesPaths={createInvite:e=>`/v1/shared-vaults/${e}/invites`,updateInvite:(e,t)=>`/v1/shared-vaults/${e}/invites/${t}`,acceptInvite:(e,t)=>`/v1/shared-vaults/${e}/invites/${t}/accept`,declineInvite:(e,t)=>`/v1/shared-vaults/${e}/invites/${t}/decline`,getInboundUserInvites:()=>"/v1/shared-vaults/invites",getOutboundUserInvites:()=>"/v1/shared-vaults/invites/outbound",getSharedVaultInvites:e=>`/v1/shared-vaults/${e}/invites`,deleteInvite:(e,t)=>`/v1/shared-vaults/${e}/invites/${t}`,deleteAllSharedVaultInvites:e=>`/v1/shared-vaults/${e}/invites`,deleteAllInboundInvites:"/v1/shared-vaults/invites/inbound",deleteAllOutboundInvites:"/v1/shared-vaults/invites/outbound"}},55784:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultInvitesServer=void 0;const r=n(39593);t.SharedVaultInvitesServer=class{constructor(e){this.httpService=e}createInvite(e){return this.httpService.post(r.SharedVaultInvitesPaths.createInvite(e.sharedVaultUuid),{recipient_uuid:e.recipientUuid,encrypted_message:e.encryptedMessage,permission:e.permission.value})}updateInvite(e){var t;return this.httpService.patch(r.SharedVaultInvitesPaths.updateInvite(e.sharedVaultUuid,e.inviteUuid),{encrypted_message:e.encryptedMessage,permission:null===(t=e.permission)||void 0===t?void 0:t.value})}acceptInvite(e){return this.httpService.post(r.SharedVaultInvitesPaths.acceptInvite(e.sharedVaultUuid,e.inviteUuid))}declineInvite(e){return this.httpService.post(r.SharedVaultInvitesPaths.declineInvite(e.sharedVaultUuid,e.inviteUuid))}getInboundUserInvites(){return this.httpService.get(r.SharedVaultInvitesPaths.getInboundUserInvites())}getOutboundUserInvites(){return this.httpService.get(r.SharedVaultInvitesPaths.getOutboundUserInvites())}getSharedVaultInvites(e){return this.httpService.get(r.SharedVaultInvitesPaths.getSharedVaultInvites(e.sharedVaultUuid))}deleteInvite(e){return this.httpService.delete(r.SharedVaultInvitesPaths.deleteInvite(e.sharedVaultUuid,e.inviteUuid))}deleteAllSharedVaultInvites(e){return this.httpService.delete(r.SharedVaultInvitesPaths.deleteAllSharedVaultInvites(e.sharedVaultUuid))}deleteAllInboundInvites(){return this.httpService.delete(r.SharedVaultInvitesPaths.deleteAllInboundInvites)}deleteAllOutboundInvites(){return this.httpService.delete(r.SharedVaultInvitesPaths.deleteAllOutboundInvites)}}},49224:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},77183:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultUsersPaths=void 0,t.SharedVaultUsersPaths={getSharedVaultUsers:e=>`/v1/shared-vaults/${e}/users`,deleteSharedVaultUser:(e,t)=>`/v1/shared-vaults/${e}/users/${t}`,designateSurvivor:(e,t)=>`/v1/shared-vaults/${e}/users/${t}/designate-survivor`}},75569:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultUsersServer=void 0;const i=n(77183);t.SharedVaultUsersServer=class{constructor(e){this.httpService=e}designateSurvivor(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.SharedVaultUsersPaths.designateSurvivor(e.sharedVaultUuid.value,e.sharedVaultMemberUuid.value))}))}getSharedVaultUsers(e){return this.httpService.get(i.SharedVaultUsersPaths.getSharedVaultUsers(e.sharedVaultUuid))}deleteSharedVaultUser(e){return this.httpService.delete(i.SharedVaultUsersPaths.deleteSharedVaultUser(e.sharedVaultUuid,e.userUuid))}}},7307:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},63385:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v1:Object.assign(Object.assign(Object.assign(Object.assign({},{invite:"/v1/subscription-invites",acceptInvite:e=>`/v1/subscription-invites/${e}/accept`,declineInvite:e=>`/v1/subscription-invites/${e}/decline`,cancelInvite:e=>`/v1/subscription-invites/${e}`,listInvites:"/v1/subscription-invites"}),{confirmAppleIAP:"/v1/subscriptions/apple_iap_confirm"}),{subscription:e=>`/v1/users/${e}/subscription`}),{availableSubscriptions:"/v2/subscriptions"})}},83527:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionServer=void 0;const i=n(63385);t.SubscriptionServer=class{constructor(e){this.httpService=e}acceptInvite(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.acceptInvite(e.inviteUuid),e)}))}declineInvite(e){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v1.declineInvite(e.inviteUuid),e)}))}cancelInvite(e){return r(this,void 0,void 0,(function*(){return this.httpService.delete(i.Paths.v1.cancelInvite(e.inviteUuid),e)}))}listInvites(e){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v1.listInvites,e)}))}invite(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.invite,e)}))}confirmAppleIAP(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.confirmAppleIAP,e)}))}getUserSubscription(e){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v1.subscription(e.userUuid),e)}))}getAvailableSubscriptions(){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v1.availableSubscriptions)}))}}},79804:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},32288:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v1:Object.assign({},{register:"/v1/users",updateAccount:e=>`/v1/users/${e}`,deleteAccount:e=>`/v1/users/${e}`})}},87466:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.UserServer=void 0;const i=n(32288);t.UserServer=class{constructor(e){this.httpService=e}deleteAccount(e){return r(this,void 0,void 0,(function*(){return this.httpService.delete(i.Paths.v1.deleteAccount(e.userUuid),e)}))}register(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.register,e)}))}update(e){return r(this,void 0,void 0,(function*(){return this.httpService.patch(i.Paths.v1.updateAccount(e.user_uuid),e)}))}}},14786:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4633:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v1:Object.assign({},{submitUserRequest:e=>`/v1/users/${e}/requests`})}},59181:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.UserRequestServer=void 0;const i=n(4633);t.UserRequestServer=class{constructor(e){this.httpService=e}submitUserRequest(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.submitUserRequest(e.userUuid),e)}))}}},39594:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1276:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v1:Object.assign({},{createConnectionToken:"/v1/sockets/tokens"})}},81355:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.WebSocketServer=void 0;const i=n(1276);t.WebSocketServer=class{constructor(e){this.httpService=e}createConnectionToken(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.createConnectionToken,e)}))}}},7404:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},87267:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(8982),t),i(n(75325),t),i(n(24610),t),i(n(1471),t),i(n(9784),t),i(n(35213),t),i(n(1807),t),i(n(71101),t),i(n(29497),t),i(n(41773),t),i(n(75569),t),i(n(7307),t),i(n(83527),t),i(n(79804),t),i(n(55784),t),i(n(49224),t),i(n(87466),t),i(n(14786),t),i(n(59181),t),i(n(39594),t),i(n(81355),t),i(n(7404),t)},74907:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(57819),t),i(n(37729),t),i(n(65148),t),i(n(59774),t),i(n(72816),t),i(n(39761),t),i(n(87267),t)},70781:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(74907),t)},46981:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentAction=void 0,function(e){e.SetSize="set-size",e.StreamItems="stream-items",e.StreamContextItem="stream-context-item",e.SaveItems="save-items",e.CreateItem="create-item",e.CreateItems="create-items",e.DeleteItems="delete-items",e.SetComponentData="set-component-data",e.RequestPermissions="request-permissions",e.DuplicateItem="duplicate-item",e.ComponentRegistered="component-registered",e.ActivateThemes="themes",e.Reply="reply",e.ThemesActivated="themes-activated",e.KeyDown="key-down",e.KeyUp="key-up",e.Click="click"}(n||(t.ComponentAction=n={}))},40611:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentArea=void 0,function(e){e.Editor="editor-editor",e.Themes="themes",e.EditorStack="editor-stack"}(n||(t.ComponentArea=n={}))},92898:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentFlag=void 0,function(e){e.New="New",e.Deprecated="Deprecated"}(n||(t.ComponentFlag=n={}))},45556:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6812:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.noteTypeForEditorIdentifier=t.NoteType=void 0;const r=n(36178);var i;!function(e){e.Authentication="authentication",e.Code="code",e.Markdown="markdown",e.RichText="rich-text",e.Spreadsheet="spreadsheet",e.Task="task",e.Plain="plain-text",e.Super="super",e.Unknown="unknown"}(i||(t.NoteType=i={})),t.noteTypeForEditorIdentifier=function(e){const t=(0,r.FindNativeFeature)(e);return t&&t.note_type?t.note_type:i.Unknown}},75482:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7675:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},92164:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},15077:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},45661:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43834:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},36178:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GetDeprecatedEditors=t.GetDarkThemeFeature=t.GetNativeThemes=t.GetPlainNoteFeature=t.GetSuperNoteFeature=t.GetIframeEditors=t.GetIframeAndNativeEditors=t.FindNativeTheme=t.FindNativeFeature=t.GetFeatures=void 0;const r=n(84135),i=n(4891),o=n(9711),s=n(10379),a=n(85771),l=n(2258),c=n(88280),u=n(88277),d=n(40611);function h(){return[...(0,i.serverFeatures)(),...(0,o.clientFeatures)(),...(0,c.themes)(),...(0,u.nativeEditors)(),...(0,l.IframeEditors)(),...(0,a.experimentalFeatures)(),...(0,s.GetDeprecatedFeatures)()]}function p(e){return h().find((t=>t.identifier===e))}t.GetFeatures=h,t.FindNativeFeature=p,t.FindNativeTheme=function(e){return(0,c.themes)().find((t=>t.identifier===e))},t.GetIframeAndNativeEditors=function(){return[...(0,l.IframeEditors)(),...(0,u.nativeEditors)()]},t.GetIframeEditors=function(){return(0,l.IframeEditors)()},t.GetSuperNoteFeature=function(){return p(r.NativeFeatureIdentifier.TYPES.SuperEditor)},t.GetPlainNoteFeature=function(){return p(r.NativeFeatureIdentifier.TYPES.PlainEditor)},t.GetNativeThemes=function(){return(0,c.themes)()},t.GetDarkThemeFeature=function(){return(0,c.themes)().find((e=>e.identifier===r.NativeFeatureIdentifier.TYPES.DarkTheme))},t.GetDeprecatedEditors=function(){return(0,s.GetDeprecatedFeatures)().filter((e=>e.area===d.ComponentArea.Editor))}},49774:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},84135:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExperimentalFeatures=t.NativeFeatureIdentifier=void 0;const r=n(82648);class i extends r.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){return Object.values(this.TYPES).includes(e)?r.Result.ok(new i({value:e})):r.Result.fail(`Invalid feature identifier: ${e}`)}}t.NativeFeatureIdentifier=i,i.TYPES={DailyEmailBackup:"org.standardnotes.daily-email-backup",Files:"org.standardnotes.files",FilesLowStorageTier:"org.standardnotes.files-low-storage-tier",FilesMaximumStorageTier:"org.standardnotes.files-max-storage-tier",ListedCustomDomain:"org.standardnotes.listed-custom-domain",NoteHistory30Days:"org.standardnotes.note-history-30",NoteHistory365Days:"org.standardnotes.note-history-365",NoteHistoryUnlimited:"org.standardnotes.note-history-unlimited",SignInAlerts:"com.standardnotes.sign-in-alerts",SmartFilters:"org.standardnotes.smart-filters",TagNesting:"org.standardnotes.tag-nesting",TwoFactorAuth:"org.standardnotes.two-factor-auth",UniversalSecondFactor:"org.standardnotes.universal-second-factor",SubscriptionSharing:"org.standardnotes.subscription-sharing",AutobiographyTheme:"org.standardnotes.theme-autobiography",DynamicTheme:"org.standardnotes.theme-dynamic",DarkTheme:"org.standardnotes.theme-focus",FuturaTheme:"org.standardnotes.theme-futura",MidnightTheme:"org.standardnotes.theme-midnight",SolarizedDarkTheme:"org.standardnotes.theme-solarized-dark",TitaniumTheme:"org.standardnotes.theme-titanium",ProtonTheme:"com.standardnotes.theme-proton",PlainEditor:"com.standardnotes.plain-text",SuperEditor:"com.standardnotes.super-editor",SheetsEditor:"org.standardnotes.standard-sheets",TokenVaultEditor:"org.standardnotes.token-vault",Clipper:"org.standardnotes.clipper",Vaults:"org.standardnotes.vaults",SharedVaults:"org.standardnotes.shared-vaults",DeprecatedCodeEditor:"org.standardnotes.code-editor",DeprecatedMarkdownProEditor:"org.standardnotes.advanced-markdown-editor",DeprecatedPlusEditor:"org.standardnotes.plus-editor",DeprecatedTaskEditor:"org.standardnotes.simple-task-editor",DeprecatedMarkdownVisualEditor:"org.standardnotes.markdown-visual-editor",DeprecatedBoldEditor:"org.standardnotes.bold-editor",DeprecatedMarkdownBasicEditor:"org.standardnotes.simple-markdown-editor",DeprecatedMarkdownMathEditor:"org.standardnotes.fancy-markdown-editor",DeprecatedMarkdownMinimistEditor:"org.standardnotes.minimal-markdown-editor",DeprecatedFoldersComponent:"org.standardnotes.folders",DeprecatedFileSafe:"org.standardnotes.file-safe",LegacyFileSafeIdentifier:"org.standardnotes.legacy.file-safe"},t.ExperimentalFeatures=[i.TYPES.Vaults]},39219:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},42116:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},95100:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},58635:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEditorFeatureDescription=t.isIframeComponentFeatureDescription=t.isThemeFeatureDescription=void 0;const r=n(82648),i=n(40611);t.isThemeFeatureDescription=function(e){return"content_type"in e&&e.content_type===r.ContentType.TYPES.Theme},t.isIframeComponentFeatureDescription=function(e){return"content_type"in e&&e.content_type===r.ContentType.TYPES.Component&&[i.ComponentArea.Editor,i.ComponentArea.EditorStack].includes(e.area)},t.isEditorFeatureDescription=function(e){return null!=e.note_type||e.area===i.ComponentArea.Editor}},53908:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9711:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clientFeatures=void 0;const r=n(80),i=n(84135),o=n(82648);t.clientFeatures=function(){return[{name:"Tag Nesting",availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser],identifier:i.NativeFeatureIdentifier.TYPES.TagNesting,permission_name:r.PermissionName.TagNesting,description:"Organize your tags into folders."},{name:"Smart Filters",availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser],identifier:i.NativeFeatureIdentifier.TYPES.SmartFilters,permission_name:r.PermissionName.SmartFilters,description:"Create smart filters for viewing notes matching specific criteria."},{name:"Encrypted files",availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser],identifier:i.NativeFeatureIdentifier.TYPES.Files,permission_name:r.PermissionName.Files,description:""},{name:"Clipper",availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser],identifier:i.NativeFeatureIdentifier.TYPES.Clipper,permission_name:r.PermissionName.Clipper,description:""}]}},10379:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GetDeprecatedFeatures=void 0;const r=n(82648),i=n(80),o=n(84135),s=n(6812),a=n(38732),l=n(46981),c=n(40611);t.GetDeprecatedFeatures=function(){const e=(0,a.FillIframeEditorDefaults)({name:"Code",spellcheckControl:!0,identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedCodeEditor,permission_name:i.PermissionName.DeprecatedCodeEditor,note_type:s.NoteType.Code,file_type:"txt",interchangeable:!0,deprecated:!0,index_path:"index.html",description:"Syntax highlighting and convenient keyboard shortcuts for over 120 programming languages. Ideal for code snippets and procedures.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/code.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),t=(0,a.FillIframeEditorDefaults)({name:"Rich Text",note_type:s.NoteType.RichText,file_type:"html",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedPlusEditor,permission_name:i.PermissionName.DeprecatedPlusEditor,spellcheckControl:!0,deprecated:!0,description:"From highlighting to custom font sizes and colors, to tables and lists, this editor is perfect for crafting any document.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/plus-editor.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),n=(0,a.FillIframeEditorDefaults)({name:"Markdown",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedMarkdownProEditor,note_type:s.NoteType.Markdown,file_type:"md",permission_name:i.PermissionName.DeprecatedMarkdownProEditor,spellcheckControl:!0,deprecated:!0,description:"A fully featured Markdown editor that supports live preview, a styling toolbar, and split pane support.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/adv-markdown.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),u=(0,a.FillIframeEditorDefaults)({name:"Checklist",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedTaskEditor,note_type:s.NoteType.Task,spellcheckControl:!0,file_type:"md",interchangeable:!1,deprecated:!0,permission_name:i.PermissionName.DeprecatedTaskEditor,description:'A great way to manage short-term and long-term to-do"s. You can mark tasks as completed, change their order, and edit the text naturally in place.',thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/task-editor.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),d=(0,a.FillIframeEditorDefaults)({name:"Alternative Rich Text",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedBoldEditor,note_type:s.NoteType.RichText,file_type:"html",component_permissions:[{name:l.ComponentAction.StreamContextItem,content_types:[r.ContentType.TYPES.Note]},{name:l.ComponentAction.StreamItems,content_types:[r.ContentType.TYPES.FilesafeCredentials,r.ContentType.TYPES.FilesafeFileMetadata,r.ContentType.TYPES.FilesafeIntegration]}],spellcheckControl:!0,deprecated:!0,permission_name:i.PermissionName.BoldEditor,description:"A simple and peaceful rich editor that helps you write and think clearly.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/bold.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),h=(0,a.FillIframeEditorDefaults)({name:"Basic Markdown",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedMarkdownBasicEditor,note_type:s.NoteType.Markdown,spellcheckControl:!0,file_type:"md",deprecated:!0,permission_name:i.PermissionName.MarkdownBasicEditor,description:"A Markdown editor with dynamic split-pane preview.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/simple-markdown.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),p=(0,a.FillIframeEditorDefaults)({name:"Markdown Alternative",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedMarkdownVisualEditor,note_type:s.NoteType.Markdown,file_type:"md",deprecated:!0,permission_name:i.PermissionName.MarkdownVisualEditor,spellcheckControl:!0,description:"A WYSIWYG-style Markdown editor that renders Markdown in preview-mode while you type without displaying any syntax.",index_path:"build/index.html",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]});return[e,t,n,u,d,h,(0,a.FillIframeEditorDefaults)({name:"Minimal Markdown",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedMarkdownMinimistEditor,note_type:s.NoteType.Markdown,file_type:"md",index_path:"index.html",permission_name:i.PermissionName.MarkdownMinimistEditor,spellcheckControl:!0,deprecated:!0,description:"A minimal Markdown editor with live rendering and in-text search via Ctrl/Cmd + F",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/min-markdown.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),(0,a.FillIframeEditorDefaults)({name:"Markdown with Math",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedMarkdownMathEditor,spellcheckControl:!0,permission_name:i.PermissionName.MarkdownMathEditor,note_type:s.NoteType.Markdown,file_type:"md",deprecated:!0,index_path:"index.html",description:"A beautiful split-pane Markdown editor with synced-scroll, LaTeX support, and colorful syntax.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/fancy-markdown.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),p,(0,a.FillIframeEditorDefaults)({name:"FileSafe",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedFileSafe,component_permissions:[{name:l.ComponentAction.StreamContextItem,content_types:[r.ContentType.TYPES.Note]},{name:l.ComponentAction.StreamItems,content_types:[r.ContentType.TYPES.FilesafeCredentials,r.ContentType.TYPES.FilesafeFileMetadata,r.ContentType.TYPES.FilesafeIntegration]}],permission_name:i.PermissionName.ComponentFilesafe,area:c.ComponentArea.EditorStack,deprecated:!0,description:"Encrypted attachments for your notes using your Dropbox, Google Drive, or WebDAV server. Limited to 50MB per file.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/FileSafe-banner.png",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]})]}},85771:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.experimentalFeatures=void 0;const r=n(82648),i=n(84135),o=n(80);t.experimentalFeatures=function(){return[{name:"Private vaults",description:"Private vaults allow you to store notes, files and tags into separate, encrypted vaults.",availableInRoles:[r.RoleName.NAMES.CoreUser,r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser],identifier:i.NativeFeatureIdentifier.TYPES.Vaults,permission_name:o.PermissionName.Vaults}]}},2258:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IframeEditors=void 0;const r=n(80),i=n(84135),o=n(6812),s=n(38732),a=n(82648);t.IframeEditors=function(){return[(0,s.FillIframeEditorDefaults)({name:"Authenticator",note_type:o.NoteType.Authentication,file_type:"json",interchangeable:!1,identifier:i.NativeFeatureIdentifier.TYPES.TokenVaultEditor,permission_name:r.PermissionName.TokenVaultEditor,description:"Encrypt and protect your 2FA secrets for all your internet accounts. Authenticator handles your 2FA secrets so that you never lose them again, or have to start over when you get a new device.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/token-vault.png",availableInRoles:[a.RoleName.NAMES.PlusUser,a.RoleName.NAMES.ProUser]}),(0,s.FillIframeEditorDefaults)({name:"Spreadsheet",identifier:i.NativeFeatureIdentifier.TYPES.SheetsEditor,note_type:o.NoteType.Spreadsheet,file_type:"json",interchangeable:!1,permission_name:r.PermissionName.SheetsEditor,description:"A powerful spreadsheet editor with formatting and formula support. Not recommended for large data sets, as encryption of such data may decrease editor performance.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/spreadsheets.png",availableInRoles:[a.RoleName.NAMES.PlusUser,a.RoleName.NAMES.ProUser]})]}},88277:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nativeEditors=void 0;const r=n(82648),i=n(6812),o=n(84135),s=n(80);t.nativeEditors=function(){return[{name:"Super",note_type:i.NoteType.Super,identifier:o.NativeFeatureIdentifier.TYPES.SuperEditor,spellcheckControl:!0,file_type:"json",interchangeable:!1,availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser],permission_name:s.PermissionName.SuperEditor,description:"The best way to edit notes. Type / to bring up the block selection menu, or @ to embed images or link other tags and notes. Type - then space to start a list, or [] then space to start a checklist. Drag and drop an image or file to embed it in your note. Cmd/Ctrl + F to bring up search and replace."},{name:"Plain Text",note_type:i.NoteType.Plain,spellcheckControl:!0,file_type:"txt",interchangeable:!0,identifier:o.NativeFeatureIdentifier.TYPES.PlainEditor,availableInRoles:[r.RoleName.NAMES.CoreUser,r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser],permission_name:s.PermissionName.PlainEditor}]}},4891:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serverFeatures=void 0;const r=n(80),i=n(84135),o=n(82648);t.serverFeatures=function(){return[{name:"Two factor authentication",identifier:i.NativeFeatureIdentifier.TYPES.TwoFactorAuth,permission_name:r.PermissionName.TwoFactorAuth,availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser]},{name:"U2F authentication",identifier:i.NativeFeatureIdentifier.TYPES.UniversalSecondFactor,permission_name:r.PermissionName.UniversalSecondFactor,availableInRoles:[o.RoleName.NAMES.ProUser]},{name:"Unlimited note history",identifier:i.NativeFeatureIdentifier.TYPES.NoteHistoryUnlimited,permission_name:r.PermissionName.NoteHistoryUnlimited,availableInRoles:[o.RoleName.NAMES.ProUser]},{name:"365 days note history",identifier:i.NativeFeatureIdentifier.TYPES.NoteHistory365Days,permission_name:r.PermissionName.NoteHistory365Days,availableInRoles:[o.RoleName.NAMES.PlusUser]},{name:"Email backups",identifier:i.NativeFeatureIdentifier.TYPES.DailyEmailBackup,permission_name:r.PermissionName.DailyEmailBackup,availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser]},{name:"Sign-in email alerts",identifier:i.NativeFeatureIdentifier.TYPES.SignInAlerts,permission_name:r.PermissionName.SignInAlerts,availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser]},{name:"Files maximum storage tier",identifier:i.NativeFeatureIdentifier.TYPES.FilesMaximumStorageTier,permission_name:r.PermissionName.FilesMaximumStorageTier,availableInRoles:[o.RoleName.NAMES.ProUser]},{name:"Files low storage tier",identifier:i.NativeFeatureIdentifier.TYPES.FilesLowStorageTier,permission_name:r.PermissionName.FilesLowStorageTier,availableInRoles:[o.RoleName.NAMES.PlusUser]},{name:"Files medium storage tier",identifier:i.NativeFeatureIdentifier.TYPES.SubscriptionSharing,permission_name:r.PermissionName.SubscriptionSharing,availableInRoles:[o.RoleName.NAMES.ProUser]},{name:"Listed Custom Domain",identifier:i.NativeFeatureIdentifier.TYPES.ListedCustomDomain,permission_name:r.PermissionName.ListedCustomDomain,availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser]},{name:"Shared Vaults",identifier:i.NativeFeatureIdentifier.TYPES.SharedVaults,permission_name:r.PermissionName.SharedVaults,availableInRoles:[o.RoleName.NAMES.InternalTeamUser]}]}},88280:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.themes=void 0;const r=n(80),i=n(84135),o=n(82504),s=n(82648);t.themes=function(){const e=(0,o.FillThemeComponentDefaults)({name:"Midnight",identifier:i.NativeFeatureIdentifier.TYPES.MidnightTheme,permission_name:r.PermissionName.MidnightTheme,isDark:!0,dock_icon:{type:"circle",background_color:"#086DD6",foreground_color:"#ffffff",border_color:"#086DD6"},availableInRoles:[s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser]}),t=(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Futura",identifier:i.NativeFeatureIdentifier.TYPES.FuturaTheme,permission_name:r.PermissionName.FuturaTheme,isDark:!0,dock_icon:{type:"circle",background_color:"#fca429",foreground_color:"#ffffff",border_color:"#fca429"}}),n=(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Solarized Dark",identifier:i.NativeFeatureIdentifier.TYPES.SolarizedDarkTheme,permission_name:r.PermissionName.SolarizedDarkTheme,isDark:!0,dock_icon:{type:"circle",background_color:"#2AA198",foreground_color:"#ffffff",border_color:"#2AA198"}}),a=(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Autobiography",identifier:i.NativeFeatureIdentifier.TYPES.AutobiographyTheme,permission_name:r.PermissionName.AutobiographyTheme,dock_icon:{type:"circle",background_color:"#9D7441",foreground_color:"#ECE4DB",border_color:"#9D7441"}}),l=(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.CoreUser,s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Dark",identifier:i.NativeFeatureIdentifier.TYPES.DarkTheme,permission_name:r.PermissionName.FocusedTheme,clientControlled:!0,isDark:!0,dock_icon:{type:"circle",background_color:"#a464c2",foreground_color:"#ffffff",border_color:"#a464c2"}}),c=(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Titanium",identifier:i.NativeFeatureIdentifier.TYPES.TitaniumTheme,permission_name:r.PermissionName.TitaniumTheme,dock_icon:{type:"circle",background_color:"#6e2b9e",foreground_color:"#ffffff",border_color:"#6e2b9e"}}),u=(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Dynamic Panels",identifier:i.NativeFeatureIdentifier.TYPES.DynamicTheme,permission_name:r.PermissionName.ThemeDynamic,layerable:!0,no_mobile:!0});return[e,t,n,a,l,(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.CoreUser,s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Carbon",identifier:i.NativeFeatureIdentifier.TYPES.ProtonTheme,permission_name:r.PermissionName.ProtonTheme,dock_icon:{type:"circle",background_color:"#16141c",foreground_color:"#ffffff",border_color:"#4a4658"}}),c,u]}},38732:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FillIframeEditorDefaults=void 0;const r=n(82648),i=n(46981),o=n(40611);t.FillIframeEditorDefaults=function(e){return e.index_path||(e.index_path="dist/index.html"),e.component_permissions||(e.component_permissions=[{name:i.ComponentAction.StreamContextItem,content_types:[r.ContentType.TYPES.Note]}]),e.content_type=r.ContentType.TYPES.Component,e.area||(e.area=o.ComponentArea.Editor),null==e.interchangeable&&(e.interchangeable=!0),e}},82504:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FillThemeComponentDefaults=void 0;const r=n(82648),i=n(40611);t.FillThemeComponentDefaults=function(e){return e.index_path||(e.index_path="index.css"),e.content_type=r.ContentType.TYPES.Theme,e.area||(e.area=i.ComponentArea.Themes),e}},93625:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},80:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PermissionName=void 0,function(e){e.AccountSwitcher="app:account-switcher",e.AutobiographyTheme="theme:autobiography",e.BoldEditor="editor:bold",e.DeprecatedCodeEditor="editor:code-editor",e.ComponentFilesafe="component:filesafe",e.ComponentFolders="component:folders",e.DailyEmailBackup="server:daily-email-backup",e.Files="app:files",e.FilesMaximumStorageTier="server:files-max-storage-tier",e.FilesLowStorageTier="server:files-low-storage-tier",e.FocusedTheme="theme:focused",e.FocusMode="app:focus-mode",e.FuturaTheme="theme:futura",e.ListedCustomDomain="listed:custom-domain",e.MarkdownBasicEditor="editor:markdown-basic",e.MarkdownMathEditor="editor:markdown-math",e.MarkdownMinimistEditor="editor:markdown-minimist",e.DeprecatedMarkdownProEditor="editor:markdown-pro",e.MarkdownVisualEditor="editor:markdown-visual",e.MidnightTheme="theme:midnight",e.NoteHistory30Days="server:note-history-30-days",e.NoteHistory365Days="server:note-history-365-days",e.NoteHistoryUnlimited="server:note-history-unlimited",e.PlainEditor="editor:plain",e.DeprecatedPlusEditor="editor:plus",e.SheetsEditor="editor:sheets",e.SignInAlerts="server:sign-in-alerts",e.SmartFilters="app:smart-filters",e.SolarizedDarkTheme="theme:solarized-dark",e.TagNesting="app:tag-nesting",e.DeprecatedTaskEditor="editor:task-editor",e.ThemeDynamic="theme:dynamic",e.TitaniumTheme="theme:titanium",e.TokenVaultEditor="editor:token-vault",e.TwoFactorAuth="server:two-factor-auth",e.UniversalSecondFactor="server:universal-second-factor",e.SubscriptionSharing="server:subscription-sharing",e.SuperEditor="editor:super-editor",e.Clipper="app:clipper",e.Vaults="app:vaults",e.SharedVaults="server:shared-vaults",e.ProtonTheme="theme:proton"}(n||(t.PermissionName=n={}))},34404:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7675),t),i(n(84135),t),i(n(36178),t),i(n(58635),t),i(n(95100),t),i(n(15077),t),i(n(39219),t),i(n(49774),t),i(n(45661),t),i(n(92164),t),i(n(43834),t),i(n(42116),t),i(n(53908),t),i(n(93625),t),i(n(80),t),i(n(46981),t),i(n(40611),t),i(n(92898),t),i(n(45556),t),i(n(6812),t),i(n(75482),t)},84409:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(34404),t)},54310:(e,t,n)=>{"use strict";n.d(t,{Re:()=>l,N4:()=>u,XQ:()=>f,KC:()=>d,A7:()=>p,vU:()=>a});var r=n(87985);const i=1024,o=1048576,s=1073741824;function a(e){let t=e,n="B";return e>=s?(t=e/s,n="GB"):e>=o?(t=e/o,n="MB"):e>=i&&(t=e/i,n="KB"),`${Number.isInteger(t)?t:t.toFixed(2)} ${n}`}const l={selectFiles:function(){const e=function(){let e=document.getElementById(c);return e||(e=document.createElement("input"),e.id=c,e.type="file",e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.height="1px",e.style.width="1px",e.style.opacity="0",e.style.zIndex="-50",e.multiple=!0,document.body.appendChild(e),e)}();return new Promise((t=>{e.onchange=async n=>{const r=n.target,i=[];for(const e of Array.from(r.files))i.push(e);t(i),e.value=""},e.click()}))},readFile:async function(e,t,n){const i=await async function(e){const t=new FileReader;return t.readAsArrayBuffer(e),new Promise((e=>{t.onload=t=>{const n=t.target.result;e(new Uint8Array(n))}}))}(e),o=new r.M1(t,n),s=2e6;for(let e=0;e<i.length;e+=s){const t=e+s,n=i.slice(e,t),r=t>=i.length;await o.addBytes(n,r)}return{name:e.name,mimeType:e.type}},available:function(){return!0},maximumFileSize:function(){return 5e7}},c="classic-reader-file-input";class u{constructor(){this.loggingEnabled=!1}log(...e){this.loggingEnabled&&console.log(e)}static maximumFileSize(){return 5e7}saveFile(e,t){this.log("Saving file to disk..."),function(e,t){const n=document.createElement("a"),r=new Blob([t],{type:"text/plain;charset=utf-8"});n.href=window.URL.createObjectURL(r),n.setAttribute("download",e),document.body.appendChild(n),n.click(),n.remove(),window.URL.revokeObjectURL(n.href)}(e,t),this.log("Closing write stream")}}const d={getFilesFromHandles:h,selectFiles:async function(){let e;try{e=await window.showOpenFilePicker({multiple:!0})}catch(t){e=[]}return h(e)},readFile:async function(e,t,n){const i=new r.M1(t,n),o=e.stream().getReader();let s;const a=async e=>{if(!e.done)return s&&await i.addBytes(s,!1),s=e.value,o.read().then(a);await i.addBytes(s,!0)};return await o.read().then(a),{name:e.name,mimeType:e.type}},available:function(){return null!=window.showOpenFilePicker},maximumFileSize:function(){}};function h(e){return Promise.all(e.map((e=>e.getFile())))}class p{constructor(e){this.name=e,this.loggingEnabled=!1}log(...e){this.loggingEnabled&&console.log(e)}static available(){return null!=window.showSaveFilePicker}async selectFileToSaveTo(e){this.log("Showing save file picker");const t=e||await window.showSaveFilePicker({suggestedName:this.name});this.writableStream=await t.createWritable()}async pushBytes(e){if(!this.writableStream)throw Error("Must call selectFileToSaveTo first");this.log("Writing chunk to disk of size",e.length),await this.writableStream.write(e)}async finish(){if(!this.writableStream)throw Error("Must call selectFileToSaveTo first");this.log("Closing write stream"),await this.writableStream.close()}}class f{async selectDirectory(){try{return{nativeHandle:await window.showDirectoryPicker()}}catch(e){return"aborted"}}async createFile(e,t){const n=await e.nativeHandle.getFileHandle(t,{create:!0}),r=await n.createWritable();return{nativeHandle:n,writableStream:r}}async createDirectory(e,t){return{nativeHandle:await e.nativeHandle.getDirectoryHandle(t,{create:!0})}}async saveBytes(e,t){return await e.writableStream.write(t),"success"}async saveString(e,t){return await e.writableStream.write(t),"success"}async closeFileWriteStream(e){return await e.writableStream.close(),"success"}async selectFile(){try{return{nativeHandle:(await window.showOpenFilePicker())[0]}}catch(e){return"aborted"}}async readFile(e,t){const n=(await e.nativeHandle.getFile()).stream().getReader();let r;const i=async e=>{if(!e.done)return r&&await t(r,!1),r=e.value,n.read().then(i);await t(r,!0)};return await n.read().then(i),"success"}}},87985:(e,t,n)=>{"use strict";n.d(t,{M1:()=>r,Qc:()=>s}),n(87901);class r{constructor(e,t){this.minimumChunkSize=e,this.onChunk=t,this.loggingEnabled=!1,this.bytes=new Uint8Array,this.index=1}log(...e){this.loggingEnabled&&console.log(e)}async addBytes(e,t){this.bytes=new Uint8Array([...this.bytes,...e]),this.log(`Chunker adding ${e.length}, total size ${this.bytes.length}`),(this.bytes.length>=this.minimumChunkSize||t)&&await this.popBytes(t)}async popBytes(e){const t=Math.max(this.minimumChunkSize,this.bytes.length),n=this.bytes.slice(0,t);this.bytes=new Uint8Array([...this.bytes.slice(t)]),this.log(`Chunker popping ${n.length}, total size in queue ${this.bytes.length}`),await this.onChunk({data:n,index:this.index++,isLast:e})}}var i,o;function s(e,t,n){const r=Math.floor(e.percentComplete);let i=`Downloading file ${"network"===e.source?"":"memcache"===e.source?"from cache":"from backup"} "${t}"`;return n.showPercent&&(i+=` (${r}%)`),i}n(95658),n(98418),(o=i||(i={}))[o.FilesPackage=0]="FilesPackage",i.FilesPackage,i.FilesPackage},2577:e=>{"use strict";var t;self,t=()=>(()=>{var e={578:(e,t)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var r=Symbol.for("react.element"),i=(Symbol.for("react.portal"),Symbol.for("react.fragment"),Symbol.for("react.strict_mode"),Symbol.for("react.profiler"),Symbol.for("react.provider"),Symbol.for("react.context"),Symbol.for("react.forward_ref"),Symbol.for("react.suspense"),Symbol.for("react.memo"),Symbol.for("react.lazy"),Symbol.iterator,{isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}}),o=Object.assign,s={};function a(e,t,n){this.props=e,this.context=t,this.refs=s,this.updater=n||i}function l(){}function c(e,t,n){this.props=e,this.context=t,this.refs=s,this.updater=n||i}a.prototype.isReactComponent={},a.prototype.setState=function(e,t){if("object"!==n(e)&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},a.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},l.prototype=a.prototype;var u=c.prototype=new l;u.constructor=c,o(u,a.prototype),u.isPureReactComponent=!0,Array.isArray;var d=Object.prototype.hasOwnProperty,h=null,p={key:!0,ref:!0,__self:!0,__source:!0};t.createElement=function(e,t,n){var i,o={},s=null,a=null;if(null!=t)for(i in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(s=""+t.key),t)d.call(t,i)&&!p.hasOwnProperty(i)&&(o[i]=t[i]);var l=arguments.length-2;if(1===l)o.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];o.children=c}if(e&&e.defaultProps)for(i in l=e.defaultProps)void 0===o[i]&&(o[i]=l[i]);return{$$typeof:r,type:e,key:s,ref:a,props:o,_owner:h}}},694:(e,t,n)=>{e.exports=n(578)}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{n.r(r),n.d(r,{AccessibilityIcon:()=>i,AccountCardDetailsOutlineIcon:()=>s,AccountCircleIcon:()=>l,AccountIllustration:()=>u,AccountVariantIcon:()=>h,AddBoldIcon:()=>f,AddIcon:()=>m,AddTextIcon:()=>v,AegisIcon:()=>b,ArchiveIcon:()=>S,ArrowDownCheckmarkIcon:()=>E,ArrowDownIcon:()=>_,ArrowLeftIcon:()=>P,ArrowRightIcon:()=>B,ArrowUpIcon:()=>Q,ArrowsHorizontalIcon:()=>N,ArrowsSortDownIcon:()=>j,ArrowsSortUpIcon:()=>M,ArrowsVerticalIcon:()=>R,AsteriskIcon:()=>V,AttachmentFileIcon:()=>H,AuthenticatorIcon:()=>Y,AuthenticatorVariantIcon:()=>Z,BackIosIcon:()=>q,BackspaceIcon:()=>X,BlockIcon:()=>ee,BlueDotIcon:()=>ne,BoldIcon:()=>ie,BoxFilledIcon:()=>se,BoxIcon:()=>le,CameraIcon:()=>ue,CaretRightIcon:()=>he,CheckAllIcon:()=>fe,CheckBoldIcon:()=>me,CheckCircleFilledIcon:()=>ve,CheckCircleIcon:()=>be,CheckIcon:()=>Se,CheckListIcon:()=>Ee,ChevronDownIcon:()=>_e,ChevronLeftIcon:()=>Pe,ChevronRightIcon:()=>Be,ChevronUpIcon:()=>Ne,CircleIcon:()=>je,ClearCircleFilledIcon:()=>Me,ClockIcon:()=>Qe,CloseCircleFilledIcon:()=>Re,CloseIcon:()=>Ve,CloudOffIcon:()=>He,CodeIcon:()=>Ye,CodeTagsIcon:()=>Ze,ColorFillIcon:()=>qe,CopyIcon:()=>Xe,CreateAccountIllustration:()=>et,DashboardIcon:()=>nt,DetailsBlockIcon:()=>la,DiamondFilledIcon:()=>it,DiamondIcon:()=>st,DownloadIcon:()=>lt,DragIcon:()=>ut,DrawIcon:()=>ht,EditorFilledIcon:()=>ft,EditorIcon:()=>mt,EmailFilledIcon:()=>vt,EmailIcon:()=>bt,EnterIcon:()=>St,EvernoteIcon:()=>Et,EyeFilledIcon:()=>_t,EyeIcon:()=>Pt,EyeOffFilledIcon:()=>Bt,EyeOffIcon:()=>Nt,FeedbackIcon:()=>jt,FileDocIcon:()=>Mt,FileErrorIcon:()=>Rt,FileFilledIcon:()=>Qt,FileIcon:()=>Vt,FileImageIcon:()=>Ht,FileMovIcon:()=>Yt,FileMusicIcon:()=>Zt,FileOtherIcon:()=>qt,FilePdfIcon:()=>Xt,FilePptIcon:()=>en,FileSelectedIcon:()=>nn,FileXlsIcon:()=>an,FileZipIcon:()=>cn,FilesIllustration:()=>on,FolderFilledIcon:()=>dn,FolderIcon:()=>pn,FolderKeyFilledIcon:()=>gn,FormatAlignCenterIcon:()=>yn,FormatAlignJustifyIcon:()=>An,FormatAlignLeftIcon:()=>wn,FormatAlignRightIcon:()=>Cn,ForwardIosIcon:()=>In,FullscreenExitIcon:()=>xn,FullscreenIcon:()=>kn,GiftOutlineIcon:()=>On,GoogleKeepIcon:()=>Dn,GroupIcon:()=>Tn,HashtagFilledIcon:()=>Fn,HashtagIcon:()=>Ln,HashtagOffIcon:()=>Un,HeartFilledIcon:()=>Kn,HelpFilledIcon:()=>Gn,HelpIcon:()=>zn,HistoryIcon:()=>Wn,HistoryLockedIllustration:()=>Jn,IconsSpriteStylekit:()=>$n,IlNotesIcon:()=>tr,ImageIcon:()=>rr,IndentIcon:()=>or,InfoIcon:()=>ar,ItalicIcon:()=>cr,KeyboardCloseIcon:()=>dr,KeyboardCommandIcon:()=>pr,KeyboardFilledIcon:()=>gr,KeyboardIcon:()=>yr,KeyboardOptionIcon:()=>Ar,KeyboardShiftIcon:()=>wr,KeyboardShowIcon:()=>Cr,LexicalCheck:()=>ha,LexicalCode:()=>fa,LexicalDraggableBlockMenu:()=>fl,LexicalHorizontalRule:()=>ma,LexicalLink:()=>va,LexicalListOL:()=>ba,LexicalListUL:()=>Sa,LexicalPencilFill:()=>hl,LexicalQuote:()=>Ea,LexicalTable:()=>_a,LexicalTextCenter:()=>Pa,LexicalTextJustify:()=>Ba,LexicalTextLeft:()=>Na,LexicalTextParagraph:()=>ja,LexicalTextRight:()=>Ma,LexicalTweet:()=>Ra,LexicalYoutube:()=>Qa,LifebuoyIcon:()=>Ir,LineWidthIcon:()=>xr,LinkIcon:()=>kr,LinkOffIcon:()=>Or,ListBulleted:()=>Dr,ListNumbered:()=>Lr,ListedFilledIcon:()=>Tr,ListedIcon:()=>Fr,LockFilledIcon:()=>Ur,LockIcon:()=>Kr,MarkdownIcon:()=>Gr,MenuArrowDownAlt:()=>zr,MenuArrowDownIcon:()=>Wr,MenuArrowRightIcon:()=>Jr,MenuCloseIcon:()=>$r,MenuOpenIcon:()=>ti,MenuVariantIcon:()=>ri,MergeIcon:()=>oi,MoreIcon:()=>ai,MoreVertIcon:()=>ci,NoPreviewIllustration:()=>di,NotesFilledIcon:()=>pi,NotesIcon:()=>gi,OpenInIcon:()=>yi,OutdentIcon:()=>Ai,PasswordIcon:()=>wi,PencilFilledIcon:()=>Ci,PencilIcon:()=>Ii,PencilOffIcon:()=>xi,PinFilledIcon:()=>ki,PinIcon:()=>Oi,PlainTextIcon:()=>Di,PlusCircleFilledIcon:()=>Ti,PlusCircleIcon:()=>Fi,PremiumFeatureIcon:()=>Li,PremiumIllustration:()=>Ui,PrintIcon:()=>Ki,ProtectedIllustration:()=>Gi,RedoIcon:()=>zi,ReorderIcon:()=>Wi,ReplaceAllIcon:()=>Ji,ReplaceIcon:()=>$i,RestoreIcon:()=>to,RichTextIcon:()=>ro,SNLogoAltIcon:()=>Qo,SNLogoFull:()=>Vo,SNLogoIcon:()=>Ho,SafeIcon:()=>oo,SafeSquareFilledIcon:()=>ao,SafeSquareIcon:()=>co,SaveIcon:()=>ho,SearchIcon:()=>fo,SearchIosIcon:()=>mo,SecurityIcon:()=>vo,SelectAllIcon:()=>bo,SendIcon:()=>So,ServerIcon:()=>Eo,SettingsFilledIcon:()=>_o,SettingsIcon:()=>Po,ShareIcon:()=>Bo,ShortcutButtonIcon:()=>No,SignInIcon:()=>jo,SignOutIcon:()=>Mo,SimplenoteIcon:()=>Ro,SortDescendingIcon:()=>Yo,SpreadsheetsIcon:()=>Zo,StarCircleFilled:()=>qo,StarFilledIcon:()=>Xo,StarIcon:()=>es,StarVariantFilledIcon:()=>ns,StrikethroughIcon:()=>is,SubscriptIcon:()=>ss,SubtractIcon:()=>ls,SuperscriptIcon:()=>us,SyncIcon:()=>hs,TableOfContentsIcon:()=>ua,TasksIcon:()=>fs,TextCircleIcon:()=>ms,TextIcon:()=>vs,TextParagraphLongIcon:()=>bs,ThemesFilledIcon:()=>Ss,ThemesIcon:()=>Es,TimerIcon:()=>_s,TrashFilledIcon:()=>Ps,TrashIcon:()=>Bs,TrashSweepFilledIcon:()=>Ns,TrashSweepIcon:()=>js,TuneIcon:()=>Ms,TypeBold:()=>Va,TypeH1:()=>Ha,TypeH2:()=>Ya,TypeH3:()=>Za,TypeH4:()=>qa,TypeH5:()=>Xa,TypeH6:()=>el,TypeItalic:()=>nl,TypeStrikethrough:()=>il,TypeSubscript:()=>sl,TypeSuperscript:()=>ll,TypeUnderline:()=>ul,UnarchiveIcon:()=>Rs,UnderlineIcon:()=>Qs,UndoIcon:()=>Vs,UnpinIcon:()=>Hs,UploadIcon:()=>Ys,UserAddIcon:()=>Zs,UserFilledIcon:()=>qs,UserIcon:()=>Xs,UserSwitch:()=>ea,ViewIcon:()=>na,WarningIcon:()=>ia,WindowIcon:()=>sa});var e=n(694);function t(){return t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},t.apply(this,arguments)}const i=function(n){return e.createElement("svg",t({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),e.createElement("path",{d:"M17.5 7.5h-5v10.833h-1.667v-5H9.167v5H7.5V7.5h-5V5.833h15V7.5ZM10 1.667A1.667 1.667 0 1 1 10 5a1.667 1.667 0 0 1 0-3.333Z"}))};function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}const s=function(t){return e.createElement("svg",o({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M18.333 2.5H1.667A1.729 1.729 0 0 0 0 4.167v11.666A1.728 1.728 0 0 0 1.667 17.5h16.666A1.728 1.728 0 0 0 20 15.833V4.167A1.728 1.728 0 0 0 18.333 2.5Zm0 13.333H1.667V4.167h16.666v11.666Zm-6.666-1.666v-1.042c0-1.383-2.784-2.083-4.167-2.083s-4.167.7-4.167 2.083v1.042h8.334ZM7.5 5.833A2.083 2.083 0 1 0 7.5 10a2.083 2.083 0 0 0 0-4.167Zm4.167 0v.834h5v-.834h-5Zm0 1.667v.833h5V7.5h-5Zm0 1.667V10H15v-.833h-3.333Z"}))};function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a.apply(this,arguments)}const l=function(t){return e.createElement("svg",a({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 16a6.027 6.027 0 0 1-5-2.667c.025-1.666 3.333-2.583 5-2.583 1.667 0 4.975.917 5 2.583A6.027 6.027 0 0 1 10 16Zm0-11.833a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5Zm0-2.5A8.333 8.333 0 1 0 18.333 10c0-4.608-3.75-8.333-8.333-8.333Z"}))};function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}const u=function(t){return e.createElement("svg",c({width:120,height:120,fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("circle",{cx:60,cy:60,r:60,fill:"#F4F5F7"}),e.createElement("g",{filter:"url(#a)"},e.createElement("rect",{x:31,y:31,width:58,height:58,rx:4,fill:"#fff"}),e.createElement("rect",{x:64,y:45,width:17,height:4,rx:2,fill:"#BBBEC4"}),e.createElement("rect",{x:64,y:51,width:17,height:4,rx:2,fill:"#BBBEC4"}),e.createElement("rect",{x:64,y:57,width:17,height:4,rx:2,fill:"#BBBEC4"}),e.createElement("path",{d:"M54 45a7.5 7.5 0 1 1 0 15 7.5 7.5 0 0 1 0-15Zm0 16.875c5.006 0 15 2.494 15 7.5V75H39v-5.625c0-5.006 9.994-7.5 15-7.5Z",fill:"#BBBEC4"})),e.createElement("defs",null,e.createElement("filter",{id:"a",x:19,y:23,width:82,height:82,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},e.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),e.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.createElement("feOffset",{dy:4}),e.createElement("feGaussianBlur",{stdDeviation:6}),e.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.16 0"}),e.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_118_16"}),e.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_118_16",result:"shape"}))))};function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d.apply(this,arguments)}const h=function(t){return e.createElement("svg",d({viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("circle",{cx:16,cy:16,r:16,fill:"#DFE1E4"}),e.createElement("path",{d:"M16 5a6.5 6.5 0 1 1 0 13 6.5 6.5 0 0 1 0-13Zm0 14.625c4.339 0 13 2.161 13 6.5V32H3v-5.875c0-4.339 8.661-6.5 13-6.5Z"}))};function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p.apply(this,arguments)}const f=function(t){return e.createElement("svg",p({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{clipRule:"evenodd",d:"M11.385 11.385h4.23a1.385 1.385 0 0 0 0-2.77h-4.23v-4.23a1.385 1.385 0 1 0-2.77 0v4.23h-4.23a1.385 1.385 0 0 0 0 2.77h4.23v4.23a1.385 1.385 0 0 0 2.77 0v-4.23Z"}))};function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},g.apply(this,arguments)}const m=function(t){return e.createElement("svg",g({viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M13.6 8a.8.8 0 0 1-.8.8h-4v4a.8.8 0 1 1-1.6 0v-4h-4a.8.8 0 1 1 0-1.6h4v-4a.8.8 0 0 1 1.6 0v4h4a.8.8 0 0 1 .8.8Z"}))};function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},y.apply(this,arguments)}const v=function(t){return e.createElement("svg",y({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M1.667 13.333h6.666v-1.666H1.667v1.666ZM15 11.667V8.333h-1.667v3.334H10v1.666h3.333v3.334H15v-3.334h3.333v-1.666H15ZM11.667 5h-10v1.667h10V5Zm0 3.333h-10V10h10V8.333Z"}))};function A(){return A=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},A.apply(this,arguments)}const b=function(t){return e.createElement("svg",A({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},t),e.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M19.59 40a2.4 2.4 0 0 1-3.28-.88l-.48-.82A2.4 2.4 0 0 1 20 35.91l.48.82a2.42 2.42 0 0 1-.89 3.27Zm10.85 0a2.4 2.4 0 0 1-3.28-.88l-5.64-9.76A2.4 2.4 0 1 1 25.68 27l5.64 9.77a2.39 2.39 0 0 1-.88 3.23Zm10.86 0a2.42 2.42 0 0 1-3.3-.86L25.67 17.75a1.92 1.92 0 0 0-3.33 0L10 39.14a2.42 2.42 0 0 1-2.09 1.2A2.37 2.37 0 0 1 6.7 40a2.4 2.4 0 0 1-.88-3.28l16.1-27.86a2.4 2.4 0 0 1 4.16 0l16.1 27.88A2.4 2.4 0 0 1 41.3 40Z"}))};function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w.apply(this,arguments)}const S=function(t){return e.createElement("svg",w({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M15.444 12.333h-3.11a2.333 2.333 0 1 1-4.667 0H4.556V4.556h10.888v7.777Zm0-9.333H4.556C3.692 3 3 3.7 3 4.556v10.888A1.556 1.556 0 0 0 4.556 17h10.888A1.556 1.556 0 0 0 17 15.444V4.556A1.556 1.556 0 0 0 15.444 3Z"}),e.createElement("path",{d:"M13.111 8.444h-1.555V6.111H8.444v2.333H6.89L10 11.555l3.111-3.11Z"}))};function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},C.apply(this,arguments)}const E=function(t){return e.createElement("svg",C({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m6.417 6.908 3.825 3.825 3.825-3.825 1.175 1.183-5 5-5-5 1.175-1.183Z",fill:"currentColor"}))};function I(){return I=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},I.apply(this,arguments)}const _=function(t){return e.createElement("svg",I({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M9.234 3.4H10.9v10l3.992-3.992a.837.837 0 0 1 1.183 1.184L10.067 16.6 4.059 10.59a.837.837 0 1 1 1.183-1.183L9.234 13.4v-10Z"}))};function x(){return x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},x.apply(this,arguments)}const P=function(t){return e.createElement("svg",x({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M16.667 9.167v1.666h-10l3.991 3.992a.837.837 0 1 1-1.183 1.183L3.467 10l6.008-6.008a.837.837 0 1 1 1.183 1.183L6.667 9.167h10Z"}))};function k(){return k=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},k.apply(this,arguments)}const B=function(t){return e.createElement("svg",k({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M3.467 10.833V9.167h10L9.475 5.175a.837.837 0 1 1 1.183-1.183L16.667 10l-6.009 6.008a.837.837 0 1 1-1.183-1.183l3.992-3.992h-10Z"}))};function O(){return O=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},O.apply(this,arguments)}const N=function(t){return e.createElement("svg",O({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m17.5 7.5-3.333-3.333v2.5H8.333v1.666h5.834v2.5L17.5 7.5ZM5.833 9.167 2.5 12.5l3.333 3.333v-2.5h5.834v-1.666H5.833v-2.5Z"}))};function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},D.apply(this,arguments)}const j=function(t){return e.createElement("svg",D({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M7.5 2.5 4.167 5.833h2.5v5.834h1.666V5.833h2.5L7.5 2.5Z"}),e.createElement("path",{d:"M13.333 8.333v5.834h2.5L12.5 17.5l-3.334-3.333h2.5V8.333h1.667Z",fill:"#086DD6"}))};function T(){return T=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},T.apply(this,arguments)}const M=function(t){return e.createElement("svg",T({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M7.5 2.5 4.167 5.833h2.5v5.834h1.666V5.833h2.5L7.5 2.5Z",fill:"#086DD6"}),e.createElement("path",{d:"M13.333 8.333v5.834h2.5L12.5 17.5l-3.334-3.333h2.5V8.333h1.667Z"}))};function F(){return F=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},F.apply(this,arguments)}const R=function(t){return e.createElement("svg",F({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M7.5 2.5 4.167 5.833h2.5v5.834h1.666V5.833h2.5L7.5 2.5Zm1.667 11.667L12.5 17.5l3.333-3.333h-2.5V8.333h-1.666v5.834h-2.5Z"}))};function L(){return L=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},L.apply(this,arguments)}const Q=function(t){return e.createElement("svg",L({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10.9 16.6H9.234v-10l-3.992 3.992a.837.837 0 0 1-1.183-1.184L10.067 3.4l6.008 6.008a.837.837 0 1 1-1.183 1.184L10.9 6.6v10Z"}))};function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U.apply(this,arguments)}const V=function(t){return e.createElement("svg",U({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M8.55 3h2.9l-.573 5.537 4.674-3.248L17 7.711 11.754 10 17 12.289l-1.45 2.422-4.673-3.248.572 5.537H8.551l.572-5.537-4.674 3.248L3 12.289 8.246 10 3 7.711l1.45-2.422 4.673 3.248L8.551 3Z"}))};function K(){return K=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},K.apply(this,arguments)}const H=function(t){return e.createElement("svg",K({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M15.417 13.333H5.833a3.333 3.333 0 0 1 0-6.666H16.25a2.083 2.083 0 0 1 0 4.166H7.5a.833.833 0 1 1 0-1.666h7.917v-1.25H7.5a2.083 2.083 0 1 0 0 4.166h8.75a3.333 3.333 0 0 0 0-6.666H5.834a4.583 4.583 0 1 0 0 9.166h9.583v-1.25Z"}))};function G(){return G=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},G.apply(this,arguments)}const Y=function(t){return e.createElement("svg",G({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M9.167 14.167a.833.833 0 1 0 1.666 0 .833.833 0 0 0-1.666 0Zm0-11.667v3.333h1.666v-1.6c2.825.409 5 2.825 5 5.767a5.833 5.833 0 1 1-11.666 0c0-1.4.491-2.683 1.316-3.683L10 10.833l1.175-1.175-5.667-5.666v.016A7.46 7.46 0 0 0 2.5 10 7.5 7.5 0 1 0 10 2.5h-.833ZM15 10a.833.833 0 1 0-1.667 0A.833.833 0 0 0 15 10ZM5 10a.833.833 0 1 0 1.667 0A.833.833 0 0 0 5 10Z"}))};function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},z.apply(this,arguments)}const Z=function(t){return e.createElement("svg",z({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M9.167 14.167a.833.833 0 1 0 1.666 0 .833.833 0 0 0-1.666 0Zm0-11.667v3.333h1.666v-1.6c2.825.409 5 2.825 5 5.767a5.833 5.833 0 1 1-11.666 0c0-1.4.491-2.683 1.316-3.683L10 10.833l1.175-1.175-5.667-5.666v.016A7.46 7.46 0 0 0 2.5 10 7.5 7.5 0 1 0 10 2.5h-.833ZM15 10a.833.833 0 1 0-1.667 0A.833.833 0 0 0 15 10ZM5 10a.833.833 0 1 0 1.667 0A.833.833 0 0 0 5 10Z"}))};function W(){return W=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},W.apply(this,arguments)}const q=function(t){return e.createElement("svg",W({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M12.36 16.964a1.136 1.136 0 0 0 1.929-.806c0-.308-.13-.601-.358-.821L8.397 9.949l5.534-5.37a1.17 1.17 0 0 0 .358-.823c0-.626-.513-1.13-1.14-1.13-.317 0-.577.105-.789.317L6.118 9.046c-.277.269-.415.562-.415.912 0 .341.13.634.415.911l6.242 6.095Z"}))};function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},J.apply(this,arguments)}const X=function(t){return e.createElement("svg",J({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},t),e.createElement("path",{fill:"currentColor",d:"m11.4 16 2.6-2.6 2.6 2.6 1.4-1.4-2.6-2.6L18 9.4 16.6 8 14 10.6 11.4 8 10 9.4l2.6 2.6-2.6 2.6 1.4 1.4ZM3 12l4.35-6.15q.275-.4.713-.625T9 5h10q.825 0 1.413.588T21 7v10q0 .825-.588 1.413T19 19H9q-.5 0-.938-.225t-.712-.625L3 12Z"}))};function $(){return $=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$.apply(this,arguments)}const ee=function(t){return e.createElement("svg",$({width:9,height:14,xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M1.667 3.333a1.667 1.667 0 1 1 0-3.333 1.667 1.667 0 0 1 0 3.333Zm0 5a1.667 1.667 0 1 1 0-3.333 1.667 1.667 0 0 1 0 3.333Zm0 5a1.667 1.667 0 1 1 0-3.333 1.667 1.667 0 0 1 0 3.333Zm5-10a1.667 1.667 0 1 1 0-3.333 1.667 1.667 0 0 1 0 3.333Zm0 5a1.667 1.667 0 1 1 0-3.333 1.667 1.667 0 0 1 0 3.333Zm0 5a1.667 1.667 0 1 1 0-3.333 1.667 1.667 0 0 1 0 3.333Z",fill:"currentColor",fillRule:"nonzero"}))};function te(){return te=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},te.apply(this,arguments)}const ne=function(t){return e.createElement("svg",te({viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M9.372 12.747a6.167 6.167 0 0 0 3.381-8.04 6.167 6.167 0 0 0-8.041-3.375A6.167 6.167 0 0 0 1.33 9.37a6.167 6.167 0 0 0 8.042 3.376Z",fill:"#BED7FE"}))};function re(){return re=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},re.apply(this,arguments)}const ie=function(t){return e.createElement("svg",re({viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10.024 15.201c.505 0 .93-.058 1.275-.175.352-.123.636-.288.853-.495.224-.208.384-.45.48-.73.102-.285.153-.59.153-.914 0-.66-.223-1.18-.67-1.555-.442-.383-1.142-.574-2.1-.574H7.243v4.443h2.78ZM7.244 4.78v4.375h2.243c.959 0 1.675-.188 2.148-.564.473-.376.71-.917.71-1.623 0-.772-.225-1.329-.672-1.673-.441-.343-1.134-.515-2.08-.515h-2.35ZM9.593 3c.882 0 1.636.087 2.262.263.627.168 1.141.411 1.544.729.403.317.697.706.882 1.166.192.454.288.966.288 1.536 0 .331-.052.652-.154.963-.096.305-.25.593-.46.865a3.356 3.356 0 0 1-.777.72 4.462 4.462 0 0 1-1.112.534c1.956.422 2.934 1.475 2.934 3.16 0 .596-.112 1.144-.336 1.643-.217.493-.537.92-.958 1.284-.416.356-.93.635-1.544.836-.614.2-1.314.301-2.1.301H5V3h4.593Z"}))};function oe(){return oe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oe.apply(this,arguments)}const se=function(t){return e.createElement("svg",oe({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M3 3h14v3.111H3V3Zm.778 3.889h12.444V17H3.778V6.889Zm4.278 2.333a.389.389 0 0 0-.39.39v1.166h4.667V9.61a.389.389 0 0 0-.389-.389H8.056Z"}))};function ae(){return ae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ae.apply(this,arguments)}const le=function(t){return e.createElement("svg",ae({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M16.222 17H3.778V8.444h1.555v7h9.334v-7h1.555V17ZM3 3h14v4.667H3V3Zm5.056 6.222h3.888c.218 0 .39.171.39.39v1.166H7.666V9.61c0-.218.17-.389.389-.389Zm-3.5-4.666V6.11h10.888V4.556H4.556Z"}))};function ce(){return ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ce.apply(this,arguments)}const ue=function(t){return e.createElement("svg",ce({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M16.667 3.333h-2.642L12.5 1.667h-5L5.975 3.333H3.333A1.667 1.667 0 0 0 1.667 5v10a1.667 1.667 0 0 0 1.666 1.667h13.334A1.667 1.667 0 0 0 18.333 15V5a1.667 1.667 0 0 0-1.666-1.667Zm0 11.667H3.333V5h3.375l1.525-1.667h3.534L13.292 5h3.375v10ZM10 5.833a4.167 4.167 0 1 0 0 8.334 4.167 4.167 0 0 0 0-8.334Zm0 6.667a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5Z"}))};function de(){return de=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},de.apply(this,arguments)}const he=function(t){return e.createElement("svg",de({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 9 16"},t),e.createElement("path",{fill:"currentColor",d:"M7.62 7.18 2.79 3.03c-.7-.6-1.79-.1-1.79.82v8.29c0 .93 1.09 1.42 1.79.82l4.83-4.14c.5-.43.5-1.21 0-1.64Z"}))};function pe(){return pe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pe.apply(this,arguments)}const fe=function(t){return e.createElement("svg",pe({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M.41 13.41 6 19l1.41-1.42L1.83 12 .41 13.41Zm21.83-7.83L11.66 16.17 7.5 12l-1.43 1.41L11.66 19l12-12-1.42-1.42ZM18 7l-1.41-1.42-6.35 6.35 1.42 1.41L18 7Z"}))};function ge(){return ge=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ge.apply(this,arguments)}const me=function(t){return e.createElement("svg",ge({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m7.5 17.017-5.175-5.175 2.358-2.359L7.5 12.308l8.233-8.241 2.359 2.358L7.5 17.017Z"}))};function ye(){return ye=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ye.apply(this,arguments)}const ve=function(t){return e.createElement("svg",ye({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.005 18.34a8.335 8.335 0 1 0 0-16.67 8.335 8.335 0 0 0 0 16.67ZM8.57 14 5 10.16l1.007-1.09 2.564 2.756L13.993 6 15 7.09 8.571 14Z",fill:"currentColor"}))};function Ae(){return Ae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ae.apply(this,arguments)}const be=function(t){return e.createElement("svg",Ae({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 1.667c-4.583 0-8.333 3.75-8.333 8.333s3.75 8.333 8.333 8.333 8.333-3.75 8.333-8.333S14.583 1.667 10 1.667Zm0 15A6.676 6.676 0 0 1 3.333 10 6.676 6.676 0 0 1 10 3.333 6.676 6.676 0 0 1 16.667 10 6.676 6.676 0 0 1 10 16.667Zm3.825-10.35-5.492 5.491-2.158-2.15L5 10.833l3.333 3.334L15 7.5l-1.175-1.183Z"}))};function we(){return we=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},we.apply(this,arguments)}const Se=function(t){return e.createElement("svg",we({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m17.5 5.833-10 10-4.583-4.583 1.175-1.175 3.408 3.4 8.825-8.817L17.5 5.833Z"}))};function Ce(){return Ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ce.apply(this,arguments)}const Ee=function(t){return e.createElement("svg",Ce({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},t),e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zM3.854 2.146a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 1 1 .708-.708L2 3.293l1.146-1.147a.5.5 0 0 1 .708 0zm0 4a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 1 1 .708-.708L2 7.293l1.146-1.147a.5.5 0 0 1 .708 0zm0 4a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 0 1 .708-.708l.146.147 1.146-1.147a.5.5 0 0 1 .708 0z"}))};function Ie(){return Ie=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ie.apply(this,arguments)}const _e=function(t){return e.createElement("svg",Ie({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m6.176 7.15 3.825 3.825 3.825-3.825 1.175 1.183-5 5-5-5L6.176 7.15Z"}))};function xe(){return xe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xe.apply(this,arguments)}const Pe=function(t){return e.createElement("svg",xe({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m13.092 6.417-3.824 3.825 3.824 3.825-1.183 1.175-5-5 5-5 1.183 1.175Z"}))};function ke(){return ke=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ke.apply(this,arguments)}const Be=function(t){return e.createElement("svg",ke({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m6.91 14.067 3.824-3.825L6.91 6.417l1.184-1.175 5 5-5 5-1.184-1.175Z"}))};function Oe(){return Oe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Oe.apply(this,arguments)}const Ne=function(t){return e.createElement("svg",Oe({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m13.826 13.334-3.825-3.825-3.825 3.825-1.175-1.184 5-5 5 5-1.175 1.184Z"}))};function De(){return De=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},De.apply(this,arguments)}const je=function(t){return e.createElement("svg",De({viewBox:"0 0 55 55",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},t),e.createElement("rect",{opacity:.36,width:54.564,height:54.564,rx:27.282,fill:"url(#a)"}),e.createElement("defs",null,e.createElement("pattern",{id:"a",patternContentUnits:"objectBoundingBox",width:.082,height:.082},e.createElement("use",{xlinkHref:"#b",transform:"scale(.00916)"})),e.createElement("image",{id:"b",width:9,height:9,xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAtSURBVHgB1dChDQAACAPBHwn23wVWAYMkxdKkVacKkF1jj80oyDfoFxgD1UdRPHMLOJmKMAEAAAAASUVORK5CYII="})))};function Te(){return Te=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Te.apply(this,arguments)}const Me=function(t){return e.createElement("svg",Te({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M12.946 12.946a.833.833 0 0 1-1.178 0L10 11.178l-1.768 1.768a.833.833 0 1 1-1.178-1.178L8.82 10 7.054 8.232a.833.833 0 1 1 1.178-1.178L10 8.82l1.768-1.767a.833.833 0 1 1 1.178 1.178L11.178 10l1.768 1.768a.833.833 0 0 1 0 1.178Zm2.946-8.839A8.334 8.334 0 1 0 4.107 15.893 8.334 8.334 0 0 0 15.892 4.107Z",fill:"currentColor"}))};function Fe(){return Fe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fe.apply(this,arguments)}const Re=function(t){return e.createElement("svg",Fe({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("circle",{cx:10,cy:10,r:10,fill:"#F4F5F7"}),e.createElement("path",{d:"M14.197 6.743a.665.665 0 1 0-.94-.94L10 9.06 6.743 5.803a.665.665 0 0 0-.94.94L9.06 10l-3.257 3.257a.665.665 0 0 0 .94.94L10 10.94l3.257 3.257a.665.665 0 1 0 .94-.94L10.94 10l3.257-3.257Z",fill:"#515357"}))};function Le(){return Le=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Le.apply(this,arguments)}const Qe=function(t){return e.createElement("svg",Le({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},t),e.createElement("path",{fill:"currentColor",d:"M12 20a8 8 0 0 0 8-8 8 8 0 0 0-8-8 8 8 0 0 0-8 8 8 8 0 0 0 8 8m0-18a10 10 0 0 1 10 10 10 10 0 0 1-10 10C6.47 22 2 17.5 2 12A10 10 0 0 1 12 2m.5 5v5.25l4.5 2.67-.75 1.23L11 13V7z"}))};function Ue(){return Ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ue.apply(this,arguments)}const Ve=function(t){return e.createElement("svg",Ue({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M15.246 5.93a.83.83 0 1 0-1.175-1.176L10 8.825l-4.072-4.07a.83.83 0 1 0-1.175 1.174L8.825 10l-4.07 4.07a.83.83 0 1 0 1.174 1.176L10 11.176l4.07 4.07a.83.83 0 1 0 1.176-1.175L11.176 10l4.07-4.072Z"}))};function Ke(){return Ke=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ke.apply(this,arguments)}const He=function(t){return e.createElement("svg",Ke({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M6.442 8.333 13.108 15H5a3.333 3.333 0 0 1 0-6.667h1.442ZM2.5 4.392l2.292 2.275C2.133 6.792 0 8.975 0 11.667a5 5 0 0 0 5 5h9.775l1.667 1.666 1.058-1.058L3.558 3.333 2.5 4.392Zm13.625 3.966A6.242 6.242 0 0 0 10 3.333a6.09 6.09 0 0 0-3.333.975l1.208 1.217a4.583 4.583 0 0 1 6.708 4.058V10h1.25a2.5 2.5 0 0 1 2.5 2.5c0 .942-.533 1.758-1.3 2.183l1.209 1.209A4.17 4.17 0 0 0 20 12.5c0-2.2-1.708-3.983-3.875-4.142Z"}))};function Ge(){return Ge=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ge.apply(this,arguments)}const Ye=function(t){return e.createElement("svg",Ge({viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m10.742 2.5 1.633.333L9.258 17.5l-1.633-.333L10.742 2.5Zm5.583 7.5-2.992-2.992V4.65l5.35 5.35-5.35 5.342v-2.359L16.325 10ZM1.317 10l5.35-5.35v2.358L3.675 10l2.992 2.983v2.359L1.317 10Z"}))};function ze(){return ze=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ze.apply(this,arguments)}const Ze=function(t){return e.createElement("svg",ze({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M12.167 13.833 16 10l-3.833-3.833L13.333 5l5 5-5 5-1.166-1.167Zm-4.334 0L4 10l3.833-3.833L6.667 5l-5 5 5 5 1.166-1.167Z"}))};function We(){return We=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},We.apply(this,arguments)}const qe=function(t){return e.createElement("svg",We({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M15.833 11.583s-1.666 1.809-1.666 2.917a1.667 1.667 0 1 0 3.333 0c0-1.108-1.667-2.917-1.667-2.917Zm-11.491-1.25 3.991-3.991 3.992 3.991H4.342ZM13.8 9.45 6.35 2 5.175 3.175l1.983 1.983L2.867 9.45c-.492.467-.492 1.275 0 1.767L7.45 15.8c.242.242.567.367.883.367.317 0 .642-.125.884-.367l4.583-4.583c.492-.492.492-1.3 0-1.767Z"}))};function Je(){return Je=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Je.apply(this,arguments)}const Xe=function(t){return e.createElement("svg",Je({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M1.667 3.666a2 2 0 0 1 2-2h7.667a2 2 0 0 1 2 2v9.667H3.667a2 2 0 0 1-2-2V3.666Zm14.667 3a2 2 0 0 1 2 2v7.667a2 2 0 0 1-2 2H8.667a2 2 0 0 1-2-2V15h8.334V6.666h1.333Zm-13-3.333v8.333h8.333V3.333H3.334Z"}))};function $e(){return $e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$e.apply(this,arguments)}const et=function(t){return e.createElement("svg",$e({width:320,height:292,fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},t),e.createElement("path",{opacity:.36,d:"M28.293 250.445s119.325-68.117 263.415 0H28.293Z",fill:"url(#a)"}),e.createElement("path",{d:"M91.802 33.601 28.69 47.885a4.8 4.8 0 0 0-3.622 5.741l21.7 95.884a4.8 4.8 0 0 0 5.742 3.622l63.112-14.283a4.8 4.8 0 0 0 3.622-5.742l-21.7-95.883a4.8 4.8 0 0 0-5.742-3.623Z",fill:"#3F3D56"}),e.createElement("path",{d:"M31.3 65.229a2.144 2.144 0 1 0 0-4.288 2.144 2.144 0 0 0 0 4.288ZM33.443 73.09a2.144 2.144 0 1 0 0-4.287 2.144 2.144 0 0 0 0 4.287ZM47.377 130.616a2.144 2.144 0 1 0 0-4.288 2.144 2.144 0 0 0 0 4.288ZM49.521 138.476a2.144 2.144 0 1 0 0-4.288 2.144 2.144 0 0 0 0 4.288Z",fill:"#fff"}),e.createElement("path",{d:"m91.536 73.477-43.518 9.85 1.642 7.252 43.518-9.849-1.642-7.253Z",fill:"#F5F5F5"}),e.createElement("path",{d:"M149.289 70.248 76.813 86.65l23.819 105.248 72.477-16.403-23.82-105.247Z",fill:"#2B6FCF"}),e.createElement("path",{d:"m225.719 52.95-72.476 16.403 23.819 105.248 72.476-16.403-23.819-105.247Z",fill:"#3F3D56"}),e.createElement("path",{d:"m135.842 85.268-43.518 9.85 1.641 7.252 43.518-9.849-1.641-7.253ZM147.062 101.154l-58.024 13.132.41 1.813 58.024-13.131-.41-1.814ZM148.019 105.386l-58.024 13.132.41 1.813 58.025-13.132-.411-1.813ZM148.977 109.616l-58.024 13.132.41 1.813 58.024-13.132-.41-1.813ZM119.713 120.687l-27.803 6.292.41 1.814 27.804-6.293-.411-1.813ZM124.902 123.96l-32.034 7.25.41 1.813 32.035-7.25-.411-1.813ZM151.849 122.31l-58.024 13.131.41 1.814 58.025-13.132-.411-1.813ZM152.807 126.541l-58.024 13.132.41 1.813 58.025-13.132-.411-1.813ZM149.533 131.729 95.74 143.903l.41 1.814 53.794-12.175-.411-1.813ZM154.722 135.003l-58.024 13.132.41 1.813 58.025-13.132-.411-1.813ZM127.876 145.526l-30.22 6.839.41 1.813 30.221-6.839-.411-1.813Z",fill:"#F5F5F5"}),e.createElement("path",{opacity:.3,d:"m209.358 132.168-32.034 7.25.411 1.813 32.034-7.25-.411-1.813ZM236.306 130.517l-58.024 13.131.41 1.814 58.024-13.132-.41-1.813ZM237.263 134.747l-58.024 13.132.411 1.813 58.024-13.132-.411-1.813ZM233.99 139.936l-53.793 12.174.41 1.814 53.793-12.175-.41-1.813ZM239.178 143.209l-58.024 13.132.411 1.813 58.024-13.132-.411-1.813Z",fill:"#2B6FCF"}),e.createElement("path",{d:"m156.112 146.76-35.056 7.934 5.471 24.177 35.057-7.934-5.472-24.177Z",fill:"#F5F5F5"}),e.createElement("path",{opacity:.3,d:"m197.607 66.207-35.056 7.934 5.471 24.176 35.057-7.933-5.472-24.177ZM231.919 91.481l-35.056 7.934 5.471 24.177 35.057-7.934-5.472-24.177Z",fill:"#2B6FCF"}),e.createElement("g",{opacity:.5,fill:"#47E6B1"},e.createElement("path",{opacity:.5,d:"M67.386 214.327h-1.072v6.074h1.072v-6.074Z"}),e.createElement("path",{opacity:.5,d:"M69.888 217.9v-1.072h-6.075v1.072h6.075Z"})),e.createElement("g",{opacity:.5,fill:"#47E6B1"},e.createElement("path",{opacity:.5,d:"M184.224 32h-1.072v6.074h1.072V32Z"}),e.createElement("path",{opacity:.5,d:"M186.726 35.573v-1.072h-6.075v1.072h6.075Z"})),e.createElement("g",{opacity:.5,fill:"#47E6B1"},e.createElement("path",{opacity:.5,d:"M317.499 76.663h-1.072v6.074h1.072v-6.074Z"}),e.createElement("path",{opacity:.5,d:"M320 80.236v-1.072h-6.074v1.072H320Z"})),e.createElement("path",{opacity:.5,d:"M128.733 213.722a1.314 1.314 0 0 1-.732-1.587.651.651 0 0 0 .029-.146.662.662 0 0 0-.43-.657.656.656 0 0 0-.826.35 1.31 1.31 0 0 1-1.587.732.654.654 0 0 0-.145-.029.663.663 0 0 0-.658.43.656.656 0 0 0 .351.826 1.314 1.314 0 0 1 .731 1.587.655.655 0 0 0 .814.817.656.656 0 0 0 .34-.235.61.61 0 0 0 .073-.129c.129-.296.362-.534.654-.669.293-.134.625-.157.933-.063a.659.659 0 0 0 .803-.401.656.656 0 0 0-.35-.826ZM180.97 258.26a1.316 1.316 0 0 1-.669-.654 1.319 1.319 0 0 1-.063-.933.651.651 0 0 0 .029-.146.662.662 0 0 0-.43-.657.656.656 0 0 0-.826.35 1.31 1.31 0 0 1-1.587.732.651.651 0 0 0-.146-.029.662.662 0 0 0-.657.43.656.656 0 0 0 .35.826 1.31 1.31 0 0 1 .732 1.587.654.654 0 0 0-.029.145.663.663 0 0 0 .43.658.656.656 0 0 0 .826-.35c.129-.296.362-.534.654-.669.293-.134.625-.157.933-.063a.654.654 0 0 0 .145.029.663.663 0 0 0 .658-.43.656.656 0 0 0-.35-.826ZM4.391 107.5a1.313 1.313 0 0 1-.731-1.587.628.628 0 0 0-.077-.545.656.656 0 0 0-1.15.093 1.315 1.315 0 0 1-1.587.731.657.657 0 0 0-.453 1.227 1.317 1.317 0 0 1 .732 1.587.627.627 0 0 0 .077.546.66.66 0 0 0 1.077.036.622.622 0 0 0 .073-.129 1.31 1.31 0 0 1 1.587-.732.657.657 0 0 0 .145.029.665.665 0 0 0 .658-.429.66.66 0 0 0-.221-.754.64.64 0 0 0-.13-.073ZM313.529 161.788a1.31 1.31 0 0 1-.731-1.587.651.651 0 0 0-.078-.545.652.652 0 0 0-.737-.272.66.66 0 0 0-.34.235.722.722 0 0 0-.073.13 1.31 1.31 0 0 1-1.586.731.653.653 0 0 0-.546.078.658.658 0 0 0-.036 1.077c.04.029.083.053.129.072a1.318 1.318 0 0 1 .732 1.587.6.6 0 0 0-.029.146.653.653 0 0 0 .429.657.659.659 0 0 0 .754-.221.63.63 0 0 0 .073-.129 1.31 1.31 0 0 1 1.586-.732.62.62 0 0 0 .546-.077.662.662 0 0 0 .272-.737.658.658 0 0 0-.365-.413Z",fill:"#4D8AF0"}),e.createElement("path",{opacity:.5,d:"M38.445 196.819a2.144 2.144 0 1 0 0-4.288 2.144 2.144 0 0 0 0 4.288Z",fill:"#F55F44"}),e.createElement("path",{opacity:.5,d:"M114.907 36.288a2.144 2.144 0 1 0 0-4.288 2.144 2.144 0 0 0 0 4.288Z",fill:"#4D8AF0"}),e.createElement("path",{opacity:.5,d:"M165.716 197.766a2.144 2.144 0 1 0 0-4.288 2.144 2.144 0 0 0 0 4.288Z",fill:"#47E6B1"}),e.createElement("path",{opacity:.5,d:"M289.343 251.362a2.144 2.144 0 1 0 0-4.288 2.144 2.144 0 0 0 0 4.288Z",fill:"#F55F44"}),e.createElement("path",{d:"m248.302 78.978-63.113 14.284a4.801 4.801 0 0 0-3.622 5.741l21.7 95.884a4.8 4.8 0 0 0 5.742 3.622l63.112-14.283a4.8 4.8 0 0 0 3.622-5.742l-21.7-95.883a4.8 4.8 0 0 0-5.741-3.623Z",fill:"#2B6FCF"}),e.createElement("path",{d:"M187.798 110.607a2.143 2.143 0 1 0 0-4.287 2.143 2.143 0 0 0 0 4.287ZM189.942 118.467a2.143 2.143 0 1 0 0-4.286 2.143 2.143 0 0 0 0 4.286ZM203.876 175.994a2.144 2.144 0 1 0 0-4.288 2.144 2.144 0 0 0 0 4.288ZM206.02 183.854a2.144 2.144 0 1 0 0-4.288 2.144 2.144 0 0 0 0 4.288Z",fill:"#fff"}),e.createElement("path",{d:"m248.035 118.855-43.518 9.849 1.642 7.253 43.518-9.849-1.642-7.253Z",fill:"#F5F5F5"}),e.createElement("defs",null,e.createElement("pattern",{id:"a",patternContentUnits:"objectBoundingBox",width:.017,height:.149},e.createElement("use",{xlinkHref:"#b",transform:"scale(.0019 .01652)"})),e.createElement("image",{id:"b",width:9,height:9,xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAtSURBVHgB1dChDQAACAPBHwn23wVWAYMkxdKkVacKkF1jj80oyDfoFxgD1UdRPHMLOJmKMAEAAAAASUVORK5CYII="})))};function tt(){return tt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tt.apply(this,arguments)}const nt=function(t){return e.createElement("svg",tt({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M15.833 4.167v1.666H12.5V4.167h3.333Zm-8.333 0v5H4.167v-5H7.5Zm8.333 6.666v5H12.5v-5h3.333ZM7.5 14.167v1.666H4.167v-1.666H7.5ZM17.5 2.5h-6.667v5H17.5v-5Zm-8.333 0H2.5v8.333h6.667V2.5ZM17.5 9.167h-6.667V17.5H17.5V9.167ZM9.167 12.5H2.5v5h6.667v-5Z"}))};function rt(){return rt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rt.apply(this,arguments)}const it=function(t){return e.createElement("svg",rt({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m5 2.5-3.333 5L10 18.333 18.333 7.5 15 2.5H5Z"}))};function ot(){return ot=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ot.apply(this,arguments)}const st=function(t){return e.createElement("svg",ot({viewBox:"0 0 104 104",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},t),e.createElement("rect",{opacity:.36,y:52,width:73.539,height:73.539,rx:8,transform:"rotate(-45 0 52)",fill:"url(#a)"}),e.createElement("defs",null,e.createElement("pattern",{id:"a",patternContentUnits:"objectBoundingBox",width:.061,height:.061},e.createElement("use",{xlinkHref:"#b",transform:"scale(.0068)"})),e.createElement("image",{id:"b",width:9,height:9,xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAtSURBVHgB1dChDQAACAPBHwn23wVWAYMkxdKkVacKkF1jj80oyDfoFxgD1UdRPHMLOJmKMAEAAAAASUVORK5CYII="})))};function at(){return at=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},at.apply(this,arguments)}const lt=function(t){return e.createElement("svg",at({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M11 3.5v6h1.17L10 11.67 7.83 9.5H9v-6h2Zm2-2H7v6H3l7 7 7-7h-4v-6Zm4 15H3v2h14v-2Z"}))};function ct(){return ct=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ct.apply(this,arguments)}const ut=function(t){return e.createElement("svg",ct({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M17.5 9.167h-15V7.5h15v1.667Zm0 1.666h-15V12.5h15v-1.667Z"}))};function dt(){return dt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dt.apply(this,arguments)}const ht=function(t){return e.createElement("svg",dt({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M8.125 17.375c1.483-.583 1.158-2.192.408-3.208-.741-1.042-1.766-1.759-2.8-2.45A8.18 8.18 0 0 1 3.783 10c-.233-.275-.708-.783-.225-.883.492-.1 1.342.383 1.775.566.759.317 1.509.684 2.209 1.117l.841-1.417c-1.3-.858-2.966-1.616-4.516-1.841-.884-.134-1.817.05-2.117 1.008-.267.825.158 1.658.642 2.308 1.141 1.525 2.916 2.259 4.241 3.575.284.275.625.6.792.984.175.366.133.391-.258.391-1.034 0-2.325-.808-3.167-1.341l-.842 1.416c1.275.784 3.409 2.009 4.967 1.492Zm9.242-13a.463.463 0 0 0 0-.658l-1.084-1.084a.468.468 0 0 0-.65 0l-.85.85 1.734 1.734.85-.842ZM9.167 9.1v1.733H10.9l5.125-5.125-1.733-1.733L9.167 9.1Z"}))};function pt(){return pt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pt.apply(this,arguments)}const ft=function(t){return e.createElement("svg",pt({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M2.5 6.018V4.41h1.667v-.804c0-.892.75-1.607 1.666-1.607h5v5.625l2.084-1.205L15 7.625V2h.833c.875 0 1.667.763 1.667 1.607v12.857c0 .844-.792 1.607-1.667 1.607h-10c-.875 0-1.666-.763-1.666-1.607v-.803H2.5v-1.607h1.667v-3.215H2.5V9.232h1.667V6.018H2.5Zm3.333 3.214H4.167v1.607h1.666V9.232Zm0-3.214V4.41H4.167v1.607h1.666Zm0 9.643v-1.607H4.167v1.607h1.666Z"}))};function gt(){return gt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gt.apply(this,arguments)}const mt=function(t){return e.createElement("svg",gt({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M14.167 3.607V8.43L12.5 6.82 10.833 8.43V3.607H7.5v12.857h8.333V3.607h-1.666ZM2.5 6.017V4.412h1.667v-.804c0-.892.75-1.607 1.666-1.607h10c.875 0 1.667.763 1.667 1.607v12.857c0 .844-.792 1.607-1.667 1.607h-10c-.875 0-1.666-.763-1.666-1.607v-.803H2.5v-1.607h1.667v-3.215H2.5V9.232h1.667V6.018H2.5Zm1.667-1.606v1.607h1.666V4.41H4.167Zm0 11.25h1.666v-1.607H4.167v1.607Zm0-4.822h1.666V9.232H4.167v1.607Z"}))};function yt(){return yt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yt.apply(this,arguments)}const vt=function(t){return e.createElement("svg",yt({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m16.933 7.09.235-.146V4.098l-.765.478L10 8.577 3.599 4.576l-.765-.478v2.846l.235.147 6.667 4.166.265.166.265-.166 6.667-4.166ZM3.334 3.834h13.334c.642 0 1.166.52 1.166 1.167v10a1.167 1.167 0 0 1-1.166 1.167H3.334A1.167 1.167 0 0 1 2.167 15V5a1.16 1.16 0 0 1 1.167-1.167Z",stroke:"#72767E"}))};function At(){return At=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},At.apply(this,arguments)}const bt=function(t){return e.createElement("svg",At({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M3.333 3.333h13.334A1.667 1.667 0 0 1 18.332 5v10a1.667 1.667 0 0 1-1.666 1.667H3.332c-.925 0-1.667-.75-1.667-1.667V5a1.66 1.66 0 0 1 1.667-1.667ZM10 9.167 16.666 5H3.333L10 9.167ZM3.333 15h13.334V6.975L10 11.133 3.333 6.975V15Z"}))};function wt(){return wt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wt.apply(this,arguments)}const St=function(t){return e.createElement("svg",wt({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m16.26 12.167-5 5-1.183-1.184L13.068 13H3.76V3h1.667v8.333h7.641L10.077 8.35l1.183-1.183 5 5Z"}))};function Ct(){return Ct=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ct.apply(this,arguments)}const Et=function(t){return e.createElement("svg",Ct({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},t),e.createElement("path",{fill:"currentColor",d:"M15.09 11.63s.19-1.28.91-1.28c.76 0 1.78 1.71 1.78 1.71s-2.32-.43-2.69-.43M19 4.69c-.36-.6-2.17-1.28-3.11-1.28H13.5S12.7 2 10.88 2c-1.83 0-1.71.81-1.71 1.5v2.82l-.83.87H4.5s-1.06.72-1.06 2.25c0 1.56.48 6.91 3.69 7.41 3.8.58 4.45-1.18 4.45-1.39 0-.9.02-2.25.02-2.25s1.11 2.12 2.79 2.12 2.65.97 2.65 1.96v1.84S17 20.28 16 20.28h-2.11s-.69-.54-.69-1.28c0-.75.33-.95.73-.95.39 0 .72.04.72.04v-1.56s-3.18-.03-3.18 2.41c0 2.43 1.66 3.06 2.99 3.06h2.17s3.93-.5 3.93-8.25S19.33 5.28 19 4.69M7.5 6.31H4.26l4.06-4.09V5.5l-.82.81Z"}))};function It(){return It=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},It.apply(this,arguments)}const _t=function(t){return e.createElement("svg",It({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 7.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5Zm0 6.667a4.167 4.167 0 1 1 0-8.334 4.167 4.167 0 0 1 0 8.334ZM10 3.75C5.833 3.75 2.275 6.342.833 10c1.442 3.658 5 6.25 9.167 6.25s7.725-2.592 9.167-6.25c-1.442-3.658-5-6.25-9.167-6.25Z"}))};function xt(){return xt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xt.apply(this,arguments)}const Pt=function(t){return e.createElement("svg",xt({viewBox:"0 0 16 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M8 3a2 2 0 1 1 0 4 2 2 0 0 1 0-4Zm0-3c3.333 0 6.18 2.073 7.333 5-1.153 2.927-4 5-7.333 5S1.82 7.927.667 5C1.82 2.073 4.667 0 8 0ZM2.12 5a6.547 6.547 0 0 0 11.76 0A6.547 6.547 0 0 0 2.12 5Z"}))};function kt(){return kt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kt.apply(this,arguments)}const Bt=function(t){return e.createElement("svg",kt({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m9.858 7.5 2.642 2.633V10A2.5 2.5 0 0 0 10 7.5h-.142Zm-3.583.667 1.292 1.291c-.042.175-.067.35-.067.542a2.5 2.5 0 0 0 2.5 2.5c.183 0 .367-.025.542-.067l1.291 1.292a4.13 4.13 0 0 1-1.833.442A4.167 4.167 0 0 1 5.833 10c0-.658.167-1.275.442-1.833ZM1.667 3.558l1.9 1.9.375.375A9.86 9.86 0 0 0 .833 10c1.442 3.658 5 6.25 9.167 6.25 1.292 0 2.525-.25 3.65-.7l.358.35 2.434 2.433 1.058-1.058L2.725 2.5 1.667 3.558ZM10 5.833A4.167 4.167 0 0 1 14.167 10c0 .533-.109 1.05-.3 1.517l2.441 2.441A9.869 9.869 0 0 0 19.167 10c-1.442-3.658-5-6.25-9.167-6.25a9.872 9.872 0 0 0-3.333.583l1.808 1.792A4.208 4.208 0 0 1 10 5.833Z"}))};function Ot(){return Ot=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ot.apply(this,arguments)}const Nt=function(t){return e.createElement("svg",Ot({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m1.667 4.392 1.066-1.059 13.934 13.934-1.059 1.066-2.566-2.566A9.647 9.647 0 0 1 10 16.25c-4.167 0-7.725-2.592-9.167-6.25a9.795 9.795 0 0 1 2.659-3.783L1.667 4.392ZM10 7.5a2.5 2.5 0 0 1 2.358 3.333L9.167 7.642A2.5 2.5 0 0 1 10 7.5Zm0-3.75c4.167 0 7.725 2.592 9.167 6.25a9.824 9.824 0 0 1-3.334 4.325l-1.183-1.192A8.219 8.219 0 0 0 17.35 10 8.184 8.184 0 0 0 10 5.417c-.908 0-1.8.15-2.633.416L6.083 4.558A9.887 9.887 0 0 1 10 3.75ZM2.65 10A8.184 8.184 0 0 0 10 14.583c.575 0 1.142-.058 1.667-.175l-1.9-1.908A2.553 2.553 0 0 1 7.5 10.233L4.667 7.392A8.212 8.212 0 0 0 2.65 10Z"}))};function Dt(){return Dt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dt.apply(this,arguments)}const jt=function(t){return e.createElement("svg",Dt({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M7.5 18.333c-.5 0-.833-.333-.833-.833V15H3.333c-.916 0-1.666-.75-1.666-1.667v-10c0-.916.75-1.666 1.666-1.666h13.334c.916 0 1.666.75 1.666 1.666v10c0 .917-.75 1.667-1.666 1.667h-5.084L8.5 18.083a.756.756 0 0 1-.583.25H7.5Zm.833-5v2.584l2.584-2.584h5.75v-10H3.333v10h5ZM13.583 5l-1.166 2.5h1.75v3.333h-3.334v-3.5L11.917 5h1.666Zm-5 0L7.417 7.5h1.75v3.333H5.833v-3.5L6.917 5h1.666Z"}))};function Tt(){return Tt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tt.apply(this,arguments)}const Mt=function(t){return e.createElement("svg",Tt({viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M1 5a4 4 0 0 1 4-4h22a4 4 0 0 1 4 4v22a4 4 0 0 1-4 4H5a4 4 0 0 1-4-4V5Z",fill:"currentColor"}),e.createElement("path",{d:"M8.5 8.5h15v1.667h-15V8.5Zm0 3.333h10V13.5h-10v-1.667Zm0 3.334h15v1.666h-15v-1.666Zm0 3.333h10v1.667h-10V18.5Zm0 3.333h15V23.5h-15v-1.667Z",fill:"#fff"}))};function Ft(){return Ft=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ft.apply(this,arguments)}const Rt=function(t){return e.createElement("svg",Ft({viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M19.535 19.535a1 1 0 0 1-1.414 0L16 17.415l-2.122 2.12a1 1 0 1 1-1.414-1.414L14.585 16l-2.12-2.121a1 1 0 0 1 1.413-1.415L16 14.586l2.121-2.122a1 1 0 1 1 1.414 1.415L17.414 16l2.121 2.121a1 1 0 0 1 0 1.415ZM23.071 8.93A10 10 0 1 0 8.929 23.07 10 10 0 0 0 23.071 8.93Z",fill:"#CC2128"}))};function Lt(){return Lt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lt.apply(this,arguments)}const Qt=function(t){return e.createElement("svg",Lt({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10.75 7.75h4.125L10.75 3.625V7.75ZM5.5 2.5h6L16 7v9a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 4 16V4c0-.833.668-1.5 1.5-1.5Zm6.75 12V13H5.5v1.5h6.75Zm2.25-3V10h-9v1.5h9Z"}))};function Ut(){return Ut=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ut.apply(this,arguments)}const Vt=function(t){return e.createElement("svg",Ut({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M5.5 2.5A1.5 1.5 0 0 0 4 4v12a1.5 1.5 0 0 0 1.5 1.5h9A1.5 1.5 0 0 0 16 16V7l-4.5-4.5h-6Zm0 1.5h5.25v3.75h3.75V16h-9V4ZM7 10v1.5h6V10H7Zm0 3v1.5h3.75V13H7Z"}))};function Kt(){return Kt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kt.apply(this,arguments)}const Ht=function(t){return e.createElement("svg",Kt({viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M1 5a4 4 0 0 1 4-4h22a4 4 0 0 1 4 4v22a4 4 0 0 1-4 4H5a4 4 0 0 1-4-4V5Z",className:"text-accessory-tint-4",fill:"currentColor"}),e.createElement("path",{d:"M24 14.4V24H8l8-8 3.2 3.2 4.8-4.8Zm-11.2-4a2.4 2.4 0 1 1-4.801 0 2.4 2.4 0 0 1 4.801 0Z",fill:"#fff"}))};function Gt(){return Gt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gt.apply(this,arguments)}const Yt=function(t){return e.createElement("svg",Gt({viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M1 5a4 4 0 0 1 4-4h22a4 4 0 0 1 4 4v22a4 4 0 0 1-4 4H5a4 4 0 0 1-4-4V5Z",fill:"#F28C52"}),e.createElement("path",{d:"M12 9.14v14l11-7-11-7Z",fill:"#fff"}))};function zt(){return zt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zt.apply(this,arguments)}const Zt=function(t){return e.createElement("svg",zt({viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M1 5a4 4 0 0 1 4-4h22a4 4 0 0 1 4 4v22a4 4 0 0 1-4 4H5a4 4 0 0 1-4-4V5Z",fill:"#F28C52"}),e.createElement("path",{d:"M23.5 8.5v10.417a2.917 2.917 0 1 1-1.667-2.634v-4.891L13.5 13.167v7.416a2.917 2.917 0 1 1-1.667-2.633V11L23.5 8.5Z",fill:"#fff"}))};function Wt(){return Wt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wt.apply(this,arguments)}const qt=function(t){return e.createElement("svg",Wt({viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M1 5a4 4 0 0 1 4-4h22a4 4 0 0 1 4 4v22a4 4 0 0 1-4 4H5a4 4 0 0 1-4-4V5Z",fill:"#515357"}),e.createElement("path",{d:"M24.4 10v2H7.6v-2h16.8ZM7.6 22H16v-2H7.6v2Zm0-5h16.8v-2H7.6v2Z",fill:"#fff"}))};function Jt(){return Jt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jt.apply(this,arguments)}const Xt=function(t){return e.createElement("svg",Jt({viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M1 5a4 4 0 0 1 4-4h22a4 4 0 0 1 4 4v22a4 4 0 0 1-4 4H5a4 4 0 0 1-4-4V5Z",fill:"#CC2128"}),e.createElement("path",{d:"M24.983 18.292c-.458-.734-1.558-1.009-3.391-1.009-.642 0-1.284 0-1.925.092-.459-.275-.917-.55-1.284-.825-.916-.733-1.741-2.108-2.383-3.758 0 0 0-.092.092-.184.458-1.925.916-4.308 0-5.316-.275-.275-.55-.367-.917-.367h-.367c-.55 0-1.008.55-1.191 1.1-.55 1.925-.184 3.025.366 4.767-.366 1.375-.825 2.841-1.65 4.4-.458 1.008-1.008 1.925-1.375 2.658-.55.275-1.008.55-1.283.733-1.742 1.1-2.658 2.384-2.75 3.117-.092.275-.092.55 0 .733v.092l.733.458c.184.092.459.184.642.184 1.192 0 2.567-1.375 4.4-4.584.092 0 .183-.091.275-.091 1.558-.459 3.392-.825 5.958-1.1 1.467.733 3.3 1.1 4.4 1.1.642 0 1.1-.184 1.375-.459.275-.275.367-.641.459-1.008 0-.275 0-.55-.184-.733ZM8.117 24.158c.091-.55.733-1.558 1.833-2.475.183-.091.367-.275.733-.458-1.1 1.742-1.925 2.658-2.566 2.933ZM14.9 7.933c.092-.091.092-.183.183-.183l.184.092c.275.366.275.825.091 1.65v.275c-.091.366-.091.733-.275 1.191-.366-1.375-.366-2.383-.183-3.025Zm-1.833 11.55-.184.092c.092-.458.459-1.008.734-1.558.641-1.284 1.191-2.475 1.466-3.575.642 1.375 1.375 2.383 2.292 3.208.183.183.367.367.642.458-1.284.184-3.025.642-4.95 1.375Zm11.091-.091h-.366c-.642 0-1.742-.275-2.842-.734.092-.183.275-.183.367-.183 2.108 0 2.658.367 2.841.55.092.092.092.092.092.183 0 .092 0 .092-.092.184Z",fill:"#fff"}))};function $t(){return $t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$t.apply(this,arguments)}const en=function(t){return e.createElement("svg",$t({viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M1 5a4 4 0 0 1 4-4h22a4 4 0 0 1 4 4v22a4 4 0 0 1-4 4H5a4 4 0 0 1-4-4V5Z",fill:"#EBAD00"}),e.createElement("path",{fill:"#fff",d:"M5 9h22v14H5z"}))};function tn(){return tn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tn.apply(this,arguments)}const nn=function(t){return e.createElement("svg",tn({viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.006 26.008c5.524 0 10.002-4.478 10.002-10.002 0-5.524-4.478-10.002-10.002-10.002-5.524 0-10.002 4.478-10.002 10.002 0 5.524 4.478 10.002 10.002 10.002Zm-1.72-5.208L10 16.193l1.209-1.308 3.077 3.308L20.79 11.2 22 12.508 14.286 20.8Z",fill:"#086DD6"}))};function rn(){return rn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rn.apply(this,arguments)}const on=function(t){return e.createElement("svg",rn({viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("circle",{cx:60,cy:60,r:60,fill:"#F4F5F7"}),e.createElement("g",{filter:"url(#a)"},e.createElement("path",{d:"M39.75 26h27L87 46.4v40.8a6.826 6.826 0 0 1-1.977 4.808A6.725 6.725 0 0 1 80.25 94h-40.5C36.004 94 33 90.94 33 87.2V32.8c0-3.774 3.004-6.8 6.75-6.8Z",fill:"#fff"})),e.createElement("rect",{x:40,y:63,width:40,height:6,rx:3,fill:"#BBBEC4"}),e.createElement("rect",{x:40,y:74,width:22,height:6,rx:3,fill:"#BBBEC4"}),e.createElement("path",{d:"M63.474 33.82c0-.877 1.049-1.329 1.687-.726l15.537 14.68c.658.62.218 1.726-.686 1.726H64.474a1 1 0 0 1-1-1V33.82Z",fill:"#BBBEC4"}),e.createElement("defs",null,e.createElement("filter",{id:"a",x:21,y:18,width:78,height:92,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},e.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),e.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.createElement("feOffset",{dy:4}),e.createElement("feGaussianBlur",{stdDeviation:6}),e.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.16 0"}),e.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_647_28"}),e.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_647_28",result:"shape"}))))};function sn(){return sn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sn.apply(this,arguments)}const an=function(t){return e.createElement("svg",sn({viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M1 5a4 4 0 0 1 4-4h22a4 4 0 0 1 4 4v22a4 4 0 0 1-4 4H5a4 4 0 0 1-4-4V5Z",fill:"#1AA772"}),e.createElement("path",{d:"M12.364 22H8v-3h4.364v3Zm0-4.5H8v-3h4.364v3Zm0-4.5H8v-3h4.364v3Zm5.818 9h-4.364v-3h4.364v3Zm0-4.5h-4.364v-3h4.364v3Zm0-4.5h-4.364v-3h4.364v3ZM19.636 22H24v-3h-4.364v3ZM19.636 17.5H24v-3h-4.364v3ZM19.636 13H24v-3h-4.364v3Z",fill:"#fff"}))};function ln(){return ln=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ln.apply(this,arguments)}const cn=function(t){return e.createElement("svg",ln({viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M1 5a4 4 0 0 1 4-4h22a4 4 0 0 1 4 4v22a4 4 0 0 1-4 4H5a4 4 0 0 1-4-4V5Z",fill:"#515357"}),e.createElement("path",{d:"M19 23h-3v-3h-3v-3h3v-3h-3v-3h3V8h-3V5h3v3h3v3h-3v3h3v3h-3v3h3v3Z",fill:"#fff"}))};function un(){return un=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},un.apply(this,arguments)}const dn=function(t){return e.createElement("svg",un({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M8.334 3.333h-5A1.66 1.66 0 0 0 1.667 5v10a1.667 1.667 0 0 0 1.667 1.667h13.333A1.667 1.667 0 0 0 18.335 15V6.667c0-.925-.75-1.667-1.666-1.667H10L8.334 3.333Z"}))};function hn(){return hn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hn.apply(this,arguments)}const pn=function(t){return e.createElement("svg",hn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M16.667 15H3.333V6.667h13.334V15Zm0-10H10L8.333 3.333h-5A1.66 1.66 0 0 0 1.667 5v10a1.667 1.667 0 0 0 1.666 1.667h13.334A1.667 1.667 0 0 0 18.333 15V6.667c0-.925-.75-1.667-1.666-1.667Z"}))};function fn(){return fn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fn.apply(this,arguments)}const gn=function(t){return e.createElement("svg",fn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M3.333 3.333A1.667 1.667 0 0 0 1.667 5v10a1.667 1.667 0 0 0 1.666 1.667h13.334A1.667 1.667 0 0 0 18.333 15V6.667A1.667 1.667 0 0 0 16.667 5H10L8.333 3.333h-5Zm5.834 5c1.091 0 2.016.7 2.358 1.667h4.308v1.667H15v1.666h-1.667v-1.666h-1.808a2.492 2.492 0 0 1-2.358 1.666 2.5 2.5 0 1 1 0-5Zm0 1.667a.833.833 0 1 0 0 1.666.833.833 0 0 0 0-1.666Z"}))};function mn(){return mn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mn.apply(this,arguments)}const yn=function(t){return e.createElement("svg",mn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M2.5 2.5h15v1.667h-15V2.5Zm3.333 3.333h8.334V7.5H5.833V5.833ZM2.5 9.167h15v1.666h-15V9.167ZM5.833 12.5h8.334v1.667H5.833V12.5ZM2.5 15.833h15V17.5h-15v-1.667Z"}))};function vn(){return vn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vn.apply(this,arguments)}const An=function(t){return e.createElement("svg",vn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M2.5 2.5h15v1.667h-15V2.5Zm0 3.333h15V7.5h-15V5.833Zm0 3.334h15v1.666h-15V9.167Zm0 3.333h15v1.667h-15V12.5Zm0 3.333h15V17.5h-15v-1.667Z"}))};function bn(){return bn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bn.apply(this,arguments)}const wn=function(t){return e.createElement("svg",bn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M2.5 2.5h15v1.667h-15V2.5Zm0 3.333h10V7.5h-10V5.833Zm0 3.334h15v1.666h-15V9.167Zm0 3.333h10v1.667h-10V12.5Zm0 3.333h15V17.5h-15v-1.667Z"}))};function Sn(){return Sn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Sn.apply(this,arguments)}const Cn=function(t){return e.createElement("svg",Sn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M2.5 2.5h15v1.667h-15V2.5Zm5 3.333h10V7.5h-10V5.833Zm-5 3.334h15v1.666h-15V9.167Zm5 3.333h10v1.667h-10V12.5Zm-5 3.333h15V17.5h-15v-1.667Z"}))};function En(){return En=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},En.apply(this,arguments)}const In=function(t){return e.createElement("svg",En({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M7.632 2.95a1.136 1.136 0 0 0-1.929.806c0 .31.13.603.358.822l5.534 5.388-5.534 5.37a1.17 1.17 0 0 0-.358.823c0 .627.513 1.131 1.14 1.131.317 0 .577-.106.789-.317l6.242-6.104c.276-.268.415-.561.415-.911 0-.342-.13-.635-.415-.912L7.631 2.951Z"}))};function _n(){return _n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_n.apply(this,arguments)}const xn=function(t){return e.createElement("svg",_n({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M11.667 11.667h4.166v1.666h-2.5v2.5h-1.666v-4.166Zm-7.5 0h4.166v4.166H6.667v-2.5h-2.5v-1.666Zm2.5-7.5h1.666v4.166H4.167V6.667h2.5v-2.5Zm9.166 2.5v1.666h-4.166V4.167h1.666v2.5h2.5Z"}))};function Pn(){return Pn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pn.apply(this,arguments)}const kn=function(t){return e.createElement("svg",Pn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M4.167 4.167h4.166v1.666h-2.5v2.5H4.167V4.167Zm7.5 0h4.166v4.166h-1.666v-2.5h-2.5V4.167Zm2.5 7.5h1.666v4.166h-4.166v-1.666h2.5v-2.5Zm-5.834 2.5v1.666H4.167v-4.166h1.666v2.5h2.5Z"}))};function Bn(){return Bn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bn.apply(this,arguments)}const On=function(t){return e.createElement("svg",Bn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M17.576 10v6c0 .398-.16.78-.444 1.06-.284.282-.67.44-1.071.44H3.939c-.401 0-.787-.158-1.07-.44A1.493 1.493 0 0 1 2.423 16v-6a.761.761 0 0 1-.535-.22.746.746 0 0 1-.222-.53V7c0-.398.16-.78.444-1.06.284-.282.67-.44 1.07-.44h2.402a2.239 2.239 0 0 1 .537-2.341A2.284 2.284 0 0 1 7.727 2.5c.758 0 1.425.375 1.841.93v-.008L10 4l.432-.578v.008a2.305 2.305 0 0 1 1.84-.93c.604 0 1.182.237 1.608.659a2.239 2.239 0 0 1 .537 2.341h2.401c.402 0 .787.158 1.072.44.284.28.443.662.443 1.06v2.25c0 .199-.08.39-.221.53a.761.761 0 0 1-.536.22ZM3.939 16h5.304v-6H3.939v6Zm12.122 0v-6h-5.303v6h5.303ZM7.727 4c-.2 0-.393.079-.535.22a.746.746 0 0 0 0 1.06.761.761 0 0 0 1.071 0 .746.746 0 0 0 0-1.06.761.761 0 0 0-.536-.22Zm4.546 0c-.201 0-.394.079-.536.22a.746.746 0 0 0 0 1.06.762.762 0 0 0 1.072 0 .746.746 0 0 0 0-1.06.762.762 0 0 0-.536-.22ZM3.182 7v1.5h6.06V7h-6.06Zm7.576 0v1.5h6.06V7h-6.06Z"}))};function Nn(){return Nn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nn.apply(this,arguments)}const Dn=function(t){return e.createElement("svg",Nn({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},t),e.createElement("path",{fill:"currentColor",d:"M4 2h16a2 2 0 0 1 2 2v13.33L17.33 22H4a2 2 0 0 1-2-2V4c0-1.1.9-2 2-2m13 15v3.25L20.25 17H17m-7 2h4v-1h1v-5a5.002 5.002 0 0 0-3-9 5.002 5.002 0 0 0-3 9v5h1v1m4-2h-4v-2h4v2M12 5c2.21 0 4 1.79 4 4 0 1.5-.8 2.77-2 3.46V14h-4v-1.54C8.8 11.77 8 10.5 8 9c0-2.21 1.79-4 4-4Z"}))};function jn(){return jn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jn.apply(this,arguments)}const Tn=function(t){return e.createElement("svg",jn({viewBox:"0 -80 700 700",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M493.79 250.57c57.176 0 102.58 45.406 102.58 102.58v67.266c-35.316 11.773-70.629 18.5-105.95 18.5v-60.539c0-45.406-20.18-85.766-53.812-110.99 16.816-11.773 36.996-16.816 57.176-16.816zm-287.57 0c20.18 0 40.359 5.047 57.176 16.816-31.953 25.227-53.812 65.586-53.812 110.99v60.539c-35.316 0-70.629-5.047-105.95-18.5v-67.266c0-57.176 47.086-102.58 102.58-102.58zm144.62 1.684c68.949 0 124.45 57.176 124.45 126.12v82.402c-87.449 30.27-169.85 30.27-250.57 0v-82.402c0-68.95 57.176-126.12 126.12-126.12zm0-174.89c45.406 0 84.086 36.996 84.086 84.086 0 47.086-38.68 84.086-84.086 84.086-47.086 0-84.086-36.996-84.086-84.086 0-47.086 36.996-84.086 84.086-84.086zm-144.62 28.59c20.18 0 36.996 8.41 50.449 21.863-10.09 26.906-6.727 58.859 8.41 84.086-13.453 20.18-33.633 31.953-58.859 31.953-38.68 0-68.949-30.27-68.949-68.95 0-36.995 30.27-68.948 68.95-68.948zm287.57 0c38.68 0 68.949 31.953 68.949 68.949 0 38.68-30.27 68.949-68.949 68.949-23.543 0-45.406-11.773-57.176-31.953 15.137-25.227 18.5-57.176 8.41-84.086 11.773-13.453 30.27-21.863 48.77-21.863z",fillRule:"evenodd"}))};function Mn(){return Mn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mn.apply(this,arguments)}const Fn=function(t){return e.createElement("svg",Mn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.6 3.5H7v3.4H3.5v1.6H7v2.9H3.5V13H7v3.5h1.6V13h2.9v3.5h1.6V13h3.4v-1.6h-3.4V8.5h3.4V6.9h-3.4V3.5h-1.6v3.4H8.6V3.5Zm0 5v2.9h2.9V8.5H8.6Z",fill:"#086DD6"}))};function Rn(){return Rn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rn.apply(this,arguments)}const Ln=function(t){return e.createElement("svg",Rn({viewBox:"0 0 20 20",fillRule:"evenodd",clipRule:"evenodd",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M8.6 3.5H7v3.4H3.5v1.6H7v2.9H3.5V13H7v3.5h1.6V13h2.9v3.5h1.6V13h3.4v-1.6h-3.4V8.5h3.4V6.9h-3.4V3.5h-1.6v3.4H8.6V3.5Zm0 5v2.9h2.9V8.5H8.6Z"}))};function Qn(){return Qn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qn.apply(this,arguments)}const Un=function(t){return e.createElement("svg",Qn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{clipRule:"evenodd",d:"M1.75 4.108 2.93 2.93 17.07 17.072l-1.179 1.178-2.792-2.792V16.5h-1.6v-2.642L10.642 13H8.6v3.5H7V13H3.5v-1.6H7V9.358L6.142 8.5H3.5V6.9h1.042L1.75 4.108ZM8.6 11.4v-.442l.442.442H8.6Z"}),e.createElement("path",{d:"M15.356 13H16.5v-1.6h-2.744l1.6 1.6ZM13.1 10.744V8.5h3.4V6.9h-3.4V3.5h-1.6v3.4H9.256l1.6 1.6h.644v.644l1.6 1.6ZM8.6 6.244V3.5H7v1.144l1.6 1.6ZM8.6 10.958v.442h.442l-.442-.442Z"}),e.createElement("path",{d:"M11.5 8.5h-.644l.644.644V8.5Z"}))};function Vn(){return Vn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vn.apply(this,arguments)}const Kn=function(t){return e.createElement("svg",Vn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m10 17.792-1.21-1.1C4.5 12.8 1.667 10.225 1.667 7.083c0-2.575 2.016-4.583 4.583-4.583 1.45 0 2.842.675 3.75 1.733A5.011 5.011 0 0 1 13.75 2.5c2.567 0 4.583 2.008 4.583 4.583 0 3.142-2.833 5.717-7.125 9.609L10 17.792Z"}))};function Hn(){return Hn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hn.apply(this,arguments)}const Gn=function(t){return e.createElement("svg",Hn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m12.558 9.375-.75.767c-.6.6-.975 1.108-.975 2.358H9.167v-.417c0-.925.375-1.758.975-2.358l1.033-1.05c.308-.3.492-.717.492-1.175a1.666 1.666 0 1 0-3.334 0H6.667a3.333 3.333 0 0 1 6.666 0c0 .733-.3 1.392-.775 1.875Zm-1.725 6.458H9.167v-1.666h1.666v1.666ZM10 1.667A8.333 8.333 0 1 0 18.333 10c0-4.608-3.75-8.333-8.333-8.333Z"}))};function Yn(){return Yn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yn.apply(this,arguments)}const zn=function(t){return e.createElement("svg",Yn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M9.167 15h1.666v-1.667H9.167V15ZM10 1.667a8.333 8.333 0 1 0 0 16.666 8.333 8.333 0 0 0 0-16.666Zm0 15A6.676 6.676 0 0 1 3.333 10 6.676 6.676 0 0 1 10 3.333 6.676 6.676 0 0 1 16.667 10 6.676 6.676 0 0 1 10 16.667ZM10 5a3.333 3.333 0 0 0-3.333 3.333h1.666a1.667 1.667 0 1 1 3.334 0c0 1.667-2.5 1.459-2.5 4.167h1.666c0-1.875 2.5-2.083 2.5-4.167A3.333 3.333 0 0 0 10 5Z"}))};function Zn(){return Zn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zn.apply(this,arguments)}const Wn=function(t){return e.createElement("svg",Zn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M11.667 6.667h-1.25v4.166l3.566 2.117.6-1.008-2.916-1.734V6.667ZM11.25 2.5a7.5 7.5 0 0 0-7.5 7.5h-2.5l3.3 3.358L7.917 10h-2.5a5.833 5.833 0 1 1 5.833 5.833 5.786 5.786 0 0 1-4.117-1.716L5.95 15.3a7.413 7.413 0 0 0 5.3 2.2 7.5 7.5 0 0 0 0-15Z"}))};function qn(){return qn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qn.apply(this,arguments)}const Jn=function(t){return e.createElement("svg",qn({width:120,height:120,fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("circle",{cx:60,cy:60,r:60,fill:"#F4F5F7"}),e.createElement("g",{filter:"url(#a)"},e.createElement("path",{d:"M78.75 45.333c1.658 0 3.247.642 4.42 1.786a6.02 6.02 0 0 1 1.83 4.31v30.476a6.02 6.02 0 0 1-1.83 4.31A6.331 6.331 0 0 1 78.75 88h-37.5a6.331 6.331 0 0 1-4.42-1.785 6.02 6.02 0 0 1-1.83-4.31V51.429c0-3.383 2.813-6.096 6.25-6.096h3.125v-6.095c0-4.041 1.646-7.917 4.577-10.775C51.882 25.605 55.856 24 60 24c2.052 0 4.084.394 5.98 1.16a15.657 15.657 0 0 1 5.069 3.303 15.218 15.218 0 0 1 3.387 4.944 14.912 14.912 0 0 1 1.189 5.831v6.095h3.125ZM60 30.095a9.497 9.497 0 0 0-6.63 2.678 9.03 9.03 0 0 0-2.745 6.465v6.095h18.75v-6.095a9.03 9.03 0 0 0-2.746-6.465A9.497 9.497 0 0 0 60 30.095Z",fill:"#fff"})),e.createElement("path",{d:"M61.071 61.389h-1.928v6.389l5.503 3.245.925-1.546-4.5-2.657v-5.431Z",fill:"#BBBEC4",stroke:"#BBBEC4",strokeWidth:2}),e.createElement("path",{d:"M60.857 52c-3.75 0-7.348 1.528-10 4.247-2.653 2.72-4.143 6.407-4.143 10.253H42l6.223 6.493L54.57 66.5h-4.714c0-2.991 1.16-5.86 3.222-7.975a10.864 10.864 0 0 1 7.778-3.303c2.918 0 5.715 1.188 7.778 3.303a11.424 11.424 0 0 1 3.222 7.975c0 2.991-1.159 5.86-3.222 7.975a10.864 10.864 0 0 1-7.778 3.303c-3.033 0-5.783-1.273-7.763-3.32l-2.231 2.289C53.424 79.389 56.929 81 60.857 81c3.751 0 7.348-1.528 10-4.247C73.51 74.033 75 70.346 75 66.5s-1.49-7.534-4.142-10.253c-2.653-2.72-6.25-4.247-10-4.247Z",fill:"#BBBEC4",stroke:"#BBBEC4"}),e.createElement("defs",null,e.createElement("filter",{id:"a",x:23,y:16,width:74,height:88,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},e.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),e.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.createElement("feOffset",{dy:4}),e.createElement("feGaussianBlur",{stdDeviation:6}),e.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.16 0"}),e.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_39_37"}),e.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_39_37",result:"shape"}))))};function Xn(){return Xn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xn.apply(this,arguments)}const $n=function(t){return e.createElement("svg",Xn({xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("svg",Xn({width:20,height:20,fill:"none",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M11.667 6.667h-1.25v4.166l3.566 2.117.6-1.008-2.916-1.734V6.667zM11.25 2.5a7.5 7.5 0 0 0-7.5 7.5h-2.5l3.3 3.358L7.917 10h-2.5a5.833 5.833 0 1 1 5.833 5.833 5.786 5.786 0 0 1-4.117-1.716L5.95 15.3a7.413 7.413 0 0 0 5.3 2.2 7.5 7.5 0 0 0 0-15z",fill:"#72767E"})),e.createElement("svg",Xn({width:20,height:20,fill:"none",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{fill:"#72767E",d:"M14.167 12.5 10 8.333 5.833 12.5h8.334z"})),e.createElement("svg",Xn({width:20,height:20,fill:"none",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M5.833 8.333 10 12.5l4.167-4.167H5.833z",fill:"#72767E"})),e.createElement("svg",Xn({width:20,height:20,fill:"none",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M14.537 9.4a7.306 7.306 0 0 0-4.722-1.733c-3.182 0-5.87 2.02-6.815 4.813l1.615.52c.718-2.127 2.771-3.667 5.2-3.667 1.335 0 2.553.48 3.504 1.254L10.842 13H17V7l-2.463 2.4z",fill:"#72767E"})),e.createElement("svg",Xn({width:20,height:20,fill:"none",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M2.5 7.5h5v5h-5v-5zm0-3.333h15v1.666h-15V4.166zm15 3.333v1.666H9.167V7.5H17.5zm0 3.333V12.5H9.167v-1.667H17.5zm-15 3.333h11.667v1.667H2.5v-1.667z",fill:"#72767E"})),e.createElement("svg",Xn({width:20,height:20,fill:"none",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10.181 7.667A7.3 7.3 0 0 0 5.462 9.4L3 7v6h6.155L6.68 10.587a5.523 5.523 0 0 1 3.501-1.254c2.421 0 4.48 1.54 5.198 3.667L17 12.48c-.95-2.793-3.639-4.813-6.819-4.813z",fill:"#72767E"})))};function er(){return er=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},er.apply(this,arguments)}const tr=function(t){return e.createElement("svg",er({width:120,height:120,fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("circle",{cx:60,cy:60,r:60,fill:"#F4F5F7"}),e.createElement("g",{filter:"url(#a)"},e.createElement("rect",{x:21.505,y:49.353,width:40,height:40,rx:4,transform:"rotate(-15 21.505 49.353)",fill:"#fff"})),e.createElement("rect",{x:29.889,y:57.459,width:28,height:4,rx:2,transform:"rotate(-15 29.889 57.46)",fill:"#BBBEC4"}),e.createElement("rect",{x:31.959,y:65.186,width:28,height:4,rx:2,transform:"rotate(-15 31.96 65.186)",fill:"#BBBEC4"}),e.createElement("rect",{x:34.03,y:72.914,width:16,height:4,rx:2,transform:"rotate(-15 34.03 72.914)",fill:"#BBBEC4"}),e.createElement("g",{filter:"url(#b)"},e.createElement("rect",{x:40,y:32,width:56,height:56,rx:4,fill:"#fff"})),e.createElement("rect",{x:48,y:46,width:40,height:6,rx:3,fill:"#BBBEC4"}),e.createElement("rect",{x:48,y:57,width:40,height:6,rx:3,fill:"#BBBEC4"}),e.createElement("rect",{x:48,y:68,width:22,height:6,rx:3,fill:"#BBBEC4"}),e.createElement("defs",null,e.createElement("filter",{id:"a",x:10.403,y:31.898,width:71.194,height:71.194,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},e.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),e.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),e.createElement("feOffset",{dy:4}),e.createElement("feGaussianBlur",{stdDeviation:6}),e.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.16 0"}),e.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow"}),e.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),e.createElement("filter",{id:"b",x:28,y:24,width:80,height:80,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},e.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),e.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),e.createElement("feOffset",{dy:4}),e.createElement("feGaussianBlur",{stdDeviation:6}),e.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.16 0"}),e.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow"}),e.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"}))))};function nr(){return nr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nr.apply(this,arguments)}const rr=function(t){return e.createElement("svg",nr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M15.833 15.833H4.167V4.167h11.666v11.666Zm0-13.333H4.167A1.667 1.667 0 0 0 2.5 4.167v11.666A1.666 1.666 0 0 0 4.167 17.5h11.666a1.666 1.666 0 0 0 1.667-1.667V4.167A1.667 1.667 0 0 0 15.833 2.5Zm-4.2 7.742-2.291 2.95-1.634-1.967-2.291 2.942h9.166l-2.95-3.925Z"}))};function ir(){return ir=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ir.apply(this,arguments)}const or=function(t){return e.createElement("svg",ir({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},t),e.createElement("path",{fill:"currentColor",d:"M2 3.5a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm.646 2.146a.5.5 0 0 1 .708 0l2 2a.5.5 0 0 1 0 .708l-2 2a.5.5 0 0 1-.708-.708L4.293 8 2.646 6.354a.5.5 0 0 1 0-.708zM7 6.5a.5.5 0 0 1 .5-.5h6a.5.5 0 0 1 0 1h-6a.5.5 0 0 1-.5-.5zm0 3a.5.5 0 0 1 .5-.5h6a.5.5 0 0 1 0 1h-6a.5.5 0 0 1-.5-.5zm-5 3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"}))};function sr(){return sr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sr.apply(this,arguments)}const ar=function(t){return e.createElement("svg",sr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M9.167 7.5h1.666V5.833H9.167V7.5ZM10 16.667A6.675 6.675 0 0 1 3.333 10 6.676 6.676 0 0 1 10 3.333 6.675 6.675 0 0 1 16.667 10 6.675 6.675 0 0 1 10 16.667Zm0-15a8.333 8.333 0 1 0 0 16.666 8.333 8.333 0 0 0 0-16.666Zm-.833 12.5h1.666v-5H9.167v5Z"}))};function lr(){return lr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lr.apply(this,arguments)}const cr=function(t){return e.createElement("svg",lr({viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.268 17.2h4.84l.131-.881-.112-.07a3.268 3.268 0 0 0-.644-.297 5.934 5.934 0 0 0-.512-.16l2.108-11.548c.199-.048.409-.106.63-.172l.008-.003c.271-.095.525-.198.763-.307l.094-.044.165-.918H8.902l-.187.892.14.068c.222.107.437.209.647.303l.01.004c.16.061.327.115.5.162L7.905 15.768c-.461.09-.93.247-1.404.471l-.096.046-.137.915ZM6.5 17l.087-.58L6.5 17Zm1.577-1.06Z"}))};function ur(){return ur=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ur.apply(this,arguments)}const dr=function(t){return e.createElement("svg",ur({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M3.333 2.5a1.667 1.667 0 0 0-1.666 1.667V12.5a1.667 1.667 0 0 0 1.666 1.667h13.334a1.667 1.667 0 0 0 1.666-1.667V4.167A1.667 1.667 0 0 0 16.667 2.5H3.333Zm0 1.667h13.334V12.5H3.333V4.167ZM4.167 5v1.667h1.666V5H4.167Zm2.5 0v1.667h1.666V5H6.667Zm2.5 0v1.667h1.666V5H9.167Zm2.5 0v1.667h1.666V5h-1.666Zm2.5 0v1.667h1.666V5h-1.666Zm-10 2.5v1.667h1.666V7.5H4.167Zm2.5 0v1.667h1.666V7.5H6.667Zm2.5 0v1.667h1.666V7.5H9.167Zm2.5 0v1.667h1.666V7.5h-1.666Zm2.5 0v1.667h1.666V7.5h-1.666Zm-7.5 2.5v1.667h6.666V10H6.667ZM13.333 15.833 10 19.167l-3.333-3.334h6.666Z"}))};function hr(){return hr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hr.apply(this,arguments)}const pr=function(t){return e.createElement("svg",hr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M5 1.667A3.333 3.333 0 0 1 8.333 5v1.667h3.334V5A3.333 3.333 0 1 1 15 8.333h-1.667v3.334H15A3.333 3.333 0 1 1 11.667 15v-1.667H8.333V15A3.333 3.333 0 1 1 5 11.667h1.667V8.333H5a3.333 3.333 0 0 1 0-6.666ZM13.333 15A1.667 1.667 0 1 0 15 13.333h-1.667V15Zm-1.666-6.667H8.333v3.334h3.334V8.333Zm-6.667 5A1.667 1.667 0 1 0 6.667 15v-1.667H5ZM6.667 5A1.667 1.667 0 1 0 5 6.667h1.667V5ZM15 6.667A1.667 1.667 0 1 0 13.333 5v1.667H15Z"}))};function fr(){return fr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fr.apply(this,arguments)}const gr=function(t){return e.createElement("svg",fr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M15.833 8.333h-1.666V6.667h1.666v1.666Zm0 2.5h-1.666V9.167h1.666v1.666Zm-2.5-2.5h-1.666V6.667h1.666v1.666Zm0 2.5h-1.666V9.167h1.666v1.666Zm0 3.334H6.667V12.5h6.666v1.667Zm-7.5-5.834H4.167V6.667h1.666v1.666Zm0 2.5H4.167V9.167h1.666v1.666Zm.834-1.666h1.666v1.666H6.667V9.167Zm0-2.5h1.666v1.666H6.667V6.667Zm2.5 2.5h1.666v1.666H9.167V9.167Zm0-2.5h1.666v1.666H9.167V6.667Zm7.5-2.5H3.333a1.66 1.66 0 0 0-1.666 1.666v8.334a1.667 1.667 0 0 0 1.666 1.666h13.334a1.667 1.667 0 0 0 1.666-1.666V5.833c0-.925-.75-1.666-1.666-1.666Z"}))};function mr(){return mr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mr.apply(this,arguments)}const yr=function(t){return e.createElement("svg",mr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M3.333 4.167a1.667 1.667 0 0 0-1.666 1.666v8.334a1.667 1.667 0 0 0 1.666 1.666h13.334a1.667 1.667 0 0 0 1.666-1.666V5.833a1.667 1.667 0 0 0-1.666-1.666H3.333Zm0 1.666h13.334v8.334H3.333V5.833Zm.834.834v1.666h1.666V6.667H4.167Zm2.5 0v1.666h1.666V6.667H6.667Zm2.5 0v1.666h1.666V6.667H9.167Zm2.5 0v1.666h1.666V6.667h-1.666Zm2.5 0v1.666h1.666V6.667h-1.666Zm-10 2.5v1.666h1.666V9.167H4.167Zm2.5 0v1.666h1.666V9.167H6.667Zm2.5 0v1.666h1.666V9.167H9.167Zm2.5 0v1.666h1.666V9.167h-1.666Zm2.5 0v1.666h1.666V9.167h-1.666Zm-7.5 2.5v1.666h6.666v-1.666H6.667Z"}))};function vr(){return vr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vr.apply(this,arguments)}const Ar=function(t){return e.createElement("svg",vr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M2.5 3.333h5.092L13.458 15H17.5v1.667h-5.1L6.533 5H2.5V3.333Zm9.167 0H17.5V5h-5.833V3.333Z"}))};function br(){return br=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},br.apply(this,arguments)}const wr=function(t){return e.createElement("svg",br({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M13.5 16.833v-6.666H16l-6-6.309-6 6.309h2.5v6.666h7ZM10 1.5l9.333 10.333h-4.166V18.5H4.833v-6.667H.667L10 1.5Z"}))};function Sr(){return Sr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Sr.apply(this,arguments)}const Cr=function(t){return e.createElement("svg",Sr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M3.333 5.833A1.667 1.667 0 0 0 1.667 7.5v8.333A1.667 1.667 0 0 0 3.333 17.5h13.334a1.667 1.667 0 0 0 1.666-1.667V7.5a1.667 1.667 0 0 0-1.666-1.667H3.333Zm0 1.667h13.334v8.333H3.333V7.5Zm.834.833V10h1.666V8.333H4.167Zm2.5 0V10h1.666V8.333H6.667Zm2.5 0V10h1.666V8.333H9.167Zm2.5 0V10h1.666V8.333h-1.666Zm2.5 0V10h1.666V8.333h-1.666Zm-10 2.5V12.5h1.666v-1.667H4.167Zm2.5 0V12.5h1.666v-1.667H6.667Zm2.5 0V12.5h1.666v-1.667H9.167Zm2.5 0V12.5h1.666v-1.667h-1.666Zm2.5 0V12.5h1.666v-1.667h-1.666Zm-7.5 2.5V15h6.666v-1.667H6.667ZM6.667 3.833 10 .5l3.334 3.333H6.667Z"}))};function Er(){return Er=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Er.apply(this,arguments)}const Ir=function(t){return e.createElement("svg",Er({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M16.492 12.842a7.097 7.097 0 0 0 0-5.684l-2.284 1.034c.5 1.15.5 2.458.009 3.616l2.275 1.034ZM12.85 3.508a7.117 7.117 0 0 0-5.692 0l1.034 2.275a4.603 4.603 0 0 1 3.625.009l1.033-2.284ZM3.508 7.15a7.137 7.137 0 0 0 0 5.7l2.284-1.042c-.5-1.15-.5-2.466 0-3.625L3.508 7.15Zm3.65 9.342a7.083 7.083 0 0 0 5.692-.009l-1.033-2.275c-1.15.5-2.467.5-3.617.009l-1.042 2.275ZM10 1.667a8.333 8.333 0 1 1 0 16.666 8.333 8.333 0 0 1 0-16.666Zm0 5a3.333 3.333 0 1 0 0 6.666 3.333 3.333 0 0 0 0-6.666Z"}))};function _r(){return _r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_r.apply(this,arguments)}const xr=function(t){return e.createElement("svg",_r({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m17.083 15-2.5 2.5v-1.667H4.167v-1.666h10.416V12.5l2.5 2.5ZM8.442 8.333h3.125L10 4.142 8.442 8.333ZM10.625 2.5l3.958 9.167H12.85l-.767-1.825H7.917l-.767 1.825H5.417L9.375 2.5h1.25Z"}))};function Pr(){return Pr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pr.apply(this,arguments)}const kr=function(t){return e.createElement("svg",Pr({viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M8.825 11.175a.811.811 0 0 1 0 1.183.84.84 0 0 1-1.183 0 4.17 4.17 0 0 1 0-5.891l2.95-2.95a4.17 4.17 0 0 1 5.891 0 4.17 4.17 0 0 1 0 5.891l-1.241 1.242a5.758 5.758 0 0 0-.334-2.017l.392-.4a2.485 2.485 0 0 0 0-3.533 2.485 2.485 0 0 0-3.533 0L8.825 7.642a2.485 2.485 0 0 0 0 3.533Zm2.35-3.533a.84.84 0 0 1 1.183 0 4.17 4.17 0 0 1 0 5.891l-2.95 2.95a4.17 4.17 0 0 1-5.891 0 4.17 4.17 0 0 1 0-5.891L4.758 9.35c-.008.683.1 1.367.334 2.025l-.392.392a2.485 2.485 0 0 0 0 3.533 2.485 2.485 0 0 0 3.533 0l2.942-2.942a2.485 2.485 0 0 0 0-3.533.811.811 0 0 1 0-1.183Z"}))};function Br(){return Br=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Br.apply(this,arguments)}const Or=function(t){return e.createElement("svg",Br({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M14.167 5.833h-3.334v1.584h3.334A2.586 2.586 0 0 1 16.75 10c0 1.192-.817 2.192-1.925 2.5l1.217 1.2c1.358-.692 2.291-2.075 2.291-3.7a4.167 4.167 0 0 0-4.166-4.167Zm-.834 3.334h-1.825l1.667 1.666h.158V9.167ZM1.667 3.558 4.258 6.15a4.16 4.16 0 0 0-1.37 6.796 4.167 4.167 0 0 0 2.945 1.22h3.334v-1.583H5.833A2.586 2.586 0 0 1 3.25 10a2.58 2.58 0 0 1 2.3-2.558l1.725 1.725h-.608v1.666h2.275l1.891 1.892v1.442h1.442l3.342 3.333 1.05-1.05L2.725 2.5 1.667 3.558Z"}))};function Nr(){return Nr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nr.apply(this,arguments)}const Dr=function(t){return e.createElement("svg",Nr({viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M5.833 3.167H17.5v1.666H5.833V3.167Zm0 7.666V9.167H17.5v1.666H5.833Zm-2.5-8.083a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5Zm0 6a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5Zm2.5 8.083v-1.666H17.5v1.666H5.833Zm-2.5-2.083a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5Z"}))};function jr(){return jr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jr.apply(this,arguments)}const Tr=function(t){return e.createElement("svg",jr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{clipRule:"evenodd",d:"M2 4.286A2.286 2.286 0 0 1 4.286 2h11.428A2.286 2.286 0 0 1 18 4.286v11.428A2.286 2.286 0 0 1 15.714 18H4.286A2.286 2.286 0 0 1 2 15.714V4.286Zm7.805 2.03c.142-.045.365-.075.668-.09V6c-.463.023-1.123.034-1.98.034-.9 0-1.564-.011-1.993-.034v.226c.277.015.48.045.605.09a.394.394 0 0 1 .265.26c.05.128.076.335.076.622v5.604c0 .287-.025.494-.076.622a.393.393 0 0 1-.265.26c-.126.045-.328.075-.605.09V14c.908-.023 2.279-.034 4.112-.034 1.354 0 2.316.011 2.888.034a14.745 14.745 0 0 1-.088-1.785c0-.407.012-.739.037-.995h-.29c-.126.761-.399 1.371-.82 1.83-.411.46-.903.69-1.475.69h-.618c-.236 0-.408-.019-.517-.056a.36.36 0 0 1-.215-.215c-.042-.113-.063-.29-.063-.531v-5.74c0-.287.026-.494.076-.622a.43.43 0 0 1 .278-.26Z"}))};function Mr(){return Mr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mr.apply(this,arguments)}const Fr=function(t){return e.createElement("svg",Mr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.286 3.6h11.428c.379 0 .686.307.686.686v11.428a.686.686 0 0 1-.686.686H4.286a.686.686 0 0 1-.686-.686V4.286c0-.379.307-.686.686-.686ZM2 4.286A2.286 2.286 0 0 1 4.286 2h11.428A2.286 2.286 0 0 1 18 4.286v11.428A2.286 2.286 0 0 1 15.714 18H4.286A2.286 2.286 0 0 1 2 15.714V4.286Zm7.805 2.03c.142-.045.365-.075.668-.09V6c-.463.023-1.123.034-1.98.034-.9 0-1.564-.011-1.993-.034v.226c.277.015.48.045.605.09a.394.394 0 0 1 .265.26c.05.128.076.335.076.622v5.604c0 .287-.025.494-.076.622a.393.393 0 0 1-.265.26c-.126.045-.328.075-.605.09V14c.908-.023 2.279-.034 4.112-.034 1.354 0 2.316.011 2.888.034a14.745 14.745 0 0 1-.088-1.785c0-.407.012-.739.037-.995h-.29c-.126.761-.399 1.371-.82 1.83-.411.46-.903.69-1.475.69h-.618c-.236 0-.408-.019-.517-.056a.36.36 0 0 1-.215-.215c-.042-.113-.063-.29-.063-.531v-5.74c0-.287.026-.494.076-.622a.43.43 0 0 1 .278-.26Z",fill:"currentColor"}))};function Rr(){return Rr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rr.apply(this,arguments)}const Lr=function(t){return e.createElement("svg",Rr({viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M5.833 3.167H17.5v1.666H5.833V3.167Zm0 7.666V9.167H17.5v1.666H5.833Zm0 6v-1.666H17.5v1.666H5.833ZM4.024 2.364V6h-.987V3.273h-.021l-.796.476V2.91l.895-.547h.91ZM2.241 12v-.71l1.357-1.122c.09-.075.167-.145.23-.21a.794.794 0 0 0 .15-.204.506.506 0 0 0 .053-.233.453.453 0 0 0-.06-.24.391.391 0 0 0-.163-.152.512.512 0 0 0-.242-.055.512.512 0 0 0-.241.055.383.383 0 0 0-.16.161.545.545 0 0 0-.057.26H2.17c0-.256.058-.476.173-.66.115-.185.277-.328.486-.427.21-.1.455-.15.737-.15.291 0 .543.048.756.141.215.093.38.223.496.39a1.072 1.072 0 0 1 .089 1.009c-.058.138-.163.29-.313.457a6.39 6.39 0 0 1-.64.596l-.342.284v.022h1.42V12h-2.79ZM3.662 18.05c-.287 0-.541-.05-.764-.148a1.274 1.274 0 0 1-.522-.41 1.003 1.003 0 0 1-.191-.6h.994c.001.07.022.133.064.188.043.055.1.097.174.128.073.03.157.046.252.046a.574.574 0 0 0 .242-.048.396.396 0 0 0 .163-.136.338.338 0 0 0 .057-.2.293.293 0 0 0-.068-.195.44.44 0 0 0-.19-.133.77.77 0 0 0-.282-.048h-.37v-.681h.37a.655.655 0 0 0 .26-.048.407.407 0 0 0 .175-.134.308.308 0 0 0 .062-.195.326.326 0 0 0-.051-.188.36.36 0 0 0-.15-.128.582.582 0 0 0-.46.002.403.403 0 0 0-.165.133.34.34 0 0 0-.062.195h-.944c0-.222.062-.419.183-.59a1.23 1.23 0 0 1 .5-.4c.212-.098.455-.146.73-.146.269 0 .506.046.712.137.207.09.369.216.485.376.117.159.175.34.174.545a.638.638 0 0 1-.21.5.912.912 0 0 1-.536.232v.028c.294.032.514.122.662.27.148.147.221.331.219.554a.884.884 0 0 1-.192.566 1.265 1.265 0 0 1-.534.387c-.228.094-.49.14-.787.14Z"}))};function Qr(){return Qr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qr.apply(this,arguments)}const Ur=function(t){return e.createElement("svg",Qr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 14.167a1.666 1.666 0 1 0 0-3.333 1.666 1.666 0 0 0 0 3.333Zm5-7.5a1.667 1.667 0 0 1 1.667 1.666v8.334A1.667 1.667 0 0 1 15 18.333H5a1.667 1.667 0 0 1-1.667-1.666V8.333c0-.925.75-1.666 1.667-1.666h.833V5a4.167 4.167 0 0 1 8.334 0v1.667H15ZM10 2.5A2.5 2.5 0 0 0 7.5 5v1.667h5V5A2.5 2.5 0 0 0 10 2.5Z"}))};function Vr(){return Vr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vr.apply(this,arguments)}const Kr=function(t){return e.createElement("svg",Vr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 14.167c-.925 0-1.666-.75-1.666-1.667A1.667 1.667 0 1 1 10 14.167Zm5 2.5V8.333H5v8.334h10Zm0-10a1.667 1.667 0 0 1 1.667 1.666v8.334A1.667 1.667 0 0 1 15 18.333H5c-.925 0-1.667-.75-1.667-1.666V8.333A1.66 1.66 0 0 1 5 6.667h.833V5a4.167 4.167 0 1 1 8.334 0v1.667H15ZM10 2.5A2.5 2.5 0 0 0 7.5 5v1.667h5V5A2.5 2.5 0 0 0 10 2.5Z"}))};function Hr(){return Hr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hr.apply(this,arguments)}const Gr=function(t){return e.createElement("svg",Hr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M12.5 3.333V5H15v10h-2.5v1.667h4.167V3.333H12.5Zm-9.167 0v13.334H7.5V15H5V5h2.5V3.333H3.333Z"}))};function Yr(){return Yr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yr.apply(this,arguments)}const zr=function(t){return e.createElement("svg",Yr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M5.833 8.333 10 12.5l4.167-4.167H5.833Z"}))};function Zr(){return Zr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zr.apply(this,arguments)}const Wr=function(t){return e.createElement("svg",Zr({viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M.667.667 4 4 7.333.667H.667Z"}))};function qr(){return qr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qr.apply(this,arguments)}const Jr=function(t){return e.createElement("svg",qr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m7.917 14.583 4.166-4.166L7.917 6.25v8.333Z"}))};function Xr(){return Xr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xr.apply(this,arguments)}const $r=function(t){return e.createElement("svg",Xr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m17.5 13.008-1.175 1.159L12.15 10l4.175-4.167L17.5 6.992 14.533 10l2.967 3.008ZM2.5 5h10.833v1.667H2.5V5Zm0 5.833V9.167h8.333v1.666H2.5ZM2.5 15v-1.667h10.833V15H2.5Z"}))};function ei(){return ei=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ei.apply(this,arguments)}const ti=function(t){return e.createElement("svg",ei({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m2.5 13.008 1.175 1.159L7.85 10 3.675 5.833 2.5 6.992 5.467 10 2.5 13.008ZM17.5 5H6.667v1.667H17.5V5Zm0 5.833V9.167H9.167v1.666H17.5Zm0 4.167v-1.667H6.667V15H17.5Z"}))};function ni(){return ni=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ni.apply(this,arguments)}const ri=function(t){return e.createElement("svg",ni({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M17 5v1.667H3V5h14ZM3 15h14v-1.667H3V15Zm0-4.167h14V9.167H3v1.666Z"}))};function ii(){return ii=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ii.apply(this,arguments)}const oi=function(t){return e.createElement("svg",ii({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m8 17 4-4h3.2c.4 1.2 1.5 2 2.8 2 1.7 0 3-1.3 3-3s-1.3-3-3-3c-1.3 0-2.4.8-2.8 2H12L8 7V3H3v5h3l4.2 4L6 16H3v5h5v-4Z"}))};function si(){return si=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},si.apply(this,arguments)}const ai=function(t){return e.createElement("svg",si({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M13.333 10a1.666 1.666 0 1 1 3.333 0 1.666 1.666 0 0 1-3.333 0Zm-5 0a1.667 1.667 0 1 1 3.334 0 1.667 1.667 0 0 1-3.334 0Zm-5 0a1.667 1.667 0 1 1 3.334 0 1.667 1.667 0 0 1-3.334 0Z"}))};function li(){return li=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},li.apply(this,arguments)}const ci=function(t){return e.createElement("svg",li({viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M12 8.666a1.667 1.667 0 1 1 0-3.333 1.667 1.667 0 0 1 0 3.333Zm0 5a1.667 1.667 0 1 1 0-3.333 1.667 1.667 0 0 1 0 3.333Zm0 5a1.667 1.667 0 1 1 0-3.333 1.667 1.667 0 0 1 0 3.333Z"}))};function ui(){return ui=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ui.apply(this,arguments)}const di=function(t){return e.createElement("svg",ui({viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("circle",{cx:60,cy:60,r:60,fill:"#F4F5F7"}),e.createElement("g",{filter:"url(#a)"},e.createElement("path",{fill:"#BBBEC4",d:"M31 46.001h58v33H31z"}),e.createElement("path",{d:"M89 37.444V58.68l-9.667-9.699-12.889 12.921-12.888-12.889-12.89 12.89-9.666-9.7V37.444A6.445 6.445 0 0 1 37.444 31h45.112A6.445 6.445 0 0 1 89 37.444Zm-9.667 20.687L89 67.83v14.726A6.445 6.445 0 0 1 82.556 89H37.444A6.445 6.445 0 0 1 31 82.556V61.353l9.667 9.635 12.889-12.89 12.888 12.89",fill:"#fff"})),e.createElement("defs",null,e.createElement("filter",{id:"a",x:19,y:23,width:82,height:82,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},e.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),e.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.createElement("feOffset",{dy:4}),e.createElement("feGaussianBlur",{stdDeviation:6}),e.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.16 0"}),e.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_1572_1023"}),e.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_1572_1023",result:"shape"}))))};function hi(){return hi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hi.apply(this,arguments)}const pi=function(t){return e.createElement("svg",hi({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M11.556 13.889H6.11v-1.556h5.445v1.556Zm2.333-3.111H6.11V9.222h7.778v1.556Zm0-3.111H6.11V6.11h7.778v1.556ZM15.444 3H4.556A1.55 1.55 0 0 0 3 4.556v10.888A1.556 1.556 0 0 0 4.556 17h10.888A1.556 1.556 0 0 0 17 15.444V4.556C17 3.692 16.3 3 15.444 3Z"}))};function fi(){return fi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fi.apply(this,arguments)}const gi=function(t){return e.createElement("svg",fi({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M4.556 3A1.55 1.55 0 0 0 3 4.556v10.888A1.55 1.55 0 0 0 4.556 17h10.888A1.55 1.55 0 0 0 17 15.444V4.556A1.55 1.55 0 0 0 15.444 3H4.556Zm0 1.556h10.888v10.888H4.556V4.556ZM6.11 6.11v1.556h7.778V6.11H6.11Zm0 3.111v1.556h7.778V9.222H6.11Zm0 3.111v1.556h5.445v-1.556H6.11Z"}))};function mi(){return mi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mi.apply(this,arguments)}const yi=function(t){return e.createElement("svg",mi({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M11.667 2.5v1.667h2.991l-8.191 8.191 1.175 1.175 8.191-8.191v2.991H17.5V2.5h-5.833Zm4.166 13.333H4.167V4.167H10V2.5H4.167c-.925 0-1.667.75-1.667 1.667v11.666A1.666 1.666 0 0 0 4.167 17.5h11.666a1.666 1.666 0 0 0 1.667-1.667V10h-1.667v5.833Z"}))};function vi(){return vi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vi.apply(this,arguments)}const Ai=function(t){return e.createElement("svg",vi({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},t),e.createElement("path",{fill:"currentColor",d:"M2 3.5a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm10.646 2.146a.5.5 0 0 1 .708.708L11.707 8l1.647 1.646a.5.5 0 0 1-.708.708l-2-2a.5.5 0 0 1 0-.708l2-2zM2 6.5a.5.5 0 0 1 .5-.5h6a.5.5 0 0 1 0 1h-6a.5.5 0 0 1-.5-.5zm0 3a.5.5 0 0 1 .5-.5h6a.5.5 0 0 1 0 1h-6a.5.5 0 0 1-.5-.5zm0 3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"}))};function bi(){return bi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bi.apply(this,arguments)}const wi=function(t){return e.createElement("svg",bi({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M16.2 7.8h4.2v8.4h-4.2v1.68a.84.84 0 0 0 .84.84h1.68v1.68h-2.1c-.462 0-1.26-.378-1.26-.84 0 .462-.798.84-1.26.84H12v-1.68h1.68a.84.84 0 0 0 .84-.84V6.12a.84.84 0 0 0-.84-.84H12V3.6h2.1c.462 0 1.26.378 1.26.84 0-.462.798-.84 1.26-.84h2.1v1.68h-1.68a.84.84 0 0 0-.84.84V7.8Zm-12.6 0h9.24v1.68H5.28v5.04h7.56v1.68H3.6V7.8Zm15.12 6.72V9.48H16.2v5.04h2.52ZM9.06 12a1.26 1.26 0 1 0-2.52 0 1.26 1.26 0 0 0 2.52 0Zm3.78-.932a1.254 1.254 0 0 0-1.78.092 1.238 1.238 0 0 0 .1 1.772 1.24 1.24 0 0 0 1.68 0v-1.864Z"}))};function Si(){return Si=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Si.apply(this,arguments)}const Ci=function(t){return e.createElement("svg",Si({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M17.258 5.867c.325-.325.325-.867 0-1.175l-1.95-1.95c-.308-.325-.85-.325-1.175 0L12.6 4.267l3.125 3.125 1.533-1.525ZM2.5 14.375V17.5h3.125l9.217-9.225-3.125-3.125L2.5 14.375Z"}))};function Ei(){return Ei=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ei.apply(this,arguments)}const Ii=function(t){return e.createElement("svg",Ei({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m11.717 7.5.783.783-7.567 7.55h-.766v-.766l7.55-7.567Zm3-5a.834.834 0 0 0-.584.242l-1.525 1.525 3.125 3.125 1.525-1.525c.325-.325.325-.867 0-1.175l-1.95-1.95a.818.818 0 0 0-.591-.242Zm-3 2.658L2.5 14.375V17.5h3.125l9.217-9.217-3.125-3.125Z"}))};function _i(){return _i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_i.apply(this,arguments)}const xi=function(t){return e.createElement("svg",_i({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m9.25 7.9 3-3 2.85 2.85-3 3-1.05-1.05L13 7.675 12.325 7l-1.95 1.95L9.25 7.9Zm8.025-3.45L15.55 2.725a.81.81 0 0 0-.525-.225.81.81 0 0 0-.525.225l-1.35 1.35L16 6.925 17.275 5.5c.3-.225.3-.75 0-1.05ZM16 16.525l-.975.975-4.875-4.875L6.85 16H4v-2.85l3.375-3.375-4.875-4.8L3.475 4 16 16.525Zm-6.9-4.95-.675-.675L5.5 13.825v.675h.675L9.1 11.575Z"}))};function Pi(){return Pi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pi.apply(this,arguments)}const ki=function(t){return e.createElement("svg",Pi({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M13 10V4h.75V2.5h-7.5V4H7v6l-2.5 1.5V13h4.9v4.5h1.2V13h4.9v-1.5L13 10Z"}))};function Bi(){return Bi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bi.apply(this,arguments)}const Oi=function(t){return e.createElement("svg",Bi({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M13 10V4h.75V2.5h-7.5V4H7v6l-2.5 1.5V13h4.9v4.5h1.2V13h4.9v-1.5L13 10Zm-6.4 1.5 1.9-.9V4h3v6.6l1.9.9H6.6Z"}))};function Ni(){return Ni=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ni.apply(this,arguments)}const Di=function(t){return e.createElement("svg",Ni({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M17 5v1.667H3V5h14ZM3 15h7v-1.667H3V15Zm0-4.167h14V9.167H3v1.666Z"}))};function ji(){return ji=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ji.apply(this,arguments)}const Ti=function(t){return e.createElement("svg",ji({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M14.167 10c0 .46-.373.833-.834.833h-2.5v2.5a.833.833 0 1 1-1.666 0v-2.5h-2.5a.833.833 0 1 1 0-1.666h2.5v-2.5a.833.833 0 0 1 1.666 0v2.5h2.5c.46 0 .834.373.834.833ZM10 1.667a8.333 8.333 0 1 0 0 16.666 8.333 8.333 0 0 0 0-16.666Z"}))};function Mi(){return Mi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mi.apply(this,arguments)}const Fi=function(t){return e.createElement("svg",Mi({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10.005 16.673a6.677 6.677 0 0 1-6.668-6.668 6.677 6.677 0 0 1 6.668-6.668 6.677 6.677 0 0 1 6.668 6.668 6.677 6.677 0 0 1-6.668 6.668Zm0-15.003a8.335 8.335 0 1 0 0 16.67 8.335 8.335 0 0 0 0-16.67Zm.833 5a.833.833 0 1 0-1.667 0v2.501h-2.5a.833.833 0 1 0 0 1.667h2.5v2.5a.833.833 0 1 0 1.667 0v-2.5h2.5a.833.833 0 1 0 0-1.667h-2.5v-2.5Z"}))};function Ri(){return Ri=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ri.apply(this,arguments)}const Li=function(t){return e.createElement("svg",Ri({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("rect",{opacity:.36,x:1,y:1,width:18,height:18,rx:9,fill:"#BBBEC4"}),e.createElement("path",{d:"M6.667 12H8c0 .72.913 1.333 2 1.333 1.086 0 2-.613 2-1.333 0-.733-.694-1-2.16-1.353C8.427 10.293 6.667 9.853 6.667 8c0-1.193.98-2.207 2.333-2.547V4h2v1.453c1.353.34 2.333 1.354 2.333 2.547H12c0-.72-.914-1.333-2-1.333-1.087 0-2 .613-2 1.333 0 .733.693 1 2.16 1.353 1.413.354 3.173.794 3.173 2.647 0 1.193-.98 2.207-2.333 2.547V16H9v-1.453c-1.354-.34-2.333-1.354-2.333-2.547Z"}))};function Qi(){return Qi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qi.apply(this,arguments)}const Ui=function(t){return e.createElement("svg",Qi({width:120,height:120,fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("circle",{cx:60,cy:60,r:60,fill:"#F4F5F7"}),e.createElement("g",{filter:"url(#a)"},e.createElement("rect",{x:31,y:31,width:58,height:58,rx:4,fill:"#fff"}),e.createElement("path",{d:"M50 66h4c0 2.16 2.74 4 6 4s6-1.84 6-4c0-2.2-2.08-3-6.48-4.06C55.28 60.88 50 59.56 50 54c0-3.58 2.94-6.62 7-7.64V42h6v4.36c4.06 1.02 7 4.06 7 7.64h-4c0-2.16-2.74-4-6-4s-6 1.84-6 4c0 2.2 2.08 3 6.48 4.06C64.72 59.12 70 60.44 70 66c0 3.58-2.94 6.62-7 7.64V78h-6v-4.36c-4.06-1.02-7-4.06-7-7.64Z",fill:"#BBBEC4"})),e.createElement("defs",null,e.createElement("filter",{id:"a",x:19,y:23,width:82,height:82,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},e.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),e.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.createElement("feOffset",{dy:4}),e.createElement("feGaussianBlur",{stdDeviation:6}),e.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.16 0"}),e.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_5_1809"}),e.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_5_1809",result:"shape"}))))};function Vi(){return Vi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vi.apply(this,arguments)}const Ki=function(t){return e.createElement("svg",Vi({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M15 2.5H5v3.333h10V2.5Zm.833 7.5a.833.833 0 1 1 0-1.666.833.833 0 0 1 0 1.666Zm-2.5 5.833H6.667v-4.166h6.666v4.166Zm2.5-9.166H4.167a2.5 2.5 0 0 0-2.5 2.5v5H5V17.5h10v-3.333h3.333v-5a2.5 2.5 0 0 0-2.5-2.5Z"}))};function Hi(){return Hi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hi.apply(this,arguments)}const Gi=function(t){return e.createElement("svg",Hi({viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("circle",{cx:60,cy:60,r:60,fill:"#F4F5F7"}),e.createElement("g",{filter:"url(#a)"},e.createElement("path",{d:"M78.75 45.333c1.658 0 3.247.642 4.42 1.786a6.02 6.02 0 0 1 1.83 4.31v30.476a6.02 6.02 0 0 1-1.83 4.31A6.331 6.331 0 0 1 78.75 88h-37.5a6.331 6.331 0 0 1-4.42-1.785 6.02 6.02 0 0 1-1.83-4.31V51.429c0-3.383 2.813-6.096 6.25-6.096h3.125v-6.095c0-4.041 1.646-7.917 4.577-10.775C51.882 25.605 55.856 24 60 24c2.052 0 4.084.394 5.98 1.16a15.657 15.657 0 0 1 5.069 3.303 15.218 15.218 0 0 1 3.387 4.944 14.912 14.912 0 0 1 1.189 5.831v6.095h3.125ZM60 30.095a9.497 9.497 0 0 0-6.63 2.678 9.03 9.03 0 0 0-2.745 6.465v6.095h18.75v-6.095a9.03 9.03 0 0 0-2.746-6.465A9.497 9.497 0 0 0 60 30.095Z",fill:"#fff"})),e.createElement("circle",{cx:60,cy:67,r:6,fill:"#BBBEC4"}),e.createElement("defs",null,e.createElement("filter",{id:"a",x:23,y:16,width:74,height:88,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},e.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),e.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.createElement("feOffset",{dy:4}),e.createElement("feGaussianBlur",{stdDeviation:6}),e.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.16 0"}),e.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_638_9"}),e.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_638_9",result:"shape"}))))};function Yi(){return Yi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yi.apply(this,arguments)}const zi=function(t){return e.createElement("svg",Yi({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M14.537 9.4a7.306 7.306 0 0 0-4.722-1.733c-3.182 0-5.87 2.02-6.815 4.813l1.615.52c.718-2.127 2.771-3.667 5.2-3.667 1.335 0 2.553.48 3.504 1.254L10.842 13H17V7l-2.463 2.4Z"}))};function Zi(){return Zi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zi.apply(this,arguments)}const Wi=function(t){return e.createElement("svg",Zi({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M3 15h18v-2H3v2Zm0 4h18v-2H3v2Zm0-8h18V9H3v2Zm0-6v2h18V5H3Z"}))};function qi(){return qi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qi.apply(this,arguments)}const Ji=function(t){return e.createElement("svg",qi({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},t),e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.6 2.677c.147-.31.356-.465.626-.465.248 0 .44.118.573.353.134.236.201.557.201.966 0 .443-.078.798-.235 1.067-.156.268-.365.402-.627.402-.237 0-.416-.125-.537-.374h-.008v.31H11V1h.593v1.677h.008zm-.016 1.1a.78.78 0 0 0 .107.426c.071.113.163.169.274.169.136 0 .24-.072.314-.216.075-.145.113-.35.113-.615 0-.22-.035-.39-.104-.514-.067-.124-.164-.187-.29-.187-.12 0-.219.062-.297.185a.886.886 0 0 0-.117.48v.272zM4.12 7.695 2 5.568l.662-.662 1.006 1v-1.51A1.39 1.39 0 0 1 5.055 3H7.4v.905H5.055a.49.49 0 0 0-.468.493l.007 1.5.949-.944.656.656-2.08 2.085zM9.356 4.93H10V3.22C10 2.408 9.685 2 9.056 2c-.135 0-.285.024-.45.073a1.444 1.444 0 0 0-.388.167v.665c.237-.203.487-.304.75-.304.261 0 .392.156.392.469l-.6.103c-.506.086-.76.406-.76.961 0 .263.061.473.183.631A.61.61 0 0 0 8.69 5c.29 0 .509-.16.657-.48h.009v.41zm.004-1.355v.193a.75.75 0 0 1-.12.436.368.368 0 0 1-.313.17.276.276 0 0 1-.22-.095.38.38 0 0 1-.08-.248c0-.222.11-.351.332-.389l.4-.067zM7 12.93h-.644v-.41h-.009c-.148.32-.367.48-.657.48a.61.61 0 0 1-.507-.235c-.122-.158-.183-.368-.183-.63 0-.556.254-.876.76-.962l.6-.103c0-.313-.13-.47-.392-.47-.263 0-.513.102-.75.305v-.665c.095-.063.224-.119.388-.167.165-.049.315-.073.45-.073.63 0 .944.407.944 1.22v1.71zm-.64-1.162v-.193l-.4.068c-.222.037-.333.166-.333.388 0 .1.027.183.08.248a.276.276 0 0 0 .22.095.368.368 0 0 0 .312-.17c.08-.116.12-.26.12-.436zM9.262 13c.321 0 .568-.058.738-.173v-.71a.9.9 0 0 1-.552.207.619.619 0 0 1-.5-.215c-.12-.145-.181-.345-.181-.598 0-.26.063-.464.189-.612a.644.644 0 0 1 .516-.223c.194 0 .37.069.528.207v-.749c-.129-.09-.338-.134-.626-.134-.417 0-.751.14-1.001.422-.249.28-.373.662-.373 1.148 0 .42.116.764.349 1.03.232.267.537.4.913.4zM2 9l1-1h9l1 1v5l-1 1H3l-1-1V9zm1 0v5h9V9H3zm3-2 1-1h7l1 1v5l-1 1V7H6z",clipRule:"evenodd"}))};function Xi(){return Xi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xi.apply(this,arguments)}const $i=function(t){return e.createElement("svg",Xi({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},t),e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"m3.221 3.739 2.261 2.269L7.7 3.784l-.7-.7-1.012 1.007-.008-1.6a.523.523 0 0 1 .5-.526H8V1H6.48A1.482 1.482 0 0 0 5 2.489V4.1L3.927 3.033l-.706.706zm6.67 1.794h.01c.183.311.451.467.806.467.393 0 .706-.168.94-.503.236-.335.353-.78.353-1.333 0-.511-.1-.913-.301-1.207-.201-.295-.488-.442-.86-.442-.405 0-.718.194-.938.581h-.01V1H9v4.919h.89v-.386zm-.015-1.061v-.34c0-.248.058-.448.175-.601a.54.54 0 0 1 .445-.23.49.49 0 0 1 .436.233c.104.154.155.368.155.643 0 .33-.056.587-.169.768a.524.524 0 0 1-.47.27.495.495 0 0 1-.411-.211.853.853 0 0 1-.16-.532zM9 12.769c-.256.154-.625.231-1.108.231-.563 0-1.02-.178-1.369-.533-.349-.355-.523-.813-.523-1.374 0-.648.186-1.158.56-1.53.374-.376.875-.563 1.5-.563.433 0 .746.06.94.179v.998a1.26 1.26 0 0 0-.792-.276c-.325 0-.583.1-.774.298-.19.196-.283.468-.283.816 0 .338.09.603.272.797.182.191.431.287.749.287.282 0 .558-.092.828-.276v.946zM4 7 3 8v6l1 1h7l1-1V8l-1-1H4zm0 1h7v6H4V8z",clipRule:"evenodd"}))};function eo(){return eo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},eo.apply(this,arguments)}const to=function(t){return e.createElement("svg",eo({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 2.5A7.5 7.5 0 0 0 2.5 10H0l3.333 3.333L6.667 10h-2.5A5.833 5.833 0 1 1 10 15.833a5.946 5.946 0 0 1-3.383-1.083l-1.2 1.2A7.595 7.595 0 0 0 10 17.5a7.5 7.5 0 0 0 0-15Zm1.667 7.5a1.667 1.667 0 1 0-3.333 0 1.667 1.667 0 0 0 3.333 0Z"}))};function no(){return no=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},no.apply(this,arguments)}const ro=function(t){return e.createElement("svg",no({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M2.5 7.5h5v5h-5v-5Zm0-3.333h15v1.666h-15V4.166Zm15 3.333v1.666H9.167V7.5H17.5Zm0 3.333V12.5H9.167v-1.667H17.5Zm-15 3.333h11.667v1.667H2.5v-1.667Z"}))};function io(){return io=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},io.apply(this,arguments)}const oo=function(t){return e.createElement("svg",io({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M3.333 3.333A1.667 1.667 0 0 0 1.667 5v9.167a1.667 1.667 0 0 0 1.666 1.666v.834H5v-.834h9.167v.834h1.666v-.834a1.666 1.666 0 0 0 1.667-1.666v-.834h.833v-1.666H17.5V7.5h.833V5.833H17.5V5a1.667 1.667 0 0 0-1.667-1.667h-12.5Zm0 1.667h12.5v9.167h-12.5V5Zm7.917 1.25a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667ZM4.167 7.5v4.167h1.666V7.5H4.167Zm7.083.417a1.667 1.667 0 1 1 0 3.333 1.667 1.667 0 0 1 0-3.333Z"}))};function so(){return so=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},so.apply(this,arguments)}const ao=function(t){return e.createElement("svg",so({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M16 2c.825 0 1.5.686 1.5 1.524v12.19c0 .838-.675 1.524-1.5 1.524h-.75V18h-3v-.762h-4.5V18h-3v-.762H4c-.825 0-1.5-.686-1.5-1.524V3.524C2.5 2.686 3.175 2 4 2h12Zm-2.25 7.619c0-.762-.225-1.524-.6-2.133l1.125-1.143-1.05-1.067L12.1 6.42c-.6-.38-1.35-.61-2.1-.61s-1.5.23-2.1.61L6.85 5.276 5.725 6.42 6.85 7.562c-.375.533-.6 1.295-.6 2.057s.225 1.524.6 2.133l-1.125 1.143 1.125 1.067 1.125-1.143c.525.381 1.275.61 2.025.61s1.5-.229 2.1-.61l1.125 1.143 1.05-1.067-1.125-1.143c.375-.61.6-1.371.6-2.133ZM10 7.333c1.275 0 2.25.99 2.25 2.286 0 1.295-.975 2.286-2.25 2.286s-2.25-.99-2.25-2.286c0-1.295.975-2.286 2.25-2.286Zm0 3.81c.825 0 1.5-.686 1.5-1.524s-.675-1.524-1.5-1.524-1.5.686-1.5 1.524.675 1.524 1.5 1.524Z"}))};function lo(){return lo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lo.apply(this,arguments)}const co=function(t){return e.createElement("svg",lo({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M8.5 9.62c0-.839.675-1.525 1.5-1.525s1.5.686 1.5 1.524-.675 1.524-1.5 1.524-1.5-.686-1.5-1.524Zm-1.65 4.342-1.125-1.067 1.125-1.143a4.144 4.144 0 0 1-.6-2.133c0-.762.225-1.524.6-2.057L5.725 6.419 6.85 5.276 7.9 6.42c.6-.38 1.35-.61 2.1-.61s1.5.23 2.1.61l1.125-1.143 1.05 1.067-1.125 1.143c.375.61.6 1.371.6 2.133s-.225 1.524-.6 2.133l1.125 1.143-1.05 1.067-1.125-1.143c-.6.381-1.35.61-2.1.61s-1.5-.229-2.025-.61L6.85 13.962ZM10 7.333c-1.275 0-2.25.99-2.25 2.286 0 1.295.975 2.286 2.25 2.286s2.25-.99 2.25-2.286c0-1.295-.975-2.286-2.25-2.286ZM16 2c.825 0 1.5.686 1.5 1.524v12.19c0 .838-.675 1.524-1.5 1.524h-.75V18h-3v-.762h-4.5V18h-3v-.762H4c-.825 0-1.5-.686-1.5-1.524V3.524C2.5 2.686 3.175 2 4 2h12Zm0 13.714V3.524H4v12.19h12Z"}))};function uo(){return uo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uo.apply(this,arguments)}const ho=function(t){return e.createElement("svg",uo({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M17 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V7l-4-4Zm2 16H5V5h11.17L19 7.83V19Zm-7-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3ZM6 6h9v4H6V6Z"}))};function po(){return po=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},po.apply(this,arguments)}const fo=function(t){return e.createElement("svg",po({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M7.917 2.5a5.417 5.417 0 0 1 5.416 5.417 5.43 5.43 0 0 1-1.3 3.525l.225.225h.659l4.166 4.166-1.25 1.25-4.166-4.166v-.659l-.225-.225a5.43 5.43 0 0 1-3.525 1.3 5.416 5.416 0 1 1 0-10.833Zm0 1.667a3.734 3.734 0 0 0-3.75 3.75 3.734 3.734 0 0 0 3.75 3.75 3.734 3.734 0 0 0 3.75-3.75 3.734 3.734 0 0 0-3.75-3.75Z"}))};function go(){return go=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},go.apply(this,arguments)}const mo=function(t){return e.createElement("svg",go({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M8.874 14.017a4.99 4.99 0 0 0 2.91-.938l3.086 3.086a.742.742 0 0 0 .534.215c.423 0 .722-.325.722-.742a.717.717 0 0 0-.208-.52l-3.066-3.074A4.987 4.987 0 0 0 13.88 9.01a5.02 5.02 0 0 0-5.006-5.006A5.02 5.02 0 0 0 3.867 9.01a5.02 5.02 0 0 0 5.007 5.007Zm0-1.08c-2.149 0-3.926-1.778-3.926-3.927 0-2.148 1.777-3.925 3.926-3.925 2.148 0 3.925 1.777 3.925 3.925 0 2.149-1.777 3.926-3.925 3.926Z"}))};function yo(){return yo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yo.apply(this,arguments)}const vo=function(t){return e.createElement("svg",yo({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 10h5.444c-.412 2.99-2.55 5.658-5.444 6.487V10H4.556V5.855L10 3.593V10Zm0-8L3 4.91v4.363c0 4.036 2.987 7.803 7 8.727 4.013-.924 7-4.69 7-8.727V4.909L10 2Z"}))};function Ao(){return Ao=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ao.apply(this,arguments)}const bo=function(t){return e.createElement("svg",Ao({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M9.167 5.833H17.5V7.5H9.167V5.833Zm0 6.667H17.5v1.666H9.167V12.5Zm-5 4.166L1.25 13.75l1.175-1.175 1.742 1.733 3.825-3.816 1.175 1.174-5 5ZM1.25 7.083 4.167 10l5-5-1.175-1.175-3.825 3.817-1.742-1.734L1.25 7.083Z"}))};function wo(){return wo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wo.apply(this,arguments)}const So=function(t){return e.createElement("svg",wo({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M.833 18.333 20 10 .833 1.667v6.481L14.523 10 .834 11.852v6.481Z"}))};function Co(){return Co=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Co.apply(this,arguments)}const Eo=function(t){return e.createElement("svg",Co({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10.833 15.833h.834a.833.833 0 0 1 .833.834h5.833v1.666H12.5a.833.833 0 0 1-.833.834H8.333a.833.833 0 0 1-.833-.834H1.667v-1.666H7.5a.833.833 0 0 1 .833-.834h.834v-1.666H3.333a.833.833 0 0 1-.833-.834V10a.833.833 0 0 1 .833-.833h13.334A.833.833 0 0 1 17.5 10v3.333a.833.833 0 0 1-.833.834h-5.834v1.666ZM3.333 2.5h13.334a.833.833 0 0 1 .833.833v3.334a.833.833 0 0 1-.833.833H3.333a.833.833 0 0 1-.833-.833V3.333a.833.833 0 0 1 .833-.833ZM7.5 5.833h.833V4.167H7.5v1.666Zm0 6.667h.833v-1.667H7.5V12.5ZM4.167 4.167v1.666h1.666V4.167H4.167Zm0 6.666V12.5h1.666v-1.667H4.167Z"}))};function Io(){return Io=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Io.apply(this,arguments)}const _o=function(t){return e.createElement("svg",Io({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 12.917a2.916 2.916 0 1 1 0-5.833 2.916 2.916 0 0 1 0 5.833Zm6.192-2.109A6.48 6.48 0 0 0 16.25 10c0-.275-.025-.55-.058-.833l1.758-1.359a.42.42 0 0 0 .1-.533l-1.667-2.883a.41.41 0 0 0-.508-.184l-2.075.834a6.04 6.04 0 0 0-1.408-.817l-.309-2.208a.421.421 0 0 0-.416-.35H8.333a.421.421 0 0 0-.416.35l-.309 2.208a6.04 6.04 0 0 0-1.408.817l-2.075-.834a.41.41 0 0 0-.508.184L1.95 7.275a.41.41 0 0 0 .1.533l1.758 1.359A7.126 7.126 0 0 0 3.75 10c0 .275.025.542.058.808L2.05 12.192a.41.41 0 0 0-.1.533l1.667 2.883c.1.184.325.25.508.184L6.2 14.95a5.79 5.79 0 0 0 1.408.825l.309 2.208c.033.2.208.35.416.35h3.334c.208 0 .383-.15.416-.35l.309-2.208a6.07 6.07 0 0 0 1.408-.825l2.075.842c.183.066.408 0 .508-.184l1.667-2.883a.42.42 0 0 0-.1-.533l-1.758-1.384Z"}))};function xo(){return xo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xo.apply(this,arguments)}const Po=function(t){return e.createElement("svg",xo({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 6.667a3.333 3.333 0 1 1 0 6.666 3.333 3.333 0 0 1 0-6.666Zm0 1.666a1.667 1.667 0 1 0 0 3.334 1.667 1.667 0 0 0 0-3.334Zm-1.667 10a.421.421 0 0 1-.416-.35l-.309-2.208A5.79 5.79 0 0 1 6.2 14.95l-2.075.842a.419.419 0 0 1-.508-.184L1.95 12.725a.41.41 0 0 1 .1-.533l1.758-1.384L3.75 10l.058-.833L2.05 7.808a.41.41 0 0 1-.1-.533l1.667-2.883a.41.41 0 0 1 .508-.184l2.075.834a6.04 6.04 0 0 1 1.408-.817l.309-2.208c.033-.2.208-.35.416-.35h3.334c.208 0 .383.15.416.35l.309 2.208a6.04 6.04 0 0 1 1.408.817l2.075-.834a.41.41 0 0 1 .508.184l1.667 2.883a.41.41 0 0 1-.1.533l-1.758 1.359.058.833-.058.833 1.758 1.359c.158.125.208.35.1.533l-1.667 2.883a.41.41 0 0 1-.508.184l-2.075-.834a6.042 6.042 0 0 1-1.408.817l-.309 2.208a.421.421 0 0 1-.416.35H8.333Zm1.042-15-.308 2.175c-1 .209-1.884.742-2.525 1.484l-2.009-.867-.625 1.083L5.667 8.5a4.625 4.625 0 0 0 0 3L3.9 12.8l.625 1.083 2.025-.866a4.536 4.536 0 0 0 2.508 1.466l.309 2.184h1.266l.309-2.175a4.598 4.598 0 0 0 2.508-1.475l2.025.866.625-1.083-1.767-1.292a4.65 4.65 0 0 0 0-3.008l1.759-1.292-.625-1.083-2.009.867a4.517 4.517 0 0 0-2.525-1.475l-.308-2.184h-1.25Z"}))};function ko(){return ko=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ko.apply(this,arguments)}const Bo=function(t){return e.createElement("svg",ko({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M14.667 13.315c-.591 0-1.12.241-1.525.619l-5.545-3.335c.039-.185.07-.37.07-.563 0-.193-.031-.378-.07-.562L13.08 6.17c.42.402.972.65 1.587.65.619 0 1.212-.253 1.65-.705A2.452 2.452 0 0 0 17 4.41c0-.64-.246-1.253-.683-1.705A2.296 2.296 0 0 0 14.667 2c-.62 0-1.213.254-1.65.706a2.452 2.452 0 0 0-.684 1.705c0 .193.031.378.07.562L6.92 8.276a2.284 2.284 0 0 0-1.587-.65c-.619 0-1.212.253-1.65.705A2.452 2.452 0 0 0 3 10.036c0 .64.246 1.253.683 1.705a2.296 2.296 0 0 0 1.65.706c.615 0 1.167-.25 1.587-.65l5.538 3.334a2.353 2.353 0 0 0-.062.53c0 1.294 1.018 2.339 2.27 2.339 1.253 0 2.272-1.045 2.272-2.338 0-.623-.24-1.22-.665-1.66a2.235 2.235 0 0 0-1.606-.687Z"}))};function Oo(){return Oo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Oo.apply(this,arguments)}const No=function(t){return e.createElement("svg",Oo({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("rect",{x:.5,y:.5,width:19,height:19,rx:3.5,fill:"#fff",stroke:"#DFE1E4"}),e.createElement("path",{d:"M5.5 6h3.055l3.52 7H14.5v1h-3.06L7.92 7H5.5V6ZM11 6h3.5v1H11V6Z"}))};function Do(){return Do=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Do.apply(this,arguments)}const jo=function(t){return e.createElement("svg",Do({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M15.833 2.5H4.167A1.66 1.66 0 0 0 2.5 4.167V7.5h1.667V4.167h11.666v11.666H4.167V12.5H2.5v3.333A1.666 1.666 0 0 0 4.167 17.5h11.666a1.666 1.666 0 0 0 1.667-1.667V4.167c0-.925-.75-1.667-1.667-1.667ZM8.4 12.983l1.183 1.184L13.75 10 9.583 5.833 8.4 7.008l2.158 2.159H2.5v1.666h8.058L8.4 12.983Z"}))};function To(){return To=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},To.apply(this,arguments)}const Mo=function(t){return e.createElement("svg",To({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m11.733 12.992 2.159-2.159H5.833V9.167h8.059l-2.159-2.159 1.184-1.175L17.083 10l-4.166 4.167-1.184-1.175Zm4.1-10.492A1.666 1.666 0 0 1 17.5 4.167v3.891l-1.667-1.666V4.167H4.167v11.666h11.666v-2.225l1.667-1.666v3.891a1.666 1.666 0 0 1-1.667 1.667H4.167c-.925 0-1.667-.75-1.667-1.667V4.167A1.66 1.66 0 0 1 4.167 2.5h11.666Z"}))};function Fo(){return Fo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fo.apply(this,arguments)}const Ro=function(t){return e.createElement("svg",Fo({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},t),e.createElement("path",{fill:"currentColor",d:"M3.466 3.62c-.004.052-.014.104-.018.158-.406 4.626 2.747 8.548 8.03 9.994 2.024.553 5.374 2.018 5.06 5.599a5.063 5.063 0 0 1-1.803 3.46c-1.022.857-2.308 1.21-3.64 1.166C5.147 23.794 0 18.367 0 12.05a11.95 11.95 0 0 1 3.467-8.428zM9.82 1.032C10.727.27 11.876-.046 13.055.005 18.996.27 24 5.67 24 11.936a11.94 11.94 0 0 1-2.667 7.536c.332-4.908-2.94-8.897-8.59-10.441-2.337-.64-4.749-2.274-4.514-4.948A4.467 4.467 0 0 1 9.82 1.03z"}))};function Lo(){return Lo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lo.apply(this,arguments)}const Qo=function(t){return e.createElement("svg",Lo({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M12.004 9.604v4.293h1.6V9.604c0-1.94-1.612-3.512-3.601-3.512-1.99 0-3.603 1.572-3.603 3.512v4.293h1.601V9.604c0-1.078.896-1.951 2.002-1.951 1.105 0 2 .873 2 1.95Z"}),e.createElement("path",{clipRule:"evenodd",d:"M1.667 3.333c0-.92.746-1.667 1.666-1.667h13.334c.92 0 1.666.747 1.666 1.667v13.334c0 .92-.746 1.666-1.666 1.666H3.333c-.92 0-1.666-.746-1.666-1.666V3.332ZM3.333 2.5h13.334c.46 0 .833.373.833.833v13.334c0 .46-.373.833-.833.833H3.333a.833.833 0 0 1-.833-.834V3.333c0-.46.373-.833.833-.833Z"}))};function Uo(){return Uo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Uo.apply(this,arguments)}const Vo=function(t){return e.createElement("svg",Uo({viewBox:"0 0 148 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 5c0-2.761 2.242-5 5.008-5h15.024a5.004 5.004 0 0 1 5.008 5v15c0 2.761-2.242 5-5.008 5H5.008A5.004 5.004 0 0 1 0 20V5Zm5.008-2.813h15.024A2.815 2.815 0 0 1 22.849 5v15a2.815 2.815 0 0 1-2.817 2.813H5.008A2.815 2.815 0 0 1 2.191 20V5a2.815 2.815 0 0 1 2.817-2.813Zm10.157 9.686v5.854h2.187v-5.854c0-2.645-2.203-4.79-4.92-4.79s-4.92 2.145-4.92 4.79v5.854h2.187v-5.854c0-1.47 1.223-2.661 2.733-2.661s2.733 1.191 2.733 2.66Zm57.436 5.848h1.834V6h-1.93v5.225h-.049a3.018 3.018 0 0 0-.37-.388 2.74 2.74 0 0 0-.547-.372 3.066 3.066 0 0 0-.724-.279 3.344 3.344 0 0 0-.95-.124c-.547 0-1.05.103-1.512.31-.461.197-.858.47-1.19.822-.333.351-.59.765-.773 1.24a4.249 4.249 0 0 0-.274 1.535c0 .548.086 1.065.258 1.55.182.476.434.894.756 1.256.333.352.73.636 1.19.853.473.207 1.004.31 1.594.31.547 0 1.056-.114 1.528-.341a2.585 2.585 0 0 0 1.127-.992h.032v1.116Zm-4.393-2.884a3.038 3.038 0 0 1-.129-.868c0-.29.043-.574.13-.853.096-.29.235-.547.417-.775.183-.227.413-.408.692-.543.28-.144.606-.217.982-.217.354 0 .67.073.95.217.278.145.514.331.707.559.204.227.354.485.45.775.108.29.162.579.162.868 0 .29-.054.579-.161.868-.097.28-.247.532-.45.76-.194.227-.43.413-.709.558a2.16 2.16 0 0 1-.95.202c-.375 0-.702-.073-.98-.218a2.13 2.13 0 0 1-.693-.558 2.484 2.484 0 0 1-.418-.775ZM39.662 9.04c-.215-.269-.52-.491-.917-.667a2.681 2.681 0 0 0-1.175-.279c-.236 0-.472.031-.708.093-.236.052-.45.14-.644.264a1.456 1.456 0 0 0-.483.465 1.248 1.248 0 0 0-.176.682c0 .248.053.46.16.636.108.175.252.325.435.45.193.123.424.232.692.325.268.093.563.186.885.279.364.113.74.243 1.126.387.397.145.757.336 1.078.574.333.238.601.538.805.9.214.361.322.81.322 1.348 0 .59-.113 1.106-.338 1.55a3.227 3.227 0 0 1-.901 1.086c-.376.29-.816.506-1.32.65A5.748 5.748 0 0 1 36.91 18c-.74 0-1.464-.13-2.172-.388-.708-.268-1.287-.661-1.738-1.178l1.448-1.302a2.9 2.9 0 0 0 1.11.883c.473.218.934.326 1.384.326.236 0 .478-.026.724-.077.247-.063.467-.16.66-.295.204-.134.365-.3.483-.496.129-.207.193-.46.193-.76 0-.29-.07-.527-.21-.713a1.72 1.72 0 0 0-.562-.496 3.849 3.849 0 0 0-.837-.372l-1.014-.326a10.304 10.304 0 0 1-1.03-.372 3.563 3.563 0 0 1-.933-.573 2.869 2.869 0 0 1-.66-.869c-.171-.351-.257-.785-.257-1.302 0-.558.118-1.039.354-1.442.247-.403.563-.734.95-.992a4.176 4.176 0 0 1 1.335-.59 5.912 5.912 0 0 1 1.528-.2c.58 0 1.164.097 1.754.294.601.196 1.121.49 1.561.883l-1.32 1.396Zm2.13 1.24v1.488h1.351v3.473c0 .362.032.703.097 1.024.075.31.204.589.386.837.193.238.45.429.772.573.322.135.74.202 1.255.202.215 0 .44-.02.676-.062.236-.031.44-.078.612-.14l-.065-1.457a2.026 2.026 0 0 1-.402.124c-.15.02-.29.031-.418.031-.43 0-.708-.108-.837-.325-.118-.218-.177-.491-.177-.822v-3.458h1.93V10.28h-1.93V8.124h-1.899v2.155h-1.352Zm11.325 6.496h.049v.946h1.802v-4.527c0-.372-.054-.744-.161-1.117a2.49 2.49 0 0 0-.531-1.007c-.258-.3-.612-.543-1.062-.729-.44-.186-1.003-.279-1.69-.279a5.43 5.43 0 0 0-1.754.295 4.406 4.406 0 0 0-1.512.883l.997 1.132c.247-.238.558-.44.934-.605a2.885 2.885 0 0 1 1.174-.248c.483 0 .896.114 1.24.341.353.218.53.559.53 1.024v.186c-.6 0-1.217.03-1.85.093a7.09 7.09 0 0 0-1.706.34c-.515.177-.938.43-1.271.76-.322.331-.483.776-.483 1.334 0 .434.091.8.274 1.1.193.29.429.528.708.714.29.176.6.3.933.372.343.083.67.124.982.124.547 0 1.035-.103 1.464-.31.429-.217.74-.491.933-.822Zm-.418-2.45h.434v.264c0 .59-.171 1.054-.515 1.396-.343.34-.847.511-1.512.511-.161 0-.322-.015-.483-.046a1.435 1.435 0 0 1-.434-.155 1.03 1.03 0 0 1-.322-.28.852.852 0 0 1-.113-.45c0-.278.097-.495.29-.65.193-.166.434-.29.724-.372.29-.093.606-.15.95-.17.342-.032.67-.047.98-.047Zm6.353-4.046h-1.835v7.442h1.931v-4.093c0-.248.038-.491.113-.729.075-.248.182-.465.322-.65.15-.187.338-.337.563-.45.225-.125.493-.187.804-.187.311 0 .558.062.74.186.194.124.344.285.451.481.108.186.177.398.21.636.032.238.048.465.048.682v4.124h1.93V13.07c0-.383-.053-.755-.16-1.117a2.628 2.628 0 0 0-.515-.96 2.374 2.374 0 0 0-.885-.667c-.354-.176-.783-.264-1.288-.264-.579 0-1.083.145-1.512.434-.419.28-.714.605-.885.977h-.032v-1.194Zm22.524 6.496h-.048c-.193.33-.504.605-.933.822-.43.207-.917.31-1.465.31-.31 0-.638-.041-.981-.124a3.026 3.026 0 0 1-.933-.372 2.543 2.543 0 0 1-.708-.713c-.183-.3-.274-.667-.274-1.101 0-.558.161-1.003.483-1.333.332-.331.756-.584 1.271-.76a7.089 7.089 0 0 1 1.706-.341c.633-.062 1.25-.093 1.85-.093v-.186c0-.465-.177-.806-.53-1.024-.344-.227-.757-.34-1.24-.34-.407 0-.799.082-1.174.247a3.174 3.174 0 0 0-.934.605l-.997-1.132c.44-.393.944-.687 1.512-.883a5.43 5.43 0 0 1 1.754-.295c.687 0 1.25.093 1.69.28.45.185.804.428 1.062.728.257.3.434.635.53 1.008.108.372.162.744.162 1.116v4.527h-1.803v-.946Zm-.032-2.45h-.434c-.311 0-.638.016-.982.047-.343.02-.66.078-.95.17-.289.083-.53.207-.723.373-.193.155-.29.372-.29.65 0 .177.038.327.113.45.085.114.193.207.322.28.128.072.273.124.434.155.16.03.322.046.483.046.665 0 1.169-.17 1.512-.511.344-.342.515-.807.515-1.396v-.263Zm4.084-4.046h1.85v1.24h.033c.214-.434.515-.785.901-1.054s.837-.403 1.352-.403c.075 0 .155.005.241.016.086 0 .16.01.225.03v1.706a2.693 2.693 0 0 0-.338-.062 2.16 2.16 0 0 0-.257-.016c-.44 0-.794.078-1.062.233a1.905 1.905 0 0 0-.933 1.225c-.054.227-.08.408-.08.542v3.985h-1.932v-7.442Zm13.431 7.442h-1.834v-1.116h-.032a2.585 2.585 0 0 1-1.127.992 3.475 3.475 0 0 1-1.528.341c-.59 0-1.121-.103-1.593-.31a3.915 3.915 0 0 1-1.191-.853 4.057 4.057 0 0 1-.757-1.256 4.62 4.62 0 0 1-.257-1.55c0-.548.091-1.06.274-1.535.182-.475.44-.889.772-1.24.332-.352.73-.626 1.19-.822.462-.207.966-.31 1.513-.31.354 0 .67.041.95.124.279.072.52.165.724.28.214.113.397.237.547.371.15.135.273.264.37.388h.048V6h1.931v11.72Zm-6.356-3.752c0 .29.043.579.129.868.096.29.236.548.418.775.183.228.413.414.692.559.28.144.606.217.982.217.354 0 .67-.068.95-.202.278-.145.514-.33.707-.558.204-.228.354-.48.45-.76.108-.29.162-.579.162-.868 0-.29-.054-.579-.161-.868a2.186 2.186 0 0 0-.45-.775 2.318 2.318 0 0 0-.709-.559 2.03 2.03 0 0 0-.95-.217c-.375 0-.702.073-.98.217-.28.135-.51.316-.693.543a2.482 2.482 0 0 0-.418.775 2.886 2.886 0 0 0-.129.853Zm12.821-7.225h2.688l5.294 8.217h.032V6.744h2.027v10.977h-2.574l-5.407-8.48h-.032v8.48h-2.028V6.744Zm12.009 7.225c0-.59.107-1.121.322-1.597.225-.486.525-.9.901-1.24.375-.341.82-.605 1.335-.79a4.793 4.793 0 0 1 1.642-.28c.579 0 1.126.093 1.641.28.515.185.96.449 1.335.79.376.34.671.754.885 1.24.226.476.338 1.008.338 1.597 0 .59-.112 1.127-.338 1.612a3.788 3.788 0 0 1-.885 1.256c-.375.341-.82.61-1.335.806a4.566 4.566 0 0 1-1.641.295c-.58 0-1.127-.098-1.642-.295a4.166 4.166 0 0 1-1.335-.806 3.998 3.998 0 0 1-.901-1.256 3.94 3.94 0 0 1-.322-1.612Zm1.963 0c0 .29.043.579.129.868.096.29.236.548.418.775.182.228.413.414.692.559.279.144.611.217.998.217.386 0 .718-.073.997-.218.279-.144.51-.33.692-.558.183-.227.317-.485.402-.775.097-.29.145-.579.145-.868 0-.29-.048-.574-.145-.853a2.221 2.221 0 0 0-.402-.775 1.962 1.962 0 0 0-.692-.543c-.279-.144-.611-.217-.997-.217-.387 0-.719.073-.998.217-.279.135-.51.316-.692.543a2.479 2.479 0 0 0-.418.775 2.88 2.88 0 0 0-.129.853Zm7.198-2.202V10.28h1.352V8.124h1.899v2.155h1.931v1.488h-1.931v3.458c0 .33.059.604.177.822.128.217.407.325.836.325.129 0 .269-.01.419-.03.15-.032.284-.073.402-.125l.064 1.457a2.93 2.93 0 0 1-.611.14 3.922 3.922 0 0 1-.676.062c-.515 0-.933-.067-1.255-.202a2.06 2.06 0 0 1-.772-.573 2.308 2.308 0 0 1-.386-.837 5.142 5.142 0 0 1-.097-1.024v-3.473h-1.352Zm13.949 2.326v.248c0 .083-.006.166-.016.248h-5.874c.022.269.092.517.21.744.128.217.295.409.498.574.204.155.435.279.692.372.258.093.526.14.805.14.483 0 .89-.083 1.223-.248.332-.176.606-.414.821-.714l1.287.993c-.762.992-1.867 1.488-3.315 1.488a5.002 5.002 0 0 1-1.657-.264 4.141 4.141 0 0 1-1.32-.775 3.62 3.62 0 0 1-.869-1.21c-.204-.485-.305-1.033-.305-1.643 0-.599.101-1.142.305-1.627.215-.497.504-.915.869-1.256.365-.352.794-.62 1.287-.806a4.443 4.443 0 0 1 1.626-.295c.536 0 1.03.088 1.48.264.461.165.858.418 1.191.76.332.33.59.749.772 1.255.193.496.29 1.08.29 1.752Zm-1.931-.837c0-.238-.038-.465-.113-.682a1.445 1.445 0 0 0-.901-.962 1.912 1.912 0 0 0-.804-.155c-.58 0-1.073.17-1.481.512-.397.33-.617.76-.66 1.287h3.959Zm8.033-.992a2.136 2.136 0 0 0-.708-.559 2.003 2.003 0 0 0-.982-.248c-.311 0-.595.062-.853.186a.64.64 0 0 0-.386.62c0 .29.14.497.419.62.289.114.708.233 1.255.357.289.062.579.145.869.248.3.104.568.243.804.419.247.165.445.377.596.636.15.248.225.553.225.914 0 .455-.091.843-.274 1.163-.171.31-.407.563-.708.76a2.848 2.848 0 0 1-1.029.419c-.387.093-.789.139-1.207.139a5.092 5.092 0 0 1-1.754-.31 3.79 3.79 0 0 1-1.416-.915l1.271-1.147c.214.269.493.49.837.667.343.175.724.263 1.142.263.14 0 .279-.015.418-.046.151-.031.285-.078.403-.14a.875.875 0 0 0 .306-.279.744.744 0 0 0 .112-.419c0-.31-.15-.532-.45-.666-.29-.135-.73-.269-1.32-.403a7.95 7.95 0 0 1-.853-.233 3.2 3.2 0 0 1-.724-.388 1.904 1.904 0 0 1-.515-.604c-.128-.238-.193-.532-.193-.884 0-.413.086-.77.258-1.07.182-.3.418-.542.708-.728.289-.197.616-.341.981-.434.365-.094.74-.14 1.127-.14.557 0 1.099.093 1.625.28.536.185.96.47 1.271.852l-1.255 1.07Z",fill:"#086DD6"}))};function Ko(){return Ko=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ko.apply(this,arguments)}const Ho=function(t){return e.createElement("svg",Ko({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{clipRule:"evenodd",d:"M4.286 3.6h11.428c.379 0 .686.307.686.686v11.428a.686.686 0 0 1-.686.686H4.286a.686.686 0 0 1-.686-.686V4.286c0-.379.307-.686.686-.686ZM2 4.286A2.286 2.286 0 0 1 4.286 2h11.428A2.286 2.286 0 0 1 18 4.286v11.428A2.286 2.286 0 0 1 15.714 18H4.286A2.286 2.286 0 0 1 2 15.714V4.286Zm9.937 5.254v4.293h1.601V9.54c0-1.94-1.613-3.512-3.602-3.512-1.99 0-3.603 1.572-3.603 3.512v4.293h1.602V9.54c0-1.078.896-1.951 2-1.951 1.106 0 2.002.873 2.002 1.951Z"}))};function Go(){return Go=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Go.apply(this,arguments)}const Yo=function(t){return e.createElement("svg",Go({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M8.333 10.833V9.167h5.834a.833.833 0 0 1 0 1.666H8.333Zm0 5v-1.666h2.5a.833.833 0 1 1 0 1.666h-2.5Zm0-10V4.167H17.5a.833.833 0 0 1 0 1.666H8.333ZM5 14.167h2.083l-2.916 2.916-2.917-2.916h2.083V3.333H5v10.834Z"}))};function zo(){return zo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zo.apply(this,arguments)}const Zo=function(t){return e.createElement("svg",zo({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M4 3h12c.398 0 .78.155 1.06.432.282.276.44.65.44 1.042v11.052c0 .391-.158.766-.44 1.042A1.514 1.514 0 0 1 16 17H4c-.398 0-.78-.155-1.06-.432a1.46 1.46 0 0 1-.44-1.042V4.474c0-.391.158-.766.44-1.042A1.514 1.514 0 0 1 4 3Zm0 2.947v2.21h3v-2.21H4Zm4.5 0v2.21h3v-2.21h-3Zm7.5 2.21v-2.21h-3v2.21h3ZM4 9.633v2.21h3v-2.21H4Zm0 5.894h3v-2.21H4v2.21Zm4.5-5.894v2.21h3v-2.21h-3Zm0 5.894h3v-2.21h-3v2.21Zm7.5 0v-2.21h-3v2.21h3Zm0-5.894h-3v2.21h3v-2.21Z"}))};function Wo(){return Wo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wo.apply(this,arguments)}const qo=function(t){return e.createElement("svg",Wo({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M13.525 15 10 12.875 6.475 15l.933-4.008L4.3 8.3l4.1-.35L10 4.167l1.6 3.775 4.1.35-3.108 2.691.933 4.017ZM10 1.667c-4.608 0-8.333 3.75-8.333 8.333A8.333 8.333 0 1 0 10 1.667Z"}))};function Jo(){return Jo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jo.apply(this,arguments)}const Xo=function(t){return e.createElement("svg",Jo({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m12.462 7.202 5.4.458a.2.2 0 0 1 .113.35l-4.1 3.553a.2.2 0 0 0-.064.196l1.231 5.28a.2.2 0 0 1-.298.216l-4.64-2.8a.2.2 0 0 0-.207 0l-4.642 2.8a.2.2 0 0 1-.298-.216l1.224-5.28a.2.2 0 0 0-.064-.196L2.024 8.01a.2.2 0 0 1 .114-.35l5.4-.458a.2.2 0 0 0 .167-.121l2.11-4.98a.2.2 0 0 1 .37 0l2.11 4.98a.2.2 0 0 0 .167.12Z"}))};function $o(){return $o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$o.apply(this,arguments)}const es=function(t){return e.createElement("svg",$o({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10.104 12.887a.2.2 0 0 0-.207 0l-2.625 1.585a.2.2 0 0 1-.299-.216l.692-2.989a.2.2 0 0 0-.064-.196l-2.318-2.01a.2.2 0 0 1 .114-.35l3.058-.26a.2.2 0 0 0 .167-.12l1.194-2.82a.2.2 0 0 1 .368 0l1.194 2.82a.2.2 0 0 0 .167.12l3.058.26a.2.2 0 0 1 .114.35L12.4 11.07a.2.2 0 0 0-.063.196l.69 2.99a.2.2 0 0 1-.297.215l-2.625-1.585Zm7.871-4.877a.2.2 0 0 0-.114-.35l-5.4-.458a.2.2 0 0 1-.166-.121l-2.11-4.98a.2.2 0 0 0-.37 0l-2.11 4.98a.2.2 0 0 1-.167.12l-5.4.46a.2.2 0 0 0-.114.35l4.093 3.552a.2.2 0 0 1 .064.196l-1.224 5.28a.2.2 0 0 0 .298.217l4.642-2.802a.2.2 0 0 1 .206 0l4.641 2.801a.2.2 0 0 0 .298-.216l-1.231-5.28a.2.2 0 0 1 .064-.196l4.1-3.553Z"}))};function ts(){return ts=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ts.apply(this,arguments)}const ns=function(t){return e.createElement("svg",ts({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 .833 7.5 7.5.833 10 7.5 12.5l2.5 6.667 2.5-6.667 6.667-2.5L12.5 7.5 10 .833Z"}))};function rs(){return rs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rs.apply(this,arguments)}const is=function(t){return e.createElement("svg",rs({viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.468 5.384a.766.766 0 0 1-.187.239.395.395 0 0 1-.25.076c-.107 0-.23-.051-.366-.153a5.322 5.322 0 0 0-.518-.353 3.396 3.396 0 0 0-.732-.352 2.904 2.904 0 0 0-1.027-.163 2.79 2.79 0 0 0-.99.163c-.28.101-.515.244-.706.429-.19.178-.336.39-.437.639a2.14 2.14 0 0 0-.143.791c0 .369.086.674.259.916.178.241.41.448.696.62.158.095.328.183.51.264H6.67a3.74 3.74 0 0 1-.067-.15c-.172-.42-.258-.934-.258-1.545 0-.49.089-.963.267-1.42a3.6 3.6 0 0 1 .777-1.212 3.774 3.774 0 0 1 1.268-.849C9.157 3.108 9.727 3 10.37 3c.72 0 1.381.124 1.982.372a4.508 4.508 0 0 1 1.58 1.049l-.464.963ZM8.148 10H16v1.5h-1.96c.107.33.16.714.16 1.151 0 .604-.098 1.17-.294 1.698-.191.527-.47.988-.84 1.383a3.946 3.946 0 0 1-1.365.934c-.536.223-1.146.334-1.83.334-.411 0-.81-.044-1.197-.134a5.605 5.605 0 0 1-1.098-.352 5.997 5.997 0 0 1-.973-.563 5.157 5.157 0 0 1-.803-.744l.545-.973a.786.786 0 0 1 .187-.19.46.46 0 0 1 .259-.077c.125 0 .268.07.428.21.167.14.37.296.607.467.244.166.533.318.866.458.34.14.75.21 1.232.21.393 0 .744-.054 1.053-.162a2.17 2.17 0 0 0 .777-.477c.214-.21.378-.46.491-.753.113-.293.17-.617.17-.973 0-.4-.087-.728-.26-.982a2.075 2.075 0 0 0-.434-.465H4V10h4.148Z"}))};function os(){return os=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},os.apply(this,arguments)}const ss=function(t){return e.createElement("svg",os({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 426.85",fill:"currentColor",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",imageRendering:"optimizeQuality",fillRule:"evenodd",clipRule:"evenodd"},t),e.createElement("path",{fillRule:"nonzero",d:"M174.2 125.3 266.74 0h76.65L212.88 173.99l135.9 180.45H272l-97.84-131.8-97.52 131.8H0L135.88 174 5.07 0h77.04l92.09 125.3zm322.38 301.55H373.5v-24.14l2.43-6.43c5.45-6.3 60.34-69.48 60.34-69.63 2.94-3.38 5.44-6.34 7.47-8.87 2.25-2.78 4.35-5.51 6.3-8.17 1.95-2.65 3.64-5.1 5.08-7.31 1.48-2.29 2.77-4.43 3.84-6.39.98-1.81 1.89-3.66 2.69-5.53.74-1.73 1.34-3.4 1.8-4.96.4-1.38.72-2.83.95-4.32.2-1.32.31-2.63.31-3.91 0-4.79-.59-8.86-1.77-12.22-1.05-3-2.61-5.55-4.66-7.63-.9-.89-1.97-1.73-3.21-2.49v-.05c-1.25-.77-2.64-1.42-4.13-1.94-1.77-.58-3.74-1.04-5.92-1.36-2.22-.33-4.72-.49-7.5-.49-2.97 0-5.62.19-7.92.56-2.27.37-4.37.92-6.29 1.64-1.74.66-3.37 1.49-4.84 2.46h-.04c-1.37.9-2.67 2.01-3.91 3.31a29.328 29.328 0 0 0-3.45 4.53 28.145 28.145 0 0 0-2.47 5.1c-.67 1.89-1.19 3.95-1.55 6.16-.34 2.15-.52 4.62-.52 7.39v15.42h-32.44l-2.49-8.39c-1.6-5.43-2.02-10.97-1.59-16.39.46-5.81 1.93-11.59 3.94-16.98 1.5-4.03 3.43-7.92 5.78-11.67v-.04c2.31-3.68 5-7.15 8.05-10.4 3.16-3.38 6.62-6.37 10.36-8.93 3.67-2.51 7.68-4.64 12.03-6.37a67.26 67.26 0 0 1 13.17-3.73v-.05c4.52-.8 9.25-1.21 14.18-1.21 4.38 0 8.75.34 13.07 1.03 4.33.69 8.4 1.71 12.19 3.05 3.9 1.38 7.65 3.18 11.24 5.36h.05c3.51 2.13 6.78 4.63 9.79 7.46 3.1 2.9 5.85 6.14 8.22 9.69 2.4 3.58 4.36 7.37 5.88 11.34 1.46 3.86 2.58 8.02 3.33 12.45.72 4.33 1.09 8.8 1.09 13.39 0 3.11-.28 6.39-.84 9.83-.52 3.22-1.31 6.5-2.35 9.8-.94 3.08-2.21 6.28-3.74 9.55a92.644 92.644 0 0 1-5.12 9.43l-.05.09c-1.97 3.13-3.91 6.09-5.82 8.84-2.02 2.9-4.26 5.98-6.7 9.2-2.15 2.83-4.71 6.08-7.67 9.73-2.77 3.42-5.63 6.85-8.57 10.26l-30.31 35.42H512v37.51h-15.42z"}))};function as(){return as=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},as.apply(this,arguments)}const ls=function(t){return e.createElement("svg",as({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},t),e.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:2,d:"M20 12H4"}))};function cs(){return cs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cs.apply(this,arguments)}const us=function(t){return e.createElement("svg",cs({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 475.8",fill:"currentColor",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",imageRendering:"optimizeQuality",fillRule:"evenodd",clipRule:"evenodd"},t),e.createElement("path",{fillRule:"nonzero",d:"m174.2 246.66 92.54-125.3h76.65L212.88 295.35l135.9 180.45H272L174.16 344 76.63 475.8H0l135.89-180.43L5.07 121.36h77.04l92.09 125.3zm322.38-33.24H373.5v-24.13l2.42-6.43c5.46-6.29 60.35-69.48 60.35-69.63 2.94-3.38 5.44-6.34 7.48-8.87 2.24-2.78 4.34-5.51 6.29-8.17 1.95-2.65 3.64-5.09 5.08-7.31 1.49-2.29 2.77-4.43 3.84-6.39a63.99 63.99 0 0 0 2.69-5.53c.74-1.74 1.34-3.39 1.8-4.96.41-1.38.73-2.83.95-4.32.2-1.32.31-2.63.31-3.91 0-4.79-.59-8.86-1.77-12.22-1.05-3-2.61-5.55-4.66-7.63-.9-.89-1.97-1.73-3.2-2.49v-.05c-1.26-.77-2.64-1.42-4.14-1.94-1.76-.58-3.74-1.04-5.92-1.36-2.22-.33-4.72-.49-7.5-.49-2.98 0-5.62.19-7.92.56-2.26.37-4.37.92-6.29 1.64-1.75.66-3.37 1.49-4.84 2.46h-.04c-1.36.9-2.67 2.01-3.9 3.31-1.34 1.43-2.5 2.95-3.46 4.53a27.446 27.446 0 0 0-2.46 5.1c-.68 1.89-1.2 3.95-1.56 6.16-.34 2.15-.51 4.62-.51 7.39v15.42h-32.45l-2.48-8.39c-1.61-5.43-2.03-10.97-1.6-16.39.46-5.81 1.94-11.59 3.94-16.98 1.5-4.03 3.43-7.92 5.78-11.67v-.04c2.32-3.68 5-7.15 8.05-10.4 3.16-3.38 6.62-6.36 10.36-8.93 3.67-2.51 7.69-4.64 12.03-6.37a67.26 67.26 0 0 1 13.17-3.73v-.05C427.86.41 432.59 0 437.52 0c4.38 0 8.74.34 13.08 1.03 4.32.69 8.39 1.71 12.18 3.05 3.9 1.38 7.65 3.18 11.25 5.36h.04c3.51 2.13 6.78 4.63 9.79 7.46 3.11 2.9 5.85 6.14 8.23 9.69 2.39 3.58 4.35 7.37 5.87 11.34 1.47 3.86 2.58 8.02 3.33 12.45.72 4.33 1.09 8.8 1.09 13.39 0 3.11-.28 6.39-.84 9.83-.51 3.23-1.3 6.5-2.35 9.8-.94 3.08-2.2 6.27-3.74 9.55a92.644 92.644 0 0 1-5.12 9.43l-.05.09c-1.96 3.13-3.91 6.09-5.82 8.84-2.02 2.9-4.26 5.98-6.7 9.2-2.15 2.83-4.71 6.08-7.67 9.74-2.77 3.41-5.63 6.84-8.57 10.25l-30.3 35.42H512v37.5h-15.42z"}))};function ds(){return ds=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ds.apply(this,arguments)}const hs=function(t){return e.createElement("svg",ds({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 15a5 5 0 0 0 5-5c0-.833-.208-1.642-.583-2.333l1.216-1.217A6.61 6.61 0 0 1 16.667 10 6.666 6.666 0 0 1 10 16.667v2.5l-3.333-3.334L10 12.5V15Zm0-11.667v-2.5l3.333 3.334L10 7.5V5a5 5 0 0 0-5 5c0 .833.208 1.642.583 2.333L4.367 13.55A6.61 6.61 0 0 1 3.333 10 6.667 6.667 0 0 1 10 3.333Z"}))};function ps(){return ps=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ps.apply(this,arguments)}const fs=function(t){return e.createElement("svg",ps({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M15.833 15.833H4.167V4.167H12.5V2.5H4.167A1.66 1.66 0 0 0 2.5 4.167v11.666A1.666 1.666 0 0 0 4.167 17.5h11.666a1.666 1.666 0 0 0 1.667-1.667V9.167h-1.667v6.666ZM6.592 8.4 5.417 9.583l3.75 3.75L17.5 5l-1.175-1.183-7.158 7.158L6.592 8.4Z"}))};function gs(){return gs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gs.apply(this,arguments)}const ms=function(t){return e.createElement("svg",gs({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{clipRule:"evenodd",d:"M3.337 10.005a6.677 6.677 0 0 0 6.668 6.668 6.677 6.677 0 0 0 6.668-6.668 6.677 6.677 0 0 0-6.668-6.668 6.677 6.677 0 0 0-6.668 6.668Zm3.478-7.7a8.335 8.335 0 1 1 6.38 15.4 8.335 8.335 0 0 1-6.38-15.4ZM9.235 5.3h1.53l3.536 8.4h-1.267a.644.644 0 0 1-.389-.117.64.64 0 0 1-.22-.288l-.697-1.729H8.272l-.697 1.73a.673.673 0 0 1-.214.277l-.005.004a.64.64 0 0 1-.39.123H5.698l3.535-8.4Zm.764 1.981a4.697 4.697 0 0 1-.081.22L8.78 10.32h2.445l-1.142-2.826a4.692 4.692 0 0 1-.084-.212Z"}))};function ys(){return ys=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ys.apply(this,arguments)}const vs=function(t){return e.createElement("svg",ys({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m12.473 11.784-2.038-5.43c-.146-.37-.293-.839-.44-1.404-.07.28-.143.54-.22.78-.07.24-.14.455-.21.643l-2.028 5.411h4.936ZM16.5 17h-1.569a.686.686 0 0 1-.44-.137.766.766 0 0 1-.248-.35l-1.215-3.247H6.972l-1.214 3.246a.822.822 0 0 1-.25.342.68.68 0 0 1-.44.146H3.5L8.972 3h2.056L16.5 17Z"}))};function As(){return As=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},As.apply(this,arguments)}const bs=function(t){return e.createElement("svg",As({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M3.333 4.167h13.334v1.666H3.333V4.167Zm0 3.333h13.334v1.667H3.333V7.5Zm0 3.333h13.334V12.5H3.333v-1.667Zm0 3.334h8.334v1.666H3.333v-1.666Z"}))};function ws(){return ws=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ws.apply(this,arguments)}const Ss=function(t){return e.createElement("svg",ws({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M14.583 10a1.25 1.25 0 1 1 0-2.5 1.25 1.25 0 0 1 0 2.5Zm-2.5-3.333a1.25 1.25 0 1 1 0-2.5 1.25 1.25 0 0 1 0 2.5Zm-4.166 0a1.25 1.25 0 1 1 0-2.5 1.25 1.25 0 0 1 0 2.5ZM5.417 10a1.25 1.25 0 1 1 0-2.5 1.25 1.25 0 0 1 0 2.5ZM10 2.5a7.5 7.5 0 0 0 0 15 1.25 1.25 0 0 0 1.25-1.25c0-.325-.125-.617-.325-.833a1.25 1.25 0 0 1 .933-2.083h1.475A4.167 4.167 0 0 0 17.5 9.166C17.5 5.483 14.142 2.5 10 2.5Z"}))};function Cs(){return Cs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Cs.apply(this,arguments)}const Es=function(t){return e.createElement("svg",Cs({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 18a7.999 7.999 0 1 1 0-16c4.4 0 8 3.2 8 7.2a4.8 4.8 0 0 1-4.8 4.8h-1.44c-.24 0-.4.16-.4.4 0 .08.08.16.08.24.32.4.48.88.48 1.36.08 1.12-.8 2-1.92 2Zm0-14.4a6.4 6.4 0 1 0 0 12.8c.24 0 .4-.16.4-.4 0-.16-.08-.24-.08-.32-.32-.4-.48-.8-.48-1.28 0-1.12.88-2 2-2h1.36a3.2 3.2 0 0 0 3.2-3.2c0-3.12-2.88-5.6-6.4-5.6ZM5.6 8.4c.64 0 1.2.56 1.2 1.2 0 .64-.56 1.2-1.2 1.2-.64 0-1.2-.56-1.2-1.2 0-.64.56-1.2 1.2-1.2ZM8 5.2c.64 0 1.2.56 1.2 1.2 0 .64-.56 1.2-1.2 1.2-.64 0-1.2-.56-1.2-1.2 0-.64.56-1.2 1.2-1.2Zm4 0c.64 0 1.2.56 1.2 1.2 0 .64-.56 1.2-1.2 1.2-.64 0-1.2-.56-1.2-1.2 0-.64.56-1.2 1.2-1.2Zm2.4 3.2c.64 0 1.2.56 1.2 1.2 0 .64-.56 1.2-1.2 1.2-.64 0-1.2-.56-1.2-1.2 0-.64.56-1.2 1.2-1.2Z"}))};function Is(){return Is=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Is.apply(this,arguments)}const _s=function(t){return e.createElement("svg",Is({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 2a8 8 0 1 1 0 16 8 8 0 0 1 0-16Zm0 1.6a6.4 6.4 0 1 0 0 12.8 6.4 6.4 0 0 0 0-12.8Zm3.92 2.48c1.04.96 1.68 2.4 1.68 3.92s-.72 2.88-1.68 3.92-2.4 1.68-3.92 1.68-2.88-.64-3.92-1.68L10 10V4.4c1.52 0 2.96.64 3.92 1.68Z"}))};function xs(){return xs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xs.apply(this,arguments)}const Ps=function(t){return e.createElement("svg",xs({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M7.5 2.5v.833H3.333V5h.834v10.833A1.666 1.666 0 0 0 5.833 17.5h8.334a1.667 1.667 0 0 0 1.666-1.667V5h.834V3.333H12.5V2.5h-5Zm0 4.167h1.667v7.5H7.5v-7.5Zm3.333 0H12.5v7.5h-1.667v-7.5Z"}))};function ks(){return ks=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ks.apply(this,arguments)}const Bs=function(t){return e.createElement("svg",ks({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M7.5 2.5v.833H3.333V5h.834v10.833A1.666 1.666 0 0 0 5.833 17.5h8.334a1.667 1.667 0 0 0 1.666-1.667V5h.834V3.333H12.5V2.5h-5ZM5.833 5h8.334v10.833H5.833V5ZM7.5 6.667v7.5h1.667v-7.5H7.5Zm3.333 0v7.5H12.5v-7.5h-1.667Z"}))};function Os(){return Os=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Os.apply(this,arguments)}const Ns=function(t){return e.createElement("svg",Os({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M12.5 13.333h3.333V15H12.5v-1.667Zm0-6.666h5.833v1.666H12.5V6.667Zm0 3.333h5v1.667h-5V10Zm-10 5a1.667 1.667 0 0 0 1.667 1.667h5A1.667 1.667 0 0 0 10.833 15V6.667H2.5V15Zm9.167-10.833h-2.5l-.834-.834H5l-.833.834h-2.5v1.666h10V4.167Z"}))};function Ds(){return Ds=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ds.apply(this,arguments)}const js=function(t){return e.createElement("svg",Ds({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M12.5 13.333h3.333V15H12.5v-1.667Zm0-6.666h5.833v1.666H12.5V6.667Zm0 3.333h5v1.667h-5V10ZM9.167 8.333V15h-5V8.333h5Zm1.666-1.666H2.5V15a1.667 1.667 0 0 0 1.667 1.667h5A1.667 1.667 0 0 0 10.833 15V6.667Zm.834-2.5h-2.5l-.834-.834H5l-.833.834h-2.5v1.666h10V4.167Z"}))};function Ts(){return Ts=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ts.apply(this,arguments)}const Ms=function(t){return e.createElement("svg",Ts({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M2.5 14.167v1.666h5v-1.666h-5Zm0-10v1.666h8.333V4.167H2.5ZM10.833 17.5v-1.667H17.5v-1.666h-6.667V12.5H9.167v5h1.666Zm-5-10v1.667H2.5v1.666h3.333V12.5H7.5v-5H5.833ZM17.5 10.833V9.167H9.167v1.666H17.5Zm-5-3.333h1.667V5.833H17.5V4.167h-3.333V2.5H12.5v5Z"}))};function Fs(){return Fs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fs.apply(this,arguments)}const Rs=function(t){return e.createElement("svg",Fs({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{clipRule:"evenodd",d:"M12.333 12.333h3.111V4.556H4.556v7.777h3.11a2.333 2.333 0 1 0 4.667 0ZM4.556 3h10.888A1.556 1.556 0 0 1 17 4.556v10.888A1.556 1.556 0 0 1 15.444 17H4.556A1.556 1.556 0 0 1 3 15.444V4.556C3 3.7 3.692 3 4.556 3Zm3.888 5.917H6.89L10 5.806l3.111 3.11h-1.556v2.334h-3.11V8.917Z"}))};function Ls(){return Ls=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ls.apply(this,arguments)}const Qs=function(t){return e.createElement("svg",Ls({viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.332 12.708c-.392.16-.836.24-1.332.24-.496 0-.94-.08-1.332-.24a2.805 2.805 0 0 1-.995-.67 2.994 2.994 0 0 1-.623-1.04 4.062 4.062 0 0 1-.207-1.33V2.5H5v7.177c0 .694.115 1.335.346 1.924.23.59.562 1.099.995 1.528.432.43.957.765 1.574 1.008.617.242 1.312.363 2.085.363.773 0 1.468-.121 2.085-.363a4.575 4.575 0 0 0 1.574-1.008c.433-.43.764-.939.995-1.528.23-.589.346-1.23.346-1.924V2.5h-1.834v7.177c0 .484-.072.928-.216 1.33-.144.396-.352.74-.623 1.032-.271.286-.603.51-.995.669ZM15 16H5v1.5h10V16Z"}))};function Us(){return Us=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Us.apply(this,arguments)}const Vs=function(t){return e.createElement("svg",Us({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10.181 7.667A7.3 7.3 0 0 0 5.462 9.4L3 7v6h6.155L6.68 10.587a5.523 5.523 0 0 1 3.501-1.254c2.421 0 4.48 1.54 5.198 3.667L17 12.48c-.95-2.793-3.639-4.813-6.819-4.813Z"}))};function Ks(){return Ks=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ks.apply(this,arguments)}const Hs=function(t){return e.createElement("svg",Ks({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{clipRule:"evenodd",d:"M7 9.69 1.667 4.357l1.178-1.179L16.987 17.32 15.81 18.5l-5.209-5.21V17.5H9.4V13H4.5v-1.5L7 10v-.31Zm1.81 1.81H6.6l1.5-.71.71.71ZM11.5 4v5.476L15.024 13h.476v-1.5L13 10V4h.75V2.5h-7.5V4H7v.976l1.5 1.5V4h3Z"}))};function Gs(){return Gs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gs.apply(this,arguments)}const Ys=function(t){return e.createElement("svg",Gs({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M7 8.5v6h6v-6h4l-7-7-7 7h4Zm3-4.2 2.2 2.2H11v6H9v-6H7.8L10 4.3Zm7 12.2H3v2h14v-2Z"}))};function zs(){return zs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zs.apply(this,arguments)}const Zs=function(t){return e.createElement("svg",zs({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M12.5 3.333a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667Zm0 1.584a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5Zm-9.167.916v2.5h-2.5V10h2.5v2.5H5V10h2.5V8.333H5v-2.5H3.333Zm9.167 5c-2.225 0-6.667 1.109-6.667 3.334v2.5h13.334v-2.5c0-2.225-4.442-3.334-6.667-3.334Zm0 1.584c2.475 0 5.083 1.216 5.083 1.75v.916H7.417v-.916c0-.534 2.583-1.75 5.083-1.75Z"}))};function Ws(){return Ws=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ws.apply(this,arguments)}const qs=function(t){return e.createElement("svg",Ws({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 3a3.5 3.5 0 1 1 0 7 3.5 3.5 0 0 1 0-7Zm0 7.875c2.336 0 7 1.164 7 3.5V17H3v-2.625c0-2.336 4.664-3.5 7-3.5Z"}))};function Js(){return Js=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Js.apply(this,arguments)}const Xs=function(t){return e.createElement("svg",Js({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 3a3.5 3.5 0 1 1 0 7 3.5 3.5 0 0 1 0-7Zm0 1.75a1.75 1.75 0 1 0 0 3.5 1.75 1.75 0 0 0 0-3.5Zm0 6.125c2.336 0 7 1.164 7 3.5V17H3v-2.625c0-2.336 4.664-3.5 7-3.5Zm0 1.662c-2.599 0-5.338 1.278-5.338 1.838v.963h10.675v-.963c0-.56-2.738-1.838-5.337-1.838Z"}))};function $s(){return $s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$s.apply(this,arguments)}const ea=function(t){return e.createElement("svg",$s({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M15.833 17.5v-1.667H12.5v-1.666h3.333V12.5l2.5 2.5-2.5 2.5Zm-5-2.5c0 .592.125 1.158.35 1.667H1.667v-2.5c0-1.842 2.983-3.334 6.666-3.334.834 0 1.634.075 2.375.217a9.637 9.637 0 0 1 1.884.55 4.164 4.164 0 0 0-1.759 3.4Zm-7.5-.833V15h5.834c0-.867.191-1.692.533-2.433L8.333 12.5c-2.758 0-5 .75-5 1.667Zm5-10.834a3.333 3.333 0 1 1 0 6.667 3.333 3.333 0 0 1 0-6.667Zm0 1.667a1.667 1.667 0 1 0 0 3.333 1.667 1.667 0 0 0 0-3.333Z"}))};function ta(){return ta=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ta.apply(this,arguments)}const na=function(t){return e.createElement("svg",ta({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M2.5 4.167v11.666h15.833V4.167H2.5Zm1.667 1.666h12.5v3.334h-12.5V5.833Zm0 8.334v-3.334H7.5v3.334H4.167Zm5 0v-3.334h7.5v3.334h-7.5Z"}))};function ra(){return ra=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ra.apply(this,arguments)}const ia=function(t){return e.createElement("svg",ra({viewBox:"0 0 20 20",fill:"#fff",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10.833 10.834H9.167v-5h1.666v5Zm0 3.333H9.167V12.5h1.666v1.667ZM10 1.667a8.333 8.333 0 1 0 0 16.667 8.333 8.333 0 0 0 0-16.667Z",fill:"currentColor"}))};function oa(){return oa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oa.apply(this,arguments)}const sa=function(t){return e.createElement("svg",oa({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M3.333 3.333h13.334v13.334H3.333V3.333ZM5 6.667V15h10V6.667H5Z"}))};function aa(){return aa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},aa.apply(this,arguments)}const la=function(t){return e.createElement("svg",aa({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},t),e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M0 4.13v1.428a.5.5 0 0 0 .725.446l.886-.446.377-.19L2 5.362l1.404-.708.07-.036.662-.333.603-.304a.5.5 0 0 0 0-.893l-.603-.305-.662-.333-.07-.036L2 1.706l-.012-.005-.377-.19-.886-.447A.5.5 0 0 0 0 1.51v2.62ZM7.25 2a.75.75 0 0 0 0 1.5h7a.25.25 0 0 1 .25.25v8.5a.25.25 0 0 1-.25.25h-9.5a.25.25 0 0 1-.25-.25V6.754a.75.75 0 0 0-1.5 0v5.496c0 .966.784 1.75 1.75 1.75h9.5A1.75 1.75 0 0 0 16 12.25v-8.5A1.75 1.75 0 0 0 14.25 2h-7Zm-.5 4a.75.75 0 0 0 0 1.5h5.5a.75.75 0 0 0 0-1.5h-5.5ZM6 9.25a.75.75 0 0 1 .75-.75h3.5a.75.75 0 0 1 0 1.5h-3.5A.75.75 0 0 1 6 9.25Z",clipRule:"evenodd"}))};function ca(){return ca=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ca.apply(this,arguments)}const ua=function(t){return e.createElement("svg",ca({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},t),e.createElement("path",{fill:"currentColor",d:"M3 17v-2h14v2H3Zm0-4v-2h14v2H3Zm0-4V7h14v2H3Zm17 8q-.425 0-.713-.288T19 16q0-.425.288-.713T20 15q.425 0 .713.288T21 16q0 .425-.288.713T20 17Zm0-4q-.425 0-.713-.288T19 12q0-.425.288-.713T20 11q.425 0 .713.288T21 12q0 .425-.288.713T20 13Zm0-4q-.425 0-.713-.288T19 8q0-.425.288-.713T20 7q.425 0 .713.288T21 8q0 .425-.288.713T20 9Z"}))};function da(){return da=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},da.apply(this,arguments)}const ha=function(t){return e.createElement("svg",da({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-check-square"},t),e.createElement("path",{d:"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"}),e.createElement("path",{d:"M10.97 4.97a.75.75 0 0 1 1.071 1.05l-3.992 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425a.235.235 0 0 1 .02-.022z"}))};function pa(){return pa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pa.apply(this,arguments)}const fa=function(t){return e.createElement("svg",pa({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-code"},t),e.createElement("path",{d:"M5.854 4.854a.5.5 0 1 0-.708-.708l-3.5 3.5a.5.5 0 0 0 0 .708l3.5 3.5a.5.5 0 0 0 .708-.708L2.707 8l3.147-3.146zm4.292 0a.5.5 0 0 1 .708-.708l3.5 3.5a.5.5 0 0 1 0 .708l-3.5 3.5a.5.5 0 0 1-.708-.708L13.293 8l-3.147-3.146z"}))};function ga(){return ga=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ga.apply(this,arguments)}const ma=function(t){return e.createElement("svg",ga({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-file-break"},t),e.createElement("path",{d:"M0 10.5a.5.5 0 0 1 .5-.5h15a.5.5 0 0 1 0 1H.5a.5.5 0 0 1-.5-.5zM12 0H4a2 2 0 0 0-2 2v7h1V2a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v7h1V2a2 2 0 0 0-2-2zm2 12h-1v2a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-2H2v2a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-2z"}))};function ya(){return ya=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ya.apply(this,arguments)}const va=function(t){return e.createElement("svg",ya({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-link"},t),e.createElement("path",{d:"M6.354 5.5H4a3 3 0 0 0 0 6h3a3 3 0 0 0 2.83-4H9c-.086 0-.17.01-.25.031A2 2 0 0 1 7 10.5H4a2 2 0 1 1 0-4h1.535c.218-.376.495-.714.82-1z"}),e.createElement("path",{d:"M9 5.5a3 3 0 0 0-2.83 4h1.098A2 2 0 0 1 9 6.5h3a2 2 0 1 1 0 4h-1.535a4.02 4.02 0 0 1-.82 1H12a3 3 0 1 0 0-6H9z"}))};function Aa(){return Aa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Aa.apply(this,arguments)}const ba=function(t){return e.createElement("svg",Aa({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-list-ol"},t),e.createElement("path",{fillRule:"evenodd",d:"M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5z"}),e.createElement("path",{d:"M1.713 11.865v-.474H2c.217 0 .363-.137.363-.317 0-.185-.158-.31-.361-.31-.223 0-.367.152-.373.31h-.59c.016-.467.373-.787.986-.787.588-.002.954.291.957.703a.595.595 0 0 1-.492.594v.033a.615.615 0 0 1 .569.631c.003.533-.502.8-1.051.8-.656 0-1-.37-1.008-.794h.582c.008.178.186.306.422.309.254 0 .424-.145.422-.35-.002-.195-.155-.348-.414-.348h-.3zm-.004-4.699h-.604v-.035c0-.408.295-.844.958-.844.583 0 .96.326.96.756 0 .389-.257.617-.476.848l-.537.572v.03h1.054V9H1.143v-.395l.957-.99c.138-.142.293-.304.293-.508 0-.18-.147-.32-.342-.32a.33.33 0 0 0-.342.338v.041zM2.564 5h-.635V2.924h-.031l-.598.42v-.567l.629-.443h.635V5z"}))};function wa(){return wa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wa.apply(this,arguments)}const Sa=function(t){return e.createElement("svg",wa({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-list-ul"},t),e.createElement("path",{fillRule:"evenodd",d:"M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm-3 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm0 4a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm0 4a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"}))};function Ca(){return Ca=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ca.apply(this,arguments)}const Ea=function(t){return e.createElement("svg",Ca({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},t),e.createElement("path",{fill:"currentColor",d:"M9 22c-.6 0-1-.4-1-1v-3H4c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2h-6.1l-3.7 3.7c-.2.2-.4.3-.7.3H9m1-6v3.1l3.1-3.1H20V4H4v12h6m6.3-10-1.4 3H17v4h-4V8.8L14.3 6h2m-6 0L8.9 9H11v4H7V8.8L8.3 6h2Z"}))};function Ia(){return Ia=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ia.apply(this,arguments)}const _a=function(t){return e.createElement("svg",Ia({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},t),e.createElement("path",{fill:"currentColor",d:"M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2zm15 2h-4v3h4V4zm0 4h-4v3h4V8zm0 4h-4v3h3a1 1 0 0 0 1-1v-2zm-5 3v-3H6v3h4zm-5 0v-3H1v2a1 1 0 0 0 1 1h3zm-4-4h4V8H1v3zm0-4h4V4H1v3zm5-3v3h4V4H6zm4 4H6v3h4V8z"}))};function xa(){return xa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xa.apply(this,arguments)}const Pa=function(t){return e.createElement("svg",xa({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-text-center"},t),e.createElement("path",{fillRule:"evenodd",d:"M4 12.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"}))};function ka(){return ka=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ka.apply(this,arguments)}const Ba=function(t){return e.createElement("svg",ka({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-justify"},t),e.createElement("path",{fillRule:"evenodd",d:"M2 12.5a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"}))};function Oa(){return Oa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Oa.apply(this,arguments)}const Na=function(t){return e.createElement("svg",Oa({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-text-left"},t),e.createElement("path",{fillRule:"evenodd",d:"M2 12.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"}))};function Da(){return Da=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Da.apply(this,arguments)}const ja=function(t){return e.createElement("svg",Da({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-text-paragraph"},t),e.createElement("path",{fillRule:"evenodd",d:"M2 12.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm4-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5z"}))};function Ta(){return Ta=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ta.apply(this,arguments)}const Ma=function(t){return e.createElement("svg",Ta({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-text-right"},t),e.createElement("path",{fillRule:"evenodd",d:"M6 12.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-4-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm4-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-4-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"}))};function Fa(){return Fa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fa.apply(this,arguments)}const Ra=function(t){return e.createElement("svg",Fa({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},t),e.createElement("path",{fill:"currentColor",d:"M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23Z"}))};function La(){return La=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},La.apply(this,arguments)}const Qa=function(t){return e.createElement("svg",La({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},t),e.createElement("path",{fill:"currentColor",d:"m10 15 5.19-3L10 9v6m11.56-7.83c.13.47.22 1.1.28 1.9.07.8.1 1.49.1 2.09L22 12c0 2.19-.16 3.8-.44 4.83-.25.9-.83 1.48-1.73 1.73-.47.13-1.33.22-2.65.28-1.3.07-2.49.1-3.59.1L12 19c-4.19 0-6.8-.16-7.83-.44-.9-.25-1.48-.83-1.73-1.73-.13-.47-.22-1.1-.28-1.9-.07-.8-.1-1.49-.1-2.09L2 12c0-2.19.16-3.8.44-4.83.25-.9.83-1.48 1.73-1.73.47-.13 1.33-.22 2.65-.28 1.3-.07 2.49-.1 3.59-.1L12 5c4.19 0 6.8.16 7.83.44.9.25 1.48.83 1.73 1.73Z"}))};function Ua(){return Ua=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ua.apply(this,arguments)}const Va=function(t){return e.createElement("svg",Ua({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-type-bold"},t),e.createElement("path",{d:"M8.21 13c2.106 0 3.412-1.087 3.412-2.823 0-1.306-.984-2.283-2.324-2.386v-.055a2.176 2.176 0 0 0 1.852-2.14c0-1.51-1.162-2.46-3.014-2.46H3.843V13H8.21zM5.908 4.674h1.696c.963 0 1.517.451 1.517 1.244 0 .834-.629 1.32-1.73 1.32H5.908V4.673zm0 6.788V8.598h1.73c1.217 0 1.88.492 1.88 1.415 0 .943-.643 1.449-1.832 1.449H5.907z"}))};function Ka(){return Ka=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ka.apply(this,arguments)}const Ha=function(t){return e.createElement("svg",Ka({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},t),e.createElement("path",{fill:"currentColor",d:"M8.637 13V3.669H7.379V7.62H2.758V3.67H1.5V13h1.258V8.728h4.62V13h1.259zm5.329 0V3.669h-1.244L10.5 5.316v1.265l2.16-1.565h.062V13h1.244z"}))};function Ga(){return Ga=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ga.apply(this,arguments)}const Ya=function(t){return e.createElement("svg",Ga({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},t),e.createElement("path",{fill:"currentColor",d:"M7.638 13V3.669H6.38V7.62H1.759V3.67H.5V13h1.258V8.728h4.62V13h1.259zm3.022-6.733v-.048c0-.889.63-1.668 1.716-1.668.957 0 1.675.608 1.675 1.572 0 .855-.554 1.504-1.067 2.085l-3.513 3.999V13H15.5v-1.094h-4.245v-.075l2.481-2.844c.875-.998 1.586-1.784 1.586-2.953 0-1.463-1.155-2.556-2.919-2.556-1.941 0-2.966 1.326-2.966 2.74v.049h1.223z"}))};function za(){return za=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},za.apply(this,arguments)}const Za=function(t){return e.createElement("svg",za({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},t),e.createElement("path",{fill:"currentColor",d:"M7.637 13V3.669H6.379V7.62H1.758V3.67H.5V13h1.258V8.728h4.62V13h1.259zm3.625-4.272h1.018c1.142 0 1.935.67 1.949 1.674.013 1.005-.78 1.737-2.01 1.73-1.08-.007-1.853-.588-1.935-1.32H9.108c.069 1.327 1.224 2.386 3.083 2.386 1.935 0 3.343-1.155 3.309-2.789-.027-1.51-1.251-2.16-2.037-2.249v-.068c.704-.123 1.764-.91 1.723-2.229-.035-1.353-1.176-2.4-2.954-2.385-1.873.006-2.857 1.162-2.898 2.358h1.196c.062-.69.711-1.299 1.696-1.299.998 0 1.695.622 1.695 1.525.007.922-.718 1.592-1.695 1.592h-.964v1.074z"}))};function Wa(){return Wa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wa.apply(this,arguments)}const qa=function(t){return e.createElement("svg",Wa({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-type-h1"},t),e.createElement("path",{d:"M7.637 13V3.669H6.379V7.62H1.758V3.67H.5V13h1.258V8.728h4.62V13Zm5.337.2v-2.328H9.108V9.828l3.441-6.35h1.632v6.141H15.5v1.253h-1.319V13.2Zm-2.615-3.581h2.615V6.7L13 4.689l-.872 1.7z"}))};function Ja(){return Ja=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ja.apply(this,arguments)}const Xa=function(t){return e.createElement("svg",Ja({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-type-h1"},t),e.createElement("path",{d:"M7.637 13V3.669H6.379V7.62H1.758V3.67H.5V13h1.258V8.728h4.62V13Zm2.755-5.791a3.763 3.763 0 0 1 2.113-.517 2.973 2.973 0 0 1 2.995 3.1 3.45 3.45 0 0 1-.9 2.442 3.111 3.111 0 0 1-2.393.968 3.327 3.327 0 0 1-2.094-.671 2.758 2.758 0 0 1-1.007-2h1.284a1.387 1.387 0 0 0 .511 1.1 2.384 2.384 0 0 0 1.4.421 1.819 1.819 0 0 0 1.479-.638 2.042 2.042 0 0 0 .437-1.514 2.17 2.17 0 0 0-.567-1.584 1.958 1.958 0 0 0-1.468-.58 2.358 2.358 0 0 0-1.79.789H9.108V3.478h5.931v1.134h-4.647Z"}))};function $a(){return $a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$a.apply(this,arguments)}const el=function(t){return e.createElement("svg",$a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-type-h1"},t),e.createElement("path",{d:"M7.637 13V3.669H6.379V7.62H1.758V3.67H.5V13h1.258V8.728h4.62V13Zm5.039-6.13a2.823 2.823 0 0 1 1.419.364 2.69 2.69 0 0 1 1.022 1.05 3.327 3.327 0 0 1 .383 1.642 3.594 3.594 0 0 1-.39 1.7 2.878 2.878 0 0 1-1.1 1.158 3.165 3.165 0 0 1-1.635.416 2.812 2.812 0 0 1-1.734-.545A3.49 3.49 0 0 1 9.51 11.1a6.515 6.515 0 0 1-.4-2.411A7.726 7.726 0 0 1 9.542 6a4.289 4.289 0 0 1 1.233-1.851 2.831 2.831 0 0 1 1.889-.673A2.7 2.7 0 0 1 13.8 3.7a2.463 2.463 0 0 1 .812.586 2.886 2.886 0 0 1 .514.8 2.768 2.768 0 0 1 .223.861H14a1.488 1.488 0 0 0-.453-.923 1.346 1.346 0 0 0-.935-.329 1.509 1.509 0 0 0-1.072.425 2.839 2.839 0 0 0-.71 1.18 6.808 6.808 0 0 0-.323 1.771 2.639 2.639 0 0 1 .918-.889 2.48 2.48 0 0 1 1.251-.312Zm-.285 5.117a1.617 1.617 0 0 0 .91-.256 1.752 1.752 0 0 0 .614-.713 2.336 2.336 0 0 0 .223-1.037 2.211 2.211 0 0 0-.217-1.01 1.6 1.6 0 0 0-.6-.666 1.671 1.671 0 0 0-.892-.236 1.833 1.833 0 0 0-1.164.377 2.4 2.4 0 0 0-.743 1.009 3.749 3.749 0 0 0 .6 1.845 1.5 1.5 0 0 0 1.269.687Z"}))};function tl(){return tl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tl.apply(this,arguments)}const nl=function(t){return e.createElement("svg",tl({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-type-italic"},t),e.createElement("path",{d:"M7.991 11.674 9.53 4.455c.123-.595.246-.71 1.347-.807l.11-.52H7.211l-.11.52c1.06.096 1.128.212 1.005.807L6.57 11.674c-.123.595-.246.71-1.346.806l-.11.52h3.774l.11-.52c-1.06-.095-1.129-.211-1.006-.806z"}))};function rl(){return rl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rl.apply(this,arguments)}const il=function(t){return e.createElement("svg",rl({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-type-strikethrough"},t),e.createElement("path",{d:"M6.333 5.686c0 .31.083.581.27.814H5.166a2.776 2.776 0 0 1-.099-.76c0-1.627 1.436-2.768 3.48-2.768 1.969 0 3.39 1.175 3.445 2.85h-1.23c-.11-1.08-.964-1.743-2.25-1.743-1.23 0-2.18.602-2.18 1.607zm2.194 7.478c-2.153 0-3.589-1.107-3.705-2.81h1.23c.144 1.06 1.129 1.703 2.544 1.703 1.34 0 2.31-.705 2.31-1.675 0-.827-.547-1.374-1.914-1.675L8.046 8.5H1v-1h14v1h-3.504c.468.437.675.994.675 1.697 0 1.826-1.436 2.967-3.644 2.967z"}))};function ol(){return ol=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ol.apply(this,arguments)}const sl=function(t){return e.createElement("svg",ol({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M11.354 14.5v-.665l1.553-1.438c.132-.128.243-.243.332-.345.091-.102.16-.203.207-.3.047-.1.07-.207.07-.322a.574.574 0 0 0-.326-.546.748.748 0 0 0-.343-.077.721.721 0 0 0-.35.082.557.557 0 0 0-.23.232.753.753 0 0 0-.08.36h-.876c0-.286.065-.534.194-.744a1.3 1.3 0 0 1 .543-.488 1.8 1.8 0 0 1 .806-.172c.312 0 .584.055.816.166.233.11.414.261.543.456.13.194.194.418.194.669 0 .165-.033.327-.098.488-.064.16-.178.339-.343.535a7.918 7.918 0 0 1-.697.7l-.637.625v.03h1.832v.754h-3.11ZM5.04 4.273l1.92 3.196h.068l1.93-3.196h1.803L8.073 8.636 10.805 13H8.972L7.03 9.825h-.068L5.018 13H3.194l2.757-4.364-2.723-4.363H5.04Z",fill:"currentColor"}))};function al(){return al=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},al.apply(this,arguments)}const ll=function(t){return e.createElement("svg",al({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M11.354 6v-.665l1.553-1.438c.132-.128.243-.243.332-.345a1.31 1.31 0 0 0 .207-.3c.047-.1.07-.207.07-.322a.574.574 0 0 0-.326-.545.748.748 0 0 0-.343-.077.721.721 0 0 0-.35.08.557.557 0 0 0-.23.233.753.753 0 0 0-.08.36h-.876c0-.286.065-.534.194-.744a1.3 1.3 0 0 1 .543-.488 1.8 1.8 0 0 1 .806-.172c.312 0 .584.055.816.166.233.11.414.261.543.456.13.194.194.417.194.669 0 .165-.033.327-.098.488-.064.16-.178.339-.343.535a7.92 7.92 0 0 1-.697.7l-.637.625v.03h1.832V6h-3.11ZM5.04 4.273l1.92 3.196h.068l1.93-3.196h1.803L8.073 8.636 10.805 13H8.972L7.03 9.825h-.068L5.018 13H3.194l2.757-4.364-2.723-4.363H5.04Z",fill:"currentColor"}))};function cl(){return cl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cl.apply(this,arguments)}const ul=function(t){return e.createElement("svg",cl({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-type-underline"},t),e.createElement("path",{d:"M5.313 3.136h-1.23V9.54c0 2.105 1.47 3.623 3.917 3.623s3.917-1.518 3.917-3.623V3.136h-1.23v6.323c0 1.49-.978 2.57-2.687 2.57-1.709 0-2.687-1.08-2.687-2.57V3.136zM12.5 15h-9v-1h9v1z"}))};function dl(){return dl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dl.apply(this,arguments)}const hl=function(t){return e.createElement("svg",dl({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-pencil-fill"},t),e.createElement("path",{d:"M12.854.146a.5.5 0 0 0-.707 0L10.5 1.793 14.207 5.5l1.647-1.646a.5.5 0 0 0 0-.708l-3-3zm.646 6.061L9.793 2.5 3.293 9H3.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.207l6.5-6.5zm-7.468 7.468A.5.5 0 0 1 6 13.5V13h-.5a.5.5 0 0 1-.5-.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.5-.5V10h-.5a.499.499 0 0 1-.175-.032l-.179.178a.5.5 0 0 0-.11.168l-2 5a.5.5 0 0 0 .65.65l5-2a.5.5 0 0 0 .168-.11l.178-.178z"}))};function pl(){return pl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pl.apply(this,arguments)}const fl=function(t){return e.createElement("svg",pl({xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",viewBox:"0 0 24 24",fill:"currentColor"},t),e.createElement("path",{stroke:"currentColor",d:"M8.5 10a2 2 0 1 0 2 2 2 2 0 0 0-2-2Zm0 7a2 2 0 1 0 2 2 2 2 0 0 0-2-2Zm7-10a2 2 0 1 0-2-2 2 2 0 0 0 2 2Zm-7-4a2 2 0 1 0 2 2 2 2 0 0 0-2-2Zm7 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2Zm0-7a2 2 0 1 0 2 2 2 2 0 0 0-2-2Z"}))}})(),r})(),e.exports=t()},56974:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},15866:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},35376:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},76317:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentViewerEvent=void 0,function(e){e.FeatureStatusUpdated="FeatureStatusUpdated"}(n||(t.ComponentViewerEvent=n={}))},88076:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},68763:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.KeyboardModifier=void 0,function(e){e.Shift="Shift",e.Ctrl="Control",e.Meta="Meta"}(n||(t.KeyboardModifier=n={}))},75895:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},74601:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3668:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},42405:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FillItemContentSpecialized=t.FillItemContent=void 0;const r=n(71458),i=n(68716);function o(e){return e.references||(e.references=[]),e.appData||(e.appData={[r.DefaultAppDomain]:{}}),e.appData[r.DefaultAppDomain]||(e.appData[r.DefaultAppDomain]={}),e.appData[r.DefaultAppDomain][i.AppDataField.UserModifiedDate]||(e.appData[r.DefaultAppDomain][i.AppDataField.UserModifiedDate]=(new Date).toString()),e}t.FillItemContent=o,t.FillItemContentSpecialized=function(e){return o(e)}},95698:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},55930:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},36186:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},80537:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createComponentCreatedContextPayload=void 0,t.createComponentCreatedContextPayload=function(e){return{content_type:e.content_type,content:e.content,created_at:e.created_at,deleted:!1,uuid:e.uuid}}},1482:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreateComponentRetrievedContextPayload=void 0,t.CreateComponentRetrievedContextPayload=function(e){return{content_type:e.content_type,content:e.content,created_at:e.created_at,deleted:!1,uuid:e.uuid}}},69087:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},70359:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkRemotePayloadAllowed=t.FilterDisallowedRemotePayloadsAndMap=void 0;const r=n(78381);function i(e){return(0,r.isCorruptTransferPayload)(e)?{disallowed:e}:(0,r.isEncryptedTransferPayload)(e)||null==e.content?{allowed:e}:{disallowed:e}}t.FilterDisallowedRemotePayloadsAndMap=function(e){const t=[],n=[];for(const o of e){const e=i(o);void 0===e.allowed?n.push(o):t.push((r=e.allowed,Object.assign(Object.assign({},r),{__passed_filter__:!0})))}var r;return{filtered:t,disallowed:n}},t.checkRemotePayloadAllowed=i},13214:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreateDecryptedBackupFileContextPayload=t.CreateEncryptedBackupFileContextPayload=void 0,t.CreateEncryptedBackupFileContextPayload=function(e){return{auth_hash:e.auth_hash,content_type:e.content_type,content:e.content,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!1,duplicate_of:e.duplicate_of,enc_item_key:e.enc_item_key,items_key_id:e.items_key_id,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid}},t.CreateDecryptedBackupFileContextPayload=function(e){return{content_type:e.content_type,content:e.content,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!1,duplicate_of:e.duplicate_of,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid}}},84034:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreateDeletedLocalStorageContextPayload=t.CreateDecryptedLocalStorageContextPayload=t.CreateEncryptedLocalStorageContextPayload=t.isEncryptedLocalStoragePayload=void 0;const r=n(87901),i=n(78381);t.isEncryptedLocalStoragePayload=function(e){return(0,i.isEncryptedTransferPayload)(e)},t.CreateEncryptedLocalStorageContextPayload=function(e){return{auth_hash:e.auth_hash,content_type:e.content_type,content:e.content,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!1,dirty:null!=e.dirty&&e.dirty,duplicate_of:e.duplicate_of,enc_item_key:e.enc_item_key,errorDecrypting:e.errorDecrypting,items_key_id:e.items_key_id,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,waitingForKey:e.waitingForKey,user_uuid:e.user_uuid,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid,last_edited_by_uuid:e.last_edited_by_uuid,signatureData:e.signatureData}},t.CreateDecryptedLocalStorageContextPayload=function(e){return{content_type:e.content_type,content:e.content,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!1,duplicate_of:e.duplicate_of,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,dirty:(0,r.useBoolean)(e.dirty,!1),user_uuid:e.user_uuid,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid,last_edited_by_uuid:e.last_edited_by_uuid,signatureData:e.signatureData}},t.CreateDeletedLocalStorageContextPayload=function(e){return{content_type:e.content_type,content:void 0,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!0,dirty:!0,duplicate_of:e.duplicate_of,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,user_uuid:e.user_uuid,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid,last_edited_by_uuid:e.last_edited_by_uuid,signatureData:e.signatureData}}},51600:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreateOfflineSyncPushContextPayload=void 0;const r=n(59180);t.CreateOfflineSyncPushContextPayload=function(e){const t={content:void 0,content_type:e.content_type,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!1,duplicate_of:e.duplicate_of,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid};return(0,r.isDecryptedPayload)(e)?Object.assign(Object.assign({},t),{content:e.content}):Object.assign(Object.assign({},t),{deleted:e.deleted})}},30429:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreateOfflineSyncSavedPayload=void 0;const r=n(59180);t.CreateOfflineSyncSavedPayload=function(e){return{content_type:e.content_type,created_at_timestamp:e.created_at_timestamp,deleted:(0,r.isDeletedPayload)(e),updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid}}},18592:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreateDeletedServerSyncPushPayload=t.CreateEncryptedServerSyncPushPayload=void 0,t.CreateEncryptedServerSyncPushPayload=function(e){return{content_type:e.content_type,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!1,duplicate_of:e.duplicate_of,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,content:e.content,enc_item_key:e.enc_item_key,items_key_id:e.items_key_id,auth_hash:e.auth_hash,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid}},t.CreateDeletedServerSyncPushPayload=function(e){return{content_type:e.content_type,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!0,duplicate_of:e.duplicate_of,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,content:void 0,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid}}},2116:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreateServerSyncSavedPayload=void 0;const r=n(87901);t.CreateServerSyncSavedPayload=function(e){return{content_type:e.content_type,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:(0,r.useBoolean)(e.deleted,!1),updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid,user_uuid:e.user_uuid,duplicate_of:e.duplicate_of,last_edited_by_uuid:e.last_edited_by_uuid}}},18973:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7563:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43740:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DecryptedItem=void 0;const r=n(87901),i=n(68716),o=n(71458),s=n(97127),a=n(41035);class l extends s.GenericItem{constructor(e){super(e),this.protected=!1,this.trashed=!1,this.pinned=!1,this.archived=!1,this.locked=!1,this.starred=!1;const t=this.getAppDomainValueWithDefault(i.AppDataField.UserModifiedDate,this.serverUpdatedAt||0);this.userModifiedDate=new Date(t),this.conflictOf=e.content.conflict_of,this.updatedAtString=(0,r.dateToLocalizedString)(this.userModifiedDate),this.protected=(0,r.useBoolean)(this.payload.content.protected,!1),this.trashed=(0,r.useBoolean)(this.payload.content.trashed,!1),this.starred=(0,r.useBoolean)(this.payload.content.starred,!1),this.pinned=this.getAppDomainValueWithDefault(i.AppDataField.Pinned,!1),this.archived=this.getAppDomainValueWithDefault(i.AppDataField.Archived,!1),this.locked=this.getAppDomainValueWithDefault(i.AppDataField.Locked,!1)}static DefaultAppDomain(){return o.DefaultAppDomain}get content(){return this.payload.content}get references(){return this.payload.content.references||[]}isReferencingItem(e){return null!=this.references.find((t=>t.uuid===e.uuid))}getDomainData(e){const t=this.payload.content.appData;if(t)return t[e]}getAppDomainValue(e){const t=this.getDomainData(o.DefaultAppDomain);return null==t?void 0:t[e]}getAppDomainValueWithDefault(e,t){const n=this.getDomainData(o.DefaultAppDomain);return(null==n?void 0:n[e])||t}payloadRepresentation(e){return this.payload.copy(e)}contentKeysToIgnoreWhenCheckingEquality(){return["conflict_of"]}appDataContentKeysToIgnoreWhenCheckingEquality(){return[i.AppDataField.UserModifiedDate]}getContentCopy(){return JSON.parse(JSON.stringify(this.content))}isItemContentEqualWith(e){return(0,a.ItemContentsEqual)(this.payload.content,e.payload.content,this.contentKeysToIgnoreWhenCheckingEquality(),this.appDataContentKeysToIgnoreWhenCheckingEquality())}}t.DecryptedItem=l},78438:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeletedItem=void 0;const r=n(97127);class i extends r.GenericItem{constructor(e){super(e),this.deleted=!0}payloadRepresentation(e){return this.payload.copy(e)}}t.DeletedItem=i},80406:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EncryptedItem=void 0;const r=n(97127);class i extends r.GenericItem{constructor(e){super(e)}get version(){return this.payload.version}payloadRepresentation(e){return this.payload.copy(e)}get errorDecrypting(){return this.payload.errorDecrypting}get waitingForKey(){return this.payload.waitingForKey}get content(){return this.payload.content}get auth_hash(){return this.payload.auth_hash}}t.EncryptedItem=i},97127:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GenericItem=void 0;const r=n(87901),i=n(33545),o=n(89223),s=n(43610),a=n(94515),l=n(63418);t.GenericItem=class{constructor(e){this.payload=e,this.duplicateOf=e.duplicate_of,this.createdAtString=this.created_at&&(0,r.dateToLocalizedString)(this.created_at),this.userModifiedDate=this.serverUpdatedAt||new Date,this.updatedAtString=(0,r.dateToLocalizedString)(this.userModifiedDate),setTimeout((()=>{(0,r.deepFreeze)(this)}),0)}get uuid(){return this.payload.uuid}get content_type(){return this.payload.content_type}get created_at(){return this.payload.created_at}get key_system_identifier(){return this.payload.key_system_identifier}get user_uuid(){return this.payload.user_uuid}get shared_vault_uuid(){return this.payload.shared_vault_uuid}get last_edited_by_uuid(){return this.payload.last_edited_by_uuid}get signatureData(){return this.payload.signatureData}get serverUpdatedAt(){return this.payload.serverUpdatedAt}get serverUpdatedAtTimestamp(){return this.payload.updated_at_timestamp}get updated_at(){return this.serverUpdatedAt}get dirty(){return this.payload.dirty}get lastSyncBegan(){return this.payload.lastSyncBegan}get lastSyncEnd(){return this.payload.lastSyncEnd}get duplicate_of(){return this.payload.duplicate_of}payloadRepresentation(e){return this.payload.copy(e)}get neverSynced(){return!this.serverUpdatedAt||0===this.serverUpdatedAt.getTime()}get isSingleton(){return!1}singletonPredicate(){throw"Must override SNItem.singletonPredicate"}get singletonStrategy(){return a.SingletonStrategy.KeepEarliest}strategyWhenConflictingWithItem(e,t){if((0,l.isEncryptedErroredItem)(this))return s.ConflictStrategy.KeepBaseDuplicateApply;if(this.isSingleton)return s.ConflictStrategy.KeepBase;if((0,l.isDeletedItem)(this))return s.ConflictStrategy.KeepApply;if((0,l.isDeletedItem)(e))return this.payload.source===o.PayloadSource.FileImport?s.ConflictStrategy.KeepBase:s.ConflictStrategy.KeepApply;if(!(0,l.isDecryptedItem)(e)||!(0,l.isDecryptedItem)(this))return s.ConflictStrategy.KeepBaseDuplicateApply;if(!(0,i.ItemContentsDiffer)(this,e))return s.ConflictStrategy.KeepApply;if((0,i.ItemContentsDiffer)(this,e,["references"])){if(t&&!(0,i.ItemContentsDiffer)(t.itemFromPayload(),e))return s.ConflictStrategy.KeepBase;const n=2e4;return e.payload.source===o.PayloadSource.FileImport||Date.now()-this.userModifiedDate.getTime()<n?s.ConflictStrategy.KeepBaseDuplicateApply:s.ConflictStrategy.DuplicateBaseKeepApply}return s.ConflictStrategy.KeepBaseMergeRefs}satisfiesPredicate(e){return e.matchesItem(this)}}},81667:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},91251:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},89169:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},12421:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},63418:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEncryptedErroredItem=t.isDecryptedOrDeletedItem=t.isDeletedItem=t.isNotEncryptedItem=t.isEncryptedItem=t.isDecryptedItem=void 0;const r=n(13566);function i(e){return"payload"in e&&(0,r.isDecryptedPayload)(e.payload)}function o(e){return(0,r.isEncryptedPayload)(e.payload)}function s(e){return(0,r.isDeletedPayload)(e.payload)}t.isDecryptedItem=i,t.isEncryptedItem=o,t.isNotEncryptedItem=function(e){return!o(e)},t.isDeletedItem=s,t.isDecryptedOrDeletedItem=function(e){return i(e)||s(e)},t.isEncryptedErroredItem=function(e){return o(e)&&!0===e.errorDecrypting}},589:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},14584:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DecryptedItemMutator=void 0;const r=n(87901),i=n(4250),o=n(68716),s=n(71458),a=n(56634),l=n(13743);class c extends a.ItemMutator{constructor(e,t){super(e,t);const n=(0,r.Copy)(this.immutablePayload.content);this.mutableContent=n}getResult(){return this.type===i.MutationType.NonDirtying?this.immutablePayload.copy({content:this.mutableContent}):(this.type===i.MutationType.UpdateUserTimestamps?this.userModifiedDate=new Date:this.immutableItem.userModifiedDate||(this.userModifiedDate=new Date(this.immutableItem.serverUpdatedAt)),this.immutablePayload.copy({content:this.mutableContent,dirty:!0,dirtyIndex:(0,l.getIncrementedDirtyIndex)(),signatureData:void 0,last_edited_by_uuid:void 0}))}setBeginSync(e,t){this.immutablePayload=this.immutablePayload.copy({content:this.mutableContent,lastSyncBegan:e,globalDirtyIndexAtLastSync:t})}setCustomContent(e){this.mutableContent=(0,r.Copy)(e)}set userModifiedDate(e){this.setAppDataItem(o.AppDataField.UserModifiedDate,e)}set conflictOf(e){this.mutableContent.conflict_of=e}set protected(e){this.mutableContent.protected=e}set trashed(e){this.mutableContent.trashed=e}set starred(e){this.mutableContent.starred=e}set pinned(e){this.setAppDataItem(o.AppDataField.Pinned,e)}set archived(e){this.setAppDataItem(o.AppDataField.Archived,e)}set locked(e){this.setAppDataItem(o.AppDataField.Locked,e)}setDomainData(e,t){this.mutableContent.appData||(this.mutableContent.appData={[s.DefaultAppDomain]:{}}),this.mutableContent.appData[t]=e}setDomainDataKey(e,t,n){this.mutableContent.appData||(this.mutableContent.appData={[s.DefaultAppDomain]:{}}),this.mutableContent.appData[n]||(this.mutableContent.appData[n]={}),this.mutableContent.appData[n][e]=t}setAppDataItem(e,t){this.setDomainDataKey(e,t,s.DefaultAppDomain)}e2ePendingRefactor_addItemAsRelationship(e){const t=this.mutableContent.references||[];t.find((t=>t.uuid===e.uuid))||t.push({uuid:e.uuid,content_type:e.content_type}),this.mutableContent.references=t}removeItemAsRelationship(e){let t=this.mutableContent.references||[];t=t.filter((t=>t.uuid!==e.uuid)),this.mutableContent.references=t}}t.DecryptedItemMutator=c},94220:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeleteItemMutator=void 0;const r=n(452),i=n(56634),o=n(4250),s=n(13743);class a extends i.ItemMutator{getDeletedResult(){const e=this.type!==o.MutationType.NonDirtying;return new r.DeletedPayload(Object.assign(Object.assign({},this.immutablePayload.ejected()),{deleted:!0,content:void 0,dirty:!!e||this.immutablePayload.dirty,dirtyIndex:e?(0,s.getIncrementedDirtyIndex)():this.immutablePayload.dirtyIndex}),this.immutablePayload.source)}getResult(){throw Error("Must use getDeletedResult")}}t.DeleteItemMutator=a},56634:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ItemMutator=void 0;const r=n(4250),i=n(13743),o=n(21662);t.ItemMutator=class{constructor(e,t){this.immutableItem=e,this.type=t,this.immutablePayload=e.payload}getUuid(){return this.immutablePayload.uuid}getItem(){return this.immutableItem}getResult(){return this.type===r.MutationType.NonDirtying?this.immutablePayload.copy():this.immutablePayload.copy({dirty:!0,dirtyIndex:(0,i.getIncrementedDirtyIndex)()})}setBeginSync(e,t){this.immutablePayload=this.immutablePayload.copy({lastSyncBegan:e,globalDirtyIndexAtLastSync:t})}set key_system_identifier(e){if((0,o.ContentTypeUsesRootKeyEncryption)(this.immutableItem.content_type))throw new Error("Cannot set key_system_identifier on a root key encrypted item");this.immutablePayload=this.immutablePayload.copy({key_system_identifier:e})}set shared_vault_uuid(e){if((0,o.ContentTypeUsesRootKeyEncryption)(this.immutableItem.content_type))throw new Error("Cannot set shared_vault_uuid on a root key encrypted item");this.immutablePayload=this.immutablePayload.copy({shared_vault_uuid:e})}set errorDecrypting(e){throw Error("This method is no longer implemented")}set updated_at(e){throw Error("This method is no longer implemented")}set updated_at_timestamp(e){throw Error("This method is no longer implemented")}}},8898:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},68716:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.AppDataField=void 0,function(e){e.Pinned="pinned",e.Archived="archived",e.Locked="locked",e.UserModifiedDate="client_updated_at",e.DefaultEditor="defaultEditor",e.MobileRules="mobileRules",e.NotAvailableOnMobile="notAvailableOnMobile",e.MobileActive="mobileActive",e.LastSize="lastSize",e.LegacyPrefersPlainEditor="prefersPlainEditor",e.ComponentInstallError="installError"}(n||(t.AppDataField=n={}))},43610:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ConflictStrategy=void 0,function(e){e[e.KeepBase=1]="KeepBase",e[e.KeepApply=2]="KeepApply",e[e.KeepBaseDuplicateApply=3]="KeepBaseDuplicateApply",e[e.DuplicateBaseKeepApply=4]="DuplicateBaseKeepApply",e[e.KeepBaseMergeRefs=5]="KeepBaseMergeRefs"}(n||(t.ConflictStrategy=n={}))},71458:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentDataDomain=t.DefaultAppDomain=void 0,t.DefaultAppDomain="org.standardnotes.sn",t.ComponentDataDomain="org.standardnotes.sn.components"},15579:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},91298:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4250:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MutationType=void 0,function(e){e[e.UpdateUserTimestamps=1]="UpdateUserTimestamps",e[e.NoUpdateUserTimestamps=2]="NoUpdateUserTimestamps",e[e.NonDirtying=3]="NonDirtying"}(n||(t.MutationType=n={}))},94515:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SingletonStrategy=void 0,function(e){e[e.KeepEarliest=1]="KeepEarliest"}(n||(t.SingletonStrategy=n={}))},50292:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(89661),t),i(n(78961),t),i(n(2445),t),i(n(64236),t),i(n(4744),t),i(n(27542),t),i(n(96933),t),i(n(77533),t),i(n(80421),t),i(n(43740),t),i(n(43740),t),i(n(78438),t),i(n(80406),t),i(n(97127),t),i(n(81667),t),i(n(91251),t),i(n(89169),t),i(n(12421),t),i(n(63418),t),i(n(589),t),i(n(14584),t),i(n(94220),t),i(n(56634),t),i(n(8898),t),i(n(68716),t),i(n(43610),t),i(n(71458),t),i(n(15579),t),i(n(91298),t),i(n(4250),t),i(n(94515),t)},89262:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DecryptedPayload=void 0;const r=n(87901),i=n(42405),o=n(89223),s=n(33264);class a extends s.PurePayload{constructor(e,t=o.PayloadSource.Constructor){super(e,t),this.content=(0,r.Copy)((0,i.FillItemContent)(e.content)),this.deleted=!1}get references(){return this.content.references||[]}getReference(e){const t=this.references.find((t=>t.uuid===e));if(!t)throw new Error("Reference not found");return t}ejected(){return Object.assign(Object.assign({},super.ejected()),{content:this.content,deleted:this.deleted})}copy(e,t=this.source){return new a(Object.assign(Object.assign({},this.ejected()),e),t)}copyAsSyncResolved(e,t=this.source){return new a(Object.assign(Object.assign({},this.ejected()),e),t)}}t.DecryptedPayload=a},452:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeletedPayload=void 0;const r=n(89223),i=n(33264);class o extends i.PurePayload{constructor(e,t=r.PayloadSource.Constructor){super(e,t),this.deleted=!0,this.content=void 0}get discardable(){return!this.dirty}ejected(){return Object.assign(Object.assign({},super.ejected()),{deleted:this.deleted,content:void 0})}copy(e,t=this.source){return new o(Object.assign(Object.assign({},this.ejected()),e),t)}copyAsSyncResolved(e,t=this.source){return new o(Object.assign(Object.assign({},this.ejected()),e),t)}}t.DeletedPayload=o},86731:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EncryptedPayload=void 0;const r=n(80910),i=n(89223),o=n(33264);class s extends o.PurePayload{constructor(e,t=i.PayloadSource.Constructor){super(e,t);const n=(0,r.ProtocolVersionFromEncryptedString)(e.content);if(n.isFailed())throw new Error("EncryptedPayload constructor versionResult is failed");this.auth_hash=e.auth_hash,this.content=e.content,this.deleted=!1,this.enc_item_key=e.enc_item_key,this.errorDecrypting=e.errorDecrypting,this.items_key_id=e.items_key_id,this.version=n.getValue(),this.waitingForKey=e.waitingForKey}ejected(){return Object.assign(Object.assign({},super.ejected()),{enc_item_key:this.enc_item_key,items_key_id:this.items_key_id,auth_hash:this.auth_hash,errorDecrypting:this.errorDecrypting,waitingForKey:this.waitingForKey,content:this.content,deleted:this.deleted})}copy(e,t=this.source){return new s(Object.assign(Object.assign({},this.ejected()),e),t)}copyAsSyncResolved(e,t=this.source){return new s(Object.assign(Object.assign({},this.ejected()),e),t)}}t.EncryptedPayload=s},33264:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PurePayload=void 0;const r=n(87901),i=n(89223),o=n(21662);t.PurePayload=class{constructor(e,t=i.PayloadSource.Constructor){var n,s,a,l;if(!e.uuid)throw Error(`Attempting to construct payload with null uuid\n        Content type: ${e.content_type}`);if(e.key_system_identifier&&(0,o.ContentTypeUsesRootKeyEncryption)(e.content_type))throw new Error("Rootkey-encrypted payload should not have a key system identifier");this.source=t,this.uuid=e.uuid,this.content=e.content,this.content_type=e.content_type,this.deleted=(0,r.useBoolean)(e.deleted,!1),this.dirty=e.dirty,this.duplicate_of=e.duplicate_of,this.updated_at=new Date(e.updated_at||0),this.updated_at_timestamp=e.updated_at_timestamp||0,this.updated_at_timestamp<0&&(this.updated_at_timestamp=0,this.updated_at=new Date(0)),this.created_at=new Date(e.created_at||new Date),this.created_at_timestamp=e.created_at_timestamp||0,this.created_at_timestamp<0&&(this.created_at_timestamp=this.updated_at_timestamp,this.created_at=this.updated_at),this.lastSyncBegan=e.lastSyncBegan?new Date(e.lastSyncBegan):void 0,this.lastSyncEnd=e.lastSyncEnd?new Date(e.lastSyncEnd):void 0,this.dirtyIndex=e.dirtyIndex,this.globalDirtyIndexAtLastSync=e.globalDirtyIndexAtLastSync,this.user_uuid=null!==(n=e.user_uuid)&&void 0!==n?n:void 0,this.key_system_identifier=null!==(s=e.key_system_identifier)&&void 0!==s?s:void 0,this.shared_vault_uuid=null!==(a=e.shared_vault_uuid)&&void 0!==a?a:void 0,this.last_edited_by_uuid=null!==(l=e.last_edited_by_uuid)&&void 0!==l?l:void 0,this.signatureData=e.signatureData,setTimeout((()=>{(0,r.deepFreeze)(this)}),0)}ejected(){return{uuid:this.uuid,content:this.content,deleted:this.deleted,content_type:this.content_type,created_at:this.created_at,updated_at:this.updated_at,created_at_timestamp:this.created_at_timestamp,updated_at_timestamp:this.updated_at_timestamp,dirty:this.dirty,duplicate_of:this.duplicate_of,dirtyIndex:this.dirtyIndex,globalDirtyIndexAtLastSync:this.globalDirtyIndexAtLastSync,lastSyncBegan:this.lastSyncBegan,lastSyncEnd:this.lastSyncEnd,key_system_identifier:this.key_system_identifier,user_uuid:this.user_uuid,shared_vault_uuid:this.shared_vault_uuid,last_edited_by_uuid:this.last_edited_by_uuid,signatureData:this.signatureData}}get serverUpdatedAt(){return this.updated_at}get serverUpdatedAtTimestamp(){return this.updated_at_timestamp}}},83732:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},75310:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3008:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},59296:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},13566:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isErrorDecryptingPayload=t.isDeletedPayload=t.isEncryptedPayload=t.isDecryptedPayload=void 0;const r=n(78381);t.isDecryptedPayload=function(e){return(0,r.isDecryptedTransferPayload)(e)},t.isEncryptedPayload=function(e){return(0,r.isEncryptedTransferPayload)(e)},t.isDeletedPayload=function(e){return(0,r.isDeletedTransferPayload)(e)},t.isErrorDecryptingPayload=function(e){return(0,r.isErrorDecryptingTransferPayload)(e)}},92238:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},55340:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadTimestampDefaults=void 0,t.PayloadTimestampDefaults=function(){return{updated_at:new Date(0),created_at:new Date,updated_at_timestamp:0,created_at_timestamp:0}}},21989:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadVaultOverrides=void 0,t.PayloadVaultOverrides=function(e){return e?{key_system_identifier:e.systemIdentifier,shared_vault_uuid:e.isSharedVaultListing()?e.sharing.sharedVaultUuid:void 0}:{}}},62935:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.isPayloadSourceRetrieved=t.isPayloadSourceInternalChange=t.PayloadEmitSource=void 0,function(e){e[e.InitialObserverRegistrationPush=1]="InitialObserverRegistrationPush",e[e.LocalChanged=2]="LocalChanged",e[e.LocalInserted=3]="LocalInserted",e[e.LocalDatabaseLoaded=4]="LocalDatabaseLoaded",e[e.OfflineSyncSaved=5]="OfflineSyncSaved",e[e.LocalRetrieved=6]="LocalRetrieved",e[e.FileImport=7]="FileImport",e[e.ComponentRetrieved=8]="ComponentRetrieved",e[e.ComponentCreated=9]="ComponentCreated",e[e.PreSyncSave=10]="PreSyncSave",e[e.RemoteRetrieved=11]="RemoteRetrieved",e[e.RemoteSaved=12]="RemoteSaved",e[e.DesktopComponentSync=13]="DesktopComponentSync"}(n||(t.PayloadEmitSource=n={})),t.isPayloadSourceInternalChange=function(e){return[n.RemoteSaved,n.PreSyncSave].includes(e)},t.isPayloadSourceRetrieved=function(e){return[n.RemoteRetrieved,n.ComponentRetrieved].includes(e)}},89223:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadSource=void 0,function(e){e[e.Constructor=1]="Constructor",e[e.LocalDatabaseLoaded=2]="LocalDatabaseLoaded",e[e.RemoteRetrieved=3]="RemoteRetrieved",e[e.RemoteSaved=4]="RemoteSaved",e[e.FileImport=5]="FileImport"}(n||(t.PayloadSource=n={}))},59180:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(33264),t),i(n(89262),t),i(n(86731),t),i(n(452),t),i(n(83732),t),i(n(75310),t),i(n(3008),t),i(n(59296),t),i(n(13566),t),i(n(92238),t),i(n(89223),t),i(n(62935),t),i(n(55340),t),i(n(21989),t)},89661:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2445:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},78961:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ContentReferenceType=void 0,function(e){e.TagToParentTag="TagToParentTag",e.TagToFile="TagToFile",e.FileToNote="FileToNote",e.FileToFile="FileToFile",e.NoteToNote="NoteToNote"}(n||(t.ContentReferenceType=n={}))},64236:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4744:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isTagToParentTagReference=t.isLegacyTagToNoteReference=t.isReference=t.isLegacyAnonymousReference=void 0;const r=n(82648),i=n(78961);t.isLegacyAnonymousReference=e=>void 0===e.reference_type,t.isReference=e=>void 0!==e.reference_type,t.isLegacyTagToNoteReference=(e,t)=>{const n=e.content_type===r.ContentType.TYPES.Note,i=t.content_type===r.ContentType.TYPES.Tag;return n&&i},t.isTagToParentTagReference=e=>(0,t.isReference)(e)&&e.reference_type===i.ContentReferenceType.TagToParentTag},27542:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},96933:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},77533:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},80421:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},69421:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},57978:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},95520:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7834:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},49762:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isCorruptTransferPayload=t.isDeletedTransferPayload=t.isErrorDecryptingTransferPayload=t.isEncryptedTransferPayload=t.isDecryptedTransferPayload=void 0;const r=n(82648),i=n(87901);function o(e){return"content"in e&&(0,i.isString)(e.content)}t.isDecryptedTransferPayload=function(e){return(0,i.isObject)(e.content)},t.isEncryptedTransferPayload=o,t.isErrorDecryptingTransferPayload=function(e){return o(e)&&!0===e.errorDecrypting},t.isDeletedTransferPayload=function(e){return"deleted"in e&&!0===e.deleted},t.isCorruptTransferPayload=function(e){const t=!0===e.deleted&&null!=e.content,n=r.ContentType.create(e.content_type);return null==e.uuid||t||n.isFailed()}},78381:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(69421),t),i(n(57978),t),i(n(95520),t),i(n(7834),t),i(n(49762),t)},21907:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},66675:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.InvitationStatus=void 0,function(e){e.Sent="sent",e.Canceled="canceled",e.Accepted="accepted",e.Declined="declined"}(n||(t.InvitationStatus=n={}))},90656:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.InviteeIdentifierType=void 0,function(e){e.Email="email",e.Hash="hash",e.Uuid="uuid"}(n||(t.InviteeIdentifierType=n={}))},93715:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.InviterIdentifierType=void 0,function(e){e.Email="email",e.Uuid="uuid"}(n||(t.InviterIdentifierType=n={}))},84457:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Environment=void 0,function(e){e[e.Web=1]="Web",e[e.Desktop=2]="Desktop",e[e.Mobile=3]="Mobile",e[e.Clipper=4]="Clipper"}(n||(t.Environment=n={}))},656:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Platform=void 0,function(e){e[e.Ios=1]="Ios",e[e.Android=2]="Android",e[e.MacWeb=3]="MacWeb",e[e.MacDesktop=4]="MacDesktop",e[e.WindowsWeb=5]="WindowsWeb",e[e.WindowsDesktop=6]="WindowsDesktop",e[e.LinuxWeb=7]="LinuxWeb",e[e.LinuxDesktop=8]="LinuxDesktop"}(n||(t.Platform=n={}))},255:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},62846:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.KeySystemPasswordType=void 0,function(e){e.UserInputted="user_inputted",e.Randomized="randomized"}(n||(t.KeySystemPasswordType=n={}))},29899:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},22296:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},52174:(e,t)=>{"use strict";var n;function r(e,t){return Number(e)-Number(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.isVersionLessThanOrEqualTo=t.leftVersionGreaterThanOrEqualToRight=t.compareVersions=t.ProtocolVersionLength=t.isProtocolVersionExpired=t.ProtocolExpirationDates=t.ProtocolVersionLastNonrootItemsKey=t.ProtocolVersionLatest=t.ProtocolVersion=void 0,function(e){e.V001="001",e.V002="002",e.V003="003",e.V004="004"}(n||(t.ProtocolVersion=n={})),t.ProtocolVersionLatest=n.V004,t.ProtocolVersionLastNonrootItemsKey=n.V003,t.ProtocolExpirationDates=Object.freeze({[n.V001]:Date.parse("2018-01-01"),[n.V002]:Date.parse("2020-01-01")}),t.isProtocolVersionExpired=function(e){const n=t.ProtocolExpirationDates[e];return!!n&&(new Date).getTime()>n},t.ProtocolVersionLength=3,t.compareVersions=r,t.leftVersionGreaterThanOrEqualToRight=function(e,t){return r(e,t)>=0},t.isVersionLessThanOrEqualTo=function(e,t){return r(e,t)<=0}},80910:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolVersionFromEncryptedString=void 0;const r=n(82648),i=n(52174);t.ProtocolVersionFromEncryptedString=function(e){try{const t=e.substring(0,i.ProtocolVersionLength);if(Object.values(i.ProtocolVersion).includes(t))return r.Result.ok(t)}catch(e){return r.Result.fail(JSON.stringify(e))}return r.Result.fail(`Invalid encrypted string ${e}`)}},87192:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},71109:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},32099:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},55430:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},33738:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},64130:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.AsymmetricMessagePayloadType=void 0,function(e){e.ContactShare="contact-share",e.SharedVaultRootKeyChanged="shared-vault-root-key-changed",e.SenderKeypairChanged="sender-keypair-changed",e.SharedVaultMetadataChanged="shared-vault-metadata-changed",e.SharedVaultInvite="shared-vault-invite"}(n||(t.AsymmetricMessagePayloadType=n={}))},18018:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},14770:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},45698:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},63070:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},32151:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},71165:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Collection=void 0;const r=n(87901),i=n(76635);t.Collection=class{constructor(e=!1,t,n,i,o){this.map={},this.typedMap={},this.dirtyIndex=new Set,this.nondeletedIndex=new Set,this.invalidsIndex=new Set,this.isDecryptedElement=e=>(0,r.isObject)(e.content),this.isEncryptedElement=e=>"content"in e&&(0,r.isString)(e.content),this.isErrorDecryptingElement=e=>this.isEncryptedElement(e),this.isDeletedElement=e=>"deleted"in e&&!0===e.deleted,this.isNonDeletedElement=e=>!this.isDeletedElement(e),e?(this.map=t,this.typedMap=n,this.referenceMap=i,this.conflictMap=o):(this.referenceMap=new r.UuidMap,this.conflictMap=new r.UuidMap)}uuids(){return Object.keys(this.map)}all(e){var t;if(e){if(Array.isArray(e)){const t=[];for(const n of e)(0,r.extendArray)(t,this.typedMap[n]||[]);return t}return(null===(t=this.typedMap[e])||void 0===t?void 0:t.slice())||[]}return Object.keys(this.map).map((e=>this.map[e]))}nondeletedElements(){const e=Array.from(this.nondeletedIndex);return this.findAll(e).filter(this.isNonDeletedElement)}invalidElements(){const e=Array.from(this.invalidsIndex);return this.findAll(e)}dirtyElements(){const e=Array.from(this.dirtyIndex);return this.findAll(e)}findAll(e){const t=[];for(const n of e){const e=this.map[n];e&&t.push(e)}return t}find(e){return this.map[e]}has(e){return null!=this.find(e)}findAllIncludingBlanks(e){const t=[];for(const n of e){const e=this.map[n];t.push(e)}return t}set(e){if(0!==(e=Array.isArray(e)?e:[e]).length)for(const t of e){if(this.map[t.uuid]=t,this.setToTypedMap(t),this.isErrorDecryptingElement(t)?this.invalidsIndex.add(t.uuid):this.invalidsIndex.delete(t.uuid),this.isDecryptedElement(t)){const e=t.content.conflict_of;e&&!t.content.trashed&&this.conflictMap.establishRelationship(e,t.uuid);const n=e&&t.content.trashed,r=!e&&this.conflictMap.getInverseRelationships(t.uuid).length>0,i=this.conflictMap.existsInDirectMap(t.uuid)&&0===this.conflictMap.getDirectRelationships(t.uuid).length;(r||i||n)&&this.conflictMap.removeFromMap(t.uuid),this.referenceMap.setAllRelationships(t.uuid,t.references.map((e=>e.uuid)))}t.dirty?this.dirtyIndex.add(t.uuid):this.dirtyIndex.delete(t.uuid),t.deleted?(this.nondeletedIndex.delete(t.uuid),(this.conflictMap.existsInDirectMap(t.uuid)||this.conflictMap.existsInInverseMap(t.uuid))&&this.conflictMap.removeFromMap(t.uuid)):this.nondeletedIndex.add(t.uuid)}else console.warn("Attempting to set 0 elements onto collection")}discard(e){e=Array.isArray(e)?e:[e];for(const t of e)this.deleteFromTypedMap(t),delete this.map[t.uuid],this.conflictMap.removeFromMap(t.uuid),this.referenceMap.removeFromMap(t.uuid)}uuidReferencesForUuid(e){return this.referenceMap.getDirectRelationships(e)}uuidsThatReferenceUuid(e){return this.referenceMap.getInverseRelationships(e)}referencesForElement(e){const t=this.referenceMap.getDirectRelationships(e.uuid);return this.findAll(t)}conflictsOf(e){const t=this.conflictMap.getDirectRelationships(e);return this.findAll(t)}elementsReferencingElement(e,t){const n=this.uuidsThatReferenceUuid(e.uuid),r=this.findAll(n);return t?r.filter((e=>e.content_type===t)):r}setToTypedMap(e){const t=this.typedMap[e.content_type]||[];(0,i.remove)(t,{uuid:e.uuid}),t.push(e),this.typedMap[e.content_type]=t}deleteFromTypedMap(e){const t=this.typedMap[e.content_type]||[];(0,i.remove)(t,{uuid:e.uuid}),this.typedMap[e.content_type]=t}uuidsOfItemsWithConflicts(){return this.conflictMap.getAllDirectKeys()}}},92207:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CollectionSort=void 0,t.CollectionSort={CreatedAt:"created_at",UpdatedAt:"userModifiedDate",Title:"title"}},36883:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ItemCollection=void 0;const r=n(63418),i=n(71165);class o extends i.Collection{onChange(e){const t=e.changed.concat(e.inserted);t.length>0&&this.set(t),this.discard(e.discarded)}findDecrypted(e){const t=this.find(e);if(t)return(0,r.isDecryptedItem)(t)?t:void 0}findAllDecrypted(e){return this.findAll(e).filter(r.isDecryptedItem)}findAllDecryptedWithBlanks(e){return this.findAllIncludingBlanks(e).map((e=>{if(null==e||(0,r.isDecryptedItem)(e))return e}))}allDecrypted(e){return this.all(e).filter(r.isDecryptedItem)}}t.ItemCollection=o},17441:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ItemCounter=void 0;const r=n(87901),i=n(4862),o=n(50292),s=n(45408),a=n(19688),l=n(52197),c=n(59017),u=n(79256),d=n(41574),h=n(82648);t.ItemCounter=class{constructor(e,t=[]){this.collection=e,this.observers=t,this.tagToItemsMap={},this.allCountableItems=new Set,this.countableItemsByType=new Map,this.isItemCountable=e=>!!(0,o.isDecryptedItem)(e)&&(this.passesAllFilters(e)&&!e.archived&&!e.trashed&&!e.conflictOf)}addCountChangeObserver(e){this.observers.push(e);const t=this.observers;return()=>{(0,r.removeFromArray)(t,e)}}setDisplayOptions(e){this.displayOptions=e,this.receiveItemChanges(this.collection.all())}setVaultDisplayOptions(e){this.vaultDisplayOptions=e,this.receiveItemChanges(this.collection.all())}allCountableItemsCount(){return this.allCountableItems.size}allCountableNotesCount(){var e;return(null===(e=this.countableItemsByType.get(h.ContentType.TYPES.Note))||void 0===e?void 0:e.size)||0}allCountableFilesCount(){var e;return(null===(e=this.countableItemsByType.get(h.ContentType.TYPES.File))||void 0===e?void 0:e.size)||0}countableItemsForTag(e){var t;return(null===(t=this.tagToItemsMap[e.uuid])||void 0===t?void 0:t.size)||0}onChange(e){const t=[...e.changed,...e.inserted,...e.discarded].filter((e=>e.content_type===h.ContentType.TYPES.Note||e.content_type===h.ContentType.TYPES.File)),n=[...e.changed,...e.inserted].filter(o.isDecryptedItem).filter(i.isTag);this.receiveItemChanges(t),this.receiveTagChanges(n)}passesAllFilters(e){if(!this.displayOptions)return!0;const t=[new s.CollectionCriteriaValidator(this.collection,e)];if(this.vaultDisplayOptions){const n=this.vaultDisplayOptions.getOptions();(0,d.isExclusionaryOptionsValue)(n)?t.push(new a.ExcludeVaultsCriteriaValidator([...n.exclude,...n.locked],e)):t.push(new l.ExclusiveVaultCriteriaValidator(n.exclusive,e))}return"hiddenContentTypes"in this.displayOptions&&this.displayOptions.hiddenContentTypes&&t.push(new c.HiddenContentCriteriaValidator(this.displayOptions.hiddenContentTypes,e)),"customFilter"in this.displayOptions&&this.displayOptions.customFilter&&t.push(new u.CustomFilterCriteriaValidator(this.displayOptions.customFilter,e)),t.every((e=>e.passes()))}notifyObservers(e){for(const t of this.observers)t(e)}receiveTagChanges(e){for(const t of e){const e=t.references.filter((e=>e.content_type===h.ContentType.TYPES.Note||e.content_type===h.ContentType.TYPES.File)).map((e=>e.uuid)).filter((e=>this.allCountableItems.has(e))),n=this.tagToItemsMap[t.uuid];this.tagToItemsMap[t.uuid]=new Set(e),(null==n?void 0:n.size)!==e.length&&this.notifyObservers(t.uuid)}}receiveItemChanges(e){var t,n;const r=this.allCountableItems.size;for(const r of e){const e=this.isItemCountable(r);e?(this.allCountableItems.add(r.uuid),this.countableItemsByType.has(r.content_type)||this.countableItemsByType.set(r.content_type,new Set),null===(t=this.countableItemsByType.get(r.content_type))||void 0===t||t.add(r.uuid)):(this.allCountableItems.delete(r.uuid),null===(n=this.countableItemsByType.get(r.content_type))||void 0===n||n.delete(r.uuid));const i=this.collection.uuidsThatReferenceUuid(r.uuid);for(const t of i){const n=this.setForTag(t),i=n.size;e?n.add(r.uuid):n.delete(r.uuid),i!==n.size&&this.notifyObservers(t)}}r!==this.allCountableItems.size&&this.notifyObservers(void 0)}setForTag(e){let t=this.tagToItemsMap[e];return t||(t=new Set,this.tagToItemsMap[e]=t),t}}},51833:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImmutablePayloadCollection=void 0;const r=n(19759);class i extends r.PayloadCollection{get payloads(){return this.all()}static WithPayloads(e=[]){const t=new i;return e.length>0&&t.set(e),Object.freeze(t),t}static FromCollection(e){const t=Object.freeze(Object.assign({},e.map)),n=Object.freeze(Object.assign({},e.typedMap)),r=Object.freeze(e.referenceMap.makeCopy()),o=Object.freeze(e.conflictMap.makeCopy()),s=new i(!0,t,n,r,o);return Object.freeze(s),s}mutableCopy(){const e=Object.assign({},this.map),t=Object.assign({},this.typedMap),n=this.referenceMap.makeCopy(),i=this.conflictMap.makeCopy();return new r.PayloadCollection(!0,e,t,n,i)}}t.ImmutablePayloadCollection=i},19759:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadCollection=void 0;const r=n(71165);class i extends r.Collection{integrityPayloads(){return this.nondeletedElements().map((e=>({uuid:e.uuid,updated_at_timestamp:e.serverUpdatedAtTimestamp})))}}t.PayloadCollection=i},9611:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSyncDelta=void 0;const r=n(87901);t.extendSyncDelta=function(e,t){(0,r.extendArray)(e.emits,t.emits),t.ignored&&(e.ignored||(e.ignored=[]),(0,r.extendArray)(e.ignored,t.ignored))}},38067:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConflictDelta=void 0;const r=n(87901),i=n(82648),o=n(73277),s=n(97873),a=n(43610),l=n(27446),c=n(37807),u=n(13566),d=n(38656),h=n(13743);t.ConflictDelta=class{constructor(e,t,n,r){this.baseCollection=e,this.basePayload=t,this.applyPayload=n,this.historyMap=r}result(){if(this.applyPayload.content_type===i.ContentType.TYPES.ItemsKey)return new d.ItemsKeyDelta(this.baseCollection,[this.applyPayload]).result();const e=this.getConflictStrategy();return{emits:this.handleStrategy(e),ignored:[]}}getConflictStrategy(){const e=(0,u.isErrorDecryptingPayload)(this.basePayload),t=(0,u.isErrorDecryptingPayload)(this.applyPayload);if(e||t){if(e&&!t)return a.ConflictStrategy.KeepBaseDuplicateApply;if(!e&&t)return a.ConflictStrategy.DuplicateBaseKeepApply;if(e&&t)return a.ConflictStrategy.KeepApply}else{if((0,u.isDecryptedPayload)(this.basePayload)){const e=this.baseCollection.conflictsOf(this.applyPayload.uuid)[0];if(e&&(0,u.isDecryptedPayload)(e)&&(0,u.isDecryptedPayload)(this.applyPayload)&&(0,c.PayloadContentsEqual)(e,this.applyPayload))return a.ConflictStrategy.KeepBase;{const e=(0,o.CreateDecryptedItemFromPayload)(this.basePayload),t=(0,o.CreateItemFromPayload)(this.applyPayload),n=this.historyMap[this.basePayload.uuid]||[],r=s.historyMapFunctions.getNewestRevision(n);return e.strategyWhenConflictingWithItem(t,r)}}if((0,u.isDeletedPayload)(this.basePayload)||(0,u.isDeletedPayload)(this.applyPayload))return(0,u.isDeletedPayload)(this.basePayload),(0,u.isDeletedPayload)(this.applyPayload),a.ConflictStrategy.KeepApply}throw Error("Unhandled strategy in Conflict Delta getConflictStrategy")}handleStrategy(e){if(e===a.ConflictStrategy.KeepBase)return this.handleKeepBaseStrategy();if(e===a.ConflictStrategy.KeepApply)return this.handleKeepApplyStrategy();if(e===a.ConflictStrategy.KeepBaseDuplicateApply)return this.handleKeepBaseDuplicateApplyStrategy();if(e===a.ConflictStrategy.DuplicateBaseKeepApply)return this.handleDuplicateBaseKeepApply();if(e===a.ConflictStrategy.KeepBaseMergeRefs)return this.handleKeepBaseMergeRefsStrategy();throw Error("Unhandled strategy in conflict delta payloadsByHandlingStrategy")}handleKeepBaseStrategy(){const e=this.applyPayload.serverUpdatedAt,t=this.applyPayload.updated_at_timestamp;return[this.basePayload.copyAsSyncResolved({updated_at:e,updated_at_timestamp:t,dirtyIndex:(0,h.getIncrementedDirtyIndex)(),dirty:!0,lastSyncEnd:new Date},this.applyPayload.source)]}handleKeepApplyStrategy(){return[this.applyPayload.copyAsSyncResolved({lastSyncBegan:this.basePayload.lastSyncBegan,lastSyncEnd:new Date,dirty:!1},this.applyPayload.source)]}handleKeepBaseDuplicateApplyStrategy(){const e=this.applyPayload.serverUpdatedAt,t=this.applyPayload.updated_at_timestamp,n=this.basePayload.copyAsSyncResolved({updated_at:e,updated_at_timestamp:t,dirty:!0,dirtyIndex:(0,h.getIncrementedDirtyIndex)(),lastSyncEnd:new Date},this.applyPayload.source),r=(0,l.PayloadsByDuplicating)({payload:this.applyPayload,baseCollection:this.baseCollection,isConflict:!0,source:this.applyPayload.source});return[n].concat(r)}handleDuplicateBaseKeepApply(){const e=(0,l.PayloadsByDuplicating)({payload:this.basePayload,baseCollection:this.baseCollection,isConflict:!0,source:this.applyPayload.source}),t=this.applyPayload.copyAsSyncResolved({lastSyncBegan:this.basePayload.lastSyncBegan,dirty:!1,lastSyncEnd:new Date},this.applyPayload.source);return e.concat([t])}handleKeepBaseMergeRefsStrategy(){if(!(0,u.isDecryptedPayload)(this.basePayload)||!(0,u.isDecryptedPayload)(this.applyPayload))return[];const e=(0,r.uniqCombineObjArrays)(this.basePayload.content.references,this.applyPayload.content.references,["uuid","content_type"]),t=this.applyPayload.serverUpdatedAt,n=this.applyPayload.updated_at_timestamp;return[this.basePayload.copyAsSyncResolved({updated_at:t,updated_at_timestamp:n,dirty:!0,dirtyIndex:(0,h.getIncrementedDirtyIndex)(),lastSyncEnd:new Date,content:Object.assign(Object.assign({},this.basePayload.content),{references:e})},this.applyPayload.source)]}}},33076:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaFileImport=void 0;const r=n(38067),i=n(59180),o=n(9611),s=n(13743);t.DeltaFileImport=class{constructor(e,t,n){this.baseCollection=e,this.applyPayloads=t,this.historyMap=n}result(){const e={emits:[],ignored:[],source:i.PayloadEmitSource.FileImport};for(const t of this.applyPayloads){const n=this.resolvePayload(t,e);(0,o.extendSyncDelta)(e,n)}return e}resolvePayload(e,t){let n=t.emits.find((t=>(0,i.isDecryptedPayload)(t)&&t.content.conflict_of===e.uuid));if(n||(n=t.emits.find((t=>t.uuid===e.uuid))),!n){const t=this.baseCollection.find(e.uuid);t&&(0,i.isDecryptedPayload)(t)&&(n=t)}return n?new r.ConflictDelta(this.baseCollection,n,e,this.historyMap).result():{emits:[e.copyAsSyncResolved({dirty:!0,dirtyIndex:(0,s.getIncrementedDirtyIndex)(),lastSyncEnd:new Date(0)})],ignored:[]}}}},38656:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ItemsKeyDelta=void 0;const r=n(59180),i=n(72990);t.ItemsKeyDelta=class{constructor(e,t){this.baseCollection=e,this.applyPayloads=t}result(){const e=[],t=[];for(const n of this.applyPayloads){const o=this.baseCollection.find(n.uuid);if(o)if((0,r.isEncryptedPayload)(n)&&(0,r.isDecryptedPayload)(o)){const r=o.copyAsSyncResolved({updated_at_timestamp:n.updated_at_timestamp,updated_at:n.updated_at,dirty:!1,lastSyncEnd:new Date});e.push(r),t.push(n)}else e.push((0,i.payloadByFinalizingSyncState)(n,this.baseCollection));else e.push((0,i.payloadByFinalizingSyncState)(n,this.baseCollection))}return{emits:e,ignored:t}}}},9910:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaOfflineSaved=void 0;const r=n(59180),i=n(72990);t.DeltaOfflineSaved=class{constructor(e,t){this.baseCollection=e,this.applyContextualPayloads=t}result(){const e=[];for(const t of this.applyContextualPayloads){const n=this.baseCollection.find(t.uuid);n&&e.push((0,i.payloadByFinalizingSyncState)(n,this.baseCollection))}return{emits:e,source:r.PayloadEmitSource.OfflineSyncSaved}}}},28504:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaOutOfSync=void 0;const r=n(59180),i=n(13566),o=n(37807),s=n(38067),a=n(82648),l=n(38656),c=n(72990),u=n(9611);t.DeltaOutOfSync=class{constructor(e,t,n){this.baseCollection=e,this.applyCollection=t,this.historyMap=n}result(){const e={emits:[],ignored:[],source:r.PayloadEmitSource.RemoteRetrieved};for(const t of this.applyCollection.all()){if(t.content_type===a.ContentType.TYPES.ItemsKey){const n=new l.ItemsKeyDelta(this.baseCollection,[t]).result();(0,u.extendSyncDelta)(e,n);continue}const n=this.baseCollection.find(t.uuid);if(!n){e.emits.push((0,c.payloadByFinalizingSyncState)(t,this.baseCollection));continue}const r=(0,i.isDecryptedPayload)(n),d=(0,i.isDecryptedPayload)(t);if(d!==r||d&&r&&!(0,o.PayloadContentsEqual)(t,n)){const r=new s.ConflictDelta(this.baseCollection,n,t,this.historyMap);(0,u.extendSyncDelta)(e,r.result())}else e.emits.push((0,c.payloadByFinalizingSyncState)(t,this.baseCollection))}return e}}},9579:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaRemoteDataConflicts=void 0;const r=n(38067),i=n(59180),o=n(9611),s=n(72990);t.DeltaRemoteDataConflicts=class{constructor(e,t,n){this.baseCollection=e,this.conflicts=t,this.historyMap=n}result(){const e={emits:[],ignored:[],source:i.PayloadEmitSource.RemoteRetrieved};for(const t of this.conflicts){const n=this.baseCollection.find(t.server_item.uuid);if(null==n){e.emits.push((0,s.payloadByFinalizingSyncState)(t.server_item,this.baseCollection));continue}const i=new r.ConflictDelta(this.baseCollection,n,t.server_item,this.historyMap);(0,o.extendSyncDelta)(e,i.result())}return e}}},34319:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaRemoteRejected=void 0;const r=n(89223),i=n(59180),o=n(84625),s=n(95658),a=n(27446),l=n(82648);t.DeltaRemoteRejected=class{constructor(e,t){this.baseCollection=e,this.conflicts=t}result(){const e=[],t=[s.ConflictType.SharedVaultInsufficientPermissionsError,s.ConflictType.SharedVaultNotMemberError,s.ConflictType.SharedVaultInvalidState,s.ConflictType.SharedVaultSnjsVersionError];for(const n of this.conflicts)t.includes(n.type)?e.push(...this.handleVaultError(n)):(0,s.conflictParamsHasServerItemAndUnsavedItem)(n)?e.push(...this.getResultForConflictWithServerItemAndUnsavedItem(n)):(0,s.conflictParamsHasOnlyServerItem)(n)?e.push(...this.getResultForConflictWithOnlyServerItem(n)):(0,s.conflictParamsHasOnlyUnsavedItem)(n)&&e.push(...this.getResultForConflictWithOnlyUnsavedItem(n));return{emits:e,source:i.PayloadEmitSource.RemoteSaved}}handleVaultError(e){const t=this.baseCollection.find(e.unsaved_item.uuid);return t?e.type===s.ConflictType.SharedVaultNotMemberError?this.resultByDuplicatingBasePayloadAsNonVaultedAndRemovingBaseItemLocally(t):t.content_type===l.ContentType.TYPES.KeySystemItemsKey?this.discardChangesOfBasePayload(t):e.server_item?this.resultByDuplicatingBasePayloadAsNonVaultedAndTakingServerPayloadAsCanonical(t,e.server_item):this.resultByDuplicatingBasePayloadAsNonVaultedAndDiscardingChangesOfOriginal(t):[]}discardChangesOfBasePayload(e){return[e.copyAsSyncResolved({dirty:!1,lastSyncEnd:new Date},r.PayloadSource.RemoteSaved)]}getResultForConflictWithOnlyUnsavedItem(e){const t=this.baseCollection.find(e.unsaved_item.uuid);return t?[t.copyAsSyncResolved({dirty:!1,lastSyncEnd:new Date},r.PayloadSource.RemoteSaved)]:[]}getResultForConflictWithOnlyServerItem(e){const t=this.baseCollection.find(e.server_item.uuid);return t?this.resultByDuplicatingBasePayloadIntoNewUuidAndTakingServerPayloadAsCanonical(t,e.server_item):[]}getResultForConflictWithServerItemAndUnsavedItem(e){const t=this.baseCollection.find(e.server_item.uuid);return t?this.resultByDuplicatingBasePayloadIntoNewUuidAndTakingServerPayloadAsCanonical(t,e.server_item):[]}resultByDuplicatingBasePayloadIntoNewUuidAndTakingServerPayloadAsCanonical(e,t){const n=(0,a.PayloadsByDuplicating)({payload:e,baseCollection:this.baseCollection,isConflict:!0,source:t.source}),r=t.copyAsSyncResolved({lastSyncBegan:e.lastSyncBegan,dirty:!1,lastSyncEnd:new Date},t.source);return n.concat([r])}resultByDuplicatingBasePayloadAsNonVaultedAndTakingServerPayloadAsCanonical(e,t){const n=(0,a.PayloadsByDuplicating)({payload:e.copy({key_system_identifier:void 0,shared_vault_uuid:void 0}),baseCollection:this.baseCollection,isConflict:!0,source:t.source}),r=t.copyAsSyncResolved({lastSyncBegan:e.lastSyncBegan,dirty:!1,lastSyncEnd:new Date},t.source);return n.concat([r])}resultByDuplicatingBasePayloadAsNonVaultedAndDiscardingChangesOfOriginal(e){return[...(0,a.PayloadsByDuplicating)({payload:e.copy({key_system_identifier:void 0,shared_vault_uuid:void 0}),baseCollection:this.baseCollection,isConflict:!0,source:e.source}),...this.discardChangesOfBasePayload(e)]}resultByDuplicatingBasePayloadAsNonVaultedAndRemovingBaseItemLocally(e){return[...(0,a.PayloadsByDuplicating)({payload:e.copy({key_system_identifier:void 0,shared_vault_uuid:void 0}),baseCollection:this.baseCollection,isConflict:!0,source:e.source}),new i.DeletedPayload(Object.assign(Object.assign(Object.assign({},e),{content:void 0,deleted:!0,key_system_identifier:void 0,shared_vault_uuid:void 0}),(0,o.BuildSyncResolvedParams)({dirty:!1,lastSyncEnd:new Date})),r.PayloadSource.RemoteSaved)]}}},79603:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaRemoteRetrieved=void 0;const r=n(38067),i=n(13566),o=n(59180),s=n(82648),a=n(72990),l=n(38656),c=n(9611);t.DeltaRemoteRetrieved=class{constructor(e,t,n,r){this.baseCollection=e,this.applyCollection=t,this.itemsSavedOrSaving=n,this.historyMap=r}isUuidOfPayloadCurrentlySavingOrSaved(e){return null!=this.itemsSavedOrSaving.find((t=>t.uuid===e))}result(){const e={emits:[],ignored:[],source:o.PayloadEmitSource.RemoteRetrieved},t=[];for(const n of this.applyCollection.all()){if(n.content_type===s.ContentType.TYPES.ItemsKey||n.content_type===s.ContentType.TYPES.KeySystemItemsKey){const t=new l.ItemsKeyDelta(this.baseCollection,[n]).result();(0,c.extendSyncDelta)(e,t);continue}if(this.isUuidOfPayloadCurrentlySavingOrSaved(n.uuid)){t.push(n);continue}const r=this.baseCollection.find(n.uuid);!(null==r?void 0:r.dirty)||(0,i.isErrorDecryptingPayload)(r)?e.emits.push((0,a.payloadByFinalizingSyncState)(n,this.baseCollection)):t.push(n)}for(const n of t){if(!(0,i.isDecryptedPayload)(n))continue;const t=this.baseCollection.find(n.uuid);if(!t)continue;const o=new r.ConflictDelta(this.baseCollection,t,n,this.historyMap);(0,c.extendSyncDelta)(e,o.result())}return e}}},50910:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaRemoteSaved=void 0;const r=n(452),i=n(89223),o=n(13566),s=n(59180),a=n(72990),l=n(84625),c=n(13743);t.DeltaRemoteSaved=class{constructor(e,t){this.baseCollection=e,this.applyContextualPayloads=t}result(){const e=[];for(const t of this.applyContextualPayloads){const n=this.baseCollection.find(t.uuid);if(n)if((0,o.isDeletedPayload)(n)){const o=!t.deleted,s=t.deleted;if(o){const n=new r.DeletedPayload(Object.assign(Object.assign(Object.assign({},t),{deleted:!0,content:void 0,dirtyIndex:(0,c.getIncrementedDirtyIndex)()}),(0,l.BuildSyncResolvedParams)({dirty:!0,lastSyncEnd:new Date})),i.PayloadSource.RemoteSaved);e.push(n)}else if(s){const r=n.copy(Object.assign(Object.assign(Object.assign({},t),{deleted:!0}),(0,l.BuildSyncResolvedParams)({dirty:!1,lastSyncEnd:new Date})),i.PayloadSource.RemoteSaved);e.push(r)}}else{const r=(0,a.payloadByFinalizingSyncState)(n.copy(Object.assign(Object.assign({},t),{deleted:!1}),i.PayloadSource.RemoteSaved),this.baseCollection);e.push(r)}else{const n=new r.DeletedPayload(Object.assign(Object.assign(Object.assign({},t),{deleted:!0,content:void 0}),(0,l.BuildSyncResolvedParams)({dirty:!1,lastSyncEnd:new Date})),i.PayloadSource.RemoteSaved);e.push(n)}}return{emits:e,source:s.PayloadEmitSource.RemoteSaved}}}},16484:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaRemoteUuidConflicts=void 0;const r=n(87901),i=n(51833),o=n(15005),s=n(13566),a=n(59180);t.DeltaRemoteUuidConflicts=class{constructor(e,t){this.baseCollection=e,this.conflicts=t}result(){const e=[],t=this.baseCollection.mutableCopy();for(const n of this.conflicts){const a=e.find((e=>e.uuid===n.unsaved_item.uuid))||n.unsaved_item;if(!(0,s.isDecryptedPayload)(a))continue;const l=(0,o.PayloadsByAlternatingUuid)(a,i.ImmutablePayloadCollection.FromCollection(t));t.set(l),(0,r.filterFromArray)(e,(e=>(0,r.Uuids)(l).includes(e.uuid))),(0,r.extendArray)(e,l)}return{emits:e,source:a.PayloadEmitSource.RemoteRetrieved}}}},72990:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.payloadsByFinalizingSyncState=t.payloadByFinalizingSyncState=void 0;const r=n(13743);function i(e,t){const n=t.find(e.uuid);if(!n)return e.copyAsSyncResolved({dirty:!1,lastSyncEnd:new Date});const i=!(!n.dirtyIndex||!n.globalDirtyIndexAtLastSync)&&n.dirtyIndex>n.globalDirtyIndexAtLastSync;return e.copyAsSyncResolved({dirty:i,dirtyIndex:i?(0,r.getIncrementedDirtyIndex)():void 0,lastSyncEnd:new Date})}t.payloadByFinalizingSyncState=i,t.payloadsByFinalizingSyncState=function(e,t){return e.map((e=>i(e,t)))}},84625:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BuildSyncResolvedParams=void 0,t.BuildSyncResolvedParams=function(e){return e}},22517:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(38067),t),i(n(33076),t),i(n(28504),t),i(n(9579),t),i(n(79603),t),i(n(50910),t),i(n(9910),t),i(n(16484),t),i(n(34319),t),i(n(9611),t)},13743:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCurrentDirtyIndex=t.getIncrementedDirtyIndex=void 0;let n=0;t.getIncrementedDirtyIndex=function(){return n++,n},t.getCurrentDirtyIndex=function(){return n}},55823:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},91176:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.computeFiltersForDisplayOptions=t.computeUnifiedFilterForDisplayOptions=void 0;const r=n(8698),i=n(50149),o=n(35509),s=n(41138),a=n(82648);function l(e,t){var n;const l=[];let c;if(e.views&&e.views.length>0){const n=new r.CompoundPredicate("and",e.views.map((e=>e.predicate)));c=n,l.push((e=>{if(n.keypathIncludesString("tags")){const r=i.ItemWithTags.Create(e.payload,e,t.elementsReferencingElement(e,a.ContentType.TYPES.Tag));return n.matchesItem(r)}return n.matchesItem(e)}))}if(e.tags&&e.tags.length>0)for(const t of e.tags)l.push((e=>t.isReferencingItem(e)));if(!1!==e.includePinned||(null==c?void 0:c.keypathIncludesString("pinned"))||l.push((e=>!e.pinned)),!1!==e.includeProtected||(null==c?void 0:c.keypathIncludesString("protected"))||l.push((e=>!e.protected)),!1!==e.includeTrashed||(null==c?void 0:c.keypathIncludesString("trashed"))||l.push((e=>!e.trashed)),!1!==e.includeArchived||(null==c?void 0:c.keypathIncludesString("archived"))||l.push((e=>!e.archived)),e.searchQuery){const n=e.searchQuery;l.push((e=>(0,o.itemMatchesQuery)(e,n,t)))}return(null==c?void 0:c.keypathIncludesString("conflict_of"))||(null===(n=e.views)||void 0===n?void 0:n.some((e=>e.uuid===s.SystemViewId.TrashedNotes)))||l.push((e=>!e.conflictOf)),l}t.computeUnifiedFilterForDisplayOptions=function(e,t,n=[]){const r=l(e,t).concat(n);return e=>(0,o.itemPassesFilters)(e,r)},t.computeFiltersForDisplayOptions=l},40257:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ItemDisplayController=void 0;const r=n(87901),i=n(50292),o=n(99548),s=n(45408),a=n(79256),l=n(19688),c=n(52197),u=n(59017),d=n(41574);t.ItemDisplayController=class{constructor(e,t,n,r){this.collection=e,this.contentTypes=t,this.options=n,this.vaultOptions=r,this.sortMap={},this.sortedItems=[],this.needsSort=!0,this.filterThenSortElements(this.collection.all(this.contentTypes))}items(){return this.sortedItems}hasExclusiveVaultOptions(){return!!this.vaultOptions&&!(0,d.isExclusionaryOptionsValue)(this.vaultOptions.getOptions())}getDisplayOptions(){return this.options}setVaultDisplayOptions(e){this.vaultOptions=e,this.needsSort=!0,this.filterThenSortElements(this.collection.all(this.contentTypes))}setDisplayOptions(e){this.options=Object.assign(Object.assign({},this.options),e),this.needsSort=!0,this.filterThenSortElements(this.collection.all(this.contentTypes))}onCollectionChange(e){const t=[...e.changed,...e.inserted,...e.discarded].filter((e=>this.contentTypes.includes(e.content_type)));this.filterThenSortElements(t)}passesAllFilters(e){const t=[new s.CollectionCriteriaValidator(this.collection,e)];if(this.vaultOptions){const n=this.vaultOptions.getOptions();(0,d.isExclusionaryOptionsValue)(n)?t.push(new l.ExcludeVaultsCriteriaValidator([...n.exclude,...n.locked],e)):t.push(new c.ExclusiveVaultCriteriaValidator(n.exclusive,e))}return"hiddenContentTypes"in this.options&&this.options.hiddenContentTypes&&t.push(new u.HiddenContentCriteriaValidator(this.options.hiddenContentTypes,e)),"customFilter"in this.options&&this.options.customFilter&&t.push(new a.CustomFilterCriteriaValidator(this.options.customFilter,e)),t.every((e=>e.passes()))}filterThenSortElements(e){for(const t of e){const e=this.sortMap[t.uuid],n=null!=e?this.sortedItems[e]:void 0,o=()=>{null!=e&&(delete this.sortMap[t.uuid],this.sortedItems[e]=void 0,this.needsSort=!0)};if((0,i.isDeletedItem)(t)||(0,i.isEncryptedItem)(t))o();else if(this.passesAllFilters(t))if(null!=n){const i=n[this.options.sortBy],o=t[this.options.sortBy];this.sortedItems[e]=t;const s=n.pinned!==t.pinned;(0,r.compareValues)(i,o)&&!s||(this.needsSort=!0)}else this.sortedItems.push(t),this.needsSort=!0;else o()}this.needsSort&&(this.needsSort=!1,this.resortItems())}resortItems(){const e=this.sortedItems.sort(((e,t)=>(0,o.sortTwoItems)(e,t,this.options.sortBy,this.options.sortDirection))),t=[];let n=0;for(const r of e)r&&(t.push(r),this.sortMap[r.uuid]=n,n++);this.sortedItems=t}}},50149:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ItemWithTags=void 0;const r=n(87901),i=n(50292);class o extends i.DecryptedItem{constructor(e,t,n){super(e),this.item=t,this.tags=n,this.transferInItemPropertiesSoRootLevelPredicateKeyPathsCanBeMatched(t),this.tags=n||e.content.tags}transferInItemPropertiesSoRootLevelPredicateKeyPathsCanBeMatched(e){Object.assign(this,(0,r.omitByCopy)(e,["title","text"]))}static Create(e,t,n){return new o(e,t,n)}get tagsCount(){var e;return(null===(e=this.tags)||void 0===e?void 0:e.length)||0}get title(){return this.item.title}get text(){return this.item.text}}t.ItemWithTags=o},35509:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.itemMatchesQuery=t.itemPassesFilters=t.notesAndFilesMatchingOptions=void 0;const r=n(82648),i=n(91176);var o;function s(e,t){for(const n of t)if(!n(e))return!1;return!0}function a(e,t){var n,r;if(0===t.length)return o.TitleAndText;const i=null===(n=e.title)||void 0===n?void 0:n.toLowerCase(),s=null===(r=e.text)||void 0===r?void 0:r.toLowerCase(),a=t.toLowerCase(),l=a.split(" "),c=function(e){const t=e.match(/"(.*?)"/);return t?t[1]:null}(a);if(c)return((null==i?void 0:i.includes(c))?o.Title:o.None)+((null==s?void 0:s.includes(c))?o.Text:o.None);if(function(e){return!!e.match(/\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b/)}(a))return e.uuid===a?o.Uuid:o.None;const u=i&&l.every((e=>i.indexOf(e)>=0)),d=s&&l.every((e=>s.indexOf(e)>=0));return(u?o.Title:0)+(d?o.Text:0)}!function(e){e[e.None=0]="None",e[e.Title=1]="Title",e[e.Text=2]="Text",e[e.TitleAndText=3]="TitleAndText",e[e.Uuid=5]="Uuid"}(o||(o={})),t.notesAndFilesMatchingOptions=function(e,t,n){const r=(0,i.computeFiltersForDisplayOptions)(e,n);return t.filter((e=>s(e,r)))},t.itemPassesFilters=s,t.itemMatchesQuery=function(e,t,n){const i=n.elementsReferencingElement(e,r.ContentType.TYPES.Tag).some((e=>a(e,t.query)!==o.None));if(e.protected&&!t.includeProtectedNoteText){const n=a(e,t.query);return n===o.Title||n===o.TitleAndText||i}return a(e,t.query)!==o.None||i}},29816:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},74379:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},99548:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sortTwoItems=t.KeepSameOrder=t.SortRightFirst=t.SortLeftFirst=void 0;const r=n(87901),i=n(92207);t.SortLeftFirst=-1,t.SortRightFirst=1,t.KeepSameOrder=0,t.sortTwoItems=function e(n,o,s,a,l=!1){if(!n)return t.SortLeftFirst;if(!o)return t.SortRightFirst;if(!l){if(n.pinned&&o.pinned)return e(n,o,s,a,!0);if(n.pinned)return t.SortLeftFirst;if(o.pinned)return t.SortRightFirst}const c=n[s]||"",u=o[s]||"",d="asc"===a;let h=t.KeepSameOrder;h=s===i.CollectionSort.Title&&(0,r.isString)(c)&&(0,r.isString)(u)&&c.length>0&&u.length>0?c.localeCompare(u,"en",{numeric:!0}):c>u?t.SortRightFirst:c<u?t.SortLeftFirst:t.KeepSameOrder;const p=h===t.SortLeftFirst,f=h===t.SortRightFirst;return p?d?t.SortLeftFirst:t.SortRightFirst:f?d?t.SortRightFirst:t.SortLeftFirst:t.KeepSameOrder}},93974:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},45408:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CollectionCriteriaValidator=void 0,t.CollectionCriteriaValidator=class{constructor(e,t){this.collection=e,this.element=t}passes(){return this.collection.has(this.element.uuid)}}},79256:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CustomFilterCriteriaValidator=void 0,t.CustomFilterCriteriaValidator=class{constructor(e,t){this.customFilter=e,this.element=t}passes(){return this.customFilter(this.element)}}},19688:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExcludeVaultsCriteriaValidator=void 0,t.ExcludeVaultsCriteriaValidator=class{constructor(e,t){this.excludeVaults=e,this.element=t}passes(){return!this.excludeVaults.some((e=>this.element.key_system_identifier===e))}}},52197:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExclusiveVaultCriteriaValidator=void 0,t.ExclusiveVaultCriteriaValidator=class{constructor(e,t){this.exclusiveVault=e,this.element=t}passes(){return this.element.key_system_identifier===this.exclusiveVault}}},59017:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HiddenContentCriteriaValidator=void 0,t.HiddenContentCriteriaValidator=class{constructor(e,t){this.hiddenContentTypes=e,this.element=t}passes(){return!this.hiddenContentTypes.includes(this.element.content_type)}}},67104:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VaultDisplayOptions=void 0;const r=n(87901),i=n(41574);function o(e){return e.map((e=>e.systemIdentifier))}class s{constructor(e){this.options=e}getOptions(){return this.options}getExclusivelyShownVault(){if((0,i.isExclusionaryOptionsValue)(this.options))throw new Error("Not in exclusive display mode");return this.options.exclusive}isInExclusiveDisplayMode(){return!(0,i.isExclusionaryOptionsValue)(this.options)}isVaultExplicitlyExcluded(e){if((0,i.isExclusionaryOptionsValue)(this.options))return this.options.exclude.some((t=>t===e.systemIdentifier));if(this.options.exclusive)return this.options.exclusive!==e.systemIdentifier;throw new Error("Invalid vault display options")}isVaultExclusivelyShown(e){return!(0,i.isExclusionaryOptionsValue)(this.options)&&this.options.exclusive===e.systemIdentifier}isVaultDisabledOrLocked(e){return!(!(0,i.isExclusionaryOptionsValue)(this.options)||!this.options.locked.find((t=>t===e.systemIdentifier)))||this.isVaultExplicitlyExcluded(e)}getPersistableValue(){return this.options}newOptionsByIntakingLockedVaults(e){return(0,i.isExclusionaryOptionsValue)(this.options)?new s({exclude:this.options.exclude,locked:o(e)}):new s({exclusive:this.options.exclusive})}newOptionsByExcludingVault(e,t){return this.newOptionsByExcludingVaults([e],t)}newOptionsByExcludingVaults(e,t){return(0,i.isExclusionaryOptionsValue)(this.options)?new s({exclude:(0,r.uniqueArray)([...this.options.exclude,...o(e)]),locked:o(t)}):new s({exclude:o(e),locked:o(t)})}newOptionsByUnexcludingVault(e,t){return(0,i.isExclusionaryOptionsValue)(this.options)?new s({exclude:this.options.exclude.filter((t=>t!==e.systemIdentifier)),locked:o(t)}):new s({exclude:[],locked:o(t)})}static FromPersistableValue(e){return new s(e)}}t.VaultDisplayOptions=s},41574:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isExclusionaryOptionsValue=void 0,t.isExclusionaryOptionsValue=function(e){return"exclude"in e||"locked"in e}},30561:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(55823),t),i(n(91176),t),i(n(40257),t),i(n(50149),t),i(n(29816),t),i(n(35509),t),i(n(74379),t),i(n(93974),t),i(n(67104),t),i(n(41574),t)},87332:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContentTypeUsesKeySystemRootKeyEncryption=void 0;const r=n(82648);t.ContentTypeUsesKeySystemRootKeyEncryption=function(e){return e===r.ContentType.TYPES.KeySystemItemsKey}},21662:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContentTypeUsesRootKeyEncryption=void 0;const r=n(96084);t.ContentTypeUsesRootKeyEncryption=function(e){return(0,r.ContentTypesUsingRootKeyEncryption)().includes(e)}},96084:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContentTypesUsingRootKeyEncryption=void 0;const r=n(82648);t.ContentTypesUsingRootKeyEncryption=function(){return[r.ContentType.TYPES.RootKey,r.ContentType.TYPES.ItemsKey,r.ContentType.TYPES.EncryptedStorage,r.ContentType.TYPES.TrustedContact,r.ContentType.TYPES.KeySystemRootKey]}},47469:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},74958:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNativeFeature=t.isItemBasedFeature=t.isUIFeatureAnIframeFeature=void 0;const r=n(84409);t.isUIFeatureAnIframeFeature=function(e){return(0,r.isIframeComponentFeatureDescription)(e.featureDescription)},t.isItemBasedFeature=function(e){return"uuid"in e},t.isNativeFeature=function(e){return!("uuid"in e)}},36053:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIFeature=void 0;const r=n(84409),i=n(74958),o=n(82648),s=n(52659);t.UIFeature=class{constructor(e){this.item=e}get isComponent(){return(0,i.isItemBasedFeature)(this.item)}get isThemeComponent(){return(0,i.isItemBasedFeature)(this.item)&&(0,s.isTheme)(this.item)}get asComponent(){if((0,i.isItemBasedFeature)(this.item))return this.item;throw new Error("Cannot cast item to component")}get asTheme(){if((0,i.isItemBasedFeature)(this.item))return this.item;throw new Error("Cannot cast item to component")}get asFeatureDescription(){if((0,i.isNativeFeature)(this.item))return this.item;throw new Error("Cannot cast item to feature description")}get isNativeFeature(){return void 0!==(0,r.FindNativeFeature)(this.featureIdentifier)}get uniqueIdentifier(){return(0,i.isNativeFeature)(this.item)?r.NativeFeatureIdentifier.create(this.item.identifier).getValue():o.Uuid.create(this.item.uuid).getValue()}get featureIdentifier(){return this.item.identifier}get noteType(){var e;if((0,i.isNativeFeature)(this.item)&&(0,r.isEditorFeatureDescription)(this.item))return null!==(e=this.item.note_type)&&void 0!==e?e:r.NoteType.Unknown;if((0,i.isItemBasedFeature)(this.item))return this.item.noteType;throw new Error("Invalid component or feature description")}get fileType(){var e,t;if((0,i.isNativeFeature)(this.item)&&(0,r.isEditorFeatureDescription)(this.item))return this.item.file_type;if((0,i.isItemBasedFeature)(this.item)&&(0,r.isEditorFeatureDescription)(this.item.package_info))return null!==(t=null===(e=this.item.package_info)||void 0===e?void 0:e.file_type)&&void 0!==t?t:"txt";throw new Error("Invalid component or feature description")}get displayName(){var e;return(0,i.isNativeFeature)(this.item)?null!==(e=this.item.name)&&void 0!==e?e:"":this.item.displayName}get description(){var e,t;return(0,i.isNativeFeature)(this.item)?null!==(e=this.item.description)&&void 0!==e?e:"":null!==(t=this.item.package_info.description)&&void 0!==t?t:""}get deprecationMessage(){return(0,i.isNativeFeature)(this.item)?this.item.deprecation_message:this.item.deprecationMessage}get expirationDate(){return(0,i.isNativeFeature)(this.item)?this.item.expires_at?new Date(this.item.expires_at):void 0:this.item.valid_until}get featureDescription(){return(0,i.isNativeFeature)(this.item)?this.item:this.item.package_info}get acquiredPermissions(){var e;if((0,i.isNativeFeature)(this.item)&&(0,r.isIframeComponentFeatureDescription)(this.item))return null!==(e=this.item.component_permissions)&&void 0!==e?e:[];if((0,i.isItemBasedFeature)(this.item))return this.item.permissions;throw new Error("Invalid component or feature description")}get area(){return"area"in this.item?this.item.area:r.ComponentArea.Editor}get layerable(){var e;return(0,i.isItemBasedFeature)(this.item)&&(0,s.isTheme)(this.item)?this.item.layerableTheme:!!(0,r.isThemeFeatureDescription)(this.asFeatureDescription)&&null!==(e=this.asFeatureDescription.layerable)&&void 0!==e&&e}get dockIcon(){return(0,i.isItemBasedFeature)(this.item)&&(0,s.isTheme)(this.item)?this.asTheme.package_info.dock_icon:(0,r.isThemeFeatureDescription)(this.asFeatureDescription)?this.asFeatureDescription.dock_icon:void 0}}},18284:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},24715:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreateHistoryEntryForPayload=void 0;const r=n(82648),i=n(69375),o=n(94068);t.CreateHistoryEntryForPayload=function(e,t){return new(e.content_type===r.ContentType.TYPES.Note?o.NoteHistoryEntry:i.HistoryEntry)(e,t)}},69375:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HistoryEntry=void 0;const r=n(87901),i=n(73277);t.HistoryEntry=class{constructor(e,t){var n;this.defaultContentKeyToDiffOn="text",this.payload=e.copy(),this.previousEntry=t,this.hasPreviousEntry=!(0,r.isNullOrUndefined)(t);const i=this.payload.content[this.defaultContentKeyToDiffOn];if(i)if(t){const e=(null===(n=t.payload.content[this.defaultContentKeyToDiffOn])||void 0===n?void 0:n.length)||0;this.textCharDiffLength=i.length-e}else this.textCharDiffLength=i.length;else this.textCharDiffLength=0}itemFromPayload(){return(0,i.CreateDecryptedItemFromPayload)(this.payload)}isSameAsEntry(e){if(!e)return!1;const t=this.itemFromPayload(),n=e.itemFromPayload();return!(t.userModifiedDate.getTime()!==n.userModifiedDate.getTime())&&t.isItemContentEqualWith(n)}isDiscardable(){return!1}operationVector(){return void 0!==this.textCharDiffLength?this.hasPreviousEntry&&0!==this.textCharDiffLength?this.textCharDiffLength<0?-1:1:0:1}deltaSize(){return void 0!==this.textCharDiffLength?Math.abs(this.textCharDiffLength):1}}},30545:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},97873:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.historyMapFunctions=void 0,t.historyMapFunctions={getNewestRevision:e=>e[0]}},94068:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoteHistoryEntry=void 0;const r=n(87901),i=n(69375);class o extends i.HistoryEntry{previewTitle(){return this.payload.updated_at.getTime()>0?this.payload.updated_at.toLocaleString():this.payload.created_at.toLocaleString()}previewSubTitle(){return this.hasPreviousEntry?this.textCharDiffLength<0?-1*this.textCharDiffLength+" characters removed":this.textCharDiffLength>0?`${this.textCharDiffLength} characters added`:"Title or metadata changed":`${this.textCharDiffLength} characters loaded`}isDiscardable(){return(0,r.isEmpty)(this.payload.content.text)}}t.NoteHistoryEntry=o},78274:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(24715),t),i(n(69375),t),i(n(97873),t),i(n(94068),t),i(n(30545),t)},47479:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreateItemDelta=void 0,t.CreateItemDelta=function(e){return{changed:e.changed||[],inserted:e.inserted||[],discarded:e.discarded||[],ignored:e.ignored||[],unerrored:e.unerrored||[]}}},21626:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8698:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CompoundPredicate=void 0,t.CompoundPredicate=class{constructor(e,t){this.operator=e,this.predicates=t}matchesItem(e){if("and"===this.operator){for(const t of this.predicates)if(!t.matchesItem(e))return!1;return!0}if("or"===this.operator){for(const t of this.predicates)if(t.matchesItem(e))return!0;return!1}return!1}keypathIncludesString(e){for(const t of this.predicates)if(t.keypathIncludesString(e))return!0;return!1}toJson(){return{operator:this.operator,value:this.predicates.map((e=>e.toJson()))}}}},26550:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.predicateFromDSLString=t.predicateFromJson=t.includesPredicateFromArguments=t.notPredicateFromArguments=t.compoundPredicateFromArguments=t.predicateFromArguments=void 0;const r=n(8698),i=n(80389),o=n(21271),s=n(73067),a=n(78688);function l(e,t,n){if(o.AllPredicateCompoundOperators.includes(t))return c(t,n);if("not"===t)return new s.NotPredicate(u(n));if("includes"===t&&e)return function(e){return!!o.SureValueNonObjectTypesAsStrings.includes(typeof e)||!!Array.isArray(e)&&!d(e)}(n)?new a.Predicate(e,t,n):new i.IncludesPredicate(e,u(n));if(e)return new a.Predicate(e,t,n);throw Error("Invalid predicate arguments")}function c(e,t){const n=t.map((e=>u(e)));return new r.CompoundPredicate(e,n)}function u(e){if(Array.isArray(e))throw Error("Invalid predicateFromJson value");return l(e.keypath,e.operator,d(e.value)?h(e.value):e.value)}function d(e){return Array.isArray(e)&&o.AllPredicateOperators.includes(e[1])}function h(e){const t=e[2];let n;if(Array.isArray(t)){const e=t;n=Array.isArray(e[0])?e.map((e=>h(e))):d(t[1])?h(e):t}else n=t;return{keypath:e[0],operator:e[1],value:n}}t.predicateFromArguments=l,t.compoundPredicateFromArguments=c,t.notPredicateFromArguments=function(e){const t=u(e);return new s.NotPredicate(t)},t.includesPredicateFromArguments=function(e,t){const n=u(t);return new i.IncludesPredicate(e,n)},t.predicateFromJson=u,t.predicateFromDSLString=function(e){try{const t=JSON.parse(e.substring(1,e.length));return t.shift(),u(h(t))}catch(e){throw Error(`Invalid smart view syntax ${JSON.stringify(e)}`)}}},80389:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IncludesPredicate=void 0,t.IncludesPredicate=class{constructor(e,t){this.keypath=e,this.predicate=t}matchesItem(e){const t=this.keypath.split(".").reduce(((e,t)=>e&&e[t]),e);return!!Array.isArray(t)&&t.some((e=>this.predicate.matchesItem(e)))}keypathIncludesString(e){return this.keypath.includes(e)}toJson(){return{keypath:this.keypath,operator:"includes",value:this.predicate.toJson()}}}},21271:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SureValueNonObjectTypesAsStrings=t.AllPredicateOperators=t.AllNonCompoundPredicateOperators=t.AllPredicateCompoundOperators=void 0,t.AllPredicateCompoundOperators=["and","or"],t.AllNonCompoundPredicateOperators=["!=","=","<",">","<=",">=","startsWith","in","matches","not","includes"],t.AllPredicateOperators=[...t.AllPredicateCompoundOperators,...t.AllNonCompoundPredicateOperators],t.SureValueNonObjectTypesAsStrings=["number","string","boolean"]},73067:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotPredicate=void 0,t.NotPredicate=class{constructor(e){this.predicate=e}matchesItem(e){return!this.predicate.matchesItem(e)}keypathIncludesString(e){return this.predicate.keypathIncludesString(e)}toJson(){return{operator:"not",value:this.predicate.toJson()}}}},21014:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.valueMatchesTargetValue=void 0;const r=n(87901),i=n(58506);t.valueMatchesTargetValue=function e(t,n,o){if(null==o)return!1;if("string"==typeof o&&o.includes(".ago")&&(o=(0,i.dateFromDSLDateString)(o)),"string"==typeof o&&(o=o.toLowerCase()),"string"==typeof t&&(t=t.toLowerCase()),t instanceof Date&&"string"==typeof o&&(o=new Date(o)),"not"===n)return!e(t,"=",o);if(null==t){const e=[!1,"",null,void 0,NaN].includes(o);return"!="===n?!e:e}if("="===n)return Array.isArray(t)?JSON.stringify(t)===JSON.stringify(o):t===o;if("!="===n)return Array.isArray(t)?JSON.stringify(t)!==JSON.stringify(o):t!==o;if("<"===n)return t<o;if(">"===n)return t>o;if("<="===n)return t<=o;if(">="===n)return t>=o;if("startsWith"===n)return t.startsWith(o);if("in"===n&&Array.isArray(o))return o.includes(t);if("includes"===n){if((0,r.isString)(t))return t.includes(o);if((0,r.isString)(o)&&((0,r.isString)(t)||Array.isArray(t)))return t.includes(o)}return"matches"===n&&new RegExp(o).test(t)}},78688:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Predicate=void 0;const r=n(21014);t.Predicate=class{constructor(e,t,n){this.keypath=e,this.operator=t,this.targetValue=n,"true"!==this.targetValue&&"false"!==this.targetValue||(this.targetValue=JSON.parse(this.targetValue))}keypathIncludesString(e){return this.keypath.includes(e)}matchesItem(e){const t=this.keypath.split(".").reduce(((e,t)=>e&&e[t]),e);return(0,r.valueMatchesTargetValue)(t,this.operator,this.targetValue)}toJson(){return{keypath:this.keypath,operator:this.operator,value:this.targetValue}}}},58506:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dateFromDSLDateString=void 0,t.dateFromDSLDateString=function(e){const t=e.split("."),n=t[1],r=new Date,i=parseInt(t[0]);return"days"===n?r.setDate(r.getDate()-i):"hours"===n?r.setHours(r.getHours()-i):"months"===n?r.setMonth(r.getMonth()-i):"years"===n&&r.setFullYear(r.getFullYear()-i),r}},59020:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SNActionsExtension=void 0;const r=n(43740),i=n(43610);class o extends r.DecryptedItem{constructor(e){super(e),this.actions=[],this.name=e.content.name||"",this.description=e.content.description||"",this.url=e.content.hosted_url||e.content.url,this.supported_types=e.content.supported_types,this.package_info=this.payload.content.package_info||{},this.deprecation=e.content.deprecation,this.actions=e.content.actions}get displayName(){return this.name}get thirdPartyPackageInfo(){return this.package_info}get isListedExtension(){return"org.standardnotes.listed"===this.package_info.identifier}actionsWithContextForItem(e){return this.actions.filter((t=>t.context===e.content_type||"Item"===t.context))}strategyWhenConflictingWithItem(e,t){return i.ConflictStrategy.KeepBase}}t.SNActionsExtension=o},27539:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActionsExtensionMutator=void 0;const r=n(14584);class i extends r.DecryptedItemMutator{set description(e){this.mutableContent.description=e}set supported_types(e){this.mutableContent.supported_types=e}set actions(e){this.mutableContent.actions=e}set deprecation(e){this.mutableContent.deprecation=e}}t.ActionsExtensionMutator=i},82531:(e,t)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.ActionVerb=t.ActionAccessType=void 0,function(e){e.Encrypted="encrypted",e.Decrypted="decrypted"}(n||(t.ActionAccessType=n={})),function(e){e.Get="get",e.Render="render",e.Show="show",e.Post="post",e.Nested="nested"}(r||(t.ActionVerb=r={}))},40826:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(59020),t),i(n(27539),t),i(n(82531),t)},35922:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentItem=void 0;const r=n(87901),i=n(84409),o=n(68716),s=n(43610),a=n(43740),l=n(78688),c=n(82648);class u extends a.DecryptedItem{constructor(e){var t,n,o;super(e),this.permissions=[],e.content.hosted_url&&(0,r.isValidUrl)(e.content.hosted_url)?this.hosted_url=e.content.hosted_url:e.content.url&&(0,r.isValidUrl)(e.content.url)?this.hosted_url=e.content.url:e.content.legacy_url&&(0,r.isValidUrl)(e.content.legacy_url)&&(this.hosted_url=e.content.legacy_url),this.local_url=e.content.local_url,this.valid_until=new Date(e.content.valid_until||0),this.offlineOnly=null!==(t=e.content.offlineOnly)&&void 0!==t&&t,this.name=e.content.name,this.content_type===c.ContentType.TYPES.Theme?this.area=i.ComponentArea.Themes:this.area=e.content.area,this.package_info=e.content.package_info||{},this.permissions=e.content.permissions||[],this.autoupdateDisabled=null!==(n=e.content.autoupdateDisabled)&&void 0!==n&&n,this.disassociatedItemIds=e.content.disassociatedItemIds||[],this.associatedItemIds=e.content.associatedItemIds||[],this.legacy_url=e.content.hosted_url?void 0:e.content.url,this.legacyComponentData=this.payload.content.componentData||{},this.legacyActive=null!==(o=e.content.active)&&void 0!==o&&o}strategyWhenConflictingWithItem(e,t){return s.ConflictStrategy.KeepBase}get isSingleton(){return!0}get displayName(){var e;return(null===(e=(0,i.FindNativeFeature)(this.identifier))||void 0===e?void 0:e.name)||this.name}singletonPredicate(){return new l.Predicate("identifier","=",this.identifier)}isTheme(){return this.content_type===c.ContentType.TYPES.Theme||this.area===i.ComponentArea.Themes}legacyIsDefaultEditor(){return!0===this.getAppDomainValue(o.AppDataField.DefaultEditor)}hasValidHostedUrl(){return null!=(this.hosted_url||this.legacy_url)}contentKeysToIgnoreWhenCheckingEquality(){return["active","disassociatedItemIds","associatedItemIds",...super.contentKeysToIgnoreWhenCheckingEquality()]}isExplicitlyEnabledForItem(e){return-1!==this.associatedItemIds.indexOf(e)}isExplicitlyDisabledForItem(e){return-1!==this.disassociatedItemIds.indexOf(e)}get isExpired(){return this.valid_until.getTime()>0&&this.valid_until<=new Date}get identifier(){return this.package_info.identifier}get thirdPartyPackageInfo(){return this.package_info}get noteType(){var e;return(0,i.isEditorFeatureDescription)(this.package_info)&&null!==(e=this.package_info.note_type)&&void 0!==e?e:i.NoteType.Unknown}get isDeprecated(){var e;let t=null!==(e=this.package_info.flags)&&void 0!==e?e:[];return t=t.map((e=>e.toLowerCase())),t.includes(i.ComponentFlag.Deprecated)}get deprecationMessage(){return this.package_info.deprecation_message}get layerableTheme(){var e;if(!this.isTheme())return!1;const t=this.package_info;return null!==(e=null==t?void 0:t.layerable)&&void 0!==e&&e}}t.ComponentItem=u},12740:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},80755:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43246:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentMutator=void 0;const r=n(87901),i=n(14584);class o extends i.DecryptedItemMutator{set package_info(e){this.mutableContent.package_info=e}set local_url(e){this.mutableContent.local_url=e}set hosted_url(e){this.mutableContent.hosted_url=e}set valid_until(e){this.mutableContent.valid_until=e}set permissions(e){this.mutableContent.permissions=e}set name(e){this.mutableContent.name=e}set offlineOnly(e){this.mutableContent.offlineOnly=e}associateWithItem(e){const t=this.mutableContent.associatedItemIds||[];(0,r.addIfUnique)(t,e),this.mutableContent.associatedItemIds=t}disassociateWithItem(e){const t=this.mutableContent.disassociatedItemIds||[];(0,r.addIfUnique)(t,e),this.mutableContent.disassociatedItemIds=t}removeAssociatedItemId(e){(0,r.removeFromArray)(this.mutableContent.associatedItemIds||[],e)}removeDisassociatedItemId(e){(0,r.removeFromArray)(this.mutableContent.disassociatedItemIds||[],e)}}t.ComponentMutator=o},78446:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},54218:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isComponentOrTheme=t.isTheme=t.isComponent=void 0;const r=n(50292),i=n(82648);t.isComponent=function(e){return!!(0,r.isDecryptedItem)(e)&&e.content_type===i.ContentType.TYPES.Component},t.isTheme=function(e){return!!(0,r.isDecryptedItem)(e)&&e.content_type===i.ContentType.TYPES.Theme},t.isComponentOrTheme=function(e){return!!(0,r.isDecryptedItem)(e)&&(e.content_type===i.ContentType.TYPES.Component||e.content_type===i.ContentType.TYPES.Theme)}},52659:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(35922),t),i(n(43246),t),i(n(12740),t),i(n(80755),t),i(n(78446),t),i(n(54218),t)},55159:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SNEditor=void 0;const r=n(43740);class i extends r.DecryptedItem{constructor(e){super(e),this.notes=[],this.data={},this.url=e.content.url,this.name=e.content.name,this.data=e.content.data||{},this.isDefault=e.content.default,this.systemEditor=e.content.systemEditor}}t.SNEditor=i},10123:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(55159),t)},73886:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SNFeatureRepo=void 0;const r=n(87901),i=n(43740);class o extends i.DecryptedItem{get migratedToUserSetting(){return(0,r.useBoolean)(this.payload.content.migratedToUserSetting,!1)}get migratedToOfflineEntitlements(){return(0,r.useBoolean)(this.payload.content.migratedToOfflineEntitlements,!1)}get onlineUrl(){return this.payload.content.url}get offlineFeaturesUrl(){return this.payload.content.offlineFeaturesUrl}get offlineKey(){return this.payload.content.offlineKey}}t.SNFeatureRepo=o},75299:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FeatureRepoMutator=void 0;const r=n(14584);class i extends r.DecryptedItemMutator{set migratedToUserSetting(e){this.mutableContent.migratedToUserSetting=e}set migratedToOfflineEntitlements(e){this.mutableContent.migratedToOfflineEntitlements=e}set offlineFeaturesUrl(e){this.mutableContent.offlineFeaturesUrl=e}set offlineKey(e){this.mutableContent.offlineKey=e}}t.FeatureRepoMutator=i},12310:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(73886),t),i(n(75299),t)},86154:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileItem=t.isFile=void 0;const r=n(82648),i=n(43740),o=n(50292);t.isFile=e=>e.content_type===r.ContentType.TYPES.File;class s extends i.DecryptedItem{constructor(e){super(e),this.remoteIdentifier=this.content.remoteIdentifier,this.name=this.content.name,this.key=this.content.key,this.content.size&&this.content.chunkSizes?(this.decryptedSize=this.content.size,this.encryptedChunkSizes=this.content.chunkSizes):(this.decryptedSize=this.content.decryptedSize,this.encryptedChunkSizes=this.content.encryptedChunkSizes),this.encryptionHeader=this.content.encryptionHeader,this.mimeType=this.content.mimeType}strategyWhenConflictingWithItem(e){return e.key!==this.key||e.encryptionHeader!==this.encryptionHeader||e.remoteIdentifier!==this.remoteIdentifier||JSON.stringify(e.encryptedChunkSizes)!==JSON.stringify(this.encryptedChunkSizes)?o.ConflictStrategy.KeepBaseDuplicateApply:o.ConflictStrategy.KeepBase}get encryptedSize(){return this.encryptedChunkSizes.reduce(((e,t)=>e+t),0)}get title(){return this.name}}t.FileItem=s},78037:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},82422:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileMutator=void 0;const r=n(82648),i=n(78961),o=n(14584);class s extends o.DecryptedItemMutator{set name(e){this.mutableContent.name=e}set encryptionHeader(e){this.mutableContent.encryptionHeader=e}addNote(e){const t={reference_type:i.ContentReferenceType.FileToNote,content_type:r.ContentType.TYPES.Note,uuid:e.uuid},n=this.mutableContent.references||[];n.push(t),this.mutableContent.references=n}removeNote(e){const t=this.immutableItem.references.filter((t=>t.uuid!==e.uuid));this.mutableContent.references=t}addFile(e){if(this.immutableItem.isReferencingItem(e))return;const t={uuid:e.uuid,content_type:r.ContentType.TYPES.File,reference_type:i.ContentReferenceType.FileToFile};this.mutableContent.references.push(t)}removeFile(e){this.mutableContent.references=this.mutableContent.references.filter((t=>t.uuid!==e.uuid))}}t.FileMutator=s},33447:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.FileProtocolV1Constants=void 0,function(e){e[e.KeySize=256]="KeySize"}(n||(t.FileProtocolV1Constants=n={}))},25698:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(86154),t),i(n(82422),t),i(n(78037),t),i(n(33447),t)},87500:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2836:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},52493:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},82412:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},23811:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},19725:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},82818:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeySystemRootKey=t.isKeySystemRootKey=void 0;const r=n(50292),i=n(82648);t.isKeySystemRootKey=function(e){return e.content_type===i.ContentType.TYPES.KeySystemRootKey};class o extends r.DecryptedItem{constructor(e){super(e),this.keyParams=e.content.keyParams,this.systemIdentifier=e.content.systemIdentifier,this.key=e.content.key,this.keyVersion=e.content.keyVersion,this.token=e.content.token}strategyWhenConflictingWithItem(e,t){const n=this.keyParams.creationTimestamp;return e.keyParams.creationTimestamp>n?r.ConflictStrategy.KeepApply:r.ConflictStrategy.KeepBase}get itemsKey(){return this.key}get key_system_identifier(){}get shared_vault_uuid(){}isEqual(e){return this.itemsKey===e.itemsKey&&this.token===e.token}}t.KeySystemRootKey=o},95132:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},31750:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},64836:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeySystemRootKeyMutator=void 0;const r=n(50292);class i extends r.DecryptedItemMutator{}t.KeySystemRootKeyMutator=i},28819:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.KeySystemRootKeyStorageMode=void 0,function(e){e.Synced="synced",e.Local="local",e.Ephemeral="ephemeral"}(n||(t.KeySystemRootKeyStorageMode=n={}))},2636:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SNNote=t.isNote=void 0;const r=n(68716),i=n(84409),o=n(43740),s=n(82648);t.isNote=e=>e.content_type===s.ContentType.TYPES.Note;class a extends o.DecryptedItem{constructor(e){super(e),this.hidePreview=!1,this.title=String(this.payload.content.title||""),this.text=String(this.payload.content.text||""),this.hidePreview=Boolean(this.payload.content.hidePreview),this.preview_plain=String(this.payload.content.preview_plain||""),this.preview_html=String(this.payload.content.preview_html||""),this.spellcheck=this.payload.content.spellcheck,this.editorWidth=this.payload.content.editorWidth,this.noteType=this.payload.content.noteType,this.editorIdentifier=this.payload.content.editorIdentifier,this.authorizedForListed=this.payload.content.authorizedForListed||!1,this.noteType||this.getAppDomainValueWithDefault(r.AppDataField.LegacyPrefersPlainEditor,!1)&&(this.noteType=i.NoteType.Plain)}}t.SNNote=a},38856:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},39273:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoteMutator=void 0;const r=n(14584),i=n(50292),o=n(82648);class s extends r.DecryptedItemMutator{set title(e){this.mutableContent.title=e}set text(e){this.mutableContent.text=e}set hidePreview(e){this.mutableContent.hidePreview=e}set preview_plain(e){this.mutableContent.preview_plain=e}set preview_html(e){this.mutableContent.preview_html=e}set spellcheck(e){this.mutableContent.spellcheck=e}set editorWidth(e){this.mutableContent.editorWidth=e}set noteType(e){this.mutableContent.noteType=e}set editorIdentifier(e){this.mutableContent.editorIdentifier=e}set authorizedForListed(e){this.mutableContent.authorizedForListed=e}toggleSpellcheck(){null==this.mutableContent.spellcheck?this.mutableContent.spellcheck=!1:this.mutableContent.spellcheck=!this.mutableContent.spellcheck}addNote(e){if(this.immutableItem.isReferencingItem(e))return;const t={uuid:e.uuid,content_type:o.ContentType.TYPES.Note,reference_type:i.ContentReferenceType.NoteToNote};this.mutableContent.references.push(t)}removeNote(e){this.mutableContent.references=this.mutableContent.references.filter((t=>t.uuid!==e.uuid))}}t.NoteMutator=s},42006:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(2636),t),i(n(39273),t),i(n(38856),t)},12775:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmartView=t.isSmartView=t.isSystemView=t.SMART_TAG_DSL_PREFIX=void 0;const r=n(82648),i=n(43740),o=n(26550),s=n(78748),a=n(47899);function l(e){return Object.values(s.SystemViewId).includes(e.uuid)}t.SMART_TAG_DSL_PREFIX="![",t.isSystemView=l,t.isSmartView=e=>e.content_type===r.ContentType.TYPES.SmartView;class c extends i.DecryptedItem{constructor(e){super(e),this.title=String(this.content.title||""),l(this)?this.iconString=(0,a.systemViewIcon)(this.uuid):this.iconString=this.payload.content.iconString||a.SmartViewDefaultIconName,this.preferences=this.payload.content.preferences;try{this.predicate=this.content.predicate&&(0,o.predicateFromJson)(this.content.predicate)}catch(e){console.error(e)}}}t.SmartView=c},11070:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BuildSmartViews=void 0;const r=n(89262),i=n(12775),o=n(78748),s=n(42405),a=n(78688),l=n(8698),c=n(59180),u=n(82648);function d(e){const t=[new a.Predicate("content_type","=",u.ContentType.TYPES.Note)];return!1===e.includeTrashed&&t.push(new a.Predicate("trashed","=",!1)),!1===e.includeArchived&&t.push(new a.Predicate("archived","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}function h(e){const t=[new a.Predicate("content_type","=",u.ContentType.TYPES.File)];return!1===e.includeTrashed&&t.push(new a.Predicate("trashed","=",!1)),!1===e.includeArchived&&t.push(new a.Predicate("archived","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}function p(e){const t=[new a.Predicate("archived","=",!0),new a.Predicate("content_type","=",u.ContentType.TYPES.Note)];return!1===e.includeTrashed&&t.push(new a.Predicate("trashed","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}function f(e){const t=[new a.Predicate("trashed","=",!0),new a.Predicate("content_type","=",u.ContentType.TYPES.Note)];return!1===e.includeArchived&&t.push(new a.Predicate("archived","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}function g(e){const t=[new a.Predicate("content_type","=",u.ContentType.TYPES.Note),new a.Predicate("tagsCount","=",0)];return!1===e.includeArchived&&t.push(new a.Predicate("archived","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}function m(e){const t=[new a.Predicate("starred","=",!0),new a.Predicate("content_type","=",u.ContentType.TYPES.Note)];return!1===e.includeTrashed&&t.push(new a.Predicate("trashed","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}function y(e){const t=[new a.Predicate("content_type","=",u.ContentType.TYPES.Note)];return!1===e.includeTrashed&&t.push(new a.Predicate("trashed","=",!1)),!1===e.includeArchived&&t.push(new a.Predicate("archived","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}t.BuildSmartViews=function(e){const t=new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.AllNotes,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Notes",predicate:d(e).toJson()})}))),n=new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.Files,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Files",predicate:h(e).toJson()})}))),a=new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.ArchivedNotes,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Archived",predicate:p(e).toJson()})}))),l=new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.TrashedNotes,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Trash",predicate:f(e).toJson()})}))),v=new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.UntaggedNotes,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Untagged",predicate:g(e).toJson()})})));return[t,n,new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.StarredNotes,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Starred",predicate:m(e).toJson()})}))),a,l,v,new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.Conflicts,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Conflicts",predicate:y(e).toJson()})})))]}},50986:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},47899:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmartViewDefaultIconName=t.systemViewIcon=t.SmartViewIcons=void 0;const r=n(78748);t.SmartViewIcons={[r.SystemViewId.AllNotes]:"notes",[r.SystemViewId.Files]:"folder",[r.SystemViewId.ArchivedNotes]:"archive",[r.SystemViewId.TrashedNotes]:"trash",[r.SystemViewId.UntaggedNotes]:"hashtag-off",[r.SystemViewId.StarredNotes]:"star-filled",[r.SystemViewId.Conflicts]:"merge"},t.systemViewIcon=function(e){return t.SmartViewIcons[e]},t.SmartViewDefaultIconName="restore"},54196:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmartViewMutator=void 0;const r=n(87458);class i extends r.TagMutator{constructor(e,t){super(e,t)}set predicate(e){this.mutableContent.predicate=e}}t.SmartViewMutator=i},78748:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SystemViewId=void 0,function(e){e.AllNotes="all-notes",e.Files="files",e.ArchivedNotes="archived-notes",e.TrashedNotes="trashed-notes",e.UntaggedNotes="untagged-notes",e.StarredNotes="starred-notes",e.Conflicts="conflicts"}(n||(t.SystemViewId=n={}))},41138:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(12775),t),i(n(11070),t),i(n(78748),t),i(n(50986),t),i(n(54196),t),i(n(47899),t)},4862:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SNTag=t.isTag=t.DefaultTagIconName=t.TagFolderDelimitter=void 0;const r=n(43740),i=n(4744),o=n(82648);t.TagFolderDelimitter=".",t.DefaultTagIconName="hashtag",t.isTag=e=>e.content_type===o.ContentType.TYPES.Tag;class s extends r.DecryptedItem{constructor(e){super(e),this.title=this.payload.content.title||"",this.expanded=null==this.payload.content.expanded||this.payload.content.expanded,this.iconString=this.payload.content.iconString||t.DefaultTagIconName,this.preferences=this.payload.content.preferences}get isDailyEntry(){var e;return"daily"===(null===(e=this.preferences)||void 0===e?void 0:e.entryMode)}get noteReferences(){return this.payload.references.filter((e=>e.content_type===o.ContentType.TYPES.Note))}get noteCount(){return this.noteReferences.length}get parentId(){const e=this.references.find(i.isTagToParentTagReference);return null==e?void 0:e.uuid}static arrayToDisplayString(e){return e.sort(((e,t)=>e.title>t.title?1:-1)).map((e=>"#"+e.title)).join(" ")}}t.SNTag=s},33913:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},74332:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TagMutator=void 0;const r=n(4744),i=n(78961),o=n(14584),s=n(82648);class a extends o.DecryptedItemMutator{constructor(e,t){super(e,t),this.mutablePreferences=this.mutableContent.preferences}set title(e){this.mutableContent.title=e}set expanded(e){this.mutableContent.expanded=e}set iconString(e){this.mutableContent.iconString=e}get preferences(){return this.mutablePreferences||(this.mutableContent.preferences={},this.mutablePreferences=this.mutableContent.preferences),this.mutablePreferences}set preferences(e){this.mutablePreferences=e,this.mutableContent.preferences=this.mutablePreferences}makeChildOf(e){const t=this.immutableItem.references.filter((e=>!(0,r.isTagToParentTagReference)(e))),n={reference_type:i.ContentReferenceType.TagToParentTag,content_type:s.ContentType.TYPES.Tag,uuid:e.uuid};t.push(n),this.mutableContent.references=t}unsetParent(){this.mutableContent.references=this.immutableItem.references.filter((e=>!(0,r.isTagToParentTagReference)(e)))}addFile(e){if(this.immutableItem.isReferencingItem(e))return;const t={reference_type:i.ContentReferenceType.TagToFile,content_type:s.ContentType.TYPES.File,uuid:e.uuid};this.mutableContent.references.push(t)}removeFile(e){this.mutableContent.references=this.mutableContent.references.filter((t=>t.uuid!==e.uuid))}addNote(e){this.immutableItem.isReferencingItem(e)||this.mutableContent.references.push({uuid:e.uuid,content_type:e.content_type})}removeNote(e){this.mutableContent.references=this.mutableContent.references.filter((t=>t.uuid!==e.uuid))}}t.TagMutator=a},72680:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},87458:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(4862),t),i(n(74332),t),i(n(33913),t),i(n(72680),t)},82602:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},63195:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TrustedContactMutator=void 0;const r=n(50292),i=n(68092);class o extends r.DecryptedItemMutator{set name(e){this.mutableContent.name=e}addPublicKey(e){const t=new i.ContactPublicKeySet({encryption:e.encryption,signing:e.signing,timestamp:new Date,previousKeySet:this.immutableItem.publicKeySet});this.mutableContent.publicKeySet=t}replacePublicKeySet(e){this.mutableContent.publicKeySet=e}}t.TrustedContactMutator=o},68092:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContactPublicKeySet=void 0;class n{constructor(e){this.encryption=e.encryption,this.signing=e.signing,this.timestamp=e.timestamp,this.previousKeySet=e.previousKeySet}findKeySetWithSigningKey(e){return this.signing===e?this:this.previousKeySet?this.previousKeySet.findKeySetWithSigningKey(e):void 0}findKeySetWithPublicKey(e){return this.encryption===e?this:this.previousKeySet?this.previousKeySet.findKeySetWithPublicKey(e):void 0}asJson(){return{encryption:this.encryption,signing:this.signing,timestamp:this.timestamp,previousKeySet:this.previousKeySet?this.previousKeySet.asJson():void 0}}mutableCopy(){return new n({encryption:this.encryption,signing:this.signing,timestamp:this.timestamp,previousKeySet:this.previousKeySet?n.FromJson(this.previousKeySet.asJson()):void 0})}static FromJson(e){return new n({encryption:e.encryption,signing:e.signing,timestamp:new Date(e.timestamp),previousKeySet:e.previousKeySet?n.FromJson(e.previousKeySet):void 0})}}t.ContactPublicKeySet=n},21436:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},79609:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TrustedContact=void 0;const r=n(50292),i=n(68092),o=n(78688),s=n(19332);class a extends r.DecryptedItem{constructor(e){super(e),this.name=e.content.name,this.contactUuid=e.content.contactUuid,this.publicKeySet=i.ContactPublicKeySet.FromJson(e.content.publicKeySet),this.isMe=e.content.isMe}get isSingleton(){return!0}singletonPredicate(){return a.singletonPredicate}hasCurrentOrPreviousSigningPublicKey(e){return void 0!==this.publicKeySet.findKeySetWithSigningKey(e)}getTrustStatusForPublicKey(e){return this.publicKeySet.encryption===e?s.PublicKeyTrustStatus.Trusted:this.publicKeySet.findKeySetWithPublicKey(e)?s.PublicKeyTrustStatus.Previous:s.PublicKeyTrustStatus.NotTrusted}getTrustStatusForSigningPublicKey(e){return this.publicKeySet.signing===e?s.PublicKeyTrustStatus.Trusted:this.publicKeySet.findKeySetWithSigningKey(e)?s.PublicKeyTrustStatus.Previous:s.PublicKeyTrustStatus.NotTrusted}strategyWhenConflictingWithItem(e,t){return r.ConflictStrategy.KeepBase}}t.TrustedContact=a,a.singletonPredicate=new o.Predicate("isMe","=",!0)},15845:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5478:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},19332:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PublicKeyTrustStatus=void 0,function(e){e.Trusted="Trusted",e.Previous="Previous",e.NotTrusted="NotTrusted"}(n||(t.PublicKeyTrustStatus=n={}))},79319:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},68933:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EditorFontSize=void 0,function(e){e.ExtraSmall="ExtraSmall",e.Small="Small",e.Normal="Normal",e.Medium="Medium",e.Large="Large"}(n||(t.EditorFontSize=n={}))},97876:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EditorLineHeightValues=t.EditorLineHeight=void 0,function(e){e.None="None",e.Tight="Tight",e.Snug="Snug",e.Normal="Normal",e.Relaxed="Relaxed",e.Loose="Loose"}(n||(t.EditorLineHeight=n={})),t.EditorLineHeightValues={None:1,Tight:1.25,Snug:1.375,Normal:1.5,Relaxed:1.625,Loose:2}},20610:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EditorLineWidth=void 0,function(e){e.Narrow="Narrow",e.Wide="Wide",e.Dynamic="Dynamic",e.FullWidth="FullWidth"}(n||(t.EditorLineWidth=n={}))},23688:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.NewNoteTitleFormat=void 0,function(e){e.CurrentDateAndTime="CurrentDateAndTime",e.CurrentNoteCount="CurrentNoteCount",e.CustomFormat="CustomFormat",e.Empty="Empty"}(n||(t.NewNoteTitleFormat=n={}))},68126:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PrefDefaults=void 0;const r=n(84409),i=n(92207),o=n(68933),s=n(97876),a=n(20610),l=n(70659),c=n(23688);t.PrefDefaults={[l.PrefKey.TagsPanelWidth]:220,[l.PrefKey.NotesPanelWidth]:350,[l.PrefKey.EditorWidth]:null,[l.PrefKey.EditorLeft]:null,[l.PrefKey.DEPRECATED_EditorMonospaceEnabled]:!1,[l.PrefKey.EditorSpellcheck]:!0,[l.PrefKey.EditorResizersEnabled]:!1,[l.PrefKey.DEPRECATED_EditorLineHeight]:s.EditorLineHeight.Normal,[l.PrefKey.DEPRECATED_EditorLineWidth]:a.EditorLineWidth.FullWidth,[l.PrefKey.DEPRECATED_EditorFontSize]:o.EditorFontSize.Normal,[l.PrefKey.SortNotesBy]:i.CollectionSort.CreatedAt,[l.PrefKey.SortNotesReverse]:!1,[l.PrefKey.NotesShowArchived]:!1,[l.PrefKey.NotesShowTrashed]:!1,[l.PrefKey.NotesHidePinned]:!1,[l.PrefKey.NotesHideProtected]:!1,[l.PrefKey.NotesHideNotePreview]:!1,[l.PrefKey.NotesHideDate]:!1,[l.PrefKey.NotesHideTags]:!1,[l.PrefKey.NotesHideEditorIcon]:!1,[l.PrefKey.DEPRECATED_UseSystemColorScheme]:!1,[l.PrefKey.DEPRECATED_UseTranslucentUI]:!0,[l.PrefKey.DEPRECATED_AutoLightThemeIdentifier]:"Default",[l.PrefKey.DEPRECATED_AutoDarkThemeIdentifier]:r.NativeFeatureIdentifier.TYPES.DarkTheme,[l.PrefKey.NoteAddToParentFolders]:!0,[l.PrefKey.NewNoteTitleFormat]:c.NewNoteTitleFormat.CurrentDateAndTime,[l.PrefKey.CustomNoteTitleFormat]:"YYYY-MM-DD [at] hh:mm A",[l.PrefKey.UpdateSavingStatusIndicator]:!0,[l.PrefKey.PaneGesturesEnabled]:!0,[l.PrefKey.MomentsDefaultTagUuid]:void 0,[l.PrefKey.ClipperDefaultTagUuid]:void 0,[l.PrefKey.DefaultEditorIdentifier]:r.NativeFeatureIdentifier.TYPES.PlainEditor,[l.PrefKey.SuperNoteExportFormat]:"json",[l.PrefKey.SuperNoteExportEmbedBehavior]:"reference",[l.PrefKey.SuperNoteExportUseMDFrontmatter]:!0,[l.PrefKey.SuperNoteExportPDFPageSize]:"A4",[l.PrefKey.SystemViewPreferences]:{},[l.PrefKey.AuthenticatorNames]:"",[l.PrefKey.ComponentPreferences]:{},[l.PrefKey.DEPRECATED_ActiveThemes]:[],[l.PrefKey.ActiveComponents]:[],[l.PrefKey.AlwaysShowSuperToolbar]:!0,[l.PrefKey.AddImportsToTag]:!0,[l.PrefKey.AlwaysCreateNewTagForImports]:!0,[l.PrefKey.ExistingTagForImports]:void 0}},70659:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PrefKey=void 0,function(e){e.TagsPanelWidth="tagsPanelWidth",e.NotesPanelWidth="notesPanelWidth",e.EditorWidth="editorWidth",e.EditorLeft="editorLeft",e.EditorSpellcheck="spellcheck",e.EditorResizersEnabled="marginResizersEnabled",e.SortNotesBy="sortBy",e.SortNotesReverse="sortReverse",e.NotesShowArchived="showArchived",e.NotesShowTrashed="showTrashed",e.NotesHideProtected="hideProtected",e.NotesHidePinned="hidePinned",e.NotesHideNotePreview="hideNotePreview",e.NotesHideDate="hideDate",e.NotesHideTags="hideTags",e.NotesHideEditorIcon="hideEditorIcon",e.NoteAddToParentFolders="noteAddToParentFolders",e.NewNoteTitleFormat="newNoteTitleFormat",e.CustomNoteTitleFormat="customNoteTitleFormat",e.UpdateSavingStatusIndicator="updateSavingStatusIndicator",e.DefaultEditorIdentifier="defaultEditorIdentifier",e.MomentsDefaultTagUuid="momentsDefaultTagUuid",e.ClipperDefaultTagUuid="clipperDefaultTagUuid",e.SystemViewPreferences="systemViewPreferences",e.SuperNoteExportFormat="superNoteExportFormat",e.SuperNoteExportEmbedBehavior="superNoteExportEmbedBehavior",e.SuperNoteExportUseMDFrontmatter="superNoteExportUseMDFrontmatter",e.SuperNoteExportPDFPageSize="superNoteExportPDFPageSize",e.AuthenticatorNames="authenticatorNames",e.PaneGesturesEnabled="paneGesturesEnabled",e.ComponentPreferences="componentPreferences",e.ActiveComponents="activeComponents",e.AlwaysShowSuperToolbar="alwaysShowSuperToolbar",e.AddImportsToTag="addImportsToTag",e.AlwaysCreateNewTagForImports="alwaysCreateNewTagForImports",e.ExistingTagForImports="existingTagForImports",e.DEPRECATED_ActiveThemes="activeThemes",e.DEPRECATED_UseSystemColorScheme="useSystemColorScheme",e.DEPRECATED_UseTranslucentUI="useTranslucentUI",e.DEPRECATED_AutoLightThemeIdentifier="autoLightThemeIdentifier",e.DEPRECATED_AutoDarkThemeIdentifier="autoDarkThemeIdentifier",e.DEPRECATED_EditorMonospaceEnabled="monospaceFont",e.DEPRECATED_EditorLineHeight="editorLineHeight",e.DEPRECATED_EditorLineWidth="editorLineWidth",e.DEPRECATED_EditorFontSize="editorFontSize"}(n||(t.PrefKey=n={}))},87070:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SNUserPrefs=void 0;const r=n(82648),i=n(43740),o=n(78688);class s extends i.DecryptedItem{get isSingleton(){return!0}singletonPredicate(){return s.singletonPredicate}getPref(e){return this.getAppDomainValue(e)}}t.SNUserPrefs=s,s.singletonPredicate=new o.Predicate("content_type","=",r.ContentType.TYPES.UserPrefs)},34660:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserPrefsMutator=void 0;const r=n(14584);class i extends r.DecryptedItemMutator{setPref(e,t){this.setAppDataItem(e,t)}}t.UserPrefsMutator=i},53840:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(87070),t),i(n(34660),t),i(n(70659),t),i(n(97876),t),i(n(68933),t),i(n(20610),t),i(n(23688),t),i(n(79319),t),i(n(68126),t)},3396:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VaultListing=t.DefaultVaultIconName=void 0;const r=n(50292);t.DefaultVaultIconName="safe-square";class i extends r.DecryptedItem{constructor(e){super(e),this.systemIdentifier=e.content.systemIdentifier,this.rootKeyParams=e.content.rootKeyParams,this.keyStorageMode=e.content.keyStorageMode,this.name=e.content.name,this.description=e.content.description,this.iconString=e.content.iconString||t.DefaultVaultIconName,this.sharing=e.content.sharing}strategyWhenConflictingWithItem(e,t){const n=this.rootKeyParams.creationTimestamp;return e.rootKeyParams.creationTimestamp>n?r.ConflictStrategy.KeepApply:r.ConflictStrategy.KeepBase}get keyPasswordType(){return this.rootKeyParams.passwordType}isSharedVaultListing(){return null!=this.sharing}get key_system_identifier(){}get shared_vault_uuid(){}}t.VaultListing=i},52897:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},59402:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},82259:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VaultListingMutator=void 0;const r=n(50292);class i extends r.DecryptedItemMutator{set name(e){this.mutableContent.name=e}set description(e){this.mutableContent.description=e}set iconString(e){this.mutableContent.iconString=e}set sharing(e){this.mutableContent.sharing=e}set rootKeyParams(e){this.mutableContent.rootKeyParams=e}set keyStorageMode(e){this.mutableContent.keyStorageMode=e}}t.VaultListingMutator=i},44957:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},53555:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},40249:(e,t)=>{"use strict";function n(e,t){return e.find((e=>e.uuid===t))}Object.defineProperty(t,"__esModule",{value:!0}),t.SureFindItem=t.FindItem=void 0,t.FindItem=n,t.SureFindItem=function(e,t){return n(e,t)}},33545:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ItemContentsDiffer=void 0;const r=n(41035);t.ItemContentsDiffer=function(e,t,n=[]){return!(0,r.ItemContentsEqual)(e.content,t.content,[...e.contentKeysToIgnoreWhenCheckingEquality(),...n],e.appDataContentKeysToIgnoreWhenCheckingEquality())}},41035:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ItemContentsEqual=void 0;const r=n(87901),i=n(71458);t.ItemContentsEqual=function(e,t,n,o){const s=(0,r.sortedCopy)(e);if(s.appData){const e=s.appData[i.DefaultAppDomain];(0,r.omitInPlace)(e,o),e?0===Object.keys(e).length&&delete s.appData:delete s.appData}(0,r.omitInPlace)(s,n);const a=(0,r.sortedCopy)(t);if(a.appData){const e=a.appData[i.DefaultAppDomain];(0,r.omitInPlace)(e,o),e?0===Object.keys(e).length&&delete a.appData:delete a.appData}return(0,r.omitInPlace)(a,n),JSON.stringify(s)===JSON.stringify(a)}},73277:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreateItemFromPayload=t.CreateDecryptedItemFromPayload=t.RegisterItemClass=t.CreateDecryptedMutatorForItem=void 0;const r=n(80406),i=n(86154),o=n(73886),s=n(59020),a=n(35922),l=n(55159),c=n(43740),u=n(2636),d=n(12775),h=n(4862),p=n(87070),f=n(82422),g=n(34660),m=n(27539),y=n(43246),v=n(74332),A=n(39273),b=n(14584),w=n(78438),S=n(41138),C=n(79609),E=n(63195),I=n(82818),_=n(64836),x=n(3396),P=n(82259),k=n(59180),B=n(82648),O={[B.ContentType.TYPES.ActionsExtension]:{itemClass:s.SNActionsExtension,mutatorClass:m.ActionsExtensionMutator},[B.ContentType.TYPES.Component]:{itemClass:a.ComponentItem,mutatorClass:y.ComponentMutator},[B.ContentType.TYPES.KeySystemRootKey]:{itemClass:I.KeySystemRootKey,mutatorClass:_.KeySystemRootKeyMutator},[B.ContentType.TYPES.TrustedContact]:{itemClass:C.TrustedContact,mutatorClass:E.TrustedContactMutator},[B.ContentType.TYPES.VaultListing]:{itemClass:x.VaultListing,mutatorClass:P.VaultListingMutator},[B.ContentType.TYPES.Editor]:{itemClass:l.SNEditor},[B.ContentType.TYPES.ExtensionRepo]:{itemClass:o.SNFeatureRepo},[B.ContentType.TYPES.File]:{itemClass:i.FileItem,mutatorClass:f.FileMutator},[B.ContentType.TYPES.Note]:{itemClass:u.SNNote,mutatorClass:A.NoteMutator},[B.ContentType.TYPES.SmartView]:{itemClass:d.SmartView,mutatorClass:S.SmartViewMutator},[B.ContentType.TYPES.Tag]:{itemClass:h.SNTag,mutatorClass:v.TagMutator},[B.ContentType.TYPES.Theme]:{itemClass:a.ComponentItem,mutatorClass:y.ComponentMutator},[B.ContentType.TYPES.UserPrefs]:{itemClass:p.SNUserPrefs,mutatorClass:g.UserPrefsMutator}};function N(e){const t=O[e.content_type];return new(t?t.itemClass:c.DecryptedItem)(e)}t.CreateDecryptedMutatorForItem=function(e,t){var n;const r=null===(n=O[e.content_type])||void 0===n?void 0:n.mutatorClass;return r?new r(e,t):new b.DecryptedItemMutator(e,t)},t.RegisterItemClass=function(e,t,n){const r={itemClass:t,mutatorClass:n};O[e]=r},t.CreateDecryptedItemFromPayload=N,t.CreateItemFromPayload=function(e){if((0,k.isDecryptedPayload)(e))return N(e);if((0,k.isEncryptedPayload)(e))return new r.EncryptedItem(e);if((0,k.isDeletedPayload)(e))return new w.DeletedItem(e);throw Error("Unhandled case in CreateItemFromPayload")}},74527:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopyPayloadWithContentOverride=void 0;const r=n(88141);t.CopyPayloadWithContentOverride=function(e,t){const n=Object.assign(Object.assign({},e.ejected()),{content:Object.assign(Object.assign({},e.content),t)});return(0,r.CreatePayload)(n,e.source)}},88141:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreatePayload=void 0;const r=n(86731),i=n(452),o=n(89262),s=n(78381);t.CreatePayload=function(e,t){if((0,s.isDecryptedTransferPayload)(e))return new o.DecryptedPayload(e,t);if((0,s.isEncryptedTransferPayload)(e))return new r.EncryptedPayload(e,t);if((0,s.isDeletedTransferPayload)(e))return new i.DeletedPayload(e,t);throw Error("Unhandled case in CreatePayload")}},15658:(e,t)=>{"use strict";function n(e,t){return e.find((e=>e.uuid===t))}Object.defineProperty(t,"__esModule",{value:!0}),t.SureFindPayload=t.FindPayload=void 0,t.FindPayload=n,t.SureFindPayload=function(e,t){return n(e,t)}},37807:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadContentsEqual=void 0;const r=n(73277);t.PayloadContentsEqual=function(e,t){const n=(0,r.CreateDecryptedItemFromPayload)(e),i=(0,r.CreateDecryptedItemFromPayload)(t);return n.isItemContentEqualWith(i)}},50723:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreateNonDecryptedPayloadSplit=t.CreatePayloadSplitWithDiscardables=t.CreatePayloadSplit=void 0;const r=n(13566);t.CreatePayloadSplit=function(e){const t={encrypted:[],decrypted:[],deleted:[]};for(const n of e)if((0,r.isDecryptedPayload)(n))t.decrypted.push(n);else if((0,r.isEncryptedPayload)(n))t.encrypted.push(n);else{if(!(0,r.isDeletedPayload)(n))throw Error("Unhandled case in CreatePayloadSplit");t.deleted.push(n)}return t},t.CreatePayloadSplitWithDiscardables=function(e){const t={encrypted:[],decrypted:[],deleted:[],discardable:[]};for(const n of e)if((0,r.isDecryptedPayload)(n))t.decrypted.push(n);else if((0,r.isEncryptedPayload)(n))t.encrypted.push(n);else{if(!(0,r.isDeletedPayload)(n))throw Error("Unhandled case in CreatePayloadSplitWithDiscardables");n.discardable?t.discardable.push(n):t.deleted.push(n)}return t},t.CreateNonDecryptedPayloadSplit=function(e){const t={encrypted:[],deleted:[]};for(const n of e)if((0,r.isEncryptedPayload)(n))t.encrypted.push(n);else{if(!(0,r.isDeletedPayload)(n))throw Error("Unhandled case in CreateNonDecryptedPayloadSplit");t.deleted.push(n)}return t}},15005:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadsByAlternatingUuid=void 0;const r=n(452),i=n(87901),o=n(13566),s=n(72208),a=n(13743),l=n(82648);t.PayloadsByAlternatingUuid=function(e,t){const n=[],c=e.copyAsSyncResolved({uuid:i.UuidGenerator.GenerateUuid(),dirty:!0,dirtyIndex:(0,a.getIncrementedDirtyIndex)(),lastSyncBegan:void 0,lastSyncEnd:new Date,duplicate_of:e.uuid});n.push(c);const u=(0,s.PayloadsByUpdatingReferencingPayloadReferences)(e,t,[c],[e.uuid]);if((0,i.extendArray)(n,u),e.content_type===l.ContentType.TYPES.ItemsKey){const r=t.all().filter((t=>(0,o.isEncryptedPayload)(t)&&t.items_key_id===e.uuid)).map((e=>e.copyAsSyncResolved({items_key_id:c.uuid,dirty:!0,dirtyIndex:(0,a.getIncrementedDirtyIndex)(),lastSyncEnd:new Date})));r.length>0&&(0,i.extendArray)(n,r)}const d=new r.DeletedPayload({created_at:e.created_at,updated_at:e.updated_at,created_at_timestamp:e.created_at_timestamp,updated_at_timestamp:e.updated_at_timestamp,dirty:!1,content:void 0,uuid:e.uuid,content_type:e.content_type,deleted:!0},e.source);return n.push(d),n}},27446:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadsByDuplicating=void 0;const r=n(87901),i=n(72208),o=n(13566),s=n(13743);t.PayloadsByDuplicating=function(e){const{payload:t,baseCollection:n,isConflict:a,additionalContent:l,source:c}=e,u=[],d={uuid:r.UuidGenerator.GenerateUuid(),dirty:!0,dirtyIndex:(0,s.getIncrementedDirtyIndex)(),lastSyncBegan:void 0,lastSyncEnd:new Date,duplicate_of:t.uuid};let h;if((0,o.isDecryptedPayload)(t)){const e=Object.assign(Object.assign({},t.content),l);a&&(e.conflict_of=t.uuid),h=t.copyAsSyncResolved(Object.assign(Object.assign({},d),{content:e,deleted:!1}))}else h=t.copyAsSyncResolved(Object.assign({},d),c||t.source);if(u.push(h),(0,o.isDecryptedPayload)(t)&&(0,o.isDecryptedPayload)(h)){const e=(0,i.PayloadsByUpdatingReferencingPayloadReferences)(t,n,[h]);(0,r.extendArray)(u,e)}return u}},72208:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadsByUpdatingReferencingPayloadReferences=void 0;const r=n(76635),i=n(59180),o=n(13743);t.PayloadsByUpdatingReferencingPayloadReferences=function(e,t,n=[],s=[]){const a=t.elementsReferencingElement(e).filter(i.isDecryptedPayload),l=[];for(const t of a){const i=t.content.references.slice(),a=t.getReference(e.uuid);for(const e of n){const t=Object.assign(Object.assign({},a),{uuid:e.uuid,content_type:e.content_type});i.push(t)}for(const e of s)(0,r.remove)(i,{uuid:e});const c=t.copyAsSyncResolved({dirty:!0,dirtyIndex:(0,o.getIncrementedDirtyIndex)(),lastSyncEnd:new Date,content:Object.assign(Object.assign({},t.content),{references:i})});l.push(c)}return l}},64475:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(56974),t),i(n(15866),t),i(n(35376),t),i(n(76317),t),i(n(88076),t),i(n(68763),t),i(n(75895),t),i(n(74601),t),i(n(3668),t),i(n(42405),t),i(n(95698),t),i(n(55930),t),i(n(36186),t),i(n(80537),t),i(n(1482),t),i(n(69087),t),i(n(70359),t),i(n(13214),t),i(n(84034),t),i(n(51600),t),i(n(30429),t),i(n(18592),t),i(n(2116),t),i(n(18973),t),i(n(7563),t),i(n(50292),t),i(n(59180),t),i(n(78381),t),i(n(21907),t),i(n(66675),t),i(n(90656),t),i(n(93715),t),i(n(84457),t),i(n(656),t),i(n(255),t),i(n(62846),t),i(n(29899),t),i(n(22296),t),i(n(52174),t),i(n(80910),t),i(n(87192),t),i(n(71109),t),i(n(32099),t),i(n(55430),t),i(n(33738),t),i(n(64130),t),i(n(18018),t),i(n(14770),t),i(n(45698),t),i(n(63070),t),i(n(32151),t),i(n(92207),t),i(n(36883),t),i(n(17441),t),i(n(51833),t),i(n(19759),t),i(n(22517),t),i(n(13743),t),i(n(30561),t),i(n(40257),t),i(n(93974),t),i(n(96084),t),i(n(87332),t),i(n(21662),t),i(n(47469),t),i(n(74958),t),i(n(36053),t),i(n(18284),t),i(n(78274),t),i(n(47479),t),i(n(21626),t),i(n(8698),t),i(n(26550),t),i(n(80389),t),i(n(21271),t),i(n(21271),t),i(n(73067),t),i(n(21014),t),i(n(78688),t),i(n(58506),t),i(n(40826),t),i(n(52659),t),i(n(10123),t),i(n(12310),t),i(n(25698),t),i(n(87500),t),i(n(2836),t),i(n(52493),t),i(n(82412),t),i(n(23811),t),i(n(19725),t),i(n(82818),t),i(n(95132),t),i(n(31750),t),i(n(64836),t),i(n(28819),t),i(n(42006),t),i(n(41138),t),i(n(87458),t),i(n(82602),t),i(n(63195),t),i(n(68092),t),i(n(21436),t),i(n(79609),t),i(n(15845),t),i(n(5478),t),i(n(19332),t),i(n(53840),t),i(n(3396),t),i(n(52897),t),i(n(59402),t),i(n(82259),t),i(n(44957),t),i(n(53555),t),i(n(40249),t),i(n(33545),t),i(n(41035),t),i(n(73277),t),i(n(74527),t),i(n(88141),t),i(n(15658),t),i(n(37807),t),i(n(15005),t),i(n(27446),t),i(n(50723),t)},22325:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(64475),t)},34789:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},88645:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},29590:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},77345:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},79594:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},81563:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},29547:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},89398:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},41278:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},48126:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},60346:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},39881:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},11706:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},74113:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},68224:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},14116:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},22893:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},94764:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isClientDisplayableError=t.ClientDisplayableError=void 0;const r=n(92961);class i{constructor(e,t,n){this.text=e,this.title=t,this.tag=n,console.error("Client Displayable Error:",e,t||"",n||"")}static FromError(e){return new i(e.message,void 0,e.tag)}static FromString(e){return new i(e)}static FromNetworkError(e){return new i((0,r.getErrorFromErrorResponse)(e).message)}}t.ClientDisplayableError=i,t.isClientDisplayableError=function(e){return e instanceof i}},89408:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},23632:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},37525:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},22039:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43129:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},27196:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43630:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},53980:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},46707:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},13838:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},95573:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},42338:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},32176:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DeprecatedStatusCode=void 0,function(e){e[e.LocalValidationError=10]="LocalValidationError",e[e.CanceledMfa=11]="CanceledMfa",e[e.HttpStatusMinSuccess=200]="HttpStatusMinSuccess",e[e.HttpStatusNoContent=204]="HttpStatusNoContent",e[e.HttpStatusMaxSuccess=299]="HttpStatusMaxSuccess",e[e.HttpStatusExpiredAccessToken=498]="HttpStatusExpiredAccessToken",e[e.HttpStatusInvalidSession=401]="HttpStatusInvalidSession",e[e.HttpStatusForbidden=403]="HttpStatusForbidden",e[e.HttpBadRequest=400]="HttpBadRequest"}(n||(t.DeprecatedStatusCode=n={}))},67545:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorTag=void 0,function(e){e.MfaInvalid="mfa-invalid",e.MfaRequired="mfa-required",e.U2FRequired="u2f-required",e.RefreshTokenInvalid="invalid-refresh-token",e.RefreshTokenExpired="expired-refresh-token",e.AccessTokenExpired="expired-access-token",e.ParametersInvalid="invalid-parameters",e.RevokedSession="revoked-session",e.AuthInvalid="invalid-auth",e.ReadOnlyAccess="read-only-access",e.ExpiredItemShare="expired-item-share",e.ClientValidationError="client-validation-error",e.ClientCanceledMfa="client-canceled-mfa"}(n||(t.ErrorTag=n={}))},64404:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},48379:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},11910:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},44323:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},53251:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},23269:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorFromErrorResponse=t.getErrorMessageFromErrorResponseBody=t.getCaptchaHeader=t.isErrorResponse=void 0,t.isErrorResponse=function(e){var t;return null!=(null===(t=e.data)||void 0===t?void 0:t.error)||e.status>=400},t.getCaptchaHeader=function(e){var t;return(null===(t=e.headers)||void 0===t?void 0:t.get("x-captcha-required"))||null},t.getErrorMessageFromErrorResponseBody=function(e,t){let n=t||"Unknown error";return e&&"object"==typeof e&&"error"in e&&e.error&&"object"==typeof e.error&&"message"in e.error&&(n=e.error.message),n},t.getErrorFromErrorResponse=function(e){return e.data.error||{message:"Unknown error"}}},58009:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},95778:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.HttpStatusCode=void 0,function(e){e[e.Success=200]="Success",e[e.NoContent=204]="NoContent",e[e.MultipleChoices=300]="MultipleChoices",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.Forbidden=403]="Forbidden",e[e.Gone=410]="Gone",e[e.ExpiredAccessToken=498]="ExpiredAccessToken",e[e.InternalServerError=500]="InternalServerError"}(n||(t.HttpStatusCode=n={}))},37204:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.HttpVerb=void 0,function(e){e.Get="GET",e.Post="POST",e.Put="PUT",e.Patch="PATCH",e.Delete="DELETE"}(n||(t.HttpVerb=n={}))},92961:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(67545),t),i(n(48379),t),i(n(11910),t),i(n(44323),t),i(n(53251),t),i(n(23269),t),i(n(58009),t),i(n(37204),t),i(n(46707),t),i(n(13838),t),i(n(95573),t),i(n(42338),t),i(n(32176),t),i(n(95778),t),i(n(64404),t)},72646:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ApiEndpointParam=void 0,function(e){e.LastSyncToken="sync_token",e.PaginationToken="cursor_token",e.SyncDlLimit="limit",e.SyncPayloads="items",e.ApiVersion="api",e.SharedVaultUuids="shared_vault_uuids"}(n||(t.ApiEndpointParam=n={}))},21799:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6579:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.conflictParamsHasOnlyUnsavedItem=t.conflictParamsHasOnlyServerItem=t.conflictParamsHasServerItemAndUnsavedItem=void 0,t.conflictParamsHasServerItemAndUnsavedItem=function(e){return void 0!==e.server_item&&void 0!==e.unsaved_item},t.conflictParamsHasOnlyServerItem=function(e){return void 0!==e.server_item},t.conflictParamsHasOnlyUnsavedItem=function(e){return void 0!==e.unsaved_item}},68655:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ConflictType=void 0,function(e){e.ConflictingData="sync_conflict",e.UuidConflict="uuid_conflict",e.ContentTypeError="content_type_error",e.ContentError="content_error",e.ReadOnlyError="readonly_error",e.UuidError="uuid_error",e.InvalidServerItem="invalid_server_item",e.SharedVaultSnjsVersionError="shared_vault_snjs_version_error",e.SharedVaultInsufficientPermissionsError="shared_vault_insufficient_permissions_error",e.SharedVaultNotMemberError="shared_vault_not_member_error",e.SharedVaultInvalidState="shared_vault_invalid_state"}(n||(t.ConflictType=n={}))},95833:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},46911:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},20459:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(72646)},74397:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},80653:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},96579:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},42374:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},51658:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},22487:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},20421:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},20780:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},34455:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6976:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1539:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},81526:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},13177:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},86682:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2564:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ValetTokenOperation=void 0,function(e){e.Read="read",e.Write="write",e.Delete="delete",e.Move="move"}(n||(t.ValetTokenOperation=n={}))},98819:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9283:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},39805:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},28022:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},80933:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},22906:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},65802:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},44877:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},13562:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},23324:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},35956:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88645),t),i(n(29590),t),i(n(77345),t),i(n(79594),t),i(n(29547),t),i(n(89398),t),i(n(41278),t),i(n(48126),t),i(n(60346),t),i(n(39881),t),i(n(11706),t),i(n(74113),t),i(n(68224),t),i(n(14116),t),i(n(22893),t),i(n(81563),t),i(n(13177),t),i(n(86682),t),i(n(2564),t),i(n(81526),t),i(n(94764),t),i(n(89408),t),i(n(23632),t),i(n(37525),t),i(n(22039),t),i(n(43129),t),i(n(43630),t),i(n(53980),t),i(n(27196),t),i(n(92961),t),i(n(34455),t),i(n(1539),t),i(n(6976),t),i(n(34789),t),i(n(72646),t),i(n(21799),t),i(n(6579),t),i(n(68655),t),i(n(95833),t),i(n(20459),t),i(n(74397),t),i(n(80653),t),i(n(46911),t),i(n(96579),t),i(n(42374),t),i(n(51658),t),i(n(22487),t),i(n(20421),t),i(n(98819),t),i(n(9283),t),i(n(39805),t),i(n(28022),t),i(n(80933),t),i(n(22906),t),i(n(65802),t),i(n(44877),t),i(n(13562),t),i(n(23324),t),i(n(20780),t),i(n(34455),t),i(n(6976),t),i(n(1539),t)},95658:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(35956),t)},32105:(e,t,n)=>{"use strict";var r,i,o,s,a;n.d(t,{mvL:()=>k,wcN:()=>y,c9N:()=>l,n9K:()=>I,Ugm:()=>v,L$3:()=>r,tv4:()=>T,FEo:()=>R,Ps8:()=>O,NiJ:()=>B,tQn:()=>N,iKc:()=>ee,dH$:()=>ie,Hh3:()=>ae,rW4:()=>ve,QtK:()=>d,qt7:()=>ce,h21:()=>ke}),(o=r||(r={}))[o.Info=0]="Info",o[o.Danger=1]="Danger";class l{showErrorAlert(e){return this.alert(e.text,e.title)}}!function(e){e.MetaReceived="MetaReceived",e.SessionRefreshed="SessionRefreshed"}(i||(i={})),n(95658),(a=s||(s={})).UserRoleMessageReceived="WebSocketMessageReceived",a.NotificationAddedForUser="NotificationAddedForUser",a.MessageSentToUser="MessageSentToUser",a.UserInvitedToSharedVault="UserInvitedToSharedVault",a.ItemsChangedOnServer="ItemsChangedOnServer";var c,u,d,h,p,f,g,m=n(87901);(p=c||(c={})).ASYNC="ASYNC",p.SEQUENCE="SEQUENCE";class y{constructor(e){this.internalEventBus=e,this.eventObservers=[],this.loggingEnabled=!1,this.criticalPromises=[],this.eventDisposers=[]}addEventObserver(e){this.eventObservers.push(e);const t=this.eventObservers;return()=>{(0,m.removeFromArray)(t,e)}}async notifyEvent(e,t){var n;for(const n of this.eventObservers)await n(e,t);null===(n=this.internalEventBus)||void 0===n||n.publish({type:e,payload:t})}async notifyEventSync(e,t){var n;for(const n of this.eventObservers)await n(e,t);await(null===(n=this.internalEventBus)||void 0===n?void 0:n.publishSync({type:e,payload:t},c.SEQUENCE))}getDiagnostics(){return Promise.resolve(void 0)}async blockDeinit(){await Promise.all(this.criticalPromises)}deinit(){this.eventObservers.length=0,this.internalEventBus=void 0,this.criticalPromises=void 0;for(const e of this.eventDisposers)e();this.eventDisposers=[]}async executeCriticalFunction(e){const t=e();return this.criticalPromises.push(t),t}getServiceName(){return this.constructor.name}isApplicationService(){return!0}}(g=u||(u={})).StorageObject="storage",g.DescriptorRecord="descriptors",g.SnjsVersion="snjs_version",g.HomeServerEnabled="home_server_enabled",g.HomeServerDataLocation="home_serve_data_location",(f=d||(d={})).RootKeyParams="ROOT_KEY_PARAMS",f.WrappedRootKey="WRAPPED_ROOT_KEY",f.RootKeyWrapperKeyParams="ROOT_KEY_WRAPPER_KEY_PARAMS",f.Session="session",f.User="user",f.ServerHost="server",f.LegacyUuid="uuid",f.LastSyncToken="syncToken",f.PaginationToken="cursorToken",f.BiometricsState="biometrics_state",f.MobilePasscodeTiming="passcode_timing",f.MobileBiometricsTiming="biometrics_timing",f.MobilePasscodeKeyboardType="passcodeKeyboardType",f.MobilePreferences="preferences",f.MobileScreenshotPrivacyEnabled="screenshotPrivacy_enabled",f.ProtectionExpirey="SessionExpiresAtKey",f.ProtectionSessionLength="SessionLengthKey",f.KeyRecoveryUndecryptableItems="key_recovery_undecryptable",f.WebSocketUrl="webSocket_url",f.UserRoles="user_roles",f.OfflineUserRoles="offline_user_roles",f.ExperimentalFeatures="experimental_features",f.DeinitMode="deinit_mode",f.CodeVerifier="code_verifier",f.LaunchPriorityUuids="launch_priority_uuids",f.LastReadChangelogVersion="last_read_changelog_version",f.MomentsEnabled="moments_enabled",f.TextBackupsEnabled="text_backups_enabled",f.TextBackupsLocation="text_backups_location",f.PlaintextBackupsEnabled="plaintext_backups_enabled",f.PlaintextBackupsLocation="plaintext_backups_location",f.FileBackupsEnabled="file_backups_enabled",f.FileBackupsLocation="file_backups_location",f.VaultSelectionOptions="vault_selection_options",f.Subscription="subscription",f.LocalPreferences="local_preferences",function(e){e.MobileFirstRun="first_run"}(h||(h={}));var v,A,b,w,S,C=n(82648);(S=v||(v={}))[S.PreparingForLaunch_0=0]="PreparingForLaunch_0",S[S.ReadyForLaunch_05=.5]="ReadyForLaunch_05",S[S.StorageDecrypted_09=.9]="StorageDecrypted_09",S[S.Launched_10=1]="Launched_10",S[S.LoadingDatabase_11=1.1]="LoadingDatabase_11",S[S.LoadedDatabase_12=1.2]="LoadedDatabase_12",S[S.FullSyncCompleted_13=1.3]="FullSyncCompleted_13",S[S.SignedIn_30=3]="SignedIn_30",function(e){e.Soft="Soft",e.Hard="Hard"}(A||(A={})),(w=b||(b={}))[w.SignOut=1]="SignOut",w[w.Lock=2]="Lock",w[w.SwitchWorkspace=3]="SwitchWorkspace",w[w.SignOutAll=4]="SignOutAll";var E,I,_,x,P=n(22325);(_=E||(E={})).SyncCompletedWithAllItemsUploaded="SyncCompletedWithAllItemsUploaded",_.SyncCompletedWithAllItemsUploadedAndDownloaded="SyncCompletedWithAllItemsUploadedAndDownloaded",_.PaginatedSyncRequestCompleted="PaginatedSyncRequestCompleted",_.SyncDidBeginProcessing="sync:did-begin-processing",_.DownloadFirstSyncCompleted="sync:download-first-completed",_.SyncTakingTooLong="sync:taking-too-long",_.SyncError="sync:error",_.InvalidSession="sync:invalid-session",_.MajorDataChange="major-data-change",_.LocalDataIncrementalLoad="local-data-incremental-load",_.LocalDataLoaded="local-data-loaded",_.EnterOutOfSync="enter-out-of-sync",_.ExitOutOfSync="exit-out-of-sync",_.StatusChanged="status-changed",_.DatabaseWriteError="database-write-error",_.DatabaseReadError="database-read-error",_.SyncRequestsIntegrityCheck="sync:requests-integrity-check",_.ReceivedRemoteSharedVaults="received-shared-vaults",_.ReceivedSharedVaultInvites="received-shared-vault-invites",_.ReceivedNotifications="received-user-events",_.ReceivedAsymmetricMessages="received-asymmetric-messages",_.TooManyRequests="too-many-requests",(x=I||(I={})).SignedIn="Application:SignedIn",x.SignedOut="Application:SignedOut",x.CompletedFullSync="Application:CompletedFullSync",x.FailedSync="Application:FailedSync",x.HighLatencySync="Application:HighLatencySync",x.EnteredOutOfSync="Application:EnteredOutOfSync",x.ExitedOutOfSync="Application:ExitedOutOfSync",x.ApplicationStageChanged="Application:ApplicationStageChanged",x.Started="Application:Started",x.Launched="Application:Launched",x.LocalDataLoaded="Application:LocalDataLoaded",x.KeyStatusChanged="Application:KeyStatusChanged",x.MajorDataChange="Application:MajorDataChange",x.CompletedRestart="Application:CompletedRestart",x.LocalDataIncrementalLoad="Application:LocalDataIncrementalLoad",x.SyncStatusChanged="Application:SyncStatusChanged",x.WillSync="Application:WillSync",x.InvalidSyncSession="Application:InvalidSyncSession",x.LocalDatabaseReadError="Application:LocalDatabaseReadError",x.LocalDatabaseWriteError="Application:LocalDatabaseWriteError",x.CompletedIncrementalSync="Application:CompletedIncrementalSync",x.MigrationsLoaded="Application:MigrationsLoaded",x.StorageReady="Application:StorageReady",x.PreferencesChanged="Application:PreferencesChanged",x.LocalPreferencesChanged="Application:LocalPreferencesChanged",x.UnprotectedSessionBegan="Application:UnprotectedSessionBegan",x.UserRolesChanged="Application:UserRolesChanged",x.FeaturesAvailabilityChanged="Application:FeaturesAvailabilityChanged",x.UnprotectedSessionExpired="Application:UnprotectedSessionExpired",x.CompletedInitialSync="Application:CompletedInitialSync",x.DidPurchaseSubscription="Application:DidPurchaseSubscription",x.SyncTooManyRequests="Application:SyncTooManyRequests",n(84409);const k="Error downloading package details. Please check the\n  extension link and try again.",B={UnlockApplication:"Authentication is required to unlock the application",NoteAccess:"Authentication is required to view this note",FileAccess:"Authentication is required to access this file",ImportFile:"Authentication is required to import a backup file",AddPasscode:"Authentication is required to add a passcode",RemovePasscode:"Authentication is required to remove your passcode",ChangePasscode:"Authentication is required to change your passcode",ChangeAutolockInterval:"Authentication is required to change autolock timer duration",RevokeSession:"Authentication is required to revoke a session",EnterAccountPassword:"Enter your account password",EnterLocalPasscode:"Enter your application passcode",EnterPasscodeForMigration:"Your application passcode is required to perform an upgrade of your local data storage structure.",EnterPasscodeForRootResave:"Enter your application passcode to continue",EnterCredentialsForProtocolUpgrade:"Enter your credentials to perform encryption upgrade",EnterCredentialsForDecryptedBackupDownload:"Enter your credentials to download a decrypted backup",AccountPasswordPlaceholder:"Account Password",LocalPasscodePlaceholder:"Application Passcode",DecryptEncryptedFile:"Enter the account password associated with the import file",ExportBackup:"Authentication is required to export a backup",DisableBiometrics:"Authentication is required to disable biometrics",UnprotectNote:"Authentication is required to unprotect a note",UnprotectFile:"Authentication is required to unprotect a file",SearchProtectedNotesText:"Authentication is required to search protected contents",SelectProtectedNote:"Authentication is required to select a protected note",DisableMfa:"Authentication is required to disable two-factor authentication",DeleteAccount:"Authentication is required to delete your account",ListedAuthorization:"Authentication is required to approve this note for Listed",UnlockVault:e=>`Unlock ${e}`,DeleteVault:e=>`Delete ${e}`,EnterVaultPassword:"Enter the password for this vault"};var O,N,D,j;(D=O||(O={}))[D.AccessProtectedFile=0]="AccessProtectedFile",D[D.AccessProtectedNote=1]="AccessProtectedNote",D[D.AddPasscode=2]="AddPasscode",D[D.ApplicationUnlock=3]="ApplicationUnlock",D[D.ChangeAutolockInterval=4]="ChangeAutolockInterval",D[D.ChangePasscode=5]="ChangePasscode",D[D.CreateDecryptedBackupWithProtectedItems=6]="CreateDecryptedBackupWithProtectedItems",D[D.Custom=7]="Custom",D[D.DecryptEncryptedFile=8]="DecryptEncryptedFile",D[D.DisableBiometrics=9]="DisableBiometrics",D[D.DisableMfa=10]="DisableMfa",D[D.ExportBackup=11]="ExportBackup",D[D.ImportFile=12]="ImportFile",D[D.Migration=13]="Migration",D[D.ProtocolUpgrade=14]="ProtocolUpgrade",D[D.RemovePasscode=15]="RemovePasscode",D[D.ResaveRootKey=16]="ResaveRootKey",D[D.RevokeSession=17]="RevokeSession",D[D.SearchProtectedNotesText=18]="SearchProtectedNotesText",D[D.SelectProtectedNote=19]="SelectProtectedNote",D[D.UnprotectFile=20]="UnprotectFile",D[D.UnprotectNote=21]="UnprotectNote",D[D.DeleteAccount=22]="DeleteAccount",D[D.AuthorizeNoteForListed=23]="AuthorizeNoteForListed";class T{constructor(e,t,n,r,i){this.prompts=e,this.reason=t,this.cancelable=n,this._heading=r,this._subheading=i,this.id=Math.random()}get modalTitle(){return this.reason===O.Migration?"Storage Update":"Authentication Required"}get heading(){if(this._heading)return this._heading;switch(this.reason){case O.ApplicationUnlock:return B.UnlockApplication;case O.Migration:return B.EnterLocalPasscode;case O.ResaveRootKey:return B.EnterPasscodeForRootResave;case O.ProtocolUpgrade:return B.EnterCredentialsForProtocolUpgrade;case O.AccessProtectedNote:return B.NoteAccess;case O.AccessProtectedFile:return B.FileAccess;case O.ImportFile:return B.ImportFile;case O.AddPasscode:return B.AddPasscode;case O.RemovePasscode:return B.RemovePasscode;case O.ChangePasscode:return B.ChangePasscode;case O.ChangeAutolockInterval:return B.ChangeAutolockInterval;case O.CreateDecryptedBackupWithProtectedItems:return B.EnterCredentialsForDecryptedBackupDownload;case O.RevokeSession:return B.RevokeSession;case O.DecryptEncryptedFile:return B.DecryptEncryptedFile;case O.ExportBackup:return B.ExportBackup;case O.DisableBiometrics:return B.DisableBiometrics;case O.UnprotectNote:return B.UnprotectNote;case O.UnprotectFile:return B.UnprotectFile;case O.SearchProtectedNotesText:return B.SearchProtectedNotesText;case O.SelectProtectedNote:return B.SelectProtectedNote;case O.DisableMfa:return B.DisableMfa;case O.DeleteAccount:return B.DeleteAccount;case O.AuthorizeNoteForListed:return B.ListedAuthorization;case O.Custom:return"";default:return(0,m.assertUnreachable)(this.reason)}}get subheading(){return this._subheading?this._subheading:this.reason===O.Migration?B.EnterPasscodeForMigration:void 0}hasPromptForValidationType(e){for(const t of this.prompts)if(t.validation===e)return!0;return!1}}(j=N||(N={}))[j.None=0]="None",j[j.LocalPasscode=1]="LocalPasscode",j[j.AccountPassword=2]="AccountPassword",j[j.Biometric=3]="Biometric",j[j.ProtectionSessionDuration=4]="ProtectionSessionDuration",j[j.Authenticator=5]="Authenticator";const M="Account Password",F="Application Passcode";class R{constructor(e,t,n,r=!0,i,o,s){switch(this.validation=e,this.secureTextEntry=r,this.keyboardType=i,this.initialValue=o,this.contextData=s,this.id=Math.random(),this.validation){case N.AccountPassword:this.title=null!=t?t:M,this.placeholder=null!=n?n:M,this.validates=!0;break;case N.LocalPasscode:this.title=null!=t?t:F,this.placeholder=null!=n?n:F,this.validates=!0;break;case N.Biometric:this.title=null!=t?t:"Biometrics",this.placeholder=null!=n?n:"",this.validates=!0;break;case N.Authenticator:this.title=null!=t?t:"Security Key",this.placeholder=null!=n?n:"",this.validates=!0;break;case N.ProtectionSessionDuration:this.title=null!=t?t:"Remember For",this.placeholder=null!=n?n:"",this.validates=!0;break;case N.None:this.title=null!=t?t:"",this.placeholder=null!=n?n:"",this.validates=!1;break;default:(0,m.assertUnreachable)(this.validation)}Object.freeze(this)}}var L,Q,U,V,K,H;!function(e){e.Alphanumeric="default",e.Numeric="numeric"}(L||(L={})),function(e){e.OfflineRestricted="OfflineRestricted",e.MissingUrl="MissingUrl"}(Q||(Q={})),U||(U={}),(V||(V={})).Vaults="vaults",(H=K||(K={})).NotApplicable="NotApplicable",H.Trusted="Trusted",H.SignedWithNonCurrentKey="SignedWithNonCurrentKey",H.NotTrusted="NotTrusted";var G=n(98418);const Y=Object.freeze({SaltSeedLength:128,PbkdfMinCost:3e3,PbkdfCostsUsed:[3e3,5e3,1e4,6e4],PbkdfOutputLength:512,EncryptionKeyLength:256});var z,Z,W,q,J,X,$,ee,te,ne,re,ie,oe,se,ae,le,ce,ue,de,he,pe,fe,ge,me,ye,ve,Ae,be,we,Se,Ce,Ee,Ie,_e,xe,Pe,ke,Be,Oe,Ne,De;Object.freeze({SaltSeedLength:128,PbkdfMinCost:3e3,PbkdfCostsUsed:Y.PbkdfCostsUsed.concat([1e5,101e3,102e3,103e3]),ImprobablePbkdfCostsUsed:[3e3,5e3],PbkdfOutputLength:768,EncryptionKeyLength:256,EncryptionIvLength:128}),Object.freeze({SaltSeedLength:256,PbkdfCost:11e4,PbkdfOutputLength:768,EncryptionKeyLength:256,EncryptionIvLength:128}),Object.freeze({ArgonSaltSeedLength:256,ArgonSaltLength:128,ArgonIterations:5,ArgonMemLimit:67108864,ArgonOutputKeyBytes:64,EncryptionKeyLength:256,EncryptionNonceLength:192,AsymmetricEncryptionNonceLength:192,MasterKeyEncryptionKeyPairSubKeyNumber:1,MasterKeyEncryptionKeyPairSubKeyContext:"sn-pkc-e",MasterKeyEncryptionKeyPairSubKeyBytes:G.SodiumConstant.crypto_box_SEEDBYTES,MasterKeySigningKeyPairSubKeyNumber:2,MasterKeySigningKeyPairSubKeyContext:"sn-pkc-s",MasterKeySigningKeyPairSubKeyBytes:G.SodiumConstant.crypto_sign_SEEDBYTES,PayloadKeyHashingKeySubKeyNumber:1,PayloadKeyHashingKeySubKeyContext:"sn-sym-h",PayloadKeyHashingKeySubKeyBytes:G.SodiumConstant.crypto_generichash_KEYBYTES}),(Z=z||(z={})).Encrypted="Encrypted",Z.EncryptedWithNonEncryptedItemsKey="EncryptedWithNonEncryptedItemsKey",Z.FullyDecrypted="FullyDecrypted",Z.Corrupt="Corrupt";class je extends P.DecryptedItem{constructor(e){super(e),this.keyVersion=e.content.version,this.isDefault=e.content.isDefault,this.itemsKey=this.payload.content.itemsKey}strategyWhenConflictingWithItem(e,t){return P.ConflictStrategy.KeepBase}get dataAuthenticationKey(){if(this.keyVersion===P.ProtocolVersion.V004)throw"Attempting to access legacy data authentication key.";return this.payload.content.dataAuthenticationKey}}class Te extends P.DecryptedItemMutator{set isDefault(e){this.mutableContent.isDefault=e}}(0,P.RegisterItemClass)(C.ContentType.TYPES.ItemsKey,je,Te);class Me extends P.DecryptedItem{constructor(e){super(e),this.creationTimestamp=e.content.creationTimestamp,this.keyVersion=e.content.version,this.itemsKey=this.payload.content.itemsKey,this.rootKeyToken=this.payload.content.rootKeyToken}strategyWhenConflictingWithItem(e,t){return P.ConflictStrategy.KeepBase}}class Fe extends P.DecryptedItemMutator{}(0,P.RegisterItemClass)(C.ContentType.TYPES.KeySystemItemsKey,Me,Fe),n(20875),(W||(W={})).RootKeyStatusChanged="RootKeyStatusChanged",(q||(q={})).RootKeyManagerKeyStatusChanged="RootKeyManagerKeyStatusChanged",(te=J||(J={}))[te.RootKeyNone=0]="RootKeyNone",te[te.RootKeyOnly=1]="RootKeyOnly",te[te.RootKeyPlusWrapper=2]="RootKeyPlusWrapper",te[te.WrapperOnly=3]="WrapperOnly",function(e){e.NewUpdateAvailable="NewUpdateAvailable",e.EditorDidFocus="EditorDidFocus",e.BeganBackupDownload="BeganBackupDownload",e.EndedBackupDownload="EndedBackupDownload",e.PanelResized="PanelResized",e.WindowDidFocus="WindowDidFocus",e.WindowDidBlur="WindowDidBlur",e.MobileKeyboardDidChangeFrame="MobileKeyboardDidChangeFrame",e.MobileKeyboardWillChangeFrame="MobileKeyboardWillChangeFrame"}(X||(X={})),function(e){e.UserRolesChanged="UserRolesChanged",e.FeaturesAvailabilityChanged="Features:FeaturesAvailabilityChanged",e.DidPurchaseSubscription="DidPurchaseSubscription"}($||($={})),function(e){e.NoUserSubscription="NoUserSubscription",e.NotInCurrentPlan="NotInCurrentPlan",e.InCurrentPlanButExpired="InCurrentPlanButExpired",e.Entitled="Entitled"}(ee||(ee={})),n(87985),n(70781),(ne||(ne={})).IntegrityCheckCompleted="IntegrityCheckCompleted",function(e){e[e.AReferencesB=0]="AReferencesB",e[e.BReferencesA=1]="BReferencesA",e[e.NoRelationship=2]="NoRelationship"}(re||(re={})),function(e){e.ActiveThemes="activeThemes",e.UseSystemColorScheme="useSystemColorScheme",e.UseTranslucentUI="useTranslucentUI",e.AutoLightThemeIdentifier="autoLightThemeIdentifier",e.AutoDarkThemeIdentifier="autoDarkThemeIdentifier",e.EditorMonospaceEnabled="monospaceFont",e.EditorLineHeight="editorLineHeight",e.EditorLineWidth="editorLineWidth",e.EditorFontSize="editorFontSize"}(ie||(ie={})),function(e){e.LocalPreferencesChanged="LocalPreferencesChanged",e.PreferencesChanged="PreferencesChanged"}(oe||(oe={})),function(e){e.Immediately="immediately",e.OnQuit="on-quit"}(se||(se={})),function(e){e.UnprotectedSessionBegan="Protection:UnprotectedSessionBegan",e.UnprotectedSessionExpired="Protection:UnprotectedSessionExpired",e.BiometricsSoftLockEngaged="Protection:BiometricsSoftLockEngaged",e.BiometricsSoftLockDisengaged="Protection:BiometricsSoftLockDisengaged"}(ae||(ae={})),(ge=le||(le={}))[ge.Default=1]="Default",ge[ge.Ephemeral=2]="Ephemeral",(fe=ce||(ce={}))[fe.Default=1]="Default",fe[fe.Nonwrapped=2]="Nonwrapped",function(e){e.Wrapped="wrapped",e.Unwrapped="unwrapped",e.Nonwrapped="nonwrapped"}(ue||(ue={})),(ye=de||(de={})).Restored="SessionEvent:SessionRestored",ye.Revoked="SessionEvent:SessionRevoked",ye.UserKeyPairChanged="SessionEvent:UserKeyPairChanged",(me=he||(he={})).SharedVaultStatusChanged="SharedVaultStatusChanged",me.SharedVaultFileStorageUsageChanged="SharedVaultFileStorageUsageChanged",(pe||(pe={})).NotificationReceived="NotificationReceived",P.AsymmetricMessagePayloadType.SharedVaultRootKeyChanged,P.AsymmetricMessagePayloadType.SharedVaultMetadataChanged,(Ae=ve||(ve={})).MessageChanged="MessageChanged",Ae.PreferencesBubbleCountChanged="PreferencesBubbleCountChanged",function(e){e.ProPlanYearly="pro_plan_yearly",e.PlusPlanYearly="plus_plan_yearly"}(be||(be={})),(we||(we={})).DidFetchSubscription="Subscription:DidFetchSubscription",function(e){e.Default="Default",e.DownloadFirst="DownloadFirst",e.LocalOnly="LocalOnly"}(Se||(Se={})),function(e){e[e.ResolveOnNext=1]="ResolveOnNext",e[e.ForceSpawnNew=2]="ForceSpawnNew"}(Ce||(Ce={})),function(e){e.External="External",e.SpawnQueue="SpawnQueue",e.ResolveQueue="ResolveQueue",e.MoreDirtyItems="MoreDirtyItems",e.DownloadFirst="DownloadFirst",e.AfterDownloadFirst="AfterDownloadFirst",e.IntegrityCheck="IntegrityCheck",e.ResolveOutOfSync="ResolveOutOfSync"}(Ee||(Ee={})),(_e=Ie||(Ie={})).SignedInOrRegistered="SignedInOrRegistered",_e.SignedOut="SignedOut",xe||(xe={}),(Oe=Pe||(Pe={})).InviteSent="VaultInviteServiceEvent.InviteSent",Oe.InvitesReloaded="VaultInviteServiceEvent.InvitesReloaded",(Ne=ke||(ke={})).VaultUnlocked="VaultUnlocked",Ne.VaultLocked="VaultLocked",(De=Be||(Be={})).UsersChanged="VaultUserServiceEvent.UsersChanged",De.InvalidatedAllUserCache="VaultUserServiceEvent.InvalidatedUserCache",De.InvalidatedUserCacheForVault="VaultUserServiceEvent.InvalidatedUserCacheForVault"},8430:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},91440:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},21404:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},63180:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(8430),t),i(n(91440),t),i(n(21404),t)},45575:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},83372:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(45575),t)},41335:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},90176:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timingSafeEqual=void 0,t.timingSafeEqual=function(e,t){const n=String(e);let r=String(t);const i=n.length;let o=0;i!==r.length&&(r=n,o=1);for(let e=0;e<i;e++)o|=n.charCodeAt(e)^r.charCodeAt(e);return 0===o}},78492:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(41335),t),i(n(90176),t)},26734:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},68101:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(26734),t)},88602:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},84370:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1282:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},69422:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},51234:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SodiumConstant=void 0,t.SodiumConstant={CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_STATEBYTES:52,CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES:17,CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES:24,CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES:32,CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX:274877906816,crypto_box_SEEDBYTES:32,crypto_sign_SEEDBYTES:32,crypto_generichash_KEYBYTES:32}},58081:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},42565:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SodiumTag=void 0,function(e){e[e.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PUSH=0]="CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PUSH",e[e.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PULL=1]="CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PULL",e[e.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY=2]="CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY",e[e.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL=3]="CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL"}(n||(t.SodiumTag=n={}))},67918:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},39296:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},91338:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},83395:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},21084:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},30418:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88602),t),i(n(84370),t),i(n(1282),t),i(n(69422),t),i(n(51234),t),i(n(58081),t),i(n(42565),t),i(n(67918),t),i(n(39296),t),i(n(91338),t),i(n(83395),t),i(n(21084),t)},98418:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(63180),t),i(n(83372),t),i(n(78492),t),i(n(68101),t),i(n(30418),t)},29894:e=>{"use strict";var t;self,t=()=>(()=>{var e={87244:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContentDecoder=void 0,t.ContentDecoder=class{decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;try{const n=t>0?e.substring(t):e,r=Buffer.from(n,"base64").toString();return JSON.parse(r)}catch(e){return{}}}encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;const n=JSON.stringify(e),r=Buffer.from(n).toString("base64");return r.padStart(r.length+t,"0")}}},21467:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},35411:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},30717:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},97936:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},79955:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},85413:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EmailMessageIdentifier=void 0,(n=t.EmailMessageIdentifier||(t.EmailMessageIdentifier={})).WELCOME_EMAIL="WELCOME_EMAIL",n.ACCOUNT_CLAIM="ACCOUNT_CLAIM",n.ACCOUNT_RESET="ACCOUNT_RESET",n.ACTIVATION_CODE="ACTIVATION_CODE",n.VERSION_ADOPTION_REPORT="VERSION_ADOPTION_REPORT",n.FAILED_DROPBOX_BACKUP="FAILED_DROPBOX_BACKUP",n.FAILED_GOOGLE_DRIVE_BACKUP="FAILED_GOOGLE_DRIVE_BACKUP",n.FAILED_ONE_DRIVE_BACKUP="FAILED_ONE_DRIVE_BACKUP",n.DATA_BACKUP="DATA_BACKUP",n.FAILED_BACKUP_ATTACHMENT_TOO_BIG="FAILED_BACKUP_ATTACHMENT_TOO_BIG",n.OFFLINE_SUBSCRIPTION_ACCESS="OFFLINE_SUBSCRIPTION_ACCESS",n.SIGN_IN="SIGN_IN",n.SHARED_SUBSCRIPTION_INVITATION="SHARED_SUBSCRIPTION_INVITATION",n.ENCOURAGE_EMAIL_BACKUPS="ENCOURAGE_EMAIL_BACKUPS",n.ENCOURAGE_SUBSCRIPTION_PURCHASING="ENCOURAGE_SUBSCRIPTION_PURCHASING",n.EXIT_INTERVIEW="EXIT_INTERVIEW",n.STUDENT_DISCOUNT_REQUESTED="STUDENT_DISCOUNT_REQUESTED",n.STUDENT_DISCOUNT_APPROVED="STUDENT_DISCOUNT_APPROVED",n.MARKETING_CAMPAIGN_FILES="MARKETING_CAMPAIGN_FILES",n.MARKETING_BLACK_FRIDAY_2022="MARKETING_BLACK_FRIDAY_2022",n.MARKETING_BLACK_FRIDAY_2022_REMINDER="MARKETING_BLACK_FRIDAY_2022_REMINDER",n.PAYMENT_FAILED="PAYMENT_FAILED",n.SEND_INVOICE="SEND_INVOICE",n.DISCOUNT_NOTICE="DISCOUNT_NOTICE",n.REFUND_NOTICE="REFUND_NOTICE",n.REFUND_REQUESTED="REFUND_REQUESTED",n.RATE_ADJUSTMENT_NOTICE="RATE_ADJUSTMENT_NOTICE",n.EXIT_DISCOUNT="EXIT_DISCOUNT",n.SUBSCRIPTION_CANCELLED="SUBSCRIPTION_CANCELLED"},35219:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},89125:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},86070:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},68597:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},38427:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},45551:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},9650:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.KeyParamsOrigination=void 0,(n=t.KeyParamsOrigination||(t.KeyParamsOrigination={})).Registration="registration",n.EmailChange="email-change",n.PasswordChange="password-change",n.ProtocolUpgrade="protocol-upgrade",n.PasscodeCreate="passcode-create",n.PasscodeChange="passcode-change"},32806:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PaymentType=void 0,(n=t.PaymentType||(t.PaymentType={})).Initial="initial",n.Renewal="renewal"},56253:(e,t)=>{var n;function r(e,t){return Number(e)-Number(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.isVersionLessThanOrEqualTo=t.leftVersionGreaterThanOrEqualToRight=t.compareVersions=t.protocolVersionFromEncryptedString=t.ProtocolVersionLength=t.isProtocolVersionExpired=t.ProtocolExpirationDates=t.ProtocolVersionLastNonrootItemsKey=t.ProtocolVersionLatest=t.ProtocolVersion=void 0,function(e){e.V001="001",e.V002="002",e.V003="003",e.V004="004"}(n=t.ProtocolVersion||(t.ProtocolVersion={})),t.ProtocolVersionLatest=n.V004,t.ProtocolVersionLastNonrootItemsKey=n.V003,t.ProtocolExpirationDates=Object.freeze({[n.V001]:Date.parse("2018-01-01"),[n.V002]:Date.parse("2020-01-01")}),t.isProtocolVersionExpired=function(e){const n=t.ProtocolExpirationDates[e];return!!n&&(new Date).getTime()>n},t.ProtocolVersionLength=3,t.protocolVersionFromEncryptedString=function(e){const r=e.substring(0,t.ProtocolVersionLength);if(Object.values(n).includes(r))return r;throw Error("Unrecognized protocol version ".concat(r))},t.compareVersions=r,t.leftVersionGreaterThanOrEqualToRight=function(e,t){return r(e,t)>=0},t.isVersionLessThanOrEqualTo=function(e,t){return r(e,t)<=0}},52410:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionBillingFrequency=void 0,(n=t.SubscriptionBillingFrequency||(t.SubscriptionBillingFrequency={}))[n.Monthly=1]="Monthly",n[n.Annual=12]="Annual",n[n.FiveYear=60]="FiveYear"},74911:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionName=void 0,(n=t.SubscriptionName||(t.SubscriptionName={})).PlusPlan="PLUS_PLAN",n.ProPlan="PRO_PLAN"},83402:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},62665:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},90235:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UserRequestType=void 0,(t.UserRequestType||(t.UserRequestType={})).ExitDiscount="exit-discount"},25560:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(87244),t),i(n(21467),t),i(n(35411),t),i(n(97936),t),i(n(79955),t),i(n(30717),t),i(n(85413),t),i(n(35219),t),i(n(89125),t),i(n(86070),t),i(n(68597),t),i(n(38427),t),i(n(45551),t),i(n(9650),t),i(n(32806),t),i(n(56253),t),i(n(52410),t),i(n(74911),t),i(n(83402),t),i(n(62665),t),i(n(90235),t)},20875:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(25560),t)},50569:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LegacySession=void 0;const r=n(93461),i=n(33969),o=n(42544);class s extends r.ValueObject{get accessToken(){return this.props.token}constructor(e){super(e)}static create(e){return o.Validator.isNotEmpty(e).isFailed()?i.Result.fail("Could not create legacy session. Token value is empty"):i.Result.ok(new s({token:e}))}}t.LegacySession=s},89957:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},87879:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Session=void 0;const r=n(93461),i=n(33969);class o extends r.ValueObject{get accessToken(){return this.props.accessToken}get refreshToken(){return this.props.refreshToken}isReadOnly(){return this.props.readonlyAccess||!1}constructor(e){super(e)}static create(e,t,n){return i.Result.ok(new o({accessToken:e,refreshToken:t,readonlyAccess:n}))}}t.Session=o},92932:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},65085:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SessionToken=void 0;const r=n(93461),i=n(33969),o=n(42544);class s extends r.ValueObject{get value(){return this.props.value}get expiresAt(){return this.props.expiresAt}constructor(e){super(e)}static create(e,t){return o.Validator.isNotEmpty(e).isFailed()?i.Result.fail("Could not create session token. Token value is empty"):o.Validator.isNotEmpty(t).isFailed()?i.Result.fail("Could not create session token. Token expiration is empty"):i.Result.ok(new s({value:e,expiresAt:t}))}}t.SessionToken=s},38487:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},43324:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CacheEntry=void 0;const r=n(77546),i=n(33969);class o extends r.Entity{constructor(e,t){super(e,t)}static create(e,t){return i.Result.ok(new o(e,t))}}t.CacheEntry=o},78881:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},67794:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},84287:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContentType=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get value(){return this.props.value}constructor(e){super(e),this.displayNamesMap={[o.TYPES.ActionsExtension]:"action-based extension",[o.TYPES.Component]:"component",[o.TYPES.Editor]:"editor",[o.TYPES.File]:"file",[o.TYPES.FilesafeCredentials]:"FileSafe credential",[o.TYPES.FilesafeFileMetadata]:"FileSafe file",[o.TYPES.FilesafeIntegration]:"FileSafe integration",[o.TYPES.ItemsKey]:"encryption key",[o.TYPES.Note]:"note",[o.TYPES.SmartView]:"smart view",[o.TYPES.Tag]:"tag",[o.TYPES.Theme]:"theme",[o.TYPES.UserPrefs]:"user preferences"}}static create(e){return null===e?r.Result.ok(new o({value:null})):Object.values(this.TYPES).includes(e)?r.Result.ok(new o({value:e})):r.Result.fail("Invalid content type: ".concat(e))}getDisplayName(){return this.value?this.displayNamesMap[this.value]||this.value:null}}o.TYPES={Any:"*",Item:"SF|Item",KeySystemItemsKey:"SN|KeySystemItemsKey",KeySystemRootKey:"SN|KeySystemRootKey",TrustedContact:"SN|TrustedContact",VaultListing:"SN|VaultListing",RootKey:"SN|RootKey|NoSync",ItemsKey:"SN|ItemsKey",EncryptedStorage:"SN|EncryptedStorage",Note:"Note",Tag:"Tag",SmartView:"SN|SmartTag",Component:"SN|Component",Editor:"SN|Editor",ActionsExtension:"Extension",UserPrefs:"SN|UserPreferences",HistorySession:"SN|HistorySession",Theme:"SN|Theme",File:"SN|File",FilesafeCredentials:"SN|FileSafe|Credentials",FilesafeFileMetadata:"SN|FileSafe|FileMetadata",FilesafeIntegration:"SN|FileSafe|Integration",ExtensionRepo:"SN|ExtensionRepo"},t.ContentType=o},4273:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},92339:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Dates=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get createdAt(){return this.props.createdAt}get updatedAt(){return this.props.updatedAt}constructor(e){super(e)}static create(e,t){return e instanceof Date?t instanceof Date?r.Result.ok(new o({createdAt:e,updatedAt:t})):r.Result.fail("Could not create Dates. Update date should be a date object, given: ".concat(t)):r.Result.fail("Could not create Dates. Creation date should be a date object, given: ".concat(e))}}t.Dates=o},57154:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},63666:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Email=void 0;const r=n(93461),i=n(33969),o=n(42544);class s extends r.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){if(o.Validator.isString(e).isFailed())return i.Result.fail("Email must be a string");const t=e.trim().toLowerCase(),n=o.Validator.isValidEmail(t);return n.isFailed()?i.Result.fail(n.getError()):i.Result.ok(new s({value:t}))}}t.Email=s},63931:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},65180:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RoleName=void 0;const r=n(93461),i=n(33969);class o extends r.ValueObject{get value(){return this.props.value}hasMoreOrEqualPowerTo(e){switch(this.value){case o.NAMES.InternalTeamUser:return!0;case o.NAMES.ProUser:return[o.NAMES.CoreUser,o.NAMES.PlusUser,o.NAMES.ProUser].includes(e.value);case o.NAMES.PlusUser:return[o.NAMES.CoreUser,o.NAMES.PlusUser].includes(e.value);case o.NAMES.CoreUser:case o.NAMES.VaultsUser:return[o.NAMES.CoreUser].includes(e.value);default:throw new Error("Invalid role name: ".concat(this.value))}}constructor(e){super(e)}static create(e){return Object.values(this.NAMES).includes(e)?i.Result.ok(new o({value:e})):i.Result.fail("Invalid role name: ".concat(e))}}o.NAMES={CoreUser:"CORE_USER",PlusUser:"PLUS_USER",ProUser:"PRO_USER",InternalTeamUser:"INTERNAL_TEAM_USER",VaultsUser:"VAULTS_USER"},t.RoleName=o},60216:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RoleNameCollection=void 0;const r=n(93461),i=n(33969),o=n(65180);class s extends r.ValueObject{get value(){return this.props.value}includes(e){for(const t of this.props.value)if(t.value===e.value)return!0;return!1}hasARoleNameWithMoreOrEqualPowerTo(e){for(const t of this.props.value)if(t.hasMoreOrEqualPowerTo(e))return!0;return!1}equals(e){if(this.props.value.length!==e.value.length)return!1;for(const t of e.value)if(!this.includes(t))return!1;return!0}constructor(e){super(e)}static create(e){const t=[];for(const n of e){const e=o.RoleName.create(n);if(e.isFailed())return i.Result.fail(e.getError());t.push(e.getValue())}return i.Result.ok(new s({value:t}))}}t.RoleNameCollection=s},78060:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},49565:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},77803:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Timestamps=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get createdAt(){return this.props.createdAt}get updatedAt(){return this.props.updatedAt}constructor(e){super(e)}static create(e,t){return isNaN(e)||"number"!=typeof e?r.Result.fail("Could not create Timestamps. Creation date should be a number, given: ".concat(e)):isNaN(t)||"number"!=typeof t?r.Result.fail("Could not create Timestamps. Update date should be a number, given: ".concat(t)):r.Result.ok(new o({createdAt:e,updatedAt:t}))}}t.Timestamps=o},95332:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},96806:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Username=void 0;const r=n(93461),i=n(33969),o=n(42544);class s extends r.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){if(o.Validator.isString(e).isFailed())return i.Result.fail("Username must be a string");const t=e.trim().toLowerCase();return o.Validator.isNotEmpty(t).isFailed()?i.Result.fail("Username cannot be empty"):i.Result.ok(new s({value:t}))}isPotentiallyAPrivateUsernameAccount(){return 64===this.value.length&&!this.value.includes("@")}}t.Username=s},29835:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},26477:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Uuid=void 0;const r=n(93461),i=n(33969),o=n(42544);class s extends r.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){const t=o.Validator.isValidUuid(e);return t.isFailed()?i.Result.fail(t.getError()):i.Result.ok(new s({value:e}))}}t.Uuid=s},55928:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},69838:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Aggregate=void 0;const r=n(77546);class i extends r.Entity{constructor(){super(...arguments),this.changesOnAggregateRoot=[]}addChange(e){this.changesOnAggregateRoot.push(e)}flushChanges(){this.changesOnAggregateRoot=[]}getChanges(){return this.changesOnAggregateRoot}}t.Aggregate=i},39653:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Change=void 0;const r=n(33969);class i{constructor(e){this.props=Object.freeze(e)}static create(e){return Object.values(i.TYPES).includes(e.changeType)?r.Result.ok(new i(e)):r.Result.fail("Invalid change type")}}i.TYPES={Add:"add",Remove:"remove",Modify:"modify"},t.Change=i},24128:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},77546:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Entity=void 0;const r=n(85193);class i{constructor(e,t){this.props=e,this._id=t||new r.UniqueEntityId}get id(){return this._id}equals(e){return null!=e&&null!=e&&(this===e||e instanceof i&&this._id.equals(e._id))}}t.Entity=i},2602:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Id=void 0,t.Id=class{constructor(e){this.value=e}equals(e){return null!=e&&e instanceof this.constructor&&e.toValue()===this.value}toString(){return String(this.value)}toValue(){return this.value}}},33969:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Result=void 0;class n{constructor(e,t,n){this.isSuccess=e,this.error=t,this.value=n,Object.freeze(this)}isFailed(){return!this.isSuccess}getValue(){if(!this.isSuccess)throw new Error("Cannot get value of an unsuccessfull result: ".concat(this.error));return this.value}getError(){if(this.isSuccess||void 0===this.error)throw new Error("Cannot get an error of a successfull result");return this.error}static ok(e){return new n(!0,void 0,e)}static fail(e){return new n(!1,e)}}t.Result=n},85193:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueEntityId=void 0;const r=n(31777),i=n(2602);class o extends i.Id{constructor(e){super(e||(0,r.v4)())}}t.UniqueEntityId=o},42544:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Validator=void 0;const r=n(33969);class i{static isValidUuid(e){return null!==String(e).toLowerCase().match(i.UUID_ANY_VERSION_AND_VARIANT_REGEX)?r.Result.ok():r.Result.fail("Given value is not a valid uuid: ".concat(e))}static isValidEmail(e){return null!==String(e).toLowerCase().match(i.EMAIL_REGEX)?r.Result.ok():r.Result.fail("Given value is not a valid email address: ".concat(e))}static isString(e){return"string"==typeof e?r.Result.ok():r.Result.fail("Given value is not a string: ".concat(typeof e))}static isNotEmpty(e){return e instanceof Array&&0===e.length||null==e||""===e?r.Result.fail("Given value is empty: ".concat(e)):r.Result.ok()}static isNotEmptyString(e){const t=i.isString(e);if(t.isFailed())return t;const n=i.isNotEmpty(e);return n.isFailed()?n:r.Result.ok()}}i.UUID_ANY_VERSION_AND_VARIANT_REGEX=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,i.EMAIL_REGEX=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,t.Validator=i},93461:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueObject=void 0,t.ValueObject=class{constructor(e){this.props=Object.freeze(e)}equals(e){return null!=e&&JSON.stringify(this.props)===JSON.stringify(e.props)}}},21797:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},82806:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ControllerContainer=void 0,t.ControllerContainer=class{constructor(){this.controllerMethodsMap=new Map}register(e,t){this.controllerMethodsMap.set(e,t)}get(e){return this.controllerMethodsMap.get(e)}}},30048:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},95951:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EmailLevel=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){return Object.values(this.LEVELS).includes(e)?r.Result.ok(new o({value:e})):r.Result.fail("Invalid subscription rejection level: ".concat(e))}}o.LEVELS={System:"SYSTEM",SignIn:"SIGN_IN",Marketing:"MARKETING",FailedCloudBackup:"FAILED_CLOUD_BACKUP",FailedEmailBackup:"FAILED_EMAIL_BACKUP"},t.EmailLevel=o},78690:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},12677:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractEnv=void 0,t.AbstractEnv=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.env={},this.overrides=e}get(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.env||this.load(),this.overrides[e])return this.overrides[e];if(!process.env[e]&&!t)throw new Error("Environment variable ".concat(e," not set"));return process.env[e]}getAll(){return this.env||this.load(),this.env}}},49321:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},26112:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationPayload=void 0;const r=n(93461),i=n(33969),o=n(1166),s=n(26477),a=n(63011);class l extends r.ValueObject{constructor(e){super(e)}toString(){var e,t;return JSON.stringify({version:this.props.version,type:this.props.type.value,primaryIdentifier:this.props.primaryIdentifier.value,primaryIndentifierType:this.props.primaryIndentifierType.value,secondaryIdentifier:null===(e=this.props.secondaryIdentifier)||void 0===e?void 0:e.value,secondaryIdentifierType:null===(t=this.props.secondaryIdentifierType)||void 0===t?void 0:t.value})}static createFromString(e){try{const t=JSON.parse(e),n=o.NotificationType.create(t.type);if(n.isFailed())return i.Result.fail(n.getError());const r=n.getValue(),c=s.Uuid.create(t.primaryIdentifier);if(c.isFailed())return i.Result.fail(c.getError());const u=c.getValue(),d=a.NotificationPayloadIdentifierType.create(t.primaryIndentifierType);if(d.isFailed())return i.Result.fail(d.getError());const h=d.getValue();let p,f;if(t.secondaryIdentifier){const e=s.Uuid.create(t.secondaryIdentifier);if(e.isFailed())return i.Result.fail(e.getError());p=e.getValue()}if(t.secondaryIdentifierType){const e=a.NotificationPayloadIdentifierType.create(t.secondaryIdentifierType);if(e.isFailed())return i.Result.fail(e.getError());f=e.getValue()}return l.create({version:t.version,type:r,primaryIdentifier:u,primaryIndentifierType:h,secondaryIdentifier:p,secondaryIdentifierType:f})}catch(e){return i.Result.fail(e.message)}}static create(e){return void 0===e.secondaryIdentifier&&e.type.equals(o.NotificationType.create(o.NotificationType.TYPES.SharedVaultItemRemoved).getValue())?i.Result.fail("Item uuid is required for ".concat(o.NotificationType.TYPES.SharedVaultItemRemoved," notification type")):i.Result.ok(new l(e))}}t.NotificationPayload=l},63011:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationPayloadIdentifierType=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{constructor(e){super(e)}get value(){return this.props.value}static create(e){return Object.values(this.TYPES).includes(e)?r.Result.ok(new o({value:e})):r.Result.fail("Invalid notification payload identifier type: ".concat(e))}}o.TYPES={SharedVaultUuid:"shared_vault_uuid",UserUuid:"user_uuid",SharedVaultInviteUuid:"shared_vault_invite_uuid",ItemUuid:"item_uuid"},t.NotificationPayloadIdentifierType=o},33980:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},98719:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},1166:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationType=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){return Object.values(this.TYPES).includes(e)?r.Result.ok(new o({value:e})):r.Result.fail("Invalid notification type: ".concat(e))}}o.TYPES={SharedVaultItemRemoved:"shared_vault_item_removed",SelfRemovedFromSharedVault:"self_removed_from_shared_vault",UserRemovedFromSharedVault:"user_removed_from_shared_vault",UserDesignatedAsSurvivor:"user_designated_as_survivor",UserAddedToSharedVault:"user_added_to_shared_vault",SharedVaultInviteCanceled:"shared_vault_invite_canceled",SharedVaultFileUploaded:"shared_vault_file_uploaded",SharedVaultFileRemoved:"shared_vault_file_removed"},t.NotificationType=o},33479:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},98401:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},93738:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceContainer=void 0,t.ServiceContainer=class{constructor(){this.serviceMap=new Map}register(e,t){this.serviceMap.set(e.value,t)}get(e){return this.serviceMap.get(e.value)}}},19055:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5775:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceIdentifier=void 0;const r=n(93461),i=n(33969);class o extends r.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){return Object.values(this.NAMES).includes(e)?i.Result.ok(new o({value:e})):i.Result.fail("Invalid subscription plan name: ".concat(e))}}o.NAMES={AnalyticsWorker:"AnalyticsWorker",AnalyticsScheduledTask:"AnalyticsScheduledTask",ApiGateway:"ApiGateway",Auth:"Auth",AuthWorker:"AuthWorker",AuthScheduledTask:"AuthScheduledTask",SyncingServer:"SyncingServer",SyncingServerWorker:"SyncingServerWorker",Revisions:"Revisions",RevisionsWorker:"RevisionsWorker",Files:"Files",FilesWorker:"FilesWorker",SchedulerWorker:"SchedulerWorker",SchedulerScheduledTask:"SchedulerScheduledTask",Email:"Email",EmailWorker:"EmailWorker",EmailBounceProcessor:"EmailBounceProcessor",EmailScheduledTask:"EmailScheduledTask",Websockets:"Websockets",WebsocketsWorker:"WebsocketsWorker"},t.ServiceIdentifier=o},55334:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},35491:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},41406:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SettingName=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get value(){return this.props.value}isSensitive(){return[o.NAMES.MfaSecret,o.NAMES.ExtensionKey].includes(this.props.value)}isASubscriptionSetting(){return[o.NAMES.FileUploadBytesLimit,o.NAMES.FileUploadBytesUsed,o.NAMES.MuteSignInEmails].includes(this.props.value)}isARegularOnlySubscriptionSetting(){return[o.NAMES.FileUploadBytesLimit,o.NAMES.FileUploadBytesUsed].includes(this.props.value)}isASharedAndRegularOnlySubscriptionSetting(){return[o.NAMES.MuteSignInEmails].includes(this.props.value)}constructor(e){super(e)}static create(e){return Object.values(this.NAMES).includes(e)?r.Result.ok(new o({value:e})):r.Result.fail("Invalid setting name: ".concat(e))}}o.NAMES={MfaSecret:"MFA_SECRET",ExtensionKey:"EXTENSION_KEY",EmailBackupFrequency:"EMAIL_BACKUP_FREQUENCY",DropboxBackupFrequency:"DROPBOX_BACKUP_FREQUENCY",DropboxBackupToken:"DROPBOX_BACKUP_TOKEN",OneDriveBackupFrequency:"ONE_DRIVE_BACKUP_FREQUENCY",OneDriveBackupToken:"ONE_DRIVE_BACKUP_TOKEN",GoogleDriveBackupFrequency:"GOOGLE_DRIVE_BACKUP_FREQUENCY",GoogleDriveBackupToken:"GOOGLE_DRIVE_BACKUP_TOKEN",MuteFailedBackupsEmails:"MUTE_FAILED_BACKUPS_EMAILS",MuteFailedCloudBackupsEmails:"MUTE_FAILED_CLOUD_BACKUPS_EMAILS",MuteSignInEmails:"MUTE_SIGN_IN_EMAILS",MuteMarketingEmails:"MUTE_MARKETING_EMAILS",ListedAuthorSecrets:"LISTED_AUTHOR_SECRETS",LogSessionUserAgent:"LOG_SESSION_USER_AGENT",RecoveryCodes:"RECOVERY_CODES",FileUploadBytesLimit:"FILE_UPLOAD_BYTES_LIMIT",FileUploadBytesUsed:"FILE_UPLOAD_BYTES_USED"},t.SettingName=o},10262:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},94478:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultUser=void 0;const r=n(77546),i=n(33969);class o extends r.Entity{constructor(e,t){super(e,t)}static create(e,t){return i.Result.ok(new o(e,t))}}t.SharedVaultUser=o},95626:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultUserPermission=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){return Object.values(this.PERMISSIONS).includes(e)?r.Result.ok(new o({value:e})):r.Result.fail("Invalid shared vault user permission ".concat(e))}}o.PERMISSIONS={Read:"read",Write:"write",Admin:"admin"},t.SharedVaultUserPermission=o},27369:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},76226:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},96829:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionPlanName=void 0;const r=n(93461),i=n(33969);class o extends r.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){return Object.values(this.NAMES).includes(e)?i.Result.ok(new o({value:e})):i.Result.fail("Invalid subscription plan name: ".concat(e))}}o.NAMES={PlusPlan:"PLUS_PLAN",ProPlan:"PRO_PLAN"},t.SubscriptionPlanName=o},13709:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},11829:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},17505:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},69749:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(50569),t),i(n(89957),t),i(n(87879),t),i(n(92932),t),i(n(65085),t),i(n(38487),t),i(n(43324),t),i(n(78881),t),i(n(67794),t),i(n(84287),t),i(n(4273),t),i(n(92339),t),i(n(57154),t),i(n(63666),t),i(n(63931),t),i(n(65180),t),i(n(49565),t),i(n(60216),t),i(n(78060),t),i(n(77803),t),i(n(95332),t),i(n(96806),t),i(n(29835),t),i(n(26477),t),i(n(55928),t),i(n(69838),t),i(n(39653),t),i(n(24128),t),i(n(77546),t),i(n(2602),t),i(n(33969),t),i(n(85193),t),i(n(42544),t),i(n(93461),t),i(n(21797),t),i(n(82806),t),i(n(30048),t),i(n(95951),t),i(n(78690),t),i(n(12677),t),i(n(49321),t),i(n(26112),t),i(n(63011),t),i(n(33980),t),i(n(98719),t),i(n(1166),t),i(n(33479),t),i(n(98401),t),i(n(93738),t),i(n(19055),t),i(n(5775),t),i(n(55334),t),i(n(35491),t),i(n(41406),t),i(n(10262),t),i(n(94478),t),i(n(95626),t),i(n(27369),t),i(n(76226),t),i(n(96829),t),i(n(13709),t),i(n(11829),t),i(n(17505),t)},82648:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(69749),t)},74350:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EmailBackupFrequency=void 0,(n=t.EmailBackupFrequency||(t.EmailBackupFrequency={})).Disabled="disabled",n.Daily="daily",n.Weekly="weekly"},80030:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},64684:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.LogSessionUserAgentOption=void 0,(n=t.LogSessionUserAgentOption||(t.LogSessionUserAgentOption={})).Disabled="disabled",n.Enabled="enabled"},22208:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MuteFailedBackupsEmailsOption=void 0,(n=t.MuteFailedBackupsEmailsOption||(t.MuteFailedBackupsEmailsOption={})).Muted="muted",n.NotMuted="not_muted"},49532:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MuteMarketingEmailsOption=void 0,(n=t.MuteMarketingEmailsOption||(t.MuteMarketingEmailsOption={})).Muted="muted",n.NotMuted="not_muted"},19639:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MuteSignInEmailsOption=void 0,(n=t.MuteSignInEmailsOption||(t.MuteSignInEmailsOption={})).Muted="muted",n.NotMuted="not_muted"},50174:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(74350),t),i(n(80030),t),i(n(64684),t),i(n(22208),t),i(n(49532),t),i(n(19639),t)},73606:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(50174),t)},59154:function(e){e.exports=function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}function n(e,r,i){return n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,n,r){var i=[null];i.push.apply(i,n);var o=new(Function.bind.apply(e,i));return r&&t(o,r.prototype),o},n.apply(null,arguments)}function r(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var o=Object.hasOwnProperty,s=Object.setPrototypeOf,a=Object.isFrozen,l=Object.getPrototypeOf,c=Object.getOwnPropertyDescriptor,u=Object.freeze,d=Object.seal,h=Object.create,p="undefined"!=typeof Reflect&&Reflect,f=p.apply,g=p.construct;f||(f=function(e,t,n){return e.apply(t,n)}),u||(u=function(e){return e}),d||(d=function(e){return e}),g||(g=function(e,t){return n(e,r(t))});var m,y=P(Array.prototype.forEach),v=P(Array.prototype.pop),A=P(Array.prototype.push),b=P(String.prototype.toLowerCase),w=P(String.prototype.toString),S=P(String.prototype.match),C=P(String.prototype.replace),E=P(String.prototype.indexOf),I=P(String.prototype.trim),_=P(RegExp.prototype.test),x=(m=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g(m,t)});function P(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return f(e,t,r)}}function k(e,t,n){var r;n=null!==(r=n)&&void 0!==r?r:b,s&&s(e,null);for(var i=t.length;i--;){var o=t[i];if("string"==typeof o){var l=n(o);l!==o&&(a(t)||(t[i]=l),o=l)}e[o]=!0}return e}function B(e){var t,n=h(null);for(t in e)!0===f(o,e,[t])&&(n[t]=e[t]);return n}function O(e,t){for(;null!==e;){var n=c(e,t);if(n){if(n.get)return P(n.get);if("function"==typeof n.value)return P(n.value)}e=l(e)}return function(e){return console.warn("fallback value for",e),null}}var N=u(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),D=u(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),j=u(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),T=u(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),M=u(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),F=u(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),R=u(["#text"]),L=u(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),Q=u(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),U=u(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),V=u(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),K=d(/\{\{[\w\W]*|[\w\W]*\}\}/gm),H=d(/<%[\w\W]*|[\w\W]*%>/gm),G=d(/\${[\w\W]*}/gm),Y=d(/^data-[\-\w.\u00B7-\uFFFF]/),z=d(/^aria-[\-\w]+$/),Z=d(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),W=d(/^(?:\w+script|data):/i),q=d(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),J=d(/^html$/i),X=function(){return"undefined"==typeof window?null:window};return function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:X(),i=function(e){return t(e)};if(i.version="2.4.7",i.removed=[],!n||!n.document||9!==n.document.nodeType)return i.isSupported=!1,i;var o=n.document,s=n.document,a=n.DocumentFragment,l=n.HTMLTemplateElement,c=n.Node,d=n.Element,h=n.NodeFilter,p=n.NamedNodeMap,f=void 0===p?n.NamedNodeMap||n.MozNamedAttrMap:p,g=n.HTMLFormElement,m=n.DOMParser,P=n.trustedTypes,$=d.prototype,ee=O($,"cloneNode"),te=O($,"nextSibling"),ne=O($,"childNodes"),re=O($,"parentNode");if("function"==typeof l){var ie=s.createElement("template");ie.content&&ie.content.ownerDocument&&(s=ie.content.ownerDocument)}var oe=function(t,n){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var r=null,i="data-tt-policy-suffix";n.currentScript&&n.currentScript.hasAttribute(i)&&(r=n.currentScript.getAttribute(i));var o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(P,o),se=oe?oe.createHTML(""):"",ae=s,le=ae.implementation,ce=ae.createNodeIterator,ue=ae.createDocumentFragment,de=ae.getElementsByTagName,he=o.importNode,pe={};try{pe=B(s).documentMode?s.documentMode:{}}catch(e){}var fe={};i.isSupported="function"==typeof re&&le&&void 0!==le.createHTMLDocument&&9!==pe;var ge,me,ye=K,ve=H,Ae=G,be=Y,we=z,Se=W,Ce=q,Ee=Z,Ie=null,_e=k({},[].concat(r(N),r(D),r(j),r(M),r(R))),xe=null,Pe=k({},[].concat(r(L),r(Q),r(U),r(V))),ke=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Be=null,Oe=null,Ne=!0,De=!0,je=!1,Te=!0,Me=!1,Fe=!1,Re=!1,Le=!1,Qe=!1,Ue=!1,Ve=!1,Ke=!0,He=!1,Ge=!0,Ye=!1,ze={},Ze=null,We=k({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),qe=null,Je=k({},["audio","video","img","source","image","track"]),Xe=null,$e=k({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml",rt=nt,it=!1,ot=null,st=k({},[et,tt,nt],w),at=["application/xhtml+xml","text/html"],lt=null,ct=s.createElement("form"),ut=function(e){return e instanceof RegExp||e instanceof Function},dt=function(t){lt&&lt===t||(t&&"object"===e(t)||(t={}),t=B(t),ge=ge=-1===at.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,me="application/xhtml+xml"===ge?w:b,Ie="ALLOWED_TAGS"in t?k({},t.ALLOWED_TAGS,me):_e,xe="ALLOWED_ATTR"in t?k({},t.ALLOWED_ATTR,me):Pe,ot="ALLOWED_NAMESPACES"in t?k({},t.ALLOWED_NAMESPACES,w):st,Xe="ADD_URI_SAFE_ATTR"in t?k(B($e),t.ADD_URI_SAFE_ATTR,me):$e,qe="ADD_DATA_URI_TAGS"in t?k(B(Je),t.ADD_DATA_URI_TAGS,me):Je,Ze="FORBID_CONTENTS"in t?k({},t.FORBID_CONTENTS,me):We,Be="FORBID_TAGS"in t?k({},t.FORBID_TAGS,me):{},Oe="FORBID_ATTR"in t?k({},t.FORBID_ATTR,me):{},ze="USE_PROFILES"in t&&t.USE_PROFILES,Ne=!1!==t.ALLOW_ARIA_ATTR,De=!1!==t.ALLOW_DATA_ATTR,je=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Te=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,Me=t.SAFE_FOR_TEMPLATES||!1,Fe=t.WHOLE_DOCUMENT||!1,Qe=t.RETURN_DOM||!1,Ue=t.RETURN_DOM_FRAGMENT||!1,Ve=t.RETURN_TRUSTED_TYPE||!1,Le=t.FORCE_BODY||!1,Ke=!1!==t.SANITIZE_DOM,He=t.SANITIZE_NAMED_PROPS||!1,Ge=!1!==t.KEEP_CONTENT,Ye=t.IN_PLACE||!1,Ee=t.ALLOWED_URI_REGEXP||Ee,rt=t.NAMESPACE||nt,ke=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&ut(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ke.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&ut(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ke.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(ke.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Me&&(De=!1),Ue&&(Qe=!0),ze&&(Ie=k({},r(R)),xe=[],!0===ze.html&&(k(Ie,N),k(xe,L)),!0===ze.svg&&(k(Ie,D),k(xe,Q),k(xe,V)),!0===ze.svgFilters&&(k(Ie,j),k(xe,Q),k(xe,V)),!0===ze.mathMl&&(k(Ie,M),k(xe,U),k(xe,V))),t.ADD_TAGS&&(Ie===_e&&(Ie=B(Ie)),k(Ie,t.ADD_TAGS,me)),t.ADD_ATTR&&(xe===Pe&&(xe=B(xe)),k(xe,t.ADD_ATTR,me)),t.ADD_URI_SAFE_ATTR&&k(Xe,t.ADD_URI_SAFE_ATTR,me),t.FORBID_CONTENTS&&(Ze===We&&(Ze=B(Ze)),k(Ze,t.FORBID_CONTENTS,me)),Ge&&(Ie["#text"]=!0),Fe&&k(Ie,["html","head","body"]),Ie.table&&(k(Ie,["tbody"]),delete Be.tbody),u&&u(t),lt=t)},ht=k({},["mi","mo","mn","ms","mtext"]),pt=k({},["foreignobject","desc","title","annotation-xml"]),ft=k({},["title","style","font","a","script"]),gt=k({},D);k(gt,j),k(gt,T);var mt=k({},M);k(mt,F);var yt=function(e){A(i.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=se}catch(t){e.remove()}}},vt=function(e,t){try{A(i.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){A(i.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!xe[e])if(Qe||Ue)try{yt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},At=function(e){var t,n;if(Le)e="<remove></remove>"+e;else{var r=S(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===ge&&rt===nt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var i=oe?oe.createHTML(e):e;if(rt===nt)try{t=(new m).parseFromString(i,ge)}catch(e){}if(!t||!t.documentElement){t=le.createDocument(rt,"template",null);try{t.documentElement.innerHTML=it?se:i}catch(e){}}var o=t.body||t.documentElement;return e&&n&&o.insertBefore(s.createTextNode(n),o.childNodes[0]||null),rt===nt?de.call(t,Fe?"html":"body")[0]:Fe?t.documentElement:o},bt=function(e){return ce.call(e.ownerDocument||e,e,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT,null,!1)},wt=function(t){return"object"===e(c)?t instanceof c:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},St=function(e,t,n){fe[e]&&y(fe[e],(function(e){e.call(i,t,n,lt)}))},Ct=function(e){var t,n;if(St("beforeSanitizeElements",e,null),(n=e)instanceof g&&("string"!=typeof n.nodeName||"string"!=typeof n.textContent||"function"!=typeof n.removeChild||!(n.attributes instanceof f)||"function"!=typeof n.removeAttribute||"function"!=typeof n.setAttribute||"string"!=typeof n.namespaceURI||"function"!=typeof n.insertBefore||"function"!=typeof n.hasChildNodes))return yt(e),!0;if(_(/[\u0080-\uFFFF]/,e.nodeName))return yt(e),!0;var r=me(e.nodeName);if(St("uponSanitizeElement",e,{tagName:r,allowedTags:Ie}),e.hasChildNodes()&&!wt(e.firstElementChild)&&(!wt(e.content)||!wt(e.content.firstElementChild))&&_(/<[/\w]/g,e.innerHTML)&&_(/<[/\w]/g,e.textContent))return yt(e),!0;if("select"===r&&_(/<template/i,e.innerHTML))return yt(e),!0;if(!Ie[r]||Be[r]){if(!Be[r]&&It(r)){if(ke.tagNameCheck instanceof RegExp&&_(ke.tagNameCheck,r))return!1;if(ke.tagNameCheck instanceof Function&&ke.tagNameCheck(r))return!1}if(Ge&&!Ze[r]){var o=re(e)||e.parentNode,s=ne(e)||e.childNodes;if(s&&o)for(var a=s.length-1;a>=0;--a)o.insertBefore(ee(s[a],!0),te(e))}return yt(e),!0}return e instanceof d&&!function(e){var t=re(e);t&&t.tagName||(t={namespaceURI:rt,tagName:"template"});var n=b(e.tagName),r=b(t.tagName);return!!ot[e.namespaceURI]&&(e.namespaceURI===tt?t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&("annotation-xml"===r||ht[r]):Boolean(gt[n]):e.namespaceURI===et?t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&&pt[r]:Boolean(mt[n]):e.namespaceURI===nt?!(t.namespaceURI===tt&&!pt[r])&&!(t.namespaceURI===et&&!ht[r])&&!mt[n]&&(ft[n]||!gt[n]):!("application/xhtml+xml"!==ge||!ot[e.namespaceURI]))}(e)?(yt(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!_(/<\/no(script|embed|frames)/i,e.innerHTML)?(Me&&3===e.nodeType&&(t=e.textContent,t=C(t,ye," "),t=C(t,ve," "),t=C(t,Ae," "),e.textContent!==t&&(A(i.removed,{element:e.cloneNode()}),e.textContent=t)),St("afterSanitizeElements",e,null),!1):(yt(e),!0)},Et=function(e,t,n){if(Ke&&("id"===t||"name"===t)&&(n in s||n in ct))return!1;if(De&&!Oe[t]&&_(be,t));else if(Ne&&_(we,t));else if(!xe[t]||Oe[t]){if(!(It(e)&&(ke.tagNameCheck instanceof RegExp&&_(ke.tagNameCheck,e)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(e))&&(ke.attributeNameCheck instanceof RegExp&&_(ke.attributeNameCheck,t)||ke.attributeNameCheck instanceof Function&&ke.attributeNameCheck(t))||"is"===t&&ke.allowCustomizedBuiltInElements&&(ke.tagNameCheck instanceof RegExp&&_(ke.tagNameCheck,n)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(n))))return!1}else if(Xe[t]);else if(_(Ee,C(n,Ce,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==E(n,"data:")||!qe[e])if(je&&!_(Se,C(n,Ce,"")));else if(n)return!1;return!0},It=function(e){return e.indexOf("-")>0},_t=function(t){var n,r,o,s;St("beforeSanitizeAttributes",t,null);var a=t.attributes;if(a){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe};for(s=a.length;s--;){var c=n=a[s],u=c.name,d=c.namespaceURI;if(r="value"===u?n.value:I(n.value),o=me(u),l.attrName=o,l.attrValue=r,l.keepAttr=!0,l.forceKeepAttr=void 0,St("uponSanitizeAttribute",t,l),r=l.attrValue,!l.forceKeepAttr&&(vt(u,t),l.keepAttr))if(Te||!_(/\/>/i,r)){Me&&(r=C(r,ye," "),r=C(r,ve," "),r=C(r,Ae," "));var h=me(t.nodeName);if(Et(h,o,r)){if(!He||"id"!==o&&"name"!==o||(vt(u,t),r="user-content-"+r),oe&&"object"===e(P)&&"function"==typeof P.getAttributeType)if(d);else switch(P.getAttributeType(h,o)){case"TrustedHTML":r=oe.createHTML(r);break;case"TrustedScriptURL":r=oe.createScriptURL(r)}try{d?t.setAttributeNS(d,u,r):t.setAttribute(u,r),v(i.removed)}catch(e){}}}else vt(u,t)}St("afterSanitizeAttributes",t,null)}},xt=function e(t){var n,r=bt(t);for(St("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)St("uponSanitizeShadowNode",n,null),Ct(n)||(n.content instanceof a&&e(n.content),_t(n));St("afterSanitizeShadowDOM",t,null)};return i.sanitize=function(t){var r,s,l,u,d,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((it=!t)&&(t="\x3c!--\x3e"),"string"!=typeof t&&!wt(t)){if("function"!=typeof t.toString)throw x("toString is not a function");if("string"!=typeof(t=t.toString()))throw x("dirty is not a string, aborting")}if(!i.isSupported){if("object"===e(n.toStaticHTML)||"function"==typeof n.toStaticHTML){if("string"==typeof t)return n.toStaticHTML(t);if(wt(t))return n.toStaticHTML(t.outerHTML)}return t}if(Re||dt(h),i.removed=[],"string"==typeof t&&(Ye=!1),Ye){if(t.nodeName){var p=me(t.nodeName);if(!Ie[p]||Be[p])throw x("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof c)1===(s=(r=At("\x3c!----\x3e")).ownerDocument.importNode(t,!0)).nodeType&&"BODY"===s.nodeName||"HTML"===s.nodeName?r=s:r.appendChild(s);else{if(!Qe&&!Me&&!Fe&&-1===t.indexOf("<"))return oe&&Ve?oe.createHTML(t):t;if(!(r=At(t)))return Qe?null:Ve?se:""}r&&Le&&yt(r.firstChild);for(var f=bt(Ye?t:r);l=f.nextNode();)3===l.nodeType&&l===u||Ct(l)||(l.content instanceof a&&xt(l.content),_t(l),u=l);if(u=null,Ye)return t;if(Qe){if(Ue)for(d=ue.call(r.ownerDocument);r.firstChild;)d.appendChild(r.firstChild);else d=r;return(xe.shadowroot||xe.shadowrootmod)&&(d=he.call(o,d,!0)),d}var g=Fe?r.outerHTML:r.innerHTML;return Fe&&Ie["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&_(J,r.ownerDocument.doctype.name)&&(g="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+g),Me&&(g=C(g,ye," "),g=C(g,ve," "),g=C(g,Ae," ")),oe&&Ve?oe.createHTML(g):g},i.setConfig=function(e){dt(e),Re=!0},i.clearConfig=function(){lt=null,Re=!1},i.isValidAttribute=function(e,t,n){lt||dt({});var r=me(e),i=me(t);return Et(r,i,n)},i.addHook=function(e,t){"function"==typeof t&&(fe[e]=fe[e]||[],A(fe[e],t))},i.removeHook=function(e){if(fe[e])return v(fe[e])},i.removeHooks=function(e){fe[e]&&(fe[e]=[])},i.removeAllHooks=function(){fe={}},i}()}()},84213:function(e,t,n){var r;e=n.nmd(e),function(){var i,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",l=32,c=128,u=1/0,d=9007199254740991,h=NaN,p=4294967295,f=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",l],["partialRight",64],["rearg",256]],g="[object Arguments]",m="[object Array]",y="[object Boolean]",v="[object Date]",A="[object Error]",b="[object Function]",w="[object GeneratorFunction]",S="[object Map]",C="[object Number]",E="[object Object]",I="[object Promise]",_="[object RegExp]",x="[object Set]",P="[object String]",k="[object Symbol]",B="[object WeakMap]",O="[object ArrayBuffer]",N="[object DataView]",D="[object Float32Array]",j="[object Float64Array]",T="[object Int8Array]",M="[object Int16Array]",F="[object Int32Array]",R="[object Uint8Array]",L="[object Uint8ClampedArray]",Q="[object Uint16Array]",U="[object Uint32Array]",V=/\b__p \+= '';/g,K=/\b(__p \+=) '' \+/g,H=/(__e\(.*?\)|\b__t\)) \+\n'';/g,G=/&(?:amp|lt|gt|quot|#39);/g,Y=/[&<>"']/g,z=RegExp(G.source),Z=RegExp(Y.source),W=/<%-([\s\S]+?)%>/g,q=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(te.source),re=/^\s+/,ie=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,se=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,le=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,ue=/\\(\\)?/g,de=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,he=/\w*$/,pe=/^[-+]0x[0-9a-f]+$/i,fe=/^0b[01]+$/i,ge=/^\[object .+?Constructor\]$/,me=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,ve=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ae=/($^)/,be=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",Se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ce="\\u2700-\\u27bf",Ee="a-z\\xdf-\\xf6\\xf8-\\xff",Ie="A-Z\\xc0-\\xd6\\xd8-\\xde",_e="\\ufe0e\\ufe0f",xe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Pe="["+we+"]",ke="["+xe+"]",Be="["+Se+"]",Oe="\\d+",Ne="["+Ce+"]",De="["+Ee+"]",je="[^"+we+xe+Oe+Ce+Ee+Ie+"]",Te="\\ud83c[\\udffb-\\udfff]",Me="[^"+we+"]",Fe="(?:\\ud83c[\\udde6-\\uddff]){2}",Re="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+Ie+"]",Qe="\\u200d",Ue="(?:"+De+"|"+je+")",Ve="(?:"+Le+"|"+je+")",Ke="(?:['’](?:d|ll|m|re|s|t|ve))?",He="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ge="(?:"+Be+"|"+Te+")?",Ye="["+_e+"]?",ze=Ye+Ge+"(?:"+Qe+"(?:"+[Me,Fe,Re].join("|")+")"+Ye+Ge+")*",Ze="(?:"+[Ne,Fe,Re].join("|")+")"+ze,We="(?:"+[Me+Be+"?",Be,Fe,Re,Pe].join("|")+")",qe=RegExp("['’]","g"),Je=RegExp(Be,"g"),Xe=RegExp(Te+"(?="+Te+")|"+We+ze,"g"),$e=RegExp([Le+"?"+De+"+"+Ke+"(?="+[ke,Le,"$"].join("|")+")",Ve+"+"+He+"(?="+[ke,Le+Ue,"$"].join("|")+")",Le+"?"+Ue+"+"+Ke,Le+"+"+He,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Oe,Ze].join("|"),"g"),et=RegExp("["+Qe+we+Se+_e+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rt=-1,it={};it[D]=it[j]=it[T]=it[M]=it[F]=it[R]=it[L]=it[Q]=it[U]=!0,it[g]=it[m]=it[O]=it[y]=it[N]=it[v]=it[A]=it[b]=it[S]=it[C]=it[E]=it[_]=it[x]=it[P]=it[B]=!1;var ot={};ot[g]=ot[m]=ot[O]=ot[N]=ot[y]=ot[v]=ot[D]=ot[j]=ot[T]=ot[M]=ot[F]=ot[S]=ot[C]=ot[E]=ot[_]=ot[x]=ot[P]=ot[k]=ot[R]=ot[L]=ot[Q]=ot[U]=!0,ot[A]=ot[b]=ot[B]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},at=parseFloat,lt=parseInt,ct="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ut="object"==typeof self&&self&&self.Object===Object&&self,dt=ct||ut||Function("return this")(),ht=t&&!t.nodeType&&t,pt=ht&&e&&!e.nodeType&&e,ft=pt&&pt.exports===ht,gt=ft&&ct.process,mt=function(){try{return pt&&pt.require&&pt.require("util").types||gt&&gt.binding&&gt.binding("util")}catch(e){}}(),yt=mt&&mt.isArrayBuffer,vt=mt&&mt.isDate,At=mt&&mt.isMap,bt=mt&&mt.isRegExp,wt=mt&&mt.isSet,St=mt&&mt.isTypedArray;function Ct(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Et(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(r,s,n(s),e)}return r}function It(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function _t(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function xt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Pt(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function kt(e,t){return!(null==e||!e.length)&&Lt(e,t,0)>-1}function Bt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Ot(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Nt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Dt(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function jt(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Tt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Mt=Kt("length");function Ft(e,t,n){var r;return n(e,(function(e,n,i){if(t(e,n,i))return r=n,!1})),r}function Rt(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Lt(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):Rt(e,Ut,n)}function Qt(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function Ut(e){return e!=e}function Vt(e,t){var n=null==e?0:e.length;return n?Yt(e,t)/n:h}function Kt(e){return function(t){return null==t?i:t[e]}}function Ht(e){return function(t){return null==e?i:e[t]}}function Gt(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}function Yt(e,t){for(var n,r=-1,o=e.length;++r<o;){var s=t(e[r]);s!==i&&(n=n===i?s:n+s)}return n}function zt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Zt(e){return e?e.slice(0,hn(e)+1).replace(re,""):e}function Wt(e){return function(t){return e(t)}}function qt(e,t){return Ot(t,(function(t){return e[t]}))}function Jt(e,t){return e.has(t)}function Xt(e,t){for(var n=-1,r=e.length;++n<r&&Lt(t,e[n],0)>-1;);return n}function $t(e,t){for(var n=e.length;n--&&Lt(t,e[n],0)>-1;);return n}var en=Ht({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tn=Ht({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function nn(e){return"\\"+st[e]}function rn(e){return et.test(e)}function on(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function sn(e,t){return function(n){return e(t(n))}}function an(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n];s!==t&&s!==a||(e[n]=a,o[i++]=n)}return o}function ln(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function cn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function un(e){return rn(e)?function(e){for(var t=Xe.lastIndex=0;Xe.test(e);)++t;return t}(e):Mt(e)}function dn(e){return rn(e)?function(e){return e.match(Xe)||[]}(e):function(e){return e.split("")}(e)}function hn(e){for(var t=e.length;t--&&ie.test(e.charAt(t)););return t}var pn=Ht({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),fn=function e(t){var n,r=(t=null==t?dt:fn.defaults(dt.Object(),t,fn.pick(dt,nt))).Array,ie=t.Date,we=t.Error,Se=t.Function,Ce=t.Math,Ee=t.Object,Ie=t.RegExp,_e=t.String,xe=t.TypeError,Pe=r.prototype,ke=Se.prototype,Be=Ee.prototype,Oe=t["__core-js_shared__"],Ne=ke.toString,De=Be.hasOwnProperty,je=0,Te=(n=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Me=Be.toString,Fe=Ne.call(Ee),Re=dt._,Le=Ie("^"+Ne.call(De).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Qe=ft?t.Buffer:i,Ue=t.Symbol,Ve=t.Uint8Array,Ke=Qe?Qe.allocUnsafe:i,He=sn(Ee.getPrototypeOf,Ee),Ge=Ee.create,Ye=Be.propertyIsEnumerable,ze=Pe.splice,Ze=Ue?Ue.isConcatSpreadable:i,We=Ue?Ue.iterator:i,Xe=Ue?Ue.toStringTag:i,et=function(){try{var e=lo(Ee,"defineProperty");return e({},"",{}),e}catch(e){}}(),st=t.clearTimeout!==dt.clearTimeout&&t.clearTimeout,ct=ie&&ie.now!==dt.Date.now&&ie.now,ut=t.setTimeout!==dt.setTimeout&&t.setTimeout,ht=Ce.ceil,pt=Ce.floor,gt=Ee.getOwnPropertySymbols,mt=Qe?Qe.isBuffer:i,Mt=t.isFinite,Ht=Pe.join,gn=sn(Ee.keys,Ee),mn=Ce.max,yn=Ce.min,vn=ie.now,An=t.parseInt,bn=Ce.random,wn=Pe.reverse,Sn=lo(t,"DataView"),Cn=lo(t,"Map"),En=lo(t,"Promise"),In=lo(t,"Set"),_n=lo(t,"WeakMap"),xn=lo(Ee,"create"),Pn=_n&&new _n,kn={},Bn=Fo(Sn),On=Fo(Cn),Nn=Fo(En),Dn=Fo(In),jn=Fo(_n),Tn=Ue?Ue.prototype:i,Mn=Tn?Tn.valueOf:i,Fn=Tn?Tn.toString:i;function Rn(e){if(ea(e)&&!Ks(e)&&!(e instanceof Vn)){if(e instanceof Un)return e;if(De.call(e,"__wrapped__"))return Ro(e)}return new Un(e)}var Ln=function(){function e(){}return function(t){if(!$s(t))return{};if(Ge)return Ge(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Qn(){}function Un(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Vn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=p,this.__views__=[]}function Kn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Hn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Gn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Yn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Gn;++t<n;)this.add(e[t])}function zn(e){var t=this.__data__=new Hn(e);this.size=t.size}function Zn(e,t){var n=Ks(e),r=!n&&Vs(e),i=!n&&!r&&zs(e),o=!n&&!r&&!i&&la(e),s=n||r||i||o,a=s?zt(e.length,_e):[],l=a.length;for(var c in e)!t&&!De.call(e,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||mo(c,l))||a.push(c);return a}function Wn(e){var t=e.length;return t?e[Gr(0,t-1)]:i}function qn(e,t){return No(_i(e),or(t,0,e.length))}function Jn(e){return No(_i(e))}function Xn(e,t,n){(n!==i&&!Ls(e[t],n)||n===i&&!(t in e))&&rr(e,t,n)}function $n(e,t,n){var r=e[t];De.call(e,t)&&Ls(r,n)&&(n!==i||t in e)||rr(e,t,n)}function er(e,t){for(var n=e.length;n--;)if(Ls(e[n][0],t))return n;return-1}function tr(e,t,n,r){return ur(e,(function(e,i,o){t(r,e,n(e),o)})),r}function nr(e,t){return e&&xi(t,Ba(t),e)}function rr(e,t,n){"__proto__"==t&&et?et(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ir(e,t){for(var n=-1,o=t.length,s=r(o),a=null==e;++n<o;)s[n]=a?i:Ia(e,t[n]);return s}function or(e,t,n){return e==e&&(n!==i&&(e=e<=n?e:n),t!==i&&(e=e>=t?e:t)),e}function sr(e,t,n,r,o,s){var a,l=1&t,c=2&t,u=4&t;if(n&&(a=o?n(e,r,o,s):n(e)),a!==i)return a;if(!$s(e))return e;var d=Ks(e);if(d){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&De.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!l)return _i(e,a)}else{var h=ho(e),p=h==b||h==w;if(zs(e))return bi(e,l);if(h==E||h==g||p&&!o){if(a=c||p?{}:fo(e),!l)return c?function(e,t){return xi(e,uo(e),t)}(e,function(e,t){return e&&xi(t,Oa(t),e)}(a,e)):function(e,t){return xi(e,co(e),t)}(e,nr(a,e))}else{if(!ot[h])return o?e:{};a=function(e,t,n){var r,i=e.constructor;switch(t){case O:return wi(e);case y:case v:return new i(+e);case N:return function(e,t){var n=t?wi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case D:case j:case T:case M:case F:case R:case L:case Q:case U:return Si(e,n);case S:return new i;case C:case P:return new i(e);case _:return function(e){var t=new e.constructor(e.source,he.exec(e));return t.lastIndex=e.lastIndex,t}(e);case x:return new i;case k:return r=e,Mn?Ee(Mn.call(r)):{}}}(e,h,l)}}s||(s=new zn);var f=s.get(e);if(f)return f;s.set(e,a),oa(e)?e.forEach((function(r){a.add(sr(r,t,n,r,e,s))})):ta(e)&&e.forEach((function(r,i){a.set(i,sr(r,t,n,i,e,s))}));var m=d?i:(u?c?to:eo:c?Oa:Ba)(e);return It(m||e,(function(r,i){m&&(r=e[i=r]),$n(a,i,sr(r,t,n,i,e,s))})),a}function ar(e,t,n){var r=n.length;if(null==e)return!r;for(e=Ee(e);r--;){var o=n[r],s=t[o],a=e[o];if(a===i&&!(o in e)||!s(a))return!1}return!0}function lr(e,t,n){if("function"!=typeof e)throw new xe(o);return Po((function(){e.apply(i,n)}),t)}function cr(e,t,n,r){var i=-1,o=kt,s=!0,a=e.length,l=[],c=t.length;if(!a)return l;n&&(t=Ot(t,Wt(n))),r?(o=Bt,s=!1):t.length>=200&&(o=Jt,s=!1,t=new Yn(t));e:for(;++i<a;){var u=e[i],d=null==n?u:n(u);if(u=r||0!==u?u:0,s&&d==d){for(var h=c;h--;)if(t[h]===d)continue e;l.push(u)}else o(t,d,r)||l.push(u)}return l}Rn.templateSettings={escape:W,evaluate:q,interpolate:J,variable:"",imports:{_:Rn}},Rn.prototype=Qn.prototype,Rn.prototype.constructor=Rn,Un.prototype=Ln(Qn.prototype),Un.prototype.constructor=Un,Vn.prototype=Ln(Qn.prototype),Vn.prototype.constructor=Vn,Kn.prototype.clear=function(){this.__data__=xn?xn(null):{},this.size=0},Kn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Kn.prototype.get=function(e){var t=this.__data__;if(xn){var n=t[e];return n===s?i:n}return De.call(t,e)?t[e]:i},Kn.prototype.has=function(e){var t=this.__data__;return xn?t[e]!==i:De.call(t,e)},Kn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=xn&&t===i?s:t,this},Hn.prototype.clear=function(){this.__data__=[],this.size=0},Hn.prototype.delete=function(e){var t=this.__data__,n=er(t,e);return!(n<0||(n==t.length-1?t.pop():ze.call(t,n,1),--this.size,0))},Hn.prototype.get=function(e){var t=this.__data__,n=er(t,e);return n<0?i:t[n][1]},Hn.prototype.has=function(e){return er(this.__data__,e)>-1},Hn.prototype.set=function(e,t){var n=this.__data__,r=er(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Gn.prototype.clear=function(){this.size=0,this.__data__={hash:new Kn,map:new(Cn||Hn),string:new Kn}},Gn.prototype.delete=function(e){var t=so(this,e).delete(e);return this.size-=t?1:0,t},Gn.prototype.get=function(e){return so(this,e).get(e)},Gn.prototype.has=function(e){return so(this,e).has(e)},Gn.prototype.set=function(e,t){var n=so(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Yn.prototype.add=Yn.prototype.push=function(e){return this.__data__.set(e,s),this},Yn.prototype.has=function(e){return this.__data__.has(e)},zn.prototype.clear=function(){this.__data__=new Hn,this.size=0},zn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},zn.prototype.get=function(e){return this.__data__.get(e)},zn.prototype.has=function(e){return this.__data__.has(e)},zn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Hn){var r=n.__data__;if(!Cn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Gn(r)}return n.set(e,t),this.size=n.size,this};var ur=Bi(vr),dr=Bi(Ar,!0);function hr(e,t){var n=!0;return ur(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function pr(e,t,n){for(var r=-1,o=e.length;++r<o;){var s=e[r],a=t(s);if(null!=a&&(l===i?a==a&&!aa(a):n(a,l)))var l=a,c=s}return c}function fr(e,t){var n=[];return ur(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}function gr(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=go),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?gr(a,t-1,n,r,i):Nt(i,a):r||(i[i.length]=a)}return i}var mr=Oi(),yr=Oi(!0);function vr(e,t){return e&&mr(e,t,Ba)}function Ar(e,t){return e&&yr(e,t,Ba)}function br(e,t){return Pt(t,(function(t){return qs(e[t])}))}function wr(e,t){for(var n=0,r=(t=mi(t,e)).length;null!=e&&n<r;)e=e[Mo(t[n++])];return n&&n==r?e:i}function Sr(e,t,n){var r=t(e);return Ks(e)?r:Nt(r,n(e))}function Cr(e){return null==e?e===i?"[object Undefined]":"[object Null]":Xe&&Xe in Ee(e)?function(e){var t=De.call(e,Xe),n=e[Xe];try{e[Xe]=i;var r=!0}catch(e){}var o=Me.call(e);return r&&(t?e[Xe]=n:delete e[Xe]),o}(e):function(e){return Me.call(e)}(e)}function Er(e,t){return e>t}function Ir(e,t){return null!=e&&De.call(e,t)}function _r(e,t){return null!=e&&t in Ee(e)}function xr(e,t,n){for(var o=n?Bt:kt,s=e[0].length,a=e.length,l=a,c=r(a),u=1/0,d=[];l--;){var h=e[l];l&&t&&(h=Ot(h,Wt(t))),u=yn(h.length,u),c[l]=!n&&(t||s>=120&&h.length>=120)?new Yn(l&&h):i}h=e[0];var p=-1,f=c[0];e:for(;++p<s&&d.length<u;){var g=h[p],m=t?t(g):g;if(g=n||0!==g?g:0,!(f?Jt(f,m):o(d,m,n))){for(l=a;--l;){var y=c[l];if(!(y?Jt(y,m):o(e[l],m,n)))continue e}f&&f.push(m),d.push(g)}}return d}function Pr(e,t,n){var r=null==(e=Io(e,t=mi(t,e)))?e:e[Mo(Wo(t))];return null==r?i:Ct(r,e,n)}function kr(e){return ea(e)&&Cr(e)==g}function Br(e,t,n,r,o){return e===t||(null==e||null==t||!ea(e)&&!ea(t)?e!=e&&t!=t:function(e,t,n,r,o,s){var a=Ks(e),l=Ks(t),c=a?m:ho(e),u=l?m:ho(t),d=(c=c==g?E:c)==E,h=(u=u==g?E:u)==E,p=c==u;if(p&&zs(e)){if(!zs(t))return!1;a=!0,d=!1}if(p&&!d)return s||(s=new zn),a||la(e)?Xi(e,t,n,r,o,s):function(e,t,n,r,i,o,s){switch(n){case N:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case O:return!(e.byteLength!=t.byteLength||!o(new Ve(e),new Ve(t)));case y:case v:case C:return Ls(+e,+t);case A:return e.name==t.name&&e.message==t.message;case _:case P:return e==t+"";case S:var a=on;case x:var l=1&r;if(a||(a=ln),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=2,s.set(e,t);var u=Xi(a(e),a(t),r,i,o,s);return s.delete(e),u;case k:if(Mn)return Mn.call(e)==Mn.call(t)}return!1}(e,t,c,n,r,o,s);if(!(1&n)){var f=d&&De.call(e,"__wrapped__"),b=h&&De.call(t,"__wrapped__");if(f||b){var w=f?e.value():e,I=b?t.value():t;return s||(s=new zn),o(w,I,n,r,s)}}return!!p&&(s||(s=new zn),function(e,t,n,r,o,s){var a=1&n,l=eo(e),c=l.length;if(c!=eo(t).length&&!a)return!1;for(var u=c;u--;){var d=l[u];if(!(a?d in t:De.call(t,d)))return!1}var h=s.get(e),p=s.get(t);if(h&&p)return h==t&&p==e;var f=!0;s.set(e,t),s.set(t,e);for(var g=a;++u<c;){var m=e[d=l[u]],y=t[d];if(r)var v=a?r(y,m,d,t,e,s):r(m,y,d,e,t,s);if(!(v===i?m===y||o(m,y,n,r,s):v)){f=!1;break}g||(g="constructor"==d)}if(f&&!g){var A=e.constructor,b=t.constructor;A==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof A&&A instanceof A&&"function"==typeof b&&b instanceof b||(f=!1)}return s.delete(e),s.delete(t),f}(e,t,n,r,o,s))}(e,t,n,r,Br,o))}function Or(e,t,n,r){var o=n.length,s=o,a=!r;if(null==e)return!s;for(e=Ee(e);o--;){var l=n[o];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<s;){var c=(l=n[o])[0],u=e[c],d=l[1];if(a&&l[2]){if(u===i&&!(c in e))return!1}else{var h=new zn;if(r)var p=r(u,d,c,e,t,h);if(!(p===i?Br(d,u,3,r,h):p))return!1}}return!0}function Nr(e){return!(!$s(e)||(t=e,Te&&Te in t))&&(qs(e)?Le:ge).test(Fo(e));var t}function Dr(e){return"function"==typeof e?e:null==e?nl:"object"==typeof e?Ks(e)?Rr(e[0],e[1]):Fr(e):dl(e)}function jr(e){if(!wo(e))return gn(e);var t=[];for(var n in Ee(e))De.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Tr(e,t){return e<t}function Mr(e,t){var n=-1,i=Gs(e)?r(e.length):[];return ur(e,(function(e,r,o){i[++n]=t(e,r,o)})),i}function Fr(e){var t=ao(e);return 1==t.length&&t[0][2]?Co(t[0][0],t[0][1]):function(n){return n===e||Or(n,e,t)}}function Rr(e,t){return vo(e)&&So(t)?Co(Mo(e),t):function(n){var r=Ia(n,e);return r===i&&r===t?_a(n,e):Br(t,r,3)}}function Lr(e,t,n,r,o){e!==t&&mr(t,(function(s,a){if(o||(o=new zn),$s(s))!function(e,t,n,r,o,s,a){var l=_o(e,n),c=_o(t,n),u=a.get(c);if(u)Xn(e,n,u);else{var d=s?s(l,c,n+"",e,t,a):i,h=d===i;if(h){var p=Ks(c),f=!p&&zs(c),g=!p&&!f&&la(c);d=c,p||f||g?Ks(l)?d=l:Ys(l)?d=_i(l):f?(h=!1,d=bi(c,!0)):g?(h=!1,d=Si(c,!0)):d=[]:ra(c)||Vs(c)?(d=l,Vs(l)?d=ma(l):$s(l)&&!qs(l)||(d=fo(c))):h=!1}h&&(a.set(c,d),o(d,c,r,s,a),a.delete(c)),Xn(e,n,d)}}(e,t,a,n,Lr,r,o);else{var l=r?r(_o(e,a),s,a+"",e,t,o):i;l===i&&(l=s),Xn(e,a,l)}}),Oa)}function Qr(e,t){var n=e.length;if(n)return mo(t+=t<0?n:0,n)?e[t]:i}function Ur(e,t,n){t=t.length?Ot(t,(function(e){return Ks(e)?function(t){return wr(t,1===e.length?e[0]:e)}:e})):[nl];var r=-1;t=Ot(t,Wt(oo()));var i=Mr(e,(function(e,n,i){var o=Ot(t,(function(t){return t(e)}));return{criteria:o,index:++r,value:e}}));return function(e,t){var r=e.length;for(e.sort((function(e,t){return function(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,s=i.length,a=n.length;++r<s;){var l=Ci(i[r],o[r]);if(l)return r>=a?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}));r--;)e[r]=e[r].value;return e}(i)}function Vr(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var s=t[r],a=wr(e,s);n(a,s)&&qr(o,mi(s,e),a)}return o}function Kr(e,t,n,r){var i=r?Qt:Lt,o=-1,s=t.length,a=e;for(e===t&&(t=_i(t)),n&&(a=Ot(e,Wt(n)));++o<s;)for(var l=0,c=t[o],u=n?n(c):c;(l=i(a,u,l,r))>-1;)a!==e&&ze.call(a,l,1),ze.call(e,l,1);return e}function Hr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;mo(i)?ze.call(e,i,1):li(e,i)}}return e}function Gr(e,t){return e+pt(bn()*(t-e+1))}function Yr(e,t){var n="";if(!e||t<1||t>d)return n;do{t%2&&(n+=e),(t=pt(t/2))&&(e+=e)}while(t);return n}function zr(e,t){return ko(Eo(e,t,nl),e+"")}function Zr(e){return Wn(La(e))}function Wr(e,t){var n=La(e);return No(n,or(t,0,n.length))}function qr(e,t,n,r){if(!$s(e))return e;for(var o=-1,s=(t=mi(t,e)).length,a=s-1,l=e;null!=l&&++o<s;){var c=Mo(t[o]),u=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var d=l[c];(u=r?r(d,c,l):i)===i&&(u=$s(d)?d:mo(t[o+1])?[]:{})}$n(l,c,u),l=l[c]}return e}var Jr=Pn?function(e,t){return Pn.set(e,t),e}:nl,Xr=et?function(e,t){return et(e,"toString",{configurable:!0,enumerable:!1,value:$a(t),writable:!0})}:nl;function $r(e){return No(La(e))}function ei(e,t,n){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var s=r(o);++i<o;)s[i]=e[i+t];return s}function ti(e,t){var n;return ur(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n}function ni(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var o=r+i>>>1,s=e[o];null!==s&&!aa(s)&&(n?s<=t:s<t)?r=o+1:i=o}return i}return ri(e,t,nl,n)}function ri(e,t,n,r){var o=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(t=n(t))!=t,l=null===t,c=aa(t),u=t===i;o<s;){var d=pt((o+s)/2),h=n(e[d]),p=h!==i,f=null===h,g=h==h,m=aa(h);if(a)var y=r||g;else y=u?g&&(r||p):l?g&&p&&(r||!f):c?g&&p&&!f&&(r||!m):!f&&!m&&(r?h<=t:h<t);y?o=d+1:s=d}return yn(s,4294967294)}function ii(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n],a=t?t(s):s;if(!n||!Ls(a,l)){var l=a;o[i++]=0===s?0:s}}return o}function oi(e){return"number"==typeof e?e:aa(e)?h:+e}function si(e){if("string"==typeof e)return e;if(Ks(e))return Ot(e,si)+"";if(aa(e))return Fn?Fn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ai(e,t,n){var r=-1,i=kt,o=e.length,s=!0,a=[],l=a;if(n)s=!1,i=Bt;else if(o>=200){var c=t?null:Yi(e);if(c)return ln(c);s=!1,i=Jt,l=new Yn}else l=t?[]:a;e:for(;++r<o;){var u=e[r],d=t?t(u):u;if(u=n||0!==u?u:0,s&&d==d){for(var h=l.length;h--;)if(l[h]===d)continue e;t&&l.push(d),a.push(u)}else i(l,d,n)||(l!==a&&l.push(d),a.push(u))}return a}function li(e,t){return null==(e=Io(e,t=mi(t,e)))||delete e[Mo(Wo(t))]}function ci(e,t,n,r){return qr(e,t,n(wr(e,t)),r)}function ui(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?ei(e,r?0:o,r?o+1:i):ei(e,r?o+1:0,r?i:o)}function di(e,t){var n=e;return n instanceof Vn&&(n=n.value()),Dt(t,(function(e,t){return t.func.apply(t.thisArg,Nt([e],t.args))}),n)}function hi(e,t,n){var i=e.length;if(i<2)return i?ai(e[0]):[];for(var o=-1,s=r(i);++o<i;)for(var a=e[o],l=-1;++l<i;)l!=o&&(s[o]=cr(s[o]||a,e[l],t,n));return ai(gr(s,1),t,n)}function pi(e,t,n){for(var r=-1,o=e.length,s=t.length,a={};++r<o;){var l=r<s?t[r]:i;n(a,e[r],l)}return a}function fi(e){return Ys(e)?e:[]}function gi(e){return"function"==typeof e?e:nl}function mi(e,t){return Ks(e)?e:vo(e,t)?[e]:To(ya(e))}var yi=zr;function vi(e,t,n){var r=e.length;return n=n===i?r:n,!t&&n>=r?e:ei(e,t,n)}var Ai=st||function(e){return dt.clearTimeout(e)};function bi(e,t){if(t)return e.slice();var n=e.length,r=Ke?Ke(n):new e.constructor(n);return e.copy(r),r}function wi(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function Si(e,t){var n=t?wi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ci(e,t){if(e!==t){var n=e!==i,r=null===e,o=e==e,s=aa(e),a=t!==i,l=null===t,c=t==t,u=aa(t);if(!l&&!u&&!s&&e>t||s&&a&&c&&!l&&!u||r&&a&&c||!n&&c||!o)return 1;if(!r&&!s&&!u&&e<t||u&&n&&o&&!r&&!s||l&&n&&o||!a&&o||!c)return-1}return 0}function Ei(e,t,n,i){for(var o=-1,s=e.length,a=n.length,l=-1,c=t.length,u=mn(s-a,0),d=r(c+u),h=!i;++l<c;)d[l]=t[l];for(;++o<a;)(h||o<s)&&(d[n[o]]=e[o]);for(;u--;)d[l++]=e[o++];return d}function Ii(e,t,n,i){for(var o=-1,s=e.length,a=-1,l=n.length,c=-1,u=t.length,d=mn(s-l,0),h=r(d+u),p=!i;++o<d;)h[o]=e[o];for(var f=o;++c<u;)h[f+c]=t[c];for(;++a<l;)(p||o<s)&&(h[f+n[a]]=e[o++]);return h}function _i(e,t){var n=-1,i=e.length;for(t||(t=r(i));++n<i;)t[n]=e[n];return t}function xi(e,t,n,r){var o=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var l=t[s],c=r?r(n[l],e[l],l,n,e):i;c===i&&(c=e[l]),o?rr(n,l,c):$n(n,l,c)}return n}function Pi(e,t){return function(n,r){var i=Ks(n)?Et:tr,o=t?t():{};return i(n,e,oo(r,2),o)}}function ki(e){return zr((function(t,n){var r=-1,o=n.length,s=o>1?n[o-1]:i,a=o>2?n[2]:i;for(s=e.length>3&&"function"==typeof s?(o--,s):i,a&&yo(n[0],n[1],a)&&(s=o<3?i:s,o=1),t=Ee(t);++r<o;){var l=n[r];l&&e(t,l,r,s)}return t}))}function Bi(e,t){return function(n,r){if(null==n)return n;if(!Gs(n))return e(n,r);for(var i=n.length,o=t?i:-1,s=Ee(n);(t?o--:++o<i)&&!1!==r(s[o],o,s););return n}}function Oi(e){return function(t,n,r){for(var i=-1,o=Ee(t),s=r(t),a=s.length;a--;){var l=s[e?a:++i];if(!1===n(o[l],l,o))break}return t}}function Ni(e){return function(t){var n=rn(t=ya(t))?dn(t):i,r=n?n[0]:t.charAt(0),o=n?vi(n,1).join(""):t.slice(1);return r[e]()+o}}function Di(e){return function(t){return Dt(qa(Va(t).replace(qe,"")),e,"")}}function ji(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Ln(e.prototype),r=e.apply(n,t);return $s(r)?r:n}}function Ti(e){return function(t,n,r){var o=Ee(t);if(!Gs(t)){var s=oo(n,3);t=Ba(t),n=function(e){return s(o[e],e,o)}}var a=e(t,n,r);return a>-1?o[s?t[a]:a]:i}}function Mi(e){return $i((function(t){var n=t.length,r=n,s=Un.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new xe(o);if(s&&!l&&"wrapper"==ro(a))var l=new Un([],!0)}for(r=l?r:n;++r<n;){var c=ro(a=t[r]),u="wrapper"==c?no(a):i;l=u&&Ao(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[ro(u[0])].apply(l,u[3]):1==a.length&&Ao(a)?l[c]():l.thru(a)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&Ks(r))return l.plant(r).value();for(var i=0,o=n?t[i].apply(this,e):r;++i<n;)o=t[i].call(this,o);return o}}))}function Fi(e,t,n,o,s,a,l,u,d,h){var p=t&c,f=1&t,g=2&t,m=24&t,y=512&t,v=g?i:ji(e);return function c(){for(var A=arguments.length,b=r(A),w=A;w--;)b[w]=arguments[w];if(m)var S=io(c),C=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(b,S);if(o&&(b=Ei(b,o,s,m)),a&&(b=Ii(b,a,l,m)),A-=C,m&&A<h){var E=an(b,S);return Hi(e,t,Fi,c.placeholder,n,b,E,u,d,h-A)}var I=f?n:this,_=g?I[e]:e;return A=b.length,u?b=function(e,t){for(var n=e.length,r=yn(t.length,n),o=_i(e);r--;){var s=t[r];e[r]=mo(s,n)?o[s]:i}return e}(b,u):y&&A>1&&b.reverse(),p&&d<A&&(b.length=d),this&&this!==dt&&this instanceof c&&(_=v||ji(_)),_.apply(I,b)}}function Ri(e,t){return function(n,r){return function(e,t,n,r){return vr(e,(function(e,i,o){t(r,n(e),i,o)})),r}(n,e,t(r),{})}}function Li(e,t){return function(n,r){var o;if(n===i&&r===i)return t;if(n!==i&&(o=n),r!==i){if(o===i)return r;"string"==typeof n||"string"==typeof r?(n=si(n),r=si(r)):(n=oi(n),r=oi(r)),o=e(n,r)}return o}}function Qi(e){return $i((function(t){return t=Ot(t,Wt(oo())),zr((function(n){var r=this;return e(t,(function(e){return Ct(e,r,n)}))}))}))}function Ui(e,t){var n=(t=t===i?" ":si(t)).length;if(n<2)return n?Yr(t,e):t;var r=Yr(t,ht(e/un(t)));return rn(t)?vi(dn(r),0,e).join(""):r.slice(0,e)}function Vi(e){return function(t,n,o){return o&&"number"!=typeof o&&yo(t,n,o)&&(n=o=i),t=ha(t),n===i?(n=t,t=0):n=ha(n),function(e,t,n,i){for(var o=-1,s=mn(ht((t-e)/(n||1)),0),a=r(s);s--;)a[i?s:++o]=e,e+=n;return a}(t,n,o=o===i?t<n?1:-1:ha(o),e)}}function Ki(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ga(t),n=ga(n)),e(t,n)}}function Hi(e,t,n,r,o,s,a,c,u,d){var h=8&t;t|=h?l:64,4&(t&=~(h?64:l))||(t&=-4);var p=[e,t,o,h?s:i,h?a:i,h?i:s,h?i:a,c,u,d],f=n.apply(i,p);return Ao(e)&&xo(f,p),f.placeholder=r,Bo(f,e,t)}function Gi(e){var t=Ce[e];return function(e,n){if(e=ga(e),(n=null==n?0:yn(pa(n),292))&&Mt(e)){var r=(ya(e)+"e").split("e");return+((r=(ya(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Yi=In&&1/ln(new In([,-0]))[1]==u?function(e){return new In(e)}:al;function zi(e){return function(t){var n=ho(t);return n==S?on(t):n==x?cn(t):function(e,t){return Ot(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Zi(e,t,n,s,u,d,h,p){var f=2&t;if(!f&&"function"!=typeof e)throw new xe(o);var g=s?s.length:0;if(g||(t&=-97,s=u=i),h=h===i?h:mn(pa(h),0),p=p===i?p:pa(p),g-=u?u.length:0,64&t){var m=s,y=u;s=u=i}var v=f?i:no(e),A=[e,t,n,s,u,m,y,d,h,p];if(v&&function(e,t){var n=e[1],r=t[1],i=n|r,o=i<131,s=r==c&&8==n||r==c&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!o&&!s)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var l=t[3];if(l){var u=e[3];e[3]=u?Ei(u,l,t[4]):l,e[4]=u?an(e[3],a):t[4]}(l=t[5])&&(u=e[5],e[5]=u?Ii(u,l,t[6]):l,e[6]=u?an(e[5],a):t[6]),(l=t[7])&&(e[7]=l),r&c&&(e[8]=null==e[8]?t[8]:yn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(A,v),e=A[0],t=A[1],n=A[2],s=A[3],u=A[4],!(p=A[9]=A[9]===i?f?0:e.length:mn(A[9]-g,0))&&24&t&&(t&=-25),t&&1!=t)b=8==t||16==t?function(e,t,n){var o=ji(e);return function s(){for(var a=arguments.length,l=r(a),c=a,u=io(s);c--;)l[c]=arguments[c];var d=a<3&&l[0]!==u&&l[a-1]!==u?[]:an(l,u);return(a-=d.length)<n?Hi(e,t,Fi,s.placeholder,i,l,d,i,i,n-a):Ct(this&&this!==dt&&this instanceof s?o:e,this,l)}}(e,t,p):t!=l&&33!=t||u.length?Fi.apply(i,A):function(e,t,n,i){var o=1&t,s=ji(e);return function t(){for(var a=-1,l=arguments.length,c=-1,u=i.length,d=r(u+l),h=this&&this!==dt&&this instanceof t?s:e;++c<u;)d[c]=i[c];for(;l--;)d[c++]=arguments[++a];return Ct(h,o?n:this,d)}}(e,t,n,s);else var b=function(e,t,n){var r=1&t,i=ji(e);return function t(){return(this&&this!==dt&&this instanceof t?i:e).apply(r?n:this,arguments)}}(e,t,n);return Bo((v?Jr:xo)(b,A),e,t)}function Wi(e,t,n,r){return e===i||Ls(e,Be[n])&&!De.call(r,n)?t:e}function qi(e,t,n,r,o,s){return $s(e)&&$s(t)&&(s.set(t,e),Lr(e,t,i,qi,s),s.delete(t)),e}function Ji(e){return ra(e)?i:e}function Xi(e,t,n,r,o,s){var a=1&n,l=e.length,c=t.length;if(l!=c&&!(a&&c>l))return!1;var u=s.get(e),d=s.get(t);if(u&&d)return u==t&&d==e;var h=-1,p=!0,f=2&n?new Yn:i;for(s.set(e,t),s.set(t,e);++h<l;){var g=e[h],m=t[h];if(r)var y=a?r(m,g,h,t,e,s):r(g,m,h,e,t,s);if(y!==i){if(y)continue;p=!1;break}if(f){if(!Tt(t,(function(e,t){if(!Jt(f,t)&&(g===e||o(g,e,n,r,s)))return f.push(t)}))){p=!1;break}}else if(g!==m&&!o(g,m,n,r,s)){p=!1;break}}return s.delete(e),s.delete(t),p}function $i(e){return ko(Eo(e,i,Ho),e+"")}function eo(e){return Sr(e,Ba,co)}function to(e){return Sr(e,Oa,uo)}var no=Pn?function(e){return Pn.get(e)}:al;function ro(e){for(var t=e.name+"",n=kn[t],r=De.call(kn,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function io(e){return(De.call(Rn,"placeholder")?Rn:e).placeholder}function oo(){var e=Rn.iteratee||rl;return e=e===rl?Dr:e,arguments.length?e(arguments[0],arguments[1]):e}function so(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function ao(e){for(var t=Ba(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,So(i)]}return t}function lo(e,t){var n=function(e,t){return null==e?i:e[t]}(e,t);return Nr(n)?n:i}var co=gt?function(e){return null==e?[]:(e=Ee(e),Pt(gt(e),(function(t){return Ye.call(e,t)})))}:fl,uo=gt?function(e){for(var t=[];e;)Nt(t,co(e)),e=He(e);return t}:fl,ho=Cr;function po(e,t,n){for(var r=-1,i=(t=mi(t,e)).length,o=!1;++r<i;){var s=Mo(t[r]);if(!(o=null!=e&&n(e,s)))break;e=e[s]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Xs(i)&&mo(s,i)&&(Ks(e)||Vs(e))}function fo(e){return"function"!=typeof e.constructor||wo(e)?{}:Ln(He(e))}function go(e){return Ks(e)||Vs(e)||!!(Ze&&e&&e[Ze])}function mo(e,t){var n=typeof e;return!!(t=null==t?d:t)&&("number"==n||"symbol"!=n&&ye.test(e))&&e>-1&&e%1==0&&e<t}function yo(e,t,n){if(!$s(n))return!1;var r=typeof t;return!!("number"==r?Gs(n)&&mo(t,n.length):"string"==r&&t in n)&&Ls(n[t],e)}function vo(e,t){if(Ks(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!aa(e))||$.test(e)||!X.test(e)||null!=t&&e in Ee(t)}function Ao(e){var t=ro(e),n=Rn[t];if("function"!=typeof n||!(t in Vn.prototype))return!1;if(e===n)return!0;var r=no(n);return!!r&&e===r[0]}(Sn&&ho(new Sn(new ArrayBuffer(1)))!=N||Cn&&ho(new Cn)!=S||En&&ho(En.resolve())!=I||In&&ho(new In)!=x||_n&&ho(new _n)!=B)&&(ho=function(e){var t=Cr(e),n=t==E?e.constructor:i,r=n?Fo(n):"";if(r)switch(r){case Bn:return N;case On:return S;case Nn:return I;case Dn:return x;case jn:return B}return t});var bo=Oe?qs:gl;function wo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Be)}function So(e){return e==e&&!$s(e)}function Co(e,t){return function(n){return null!=n&&n[e]===t&&(t!==i||e in Ee(n))}}function Eo(e,t,n){return t=mn(t===i?e.length-1:t,0),function(){for(var i=arguments,o=-1,s=mn(i.length-t,0),a=r(s);++o<s;)a[o]=i[t+o];o=-1;for(var l=r(t+1);++o<t;)l[o]=i[o];return l[t]=n(a),Ct(e,this,l)}}function Io(e,t){return t.length<2?e:wr(e,ei(t,0,-1))}function _o(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var xo=Oo(Jr),Po=ut||function(e,t){return dt.setTimeout(e,t)},ko=Oo(Xr);function Bo(e,t,n){var r=t+"";return ko(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return It(f,(function(n){var r="_."+n[0];t&n[1]&&!kt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(se);return t?t[1].split(ae):[]}(r),n)))}function Oo(e){var t=0,n=0;return function(){var r=vn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function No(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n<t;){var s=Gr(n,o),a=e[s];e[s]=e[n],e[n]=a}return e.length=t,e}var Do,jo,To=(Do=Ds((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ee,(function(e,n,r,i){t.push(r?i.replace(ue,"$1"):n||e)})),t}),(function(e){return 500===jo.size&&jo.clear(),e})),jo=Do.cache,Do);function Mo(e){if("string"==typeof e||aa(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Fo(e){if(null!=e){try{return Ne.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ro(e){if(e instanceof Vn)return e.clone();var t=new Un(e.__wrapped__,e.__chain__);return t.__actions__=_i(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Lo=zr((function(e,t){return Ys(e)?cr(e,gr(t,1,Ys,!0)):[]})),Qo=zr((function(e,t){var n=Wo(t);return Ys(n)&&(n=i),Ys(e)?cr(e,gr(t,1,Ys,!0),oo(n,2)):[]})),Uo=zr((function(e,t){var n=Wo(t);return Ys(n)&&(n=i),Ys(e)?cr(e,gr(t,1,Ys,!0),i,n):[]}));function Vo(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:pa(n);return i<0&&(i=mn(r+i,0)),Rt(e,oo(t,3),i)}function Ko(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r-1;return n!==i&&(o=pa(n),o=n<0?mn(r+o,0):yn(o,r-1)),Rt(e,oo(t,3),o,!0)}function Ho(e){return null!=e&&e.length?gr(e,1):[]}function Go(e){return e&&e.length?e[0]:i}var Yo=zr((function(e){var t=Ot(e,fi);return t.length&&t[0]===e[0]?xr(t):[]})),zo=zr((function(e){var t=Wo(e),n=Ot(e,fi);return t===Wo(n)?t=i:n.pop(),n.length&&n[0]===e[0]?xr(n,oo(t,2)):[]})),Zo=zr((function(e){var t=Wo(e),n=Ot(e,fi);return(t="function"==typeof t?t:i)&&n.pop(),n.length&&n[0]===e[0]?xr(n,i,t):[]}));function Wo(e){var t=null==e?0:e.length;return t?e[t-1]:i}var qo=zr(Jo);function Jo(e,t){return e&&e.length&&t&&t.length?Kr(e,t):e}var Xo=$i((function(e,t){var n=null==e?0:e.length,r=ir(e,t);return Hr(e,Ot(t,(function(e){return mo(e,n)?+e:e})).sort(Ci)),r}));function $o(e){return null==e?e:wn.call(e)}var es=zr((function(e){return ai(gr(e,1,Ys,!0))})),ts=zr((function(e){var t=Wo(e);return Ys(t)&&(t=i),ai(gr(e,1,Ys,!0),oo(t,2))})),ns=zr((function(e){var t=Wo(e);return t="function"==typeof t?t:i,ai(gr(e,1,Ys,!0),i,t)}));function rs(e){if(!e||!e.length)return[];var t=0;return e=Pt(e,(function(e){if(Ys(e))return t=mn(e.length,t),!0})),zt(t,(function(t){return Ot(e,Kt(t))}))}function is(e,t){if(!e||!e.length)return[];var n=rs(e);return null==t?n:Ot(n,(function(e){return Ct(t,i,e)}))}var os=zr((function(e,t){return Ys(e)?cr(e,t):[]})),ss=zr((function(e){return hi(Pt(e,Ys))})),as=zr((function(e){var t=Wo(e);return Ys(t)&&(t=i),hi(Pt(e,Ys),oo(t,2))})),ls=zr((function(e){var t=Wo(e);return t="function"==typeof t?t:i,hi(Pt(e,Ys),i,t)})),cs=zr(rs),us=zr((function(e){var t=e.length,n=t>1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,is(e,n)}));function ds(e){var t=Rn(e);return t.__chain__=!0,t}function hs(e,t){return t(e)}var ps=$i((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return ir(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Vn&&mo(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:hs,args:[o],thisArg:i}),new Un(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)})),fs=Pi((function(e,t,n){De.call(e,n)?++e[n]:rr(e,n,1)})),gs=Ti(Vo),ms=Ti(Ko);function ys(e,t){return(Ks(e)?It:ur)(e,oo(t,3))}function vs(e,t){return(Ks(e)?_t:dr)(e,oo(t,3))}var As=Pi((function(e,t,n){De.call(e,n)?e[n].push(t):rr(e,n,[t])})),bs=zr((function(e,t,n){var i=-1,o="function"==typeof t,s=Gs(e)?r(e.length):[];return ur(e,(function(e){s[++i]=o?Ct(t,e,n):Pr(e,t,n)})),s})),ws=Pi((function(e,t,n){rr(e,n,t)}));function Ss(e,t){return(Ks(e)?Ot:Mr)(e,oo(t,3))}var Cs=Pi((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]})),Es=zr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&yo(e,t[0],t[1])?t=[]:n>2&&yo(t[0],t[1],t[2])&&(t=[t[0]]),Ur(e,gr(t,1),[])})),Is=ct||function(){return dt.Date.now()};function _s(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Zi(e,c,i,i,i,i,t)}function xs(e,t){var n;if("function"!=typeof t)throw new xe(o);return e=pa(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var Ps=zr((function(e,t,n){var r=1;if(n.length){var i=an(n,io(Ps));r|=l}return Zi(e,r,t,n,i)})),ks=zr((function(e,t,n){var r=3;if(n.length){var i=an(n,io(ks));r|=l}return Zi(t,r,e,n,i)}));function Bs(e,t,n){var r,s,a,l,c,u,d=0,h=!1,p=!1,f=!0;if("function"!=typeof e)throw new xe(o);function g(t){var n=r,o=s;return r=s=i,d=t,l=e.apply(o,n)}function m(e){var n=e-u;return u===i||n>=t||n<0||p&&e-d>=a}function y(){var e=Is();if(m(e))return v(e);c=Po(y,function(e){var n=t-(e-u);return p?yn(n,a-(e-d)):n}(e))}function v(e){return c=i,f&&r?g(e):(r=s=i,l)}function A(){var e=Is(),n=m(e);if(r=arguments,s=this,u=e,n){if(c===i)return function(e){return d=e,c=Po(y,t),h?g(e):l}(u);if(p)return Ai(c),c=Po(y,t),g(u)}return c===i&&(c=Po(y,t)),l}return t=ga(t)||0,$s(n)&&(h=!!n.leading,a=(p="maxWait"in n)?mn(ga(n.maxWait)||0,t):a,f="trailing"in n?!!n.trailing:f),A.cancel=function(){c!==i&&Ai(c),d=0,r=u=s=c=i},A.flush=function(){return c===i?l:v(Is())},A}var Os=zr((function(e,t){return lr(e,1,t)})),Ns=zr((function(e,t,n){return lr(e,ga(t)||0,n)}));function Ds(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new xe(o);var n=function n(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Ds.Cache||Gn),n}function js(e){if("function"!=typeof e)throw new xe(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ds.Cache=Gn;var Ts=yi((function(e,t){var n=(t=1==t.length&&Ks(t[0])?Ot(t[0],Wt(oo())):Ot(gr(t,1),Wt(oo()))).length;return zr((function(r){for(var i=-1,o=yn(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return Ct(e,this,r)}))})),Ms=zr((function(e,t){var n=an(t,io(Ms));return Zi(e,l,i,t,n)})),Fs=zr((function(e,t){var n=an(t,io(Fs));return Zi(e,64,i,t,n)})),Rs=$i((function(e,t){return Zi(e,256,i,i,i,t)}));function Ls(e,t){return e===t||e!=e&&t!=t}var Qs=Ki(Er),Us=Ki((function(e,t){return e>=t})),Vs=kr(function(){return arguments}())?kr:function(e){return ea(e)&&De.call(e,"callee")&&!Ye.call(e,"callee")},Ks=r.isArray,Hs=yt?Wt(yt):function(e){return ea(e)&&Cr(e)==O};function Gs(e){return null!=e&&Xs(e.length)&&!qs(e)}function Ys(e){return ea(e)&&Gs(e)}var zs=mt||gl,Zs=vt?Wt(vt):function(e){return ea(e)&&Cr(e)==v};function Ws(e){if(!ea(e))return!1;var t=Cr(e);return t==A||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ra(e)}function qs(e){if(!$s(e))return!1;var t=Cr(e);return t==b||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Js(e){return"number"==typeof e&&e==pa(e)}function Xs(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=d}function $s(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ea(e){return null!=e&&"object"==typeof e}var ta=At?Wt(At):function(e){return ea(e)&&ho(e)==S};function na(e){return"number"==typeof e||ea(e)&&Cr(e)==C}function ra(e){if(!ea(e)||Cr(e)!=E)return!1;var t=He(e);if(null===t)return!0;var n=De.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ne.call(n)==Fe}var ia=bt?Wt(bt):function(e){return ea(e)&&Cr(e)==_},oa=wt?Wt(wt):function(e){return ea(e)&&ho(e)==x};function sa(e){return"string"==typeof e||!Ks(e)&&ea(e)&&Cr(e)==P}function aa(e){return"symbol"==typeof e||ea(e)&&Cr(e)==k}var la=St?Wt(St):function(e){return ea(e)&&Xs(e.length)&&!!it[Cr(e)]},ca=Ki(Tr),ua=Ki((function(e,t){return e<=t}));function da(e){if(!e)return[];if(Gs(e))return sa(e)?dn(e):_i(e);if(We&&e[We])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[We]());var t=ho(e);return(t==S?on:t==x?ln:La)(e)}function ha(e){return e?(e=ga(e))===u||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function pa(e){var t=ha(e),n=t%1;return t==t?n?t-n:t:0}function fa(e){return e?or(pa(e),0,p):0}function ga(e){if("number"==typeof e)return e;if(aa(e))return h;if($s(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=$s(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Zt(e);var n=fe.test(e);return n||me.test(e)?lt(e.slice(2),n?2:8):pe.test(e)?h:+e}function ma(e){return xi(e,Oa(e))}function ya(e){return null==e?"":si(e)}var va=ki((function(e,t){if(wo(t)||Gs(t))xi(t,Ba(t),e);else for(var n in t)De.call(t,n)&&$n(e,n,t[n])})),Aa=ki((function(e,t){xi(t,Oa(t),e)})),ba=ki((function(e,t,n,r){xi(t,Oa(t),e,r)})),wa=ki((function(e,t,n,r){xi(t,Ba(t),e,r)})),Sa=$i(ir),Ca=zr((function(e,t){e=Ee(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&yo(t[0],t[1],o)&&(r=1);++n<r;)for(var s=t[n],a=Oa(s),l=-1,c=a.length;++l<c;){var u=a[l],d=e[u];(d===i||Ls(d,Be[u])&&!De.call(e,u))&&(e[u]=s[u])}return e})),Ea=zr((function(e){return e.push(i,qi),Ct(Da,i,e)}));function Ia(e,t,n){var r=null==e?i:wr(e,t);return r===i?n:r}function _a(e,t){return null!=e&&po(e,t,_r)}var xa=Ri((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Me.call(t)),e[t]=n}),$a(nl)),Pa=Ri((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Me.call(t)),De.call(e,t)?e[t].push(n):e[t]=[n]}),oo),ka=zr(Pr);function Ba(e){return Gs(e)?Zn(e):jr(e)}function Oa(e){return Gs(e)?Zn(e,!0):function(e){if(!$s(e))return function(e){var t=[];if(null!=e)for(var n in Ee(e))t.push(n);return t}(e);var t=wo(e),n=[];for(var r in e)("constructor"!=r||!t&&De.call(e,r))&&n.push(r);return n}(e)}var Na=ki((function(e,t,n){Lr(e,t,n)})),Da=ki((function(e,t,n,r){Lr(e,t,n,r)})),ja=$i((function(e,t){var n={};if(null==e)return n;var r=!1;t=Ot(t,(function(t){return t=mi(t,e),r||(r=t.length>1),t})),xi(e,to(e),n),r&&(n=sr(n,7,Ji));for(var i=t.length;i--;)li(n,t[i]);return n})),Ta=$i((function(e,t){return null==e?{}:function(e,t){return Vr(e,t,(function(t,n){return _a(e,n)}))}(e,t)}));function Ma(e,t){if(null==e)return{};var n=Ot(to(e),(function(e){return[e]}));return t=oo(t),Vr(e,n,(function(e,n){return t(e,n[0])}))}var Fa=zi(Ba),Ra=zi(Oa);function La(e){return null==e?[]:qt(e,Ba(e))}var Qa=Di((function(e,t,n){return t=t.toLowerCase(),e+(n?Ua(t):t)}));function Ua(e){return Wa(ya(e).toLowerCase())}function Va(e){return(e=ya(e))&&e.replace(ve,en).replace(Je,"")}var Ka=Di((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Ha=Di((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Ga=Ni("toLowerCase"),Ya=Di((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()})),za=Di((function(e,t,n){return e+(n?" ":"")+Wa(t)})),Za=Di((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Wa=Ni("toUpperCase");function qa(e,t,n){return e=ya(e),(t=n?i:t)===i?function(e){return tt.test(e)}(e)?function(e){return e.match($e)||[]}(e):function(e){return e.match(le)||[]}(e):e.match(t)||[]}var Ja=zr((function(e,t){try{return Ct(e,i,t)}catch(e){return Ws(e)?e:new we(e)}})),Xa=$i((function(e,t){return It(t,(function(t){t=Mo(t),rr(e,t,Ps(e[t],e))})),e}));function $a(e){return function(){return e}}var el=Mi(),tl=Mi(!0);function nl(e){return e}function rl(e){return Dr("function"==typeof e?e:sr(e,1))}var il=zr((function(e,t){return function(n){return Pr(n,e,t)}})),ol=zr((function(e,t){return function(n){return Pr(e,n,t)}}));function sl(e,t,n){var r=Ba(t),i=br(t,r);null!=n||$s(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=br(t,Ba(t)));var o=!($s(n)&&"chain"in n&&!n.chain),s=qs(e);return It(i,(function(n){var r=t[n];e[n]=r,s&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=_i(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Nt([this.value()],arguments))})})),e}function al(){}var ll=Qi(Ot),cl=Qi(xt),ul=Qi(Tt);function dl(e){return vo(e)?Kt(Mo(e)):function(e){return function(t){return wr(t,e)}}(e)}var hl=Vi(),pl=Vi(!0);function fl(){return[]}function gl(){return!1}var ml,yl=Li((function(e,t){return e+t}),0),vl=Gi("ceil"),Al=Li((function(e,t){return e/t}),1),bl=Gi("floor"),wl=Li((function(e,t){return e*t}),1),Sl=Gi("round"),Cl=Li((function(e,t){return e-t}),0);return Rn.after=function(e,t){if("function"!=typeof t)throw new xe(o);return e=pa(e),function(){if(--e<1)return t.apply(this,arguments)}},Rn.ary=_s,Rn.assign=va,Rn.assignIn=Aa,Rn.assignInWith=ba,Rn.assignWith=wa,Rn.at=Sa,Rn.before=xs,Rn.bind=Ps,Rn.bindAll=Xa,Rn.bindKey=ks,Rn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ks(e)?e:[e]},Rn.chain=ds,Rn.chunk=function(e,t,n){t=(n?yo(e,t,n):t===i)?1:mn(pa(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var s=0,a=0,l=r(ht(o/t));s<o;)l[a++]=ei(e,s,s+=t);return l},Rn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},Rn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],i=e;i--;)t[i-1]=arguments[i];return Nt(Ks(n)?_i(n):[n],gr(t,1))},Rn.cond=function(e){var t=null==e?0:e.length,n=oo();return e=t?Ot(e,(function(e){if("function"!=typeof e[1])throw new xe(o);return[n(e[0]),e[1]]})):[],zr((function(n){for(var r=-1;++r<t;){var i=e[r];if(Ct(i[0],this,n))return Ct(i[1],this,n)}}))},Rn.conforms=function(e){return function(e){var t=Ba(e);return function(n){return ar(n,e,t)}}(sr(e,1))},Rn.constant=$a,Rn.countBy=fs,Rn.create=function(e,t){var n=Ln(e);return null==t?n:nr(n,t)},Rn.curry=function e(t,n,r){var o=Zi(t,8,i,i,i,i,i,n=r?i:n);return o.placeholder=e.placeholder,o},Rn.curryRight=function e(t,n,r){var o=Zi(t,16,i,i,i,i,i,n=r?i:n);return o.placeholder=e.placeholder,o},Rn.debounce=Bs,Rn.defaults=Ca,Rn.defaultsDeep=Ea,Rn.defer=Os,Rn.delay=Ns,Rn.difference=Lo,Rn.differenceBy=Qo,Rn.differenceWith=Uo,Rn.drop=function(e,t,n){var r=null==e?0:e.length;return r?ei(e,(t=n||t===i?1:pa(t))<0?0:t,r):[]},Rn.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?ei(e,0,(t=r-(t=n||t===i?1:pa(t)))<0?0:t):[]},Rn.dropRightWhile=function(e,t){return e&&e.length?ui(e,oo(t,3),!0,!0):[]},Rn.dropWhile=function(e,t){return e&&e.length?ui(e,oo(t,3),!0):[]},Rn.fill=function(e,t,n,r){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&yo(e,t,n)&&(n=0,r=o),function(e,t,n,r){var o=e.length;for((n=pa(n))<0&&(n=-n>o?0:o+n),(r=r===i||r>o?o:pa(r))<0&&(r+=o),r=n>r?0:fa(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Rn.filter=function(e,t){return(Ks(e)?Pt:fr)(e,oo(t,3))},Rn.flatMap=function(e,t){return gr(Ss(e,t),1)},Rn.flatMapDeep=function(e,t){return gr(Ss(e,t),u)},Rn.flatMapDepth=function(e,t,n){return n=n===i?1:pa(n),gr(Ss(e,t),n)},Rn.flatten=Ho,Rn.flattenDeep=function(e){return null!=e&&e.length?gr(e,u):[]},Rn.flattenDepth=function(e,t){return null!=e&&e.length?gr(e,t=t===i?1:pa(t)):[]},Rn.flip=function(e){return Zi(e,512)},Rn.flow=el,Rn.flowRight=tl,Rn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},Rn.functions=function(e){return null==e?[]:br(e,Ba(e))},Rn.functionsIn=function(e){return null==e?[]:br(e,Oa(e))},Rn.groupBy=As,Rn.initial=function(e){return null!=e&&e.length?ei(e,0,-1):[]},Rn.intersection=Yo,Rn.intersectionBy=zo,Rn.intersectionWith=Zo,Rn.invert=xa,Rn.invertBy=Pa,Rn.invokeMap=bs,Rn.iteratee=rl,Rn.keyBy=ws,Rn.keys=Ba,Rn.keysIn=Oa,Rn.map=Ss,Rn.mapKeys=function(e,t){var n={};return t=oo(t,3),vr(e,(function(e,r,i){rr(n,t(e,r,i),e)})),n},Rn.mapValues=function(e,t){var n={};return t=oo(t,3),vr(e,(function(e,r,i){rr(n,r,t(e,r,i))})),n},Rn.matches=function(e){return Fr(sr(e,1))},Rn.matchesProperty=function(e,t){return Rr(e,sr(t,1))},Rn.memoize=Ds,Rn.merge=Na,Rn.mergeWith=Da,Rn.method=il,Rn.methodOf=ol,Rn.mixin=sl,Rn.negate=js,Rn.nthArg=function(e){return e=pa(e),zr((function(t){return Qr(t,e)}))},Rn.omit=ja,Rn.omitBy=function(e,t){return Ma(e,js(oo(t)))},Rn.once=function(e){return xs(2,e)},Rn.orderBy=function(e,t,n,r){return null==e?[]:(Ks(t)||(t=null==t?[]:[t]),Ks(n=r?i:n)||(n=null==n?[]:[n]),Ur(e,t,n))},Rn.over=ll,Rn.overArgs=Ts,Rn.overEvery=cl,Rn.overSome=ul,Rn.partial=Ms,Rn.partialRight=Fs,Rn.partition=Cs,Rn.pick=Ta,Rn.pickBy=Ma,Rn.property=dl,Rn.propertyOf=function(e){return function(t){return null==e?i:wr(e,t)}},Rn.pull=qo,Rn.pullAll=Jo,Rn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Kr(e,t,oo(n,2)):e},Rn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Kr(e,t,i,n):e},Rn.pullAt=Xo,Rn.range=hl,Rn.rangeRight=pl,Rn.rearg=Rs,Rn.reject=function(e,t){return(Ks(e)?Pt:fr)(e,js(oo(t,3)))},Rn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=oo(t,3);++r<o;){var s=e[r];t(s,r,e)&&(n.push(s),i.push(r))}return Hr(e,i),n},Rn.rest=function(e,t){if("function"!=typeof e)throw new xe(o);return zr(e,t=t===i?t:pa(t))},Rn.reverse=$o,Rn.sampleSize=function(e,t,n){return t=(n?yo(e,t,n):t===i)?1:pa(t),(Ks(e)?qn:Wr)(e,t)},Rn.set=function(e,t,n){return null==e?e:qr(e,t,n)},Rn.setWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:qr(e,t,n,r)},Rn.shuffle=function(e){return(Ks(e)?Jn:$r)(e)},Rn.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&yo(e,t,n)?(t=0,n=r):(t=null==t?0:pa(t),n=n===i?r:pa(n)),ei(e,t,n)):[]},Rn.sortBy=Es,Rn.sortedUniq=function(e){return e&&e.length?ii(e):[]},Rn.sortedUniqBy=function(e,t){return e&&e.length?ii(e,oo(t,2)):[]},Rn.split=function(e,t,n){return n&&"number"!=typeof n&&yo(e,t,n)&&(t=n=i),(n=n===i?p:n>>>0)?(e=ya(e))&&("string"==typeof t||null!=t&&!ia(t))&&!(t=si(t))&&rn(e)?vi(dn(e),0,n):e.split(t,n):[]},Rn.spread=function(e,t){if("function"!=typeof e)throw new xe(o);return t=null==t?0:mn(pa(t),0),zr((function(n){var r=n[t],i=vi(n,0,t);return r&&Nt(i,r),Ct(e,this,i)}))},Rn.tail=function(e){var t=null==e?0:e.length;return t?ei(e,1,t):[]},Rn.take=function(e,t,n){return e&&e.length?ei(e,0,(t=n||t===i?1:pa(t))<0?0:t):[]},Rn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?ei(e,(t=r-(t=n||t===i?1:pa(t)))<0?0:t,r):[]},Rn.takeRightWhile=function(e,t){return e&&e.length?ui(e,oo(t,3),!1,!0):[]},Rn.takeWhile=function(e,t){return e&&e.length?ui(e,oo(t,3)):[]},Rn.tap=function(e,t){return t(e),e},Rn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new xe(o);return $s(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Bs(e,t,{leading:r,maxWait:t,trailing:i})},Rn.thru=hs,Rn.toArray=da,Rn.toPairs=Fa,Rn.toPairsIn=Ra,Rn.toPath=function(e){return Ks(e)?Ot(e,Mo):aa(e)?[e]:_i(To(ya(e)))},Rn.toPlainObject=ma,Rn.transform=function(e,t,n){var r=Ks(e),i=r||zs(e)||la(e);if(t=oo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:$s(e)&&qs(o)?Ln(He(e)):{}}return(i?It:vr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Rn.unary=function(e){return _s(e,1)},Rn.union=es,Rn.unionBy=ts,Rn.unionWith=ns,Rn.uniq=function(e){return e&&e.length?ai(e):[]},Rn.uniqBy=function(e,t){return e&&e.length?ai(e,oo(t,2)):[]},Rn.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?ai(e,i,t):[]},Rn.unset=function(e,t){return null==e||li(e,t)},Rn.unzip=rs,Rn.unzipWith=is,Rn.update=function(e,t,n){return null==e?e:ci(e,t,gi(n))},Rn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:ci(e,t,gi(n),r)},Rn.values=La,Rn.valuesIn=function(e){return null==e?[]:qt(e,Oa(e))},Rn.without=os,Rn.words=qa,Rn.wrap=function(e,t){return Ms(gi(t),e)},Rn.xor=ss,Rn.xorBy=as,Rn.xorWith=ls,Rn.zip=cs,Rn.zipObject=function(e,t){return pi(e||[],t||[],$n)},Rn.zipObjectDeep=function(e,t){return pi(e||[],t||[],qr)},Rn.zipWith=us,Rn.entries=Fa,Rn.entriesIn=Ra,Rn.extend=Aa,Rn.extendWith=ba,sl(Rn,Rn),Rn.add=yl,Rn.attempt=Ja,Rn.camelCase=Qa,Rn.capitalize=Ua,Rn.ceil=vl,Rn.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=ga(n))==n?n:0),t!==i&&(t=(t=ga(t))==t?t:0),or(ga(e),t,n)},Rn.clone=function(e){return sr(e,4)},Rn.cloneDeep=function(e){return sr(e,5)},Rn.cloneDeepWith=function(e,t){return sr(e,5,t="function"==typeof t?t:i)},Rn.cloneWith=function(e,t){return sr(e,4,t="function"==typeof t?t:i)},Rn.conformsTo=function(e,t){return null==t||ar(e,t,Ba(t))},Rn.deburr=Va,Rn.defaultTo=function(e,t){return null==e||e!=e?t:e},Rn.divide=Al,Rn.endsWith=function(e,t,n){e=ya(e),t=si(t);var r=e.length,o=n=n===i?r:or(pa(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Rn.eq=Ls,Rn.escape=function(e){return(e=ya(e))&&Z.test(e)?e.replace(Y,tn):e},Rn.escapeRegExp=function(e){return(e=ya(e))&&ne.test(e)?e.replace(te,"\\$&"):e},Rn.every=function(e,t,n){var r=Ks(e)?xt:hr;return n&&yo(e,t,n)&&(t=i),r(e,oo(t,3))},Rn.find=gs,Rn.findIndex=Vo,Rn.findKey=function(e,t){return Ft(e,oo(t,3),vr)},Rn.findLast=ms,Rn.findLastIndex=Ko,Rn.findLastKey=function(e,t){return Ft(e,oo(t,3),Ar)},Rn.floor=bl,Rn.forEach=ys,Rn.forEachRight=vs,Rn.forIn=function(e,t){return null==e?e:mr(e,oo(t,3),Oa)},Rn.forInRight=function(e,t){return null==e?e:yr(e,oo(t,3),Oa)},Rn.forOwn=function(e,t){return e&&vr(e,oo(t,3))},Rn.forOwnRight=function(e,t){return e&&Ar(e,oo(t,3))},Rn.get=Ia,Rn.gt=Qs,Rn.gte=Us,Rn.has=function(e,t){return null!=e&&po(e,t,Ir)},Rn.hasIn=_a,Rn.head=Go,Rn.identity=nl,Rn.includes=function(e,t,n,r){e=Gs(e)?e:La(e),n=n&&!r?pa(n):0;var i=e.length;return n<0&&(n=mn(i+n,0)),sa(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Lt(e,t,n)>-1},Rn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:pa(n);return i<0&&(i=mn(r+i,0)),Lt(e,t,i)},Rn.inRange=function(e,t,n){return t=ha(t),n===i?(n=t,t=0):n=ha(n),function(e,t,n){return e>=yn(t,n)&&e<mn(t,n)}(e=ga(e),t,n)},Rn.invoke=ka,Rn.isArguments=Vs,Rn.isArray=Ks,Rn.isArrayBuffer=Hs,Rn.isArrayLike=Gs,Rn.isArrayLikeObject=Ys,Rn.isBoolean=function(e){return!0===e||!1===e||ea(e)&&Cr(e)==y},Rn.isBuffer=zs,Rn.isDate=Zs,Rn.isElement=function(e){return ea(e)&&1===e.nodeType&&!ra(e)},Rn.isEmpty=function(e){if(null==e)return!0;if(Gs(e)&&(Ks(e)||"string"==typeof e||"function"==typeof e.splice||zs(e)||la(e)||Vs(e)))return!e.length;var t=ho(e);if(t==S||t==x)return!e.size;if(wo(e))return!jr(e).length;for(var n in e)if(De.call(e,n))return!1;return!0},Rn.isEqual=function(e,t){return Br(e,t)},Rn.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:i)?n(e,t):i;return r===i?Br(e,t,i,n):!!r},Rn.isError=Ws,Rn.isFinite=function(e){return"number"==typeof e&&Mt(e)},Rn.isFunction=qs,Rn.isInteger=Js,Rn.isLength=Xs,Rn.isMap=ta,Rn.isMatch=function(e,t){return e===t||Or(e,t,ao(t))},Rn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:i,Or(e,t,ao(t),n)},Rn.isNaN=function(e){return na(e)&&e!=+e},Rn.isNative=function(e){if(bo(e))throw new we("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Nr(e)},Rn.isNil=function(e){return null==e},Rn.isNull=function(e){return null===e},Rn.isNumber=na,Rn.isObject=$s,Rn.isObjectLike=ea,Rn.isPlainObject=ra,Rn.isRegExp=ia,Rn.isSafeInteger=function(e){return Js(e)&&e>=-9007199254740991&&e<=d},Rn.isSet=oa,Rn.isString=sa,Rn.isSymbol=aa,Rn.isTypedArray=la,Rn.isUndefined=function(e){return e===i},Rn.isWeakMap=function(e){return ea(e)&&ho(e)==B},Rn.isWeakSet=function(e){return ea(e)&&"[object WeakSet]"==Cr(e)},Rn.join=function(e,t){return null==e?"":Ht.call(e,t)},Rn.kebabCase=Ka,Rn.last=Wo,Rn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=pa(n))<0?mn(r+o,0):yn(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Rt(e,Ut,o,!0)},Rn.lowerCase=Ha,Rn.lowerFirst=Ga,Rn.lt=ca,Rn.lte=ua,Rn.max=function(e){return e&&e.length?pr(e,nl,Er):i},Rn.maxBy=function(e,t){return e&&e.length?pr(e,oo(t,2),Er):i},Rn.mean=function(e){return Vt(e,nl)},Rn.meanBy=function(e,t){return Vt(e,oo(t,2))},Rn.min=function(e){return e&&e.length?pr(e,nl,Tr):i},Rn.minBy=function(e,t){return e&&e.length?pr(e,oo(t,2),Tr):i},Rn.stubArray=fl,Rn.stubFalse=gl,Rn.stubObject=function(){return{}},Rn.stubString=function(){return""},Rn.stubTrue=function(){return!0},Rn.multiply=wl,Rn.nth=function(e,t){return e&&e.length?Qr(e,pa(t)):i},Rn.noConflict=function(){return dt._===this&&(dt._=Re),this},Rn.noop=al,Rn.now=Is,Rn.pad=function(e,t,n){e=ya(e);var r=(t=pa(t))?un(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Ui(pt(i),n)+e+Ui(ht(i),n)},Rn.padEnd=function(e,t,n){e=ya(e);var r=(t=pa(t))?un(e):0;return t&&r<t?e+Ui(t-r,n):e},Rn.padStart=function(e,t,n){e=ya(e);var r=(t=pa(t))?un(e):0;return t&&r<t?Ui(t-r,n)+e:e},Rn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),An(ya(e).replace(re,""),t||0)},Rn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&yo(e,t,n)&&(t=n=i),n===i&&("boolean"==typeof t?(n=t,t=i):"boolean"==typeof e&&(n=e,e=i)),e===i&&t===i?(e=0,t=1):(e=ha(e),t===i?(t=e,e=0):t=ha(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var o=bn();return yn(e+o*(t-e+at("1e-"+((o+"").length-1))),t)}return Gr(e,t)},Rn.reduce=function(e,t,n){var r=Ks(e)?Dt:Gt,i=arguments.length<3;return r(e,oo(t,4),n,i,ur)},Rn.reduceRight=function(e,t,n){var r=Ks(e)?jt:Gt,i=arguments.length<3;return r(e,oo(t,4),n,i,dr)},Rn.repeat=function(e,t,n){return t=(n?yo(e,t,n):t===i)?1:pa(t),Yr(ya(e),t)},Rn.replace=function(){var e=arguments,t=ya(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Rn.result=function(e,t,n){var r=-1,o=(t=mi(t,e)).length;for(o||(o=1,e=i);++r<o;){var s=null==e?i:e[Mo(t[r])];s===i&&(r=o,s=n),e=qs(s)?s.call(e):s}return e},Rn.round=Sl,Rn.runInContext=e,Rn.sample=function(e){return(Ks(e)?Wn:Zr)(e)},Rn.size=function(e){if(null==e)return 0;if(Gs(e))return sa(e)?un(e):e.length;var t=ho(e);return t==S||t==x?e.size:jr(e).length},Rn.snakeCase=Ya,Rn.some=function(e,t,n){var r=Ks(e)?Tt:ti;return n&&yo(e,t,n)&&(t=i),r(e,oo(t,3))},Rn.sortedIndex=function(e,t){return ni(e,t)},Rn.sortedIndexBy=function(e,t,n){return ri(e,t,oo(n,2))},Rn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=ni(e,t);if(r<n&&Ls(e[r],t))return r}return-1},Rn.sortedLastIndex=function(e,t){return ni(e,t,!0)},Rn.sortedLastIndexBy=function(e,t,n){return ri(e,t,oo(n,2),!0)},Rn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=ni(e,t,!0)-1;if(Ls(e[n],t))return n}return-1},Rn.startCase=za,Rn.startsWith=function(e,t,n){return e=ya(e),n=null==n?0:or(pa(n),0,e.length),t=si(t),e.slice(n,n+t.length)==t},Rn.subtract=Cl,Rn.sum=function(e){return e&&e.length?Yt(e,nl):0},Rn.sumBy=function(e,t){return e&&e.length?Yt(e,oo(t,2)):0},Rn.template=function(e,t,n){var r=Rn.templateSettings;n&&yo(e,t,n)&&(t=i),e=ya(e),t=ba({},t,r,Wi);var o,s,a=ba({},t.imports,r.imports,Wi),l=Ba(a),c=qt(a,l),u=0,d=t.interpolate||Ae,h="__p += '",p=Ie((t.escape||Ae).source+"|"+d.source+"|"+(d===J?de:Ae).source+"|"+(t.evaluate||Ae).source+"|$","g"),f="//# sourceURL="+(De.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++rt+"]")+"\n";e.replace(p,(function(t,n,r,i,a,l){return r||(r=i),h+=e.slice(u,l).replace(be,nn),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),a&&(s=!0,h+="';\n"+a+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=l+t.length,t})),h+="';\n";var g=De.call(t,"variable")&&t.variable;if(g){if(ce.test(g))throw new we("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(s?h.replace(V,""):h).replace(K,"$1").replace(H,"$1;"),h="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var m=Ja((function(){return Se(l,f+"return "+h).apply(i,c)}));if(m.source=h,Ws(m))throw m;return m},Rn.times=function(e,t){if((e=pa(e))<1||e>d)return[];var n=p,r=yn(e,p);t=oo(t),e-=p;for(var i=zt(r,t);++n<e;)t(n);return i},Rn.toFinite=ha,Rn.toInteger=pa,Rn.toLength=fa,Rn.toLower=function(e){return ya(e).toLowerCase()},Rn.toNumber=ga,Rn.toSafeInteger=function(e){return e?or(pa(e),-9007199254740991,d):0===e?e:0},Rn.toString=ya,Rn.toUpper=function(e){return ya(e).toUpperCase()},Rn.trim=function(e,t,n){if((e=ya(e))&&(n||t===i))return Zt(e);if(!e||!(t=si(t)))return e;var r=dn(e),o=dn(t);return vi(r,Xt(r,o),$t(r,o)+1).join("")},Rn.trimEnd=function(e,t,n){if((e=ya(e))&&(n||t===i))return e.slice(0,hn(e)+1);if(!e||!(t=si(t)))return e;var r=dn(e);return vi(r,0,$t(r,dn(t))+1).join("")},Rn.trimStart=function(e,t,n){if((e=ya(e))&&(n||t===i))return e.replace(re,"");if(!e||!(t=si(t)))return e;var r=dn(e);return vi(r,Xt(r,dn(t))).join("")},Rn.truncate=function(e,t){var n=30,r="...";if($s(t)){var o="separator"in t?t.separator:o;n="length"in t?pa(t.length):n,r="omission"in t?si(t.omission):r}var s=(e=ya(e)).length;if(rn(e)){var a=dn(e);s=a.length}if(n>=s)return e;var l=n-un(r);if(l<1)return r;var c=a?vi(a,0,l).join(""):e.slice(0,l);if(o===i)return c+r;if(a&&(l+=c.length-l),ia(o)){if(e.slice(l).search(o)){var u,d=c;for(o.global||(o=Ie(o.source,ya(he.exec(o))+"g")),o.lastIndex=0;u=o.exec(d);)var h=u.index;c=c.slice(0,h===i?l:h)}}else if(e.indexOf(si(o),l)!=l){var p=c.lastIndexOf(o);p>-1&&(c=c.slice(0,p))}return c+r},Rn.unescape=function(e){return(e=ya(e))&&z.test(e)?e.replace(G,pn):e},Rn.uniqueId=function(e){var t=++je;return ya(e)+t},Rn.upperCase=Za,Rn.upperFirst=Wa,Rn.each=ys,Rn.eachRight=vs,Rn.first=Go,sl(Rn,(ml={},vr(Rn,(function(e,t){De.call(Rn.prototype,t)||(ml[t]=e)})),ml),{chain:!1}),Rn.VERSION="4.17.21",It(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Rn[e].placeholder=Rn})),It(["drop","take"],(function(e,t){Vn.prototype[e]=function(n){n=n===i?1:mn(pa(n),0);var r=this.__filtered__&&!t?new Vn(this):this.clone();return r.__filtered__?r.__takeCount__=yn(n,r.__takeCount__):r.__views__.push({size:yn(n,p),type:e+(r.__dir__<0?"Right":"")}),r},Vn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),It(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Vn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:oo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),It(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Vn.prototype[e]=function(){return this[n](1).value()[0]}})),It(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Vn.prototype[e]=function(){return this.__filtered__?new Vn(this):this[n](1)}})),Vn.prototype.compact=function(){return this.filter(nl)},Vn.prototype.find=function(e){return this.filter(e).head()},Vn.prototype.findLast=function(e){return this.reverse().find(e)},Vn.prototype.invokeMap=zr((function(e,t){return"function"==typeof e?new Vn(this):this.map((function(n){return Pr(n,e,t)}))})),Vn.prototype.reject=function(e){return this.filter(js(oo(e)))},Vn.prototype.slice=function(e,t){e=pa(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Vn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=pa(t))<0?n.dropRight(-t):n.take(t-e)),n)},Vn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Vn.prototype.toArray=function(){return this.take(p)},vr(Vn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Rn[r?"take"+("last"==t?"Right":""):t],s=r||/^find/.test(t);o&&(Rn.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,l=t instanceof Vn,c=a[0],u=l||Ks(t),d=function(e){var t=o.apply(Rn,Nt([e],a));return r&&h?t[0]:t};u&&n&&"function"==typeof c&&1!=c.length&&(l=u=!1);var h=this.__chain__,p=!!this.__actions__.length,f=s&&!h,g=l&&!p;if(!s&&u){t=g?t:new Vn(this);var m=e.apply(t,a);return m.__actions__.push({func:hs,args:[d],thisArg:i}),new Un(m,h)}return f&&g?e.apply(this,a):(m=this.thru(d),f?r?m.value()[0]:m.value():m)})})),It(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Pe[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Rn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ks(i)?i:[],e)}return this[n]((function(n){return t.apply(Ks(n)?n:[],e)}))}})),vr(Vn.prototype,(function(e,t){var n=Rn[t];if(n){var r=n.name+"";De.call(kn,r)||(kn[r]=[]),kn[r].push({name:t,func:n})}})),kn[Fi(i,2).name]=[{name:"wrapper",func:i}],Vn.prototype.clone=function(){var e=new Vn(this.__wrapped__);return e.__actions__=_i(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=_i(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=_i(this.__views__),e},Vn.prototype.reverse=function(){if(this.__filtered__){var e=new Vn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Vn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ks(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=yn(t,e+s);break;case"takeRight":e=mn(e,t-s)}}return{start:e,end:t}}(0,i,this.__views__),s=o.start,a=o.end,l=a-s,c=r?a:s-1,u=this.__iteratees__,d=u.length,h=0,p=yn(l,this.__takeCount__);if(!n||!r&&i==l&&p==l)return di(e,this.__actions__);var f=[];e:for(;l--&&h<p;){for(var g=-1,m=e[c+=t];++g<d;){var y=u[g],v=y.iteratee,A=y.type,b=v(m);if(2==A)m=b;else if(!b){if(1==A)continue e;break e}}f[h++]=m}return f},Rn.prototype.at=ps,Rn.prototype.chain=function(){return ds(this)},Rn.prototype.commit=function(){return new Un(this.value(),this.__chain__)},Rn.prototype.next=function(){this.__values__===i&&(this.__values__=da(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Rn.prototype.plant=function(e){for(var t,n=this;n instanceof Qn;){var r=Ro(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Rn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Vn){var t=e;return this.__actions__.length&&(t=new Vn(this)),(t=t.reverse()).__actions__.push({func:hs,args:[$o],thisArg:i}),new Un(t,this.__chain__)}return this.thru($o)},Rn.prototype.toJSON=Rn.prototype.valueOf=Rn.prototype.value=function(){return di(this.__wrapped__,this.__actions__)},Rn.prototype.first=Rn.prototype.head,We&&(Rn.prototype[We]=function(){return this}),Rn}();dt._=fn,(r=function(){return fn}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},70439:(e,t,n)=>{const r=n(37520),i=Symbol("max"),o=Symbol("length"),s=Symbol("lengthCalculator"),a=Symbol("allowStale"),l=Symbol("maxAge"),c=Symbol("dispose"),u=Symbol("noDisposeOnSet"),d=Symbol("lruList"),h=Symbol("cache"),p=Symbol("updateAgeOnGet"),f=()=>1,g=(e,t,n)=>{const r=e[h].get(t);if(r){const t=r.value;if(m(e,t)){if(v(e,r),!e[a])return}else n&&(e[p]&&(r.value.now=Date.now()),e[d].unshiftNode(r));return t.value}},m=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[l]&&n>e[l]},y=e=>{if(e[o]>e[i])for(let t=e[d].tail;e[o]>e[i]&&null!==t;){const n=t.prev;v(e,t),t=n}},v=(e,t)=>{if(t){const n=t.value;e[c]&&e[c](n.key,n.value),e[o]-=n.length,e[h].delete(n.key),e[d].removeNode(t)}};class A{constructor(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}}const b=(e,t,n,r)=>{let i=n.value;m(e,i)&&(v(e,n),e[a]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[i]=e.max||1/0;const t=e.length||f;if(this[s]="function"!=typeof t?f:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[c]=e.dispose,this[u]=e.noDisposeOnSet||!1,this[p]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,y(this)}get max(){return this[i]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,y(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=f),e!==this[s]&&(this[s]=e,this[o]=0,this[d].forEach((e=>{e.length=this[s](e.value,e.key),this[o]+=e.length}))),y(this)}get lengthCalculator(){return this[s]}get length(){return this[o]}get itemCount(){return this[d].length}rforEach(e,t){t=t||this;for(let n=this[d].tail;null!==n;){const r=n.prev;b(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[d].head;null!==n;){const r=n.next;b(this,e,n,t),n=r}}keys(){return this[d].toArray().map((e=>e.key))}values(){return this[d].toArray().map((e=>e.value))}reset(){this[c]&&this[d]&&this[d].length&&this[d].forEach((e=>this[c](e.key,e.value))),this[h]=new Map,this[d]=new r,this[o]=0}dump(){return this[d].map((e=>!m(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[d]}set(e,t,n){if((n=n||this[l])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const r=n?Date.now():0,a=this[s](t,e);if(this[h].has(e)){if(a>this[i])return v(this,this[h].get(e)),!1;const s=this[h].get(e).value;return this[c]&&(this[u]||this[c](e,s.value)),s.now=r,s.maxAge=n,s.value=t,this[o]+=a-s.length,s.length=a,this.get(e),y(this),!0}const p=new A(e,t,a,r,n);return p.length>this[i]?(this[c]&&this[c](e,t),!1):(this[o]+=p.length,this[d].unshift(p),this[h].set(e,this[d].head),y(this),!0)}has(e){if(!this[h].has(e))return!1;const t=this[h].get(e).value;return!m(this,t)}get(e){return g(this,e,!0)}peek(e){return g(this,e,!1)}pop(){const e=this[d].tail;return e?(v(this,e),e.value):null}del(e){v(this,this[h].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{const e=i-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[h].forEach(((e,t)=>g(this,t,!1)))}}},74732:(e,t,n)=>{const r=Symbol("SemVer ANY");class i{static get ANY(){return r}constructor(e,t){if(t=o(t),e instanceof i){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),c("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===r?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(e){const t=this.options.loose?s[a.COMPARATORLOOSE]:s[a.COMPARATOR],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: ".concat(e));this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new u(n[2],this.options.loose):this.semver=r}toString(){return this.value}test(e){if(c("Comparator.test",e,this.options.loose),this.semver===r||e===r)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):!((t=o(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=i;const o=n(81042),{safeRe:s,t:a}=n(47045),l=n(30706),c=n(52997),u=n(47566),d=n(13246)},13246:(e,t,n)=>{class r{constructor(e,t){if(t=o(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof s)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(this.raw));if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!m(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&y(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&f)|(this.options.loose&&g))+":"+e,n=i.get(t);if(n)return n;const r=this.options.loose,o=r?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(o,k(this.options.includePrerelease)),a("hyphen replace",e),e=e.replace(c[u.COMPARATORTRIM],d),a("comparator trim",e),e=e.replace(c[u.TILDETRIM],h),a("tilde trim",e),e=e.replace(c[u.CARETTRIM],p),a("caret trim",e);let l=e.split(" ").map((e=>A(e,this.options))).join(" ").split(/\s+/).map((e=>P(e,this.options)));r&&(l=l.filter((e=>(a("loose invalid filter",e,this.options),!!e.match(c[u.COMPARATORLOOSE]))))),a("range list",l);const y=new Map,v=l.map((e=>new s(e,this.options)));for(const e of v){if(m(e))return[e];y.set(e.value,e)}y.size>1&&y.has("")&&y.delete("");const b=[...y.values()];return i.set(t,b),b}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some((n=>v(n,t)&&e.set.some((e=>v(e,t)&&n.every((n=>e.every((e=>n.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(B(this.set[t],e,this.options))return!0;return!1}}e.exports=r;const i=new(n(70439))({max:1e3}),o=n(81042),s=n(74732),a=n(52997),l=n(47566),{safeRe:c,t:u,comparatorTrimReplace:d,tildeTrimReplace:h,caretTrimReplace:p}=n(47045),{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:g}=n(46212),m=e=>"<0.0.0-0"===e.value,y=e=>""===e.value,v=(e,t)=>{let n=!0;const r=e.slice();let i=r.pop();for(;n&&r.length;)n=r.every((e=>i.intersects(e,t))),i=r.pop();return n},A=(e,t)=>(a("comp",e,t),e=C(e,t),a("caret",e),e=w(e,t),a("tildes",e),e=I(e,t),a("xrange",e),e=x(e,t),a("stars",e),e),b=e=>!e||"x"===e.toLowerCase()||"*"===e,w=(e,t)=>e.trim().split(/\s+/).map((e=>S(e,t))).join(" "),S=(e,t)=>{const n=t.loose?c[u.TILDELOOSE]:c[u.TILDE];return e.replace(n,((t,n,r,i,o)=>{let s;return a("tilde",e,t,n,r,i,o),b(n)?s="":b(r)?s=">=".concat(n,".0.0 <").concat(+n+1,".0.0-0"):b(i)?s=">=".concat(n,".").concat(r,".0 <").concat(n,".").concat(+r+1,".0-0"):o?(a("replaceTilde pr",o),s=">=".concat(n,".").concat(r,".").concat(i,"-").concat(o," <").concat(n,".").concat(+r+1,".0-0")):s=">=".concat(n,".").concat(r,".").concat(i," <").concat(n,".").concat(+r+1,".0-0"),a("tilde return",s),s}))},C=(e,t)=>e.trim().split(/\s+/).map((e=>E(e,t))).join(" "),E=(e,t)=>{a("caret",e,t);const n=t.loose?c[u.CARETLOOSE]:c[u.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,i,o,s)=>{let l;return a("caret",e,t,n,i,o,s),b(n)?l="":b(i)?l=">=".concat(n,".0.0").concat(r," <").concat(+n+1,".0.0-0"):b(o)?l="0"===n?">=".concat(n,".").concat(i,".0").concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".0").concat(r," <").concat(+n+1,".0.0-0"):s?(a("replaceCaret pr",s),l="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(o,"-").concat(s," <").concat(n,".").concat(i,".").concat(+o+1,"-0"):">=".concat(n,".").concat(i,".").concat(o,"-").concat(s," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(o,"-").concat(s," <").concat(+n+1,".0.0-0")):(a("no pr"),l="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(o).concat(r," <").concat(n,".").concat(i,".").concat(+o+1,"-0"):">=".concat(n,".").concat(i,".").concat(o).concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(o," <").concat(+n+1,".0.0-0")),a("caret return",l),l}))},I=(e,t)=>(a("replaceXRanges",e,t),e.split(/\s+/).map((e=>_(e,t))).join(" ")),_=(e,t)=>{e=e.trim();const n=t.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return e.replace(n,((n,r,i,o,s,l)=>{a("xRange",e,n,r,i,o,s,l);const c=b(i),u=c||b(o),d=u||b(s),h=d;return"="===r&&h&&(r=""),l=t.includePrerelease?"-0":"",c?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&h?(u&&(o=0),s=0,">"===r?(r=">=",u?(i=+i+1,o=0,s=0):(o=+o+1,s=0)):"<="===r&&(r="<",u?i=+i+1:o=+o+1),"<"===r&&(l="-0"),n="".concat(r+i,".").concat(o,".").concat(s).concat(l)):u?n=">=".concat(i,".0.0").concat(l," <").concat(+i+1,".0.0-0"):d&&(n=">=".concat(i,".").concat(o,".0").concat(l," <").concat(i,".").concat(+o+1,".0-0")),a("xRange return",n),n}))},x=(e,t)=>(a("replaceStars",e,t),e.trim().replace(c[u.STAR],"")),P=(e,t)=>(a("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?u.GTE0PRE:u.GTE0],"")),k=e=>(t,n,r,i,o,s,a,l,c,u,d,h,p)=>(n=b(r)?"":b(i)?">=".concat(r,".0.0").concat(e?"-0":""):b(o)?">=".concat(r,".").concat(i,".0").concat(e?"-0":""):s?">=".concat(n):">=".concat(n).concat(e?"-0":""),l=b(c)?"":b(u)?"<".concat(+c+1,".0.0-0"):b(d)?"<".concat(c,".").concat(+u+1,".0-0"):h?"<=".concat(c,".").concat(u,".").concat(d,"-").concat(h):e?"<".concat(c,".").concat(u,".").concat(+d+1,"-0"):"<=".concat(l),"".concat(n," ").concat(l).trim()),B=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(a(e[n].semver),e[n].semver!==s.ANY&&e[n].semver.prerelease.length>0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}},47566:(e,t,n)=>{const r=n(52997),{MAX_LENGTH:i,MAX_SAFE_INTEGER:o}=n(46212),{safeRe:s,t:a}=n(47045),l=n(81042),{compareIdentifiers:c}=n(70476);class u{constructor(e,t){if(t=l(t),e instanceof u){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError('Invalid version. Must be a string. Got type "'.concat(typeof e,'".'));if(e.length>i)throw new TypeError("version is longer than ".concat(i," characters"));r("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?s[a.LOOSE]:s[a.FULL]);if(!n)throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<o)return t}return e})):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version="".concat(this.major,".").concat(this.minor,".").concat(this.patch),this.prerelease.length&&(this.version+="-".concat(this.prerelease.join("."))),this.version}toString(){return this.version}compare(e){if(r("SemVer.compare",this.version,this.options,e),!(e instanceof u)){if("string"==typeof e&&e===this.version)return 0;e=new u(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof u||(e=new u(e,this.options)),c(this.major,e.major)||c(this.minor,e.minor)||c(this.patch,e.patch)}comparePre(e){if(e instanceof u||(e=new u(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const n=this.prerelease[t],i=e.prerelease[t];if(r("prerelease compare",t,n,i),void 0===n&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===n)return-1;if(n!==i)return c(n,i)}while(++t)}compareBuild(e){e instanceof u||(e=new u(e,this.options));let t=0;do{const n=this.build[t],i=e.build[t];if(r("prerelease compare",t,n,i),void 0===n&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===n)return-1;if(n!==i)return c(n,i)}while(++t)}inc(e,t,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===c(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error("invalid increment argument: ".concat(e))}return this.raw=this.format(),this.build.length&&(this.raw+="+".concat(this.build.join("."))),this}}e.exports=u},53245:(e,t,n)=>{const r=n(92293);e.exports=(e,t)=>{const n=r(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},30706:(e,t,n)=>{const r=n(88119),i=n(86530),o=n(99480),s=n(4975),a=n(17604),l=n(13818);e.exports=(e,t,n,c)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return r(e,n,c);case"!=":return i(e,n,c);case">":return o(e,n,c);case">=":return s(e,n,c);case"<":return a(e,n,c);case"<=":return l(e,n,c);default:throw new TypeError("Invalid operator: ".concat(t))}}},14767:(e,t,n)=>{const r=n(47566),i=n(92293),{safeRe:o,t:s}=n(47045);e.exports=(e,t)=>{if(e instanceof r)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){let t;for(;(t=o[s.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&t.index+t[0].length===n.index+n[0].length||(n=t),o[s.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;o[s.COERCERTL].lastIndex=-1}else n=e.match(o[s.COERCE]);return null===n?null:i("".concat(n[2],".").concat(n[3]||"0",".").concat(n[4]||"0"),t)}},46525:(e,t,n)=>{const r=n(47566);e.exports=(e,t,n)=>{const i=new r(e,n),o=new r(t,n);return i.compare(o)||i.compareBuild(o)}},97957:(e,t,n)=>{const r=n(23969);e.exports=(e,t)=>r(e,t,!0)},23969:(e,t,n)=>{const r=n(47566);e.exports=(e,t,n)=>new r(e,n).compare(new r(t,n))},15713:(e,t,n)=>{const r=n(92293);e.exports=(e,t)=>{const n=r(e,null,!0),i=r(t,null,!0),o=n.compare(i);if(0===o)return null;const s=o>0,a=s?n:i,l=s?i:n,c=!!a.prerelease.length;if(l.prerelease.length&&!c)return l.patch||l.minor?a.patch?"patch":a.minor?"minor":"major":"major";const u=c?"pre":"";return n.major!==i.major?u+"major":n.minor!==i.minor?u+"minor":n.patch!==i.patch?u+"patch":"prerelease"}},88119:(e,t,n)=>{const r=n(23969);e.exports=(e,t,n)=>0===r(e,t,n)},99480:(e,t,n)=>{const r=n(23969);e.exports=(e,t,n)=>r(e,t,n)>0},4975:(e,t,n)=>{const r=n(23969);e.exports=(e,t,n)=>r(e,t,n)>=0},31528:(e,t,n)=>{const r=n(47566);e.exports=(e,t,n,i,o)=>{"string"==typeof n&&(o=i,i=n,n=void 0);try{return new r(e instanceof r?e.version:e,n).inc(t,i,o).version}catch(e){return null}}},17604:(e,t,n)=>{const r=n(23969);e.exports=(e,t,n)=>r(e,t,n)<0},13818:(e,t,n)=>{const r=n(23969);e.exports=(e,t,n)=>r(e,t,n)<=0},85685:(e,t,n)=>{const r=n(47566);e.exports=(e,t)=>new r(e,t).major},49597:(e,t,n)=>{const r=n(47566);e.exports=(e,t)=>new r(e,t).minor},86530:(e,t,n)=>{const r=n(23969);e.exports=(e,t,n)=>0!==r(e,t,n)},92293:(e,t,n)=>{const r=n(47566);e.exports=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e instanceof r)return e;try{return new r(e,t)}catch(e){if(!n)return null;throw e}}},79708:(e,t,n)=>{const r=n(47566);e.exports=(e,t)=>new r(e,t).patch},55558:(e,t,n)=>{const r=n(92293);e.exports=(e,t)=>{const n=r(e,t);return n&&n.prerelease.length?n.prerelease:null}},8552:(e,t,n)=>{const r=n(23969);e.exports=(e,t,n)=>r(t,e,n)},92143:(e,t,n)=>{const r=n(46525);e.exports=(e,t)=>e.sort(((e,n)=>r(n,e,t)))},47311:(e,t,n)=>{const r=n(13246);e.exports=(e,t,n)=>{try{t=new r(t,n)}catch(e){return!1}return t.test(e)}},11517:(e,t,n)=>{const r=n(46525);e.exports=(e,t)=>e.sort(((e,n)=>r(e,n,t)))},25443:(e,t,n)=>{const r=n(92293);e.exports=(e,t)=>{const n=r(e,t);return n?n.version:null}},27374:(e,t,n)=>{const r=n(47045),i=n(46212),o=n(47566),s=n(70476),a=n(92293),l=n(25443),c=n(53245),u=n(31528),d=n(15713),h=n(85685),p=n(49597),f=n(79708),g=n(55558),m=n(23969),y=n(8552),v=n(97957),A=n(46525),b=n(11517),w=n(92143),S=n(99480),C=n(17604),E=n(88119),I=n(86530),_=n(4975),x=n(13818),P=n(30706),k=n(14767),B=n(74732),O=n(13246),N=n(47311),D=n(58052),j=n(39225),T=n(21433),M=n(88598),F=n(5011),R=n(36854),L=n(27028),Q=n(40178),U=n(34729),V=n(91047),K=n(74632);e.exports={parse:a,valid:l,clean:c,inc:u,diff:d,major:h,minor:p,patch:f,prerelease:g,compare:m,rcompare:y,compareLoose:v,compareBuild:A,sort:b,rsort:w,gt:S,lt:C,eq:E,neq:I,gte:_,lte:x,cmp:P,coerce:k,Comparator:B,Range:O,satisfies:N,toComparators:D,maxSatisfying:j,minSatisfying:T,minVersion:M,validRange:F,outside:R,gtr:L,ltr:Q,intersects:U,simplifyRange:V,subset:K,SemVer:o,re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:s.compareIdentifiers,rcompareIdentifiers:s.rcompareIdentifiers}},46212:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},52997:e=>{const t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return console.error("SEMVER",...t)}:()=>{};e.exports=t},70476:e=>{const t=/^[0-9]+$/,n=(e,n)=>{const r=t.test(e),i=t.test(n);return r&&i&&(e=+e,n=+n),e===n?0:r&&!i?-1:i&&!r?1:e<n?-1:1};e.exports={compareIdentifiers:n,rcompareIdentifiers:(e,t)=>n(t,e)}},81042:e=>{const t=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:n},47045:(e,t,n)=>{const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:o}=n(46212),s=n(52997),a=(t=e.exports={}).re=[],l=t.safeRe=[],c=t.src=[],u=t.t={};let d=0;const h="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",o],[h,i]],f=(e,t,n)=>{const r=(e=>{for(const[t,n]of p)e=e.split("".concat(t,"*")).join("".concat(t,"{0,").concat(n,"}")).split("".concat(t,"+")).join("".concat(t,"{1,").concat(n,"}"));return e})(t),i=d++;s(e,i,t),u[e]=i,c[i]=t,a[i]=new RegExp(t,n?"g":void 0),l[i]=new RegExp(r,n?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-]".concat(h,"*")),f("MAINVERSION","(".concat(c[u.NUMERICIDENTIFIER],")\\.")+"(".concat(c[u.NUMERICIDENTIFIER],")\\.")+"(".concat(c[u.NUMERICIDENTIFIER],")")),f("MAINVERSIONLOOSE","(".concat(c[u.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(c[u.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(c[u.NUMERICIDENTIFIERLOOSE],")")),f("PRERELEASEIDENTIFIER","(?:".concat(c[u.NUMERICIDENTIFIER],"|").concat(c[u.NONNUMERICIDENTIFIER],")")),f("PRERELEASEIDENTIFIERLOOSE","(?:".concat(c[u.NUMERICIDENTIFIERLOOSE],"|").concat(c[u.NONNUMERICIDENTIFIER],")")),f("PRERELEASE","(?:-(".concat(c[u.PRERELEASEIDENTIFIER],"(?:\\.").concat(c[u.PRERELEASEIDENTIFIER],")*))")),f("PRERELEASELOOSE","(?:-?(".concat(c[u.PRERELEASEIDENTIFIERLOOSE],"(?:\\.").concat(c[u.PRERELEASEIDENTIFIERLOOSE],")*))")),f("BUILDIDENTIFIER","".concat(h,"+")),f("BUILD","(?:\\+(".concat(c[u.BUILDIDENTIFIER],"(?:\\.").concat(c[u.BUILDIDENTIFIER],")*))")),f("FULLPLAIN","v?".concat(c[u.MAINVERSION]).concat(c[u.PRERELEASE],"?").concat(c[u.BUILD],"?")),f("FULL","^".concat(c[u.FULLPLAIN],"$")),f("LOOSEPLAIN","[v=\\s]*".concat(c[u.MAINVERSIONLOOSE]).concat(c[u.PRERELEASELOOSE],"?").concat(c[u.BUILD],"?")),f("LOOSE","^".concat(c[u.LOOSEPLAIN],"$")),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE","".concat(c[u.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),f("XRANGEIDENTIFIER","".concat(c[u.NUMERICIDENTIFIER],"|x|X|\\*")),f("XRANGEPLAIN","[v=\\s]*(".concat(c[u.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(c[u.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(c[u.XRANGEIDENTIFIER],")")+"(?:".concat(c[u.PRERELEASE],")?").concat(c[u.BUILD],"?")+")?)?"),f("XRANGEPLAINLOOSE","[v=\\s]*(".concat(c[u.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(c[u.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(c[u.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(c[u.PRERELEASELOOSE],")?").concat(c[u.BUILD],"?")+")?)?"),f("XRANGE","^".concat(c[u.GTLT],"\\s*").concat(c[u.XRANGEPLAIN],"$")),f("XRANGELOOSE","^".concat(c[u.GTLT],"\\s*").concat(c[u.XRANGEPLAINLOOSE],"$")),f("COERCE","".concat("(^|[^\\d])(\\d{1,").concat(r,"})")+"(?:\\.(\\d{1,".concat(r,"}))?")+"(?:\\.(\\d{1,".concat(r,"}))?")+"(?:$|[^\\d])"),f("COERCERTL",c[u.COERCE],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM","(\\s*)".concat(c[u.LONETILDE],"\\s+"),!0),t.tildeTrimReplace="$1~",f("TILDE","^".concat(c[u.LONETILDE]).concat(c[u.XRANGEPLAIN],"$")),f("TILDELOOSE","^".concat(c[u.LONETILDE]).concat(c[u.XRANGEPLAINLOOSE],"$")),f("LONECARET","(?:\\^)"),f("CARETTRIM","(\\s*)".concat(c[u.LONECARET],"\\s+"),!0),t.caretTrimReplace="$1^",f("CARET","^".concat(c[u.LONECARET]).concat(c[u.XRANGEPLAIN],"$")),f("CARETLOOSE","^".concat(c[u.LONECARET]).concat(c[u.XRANGEPLAINLOOSE],"$")),f("COMPARATORLOOSE","^".concat(c[u.GTLT],"\\s*(").concat(c[u.LOOSEPLAIN],")$|^$")),f("COMPARATOR","^".concat(c[u.GTLT],"\\s*(").concat(c[u.FULLPLAIN],")$|^$")),f("COMPARATORTRIM","(\\s*)".concat(c[u.GTLT],"\\s*(").concat(c[u.LOOSEPLAIN],"|").concat(c[u.XRANGEPLAIN],")"),!0),t.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE","^\\s*(".concat(c[u.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(c[u.XRANGEPLAIN],")")+"\\s*$"),f("HYPHENRANGELOOSE","^\\s*(".concat(c[u.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(c[u.XRANGEPLAINLOOSE],")")+"\\s*$"),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},27028:(e,t,n)=>{const r=n(36854);e.exports=(e,t,n)=>r(e,t,">",n)},34729:(e,t,n)=>{const r=n(13246);e.exports=(e,t,n)=>(e=new r(e,n),t=new r(t,n),e.intersects(t,n))},40178:(e,t,n)=>{const r=n(36854);e.exports=(e,t,n)=>r(e,t,"<",n)},39225:(e,t,n)=>{const r=n(47566),i=n(13246);e.exports=(e,t,n)=>{let o=null,s=null,a=null;try{a=new i(t,n)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(o&&-1!==s.compare(e)||(o=e,s=new r(o,n)))})),o}},21433:(e,t,n)=>{const r=n(47566),i=n(13246);e.exports=(e,t,n)=>{let o=null,s=null,a=null;try{a=new i(t,n)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(o&&1!==s.compare(e)||(o=e,s=new r(o,n)))})),o}},88598:(e,t,n)=>{const r=n(47566),i=n(13246),o=n(99480);e.exports=(e,t)=>{e=new i(e,t);let n=new r("0.0.0");if(e.test(n))return n;if(n=new r("0.0.0-0"),e.test(n))return n;n=null;for(let t=0;t<e.set.length;++t){const i=e.set[t];let s=null;i.forEach((e=>{const t=new r(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":s&&!o(t,s)||(s=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: ".concat(e.operator))}})),!s||n&&!o(n,s)||(n=s)}return n&&e.test(n)?n:null}},36854:(e,t,n)=>{const r=n(47566),i=n(74732),{ANY:o}=i,s=n(13246),a=n(47311),l=n(99480),c=n(17604),u=n(13818),d=n(4975);e.exports=(e,t,n,h)=>{let p,f,g,m,y;switch(e=new r(e,h),t=new s(t,h),n){case">":p=l,f=u,g=c,m=">",y=">=";break;case"<":p=c,f=d,g=l,m="<",y="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,h))return!1;for(let n=0;n<t.set.length;++n){const r=t.set[n];let s=null,a=null;if(r.forEach((e=>{e.semver===o&&(e=new i(">=0.0.0")),s=s||e,a=a||e,p(e.semver,s.semver,h)?s=e:g(e.semver,a.semver,h)&&(a=e)})),s.operator===m||s.operator===y)return!1;if((!a.operator||a.operator===m)&&f(e,a.semver))return!1;if(a.operator===y&&g(e,a.semver))return!1}return!0}},91047:(e,t,n)=>{const r=n(47311),i=n(23969);e.exports=(e,t,n)=>{const o=[];let s=null,a=null;const l=e.sort(((e,t)=>i(e,t,n)));for(const e of l)r(e,t,n)?(a=e,s||(s=e)):(a&&o.push([s,a]),a=null,s=null);s&&o.push([s,null]);const c=[];for(const[e,t]of o)e===t?c.push(e):t||e!==l[0]?t?e===l[0]?c.push("<=".concat(t)):c.push("".concat(e," - ").concat(t)):c.push(">=".concat(e)):c.push("*");const u=c.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return u.length<d.length?u:t}},74632:(e,t,n)=>{const r=n(13246),i=n(74732),{ANY:o}=i,s=n(47311),a=n(23969),l=[new i(">=0.0.0-0")],c=[new i(">=0.0.0")],u=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===o){if(1===t.length&&t[0].semver===o)return!0;e=n.includePrerelease?l:c}if(1===t.length&&t[0].semver===o){if(n.includePrerelease)return!0;t=c}const r=new Set;let i,u,p,f,g,m,y;for(const t of e)">"===t.operator||">="===t.operator?i=d(i,t,n):"<"===t.operator||"<="===t.operator?u=h(u,t,n):r.add(t.semver);if(r.size>1)return null;if(i&&u){if(p=a(i.semver,u.semver,n),p>0)return null;if(0===p&&(">="!==i.operator||"<="!==u.operator))return null}for(const e of r){if(i&&!s(e,String(i),n))return null;if(u&&!s(e,String(u),n))return null;for(const r of t)if(!s(e,String(r),n))return!1;return!0}let v=!(!u||n.includePrerelease||!u.semver.prerelease.length)&&u.semver,A=!(!i||n.includePrerelease||!i.semver.prerelease.length)&&i.semver;v&&1===v.prerelease.length&&"<"===u.operator&&0===v.prerelease[0]&&(v=!1);for(const e of t){if(y=y||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,i)if(A&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===A.major&&e.semver.minor===A.minor&&e.semver.patch===A.patch&&(A=!1),">"===e.operator||">="===e.operator){if(f=d(i,e,n),f===e&&f!==i)return!1}else if(">="===i.operator&&!s(i.semver,String(e),n))return!1;if(u)if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),"<"===e.operator||"<="===e.operator){if(g=h(u,e,n),g===e&&g!==u)return!1}else if("<="===u.operator&&!s(u.semver,String(e),n))return!1;if(!e.operator&&(u||i)&&0!==p)return!1}return!(i&&m&&!u&&0!==p||u&&y&&!i&&0!==p||A||v)},d=(e,t,n)=>{if(!e)return t;const r=a(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},h=(e,t,n)=>{if(!e)return t;const r=a(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e===t)return!0;e=new r(e,n),t=new r(t,n);let i=!1;e:for(const r of e.set){for(const e of t.set){const t=u(r,e,n);if(i=i||null!==t,t)continue e}if(i)return!1}return!0}},58052:(e,t,n)=>{const r=n(13246);e.exports=(e,t)=>new r(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},5011:(e,t,n)=>{const r=n(13246);e.exports=(e,t)=>{try{return new r(e,t).range||"*"}catch(e){return null}}},31777:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NIL",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"v1",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"v3",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"v4",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"v5",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return l.default}});var r=h(n(53108)),i=h(n(95532)),o=h(n(7210)),s=h(n(53025)),a=h(n(8239)),l=h(n(26507)),c=h(n(53946)),u=h(n(40835)),d=h(n(5366));function h(e){return e&&e.__esModule?e:{default:e}}},95645:(e,t)=>{function n(e){return 14+(e+64>>>9<<4)+1}function r(e,t){const n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function i(e,t,n,i,o,s){return r((a=r(r(t,e),r(i,s)))<<(l=o)|a>>>32-l,n);var a,l}function o(e,t,n,r,o,s,a){return i(t&n|~t&r,e,t,o,s,a)}function s(e,t,n,r,o,s,a){return i(t&r|n&~r,e,t,o,s,a)}function a(e,t,n,r,o,s,a){return i(t^n^r,e,t,o,s,a)}function l(e,t,n,r,o,s,a){return i(n^(t|~r),e,t,o,s,a)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return function(e){const t=[],n=32*e.length,r="0123456789abcdef";for(let i=0;i<n;i+=8){const n=e[i>>5]>>>i%32&255,o=parseInt(r.charAt(n>>>4&15)+r.charAt(15&n),16);t.push(o)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[n(t)-1]=t;let i=1732584193,c=-271733879,u=-1732584194,d=271733878;for(let t=0;t<e.length;t+=16){const n=i,h=c,p=u,f=d;i=o(i,c,u,d,e[t],7,-680876936),d=o(d,i,c,u,e[t+1],12,-389564586),u=o(u,d,i,c,e[t+2],17,606105819),c=o(c,u,d,i,e[t+3],22,-1044525330),i=o(i,c,u,d,e[t+4],7,-176418897),d=o(d,i,c,u,e[t+5],12,1200080426),u=o(u,d,i,c,e[t+6],17,-1473231341),c=o(c,u,d,i,e[t+7],22,-45705983),i=o(i,c,u,d,e[t+8],7,1770035416),d=o(d,i,c,u,e[t+9],12,-1958414417),u=o(u,d,i,c,e[t+10],17,-42063),c=o(c,u,d,i,e[t+11],22,-1990404162),i=o(i,c,u,d,e[t+12],7,1804603682),d=o(d,i,c,u,e[t+13],12,-40341101),u=o(u,d,i,c,e[t+14],17,-1502002290),c=o(c,u,d,i,e[t+15],22,1236535329),i=s(i,c,u,d,e[t+1],5,-165796510),d=s(d,i,c,u,e[t+6],9,-1069501632),u=s(u,d,i,c,e[t+11],14,643717713),c=s(c,u,d,i,e[t],20,-373897302),i=s(i,c,u,d,e[t+5],5,-701558691),d=s(d,i,c,u,e[t+10],9,38016083),u=s(u,d,i,c,e[t+15],14,-660478335),c=s(c,u,d,i,e[t+4],20,-405537848),i=s(i,c,u,d,e[t+9],5,568446438),d=s(d,i,c,u,e[t+14],9,-1019803690),u=s(u,d,i,c,e[t+3],14,-187363961),c=s(c,u,d,i,e[t+8],20,1163531501),i=s(i,c,u,d,e[t+13],5,-1444681467),d=s(d,i,c,u,e[t+2],9,-51403784),u=s(u,d,i,c,e[t+7],14,1735328473),c=s(c,u,d,i,e[t+12],20,-1926607734),i=a(i,c,u,d,e[t+5],4,-378558),d=a(d,i,c,u,e[t+8],11,-2022574463),u=a(u,d,i,c,e[t+11],16,1839030562),c=a(c,u,d,i,e[t+14],23,-35309556),i=a(i,c,u,d,e[t+1],4,-1530992060),d=a(d,i,c,u,e[t+4],11,1272893353),u=a(u,d,i,c,e[t+7],16,-155497632),c=a(c,u,d,i,e[t+10],23,-1094730640),i=a(i,c,u,d,e[t+13],4,681279174),d=a(d,i,c,u,e[t],11,-358537222),u=a(u,d,i,c,e[t+3],16,-722521979),c=a(c,u,d,i,e[t+6],23,76029189),i=a(i,c,u,d,e[t+9],4,-640364487),d=a(d,i,c,u,e[t+12],11,-421815835),u=a(u,d,i,c,e[t+15],16,530742520),c=a(c,u,d,i,e[t+2],23,-995338651),i=l(i,c,u,d,e[t],6,-198630844),d=l(d,i,c,u,e[t+7],10,1126891415),u=l(u,d,i,c,e[t+14],15,-1416354905),c=l(c,u,d,i,e[t+5],21,-57434055),i=l(i,c,u,d,e[t+12],6,1700485571),d=l(d,i,c,u,e[t+3],10,-1894986606),u=l(u,d,i,c,e[t+10],15,-1051523),c=l(c,u,d,i,e[t+1],21,-2054922799),i=l(i,c,u,d,e[t+8],6,1873313359),d=l(d,i,c,u,e[t+15],10,-30611744),u=l(u,d,i,c,e[t+6],15,-1560198380),c=l(c,u,d,i,e[t+13],21,1309151649),i=l(i,c,u,d,e[t+4],6,-145523070),d=l(d,i,c,u,e[t+11],10,-1120210379),u=l(u,d,i,c,e[t+2],15,718787259),c=l(c,u,d,i,e[t+9],21,-343485551),i=r(i,n),c=r(c,h),u=r(u,p),d=r(d,f)}return[i,c,u,d]}(function(e){if(0===e.length)return[];const t=8*e.length,r=new Uint32Array(n(t));for(let n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))}},88945:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};t.default=n},8239:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default="00000000-0000-0000-0000-000000000000"},5366:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(53946))&&r.__esModule?r:{default:r};t.default=function(e){if(!(0,i.default)(e))throw TypeError("Invalid UUID");let t;const n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n}},66979:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},52185:(e,t)=>{let n;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(r)};const r=new Uint8Array(16)},2743:(e,t)=>{function n(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:case 3:return t^n^r;case 2:return t&n^t&r^n&r}}function r(e,t){return e<<t|e>>>32-t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e){const t=[1518500249,1859775393,2400959708,3395469782],i=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const o=e.length/4+2,s=Math.ceil(o/16),a=new Array(s);for(let t=0;t<s;++t){const n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=e[64*t+4*r]<<24|e[64*t+4*r+1]<<16|e[64*t+4*r+2]<<8|e[64*t+4*r+3];a[t]=n}a[s-1][14]=8*(e.length-1)/Math.pow(2,32),a[s-1][14]=Math.floor(a[s-1][14]),a[s-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<s;++e){const o=new Uint32Array(80);for(let t=0;t<16;++t)o[t]=a[e][t];for(let e=16;e<80;++e)o[e]=r(o[e-3]^o[e-8]^o[e-14]^o[e-16],1);let s=i[0],l=i[1],c=i[2],u=i[3],d=i[4];for(let e=0;e<80;++e){const i=Math.floor(e/20),a=r(s,5)+n(i,l,c,u)+d+t[i]+o[e]>>>0;d=u,u=c,c=r(l,30)>>>0,l=s,s=a}i[0]=i[0]+s>>>0,i[1]=i[1]+l>>>0,i[2]=i[2]+c>>>0,i[3]=i[3]+u>>>0,i[4]=i[4]+d>>>0}return[i[0]>>24&255,i[0]>>16&255,i[0]>>8&255,255&i[0],i[1]>>24&255,i[1]>>16&255,i[1]>>8&255,255&i[1],i[2]>>24&255,i[2]>>16&255,i[2]>>8&255,255&i[2],i[3]>>24&255,i[3]>>16&255,i[3]>>8&255,255&i[3],i[4]>>24&255,i[4]>>16&255,i[4]>>8&255,255&i[4]]}},40835:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.unsafeStringify=s;var r,i=(r=n(53946))&&r.__esModule?r:{default:r};const o=[];for(let e=0;e<256;++e)o.push((e+256).toString(16).slice(1));function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(o[e[t+0]]+o[e[t+1]]+o[e[t+2]]+o[e[t+3]]+"-"+o[e[t+4]]+o[e[t+5]]+"-"+o[e[t+6]]+o[e[t+7]]+"-"+o[e[t+8]]+o[e[t+9]]+"-"+o[e[t+10]]+o[e[t+11]]+o[e[t+12]]+o[e[t+13]]+o[e[t+14]]+o[e[t+15]]).toLowerCase()}t.default=function(e){const t=s(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0);if(!(0,i.default)(t))throw TypeError("Stringified UUID is invalid");return t}},53108:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(52185))&&r.__esModule?r:{default:r},o=n(40835);let s,a,l=0,c=0;t.default=function(e,t,n){let r=t&&n||0;const u=t||new Array(16);let d=(e=e||{}).node||s,h=void 0!==e.clockseq?e.clockseq:a;if(null==d||null==h){const t=e.random||(e.rng||i.default)();null==d&&(d=s=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==h&&(h=a=16383&(t[6]<<8|t[7]))}let p=void 0!==e.msecs?e.msecs:Date.now(),f=void 0!==e.nsecs?e.nsecs:c+1;const g=p-l+(f-c)/1e4;if(g<0&&void 0===e.clockseq&&(h=h+1&16383),(g<0||p>l)&&void 0===e.nsecs&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");l=p,c=f,a=h,p+=122192928e5;const m=(1e4*(268435455&p)+f)%4294967296;u[r++]=m>>>24&255,u[r++]=m>>>16&255,u[r++]=m>>>8&255,u[r++]=255&m;const y=p/4294967296*1e4&268435455;u[r++]=y>>>8&255,u[r++]=255&y,u[r++]=y>>>24&15|16,u[r++]=y>>>16&255,u[r++]=h>>>8|128,u[r++]=255&h;for(let e=0;e<6;++e)u[r+e]=d[e];return t||(0,o.unsafeStringify)(u)}},95532:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(78183)),i=o(n(95645));function o(e){return e&&e.__esModule?e:{default:e}}var s=(0,r.default)("v3",48,i.default);t.default=s},78183:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0,t.default=function(e,t,n){function r(e,r,s,a){var l;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=(0,o.default)(r)),16!==(null===(l=r)||void 0===l?void 0:l.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+e.length);if(c.set(r),c.set(e,r.length),c=n(c),c[6]=15&c[6]|t,c[8]=63&c[8]|128,s){a=a||0;for(let e=0;e<16;++e)s[a+e]=c[e];return s}return(0,i.unsafeStringify)(c)}try{r.name=e}catch(e){}return r.DNS=s,r.URL=a,r};var r,i=n(40835),o=(r=n(5366))&&r.__esModule?r:{default:r};const s="6ba7b810-9dad-11d1-80b4-00c04fd430c8";t.DNS=s;const a="6ba7b811-9dad-11d1-80b4-00c04fd430c8";t.URL=a},7210:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n(88945)),i=s(n(52185)),o=n(40835);function s(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t,n){if(r.default.randomUUID&&!t&&!e)return r.default.randomUUID();const s=(e=e||{}).random||(e.rng||i.default)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=s[e];return t}return(0,o.unsafeStringify)(s)}},53025:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(78183)),i=o(n(2743));function o(e){return e&&e.__esModule?e:{default:e}}var s=(0,r.default)("v5",80,i.default);t.default=s},53946:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(66979))&&r.__esModule?r:{default:r};t.default=function(e){return"string"==typeof e&&i.default.test(e)}},26507:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(53946))&&r.__esModule?r:{default:r};t.default=function(e){if(!(0,i.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}},82908:e=>{e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},37520:(e,t,n)=>{function r(e){var t=this;if(t instanceof r||(t=new r),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var n=0,i=arguments.length;n<i;n++)t.push(arguments[n]);return t}function i(e,t,n){var r=t===e.head?new a(n,null,t,e):new a(n,t,t.next,e);return null===r.next&&(e.tail=r),null===r.prev&&(e.head=r),e.length++,r}function o(e,t){e.tail=new a(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function s(e,t){e.head=new a(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function a(e,t,n,r){if(!(this instanceof a))return new a(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}e.exports=r,r.Node=a,r.create=r,r.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},r.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},r.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},r.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},r.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)s(this,arguments[e]);return this.length},r.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},r.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},r.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;null!==n;r++)e.call(t,n.value,r,this),n=n.next},r.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;null!==n;r--)e.call(t,n.value,r,this),n=n.prev},r.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&t<e;t++)n=n.next;if(t===e&&null!==n)return n.value},r.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&t<e;t++)n=n.prev;if(t===e&&null!==n)return n.value},r.prototype.map=function(e,t){t=t||this;for(var n=new r,i=this.head;null!==i;)n.push(e.call(t,i.value,this)),i=i.next;return n},r.prototype.mapReverse=function(e,t){t=t||this;for(var n=new r,i=this.tail;null!==i;)n.push(e.call(t,i.value,this)),i=i.prev;return n},r.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},r.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},r.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},r.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},r.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&i<e;i++)o=o.next;for(;null!==o&&i<t;i++,o=o.next)n.push(o.value);return n},r.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)n.push(o.value);return n},r.prototype.splice=function(e,t){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,r=this.head;null!==r&&n<e;n++)r=r.next;var o=[];for(n=0;r&&n<t;n++)o.push(r.value),r=this.removeNode(r);for(null===r&&(r=this.tail),r!==this.head&&r!==this.tail&&(r=r.prev),n=0;n<(arguments.length<=2?0:arguments.length-2);n++)r=i(this,r,n+2<2||arguments.length<=n+2?void 0:arguments[n+2]);return o},r.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};try{n(82908)(r)}catch(e){}},26927:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ApiVersion=void 0,function(e){e.v0="20200115",e.v1="20240226"}(n||(t.ApiVersion=n={}))},57819:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(26927),t)},7941:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.AuthApiOperations=void 0,function(e){e[e.GenerateRecoveryCodes=0]="GenerateRecoveryCodes",e[e.GetRecoveryKeyParams=1]="GetRecoveryKeyParams",e[e.SignInWithRecoveryCodes=2]="SignInWithRecoveryCodes"}(n||(t.AuthApiOperations=n={}))},80605:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AuthApiService=void 0;const i=n(29898),o=n(38130),s=n(7941);t.AuthApiService=class{constructor(e,t){this.authServer=e,this.apiVersion=t,this.operationsInProgress=new Map}generateRecoveryCodes(){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthApiOperations.GenerateRecoveryCodes))throw new i.ApiCallError(o.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthApiOperations.GenerateRecoveryCodes,!0);try{return yield this.authServer.generateRecoveryCodes()}catch(e){throw new i.ApiCallError(o.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthApiOperations.GenerateRecoveryCodes,!1)}}))}recoveryKeyParams(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthApiOperations.GetRecoveryKeyParams))throw new i.ApiCallError(o.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthApiOperations.GetRecoveryKeyParams,!0);try{return yield this.authServer.recoveryKeyParams({api_version:this.apiVersion,code_challenge:e.codeChallenge,recovery_codes:e.recoveryCodes,username:e.username})}catch(e){throw new i.ApiCallError(o.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthApiOperations.GetRecoveryKeyParams,!1)}}))}signInWithRecoveryCodes(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthApiOperations.SignInWithRecoveryCodes))throw new i.ApiCallError(o.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthApiOperations.SignInWithRecoveryCodes,!0);try{return yield this.authServer.signInWithRecoveryCodes({api_version:this.apiVersion,code_verifier:e.codeVerifier,password:e.password,recovery_codes:e.recoveryCodes,username:e.username,hvm_token:e.hvmToken})}catch(e){throw new i.ApiCallError(o.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthApiOperations.SignInWithRecoveryCodes,!1)}}))}}},73987:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},66527:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.AuthenticatorApiOperations=void 0,function(e){e[e.List=0]="List",e[e.Delete=1]="Delete",e[e.GenerateRegistrationOptions=2]="GenerateRegistrationOptions",e[e.GenerateAuthenticationOptions=3]="GenerateAuthenticationOptions",e[e.VerifyRegistrationResponse=4]="VerifyRegistrationResponse"}(n||(t.AuthenticatorApiOperations=n={}))},60356:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AuthenticatorApiService=void 0;const i=n(38130),o=n(29898),s=n(66527);t.AuthenticatorApiService=class{constructor(e){this.authenticatorServer=e,this.operationsInProgress=new Map}list(){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthenticatorApiOperations.List))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthenticatorApiOperations.List,!0);try{return yield this.authenticatorServer.list({})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthenticatorApiOperations.List,!1)}}))}delete(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthenticatorApiOperations.Delete))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthenticatorApiOperations.Delete,!0);try{return yield this.authenticatorServer.delete({authenticatorId:e})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthenticatorApiOperations.Delete,!1)}}))}generateRegistrationOptions(){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthenticatorApiOperations.GenerateRegistrationOptions))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthenticatorApiOperations.GenerateRegistrationOptions,!0);try{return yield this.authenticatorServer.generateRegistrationOptions()}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthenticatorApiOperations.GenerateRegistrationOptions,!1)}}))}verifyRegistrationResponse(e,t,n){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthenticatorApiOperations.VerifyRegistrationResponse))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthenticatorApiOperations.VerifyRegistrationResponse,!0);try{return yield this.authenticatorServer.verifyRegistrationResponse({userUuid:e,name:t,attestationResponse:n})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthenticatorApiOperations.VerifyRegistrationResponse,!1)}}))}generateAuthenticationOptions(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthenticatorApiOperations.GenerateAuthenticationOptions))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthenticatorApiOperations.GenerateAuthenticationOptions,!0);try{return yield this.authenticatorServer.generateAuthenticationOptions({username:e})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthenticatorApiOperations.GenerateAuthenticationOptions,!1)}}))}}},4405:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},23624:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.RevisionApiOperations=void 0,function(e){e[e.List=0]="List",e[e.Delete=1]="Delete",e[e.Get=2]="Get"}(n||(t.RevisionApiOperations=n={}))},33416:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RevisionApiService=void 0;const i=n(38130),o=n(29898),s=n(23624);t.RevisionApiService=class{constructor(e){this.revisionServer=e,this.operationsInProgress=new Map}listRevisions(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.RevisionApiOperations.List))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.RevisionApiOperations.List,!0);try{return yield this.revisionServer.listRevisions({itemUuid:e})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.RevisionApiOperations.List,!1)}}))}getRevision(e,t){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.RevisionApiOperations.Get))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.RevisionApiOperations.Get,!0);try{return yield this.revisionServer.getRevision({itemUuid:e,revisionUuid:t})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.RevisionApiOperations.Get,!1)}}))}deleteRevision(e,t){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.RevisionApiOperations.Delete))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.RevisionApiOperations.Delete,!0);try{return yield this.revisionServer.deleteRevision({itemUuid:e,revisionUuid:t})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.RevisionApiOperations.Delete,!1)}}))}}},68888:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},17737:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionApiOperations=void 0,function(e){e[e.Inviting=0]="Inviting",e[e.CancelingInvite=1]="CancelingInvite",e[e.ListingInvites=2]="ListingInvites",e[e.AcceptingInvite=3]="AcceptingInvite",e[e.ConfirmAppleIAP=4]="ConfirmAppleIAP",e[e.GetSubscription=5]="GetSubscription",e[e.GetAvailableSubscriptions=6]="GetAvailableSubscriptions"}(n||(t.SubscriptionApiOperations=n={}))},37856:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionApiService=void 0;const i=n(38130),o=n(29898),s=n(95658),a=n(17737);t.SubscriptionApiService=class{constructor(e,t){this.subscriptionServer=e,this.apiVersion=t,this.operationsInProgress=new Map}listInvites(){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.ListingInvites))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.ListingInvites,!0);try{return yield this.subscriptionServer.listInvites({[s.ApiEndpointParam.ApiVersion]:this.apiVersion})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.ListingInvites,!1)}}))}cancelInvite(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.CancelingInvite))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.CancelingInvite,!0);try{return yield this.subscriptionServer.cancelInvite({[s.ApiEndpointParam.ApiVersion]:this.apiVersion,inviteUuid:e})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.CancelingInvite,!1)}}))}invite(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.Inviting))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.Inviting,!0);try{return yield this.subscriptionServer.invite({[s.ApiEndpointParam.ApiVersion]:this.apiVersion,identifier:e})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.Inviting,!1)}}))}acceptInvite(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.AcceptingInvite))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.AcceptingInvite,!0);try{return yield this.subscriptionServer.acceptInvite({inviteUuid:e})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.AcceptingInvite,!1)}}))}confirmAppleIAP(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.ConfirmAppleIAP))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.ConfirmAppleIAP,!0);try{return yield this.subscriptionServer.confirmAppleIAP(e)}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.ConfirmAppleIAP,!1)}}))}getUserSubscription(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.GetSubscription))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.GetSubscription,!0);try{return yield this.subscriptionServer.getUserSubscription(e)}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.GetSubscription,!1)}}))}getAvailableSubscriptions(){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.GetAvailableSubscriptions))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.GetAvailableSubscriptions,!0);try{return yield this.subscriptionServer.getAvailableSubscriptions()}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.GetAvailableSubscriptions,!1)}}))}}},57898:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},13167:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.UserApiOperations=void 0,function(e){e[e.Registering=0]="Registering",e[e.SubmittingRequest=1]="SubmittingRequest",e[e.DeletingAccount=2]="DeletingAccount",e[e.UpdatingUser=3]="UpdatingUser"}(n||(t.UserApiOperations=n={}))},45869:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.UserApiService=void 0;const i=n(38130),o=n(29898),s=n(95658),a=n(13167);t.UserApiService=class{constructor(e,t,n){this.userServer=e,this.userRequestServer=t,this.apiVersion=n,this.operationsInProgress=new Map}deleteAccount(e){return r(this,void 0,void 0,(function*(){this.lockOperation(a.UserApiOperations.DeletingAccount);try{const t=yield this.userServer.deleteAccount({userUuid:e});return this.unlockOperation(a.UserApiOperations.DeletingAccount),t}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}}))}submitUserRequest(e){return r(this,void 0,void 0,(function*(){this.lockOperation(a.UserApiOperations.SubmittingRequest);try{const t=yield this.userRequestServer.submitUserRequest({userUuid:e.userUuid,requestType:e.requestType});return this.unlockOperation(a.UserApiOperations.SubmittingRequest),t}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}}))}register(e){return r(this,void 0,void 0,(function*(){this.lockOperation(a.UserApiOperations.Registering);try{const t=yield this.userServer.register(Object.assign({[s.ApiEndpointParam.ApiVersion]:this.apiVersion,password:e.serverPassword,email:e.email,hvm_token:e.hvmToken,ephemeral:e.ephemeral},e.keyParams.getPortableValue()));return this.unlockOperation(a.UserApiOperations.Registering),t}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericRegistrationFail)}}))}updateUser(e){return r(this,void 0,void 0,(function*(){this.lockOperation(a.UserApiOperations.UpdatingUser);try{const t=yield this.userServer.update({[s.ApiEndpointParam.ApiVersion]:this.apiVersion,user_uuid:e.userUuid});return this.unlockOperation(a.UserApiOperations.UpdatingUser),t}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}}))}lockOperation(e){if(this.operationsInProgress.get(e))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(e,!0)}unlockOperation(e){this.operationsInProgress.set(e,!1)}}},56824:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},67958:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.WebSocketApiOperations=void 0,function(e){e[e.CreatingConnectionToken=0]="CreatingConnectionToken"}(n||(t.WebSocketApiOperations=n={}))},62984:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.WebSocketApiService=void 0;const i=n(38130),o=n(29898),s=n(67958);t.WebSocketApiService=class{constructor(e){this.webSocketServer=e,this.operationsInProgress=new Map}createConnectionToken(){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.WebSocketApiOperations.CreatingConnectionToken))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.WebSocketApiOperations.CreatingConnectionToken,!0);try{const e=yield this.webSocketServer.createConnectionToken({});return this.operationsInProgress.set(s.WebSocketApiOperations.CreatingConnectionToken,!1),e}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}}))}}},95736:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},37729:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7941),t),i(n(80605),t),i(n(73987),t),i(n(66527),t),i(n(60356),t),i(n(4405),t),i(n(23624),t),i(n(33416),t),i(n(68888),t),i(n(17737),t),i(n(37856),t),i(n(57898),t),i(n(13167),t),i(n(45869),t),i(n(56824),t),i(n(62984),t),i(n(95736),t)},29898:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ApiCallError=void 0;class n extends Error{constructor(e){super(e),Object.setPrototypeOf(this,n.prototype)}}t.ApiCallError=n},38130:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorMessage=void 0,function(e){e.RegistrationInProgress="An existing registration request is already in progress.",e.GenericRegistrationFail="A server error occurred while trying to register. Please try again.",e.RateLimited="Too many successive server requests. Please wait a few minutes and try again.",e.InsufficientPasswordMessage="Your password must be at least %LENGTH% characters in length. For your security, please choose a longer password or, ideally, a passphrase, and try again.",e.PasscodeRequired="Your passcode is required in order to register for an account.",e.GenericInProgress="An existing request is already in progress.",e.GenericFail="A server error occurred. Please try again."}(n||(t.ErrorMessage=n={}))},65148:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(29898),t),i(n(38130),t)},60256:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.FetchRequestHandler=void 0;const i=n(95658),o=n(22325),s=n(84213),a=n(65148);t.FetchRequestHandler=class{constructor(e,t,n,r){this.snjsVersion=e,this.appVersion=t,this.environment=n,this.logger=r}handleRequest(e){return r(this,void 0,void 0,(function*(){const t=this.createRequest(e);return yield this.runRequest(t,this.createRequestBody(e))}))}createRequest(e){e.params&&e.verb===i.HttpVerb.Get&&Object.keys(e.params).length>0&&(e.url=this.urlForUrlAndParams(e.url,e.params));const t={};if(!e.external){t["X-SNJS-Version"]=this.snjsVersion;const n="".concat(o.Environment[this.environment],"-").concat(this.appVersion);t["X-Application-Version"]=n,e.authentication&&(t.Authorization="Bearer "+e.authentication)}let n=!1;return e.customHeaders&&e.customHeaders.length>0&&e.customHeaders.forEach((e=>{let{key:r,value:i}=e;t[r]=i,"Content-Type"===r&&(n=!0)})),n||e.external||(t["Content-Type"]="application/json"),new Request(e.url,{method:e.verb,headers:t,credentials:"include"})}runRequest(e,t){return r(this,void 0,void 0,(function*(){try{const n=yield fetch(e,{body:t});return yield this.handleFetchResponse(n)}catch(e){return{status:i.HttpStatusCode.InternalServerError,headers:new Map,data:{error:{message:"message"in e?e.message:"Unknown error"}}}}}))}handleFetchResponse(e){var t,n;return r(this,void 0,void 0,(function*(){const r=e.status,o={status:r,headers:new Map,data:{}};e.headers.forEach(((e,t)=>{o.headers.set(t,e)}));try{if(r!==i.HttpStatusCode.NoContent){let r;const i=(null===(t=o.headers)||void 0===t?void 0:t.get("content-type"))||(null===(n=o.headers)||void 0===n?void 0:n.get("Content-Type"));r=(null==i?void 0:i.includes("application/json"))?JSON.parse(yield e.text()):yield e.arrayBuffer(),r.data||(o.data=r),(0,s.isString)(r)||Object.assign(o,r)}}catch(e){this.logger.error(JSON.stringify(e))}if(r>=i.HttpStatusCode.Success&&r<i.HttpStatusCode.InternalServerError)return r===i.HttpStatusCode.Forbidden&&(0,i.isErrorResponse)(o)&&(o.data.error?o.data.error.message=a.ErrorMessage.RateLimited:o.data.error={message:a.ErrorMessage.RateLimited}),o;{const e=o;return e.data||(e.data={error:{message:"Unknown error"}}),(0,s.isString)(e.data)&&(e.data={error:{message:e.data}}),e.data.error||(e.data.error={message:"Unknown error"}),e}}))}urlForUrlAndParams(e,t){const n=Object.keys(t).map((e=>e+"="+encodeURIComponent(t[e]))).join("&");return e.includes("?")?e+"&"+n:e+"?"+n}createRequestBody(e){return void 0!==e.params&&[i.HttpVerb.Post,i.HttpVerb.Put,i.HttpVerb.Patch,i.HttpVerb.Delete].includes(e.verb)?JSON.stringify(e.params):e.rawBytes}}},56176:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},93763:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.HttpService=void 0;const i=n(87901),o=n(82648),s=n(95658),a=n(41325),l=n(60256);t.HttpService=class{constructor(e,t,n,r,i){this.environment=e,this.appVersion=t,this.snjsVersion=n,this.apiVersion=r,this.logger=i,this.__simulateNextSessionRefreshResponseDrop=!1,this.loggingEnabled=!1,this.requestHandler=new l.FetchRequestHandler(this.snjsVersion,this.appVersion,this.environment,this.logger)}setCallbacks(e,t){this.updateMetaCallback=e,this.refreshSessionCallback=t}deinit(){this.session=void 0,this.updateMetaCallback=void 0,this.refreshSessionCallback=void 0}setSession(e){this.session=e}setHost(e){this.host=e}getHost(){return this.host}getSessionAccessToken(){if(this.session)return this.session instanceof o.Session?this.session.accessToken.value:this.session.accessToken}get(e,t,n){var o;return r(this,void 0,void 0,(function*(){if(!this.host)throw new Error("Attempting to make network request before host is set");return this.runHttp({url:(0,i.joinPaths)(this.host,e),params:t,verb:s.HttpVerb.Get,authentication:null!==(o=null==n?void 0:n.authentication)&&void 0!==o?o:this.getSessionAccessToken()})}))}getExternal(e,t){return r(this,void 0,void 0,(function*(){return this.runHttp({url:e,params:t,verb:s.HttpVerb.Get,external:!0})}))}post(e,t,n){var o;return r(this,void 0,void 0,(function*(){if(!this.host)throw new Error("Attempting to make network request before host is set");return this.runHttp({url:(0,i.joinPaths)(this.host,e),params:t,verb:s.HttpVerb.Post,authentication:null!==(o=null==n?void 0:n.authentication)&&void 0!==o?o:this.getSessionAccessToken(),customHeaders:null==n?void 0:n.headers})}))}put(e,t,n){var o;return r(this,void 0,void 0,(function*(){return this.runHttp({url:(0,i.joinPaths)(this.host,e),params:t,verb:s.HttpVerb.Put,authentication:null!==(o=null==n?void 0:n.authentication)&&void 0!==o?o:this.getSessionAccessToken()})}))}patch(e,t,n){var o;return r(this,void 0,void 0,(function*(){return this.runHttp({url:(0,i.joinPaths)(this.host,e),params:t,verb:s.HttpVerb.Patch,authentication:null!==(o=null==n?void 0:n.authentication)&&void 0!==o?o:this.getSessionAccessToken()})}))}delete(e,t,n){var o;return r(this,void 0,void 0,(function*(){return this.runHttp({url:(0,i.joinPaths)(this.host,e),params:t,verb:s.HttpVerb.Delete,authentication:null!==(o=null==n?void 0:n.authentication)&&void 0!==o?o:this.getSessionAccessToken()})}))}runHttp(e){var t;return r(this,void 0,void 0,(function*(){this.__latencySimulatorMs&&(yield(0,i.sleep)(this.__latencySimulatorMs,!0)),e.params=e.params?this.params(e.params):void 0;const n=e.url===(0,i.joinPaths)(this.host,a.Paths.v1.refreshSession);this.inProgressRefreshSessionPromise&&!n&&(yield this.inProgressRefreshSessionPromise,e.authentication=this.getSessionAccessToken());const r=yield this.requestHandler.handleRequest(e);if(this.loggingEnabled&&(0,s.isErrorResponse)(r)&&this.logger.error("Request failed",e,r),r.meta&&!e.external&&(null===(t=this.updateMetaCallback)||void 0===t||t.call(this,r.meta)),r.status===s.HttpStatusCode.ExpiredAccessToken&&!n&&!e.external){if(this.inProgressRefreshSessionPromise)yield this.inProgressRefreshSessionPromise;else if(e.authentication===this.getSessionAccessToken()){this.inProgressRefreshSessionPromise=this.refreshSession();const e=yield this.inProgressRefreshSessionPromise;let t=!1;if(e.isFailed()||(t=!(0,s.isErrorResponse)(e.getValue())),this.inProgressRefreshSessionPromise=void 0,!t)return r}return e.authentication=this.getSessionAccessToken(),this.runHttp(e)}return r}))}refreshSession(){var e;return r(this,void 0,void 0,(function*(){if(!this.session)return o.Result.fail("No session to refresh");if(this.session instanceof o.LegacySession)return o.Result.fail("Cannot refresh legacy session");const t=yield this.post(a.Paths.v1.refreshSession,{access_token:this.session.accessToken.value,refresh_token:this.session.refreshToken.value});if(this.__simulateNextSessionRefreshResponseDrop)return this.__simulateNextSessionRefreshResponseDrop=!1,o.Result.fail("Simulating a dropped response");if((0,s.isErrorResponse)(t))return o.Result.ok(t);t.meta&&(null===(e=this.updateMetaCallback)||void 0===e||e.call(this,t.meta));const n=o.SessionToken.create(t.data.session.access_token,t.data.session.access_expiration);if(n.isFailed())return o.Result.fail(n.getError());const r=n.getValue(),i=o.SessionToken.create(t.data.session.refresh_token,t.data.session.refresh_expiration);if(i.isFailed())return o.Result.fail(i.getError());const l=i.getValue(),c=o.Session.create(r,l,t.data.session.readonly_access);return c.isFailed()?o.Result.fail(c.getError()):(this.setSession(c.getValue()),this.refreshSessionCallback(this.session),o.Result.ok(t))}))}params(e){return Object.assign(Object.assign({},e),{[s.ApiEndpointParam.ApiVersion]:this.apiVersion})}}},11751:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},23792:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.XMLHttpRequestState=void 0,function(e){e[e.Completed=4]="Completed"}(n||(t.XMLHttpRequestState=n={}))},59774:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(93763),t),i(n(60256),t),i(n(56176),t),i(n(11751),t),i(n(23792),t)},6813:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4960:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},8433:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},72548:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},37280:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},25618:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},1179:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},68805:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},90327:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},57726:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},75146:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},45512:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),n(95658)},15829:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),n(95658)},609:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),n(95658)},79329:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),n(95658)},30163:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},33488:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),n(95658)},19298:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),n(95658)},57826:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},74815:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},72816:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(6813),t),i(n(4960),t),i(n(8433),t),i(n(72548),t),i(n(37280),t),i(n(25618),t),i(n(1179),t),i(n(68805),t),i(n(90327),t),i(n(57726),t),i(n(75146),t),i(n(45512),t),i(n(15829),t),i(n(609),t),i(n(79329),t),i(n(30163),t),i(n(33488),t),i(n(19298),t),i(n(57826),t),i(n(74815),t)},63404:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},62299:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},30785:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},86237:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},89996:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},27528:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},98259:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},51109:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},89304:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},9712:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6605:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},25513:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},99614:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},68533:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},66722:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6497:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},96741:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5209:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5918:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},39761:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(63404),t),i(n(62299),t),i(n(30785),t),i(n(86237),t),i(n(89996),t),i(n(27528),t),i(n(98259),t),i(n(51109),t),i(n(89304),t),i(n(98259),t),i(n(51109),t),i(n(89304),t),i(n(9712),t),i(n(6605),t),i(n(25513),t),i(n(99614),t),i(n(68533),t),i(n(66722),t),i(n(6497),t),i(n(96741),t),i(n(5209),t),i(n(5918),t)},1807:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AsymmetricMessageServer=void 0;const r=n(18109);t.AsymmetricMessageServer=class{constructor(e){this.httpService=e}createMessage(e){return this.httpService.post(r.AsymmetricMessagesPaths.createMessage,{recipient_uuid:e.recipientUuid,encrypted_message:e.encryptedMessage,replaceability_identifier:e.replaceabilityIdentifier})}getInboundUserMessages(){return this.httpService.get(r.AsymmetricMessagesPaths.getInboundUserMessages())}getOutboundUserMessages(){return this.httpService.get(r.AsymmetricMessagesPaths.getOutboundUserMessages())}getMessages(){return this.httpService.get(r.AsymmetricMessagesPaths.getMessages)}deleteMessage(e){return this.httpService.delete(r.AsymmetricMessagesPaths.deleteMessage(e.messageUuid))}deleteAllInboundMessages(){return this.httpService.delete(r.AsymmetricMessagesPaths.deleteAllInboundMessages)}}},71101:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},18109:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AsymmetricMessagesPaths=void 0,t.AsymmetricMessagesPaths={createMessage:"/v1/messages",getMessages:"/v1/messages",updateMessage:e=>"/v1/messages/".concat(e),getInboundUserMessages:()=>"/v1/messages",getOutboundUserMessages:()=>"/v1/messages/outbound",deleteMessage:e=>"/v1/messages/".concat(e),deleteAllInboundMessages:"/v1/messages/inbound"}},8982:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AuthServer=void 0;const i=n(41325);t.AuthServer=class{constructor(e){this.httpService=e}generateRecoveryCodes(){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.generateRecoveryCodes)}))}recoveryKeyParams(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.recoveryKeyParams,e)}))}signInWithRecoveryCodes(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.signInWithRecoveryCodes,e)}))}}},75325:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},41325:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v1:Object.assign(Object.assign({},{refreshSession:"/v1/sessions/refresh"}),{generateRecoveryCodes:"/v1/recovery/codes",recoveryKeyParams:"/v1/recovery/login-params",signInWithRecoveryCodes:"/v1/recovery/login"})}},24610:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AuthenticatorServer=void 0;const i=n(35821);t.AuthenticatorServer=class{constructor(e){this.httpService=e}list(e){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v1.listAuthenticators,e)}))}delete(e){return r(this,void 0,void 0,(function*(){return this.httpService.delete(i.Paths.v1.deleteAuthenticator(e.authenticatorId),e)}))}generateRegistrationOptions(){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v1.generateRegistrationOptions)}))}verifyRegistrationResponse(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.verifyRegistrationResponse,e)}))}generateAuthenticationOptions(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.generateAuthenticationOptions,e)}))}}},1471:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},35821:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v1:Object.assign({},{listAuthenticators:"/v1/authenticators",deleteAuthenticator:e=>"/v1/authenticators/".concat(e),generateRegistrationOptions:"/v1/authenticators/generate-registration-options",verifyRegistrationResponse:"/v1/authenticators/verify-registration",generateAuthenticationOptions:"/v1/authenticators/generate-authentication-options"})}},92272:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v2:Object.assign({},{listRevisions:e=>"/v2/items/".concat(e,"/revisions"),getRevision:(e,t)=>"/v2/items/".concat(e,"/revisions/").concat(t),deleteRevision:(e,t)=>"/v2/items/".concat(e,"/revisions/").concat(t)})}},9784:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RevisionServer=void 0;const i=n(92272);t.RevisionServer=class{constructor(e){this.httpService=e}listRevisions(e){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v2.listRevisions(e.itemUuid))}))}getRevision(e){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v2.getRevision(e.itemUuid,e.revisionUuid))}))}deleteRevision(e){return r(this,void 0,void 0,(function*(){return this.httpService.delete(i.Paths.v2.deleteRevision(e.itemUuid,e.revisionUuid))}))}}},35213:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},83625:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultsPaths=void 0,t.SharedVaultsPaths={getSharedVaults:"/v1/shared-vaults",createSharedVault:"/v1/shared-vaults",deleteSharedVault:e=>"/v1/shared-vaults/".concat(e),updateSharedVault:e=>"/v1/shared-vaults/".concat(e),createSharedVaultFileValetToken:e=>"/v1/shared-vaults/".concat(e,"/valet-tokens")}},29497:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultServer=void 0;const r=n(83625);t.SharedVaultServer=class{constructor(e){this.httpService=e}getSharedVaults(){return this.httpService.get(r.SharedVaultsPaths.getSharedVaults)}createSharedVault(){return this.httpService.post(r.SharedVaultsPaths.createSharedVault)}deleteSharedVault(e){return this.httpService.delete(r.SharedVaultsPaths.deleteSharedVault(e.sharedVaultUuid))}createSharedVaultFileValetToken(e){let t;return e.sharedVaultOwnerUuid&&(t=[{key:"x-shared-vault-owner-context",value:e.sharedVaultOwnerUuid}]),this.httpService.post(r.SharedVaultsPaths.createSharedVaultFileValetToken(e.sharedVaultUuid),{file_uuid:e.fileUuid,remote_identifier:e.remoteIdentifier,operation:e.operation,unencrypted_file_size:e.unencryptedFileSize,move_operation_type:e.moveOperationType,shared_vault_to_shared_vault_move_target_uuid:e.sharedVaultToSharedVaultMoveTargetUuid},{headers:t})}}},41773:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},39593:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultInvitesPaths=void 0,t.SharedVaultInvitesPaths={createInvite:e=>"/v1/shared-vaults/".concat(e,"/invites"),updateInvite:(e,t)=>"/v1/shared-vaults/".concat(e,"/invites/").concat(t),acceptInvite:(e,t)=>"/v1/shared-vaults/".concat(e,"/invites/").concat(t,"/accept"),declineInvite:(e,t)=>"/v1/shared-vaults/".concat(e,"/invites/").concat(t,"/decline"),getInboundUserInvites:()=>"/v1/shared-vaults/invites",getOutboundUserInvites:()=>"/v1/shared-vaults/invites/outbound",getSharedVaultInvites:e=>"/v1/shared-vaults/".concat(e,"/invites"),deleteInvite:(e,t)=>"/v1/shared-vaults/".concat(e,"/invites/").concat(t),deleteAllSharedVaultInvites:e=>"/v1/shared-vaults/".concat(e,"/invites"),deleteAllInboundInvites:"/v1/shared-vaults/invites/inbound",deleteAllOutboundInvites:"/v1/shared-vaults/invites/outbound"}},55784:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultInvitesServer=void 0;const r=n(39593);t.SharedVaultInvitesServer=class{constructor(e){this.httpService=e}createInvite(e){return this.httpService.post(r.SharedVaultInvitesPaths.createInvite(e.sharedVaultUuid),{recipient_uuid:e.recipientUuid,encrypted_message:e.encryptedMessage,permission:e.permission.value})}updateInvite(e){var t;return this.httpService.patch(r.SharedVaultInvitesPaths.updateInvite(e.sharedVaultUuid,e.inviteUuid),{encrypted_message:e.encryptedMessage,permission:null===(t=e.permission)||void 0===t?void 0:t.value})}acceptInvite(e){return this.httpService.post(r.SharedVaultInvitesPaths.acceptInvite(e.sharedVaultUuid,e.inviteUuid))}declineInvite(e){return this.httpService.post(r.SharedVaultInvitesPaths.declineInvite(e.sharedVaultUuid,e.inviteUuid))}getInboundUserInvites(){return this.httpService.get(r.SharedVaultInvitesPaths.getInboundUserInvites())}getOutboundUserInvites(){return this.httpService.get(r.SharedVaultInvitesPaths.getOutboundUserInvites())}getSharedVaultInvites(e){return this.httpService.get(r.SharedVaultInvitesPaths.getSharedVaultInvites(e.sharedVaultUuid))}deleteInvite(e){return this.httpService.delete(r.SharedVaultInvitesPaths.deleteInvite(e.sharedVaultUuid,e.inviteUuid))}deleteAllSharedVaultInvites(e){return this.httpService.delete(r.SharedVaultInvitesPaths.deleteAllSharedVaultInvites(e.sharedVaultUuid))}deleteAllInboundInvites(){return this.httpService.delete(r.SharedVaultInvitesPaths.deleteAllInboundInvites)}deleteAllOutboundInvites(){return this.httpService.delete(r.SharedVaultInvitesPaths.deleteAllOutboundInvites)}}},49224:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},77183:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultUsersPaths=void 0,t.SharedVaultUsersPaths={getSharedVaultUsers:e=>"/v1/shared-vaults/".concat(e,"/users"),deleteSharedVaultUser:(e,t)=>"/v1/shared-vaults/".concat(e,"/users/").concat(t),designateSurvivor:(e,t)=>"/v1/shared-vaults/".concat(e,"/users/").concat(t,"/designate-survivor")}},75569:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultUsersServer=void 0;const i=n(77183);t.SharedVaultUsersServer=class{constructor(e){this.httpService=e}designateSurvivor(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.SharedVaultUsersPaths.designateSurvivor(e.sharedVaultUuid.value,e.sharedVaultMemberUuid.value))}))}getSharedVaultUsers(e){return this.httpService.get(i.SharedVaultUsersPaths.getSharedVaultUsers(e.sharedVaultUuid))}deleteSharedVaultUser(e){return this.httpService.delete(i.SharedVaultUsersPaths.deleteSharedVaultUser(e.sharedVaultUuid,e.userUuid))}}},7307:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},63385:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v1:Object.assign(Object.assign(Object.assign(Object.assign({},{invite:"/v1/subscription-invites",acceptInvite:e=>"/v1/subscription-invites/".concat(e,"/accept"),declineInvite:e=>"/v1/subscription-invites/".concat(e,"/decline"),cancelInvite:e=>"/v1/subscription-invites/".concat(e),listInvites:"/v1/subscription-invites"}),{confirmAppleIAP:"/v1/subscriptions/apple_iap_confirm"}),{subscription:e=>"/v1/users/".concat(e,"/subscription")}),{availableSubscriptions:"/v2/subscriptions"})}},83527:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionServer=void 0;const i=n(63385);t.SubscriptionServer=class{constructor(e){this.httpService=e}acceptInvite(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.acceptInvite(e.inviteUuid),e)}))}declineInvite(e){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v1.declineInvite(e.inviteUuid),e)}))}cancelInvite(e){return r(this,void 0,void 0,(function*(){return this.httpService.delete(i.Paths.v1.cancelInvite(e.inviteUuid),e)}))}listInvites(e){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v1.listInvites,e)}))}invite(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.invite,e)}))}confirmAppleIAP(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.confirmAppleIAP,e)}))}getUserSubscription(e){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v1.subscription(e.userUuid),e)}))}getAvailableSubscriptions(){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v1.availableSubscriptions)}))}}},79804:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},32288:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v1:Object.assign({},{register:"/v1/users",updateAccount:e=>"/v1/users/".concat(e),deleteAccount:e=>"/v1/users/".concat(e)})}},87466:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.UserServer=void 0;const i=n(32288);t.UserServer=class{constructor(e){this.httpService=e}deleteAccount(e){return r(this,void 0,void 0,(function*(){return this.httpService.delete(i.Paths.v1.deleteAccount(e.userUuid),e)}))}register(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.register,e)}))}update(e){return r(this,void 0,void 0,(function*(){return this.httpService.patch(i.Paths.v1.updateAccount(e.user_uuid),e)}))}}},14786:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4633:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v1:Object.assign({},{submitUserRequest:e=>"/v1/users/".concat(e,"/requests")})}},59181:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.UserRequestServer=void 0;const i=n(4633);t.UserRequestServer=class{constructor(e){this.httpService=e}submitUserRequest(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.submitUserRequest(e.userUuid),e)}))}}},39594:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},1276:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v1:Object.assign({},{createConnectionToken:"/v1/sockets/tokens"})}},81355:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.WebSocketServer=void 0;const i=n(1276);t.WebSocketServer=class{constructor(e){this.httpService=e}createConnectionToken(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.createConnectionToken,e)}))}}},7404:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},87267:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(8982),t),i(n(75325),t),i(n(24610),t),i(n(1471),t),i(n(9784),t),i(n(35213),t),i(n(1807),t),i(n(71101),t),i(n(29497),t),i(n(41773),t),i(n(75569),t),i(n(7307),t),i(n(83527),t),i(n(79804),t),i(n(55784),t),i(n(49224),t),i(n(87466),t),i(n(14786),t),i(n(59181),t),i(n(39594),t),i(n(81355),t),i(n(7404),t)},74907:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(57819),t),i(n(37729),t),i(n(65148),t),i(n(59774),t),i(n(72816),t),i(n(39761),t),i(n(87267),t)},70781:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(74907),t)},73936:(e,t,n)=>{n.d(t,{U:()=>o,q:()=>i});var r=n(99299);function i(e){return null!=e.shared_vault_uuid}function o(e){var t;const n=e.split(r.X);return{version:n[0],nonce:n[1],ciphertext:n[2],authenticatedData:n[3],additionalData:null!==(t=n[4])&&void 0!==t?t:"e30="}}},99299:(e,t,n)=>{n.d(t,{X:()=>i,s:()=>r});const r="004_Asym",i=":"},86999:(e,t,n)=>{n.d(t,{qX:()=>l,lx:()=>ke,Nv:()=>I,H$:()=>_,mU:()=>x,ao:()=>P,jl:()=>k,nJ:()=>Se,Ak:()=>we,C4:()=>C,$l:()=>fe,FX:()=>E,sP:()=>Ee,G6:()=>Ce,tn:()=>p,LW:()=>B,fD:()=>O,yv:()=>g,NC:()=>m,nx:()=>A,rU:()=>h,d1:()=>j,QR:()=>M,Er:()=>R,iN:()=>he,t$:()=>S,Gw:()=>w,xg:()=>Ie,KX:()=>_e,xo:()=>i,$4:()=>o,_0:()=>s,eC:()=>a,Am:()=>b,ZP:()=>pe,UH:()=>H.U,oO:()=>be,qw:()=>H.q,Gl:()=>Ae,xi:()=>me,XL:()=>ge,dS:()=>d,mX:()=>f});var r=n(98418);const i=Object.freeze({SaltSeedLength:128,PbkdfMinCost:3e3,PbkdfCostsUsed:[3e3,5e3,1e4,6e4],PbkdfOutputLength:512,EncryptionKeyLength:256}),o=Object.freeze({SaltSeedLength:128,PbkdfMinCost:3e3,PbkdfCostsUsed:i.PbkdfCostsUsed.concat([1e5,101e3,102e3,103e3]),ImprobablePbkdfCostsUsed:[3e3,5e3],PbkdfOutputLength:768,EncryptionKeyLength:256,EncryptionIvLength:128}),s=Object.freeze({SaltSeedLength:256,PbkdfCost:11e4,PbkdfOutputLength:768,EncryptionKeyLength:256,EncryptionIvLength:128}),a=Object.freeze({ArgonSaltSeedLength:256,ArgonSaltLength:128,ArgonIterations:5,ArgonMemLimit:67108864,ArgonOutputKeyBytes:64,EncryptionKeyLength:256,EncryptionNonceLength:192,AsymmetricEncryptionNonceLength:192,MasterKeyEncryptionKeyPairSubKeyNumber:1,MasterKeyEncryptionKeyPairSubKeyContext:"sn-pkc-e",MasterKeyEncryptionKeyPairSubKeyBytes:r.SodiumConstant.crypto_box_SEEDBYTES,MasterKeySigningKeyPairSubKeyNumber:2,MasterKeySigningKeyPairSubKeyContext:"sn-pkc-s",MasterKeySigningKeyPairSubKeyBytes:r.SodiumConstant.crypto_sign_SEEDBYTES,PayloadKeyHashingKeySubKeyNumber:1,PayloadKeyHashingKeySubKeyContext:"sn-sym-h",PayloadKeyHashingKeySubKeyBytes:r.SodiumConstant.crypto_generichash_KEYBYTES});var l;!function(e){e.Encrypted="Encrypted",e.EncryptedWithNonEncryptedItemsKey="EncryptedWithNonEncryptedItemsKey",e.FullyDecrypted="FullyDecrypted",e.Corrupt="Corrupt"}(l||(l={}));var c=n(82648),u=n(22325);function d(e){return e.content_type===c.ContentType.TYPES.ItemsKey}class h extends u.DecryptedItem{constructor(e){super(e),this.keyVersion=e.content.version,this.isDefault=e.content.isDefault,this.itemsKey=this.payload.content.itemsKey}strategyWhenConflictingWithItem(e,t){return u.ConflictStrategy.KeepBase}get dataAuthenticationKey(){if(this.keyVersion===u.ProtocolVersion.V004)throw"Attempting to access legacy data authentication key.";return this.payload.content.dataAuthenticationKey}}class p extends u.DecryptedItemMutator{set isDefault(e){this.mutableContent.isDefault=e}}function f(e){return e.content_type===c.ContentType.TYPES.KeySystemItemsKey}(0,u.RegisterItemClass)(c.ContentType.TYPES.ItemsKey,h,p);class g extends u.DecryptedItem{constructor(e){super(e),this.creationTimestamp=e.content.creationTimestamp,this.keyVersion=e.content.version,this.itemsKey=this.payload.content.itemsKey,this.rootKeyToken=this.payload.content.rootKeyToken}strategyWhenConflictingWithItem(e,t){return u.ConflictStrategy.KeepBase}}class m extends u.DecryptedItemMutator{}(0,u.RegisterItemClass)(c.ContentType.TYPES.KeySystemItemsKey,g,m);var y=n(87901),v=n(20875);function A(e){if(e.version)return e.version;const t=e.pw_cost,n=i.PbkdfCostsUsed.includes(t),r=o.PbkdfCostsUsed.includes(t);return n&&!r?v.ProtocolVersion.V001:r&&!n?v.ProtocolVersion.V002:r&&n&&e.pw_nonce&&o.ImprobablePbkdfCostsUsed.includes(t)?v.ProtocolVersion.V001:v.ProtocolVersion.V002}const b=["identifier","pw_cost","pw_nonce","pw_salt","version","origination","created"];class w{constructor(e){this.content=Object.assign(Object.assign({},e),{origination:e.origination||v.KeyParamsOrigination.Registration,version:e.version||A(e)})}get isKeyParamsObject(){return!0}get identifier(){return this.content004.identifier||this.content002.email}get version(){return this.content.version}get origination(){return this.content.origination}get content001(){return this.content}get content002(){return this.content}get content003(){return this.content}get content004(){return this.content}get createdDate(){if(this.content004.created)return new Date(Number(this.content004.created))}compare(e){if(this.version!==e.version)return!1;if([v.ProtocolVersion.V004,v.ProtocolVersion.V003].includes(this.version))return this.identifier===e.identifier&&this.content004.pw_nonce===e.content003.pw_nonce;if([v.ProtocolVersion.V002,v.ProtocolVersion.V001].includes(this.version))return this.identifier===e.identifier&&this.content002.pw_salt===e.content001.pw_salt;throw Error("Unhandled version in KeyParams.compare")}getPortableValue(){return(0,y.pickByCopy)(this.content,b)}}class S extends u.DecryptedItem{constructor(e){super(e),this.keyParams=new w(e.content.keyParams)}get keyVersion(){return this.content.version}get itemsKey(){return this.masterKey}get masterKey(){return this.content.masterKey}get serverPassword(){return this.content.serverPassword}get encryptionKeyPair(){return this.content.encryptionKeyPair}get signingKeyPair(){return this.content.signingKeyPair}get dataAuthenticationKey(){return this.content.dataAuthenticationKey}compare(e){return this.keyVersion===e.keyVersion&&(this.serverPassword&&e.serverPassword?(0,r.timingSafeEqual)(this.masterKey,e.masterKey)&&(0,r.timingSafeEqual)(this.serverPassword,e.serverPassword):(0,r.timingSafeEqual)(this.masterKey,e.masterKey))}persistableValueWhenWrapping(){return Object.assign(Object.assign({},this.getKeychainValue()),{keyParams:this.keyParams.getPortableValue()})}getKeychainValue(){const e={version:this.keyVersion,masterKey:this.masterKey,encryptionKeyPair:this.encryptionKeyPair,signingKeyPair:this.signingKeyPair};return this.dataAuthenticationKey&&(e.dataAuthenticationKey=this.dataAuthenticationKey),e}}function C(e){const t=y.UuidGenerator.GenerateUuid(),n=new u.DecryptedPayload(Object.assign({uuid:t,content_type:c.ContentType.TYPES.RootKey,content:E(e)},(0,u.PayloadTimestampDefaults)()));return new S(n)}function E(e){return e.version||(e.dataAuthenticationKey?e.version=u.ProtocolVersion.V002:e.version=u.ProtocolVersion.V001),(0,u.FillItemContentSpecialized)(e)}function I(e){return k(e)}function _(e){return k(e)}function x(e){return k(e)}function P(e){return k(e)}function k(e){if("content"in e)throw Error("Raw key params shouldnt have content; perhaps you passed in a SNRootKeyParams object.");return new w(e)}function B(e,t){return k({identifier:t||e.identifier,pw_cost:e.pw_cost,pw_nonce:e.pw_nonce,pw_salt:e.pw_salt,version:A(e),origination:e.origination,created:e.created})}const O={KeyRecoveryLoginFlowPrompt:e=>{var t;const n=null===(t=e.createdDate)||void 0===t?void 0:t.toLocaleString();switch(e.origination){case v.KeyParamsOrigination.EmailChange:return"Enter your account password as it was when you changed your email on ".concat(n,".");case v.KeyParamsOrigination.PasswordChange:return"Enter your account password after it was changed on ".concat(n,".");case v.KeyParamsOrigination.Registration:return"Enter your account password as it was when you registered ".concat(n,".");case v.KeyParamsOrigination.ProtocolUpgrade:return"Enter your account password as it was when you upgraded your encryption version on ".concat(n,".");case v.KeyParamsOrigination.PasscodeChange:return"Enter your application passcode after it was changed on ".concat(n,".");case v.KeyParamsOrigination.PasscodeCreate:return"Enter your application passcode as it was when you created it on ".concat(n,".");default:throw Error("Unhandled KeyParamsOrigination case for KeyRecoveryLoginFlowPrompt")}},KeyRecoveryLoginFlowReason:"Your account password is required to revalidate your session.",KeyRecoveryLoginFlowInvalidPassword:"Incorrect credentials entered. Please try again.",KeyRecoveryRootKeyReplaced:"Your credentials have successfully been updated.",KeyRecoveryPasscodeRequiredTitle:"Passcode Required",KeyRecoveryPasscodeRequiredText:"You must enter your passcode in order to save your new credentials.",KeyRecoveryPasswordRequired:"Your account password is required to recover an encryption key.",KeyRecoveryKeyRecovered:"Your key has successfully been recovered.",KeyRecoveryUnableToRecover:"Unable to recover your key with the attempted password. Please try again."};var N=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};const D="00000000000000000000000000000000";class j{constructor(e){this.crypto=e}getEncryptionDisplayName(){return"AES-256"}get version(){return v.ProtocolVersion.V001}generateNewItemsKeyContent(){const e=i.EncryptionKeyLength,t=this.crypto.generateRandomKey(e);return(0,u.FillItemContent)({itemsKey:t,version:v.ProtocolVersion.V001})}createItemsKey(){const e=new u.DecryptedPayload(Object.assign({uuid:y.UuidGenerator.GenerateUuid(),content_type:c.ContentType.TYPES.ItemsKey,content:this.generateNewItemsKeyContent()},(0,u.PayloadTimestampDefaults)()));return(0,u.CreateDecryptedItemFromPayload)(e)}createRootKey(e,t,n){return N(this,void 0,void 0,(function*(){const r=i.PbkdfMinCost,o=this.crypto.generateRandomKey(i.SaltSeedLength),s=yield this.crypto.unsafeSha1(e+"SN"+o),a=I({email:e,pw_cost:r,pw_nonce:o,pw_salt:s,version:v.ProtocolVersion.V001,origination:n,created:"".concat(Date.now())});return this.deriveKey(t,a)}))}getPayloadAuthenticatedDataForExternalUse(e){}computeRootKey(e,t){return N(this,void 0,void 0,(function*(){return this.deriveKey(e,t)}))}decryptString(e,t){return N(this,void 0,void 0,(function*(){return this.crypto.aes256CbcDecrypt(e,D,t)}))}encryptString(e,t){return N(this,void 0,void 0,(function*(){return this.crypto.aes256CbcEncrypt(e,D,t)}))}generateEncryptedParametersAsync(e,t){return N(this,void 0,void 0,(function*(){const n=this.crypto.generateRandomKey(2*i.EncryptionKeyLength),r=yield this.encryptString(n,t.itemsKey),o=(0,y.firstHalfOfString)(n),s=(0,y.secondHalfOfString)(n),a=yield this.encryptString(JSON.stringify(e.content),o),l=t.keyVersion+a,c=yield this.crypto.hmac256(l,s);if(!c)throw Error("Error generating hmac256 authHash");return{uuid:e.uuid,content_type:e.content_type,items_key_id:d(t)?t.uuid:void 0,content:l,enc_item_key:r,auth_hash:c,version:this.version,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid}}))}generateDecryptedParametersAsync(e,t){return N(this,void 0,void 0,(function*(){if(!e.enc_item_key)return console.error(Error("Missing item encryption key, skipping decryption.")),{uuid:e.uuid,errorDecrypting:!0};let n=e.enc_item_key;n=this.version+n;const r=this.encryptionComponentsFromString(n,t.itemsKey),i=yield this.decryptString(r.ciphertext,r.key);if(!i)return console.error("Error decrypting parameters",e),{uuid:e.uuid,errorDecrypting:!0};const o=(0,y.firstHalfOfString)(i),s=this.encryptionComponentsFromString(e.content,o),a=yield this.decryptString(s.ciphertext,s.key);return a?{uuid:e.uuid,content:JSON.parse(a),signatureData:{required:!1,contentHash:""}}:{uuid:e.uuid,errorDecrypting:!0}}))}encryptionComponentsFromString(e,t){const n=e.substring(0,v.ProtocolVersionLength);return{ciphertext:e.substring(v.ProtocolVersionLength,e.length),version:n,key:t}}deriveKey(e,t){return N(this,void 0,void 0,(function*(){const n=yield this.crypto.pbkdf2(e,t.content001.pw_salt,t.content001.pw_cost,i.PbkdfOutputLength);if(!n)throw Error("Error deriving PBKDF2 key");const r=(0,y.splitString)(n,2);return C({serverPassword:r[0],masterKey:r[1],version:v.ProtocolVersion.V001,keyParams:t.getPortableValue()})}))}createRandomizedKeySystemRootKey(e){throw new Error("Method not implemented.")}createUserInputtedKeySystemRootKey(e){throw new Error("Method not implemented.")}deriveUserInputtedKeySystemRootKey(e){throw new Error("Method not implemented.")}createKeySystemItemsKey(e,t,n){throw new Error("Method not implemented.")}versionForAsymmetricallyEncryptedString(e){throw new Error("Method not implemented.")}asymmetricEncrypt(e){throw new Error("Method not implemented.")}asymmetricDecrypt(e){throw new Error("Method not implemented.")}asymmetricDecryptOwnMessage(e){throw new Error("Method not implemented.")}asymmetricSignatureVerifyDetached(e){throw new Error("Method not implemented.")}asymmetricStringGetAdditionalData(e){throw new Error("Method not implemented.")}getSenderPublicKeySetFromAsymmetricallyEncryptedString(e){throw new Error("Method not implemented.")}}var T=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class M extends j{get version(){return v.ProtocolVersion.V002}generateNewItemsKeyContent(){const e=o.EncryptionKeyLength,t=this.crypto.generateRandomKey(e),n=this.crypto.generateRandomKey(e);return u.FillItemContent({itemsKey:t,dataAuthenticationKey:n,version:v.ProtocolVersion.V002})}createItemsKey(){const e=new u.DecryptedPayload(Object.assign({uuid:y.UuidGenerator.GenerateUuid(),content_type:c.ContentType.TYPES.ItemsKey,content:this.generateNewItemsKeyContent()},(0,u.PayloadTimestampDefaults)()));return u.CreateDecryptedItemFromPayload(e)}createRootKey(e,t,n){return T(this,void 0,void 0,(function*(){const r=y.lastElement(o.PbkdfCostsUsed),i=this.crypto.generateRandomKey(o.SaltSeedLength),s=yield this.crypto.unsafeSha1(e+":"+i),a=_({email:e,pw_nonce:i,pw_cost:r,pw_salt:s,version:v.ProtocolVersion.V002,origination:n,created:"".concat(Date.now())});return this.deriveKey(t,a)}))}computeRootKey(e,t){return T(this,void 0,void 0,(function*(){return this.deriveKey(e,t)}))}decryptString002(e,t,n){return T(this,void 0,void 0,(function*(){return this.crypto.aes256CbcDecrypt(e,n,t)}))}encryptString002(e,t,n){return T(this,void 0,void 0,(function*(){return this.crypto.aes256CbcEncrypt(e,n,t)}))}encryptTextParams(e,t,n,r,i,s){return T(this,void 0,void 0,(function*(){const a=this.crypto.generateRandomKey(o.EncryptionIvLength),l=yield this.encryptString002(e,t,a),c=[i,r,a,l].join(":"),u=yield this.crypto.hmac256(c,n);if(!u)throw Error("Error generating hmac256 authHash");const d=[i,u,r,a,l];if(s){const e=this.crypto.base64Encode(JSON.stringify(s.content));d.push(e)}return d.join(":")}))}decryptTextParams(e,t,n,r,i,o){return T(this,void 0,void 0,(function*(){if(!n)throw"Attempting to decryptTextParams with null encryptionKey";const s=yield this.crypto.hmac256(e,o);if(!s)throw Error("Error generating hmac256 localAuthHash");return!1===this.crypto.timingSafeEqual(i,s)?(console.error(Error("Auth hash does not match.")),null):this.decryptString002(t,n,r)}))}getPayloadAuthenticatedDataForExternalUse(e){const t=this.encryptionComponentsFromString002(e.enc_item_key).keyParams;if(!t)return;const n=JSON.parse(this.crypto.base64Decode(t));return Object.assign({},n)}generateEncryptedParametersAsync(e,t){return T(this,void 0,void 0,(function*(){const n=this.crypto.generateRandomKey(2*o.EncryptionKeyLength),r=yield this.encryptTextParams(n,t.itemsKey,t.dataAuthenticationKey,e.uuid,t.keyVersion,t instanceof S?t.keyParams:void 0),i=y.firstHalfOfString(n),s=y.secondHalfOfString(n),a=yield this.encryptTextParams(JSON.stringify(e.content),i,s,e.uuid,t.keyVersion,t instanceof S?t.keyParams:void 0);return{uuid:e.uuid,content_type:e.content_type,items_key_id:d(t)?t.uuid:void 0,content:a,enc_item_key:r,version:this.version,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid}}))}generateDecryptedParametersAsync(e,t){return T(this,void 0,void 0,(function*(){if(!e.enc_item_key)return console.error(Error("Missing item encryption key, skipping decryption.")),{uuid:e.uuid,errorDecrypting:!0};const n=e.enc_item_key,r=this.encryptionComponentsFromString002(n,t.itemsKey,t.dataAuthenticationKey),i=yield this.decryptTextParams(r.ciphertextToAuth,r.contentCiphertext,r.encryptionKey,r.iv,r.authHash,r.authKey);if(!i)return console.error("Error decrypting item_key parameters",e),{uuid:e.uuid,errorDecrypting:!0};const o=y.firstHalfOfString(i),s=y.secondHalfOfString(i),a=this.encryptionComponentsFromString002(e.content,o,s),l=yield this.decryptTextParams(a.ciphertextToAuth,a.contentCiphertext,a.encryptionKey,a.iv,a.authHash,a.authKey);return l?{uuid:e.uuid,content:JSON.parse(l),signatureData:{required:!1,contentHash:""}}:{uuid:e.uuid,errorDecrypting:!0}}))}deriveKey(e,t){return T(this,void 0,void 0,(function*(){const n=yield this.crypto.pbkdf2(e,t.content002.pw_salt,t.content002.pw_cost,o.PbkdfOutputLength);if(!n)throw Error("Error deriving PBKDF2 key");const r=y.splitString(n,3);return C({serverPassword:r[0],masterKey:r[1],dataAuthenticationKey:r[2],version:v.ProtocolVersion.V002,keyParams:t.getPortableValue()})}))}encryptionComponentsFromString002(e,t,n){const r=e.split(":");return{encryptionVersion:r[0],authHash:r[1],uuid:r[2],iv:r[3],contentCiphertext:r[4],keyParams:r[5],ciphertextToAuth:[r[0],r[2],r[3],r[4]].join(":"),encryptionKey:t,authKey:n}}}var F=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class R extends M{get version(){return v.ProtocolVersion.V003}generateNewItemsKeyContent(){const e=s.EncryptionKeyLength,t=this.crypto.generateRandomKey(e),n=this.crypto.generateRandomKey(e);return(0,u.FillItemContent)({itemsKey:t,dataAuthenticationKey:n,version:v.ProtocolVersion.V003})}createItemsKey(){const e=this.generateNewItemsKeyContent(),t=new u.DecryptedPayload(Object.assign({uuid:y.UuidGenerator.GenerateUuid(),content_type:c.ContentType.TYPES.ItemsKey,content:(0,u.FillItemContent)(e)},(0,u.PayloadTimestampDefaults)()));return(0,u.CreateDecryptedItemFromPayload)(t)}computeRootKey(e,t){return F(this,void 0,void 0,(function*(){return this.deriveKey(e,t)}))}deriveKey(e,t){return F(this,void 0,void 0,(function*(){const n=yield this.generateSalt(t.content003.identifier,v.ProtocolVersion.V003,s.PbkdfCost,t.content003.pw_nonce),r=yield this.crypto.pbkdf2(e,n,s.PbkdfCost,s.PbkdfOutputLength);if(!r)throw Error("Error deriving PBKDF2 key");const i=(0,y.splitString)(r,3);return C({serverPassword:i[0],masterKey:i[1],dataAuthenticationKey:i[2],version:v.ProtocolVersion.V003,keyParams:t.getPortableValue()})}))}createRootKey(e,t,n){return F(this,void 0,void 0,(function*(){const r=v.ProtocolVersion.V003,i=this.crypto.generateRandomKey(s.SaltSeedLength),o=x({identifier:e,pw_nonce:i,version:r,origination:n,created:"".concat(Date.now())});return this.deriveKey(t,o)}))}generateSalt(e,t,n,r){return F(this,void 0,void 0,(function*(){return yield this.crypto.sha256([e,"SF",t,n,r].join(":"))}))}}var L=n(99299);class Q{constructor(e){this.crypto=e}execute(e){return this.crypto.base64Encode(JSON.stringify(y.sortedCopy(y.omitUndefinedCopy(e))))}}class U{constructor(e){this.crypto=e,this.base64DataUsecase=new Q(this.crypto)}execute(e){const t=this.crypto.generateRandomKey(a.AsymmetricEncryptionNonceLength),n=this.crypto.sodiumCryptoBoxEasyEncrypt(e.stringToEncrypt,t,e.recipientPublicKey,e.senderKeyPair.privateKey),r={signingData:{publicKey:e.senderSigningKeyPair.publicKey,signature:this.crypto.sodiumCryptoSign(n,e.senderSigningKeyPair.privateKey)},senderPublicKey:e.senderKeyPair.publicKey};return[L.s,t,n,this.base64DataUsecase.execute(r)].join(":")}}class V{constructor(e){this.crypto=e}execute(e){return JSON.parse(this.crypto.base64Decode(e))}}class K{constructor(e){this.crypto=e,this.parseBase64Usecase=new V(this.crypto)}execute(e){const[t,n,r,i]=e.stringToDecrypt.split(":"),o=this.parseBase64Usecase.execute(i);try{const t=this.crypto.sodiumCryptoBoxEasyDecrypt(r,n,o.senderPublicKey,e.recipientSecretKey);return t?{plaintext:t,signatureVerified:this.crypto.sodiumCryptoSignVerify(r,o.signingData.signature,o.signingData.publicKey),signaturePublicKey:o.signingData.publicKey,senderPublicKey:o.senderPublicKey}:null}catch(e){return null}}}var H=n(73936);class G{constructor(e){this.crypto=e}execute(e,t){const n=JSON.parse(this.crypto.base64Decode(e));return(0,y.sortedCopy)(Object.assign(Object.assign({},n),t))}executeRaw(e){return JSON.parse(this.crypto.base64Decode(e))}}class Y{constructor(e){this.crypto=e}execute(e,t){return this.crypto.sodiumCryptoGenericHash(e,t.key)}}class z{constructor(e){this.crypto=e,this.parseBase64Usecase=new V(this.crypto),this.hashUseCase=new Y(this.crypto)}execute(e,t,n,r){const i=this.hashUseCase.execute(n.plaintext,t),o=this.hashUseCase.execute(r.plaintext,t),s=this.parseBase64Usecase.execute(n.additionalData),a=this.parseBase64Usecase.execute(r.additionalData),l=(0,H.q)(e);if(!s.signingData||!a.signingData)return l?{required:!0,contentHash:o,result:{passes:!1,publicKey:"",signature:""}}:{required:!1,contentHash:o};if(s.signingData.publicKey!==a.signingData.publicKey)return{required:l,contentHash:o,result:{passes:!1,publicKey:"",signature:""}};const c=s.signingData.publicKey,u=this.verifySignature(i,s.signingData.signature,c),d=this.verifySignature(o,a.signingData.signature,c);let h=!0;const p=e.signatureData;return p&&p.contentHash===o&&(p.required||p.result)&&(h=p.result.passes),{required:l,contentHash:o,result:{passes:u&&d&&h,publicKey:c,signature:a.signingData.signature}}}verifySignature(e,t,n){return this.crypto.sodiumCryptoSignVerify(e,t,n)}}class Z{constructor(e){this.crypto=e}execute(e){return{key:this.crypto.sodiumCryptoKdfDeriveFromKey(e.itemsKey,a.PayloadKeyHashingKeySubKeyNumber,a.PayloadKeyHashingKeySubKeyBytes,a.PayloadKeyHashingKeySubKeyContext)}}}class W{constructor(e){this.crypto=e,this.base64DataUsecase=new Q(this.crypto),this.stringToAuthenticatedDataUseCase=new G(this.crypto),this.signingVerificationUseCase=new z(this.crypto),this.deriveHashingKeyUseCase=new Z(this.crypto)}execute(e,t){const n=this.decryptContentKey(e,t);if(!n)return console.error("Error decrypting contentKey from parameters",e),{uuid:e.uuid,errorDecrypting:!0};const r=this.decryptContent(e,n.decrypted);if(!r)return{uuid:e.uuid,errorDecrypting:!0};const i=this.deriveHashingKeyUseCase.execute(t),o=this.signingVerificationUseCase.execute(e,i,{additionalData:n.components.additionalData,plaintext:n.decrypted},{additionalData:r.components.additionalData,plaintext:r.decrypted});return{uuid:e.uuid,content:JSON.parse(r.decrypted),signatureData:o}}decryptContent(e,t){const n=(0,H.U)(e.content);return this.decrypt(e,n,t)}decryptContentKey(e,t){const n=(0,H.U)(e.enc_item_key);return this.decrypt(e,n,t.itemsKey)}decrypt(e,t,n){const r=this.stringToAuthenticatedDataUseCase.executeRaw(t.authenticatedData),i=/[A-Z]/.test(r.u),o=this.stringToAuthenticatedDataUseCase.execute(t.authenticatedData,{u:i?e.uuid.toUpperCase():e.uuid,v:e.version,ksi:e.key_system_identifier,svu:e.shared_vault_uuid}),s=this.base64DataUsecase.execute(o),a=this.crypto.xchacha20Decrypt(t.ciphertext,t.nonce,n,s);return a?{decrypted:a,components:t,authenticatedDataString:s}:null}}class q{execute(e,t){const n={u:e.uuid,v:u.ProtocolVersion.V004};if(e.key_system_identifier&&(n.ksi=e.key_system_identifier),e.shared_vault_uuid&&(n.svu=e.shared_vault_uuid),(0,u.ContentTypeUsesRootKeyEncryption)(e.content_type))return Object.assign(Object.assign({},n),{kp:t.keyParams.content});if((0,u.ContentTypeUsesKeySystemRootKeyEncryption)(e.content_type)){if(!(0,u.isKeySystemRootKey)(t))throw Error("Attempting to use non-key system root key ".concat(t.content_type," for item content type ").concat(e.content_type));return Object.assign(Object.assign({},n),{kp:t.keyParams})}if(!d(t)&&!f(t))throw Error("Attempting to use non-items key for regular item.");return n}}class J{constructor(e){this.crypto=e}execute(e,t,n,r){const i=this.crypto.generateRandomKey(a.EncryptionNonceLength),o=this.encryptString(e,t,i,n);return[u.ProtocolVersion.V004,i,o,n,r].join(L.X)}encryptString(e,t,n,r){if(!n)throw"encryptString null nonce";if(!t)throw"encryptString null rawKey";return this.crypto.xchacha20Encrypt(e,n,t,r)}}class X{constructor(e){this.crypto=e,this.hashUseCase=new Y(this.crypto)}execute(e,t,n){const r=this.hashUseCase.execute(e,t);if(!n)return{additionalData:{},plaintextHash:r};const i=this.crypto.sodiumCryptoSign(r,n.privateKey);return{additionalData:{signingData:{publicKey:n.publicKey,signature:i}},plaintextHash:r}}}class ${constructor(e){this.crypto=e,this.generateProtocolStringUseCase=new J(this.crypto),this.generateAuthenticatedDataUseCase=new q,this.generateAdditionalDataUseCase=new X(this.crypto),this.encodeBase64DataUsecase=new Q(this.crypto),this.deriveHashingKeyUseCase=new Z(this.crypto)}execute(e,t,n){if((0,H.q)(e)&&!n)throw Error("Payload requires signing but no signing key pair was provided.");const r=this.generateAuthenticatedDataUseCase.execute(e,t),i=this.deriveHashingKeyUseCase.execute(t),{contentKey:o,encryptedContentKey:s}=this.generateEncryptedContentKey(t,i,r,n),{encryptedContent:a}=this.generateEncryptedContent(e,i,o,r,n);return{uuid:e.uuid,content_type:e.content_type,items_key_id:d(t)||f(t)?t.uuid:void 0,content:a,enc_item_key:s,version:u.ProtocolVersion.V004,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid}}generateEncryptedContent(e,t,n,r,i){const o=JSON.stringify(e.content),{additionalData:s}=this.generateAdditionalDataUseCase.execute(o,t,i);return{encryptedContent:this.generateProtocolStringUseCase.execute(o,n,this.encodeBase64DataUsecase.execute(r),this.encodeBase64DataUsecase.execute(s))}}generateEncryptedContentKey(e,t,n,r){const i=this.crypto.generateRandomKey(a.EncryptionKeyLength),{additionalData:o}=this.generateAdditionalDataUseCase.execute(i,t,r);return{contentKey:i,encryptedContentKey:this.generateProtocolStringUseCase.execute(i,e.itemsKey,this.encodeBase64DataUsecase.execute(n),this.encodeBase64DataUsecase.execute(o))}}}var ee=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class te{constructor(e){this.crypto=e}execute(e,t){return ee(this,void 0,void 0,(function*(){const n=t.content004.pw_nonce,r=yield this.generateSalt(t.content004.identifier,n),i=this.crypto.argon2(e,r,a.ArgonIterations,a.ArgonMemLimit,a.ArgonOutputKeyBytes),o=(0,y.splitString)(i,2),s=o[0],l=o[1],c=this.crypto.sodiumCryptoKdfDeriveFromKey(s,a.MasterKeyEncryptionKeyPairSubKeyNumber,a.MasterKeyEncryptionKeyPairSubKeyBytes,a.MasterKeyEncryptionKeyPairSubKeyContext),d=this.crypto.sodiumCryptoBoxSeedKeypair(c),h=this.crypto.sodiumCryptoKdfDeriveFromKey(s,a.MasterKeySigningKeyPairSubKeyNumber,a.MasterKeySigningKeyPairSubKeyBytes,a.MasterKeySigningKeyPairSubKeyContext),p=this.crypto.sodiumCryptoSignSeedKeypair(h);return C({masterKey:s,serverPassword:l,version:u.ProtocolVersion.V004,keyParams:t.getPortableValue(),encryptionKeyPair:d,signingKeyPair:p})}))}generateSalt(e,t){return ee(this,void 0,void 0,(function*(){const n=yield this.crypto.sha256([e,t].join(L.X));return(0,y.truncateHexString)(n,a.ArgonSaltLength)}))}}class ne{constructor(e){this.crypto=e,this.parseStringUseCase=new V(this.crypto)}execute(e){const t=(0,H.U)(e.enc_item_key).authenticatedData;return this.parseStringUseCase.execute(t)}}class re{constructor(e){this.crypto=e}execute(e,t,n){return r=this,i=void 0,s=function*(){const r=v.ProtocolVersion.V004,i=this.crypto.generateRandomKey(a.ArgonSaltSeedLength),o=P({identifier:e,pw_nonce:i,version:r,origination:n,created:"".concat(Date.now())});return new te(this.crypto).execute(t,o)},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(n,a)}l((s=s.apply(r,i||[])).next())}));var r,i,o,s}}class ie{constructor(e){this.crypto=e}execute(e){const t=this.crypto.generateRandomKey(a.EncryptionKeyLength),n=(0,u.FillItemContentSpecialized)({itemsKey:t,creationTimestamp:(new Date).getTime(),version:u.ProtocolVersion.V004,rootKeyToken:e.rootKeyToken}),r=Object.assign({uuid:e.uuid,content_type:c.ContentType.TYPES.KeySystemItemsKey,key_system_identifier:e.keySystemIdentifier,shared_vault_uuid:e.sharedVaultUuid,content:n,dirty:!0},(0,u.PayloadTimestampDefaults)()),i=new u.DecryptedPayload(r);return(0,u.CreateDecryptedItemFromPayload)(i)}}class oe{constructor(e){this.crypto=e}execute(e){const t=e.keyParams.seed,n=this.generateSalt(e.keyParams.systemIdentifier,t),r=this.crypto.argon2(e.password,n,a.ArgonIterations,a.ArgonMemLimit,a.ArgonOutputKeyBytes),i=(0,y.splitString)(r,2),o=i[0],s=i[1],l=y.UuidGenerator.GenerateUuid(),d={systemIdentifier:e.keyParams.systemIdentifier,key:o,keyVersion:u.ProtocolVersion.V004,keyParams:e.keyParams,token:s},h=new u.DecryptedPayload(Object.assign({uuid:l,content_type:c.ContentType.TYPES.KeySystemRootKey,content:(0,u.FillItemContentSpecialized)(d)},(0,u.PayloadTimestampDefaults)()));return new u.KeySystemRootKey(h)}generateSalt(e,t){const n=this.crypto.sodiumCryptoGenericHash([e,t].join(L.X));return(0,y.truncateHexString)(n,a.ArgonSaltLength)}}class se{constructor(e){this.crypto=e}execute(e){const t=u.ProtocolVersion.V004,n=this.crypto.generateRandomKey(a.ArgonSaltSeedLength),r=this.crypto.generateRandomKey(32),i={systemIdentifier:e.systemIdentifier,passwordType:u.KeySystemPasswordType.Randomized,creationTimestamp:(new Date).getTime(),seed:n,version:t};return new oe(this.crypto).execute({password:r,keyParams:i})}}class ae{constructor(e){this.crypto=e}execute(e){const t=u.ProtocolVersion.V004,n=this.crypto.generateRandomKey(a.ArgonSaltSeedLength),r={systemIdentifier:e.systemIdentifier,passwordType:u.KeySystemPasswordType.UserInputted,creationTimestamp:(new Date).getTime(),seed:n,version:t};return new oe(this.crypto).execute({password:e.userInputtedPassword,keyParams:r})}}class le{constructor(e){this.crypto=e,this.parseBase64Usecase=new V(this.crypto)}execute(e){const[t,n,r,i]=e.encryptedString.split(":"),o=this.parseBase64Usecase.execute(i);try{return{signatureVerified:this.crypto.sodiumCryptoSignVerify(r,o.signingData.signature,o.signingData.publicKey),signaturePublicKey:o.signingData.publicKey,senderPublicKey:o.senderPublicKey}}catch(e){return{signatureVerified:!1}}}}class ce{constructor(e){this.crypto=e,this.parseBase64Usecase=new V(this.crypto)}execute(e){const[t,n,r,i]=e.encryptedString.split(":"),o=this.parseBase64Usecase.execute(i);return c.Result.ok(o)}}class ue{constructor(e){this.crypto=e,this.parseBase64Usecase=new V(this.crypto)}execute(e){const[t,n,r,i]=e.message.split(":"),o=this.parseBase64Usecase.execute(i);try{const t=this.crypto.sodiumCryptoBoxEasyDecrypt(r,n,e.recipientPublicKey,e.ownPrivateKey);if(!t)return c.Result.fail("Could not decrypt message");const i=this.crypto.sodiumCryptoSignVerify(r,o.signingData.signature,o.signingData.publicKey);return c.Result.ok({plaintext:t,signatureVerified:i,signaturePublicKey:o.signingData.publicKey,senderPublicKey:o.senderPublicKey})}catch(e){return c.Result.fail("Could not decrypt message")}}}var de=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class he{constructor(e){this.crypto=e}getEncryptionDisplayName(){return"XChaCha20-Poly1305"}get version(){return v.ProtocolVersion.V004}generateNewItemsKeyContent(){const e=this.crypto.generateRandomKey(a.EncryptionKeyLength);return(0,u.FillItemContentSpecialized)({itemsKey:e,version:v.ProtocolVersion.V004})}createItemsKey(){const e=new u.DecryptedPayload(Object.assign({uuid:y.UuidGenerator.GenerateUuid(),content_type:c.ContentType.TYPES.ItemsKey,content:this.generateNewItemsKeyContent(),key_system_identifier:void 0,shared_vault_uuid:void 0},(0,u.PayloadTimestampDefaults)()));return(0,u.CreateDecryptedItemFromPayload)(e)}createRandomizedKeySystemRootKey(e){return new se(this.crypto).execute(e)}createUserInputtedKeySystemRootKey(e){return new ae(this.crypto).execute(e)}deriveUserInputtedKeySystemRootKey(e){return new oe(this.crypto).execute({keyParams:e.keyParams,password:e.userInputtedPassword})}createKeySystemItemsKey(e,t,n,r){return new ie(this.crypto).execute({uuid:e,keySystemIdentifier:t,sharedVaultUuid:n,rootKeyToken:r})}computeRootKey(e,t){return de(this,void 0,void 0,(function*(){return new te(this.crypto).execute(e,t)}))}createRootKey(e,t,n){return de(this,void 0,void 0,(function*(){return new re(this.crypto).execute(e,t,n)}))}getPayloadAuthenticatedDataForExternalUse(e){return new ne(this.crypto).execute(e)}generateEncryptedParameters(e,t,n){return new $(this.crypto).execute(e,t,n)}generateDecryptedParameters(e,t){return new W(this.crypto).execute(e,t)}asymmetricEncrypt(e){return new U(this.crypto).execute(e)}asymmetricDecrypt(e){return new K(this.crypto).execute(e)}asymmetricDecryptOwnMessage(e){return new ue(this.crypto).execute(e)}asymmetricSignatureVerifyDetached(e){return new le(this.crypto).execute({encryptedString:e})}asymmetricStringGetAdditionalData(e){return new ce(this.crypto).execute(e)}getSenderPublicKeySetFromAsymmetricallyEncryptedString(e){const[t,n,r,i]=e.split(":"),o=new V(this.crypto).execute(i);return{encryption:o.senderPublicKey,signing:o.signingData.publicKey}}versionForAsymmetricallyEncryptedString(e){const[t]=e.split(":");return t.split("_")[0]}}function pe(e,t){if(e===u.ProtocolVersion.V001)return new j(t);if(e===u.ProtocolVersion.V002)return new M(t);if(e===u.ProtocolVersion.V003)return new R(t);if(e===u.ProtocolVersion.V004)return new he(t);throw Error("Unable to find operator for version ".concat(e))}class fe{constructor(e){this.crypto=e,this.operators={},this.crypto=e}deinit(){this.crypto=void 0,this.operators={}}operatorForVersion(e){const t=e;let n=this.operators[t];return n||(n=pe(e,this.crypto),this.operators[t]=n),n}defaultOperator(){return this.operatorForVersion(v.ProtocolVersionLatest)}}function ge(e){return e.errorDecrypting}function me(e){return{uuid:e.uuid,content:e.content,content_type:e.content_type,items_key_id:e.items_key_id,enc_item_key:e.enc_item_key,version:e.version,auth_hash:e.auth_hash,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid,signatureData:e.signatureData}}function ye(e){return"generateEncryptedParametersAsync"in e}var ve=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};function Ae(e,t,n,r){return ve(this,void 0,void 0,(function*(){const i=n.operatorForVersion(t.keyVersion);let o;if(o=ye(i)?yield i.generateEncryptedParametersAsync(e,t):i.generateEncryptedParameters(e,t,r),!o)throw"Unable to generate encryption parameters";return o}))}function be(e,t,n){return ve(this,void 0,void 0,(function*(){const r=n.operatorForVersion(e.version);try{return ye(r)?yield r.generateDecryptedParametersAsync(me(e),t):r.generateDecryptedParameters(me(e),t)}catch(t){return console.error("Error decrypting payload",e,t),{uuid:e.uuid,errorDecrypting:!0}}}))}function we(e){const t={};return e.rootKeyEncryption&&(t.usesRootKeyWithKeyLookup={items:e.rootKeyEncryption}),e.keySystemRootKeyEncryption&&(t.usesKeySystemRootKeyWithKeyLookup={items:e.keySystemRootKeyEncryption}),e.itemsKeyEncryption&&(t.usesItemsKeyWithKeyLookup={items:e.itemsKeyEncryption}),t}function Se(e){const t={};return e.rootKeyEncryption&&(t.usesRootKeyWithKeyLookup={items:e.rootKeyEncryption}),e.keySystemRootKeyEncryption&&(t.usesKeySystemRootKeyWithKeyLookup={items:e.keySystemRootKeyEncryption}),e.itemsKeyEncryption&&(t.usesItemsKeyWithKeyLookup={items:e.itemsKeyEncryption}),t}function Ce(e,t){var n,r,i,o,s,a;const l=null===(n=t.usesItemsKey)||void 0===n?void 0:n.items.find((t=>t.uuid===e));if(l)return l;const c=null===(r=t.usesRootKey)||void 0===r?void 0:r.items.find((t=>t.uuid===e));if(c)return c;const u=null===(i=t.usesKeySystemRootKey)||void 0===i?void 0:i.items.find((t=>t.uuid===e));if(u)return u;const d=null===(o=t.usesItemsKeyWithKeyLookup)||void 0===o?void 0:o.items.find((t=>t.uuid===e));if(d)return d;const h=null===(s=t.usesRootKeyWithKeyLookup)||void 0===s?void 0:s.items.find((t=>t.uuid===e));if(h)return h;const p=null===(a=t.usesKeySystemRootKeyWithKeyLookup)||void 0===a?void 0:a.items.find((t=>t.uuid===e));if(p)return p;throw Error("Cannot find payload in encryption split")}function Ee(e,t){var n,r,i,o,s,a;const l=null===(n=t.usesItemsKey)||void 0===n?void 0:n.items.find((t=>t.uuid===e));if(l)return l;const c=null===(r=t.usesRootKey)||void 0===r?void 0:r.items.find((t=>t.uuid===e));if(c)return c;const u=null===(i=t.usesKeySystemRootKey)||void 0===i?void 0:i.items.find((t=>t.uuid===e));if(u)return u;const d=null===(o=t.usesItemsKeyWithKeyLookup)||void 0===o?void 0:o.items.find((t=>t.uuid===e));if(d)return d;const h=null===(s=t.usesRootKeyWithKeyLookup)||void 0===s?void 0:s.items.find((t=>t.uuid===e));if(h)return h;const p=null===(a=t.usesKeySystemRootKeyWithKeyLookup)||void 0===a?void 0:a.items.find((t=>t.uuid===e));if(p)return p;throw Error("Cannot find payload in encryption split")}function Ie(e){const t=[],n=[],r=[];for(const i of e)(0,u.ContentTypeUsesRootKeyEncryption)(i.content_type)?t.push(i):(0,u.ContentTypeUsesKeySystemRootKeyEncryption)(i.content_type)?r.push(i):n.push(i);return{rootKeyEncryption:t.length>0?t:void 0,itemsKeyEncryption:n.length>0?n:void 0,keySystemRootKeyEncryption:r.length>0?r:void 0}}class _e{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.message=e,t&&console.error("StandardException raised: ",e)}}var xe=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};const Pe="StandardNotes-PrivateUsername-V1";function ke(e,t){return xe(this,void 0,void 0,(function*(){const n=yield e.hmac256(yield e.sha256(Pe),yield e.sha256(t.trim().toLowerCase()));if(null!=n)return n}))}},46981:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentAction=void 0,function(e){e.SetSize="set-size",e.StreamItems="stream-items",e.StreamContextItem="stream-context-item",e.SaveItems="save-items",e.CreateItem="create-item",e.CreateItems="create-items",e.DeleteItems="delete-items",e.SetComponentData="set-component-data",e.RequestPermissions="request-permissions",e.DuplicateItem="duplicate-item",e.ComponentRegistered="component-registered",e.ActivateThemes="themes",e.Reply="reply",e.ThemesActivated="themes-activated",e.KeyDown="key-down",e.KeyUp="key-up",e.Click="click"}(n||(t.ComponentAction=n={}))},40611:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentArea=void 0,function(e){e.Editor="editor-editor",e.Themes="themes",e.EditorStack="editor-stack"}(n||(t.ComponentArea=n={}))},92898:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentFlag=void 0,function(e){e.New="New",e.Deprecated="Deprecated"}(n||(t.ComponentFlag=n={}))},45556:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6812:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.noteTypeForEditorIdentifier=t.NoteType=void 0;const r=n(36178);var i;!function(e){e.Authentication="authentication",e.Code="code",e.Markdown="markdown",e.RichText="rich-text",e.Spreadsheet="spreadsheet",e.Task="task",e.Plain="plain-text",e.Super="super",e.Unknown="unknown"}(i||(t.NoteType=i={})),t.noteTypeForEditorIdentifier=function(e){const t=(0,r.FindNativeFeature)(e);return t&&t.note_type?t.note_type:i.Unknown}},75482:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7675:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},92164:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},15077:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},45661:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},43834:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},36178:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GetDeprecatedEditors=t.GetDarkThemeFeature=t.GetNativeThemes=t.GetPlainNoteFeature=t.GetSuperNoteFeature=t.GetIframeEditors=t.GetIframeAndNativeEditors=t.FindNativeTheme=t.FindNativeFeature=t.GetFeatures=void 0;const r=n(84135),i=n(4891),o=n(9711),s=n(10379),a=n(85771),l=n(2258),c=n(88280),u=n(88277),d=n(40611);function h(){return[...(0,i.serverFeatures)(),...(0,o.clientFeatures)(),...(0,c.themes)(),...(0,u.nativeEditors)(),...(0,l.IframeEditors)(),...(0,a.experimentalFeatures)(),...(0,s.GetDeprecatedFeatures)()]}function p(e){return h().find((t=>t.identifier===e))}t.GetFeatures=h,t.FindNativeFeature=p,t.FindNativeTheme=function(e){return(0,c.themes)().find((t=>t.identifier===e))},t.GetIframeAndNativeEditors=function(){return[...(0,l.IframeEditors)(),...(0,u.nativeEditors)()]},t.GetIframeEditors=function(){return(0,l.IframeEditors)()},t.GetSuperNoteFeature=function(){return p(r.NativeFeatureIdentifier.TYPES.SuperEditor)},t.GetPlainNoteFeature=function(){return p(r.NativeFeatureIdentifier.TYPES.PlainEditor)},t.GetNativeThemes=function(){return(0,c.themes)()},t.GetDarkThemeFeature=function(){return(0,c.themes)().find((e=>e.identifier===r.NativeFeatureIdentifier.TYPES.DarkTheme))},t.GetDeprecatedEditors=function(){return(0,s.GetDeprecatedFeatures)().filter((e=>e.area===d.ComponentArea.Editor))}},49774:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},84135:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExperimentalFeatures=t.NativeFeatureIdentifier=void 0;const r=n(82648);class i extends r.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){return Object.values(this.TYPES).includes(e)?r.Result.ok(new i({value:e})):r.Result.fail("Invalid feature identifier: ".concat(e))}}t.NativeFeatureIdentifier=i,i.TYPES={DailyEmailBackup:"org.standardnotes.daily-email-backup",Files:"org.standardnotes.files",FilesLowStorageTier:"org.standardnotes.files-low-storage-tier",FilesMaximumStorageTier:"org.standardnotes.files-max-storage-tier",ListedCustomDomain:"org.standardnotes.listed-custom-domain",NoteHistory30Days:"org.standardnotes.note-history-30",NoteHistory365Days:"org.standardnotes.note-history-365",NoteHistoryUnlimited:"org.standardnotes.note-history-unlimited",SignInAlerts:"com.standardnotes.sign-in-alerts",SmartFilters:"org.standardnotes.smart-filters",TagNesting:"org.standardnotes.tag-nesting",TwoFactorAuth:"org.standardnotes.two-factor-auth",UniversalSecondFactor:"org.standardnotes.universal-second-factor",SubscriptionSharing:"org.standardnotes.subscription-sharing",AutobiographyTheme:"org.standardnotes.theme-autobiography",DynamicTheme:"org.standardnotes.theme-dynamic",DarkTheme:"org.standardnotes.theme-focus",FuturaTheme:"org.standardnotes.theme-futura",MidnightTheme:"org.standardnotes.theme-midnight",SolarizedDarkTheme:"org.standardnotes.theme-solarized-dark",TitaniumTheme:"org.standardnotes.theme-titanium",ProtonTheme:"com.standardnotes.theme-proton",PlainEditor:"com.standardnotes.plain-text",SuperEditor:"com.standardnotes.super-editor",SheetsEditor:"org.standardnotes.standard-sheets",TokenVaultEditor:"org.standardnotes.token-vault",Clipper:"org.standardnotes.clipper",Vaults:"org.standardnotes.vaults",SharedVaults:"org.standardnotes.shared-vaults",DeprecatedCodeEditor:"org.standardnotes.code-editor",DeprecatedMarkdownProEditor:"org.standardnotes.advanced-markdown-editor",DeprecatedPlusEditor:"org.standardnotes.plus-editor",DeprecatedTaskEditor:"org.standardnotes.simple-task-editor",DeprecatedMarkdownVisualEditor:"org.standardnotes.markdown-visual-editor",DeprecatedBoldEditor:"org.standardnotes.bold-editor",DeprecatedMarkdownBasicEditor:"org.standardnotes.simple-markdown-editor",DeprecatedMarkdownMathEditor:"org.standardnotes.fancy-markdown-editor",DeprecatedMarkdownMinimistEditor:"org.standardnotes.minimal-markdown-editor",DeprecatedFoldersComponent:"org.standardnotes.folders",DeprecatedFileSafe:"org.standardnotes.file-safe",LegacyFileSafeIdentifier:"org.standardnotes.legacy.file-safe"},t.ExperimentalFeatures=[i.TYPES.Vaults]},39219:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},42116:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},95100:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},58635:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isEditorFeatureDescription=t.isIframeComponentFeatureDescription=t.isThemeFeatureDescription=void 0;const r=n(82648),i=n(40611);t.isThemeFeatureDescription=function(e){return"content_type"in e&&e.content_type===r.ContentType.TYPES.Theme},t.isIframeComponentFeatureDescription=function(e){return"content_type"in e&&e.content_type===r.ContentType.TYPES.Component&&[i.ComponentArea.Editor,i.ComponentArea.EditorStack].includes(e.area)},t.isEditorFeatureDescription=function(e){return null!=e.note_type||e.area===i.ComponentArea.Editor}},53908:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},9711:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clientFeatures=void 0;const r=n(80),i=n(84135),o=n(82648);t.clientFeatures=function(){return[{name:"Tag Nesting",availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser],identifier:i.NativeFeatureIdentifier.TYPES.TagNesting,permission_name:r.PermissionName.TagNesting,description:"Organize your tags into folders."},{name:"Smart Filters",availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser],identifier:i.NativeFeatureIdentifier.TYPES.SmartFilters,permission_name:r.PermissionName.SmartFilters,description:"Create smart filters for viewing notes matching specific criteria."},{name:"Encrypted files",availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser],identifier:i.NativeFeatureIdentifier.TYPES.Files,permission_name:r.PermissionName.Files,description:""},{name:"Clipper",availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser],identifier:i.NativeFeatureIdentifier.TYPES.Clipper,permission_name:r.PermissionName.Clipper,description:""}]}},10379:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GetDeprecatedFeatures=void 0;const r=n(82648),i=n(80),o=n(84135),s=n(6812),a=n(38732),l=n(46981),c=n(40611);t.GetDeprecatedFeatures=function(){const e=(0,a.FillIframeEditorDefaults)({name:"Code",spellcheckControl:!0,identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedCodeEditor,permission_name:i.PermissionName.DeprecatedCodeEditor,note_type:s.NoteType.Code,file_type:"txt",interchangeable:!0,deprecated:!0,index_path:"index.html",description:"Syntax highlighting and convenient keyboard shortcuts for over 120 programming languages. Ideal for code snippets and procedures.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/code.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),t=(0,a.FillIframeEditorDefaults)({name:"Rich Text",note_type:s.NoteType.RichText,file_type:"html",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedPlusEditor,permission_name:i.PermissionName.DeprecatedPlusEditor,spellcheckControl:!0,deprecated:!0,description:"From highlighting to custom font sizes and colors, to tables and lists, this editor is perfect for crafting any document.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/plus-editor.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),n=(0,a.FillIframeEditorDefaults)({name:"Markdown",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedMarkdownProEditor,note_type:s.NoteType.Markdown,file_type:"md",permission_name:i.PermissionName.DeprecatedMarkdownProEditor,spellcheckControl:!0,deprecated:!0,description:"A fully featured Markdown editor that supports live preview, a styling toolbar, and split pane support.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/adv-markdown.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),u=(0,a.FillIframeEditorDefaults)({name:"Checklist",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedTaskEditor,note_type:s.NoteType.Task,spellcheckControl:!0,file_type:"md",interchangeable:!1,deprecated:!0,permission_name:i.PermissionName.DeprecatedTaskEditor,description:'A great way to manage short-term and long-term to-do"s. You can mark tasks as completed, change their order, and edit the text naturally in place.',thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/task-editor.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),d=(0,a.FillIframeEditorDefaults)({name:"Alternative Rich Text",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedBoldEditor,note_type:s.NoteType.RichText,file_type:"html",component_permissions:[{name:l.ComponentAction.StreamContextItem,content_types:[r.ContentType.TYPES.Note]},{name:l.ComponentAction.StreamItems,content_types:[r.ContentType.TYPES.FilesafeCredentials,r.ContentType.TYPES.FilesafeFileMetadata,r.ContentType.TYPES.FilesafeIntegration]}],spellcheckControl:!0,deprecated:!0,permission_name:i.PermissionName.BoldEditor,description:"A simple and peaceful rich editor that helps you write and think clearly.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/bold.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),h=(0,a.FillIframeEditorDefaults)({name:"Basic Markdown",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedMarkdownBasicEditor,note_type:s.NoteType.Markdown,spellcheckControl:!0,file_type:"md",deprecated:!0,permission_name:i.PermissionName.MarkdownBasicEditor,description:"A Markdown editor with dynamic split-pane preview.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/simple-markdown.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),p=(0,a.FillIframeEditorDefaults)({name:"Markdown Alternative",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedMarkdownVisualEditor,note_type:s.NoteType.Markdown,file_type:"md",deprecated:!0,permission_name:i.PermissionName.MarkdownVisualEditor,spellcheckControl:!0,description:"A WYSIWYG-style Markdown editor that renders Markdown in preview-mode while you type without displaying any syntax.",index_path:"build/index.html",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]});return[e,t,n,u,d,h,(0,a.FillIframeEditorDefaults)({name:"Minimal Markdown",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedMarkdownMinimistEditor,note_type:s.NoteType.Markdown,file_type:"md",index_path:"index.html",permission_name:i.PermissionName.MarkdownMinimistEditor,spellcheckControl:!0,deprecated:!0,description:"A minimal Markdown editor with live rendering and in-text search via Ctrl/Cmd + F",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/min-markdown.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),(0,a.FillIframeEditorDefaults)({name:"Markdown with Math",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedMarkdownMathEditor,spellcheckControl:!0,permission_name:i.PermissionName.MarkdownMathEditor,note_type:s.NoteType.Markdown,file_type:"md",deprecated:!0,index_path:"index.html",description:"A beautiful split-pane Markdown editor with synced-scroll, LaTeX support, and colorful syntax.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/fancy-markdown.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),p,(0,a.FillIframeEditorDefaults)({name:"FileSafe",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedFileSafe,component_permissions:[{name:l.ComponentAction.StreamContextItem,content_types:[r.ContentType.TYPES.Note]},{name:l.ComponentAction.StreamItems,content_types:[r.ContentType.TYPES.FilesafeCredentials,r.ContentType.TYPES.FilesafeFileMetadata,r.ContentType.TYPES.FilesafeIntegration]}],permission_name:i.PermissionName.ComponentFilesafe,area:c.ComponentArea.EditorStack,deprecated:!0,description:"Encrypted attachments for your notes using your Dropbox, Google Drive, or WebDAV server. Limited to 50MB per file.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/FileSafe-banner.png",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]})]}},85771:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.experimentalFeatures=void 0;const r=n(82648),i=n(84135),o=n(80);t.experimentalFeatures=function(){return[{name:"Private vaults",description:"Private vaults allow you to store notes, files and tags into separate, encrypted vaults.",availableInRoles:[r.RoleName.NAMES.CoreUser,r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser],identifier:i.NativeFeatureIdentifier.TYPES.Vaults,permission_name:o.PermissionName.Vaults}]}},2258:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IframeEditors=void 0;const r=n(80),i=n(84135),o=n(6812),s=n(38732),a=n(82648);t.IframeEditors=function(){return[(0,s.FillIframeEditorDefaults)({name:"Authenticator",note_type:o.NoteType.Authentication,file_type:"json",interchangeable:!1,identifier:i.NativeFeatureIdentifier.TYPES.TokenVaultEditor,permission_name:r.PermissionName.TokenVaultEditor,description:"Encrypt and protect your 2FA secrets for all your internet accounts. Authenticator handles your 2FA secrets so that you never lose them again, or have to start over when you get a new device.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/token-vault.png",availableInRoles:[a.RoleName.NAMES.PlusUser,a.RoleName.NAMES.ProUser]}),(0,s.FillIframeEditorDefaults)({name:"Spreadsheet",identifier:i.NativeFeatureIdentifier.TYPES.SheetsEditor,note_type:o.NoteType.Spreadsheet,file_type:"json",interchangeable:!1,permission_name:r.PermissionName.SheetsEditor,description:"A powerful spreadsheet editor with formatting and formula support. Not recommended for large data sets, as encryption of such data may decrease editor performance.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/spreadsheets.png",availableInRoles:[a.RoleName.NAMES.PlusUser,a.RoleName.NAMES.ProUser]})]}},88277:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.nativeEditors=void 0;const r=n(82648),i=n(6812),o=n(84135),s=n(80);t.nativeEditors=function(){return[{name:"Super",note_type:i.NoteType.Super,identifier:o.NativeFeatureIdentifier.TYPES.SuperEditor,spellcheckControl:!0,file_type:"json",interchangeable:!1,availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser],permission_name:s.PermissionName.SuperEditor,description:"The best way to edit notes. Type / to bring up the block selection menu, or @ to embed images or link other tags and notes. Type - then space to start a list, or [] then space to start a checklist. Drag and drop an image or file to embed it in your note. Cmd/Ctrl + F to bring up search and replace."},{name:"Plain Text",note_type:i.NoteType.Plain,spellcheckControl:!0,file_type:"txt",interchangeable:!0,identifier:o.NativeFeatureIdentifier.TYPES.PlainEditor,availableInRoles:[r.RoleName.NAMES.CoreUser,r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser],permission_name:s.PermissionName.PlainEditor}]}},4891:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.serverFeatures=void 0;const r=n(80),i=n(84135),o=n(82648);t.serverFeatures=function(){return[{name:"Two factor authentication",identifier:i.NativeFeatureIdentifier.TYPES.TwoFactorAuth,permission_name:r.PermissionName.TwoFactorAuth,availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser]},{name:"U2F authentication",identifier:i.NativeFeatureIdentifier.TYPES.UniversalSecondFactor,permission_name:r.PermissionName.UniversalSecondFactor,availableInRoles:[o.RoleName.NAMES.ProUser]},{name:"Unlimited note history",identifier:i.NativeFeatureIdentifier.TYPES.NoteHistoryUnlimited,permission_name:r.PermissionName.NoteHistoryUnlimited,availableInRoles:[o.RoleName.NAMES.ProUser]},{name:"365 days note history",identifier:i.NativeFeatureIdentifier.TYPES.NoteHistory365Days,permission_name:r.PermissionName.NoteHistory365Days,availableInRoles:[o.RoleName.NAMES.PlusUser]},{name:"Email backups",identifier:i.NativeFeatureIdentifier.TYPES.DailyEmailBackup,permission_name:r.PermissionName.DailyEmailBackup,availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser]},{name:"Sign-in email alerts",identifier:i.NativeFeatureIdentifier.TYPES.SignInAlerts,permission_name:r.PermissionName.SignInAlerts,availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser]},{name:"Files maximum storage tier",identifier:i.NativeFeatureIdentifier.TYPES.FilesMaximumStorageTier,permission_name:r.PermissionName.FilesMaximumStorageTier,availableInRoles:[o.RoleName.NAMES.ProUser]},{name:"Files low storage tier",identifier:i.NativeFeatureIdentifier.TYPES.FilesLowStorageTier,permission_name:r.PermissionName.FilesLowStorageTier,availableInRoles:[o.RoleName.NAMES.PlusUser]},{name:"Files medium storage tier",identifier:i.NativeFeatureIdentifier.TYPES.SubscriptionSharing,permission_name:r.PermissionName.SubscriptionSharing,availableInRoles:[o.RoleName.NAMES.ProUser]},{name:"Listed Custom Domain",identifier:i.NativeFeatureIdentifier.TYPES.ListedCustomDomain,permission_name:r.PermissionName.ListedCustomDomain,availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser]},{name:"Shared Vaults",identifier:i.NativeFeatureIdentifier.TYPES.SharedVaults,permission_name:r.PermissionName.SharedVaults,availableInRoles:[o.RoleName.NAMES.InternalTeamUser]}]}},88280:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.themes=void 0;const r=n(80),i=n(84135),o=n(82504),s=n(82648);t.themes=function(){const e=(0,o.FillThemeComponentDefaults)({name:"Midnight",identifier:i.NativeFeatureIdentifier.TYPES.MidnightTheme,permission_name:r.PermissionName.MidnightTheme,isDark:!0,dock_icon:{type:"circle",background_color:"#086DD6",foreground_color:"#ffffff",border_color:"#086DD6"},availableInRoles:[s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser]}),t=(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Futura",identifier:i.NativeFeatureIdentifier.TYPES.FuturaTheme,permission_name:r.PermissionName.FuturaTheme,isDark:!0,dock_icon:{type:"circle",background_color:"#fca429",foreground_color:"#ffffff",border_color:"#fca429"}}),n=(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Solarized Dark",identifier:i.NativeFeatureIdentifier.TYPES.SolarizedDarkTheme,permission_name:r.PermissionName.SolarizedDarkTheme,isDark:!0,dock_icon:{type:"circle",background_color:"#2AA198",foreground_color:"#ffffff",border_color:"#2AA198"}}),a=(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Autobiography",identifier:i.NativeFeatureIdentifier.TYPES.AutobiographyTheme,permission_name:r.PermissionName.AutobiographyTheme,dock_icon:{type:"circle",background_color:"#9D7441",foreground_color:"#ECE4DB",border_color:"#9D7441"}}),l=(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.CoreUser,s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Dark",identifier:i.NativeFeatureIdentifier.TYPES.DarkTheme,permission_name:r.PermissionName.FocusedTheme,clientControlled:!0,isDark:!0,dock_icon:{type:"circle",background_color:"#a464c2",foreground_color:"#ffffff",border_color:"#a464c2"}}),c=(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Titanium",identifier:i.NativeFeatureIdentifier.TYPES.TitaniumTheme,permission_name:r.PermissionName.TitaniumTheme,dock_icon:{type:"circle",background_color:"#6e2b9e",foreground_color:"#ffffff",border_color:"#6e2b9e"}}),u=(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Dynamic Panels",identifier:i.NativeFeatureIdentifier.TYPES.DynamicTheme,permission_name:r.PermissionName.ThemeDynamic,layerable:!0,no_mobile:!0});return[e,t,n,a,l,(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.CoreUser,s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Carbon",identifier:i.NativeFeatureIdentifier.TYPES.ProtonTheme,permission_name:r.PermissionName.ProtonTheme,dock_icon:{type:"circle",background_color:"#16141c",foreground_color:"#ffffff",border_color:"#4a4658"}}),c,u]}},38732:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FillIframeEditorDefaults=void 0;const r=n(82648),i=n(46981),o=n(40611);t.FillIframeEditorDefaults=function(e){return e.index_path||(e.index_path="dist/index.html"),e.component_permissions||(e.component_permissions=[{name:i.ComponentAction.StreamContextItem,content_types:[r.ContentType.TYPES.Note]}]),e.content_type=r.ContentType.TYPES.Component,e.area||(e.area=o.ComponentArea.Editor),null==e.interchangeable&&(e.interchangeable=!0),e}},82504:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FillThemeComponentDefaults=void 0;const r=n(82648),i=n(40611);t.FillThemeComponentDefaults=function(e){return e.index_path||(e.index_path="index.css"),e.content_type=r.ContentType.TYPES.Theme,e.area||(e.area=i.ComponentArea.Themes),e}},93625:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},80:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PermissionName=void 0,function(e){e.AccountSwitcher="app:account-switcher",e.AutobiographyTheme="theme:autobiography",e.BoldEditor="editor:bold",e.DeprecatedCodeEditor="editor:code-editor",e.ComponentFilesafe="component:filesafe",e.ComponentFolders="component:folders",e.DailyEmailBackup="server:daily-email-backup",e.Files="app:files",e.FilesMaximumStorageTier="server:files-max-storage-tier",e.FilesLowStorageTier="server:files-low-storage-tier",e.FocusedTheme="theme:focused",e.FocusMode="app:focus-mode",e.FuturaTheme="theme:futura",e.ListedCustomDomain="listed:custom-domain",e.MarkdownBasicEditor="editor:markdown-basic",e.MarkdownMathEditor="editor:markdown-math",e.MarkdownMinimistEditor="editor:markdown-minimist",e.DeprecatedMarkdownProEditor="editor:markdown-pro",e.MarkdownVisualEditor="editor:markdown-visual",e.MidnightTheme="theme:midnight",e.NoteHistory30Days="server:note-history-30-days",e.NoteHistory365Days="server:note-history-365-days",e.NoteHistoryUnlimited="server:note-history-unlimited",e.PlainEditor="editor:plain",e.DeprecatedPlusEditor="editor:plus",e.SheetsEditor="editor:sheets",e.SignInAlerts="server:sign-in-alerts",e.SmartFilters="app:smart-filters",e.SolarizedDarkTheme="theme:solarized-dark",e.TagNesting="app:tag-nesting",e.DeprecatedTaskEditor="editor:task-editor",e.ThemeDynamic="theme:dynamic",e.TitaniumTheme="theme:titanium",e.TokenVaultEditor="editor:token-vault",e.TwoFactorAuth="server:two-factor-auth",e.UniversalSecondFactor="server:universal-second-factor",e.SubscriptionSharing="server:subscription-sharing",e.SuperEditor="editor:super-editor",e.Clipper="app:clipper",e.Vaults="app:vaults",e.SharedVaults="server:shared-vaults",e.ProtonTheme="theme:proton"}(n||(t.PermissionName=n={}))},34404:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7675),t),i(n(84135),t),i(n(36178),t),i(n(58635),t),i(n(95100),t),i(n(15077),t),i(n(39219),t),i(n(49774),t),i(n(45661),t),i(n(92164),t),i(n(43834),t),i(n(42116),t),i(n(53908),t),i(n(93625),t),i(n(80),t),i(n(46981),t),i(n(40611),t),i(n(92898),t),i(n(45556),t),i(n(6812),t),i(n(75482),t)},80215:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(34404),t)},86311:(e,t,n)=>{n.d(t,{M1:()=>s,BI:()=>m,y4:()=>b,yW:()=>c,YT:()=>f,VA:()=>h,IL:()=>v,F9:()=>i,bA:()=>y,WE:()=>l,Qc:()=>B,mQ:()=>k,Qf:()=>S});var r=n(87901);class i{constructor(e){this.maxSize=e,this.cache={},this.orderedQueue=[]}add(e,t){if(t.encryptedBytes.length>this.maxSize)return!1;for(;this.size+t.encryptedBytes.length>this.maxSize;)this.remove(this.orderedQueue[0]);return this.cache[e]=t,this.orderedQueue.push(e),!0}get size(){return Object.values(this.cache).map((e=>e.encryptedBytes.length)).reduce(((e,t)=>e+t),0)}get(e){return this.cache[e]}remove(e){delete this.cache[e],(0,r.removeFromArray)(this.orderedQueue,e)}clear(){this.cache={},this.orderedQueue=[]}}var o=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class s{constructor(e,t){this.minimumChunkSize=e,this.onChunk=t,this.loggingEnabled=!1,this.bytes=new Uint8Array,this.index=1}log(){if(this.loggingEnabled){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];console.log(t)}}addBytes(e,t){return o(this,void 0,void 0,(function*(){this.bytes=new Uint8Array([...this.bytes,...e]),this.log("Chunker adding ".concat(e.length,", total size ").concat(this.bytes.length)),(this.bytes.length>=this.minimumChunkSize||t)&&(yield this.popBytes(t))}))}popBytes(e){return o(this,void 0,void 0,(function*(){const t=Math.max(this.minimumChunkSize,this.bytes.length),n=this.bytes.slice(0,t);this.bytes=new Uint8Array([...this.bytes.slice(t)]),this.log("Chunker popping ".concat(n.length,", total size in queue ").concat(this.bytes.length)),yield this.onChunk({data:n,index:this.index++,isLast:e})}))}}var a=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class l{constructor(e,t,n){this.chunkSizes=e,this.source=t,this.onChunk=n,this.bytes=new Uint8Array,this.index=1,this.remainingChunks=[],this.remainingChunks=e.slice(),this.fileSize=e.reduce(((e,t)=>e+t),0)}get bytesPopped(){return this.fileSize-this.bytesRemaining}get bytesRemaining(){return this.remainingChunks.reduce(((e,t)=>e+t),0)}needsPop(){return this.remainingChunks.length>0&&this.bytes.length>=this.remainingChunks[0]}addBytes(e){return a(this,void 0,void 0,(function*(){this.bytes=new Uint8Array([...this.bytes,...e]),this.needsPop()&&(yield this.popBytes())}))}popBytes(){return a(this,void 0,void 0,(function*(){const e=this.remainingChunks[0],t=this.bytes.slice(0,e);this.bytes=new Uint8Array([...this.bytes.slice(e)]),this.remainingChunks.shift(),yield this.onChunk({data:t,index:this.index++,isLast:this.index===this.chunkSizes.length-1,progress:{encryptedFileSize:this.fileSize,encryptedBytesDownloaded:this.bytesPopped,encryptedBytesRemaining:this.bytesRemaining,percentComplete:this.bytesPopped/this.fileSize*100,source:this.source}}),this.needsPop()&&(yield this.popBytes())}))}}const c={Version:"1.0.0",MetadataFileName:"metadata.sn.json",BinaryFileName:"file.encrypted"};var u=n(95658),d=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class h{constructor(e,t,n){this.file=e,this.api=t,this.valetToken=n,this.aborted=!1,this.abortDeferred=(0,r.Deferred)(),this.totalBytesDownloaded=0}getProgress(){const e=this.file.encryptedChunkSizes.reduce(((e,t)=>e+t),0);return{encryptedFileSize:e,encryptedBytesDownloaded:this.totalBytesDownloaded,encryptedBytesRemaining:e-this.totalBytesDownloaded,percentComplete:this.totalBytesDownloaded/e*100,source:"network"}}run(e){return d(this,void 0,void 0,(function*(){return this.performDownload(e)}))}performDownload(e){return d(this,void 0,void 0,(function*(){const t=this.api.downloadFile({file:this.file,chunkIndex:0,valetToken:this.valetToken,contentRangeStart:0,onBytesReceived:t=>d(this,void 0,void 0,(function*(){this.aborted||(this.totalBytesDownloaded+=t.byteLength,yield e(t,this.getProgress(),this.abort))})),ownershipType:this.file.shared_vault_uuid?"shared-vault":"user"});return yield Promise.race([this.abortDeferred.promise,t])}))}abort(){this.aborted=!0,this.abortDeferred.resolve("aborted")}}var p=n(98418);class f{constructor(e,t){this.file=e,this.crypto=t,this.decryptor=this.crypto.xchacha20StreamInitDecryptor(this.file.encryptionHeader,this.file.key)}decryptBytes(e){const t=this.crypto.xchacha20StreamDecryptorPush(this.decryptor,e,this.file.remoteIdentifier);if(!1===t)return;const n=t.tag===p.SodiumTag.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL;return{decryptedBytes:t.message,isFinalChunk:n}}}var g=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class m{constructor(e,t,n,r){this.file=e,this.crypto=t,this.api=n,this.downloader=new h(this.file,this.api,r)}createDecryptor(){return new f(this.file,this.crypto)}run(e){return g(this,void 0,void 0,(function*(){const t=this.createDecryptor();let n;const r=yield this.downloader.run(((r,i,o)=>g(this,void 0,void 0,(function*(){const s=t.decryptBytes(r);if(!s||0===s.decryptedBytes.length)return n=new u.ClientDisplayableError("Failed to decrypt chunk"),void o();const a=s.decryptedBytes;yield e({decrypted:{decryptedBytes:a},encrypted:{encryptedBytes:r},progress:i})}))));return{success:!(r instanceof u.ClientDisplayableError),error:"aborted"===r?void 0:r||n,aborted:"aborted"===r}}))}abort(){this.downloader.abort()}}class y{constructor(e){this.apiService=e}uploadBytes(e,t,n,r){return i=this,o=void 0,a=function*(){return yield this.apiService.uploadFileBytes(r,t,n,e)},new((s=void 0)||(s=Promise))((function(e,t){function n(e){try{l(a.next(e))}catch(e){t(e)}}function r(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(n,r)}l((a=a.apply(i,o||[])).next())}));var i,o,s,a}}class v{constructor(e,t){this.file=e,this.crypto=t}initializeHeader(){return this.stream=this.crypto.xchacha20StreamInitEncryptor(this.file.key),this.stream.header}pushBytes(e,t){if(!this.stream)throw new Error("FileEncryptor must call initializeHeader first");const n=t?p.SodiumTag.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL:void 0;return this.crypto.xchacha20StreamEncryptorPush(this.stream,e,this.file.remoteIdentifier,n)}}var A=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class b{constructor(e,t,n,r,i){this.file=e,this.valetToken=t,this.crypto=n,this.api=r,this.vault=i,this.encryptedChunkSizes=[],this.totalBytesPushedInDecryptedTerms=0,this.totalBytesUploadedInDecryptedTerms=0,this.encryptor=new v(e,this.crypto),this.uploader=new y(this.api),this.encryptionHeader=this.encryptor.initializeHeader()}getValetToken(){return this.valetToken}getProgress(){const e=this.file.decryptedSize;return{decryptedFileSize:e,decryptedBytesUploaded:this.totalBytesUploadedInDecryptedTerms,decryptedBytesRemaining:e-this.totalBytesUploadedInDecryptedTerms,percentComplete:this.totalBytesUploadedInDecryptedTerms/e*100}}getResult(){return{encryptionHeader:this.encryptionHeader,finalDecryptedSize:this.totalBytesPushedInDecryptedTerms,key:this.file.key,remoteIdentifier:this.file.remoteIdentifier}}pushBytes(e,t,n){return A(this,void 0,void 0,(function*(){this.totalBytesPushedInDecryptedTerms+=e.byteLength;const r=this.encryptBytes(e,n);this.encryptedChunkSizes.push(r.length);const i=yield this.uploadBytes(r,t);return i&&(this.totalBytesUploadedInDecryptedTerms+=e.byteLength),i}))}encryptBytes(e,t){return this.encryptor.pushBytes(e,t)}uploadBytes(e,t){return A(this,void 0,void 0,(function*(){return yield this.uploader.uploadBytes(e,this.vault&&this.vault.sharing?"shared-vault":"user",t,this.valetToken)}))}}var w=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};function S(e,t,n,r,i){return w(this,void 0,void 0,(function*(){const o=new f(t,r),s=new l(t.encryptedChunkSizes,"local",(e=>w(this,void 0,void 0,(function*(){const t=o.decryptBytes(e.data);t&&(yield i(t.decryptedBytes))}))));return yield n.readFile(e,(e=>w(this,void 0,void 0,(function*(){yield s.addBytes(e)}))))}))}const C=!1;var E;!function(e){e[e.FilesPackage=0]="FilesPackage"}(E||(E={}));const I={[E.FilesPackage]:!1},_={[E.FilesPackage]:"green"};function x(e){if(C&&I[e]){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];(0,r.logWithColor)(E[e],_[e],...n)}}var P=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};function k(e,t,n,r){return P(this,void 0,void 0,(function*(){x(E.FilesPackage,"Reading and decrypting backup file",e.uuid,"chunk sizes",e.encryptedChunkSizes);const i=new f(e,n),o=new l(e.encryptedChunkSizes,"local",(e=>P(this,void 0,void 0,(function*(){x(E.FilesPackage,"OrderedByteChunker did pop bytes",e.data.length,e.progress);const t=i.decryptBytes(e.data);t&&(yield r(Object.assign(Object.assign({},e),{data:t.decryptedBytes})))})))),s=yield t.readEncryptedFileFromBackup(e.uuid,(e=>P(this,void 0,void 0,(function*(){x(E.FilesPackage,"Got file chunk from backup service",e.data.length,e.progress),yield o.addBytes(e.data)}))));return x(E.FilesPackage,"Finished reading and decrypting backup file",e.uuid),s}))}function B(e,t,n){const r=Math.floor(e.percentComplete),i="network"===e.source?"":"memcache"===e.source?"from cache":"from backup";let o="Downloading file ".concat(i,' "').concat(t,'"');return n.showPercent&&(o+=" (".concat(r,"%)")),o}},56974:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},15866:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},35376:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},76317:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentViewerEvent=void 0,function(e){e.FeatureStatusUpdated="FeatureStatusUpdated"}(n||(t.ComponentViewerEvent=n={}))},88076:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},68763:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.KeyboardModifier=void 0,function(e){e.Shift="Shift",e.Ctrl="Control",e.Meta="Meta"}(n||(t.KeyboardModifier=n={}))},75895:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},74601:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},3668:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},42405:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FillItemContentSpecialized=t.FillItemContent=void 0;const r=n(71458),i=n(68716);function o(e){return e.references||(e.references=[]),e.appData||(e.appData={[r.DefaultAppDomain]:{}}),e.appData[r.DefaultAppDomain]||(e.appData[r.DefaultAppDomain]={}),e.appData[r.DefaultAppDomain][i.AppDataField.UserModifiedDate]||(e.appData[r.DefaultAppDomain][i.AppDataField.UserModifiedDate]=(new Date).toString()),e}t.FillItemContent=o,t.FillItemContentSpecialized=function(e){return o(e)}},95698:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},55930:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},36186:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},80537:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createComponentCreatedContextPayload=void 0,t.createComponentCreatedContextPayload=function(e){return{content_type:e.content_type,content:e.content,created_at:e.created_at,deleted:!1,uuid:e.uuid}}},1482:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateComponentRetrievedContextPayload=void 0,t.CreateComponentRetrievedContextPayload=function(e){return{content_type:e.content_type,content:e.content,created_at:e.created_at,deleted:!1,uuid:e.uuid}}},69087:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},70359:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.checkRemotePayloadAllowed=t.FilterDisallowedRemotePayloadsAndMap=void 0;const r=n(78381);function i(e){return(0,r.isCorruptTransferPayload)(e)?{disallowed:e}:(0,r.isEncryptedTransferPayload)(e)||null==e.content?{allowed:e}:{disallowed:e}}t.FilterDisallowedRemotePayloadsAndMap=function(e){const t=[],n=[];for(const o of e){const e=i(o);void 0===e.allowed?n.push(o):t.push((r=e.allowed,Object.assign(Object.assign({},r),{__passed_filter__:!0})))}var r;return{filtered:t,disallowed:n}},t.checkRemotePayloadAllowed=i},13214:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateDecryptedBackupFileContextPayload=t.CreateEncryptedBackupFileContextPayload=void 0,t.CreateEncryptedBackupFileContextPayload=function(e){return{auth_hash:e.auth_hash,content_type:e.content_type,content:e.content,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!1,duplicate_of:e.duplicate_of,enc_item_key:e.enc_item_key,items_key_id:e.items_key_id,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid}},t.CreateDecryptedBackupFileContextPayload=function(e){return{content_type:e.content_type,content:e.content,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!1,duplicate_of:e.duplicate_of,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid}}},84034:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateDeletedLocalStorageContextPayload=t.CreateDecryptedLocalStorageContextPayload=t.CreateEncryptedLocalStorageContextPayload=t.isEncryptedLocalStoragePayload=void 0;const r=n(87901),i=n(78381);t.isEncryptedLocalStoragePayload=function(e){return(0,i.isEncryptedTransferPayload)(e)},t.CreateEncryptedLocalStorageContextPayload=function(e){return{auth_hash:e.auth_hash,content_type:e.content_type,content:e.content,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!1,dirty:null!=e.dirty&&e.dirty,duplicate_of:e.duplicate_of,enc_item_key:e.enc_item_key,errorDecrypting:e.errorDecrypting,items_key_id:e.items_key_id,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,waitingForKey:e.waitingForKey,user_uuid:e.user_uuid,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid,last_edited_by_uuid:e.last_edited_by_uuid,signatureData:e.signatureData}},t.CreateDecryptedLocalStorageContextPayload=function(e){return{content_type:e.content_type,content:e.content,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!1,duplicate_of:e.duplicate_of,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,dirty:(0,r.useBoolean)(e.dirty,!1),user_uuid:e.user_uuid,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid,last_edited_by_uuid:e.last_edited_by_uuid,signatureData:e.signatureData}},t.CreateDeletedLocalStorageContextPayload=function(e){return{content_type:e.content_type,content:void 0,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!0,dirty:!0,duplicate_of:e.duplicate_of,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,user_uuid:e.user_uuid,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid,last_edited_by_uuid:e.last_edited_by_uuid,signatureData:e.signatureData}}},51600:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateOfflineSyncPushContextPayload=void 0;const r=n(59180);t.CreateOfflineSyncPushContextPayload=function(e){const t={content:void 0,content_type:e.content_type,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!1,duplicate_of:e.duplicate_of,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid};return(0,r.isDecryptedPayload)(e)?Object.assign(Object.assign({},t),{content:e.content}):Object.assign(Object.assign({},t),{deleted:e.deleted})}},30429:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateOfflineSyncSavedPayload=void 0;const r=n(59180);t.CreateOfflineSyncSavedPayload=function(e){return{content_type:e.content_type,created_at_timestamp:e.created_at_timestamp,deleted:(0,r.isDeletedPayload)(e),updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid}}},18592:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateDeletedServerSyncPushPayload=t.CreateEncryptedServerSyncPushPayload=void 0,t.CreateEncryptedServerSyncPushPayload=function(e){return{content_type:e.content_type,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!1,duplicate_of:e.duplicate_of,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,content:e.content,enc_item_key:e.enc_item_key,items_key_id:e.items_key_id,auth_hash:e.auth_hash,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid}},t.CreateDeletedServerSyncPushPayload=function(e){return{content_type:e.content_type,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!0,duplicate_of:e.duplicate_of,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,content:void 0,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid}}},2116:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateServerSyncSavedPayload=void 0;const r=n(87901);t.CreateServerSyncSavedPayload=function(e){return{content_type:e.content_type,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:(0,r.useBoolean)(e.deleted,!1),updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid,user_uuid:e.user_uuid,duplicate_of:e.duplicate_of,last_edited_by_uuid:e.last_edited_by_uuid}}},18973:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7563:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},43740:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DecryptedItem=void 0;const r=n(87901),i=n(68716),o=n(71458),s=n(97127),a=n(41035);class l extends s.GenericItem{constructor(e){super(e),this.protected=!1,this.trashed=!1,this.pinned=!1,this.archived=!1,this.locked=!1,this.starred=!1;const t=this.getAppDomainValueWithDefault(i.AppDataField.UserModifiedDate,this.serverUpdatedAt||0);this.userModifiedDate=new Date(t),this.conflictOf=e.content.conflict_of,this.updatedAtString=(0,r.dateToLocalizedString)(this.userModifiedDate),this.protected=(0,r.useBoolean)(this.payload.content.protected,!1),this.trashed=(0,r.useBoolean)(this.payload.content.trashed,!1),this.starred=(0,r.useBoolean)(this.payload.content.starred,!1),this.pinned=this.getAppDomainValueWithDefault(i.AppDataField.Pinned,!1),this.archived=this.getAppDomainValueWithDefault(i.AppDataField.Archived,!1),this.locked=this.getAppDomainValueWithDefault(i.AppDataField.Locked,!1)}static DefaultAppDomain(){return o.DefaultAppDomain}get content(){return this.payload.content}get references(){return this.payload.content.references||[]}isReferencingItem(e){return null!=this.references.find((t=>t.uuid===e.uuid))}getDomainData(e){const t=this.payload.content.appData;if(t)return t[e]}getAppDomainValue(e){const t=this.getDomainData(o.DefaultAppDomain);return null==t?void 0:t[e]}getAppDomainValueWithDefault(e,t){const n=this.getDomainData(o.DefaultAppDomain);return(null==n?void 0:n[e])||t}payloadRepresentation(e){return this.payload.copy(e)}contentKeysToIgnoreWhenCheckingEquality(){return["conflict_of"]}appDataContentKeysToIgnoreWhenCheckingEquality(){return[i.AppDataField.UserModifiedDate]}getContentCopy(){return JSON.parse(JSON.stringify(this.content))}isItemContentEqualWith(e){return(0,a.ItemContentsEqual)(this.payload.content,e.payload.content,this.contentKeysToIgnoreWhenCheckingEquality(),this.appDataContentKeysToIgnoreWhenCheckingEquality())}}t.DecryptedItem=l},78438:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DeletedItem=void 0;const r=n(97127);class i extends r.GenericItem{constructor(e){super(e),this.deleted=!0}payloadRepresentation(e){return this.payload.copy(e)}}t.DeletedItem=i},80406:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EncryptedItem=void 0;const r=n(97127);class i extends r.GenericItem{constructor(e){super(e)}get version(){return this.payload.version}payloadRepresentation(e){return this.payload.copy(e)}get errorDecrypting(){return this.payload.errorDecrypting}get waitingForKey(){return this.payload.waitingForKey}get content(){return this.payload.content}get auth_hash(){return this.payload.auth_hash}}t.EncryptedItem=i},97127:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GenericItem=void 0;const r=n(87901),i=n(33545),o=n(89223),s=n(43610),a=n(94515),l=n(63418);t.GenericItem=class{constructor(e){this.payload=e,this.duplicateOf=e.duplicate_of,this.createdAtString=this.created_at&&(0,r.dateToLocalizedString)(this.created_at),this.userModifiedDate=this.serverUpdatedAt||new Date,this.updatedAtString=(0,r.dateToLocalizedString)(this.userModifiedDate),setTimeout((()=>{(0,r.deepFreeze)(this)}),0)}get uuid(){return this.payload.uuid}get content_type(){return this.payload.content_type}get created_at(){return this.payload.created_at}get key_system_identifier(){return this.payload.key_system_identifier}get user_uuid(){return this.payload.user_uuid}get shared_vault_uuid(){return this.payload.shared_vault_uuid}get last_edited_by_uuid(){return this.payload.last_edited_by_uuid}get signatureData(){return this.payload.signatureData}get serverUpdatedAt(){return this.payload.serverUpdatedAt}get serverUpdatedAtTimestamp(){return this.payload.updated_at_timestamp}get updated_at(){return this.serverUpdatedAt}get dirty(){return this.payload.dirty}get lastSyncBegan(){return this.payload.lastSyncBegan}get lastSyncEnd(){return this.payload.lastSyncEnd}get duplicate_of(){return this.payload.duplicate_of}payloadRepresentation(e){return this.payload.copy(e)}get neverSynced(){return!this.serverUpdatedAt||0===this.serverUpdatedAt.getTime()}get isSingleton(){return!1}singletonPredicate(){throw"Must override SNItem.singletonPredicate"}get singletonStrategy(){return a.SingletonStrategy.KeepEarliest}strategyWhenConflictingWithItem(e,t){if((0,l.isEncryptedErroredItem)(this))return s.ConflictStrategy.KeepBaseDuplicateApply;if(this.isSingleton)return s.ConflictStrategy.KeepBase;if((0,l.isDeletedItem)(this))return s.ConflictStrategy.KeepApply;if((0,l.isDeletedItem)(e))return this.payload.source===o.PayloadSource.FileImport?s.ConflictStrategy.KeepBase:s.ConflictStrategy.KeepApply;if(!(0,l.isDecryptedItem)(e)||!(0,l.isDecryptedItem)(this))return s.ConflictStrategy.KeepBaseDuplicateApply;if(!(0,i.ItemContentsDiffer)(this,e))return s.ConflictStrategy.KeepApply;if((0,i.ItemContentsDiffer)(this,e,["references"])){if(t&&!(0,i.ItemContentsDiffer)(t.itemFromPayload(),e))return s.ConflictStrategy.KeepBase;const n=2e4;return e.payload.source===o.PayloadSource.FileImport||Date.now()-this.userModifiedDate.getTime()<n?s.ConflictStrategy.KeepBaseDuplicateApply:s.ConflictStrategy.DuplicateBaseKeepApply}return s.ConflictStrategy.KeepBaseMergeRefs}satisfiesPredicate(e){return e.matchesItem(this)}}},81667:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},91251:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},89169:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},12421:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},63418:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isEncryptedErroredItem=t.isDecryptedOrDeletedItem=t.isDeletedItem=t.isNotEncryptedItem=t.isEncryptedItem=t.isDecryptedItem=void 0;const r=n(13566);function i(e){return"payload"in e&&(0,r.isDecryptedPayload)(e.payload)}function o(e){return(0,r.isEncryptedPayload)(e.payload)}function s(e){return(0,r.isDeletedPayload)(e.payload)}t.isDecryptedItem=i,t.isEncryptedItem=o,t.isNotEncryptedItem=function(e){return!o(e)},t.isDeletedItem=s,t.isDecryptedOrDeletedItem=function(e){return i(e)||s(e)},t.isEncryptedErroredItem=function(e){return o(e)&&!0===e.errorDecrypting}},589:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},14584:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DecryptedItemMutator=void 0;const r=n(87901),i=n(4250),o=n(68716),s=n(71458),a=n(56634),l=n(13743);class c extends a.ItemMutator{constructor(e,t){super(e,t);const n=(0,r.Copy)(this.immutablePayload.content);this.mutableContent=n}getResult(){return this.type===i.MutationType.NonDirtying?this.immutablePayload.copy({content:this.mutableContent}):(this.type===i.MutationType.UpdateUserTimestamps?this.userModifiedDate=new Date:this.immutableItem.userModifiedDate||(this.userModifiedDate=new Date(this.immutableItem.serverUpdatedAt)),this.immutablePayload.copy({content:this.mutableContent,dirty:!0,dirtyIndex:(0,l.getIncrementedDirtyIndex)(),signatureData:void 0,last_edited_by_uuid:void 0}))}setBeginSync(e,t){this.immutablePayload=this.immutablePayload.copy({content:this.mutableContent,lastSyncBegan:e,globalDirtyIndexAtLastSync:t})}setCustomContent(e){this.mutableContent=(0,r.Copy)(e)}set userModifiedDate(e){this.setAppDataItem(o.AppDataField.UserModifiedDate,e)}set conflictOf(e){this.mutableContent.conflict_of=e}set protected(e){this.mutableContent.protected=e}set trashed(e){this.mutableContent.trashed=e}set starred(e){this.mutableContent.starred=e}set pinned(e){this.setAppDataItem(o.AppDataField.Pinned,e)}set archived(e){this.setAppDataItem(o.AppDataField.Archived,e)}set locked(e){this.setAppDataItem(o.AppDataField.Locked,e)}setDomainData(e,t){this.mutableContent.appData||(this.mutableContent.appData={[s.DefaultAppDomain]:{}}),this.mutableContent.appData[t]=e}setDomainDataKey(e,t,n){this.mutableContent.appData||(this.mutableContent.appData={[s.DefaultAppDomain]:{}}),this.mutableContent.appData[n]||(this.mutableContent.appData[n]={}),this.mutableContent.appData[n][e]=t}setAppDataItem(e,t){this.setDomainDataKey(e,t,s.DefaultAppDomain)}e2ePendingRefactor_addItemAsRelationship(e){const t=this.mutableContent.references||[];t.find((t=>t.uuid===e.uuid))||t.push({uuid:e.uuid,content_type:e.content_type}),this.mutableContent.references=t}removeItemAsRelationship(e){let t=this.mutableContent.references||[];t=t.filter((t=>t.uuid!==e.uuid)),this.mutableContent.references=t}}t.DecryptedItemMutator=c},94220:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DeleteItemMutator=void 0;const r=n(452),i=n(56634),o=n(4250),s=n(13743);class a extends i.ItemMutator{getDeletedResult(){const e=this.type!==o.MutationType.NonDirtying;return new r.DeletedPayload(Object.assign(Object.assign({},this.immutablePayload.ejected()),{deleted:!0,content:void 0,dirty:!!e||this.immutablePayload.dirty,dirtyIndex:e?(0,s.getIncrementedDirtyIndex)():this.immutablePayload.dirtyIndex}),this.immutablePayload.source)}getResult(){throw Error("Must use getDeletedResult")}}t.DeleteItemMutator=a},56634:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ItemMutator=void 0;const r=n(4250),i=n(13743),o=n(21662);t.ItemMutator=class{constructor(e,t){this.immutableItem=e,this.type=t,this.immutablePayload=e.payload}getUuid(){return this.immutablePayload.uuid}getItem(){return this.immutableItem}getResult(){return this.type===r.MutationType.NonDirtying?this.immutablePayload.copy():this.immutablePayload.copy({dirty:!0,dirtyIndex:(0,i.getIncrementedDirtyIndex)()})}setBeginSync(e,t){this.immutablePayload=this.immutablePayload.copy({lastSyncBegan:e,globalDirtyIndexAtLastSync:t})}set key_system_identifier(e){if((0,o.ContentTypeUsesRootKeyEncryption)(this.immutableItem.content_type))throw new Error("Cannot set key_system_identifier on a root key encrypted item");this.immutablePayload=this.immutablePayload.copy({key_system_identifier:e})}set shared_vault_uuid(e){if((0,o.ContentTypeUsesRootKeyEncryption)(this.immutableItem.content_type))throw new Error("Cannot set shared_vault_uuid on a root key encrypted item");this.immutablePayload=this.immutablePayload.copy({shared_vault_uuid:e})}set errorDecrypting(e){throw Error("This method is no longer implemented")}set updated_at(e){throw Error("This method is no longer implemented")}set updated_at_timestamp(e){throw Error("This method is no longer implemented")}}},8898:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},68716:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.AppDataField=void 0,function(e){e.Pinned="pinned",e.Archived="archived",e.Locked="locked",e.UserModifiedDate="client_updated_at",e.DefaultEditor="defaultEditor",e.MobileRules="mobileRules",e.NotAvailableOnMobile="notAvailableOnMobile",e.MobileActive="mobileActive",e.LastSize="lastSize",e.LegacyPrefersPlainEditor="prefersPlainEditor",e.ComponentInstallError="installError"}(n||(t.AppDataField=n={}))},43610:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ConflictStrategy=void 0,function(e){e[e.KeepBase=1]="KeepBase",e[e.KeepApply=2]="KeepApply",e[e.KeepBaseDuplicateApply=3]="KeepBaseDuplicateApply",e[e.DuplicateBaseKeepApply=4]="DuplicateBaseKeepApply",e[e.KeepBaseMergeRefs=5]="KeepBaseMergeRefs"}(n||(t.ConflictStrategy=n={}))},71458:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentDataDomain=t.DefaultAppDomain=void 0,t.DefaultAppDomain="org.standardnotes.sn",t.ComponentDataDomain="org.standardnotes.sn.components"},15579:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},91298:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4250:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MutationType=void 0,function(e){e[e.UpdateUserTimestamps=1]="UpdateUserTimestamps",e[e.NoUpdateUserTimestamps=2]="NoUpdateUserTimestamps",e[e.NonDirtying=3]="NonDirtying"}(n||(t.MutationType=n={}))},94515:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SingletonStrategy=void 0,function(e){e[e.KeepEarliest=1]="KeepEarliest"}(n||(t.SingletonStrategy=n={}))},50292:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(89661),t),i(n(78961),t),i(n(2445),t),i(n(64236),t),i(n(4744),t),i(n(27542),t),i(n(96933),t),i(n(77533),t),i(n(80421),t),i(n(43740),t),i(n(43740),t),i(n(78438),t),i(n(80406),t),i(n(97127),t),i(n(81667),t),i(n(91251),t),i(n(89169),t),i(n(12421),t),i(n(63418),t),i(n(589),t),i(n(14584),t),i(n(94220),t),i(n(56634),t),i(n(8898),t),i(n(68716),t),i(n(43610),t),i(n(71458),t),i(n(15579),t),i(n(91298),t),i(n(4250),t),i(n(94515),t)},89262:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DecryptedPayload=void 0;const r=n(87901),i=n(42405),o=n(89223),s=n(33264);class a extends s.PurePayload{constructor(e){super(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.PayloadSource.Constructor),this.content=(0,r.Copy)((0,i.FillItemContent)(e.content)),this.deleted=!1}get references(){return this.content.references||[]}getReference(e){const t=this.references.find((t=>t.uuid===e));if(!t)throw new Error("Reference not found");return t}ejected(){return Object.assign(Object.assign({},super.ejected()),{content:this.content,deleted:this.deleted})}copy(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.source;return new a(Object.assign(Object.assign({},this.ejected()),e),t)}copyAsSyncResolved(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.source;return new a(Object.assign(Object.assign({},this.ejected()),e),t)}}t.DecryptedPayload=a},452:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DeletedPayload=void 0;const r=n(89223),i=n(33264);class o extends i.PurePayload{constructor(e){super(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.PayloadSource.Constructor),this.deleted=!0,this.content=void 0}get discardable(){return!this.dirty}ejected(){return Object.assign(Object.assign({},super.ejected()),{deleted:this.deleted,content:void 0})}copy(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.source;return new o(Object.assign(Object.assign({},this.ejected()),e),t)}copyAsSyncResolved(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.source;return new o(Object.assign(Object.assign({},this.ejected()),e),t)}}t.DeletedPayload=o},86731:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EncryptedPayload=void 0;const r=n(80910),i=n(89223),o=n(33264);class s extends o.PurePayload{constructor(e){super(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.PayloadSource.Constructor);const t=(0,r.ProtocolVersionFromEncryptedString)(e.content);if(t.isFailed())throw new Error("EncryptedPayload constructor versionResult is failed");this.auth_hash=e.auth_hash,this.content=e.content,this.deleted=!1,this.enc_item_key=e.enc_item_key,this.errorDecrypting=e.errorDecrypting,this.items_key_id=e.items_key_id,this.version=t.getValue(),this.waitingForKey=e.waitingForKey}ejected(){return Object.assign(Object.assign({},super.ejected()),{enc_item_key:this.enc_item_key,items_key_id:this.items_key_id,auth_hash:this.auth_hash,errorDecrypting:this.errorDecrypting,waitingForKey:this.waitingForKey,content:this.content,deleted:this.deleted})}copy(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.source;return new s(Object.assign(Object.assign({},this.ejected()),e),t)}copyAsSyncResolved(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.source;return new s(Object.assign(Object.assign({},this.ejected()),e),t)}}t.EncryptedPayload=s},33264:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PurePayload=void 0;const r=n(87901),i=n(89223),o=n(21662);t.PurePayload=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.PayloadSource.Constructor;var n,s,a,l;if(!e.uuid)throw Error("Attempting to construct payload with null uuid\n        Content type: ".concat(e.content_type));if(e.key_system_identifier&&(0,o.ContentTypeUsesRootKeyEncryption)(e.content_type))throw new Error("Rootkey-encrypted payload should not have a key system identifier");this.source=t,this.uuid=e.uuid,this.content=e.content,this.content_type=e.content_type,this.deleted=(0,r.useBoolean)(e.deleted,!1),this.dirty=e.dirty,this.duplicate_of=e.duplicate_of,this.updated_at=new Date(e.updated_at||0),this.updated_at_timestamp=e.updated_at_timestamp||0,this.updated_at_timestamp<0&&(this.updated_at_timestamp=0,this.updated_at=new Date(0)),this.created_at=new Date(e.created_at||new Date),this.created_at_timestamp=e.created_at_timestamp||0,this.created_at_timestamp<0&&(this.created_at_timestamp=this.updated_at_timestamp,this.created_at=this.updated_at),this.lastSyncBegan=e.lastSyncBegan?new Date(e.lastSyncBegan):void 0,this.lastSyncEnd=e.lastSyncEnd?new Date(e.lastSyncEnd):void 0,this.dirtyIndex=e.dirtyIndex,this.globalDirtyIndexAtLastSync=e.globalDirtyIndexAtLastSync,this.user_uuid=null!==(n=e.user_uuid)&&void 0!==n?n:void 0,this.key_system_identifier=null!==(s=e.key_system_identifier)&&void 0!==s?s:void 0,this.shared_vault_uuid=null!==(a=e.shared_vault_uuid)&&void 0!==a?a:void 0,this.last_edited_by_uuid=null!==(l=e.last_edited_by_uuid)&&void 0!==l?l:void 0,this.signatureData=e.signatureData,setTimeout((()=>{(0,r.deepFreeze)(this)}),0)}ejected(){return{uuid:this.uuid,content:this.content,deleted:this.deleted,content_type:this.content_type,created_at:this.created_at,updated_at:this.updated_at,created_at_timestamp:this.created_at_timestamp,updated_at_timestamp:this.updated_at_timestamp,dirty:this.dirty,duplicate_of:this.duplicate_of,dirtyIndex:this.dirtyIndex,globalDirtyIndexAtLastSync:this.globalDirtyIndexAtLastSync,lastSyncBegan:this.lastSyncBegan,lastSyncEnd:this.lastSyncEnd,key_system_identifier:this.key_system_identifier,user_uuid:this.user_uuid,shared_vault_uuid:this.shared_vault_uuid,last_edited_by_uuid:this.last_edited_by_uuid,signatureData:this.signatureData}}get serverUpdatedAt(){return this.updated_at}get serverUpdatedAtTimestamp(){return this.updated_at_timestamp}}},83732:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},75310:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},3008:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},59296:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},13566:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isErrorDecryptingPayload=t.isDeletedPayload=t.isEncryptedPayload=t.isDecryptedPayload=void 0;const r=n(78381);t.isDecryptedPayload=function(e){return(0,r.isDecryptedTransferPayload)(e)},t.isEncryptedPayload=function(e){return(0,r.isEncryptedTransferPayload)(e)},t.isDeletedPayload=function(e){return(0,r.isDeletedTransferPayload)(e)},t.isErrorDecryptingPayload=function(e){return(0,r.isErrorDecryptingTransferPayload)(e)}},92238:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},55340:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadTimestampDefaults=void 0,t.PayloadTimestampDefaults=function(){return{updated_at:new Date(0),created_at:new Date,updated_at_timestamp:0,created_at_timestamp:0}}},21989:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadVaultOverrides=void 0,t.PayloadVaultOverrides=function(e){return e?{key_system_identifier:e.systemIdentifier,shared_vault_uuid:e.isSharedVaultListing()?e.sharing.sharedVaultUuid:void 0}:{}}},62935:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.isPayloadSourceRetrieved=t.isPayloadSourceInternalChange=t.PayloadEmitSource=void 0,function(e){e[e.InitialObserverRegistrationPush=1]="InitialObserverRegistrationPush",e[e.LocalChanged=2]="LocalChanged",e[e.LocalInserted=3]="LocalInserted",e[e.LocalDatabaseLoaded=4]="LocalDatabaseLoaded",e[e.OfflineSyncSaved=5]="OfflineSyncSaved",e[e.LocalRetrieved=6]="LocalRetrieved",e[e.FileImport=7]="FileImport",e[e.ComponentRetrieved=8]="ComponentRetrieved",e[e.ComponentCreated=9]="ComponentCreated",e[e.PreSyncSave=10]="PreSyncSave",e[e.RemoteRetrieved=11]="RemoteRetrieved",e[e.RemoteSaved=12]="RemoteSaved",e[e.DesktopComponentSync=13]="DesktopComponentSync"}(n||(t.PayloadEmitSource=n={})),t.isPayloadSourceInternalChange=function(e){return[n.RemoteSaved,n.PreSyncSave].includes(e)},t.isPayloadSourceRetrieved=function(e){return[n.RemoteRetrieved,n.ComponentRetrieved].includes(e)}},89223:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadSource=void 0,function(e){e[e.Constructor=1]="Constructor",e[e.LocalDatabaseLoaded=2]="LocalDatabaseLoaded",e[e.RemoteRetrieved=3]="RemoteRetrieved",e[e.RemoteSaved=4]="RemoteSaved",e[e.FileImport=5]="FileImport"}(n||(t.PayloadSource=n={}))},59180:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(33264),t),i(n(89262),t),i(n(86731),t),i(n(452),t),i(n(83732),t),i(n(75310),t),i(n(3008),t),i(n(59296),t),i(n(13566),t),i(n(92238),t),i(n(89223),t),i(n(62935),t),i(n(55340),t),i(n(21989),t)},89661:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},2445:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},78961:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ContentReferenceType=void 0,function(e){e.TagToParentTag="TagToParentTag",e.TagToFile="TagToFile",e.FileToNote="FileToNote",e.FileToFile="FileToFile",e.NoteToNote="NoteToNote"}(n||(t.ContentReferenceType=n={}))},64236:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4744:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isTagToParentTagReference=t.isLegacyTagToNoteReference=t.isReference=t.isLegacyAnonymousReference=void 0;const r=n(82648),i=n(78961);t.isLegacyAnonymousReference=e=>void 0===e.reference_type,t.isReference=e=>void 0!==e.reference_type,t.isLegacyTagToNoteReference=(e,t)=>{const n=e.content_type===r.ContentType.TYPES.Note,i=t.content_type===r.ContentType.TYPES.Tag;return n&&i},t.isTagToParentTagReference=e=>(0,t.isReference)(e)&&e.reference_type===i.ContentReferenceType.TagToParentTag},27542:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},96933:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},77533:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},80421:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},69421:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},57978:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},95520:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7834:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},49762:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isCorruptTransferPayload=t.isDeletedTransferPayload=t.isErrorDecryptingTransferPayload=t.isEncryptedTransferPayload=t.isDecryptedTransferPayload=void 0;const r=n(82648),i=n(87901);function o(e){return"content"in e&&(0,i.isString)(e.content)}t.isDecryptedTransferPayload=function(e){return(0,i.isObject)(e.content)},t.isEncryptedTransferPayload=o,t.isErrorDecryptingTransferPayload=function(e){return o(e)&&!0===e.errorDecrypting},t.isDeletedTransferPayload=function(e){return"deleted"in e&&!0===e.deleted},t.isCorruptTransferPayload=function(e){const t=!0===e.deleted&&null!=e.content,n=r.ContentType.create(e.content_type);return null==e.uuid||t||n.isFailed()}},78381:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(69421),t),i(n(57978),t),i(n(95520),t),i(n(7834),t),i(n(49762),t)},21907:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},66675:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.InvitationStatus=void 0,function(e){e.Sent="sent",e.Canceled="canceled",e.Accepted="accepted",e.Declined="declined"}(n||(t.InvitationStatus=n={}))},90656:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.InviteeIdentifierType=void 0,function(e){e.Email="email",e.Hash="hash",e.Uuid="uuid"}(n||(t.InviteeIdentifierType=n={}))},93715:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.InviterIdentifierType=void 0,function(e){e.Email="email",e.Uuid="uuid"}(n||(t.InviterIdentifierType=n={}))},84457:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Environment=void 0,function(e){e[e.Web=1]="Web",e[e.Desktop=2]="Desktop",e[e.Mobile=3]="Mobile",e[e.Clipper=4]="Clipper"}(n||(t.Environment=n={}))},656:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Platform=void 0,function(e){e[e.Ios=1]="Ios",e[e.Android=2]="Android",e[e.MacWeb=3]="MacWeb",e[e.MacDesktop=4]="MacDesktop",e[e.WindowsWeb=5]="WindowsWeb",e[e.WindowsDesktop=6]="WindowsDesktop",e[e.LinuxWeb=7]="LinuxWeb",e[e.LinuxDesktop=8]="LinuxDesktop"}(n||(t.Platform=n={}))},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},62846:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.KeySystemPasswordType=void 0,function(e){e.UserInputted="user_inputted",e.Randomized="randomized"}(n||(t.KeySystemPasswordType=n={}))},29899:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},22296:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},52174:(e,t)=>{var n;function r(e,t){return Number(e)-Number(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.isVersionLessThanOrEqualTo=t.leftVersionGreaterThanOrEqualToRight=t.compareVersions=t.ProtocolVersionLength=t.isProtocolVersionExpired=t.ProtocolExpirationDates=t.ProtocolVersionLastNonrootItemsKey=t.ProtocolVersionLatest=t.ProtocolVersion=void 0,function(e){e.V001="001",e.V002="002",e.V003="003",e.V004="004"}(n||(t.ProtocolVersion=n={})),t.ProtocolVersionLatest=n.V004,t.ProtocolVersionLastNonrootItemsKey=n.V003,t.ProtocolExpirationDates=Object.freeze({[n.V001]:Date.parse("2018-01-01"),[n.V002]:Date.parse("2020-01-01")}),t.isProtocolVersionExpired=function(e){const n=t.ProtocolExpirationDates[e];return!!n&&(new Date).getTime()>n},t.ProtocolVersionLength=3,t.compareVersions=r,t.leftVersionGreaterThanOrEqualToRight=function(e,t){return r(e,t)>=0},t.isVersionLessThanOrEqualTo=function(e,t){return r(e,t)<=0}},80910:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolVersionFromEncryptedString=void 0;const r=n(82648),i=n(52174);t.ProtocolVersionFromEncryptedString=function(e){try{const t=e.substring(0,i.ProtocolVersionLength);if(Object.values(i.ProtocolVersion).includes(t))return r.Result.ok(t)}catch(e){return r.Result.fail(JSON.stringify(e))}return r.Result.fail("Invalid encrypted string ".concat(e))}},87192:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},71109:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},32099:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},55430:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},33738:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},64130:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.AsymmetricMessagePayloadType=void 0,function(e){e.ContactShare="contact-share",e.SharedVaultRootKeyChanged="shared-vault-root-key-changed",e.SenderKeypairChanged="sender-keypair-changed",e.SharedVaultMetadataChanged="shared-vault-metadata-changed",e.SharedVaultInvite="shared-vault-invite"}(n||(t.AsymmetricMessagePayloadType=n={}))},18018:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},14770:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},45698:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},63070:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},32151:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},71165:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Collection=void 0;const r=n(87901),i=n(84213);t.Collection=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;this.map={},this.typedMap={},this.dirtyIndex=new Set,this.nondeletedIndex=new Set,this.invalidsIndex=new Set,this.isDecryptedElement=e=>(0,r.isObject)(e.content),this.isEncryptedElement=e=>"content"in e&&(0,r.isString)(e.content),this.isErrorDecryptingElement=e=>this.isEncryptedElement(e),this.isDeletedElement=e=>"deleted"in e&&!0===e.deleted,this.isNonDeletedElement=e=>!this.isDeletedElement(e),e?(this.map=t,this.typedMap=n,this.referenceMap=i,this.conflictMap=o):(this.referenceMap=new r.UuidMap,this.conflictMap=new r.UuidMap)}uuids(){return Object.keys(this.map)}all(e){var t;if(e){if(Array.isArray(e)){const t=[];for(const n of e)(0,r.extendArray)(t,this.typedMap[n]||[]);return t}return(null===(t=this.typedMap[e])||void 0===t?void 0:t.slice())||[]}return Object.keys(this.map).map((e=>this.map[e]))}nondeletedElements(){const e=Array.from(this.nondeletedIndex);return this.findAll(e).filter(this.isNonDeletedElement)}invalidElements(){const e=Array.from(this.invalidsIndex);return this.findAll(e)}dirtyElements(){const e=Array.from(this.dirtyIndex);return this.findAll(e)}findAll(e){const t=[];for(const n of e){const e=this.map[n];e&&t.push(e)}return t}find(e){return this.map[e]}has(e){return null!=this.find(e)}findAllIncludingBlanks(e){const t=[];for(const n of e){const e=this.map[n];t.push(e)}return t}set(e){if(0!==(e=Array.isArray(e)?e:[e]).length)for(const t of e){if(this.map[t.uuid]=t,this.setToTypedMap(t),this.isErrorDecryptingElement(t)?this.invalidsIndex.add(t.uuid):this.invalidsIndex.delete(t.uuid),this.isDecryptedElement(t)){const e=t.content.conflict_of;e&&!t.content.trashed&&this.conflictMap.establishRelationship(e,t.uuid);const n=e&&t.content.trashed,r=!e&&this.conflictMap.getInverseRelationships(t.uuid).length>0,i=this.conflictMap.existsInDirectMap(t.uuid)&&0===this.conflictMap.getDirectRelationships(t.uuid).length;(r||i||n)&&this.conflictMap.removeFromMap(t.uuid),this.referenceMap.setAllRelationships(t.uuid,t.references.map((e=>e.uuid)))}t.dirty?this.dirtyIndex.add(t.uuid):this.dirtyIndex.delete(t.uuid),t.deleted?(this.nondeletedIndex.delete(t.uuid),(this.conflictMap.existsInDirectMap(t.uuid)||this.conflictMap.existsInInverseMap(t.uuid))&&this.conflictMap.removeFromMap(t.uuid)):this.nondeletedIndex.add(t.uuid)}else console.warn("Attempting to set 0 elements onto collection")}discard(e){e=Array.isArray(e)?e:[e];for(const t of e)this.deleteFromTypedMap(t),delete this.map[t.uuid],this.conflictMap.removeFromMap(t.uuid),this.referenceMap.removeFromMap(t.uuid)}uuidReferencesForUuid(e){return this.referenceMap.getDirectRelationships(e)}uuidsThatReferenceUuid(e){return this.referenceMap.getInverseRelationships(e)}referencesForElement(e){const t=this.referenceMap.getDirectRelationships(e.uuid);return this.findAll(t)}conflictsOf(e){const t=this.conflictMap.getDirectRelationships(e);return this.findAll(t)}elementsReferencingElement(e,t){const n=this.uuidsThatReferenceUuid(e.uuid),r=this.findAll(n);return t?r.filter((e=>e.content_type===t)):r}setToTypedMap(e){const t=this.typedMap[e.content_type]||[];(0,i.remove)(t,{uuid:e.uuid}),t.push(e),this.typedMap[e.content_type]=t}deleteFromTypedMap(e){const t=this.typedMap[e.content_type]||[];(0,i.remove)(t,{uuid:e.uuid}),this.typedMap[e.content_type]=t}uuidsOfItemsWithConflicts(){return this.conflictMap.getAllDirectKeys()}}},92207:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CollectionSort=void 0,t.CollectionSort={CreatedAt:"created_at",UpdatedAt:"userModifiedDate",Title:"title"}},36883:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ItemCollection=void 0;const r=n(63418),i=n(71165);class o extends i.Collection{onChange(e){const t=e.changed.concat(e.inserted);t.length>0&&this.set(t),this.discard(e.discarded)}findDecrypted(e){const t=this.find(e);if(t)return(0,r.isDecryptedItem)(t)?t:void 0}findAllDecrypted(e){return this.findAll(e).filter(r.isDecryptedItem)}findAllDecryptedWithBlanks(e){return this.findAllIncludingBlanks(e).map((e=>{if(null==e||(0,r.isDecryptedItem)(e))return e}))}allDecrypted(e){return this.all(e).filter(r.isDecryptedItem)}}t.ItemCollection=o},17441:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ItemCounter=void 0;const r=n(87901),i=n(4862),o=n(50292),s=n(45408),a=n(19688),l=n(52197),c=n(59017),u=n(79256),d=n(41574),h=n(82648);t.ItemCounter=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.collection=e,this.observers=t,this.tagToItemsMap={},this.allCountableItems=new Set,this.countableItemsByType=new Map,this.isItemCountable=e=>!!(0,o.isDecryptedItem)(e)&&this.passesAllFilters(e)&&!e.archived&&!e.trashed&&!e.conflictOf}addCountChangeObserver(e){this.observers.push(e);const t=this.observers;return()=>{(0,r.removeFromArray)(t,e)}}setDisplayOptions(e){this.displayOptions=e,this.receiveItemChanges(this.collection.all())}setVaultDisplayOptions(e){this.vaultDisplayOptions=e,this.receiveItemChanges(this.collection.all())}allCountableItemsCount(){return this.allCountableItems.size}allCountableNotesCount(){var e;return(null===(e=this.countableItemsByType.get(h.ContentType.TYPES.Note))||void 0===e?void 0:e.size)||0}allCountableFilesCount(){var e;return(null===(e=this.countableItemsByType.get(h.ContentType.TYPES.File))||void 0===e?void 0:e.size)||0}countableItemsForTag(e){var t;return(null===(t=this.tagToItemsMap[e.uuid])||void 0===t?void 0:t.size)||0}onChange(e){const t=[...e.changed,...e.inserted,...e.discarded].filter((e=>e.content_type===h.ContentType.TYPES.Note||e.content_type===h.ContentType.TYPES.File)),n=[...e.changed,...e.inserted].filter(o.isDecryptedItem).filter(i.isTag);this.receiveItemChanges(t),this.receiveTagChanges(n)}passesAllFilters(e){if(!this.displayOptions)return!0;const t=[new s.CollectionCriteriaValidator(this.collection,e)];if(this.vaultDisplayOptions){const n=this.vaultDisplayOptions.getOptions();(0,d.isExclusionaryOptionsValue)(n)?t.push(new a.ExcludeVaultsCriteriaValidator([...n.exclude,...n.locked],e)):t.push(new l.ExclusiveVaultCriteriaValidator(n.exclusive,e))}return"hiddenContentTypes"in this.displayOptions&&this.displayOptions.hiddenContentTypes&&t.push(new c.HiddenContentCriteriaValidator(this.displayOptions.hiddenContentTypes,e)),"customFilter"in this.displayOptions&&this.displayOptions.customFilter&&t.push(new u.CustomFilterCriteriaValidator(this.displayOptions.customFilter,e)),t.every((e=>e.passes()))}notifyObservers(e){for(const t of this.observers)t(e)}receiveTagChanges(e){for(const t of e){const e=t.references.filter((e=>e.content_type===h.ContentType.TYPES.Note||e.content_type===h.ContentType.TYPES.File)).map((e=>e.uuid)).filter((e=>this.allCountableItems.has(e))),n=this.tagToItemsMap[t.uuid];this.tagToItemsMap[t.uuid]=new Set(e),(null==n?void 0:n.size)!==e.length&&this.notifyObservers(t.uuid)}}receiveItemChanges(e){var t,n;const r=this.allCountableItems.size;for(const r of e){const e=this.isItemCountable(r);e?(this.allCountableItems.add(r.uuid),this.countableItemsByType.has(r.content_type)||this.countableItemsByType.set(r.content_type,new Set),null===(t=this.countableItemsByType.get(r.content_type))||void 0===t||t.add(r.uuid)):(this.allCountableItems.delete(r.uuid),null===(n=this.countableItemsByType.get(r.content_type))||void 0===n||n.delete(r.uuid));const i=this.collection.uuidsThatReferenceUuid(r.uuid);for(const t of i){const n=this.setForTag(t),i=n.size;e?n.add(r.uuid):n.delete(r.uuid),i!==n.size&&this.notifyObservers(t)}}r!==this.allCountableItems.size&&this.notifyObservers(void 0)}setForTag(e){let t=this.tagToItemsMap[e];return t||(t=new Set,this.tagToItemsMap[e]=t),t}}},51833:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ImmutablePayloadCollection=void 0;const r=n(19759);class i extends r.PayloadCollection{get payloads(){return this.all()}static WithPayloads(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=new i;return e.length>0&&t.set(e),Object.freeze(t),t}static FromCollection(e){const t=Object.freeze(Object.assign({},e.map)),n=Object.freeze(Object.assign({},e.typedMap)),r=Object.freeze(e.referenceMap.makeCopy()),o=Object.freeze(e.conflictMap.makeCopy()),s=new i(!0,t,n,r,o);return Object.freeze(s),s}mutableCopy(){const e=Object.assign({},this.map),t=Object.assign({},this.typedMap),n=this.referenceMap.makeCopy(),i=this.conflictMap.makeCopy();return new r.PayloadCollection(!0,e,t,n,i)}}t.ImmutablePayloadCollection=i},19759:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadCollection=void 0;const r=n(71165);class i extends r.Collection{integrityPayloads(){return this.nondeletedElements().map((e=>({uuid:e.uuid,updated_at_timestamp:e.serverUpdatedAtTimestamp})))}}t.PayloadCollection=i},9611:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendSyncDelta=void 0;const r=n(87901);t.extendSyncDelta=function(e,t){(0,r.extendArray)(e.emits,t.emits),t.ignored&&(e.ignored||(e.ignored=[]),(0,r.extendArray)(e.ignored,t.ignored))}},38067:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ConflictDelta=void 0;const r=n(87901),i=n(82648),o=n(73277),s=n(97873),a=n(43610),l=n(27446),c=n(37807),u=n(13566),d=n(38656),h=n(13743);t.ConflictDelta=class{constructor(e,t,n,r){this.baseCollection=e,this.basePayload=t,this.applyPayload=n,this.historyMap=r}result(){if(this.applyPayload.content_type===i.ContentType.TYPES.ItemsKey)return new d.ItemsKeyDelta(this.baseCollection,[this.applyPayload]).result();const e=this.getConflictStrategy();return{emits:this.handleStrategy(e),ignored:[]}}getConflictStrategy(){const e=(0,u.isErrorDecryptingPayload)(this.basePayload),t=(0,u.isErrorDecryptingPayload)(this.applyPayload);if(e||t){if(e&&!t)return a.ConflictStrategy.KeepBaseDuplicateApply;if(!e&&t)return a.ConflictStrategy.DuplicateBaseKeepApply;if(e&&t)return a.ConflictStrategy.KeepApply}else{if((0,u.isDecryptedPayload)(this.basePayload)){const e=this.baseCollection.conflictsOf(this.applyPayload.uuid)[0];if(e&&(0,u.isDecryptedPayload)(e)&&(0,u.isDecryptedPayload)(this.applyPayload)&&(0,c.PayloadContentsEqual)(e,this.applyPayload))return a.ConflictStrategy.KeepBase;{const e=(0,o.CreateDecryptedItemFromPayload)(this.basePayload),t=(0,o.CreateItemFromPayload)(this.applyPayload),n=this.historyMap[this.basePayload.uuid]||[],r=s.historyMapFunctions.getNewestRevision(n);return e.strategyWhenConflictingWithItem(t,r)}}if((0,u.isDeletedPayload)(this.basePayload)||(0,u.isDeletedPayload)(this.applyPayload))return(0,u.isDeletedPayload)(this.basePayload),(0,u.isDeletedPayload)(this.applyPayload),a.ConflictStrategy.KeepApply}throw Error("Unhandled strategy in Conflict Delta getConflictStrategy")}handleStrategy(e){if(e===a.ConflictStrategy.KeepBase)return this.handleKeepBaseStrategy();if(e===a.ConflictStrategy.KeepApply)return this.handleKeepApplyStrategy();if(e===a.ConflictStrategy.KeepBaseDuplicateApply)return this.handleKeepBaseDuplicateApplyStrategy();if(e===a.ConflictStrategy.DuplicateBaseKeepApply)return this.handleDuplicateBaseKeepApply();if(e===a.ConflictStrategy.KeepBaseMergeRefs)return this.handleKeepBaseMergeRefsStrategy();throw Error("Unhandled strategy in conflict delta payloadsByHandlingStrategy")}handleKeepBaseStrategy(){const e=this.applyPayload.serverUpdatedAt,t=this.applyPayload.updated_at_timestamp;return[this.basePayload.copyAsSyncResolved({updated_at:e,updated_at_timestamp:t,dirtyIndex:(0,h.getIncrementedDirtyIndex)(),dirty:!0,lastSyncEnd:new Date},this.applyPayload.source)]}handleKeepApplyStrategy(){return[this.applyPayload.copyAsSyncResolved({lastSyncBegan:this.basePayload.lastSyncBegan,lastSyncEnd:new Date,dirty:!1},this.applyPayload.source)]}handleKeepBaseDuplicateApplyStrategy(){const e=this.applyPayload.serverUpdatedAt,t=this.applyPayload.updated_at_timestamp,n=this.basePayload.copyAsSyncResolved({updated_at:e,updated_at_timestamp:t,dirty:!0,dirtyIndex:(0,h.getIncrementedDirtyIndex)(),lastSyncEnd:new Date},this.applyPayload.source),r=(0,l.PayloadsByDuplicating)({payload:this.applyPayload,baseCollection:this.baseCollection,isConflict:!0,source:this.applyPayload.source});return[n].concat(r)}handleDuplicateBaseKeepApply(){const e=(0,l.PayloadsByDuplicating)({payload:this.basePayload,baseCollection:this.baseCollection,isConflict:!0,source:this.applyPayload.source}),t=this.applyPayload.copyAsSyncResolved({lastSyncBegan:this.basePayload.lastSyncBegan,dirty:!1,lastSyncEnd:new Date},this.applyPayload.source);return e.concat([t])}handleKeepBaseMergeRefsStrategy(){if(!(0,u.isDecryptedPayload)(this.basePayload)||!(0,u.isDecryptedPayload)(this.applyPayload))return[];const e=(0,r.uniqCombineObjArrays)(this.basePayload.content.references,this.applyPayload.content.references,["uuid","content_type"]),t=this.applyPayload.serverUpdatedAt,n=this.applyPayload.updated_at_timestamp;return[this.basePayload.copyAsSyncResolved({updated_at:t,updated_at_timestamp:n,dirty:!0,dirtyIndex:(0,h.getIncrementedDirtyIndex)(),lastSyncEnd:new Date,content:Object.assign(Object.assign({},this.basePayload.content),{references:e})},this.applyPayload.source)]}}},33076:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaFileImport=void 0;const r=n(38067),i=n(59180),o=n(9611),s=n(13743);t.DeltaFileImport=class{constructor(e,t,n){this.baseCollection=e,this.applyPayloads=t,this.historyMap=n}result(){const e={emits:[],ignored:[],source:i.PayloadEmitSource.FileImport};for(const t of this.applyPayloads){const n=this.resolvePayload(t,e);(0,o.extendSyncDelta)(e,n)}return e}resolvePayload(e,t){let n=t.emits.find((t=>(0,i.isDecryptedPayload)(t)&&t.content.conflict_of===e.uuid));if(n||(n=t.emits.find((t=>t.uuid===e.uuid))),!n){const t=this.baseCollection.find(e.uuid);t&&(0,i.isDecryptedPayload)(t)&&(n=t)}return n?new r.ConflictDelta(this.baseCollection,n,e,this.historyMap).result():{emits:[e.copyAsSyncResolved({dirty:!0,dirtyIndex:(0,s.getIncrementedDirtyIndex)(),lastSyncEnd:new Date(0)})],ignored:[]}}}},38656:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ItemsKeyDelta=void 0;const r=n(59180),i=n(72990);t.ItemsKeyDelta=class{constructor(e,t){this.baseCollection=e,this.applyPayloads=t}result(){const e=[],t=[];for(const n of this.applyPayloads){const o=this.baseCollection.find(n.uuid);if(o)if((0,r.isEncryptedPayload)(n)&&(0,r.isDecryptedPayload)(o)){const r=o.copyAsSyncResolved({updated_at_timestamp:n.updated_at_timestamp,updated_at:n.updated_at,dirty:!1,lastSyncEnd:new Date});e.push(r),t.push(n)}else e.push((0,i.payloadByFinalizingSyncState)(n,this.baseCollection));else e.push((0,i.payloadByFinalizingSyncState)(n,this.baseCollection))}return{emits:e,ignored:t}}}},9910:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaOfflineSaved=void 0;const r=n(59180),i=n(72990);t.DeltaOfflineSaved=class{constructor(e,t){this.baseCollection=e,this.applyContextualPayloads=t}result(){const e=[];for(const t of this.applyContextualPayloads){const n=this.baseCollection.find(t.uuid);n&&e.push((0,i.payloadByFinalizingSyncState)(n,this.baseCollection))}return{emits:e,source:r.PayloadEmitSource.OfflineSyncSaved}}}},28504:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaOutOfSync=void 0;const r=n(59180),i=n(13566),o=n(37807),s=n(38067),a=n(82648),l=n(38656),c=n(72990),u=n(9611);t.DeltaOutOfSync=class{constructor(e,t,n){this.baseCollection=e,this.applyCollection=t,this.historyMap=n}result(){const e={emits:[],ignored:[],source:r.PayloadEmitSource.RemoteRetrieved};for(const t of this.applyCollection.all()){if(t.content_type===a.ContentType.TYPES.ItemsKey){const n=new l.ItemsKeyDelta(this.baseCollection,[t]).result();(0,u.extendSyncDelta)(e,n);continue}const n=this.baseCollection.find(t.uuid);if(!n){e.emits.push((0,c.payloadByFinalizingSyncState)(t,this.baseCollection));continue}const r=(0,i.isDecryptedPayload)(n),d=(0,i.isDecryptedPayload)(t);if(d!==r||d&&r&&!(0,o.PayloadContentsEqual)(t,n)){const r=new s.ConflictDelta(this.baseCollection,n,t,this.historyMap);(0,u.extendSyncDelta)(e,r.result())}else e.emits.push((0,c.payloadByFinalizingSyncState)(t,this.baseCollection))}return e}}},9579:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaRemoteDataConflicts=void 0;const r=n(38067),i=n(59180),o=n(9611),s=n(72990);t.DeltaRemoteDataConflicts=class{constructor(e,t,n){this.baseCollection=e,this.conflicts=t,this.historyMap=n}result(){const e={emits:[],ignored:[],source:i.PayloadEmitSource.RemoteRetrieved};for(const t of this.conflicts){const n=this.baseCollection.find(t.server_item.uuid);if(null==n){e.emits.push((0,s.payloadByFinalizingSyncState)(t.server_item,this.baseCollection));continue}const i=new r.ConflictDelta(this.baseCollection,n,t.server_item,this.historyMap);(0,o.extendSyncDelta)(e,i.result())}return e}}},34319:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaRemoteRejected=void 0;const r=n(89223),i=n(59180),o=n(84625),s=n(95658),a=n(27446),l=n(82648);t.DeltaRemoteRejected=class{constructor(e,t){this.baseCollection=e,this.conflicts=t}result(){const e=[],t=[s.ConflictType.SharedVaultInsufficientPermissionsError,s.ConflictType.SharedVaultNotMemberError,s.ConflictType.SharedVaultInvalidState,s.ConflictType.SharedVaultSnjsVersionError];for(const n of this.conflicts)t.includes(n.type)?e.push(...this.handleVaultError(n)):(0,s.conflictParamsHasServerItemAndUnsavedItem)(n)?e.push(...this.getResultForConflictWithServerItemAndUnsavedItem(n)):(0,s.conflictParamsHasOnlyServerItem)(n)?e.push(...this.getResultForConflictWithOnlyServerItem(n)):(0,s.conflictParamsHasOnlyUnsavedItem)(n)&&e.push(...this.getResultForConflictWithOnlyUnsavedItem(n));return{emits:e,source:i.PayloadEmitSource.RemoteSaved}}handleVaultError(e){const t=this.baseCollection.find(e.unsaved_item.uuid);return t?e.type===s.ConflictType.SharedVaultNotMemberError?this.resultByDuplicatingBasePayloadAsNonVaultedAndRemovingBaseItemLocally(t):t.content_type===l.ContentType.TYPES.KeySystemItemsKey?this.discardChangesOfBasePayload(t):e.server_item?this.resultByDuplicatingBasePayloadAsNonVaultedAndTakingServerPayloadAsCanonical(t,e.server_item):this.resultByDuplicatingBasePayloadAsNonVaultedAndDiscardingChangesOfOriginal(t):[]}discardChangesOfBasePayload(e){return[e.copyAsSyncResolved({dirty:!1,lastSyncEnd:new Date},r.PayloadSource.RemoteSaved)]}getResultForConflictWithOnlyUnsavedItem(e){const t=this.baseCollection.find(e.unsaved_item.uuid);return t?[t.copyAsSyncResolved({dirty:!1,lastSyncEnd:new Date},r.PayloadSource.RemoteSaved)]:[]}getResultForConflictWithOnlyServerItem(e){const t=this.baseCollection.find(e.server_item.uuid);return t?this.resultByDuplicatingBasePayloadIntoNewUuidAndTakingServerPayloadAsCanonical(t,e.server_item):[]}getResultForConflictWithServerItemAndUnsavedItem(e){const t=this.baseCollection.find(e.server_item.uuid);return t?this.resultByDuplicatingBasePayloadIntoNewUuidAndTakingServerPayloadAsCanonical(t,e.server_item):[]}resultByDuplicatingBasePayloadIntoNewUuidAndTakingServerPayloadAsCanonical(e,t){const n=(0,a.PayloadsByDuplicating)({payload:e,baseCollection:this.baseCollection,isConflict:!0,source:t.source}),r=t.copyAsSyncResolved({lastSyncBegan:e.lastSyncBegan,dirty:!1,lastSyncEnd:new Date},t.source);return n.concat([r])}resultByDuplicatingBasePayloadAsNonVaultedAndTakingServerPayloadAsCanonical(e,t){const n=(0,a.PayloadsByDuplicating)({payload:e.copy({key_system_identifier:void 0,shared_vault_uuid:void 0}),baseCollection:this.baseCollection,isConflict:!0,source:t.source}),r=t.copyAsSyncResolved({lastSyncBegan:e.lastSyncBegan,dirty:!1,lastSyncEnd:new Date},t.source);return n.concat([r])}resultByDuplicatingBasePayloadAsNonVaultedAndDiscardingChangesOfOriginal(e){return[...(0,a.PayloadsByDuplicating)({payload:e.copy({key_system_identifier:void 0,shared_vault_uuid:void 0}),baseCollection:this.baseCollection,isConflict:!0,source:e.source}),...this.discardChangesOfBasePayload(e)]}resultByDuplicatingBasePayloadAsNonVaultedAndRemovingBaseItemLocally(e){return[...(0,a.PayloadsByDuplicating)({payload:e.copy({key_system_identifier:void 0,shared_vault_uuid:void 0}),baseCollection:this.baseCollection,isConflict:!0,source:e.source}),new i.DeletedPayload(Object.assign(Object.assign(Object.assign({},e),{content:void 0,deleted:!0,key_system_identifier:void 0,shared_vault_uuid:void 0}),(0,o.BuildSyncResolvedParams)({dirty:!1,lastSyncEnd:new Date})),r.PayloadSource.RemoteSaved)]}}},79603:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaRemoteRetrieved=void 0;const r=n(38067),i=n(13566),o=n(59180),s=n(82648),a=n(72990),l=n(38656),c=n(9611);t.DeltaRemoteRetrieved=class{constructor(e,t,n,r){this.baseCollection=e,this.applyCollection=t,this.itemsSavedOrSaving=n,this.historyMap=r}isUuidOfPayloadCurrentlySavingOrSaved(e){return null!=this.itemsSavedOrSaving.find((t=>t.uuid===e))}result(){const e={emits:[],ignored:[],source:o.PayloadEmitSource.RemoteRetrieved},t=[];for(const n of this.applyCollection.all()){if(n.content_type===s.ContentType.TYPES.ItemsKey||n.content_type===s.ContentType.TYPES.KeySystemItemsKey){const t=new l.ItemsKeyDelta(this.baseCollection,[n]).result();(0,c.extendSyncDelta)(e,t);continue}if(this.isUuidOfPayloadCurrentlySavingOrSaved(n.uuid)){t.push(n);continue}const r=this.baseCollection.find(n.uuid);!(null==r?void 0:r.dirty)||(0,i.isErrorDecryptingPayload)(r)?e.emits.push((0,a.payloadByFinalizingSyncState)(n,this.baseCollection)):t.push(n)}for(const n of t){if(!(0,i.isDecryptedPayload)(n))continue;const t=this.baseCollection.find(n.uuid);if(!t)continue;const o=new r.ConflictDelta(this.baseCollection,t,n,this.historyMap);(0,c.extendSyncDelta)(e,o.result())}return e}}},50910:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaRemoteSaved=void 0;const r=n(452),i=n(89223),o=n(13566),s=n(59180),a=n(72990),l=n(84625),c=n(13743);t.DeltaRemoteSaved=class{constructor(e,t){this.baseCollection=e,this.applyContextualPayloads=t}result(){const e=[];for(const t of this.applyContextualPayloads){const n=this.baseCollection.find(t.uuid);if(n)if((0,o.isDeletedPayload)(n)){const o=!t.deleted,s=t.deleted;if(o){const n=new r.DeletedPayload(Object.assign(Object.assign(Object.assign({},t),{deleted:!0,content:void 0,dirtyIndex:(0,c.getIncrementedDirtyIndex)()}),(0,l.BuildSyncResolvedParams)({dirty:!0,lastSyncEnd:new Date})),i.PayloadSource.RemoteSaved);e.push(n)}else if(s){const r=n.copy(Object.assign(Object.assign(Object.assign({},t),{deleted:!0}),(0,l.BuildSyncResolvedParams)({dirty:!1,lastSyncEnd:new Date})),i.PayloadSource.RemoteSaved);e.push(r)}}else{const r=(0,a.payloadByFinalizingSyncState)(n.copy(Object.assign(Object.assign({},t),{deleted:!1}),i.PayloadSource.RemoteSaved),this.baseCollection);e.push(r)}else{const n=new r.DeletedPayload(Object.assign(Object.assign(Object.assign({},t),{deleted:!0,content:void 0}),(0,l.BuildSyncResolvedParams)({dirty:!1,lastSyncEnd:new Date})),i.PayloadSource.RemoteSaved);e.push(n)}}return{emits:e,source:s.PayloadEmitSource.RemoteSaved}}}},16484:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaRemoteUuidConflicts=void 0;const r=n(87901),i=n(51833),o=n(15005),s=n(13566),a=n(59180);t.DeltaRemoteUuidConflicts=class{constructor(e,t){this.baseCollection=e,this.conflicts=t}result(){const e=[],t=this.baseCollection.mutableCopy();for(const n of this.conflicts){const a=e.find((e=>e.uuid===n.unsaved_item.uuid))||n.unsaved_item;if(!(0,s.isDecryptedPayload)(a))continue;const l=(0,o.PayloadsByAlternatingUuid)(a,i.ImmutablePayloadCollection.FromCollection(t));t.set(l),(0,r.filterFromArray)(e,(e=>(0,r.Uuids)(l).includes(e.uuid))),(0,r.extendArray)(e,l)}return{emits:e,source:a.PayloadEmitSource.RemoteRetrieved}}}},72990:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.payloadsByFinalizingSyncState=t.payloadByFinalizingSyncState=void 0;const r=n(13743);function i(e,t){const n=t.find(e.uuid);if(!n)return e.copyAsSyncResolved({dirty:!1,lastSyncEnd:new Date});const i=!(!n.dirtyIndex||!n.globalDirtyIndexAtLastSync)&&n.dirtyIndex>n.globalDirtyIndexAtLastSync;return e.copyAsSyncResolved({dirty:i,dirtyIndex:i?(0,r.getIncrementedDirtyIndex)():void 0,lastSyncEnd:new Date})}t.payloadByFinalizingSyncState=i,t.payloadsByFinalizingSyncState=function(e,t){return e.map((e=>i(e,t)))}},84625:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BuildSyncResolvedParams=void 0,t.BuildSyncResolvedParams=function(e){return e}},22517:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(38067),t),i(n(33076),t),i(n(28504),t),i(n(9579),t),i(n(79603),t),i(n(50910),t),i(n(9910),t),i(n(16484),t),i(n(34319),t),i(n(9611),t)},13743:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getCurrentDirtyIndex=t.getIncrementedDirtyIndex=void 0;let n=0;t.getIncrementedDirtyIndex=function(){return n++,n},t.getCurrentDirtyIndex=function(){return n}},55823:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},91176:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.computeFiltersForDisplayOptions=t.computeUnifiedFilterForDisplayOptions=void 0;const r=n(8698),i=n(50149),o=n(35509),s=n(41138),a=n(82648);function l(e,t){var n;const l=[];let c;if(e.views&&e.views.length>0){const n=new r.CompoundPredicate("and",e.views.map((e=>e.predicate)));c=n,l.push((e=>{if(n.keypathIncludesString("tags")){const r=i.ItemWithTags.Create(e.payload,e,t.elementsReferencingElement(e,a.ContentType.TYPES.Tag));return n.matchesItem(r)}return n.matchesItem(e)}))}if(e.tags&&e.tags.length>0)for(const t of e.tags)l.push((e=>t.isReferencingItem(e)));if(!1!==e.includePinned||(null==c?void 0:c.keypathIncludesString("pinned"))||l.push((e=>!e.pinned)),!1!==e.includeProtected||(null==c?void 0:c.keypathIncludesString("protected"))||l.push((e=>!e.protected)),!1!==e.includeTrashed||(null==c?void 0:c.keypathIncludesString("trashed"))||l.push((e=>!e.trashed)),!1!==e.includeArchived||(null==c?void 0:c.keypathIncludesString("archived"))||l.push((e=>!e.archived)),e.searchQuery){const n=e.searchQuery;l.push((e=>(0,o.itemMatchesQuery)(e,n,t)))}return(null==c?void 0:c.keypathIncludesString("conflict_of"))||(null===(n=e.views)||void 0===n?void 0:n.some((e=>e.uuid===s.SystemViewId.TrashedNotes)))||l.push((e=>!e.conflictOf)),l}t.computeUnifiedFilterForDisplayOptions=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const r=l(e,t).concat(n);return e=>(0,o.itemPassesFilters)(e,r)},t.computeFiltersForDisplayOptions=l},40257:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ItemDisplayController=void 0;const r=n(87901),i=n(50292),o=n(99548),s=n(45408),a=n(79256),l=n(19688),c=n(52197),u=n(59017),d=n(41574);t.ItemDisplayController=class{constructor(e,t,n,r){this.collection=e,this.contentTypes=t,this.options=n,this.vaultOptions=r,this.sortMap={},this.sortedItems=[],this.needsSort=!0,this.filterThenSortElements(this.collection.all(this.contentTypes))}items(){return this.sortedItems}hasExclusiveVaultOptions(){return!!this.vaultOptions&&!(0,d.isExclusionaryOptionsValue)(this.vaultOptions.getOptions())}getDisplayOptions(){return this.options}setVaultDisplayOptions(e){this.vaultOptions=e,this.needsSort=!0,this.filterThenSortElements(this.collection.all(this.contentTypes))}setDisplayOptions(e){this.options=Object.assign(Object.assign({},this.options),e),this.needsSort=!0,this.filterThenSortElements(this.collection.all(this.contentTypes))}onCollectionChange(e){const t=[...e.changed,...e.inserted,...e.discarded].filter((e=>this.contentTypes.includes(e.content_type)));this.filterThenSortElements(t)}passesAllFilters(e){const t=[new s.CollectionCriteriaValidator(this.collection,e)];if(this.vaultOptions){const n=this.vaultOptions.getOptions();(0,d.isExclusionaryOptionsValue)(n)?t.push(new l.ExcludeVaultsCriteriaValidator([...n.exclude,...n.locked],e)):t.push(new c.ExclusiveVaultCriteriaValidator(n.exclusive,e))}return"hiddenContentTypes"in this.options&&this.options.hiddenContentTypes&&t.push(new u.HiddenContentCriteriaValidator(this.options.hiddenContentTypes,e)),"customFilter"in this.options&&this.options.customFilter&&t.push(new a.CustomFilterCriteriaValidator(this.options.customFilter,e)),t.every((e=>e.passes()))}filterThenSortElements(e){for(const t of e){const e=this.sortMap[t.uuid],n=null!=e?this.sortedItems[e]:void 0,o=()=>{null!=e&&(delete this.sortMap[t.uuid],this.sortedItems[e]=void 0,this.needsSort=!0)};if((0,i.isDeletedItem)(t)||(0,i.isEncryptedItem)(t))o();else if(this.passesAllFilters(t))if(null!=n){const i=n[this.options.sortBy],o=t[this.options.sortBy];this.sortedItems[e]=t;const s=n.pinned!==t.pinned;(0,r.compareValues)(i,o)&&!s||(this.needsSort=!0)}else this.sortedItems.push(t),this.needsSort=!0;else o()}this.needsSort&&(this.needsSort=!1,this.resortItems())}resortItems(){const e=this.sortedItems.sort(((e,t)=>(0,o.sortTwoItems)(e,t,this.options.sortBy,this.options.sortDirection))),t=[];let n=0;for(const r of e)r&&(t.push(r),this.sortMap[r.uuid]=n,n++);this.sortedItems=t}}},50149:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ItemWithTags=void 0;const r=n(87901),i=n(50292);class o extends i.DecryptedItem{constructor(e,t,n){super(e),this.item=t,this.tags=n,this.transferInItemPropertiesSoRootLevelPredicateKeyPathsCanBeMatched(t),this.tags=n||e.content.tags}transferInItemPropertiesSoRootLevelPredicateKeyPathsCanBeMatched(e){Object.assign(this,(0,r.omitByCopy)(e,["title","text"]))}static Create(e,t,n){return new o(e,t,n)}get tagsCount(){var e;return(null===(e=this.tags)||void 0===e?void 0:e.length)||0}get title(){return this.item.title}get text(){return this.item.text}}t.ItemWithTags=o},35509:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.itemMatchesQuery=t.itemPassesFilters=t.notesAndFilesMatchingOptions=void 0;const r=n(82648),i=n(91176);var o;function s(e,t){for(const n of t)if(!n(e))return!1;return!0}function a(e,t){var n,r;if(0===t.length)return o.TitleAndText;const i=null===(n=e.title)||void 0===n?void 0:n.toLowerCase(),s=null===(r=e.text)||void 0===r?void 0:r.toLowerCase(),a=t.toLowerCase(),l=a.split(" "),c=function(e){const t=e.match(/"(.*?)"/);return t?t[1]:null}(a);if(c)return((null==i?void 0:i.includes(c))?o.Title:o.None)+((null==s?void 0:s.includes(c))?o.Text:o.None);if(function(e){return!!e.match(/\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b/)}(a))return e.uuid===a?o.Uuid:o.None;const u=i&&l.every((e=>i.indexOf(e)>=0)),d=s&&l.every((e=>s.indexOf(e)>=0));return(u?o.Title:0)+(d?o.Text:0)}!function(e){e[e.None=0]="None",e[e.Title=1]="Title",e[e.Text=2]="Text",e[e.TitleAndText=3]="TitleAndText",e[e.Uuid=5]="Uuid"}(o||(o={})),t.notesAndFilesMatchingOptions=function(e,t,n){const r=(0,i.computeFiltersForDisplayOptions)(e,n);return t.filter((e=>s(e,r)))},t.itemPassesFilters=s,t.itemMatchesQuery=function(e,t,n){const i=n.elementsReferencingElement(e,r.ContentType.TYPES.Tag).some((e=>a(e,t.query)!==o.None));if(e.protected&&!t.includeProtectedNoteText){const n=a(e,t.query);return n===o.Title||n===o.TitleAndText||i}return a(e,t.query)!==o.None||i}},29816:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},74379:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},99548:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sortTwoItems=t.KeepSameOrder=t.SortRightFirst=t.SortLeftFirst=void 0;const r=n(87901),i=n(92207);t.SortLeftFirst=-1,t.SortRightFirst=1,t.KeepSameOrder=0,t.sortTwoItems=function e(n,o,s,a){let l=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(!n)return t.SortLeftFirst;if(!o)return t.SortRightFirst;if(!l){if(n.pinned&&o.pinned)return e(n,o,s,a,!0);if(n.pinned)return t.SortLeftFirst;if(o.pinned)return t.SortRightFirst}const c=n[s]||"",u=o[s]||"",d="asc"===a;let h=t.KeepSameOrder;h=s===i.CollectionSort.Title&&(0,r.isString)(c)&&(0,r.isString)(u)&&c.length>0&&u.length>0?c.localeCompare(u,"en",{numeric:!0}):c>u?t.SortRightFirst:c<u?t.SortLeftFirst:t.KeepSameOrder;const p=h===t.SortLeftFirst,f=h===t.SortRightFirst;return p?d?t.SortLeftFirst:t.SortRightFirst:f?d?t.SortRightFirst:t.SortLeftFirst:t.KeepSameOrder}},93974:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},45408:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CollectionCriteriaValidator=void 0,t.CollectionCriteriaValidator=class{constructor(e,t){this.collection=e,this.element=t}passes(){return this.collection.has(this.element.uuid)}}},79256:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CustomFilterCriteriaValidator=void 0,t.CustomFilterCriteriaValidator=class{constructor(e,t){this.customFilter=e,this.element=t}passes(){return this.customFilter(this.element)}}},19688:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExcludeVaultsCriteriaValidator=void 0,t.ExcludeVaultsCriteriaValidator=class{constructor(e,t){this.excludeVaults=e,this.element=t}passes(){return!this.excludeVaults.some((e=>this.element.key_system_identifier===e))}}},52197:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExclusiveVaultCriteriaValidator=void 0,t.ExclusiveVaultCriteriaValidator=class{constructor(e,t){this.exclusiveVault=e,this.element=t}passes(){return this.element.key_system_identifier===this.exclusiveVault}}},59017:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.HiddenContentCriteriaValidator=void 0,t.HiddenContentCriteriaValidator=class{constructor(e,t){this.hiddenContentTypes=e,this.element=t}passes(){return!this.hiddenContentTypes.includes(this.element.content_type)}}},67104:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VaultDisplayOptions=void 0;const r=n(87901),i=n(41574);function o(e){return e.map((e=>e.systemIdentifier))}class s{constructor(e){this.options=e}getOptions(){return this.options}getExclusivelyShownVault(){if((0,i.isExclusionaryOptionsValue)(this.options))throw new Error("Not in exclusive display mode");return this.options.exclusive}isInExclusiveDisplayMode(){return!(0,i.isExclusionaryOptionsValue)(this.options)}isVaultExplicitlyExcluded(e){if((0,i.isExclusionaryOptionsValue)(this.options))return this.options.exclude.some((t=>t===e.systemIdentifier));if(this.options.exclusive)return this.options.exclusive!==e.systemIdentifier;throw new Error("Invalid vault display options")}isVaultExclusivelyShown(e){return!(0,i.isExclusionaryOptionsValue)(this.options)&&this.options.exclusive===e.systemIdentifier}isVaultDisabledOrLocked(e){return!(!(0,i.isExclusionaryOptionsValue)(this.options)||!this.options.locked.find((t=>t===e.systemIdentifier)))||this.isVaultExplicitlyExcluded(e)}getPersistableValue(){return this.options}newOptionsByIntakingLockedVaults(e){return(0,i.isExclusionaryOptionsValue)(this.options)?new s({exclude:this.options.exclude,locked:o(e)}):new s({exclusive:this.options.exclusive})}newOptionsByExcludingVault(e,t){return this.newOptionsByExcludingVaults([e],t)}newOptionsByExcludingVaults(e,t){return(0,i.isExclusionaryOptionsValue)(this.options)?new s({exclude:(0,r.uniqueArray)([...this.options.exclude,...o(e)]),locked:o(t)}):new s({exclude:o(e),locked:o(t)})}newOptionsByUnexcludingVault(e,t){return(0,i.isExclusionaryOptionsValue)(this.options)?new s({exclude:this.options.exclude.filter((t=>t!==e.systemIdentifier)),locked:o(t)}):new s({exclude:[],locked:o(t)})}static FromPersistableValue(e){return new s(e)}}t.VaultDisplayOptions=s},41574:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isExclusionaryOptionsValue=void 0,t.isExclusionaryOptionsValue=function(e){return"exclude"in e||"locked"in e}},30561:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(55823),t),i(n(91176),t),i(n(40257),t),i(n(50149),t),i(n(29816),t),i(n(35509),t),i(n(74379),t),i(n(93974),t),i(n(67104),t),i(n(41574),t)},87332:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContentTypeUsesKeySystemRootKeyEncryption=void 0;const r=n(82648);t.ContentTypeUsesKeySystemRootKeyEncryption=function(e){return e===r.ContentType.TYPES.KeySystemItemsKey}},21662:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContentTypeUsesRootKeyEncryption=void 0;const r=n(96084);t.ContentTypeUsesRootKeyEncryption=function(e){return(0,r.ContentTypesUsingRootKeyEncryption)().includes(e)}},96084:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContentTypesUsingRootKeyEncryption=void 0;const r=n(82648);t.ContentTypesUsingRootKeyEncryption=function(){return[r.ContentType.TYPES.RootKey,r.ContentType.TYPES.ItemsKey,r.ContentType.TYPES.EncryptedStorage,r.ContentType.TYPES.TrustedContact,r.ContentType.TYPES.KeySystemRootKey]}},47469:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},74958:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isNativeFeature=t.isItemBasedFeature=t.isUIFeatureAnIframeFeature=void 0;const r=n(80215);t.isUIFeatureAnIframeFeature=function(e){return(0,r.isIframeComponentFeatureDescription)(e.featureDescription)},t.isItemBasedFeature=function(e){return"uuid"in e},t.isNativeFeature=function(e){return!("uuid"in e)}},36053:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UIFeature=void 0;const r=n(80215),i=n(74958),o=n(82648),s=n(52659);t.UIFeature=class{constructor(e){this.item=e}get isComponent(){return(0,i.isItemBasedFeature)(this.item)}get isThemeComponent(){return(0,i.isItemBasedFeature)(this.item)&&(0,s.isTheme)(this.item)}get asComponent(){if((0,i.isItemBasedFeature)(this.item))return this.item;throw new Error("Cannot cast item to component")}get asTheme(){if((0,i.isItemBasedFeature)(this.item))return this.item;throw new Error("Cannot cast item to component")}get asFeatureDescription(){if((0,i.isNativeFeature)(this.item))return this.item;throw new Error("Cannot cast item to feature description")}get isNativeFeature(){return void 0!==(0,r.FindNativeFeature)(this.featureIdentifier)}get uniqueIdentifier(){return(0,i.isNativeFeature)(this.item)?r.NativeFeatureIdentifier.create(this.item.identifier).getValue():o.Uuid.create(this.item.uuid).getValue()}get featureIdentifier(){return this.item.identifier}get noteType(){var e;if((0,i.isNativeFeature)(this.item)&&(0,r.isEditorFeatureDescription)(this.item))return null!==(e=this.item.note_type)&&void 0!==e?e:r.NoteType.Unknown;if((0,i.isItemBasedFeature)(this.item))return this.item.noteType;throw new Error("Invalid component or feature description")}get fileType(){var e,t;if((0,i.isNativeFeature)(this.item)&&(0,r.isEditorFeatureDescription)(this.item))return this.item.file_type;if((0,i.isItemBasedFeature)(this.item)&&(0,r.isEditorFeatureDescription)(this.item.package_info))return null!==(t=null===(e=this.item.package_info)||void 0===e?void 0:e.file_type)&&void 0!==t?t:"txt";throw new Error("Invalid component or feature description")}get displayName(){var e;return(0,i.isNativeFeature)(this.item)?null!==(e=this.item.name)&&void 0!==e?e:"":this.item.displayName}get description(){var e,t;return(0,i.isNativeFeature)(this.item)?null!==(e=this.item.description)&&void 0!==e?e:"":null!==(t=this.item.package_info.description)&&void 0!==t?t:""}get deprecationMessage(){return(0,i.isNativeFeature)(this.item)?this.item.deprecation_message:this.item.deprecationMessage}get expirationDate(){return(0,i.isNativeFeature)(this.item)?this.item.expires_at?new Date(this.item.expires_at):void 0:this.item.valid_until}get featureDescription(){return(0,i.isNativeFeature)(this.item)?this.item:this.item.package_info}get acquiredPermissions(){var e;if((0,i.isNativeFeature)(this.item)&&(0,r.isIframeComponentFeatureDescription)(this.item))return null!==(e=this.item.component_permissions)&&void 0!==e?e:[];if((0,i.isItemBasedFeature)(this.item))return this.item.permissions;throw new Error("Invalid component or feature description")}get area(){return"area"in this.item?this.item.area:r.ComponentArea.Editor}get layerable(){var e;return(0,i.isItemBasedFeature)(this.item)&&(0,s.isTheme)(this.item)?this.item.layerableTheme:!!(0,r.isThemeFeatureDescription)(this.asFeatureDescription)&&null!==(e=this.asFeatureDescription.layerable)&&void 0!==e&&e}get dockIcon(){return(0,i.isItemBasedFeature)(this.item)&&(0,s.isTheme)(this.item)?this.asTheme.package_info.dock_icon:(0,r.isThemeFeatureDescription)(this.asFeatureDescription)?this.asFeatureDescription.dock_icon:void 0}}},18284:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},24715:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateHistoryEntryForPayload=void 0;const r=n(82648),i=n(69375),o=n(94068);t.CreateHistoryEntryForPayload=function(e,t){return new(e.content_type===r.ContentType.TYPES.Note?o.NoteHistoryEntry:i.HistoryEntry)(e,t)}},69375:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.HistoryEntry=void 0;const r=n(87901),i=n(73277);t.HistoryEntry=class{constructor(e,t){var n;this.defaultContentKeyToDiffOn="text",this.payload=e.copy(),this.previousEntry=t,this.hasPreviousEntry=!(0,r.isNullOrUndefined)(t);const i=this.payload.content[this.defaultContentKeyToDiffOn];if(i)if(t){const e=(null===(n=t.payload.content[this.defaultContentKeyToDiffOn])||void 0===n?void 0:n.length)||0;this.textCharDiffLength=i.length-e}else this.textCharDiffLength=i.length;else this.textCharDiffLength=0}itemFromPayload(){return(0,i.CreateDecryptedItemFromPayload)(this.payload)}isSameAsEntry(e){if(!e)return!1;const t=this.itemFromPayload(),n=e.itemFromPayload();return!(t.userModifiedDate.getTime()!==n.userModifiedDate.getTime())&&t.isItemContentEqualWith(n)}isDiscardable(){return!1}operationVector(){return void 0!==this.textCharDiffLength?this.hasPreviousEntry&&0!==this.textCharDiffLength?this.textCharDiffLength<0?-1:1:0:1}deltaSize(){return void 0!==this.textCharDiffLength?Math.abs(this.textCharDiffLength):1}}},30545:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},97873:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.historyMapFunctions=void 0,t.historyMapFunctions={getNewestRevision:e=>e[0]}},94068:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoteHistoryEntry=void 0;const r=n(87901),i=n(69375);class o extends i.HistoryEntry{previewTitle(){return this.payload.updated_at.getTime()>0?this.payload.updated_at.toLocaleString():this.payload.created_at.toLocaleString()}previewSubTitle(){return this.hasPreviousEntry?this.textCharDiffLength<0?"".concat(-1*this.textCharDiffLength," characters removed"):this.textCharDiffLength>0?"".concat(this.textCharDiffLength," characters added"):"Title or metadata changed":"".concat(this.textCharDiffLength," characters loaded")}isDiscardable(){return(0,r.isEmpty)(this.payload.content.text)}}t.NoteHistoryEntry=o},78274:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(24715),t),i(n(69375),t),i(n(97873),t),i(n(94068),t),i(n(30545),t)},47479:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateItemDelta=void 0,t.CreateItemDelta=function(e){return{changed:e.changed||[],inserted:e.inserted||[],discarded:e.discarded||[],ignored:e.ignored||[],unerrored:e.unerrored||[]}}},21626:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},8698:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CompoundPredicate=void 0,t.CompoundPredicate=class{constructor(e,t){this.operator=e,this.predicates=t}matchesItem(e){if("and"===this.operator){for(const t of this.predicates)if(!t.matchesItem(e))return!1;return!0}if("or"===this.operator){for(const t of this.predicates)if(t.matchesItem(e))return!0;return!1}return!1}keypathIncludesString(e){for(const t of this.predicates)if(t.keypathIncludesString(e))return!0;return!1}toJson(){return{operator:this.operator,value:this.predicates.map((e=>e.toJson()))}}}},26550:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.predicateFromDSLString=t.predicateFromJson=t.includesPredicateFromArguments=t.notPredicateFromArguments=t.compoundPredicateFromArguments=t.predicateFromArguments=void 0;const r=n(8698),i=n(80389),o=n(21271),s=n(73067),a=n(78688);function l(e,t,n){if(o.AllPredicateCompoundOperators.includes(t))return c(t,n);if("not"===t)return new s.NotPredicate(u(n));if("includes"===t&&e)return function(e){return!!o.SureValueNonObjectTypesAsStrings.includes(typeof e)||!!Array.isArray(e)&&!d(e)}(n)?new a.Predicate(e,t,n):new i.IncludesPredicate(e,u(n));if(e)return new a.Predicate(e,t,n);throw Error("Invalid predicate arguments")}function c(e,t){const n=t.map((e=>u(e)));return new r.CompoundPredicate(e,n)}function u(e){if(Array.isArray(e))throw Error("Invalid predicateFromJson value");return l(e.keypath,e.operator,d(e.value)?h(e.value):e.value)}function d(e){return Array.isArray(e)&&o.AllPredicateOperators.includes(e[1])}function h(e){const t=e[2];let n;if(Array.isArray(t)){const e=t;n=Array.isArray(e[0])?e.map((e=>h(e))):d(t[1])?h(e):t}else n=t;return{keypath:e[0],operator:e[1],value:n}}t.predicateFromArguments=l,t.compoundPredicateFromArguments=c,t.notPredicateFromArguments=function(e){const t=u(e);return new s.NotPredicate(t)},t.includesPredicateFromArguments=function(e,t){const n=u(t);return new i.IncludesPredicate(e,n)},t.predicateFromJson=u,t.predicateFromDSLString=function(e){try{const t=JSON.parse(e.substring(1,e.length));return t.shift(),u(h(t))}catch(e){throw Error("Invalid smart view syntax ".concat(JSON.stringify(e)))}}},80389:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IncludesPredicate=void 0,t.IncludesPredicate=class{constructor(e,t){this.keypath=e,this.predicate=t}matchesItem(e){const t=this.keypath.split(".").reduce(((e,t)=>e&&e[t]),e);return!!Array.isArray(t)&&t.some((e=>this.predicate.matchesItem(e)))}keypathIncludesString(e){return this.keypath.includes(e)}toJson(){return{keypath:this.keypath,operator:"includes",value:this.predicate.toJson()}}}},21271:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SureValueNonObjectTypesAsStrings=t.AllPredicateOperators=t.AllNonCompoundPredicateOperators=t.AllPredicateCompoundOperators=void 0,t.AllPredicateCompoundOperators=["and","or"],t.AllNonCompoundPredicateOperators=["!=","=","<",">","<=",">=","startsWith","in","matches","not","includes"],t.AllPredicateOperators=[...t.AllPredicateCompoundOperators,...t.AllNonCompoundPredicateOperators],t.SureValueNonObjectTypesAsStrings=["number","string","boolean"]},73067:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NotPredicate=void 0,t.NotPredicate=class{constructor(e){this.predicate=e}matchesItem(e){return!this.predicate.matchesItem(e)}keypathIncludesString(e){return this.predicate.keypathIncludesString(e)}toJson(){return{operator:"not",value:this.predicate.toJson()}}}},21014:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.valueMatchesTargetValue=void 0;const r=n(87901),i=n(58506);t.valueMatchesTargetValue=function e(t,n,o){if(null==o)return!1;if("string"==typeof o&&o.includes(".ago")&&(o=(0,i.dateFromDSLDateString)(o)),"string"==typeof o&&(o=o.toLowerCase()),"string"==typeof t&&(t=t.toLowerCase()),t instanceof Date&&"string"==typeof o&&(o=new Date(o)),"not"===n)return!e(t,"=",o);if(null==t){const e=[!1,"",null,void 0,NaN].includes(o);return"!="===n?!e:e}if("="===n)return Array.isArray(t)?JSON.stringify(t)===JSON.stringify(o):t===o;if("!="===n)return Array.isArray(t)?JSON.stringify(t)!==JSON.stringify(o):t!==o;if("<"===n)return t<o;if(">"===n)return t>o;if("<="===n)return t<=o;if(">="===n)return t>=o;if("startsWith"===n)return t.startsWith(o);if("in"===n&&Array.isArray(o))return o.includes(t);if("includes"===n){if((0,r.isString)(t))return t.includes(o);if((0,r.isString)(o)&&((0,r.isString)(t)||Array.isArray(t)))return t.includes(o)}return"matches"===n&&new RegExp(o).test(t)}},78688:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Predicate=void 0;const r=n(21014);t.Predicate=class{constructor(e,t,n){this.keypath=e,this.operator=t,this.targetValue=n,"true"!==this.targetValue&&"false"!==this.targetValue||(this.targetValue=JSON.parse(this.targetValue))}keypathIncludesString(e){return this.keypath.includes(e)}matchesItem(e){const t=this.keypath.split(".").reduce(((e,t)=>e&&e[t]),e);return(0,r.valueMatchesTargetValue)(t,this.operator,this.targetValue)}toJson(){return{keypath:this.keypath,operator:this.operator,value:this.targetValue}}}},58506:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.dateFromDSLDateString=void 0,t.dateFromDSLDateString=function(e){const t=e.split("."),n=t[1],r=new Date,i=parseInt(t[0]);return"days"===n?r.setDate(r.getDate()-i):"hours"===n?r.setHours(r.getHours()-i):"months"===n?r.setMonth(r.getMonth()-i):"years"===n&&r.setFullYear(r.getFullYear()-i),r}},59020:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SNActionsExtension=void 0;const r=n(43740),i=n(43610);class o extends r.DecryptedItem{constructor(e){super(e),this.actions=[],this.name=e.content.name||"",this.description=e.content.description||"",this.url=e.content.hosted_url||e.content.url,this.supported_types=e.content.supported_types,this.package_info=this.payload.content.package_info||{},this.deprecation=e.content.deprecation,this.actions=e.content.actions}get displayName(){return this.name}get thirdPartyPackageInfo(){return this.package_info}get isListedExtension(){return"org.standardnotes.listed"===this.package_info.identifier}actionsWithContextForItem(e){return this.actions.filter((t=>t.context===e.content_type||"Item"===t.context))}strategyWhenConflictingWithItem(e,t){return i.ConflictStrategy.KeepBase}}t.SNActionsExtension=o},27539:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ActionsExtensionMutator=void 0;const r=n(14584);class i extends r.DecryptedItemMutator{set description(e){this.mutableContent.description=e}set supported_types(e){this.mutableContent.supported_types=e}set actions(e){this.mutableContent.actions=e}set deprecation(e){this.mutableContent.deprecation=e}}t.ActionsExtensionMutator=i},82531:(e,t)=>{var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.ActionVerb=t.ActionAccessType=void 0,function(e){e.Encrypted="encrypted",e.Decrypted="decrypted"}(n||(t.ActionAccessType=n={})),function(e){e.Get="get",e.Render="render",e.Show="show",e.Post="post",e.Nested="nested"}(r||(t.ActionVerb=r={}))},40826:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(59020),t),i(n(27539),t),i(n(82531),t)},35922:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentItem=void 0;const r=n(87901),i=n(80215),o=n(68716),s=n(43610),a=n(43740),l=n(78688),c=n(82648);class u extends a.DecryptedItem{constructor(e){var t,n,o;super(e),this.permissions=[],e.content.hosted_url&&(0,r.isValidUrl)(e.content.hosted_url)?this.hosted_url=e.content.hosted_url:e.content.url&&(0,r.isValidUrl)(e.content.url)?this.hosted_url=e.content.url:e.content.legacy_url&&(0,r.isValidUrl)(e.content.legacy_url)&&(this.hosted_url=e.content.legacy_url),this.local_url=e.content.local_url,this.valid_until=new Date(e.content.valid_until||0),this.offlineOnly=null!==(t=e.content.offlineOnly)&&void 0!==t&&t,this.name=e.content.name,this.content_type===c.ContentType.TYPES.Theme?this.area=i.ComponentArea.Themes:this.area=e.content.area,this.package_info=e.content.package_info||{},this.permissions=e.content.permissions||[],this.autoupdateDisabled=null!==(n=e.content.autoupdateDisabled)&&void 0!==n&&n,this.disassociatedItemIds=e.content.disassociatedItemIds||[],this.associatedItemIds=e.content.associatedItemIds||[],this.legacy_url=e.content.hosted_url?void 0:e.content.url,this.legacyComponentData=this.payload.content.componentData||{},this.legacyActive=null!==(o=e.content.active)&&void 0!==o&&o}strategyWhenConflictingWithItem(e,t){return s.ConflictStrategy.KeepBase}get isSingleton(){return!0}get displayName(){var e;return(null===(e=(0,i.FindNativeFeature)(this.identifier))||void 0===e?void 0:e.name)||this.name}singletonPredicate(){return new l.Predicate("identifier","=",this.identifier)}isTheme(){return this.content_type===c.ContentType.TYPES.Theme||this.area===i.ComponentArea.Themes}legacyIsDefaultEditor(){return!0===this.getAppDomainValue(o.AppDataField.DefaultEditor)}hasValidHostedUrl(){return null!=(this.hosted_url||this.legacy_url)}contentKeysToIgnoreWhenCheckingEquality(){return["active","disassociatedItemIds","associatedItemIds",...super.contentKeysToIgnoreWhenCheckingEquality()]}isExplicitlyEnabledForItem(e){return-1!==this.associatedItemIds.indexOf(e)}isExplicitlyDisabledForItem(e){return-1!==this.disassociatedItemIds.indexOf(e)}get isExpired(){return this.valid_until.getTime()>0&&this.valid_until<=new Date}get identifier(){return this.package_info.identifier}get thirdPartyPackageInfo(){return this.package_info}get noteType(){var e;return(0,i.isEditorFeatureDescription)(this.package_info)&&null!==(e=this.package_info.note_type)&&void 0!==e?e:i.NoteType.Unknown}get isDeprecated(){var e;let t=null!==(e=this.package_info.flags)&&void 0!==e?e:[];return t=t.map((e=>e.toLowerCase())),t.includes(i.ComponentFlag.Deprecated)}get deprecationMessage(){return this.package_info.deprecation_message}get layerableTheme(){var e;if(!this.isTheme())return!1;const t=this.package_info;return null!==(e=null==t?void 0:t.layerable)&&void 0!==e&&e}}t.ComponentItem=u},12740:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},80755:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},43246:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentMutator=void 0;const r=n(87901),i=n(14584);class o extends i.DecryptedItemMutator{set package_info(e){this.mutableContent.package_info=e}set local_url(e){this.mutableContent.local_url=e}set hosted_url(e){this.mutableContent.hosted_url=e}set valid_until(e){this.mutableContent.valid_until=e}set permissions(e){this.mutableContent.permissions=e}set name(e){this.mutableContent.name=e}set offlineOnly(e){this.mutableContent.offlineOnly=e}associateWithItem(e){const t=this.mutableContent.associatedItemIds||[];(0,r.addIfUnique)(t,e),this.mutableContent.associatedItemIds=t}disassociateWithItem(e){const t=this.mutableContent.disassociatedItemIds||[];(0,r.addIfUnique)(t,e),this.mutableContent.disassociatedItemIds=t}removeAssociatedItemId(e){(0,r.removeFromArray)(this.mutableContent.associatedItemIds||[],e)}removeDisassociatedItemId(e){(0,r.removeFromArray)(this.mutableContent.disassociatedItemIds||[],e)}}t.ComponentMutator=o},78446:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},54218:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isComponentOrTheme=t.isTheme=t.isComponent=void 0;const r=n(50292),i=n(82648);t.isComponent=function(e){return!!(0,r.isDecryptedItem)(e)&&e.content_type===i.ContentType.TYPES.Component},t.isTheme=function(e){return!!(0,r.isDecryptedItem)(e)&&e.content_type===i.ContentType.TYPES.Theme},t.isComponentOrTheme=function(e){return!!(0,r.isDecryptedItem)(e)&&(e.content_type===i.ContentType.TYPES.Component||e.content_type===i.ContentType.TYPES.Theme)}},52659:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(35922),t),i(n(43246),t),i(n(12740),t),i(n(80755),t),i(n(78446),t),i(n(54218),t)},55159:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SNEditor=void 0;const r=n(43740);class i extends r.DecryptedItem{constructor(e){super(e),this.notes=[],this.data={},this.url=e.content.url,this.name=e.content.name,this.data=e.content.data||{},this.isDefault=e.content.default,this.systemEditor=e.content.systemEditor}}t.SNEditor=i},10123:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(55159),t)},73886:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SNFeatureRepo=void 0;const r=n(87901),i=n(43740);class o extends i.DecryptedItem{get migratedToUserSetting(){return(0,r.useBoolean)(this.payload.content.migratedToUserSetting,!1)}get migratedToOfflineEntitlements(){return(0,r.useBoolean)(this.payload.content.migratedToOfflineEntitlements,!1)}get onlineUrl(){return this.payload.content.url}get offlineFeaturesUrl(){return this.payload.content.offlineFeaturesUrl}get offlineKey(){return this.payload.content.offlineKey}}t.SNFeatureRepo=o},75299:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FeatureRepoMutator=void 0;const r=n(14584);class i extends r.DecryptedItemMutator{set migratedToUserSetting(e){this.mutableContent.migratedToUserSetting=e}set migratedToOfflineEntitlements(e){this.mutableContent.migratedToOfflineEntitlements=e}set offlineFeaturesUrl(e){this.mutableContent.offlineFeaturesUrl=e}set offlineKey(e){this.mutableContent.offlineKey=e}}t.FeatureRepoMutator=i},12310:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(73886),t),i(n(75299),t)},86154:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FileItem=t.isFile=void 0;const r=n(82648),i=n(43740),o=n(50292);t.isFile=e=>e.content_type===r.ContentType.TYPES.File;class s extends i.DecryptedItem{constructor(e){super(e),this.remoteIdentifier=this.content.remoteIdentifier,this.name=this.content.name,this.key=this.content.key,this.content.size&&this.content.chunkSizes?(this.decryptedSize=this.content.size,this.encryptedChunkSizes=this.content.chunkSizes):(this.decryptedSize=this.content.decryptedSize,this.encryptedChunkSizes=this.content.encryptedChunkSizes),this.encryptionHeader=this.content.encryptionHeader,this.mimeType=this.content.mimeType}strategyWhenConflictingWithItem(e){return e.key!==this.key||e.encryptionHeader!==this.encryptionHeader||e.remoteIdentifier!==this.remoteIdentifier||JSON.stringify(e.encryptedChunkSizes)!==JSON.stringify(this.encryptedChunkSizes)?o.ConflictStrategy.KeepBaseDuplicateApply:o.ConflictStrategy.KeepBase}get encryptedSize(){return this.encryptedChunkSizes.reduce(((e,t)=>e+t),0)}get title(){return this.name}}t.FileItem=s},78037:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},82422:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FileMutator=void 0;const r=n(82648),i=n(78961),o=n(14584);class s extends o.DecryptedItemMutator{set name(e){this.mutableContent.name=e}set encryptionHeader(e){this.mutableContent.encryptionHeader=e}addNote(e){const t={reference_type:i.ContentReferenceType.FileToNote,content_type:r.ContentType.TYPES.Note,uuid:e.uuid},n=this.mutableContent.references||[];n.push(t),this.mutableContent.references=n}removeNote(e){const t=this.immutableItem.references.filter((t=>t.uuid!==e.uuid));this.mutableContent.references=t}addFile(e){if(this.immutableItem.isReferencingItem(e))return;const t={uuid:e.uuid,content_type:r.ContentType.TYPES.File,reference_type:i.ContentReferenceType.FileToFile};this.mutableContent.references.push(t)}removeFile(e){this.mutableContent.references=this.mutableContent.references.filter((t=>t.uuid!==e.uuid))}}t.FileMutator=s},33447:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.FileProtocolV1Constants=void 0,function(e){e[e.KeySize=256]="KeySize"}(n||(t.FileProtocolV1Constants=n={}))},25698:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(86154),t),i(n(82422),t),i(n(78037),t),i(n(33447),t)},87500:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},2836:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},52493:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},82412:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},23811:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},19725:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},82818:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.KeySystemRootKey=t.isKeySystemRootKey=void 0;const r=n(50292),i=n(82648);t.isKeySystemRootKey=function(e){return e.content_type===i.ContentType.TYPES.KeySystemRootKey};class o extends r.DecryptedItem{constructor(e){super(e),this.keyParams=e.content.keyParams,this.systemIdentifier=e.content.systemIdentifier,this.key=e.content.key,this.keyVersion=e.content.keyVersion,this.token=e.content.token}strategyWhenConflictingWithItem(e,t){const n=this.keyParams.creationTimestamp;return e.keyParams.creationTimestamp>n?r.ConflictStrategy.KeepApply:r.ConflictStrategy.KeepBase}get itemsKey(){return this.key}get key_system_identifier(){}get shared_vault_uuid(){}isEqual(e){return this.itemsKey===e.itemsKey&&this.token===e.token}}t.KeySystemRootKey=o},95132:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},31750:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},64836:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.KeySystemRootKeyMutator=void 0;const r=n(50292);class i extends r.DecryptedItemMutator{}t.KeySystemRootKeyMutator=i},28819:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.KeySystemRootKeyStorageMode=void 0,function(e){e.Synced="synced",e.Local="local",e.Ephemeral="ephemeral"}(n||(t.KeySystemRootKeyStorageMode=n={}))},2636:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SNNote=t.isNote=void 0;const r=n(68716),i=n(80215),o=n(43740),s=n(82648);t.isNote=e=>e.content_type===s.ContentType.TYPES.Note;class a extends o.DecryptedItem{constructor(e){super(e),this.hidePreview=!1,this.title=String(this.payload.content.title||""),this.text=String(this.payload.content.text||""),this.hidePreview=Boolean(this.payload.content.hidePreview),this.preview_plain=String(this.payload.content.preview_plain||""),this.preview_html=String(this.payload.content.preview_html||""),this.spellcheck=this.payload.content.spellcheck,this.editorWidth=this.payload.content.editorWidth,this.noteType=this.payload.content.noteType,this.editorIdentifier=this.payload.content.editorIdentifier,this.authorizedForListed=this.payload.content.authorizedForListed||!1,this.noteType||this.getAppDomainValueWithDefault(r.AppDataField.LegacyPrefersPlainEditor,!1)&&(this.noteType=i.NoteType.Plain)}}t.SNNote=a},38856:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},39273:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoteMutator=void 0;const r=n(14584),i=n(50292),o=n(82648);class s extends r.DecryptedItemMutator{set title(e){this.mutableContent.title=e}set text(e){this.mutableContent.text=e}set hidePreview(e){this.mutableContent.hidePreview=e}set preview_plain(e){this.mutableContent.preview_plain=e}set preview_html(e){this.mutableContent.preview_html=e}set spellcheck(e){this.mutableContent.spellcheck=e}set editorWidth(e){this.mutableContent.editorWidth=e}set noteType(e){this.mutableContent.noteType=e}set editorIdentifier(e){this.mutableContent.editorIdentifier=e}set authorizedForListed(e){this.mutableContent.authorizedForListed=e}toggleSpellcheck(){null==this.mutableContent.spellcheck?this.mutableContent.spellcheck=!1:this.mutableContent.spellcheck=!this.mutableContent.spellcheck}addNote(e){if(this.immutableItem.isReferencingItem(e))return;const t={uuid:e.uuid,content_type:o.ContentType.TYPES.Note,reference_type:i.ContentReferenceType.NoteToNote};this.mutableContent.references.push(t)}removeNote(e){this.mutableContent.references=this.mutableContent.references.filter((t=>t.uuid!==e.uuid))}}t.NoteMutator=s},42006:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(2636),t),i(n(39273),t),i(n(38856),t)},12775:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SmartView=t.isSmartView=t.isSystemView=t.SMART_TAG_DSL_PREFIX=void 0;const r=n(82648),i=n(43740),o=n(26550),s=n(78748),a=n(47899);function l(e){return Object.values(s.SystemViewId).includes(e.uuid)}t.SMART_TAG_DSL_PREFIX="![",t.isSystemView=l,t.isSmartView=e=>e.content_type===r.ContentType.TYPES.SmartView;class c extends i.DecryptedItem{constructor(e){super(e),this.title=String(this.content.title||""),l(this)?this.iconString=(0,a.systemViewIcon)(this.uuid):this.iconString=this.payload.content.iconString||a.SmartViewDefaultIconName,this.preferences=this.payload.content.preferences;try{this.predicate=this.content.predicate&&(0,o.predicateFromJson)(this.content.predicate)}catch(e){console.error(e)}}}t.SmartView=c},11070:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BuildSmartViews=void 0;const r=n(89262),i=n(12775),o=n(78748),s=n(42405),a=n(78688),l=n(8698),c=n(59180),u=n(82648);function d(e){const t=[new a.Predicate("content_type","=",u.ContentType.TYPES.Note)];return!1===e.includeTrashed&&t.push(new a.Predicate("trashed","=",!1)),!1===e.includeArchived&&t.push(new a.Predicate("archived","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}function h(e){const t=[new a.Predicate("content_type","=",u.ContentType.TYPES.File)];return!1===e.includeTrashed&&t.push(new a.Predicate("trashed","=",!1)),!1===e.includeArchived&&t.push(new a.Predicate("archived","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}function p(e){const t=[new a.Predicate("archived","=",!0),new a.Predicate("content_type","=",u.ContentType.TYPES.Note)];return!1===e.includeTrashed&&t.push(new a.Predicate("trashed","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}function f(e){const t=[new a.Predicate("trashed","=",!0),new a.Predicate("content_type","=",u.ContentType.TYPES.Note)];return!1===e.includeArchived&&t.push(new a.Predicate("archived","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}function g(e){const t=[new a.Predicate("content_type","=",u.ContentType.TYPES.Note),new a.Predicate("tagsCount","=",0)];return!1===e.includeArchived&&t.push(new a.Predicate("archived","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}function m(e){const t=[new a.Predicate("starred","=",!0),new a.Predicate("content_type","=",u.ContentType.TYPES.Note)];return!1===e.includeTrashed&&t.push(new a.Predicate("trashed","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}function y(e){const t=[new a.Predicate("content_type","=",u.ContentType.TYPES.Note)];return!1===e.includeTrashed&&t.push(new a.Predicate("trashed","=",!1)),!1===e.includeArchived&&t.push(new a.Predicate("archived","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}t.BuildSmartViews=function(e){const t=new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.AllNotes,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Notes",predicate:d(e).toJson()})}))),n=new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.Files,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Files",predicate:h(e).toJson()})}))),a=new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.ArchivedNotes,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Archived",predicate:p(e).toJson()})}))),l=new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.TrashedNotes,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Trash",predicate:f(e).toJson()})}))),v=new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.UntaggedNotes,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Untagged",predicate:g(e).toJson()})})));return[t,n,new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.StarredNotes,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Starred",predicate:m(e).toJson()})}))),a,l,v,new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.Conflicts,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Conflicts",predicate:y(e).toJson()})})))]}},50986:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},47899:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SmartViewDefaultIconName=t.systemViewIcon=t.SmartViewIcons=void 0;const r=n(78748);t.SmartViewIcons={[r.SystemViewId.AllNotes]:"notes",[r.SystemViewId.Files]:"folder",[r.SystemViewId.ArchivedNotes]:"archive",[r.SystemViewId.TrashedNotes]:"trash",[r.SystemViewId.UntaggedNotes]:"hashtag-off",[r.SystemViewId.StarredNotes]:"star-filled",[r.SystemViewId.Conflicts]:"merge"},t.systemViewIcon=function(e){return t.SmartViewIcons[e]},t.SmartViewDefaultIconName="restore"},54196:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SmartViewMutator=void 0;const r=n(87458);class i extends r.TagMutator{constructor(e,t){super(e,t)}set predicate(e){this.mutableContent.predicate=e}}t.SmartViewMutator=i},78748:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SystemViewId=void 0,function(e){e.AllNotes="all-notes",e.Files="files",e.ArchivedNotes="archived-notes",e.TrashedNotes="trashed-notes",e.UntaggedNotes="untagged-notes",e.StarredNotes="starred-notes",e.Conflicts="conflicts"}(n||(t.SystemViewId=n={}))},41138:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(12775),t),i(n(11070),t),i(n(78748),t),i(n(50986),t),i(n(54196),t),i(n(47899),t)},4862:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SNTag=t.isTag=t.DefaultTagIconName=t.TagFolderDelimitter=void 0;const r=n(43740),i=n(4744),o=n(82648);t.TagFolderDelimitter=".",t.DefaultTagIconName="hashtag",t.isTag=e=>e.content_type===o.ContentType.TYPES.Tag;class s extends r.DecryptedItem{constructor(e){super(e),this.title=this.payload.content.title||"",this.expanded=null==this.payload.content.expanded||this.payload.content.expanded,this.iconString=this.payload.content.iconString||t.DefaultTagIconName,this.preferences=this.payload.content.preferences}get isDailyEntry(){var e;return"daily"===(null===(e=this.preferences)||void 0===e?void 0:e.entryMode)}get noteReferences(){return this.payload.references.filter((e=>e.content_type===o.ContentType.TYPES.Note))}get noteCount(){return this.noteReferences.length}get parentId(){const e=this.references.find(i.isTagToParentTagReference);return null==e?void 0:e.uuid}static arrayToDisplayString(e){return e.sort(((e,t)=>e.title>t.title?1:-1)).map((e=>"#"+e.title)).join(" ")}}t.SNTag=s},33913:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},74332:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TagMutator=void 0;const r=n(4744),i=n(78961),o=n(14584),s=n(82648);class a extends o.DecryptedItemMutator{constructor(e,t){super(e,t),this.mutablePreferences=this.mutableContent.preferences}set title(e){this.mutableContent.title=e}set expanded(e){this.mutableContent.expanded=e}set iconString(e){this.mutableContent.iconString=e}get preferences(){return this.mutablePreferences||(this.mutableContent.preferences={},this.mutablePreferences=this.mutableContent.preferences),this.mutablePreferences}set preferences(e){this.mutablePreferences=e,this.mutableContent.preferences=this.mutablePreferences}makeChildOf(e){const t=this.immutableItem.references.filter((e=>!(0,r.isTagToParentTagReference)(e))),n={reference_type:i.ContentReferenceType.TagToParentTag,content_type:s.ContentType.TYPES.Tag,uuid:e.uuid};t.push(n),this.mutableContent.references=t}unsetParent(){this.mutableContent.references=this.immutableItem.references.filter((e=>!(0,r.isTagToParentTagReference)(e)))}addFile(e){if(this.immutableItem.isReferencingItem(e))return;const t={reference_type:i.ContentReferenceType.TagToFile,content_type:s.ContentType.TYPES.File,uuid:e.uuid};this.mutableContent.references.push(t)}removeFile(e){this.mutableContent.references=this.mutableContent.references.filter((t=>t.uuid!==e.uuid))}addNote(e){this.immutableItem.isReferencingItem(e)||this.mutableContent.references.push({uuid:e.uuid,content_type:e.content_type})}removeNote(e){this.mutableContent.references=this.mutableContent.references.filter((t=>t.uuid!==e.uuid))}}t.TagMutator=a},72680:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},87458:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(4862),t),i(n(74332),t),i(n(33913),t),i(n(72680),t)},82602:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},63195:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TrustedContactMutator=void 0;const r=n(50292),i=n(68092);class o extends r.DecryptedItemMutator{set name(e){this.mutableContent.name=e}addPublicKey(e){const t=new i.ContactPublicKeySet({encryption:e.encryption,signing:e.signing,timestamp:new Date,previousKeySet:this.immutableItem.publicKeySet});this.mutableContent.publicKeySet=t}replacePublicKeySet(e){this.mutableContent.publicKeySet=e}}t.TrustedContactMutator=o},68092:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContactPublicKeySet=void 0;class n{constructor(e){this.encryption=e.encryption,this.signing=e.signing,this.timestamp=e.timestamp,this.previousKeySet=e.previousKeySet}findKeySetWithSigningKey(e){return this.signing===e?this:this.previousKeySet?this.previousKeySet.findKeySetWithSigningKey(e):void 0}findKeySetWithPublicKey(e){return this.encryption===e?this:this.previousKeySet?this.previousKeySet.findKeySetWithPublicKey(e):void 0}asJson(){return{encryption:this.encryption,signing:this.signing,timestamp:this.timestamp,previousKeySet:this.previousKeySet?this.previousKeySet.asJson():void 0}}mutableCopy(){return new n({encryption:this.encryption,signing:this.signing,timestamp:this.timestamp,previousKeySet:this.previousKeySet?n.FromJson(this.previousKeySet.asJson()):void 0})}static FromJson(e){return new n({encryption:e.encryption,signing:e.signing,timestamp:new Date(e.timestamp),previousKeySet:e.previousKeySet?n.FromJson(e.previousKeySet):void 0})}}t.ContactPublicKeySet=n},21436:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},79609:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TrustedContact=void 0;const r=n(50292),i=n(68092),o=n(78688),s=n(19332);class a extends r.DecryptedItem{constructor(e){super(e),this.name=e.content.name,this.contactUuid=e.content.contactUuid,this.publicKeySet=i.ContactPublicKeySet.FromJson(e.content.publicKeySet),this.isMe=e.content.isMe}get isSingleton(){return!0}singletonPredicate(){return a.singletonPredicate}hasCurrentOrPreviousSigningPublicKey(e){return void 0!==this.publicKeySet.findKeySetWithSigningKey(e)}getTrustStatusForPublicKey(e){return this.publicKeySet.encryption===e?s.PublicKeyTrustStatus.Trusted:this.publicKeySet.findKeySetWithPublicKey(e)?s.PublicKeyTrustStatus.Previous:s.PublicKeyTrustStatus.NotTrusted}getTrustStatusForSigningPublicKey(e){return this.publicKeySet.signing===e?s.PublicKeyTrustStatus.Trusted:this.publicKeySet.findKeySetWithSigningKey(e)?s.PublicKeyTrustStatus.Previous:s.PublicKeyTrustStatus.NotTrusted}strategyWhenConflictingWithItem(e,t){return r.ConflictStrategy.KeepBase}}t.TrustedContact=a,a.singletonPredicate=new o.Predicate("isMe","=",!0)},15845:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5478:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},19332:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PublicKeyTrustStatus=void 0,function(e){e.Trusted="Trusted",e.Previous="Previous",e.NotTrusted="NotTrusted"}(n||(t.PublicKeyTrustStatus=n={}))},79319:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},68933:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EditorFontSize=void 0,function(e){e.ExtraSmall="ExtraSmall",e.Small="Small",e.Normal="Normal",e.Medium="Medium",e.Large="Large"}(n||(t.EditorFontSize=n={}))},97876:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EditorLineHeightValues=t.EditorLineHeight=void 0,function(e){e.None="None",e.Tight="Tight",e.Snug="Snug",e.Normal="Normal",e.Relaxed="Relaxed",e.Loose="Loose"}(n||(t.EditorLineHeight=n={})),t.EditorLineHeightValues={None:1,Tight:1.25,Snug:1.375,Normal:1.5,Relaxed:1.625,Loose:2}},20610:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EditorLineWidth=void 0,function(e){e.Narrow="Narrow",e.Wide="Wide",e.Dynamic="Dynamic",e.FullWidth="FullWidth"}(n||(t.EditorLineWidth=n={}))},23688:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.NewNoteTitleFormat=void 0,function(e){e.CurrentDateAndTime="CurrentDateAndTime",e.CurrentNoteCount="CurrentNoteCount",e.CustomFormat="CustomFormat",e.Empty="Empty"}(n||(t.NewNoteTitleFormat=n={}))},68126:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PrefDefaults=void 0;const r=n(80215),i=n(92207),o=n(68933),s=n(97876),a=n(20610),l=n(70659),c=n(23688);t.PrefDefaults={[l.PrefKey.TagsPanelWidth]:220,[l.PrefKey.NotesPanelWidth]:350,[l.PrefKey.EditorWidth]:null,[l.PrefKey.EditorLeft]:null,[l.PrefKey.DEPRECATED_EditorMonospaceEnabled]:!1,[l.PrefKey.EditorSpellcheck]:!0,[l.PrefKey.EditorResizersEnabled]:!1,[l.PrefKey.DEPRECATED_EditorLineHeight]:s.EditorLineHeight.Normal,[l.PrefKey.DEPRECATED_EditorLineWidth]:a.EditorLineWidth.FullWidth,[l.PrefKey.DEPRECATED_EditorFontSize]:o.EditorFontSize.Normal,[l.PrefKey.SortNotesBy]:i.CollectionSort.CreatedAt,[l.PrefKey.SortNotesReverse]:!1,[l.PrefKey.NotesShowArchived]:!1,[l.PrefKey.NotesShowTrashed]:!1,[l.PrefKey.NotesHidePinned]:!1,[l.PrefKey.NotesHideProtected]:!1,[l.PrefKey.NotesHideNotePreview]:!1,[l.PrefKey.NotesHideDate]:!1,[l.PrefKey.NotesHideTags]:!1,[l.PrefKey.NotesHideEditorIcon]:!1,[l.PrefKey.DEPRECATED_UseSystemColorScheme]:!1,[l.PrefKey.DEPRECATED_UseTranslucentUI]:!0,[l.PrefKey.DEPRECATED_AutoLightThemeIdentifier]:"Default",[l.PrefKey.DEPRECATED_AutoDarkThemeIdentifier]:r.NativeFeatureIdentifier.TYPES.DarkTheme,[l.PrefKey.NoteAddToParentFolders]:!0,[l.PrefKey.NewNoteTitleFormat]:c.NewNoteTitleFormat.CurrentDateAndTime,[l.PrefKey.CustomNoteTitleFormat]:"YYYY-MM-DD [at] hh:mm A",[l.PrefKey.UpdateSavingStatusIndicator]:!0,[l.PrefKey.PaneGesturesEnabled]:!0,[l.PrefKey.MomentsDefaultTagUuid]:void 0,[l.PrefKey.ClipperDefaultTagUuid]:void 0,[l.PrefKey.DefaultEditorIdentifier]:r.NativeFeatureIdentifier.TYPES.PlainEditor,[l.PrefKey.SuperNoteExportFormat]:"json",[l.PrefKey.SuperNoteExportEmbedBehavior]:"reference",[l.PrefKey.SuperNoteExportUseMDFrontmatter]:!0,[l.PrefKey.SuperNoteExportPDFPageSize]:"A4",[l.PrefKey.SystemViewPreferences]:{},[l.PrefKey.AuthenticatorNames]:"",[l.PrefKey.ComponentPreferences]:{},[l.PrefKey.DEPRECATED_ActiveThemes]:[],[l.PrefKey.ActiveComponents]:[],[l.PrefKey.AlwaysShowSuperToolbar]:!0,[l.PrefKey.AddImportsToTag]:!0,[l.PrefKey.AlwaysCreateNewTagForImports]:!0,[l.PrefKey.ExistingTagForImports]:void 0}},70659:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PrefKey=void 0,function(e){e.TagsPanelWidth="tagsPanelWidth",e.NotesPanelWidth="notesPanelWidth",e.EditorWidth="editorWidth",e.EditorLeft="editorLeft",e.EditorSpellcheck="spellcheck",e.EditorResizersEnabled="marginResizersEnabled",e.SortNotesBy="sortBy",e.SortNotesReverse="sortReverse",e.NotesShowArchived="showArchived",e.NotesShowTrashed="showTrashed",e.NotesHideProtected="hideProtected",e.NotesHidePinned="hidePinned",e.NotesHideNotePreview="hideNotePreview",e.NotesHideDate="hideDate",e.NotesHideTags="hideTags",e.NotesHideEditorIcon="hideEditorIcon",e.NoteAddToParentFolders="noteAddToParentFolders",e.NewNoteTitleFormat="newNoteTitleFormat",e.CustomNoteTitleFormat="customNoteTitleFormat",e.UpdateSavingStatusIndicator="updateSavingStatusIndicator",e.DefaultEditorIdentifier="defaultEditorIdentifier",e.MomentsDefaultTagUuid="momentsDefaultTagUuid",e.ClipperDefaultTagUuid="clipperDefaultTagUuid",e.SystemViewPreferences="systemViewPreferences",e.SuperNoteExportFormat="superNoteExportFormat",e.SuperNoteExportEmbedBehavior="superNoteExportEmbedBehavior",e.SuperNoteExportUseMDFrontmatter="superNoteExportUseMDFrontmatter",e.SuperNoteExportPDFPageSize="superNoteExportPDFPageSize",e.AuthenticatorNames="authenticatorNames",e.PaneGesturesEnabled="paneGesturesEnabled",e.ComponentPreferences="componentPreferences",e.ActiveComponents="activeComponents",e.AlwaysShowSuperToolbar="alwaysShowSuperToolbar",e.AddImportsToTag="addImportsToTag",e.AlwaysCreateNewTagForImports="alwaysCreateNewTagForImports",e.ExistingTagForImports="existingTagForImports",e.DEPRECATED_ActiveThemes="activeThemes",e.DEPRECATED_UseSystemColorScheme="useSystemColorScheme",e.DEPRECATED_UseTranslucentUI="useTranslucentUI",e.DEPRECATED_AutoLightThemeIdentifier="autoLightThemeIdentifier",e.DEPRECATED_AutoDarkThemeIdentifier="autoDarkThemeIdentifier",e.DEPRECATED_EditorMonospaceEnabled="monospaceFont",e.DEPRECATED_EditorLineHeight="editorLineHeight",e.DEPRECATED_EditorLineWidth="editorLineWidth",e.DEPRECATED_EditorFontSize="editorFontSize"}(n||(t.PrefKey=n={}))},87070:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SNUserPrefs=void 0;const r=n(82648),i=n(43740),o=n(78688);class s extends i.DecryptedItem{get isSingleton(){return!0}singletonPredicate(){return s.singletonPredicate}getPref(e){return this.getAppDomainValue(e)}}t.SNUserPrefs=s,s.singletonPredicate=new o.Predicate("content_type","=",r.ContentType.TYPES.UserPrefs)},34660:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UserPrefsMutator=void 0;const r=n(14584);class i extends r.DecryptedItemMutator{setPref(e,t){this.setAppDataItem(e,t)}}t.UserPrefsMutator=i},53840:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(87070),t),i(n(34660),t),i(n(70659),t),i(n(97876),t),i(n(68933),t),i(n(20610),t),i(n(23688),t),i(n(79319),t),i(n(68126),t)},3396:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VaultListing=t.DefaultVaultIconName=void 0;const r=n(50292);t.DefaultVaultIconName="safe-square";class i extends r.DecryptedItem{constructor(e){super(e),this.systemIdentifier=e.content.systemIdentifier,this.rootKeyParams=e.content.rootKeyParams,this.keyStorageMode=e.content.keyStorageMode,this.name=e.content.name,this.description=e.content.description,this.iconString=e.content.iconString||t.DefaultVaultIconName,this.sharing=e.content.sharing}strategyWhenConflictingWithItem(e,t){const n=this.rootKeyParams.creationTimestamp;return e.rootKeyParams.creationTimestamp>n?r.ConflictStrategy.KeepApply:r.ConflictStrategy.KeepBase}get keyPasswordType(){return this.rootKeyParams.passwordType}isSharedVaultListing(){return null!=this.sharing}get key_system_identifier(){}get shared_vault_uuid(){}}t.VaultListing=i},52897:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},59402:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},82259:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VaultListingMutator=void 0;const r=n(50292);class i extends r.DecryptedItemMutator{set name(e){this.mutableContent.name=e}set description(e){this.mutableContent.description=e}set iconString(e){this.mutableContent.iconString=e}set sharing(e){this.mutableContent.sharing=e}set rootKeyParams(e){this.mutableContent.rootKeyParams=e}set keyStorageMode(e){this.mutableContent.keyStorageMode=e}}t.VaultListingMutator=i},44957:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},53555:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},40249:(e,t)=>{function n(e,t){return e.find((e=>e.uuid===t))}Object.defineProperty(t,"__esModule",{value:!0}),t.SureFindItem=t.FindItem=void 0,t.FindItem=n,t.SureFindItem=function(e,t){return n(e,t)}},33545:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ItemContentsDiffer=void 0;const r=n(41035);t.ItemContentsDiffer=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return!(0,r.ItemContentsEqual)(e.content,t.content,[...e.contentKeysToIgnoreWhenCheckingEquality(),...n],e.appDataContentKeysToIgnoreWhenCheckingEquality())}},41035:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ItemContentsEqual=void 0;const r=n(87901),i=n(71458);t.ItemContentsEqual=function(e,t,n,o){const s=(0,r.sortedCopy)(e);if(s.appData){const e=s.appData[i.DefaultAppDomain];(0,r.omitInPlace)(e,o),e?0===Object.keys(e).length&&delete s.appData:delete s.appData}(0,r.omitInPlace)(s,n);const a=(0,r.sortedCopy)(t);if(a.appData){const e=a.appData[i.DefaultAppDomain];(0,r.omitInPlace)(e,o),e?0===Object.keys(e).length&&delete a.appData:delete a.appData}return(0,r.omitInPlace)(a,n),JSON.stringify(s)===JSON.stringify(a)}},73277:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateItemFromPayload=t.CreateDecryptedItemFromPayload=t.RegisterItemClass=t.CreateDecryptedMutatorForItem=void 0;const r=n(80406),i=n(86154),o=n(73886),s=n(59020),a=n(35922),l=n(55159),c=n(43740),u=n(2636),d=n(12775),h=n(4862),p=n(87070),f=n(82422),g=n(34660),m=n(27539),y=n(43246),v=n(74332),A=n(39273),b=n(14584),w=n(78438),S=n(41138),C=n(79609),E=n(63195),I=n(82818),_=n(64836),x=n(3396),P=n(82259),k=n(59180),B=n(82648),O={[B.ContentType.TYPES.ActionsExtension]:{itemClass:s.SNActionsExtension,mutatorClass:m.ActionsExtensionMutator},[B.ContentType.TYPES.Component]:{itemClass:a.ComponentItem,mutatorClass:y.ComponentMutator},[B.ContentType.TYPES.KeySystemRootKey]:{itemClass:I.KeySystemRootKey,mutatorClass:_.KeySystemRootKeyMutator},[B.ContentType.TYPES.TrustedContact]:{itemClass:C.TrustedContact,mutatorClass:E.TrustedContactMutator},[B.ContentType.TYPES.VaultListing]:{itemClass:x.VaultListing,mutatorClass:P.VaultListingMutator},[B.ContentType.TYPES.Editor]:{itemClass:l.SNEditor},[B.ContentType.TYPES.ExtensionRepo]:{itemClass:o.SNFeatureRepo},[B.ContentType.TYPES.File]:{itemClass:i.FileItem,mutatorClass:f.FileMutator},[B.ContentType.TYPES.Note]:{itemClass:u.SNNote,mutatorClass:A.NoteMutator},[B.ContentType.TYPES.SmartView]:{itemClass:d.SmartView,mutatorClass:S.SmartViewMutator},[B.ContentType.TYPES.Tag]:{itemClass:h.SNTag,mutatorClass:v.TagMutator},[B.ContentType.TYPES.Theme]:{itemClass:a.ComponentItem,mutatorClass:y.ComponentMutator},[B.ContentType.TYPES.UserPrefs]:{itemClass:p.SNUserPrefs,mutatorClass:g.UserPrefsMutator}};function N(e){const t=O[e.content_type];return new(t?t.itemClass:c.DecryptedItem)(e)}t.CreateDecryptedMutatorForItem=function(e,t){var n;const r=null===(n=O[e.content_type])||void 0===n?void 0:n.mutatorClass;return r?new r(e,t):new b.DecryptedItemMutator(e,t)},t.RegisterItemClass=function(e,t,n){const r={itemClass:t,mutatorClass:n};O[e]=r},t.CreateDecryptedItemFromPayload=N,t.CreateItemFromPayload=function(e){if((0,k.isDecryptedPayload)(e))return N(e);if((0,k.isEncryptedPayload)(e))return new r.EncryptedItem(e);if((0,k.isDeletedPayload)(e))return new w.DeletedItem(e);throw Error("Unhandled case in CreateItemFromPayload")}},74527:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CopyPayloadWithContentOverride=void 0;const r=n(88141);t.CopyPayloadWithContentOverride=function(e,t){const n=Object.assign(Object.assign({},e.ejected()),{content:Object.assign(Object.assign({},e.content),t)});return(0,r.CreatePayload)(n,e.source)}},88141:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreatePayload=void 0;const r=n(86731),i=n(452),o=n(89262),s=n(78381);t.CreatePayload=function(e,t){if((0,s.isDecryptedTransferPayload)(e))return new o.DecryptedPayload(e,t);if((0,s.isEncryptedTransferPayload)(e))return new r.EncryptedPayload(e,t);if((0,s.isDeletedTransferPayload)(e))return new i.DeletedPayload(e,t);throw Error("Unhandled case in CreatePayload")}},15658:(e,t)=>{function n(e,t){return e.find((e=>e.uuid===t))}Object.defineProperty(t,"__esModule",{value:!0}),t.SureFindPayload=t.FindPayload=void 0,t.FindPayload=n,t.SureFindPayload=function(e,t){return n(e,t)}},37807:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadContentsEqual=void 0;const r=n(73277);t.PayloadContentsEqual=function(e,t){const n=(0,r.CreateDecryptedItemFromPayload)(e),i=(0,r.CreateDecryptedItemFromPayload)(t);return n.isItemContentEqualWith(i)}},50723:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateNonDecryptedPayloadSplit=t.CreatePayloadSplitWithDiscardables=t.CreatePayloadSplit=void 0;const r=n(13566);t.CreatePayloadSplit=function(e){const t={encrypted:[],decrypted:[],deleted:[]};for(const n of e)if((0,r.isDecryptedPayload)(n))t.decrypted.push(n);else if((0,r.isEncryptedPayload)(n))t.encrypted.push(n);else{if(!(0,r.isDeletedPayload)(n))throw Error("Unhandled case in CreatePayloadSplit");t.deleted.push(n)}return t},t.CreatePayloadSplitWithDiscardables=function(e){const t={encrypted:[],decrypted:[],deleted:[],discardable:[]};for(const n of e)if((0,r.isDecryptedPayload)(n))t.decrypted.push(n);else if((0,r.isEncryptedPayload)(n))t.encrypted.push(n);else{if(!(0,r.isDeletedPayload)(n))throw Error("Unhandled case in CreatePayloadSplitWithDiscardables");n.discardable?t.discardable.push(n):t.deleted.push(n)}return t},t.CreateNonDecryptedPayloadSplit=function(e){const t={encrypted:[],deleted:[]};for(const n of e)if((0,r.isEncryptedPayload)(n))t.encrypted.push(n);else{if(!(0,r.isDeletedPayload)(n))throw Error("Unhandled case in CreateNonDecryptedPayloadSplit");t.deleted.push(n)}return t}},15005:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadsByAlternatingUuid=void 0;const r=n(452),i=n(87901),o=n(13566),s=n(72208),a=n(13743),l=n(82648);t.PayloadsByAlternatingUuid=function(e,t){const n=[],c=e.copyAsSyncResolved({uuid:i.UuidGenerator.GenerateUuid(),dirty:!0,dirtyIndex:(0,a.getIncrementedDirtyIndex)(),lastSyncBegan:void 0,lastSyncEnd:new Date,duplicate_of:e.uuid});n.push(c);const u=(0,s.PayloadsByUpdatingReferencingPayloadReferences)(e,t,[c],[e.uuid]);if((0,i.extendArray)(n,u),e.content_type===l.ContentType.TYPES.ItemsKey){const r=t.all().filter((t=>(0,o.isEncryptedPayload)(t)&&t.items_key_id===e.uuid)).map((e=>e.copyAsSyncResolved({items_key_id:c.uuid,dirty:!0,dirtyIndex:(0,a.getIncrementedDirtyIndex)(),lastSyncEnd:new Date})));r.length>0&&(0,i.extendArray)(n,r)}const d=new r.DeletedPayload({created_at:e.created_at,updated_at:e.updated_at,created_at_timestamp:e.created_at_timestamp,updated_at_timestamp:e.updated_at_timestamp,dirty:!1,content:void 0,uuid:e.uuid,content_type:e.content_type,deleted:!0},e.source);return n.push(d),n}},27446:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadsByDuplicating=void 0;const r=n(87901),i=n(72208),o=n(13566),s=n(13743);t.PayloadsByDuplicating=function(e){const{payload:t,baseCollection:n,isConflict:a,additionalContent:l,source:c}=e,u=[],d={uuid:r.UuidGenerator.GenerateUuid(),dirty:!0,dirtyIndex:(0,s.getIncrementedDirtyIndex)(),lastSyncBegan:void 0,lastSyncEnd:new Date,duplicate_of:t.uuid};let h;if((0,o.isDecryptedPayload)(t)){const e=Object.assign(Object.assign({},t.content),l);a&&(e.conflict_of=t.uuid),h=t.copyAsSyncResolved(Object.assign(Object.assign({},d),{content:e,deleted:!1}))}else h=t.copyAsSyncResolved(Object.assign({},d),c||t.source);if(u.push(h),(0,o.isDecryptedPayload)(t)&&(0,o.isDecryptedPayload)(h)){const e=(0,i.PayloadsByUpdatingReferencingPayloadReferences)(t,n,[h]);(0,r.extendArray)(u,e)}return u}},72208:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadsByUpdatingReferencingPayloadReferences=void 0;const r=n(84213),i=n(59180),o=n(13743);t.PayloadsByUpdatingReferencingPayloadReferences=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const a=t.elementsReferencingElement(e).filter(i.isDecryptedPayload),l=[];for(const t of a){const i=t.content.references.slice(),a=t.getReference(e.uuid);for(const e of n){const t=Object.assign(Object.assign({},a),{uuid:e.uuid,content_type:e.content_type});i.push(t)}for(const e of s)(0,r.remove)(i,{uuid:e});const c=t.copyAsSyncResolved({dirty:!0,dirtyIndex:(0,o.getIncrementedDirtyIndex)(),lastSyncEnd:new Date,content:Object.assign(Object.assign({},t.content),{references:i})});l.push(c)}return l}},64475:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(56974),t),i(n(15866),t),i(n(35376),t),i(n(76317),t),i(n(88076),t),i(n(68763),t),i(n(75895),t),i(n(74601),t),i(n(3668),t),i(n(42405),t),i(n(95698),t),i(n(55930),t),i(n(36186),t),i(n(80537),t),i(n(1482),t),i(n(69087),t),i(n(70359),t),i(n(13214),t),i(n(84034),t),i(n(51600),t),i(n(30429),t),i(n(18592),t),i(n(2116),t),i(n(18973),t),i(n(7563),t),i(n(50292),t),i(n(59180),t),i(n(78381),t),i(n(21907),t),i(n(66675),t),i(n(90656),t),i(n(93715),t),i(n(84457),t),i(n(656),t),i(n(255),t),i(n(62846),t),i(n(29899),t),i(n(22296),t),i(n(52174),t),i(n(80910),t),i(n(87192),t),i(n(71109),t),i(n(32099),t),i(n(55430),t),i(n(33738),t),i(n(64130),t),i(n(18018),t),i(n(14770),t),i(n(45698),t),i(n(63070),t),i(n(32151),t),i(n(92207),t),i(n(36883),t),i(n(17441),t),i(n(51833),t),i(n(19759),t),i(n(22517),t),i(n(13743),t),i(n(30561),t),i(n(40257),t),i(n(93974),t),i(n(96084),t),i(n(87332),t),i(n(21662),t),i(n(47469),t),i(n(74958),t),i(n(36053),t),i(n(18284),t),i(n(78274),t),i(n(47479),t),i(n(21626),t),i(n(8698),t),i(n(26550),t),i(n(80389),t),i(n(21271),t),i(n(21271),t),i(n(73067),t),i(n(21014),t),i(n(78688),t),i(n(58506),t),i(n(40826),t),i(n(52659),t),i(n(10123),t),i(n(12310),t),i(n(25698),t),i(n(87500),t),i(n(2836),t),i(n(52493),t),i(n(82412),t),i(n(23811),t),i(n(19725),t),i(n(82818),t),i(n(95132),t),i(n(31750),t),i(n(64836),t),i(n(28819),t),i(n(42006),t),i(n(41138),t),i(n(87458),t),i(n(82602),t),i(n(63195),t),i(n(68092),t),i(n(21436),t),i(n(79609),t),i(n(15845),t),i(n(5478),t),i(n(19332),t),i(n(53840),t),i(n(3396),t),i(n(52897),t),i(n(59402),t),i(n(82259),t),i(n(44957),t),i(n(53555),t),i(n(40249),t),i(n(33545),t),i(n(41035),t),i(n(73277),t),i(n(74527),t),i(n(88141),t),i(n(15658),t),i(n(37807),t),i(n(15005),t),i(n(27446),t),i(n(50723),t)},22325:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(64475),t)},34789:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},88645:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},29590:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},77345:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},79594:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},81563:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},29547:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},89398:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},41278:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},48126:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},60346:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},39881:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},11706:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},74113:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},68224:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},14116:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},22893:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},94764:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isClientDisplayableError=t.ClientDisplayableError=void 0;const r=n(92961);class i{constructor(e,t,n){this.text=e,this.title=t,this.tag=n,console.error("Client Displayable Error:",e,t||"",n||"")}static FromError(e){return new i(e.message,void 0,e.tag)}static FromString(e){return new i(e)}static FromNetworkError(e){return new i((0,r.getErrorFromErrorResponse)(e).message)}}t.ClientDisplayableError=i,t.isClientDisplayableError=function(e){return e instanceof i}},89408:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},23632:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},37525:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},22039:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},43129:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},27196:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},43630:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},53980:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},46707:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},13838:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},95573:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},42338:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},32176:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DeprecatedStatusCode=void 0,function(e){e[e.LocalValidationError=10]="LocalValidationError",e[e.CanceledMfa=11]="CanceledMfa",e[e.HttpStatusMinSuccess=200]="HttpStatusMinSuccess",e[e.HttpStatusNoContent=204]="HttpStatusNoContent",e[e.HttpStatusMaxSuccess=299]="HttpStatusMaxSuccess",e[e.HttpStatusExpiredAccessToken=498]="HttpStatusExpiredAccessToken",e[e.HttpStatusInvalidSession=401]="HttpStatusInvalidSession",e[e.HttpStatusForbidden=403]="HttpStatusForbidden",e[e.HttpBadRequest=400]="HttpBadRequest"}(n||(t.DeprecatedStatusCode=n={}))},67545:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorTag=void 0,function(e){e.MfaInvalid="mfa-invalid",e.MfaRequired="mfa-required",e.U2FRequired="u2f-required",e.RefreshTokenInvalid="invalid-refresh-token",e.RefreshTokenExpired="expired-refresh-token",e.AccessTokenExpired="expired-access-token",e.ParametersInvalid="invalid-parameters",e.RevokedSession="revoked-session",e.AuthInvalid="invalid-auth",e.ReadOnlyAccess="read-only-access",e.ExpiredItemShare="expired-item-share",e.ClientValidationError="client-validation-error",e.ClientCanceledMfa="client-canceled-mfa"}(n||(t.ErrorTag=n={}))},64404:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},48379:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},11910:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},44323:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},53251:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},23269:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorFromErrorResponse=t.getErrorMessageFromErrorResponseBody=t.getCaptchaHeader=t.isErrorResponse=void 0,t.isErrorResponse=function(e){var t;return null!=(null===(t=e.data)||void 0===t?void 0:t.error)||e.status>=400},t.getCaptchaHeader=function(e){var t;return(null===(t=e.headers)||void 0===t?void 0:t.get("x-captcha-required"))||null},t.getErrorMessageFromErrorResponseBody=function(e,t){let n=t||"Unknown error";return e&&"object"==typeof e&&"error"in e&&e.error&&"object"==typeof e.error&&"message"in e.error&&(n=e.error.message),n},t.getErrorFromErrorResponse=function(e){return e.data.error||{message:"Unknown error"}}},58009:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},95778:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.HttpStatusCode=void 0,function(e){e[e.Success=200]="Success",e[e.NoContent=204]="NoContent",e[e.MultipleChoices=300]="MultipleChoices",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.Forbidden=403]="Forbidden",e[e.Gone=410]="Gone",e[e.ExpiredAccessToken=498]="ExpiredAccessToken",e[e.InternalServerError=500]="InternalServerError"}(n||(t.HttpStatusCode=n={}))},37204:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.HttpVerb=void 0,function(e){e.Get="GET",e.Post="POST",e.Put="PUT",e.Patch="PATCH",e.Delete="DELETE"}(n||(t.HttpVerb=n={}))},92961:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(67545),t),i(n(48379),t),i(n(11910),t),i(n(44323),t),i(n(53251),t),i(n(23269),t),i(n(58009),t),i(n(37204),t),i(n(46707),t),i(n(13838),t),i(n(95573),t),i(n(42338),t),i(n(32176),t),i(n(95778),t),i(n(64404),t)},72646:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ApiEndpointParam=void 0,function(e){e.LastSyncToken="sync_token",e.PaginationToken="cursor_token",e.SyncDlLimit="limit",e.SyncPayloads="items",e.ApiVersion="api",e.SharedVaultUuids="shared_vault_uuids"}(n||(t.ApiEndpointParam=n={}))},21799:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6579:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.conflictParamsHasOnlyUnsavedItem=t.conflictParamsHasOnlyServerItem=t.conflictParamsHasServerItemAndUnsavedItem=void 0,t.conflictParamsHasServerItemAndUnsavedItem=function(e){return void 0!==e.server_item&&void 0!==e.unsaved_item},t.conflictParamsHasOnlyServerItem=function(e){return void 0!==e.server_item},t.conflictParamsHasOnlyUnsavedItem=function(e){return void 0!==e.unsaved_item}},68655:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ConflictType=void 0,function(e){e.ConflictingData="sync_conflict",e.UuidConflict="uuid_conflict",e.ContentTypeError="content_type_error",e.ContentError="content_error",e.ReadOnlyError="readonly_error",e.UuidError="uuid_error",e.InvalidServerItem="invalid_server_item",e.SharedVaultSnjsVersionError="shared_vault_snjs_version_error",e.SharedVaultInsufficientPermissionsError="shared_vault_insufficient_permissions_error",e.SharedVaultNotMemberError="shared_vault_not_member_error",e.SharedVaultInvalidState="shared_vault_invalid_state"}(n||(t.ConflictType=n={}))},95833:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},46911:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},20459:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),n(72646)},74397:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},80653:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},96579:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},42374:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},51658:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},22487:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},20421:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},20780:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},34455:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6976:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},1539:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},81526:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},13177:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},86682:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},2564:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ValetTokenOperation=void 0,function(e){e.Read="read",e.Write="write",e.Delete="delete",e.Move="move"}(n||(t.ValetTokenOperation=n={}))},98819:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},9283:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},39805:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},28022:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},80933:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},22906:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},65802:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},44877:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},13562:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},23324:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},35956:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88645),t),i(n(29590),t),i(n(77345),t),i(n(79594),t),i(n(29547),t),i(n(89398),t),i(n(41278),t),i(n(48126),t),i(n(60346),t),i(n(39881),t),i(n(11706),t),i(n(74113),t),i(n(68224),t),i(n(14116),t),i(n(22893),t),i(n(81563),t),i(n(13177),t),i(n(86682),t),i(n(2564),t),i(n(81526),t),i(n(94764),t),i(n(89408),t),i(n(23632),t),i(n(37525),t),i(n(22039),t),i(n(43129),t),i(n(43630),t),i(n(53980),t),i(n(27196),t),i(n(92961),t),i(n(34455),t),i(n(1539),t),i(n(6976),t),i(n(34789),t),i(n(72646),t),i(n(21799),t),i(n(6579),t),i(n(68655),t),i(n(95833),t),i(n(20459),t),i(n(74397),t),i(n(80653),t),i(n(46911),t),i(n(96579),t),i(n(42374),t),i(n(51658),t),i(n(22487),t),i(n(20421),t),i(n(98819),t),i(n(9283),t),i(n(39805),t),i(n(28022),t),i(n(80933),t),i(n(22906),t),i(n(65802),t),i(n(44877),t),i(n(13562),t),i(n(23324),t),i(n(20780),t),i(n(34455),t),i(n(6976),t),i(n(1539),t)},95658:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(35956),t)},55668:(e,t,n)=>{var r,i;n.d(t,{WLG:()=>re,gQA:()=>fe,qIx:()=>he,mvL:()=>ye,Zq2:()=>ce,EaW:()=>de,iMd:()=>ve,WZ6:()=>ge,BMD:()=>pe,oBV:()=>ue,aWs:()=>ie,Z15:()=>q,oe5:()=>$,VpG:()=>Z,Cj$:()=>W,TwN:()=>ee,gEn:()=>J,lO_:()=>oe,aXB:()=>le,TYJ:()=>ne,jN7:()=>ae,vfv:()=>te,z6z:()=>se,CV:()=>me,wcN:()=>f,nmV:()=>ei,oF7:()=>Br,c9N:()=>o,Sf$:()=>i,mxT:()=>mr,n9K:()=>L,U3K:()=>C,Ugm:()=>y,WXh:()=>x,El:()=>R,F8w:()=>U,D$B:()=>Fr,L$3:()=>r,V1G:()=>Pe,tv4:()=>Ge,gqK:()=>Ze,GnZ:()=>Re,FEo:()=>ze,fD2:()=>Ye,Ps8:()=>Ke,NiJ:()=>Qe,tQn:()=>He,EdL:()=>Ir,tuB:()=>Rr,KH1:()=>Qr,kQg:()=>We,euo:()=>zn,yqc:()=>tt,EFn:()=>Xe,b$E:()=>Zn,KL0:()=>qe,ocI:()=>An,D6l:()=>wn,Nwx:()=>Ut,Yw:()=>Kt,Dk4:()=>st,zEM:()=>Wn,TQm:()=>Vr,Y7C:()=>je,liL:()=>Be,vV3:()=>hn,ZXN:()=>pn,eyx:()=>Lt,suI:()=>Gt,zW4:()=>jt,nGw:()=>Dt,$M4:()=>Tt,EQN:()=>Mt,gzl:()=>zt,qXV:()=>Wt,CYv:()=>v,u4P:()=>A,z8s:()=>at,KLn:()=>Xn,jGD:()=>Jn,Rws:()=>Kr,X2V:()=>mi,WEs:()=>fn,Ydb:()=>_r,R53:()=>we,ZQj:()=>lt,S1n:()=>Ft,i6C:()=>Jt,k6d:()=>$t,C6q:()=>Ot,fa_:()=>It,kov:()=>Ue,iKc:()=>nn,Usi:()=>tn,aax:()=>Y,IpN:()=>ln,exs:()=>z,VD3:()=>ct,iPu:()=>Ht,ug$:()=>xr,s$_:()=>ut,KCz:()=>gn,DZq:()=>mn,cdY:()=>Pr,Vxn:()=>P,Byj:()=>Qt,qk9:()=>Rt,WUT:()=>k,tlz:()=>$n,Tog:()=>er,xOS:()=>St,pqE:()=>B,P9M:()=>O,dDs:()=>Hr,bDv:()=>yi,$qZ:()=>Gr,PDt:()=>vi,r0l:()=>Yr,qjc:()=>ht,cjV:()=>N,tGH:()=>un,$cH:()=>Ae,CVE:()=>Ee,nIe:()=>Ce,Ens:()=>vn,CEH:()=>pr,l4I:()=>gr,Bw1:()=>Ne,ezr:()=>bn,yim:()=>Sn,Ehg:()=>En,WNP:()=>l,KK4:()=>$e,BbS:()=>rt,RAe:()=>ni,Y8x:()=>kr,hEi:()=>Ai,o1e:()=>bi,hjk:()=>wi,uMm:()=>Cn,kNl:()=>ft,oQ4:()=>xn,UEW:()=>xt,Pn4:()=>Bn,mHn:()=>Ve,Z7G:()=>Si,Icj:()=>m,dH$:()=>On,sNv:()=>Dn,cZu:()=>zr,cU9:()=>h,gqp:()=>Tr,JQe:()=>Vn,cVV:()=>nr,_Bl:()=>Ie,WZd:()=>Nn,Klw:()=>D,Hh3:()=>jn,GUt:()=>Fe,vL5:()=>ke,Bq2:()=>u,HSp:()=>rn,rc1:()=>Te,fF_:()=>Zr,$sG:()=>fr,YxU:()=>Ei,xRL:()=>pt,HLD:()=>j,IF$:()=>T,F0Y:()=>ii,afr:()=>oi,s7t:()=>ai,t9U:()=>Ln,wtP:()=>Hn,PqX:()=>qr,TpP:()=>xe,Ld1:()=>ot,uzh:()=>M,u3X:()=>gt,$SL:()=>sr,Iup:()=>ci,Foy:()=>lr,VxG:()=>X,Pxr:()=>Qn,K9E:()=>Le,q62:()=>Or,uLb:()=>cr,cnh:()=>Yn,$_C:()=>Un,Mwm:()=>Me,kNs:()=>In,Bjn:()=>hr,rW4:()=>ur,QtK:()=>d,eIN:()=>Tn,qt7:()=>Mn,OC4:()=>De,LF2:()=>Sr,lKe:()=>yr,XEg:()=>Cr,wMo:()=>E,_Jh:()=>dr,YCg:()=>vr,BUK:()=>Er,Sii:()=>Ar,Lbd:()=>br,OU3:()=>G,I4j:()=>Oe,VnT:()=>Se,fnl:()=>be,RsP:()=>_e,KDu:()=>Dr,Lv2:()=>yt,EGP:()=>pi,dDH:()=>Fn,hZp:()=>hi,Z$T:()=>li,PHC:()=>gi,h21:()=>ui,RDE:()=>$r,ccW:()=>Jr,k7Z:()=>Ii,igb:()=>xi,UR5:()=>Ci,B5f:()=>en,BV4:()=>S,fAX:()=>s,ufS:()=>vt,qr4:()=>Je,dse:()=>Ct,Or9:()=>At,s2G:()=>Et,xLN:()=>g}),function(e){e[e.Info=0]="Info",e[e.Danger=1]="Danger"}(r||(r={}));class o{showErrorAlert(e){return this.alert(e.text,e.title)}}!function(e){e.MetaReceived="MetaReceived",e.SessionRefreshed="SessionRefreshed"}(i||(i={}));var s,a=n(95658);!function(e){e.UserRoleMessageReceived="WebSocketMessageReceived",e.NotificationAddedForUser="NotificationAddedForUser",e.MessageSentToUser="MessageSentToUser",e.UserInvitedToSharedVault="UserInvitedToSharedVault",e.ItemsChangedOnServer="ItemsChangedOnServer"}(s||(s={}));var l,c=n(87901);!function(e){e.ASYNC="ASYNC",e.SEQUENCE="SEQUENCE"}(l||(l={}));var u,d,h,p=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class f{constructor(e){this.internalEventBus=e,this.eventObservers=[],this.loggingEnabled=!1,this.criticalPromises=[],this.eventDisposers=[]}addEventObserver(e){this.eventObservers.push(e);const t=this.eventObservers;return()=>{(0,c.removeFromArray)(t,e)}}notifyEvent(e,t){var n;return p(this,void 0,void 0,(function*(){for(const n of this.eventObservers)yield n(e,t);null===(n=this.internalEventBus)||void 0===n||n.publish({type:e,payload:t})}))}notifyEventSync(e,t){var n;return p(this,void 0,void 0,(function*(){for(const n of this.eventObservers)yield n(e,t);yield null===(n=this.internalEventBus)||void 0===n?void 0:n.publishSync({type:e,payload:t},l.SEQUENCE)}))}getDiagnostics(){return Promise.resolve(void 0)}blockDeinit(){return p(this,void 0,void 0,(function*(){yield Promise.all(this.criticalPromises)}))}deinit(){this.eventObservers.length=0,this.internalEventBus=void 0,this.criticalPromises=void 0;for(const e of this.eventDisposers)e();this.eventDisposers=[]}executeCriticalFunction(e){return p(this,void 0,void 0,(function*(){const t=e();return this.criticalPromises.push(t),t}))}getServiceName(){return this.constructor.name}isApplicationService(){return!0}}function g(e,t){return"".concat(e,"-").concat(t)}!function(e){e.StorageObject="storage",e.DescriptorRecord="descriptors",e.SnjsVersion="snjs_version",e.HomeServerEnabled="home_server_enabled",e.HomeServerDataLocation="home_serve_data_location"}(u||(u={})),function(e){e.RootKeyParams="ROOT_KEY_PARAMS",e.WrappedRootKey="WRAPPED_ROOT_KEY",e.RootKeyWrapperKeyParams="ROOT_KEY_WRAPPER_KEY_PARAMS",e.Session="session",e.User="user",e.ServerHost="server",e.LegacyUuid="uuid",e.LastSyncToken="syncToken",e.PaginationToken="cursorToken",e.BiometricsState="biometrics_state",e.MobilePasscodeTiming="passcode_timing",e.MobileBiometricsTiming="biometrics_timing",e.MobilePasscodeKeyboardType="passcodeKeyboardType",e.MobilePreferences="preferences",e.MobileScreenshotPrivacyEnabled="screenshotPrivacy_enabled",e.ProtectionExpirey="SessionExpiresAtKey",e.ProtectionSessionLength="SessionLengthKey",e.KeyRecoveryUndecryptableItems="key_recovery_undecryptable",e.WebSocketUrl="webSocket_url",e.UserRoles="user_roles",e.OfflineUserRoles="offline_user_roles",e.ExperimentalFeatures="experimental_features",e.DeinitMode="deinit_mode",e.CodeVerifier="code_verifier",e.LaunchPriorityUuids="launch_priority_uuids",e.LastReadChangelogVersion="last_read_changelog_version",e.MomentsEnabled="moments_enabled",e.TextBackupsEnabled="text_backups_enabled",e.TextBackupsLocation="text_backups_location",e.PlaintextBackupsEnabled="plaintext_backups_enabled",e.PlaintextBackupsLocation="plaintext_backups_location",e.FileBackupsEnabled="file_backups_enabled",e.FileBackupsLocation="file_backups_location",e.VaultSelectionOptions="vault_selection_options",e.Subscription="subscription",e.LocalPreferences="local_preferences"}(d||(d={})),function(e){e.MobileFirstRun="first_run"}(h||(h={}));const m={WebPasscodeParamsKey:"offlineParams",MobilePasscodeParamsKey:"pc_params",AllAccountKeyParamsKey:"auth_params",WebEncryptedStorageKey:"encryptedStorage",MobileWrappedRootKeyKey:"encrypted_account_keys",MobileBiometricsPrefs:"biometrics_prefs",AllMigrations:"migrations",MobileThemesCache:"ThemePreferencesKey",MobileLightTheme:"lightTheme",MobileDarkTheme:"darkTheme",MobileLastExportDate:"LastExportDateKey",MobileDoNotWarnUnsupportedEditors:"DoNotShowAgainUnsupportedEditorsKey",MobileOptionsState:"options",MobilePasscodeKeyboardType:"passcodeKeyboardType"};var y,v,A,b=n(82648),w=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class S extends f{constructor(e,t,n,r){super(r),this.storageService=e,this.webSocketUrl=t,this.webSocketApiService=n,this.internalEventBus=r,this.CLOSE_CONNECTION_CODE=3123,this.HEARTBEAT_DELAY=36e4}setWebSocketUrl(e){this.webSocketUrl=e,this.storageService.setValue(d.WebSocketUrl,e)}loadWebSocketUrl(){const e=this.storageService.getValue(d.WebSocketUrl);this.webSocketUrl=e||this.webSocketUrl||window._websocket_url}startWebSocketConnection(){return w(this,void 0,void 0,(function*(){if(!this.webSocketUrl)return b.Result.fail("WebSocket URL is not set");const e=yield this.createWebSocketConnectionToken();if(void 0===e)return b.Result.fail("Failed to create WebSocket connection token");try{return this.webSocket=new WebSocket("".concat(this.webSocketUrl,"?authToken=").concat(e)),this.webSocket.onmessage=this.onWebSocketMessage.bind(this),this.webSocket.onclose=this.onWebSocketClose.bind(this),this.webSocket.onopen=this.beginWebSocketHeartbeat.bind(this),b.Result.ok()}catch(e){return b.Result.fail("Error starting WebSocket connection: ".concat(e.message))}}))}isWebSocketConnectionOpen(){var e;return(null===(e=this.webSocket)||void 0===e?void 0:e.readyState)===WebSocket.OPEN}closeWebSocketConnection(){var e;null===(e=this.webSocket)||void 0===e||e.close(this.CLOSE_CONNECTION_CODE,"Closing application")}beginWebSocketHeartbeat(){this.webSocketHeartbeatInterval=setInterval(this.websocketHeartbeat.bind(this),this.HEARTBEAT_DELAY)}websocketHeartbeat(){var e;(null===(e=this.webSocket)||void 0===e?void 0:e.readyState)===WebSocket.OPEN&&this.webSocket.send("ping")}onWebSocketMessage(e){const t=JSON.parse(e.data);switch(t.type){case"ITEMS_CHANGED_ON_SERVER":this.notifyEvent(s.ItemsChangedOnServer,t);break;case"USER_ROLES_CHANGED":this.notifyEvent(s.UserRoleMessageReceived,t);break;case"NOTIFICATION_ADDED_FOR_USER":this.notifyEvent(s.NotificationAddedForUser,t.payload);break;case"MESSAGE_SENT_TO_USER":this.notifyEvent(s.MessageSentToUser,t.payload);break;case"USER_INVITED_TO_SHARED_VAULT":this.notifyEvent(s.UserInvitedToSharedVault,t.payload)}}onWebSocketClose(e){var t;this.webSocketHeartbeatInterval&&clearInterval(this.webSocketHeartbeatInterval),this.webSocketHeartbeatInterval=void 0,e.code===this.CLOSE_CONNECTION_CODE?this.webSocket=void 0:(null===(t=this.webSocket)||void 0===t?void 0:t.readyState)===WebSocket.CLOSED&&this.startWebSocketConnection()}createWebSocketConnectionToken(){return w(this,void 0,void 0,(function*(){try{const e=yield this.webSocketApiService.createConnectionToken();return(0,a.isErrorResponse)(e)?void console.error(e.data.error):e.data.token}catch(e){return void console.error("Caught error:",e.message)}}))}deinit(){super.deinit(),this.storageService=void 0,this.webSocketApiService=void 0,this.closeWebSocketConnection()}}!function(e){e[e.PreparingForLaunch_0=0]="PreparingForLaunch_0",e[e.ReadyForLaunch_05=.5]="ReadyForLaunch_05",e[e.StorageDecrypted_09=.9]="StorageDecrypted_09",e[e.Launched_10=1]="Launched_10",e[e.LoadingDatabase_11=1.1]="LoadingDatabase_11",e[e.LoadedDatabase_12=1.2]="LoadedDatabase_12",e[e.FullSyncCompleted_13=1.3]="FullSyncCompleted_13",e[e.SignedIn_30=3]="SignedIn_30"}(y||(y={})),function(e){e.Soft="Soft",e.Hard="Hard"}(v||(v={})),function(e){e[e.SignOut=1]="SignOut",e[e.Lock=2]="Lock",e[e.SwitchWorkspace=3]="SwitchWorkspace",e[e.SignOutAll=4]="SignOutAll"}(A||(A={}));const C={loadBatchSize:700,sleepBetweenBatches:10,allowMultipleSelection:!0,allowNoteSelectionStatePersistence:!0};var E,I=n(22325);!function(e){e.SyncCompletedWithAllItemsUploaded="SyncCompletedWithAllItemsUploaded",e.SyncCompletedWithAllItemsUploadedAndDownloaded="SyncCompletedWithAllItemsUploadedAndDownloaded",e.PaginatedSyncRequestCompleted="PaginatedSyncRequestCompleted",e.SyncDidBeginProcessing="sync:did-begin-processing",e.DownloadFirstSyncCompleted="sync:download-first-completed",e.SyncTakingTooLong="sync:taking-too-long",e.SyncError="sync:error",e.InvalidSession="sync:invalid-session",e.MajorDataChange="major-data-change",e.LocalDataIncrementalLoad="local-data-incremental-load",e.LocalDataLoaded="local-data-loaded",e.EnterOutOfSync="enter-out-of-sync",e.ExitOutOfSync="exit-out-of-sync",e.StatusChanged="status-changed",e.DatabaseWriteError="database-write-error",e.DatabaseReadError="database-read-error",e.SyncRequestsIntegrityCheck="sync:requests-integrity-check",e.ReceivedRemoteSharedVaults="received-shared-vaults",e.ReceivedSharedVaultInvites="received-shared-vault-invites",e.ReceivedNotifications="received-user-events",e.ReceivedAsymmetricMessages="received-asymmetric-messages",e.TooManyRequests="too-many-requests"}(E||(E={}));var _=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class x extends f{constructor(e,t,n,r,i,o,s,a,l,c,u,d,h,p,f,g){super(g),this.encryption=e,this.mutator=t,this.sessions=n,this.sync=r,this.messageServer=i,this._createOrEditContact=o,this._findContact=s,this._replaceContactData=a,this._getTrustedPayload=l,this._getVault=c,this._handleRootKeyChangedMessage=u,this._getOutboundMessagesUseCase=d,this._getInboundMessagesUseCase=h,this._getUntrustedPayload=p,this._getKeyPairs=f,this.handledMessages=new Set}deinit(){super.deinit(),this.messageServer=void 0,this.encryption=void 0,this.mutator=void 0,this._createOrEditContact=void 0,this._findContact=void 0,this._replaceContactData=void 0,this._getTrustedPayload=void 0,this._getVault=void 0,this._handleRootKeyChangedMessage=void 0,this._getOutboundMessagesUseCase=void 0,this._getInboundMessagesUseCase=void 0,this._getUntrustedPayload=void 0}handleEvent(e){return _(this,void 0,void 0,(function*(){switch(e.type){case E.ReceivedAsymmetricMessages:this.handleRemoteReceivedAsymmetricMessages(e.payload);break;case s.MessageSentToUser:this.handleRemoteReceivedAsymmetricMessages([e.payload.message])}}))}getOutboundMessages(){return _(this,void 0,void 0,(function*(){return this._getOutboundMessagesUseCase.execute()}))}getInboundMessages(){return _(this,void 0,void 0,(function*(){return this._getInboundMessagesUseCase.execute()}))}downloadAndProcessInboundMessages(){return _(this,void 0,void 0,(function*(){const e=yield this.getInboundMessages();e.isFailed()||(yield this.handleRemoteReceivedAsymmetricMessages(e.getValue()))}))}sortServerMessages(e){const t=[I.AsymmetricMessagePayloadType.SenderKeypairChanged],n=[],r=[],i=e.slice().sort(((e,t)=>e.created_at_timestamp-t.created_at_timestamp)),o={};for(const e of i){const i=this.getServerMessageType(e);i&&(o[e.uuid]=i,t.includes(i)?n.push(e):r.push(e))}return[...n.sort(((e,n)=>{const r=o[e.uuid],i=o[n.uuid];return r!==i?t.indexOf(r)-t.indexOf(i):e.created_at_timestamp-n.created_at_timestamp})),...r.sort(((e,t)=>e.created_at_timestamp-t.created_at_timestamp))]}getServerMessageType(e){const t=this.getUntrustedMessagePayload(e);if(!t.isFailed())return t.getValue().type}handleRemoteReceivedAsymmetricMessages(e){return _(this,void 0,void 0,(function*(){if(0===e.length)return;const t=this.sortServerMessages(e);for(const e of t){const t=this.getTrustedMessagePayload(e);t.isFailed()||(yield this.handleTrustedMessageResult(e,t.getValue()))}this.sync.sync()}))}handleTrustedMessageResult(e,t){return _(this,void 0,void 0,(function*(){if(!this.handledMessages.has(e.uuid)){if(this.handledMessages.add(e.uuid),t.type===I.AsymmetricMessagePayloadType.ContactShare)yield this.handleTrustedContactShareMessage(e,t);else if(t.type===I.AsymmetricMessagePayloadType.SenderKeypairChanged)yield this.handleTrustedSenderKeypairChangedMessage(e,t);else if(t.type===I.AsymmetricMessagePayloadType.SharedVaultRootKeyChanged)yield this.handleTrustedSharedVaultRootKeyChangedMessage(e,t);else if(t.type===I.AsymmetricMessagePayloadType.SharedVaultMetadataChanged)yield this.handleTrustedVaultMetadataChangedMessage(e,t);else if(t.type===I.AsymmetricMessagePayloadType.SharedVaultInvite)throw new Error("Shared vault invites payloads are not handled as part of asymmetric messages");yield this.deleteMessageAfterProcessing(e)}}))}getUntrustedMessagePayload(e){const t=this._getKeyPairs.execute();if(t.isFailed())return b.Result.fail(t.getError());const n=this._getUntrustedPayload.execute({privateKey:t.getValue().encryption.privateKey,payload:e});return n.isFailed()?b.Result.fail(n.getError()):n}getTrustedMessagePayload(e){const t=this._findContact.execute({userUuid:e.sender_uuid});if(t.isFailed())return b.Result.fail(t.getError());const n=this._getKeyPairs.execute();if(n.isFailed())return b.Result.fail(n.getError());const r=this._getTrustedPayload.execute({privateKey:n.getValue().encryption.privateKey,sender:t.getValue(),ownUserUuid:this.sessions.userUuid,payload:e});return r.isFailed()?b.Result.fail(r.getError()):r}deleteMessageAfterProcessing(e){return _(this,void 0,void 0,(function*(){yield this.messageServer.deleteMessage({messageUuid:e.uuid})}))}handleTrustedVaultMetadataChangedMessage(e,t){return _(this,void 0,void 0,(function*(){const e=this._getVault.execute({sharedVaultUuid:t.data.sharedVaultUuid});e.isFailed()||(yield this.mutator.changeItem(e.getValue(),(e=>{e.name=t.data.name,e.description=t.data.description}),I.MutationType.UpdateUserTimestamps,I.PayloadEmitSource.RemoteRetrieved))}))}handleTrustedContactShareMessage(e,t){return _(this,void 0,void 0,(function*(){t.data.trustedContact.isMe||(yield this._replaceContactData.execute(t.data.trustedContact))}))}handleTrustedSenderKeypairChangedMessage(e,t){return _(this,void 0,void 0,(function*(){yield this._createOrEditContact.execute({contactUuid:e.sender_uuid,publicKey:t.data.newEncryptionPublicKey,signingPublicKey:t.data.newSigningPublicKey})}))}handleTrustedSharedVaultRootKeyChangedMessage(e,t){return _(this,void 0,void 0,(function*(){yield this._handleRootKeyChangedMessage.execute(t)}))}}class P{constructor(e){this.messageServer=e}execute(){return e=this,t=void 0,r=function*(){const e=yield this.messageServer.getMessages();return(0,a.isErrorResponse)(e)?b.Result.fail((0,a.getErrorFromErrorResponse)(e).message):b.Result.ok(e.data.messages)},new((n=void 0)||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}));var e,t,n,r}}class k{constructor(e){this.messageServer=e}execute(){return e=this,t=void 0,r=function*(){const e=yield this.messageServer.getOutboundUserMessages();return(0,a.isErrorResponse)(e)?b.Result.fail((0,a.getErrorFromErrorResponse)(e).message):b.Result.ok(e.data.messages)},new((n=void 0)||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}));var e,t,n,r}}class B{constructor(e){this.decryptMessage=e}execute(e){const t=this.decryptMessage.execute({message:e.payload.encrypted_message,sender:e.sender,privateKey:e.privateKey});return t.isFailed()?t:t.getValue().data.recipientUuid!==e.ownUserUuid?b.Result.fail("Message is not for this user"):t}}class O{constructor(e){this.decryptMessage=e}execute(e){return this.decryptMessage.execute({message:e.payload.encrypted_message,sender:void 0,privateKey:e.privateKey})}}class N{constructor(e,t,n,r){this.mutator=e,this.sync=t,this._getVault=n,this._decryptErroredPayloads=r}execute(e){return t=this,n=void 0,i=function*(){const t=e.data.rootKey;yield this.mutator.createItem(b.ContentType.TYPES.KeySystemRootKey,(0,I.FillItemContent)(t),!0);const n=this._getVault.execute({keySystemIdentifier:t.systemIdentifier});n.isFailed()||(yield this.mutator.changeItem(n.getValue(),(e=>{e.rootKeyParams=t.keyParams}))),yield this._decryptErroredPayloads.execute(),this.sync.sync({sourceDescription:"Not awaiting due to this event handler running from sync response"})},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class D{constructor(e,t,n){this.mutator=e,this.sync=t,this._createOrEditContact=n}execute(e,t,n){return r=this,i=void 0,s=function*(){const{rootKey:r,trustedContacts:i,metadata:o}=e.data,s={systemIdentifier:r.systemIdentifier,rootKeyParams:r.keyParams,keyStorageMode:I.KeySystemRootKeyStorageMode.Synced,name:o.name,description:o.description,iconString:o.iconString,sharing:{sharedVaultUuid:t,ownerUserUuid:n,fileBytesUsed:o.fileBytesUsed,designatedSurvivor:o.designatedSurvivor}};yield this.mutator.createItem(b.ContentType.TYPES.KeySystemRootKey,(0,I.FillItemContent)(r),!0),yield this.mutator.createItem(b.ContentType.TYPES.VaultListing,(0,I.FillItemContentSpecialized)(s),!0);for(const e of i)yield this._createOrEditContact.execute({name:e.name,contactUuid:e.contactUuid,publicKey:e.publicKeySet.encryption,signingPublicKey:e.publicKeySet.signing});this.sync.sync({sourceDescription:"Not awaiting due to this event handler running from sync response"})},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(n,a)}l((s=s.apply(r,i||[])).next())}));var r,i,o,s}}class j{constructor(e,t,n,r){this.resendMessage=e,this.decryptOwnMessage=t,this.messageServer=n,this.findContact=r}messagesToExcludeFromResending(){return[I.AsymmetricMessagePayloadType.SenderKeypairChanged]}execute(e){var t,n,r,i,o,s;return r=this,i=void 0,s=function*(){const r=yield this.messageServer.getOutboundUserMessages();if((0,a.isErrorResponse)(r))return b.Result.fail("Failed to get outbound user messages");const i=[];for(const o of r.data.messages){const r=this.findContact.execute({userUuid:o.recipient_uuid});if(r.isFailed()){i.push("Contact not found for invite ".concat(o.recipient_uuid));continue}const s=this.decryptOwnMessage.execute({message:o.encrypted_message,privateKey:null!==(n=null===(t=e.previousKeys)||void 0===t?void 0:t.encryption.privateKey)&&void 0!==n?n:e.keys.encryption.privateKey,recipientPublicKey:r.getValue().publicKeySet.encryption});if(s.isFailed()){i.push("Failed to decrypt message ".concat(o.uuid));continue}const a=s.getValue();this.messagesToExcludeFromResending().includes(a.type)||(yield this.resendMessage.execute({keys:e.keys,previousKeys:e.previousKeys,decryptedMessage:a,rawMessage:o,recipient:r.getValue()}),yield this.messageServer.deleteMessage({messageUuid:o.uuid}))}return i.length>0?b.Result.fail(i.join(", ")):b.Result.ok()},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(n,a)}l((s=s.apply(r,i||[])).next())}))}}class T{constructor(e,t){this.sendMessage=e,this.encryptMessage=t}execute(e){return t=this,n=void 0,i=function*(){const t=this.encryptMessage.execute({message:e.decryptedMessage,keys:e.keys,recipientPublicKey:e.recipient.publicKeySet.encryption});return t.isFailed()?b.Result.fail(t.getError()):yield this.sendMessage.execute({recipientUuid:e.recipient.contactUuid,encryptedMessage:t.getValue(),replaceabilityIdentifier:e.rawMessage.replaceability_identifier||void 0})},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class M{constructor(e){this.messageServer=e}execute(e){return t=this,n=void 0,i=function*(){const t=yield this.messageServer.createMessage({recipientUuid:e.recipientUuid,encryptedMessage:e.encryptedMessage,replaceabilityIdentifier:e.replaceabilityIdentifier});return(0,a.isErrorResponse)(t)?b.Result.fail((0,a.getErrorFromErrorResponse)(t).message):b.Result.ok(t.data.message)},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}var F=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class R extends f{constructor(e,t){super(t),this.authApiService=e,this.internalEventBus=t}generateRecoveryCodes(){return F(this,void 0,void 0,(function*(){try{const e=yield this.authApiService.generateRecoveryCodes();return!(0,a.isErrorResponse)(e)&&e.data.recoveryCodes}catch(e){return!1}}))}recoveryKeyParams(e){return F(this,void 0,void 0,(function*(){try{const t=yield this.authApiService.recoveryKeyParams(e);return!(0,a.isErrorResponse)(t)&&t.data.keyParams}catch(e){return!1}}))}signInWithRecoveryCodes(e){return F(this,void 0,void 0,(function*(){try{const t=yield this.authApiService.signInWithRecoveryCodes(e),n=(0,a.getCaptchaHeader)(t);return n?{success:!1,captchaURL:n}:(0,a.isErrorResponse)(t)?{success:!1,captchaURL:""}:{success:!0,keyParams:t.data.key_params,session:t.data.session,user:t.data.user}}catch(e){return{success:!1,captchaURL:""}}}))}}var L,Q=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class U extends f{constructor(e,t,n){super(n),this.authenticatorApiService=e,this.preferencesService=t,this.internalEventBus=n}list(){return Q(this,void 0,void 0,(function*(){try{const e=yield this.authenticatorApiService.list();if((0,a.isErrorResponse)(e))return[];const t=this.getAuthenticatorNamesFromPreferences();return e.data.authenticators.map((e=>({id:e.id,name:t.has(e.id)?t.get(e.id):"Security Key"})))}catch(e){return[]}}))}delete(e){return Q(this,void 0,void 0,(function*(){try{const t=yield this.authenticatorApiService.delete(e.value);if((0,a.isErrorResponse)(t))return!1;const n=this.getAuthenticatorNamesFromPreferences();return n.delete(e.value),yield this.preferencesService.setValue(I.PrefKey.AuthenticatorNames,JSON.stringify([...n])),!0}catch(e){return!1}}))}generateRegistrationOptions(){return Q(this,void 0,void 0,(function*(){try{const e=yield this.authenticatorApiService.generateRegistrationOptions();return(0,a.isErrorResponse)(e)?null:e.data.options}catch(e){return null}}))}verifyRegistrationResponse(e,t,n){return Q(this,void 0,void 0,(function*(){try{const r=yield this.authenticatorApiService.verifyRegistrationResponse(e.value,t,n);if((0,a.isErrorResponse)(r))return!1;const i=this.getAuthenticatorNamesFromPreferences();return i.set(r.data.id,t),yield this.preferencesService.setValue(I.PrefKey.AuthenticatorNames,JSON.stringify([...i])),!0}catch(e){return!1}}))}generateAuthenticationOptions(e){return Q(this,void 0,void 0,(function*(){try{const t=yield this.authenticatorApiService.generateAuthenticationOptions(e.value);return(0,a.isErrorResponse)(t)?null:t.data.options}catch(e){return null}}))}getAuthenticatorNamesFromPreferences(){let e=new Map;const t=this.preferencesService.getValue(I.PrefKey.AuthenticatorNames);if(void 0!==t)try{e=new Map(JSON.parse(t))}catch(t){e=new Map}return e}}!function(e){e.SignedIn="Application:SignedIn",e.SignedOut="Application:SignedOut",e.CompletedFullSync="Application:CompletedFullSync",e.FailedSync="Application:FailedSync",e.HighLatencySync="Application:HighLatencySync",e.EnteredOutOfSync="Application:EnteredOutOfSync",e.ExitedOutOfSync="Application:ExitedOutOfSync",e.ApplicationStageChanged="Application:ApplicationStageChanged",e.Started="Application:Started",e.Launched="Application:Launched",e.LocalDataLoaded="Application:LocalDataLoaded",e.KeyStatusChanged="Application:KeyStatusChanged",e.MajorDataChange="Application:MajorDataChange",e.CompletedRestart="Application:CompletedRestart",e.LocalDataIncrementalLoad="Application:LocalDataIncrementalLoad",e.SyncStatusChanged="Application:SyncStatusChanged",e.WillSync="Application:WillSync",e.InvalidSyncSession="Application:InvalidSyncSession",e.LocalDatabaseReadError="Application:LocalDatabaseReadError",e.LocalDatabaseWriteError="Application:LocalDatabaseWriteError",e.CompletedIncrementalSync="Application:CompletedIncrementalSync",e.MigrationsLoaded="Application:MigrationsLoaded",e.StorageReady="Application:StorageReady",e.PreferencesChanged="Application:PreferencesChanged",e.LocalPreferencesChanged="Application:LocalPreferencesChanged",e.UnprotectedSessionBegan="Application:UnprotectedSessionBegan",e.UserRolesChanged="Application:UserRolesChanged",e.FeaturesAvailabilityChanged="Application:FeaturesAvailabilityChanged",e.UnprotectedSessionExpired="Application:UnprotectedSessionExpired",e.CompletedInitialSync="Application:CompletedInitialSync",e.DidPurchaseSubscription="Application:DidPurchaseSubscription",e.SyncTooManyRequests="Application:SyncTooManyRequests"}(L||(L={}));var V=n(80215),K=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};const H="Plaintext Backups",G="Text Backups",Y="File Backups";class z extends f{constructor(e,t,n,r,i,o,s,a,l,c,u,d){super(d),this.items=e,this.api=t,this.encryptor=n,this.device=r,this.status=i,this.crypto=o,this.storage=s,this.session=a,this.payloads=l,this.history=c,this.directory=u,this.internalEventBus=d,this.pendingFiles=new Set,this.filesObserverDisposer=e.addObserver(b.ContentType.TYPES.File,(e=>{let{changed:t,inserted:n,source:r}=e;[I.PayloadEmitSource.LocalDatabaseLoaded,I.PayloadEmitSource.RemoteSaved,I.PayloadEmitSource.RemoteRetrieved].includes(r)&&this.handleChangedFiles([...t,...n])}));const h=[I.PayloadEmitSource.RemoteSaved,I.PayloadEmitSource.RemoteRetrieved,I.PayloadEmitSource.OfflineSyncSaved];this.notesObserverDisposer=e.addObserver(b.ContentType.TYPES.Note,(e=>{let{changed:t,inserted:n,source:r}=e;h.includes(r)&&this.handleChangedNotes([...t,...n])})),this.tagsObserverDisposer=e.addObserver(b.ContentType.TYPES.Tag,(e=>{let{changed:t,inserted:n,source:r}=e;h.includes(r)&&this.handleChangedTags([...t,...n])}))}handleEvent(e){return K(this,void 0,void 0,(function*(){e.type===L.ApplicationStageChanged&&e.payload.stage===y.Launched_10&&this.automaticallyEnableTextBackupsIfPreferenceNotSet()}))}setSuperConverter(e){this.markdownConverter=e}importWatchedDirectoryChanges(e){return K(this,void 0,void 0,(function*(){for(const t of e){const e=this.items.findItem(t.itemUuid);if(!e)continue;if(!(0,I.isNote)(e))continue;const n=Object.assign(Object.assign({},e.payload.content),{preview_html:void 0,preview_plain:void 0,text:t.content}),r=e.payload.copy({content:n});yield this.payloads.importPayloads([r],this.history.getHistoryMapCopy())}}))}deinit(){super.deinit(),this.filesObserverDisposer(),this.notesObserverDisposer(),this.tagsObserverDisposer(),this.items=void 0,this.api=void 0,this.encryptor=void 0,this.device=void 0,this.status=void 0,this.crypto=void 0,this.storage=void 0,this.session=void 0}automaticallyEnableTextBackupsIfPreferenceNotSet(){return K(this,void 0,void 0,(function*(){if(null!=this.storage.getValue(d.TextBackupsEnabled))return;this.storage.setValue(d.TextBackupsEnabled,!0);const e=yield this.device.getUserDocumentsDirectory();if(!e)return;const t=yield this.device.joinPaths(e,yield this.prependWorkspacePathForPath(G));this.storage.setValue(d.TextBackupsLocation,t)}))}openAllDirectoriesContainingBackupFiles(){const e=this.getFilesBackupsLocation(),t=this.getPlaintextBackupsLocation(),n=this.getTextBackupsLocation();e&&this.directory.openLocation(e),t&&this.directory.openLocation(t),n&&this.directory.openLocation(n)}isFilesBackupsEnabled(){return this.storage.getValue(d.FileBackupsEnabled,void 0,!1)}getFilesBackupsLocation(){return this.storage.getValue(d.FileBackupsLocation)}isTextBackupsEnabled(){return this.storage.getValue(d.TextBackupsEnabled,void 0,!0)}prependWorkspacePathForPath(e){return K(this,void 0,void 0,(function*(){const t=this.session.getWorkspaceDisplayIdentifier();return this.device.joinPaths(t,e)}))}enableTextBackups(){return K(this,void 0,void 0,(function*(){let e=this.getTextBackupsLocation();(e||(e=yield this.directory.presentDirectoryPickerForLocationChangeAndTransferOld(yield this.prependWorkspacePathForPath(G)),e))&&(this.storage.setValue(d.TextBackupsEnabled,!0),this.storage.setValue(d.TextBackupsLocation,e))}))}disableTextBackups(){this.storage.setValue(d.TextBackupsEnabled,!1)}getTextBackupsLocation(){return this.storage.getValue(d.TextBackupsLocation)}openTextBackupsLocation(){return K(this,void 0,void 0,(function*(){const e=this.getTextBackupsLocation();e&&this.directory.openLocation(e)}))}changeTextBackupsLocation(){return K(this,void 0,void 0,(function*(){const e=this.getTextBackupsLocation(),t=yield this.directory.presentDirectoryPickerForLocationChangeAndTransferOld(yield this.prependWorkspacePathForPath(G),e);if(t)return this.storage.setValue(d.TextBackupsLocation,t),t}))}saveTextBackupData(e){return K(this,void 0,void 0,(function*(){const t=this.getTextBackupsLocation();if(t)return this.device.saveTextBackupData(t,e)}))}isPlaintextBackupsEnabled(){return this.storage.getValue(d.PlaintextBackupsEnabled,void 0,!1)}enablePlaintextBackups(){return K(this,void 0,void 0,(function*(){let e=this.getPlaintextBackupsLocation();(e||(e=yield this.directory.presentDirectoryPickerForLocationChangeAndTransferOld(yield this.prependWorkspacePathForPath(H)),e))&&(this.storage.setValue(d.PlaintextBackupsEnabled,!0),this.storage.setValue(d.PlaintextBackupsLocation,e),this.handleChangedNotes(this.items.getItems(b.ContentType.TYPES.Note)))}))}disablePlaintextBackups(){this.storage.setValue(d.PlaintextBackupsEnabled,!1),this.storage.setValue(d.PlaintextBackupsLocation,void 0)}getPlaintextBackupsLocation(){return this.storage.getValue(d.PlaintextBackupsLocation)}openPlaintextBackupsLocation(){return K(this,void 0,void 0,(function*(){const e=this.getPlaintextBackupsLocation();e&&this.directory.openLocation(e)}))}changePlaintextBackupsLocation(){return K(this,void 0,void 0,(function*(){const e=this.getPlaintextBackupsLocation(),t=yield this.directory.presentDirectoryPickerForLocationChangeAndTransferOld(yield this.prependWorkspacePathForPath(H),e);if(t)return this.storage.setValue(d.PlaintextBackupsLocation,t),t}))}enableFilesBackups(){return K(this,void 0,void 0,(function*(){let e=this.getFilesBackupsLocation();(e||(e=yield this.directory.presentDirectoryPickerForLocationChangeAndTransferOld(yield this.prependWorkspacePathForPath(Y)),e))&&(this.storage.setValue(d.FileBackupsEnabled,!0),this.storage.setValue(d.FileBackupsLocation,e),this.backupAllFiles())}))}backupAllFiles(){const e=this.items.getItems(b.ContentType.TYPES.File);this.handleChangedFiles(e)}disableFilesBackups(){this.storage.setValue(d.FileBackupsEnabled,!1)}changeFilesBackupsLocation(){return K(this,void 0,void 0,(function*(){const e=this.getFilesBackupsLocation(),t=yield this.directory.presentDirectoryPickerForLocationChangeAndTransferOld(yield this.prependWorkspacePathForPath(Y),e);if(t)return this.storage.setValue(d.FileBackupsLocation,t),t}))}openFilesBackupsLocation(){return K(this,void 0,void 0,(function*(){const e=this.getFilesBackupsLocation();e&&this.directory.openLocation(e)}))}getBackupsMappingFromDisk(){return K(this,void 0,void 0,(function*(){const e=this.getFilesBackupsLocation();if(!e)return;const t=(yield this.device.getFilesBackupsMappingFile(e)).files;return this.mappingCache=t,t}))}invalidateMappingCache(){this.mappingCache=void 0}getBackupsMappingFromCache(){var e;return K(this,void 0,void 0,(function*(){return null!==(e=this.mappingCache)&&void 0!==e?e:yield this.getBackupsMappingFromDisk()}))}getFileBackupInfo(e){return K(this,void 0,void 0,(function*(){const t=yield this.getBackupsMappingFromCache();if(t)return t[e.uuid]}))}getFileBackupAbsolutePath(e){const t=this.getFilesBackupsLocation();if(!t)throw new a.ClientDisplayableError("No files backups location set");return this.device.joinPaths(t,e.relativePath)}openFileBackup(e){return K(this,void 0,void 0,(function*(){const t=yield this.getFileBackupAbsolutePath(e);yield this.directory.openLocation(t)}))}handleChangedFiles(e){return K(this,void 0,void 0,(function*(){if(0===e.length||!this.isFilesBackupsEnabled())return;const t=yield this.getBackupsMappingFromDisk();if(!t)throw new a.ClientDisplayableError("No backups mapping found");for(const n of e)this.pendingFiles.has(n.uuid)||null==t[n.uuid]&&(this.pendingFiles.add(n.uuid),yield this.performBackupOperation(n),this.pendingFiles.delete(n.uuid));this.invalidateMappingCache()}))}handleChangedNotes(e){return K(this,void 0,void 0,(function*(){if(0===e.length||!this.isPlaintextBackupsEnabled())return;const t=this.getPlaintextBackupsLocation();if(!t)throw new a.ClientDisplayableError("No plaintext backups location found");if(!this.markdownConverter)throw"Super markdown converter not initialized";for(const n of e){const e=this.items.getSortedTagsForItem(n).map((e=>this.items.getTagLongTitle(e))),r=n.noteType===V.NoteType.Super?yield this.markdownConverter.convertSuperStringToOtherFormat(n.text,"md"):n.text;yield this.device.savePlaintextNoteBackup(t,n.uuid,n.title,e,r)}yield this.device.persistPlaintextBackupsMappingFile(t)}))}handleChangedTags(e){return K(this,void 0,void 0,(function*(){if(0!==e.length&&this.isPlaintextBackupsEnabled())for(const t of e){const e=this.items.referencesForItem(t,b.ContentType.TYPES.Note);yield this.handleChangedNotes(e)}}))}readEncryptedFileFromBackup(e,t){return K(this,void 0,void 0,(function*(){const n=yield this.getFileBackupInfo({uuid:e});if(!n)return"failed";const r=this.getFilesBackupsLocation();if(!r)return"failed";const i=yield this.device.joinPaths(r,n.relativePath,n.binaryFileName),o=yield this.device.getFileBackupReadToken(i);let s=!0,a=0;for(;s;){const{chunk:e,isLast:n,progress:r}=yield this.device.readNextChunk(o);yield t({data:e,index:a,isLast:n,progress:r}),s=!n,a++}return"success"}))}performBackupOperation(e){return K(this,void 0,void 0,(function*(){const t=this.getFilesBackupsLocation();if(!t)return"failed";const n=this.status.addMessage("Backing up file ".concat(e.name,"...")),r=yield this.encryptor.encryptSplitSingle({usesItemsKeyWithKeyLookup:{items:[e.payload]}}),i=this.items.getDisplayableItemsKeys().find((e=>e.uuid===r.items_key_id));if(!i)return this.status.removeMessage(n),"failed";const o=yield this.encryptor.encryptSplitSingle({usesRootKeyWithKeyLookup:{items:[i.payload]}}),s=yield this.api.createUserFileValetToken(e.remoteIdentifier,a.ValetTokenOperation.Read);if(s instanceof a.ClientDisplayableError)return this.status.removeMessage(n),"failed";const l={info:{warning:"Do not edit this file.",information:"The file and key data below is encrypted with your account password.",instructions:"Drag and drop this metadata file into the File Backups preferences pane in the Standard Notes desktop or web application interface."},file:(0,I.CreateEncryptedBackupFileContextPayload)(r.ejected()),itemsKey:(0,I.CreateEncryptedBackupFileContextPayload)(o.ejected()),version:"1.0.0"},c=JSON.stringify(l,null,2),u=e.user_uuid&&e.user_uuid!==this.session.getSureUser().uuid?"shared-vault":"user",d=yield this.device.saveFilesBackupsFile(t,e.uuid,c,{chunkSizes:e.encryptedChunkSizes,url:this.api.getFilesDownloadUrl(u),valetToken:s});if(this.status.removeMessage(n),"failed"===d){const t=this.status.addMessage("Failed to back up ".concat(e.name,"..."));setTimeout((()=>{this.status.removeMessage(t)}),2e3)}return d}))}disabledExperimental_monitorPlaintextBackups(){const e=this.getPlaintextBackupsLocation();e&&this.device.monitorPlaintextBackupsLocationForChanges(e)}}const Z="A server error occurred while trying to sign in. Please try again.",W="A server error occurred while trying to register. Please try again.",q="Something went wrong while changing your credentials. Your credentials were not changed. Please try again.",J="Could not connect to server.",X={DeleteAccountError:"Your account was unable to be deleted due to an error. Please try your request again."},$="Could not check your data integrity with the server.",ee="Could not retrieve item.",te="An existing registration request is already in progress.",ne="An existing sign in request is already in progress.",re="An existing change credentials request is already in progress.",ie="Invalid email or password.",oe="A server error occurred while trying to refresh your session. Please try again.",se="Your account session is being renewed with the server. Please try your request again.",ae="Too many successive server requests. Please wait a few minutes and try again.",le="Please sign in to an account in order to continue with your request.",ce="Failed to get settings.",ue="Failed to update settings.",de="Unable to register for Listed. Please try again later.",he="Failed to create file token.",pe="Failed to get subscription's information.",fe="Failed to access purchase flow.",ge="Failed to get offline features.",me="The extension you are attempting to install comes from an\n  untrusted source. Untrusted extensions may lower the security of your data. Do you want to continue?",ye="Error downloading package details. Please check the\n  extension link and try again.",ve="An unknown issue occurred during offline activation. Please download your activation code again and try once more.",Ae="Invalid extension URL.",be="This version of the application does not support your newer account type. Please upgrade to the latest version of Standard Notes to sign in.",we="The protocol version associated with your account is outdated and no longer supported by this application. Please visit standardnotes.com/help/security for more information.",Se="Your account was created on a platform with higher security capabilities than this browser supports. If we attempted to generate your login keys here, it would take hours. Please use a browser with more up to date security capabilities, like Google Chrome or Firefox, to log in.",Ce="Unable to sign in due to insecure password parameters. Please visit standardnotes.com/help/security for more information.",Ee="Invalid password.",Ie="Sign In",_e="Upgrading your account's encryption version…",xe="Setting passcode…",Pe="Changing passcode…",ke="Removing passcode…",Be="Do not close the application until this process completes.",Oe="Unknown error.";function Ne(e){return"Your password must be at least ".concat(e," characters in length. For your security, please choose a longer password or, ideally, a passphrase, and try again.")}function De(e,t){return"Strict Sign In has refused the server's sign-in parameters. The latest account version is ".concat(t,", but the server is reporting a version of ").concat(e," for your account. If you'd like to proceed with sign in anyway, please disable Strict Sign In and try again.")}const je={PasscodeRequired:"Your passcode is required to process your credentials change.",Failed:"Unable to change your credentials due to a sync error. Please try again."},Te={PasscodeRequired:"Your passcode is required in order to register for an account."},Me={PasscodeRequired:"Your passcode is required in order to sign in to your account.",IncorrectMfa:"Incorrect two-factor authentication code. Please try again.",SignInCanceledMissingMfa:"Your sign in request has been canceled."},Fe={SuccessAccount:"Your encryption version has been successfully upgraded. You may be asked to enter your credentials again on other devices you're signed into.",SuccessPasscodeOnly:"Your encryption version has been successfully upgraded.",Fail:"Unable to upgrade encryption version. Please try again.",UpgradingPasscode:"Upgrading local encryption..."},Re={Generic:"Authentication Required",Migration:"Storage Update"},Le={EnterEmailAndPassword:"Please enter your account email and password.",RecoverSession:e=>e?"Your credentials are needed for ".concat(e," to refresh your session with the server."):"Your credentials are needed to refresh your session with the server.",SessionRestored:"Your session has been successfully restored.",EnterMfa:"Please enter your two-factor authentication code.",InputU2FDevice:"Please authenticate with your hardware security key.",MfaInputPlaceholder:"Two-factor authentication code",EmailInputPlaceholder:"Email",PasswordInputPlaceholder:"Password",KeychainRecoveryErrorTitle:"Invalid Credentials",KeychainRecoveryError:"The email or password you entered is incorrect.\n\nPlease note that this sign-in request is made against the default server. If you are using a custom server, you must uninstall the app then reinstall, and sign back into your account.",RevokeTitle:"Revoke this session?",RevokeConfirmButton:"Revoke",RevokeCancelButton:"Cancel",RevokeText:"The associated app will be signed out and all data removed from the device when it is next launched. You can sign back in on that device at any time.",CurrentSessionRevoked:"Your session has been revoked and all local data has been removed from this device."},Qe={UnlockApplication:"Authentication is required to unlock the application",NoteAccess:"Authentication is required to view this note",FileAccess:"Authentication is required to access this file",ImportFile:"Authentication is required to import a backup file",AddPasscode:"Authentication is required to add a passcode",RemovePasscode:"Authentication is required to remove your passcode",ChangePasscode:"Authentication is required to change your passcode",ChangeAutolockInterval:"Authentication is required to change autolock timer duration",RevokeSession:"Authentication is required to revoke a session",EnterAccountPassword:"Enter your account password",EnterLocalPasscode:"Enter your application passcode",EnterPasscodeForMigration:"Your application passcode is required to perform an upgrade of your local data storage structure.",EnterPasscodeForRootResave:"Enter your application passcode to continue",EnterCredentialsForProtocolUpgrade:"Enter your credentials to perform encryption upgrade",EnterCredentialsForDecryptedBackupDownload:"Enter your credentials to download a decrypted backup",AccountPasswordPlaceholder:"Account Password",LocalPasscodePlaceholder:"Application Passcode",DecryptEncryptedFile:"Enter the account password associated with the import file",ExportBackup:"Authentication is required to export a backup",DisableBiometrics:"Authentication is required to disable biometrics",UnprotectNote:"Authentication is required to unprotect a note",UnprotectFile:"Authentication is required to unprotect a file",SearchProtectedNotesText:"Authentication is required to search protected contents",SelectProtectedNote:"Authentication is required to select a protected note",DisableMfa:"Authentication is required to disable two-factor authentication",DeleteAccount:"Authentication is required to delete your account",ListedAuthorization:"Authentication is required to approve this note for Listed",UnlockVault:e=>"Unlock ".concat(e),DeleteVault:e=>"Delete ".concat(e),EnterVaultPassword:"Enter the password for this vault"},Ue={MissingSessionTitle:"Missing Session",MissingSessionBody:"We were unable to load your server session. This represents an inconsistency with your application state. Please take an opportunity to backup your data, then sign out and sign back in to resolve this issue.",StorageDecryptErrorTitle:"Storage Error",StorageDecryptErrorBody:"We were unable to decrypt your local storage. Please restart the app and try again. If you're unable to resolve this issue, and you have an account, you may try uninstalling the app then reinstalling, then signing back into your account. Otherwise, please contact help@standardnotes.com for support."},Ve={Title:"Restore Keychain",Text:e=>"We've detected that your keychain has been wiped. This can happen when restoring your device from a backup. Please enter your account password for \"".concat(e,'" to restore your account keys.')};var Ke,He;!function(e){e[e.AccessProtectedFile=0]="AccessProtectedFile",e[e.AccessProtectedNote=1]="AccessProtectedNote",e[e.AddPasscode=2]="AddPasscode",e[e.ApplicationUnlock=3]="ApplicationUnlock",e[e.ChangeAutolockInterval=4]="ChangeAutolockInterval",e[e.ChangePasscode=5]="ChangePasscode",e[e.CreateDecryptedBackupWithProtectedItems=6]="CreateDecryptedBackupWithProtectedItems",e[e.Custom=7]="Custom",e[e.DecryptEncryptedFile=8]="DecryptEncryptedFile",e[e.DisableBiometrics=9]="DisableBiometrics",e[e.DisableMfa=10]="DisableMfa",e[e.ExportBackup=11]="ExportBackup",e[e.ImportFile=12]="ImportFile",e[e.Migration=13]="Migration",e[e.ProtocolUpgrade=14]="ProtocolUpgrade",e[e.RemovePasscode=15]="RemovePasscode",e[e.ResaveRootKey=16]="ResaveRootKey",e[e.RevokeSession=17]="RevokeSession",e[e.SearchProtectedNotesText=18]="SearchProtectedNotesText",e[e.SelectProtectedNote=19]="SelectProtectedNote",e[e.UnprotectFile=20]="UnprotectFile",e[e.UnprotectNote=21]="UnprotectNote",e[e.DeleteAccount=22]="DeleteAccount",e[e.AuthorizeNoteForListed=23]="AuthorizeNoteForListed"}(Ke||(Ke={}));class Ge{constructor(e,t,n,r,i){this.prompts=e,this.reason=t,this.cancelable=n,this._heading=r,this._subheading=i,this.id=Math.random()}get modalTitle(){return this.reason===Ke.Migration?Re.Migration:Re.Generic}get heading(){if(this._heading)return this._heading;switch(this.reason){case Ke.ApplicationUnlock:return Qe.UnlockApplication;case Ke.Migration:return Qe.EnterLocalPasscode;case Ke.ResaveRootKey:return Qe.EnterPasscodeForRootResave;case Ke.ProtocolUpgrade:return Qe.EnterCredentialsForProtocolUpgrade;case Ke.AccessProtectedNote:return Qe.NoteAccess;case Ke.AccessProtectedFile:return Qe.FileAccess;case Ke.ImportFile:return Qe.ImportFile;case Ke.AddPasscode:return Qe.AddPasscode;case Ke.RemovePasscode:return Qe.RemovePasscode;case Ke.ChangePasscode:return Qe.ChangePasscode;case Ke.ChangeAutolockInterval:return Qe.ChangeAutolockInterval;case Ke.CreateDecryptedBackupWithProtectedItems:return Qe.EnterCredentialsForDecryptedBackupDownload;case Ke.RevokeSession:return Qe.RevokeSession;case Ke.DecryptEncryptedFile:return Qe.DecryptEncryptedFile;case Ke.ExportBackup:return Qe.ExportBackup;case Ke.DisableBiometrics:return Qe.DisableBiometrics;case Ke.UnprotectNote:return Qe.UnprotectNote;case Ke.UnprotectFile:return Qe.UnprotectFile;case Ke.SearchProtectedNotesText:return Qe.SearchProtectedNotesText;case Ke.SelectProtectedNote:return Qe.SelectProtectedNote;case Ke.DisableMfa:return Qe.DisableMfa;case Ke.DeleteAccount:return Qe.DeleteAccount;case Ke.AuthorizeNoteForListed:return Qe.ListedAuthorization;case Ke.Custom:return"";default:return(0,c.assertUnreachable)(this.reason)}}get subheading(){return this._subheading?this._subheading:this.reason===Ke.Migration?Qe.EnterPasscodeForMigration:void 0}hasPromptForValidationType(e){for(const t of this.prompts)if(t.validation===e)return!0;return!1}}!function(e){e[e.None=0]="None",e[e.LocalPasscode=1]="LocalPasscode",e[e.AccountPassword=2]="AccountPassword",e[e.Biometric=3]="Biometric",e[e.ProtectionSessionDuration=4]="ProtectionSessionDuration",e[e.Authenticator=5]="Authenticator"}(He||(He={}));const Ye={AccountPassword:"Account Password",LocalPasscode:"Application Passcode",Biometrics:"Biometrics",RememberFor:"Remember For",Mfa:"Two-factor Authentication Code",U2F:"Security Key"};class ze{constructor(e,t,n){let r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0;switch(this.validation=e,this.secureTextEntry=r,this.keyboardType=i,this.initialValue=o,this.contextData=s,this.id=Math.random(),this.validation){case He.AccountPassword:this.title=null!=t?t:Ye.AccountPassword,this.placeholder=null!=n?n:Ye.AccountPassword,this.validates=!0;break;case He.LocalPasscode:this.title=null!=t?t:Ye.LocalPasscode,this.placeholder=null!=n?n:Ye.LocalPasscode,this.validates=!0;break;case He.Biometric:this.title=null!=t?t:Ye.Biometrics,this.placeholder=null!=n?n:"",this.validates=!0;break;case He.Authenticator:this.title=null!=t?t:Ye.U2F,this.placeholder=null!=n?n:"",this.validates=!0;break;case He.ProtectionSessionDuration:this.title=null!=t?t:Ye.RememberFor,this.placeholder=null!=n?n:"",this.validates=!0;break;case He.None:this.title=null!=t?t:"",this.placeholder=null!=n?n:"",this.validates=!1;break;default:(0,c.assertUnreachable)(this.validation)}Object.freeze(this)}}var Ze,We;function qe(e,t){return{prompt:e,value:t}}function Je(e){return"readonlyItem"in e}!function(e){e.Alphanumeric="default",e.Numeric="numeric"}(Ze||(Ze={})),function(e){e.OfflineRestricted="OfflineRestricted",e.MissingUrl="MissingUrl"}(We||(We={}));var Xe,$e,et=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class tt extends f{constructor(e,t,n,r,i,o,s,a,l,c,u,d,h,p){super(p),this.sync=e,this.mutator=t,this.session=n,this.crypto=r,this.user=i,this.selfContactManager=o,this.encryption=s,this._deleteContact=a,this._findContact=l,this._getAllContacts=c,this._createOrEditContact=u,this._editContact=d,this._validateItemSigner=h}deinit(){super.deinit(),this.sync=void 0,this.mutator=void 0,this.session=void 0,this.crypto=void 0,this.user=void 0,this.selfContactManager=void 0,this.encryption=void 0,this._findContact=void 0,this._getAllContacts=void 0,this._createOrEditContact=void 0,this._editContact=void 0,this._validateItemSigner=void 0}getSelfContact(){return this.selfContactManager.selfContact}isCollaborationEnabled(){return!this.session.isUserMissingKeyPair()}enableCollaboration(){return et(this,void 0,void 0,(function*(){yield this.user.updateAccountWithFirstTimeKeyPair()}))}getCollaborationID(){const e=this.session.getPublicKey();if(!e)throw new Error("Collaboration not enabled");return this.buildCollaborationId({version:"1",userUuid:this.session.getSureUser().uuid,publicKey:e,signingPublicKey:this.session.getSigningPublicKey()})}buildCollaborationId(e){const t="".concat(e.version,":").concat(e.userUuid,":").concat(e.publicKey,":").concat(e.signingPublicKey);return this.crypto.base64Encode(t)}parseCollaborationID(e){const t=this.crypto.base64Decode(e),[n,r,i,o]=t.split(":");return{version:n,userUuid:r,publicKey:i,signingPublicKey:o}}getCollaborationIDFromInvite(e){const t=this.encryption.getSenderPublicKeySetFromAsymmetricallyEncryptedString(e.encrypted_message);return this.buildCollaborationId({version:"1",userUuid:e.sender_uuid,publicKey:t.encryption,signingPublicKey:t.signing})}addTrustedContactFromCollaborationID(e,t){const{userUuid:n,publicKey:r,signingPublicKey:i}=this.parseCollaborationID(e);if(n===this.user.getUserUuid())throw new a.ClientDisplayableError("You cannot add yourself as a trusted contact");return this.createOrEditTrustedContact({name:null!=t?t:"",contactUuid:n,publicKey:r,signingPublicKey:i})}editTrustedContactFromCollaborationID(e,t){return et(this,void 0,void 0,(function*(){const{publicKey:n,signingPublicKey:r,userUuid:i}=this.parseCollaborationID(t.collaborationID);if(i!==e.contactUuid)throw new Error("Collaboration ID's user uuid does not match contact UUID");const o=yield this.mutator.changeItem(e,(i=>{i.name=t.name,n===e.publicKeySet.encryption&&r===e.publicKeySet.signing||i.addPublicKey({encryption:n,signing:r})}));return yield this.sync.sync(),o}))}updateTrustedContact(e,t){return et(this,void 0,void 0,(function*(){const n=yield this._editContact.execute(e,t);return this.sync.sync(),n}))}createOrEditTrustedContact(e){return et(this,void 0,void 0,(function*(){const t=yield this._createOrEditContact.execute(e);return this.sync.sync(),t}))}deleteContact(e){return et(this,void 0,void 0,(function*(){return this._deleteContact.execute({contact:e,ownUserUuid:this.session.userUuid})}))}getAllContacts(){return this._getAllContacts.execute().getValue()}findContact(e){const t=this._findContact.execute({userUuid:e});if(!t.isFailed())return t.getValue()}findContactForServerUser(e){return this.findContact(e.user_uuid)}findContactForInvite(e){return this.findContact(e.user_uuid)}findSenderContactForInvite(e){return this.findContact(e.sender_uuid)}getCollaborationIDForTrustedContact(e){return this.buildCollaborationId({version:"1",userUuid:e.content.contactUuid,publicKey:e.content.publicKeySet.encryption,signingPublicKey:e.content.publicKeySet.signing})}getItemSignatureStatus(e){return this._validateItemSigner.execute(e)}}let nt;Xe||(Xe={}),function(e){e.Vaults="vaults"}($e||($e={}));class rt{constructor(){this.enabledFeatures=new Set}static get(){return nt||(nt=new rt),nt}isFeatureEnabled(e){return this.enabledFeatures.has(e)}enableFeature(e){console.warn("Enabling internal feature: ".concat(e)),this.enabledFeatures.add(e)}}var it=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class ot{constructor(e,t,n,r){this.session=n,this.singletons=r,this.isReloadingSelfContact=!1,this.eventDisposers=[],this.eventDisposers.push(e.addEventObserver((e=>{e===E.LocalDataIncrementalLoad&&this.loadSelfContactFromDatabase(),e===E.SyncCompletedWithAllItemsUploaded&&this.reloadSelfContactAndCreateIfNecessary()}))),this.eventDisposers.push(t.addObserver(b.ContentType.TYPES.TrustedContact,(()=>{const e=this.singletons.findSingleton(b.ContentType.TYPES.TrustedContact,I.TrustedContact.singletonPredicate);e&&(this.selfContact=e)})))}handleEvent(e){return it(this,void 0,void 0,(function*(){e.type===L.ApplicationStageChanged&&e.payload.stage===y.LoadedDatabase_12&&this.loadSelfContactFromDatabase()}))}loadSelfContactFromDatabase(){this.selfContact||(this.selfContact=this.singletons.findSingleton(b.ContentType.TYPES.TrustedContact,I.TrustedContact.singletonPredicate))}reloadSelfContactAndCreateIfNecessary(){return it(this,void 0,void 0,(function*(){if(!rt.get().isFeatureEnabled($e.Vaults))return;if(this.selfContact)return;if(this.isReloadingSelfContact)return;if(!this.session.isSignedIn())return;if(this.session.isUserMissingKeyPair())return;this.isReloadingSelfContact=!0;const e={name:"Me",isMe:!0,contactUuid:this.session.getSureUser().uuid,publicKeySet:I.ContactPublicKeySet.FromJson({encryption:this.session.getPublicKey(),signing:this.session.getSigningPublicKey(),timestamp:new Date})};this.selfContact=yield this.singletons.findOrCreateSingleton(I.TrustedContact.singletonPredicate,b.ContentType.TYPES.TrustedContact,(0,I.FillItemContent)(e)),this.isReloadingSelfContact=!1}))}deinit(){this.eventDisposers.forEach((e=>e())),this.session=void 0,this.singletons=void 0}}class st{constructor(e,t,n){this.mutator=e,this.findContact=t,this.editContact=n}execute(e){var t,n,r,i,o,s,a;return i=this,o=void 0,a=function*(){const i=this.findContact.execute({userUuid:e.contactUuid});if(!i.isFailed())return yield this.editContact.execute(i.getValue(),Object.assign(Object.assign({},e),{name:null!==(t=e.name)&&void 0!==t?t:i.getValue().name})),i.getValue();const o={name:null!==(n=e.name)&&void 0!==n?n:"Unnamed contact",publicKeySet:I.ContactPublicKeySet.FromJson({encryption:e.publicKey,signing:e.signingPublicKey,timestamp:new Date}),contactUuid:e.contactUuid,isMe:null!==(r=e.isMe)&&void 0!==r&&r};return yield this.mutator.createItem(b.ContentType.TYPES.TrustedContact,(0,I.FillItemContent)(o),!0)},new((s=void 0)||(s=Promise))((function(e,t){function n(e){try{l(a.next(e))}catch(e){t(e)}}function r(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(n,r)}l((a=a.apply(i,o||[])).next())}))}}class at{constructor(e,t,n,r){this.mutator=e,this.sync=t,this.getOwnedVaults=n,this.contactBelongsToVault=r}execute(e){return t=this,n=void 0,i=function*(){if(e.contact.isMe)throw new Error("Cannot delete self");const t=this.getOwnedVaults.execute();if(t.isFailed())return b.Result.fail("Failed to get owned vaults");for(const n of t.getValue()){const t=yield this.contactBelongsToVault.execute({contact:e.contact,vault:n});if(t.isFailed())return b.Result.fail("Failed to check contact membership");if(t.getValue())return b.Result.fail("Cannot delete contact that belongs to an owned vault")}return yield this.mutator.setItemToBeDeleted(e.contact),yield this.sync.sync(),b.Result.ok()},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class lt{constructor(e){this.mutator=e}execute(e,t){return n=this,r=void 0,o=function*(){return yield this.mutator.changeItem(e,(n=>{n.name=t.name,t.publicKey===e.publicKeySet.encryption&&t.signingPublicKey===e.publicKeySet.signing||n.addPublicKey({encryption:t.publicKey,signing:t.signingPublicKey})}))},new((i=void 0)||(i=Promise))((function(e,t){function s(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(n,r||[])).next())}));var n,r,i,o}}class ct{constructor(e){this.items=e}execute(e){if("userUuid"in e&&e.userUuid){const t=this.items.itemsMatchingPredicate(b.ContentType.TYPES.TrustedContact,new I.Predicate("contactUuid","=",e.userUuid));return 0===t.length?b.Result.fail("Contact not found for user ".concat(e.userUuid)):t.length>1?b.Result.fail("Multiple contacts found for user ".concat(e.userUuid)):b.Result.ok(t[0])}if("signingPublicKey"in e&&e.signingPublicKey){const t=this.items.getItems(b.ContentType.TYPES.TrustedContact).find((t=>t.hasCurrentOrPreviousSigningPublicKey(e.signingPublicKey)));return t?b.Result.ok(t):b.Result.fail("Contact not found")}throw new Error("Invalid query")}}class ut{constructor(e){this.items=e}execute(){return b.Result.ok(this.items.getItems(b.ContentType.TYPES.TrustedContact))}}var dt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class ht{constructor(e,t,n,r,i,o,s,a,l){this.selfContactManager=e,this.invitesServer=t,this.messageServer=n,this._reuploadAllInvites=r,this._resendAllMessages=i,this._getAllContacts=o,this._sendOwnContactChangedMessage=s,this._createOrEditContact=a,this.logger=l}execute(e){return dt(this,void 0,void 0,(function*(){yield this.updateSelfContact({encryption:e.newKeys.encryption.publicKey,signing:e.newKeys.signing.publicKey});const t=yield Promise.all([this._reuploadAllInvites.execute({keys:e.newKeys,previousKeys:e.previousKeys}),this._resendAllMessages.execute({keys:e.newKeys,previousKeys:e.previousKeys})]);for(const e of t)e.isFailed()&&this.logger.error(e.getError());yield this.sendOwnContactChangeEventToAllContacts(e);const n=yield Promise.all([this.messageServer.deleteAllInboundMessages(),this.invitesServer.deleteAllInboundInvites()]);for(const e of n)(0,a.isErrorResponse)(e)&&this.logger.error(JSON.stringify(e));return b.Result.ok()}))}updateSelfContact(e){return dt(this,void 0,void 0,(function*(){if(!rt.get().isFeatureEnabled($e.Vaults))return;const t=this.selfContactManager.selfContact;t&&(yield this._createOrEditContact.execute({contactUuid:t.contactUuid,publicKey:e.encryption,signingPublicKey:e.signing}))}))}sendOwnContactChangeEventToAllContacts(e){return dt(this,void 0,void 0,(function*(){if(!e.previousKeys)return;const t=this._getAllContacts.execute();if(!t.isFailed())for(const n of t.getValue())n.isMe||(yield this._sendOwnContactChangedMessage.execute({senderOldKeyPair:e.previousKeys.encryption,senderOldSigningKeyPair:e.previousKeys.signing,senderNewKeyPair:e.newKeys.encryption,senderNewSigningKeyPair:e.newKeys.signing,contact:n}))}))}}class pt{constructor(e,t,n){this.mutator=e,this.sync=t,this.findContact=n}execute(e){return t=this,n=void 0,i=function*(){const t=this.findContact.execute({userUuid:e.contactUuid});if(t.isFailed()){const t=yield this.mutator.createItem(b.ContentType.TYPES.TrustedContact,(0,I.FillItemContent)(e),!0);return yield this.sync.sync(),b.Result.ok(t)}const n=t.getValue();if(n.isMe)return b.Result.fail("Cannot replace data for me contact");const r=yield this.mutator.changeItem(n,(t=>{t.name=e.name,t.replacePublicKeySet(e.publicKeySet)}),I.MutationType.UpdateUserTimestamps,I.PayloadEmitSource.RemoteRetrieved);return yield this.sync.sync(),b.Result.ok(r)},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}var ft;class gt{constructor(e,t){this.encryptMessage=e,this.sendMessage=t}execute(e){return t=this,n=void 0,i=function*(){const t={type:I.AsymmetricMessagePayloadType.SenderKeypairChanged,data:{recipientUuid:e.contact.contactUuid,newEncryptionPublicKey:e.senderNewKeyPair.publicKey,newSigningPublicKey:e.senderNewSigningKeyPair.publicKey}},n=this.encryptMessage.execute({message:t,keys:{encryption:e.senderOldKeyPair,signing:e.senderOldSigningKeyPair},recipientPublicKey:e.contact.publicKeySet.encryption});return n.isFailed()?b.Result.fail(n.getError()):yield this.sendMessage.execute({recipientUuid:e.contact.contactUuid,encryptedMessage:n.getValue(),replaceabilityIdentifier:void 0})},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}!function(e){e.NotApplicable="NotApplicable",e.Trusted="Trusted",e.SignedWithNonCurrentKey="SignedWithNonCurrentKey",e.NotTrusted="NotTrusted"}(ft||(ft={}));var mt=n(73936);class yt{constructor(e){this.findContact=e}execute(e){const t=e.last_edited_by_uuid;return t?this.validateSignatureWithLastEditedByUuid(e,t):this.validateSignatureWithNoLastEditedByUuid(e)}isItemLocallyCreatedAndDoesNotRequireSignature(e){return e.payload.source===I.PayloadSource.Constructor}isItemResutOfRemoteSaveAndDoesNotRequireSignature(e){return e.payload.source===I.PayloadSource.RemoteSaved}validateSignatureWithLastEditedByUuid(e,t){const n=(0,mt.q)(e),r=this.findContact.execute({userUuid:t});if(r.isFailed())return n?ft.NotTrusted:ft.NotApplicable;if(!e.signatureData)return this.isItemLocallyCreatedAndDoesNotRequireSignature(e)||this.isItemResutOfRemoteSaveAndDoesNotRequireSignature(e)?ft.NotApplicable:n?ft.NotTrusted:ft.NotApplicable;const i=e.signatureData;if(!i.result)return i.required?ft.NotTrusted:ft.NotApplicable;const o=i.result;if(!o.passes)return ft.NotTrusted;const s=o.publicKey,a=r.getValue().getTrustStatusForSigningPublicKey(s);return a===I.PublicKeyTrustStatus.Trusted?ft.Trusted:a===I.PublicKeyTrustStatus.Previous?ft.SignedWithNonCurrentKey:ft.NotTrusted}validateSignatureWithNoLastEditedByUuid(e){const t=(0,mt.q)(e);if(!e.signatureData)return this.isItemLocallyCreatedAndDoesNotRequireSignature(e)||this.isItemResutOfRemoteSaveAndDoesNotRequireSignature(e)?ft.NotApplicable:t?ft.NotTrusted:ft.NotApplicable;const n=e.signatureData;if(!n.result)return n.required?ft.NotTrusted:ft.NotApplicable;const r=n.result;if(!r.passes)return ft.NotTrusted;const i=r.publicKey,o=this.findContact.execute({signingPublicKey:i});if(o.isFailed())return ft.NotTrusted;const s=o.getValue().getTrustStatusForSigningPublicKey(i);return s===I.PublicKeyTrustStatus.Trusted?ft.Trusted:s===I.PublicKeyTrustStatus.Previous?ft.SignedWithNonCurrentKey:ft.NotTrusted}}function vt(e){return void 0!==e.entries}function At(e){return void 0!==e.fullEntries}function bt(e,t){return e.sort(((e,n)=>{const r=new Date(n.updated_at).getTime()-new Date(e.updated_at).getTime();let i=0,o=0;return i=t.indexOf(e.content_type),o=t.indexOf(n.content_type),-1===i&&(i=t.length),-1===o&&(o=t.length),i===o?r:i<o?-1:1}))}function wt(e,t){return e.sort(((e,n)=>{const r=new Date(n.updated_at).getTime()-new Date(e.updated_at).getTime();let i=0,o=0;return i=t.indexOf(e.uuid),o=t.indexOf(n.uuid),-1===i&&(i=t.length),-1===o&&(o=t.length),i===o?r:i<o?-1:1}))}function St(e,t){const n=[],r=[],i=[],o=[],s=[];for(let a=0;a<e.length;a++){const l=e[a];l.content_type===b.ContentType.TYPES.KeySystemRootKey?r.push(l):l.content_type===b.ContentType.TYPES.KeySystemItemsKey?i.push(l):l.content_type===b.ContentType.TYPES.ItemsKey?n.push(l):t.contentTypePriority.includes(l.content_type)?o.push(l):s.push(l)}return{itemsKeyPayloads:n,keySystemRootKeyPayloads:r,keySystemItemsKeyPayloads:i,contentTypePriorityPayloads:bt(o,t.contentTypePriority),remainingPayloads:wt(s,t.uuidPriority)}}function Ct(e){return e.environment===I.Environment.Desktop}function Et(e){return e.environment===I.Environment.Mobile}var It,_t,xt,Pt=n(86999),kt=n(20875);!function(e){e.RootKeyStatusChanged="RootKeyStatusChanged"}(It||(It={})),function(e){e.RootKeyManagerKeyStatusChanged="RootKeyManagerKeyStatusChanged"}(_t||(_t={})),function(e){e[e.RootKeyNone=0]="RootKeyNone",e[e.RootKeyOnly=1]="RootKeyOnly",e[e.RootKeyPlusWrapper=2]="RootKeyPlusWrapper",e[e.WrapperOnly=3]="WrapperOnly"}(xt||(xt={}));var Bt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Ot extends f{constructor(e,t,n,r,i,o,s,a,l,u,d,h,p,f,g,m){super(m),this.items=e,this.mutator=t,this.payloads=n,this.operators=r,this.itemsEncryption=i,this.rootKeyManager=o,this.crypto=s,this._createNewItemsKeyWithRollback=a,this._findDefaultItemsKey=l,this._rootKeyEncryptPayloadWithKeyLookup=u,this._rootKeyEncryptPayload=d,this._rootKeyDecryptPayload=h,this._rootKeyDecryptPayloadWithKeyLookup=p,this._createDefaultItemsKey=f,this._getKeyPairs=g,this.internalEventBus=m,m.addEventHandler(this,_t.RootKeyManagerKeyStatusChanged),c.UuidGenerator.SetGenerator(this.crypto.generateUUID)}handleEvent(e){return Bt(this,void 0,void 0,(function*(){e.type===_t.RootKeyManagerKeyStatusChanged&&(this.itemsEncryption.userVersion=this.getUserVersion(),this.notifyEvent(It.RootKeyStatusChanged))}))}deinit(){this.items=void 0,this.payloads=void 0,this.operators=void 0,this.itemsEncryption=void 0,this.rootKeyManager=void 0,this.crypto=void 0,this._createNewItemsKeyWithRollback=void 0,this._findDefaultItemsKey=void 0,this._rootKeyEncryptPayloadWithKeyLookup=void 0,this._rootKeyEncryptPayload=void 0,this._rootKeyDecryptPayload=void 0,this._rootKeyDecryptPayloadWithKeyLookup=void 0,this._createDefaultItemsKey=void 0,super.deinit()}hasSigningKeyPair(){var e;return!!(null===(e=this.getRootKey())||void 0===e?void 0:e.signingKeyPair)}initialize(){return Bt(this,void 0,void 0,(function*(){yield this.rootKeyManager.initialize()}))}getEncryptionDisplayName(){return Bt(this,void 0,void 0,(function*(){const e=yield this.rootKeyManager.getEncryptionSourceVersion();if(e)return this.operators.operatorForVersion(e).getEncryptionDisplayName();throw Error("Attempting to access encryption display name wtihout source")}))}getLatestVersion(){return kt.ProtocolVersionLatest}hasAccount(){return this.rootKeyManager.hasAccount()}hasRootKeyEncryptionSource(){return this.rootKeyManager.hasRootKeyEncryptionSource()}getUserVersion(){return this.rootKeyManager.getUserVersion()}upgradeAvailable(){return Bt(this,void 0,void 0,(function*(){const e=this.accountUpgradeAvailable(),t=yield this.passcodeUpgradeAvailable();return e||t}))}getSureDefaultItemsKey(){return this.itemsEncryption.getDefaultItemsKey()}repersistAllItems(){return Bt(this,void 0,void 0,(function*(){return this.itemsEncryption.repersistAllItems()}))}createNewItemsKeyWithRollback(){return Bt(this,void 0,void 0,(function*(){return this._createNewItemsKeyWithRollback.execute()}))}itemsKeyForEncryptedPayload(e){return this.itemsEncryption.itemsKeyForEncryptedPayload(e)}defaultItemsKeyForItemVersion(e,t){return this.itemsEncryption.defaultItemsKeyForItemVersion(e,t)}encryptSplitSingle(e){return Bt(this,void 0,void 0,(function*(){return(yield this.encryptSplit(e))[0]}))}encryptSplit(e){return Bt(this,void 0,void 0,(function*(){const t=[],{usesRootKey:n,usesItemsKey:r,usesKeySystemRootKey:i,usesRootKeyWithKeyLookup:o,usesItemsKeyWithKeyLookup:s,usesKeySystemRootKeyWithKeyLookup:a}=e,l=this._getKeyPairs.execute(),u=l.isFailed()?void 0:l.getValue().signing;if(n){const e=yield this._rootKeyEncryptPayload.executeMany(n.items,n.key,u);(0,c.extendArray)(t,e)}if(o){const e=yield this._rootKeyEncryptPayloadWithKeyLookup.executeMany(o.items,u);(0,c.extendArray)(t,e)}if(i){const e=yield this._rootKeyEncryptPayload.executeMany(i.items,i.key,u);(0,c.extendArray)(t,e)}if(a){const e=yield this._rootKeyEncryptPayloadWithKeyLookup.executeMany(a.items,u);(0,c.extendArray)(t,e)}if(r){const e=yield this.itemsEncryption.encryptPayloads(r.items,r.key,u);(0,c.extendArray)(t,e)}if(s){const e=yield this.itemsEncryption.encryptPayloadsWithKeyLookup(s.items,u);(0,c.extendArray)(t,e)}return t.map((t=>{const n=(0,Pt.G6)(t.uuid,e);return new I.EncryptedPayload(Object.assign(Object.assign(Object.assign({},n),t),{waitingForKey:!1,errorDecrypting:!1}))}))}))}decryptSplitSingle(e){return Bt(this,void 0,void 0,(function*(){return(yield this.decryptSplit(e))[0]}))}decryptSplit(e){return Bt(this,void 0,void 0,(function*(){const t=[],{usesRootKey:n,usesItemsKey:r,usesKeySystemRootKey:i,usesRootKeyWithKeyLookup:o,usesItemsKeyWithKeyLookup:s,usesKeySystemRootKeyWithKeyLookup:a}=e;if(n){const e=yield this._rootKeyDecryptPayload.executeMany(n.items,n.key);(0,c.extendArray)(t,e)}if(o){const e=yield this._rootKeyDecryptPayloadWithKeyLookup.executeMany(o.items);(0,c.extendArray)(t,e)}if(i){const e=yield this._rootKeyDecryptPayload.executeMany(i.items,i.key);(0,c.extendArray)(t,e)}if(a){const e=yield this._rootKeyDecryptPayloadWithKeyLookup.executeMany(a.items);(0,c.extendArray)(t,e)}if(r){const e=yield this.itemsEncryption.decryptPayloads(r.items,r.key);(0,c.extendArray)(t,e)}if(s){const e=yield this.itemsEncryption.decryptPayloadsWithKeyLookup(s.items);(0,c.extendArray)(t,e)}return t.map((t=>{const n=(0,Pt.sP)(t.uuid,e);return(0,Pt.XL)(t)?new I.EncryptedPayload(Object.assign(Object.assign({},n.ejected()),t)):new I.DecryptedPayload(Object.assign(Object.assign({},n.ejected()),t))}))}))}decryptPayloadWithKeyLookup(e){return Bt(this,void 0,void 0,(function*(){const t=yield this.itemsEncryption.decryptPayloadWithKeyLookup(e);return(0,Pt.XL)(t)?{parameters:t,payload:new I.EncryptedPayload(Object.assign(Object.assign({},e.ejected()),t))}:{parameters:t,payload:new I.DecryptedPayload(Object.assign(Object.assign({},e.ejected()),t))}}))}accountUpgradeAvailable(){const e=this.getUserVersion();return!!e&&e!==kt.ProtocolVersionLatest}passcodeUpgradeAvailable(){return Bt(this,void 0,void 0,(function*(){return this.rootKeyManager.passcodeUpgradeAvailable()}))}platformSupportsKeyDerivation(e){return(0,kt.compareVersions)(e.version,kt.ProtocolVersion.V004)>=0||!!(0,c.isWebCryptoAvailable)()||(0,c.isReactNativeEnvironment)()}supportedVersions(){return[kt.ProtocolVersion.V001,kt.ProtocolVersion.V002,kt.ProtocolVersion.V003,kt.ProtocolVersion.V004]}isVersionNewerThanLibraryVersion(e){const t=kt.ProtocolVersionLatest;return 1===(0,kt.compareVersions)(e,t)}costMinimumForVersion(e){if((0,kt.compareVersions)(e,kt.ProtocolVersion.V003)>=0)throw"Cost minimums only apply to versions <= 002";if(e===kt.ProtocolVersion.V001)return Pt.xo.PbkdfMinCost;if(e===kt.ProtocolVersion.V002)return Pt.$4.PbkdfMinCost;throw"Invalid version for cost minimum: ".concat(e)}computeRootKey(e,t){return Bt(this,void 0,void 0,(function*(){return this.rootKeyManager.computeRootKey(e,t)}))}createRootKey(e,t,n,r){return Bt(this,void 0,void 0,(function*(){return this.rootKeyManager.createRootKey(e,t,n,r)}))}createRandomizedKeySystemRootKey(e){return this.operators.defaultOperator().createRandomizedKeySystemRootKey(e)}createUserInputtedKeySystemRootKey(e){return this.operators.defaultOperator().createUserInputtedKeySystemRootKey(e)}deriveUserInputtedKeySystemRootKey(e){return this.operators.defaultOperator().deriveUserInputtedKeySystemRootKey(e)}createKeySystemItemsKey(e,t,n,r){return this.operators.defaultOperator().createKeySystemItemsKey(e,t,n,r)}asymmetricSignatureVerifyDetached(e){const t=this.operators.defaultOperator().versionForAsymmetricallyEncryptedString(e);return this.operators.operatorForVersion(t).asymmetricSignatureVerifyDetached(e)}getSenderPublicKeySetFromAsymmetricallyEncryptedString(e){const t=this.operators.defaultOperator().versionForAsymmetricallyEncryptedString(e);return this.operators.operatorForVersion(t).getSenderPublicKeySetFromAsymmetricallyEncryptedString(e)}createKeyParams(e){return(0,Pt.jl)(e)}hasPasscode(){return this.rootKeyManager.hasPasscode()}isPasscodeLocked(){return Bt(this,void 0,void 0,(function*(){return(yield this.rootKeyManager.hasRootKeyWrapper())&&null==this.rootKeyManager.getRootKey()}))}getRootKeyParams(){return this.rootKeyManager.getRootKeyParams()}getAccountKeyParams(){return this.rootKeyManager.getMemoizedRootKeyParams()}computeWrappingKey(e){return Bt(this,void 0,void 0,(function*(){const t=this.rootKeyManager.getSureRootKeyWrapperKeyParams();return yield this.computeRootKey(e,t)}))}unwrapRootKey(e){return Bt(this,void 0,void 0,(function*(){return this.rootKeyManager.unwrapRootKey(e)}))}setNewRootKeyWrapper(e){return Bt(this,void 0,void 0,(function*(){return this.rootKeyManager.setNewRootKeyWrapper(e)}))}removePasscode(){return Bt(this,void 0,void 0,(function*(){yield this.rootKeyManager.removeRootKeyWrapper()}))}setRootKey(e,t){return Bt(this,void 0,void 0,(function*(){yield this.rootKeyManager.setRootKey(e,t)}))}getRootKey(){return this.rootKeyManager.getRootKey()}getSureRootKey(){return this.rootKeyManager.getRootKey()}deleteWorkspaceSpecificKeyStateFromDevice(){return Bt(this,void 0,void 0,(function*(){yield this.rootKeyManager.deleteWorkspaceSpecificKeyStateFromDevice()}))}validateAccountPassword(e){return Bt(this,void 0,void 0,(function*(){return this.rootKeyManager.validateAccountPassword(e)}))}validatePasscode(e){return Bt(this,void 0,void 0,(function*(){return this.rootKeyManager.validatePasscode(e)}))}getEmbeddedPayloadAuthenticatedData(e){const t=e.version;if(t)return this.operators.operatorForVersion(t).getPayloadAuthenticatedDataForExternalUse((0,Pt.xi)(e))}getKeyEmbeddedKeyParamsFromItemsKey(e){const t=this.getEmbeddedPayloadAuthenticatedData(e);if(t){if((0,kt.isVersionLessThanOrEqualTo)(e.version,kt.ProtocolVersion.V003)){const e=t;return this.createKeyParams(e)}{const e=t.kp;return this.createKeyParams(e)}}}needsNewRootKeyBasedItemsKey(){if(!this.hasAccount())return!1;const e=this.rootKeyManager.getRootKey();if(!e)return!1;if((0,kt.compareVersions)(e.keyVersion,kt.ProtocolVersionLastNonrootItemsKey)>0)return!1;const t=this._findDefaultItemsKey.execute(this.itemsEncryption.getItemsKeys()).getValue();return!t||t.itemsKey!==e.itemsKey}createNewDefaultItemsKey(){return Bt(this,void 0,void 0,(function*(){return this._createDefaultItemsKey.execute()}))}getPasswordCreatedDate(){const e=this.getRootKey();return e?e.keyParams.createdDate:void 0}onSyncEvent(e){return Bt(this,void 0,void 0,(function*(){e===E.SyncCompletedWithAllItemsUploaded&&(yield this.handleFullSyncCompletion()),e===E.DownloadFirstSyncCompleted&&(yield this.handleDownloadFirstSyncCompletion())}))}handleDownloadFirstSyncCompletion(){return Bt(this,void 0,void 0,(function*(){if(!this.hasAccount())return;const e=this.itemsEncryption.getItemsKeys(),t=e.filter((e=>e.neverSynced)),n=e.filter((e=>!e.neverSynced)).find((e=>e.isDefault));if((0,c.isNullOrUndefined)(n)){const e=this.getRootKeyParams();if(e){const n=t.filter((t=>t.keyVersion!==e.version));n.length>0&&(yield this.mutator.setItemsToBeDeleted(n)),0===this.itemsEncryption.getItemsKeys().length&&(yield this.createNewDefaultItemsKey())}}else yield this.mutator.setItemsToBeDeleted(t);const r=this.getUserVersion(),i=this.itemsEncryption.getItemsKeys().find((e=>e.keyVersion===r));(0,c.isNullOrUndefined)(i)&&(yield this.createNewDefaultItemsKey()),this.syncUnsyncedItemsKeys()}))}handleFullSyncCompletion(){return Bt(this,void 0,void 0,(function*(){if(!this._findDefaultItemsKey.execute(this.itemsEncryption.getItemsKeys()).getValue()&&(yield this.createNewDefaultItemsKey(),this.rootKeyManager.getKeyMode()===xt.WrapperOnly))return this.itemsEncryption.repersistAllItems()}))}syncUnsyncedItemsKeys(){if(!this.hasAccount())return;const e=this.itemsEncryption.getItemsKeys().filter((e=>e.neverSynced&&!e.dirty));e.length>0&&this.mutator.setItemsDirty(e)}}var Nt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};function Dt(e,t,n){return Nt(this,void 0,void 0,(function*(){const r=yield t.decryptSplitSingle({usesRootKeyWithKeyLookup:{items:[e]}});if((0,I.isDecryptedPayload)(r))return r;const i=yield jt(e,t,n);return"aborted"===i||"failed"===i?i:i.decryptedKey}))}function jt(e,t,n,r){return Nt(this,void 0,void 0,(function*(){if(r||(r=t.getKeyEmbeddedKeyParamsFromItemsKey(e)),!r)return"failed";const i=n.createChallenge([new ze(He.None,void 0,void 0,!0)],Ke.Custom,!0,Pt.fD.KeyRecoveryLoginFlowPrompt(r),Pt.fD.KeyRecoveryPasswordRequired),o=yield n.promptForChallengeResponse(i);if(!o)return"aborted";const s=o.values[0].value,a=yield t.computeRootKey(s,r),l=yield t.decryptSplitSingle({usesRootKey:{items:[e],key:a}});return n.completeChallenge(i),(0,I.isDecryptedPayload)(l)?{decryptedKey:l,rootKey:a}:"failed"}))}class Tt{constructor(e){this.operators=e}execute(e){const t=this.operators.defaultOperator().versionForAsymmetricallyEncryptedString(e.message),n=this.operators.operatorForVersion(t).asymmetricDecrypt({stringToDecrypt:e.message,recipientSecretKey:e.privateKey});if(!n)return b.Result.fail("Failed to decrypt message");if(!n.signatureVerified)return b.Result.fail("Failed to verify signature");if(e.sender){if(e.sender.getTrustStatusForPublicKey(n.senderPublicKey)!==I.PublicKeyTrustStatus.Trusted)return b.Result.fail("Sender public key is not trusted");if(e.sender.getTrustStatusForSigningPublicKey(n.signaturePublicKey)!==I.PublicKeyTrustStatus.Trusted)return b.Result.fail("Signature public key is not trusted")}return b.Result.ok(JSON.parse(n.plaintext))}}class Mt{constructor(e){this.operators=e}execute(e){const t=this.operators.defaultOperator().versionForAsymmetricallyEncryptedString(e.message),n=this.operators.operatorForVersion(t).asymmetricDecryptOwnMessage({message:e.message,ownPrivateKey:e.privateKey,recipientPublicKey:e.recipientPublicKey});if(n.isFailed())return b.Result.fail(n.getError());const r=n.getValue();return r.signatureVerified?b.Result.ok(JSON.parse(r.plaintext)):b.Result.fail("Failed to verify signature")}}class Ft{constructor(e){this.operators=e}execute(e){const t=this.operators.defaultOperator().asymmetricEncrypt({stringToEncrypt:JSON.stringify(e.message),senderKeyPair:e.keys.encryption,senderSigningKeyPair:e.keys.signing,recipientPublicKey:e.recipientPublicKey});return b.Result.ok(t)}}class Rt{constructor(e){this.operators=e}execute(e){return this.operators.defaultOperator().asymmetricStringGetAdditionalData({encryptedString:e.message})}}class Lt{constructor(e,t){this.itemsEncryption=e,this._decryptErroredRootPayloads=t}execute(){return e=this,t=void 0,r=function*(){return yield this._decryptErroredRootPayloads.execute(),yield this.itemsEncryption.decryptErroredItemPayloads(),b.Result.ok()},new((n=void 0)||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}));var e,t,n,r}}class Qt{constructor(e){this.rootKeyManager=e}execute(){const e=this.rootKeyManager.getRootKey();return(null==e?void 0:e.encryptionKeyPair)&&(null==e?void 0:e.signingKeyPair)?b.Result.ok({encryption:e.encryptionKeyPair,signing:e.signingKeyPair}):b.Result.fail("Account keypair not found")}}class Ut{constructor(e,t,n,r){this.mutator=e,this.items=t,this.operators=n,this.rootKeyManager=r}execute(){return e=this,t=void 0,r=function*(){const e=this.rootKeyManager.getSureRootKey(),t=e?e.keyVersion:kt.ProtocolVersionLatest;let n;if((0,kt.compareVersions)(t,kt.ProtocolVersionLastNonrootItemsKey)<=0){const r=new I.DecryptedPayload(Object.assign({uuid:c.UuidGenerator.GenerateUuid(),content_type:b.ContentType.TYPES.ItemsKey,content:(0,I.FillItemContentSpecialized)({itemsKey:e.masterKey,dataAuthenticationKey:e.dataAuthenticationKey,version:t})},(0,I.PayloadTimestampDefaults)()));n=(0,I.CreateDecryptedItemFromPayload)(r)}else n=this.operators.operatorForVersion(t).createItemsKey();const r=this.items.getDisplayableItemsKeys().filter((e=>e.isDefault));for(const e of r)yield this.mutator.changeItemsKey(e,(e=>{e.isDefault=!1}));const i=yield this.mutator.insertItem(n);return yield this.mutator.changeItemsKey(i,(e=>{e.isDefault=!0})),i},new((n=void 0)||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}));var e,t,n,r}}var Vt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Kt{constructor(e,t,n,r,i){this.mutator=e,this.items=t,this._createDefaultItemsKey=n,this._discardItemsLocally=r,this._findDefaultItemsKey=i}execute(){return Vt(this,void 0,void 0,(function*(){const e=this._findDefaultItemsKey.execute(this.items.getDisplayableItemsKeys()).getValue(),t=yield this._createDefaultItemsKey.execute();return()=>Vt(this,void 0,void 0,(function*(){yield this._discardItemsLocally.execute([t]),e&&(yield this.mutator.changeItem(e,(e=>{e.isDefault=!0})))}))}))}}class Ht{execute(e){if(1===e.length)return b.Result.ok(e[0]);const t=e.filter((e=>e.isDefault));if(0===t.length)return b.Result.ok(void 0);if(1===t.length)return b.Result.ok(t[0]);const n=t.filter((e=>!e.neverSynced));return n.length>0?b.Result.ok(n[0]):b.Result.ok(void 0)}}class Gt{constructor(e,t){this.payloads=e,this._decryptTypeAPayloadWithKeyLookup=t}execute(){return e=this,t=void 0,r=function*(){const e=this.payloads.invalidPayloads.filter((e=>(0,I.ContentTypeUsesRootKeyEncryption)(e.content_type)||(0,I.ContentTypeUsesKeySystemRootKeyEncryption)(e.content_type)));if(0===e.length)return;const t=(yield this._decryptTypeAPayloadWithKeyLookup.executeMany(e)).map((t=>{const n=(0,I.SureFindPayload)(e,t.uuid);return(0,Pt.XL)(t)?new I.EncryptedPayload(Object.assign(Object.assign({},n.ejected()),t)):new I.DecryptedPayload(Object.assign(Object.assign({},n.ejected()),t))}));yield this.payloads.emitPayloads(t,I.PayloadEmitSource.LocalChanged)},new((n=void 0)||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}));var e,t,n,r}}var Yt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class zt{constructor(e){this.operatorManager=e}executeOne(e,t){return Yt(this,void 0,void 0,(function*(){return(0,Pt.oO)(e,t,this.operatorManager)}))}executeMany(e,t){return Yt(this,void 0,void 0,(function*(){return Promise.all(e.map((e=>this.executeOne(e,t))))}))}}var Zt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Wt{constructor(e,t,n,r){this.operators=e,this.keySystemKeyManager=t,this.rootKeyManager=n,this.logger=r}executeOne(e){return Zt(this,void 0,void 0,(function*(){let t;if((0,I.ContentTypeUsesKeySystemRootKeyEncryption)(e.content_type)){if(!e.key_system_identifier)return this.logger.error("Payload is missing key system identifier",e),{uuid:e.uuid,errorDecrypting:!0};t=this.keySystemKeyManager.getPrimaryKeySystemRootKey(e.key_system_identifier)}else t=this.rootKeyManager.getRootKey();return null==t?{uuid:e.uuid,errorDecrypting:!0,waitingForKey:!0}:new zt(this.operators).executeOne(e,t)}))}executeMany(e){return Zt(this,void 0,void 0,(function*(){return Promise.all(e.map((e=>this.executeOne(e))))}))}}var qt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Jt{constructor(e){this.operators=e}executeOne(e,t,n){return qt(this,void 0,void 0,(function*(){return(0,Pt.Gl)(e,t,this.operators,n)}))}executeMany(e,t,n){return qt(this,void 0,void 0,(function*(){return Promise.all(e.map((e=>this.executeOne(e,t,n))))}))}}var Xt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class $t{constructor(e,t,n){this.operators=e,this.keySystemKeyManager=t,this.rootKeyManager=n}executeOne(e,t){return Xt(this,void 0,void 0,(function*(){let n;if((0,I.ContentTypeUsesKeySystemRootKeyEncryption)(e.content_type)){if(!e.key_system_identifier)throw Error("Key system-encrypted payload ".concat(e.content_type,"is missing a key_system_identifier"));n=this.keySystemKeyManager.getPrimaryKeySystemRootKey(e.key_system_identifier)}else n=this.rootKeyManager.getRootKey();if(null==n)throw Error("Attempting root key encryption with no root key");return new Jt(this.operators).executeOne(e,n,t)}))}executeMany(e,t){return Xt(this,void 0,void 0,(function*(){return Promise.all(e.map((e=>this.executeOne(e,t))))}))}}var en,tn,nn;class rn{constructor(e,t){this.items=e,this.mutator=t}execute(){return e=this,t=void 0,r=function*(){const e=this.items.getItems((0,I.ContentTypesUsingRootKeyEncryption)());return e.length>0&&(yield this.mutator.setItemsDirty(e)),b.Result.ok()},new((n=void 0)||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}));var e,t,n,r}}!function(e){e.NewUpdateAvailable="NewUpdateAvailable",e.EditorDidFocus="EditorDidFocus",e.BeganBackupDownload="BeganBackupDownload",e.EndedBackupDownload="EndedBackupDownload",e.PanelResized="PanelResized",e.WindowDidFocus="WindowDidFocus",e.WindowDidBlur="WindowDidBlur",e.MobileKeyboardDidChangeFrame="MobileKeyboardDidChangeFrame",e.MobileKeyboardWillChangeFrame="MobileKeyboardWillChangeFrame"}(en||(en={})),function(e){e.UserRolesChanged="UserRolesChanged",e.FeaturesAvailabilityChanged="Features:FeaturesAvailabilityChanged",e.DidPurchaseSubscription="DidPurchaseSubscription"}(tn||(tn={})),function(e){e.NoUserSubscription="NoUserSubscription",e.NotInCurrentPlan="NotInCurrentPlan",e.InCurrentPlanButExpired="InCurrentPlanButExpired",e.Entitled="Entitled"}(nn||(nn={}));var on=n(86311),sn=n(70781),an=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class ln extends f{constructor(e,t,n,r,i,o,s,a,l,c,u){super(l),this.api=e,this.mutator=t,this.sync=n,this.encryptor=r,this.challengor=i,this.alertService=s,this.crypto=a,this.internalEventBus=l,this.logger=c,this.backupsService=u,this.encryptedCache=new on.F9(1e8),this.sharedVault=new sn.SharedVaultServer(o)}deinit(){super.deinit(),this.encryptedCache.clear(),this.encryptedCache=void 0,this.api=void 0,this.encryptor=void 0,this.sync=void 0,this.alertService=void 0,this.challengor=void 0,this.crypto=void 0}minimumChunkSize(){return 5e6}createUserValetToken(e,t,n){return an(this,void 0,void 0,(function*(){return this.api.createUserFileValetToken(e,t,n)}))}createSharedVaultValetToken(e){return an(this,void 0,void 0,(function*(){if(e.operation!==a.ValetTokenOperation.Write&&!e.fileUuidRequiredForExistingFiles)throw new Error("File UUID is required for for non-write operations");const t=yield this.sharedVault.createSharedVaultFileValetToken({sharedVaultUuid:e.sharedVaultUuid,sharedVaultOwnerUuid:e.sharedVaultOwnerUuid,fileUuid:e.fileUuidRequiredForExistingFiles,remoteIdentifier:e.remoteIdentifier,operation:e.operation,unencryptedFileSize:e.unencryptedFileSizeForUpload,moveOperationType:e.moveOperationType,sharedVaultToSharedVaultMoveTargetUuid:e.sharedVaultToSharedVaultMoveTargetUuid});return(0,a.isErrorResponse)(t)?new a.ClientDisplayableError("Could not create valet token"):t.data.valetToken}))}moveFileToSharedVault(e,t){return an(this,void 0,void 0,(function*(){const n=yield this.createSharedVaultValetToken({sharedVaultUuid:e.shared_vault_uuid?e.shared_vault_uuid:t.sharing.sharedVaultUuid,sharedVaultOwnerUuid:t.sharing.ownerUserUuid,remoteIdentifier:e.remoteIdentifier,operation:a.ValetTokenOperation.Move,fileUuidRequiredForExistingFiles:e.uuid,moveOperationType:e.shared_vault_uuid?"shared-vault-to-shared-vault":"user-to-shared-vault",sharedVaultToSharedVaultMoveTargetUuid:e.shared_vault_uuid?t.sharing.sharedVaultUuid:void 0});return(0,a.isClientDisplayableError)(n)?n:(yield this.api.moveFile(n))?void 0:new a.ClientDisplayableError("Could not move file")}))}moveFileOutOfSharedVault(e){return an(this,void 0,void 0,(function*(){if(!e.shared_vault_uuid)return new a.ClientDisplayableError("File is not in a shared vault");const t=yield this.createSharedVaultValetToken({sharedVaultUuid:e.shared_vault_uuid,remoteIdentifier:e.remoteIdentifier,operation:a.ValetTokenOperation.Move,fileUuidRequiredForExistingFiles:e.uuid,moveOperationType:"shared-vault-to-user"});return(0,a.isClientDisplayableError)(t)?t:(yield this.api.moveFile(t))?void 0:new a.ClientDisplayableError("Could not move file")}))}beginNewFileUpload(e,t){return an(this,void 0,void 0,(function*(){const n=c.UuidGenerator.GenerateUuid(),r=t&&t.isSharedVaultListing()?yield this.createSharedVaultValetToken({sharedVaultUuid:t.sharing.sharedVaultUuid,sharedVaultOwnerUuid:t.sharing.ownerUserUuid,remoteIdentifier:n,operation:a.ValetTokenOperation.Write,unencryptedFileSizeForUpload:e}):yield this.createUserValetToken(n,a.ValetTokenOperation.Write,e);if(r instanceof a.ClientDisplayableError)return r;const i={key:this.crypto.generateRandomKey(I.FileProtocolV1Constants.KeySize),remoteIdentifier:n,decryptedSize:e},o=new on.y4(i,r,this.crypto,this.api,t),s=yield this.api.startUploadSession(r,t&&t.isSharedVaultListing()?"shared-vault":"user");return(0,a.isErrorResponse)(s)||!s.data.uploadId?new a.ClientDisplayableError("Could not start upload session"):o}))}pushBytesForUpload(e,t,n,r){return an(this,void 0,void 0,(function*(){if(!(yield e.pushBytes(t,n,r)))return new a.ClientDisplayableError("Failed to push file bytes to server")}))}finishUpload(e,t,n){return an(this,void 0,void 0,(function*(){if(!(yield this.api.closeUploadSession(e.getValetToken(),e.vault&&e.vault.isSharedVaultListing()?"shared-vault":"user")))return new a.ClientDisplayableError("Could not close upload session");const r=e.getResult(),i={decryptedSize:r.finalDecryptedSize,encryptedChunkSizes:e.encryptedChunkSizes,encryptionHeader:r.encryptionHeader,key:r.key,mimeType:t.mimeType,name:t.name,remoteIdentifier:r.remoteIdentifier},o=new I.DecryptedPayload(Object.assign(Object.assign({uuid:n,content_type:b.ContentType.TYPES.File,content:(0,I.FillItemContent)((0,I.FillItemContentSpecialized)(i)),dirty:!0},(0,I.PayloadVaultOverrides)(e.vault)),(0,I.PayloadTimestampDefaults)())),s=(0,I.CreateItemFromPayload)(o),l=yield this.mutator.insertItem(s);return yield this.sync.sync(),l}))}decryptCachedEntry(e,t){return an(this,void 0,void 0,(function*(){const n=new on.YT(e,this.crypto);let r=new Uint8Array;const i=new on.WE(e.encryptedChunkSizes,"memcache",(e=>an(this,void 0,void 0,(function*(){const t=n.decryptBytes(e.data);t&&(r=new Uint8Array([...r,...t.decryptedBytes]))}))));return yield i.addBytes(t.encryptedBytes),{decryptedBytes:r}}))}downloadFile(e,t){var n;return an(this,void 0,void 0,(function*(){const r=this.encryptedCache.get(e.uuid);if(r){const n=yield this.decryptCachedEntry(e,r);return void(yield t(n.decryptedBytes,{encryptedFileSize:r.encryptedBytes.length,encryptedBytesDownloaded:r.encryptedBytes.length,encryptedBytesRemaining:0,percentComplete:100,source:"memcache"}))}const i=yield null===(n=this.backupsService)||void 0===n?void 0:n.getFileBackupInfo(e);if(this.backupsService&&i)return this.logger.info("Downloading file from backup",i),yield(0,on.mQ)(e,this.backupsService,this.crypto,(e=>an(this,void 0,void 0,(function*(){return this.logger.info("Got local file chunk",e.progress),t(e.data,e.progress)})))),void this.logger.info("Finished downloading file from backup");{this.logger.info("Downloading file from network");const n=e.encryptedSize<this.encryptedCache.maxSize;let r=new Uint8Array;const i=e.shared_vault_uuid?yield this.createSharedVaultValetToken({sharedVaultUuid:e.shared_vault_uuid,remoteIdentifier:e.remoteIdentifier,operation:a.ValetTokenOperation.Read,fileUuidRequiredForExistingFiles:e.uuid}):yield this.createUserValetToken(e.remoteIdentifier,a.ValetTokenOperation.Read);if(i instanceof a.ClientDisplayableError)return i;const o=new on.BI(e,this.crypto,this.api,i),s=yield o.run((e=>{let{decrypted:i,encrypted:o,progress:s}=e;return an(this,void 0,void 0,(function*(){return n&&(r=new Uint8Array([...r,...o.encryptedBytes])),t(i.decryptedBytes,s)}))}));return n&&r.byteLength>0&&this.encryptedCache.add(e.uuid,{encryptedBytes:r}),s.error}}))}deleteFile(e){return an(this,void 0,void 0,(function*(){this.encryptedCache.remove(e.uuid);const t=e.shared_vault_uuid?yield this.createSharedVaultValetToken({sharedVaultUuid:e.shared_vault_uuid,remoteIdentifier:e.remoteIdentifier,operation:a.ValetTokenOperation.Delete,fileUuidRequiredForExistingFiles:e.uuid}):yield this.createUserValetToken(e.remoteIdentifier,a.ValetTokenOperation.Delete);if(t instanceof a.ClientDisplayableError)return t;const n=yield this.api.deleteFile(t,e.shared_vault_uuid?"shared-vault":"user");if((0,a.isErrorResponse)(n)&&!(yield this.alertService.confirm((0,c.spaceSeparatedStrings)("This file could not be deleted from the server, possibly because you are attempting to delete a file item","that was imported from another account. Would you like to remove this file item from your account anyway?","If you're sure the file is yours and still exists on the server, do not choose this option,","and instead try to delete it again."),"Unable to Delete","Delete Anyway",r.Danger)))return a.ClientDisplayableError.FromNetworkError(n);yield this.mutator.setItemToBeDeleted(e),yield this.sync.sync()}))}isFileNameFileBackupRelated(e){return e===on.yW.MetadataFileName?"metadata":e===on.yW.BinaryFileName&&"binary"}decryptBackupMetadataFile(e){return an(this,void 0,void 0,(function*(){const t=new I.EncryptedPayload(Object.assign(Object.assign({},e.itemsKey),{waitingForKey:!1,errorDecrypting:!1})),n=yield Dt(t,this.encryptor,this.challengor);if("failed"===n||"aborted"===n)return;const r=new I.EncryptedPayload(Object.assign(Object.assign({},e.file),{waitingForKey:!1,errorDecrypting:!1})),i=new Pt.rU(n),o=yield this.encryptor.decryptSplitSingle({usesItemsKey:{items:[r],key:i}});return(0,I.isEncryptedPayload)(o)?void 0:new I.FileItem(o)}))}selectFile(e){return an(this,void 0,void 0,(function*(){return yield e.selectFile()}))}readBackupFileAndSaveDecrypted(e,t,n){return an(this,void 0,void 0,(function*(){const r=yield n.selectDirectory();if("aborted"===r||"failed"===r)return r;const i=yield n.createFile(r,t.name);if("aborted"===i||"failed"===i)return i;const o=yield(0,on.Qf)(e,t,n,this.crypto,(e=>an(this,void 0,void 0,(function*(){yield n.saveBytes(i,e)}))));return yield n.closeFileWriteStream(i),o}))}readBackupFileBytesDecrypted(e,t,n){return an(this,void 0,void 0,(function*(){let r=new Uint8Array;return yield(0,on.Qf)(e,t,n,this.crypto,(e=>an(this,void 0,void 0,(function*(){r=new Uint8Array([...r,...e])})))),r}))}}var cn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class un extends f{constructor(e,t,n){super(n),this.desktopDevice=e,this.platform=t,this.internalEventBus=n,this.HOME_SERVER_DATA_DIRECTORY_NAME=".homeserver"}handleEvent(e){return cn(this,void 0,void 0,(function*(){if(e.type===L.ApplicationStageChanged)switch(e.payload.stage){case y.StorageDecrypted_09:yield this.setHomeServerDataLocationOnDevice();break;case y.Launched_10:yield this.startHomeServerIfItIsEnabled()}}))}deinit(){this.desktopDevice=void 0,super.deinit()}getHomeServerStatus(){return cn(this,void 0,void 0,(function*(){return(yield this.desktopDevice.isHomeServerRunning())?{status:"on",url:yield this.getHomeServerUrl()}:{status:"off",errorMessage:yield this.desktopDevice.getHomeServerLastErrorMessage()}}))}getHomeServerLogs(){return cn(this,void 0,void 0,(function*(){return this.desktopDevice.getHomeServerLogs()}))}getHomeServerUrl(){return cn(this,void 0,void 0,(function*(){return this.desktopDevice.getHomeServerUrl()}))}startHomeServer(){return cn(this,void 0,void 0,(function*(){return this.desktopDevice.startHomeServer()}))}stopHomeServer(){return cn(this,void 0,void 0,(function*(){return this.desktopDevice.stopHomeServer()}))}isHomeServerRunning(){return cn(this,void 0,void 0,(function*(){return this.desktopDevice.isHomeServerRunning()}))}activatePremiumFeatures(e,t){return cn(this,void 0,void 0,(function*(){const n=yield this.desktopDevice.activatePremiumFeatures(e,t);return void 0!==n?b.Result.fail(n):b.Result.ok("Premium features activated")}))}setHomeServerConfiguration(e){return cn(this,void 0,void 0,(function*(){yield this.desktopDevice.setHomeServerConfiguration(JSON.stringify(e))}))}getHomeServerConfiguration(){return cn(this,void 0,void 0,(function*(){const e=yield this.desktopDevice.getHomeServerConfiguration();if(e)return JSON.parse(e)}))}enableHomeServer(){return cn(this,void 0,void 0,(function*(){yield this.desktopDevice.setRawStorageValue(u.HomeServerEnabled,"true"),yield this.startHomeServer()}))}isHomeServerEnabled(){return cn(this,void 0,void 0,(function*(){return"true"===(yield this.desktopDevice.getRawStorageValue(u.HomeServerEnabled))}))}getHomeServerDataLocation(){return cn(this,void 0,void 0,(function*(){return this.desktopDevice.getRawStorageValue(u.HomeServerDataLocation)}))}disableHomeServer(){return cn(this,void 0,void 0,(function*(){yield this.desktopDevice.setRawStorageValue(u.HomeServerEnabled,"false");const e=yield this.stopHomeServer();return void 0!==e?b.Result.fail(e):b.Result.ok("Home server disabled")}))}changeHomeServerDataLocation(){return cn(this,void 0,void 0,(function*(){const e=yield this.getHomeServerDataLocation(),t=yield this.desktopDevice.presentDirectoryPickerForLocationChangeAndTransferOld(this.HOME_SERVER_DATA_DIRECTORY_NAME,e);if(!t){const e=yield this.desktopDevice.getDirectoryManagerLastErrorMessage();return b.Result.fail(null!=e?e:"No location selected")}return yield this.desktopDevice.setRawStorageValue(u.HomeServerDataLocation,t),yield this.desktopDevice.setHomeServerDataLocation(t),b.Result.ok(t)}))}openHomeServerDataLocation(){return cn(this,void 0,void 0,(function*(){const e=yield this.getHomeServerDataLocation();e&&this.desktopDevice.openLocation(e)}))}startHomeServerIfItIsEnabled(){return cn(this,void 0,void 0,(function*(){(yield this.isHomeServerEnabled())&&(yield this.startHomeServer())}))}setHomeServerDataLocationOnDevice(){return cn(this,void 0,void 0,(function*(){let e=yield this.getHomeServerDataLocation();if(!e){const t=yield this.desktopDevice.getUserDocumentsDirectory();if(!t)return;const n=this.platform===I.Platform.WindowsDesktop?"\\":"/";e="".concat(t).concat(n).concat(this.HOME_SERVER_DATA_DIRECTORY_NAME)}yield this.desktopDevice.setRawStorageValue(u.HomeServerDataLocation,e),yield this.desktopDevice.setHomeServerDataLocation(e)}))}}var dn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class hn{constructor(e,t,n,r){this.encryption=e,this.keys=t,this._getBackupFileType=n,this._decryptBackupPayloads=r}execute(e,t){return dn(this,void 0,void 0,(function*(){const n=this.convertToPayloads(e),r=this._getBackupFileType.execute(e,n).getValue();if(r===Pt.qX.Corrupt)return b.Result.fail("Invalid backup file.");const{encrypted:i,decrypted:o}=(0,I.CreatePayloadSplit)(n);if(r===Pt.qX.FullyDecrypted)return b.Result.ok([...o,...i]);if(r===Pt.qX.EncryptedWithNonEncryptedItemsKey){const e=yield this.handleEncryptedWithNonEncryptedItemsKeyFileType(n);return e.isFailed()?b.Result.fail(e.getError()):b.Result.ok([...o,...e.getValue()])}if(!t)throw Error("Attempting to decrypt encrypted file with no password");const s=yield this.handleEncryptedFileType({payloads:i,file:e,password:t});return s.isFailed()?b.Result.fail(s.getError()):b.Result.ok([...o,...s.getValue()])}))}handleEncryptedFileType(e){var t;return dn(this,void 0,void 0,(function*(){const n=(0,Pt.jl)(e.file.keyParams||e.file.auth_params),r=yield this.encryption.computeRootKey(e.password,n),i=[],{rootKeyEncryption:o,itemsKeyEncryption:s,keySystemRootKeyEncryption:a}=(0,Pt.xg)(e.payloads),l=yield this.encryption.decryptSplit({usesRootKey:{items:o||[],key:r}}),u=l.filter((e=>(0,Pt.dS)(e)||(0,I.isKeySystemRootKey)(e))).filter(I.isDecryptedPayload).map((e=>(0,I.CreateDecryptedItemFromPayload)(e)));for(const e of null!=a?a:[]){if(!e.key_system_identifier)throw new Error("Attempting to decrypt key system root key encrypted payload with no key system identifier");const n=l.filter(I.isDecryptedPayload).filter(I.isKeySystemRootKey).map((e=>(0,I.CreateDecryptedItemFromPayload)(e))),r=null!==(t=n.find((t=>t.systemIdentifier===e.key_system_identifier)))&&void 0!==t?t:this.keys.getPrimaryKeySystemRootKey(e.key_system_identifier);if(!r){i.push(e.copy({errorDecrypting:!0}));continue}const o=yield this.encryption.decryptSplitSingle({usesKeySystemRootKey:{items:[e],key:r}});(0,I.isDecryptedPayload)(o)&&(0,Pt.mX)(o)&&u.push((0,I.CreateDecryptedItemFromPayload)(o)),i.push(o)}(0,c.extendArray)(i,l);const d=[...null!=s?s:[]],h=yield this._decryptBackupPayloads.execute({payloads:d,recentlyDecryptedKeys:u,keyParams:n,rootKey:r});return h.isFailed()?b.Result.fail(h.getError()):((0,c.extendArray)(i,h.getValue()),b.Result.ok(i))}))}handleEncryptedWithNonEncryptedItemsKeyFileType(e){return dn(this,void 0,void 0,(function*(){const t=[],n=[];e.forEach((e=>{e.content_type===b.ContentType.TYPES.ItemsKey&&(0,I.isDecryptedPayload)(e)?t.push(e):(0,I.isEncryptedPayload)(e)&&n.push(e)}));const r=t.map((e=>(0,I.CreateDecryptedItemFromPayload)(e)));return this._decryptBackupPayloads.execute({payloads:n,recentlyDecryptedKeys:r,rootKey:void 0})}))}convertToPayloads(e){return e.items.map((e=>{if((0,I.isEncryptedTransferPayload)(e))return new I.EncryptedPayload(e);if((0,I.isDecryptedTransferPayload)(e))return new I.DecryptedPayload(e);throw Error("Unhandled case in DecryptBackupFile")}))}}class pn{constructor(e,t,n){this.encryption=e,this._determineKeyToUse=t,this.logger=n}execute(e){return t=this,n=void 0,i=function*(){const t=[];for(const n of e.payloads)try{const r=this._determineKeyToUse.execute({payload:n,recentlyDecryptedKeys:e.recentlyDecryptedKeys,keyParams:e.keyParams,rootKey:e.rootKey}).getValue();if(!r){t.push(n.copy({errorDecrypting:!0}));continue}if((0,Pt.dS)(r)||(0,Pt.mX)(r)){const e=yield this.encryption.decryptSplitSingle({usesItemsKey:{items:[n],key:r}});t.push(e)}else if((0,I.isKeySystemRootKey)(r)){const e=yield this.encryption.decryptSplitSingle({usesKeySystemRootKey:{items:[n],key:r}});t.push(e)}else{const e=yield this.encryption.decryptSplitSingle({usesRootKey:{items:[n],key:r}});t.push(e)}}catch(e){t.push(n.copy({errorDecrypting:!0})),this.logger.error("Error decrypting payload",n,e)}return b.Result.ok(t)},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class fn{constructor(e,t){this.encryption=e,this.keys=t}execute(e){if((0,I.ContentTypeUsesRootKeyEncryption)(e.payload.content_type)){if(!e.rootKey)throw new Error("Attempting to decrypt root key encrypted payload with no root key");return b.Result.ok(e.rootKey)}if((0,I.ContentTypeUsesKeySystemRootKeyEncryption)(e.payload.content_type)){if(!e.payload.key_system_identifier)throw new Error("Attempting to decrypt key system root key encrypted payload with no key system identifier");try{let t=e.recentlyDecryptedKeys.filter(I.isKeySystemRootKey).find((t=>t.systemIdentifier===e.payload.key_system_identifier));return t||(t=this.keys.getPrimaryKeySystemRootKey(e.payload.key_system_identifier)),b.Result.ok(t)}catch(e){return b.Result.fail(JSON.stringify(e))}}if(e.payload.key_system_identifier){const t=e.recentlyDecryptedKeys.find((t=>t.key_system_identifier===e.payload.key_system_identifier));if(t)return b.Result.ok(t)}let t;if(t=e.recentlyDecryptedKeys.filter(Pt.dS).find((t=>e.payload.items_key_id===t.uuid)),t)return b.Result.ok(t);if(e.payload.items_key_id&&(t=this.encryption.itemsKeyForEncryptedPayload(e.payload),t))return b.Result.ok(t);if(t)return b.Result.ok(t);if(!e.keyParams)return b.Result.ok(void 0);const n=e.payload.version;return(0,kt.leftVersionGreaterThanOrEqualToRight)(e.keyParams.version,kt.ProtocolVersion.V004)?t=this.encryption.defaultItemsKeyForItemVersion(n,e.recentlyDecryptedKeys.filter(Pt.dS)):(0,kt.compareVersions)(n,kt.ProtocolVersion.V003)<=0&&(t=e.rootKey),b.Result.ok(t)}}class gn{execute(e,t){if(e.keyParams||e.auth_params)return b.Result.ok(Pt.qX.Encrypted);const n=t.find(I.isEncryptedPayload),r=t.find((e=>e.content_type===b.ContentType.TYPES.ItemsKey&&(0,I.isDecryptedPayload)(e)));return n&&r?b.Result.ok(Pt.qX.EncryptedWithNonEncryptedItemsKey):n?b.Result.ok(Pt.qX.Corrupt):b.Result.ok(Pt.qX.FullyDecrypted)}}class mn{constructor(e){this.challenges=e}execute(){return e=this,t=void 0,r=function*(){const e=new Ge([new ze(He.None,"File account password",void 0,!0)],Ke.DecryptEncryptedFile,!0),t=yield this.challenges.promptForChallengeResponse(e);return null==t?b.Result.fail("Import aborted due to canceled password prompt"):(this.challenges.completeChallenge(e),b.Result.ok(null==t?void 0:t.values[0].value))},new((n=void 0)||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}));var e,t,n,r}}var yn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class vn{constructor(e,t,n,r,i,o,s,a){this.items=e,this.sync=t,this.protections=n,this.encryption=r,this.payloads=i,this.history=o,this._decryptBackFile=s,this._getFilePassword=a}execute(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return yn(this,void 0,void 0,(function*(){const n=this.validateFileVersion(e);if(n.isFailed())return b.Result.fail(n.getError());const r=yield this.decryptData(e);if(r.isFailed())return b.Result.fail(r.getError());const i=this.getValidPayloadsToImportFromDecryptedResult(r.getValue());if(!(yield this.protections.authorizeFileImport()))return b.Result.fail("Import aborted");const o=yield this.payloads.importPayloads(i,this.history.getHistoryMapCopy()),s=this.sync.sync();t&&(yield s);const a=this.items.findItems(o);return b.Result.ok({affectedItems:a,errorCount:r.getValue().length-i.length})}))}validateFileVersion(e){if(e.version){const t=this.validateVersion(e.version);if(t.isFailed())return b.Result.fail(t.getError())}return b.Result.ok()}decryptData(e){return yn(this,void 0,void 0,(function*(){let t;if(e.auth_params||e.keyParams){const e=yield this._getFilePassword.execute();if(e.isFailed())return b.Result.fail(e.getError());t=e.getValue()}this.cleanImportData(e);const n=yield this._decryptBackFile.execute(e,t);return n.isFailed()?b.Result.fail(n.getError()):b.Result.ok(n.getValue())}))}getValidPayloadsToImportFromDecryptedResult(e){return[...e.filter(I.isDecryptedPayload),...e.filter(I.isEncryptedPayload).filter((e=>void 0!==e.key_system_identifier))]}cleanImportData(e){e.items=e.items.map((e=>(0,I.isEncryptedTransferPayload)(e)?(0,I.CreateEncryptedBackupFileContextPayload)(e):(0,I.CreateDecryptedBackupFileContextPayload)(e)))}validateVersion(e){if(!this.encryption.supportedVersions().includes(e))return b.Result.fail("This backup file was created using a newer version of the application and cannot be imported here. Please update your application and try again.");const t=this.encryption.getUserVersion();return t&&1===(0,kt.compareVersions)(e,t)?b.Result.fail("This backup file was created using a newer encryption version than your account's. Please run the available encryption upgrade and try again."):b.Result.ok()}}class An{constructor(e,t){this.payloads=e,this.protections=t}execute(){return e=this,t=void 0,r=function*(){if(!(yield this.protections.authorizeBackupCreation()))return b.Result.fail("Failed to authorize backup creation");const e=this.payloads.nonDeletedItems.filter((e=>e.content_type!==b.ContentType.TYPES.ItemsKey)),t={version:kt.ProtocolVersionLatest,items:e.map((e=>(0,I.isDecryptedPayload)(e)?(0,I.CreateDecryptedBackupFileContextPayload)(e):(0,I.isEncryptedPayload)(e)?(0,I.CreateEncryptedBackupFileContextPayload)(e):void 0)).filter(c.isNotUndefined)};return b.Result.ok(t)},new((n=void 0)||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}));var e,t,n,r}}var bn;class wn{constructor(e,t,n){this.items=e,this.protections=t,this.encryption=n}execute(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{skipAuthorization:!1};return t=this,n=void 0,i=function*(){if(!e.skipAuthorization&&!(yield this.protections.authorizeBackupCreation()))return b.Result.fail("Failed to authorize backup creation");const t=this.items.items.map((e=>e.payload)),n=(0,Pt.xg)(t),r=(0,Pt.Ak)(n),i=(yield this.encryption.encryptSplit(r)).map((e=>(0,I.CreateEncryptedBackupFileContextPayload)(e))),o={version:kt.ProtocolVersionLatest,items:i},s=this.encryption.getRootKeyParams();return o.keyParams=null==s?void 0:s.getPortableValue(),b.Result.ok(o)},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}!function(e){e.IntegrityCheckCompleted="IntegrityCheckCompleted"}(bn||(bn={}));class Sn extends f{constructor(e,t,n,r,i){super(i),this.integrityApi=e,this.itemApi=t,this.payloadManager=n,this.logger=r,this.internalEventBus=i}handleEvent(e){var t,n,r,i,o,s;return r=this,i=void 0,s=function*(){if(e.type!==E.SyncRequestsIntegrityCheck)return;const r=yield this.integrityApi.checkIntegrity(this.payloadManager.integrityPayloads);if((0,a.isErrorResponse)(r))return void this.logger.error("Could not obtain integrity check: ".concat(null===(t=r.data.error)||void 0===t?void 0:t.message));const i=[];for(const e of r.data.mismatches)i.push(this.itemApi.getSingleItem(e.uuid));const o=yield Promise.all(i),s=[];for(const e of o)null!=e.data&&!(0,a.isErrorResponse)(e)&&"item"in e.data?s.push(e.data.item):this.logger.error("Could not obtain item for integrity adjustments: ".concat((0,a.isErrorResponse)(e)?null===(n=e.data.error)||void 0===n?void 0:n.message:""));yield this.notifyEventSync(bn.IntegrityCheckCompleted,{rawPayloads:s,source:e.payload.source})},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(n,a)}l((s=s.apply(r,i||[])).next())}))}}var Cn;class En{constructor(){this.eventHandlers=new Map}deinit(){this.eventHandlers=void 0}addEventHandler(e,t){let n=this.eventHandlers.get(t);void 0===n&&(n=[]),n.push(e),this.eventHandlers.set(t,n)}publish(e){const t=this.eventHandlers.get(e.type);if(void 0!==t)for(const n of t)n.handleEvent(e)}publishSync(e,t){return n=this,r=void 0,o=function*(){const n=this.eventHandlers.get(e.type);if(void 0!==n){if(t===l.SEQUENCE)for(const t of n)yield t.handleEvent(e);if(t===l.ASYNC){const t=[];for(const r of n)t.push(r.handleEvent(e));yield Promise.all(t)}}},new((i=void 0)||(i=Promise))((function(e,t){function s(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(n,r||[])).next())}));var n,r,i,o}}!function(e){e[e.AReferencesB=0]="AReferencesB",e[e.BReferencesA=1]="BReferencesA",e[e.NoRelationship=2]="NoRelationship"}(Cn||(Cn={}));class In{countNotesAndTags(e){const t={notes:0,archived:0,deleted:0,tags:0};for(const n of e)n.trashed?t.deleted++:n.archived?t.archived++:n.content_type!==b.ContentType.TYPES.Note||n.conflictOf?n.content_type!==b.ContentType.TYPES.Tag||t.tags++:t.notes++;return t}}var _n=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class xn extends f{constructor(e,t,n,r,i,o,s){super(s),this.items=e,this.payloads=t,this.storage=n,this.operators=r,this.keys=i,this._findDefaultItemsKey=o,this.internalEventBus=s,this.removeItemsObserver=this.items.addObserver([b.ContentType.TYPES.ItemsKey],(e=>{let{changed:t,inserted:n}=e;t.concat(n).length>0&&this.decryptErroredItemPayloads()}))}deinit(){this.items=void 0,this.payloads=void 0,this.storage=void 0,this.operators=void 0,this.keys=void 0,this.removeItemsObserver(),this.removeItemsObserver=void 0,super.deinit()}repersistAllItems(){return _n(this,void 0,void 0,(function*(){const e=this.items.items.map((e=>e.payload));return this.storage.savePayloads(e)}))}getItemsKeys(){return this.items.getDisplayableItemsKeys()}itemsKeyForEncryptedPayload(e){return[...this.getItemsKeys(),...this.items.getItems(b.ContentType.TYPES.KeySystemItemsKey)].find((t=>t.uuid===e.items_key_id||t.duplicateOf===e.items_key_id))}getDefaultItemsKey(){return this._findDefaultItemsKey.execute(this.getItemsKeys()).getValue()}keyToUseForItemEncryption(e){if(e.key_system_identifier){return this.keys.getPrimaryKeySystemItemsKey(e.key_system_identifier)||new Pt.KX("Cannot find key system items key to use for encryption")}const t=this.getDefaultItemsKey();let n;return n=this.userVersion&&this.userVersion!==(null==t?void 0:t.keyVersion)?this.getItemsKeys().find((e=>e.keyVersion===this.userVersion)):t,n||new Pt.KX("Cannot find items key to use for encryption")}keyToUseForDecryptionOfPayload(e){return e.items_key_id?this.itemsKeyForEncryptedPayload(e):this.defaultItemsKeyForItemVersion(e.version)}encryptPayloadWithKeyLookup(e,t){return _n(this,void 0,void 0,(function*(){const n=this.keyToUseForItemEncryption(e);if(n instanceof Pt.KX)throw Error(n.message);return this.encryptPayload(e,n,t)}))}encryptPayload(e,t,n){return _n(this,void 0,void 0,(function*(){if((0,I.isEncryptedPayload)(e))throw Error("Attempting to encrypt already encrypted payload.");if(!e.content)throw Error("Attempting to encrypt payload with no content.");if(!e.uuid)throw Error("Attempting to encrypt payload with no UuidGenerator.");return(0,Pt.Gl)(e,t,this.operators,n)}))}encryptPayloads(e,t,n){return _n(this,void 0,void 0,(function*(){return Promise.all(e.map((e=>this.encryptPayload(e,t,n))))}))}encryptPayloadsWithKeyLookup(e,t){return _n(this,void 0,void 0,(function*(){return Promise.all(e.map((e=>this.encryptPayloadWithKeyLookup(e,t))))}))}decryptPayloadWithKeyLookup(e){return _n(this,void 0,void 0,(function*(){const t=this.keyToUseForDecryptionOfPayload(e);return null==t?{uuid:e.uuid,errorDecrypting:!0,waitingForKey:!0}:this.decryptPayload(e,t)}))}decryptPayload(e,t){return _n(this,void 0,void 0,(function*(){return e.content?(0,Pt.oO)(e,t,this.operators):{uuid:e.uuid,errorDecrypting:!0}}))}decryptPayloadsWithKeyLookup(e){return _n(this,void 0,void 0,(function*(){return Promise.all(e.map((e=>this.decryptPayloadWithKeyLookup(e))))}))}decryptPayloads(e,t){return _n(this,void 0,void 0,(function*(){return Promise.all(e.map((e=>this.decryptPayload(e,t))))}))}decryptErroredItemPayloads(){return _n(this,void 0,void 0,(function*(){const e=this.payloads.invalidPayloads.filter((e=>!(0,I.ContentTypeUsesRootKeyEncryption)(e.content_type)&&!(0,I.ContentTypeUsesKeySystemRootKeyEncryption)(e.content_type)));if(0===e.length)return;const t=(yield this.decryptPayloadsWithKeyLookup(e)).map((t=>{const n=(0,I.SureFindPayload)(e,t.uuid);return(0,Pt.XL)(t)?new I.EncryptedPayload(Object.assign(Object.assign({},n.ejected()),t)):new I.DecryptedPayload(Object.assign(Object.assign({},n.ejected()),t))}));yield this.payloads.emitPayloads(t,I.PayloadEmitSource.LocalChanged)}))}defaultItemsKeyForItemVersion(e,t){const n=t||this.getItemsKeys();return n.find((t=>t.isDefault&&t.keyVersion===e))||n.find((t=>t.keyVersion===e))}}var Pn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};const kn="key-system-root-key-";class Bn extends f{constructor(e,t,n,r,i){super(i),this.items=e,this.mutator=t,this.storage=n,this._removeItemsFromMemory=r,this.rootKeyMemoryCache={}}deinit(){this.items=void 0,this.mutator=void 0,this.storage=void 0,this._removeItemsFromMemory=void 0,super.deinit()}handleEvent(e){return Pn(this,void 0,void 0,(function*(){e.type===L.ApplicationStageChanged&&e.payload.stage===y.StorageDecrypted_09&&this.loadRootKeysFromStorage()}))}loadRootKeysFromStorage(){const e=this.storage.getAllKeys().filter((e=>e.startsWith(kn))).map((e=>this.storage.getValue(e))).map((e=>new I.DecryptedPayload(e))).map((e=>new I.KeySystemRootKey(e)));for(const t of e)this.rootKeyMemoryCache[t.systemIdentifier]=t}getRootKeyFromStorageForVault(e){const t=this.storage.getValue(this.storageKeyForRootKey(e));if(!t)return;const n=new I.DecryptedPayload(t);return new I.KeySystemRootKey(n)}getMemCachedRootKey(e){return this.rootKeyMemoryCache[e]}storageKeyForRootKey(e){return"".concat(kn).concat(e)}queueVaultItemsKeysForReencryption(e){return Pn(this,void 0,void 0,(function*(){const t=this.getKeySystemItemsKeys(e);t.length>0&&(yield this.mutator.setItemsDirty(t))}))}cacheKey(e,t){this.rootKeyMemoryCache[e.systemIdentifier]=e,t===I.KeySystemRootKeyStorageMode.Local&&this.storage.setValue(this.storageKeyForRootKey(e.systemIdentifier),e.payload.ejected())}removeKeyFromCache(e){delete this.rootKeyMemoryCache[e],this.storage.removeValue(this.storageKeyForRootKey(e))}getAllSyncedKeySystemRootKeys(){return this.items.getItems(b.ContentType.TYPES.KeySystemRootKey)}wipeVaultKeysFromMemory(e){return Pn(this,void 0,void 0,(function*(){delete this.rootKeyMemoryCache[e.systemIdentifier];const t=this.getKeySystemItemsKeys(e.systemIdentifier);yield this._removeItemsFromMemory.execute(t)}))}getSyncedKeySystemRootKeysForVault(e){return this.items.itemsMatchingPredicate(b.ContentType.TYPES.KeySystemRootKey,new I.Predicate("systemIdentifier","=",e))}getAllKeySystemRootKeysForVault(e){return[...this.getSyncedKeySystemRootKeysForVault(e),...this.rootKeyMemoryCache[e]?[this.rootKeyMemoryCache[e]]:[]]}deleteNonPersistentSystemRootKeysForVault(e){return Pn(this,void 0,void 0,(function*(){delete this.rootKeyMemoryCache[e],yield this.storage.removeValue(this.storageKeyForRootKey(e))}))}deleteAllSyncedKeySystemRootKeys(e){return Pn(this,void 0,void 0,(function*(){const t=this.getSyncedKeySystemRootKeysForVault(e);yield this.mutator.setItemsToBeDeleted(t)}))}getPrimaryKeySystemRootKey(e){return this.getAllKeySystemRootKeysForVault(e).sort(((e,t)=>t.keyParams.creationTimestamp-e.keyParams.creationTimestamp))[0]}getAllKeySystemItemsKeys(){return[...this.items.getItems(b.ContentType.TYPES.KeySystemItemsKey),...this.items.invalidItems.filter((e=>e.content_type===b.ContentType.TYPES.KeySystemItemsKey))]}getKeySystemItemsKeys(e){return this.items.getItems(b.ContentType.TYPES.KeySystemItemsKey).filter((t=>t.key_system_identifier===e))}getPrimaryKeySystemItemsKey(e){const t=this.getPrimaryKeySystemRootKey(e);if(!t)throw new Error("No primary key system root key found");return this.getKeySystemItemsKeys(e).filter((e=>e.rootKeyToken===t.token)).sort(((e,t)=>t.creationTimestamp-e.creationTimestamp))[0]}}var On,Nn,Dn,jn;!function(e){e.ActiveThemes="activeThemes",e.UseSystemColorScheme="useSystemColorScheme",e.UseTranslucentUI="useTranslucentUI",e.AutoLightThemeIdentifier="autoLightThemeIdentifier",e.AutoDarkThemeIdentifier="autoDarkThemeIdentifier",e.EditorMonospaceEnabled="monospaceFont",e.EditorLineHeight="editorLineHeight",e.EditorLineWidth="editorLineWidth",e.EditorFontSize="editorFontSize"}(On||(On={})),function(e){e.LocalPreferencesChanged="LocalPreferencesChanged",e.PreferencesChanged="PreferencesChanged"}(Nn||(Nn={})),function(e){e.Immediately="immediately",e.OnQuit="on-quit"}(Dn||(Dn={})),function(e){e.UnprotectedSessionBegan="Protection:UnprotectedSessionBegan",e.UnprotectedSessionExpired="Protection:UnprotectedSessionExpired",e.BiometricsSoftLockEngaged="Protection:BiometricsSoftLockEngaged",e.BiometricsSoftLockDisengaged="Protection:BiometricsSoftLockDisengaged"}(jn||(jn={}));var Tn,Mn,Fn,Rn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Ln extends f{constructor(e,t){super(t),this.revisionApiService=e,this.internalEventBus=t}listRevisions(e){return Rn(this,void 0,void 0,(function*(){const t=yield this.revisionApiService.listRevisions(e.value);if((0,a.isErrorResponse)(t))throw new Error((0,a.getErrorFromErrorResponse)(t).message);return t.data.revisions}))}deleteRevision(e,t){return Rn(this,void 0,void 0,(function*(){const n=yield this.revisionApiService.deleteRevision(e.value,t.value);if((0,a.isErrorResponse)(n))throw new Error((0,a.getErrorFromErrorResponse)(n).message);return n.data.message}))}getRevision(e,t){return Rn(this,void 0,void 0,(function*(){const n=yield this.revisionApiService.getRevision(e.value,t.value);if((0,a.isErrorResponse)(n))throw new Error((0,a.getErrorFromErrorResponse)(n).message);return n.data.revision}))}}!function(e){e[e.Default=1]="Default",e[e.Ephemeral=2]="Ephemeral"}(Tn||(Tn={})),function(e){e[e.Default=1]="Default",e[e.Nonwrapped=2]="Nonwrapped"}(Mn||(Mn={})),function(e){e.Wrapped="wrapped",e.Unwrapped="unwrapped",e.Nonwrapped="nonwrapped"}(Fn||(Fn={}));var Qn,Un,Vn,Kn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Hn extends f{constructor(e,t,n,r,i,o){super(o),this.device=e,this.storage=t,this.operators=n,this.identifier=r,this._reencryptTypeAItems=i,this.keyMode=xt.RootKeyNone}deinit(){super.deinit(),this.device=void 0,this.storage=void 0,this.operators=void 0,this.identifier=void 0,this._reencryptTypeAItems=void 0,this.rootKey=void 0,this.memoizedRootKeyParams=void 0}initialize(){return Kn(this,void 0,void 0,(function*(){const e=this.getWrappedRootKey(),t=this.recomputeAccountKeyParams(),n=yield this.hasRootKeyWrapper(),r=null!=e||null!=t;if(n&&r)this.keyMode=xt.RootKeyPlusWrapper;else if(n&&!r)this.keyMode=xt.WrapperOnly;else if(!n&&r)this.keyMode=xt.RootKeyOnly;else{if(n||r)throw"Invalid key mode condition";this.keyMode=xt.RootKeyNone}this.keyMode===xt.RootKeyOnly&&(this.setRootKeyInstance(yield this.getRootKeyFromKeychain()),yield this.handleKeyStatusChange())}))}getMemoizedRootKeyParams(){return this.memoizedRootKeyParams}getKeyMode(){return this.keyMode}hasRootKeyWrapper(){return Kn(this,void 0,void 0,(function*(){return null!=this.getRootKeyWrapperKeyParams()}))}getRootKeyWrapperKeyParams(){const e=this.storage.getValue(d.RootKeyWrapperKeyParams,Mn.Nonwrapped);if(e)return(0,Pt.jl)(e)}passcodeUpgradeAvailable(){return Kn(this,void 0,void 0,(function*(){const e=this.getRootKeyWrapperKeyParams();return!!e&&e.version!==kt.ProtocolVersionLatest}))}hasAccount(){switch(this.keyMode){case xt.RootKeyNone:case xt.WrapperOnly:return!1;case xt.RootKeyOnly:case xt.RootKeyPlusWrapper:return!0;default:throw Error("Unhandled keyMode value.")}}getUserVersion(){const e=this.memoizedRootKeyParams;return null==e?void 0:e.version}hasRootKeyEncryptionSource(){return this.hasAccount()||this.hasPasscode()}computeRootKey(e,t){return Kn(this,void 0,void 0,(function*(){const n=t.version;return this.operators.operatorForVersion(n).computeRootKey(e,t)}))}deleteWorkspaceSpecificKeyStateFromDevice(){return Kn(this,void 0,void 0,(function*(){yield this.device.clearNamespacedKeychainValue(this.identifier),yield this.storage.removeValue(d.WrappedRootKey,Mn.Nonwrapped),yield this.storage.removeValue(d.RootKeyWrapperKeyParams,Mn.Nonwrapped),yield this.storage.removeValue(d.RootKeyParams,Mn.Nonwrapped),this.keyMode=xt.RootKeyNone,this.setRootKeyInstance(void 0),yield this.handleKeyStatusChange()}))}createRootKey(e,t,n,r){return Kn(this,void 0,void 0,(function*(){return(r?this.operators.operatorForVersion(r):this.operators.defaultOperator()).createRootKey(e,t,n)}))}validateAccountPassword(e){return Kn(this,void 0,void 0,(function*(){const t=yield this.computeRootKey(e,this.memoizedRootKeyParams),n=this.getSureRootKey().compare(t);return n?{valid:n,artifacts:{rootKey:t}}:{valid:!1}}))}validatePasscode(e){return Kn(this,void 0,void 0,(function*(){const t=this.getSureRootKeyWrapperKeyParams(),n=yield this.computeRootKey(e,t),r=yield this.validateWrappingKey(n);return r?{valid:r,artifacts:{wrappingKey:n}}:{valid:!1}}))}getEncryptionSourceVersion(){return Kn(this,void 0,void 0,(function*(){if(this.hasAccount())return this.getSureUserVersion();if(this.hasPasscode())return this.getSureRootKeyWrapperKeyParams().version;throw Error("Attempting to access encryption source version without source")}))}getSureUserVersion(){return this.memoizedRootKeyParams.version}handleKeyStatusChange(){return Kn(this,void 0,void 0,(function*(){this.recomputeAccountKeyParams(),this.notifyEvent(_t.RootKeyManagerKeyStatusChanged)}))}hasPasscode(){return this.keyMode===xt.WrapperOnly||this.keyMode===xt.RootKeyPlusWrapper}recomputeAccountKeyParams(){const e=this.storage.getValue(d.RootKeyParams,Mn.Nonwrapped);if(e)return this.memoizedRootKeyParams=(0,Pt.jl)(e),this.memoizedRootKeyParams}getSureRootKeyWrapperKeyParams(){return this.getRootKeyWrapperKeyParams()}wrapAndPersistRootKey(e){return Kn(this,void 0,void 0,(function*(){const t=this.getSureRootKey(),n=Object.assign(Object.assign({},t.payload.ejected()),{content:(0,I.FillItemContentSpecialized)(t.persistableValueWhenWrapping())}),r=new I.DecryptedPayload(n),i=new Jt(this.operators),o=yield i.executeOne(r,e),s=new I.EncryptedPayload(Object.assign(Object.assign(Object.assign({},r.ejected()),o),{errorDecrypting:!1,waitingForKey:!1}));this.storage.setValue(d.WrappedRootKey,s.ejected(),Mn.Nonwrapped)}))}unwrapRootKey(e){return Kn(this,void 0,void 0,(function*(){if(this.keyMode===xt.WrapperOnly)return void this.setRootKeyInstance(e);if(this.keyMode!==xt.RootKeyPlusWrapper)throw"Invalid key mode condition for unwrapping.";const t=this.getWrappedRootKey(),n=new I.EncryptedPayload(t),r=new zt(this.operators),i=yield r.executeOne(n,e);if((0,Pt.XL)(i))throw Error("Unable to decrypt root key with provided wrapping key.");{const e=new I.DecryptedPayload(Object.assign(Object.assign({},n.ejected()),i));this.setRootKeyInstance(new Pt.t$(e)),yield this.handleKeyStatusChange()}}))}setNewRootKeyWrapper(e){return Kn(this,void 0,void 0,(function*(){if(this.keyMode===xt.RootKeyNone)this.keyMode=xt.WrapperOnly;else{if(this.keyMode!==xt.RootKeyOnly)throw Error("Attempting to set wrapper on already wrapped key.");this.keyMode=xt.RootKeyPlusWrapper}if(yield this.device.clearNamespacedKeychainValue(this.identifier),this.keyMode!==xt.WrapperOnly&&this.keyMode!==xt.RootKeyPlusWrapper)throw Error("Invalid keyMode on setNewRootKeyWrapper");this.keyMode===xt.WrapperOnly?(this.setRootKeyInstance(e),yield this._reencryptTypeAItems.execute()):yield this.wrapAndPersistRootKey(e),this.storage.setValue(d.RootKeyWrapperKeyParams,e.keyParams.getPortableValue(),Mn.Nonwrapped),yield this.handleKeyStatusChange()}))}removeRootKeyWrapper(){return Kn(this,void 0,void 0,(function*(){if(this.keyMode!==xt.WrapperOnly&&this.keyMode!==xt.RootKeyPlusWrapper)throw Error("Attempting to remove root key wrapper on unwrapped key.");this.keyMode===xt.WrapperOnly?(this.keyMode=xt.RootKeyNone,this.setRootKeyInstance(void 0)):this.keyMode===xt.RootKeyPlusWrapper&&(this.keyMode=xt.RootKeyOnly),yield this.storage.removeValue(d.WrappedRootKey,Mn.Nonwrapped),yield this.storage.removeValue(d.RootKeyWrapperKeyParams,Mn.Nonwrapped),this.keyMode===xt.RootKeyOnly&&(yield this.saveRootKeyToKeychain()),yield this.handleKeyStatusChange()}))}setRootKey(e,t){return Kn(this,void 0,void 0,(function*(){if(!e.keyParams)throw Error("keyParams must be supplied if setting root key.");if(this.getRootKey()===e)throw Error("Attempting to set root key as same current value.");if(this.keyMode===xt.WrapperOnly)this.keyMode=xt.RootKeyPlusWrapper;else if(this.keyMode===xt.RootKeyNone)this.keyMode=xt.RootKeyOnly;else if(this.keyMode!==xt.RootKeyOnly&&this.keyMode!==xt.RootKeyPlusWrapper)throw Error("Unhandled key mode for setNewRootKey");if(this.setRootKeyInstance(e),this.storage.setValue(d.RootKeyParams,e.keyParams.getPortableValue(),Mn.Nonwrapped),this.keyMode===xt.RootKeyOnly)yield this.saveRootKeyToKeychain();else if(this.keyMode===xt.RootKeyPlusWrapper){if(!t)throw Error("wrappingKey must be supplied");yield this.wrapAndPersistRootKey(t)}yield this.handleKeyStatusChange()}))}getRootKeyParams(){if(this.keyMode===xt.WrapperOnly)return this.getRootKeyWrapperKeyParams();if(this.keyMode===xt.RootKeyOnly||this.keyMode===xt.RootKeyPlusWrapper)return this.recomputeAccountKeyParams();if(this.keyMode!==xt.RootKeyNone)throw"Unhandled key mode for getRootKeyParams"}getSureRootKeyParams(){return this.getRootKeyParams()}saveRootKeyToKeychain(){return Kn(this,void 0,void 0,(function*(){if(null==this.getRootKey())throw"Attempting to non-existent root key to the keychain.";if(this.keyMode!==xt.RootKeyOnly)throw"Should not be persisting wrapped key to keychain.";const e=this.getSureRootKey().getKeychainValue();return this.executeCriticalFunction((()=>this.device.setNamespacedKeychainValue(e,this.identifier)))}))}validateWrappingKey(e){return Kn(this,void 0,void 0,(function*(){const t=this.getWrappedRootKey();if(this.keyMode===xt.WrapperOnly)return this.storage.canDecryptWithKey(e);if(this.keyMode===xt.RootKeyOnly||this.keyMode===xt.RootKeyPlusWrapper){const n=new I.EncryptedPayload(t),r=new zt(this.operators),i=yield r.executeOne(n,e);return!(0,Pt.XL)(i)}throw"Unhandled case in validateWrappingKey"}))}getWrappedRootKey(){return this.storage.getValue(d.WrappedRootKey,Mn.Nonwrapped)}setRootKeyInstance(e){this.rootKey=e}getRootKey(){return this.rootKey}getSureRootKey(){return this.rootKey}getRootKeyFromKeychain(){return Kn(this,void 0,void 0,(function*(){const e=yield this.device.getNamespacedKeychainValue(this.identifier);if(null==e)return;const t=this.getSureRootKeyParams();return(0,Pt.C4)(Object.assign(Object.assign({},e),{keyParams:t.getPortableValue()}))}))}}!function(e){e.Restored="SessionEvent:SessionRestored",e.Revoked="SessionEvent:SessionRevoked",e.UserKeyPairChanged="SessionEvent:UserKeyPairChanged"}(Qn||(Qn={})),function(e){e.SharedVaultStatusChanged="SharedVaultStatusChanged",e.SharedVaultFileStorageUsageChanged="SharedVaultFileStorageUsageChanged"}(Un||(Un={})),function(e){e.NotificationReceived="NotificationReceived"}(Vn||(Vn={}));var Gn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Yn extends f{constructor(e,t,n,r,i,o,s,a,l,c,u,d,h,p,f){super(f),this.items=e,this.session=t,this.vaultUsers=n,this._syncLocalVaultsWithRemoteSharedVaults=r,this._getVault=i,this._getOwnedSharedVaults=o,this._createSharedVault=s,this._handleKeyPairChange=a,this._findContact=l,this._deleteThirdPartyVault=c,this._shareContactWithVault=u,this._convertToSharedVault=d,this._deleteSharedVault=h,this._discardItemsLocally=p,this.eventDisposers.push(e.addObserver(b.ContentType.TYPES.TrustedContact,(e=>{let{changed:t,source:n}=e;return Gn(this,void 0,void 0,(function*(){n===I.PayloadEmitSource.LocalChanged&&t.length>0&&this.handleTrustedContactsChange(t)}))})))}deinit(){super.deinit(),this.items=void 0,this.session=void 0,this._syncLocalVaultsWithRemoteSharedVaults=void 0,this._getVault=void 0,this._createSharedVault=void 0,this._handleKeyPairChange=void 0,this._findContact=void 0,this._deleteThirdPartyVault=void 0,this._shareContactWithVault=void 0,this._convertToSharedVault=void 0,this._deleteSharedVault=void 0}handleEvent(e){return Gn(this,void 0,void 0,(function*(){switch(e.type){case Qn.UserKeyPairChanged:{const t=e.payload;this._handleKeyPairChange.execute({newKeys:t.current,previousKeys:t.previous});break}case Vn.NotificationReceived:yield this.handleNotification(e.payload);break;case E.ReceivedRemoteSharedVaults:this.notifyEvent(Un.SharedVaultStatusChanged)}}))}handleNotification(e){return Gn(this,void 0,void 0,(function*(){switch(e.eventPayload.props.type.value){case b.NotificationType.TYPES.SelfRemovedFromSharedVault:{const t=this._getVault.execute({sharedVaultUuid:e.eventPayload.props.primaryIdentifier.value});t.isFailed()||(yield this._deleteThirdPartyVault.execute(t.getValue()));break}case b.NotificationType.TYPES.UserRemovedFromSharedVault:{const t=this._getVault.execute({sharedVaultUuid:e.eventPayload.props.primaryIdentifier.value});if(!t.isFailed()){const n=t.getValue();this.vaultUsers.invalidateVaultUsersCache(e.eventPayload.props.primaryIdentifier.value).catch(console.error),yield this._syncLocalVaultsWithRemoteSharedVaults.execute([n]),this.notifyEvent(Un.SharedVaultStatusChanged)}break}case b.NotificationType.TYPES.SharedVaultItemRemoved:{const t=this.items.findItem(e.eventPayload.props.secondaryIdentifier.value);t&&this._discardItemsLocally.execute([t]);break}case b.NotificationType.TYPES.SharedVaultFileRemoved:case b.NotificationType.TYPES.SharedVaultFileUploaded:case b.NotificationType.TYPES.UserDesignatedAsSurvivor:{const t=this._getVault.execute({sharedVaultUuid:e.eventPayload.props.primaryIdentifier.value});t.isFailed()||(yield this._syncLocalVaultsWithRemoteSharedVaults.execute([t.getValue()]),this.notifyEvent(Un.SharedVaultStatusChanged));break}}}))}createSharedVault(e){var t;return Gn(this,void 0,void 0,(function*(){return this._createSharedVault.execute({vaultName:e.name,vaultDescription:e.description,vaultIcon:e.iconString,userInputtedPassword:e.userInputtedPassword,storagePreference:null!==(t=e.storagePreference)&&void 0!==t?t:I.KeySystemRootKeyStorageMode.Synced})}))}convertVaultToSharedVault(e){return Gn(this,void 0,void 0,(function*(){return this._convertToSharedVault.execute({vault:e})}))}handleTrustedContactsChange(e){return Gn(this,void 0,void 0,(function*(){for(const t of e)t.isMe||(yield this.shareContactWithVaults(t))}))}deleteSharedVault(e){return Gn(this,void 0,void 0,(function*(){return this._deleteSharedVault.execute({sharedVault:e})}))}shareContactWithVaults(e){return Gn(this,void 0,void 0,(function*(){if(e.isMe)throw new Error("Cannot share self contact");const t=this._getOwnedSharedVaults.execute().getValue();for(const n of t)yield this._shareContactWithVault.execute({sharedVault:n,contactToShare:e})}))}getItemLastEditedBy(e){if(!e.last_edited_by_uuid)return;const t=this._findContact.execute({userUuid:e.last_edited_by_uuid});return t.isFailed()?void 0:t.getValue()}getItemSharedBy(e){if(!e.user_uuid||e.user_uuid===this.session.getSureUser().uuid)return;const t=this._findContact.execute({userUuid:e.user_uuid});return t.isFailed()?void 0:t.getValue()}}class zn{constructor(e){this.getVaultUsers=e}execute(e){return t=this,n=void 0,i=function*(){const t=yield this.getVaultUsers.execute({sharedVaultUuid:e.vault.sharing.sharedVaultUuid,readFromCache:!1});return t.isFailed()?b.Result.fail("Failed to get vault users"):b.Result.ok(t.getValue().some((t=>t.user_uuid===e.contact.contactUuid)))},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class Zn{constructor(e,t,n,r){this.mutator=e,this.sharedVaultServer=t,this._moveItemsToVault=n,this._getVaultItems=r}execute(e){return t=this,n=void 0,i=function*(){if(e.vault.isSharedVaultListing())throw new Error("Cannot convert a shared vault to a shared vault");const t=yield this.sharedVaultServer.createSharedVault();if((0,a.isErrorResponse)(t))return a.ClientDisplayableError.FromString("Failed to convert to shared vault ".concat(JSON.stringify(t)));const n=t.data.sharedVault,r=yield this.mutator.changeItem(e.vault,(e=>{e.sharing={sharedVaultUuid:n.uuid,ownerUserUuid:n.user_uuid,fileBytesUsed:n.file_upload_bytes_used,designatedSurvivor:null}})),i=this._getVaultItems.execute(r).getValue();return yield this._moveItemsToVault.execute({vault:r,items:i}),r},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class Wn{constructor(e,t,n,r,i){this.mutator=e,this.sharedVaultServer=t,this._createVault=n,this._moveItemsToVault=r,this._getVaultItems=i}execute(e){var t,n,r,i,o;return n=this,r=void 0,o=function*(){const n=yield this._createVault.execute({vaultName:e.vaultName,vaultDescription:e.vaultDescription,vaultIcon:e.vaultIcon,userInputtedPassword:e.userInputtedPassword,storagePreference:e.storagePreference}),r=yield this.sharedVaultServer.createSharedVault();if((0,a.isErrorResponse)(r))return a.ClientDisplayableError.FromString("Failed to create shared vault: ".concat(null===(t=r.data.error)||void 0===t?void 0:t.message));const i=r.data.sharedVault,o=yield this.mutator.changeItem(n,(e=>{e.sharing={sharedVaultUuid:i.uuid,ownerUserUuid:i.user_uuid,fileBytesUsed:i.file_upload_bytes_used,designatedSurvivor:null}})),s=this._getVaultItems.execute(o).getValue();return yield this._moveItemsToVault.execute({vault:o,items:s}),o},new((i=void 0)||(i=Promise))((function(e,t){function s(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(n,r||[])).next())}))}}var qn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Jn{constructor(e,t,n,r,i){this.items=e,this.mutator=t,this.keys=n,this.sync=r,this._discardItemsLocally=i}execute(e){return qn(this,void 0,void 0,(function*(){yield this.deleteDataSharedByVaultUsers(e),yield this.deleteDataOwnedByThisUser(e),yield this.keys.deleteNonPersistentSystemRootKeysForVault(e.systemIdentifier),this.sync.sync({sourceDescription:"Not awaiting due to this event handler running from sync response"})}))}deleteDataSharedByVaultUsers(e){return qn(this,void 0,void 0,(function*(){const t=this.items.allTrackedItems().filter((t=>t.key_system_identifier===e.systemIdentifier)),n=this.keys.getKeySystemItemsKeys(e.systemIdentifier);yield this._discardItemsLocally.execute([...t,...n])}))}deleteDataOwnedByThisUser(e){return qn(this,void 0,void 0,(function*(){const t=this.keys.getSyncedKeySystemRootKeysForVault(e.systemIdentifier);yield this.mutator.setItemsToBeDeleted(t),yield this.mutator.setItemToBeDeleted(e)}))}}class Xn{constructor(e,t,n){this.sharedVaultServer=e,this.sync=t,this.deleteVault=n}execute(e){return t=this,n=void 0,i=function*(){const t=yield this.sharedVaultServer.deleteSharedVault({sharedVaultUuid:e.sharedVault.sharing.sharedVaultUuid});if((0,a.isErrorResponse)(t))return a.ClientDisplayableError.FromString("Failed to delete vault ".concat(JSON.stringify(t)));yield this.deleteVault.execute(e.sharedVault),yield this.sync.sync()},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class $n{constructor(e,t){this._getSharedVaults=e,this._isVaultOwnwer=t}execute(){const e=this._getSharedVaults.execute().getValue().filter((e=>this._isVaultOwnwer.execute(e).getValue()));return b.Result.ok(e)}}class er{constructor(e){this.getVaults=e}execute(){const e=this.getVaults.execute().getValue().filter((e=>e.isSharedVaultListing()));return b.Result.ok(e)}}var tr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class nr{constructor(e,t,n,r,i,o,s){this._findContact=e,this._sendKeyChangedMessage=t,this._inviteToVault=n,this._inviteServer=r,this._getVaultContacts=i,this._decryptOwnMessage=o,this._getKeyPairs=s}execute(e){return tr(this,void 0,void 0,(function*(){return yield this.reinvitePendingInvites(e),yield this.performSendKeyChangeMessage(e),b.Result.ok()}))}reinvitePendingInvites(e){return tr(this,void 0,void 0,(function*(){const t=yield this.getExistingInvites(e.sharedVault.sharing.sharedVaultUuid);if(t.isFailed())return t;yield this.deleteAllInvites(e.sharedVault.sharing.sharedVaultUuid);const n=yield this._getVaultContacts.execute({sharedVaultUuid:e.sharedVault.sharing.sharedVaultUuid,readFromCache:!1}),r=this._getKeyPairs.execute();if(r.isFailed())return b.Result.fail("Cannot send metadata changed message; keys not found");for(const i of t.getValue()){const t=this._findContact.execute({userUuid:i.user_uuid});if(t.isFailed())continue;const o=this._decryptOwnMessage.execute({message:i.encrypted_message,privateKey:r.getValue().encryption.privateKey,recipientPublicKey:t.getValue().publicKeySet.encryption});if(o.isFailed())return b.Result.fail(o.getError());yield this._inviteToVault.execute({sharedVault:e.sharedVault,sharedVaultContacts:n.isFailed()?[]:n.getValue(),recipient:t.getValue(),permission:i.permission})}return b.Result.ok()}))}performSendKeyChangeMessage(e){return tr(this,void 0,void 0,(function*(){const t=yield this._sendKeyChangedMessage.execute({keySystemIdentifier:e.sharedVault.systemIdentifier,sharedVaultUuid:e.sharedVault.sharing.sharedVaultUuid});return t.isFailed()?t:b.Result.ok()}))}deleteAllInvites(e){return tr(this,void 0,void 0,(function*(){const t=yield this._inviteServer.deleteAllSharedVaultInvites({sharedVaultUuid:e});return(0,a.isErrorResponse)(t)?b.Result.fail("Failed to delete existing invites ".concat(JSON.stringify(t))):b.Result.ok()}))}getExistingInvites(e){return tr(this,void 0,void 0,(function*(){const t=yield this._inviteServer.getOutboundUserInvites();if((0,a.isErrorResponse)(t))return b.Result.fail("Failed to get outbound user invites ".concat(JSON.stringify(t)));const n=t.data.invites;return b.Result.ok(n.filter((t=>t.shared_vault_uuid===e)))}))}}const rr=[I.AsymmetricMessagePayloadType.SharedVaultRootKeyChanged,I.AsymmetricMessagePayloadType.SharedVaultMetadataChanged];function ir(e,t,n){if(rr.includes(e))return[e,t,n].join(":")}var or=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class sr{constructor(e,t,n,r,i,o,s){this.users=e,this._encryptMessage=t,this._findContact=n,this._getVaultUsers=r,this._sendMessage=i,this._isVaultOwner=o,this._getKeyPairs=s}execute(e){return or(this,void 0,void 0,(function*(){if(!this._isVaultOwner.execute(e.vault).getValue())return b.Result.ok();const t=yield this._getVaultUsers.execute({sharedVaultUuid:e.vault.sharing.sharedVaultUuid,readFromCache:!1});if(t.isFailed())return b.Result.fail("Cannot send metadata changed message; users not found");const n=this._getKeyPairs.execute();if(n.isFailed())return b.Result.fail("Cannot send metadata changed message; keys not found");const r=[];for(const i of t.getValue()){if(i.user_uuid===this.users.sureUser.uuid)continue;const t=this._findContact.execute({userUuid:i.user_uuid});if(t.isFailed())continue;const o=yield this.sendToContact({vault:e.vault,keys:n.getValue(),contact:t.getValue()});o.isFailed()&&r.push(o.getError())}return r.length>0?b.Result.fail(r.join(", ")):b.Result.ok()}))}sendToContact(e){return or(this,void 0,void 0,(function*(){const t={type:I.AsymmetricMessagePayloadType.SharedVaultMetadataChanged,data:{recipientUuid:e.contact.contactUuid,sharedVaultUuid:e.vault.sharing.sharedVaultUuid,name:e.vault.name,description:e.vault.description}},n=this._encryptMessage.execute({message:t,keys:e.keys,recipientPublicKey:e.contact.publicKeySet.encryption});if(n.isFailed())return b.Result.fail(n.getError());const r=ir(I.AsymmetricMessagePayloadType.SharedVaultMetadataChanged,e.vault.sharing.sharedVaultUuid,e.vault.systemIdentifier);return yield this._sendMessage.execute({recipientUuid:e.contact.contactUuid,encryptedMessage:n.getValue(),replaceabilityIdentifier:r})}))}}var ar=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class lr{constructor(e,t,n,r,i,o,s){this.users=e,this.keyManager=t,this._encryptMessage=n,this._findContact=r,this._sendMessage=i,this._getVaultUsers=o,this._getKeyPairs=s}execute(e){return ar(this,void 0,void 0,(function*(){const t=yield this._getVaultUsers.execute({sharedVaultUuid:e.sharedVaultUuid,readFromCache:!1});if(t.isFailed())return b.Result.fail("Cannot send root key changed message; users not found");const n=this._getKeyPairs.execute();if(n.isFailed())return b.Result.fail("Cannot send root key changed message; keys not found");const r=[];for(const i of t.getValue()){if(i.user_uuid===this.users.sureUser.uuid)continue;const t=this._findContact.execute({userUuid:i.user_uuid});if(t.isFailed())continue;const o=yield this.sendToContact({keySystemIdentifier:e.keySystemIdentifier,sharedVaultUuid:e.sharedVaultUuid,keys:n.getValue(),contact:t.getValue()});o.isFailed()&&r.push(o.getError())}return r.length>0?b.Result.fail(r.join(", ")):b.Result.ok()}))}sendToContact(e){return ar(this,void 0,void 0,(function*(){const t=this.keyManager.getPrimaryKeySystemRootKey(e.keySystemIdentifier);if(!t)throw new Error("Vault key not found for keySystemIdentifier ".concat(e.keySystemIdentifier));const n={type:I.AsymmetricMessagePayloadType.SharedVaultRootKeyChanged,data:{recipientUuid:e.contact.contactUuid,rootKey:t.content}},r=this._encryptMessage.execute({message:n,keys:e.keys,recipientPublicKey:e.contact.publicKeySet.encryption});if(r.isFailed())return b.Result.fail(r.getError());const i=ir(I.AsymmetricMessagePayloadType.SharedVaultRootKeyChanged,e.sharedVaultUuid,e.keySystemIdentifier);return yield this._sendMessage.execute({recipientUuid:e.contact.contactUuid,encryptedMessage:r.getValue(),replaceabilityIdentifier:i})}))}}class cr{constructor(e,t,n,r,i,o){this.users=e,this._findContact=t,this._encryptMessage=n,this._sendMessage=r,this._getVaultUsers=i,this._getKeyPairs=o}execute(e){return t=this,n=void 0,i=function*(){if(e.sharedVault.sharing.ownerUserUuid!==this.users.sureUser.uuid)return b.Result.fail("Cannot share contact; user is not the owner of the shared vault");const t=yield this._getVaultUsers.execute({sharedVaultUuid:e.sharedVault.sharing.sharedVaultUuid,readFromCache:!1});if(t.isFailed())return b.Result.fail("Cannot share contact; shared vault users not found");if(0===t.getValue().length)return b.Result.ok();const n=this._getKeyPairs.execute();if(n.isFailed())return b.Result.fail("Cannot share contact; keys not found");for(const r of t.getValue()){if(r.user_uuid===this.users.sureUser.uuid)continue;if(r.user_uuid===e.contactToShare.contactUuid)continue;const t=this._findContact.execute({userUuid:r.user_uuid});if(t.isFailed())continue;const i=this._encryptMessage.execute({message:{type:I.AsymmetricMessagePayloadType.ContactShare,data:{recipientUuid:t.getValue().contactUuid,trustedContact:e.contactToShare.content}},keys:n.getValue(),recipientPublicKey:t.getValue().publicKeySet.encryption});i.isFailed()||(yield this._sendMessage.execute({recipientUuid:t.getValue().contactUuid,encryptedMessage:i.getValue(),replaceabilityIdentifier:void 0}))}return b.Result.ok()},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}var ur;class dr{constructor(e,t){this.sharedVaultServer=e,this.mutator=t}execute(e){return t=this,n=void 0,i=function*(){const t=yield this.sharedVaultServer.getSharedVaults();if((0,a.isErrorResponse)(t))return b.Result.fail(t.data.error.message);const n=t.data.sharedVaults,r=t.data.designatedSurvivors||[];for(const t of e){if(!t.isSharedVaultListing())continue;const e=n.find((e=>e.uuid===t.sharing.sharedVaultUuid));if(e){const n=r.find((t=>t.sharedVaultUuid===e.uuid));yield this.mutator.changeItem(t,(t=>{t.sharing={sharedVaultUuid:e.uuid,ownerUserUuid:e.user_uuid,fileBytesUsed:e.file_upload_bytes_used,designatedSurvivor:n?n.userUuid:null}}))}}return b.Result.ok()},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}!function(e){e.MessageChanged="MessageChanged",e.PreferencesBubbleCountChanged="PreferencesBubbleCountChanged"}(ur||(ur={}));class hr extends f{constructor(){super(...arguments),this.preferencesBubbleCounts={general:0,account:0,security:0,"home-server":0,vaults:0,appearance:0,backups:0,listed:0,shortcuts:0,plugins:0,accessibility:0,"get-free-month":0,"help-feedback":0,"whats-new":0},this._message="",this.dynamicMessages=[]}getPreferencesBubbleCount(e){return this.preferencesBubbleCounts[e]}setPreferencesBubbleCount(e,t){this.preferencesBubbleCounts[e]=t;const n=this.totalPreferencesBubbleCount;this.notifyEvent(ur.PreferencesBubbleCountChanged,n>0?n.toString():void 0)}get totalPreferencesBubbleCount(){return Object.values(this.preferencesBubbleCounts).reduce(((e,t)=>e+t),0)}get message(){return this._message}setMessage(e){this.directSetMessage=e,this.recomputeMessage()}addMessage(e){return this.dynamicMessages.push(e),this.recomputeMessage(),e}removeMessage(e){(0,c.removeFromArray)(this.dynamicMessages,e),this.recomputeMessage()}recomputeMessage(){const e=[...this.dynamicMessages];this.directSetMessage&&e.unshift(this.directSetMessage),this._message=this.messageFromArray(e),this.notifyEvent(ur.MessageChanged,this._message)}messageFromArray(e){let t="";return e.forEach(((n,r)=>{const i=r===e.length-1;t+=n,i||(t+=", ")})),t}}class pr{constructor(){this.values=new Map}setValue(e,t){this.values.set(e,t)}getValue(e){return this.values.get(e)}removeValue(e){this.values.delete(e)}}class fr{constructor(e,t,n){this.storage=e,this.items=t,this.payloads=n}execute(e){return t=this,n=void 0,i=function*(){this.items.removeItemsFromMemory(e);const t=(yield this.storage.getRawPayloads((0,c.Uuids)(e))).map((e=>(0,I.CreatePayload)(e,I.PayloadSource.LocalDatabaseLoaded)));return yield this.payloads.emitPayloads(t,I.PayloadEmitSource.LocalDatabaseLoaded),b.Result.ok()},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}const gr={AccountDeleted:"Your account has been successfully deleted.",InvalidNote:"The note you are attempting to save can not be found or has been deleted. Changes you make will not be synced. Please copy this note's text and start a new note."};var mr,yr;!function(e){e.ProPlanYearly="pro_plan_yearly",e.PlusPlanYearly="plus_plan_yearly"}(mr||(mr={})),function(e){e.DidFetchSubscription="Subscription:DidFetchSubscription"}(yr||(yr={}));var vr,Ar,br,wr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Sr extends f{constructor(e,t,n,r,i){super(i),this.subscriptionApiService=e,this.sessions=t,this.storage=n,this.isApplicationUsingThirdPartyHostUseCase=r,this.internalEventBus=i}handleEvent(e){return wr(this,void 0,void 0,(function*(){switch(e.type){case L.Launched:{this.fetchOnlineSubscription();const e=this.isApplicationUsingThirdPartyHostUseCase.execute();if(e.isFailed())break;e.getValue()||this.fetchAvailableSubscriptions();break}case L.UserRolesChanged:case Qn.Restored:case L.SignedIn:this.fetchOnlineSubscription();break;case L.ApplicationStageChanged:e.payload.stage===y.StorageDecrypted_09&&this.loadSubscriptionFromStorage()}}))}loadSubscriptionFromStorage(){this.onlineSubscription=this.storage.getValue(d.Subscription),this.notifyEvent(yr.DidFetchSubscription)}hasOnlineSubscription(){return null!=this.onlineSubscription}getOnlineSubscription(){return this.onlineSubscription}getAvailableSubscriptions(){return this.availableSubscriptions}get userSubscriptionName(){if(!this.onlineSubscription)throw new Error("Attempting to get subscription name without a subscription.");return this.availableSubscriptions&&this.availableSubscriptions[this.onlineSubscription.planName]?this.availableSubscriptions[this.onlineSubscription.planName].name:""}get userSubscriptionExpirationDate(){if(this.onlineSubscription)return new Date((0,c.convertTimestampToMilliseconds)(this.onlineSubscription.endsAt))}get isUserSubscriptionExpired(){if(!this.onlineSubscription)throw new Error("Attempting to check subscription expiration without a subscription.");return!!this.userSubscriptionExpirationDate&&this.userSubscriptionExpirationDate.getTime()<(new Date).getTime()}get isUserSubscriptionCanceled(){if(!this.onlineSubscription)throw new Error("Attempting to check subscription expiration without a subscription.");return this.onlineSubscription.cancelled}acceptInvitation(e){return wr(this,void 0,void 0,(function*(){try{const t=yield this.subscriptionApiService.acceptInvite(e);return(0,a.isErrorResponse)(t)?{success:!1,message:(0,a.getErrorFromErrorResponse)(t).message}:t.data}catch(e){return{success:!1,message:"Could not accept invitation."}}}))}listSubscriptionInvitations(){var e;return wr(this,void 0,void 0,(function*(){try{const t=yield this.subscriptionApiService.listInvites();return(0,a.isErrorResponse)(t)?[]:null!==(e=t.data.invitations)&&void 0!==e?e:[]}catch(e){return[]}}))}inviteToSubscription(e){return wr(this,void 0,void 0,(function*(){try{const t=yield this.subscriptionApiService.invite(e);return!(0,a.isErrorResponse)(t)&&!0===t.data.success}catch(e){return!1}}))}cancelInvitation(e){return wr(this,void 0,void 0,(function*(){try{const t=yield this.subscriptionApiService.cancelInvite(e);return!(0,a.isErrorResponse)(t)&&!0===t.data.success}catch(e){return!1}}))}fetchOnlineSubscription(){return wr(this,void 0,void 0,(function*(){if(this.sessions.isSignedIn())try{const e=yield this.subscriptionApiService.getUserSubscription({userUuid:this.sessions.userUuid});if((0,a.isErrorResponse)(e))return;const t=e.data.subscription;this.handleReceivedOnlineSubscriptionFromServer(t)}catch(e){}}))}handleReceivedOnlineSubscriptionFromServer(e){this.onlineSubscription=e,this.storage.setValue(d.Subscription,e),this.notifyEvent(yr.DidFetchSubscription)}fetchAvailableSubscriptions(){return wr(this,void 0,void 0,(function*(){try{const e=yield this.subscriptionApiService.getAvailableSubscriptions();if((0,a.isErrorResponse)(e))return;this.availableSubscriptions=e.data}catch(e){}}))}confirmAppleIAP(e,t){return wr(this,void 0,void 0,(function*(){try{const n=yield this.subscriptionApiService.confirmAppleIAP(Object.assign(Object.assign({},e),{subscription_token:t}));return(0,a.isErrorResponse)(n)?{success:!1,message:(0,a.getErrorFromErrorResponse)(n).message}:n.data}catch(e){return{success:!1,message:"Could not confirm IAP."}}}))}}class Cr{constructor(){this.backoffPenalties=new Map,this.backoffStartTimestamps=new Map}isItemInBackoff(e){const t=this.backoffStartTimestamps.get(e.uuid);if(!t)return!1;const n=this.backoffPenalties.get(e.uuid);return!!n&&t+n>Date.now()}backoffItem(e){const t=this.backoffPenalties.get(e.uuid)||0,n=0===t?1e3:2*t;this.backoffPenalties.set(e.uuid,n),this.backoffStartTimestamps.set(e.uuid,Date.now())}}!function(e){e.Default="Default",e.DownloadFirst="DownloadFirst",e.LocalOnly="LocalOnly"}(vr||(vr={}));class Er{constructor(e,t){this.completedUpload=0,this.totalUpload=0,this.downloaded=0,this.databaseLoadCurrent=0,this.databaseLoadTotal=0,this.databaseLoadDone=!1,this.syncing=!1,this.interval=e,this.receiver=t}deinit(){this.stopTimingMonitor()}setUploadStatus(e,t){this.completedUpload=e,this.totalUpload=t,this.receiver(E.StatusChanged)}setDownloadStatus(e){this.downloaded+=e,this.receiver(E.StatusChanged)}setDatabaseLoadStatus(e,t,n){this.databaseLoadCurrent=e,this.databaseLoadTotal=t,this.databaseLoadDone=n,n?this.receiver(E.LocalDataLoaded):this.receiver(E.LocalDataIncrementalLoad)}getStats(){return{uploadCompletionCount:this.completedUpload,uploadTotalCount:this.totalUpload,downloadCount:this.downloaded,localDataDone:this.databaseLoadDone,localDataCurrent:this.databaseLoadCurrent,localDataTotal:this.databaseLoadTotal}}setDidBegin(){this.syncing=!0,this.syncStart=new Date}setDidEnd(){this.syncing=!1}get syncInProgress(){return!0===this.syncing}get secondsSinceSyncStart(){return((new Date).getTime()-this.syncStart.getTime())/1e3}startTimingMonitor(){this.timingMonitor&&this.stopTimingMonitor(),this.timingMonitor=this.interval((()=>{this.secondsSinceSyncStart>5&&(this.receiver(E.SyncTakingTooLong),this.stopTimingMonitor())}),500)}stopTimingMonitor(){Object.prototype.hasOwnProperty.call(this.interval,"cancel")?this.interval.cancel(this.timingMonitor):clearInterval(this.timingMonitor),this.timingMonitor=null}hasError(){return!!this.error}setError(e){this.error=e}clearError(){this.error=null}reset(){this.downloaded=0,this.completedUpload=0,this.totalUpload=0,this.syncing=!1,this.error=null,this.stopTimingMonitor(),this.receiver(E.StatusChanged)}}!function(e){e[e.ResolveOnNext=1]="ResolveOnNext",e[e.ForceSpawnNew=2]="ForceSpawnNew"}(Ar||(Ar={})),function(e){e.External="External",e.SpawnQueue="SpawnQueue",e.ResolveQueue="ResolveQueue",e.MoreDirtyItems="MoreDirtyItems",e.DownloadFirst="DownloadFirst",e.AfterDownloadFirst="AfterDownloadFirst",e.IntegrityCheck="IntegrityCheck",e.ResolveOutOfSync="ResolveOutOfSync"}(br||(br={}));class Ir{constructor(e,t,n){this.items=e,this.mutator=t,this.sync=n}execute(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;return o=this,s=void 0,l=function*(){return yield this.mutator.changeItems([e],t,n?I.MutationType.UpdateUserTimestamps:I.MutationType.NoUpdateUserTimestamps,r),yield this.sync.sync(i),b.Result.ok(this.items.findItem(e.uuid))},new((a=void 0)||(a=Promise))((function(e,t){function n(e){try{i(l.next(e))}catch(e){t(e)}}function r(e){try{i(l.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(n,r)}i((l=l.apply(o,s||[])).next())}));var o,s,a,l}}class _r{constructor(e,t){this.items=e,this.storage=t}execute(e){return t=this,n=void 0,i=function*(){this.items.removeItemsFromMemory(e),yield this.storage.deletePayloadsWithUuids((0,c.Uuids)(e))},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class xr{constructor(e){this.crypto=e}execute(){const e=this.crypto.generateUUID();return b.Result.ok(e)}}class Pr{constructor(e){this.legacyApi=e}execute(){return b.Result.ok(this.legacyApi.getHost())}}class kr{constructor(e){this.getHostUseCase=e,this.APPLICATION_DEFAULT_HOSTS=["api.standardnotes.com","sync.standardnotes.org","localhost:3123"],this.FILES_DEFAULT_HOSTS=["files.standardnotes.com"]}execute(){const e=this.getHostUseCase.execute();if(e.isFailed())return b.Result.fail(e.getError());const t=e.getValue();return b.Result.ok(!this.isUrlFirstParty(t))}isUrlFirstParty(e){try{const{host:t}=new URL(e);return this.APPLICATION_DEFAULT_HOSTS.includes(t)||this.FILES_DEFAULT_HOSTS.includes(t)}catch(e){return!1}}}var Br;class Or{constructor(e,t){this.http=e,this.legacyApi=t}execute(e){return t=this,n=void 0,i=function*(){return this.http.setHost(e),yield this.legacyApi.setHost(e),b.Result.ok()},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}!function(e){e.SignedInOrRegistered="SignedInOrRegistered",e.SignedOut="SignedOut"}(Br||(Br={}));var Nr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Dr extends f{constructor(e,t,n,r,i,o,s,a,l,c,u,d){super(d),this.sessions=e,this.sync=t,this.storage=n,this.items=r,this.encryption=i,this.alerts=o,this.challenges=s,this.protections=a,this.userApi=l,this._reencryptTypeAItems=c,this._decryptErroredPayloads=u,this.internalEventBus=d,this.signingIn=!1,this.registering=!1,this.MINIMUM_PASSCODE_LENGTH=1,this.MINIMUM_PASSWORD_LENGTH=8}deinit(){super.deinit(),this.sessions=void 0,this.sync=void 0,this.storage=void 0,this.items=void 0,this.encryption=void 0,this.alerts=void 0,this.challenges=void 0,this.protections=void 0,this.userApi=void 0,this._reencryptTypeAItems=void 0,this._decryptErroredPayloads=void 0}handleEvent(e){return Nr(this,void 0,void 0,(function*(){if(e.type===Br.SignedInOrRegistered){const t=e.payload.payload;this.sync.resetSyncState(),yield this.storage.setPersistencePolicy(t.ephemeral?Tn.Ephemeral:Tn.Default),t.mergeLocal?yield this.sync.markAllItemsAsNeedingSyncAndPersist():(this.items.removeAllItemsFromMemory(),yield this.clearDatabase()),this.unlockSyncing();const n=this.sync.downloadFirstSync(1e3,{checkIntegrity:t.checkIntegrity,awaitAll:t.awaitSync}).then((()=>{t.awaitSync||this._decryptErroredPayloads.execute()}));t.awaitSync&&(yield n,yield this._decryptErroredPayloads.execute())}}))}get user(){return this.sessions.getUser()}get sureUser(){return this.sessions.getSureUser()}getUserUuid(){return this.sessions.userUuid}isSignedIn(){return this.sessions.isSignedIn()}register(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return Nr(this,void 0,void 0,(function*(){if(this.encryption.hasAccount())throw Error("Tried to register when an account already exists.");if(this.registering)throw Error("Already registering.");this.registering=!0;try{this.lockSyncing();const o=yield this.sessions.register(e,t,n,r);return yield this.notifyEventSync(Br.SignedInOrRegistered,{payload:{ephemeral:r,mergeLocal:i,awaitSync:!0,checkIntegrity:!1}}),this.registering=!1,o}catch(e){throw this.unlockSyncing(),this.registering=!1,e}}))}signIn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6?arguments[6]:void 0;return Nr(this,void 0,void 0,(function*(){if(this.encryption.hasAccount())throw Error("Tried to sign in when an account already exists.");if(this.signingIn)throw Error("Already signing in.");this.signingIn=!0;try{this.lockSyncing();const{response:l}=yield this.sessions.signIn(e,t,n,r,void 0,s);if((0,a.isErrorResponse)(l))this.unlockSyncing();else{const e=o?this.notifyEventSync.bind(this):this.notifyEvent.bind(this);yield e(Br.SignedInOrRegistered,{payload:{mergeLocal:i,awaitSync:o,ephemeral:r,checkIntegrity:!0}})}return l}finally{this.signingIn=!1}}))}deleteAccount(){return Nr(this,void 0,void 0,(function*(){if(!(yield this.protections.authorizeAction(Ke.DeleteAccount,{fallBackToAccountPassword:!0,requireAccountPassword:!0,forcePrompt:!1})))return{error:!0,message:Ee};const e=this.sessions.getSureUser().uuid,t=yield this.userApi.deleteAccount(e);return(0,a.isErrorResponse)(t)?{error:!0,message:(0,a.getErrorFromErrorResponse)(t).message}:(yield this.signOut(!0),this.alerts&&this.alerts.alert(gr.AccountDeleted),{error:!1})}))}submitUserRequest(e){return Nr(this,void 0,void 0,(function*(){const t=this.sessions.getSureUser().uuid;try{const n=yield this.userApi.submitUserRequest({userUuid:t,requestType:e});return!(0,a.isErrorResponse)(n)&&n.data.success}catch(e){return!1}}))}correctiveSignIn(e){return Nr(this,void 0,void 0,(function*(){this.lockSyncing();const t=yield this.sessions.bypassChecksAndSignInWithRootKey(e.keyParams.identifier,e,!1);return(0,a.isErrorResponse)(t)||(yield this.notifyEvent(Br.SignedInOrRegistered,{payload:{mergeLocal:!0,awaitSync:!0,ephemeral:!1,checkIntegrity:!0}})),this.unlockSyncing(),t}))}changeCredentials(e){return Nr(this,void 0,void 0,(function*(){const t=yield this.performCredentialsChange(e);return t.error&&this.alerts.alert(t.error.message),t}))}signOut(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:A.SignOut;return Nr(this,void 0,void 0,(function*(){const n=()=>Nr(this,void 0,void 0,(function*(){yield this.sessions.signOut(),yield this.encryption.deleteWorkspaceSpecificKeyStateFromDevice(),yield this.storage.clearAllData(),yield this.notifyEvent(Br.SignedOut,{payload:{source:t}})}));if(e)return void(yield n());const r=this.items.getDirtyItems();if(r.length>0){const e=1===r.length;(yield this.alerts.confirm("There ".concat(e?"is":"are"," ").concat(r.length," ").concat(e?"item":"items"," with unsynced changes. If you sign out, these changes will be lost forever. Are you sure you want to sign out?")))&&(yield n())}else yield n()}))}updateAccountWithFirstTimeKeyPair(){return Nr(this,void 0,void 0,(function*(){if(!this.sessions.isUserMissingKeyPair())throw Error("Cannot update account with first time keypair if user already has a keypair");return yield this.performProtocolUpgrade()}))}performProtocolUpgrade(){return Nr(this,void 0,void 0,(function*(){const e=this.encryption.hasPasscode(),t=this.encryption.hasAccount(),n=[];e&&n.push(new ze(He.LocalPasscode,void 0,Qe.LocalPasscodePlaceholder)),t&&n.push(new ze(He.AccountPassword,void 0,Qe.AccountPasswordPlaceholder));const r=new Ge(n,Ke.ProtocolUpgrade,!0),i=yield this.challenges.promptForChallengeResponse(r);if(!i)return{canceled:!0};const o=yield this.alerts.blockingDialog(Be,_e);try{let n;if(e&&(n=i.getValueForType(He.LocalPasscode).value),t){const e=i.getValueForType(He.AccountPassword).value,t=yield this.changeCredentials({currentPassword:e,newPassword:e,passcode:n,origination:kt.KeyParamsOrigination.ProtocolUpgrade,validateNewPasswordStrength:!1});if(null==t?void 0:t.error)return{error:t.error}}return e&&(yield this.removePasscodeWithoutWarning(),yield this.setPasscodeWithoutWarning(n,kt.KeyParamsOrigination.ProtocolUpgrade)),{success:!0}}catch(e){return{error:e}}finally{o()}}))}addPasscode(e){return Nr(this,void 0,void 0,(function*(){if(e.length<this.MINIMUM_PASSCODE_LENGTH)return!1;if(!(yield this.protections.authorizeAddingPasscode()))return!1;const t=yield this.alerts.blockingDialog(Be,xe);try{return yield this.setPasscodeWithoutWarning(e,kt.KeyParamsOrigination.PasscodeCreate),!0}finally{t()}}))}removePasscode(){return Nr(this,void 0,void 0,(function*(){if(!(yield this.protections.authorizeRemovingPasscode()))return!1;const e=yield this.alerts.blockingDialog(Be,ke);try{return yield this.removePasscodeWithoutWarning(),!0}finally{e()}}))}changePasscode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:kt.KeyParamsOrigination.PasscodeChange;return Nr(this,void 0,void 0,(function*(){if(e.length<this.MINIMUM_PASSCODE_LENGTH)return!1;if(!(yield this.protections.authorizeChangingPasscode()))return!1;const n=yield this.alerts.blockingDialog(Be,t===kt.KeyParamsOrigination.ProtocolUpgrade?Fe.UpgradingPasscode:Pe);try{return yield this.removePasscodeWithoutWarning(),yield this.setPasscodeWithoutWarning(e,t),!0}finally{n()}}))}populateSessionFromDemoShareToken(e){return Nr(this,void 0,void 0,(function*(){yield this.sessions.populateSessionFromDemoShareToken(e),yield this.notifyEvent(Br.SignedInOrRegistered,{payload:{ephemeral:!1,mergeLocal:!1,checkIntegrity:!1,awaitSync:!0}})}))}setPasscodeWithoutWarning(e,t){return Nr(this,void 0,void 0,(function*(){const n=c.UuidGenerator.GenerateUuid(),r=yield this.encryption.createRootKey(n,e,t);yield this.encryption.setNewRootKeyWrapper(r),yield this.rewriteItemsKeys(),yield this.sync.sync()}))}removePasscodeWithoutWarning(){return Nr(this,void 0,void 0,(function*(){yield this.encryption.removePasscode(),yield this.rewriteItemsKeys()}))}rewriteItemsKeys(){return Nr(this,void 0,void 0,(function*(){const e=this.items.getDisplayableItemsKeys().map((e=>e.payloadRepresentation()));yield this.storage.deletePayloads(e),yield this.sync.persistPayloads(e)}))}lockSyncing(){this.sync.lockSyncing()}unlockSyncing(){this.sync.unlockSyncing()}clearDatabase(){return this.storage.clearAllPayloads()}performCredentialsChange(e){var t;return Nr(this,void 0,void 0,(function*(){const{wrappingKey:n,canceled:r}=yield this.challenges.getWrappingKeyIfApplicable(e.passcode);if(r)return{error:Error(je.PasscodeRequired)};if(void 0!==e.newPassword&&e.validateNewPasswordStrength&&e.newPassword.length<this.MINIMUM_PASSWORD_LENGTH)return{error:Error(Ne(this.MINIMUM_PASSWORD_LENGTH))};if(!(yield this.encryption.validateAccountPassword(e.currentPassword)).valid)return{error:Error(Ee)};const i=e.newEmail?e.newEmail.trim().toLowerCase():void 0,o=this.sessions.getUser().email,{currentRootKey:s,newRootKey:l}=yield this.recomputeRootKeysForCredentialChange({currentPassword:e.currentPassword,currentEmail:o,origination:e.origination,newEmail:i,newPassword:e.newPassword});this.lockSyncing();const{response:c}=yield this.sessions.changeCredentials({currentServerPassword:s.serverPassword,newRootKey:l,wrappingKey:n,newEmail:i});if(this.unlockSyncing(),(0,a.isErrorResponse)(c))return{error:Error(null===(t=c.data.error)||void 0===t?void 0:t.message)};const u=yield this.encryption.createNewItemsKeyWithRollback();return yield this._reencryptTypeAItems.execute(),yield this.sync.sync({awaitAll:!0}),this.encryption.getSureDefaultItemsKey().neverSynced?(yield this.sessions.changeCredentials({currentServerPassword:l.serverPassword,newRootKey:s,wrappingKey:n}),yield this._reencryptTypeAItems.execute(),yield u(),yield this.sync.sync({awaitAll:!0}),{error:Error(je.Failed)}):{}}))}recomputeRootKeysForCredentialChange(e){var t,n;return Nr(this,void 0,void 0,(function*(){return{currentRootKey:yield this.encryption.computeRootKey(e.currentPassword,this.encryption.getRootKeyParams()),newRootKey:yield this.encryption.createRootKey(null!==(t=e.newEmail)&&void 0!==t?t:e.currentEmail,null!==(n=e.newPassword)&&void 0!==n?n:e.currentPassword,e.origination)}}))}}var jr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Tr extends f{constructor(e){super(e),this.handledNotifications=new Set}handleEvent(e){return jr(this,void 0,void 0,(function*(){switch(e.type){case E.ReceivedNotifications:return this.handleReceivedNotifications(e.payload);case s.NotificationAddedForUser:return this.handleReceivedNotifications([e.payload.notification])}}))}handleReceivedNotifications(e){return jr(this,void 0,void 0,(function*(){if(0!==e.length)for(const t of e){if(this.handledNotifications.has(t.uuid))continue;this.handledNotifications.add(t.uuid);const e=b.NotificationPayload.createFromString(t.payload);if(e.isFailed())continue;const n={eventPayload:e.getValue()};yield this.notifyEventSync(Vn.NotificationReceived,n)}}))}}var Mr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Fr{constructor(e,t,n,r){this.vaultLocks=e,this.protection=t,this.challenges=n,this._validateVaultPassword=r}execute(e){return Mr(this,void 0,void 0,(function*(){if(!this.vaultLocks.isVaultLockable(e)){const e=yield this.protection.authorizeAction(Ke.Custom,{fallBackToAccountPassword:!0,requireAccountPassword:!1,forcePrompt:!0});return b.Result.ok(e)}const t=new Ge([new ze(He.None,void 0,"Password")],Ke.Custom,!0,Qe.DeleteVault(e.name),Qe.EnterVaultPassword);return new Promise((n=>{this.challenges.addChallengeObserver(t,{onCancel(){n(b.Result.ok(!1))},onNonvalidatedSubmit:r=>Mr(this,void 0,void 0,(function*(){const i=r.getDefaultValue();if(!i)return this.challenges.completeChallenge(t),void n(b.Result.ok(!1));const o=i.value;return this.vaultLocks.isVaultLocked(e)&&(yield this.vaultLocks.unlockNonPersistentVault(e,o))||this._validateVaultPassword.execute(e,o).getValue()?(this.challenges.completeChallenge(t),void n(b.Result.ok(!0))):(this.challenges.setValidationStatusForChallenge(t,i,!1),void n(b.Result.ok(!1)))}))}),this.challenges.promptForChallengeResponse(t)}))}))}}class Rr{constructor(e,t,n){this.sync=e,this._rotateVaultKey=t,this._changeVaultStorageMode=n}execute(e){return t=this,n=void 0,i=function*(){let t=e.newStorageMode,n=e.vault;if(e.newPasswordOptions){if(e.newPasswordOptions.passwordType===I.KeySystemPasswordType.Randomized&&e.newStorageMode&&e.newStorageMode!==I.KeySystemRootKeyStorageMode.Synced)return b.Result.fail("Cannot change storage mode to non-synced for randomized vault");if(e.newPasswordOptions.passwordType===I.KeySystemPasswordType.UserInputted&&!e.newPasswordOptions.userInputtedPassword)return b.Result.fail("User inputted password required");const r=yield this._rotateVaultKey.execute({vault:e.vault,userInputtedPassword:e.newPasswordOptions.passwordType===I.KeySystemPasswordType.UserInputted?e.newPasswordOptions.userInputtedPassword:void 0});if(r.isFailed())return r;n=r.getValue(),e.newPasswordOptions.passwordType===I.KeySystemPasswordType.Randomized&&(t=I.KeySystemRootKeyStorageMode.Synced)}if(t&&t!==n.keyStorageMode){const e=yield this._changeVaultStorageMode.execute({vault:n,newStorageMode:t});if(e.isFailed())return e}return yield this.sync.sync(),b.Result.ok()},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}var Lr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Qr{constructor(e,t,n,r){this.mutator=e,this.sync=t,this.keys=n,this._getVault=r}execute(e){return Lr(this,void 0,void 0,(function*(){const t=this._getVault.execute({keySystemIdentifier:e.vault.systemIdentifier});if(t.isFailed())return b.Result.fail("Vault not found");if(t.getValue().keyPasswordType===I.KeySystemPasswordType.Randomized&&e.newStorageMode!==I.KeySystemRootKeyStorageMode.Synced)return b.Result.fail("Cannot change storage mode to non-synced for randomized vault");const n=t.getValue();if(e.newStorageMode===n.keyStorageMode)return b.Result.fail("Vault already uses this storage preference");if(e.newStorageMode===I.KeySystemRootKeyStorageMode.Local||e.newStorageMode===I.KeySystemRootKeyStorageMode.Ephemeral){const t=yield this.changeStorageModeToLocalOrEphemeral(n,e.newStorageMode);if(t.isFailed())return t}else if(e.newStorageMode===I.KeySystemRootKeyStorageMode.Synced){const e=yield this.changeStorageModeToSynced(n);if(e.isFailed())return e}return b.Result.ok()}))}changeStorageModeToLocalOrEphemeral(e,t){return Lr(this,void 0,void 0,(function*(){const n=this.keys.getPrimaryKeySystemRootKey(e.systemIdentifier);if(!n)return b.Result.fail("No primary key found");t===I.KeySystemRootKeyStorageMode.Ephemeral&&this.keys.removeKeyFromCache(e.systemIdentifier),this.keys.cacheKey(n,t),yield this.keys.deleteAllSyncedKeySystemRootKeys(e.systemIdentifier);const r=yield this.mutator.changeItem(e,(e=>{e.keyStorageMode=t}));return yield this.sync.sync(),b.Result.ok(r)}))}changeStorageModeToSynced(e){return Lr(this,void 0,void 0,(function*(){const t=this.keys.getAllKeySystemRootKeysForVault(e.systemIdentifier),n=this.keys.getSyncedKeySystemRootKeysForVault(e.systemIdentifier);this.keys.removeKeyFromCache(e.systemIdentifier);for(const e of t)n.find((t=>t.token===e.token))||(yield this.mutator.insertItem(e));const r=yield this.mutator.changeItem(e,(e=>{e.keyStorageMode=I.KeySystemRootKeyStorageMode.Synced}));return b.Result.ok(r)}))}}var Ur=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Vr{constructor(e,t,n,r){this.mutator=e,this.encryption=t,this.keys=n,this.sync=r}execute(e){return Ur(this,void 0,void 0,(function*(){const t=c.UuidGenerator.GenerateUuid(),n=yield this.createKeySystemRootKey({keySystemIdentifier:t,vaultName:e.vaultName,vaultDescription:e.vaultDescription,userInputtedPassword:e.userInputtedPassword,storagePreference:e.storagePreference});yield this.createKeySystemItemsKey(t,n.token);const r=yield this.createVaultListing({keySystemIdentifier:t,vaultName:e.vaultName,vaultDescription:e.vaultDescription,vaultIcon:e.vaultIcon,passwordType:e.userInputtedPassword?I.KeySystemPasswordType.UserInputted:I.KeySystemPasswordType.Randomized,rootKeyParams:n.keyParams,storage:e.storagePreference});return yield this.sync.sync(),r}))}createVaultListing(e){return Ur(this,void 0,void 0,(function*(){const t={systemIdentifier:e.keySystemIdentifier,rootKeyParams:e.rootKeyParams,keyStorageMode:e.storage,name:e.vaultName,description:e.vaultDescription,iconString:e.vaultIcon};return this.mutator.createItem(b.ContentType.TYPES.VaultListing,(0,I.FillItemContentSpecialized)(t),!0)}))}createKeySystemItemsKey(e,t){return Ur(this,void 0,void 0,(function*(){const n=this.encryption.createKeySystemItemsKey(c.UuidGenerator.GenerateUuid(),e,void 0,t);yield this.mutator.insertItem(n)}))}createKeySystemRootKey(e){return Ur(this,void 0,void 0,(function*(){let t;return t=e.userInputtedPassword?this.encryption.createUserInputtedKeySystemRootKey({systemIdentifier:e.keySystemIdentifier,userInputtedPassword:e.userInputtedPassword}):this.encryption.createRandomizedKeySystemRootKey({systemIdentifier:e.keySystemIdentifier}),e.storagePreference===I.KeySystemRootKeyStorageMode.Synced?yield this.mutator.insertItem(t,!0):this.keys.cacheKey(t,e.storagePreference),t}))}}class Kr{constructor(e,t,n){this.mutator=e,this.keys=t,this._getVaultItems=n}execute(e){return t=this,n=void 0,i=function*(){if(!e.systemIdentifier)throw new Error("Vault system identifier is missing");yield this.keys.deleteNonPersistentSystemRootKeysForVault(e.systemIdentifier);const t=this.keys.getSyncedKeySystemRootKeysForVault(e.systemIdentifier);yield this.mutator.setItemsToBeDeleted(t);const n=this.keys.getKeySystemItemsKeys(e.systemIdentifier);yield this.mutator.setItemsToBeDeleted(n);const r=this._getVaultItems.execute(e).getValue();yield this.mutator.setItemsToBeDeleted(r),yield this.mutator.setItemToBeDeleted(e)},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class Hr{constructor(e){this.items=e}execute(e){const t=this.items.getItems(b.ContentType.TYPES.VaultListing);if("keySystemIdentifier"in e){const n=t.find((t=>t.systemIdentifier===e.keySystemIdentifier));return n?b.Result.ok(n):b.Result.fail("Vault not found")}{const n=t.find((t=>{var n;return(null===(n=t.sharing)||void 0===n?void 0:n.sharedVaultUuid)===e.sharedVaultUuid}));return n?b.Result.ok(n):b.Result.fail("Shared vault not found")}}}class Gr{constructor(e){this.items=e}execute(e){return b.Result.ok(this.items.items.filter((t=>t.key_system_identifier===e.systemIdentifier)))}}class Yr{constructor(e){this.items=e}execute(){const e=this.items.getItems(b.ContentType.TYPES.VaultListing).sort(((e,t)=>e.name.localeCompare(t.name)));return b.Result.ok(e)}}class zr{constructor(e,t,n){this.mutator=e,this.sync=t,this.files=n}execute(e){return t=this,n=void 0,i=function*(){for(const t of e.items)yield this.mutator.changeItem(t,(t=>{t.key_system_identifier=e.vault.systemIdentifier,t.shared_vault_uuid=e.vault.isSharedVaultListing()?e.vault.sharing.sharedVaultUuid:void 0}));yield this.sync.sync();for(const t of e.items)t.content_type===b.ContentType.TYPES.File&&(e.vault.isSharedVaultListing()?yield this.files.moveFileToSharedVault(t,e.vault):t.shared_vault_uuid&&(yield this.files.moveFileOutOfSharedVault(t)))},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class Zr{constructor(e,t,n){this.mutator=e,this.sync=t,this.files=n}execute(e){return t=this,n=void 0,i=function*(){yield this.mutator.changeItem(e.item,(e=>{e.key_system_identifier=void 0,e.shared_vault_uuid=void 0})),yield this.sync.sync(),e.item.content_type===b.ContentType.TYPES.File&&(yield this.files.moveFileOutOfSharedVault(e.item))},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}var Wr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class qr{constructor(e,t,n,r,i){this.mutator=e,this.encryption=t,this.keys=n,this._notifyVaultUsersOfKeyRotation=r,this._isVaultOwner=i}execute(e){return Wr(this,void 0,void 0,(function*(){const{newRootKey:t,updatedVault:n}=yield this.updateRootKeyparams(e);yield this.createNewKeySystemItemsKey({keySystemIdentifier:n.systemIdentifier,sharedVaultUuid:n.isSharedVaultListing()?n.sharing.sharedVaultUuid:void 0,rootKeyToken:t.token}),yield this.keys.queueVaultItemsKeysForReencryption(n.systemIdentifier);const r=yield this.shareNewKeyWithMembers({vault:n,newRootKey:t});return r.isFailed()?b.Result.fail(r.getError()):b.Result.ok(n)}))}updateRootKeyparams(e){return Wr(this,void 0,void 0,(function*(){if(!this.keys.getPrimaryKeySystemRootKey(e.vault.systemIdentifier))throw new Error("Cannot rotate key system root key; key system root key not found");let t;if(t=e.userInputtedPassword?this.encryption.createUserInputtedKeySystemRootKey({systemIdentifier:e.vault.systemIdentifier,userInputtedPassword:e.userInputtedPassword}):this.encryption.createRandomizedKeySystemRootKey({systemIdentifier:e.vault.systemIdentifier}),!t)throw new Error("Cannot rotate key system root key; new root key not created");e.userInputtedPassword&&e.vault.keyStorageMode!==I.KeySystemRootKeyStorageMode.Synced?this.keys.cacheKey(t,e.vault.keyStorageMode):yield this.mutator.insertItem(t,!0);const n=yield this.mutator.changeItem(e.vault,(e=>{(0,c.assert)(t),e.rootKeyParams=t.keyParams}));return{newRootKey:t,updatedVault:n}}))}createNewKeySystemItemsKey(e){return Wr(this,void 0,void 0,(function*(){const t=c.UuidGenerator.GenerateUuid(),n=this.encryption.createKeySystemItemsKey(t,e.keySystemIdentifier,e.sharedVaultUuid,e.rootKeyToken);yield this.mutator.insertItem(n)}))}shareNewKeyWithMembers(e){return Wr(this,void 0,void 0,(function*(){return e.vault.isSharedVaultListing()&&this._isVaultOwner.execute(e.vault).getValue()?yield this._notifyVaultUsersOfKeyRotation.execute({sharedVault:e.vault}):b.Result.ok()}))}}var Jr,Xr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class $r extends f{constructor(e,t,n,r,i,o,s,a,l,c,u,d,h,p,f,g,m,y){super(y),this.sync=e,this.items=t,this.mutator=n,this.vaultLocks=r,this.alerts=i,this._getVault=o,this._getVaults=s,this._changeVaultKeyOptions=a,this._moveItemsToVault=l,this._createVault=c,this._removeItemFromVault=u,this._deleteVault=d,this._rotateVaultKey=h,this._sendVaultDataChangeMessage=p,this._isVaultOwner=f,this._validateVaultPassword=g,this._authorizeVaultDeletion=m}deinit(){super.deinit(),this.sync=void 0,this.items=void 0,this.mutator=void 0,this.vaultLocks=void 0,this.alerts=void 0,this._getVault=void 0,this._getVaults=void 0,this._changeVaultKeyOptions=void 0,this._moveItemsToVault=void 0,this._createVault=void 0,this._removeItemFromVault=void 0,this._deleteVault=void 0,this._rotateVaultKey=void 0}getVaults(){return this._getVaults.execute().getValue()}getVault(e){return this._getVault.execute(e)}createRandomizedVault(e){return Xr(this,void 0,void 0,(function*(){return this.createVaultWithParameters({name:e.name,description:e.description,iconString:e.iconString,userInputtedPassword:void 0,storagePreference:I.KeySystemRootKeyStorageMode.Synced})}))}createUserInputtedPasswordVault(e){return Xr(this,void 0,void 0,(function*(){return this.createVaultWithParameters(e)}))}createVaultWithParameters(e){return Xr(this,void 0,void 0,(function*(){return yield this._createVault.execute({vaultName:e.name,vaultDescription:e.description,vaultIcon:e.iconString,userInputtedPassword:e.userInputtedPassword,storagePreference:e.storagePreference})}))}moveItemToVault(e,t){return Xr(this,void 0,void 0,(function*(){if(this.vaultLocks.isVaultLocked(e))throw new Error("Attempting to add item to locked vault");if(((0,I.isNote)(t)||(0,I.isFile)(t))&&[...this.items.getItemLinkedFiles(t),...this.items.getItemLinkedNotes(t),...this.items.getUnsortedTagsForItem(t)].some((t=>t.key_system_identifier!==e.systemIdentifier))){const e="This item is linked to other items that are not in the same vault. Please move those items to this vault first.";return this.alerts.alertV2({title:"Cannot move item to vault",text:e}).catch(console.error),b.Result.fail(e)}let n=[];if((0,I.isTag)(t)){const r=this.items.getDeepTagChildren(t);if(r.some((t=>t.key_system_identifier&&t.key_system_identifier!==e.systemIdentifier))){const e="One or more subtags are in other vaults. Please remove those subtags from the vaults or move them to this vault first.";return this.alerts.alertV2({title:"Cannot move item to vault",text:e}).catch(console.error),b.Result.fail(e)}n=r}return yield this._moveItemsToVault.execute({vault:e,items:[t,...n]}),b.Result.ok(this.items.findSureItem(t.uuid))}))}removeItemFromVault(e){return Xr(this,void 0,void 0,(function*(){const t=this.getItemVault(e);if(!t)throw new Error("Cannot find vault to remove item from");if(this.vaultLocks.isVaultLocked(t))throw new Error("Attempting to remove item from locked vault");if((0,I.isTag)(e)){const t=this.items.getDeepTagChildren(e);for(const e of t)yield this._removeItemFromVault.execute({item:e})}return yield this._removeItemFromVault.execute({item:e}),this.items.findSureItem(e.uuid)}))}authorizeVaultDeletion(e){return this._authorizeVaultDeletion.execute(e)}deleteVault(e){return Xr(this,void 0,void 0,(function*(){if(e.isSharedVaultListing())throw new Error("Shared vault must be deleted through SharedVaultService");const t=yield this._deleteVault.execute(e);return!(0,a.isClientDisplayableError)(t)&&(yield this.sync.sync(),!0)}))}changeVaultMetadata(e,t){return Xr(this,void 0,void 0,(function*(){const n=yield this.mutator.changeItem(e,(e=>{e.name=t.name,e.description=t.description,e.iconString=t.iconString}));return yield this.sync.sync(),n.isSharedVaultListing()&&(yield this._sendVaultDataChangeMessage.execute({vault:n})),n}))}rotateVaultRootKey(e,t){return Xr(this,void 0,void 0,(function*(){if(this.vaultLocks.isVaultLocked(e))throw new Error("Cannot rotate root key of locked vault");yield this._rotateVaultKey.execute({vault:e,userInputtedPassword:t}),yield this.sync.sync()}))}isItemInVault(e){return void 0!==e.key_system_identifier}getItemVault(e){const t=this.items.findItem(e.uuid);if(this.items.isTemplateItem(e))return;if(!t)throw new Error("Cannot find latest version of item to get vault for");if(!t.key_system_identifier)return;const n=this.getVault({keySystemIdentifier:t.key_system_identifier});if(n.isFailed())throw new Error("Cannot find vault for item");return n.getValue()}changeVaultKeyOptions(e){return Xr(this,void 0,void 0,(function*(){if(this.vaultLocks.isVaultLocked(e.vault))throw new Error("Attempting to change vault options on a locked vault");if(!this._isVaultOwner.execute(e.vault).getValue())throw new Error("Third party vault options should be changed via changeThirdPartyVaultStorageOptions");return yield this._changeVaultKeyOptions.execute(e)}))}changeThirdPartyVaultStorageOptions(e){return Xr(this,void 0,void 0,(function*(){if(this.vaultLocks.isVaultLocked(e.vault))throw new Error("Attempting to change vault options on a locked vault");if(this._isVaultOwner.execute(e.vault).getValue())throw new Error("First party vault options should be changed via changeVaultKeyOptions");return this._validateVaultPassword.execute(e.vault,e.vaultPassword).getValue()?yield this._changeVaultKeyOptions.execute({vault:e.vault,newStorageMode:e.newStorageMode,newPasswordOptions:void 0}):b.Result.fail("Invalid vault password")}))}}Jr||(Jr={});class ei{constructor(e,t){this.inviteServer=e,this.processInvite=t}execute(e){return t=this,n=void 0,i=function*(){const t=yield this.inviteServer.acceptInvite({sharedVaultUuid:e.invite.shared_vault_uuid,inviteUuid:e.invite.uuid});return(0,a.isErrorResponse)(t)?b.Result.fail("Could not accept vault invitation: ".concat((0,a.getErrorFromErrorResponse)(t).message)):(yield this.processInvite.execute(e.message,e.invite.shared_vault_uuid,e.invite.sender_uuid),b.Result.ok())},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}var ti=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class ni{constructor(e,t,n,r,i){this.keyManager=e,this._encryptMessage=t,this._sendInvite=n,this._shareContact=r,this._getKeyPairs=i}execute(e){return ti(this,void 0,void 0,(function*(){const t=this._getKeyPairs.execute();if(t.isFailed())return b.Result.fail("Cannot invite contact; keys not found");const n=yield this.inviteContact({keys:t.getValue(),sharedVault:e.sharedVault,sharedVaultContacts:e.sharedVaultContacts,recipient:e.recipient,permission:e.permission});return n.isFailed()||(yield this.shareContactWithOtherVaultMembers({contact:e.recipient,keys:t.getValue(),sharedVault:e.sharedVault})),n}))}shareContactWithOtherVaultMembers(e){return ti(this,void 0,void 0,(function*(){return yield this._shareContact.execute({sharedVault:e.sharedVault,contactToShare:e.contact})}))}inviteContact(e){return ti(this,void 0,void 0,(function*(){const t=b.SharedVaultUserPermission.create(e.permission);if(t.isFailed())return b.Result.fail(t.getError());const n=t.getValue(),r=this.keyManager.getPrimaryKeySystemRootKey(e.sharedVault.systemIdentifier);if(!r)return b.Result.fail("Cannot invite contact; key system root key not found");const i=e.sharedVaultContacts.find((e=>e.isMe));if(!i)return b.Result.fail("Cannot invite contact; me contact not found");const o={name:void 0,contactUuid:i.contactUuid,publicKeySet:i.publicKeySet},s=e.sharedVaultContacts.filter((t=>!t.isMe&&t.contactUuid!==e.recipient.contactUuid)).map((e=>({name:e.name,contactUuid:e.contactUuid,publicKeySet:e.publicKeySet}))),a=this._encryptMessage.execute({message:{type:I.AsymmetricMessagePayloadType.SharedVaultInvite,data:{recipientUuid:e.recipient.contactUuid,rootKey:r.content,trustedContacts:[o,...s],metadata:{name:e.sharedVault.name,description:e.sharedVault.description,iconString:e.sharedVault.iconString,fileBytesUsed:e.sharedVault.sharing.fileBytesUsed,designatedSurvivor:e.sharedVault.sharing.designatedSurvivor}}},keys:e.keys,recipientPublicKey:e.recipient.publicKeySet.encryption});return a.isFailed()?b.Result.fail(a.getError()):yield this._sendInvite.execute({sharedVaultUuid:e.sharedVault.sharing.sharedVaultUuid,recipientUuid:e.recipient.contactUuid,encryptedMessage:a.getValue(),permission:n.value})}))}}var ri=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class ii{constructor(e,t,n){this.reuploadInvite=e,this.findContact=t,this.inviteServer=n}execute(e){return ri(this,void 0,void 0,(function*(){const t=yield this.getExistingInvites();if(t.isFailed())return t;const n=yield this.deleteExistingInvites();if(n.isFailed())return n;const r=[];for(const n of t.getValue()){const t=this.findContact.execute({userUuid:n.user_uuid});if(t.isFailed()){r.push("Contact not found for invite ".concat(n.user_uuid));continue}const i=yield this.reuploadInvite.execute({keys:e.keys,previousKeys:e.previousKeys,recipient:t.getValue(),previousInvite:n});i.isFailed()&&r.push(i.getError())}return r.length>0?b.Result.fail(r.join(", ")):b.Result.ok()}))}getExistingInvites(){return ri(this,void 0,void 0,(function*(){const e=yield this.inviteServer.getOutboundUserInvites();if((0,a.isErrorResponse)(e))return b.Result.fail("Failed to get outbound user invites ".concat(JSON.stringify(e)));const t=e.data.invites;return b.Result.ok(t)}))}deleteExistingInvites(){return ri(this,void 0,void 0,(function*(){const e=yield this.inviteServer.deleteAllOutboundInvites();return(0,a.isErrorResponse)(e)?b.Result.fail("Failed to delete existing invites ".concat(JSON.stringify(e))):b.Result.ok()}))}}class oi{constructor(e,t,n){this.decryptOwnMessage=e,this.sendInvite=t,this.encryptMessage=n}execute(e){var t,n,r,i,o,s;return r=this,i=void 0,s=function*(){const r=this.decryptOwnMessage.execute({message:e.previousInvite.encrypted_message,privateKey:null!==(n=null===(t=e.previousKeys)||void 0===t?void 0:t.encryption.privateKey)&&void 0!==n?n:e.keys.encryption.privateKey,recipientPublicKey:e.recipient.publicKeySet.encryption});if(r.isFailed())return b.Result.fail(r.getError());const i=this.encryptMessage.execute({message:r.getValue(),keys:e.keys,recipientPublicKey:e.recipient.publicKeySet.encryption});return i.isFailed()?b.Result.fail(i.getError()):yield this.sendInvite.execute({sharedVaultUuid:e.previousInvite.shared_vault_uuid,recipientUuid:e.recipient.contactUuid,encryptedMessage:i.getValue(),permission:e.previousInvite.permission})},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(n,a)}l((s=s.apply(r,i||[])).next())}))}}var si=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class ai{constructor(e,t,n){this.reuploadInvite=e,this.findContact=t,this.inviteServer=n}execute(e){return si(this,void 0,void 0,(function*(){const t=yield this.getExistingInvites(e.sharedVault.sharing.sharedVaultUuid);if(t.isFailed())return t;const n=yield this.deleteExistingInvites(e.sharedVault.sharing.sharedVaultUuid);if(n.isFailed())return n;const r=[];for(const n of t.getValue()){const t=this.findContact.execute({userUuid:n.user_uuid});if(t.isFailed()){r.push("Contact not found for invite ".concat(n.user_uuid));continue}const i=yield this.reuploadInvite.execute({keys:e.keys,recipient:t.getValue(),previousInvite:n});i.isFailed()&&r.push(i.getError())}return r.length>0?b.Result.fail(r.join(", ")):b.Result.ok()}))}getExistingInvites(e){return si(this,void 0,void 0,(function*(){const t=yield this.inviteServer.getOutboundUserInvites();if((0,a.isErrorResponse)(t))return b.Result.fail("Failed to get outbound user invites ".concat(JSON.stringify(t)));const n=t.data.invites;return b.Result.ok(n.filter((t=>t.shared_vault_uuid===e)))}))}deleteExistingInvites(e){return si(this,void 0,void 0,(function*(){const t=yield this.inviteServer.deleteAllSharedVaultInvites({sharedVaultUuid:e});return(0,a.isErrorResponse)(t)?b.Result.fail("Failed to delete existing invites ".concat(JSON.stringify(t))):b.Result.ok()}))}}var li;class ci{constructor(e){this.vaultInvitesServer=e}execute(e){return t=this,n=void 0,i=function*(){const t=b.SharedVaultUserPermission.create(e.permission);if(t.isFailed())return b.Result.fail(t.getError());const n=t.getValue(),r=yield this.vaultInvitesServer.createInvite({sharedVaultUuid:e.sharedVaultUuid,recipientUuid:e.recipientUuid,encryptedMessage:e.encryptedMessage,permission:n});return(0,a.isErrorResponse)(r)?b.Result.fail((0,a.getErrorFromErrorResponse)(r).message):b.Result.ok(r.data.invite)},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}!function(e){e.InviteSent="VaultInviteServiceEvent.InviteSent",e.InvitesReloaded="VaultInviteServiceEvent.InvitesReloaded"}(li||(li={}));var ui,di=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class hi extends f{constructor(e,t,n,r,i,o,s,a,l,c,u,d,h,p,f,g,m){super(m),this.session=t,this.vaultUsers=n,this.sync=r,this.invitesServer=i,this.status=o,this._getAllContacts=s,this._getVault=a,this._getVaultContacts=l,this._inviteToVault=c,this._getTrustedPayload=u,this._getUntrustedPayload=d,this._findContact=h,this._acceptVaultInvite=p,this._getKeyPairs=f,this._decryptErroredPayloads=g,this.pendingInvites={},this.eventDisposers.push(e.addObserver(b.ContentType.TYPES.TrustedContact,(e=>{let{inserted:t,source:n}=e;return di(this,void 0,void 0,(function*(){n===I.PayloadEmitSource.LocalChanged&&t.length>0&&this.downloadInboundInvites(),yield this.reprocessCachedInvitesTrustStatusAfterTrustedContactsChange()}))})))}deinit(){super.deinit(),this.session=void 0,this.vaultUsers=void 0,this.sync=void 0,this.invitesServer=void 0,this._getAllContacts=void 0,this._getVault=void 0,this._getVaultContacts=void 0,this._inviteToVault=void 0,this._getTrustedPayload=void 0,this._getUntrustedPayload=void 0,this._findContact=void 0,this._acceptVaultInvite=void 0,this._getKeyPairs=void 0,this._decryptErroredPayloads=void 0,this.pendingInvites={}}updatePendingInviteCount(){this.status.setPreferencesBubbleCount("vaults",Object.keys(this.pendingInvites).length)}addPendingInvite(e){this.pendingInvites[e.invite.uuid]=e,this.updatePendingInviteCount()}removePendingInvite(e){delete this.pendingInvites[e],this.updatePendingInviteCount()}handleEvent(e){return di(this,void 0,void 0,(function*(){switch(e.type){case E.ReceivedSharedVaultInvites:yield this.processInboundInvites(e.payload);break;case L.Launched:if(!this.session.isSignedIn())return;this.downloadInboundInvites();break;case Vn.NotificationReceived:yield this.handleNotification(e.payload);break;case s.UserInvitedToSharedVault:yield this.processInboundInvites([e.payload.invite])}}))}handleNotification(e){return di(this,void 0,void 0,(function*(){e.eventPayload.props.type.value===b.NotificationType.TYPES.SharedVaultInviteCanceled&&(this.removePendingInvite(e.eventPayload.props.primaryIdentifier.value),this.notifyEvent(li.InvitesReloaded))}))}getCachedPendingInviteRecords(){return Object.values(this.pendingInvites)}downloadInboundInvites(){return di(this,void 0,void 0,(function*(){const e=yield this.invitesServer.getInboundUserInvites();return(0,a.isErrorResponse)(e)?a.ClientDisplayableError.FromString("Failed to get inbound user invites ".concat(JSON.stringify(e))):(this.pendingInvites={},yield this.processInboundInvites(e.data.invites),e.data.invites)}))}getOutboundInvites(e){return di(this,void 0,void 0,(function*(){const t=yield this.invitesServer.getOutboundUserInvites();return(0,a.isErrorResponse)(t)?a.ClientDisplayableError.FromString("Failed to get outbound user invites ".concat(JSON.stringify(t))):e?t.data.invites.filter((t=>t.shared_vault_uuid===e.sharing.sharedVaultUuid)):t.data.invites}))}acceptInvite(e){return di(this,void 0,void 0,(function*(){if(!e.trusted)return b.Result.fail("Cannot accept untrusted invite");const t=yield this._acceptVaultInvite.execute({invite:e.invite,message:e.message});return t.isFailed()?b.Result.fail(t.getError()):(this.removePendingInvite(e.invite.uuid),this.sync.sync().catch(console.error),this.vaultUsers.invalidateVaultUsersCache(e.invite.shared_vault_uuid).catch(console.error),yield this._decryptErroredPayloads.execute(),yield this.sync.syncSharedVaultsFromScratch([e.invite.shared_vault_uuid]),b.Result.ok())}))}getInvitableContactsForSharedVault(e){return di(this,void 0,void 0,(function*(){const t=yield this.vaultUsers.getSharedVaultUsersFromServer(e);if(!t)return[];const n=this._getAllContacts.execute();if(n.isFailed())return[];const r=yield this.getOutboundInvites(e);return(0,a.isClientDisplayableError)(r)?[]:n.getValue().filter((e=>{const n=t.some((t=>t.user_uuid===e.contactUuid)),i=r.some((t=>t.user_uuid===e.contactUuid));return!n&&!i}))}))}inviteContactToSharedVault(e,t,n){return di(this,void 0,void 0,(function*(){const r=yield this._getVaultContacts.execute({sharedVaultUuid:e.sharing.sharedVaultUuid,readFromCache:!1});if(r.isFailed())return b.Result.fail(r.getError());const i=r.getValue(),o=yield this._inviteToVault.execute({sharedVault:e,recipient:t,sharedVaultContacts:i,permission:n});return o.isFailed()?b.Result.fail(o.getError()):(this.notifyEvent(li.InviteSent),yield this.sync.sync(),o)}))}isVaultUserOwner(e){const t=this._getVault.execute({sharedVaultUuid:e.shared_vault_uuid});if(t.isFailed())return!1;const n=t.getValue();return null!=n&&n.sharing.ownerUserUuid===e.user_uuid}deleteInvite(e){return di(this,void 0,void 0,(function*(){const t=yield this.invitesServer.deleteInvite({sharedVaultUuid:e.shared_vault_uuid,inviteUuid:e.uuid});if((0,a.isErrorResponse)(t))return a.ClientDisplayableError.FromString("Failed to delete invite ".concat(JSON.stringify(t)));this.removePendingInvite(e.uuid)}))}reprocessCachedInvitesTrustStatusAfterTrustedContactsChange(){return di(this,void 0,void 0,(function*(){const e=this.getCachedPendingInviteRecords().map((e=>e.invite));yield this.processInboundInvites(e)}))}processInboundInvites(e){return di(this,void 0,void 0,(function*(){if(0===e.length)return void this.updatePendingInviteCount();const t=this._getKeyPairs.execute();if(!t.isFailed()){for(const n of e){delete this.pendingInvites[n.uuid];const e=this._findContact.execute({userUuid:n.sender_uuid});if(!e.isFailed()){const r=this._getTrustedPayload.execute({payload:n,privateKey:t.getValue().encryption.privateKey,ownUserUuid:this.session.userUuid,sender:e.getValue()});if(!r.isFailed()){this.addPendingInvite({invite:n,message:r.getValue(),trusted:!0});continue}}const r=this._getUntrustedPayload.execute({payload:n,privateKey:t.getValue().encryption.privateKey});r.isFailed()||this.addPendingInvite({invite:n,message:r.getValue(),trusted:!1})}this.notifyEvent(li.InvitesReloaded)}}))}}class pi{constructor(e,t){this.encryption=e,this.keys=t}execute(e,t){if(e.keyPasswordType!==I.KeySystemPasswordType.UserInputted)throw new Error("Vault uses randomized password and cannot be validated with password");const n=this.keys.getPrimaryKeySystemRootKey(e.systemIdentifier);if(!n)return b.Result.ok(!1);const r=this.encryption.deriveUserInputtedKeySystemRootKey({keyParams:e.rootKeyParams,userInputtedPassword:t});return b.Result.ok(n.isEqual(r))}}!function(e){e.VaultUnlocked="VaultUnlocked",e.VaultLocked="VaultLocked"}(ui||(ui={}));var fi=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class gi extends f{constructor(e,t,n,r,i,o,s,a){super(a),this.encryption=t,this.keys=n,this._getVaults=r,this._decryptErroredPayloads=i,this._removeItemsFromMemory=o,this._getVaultItems=s,this.lockMap=new Map,this.recomputeAllVaultsLockingState=()=>fi(this,void 0,void 0,(function*(){const e=this._getVaults.execute().getValue();for(const t of e){const e="locked"===this.computeVaultLockState(t);this.lockMap.get(t.uuid)!==e&&(this.lockMap.set(t.uuid,e),e?this.notifyEvent(ui.VaultLocked,{vault:t}):this.notifyEvent(ui.VaultUnlocked,{vault:t}))}})),e.addObserver([b.ContentType.TYPES.KeySystemItemsKey,b.ContentType.TYPES.KeySystemRootKey,b.ContentType.TYPES.VaultListing],(()=>{this.recomputeAllVaultsLockingState()}))}deinit(){super.deinit(),this.encryption=void 0,this.keys=void 0,this._getVaults=void 0,this._decryptErroredPayloads=void 0,this._removeItemsFromMemory=void 0,this._getVaultItems=void 0,this.lockMap.clear()}getLockedvaults(){return this._getVaults.execute().getValue().filter((e=>this.isVaultLocked(e)))}isVaultLocked(e){return!0===this.lockMap.get(e.uuid)}isVaultLockable(e){return e.keyPasswordType===I.KeySystemPasswordType.UserInputted}lockNonPersistentVault(e){return fi(this,void 0,void 0,(function*(){if(e.keyStorageMode===I.KeySystemRootKeyStorageMode.Synced)throw new Error("Vault uses synced key storage and cannot be locked");if(e.keyPasswordType!==I.KeySystemPasswordType.UserInputted)throw new Error("Vault uses randomized password and cannot be locked");yield this.keys.wipeVaultKeysFromMemory(e);const t=this._getVaultItems.execute(e).getValue();yield this._removeItemsFromMemory.execute(t),this.lockMap.set(e.uuid,!0),this.notifyEventSync(ui.VaultLocked,{vault:e})}))}unlockNonPersistentVault(e,t){return fi(this,void 0,void 0,(function*(){if(e.keyPasswordType!==I.KeySystemPasswordType.UserInputted)throw new Error("Vault uses randomized password and cannot be unlocked with user inputted password");if(e.keyStorageMode===I.KeySystemRootKeyStorageMode.Synced)throw new Error("Vault uses synced root key and cannot be unlocked with user inputted password");const n=this.encryption.deriveUserInputtedKeySystemRootKey({keyParams:e.rootKeyParams,userInputtedPassword:t});return this.keys.cacheKey(n,e.keyStorageMode),yield this._decryptErroredPayloads.execute(),"locked"===this.computeVaultLockState(e)?(this.keys.removeKeyFromCache(e.systemIdentifier),!1):(this.lockMap.set(e.uuid,!1),this.notifyEventSync(ui.VaultUnlocked,{vault:e}),!0)}))}computeVaultLockState(e){return this.keys.getPrimaryKeySystemRootKey(e.systemIdentifier)&&this.keys.getPrimaryKeySystemItemsKey(e.systemIdentifier)?"unlocked":"locked"}}class mi{constructor(e){this.sharedVaultUserServer=e}execute(e){return t=this,n=void 0,i=function*(){const t=b.Uuid.create(e.sharedVaultUuid);if(t.isFailed())return b.Result.fail(t.getError());const n=t.getValue(),r=b.Uuid.create(e.sharedVaultMemberUuid);if(r.isFailed())return b.Result.fail(r.getError());const i=r.getValue();return(yield this.sharedVaultUserServer.designateSurvivor({sharedVaultUuid:n,sharedVaultMemberUuid:i})).status!==a.HttpStatusCode.Success?b.Result.fail("Failed to mark designated survivor on the server"):b.Result.ok()},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class yi{constructor(e,t){this._findContact=e,this._getVaultUsers=t}execute(e){return t=this,n=void 0,i=function*(){const t=yield this._getVaultUsers.execute({sharedVaultUuid:e.sharedVaultUuid,readFromCache:e.readFromCache});if(t.isFailed())return b.Result.fail("Failed to get vault users");const n=t.getValue().map((e=>this._findContact.execute({userUuid:e.user_uuid}))).map((e=>e.isFailed()?void 0:e.getValue())).filter(c.isNotUndefined);return b.Result.ok(n)},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class vi{constructor(e,t){this.vaultUsersServer=e,this.cache=t}execute(e){return t=this,n=void 0,i=function*(){if(e.readFromCache){const t=this.cache.get(e.sharedVaultUuid);if(t)return b.Result.ok(t)}const t=yield this.vaultUsersServer.getSharedVaultUsers({sharedVaultUuid:e.sharedVaultUuid});return(0,a.isErrorResponse)(t)?b.Result.fail((0,a.getErrorFromErrorResponse)(t).message):(this.cache.set(e.sharedVaultUuid,t.data.users),b.Result.ok(t.data.users))},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class Ai{constructor(e,t){this.users=e,this.cache=t}execute(e){var t;if(!e.sharing)return b.Result.ok(!0);if(!e.sharing.ownerUserUuid)throw new Error("Shared vault ".concat(e.sharing.sharedVaultUuid," does not have an owner user uuid"));const n=this.users.sureUser,r=this.cache.get(e.sharing.sharedVaultUuid),i=null===(t=null==r?void 0:r.find((e=>e.user_uuid===n.uuid)))||void 0===t?void 0:t.permission;return b.Result.ok(i===b.SharedVaultUserPermission.PERMISSIONS.Read)}}class bi{constructor(e,t){this.users=e,this.cache=t}execute(e){var t;if(!e.sharing)return b.Result.ok(!0);if(!e.sharing.ownerUserUuid)throw new Error("Shared vault ".concat(e.sharing.sharedVaultUuid," does not have an owner user uuid"));const n=this.users.sureUser,r=this.cache.get(e.sharing.sharedVaultUuid),i=null===(t=null==r?void 0:r.find((e=>e.user_uuid===n.uuid)))||void 0===t?void 0:t.permission;return b.Result.ok(i===b.SharedVaultUserPermission.PERMISSIONS.Admin||e.sharing.ownerUserUuid===n.uuid)}}class wi{constructor(e){this.users=e}execute(e){if(!e.sharing)return b.Result.ok(!0);if(!e.sharing.ownerUserUuid)throw new Error("Shared vault ".concat(e.sharing.sharedVaultUuid," does not have an owner user uuid"));const t=this.users.sureUser;return b.Result.ok(e.sharing.ownerUserUuid===t.uuid)}}class Si{constructor(e,t,n,r){this.users=e,this.vaultUserServer=t,this.items=n,this._deleteThirdPartyVault=r}execute(e){return t=this,n=void 0,i=function*(){const t=this.items.findItem(e.sharedVault.uuid);if(!t)throw new Error("LeaveVaultUseCase: Could not find vault ".concat(e.sharedVault.uuid));const n=yield this.vaultUserServer.deleteSharedVaultUser({sharedVaultUuid:t.sharing.sharedVaultUuid,userUuid:this.users.sureUser.uuid});if((0,a.isErrorResponse)(n))return a.ClientDisplayableError.FromString("Failed to leave vault ".concat(JSON.stringify(n)));yield this._deleteThirdPartyVault.execute(t)},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}var Ci;class Ei{constructor(e){this.vaultUserServer=e}execute(e){return t=this,n=void 0,i=function*(){const t=yield this.vaultUserServer.deleteSharedVaultUser({sharedVaultUuid:e.sharedVaultUuid,userUuid:e.userUuid});return(0,a.isErrorResponse)(t)?b.Result.fail((0,a.getErrorFromErrorResponse)(t).message):b.Result.ok()},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class Ii{constructor(){this.cache=new Map}get(e){return this.cache.get(e)}set(e,t){this.cache.set(e,t)}}!function(e){e.UsersChanged="VaultUserServiceEvent.UsersChanged",e.InvalidatedAllUserCache="VaultUserServiceEvent.InvalidatedUserCache",e.InvalidatedUserCacheForVault="VaultUserServiceEvent.InvalidatedUserCacheForVault"}(Ci||(Ci={}));var _i=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class xi extends f{constructor(e,t,n,r,i,o,s,a,l,c,u){super(u),this.vaults=e,this.vaultLocks=t,this._getVaultUsers=n,this._removeVaultMember=r,this._isVaultOwner=i,this._isVaultAdmin=o,this._isReadonlyVaultMember=s,this._getVault=a,this._leaveVault=l,this.designateSurvivorUseCase=c}deinit(){super.deinit(),this.vaults=void 0,this._getVaultUsers=void 0,this._removeVaultMember=void 0,this._isVaultOwner=void 0,this._getVault=void 0,this._leaveVault=void 0}designateSurvivor(e,t){return _i(this,void 0,void 0,(function*(){const n=yield this.designateSurvivorUseCase.execute({sharedVaultMemberUuid:t,sharedVaultUuid:e.sharing.sharedVaultUuid});return n.isFailed()?b.Result.fail("Could not designate survivor: ".concat(n.getError())):b.Result.ok()}))}invalidateVaultUsersCache(e){return _i(this,void 0,void 0,(function*(){if(e)return yield this._getVaultUsers.execute({sharedVaultUuid:e,readFromCache:!1}),void this.notifyEvent(Ci.InvalidatedUserCacheForVault,e);yield Promise.all(this.vaults.getVaults().map((e=>_i(this,void 0,void 0,(function*(){e.isSharedVaultListing()&&(yield this._getVaultUsers.execute({sharedVaultUuid:e.sharing.sharedVaultUuid,readFromCache:!1}),this.notifyEvent(Ci.InvalidatedUserCacheForVault,e.sharing.sharedVaultUuid))}))))),this.notifyEvent(Ci.InvalidatedAllUserCache)}))}getSharedVaultUsersFromServer(e){return _i(this,void 0,void 0,(function*(){const t=yield this._getVaultUsers.execute({sharedVaultUuid:e.sharing.sharedVaultUuid,readFromCache:!1});if(!t.isFailed())return t.getValue()}))}isCurrentUserSharedVaultOwner(e){return this._isVaultOwner.execute(e).getValue()}isCurrentUserSharedVaultAdmin(e){return this._isVaultAdmin.execute(e).getValue()}isCurrentUserReadonlyVaultMember(e){return!!e.isSharedVaultListing()&&this._isReadonlyVaultMember.execute(e).getValue()}removeUserFromSharedVault(e,t){return _i(this,void 0,void 0,(function*(){if(!this.isCurrentUserSharedVaultOwner(e))throw new Error("Only vault admins can remove users");if(this.vaultLocks.isVaultLocked(e))throw new Error("Cannot remove user from locked vault");const n=yield this._removeVaultMember.execute({sharedVaultUuid:e.sharing.sharedVaultUuid,userUuid:t});return n.isFailed()||(this.notifyEvent(Ci.UsersChanged),yield this.vaults.rotateVaultRootKey(e)),n}))}isVaultUserOwner(e){const t=this._getVault.execute({sharedVaultUuid:e.shared_vault_uuid});if(t.isFailed())return!1;const n=t.getValue();return null!=n&&n.sharing.ownerUserUuid===e.user_uuid}leaveSharedVault(e){return _i(this,void 0,void 0,(function*(){const t=yield this._leaveVault.execute({sharedVault:e});if((0,a.isClientDisplayableError)(t))return t;this.notifyEvent(Ci.UsersChanged)}))}getFormattedMemberPermission(e){switch(e){case"admin":return"Admin";case"write":return"Read / Write";case"read":return"Read-only";default:return"Unknown"}}}},8430:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},91440:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},21404:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},63180:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(8430),t),i(n(91440),t),i(n(21404),t)},45575:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},83372:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(45575),t)},41335:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},90176:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.timingSafeEqual=void 0,t.timingSafeEqual=function(e,t){const n=String(e);let r=String(t);const i=n.length;let o=0;i!==r.length&&(r=n,o=1);for(let e=0;e<i;e++)o|=n.charCodeAt(e)^r.charCodeAt(e);return 0===o}},78492:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(41335),t),i(n(90176),t)},26734:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},68101:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(26734),t)},88602:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},84370:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},1282:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},69422:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},51234:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SodiumConstant=void 0,t.SodiumConstant={CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_STATEBYTES:52,CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES:17,CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES:24,CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES:32,CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX:274877906816,crypto_box_SEEDBYTES:32,crypto_sign_SEEDBYTES:32,crypto_generichash_KEYBYTES:32}},58081:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},42565:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SodiumTag=void 0,function(e){e[e.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PUSH=0]="CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PUSH",e[e.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PULL=1]="CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PULL",e[e.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY=2]="CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY",e[e.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL=3]="CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL"}(n||(t.SodiumTag=n={}))},67918:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},39296:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},91338:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},83395:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},21084:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},30418:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88602),t),i(n(84370),t),i(n(1282),t),i(n(69422),t),i(n(51234),t),i(n(58081),t),i(n(42565),t),i(n(67918),t),i(n(39296),t),i(n(91338),t),i(n(83395),t),i(n(21084),t)},98418:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(63180),t),i(n(83372),t),i(n(78492),t),i(n(68101),t),i(n(30418),t)},13979:(e,t,n)=>{n.d(t,{v:()=>r});const r={DeviceInterface:Symbol.for("DeviceInterface"),AlertService:Symbol.for("AlertService"),Crypto:Symbol.for("Crypto"),InternalEventBus:Symbol.for("InternalEventBus"),PayloadManager:Symbol.for("PayloadManager"),ItemManager:Symbol.for("ItemManager"),MutatorService:Symbol.for("MutatorService"),DiskStorageService:Symbol.for("DiskStorageService"),NotificationService:Symbol.for("NotificationService"),InMemoryStore:Symbol.for("InMemoryStore"),KeySystemKeyManager:Symbol.for("KeySystemKeyManager"),EncryptionService:Symbol.for("EncryptionService"),ChallengeService:Symbol.for("ChallengeService"),DeprecatedHttpService:Symbol.for("DeprecatedHttpService"),HttpService:Symbol.for("HttpService"),LegacyApiService:Symbol.for("LegacyApiService"),UserServer:Symbol.for("UserServer"),UserRequestServer:Symbol.for("UserRequestServer"),UserApiService:Symbol.for("UserApiService"),SubscriptionServer:Symbol.for("SubscriptionServer"),SubscriptionApiService:Symbol.for("SubscriptionApiService"),WebSocketServer:Symbol.for("WebSocketServer"),WebSocketApiService:Symbol.for("WebSocketApiService"),WebSocketsService:Symbol.for("WebSocketsService"),SessionManager:Symbol.for("SessionManager"),SubscriptionManager:Symbol.for("SubscriptionManager"),HistoryManager:Symbol.for("HistoryManager"),SyncFrequencyGuard:Symbol.for("SyncFrequencyGuard"),SyncBackoffService:Symbol.for("SyncBackoffService"),SyncService:Symbol.for("SyncService"),ProtectionService:Symbol.for("ProtectionService"),UserService:Symbol.for("UserService"),KeyRecoveryService:Symbol.for("KeyRecoveryService"),SingletonManager:Symbol.for("SingletonManager"),PreferencesService:Symbol.for("PreferencesService"),SettingsService:Symbol.for("SettingsService"),FeaturesService:Symbol.for("FeaturesService"),ComponentManager:Symbol.for("ComponentManager"),MfaService:Symbol.for("MfaService"),StatusService:Symbol.for("StatusService"),MigrationService:Symbol.for("MigrationService"),FileService:Symbol.for("FileService"),IntegrityService:Symbol.for("IntegrityService"),ListedService:Symbol.for("ListedService"),ActionsService:Symbol.for("ActionsService"),AuthenticatorApiService:Symbol.for("AuthenticatorApiService"),AuthenticatorManager:Symbol.for("AuthenticatorManager"),AuthApiService:Symbol.for("AuthApiService"),AuthManager:Symbol.for("AuthManager"),RevisionApiService:Symbol.for("RevisionApiService"),RevisionManager:Symbol.for("RevisionManager"),ContactService:Symbol.for("ContactService"),VaultService:Symbol.for("VaultService"),SharedVaultService:Symbol.for("SharedVaultService"),AsymmetricMessageService:Symbol.for("AsymmetricMessageService"),SelfContactManager:Symbol.for("SelfContactManager"),EncryptionOperators:Symbol.for("EncryptionOperators"),RootKeyManager:Symbol.for("RootKeyManager"),ItemsEncryptionService:Symbol.for("ItemsEncryptionService"),VaultUserService:Symbol.for("VaultUserService"),VaultInviteService:Symbol.for("VaultInviteService"),VaultUserCache:Symbol.for("VaultUserCache"),VaultLockService:Symbol.for("VaultLockService"),Logger:Symbol.for("Logger"),RevisionServer:Symbol.for("RevisionServer"),AuthenticatorServer:Symbol.for("AuthenticatorServer"),AuthServer:Symbol.for("AuthServer"),SharedVaultInvitesServer:Symbol.for("SharedVaultInvitesServer"),SharedVaultServer:Symbol.for("SharedVaultServer"),SharedVaultUsersServer:Symbol.for("SharedVaultUsersServer"),AsymmetricMessageServer:Symbol.for("AsymmetricMessageServer"),FilesBackupService:Symbol.for("FilesBackupService"),HomeServerService:Symbol.for("HomeServerService"),SignInWithRecoveryCodes:Symbol.for("SignInWithRecoveryCodes"),GetRecoveryCodes:Symbol.for("GetRecoveryCodes"),AddAuthenticator:Symbol.for("AddAuthenticator"),ListAuthenticators:Symbol.for("ListAuthenticators"),DeleteAuthenticator:Symbol.for("DeleteAuthenticator"),GetAuthenticatorAuthenticationOptions:Symbol.for("GetAuthenticatorAuthenticationOptions"),GetAuthenticatorAuthenticationResponse:Symbol.for("GetAuthenticatorAuthenticationResponse"),ListRevisions:Symbol.for("ListRevisions"),GetRevision:Symbol.for("GetRevision"),DeleteRevision:Symbol.for("DeleteRevision"),ImportData:Symbol.for("ImportData"),DiscardItemsLocally:Symbol.for("DiscardItemsLocally"),FindContact:Symbol.for("FindContact"),GetAllContacts:Symbol.for("GetAllContacts"),CreateOrEditContact:Symbol.for("CreateOrEditContact"),EditContact:Symbol.for("EditContact"),ValidateItemSigner:Symbol.for("ValidateItemSigner"),GetVault:Symbol.for("GetVault"),GetVaults:Symbol.for("GetVaults"),SyncLocalVaultsWithRemoteSharedVaults:Symbol.for("SyncLocalVaultsWithRemoteSharedVaults"),GetSharedVaults:Symbol.for("GetSharedVaults"),GetOwnedSharedVaults:Symbol.for("GetOwnedSharedVaults"),ChangeVaultKeyOptions:Symbol.for("ChangeVaultKeyOptions"),MoveItemsToVault:Symbol.for("MoveItemsToVault"),CreateVault:Symbol.for("CreateVault"),DeleteContact:Symbol.for("DeleteContact"),ContactBelongsToVault:Symbol.for("ContactBelongsToVault"),RemoveItemFromVault:Symbol.for("RemoveItemFromVault"),DeleteVault:Symbol.for("DeleteVault"),RotateVaultKey:Symbol.for("RotateVaultKey"),CreateSharedVault:Symbol.for("CreateSharedVault"),HandleKeyPairChange:Symbol.for("HandleKeyPairChange"),NotifyVaultUsersOfKeyRotation:Symbol.for("NotifyVaultUsersOfKeyRotation"),SendVaultDataChangedMessage:Symbol.for("SendVaultDataChangedMessage"),SendVaultKeyChangedMessage:Symbol.for("SendVaultKeyChangedMessage"),GetTrustedPayload:Symbol.for("GetTrustedPayload"),GetUntrustedPayload:Symbol.for("GetUntrustedPayload"),GetVaultContacts:Symbol.for("GetVaultContacts"),AcceptVaultInvite:Symbol.for("AcceptVaultInvite"),InviteToVault:Symbol.for("InviteToVault"),LeaveVault:Symbol.for("LeaveVault"),DeleteThirdPartyVault:Symbol.for("DeleteThirdPartyVault"),ShareContactWithVault:Symbol.for("ShareContactWithVault"),ConvertToSharedVault:Symbol.for("ConvertToSharedVault"),DeleteSharedVault:Symbol.for("DeleteSharedVault"),RemoveVaultMember:Symbol.for("RemoveVaultMember"),DesignateSurvivor:Symbol.for("DesignateSurvivor"),GetVaultUsers:Symbol.for("GetSharedVaultUsers"),ResendAllMessages:Symbol.for("ResendAllMessages"),ReuploadAllInvites:Symbol.for("ReuploadAllInvites"),ReuploadInvite:Symbol.for("ReuploadInvite"),GetInboundMessages:Symbol.for("GetInboundMessages"),GetOutboundMessages:Symbol.for("GetOutboundMessages"),HandleRootKeyChangedMessage:Symbol.for("HandleRootKeyChangedMessage"),ProcessAcceptedVaultInvite:Symbol.for("ProcessAcceptedVaultInvite"),ResendMessage:Symbol.for("ResendMessage"),SendMessage:Symbol.for("SendMessage"),SendOwnContactChangeMessage:Symbol.for("SendOwnContactChangeMessage"),DecryptMessage:Symbol.for("DecryptMessage"),DecryptOwnMessage:Symbol.for("DecryptOwnMessage"),EncryptMessage:Symbol.for("EncryptMessage"),GetMessageAdditionalData:Symbol.for("GetMessageAdditionalData"),SendVaultInvite:Symbol.for("SendVaultInvite"),ReplaceContactData:Symbol.for("ReplaceContactData"),CreateNewDefaultItemsKey:Symbol.for("CreateNewDefaultItemsKey"),CreateNewItemsKeyWithRollback:Symbol.for("CreateNewItemsKeyWithRollback"),FindDefaultItemsKey:Symbol.for("FindDefaultItemsKey"),DecryptErroredTypeAPayloads:Symbol.for("DecryptErroredTypeAPayloads"),DecryptTypeAPayload:Symbol.for("DecryptTypeAPayload"),DecryptTypeAPayloadWithKeyLookup:Symbol.for("DecryptTypeAPayloadWithKeyLookup"),EncryptTypeAPayload:Symbol.for("EncryptTypeAPayload"),EncryptTypeAPayloadWithKeyLookup:Symbol.for("EncryptTypeAPayloadWithKeyLookup"),DecryptBackupFile:Symbol.for("DecryptBackupFile"),IsVaultOwner:Symbol.for("IsVaultOwner"),IsVaultAdmin:Symbol.for("IsVaultAdmin"),IsReadonlyVaultMember:Symbol.for("IsReadonlyVaultMember"),RemoveItemsFromMemory:Symbol.for("RemoveItemsFromMemory"),ReencryptTypeAItems:Symbol.for("ReencryptTypeAItems"),DecryptErroredPayloads:Symbol.for("DecryptErroredPayloads"),GetKeyPairs:Symbol.for("GetKeyPairs"),ChangeVaultStorageMode:Symbol.for("ChangeVaultStorageMode"),ChangeAndSaveItem:Symbol.for("ChangeAndSaveItem"),GetHost:Symbol.for("GetHost"),IsApplicationUsingThirdPartyHost:Symbol.for("IsApplicationUsingThirdPartyHost"),SetHost:Symbol.for("SetHost"),GenerateUuid:Symbol.for("GenerateUuid"),GetVaultItems:Symbol.for("GetVaultItems"),ValidateVaultPassword:Symbol.for("ValidateVaultPassword"),DecryptBackupPayloads:Symbol.for("DecryptBackupPayloads"),DetermineKeyToUse:Symbol.for("DetermineKeyToUse"),GetBackupFileType:Symbol.for("GetBackupFileType"),GetFilePassword:Symbol.for("GetFilePassword"),AuthorizeVaultDeletion:Symbol.for("AuthorizeVaultDeletion"),CreateDecryptedBackupFile:Symbol.for("CreateDecryptedBackupFile"),CreateEncryptedBackupFile:Symbol.for("CreateEncryptedBackupFile"),SessionStorageMapper:Symbol.for("SessionStorageMapper"),LegacySessionStorageMapper:Symbol.for("LegacySessionStorageMapper")}},2256:(e,t,n)=>{n.d(t,{Ak:()=>a,FB:()=>i,Im:()=>l,_e:()=>o,g:()=>s});var r=n(22325);function i(e){return{"mac-web":r.Platform.MacWeb,"mac-desktop":r.Platform.MacDesktop,"linux-web":r.Platform.LinuxWeb,"linux-desktop":r.Platform.LinuxDesktop,"windows-web":r.Platform.WindowsWeb,"windows-desktop":r.Platform.WindowsDesktop,"ios-web":r.Platform.Ios,"android-web":r.Platform.Android}[e]}function o(e){return{[r.Platform.MacWeb]:"mac-web",[r.Platform.MacDesktop]:"mac-desktop",[r.Platform.LinuxWeb]:"linux-web",[r.Platform.LinuxDesktop]:"linux-desktop",[r.Platform.WindowsWeb]:"windows-web",[r.Platform.WindowsDesktop]:"windows-desktop",[r.Platform.Ios]:"ios",[r.Platform.Android]:"android"}[e]}function s(e){return{[r.Environment.Web]:"web",[r.Environment.Desktop]:"desktop",[r.Environment.Mobile]:"native-mobile-web",[r.Environment.Clipper]:"clipper"}[e]}function a(e){return e===r.Environment.Web||e===r.Environment.Desktop}function l(e){return e===r.Environment.Mobile}},85593:(e,t,n)=>{n.d(t,{J5:()=>X,UC:()=>J,ie:()=>l,g:()=>$.g,Im:()=>$.Im,Ak:()=>$.Ak,FB:()=>$.FB,_e:()=>$._e});var r=n(20875),i=n(55668),o=n(22325),s=n(87901);const a={[i.wMo.SyncCompletedWithAllItemsUploaded]:i.n9K.CompletedFullSync,[i.wMo.PaginatedSyncRequestCompleted]:i.n9K.CompletedIncrementalSync,[i.wMo.SyncError]:i.n9K.FailedSync,[i.wMo.SyncTakingTooLong]:i.n9K.HighLatencySync,[i.wMo.EnterOutOfSync]:i.n9K.EnteredOutOfSync,[i.wMo.ExitOutOfSync]:i.n9K.ExitedOutOfSync,[i.wMo.LocalDataLoaded]:i.n9K.LocalDataLoaded,[i.wMo.MajorDataChange]:i.n9K.MajorDataChange,[i.wMo.LocalDataIncrementalLoad]:i.n9K.LocalDataIncrementalLoad,[i.wMo.StatusChanged]:i.n9K.SyncStatusChanged,[i.wMo.SyncDidBeginProcessing]:i.n9K.WillSync,[i.wMo.InvalidSession]:i.n9K.InvalidSyncSession,[i.wMo.DatabaseReadError]:i.n9K.LocalDatabaseReadError,[i.wMo.DatabaseWriteError]:i.n9K.LocalDatabaseWriteError,[i.wMo.DownloadFirstSyncCompleted]:i.n9K.CompletedInitialSync,[i.wMo.TooManyRequests]:i.n9K.SyncTooManyRequests};function l(e){return a[e]}var c=n(86999),u=n(43361),d=n(19820),h=n(46390),p=n(51383),f=n(9704),g=n(84526),m=n(12473),y=n(58875),v=n(43252),A=n(68704),b=n(79327),w=n(32274),S=n(81679),C=n(8740),E=n(3876),I=n(74987),_=n(6314),x=n(98116),P=n(30693),k=n(15109),B=n(80738),O=n(51271),N=n(37486),D=n(29675),j=n(53218),T=n(54911),M=n(94986),F=n(78734),R=n(40278),L=n(28559),Q=n(28178),U=n(45447),V=n(64892),K=n(82648);class H{toDomain(e){const{jwt:t}=e,n=K.LegacySession.create(t);if(n.isFailed())throw new Error(n.getError());return n.getValue()}toProjection(e){return{jwt:e.accessToken}}}class G{toDomain(e){const t=K.SessionToken.create(e.accessToken,e.accessExpiration);if(t.isFailed())throw new Error(t.getError());const n=t.getValue(),r=K.SessionToken.create(e.refreshToken,e.refreshExpiration);if(r.isFailed())throw new Error(r.getError());const i=r.getValue(),o=K.Session.create(n,i,e.readonlyAccess);if(o.isFailed())throw new Error(o.getError());return o.getValue()}toProjection(e){return{accessToken:e.accessToken.value,refreshToken:e.refreshToken.value,accessExpiration:e.accessToken.expiresAt,refreshExpiration:e.refreshToken.expiresAt,readonlyAccess:e.isReadOnly()}}}var Y=n(70781),z=n(13979);class Z{constructor(e){this.syncCallsThresholdPerMinute=e,this.callsPerMinuteMap=new Map}isSyncCallsThresholdReachedThisMinute(){const e=this.getCallsPerMinuteKey();return(this.callsPerMinuteMap.get(e)||0)>=this.syncCallsThresholdPerMinute}incrementCallsPerMinute(){const e=this.getCallsPerMinuteKey(),t=this.callsPerMinuteMap.get(e);void 0===t?(this.clear(),this.callsPerMinuteMap.set(e,1)):this.callsPerMinuteMap.set(e,t+1)}clear(){this.callsPerMinuteMap.clear()}getCallsPerMinuteKey(){const e=new Date;return"".concat(e.getFullYear(),"-").concat(e.getMonth(),"-").concat(e.getDate(),"T").concat(e.getHours(),":").concat(e.getMinutes())}}class W{constructor(e){this.options=e,this.factory=new Map,this.dependencies=new Map,this.DEFAULT_SYNC_CALLS_THRESHOLD_PER_MINUTE=200,this.dependencies.set(z.v.DeviceInterface,e.deviceInterface),this.dependencies.set(z.v.AlertService,e.alertService),this.dependencies.set(z.v.Crypto,e.crypto),this.registerServiceMakers(),this.registerUseCaseMakers()}deinit(){this.factory.clear();const e=this.getAll();for(const t of e)(0,s.isDeinitable)(t)&&t.deinit();this.dependencies.clear()}getAll(){return Array.from(this.dependencies.values()).filter(s.isNotUndefined)}get(e){const t=this.dependencies.get(e);if(t)return t;const n=this.factory.get(e);if(!n)throw new Error("No dependency maker found for ".concat(e.toString()));const r=n();return r?(this.dependencies.set(e,r),r):void 0}registerUseCaseMakers(){this.factory.set(z.v.DecryptBackupPayloads,(()=>new i.ZXN(this.get(z.v.EncryptionService),this.get(z.v.DetermineKeyToUse),this.get(z.v.Logger)))),this.factory.set(z.v.DetermineKeyToUse,(()=>new i.WEs(this.get(z.v.EncryptionService),this.get(z.v.KeySystemKeyManager)))),this.factory.set(z.v.GetBackupFileType,(()=>new i.KCz)),this.factory.set(z.v.GetFilePassword,(()=>new i.DZq(this.get(z.v.ChallengeService)))),this.factory.set(z.v.ValidateVaultPassword,(()=>new i.EGP(this.get(z.v.EncryptionService),this.get(z.v.KeySystemKeyManager)))),this.factory.set(z.v.AuthorizeVaultDeletion,(()=>new i.D$B(this.get(z.v.VaultLockService),this.get(z.v.ProtectionService),this.get(z.v.ChallengeService),this.get(z.v.ValidateVaultPassword)))),this.factory.set(z.v.GenerateUuid,(()=>new i.ug$(this.get(z.v.Crypto)))),this.factory.set(z.v.GetVaultItems,(()=>new i.$qZ(this.get(z.v.ItemManager)))),this.factory.set(z.v.DecryptErroredPayloads,(()=>new i.eyx(this.get(z.v.ItemsEncryptionService),this.get(z.v.DecryptErroredTypeAPayloads)))),this.factory.set(z.v.GetHost,(()=>new i.cdY(this.get(z.v.LegacyApiService)))),this.factory.set(z.v.IsApplicationUsingThirdPartyHost,(()=>new i.Y8x(this.get(z.v.GetHost)))),this.factory.set(z.v.SetHost,(()=>new i.q62(this.get(z.v.HttpService),this.get(z.v.LegacyApiService)))),this.factory.set(z.v.GetKeyPairs,(()=>new i.Byj(this.get(z.v.RootKeyManager)))),this.factory.set(z.v.ReencryptTypeAItems,(()=>new i.HSp(this.get(z.v.ItemManager),this.get(z.v.MutatorService)))),this.factory.set(z.v.CreateDecryptedBackupFile,(()=>new i.ocI(this.get(z.v.PayloadManager),this.get(z.v.ProtectionService)))),this.factory.set(z.v.CreateEncryptedBackupFile,(()=>new i.D6l(this.get(z.v.ItemManager),this.get(z.v.ProtectionService),this.get(z.v.EncryptionService)))),this.factory.set(z.v.ImportData,(()=>new i.Ens(this.get(z.v.ItemManager),this.get(z.v.SyncService),this.get(z.v.ProtectionService),this.get(z.v.EncryptionService),this.get(z.v.PayloadManager),this.get(z.v.HistoryManager),this.get(z.v.DecryptBackupFile),this.get(z.v.GetFilePassword)))),this.factory.set(z.v.IsVaultOwner,(()=>new i.hjk(this.get(z.v.UserService)))),this.factory.set(z.v.IsVaultAdmin,(()=>new i.o1e(this.get(z.v.UserService),this.get(z.v.VaultUserCache)))),this.factory.set(z.v.IsReadonlyVaultMember,(()=>new i.hEi(this.get(z.v.UserService),this.get(z.v.VaultUserCache)))),this.factory.set(z.v.DecryptBackupFile,(()=>new i.vV3(this.get(z.v.EncryptionService),this.get(z.v.KeySystemKeyManager),this.get(z.v.GetBackupFileType),this.get(z.v.DecryptBackupPayloads)))),this.factory.set(z.v.DiscardItemsLocally,(()=>new i.Ydb(this.get(z.v.ItemManager),this.get(z.v.DiskStorageService)))),this.factory.set(z.v.RemoveItemsFromMemory,(()=>new i.$sG(this.get(z.v.DiskStorageService),this.get(z.v.ItemManager),this.get(z.v.PayloadManager)))),this.factory.set(z.v.FindContact,(()=>new i.VD3(this.get(z.v.ItemManager)))),this.factory.set(z.v.DeleteContact,(()=>new i.z8s(this.get(z.v.MutatorService),this.get(z.v.SyncService),this.get(z.v.GetOwnedSharedVaults),this.get(z.v.ContactBelongsToVault)))),this.factory.set(z.v.EditContact,(()=>new i.ZQj(this.get(z.v.MutatorService)))),this.factory.set(z.v.GetAllContacts,(()=>new i.s$_(this.get(z.v.ItemManager)))),this.factory.set(z.v.ValidateItemSigner,(()=>new i.Lv2(this.get(z.v.FindContact)))),this.factory.set(z.v.CreateOrEditContact,(()=>new i.Dk4(this.get(z.v.MutatorService),this.get(z.v.FindContact),this.get(z.v.EditContact)))),this.factory.set(z.v.GetVault,(()=>new i.dDs(this.get(z.v.ItemManager)))),this.factory.set(z.v.GetVaults,(()=>new i.r0l(this.get(z.v.ItemManager)))),this.factory.set(z.v.SyncLocalVaultsWithRemoteSharedVaults,(()=>new i._Jh(this.get(z.v.SharedVaultServer),this.get(z.v.MutatorService)))),this.factory.set(z.v.ChangeAndSaveItem,(()=>new i.EdL(this.get(z.v.ItemManager),this.get(z.v.MutatorService),this.get(z.v.SyncService)))),this.factory.set(z.v.GetSharedVaults,(()=>new i.Tog(this.get(z.v.GetVaults)))),this.factory.set(z.v.GetOwnedSharedVaults,(()=>new i.tlz(this.get(z.v.GetSharedVaults),this.get(z.v.IsVaultOwner)))),this.factory.set(z.v.ContactBelongsToVault,(()=>new i.euo(this.get(z.v.GetVaultUsers)))),this.factory.set(z.v.ChangeVaultStorageMode,(()=>new i.KH1(this.get(z.v.MutatorService),this.get(z.v.SyncService),this.get(z.v.KeySystemKeyManager),this.get(z.v.GetVault)))),this.factory.set(z.v.ChangeVaultKeyOptions,(()=>new i.tuB(this.get(z.v.SyncService),this.get(z.v.RotateVaultKey),this.get(z.v.ChangeVaultStorageMode)))),this.factory.set(z.v.MoveItemsToVault,(()=>new i.cZu(this.get(z.v.MutatorService),this.get(z.v.SyncService),this.get(z.v.FileService)))),this.factory.set(z.v.CreateVault,(()=>new i.TQm(this.get(z.v.MutatorService),this.get(z.v.EncryptionService),this.get(z.v.KeySystemKeyManager),this.get(z.v.SyncService)))),this.factory.set(z.v.RemoveItemFromVault,(()=>new i.fF_(this.get(z.v.MutatorService),this.get(z.v.SyncService),this.get(z.v.FileService)))),this.factory.set(z.v.DeleteVault,(()=>new i.Rws(this.get(z.v.MutatorService),this.get(z.v.KeySystemKeyManager),this.get(z.v.GetVaultItems)))),this.factory.set(z.v.RotateVaultKey,(()=>new i.PqX(this.get(z.v.MutatorService),this.get(z.v.EncryptionService),this.get(z.v.KeySystemKeyManager),this.get(z.v.NotifyVaultUsersOfKeyRotation),this.get(z.v.IsVaultOwner)))),this.factory.set(z.v.ReuploadInvite,(()=>new i.afr(this.get(z.v.DecryptOwnMessage),this.get(z.v.SendVaultInvite),this.get(z.v.EncryptMessage)))),this.factory.set(z.v.ReuploadAllInvites,(()=>new i.F0Y(this.get(z.v.ReuploadInvite),this.get(z.v.FindContact),this.get(z.v.SharedVaultInvitesServer)))),this.factory.set(z.v.ResendAllMessages,(()=>new i.HLD(this.get(z.v.ResendMessage),this.get(z.v.DecryptOwnMessage),this.get(z.v.AsymmetricMessageServer),this.get(z.v.FindContact)))),this.factory.set(z.v.CreateSharedVault,(()=>new i.zEM(this.get(z.v.MutatorService),this.get(z.v.SharedVaultServer),this.get(z.v.CreateVault),this.get(z.v.MoveItemsToVault),this.get(z.v.GetVaultItems)))),this.factory.set(z.v.HandleKeyPairChange,(()=>new i.qjc(this.get(z.v.SelfContactManager),this.get(z.v.SharedVaultInvitesServer),this.get(z.v.AsymmetricMessageServer),this.get(z.v.ReuploadAllInvites),this.get(z.v.ResendAllMessages),this.get(z.v.GetAllContacts),this.get(z.v.SendOwnContactChangeMessage),this.get(z.v.CreateOrEditContact),this.get(z.v.Logger)))),this.factory.set(z.v.NotifyVaultUsersOfKeyRotation,(()=>new i.cVV(this.get(z.v.FindContact),this.get(z.v.SendVaultKeyChangedMessage),this.get(z.v.InviteToVault),this.get(z.v.SharedVaultInvitesServer),this.get(z.v.GetVaultContacts),this.get(z.v.DecryptOwnMessage),this.get(z.v.GetKeyPairs)))),this.factory.set(z.v.SendVaultKeyChangedMessage,(()=>new i.Foy(this.get(z.v.UserService),this.get(z.v.KeySystemKeyManager),this.get(z.v.EncryptMessage),this.get(z.v.FindContact),this.get(z.v.SendMessage),this.get(z.v.GetVaultUsers),this.get(z.v.GetKeyPairs)))),this.factory.set(z.v.SendVaultDataChangedMessage,(()=>new i.$SL(this.get(z.v.UserService),this.get(z.v.EncryptMessage),this.get(z.v.FindContact),this.get(z.v.GetVaultUsers),this.get(z.v.SendMessage),this.get(z.v.IsVaultOwner),this.get(z.v.GetKeyPairs)))),this.factory.set(z.v.ReplaceContactData,(()=>new i.xRL(this.get(z.v.MutatorService),this.get(z.v.SyncService),this.get(z.v.FindContact)))),this.factory.set(z.v.GetTrustedPayload,(()=>new i.pqE(this.get(z.v.DecryptMessage)))),this.factory.set(z.v.GetUntrustedPayload,(()=>new i.P9M(this.get(z.v.DecryptMessage)))),this.factory.set(z.v.GetVaultContacts,(()=>new i.bDv(this.get(z.v.FindContact),this.get(z.v.GetVaultUsers)))),this.factory.set(z.v.AcceptVaultInvite,(()=>new i.nmV(this.get(z.v.SharedVaultInvitesServer),this.get(z.v.ProcessAcceptedVaultInvite)))),this.factory.set(z.v.InviteToVault,(()=>new i.RAe(this.get(z.v.KeySystemKeyManager),this.get(z.v.EncryptMessage),this.get(z.v.SendVaultInvite),this.get(z.v.ShareContactWithVault),this.get(z.v.GetKeyPairs)))),this.factory.set(z.v.SendVaultInvite,(()=>new i.Iup(this.get(z.v.SharedVaultInvitesServer)))),this.factory.set(z.v.DeleteThirdPartyVault,(()=>new i.jGD(this.get(z.v.ItemManager),this.get(z.v.MutatorService),this.get(z.v.KeySystemKeyManager),this.get(z.v.SyncService),this.get(z.v.DiscardItemsLocally)))),this.factory.set(z.v.LeaveVault,(()=>new i.Z7G(this.get(z.v.UserService),this.get(z.v.SharedVaultUsersServer),this.get(z.v.ItemManager),this.get(z.v.DeleteThirdPartyVault)))),this.factory.set(z.v.ShareContactWithVault,(()=>new i.uLb(this.get(z.v.UserService),this.get(z.v.FindContact),this.get(z.v.EncryptMessage),this.get(z.v.SendMessage),this.get(z.v.GetVaultUsers),this.get(z.v.GetKeyPairs)))),this.factory.set(z.v.ConvertToSharedVault,(()=>new i.b$E(this.get(z.v.MutatorService),this.get(z.v.SharedVaultServer),this.get(z.v.MoveItemsToVault),this.get(z.v.GetVaultItems)))),this.factory.set(z.v.DeleteSharedVault,(()=>new i.KLn(this.get(z.v.SharedVaultServer),this.get(z.v.SyncService),this.get(z.v.DeleteVault)))),this.factory.set(z.v.RemoveVaultMember,(()=>new i.YxU(this.get(z.v.SharedVaultUsersServer)))),this.factory.set(z.v.DesignateSurvivor,(()=>new i.X2V(this.get(z.v.SharedVaultUsersServer)))),this.factory.set(z.v.GetVaultUsers,(()=>new i.PDt(this.get(z.v.SharedVaultUsersServer),this.get(z.v.VaultUserCache)))),this.factory.set(z.v.DecryptOwnMessage,(()=>new i.EQN(this.get(z.v.EncryptionOperators)))),this.factory.set(z.v.EncryptMessage,(()=>new i.S1n(this.get(z.v.EncryptionOperators)))),this.factory.set(z.v.DecryptMessage,(()=>new i.$M4(this.get(z.v.EncryptionOperators)))),this.factory.set(z.v.ResendMessage,(()=>new i.IF$(this.get(z.v.SendMessage),this.get(z.v.EncryptMessage)))),this.factory.set(z.v.SendMessage,(()=>new i.uzh(this.get(z.v.AsymmetricMessageServer)))),this.factory.set(z.v.ProcessAcceptedVaultInvite,(()=>new i.Klw(this.get(z.v.MutatorService),this.get(z.v.SyncService),this.get(z.v.CreateOrEditContact)))),this.factory.set(z.v.HandleRootKeyChangedMessage,(()=>new i.cjV(this.get(z.v.MutatorService),this.get(z.v.SyncService),this.get(z.v.GetVault),this.get(z.v.DecryptErroredPayloads)))),this.factory.set(z.v.SendOwnContactChangeMessage,(()=>new i.u3X(this.get(z.v.EncryptMessage),this.get(z.v.SendMessage)))),this.factory.set(z.v.GetOutboundMessages,(()=>new i.WUT(this.get(z.v.AsymmetricMessageServer)))),this.factory.set(z.v.GetInboundMessages,(()=>new i.Vxn(this.get(z.v.AsymmetricMessageServer)))),this.factory.set(z.v.CreateNewDefaultItemsKey,(()=>new i.Nwx(this.get(z.v.MutatorService),this.get(z.v.ItemManager),this.get(z.v.EncryptionOperators),this.get(z.v.RootKeyManager)))),this.factory.set(z.v.CreateNewItemsKeyWithRollback,(()=>new i.Yw(this.get(z.v.MutatorService),this.get(z.v.ItemManager),this.get(z.v.CreateNewDefaultItemsKey),this.get(z.v.DiscardItemsLocally),this.get(z.v.FindDefaultItemsKey)))),this.factory.set(z.v.FindDefaultItemsKey,(()=>new i.iPu)),this.factory.set(z.v.DecryptErroredTypeAPayloads,(()=>new i.suI(this.get(z.v.PayloadManager),this.get(z.v.DecryptTypeAPayloadWithKeyLookup)))),this.factory.set(z.v.DecryptTypeAPayload,(()=>new i.gzl(this.get(z.v.EncryptionOperators)))),this.factory.set(z.v.DecryptTypeAPayloadWithKeyLookup,(()=>new i.qXV(this.get(z.v.EncryptionOperators),this.get(z.v.KeySystemKeyManager),this.get(z.v.RootKeyManager),this.get(z.v.Logger)))),this.factory.set(z.v.EncryptTypeAPayload,(()=>new i.i6C(this.get(z.v.EncryptionOperators)))),this.factory.set(z.v.EncryptTypeAPayloadWithKeyLookup,(()=>new i.k6d(this.get(z.v.EncryptionOperators),this.get(z.v.KeySystemKeyManager),this.get(z.v.RootKeyManager))))}registerServiceMakers(){this.factory.set(z.v.Logger,(()=>new s.Logger(this.options.identifier))),this.factory.set(z.v.UserServer,(()=>new Y.UserServer(this.get(z.v.HttpService)))),this.factory.set(z.v.RootKeyManager,(()=>new i.wtP(this.get(z.v.DeviceInterface),this.get(z.v.DiskStorageService),this.get(z.v.EncryptionOperators),this.options.identifier,this.get(z.v.ReencryptTypeAItems),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.ItemsEncryptionService,(()=>new i.oQ4(this.get(z.v.ItemManager),this.get(z.v.PayloadManager),this.get(z.v.DiskStorageService),this.get(z.v.EncryptionOperators),this.get(z.v.KeySystemKeyManager),this.get(z.v.FindDefaultItemsKey),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.EncryptionOperators,(()=>new c.$l(this.get(z.v.Crypto)))),this.factory.set(z.v.SharedVaultInvitesServer,(()=>new Y.SharedVaultInvitesServer(this.get(z.v.HttpService)))),this.factory.set(z.v.SharedVaultServer,(()=>new Y.SharedVaultServer(this.get(z.v.HttpService)))),this.factory.set(z.v.AsymmetricMessageServer,(()=>new Y.AsymmetricMessageServer(this.get(z.v.HttpService)))),this.factory.set(z.v.SharedVaultUsersServer,(()=>new Y.SharedVaultUsersServer(this.get(z.v.HttpService)))),this.factory.set(z.v.VaultUserService,(()=>new i.igb(this.get(z.v.VaultService),this.get(z.v.VaultLockService),this.get(z.v.GetVaultUsers),this.get(z.v.RemoveVaultMember),this.get(z.v.IsVaultOwner),this.get(z.v.IsVaultAdmin),this.get(z.v.IsReadonlyVaultMember),this.get(z.v.GetVault),this.get(z.v.LeaveVault),this.get(z.v.DesignateSurvivor),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.VaultUserCache,(()=>new i.k7Z)),this.factory.set(z.v.VaultInviteService,(()=>new i.hZp(this.get(z.v.ItemManager),this.get(z.v.SessionManager),this.get(z.v.VaultUserService),this.get(z.v.SyncService),this.get(z.v.SharedVaultInvitesServer),this.get(z.v.StatusService),this.get(z.v.GetAllContacts),this.get(z.v.GetVault),this.get(z.v.GetVaultContacts),this.get(z.v.InviteToVault),this.get(z.v.GetTrustedPayload),this.get(z.v.GetUntrustedPayload),this.get(z.v.FindContact),this.get(z.v.AcceptVaultInvite),this.get(z.v.GetKeyPairs),this.get(z.v.DecryptErroredPayloads),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.AsymmetricMessageService,(()=>new i.WXh(this.get(z.v.EncryptionService),this.get(z.v.MutatorService),this.get(z.v.SessionManager),this.get(z.v.SyncService),this.get(z.v.AsymmetricMessageServer),this.get(z.v.CreateOrEditContact),this.get(z.v.FindContact),this.get(z.v.ReplaceContactData),this.get(z.v.GetTrustedPayload),this.get(z.v.GetVault),this.get(z.v.HandleRootKeyChangedMessage),this.get(z.v.GetOutboundMessages),this.get(z.v.GetInboundMessages),this.get(z.v.GetUntrustedPayload),this.get(z.v.GetKeyPairs),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.SharedVaultService,(()=>new i.cnh(this.get(z.v.ItemManager),this.get(z.v.SessionManager),this.get(z.v.VaultUserService),this.get(z.v.SyncLocalVaultsWithRemoteSharedVaults),this.get(z.v.GetVault),this.get(z.v.GetOwnedSharedVaults),this.get(z.v.CreateSharedVault),this.get(z.v.HandleKeyPairChange),this.get(z.v.FindContact),this.get(z.v.DeleteThirdPartyVault),this.get(z.v.ShareContactWithVault),this.get(z.v.ConvertToSharedVault),this.get(z.v.DeleteSharedVault),this.get(z.v.DiscardItemsLocally),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.VaultLockService,(()=>new i.PHC(this.get(z.v.ItemManager),this.get(z.v.EncryptionService),this.get(z.v.KeySystemKeyManager),this.get(z.v.GetVaults),this.get(z.v.DecryptErroredPayloads),this.get(z.v.RemoveItemsFromMemory),this.get(z.v.GetVaultItems),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.VaultService,(()=>new i.RDE(this.get(z.v.SyncService),this.get(z.v.ItemManager),this.get(z.v.MutatorService),this.get(z.v.VaultLockService),this.get(z.v.AlertService),this.get(z.v.GetVault),this.get(z.v.GetVaults),this.get(z.v.ChangeVaultKeyOptions),this.get(z.v.MoveItemsToVault),this.get(z.v.CreateVault),this.get(z.v.RemoveItemFromVault),this.get(z.v.DeleteVault),this.get(z.v.RotateVaultKey),this.get(z.v.SendVaultDataChangedMessage),this.get(z.v.IsVaultOwner),this.get(z.v.ValidateVaultPassword),this.get(z.v.AuthorizeVaultDeletion),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.SelfContactManager,(()=>new i.Ld1(this.get(z.v.SyncService),this.get(z.v.ItemManager),this.get(z.v.SessionManager),this.get(z.v.SingletonManager)))),this.factory.set(z.v.ContactService,(()=>new i.yqc(this.get(z.v.SyncService),this.get(z.v.MutatorService),this.get(z.v.SessionManager),this.get(z.v.Crypto),this.get(z.v.UserService),this.get(z.v.SelfContactManager),this.get(z.v.EncryptionService),this.get(z.v.DeleteContact),this.get(z.v.FindContact),this.get(z.v.GetAllContacts),this.get(z.v.CreateOrEditContact),this.get(z.v.EditContact),this.get(z.v.ValidateItemSigner),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.SignInWithRecoveryCodes,(()=>new w.Y(this.get(z.v.AuthManager),this.get(z.v.EncryptionService),this.get(z.v.InMemoryStore),this.get(z.v.Crypto),this.get(z.v.SessionManager),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.GetRecoveryCodes,(()=>new b.u(this.get(z.v.AuthManager),this.get(z.v.SettingsService)))),this.factory.set(z.v.AddAuthenticator,(()=>new A.f(this.get(z.v.AuthenticatorManager),this.options.u2fAuthenticatorRegistrationPromptFunction))),this.factory.set(z.v.ListAuthenticators,(()=>new v.F(this.get(z.v.AuthenticatorManager)))),this.factory.set(z.v.DeleteAuthenticator,(()=>new y.c(this.get(z.v.AuthenticatorManager)))),this.factory.set(z.v.GetAuthenticatorAuthenticationOptions,(()=>new m.V(this.get(z.v.AuthenticatorManager)))),this.factory.set(z.v.GetAuthenticatorAuthenticationResponse,(()=>new g.F(this.get(z.v.GetAuthenticatorAuthenticationOptions),this.options.u2fAuthenticatorVerificationPromptFunction))),this.factory.set(z.v.ListRevisions,(()=>new f.G(this.get(z.v.RevisionManager)))),this.factory.set(z.v.GetRevision,(()=>new p.X(this.get(z.v.RevisionManager),this.get(z.v.EncryptionService)))),this.factory.set(z.v.DeleteRevision,(()=>new h.g(this.get(z.v.RevisionManager)))),this.factory.set(z.v.RevisionServer,(()=>new Y.RevisionServer(this.get(z.v.HttpService)))),this.factory.set(z.v.RevisionApiService,(()=>new Y.RevisionApiService(this.get(z.v.RevisionServer)))),this.factory.set(z.v.RevisionManager,(()=>new i.t9U(this.get(z.v.RevisionApiService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.AuthServer,(()=>new Y.AuthServer(this.get(z.v.HttpService)))),this.factory.set(z.v.AuthApiService,(()=>new Y.AuthApiService(this.get(z.v.AuthServer),this.options.apiVersion))),this.factory.set(z.v.AuthManager,(()=>new i.El(this.get(z.v.AuthApiService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.AuthenticatorServer,(()=>new Y.AuthenticatorServer(this.get(z.v.HttpService)))),this.factory.set(z.v.AuthenticatorApiService,(()=>new Y.AuthenticatorApiService(this.get(z.v.AuthenticatorServer)))),this.factory.set(z.v.AuthenticatorManager,(()=>new i.F8w(this.get(z.v.AuthenticatorApiService),this.get(z.v.PreferencesService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.ActionsService,(()=>new d.b(this.get(z.v.ItemManager),this.get(z.v.AlertService),this.get(z.v.DeviceInterface),this.get(z.v.DeprecatedHttpService),this.get(z.v.EncryptionService),this.get(z.v.ChallengeService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.ListedService,(()=>new S.o(this.get(z.v.LegacyApiService),this.get(z.v.ItemManager),this.get(z.v.SettingsService),this.get(z.v.DeprecatedHttpService),this.get(z.v.ProtectionService),this.get(z.v.MutatorService),this.get(z.v.SyncService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.IntegrityService,(()=>new i.yim(this.get(z.v.LegacyApiService),this.get(z.v.LegacyApiService),this.get(z.v.PayloadManager),this.get(z.v.Logger),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.FileService,(()=>new i.IpN(this.get(z.v.LegacyApiService),this.get(z.v.MutatorService),this.get(z.v.SyncService),this.get(z.v.EncryptionService),this.get(z.v.ChallengeService),this.get(z.v.HttpService),this.get(z.v.AlertService),this.get(z.v.Crypto),this.get(z.v.InternalEventBus),this.get(z.v.Logger),this.get(z.v.FilesBackupService)))),this.factory.set(z.v.MigrationService,(()=>new C.H({encryptionService:this.get(z.v.EncryptionService),deviceInterface:this.get(z.v.DeviceInterface),storageService:this.get(z.v.DiskStorageService),sessionManager:this.get(z.v.SessionManager),challengeService:this.get(z.v.ChallengeService),itemManager:this.get(z.v.ItemManager),mutator:this.get(z.v.MutatorService),singletonManager:this.get(z.v.SingletonManager),featuresService:this.get(z.v.FeaturesService),environment:this.options.environment,platform:this.options.platform,identifier:this.options.identifier,internalEventBus:this.get(z.v.InternalEventBus),legacySessionStorageMapper:this.get(z.v.LegacySessionStorageMapper),backups:this.get(z.v.FilesBackupService),preferences:this.get(z.v.PreferencesService)}))),this.factory.set(z.v.HomeServerService,(()=>{if((0,i.dse)(this.get(z.v.DeviceInterface)))return new i.tGH(this.get(z.v.DeviceInterface),this.options.platform,this.get(z.v.InternalEventBus))})),this.factory.set(z.v.FilesBackupService,(()=>{if((0,i.dse)(this.get(z.v.DeviceInterface)))return new i.exs(this.get(z.v.ItemManager),this.get(z.v.LegacyApiService),this.get(z.v.EncryptionService),this.get(z.v.DeviceInterface),this.get(z.v.StatusService),this.get(z.v.Crypto),this.get(z.v.DiskStorageService),this.get(z.v.SessionManager),this.get(z.v.PayloadManager),this.get(z.v.HistoryManager),this.get(z.v.DeviceInterface),this.get(z.v.InternalEventBus))})),this.factory.set(z.v.StatusService,(()=>new i.Bjn(this.get(z.v.InternalEventBus)))),this.factory.set(z.v.MfaService,(()=>new E.p(this.get(z.v.SettingsService),this.get(z.v.Crypto),this.get(z.v.FeaturesService),this.get(z.v.ProtectionService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.ComponentManager,(()=>new I.y(this.get(z.v.ItemManager),this.get(z.v.MutatorService),this.get(z.v.SyncService),this.get(z.v.FeaturesService),this.get(z.v.PreferencesService),this.get(z.v.AlertService),this.options.environment,this.options.platform,this.get(z.v.DeviceInterface),this.get(z.v.Logger),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.FeaturesService,(()=>new _.k(this.get(z.v.DiskStorageService),this.get(z.v.ItemManager),this.get(z.v.MutatorService),this.get(z.v.SubscriptionManager),this.get(z.v.LegacyApiService),this.get(z.v.WebSocketsService),this.get(z.v.SettingsService),this.get(z.v.UserService),this.get(z.v.SyncService),this.get(z.v.AlertService),this.get(z.v.SessionManager),this.get(z.v.Crypto),this.get(z.v.Logger),this.get(z.v.IsApplicationUsingThirdPartyHost),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.SettingsService,(()=>new x.g(this.get(z.v.SessionManager),this.get(z.v.LegacyApiService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.PreferencesService,(()=>new P.y(this.get(z.v.SingletonManager),this.get(z.v.ItemManager),this.get(z.v.MutatorService),this.get(z.v.SyncService),this.get(z.v.DiskStorageService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.SingletonManager,(()=>new k.W(this.get(z.v.ItemManager),this.get(z.v.MutatorService),this.get(z.v.PayloadManager),this.get(z.v.SyncService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.KeyRecoveryService,(()=>new B.D(this.get(z.v.ItemManager),this.get(z.v.PayloadManager),this.get(z.v.LegacyApiService),this.get(z.v.EncryptionService),this.get(z.v.ChallengeService),this.get(z.v.AlertService),this.get(z.v.DiskStorageService),this.get(z.v.SyncService),this.get(z.v.UserService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.UserService,(()=>new i.KDu(this.get(z.v.SessionManager),this.get(z.v.SyncService),this.get(z.v.DiskStorageService),this.get(z.v.ItemManager),this.get(z.v.EncryptionService),this.get(z.v.AlertService),this.get(z.v.ChallengeService),this.get(z.v.ProtectionService),this.get(z.v.UserApiService),this.get(z.v.ReencryptTypeAItems),this.get(z.v.DecryptErroredPayloads),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.ProtectionService,(()=>new O.n(this.get(z.v.EncryptionService),this.get(z.v.MutatorService),this.get(z.v.ChallengeService),this.get(z.v.DiskStorageService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.WebSocketsService,(()=>new i.BV4(this.get(z.v.DiskStorageService),this.options.webSocketUrl,this.get(z.v.WebSocketApiService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.SyncFrequencyGuard,(()=>{var e;return new Z(null!==(e=this.options.syncCallsThresholdPerMinute)&&void 0!==e?e:this.DEFAULT_SYNC_CALLS_THRESHOLD_PER_MINUTE)})),this.factory.set(z.v.SyncBackoffService,(()=>new i.XEg)),this.factory.set(z.v.SyncService,(()=>new N._(this.get(z.v.ItemManager),this.get(z.v.SessionManager),this.get(z.v.EncryptionService),this.get(z.v.DiskStorageService),this.get(z.v.PayloadManager),this.get(z.v.LegacyApiService),this.get(z.v.HistoryManager),this.get(z.v.DeviceInterface),this.options.identifier,{loadBatchSize:this.options.loadBatchSize,sleepBetweenBatches:this.options.sleepBetweenBatches},this.get(z.v.Logger),this.get(z.v.WebSocketsService),this.get(z.v.SyncFrequencyGuard),this.get(z.v.SyncBackoffService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.HistoryManager,(()=>new D.E(this.get(z.v.ItemManager),this.get(z.v.DiskStorageService),this.get(z.v.DeviceInterface),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.SubscriptionManager,(()=>new i.LF2(this.get(z.v.SubscriptionApiService),this.get(z.v.SessionManager),this.get(z.v.DiskStorageService),this.get(z.v.IsApplicationUsingThirdPartyHost),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.SessionManager,(()=>new j.Sj(this.get(z.v.DiskStorageService),this.get(z.v.LegacyApiService),this.get(z.v.UserApiService),this.get(z.v.AlertService),this.get(z.v.EncryptionService),this.get(z.v.Crypto),this.get(z.v.ChallengeService),this.get(z.v.WebSocketsService),this.get(z.v.HttpService),this.get(z.v.SessionStorageMapper),this.get(z.v.LegacySessionStorageMapper),this.options.identifier,this.get(z.v.GetKeyPairs),this.get(z.v.IsApplicationUsingThirdPartyHost),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.WebSocketApiService,(()=>new Y.WebSocketApiService(this.get(z.v.WebSocketServer)))),this.factory.set(z.v.WebSocketServer,(()=>new Y.WebSocketServer(this.get(z.v.HttpService)))),this.factory.set(z.v.SubscriptionApiService,(()=>new Y.SubscriptionApiService(this.get(z.v.SubscriptionServer),this.options.apiVersion))),this.factory.set(z.v.UserApiService,(()=>new Y.UserApiService(this.get(z.v.UserServer),this.get(z.v.UserRequestServer),this.options.apiVersion))),this.factory.set(z.v.SubscriptionServer,(()=>new Y.SubscriptionServer(this.get(z.v.HttpService)))),this.factory.set(z.v.UserRequestServer,(()=>new Y.UserRequestServer(this.get(z.v.HttpService)))),this.factory.set(z.v.InternalEventBus,(()=>new i.Ehg)),this.factory.set(z.v.PayloadManager,(()=>new V.O(this.get(z.v.Logger),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.ItemManager,(()=>new U.A(this.get(z.v.PayloadManager),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.MutatorService,(()=>new Q.V(this.get(z.v.ItemManager),this.get(z.v.PayloadManager),this.get(z.v.AlertService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.DiskStorageService,(()=>new L.e(this.get(z.v.DeviceInterface),this.options.identifier,this.get(z.v.InternalEventBus)))),this.factory.set(z.v.NotificationService,(()=>new i.gqp(this.get(z.v.InternalEventBus)))),this.factory.set(z.v.InMemoryStore,(()=>new i.CEH)),this.factory.set(z.v.KeySystemKeyManager,(()=>new i.Pn4(this.get(z.v.ItemManager),this.get(z.v.MutatorService),this.get(z.v.DiskStorageService),this.get(z.v.RemoveItemsFromMemory),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.ChallengeService,(()=>new R.P(this.get(z.v.DiskStorageService),this.get(z.v.EncryptionService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.EncryptionService,(()=>new i.C6q(this.get(z.v.ItemManager),this.get(z.v.MutatorService),this.get(z.v.PayloadManager),this.get(z.v.EncryptionOperators),this.get(z.v.ItemsEncryptionService),this.get(z.v.RootKeyManager),this.get(z.v.Crypto),this.get(z.v.CreateNewItemsKeyWithRollback),this.get(z.v.FindDefaultItemsKey),this.get(z.v.EncryptTypeAPayloadWithKeyLookup),this.get(z.v.EncryptTypeAPayload),this.get(z.v.DecryptTypeAPayload),this.get(z.v.DecryptTypeAPayloadWithKeyLookup),this.get(z.v.CreateNewDefaultItemsKey),this.get(z.v.GetKeyPairs),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.DeprecatedHttpService,(()=>new F.q(this.options.environment,this.options.appVersion,this.get(z.v.InternalEventBus)))),this.factory.set(z.v.HttpService,(()=>new Y.HttpService(this.options.environment,this.options.appVersion,M.in,this.options.apiVersion,this.get(z.v.Logger)))),this.factory.set(z.v.LegacyApiService,(()=>new T.A(this.get(z.v.HttpService),this.get(z.v.DiskStorageService),this.options.defaultHost,this.get(z.v.InMemoryStore),this.get(z.v.Crypto),this.get(z.v.SessionStorageMapper),this.get(z.v.LegacySessionStorageMapper),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.SessionStorageMapper,(()=>new G)),this.factory.set(z.v.LegacySessionStorageMapper,(()=>new H))}}var q=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class J{constructor(e){this.ephemeralIdentifier=(0,s.nonSecureRandomIdentifier)(),this.eventHandlers=[],this.serviceObservers=[],this.managedSubscribers=[],this.createdNewDatabase=!1,this.started=!1,this.launched=!1,this.dealloced=!1,this.revokingSession=!1,this.handledFullSyncStage=!1;const t=Object.assign(Object.assign({},i.U3K),e);if(!u.W.onLog)throw Error("SNLog.onLog must be set.");if(!u.W.onError)throw Error("SNLog.onError must be set.");const n=["deviceInterface","environment","platform","crypto","alertService","identifier","defaultHost","appVersion","apiVersion"];for(const e of n)if(!t[e])throw Error("".concat(e," must be supplied when creating an application."));var r,o;this.environment=e.environment,this.platform=e.platform,this.identifier=e.identifier,this.options=Object.freeze(t),this.dependencies=new W(this.options),this.dependencies.get(z.v.Logger).setLevel("error"),this.registerServiceObservers(),r=this.dependencies,(o=this.events).addEventHandler(r.get(z.v.AsymmetricMessageService),i.wMo.ReceivedAsymmetricMessages),o.addEventHandler(r.get(z.v.AsymmetricMessageService),i.fAX.MessageSentToUser),o.addEventHandler(r.get(z.v.DiskStorageService),i.n9K.ApplicationStageChanged),o.addEventHandler(r.get(z.v.FeaturesService),i.Sf$.MetaReceived),o.addEventHandler(r.get(z.v.FeaturesService),i.n9K.ApplicationStageChanged),o.addEventHandler(r.get(z.v.IntegrityService),i.wMo.SyncRequestsIntegrityCheck),o.addEventHandler(r.get(z.v.KeyRecoveryService),i.n9K.ApplicationStageChanged),o.addEventHandler(r.get(z.v.KeySystemKeyManager),i.n9K.ApplicationStageChanged),o.addEventHandler(r.get(z.v.MigrationService),i.n9K.ApplicationStageChanged),o.addEventHandler(r.get(z.v.NotificationService),i.wMo.ReceivedNotifications),o.addEventHandler(r.get(z.v.NotificationService),i.fAX.NotificationAddedForUser),o.addEventHandler(r.get(z.v.PreferencesService),i.n9K.ApplicationStageChanged),o.addEventHandler(r.get(z.v.ProtectionService),i.n9K.ApplicationStageChanged),o.addEventHandler(r.get(z.v.ProtectionService),i.n9K.Started),o.addEventHandler(r.get(z.v.SelfContactManager),i.n9K.ApplicationStageChanged),o.addEventHandler(r.get(z.v.SessionManager),i.Sf$.SessionRefreshed),o.addEventHandler(r.get(z.v.SessionManager),i.n9K.ApplicationStageChanged),o.addEventHandler(r.get(z.v.SharedVaultService),i.JQe.NotificationReceived),o.addEventHandler(r.get(z.v.VaultInviteService),i.JQe.NotificationReceived),o.addEventHandler(r.get(z.v.SharedVaultService),i.Pxr.UserKeyPairChanged),o.addEventHandler(r.get(z.v.SharedVaultService),i.wMo.ReceivedRemoteSharedVaults),o.addEventHandler(r.get(z.v.SubscriptionManager),i.n9K.ApplicationStageChanged),o.addEventHandler(r.get(z.v.SubscriptionManager),i.n9K.Launched),o.addEventHandler(r.get(z.v.SubscriptionManager),i.n9K.SignedIn),o.addEventHandler(r.get(z.v.SubscriptionManager),i.n9K.UserRolesChanged),o.addEventHandler(r.get(z.v.SubscriptionManager),i.Pxr.Restored),o.addEventHandler(r.get(z.v.SyncService),i.ezr.IntegrityCheckCompleted),o.addEventHandler(r.get(z.v.SyncService),i.fAX.ItemsChangedOnServer),o.addEventHandler(r.get(z.v.UserService),i.oF7.SignedInOrRegistered),o.addEventHandler(r.get(z.v.VaultInviteService),i.n9K.Launched),o.addEventHandler(r.get(z.v.VaultInviteService),i.wMo.ReceivedSharedVaultInvites),o.addEventHandler(r.get(z.v.VaultInviteService),i.fAX.UserInvitedToSharedVault),r.get(z.v.FilesBackupService)&&o.addEventHandler(r.get(z.v.FilesBackupService),i.n9K.ApplicationStageChanged),r.get(z.v.HomeServerService)&&o.addEventHandler(r.get(z.v.HomeServerService),i.n9K.ApplicationStageChanged)}registerServiceObservers(){const e=this.dependencies.get(z.v.EncryptionService);this.serviceObservers.push(e.addEventObserver((e=>q(this,void 0,void 0,(function*(){e===i.fa_.RootKeyStatusChanged&&(yield this.notifyEvent(i.n9K.KeyStatusChanged))}))))),this.dependencies.get(z.v.DiskStorageService).provideEncryptionProvider(e);const t=this.dependencies.get(z.v.LegacyApiService);this.dependencies.get(z.v.HttpService).setCallbacks(t.processMetaObject.bind(t),t.setSession.bind(t)),this.serviceObservers.push(this.dependencies.get(z.v.SessionManager).addEventObserver((t=>q(this,void 0,void 0,(function*(){switch(t){case i.Pxr.Restored:(()=>{q(this,void 0,void 0,(function*(){yield this.sync.sync({sourceDescription:"Session restored pre key creation"}),e.needsNewRootKeyBasedItemsKey()&&e.createNewDefaultItemsKey().then((()=>{this.sync.sync({sourceDescription:"Session restored post key creation"})}))}))})();break;case i.Pxr.Revoked:yield this.handleRevokedSession();break;case i.Pxr.UserKeyPairChanged:break;default:(0,s.assertUnreachable)(t)}})))));const n=this.dependencies.get(z.v.SyncService).addEventObserver(((t,n)=>q(this,void 0,void 0,(function*(){const r=l(t);r&&(yield e.onSyncEvent(t),yield this.notifyEvent(r,n),r===i.n9K.CompletedFullSync&&(this.handledFullSyncStage||(this.handledFullSyncStage=!0,yield this.handleStage(i.Ugm.FullSyncCompleted_13))))}))));this.serviceObservers.push(n);const r=this.dependencies.get(z.v.ProtectionService);this.serviceObservers.push(r.addEventObserver((e=>{e===i.Hh3.UnprotectedSessionBegan?this.notifyEvent(i.n9K.UnprotectedSessionBegan):e===i.Hh3.UnprotectedSessionExpired&&this.notifyEvent(i.n9K.UnprotectedSessionExpired)})));const o=this.dependencies.get(z.v.UserService);this.serviceObservers.push(o.addEventObserver(((e,t)=>q(this,void 0,void 0,(function*(){switch(e){case i.oF7.SignedInOrRegistered:this.notifyEvent(i.n9K.SignedIn);break;case i.oF7.SignedOut:yield this.notifyEvent(i.n9K.SignedOut),yield this.prepareForDeinit(),this.deinit(this.getDeinitMode(),(null==t?void 0:t.payload.source)||i.u4P.SignOut);break;default:(0,s.assertUnreachable)(e)}})))));const a=this.dependencies.get(z.v.PreferencesService);this.serviceObservers.push(a.addEventObserver((e=>{e===i.WZd.PreferencesChanged?this.notifyEvent(i.n9K.PreferencesChanged):e===i.WZd.LocalPreferencesChanged&&this.notifyEvent(i.n9K.LocalPreferencesChanged)})));const c=this.dependencies.get(z.v.FeaturesService);this.serviceObservers.push(c.addEventObserver((e=>{switch(e){case i.Usi.UserRolesChanged:this.notifyEvent(i.n9K.UserRolesChanged);break;case i.Usi.FeaturesAvailabilityChanged:this.notifyEvent(i.n9K.FeaturesAvailabilityChanged);break;case i.Usi.DidPurchaseSubscription:this.notifyEvent(i.n9K.DidPurchaseSubscription);break;default:(0,s.assertUnreachable)(e)}})))}computePrivateUsername(e){return(0,c.lx)(this.options.crypto,e)}prepareForLaunch(e){return q(this,void 0,void 0,(function*(){if(this.launched)throw new Error("Attempting to prelaunch already launched application");yield this.options.crypto.initialize(),this.setLaunchCallback(e);const t=yield this.device.openDatabase(this.identifier).catch((e=>{this.notifyEvent(i.n9K.LocalDatabaseReadError,e)}));this.createdNewDatabase=(0,s.useBoolean)(null==t?void 0:t.isNewDatabase,!1),yield this.migrations.initialize(),yield this.notifyEvent(i.n9K.MigrationsLoaded),yield this.handleStage(i.Ugm.PreparingForLaunch_0),yield this.storage.initializeFromDisk(),yield this.notifyEvent(i.n9K.StorageReady),yield this.encryption.initialize(),yield this.handleStage(i.Ugm.ReadyForLaunch_05),this.started=!0,yield this.notifyEvent(i.n9K.Started)}))}setLaunchCallback(e){this.challenges.sendChallenge=e.receiveChallenge}launch(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return q(this,void 0,void 0,(function*(){if(this.launched)throw new Error("Attempting to launch already launched application");this.launched=!1;const t=this.getLaunchChallenge();if(t){const e=yield this.challenges.promptForChallengeResponse(t);if(!e)throw Error("Launch challenge was cancelled.");yield this.handleLaunchChallengeResponse(e)}if(this.storage.isStorageWrapped())try{yield this.storage.decryptStorage()}catch(e){this.alerts.alert(i.kov.StorageDecryptErrorBody,i.kov.StorageDecryptErrorTitle)}yield this.handleStage(i.Ugm.StorageDecrypted_09);const n=this.legacyApi.loadHost();this.http.setHost(n),this.sockets.loadWebSocketUrl(),this.settings.initializeFromDisk(),this.launched=!0,yield this.notifyEvent(i.n9K.Launched),yield this.handleStage(i.Ugm.Launched_10),yield this.handleStage(i.Ugm.LoadingDatabase_11),this.createdNewDatabase&&(yield this.sync.onNewDatabaseCreated());const r=this.sync.loadDatabasePayloads().then((()=>q(this,void 0,void 0,(function*(){if(this.dealloced)throw"Application has been destroyed.";yield this.handleStage(i.Ugm.LoadedDatabase_12),this.sync.beginAutoSyncTimer(),yield this.sync.sync({mode:i.YCg.DownloadFirst,source:i.Lbd.External,sourceDescription:"Application Launch"}),this.vaultUsers.invalidateVaultUsersCache().catch(console.error)})))).catch((e=>{throw this.notifyEvent(i.n9K.LocalDatabaseReadError,e),e}));e&&(yield r)}))}onStart(){}onLaunch(){}getLaunchChallenge(){return this.protections.createLaunchChallenge()}handleLaunchChallengeResponse(e){var t;return q(this,void 0,void 0,(function*(){if(e.challenge.hasPromptForValidationType(i.tQn.LocalPasscode)){let n=null===(t=e.artifacts)||void 0===t?void 0:t.wrappingKey;if(!n){const t=e.getValueForType(i.tQn.LocalPasscode);n=yield this.encryption.computeWrappingKey(t.value)}yield this.encryption.unwrapRootKey(n)}}))}handleStage(e){return q(this,void 0,void 0,(function*(){yield this.events.publishSync({type:i.n9K.ApplicationStageChanged,payload:{stage:e}},i.WNP.SEQUENCE)}))}addEventObserver(e,t){const n={callback:e,singleEvent:t};return this.eventHandlers.push(n),()=>{(0,s.removeFromArray)(this.eventHandlers,n)}}addSingleEventObserver(e,t){return this.addEventObserver((n=>q(this,void 0,void 0,(function*(){n===e&&t(e)}))),e)}notifyEvent(e,t){return q(this,void 0,void 0,(function*(){e===i.n9K.Started?this.onStart():e===i.n9K.Launched&&this.onLaunch();for(const n of this.eventHandlers.slice())(n.singleEvent&&n.singleEvent===e||!n.singleEvent)&&(yield n.callback(e,t||{}));this.events.publish({type:e,payload:t}),this.migrations.handleApplicationEvent(e)}))}getSessions(){return this.sessions.getSessionsList()}revokeSession(e){return q(this,void 0,void 0,(function*(){if(yield this.protections.authorizeSessionRevoking())return this.sessions.revokeSession(e)}))}revokeAllOtherSessions(){return q(this,void 0,void 0,(function*(){return this.sessions.revokeAllOtherSessions()}))}userCanManageSessions(){const e=this.getUserVersion();return!(0,s.isNullOrUndefined)(e)&&(0,r.compareVersions)(e,r.ProtocolVersion.V004)>=0}setCustomHost(e,t){return q(this,void 0,void 0,(function*(){yield this.setHost.execute(e),this.sockets.setWebSocketUrl(t)}))}getUserPasswordCreationDate(){return this.encryption.getPasswordCreatedDate()}getProtocolEncryptionDisplayName(){return this.encryption.getEncryptionDisplayName()}getUserVersion(){return this.encryption.getUserVersion()}protocolUpgradeAvailable(){return this.encryption.upgradeAvailable()}isEncryptionAvailable(){return this.hasAccount()||this.hasPasscode()}upgradeProtocolVersion(){return q(this,void 0,void 0,(function*(){const e=yield this.user.performProtocolUpgrade();return e.success?this.hasAccount()?this.alerts.alert(i.GUt.SuccessAccount):this.alerts.alert(i.GUt.SuccessPasscodeOnly):e.error&&this.alerts.alert(i.GUt.Fail),e}))}hasAccount(){return this.encryption.hasAccount()}hasProtectionSources(){return this.protections.hasProtectionSources()}getProtectionSessionExpiryDate(){return this.protections.getSessionExpiryDate()}clearProtectionSession(){return this.protections.clearSession()}authorizeProtectedActionForNotes(e,t){return q(this,void 0,void 0,(function*(){return yield this.protections.authorizeProtectedActionForItems(e,t)}))}authorizeNoteAccess(e){return this.protections.authorizeItemAccess(e)}authorizeAutolockIntervalChange(){return this.protections.authorizeAutolockIntervalChange()}isEphemeralSession(){return this.storage.isEphemeralSession()}setValue(e,t,n){return this.storage.setValue(e,t,n)}getValue(e,t){return this.storage.getValue(e,t)}removeValue(e,t){return q(this,void 0,void 0,(function*(){return this.storage.removeValue(e,t)}))}getPreference(e,t){return this.preferences.getValue(e,t)}setPreference(e,t){return q(this,void 0,void 0,(function*(){return this.preferences.setValue(e,t)}))}prepareForDeinit(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return q(this,void 0,void 0,(function*(){const t=this.dependencies.getAll().filter(s.canBlockDeinit),n=Promise.all(t.map((e=>e.blockDeinit())));0===e?yield n:yield Promise.race([n,(0,s.sleep)(e,!1,"Preparing for deinit...")])}))}addChallengeObserver(e,t){return this.challenges.addChallengeObserver(e,t)}submitValuesForChallenge(e,t){return this.challenges.submitValuesForChallenge(e,t)}cancelChallenge(e){this.challenges.cancelChallenge(e)}setOnDeinit(e){this.onDeinit=e}deinit(e,t){var n;this.dealloced=!0;for(const e of this.serviceObservers)e();for(const e of this.managedSubscribers)e();this.options.crypto.deinit(),this.options=void 0,this.createdNewDatabase=!1,this.serviceObservers.length=0,this.managedSubscribers.length=0,this.started=!1,this.dependencies.deinit(),null===(n=this.onDeinit)||void 0===n||n.call(this,this,e,t),this.onDeinit=void 0}register(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return q(this,void 0,void 0,(function*(){return this.user.register(e,t,n,r,i)}))}signIn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6?arguments[6]:void 0;return q(this,void 0,void 0,(function*(){return this.user.signIn(e,t,n,r,i,o,s)}))}getCaptchaUrl(){return q(this,void 0,void 0,(function*(){return this.legacyApi.getCaptchaUrl()}))}changeEmail(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r.KeyParamsOrigination.EmailChange;return q(this,void 0,void 0,(function*(){return this.user.changeCredentials({currentPassword:t,newEmail:e,passcode:n,origination:i,validateNewPasswordStrength:!1})}))}changePassword(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r.KeyParamsOrigination.PasswordChange,o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return q(this,void 0,void 0,(function*(){return this.user.changeCredentials({currentPassword:e,newPassword:t,passcode:n,origination:i,validateNewPasswordStrength:o})}))}importData(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return q(this,void 0,void 0,(function*(){return this.dependencies.get(z.v.ImportData).execute(e,t)}))}handleRevokedSession(){return q(this,void 0,void 0,(function*(){if(this.revokingSession)return;this.revokingSession=!0;const e=this.alerts;yield this.user.signOut(!0),e.alert(i.K9E.CurrentSessionRevoked)}))}validateAccountPassword(e){return q(this,void 0,void 0,(function*(){const{valid:t}=yield this.encryption.validateAccountPassword(e);return t}))}isStarted(){return this.started}isLaunched(){return this.launched}hasPasscode(){return this.encryption.hasPasscode()}lock(){return q(this,void 0,void 0,(function*(){return yield this.prepareForDeinit(500),this.deinit(this.getDeinitMode(),i.u4P.Lock)}))}isNativeMobileWeb(){return this.environment===o.Environment.Mobile}getDeinitMode(){return"hard"===this.getValue(i.QtK.DeinitMode)?i.CYv.Hard:i.CYv.Soft}addPasscode(e){return this.user.addPasscode(e)}removePasscode(){return q(this,void 0,void 0,(function*(){return this.user.removePasscode()}))}changePasscode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.KeyParamsOrigination.PasscodeChange;return q(this,void 0,void 0,(function*(){return this.user.changePasscode(e,t)}))}enableEphemeralPersistencePolicy(){return this.storage.setPersistencePolicy(i.eIN.Ephemeral)}hasPendingMigrations(){return this.migrations.hasPendingMigrations()}presentKeyRecoveryWizard(){return this.dependencies.get(z.v.KeyRecoveryService).presentKeyRecoveryWizard()}canAttemptDecryptionOfItem(e){return this.dependencies.get(z.v.KeyRecoveryService).canAttemptDecryptionOfItem(e)}isUsingHomeServer(){return q(this,void 0,void 0,(function*(){const e=this.dependencies.get(z.v.HomeServerService);return!!e&&this.getHost.execute().getValue()===(yield e.getHomeServerUrl())}))}get device(){return this.dependencies.get(z.v.DeviceInterface)}get subscriptions(){return this.dependencies.get(z.v.SubscriptionManager)}get signInWithRecoveryCodes(){return this.dependencies.get(z.v.SignInWithRecoveryCodes)}get getRecoveryCodes(){return this.dependencies.get(z.v.GetRecoveryCodes)}get addAuthenticator(){return this.dependencies.get(z.v.AddAuthenticator)}get listAuthenticators(){return this.dependencies.get(z.v.ListAuthenticators)}get deleteAuthenticator(){return this.dependencies.get(z.v.DeleteAuthenticator)}get getAuthenticatorAuthenticationOptions(){return this.dependencies.get(z.v.GetAuthenticatorAuthenticationOptions)}get getAuthenticatorAuthenticationResponse(){return this.dependencies.get(z.v.GetAuthenticatorAuthenticationResponse)}get listRevisions(){return this.dependencies.get(z.v.ListRevisions)}get getRevision(){return this.dependencies.get(z.v.GetRevision)}get deleteRevision(){return this.dependencies.get(z.v.DeleteRevision)}get files(){return this.dependencies.get(z.v.FileService)}get features(){return this.dependencies.get(z.v.FeaturesService)}get items(){return this.dependencies.get(z.v.ItemManager)}get payloads(){return this.dependencies.get(z.v.PayloadManager)}get protections(){return this.dependencies.get(z.v.ProtectionService)}get sync(){return this.dependencies.get(z.v.SyncService)}get user(){return this.dependencies.get(z.v.UserService)}get settings(){return this.dependencies.get(z.v.SettingsService)}get mutator(){return this.dependencies.get(z.v.MutatorService)}get sessions(){return this.dependencies.get(z.v.SessionManager)}get status(){return this.dependencies.get(z.v.StatusService)}get fileBackups(){return this.dependencies.get(z.v.FilesBackupService)}get componentManager(){return this.dependencies.get(z.v.ComponentManager)}get listed(){return this.dependencies.get(z.v.ListedService)}get alerts(){return this.dependencies.get(z.v.AlertService)}get storage(){return this.dependencies.get(z.v.DiskStorageService)}get actions(){return this.dependencies.get(z.v.ActionsService)}get challenges(){return this.dependencies.get(z.v.ChallengeService)}get asymmetric(){return this.dependencies.get(z.v.AsymmetricMessageService)}get homeServer(){return this.dependencies.get(z.v.HomeServerService)}get preferences(){return this.dependencies.get(z.v.PreferencesService)}get history(){return this.dependencies.get(z.v.HistoryManager)}get encryption(){return this.dependencies.get(z.v.EncryptionService)}get events(){return this.dependencies.get(z.v.InternalEventBus)}get vaults(){return this.dependencies.get(z.v.VaultService)}get vaultLocks(){return this.dependencies.get(z.v.VaultLockService)}get vaultUsers(){return this.dependencies.get(z.v.VaultUserService)}get vaultInvites(){return this.dependencies.get(z.v.VaultInviteService)}get contacts(){return this.dependencies.get(z.v.ContactService)}get sharedVaults(){return this.dependencies.get(z.v.SharedVaultService)}get changeAndSaveItem(){return this.dependencies.get(z.v.ChangeAndSaveItem)}get getHost(){return this.dependencies.get(z.v.GetHost)}get setHost(){return this.dependencies.get(z.v.SetHost)}get legacyApi(){return this.dependencies.get(z.v.LegacyApiService)}get mfa(){return this.dependencies.get(z.v.MfaService)}get generateUuid(){return this.dependencies.get(z.v.GenerateUuid)}get createDecryptedBackupFile(){return this.dependencies.get(z.v.CreateDecryptedBackupFile)}get createEncryptedBackupFile(){return this.dependencies.get(z.v.CreateEncryptedBackupFile)}get migrations(){return this.dependencies.get(z.v.MigrationService)}get http(){return this.dependencies.get(z.v.HttpService)}get sockets(){return this.dependencies.get(z.v.WebSocketsService)}}class X{constructor(e,t,n){this.item=t.findSureItem(e),n&&n(this.item),this.removeObserver=t.streamItems(this.item.content_type,(t=>{let{changed:r,inserted:i}=t;const o=[...r,...i].find((t=>t.uuid===e));o&&(this.item=o,n&&n(this.item))}))}deinit(){this.removeObserver?(this.removeObserver(),this.removeObserver=void 0):console.error("A LiveItem is attempting to be deinited more than once.")}}var $=n(2256)},58181:(e,t,n)=>{n.d(t,{$:()=>r,R:()=>a});var r,i=n(55668),o=n(87901);!function(e){e.PrimaryApplicationSet="PrimaryApplicationSet",e.DescriptorsDataChanged="DescriptorsDataChanged",e.DeviceWillRestart="DeviceWillRestart"}(r||(r={}));var s=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class a extends i.wcN{constructor(e,t){void 0===t&&(t=new i.Ehg),super(t),this.device=e,this.onApplicationDeinit=(e,t,n)=>{this.primaryApplication===e&&(this.primaryApplication=void 0),(()=>{s(this,void 0,void 0,(function*(){n===i.u4P.SignOut&&this.removeDescriptor(this.descriptorForApplication(e));const o=this.getDescriptors();if(0===o.length||n===i.u4P.SignOutAll){const e=o.map((e=>e.identifier));this.descriptorRecord={};const{killsApplication:t}=yield this.device.clearAllDataFromDevice(e);if(t)return}const s=this.device;this.notifyEvent(r.DeviceWillRestart,{source:n,mode:t}),this.deinit(),t===i.CYv.Hard?s.performHardReset():s.performSoftReset()}))})()}}deinit(){super.deinit(),this.device.deinit(),this.device=void 0,this.callback=void 0,this.primaryApplication=void 0,this.onApplicationDeinit=void 0}initialize(e){return s(this,void 0,void 0,(function*(){if(this.device.isDeviceDestroyed())throw"Attempting to initialize new application while device is destroyed.";this.callback=e,this.descriptorRecord=yield this.device.getJsonParsedRawStorageValue(i.Bq2.DescriptorRecord),this.descriptorRecord||(yield this.createNewDescriptorRecord());let t=this.findPrimaryDescriptor();t||(console.error("No primary application descriptor found. Ensure migrations have been run."),t=this.getDescriptors()[0],this.setDescriptorAsPrimary(t),yield this.persistDescriptors());const n=yield this.buildApplication(t);this.primaryApplication=n,n.addEventObserver((()=>s(this,void 0,void 0,(function*(){this.renameDescriptor(t,n.sessions.getWorkspaceDisplayIdentifier())}))),i.n9K.SignedIn),yield this.notifyEvent(r.PrimaryApplicationSet,{application:n})}))}createNewDescriptorRecord(){return s(this,void 0,void 0,(function*(){const e="standardnotes",t={[e]:{identifier:e,label:"Main Workspace",primary:!0}};this.device.setRawStorageValue(i.Bq2.DescriptorRecord,JSON.stringify(t)),this.descriptorRecord=t,yield this.persistDescriptors()}))}getDescriptors(){return Object.values(this.descriptorRecord)}findPrimaryDescriptor(){for(const e of this.getDescriptors())if(e.primary)return e}signOutAllWorkspaces(){return s(this,void 0,void 0,(function*(){yield this.primaryApplication.user.signOut(!1,i.u4P.SignOutAll)}))}setDescriptorAsPrimary(e){for(const t of this.getDescriptors())t.primary=t===e}persistDescriptors(){return s(this,void 0,void 0,(function*(){yield this.device.setRawStorageValue(i.Bq2.DescriptorRecord,JSON.stringify(this.descriptorRecord)),this.notifyEvent(r.DescriptorsDataChanged,{descriptors:this.descriptorRecord})}))}renameDescriptor(e,t){e.label=t,this.persistDescriptors()}removeDescriptor(e){delete this.descriptorRecord[e.identifier];const t=this.getDescriptors();return e.primary&&t.length>0&&this.setDescriptorAsPrimary(t[0]),this.persistDescriptors()}removeAllDescriptors(){return this.descriptorRecord={},this.persistDescriptors()}descriptorForApplication(e){return this.descriptorRecord[e.identifier]}createNewApplicationDescriptor(e){const t=o.UuidGenerator.GenerateUuid(),n=this.getDescriptors().length+1;return{identifier:t,label:e||"Workspace ".concat(n),primary:!1}}createNewPrimaryDescriptor(e){return s(this,void 0,void 0,(function*(){const t=this.createNewApplicationDescriptor(e);this.descriptorRecord[t.identifier]=t,this.setDescriptorAsPrimary(t),yield this.persistDescriptors()}))}unloadCurrentAndCreateNewDescriptor(e){return s(this,void 0,void 0,(function*(){yield this.createNewPrimaryDescriptor(e),this.primaryApplication&&this.primaryApplication.deinit(this.primaryApplication.getDeinitMode(),i.u4P.SwitchWorkspace)}))}unloadCurrentAndActivateDescriptor(e){return s(this,void 0,void 0,(function*(){this.setDescriptorAsPrimary(e),yield this.persistDescriptors(),this.primaryApplication&&this.primaryApplication.deinit(this.primaryApplication.getDeinitMode(),i.u4P.SwitchWorkspace)}))}buildApplication(e){return s(this,void 0,void 0,(function*(){const t=yield this.callback.applicationCreator(e,this.device);return t.setOnDeinit(this.onApplicationDeinit),t}))}}},29159:(e,t,n)=>{var r;n.d(t,{Z:()=>r}),function(e){e.EnteringBackground="EnteringBackground",e.ResumingFromBackground="ResumingFromBackground",e.GainingFocus="GainingFocus",e.LosingFocus="LosingFocus",e.AndroidBackButtonPressed="AndroidBackButtonPressed",e.ColorSchemeChanged="ColorSchemeChanged",e.KeyboardFrameWillChange="KeyboardFrameWillChange",e.KeyboardFrameDidChange="KeyboardFrameDidChange",e.KeyboardWillShow="KeyboardWillShow",e.KeyboardWillHide="KeyboardWillHide",e.ReceivedFile="ReceivedFile",e.ReceivedLink="ReceivedLink",e.ReceivedText="ReceivedText",e.OpenFilePreview="OpenFilePreview"}(r||(r={}))},68704:(e,t,n)=>{n.d(t,{f:()=>i});var r=n(82648);class i{constructor(e,t){this.authenticatorClient=e,this.authenticatorRegistrationPromptFunction=t}execute(e){return t=this,n=void 0,o=function*(){if(!this.authenticatorRegistrationPromptFunction)return r.Result.fail("Could not generate authenticator registration options: No authenticator registration prompt function provided");const t=r.Uuid.create(e.userUuid);if(t.isFailed())return r.Result.fail("Could not generate authenticator registration options: ".concat(t.getError()));const n=t.getValue(),i=r.Validator.isNotEmpty(e.authenticatorName);if(i.isFailed())return r.Result.fail("Could not generate authenticator registration options: ".concat(i.getError()));const o=yield this.authenticatorClient.generateRegistrationOptions();if(null===o)return r.Result.fail("Could not generate authenticator registration options");let s;try{s=yield this.authenticatorRegistrationPromptFunction(o)}catch(e){return"InvalidStateError"===e.name?r.Result.fail("Authenticator was probably already registered by user"):r.Result.fail("Could not generate authenticator registration options: ".concat(e.message))}return(yield this.authenticatorClient.verifyRegistrationResponse(n,e.authenticatorName,s))?r.Result.ok():r.Result.fail("Could not verify authenticator registration response")},new((i=void 0)||(i=Promise))((function(e,r){function s(e){try{l(o.next(e))}catch(e){r(e)}}function a(e){try{l(o.throw(e))}catch(e){r(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(t,n||[])).next())}));var t,n,i,o}}},58875:(e,t,n)=>{n.d(t,{c:()=>i});var r=n(82648);class i{constructor(e){this.authenticatorClient=e}execute(e){return t=this,n=void 0,o=function*(){const t=r.Uuid.create(e.authenticatorId);if(t.isFailed())return r.Result.fail("Could not delete authenticator: ".concat(t.getError()));const n=t.getValue();return(yield this.authenticatorClient.delete(n))?r.Result.ok():r.Result.fail("Could not delete authenticator")},new((i=void 0)||(i=Promise))((function(e,r){function s(e){try{l(o.next(e))}catch(e){r(e)}}function a(e){try{l(o.throw(e))}catch(e){r(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(t,n||[])).next())}));var t,n,i,o}}},46390:(e,t,n)=>{n.d(t,{g:()=>i});var r=n(82648);class i{constructor(e){this.revisionManager=e}execute(e){return t=this,n=void 0,o=function*(){const t=r.Uuid.create(e.itemUuid);if(t.isFailed())return r.Result.fail("Could not delete revision: ".concat(t.getError()));const n=t.getValue(),i=r.Uuid.create(e.revisionUuid);if(i.isFailed())return r.Result.fail("Could not delete revision: ".concat(i.getError()));const o=i.getValue();try{return yield this.revisionManager.deleteRevision(n,o),r.Result.ok()}catch(e){return r.Result.fail("Could not delete revision: ".concat(e.message))}},new((i=void 0)||(i=Promise))((function(e,r){function s(e){try{l(o.next(e))}catch(e){r(e)}}function a(e){try{l(o.throw(e))}catch(e){r(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(t,n||[])).next())}));var t,n,i,o}}},12473:(e,t,n)=>{n.d(t,{V:()=>i});var r=n(82648);class i{constructor(e){this.authenticatorClient=e}execute(e){return t=this,n=void 0,o=function*(){const t=r.Username.create(e.username);if(t.isFailed())return r.Result.fail("Could not generate authenticator authentication options: ".concat(t.getError()));const n=t.getValue(),i=yield this.authenticatorClient.generateAuthenticationOptions(n);return null===i?r.Result.fail("Could not generate authenticator authentication options"):r.Result.ok(i)},new((i=void 0)||(i=Promise))((function(e,r){function s(e){try{l(o.next(e))}catch(e){r(e)}}function a(e){try{l(o.throw(e))}catch(e){r(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(t,n||[])).next())}));var t,n,i,o}}},84526:(e,t,n)=>{n.d(t,{F:()=>i});var r=n(82648);class i{constructor(e,t){this.getAuthenticatorAuthenticationOptions=e,this.authenticatorVerificationPromptFunction=t}execute(e){return t=this,n=void 0,o=function*(){if(!this.authenticatorVerificationPromptFunction)return r.Result.fail("Could not generate authenticator authentication options: No authenticator verification prompt function provided");const t=yield this.getAuthenticatorAuthenticationOptions.execute({username:e.username});if(t.isFailed())return r.Result.fail(t.getError());const n=t.getValue();let i;try{i=yield this.authenticatorVerificationPromptFunction(n)}catch(e){return r.Result.fail("Could not generate authenticator authentication options: ".concat(e.message))}return r.Result.ok(i)},new((i=void 0)||(i=Promise))((function(e,r){function s(e){try{l(o.next(e))}catch(e){r(e)}}function a(e){try{l(o.throw(e))}catch(e){r(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(t,n||[])).next())}));var t,n,i,o}}},79327:(e,t,n)=>{n.d(t,{u:()=>i});var r=n(82648);class i{constructor(e,t){this.authClient=e,this.settingsClient=t}execute(){return e=this,t=void 0,i=function*(){const e=yield this.settingsClient.getSetting(r.SettingName.create(r.SettingName.NAMES.RecoveryCodes).getValue());if(void 0!==e)return r.Result.ok(e);const t=yield this.authClient.generateRecoveryCodes();return!1===t?r.Result.fail("Could not generate recovery code"):r.Result.ok(t)},new((n=void 0)||(n=Promise))((function(r,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}));var e,t,n,i}}},51383:(e,t,n)=>{n.d(t,{X:()=>o});var r=n(82648),i=n(22325);class o{constructor(e,t){this.revisionManager=e,this.encryptionService=t}execute(e){var t,n,o,s,a,l;return o=this,s=void 0,l=function*(){const o=r.Uuid.create(e.itemUuid);if(o.isFailed())return r.Result.fail("Could not get revision: ".concat(o.getError()));const s=o.getValue(),a=r.Uuid.create(e.revisionUuid);if(a.isFailed())return r.Result.fail("Could not get revision: ".concat(a.getError()));const l=a.getValue();let c;try{c=yield this.revisionManager.getRevision(s,l)}catch(e){return r.Result.fail("Could not get revision: ".concat(e.message))}if(!c)return r.Result.fail("Could not get revision: Revision not found");const u=new i.EncryptedPayload(Object.assign(Object.assign({},(0,i.PayloadTimestampDefaults)()),{uuid:c.uuid,content:c.content,enc_item_key:c.enc_item_key,items_key_id:c.items_key_id,auth_hash:c.auth_hash,content_type:c.content_type,updated_at:new Date(c.updated_at),created_at:new Date(c.created_at),key_system_identifier:null!==(t=c.key_system_identifier)&&void 0!==t?t:void 0,shared_vault_uuid:null!==(n=c.shared_vault_uuid)&&void 0!==n?n:void 0,waitingForKey:!1,errorDecrypting:!1})),d=this.encryptionService.getEmbeddedPayloadAuthenticatedData(u),h=null==d?void 0:d.u,p=u.copy({uuid:h||c.item_uuid});if(void 0!==(0,i.checkRemotePayloadAllowed)(p).disallowed)return r.Result.fail("Remote payload is disallowed: ".concat(JSON.stringify(p)));const f=new i.EncryptedPayload(p),g=yield this.encryptionService.decryptSplitSingle({usesItemsKeyWithKeyLookup:{items:[f]}});return(0,i.isErrorDecryptingPayload)(g)?r.Result.fail("Could not decrypt revision."):r.Result.ok(new i.HistoryEntry(g))},new((a=void 0)||(a=Promise))((function(e,t){function n(e){try{i(l.next(e))}catch(e){t(e)}}function r(e){try{i(l.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(n,r)}i((l=l.apply(o,s||[])).next())}))}}},43252:(e,t,n)=>{n.d(t,{F:()=>i});var r=n(82648);class i{constructor(e){this.authenticatorClient=e}execute(){return e=this,t=void 0,i=function*(){const e=yield this.authenticatorClient.list();return r.Result.ok(e)},new((n=void 0)||(n=Promise))((function(r,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}));var e,t,n,i}}},9704:(e,t,n)=>{n.d(t,{G:()=>i});var r=n(82648);class i{constructor(e){this.revisionManager=e}execute(e){return t=this,n=void 0,o=function*(){const t=r.Uuid.create(e.itemUuid);if(t.isFailed())return r.Result.fail("Could not list item revisions: ".concat(t.getError()));const n=t.getValue();try{const e=yield this.revisionManager.listRevisions(n);return r.Result.ok(e)}catch(e){return r.Result.fail("Could not list item revisions: ".concat(e.message))}},new((i=void 0)||(i=Promise))((function(e,r){function s(e){try{l(o.next(e))}catch(e){r(e)}}function a(e){try{l(o.throw(e))}catch(e){r(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(t,n||[])).next())}));var t,n,i,o}}},32274:(e,t,n)=>{n.d(t,{Y:()=>a});var r=n(82648),i=n(22325),o=n(55668),s=n(86999);class a{constructor(e,t,n,r,i,o){this.authManager=e,this.encryptionService=t,this.inMemoryStore=n,this.crypto=r,this.sessionManager=i,this.internalEventBus=o}execute(e){return t=this,n=void 0,l=function*(){if(this.encryptionService.hasAccount())return r.Result.fail("Tried to sign in when an account already exists.");const t=this.crypto.generateRandomKey(256);this.inMemoryStore.setValue(o.QtK.CodeVerifier,t);const n=this.crypto.base64URLEncode(yield this.crypto.sha256(t)),a=yield this.authManager.recoveryKeyParams(Object.assign({codeChallenge:n},e));if(!1===a)return r.Result.fail("Could not retrieve recovery key params");const l=(0,s.jl)(a);if(!this.encryptionService.supportedVersions().includes(l.version))return this.encryptionService.isVersionNewerThanLibraryVersion(l.version)?r.Result.fail(o.fnl):r.Result.fail(o.R53);if(!this.encryptionService.platformSupportsKeyDerivation(l))return r.Result.fail(o.VnT);const c=yield this.encryptionService.computeRootKey(e.password,l),u=yield this.authManager.signInWithRecoveryCodes({codeVerifier:t,recoveryCodes:e.recoveryCodes,username:e.username,password:c.serverPassword,hvmToken:e.hvmToken});if(!1===u.success)return u.captchaURL?r.Result.fail(JSON.stringify({captchaURL:u.captchaURL})):r.Result.fail("Could not sign in with recovery code");this.inMemoryStore.removeValue(o.QtK.CodeVerifier);const d=new s.t$((0,i.CopyPayloadWithContentOverride)(c.payload,{keyParams:u.keyParams}));return yield this.sessionManager.handleAuthentication({session:u.session,user:u.user,rootKey:d}),yield this.internalEventBus.publishSync({type:o.oF7.SignedInOrRegistered,payload:{payload:{ephemeral:!1,mergeLocal:!1,awaitSync:!0,checkIntegrity:!1}}},o.WNP.SEQUENCE),r.Result.ok()},new((a=void 0)||(a=Promise))((function(e,r){function i(e){try{s(l.next(e))}catch(e){r(e)}}function o(e){try{s(l.throw(e))}catch(e){r(e)}}function s(t){var n;t.done?e(t.value):(n=t.value,n instanceof a?n:new a((function(e){e(n)}))).then(i,o)}s((l=l.apply(t,n||[])).next())}));var t,n,a,l}}},67199:(e,t,n)=>{n.d(t,{FL:()=>u.F,FV:()=>a.F,GU:()=>d.G,VQ:()=>s.V,Xc:()=>c.X,Y_:()=>h.Y,cx:()=>i.c,fC:()=>r.f,gS:()=>o.g,u2:()=>l.u});var r=n(68704),i=n(58875),o=n(46390),s=n(12473),a=n(84526),l=n(79327),c=n(51383),u=n(43252),d=n(9704),h=n(32274)},43361:(e,t,n)=>{n.d(t,{W:()=>r});class r{static log(){this.onLog(...arguments)}static error(e){return this.onError(e),e}}},38529:(e,t,n)=>{n.d(t,{l:()=>s});var r=n(22325),i=n(87901),o=n(82648);class s{static isApplicableToCurrentData(e){const t=e.getItems(o.ContentType.TYPES.Tag);for(const e of t)if(e.title.includes(r.TagFolderDelimitter)&&!e.parentId)return!0;return!1}static run(e,t){return n=this,s=void 0,l=function*(){const n=e.getItems(o.ContentType.TYPES.Tag),s=(0,i.sortByKey)(n,"title");for(const e of s){const n=e.title.split(r.TagFolderDelimitter),o=1===n.length,s=!!e.parentId,a=n.some((e=>0===e.length));if(s||o||a)continue;const l=(0,i.withoutLastElement)(n),c=(0,i.lastElement)(n);if(!c)return;const u=yield t.findOrCreateTagParentChain(l);yield t.changeItem(e,(e=>{e.title=c,u&&e.makeChildOf(u)}))}},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{o(l.next(e))}catch(e){t(e)}}function i(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){var n;t.done?e(t.value):(n=t.value,n instanceof a?n:new a((function(e){e(n)}))).then(r,i)}o((l=l.apply(n,s||[])).next())}));var n,s,a,l}}},58386:(e,t,n)=>{n.d(t,{_:()=>f});var r={};n.r(r),n.d(r,{StorageReader2_0_0:()=>d});var i=n(22325),o=n(94986),s=n(15078),a=n(55668),l=n(87901);class c{constructor(e,t,n){this.deviceInterface=e,this.identifier=t,this.environment=n}static version(){throw Error("Must override")}}var u=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class d extends c{static version(){return o.Oq}getStorage(){return u(this,void 0,void 0,(function*(){const e=(0,a.xLN)(this.identifier,a.Bq2.StorageObject),t=yield this.deviceInterface.getRawStorageValue(e);return t?JSON.parse(t):void 0}))}getNonWrappedValue(e){var t;return u(this,void 0,void 0,(function*(){const n=yield this.getStorage();if(n)return null===(t=n[a.dDH.Nonwrapped])||void 0===t?void 0:t[e]}))}getAccountKeyParams(){return u(this,void 0,void 0,(function*(){return this.getNonWrappedValue(a.QtK.RootKeyParams)}))}hasNonWrappedAccountKeys(){return u(this,void 0,void 0,(function*(){const e=yield this.deviceInterface.getNamespacedKeychainValue(this.identifier);return!(0,l.isNullOrUndefined)(e)}))}hasPasscode(){return u(this,void 0,void 0,(function*(){const e=yield this.getNonWrappedValue(a.QtK.WrappedRootKey);return!(0,l.isNullOrUndefined)(e)}))}usesKeychain(){return!0}}var h=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};const p="last_migration_timestamp";class f extends s.U{constructor(){super(...arguments),this.didPreRun=!1}preRun(){return h(this,void 0,void 0,(function*(){yield this.storeVersionNumber(),this.didPreRun=!0}))}registerStageHandlers(){this.registerStageHandler(a.Ugm.PreparingForLaunch_0,(()=>h(this,void 0,void 0,(function*(){(yield this.needsKeychainRepair())&&(yield this.repairMissingKeychain()),this.markDone()}))))}getStoredVersion(){const e=(0,a.xLN)(this.services.identifier,a.Bq2.SnjsVersion);return this.services.deviceInterface.getRawStorageValue(e)}storeVersionNumber(){return h(this,void 0,void 0,(function*(){const e=(0,a.xLN)(this.services.identifier,a.Bq2.SnjsVersion);if(!(yield this.getStoredVersion())){const t=["migrations","ephemeral","user","cachedThemes","syncToken","encryptedStorage"];let n=!1;for(const e of t)if(yield this.services.deviceInterface.getRawStorageValue(e)){n=!0;break}if(n)yield this.services.deviceInterface.setRawStorageValue(e,o.DU);else{const t=(0,a.xLN)(this.services.identifier,p);null!=(yield this.services.deviceInterface.getRawStorageValue(t))?(yield this.services.deviceInterface.setRawStorageValue(e,o.Oq),yield this.services.deviceInterface.removeRawStorageValue(p)):yield this.services.deviceInterface.setRawStorageValue(e,o.in)}}}))}loadReader(){return h(this,void 0,void 0,(function*(){if(this.reader)return;const e=yield this.getStoredVersion();this.reader=function(e,t,n,i){const s=function(e){const t=Object.values(r).sort(((e,t)=>-1*(0,o.D8)(e.version(),t.version())));for(const n of t){if(n.version()===e)return n;if((0,o.jV)(n.version(),e))return n}throw Error("Cannot find reader for version ".concat(e))}(e);return new s(t,n,i)}(e,this.services.deviceInterface,this.services.identifier,this.services.environment)}))}needsKeychainRepair(){return h(this,void 0,void 0,(function*(){if(null!=this.memoizedNeedsKeychainRepair)return this.memoizedNeedsKeychainRepair;if(!this.didPreRun)throw Error("Attempting to access specialized function before prerun");return this.reader||(yield this.loadReader()),this.reader.usesKeychain?null==(yield this.reader.getAccountKeyParams())||(yield this.reader.hasPasscode())||(yield this.reader.hasNonWrappedAccountKeys())?(this.memoizedNeedsKeychainRepair=!1,this.memoizedNeedsKeychainRepair):(this.memoizedNeedsKeychainRepair=!0,this.memoizedNeedsKeychainRepair):(this.memoizedNeedsKeychainRepair=!1,this.memoizedNeedsKeychainRepair)}))}repairMissingKeychain(){return h(this,void 0,void 0,(function*(){const e=yield this.reader.getAccountKeyParams(),t=(yield this.services.deviceInterface.getAllDatabaseEntries(this.services.identifier)).map((e=>new i.EncryptedPayload(e)));let n=t.find((e=>(0,i.ContentTypeUsesRootKeyEncryption)(e.content_type)));if(n||(n=t[0]),!n)return void(yield this.services.storageService.clearValues());const r=new a.tv4([new a.FEo(a.tQn.None,void 0,a.K9E.PasswordInputPlaceholder,!0)],a.Ps8.Custom,!1,a.mHn.Title,a.mHn.Text(e.identifier));return new Promise((t=>{this.services.challengeService.addChallengeObserver(r,{onNonvalidatedSubmit:o=>h(this,void 0,void 0,(function*(){const s=o.values[0].value,a=this.services.encryptionService.createKeyParams(e),c=yield this.services.encryptionService.computeRootKey(s,a);(0,l.assert)(n);const u=yield this.services.encryptionService.decryptSplitSingle({usesRootKey:{items:[n],key:c}});if((0,i.isErrorDecryptingPayload)(u))this.services.challengeService.setValidationStatusForChallenge(r,o.values[0],!1);else{const e=c.getKeychainValue();yield this.services.deviceInterface.setNamespacedKeychainValue(e,this.services.identifier),t(!0),this.services.challengeService.completeChallenge(r)}}))}),this.services.challengeService.promptForChallengeResponse(r)}))}))}}},15078:(e,t,n)=>{n.d(t,{U:()=>o});var r=n(55668),i=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class o{constructor(e){this.services=e,this.stageHandlers={},this.registerStageHandlers()}static version(){throw"Must override migration version"}registerStageHandler(e,t){this.stageHandlers[e]=t}markDone(){var e;null===(e=this.onDoneHandler)||void 0===e||e.call(this),this.onDoneHandler=void 0}promptForPasscodeUntilCorrect(e){return i(this,void 0,void 0,(function*(){const t=new r.tv4([new r.FEo(r.tQn.None)],r.Ps8.Migration,!1);return new Promise((n=>{this.services.challengeService.addChallengeObserver(t,{onNonvalidatedSubmit:r=>i(this,void 0,void 0,(function*(){const i=r.values[0],o=i.value;(yield e(o))?(this.services.challengeService.completeChallenge(t),n(o)):this.services.challengeService.setValidationStatusForChallenge(t,i,!1)}))}),this.services.challengeService.promptForChallengeResponse(t)}))}))}onDone(e){this.onDoneHandler=e}handleStage(e){return i(this,void 0,void 0,(function*(){const t=this.stageHandlers[e];t&&(yield t())}))}}},42798:(e,t,n)=>{n.d(t,{ly:()=>s,wg:()=>v,aL:()=>b,od:()=>E,Jb:()=>_,Lp:()=>P,kK:()=>h,qW:()=>f,Ni:()=>m,pI:()=>u,R_:()=>k});var r=n(55668),i=n(15078),o=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class s extends i.U{static version(){return"2.0.15"}registerStageHandlers(){this.registerStageHandler(r.Ugm.LoadedDatabase_12,(()=>o(this,void 0,void 0,(function*(){yield this.createNewDefaultItemsKeyIfNecessary(),this.markDone()}))))}createNewDefaultItemsKeyIfNecessary(){return o(this,void 0,void 0,(function*(){this.services.encryptionService.needsNewRootKeyBasedItemsKey()&&(yield this.services.encryptionService.createNewDefaultItemsKey())}))}}var a=n(22325),l=n(82648),c=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class u extends i.U{static version(){return"2.7.0"}registerStageHandlers(){this.registerStageHandler(r.Ugm.FullSyncCompleted_13,(()=>c(this,void 0,void 0,(function*(){yield this.deleteBatchManagerSingleton(),this.markDone()}))))}deleteBatchManagerSingleton(){return c(this,void 0,void 0,(function*(){const e=new a.CompoundPredicate("and",[new a.Predicate("content_type","=",l.ContentType.TYPES.Component),new a.Predicate("identifier","=","org.standardnotes.batch-manager")]),t=this.services.singletonManager.findSingleton(l.ContentType.TYPES.Component,e);t&&(yield this.services.mutator.setItemToBeDeleted(t))}))}}var d=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class h extends i.U{static version(){return"2.20.0"}registerStageHandlers(){this.registerStageHandler(r.Ugm.LoadedDatabase_12,(()=>d(this,void 0,void 0,(function*(){yield this.deleteMfaItems(),this.markDone()}))))}deleteMfaItems(){return d(this,void 0,void 0,(function*(){const e=this.services.itemManager.getItems("SF|MFA");for(const t of e)this.services.itemManager.removeItemFromMemory(t),yield this.services.storageService.deletePayloadWithUuid(t.uuid)}))}}var p=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class f extends i.U{static version(){return"2.36.0"}registerStageHandlers(){this.registerStageHandler(r.Ugm.LoadedDatabase_12,(()=>p(this,void 0,void 0,(function*(){yield this.removeServerExtensionsLocally(),this.markDone()}))))}removeServerExtensionsLocally(){return p(this,void 0,void 0,(function*(){const e=this.services.itemManager.getItems("SF|Extension");for(const t of e)this.services.itemManager.removeItemFromMemory(t),yield this.services.storageService.deletePayloadWithUuid(t.uuid)}))}}var g=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class m extends i.U{static version(){return"2.42.0"}registerStageHandlers(){this.registerStageHandler(r.Ugm.FullSyncCompleted_13,(()=>g(this,void 0,void 0,(function*(){yield this.deleteNoDistraction(),this.markDone()}))))}deleteNoDistraction(){return g(this,void 0,void 0,(function*(){const e=this.services.itemManager.getItems(l.ContentType.TYPES.Theme).filter((e=>"org.standardnotes.theme-no-distraction"===e.identifier));for(const t of e)yield this.services.mutator.setItemToBeDeleted(t)}))}}var y=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class v extends i.U{static version(){return"2.167.6"}registerStageHandlers(){this.registerStageHandler(r.Ugm.Launched_10,(()=>y(this,void 0,void 0,(function*(){yield this.migrateStorageKeysForDesktopBackups(),this.markDone()}))))}migrateStorageKeysForDesktopBackups(){return y(this,void 0,void 0,(function*(){const e=this.services.deviceInterface;if(!(0,r.dse)(e)||!this.services.backups)return;const t=yield e.isLegacyFilesBackupsEnabled();if(this.services.storageService.setValue(r.QtK.FileBackupsEnabled,t),t){const t=yield e.getLegacyFilesBackupsLocation(),n=yield e.joinPaths(t,yield this.services.backups.prependWorkspacePathForPath(r.aax));yield e.migrateLegacyFileBackupsToNewStructure(n),this.services.storageService.setValue(r.QtK.FileBackupsLocation,n)}if(yield e.wasLegacyTextBackupsExplicitlyDisabled())this.services.storageService.setValue(r.QtK.TextBackupsEnabled,!1);else{const t=yield e.joinPaths(yield e.getLegacyTextBackupsLocation(),yield this.services.backups.prependWorkspacePathForPath(r.OU3));this.services.storageService.setValue(r.QtK.TextBackupsLocation,t),this.services.storageService.setValue(r.QtK.TextBackupsEnabled,!0)}}))}}var A=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class b extends i.U{static version(){return"2.168.6"}registerStageHandlers(){this.registerStageHandler(r.Ugm.Launched_10,(()=>A(this,void 0,void 0,(function*(){yield this.migrateErroneousWindowsPathFromPreviousMigration(),this.markDone()}))))}migrateErroneousWindowsPathFromPreviousMigration(){return A(this,void 0,void 0,(function*(){const e=this.services.deviceInterface;if(!(0,r.dse)(e)||!this.services.backups)return;if(this.services.platform!==a.Platform.WindowsDesktop)return;const t=this.services.backups.getTextBackupsLocation();if(t){const n=t.split("/");if(n.length>1){const t=yield e.joinPaths(...n);this.services.storageService.setValue(r.QtK.TextBackupsLocation,t)}}const n=this.services.backups.getFilesBackupsLocation();if(n){const t=n.split("/");if(t.length>1){const n=yield e.joinPaths(...t);this.services.storageService.setValue(r.QtK.FileBackupsLocation,n)}}const i=this.services.backups.getPlaintextBackupsLocation();if(i){const t=i.split("/");if(t.length>1){const n=yield e.joinPaths(...t);this.services.storageService.setValue(r.QtK.PlaintextBackupsLocation,n)}}}))}}var w=n(87901),S=n(80215),C=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class E extends i.U{static version(){return"2.202.1"}registerStageHandlers(){this.registerStageHandler(r.Ugm.FullSyncCompleted_13,(()=>C(this,void 0,void 0,(function*(){yield this.migrateComponentDataToUserPreferences(),yield this.migrateActiveComponentsToUserPreferences(),this.markDone()}))))}migrateComponentDataToUserPreferences(){var e,t;return C(this,void 0,void 0,(function*(){const n=this.services.itemManager.getItems(l.ContentType.TYPES.Component);if(0===n.length)return;const r=(0,w.Copy)(null!==(e=this.services.preferences.getValue(a.PrefKey.ComponentPreferences))&&void 0!==e?e:{});for(const e of n){const n=e.legacyComponentData;if(!n)continue;if(0===Object.keys(n).length)continue;const i=(0,S.FindNativeFeature)(e.identifier)?e.identifier:e.uuid,o=null!==(t=r[i])&&void 0!==t?t:{};for(const e of Object.keys(n))o[e]=n[e];r[i]=o}yield this.services.preferences.setValueDetached(a.PrefKey.ComponentPreferences,r)}))}migrateActiveComponentsToUserPreferences(){return C(this,void 0,void 0,(function*(){const e=[...this.services.itemManager.getItems(l.ContentType.TYPES.Component),...this.services.itemManager.getItems(l.ContentType.TYPES.Theme)].filter((e=>e.legacyActive));if(0===e.length)return;const t=e.filter((e=>e.isTheme())),n=e.filter((e=>!e.isTheme()));yield this.services.preferences.setValueDetached(a.PrefKey.DEPRECATED_ActiveThemes,(0,w.Uuids)(t)),yield this.services.preferences.setValueDetached(a.PrefKey.ActiveComponents,(0,w.Uuids)(n))}))}}var I=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class _ extends i.U{static version(){return"2.208.0"}registerStageHandlers(){this.registerStageHandler(r.Ugm.FullSyncCompleted_13,(()=>I(this,void 0,void 0,(function*(){yield this.migrateSyncedPreferencesToLocal(),this.markDone()}))))}migrateSyncedPreferencesToLocal(){return I(this,void 0,void 0,(function*(){this.services.preferences.setLocalValue(r.dH$.ActiveThemes,this.services.preferences.getValue(a.PrefKey.DEPRECATED_ActiveThemes,a.PrefDefaults[a.PrefKey.DEPRECATED_ActiveThemes])),this.services.preferences.setLocalValue(r.dH$.UseSystemColorScheme,this.services.preferences.getValue(a.PrefKey.DEPRECATED_UseSystemColorScheme,a.PrefDefaults[a.PrefKey.DEPRECATED_UseSystemColorScheme])),this.services.preferences.setLocalValue(r.dH$.AutoLightThemeIdentifier,this.services.preferences.getValue(a.PrefKey.DEPRECATED_AutoLightThemeIdentifier,a.PrefDefaults[a.PrefKey.DEPRECATED_AutoLightThemeIdentifier])),this.services.preferences.setLocalValue(r.dH$.AutoDarkThemeIdentifier,this.services.preferences.getValue(a.PrefKey.DEPRECATED_AutoDarkThemeIdentifier,a.PrefDefaults[a.PrefKey.DEPRECATED_AutoDarkThemeIdentifier])),this.services.preferences.setLocalValue(r.dH$.UseTranslucentUI,this.services.preferences.getValue(a.PrefKey.DEPRECATED_UseTranslucentUI,a.PrefDefaults[a.PrefKey.DEPRECATED_UseTranslucentUI]))}))}}var x=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class P extends i.U{static version(){return"2.209.0"}registerStageHandlers(){this.registerStageHandler(r.Ugm.FullSyncCompleted_13,(()=>x(this,void 0,void 0,(function*(){yield this.migrateSyncedPreferencesToLocal(),this.markDone()}))))}migrateSyncedPreferencesToLocal(){return x(this,void 0,void 0,(function*(){this.services.preferences.setLocalValue(r.dH$.EditorMonospaceEnabled,this.services.preferences.getValue(a.PrefKey.DEPRECATED_EditorMonospaceEnabled,a.PrefDefaults[r.dH$.EditorMonospaceEnabled])),this.services.preferences.setLocalValue(r.dH$.EditorFontSize,this.services.preferences.getValue(a.PrefKey.DEPRECATED_EditorFontSize,a.PrefDefaults[r.dH$.EditorFontSize])),this.services.preferences.setLocalValue(r.dH$.EditorLineWidth,this.services.preferences.getValue(a.PrefKey.DEPRECATED_EditorLineWidth,a.PrefDefaults[r.dH$.EditorLineWidth])),this.services.preferences.setLocalValue(r.dH$.EditorLineHeight,this.services.preferences.getValue(a.PrefKey.DEPRECATED_EditorLineHeight,a.PrefDefaults[r.dH$.EditorLineHeight]))}))}}const k=[s,u,h,f,m,v,b,E,_,P]},90693:(e,t,n)=>{n.d(t,{Jb:()=>i.Jb,Lp:()=>i.Lp,Ni:()=>i.Ni,R_:()=>i.R_,_r:()=>r._,aL:()=>i.aL,kK:()=>i.kK,ly:()=>i.ly,od:()=>i.od,pI:()=>i.pI,qW:()=>i.qW,wg:()=>i.wg});var r=n(58386),i=n(42798)},19820:(e,t,n)=>{n.d(t,{b:()=>l});var r=n(87901),i=n(22325),o=n(55668),s=n(82648),a=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class l extends o.wcN{constructor(e,t,n,r,i,o,s){super(s),this.itemManager=e,this.alertService=t,this.device=n,this.httpService=r,this.encryptionService=i,this.challengeService=o,this.internalEventBus=s,this.previousPasswords=[],this.payloadRequestHandlers=[],this.previousPasswords=[]}deinit(){this.itemManager=void 0,this.alertService=void 0,this.device=void 0,this.httpService=void 0,this.challengeService=void 0,this.encryptionService=void 0,this.payloadRequestHandlers.length=0,this.previousPasswords.length=0,super.deinit()}addPayloadRequestHandler(e){return this.payloadRequestHandlers.push(e),()=>{(0,r.removeFromArray)(this.payloadRequestHandlers,e)}}getExtensions(){return this.itemManager.getItems(s.ContentType.TYPES.ActionsExtension).filter((e=>!e.isListedExtension))}extensionsInContextOfItem(e){return this.getExtensions().filter((t=>t.supported_types.includes(e.content_type)||t.actionsWithContextForItem(e).length>0))}loadExtensionInContextOfItem(e,t){return a(this,void 0,void 0,(function*(){const n={content_type:t.content_type,item_uuid:t.uuid},r=yield this.httpService.getAbsolute(e.url,n).catch((e=>{console.error("Error loading extension",e)}));if(!r)return;const o=r.description||e.description,s=r.supported_types||e.supported_types,a=r.actions||[],l=new i.ActionsExtensionMutator(e,i.MutationType.UpdateUserTimestamps);l.deprecation=r.deprecation,l.description=o,l.supported_types=s,l.actions=a;const c=l.getResult();return(0,i.CreateDecryptedItemFromPayload)(c)}))}runAction(e,t){return a(this,void 0,void 0,(function*(){let n;switch(e.verb){case"render":n=yield this.handleRenderAction(e);break;case"show":n=this.handleShowAction(e);break;case"post":n=yield this.handlePostAction(e,t)}return n}))}handleRenderAction(e){return a(this,void 0,void 0,(function*(){return yield this.httpService.getAbsolute(e.url).then((e=>a(this,void 0,void 0,(function*(){const t=yield this.payloadByDecryptingResponse(e);if(t){const n=(0,i.CreateDecryptedItemFromPayload)(t);return Object.assign(Object.assign({},e),{item:n})}})))).catch((e=>{const t=e&&e.error||{message:"An issue occurred while processing this action. Please try again."};return this.alertService.alert(t.message),{error:t}}))}))}payloadByDecryptingResponse(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return a(this,void 0,void 0,(function*(){if(!e.item||e.item.deleted||null==e.item.content)return;const r=new i.EncryptedPayload(e.item);if(!r.enc_item_key)return void this.alertService.alert("This revision is missing its key and cannot be recovered.");let o=yield this.encryptionService.decryptSplitSingle({usesItemsKeyWithKeyLookup:{items:[r]}});if(!(0,i.isErrorDecryptingPayload)(o))return o;if(t&&(o=yield this.encryptionService.decryptSplitSingle({usesRootKey:{items:[r],key:t}}),!(0,i.isErrorDecryptingPayload)(o)))return o;for(const e of this.itemManager.getDisplayableItemsKeys()){const t=yield this.encryptionService.decryptSplitSingle({usesItemsKey:{items:[r],key:e}});if(!(0,i.isErrorDecryptingPayload)(t))return t}const s=e.keyParams||e.auth_params;if(!s)return void this.alertService.alert("We were unable to decrypt this revision using your current keys, and this revision is missing metadata that would allow us to try different keys to decrypt it. This can likely be fixed with some manual intervention. Please email help@standardnotes.com for assistance.");const a=this.encryptionService.createKeyParams(s);for(const t of this.previousPasswords){if(n.includes(t))continue;n.push(t);const r=yield this.encryptionService.computeRootKey(t,a);if(!r)continue;const i=yield this.payloadByDecryptingResponse(e,r,n);if(i)return i}const l=yield this.promptForLegacyPassword();return l&&!this.previousPasswords.includes(l)?(this.previousPasswords.push(l),this.payloadByDecryptingResponse(e,t)):void 0}))}promptForLegacyPassword(){return a(this,void 0,void 0,(function*(){const e=new o.tv4([new o.FEo(o.tQn.None,"Previous Password",void 0,!0)],o.Ps8.Custom,!0,"Unable to find key for revision. Please enter the account password you may have used at the time of the revision."),t=yield this.challengeService.promptForChallengeResponse(e);return null==t?void 0:t.getDefaultValue().value}))}handlePostAction(e,t){return a(this,void 0,void 0,(function*(){const n=e.access_type===i.ActionAccessType.Decrypted,r={items:[yield this.outgoingPayloadForItem(t,n)]};return this.httpService.postAbsolute(e.url,r).then((e=>e)).catch((e=>(console.error("Action error response:",e),this.alertService.alert("An issue occurred while processing this action. Please try again."),e)))}))}handleShowAction(e){return this.device.openUrl(e.url),{}}outgoingPayloadForItem(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return a(this,void 0,void 0,(function*(){const n=this.getPayloadFromRequestHandlers(e.uuid);if(n)return n;if(t)return e.payload.ejected();const r=yield this.encryptionService.encryptSplitSingle({usesItemsKeyWithKeyLookup:{items:[e.payload]}});return(0,i.CreateEncryptedBackupFileContextPayload)(r)}))}getPayloadFromRequestHandlers(e){for(const t of this.payloadRequestHandlers){const n=t(e);if(n)return n}}}},54911:(e,t,n)=>{n.d(t,{A:()=>u});var r=n(87901),i=n(55668),o=n(95658),s=n(82648),a=n(98361),l=n(52450),c=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class u extends i.wcN{constructor(e,t,n,r,i,o,s,a){super(a),this.httpService=e,this.storageService=t,this.host=n,this.inMemoryStore=r,this.crypto=i,this.sessionStorageMapper=o,this.legacySessionStorageMapper=s,this.internalEventBus=a,this.authenticating=!1,this.changing=!1,this.refreshingSession=!1,this.session=null}deinit(){this.httpService=void 0,this.storageService=void 0,this.invalidSessionObserver=void 0,this.session=null,super.deinit()}setUser(e){this.user=e}setInvalidSessionObserver(e){this.invalidSessionObserver=e}loadHost(){const e=this.storageService.getValue(i.QtK.ServerHost);return this.host=e||this.host,this.host}setHost(e){return c(this,void 0,void 0,(function*(){this.host=e,this.storageService.setValue(i.QtK.ServerHost,e)}))}getHost(){return this.host}getFilesHost(){if(!this.filesHost)throw Error("Attempting to access undefined filesHost");return this.filesHost}setSession(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.session=e,t){let t;t=e instanceof s.Session?this.sessionStorageMapper.toProjection(e):this.legacySessionStorageMapper.toProjection(e),this.storageService.setValue(i.QtK.Session,t)}}getSession(){return this.session}get apiVersion(){return"20240226"}params(e){return Object.assign(Object.assign({},e),{[o.ApiEndpointParam.ApiVersion]:this.apiVersion})}createErrorResponse(e,t,n){return{data:{error:{message:e,tag:n}},status:null!=t?t:o.HttpStatusCode.BadRequest}}errorResponseWithFallbackMessage(e,t){return e.data.error&&!e.data.error.message&&(e.data.error.message=t),e}processMetaObject(e){var t,n;e.auth&&e.auth.userUuid&&e.auth.roles&&this.notifyEvent(i.Sf$.MetaReceived,{userUuid:e.auth.userUuid,userRoles:e.auth.roles}),(null===(t=e.server)||void 0===t?void 0:t.filesServerUrl)&&(this.filesHost=null===(n=e.server)||void 0===n?void 0:n.filesServerUrl)}processSuccessResponseForMetaBody(e){e.meta&&this.processMetaObject(e.meta)}request(e){return c(this,void 0,void 0,(function*(){try{const t=yield this.httpService.runHttp(e);return(0,o.isErrorResponse)(t)?this.errorResponseWithFallbackMessage(t,e.fallbackErrorMessage):(this.processSuccessResponseForMetaBody(t),t)}catch(t){return this.errorResponseWithFallbackMessage(t,e.fallbackErrorMessage)}}))}getAccountKeyParams(e){return c(this,void 0,void 0,(function*(){const t=this.crypto.generateRandomKey(256);this.inMemoryStore.setValue(i.QtK.CodeVerifier,t);const n=this.crypto.base64URLEncode(yield this.crypto.sha256(t)),s=this.params({email:e.email,code_challenge:n});return void 0!==e.mfaCode&&(s.mfa_code=e.mfaCode),e.authenticatorResponse&&(s.authenticator_response=e.authenticatorResponse),this.request({verb:o.HttpVerb.Post,url:(0,r.joinPaths)(this.host,a.n.v2.keyParams),fallbackErrorMessage:i.VpG,params:s,authentication:this.getSessionAccessToken()})}))}signIn(e){return c(this,void 0,void 0,(function*(){if(this.authenticating)return this.createErrorResponse(i.TYJ,o.HttpStatusCode.BadRequest);this.authenticating=!0;const t=(0,r.joinPaths)(this.host,a.n.v2.signIn),n=this.params({email:e.email,password:e.serverPassword,ephemeral:e.ephemeral,code_verifier:this.inMemoryStore.getValue(i.QtK.CodeVerifier),hvm_token:e.hvmToken}),s=yield this.request({verb:o.HttpVerb.Post,url:t,params:n,fallbackErrorMessage:i.VpG});return this.authenticating=!1,this.inMemoryStore.removeValue(i.QtK.CodeVerifier),s}))}signOut(){return this.httpService.post(a.n.v1.signOut,void 0,{authentication:this.getSessionAccessToken()})}changeCredentials(e){return c(this,void 0,void 0,(function*(){if(this.changing)return this.createErrorResponse(i.WLG,o.HttpStatusCode.BadRequest);const t=this.preprocessingError();if(t)return t;this.changing=!0;const n=a.n.v1.changeCredentials(e.userUuid),r=this.params(Object.assign({current_password:e.currentServerPassword,new_password:e.newServerPassword,new_email:e.newEmail},e.newKeyParams.getPortableValue())),s=yield this.httpService.put(n,r,{authentication:this.getSessionAccessToken()});return this.changing=!1,(0,o.isErrorResponse)(s)?this.errorResponseWithFallbackMessage(s,i.Z15):(this.processSuccessResponseForMetaBody(s),s)}))}sync(e,t,n,r,s){return c(this,void 0,void 0,(function*(){const a=this.preprocessingError();if(a)return a;const l=this.getSyncHttpRequest(e,t,n,r,s),c=yield this.httpService.runHttp(l);return(0,o.isErrorResponse)(c)?(this.preprocessAuthenticatedErrorResponse(c),this.errorResponseWithFallbackMessage(c,i.gEn)):(this.processSuccessResponseForMetaBody(c),c)}))}getSyncHttpRequest(e,t,n,i,s){const l=a.n.v1.sync,c=this.params({[o.ApiEndpointParam.SyncPayloads]:e,[o.ApiEndpointParam.LastSyncToken]:t,[o.ApiEndpointParam.PaginationToken]:n,[o.ApiEndpointParam.SyncDlLimit]:i,[o.ApiEndpointParam.SharedVaultUuids]:s});return{url:(0,r.joinPaths)(this.host,l),params:c,verb:o.HttpVerb.Post,authentication:this.getSessionAccessToken()}}deprecatedRefreshSessionOnlyUsedInE2eTests(){return c(this,void 0,void 0,(function*(){const e=this.preprocessingError();if(e)return e;this.refreshingSession=!0;const t=this.session,n=this.params({access_token:t.accessToken.value,refresh_token:t.refreshToken.value}),r=yield this.httpService.post(a.n.v1.refreshSession,n).then((e=>c(this,void 0,void 0,(function*(){if((0,o.isErrorResponse)(e)||!e.data.session)return e;const t=s.SessionToken.create(e.data.session.access_token,e.data.session.access_expiration);if(t.isFailed())return null;const n=t.getValue(),r=s.SessionToken.create(e.data.session.refresh_token,e.data.session.refresh_expiration);if(r.isFailed())return null;const a=r.getValue(),l=s.Session.create(n,a,e.data.session.readonly_access);if(l.isFailed())return null;const c=l.getValue();return this.session=c,this.setSession(c),this.processSuccessResponseForMetaBody(e),yield this.notifyEventSync(i.Sf$.SessionRefreshed,{session:c}),e}))));return this.refreshingSession=!1,null===r?this.createErrorResponse(i.aXB,o.HttpStatusCode.BadRequest):(0,o.isErrorResponse)(r)?(this.preprocessAuthenticatedErrorResponse(r),this.errorResponseWithFallbackMessage(r,i.lO_)):r}))}getSessionsList(){return c(this,void 0,void 0,(function*(){const e=this.preprocessingError();if(e)return e;const t=a.n.v1.sessions,n=yield this.httpService.get(t,{},{authentication:this.getSessionAccessToken()});return(0,o.isErrorResponse)(n)?(this.preprocessAuthenticatedErrorResponse(n),this.errorResponseWithFallbackMessage(n,i.gEn)):(this.processSuccessResponseForMetaBody(n),n)}))}deleteSession(e){return c(this,void 0,void 0,(function*(){const t=this.preprocessingError();if(t)return t;const n=a.n.v1.session(e),r=yield this.httpService.delete(n,{uuid:e},{authentication:this.getSessionAccessToken()});return(0,o.isErrorResponse)(r)?(this.preprocessAuthenticatedErrorResponse(r),this.errorResponseWithFallbackMessage(r,i.gEn)):(this.processSuccessResponseForMetaBody(r),r)}))}tokenRefreshableRequest(e){return c(this,void 0,void 0,(function*(){const t=this.preprocessingError();if(t)return t;const n=yield this.httpService.runHttp(e);return(0,o.isErrorResponse)(n)?(this.preprocessAuthenticatedErrorResponse(n),this.errorResponseWithFallbackMessage(n,e.fallbackErrorMessage)):(this.processSuccessResponseForMetaBody(n),n)}))}listSettings(e){return c(this,void 0,void 0,(function*(){return yield this.tokenRefreshableRequest({verb:o.HttpVerb.Get,url:(0,r.joinPaths)(this.host,a.n.v1.settings(e)),fallbackErrorMessage:i.Zq2,authentication:this.getSessionAccessToken()})}))}updateSetting(e,t,n,s){return c(this,void 0,void 0,(function*(){const l={name:t,value:n,sensitive:s};return this.tokenRefreshableRequest({verb:o.HttpVerb.Put,url:(0,r.joinPaths)(this.host,a.n.v1.settings(e)),authentication:this.getSessionAccessToken(),fallbackErrorMessage:i.oBV,params:l})}))}getSetting(e,t){return c(this,void 0,void 0,(function*(){return yield this.tokenRefreshableRequest({verb:o.HttpVerb.Get,url:(0,r.joinPaths)(this.host,a.n.v1.setting(e,t.toLowerCase())),authentication:this.getSessionAccessToken(),fallbackErrorMessage:i.Zq2})}))}getSubscriptionSetting(e,t){return c(this,void 0,void 0,(function*(){return yield this.tokenRefreshableRequest({verb:o.HttpVerb.Get,url:(0,r.joinPaths)(this.host,a.n.v1.subscriptionSetting(e,t.toLowerCase())),authentication:this.getSessionAccessToken(),fallbackErrorMessage:i.Zq2})}))}updateSubscriptionSetting(e,t,n,s){return c(this,void 0,void 0,(function*(){const l={name:t,value:n,sensitive:s};return this.tokenRefreshableRequest({verb:o.HttpVerb.Put,url:(0,r.joinPaths)(this.host,a.n.v1.subscriptionSettings(e)),authentication:this.getSessionAccessToken(),fallbackErrorMessage:i.oBV,params:l})}))}deleteSetting(e,t){return c(this,void 0,void 0,(function*(){return this.tokenRefreshableRequest({verb:o.HttpVerb.Delete,url:(0,r.joinPaths)(this.host,a.n.v1.setting(e,t)),authentication:this.getSessionAccessToken(),fallbackErrorMessage:i.oBV})}))}downloadFeatureUrl(e){return this.request({verb:o.HttpVerb.Get,url:e,external:!0,fallbackErrorMessage:i.VpG})}getNewSubscriptionToken(){return c(this,void 0,void 0,(function*(){const e=(0,r.joinPaths)(this.host,a.n.v1.subscriptionTokens),t=yield this.request({verb:o.HttpVerb.Post,url:e,authentication:this.getSessionAccessToken(),fallbackErrorMessage:i.gQA});if(!(0,o.isErrorResponse)(t))return t.data.token}))}downloadOfflineFeaturesFromRepo(e){return c(this,void 0,void 0,(function*(){try{const t=e.repo.offlineFeaturesUrl,n=e.repo.offlineKey;if(!t||!n)throw Error("Cannot download offline repo without url and offlineKEy");const r=["api.standardnotes.com","localhost"],{hostname:s}=new URL(t);if(!r.includes(s))return new o.ClientDisplayableError("The offline features host ".concat(s," is not in the trusted allowlist."));const a=yield this.request({verb:o.HttpVerb.Get,url:t,fallbackErrorMessage:i.WZ6,customHeaders:[{key:"x-offline-token",value:n}]});if((0,o.isErrorResponse)(a))return o.ClientDisplayableError.FromNetworkError(a);const l=a.data;return{features:(null==l?void 0:l.features)||[],roles:(null==l?void 0:l.roles)||[]}}catch(e){return new o.ClientDisplayableError(i.iMd)}}))}registerForListedAccount(){return c(this,void 0,void 0,(function*(){if(!this.user)throw Error("Cannot register for Listed without user account.");return this.tokenRefreshableRequest({verb:o.HttpVerb.Post,url:(0,r.joinPaths)(this.host,a.n.v1.listedRegistration(this.user.uuid)),fallbackErrorMessage:i.EaW,authentication:this.getSessionAccessToken()})}))}createUserFileValetToken(e,t,n){var s,l,u,d,h,p;return c(this,void 0,void 0,(function*(){const c=(0,r.joinPaths)(this.host,a.n.v1.createUserFileValetToken),f={operation:t,resources:[{remoteIdentifier:e,unencryptedFileSize:n||0}]},g=yield this.tokenRefreshableRequest({verb:o.HttpVerb.Post,url:c,authentication:this.getSessionAccessToken(),fallbackErrorMessage:i.qIx,params:f});return(0,o.isErrorResponse)(g)?new o.ClientDisplayableError(null===(l=null===(s=g.data)||void 0===s?void 0:s.error)||void 0===l?void 0:l.message):(null===(u=g.data)||void 0===u?void 0:u.success)?null===(p=g.data)||void 0===p?void 0:p.valetToken:new o.ClientDisplayableError(null===(d=g.data)||void 0===d?void 0:d.reason,void 0,null===(h=g.data)||void 0===h?void 0:h.reason)}))}startUploadSession(e,t){return c(this,void 0,void 0,(function*(){const n=(0,r.joinPaths)(this.getFilesHost(),"user"===t?a.n.v1.startUploadSession:a.n.v1.startSharedVaultUploadSession);return this.tokenRefreshableRequest({verb:o.HttpVerb.Post,url:n,customHeaders:[{key:"x-valet-token",value:e}],fallbackErrorMessage:l.e.Network.Files.FailedStartUploadSession})}))}deleteFile(e,t){return c(this,void 0,void 0,(function*(){const n=(0,r.joinPaths)(this.getFilesHost(),"user"===t?a.n.v1.deleteFile:a.n.v1.deleteSharedVaultFile);return this.tokenRefreshableRequest({verb:o.HttpVerb.Delete,url:n,customHeaders:[{key:"x-valet-token",value:e}],fallbackErrorMessage:l.e.Network.Files.FailedDeleteFile})}))}uploadFileBytes(e,t,n,i){return c(this,void 0,void 0,(function*(){if(0===n)throw Error("chunkId must start with 1");const s=(0,r.joinPaths)(this.getFilesHost(),"user"===t?a.n.v1.uploadFileChunk:a.n.v1.uploadSharedVaultFileChunk),c=yield this.tokenRefreshableRequest({verb:o.HttpVerb.Post,url:s,rawBytes:i,customHeaders:[{key:"x-valet-token",value:e},{key:"x-chunk-id",value:n.toString()},{key:"Content-Type",value:"application/octet-stream"}],fallbackErrorMessage:l.e.Network.Files.FailedUploadFileChunk});return!(0,o.isErrorResponse)(c)&&c.data.success}))}closeUploadSession(e,t){return c(this,void 0,void 0,(function*(){const n=(0,r.joinPaths)(this.getFilesHost(),"user"===t?a.n.v1.closeUploadSession:a.n.v1.closeSharedVaultUploadSession),i=yield this.tokenRefreshableRequest({verb:o.HttpVerb.Post,url:n,customHeaders:[{key:"x-valet-token",value:e}],fallbackErrorMessage:l.e.Network.Files.FailedCloseUploadSession});return!(0,o.isErrorResponse)(i)&&i.data.success}))}moveFile(e){return c(this,void 0,void 0,(function*(){const t=(0,r.joinPaths)(this.getFilesHost(),a.n.v1.moveFile),n=yield this.tokenRefreshableRequest({verb:o.HttpVerb.Post,url:t,customHeaders:[{key:"x-valet-token",value:e}],fallbackErrorMessage:l.e.Network.Files.FailedCloseUploadSession});return!(0,o.isErrorResponse)(n)&&n.data.success}))}getFilesDownloadUrl(e){if("user"===e)return(0,r.joinPaths)(this.getFilesHost(),a.n.v1.downloadFileChunk);if("shared-vault"===e)return(0,r.joinPaths)(this.getFilesHost(),a.n.v1.downloadSharedVaultFileChunk);throw Error("Invalid download type")}downloadFile(e){let{file:t,chunkIndex:n,valetToken:r,ownershipType:i,contentRangeStart:s,onBytesReceived:a}=e;var u,d;return c(this,void 0,void 0,(function*(){const e=this.getFilesDownloadUrl(i),c=t.encryptedChunkSizes[n],h={verb:o.HttpVerb.Get,url:e,customHeaders:[{key:"x-valet-token",value:r},{key:"x-chunk-size",value:c.toString()},{key:"range",value:"bytes=".concat(s,"-")}],responseType:"arraybuffer"},p=yield this.tokenRefreshableRequest(Object.assign(Object.assign({},h),{fallbackErrorMessage:l.e.Network.Files.FailedDownloadFileChunk}));if((0,o.isErrorResponse)(p))return new o.ClientDisplayableError(null===(d=null===(u=p.data)||void 0===u?void 0:u.error)||void 0===d?void 0:d.message);const f=p.headers.get("content-range");if(!f)return new o.ClientDisplayableError("Could not obtain content-range header while downloading file chunk");const g=f.match(/(^[a-zA-Z][\w]*)\s+(\d+)\s?-\s?(\d+)?\s?\/?\s?(\d+|\*)?/);if(!g||5!==g.length)return new o.ClientDisplayableError("Malformed content-range header in response when downloading file chunk");const m=+g[2],y=+g[3],v=+g[4],A=new Uint8Array(p.data);return yield a(A),y<v-1?this.downloadFile({file:t,chunkIndex:++n,valetToken:r,ownershipType:i,contentRangeStart:m+c,onBytesReceived:a}):void 0}))}checkIntegrity(e){return c(this,void 0,void 0,(function*(){return this.tokenRefreshableRequest({verb:o.HttpVerb.Post,url:(0,r.joinPaths)(this.host,a.n.v1.checkIntegrity),params:{integrityPayloads:e},fallbackErrorMessage:i.oe5,authentication:this.getSessionAccessToken()})}))}getSingleItem(e){return c(this,void 0,void 0,(function*(){return this.tokenRefreshableRequest({verb:o.HttpVerb.Get,url:(0,r.joinPaths)(this.host,a.n.v1.getSingleItem(e)),fallbackErrorMessage:i.TwN,authentication:this.getSessionAccessToken()})}))}preprocessingError(){return this.refreshingSession?this.createErrorResponse(i.z6z,o.HttpStatusCode.BadRequest):this.session?void 0:this.createErrorResponse(i.aXB,o.HttpStatusCode.BadRequest)}preprocessAuthenticatedErrorResponse(e){var t,n;this.session&&(e.status!==o.HttpStatusCode.Unauthorized&&e.status!==o.HttpStatusCode.ExpiredAccessToken||null===(t=this.invalidSessionObserver)||void 0===t||t.call(this,(null===(n=e.data.error)||void 0===n?void 0:n.tag)===o.ErrorTag.RevokedSession))}getSessionAccessToken(){if(this.session)return this.session instanceof s.Session?this.session.accessToken.value:this.session.accessToken}getCaptchaUrl(){return this.httpService.get(a.n.v1.meta)}}},78734:(e,t,n)=>{n.d(t,{q:()=>c});var r=n(95658),i=n(87901),o=n(94986),s=n(55668),a=n(22325),l=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class c extends s.wcN{constructor(e,t,n){super(n),this.environment=e,this.appVersion=t,this.internalEventBus=n}getAbsolute(e,t,n){return l(this,void 0,void 0,(function*(){return this.runHttp({url:e,params:t,verb:r.HttpVerb.Get,authentication:n})}))}postAbsolute(e,t,n){return l(this,void 0,void 0,(function*(){return this.runHttp({url:e,params:t,verb:r.HttpVerb.Post,authentication:n})}))}putAbsolute(e,t,n){return l(this,void 0,void 0,(function*(){return this.runHttp({url:e,params:t,verb:r.HttpVerb.Put,authentication:n})}))}patchAbsolute(e,t,n){return l(this,void 0,void 0,(function*(){return this.runHttp({url:e,params:t,verb:r.HttpVerb.Patch,authentication:n})}))}deleteAbsolute(e,t,n){return l(this,void 0,void 0,(function*(){return this.runHttp({url:e,params:t,verb:r.HttpVerb.Delete,authentication:n})}))}runHttp(e){return l(this,void 0,void 0,(function*(){const t=this.createXmlRequest(e);return this.runRequest(t,this.createRequestBody(e))}))}createRequestBody(e){return void 0!==e.params&&[r.HttpVerb.Post,r.HttpVerb.Put,r.HttpVerb.Patch,r.HttpVerb.Delete].includes(e.verb)?JSON.stringify(e.params):e.rawBytes}createXmlRequest(e){var t;const n=new XMLHttpRequest;if(e.params&&e.verb===r.HttpVerb.Get&&Object.keys(e.params).length>0&&(e.url=this.urlForUrlAndParams(e.url,e.params)),n.open(e.verb,e.url,!0),n.responseType=null!==(t=e.responseType)&&void 0!==t?t:"",!e.external){n.setRequestHeader("X-SNJS-Version",o.in);const t="".concat(a.Environment[this.environment],"-").concat(this.appVersion);n.setRequestHeader("X-Application-Version",t),e.authentication&&n.setRequestHeader("Authorization","Bearer "+e.authentication)}let i=!1;return e.customHeaders&&e.customHeaders.length>0&&e.customHeaders.forEach((e=>{let{key:t,value:r}=e;n.setRequestHeader(t,r),"Content-Type"===t&&(i=!0)})),i||e.external||n.setRequestHeader("Content-Type","application/json"),n}runRequest(e,t){return l(this,void 0,void 0,(function*(){return new Promise(((n,r)=>{e.onreadystatechange=()=>{this.stateChangeHandlerForRequest(e,n,r)},e.send(t)}))}))}stateChangeHandlerForRequest(e,t,n){var o,a,l;if(4!==e.readyState)return;const c=e.status,u={status:c,headers:new Map},d=null===(o=e.getAllResponseHeaders())||void 0===o?void 0:o.trim().split(/[\r\n]+/);null==d||d.forEach((e=>{const t=e.split(": "),n=t.shift(),r=t.join(": ");u.headers.set(n,r)}));try{if(c!==r.DeprecatedStatusCode.HttpStatusNoContent){let t;const n=(null===(a=u.headers)||void 0===a?void 0:a.get("content-type"))||(null===(l=u.headers)||void 0===l?void 0:l.get("Content-Type"));t=(null==n?void 0:n.includes("application/json"))?JSON.parse(e.responseText):e.response,t.data||(u.data=t),(0,i.isString)(t)||Object.assign(u,t)}}catch(e){console.error(e)}if(c>=r.DeprecatedStatusCode.HttpStatusMinSuccess&&c<=r.DeprecatedStatusCode.HttpStatusMaxSuccess)t(u);else{if(c===r.DeprecatedStatusCode.HttpStatusForbidden)u.error={message:s.jN7,status:c};else if(null==u.error)if(null==u.data||null==u.data.error)try{u.error={message:e.responseText||s.I4j,status:c}}catch(e){u.error={message:s.I4j,status:c}}else u.error=u.data.error;n(u)}}urlForUrlAndParams(e,t){const n=Object.keys(t).map((e=>e+"="+encodeURIComponent(t[e]))).join("&");return e.includes("?")?e+"&"+n:e+"?"+n}}},98361:(e,t,n)=>{n.d(t,{n:()=>r});const r={v1:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},{closeUploadSession:"/v1/files/upload/close-session",createUserFileValetToken:"/v1/files/valet-tokens",deleteFile:"/v1/files",downloadFileChunk:"/v1/files",downloadVaultFileChunk:"/v1/vaults/files",startUploadSession:"/v1/files/upload/create-session",uploadFileChunk:"/v1/files/upload/chunk"}),{closeSharedVaultUploadSession:"/v1/shared-vault/files/upload/close-session",deleteSharedVaultFile:"/v1/shared-vault/files",downloadSharedVaultFileChunk:"/v1/shared-vault/files",startSharedVaultUploadSession:"/v1/shared-vault/files/upload/create-session",uploadSharedVaultFileChunk:"/v1/shared-vault/files/upload/chunk",moveFile:"/v1/shared-vault/files/move"}),{checkIntegrity:"/v1/items/check-integrity",getSingleItem:e=>"/v1/items/".concat(e),itemRevisions:e=>"/v1/items/".concat(e,"/revisions"),itemRevision:(e,t)=>"/v1/items/".concat(e,"/revisions/").concat(t),sync:"/v1/items"}),{listedRegistration:e=>"/v1/users/".concat(e,"/integrations/listed")}),{settings:e=>"/v1/users/".concat(e,"/settings"),setting:(e,t)=>"/v1/users/".concat(e,"/settings/").concat(t),subscriptionSetting:(e,t)=>"/v1/users/".concat(e,"/subscription-settings/").concat(t),subscriptionSettings:e=>"/v1/users/".concat(e,"/subscription-settings")}),{offlineFeatures:"/v1/offline/features",purchase:"/v1/purchase",subscription:e=>"/v1/users/".concat(e,"/subscription"),subscriptionTokens:"/v1/subscription-tokens"}),{changeCredentials:e=>"/v1/users/".concat(e,"/attributes/credentials"),deleteAccount:e=>"/v1/users/".concat(e),keyParams:"/v1/login-params",refreshSession:"/v1/sessions/refresh",register:"/v1/users",session:e=>"/v1/sessions/".concat(e),sessions:"/v1/sessions",signIn:"/v1/login",signOut:"/v1/logout"}),{meta:"/v1/meta"}),v2:Object.assign({},{keyParams:"/v2/login-params",signIn:"/v2/login"})}},68625:(e,t,n)=>{n.d(t,{n:()=>o});var r=n(59472),i=n(87901);class o{constructor(e,t,n,r,i,o){this.challenge=e,this.onValidValue=t,this.onInvalidValue=n,this.onNonvalidatedSubmit=r,this.onComplete=i,this.onCancel=o,this.nonvalidatedValues=[],this.validValues=[],this.invalidValues=[],this.artifacts={}}deinit(){this.challenge=void 0,this.onValidValue=void 0,this.onInvalidValue=void 0,this.onNonvalidatedSubmit=void 0,this.onComplete=void 0,this.onCancel=void 0,this.nonvalidatedValues=void 0,this.validValues=void 0,this.invalidValues=void 0,this.artifacts=void 0}complete(e){var t;e||(e=new r.a(this.challenge,this.validValues,this.artifacts)),null===(t=this.onComplete)||void 0===t||t.call(this,e)}nonvalidatedSubmit(){var e;const t=new r.a(this.challenge,this.nonvalidatedValues.slice(),this.artifacts);null===(e=this.onNonvalidatedSubmit)||void 0===e||e.call(this,t),this.nonvalidatedValues=[]}cancel(){var e;null===(e=this.onCancel)||void 0===e||e.call(this)}isFinished(){return this.validValues.length===this.challenge.prompts.length}nonvalidatedPrompts(){return this.challenge.prompts.filter((e=>!e.validates))}addNonvalidatedValue(e){const t=this.nonvalidatedValues,n=t.find((t=>t.prompt.id===e.prompt.id));n&&(0,i.removeFromArray)(t,n),t.push(e),this.nonvalidatedValues.length===this.nonvalidatedPrompts().length&&this.nonvalidatedSubmit()}setValueStatus(e,t,n){var r,o;const s=t?this.validValues:this.invalidValues,a=s.find((t=>t.prompt.validation===e.prompt.validation));a&&(0,i.removeFromArray)(s,a),s.push(e),Object.assign(this.artifacts,n),this.isFinished()?this.complete():t?null===(r=this.onValidValue)||void 0===r||r.call(this,e):null===(o=this.onInvalidValue)||void 0===o||o.call(this,e)}}},59472:(e,t,n)=>{n.d(t,{a:()=>i});var r=n(87901);class i{constructor(e,t,n){this.challenge=e,this.values=t,this.artifacts=n,Object.freeze(this)}getValueForType(e){const t=this.values.find((t=>t.prompt.validation===e));if((0,r.isNullOrUndefined)(t))throw Error("Could not find value for validation type "+e);return t}getDefaultValue(){if(this.values.length>1)throw Error("Attempting to retrieve default response value when more than one value exists");return this.values[0]}}},40278:(e,t,n)=>{n.d(t,{P:()=>c});var r=n(87901),i=n(17956),o=n(55668),s=n(68625),a=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};const l=e=>{e.onCancel=void 0,e.onComplete=void 0,e.onValidValue=void 0,e.onInvalidValue=void 0,e.onNonvalidatedSubmit=void 0};class c extends o.wcN{constructor(e,t,n){super(n),this.storageService=e,this.encryptionService=t,this.internalEventBus=n,this.challengeOperations={},this.challengeObservers={}}deinit(){this.storageService=void 0,this.encryptionService=void 0,this.sendChallenge=void 0,this.challengeOperations=void 0,this.challengeObservers=void 0,super.deinit()}promptForChallengeResponse(e){return new Promise((t=>{this.createOrGetChallengeOperation(e,t),this.sendChallenge(e)}))}createChallenge(e,t,n,r,i){return new o.tv4(e,t,n,r,i)}validateChallengeValue(e){return a(this,void 0,void 0,(function*(){switch(e.prompt.validation){case o.tQn.LocalPasscode:return this.encryptionService.validatePasscode(e.value);case o.tQn.AccountPassword:return this.encryptionService.validateAccountPassword(e.value);case o.tQn.Biometric:return{valid:!0===e.value};case o.tQn.Authenticator:return{valid:"id"in e.value};case o.tQn.ProtectionSessionDuration:return{valid:(0,i.z)(e.value)};default:throw Error("Unhandled validation mode ".concat(e.prompt.validation))}}))}promptForCorrectPasscode(e){return a(this,void 0,void 0,(function*(){const t=new o.tv4([new o.FEo(o.tQn.LocalPasscode)],e,!0),n=yield this.promptForChallengeResponse(t);if(n)return n.getValueForType(o.tQn.LocalPasscode).value}))}promptForAccountPassword(){var e;return a(this,void 0,void 0,(function*(){if(!this.encryptionService.hasAccount())throw Error("Requiring account password for challenge with no account");const t=yield this.promptForChallengeResponse(new o.tv4([new o.FEo(o.tQn.AccountPassword)],o.Ps8.Custom,!0,o.NiJ.EnterAccountPassword));return null===(e=null==t?void 0:t.getValueForType(o.tQn.AccountPassword))||void 0===e?void 0:e.value}))}getWrappingKeyIfApplicable(e){return a(this,void 0,void 0,(function*(){return this.encryptionService.hasPasscode()?e||(e=yield this.promptForCorrectPasscode(o.Ps8.ResaveRootKey))?{wrappingKey:yield this.encryptionService.computeWrappingKey(e)}:{canceled:!0}:{}}))}addChallengeObserver(e,t){const n=this.challengeObservers[e.id]||[];return n.push(t),this.challengeObservers[e.id]=n,()=>{l(t),(0,r.removeFromArray)(n,t)}}createOrGetChallengeOperation(e,t){let n=this.getChallengeOperation(e);return n||(n=new s.n(e,(t=>{this.onChallengeValidValue(e,t)}),(t=>{this.onChallengeInvalidValue(e,t)}),(n=>{this.onChallengeNonvalidatedSubmit(e,n),t(n)}),(n=>{this.onChallengeComplete(e,n),t(n)}),(()=>{this.onChallengeCancel(e),t(void 0)})),this.challengeOperations[e.id]=n),n}performOnObservers(e,t){const n=this.challengeObservers[e.id]||[];for(const e of n)t(e)}onChallengeValidValue(e,t){this.performOnObservers(e,(e=>{var n;null===(n=e.onValidValue)||void 0===n||n.call(e,t)}))}onChallengeInvalidValue(e,t){this.performOnObservers(e,(e=>{var n;null===(n=e.onInvalidValue)||void 0===n||n.call(e,t)}))}onChallengeNonvalidatedSubmit(e,t){this.performOnObservers(e,(e=>{var n;null===(n=e.onNonvalidatedSubmit)||void 0===n||n.call(e,t)}))}onChallengeComplete(e,t){this.performOnObservers(e,(e=>{var n;null===(n=e.onComplete)||void 0===n||n.call(e,t)}))}onChallengeCancel(e){this.performOnObservers(e,(e=>{var t;null===(t=e.onCancel)||void 0===t||t.call(e)}))}getChallengeOperation(e){return this.challengeOperations[e.id]}deleteChallengeOperation(e){const t=e.challenge;t.customHandler=void 0,e.deinit(),delete this.challengeOperations[t.id]}cancelChallenge(e){const t=this.challengeOperations[e.id];t.cancel(),this.deleteChallengeOperation(t)}completeChallenge(e){const t=this.challengeOperations[e.id];t.complete(),this.deleteChallengeOperation(t)}submitValuesForChallenge(e,t){return a(this,void 0,void 0,(function*(){if(0===t.length)throw Error("Attempting to submit 0 values for challenge");for(const n of t)if(n.prompt.validates){const{valid:t,artifacts:r}=yield this.validateChallengeValue(n);this.setValidationStatusForChallenge(e,n,t,r)}else this.getChallengeOperation(e).addNonvalidatedValue(n)}))}setValidationStatusForChallenge(e,t,n,r){const i=this.getChallengeOperation(e);if(i.setValueStatus(t,n,r),i.isFinished()){this.deleteChallengeOperation(i);const t=this.challengeObservers[e.id]||[];t.forEach(l),t.length=0,delete this.challengeObservers[e.id]}}}},74987:(e,t,n)=>{n.d(t,{y:()=>b});var r=n(82648),i=n(22325),o=n(80215),s=n(87901),a=n(56297),l=n(55668);const c="localhost";class u{constructor(e,t,n){this.desktopManager=e,this.environment=t,this.platform=n}execute(e){if(this.desktopManager)return this.urlForFeatureOnDesktop(e);if(e.isNativeFeature)return this.urlForNativeComponent(e.featureDescription.identifier,e.featureDescription.index_path);if(e.asComponent.offlineOnly)return;const t=e.asComponent.hosted_url||e.asComponent.legacy_url;if(!t)return e.asComponent.package_info.identifier&&e.asComponent.package_info.index_path?this.urlForNativeComponent(e.asComponent.package_info.identifier,e.asComponent.package_info.index_path):void 0;if(this.isMobile){const e=this.platform===i.Platform.Ios?c:"10.0.2.2";return t.replace(c,e).replace("sn.local",e)}return t}urlForFeatureOnDesktop(e){if(!this.desktopManager)throw new Error("Desktop manager is not defined");return e.isNativeFeature?"".concat(this.desktopManager.getExtServerHost(),"/components/").concat(e.featureIdentifier,"/").concat(e.featureDescription.index_path):e.asComponent.local_url?e.asComponent.local_url.replace("sn://",this.desktopManager.getExtServerHost()+"/"):e.asComponent.hosted_url||e.asComponent.legacy_url}urlForNativeComponent(e,t){if(this.isMobile){const n=window.location.href.split("/index.html")[0];return"".concat(n,"/web-src/components/assets/").concat(e,"/").concat(t)}{const n=window.location.origin;return"".concat(n,"/components/assets/").concat(e,"/").concat(t)}}get isMobile(){return this.environment===i.Environment.Mobile}}var d;!function(e){e.ViewerDidFocus="ViewerDidFocus"}(d||(d={}));var h=n(20549);function p(e,t){if(0===e.length)return".";let n=[],i=[];return e.forEach((e=>{switch(e.name){case o.ComponentAction.StreamItems:if(!e.content_types)return;e.content_types.forEach((e=>{const t=r.ContentType.create(e);if(t.isFailed())return;const i=t.getValue(),o=i.getDisplayName();o?n.push("".concat(o,"s")):n.push("items of type ".concat(i.value))}));break;case o.ComponentAction.StreamContextItem:{const e={[o.ComponentArea.EditorStack]:"working note",[o.ComponentArea.Editor]:"working note",[o.ComponentArea.Themes]:"Unknown"};i.push(e[t.area])}}})),n=(0,s.uniqueArray)(n),i=(0,s.uniqueArray)(i),0===n.length&&0===i.length?".":n.concat(i).join(", ")+"."}var f=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class g{constructor(e,t,n,r,i){this.permissionDialogUIHandler=e,this.alerts=t,this.mutator=n,this.sync=r,this.items=i,this.permissionDialogs=[],this.pendingErrorAlerts=new Set}deinit(){this.permissionDialogs=[],this.permissionDialogUIHandler=void 0,this.alerts=void 0,this.mutator=void 0,this.sync=void 0,this.items=void 0}execute(e,t,n){const r=this.findUIFeature(e);if(!r)return void(this.pendingErrorAlerts.has(e)||(this.pendingErrorAlerts.add(e),this.alerts.alert("Unable to find component with ID ".concat(e,". Please restart the app and try again."),"An unexpected error occurred").then((()=>{this.pendingErrorAlerts.delete(e)}))));if(r.isNativeFeature)return void n();if(!this.areRequestedPermissionsValid(r,t))return void console.error("Component is requesting invalid permissions",e,t);const i=r.acquiredPermissions;t=(0,s.Copy)(t);for(const e of t.slice()){const n=i.find((t=>t.name===e.name));if(!n)continue;const r=e.content_types;if(r){for(const e of n.content_types)(0,s.removeFromArray)(r,e);0===r.length&&(0,s.filterFromArray)(t,e)}else(0,s.filterFromArray)(t,e)}t.length>0?this.promptForPermissionsWithDeferredRendering(r.asComponent,t,(e=>f(this,void 0,void 0,(function*(){e&&n()})))):n()}setPermissionDialogUIHandler(e){this.permissionDialogUIHandler=e}areRequestedPermissionsValid(e,t){var n;for(const r of t)if(r.name===o.ComponentAction.StreamItems){if(!h.h6.includes(e.featureIdentifier))return!1;if(null===(n=r.content_types)||void 0===n?void 0:n.some((e=>!h.Jg.includes(e))))return!1}return!0}promptForPermissionsWithDeferredRendering(e,t,n){setTimeout((()=>{this.promptForPermissions(e,t,n)}))}promptForPermissions(e,t,n){const r={component:e,permissions:t,permissionsString:p(t,e),actionBlock:n,callback:n=>f(this,void 0,void 0,(function*(){const i=this.items.findItem(e.uuid);if(i){if(n){const n=(0,s.Copy)(i.permissions);for(const e of t){const t=n.find((t=>t.name===e.name));if(t){const n=t.content_types||[];t.content_types=(0,s.uniqueArray)(n.concat(e.content_types))}else n.push(e)}yield this.mutator.changeItem(e,(e=>{e.permissions=n})),this.sync.sync()}this.permissionDialogs=this.permissionDialogs.filter((i=>{return i===r?(i.actionBlock&&i.actionBlock(n),!1):!!(i.component!==e||i.permissions!==t&&(o=t,i.permissions.some((e=>!o.find((t=>JSON.stringify(t)===JSON.stringify(e)))))))||(n&&i.actionBlock&&i.actionBlock(n),!1);var o})),this.permissionDialogs.length>0&&this.permissionDialogUIHandler(this.permissionDialogs[0])}}))},i=this.permissionDialogs.find((t=>t.component===e));this.permissionDialogs.push(r),i||this.permissionDialogUIHandler(r)}findUIFeature(e){const t=(0,o.FindNativeFeature)(e);if(t)return new i.UIFeature(t);const n=this.items.findItem(e);return n?new i.UIFeature(n):void 0}}class m{constructor(e){this.items=e}execute(e){if(e.noteType===o.NoteType.Plain)return new i.UIFeature((0,o.GetPlainNoteFeature)());if(e.noteType===o.NoteType.Super)return new i.UIFeature((0,o.GetSuperNoteFeature)());if(e.editorIdentifier){const t=this.componentOrNativeFeatureForIdentifier(e.editorIdentifier);if(t)return t}if(e.noteType&&e.noteType!==o.NoteType.Unknown){const t=this.nativeEditorForNoteType(e.noteType);if(t)return new i.UIFeature(t)}const t=this.legacyGetEditorForNote(e);return t?new i.UIFeature(t):new i.UIFeature((0,o.GetPlainNoteFeature)())}componentOrNativeFeatureForIdentifier(e){const t=(0,o.FindNativeFeature)(e);if(t)return new i.UIFeature(t);const n=this.items.getDisplayableComponents().find((t=>t.identifier===e));return n?new i.UIFeature(n):void 0}nativeEditorForNoteType(e){return(0,o.GetIframeAndNativeEditors)().find((t=>t.note_type===e))}legacyGetEditorForNote(e){const t=this.thirdPartyComponentsForArea(o.ComponentArea.Editor);for(const n of t)if(n.isExplicitlyEnabledForItem(e.uuid))return n;const n=this.legacyGetDefaultEditor();return n&&!n.isExplicitlyDisabledForItem(e.uuid)?n:void 0}legacyGetDefaultEditor(){return this.thirdPartyComponentsForArea(o.ComponentArea.Editor).filter((e=>e.legacyIsDefaultEditor()))[0]}thirdPartyComponentsForArea(e){return this.items.getDisplayableComponents().filter((t=>t.area===e))}}class y{constructor(e,t){this.preferences=e,this.items=t}execute(e){var t;if(e){const n=null===(t=null==e?void 0:e.preferences)||void 0===t?void 0:t.editorIdentifier;if(n)return r.Result.ok(n)}const n=this.preferences.getValue(i.PrefKey.DefaultEditorIdentifier);if(n)return r.Result.ok(n);const s=this.thirdPartyComponentsForArea(o.ComponentArea.Editor).filter((e=>e.legacyIsDefaultEditor()))[0];return s?r.Result.ok(s.identifier):r.Result.ok(o.NativeFeatureIdentifier.TYPES.PlainEditor)}thirdPartyComponentsForArea(e){return this.items.getDisplayableComponents().filter((t=>t.area===e))}}class v{execute(e,t){if(!e||!t)return!1;const n=e.fileType,r=t.fileType;return!("md"===n||"md"===r||"html"===n&&"html"===r)}}var A=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class b extends l.wcN{constructor(e,t,n,r,i,o,s,a,c,u,h){super(h),this.items=e,this.mutator=t,this.sync=n,this.features=r,this.preferences=i,this.alerts=o,this.environment=s,this.platform=a,this.device=c,this.logger=u,this.internalEventBus=h,this.viewers=[],this.permissionDialogUIHandler=()=>{throw"Must call setPermissionDialogUIHandler"},this.runWithPermissionsUseCase=new g(this.permissionDialogUIHandler,this.alerts,this.mutator,this.sync,this.items),this.detectFocusChange=()=>{const e=Array.from(document.getElementsByTagName("iframe"));for(const t of e)if(document.activeElement===t)return void setTimeout((()=>{const e=this.findComponentViewer(t.dataset.componentViewerId);this.notifyEvent(d.ViewerDidFocus,{componentViewer:e})}))},this.onWindowMessage=e=>{var t;const n=e.data;n.sessionKey&&(this.logger.info("Component manager received message",n),null===(t=this.componentViewerForSessionKey(n.sessionKey))||void 0===t||t.handleMessage(n))},this.loggingEnabled=!1,this.addSyncedComponentItemObserver(),this.registerMobileNativeComponentUrls(),this.registerDeprecatedEditorUrlsForAndroid(),this.eventDisposers.push(i.addEventObserver((e=>{e===l.WZd.PreferencesChanged&&this.postActiveThemesToAllViewers()}))),window.addEventListener?window.addEventListener("focus",this.detectFocusChange,!0):window.attachEvent("onfocusout",this.detectFocusChange),window.addEventListener?window.addEventListener("blur",this.detectFocusChange,!0):window.attachEvent("onblur",this.detectFocusChange),window.addEventListener("message",this.onWindowMessage,!0)}deinit(){super.deinit();for(const e of this.viewers)e.destroy();this.viewers.length=0,this.runWithPermissionsUseCase.deinit(),this.desktopManager=void 0,this.items=void 0,this.features=void 0,this.sync=void 0,this.alerts=void 0,this.preferences=void 0,this.permissionDialogUIHandler=void 0,window&&(window.removeEventListener("focus",this.detectFocusChange,!0),window.removeEventListener("blur",this.detectFocusChange,!0),window.removeEventListener("message",this.onWindowMessage,!0)),this.detectFocusChange=void 0,this.onWindowMessage=void 0}setPermissionDialogUIHandler(e){this.permissionDialogUIHandler=e,this.runWithPermissionsUseCase.setPermissionDialogUIHandler(e)}thirdPartyComponentsForArea(e){return this.items.getDisplayableComponents().filter((t=>t.area===e))}createComponentViewer(e,t,n){var r;const i=new a.S(e,{items:this.items,mutator:this.mutator,sync:this.sync,alerts:this.alerts,preferences:this.preferences,features:this.features,logger:this.logger},{url:null!==(r=this.urlForFeature(e))&&void 0!==r?r:"",item:t,actionObserver:n},{environment:this.environment,platform:this.platform,componentManagerFunctions:{runWithPermissionsUseCase:this.runWithPermissionsUseCase,urlsForActiveThemes:this.urlsForActiveThemes.bind(this),setComponentPreferences:this.setComponentPreferences.bind(this),getComponentPreferences:this.getComponentPreferences.bind(this)}});return this.viewers.push(i),i}destroyComponentViewer(e){e.destroy(),(0,s.removeFromArray)(this.viewers,e)}setDesktopManager(e){this.desktopManager=e,this.configureForDesktop()}handleChangedComponents(e,t){const n=[i.PayloadEmitSource.LocalChanged,i.PayloadEmitSource.RemoteRetrieved,i.PayloadEmitSource.LocalDatabaseLoaded,i.PayloadEmitSource.LocalInserted];if(0!==e.length&&n.includes(t)){if(this.desktopManager){const t=e.filter((e=>!(0,o.FindNativeFeature)(e.identifier)));t.length>0&&this.desktopManager.syncComponentsInstallation(t)}e.filter((e=>e.isTheme())).length>0&&this.postActiveThemesToAllViewers()}}addSyncedComponentItemObserver(){this.eventDisposers.push(this.items.addObserver([r.ContentType.TYPES.Component,r.ContentType.TYPES.Theme],(e=>{let{changed:t,inserted:n,removed:r,source:i}=e;const o=[...t,...n];this.handleChangedComponents(o,i),this.updateMobileRegisteredComponentUrls(n,r)})))}updateMobileRegisteredComponentUrls(e,t){if((0,l.s2G)(this.device)){for(const t of e){const e=new i.UIFeature(t),n=this.urlForFeature(e);n&&this.device.registerComponentUrl(t.uuid,n)}for(const e of t)this.device.deregisterComponentUrl(e.uuid)}}registerMobileNativeComponentUrls(){if(!(0,l.s2G)(this.device))return;const e=[...(0,o.GetIframeEditors)(),...(0,o.GetNativeThemes)()];for(const t of e){const e=new i.UIFeature(t),n=this.urlForFeature(e);n&&this.device.registerComponentUrl(e.uniqueIdentifier.value,n)}}registerDeprecatedEditorUrlsForAndroid(){if(!(0,l.s2G)(this.device))return;const e=[...(0,o.GetDeprecatedEditors)()];for(const t of e){const e=new i.UIFeature(t),n=this.urlForFeature(e);n&&this.device.registerComponentUrl(e.uniqueIdentifier.value,n)}}configureForDesktop(){if(!this.desktopManager)throw new Error("Desktop manager is not defined");this.desktopManager.registerUpdateObserver((e=>{this.getActiveComponents().find((t=>t.uuid===e.uuid))&&e.isTheme()&&this.postActiveThemesToAllViewers()}))}postActiveThemesToAllViewers(){for(const e of this.viewers)e.postActiveThemes()}urlForFeature(e){return new u(this.desktopManager,this.environment,this.platform).execute(e)}urlsForActiveThemes(){const e=this.getActiveThemes(),t=[];for(const n of e){const e=this.urlForFeature(n);e&&t.push(e)}return t}findComponentViewer(e){return this.viewers.find((t=>t.identifier===e))}findComponentWithPackageIdentifier(e){return this.items.getDisplayableComponents().find((t=>t.identifier===e))}componentViewerForSessionKey(e){return this.viewers.find((t=>t.sessionKey===e))}toggleOtherNonLayerableThemes(e){const t=this.getActiveThemes();for(const n of t)n.featureIdentifier!==e.featureIdentifier&&(n.layerable||this.removeActiveTheme(n))}toggleTheme(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return A(this,void 0,void 0,(function*(){if(this.logger.info("Toggling theme",e.uniqueIdentifier),this.isThemeActive(e))return void this.removeActiveTheme(e);const n=this.features.getFeatureStatus(e.uniqueIdentifier);(t||n===l.iKc.Entitled)&&(this.addActiveTheme(e),e.layerable||(yield(0,s.sleep)(10),this.toggleOtherNonLayerableThemes(e)))}))}getActiveThemes(){const{features:e,uuids:t}=this.getActiveThemesIdentifiers();return[...t.map((e=>{const t=this.items.findItem(e.value);if(t)return new i.UIFeature(t)})).filter(s.isNotUndefined),...e.map((e=>(0,o.FindNativeTheme)(e.value))).filter(s.isNotUndefined).map((e=>new i.UIFeature(e)))].filter((e=>this.features.getFeatureStatus(e.uniqueIdentifier)===l.iKc.Entitled))}getActiveThemesIdentifiers(){const e=[],t=[],n=new Set(this.preferences.getLocalValue(l.dH$.ActiveThemes,[]));for(const i of n){const n=o.NativeFeatureIdentifier.create(i);n.isFailed()||e.push(n.getValue());const s=r.Uuid.create(i);s.isFailed()||t.push(s.getValue())}return{features:e,uuids:t}}toggleComponent(e){return A(this,void 0,void 0,(function*(){this.logger.info("Toggling component",e.uuid),this.isComponentActive(e)?yield this.removeActiveComponent(e):yield this.addActiveComponent(e)}))}editorForNote(e){return new m(this.items).execute(e)}getDefaultEditorIdentifier(e){return new y(this.preferences,this.items).execute(e).getValue()}doesEditorChangeRequireAlert(e,t){return(new v).execute(e,t)}showEditorChangeAlert(){return A(this,void 0,void 0,(function*(){return yield this.alerts.confirm("Doing so might result in minor formatting changes.","Are you sure you want to change this note's type?","Yes, change it")}))}setComponentPreferences(e,t){var n;return A(this,void 0,void 0,(function*(){const r=(0,s.Copy)(null!==(n=this.preferences.getValue(i.PrefKey.ComponentPreferences,void 0))&&void 0!==n?n:{});r[e.uniqueIdentifier.value]=t,yield this.preferences.setValue(i.PrefKey.ComponentPreferences,r)}))}getComponentPreferences(e){const t=this.preferences.getValue(i.PrefKey.ComponentPreferences,void 0);if(t)return t[e.uniqueIdentifier.value]}addActiveTheme(e){const t=this.preferences.getLocalValue(l.dH$.ActiveThemes,[]).slice();t.push(e.uniqueIdentifier.value),this.preferences.setLocalValue(l.dH$.ActiveThemes,t)}replaceActiveTheme(e){this.preferences.setLocalValue(l.dH$.ActiveThemes,[e.uniqueIdentifier.value])}removeActiveTheme(e){const t=this.preferences.getLocalValue(l.dH$.ActiveThemes,[]).filter((t=>t!==e.uniqueIdentifier.value));this.preferences.setLocalValue(l.dH$.ActiveThemes,t)}isThemeActive(e){return this.features.getFeatureStatus(e.uniqueIdentifier)===l.iKc.Entitled&&this.preferences.getLocalValue(l.dH$.ActiveThemes,[]).includes(e.uniqueIdentifier.value)}addActiveComponent(e){return A(this,void 0,void 0,(function*(){const t=this.preferences.getValue(i.PrefKey.ActiveComponents,[]).slice();t.push(e.uuid),yield this.preferences.setValue(i.PrefKey.ActiveComponents,t)}))}removeActiveComponent(e){var t;return A(this,void 0,void 0,(function*(){const n=(null!==(t=this.preferences.getValue(i.PrefKey.ActiveComponents,void 0))&&void 0!==t?t:[]).filter((t=>t!==e.uuid));yield this.preferences.setValue(i.PrefKey.ActiveComponents,n)}))}getActiveComponents(){var e;const t=null!==(e=this.preferences.getValue(i.PrefKey.ActiveComponents,void 0))&&void 0!==e?e:[];return this.items.findItems(t)}isComponentActive(e){var t;return(null!==(t=this.preferences.getValue(i.PrefKey.ActiveComponents,void 0))&&void 0!==t?t:[]).includes(e.uuid)}}},56297:(e,t,n)=>{n.d(t,{S:()=>d});var r=n(55668),i=n(22325),o=n(2256),s=n(20549),a=n(80215),l=n(87901),c=n(82648),u=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class d{constructor(e,t,n,o){this.componentOrFeature=e,this.services=t,this.options=n,this.config=o,this.identifier=(0,l.nonSecureRandomIdentifier)(),this.actionObservers=[],this.eventObservers=[],this.dealloced=!1,this.readonly=!1,this.lockReadonly=!1,(0,r.qr4)(n.item)&&(this.setReadonly(!0),this.lockReadonly=!0),this.removeItemObserver=this.services.items.addObserver(c.ContentType.TYPES.Any,(e=>{let{changed:t,inserted:n,removed:r,source:i,sourceKey:o}=e;if(this.dealloced)return;const s=[...t,...n,...r];this.handleChangesInItems(s,i,o)})),n.actionObserver&&this.actionObservers.push(n.actionObserver),this.removeFeaturesObserver=t.features.addEventObserver((e=>{this.dealloced||e===r.Usi.FeaturesAvailabilityChanged&&(this.postActiveThemes(),this.notifyEventObservers(i.ComponentViewerEvent.FeatureStatusUpdated))})),this.services.logger.info("Constructor",this)}getComponentOrFeatureItem(){return this.componentOrFeature}get url(){return this.options.url}get isDesktop(){return this.config.environment===i.Environment.Desktop}get isMobile(){return this.config.environment===i.Environment.Mobile}destroy(){this.services.logger.info("Destroying",this),this.deinit()}deinit(){this.dealloced=!0,this.componentOrFeature=void 0,this.services=void 0,this.config=void 0,this.options=void 0,this.eventObservers.length=0,this.actionObservers.length=0,this.removeFeaturesObserver(),this.removeFeaturesObserver=void 0,this.removeItemObserver(),this.removeItemObserver=void 0}addEventObserver(e){this.eventObservers.push(e);const t=this.eventObservers;return()=>{(0,l.removeFromArray)(t,e)}}notifyEventObservers(e){for(const t of this.eventObservers)t(e)}addActionObserver(e){this.actionObservers.push(e);const t=this.actionObservers;return()=>{(0,l.removeFromArray)(t,e)}}setReadonly(e){if(this.lockReadonly)throw Error("Attempting to set readonly on lockedReadonly component viewer");this.readonly=e}get componentUniqueIdentifier(){return this.componentOrFeature.uniqueIdentifier}getFeatureStatus(){return this.services.features.getFeatureStatus(this.componentUniqueIdentifier,{inContextOfItem:this.getContextItem()})}getContextItem(){return(0,r.qr4)(this.options.item)?this.options.item.readonlyItem:this.services.items.findItem(this.options.item.uuid)}isOfflineRestricted(){return this.componentOrFeature.isComponent&&this.componentOrFeature.asComponent.offlineOnly&&!this.isDesktop}hasUrlError(){return!(!this.componentOrFeature.isComponent||this.isDesktop&&this.componentOrFeature.asComponent.local_url||this.componentOrFeature.asComponent.hasValidHostedUrl)}shouldRender(){return null==this.getError()}getError(){return this.isOfflineRestricted()?r.kQg.OfflineRestricted:this.hasUrlError()?r.kQg.MissingUrl:void 0}updateOurComponentRefFromChangedItems(e){if(!this.componentOrFeature.isComponent)return;const t=e.find((e=>e.uuid===this.componentUniqueIdentifier.value));if(!t)return;const n=new i.UIFeature(t);this.componentOrFeature=n}handleChangesInItems(e,t,n){const o=e.filter(i.isNotEncryptedItem),s=o.filter(i.isDecryptedItem);if(this.updateOurComponentRefFromChangedItems(s),!n||n!==this.componentUniqueIdentifier.value){if(this.streamItems){const e=o.filter((e=>{var t;return null===(t=this.streamItems)||void 0===t?void 0:t.includes(e.content_type)}));e.length>0&&this.sendManyItemsThroughBridge(e)}if(this.streamContextItemOriginalMessage){const e=this.options.item;if((0,r.qr4)(e))return;const n=s.find((t=>t.uuid===e.uuid));n&&this.sendContextItemThroughBridge(n,t)}}}sendManyItemsThroughBridge(e){var t;const n=[{name:a.ComponentAction.StreamItems,content_types:null===(t=this.streamItems)||void 0===t?void 0:t.sort()}];this.config.componentManagerFunctions.runWithPermissionsUseCase.execute(this.componentUniqueIdentifier.value,n,(()=>{this.sendItemsInReply(e,this.streamItemsOriginalMessage)}))}sendContextItemThroughBridge(e,t){const n=[{name:a.ComponentAction.StreamContextItem}];this.config.componentManagerFunctions.runWithPermissionsUseCase.execute(this.componentUniqueIdentifier.value,n,(()=>{this.services.logger.info("Send context item in reply","component:",this.componentOrFeature,"item: ",e,"originalMessage: ",this.streamContextItemOriginalMessage);const n={item:this.jsonForItem(e,t)};this.replyToMessage(this.streamContextItemOriginalMessage,n)}))}sendItemsInReply(e,t,n){this.services.logger.info("Send items in reply",this.componentOrFeature,e,t);const r={},i=e.map((e=>this.jsonForItem(e,n)));r.items=i,this.replyToMessage(t,r)}jsonForItem(e,t){const n=t===i.PayloadEmitSource.RemoteSaved||t===i.PayloadEmitSource.OfflineSyncSaved||t===i.PayloadEmitSource.PreSyncSave,r={uuid:e.uuid,content_type:e.content_type,created_at:e.created_at,updated_at:e.serverUpdatedAt,isMetadataUpdate:n};return(0,i.isDecryptedItem)(e)?(r.content=this.contentForItem(e),r.clientData=this.getClientData(e)):r.deleted=!0,this.responseItemsByRemovingPrivateProperties([r])[0]}getClientData(e){return(e.getDomainData(i.ComponentDataDomain)||{})[this.componentUniqueIdentifier.value]||{}}contentForItem(e){if((0,i.isNote)(e)){const t=e.content,n=null!=e.spellcheck?e.spellcheck:this.services.preferences.getValue(i.PrefKey.EditorSpellcheck,!0);return Object.assign(Object.assign({},t),{spellcheck:n})}return e.content}replyToMessage(e,t){const n={action:a.ComponentAction.Reply,original:e,data:t};this.sendMessage(n)}sendMessage(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.window||e.action!==a.ComponentAction.Reply?(this.services.logger.info("Send message to component",this.componentOrFeature,"message: ",e),this.window?this.window.postMessage(this.isMobile?JSON.stringify(e):e,"*"):t&&this.services.alerts.alert("Standard Notes is trying to communicate with ".concat(this.componentOrFeature.displayName,", ")+"but an error is occurring. Please restart this extension and try again.")):this.services.logger.info("Component has been deallocated in between message send and reply",this.componentOrFeature,e)}responseItemsByRemovingPrivateProperties(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=["autoupdateDisabled","permissions","active"];return t&&(n=n.concat(["hosted_url","local_url"])),e.map((e=>{const r=n.slice();if(t&&r.push("url"),!e.content||(0,l.isString)(e.content))return e;let i={};for(const[t,n]of Object.entries(e.content))r.includes(t)||(i=Object.assign(Object.assign({},i),{[t]:n}));return Object.assign(Object.assign({},e),{content:i})}))}setWindow(e){var t;if(this.window)throw Error("Attempting to override component viewer window. Create a new component viewer instead.");this.services.logger.info("setWindow","component: ",this.componentOrFeature,"window: ",e),this.window=e,this.sessionKey=l.UuidGenerator.GenerateUuid();const n=null!==(t=this.config.componentManagerFunctions.getComponentPreferences(this.componentOrFeature))&&void 0!==t?t:{};this.sendMessage({action:a.ComponentAction.ComponentRegistered,sessionKey:this.sessionKey,componentData:n,data:{uuid:this.componentUniqueIdentifier.value,environment:(0,o.g)(this.config.environment),platform:(0,o._e)(this.config.platform),activeThemeUrls:this.config.componentManagerFunctions.urlsForActiveThemes()}}),this.services.logger.info("setWindow got new sessionKey",this.sessionKey),this.postActiveThemes()}postActiveThemes(){const e={themes:this.config.componentManagerFunctions.urlsForActiveThemes()},t={action:a.ComponentAction.ActivateThemes,data:e};this.sendMessage(t,!1)}handleMessage(e){if(this.services.logger.info("Handle message",e,this),!this.componentOrFeature)return this.services.logger.info("Component not defined for message, returning",e),void this.services.alerts.alert("A component is trying to communicate with Standard Notes, but there is an error establishing a bridge. Please restart the app and try again.");if(this.readonly&&s.wJ.includes(e.action))return void this.services.alerts.alert("".concat(this.componentOrFeature.displayName," is trying to save, but it is in a locked state and cannot accept changes."));const t={[a.ComponentAction.StreamItems]:this.handleStreamItemsMessage.bind(this),[a.ComponentAction.StreamContextItem]:this.handleStreamContextItemMessage.bind(this),[a.ComponentAction.SetComponentData]:this.handleSetComponentPreferencesMessage.bind(this),[a.ComponentAction.DeleteItems]:this.handleDeleteItemsMessage.bind(this),[a.ComponentAction.CreateItems]:this.handleCreateItemsMessage.bind(this),[a.ComponentAction.CreateItem]:this.handleCreateItemsMessage.bind(this),[a.ComponentAction.SaveItems]:this.handleSaveItemsMessage.bind(this),[a.ComponentAction.SetSize]:this.handleSetSizeEvent.bind(this)}[e.action];null==t||t(e);for(const t of this.actionObservers)t(e.action,e.data)}handleStreamItemsMessage(e){const t=e.data.content_types.filter((e=>s.Jg.includes(e))).sort(),n=[{name:a.ComponentAction.StreamItems,content_types:t}];this.config.componentManagerFunctions.runWithPermissionsUseCase.execute(this.componentUniqueIdentifier.value,n,(()=>{this.streamItems||(this.streamItems=t,this.streamItemsOriginalMessage=e);const n=[];for(const e of t)(0,l.extendArray)(n,this.services.items.getItems(e));this.sendItemsInReply(n,e)}))}handleStreamContextItemMessage(e){const t=[{name:a.ComponentAction.StreamContextItem}];this.config.componentManagerFunctions.runWithPermissionsUseCase.execute(this.componentUniqueIdentifier.value,t,(()=>{this.streamContextItemOriginalMessage||(this.streamContextItemOriginalMessage=e);const t=(0,r.qr4)(this.options.item)?this.options.item.readonlyItem:this.services.items.findItem(this.options.item.uuid);t&&this.sendContextItemThroughBridge(t)}))}handleSaveItemsMessage(e){let t=e.data.items;const n=[],o=t.slice();if(!(0,r.qr4)(this.options.item)){for(const e of t.slice())if(e.uuid===this.options.item.uuid){n.push({name:a.ComponentAction.StreamContextItem}),(0,l.removeFromArray)(o,e);break}if(o.length>0){const e=(0,l.uniqueArray)(o.map((e=>e.content_type))).sort();n.push({name:a.ComponentAction.StreamItems,content_types:e})}this.config.componentManagerFunctions.runWithPermissionsUseCase.execute(this.componentUniqueIdentifier.value,n,(()=>u(this,void 0,void 0,(function*(){t=this.responseItemsByRemovingPrivateProperties(t,!0);const n=(0,l.Uuids)(t),r=this.services.items.findItemsIncludingBlanks(n);let o=0,s=0;for(const e of r)e&&e.locked&&(t=t.filter((t=>t.uuid!==e.uuid)),o++,e.content_type===c.ContentType.TYPES.Note&&s++);if(1===s)return void this.services.alerts.alert("The note you are attempting to save has editing disabled","Note has Editing Disabled");if(o>0){const e=1===o?"item":s===o?"notes":"items",t=1===o?"has":"have";return void this.services.alerts.alert("".concat(o," ").concat(e," you are attempting to save ").concat(t," editing disabled."),"Items have Editing Disabled")}const a=t.map((e=>(0,i.CreateComponentRetrievedContextPayload)(e)));for(const e of a){const t=this.services.items.findItem(e.uuid);if(t){if(e.content_type!==t.content_type)throw Error("Extension is trying to modify content type of item.")}else{const t=new i.DecryptedPayload(Object.assign(Object.assign({},(0,i.PayloadTimestampDefaults)()),e)),n=(0,i.CreateDecryptedItemFromPayload)(t);yield this.services.mutator.insertItem(n)}}yield this.services.mutator.changeItems(r.filter(l.isNotUndefined),(e=>{const n=(0,l.sureSearchArray)(a,{uuid:e.getUuid()});e.setCustomContent(n.content);const r=(0,l.sureSearchArray)(t,{uuid:e.getUuid()});if(r.clientData){const t=(0,l.Copy)(e.getItem().getDomainData(i.ComponentDataDomain)||{});t[this.componentUniqueIdentifier.value]=r.clientData,e.setDomainData(t,i.ComponentDataDomain)}}),i.MutationType.UpdateUserTimestamps,i.PayloadEmitSource.ComponentRetrieved,this.componentUniqueIdentifier.value),this.services.sync.sync({onPresyncSave:()=>{this.replyToMessage(e,{})}}).catch((()=>{this.replyToMessage(e,{error:"save-error"})}))}))))}}handleCreateItemsMessage(e){let t=e.data.item?[e.data.item]:e.data.items;const n=(0,l.uniqueArray)(t.map((e=>e.content_type))),r=[{name:a.ComponentAction.StreamItems,content_types:n}];this.config.componentManagerFunctions.runWithPermissionsUseCase.execute(this.componentUniqueIdentifier.value,r,(()=>u(this,void 0,void 0,(function*(){t=this.responseItemsByRemovingPrivateProperties(t);const n=[];for(const e of t){e.uuid||(e.uuid=l.UuidGenerator.GenerateUuid());const t=(0,i.createComponentCreatedContextPayload)(e),r=new i.DecryptedPayload(Object.assign(Object.assign({},(0,i.PayloadTimestampDefaults)()),t)),o=(0,i.CreateDecryptedItemFromPayload)(r),s=yield this.services.mutator.insertItem(o);yield this.services.mutator.changeItem(s,(t=>{if(e.clientData){const n=(0,l.Copy)(s.getDomainData(i.ComponentDataDomain)||{});n[this.componentUniqueIdentifier.value]=e.clientData,t.setDomainData(n,i.ComponentDataDomain)}}),i.MutationType.UpdateUserTimestamps,i.PayloadEmitSource.ComponentCreated,this.componentUniqueIdentifier.value),n.push(s)}this.services.sync.sync();const r=e.action===a.ComponentAction.CreateItem?{item:this.jsonForItem(n[0])}:{items:n.map((e=>this.jsonForItem(e)))};this.replyToMessage(e,r)}))))}handleDeleteItemsMessage(e){const t=e.data.items.filter((e=>s.Jg.includes(e.content_type))),n=(0,l.uniqueArray)(t.map((e=>e.content_type))).sort(),r=[{name:a.ComponentAction.StreamItems,content_types:n}];this.config.componentManagerFunctions.runWithPermissionsUseCase.execute(this.componentUniqueIdentifier.value,r,(()=>u(this,void 0,void 0,(function*(){const n=t,r=1===n.length?"item":"items";let o=null;if(yield this.services.alerts.confirm("Are you sure you want to delete ".concat(n.length," ").concat(r,"?"))){for(const e of n){const t=this.services.items.findItem(e.uuid);t?yield this.services.mutator.setItemToBeDeleted(t,i.PayloadEmitSource.ComponentRetrieved):this.services.alerts.alert("The item you are trying to delete cannot be found.")}this.services.sync.sync(),o={deleted:!0}}else o={deleted:!1};this.replyToMessage(e,o)}))))}handleSetComponentPreferencesMessage(e){this.config.componentManagerFunctions.runWithPermissionsUseCase.execute(this.componentUniqueIdentifier.value,[],(()=>u(this,void 0,void 0,(function*(){const t=e.data.componentData;t&&(yield this.config.componentManagerFunctions.setComponentPreferences(this.componentOrFeature,t))}))))}handleSetSizeEvent(e){var t;if(this.componentOrFeature.area!==a.ComponentArea.EditorStack)return;const n=null===(t=this.getIframe())||void 0===t?void 0:t.parentElement;if(!n)return;const r=e.data,i=(0,l.isString)(r.width)?r.width:"".concat(r.width,"px"),o=(0,l.isString)(r.height)?r.height:"".concat(r.height,"px");n&&n.setAttribute("style","width:".concat(i,"; height:").concat(o,";"))}getIframe(){return Array.from(document.getElementsByTagName("iframe")).find((e=>e.dataset.componentViewerId===this.identifier))}}},20549:(e,t,n)=>{n.d(t,{Jg:()=>a,h6:()=>s,wJ:()=>o});var r=n(80215),i=n(82648);const o=[r.ComponentAction.SaveItems,r.ComponentAction.CreateItem,r.ComponentAction.CreateItems,r.ComponentAction.DeleteItems,r.ComponentAction.SetComponentData],s=Object.freeze([r.NativeFeatureIdentifier.TYPES.LegacyFileSafeIdentifier,r.NativeFeatureIdentifier.TYPES.DeprecatedFileSafe,r.NativeFeatureIdentifier.TYPES.DeprecatedBoldEditor]),a=Object.freeze([i.ContentType.TYPES.FilesafeCredentials,i.ContentType.TYPES.FilesafeFileMetadata,i.ContentType.TYPES.FilesafeIntegration])},6314:(e,t,n)=>{n.d(t,{k:()=>p});var r=n(82648);class i{constructor(e,t){this.mutator=e,this.settings=t}execute(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return t=this,n=void 0,o=function*(){for(const t of e){if(t.migratedToUserSetting)continue;if(!t.onlineUrl)continue;const e=t.onlineUrl.match(/\w{32,64}/);if(e&&e.length>0){const n=e[0];yield this.settings.updateSetting(r.SettingName.create(r.SettingName.NAMES.ExtensionKey).getValue(),n,!0),yield this.mutator.changeFeatureRepo(t,(e=>{e.migratedToUserSetting=!0}))}}},new((i=void 0)||(i=Promise))((function(e,r){function s(e){try{l(o.next(e))}catch(e){r(e)}}function a(e){try{l(o.throw(e))}catch(e){r(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(t,n||[])).next())}));var t,n,i,o}}var o=n(87901),s=n(95658),a=n(80215),l=n(22325),c=n(55668);class u{constructor(e){this.mutator=e,this.LEGACY_PROD_EXT_ORIGIN="https://extensions.standardnotes.org"}execute(e){return t=this,n=void 0,i=function*(){const t=[];for(const n of e.featureRepos){if(n.migratedToOfflineEntitlements)continue;if(!n.onlineUrl)continue;const r=n.onlineUrl,{origin:i}=new URL(r);if(!i.includes(this.LEGACY_PROD_EXT_ORIGIN))continue;const o=r.match(/\w{32,64}/);if(o&&o.length>0){const r=o[0],i=yield this.mutator.changeFeatureRepo(n,(t=>{t.offlineFeaturesUrl=e.prodOfflineFeaturesUrl,t.offlineKey=r,t.migratedToOfflineEntitlements=!0}));t.push(i)}}return t},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class d{constructor(e){this.items=e}execute(e){if(this.isFreeFeature(e.featureId))return c.iKc.Entitled;const t=this.findNativeFeature(e.featureId);return t?t.deprecated?this.getDeprecatedNativeFeatureStatus({nativeFeature:t,hasPaidAnyPartyOnlineOrOfflineSubscription:e.hasPaidAnyPartyOnlineOrOfflineSubscription}):this.getNativeFeatureFeatureStatus({nativeFeature:t,firstPartyOnlineSubscription:e.firstPartyOnlineSubscription,firstPartyRoles:e.firstPartyRoles,inContextOfItem:e.inContextOfItem}):this.getThirdPartyFeatureStatus(e.featureId)}findNativeFeature(e){return(0,a.FindNativeFeature)(e.value)}getDeprecatedNativeFeatureStatus(e){return e.hasPaidAnyPartyOnlineOrOfflineSubscription?c.iKc.Entitled:c.iKc.NoUserSubscription}getNativeFeatureFeatureStatus(e){if(e.inContextOfItem&&void 0!==e.inContextOfItem.shared_vault_uuid)return c.iKc.Entitled;if(!e.firstPartyOnlineSubscription&&!e.firstPartyRoles)return c.iKc.NoUserSubscription;const t=e.firstPartyRoles?"online"in e.firstPartyRoles?e.firstPartyRoles.online:e.firstPartyRoles.offline:void 0;return e.nativeFeature.availableInRoles&&t&&!t.some((t=>{var n;return null===(n=e.nativeFeature.availableInRoles)||void 0===n?void 0:n.includes(t)}))?c.iKc.NotInCurrentPlan:e.firstPartyOnlineSubscription&&new Date((0,o.convertTimestampToMilliseconds)(e.firstPartyOnlineSubscription.endsAt))<new Date?c.iKc.InCurrentPlanButExpired:c.iKc.Entitled}getThirdPartyFeatureStatus(e){const t=this.items.getDisplayableComponents().find((t=>t.uuid===e.value));return t?t.isExpired?c.iKc.InCurrentPlanButExpired:c.iKc.Entitled:c.iKc.NoUserSubscription}isFreeFeature(e){return[a.NativeFeatureIdentifier.TYPES.DarkTheme,a.NativeFeatureIdentifier.TYPES.PlainEditor,a.NativeFeatureIdentifier.TYPES.ProtonTheme].includes(e.value)}}var h=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class p extends c.wcN{constructor(e,t,n,i,o,s,a,u,p,f,g,m,y,v,A){super(A),this.storage=e,this.items=t,this.mutator=n,this.subscriptions=i,this.api=o,this.settings=a,this.user=u,this.sync=p,this.alerts=f,this.sessions=g,this.crypto=m,this.logger=y,this.isApplicationUsingThirdPartyHostUseCase=v,this.internalEventBus=A,this.onlineRoles=[],this.offlineRoles=[],this.enabledExperimentalFeatures=[],this.getFeatureStatusUseCase=new d(this.items),this.PROD_OFFLINE_FEATURES_URL="https://api.standardnotes.com/v1/offline/features",this.eventDisposers.push(s.addEventObserver(((e,t)=>h(this,void 0,void 0,(function*(){if(e===c.fAX.UserRoleMessageReceived){const e=t.payload.currentRoles;this.updateOnlineRolesWithNewValues(e)}}))))),this.eventDisposers.push(i.addEventObserver((e=>{e===c.lKe.DidFetchSubscription&&this.notifyEvent(c.Usi.FeaturesAvailabilityChanged)}))),this.eventDisposers.push(this.items.addObserver(r.ContentType.TYPES.ExtensionRepo,(e=>{let{changed:t,inserted:n,source:r}=e;return h(this,void 0,void 0,(function*(){if([l.PayloadEmitSource.InitialObserverRegistrationPush,l.PayloadEmitSource.LocalInserted,l.PayloadEmitSource.LocalDatabaseLoaded,l.PayloadEmitSource.RemoteRetrieved,l.PayloadEmitSource.FileImport].includes(r)){const e=[...t,...n];this.sessions.isSignedIntoFirstPartyServer()?this.migrateFeatureRepoToUserSetting(e):this.migrateFeatureRepoToOfflineEntitlements(e)}}))}))),this.eventDisposers.push(this.user.addEventObserver((e=>{if(e===c.oF7.SignedInOrRegistered){const e=this.items.getItems(r.ContentType.TYPES.ExtensionRepo),t=this.isApplicationUsingThirdPartyHostUseCase.execute();if(t.isFailed())return;t.getValue()||this.migrateFeatureRepoToUserSetting(e)}})))}initializeFromDisk(){this.onlineRoles=this.storage.getValue(c.QtK.UserRoles,void 0,[]),this.offlineRoles=this.storage.getValue(c.QtK.OfflineUserRoles,void 0,[]),this.enabledExperimentalFeatures=this.storage.getValue(c.QtK.ExperimentalFeatures,void 0,[])}handleEvent(e){return h(this,void 0,void 0,(function*(){switch(e.type){case c.Sf$.MetaReceived:{if(!this.sync)return void this.logger.warn("Handling events interrupted. Sync service is not yet initialized.",e);const{userRoles:t}=e.payload;this.updateOnlineRolesWithNewValues(t.map((e=>e.name)));break}case c.n9K.ApplicationStageChanged:switch(e.payload.stage){case c.Ugm.StorageDecrypted_09:this.initializeFromDisk();break;case c.Ugm.FullSyncCompleted_13:if(!this.hasFirstPartyOnlineSubscription()){const e=this.getOfflineRepo();e&&this.downloadOfflineRoles(e)}}}}))}enableExperimentalFeature(e){this.enabledExperimentalFeatures.push(e),this.storage.setValue(c.QtK.ExperimentalFeatures,this.enabledExperimentalFeatures),this.notifyEvent(c.Usi.FeaturesAvailabilityChanged)}disableExperimentalFeature(e){(0,o.removeFromArray)(this.enabledExperimentalFeatures,e),this.storage.setValue(c.QtK.ExperimentalFeatures,this.enabledExperimentalFeatures);const t=this.items.getItems([r.ContentType.TYPES.Component,r.ContentType.TYPES.Theme]).find((t=>t.identifier===e));t&&(this.mutator.setItemToBeDeleted(t).then((()=>{this.sync.sync()})),this.notifyEvent(c.Usi.FeaturesAvailabilityChanged))}toggleExperimentalFeature(e){this.isExperimentalFeatureEnabled(e)?this.disableExperimentalFeature(e):this.enableExperimentalFeature(e)}getExperimentalFeatures(){return a.ExperimentalFeatures}isExperimentalFeature(e){return this.getExperimentalFeatures().includes(e)}getEnabledExperimentalFeatures(){return this.enabledExperimentalFeatures}isExperimentalFeatureEnabled(e){return this.enabledExperimentalFeatures.includes(e)}setOfflineFeaturesCode(e){return h(this,void 0,void 0,(function*(){try{const t=this.parseOfflineEntitlementsCode(e);if(t instanceof s.ClientDisplayableError)return t;const n=yield this.mutator.createItem(r.ContentType.TYPES.ExtensionRepo,(0,l.FillItemContent)({offlineFeaturesUrl:t.featuresUrl,offlineKey:t.extensionKey,migratedToOfflineEntitlements:!0}),!0);return this.sync.sync(),this.downloadOfflineRoles(n)}catch(e){return new s.ClientDisplayableError("".concat(c.iMd,", ").concat(JSON.stringify(e)))}}))}getOfflineRepo(){return this.items.getItems(r.ContentType.TYPES.ExtensionRepo).filter((e=>e.migratedToOfflineEntitlements))[0]}hasOfflineRepo(){return null!=this.getOfflineRepo()}deleteOfflineFeatureRepo(){return h(this,void 0,void 0,(function*(){const e=this.getOfflineRepo();e&&(yield this.mutator.setItemToBeDeleted(e),this.sync.sync())}))}parseOfflineEntitlementsCode(e){try{const t=e.replace(/\s/g,""),n=this.crypto.base64Decode(t),{featuresUrl:r,extensionKey:i,subscriptionId:o}=JSON.parse(n);return{featuresUrl:r,extensionKey:i,subscriptionId:o}}catch(e){return new s.ClientDisplayableError(c.iMd)}}downloadOfflineRoles(e){return h(this,void 0,void 0,(function*(){const t=yield this.api.downloadOfflineFeaturesFromRepo({repo:e});if(t instanceof s.ClientDisplayableError)return t;this.setOfflineRoles(t.roles)}))}migrateFeatureRepoToUserSetting(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return h(this,void 0,void 0,(function*(){const t=new i(this.mutator,this.settings);yield t.execute(e)}))}migrateFeatureRepoToOfflineEntitlements(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return h(this,void 0,void 0,(function*(){const t=new u(this.mutator),n=yield t.execute({featureRepos:e,prodOfflineFeaturesUrl:this.PROD_OFFLINE_FEATURES_URL});n.length>0&&(yield this.downloadOfflineRoles(n[0]));for(const t of e)yield this.downloadOfflineRoles(t)}))}hasPaidAnyPartyOnlineOrOfflineSubscription(){return this.onlineRolesIncludePaidSubscription()||this.hasOfflineRepo()||this.hasFirstPartyOnlineSubscription()}hasFirstPartyOnlineSubscription(){return this.sessions.isSignedIntoFirstPartyServer()&&this.subscriptions.hasOnlineSubscription()}hasFirstPartyOfflineSubscription(){const e=this.getOfflineRepo();return!(!e||!e.content.offlineFeaturesUrl||e.content.offlineFeaturesUrl!==this.PROD_OFFLINE_FEATURES_URL&&"localhost"!==new URL(e.content.offlineFeaturesUrl).hostname)}updateOnlineRolesWithNewValues(e){return h(this,void 0,void 0,(function*(){const t=this.onlineRoles;if((e.some((e=>!this.onlineRoles.includes(e)))||this.onlineRoles.some((t=>!e.includes(t))))&&(this.setOnlineRoles(e),0!==t.length)){const n=e.filter((e=>!t.includes(e)));this.rolesIncludePaidSubscription(n)&&(yield this.notifyEvent(c.Usi.DidPurchaseSubscription))}}))}setOnlineRoles(e){const t=!(0,o.arraysEqual)(this.onlineRoles,e);this.onlineRoles=e,t&&this.notifyEvent(c.Usi.UserRolesChanged),this.storage.setValue(c.QtK.UserRoles,this.onlineRoles)}setOfflineRoles(e){const t=!(0,o.arraysEqual)(this.offlineRoles,e);this.offlineRoles=e,t&&this.notifyEvent(c.Usi.UserRolesChanged),this.storage.setValue(c.QtK.OfflineUserRoles,this.offlineRoles)}isThirdPartyFeature(e){return!(0,a.FindNativeFeature)(e)}rolesIncludePaidSubscription(e){const t=[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser];return e.some((e=>t.includes(e)))}onlineRolesIncludePaidSubscription(){return this.rolesIncludePaidSubscription(this.onlineRoles)}rolesBySorting(e){return Object.values(r.RoleName.NAMES).filter((t=>e.includes(t)))}hasRole(e){return this.onlineRoles.includes(e.value)||this.offlineRoles.includes(e.value)}hasMinimumRole(e){const t=Object.values(r.RoleName.NAMES),n=this.rolesBySorting(this.hasFirstPartyOnlineSubscription()?this.onlineRoles:this.offlineRoles),i=t.indexOf((0,o.lastElement)(n));return t.indexOf(e)<=i}getFeatureStatus(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.getFeatureStatusUseCase.execute({featureId:e,firstPartyRoles:this.hasFirstPartyOnlineSubscription()?{online:this.onlineRoles}:this.hasFirstPartyOfflineSubscription()?{offline:this.offlineRoles}:void 0,hasPaidAnyPartyOnlineOrOfflineSubscription:this.hasPaidAnyPartyOnlineOrOfflineSubscription(),firstPartyOnlineSubscription:this.hasFirstPartyOnlineSubscription()?this.subscriptions.getOnlineSubscription():void 0,inContextOfItem:t.inContextOfItem})}deinit(){super.deinit(),this.onlineRoles=void 0,this.offlineRoles=void 0,this.storage=void 0,this.items=void 0,this.mutator=void 0,this.api=void 0,this.subscriptions=void 0,this.settings=void 0,this.user=void 0,this.sync=void 0,this.alerts=void 0,this.sessions=void 0,this.crypto=void 0}}},29675:(e,t,n)=>{n.d(t,{E:()=>a});var r=n(87901),i=n(22325),o=n(55668),s=n(82648);class a extends o.wcN{constructor(e,t,n,r){super(r),this.itemManager=e,this.storageService=t,this.deviceInterface=n,this.internalEventBus=r,this.historyStaging={},this.history={},this.itemRevisionThreshold=20,this.removeChangeObserver=this.itemManager.addObserver(s.ContentType.TYPES.Note,(e=>{let{changed:t,inserted:n}=e;this.recordNewHistoryForItems(t.concat(n))}))}deinit(){this.itemManager=void 0,this.storageService=void 0,this.history=void 0,this.removeChangeObserver&&(this.removeChangeObserver(),this.removeChangeObserver=void 0),super.deinit()}recordNewHistoryForItems(e){for(const t of e){const e=this.history[t.uuid]||[],n=i.historyMapFunctions.getNewestRevision(e),r=new i.DecryptedPayload(t.payload),o=i.CreateHistoryEntryForPayload(r,n);if(o.isDiscardable())continue;const s=this.historyStaging[t.uuid];this.historyStaging[t.uuid]=o,s&&(s.isSameAsEntry(o)||n&&s.isSameAsEntry(n)||(e.unshift(s),this.history[t.uuid]=e,this.optimizeHistoryForItem(t.uuid)))}}sessionHistoryForItem(e){return this.history[e.uuid]||[]}getHistoryMapCopy(){const e=Object.assign({},this.history);for(const[t,n]of Object.entries(e))e[t]=n.slice();return Object.freeze(e)}optimizeHistoryForItem(e){const t=this.history[e]||[];if(t.length<=this.itemRevisionThreshold)return;const n=e=>e.deltaSize()>25,i=[],o=(e,o,s)=>{if(s){if(i.unshift(e),n(e)&&-1===e.operationVector()){const e=t[o+1];e&&i.unshift(e)}}else(0,r.removeFromArray)(i,e)};for(let e=t.length-1;e>=0;e--){const r=t[e];o(r,e,0===e||e===t.length-1||n(r))}const s=t.filter((e=>i.includes(e)));this.history[e]=s}}},45447:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(87901),i=n(38529),o=n(22325),s=n(55668),a=n(82648);class l extends s.wcN{constructor(e,t){super(t),this.payloadManager=e,this.internalEventBus=t,this.observers=[],this.streamDisposers=[],this.payloadManager=e,this.systemSmartViews=this.rebuildSystemSmartViews({}),this.createCollection(),this.unsubChangeObserver=this.payloadManager.addObserver(a.ContentType.TYPES.Any,this.setPayloads.bind(this))}rebuildSystemSmartViews(e){return this.systemSmartViews=o.BuildSmartViews(e),this.systemSmartViews}getCollection(){return this.collection}createCollection(){var e;this.collection=new o.ItemCollection,this.navigationDisplayController=new o.ItemDisplayController(this.collection,[a.ContentType.TYPES.Note,a.ContentType.TYPES.File],{sortBy:"created_at",sortDirection:"dsc",hiddenContentTypes:[]}),this.tagDisplayController=new o.ItemDisplayController(this.collection,[a.ContentType.TYPES.Tag],{sortBy:"title",sortDirection:"asc"}),this.itemsKeyDisplayController=new o.ItemDisplayController(this.collection,[a.ContentType.TYPES.ItemsKey],{sortBy:"created_at",sortDirection:"asc"}),this.componentDisplayController=new o.ItemDisplayController(this.collection,[a.ContentType.TYPES.Component],{sortBy:"created_at",sortDirection:"asc"}),this.themeDisplayController=new o.ItemDisplayController(this.collection,[a.ContentType.TYPES.Theme],{sortBy:"title",sortDirection:"asc"}),this.smartViewDisplayController=new o.ItemDisplayController(this.collection,[a.ContentType.TYPES.SmartView],{sortBy:"title",sortDirection:"asc"}),this.fileDisplayController=new o.ItemDisplayController(this.collection,[a.ContentType.TYPES.File],{sortBy:"title",sortDirection:"asc"}),this.itemCounter=new o.ItemCounter(this.collection,null===(e=this.itemCounter)||void 0===e?void 0:e.observers)}get allDisplayControllers(){return[this.navigationDisplayController,this.tagDisplayController,this.itemsKeyDisplayController,this.componentDisplayController,this.themeDisplayController,this.smartViewDisplayController,this.fileDisplayController]}get invalidItems(){return this.collection.invalidElements()}get invalidNonVaultedItems(){return this.invalidItems.filter((e=>!e.key_system_identifier))}createItemFromPayload(e){return o.CreateDecryptedItemFromPayload(e)}createPayloadFromObject(e){return new o.DecryptedPayload(e)}setPrimaryItemDisplayOptions(e){var t,n;const r={},i=[];e.views&&e.views.find((e=>e.uuid===o.SystemViewId.AllNotes))&&(void 0===e.includeArchived&&(r.includeArchived=!1),void 0===e.includeTrashed&&(r.includeTrashed=!1)),e.views&&e.views.find((e=>e.uuid===o.SystemViewId.ArchivedNotes))&&void 0===e.includeTrashed&&(r.includeTrashed=!1),e.views&&e.views.find((e=>e.uuid===o.SystemViewId.TrashedNotes))&&(e.includeArchived||(r.includeArchived=!0)),e.views&&e.views.find((e=>e.uuid===o.SystemViewId.Conflicts))&&i.push((e=>this.collection.conflictsOf(e.uuid).length>0)),this.rebuildSystemSmartViews(Object.assign(Object.assign({},e),r));const s=null===(t=e.tags)||void 0===t?void 0:t.map((e=>this.collection.find(e.uuid))).filter((e=>null!=e)),l=null===(n=e.views)||void 0===n?void 0:n.map((e=>o.isSystemView(e)?this.systemSmartViews.find((t=>t.uuid===e.uuid)):this.collection.find(e.uuid))).filter((e=>null!=e)),c=Object.assign(Object.assign(Object.assign({},e),r),{tags:s,views:l,hiddenContentTypes:[a.ContentType.TYPES.Tag]});c.sortBy===o.CollectionSort.Title&&(c.sortDirection="asc"===c.sortDirection?"dsc":"asc"),this.navigationDisplayController.setDisplayOptions(Object.assign({customFilter:o.computeUnifiedFilterForDisplayOptions(c,this.collection,i)},c)),this.itemCounter.setDisplayOptions(c)}setTagsAndViewsDisplayOptions(e){const t=Object.assign({customFilter:o.computeUnifiedFilterForDisplayOptions(e,this.collection)},e);this.tagDisplayController.setDisplayOptions(t),this.smartViewDisplayController.setDisplayOptions(t)}setVaultDisplayOptions(e){this.navigationDisplayController.setVaultDisplayOptions(e),this.tagDisplayController.setVaultDisplayOptions(e),this.smartViewDisplayController.setVaultDisplayOptions(e),this.fileDisplayController.setVaultDisplayOptions(e),this.itemCounter.setVaultDisplayOptions(e)}getDisplayableNotes(){return(0,r.assert)(2===this.navigationDisplayController.contentTypes.length),this.navigationDisplayController.items().filter(o.isNote)}getDisplayableFiles(){return this.fileDisplayController.items()}getDisplayableNotesAndFiles(){return this.navigationDisplayController.items()}getDisplayableTags(){return this.tagDisplayController.items()}getDisplayableItemsKeys(){return this.itemsKeyDisplayController.items()}getDisplayableComponents(){return[...this.componentDisplayController.items(),...this.themeDisplayController.items()]}deinit(){this.unsubChangeObserver(),this.streamDisposers.length=0,this.unsubChangeObserver=void 0,this.payloadManager=void 0,this.collection=void 0,this.itemCounter=void 0,this.tagDisplayController=void 0,this.navigationDisplayController=void 0,this.itemsKeyDisplayController=void 0,this.componentDisplayController=void 0,this.themeDisplayController=void 0,this.fileDisplayController=void 0,this.smartViewDisplayController=void 0}resetState(){this.createCollection()}findItem(e){return this.collection.findDecrypted(e)||this.findSystemSmartView(e)}findAnyItem(e){return this.collection.find(e)||this.findSystemSmartView(e)}findAnyItems(e){return this.collection.findAll(e)}findSystemSmartView(e){return this.systemSmartViews.find((t=>t.uuid===e))}findSureItem(e){return this.findItem(e)}findItems(e){return this.collection.findAllDecrypted(e)}findItemsIncludingBlanks(e){return this.collection.findAllDecryptedWithBlanks(e)}get items(){return this.collection.nondeletedElements().filter(o.isDecryptedItem)}allTrackedItems(){return this.collection.all()}hasTagsNeedingFoldersMigration(){return i.l.isApplicableToCurrentData(this)}addNoteCountChangeObserver(e){return this.itemCounter.addCountChangeObserver(e)}allCountableNotesCount(){return this.itemCounter.allCountableNotesCount()}allCountableFilesCount(){return this.itemCounter.allCountableFilesCount()}countableNotesForTag(e){if(e instanceof o.SmartView){if(e.uuid===o.SystemViewId.AllNotes)return this.itemCounter.allCountableNotesCount();throw Error("countableItemsForTag is not meant to be used for smart views.")}return this.itemCounter.countableItemsForTag(e)}getNoteCount(){return this.noteCount}addObserver(e,t){Array.isArray(e)||(e=[e]);const n={contentType:e,callback:t};this.observers.push(n);const i=this.observers;return()=>{(0,r.removeFromArray)(i,n)}}itemsReferencingItem(e,t){const n=this.collection.uuidsThatReferenceUuid(e.uuid);let r=this.findItems(n);return t&&(r=r.filter((e=>(null==e?void 0:e.content_type)===t))),r}referencesForItem(e,t){const n=this.findSureItem(e.uuid).references.map((e=>e.uuid));let r=this.findItems(n);return t&&(r=r.filter((e=>(null==e?void 0:e.content_type)===t))),r}setPayloads(e){const{changed:t,inserted:n,discarded:r,ignored:i,unerrored:s,source:a,sourceKey:l}=e,c=e=>o.CreateItemFromPayload(e),u=new Set,d={changed:t.map((e=>(u.add(e.content_type),c(e)))),inserted:n.map((e=>(u.add(e.content_type),c(e)))),discarded:r.map((e=>(u.add(e.content_type),new o.DeletedItem(e)))),ignored:i.map((e=>(u.add(e.content_type),new o.EncryptedItem(e)))),unerrored:s.map((e=>(u.add(e.content_type),o.CreateDecryptedItemFromPayload(e))))};this.collection.onChange(d),this.itemCounter.onChange(d);const h=Array.from(u.values());for(const e of this.allDisplayControllers)e.contentTypes.some((e=>h.includes(e)))&&e.onCollectionChange(d);this.notifyObserversByUiAdjustingDelta(d,a,l)}notifyObserversByUiAdjustingDelta(e,t,n){const r=[],i=[],s=[],a=[],l=[];for(const t of e.changed)o.isDeletedItem(t)?s.push(t):o.isDecryptedItem(t)?r.push(t):l.push(t);for(const t of e.inserted)o.isDeletedItem(t)?a.push(t):o.isDecryptedItem(t)&&i.push(t);const c=[...e.discarded,...s,...a,...l];this.notifyObservers(r,i,c,e.ignored,e.unerrored,t,n)}notifyObservers(e,t,n,r,i,o,s){const l=(e,t)=>e.filter((e=>t.includes(a.ContentType.TYPES.Any)||t.includes(e.content_type))),c=this.observers.slice();for(const a of c){const c=l(e,a.contentType),u=l(t,a.contentType),d=l(n,a.contentType),h=l(r,a.contentType),p=l(i,a.contentType);0===c.length&&0===u.length&&0===d.length&&0===h.length&&0===p.length||a.callback({changed:c,inserted:u,removed:d,ignored:h,unerrored:p,source:o,sourceKey:s})}}getDirtyItems(){return this.collection.dirtyElements().filter(o.isDecryptedOrDeletedItem)}createTemplateItem(e,t,n){const i=new o.DecryptedPayload(Object.assign(Object.assign({uuid:r.UuidGenerator.GenerateUuid(),content_type:e,content:o.FillItemContent(t||{})},o.PayloadTimestampDefaults()),n));return o.CreateDecryptedItemFromPayload(i)}isTemplateItem(e){return!this.findItem(e.uuid)}getItems(e){return this.collection.allDecrypted(e)}getAnyItems(e){return this.collection.all(e)}itemsMatchingPredicate(e,t){return this.itemsMatchingPredicates(e,[t])}itemsMatchingPredicates(e,t){const n=this.getItems(e);return this.subItemsMatchingPredicates(n,t)}subItemsMatchingPredicates(e,t){return e.filter((e=>{for(const n of t)if(!e.satisfiesPredicate(n))return!1;return!0}))}getRootTags(){return this.getDisplayableTags().filter((e=>void 0===e.parentId))}findTagByTitle(e){const t=e.toLowerCase();return this.getDisplayableTags().find((e=>{var n;return(null===(n=e.title)||void 0===n?void 0:n.toLowerCase())===t}))}findTagByTitleAndParent(e,t){const n=e.toLowerCase();return(t?this.getTagChildren(t):this.getRootTags()).find((e=>{var t;return(null===(t=e.title)||void 0===t?void 0:t.toLowerCase())===n}))}searchTags(e,t){return(0,r.naturalSort)(this.getDisplayableTags().filter((n=>{const r=this.getTagLongTitle(n).toLowerCase().includes(e.toLowerCase()),i=!!t&&this.itemsReferencingItem(t).some((e=>(null==e?void 0:e.uuid)===n.uuid));return r&&!i})),"title")}getTagParent(e){const t=this.findItem(e.uuid);if(!t)return;const n=t.parentId;return n?this.findItem(n):void 0}getDisplayableTagParent(e){const t=this.findItem(e.uuid);if(!t)return;const n=t.parentId;return n?this.tagDisplayController.items().find((e=>e.uuid===n)):void 0}getTagPrefixTitle(e){const t=this.getTagParentChain(e);if(0===t.length)return;const n=t.map((e=>e.title)).join("/");return"".concat(n,"/")}getTagLongTitle(e){return[...this.getTagParentChain(e),e].map((e=>e.title)).join("/")}getTagParentChain(e){const t=this.findItem(e.uuid);if(!t)return[];let n=t.parentId;const r=[];for(;n;){const e=this.findItem(n);if(!e)return r;r.unshift(e),n=e.parentId}return r}getTagChildren(e){const t=this.findItem(e.uuid);return t?this.collection.elementsReferencingElement(t,a.ContentType.TYPES.Tag).filter((t=>t.parentId===e.uuid)):[]}getDeepTagChildren(e){const t=[],n=this.getTagChildren(e);for(const e of n)t.push(e),t.push(...this.getDeepTagChildren(e));return t}isTagAncestor(e,t){const n=this.findItem(t.uuid);if(!n)return!1;let r=n.parentId;for(;r;){if(r===e.uuid)return!0;const t=this.findItem(r);if(!t)return!1;r=t.parentId}return!1}isValidTagParent(e,t){return e.uuid!==t.uuid&&!this.isTagAncestor(t,e)}getSortedTagsForItem(e){return(0,r.naturalSort)(this.itemsReferencingItem(e).filter((e=>(null==e?void 0:e.content_type)===a.ContentType.TYPES.Tag)),"title")}getUnsortedTagsForItem(e){return this.itemsReferencingItem(e).filter((e=>(null==e?void 0:e.content_type)===a.ContentType.TYPES.Tag))}isSmartViewTitle(e){return e.startsWith(o.SMART_TAG_DSL_PREFIX)}notesMatchingSmartView(e){const t={views:[e]};return o.notesAndFilesMatchingOptions(t,this.collection.allDecrypted(a.ContentType.TYPES.Note),this.collection)}get allNotesSmartView(){return this.systemSmartViews.find((e=>e.uuid===o.SystemViewId.AllNotes))}get archivedSmartView(){return this.systemSmartViews.find((e=>e.uuid===o.SystemViewId.ArchivedNotes))}get trashSmartView(){return this.systemSmartViews.find((e=>e.uuid===o.SystemViewId.TrashedNotes))}get untaggedNotesSmartView(){return this.systemSmartViews.find((e=>e.uuid===o.SystemViewId.UntaggedNotes))}get trashedItems(){return this.notesMatchingSmartView(this.trashSmartView)}getSmartViews(){const e=this.smartViewDisplayController.items();return this.systemSmartViews.concat(e)}get noteCount(){return this.collection.all(a.ContentType.TYPES.Note).length}removeAllItemsFromMemory(){return e=this,t=void 0,i=function*(){const e=(0,r.Uuids)(this.items),t=[];for(const n of e){const e=new o.DeleteItemMutator(this.findSureItem(n),o.MutationType.NonDirtying);t.push(e.getDeletedResult())}yield this.payloadManager.emitPayloads(t,o.PayloadEmitSource.LocalChanged),this.resetState(),this.payloadManager.resetState()},new((n=void 0)||(n=Promise))((function(r,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}));var e,t,n,i}removeItemFromMemory(e){this.removeItemsFromMemory([e])}removeItemsFromMemory(e){this.collection.discard(e),this.payloadManager.removePayloadLocally(e.map((e=>e.payload)));const t=o.CreateItemDelta({discarded:e}),n=e.map((e=>e.content_type));for(const e of this.allDisplayControllers)e.contentTypes.some((e=>n.includes(e)))&&e.onCollectionChange(t)}relationshipDirectionBetweenItems(e,t){const n=!!e.references.find((e=>e.uuid===t.uuid)),r=!!t.references.find((t=>t.uuid===e.uuid));return n?s.uMm.AReferencesB:r?s.uMm.BReferencesA:s.uMm.NoRelationship}conflictsOf(e){return this.collection.conflictsOf(e)}numberOfNotesWithConflicts(){const e=this.collection.uuidsOfItemsWithConflicts();return(this.navigationDisplayController.hasExclusiveVaultOptions()?this.navigationDisplayController.items().filter((e=>o.isNote(e)&&this.collection.uuidsOfItemsWithConflicts().includes(e.uuid))):this.findItems(e).filter(o.isNote)).length}getItemLinkedFiles(e){return e.content_type===a.ContentType.TYPES.File?this.referencesForItem(e).filter(o.isFile):this.itemsReferencingItem(e).filter(o.isFile)}getItemLinkedNotes(e){return this.referencesForItem(e).filter(o.isNote)}streamItems(e,t){const n=this.addObserver(e,(e=>{let{changed:n,inserted:r,removed:i,source:o}=e;t({changed:n,inserted:r,removed:i,source:o})})),i=this.getItems(e);return t({inserted:i,changed:[],removed:[],source:o.PayloadEmitSource.InitialObserverRegistrationPush}),this.streamDisposers.push(n),()=>{n(),(0,r.removeFromArray)(this.streamDisposers,n)}}}},80738:(e,t,n)=>{n.d(t,{D:()=>g});var r=n(87901),i=n(20875);function o(e,t){return(0,i.leftVersionGreaterThanOrEqualToRight)(e.version,t.version)}var s=n(55668),a=n(82648);class l{constructor(e,t,n,r,i,o){this.queueItem=e,this.itemManager=t,this.encryptionService=n,this.challengeService=r,this.clientParams=i,this.serverParams=o}run(){return e=this,t=void 0,i=function*(){let e=!1;if(this.serverParams&&this.clientParams&&!this.clientParams.compare(this.serverParams)&&this.queueItem.keyParams.compare(this.serverParams)&&o(this.serverParams,this.clientParams)){const t=(0,r.dateSorted)(this.itemManager.getItems(a.ContentType.TYPES.ItemsKey),"created_at",!1)[0];e=!t||this.queueItem.encryptedKey.created_at>t.created_at}const t=yield(0,s.zW4)(this.queueItem.encryptedKey,this.encryptionService,this.challengeService,this.queueItem.keyParams);return"aborted"===t?{aborted:!0}:"failed"===t?{aborted:!1}:{rootKey:t.rootKey,replaceLocalRootKeyWithResult:e,decryptedItemsKey:t.decryptedKey}},new((n=void 0)||(n=Promise))((function(r,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}));var e,t,n,i}}var c,u=n(86999),d=n(22325),h=n(95658);function p(e){return"rootKey"in e}!function(e){e.KeysRecovered="KeysRecovered"}(c||(c={}));var f=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class g extends s.wcN{constructor(e,t,n,r,i,o,s,l,c,u){super(u),this.itemManager=e,this.payloadManager=t,this.apiService=n,this.encryptionService=r,this.challengeService=i,this.alertService=o,this.storageService=s,this.sync=l,this.userService=c,this.internalEventBus=u,this.decryptionQueue=[],this.isProcessingQueue=!1,this.removeItemObserver=this.payloadManager.addObserver([a.ContentType.TYPES.ItemsKey],(e=>{let{changed:t,inserted:n,ignored:r,source:i}=e;if(i===d.PayloadEmitSource.LocalChanged)return;const o=t.concat(n).filter(d.isErrorDecryptingPayload);o.length>0&&this.handleUndecryptableItemsKeys(o),r.length>0&&this.handleIgnoredItemsKeys(r)}))}deinit(){this.itemManager=void 0,this.payloadManager=void 0,this.apiService=void 0,this.encryptionService=void 0,this.challengeService=void 0,this.alertService=void 0,this.storageService=void 0,this.sync=void 0,this.userService=void 0,this.removeItemObserver(),this.removeItemObserver=void 0,super.deinit()}handleEvent(e){return f(this,void 0,void 0,(function*(){e.type===s.n9K.ApplicationStageChanged&&e.payload.stage===s.Ugm.LoadedDatabase_12&&this.processPersistedUndecryptables()}))}handleIgnoredItemsKeys(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return f(this,void 0,void 0,(function*(){t&&this.saveToUndecryptables(e),this.addKeysToQueue(e),yield this.beginKeyRecovery()}))}handleUndecryptableItemsKeys(e){return f(this,void 0,void 0,(function*(){this.addKeysToQueue(e),yield this.beginKeyRecovery()}))}presentKeyRecoveryWizard(){const e=this.itemManager.invalidItems.filter((e=>e.content_type===a.ContentType.TYPES.ItemsKey)).map((e=>e.payload));this.handleIgnoredItemsKeys(e,!1)}canAttemptDecryptionOfItem(e){if((0,d.ContentTypeUsesRootKeyEncryption)(e.content_type))return!0;const t=e.payload.items_key_id;return t?!!this.payloadManager.findOne(t)||new h.ClientDisplayableError("Unable to find key ".concat(t," for this item. You may try signing out and back in; if that doesn't help, check your backup files for a key with this ID and import it.")):new h.ClientDisplayableError("This item cannot be recovered.")}processPersistedUndecryptables(){return f(this,void 0,void 0,(function*(){const e=this.getUndecryptables(),t=Object.values(e);if(0===t.length)return;const n=t.map((e=>new d.EncryptedPayload(e)));return this.handleIgnoredItemsKeys(n,!1)}))}getUndecryptables(){return this.storageService.getValue(s.QtK.KeyRecoveryUndecryptableItems,s.qt7.Default,{})}persistUndecryptables(e){this.storageService.setValue(s.QtK.KeyRecoveryUndecryptableItems,e)}saveToUndecryptables(e){const t=this.getUndecryptables();for(const n of e)t[n.uuid]=n.ejected();this.persistUndecryptables(t)}removeFromUndecryptables(e){const t=this.getUndecryptables();for(const n of e)delete t[n];this.persistUndecryptables(t)}getClientKeyParams(){return this.encryptionService.getAccountKeyParams()}performServerSignIn(){return f(this,void 0,void 0,(function*(){const e=new s.tv4([new s.FEo(s.tQn.None,void 0,void 0,!0)],s.Ps8.Custom,!0,u.fD.KeyRecoveryLoginFlowReason),t=yield this.challengeService.promptForChallengeResponse(e);if(!t)return;this.challengeService.completeChallenge(e);const n=t.values[0].value,r=this.getClientKeyParams(),i=yield this.getLatestKeyParamsFromServer(r.identifier);if(!i||!o(i,r))return;const a=yield this.encryptionService.computeRootKey(n,i),l=yield this.userService.correctiveSignIn(a);return(0,h.isErrorResponse)(l)?(yield this.alertService.alert(u.fD.KeyRecoveryLoginFlowInvalidPassword),this.performServerSignIn()):(this.alertService.alert(u.fD.KeyRecoveryRootKeyReplaced),a)}))}getWrappingKeyIfApplicable(){return f(this,void 0,void 0,(function*(){if(!this.encryptionService.hasPasscode())return;const{wrappingKey:e,canceled:t}=yield this.challengeService.getWrappingKeyIfApplicable();return t?(yield this.alertService.alert(u.fD.KeyRecoveryPasscodeRequiredText,u.fD.KeyRecoveryPasscodeRequiredTitle),this.getWrappingKeyIfApplicable()):e}))}addKeysToQueue(e){for(const t of e){const e=this.encryptionService.getKeyEmbeddedKeyParamsFromItemsKey(t);if(!e)continue;const n={encryptedKey:t,keyParams:e};this.decryptionQueue.push(n)}}readdQueueItem(e){this.decryptionQueue.unshift(e)}getLatestKeyParamsFromServer(e){return f(this,void 0,void 0,(function*(){const t=yield this.apiService.getAccountKeyParams({email:e});return(0,h.isErrorResponse)(t)?void 0:(0,u.LW)(t.data)}))}beginKeyRecovery(){return f(this,void 0,void 0,(function*(){if(this.isProcessingQueue)return;this.isProcessingQueue=!0;const e=this.getClientKeyParams();let t;if(e&&(t=yield this.getLatestKeyParamsFromServer(e.identifier)),null!=this.encryptionService){if(!this.encryptionService.hasAccount()&&!this.encryptionService.hasPasscode()){const e=yield this.performServerSignIn();if(e){const n=!0;yield this.handleDecryptionOfAllKeysMatchingCorrectRootKey(e,n,t)}}yield this.processQueue(t),t&&(yield this.potentiallyPerformFallbackSignInToUpdateOutdatedLocalRootKey(t)),this.sync.isOutOfSync()&&this.sync.sync({checkIntegrity:!0})}}))}potentiallyPerformFallbackSignInToUpdateOutdatedLocalRootKey(e){return f(this,void 0,void 0,(function*(){const t=this.getClientKeyParams();t&&!e.compare(t)&&o(e,t)&&(yield this.performServerSignIn())}))}processQueue(e){return f(this,void 0,void 0,(function*(){let t=this.decryptionQueue[0];for(;t;){const n=yield this.processQueueItem(t,e);if((0,r.removeFromArray)(this.decryptionQueue,t),!p(n)&&n.aborted)return void(this.isProcessingQueue=!1);t=this.decryptionQueue[0]}this.isProcessingQueue=!1}))}processQueueItem(e,t){return f(this,void 0,void 0,(function*(){const n=this.getClientKeyParams(),r=new l(e,this.itemManager,this.encryptionService,this.challengeService,n,t),i=yield r.run();return p(i)?(yield this.handleDecryptionOfAllKeysMatchingCorrectRootKey(i.rootKey,i.replaceLocalRootKeyWithResult,t),i):(i.aborted||(yield this.alertService.alert(u.fD.KeyRecoveryUnableToRecover),this.readdQueueItem(e)),i)}))}handleDecryptionOfAllKeysMatchingCorrectRootKey(e,t,n){return f(this,void 0,void 0,(function*(){if(t){const t=yield this.getWrappingKeyIfApplicable();yield this.encryptionService.setRootKey(e,t)}const i=this.getClientKeyParams(),o=i&&n&&i.compare(n),s=this.removeElementsFromQueueForMatchingKeyParams(e.keyParams).map((e=>o&&!n.compare(e.keyParams)?e.encryptedKey.copy({dirty:!0,dirtyIndex:(0,d.getIncrementedDirtyIndex)()}):e.encryptedKey)),a=(yield this.encryptionService.decryptSplit({usesRootKey:{items:s,key:e}})).filter(d.isDecryptedPayload);this.payloadManager.emitPayloads(a,d.PayloadEmitSource.LocalChanged),yield this.storageService.savePayloads(a),t?this.alertService.alert(u.fD.KeyRecoveryRootKeyReplaced):this.alertService.alert(u.fD.KeyRecoveryKeyRecovered),a.some((e=>e.dirty))&&(yield this.sync.sync()),yield this.notifyEvent(c.KeysRecovered,a),this.removeFromUndecryptables((0,r.Uuids)(a))}))}removeElementsFromQueueForMatchingKeyParams(e){const t=[],n=[];for(const r of this.decryptionQueue)r.keyParams.compare(e)?t.push(r):n.push(r);return this.decryptionQueue=n,t}getDiagnostics(){return Promise.resolve({keyRecovery:{queueLength:this.decryptionQueue.length,isProcessingQueue:this.isProcessingQueue}})}}},81679:(e,t,n)=>{n.d(t,{o:()=>l});var r=n(87901),i=n(95658),o=n(55668),s=n(82648),a=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class l extends o.wcN{constructor(e,t,n,r,i,o,s,a){super(a),this.apiService=e,this.itemManager=t,this.settingsService=n,this.httpSerivce=r,this.protectionService=i,this.mutator=o,this.sync=s,this.internalEventBus=a}deinit(){this.itemManager=void 0,this.settingsService=void 0,this.apiService=void 0,this.httpSerivce=void 0,this.protectionService=void 0,this.mutator=void 0,super.deinit()}canRegisterNewListedAccount(){return null!=this.apiService.user}isNoteAuthorizedForListed(e){return e.authorizedForListed}authorizeNoteForListed(e){return a(this,void 0,void 0,(function*(){return!1!==(yield this.protectionService.authorizeListedPublishing())&&(yield this.mutator.changeItem(e,(e=>{e.authorizedForListed=!0})),this.sync.sync(),!0)}))}requestNewListedAccount(){return a(this,void 0,void 0,(function*(){const e=yield this.getSettingsBasedListedAccounts(),t=yield this.apiService.registerForListedAccount();if(!(0,i.isErrorResponse)(t))for(let t=0;t<4;t++){const t=yield this.getSettingsBasedListedAccounts();if(t.length>e.length)return(0,r.lastElement)(t);yield(0,r.sleep)(3e3,!1)}}))}getListedAccounts(){return a(this,void 0,void 0,(function*(){return[...yield this.getSettingsBasedListedAccounts(),...this.getLegacyListedAccounts()]}))}getListedAccountInfo(e,t){var n;return a(this,void 0,void 0,(function*(){const i=e.hostUrl;let o="".concat(i,"/authors/").concat(e.authorId,"/extension?secret=").concat(e.secret);t&&(o+="&item_uuid=".concat(t));const s=yield this.httpSerivce.getAbsolute(o).catch((e=>{console.error(e)}));if(s&&!(null===(n=s.data)||void 0===n?void 0:n.error)&&s.data&&!(0,r.isString)(s.data))return s}))}getSettingsBasedListedAccounts(){return a(this,void 0,void 0,(function*(){const e=yield this.settingsService.getSetting(s.SettingName.create(s.SettingName.NAMES.ListedAuthorSecrets).getValue());return e?JSON.parse(e):[]}))}getLegacyListedAccounts(){const e=this.itemManager.getItems(s.ContentType.TYPES.ActionsExtension).filter((e=>e.isListedExtension)),t=[];for(const n of e){const e=n.url,r=new URL(e),i=r.pathname.split("/")[2],o=r.search.split("secret=")[1].split("&")[0];t.push({secret:o,authorId:i,hostUrl:r.origin})}return t}}},3876:(e,t,n)=>{n.d(t,{p:()=>s});var r=n(55668),i=n(82648),o=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class s extends r.wcN{constructor(e,t,n,r,i){super(i),this.settingsService=e,this.crypto=t,this.featuresService=n,this.protections=r,this.internalEventBus=i}saveMfaSetting(e){return o(this,void 0,void 0,(function*(){return yield this.settingsService.updateSetting(i.SettingName.create(i.SettingName.NAMES.MfaSecret).getValue(),e,!0)}))}isMfaActivated(){return o(this,void 0,void 0,(function*(){return 0!=(yield this.settingsService.getDoesSensitiveSettingExist(i.SettingName.create(i.SettingName.NAMES.MfaSecret).getValue()))}))}generateMfaSecret(){return o(this,void 0,void 0,(function*(){return this.crypto.generateOtpSecret()}))}getOtpToken(e){return o(this,void 0,void 0,(function*(){return this.crypto.totpToken(e,Date.now(),6,30)}))}enableMfa(e,t){return o(this,void 0,void 0,(function*(){if(null==t||t!==(yield this.getOtpToken(e)))throw new Error(r.Mwm.IncorrectMfa);return this.saveMfaSetting(e)}))}disableMfa(){return o(this,void 0,void 0,(function*(){if(yield this.protections.authorizeMfaDisable())return yield this.settingsService.deleteSetting(i.SettingName.create(i.SettingName.NAMES.MfaSecret).getValue())}))}deinit(){this.settingsService=void 0,this.crypto=void 0,this.featuresService=void 0,super.deinit()}}},8740:(e,t,n)=>{n.d(t,{H:()=>u});var r=n(58386),i=n(94986),o=n(87901),s=n(55668),a=n(43361),l=n(42798),c=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class u extends s.wcN{constructor(e){super(e.internalEventBus),this.services=e}deinit(){this.services=void 0,this.activeMigrations&&(this.activeMigrations.length=0),super.deinit()}initialize(){return c(this,void 0,void 0,(function*(){yield this.runBaseMigrationPreRun();const e=u.getRequiredMigrations(yield this.getStoredSnjsVersion());this.activeMigrations=this.instantiateMigrationClasses(e),this.activeMigrations.length>0?(0,o.lastElement)(this.activeMigrations).onDone((()=>c(this,void 0,void 0,(function*(){yield this.markMigrationsAsDone()})))):yield this.markMigrationsAsDone()}))}markMigrationsAsDone(){return c(this,void 0,void 0,(function*(){yield this.services.deviceInterface.setRawStorageValue((0,s.xLN)(this.services.identifier,s.Bq2.SnjsVersion),i.in)}))}runBaseMigrationPreRun(){return c(this,void 0,void 0,(function*(){this.baseMigration=new r._(this.services),yield this.baseMigration.preRun()}))}handleEvent(e){return c(this,void 0,void 0,(function*(){if(e.type===s.n9K.ApplicationStageChanged){const t=e.payload.stage;yield this.handleStage(t)}}))}handleApplicationEvent(e){return c(this,void 0,void 0,(function*(){e===s.n9K.SignedIn&&(yield this.handleStage(s.Ugm.SignedIn_30))}))}hasPendingMigrations(){return c(this,void 0,void 0,(function*(){return u.getRequiredMigrations(yield this.getStoredSnjsVersion()).length>0||(yield this.baseMigration.needsKeychainRepair())}))}getStoredSnjsVersion(){return c(this,void 0,void 0,(function*(){const e=yield this.services.deviceInterface.getRawStorageValue((0,s.xLN)(this.services.identifier,s.Bq2.SnjsVersion));if(!e)throw a.W.error(Error("Snjs version missing from storage, run base migration."));return e}))}static getRequiredMigrations(e){const t=[],n=l.R_.sort(((e,t)=>(0,i.D8)(e.version(),t.version())));for(const r of n){const n=r.version();n!==e&&(0,i.jV)(e,n)&&t.push(r)}return t}instantiateMigrationClasses(e){return e.map((e=>new e(this.services)))}handleStage(e){return c(this,void 0,void 0,(function*(){if(yield this.baseMigration.handleStage(e),!this.activeMigrations)throw new Error("Invalid active migrations");for(const t of this.activeMigrations)yield t.handleStage(e)}))}getDiagnostics(){return Promise.resolve({migrations:{activeMigrations:this.activeMigrations&&this.activeMigrations.map((e=>typeof e))}})}}},28178:(e,t,n)=>{n.d(t,{V:()=>u});var r=n(55668),i=n(86999),o=n(82648),s=n(38529),a=n(22325),l=n(87901),c=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class u extends r.wcN{constructor(e,t,n,r){super(r),this.itemManager=e,this.payloadManager=t,this.alerts=n,this.internalEventBus=r}deinit(){super.deinit(),this.itemManager=void 0,this.payloadManager=void 0}changeItem(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.MutationType.UpdateUserTimestamps,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.PayloadEmitSource.LocalChanged,i=arguments.length>4?arguments[4]:void 0;return c(this,void 0,void 0,(function*(){return(yield this.changeItems([e],t,n,r,i))[0]}))}changeItems(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.MutationType.UpdateUserTimestamps,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.PayloadEmitSource.LocalChanged,i=arguments.length>4?arguments[4]:void 0;return c(this,void 0,void 0,(function*(){const o=this.itemManager.findItemsIncludingBlanks((0,l.Uuids)(e)),s=[];for(const e of o){if(!e)throw Error("Attempting to change non-existant item");const r=(0,a.CreateDecryptedMutatorForItem)(e,n);t&&t(r);const i=r.getResult();s.push(i)}return yield this.payloadManager.emitPayloads(s,r,i),this.itemManager.findItems(s.map((e=>e.uuid)))}))}runTransactionalMutations(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.PayloadEmitSource.LocalChanged,n=arguments.length>2?arguments[2]:void 0;return c(this,void 0,void 0,(function*(){const r=[];for(const t of e){const e=this.itemManager.findItem(t.itemUuid);if(!e)continue;const n=(0,a.CreateDecryptedMutatorForItem)(e,t.mutationType||a.MutationType.UpdateUserTimestamps);t.mutate(n);const i=n.getResult();r.push(i)}return yield this.payloadManager.emitPayloads(r,t,n),this.itemManager.findItems(r.map((e=>e.uuid)))}))}runTransactionalMutation(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.PayloadEmitSource.LocalChanged,n=arguments.length>2?arguments[2]:void 0;return c(this,void 0,void 0,(function*(){const r=this.itemManager.findSureItem(e.itemUuid),i=(0,a.CreateDecryptedMutatorForItem)(r,e.mutationType||a.MutationType.UpdateUserTimestamps);e.mutate(i);const o=i.getResult();return yield this.payloadManager.emitPayloads([o],t,n),this.itemManager.findItem(o.uuid)}))}changeNote(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.MutationType.UpdateUserTimestamps,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.PayloadEmitSource.LocalChanged,i=arguments.length>4?arguments[4]:void 0;return c(this,void 0,void 0,(function*(){const o=this.itemManager.findItem(e.uuid);if(!o)throw Error("Attempting to change non-existant note");const s=new a.NoteMutator(o,n);return this.applyTransform(s,t,r,i)}))}changeTag(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.MutationType.UpdateUserTimestamps,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.PayloadEmitSource.LocalChanged,i=arguments.length>4?arguments[4]:void 0;return c(this,void 0,void 0,(function*(){const o=this.itemManager.findItem(e.uuid);if(!o)throw Error("Attempting to change non-existant tag");const s=new a.TagMutator(o,n);return yield this.applyTransform(s,t,r,i),this.itemManager.findSureItem(e.uuid)}))}changeComponent(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.MutationType.UpdateUserTimestamps,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.PayloadEmitSource.LocalChanged,i=arguments.length>4?arguments[4]:void 0;return c(this,void 0,void 0,(function*(){const o=this.itemManager.findItem(e.uuid);if(!o)throw Error("Attempting to change non-existant component");const s=new a.ComponentMutator(o,n);return yield this.applyTransform(s,t,r,i),this.itemManager.findSureItem(e.uuid)}))}changeFeatureRepo(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.MutationType.UpdateUserTimestamps,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.PayloadEmitSource.LocalChanged,i=arguments.length>4?arguments[4]:void 0;return c(this,void 0,void 0,(function*(){const o=this.itemManager.findItem(e.uuid);if(!o)throw Error("Attempting to change non-existant repo");const s=new a.FeatureRepoMutator(o,n);return yield this.applyTransform(s,t,r,i),this.itemManager.findSureItem(e.uuid)}))}changeActionsExtension(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.MutationType.UpdateUserTimestamps,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.PayloadEmitSource.LocalChanged,i=arguments.length>4?arguments[4]:void 0;return c(this,void 0,void 0,(function*(){const o=this.itemManager.findItem(e.uuid);if(!o)throw Error("Attempting to change non-existant extension");const s=new a.ActionsExtensionMutator(o,n);return yield this.applyTransform(s,t,r,i),this.itemManager.findSureItem(e.uuid)}))}changeItemsKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.MutationType.UpdateUserTimestamps,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.PayloadEmitSource.LocalChanged,o=arguments.length>4?arguments[4]:void 0;return c(this,void 0,void 0,(function*(){const s=this.itemManager.findItem(e.uuid);if(!s)throw Error("Attempting to change non-existant itemsKey");const a=new i.tn(s,n);return yield this.applyTransform(a,t,r,o),this.itemManager.findSureItem(e.uuid)}))}applyTransform(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.PayloadEmitSource.LocalChanged,r=arguments.length>3?arguments[3]:void 0;return c(this,void 0,void 0,(function*(){t(e);const i=e.getResult();return this.payloadManager.emitPayload(i,n,r)}))}setItemDirty(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return c(this,void 0,void 0,(function*(){return(yield this.setItemsDirty([e],t))[0]}))}setItemsDirty(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return c(this,void 0,void 0,(function*(){return this.changeItems(e,void 0,t?a.MutationType.UpdateUserTimestamps:a.MutationType.NoUpdateUserTimestamps)}))}duplicateItem(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;return c(this,void 0,void 0,(function*(){const r=this.itemManager.findSureItem(e.uuid).payload.copy(),i=(0,a.PayloadsByDuplicating)({payload:r,baseCollection:this.payloadManager.getMasterCollection(),isConflict:t,additionalContent:Object.assign({appData:{[a.DefaultAppDomain]:{[a.AppDataField.UserModifiedDate]:new Date}}},n)});return yield this.payloadManager.emitPayloads(i,a.PayloadEmitSource.LocalChanged),this.itemManager.findSureItem(i[0].uuid)}))}createItem(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;return c(this,void 0,void 0,(function*(){const i=new a.DecryptedPayload(Object.assign(Object.assign({uuid:l.UuidGenerator.GenerateUuid(),content_type:e,content:(0,a.FillItemContent)(t),dirty:n},(0,a.PayloadVaultOverrides)(r)),(0,a.PayloadTimestampDefaults)()));return yield this.payloadManager.emitPayload(i,a.PayloadEmitSource.LocalInserted),this.itemManager.findSureItem(i.uuid)}))}insertItem(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return c(this,void 0,void 0,(function*(){if(this.itemManager.findItem(e.uuid))throw Error("Attempting to insert item that already exists");if(t){const t=(0,a.CreateDecryptedMutatorForItem)(e,a.MutationType.UpdateUserTimestamps).getResult();return yield this.emitItemFromPayload(t,a.PayloadEmitSource.LocalInserted)}return this.emitItemFromPayload(e.payload,a.PayloadEmitSource.LocalChanged)}))}insertItems(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.PayloadEmitSource.LocalInserted;return c(this,void 0,void 0,(function*(){return this.emitItemsFromPayloads(e.map((e=>e.payload)),t)}))}emitItemFromPayload(e,t){return c(this,void 0,void 0,(function*(){yield this.payloadManager.emitPayload(e,t);const n=this.itemManager.findSureItem(e.uuid);if(!n)throw Error("Emitted item can't be found");return n}))}emitItemsFromPayloads(e,t){return c(this,void 0,void 0,(function*(){yield this.payloadManager.emitPayloads(e,t);const n=(0,l.Uuids)(e);return this.itemManager.findItems(n)}))}setItemToBeDeleted(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.PayloadEmitSource.LocalChanged;return c(this,void 0,void 0,(function*(){const n=this.itemManager.getCollection().uuidsThatReferenceUuid(e.uuid),r=this.itemManager.findAnyItem(e.uuid);if(!r)return;const i=new a.DeleteItemMutator(r,a.MutationType.UpdateUserTimestamps).getDeletedResult();yield this.payloadManager.emitPayload(i,t);for(const e of n){const t=this.itemManager.findItem(e);t&&(yield this.changeItem(t,(e=>{e.removeItemAsRelationship(r)})))}}))}setItemsToBeDeleted(e){return c(this,void 0,void 0,(function*(){yield Promise.all(e.map((e=>this.setItemToBeDeleted(e))))}))}findOrCreateTagParentChain(e){return c(this,void 0,void 0,(function*(){let t;for(const n of e)t=yield this.findOrCreateTagByTitle({title:n,parentItemToLookupUuidFor:t});if(!t)throw new Error("Invalid tag hierarchy");return t}))}createTag(e){return c(this,void 0,void 0,(function*(){const t=yield this.createItem(o.ContentType.TYPES.Tag,(0,a.FillItemContent)({title:e.title}),!0,e.createInVault);if(e.parentItemToLookupUuidFor){const n=this.itemManager.findItem(e.parentItemToLookupUuidFor.uuid);if(!n)throw new Error("Invalid parent tag");return this.changeTag(t,(e=>{e.makeChildOf(n)}))}return t}))}createSmartView(e){return c(this,void 0,void 0,(function*(){return this.createItem(o.ContentType.TYPES.SmartView,(0,a.FillItemContent)({title:e.title,predicate:e.predicate.toJson(),iconString:e.iconString||a.SmartViewDefaultIconName}),!0,e.vault)}))}createSmartViewFromDSL(e,t){return c(this,void 0,void 0,(function*(){let n=null;try{n=JSON.parse(e.substring(1,e.length))}catch(e){throw Error("Invalid smart view syntax")}const r=n[0],i=(0,a.predicateFromDSLString)(e);return this.createSmartView({title:r,predicate:i,vault:t})}))}createTagOrSmartView(e,t){return c(this,void 0,void 0,(function*(){return this.itemManager.isSmartViewTitle(e)?this.createSmartViewFromDSL(e,t):this.createTag({title:e,createInVault:t})}))}findOrCreateTagByTitle(e){return c(this,void 0,void 0,(function*(){return this.itemManager.findTagByTitleAndParent(e.title,e.parentItemToLookupUuidFor)||this.createTag(e)}))}renameFile(e,t){return this.changeItem(e,(e=>{e.name=t}))}mergeItem(e,t){return c(this,void 0,void 0,(function*(){return this.emitItemFromPayload(e.payloadRepresentation(),t)}))}setItemNeedsSync(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return c(this,void 0,void 0,(function*(){return this.setItemDirty(e,t)}))}setItemsNeedsSync(e){return c(this,void 0,void 0,(function*(){return this.setItemsDirty(e)}))}deleteItem(e){return c(this,void 0,void 0,(function*(){return this.deleteItems([e])}))}deleteItems(e){return c(this,void 0,void 0,(function*(){yield this.setItemsToBeDeleted(e)}))}emptyTrash(){return c(this,void 0,void 0,(function*(){const e=this.itemManager.trashedItems;yield this.setItemsToBeDeleted(e)}))}migrateTagsToFolders(){return c(this,void 0,void 0,(function*(){yield s.l.run(this.itemManager,this)}))}findOrCreateTag(e,t){return c(this,void 0,void 0,(function*(){return this.findOrCreateTagByTitle({title:e,createInVault:t})}))}setTagParent(e,t){return c(this,void 0,void 0,(function*(){if(e.uuid===t.uuid)throw new Error("Can not set a tag parent of itself");if(this.itemManager.isTagAncestor(t,e))throw new Error("Can not set a tag ancestor of itself");return this.changeTag(t,(t=>{t.makeChildOf(e)}))}))}unsetTagParent(e){return this.itemManager.getTagParent(e)?this.changeTag(e,(e=>{e.unsetParent()})):Promise.resolve(e)}associateFileWithNote(e,t){return c(this,void 0,void 0,(function*(){if(!e.key_system_identifier||!t.key_system_identifier||e.key_system_identifier===t.key_system_identifier)return this.changeItem(e,(e=>{e.addNote(t)}));this.alerts.alert("The items you are trying to link belong to different vaults and cannot be linked")}))}disassociateFileWithNote(e,t){return c(this,void 0,void 0,(function*(){return this.changeItem(e,(e=>{e.removeNote(t)}))}))}addTagToNote(e,t,n){return c(this,void 0,void 0,(function*(){if(t.key_system_identifier!==e.key_system_identifier)return void this.alerts.alert("The items you are trying to link belong to different vaults and cannot be linked");let r=[t];return n&&(r=[...this.itemManager.getTagParentChain(t),t]),Promise.all(r.map((t=>this.changeTag(t,(t=>{t.addNote(e)})))))}))}addTagToFile(e,t,n){return c(this,void 0,void 0,(function*(){if(t.key_system_identifier!==e.key_system_identifier)return void this.alerts.alert("The items you are trying to link belong to different vaults and cannot be linked");let r=[t];return n&&(r=[...this.itemManager.getTagParentChain(t),t]),Promise.all(r.map((t=>this.changeTag(t,(t=>{t.addFile(e)})))))}))}linkNoteToNote(e,t){return c(this,void 0,void 0,(function*(){return this.changeItem(e,(e=>{e.addNote(t)}))}))}linkFileToFile(e,t){return c(this,void 0,void 0,(function*(){return this.changeItem(e,(e=>{e.addFile(t)}))}))}unlinkItems(e,t){return c(this,void 0,void 0,(function*(){const n=this.itemManager.relationshipDirectionBetweenItems(e,t);if(n===r.uMm.NoRelationship)throw new Error("Trying to unlink already unlinked items");const i=n===r.uMm.AReferencesB?e:t,o=i===e?t:e;return this.changeItem(i,(e=>{e.removeItemAsRelationship(o)}))}))}}},64892:(e,t,n)=>{n.d(t,{O:()=>l});var r=n(82648),i=n(87901),o=n(22325),s=n(55668),a=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class l extends s.wcN{constructor(e,t){super(t),this.logger=e,this.internalEventBus=t,this.changeObservers=[],this.emitQueue=[],this.collection=new o.PayloadCollection}getMasterCollection(){return o.ImmutablePayloadCollection.FromCollection(this.collection)}deinit(){super.deinit(),this.changeObservers.length=0,this.resetState()}resetState(){this.collection=new o.PayloadCollection}find(e){return this.collection.findAll(e)}findOne(e){return this.collection.findAll([e])[0]}all(e){return this.collection.all(e)}get integrityPayloads(){return this.collection.integrityPayloads()}get nonDeletedItems(){return this.collection.nondeletedElements()}get invalidPayloads(){return this.collection.invalidElements()}emitDeltaEmit(e,t){var n;return a(this,void 0,void 0,(function*(){return 0===e.emits.length&&0===(null===(n=e.ignored)||void 0===n?void 0:n.length)?[]:new Promise((n=>{const r={emit:e,sourceKey:t,resolve:n};this.emitQueue.push(r),1===this.emitQueue.length&&this.popQueue()}))}))}emitPayload(e,t,n){return a(this,void 0,void 0,(function*(){return this.emitPayloads([e],t,n)}))}emitPayloads(e,t,n){return a(this,void 0,void 0,(function*(){const r={emits:e,source:t};return this.emitDeltaEmit(r,n)}))}popQueue(){const e=this.emitQueue[0],{changed:t,inserted:n,discarded:r,unerrored:o}=this.applyPayloads(e.emit.emits);this.notifyChangeObservers(t,n,r,e.emit.ignored||[],o,e.emit.source,e.sourceKey),(0,i.removeFromArray)(this.emitQueue,e),e.resolve([...t,...n,...r]),this.emitQueue.length>0&&this.popQueue()}applyPayloads(e){const t=[],n=[],r=[],i=[];for(const s of e){if(!s.uuid||!s.content_type){console.error("Payload is corrupt",s);continue}this.logger.debug("applying payload",s.uuid,"globalDirtyIndexAtLastSync",s.globalDirtyIndexAtLastSync,"dirtyIndex",s.dirtyIndex,"dirty",s.dirty);const e=this.collection.find(s.uuid);(0,o.isDeletedPayload)(s)&&s.discardable?(this.collection.discard(s),r.push(s)):(this.collection.set(s),e?(t.push(s),(0,o.isEncryptedPayload)(e)&&(0,o.isDecryptedPayload)(s)&&i.push(s)):n.push(s))}return{changed:t,inserted:n,discarded:r,unerrored:i}}addObserver(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;Array.isArray(e)||(e=[e]);const r={types:e,priority:n,callback:t};this.changeObservers.push(r);const o=this.changeObservers;return()=>{(0,i.removeFromArray)(o,r)}}notifyChangeObservers(e,t,n,i,o,s,a){const l=this.changeObservers.slice().sort(((e,t)=>e.priority<t.priority?-1:1)),c=(e,t)=>t.includes(r.ContentType.TYPES.Any)?e.slice():e.slice().filter((e=>t.includes(e.content_type)));for(const r of l)r.callback({changed:c(e,r.types),inserted:c(t,r.types),discarded:c(n,r.types),ignored:c(i,r.types),unerrored:c(o,r.types),source:s,sourceKey:a})}importPayloads(e,t){return a(this,void 0,void 0,(function*(){const n=e.map((e=>e.copy(void 0,o.PayloadSource.FileImport))),r=new o.DeltaFileImport(this.getMasterCollection(),n,t).result();return yield this.emitDeltaEmit(r),(0,i.Uuids)(e)}))}removePayloadLocally(e){this.collection.discard(e)}erroredPayloadsForContentType(e){return this.collection.invalidElements().filter((t=>t.content_type===e))}deleteErroredPayloads(e){return a(this,void 0,void 0,(function*(){const t=e.map((e=>new o.DeletedPayload(Object.assign(Object.assign({},e.ejected()),{deleted:!0,content:void 0,dirty:!0,dirtyIndex:(0,o.getIncrementedDirtyIndex)()}),e.source)));yield this.emitPayloads(t,o.PayloadEmitSource.LocalChanged)}))}getDiagnostics(){return Promise.resolve({payloads:{integrityPayloads:this.integrityPayloads,nonDeletedItemCount:this.nonDeletedItems.length,invalidPayloadsCount:this.invalidPayloads.length}})}}},30693:(e,t,n)=>{n.d(t,{y:()=>a});var r=n(22325),i=n(55668),o=n(82648),s=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class a extends i.wcN{constructor(e,t,n,r,s,a){super(a),this.singletons=e,this.mutator=n,this.sync=r,this.storage=s,this.internalEventBus=a,this.shouldReload=!0,this.reloading=!1,this.localPreferences={},this.removeItemObserver=t.addObserver(o.ContentType.TYPES.UserPrefs,(()=>{this.shouldReload=!0})),this.removeSyncObserver=r.addEventObserver((e=>{e!==i.wMo.SyncCompletedWithAllItemsUploaded&&e!==i.wMo.LocalDataIncrementalLoad||this.reload()}))}deinit(){var e,t;null===(e=this.removeItemObserver)||void 0===e||e.call(this),null===(t=this.removeSyncObserver)||void 0===t||t.call(this),this.singletons=void 0,this.mutator=void 0,super.deinit()}handleEvent(e){var t;return s(this,void 0,void 0,(function*(){if(e.type===i.n9K.ApplicationStageChanged){const n=e.payload.stage;n===i.Ugm.LoadedDatabase_12?(this.preferences=this.singletons.findSingleton(o.ContentType.TYPES.UserPrefs,r.SNUserPrefs.singletonPredicate),this.preferences&&this.notifyEvent(i.WZd.PreferencesChanged)):n===i.Ugm.StorageDecrypted_09&&(this.localPreferences=null!==(t=this.storage.getValue(i.QtK.LocalPreferences))&&void 0!==t?t:{},this.notifyEvent(i.WZd.LocalPreferencesChanged))}}))}getLocalValue(e,t){var n;return null!==(n=this.localPreferences[e])&&void 0!==n?n:t}getValue(e,t){var n,r;return null!==(r=null===(n=this.preferences)||void 0===n?void 0:n.getPref(e))&&void 0!==r?r:t}setLocalValue(e,t){this.localPreferences[e]=t,this.storage.setValue(i.QtK.LocalPreferences,this.localPreferences),this.notifyEvent(i.WZd.LocalPreferencesChanged)}setValue(e,t){return s(this,void 0,void 0,(function*(){yield this.setValueDetached(e,t),this.notifyEvent(i.WZd.PreferencesChanged),this.sync.sync({sourceDescription:"PreferencesService.setValue"})}))}setValueDetached(e,t){return s(this,void 0,void 0,(function*(){this.preferences&&(this.preferences=yield this.mutator.changeItem(this.preferences,(n=>{n.setPref(e,t)})))}))}reload(){return s(this,void 0,void 0,(function*(){if(this.shouldReload&&!this.reloading){this.reloading=!0;try{const e=this.preferences;this.preferences=yield this.singletons.findOrCreateContentTypeSingleton(o.ContentType.TYPES.UserPrefs,(0,r.FillItemContent)({})),((null==e?void 0:e.uuid)!==this.preferences.uuid||this.preferences.userModifiedDate>e.userModifiedDate)&&this.notifyEvent(i.WZd.PreferencesChanged),this.shouldReload=!1}finally{this.reloading=!1}}}))}}},51271:(e,t,n)=>{n.d(t,{n:()=>d});var r=n(43361),i=n(22325),o=n(87901),s=n(55668),a=n(82648),l=n(17956),c=n(97210),u=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class d extends s.wcN{constructor(e,t,n,r,i){super(i),this.encryption=e,this.mutator=t,this.challenges=n,this.storage=r,this.internalEventBus=i,this.sessionExpiryTimeout=-1,this.mobilePasscodeTiming=s.sNv.OnQuit,this.mobileBiometricsTiming=s.sNv.OnQuit,this.isBiometricsSoftLockEngaged=!1,this.applicationStarted=!1}deinit(){clearTimeout(this.sessionExpiryTimeout),this.encryption=void 0,this.challenges=void 0,this.storage=void 0,super.deinit()}handleEvent(e){return u(this,void 0,void 0,(function*(){e.type===s.n9K.ApplicationStageChanged?e.payload.stage===s.Ugm.LoadedDatabase_12&&(this.updateSessionExpiryTimer(this.getSessionExpiryDate()),this.mobilePasscodeTiming=this.getMobilePasscodeTiming(),this.mobileBiometricsTiming=this.getMobileBiometricsTiming()):e.type===s.n9K.Started&&(this.applicationStarted=!0)}))}isLocked(){return u(this,void 0,void 0,(function*(){return!this.applicationStarted||(yield this.encryption.isPasscodeLocked())||this.isBiometricsSoftLockEngaged}))}softLockBiometrics(){const e=new s.tv4([new s.FEo(s.tQn.Biometric)],s.Ps8.ApplicationUnlock,!1);this.challenges.promptForChallengeResponse(e),this.isBiometricsSoftLockEngaged=!0,this.notifyEvent(s.Hh3.BiometricsSoftLockEngaged),this.challenges.addChallengeObserver(e,{onComplete:()=>{this.isBiometricsSoftLockEngaged=!1,this.notifyEvent(s.Hh3.BiometricsSoftLockDisengaged)}})}hasProtectionSources(){return this.encryption.hasAccount()||this.encryption.hasPasscode()||this.hasBiometricsEnabled()}hasUnprotectedAccessSession(){return!this.hasProtectionSources()||this.getSessionExpiryDate()>new Date}hasBiometricsEnabled(){const e=this.storage.getValue(s.QtK.BiometricsState,s.qt7.Nonwrapped);return Boolean(e)}enableBiometrics(){return this.hasBiometricsEnabled()?(r.W.onError(Error("Tried to enable biometrics when they already are enabled.")),!1):(this.storage.setValue(s.QtK.BiometricsState,!0,s.qt7.Nonwrapped),!0)}disableBiometrics(){return u(this,void 0,void 0,(function*(){return this.hasBiometricsEnabled()?!!(yield this.validateOrRenewSession(s.Ps8.DisableBiometrics))&&(this.storage.setValue(s.QtK.BiometricsState,!1,s.qt7.Nonwrapped),!0):(r.W.onError(Error("Tried to disable biometrics when they already are disabled.")),!1)}))}createLaunchChallenge(){const e=[];return this.hasBiometricsEnabled()&&e.push(new s.FEo(s.tQn.Biometric)),this.encryption.hasPasscode()&&e.push(new s.FEo(s.tQn.LocalPasscode)),e.length>0?new s.tv4(e,s.Ps8.ApplicationUnlock,!1):void 0}authorizeProtectedActionForItems(e,t){return u(this,void 0,void 0,(function*(){let n;const r=[];for(const i of e){const e=i.protected&&!this.hasUnprotectedAccessSession();e&&!n&&(n=this.validateOrRenewSession(t)),e&&!(yield n)||r.push(i)}return r}))}authorizeItemAccess(e){return u(this,void 0,void 0,(function*(){return!e.protected||this.authorizeAction(e.content_type===a.ContentType.TYPES.Note?s.Ps8.AccessProtectedNote:s.Ps8.AccessProtectedFile,{fallBackToAccountPassword:!0,requireAccountPassword:!1,forcePrompt:!1})}))}authorizeAddingPasscode(){return this.authorizeAction(s.Ps8.AddPasscode,{fallBackToAccountPassword:!0,requireAccountPassword:!1,forcePrompt:!1})}authorizeChangingPasscode(){return this.authorizeAction(s.Ps8.ChangePasscode,{fallBackToAccountPassword:!0,requireAccountPassword:!1,forcePrompt:!1})}authorizeRemovingPasscode(){return this.authorizeAction(s.Ps8.RemovePasscode,{fallBackToAccountPassword:!0,requireAccountPassword:!1,forcePrompt:!1})}authorizeSearchingProtectedNotesText(){return this.authorizeAction(s.Ps8.SearchProtectedNotesText,{fallBackToAccountPassword:!0,requireAccountPassword:!1,forcePrompt:!1})}authorizeFileImport(){return this.authorizeAction(s.Ps8.ImportFile,{fallBackToAccountPassword:!0,requireAccountPassword:!1,forcePrompt:!1})}authorizeBackupCreation(){return u(this,void 0,void 0,(function*(){return this.authorizeAction(s.Ps8.ExportBackup,{fallBackToAccountPassword:!0,requireAccountPassword:!1,forcePrompt:!1})}))}authorizeMfaDisable(){return u(this,void 0,void 0,(function*(){return this.authorizeAction(s.Ps8.DisableMfa,{fallBackToAccountPassword:!0,requireAccountPassword:!0,forcePrompt:!1})}))}authorizeAutolockIntervalChange(){return u(this,void 0,void 0,(function*(){return this.authorizeAction(s.Ps8.ChangeAutolockInterval,{fallBackToAccountPassword:!0,requireAccountPassword:!1,forcePrompt:!1})}))}authorizeSessionRevoking(){return u(this,void 0,void 0,(function*(){return this.authorizeAction(s.Ps8.RevokeSession,{fallBackToAccountPassword:!0,requireAccountPassword:!1,forcePrompt:!1})}))}authorizeListedPublishing(){return u(this,void 0,void 0,(function*(){return this.authorizeAction(s.Ps8.AuthorizeNoteForListed,{fallBackToAccountPassword:!0,requireAccountPassword:!1,forcePrompt:!0})}))}authorizeAction(e,t){return u(this,void 0,void 0,(function*(){return this.validateOrRenewSession(e,t)}))}getMobilePasscodeTimingOptions(){return[{title:"Immediately",key:s.sNv.Immediately,selected:this.mobilePasscodeTiming===s.sNv.Immediately},{title:"On Quit",key:s.sNv.OnQuit,selected:this.mobilePasscodeTiming===s.sNv.OnQuit}]}getMobileBiometricsTimingOptions(){return[{title:"Immediately",key:s.sNv.Immediately,selected:this.mobileBiometricsTiming===s.sNv.Immediately},{title:"On Quit",key:s.sNv.OnQuit,selected:this.mobileBiometricsTiming===s.sNv.OnQuit}]}getMobileBiometricsTiming(){return this.storage.getValue(s.QtK.MobileBiometricsTiming,s.qt7.Nonwrapped,s.sNv.OnQuit)}getMobilePasscodeTiming(){return this.storage.getValue(s.QtK.MobilePasscodeTiming,s.qt7.Nonwrapped,s.sNv.OnQuit)}setMobileBiometricsTiming(e){this.storage.setValue(s.QtK.MobileBiometricsTiming,e,s.qt7.Nonwrapped),this.mobileBiometricsTiming=e}setMobilePasscodeTiming(e){this.storage.setValue(s.QtK.MobilePasscodeTiming,e,s.qt7.Nonwrapped),this.mobilePasscodeTiming=e}setMobileScreenshotPrivacyEnabled(e){return this.storage.setValue(s.QtK.MobileScreenshotPrivacyEnabled,e,s.qt7.Default)}getMobileScreenshotPrivacyEnabled(){return this.storage.getValue(s.QtK.MobileScreenshotPrivacyEnabled,s.qt7.Default,!1)}validateOrRenewSession(e){let{fallBackToAccountPassword:t=!0,requireAccountPassword:n=!1,forcePrompt:i=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var a;return u(this,void 0,void 0,(function*(){if(this.getSessionExpiryDate()>new Date&&!i)return!0;const u=[];if(this.hasBiometricsEnabled()&&u.push(new s.FEo(s.tQn.Biometric)),this.encryption.hasPasscode()&&u.push(new s.FEo(s.tQn.LocalPasscode)),n){if(!this.encryption.hasAccount())throw Error("Requiring account password for challenge with no account");u.push(new s.FEo(s.tQn.AccountPassword))}if(0===u.length){if(!t||!this.encryption.hasAccount())return!0;u.push(new s.FEo(s.tQn.AccountPassword))}const d=this.getLastSessionLength(),h=(0,l.z)(d)?d:c.F.OneMinute;u.push(new s.FEo(s.tQn.ProtectionSessionDuration,void 0,void 0,void 0,void 0,h));const p=yield this.challenges.promptForChallengeResponse(new s.tv4(u,e,!0));if(p){const e=null===(a=p.values.find((e=>e.prompt.validation===s.tQn.ProtectionSessionDuration)))||void 0===a?void 0:a.value;return(0,o.isNullOrUndefined)(e)?r.W.error(Error("No valid protection session length found. Got "+e)):this.setSessionLength(e),!0}return!1}))}getSessionExpiryDate(){const e=this.storage.getValue(s.QtK.ProtectionExpirey);return e?new Date(e):new Date}clearSession(){return this.setSessionExpiryDate(new Date),this.notifyEvent(s.Hh3.UnprotectedSessionExpired)}setSessionExpiryDate(e){this.storage.setValue(s.QtK.ProtectionExpirey,e)}getLastSessionLength(){return this.storage.getValue(s.QtK.ProtectionSessionLength)}setSessionLength(e){this.storage.setValue(s.QtK.ProtectionSessionLength,e);const t=new Date;t.setSeconds(t.getSeconds()+e),this.setSessionExpiryDate(t),this.updateSessionExpiryTimer(t),this.notifyEvent(s.Hh3.UnprotectedSessionBegan)}updateSessionExpiryTimer(e){clearTimeout(this.sessionExpiryTimeout),this.sessionExpiryTimeout=setTimeout((()=>{this.clearSession()}),e.getTime()-Date.now())}protectItems(e){return u(this,void 0,void 0,(function*(){return yield this.mutator.changeItems(e,(e=>{e.protected=!0}),i.MutationType.NoUpdateUserTimestamps)}))}unprotectItems(e,t){return u(this,void 0,void 0,(function*(){if(yield this.authorizeAction(t,{fallBackToAccountPassword:!0,requireAccountPassword:!1,forcePrompt:!1}))return yield this.mutator.changeItems(e,(e=>{e.protected=!1}),i.MutationType.NoUpdateUserTimestamps)}))}protectNote(e){return u(this,void 0,void 0,(function*(){return(yield this.protectItems([e]))[0]}))}unprotectNote(e){return u(this,void 0,void 0,(function*(){const t=yield this.unprotectItems([e],s.Ps8.UnprotectNote);return t?t[0]:void 0}))}protectNotes(e){return u(this,void 0,void 0,(function*(){return this.protectItems(e)}))}unprotectNotes(e){return u(this,void 0,void 0,(function*(){return(yield this.unprotectItems(e,s.Ps8.UnprotectNote))||[]}))}protectFile(e){return u(this,void 0,void 0,(function*(){return(yield this.protectItems([e]))[0]}))}unprotectFile(e){return u(this,void 0,void 0,(function*(){const t=yield this.unprotectItems([e],s.Ps8.UnprotectFile);return t?t[0]:void 0}))}}},97210:(e,t,n)=>{var r;n.d(t,{F:()=>r}),function(e){e[e.OneMinute=60]="OneMinute",e[e.FiveMinutes=300]="FiveMinutes",e[e.OneHour=3600]="OneHour",e[e.OneWeek=604800]="OneWeek"}(r||(r={}))},17956:(e,t,n)=>{n.d(t,{z:()=>i});var r=n(97210);function i(e){return"number"==typeof e&&Object.values(r.F).includes(e)}},53218:(e,t,n)=>{n.d(t,{aM:()=>p,Sn:()=>f,Sj:()=>m});var r=n(55668),i=n(95658),o=n(22325),s=n(82648),a=n(86999),l=n(20875),c=n(52450),u=n(70781);const d=e=>e.trim().toLowerCase();var h=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};const p=8,f="missing-params",g=18e5;class m extends r.wcN{constructor(e,t,n,i,o,s,a,l,c,u,d,h,p,f,g){super(g),this.storage=e,this.apiService=t,this.userApiService=n,this.alertService=i,this.encryptionService=o,this.crypto=s,this.challengeService=a,this.webSocketsService=l,this.httpService=c,this.sessionStorageMapper=u,this.legacySessionStorageMapper=d,this.workspaceIdentifier=h,this._getKeyPairs=p,this.isApplicationUsingThirdPartyHostUseCase=f,this.internalEventBus=g,this.isSessionRenewChallengePresented=!1,t.setInvalidSessionObserver((e=>{e?this.notifyEvent(r.Pxr.Revoked):this.reauthenticateInvalidSession()}))}handleEvent(e){return h(this,void 0,void 0,(function*(){switch(e.type){case r.Sf$.SessionRefreshed:this.httpService.setSession(e.payload.session);break;case r.n9K.ApplicationStageChanged:e.payload.stage===r.Ugm.StorageDecrypted_09&&(yield this.initializeFromDisk())}}))}deinit(){this.encryptionService=void 0,this.storage=void 0,this.apiService=void 0,this.alertService=void 0,this.challengeService=void 0,this.webSocketsService=void 0,this.user=void 0,super.deinit()}getWorkspaceDisplayIdentifier(){return this.user?this.user.email:this.workspaceIdentifier}memoizeUser(e){this.user=e,this.apiService.setUser(e)}initializeFromDisk(){return h(this,void 0,void 0,(function*(){if(this.memoizeUser(this.storage.getValue(r.QtK.User)),!this.user){const e=this.storage.getValue(r.QtK.LegacyUuid);e&&this.memoizeUser({uuid:e,email:e})}const e=this.storage.getValue(r.QtK.ServerHost);e&&(this.apiService.setHost(e),this.httpService.setHost(e));const t=this.storage.getValue(r.QtK.Session);if(t)try{const e="jwt"in t?this.legacySessionStorageMapper.toDomain(t):this.sessionStorageMapper.toDomain(t);this.setSession(e,!1)}catch(e){console.error("Could not deserialize session from storage: ".concat(e.message))}}))}setSession(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.session=e,this.httpService.setSession(e),this.apiService.setSession(e,t),this.isSignedIntoFirstPartyServer()&&this.webSocketsService.startWebSocketConnection()}online(){return!this.offline()}offline(){return null==this.apiService.getSession()}getUser(){return this.user}getSureUser(){return this.user}isUserMissingKeyPair(){try{return null==this.getPublicKey()}catch(e){return!0}}getPublicKey(){return this._getKeyPairs.execute().getValue().encryption.publicKey}getSigningPublicKey(){return this._getKeyPairs.execute().getValue().signing.publicKey}get userUuid(){const e=this.getUser();if(!e)throw Error("Attempting to access userUuid when user is undefined");return e.uuid}isCurrentSessionReadOnly(){if(void 0!==this.session)return!(this.session instanceof s.LegacySession)&&this.session.isReadOnly()}getSession(){return this.apiService.getSession()}signOut(){return h(this,void 0,void 0,(function*(){this.memoizeUser(void 0);const e=this.apiService.getSession();e&&e instanceof s.Session&&(yield this.apiService.signOut(),this.webSocketsService.closeWebSocketConnection())}))}isSignedIn(){return null!=this.getUser()}isSignedOut(){return!this.isSignedIn()}isSignedIntoFirstPartyServer(){const e=this.isApplicationUsingThirdPartyHostUseCase.execute();if(e.isFailed())return!1;const t=e.getValue();return this.isSignedIn()&&!t}reauthenticateInvalidSession(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;var n;return h(this,void 0,void 0,(function*(){if(this.isSessionRenewChallengePresented)return;this.isSessionRenewChallengePresented=!0;const o=new r.tv4([new r.FEo(r.tQn.None,void 0,r.K9E.EmailInputPlaceholder,!1),new r.FEo(r.tQn.None,void 0,r.K9E.PasswordInputPlaceholder)],r.Ps8.Custom,e,r.K9E.EnterEmailAndPassword,r.K9E.RecoverSession(null===(n=this.getUser())||void 0===n?void 0:n.email));return new Promise((e=>{this.challengeService.addChallengeObserver(o,{onCancel:()=>{this.isSessionRenewChallengePresented=!1},onComplete:()=>{this.isSessionRenewChallengePresented=!1},onNonvalidatedSubmit:n=>h(this,void 0,void 0,(function*(){const s=n.values[0].value,a=n.values[1].value,l=this.encryptionService.getAccountKeyParams(),{response:c}=yield this.signIn(s,a,!1,this.storage.isEphemeralSession(),null==l?void 0:l.version);(0,i.isErrorResponse)(c)?(this.challengeService.setValidationStatusForChallenge(o,n.values[1],!1),null==t||t(c)):(e(),this.challengeService.completeChallenge(o),this.notifyEvent(r.Pxr.Restored),this.alertService.alert(r.K9E.SessionRestored))}))}),this.challengeService.promptForChallengeResponse(o)}))}))}promptForU2FVerification(e){return h(this,void 0,void 0,(function*(){const t=new r.tv4([new r.FEo(r.tQn.Authenticator,r.fD2.U2F,void 0,!1,void 0,void 0,{username:e})],r.Ps8.Custom,!0,r.K9E.InputU2FDevice),n=yield this.challengeService.promptForChallengeResponse(t);if(n)return n.values[0].value}))}promptForMfaValue(){return h(this,void 0,void 0,(function*(){const e=new r.tv4([new r.FEo(r.tQn.None,r.fD2.Mfa,r.K9E.MfaInputPlaceholder,!1,r.gqK.Numeric)],r.Ps8.Custom,!0,r.K9E.EnterMfa),t=yield this.challengeService.promptForChallengeResponse(e);if(t)return this.challengeService.completeChallenge(e),t.values[0].value}))}register(e,t,n,r){return h(this,void 0,void 0,(function*(){if(t.length<p)throw new u.ApiCallError(u.ErrorMessage.InsufficientPasswordMessage.replace("%LENGTH%",p.toString()));const{wrappingKey:o,canceled:s}=yield this.challengeService.getWrappingKeyIfApplicable();if(s)throw new u.ApiCallError(u.ErrorMessage.PasscodeRequired);e=d(e);const a=yield this.encryptionService.createRootKey(e,t,l.KeyParamsOrigination.Registration),c=a.serverPassword,h=a.keyParams,f=yield this.userApiService.register({email:e,serverPassword:c,hvmToken:n,keyParams:h,ephemeral:r});if((0,i.isErrorResponse)(f))throw new u.ApiCallError((0,i.getErrorFromErrorResponse)(f).message);return yield this.handleAuthentication({rootKey:a,wrappingKey:o,session:f.data.session,user:f.data.user}),f.data}))}retrieveKeyParams(e){return h(this,void 0,void 0,(function*(){const t=yield this.apiService.getAccountKeyParams(e);if((0,i.isErrorResponse)(t)||!t.data){e.mfaCode&&(yield this.alertService.alert(r.Mwm.IncorrectMfa));const n=(0,i.isErrorResponse)(t)?t.data.error:void 0;if(t.data&&[i.ErrorTag.U2FRequired,i.ErrorTag.MfaRequired].includes(null==n?void 0:n.tag)){const t=(null==n?void 0:n.tag)===i.ErrorTag.U2FRequired,o=t?yield this.promptForU2FVerification(e.email):yield this.promptForMfaValue();return o?this.retrieveKeyParams({email:e.email,mfaCode:t?void 0:o,authenticatorResponse:t?o:void 0}):{response:this.apiService.createErrorResponse(r.Mwm.SignInCanceledMissingMfa,void 0,i.ErrorTag.ClientCanceledMfa)}}return{response:t}}const n=(0,a.LW)(t.data,e.email);return n&&n.version?{keyParams:n,response:t,mfaCode:e.mfaCode}:{response:this.apiService.createErrorResponse(r.aWs)}}))}signIn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0;return h(this,void 0,void 0,(function*(){const a=yield this.performSignIn(e,t,n,r,o,s);if((0,i.isErrorResponse)(a.response)&&(0,i.getErrorFromErrorResponse)(a.response).tag!==i.ErrorTag.ClientValidationError&&(0,i.getErrorFromErrorResponse)(a.response).tag!==i.ErrorTag.ClientCanceledMfa){const i=d(e);return i!==e?this.performSignIn(i,t,n,r,o,s):a}return a}))}performSignIn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0;return h(this,void 0,void 0,(function*(){const u=yield this.retrieveKeyParams({email:e});if((0,i.isErrorResponse)(u.response))return{response:u.response};const d=u.keyParams;if(!this.encryptionService.supportedVersions().includes(d.version))return this.encryptionService.isVersionNewerThanLibraryVersion(d.version)?{response:this.apiService.createErrorResponse(r.fnl)}:{response:this.apiService.createErrorResponse(r.R53)};if(l.isProtocolVersionExpired(d.version)){const e=this.encryptionService.costMinimumForVersion(d.version);if(d.content002.pw_cost<e)return{response:this.apiService.createErrorResponse(r.nIe)};const t=c.e.Confirm.ProtocolVersionExpired(d.version);if(!(yield this.alertService.confirm(t.Message,t.Title,t.ConfirmButton)))return{response:this.apiService.createErrorResponse(r.aWs)}}if(!this.encryptionService.platformSupportsKeyDerivation(d))return{response:this.apiService.createErrorResponse(r.VnT)};if(n&&(s=this.encryptionService.getLatestVersion()),null!=s&&!l.leftVersionGreaterThanOrEqualToRight(d.version,s))return{response:this.apiService.createErrorResponse((0,r.OC4)(d.version,s))};const h=yield this.encryptionService.computeRootKey(t,d);return{response:yield this.bypassChecksAndSignInWithRootKey(e,h,o,a)}}))}bypassChecksAndSignInWithRootKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3?arguments[3]:void 0;return h(this,void 0,void 0,(function*(){const{wrappingKey:l,canceled:c}=yield this.challengeService.getWrappingKeyIfApplicable();if(c)return this.apiService.createErrorResponse(r.Mwm.PasscodeRequired,void 0,i.ErrorTag.ClientValidationError);const u=yield this.apiService.signIn({email:e,serverPassword:t.serverPassword,ephemeral:n,hvmToken:s});if(!u.data||(0,i.isErrorResponse)(u))return u;const d=u.data.key_params,h=new a.t$((0,o.CopyPayloadWithContentOverride)(t.payload,{keyParams:d||t.keyParams.getPortableValue()}));return yield this.handleSuccessAuthResponse(u,h,l),u}))}changeCredentials(e){return h(this,void 0,void 0,(function*(){const t=this.getSureUser().uuid,n=yield this.apiService.changeCredentials({userUuid:t,currentServerPassword:e.currentServerPassword,newServerPassword:e.newRootKey.serverPassword,newKeyParams:e.newRootKey.keyParams,newEmail:e.newEmail?d(e.newEmail):void 0}),o=this._getKeyPairs.execute(),s=yield this.processChangeCredentialsResponse(n,e.newRootKey,e.wrappingKey);if(!(0,i.isErrorResponse)(n)&&r.BbS.get().isFeatureEnabled(r.KK4.Vaults)){const t={previous:o.isFailed()?void 0:{encryption:o.getValue().encryption,signing:o.getValue().signing},current:{encryption:e.newRootKey.encryptionKeyPair,signing:e.newRootKey.signingKeyPair}};this.notifyEvent(r.Pxr.UserKeyPairChanged,t)}return s}))}getSessionsList(){return h(this,void 0,void 0,(function*(){const e=yield this.apiService.getSessionsList();return(0,i.isErrorResponse)(e)||(e.data=e.data.sort(((e,t)=>new Date(e.updated_at)<new Date(t.updated_at)?1:-1))),e}))}revokeSession(e){return h(this,void 0,void 0,(function*(){return this.apiService.deleteSession(e)}))}revokeAllOtherSessions(){var e,t;return h(this,void 0,void 0,(function*(){const n=yield this.getSessionsList();if((0,i.isErrorResponse)(n)||!n.data){const o=(0,i.isErrorResponse)(n)?null===(e=n.data)||void 0===e?void 0:e.error:void 0;throw new Error(null!==(t=null==o?void 0:o.message)&&void 0!==t?t:r.gEn)}const o=n.data.filter((e=>!e.current));yield Promise.all(o.map((e=>this.revokeSession(e.uuid))))}))}processChangeCredentialsResponse(e,t,n){var r;return h(this,void 0,void 0,(function*(){return(0,i.isErrorResponse)(e)?{response:e}:(yield this.handleSuccessAuthResponse(e,t,n),{response:e,keyParams:null===(r=e.data)||void 0===r?void 0:r.key_params})}))}decodeDemoShareToken(e){const t=this.crypto.base64Decode(e);return JSON.parse(t)}populateSessionFromDemoShareToken(e){return h(this,void 0,void 0,(function*(){const t=this.decodeDemoShareToken(e);yield this.signIn(t.email,t.password,!1,!0)}))}populateSession(e,t,n,i,o){return h(this,void 0,void 0,(function*(){yield this.encryptionService.setRootKey(e,o),this.memoizeUser(t),this.storage.setValue(r.QtK.User,t),this.apiService.setHost(i),this.httpService.setHost(i),this.setSession(n)}))}handleAuthentication(e){return h(this,void 0,void 0,(function*(){const t=this.createSession(e.session.access_token,e.session.access_expiration,e.session.refresh_token,e.session.refresh_expiration,e.session.readonly_access);t.isFailed()?console.error(t.getError()):yield this.populateSession(e.rootKey,e.user,t.getValue(),this.apiService.getHost(),e.wrappingKey)}))}handleSuccessAuthResponse(e,t,n){return h(this,void 0,void 0,(function*(){const{data:r}=e,i=r.user;if(null!=r.token){const e=s.LegacySession.create(r.token);!e.isFailed()&&i&&(yield this.populateSession(t,i,e.getValue(),this.apiService.getHost(),n))}else if(r.session){const e=this.createSession(r.session.access_token,r.session.access_expiration,r.session.refresh_token,r.session.refresh_expiration,r.session.readonly_access);if(e.isFailed())return void console.error(e.getError());if(!i)return void console.error("No user in response");yield this.populateSession(t,i,e.getValue(),this.apiService.getHost(),n)}}))}createSession(e,t,n,r,i){const o=s.SessionToken.create(e,t);if(o.isFailed())return s.Result.fail("Could not create session: ".concat(o.getError()));const a=o.getValue(),l=s.SessionToken.create(n,r);if(l.isFailed())return s.Result.fail("Could not create session: ".concat(l.getError()));const c=l.getValue(),u=s.Session.create(a,c,i);return u.isFailed()?s.Result.fail("Could not create session: ".concat(u.getError())):s.Result.ok(u.getValue())}refreshSessionIfExpiringSoon(){return h(this,void 0,void 0,(function*(){const e=this.getSession();if(!e)return!1;if(e instanceof s.LegacySession)return!1;const t=new Date(e.accessToken.expiresAt),n=new Date(e.refreshToken.expiresAt),r=t.getTime()-Date.now()<g,o=n.getTime()-Date.now()<g;if(r||o){const e=yield this.httpService.refreshSession();if(e.isFailed())return!1;const t=e.getValue();return(0,i.isErrorResponse)(t)}return!1}))}}},98116:(e,t,n)=>{n.d(t,{g:()=>u});class r{constructor(e){this.map={};for(const t of e)this.map[t.name]=t}getSettingValue(e,t){const n=this.map[e.value];return(null==n?void 0:n.value)||t}}var i=n(55668),o=n(95658),s=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class a{constructor(e,t){this.settingsApi=e,this.userProvider=t}isReadyForModification(){return null!=this.getUser()}getUser(){return this.userProvider.getUser()}get userUuid(){const e=this.getUser();if(null==e||null==e.uuid)throw new Error(i.aXB);return e.uuid}listSettings(){return s(this,void 0,void 0,(function*(){const e=yield this.settingsApi.listSettings(this.userUuid);if((0,o.isErrorResponse)(e))throw new Error((0,o.getErrorFromErrorResponse)(e).message);return null==e.data||null==e.data.settings?new r([]):new r(e.data.settings)}))}getSetting(e){var t,n,r;return s(this,void 0,void 0,(function*(){const i=yield this.settingsApi.getSetting(this.userUuid,e.value);if(i.status!==o.HttpStatusCode.BadRequest){if((0,o.isErrorResponse)(i))throw new Error((0,o.getErrorFromErrorResponse)(i).message);return null!==(r=null===(n=null===(t=null==i?void 0:i.data)||void 0===t?void 0:t.setting)||void 0===n?void 0:n.value)&&void 0!==r?r:void 0}}))}getSubscriptionSetting(e){var t,n,r;return s(this,void 0,void 0,(function*(){if(!e.isASubscriptionSetting())throw new Error("Setting ".concat(e.value," is not a subscription setting"));const i=yield this.settingsApi.getSubscriptionSetting(this.userUuid,e.value);if(i.status!==o.HttpStatusCode.BadRequest){if((0,o.isErrorResponse)(i))throw new Error((0,o.getErrorFromErrorResponse)(i).message);return null!==(r=null===(n=null===(t=null==i?void 0:i.data)||void 0===t?void 0:t.setting)||void 0===n?void 0:n.value)&&void 0!==r?r:void 0}}))}updateSubscriptionSetting(e,t,n){return s(this,void 0,void 0,(function*(){const r=yield this.settingsApi.updateSubscriptionSetting(this.userUuid,e.value,t,n);if((0,o.isErrorResponse)(r))throw new Error((0,o.getErrorFromErrorResponse)(r).message)}))}getDoesSensitiveSettingExist(e){var t,n;return s(this,void 0,void 0,(function*(){if(!e.isSensitive())throw new Error("Setting ".concat(e.value," is not sensitive"));const r=yield this.settingsApi.getSetting(this.userUuid,e.value);if(r.status===o.HttpStatusCode.BadRequest)return!1;if((0,o.isErrorResponse)(r))throw new Error((0,o.getErrorFromErrorResponse)(r).message);return null!==(n=null===(t=r.data)||void 0===t?void 0:t.success)&&void 0!==n&&n}))}updateSetting(e,t,n){return s(this,void 0,void 0,(function*(){const r=yield this.settingsApi.updateSetting(this.userUuid,e.value,t,n);if((0,o.isErrorResponse)(r))throw new Error((0,o.getErrorFromErrorResponse)(r).message)}))}deleteSetting(e){return s(this,void 0,void 0,(function*(){const t=yield this.settingsApi.deleteSetting(this.userUuid,e.value);if((0,o.isErrorResponse)(t))throw new Error((0,o.getErrorFromErrorResponse)(t).message)}))}deinit(){this.settingsApi=void 0,this.userProvider=void 0}}var l=n(73606),c=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class u extends i.wcN{constructor(e,t,n){super(n),this.sessionManager=e,this.apiService=t,this.internalEventBus=n,this.frequencyOptionsLabels={[l.EmailBackupFrequency.Disabled]:"No email backups",[l.EmailBackupFrequency.Daily]:"Daily",[l.EmailBackupFrequency.Weekly]:"Weekly"}}initializeFromDisk(){this.provider=new a(this.apiService,this.sessionManager)}listSettings(){return c(this,void 0,void 0,(function*(){return this.provider.listSettings()}))}getSetting(e){return c(this,void 0,void 0,(function*(){return this.provider.getSetting(e)}))}getSubscriptionSetting(e){return c(this,void 0,void 0,(function*(){return this.provider.getSubscriptionSetting(e)}))}updateSubscriptionSetting(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return c(this,void 0,void 0,(function*(){return this.provider.updateSubscriptionSetting(e,t,n)}))}updateSetting(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return c(this,void 0,void 0,(function*(){return this.provider.updateSetting(e,t,n)}))}getDoesSensitiveSettingExist(e){return c(this,void 0,void 0,(function*(){return this.provider.getDoesSensitiveSettingExist(e)}))}deleteSetting(e){return c(this,void 0,void 0,(function*(){return this.provider.deleteSetting(e)}))}getEmailBackupFrequencyOptionLabel(e){return this.frequencyOptionsLabels[e]}deinit(){var e;null===(e=this.provider)||void 0===e||e.deinit(),this.provider=void 0,this.sessionManager=void 0,this.apiService=void 0}}},15109:(e,t,n)=>{n.d(t,{W:()=>l});var r=n(22325),i=n(87901),o=n(55668),s=n(82648),a=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class l extends o.wcN{constructor(e,t,n,r,i){super(i),this.itemManager=e,this.mutator=t,this.payloadManager=n,this.sync=r,this.internalEventBus=i,this.resolveQueue=[],this.addObservers()}deinit(){this.sync=void 0,this.mutator=void 0,this.itemManager=void 0,this.payloadManager=void 0,this.resolveQueue.length=0,this.removeItemObserver(),this.removeItemObserver=void 0,this.removeSyncObserver(),this.removeSyncObserver=void 0,super.deinit()}popResolveQueue(){const e=this.resolveQueue.slice();return this.resolveQueue=[],e}addObservers(){this.removeItemObserver=this.itemManager.addObserver(s.ContentType.TYPES.Any,(e=>{let{inserted:t,unerrored:n}=e;n.length>0&&(this.resolveQueue=this.resolveQueue.concat(n)),t.length>0&&(this.resolveQueue=this.resolveQueue.concat(t))})),this.removeSyncObserver=this.sync.addEventObserver((e=>a(this,void 0,void 0,(function*(){e!==o.wMo.DownloadFirstSyncCompleted&&e!==o.wMo.SyncCompletedWithAllItemsUploaded||(yield this.resolveSingletonsForItems(this.popResolveQueue(),e))}))))}validItemsMatchingPredicate(e,t){return this.itemManager.itemsMatchingPredicate(e,t)}resolveSingletonsForItems(e,t){var n;return a(this,void 0,void 0,(function*(){if(0===e.length)return;const r=[];for(const t of e){if(r.includes(t)||!t.isSingleton)continue;const e=this.validItemsMatchingPredicate(t.content_type,t.singletonPredicate());(0,i.extendArray)(r,e||[]),!e||e.length<=1||(yield this.handleStrategy(e,t.singletonStrategy))}r.length>0&&t===o.wMo.SyncCompletedWithAllItemsUploaded&&(yield null===(n=this.sync)||void 0===n?void 0:n.sync({sourceDescription:"Resolve singletons for items"}))}))}handleStrategy(e,t){return a(this,void 0,void 0,(function*(){if(t!==r.SingletonStrategy.KeepEarliest)throw"Unhandled singleton strategy";const n=e.sort(((e,t)=>e.created_at<t.created_at?-1:1)),o=(0,i.arrayByRemovingFromIndex)(n,0);yield this.mutator.setItemsToBeDeleted(o)}))}findSingleton(e,t){const n=this.validItemsMatchingPredicate(e,t);if(n.length>0)return n[0]}findOrCreateContentTypeSingleton(e,t){return a(this,void 0,void 0,(function*(){const n=this.itemManager.getItems(e);if(n.length>0)return n[0];if(!this.sync.getLastSyncDate()){let t;const n=this.itemManager.addObserver(e,(n=>{let{inserted:r}=n;if(r.length>0){const n=r.filter((t=>t.content_type===e));n.length>0&&(t=n[0])}}));if(yield this.sync.sync({sourceDescription:"Find or create singleton, before any sync has completed"}),n(),t)return t;const r=this.itemManager.getItems(e);if(r.length>0)return r[0]}const o=this.payloadManager.erroredPayloadsForContentType(e);o.length&&(yield this.payloadManager.deleteErroredPayloads(o));const s=new r.DecryptedPayload(Object.assign({uuid:i.UuidGenerator.GenerateUuid(),content_type:e,content:t,dirty:!0,dirtyIndex:(0,r.getIncrementedDirtyIndex)()},(0,r.PayloadTimestampDefaults)())),a=yield this.mutator.emitItemFromPayload(s,r.PayloadEmitSource.LocalInserted);return this.sync.sync({sourceDescription:"After find or create singleton"}),a}))}findOrCreateSingleton(e,t,n){return a(this,void 0,void 0,(function*(){const o=this.itemManager.itemsMatchingPredicate(t,e);if(o.length>0)return o[0];if(!this.sync.getLastSyncDate()){let n;const r=this.itemManager.addObserver(t,(t=>{let{inserted:r}=t;if(r.length>0){const t=r.filter((t=>t.satisfiesPredicate(e)));t.length>0&&(n=t[0])}}));if(yield this.sync.sync({sourceDescription:"Find or create singleton, before any sync has completed"}),r(),n)return n;const i=this.itemManager.itemsMatchingPredicate(t,e);if(i.length>0)return i[0]}const s=new r.DecryptedPayload(Object.assign({uuid:i.UuidGenerator.GenerateUuid(),content_type:t,content:n,dirty:!0,dirtyIndex:(0,r.getIncrementedDirtyIndex)()},(0,r.PayloadTimestampDefaults)())),a=yield this.mutator.emitItemFromPayload(s,r.PayloadEmitSource.LocalInserted);return this.sync.sync({sourceDescription:"After find or create singleton"}),a}))}}},28559:(e,t,n)=>{n.d(t,{e:()=>u});var r=n(87901),i=n(43361),o=n(86999),s=n(55668),a=n(22325),l=n(82648),c=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class u extends s.wcN{constructor(e,t,n){super(n),this.device=e,this.identifier=t,this.internalEventBus=n,this.storagePersistable=!1,this.needsPersist=!1,this.setPersistencePolicy(s.eIN.Default)}provideEncryptionProvider(e){this.encryptionProvider=e}deinit(){this.device=void 0,this.encryptionProvider=void 0,this.storagePersistable=!1,super.deinit()}handleEvent(e){return c(this,void 0,void 0,(function*(){e.type===s.n9K.ApplicationStageChanged&&e.payload.stage===s.Ugm.Launched_10&&(this.storagePersistable=!0,this.needsPersist&&this.persistValuesToDisk())}))}setPersistencePolicy(e){return c(this,void 0,void 0,(function*(){this.persistencePolicy=e,this.persistencePolicy===s.eIN.Ephemeral&&(yield this.device.clearNamespacedKeychainValue(this.identifier),yield this.device.removeAllDatabaseEntries(this.identifier),yield this.device.removeRawStorageValuesForIdentifier(this.identifier),yield this.clearAllPayloads())}))}isEphemeralSession(){return this.persistencePolicy===s.eIN.Ephemeral}initializeFromDisk(){return c(this,void 0,void 0,(function*(){const e=yield this.device.getRawStorageValue(this.getPersistenceKey()),t=e?JSON.parse(e):void 0;yield this.setInitialValues(t)}))}setInitialValues(e){return c(this,void 0,void 0,(function*(){const t=e||this.defaultValuesObject();t[s.dDH.Unwrapped]||(t[s.dDH.Unwrapped]={}),this.values=t,this.isStorageWrapped()||(this.values[s.dDH.Unwrapped]=Object.assign(Object.assign({},this.values[s.dDH.Wrapped].content),this.values[s.dDH.Unwrapped]))}))}isStorageWrapped(){const e=this.values[s.dDH.Wrapped];return null!=e&&(0,a.isEncryptedLocalStoragePayload)(e)}canDecryptWithKey(e){return c(this,void 0,void 0,(function*(){const t=this.values[s.dDH.Wrapped];if(!(0,a.isEncryptedLocalStoragePayload)(t))throw Error("Attempting to decrypt non decrypted storage value");const n=yield this.decryptWrappedValue(t,e);return!(0,o.XL)(n)}))}decryptWrappedValue(e,t){return c(this,void 0,void 0,(function*(){if(!(null==e?void 0:e.content_type))throw Error("Attempting to decrypt nonexistent wrapped value");const n=new a.EncryptedPayload(Object.assign(Object.assign(Object.assign({},e),(0,a.PayloadTimestampDefaults)()),{content_type:l.ContentType.TYPES.EncryptedStorage})),r=t?{usesRootKey:{items:[n],key:t}}:{usesRootKeyWithKeyLookup:{items:[n]}};return yield this.encryptionProvider.decryptSplitSingle(r)}))}decryptStorage(){return c(this,void 0,void 0,(function*(){const e=this.values[s.dDH.Wrapped];if(!(0,a.isEncryptedLocalStoragePayload)(e))throw Error("Attempting to decrypt already decrypted storage");const t=yield this.decryptWrappedValue(e);if((0,o.XL)(t))throw i.W.error(Error("Unable to decrypt storage."));this.values[s.dDH.Unwrapped]=(0,r.Copy)(t.content)}))}persistValuesToDisk(){return c(this,void 0,void 0,(function*(){if(!this.storagePersistable)return void(this.needsPersist=!0);if(this.persistencePolicy===s.eIN.Ephemeral)return;yield this.currentPersistPromise,this.needsPersist=!1;const e=yield this.immediatelyPersistValuesToDisk();this.values[s.dDH.Wrapped]=e[s.dDH.Wrapped]}))}awaitPersist(){return c(this,void 0,void 0,(function*(){yield this.currentPersistPromise}))}immediatelyPersistValuesToDisk(){return c(this,void 0,void 0,(function*(){return this.currentPersistPromise=this.executeCriticalFunction((()=>c(this,void 0,void 0,(function*(){var e;const t=yield this.generatePersistableValues();return this.persistencePolicy===s.eIN.Ephemeral||(yield null===(e=this.device)||void 0===e?void 0:e.setRawStorageValue(this.getPersistenceKey(),JSON.stringify(t))),t})))),this.currentPersistPromise}))}generatePersistableValues(){return c(this,void 0,void 0,(function*(){const e=(0,r.Copy)(this.values),t=e[s.dDH.Unwrapped];e[s.dDH.Unwrapped]=void 0;const n=new a.DecryptedPayload(Object.assign({uuid:r.UuidGenerator.GenerateUuid(),content:t,content_type:l.ContentType.TYPES.EncryptedStorage},(0,a.PayloadTimestampDefaults)()));if(this.encryptionProvider.hasRootKeyEncryptionSource()){const t={usesRootKeyWithKeyLookup:{items:[n]}},r=yield this.encryptionProvider.encryptSplitSingle(t);e[s.dDH.Wrapped]=(0,a.CreateEncryptedLocalStorageContextPayload)(r)}else e[s.dDH.Wrapped]=(0,a.CreateDecryptedLocalStorageContextPayload)(n);return e}))}setValue(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.qt7.Default;this.setValueWithNoPersist(e,t,n),this.persistValuesToDisk()}setValueAndAwaitPersist(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.qt7.Default;return c(this,void 0,void 0,(function*(){this.setValueWithNoPersist(e,t,n),yield this.persistValuesToDisk()}))}setValueWithNoPersist(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.qt7.Default;if(!this.values)throw Error("Attempting to set storage key ".concat(e," before loading local storage."));const r=this.domainKeyForMode(n);this.values[r][e]=t}getValue(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.qt7.Default,n=arguments.length>2?arguments[2]:void 0;if(!this.values)throw Error("Attempting to get storage key ".concat(e," before loading local storage."));if(!this.values[this.domainKeyForMode(t)])throw Error("Storage domain mode not available ".concat(t," for key ").concat(e));const r=this.values[this.domainKeyForMode(t)][e];return null!=r?r:n}getAllKeys(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s.qt7.Default;if(!this.values)throw Error("Attempting to get all keys before loading local storage.");return Object.keys(this.values[this.domainKeyForMode(e)])}removeValue(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.qt7.Default;return c(this,void 0,void 0,(function*(){if(!this.values)throw Error("Attempting to remove storage key ".concat(e," before loading local storage."));const n=this.values[this.domainKeyForMode(t)];if(null==n?void 0:n[e])return delete n[e],this.persistValuesToDisk()}))}getPersistenceKey(){return(0,s.xLN)(this.identifier,s.Bq2.StorageObject)}defaultValuesObject(e,t,n){return u.DefaultValuesObject(e,t,n)}static DefaultValuesObject(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{[s.dDH.Wrapped]:e,[s.dDH.Unwrapped]:t,[s.dDH.Nonwrapped]:n}}domainKeyForMode(e){if(e===s.qt7.Default)return s.dDH.Unwrapped;if(e===s.qt7.Nonwrapped)return s.dDH.Nonwrapped;throw Error("Invalid mode")}clearValues(){return c(this,void 0,void 0,(function*(){yield this.setInitialValues(),yield this.immediatelyPersistValuesToDisk()}))}getAllRawPayloads(){return c(this,void 0,void 0,(function*(){return this.device.getAllDatabaseEntries(this.identifier)}))}getRawPayloads(e){return c(this,void 0,void 0,(function*(){return this.device.getDatabaseEntries(this.identifier,e)}))}savePayload(e){return c(this,void 0,void 0,(function*(){return this.savePayloads([e])}))}savePayloads(e){return c(this,void 0,void 0,(function*(){if(this.persistencePolicy===s.eIN.Ephemeral)return;const{encrypted:t,decrypted:n,deleted:i,discardable:l}=(0,a.CreatePayloadSplitWithDiscardables)(e),u=this.encryptionProvider.hasRootKeyEncryptionSource(),d=[],h=[],{rootKeyEncryption:p,keySystemRootKeyEncryption:f,itemsKeyEncryption:g}=(0,o.xg)(n);g&&(0,r.extendArray)(d,g),f&&(0,r.extendArray)(d,f),p&&(u?(0,r.extendArray)(d,p):(0,r.extendArray)(h,p)),l.length>0&&(yield this.deletePayloads(l));const m=(0,o.xg)(d),y=(0,o.Ak)(m),v=[...t,...yield this.encryptionProvider.encryptSplit(y)].map(a.CreateEncryptedLocalStorageContextPayload),A=h.map(a.CreateDecryptedLocalStorageContextPayload),b=i.map(a.CreateDeletedLocalStorageContextPayload);return this.executeCriticalFunction((()=>c(this,void 0,void 0,(function*(){var e;return null===(e=this.device)||void 0===e?void 0:e.saveDatabaseEntries([...v,...A,...b],this.identifier)}))))}))}deletePayloads(e){return c(this,void 0,void 0,(function*(){yield this.deletePayloadsWithUuids((0,r.Uuids)(e))}))}deletePayloadsWithUuids(e){return c(this,void 0,void 0,(function*(){yield this.executeCriticalFunction((()=>c(this,void 0,void 0,(function*(){yield Promise.all(e.map((e=>this.device.removeDatabaseEntry(e,this.identifier))))}))))}))}deletePayloadWithUuid(e){return c(this,void 0,void 0,(function*(){return this.executeCriticalFunction((()=>c(this,void 0,void 0,(function*(){yield this.device.removeDatabaseEntry(e,this.identifier)}))))}))}clearAllPayloads(){return c(this,void 0,void 0,(function*(){return this.executeCriticalFunction((()=>c(this,void 0,void 0,(function*(){return this.device.removeAllDatabaseEntries(this.identifier)}))))}))}clearAllData(){return this.executeCriticalFunction((()=>c(this,void 0,void 0,(function*(){yield this.clearValues(),yield this.clearAllPayloads(),yield this.device.removeRawStorageValue((0,s.xLN)(this.identifier,s.Bq2.SnjsVersion)),yield this.device.removeRawStorageValue(this.getPersistenceKey())}))))}}},37185:(e,t,n)=>{n.d(t,{U:()=>a,j:()=>s});var r=n(87901),i=n(87570),o=n(60215);const s=150;class a{constructor(e,t,n,i){this.payloads=e,this.receiver=t,this.apiService=n,this.options=i,this.id=(0,r.nonSecureRandomIdentifier)(),this.responses=[],this.pendingPayloads=e.slice()}get payloadsSavedOrSaving(){return(0,r.arrayByDifference)(this.payloads,this.pendingPayloads)}popPayloads(e){const t=this.pendingPayloads.slice(0,e);return(0,r.subtractFromArray)(this.pendingPayloads,t),t}run(){return e=this,t=void 0,r=function*(){yield this.receiver(o._.StatusChanged,void 0,{completedUploadCount:this.totalUploadCount-this.pendingUploadCount,totalUploadCount:this.totalUploadCount});const e=this.popPayloads(this.upLimit),t=yield this.apiService.sync(e,this.options.syncToken,this.options.paginationToken,this.downLimit,this.options.sharedVaultUuids),n=new i.F(t);this.responses.push(n),this.options.syncToken=n.lastSyncToken,this.options.paginationToken=n.paginationToken;try{yield this.receiver(o._.Response,n)}catch(e){console.error("Sync handle response error",e)}if(!this.done)return this.run()},new((n=void 0)||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}));var e,t,n,r}get done(){return 0===this.pendingPayloads.length&&!this.options.paginationToken}get pendingUploadCount(){return this.pendingPayloads.length}get totalUploadCount(){return this.payloads.length}get upLimit(){return s}get downLimit(){return s}get numberOfItemsInvolved(){let e=0;for(const t of this.responses)e+=t.numberOfItemsInvolved;return e}}},87570:(e,t,n)=>{n.d(t,{F:()=>s});var r=n(95658),i=n(22325),o=n(87901);class s{constructor(e){var t,n,s,a,l,c,u,d;this.rawResponse=e,(0,r.isErrorResponse)(e)||(this.successResponseData=e.data);const h=(null===(t=this.successResponseData)||void 0===t?void 0:t.conflicts)||[],p=(null===(n=this.successResponseData)||void 0===n?void 0:n.unsaved)||[];this.rawConflictObjects=h.concat(p);const f=[],g=(0,i.FilterDisallowedRemotePayloadsAndMap)((null===(s=this.successResponseData)||void 0===s?void 0:s.saved_items)||[]);this.savedPayloads=g.filtered.map((e=>(0,i.CreateServerSyncSavedPayload)(e))),f.push(...g.disallowed);const m=(0,i.FilterDisallowedRemotePayloadsAndMap)((null===(a=this.successResponseData)||void 0===a?void 0:a.retrieved_items)||[]);this.retrievedPayloads=m.filtered,f.push(...m.disallowed),this.conflicts=this.filterConflictsAndDisallowedPayloads(f),this.vaults=(null===(l=this.successResponseData)||void 0===l?void 0:l.shared_vaults)||[],this.vaultInvites=(null===(c=this.successResponseData)||void 0===c?void 0:c.shared_vault_invites)||[],this.asymmetricMessages=(null===(u=this.successResponseData)||void 0===u?void 0:u.messages)||[],this.userEvents=(null===(d=this.successResponseData)||void 0===d?void 0:d.notifications)||[],(0,o.deepFreeze)(this)}filterConflictsAndDisallowedPayloads(e){const t=this.rawConflictObjects,n={};n[r.ConflictType.InvalidServerItem]=[];const o=n[r.ConflictType.InvalidServerItem];for(const t of e)o.push({type:r.ConflictType.InvalidServerItem,server_item:t});for(const e of t){let t,s;if(e.unsaved_item){const t=(0,i.FilterDisallowedRemotePayloadsAndMap)([e.unsaved_item]);1===t.filtered.length&&(s=t.filtered[0]),1===t.disallowed.length&&o.push({type:r.ConflictType.InvalidServerItem,unsaved_item:t.disallowed[0]})}if(e.server_item){const n=(0,i.FilterDisallowedRemotePayloadsAndMap)([e.server_item]);1===n.filtered.length&&(t=n.filtered[0]),1===n.disallowed.length&&o.push({type:r.ConflictType.InvalidServerItem,server_item:n.disallowed[0]})}n[e.type]||(n[e.type]=[]);const a=n[e.type];if(a){const n={type:e.type,server_item:t,unsaved_item:s};a.push(n)}}return n}get error(){return(0,r.isErrorResponse)(this.rawResponse)?(0,r.getErrorFromErrorResponse)(this.rawResponse):void 0}get status(){return this.rawResponse.status}get lastSyncToken(){var e;return null===(e=this.successResponseData)||void 0===e?void 0:e[r.ApiEndpointParam.LastSyncToken]}get paginationToken(){var e;return null===(e=this.successResponseData)||void 0===e?void 0:e[r.ApiEndpointParam.PaginationToken]}get numberOfItemsInvolved(){return[...this.retrievedPayloads,...this.rawConflictObjects].length}get hasError(){return(0,r.isErrorResponse)(this.rawResponse)}}},73822:(e,t,n)=>{n.d(t,{y:()=>o});var r=n(95658),i=n(22325);class o{constructor(e,t,n,r){this.payloadSet=e,this.baseCollection=t,this.payloadsSavedOrSaving=n,this.historyMap=r}result(){const e=[];return e.push(this.processRetrievedPayloads()),e.push(this.processSavedPayloads()),e.push(this.processUuidConflictUnsavedPayloads()),e.push(this.processDataConflictServerPayloads()),e.push(this.processRejectedPayloads()),e}processSavedPayloads(){return new i.DeltaRemoteSaved(this.baseCollection,this.payloadSet.savedPayloads).result()}processRetrievedPayloads(){const e=i.ImmutablePayloadCollection.WithPayloads(this.payloadSet.retrievedPayloads);return new i.DeltaRemoteRetrieved(this.baseCollection,e,this.payloadsSavedOrSaving,this.historyMap).result()}getConflictsForType(e){return this.payloadSet.conflicts[e]||[]}processDataConflictServerPayloads(){return new i.DeltaRemoteDataConflicts(this.baseCollection,this.getConflictsForType(r.ConflictType.ConflictingData),this.historyMap).result()}processUuidConflictUnsavedPayloads(){return new i.DeltaRemoteUuidConflicts(this.baseCollection,this.getConflictsForType(r.ConflictType.UuidConflict)).result()}processRejectedPayloads(){const e=[...this.getConflictsForType(r.ConflictType.ContentTypeError),...this.getConflictsForType(r.ConflictType.ContentError),...this.getConflictsForType(r.ConflictType.ReadOnlyError),...this.getConflictsForType(r.ConflictType.UuidError),...this.getConflictsForType(r.ConflictType.SharedVaultSnjsVersionError),...this.getConflictsForType(r.ConflictType.SharedVaultInsufficientPermissionsError),...this.getConflictsForType(r.ConflictType.SharedVaultNotMemberError),...this.getConflictsForType(r.ConflictType.SharedVaultInvalidState),...this.getConflictsForType(r.ConflictType.InvalidServerItem)];return new i.DeltaRemoteRejected(this.baseCollection,e).result()}}},48671:(e,t,n)=>{n.d(t,{B:()=>s});var r=n(22325),i=n(60215);class o{constructor(e){this.savedPayloads=e}}class s{constructor(e,t){this.payloads=e,this.receiver=t}run(){return e=this,t=void 0,s=function*(){const e=this.payloads.map((e=>(0,r.CreateOfflineSyncSavedPayload)(e))),t=new o(e);yield this.receiver(i._.Response,t)},new((n=void 0)||(n=Promise))((function(r,i){function o(e){try{l(s.next(e))}catch(e){i(e)}}function a(e){try{l(s.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((s=s.apply(e,t||[])).next())}));var e,t,n,s}}},60215:(e,t,n)=>{var r;n.d(t,{_:()=>r}),function(e){e[e.Response=1]="Response",e[e.StatusChanged=2]="StatusChanged"}(r||(r={}))},37486:(e,t,n)=>{n.d(t,{_:()=>m});var r=n(37185),i=n(87901),o=n(48671),s=n(43361),a=n(73822),l=n(60215),c=n(22325),u=n(55668),d=n(86999),h=n(82648);function p(e,t){if(e.deleted)return h.Result.ok(new c.DeletedPayload(Object.assign(Object.assign({},e),{content:void 0,deleted:!0}),t));if(null!=e.content)try{return h.Result.ok(new c.EncryptedPayload(Object.assign(Object.assign({},e),{items_key_id:e.items_key_id,content:e.content,deleted:!1,errorDecrypting:!1,waitingForKey:!1}),t))}catch(e){return h.Result.fail(JSON.stringify(e))}return h.Result.fail("Unhandled case in createPayloadFromRawItem")}var f=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};const g=[h.ContentType.TYPES.ItemsKey,h.ContentType.TYPES.KeySystemRootKey,h.ContentType.TYPES.KeySystemItemsKey,h.ContentType.TYPES.VaultListing,h.ContentType.TYPES.TrustedContact,h.ContentType.TYPES.UserPrefs,h.ContentType.TYPES.Component,h.ContentType.TYPES.Theme];class m extends u.wcN{constructor(e,t,n,r,i,o,s,a,l,c,u,d,h,p,f){super(f),this.itemManager=e,this.sessionManager=t,this.encryptionService=n,this.storageService=r,this.payloadManager=i,this.apiService=o,this.historyService=s,this.device=a,this.identifier=l,this.options=c,this.logger=u,this.sockets=d,this.syncFrequencyGuard=h,this.syncBackoffService=p,this.internalEventBus=f,this.outOfSync=!1,this.resolveQueue=[],this.spawnQueue=[],this.completedOnlineDownloadFirstSync=!1,this.majorChangeThreshold=15,this.clientLocked=!1,this.databaseLoaded=!1,this.syncLock=!1,this.dealloced=!1,this.wasNotifiedOfItemsChangeOnServer=!1,this.opStatus=this.initializeStatus()}onNewDatabaseCreated(){return f(this,void 0,void 0,(function*(){(yield this.getLastSyncToken())&&(yield this.clearSyncPositionTokens())}))}get launchPriorityUuids(){var e;return null!==(e=this.storageService.getValue(u.QtK.LaunchPriorityUuids))&&void 0!==e?e:[]}setLaunchPriorityUuids(e){this.storageService.setValue(u.QtK.LaunchPriorityUuids,e)}deinit(){this.dealloced=!0,this.autoSyncInterval&&clearInterval(this.autoSyncInterval),this.autoSyncInterval=void 0,this.sessionManager=void 0,this.itemManager=void 0,this.encryptionService=void 0,this.payloadManager=void 0,this.storageService=void 0,this.apiService=void 0,this.opStatus.reset(),this.opStatus=void 0,this.resolveQueue.length=0,this.spawnQueue.length=0,super.deinit()}initializeStatus(){return new u.BUK(setInterval,(e=>{this.notifyEvent(e)}))}lockSyncing(){this.clientLocked=!0}unlockSyncing(){this.clientLocked=!1}isOutOfSync(){return this.outOfSync}getLastSyncDate(){return this.lastSyncDate}getSyncStatus(){return this.opStatus}resetSyncState(){this.dirtyIndexAtLastPresyncSave=void 0,this.lastSyncDate=void 0,this.outOfSync=!1}isDatabaseLoaded(){return this.databaseLoaded}processPriorityItemsForDatabaseLoad(e){return f(this,void 0,void 0,(function*(){if(0===e.length)return;const t=e.filter(c.isEncryptedPayload),n=e.filter(c.isDecryptedPayload),r=(0,d.xg)(t),i=(0,d.nJ)(r),o=yield this.encryptionService.decryptSplit(i);yield this.payloadManager.emitPayloads([...n,...o],c.PayloadEmitSource.LocalDatabaseLoaded)}))}loadDatabasePayloads(){return f(this,void 0,void 0,(function*(){if(this.logger.debug("Loading database payloads"),this.databaseLoaded)throw"Attempting to initialize already initialized local database.";const e=yield this.device.getDatabaseLoadChunks({batchSize:this.options.loadBatchSize,contentTypePriority:g,uuidPriority:this.launchPriorityUuids},this.identifier),t=(0,u.Or9)(e)?e.fullEntries.itemsKeys.entries:yield this.device.getDatabaseEntries(this.identifier,e.keys.itemsKeys.keys),n=(0,u.Or9)(e)?e.fullEntries.keySystemRootKeys.entries:yield this.device.getDatabaseEntries(this.identifier,e.keys.keySystemRootKeys.keys),r=(0,u.Or9)(e)?e.fullEntries.keySystemItemsKeys.entries:yield this.device.getDatabaseEntries(this.identifier,e.keys.keySystemItemsKeys.keys),o=e=>{try{return(0,c.CreatePayload)(e,c.PayloadSource.LocalDatabaseLoaded)}catch(e){return void console.error("Creating payload failed",e)}};yield this.processPriorityItemsForDatabaseLoad(t.map(o).filter(i.isNotUndefined)),yield this.processPriorityItemsForDatabaseLoad(n.map(o).filter(i.isNotUndefined)),yield this.processPriorityItemsForDatabaseLoad(r.map(o).filter(i.isNotUndefined));const s=e.remainingChunksItemCount;let a=0;const l=(0,u.Or9)(e)?e.fullEntries.remainingChunks:e.keys.remainingChunks;let d=0;for(const e of l){const t=((0,u.ufS)(e)?e.entries:yield this.device.getDatabaseEntries(this.identifier,e.keys)).map((e=>{try{return(0,c.CreatePayload)(e,c.PayloadSource.LocalDatabaseLoaded)}catch(e){return void console.error("Creating payload failed",e)}})).filter(i.isNotUndefined);yield this.processPayloadBatch(t,a,s),d>0&&(yield(0,i.sleep)(this.options.sleepBetweenBatches,!1,"Sleeping to allow interface to update")),a+=t.length,d++}this.databaseLoaded=!0,this.opStatus.setDatabaseLoadStatus(0,0,!0)}))}beginAutoSyncTimer(){this.autoSyncInterval=setInterval(this.autoSync.bind(this),3e4)}autoSync(){if(!this.sockets.isWebSocketConnectionOpen())return this.logger.debug("WebSocket connection is closed, doing autosync"),void this.sync({sourceDescription:"Auto Sync"});this.wasNotifiedOfItemsChangeOnServer&&(this.logger.debug("Was notified of items changed on server, doing autosync"),this.wasNotifiedOfItemsChangeOnServer=!1,this.sync({sourceDescription:"WebSockets Event - Items Changed On Server"}))}processPayloadBatch(e,t,n){return f(this,void 0,void 0,(function*(){this.logger.debug("Processing batch at index",t,"length",e.length);const r=[],i=[];for(const t of e)(0,c.isEncryptedPayload)(t)?r.push(t):i.push(t);const o=(0,d.xg)(r),s=(0,d.nJ)(o),a=yield this.encryptionService.decryptSplit(s);yield this.payloadManager.emitPayloads([...i,...a],c.PayloadEmitSource.LocalDatabaseLoaded),this.notifyEvent(u.wMo.LocalDataIncrementalLoad),null!=t&&null!=n&&this.opStatus.setDatabaseLoadStatus(t,n,!1)}))}setLastSyncToken(e){return this.syncToken=e,this.storageService.setValue(u.QtK.LastSyncToken,e)}setPaginationToken(e){return f(this,void 0,void 0,(function*(){return this.cursorToken=e,e?this.storageService.setValue(u.QtK.PaginationToken,e):this.storageService.removeValue(u.QtK.PaginationToken)}))}getLastSyncToken(){return f(this,void 0,void 0,(function*(){return this.syncToken||(this.syncToken=yield this.storageService.getValue(u.QtK.LastSyncToken)),this.syncToken}))}getPaginationToken(){return f(this,void 0,void 0,(function*(){return this.cursorToken||(this.cursorToken=yield this.storageService.getValue(u.QtK.PaginationToken)),this.cursorToken}))}clearSyncPositionTokens(){return f(this,void 0,void 0,(function*(){this.syncToken=void 0,this.cursorToken=void 0,yield this.storageService.removeValue(u.QtK.LastSyncToken),yield this.storageService.removeValue(u.QtK.PaginationToken)}))}itemsNeedingSync(){return this.itemManager.getDirtyItems().filter((e=>!this.syncBackoffService.isItemInBackoff(e)))}markAllItemsAsNeedingSyncAndPersist(){return f(this,void 0,void 0,(function*(){this.logger.debug("Marking all items as needing sync");const e=this.itemManager.items.map((e=>new c.DecryptedPayload(Object.assign(Object.assign({},e.payload.ejected()),{dirty:!0,dirtyIndex:(0,c.getIncrementedDirtyIndex)()}))));yield this.payloadManager.emitPayloads(e,c.PayloadEmitSource.LocalChanged),yield this.persistPayloads(e,{throwError:!1})}))}popPayloadsNeedingPreSyncSave(e){const t=this.dirtyIndexAtLastPresyncSave;if(null==t)return e;const n=e.filter((e=>!e.dirtyIndex||e.dirtyIndex>t));return this.dirtyIndexAtLastPresyncSave=(0,c.getCurrentDirtyIndex)(),n}queueStrategyResolveOnNext(){return new Promise(((e,t)=>{this.resolveQueue.push({resolve:e,reject:t})}))}queueStrategyForceSpawnNew(e){return new Promise(((t,n)=>{this.spawnQueue.push({resolve:t,reject:n,options:e})}))}popSpawnQueue(){if(0===this.spawnQueue.length)return null;const e=this.spawnQueue[0];return(0,i.removeFromIndex)(this.spawnQueue,0),this.logger.debug("Syncing again from spawn queue"),this.sync(Object.assign({queueStrategy:u.Sii.ForceSpawnNew,source:u.Lbd.SpawnQueue},e.options)).then((()=>{e.resolve()})).catch((()=>{e.reject()}))}payloadsByPreparingForServer(e){return f(this,void 0,void 0,(function*(){const t=(0,c.CreatePayloadSplit)(e),n=(0,d.xg)(t.decrypted),r=(0,d.Ak)(n);return[...(yield this.encryptionService.encryptSplit(r)).map(c.CreateEncryptedServerSyncPushPayload),...t.deleted.map(c.CreateDeletedServerSyncPushPayload)]}))}downloadFirstSync(e,t){return f(this,void 0,void 0,(function*(){for(let n=0;n<5;n++){if(yield this.sync(Object.assign({mode:u.YCg.DownloadFirst,queueStrategy:u.Sii.ForceSpawnNew,source:u.Lbd.External},t)).catch(console.error),this.completedOnlineDownloadFirstSync)return;yield(0,i.sleep)(e)}console.error("Failed downloadFirstSync after ".concat(5," tries"))}))}awaitCurrentSyncs(){return f(this,void 0,void 0,(function*(){yield this.lastSyncInvokationPromise,yield this.currentSyncRequestPromise}))}sync(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return f(this,void 0,void 0,(function*(){if(this.clientLocked)return void this.logger.debug("Sync locked by client");const t=Object.assign({source:u.Lbd.External},e);return this.lastSyncInvokationPromise=this.performSync(t),this.lastSyncInvokationPromise}))}prepareForSync(e){return f(this,void 0,void 0,(function*(){const t=this.itemsNeedingSync(),n=new Date,r=(0,c.getCurrentDirtyIndex)(),o=t.filter((e=>e.neverSynced&&(0,c.isDeletedItem)(e)));(0,i.subtractFromArray)(t,o);const s=t.map((e=>e.payloadRepresentation())),a=this.popPayloadsNeedingPreSyncSave(s),l=e.mode===u.YCg.DownloadFirst;return yield this.persistPayloads(a,{throwError:!l}),e.onPresyncSave&&e.onPresyncSave(),{items:t,beginDate:n,frozenDirtyIndex:r,neverSyncedDeleted:o}}))}configureSyncLock(e){const t=this.opStatus.syncInProgress,n=this.databaseLoaded,r=!this.syncLock,i=this.syncFrequencyGuard.isSyncCallsThresholdReachedThisMinute(),o=r&&n&&!t&&!i;return o?this.syncLock=!0:this.logger.debug(r?t?"Attempting to sync while existing sync in progress.":"Attempting to sync before local database has loaded.":"Another function call has begun preparing for sync.",e),{shouldExecuteSync:o,releaseLock:()=>{this.syncLock=!1}}}deferSyncRequest(e){const t=(0,i.isNullOrUndefined)(e.queueStrategy)?u.Sii.ResolveOnNext:e.queueStrategy;if(t===u.Sii.ResolveOnNext)return this.queueStrategyResolveOnNext();if(t===u.Sii.ForceSpawnNew)return this.queueStrategyForceSpawnNew(e);throw Error("Unhandled timing strategy")}prepareForSyncExecution(e,t,n,r){return f(this,void 0,void 0,(function*(){return this.opStatus.setDidBegin(),yield this.notifyEvent(u.wMo.SyncDidBeginProcessing),(0,i.subtractFromArray)(this.resolveQueue,t),e.length>0?this.setLastSyncBeganForItems(e,n,r):e}))}setLastSyncBeganForItems(e,t,n){return f(this,void 0,void 0,(function*(){const r=(0,i.Uuids)(e),o=this.itemManager.getCollection().findAll(r).filter(c.isDecryptedOrDeletedItem),s=[];for(const e of o){const r=new c.ItemMutator(e,c.MutationType.NonDirtying);r.setBeginSync(t,n);const i=r.getResult();s.push(i)}return yield this.payloadManager.emitPayloads(s,c.PayloadEmitSource.PreSyncSave),this.itemManager.findAnyItems(r)}))}getPendingRequestsMadeInTimeToPiggyBackOnCurrentRequest(){return this.resolveQueue.slice()}getOfflineSyncParameters(e){return{uploadPayloads:(arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.YCg.Default)===u.YCg.Default?e:[]}}createOfflineSyncOperation(e,t){return this.logger.debug("Syncing offline user","source:",u.Lbd[t.source],"sourceDesc",t.sourceDescription,"mode:",t.mode&&u.YCg[t.mode],"payloads:",e),new o.B(e,((e,t)=>f(this,void 0,void 0,(function*(){this.dealloced||e===l._.Response&&t&&(yield this.handleOfflineResponse(t))}))))}getOnlineSyncParameters(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.YCg.Default;return f(this,void 0,void 0,(function*(){const n=this.completedOnlineDownloadFirstSync?t:u.YCg.DownloadFirst;if(n===u.YCg.Default&&!this.completedOnlineDownloadFirstSync)throw Error("Attempting to default mode sync without having completed initial.");return{uploadPayloads:n===u.YCg.Default?yield this.payloadsByPreparingForServer(e):[],syncMode:n}}))}createServerSyncOperation(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.YCg.Default;return f(this,void 0,void 0,(function*(){const i=t.sharedVaultUuids&&t.sharedVaultUuids.length>0&&t.syncSharedVaultsFromScratch?void 0:yield this.getLastSyncToken(),o=t.sharedVaultUuids&&t.syncSharedVaultsFromScratch?void 0:yield this.getPaginationToken(),s=new r.U(e,((e,t,n)=>f(this,void 0,void 0,(function*(){switch(e){case l._.Response:if(this.dealloced)return;(null==t?void 0:t.hasError)?this.handleErrorServerResponse(t):t&&(yield this.handleSuccessServerResponse(s,t));break;case l._.StatusChanged:n&&this.opStatus.setUploadStatus(n.completedUploadCount,n.totalUploadCount)}}))),this.apiService,{syncToken:i,paginationToken:o,sharedVaultUuids:t.sharedVaultUuids});return this.logger.debug("Syncing online user","source",u.Lbd[t.source],"operation id",s.id,"integrity check",t.checkIntegrity,"mode",u.YCg[n],"syncToken",i,"cursorToken",o,"payloads",e),s}))}createSyncOperation(e,t,n){return f(this,void 0,void 0,(function*(){if(t){const{uploadPayloads:t,syncMode:r}=yield this.getOnlineSyncParameters(e,n.mode);return{operation:yield this.createServerSyncOperation(t,n,r),mode:r}}{const{uploadPayloads:t}=this.getOfflineSyncParameters(e,n.mode);return{operation:this.createOfflineSyncOperation(t,n),mode:n.mode||u.YCg.Default}}}))}performSync(e){return f(this,void 0,void 0,(function*(){const{shouldExecuteSync:t,releaseLock:n}=this.configureSyncLock(e),{items:r,beginDate:i,frozenDirtyIndex:o,neverSyncedDeleted:s}=yield this.prepareForSync(e);if(e.mode===u.YCg.LocalOnly)return this.logger.debug("Syncing local only, skipping remote sync request"),void n();const a=this.getPendingRequestsMadeInTimeToPiggyBackOnCurrentRequest();if(!t)return this.deferSyncRequest(e);if(this.dealloced)return;const l=yield this.prepareForSyncExecution(r,a,i,o),c=this.sessionManager.online(),{operation:d,mode:h}=yield this.createSyncOperation(l.map((e=>e.payloadRepresentation())),c,e),p=d.run();if(this.currentSyncRequestPromise=p,yield p,this.dealloced)return;n();const{hasError:f}=yield this.handleSyncOperationFinish(d,e,s,h);f||(yield this.potentiallySyncAgainAfterSyncCompletion(h,e,a,c))||(e.checkIntegrity&&c&&(yield this.notifyEventSync(u.wMo.SyncRequestsIntegrityCheck,{source:e.source})),yield this.notifyEventSync(u.wMo.SyncCompletedWithAllItemsUploadedAndDownloaded,{source:e.source,options:e}),this.resolvePendingSyncRequestsThatMadeItInTimeOfCurrentRequest(a))}))}getRawSyncRequestForExternalUse(e){return f(this,void 0,void 0,(function*(){if(this.dealloced)return;if(!this.sessionManager.online())return;const t=yield this.payloadsByPreparingForServer(e.map((e=>e.payloadRepresentation()))),n=yield this.getLastSyncToken(),r=yield this.getPaginationToken();return this.apiService.getSyncHttpRequest(t,n,r,150)}))}handleOfflineResponse(e){return f(this,void 0,void 0,(function*(){this.logger.debug("Offline Sync Response",e);const t=this.payloadManager.getMasterCollection(),n=new c.DeltaOfflineSaved(t,e.savedPayloads).result(),r=yield this.payloadManager.emitDeltaEmit(n);yield this.persistPayloads(r),this.opStatus.clearError(),yield this.notifyEvent(u.wMo.PaginatedSyncRequestCompleted,e)}))}handleErrorServerResponse(e){var t;this.logger.debug("Sync Error",e),401===e.status&&this.notifyEvent(u.wMo.InvalidSession),429===e.status&&this.notifyEvent(u.wMo.TooManyRequests),null===(t=this.opStatus)||void 0===t||t.setError(e.error),this.notifyEvent(u.wMo.SyncError,e)}handleSuccessServerResponse(e,t){return f(this,void 0,void 0,(function*(){this._simulate_latency&&(yield(0,i.sleep)(this._simulate_latency.latency)),this.opStatus.clearError(),this.opStatus.setDownloadStatus(t.retrievedPayloads.length);const n=this.payloadManager.getMasterCollection(),r=this.historyService.getHistoryMapCopy();t.userEvents&&t.userEvents.length>0&&(yield this.notifyEventSync(u.wMo.ReceivedNotifications,t.userEvents)),t.asymmetricMessages&&t.asymmetricMessages.length>0&&(yield this.notifyEventSync(u.wMo.ReceivedAsymmetricMessages,t.asymmetricMessages)),t.vaults&&t.vaults.length>0&&(yield this.notifyEventSync(u.wMo.ReceivedRemoteSharedVaults,t.vaults)),t.vaultInvites&&t.vaultInvites.length>0&&(yield this.notifyEventSync(u.wMo.ReceivedSharedVaultInvites,t.vaultInvites));const o=new a.y({retrievedPayloads:yield this.processServerPayloads(t.retrievedPayloads,c.PayloadSource.RemoteRetrieved),savedPayloads:t.savedPayloads,conflicts:yield this.decryptServerConflicts(t.conflicts)},n,e.payloadsSavedOrSaving,r);this.logger.debug("Online Sync Response","Operator ID",e.id,t.rawResponse.data,"Decrypted payloads",o.payloadSet);const s=o.result();for(const e of s){const t=yield this.payloadManager.emitDeltaEmit(e);yield this.persistPayloads(t)}e.options.sharedVaultUuids||(yield Promise.all([this.setLastSyncToken(t.lastSyncToken),this.setPaginationToken(t.paginationToken)])),yield this.notifyEvent(u.wMo.PaginatedSyncRequestCompleted,Object.assign(Object.assign({},t),{uploadedPayloads:e.payloads,options:e.options}))}))}decryptServerConflicts(e){return f(this,void 0,void 0,(function*(){const t={};for(const n of Object.keys(e)){const r=e[n];if(!r)continue;t[n]||(t[n]=[]);const i=t[n];if(!i)throw Error("Decrypted conflicts for type should exist");for(const e of r){const t=e.unsaved_item?yield this.processServerPayload(e.unsaved_item,c.PayloadSource.RemoteRetrieved):void 0,n=e.server_item?yield this.processServerPayload(e.server_item,c.PayloadSource.RemoteRetrieved):void 0,r={type:e.type,unsaved_item:t,server_item:n};i.push(r)}}return t}))}processServerPayload(e,t){return f(this,void 0,void 0,(function*(){return(yield this.processServerPayloads([e],t))[0]}))}processServerPayloads(e,t){return f(this,void 0,void 0,(function*(){const n=e.map((e=>{const n=p(e,t);return n.isFailed()?void 0:n.getValue()})).filter(i.isNotUndefined),{encrypted:r,deleted:o}=(0,c.CreateNonDecryptedPayloadSplit)(n),s=[...o],{rootKeyEncryption:a,itemsKeyEncryption:l,keySystemRootKeyEncryption:u}=(0,d.xg)(r),{results:h,map:f}=yield this.decryptServerItemsKeys(a||[]);(0,i.extendArray)(s,h);const{results:g,map:m}=yield this.decryptServerKeySystemItemsKeys(u||[]);if((0,i.extendArray)(s,g),l){const e=yield this.decryptProcessedServerPayloads(l,Object.assign(Object.assign({},f),m));(0,i.extendArray)(s,e)}return s}))}decryptServerItemsKeys(e){return f(this,void 0,void 0,(function*(){const t={};if(0===e.length)return{results:[],map:t};const n={usesRootKeyWithKeyLookup:{items:e}},r=yield this.encryptionService.decryptSplit(n);return r.forEach((e=>{(0,c.isDecryptedPayload)(e)&&e.content_type===h.ContentType.TYPES.ItemsKey&&(t[e.uuid]=e)})),{results:r,map:t}}))}decryptServerKeySystemItemsKeys(e){return f(this,void 0,void 0,(function*(){const t={};if(0===e.length)return{results:[],map:t};const n={usesKeySystemRootKeyWithKeyLookup:{items:e}},r=yield this.encryptionService.decryptSplit(n);return r.forEach((e=>{(0,c.isDecryptedPayload)(e)&&e.content_type===h.ContentType.TYPES.KeySystemItemsKey&&(t[e.uuid]=e)})),{results:r,map:t}}))}decryptProcessedServerPayloads(e,t){return f(this,void 0,void 0,(function*(){return Promise.all(e.map((e=>f(this,void 0,void 0,(function*(){const n=t[e.items_key_id],r=n?(0,c.CreateDecryptedItemFromPayload)(n):void 0,i={};return r?i.usesItemsKey={items:[e],key:r}:i.usesItemsKeyWithKeyLookup={items:[e]},this.encryptionService.decryptSplitSingle(i)})))))}))}handleSyncOperationFinish(e,t,n,i){return f(this,void 0,void 0,(function*(){return this.opStatus.setDidEnd(),this.opStatus.hasError()?{hasError:!0}:(this.opStatus.reset(),this.lastSyncDate=new Date,this.syncFrequencyGuard.incrementCallsPerMinute(),e instanceof r.U&&e.numberOfItemsInvolved>=this.majorChangeThreshold&&this.notifyEvent(u.wMo.MajorDataChange),n.length>0&&(yield this.handleNeverSyncedDeleted(n)),i!==u.YCg.DownloadFirst&&(yield this.notifyEvent(u.wMo.SyncCompletedWithAllItemsUploaded,{source:t.source})),{hasError:!1})}))}handleDownloadFirstCompletionAndSyncAgain(e,t){return f(this,void 0,void 0,(function*(){e&&(this.completedOnlineDownloadFirstSync=!0),yield this.notifyEvent(u.wMo.DownloadFirstSyncCompleted),yield this.sync({source:u.Lbd.AfterDownloadFirst,checkIntegrity:!0,awaitAll:t.awaitAll})}))}syncAgainByHandlingRequestsWaitingInResolveQueue(e){return f(this,void 0,void 0,(function*(){this.logger.debug("Syncing again from resolve queue");const t=this.sync({source:u.Lbd.ResolveQueue,checkIntegrity:e.checkIntegrity});e.awaitAll&&(yield t)}))}syncAgainByHandlingNewDirtyItems(e){return f(this,void 0,void 0,(function*(){yield this.sync({source:u.Lbd.MoreDirtyItems,checkIntegrity:e.checkIntegrity,awaitAll:e.awaitAll})}))}resolvePendingSyncRequestsThatMadeItInTimeOfCurrentRequest(e){for(const t of e)t.resolve()}potentiallySyncAgainAfterSyncCompletion(e,t,n,r){return f(this,void 0,void 0,(function*(){if(e===u.YCg.DownloadFirst)return yield this.handleDownloadFirstCompletionAndSyncAgain(r,t),this.resolvePendingSyncRequestsThatMadeItInTimeOfCurrentRequest(n),!0;const i=this.popSpawnQueue(),o=this.resolveQueue.length>0;return!i&&o?(yield this.syncAgainByHandlingRequestsWaitingInResolveQueue(t),this.resolvePendingSyncRequestsThatMadeItInTimeOfCurrentRequest(n),!0):this.itemsNeedingSync().length>0&&(yield this.syncAgainByHandlingNewDirtyItems(t),this.resolvePendingSyncRequestsThatMadeItInTimeOfCurrentRequest(n),!0)}))}handleNeverSyncedDeleted(e){return f(this,void 0,void 0,(function*(){const t=e.map((e=>e.payloadRepresentation({dirty:!1})));yield this.payloadManager.emitPayloads(t,c.PayloadEmitSource.LocalChanged),yield this.persistPayloads(t)}))}persistPayloads(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{throwError:!0};return f(this,void 0,void 0,(function*(){if(0!==e.length&&!this.dealloced)return this.storageService.savePayloads(e).catch((e=>{t.throwError&&(this.notifyEvent(u.wMo.DatabaseWriteError,e),s.W.error(e))}))}))}setInSync(e){e!==!this.outOfSync&&(e?(this.outOfSync=!1,this.notifyEvent(u.wMo.ExitOutOfSync)):(this.outOfSync=!0,this.notifyEvent(u.wMo.EnterOutOfSync)))}handleEvent(e){return f(this,void 0,void 0,(function*(){switch(e.type){case u.ezr.IntegrityCheckCompleted:yield this.handleIntegrityCheckEventResponse(e.payload);break;case u.fAX.ItemsChangedOnServer:this.wasNotifiedOfItemsChangeOnServer=!0}}))}handleIntegrityCheckEventResponse(e){return f(this,void 0,void 0,(function*(){const t=e.rawPayloads;if(0===t.length)return void this.setInSync(!0);const n=(0,c.FilterDisallowedRemotePayloadsAndMap)(t).filtered.map((e=>{const t=p(e,c.PayloadSource.RemoteRetrieved);if(!t.isFailed())return t.getValue()})).filter(i.isNotUndefined),r=(0,c.CreateNonDecryptedPayloadSplit)(n),o=(0,d.xg)(r.encrypted),s=(0,d.nJ)(o),a=yield this.encryptionService.decryptSplit(s);this.setInSync(!1),yield this.emitOutOfSyncRemotePayloads([...a,...r.deleted]);const l=e.source!==u.Lbd.ResolveOutOfSync;yield this.sync({checkIntegrity:l,source:u.Lbd.ResolveOutOfSync})}))}emitOutOfSyncRemotePayloads(e){return f(this,void 0,void 0,(function*(){const t=new c.DeltaOutOfSync(this.payloadManager.getMasterCollection(),c.ImmutablePayloadCollection.WithPayloads(e),this.historyService.getHistoryMapCopy()).result();yield this.payloadManager.emitDeltaEmit(t),yield this.persistPayloads(t.emits)}))}syncSharedVaultsFromScratch(e){return f(this,void 0,void 0,(function*(){yield this.sync({sharedVaultUuids:e,syncSharedVaultsFromScratch:!0,queueStrategy:u.Sii.ForceSpawnNew,awaitAll:!0})}))}ut_setDatabaseLoaded(e){this.databaseLoaded=e}ut_clearLastSyncDate(){this.lastSyncDate=void 0}ut_beginLatencySimulator(e){this._simulate_latency={latency:e||1e3,enabled:!0}}ut_endLatencySimulator(){this._simulate_latency=void 0}}},91096:(e,t,n)=>{n.d(t,{U8:()=>M.U,bQ:()=>r.b,Jg:()=>m.Jg,h6:()=>m.h6,IX:()=>u,ne:()=>d.n,ap:()=>h.a,PJ:()=>p.P,yW:()=>f.y,SV:()=>g.S,ql:()=>o.q,e5:()=>j.e,kq:()=>y.k,EO:()=>v.E,A:()=>A.A,D0:()=>b.D,Af:()=>i.A,o8:()=>w.o,aM:()=>a.aM,pY:()=>S.p,HK:()=>C.H,Sn:()=>a.Sn,Vu:()=>E.V,Bi:()=>R.B,nB:()=>s.n,Ot:()=>I.O,KJ:()=>_.y,Ps:()=>P,nT:()=>x.n,jg:()=>B,wJ:()=>m.wJ,Fi:()=>L.F,y0:()=>F.y,Sj:()=>a.Sj,gb:()=>N.g,Wz:()=>D.W,_U:()=>T._,jH:()=>M.j,Fr:()=>k.F,z4:()=>O.z});var r=n(19820),i=n(54911),o=n(78734),s=n(98361),a=n(53218),l=n(55668),c=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class u extends l.wcN{constructor(e,t){super(t),this.application=e,this.internalEventBus=t,this.addAppEventObserverAfterSubclassesFinishConstructing()}deinit(){this.application=void 0,this.unsubApp(),this.unsubApp=void 0,super.deinit()}addAppEventObserverAfterSubclassesFinishConstructing(){setTimeout((()=>{this.addAppEventObserver()}),0)}addAppEventObserver(){this.application.isStarted()&&this.onAppStart(),this.application.isLaunched()&&this.onAppLaunch(),this.unsubApp=this.application.addEventObserver((e=>c(this,void 0,void 0,(function*(){yield this.onAppEvent(e),e===l.n9K.Started?this.onAppStart():e===l.n9K.Launched?this.onAppLaunch():e===l.n9K.CompletedFullSync?this.onAppFullSync():e===l.n9K.CompletedIncrementalSync?this.onAppIncrementalSync():e===l.n9K.KeyStatusChanged&&this.onAppKeyChange()}))))}onAppEvent(e){return c(this,void 0,void 0,(function*(){}))}onAppStart(){return c(this,void 0,void 0,(function*(){}))}onAppLaunch(){return c(this,void 0,void 0,(function*(){}))}onAppKeyChange(){return c(this,void 0,void 0,(function*(){}))}onAppIncrementalSync(){}onAppFullSync(){}}var d=n(68625),h=n(59472),p=n(40278),f=n(74987),g=n(56297),m=n(20549),y=n(6314),v=n(29675),A=n(45447),b=n(80738),w=n(81679),S=n(3876),C=n(8740),E=n(28178),I=n(64892),_=n(30693),x=n(51271);const P=30;var k=n(97210);const B=[{valueInSeconds:k.F.OneMinute,label:"1 Minute"},{valueInSeconds:k.F.FiveMinutes,label:"5 Minutes"},{valueInSeconds:k.F.OneHour,label:"1 Hour"},{valueInSeconds:k.F.OneWeek,label:"1 Week"}];var O=n(17956),N=n(98116),D=n(15109),j=n(28559),T=n(37486),M=n(37185),F=n(73822),R=n(48671),L=n(87570)},52450:(e,t,n)=>{n.d(t,{e:()=>i});var r=n(20875);const i={Network:{Files:{FailedStartUploadSession:"Failed to start an upload session.",FailedCloseUploadSession:"Failed to close an upload session.",FailedUploadFileChunk:"Failed to upload file chunk.",FailedDownloadFileChunk:"Failed to download file chunk.",FailedDeleteFile:"Failed to delete file."}},Confirm:{ProtocolVersionExpired(e){var t;return{Message:"The encryption version for your account is outdated and requires upgrade. You may proceed with login, but are advised to perform a security update using the web or desktop application.\n\n"+"If your account was created after ".concat(null===(t=r.ProtocolExpirationDates[e])||void 0===t?void 0:t.toLocaleString(),", it may not be safe to continue signing in. ")+"In that case, please discontinue your sign in request and contact support.\n\nFor more information, visit standardnotes.com/help/security.",Title:"Update Recommended",ConfirmButton:"Sign In"}}}}},34146:(e,t,n)=>{var r;n.d(t,{M:()=>r}),function(e){e.Api="https://api.standardnotes.com",e.WebSocket="wss://sockets.standardnotes.com"}(r||(r={}))},94986:(e,t,n)=>{n.d(t,{D8:()=>l,DU:()=>o,Oq:()=>s,in:()=>i,jV:()=>a});var r=n(27374);const i="2.209.5",o="1.0.0",s="2.0.0";function a(e,t){return-1===l(e,t)}function l(e,t){return(0,r.eq)(e,t)?0:(0,r.gt)(e,t)?1:-1}},81346:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addYearsToDate=t.addMonthsToDate=t.addDaysToDate=t.addHoursToDate=void 0,t.addHoursToDate=function(e,t){const n=new Date(e);return n.setHours(n.getHours()+t),n},t.addDaysToDate=function(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n},t.addMonthsToDate=function(e,t){const n=new Date(e);return n.setMonth(n.getMonth()+t),n},t.addYearsToDate=function(e,t){const n=new Date(e);return n.setFullYear(n.getFullYear()+t),n}},90622:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Deferred=void 0,t.Deferred=()=>{let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return{resolve:e,reject:t,promise:n}}},75760:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DependencyContainer=void 0;const r=n(37225),i=n(75807);t.DependencyContainer=class{constructor(){this.factory=new Map,this.dependencies=new Map}deinit(){this.factory.clear();const e=this.getAll();for(const t of e)(0,i.isDeinitable)(t)&&t.deinit();this.dependencies.clear()}getAll(){return Array.from(this.dependencies.values()).filter(r.isNotUndefined)}bind(e,t){this.factory.set(e,t)}get(e){const t=this.dependencies.get(e);if(t)return t;const n=this.factory.get(e);if(!n)throw new Error("No dependency maker found for ".concat(e.toString()));const r=n();return r?(this.dependencies.set(e,r),r):void 0}}},75807:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.canBlockDeinit=t.isDeinitable=void 0,t.isDeinitable=function(e){if(!e)throw new Error("Service is undefined");return"function"==typeof e.deinit},t.canBlockDeinit=function(e){if(!e)throw new Error("Service is undefined");return"function"==typeof e.blockDeinit}},12377:(e,t)=>{function n(e){const t=/(?:\.([^.]+))$/.exec(e),n=(null==t?void 0:t[1])||"";return{name:e.includes(".")?e.substring(0,e.lastIndexOf(".")):e,ext:n}}function r(e){return e.trim().replace(/[.\\/:"?*|<>]/g,"_")}function i(e,t){return e.length>t?e.slice(0,t):e}Object.defineProperty(t,"__esModule",{value:!0}),t.parseAndCreateZippableFileName=t.createZippableFileName=t.truncateFileName=t.sanitizeFileName=t.parseFileName=void 0,t.parseFileName=n,t.sanitizeFileName=r,t.truncateFileName=i;function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"txt",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100;return i(r(e),o)+(t+".")+n}t.createZippableFileName=o,t.parseAndCreateZippableFileName=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const{name:r,ext:i}=n(e);return o(r,t,i)}},33638:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},91379:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=void 0;class n{constructor(e){this.appIdentifier=e,this.level="none"}canLog(e){if("none"===this.level)return!1;const t=["debug","info","warn","error"];return t.indexOf(e)>=t.indexOf(this.level)}setLevel(e){this.level=e}debug(e){if(this.canLog("debug")){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.logWithColor(e,...n)}}info(e){if(this.canLog("info")){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.logWithColor(e,...n)}}warn(e){if(this.canLog("warn")){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];console.warn(e,...n)}}error(e){if(this.canLog("error")){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];console.error(e,...n)}}logWithColor(){const e=new Date,t="".concat(e.toLocaleTimeString().replace(" PM","").replace(" AM",""),".").concat(e.getMilliseconds());for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];this.customLog("%c".concat(this.appIdentifier,"%c").concat(t),"color: font-weight: bold; margin-right: 4px","color: gray",...r)}customLog(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Function.prototype.apply.call(console.log,console,arguments)}}t.Logger=n,t.default=n},13777:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},47887:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.classNames=void 0;const r=n(37225);t.classNames=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.map((e=>"string"==typeof e?e:null)).filter(r.isNotUndefined).join(" ")}},92484:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=void 0,t.debounce=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var r,i;let o;const s=null!==(r=n.isImmediate)&&void 0!==r&&r,a=null!==(i=n.callback)&&void 0!==i&&i,l=n.maxWait;let c=Date.now(),u=[];const d=function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];const d=this;return new Promise(((n,i)=>{const h=s&&void 0===o;if(void 0!==o&&clearTimeout(o),o=setTimeout((function(){if(o=void 0,c=Date.now(),!s){const t=e.apply(d,r);a&&a(t),u.forEach((e=>{let{resolve:n}=e;return n(t)})),u=[]}}),function(){if(void 0!==l){const e=Date.now()-c;if(e+t>=l)return l-e}return t}()),h){const t=e.apply(d,r);return a&&a(t),n(t)}u.push({resolve:n,reject:i})}))};return d.cancel=function(e){void 0!==o&&clearTimeout(o),u.forEach((t=>{let{reject:n}=t;return n(e)})),u=[]},d}},37225:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.assertUnreachable=t.sleep=t.truncateHexString=t.hasGetter=t.isValidUrl=t.deepFreeze=t.pickByCopy=t.deepMerge=t.Copy=t.joinPaths=t.omitByCopy=t.omitInPlace=t.withoutLastElement=t.jsonParseEmbeddedKeys=t.topLevelCompare=t.dateSorted=t.omitUndefinedCopy=t.sortByKey=t.sortedCopy=t.objectToValueArray=t.arrayByRemovingFromIndex=t.addAtIndex=t.removeFromIndex=t.compareValues=t.compareArrayReferences=t.arrayByDifference=t.filterFromArray=t.addIfUnique=t.removeFromArray=t.subtractFromArray=t.extendArray=t.lastElement=t.uniqueArrayByKey=t.uniqueArray=t.uniqCombineObjArrays=t.greaterOfTwoDates=t.isString=t.isEmpty=t.isNotUndefined=t.isNullOrUndefined=t.isFunction=t.isObject=t.sureSearchArray=t.searchArray=t.findInArray=t.isReactNativeEnvironment=t.isWebCryptoAvailable=t.isWebEnvironment=t.dictToArray=t.getGlobalScope=void 0,t.pluralize=t.spaceSeparatedStrings=t.useBoolean=t.assert=t.logWithColor=t.log=t.secondHalfOfString=t.firstHalfOfString=t.splitString=t.nonSecureRandomIdentifier=t.dateToLocalizedString=t.sanitizeHtmlString=t.convertTimestampToMilliseconds=t.arraysEqual=t.naturalSort=t.isSameDay=void 0;const i=n(59154),o=n(84213),s="undefined"!=typeof Intl?new Intl.Collator("en",{numeric:!0}):void 0;function a(){return"undefined"!=typeof window?window:void 0!==n.g?n.g:null}function l(){return null!==a()}function c(){return"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function u(e,t){return(0,o.find)(e,t)}function d(e){return null!==e&&("function"==typeof e||"object"==typeof e)}function h(e){return null==e}function p(e,t){const n=e.indexOf(t);-1!==n&&e.splice(n,1)}function f(e,t){e.splice(t,1)}function g(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function m(e){return e instanceof Date?new Date(e):d(e)?JSON.parse(JSON.stringify(e)):e}var y;let v;function A(e,t){const n=new Date,r="".concat(n.toLocaleTimeString().replace(" PM","").replace(" AM",""),".").concat(n.getMilliseconds());for(var i=arguments.length,o=new Array(i>2?i-2:0),s=2;s<i;s++)o[s-2]=arguments[s];!function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Function.prototype.apply.call(console.log,console,arguments)}("%c".concat(e,"%c").concat(r),"color: ".concat(t,"; font-weight: bold; margin-right: 4px"),"color: gray",...o)}t.getGlobalScope=a,t.dictToArray=function(e){return Object.values(e)},t.isWebEnvironment=l,t.isWebCryptoAvailable=function(){return l()&&!c()&&!(document&&document.documentMode)||/Edge/.test(navigator.userAgent)&&window.crypto&&!!window.crypto.subtle},t.isReactNativeEnvironment=c,t.findInArray=function(e,t,n){return e.find((e=>e[t]===n))},t.searchArray=u,t.sureSearchArray=function(e,t){return u(e,t)},t.isObject=d,t.isFunction=function(e){return null!==e&&"function"==typeof e},t.isNullOrUndefined=h,t.isNotUndefined=function(e){return null!=e},t.isEmpty=function(e){return!e||0===e.length},t.isString=function(e){return"string"==typeof e||e instanceof String},t.greaterOfTwoDates=function(e,t){return e>t?e:t},t.uniqCombineObjArrays=function(e,t,n){return(0,o.uniqWith)(e.concat(t),((e,t)=>{for(const r of n)if(e[r]!==t[r])return!1;return!0}))},t.uniqueArray=function(e){return(0,o.uniq)(e)},t.uniqueArrayByKey=function(e,t){return(0,o.uniqWith)(e,((e,n)=>e[t]===n[t]))},t.lastElement=function(e){return e[e.length-1]},t.extendArray=function(e,t){for(const n of t)e.push(n)},t.subtractFromArray=function(e,t){for(const n of t)p(e,n)},t.removeFromArray=p,t.addIfUnique=function(e,t){return!e.includes(t)&&(e.push(t),!0)},t.filterFromArray=function(e,t){(0,o.remove)(e,t)},t.arrayByDifference=function(e,t){return e.filter((e=>!t.includes(e))).concat(t.filter((t=>!e.includes(t))))},t.compareArrayReferences=function(e,t){return e.length===t.length&&e.every(((e,n)=>e===t[n]))},t.compareValues=function(e,t){return!(e&&!t||!e&&t)&&(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():e instanceof String&&t instanceof String?e===t:g(e,t))},t.removeFromIndex=f,t.addAtIndex=function(e,t,n){e.splice(n,0,t)},t.arrayByRemovingFromIndex=function(e,t){const n=e.slice();return f(n,t),n},t.objectToValueArray=function(e){const t=[];for(const n of Object.keys(e))t.push(e[n]);return t},t.sortedCopy=function(e){const t=Object.keys(e).sort(),n={};for(const r of t)n[r]=e[r];return m(n)},t.sortByKey=(e,t)=>{const n=[...e];return n.sort(((e,n)=>{const r=e[t],i=n[t];return r<i?-1:r>i?1:0})),n},t.omitUndefinedCopy=function(e){const t={};for(const n of Object.keys(e))h(e[n])||(t[n]=e[n]);return t},t.dateSorted=function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return e.sort(((e,r)=>{const i=e[t].getTime(),o=r[t].getTime(),s=n?1:-1;return i<o?-1*s:i>o?1*s:0}))},t.topLevelCompare=g,t.jsonParseEmbeddedKeys=function(e){const t={};for(const n of Object.keys(e)){let r;try{r=JSON.parse(e[n])}catch(t){r=e[n]}t[n]=r}return t},t.withoutLastElement=e=>e.slice(0,-1),t.omitInPlace=function(e,t){if(e)for(const n of t)delete e[n]},t.omitByCopy=function(e,t){if(h(e))return;const n=Object.assign({},e);for(const e of t)delete n[e];return n},t.joinPaths=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.map(((e,t)=>0===t?e.trim().replace(/[/]*$/g,""):e.trim().replace(/(^[/]*|[/]*$)/g,""))).filter((e=>e.length)).join("/")},t.Copy=m,t.deepMerge=function(e,t){if(!e||!t)throw"Attempting to deepMerge with null values";return(0,o.mergeWith)(e,t,((e,t)=>{if((0,o.isArray)(e))return t})),e},t.pickByCopy=function(e,t){const n={};for(const r of t)n[r]=e[r];return m(n)},t.deepFreeze=function e(t){const n=Object.getOwnPropertyNames(t);for(const r of n){const n=t[r];n&&"object"==typeof n&&!Object.isFrozen(n)?t[r]=e(n):t[r]=n}return Object.freeze(t)},t.isValidUrl=function(e){try{return new URL(e),!0}catch(e){return!1}},t.hasGetter=function(e,t){const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t);return n&&!h(n.get)},t.truncateHexString=function(e,t){const n=t/4;return e.substring(0,n)},t.sleep=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return r(this,void 0,void 0,(function*(){return t&&console.warn("Sleeping for ".concat(e,"ms ").concat(n)),new Promise((t=>{setTimeout((function(){t()}),e)}))}))},t.assertUnreachable=function(e){throw Error("Unchecked case "+e)},t.isSameDay=function(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()},t.naturalSort=function(e,t){switch(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"asc"){case"asc":return[...e].sort(s?(e,n)=>s.compare(e[t],n[t]):(e,n)=>e[t].localeCompare(n[t],"en",{numeric:!0}));case"desc":return[...e].sort(s?(e,n)=>s.compare(n[t],e[t]):(e,n)=>n[t].localeCompare(e[t],"en",{numeric:!0}))}},t.arraysEqual=function(e,t){return e.length===t.length&&e.every((e=>t.includes(e)))&&t.every((t=>e.includes(t)))},function(e){e[e.Seconds=10]="Seconds",e[e.Milliseconds=13]="Milliseconds",e[e.Microseconds=16]="Microseconds"}(y||(y={})),t.convertTimestampToMilliseconds=function(e){switch(String(e).length){case y.Seconds:return 1e3*e;case y.Milliseconds:return e;case y.Microseconds:return Math.floor(e/1e3);default:throw"Unhandled timestamp precision: ".concat(e)}},t.sanitizeHtmlString=function(e){return(0,i.sanitize)(e)},t.dateToLocalizedString=function(e){if("undefined"!=typeof Intl&&Intl.DateTimeFormat&&"undefined"!=typeof navigator){if(!v){const e=navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.language;v=new Intl.DateTimeFormat(e,{year:"numeric",month:"short",day:"2-digit",weekday:"long",hour:"2-digit",minute:"2-digit"})}return v.format(e)}return e.toDateString()+" "+e.toLocaleTimeString()},t.nonSecureRandomIdentifier=function(){return"".concat(100*Math.random()).replace(".","")},t.splitString=function(e,t){const n=e.length/t,r=[];for(let i=0;i<t;i++){const t=e.slice(n*i,n*(i+1));r.push(t)}return r},t.firstHalfOfString=function(e){return e.substring(0,e.length/2)},t.secondHalfOfString=function(e){return e.substring(e.length/2,e.length)},t.log=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];A(e,"black",...n)},t.logWithColor=A,t.assert=function(e){if(void 0===e)throw new Error("Assertion failed; value must be defined")},t.useBoolean=function(e,t){return null!=e?e:t},t.spaceSeparatedStrings=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.join(" ")},t.pluralize=function(e,t,n){return 1===e?t:n}},49095:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Uuids=void 0,t.Uuids=function(e){return e.map((e=>e.uuid))}},57865:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UuidGenerator=void 0,t.UuidGenerator=class{static SetGenerator(e){this.syncUuidFunc=e}static GenerateUuid(){return this.syncUuidFunc()}}},28569:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UuidMap=void 0;const r=n(37225);class i{constructor(){this.directMap=new Map,this.inverseMap=new Map}get directMapSize(){return this.directMap.size}get inverseMapSize(){return this.inverseMap.size}makeCopy(){const e=new i;return e.directMap=new Map(this.directMap),e.inverseMap=new Map(this.inverseMap),e}existsInDirectMap(e){return this.directMap.has(e)}existsInInverseMap(e){return this.inverseMap.has(e)}getDirectRelationships(e){return this.directMap.get(e)||[]}getAllDirectKeys(){return Array.from(this.directMap.keys())}getInverseRelationships(e){return this.inverseMap.get(e)||[]}establishRelationship(e,t){this.establishDirectRelationship(e,t),this.establishInverseRelationship(e,t)}deestablishRelationship(e,t){this.deestablishDirectRelationship(e,t),this.deestablishInverseRelationship(e,t)}setAllRelationships(e,t){const n=this.directMap.get(e)||[];this.directMap.set(e,t);for(const t of n)this.deestablishInverseRelationship(e,t);for(const n of t)this.establishInverseRelationship(e,n)}removeFromMap(e){const t=this.directMap.get(e)||[];for(const n of t)(0,r.removeFromArray)(this.inverseMap.get(n)||[],e);this.directMap.delete(e);const n=this.inverseMap.get(e)||[];for(const t of n)(0,r.removeFromArray)(this.directMap.get(t)||[],e);this.inverseMap.delete(e)}establishDirectRelationship(e,t){const n=this.directMap.get(e)||[];(0,r.addIfUnique)(n,t),this.directMap.set(e,n)}establishInverseRelationship(e,t){const n=this.inverseMap.get(t)||[];(0,r.addIfUnique)(n,e),this.inverseMap.set(t,n)}deestablishDirectRelationship(e,t){const n=this.directMap.get(e)||[];(0,r.removeFromArray)(n,t),this.directMap.set(e,n)}deestablishInverseRelationship(e,t){const n=this.inverseMap.get(t)||[];(0,r.removeFromArray)(n,e),this.inverseMap.set(t,n)}}t.UuidMap=i},31800:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(81346),t),i(n(90622),t),i(n(75760),t),i(n(75807),t),i(n(91379),t),i(n(13777),t),i(n(33638),t),i(n(47887),t),i(n(92484),t),i(n(37225),t),i(n(49095),t),i(n(57865),t),i(n(28569),t),i(n(12377),t)},87901:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31800),t)}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var r={};return(()=>{n.r(r),n.d(r,{API_MESSAGE_CHANGE_CREDENTIALS_IN_PROGRESS:()=>w.WLG,API_MESSAGE_FAILED_ACCESS_PURCHASE:()=>w.gQA,API_MESSAGE_FAILED_CREATE_FILE_TOKEN:()=>w.qIx,API_MESSAGE_FAILED_DOWNLOADING_EXTENSION:()=>w.mvL,API_MESSAGE_FAILED_GET_SETTINGS:()=>w.Zq2,API_MESSAGE_FAILED_LISTED_REGISTRATION:()=>w.EaW,API_MESSAGE_FAILED_OFFLINE_ACTIVATION:()=>w.iMd,API_MESSAGE_FAILED_OFFLINE_FEATURES:()=>w.WZ6,API_MESSAGE_FAILED_SUBSCRIPTION_INFO:()=>w.BMD,API_MESSAGE_FAILED_UPDATE_SETTINGS:()=>w.oBV,API_MESSAGE_FALLBACK_LOGIN_FAIL:()=>w.aWs,API_MESSAGE_GENERIC_CHANGE_CREDENTIALS_FAIL:()=>w.Z15,API_MESSAGE_GENERIC_INTEGRITY_CHECK_FAIL:()=>w.oe5,API_MESSAGE_GENERIC_INVALID_LOGIN:()=>w.VpG,API_MESSAGE_GENERIC_REGISTRATION_FAIL:()=>w.Cj$,API_MESSAGE_GENERIC_SINGLE_ITEM_SYNC_FAIL:()=>w.TwN,API_MESSAGE_GENERIC_SYNC_FAIL:()=>w.gEn,API_MESSAGE_GENERIC_TOKEN_REFRESH_FAIL:()=>w.lO_,API_MESSAGE_INVALID_SESSION:()=>w.aXB,API_MESSAGE_LOGIN_IN_PROGRESS:()=>w.TYJ,API_MESSAGE_RATE_LIMITED:()=>w.jN7,API_MESSAGE_REGISTRATION_IN_PROGRESS:()=>w.vfv,API_MESSAGE_TOKEN_REFRESH_IN_PROGRESS:()=>w.z6z,API_MESSAGE_UNTRUSTED_EXTENSIONS_WARNING:()=>w.CV,AbstractService:()=>w.wcN,AcceptVaultInvite:()=>w.nmV,AccountEvent:()=>w.oF7,AccountSyncOperation:()=>c.U8,ActionsService:()=>c.bQ,AddAuthenticator:()=>s.fC,AlertService:()=>w.c9N,AllowedBatchContentTypes:()=>c.Jg,AllowedBatchStreaming:()=>c.h6,ApiServiceEvent:()=>w.Sf$,AppleIAPProductId:()=>w.mxT,ApplicationEvent:()=>w.n9K,ApplicationGroupEvent:()=>i.$,ApplicationOptionsDefaults:()=>w.U3K,ApplicationService:()=>c.IX,ApplicationStage:()=>w.Ugm,AsymmetricMessageService:()=>w.WXh,AuthManager:()=>w.El,AuthenticatorManager:()=>w.F8w,AuthorizeVaultDeletion:()=>w.D$B,BackupFileType:()=>m.qX,BaseMigration:()=>l._r,ButtonType:()=>w.L$3,ByteChunker:()=>v.M1,CHANGING_PASSCODE:()=>w.V1G,Challenge:()=>w.tv4,ChallengeKeyboardType:()=>w.gqK,ChallengeModalTitle:()=>w.GnZ,ChallengeOperation:()=>c.ne,ChallengePrompt:()=>w.FEo,ChallengePromptTitle:()=>w.fD2,ChallengeReason:()=>w.Ps8,ChallengeResponse:()=>c.ap,ChallengeService:()=>c.PJ,ChallengeStrings:()=>w.NiJ,ChallengeValidation:()=>w.tQn,ChangeAndSaveItem:()=>w.EdL,ChangeVaultKeyOptions:()=>w.tuB,ChangeVaultStorageMode:()=>w.KH1,ComponentManager:()=>c.yW,ComponentViewer:()=>c.SV,ComponentViewerError:()=>w.kQg,ComputePrivateUsername:()=>m.lx,ContactBelongsToVault:()=>w.euo,ContactService:()=>w.yqc,ContactServiceEvent:()=>w.EFn,ConvertToSharedVault:()=>w.b$E,Create001KeyParams:()=>m.Nv,Create002KeyParams:()=>m.H$,Create003KeyParams:()=>m.mU,Create004KeyParams:()=>m.ao,CreateAnyKeyParams:()=>m.jl,CreateChallengeValue:()=>w.KL0,CreateDecryptedBackupFile:()=>w.ocI,CreateDecryptionSplitWithKeyLookup:()=>m.nJ,CreateEncryptedBackupFile:()=>w.D6l,CreateEncryptionSplitWithKeyLookup:()=>m.Ak,CreateNewDefaultItemsKey:()=>w.Nwx,CreateNewItemsKeyWithRollback:()=>w.Yw,CreateNewRootKey:()=>m.C4,CreateOrEditContact:()=>w.Dk4,CreateSharedVault:()=>w.zEM,CreateVault:()=>w.TQm,CredentialsChangeStrings:()=>w.Y7C,DO_NOT_CLOSE_APPLICATION:()=>w.liL,DecryptBackupFile:()=>w.vV3,DecryptBackupPayloads:()=>w.ZXN,DecryptErroredPayloads:()=>w.eyx,DecryptErroredTypeAPayloads:()=>w.suI,DecryptItemsKeyByPromptingUser:()=>w.zW4,DecryptItemsKeyWithUserFallback:()=>w.nGw,DecryptMessage:()=>w.$M4,DecryptOwnMessage:()=>w.EQN,DecryptTypeAPayload:()=>w.gzl,DecryptTypeAPayloadWithKeyLookup:()=>w.qXV,DefaultHost:()=>u.M,DeinitMode:()=>w.CYv,DeinitSource:()=>w.u4P,DeleteAuthenticator:()=>s.cx,DeleteContact:()=>w.z8s,DeleteRevision:()=>s.gS,DeleteSharedVault:()=>w.KLn,DeleteThirdPartyVault:()=>w.jGD,DeleteVault:()=>w.Rws,DeprecatedHttpService:()=>c.ql,DesignateSurvivor:()=>w.X2V,DetermineKeyToUse:()=>w.WEs,DiscardItemsLocally:()=>w.Ydb,DiskStorageService:()=>c.e5,DownloadAndDecryptFileOperation:()=>v.BI,EXPIRED_PROTOCOL_VERSION:()=>w.R53,EditContact:()=>w.ZQj,EncryptAndUploadFileOperation:()=>v.y4,EncryptMessage:()=>w.S1n,EncryptTypeAPayload:()=>w.i6C,EncryptTypeAPayloadWithKeyLookup:()=>w.k6d,EncryptionOperators:()=>m.$l,EncryptionService:()=>w.C6q,EncryptionServiceEvent:()=>w.fa_,ErrorAlertStrings:()=>w.kov,FeatureStatus:()=>w.iKc,FeaturesEvent:()=>w.Usi,FeaturesService:()=>c.kq,FileBackupsConstantsV1:()=>v.yW,FileBackupsDirectoryName:()=>w.aax,FileDecryptor:()=>v.YT,FileDownloader:()=>v.VA,FileEncryptor:()=>v.IL,FileMemoryCache:()=>v.F9,FileService:()=>w.IpN,FileUploader:()=>v.bA,FilesBackupService:()=>w.exs,FillRootKeyContent:()=>m.FX,FindContact:()=>w.VD3,FindDefaultItemsKey:()=>w.iPu,FindPayloadInDecryptionSplit:()=>m.sP,FindPayloadInEncryptionSplit:()=>m.G6,GenerateUuid:()=>w.ug$,GetAllContacts:()=>w.s$_,GetAuthenticatorAuthenticationOptions:()=>s.VQ,GetAuthenticatorAuthenticationResponse:()=>s.FV,GetBackupFileType:()=>w.KCz,GetFilePassword:()=>w.DZq,GetHost:()=>w.cdY,GetInboundMessages:()=>w.Vxn,GetKeyPairs:()=>w.Byj,GetMessageAdditionalData:()=>w.qk9,GetOutboundMessages:()=>w.WUT,GetOwnedSharedVaults:()=>w.tlz,GetRecoveryCodes:()=>s.u2,GetRevision:()=>s.Xc,GetSharedVaults:()=>w.Tog,GetSortedPayloadsByPriority:()=>w.xOS,GetTrustedPayload:()=>w.pqE,GetUntrustedPayload:()=>w.P9M,GetVault:()=>w.dDs,GetVaultContacts:()=>w.bDv,GetVaultItems:()=>w.$qZ,GetVaultUsers:()=>w.PDt,GetVaults:()=>w.r0l,HandleKeyPairChange:()=>w.qjc,HandleRootKeyChangedMessage:()=>w.cjV,HistoryManager:()=>c.EO,HomeServerService:()=>w.tGH,INVALID_EXTENSION_URL:()=>w.$cH,INVALID_PASSWORD:()=>w.CVE,INVALID_PASSWORD_COST:()=>w.nIe,ImportData:()=>w.Ens,InMemoryStore:()=>w.CEH,InfoStrings:()=>w.l4I,InsufficientPasswordMessage:()=>w.Bw1,IntegrityEvent:()=>w.ezr,IntegrityService:()=>w.yim,InternalEventBus:()=>w.Ehg,InternalEventPublishStrategy:()=>w.WNP,InternalFeature:()=>w.KK4,InternalFeatureService:()=>w.BbS,InviteToVault:()=>w.RAe,IsApplicationUsingThirdPartyHost:()=>w.Y8x,IsReadonlyVaultMember:()=>w.hEi,IsVaultAdmin:()=>w.o1e,IsVaultOwner:()=>w.hjk,ItemManager:()=>c.A,ItemRelationshipDirection:()=>w.uMm,ItemSignatureValidationResult:()=>w.kNl,ItemsEncryptionService:()=>w.oQ4,ItemsKeyMutator:()=>m.tn,KeyMode:()=>w.UEW,KeyParamsFromApiResponse:()=>m.LW,KeyParamsOrigination:()=>h.KeyParamsOrigination,KeyRecoveryService:()=>c.D0,KeyRecoveryStrings:()=>m.fD,KeySystemItemsKey:()=>m.yv,KeySystemItemsKeyMutator:()=>m.NC,KeySystemKeyManager:()=>w.Pn4,KeychainRecoveryStrings:()=>w.mHn,LeaveVault:()=>w.Z7G,LegacyApiService:()=>c.Af,LegacyKeys1_0_0:()=>w.Icj,ListAuthenticators:()=>s.FL,ListRevisions:()=>s.GU,ListedService:()=>c.o8,LiveItem:()=>e.J5,LocalPrefKey:()=>w.dH$,MINIMUM_PASSWORD_LENGTH:()=>c.aM,MfaService:()=>c.pY,Migration2_0_15:()=>l.ly,Migration2_167_6:()=>l.wg,Migration2_168_6:()=>l.aL,Migration2_202_1:()=>l.od,Migration2_208_0:()=>l.Jb,Migration2_209_0:()=>l.Lp,Migration2_20_0:()=>l.kK,Migration2_36_0:()=>l.qW,Migration2_42_0:()=>l.Ni,Migration2_7_0:()=>l.pI,MigrationClasses:()=>l.R_,MigrationService:()=>c.HK,MissingAccountParams:()=>c.Sn,MobileUnlockTiming:()=>w.sNv,MoveItemsToVault:()=>w.cZu,MutatorService:()=>c.Vu,NonwrappedStorageKey:()=>w.cU9,NotificationService:()=>w.gqp,NotificationServiceEvent:()=>w.JQe,NotifyVaultUsersOfKeyRotation:()=>w.cVV,OUTDATED_PROTOCOL_ALERT_IGNORE:()=>w._Bl,OfflineSyncOperation:()=>c.Bi,OrderedByteChunker:()=>v.WE,Paths:()=>c.nB,PayloadManager:()=>c.Ot,PreferencesService:()=>c.KJ,PreferencesServiceEvent:()=>w.WZd,PreviousSnjsVersion1_0_0:()=>d.DU,PreviousSnjsVersion2_0_0:()=>d.Oq,ProcessAcceptedVaultInvite:()=>w.Klw,ProposedSecondsToDeferUILevelSessionExpirationDuringActiveInteraction:()=>c.Ps,ProtectionEvent:()=>w.Hh3,ProtectionService:()=>c.nT,ProtectionSessionDurations:()=>c.jg,ProtocolUpgradeStrings:()=>w.GUt,ProtocolVersionForKeyParams:()=>m.nx,REMOVING_PASSCODE:()=>w.vL5,RawStorageKey:()=>w.Bq2,ReactNativeToWebEvent:()=>o.Z,ReadwriteActions:()=>c.wJ,ReencryptTypeAItems:()=>w.HSp,RegisterStrings:()=>w.rc1,RemoveItemFromVault:()=>w.fF_,RemoveItemsFromMemory:()=>w.$sG,RemoveVaultMember:()=>w.YxU,ReplaceContactData:()=>w.xRL,ResendAllMessages:()=>w.HLD,ResendMessage:()=>w.IF$,ReuploadAllInvites:()=>w.F0Y,ReuploadInvite:()=>w.afr,ReuploadVaultInvites:()=>w.s7t,RevisionManager:()=>w.t9U,RootKeyManager:()=>w.wtP,RotateVaultKey:()=>w.PqX,SETTING_PASSCODE:()=>w.TpP,SNApplication:()=>e.UC,SNApplicationGroup:()=>i.R,SNItemsKey:()=>m.rU,SNLog:()=>a.W,SNProtocolOperator001:()=>m.d1,SNProtocolOperator002:()=>m.QR,SNProtocolOperator003:()=>m.Er,SNProtocolOperator004:()=>m.iN,SNRootKey:()=>m.t$,SNRootKeyParams:()=>m.Gw,SelfContactManager:()=>w.Ld1,SendMessage:()=>w.uzh,SendOwnContactChangeMessage:()=>w.u3X,SendVaultDataChangedMessage:()=>w.$SL,SendVaultInvite:()=>w.Iup,SendVaultKeyChangedMessage:()=>w.Foy,ServerErrorStrings:()=>w.VxG,ServerSyncResponse:()=>c.Fi,ServerSyncResponseResolver:()=>c.y0,SessionEvent:()=>w.Pxr,SessionManager:()=>c.Sj,SessionStrings:()=>w.K9E,SetHost:()=>w.q62,SettingsService:()=>c.gb,ShareContactWithVault:()=>w.uLb,SharedVaultService:()=>w.cnh,SharedVaultServiceEvent:()=>w.$_C,SignInStrings:()=>w.Mwm,SignInWithRecoveryCodes:()=>s.Y_,SingletonManager:()=>c.Wz,SnjsVersion:()=>d.in,SplitPayloadsByEncryptionType:()=>m.xg,StandardException:()=>m.KX,StaticItemCounter:()=>w.kNs,StatusService:()=>w.Bjn,StatusServiceEvent:()=>w.rW4,StorageKey:()=>w.QtK,StoragePersistencePolicies:()=>w.eIN,StorageValueModes:()=>w.qt7,StrictSignInFailed:()=>w.OC4,SubscriptionManager:()=>w.LF2,SubscriptionManagerEvent:()=>w.lKe,SyncBackoffService:()=>w.XEg,SyncEvent:()=>w.wMo,SyncLocalVaultsWithRemoteSharedVaults:()=>w._Jh,SyncMode:()=>w.YCg,SyncOpStatus:()=>w.BUK,SyncQueueStrategy:()=>w.Sii,SyncService:()=>c._U,SyncSource:()=>w.Lbd,SyncUpDownLimit:()=>c.jH,TYPES:()=>t.v,TextBackupsDirectoryName:()=>w.OU3,UNKNOWN_ERROR:()=>w.I4j,UNSUPPORTED_KEY_DERIVATION:()=>w.VnT,UNSUPPORTED_PROTOCOL_VERSION:()=>w.fnl,UPGRADING_ENCRYPTION:()=>w.RsP,UnprotectedAccessSecondsDuration:()=>c.Fr,UserService:()=>w.KDu,V001Algorithm:()=>m.xo,V002Algorithm:()=>m.$4,V003Algorithm:()=>m._0,V004Algorithm:()=>m.eC,ValidKeyParamsKeys:()=>m.Am,ValidateItemSigner:()=>w.Lv2,ValidateVaultPassword:()=>w.EGP,ValueModesKeys:()=>w.dDH,VaultInviteService:()=>w.hZp,VaultInviteServiceEvent:()=>w.Z$T,VaultLockService:()=>w.PHC,VaultLockServiceEvent:()=>w.h21,VaultService:()=>w.RDE,VaultServiceEvent:()=>w.ccW,VaultUserCache:()=>w.k7Z,VaultUserService:()=>w.igb,VaultUserServiceEvent:()=>w.UR5,WebAppEvent:()=>w.B5f,WebSocketsService:()=>w.BV4,WebSocketsServiceEvent:()=>w.fAX,applicationEventForSyncEvent:()=>e.ie,compareSemVersions:()=>d.D8,createOperatorForVersion:()=>m.ZP,deconstructEncryptedPayloadString:()=>m.UH,decryptPayload:()=>m.oO,doesPayloadRequireSigning:()=>m.qw,encryptPayload:()=>m.Gl,encryptedInputParametersFromPayload:()=>m.xi,environmentToString:()=>e.g,fileProgressToHumanReadableString:()=>v.Qc,isChunkFullEntry:()=>w.ufS,isComponentViewerItemReadonlyItem:()=>w.qr4,isDesktopDevice:()=>w.dse,isEnvironmentMobile:()=>e.Im,isEnvironmentWebOrDesktop:()=>e.Ak,isErrorDecryptingParameters:()=>m.XL,isFullEntryLoadChunkResponse:()=>w.Or9,isItemsKey:()=>m.dS,isKeySystemItemsKey:()=>m.mX,isMobileDevice:()=>w.s2G,isRightVersionGreaterThanLeft:()=>d.jV,isValidProtectionSessionLength:()=>c.z4,namespacedKey:()=>w.xLN,platformFromString:()=>e.FB,platformToString:()=>e._e,readAndDecryptBackupFileUsingBackupService:()=>v.mQ,readAndDecryptBackupFileUsingFileSystemAPI:()=>v.Qf});var e=n(85593),t=n(13979),i=n(58181),o=n(29159),s=n(67199),a=n(43361),l=n(90693),c=n(91096),u=n(34146),d=n(94986),h=n(20875),p=n(82648),f={};for(const e in p)["default","KeyParamsOrigination","LiveItem","SNApplication","applicationEventForSyncEvent","environmentToString","isEnvironmentMobile","isEnvironmentWebOrDesktop","platformFromString","platformToString","TYPES","ApplicationGroupEvent","SNApplicationGroup","ReactNativeToWebEvent","AddAuthenticator","DeleteAuthenticator","DeleteRevision","GetAuthenticatorAuthenticationOptions","GetAuthenticatorAuthenticationResponse","GetRecoveryCodes","GetRevision","ListAuthenticators","ListRevisions","SignInWithRecoveryCodes","SNLog","BaseMigration","Migration2_0_15","Migration2_167_6","Migration2_168_6","Migration2_202_1","Migration2_208_0","Migration2_209_0","Migration2_20_0","Migration2_36_0","Migration2_42_0","Migration2_7_0","MigrationClasses","AccountSyncOperation","ActionsService","AllowedBatchContentTypes","AllowedBatchStreaming","ApplicationService","ChallengeOperation","ChallengeResponse","ChallengeService","ComponentManager","ComponentViewer","DeprecatedHttpService","DiskStorageService","FeaturesService","HistoryManager","ItemManager","KeyRecoveryService","LegacyApiService","ListedService","MINIMUM_PASSWORD_LENGTH","MfaService","MigrationService","MissingAccountParams","MutatorService","OfflineSyncOperation","Paths","PayloadManager","PreferencesService","ProposedSecondsToDeferUILevelSessionExpirationDuringActiveInteraction","ProtectionService","ProtectionSessionDurations","ReadwriteActions","ServerSyncResponse","ServerSyncResponseResolver","SessionManager","SettingsService","SingletonManager","SyncService","SyncUpDownLimit","UnprotectedAccessSecondsDuration","isValidProtectionSessionLength","DefaultHost","PreviousSnjsVersion1_0_0","PreviousSnjsVersion2_0_0","SnjsVersion","compareSemVersions","isRightVersionGreaterThanLeft"].indexOf(e)<0&&(f[e]=()=>p[e]);n.d(r,f);var g=n(70781);f={};for(const e in g)["default","KeyParamsOrigination","LiveItem","SNApplication","applicationEventForSyncEvent","environmentToString","isEnvironmentMobile","isEnvironmentWebOrDesktop","platformFromString","platformToString","TYPES","ApplicationGroupEvent","SNApplicationGroup","ReactNativeToWebEvent","AddAuthenticator","DeleteAuthenticator","DeleteRevision","GetAuthenticatorAuthenticationOptions","GetAuthenticatorAuthenticationResponse","GetRecoveryCodes","GetRevision","ListAuthenticators","ListRevisions","SignInWithRecoveryCodes","SNLog","BaseMigration","Migration2_0_15","Migration2_167_6","Migration2_168_6","Migration2_202_1","Migration2_208_0","Migration2_209_0","Migration2_20_0","Migration2_36_0","Migration2_42_0","Migration2_7_0","MigrationClasses","AccountSyncOperation","ActionsService","AllowedBatchContentTypes","AllowedBatchStreaming","ApplicationService","ChallengeOperation","ChallengeResponse","ChallengeService","ComponentManager","ComponentViewer","DeprecatedHttpService","DiskStorageService","FeaturesService","HistoryManager","ItemManager","KeyRecoveryService","LegacyApiService","ListedService","MINIMUM_PASSWORD_LENGTH","MfaService","MigrationService","MissingAccountParams","MutatorService","OfflineSyncOperation","Paths","PayloadManager","PreferencesService","ProposedSecondsToDeferUILevelSessionExpirationDuringActiveInteraction","ProtectionService","ProtectionSessionDurations","ReadwriteActions","ServerSyncResponse","ServerSyncResponseResolver","SessionManager","SettingsService","SingletonManager","SyncService","SyncUpDownLimit","UnprotectedAccessSecondsDuration","isValidProtectionSessionLength","DefaultHost","PreviousSnjsVersion1_0_0","PreviousSnjsVersion2_0_0","SnjsVersion","compareSemVersions","isRightVersionGreaterThanLeft"].indexOf(e)<0&&(f[e]=()=>g[e]);n.d(r,f);var m=n(86999),y=n(80215);f={};for(const e in y)["default","KeyParamsOrigination","LiveItem","SNApplication","applicationEventForSyncEvent","environmentToString","isEnvironmentMobile","isEnvironmentWebOrDesktop","platformFromString","platformToString","TYPES","ApplicationGroupEvent","SNApplicationGroup","ReactNativeToWebEvent","AddAuthenticator","DeleteAuthenticator","DeleteRevision","GetAuthenticatorAuthenticationOptions","GetAuthenticatorAuthenticationResponse","GetRecoveryCodes","GetRevision","ListAuthenticators","ListRevisions","SignInWithRecoveryCodes","SNLog","BaseMigration","Migration2_0_15","Migration2_167_6","Migration2_168_6","Migration2_202_1","Migration2_208_0","Migration2_209_0","Migration2_20_0","Migration2_36_0","Migration2_42_0","Migration2_7_0","MigrationClasses","AccountSyncOperation","ActionsService","AllowedBatchContentTypes","AllowedBatchStreaming","ApplicationService","ChallengeOperation","ChallengeResponse","ChallengeService","ComponentManager","ComponentViewer","DeprecatedHttpService","DiskStorageService","FeaturesService","HistoryManager","ItemManager","KeyRecoveryService","LegacyApiService","ListedService","MINIMUM_PASSWORD_LENGTH","MfaService","MigrationService","MissingAccountParams","MutatorService","OfflineSyncOperation","Paths","PayloadManager","PreferencesService","ProposedSecondsToDeferUILevelSessionExpirationDuringActiveInteraction","ProtectionService","ProtectionSessionDurations","ReadwriteActions","ServerSyncResponse","ServerSyncResponseResolver","SessionManager","SettingsService","SingletonManager","SyncService","SyncUpDownLimit","UnprotectedAccessSecondsDuration","isValidProtectionSessionLength","DefaultHost","PreviousSnjsVersion1_0_0","PreviousSnjsVersion2_0_0","SnjsVersion","compareSemVersions","isRightVersionGreaterThanLeft","BackupFileType","ComputePrivateUsername","Create001KeyParams","Create002KeyParams","Create003KeyParams","Create004KeyParams","CreateAnyKeyParams","CreateDecryptionSplitWithKeyLookup","CreateEncryptionSplitWithKeyLookup","CreateNewRootKey","EncryptionOperators","FillRootKeyContent","FindPayloadInDecryptionSplit","FindPayloadInEncryptionSplit","ItemsKeyMutator","KeyParamsFromApiResponse","KeyRecoveryStrings","KeySystemItemsKey","KeySystemItemsKeyMutator","ProtocolVersionForKeyParams","SNItemsKey","SNProtocolOperator001","SNProtocolOperator002","SNProtocolOperator003","SNProtocolOperator004","SNRootKey","SNRootKeyParams","SplitPayloadsByEncryptionType","StandardException","V001Algorithm","V002Algorithm","V003Algorithm","V004Algorithm","ValidKeyParamsKeys","createOperatorForVersion","deconstructEncryptedPayloadString","decryptPayload","doesPayloadRequireSigning","encryptPayload","encryptedInputParametersFromPayload","isErrorDecryptingParameters","isItemsKey","isKeySystemItemsKey"].indexOf(e)<0&&(f[e]=()=>y[e]);n.d(r,f);var v=n(86311),A=n(22325);f={};for(const e in A)["default","KeyParamsOrigination","LiveItem","SNApplication","applicationEventForSyncEvent","environmentToString","isEnvironmentMobile","isEnvironmentWebOrDesktop","platformFromString","platformToString","TYPES","ApplicationGroupEvent","SNApplicationGroup","ReactNativeToWebEvent","AddAuthenticator","DeleteAuthenticator","DeleteRevision","GetAuthenticatorAuthenticationOptions","GetAuthenticatorAuthenticationResponse","GetRecoveryCodes","GetRevision","ListAuthenticators","ListRevisions","SignInWithRecoveryCodes","SNLog","BaseMigration","Migration2_0_15","Migration2_167_6","Migration2_168_6","Migration2_202_1","Migration2_208_0","Migration2_209_0","Migration2_20_0","Migration2_36_0","Migration2_42_0","Migration2_7_0","MigrationClasses","AccountSyncOperation","ActionsService","AllowedBatchContentTypes","AllowedBatchStreaming","ApplicationService","ChallengeOperation","ChallengeResponse","ChallengeService","ComponentManager","ComponentViewer","DeprecatedHttpService","DiskStorageService","FeaturesService","HistoryManager","ItemManager","KeyRecoveryService","LegacyApiService","ListedService","MINIMUM_PASSWORD_LENGTH","MfaService","MigrationService","MissingAccountParams","MutatorService","OfflineSyncOperation","Paths","PayloadManager","PreferencesService","ProposedSecondsToDeferUILevelSessionExpirationDuringActiveInteraction","ProtectionService","ProtectionSessionDurations","ReadwriteActions","ServerSyncResponse","ServerSyncResponseResolver","SessionManager","SettingsService","SingletonManager","SyncService","SyncUpDownLimit","UnprotectedAccessSecondsDuration","isValidProtectionSessionLength","DefaultHost","PreviousSnjsVersion1_0_0","PreviousSnjsVersion2_0_0","SnjsVersion","compareSemVersions","isRightVersionGreaterThanLeft","BackupFileType","ComputePrivateUsername","Create001KeyParams","Create002KeyParams","Create003KeyParams","Create004KeyParams","CreateAnyKeyParams","CreateDecryptionSplitWithKeyLookup","CreateEncryptionSplitWithKeyLookup","CreateNewRootKey","EncryptionOperators","FillRootKeyContent","FindPayloadInDecryptionSplit","FindPayloadInEncryptionSplit","ItemsKeyMutator","KeyParamsFromApiResponse","KeyRecoveryStrings","KeySystemItemsKey","KeySystemItemsKeyMutator","ProtocolVersionForKeyParams","SNItemsKey","SNProtocolOperator001","SNProtocolOperator002","SNProtocolOperator003","SNProtocolOperator004","SNRootKey","SNRootKeyParams","SplitPayloadsByEncryptionType","StandardException","V001Algorithm","V002Algorithm","V003Algorithm","V004Algorithm","ValidKeyParamsKeys","createOperatorForVersion","deconstructEncryptedPayloadString","decryptPayload","doesPayloadRequireSigning","encryptPayload","encryptedInputParametersFromPayload","isErrorDecryptingParameters","isItemsKey","isKeySystemItemsKey","ByteChunker","DownloadAndDecryptFileOperation","EncryptAndUploadFileOperation","FileBackupsConstantsV1","FileDecryptor","FileDownloader","FileEncryptor","FileMemoryCache","FileUploader","OrderedByteChunker","fileProgressToHumanReadableString","readAndDecryptBackupFileUsingBackupService","readAndDecryptBackupFileUsingFileSystemAPI"].indexOf(e)<0&&(f[e]=()=>A[e]);n.d(r,f);var b=n(95658);f={};for(const e in b)["default","KeyParamsOrigination","LiveItem","SNApplication","applicationEventForSyncEvent","environmentToString","isEnvironmentMobile","isEnvironmentWebOrDesktop","platformFromString","platformToString","TYPES","ApplicationGroupEvent","SNApplicationGroup","ReactNativeToWebEvent","AddAuthenticator","DeleteAuthenticator","DeleteRevision","GetAuthenticatorAuthenticationOptions","GetAuthenticatorAuthenticationResponse","GetRecoveryCodes","GetRevision","ListAuthenticators","ListRevisions","SignInWithRecoveryCodes","SNLog","BaseMigration","Migration2_0_15","Migration2_167_6","Migration2_168_6","Migration2_202_1","Migration2_208_0","Migration2_209_0","Migration2_20_0","Migration2_36_0","Migration2_42_0","Migration2_7_0","MigrationClasses","AccountSyncOperation","ActionsService","AllowedBatchContentTypes","AllowedBatchStreaming","ApplicationService","ChallengeOperation","ChallengeResponse","ChallengeService","ComponentManager","ComponentViewer","DeprecatedHttpService","DiskStorageService","FeaturesService","HistoryManager","ItemManager","KeyRecoveryService","LegacyApiService","ListedService","MINIMUM_PASSWORD_LENGTH","MfaService","MigrationService","MissingAccountParams","MutatorService","OfflineSyncOperation","Paths","PayloadManager","PreferencesService","ProposedSecondsToDeferUILevelSessionExpirationDuringActiveInteraction","ProtectionService","ProtectionSessionDurations","ReadwriteActions","ServerSyncResponse","ServerSyncResponseResolver","SessionManager","SettingsService","SingletonManager","SyncService","SyncUpDownLimit","UnprotectedAccessSecondsDuration","isValidProtectionSessionLength","DefaultHost","PreviousSnjsVersion1_0_0","PreviousSnjsVersion2_0_0","SnjsVersion","compareSemVersions","isRightVersionGreaterThanLeft","BackupFileType","ComputePrivateUsername","Create001KeyParams","Create002KeyParams","Create003KeyParams","Create004KeyParams","CreateAnyKeyParams","CreateDecryptionSplitWithKeyLookup","CreateEncryptionSplitWithKeyLookup","CreateNewRootKey","EncryptionOperators","FillRootKeyContent","FindPayloadInDecryptionSplit","FindPayloadInEncryptionSplit","ItemsKeyMutator","KeyParamsFromApiResponse","KeyRecoveryStrings","KeySystemItemsKey","KeySystemItemsKeyMutator","ProtocolVersionForKeyParams","SNItemsKey","SNProtocolOperator001","SNProtocolOperator002","SNProtocolOperator003","SNProtocolOperator004","SNRootKey","SNRootKeyParams","SplitPayloadsByEncryptionType","StandardException","V001Algorithm","V002Algorithm","V003Algorithm","V004Algorithm","ValidKeyParamsKeys","createOperatorForVersion","deconstructEncryptedPayloadString","decryptPayload","doesPayloadRequireSigning","encryptPayload","encryptedInputParametersFromPayload","isErrorDecryptingParameters","isItemsKey","isKeySystemItemsKey","ByteChunker","DownloadAndDecryptFileOperation","EncryptAndUploadFileOperation","FileBackupsConstantsV1","FileDecryptor","FileDownloader","FileEncryptor","FileMemoryCache","FileUploader","OrderedByteChunker","fileProgressToHumanReadableString","readAndDecryptBackupFileUsingBackupService","readAndDecryptBackupFileUsingFileSystemAPI"].indexOf(e)<0&&(f[e]=()=>b[e]);n.d(r,f);var w=n(55668),S=n(73606);f={};for(const e in S)["default","KeyParamsOrigination","LiveItem","SNApplication","applicationEventForSyncEvent","environmentToString","isEnvironmentMobile","isEnvironmentWebOrDesktop","platformFromString","platformToString","TYPES","ApplicationGroupEvent","SNApplicationGroup","ReactNativeToWebEvent","AddAuthenticator","DeleteAuthenticator","DeleteRevision","GetAuthenticatorAuthenticationOptions","GetAuthenticatorAuthenticationResponse","GetRecoveryCodes","GetRevision","ListAuthenticators","ListRevisions","SignInWithRecoveryCodes","SNLog","BaseMigration","Migration2_0_15","Migration2_167_6","Migration2_168_6","Migration2_202_1","Migration2_208_0","Migration2_209_0","Migration2_20_0","Migration2_36_0","Migration2_42_0","Migration2_7_0","MigrationClasses","AccountSyncOperation","ActionsService","AllowedBatchContentTypes","AllowedBatchStreaming","ApplicationService","ChallengeOperation","ChallengeResponse","ChallengeService","ComponentManager","ComponentViewer","DeprecatedHttpService","DiskStorageService","FeaturesService","HistoryManager","ItemManager","KeyRecoveryService","LegacyApiService","ListedService","MINIMUM_PASSWORD_LENGTH","MfaService","MigrationService","MissingAccountParams","MutatorService","OfflineSyncOperation","Paths","PayloadManager","PreferencesService","ProposedSecondsToDeferUILevelSessionExpirationDuringActiveInteraction","ProtectionService","ProtectionSessionDurations","ReadwriteActions","ServerSyncResponse","ServerSyncResponseResolver","SessionManager","SettingsService","SingletonManager","SyncService","SyncUpDownLimit","UnprotectedAccessSecondsDuration","isValidProtectionSessionLength","DefaultHost","PreviousSnjsVersion1_0_0","PreviousSnjsVersion2_0_0","SnjsVersion","compareSemVersions","isRightVersionGreaterThanLeft","BackupFileType","ComputePrivateUsername","Create001KeyParams","Create002KeyParams","Create003KeyParams","Create004KeyParams","CreateAnyKeyParams","CreateDecryptionSplitWithKeyLookup","CreateEncryptionSplitWithKeyLookup","CreateNewRootKey","EncryptionOperators","FillRootKeyContent","FindPayloadInDecryptionSplit","FindPayloadInEncryptionSplit","ItemsKeyMutator","KeyParamsFromApiResponse","KeyRecoveryStrings","KeySystemItemsKey","KeySystemItemsKeyMutator","ProtocolVersionForKeyParams","SNItemsKey","SNProtocolOperator001","SNProtocolOperator002","SNProtocolOperator003","SNProtocolOperator004","SNRootKey","SNRootKeyParams","SplitPayloadsByEncryptionType","StandardException","V001Algorithm","V002Algorithm","V003Algorithm","V004Algorithm","ValidKeyParamsKeys","createOperatorForVersion","deconstructEncryptedPayloadString","decryptPayload","doesPayloadRequireSigning","encryptPayload","encryptedInputParametersFromPayload","isErrorDecryptingParameters","isItemsKey","isKeySystemItemsKey","ByteChunker","DownloadAndDecryptFileOperation","EncryptAndUploadFileOperation","FileBackupsConstantsV1","FileDecryptor","FileDownloader","FileEncryptor","FileMemoryCache","FileUploader","OrderedByteChunker","fileProgressToHumanReadableString","readAndDecryptBackupFileUsingBackupService","readAndDecryptBackupFileUsingFileSystemAPI","API_MESSAGE_CHANGE_CREDENTIALS_IN_PROGRESS","API_MESSAGE_FAILED_ACCESS_PURCHASE","API_MESSAGE_FAILED_CREATE_FILE_TOKEN","API_MESSAGE_FAILED_DOWNLOADING_EXTENSION","API_MESSAGE_FAILED_GET_SETTINGS","API_MESSAGE_FAILED_LISTED_REGISTRATION","API_MESSAGE_FAILED_OFFLINE_ACTIVATION","API_MESSAGE_FAILED_OFFLINE_FEATURES","API_MESSAGE_FAILED_SUBSCRIPTION_INFO","API_MESSAGE_FAILED_UPDATE_SETTINGS","API_MESSAGE_FALLBACK_LOGIN_FAIL","API_MESSAGE_GENERIC_CHANGE_CREDENTIALS_FAIL","API_MESSAGE_GENERIC_INTEGRITY_CHECK_FAIL","API_MESSAGE_GENERIC_INVALID_LOGIN","API_MESSAGE_GENERIC_REGISTRATION_FAIL","API_MESSAGE_GENERIC_SINGLE_ITEM_SYNC_FAIL","API_MESSAGE_GENERIC_SYNC_FAIL","API_MESSAGE_GENERIC_TOKEN_REFRESH_FAIL","API_MESSAGE_INVALID_SESSION","API_MESSAGE_LOGIN_IN_PROGRESS","API_MESSAGE_RATE_LIMITED","API_MESSAGE_REGISTRATION_IN_PROGRESS","API_MESSAGE_TOKEN_REFRESH_IN_PROGRESS","API_MESSAGE_UNTRUSTED_EXTENSIONS_WARNING","AbstractService","AcceptVaultInvite","AccountEvent","AlertService","ApiServiceEvent","AppleIAPProductId","ApplicationEvent","ApplicationOptionsDefaults","ApplicationStage","AsymmetricMessageService","AuthManager","AuthenticatorManager","AuthorizeVaultDeletion","ButtonType","CHANGING_PASSCODE","Challenge","ChallengeKeyboardType","ChallengeModalTitle","ChallengePrompt","ChallengePromptTitle","ChallengeReason","ChallengeStrings","ChallengeValidation","ChangeAndSaveItem","ChangeVaultKeyOptions","ChangeVaultStorageMode","ComponentViewerError","ContactBelongsToVault","ContactService","ContactServiceEvent","ConvertToSharedVault","CreateChallengeValue","CreateDecryptedBackupFile","CreateEncryptedBackupFile","CreateNewDefaultItemsKey","CreateNewItemsKeyWithRollback","CreateOrEditContact","CreateSharedVault","CreateVault","CredentialsChangeStrings","DO_NOT_CLOSE_APPLICATION","DecryptBackupFile","DecryptBackupPayloads","DecryptErroredPayloads","DecryptErroredTypeAPayloads","DecryptItemsKeyByPromptingUser","DecryptItemsKeyWithUserFallback","DecryptMessage","DecryptOwnMessage","DecryptTypeAPayload","DecryptTypeAPayloadWithKeyLookup","DeinitMode","DeinitSource","DeleteContact","DeleteSharedVault","DeleteThirdPartyVault","DeleteVault","DesignateSurvivor","DetermineKeyToUse","DiscardItemsLocally","EXPIRED_PROTOCOL_VERSION","EditContact","EncryptMessage","EncryptTypeAPayload","EncryptTypeAPayloadWithKeyLookup","EncryptionService","EncryptionServiceEvent","ErrorAlertStrings","FeatureStatus","FeaturesEvent","FileBackupsDirectoryName","FileService","FilesBackupService","FindContact","FindDefaultItemsKey","GenerateUuid","GetAllContacts","GetBackupFileType","GetFilePassword","GetHost","GetInboundMessages","GetKeyPairs","GetMessageAdditionalData","GetOutboundMessages","GetOwnedSharedVaults","GetSharedVaults","GetSortedPayloadsByPriority","GetTrustedPayload","GetUntrustedPayload","GetVault","GetVaultContacts","GetVaultItems","GetVaultUsers","GetVaults","HandleKeyPairChange","HandleRootKeyChangedMessage","HomeServerService","INVALID_EXTENSION_URL","INVALID_PASSWORD","INVALID_PASSWORD_COST","ImportData","InMemoryStore","InfoStrings","InsufficientPasswordMessage","IntegrityEvent","IntegrityService","InternalEventBus","InternalEventPublishStrategy","InternalFeature","InternalFeatureService","InviteToVault","IsApplicationUsingThirdPartyHost","IsReadonlyVaultMember","IsVaultAdmin","IsVaultOwner","ItemRelationshipDirection","ItemSignatureValidationResult","ItemsEncryptionService","KeyMode","KeySystemKeyManager","KeychainRecoveryStrings","LeaveVault","LegacyKeys1_0_0","LocalPrefKey","MobileUnlockTiming","MoveItemsToVault","NonwrappedStorageKey","NotificationService","NotificationServiceEvent","NotifyVaultUsersOfKeyRotation","OUTDATED_PROTOCOL_ALERT_IGNORE","PreferencesServiceEvent","ProcessAcceptedVaultInvite","ProtectionEvent","ProtocolUpgradeStrings","REMOVING_PASSCODE","RawStorageKey","ReencryptTypeAItems","RegisterStrings","RemoveItemFromVault","RemoveItemsFromMemory","RemoveVaultMember","ReplaceContactData","ResendAllMessages","ResendMessage","ReuploadAllInvites","ReuploadInvite","ReuploadVaultInvites","RevisionManager","RootKeyManager","RotateVaultKey","SETTING_PASSCODE","SelfContactManager","SendMessage","SendOwnContactChangeMessage","SendVaultDataChangedMessage","SendVaultInvite","SendVaultKeyChangedMessage","ServerErrorStrings","SessionEvent","SessionStrings","SetHost","ShareContactWithVault","SharedVaultService","SharedVaultServiceEvent","SignInStrings","StaticItemCounter","StatusService","StatusServiceEvent","StorageKey","StoragePersistencePolicies","StorageValueModes","StrictSignInFailed","SubscriptionManager","SubscriptionManagerEvent","SyncBackoffService","SyncEvent","SyncLocalVaultsWithRemoteSharedVaults","SyncMode","SyncOpStatus","SyncQueueStrategy","SyncSource","TextBackupsDirectoryName","UNKNOWN_ERROR","UNSUPPORTED_KEY_DERIVATION","UNSUPPORTED_PROTOCOL_VERSION","UPGRADING_ENCRYPTION","UserService","ValidateItemSigner","ValidateVaultPassword","ValueModesKeys","VaultInviteService","VaultInviteServiceEvent","VaultLockService","VaultLockServiceEvent","VaultService","VaultServiceEvent","VaultUserCache","VaultUserService","VaultUserServiceEvent","WebAppEvent","WebSocketsService","WebSocketsServiceEvent","isChunkFullEntry","isComponentViewerItemReadonlyItem","isDesktopDevice","isFullEntryLoadChunkResponse","isMobileDevice","namespacedKey"].indexOf(e)<0&&(f[e]=()=>S[e]);n.d(r,f);var C=n(87901);f={};for(const e in C)["default","KeyParamsOrigination","LiveItem","SNApplication","applicationEventForSyncEvent","environmentToString","isEnvironmentMobile","isEnvironmentWebOrDesktop","platformFromString","platformToString","TYPES","ApplicationGroupEvent","SNApplicationGroup","ReactNativeToWebEvent","AddAuthenticator","DeleteAuthenticator","DeleteRevision","GetAuthenticatorAuthenticationOptions","GetAuthenticatorAuthenticationResponse","GetRecoveryCodes","GetRevision","ListAuthenticators","ListRevisions","SignInWithRecoveryCodes","SNLog","BaseMigration","Migration2_0_15","Migration2_167_6","Migration2_168_6","Migration2_202_1","Migration2_208_0","Migration2_209_0","Migration2_20_0","Migration2_36_0","Migration2_42_0","Migration2_7_0","MigrationClasses","AccountSyncOperation","ActionsService","AllowedBatchContentTypes","AllowedBatchStreaming","ApplicationService","ChallengeOperation","ChallengeResponse","ChallengeService","ComponentManager","ComponentViewer","DeprecatedHttpService","DiskStorageService","FeaturesService","HistoryManager","ItemManager","KeyRecoveryService","LegacyApiService","ListedService","MINIMUM_PASSWORD_LENGTH","MfaService","MigrationService","MissingAccountParams","MutatorService","OfflineSyncOperation","Paths","PayloadManager","PreferencesService","ProposedSecondsToDeferUILevelSessionExpirationDuringActiveInteraction","ProtectionService","ProtectionSessionDurations","ReadwriteActions","ServerSyncResponse","ServerSyncResponseResolver","SessionManager","SettingsService","SingletonManager","SyncService","SyncUpDownLimit","UnprotectedAccessSecondsDuration","isValidProtectionSessionLength","DefaultHost","PreviousSnjsVersion1_0_0","PreviousSnjsVersion2_0_0","SnjsVersion","compareSemVersions","isRightVersionGreaterThanLeft","BackupFileType","ComputePrivateUsername","Create001KeyParams","Create002KeyParams","Create003KeyParams","Create004KeyParams","CreateAnyKeyParams","CreateDecryptionSplitWithKeyLookup","CreateEncryptionSplitWithKeyLookup","CreateNewRootKey","EncryptionOperators","FillRootKeyContent","FindPayloadInDecryptionSplit","FindPayloadInEncryptionSplit","ItemsKeyMutator","KeyParamsFromApiResponse","KeyRecoveryStrings","KeySystemItemsKey","KeySystemItemsKeyMutator","ProtocolVersionForKeyParams","SNItemsKey","SNProtocolOperator001","SNProtocolOperator002","SNProtocolOperator003","SNProtocolOperator004","SNRootKey","SNRootKeyParams","SplitPayloadsByEncryptionType","StandardException","V001Algorithm","V002Algorithm","V003Algorithm","V004Algorithm","ValidKeyParamsKeys","createOperatorForVersion","deconstructEncryptedPayloadString","decryptPayload","doesPayloadRequireSigning","encryptPayload","encryptedInputParametersFromPayload","isErrorDecryptingParameters","isItemsKey","isKeySystemItemsKey","ByteChunker","DownloadAndDecryptFileOperation","EncryptAndUploadFileOperation","FileBackupsConstantsV1","FileDecryptor","FileDownloader","FileEncryptor","FileMemoryCache","FileUploader","OrderedByteChunker","fileProgressToHumanReadableString","readAndDecryptBackupFileUsingBackupService","readAndDecryptBackupFileUsingFileSystemAPI","API_MESSAGE_CHANGE_CREDENTIALS_IN_PROGRESS","API_MESSAGE_FAILED_ACCESS_PURCHASE","API_MESSAGE_FAILED_CREATE_FILE_TOKEN","API_MESSAGE_FAILED_DOWNLOADING_EXTENSION","API_MESSAGE_FAILED_GET_SETTINGS","API_MESSAGE_FAILED_LISTED_REGISTRATION","API_MESSAGE_FAILED_OFFLINE_ACTIVATION","API_MESSAGE_FAILED_OFFLINE_FEATURES","API_MESSAGE_FAILED_SUBSCRIPTION_INFO","API_MESSAGE_FAILED_UPDATE_SETTINGS","API_MESSAGE_FALLBACK_LOGIN_FAIL","API_MESSAGE_GENERIC_CHANGE_CREDENTIALS_FAIL","API_MESSAGE_GENERIC_INTEGRITY_CHECK_FAIL","API_MESSAGE_GENERIC_INVALID_LOGIN","API_MESSAGE_GENERIC_REGISTRATION_FAIL","API_MESSAGE_GENERIC_SINGLE_ITEM_SYNC_FAIL","API_MESSAGE_GENERIC_SYNC_FAIL","API_MESSAGE_GENERIC_TOKEN_REFRESH_FAIL","API_MESSAGE_INVALID_SESSION","API_MESSAGE_LOGIN_IN_PROGRESS","API_MESSAGE_RATE_LIMITED","API_MESSAGE_REGISTRATION_IN_PROGRESS","API_MESSAGE_TOKEN_REFRESH_IN_PROGRESS","API_MESSAGE_UNTRUSTED_EXTENSIONS_WARNING","AbstractService","AcceptVaultInvite","AccountEvent","AlertService","ApiServiceEvent","AppleIAPProductId","ApplicationEvent","ApplicationOptionsDefaults","ApplicationStage","AsymmetricMessageService","AuthManager","AuthenticatorManager","AuthorizeVaultDeletion","ButtonType","CHANGING_PASSCODE","Challenge","ChallengeKeyboardType","ChallengeModalTitle","ChallengePrompt","ChallengePromptTitle","ChallengeReason","ChallengeStrings","ChallengeValidation","ChangeAndSaveItem","ChangeVaultKeyOptions","ChangeVaultStorageMode","ComponentViewerError","ContactBelongsToVault","ContactService","ContactServiceEvent","ConvertToSharedVault","CreateChallengeValue","CreateDecryptedBackupFile","CreateEncryptedBackupFile","CreateNewDefaultItemsKey","CreateNewItemsKeyWithRollback","CreateOrEditContact","CreateSharedVault","CreateVault","CredentialsChangeStrings","DO_NOT_CLOSE_APPLICATION","DecryptBackupFile","DecryptBackupPayloads","DecryptErroredPayloads","DecryptErroredTypeAPayloads","DecryptItemsKeyByPromptingUser","DecryptItemsKeyWithUserFallback","DecryptMessage","DecryptOwnMessage","DecryptTypeAPayload","DecryptTypeAPayloadWithKeyLookup","DeinitMode","DeinitSource","DeleteContact","DeleteSharedVault","DeleteThirdPartyVault","DeleteVault","DesignateSurvivor","DetermineKeyToUse","DiscardItemsLocally","EXPIRED_PROTOCOL_VERSION","EditContact","EncryptMessage","EncryptTypeAPayload","EncryptTypeAPayloadWithKeyLookup","EncryptionService","EncryptionServiceEvent","ErrorAlertStrings","FeatureStatus","FeaturesEvent","FileBackupsDirectoryName","FileService","FilesBackupService","FindContact","FindDefaultItemsKey","GenerateUuid","GetAllContacts","GetBackupFileType","GetFilePassword","GetHost","GetInboundMessages","GetKeyPairs","GetMessageAdditionalData","GetOutboundMessages","GetOwnedSharedVaults","GetSharedVaults","GetSortedPayloadsByPriority","GetTrustedPayload","GetUntrustedPayload","GetVault","GetVaultContacts","GetVaultItems","GetVaultUsers","GetVaults","HandleKeyPairChange","HandleRootKeyChangedMessage","HomeServerService","INVALID_EXTENSION_URL","INVALID_PASSWORD","INVALID_PASSWORD_COST","ImportData","InMemoryStore","InfoStrings","InsufficientPasswordMessage","IntegrityEvent","IntegrityService","InternalEventBus","InternalEventPublishStrategy","InternalFeature","InternalFeatureService","InviteToVault","IsApplicationUsingThirdPartyHost","IsReadonlyVaultMember","IsVaultAdmin","IsVaultOwner","ItemRelationshipDirection","ItemSignatureValidationResult","ItemsEncryptionService","KeyMode","KeySystemKeyManager","KeychainRecoveryStrings","LeaveVault","LegacyKeys1_0_0","LocalPrefKey","MobileUnlockTiming","MoveItemsToVault","NonwrappedStorageKey","NotificationService","NotificationServiceEvent","NotifyVaultUsersOfKeyRotation","OUTDATED_PROTOCOL_ALERT_IGNORE","PreferencesServiceEvent","ProcessAcceptedVaultInvite","ProtectionEvent","ProtocolUpgradeStrings","REMOVING_PASSCODE","RawStorageKey","ReencryptTypeAItems","RegisterStrings","RemoveItemFromVault","RemoveItemsFromMemory","RemoveVaultMember","ReplaceContactData","ResendAllMessages","ResendMessage","ReuploadAllInvites","ReuploadInvite","ReuploadVaultInvites","RevisionManager","RootKeyManager","RotateVaultKey","SETTING_PASSCODE","SelfContactManager","SendMessage","SendOwnContactChangeMessage","SendVaultDataChangedMessage","SendVaultInvite","SendVaultKeyChangedMessage","ServerErrorStrings","SessionEvent","SessionStrings","SetHost","ShareContactWithVault","SharedVaultService","SharedVaultServiceEvent","SignInStrings","StaticItemCounter","StatusService","StatusServiceEvent","StorageKey","StoragePersistencePolicies","StorageValueModes","StrictSignInFailed","SubscriptionManager","SubscriptionManagerEvent","SyncBackoffService","SyncEvent","SyncLocalVaultsWithRemoteSharedVaults","SyncMode","SyncOpStatus","SyncQueueStrategy","SyncSource","TextBackupsDirectoryName","UNKNOWN_ERROR","UNSUPPORTED_KEY_DERIVATION","UNSUPPORTED_PROTOCOL_VERSION","UPGRADING_ENCRYPTION","UserService","ValidateItemSigner","ValidateVaultPassword","ValueModesKeys","VaultInviteService","VaultInviteServiceEvent","VaultLockService","VaultLockServiceEvent","VaultService","VaultServiceEvent","VaultUserCache","VaultUserService","VaultUserServiceEvent","WebAppEvent","WebSocketsService","WebSocketsServiceEvent","isChunkFullEntry","isComponentViewerItemReadonlyItem","isDesktopDevice","isFullEntryLoadChunkResponse","isMobileDevice","namespacedKey"].indexOf(e)<0&&(f[e]=()=>C[e]);n.d(r,f)})(),r})(),e.exports=t()},54569:(e,t,n)=>{"use strict";n.d(t,{Ix:()=>S,pC:()=>y,fz:()=>m,Xd:()=>g,es:()=>p});var r=n(52322),i=n(2784);let o=[],s=0,a=[];let l=Symbol(),c=Symbol(),u=0,d=(e,t,n)=>(...r)=>((e,t,n,r)=>{let i,o,d=++u,h={...e};h.set=(...n)=>{e[l]=t,e[c]=d,e.set(...n),delete e[l],delete e[c]},e.setKey&&(h.setKey=(...n)=>{e[l]=t,e[c]=d,e.setKey(...n),delete e[l],delete e[c]}),e.action&&([i,o]=e.action(d,t,r));let p=n(h,...r);if(p instanceof Promise){let e=(s+=1,()=>{if(s-=1,0===s){let e=a;a=[];for(let t of e)t()}});return p.catch((e=>{throw i&&i(e),e})).finally((()=>{e(),o&&o()}))}return o&&o(),p})(e,t,n,r);const h=((e,t)=>{let n=[],r={get:()=>(r.lc||r.listen((()=>{}))(),r.value),l:0,lc:0,listen:(e,t)=>(r.lc=n.push(e,t||r.l)/2,()=>{let t=n.indexOf(e);~t&&(n.splice(t,2),r.lc--,r.lc||r.off())}),notify(e){let t=!o.length;for(let t=0;t<n.length;t+=2)o.push(n[t],r.value,e,n[t+1]);if(t){for(let e=0;e<o.length;e+=4){let t=!1;for(let n=e+7;n<o.length;n+=4)if(o[n]<o[e+3]){t=!0;break}t?o.push(o[e],o[e+1],o[e+2],o[e+3]):o[e](o[e+1],o[e+2])}o.length=0}},off(){},set(e){r.value!==e&&(r.value=e,r.notify())},subscribe(e,t){let n=r.listen(e,t);return e(r.value),n},value:[]};return r})(),p=d(h,"updateToast",((e,t,n)=>{const r=e.get();e.set(r.map((e=>e.id===t?{...e,...n}:e)))})),f=d(h,"removeToast",((e,t)=>{const n=e.get();e.set(n.filter((e=>e.id!==t)))})),g=d(h,"dismissToast",((e,t)=>{const n=e.get();e.set(n.map((e=>e.id===t?{...e,dismissed:!0}:e))),setTimeout((()=>{f(t)}),175)})),m=d(h,"addToast",((e,t)=>{var n;const r=e.get(),i=r.findIndex((e=>e.id===t.id))>-1,o=t.id&&!i?t.id:((e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce(((e,t)=>e+((t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_")),""))();i&&console.warn(`Generated new ID for toast instead of overriding toast of ID "${t.id}".\nIf you want to update an existing toast, use the \`updateToast()\` function instead.`);const s={...t,id:o,dismissed:!1,pauseOnWindowBlur:null===(n=t.pauseOnWindowBlur)||void 0===n||n};return e.set([...r,s]),o}));var y,v=n(2577);!function(e){e.Regular="regular",e.Success="success",e.Error="error",e.Loading="loading",e.Progress="progress"}(y||(y={}));const A=e=>{switch(e){case y.Success:return"bg-success text-info-contrast md:text-success";case y.Error:return"bg-danger text-info-contrast md:text-danger";default:return"bg-info text-info-contrast md:text-info"}},b=(0,i.forwardRef)((({toast:e,index:t},n)=>{var o;const s=(e=>{switch(e){case y.Success:return(0,r.jsx)(v.CheckCircleFilledIcon,{className:"text-success h-5 w-5"});case y.Error:return(0,r.jsx)(v.ClearCircleFilledIcon,{className:"text-danger h-5 w-5"});case y.Progress:case y.Loading:return(0,r.jsx)("div",{className:"border-info h-4 w-4 animate-spin rounded-full border border-solid border-r-transparent"});default:return(0,r.jsx)(v.InfoIcon,{className:"fill-text h-5 w-5"})}})(e.type),a=e.actions&&e.actions.length>0,l=e.type===y.Progress&&void 0!==e.progress&&e.progress>-1,c=matchMedia("(prefers-reduced-motion: reduce)").matches,u=c?"fade-in-animation":"slide-in-right-animation",d=c?"fade-out-animation":"slide-out-left-animation",h=e.dismissed?d:u;return(0,i.useEffect)((()=>{if(!n)return;const t=n.current;if(t&&e.dismissed){const{scrollHeight:e,style:n}=t;requestAnimationFrame((()=>{n.minHeight="initial",n.height=e+"px",n.transition="all 200ms",requestAnimationFrame((()=>{n.height="0",n.padding="0",n.margin="0"}))}))}}),[n,e.dismissed]),(0,r.jsxs)("div",{"data-index":t,role:"status",className:`bg-passive-5 animation-fill-forwards relative mt-3 flex min-w-full select-none flex-col rounded opacity-0 md:min-w-max ${h}`,style:{boxShadow:"0px 4px 12px rgba(0, 0, 0, 0.16)",transition:c?void 0:"all 0.2s ease",animationDelay:e.dismissed?void 0:"50ms"},onClick:()=>{e.type!==y.Loading&&e.type!==y.Progress&&g(e.id)},ref:n,children:[(0,r.jsxs)("div",{className:"grid gap-x-2.5 gap-y-1 overflow-hidden grid-cols-[min-content,auto] pl-3 pr-3.5 py-2.5",children:[s?(0,r.jsx)("div",{className:"sn-icon flex items-center justify-center",children:s}):null,e.title&&(0,r.jsx)("div",{className:"text-text text-sm font-semibold col-start-2",children:e.title}),(0,r.jsx)("div",{className:"text-text text-sm [word-wrap:anywhere] col-start-2",children:e.message}),a&&(0,r.jsx)("div",{className:"col-start-2 -mx-1.5 -mb-0.5",children:null===(o=e.actions)||void 0===o?void 0:o.map(((t,n)=>(0,r.jsx)("button",{className:`hover:bg-passive-3 cursor-pointer rounded border-0 px-[0.45rem] py-1 text-sm font-semibold md:bg-transparent ${A(e.type)} ${0!==n?"ml-2":""}`,onClick:n=>{n.preventDefault(),n.stopPropagation(),t.handler(e.id)},children:t.label},n)))})]}),l&&(0,r.jsx)("div",{className:"bg-default w-full overflow-hidden rounded rounded-tl-none rounded-tr-none",children:(0,r.jsx)("div",{className:"bg-info h-2 rounded rounded-tl-none transition-[width] duration-100",role:"progressbar",style:{width:`${e.progress}%`,...100===e.progress?{borderTopRightRadius:0}:{}},"aria-valuenow":e.progress})})]})})),w=({toast:e,index:t})=>{var n,o,s;const a=(0,i.useRef)(null),l=(0,i.useRef)(),c=Boolean(null===(n=e.actions)||void 0===n?void 0:n.length),u=null!==(o=e.autoClose)&&void 0!==o?o:((e,t)=>!e&&![y.Loading,y.Progress].includes(t))(c,e.type),d=null!==(s=e.duration)&&void 0!==s?s:e.type===y.Error?8e3:4e3,h=(0,i.useRef)(d),p=(0,i.useRef)(d),f=(0,i.useCallback)((()=>{u&&g(e.id)}),[u,e.id]),m=(0,i.useCallback)((()=>{l.current&&clearTimeout(l.current)}),[]),v=(0,i.useCallback)((()=>{m(),p.current-=Date.now()-h.current}),[m]),A=(0,i.useCallback)((()=>{h.current=Date.now(),m(),l.current=window.setTimeout(f,p.current)}),[m,f]),w=(0,i.useCallback)((()=>{v()}),[v]),S=(0,i.useCallback)((()=>{A()}),[A]),C=(0,i.useCallback)((()=>{A()}),[A]),E=(0,i.useCallback)((()=>{v()}),[v]);return(0,i.useEffect)((()=>{m(),u&&A();const t=a.current;return t&&(t.addEventListener("mouseenter",w),t.addEventListener("mouseleave",S)),e.pauseOnWindowBlur&&(window.addEventListener("focus",C),window.addEventListener("blur",E)),()=>{m(),t&&(t.removeEventListener("mouseenter",w),t.removeEventListener("mouseleave",S)),e.pauseOnWindowBlur&&(window.removeEventListener("focus",C),window.removeEventListener("blur",E))}}),[m,f,d,w,S,E,C,A,u,e.id]),(0,r.jsx)(b,{toast:e,index:t,ref:a})},S=()=>{const e=function(e,t={}){let n=(0,i.useCallback)((n=>t.keys?function(e,t,n){let r=new Set([...t,void 0]);return e.listen(((e,t)=>{r.has(t)&&n(e,t)}))}(e,t.keys,n):e.listen(n)),[t.keys,e]),r=e.get.bind(e);return(0,i.useSyncExternalStore)(n,r,r)}(h);return e.length?(0,r.jsx)("div",{className:"z-toast fixed bottom-6 right-6 flex w-[calc(100%-3rem)] flex-col items-end md:w-auto",children:e.map(((e,t)=>(0,r.jsx)(w,{toast:e,index:t},e.id)))}):null}},84075:(e,t,n)=>{"use strict";n.d(t,{jB:()=>u,BD:()=>Ae,ZC:()=>k,AX:()=>F,Wu:()=>X,kS:()=>I,PV:()=>L,BQ:()=>f,jd:()=>N,qC:()=>R,os:()=>Ne,$e:()=>Be,q_:()=>ct,P$:()=>Ee,hJ:()=>Pe,WY:()=>ke,Ab:()=>Ie,u8:()=>ee,i8:()=>ne,QE:()=>_,Ek:()=>Q,QD:()=>J,Ib:()=>K,um:()=>x,UK:()=>Le,zo:()=>Ce,YX:()=>te,mc:()=>ue,MZ:()=>de,Yt:()=>le,RL:()=>P,hh:()=>B,Ur:()=>O,Ak:()=>V,yc:()=>Z,fq:()=>W,zI:()=>Y,p6:()=>z,YN:()=>q,Ix:()=>H,Qx:()=>G,Qt:()=>be,gE:()=>D,Xc:()=>M,yX:()=>T,ZL:()=>$,p7:()=>C,Jr:()=>E,Ve:()=>Re,kl:()=>Ue,r9:()=>ht,FJ:()=>ut,GW:()=>l,Ne:()=>s,VG:()=>o,dP:()=>b,Dt:()=>xe,gn:()=>_e,ae:()=>v,an:()=>A,zr:()=>re,Mn:()=>ie,Ld:()=>oe,tO:()=>we});var r=n(87901);class i{constructor({title:e,text:t,buttons:n}){this.title=e,this.text=t,this.buttons=n||[]}buttonsString(){return`\n      <div class='flex items-center justify-end gap-2 w-full'>\n        ${this.buttons.map((function(e,t){return function(e,t){return`\n        <button id='button-${t}' class='font-bold px-4 py-1.5 rounded text-base lg:text-sm ${e.primary?"no-border ":"border-solid border-border border "} ${e.primary?"hover:brightness-125 focus:outline-none focus:brightness-125 ":"focus:bg-contrast focus:outline-none hover:bg-contrast "} ${e.primary?(e=>{switch(e){case"default":return"bg-default text-foreground";case"contrast":return"bg-contrast text-text";case"neutral":return"bg-neutral text-neutral-contrast";case"info":return"bg-info text-info-contrast";case"warning":return"bg-warning text-warning-contrast";case"danger":return"bg-danger text-danger-contrast";case"success":return"bg-success text-success-contrast"}})(e.style):(e=>{switch(e){case"default":return"bg-default text-text";case"contrast":return"bg-default text-contrast";case"neutral":return"bg-default text-neutral";case"info":return"bg-default text-info";case"warning":return"bg-default text-warning";case"danger":return"bg-default text-danger";case"success":return"bg-default text-success"}})(e.style)}'>\n          <div class='sk-label'>${e.text}</div>\n        </button>\n      `}(e,t)})).join("")}\n      </div>\n    `}templateString(){let e,t;return this.buttons?(e=`\n        <div class="sk-panel-row" style='margin-top: 8px;'>\n          ${this.buttonsString()}\n        </div>\n      `,t=""):(e="",t='style="padding-bottom: 8px"'),`\n      <div class="sk-modal">\n        <div class="sk-modal-background"></div>\n        <div class="sk-modal-content">\n          <div class="sn-component">\n            <div class="sk-panel" style='max-width: min(95vw, 500px);'>\n              <div class="sk-panel-content" ${t}>\n                <div class="sk-panel-section">\n                  ${this.title?`<div class='mb-1 font-bold text-lg flex items-center justify-between'>\n          ${this.title}\n          <button id="close-button" class="rounded p-1 font-bold hover:bg-contrast" onClick={closeDialog}>\n            <svg class="w-5 h-5 fill-current" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.2459 5.92925C15.5704 5.60478 15.5704 5.07872 15.2459 4.75425C14.9214 4.42978 14.3954 4.42978 14.0709 4.75425L10.0001 8.82508L5.92925 4.75425C5.60478 4.42978 5.07872 4.42978 4.75425 4.75425C4.42978 5.07872 4.42978 5.60478 4.75425 5.92925L8.82508 10.0001L4.75425 14.0709C4.42978 14.3954 4.42978 14.9214 4.75425 15.2459C5.07872 15.5704 5.60478 15.5704 5.92925 15.2459L10.0001 11.1751L14.0709 15.2459C14.3954 15.5704 14.9214 15.5704 15.2459 15.2459C15.5704 14.9214 15.5704 14.3954 15.2459 14.0709L11.1751 10.0001L15.2459 5.92925Z" /></svg>\n          </button>\n         </div>`:""}\n\n                  <div class="sk-panel-row">\n                    ${this.text?`<p class='sk-p text-base lg:text-sm' style="max-width: 100%; overflow: hidden; text-overflow: ellipsis;">${this.text}</p>`:""}\n                  </div>\n\n                  ${e}\n                </div>\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n    `}dismiss(){this.onElement.removeChild(this.element)}primaryButton(){let e=this.buttons.find((e=>!0===e.primary));return e||(e=this.buttons[this.buttons.length-1]),e}present(e){e||(e=document.body),this.onElement=e,this.element=document.createElement("div"),this.element.className="sn-component",this.element.innerHTML=this.templateString().trim(),e.appendChild(this.element),this.buttons&&this.buttons.length&&this.buttons.forEach(((e,t)=>{const n=this.element.querySelector(`#button-${t}`);n.onclick=()=>{e.action&&e.action(),this.dismiss()},0===t&&n.focus()}));const t=this.element.querySelector("#close-button");t&&(t.onclick=()=>{this.dismiss()})}}function o({text:e,title:t,confirmButtonText:n="Confirm",cancelButtonText:o="Cancel",confirmButtonStyle:s="info"}){return new Promise((a=>{new i({title:t&&(0,r.sanitizeHtmlString)(t),text:(0,r.sanitizeHtmlString)(e),buttons:[{text:o,style:"default",action(){a(!1)}},{text:n,style:s,primary:!0,action(){a(!0)}}]}).present()}))}function s({title:e,text:t,closeButtonText:n="OK"}){return new Promise((o=>{new i({title:e&&(0,r.sanitizeHtmlString)(e),text:(0,r.sanitizeHtmlString)(t),buttons:[{text:n,style:"default",action:o}]}).present()}))}var a=n(32105);class l extends a.c9N{confirmV2(e){return o({text:e.text,title:e.title,confirmButtonText:e.confirmButtonText,cancelButtonText:e.cancelButtonText,confirmButtonStyle:e.confirmButtonType===a.L$3.Danger?"danger":"info"})}alertV2(e){return s({text:e.text,title:e.title,closeButtonText:e.closeButtonText})}alert(e,t,n){return s({text:e,title:t,closeButtonText:n})}confirm(e,t,n,r,i){return o({text:e,title:t,confirmButtonText:n,cancelButtonText:i,confirmButtonStyle:r===a.L$3.Danger?"danger":"info"})}blockingDialog(e,t){const n=new i({title:t&&(0,r.sanitizeHtmlString)(t),text:(0,r.sanitizeHtmlString)(e),buttons:[]});return n.present(),()=>{n.dismiss()}}}var c=n(82648);class u{constructor(e){this.application=e}async getMimeType(e){return(await n.e(612).then(n.bind(n,75612))).getMimeType(e)}async downloadBackup(e){const t=e?await this.application.createEncryptedBackupFile.execute():await this.application.createDecryptedBackupFile.execute();if(t.isFailed())return;const n=t.getValue(),r=new Blob([JSON.stringify(n,null,2)],{type:"text/json"});e?this.downloadData(r,`Standard Notes Encrypted Backup and Import File - ${this.formattedDateForExports()}.txt`):this.downloadZippedDecryptedItems(n).catch(console.error)}formattedDateForExports(){const e=(new Date).toString(),t=e.match(/^(.*?) \(/);return t&&t.length>=2?t[1]:e}async getZippedDecryptedItemsBlob(e){const t=await n.e(612).then(n.bind(n,75612)),i=new t.ZipWriter(new t.BlobWriter("application/zip")),o=e.items,s=new Blob([JSON.stringify(e,null,2)],{type:"text/plain"}),a=(0,r.createZippableFileName)("Standard Notes Backup and Import File");await i.add(a,new t.BlobReader(s));for(let e=0;e<o.length;e++){const n=o[e];let s,a;if(n.content_type===c.ContentType.TYPES.Note){const e=n;s=e.content.title,a=e.content.text}else s=n.content_type,a=JSON.stringify(n.content,null,2);s||(s="");const l=new Blob([a],{type:"text/plain"}),u=`Items/${(0,r.sanitizeFileName)(n.content_type)}/`+(0,r.createZippableFileName)(s,`-${n.uuid.split("-")[0]}`);await i.add(u,new t.BlobReader(l))}return await i.close()}async downloadZippedDecryptedItems(e){const t=await this.getZippedDecryptedItemsBlob(e);this.downloadData(t,`Standard Notes Backup - ${this.formattedDateForExports()}.zip`)}async zipData(e){const t=await n.e(612).then(n.bind(n,75612)),i=new t.ZipWriter(new t.BlobWriter("application/zip")),o={};for(let n=0;n<e.length;n++){const s=e[n],{name:a,ext:l}=(0,r.parseFileName)(s.name);o[s.name]=null==o[s.name]?0:o[s.name]+1;const c=o[s.name];await i.add((0,r.createZippableFileName)(a,c>0?` - ${c}`:"",l),new t.BlobReader(s.content))}return await i.close()}async downloadDataAsZip(e){const t=await this.zipData(e);this.downloadData(t,`Standard Notes Export - ${this.formattedDateForExports()}.zip`)}hrefForData(e){return this.textFile&&window.URL.revokeObjectURL(this.textFile),this.textFile=window.URL.createObjectURL(e),this.textFile}downloadData(e,t){const n=document.createElement("a");n.setAttribute("download",t),n.href="string"==typeof e?e:this.hrefForData(e),document.body.appendChild(n),n.click(),n.remove()}downloadEncryptedItem(e){this.downloadData(new Blob([JSON.stringify(e.payload.ejected())]),`${e.uuid}.txt`)}downloadEncryptedItems(e){const t=JSON.stringify(e.map((e=>e.payload.ejected())));this.downloadData(new Blob([t]),"errored-items.txt")}}var d=n(22325);const h={"3.107.0":"3.101.2","3.106.0":"3.101.1","3.105.0":"3.101.0","3.104.1":"3.100.18","3.104.0":"3.100.17","3.103.2":"3.100.16","3.103.1":"3.100.15","3.103.0":"3.100.14","3.102.0":"3.100.13","3.101.2":"3.100.12","3.101.1":"3.100.11","3.101.0":"3.100.10","3.100.8":"3.100.9","3.100.7":"3.100.8","3.100.6":"3.100.7","3.100.5":"3.100.6","3.100.4":"3.100.5","3.100.3":"3.100.4","3.100.2":"3.100.3","3.100.1":"3.100.2","3.100.0":"3.100.1","3.99.0":"3.100.0","3.98.2":"3.23.301","3.98.1":"3.23.300","3.98.0":"3.23.299","3.97.0":"3.23.298","3.96.1":"3.23.297","3.96.0":"3.23.296","3.95.1":"3.23.295","3.95.0":"3.23.294","3.94.2":"3.23.293","3.94.1":"3.23.292","3.94.0":"3.23.291","3.93.19":"3.23.290","3.93.18":"3.23.289","3.93.17":"3.23.288","3.93.16":"3.23.287","3.93.15":"3.23.286","3.93.14":"3.23.285","3.93.13":"3.23.284","3.93.12":"3.23.283","3.93.11":"3.23.282","3.93.10":"3.23.281","3.93.9":"3.23.280","3.93.8":"3.23.279","3.93.7":"3.23.278","3.93.6":"3.23.277","3.93.5":"3.23.276","3.93.4":"3.23.275","3.93.3":"3.23.274","3.93.2":"3.23.273","3.93.1":"3.23.272","3.93.0":"3.23.271","3.92.0":"3.23.270","3.91.1":"3.23.269","3.91.0":"3.23.268","3.90.11":"3.23.267","3.90.10":"3.23.266","3.90.9":"3.23.265","3.90.8":"3.23.264","3.90.7":"3.23.263","3.90.6":"3.23.262","3.90.5":"3.23.261","3.90.4":"3.23.260","3.90.3":"3.23.259","3.90.2":"3.23.258","3.90.1":"3.23.257","3.90.0":"3.23.256","3.89.0":"3.23.255","3.88.1":"3.23.254","3.88.0":"3.23.253","3.87.2":"3.23.252","3.87.1":"3.23.251","3.87.0":"3.23.250","3.86.0":"3.23.249","3.85.2":"3.23.248","3.85.1":"3.23.247","3.85.0":"3.23.246","3.84.7":"3.23.245","3.84.6":"3.23.244","3.84.5":"3.23.243","3.84.4":"3.23.242","3.84.3":"3.23.241","3.84.2":"3.23.240","3.84.1":"3.23.239","3.84.0":"3.23.238","3.83.0":"3.23.237","3.82.6":"3.23.236","3.82.5":"3.23.235","3.82.4":"3.23.234","3.82.3":"3.23.233","3.82.2":"3.23.232","3.82.1":"3.23.231","3.82.0":"3.23.230","3.81.0":"3.23.229","3.80.1":"3.23.228","3.80.0":"3.23.227","3.79.0":"3.23.226","3.78.1":"3.23.225","3.78.0":"3.23.224","3.77.1":"3.23.223","3.77.0":"3.23.222","3.76.2":"3.23.221","3.76.1":"3.23.220","3.76.0":"3.23.219","3.75.1":"3.23.218","3.75.0":"3.23.217","3.74.0":"3.23.216","3.73.0":"3.23.215","3.72.4":"3.23.214","3.72.3":"3.23.213","3.72.2":"3.23.212","3.72.1":"3.23.211","3.72.0":"3.23.210","3.71.8":"3.23.209","3.71.7":"3.23.208","3.71.6":"3.23.207","3.71.5":"3.23.206","3.71.4":"3.23.205","3.71.3":"3.23.204","3.71.2":"3.23.203","3.71.1":"3.23.202","3.71.0":"3.23.201","3.70.5":"3.23.200","3.70.4":"3.23.199","3.70.3":"3.23.198","3.70.2":"3.23.197","3.70.1":"3.23.196","3.70.0":"3.23.195","3.69.1":"3.23.194","3.69.0":"3.23.193","3.68.6":"3.23.192","3.68.5":"3.23.191","3.68.4":"3.23.190","3.68.3":"3.23.189","3.68.2":"3.23.188","3.68.1":"3.23.187","3.68.0":"3.23.186","3.67.4":"3.23.185","3.67.3":"3.23.184","3.67.2":"3.23.183","3.67.1":"3.23.182","3.67.0":"3.23.181","3.66.0":"3.23.180","3.65.0":"3.23.179","3.64.0":"3.23.178","3.63.3":"3.23.177","3.63.2":"3.23.176","3.63.1":"3.23.175","3.63.0":"3.23.174","3.62.4":"3.23.173","3.62.3":"3.23.172","3.62.2":"3.23.171","3.62.1":"3.23.170","3.62.0":"3.23.169","3.61.0":"3.23.168","3.60.0":"3.23.167","3.59.3":"3.23.166","3.59.2":"3.23.165","3.59.1":"3.23.164","3.59.0":"3.23.163","3.58.1":"3.23.162","3.58.0":"3.23.161","3.57.3":"3.23.160","3.57.2":"3.23.159","3.57.1":"3.23.158","3.57.0":"3.23.157","3.56.0":"3.23.156","3.55.2":"3.23.155","3.55.1":"3.23.154","3.55.0":"3.23.153","3.54.6":"3.23.152","3.54.5":"3.23.151","3.54.4":"3.23.150","3.54.3":"3.23.149","3.54.2":"3.23.148","3.54.1":"3.23.147","3.54.0":"3.23.146","3.53.0":"3.23.145","3.52.1":"3.23.144","3.52.0":"3.23.143","3.51.0":"3.23.142","3.50.6":"3.23.141","3.50.5":"3.23.140","3.50.4":"3.23.139","3.50.3":"3.23.138","3.50.2":"3.23.137","3.50.1":"3.23.136","3.50.0":"3.23.135","3.49.3":"3.23.134","3.49.2":"3.23.133","3.49.1":"3.23.132","3.49.0":"3.23.131","3.48.3":"3.23.130","3.48.2":"3.23.129","3.48.1":"3.23.128","3.48.0":"3.23.127","3.47.3":"3.23.126","3.47.2":"3.23.125","3.47.1":"3.23.124","3.47.0":"3.23.123","3.46.3":"3.23.122","3.46.2":"3.23.121","3.46.1":"3.23.120","3.46.0":"3.23.119","3.45.18":"3.23.118","3.45.17":"3.23.117","3.45.16":"3.23.116","3.45.15":"3.23.115","3.45.14":"3.23.114","3.45.13":"3.23.113","3.45.12":"3.23.112","3.45.11":"3.23.111","3.45.10":"3.23.110","3.45.9":"3.23.109","3.45.8":"3.23.108","3.45.7":"3.23.107","3.45.6":"3.23.106","3.45.5":"3.23.105","3.45.4":"3.23.104","3.45.3":"3.23.103","3.45.2":"3.23.102","3.45.1":"3.23.101","3.45.0":"3.23.100","3.44.7":"3.23.99","3.44.6":"3.23.98","3.44.5":"3.23.97","3.44.4":"3.23.96","3.44.3":"3.23.95","3.44.2":"3.23.94","3.44.1":"3.23.93","3.44.0":"3.23.92","3.43.1":"3.23.91","3.43.0":"3.23.90","3.42.1":"3.23.89","3.42.0":"3.23.88","3.41.3":"3.23.87","3.41.2":"3.23.86","3.41.1":"3.23.85","3.41.0":"3.23.84","3.40.7":"3.23.83","3.40.6":"3.23.82","3.40.5":"3.23.81","3.40.4":"3.23.80","3.40.3":"3.23.79","3.40.2":"3.23.78","3.40.1":"3.23.77","3.40.0":"3.23.76","3.39.1":"3.23.75","3.39.0":"3.23.74","3.38.6":"3.23.73","3.38.5":"3.23.72","3.38.4":"3.23.71","3.38.3":"3.23.70","3.38.2":"3.23.69","3.38.1":"3.23.68","3.38.0":"3.23.67","3.37.7":"3.23.66","3.37.6":"3.23.65","3.37.5":"3.23.64","3.37.4":"3.23.63","3.37.3":"3.23.62","3.37.2":"3.23.61","3.37.1":"3.23.60","3.37.0":"3.23.59","3.36.0":"3.23.58","3.35.2":"3.23.57","3.35.1":"3.23.56","3.35.0":"3.23.55","3.34.0":"3.23.54","3.33.8":"3.23.53","3.33.7":"3.23.52","3.33.6":"3.23.51","3.33.5":"3.23.50","3.33.4":"3.23.49","3.33.3":"3.23.48","3.33.2":"3.23.47","3.33.1":"3.23.46","3.33.0":"3.23.45","3.32.0":"3.23.44","3.31.1":"3.23.43","3.31.0":"3.23.42","3.30.0":"3.23.41","3.29.2":"3.23.40","3.29.1":"3.23.39","3.29.0":"3.23.38","3.28.1":"3.23.37","3.28.0":"3.23.36","3.27.7":"3.23.35","3.27.6":"3.23.34","3.27.5":"3.23.33","3.27.4":"3.23.32","3.27.3":"3.23.31","3.27.2":"3.23.30","3.27.1":"3.23.29","3.27.0":"3.23.28","3.26.4":"3.23.27","3.26.3":"3.23.26","3.26.2":"3.23.25","3.26.1":"3.23.24","3.26.0":"3.23.23","3.25.0":"3.23.22","3.24.6":"3.23.21","3.24.5":"3.23.20","3.24.4":"3.23.19","3.24.3":"3.23.18","3.24.3-alpha.1":"3.23.17","3.24.3-alpha.0":"3.23.16","3.24.2":"3.23.15","3.24.2-alpha.1":"3.23.14","3.24.2-alpha.0":"3.23.13","3.24.1":"3.23.12","3.24.1-alpha.0":"3.23.11","3.24.0":"3.23.10","3.24.0-alpha.7":"3.23.9","3.24.0-alpha.6":"3.23.8","3.24.0-alpha.5":"3.23.7","3.24.0-alpha.4":"3.23.6","3.24.0-alpha.3":"3.23.5","3.24.0-alpha.2":"3.23.4","3.24.0-alpha.1":"3.23.3","3.24.0-alpha.0":"3.23.2","3.23.0":"3.23.1","3.23.0-alpha.1":"3.23.0","3.23.0-alpha.0":"3.22.21","3.22.7-alpha.0":"3.22.20","3.22.6":"3.22.19","3.22.6-alpha.0":"3.22.18","3.22.5":"3.22.17","3.22.4":"3.22.13-alpha.9","3.22.3":"3.22.13-alpha.8","3.22.3-alpha.9":"3.22.16-alpha.1","3.22.3-alpha.8":"3.22.16-alpha.0","3.22.3-alpha.7":"3.22.15","3.22.3-alpha.6":"3.22.15-alpha.3","3.22.3-alpha.5":"3.22.15-alpha.2","3.22.3-alpha.4":"3.22.15-alpha.1","3.22.3-alpha.3":"3.22.15-alpha.0","3.22.3-alpha.2":"3.22.14","3.22.3-alpha.1":"3.22.14-alpha.0","3.22.3-alpha.0":"3.22.13","3.22.2":"3.22.13-alpha.10","3.22.1":"3.22.13-alpha.7","3.22.0":"3.22.13-alpha.6","3.21.0":"3.22.13-alpha.5"},p={"3.107.0":"3.46.31","3.106.0":"3.46.30","3.105.0":"3.46.29","3.104.1":"3.46.28","3.104.0":"3.46.27","3.103.2":"3.46.26","3.103.1":"3.46.25","3.103.0":"3.46.24","3.102.0":"3.46.23","3.101.2":"3.46.22","3.101.1":"3.46.21","3.101.0":"3.46.20","3.100.8":"3.46.19","3.100.7":"3.46.18","3.100.6":"3.46.17","3.100.5":"3.46.16","3.100.4":"3.46.15","3.100.3":"3.46.14","3.100.2":"3.46.13","3.100.1":"3.46.12","3.100.0":"3.46.11","3.99.0":"3.46.10","3.98.2":"3.46.9","3.98.1":"3.46.8","3.98.0":"3.46.7","3.97.0":"3.46.6","3.96.1":"3.46.5","3.96.0":"3.46.4","3.95.1":"3.46.3","3.95.0":"3.46.2","3.94.2":"3.46.1","3.94.1":"3.46.0","3.94.0":"3.45.42","3.93.19":"3.45.41","3.93.18":"3.45.40","3.93.17":"3.45.39","3.93.16":"3.45.38","3.93.15":"3.45.37","3.93.14":"3.45.36","3.93.13":"3.45.35","3.93.12":"3.45.34","3.93.11":"3.45.33","3.93.10":"3.45.32","3.93.9":"3.45.31","3.93.8":"3.45.30","3.93.7":"3.45.29","3.93.6":"3.45.28","3.93.5":"3.45.27","3.93.4":"3.45.26","3.93.3":"3.45.25","3.93.2":"3.45.24","3.93.1":"3.45.23","3.93.0":"3.45.22","3.92.0":"3.45.21","3.91.1":"3.45.20","3.91.0":"3.45.19","3.90.11":"3.45.18","3.90.10":"3.45.17","3.90.9":"3.45.16","3.90.8":"3.45.15","3.90.7":"3.45.14","3.90.6":"3.45.13","3.90.5":"3.45.12","3.90.4":"3.45.11","3.90.3":"3.45.10","3.90.2":"3.45.9","3.90.1":"3.45.8","3.90.0":"3.45.7","3.89.0":"3.45.6","3.88.1":"3.45.5","3.88.0":"3.45.4","3.87.2":"3.45.3","3.87.1":"3.45.2","3.87.0":"3.45.1","3.86.0":"3.45.0","3.85.2":"3.44.5","3.85.1":"3.44.4","3.85.0":"3.44.3","3.84.7":"3.44.2","3.84.6":"3.44.1","3.84.5":"3.44.0","3.84.4":"3.43.33","3.84.3":"3.43.32","3.84.2":"3.43.31","3.84.1":"3.43.30","3.84.0":"3.43.29","3.83.0":"3.43.28","3.82.6":"3.43.27","3.82.5":"3.43.26","3.82.4":"3.43.25","3.82.3":"3.43.24","3.82.2":"3.43.23","3.82.1":"3.43.22","3.82.0":"3.43.21","3.81.0":"3.43.20","3.80.1":"3.43.19","3.80.0":"3.43.18","3.79.0":"3.43.17","3.78.1":"3.43.16","3.78.0":"3.43.15","3.77.1":"3.43.14","3.77.0":"3.43.13","3.76.2":"3.43.12","3.76.1":"3.43.11","3.76.0":"3.43.10","3.75.1":"3.43.9","3.75.0":"3.43.8","3.74.0":"3.43.7","3.73.0":"3.43.6","3.72.4":"3.43.5","3.72.3":"3.43.4","3.72.2":"3.43.3","3.72.1":"3.43.2","3.72.0":"3.43.1","3.71.8":"3.43.0","3.71.7":"3.42.5","3.71.6":"3.42.4","3.71.5":"3.42.3","3.71.4":"3.42.2","3.71.3":"3.42.1","3.71.2":"3.42.0","3.71.1":"3.41.10","3.71.0":"3.41.9","3.70.5":"3.41.8","3.70.4":"3.41.7","3.70.3":"3.41.6","3.70.2":"3.41.5","3.70.1":"3.41.4","3.70.0":"3.41.3","3.69.1":"3.41.2","3.69.0":"3.41.1","3.68.6":"3.41.0","3.68.5":"3.40.2","3.68.4":"3.40.1","3.68.3":"3.40.0","3.68.2":"3.39.12","3.68.1":"3.39.11","3.68.0":"3.39.10","3.67.4":"3.39.9","3.67.3":"3.39.8","3.67.2":"3.39.7","3.67.1":"3.39.6","3.67.0":"3.39.5","3.66.0":"3.39.4","3.65.0":"3.39.3","3.64.0":"3.39.2","3.63.3":"3.39.1","3.63.2":"3.39.0","3.63.1":"3.38.1","3.63.0":"3.38.0","3.62.4":"3.37.14","3.62.3":"3.37.13","3.62.2":"3.37.12","3.62.1":"3.37.11","3.62.0":"3.37.10","3.61.0":"3.37.9","3.60.0":"3.37.8","3.59.3":"3.37.7","3.59.2":"3.37.6","3.59.1":"3.37.5","3.59.0":"3.37.4","3.58.1":"3.37.3","3.58.0":"3.37.2","3.57.3":"3.37.1","3.57.2":"3.37.0","3.57.1":"3.36.18","3.57.0":"3.36.17","3.56.0":"3.36.16","3.55.2":"3.36.15","3.55.1":"3.36.14","3.55.0":"3.36.13","3.54.6":"3.36.12","3.54.5":"3.36.11","3.54.4":"3.36.10","3.54.3":"3.36.9","3.54.2":"3.36.8","3.54.1":"3.36.7","3.54.0":"3.36.6","3.53.0":"3.36.5","3.52.1":"3.36.4","3.52.0":"3.36.3","3.51.0":"3.36.2","3.50.6":"3.36.1","3.50.5":"3.36.0","3.50.4":"3.35.16","3.50.3":"3.35.15","3.50.2":"3.35.14","3.50.1":"3.35.13","3.50.0":"3.35.12","3.49.3":"3.35.11","3.49.2":"3.35.10","3.49.1":"3.35.9","3.49.0":"3.35.8","3.48.3":"3.35.7","3.48.2":"3.35.6","3.48.1":"3.35.5","3.48.0":"3.35.4","3.47.3":"3.35.3","3.47.2":"3.35.2","3.47.1":"3.35.1","3.47.0":"3.35.0","3.46.3":"3.34.3","3.46.2":"3.34.2","3.46.1":"3.34.1","3.46.0":"3.34.0","3.45.18":"3.33.7","3.45.17":"3.33.6","3.45.16":"3.33.5","3.45.15":"3.33.4","3.45.14":"3.33.3","3.45.13":"3.33.2","3.45.12":"3.33.1","3.45.11":"3.33.0","3.45.10":"3.32.5","3.45.9":"3.32.4","3.45.8":"3.32.3","3.45.7":"3.32.2","3.45.6":"3.32.1","3.45.5":"3.32.0","3.45.4":"3.31.29","3.45.3":"3.31.28","3.45.2":"3.31.27","3.45.1":"3.31.26","3.45.0":"3.31.25","3.44.7":"3.31.24","3.44.6":"3.31.23","3.44.5":"3.31.22","3.44.4":"3.31.21","3.44.3":"3.31.20","3.44.2":"3.31.19","3.44.1":"3.31.18","3.44.0":"3.31.17","3.43.1":"3.31.16","3.43.0":"3.31.15","3.42.1":"3.31.14","3.42.0":"3.31.13","3.41.3":"3.31.12","3.41.2":"3.31.11","3.41.1":"3.31.10","3.41.0":"3.31.9","3.40.7":"3.31.8","3.40.6":"3.31.7","3.40.5":"3.31.6","3.40.4":"3.31.5","3.40.3":"3.31.4","3.40.2":"3.31.3","3.40.1":"3.31.2","3.40.0":"3.31.1","3.39.1":"3.31.0","3.39.0":"3.30.38","3.38.6":"3.30.37","3.38.5":"3.30.36","3.38.4":"3.30.35","3.38.3":"3.30.34","3.38.2":"3.30.33","3.38.1":"3.30.32","3.38.0":"3.30.31","3.37.7":"3.30.30","3.37.6":"3.30.29","3.37.5":"3.30.28","3.37.4":"3.30.27","3.37.3":"3.30.26","3.37.2":"3.30.25","3.37.1":"3.30.24","3.37.0":"3.30.23","3.36.0":"3.30.22","3.35.2":"3.30.21","3.35.1":"3.30.20","3.35.0":"3.30.19","3.34.0":"3.30.18","3.33.8":"3.30.17","3.33.7":"3.30.16","3.33.6":"3.30.15","3.33.5":"3.30.14","3.33.4":"3.30.13","3.33.3":"3.30.12","3.33.2":"3.30.11","3.33.1":"3.30.10","3.33.0":"3.30.9","3.32.0":"3.30.8","3.31.1":"3.30.7","3.31.0":"3.30.6","3.30.0":"3.30.5","3.29.2":"3.30.4","3.29.1":"3.30.3","3.29.0":"3.30.2","3.28.1":"3.30.1","3.28.0":"3.30.0","3.27.7":"3.29.0","3.27.6":"3.28.3","3.27.5":"3.28.2","3.27.4":"3.28.1","3.27.3":"3.28.0","3.27.2":"3.27.13","3.27.1":"3.27.12","3.27.0":"3.27.11","3.26.4":"3.27.10","3.26.3":"3.27.9","3.26.2":"3.27.8","3.26.1":"3.27.7","3.26.0":"3.27.6","3.25.0":"3.27.5","3.24.6":"3.27.4","3.24.5":"3.27.3","3.24.4":"3.27.2","3.24.3":"3.27.1","3.24.3-alpha.1":"3.27.0","3.24.3-alpha.0":"3.26.14","3.24.2":"3.26.13","3.24.2-alpha.1":"3.26.12","3.24.2-alpha.0":"3.26.11","3.24.1":"3.26.10","3.24.1-alpha.0":"3.26.9","3.24.0":"3.26.8","3.24.0-alpha.7":"3.26.7","3.24.0-alpha.6":"3.26.6","3.24.0-alpha.5":"3.26.5","3.24.0-alpha.4":"3.26.4","3.24.0-alpha.3":"3.26.3","3.24.0-alpha.2":"3.26.2","3.24.0-alpha.1":"3.26.1","3.24.0-alpha.0":"3.26.0","3.23.0":"3.25.15","3.23.0-alpha.1":"3.25.14","3.23.0-alpha.0":"3.25.13","3.22.7-alpha.0":"3.25.12","3.22.6":"3.25.11","3.22.6-alpha.0":"3.25.10","3.22.5":"3.25.9","3.22.4":"3.24.4","3.22.3":"3.24.3","3.22.3-alpha.9":"3.25.6","3.22.3-alpha.8":"3.25.5","3.22.3-alpha.7":"3.25.4","3.22.3-alpha.6":"3.25.3","3.22.3-alpha.5":"3.25.2","3.22.3-alpha.4":"3.25.1","3.22.3-alpha.3":"3.25.0","3.22.3-alpha.2":"3.24.8","3.22.3-alpha.1":"3.24.7","3.22.3-alpha.0":"3.24.6","3.22.2":"3.24.5","3.22.1":"3.24.2","3.22.0":"3.24.2-alpha.2","3.21.0":"3.24.2-alpha.1"};class f{constructor(e,t){this.environment=e,this.diskService=t,this.lastReadChangeListeners=[]}addLastReadChangeListener(e){return this.lastReadChangeListeners.push(e),()=>{this.lastReadChangeListeners=this.lastReadChangeListeners.filter((t=>t!==e))}}async performDownloadChangelog(){const e=await fetch("https://raw.githubusercontent.com/standardnotes/app/main/packages/web/CHANGELOG.md.json"),t=await e.text();return JSON.parse(t)}async getChangelog(){if(this.changeLog)return this.changeLog;if(this.changeLog=await this.performDownloadChangelog(),this.environment!==d.Environment.Web){const e=this.getLegacyMapping();this.changeLog.versions=this.changeLog.versions.map((t=>{const n=t.version||"";return{...t,version:e[n]||t.version}}))}return this.changeLog}markAsRead(){if(!this.changeLog)return;const e=this.changeLog.versions[0].version;this.diskService.setValue(a.QtK.LastReadChangelogVersion,e),e&&this.lastReadChangeListeners.forEach((t=>t(e)))}getLastReadVersion(){return this.diskService.getValue(a.QtK.LastReadChangelogVersion)}async getVersions(){return(await this.getChangelog()).versions}getLegacyMapping(){return this.environment===d.Environment.Desktop?h:this.environment===d.Environment.Mobile?p:{}}getDesktopDownloadsUrl(e){return"https://github.com/standardnotes/app/releases/tag/%40standardnotes%2Fdesktop%40"+e}getDesktopVersionForWebVersion(e){var t;return null!==(t=h[e])&&void 0!==t?t:e}}var g,m,y=n(29894);function v(e){return e===y.Platform.MacDesktop||e===y.Platform.MacWeb}function A(e){return e===y.Platform.Ios||e===y.Platform.Android}function b(e){return v(e)?g.Meta:g.Ctrl}function w(e,t){var n;const r=function(e){return Object.values(g).filter((t=>(e.ctrlKey||e.key===g.Ctrl)&&t===g.Ctrl||(e.metaKey||e.key===g.Meta)&&t===g.Meta||(e.altKey||e.key===g.Alt)&&t===g.Alt||(e.shiftKey||e.key===g.Shift)&&t===g.Shift))}(e),i=null!==(n=t.modifiers)&&void 0!==n?n:[];if(r.length!==i.length)return!1;for(const e of i)if(!r.includes(e))return!1;return!t.key&&!t.code||(t.key?t.key.toLowerCase()===e.key.toLowerCase():t.code===e.code)}function S(e){return Symbol(e)}!function(e){e.Shift="Shift",e.Ctrl="Control",e.Meta="Meta",e.Alt="Alt"}(g||(g={})),function(e){e.Down="KeyEventDown",e.Up="KeyEventUp"}(m||(m={}));const C=S("TOGGLE_LIST_PANE_KEYBOARD_COMMAND"),E=S("TOGGLE_NAVIGATION_PANE_KEYBOARD_COMMAND"),I=S("CREATE_NEW_NOTE_KEYBOARD_COMMAND"),_=S("NEXT_LIST_ITEM_KEYBOARD_COMMAND"),x=S("PREVIOUS_LIST_ITEM_KEYBOARD_COMMAND"),P=S("SEARCH_KEYBOARD_COMMAND"),k=S("CANCEL_SEARCH_COMMAND"),B=S("SELECT_ALL_ITEMS_KEYBOARD_COMMAND"),O=S("SHOW_HIDDEN_OPTIONS_KEYBOARD_COMMAND"),N=S("DELETE_NOTE_KEYBOARD_COMMAND"),D=S("PLAIN_EDITOR_INSERT_TAB_KEYBOARD_COMMAND"),j=S("ESCAPE_COMMAND"),T=S("TOGGLE_FOCUS_MODE_COMMAND"),M=S("TOGGLE_DARK_MODE_COMMAND"),F=S("CHANGE_EDITOR_COMMAND"),R=S("FOCUS_TAGS_INPUT_COMMAND"),L=S("CREATE_NEW_TAG_COMMAND"),Q=S("OPEN_NOTE_HISTORY_COMMAND"),U=S("CAPTURE_SAVE_COMMAND"),V=S("STAR_NOTE_COMMAND"),K=S("PIN_NOTE_COMMAND"),H=S("SUPER_TOGGLE_SEARCH"),G=S("SUPER_TOGGLE_TOOLBAR"),Y=S("SUPER_SEARCH_TOGGLE_CASE_SENSITIVE"),z=S("SUPER_SEARCH_TOGGLE_REPLACE_MODE"),Z=S("SUPER_SEARCH_NEXT_RESULT"),W=S("SUPER_SEARCH_PREVIOUS_RESULT"),q=S("SUPER_SHOW_MARKDOWN_PREVIEW"),J=(S("SUPER_EXPORT_JSON"),S("SUPER_EXPORT_MARKDOWN"),S("OPEN_PREFERENCES_COMMAND")),X=S("CHANGE_EDITOR_WIDTH_COMMAND"),$=S("TOGGLE_KEYBOARD_SHORTCUTS_MODAL");var ee,te;!function(e){e.Tab="Tab",e.Backspace="Backspace",e.Up="ArrowUp",e.Down="ArrowDown",e.Left="ArrowLeft",e.Right="ArrowRight",e.Enter="Enter",e.Escape="Escape",e.Home="Home",e.End="End",e.Space=" ",e.PageUp="PageUp",e.PageDown="PageDown"}(ee||(ee={}));class ne{constructor(e,t){this.platform=e,this.activeModifiers=new Set,this.commandHandlers=new Set,this.commandMap=new Map,this.keyboardShortcutHelpItems=new Set,this.addActiveModifier=e=>{if(e)switch(e){case g.Meta:this.isMac&&this.activeModifiers.add(e);break;case g.Ctrl:this.isMac||this.activeModifiers.add(e);break;default:this.activeModifiers.add(e)}},this.removeActiveModifier=e=>{e&&this.activeModifiers.delete(e)},this.cancelAllKeyboardModifiers=()=>{this.activeModifiers.clear()},this.handleComponentKeyDown=e=>{this.addActiveModifier(e)},this.handleComponentKeyUp=e=>{this.removeActiveModifier(e)},this.handleKeyDown=e=>{this.updateAllModifiersFromEvent(e),this.handleKeyboardEvent(e,m.Down)},this.handleKeyUp=e=>{this.updateAllModifiersFromEvent(e),this.handleKeyboardEvent(e,m.Up)},this.handleWindowBlur=()=>{for(const e of this.activeModifiers)this.activeModifiers.delete(e)},window.addEventListener("keydown",this.handleKeyDown),window.addEventListener("keyup",this.handleKeyUp),window.addEventListener("blur",this.handleWindowBlur);const n=function(e,t){const n=b(e);return[{command:C,key:"l",modifiers:[n,g.Shift]},{command:E,key:"e",modifiers:[n,g.Shift]},{command:I,code:"KeyN",modifiers:[g.Alt,g.Shift]},{command:_,key:ee.Down},{command:x,key:ee.Up},{command:P,code:"KeyF",modifiers:[g.Alt,g.Shift]},{command:k,key:ee.Escape},{command:B,key:"a",modifiers:[n]},{command:O,modifiers:[g.Alt]},{command:N,key:ee.Backspace,modifiers:[n]},{command:D,key:ee.Tab},{command:j,key:ee.Escape},{command:T,key:"f",modifiers:[n,g.Shift]},{command:M,key:"d",modifiers:[n,g.Shift],preventDefault:!0},{command:F,key:"/",modifiers:[n,g.Shift],preventDefault:!0},{command:R,code:"KeyT",modifiers:[n,g.Alt],preventDefault:!0},{command:L,code:"KeyN",modifiers:[n,g.Alt]},{command:Q,key:"h",modifiers:[n,g.Shift],preventDefault:!0},{command:U,key:"s",modifiers:[n],preventDefault:!0},{command:V,key:"s",modifiers:[n,g.Shift],preventDefault:!0},{command:K,key:"p",modifiers:[n,g.Shift],preventDefault:!0},{command:G,key:"k",modifiers:[n,g.Shift]},{command:H,key:"f",modifiers:[n]},{command:z,key:v(e)?void 0:"h",code:v(e)?"KeyF":void 0,modifiers:v(e)?[g.Alt,n]:[n]},{command:Y,key:"c",modifiers:[g.Alt]},{command:Z,key:"F3"},{command:W,key:"F3",modifiers:[g.Shift]},{command:q,key:"m",modifiers:[n,g.Shift],preventDefault:!0},{command:J,key:",",modifiers:[n],preventDefault:!0},{command:X,key:"j",modifiers:[n,g.Shift],preventDefault:!0},{command:$,key:"/",modifiers:[n]}]}(e);for(const e of n)this.registerShortcut(e)}get isMac(){return this.platform===y.Platform.MacDesktop||this.platform===y.Platform.MacWeb}deinit(){this.commandHandlers.clear(),window.removeEventListener("keydown",this.handleKeyDown),window.removeEventListener("keyup",this.handleKeyUp),window.removeEventListener("blur",this.handleWindowBlur),this.handleKeyDown=void 0,this.handleKeyUp=void 0,this.handleWindowBlur=void 0}updateAllModifiersFromEvent(e){for(const t of Object.values(g))e.getModifierState(t)?this.addActiveModifier(t):this.removeActiveModifier(t)}handleKeyboardEvent(e,t){for(const n of this.commandMap.keys()){const r=this.commandMap.get(n);r&&w(e,r)&&(r.preventDefault&&e.preventDefault(),this.handleCommand(n,e,t))}}handleCommand(e,t,n){const r=t.target;for(const i of Array.from(this.commandHandlers).reverse()){if(i.command!==e)continue;if(i.element&&t.target!==i.element)continue;if(i.elements&&!i.elements.includes(r))continue;if(i.notElement&&i.notElement===t.target)continue;if(i.notElementIds&&i.notElementIds.includes(r.id))continue;if(i.notTags&&i.notTags.includes(r.tagName))continue;const o=n===m.Down?i.onKeyDown:i.onKeyUp;if(o&&o(t))return}}triggerCommand(e,t){for(const n of Array.from(this.commandHandlers).reverse()){if(n.command!==e)continue;const r=n.onKeyDown||n.onKeyUp;if(r&&r(new KeyboardEvent("command-trigger"),t))return}}registerShortcut(e){this.commandMap.set(e.command,e)}addCommandHandler(e){this.commandHandlers.add(e);const t=this.getKeyboardShortcutHelpItemForHandler(e);if(t){const e=Array.from(this.keyboardShortcutHelpItems).find((e=>e.command===t.command));e&&this.keyboardShortcutHelpItems.delete(e),this.keyboardShortcutHelpItems.add(t)}return()=>{e.onKeyDown=void 0,e.onKeyDown=void 0,this.commandHandlers.delete(e),t&&this.keyboardShortcutHelpItems.delete(t)}}addCommandHandlers(e){const t=e.map((e=>this.addCommandHandler(e)));return()=>{for(const e of t)e()}}keyboardShortcutForCommand(e){const t=this.commandMap.get(e);if(t)return{platform:this.platform,...t}}getKeyboardShortcutHelpItemForHandler(e){const t=this.keyboardShortcutForCommand(e.command);if(t&&e.category&&e.description)return{...t,category:e.category,description:e.description}}registerExternalKeyboardShortcutHelpItem(e){return this.keyboardShortcutHelpItems.add(e),()=>{this.keyboardShortcutHelpItems.delete(e)}}registerExternalKeyboardShortcutHelpItems(e){const t=e.map((e=>this.registerExternalKeyboardShortcutHelpItem(e)));return()=>{for(const e of t)e()}}getRegisteredKeyboardShorcutHelpItems(){return Array.from(this.keyboardShortcutHelpItems)}}function re(e){if(e.startsWith("Digit"))return e.replace("Digit","");if(e.startsWith("Key"))return e.replace("Key","");switch(e){case"ArrowDown":return"↓";case"ArrowUp":return"↑";case"ArrowLeft":return"←";case"ArrowRight":return"→";default:return e}}function ie(e,t){const n=function(e){return e===y.Platform.MacDesktop||e===y.Platform.MacWeb}(t);return e===g.Meta?n?"⌘":"⊞":e===g.Ctrl?n?"⌃":"Ctrl":e===g.Alt?n?"⌥":"Alt":e===g.Shift?n?"⇧":"Shift":g[e]}function oe(e){var t;if(!e)return"";const n=(null===(t=e.key)||void 0===t?void 0:t.toUpperCase())||function(e=""){return e.replace("Key","").replace("Digit","")}(e.code);if(!e.modifiers||0===e.modifiers.length)return n;const r=e.modifiers.map((t=>ie(t,e.platform)));return v(e.platform)?`${r.join("")}${n}`:`${r.join("+")}+${n}`}!function(e){e.Purchase="purchase",e.Settings="settings",e.DemoToken="demo-token",e.AcceptSubscriptionInvite="accept-subscription-invite",e.UserRequest="user-request",e.AppViewRoute="route"}(te||(te={}));const se=["u2f","extension"];var ae,le,ce;!function(e){e.Onboarding="/onboard",e.None="/"}(ae||(ae={})),function(e){e.Onboarding="onboarding",e.Settings="settings",e.Purchase="purchase",e.AcceptSubscriptionInvite="accept-subscription-invite",e.UserRequest="user-request",e.Demo="demo",e.AppViewRoute="route",e.None="none"}(le||(le={}));class ue{constructor(e){this.url=new URL(e),this.path=this.url.pathname,this.searchParams=this.url.searchParams,this.parsedType=this.parseTypeFromQueryParameters()}get type(){return this.parsedType}get userRequestParams(){return this.checkForProperRouteType(le.UserRequest),{requestType:this.searchParams.get(te.UserRequest)}}get subscriptionInviteParams(){return this.checkForProperRouteType(le.AcceptSubscriptionInvite),{inviteUuid:this.searchParams.get(te.AcceptSubscriptionInvite)}}get demoParams(){return this.checkForProperRouteType(le.Demo),{token:this.searchParams.get(te.DemoToken)}}get settingsParams(){return this.checkForProperRouteType(le.Settings),{panel:this.searchParams.get(te.Settings)}}get purchaseParams(){return this.checkForProperRouteType(le.Purchase),{plan:this.searchParams.get("plan"),period:this.searchParams.get("period")}}get onboardingParams(){return this.checkForProperRouteType(le.Onboarding),{fromHomepage:!!this.searchParams.get("from_homepage")}}get appViewRouteParam(){this.checkForProperRouteType(le.AppViewRoute);const e=this.searchParams.get(te.AppViewRoute);if(se.includes(e))return this.searchParams.get(te.AppViewRoute)}checkForProperRouteType(e){if(this.parsedType!==e)throw new Error("Accessing invalid params")}parseTypeFromQueryParameters(){if(this.path===ae.Onboarding)return le.Onboarding;const e=["index.html","popup.html"].some((e=>this.path.endsWith(e)));if(this.path!==ae.None&&!e)return le.None;const t=new Map([[te.Purchase,le.Purchase],[te.Settings,le.Settings],[te.DemoToken,le.Demo],[te.AcceptSubscriptionInvite,le.AcceptSubscriptionInvite],[te.UserRequest,le.UserRequest],[te.AppViewRoute,le.AppViewRoute]]);for(const e of t.keys())if(this.searchParams.has(e))return t.get(e);return le.None}}!function(e){e.RouteChanged="route-changed"}(ce||(ce={}));class de extends a.wcN{constructor(e,t){super(t),this.application=e,this.internalEventBus=t,this.addAppEventObserver()}deinit(){super.deinit(),this.application=void 0,this.unsubApp()}getRoute(){return new ue(window.location.href)}get isDotOrg(){return"app.standardnotes.org"===window.location.host}removeQueryParameterFromURL(e){const t=new URLSearchParams(window.location.search);t.delete(e);const n=`${window.location.origin}${window.location.pathname}${t.toString()}`;window.history.replaceState(null,document.title,n)}addAppEventObserver(){this.unsubApp=this.application.addEventObserver((async e=>{e===a.n9K.LocalDataLoaded&&this.notifyRouteChange()}))}notifyRouteChange(){this.notifyEvent(ce.RouteChanged,this.getRoute())}}const he=0,pe=1,fe=6e4,ge=3e5,me=6e5,ye=36e5,ve="AutoLockIntervalKey";class Ae extends a.wcN{constructor(e,t){super(t),this.application=e,this.internalEventBus=t,this.addAppEventObserverAfterSubclassesFinishConstructing()}onAppLaunch(){this.beginPolling()}deinit(){this.cancelAutoLockTimer(),this.pollInterval&&clearInterval(this.pollInterval),this.application=void 0,this.unsubApp(),this.unsubApp=void 0,super.deinit()}addAppEventObserverAfterSubclassesFinishConstructing(){setTimeout((()=>{this.addAppEventObserver()}),0)}addAppEventObserver(){this.application.isLaunched()&&this.onAppLaunch(),this.unsubApp=this.application.addEventObserver((async e=>{e===a.n9K.Launched&&this.onAppLaunch()}))}lockApplication(){if(!this.application.hasPasscode())throw Error("Attempting to lock application with no passcode");this.application.lock().catch(console.error)}async setAutoLockInterval(e){return this.application.setValue(ve,e)}async getAutoLockInterval(){return await this.application.getValue(ve)||he}async deleteAutolockPreference(){await this.application.removeValue(ve),this.cancelAutoLockTimer()}beginPolling(){this.pollInterval=setInterval((async()=>{!await this.application.protections.isLocked()&&this.lockAfterDate&&new Date>this.lockAfterDate&&this.lockApplication();const e=document.hasFocus();e&&"hidden"===this.lastFocusState?this.documentVisibilityChanged(!0).catch(console.error):e||"visible"!==this.lastFocusState||this.documentVisibilityChanged(!1).catch(console.error),this.lastFocusState=e?"visible":"hidden"}),50)}getAutoLockIntervalOptions(){return[{value:he,label:"Off"},{value:pe,label:"Immediately"},{value:fe,label:"1m"},{value:ge,label:"5m"},{value:me,label:"10m"},{value:ye,label:"1h"}]}async documentVisibilityChanged(e){e?this.cancelAutoLockTimer():this.beginAutoLockTimer().catch(console.error)}async beginAutoLockTimer(){const e=await this.getAutoLockInterval();e!==he&&(this.lockAfterDate=(e=>{const t=new Date;return t.setSeconds(t.getSeconds()+e),t})(e/1e3))}cancelAutoLockTimer(){this.lockAfterDate=void 0}}var be;!function(e){e.AnonymousUserId="AnonymousUserId",e.ShowBetaWarning="ShowBetaWarning",e.ShowNoAccountWarning="ShowNoAccountWarning",e.FilesNavigationEnabled="FilesNavigationEnabled",e.MasterStatePersistenceKey="master-persistence-key"}(be||(be={}));const we={get(e){const t=localStorage.getItem(e);return t?JSON.parse(t):null},set(e,t){localStorage.setItem(e,JSON.stringify(t))},remove(e){localStorage.removeItem(e)}};var Se=n(84409);class Ce{constructor(e,t,n,r,i,o){this.items=e,this.mutator=t,this.sync=n,this.api=r,this.alerts=i,this.crypto=o}async performDownloadPlugins(){const e=await fetch("https://raw.githubusercontent.com/standardnotes/plugins/main/cdn/dist/packages.json"),t=await e.text(),n=JSON.parse(t);return Object.values(n)}async getInstallablePlugins(){return this.originalPlugins||(this.originalPlugins=await this.performDownloadPlugins()),this.filterInstallablePlugins(this.originalPlugins)}filterInstallablePlugins(e){return e.filter((e=>{if(!e.showInGallery)return!1;const t=(0,Se.FindNativeFeature)(e.identifier);return!(t&&!t.deprecated)&&!this.items.getDisplayableComponents().find((t=>t.identifier===e.identifier))})).sort(((e,t)=>e.name===t.name?0:e.name.toLowerCase()<t.name.toLowerCase()?-1:1))}async installPlugin(e){var t;if(![c.ContentType.TYPES.Component,c.ContentType.TYPES.Theme,c.ContentType.TYPES.ActionsExtension,c.ContentType.TYPES.ExtensionRepo].includes(e.content_type))return;const n=(0,Se.FindNativeFeature)(e.identifier);if(n&&!n.deprecated)return void this.alerts.alert("Unable to install plugin due to a conflict with a native feature.");if(e.url)for(const t of(0,Se.GetFeatures)())if(e.url.includes(t.identifier)&&!t.deprecated)return void this.alerts.alert("Unable to install plugin due to a conflict with a native feature.");const r=(0,d.FillItemContentSpecialized)({area:e.area,name:null!==(t=e.name)&&void 0!==t?t:"",package_info:e,valid_until:new Date(e.expires_at||0),hosted_url:e.url}),i=this.items.createTemplateItem(e.content_type,r);return await this.mutator.insertItem(i),this.sync.sync(),i}async getPluginDetailsFromUrl(e){var t;let n=e;try{n=this.crypto.base64Decode(e)}catch(e){}const i=await this.api.downloadFeatureUrl(n);if(null===(t=i.data)||void 0===t?void 0:t.error)return void await this.alerts.alert(a.mvL);let o=i.data;if((0,r.isString)(o))try{o=JSON.parse(o)}catch(e){}return o.content_type?o:void 0}async installExternalPlugin(e){if(!(0,Se.FindNativeFeature)(e.identifier)){if(e.url)for(const t of(0,Se.GetFeatures)())if(e.url.includes(t.identifier))return void await this.alerts.alert("Unable to install external plugin due to a conflict with a native feature.");return this.installPlugin(e)}await this.alerts.alert("Unable to install external plugin due to a conflict with a native feature.")}}class Ee{constructor(e){this.preferences=e}execute(){return c.Result.ok(this.preferences.getValue(d.PrefKey.EditorSpellcheck,d.PrefDefaults[d.PrefKey.EditorSpellcheck]))}}class Ie{constructor(e){this.environment=e}execute(){return c.Result.ok(this.environment===d.Environment.Mobile)}}const _e=()=>/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||navigator.userAgent.includes("Mac")&&"ontouchend"in document&&navigator.maxTouchPoints>1||window.platform===d.Platform.Ios,xe=()=>navigator.userAgent.toLowerCase().includes("android");class Pe{constructor(e){this._isNativeMobileWeb=e}execute(){return c.Result.ok(this._isNativeMobileWeb.execute().getValue()||_e()||xe())}}class ke{constructor(e,t){this.environment=e,this.platform=t}execute(){return c.Result.ok(this.environment===d.Environment.Mobile&&this.platform===d.Platform.Ios)}}class Be{constructor(e){this.items=e}execute(e){return c.Result.ok(this.items.itemsReferencingItem(e).filter((e=>e.content_type===c.ContentType.TYPES.Tag)))}}class Oe extends a.wcN{constructor(e,t){super(t),this.application=e,this.internalEventBus=t,this.observers=new Set,this.addAppEventObserverAfterSubclassesFinishConstructing()}async onAppStart(){}async onAppEvent(e){}addAppEventObserverAfterSubclassesFinishConstructing(){setTimeout((()=>{this.addAppEventObserver()}),0)}addAppEventObserver(){this.application.isStarted()&&this.onAppStart(),this.unsubApp=this.application.addEventObserver((async e=>{await this.onAppEvent(e),e===a.n9K.Started&&this.onAppStart()}))}addObserver(e){this.observers.add(e)}deinit(){this.application=void 0,this.observers.forEach((e=>e())),this.unsubApp(),this.unsubApp=void 0,super.deinit()}}class Ne{constructor(e){this.items=e}execute(e){const t=(0,Se.GetNativeThemes)().filter((t=>!e.excludeLayerable||!t.layerable));return{thirdParty:this.items.getDisplayableComponents().filter((e=>e.isTheme()&&void 0===(0,Se.FindNativeTheme)(e.identifier))).filter((t=>!e.excludeLayerable||!t.layerableTheme)).map((e=>new d.UIFeature(e))),native:t.map((e=>new d.UIFeature(e)))}}}class De{constructor(e,t){this.items=e,this.list=[],t&&(this.list=t)}getList(){return this.list.slice()}isEmpty(){return 0===this.list.length}clear(){this.list=[]}has(e){for(const t of this.list)if(t.equals(e))return!0;return!1}add(e){this.has(e)||this.list.push(e)}remove(e){this.list=this.list.filter((t=>!t.equals(e)))}asThemes(){const e=[];for(const t of this.list)if(t instanceof c.Uuid){const n=this.items.findItem(t.value);if(n){const t=new d.UIFeature(n);e.push(t)}}else{const n=(0,Se.FindNativeTheme)(t.value);if(n){const t=new d.UIFeature(n);e.push(t)}}return e}}const je=/-?\b[0-9]{1,3}\b/g;class Te{constructor(e){if(this.r=0,this.g=0,this.b=0,this.a=1,e.startsWith("rgb"))this.setFromRGB(e);else{if(!e.startsWith("#"))throw new Error("Invalid color");this.setFromHex(e)}}setFromHex(e){if(!e.startsWith("#"))throw new Error("Invalid color");const t=e.substring(1);if(3!==t.length&&6!==t.length)throw new Error("Invalid color");const n=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16);this.r=n,this.g=r,this.b=i}setFromRGB(e){if(!e.startsWith("rgb"))throw new Error("Invalid color");const t=e.match(je);if(!t||3!==t.length)throw new Error("Invalid color");const[n,r,i]=t.map((e=>parseInt(e,10)));if(n<0||n>255||r<0||r>255||i<0||i>255)throw new Error("Invalid color");this.r=n,this.g=r,this.b=i}setAlpha(e){if(e<0||e>1)throw new Error("Invalid alpha value");return this.a=e,this}toString(){return`rgba(${this.r}, ${this.g}, ${this.b}, ${this.a})`}isDark(){return(299*this.r+587*this.g+114*this.b)/1e3<=128}}const Me="cachedThemes",Fe="Default";class Re extends Oe{constructor(e,t,n,r){super(e,r),this.preferences=t,this.components=n,this.colorSchemeEventHandler=this.colorSchemeEventHandler.bind(this),this.themesActiveInTheUI=new De(e.items)}deinit(){this.themesActiveInTheUI.clear(),this.themesActiveInTheUI=void 0,this.preferences=void 0,this.components=void 0;const e=window.matchMedia("(prefers-color-scheme: dark)");null!=e.removeEventListener?e.removeEventListener("change",this.colorSchemeEventHandler):e.removeListener(this.colorSchemeEventHandler),super.deinit()}async onAppStart(){const e=this.application.desktopManager;e&&this.eventDisposers.push(e.registerUpdateObserver((e=>{const t=new d.UIFeature(e);t.isThemeComponent&&this.components.isThemeActive(t)&&(this.deactivateThemeInTheUI(t.uniqueIdentifier),setTimeout((()=>{this.activateTheme(t),this.cacheThemeState().catch(console.error)}),10))})))}async onAppEvent(e){var t;switch(e){case a.n9K.SignedOut:this.deactivateAllThemes(),this.themesActiveInTheUI.clear(),null===(t=this.application)||void 0===t||t.removeValue(Me,a.qt7.Nonwrapped).catch(console.error);break;case a.n9K.StorageReady:await this.activateCachedThemes();break;case a.n9K.FeaturesAvailabilityChanged:this.handleFeaturesAvailabilityChanged().catch(console.error);break;case a.n9K.Launched:if(!this.application.isNativeMobileWeb()){const e=window.matchMedia("(prefers-color-scheme: dark)");null!=e.addEventListener?e.addEventListener("change",this.colorSchemeEventHandler):e.addListener(this.colorSchemeEventHandler)}break;case a.n9K.LocalPreferencesChanged:this.handleLocalPreferencesChangeEvent()}}async handleMobileColorSchemeChangeEvent(){if(this.preferences.getLocalValue(a.dH$.UseSystemColorScheme,!1)){const e="dark"===await this.application.mobileDevice.getColorScheme();this.setThemeAsPerColorScheme(e)}}handleThemeStateChange(){let e=!1;const{features:t,uuids:n}=this.components.getActiveThemesIdentifiers(),r=new De(this.application.items,t),i=new De(this.application.items,n);for(const t of this.themesActiveInTheUI.getList())r.has(t)||i.has(t)||(this.deactivateThemeInTheUI(t),e=!0);for(const n of t)if(!this.themesActiveInTheUI.has(n)){const t=(0,Se.FindNativeTheme)(n.value);if(t){const n=new d.UIFeature(t);this.activateTheme(n),e=!0}}for(const t of n)if(!this.themesActiveInTheUI.has(t)){const n=this.application.items.findItem(t.value);if(n){const t=new d.UIFeature(n);this.activateTheme(t),e=!0}}e&&this.cacheThemeState().catch(console.error)}async handleLocalPreferencesChangeEvent(){this.handleThemeStateChange(),this.toggleTranslucentUIColors();const e=this.preferences.getLocalValue(a.dH$.UseSystemColorScheme,!1),t=this.preferences.getLocalValue(a.dH$.AutoLightThemeIdentifier,Fe),n=this.preferences.getLocalValue(a.dH$.AutoDarkThemeIdentifier,Se.NativeFeatureIdentifier.TYPES.DarkTheme),r=e!==this.lastUseDeviceThemeSettings||t!==this.lastAutoLightTheme||n!==this.lastAutoDarkTheme;if(r&&(this.lastUseDeviceThemeSettings=e,this.lastAutoLightTheme=t,this.lastAutoDarkTheme=n),r&&e){let e=window.matchMedia("(prefers-color-scheme: dark)").matches;this.application.isNativeMobileWeb()&&(e="dark"===await this.application.mobileDevice.getColorScheme()),this.setThemeAsPerColorScheme(e)}}async handleFeaturesAvailabilityChanged(){let e=!1;for(const t of this.themesActiveInTheUI.asThemes())this.application.features.getFeatureStatus(t.uniqueIdentifier)!==a.iKc.Entitled&&(this.deactivateThemeInTheUI(t.uniqueIdentifier),e=!0);const t=this.components.getActiveThemes();for(const n of t)this.themesActiveInTheUI.has(n.uniqueIdentifier)||(this.activateTheme(n),e=!0);if(this.preferences.getLocalValue(a.dH$.UseSystemColorScheme,!1)){let t=window.matchMedia("(prefers-color-scheme: dark)").matches;this.application.isNativeMobileWeb()&&(t="dark"===await this.application.mobileDevice.getColorScheme()),e=this.setThemeAsPerColorScheme(t)}e&&this.cacheThemeState()}colorSchemeEventHandler(e){this.preferences.getLocalValue(a.dH$.UseSystemColorScheme,!1)&&this.setThemeAsPerColorScheme(e.matches)}setThemeAsPerColorScheme(e){let t=!1;const n=e?a.dH$.AutoDarkThemeIdentifier:a.dH$.AutoLightThemeIdentifier,r=n===a.dH$.AutoDarkThemeIdentifier?Se.NativeFeatureIdentifier.TYPES.DarkTheme:Fe,i=new Ne(this.application.items),{thirdParty:o,native:s}=i.execute({excludeLayerable:!1}),l=[...o,...s],c=l.find((e=>this.components.isThemeActive(e)&&!e.layerable)),u=this.preferences.getLocalValue(n,r);if(u===Fe)(()=>{c&&(this.components.toggleTheme(c),t=!0)})();else{const e=l.find((e=>e.featureIdentifier===u));e&&(this.components.isThemeActive(e)?this.components.toggleOtherNonLayerableThemes(e):this.components.toggleTheme(e,!0).catch(console.error),t=!0)}return t}async activateCachedThemes(){const e=this.getCachedThemes();for(const t of e)this.activateTheme(t,!0)}deactivateAllThemes(){const e=this.themesActiveInTheUI.getList();for(const t of e)this.deactivateThemeInTheUI(t)}activateTheme(e,t=!1){if(this.themesActiveInTheUI.has(e.uniqueIdentifier))return;if(!t&&this.application.features.getFeatureStatus(e.uniqueIdentifier)!==a.iKc.Entitled)return;const n=this.application.componentManager.urlForFeature(e);if(!n)return;this.themesActiveInTheUI.add(e.uniqueIdentifier);const r=document.createElement("link");r.href=n,r.type="text/css",r.rel="stylesheet",r.media="screen,print",r.id=e.uniqueIdentifier.value,r.onload=()=>{this.syncThemeColorMetadata(),this.application.isNativeMobileWeb()&&setTimeout((()=>{const e=this.getBackgroundColor(),t=new Te(e);this.application.mobileDevice.handleThemeSchemeChange(t.isDark(),e)})),this.toggleTranslucentUIColors()},document.getElementsByTagName("head")[0].appendChild(r)}deactivateThemeInTheUI(e){var t;if(!this.themesActiveInTheUI.has(e))return;const n=document.getElementById(e.value);n&&(n.disabled=!0,null===(t=n.parentNode)||void 0===t||t.removeChild(n)),this.themesActiveInTheUI.remove(e),this.themesActiveInTheUI.isEmpty()&&(this.application.isNativeMobileWeb()&&this.application.mobileDevice.handleThemeSchemeChange(!1,"#ffffff"),this.toggleTranslucentUIColors())}getBackgroundColor(){const e=getComputedStyle(document.documentElement).getPropertyValue("--sn-stylekit-background-color").trim();return e.length?e:"#ffffff"}shouldUseTranslucentUI(){return this.preferences.getLocalValue(a.dH$.UseTranslucentUI,d.PrefDefaults[a.dH$.UseTranslucentUI])}toggleTranslucentUIColors(){if(!this.shouldUseTranslucentUI())return document.documentElement.style.removeProperty("--popover-background-color"),document.documentElement.style.removeProperty("--popover-backdrop-filter"),void document.body.classList.remove("translucent-ui");try{const e=new Te(this.getBackgroundColor()),t=e.isDark()?"blur(12px) saturate(190%) contrast(70%) brightness(80%)":"blur(12px) saturate(190%) contrast(50%) brightness(130%)",n=e.setAlpha(.65).toString();document.documentElement.style.setProperty("--popover-background-color",n),document.documentElement.style.setProperty("--popover-backdrop-filter",t),document.body.classList.add("translucent-ui")}catch(e){console.error(e)}}syncThemeColorMetadata(){const e=document.querySelector('meta[name="theme-color"]');e&&e.setAttribute("content",this.getBackgroundColor())}async cacheThemeState(){const e=this.themesActiveInTheUI.asThemes().map((e=>{if(e.isComponent){const t=e.asComponent.payloadRepresentation();return(0,d.CreateDecryptedLocalStorageContextPayload)(t)}return e.asFeatureDescription}));return this.application.setValue(Me,e,a.qt7.Nonwrapped)}getCachedThemes(){const e=this.application.getValue(Me,a.qt7.Nonwrapped);if(!e)return[];const t=[];for(const n of e)if("uuid"in n){const e=this.application.items.createPayloadFromObject(n),r=this.application.items.createItemFromPayload(e);t.push(new d.UIFeature(r))}else if("identifier"in n){const e=(0,Se.FindNativeTheme)(n.identifier);e&&t.push(new d.UIFeature(e))}return t}}var Le,Qe=n(54569);class Ue{hideToast(e){(0,Qe.Xd)(e)}showToast(e,t){return(0,Qe.fz)({type:e,message:t})}}!function(e){e.ItemListController="selected-items-controller",e.NavigationController="navigation-controller"}(Le||(Le={}));const Ve=["hotp","totp","steam","yandex"];class Ke{constructor(){this.convert=async(e,{insertNote:t,readFileAsText:n})=>{const r=await n(e),i=this.parseEntries(r);if(!i)throw new Error("Could not parse entries");const o=e.lastModified?new Date(e.lastModified):new Date,s=e.lastModified?new Date(e.lastModified):new Date,a=e.name.split(".")[0],l=JSON.stringify(i);return{successful:[await t({createdAt:o,updatedAt:s,title:a,text:l,noteType:Se.NoteType.Authentication,editorIdentifier:Se.NativeFeatureIdentifier.TYPES.TokenVaultEditor,useSuperIfPossible:!1})],errored:[]}}}getImportType(){return"aegis"}getSupportedFileTypes(){return["application/json"]}isContentValid(e){try{const t=JSON.parse(e);return t.db&&t.db.entries&&t.db.entries.every((e=>Ve.includes(e.type)))}catch(e){console.error(e)}return!1}parseEntries(e){try{return JSON.parse(e).db.entries.map((e=>({service:e.issuer,account:e.name,secret:e.info.secret,notes:e.note})))}catch(e){return console.error(e),null}}}var He=n(28879),Ge=n.n(He),Ye=n(89945),ze=n.n(Ye),Ze=n(10264),We=n.n(Ze),qe=n(79174),Je=n.n(qe),Xe=n(8139),$e=n.n(Xe);const et=e=>new Promise(((t,n)=>{const r=new FileReader;r.onload=e=>{var r;(null===(r=e.target)||void 0===r?void 0:r.result)?t(e.target.result):n()},r.readAsText(e)}));Ge().extend(ze()),Ge().extend(We());const tt="YYYYMMDDTHHmmss";class nt{constructor(e){this._generateUuid=e,this.convert=async(e,{insertNote:t,insertTag:n,linkItems:r,canUploadFiles:i,canUseSuper:o,convertHTMLToSuper:s,readFileAsText:a,uploadFile:l,cleanupItems:c})=>{var u,d,h;const p=await a(e),f=this.loadXMLString(p,"xml").getElementsByTagName("note"),g=[];function m(e){return g.filter((function(t){return t.content.title==e}))[0]}const y=[],v=[];for(const[a,p]of Array.from(f).entries()){const f=[];try{const e=p.getElementsByTagName("title")[0].textContent,c=null===(u=p.getElementsByTagName("created")[0])||void 0===u?void 0:u.textContent,d=p.getElementsByTagName("updated"),h=d.length?d[0].textContent:null,v=Array.from(p.getElementsByTagName("resource")).map(this.getResourceFromElement).filter(Boolean),A=p.getElementsByTagName("content")[0];let b=this.getXmlStringFromContentElement(A);if(!b)continue;b=b.replace(/<((en-media)[^<>]+)\/>/g,"<$1></$2>");const w=this.loadXMLString(b,"html").getElementsByTagName("en-note")[0],S=Array.from(w.getElementsByTagName("ul"));o&&(this.convertTopLevelDivsToParagraphs(w),this.convertListsToSuperFormatIfApplicable(S),this.convertLeftPaddingToSuperIndent(w)),this.removeEmptyAndOrphanListElements(w),this.unwrapTopLevelBreaks(w);const C=Array.from(w.getElementsByTagName("font"));for(const e of C)e.childNodes.forEach((e=>{e.textContent+=" "})),e.innerText=e.textContent||"";const E=Array.from(w.getElementsByTagName("en-media")),{uploadedFiles:I}=await this.replaceMediaElementsWithResources(E,v,i,l);f.push(...I);let _=w.innerHTML;o||(_=_.replace(/<\/div>/g,"</div>\n"),_=_.replace(/<li[^>]*>/g,"\n"),_=_.trim());const x=o?s(_,{addLineBreaks:!1}):this.stripHTML(_),P=c?Ge().utc(c,tt).toDate():new Date,k=h?Ge().utc(h,tt).toDate():P,B=await t({createdAt:P,updatedAt:k,title:e||`Imported note ${a+1} from Evernote`,text:x,useSuperIfPossible:o});y.push(B);for(const e of I)await r(B,e),y.push(e);const O=p.getElementsByTagName("tag");for(const e of Array.from(O)){const t=e.childNodes[0].nodeValue;let i=m(t);if(!i){const e=new Date;i=await n({createdAt:e,updatedAt:e,title:t||`Imported tag ${a+1} from Evernote`,references:[]}),g.push(i),y.push(i)}await r(B,i)}}catch(t){console.error(t),v.push({name:(null===(h=null===(d=p.getElementsByTagName("title"))||void 0===d?void 0:d[0])||void 0===h?void 0:h.textContent)||`${e.name} - Note #${a}`,error:t}),c(f).catch(console.error);continue}}return{successful:y,errored:v}},this.getResourceFromElement=e=>{var t,n,r,i;const o=null===(t=e.getElementsByTagName("mime")[0])||void 0===t?void 0:t.textContent;if(!o)return;const s=e.getElementsByTagName("resource-attributes")[0],a=null===(n=s.getElementsByTagName("source-url")[0])||void 0===n?void 0:n.textContent,l=(null===(r=s.getElementsByTagName("file-name")[0])||void 0===r?void 0:r.textContent)||this._generateUuid.execute().getValue(),c=e.getElementsByTagName("data")[0],u=c.getAttribute("encoding"),d=null===(i=c.textContent)||void 0===i?void 0:i.replace(/\n/g,"");if(!d)return;const h="data:"+o+";"+u+","+d;let p="";if(a&&a.startsWith("en-cache")){const e=a.split("+");p=e[e.length-2]}else"base64"===u&&(p=this.getMD5HashFromBase64(d));return p?{hash:p,data:h,fileName:l,mimeType:o}:void 0}}getImportType(){return"evernote"}getFileExtension(){return"enex"}isContentValid(e){return e.includes("<en-export")&&e.includes("</en-export>")}getXmlStringFromContentElement(e){let t;for(const n of Array.from(e.childNodes))if(n instanceof CDATASection){t=n.nodeValue;break}return t}getMD5HashFromBase64(e){const t=$e().parse(e);return Je()(t).toString()}convertTopLevelDivsToParagraphs(e){e.querySelectorAll("div").forEach((t=>{t.parentElement===e&&function(e,t){const n=Array.prototype.slice.call(e.attributes);e.outerHTML=`<p ${n.map((e=>e.name+'="'+e.value+'"')).join(" ")}>${e.innerHTML}</p>`}(t)}))}convertListsToSuperFormatIfApplicable(e){for(const t of e){if("true"!==t.style.getPropertyValue("--en-todo"))continue;t.setAttribute("__lexicallisttype","check");const e=t.getElementsByTagName("li");for(const t of Array.from(e))t.setAttribute("aria-checked",t.style.getPropertyValue("--en-checked"))}}convertLeftPaddingToSuperIndent(e){e.querySelectorAll("p").forEach((e=>{const t=e.style.paddingLeft;if(t){const n=parseInt(t)/2;e.style.textIndent=`${n}px`,e.style.paddingLeft=""}}))}removeEmptyAndOrphanListElements(e){Array.from(e.getElementsByTagName("ul, ol")).forEach((e=>{0===e.children.length&&e.remove()})),Array.from(e.getElementsByTagName("li")).forEach((e=>{const t=null===e.textContent||""===e.textContent.trim(),n=!e.closest("ul, ol");(t||n)&&e.remove()}))}unwrapTopLevelBreaks(e){Array.from(e.querySelectorAll("* > p > br, * > div > br")).forEach((e=>{const t=e.parentElement,n=Array.from(t.children);n.every((e=>"BR"===e.tagName))&&t.replaceWith(n[0])}))}getHTMLElementFromResource(e){let t=document.createElement("object");if(t.setAttribute("type",e.mimeType),t.setAttribute("data",e.data),e.mimeType.startsWith("image/"))t=document.createElement("img"),t.setAttribute("src",e.data),t.setAttribute("data-mime-type",e.mimeType);else if(e.mimeType.startsWith("audio/")){t=document.createElement("audio"),t.setAttribute("controls","controls");const n=document.createElement("source");n.setAttribute("src",e.data),n.setAttribute("type",e.mimeType),t.appendChild(n)}else if(e.mimeType.startsWith("video/")){t=document.createElement("video"),t.setAttribute("controls","controls");const n=document.createElement("source");n.setAttribute("src",e.data),n.setAttribute("type",e.mimeType),t.appendChild(n)}return t.setAttribute("data-filename",e.fileName),t}async getFileFromResource(e){const t=((e,t="")=>{const n=atob(e.split(",")[1]);t||(t=e.split(",")[0].split(":")[1].split(";")[0]);const r=new ArrayBuffer(n.length),i=new Uint8Array(r);for(let e=0;e<n.length;e++)i[e]=n.charCodeAt(e);return new Blob([r],{type:t})})(e.data,e.mimeType);return new File([t],e.fileName,{type:e.mimeType})}async replaceMediaElementsWithResources(e,t,n,r){const i=[],o=new Map;for(const s of e){const e=s.getAttribute("hash"),a=t.find((t=>t&&t.hash===e));if(!a)continue;if(!s.parentNode)continue;const l=o.get(a.hash),c=n?l||await r(await this.getFileFromResource(a)):void 0;if(c){const e=document.createElement("div");e.setAttribute("data-lexical-file-uuid",c.uuid),s.parentNode.replaceChild(e,s),i.push(e),l||o.set(a.hash,c);continue}const u=this.getHTMLElementFromResource(a);s.parentNode.replaceChild(u,s),i.push(u)}return{replacedElements:i,uploadedFiles:Array.from(o.values())}}loadXMLString(e,t){return(new DOMParser).parseFromString(e,`text/${t}`)}stripHTML(e){const t=document.createElement("html");return t.innerHTML=e,t.textContent||t.innerText||""}}class rt{constructor(){this.convert=async(e,{insertNote:t,convertMarkdownToSuper:n,readFileAsText:i})=>{const o=await i(e),{name:s}=(0,r.parseFileName)(e.name),a=e.lastModified?new Date(e.lastModified):new Date,l=e.lastModified?new Date(e.lastModified):new Date;return{successful:[await t({createdAt:a,updatedAt:l,title:s,text:n(o),useSuperIfPossible:!0})],errored:[]}}}getImportType(){return"plaintext"}getSupportedFileTypes(){return["text/plain","text/markdown"]}isContentValid(e){return!0}static isValidPlaintextFile(e){return"text/plain"===e.type||"text/markdown"===e.type}}class it{constructor(){this.convert=async(e,{insertNote:t,canUseSuper:n,convertHTMLToSuper:r,convertMarkdownToSuper:i,readFileAsText:o})=>{const s=await o(e),a=await this.tryParseAsJson(s,t,i)||await this.tryParseAsHtml(s,e,t,r,n);if(a)return{successful:[a],errored:[]};throw new Error("Could not parse Google Keep backup file")}}getImportType(){return"google-keep"}getSupportedFileTypes(){return["text/html","application/json"]}isContentValid(e){try{const t=JSON.parse(e);return it.isValidGoogleKeepJson(t)}catch(e){console.error(e)}return!!(e.length>0&&e.includes('class="content"'))}async tryParseAsHtml(e,t,n,r,i){var o;const s=document.createElement("html");s.innerHTML=e;const a=s.getElementsByClassName("heading")[0],l=new Date((null==a?void 0:a.textContent)||"");null==a||a.remove();const c=s.getElementsByClassName("content")[0];if(!c)throw new Error("Could not parse content. Content element not found.");let u;const d=c.getElementsByTagName("ul");if(Array.from(d).forEach((e=>{e.setAttribute("__lexicallisttype","check");const t=e.getElementsByTagName("li");Array.from(t).forEach((e=>{var t;const n=e.getElementsByClassName("bullet")[0];null==n||n.remove();const r=e.classList.contains("checked");e.setAttribute("aria-checked",r?"true":"false"),i||(e.textContent=`- ${r?"[x]":"[ ]"} ${null===(t=e.textContent)||void 0===t?void 0:t.trim()}\n`)}))})),i?u=r(s.innerHTML,{addLineBreaks:!1}):(c.innerHTML=c.innerHTML.replace(/<br>/g,"\n"),u=c.textContent),!u)throw new Error("Could not parse content");const h=(null===(o=s.getElementsByClassName("title")[0])||void 0===o?void 0:o.textContent)||t.name;return await n({createdAt:l,updatedAt:l,title:h,text:u,useSuperIfPossible:!0})}static isValidGoogleKeepJson(e){return"string"!=typeof e.textContent?!("object"!=typeof e.listContent||!Array.isArray(e.listContent))&&e.listContent.every((e=>"string"==typeof e.text&&"boolean"==typeof e.isChecked)):"string"==typeof e.title&&"number"==typeof e.userEditedTimestampUsec&&"boolean"==typeof e.isArchived&&"boolean"==typeof e.isTrashed&&"boolean"==typeof e.isPinned&&"string"==typeof e.color}async tryParseAsJson(e,t,n){try{const r=JSON.parse(e);if(!it.isValidGoogleKeepJson(r))return null;const i=new Date(r.userEditedTimestampUsec/1e3);let o;return o="textContent"in r?r.textContent:r.listContent.map((e=>e.isChecked?`- [x] ${e.text}`:`- [ ] ${e.text}`)).join("\n"),o=n(o),await t({createdAt:i,updatedAt:i,title:r.title,text:o,archived:Boolean(r.isArchived),trashed:Boolean(r.isTrashed),pinned:Boolean(r.isPinned),useSuperIfPossible:!0})}catch(e){return console.error(e),null}}}const ot=e=>e.id&&null!=e.content&&e.creationDate&&e.lastModified;class st{constructor(){this.convert=async(e,{insertNote:t,readFileAsText:n})=>{const r=await n(e),i=await this.parse(r,t);if(!i)throw new Error("Could not parse notes");return{successful:i,errored:[]}}}getImportType(){return"simplenote"}getSupportedFileTypes(){return["application/json"]}isContentValid(e){try{const t=JSON.parse(e);return t.activeNotes&&t.activeNotes.every(ot)||t.trashedNotes&&t.trashedNotes.every(ot)}catch(e){console.error(e)}return!1}createNoteFromItem(e,t,n){var r,i;const o=new Date(e.creationDate),s=new Date(e.lastModified),a=((e,t)=>{const n=e.indexOf("\r\n");return n>-1?[e.slice(0,n),e.slice(n+2)]:[]})(e.content),l=null!==(r=a[0])&&void 0!==r?r:o.toLocaleString();return n({createdAt:o,updatedAt:s,title:l,text:null!==(i=a[1])&&void 0!==i?i:e.content,trashed:t,useSuperIfPossible:!0})}async parse(e,t){try{const n=JSON.parse(e),r=await Promise.all(n.activeNotes.reverse().map((e=>this.createNoteFromItem(e,!1,t)))),i=await Promise.all(n.trashedNotes.reverse().map((e=>this.createNoteFromItem(e,!0,t))));return[...r,...i]}catch(e){return console.error(e),null}}}class at{constructor(){this.convert=async(e,{insertNote:t,convertHTMLToSuper:n,readFileAsText:i})=>{const o=await i(e),{name:s}=(0,r.parseFileName)(e.name),a=e.lastModified?new Date(e.lastModified):new Date,l=e.lastModified?new Date(e.lastModified):new Date,c=n(o);return{successful:[await t({createdAt:a,updatedAt:l,title:s,text:c,useSuperIfPossible:!0})],errored:[]}}}getImportType(){return"html"}getSupportedFileTypes(){return["text/html"]}isContentValid(e){return!0}}class lt{constructor(e){this.converterService=e,this.convert=async(e,{insertNote:t,readFileAsText:n})=>{const i=await n(e),o={successful:[],errored:[]};if(!this.converterService.isValidSuperString(i))throw new Error("Content is not valid Super JSON");const{name:s}=(0,r.parseFileName)(e.name),a=e.lastModified?new Date(e.lastModified):new Date,l=e.lastModified?new Date(e.lastModified):new Date,c=await t({createdAt:a,updatedAt:l,title:s,text:i,useSuperIfPossible:!0});return o.successful.push(c),o}}getImportType(){return"super"}getSupportedFileTypes(){return["application/json"]}isContentValid(e){return this.converterService.isValidSuperString(e)}}class ct{constructor(e,t,n,i,o,s,l,u){this.features=e,this.mutator=t,this.items=n,this.superConverterService=i,this.filesController=o,this.linkingController=s,this._generateUuid=l,this.files=u,this.converters=new Set,this.detectService=async e=>{const t=await et(e),{ext:n}=(0,r.parseFileName)(e.name);for(const r of this.converters){const i=r.getSupportedFileTypes&&r.getSupportedFileTypes().includes(e.type),o=r.getFileExtension&&r.getFileExtension()===n;if((i||o)&&r.isContentValid(t))return r.getImportType()}return null},this.insertNote=async({createdAt:e,updatedAt:t,title:n,text:r,noteType:i,editorIdentifier:o,trashed:s=!1,archived:l=!1,pinned:u=!1,useSuperIfPossible:d})=>{i!==Se.NoteType.Super||this.canUseSuper()||(i=void 0),o&&this.features.getFeatureStatus(Se.NativeFeatureIdentifier.create(o).getValue())!==a.iKc.Entitled&&(o=void 0);const h=d&&this.canUseSuper();if(new Blob([r]).size>3e6)throw new Error("Note is too large to import");const p=this.items.createTemplateItem(c.ContentType.TYPES.Note,{title:n,text:r,references:[],noteType:h?Se.NoteType.Super:i,trashed:s,archived:l,pinned:u,editorIdentifier:h?Se.NativeFeatureIdentifier.TYPES.SuperEditor:o},{created_at:e,updated_at:t});return await this.mutator.insertItem(p)},this.insertTag=async({createdAt:e,updatedAt:t,title:n,references:r})=>{const i=this.items.createTemplateItem(c.ContentType.TYPES.Tag,{title:n,expanded:!1,iconString:"",references:r},{created_at:e,updated_at:t});return await this.mutator.insertItem(i)},this.canUploadFiles=()=>this.features.getFeatureStatus(Se.NativeFeatureIdentifier.create(Se.NativeFeatureIdentifier.TYPES.Files).getValue())===a.iKc.Entitled,this.uploadFile=async e=>{if(this.canUploadFiles())try{return await this.filesController.uploadNewFile(e,{showToast:!0})}catch(e){return void console.error(e)}},this.linkItems=async(e,t)=>{await this.linkingController.linkItems(e,t,!1)},this.cleanupItems=async e=>{for(const t of e)(0,d.isFile)(t)&&await this.files.deleteFile(t),await this.mutator.deleteItems([t])},this.canUseSuper=()=>this.features.getFeatureStatus(Se.NativeFeatureIdentifier.create(Se.NativeFeatureIdentifier.TYPES.SuperEditor).getValue())===a.iKc.Entitled,this.convertHTMLToSuper=(e,t)=>this.canUseSuper()?this.superConverterService.convertOtherFormatToSuperString(e,"html",{html:t}):e,this.convertMarkdownToSuper=e=>this.canUseSuper()?this.superConverterService.convertOtherFormatToSuperString(e,"md"):e,this.registerNativeConverters()}registerNativeConverters(){this.converters.add(new Ke),this.converters.add(new it),this.converters.add(new st),this.converters.add(new rt),this.converters.add(new nt(this._generateUuid)),this.converters.add(new at),this.converters.add(new lt(this.superConverterService))}async importFromFile(e,t){const n=this.canUseSuper();if("super"===t&&!n)throw new Error("Importing Super notes requires a subscription");const r=[],i=[];for(const o of this.converters){if(o.getImportType()!==t)continue;const s=await et(e);if(!o.isContentValid(s))throw new Error("Content is not valid");const a=await o.convert(e,{insertNote:this.insertNote,insertTag:this.insertTag,canUploadFiles:this.canUploadFiles(),uploadFile:this.uploadFile,canUseSuper:n,convertHTMLToSuper:this.convertHTMLToSuper,convertMarkdownToSuper:this.convertMarkdownToSuper,readFileAsText:et,linkItems:this.linkItems,cleanupItems:this.cleanupItems});r.push(...a.successful),i.push(...a.errored);break}return{successful:r,errored:i}}}var ut;!function(e){e.VaultDisplayOptionsChanged="VaultDisplayOptionsChanged"}(ut||(ut={}));var dt=n(80075);class ht extends Oe{constructor(e,t){super(e,t),this.exclusivelyShownVault=void 0,this.isVaultExplicitlyExcluded=e=>{var t;return null!==(t=this.options.isVaultExplicitlyExcluded(e))&&void 0!==t&&t},this.isVaultExclusivelyShown=e=>this.options.isVaultExclusivelyShown(e),this.hideVault=e=>{const t=this.application.vaultLocks.getLockedvaults(),n=this.options.newOptionsByExcludingVault(e,t);this.setVaultSelectionOptions(n)},this.unhideVault=async e=>{if(this.application.vaultLocks.isVaultLocked(e)&&!await this.unlockVault(e))return;const t=this.application.vaultLocks.getLockedvaults(),n=this.options.newOptionsByUnexcludingVault(e,t);this.setVaultSelectionOptions(n)},this.showOnlyVault=async e=>{if(this.application.vaultLocks.isVaultLocked(e)&&!await this.unlockVault(e))return;const t=new d.VaultDisplayOptions({exclusive:e.systemIdentifier});this.setVaultSelectionOptions(t)},this.setVaultSelectionOptions=e=>{const t=this.options;if(this.options=e,!t.isInExclusiveDisplayMode()&&e.isInExclusiveDisplayMode()&&(this.previousMultipleSelectionOptions=t),this.isInExclusiveDisplayMode()){const e=this.application.vaults.getVault({keySystemIdentifier:this.options.getExclusivelyShownVault()});this.exclusivelyShownVault=e.isFailed()?void 0:e.getValue()}else this.exclusivelyShownVault=void 0;this.application.items.setVaultDisplayOptions(e),this.notifyEvent(ut.VaultDisplayOptionsChanged,e),this.application.isLaunched()&&this.application.setValue(a.QtK.VaultSelectionOptions,e.getPersistableValue())},this.loadVaultSelectionOptionsFromDisk=()=>{const e=this.application.getValue(a.QtK.VaultSelectionOptions);if(!e)return;const t=d.VaultDisplayOptions.FromPersistableValue(e);this.options=t,this.notifyEvent(ut.VaultDisplayOptionsChanged,t)},this.options=new d.VaultDisplayOptions({exclude:[],locked:[]}),(0,dt.rC)(this,{options:dt.LO,isVaultExplicitlyExcluded:dt.LO,isVaultExclusivelyShown:dt.LO,exclusivelyShownVault:dt.LO,hideVault:dt.aD,unhideVault:dt.aD,showOnlyVault:dt.aD}),t.addEventHandler(this,a.h21.VaultLocked),t.addEventHandler(this,a.h21.VaultUnlocked),t.addEventHandler(this,a.n9K.ApplicationStageChanged),this.addObserver(e.items.streamItems(c.ContentType.TYPES.VaultListing,(({removed:e})=>{e.some((e=>{var t;return e.uuid===(null===(t=this.exclusivelyShownVault)||void 0===t?void 0:t.uuid)}))&&this.changeToMultipleVaultDisplayMode()})))}async handleEvent(e){e.type===a.h21.VaultLocked||e.type===a.h21.VaultUnlocked?this.handleVaultLockingStatusChanged():e.type===a.n9K.ApplicationStageChanged&&e.payload.stage===a.Ugm.StorageDecrypted_09&&this.loadVaultSelectionOptionsFromDisk()}handleVaultLockingStatusChanged(){const e=this.application.vaultLocks.getLockedvaults(),t=this.options.newOptionsByIntakingLockedVaults(e);this.setVaultSelectionOptions(t)}getOptions(){return this.options}isVaultDisabledOrLocked(e){return this.options.isVaultDisabledOrLocked(e)}isInExclusiveDisplayMode(){return this.options.isInExclusiveDisplayMode()}getItemVault(e){return this.application.items.isTemplateItem(e)?this.exclusivelyShownVault?this.exclusivelyShownVault:void 0:this.application.vaults.getItemVault(e)}changeToMultipleVaultDisplayMode(){const e=this.application.vaults.getVaults(),t=this.application.vaultLocks.getLockedvaults(),n=this.previousMultipleSelectionOptions?this.previousMultipleSelectionOptions.getOptions().exclude:e.map((e=>e.systemIdentifier)).filter((e=>{var t;return e!==(null===(t=this.exclusivelyShownVault)||void 0===t?void 0:t.systemIdentifier)})),r=new d.VaultDisplayOptions({exclude:n,locked:t.map((e=>e.systemIdentifier))});this.setVaultSelectionOptions(r)}async unlockVault(e){if(!this.application.vaultLocks.isVaultLocked(e))throw new Error("Attempting to unlock a vault that is not locked.");const t=new a.tv4([new a.FEo(a.tQn.None,void 0,"Password")],a.Ps8.Custom,!0,a.NiJ.UnlockVault(e.name),a.NiJ.EnterVaultPassword);return new Promise((n=>{this.application.challenges.addChallengeObserver(t,{onCancel(){n(!1)},onNonvalidatedSubmit:async r=>{const i=r.getDefaultValue();if(!i)return this.application.challenges.completeChallenge(t),void n(!1);const o=i.value;if(!await this.application.vaultLocks.unlockNonPersistentVault(e,o))return this.application.challenges.setValidationStatusForChallenge(t,i,!1),void n(!1);this.application.challenges.completeChallenge(t),n(!0)}}),this.application.challenges.promptForChallengeResponse(t)}))}deinit(){this.options=void 0,super.deinit()}}},81346:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addYearsToDate=t.addMonthsToDate=t.addDaysToDate=t.addHoursToDate=void 0,t.addHoursToDate=function(e,t){const n=new Date(e);return n.setHours(n.getHours()+t),n},t.addDaysToDate=function(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n},t.addMonthsToDate=function(e,t){const n=new Date(e);return n.setMonth(n.getMonth()+t),n},t.addYearsToDate=function(e,t){const n=new Date(e);return n.setFullYear(n.getFullYear()+t),n}},90622:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Deferred=void 0,t.Deferred=()=>{let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return{resolve:e,reject:t,promise:n}}},75760:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DependencyContainer=void 0;const r=n(37225),i=n(75807);t.DependencyContainer=class{constructor(){this.factory=new Map,this.dependencies=new Map}deinit(){this.factory.clear();const e=this.getAll();for(const t of e)(0,i.isDeinitable)(t)&&t.deinit();this.dependencies.clear()}getAll(){return Array.from(this.dependencies.values()).filter(r.isNotUndefined)}bind(e,t){this.factory.set(e,t)}get(e){const t=this.dependencies.get(e);if(t)return t;const n=this.factory.get(e);if(!n)throw new Error(`No dependency maker found for ${e.toString()}`);const r=n();return r?(this.dependencies.set(e,r),r):void 0}}},75807:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canBlockDeinit=t.isDeinitable=void 0,t.isDeinitable=function(e){if(!e)throw new Error("Service is undefined");return"function"==typeof e.deinit},t.canBlockDeinit=function(e){if(!e)throw new Error("Service is undefined");return"function"==typeof e.blockDeinit}},12377:(e,t)=>{"use strict";function n(e){const t=/(?:\.([^.]+))$/.exec(e),n=(null==t?void 0:t[1])||"";return{name:e.includes(".")?e.substring(0,e.lastIndexOf(".")):e,ext:n}}function r(e){return e.trim().replace(/[.\\/:"?*|<>]/g,"_")}function i(e,t){return e.length>t?e.slice(0,t):e}Object.defineProperty(t,"__esModule",{value:!0}),t.parseAndCreateZippableFileName=t.createZippableFileName=t.truncateFileName=t.sanitizeFileName=t.parseFileName=void 0,t.parseFileName=n,t.sanitizeFileName=r,t.truncateFileName=i;function o(e,t="",n="txt",o=100){return i(r(e),o)+(t+".")+n}t.createZippableFileName=o,t.parseAndCreateZippableFileName=function(e,t=""){const{name:r,ext:i}=n(e);return o(r,t,i)}},33638:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},91379:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=void 0;class n{constructor(e){this.appIdentifier=e,this.level="none"}canLog(e){if("none"===this.level)return!1;const t=["debug","info","warn","error"];return t.indexOf(e)>=t.indexOf(this.level)}setLevel(e){this.level=e}debug(e,...t){this.canLog("debug")&&this.logWithColor(e,...t)}info(e,...t){this.canLog("info")&&this.logWithColor(e,...t)}warn(e,...t){this.canLog("warn")&&console.warn(e,...t)}error(e,...t){this.canLog("error")&&console.error(e,...t)}logWithColor(...e){const t=new Date,n=`${t.toLocaleTimeString().replace(" PM","").replace(" AM","")}.${t.getMilliseconds()}`;this.customLog(`%c${this.appIdentifier}%c${n}`,"color: font-weight: bold; margin-right: 4px","color: gray",...e)}customLog(...e){Function.prototype.apply.call(console.log,console,arguments)}}t.Logger=n,t.default=n},13777:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},47887:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.classNames=void 0;const r=n(37225);t.classNames=(...e)=>e.map((e=>"string"==typeof e?e:null)).filter(r.isNotUndefined).join(" ")},92484:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=void 0,t.debounce=function(e,t=50,n={}){var r,i;let o;const s=null!==(r=n.isImmediate)&&void 0!==r&&r,a=null!==(i=n.callback)&&void 0!==i&&i,l=n.maxWait;let c=Date.now(),u=[];const d=function(...n){const r=this;return new Promise(((i,d)=>{const h=s&&void 0===o;if(void 0!==o&&clearTimeout(o),o=setTimeout((function(){if(o=void 0,c=Date.now(),!s){const t=e.apply(r,n);a&&a(t),u.forEach((({resolve:e})=>e(t))),u=[]}}),function(){if(void 0!==l){const e=Date.now()-c;if(e+t>=l)return l-e}return t}()),h){const t=e.apply(r,n);return a&&a(t),i(t)}u.push({resolve:i,reject:d})}))};return d.cancel=function(e){void 0!==o&&clearTimeout(o),u.forEach((({reject:t})=>t(e))),u=[]},d}},37225:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.assertUnreachable=t.sleep=t.truncateHexString=t.hasGetter=t.isValidUrl=t.deepFreeze=t.pickByCopy=t.deepMerge=t.Copy=t.joinPaths=t.omitByCopy=t.omitInPlace=t.withoutLastElement=t.jsonParseEmbeddedKeys=t.topLevelCompare=t.dateSorted=t.omitUndefinedCopy=t.sortByKey=t.sortedCopy=t.objectToValueArray=t.arrayByRemovingFromIndex=t.addAtIndex=t.removeFromIndex=t.compareValues=t.compareArrayReferences=t.arrayByDifference=t.filterFromArray=t.addIfUnique=t.removeFromArray=t.subtractFromArray=t.extendArray=t.lastElement=t.uniqueArrayByKey=t.uniqueArray=t.uniqCombineObjArrays=t.greaterOfTwoDates=t.isString=t.isEmpty=t.isNotUndefined=t.isNullOrUndefined=t.isFunction=t.isObject=t.sureSearchArray=t.searchArray=t.findInArray=t.isReactNativeEnvironment=t.isWebCryptoAvailable=t.isWebEnvironment=t.dictToArray=t.getGlobalScope=void 0,t.pluralize=t.spaceSeparatedStrings=t.useBoolean=t.assert=t.logWithColor=t.log=t.secondHalfOfString=t.firstHalfOfString=t.splitString=t.nonSecureRandomIdentifier=t.dateToLocalizedString=t.sanitizeHtmlString=t.convertTimestampToMilliseconds=t.arraysEqual=t.naturalSort=t.isSameDay=void 0;const i=n(35368),o=n(76635),s="undefined"!=typeof Intl?new Intl.Collator("en",{numeric:!0}):void 0;function a(){return"undefined"!=typeof window?window:void 0!==n.g?n.g:null}function l(){return null!==a()}function c(){return"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function u(e,t){return(0,o.find)(e,t)}function d(e){return null!==e&&("function"==typeof e||"object"==typeof e)}function h(e){return null==e}function p(e,t){const n=e.indexOf(t);-1!==n&&e.splice(n,1)}function f(e,t){e.splice(t,1)}function g(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function m(e){return e instanceof Date?new Date(e):d(e)?JSON.parse(JSON.stringify(e)):e}var y;let v;function A(e,t,...n){const r=new Date;!function(...e){Function.prototype.apply.call(console.log,console,arguments)}(`%c${e}%c${r.toLocaleTimeString().replace(" PM","").replace(" AM","")}.${r.getMilliseconds()}`,`color: ${t}; font-weight: bold; margin-right: 4px`,"color: gray",...n)}t.getGlobalScope=a,t.dictToArray=function(e){return Object.values(e)},t.isWebEnvironment=l,t.isWebCryptoAvailable=function(){return l()&&!c()&&!(document&&document.documentMode)||/Edge/.test(navigator.userAgent)&&window.crypto&&!!window.crypto.subtle},t.isReactNativeEnvironment=c,t.findInArray=function(e,t,n){return e.find((e=>e[t]===n))},t.searchArray=u,t.sureSearchArray=function(e,t){return u(e,t)},t.isObject=d,t.isFunction=function(e){return null!==e&&"function"==typeof e},t.isNullOrUndefined=h,t.isNotUndefined=function(e){return null!=e},t.isEmpty=function(e){return!e||0===e.length},t.isString=function(e){return"string"==typeof e||e instanceof String},t.greaterOfTwoDates=function(e,t){return e>t?e:t},t.uniqCombineObjArrays=function(e,t,n){return(0,o.uniqWith)(e.concat(t),((e,t)=>{for(const r of n)if(e[r]!==t[r])return!1;return!0}))},t.uniqueArray=function(e){return(0,o.uniq)(e)},t.uniqueArrayByKey=function(e,t){return(0,o.uniqWith)(e,((e,n)=>e[t]===n[t]))},t.lastElement=function(e){return e[e.length-1]},t.extendArray=function(e,t){for(const n of t)e.push(n)},t.subtractFromArray=function(e,t){for(const n of t)p(e,n)},t.removeFromArray=p,t.addIfUnique=function(e,t){return!e.includes(t)&&(e.push(t),!0)},t.filterFromArray=function(e,t){(0,o.remove)(e,t)},t.arrayByDifference=function(e,t){return e.filter((e=>!t.includes(e))).concat(t.filter((t=>!e.includes(t))))},t.compareArrayReferences=function(e,t){return e.length===t.length&&e.every(((e,n)=>e===t[n]))},t.compareValues=function(e,t){return!(e&&!t||!e&&t)&&(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():e instanceof String&&t instanceof String?e===t:g(e,t))},t.removeFromIndex=f,t.addAtIndex=function(e,t,n){e.splice(n,0,t)},t.arrayByRemovingFromIndex=function(e,t){const n=e.slice();return f(n,t),n},t.objectToValueArray=function(e){const t=[];for(const n of Object.keys(e))t.push(e[n]);return t},t.sortedCopy=function(e){const t=Object.keys(e).sort(),n={};for(const r of t)n[r]=e[r];return m(n)},t.sortByKey=(e,t)=>{const n=[...e];return n.sort(((e,n)=>{const r=e[t],i=n[t];return r<i?-1:r>i?1:0})),n},t.omitUndefinedCopy=function(e){const t={};for(const n of Object.keys(e))h(e[n])||(t[n]=e[n]);return t},t.dateSorted=function(e,t,n=!0){return e.sort(((e,r)=>{const i=e[t].getTime(),o=r[t].getTime(),s=n?1:-1;return i<o?-1*s:i>o?1*s:0}))},t.topLevelCompare=g,t.jsonParseEmbeddedKeys=function(e){const t={};for(const n of Object.keys(e)){let r;try{r=JSON.parse(e[n])}catch(t){r=e[n]}t[n]=r}return t},t.withoutLastElement=e=>e.slice(0,-1),t.omitInPlace=function(e,t){if(e)for(const n of t)delete e[n]},t.omitByCopy=function(e,t){if(h(e))return;const n=Object.assign({},e);for(const e of t)delete n[e];return n},t.joinPaths=function(...e){return e.map(((e,t)=>0===t?e.trim().replace(/[/]*$/g,""):e.trim().replace(/(^[/]*|[/]*$)/g,""))).filter((e=>e.length)).join("/")},t.Copy=m,t.deepMerge=function(e,t){if(!e||!t)throw"Attempting to deepMerge with null values";return(0,o.mergeWith)(e,t,((e,t)=>{if((0,o.isArray)(e))return t})),e},t.pickByCopy=function(e,t){const n={};for(const r of t)n[r]=e[r];return m(n)},t.deepFreeze=function e(t){const n=Object.getOwnPropertyNames(t);for(const r of n){const n=t[r];n&&"object"==typeof n&&!Object.isFrozen(n)?t[r]=e(n):t[r]=n}return Object.freeze(t)},t.isValidUrl=function(e){try{return new URL(e),!0}catch(e){return!1}},t.hasGetter=function(e,t){const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t);return n&&!h(n.get)},t.truncateHexString=function(e,t){const n=t/4;return e.substring(0,n)},t.sleep=function(e,t=!0,n=""){return r(this,void 0,void 0,(function*(){return t&&console.warn(`Sleeping for ${e}ms ${n}`),new Promise((t=>{setTimeout((function(){t()}),e)}))}))},t.assertUnreachable=function(e){throw Error("Unchecked case "+e)},t.isSameDay=function(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()},t.naturalSort=function(e,t,n="asc"){switch(n){case"asc":return[...e].sort(s?(e,n)=>s.compare(e[t],n[t]):(e,n)=>e[t].localeCompare(n[t],"en",{numeric:!0}));case"desc":return[...e].sort(s?(e,n)=>s.compare(n[t],e[t]):(e,n)=>n[t].localeCompare(e[t],"en",{numeric:!0}))}},t.arraysEqual=function(e,t){return e.length===t.length&&e.every((e=>t.includes(e)))&&t.every((t=>e.includes(t)))},function(e){e[e.Seconds=10]="Seconds",e[e.Milliseconds=13]="Milliseconds",e[e.Microseconds=16]="Microseconds"}(y||(y={})),t.convertTimestampToMilliseconds=function(e){switch(String(e).length){case y.Seconds:return 1e3*e;case y.Milliseconds:return e;case y.Microseconds:return Math.floor(e/1e3);default:throw`Unhandled timestamp precision: ${e}`}},t.sanitizeHtmlString=function(e){return(0,i.sanitize)(e)},t.dateToLocalizedString=function(e){if("undefined"!=typeof Intl&&Intl.DateTimeFormat&&"undefined"!=typeof navigator){if(!v){const e=navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.language;v=new Intl.DateTimeFormat(e,{year:"numeric",month:"short",day:"2-digit",weekday:"long",hour:"2-digit",minute:"2-digit"})}return v.format(e)}return e.toDateString()+" "+e.toLocaleTimeString()},t.nonSecureRandomIdentifier=function(){return(""+100*Math.random()).replace(".","")},t.splitString=function(e,t){const n=e.length/t,r=[];for(let i=0;i<t;i++){const t=e.slice(n*i,n*(i+1));r.push(t)}return r},t.firstHalfOfString=function(e){return e.substring(0,e.length/2)},t.secondHalfOfString=function(e){return e.substring(e.length/2,e.length)},t.log=function(e,...t){A(e,"black",...t)},t.logWithColor=A,t.assert=function(e){if(void 0===e)throw new Error("Assertion failed; value must be defined")},t.useBoolean=function(e,t){return null!=e?e:t},t.spaceSeparatedStrings=function(...e){return e.join(" ")},t.pluralize=function(e,t,n){return 1===e?t:n}},49095:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Uuids=void 0,t.Uuids=function(e){return e.map((e=>e.uuid))}},57865:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UuidGenerator=void 0,t.UuidGenerator=class{static SetGenerator(e){this.syncUuidFunc=e}static GenerateUuid(){return this.syncUuidFunc()}}},28569:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UuidMap=void 0;const r=n(37225);class i{constructor(){this.directMap=new Map,this.inverseMap=new Map}get directMapSize(){return this.directMap.size}get inverseMapSize(){return this.inverseMap.size}makeCopy(){const e=new i;return e.directMap=new Map(this.directMap),e.inverseMap=new Map(this.inverseMap),e}existsInDirectMap(e){return this.directMap.has(e)}existsInInverseMap(e){return this.inverseMap.has(e)}getDirectRelationships(e){return this.directMap.get(e)||[]}getAllDirectKeys(){return Array.from(this.directMap.keys())}getInverseRelationships(e){return this.inverseMap.get(e)||[]}establishRelationship(e,t){this.establishDirectRelationship(e,t),this.establishInverseRelationship(e,t)}deestablishRelationship(e,t){this.deestablishDirectRelationship(e,t),this.deestablishInverseRelationship(e,t)}setAllRelationships(e,t){const n=this.directMap.get(e)||[];this.directMap.set(e,t);for(const t of n)this.deestablishInverseRelationship(e,t);for(const n of t)this.establishInverseRelationship(e,n)}removeFromMap(e){const t=this.directMap.get(e)||[];for(const n of t)(0,r.removeFromArray)(this.inverseMap.get(n)||[],e);this.directMap.delete(e);const n=this.inverseMap.get(e)||[];for(const t of n)(0,r.removeFromArray)(this.directMap.get(t)||[],e);this.inverseMap.delete(e)}establishDirectRelationship(e,t){const n=this.directMap.get(e)||[];(0,r.addIfUnique)(n,t),this.directMap.set(e,n)}establishInverseRelationship(e,t){const n=this.inverseMap.get(t)||[];(0,r.addIfUnique)(n,e),this.inverseMap.set(t,n)}deestablishDirectRelationship(e,t){const n=this.directMap.get(e)||[];(0,r.removeFromArray)(n,t),this.directMap.set(e,n)}deestablishInverseRelationship(e,t){const n=this.inverseMap.get(t)||[];(0,r.removeFromArray)(n,e),this.inverseMap.set(t,n)}}t.UuidMap=i},31800:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(81346),t),i(n(90622),t),i(n(75760),t),i(n(75807),t),i(n(91379),t),i(n(13777),t),i(n(33638),t),i(n(47887),t),i(n(92484),t),i(n(37225),t),i(n(49095),t),i(n(57865),t),i(n(28569),t),i(n(12377),t)},87901:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31800),t)},38318:(e,t,n)=>{"use strict";var r;n.d(t,{V:()=>r}),function(e){e[e.GeneralMenu=0]="GeneralMenu",e[e.SignIn=1]="SignIn",e[e.Register=2]="Register",e[e.ConfirmPassword=3]="ConfirmPassword"}(r||(r={}))},91819:(e,t,n)=>{"use strict";n.d(t,{Z:()=>L});var r=n(52322),i=n(34309),o=n(2784),s=n(38318),a=n(39537),l=n(756);const c=e=>{let{name:t,checked:n,onChange:i,disabled:o,label:s}=e;return(0,r.jsxs)("label",{htmlFor:t,className:"fit-content mb-2 flex items-center text-sm",children:[(0,r.jsx)("input",{className:"mr-2",type:"checkbox",name:t,id:t,checked:n,onChange:i,disabled:o}),s]})};var u=n(91467),d=n(47931),h=n(99456),p=n(48518),f=n(66724),g=n(29894);const m=(0,i.Pi)((e=>{let{setMenuPane:t,email:n,password:i}=e;const m=(0,p.I)(),{notesAndTagsCount:y}=m.accountMenuController,[v,A]=(0,o.useState)(""),[b,w]=(0,o.useState)(!1),[S,C]=(0,o.useState)(!1),[E,I]=(0,o.useState)(!0),[_,x]=(0,o.useState)(""),[P,k]=(0,o.useState)(""),[B,O]=(0,o.useState)(""),N=(0,o.useCallback)((()=>{w(!0),m.register(n,i,P,S,E).then((()=>{m.accountMenuController.closeAccountMenu(),m.accountMenuController.setCurrentPane(s.V.GeneralMenu)})).catch((e=>{console.error(e),x(e.message)})).finally((()=>{w(!1)}))}),[m,n,P,S,i,E]),D=(0,f.m)(B,(e=>{k(e),O("")}));(0,o.useEffect)((()=>{P&&N()}),[P,N]);const j=(0,o.useRef)(null);(0,o.useEffect)((()=>{var e;null===(e=j.current)||void 0===e||e.focus()}),[]);const T=(0,o.useCallback)((e=>{A(e)}),[]),M=(0,o.useCallback)((()=>{C(!S)}),[S]),F=(0,o.useCallback)((()=>{I(!E)}),[E]),R=(0,o.useCallback)((()=>{m.getCaptchaUrl().then((e=>{if((0,g.isErrorResponse)(e))throw new Error;const{captchaUIUrl:t}=e.data;t?O(t):(O(""),N())})).catch((e=>{console.error(e),O(""),N()}))}),[m,N]),L=(0,o.useCallback)((e=>{var t,n;if(e.preventDefault(),i)return i!==v?(x(a.Zh),A(""),void(null===(n=j.current)||void 0===n||n.focus())):void R();null===(t=j.current)||void 0===t||t.focus()}),[R,v,i]),Q=(0,o.useCallback)((e=>{_.length&&x(""),"Enter"===e.key&&L(e)}),[L,_]),U=(0,o.useCallback)((()=>{t(s.V.Register)}),[t]),V=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-3 px-3 text-sm",children:["Because your notes are encrypted using your password,"," ",(0,r.jsx)("span",{className:"text-danger",children:"Standard Notes does not have a password reset option"}),". If you forget your password, you will permanently lose access to your data."]}),(0,r.jsxs)("form",{onSubmit:L,className:"mb-1 px-3",children:[!b&&(0,r.jsx)(u.Z,{className:{container:"mb-2"},disabled:b,left:[(0,r.jsx)(d.Z,{type:"password",className:"text-neutral"})],onChange:T,onKeyDown:Q,placeholder:"Confirm password",ref:j,value:v}),_?(0,r.jsx)("div",{className:"my-2 text-danger",children:_}):null,(0,r.jsx)(l.Z,{primary:!0,fullWidth:!0,className:"mb-3 mt-1",label:b?"Creating account...":"Create account & sign in",onClick:L,disabled:b}),(0,r.jsx)(c,{name:"is-ephemeral",label:"Stay signed in",checked:!S,onChange:M,disabled:b}),y>0?(0,r.jsx)(c,{name:"should-merge-local",label:"Merge local data (".concat(y," notes and tags)"),checked:E,onChange:F,disabled:b}):null]})]});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-3 mt-1 flex items-center px-3",children:[(0,r.jsx)(h.Z,{icon:"arrow-left",title:"Go back",className:"mr-2 flex p-0 text-neutral",onClick:U,focusable:!0,disabled:b}),(0,r.jsx)("div",{className:"text-base font-bold",children:B?"Human verification":"Confirm password"})]}),B?(0,r.jsx)("div",{className:"p-[10px]",children:D}):V]})}));var y=n(13959),v=n(24118),A=n(88743);const b=e=>{let{className:t}=e;const n=(0,p.I)(),[i,s]=(0,o.useState)("standard"),{server:a,setServer:l}=n.accountMenuController,c=(0,o.useCallback)((async()=>{var e;const t=await(null===(e=n.homeServer)||void 0===e?void 0:e.getHomeServerUrl());t&&a===t?s("home server"):a===g.DefaultHost.Api?s("standard"):s("custom")}),[n.homeServer,a]),u=(0,o.useCallback)(((e,t)=>{l(e),c(),n.setCustomHost(e,t).catch(console.error)}),[n,l,c]);(0,o.useEffect)((()=>{c()}),[n,a,c]);const h=(0,o.useMemo)((()=>[{label:"Default",value:"standard"},{label:"Custom",value:"custom"}].concat((0,v.Z$)()?[{label:"Home Server",value:"home server"}]:[])),[]);return(0,r.jsxs)("div",{className:"flex h-full flex-grow flex-col px-3 pb-1.5 ".concat(t),children:[(0,r.jsx)("div",{className:"mb-2 flex font-bold",children:"Sync Server"}),(0,r.jsx)(A.Z,{value:i,items:h,onChange:async e=>{if(s(e),"standard"===e)u(g.DefaultHost.Api,g.DefaultHost.WebSocket);else if("home server"===e){if(!n.homeServer)return void n.alerts.alert("Home server is not running. Please open the prefences and home server tab to start it.").catch(console.error);const e=await n.homeServer.getHomeServerUrl();if(!e)return void n.alerts.alert("Home server is not running. Please open the prefences and home server tab to start it.").catch(console.error);u(e)}}}),"custom"===i&&(0,r.jsx)(y.Z,{className:{container:"mt-1"},type:"text",left:[(0,r.jsx)(d.Z,{type:"server",className:"text-neutral"})],placeholder:g.DefaultHost.Api,value:a,onChange:u})]})},w=(0,i.Pi)((e=>{let{disabled:t=!1,onPrivateUsernameModeChange:n,onStrictSignInChange:i,onRecoveryCodesChange:s,children:a}=e;const l=(0,p.I)(),{server:u}=l.accountMenuController,[h,f]=(0,o.useState)(u!==g.DefaultHost.Api),[m,v]=(0,o.useState)(!1),[A,w]=(0,o.useState)(""),[S,C]=(0,o.useState)(!1),[E,I]=(0,o.useState)(""),[_,x]=(0,o.useState)(!1);(0,o.useEffect)((()=>{var e;null===(e=l.homeServer)||void 0===e||e.isHomeServerRunning().then((e=>{e&&f(!0)}))}),[l.homeServer]),(0,o.useEffect)((()=>{A&&(async()=>{const e=await l.computePrivateUsername(A);e?null==n||n(!0,e):(null==A?void 0:A.length)>0&&l.alerts.alert("Unable to compute private username.").catch(console.error)})().catch(console.error)}),[A,l,n]),(0,o.useEffect)((()=>{null==n||n(m)}),[m,n]);const P=(0,o.useCallback)((()=>{v(!m)}),[m]),k=(0,o.useCallback)((e=>{w(e)}),[]),B=(0,o.useCallback)((()=>{const e=!S;C(e),null==s||s(e),S||(v(!1),x(!1))}),[S,v,x,s]),O=(0,o.useCallback)((e=>{I(e),e&&(null==s||s(!0,e))}),[s]),N=(0,o.useCallback)((()=>{const e=!_;x(e),null==i||i(e)}),[_,i]),D=(0,o.useCallback)((()=>{f(!h)}),[h]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{className:"flex w-full cursor-pointer items-center border-0 bg-transparent px-3 py-1.5 text-left text-sm font-bold text-text hover:bg-contrast hover:text-foreground focus:bg-info-backdrop focus:shadow-none",onClick:D,children:(0,r.jsxs)("div",{className:"flex items-center",children:["Advanced options",(0,r.jsx)(d.Z,{type:"chevron-down",className:"ml-1 text-passive-1"})]})}),h?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"my-2 px-3",children:[a,(0,r.jsxs)("div",{className:"mb-1 flex items-center justify-between",children:[(0,r.jsx)(c,{name:"private-workspace",label:"Private username mode",checked:m,disabled:t||S,onChange:P}),(0,r.jsx)("a",{href:"https://standardnotes.com/help/80",target:"_blank",rel:"noopener noreferrer",title:"Learn more",children:(0,r.jsx)(d.Z,{type:"info",className:"text-neutral"})})]}),m&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(y.Z,{className:{container:"mb-2"},left:[(0,r.jsx)(d.Z,{type:"account-circle",className:"text-neutral"})],type:"text",placeholder:"Username",value:A,onChange:k,disabled:t||S,spellcheck:!1,autocomplete:!1})}),i&&(0,r.jsxs)("div",{className:"mb-1 flex items-center justify-between",children:[(0,r.jsx)(c,{name:"use-strict-signin",label:"Use strict sign-in",checked:_,disabled:t||S,onChange:N}),(0,r.jsx)("a",{href:"https://standardnotes.com/help/security",target:"_blank",rel:"noopener noreferrer",title:"Learn more",children:(0,r.jsx)(d.Z,{type:"info",className:"text-neutral"})})]}),(0,r.jsx)("div",{className:"mb-1 flex items-center justify-between",children:(0,r.jsx)(c,{name:"recovery-codes",label:"Use recovery code",checked:S,disabled:t,onChange:B})}),S&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(y.Z,{className:{container:"mb-2"},left:[(0,r.jsx)(d.Z,{type:"security",className:"text-neutral"})],type:"text",placeholder:"Recovery code",value:E,onChange:O,disabled:t,spellcheck:!1,autocomplete:!1})})]}),(0,r.jsx)(b,{})]}):null]})}));var S=n(53846);const C=(0,i.Pi)((e=>{let{setMenuPane:t,email:n,setEmail:i,password:a,setPassword:c}=e;const p=(0,o.useRef)(null),f=(0,o.useRef)(null),[g,m]=(0,o.useState)(!1);(0,o.useEffect)((()=>{var e;p.current&&(null===(e=p.current)||void 0===e||e.focus())}),[]);const v=(0,o.useCallback)((e=>{i(e)}),[i]),A=(0,o.useCallback)((e=>{c(e)}),[c]),b=(0,o.useCallback)((e=>{var r,o;e.preventDefault(),n&&0!==n.length?a&&0!==a.length?(i(n),c(a),t(s.V.ConfirmPassword)):null===(o=f.current)||void 0===o||o.focus():null===(r=p.current)||void 0===r||r.focus()}),[n,a,c,t,i]),C=(0,o.useCallback)((e=>{"Enter"===e.key&&b(e)}),[b]),E=(0,o.useCallback)((()=>{t(s.V.GeneralMenu),i(""),c("")}),[i,t,c]),I=(0,o.useCallback)(((e,t)=>{m(e),e&&t&&i(t)}),[i]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-3 mt-1 flex items-center px-3",children:[(0,r.jsx)(h.Z,{icon:"arrow-left",title:"Go back",className:"mr-2 flex p-0 text-neutral",onClick:E,focusable:!0}),(0,r.jsx)("div",{className:"text-base font-bold",children:"Create account"})]}),(0,r.jsxs)("form",{onSubmit:b,className:"mb-1 px-3",children:[(0,r.jsx)(y.Z,{className:{container:"mb-2"},disabled:g,left:[(0,r.jsx)(d.Z,{type:"email",className:"text-neutral"})],onChange:v,onKeyDown:C,placeholder:"Email",ref:p,type:"email",value:n,spellcheck:!1}),(0,r.jsx)(u.Z,{className:{container:"mb-2"},left:[(0,r.jsx)(d.Z,{type:"password",className:"text-neutral"})],onChange:A,onKeyDown:C,placeholder:"Password",ref:f,value:a}),(0,r.jsx)(l.Z,{className:"mt-1",label:"Next",primary:!0,onClick:b,fullWidth:!0})]}),(0,r.jsx)(S.Z,{classes:"my-2"}),(0,r.jsx)(w,{onPrivateUsernameModeChange:I})]})}));var E=n(20896),I=n(37211),_=n(88450),x=n(49258),P=n(27055),k=n(97638);const B=(0,i.Pi)((e=>{let{mainApplicationGroup:t}=e;const n=(0,o.useRef)(null),[i,s]=(0,o.useState)(!1),a=(0,o.useCallback)((()=>{s((e=>!e))}),[]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(I.Z,{tabIndex:_.HF,ref:n,onClick:a,className:"justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(d.Z,{type:"user-switch",className:"mr-2 text-neutral ".concat(k.t)}),"Switch workspace"]}),(0,r.jsx)(d.Z,{type:"chevron-right",className:"text-neutral ".concat(k.t)})]}),(0,r.jsx)(P.Z,{title:"Switch workspace",align:"end",anchorElement:n,className:"pb-2",open:i,side:"right",togglePopover:a,children:(0,r.jsx)(x.Z,{mainApplicationGroup:t})})]})}));var O=n(93632),N=n(41707),D=n(38403),j=n(84075),T=n(68242);const M="text-neutral mr-2 ".concat(k.t),F=(0,i.Pi)((e=>{let{setMenuPane:t,closeMenu:n,mainApplicationGroup:i}=e;const l=(0,p.I)(),[c,u]=(0,o.useState)(!1),[h,f]=(0,o.useState)((0,O.Bt)(l.sync.getLastSyncDate())),m=(0,o.useCallback)((async()=>{u(!0),l.sync.sync({queueStrategy:g.SyncQueueStrategy.ForceSpawnNew,checkIntegrity:!0}).then((e=>{if(e&&e.error)throw new Error;f((0,O.Bt)(l.sync.getLastSyncDate()))})).catch((()=>{l.alerts.alert(a.zR).catch(console.error)})).finally((()=>{u(!1)}))}),[l]),y=(0,o.useMemo)((()=>l.sessions.getUser()),[l]),v=(0,o.useCallback)((()=>{l.accountMenuController.closeAccountMenu(),l.preferencesController.setCurrentPane("account"),l.preferencesController.openPreferences()}),[l]),A=(0,o.useCallback)((()=>{l.accountMenuController.closeAccountMenu(),l.preferencesController.setCurrentPane("help-feedback"),l.preferencesController.openPreferences()}),[l]),b=(0,o.useCallback)((()=>{const e="App Version: ".concat(l.version);l.device.openUrl("mailto:help@standardnotes.com?subject=".concat(encodeURIComponent("Standard Notes Feedback"),"&body=").concat(encodeURIComponent(e)))}),[l.device,l.version]),w=(0,o.useCallback)((()=>{l.accountMenuController.setSigningOut(!0)}),[l]),S=(0,o.useCallback)((()=>{t(s.V.Register)}),[t]),C=(0,o.useCallback)((()=>{t(s.V.SignIn)}),[t]),_=(0,o.useMemo)((()=>l.keyboardService.keyboardShortcutForCommand(j.ZL)),[l.keyboardService]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-1 mt-1 hidden items-center justify-between px-4 md:flex md:px-3",children:[(0,r.jsx)("div",{className:"text-lg font-bold lg:text-base",children:"Account"}),(0,r.jsx)("div",{className:"flex cursor-pointer",onClick:n,children:(0,r.jsx)(d.Z,{type:"close",className:"text-neutral"})})]}),y?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-3 px-4 text-lg text-foreground md:px-3 lg:text-sm",children:[(0,r.jsx)("div",{children:"You're signed in as:"}),(0,r.jsx)("div",{className:"wrap my-0.5 font-bold",children:y.email}),(0,r.jsx)("span",{className:"text-neutral",children:l.getHost.execute().getValue()})]}),(0,r.jsxs)("div",{className:"mb-2 flex items-start justify-between px-4 text-mobile-menu-item md:px-3 md:text-tablet-menu-item lg:text-menu-item",children:[c?(0,r.jsxs)("div",{className:"flex items-center font-semibold text-info",children:[(0,r.jsx)(N.Z,{className:"mr-2 h-5 w-5"}),"Syncing..."]}):(0,r.jsxs)("div",{className:"flex items-start",children:[(0,r.jsx)(d.Z,{type:"check-circle",className:"mr-2 text-success ".concat(k.t)}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"font-semibold text-success",children:"Last synced:"}),(0,r.jsx)("div",{className:"text-text",children:h})]})]}),(0,r.jsx)("div",{className:"flex cursor-pointer text-passive-1",onClick:m,children:(0,r.jsx)(d.Z,{type:"sync",className:"".concat(k.t)})})]})]}):(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"mb-1 px-4 md:px-3",children:[(0,r.jsx)("div",{className:"mb-3 text-base text-foreground lg:text-sm",children:"You’re offline. Sign in to sync your notes and preferences across all your devices and enable end-to-end encryption."}),(0,r.jsxs)("div",{className:"flex items-center text-passive-1",children:[(0,r.jsx)(d.Z,{type:"cloud-off",className:"mr-2 ".concat(k.t)}),(0,r.jsx)("span",{className:"text-lg font-semibold lg:text-sm",children:"Offline"})]})]})}),(0,r.jsxs)(E.Z,{a11yLabel:"General account menu",closeMenu:n,initialFocus:l.hasAccount()?0:1,children:[(0,r.jsx)(D.Z,{className:"md:border-t md:pt-2",children:(0,r.jsx)(B,{mainApplicationGroup:i})}),(0,r.jsxs)(D.Z,{children:[y?(0,r.jsxs)(I.Z,{onClick:v,children:[(0,r.jsx)(d.Z,{type:"user",className:M}),"Account settings"]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(I.Z,{onClick:S,children:[(0,r.jsx)(d.Z,{type:"user",className:M}),"Create free account"]}),(0,r.jsxs)(I.Z,{onClick:C,children:[(0,r.jsx)(d.Z,{type:"signIn",className:M}),"Sign in"]})]}),(0,r.jsxs)(I.Z,{onClick:()=>{l.importModalController.setIsVisible(!0),l.accountMenuController.closeAccountMenu()},children:[(0,r.jsx)(d.Z,{type:"archive",className:M}),"Import"]}),l.isNativeMobileWeb()&&(0,r.jsxs)(I.Z,{onClick:b,children:[(0,r.jsx)(d.Z,{type:"email-filled",className:M}),"Email us"]}),(0,r.jsxs)(I.Z,{className:"justify-between",onClick:A,children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(d.Z,{type:"help",className:M}),"Help & feedback"]}),(0,r.jsxs)("span",{className:"text-neutral",children:["v",l.version]})]}),!(0,j.an)(l.platform)&&(0,r.jsxs)(I.Z,{onClick:()=>{l.keyboardService.triggerCommand(j.ZL)},children:[(0,r.jsx)(d.Z,{type:"keyboard",className:M}),"Keyboard shortcuts",_&&(0,r.jsx)(T.J,{shortcut:_,className:"ml-auto"})]})]}),y?(0,r.jsx)(D.Z,{children:(0,r.jsxs)(I.Z,{onClick:w,children:[(0,r.jsx)(d.Z,{type:"signOut",className:M}),"Sign out workspace"]})}):null]})]})})),R=(0,i.Pi)((e=>{let{setMenuPane:t}=e;const n=(0,p.I)(),{notesAndTagsCount:i}=n.accountMenuController,[a,m]=(0,o.useState)(""),[A,b]=(0,o.useState)(""),[C,E]=(0,o.useState)(""),[I,_]=(0,o.useState)(""),[x,P]=(0,o.useState)(!1),[k,B]=(0,o.useState)(!1),[O,N]=(0,o.useState)(!1),[D,j]=(0,o.useState)(!0),[T,M]=(0,o.useState)(!1),[F,R]=(0,o.useState)(!1),[L,Q]=(0,o.useState)(""),[U,V]=(0,o.useState)(!1),[K,H]=(0,o.useState)(""),G=(0,f.m)(L,(e=>{H(e),V(!1),Q("")})),Y=(0,o.useRef)(null),z=(0,o.useRef)(null);(0,o.useEffect)((()=>{var e;(null==Y?void 0:Y.current)&&(null===(e=Y.current)||void 0===e||e.focus()),v.r8&&window.devAccountEmail&&(m(window.devAccountEmail),b(window.devAccountPassword))}),[]);const Z=(0,o.useCallback)((()=>{I.length&&_("")}),[_,I]),W=(0,o.useCallback)((e=>{m(e)}),[]),q=(0,o.useCallback)((e=>{I.length&&_(""),b(e)}),[b,I]),J=(0,o.useCallback)((()=>{P(!x)}),[x]),X=(0,o.useCallback)((()=>{B(!k)}),[k]),$=(0,o.useCallback)(((e,t)=>{R(e),e&&t&&E(t)}),[E]),ee=(0,o.useCallback)((()=>{j(!D)}),[D]),te=(0,o.useCallback)((()=>{var e,t;N(!0),null===(e=null==Y?void 0:Y.current)||void 0===e||e.blur(),null===(t=null==z?void 0:z.current)||void 0===t||t.blur(),n.signIn(a,A,k,x,D,!1,K).then((e=>{const t=(0,g.getCaptchaHeader)(e);if(t&&Q(t),(0,g.isErrorResponse)(e))throw new Error((0,g.getErrorFromErrorResponse)(e).message);n.accountMenuController.closeAccountMenu()})).catch((e=>{var t,n;console.error(e),_(null!==(t=e.message)&&void 0!==t?t:e.toString()),b(""),H(""),null===(n=null==z?void 0:z.current)||void 0===n||n.blur()})).finally((()=>{N(!1)}))}),[n,a,K,x,k,A,D]),ne=(0,o.useCallback)((()=>{var e,t;N(!0),null===(e=null==Y?void 0:Y.current)||void 0===e||e.blur(),null===(t=null==z?void 0:z.current)||void 0===t||t.blur(),n.signInWithRecoveryCodes.execute({recoveryCodes:C,username:a,password:A,hvmToken:K}).then((e=>{if(e.isFailed()){const t=e.getError();try{const e=JSON.parse(t);if(e.captchaURL)return void Q(e.captchaURL)}catch(e){Q("")}throw new Error(t)}n.accountMenuController.closeAccountMenu()})).catch((e=>{var t,n;console.error(e),_(null!==(t=e.message)&&void 0!==t?t:e.toString()),b(""),H(""),null===(n=null==z?void 0:z.current)||void 0===n||n.blur()})).finally((()=>{N(!1)}))}),[n.accountMenuController,n.signInWithRecoveryCodes,a,K,A,C]),re=(0,o.useCallback)(((e,t)=>{M(e),e&&t&&m(t)}),[m]),ie=(0,o.useCallback)((()=>{var e,t;a&&0!==a.length?A&&0!==A.length?F?ne():te():null===(t=null==z?void 0:z.current)||void 0===t||t.focus():null===(e=null==Y?void 0:Y.current)||void 0===e||e.focus()}),[a,F,A,ne,te]),oe=(0,o.useCallback)((e=>{e.preventDefault(),L?V(!0):ie()}),[L,ie]),se=(0,o.useCallback)((e=>{"Enter"===e.key&&oe(e)}),[oe]);(0,o.useEffect)((()=>{K&&ie()}),[K,ie]);const ae=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-1 px-3",children:[(0,r.jsx)(y.Z,{className:{container:"mb-2 ".concat(I?"border-danger":null)},left:[(0,r.jsx)(d.Z,{type:"email",className:"text-neutral"})],type:"email",placeholder:"Email",value:a,onChange:W,onFocus:Z,onKeyDown:se,disabled:O||T,ref:Y,spellcheck:!1}),(0,r.jsx)(u.Z,{className:{container:"mb-2 ".concat(I?"border-danger":null)},disabled:O,left:[(0,r.jsx)(d.Z,{type:"password",className:"text-neutral"})],onChange:q,onFocus:Z,onKeyDown:se,placeholder:"Password",ref:z,value:A}),I?(0,r.jsx)("div",{className:"my-2 text-danger",children:I}):null,(0,r.jsx)(l.Z,{className:"mb-3 mt-1",label:O?"Signing in...":"Sign in",primary:!0,onClick:oe,disabled:O,fullWidth:!0}),(0,r.jsx)(c,{name:"is-ephemeral",label:"Stay signed in",checked:!x,disabled:O||F,onChange:J}),i>0?(0,r.jsx)(c,{name:"should-merge-local",label:"Merge local data (".concat(i," notes and tags)"),checked:D,disabled:O,onChange:ee}):null]}),(0,r.jsx)(S.Z,{classes:"my-2"}),(0,r.jsx)(w,{disabled:O,onPrivateUsernameModeChange:re,onStrictSignInChange:X,onRecoveryCodesChange:$})]});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-3 mt-1 flex items-center px-3",children:[(0,r.jsx)(h.Z,{icon:"arrow-left",title:"Go back",className:"mr-2 flex p-0 text-neutral",onClick:()=>t(s.V.GeneralMenu),focusable:!0,disabled:O}),(0,r.jsx)("div",{className:"text-base font-bold",children:U?"Human verification":"Sign in"})]}),U?(0,r.jsx)("div",{className:"p-[10px]",children:G}):ae]})})),L=(0,i.Pi)((e=>{let{menuPane:t,setMenuPane:n,closeMenu:i,mainApplicationGroup:a}=e;const[l,c]=(0,o.useState)(""),[u,d]=(0,o.useState)("");switch(t){case s.V.GeneralMenu:return(0,r.jsx)(F,{mainApplicationGroup:a,setMenuPane:n,closeMenu:i});case s.V.SignIn:return(0,r.jsx)(R,{setMenuPane:n});case s.V.Register:return(0,r.jsx)(C,{setMenuPane:n,email:l,setEmail:c,password:u,setPassword:d});case s.V.ConfirmPassword:return(0,r.jsx)(m,{setMenuPane:n,email:l,password:u})}}))},49258:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var r=n(52322),i=n(29894),o=n(34309),s=n(2784),a=n(47931),l=n(20896),c=n(37211),u=n(84075),d=n(77059);const h=e=>{let{descriptor:t,onClick:n,onDelete:i,renameDescriptor:o,hideOptions:l}=e;const[c,h]=(0,s.useState)(!1),[p,f]=(0,s.useState)(t.label),g=(0,s.useRef)(null),m=(0,s.useRef)(null);(0,s.useEffect)((()=>{var e;c&&(null===(e=m.current)||void 0===e||e.focus())}),[c]);const y=(0,s.useCallback)((e=>{f(e.target.value)}),[]),v=(0,s.useCallback)((e=>{var t;e.key!==u.u8.Enter&&e.key!==u.u8.Escape||(e.preventDefault(),e.stopPropagation(),null===(t=g.current)||void 0===t||t.focus())}),[]),A=(0,s.useCallback)((()=>{o(p),h(!1)}),[p,o]);return(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(d.Z,{ref:g,className:"overflow-hidden",onClick:n,checked:t.primary,children:(0,r.jsxs)("div",{className:"ml-2 flex w-full items-center justify-between gap-3 overflow-hidden",children:[!c&&(0,r.jsx)("div",{className:"overflow-hidden text-ellipsis",children:t.label}),t.primary&&!l&&(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("a",{role:"button",className:"flex h-5 w-5 cursor-pointer items-center justify-center border-0 bg-transparent p-0 hover:bg-contrast",onClick:e=>{e.stopPropagation(),h((e=>!e))},children:(0,r.jsx)(a.Z,{type:"pencil",className:"text-neutral",size:"medium"})}),(0,r.jsx)("a",{role:"button",className:"flex h-5 w-5 cursor-pointer items-center justify-center border-0 bg-transparent p-0 hover:bg-contrast",onClick:e=>{e.stopPropagation(),i()},children:(0,r.jsx)(a.Z,{type:"trash",className:"text-danger",size:"medium"})})]})]})}),c&&(0,r.jsx)("input",{ref:m,type:"text",value:p,onChange:y,onKeyDown:v,onBlur:A,onClick:e=>e.stopPropagation(),className:"absolute left-11 top-1/2 -translate-y-1/2 bg-default"})]})};var p=n(48518),f=n(38403);const g=(0,o.Pi)((e=>{let{mainApplicationGroup:t,hideWorkspaceOptions:n=!1}=e;const o=(0,p.I)(),[u,d]=(0,s.useState)(t.getDescriptors());(0,s.useEffect)((()=>{const e=t.getDescriptors();d(e);const n=t.addEventObserver((e=>{if(e===i.ApplicationGroupEvent.DescriptorsDataChanged){const e=t.getDescriptors();d(e)}}));return()=>{n()}}),[t]);const g=(0,s.useCallback)((async()=>{await o.alerts.confirm("Are you sure you want to sign out of all workspaces on this device?",void 0,"Sign out all",i.ButtonType.Danger)&&t.signOutAllWorkspaces().catch(console.error)}),[t,o]),m=(0,s.useCallback)((()=>{o.accountMenuController.setSigningOut(!0)}),[o]),y=(0,s.useCallback)((async e=>{t.unloadCurrentAndActivateDescriptor(e)}),[t]),v=(0,s.useCallback)((async()=>{t.unloadCurrentAndCreateNewDescriptor()}),[t]);return(0,r.jsxs)(l.Z,{a11yLabel:"Workspace switcher menu",className:"focus:shadow-none",children:[(0,r.jsx)(f.Z,{children:u.map((e=>(0,r.jsx)(h,{descriptor:e,hideOptions:n,onDelete:m,onClick:()=>y(e),renameDescriptor:n=>t.renameDescriptor(e,n)},e.identifier)))}),(0,r.jsxs)(f.Z,{children:[(0,r.jsxs)(c.Z,{onClick:v,children:[(0,r.jsx)(a.Z,{type:"user-add",className:"mr-2 text-neutral"}),"Add another workspace"]}),!n&&(0,r.jsxs)(c.Z,{onClick:g,children:[(0,r.jsx)(a.Z,{type:"signOut",className:"mr-2 text-neutral"}),"Sign out all workspaces"]})]})]})}))},48518:(e,t,n)=>{"use strict";n.d(t,{I:()=>a,Z:()=>c});var r=n(52322),i=n(2784),o=n(34309);const s=(0,i.createContext)(void 0),a=()=>{const e=(0,i.useContext)(s);if(!e)throw new Error("Component must be a child of <ApplicationProvider />");return e},l=(0,i.memo)((e=>{let{children:t}=e;return(0,r.jsx)(r.Fragment,{children:t})})),c=(0,o.Pi)((e=>{let{application:t,children:n}=e;return(0,r.jsx)(s.Provider,{value:t,children:(0,r.jsx)(l,{children:n})})}))},87978:(e,t,n)=>{"use strict";var r;n.d(t,{d:()=>r}),function(e){e[e.AttachFileToNote=0]="AttachFileToNote",e[e.DetachFileToNote=1]="DetachFileToNote",e[e.DeleteFile=2]="DeleteFile",e[e.DownloadFile=3]="DownloadFile",e[e.RenameFile=4]="RenameFile",e[e.ToggleFileProtection=5]="ToggleFileProtection",e[e.PreviewFile=6]="PreviewFile"}(r||(r={}))},756:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d,c:()=>c});var r=n(52322),i=n(2784);const o=["primary","label","className","colorStyle","disabled","children","fullWidth","small","rounded"];function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const c=e=>{switch(e){case"default":return"bg-default text-foreground";case"contrast":return"bg-contrast text-text";case"neutral":return"bg-neutral text-neutral-contrast";case"info":return"bg-info text-info-contrast";case"warning":return"bg-warning text-warning-contrast";case"danger":return"bg-danger text-danger-contrast";case"success":return"bg-success text-success-contrast"}},u=(e,t,n,r,i,o)=>{const s=e?"no-border":"border-solid border-border border",a=n?"cursor-not-allowed":"cursor-pointer",l=r?"w-full":"w-fit",u=i?"px-3 py-1.5":"px-4 py-1.5",d=i?"text-sm lg:text-xs":"text-base lg:text-sm",h=o?"rounded":"";let p=e?c(t):(e=>{switch(e){case"default":return"bg-normal-button text-text";case"contrast":return"bg-normal-button text-contrast";case"neutral":return"bg-normal-button text-neutral";case"info":return"bg-normal-button text-info";case"warning":return"bg-normal-button text-warning";case"danger":return"bg-normal-button text-danger";case"success":return"bg-normal-button text-success"}})(t),f=e?"hover:brightness-125 focus:outline-none focus-visible:brightness-125":"focus:bg-contrast focus:outline-none hover:bg-contrast";return n&&(p=e?"bg-passive-2 text-info-contrast":"bg-default text-passive-2",f=e?"focus:brightness-100 focus:outline-none hover:brightness-100":"focus:bg-default focus:outline-none hover:bg-default"),"".concat(h," font-bold select-none ").concat(l," ").concat(u," ").concat(d," ").concat(p," ").concat(s," ").concat(f," ").concat(a)},d=(0,i.forwardRef)(((e,t)=>{let{primary:n=!1,label:i,className:s="",colorStyle:l=(n?"info":"default"),disabled:c=!1,children:d,fullWidth:h,small:p,rounded:f=!0}=e,g=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,o);return(0,r.jsx)("button",a(a({type:"button",className:"".concat(u(n,l,c,h,p,f)," ").concat(s),disabled:c,ref:t},g),{},{children:null!=i?i:d}))}))},99456:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(52322),i=n(47931);const o=e=>{let{onClick:t,className:n="",icon:o,title:s,focusable:a,iconClassName:l="",disabled:c=!1}=e;const u=a?"":"focus:shadow-none";return(0,r.jsx)("button",{type:"button",title:s,className:"no-border flex cursor-pointer flex-row items-center bg-transparent ".concat(u," ").concat(n),onClick:e=>{e.preventDefault(),t(e)},disabled:c,"aria-label":s,children:(0,r.jsx)(i.Z,{type:o,className:l})})}},79021:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var r=n(52322),i=n(2784),o=n(47931),s=n(87901),a=n(75711);const l=["onClick","className","icon","iconClassName","iconProps","id","label"];function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const h=(0,i.forwardRef)(((e,t)=>{let{onClick:n,className:i,icon:c,iconClassName:d,iconProps:h,id:p,label:f}=e,g=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,l);return(0,r.jsx)(a.Z,{label:f,children:(0,r.jsx)("button",u(u({className:(0,s.classNames)("bg-text-padding m-0 flex h-10 min-w-10 cursor-pointer items-center justify-center rounded-full border","border-solid border-border bg-clip-padding text-neutral hover:bg-contrast hover:text-text focus:bg-contrast","focus:text-text focus:outline-none focus:ring-info md:h-8 md:min-w-8",i),onClick:e=>{e.preventDefault(),n(e)},ref:t,id:p,"aria-label":f},g),{},{children:(0,r.jsx)(o.Z,u(u({},h),{},{type:c,className:d}))}))})}))},44783:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c,o:()=>a});var r=n(52322),i=n(2784),o=n(34309);const s=(0,i.createContext)(void 0),a=()=>{const e=(0,i.useContext)(s);if(!e)throw new Error("Component must be a child of <CommandServiceProvider />");return e},l=(0,i.memo)((e=>{let{children:t}=e;return(0,r.jsx)(r.Fragment,{children:t})})),c=(0,o.Pi)((e=>{let{service:t,children:n}=e;return(0,r.jsx)(s.Provider,{value:t,children:(0,r.jsx)(l,{children:n})})}))},37658:(e,t,n)=>{"use strict";n.d(t,{Z:()=>S});var r=n(52322),i=n(47931),o=n(29894),s=n(54425),a=n(9460),l=n(45010),c=n(48104),u=n(70604),d=n(81548),h=(0,l.Bi)((e=>{var t=e,{store:n}=t,r=(0,u.S0)(t,["store"]);const i=(0,a.ht)();n=n||i,(0,d.kG)(n,!1);const o=(0,c.Me)(r.id),s=r.onClick,l=(0,c.zX)((e=>{null==s||s(e),e.defaultPrevented||queueMicrotask((()=>{const e=null==n?void 0:n.getState().selectElement;null==e||e.focus(),null==e||e.click()}))}));return(0,u.EZ)((0,u.ih)({id:o},r),{ref:(0,c.qq)(n.setLabelElement,r.ref),onClick:l,style:(0,u.ih)({cursor:"default"},r.style)})})),p=(0,l.W5)((e=>{const t=h(e);return(0,l.az)("div",t)})),f=n(2363),g=n(25729),m=n(83222),y=n(56278),v=(0,l.Bi)((e=>{var t=e,{store:n,alwaysVisible:r}=t,i=(0,u.S0)(t,["store","alwaysVisible"]);const o=(0,a.ht)();return n=n||o,i=(0,g.m)((0,u.ih)({store:n,alwaysVisible:r},i)),(0,m.S)((0,u.ih)({store:n,alwaysVisible:r},i))})),A=(0,y.L5)((0,l.LM)((e=>{const t=v(e);return(0,l.az)("div",t)})),a.ht),b=n(57996),w=n(84075);const S=e=>{let{label:t,value:n,onChange:a,items:l,disabled:c,fullWidth:u,classNameOverride:d={},popoverPlacement:h,showLabel:g}=e;var m;const y=(0,s.I)({value:n,setValue:a,placement:h||"top"}),v=y.useState("open"),S=l.find((e=>e.value===n));return(0,r.jsxs)("div",{className:d.wrapper,onKeyDown:e=>{e.key===w.u8.Escape&&(e.stopPropagation(),y.toggle())},children:[(0,r.jsx)(p,{className:g?"":"sr-only",store:y,children:t}),(0,r.jsxs)(f.P,{className:(0,o.classNames)("flex w-full min-w-55 items-center justify-between rounded border border-passive-3 bg-default px-3.5 py-1.5 text-sm text-foreground md:translucent-ui:bg-transparent",c&&"opacity-50",d.button,!u&&"md:w-fit"),store:y,disabled:c,children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(null==S?void 0:S.icon)?(0,r.jsx)("div",{className:"mr-2 flex",children:(0,r.jsx)(i.Z,{type:S.icon,className:null!==(m=S.iconClassName)&&void 0!==m?m:"",size:"small"})}):null,(0,r.jsx)("div",{className:"text-base lg:text-sm",children:null==S?void 0:S.label})]}),(0,r.jsx)(i.Z,{type:"chevron-down",size:"normal",className:v?"rotate-180":""})]}),(0,r.jsx)(A,{store:y,className:(0,o.classNames)("z-dropdown-menu max-h-[var(--popover-available-height)] w-[var(--popover-anchor-width)] overflow-y-auto rounded border border-passive-3 bg-default py-1 [backdrop-filter:var(--popover-backdrop-filter)]",d.popover),portal:!1,children:l.map((e=>{var t;return(0,r.jsxs)(b.Q,{className:"group flex cursor-pointer items-center bg-transparent px-3 py-1.5 text-sm text-text hover:bg-contrast hover:text-foreground [&[data-active-item]]:bg-info [&[data-active-item]]:text-info-contrast",value:e.value,disabled:e.disabled,children:[e.icon?(0,r.jsx)("div",{className:"mr-3 flex",children:(0,r.jsx)(i.Z,{type:e.icon,className:null!==(t=e.iconClassName)&&void 0!==t?t:"",size:"small"})}):null,(0,r.jsx)("div",{className:"text-base lg:text-sm",children:e.label})]},e.value)}))})]})}},25281:(e,t,n)=>{"use strict";n.d(t,{Z:()=>E});var r=n(52322),i=n(24118),o=n(29894),s=n(2784),a=n(41707),l=n(2577),c=n(87978),u=n(756);const d=e=>{let{file:t,filesController:n,isFilePreviewable:i,tryAgainCallback:o}=e;return(0,r.jsxs)("div",{className:"flex flex-grow flex-col items-center justify-center",children:[(0,r.jsx)(l.NoPreviewIllustration,{className:"mb-4 h-30 w-30"}),(0,r.jsx)("div",{className:"mb-2 text-base font-bold",children:"This file can't be previewed."}),i?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"mb-4 max-w-[35ch] text-center text-sm text-passive-0",children:"There was an error loading the file. Try again, or download the file and open it using another application."}),(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(u.Z,{primary:!0,className:"mr-3",onClick:()=>{o()},children:"Try again"}),(0,r.jsx)(u.Z,{onClick:()=>{n.handleFileAction({type:c.d.DownloadFile,payload:{file:t}}).catch(console.error)},children:"Download"})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"mb-4 max-w-[35ch] text-center text-sm text-passive-0",children:"To view this file, download it and open it using another application."}),(0,r.jsx)(u.Z,{primary:!0,onClick:()=>{n.handleFileAction({type:c.d.DownloadFile,payload:{file:t}}).catch(console.error)},children:"Download"})]})]})},h=["text/plain","text/csv","application/json"],p=["application/pdf"];var f=n(99456);function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function y(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const v=e=>{let{objectUrl:t,isEmbeddedInSuper:n,imageZoomLevel:i,setImageZoomLevel:a}=e;const[l,c]=(0,s.useState)(0),[u,d]=(0,s.useState)(0),[h,p]=(0,s.useState)(i||100),[g,y]=(0,s.useState)(!1);(0,s.useEffect)((()=>{p(i||100)}),[i]);const v=(0,s.useCallback)((e=>{p(e),null==a||a(e)}),[a]);(0,s.useEffect)((()=>{const e=new Image;e.src=t,e.onload=()=>{c(e.width),d(e.height)}}),[t]);const A=l*(h/100);return(0,r.jsxs)("div",{className:"group relative flex h-full min-h-0 w-full items-center justify-center",children:[(0,r.jsx)("div",{className:"relative flex h-full w-full items-center justify-center overflow-auto",style:{width:n?"".concat(A,"px"):"",aspectRatio:n?"".concat(l," / ").concat(u):""},children:(0,r.jsx)("img",{src:t,style:m({height:n?"100%":"".concat(h,"%")},n?{}:h<=100?{minWidth:"100%",objectFit:"contain"}:{position:"absolute",top:0,left:0,margin:"auto",maxWidth:"none"})})}),(0,r.jsxs)("div",{className:(0,o.classNames)(n?"hidden focus-within:flex group-hover:flex":"","absolute bottom-6 left-1/2 flex -translate-x-1/2 items-center rounded border border-solid border-border bg-default px-3 py-1"),children:[(0,r.jsxs)("span",{className:"mr-1.5",children:[n?"Size":"Zoom",":"]}),(0,r.jsx)(f.Z,{className:"rounded p-1 hover:bg-contrast",icon:"subtract",title:n?"Decrease size":"Zoom Out",focusable:!0,onClick:()=>{const e=h-10;v(e>=10?e:h)}}),g?(0,r.jsxs)("div",{className:"mx-2",children:[(0,r.jsx)("input",{type:"number",className:"w-10 bg-default text-center",defaultValue:h,onKeyDown:e=>{if(e.stopPropagation(),"Enter"===e.key){const t=parseInt(e.currentTarget.value);t>=10&&t<=1e3&&v(t),y(!1)}},onBlur:e=>{y(!1);const t=parseInt(e.currentTarget.value);t>=10&&t<=1e3&&v(t)}}),"%"]}):(0,r.jsxs)("button",{className:"mx-1 rounded px-1.5 py-1 hover:bg-contrast",onClick:()=>y((e=>!e)),children:[h,"%"]}),(0,r.jsx)(f.Z,{className:"rounded p-1 hover:bg-contrast",icon:"add",title:n?"Increase size":"Zoom In",focusable:!0,onClick:()=>{v(h+10)}})]})]})};var A=n(72435);const b=e=>{let{bytes:t}=e;const n=(0,s.useMemo)((()=>(new TextDecoder).decode(t)),[t]);return(0,r.jsx)("textarea",{autoComplete:"off",className:"font-editor h-full w-full flex-grow focus:shadow-none focus:outline-none",dir:"auto",id:A.N.FileTextPreview,defaultValue:n,readOnly:!0})};var w=n(87901);const S=e=>{let{file:t,filesController:n,objectUrl:i,isEmbeddedInSuper:o}=e;const[a,d]=(0,s.useState)(!1),[h,p]=(0,s.useState)(!1);return a?(0,r.jsxs)("div",{className:"flex flex-grow flex-col items-center justify-center",children:[(0,r.jsx)(l.NoPreviewIllustration,{className:"mb-4 h-30 w-30"}),(0,r.jsx)("div",{className:"mb-2 text-base font-bold",children:"This video can't be previewed."}),(0,r.jsx)("div",{className:"mb-4 max-w-[35ch] text-center text-sm text-passive-0",children:"To view this file, download it and open it using another application."}),(0,r.jsx)(u.Z,{primary:!0,onClick:()=>{n.handleFileAction({type:c.d.DownloadFile,payload:{file:t}}).catch(console.error)},children:"Download"})]}):h?(0,r.jsx)("video",{className:"h-full w-full",controls:!0,autoPlay:!0,src:i,onError:()=>{d(!0),p(!1)}}):(0,r.jsx)("video",{className:"h-full w-full",controls:!0,autoPlay:!o,onError:()=>{p(!0)},children:(0,r.jsx)("source",{src:i,type:t.mimeType})})},C=e=>{let{application:t,file:n,bytes:a,isEmbeddedInSuper:l,imageZoomLevel:c,setImageZoomLevel:d}=e;const f=(0,s.useRef)(),g=(0,s.useMemo)((()=>((e,t,n)=>{const r=URL.createObjectURL(new Blob([t],{type:e}));return n.current=r,r})(n.mimeType,a,f)),[a,n.mimeType]);(0,s.useEffect)((()=>{const e=f.current;return()=>{e&&(URL.revokeObjectURL(e),f.current="")}}),[]);const m=t.isNativeMobileWeb(),y=p.includes(n.mimeType),A=(0,s.useCallback)((async()=>{if(!m)throw new Error("Native file preview cannot be used on non-native platform");const e=await(0,i.cN)(new Blob([a],{type:n.mimeType})),{name:r,ext:o}=(0,w.parseFileName)(n.name),s=(0,w.sanitizeFileName)(r),l="".concat(s,".").concat(o);t.mobileDevice.previewFile(e,l)}),[t,a,n.mimeType,n.name,m]);if(m&&y)return(0,r.jsxs)("div",{className:"flex flex-grow flex-col items-center justify-center",children:[(0,r.jsx)("div",{className:"max-w-[30ch] text-center text-base font-bold",children:"This file can only be previewed in an external app"}),(0,r.jsx)(u.Z,{className:"mt-3",primary:!0,onClick:A,children:"Open file preview"})]});if(n.mimeType.startsWith("image/"))return(0,r.jsx)(v,{objectUrl:g,isEmbeddedInSuper:l,imageZoomLevel:c,setImageZoomLevel:d});if(n.mimeType.startsWith("video/"))return(0,r.jsx)(S,{file:n,filesController:t.filesController,objectUrl:g,isEmbeddedInSuper:l});if(n.mimeType.startsWith("audio/"))return(0,r.jsx)("div",{className:"flex h-full w-full items-center justify-center",children:(0,r.jsx)("audio",{src:g,controls:!0})});if(h.includes(n.mimeType))return(0,r.jsx)(b,{bytes:a});const C="application/pdf"===n.mimeType;return(0,r.jsx)("object",{className:(0,o.classNames)("h-full w-full",C&&"min-h-[65vh]"),data:C?g+"#view=FitV":g})},E=e=>{let{file:t,application:n,isEmbeddedInSuper:c=!1,imageZoomLevel:p,setImageZoomLevel:f}=e;const[g,m]=(0,s.useState)(n.isAuthorizedToRenderItem(t)),y=(0,s.useMemo)((()=>(e=>{const t=e.startsWith("image/"),n=e.startsWith("video/"),r=e.startsWith("audio/"),i="application/pdf"===e,o=h.includes(e);return!!(t||n||r||o||i)})(t.mimeType)),[t.mimeType]),[v,A]=(0,s.useState)(!0),[b,w]=(0,s.useState)(),[S,E]=(0,s.useState)();if((0,s.useEffect)((()=>{m(n.isAuthorizedToRenderItem(t))}),[t.protected,n,t]),(0,s.useEffect)((()=>n.addEventObserver((async e=>{e===o.ApplicationEvent.UnprotectedSessionBegan?m(!0):e===o.ApplicationEvent.UnprotectedSessionExpired&&m(n.isAuthorizedToRenderItem(t))}))),[n,t]),(0,s.useEffect)((()=>{if(!y||!g)return A(!1),w(void 0),void E(void 0);(async()=>{if(!S){A(!0);try{const e=[];if(w(void 0),!await n.files.downloadFile(t,(async(t,n)=>{e.push(t),n&&w(n)}))){const t=(0,i.Lf)(e);E(t)}}catch(e){console.error(e)}finally{A(!1)}}})()}),[n.files,S,t,y,g]),!g){const e=n.hasProtectionSources();return(0,r.jsxs)("div",{className:"flex flex-grow flex-col items-center justify-center",children:[(0,r.jsx)(l.ProtectedIllustration,{className:"mb-4 h-30 w-30"}),(0,r.jsx)("div",{className:"mb-2 text-base font-bold",children:"This file is protected."}),(0,r.jsx)("p",{className:"max-w-[35ch] text-center text-sm text-passive-0",children:e?"Authenticate to view this file.":"Add a passcode or create an account to require authentication to view this file."}),(0,r.jsxs)("div",{className:"mt-3 flex gap-3",children:[!e&&(0,r.jsx)(u.Z,{primary:!0,small:!0,onClick:()=>n.showAccountMenu(),children:"Open account menu"}),(0,r.jsx)(u.Z,{primary:!0,onClick:()=>n.protections.authorizeItemAccess(t),children:e?"Authenticate":"View file"})]})]})}return v?(0,r.jsxs)("div",{className:"flex flex-grow flex-col items-center justify-center",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(a.Z,{className:"mr-3 h-5 w-5"}),b&&(0,r.jsxs)("div",{className:"text-base font-semibold",children:[Math.floor(b.percentComplete),"%"]})]}),b?(0,r.jsx)("span",{className:"mt-3",children:(0,o.fileProgressToHumanReadableString)(b,t.name,{showPercent:!1})}):(0,r.jsx)("span",{className:"mt-3",children:"Loading..."})]}):S?(0,r.jsx)(C,{application:n,file:t,bytes:S,isEmbeddedInSuper:c,imageZoomLevel:p,setImageZoomLevel:f}):(0,r.jsx)(d,{file:t,filesController:n.filesController,tryAgainCallback:()=>{E(void 0)},isFilePreviewable:y})}},47931:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m,R:()=>g});var r=n(52322),i=n(62872),o=n(87901),s=n(2577);const a={"lexical-code":s.LexicalCode,"align-center":s.LexicalTextCenter,"align-justify":s.LexicalTextJustify,"align-left":s.LexicalTextLeft,"align-right":s.LexicalTextRight,"horizontal-rule":s.LexicalHorizontalRule,"list-ol":s.LexicalListOL,"list-ul":s.LexicalListUL,check:s.LexicalCheck,quote:s.LexicalQuote,table:s.LexicalTable,tweet:s.LexicalTweet,youtube:s.LexicalYoutube,paragraph:s.LexicalTextParagraph,h1:s.TypeH1,h2:s.TypeH2,h3:s.TypeH3,h4:s.TypeH4,h5:s.TypeH5,h6:s.TypeH6};function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u={small:"w-3.5 h-3.5",medium:"w-4 h-4",normal:"w-5 h-5",large:"w-6 h-6",custom:""},d={small:"w-4 h-4",medium:"w-5 h-5",normal:"w-5 h-5",large:"w-7 h-6",custom:""},h={small:"",medium:"",normal:"-mt-0.5",large:"",custom:""},p={small:"text-xs",medium:"text-sm",normal:"text-base",large:"text-lg",custom:""},f=e=>i.p[e]||a[e],g=e=>null==f(e),m=e=>{let{type:t,className:n="",ariaLabel:i,size:s="normal",emojiSize:a}=e;const g=f(t);return g?(0,r.jsx)(g,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({className:"".concat(u[s]," fill-current ").concat(n),role:"img"},i?{"aria-label":i}:{"aria-hidden":!0})):(0,r.jsx)("label",{className:(0,o.classNames)("fill-current","text-center",p[a||s],d[a||s],h[a||s],n),children:t})}},62872:(e,t,n)=>{"use strict";n.d(t,{p:()=>i});var r=n(2577);const i={"account-circle":r.AccountCircleIcon,"align-center":r.FormatAlignCenterIcon,"align-justify":r.FormatAlignJustifyIcon,"align-left":r.FormatAlignLeftIcon,"align-right":r.FormatAlignRightIcon,"arrow-down":r.ArrowDownIcon,"arrow-left":r.ArrowLeftIcon,"arrow-right":r.ArrowRightIcon,"arrow-up":r.ArrowUpIcon,"arrows-sort-down":r.ArrowsSortDownIcon,"arrows-sort-up":r.ArrowsSortUpIcon,"arrows-vertical":r.ArrowsVerticalIcon,"attachment-file":r.AttachmentFileIcon,"caret-right":r.CaretRightIcon,"check-bold":r.CheckBoldIcon,"check-circle-filled":r.CheckCircleFilledIcon,"check-circle":r.CheckCircleIcon,"chevron-down":r.ChevronDownIcon,"chevron-left":r.ChevronLeftIcon,"chevron-right":r.ChevronRightIcon,"chevron-up":r.ChevronUpIcon,"clear-circle-filled":r.ClearCircleFilledIcon,"cloud-off":r.CloudOffIcon,"code-tags":r.CodeTagsIcon,"details-block":r.DetailsBlockIcon,"diamond-filled":r.DiamondFilledIcon,"email-filled":r.EmailFilledIcon,"eye-off":r.EyeOffIcon,"file-doc":r.FileDocIcon,"file-image":r.FileImageIcon,"file-mov":r.FileMovIcon,"file-music":r.FileMusicIcon,"file-other":r.FileOtherIcon,"file-pdf":r.FilePdfIcon,"file-ppt":r.FilePptIcon,"file-xls":r.FileXlsIcon,"file-zip":r.FileZipIcon,"format-align-center":r.FormatAlignCenterIcon,"format-align-justify":r.FormatAlignJustifyIcon,"format-align-left":r.FormatAlignLeftIcon,"format-align-right":r.FormatAlignRightIcon,"fullscreen-exit":r.FullscreenExitIcon,"hashtag-off":r.HashtagOffIcon,"keyboard-close":r.KeyboardCloseIcon,"line-width":r.LineWidthIcon,"link-off":r.LinkOffIcon,"list-bulleted":r.ListBulleted,"list-numbered":r.ListNumbered,"list-check":r.CheckListIcon,"lock-filled":r.LockFilledIcon,"menu-arrow-down-alt":r.MenuArrowDownAlt,"menu-arrow-down":r.MenuArrowDownIcon,"menu-arrow-right":r.MenuArrowRightIcon,"menu-close":r.MenuCloseIcon,"menu-variant":r.MenuVariantIcon,"notes-filled":r.NotesFilledIcon,"open-in":r.OpenInIcon,"pencil-filled":r.PencilFilledIcon,"pencil-off":r.PencilOffIcon,"pin-filled":r.PinFilledIcon,"plain-text":r.PlainTextIcon,"premium-feature":r.PremiumFeatureIcon,"rich-text":r.RichTextIcon,"safe-square":r.SafeSquareIcon,"select-all":r.SelectAllIcon,"sort-descending":r.SortDescendingIcon,"star-circle-filled":r.StarCircleFilled,"star-filled":r.StarFilledIcon,"star-variant-filled":r.StarVariantFilledIcon,"trash-filled":r.TrashFilledIcon,"trash-sweep":r.TrashSweepIcon,"user-add":r.UserAddIcon,"user-switch":r.UserSwitch,accessibility:r.AccessibilityIcon,add:r.AddIcon,aegis:r.AegisIcon,archive:r.ArchiveIcon,asterisk:r.AsteriskIcon,authenticator:r.AuthenticatorIcon,backspace:r.BackspaceIcon,bold:r.BoldIcon,camera:r.CameraIcon,check:r.CheckIcon,clock:r.ClockIcon,close:r.CloseIcon,code:r.CodeIcon,comment:r.FeedbackIcon,copy:r.CopyIcon,dashboard:r.DashboardIcon,diamond:r.DiamondIcon,download:r.DownloadIcon,drag:r.DragIcon,draw:r.DrawIcon,editor:r.EditorIcon,email:r.EmailIcon,evernote:r.EvernoteIcon,eye:r.EyeIcon,file:r.FileIcon,folder:r.FolderIcon,gkeep:r.GoogleKeepIcon,group:r.GroupIcon,hashtag:r.HashtagIcon,help:r.HelpIcon,history:r.HistoryIcon,image:r.ImageIcon,indent:r.IndentIcon,info:r.InfoIcon,italic:r.ItalicIcon,keyboard:r.KeyboardIcon,link:r.LinkIcon,listed:r.ListedIcon,lock:r.LockIcon,markdown:r.MarkdownIcon,merge:r.MergeIcon,more:r.MoreIcon,notes:r.NotesIcon,outdent:r.OutdentIcon,paragraph:r.TextParagraphLongIcon,password:r.PasswordIcon,pencil:r.PencilIcon,pin:r.PinIcon,redo:r.RedoIcon,restore:r.RestoreIcon,save:r.SaveIcon,search:r.SearchIcon,security:r.SecurityIcon,server:r.ServerIcon,settings:r.SettingsIcon,share:r.ShareIcon,signIn:r.SignInIcon,signOut:r.SignOutIcon,simplenote:r.SimplenoteIcon,spreadsheets:r.SpreadsheetsIcon,star:r.StarIcon,strikethrough:r.StrikethroughIcon,subscript:r.SubscriptIcon,subtract:r.SubtractIcon,superscript:r.SuperscriptIcon,sync:r.SyncIcon,tasks:r.TasksIcon,text:r.TextIcon,themes:r.ThemesIcon,trash:r.TrashIcon,tune:r.TuneIcon,toc:r.TableOfContentsIcon,unarchive:r.UnarchiveIcon,underline:r.UnderlineIcon,undo:r.UndoIcon,unpin:r.UnpinIcon,upload:r.UploadIcon,user:r.UserIcon,view:r.ViewIcon,warning:r.WarningIcon,window:r.WindowIcon}},73703:(e,t,n)=>{"use strict";n.d(t,{K:()=>i,_:()=>r});const r="asterisk",i="text-info group-disabled:text-passive-2"},13959:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(52322),i=n(87901),o=n(2784);const s=(0,o.forwardRef)(((e,t)=>{let{autocomplete:n=!1,spellcheck:s=!0,className:a,disabled:l=!1,id:c,left:u,onBlur:d,onChange:h,onFocus:p,onKeyDown:f,onKeyUp:g,onEnter:m,placeholder:y="",right:v,type:A="text",title:b,value:w,defaultValue:S,roundedFull:C,autofocus:E=!1}=e;const I=((e,t,n)=>({container:"position-relative flex items-stretch overflow-hidden border border-border translucent-ui:border-[--popover-border-color] bg-default translucent-ui:bg-transparent text-sm focus-within:ring-2 focus-within:ring-info bg-clip-padding ".concat(e||t?"":"px-2 py-1.5"," ").concat(n?"rounded-full":"rounded"),input:"focus:ring-none w-full border-0 bg-transparent text-text focus:shadow-none focus:outline-none ".concat(!e&&t?"pl-2":""," ").concat(t?"pr-2":""),disabled:"bg-passive-5 cursor-not-allowed"}))(Boolean(null==u?void 0:u.length),Boolean(null==v?void 0:v.length),C),_=(0,o.useCallback)((e=>{"Enter"===e.key&&(null==m||m()),null==g||g(e)}),[g,m]);return(0,r.jsxs)("div",{className:(0,i.classNames)(I.container,l?I.disabled:"",null==a?void 0:a.container),children:[u&&(0,r.jsx)("div",{className:(0,i.classNames)("flex items-center px-2 py-1.5",null==a?void 0:a.left),children:u.map(((e,t)=>(0,r.jsx)(o.Fragment,{children:e},t)))}),(0,r.jsx)("input",{autoComplete:n?"on":"off",autoFocus:E,className:"".concat(I.input," ").concat(l?I.disabled:""," ").concat(null==a?void 0:a.input),"data-lpignore":"password"!==A,disabled:l,id:c,onBlur:d,onChange:e=>h&&h(e.target.value),onFocus:p,onKeyDown:f,onKeyUp:_,placeholder:y,ref:t,title:b,type:A,value:w,defaultValue:S,spellCheck:s}),v&&(0,r.jsx)("div",{className:(0,i.classNames)("flex items-center px-2 py-1.5",null==a?void 0:a.right),children:v.map(((e,t)=>(0,r.jsx)("div",{className:t>0?"ml-3":"",children:e},t)))})]})}))},91467:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(52322),i=n(2784),o=n(13959),s=n(99456);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u=e=>{let{isToggled:t,setIsToggled:n}=e;return(0,r.jsx)(s.Z,{className:"h-5 w-5 justify-center rounded-full p-0 text-neutral hover:bg-passive-4",icon:t?"eye-off":"eye",iconClassName:"w-3.5 h-3.5",title:"Show/hide password",onClick:()=>n((e=>!e)),focusable:!0})},d=(0,i.forwardRef)(((e,t)=>{const[n,s]=(0,i.useState)(!1),a=e.right?[...e.right]:[];return(0,r.jsx)(o.Z,l(l({},e),{},{ref:t,type:n?"text":"password",right:[...a,(0,r.jsx)(u,{isToggled:n,setIsToggled:s})]}))}))},81959:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var r=n(52322),i=n(11032),o=n(23978),s=n(96332),a=n(32819),l=n(51626),c=n(60750),u=n(29894),d=n(34309),h=n(2784),p=n(48518),f=n(71881);const g=(0,d.Pi)((e=>{let{contentTypes:t,placeholder:n,onSelection:d,comboboxProps:g,className:m={}}=e;const y=(0,p.I)(),v=(0,o.R)(g),A=v.useState("value"),b=v.useState("open");(0,h.useEffect)((()=>{A.length<1&&b&&v.setOpen(!1)}),[v,b,A.length]);const w=(0,h.useDeferredValue)(A),[S,C]=(0,h.useState)([]);return(0,h.useEffect)((()=>{const e=(0,u.naturalSort)(y.items.getItems(t),"title").filter((e=>(0,i.f)(e,w,y)));C(e)}),[w,y,t]),(0,r.jsxs)("div",{children:[(0,r.jsx)(s.T,{children:"Select an item"}),(0,r.jsx)(a.h,{store:v,placeholder:n,className:(0,u.classNames)("h-7 w-70 bg-transparent text-sm text-text focus:border-b-2 focus:border-info focus:shadow-none focus:outline-none lg:text-xs",m.input)}),(0,r.jsx)(l.S,{store:v,className:(0,u.classNames)("z-dropdown-menu max-h-[var(--popover-available-height)] w-[var(--popover-anchor-width)] overflow-y-auto rounded bg-default py-2 shadow-main",m.popover),children:S.length>0?S.map((e=>(0,r.jsx)(c.l,{className:"flex w-full cursor-pointer items-center justify-between gap-4 overflow-hidden px-3 py-2 hover:bg-contrast hover:text-foreground [&[data-active-item]]:bg-info-backdrop",hideOnClick:!0,onClick:()=>{v.setValue(""),d(e)},children:(0,r.jsx)(f.Z,{item:e,searchQuery:w})},e.uuid))):(0,r.jsx)("div",{className:"px-2",children:"No results found"})})]})}))},68242:(e,t,n)=>{"use strict";n.d(t,{J:()=>a});var r=n(52322),i=n(29894),o=n(84075),s=n(2784);const a=e=>{let{shortcut:t,small:n=!0,dimmed:a=!0,className:l}=e;const c=(0,s.useMemo)((()=>{const e=t.modifiers||[],n=t.key?(0,o.zr)(t.key):t.code?(0,o.zr)(t.code):void 0,r=[];return e.forEach((e=>{r.push((0,o.Mn)(e,t.platform))})),n&&r.push(n),r}),[t]);return(0,o.an)(t.platform)?null:(0,r.jsx)("div",{className:(0,i.classNames)("flex items-center gap-1",a&&"opacity-70",l),children:c.map(((e,t)=>(0,r.jsx)("kbd",{className:(0,i.classNames)("rounded border-[0.5px] border-passive-3 bg-default p-1 text-center font-sans capitalize leading-none text-text shadow-[var(--tw-shadow-color)_0px_2px_0px_0px] shadow-passive-3",n?"text-[length:0.65rem]":"text-xs"),children:e},t)))})}},26013:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(52322),i=n(87901),o=n(84075),s=n(34309),a=n(2784),l=n(29894),c=n(47931),u=n(79323),d=n(48518),h=n(43426),p=n(11032);const f=(0,s.Pi)((e=>{let{link:t,activateItem:n,unlinkItem:s,focusPreviousItem:f,focusNextItem:g,focusedId:m,setFocusedId:y,isBidirectional:v,inlineFlex:A,className:b,readonly:w,wrappable:S}=e;const C=(0,a.useRef)(),E=(0,d.I)(),[I,_]=(0,a.useState)(!1),x=(0,a.useRef)(),[P,k]=(0,a.useState)(!1),B=()=>{m!==t.id&&(null==y||y(t.id)),_(!0)},O=()=>{_(!1),k(!1)},N=e=>{if(P&&e.target!==x.current){if(k(!1),w)return;null==n||n(t.item)}else k(!0)},D=e=>{e.stopPropagation(),s(t.item)},j=e=>{switch(e.key){case o.u8.Backspace:null==f||f(),s(t.item);break;case o.u8.Left:null==f||f();break;case o.u8.Right:null==g||g()}},[T,M]=(0,u.b)(t.item,E),F=(0,h.l)(t.item,E);return(0,a.useEffect)((()=>{var e;t.id===m&&(null===(e=C.current)||void 0===e||e.focus())}),[m,t.id]),S?(0,r.jsxs)("a",{ref:e=>C.current=e,tabIndex:0,className:(0,i.classNames)("group cursor-pointer rounded align-middle [&>*]:align-middle","bg-passive-4-opacity-variant outline-1 outline-info hover:bg-contrast focus:bg-contrast focus:outline","whitespace-pre-wrap text-left text-sm text-text hover:no-underline focus:no-underline lg:text-xs","py-1 pl-1 pr-2",b),onFocus:B,onBlur:O,onClick:N,title:F?F.longTitle:t.item.title,onKeyDown:j,children:[(0,r.jsx)(c.Z,{type:T,className:(0,i.classNames)("mr-1 inline",M),size:"small"}),F&&(0,r.jsx)("span",{className:"text-passive-1",children:F.titlePrefix}),"linked-by"===t.type&&t.item.content_type!==l.ContentType.TYPES.Tag&&(0,r.jsx)("span",{className:v?"":"hidden group-focus:inline",children:"Linked By:"}),(0,r.jsx)("span",{children:(0,p.R)(t.item)}),I&&!w&&(0,r.jsx)("button",{ref:e=>x.current=e,role:"button",className:"-mr-1 ml-2 inline-flex cursor-pointer border-0 bg-transparent p-0",onClick:D,children:(0,r.jsx)(c.Z,{type:"close",className:"text-neutral hover:text-info",size:"small"})})]}):(0,r.jsxs)("button",{ref:e=>C.current=e,className:(0,i.classNames)("group h-6 cursor-pointer items-center rounded bg-passive-4-opacity-variant py-2 pl-1 pr-2 align-middle text-sm","text-text hover:bg-contrast focus:bg-contrast lg:text-xs",A?"inline-flex":"flex",b),onFocus:B,onBlur:O,onClick:N,title:F?F.longTitle:t.item.title,onKeyDown:j,children:[(0,r.jsx)(c.Z,{type:T,className:(0,i.classNames)("mr-1 flex-shrink-0",M),size:"small"}),(0,r.jsxs)("span",{className:"flex items-center overflow-hidden overflow-ellipsis whitespace-nowrap",children:[F&&(0,r.jsx)("span",{className:"text-passive-1",children:F.titlePrefix}),(0,r.jsxs)("span",{className:"flex items-center gap-1",children:["linked-by"===t.type&&t.item.content_type!==l.ContentType.TYPES.Tag&&(0,r.jsx)("span",{className:v?"":"hidden group-focus:block",children:"Linked By:"}),(0,p.R)(t.item)]})]}),I&&!w&&(0,r.jsx)("a",{ref:e=>x.current=e,role:"button",className:"-mr-1 ml-2 flex cursor-pointer border-0 bg-transparent p-0",onClick:D,children:(0,r.jsx)(c.Z,{type:"close",className:"text-neutral hover:text-info",size:"small"})})]})}))},66743:(e,t,n)=>{"use strict";n.d(t,{Z:()=>D});var r=n(52322),i=n(34309),o=n(2784),s=n(87901),a=n(72435),l=n(90509),c=n(48518),u=n(29894),d=n(23978),h=n(96332),p=n(32819),f=n(51626),g=n(60750),m=n(71881),y=n(72604),v=n(20038),A=n(47931),b=n(73703),w=n(84075),S=n(7453);const C=(0,o.forwardRef)(((e,t)=>{let{linkingController:n,focusPreviousItem:i,focusedId:C,setFocusedId:E,hoverLabel:I,item:_}=e;const x=(0,c.I)(),{getLinkedTagsForItem:P,linkItems:k,createAndAddNewTag:B,isEntitledToNoteLinking:O}=n,N=P(_)||[],D=(0,d.R)(),j=D.useState("value"),T=(0,o.useDeferredValue)(j),{unlinkedItems:M,shouldShowCreateTag:F}=(0,l.Q)(T,x,_),R=(0,o.useRef)(null);return(0,o.useEffect)((()=>{var e;C===a.N.ItemLinkAutocompleteInput&&(null===(e=R.current)||void 0===e||e.focus())}),[C]),(0,r.jsx)("div",{children:(0,r.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),""!==T&&(await B(T),D.setValue(""))},children:[(0,r.jsxs)("label",{children:[(0,r.jsx)(h.T,{children:"Link tags, notes or files"}),(0,r.jsx)(p.h,{store:D,placeholder:"Link tags, notes, files...",className:(0,s.classNames)("".concat(N.length>0?"w-80":"mr-10 w-70"),"h-7 w-70 bg-transparent text-sm text-text focus:border-b-2 focus:border-info focus:shadow-none focus:outline-none lg:text-xs"),title:I,id:a.N.ItemLinkAutocompleteInput,ref:(0,S.l)([R,t]),onFocus:()=>{C!==a.N.ItemLinkAutocompleteInput&&E(a.N.ItemLinkAutocompleteInput)},onKeyDown:e=>{e.key===w.u8.Left&&0===T.length&&i()}})]}),(0,r.jsxs)(f.S,{store:D,className:(0,s.classNames)("z-dropdown-menu max-h-[var(--popover-available-height)] w-[var(--popover-anchor-width)] overflow-y-auto rounded bg-default py-2 shadow-main",0===M.length&&!F&&"hidden"),children:[M.map((e=>{const t=!O&&e instanceof u.SNNote;return(0,r.jsxs)(g.l,{className:"flex w-full cursor-pointer items-center justify-between gap-4 overflow-hidden px-3 py-2 hover:bg-contrast hover:text-foreground [&[data-active-item]]:bg-info-backdrop",hideOnClick:!0,onClick:()=>{k(_,e).catch(console.error),D.setValue("")},children:[(0,r.jsx)(m.Z,{item:e,searchQuery:T}),t&&(0,r.jsx)(A.Z,{type:b._,className:"ml-auto flex-shrink-0 text-info"})]},e.uuid)})),F&&(0,r.jsx)(g.l,{hideOnClick:!0,render:(0,r.jsx)(v.g7,{}),onClick:()=>{B(T),D.setValue("")},children:(0,r.jsx)(y.d,{searchQuery:T})})]})]})})})),E=(0,i.Pi)(C);var I=n(26013),_=n(74522),x=n(44783),P=n(20153),k=n(79021),B=n(69170),O=n(4160),N=n(16786);const D=(0,i.Pi)((e=>{let{item:t,linkingController:n,hideToggle:i=!1,readonly:l=!1,className:c={},isCollapsedByDefault:d=!0}=e;const{toggleAppPane:h}=(0,_.G)(),p=(0,x.o)(),{unlinkItems:f,activateItem:g}=n,m=(0,o.useCallback)((async e=>{f(t,e)}),[t,f]),{notesLinkedToItem:y,filesLinkedToItem:v,tagsLinkedToItem:A,notesLinkingToItem:b,filesLinkingToItem:S}=(0,P.f)(t),C=(0,o.useMemo)((()=>(new Array).concat(y,v,A)),[v,y,A]);(0,o.useEffect)((()=>p.addCommandHandler({command:w.qC,category:"Current note",description:"Link tags, notes, files",onKeyDown:()=>{const e=document.getElementById(a.N.ItemLinkAutocompleteInput);e&&e.focus()}})),[p]);const D=(0,o.useMemo)((()=>(0,w.Ld)(p.keyboardShortcutForCommand(w.qC))),[p]),[j,T]=(0,o.useState)(),M=C.map((e=>e.id)).concat(b.map((e=>e.id)),S.map((e=>e.id)),[a.N.ItemLinkAutocompleteInput]),F=(0,o.useCallback)((()=>{const e=M.findIndex((e=>e===j))-1;e>-1&&T(M[e])}),[M,j]),R=(0,o.useCallback)((()=>{const e=M.findIndex((e=>e===j))+1;e<M.length&&T(M[e])}),[M,j]),L=(0,o.useCallback)((async e=>{const t=await g(e);t&&h(t)}),[g,h]),Q=e=>{const t=!!C.find((t=>e.item.uuid===t.item.uuid)),n=!!b.find((t=>e.item.uuid===t.item.uuid)),r=!!S.find((t=>e.item.uuid===t.item.uuid));return t&&(e.item.content_type===u.ContentType.TYPES.Note?n:r)},U=C.concat(b).concat(S),[V,K]=(0,o.useState)(!(U.length<5)&&d),H=V?U.slice(0,5):U,G=U.length-H.length,[Y,z]=(0,o.useState)(!0),[Z,W]=(0,o.useState)(null);(0,o.useEffect)((()=>{const e=Z;if(!e)return;const t=new ResizeObserver((()=>{const t=e.firstElementChild;if(!t)return;const n=t.clientHeight+4,r=e.clientHeight>n;z(!!r)}));return t.observe(e),()=>{t.disconnect()}}),[Z]);const q=i||!Y&&!V,{vault:J,lastEditedByContact:X}=(0,N.j)(t);return l&&0===U.length&&!J?null:(0,r.jsxs)("div",{className:(0,s.classNames)("flex w-full flex-wrap justify-between md:flex-nowrap",U.length>0&&!q?"pt-2 "+c.withToggle:void 0,V?"gap-4":"gap-1",c.base),children:[(0,r.jsxs)("div",{className:(0,s.classNames)("note-view-linking-container flex min-w-80 max-w-full items-center gap-2 bg-transparent",C.length||b.length?"mt-1":"mt-0.5",V?"overflow-hidden":"flex-wrap",!q&&"mr-2"),ref:W,children:[!!J&&(0,r.jsx)(B.Z,{vault:J}),!!X&&(0,r.jsx)(O.Z,{contact:X}),H.map((e=>(0,r.jsx)(I.Z,{link:e,activateItem:L,unlinkItem:m,focusPreviousItem:F,focusNextItem:R,focusedId:j,setFocusedId:T,isBidirectional:Q(e),readonly:l},e.id))),V&&G>0&&(0,r.jsxs)("span",{className:"flex-shrink-0",children:["and ",G," more..."]}),!l&&(0,r.jsx)(E,{focusedId:j,linkingController:n,focusPreviousItem:F,setFocusedId:T,hoverLabel:"Focus input to add a link (".concat(D,")"),item:t})]}),U.length>0&&!q&&(0,r.jsx)(k.Z,{id:"toggle-linking-container",label:"Toggle linked items container",onClick:()=>{K((e=>!e))},icon:V?"chevron-down":"chevron-left"})]})}))},71881:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var r=n(52322),i=n(24118),o=n(87901),s=n(43426),a=n(79323),l=n(34309),c=n(48518),u=n(47931),d=n(11032);const h=(0,l.Pi)((e=>{let{item:t,searchQuery:n}=e;const l=(0,c.I)(),[h,p]=(0,a.b)(t,l),f=(0,s.l)(t,l),g=(0,d.R)(t);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.Z,{type:h,className:(0,o.classNames)("flex-shrink-0",p)}),(0,r.jsxs)("div",{className:"min-w-0 flex-grow break-words text-left text-base lg:text-sm",children:[f&&(0,r.jsx)("span",{className:"text-passive-1",children:f.titlePrefix}),n?(0,i.RB)(g,n).map(((e,t)=>(0,r.jsx)("span",{className:"".concat(e.toLowerCase()===n.toLowerCase()?"whitespace-pre-wrap font-bold":"whitespace-pre-wrap "),children:e},t))):g]})]})}))},72604:(e,t,n)=>{"use strict";n.d(t,{d:()=>d});var r=n(52322),i=n(87901),o=n(2784),s=n(47931);const a=["searchQuery","onClickCallback","isFocused"];function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const d=(0,o.forwardRef)(((e,t)=>{let{searchQuery:n,onClickCallback:o,isFocused:l}=e,u=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,a);return(0,r.jsxs)("button",c(c({className:(0,i.classNames)("group flex w-full items-center gap-2 overflow-hidden px-3 py-2 hover:bg-contrast hover:text-foreground","focus:bg-info-backdrop [&[data-active-item]]:bg-info-backdrop"),onClick:()=>{o&&o(n)},ref:t},u),{},{children:[(0,r.jsx)("span",{className:"flex-shrink-0 align-middle text-sm lg:text-xs",children:"Create & add tag"})," ",(0,r.jsxs)("span",{className:(0,i.classNames)("inline-flex min-w-0 items-center gap-1 rounded py-1 pl-1 pr-2 align-middle text-xs ","group-hover:bg-info group-hover:text-info-contrast",l?"bg-info text-info-contrast":"bg-contrast text-text"),children:[(0,r.jsx)(s.Z,{type:"hashtag",className:(0,i.classNames)("flex-shrink-0 group-hover:text-info-contrast",l?"text-info-contrast":"text-info"),size:"small"}),(0,r.jsx)("span",{className:"min-w-0 overflow-hidden text-ellipsis",children:n})]})]}))}))},20896:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(52322),i=n(2784),o=n(84075),s=n(91611),a=n(7453),l=n(3555);const c=["children","className","style","a11yLabel","closeMenu","initialFocus","onKeyDown","shouldAutoFocus"];function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function h(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const p=(0,i.forwardRef)(((e,t)=>{let{children:n,className:u="",style:h,a11yLabel:p,closeMenu:f,initialFocus:g,onKeyDown:m,shouldAutoFocus:y=!0}=e,v=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,c);const[A,b]=(0,i.useState)(null),w=(0,i.useCallback)((e=>{null==m||m(e),e.key!==o.u8.Escape||null==f||f()}),[f,m]),S=(0,l.ac)(l.Jj.sm),{setInitialFocus:C}=(0,s.Z)(A,{initialFocus:g,shouldAutoFocus:!S&&y});return(0,i.useImperativeHandle)(t,(()=>({focus:()=>{C()}}))),(0,r.jsx)("menu",d(d({className:"m-0 list-none px-4 focus:shadow-none md:px-0 ".concat(u),onKeyDown:w,ref:(0,a.l)([b,t]),style:h,"aria-label":p},v),{},{children:n}))}))},37211:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(52322),i=n(2784),o=n(47931),s=n(88450),a=n(87901),l=n(68242),c=n(91849);const u=["children","className","icon","iconClassName","tabIndex","shortcut","disabled"];function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const f=(0,i.forwardRef)(((e,t)=>{let{children:n,className:i="",icon:d,iconClassName:p="w-6 h-6 md:w-5 md:h-5 text-neutral mr-2",tabIndex:f,shortcut:g,disabled:m}=e,y=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,u);return(0,r.jsx)(c.Z,{children:(0,r.jsxs)("button",h(h({ref:t,role:"menuitem",tabIndex:"number"==typeof f?f:s.HF,className:(0,a.classNames)("flex w-full cursor-pointer select-none border-0 bg-transparent px-3 py-2.5 text-left md:py-1.5","text-mobile-menu-item text-text enabled:hover:bg-passive-3 enabled:hover:text-foreground","focus:bg-info-backdrop focus:shadow-none md:text-tablet-menu-item lg:text-menu-item","disabled:cursor-not-allowed disabled:opacity-60",i,i.includes("items-")?"":"items-center"),disabled:m},y),{},{children:[g&&(0,r.jsx)(l.J,{className:"mr-2",shortcut:g}),d?(0,r.jsx)(o.Z,{type:d,className:(0,a.classNames)("flex-shrink-0",p)}):null,n]}))})}))},51694:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(52322);const i=()=>(0,r.jsx)("li",{className:"list-none",role:"none",children:(0,r.jsx)("div",{role:"separator",className:"my-2 h-[1px] bg-[--separator-color]"})})},91849:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(52322);const i=e=>{let{children:t}=e;return(0,r.jsx)("li",{className:"flex-grow list-none",role:"none",children:t})}},77059:(e,t,n)=>{"use strict";n.d(t,{Z:()=>y});var r=n(52322),i=n(88450),o=n(29894),s=n(2784),a=n(47931),l=n(68242),c=n(13500),u=n(91849),d=n(27055);const h=["checked","disabled","tabIndex","children","shortcut","className","info"];function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){g(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function g(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const m=e=>{let{text:t}=e;const[n,i]=(0,s.useState)(!1),l=(0,s.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),i(!n)}),[n]),c=(0,s.useRef)(null);return(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("div",{ref:c,className:(0,o.classNames)("peer z-0 flex h-5 w-5 items-center justify-center rounded-full"),onClick:l,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:(0,r.jsx)(a.Z,{type:"notes",className:"text-border translucent-ui:text-[--popover-border-color]",size:"large"})}),(0,r.jsx)(d.Z,{open:n,title:"Info",anchorElement:c,disableMobileFullscreenTakeover:!0,className:"z-modal bg-default px-3 py-1.5 text-left",containerClassName:"w-60",children:t})]})},y=(0,s.forwardRef)(((e,t)=>{let{checked:n,disabled:s,tabIndex:a,children:d,shortcut:p,className:g,info:y}=e,v=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,h);return(0,r.jsx)(u.Z,{children:(0,r.jsxs)("button",f(f({ref:t,role:"menuitemradio",tabIndex:"number"==typeof a?a:i.HF,className:(0,o.classNames)("flex w-full cursor-pointer gap-2 border-0 bg-transparent px-3 py-2.5 text-left md:py-1.5","text-mobile-menu-item text-text hover:bg-passive-3 hover:text-foreground","focus:bg-info-backdrop focus:shadow-none md:text-tablet-menu-item lg:text-menu-item",g,(null==g?void 0:g.includes("items-"))?"":"items-center"),"aria-checked":n,disabled:s},v),{},{children:[p&&(0,r.jsx)(l.J,{className:"mr-2",shortcut:p}),(0,r.jsx)(c.Z,{disabled:s,checked:n,className:"flex-shrink-0"}),d,y&&(0,r.jsx)(m,{text:y})]}))})}))},38403:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(52322),i=n(29894);const o=e=>{let{title:t,className:n,children:o}=e;return(0,r.jsxs)("div",{className:(0,i.classNames)("my-4 md:my-2 md:border-b md:border-border md:pb-2 md:last:mb-0 md:last:border-b-0 md:last:pb-0 md:first:last:mt-0 md:translucent-ui:border-[--popover-border-color]",n),children:[t&&(0,r.jsx)("div",{className:"px-3 py-1 text-sm font-semibold uppercase text-text lg:text-xs",children:t}),(0,r.jsx)("div",{className:"divide-y divide-passive-3 overflow-hidden rounded-md bg-default md:divide-none md:rounded-none md:bg-transparent",children:o})]})}},61293:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(52322),i=n(88450),o=n(29894),s=n(2784),a=n(68242),l=n(88669),c=n(91849);const u=["checked","onChange","disabled","onBlur","tabIndex","children","shortcut","className","forceDesktopStyle"];function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const f=(0,s.forwardRef)(((e,t)=>{let{checked:n,onChange:s,disabled:d,onBlur:p,tabIndex:f,children:g,shortcut:m,className:y,forceDesktopStyle:v}=e,A=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,u);return(0,r.jsx)(c.Z,{children:(0,r.jsxs)("button",h(h({disabled:d,ref:t,className:(0,o.classNames)("flex w-full cursor-pointer items-center border-0 bg-transparent px-3 py-2 md:py-1.5","text-left text-text focus:bg-info-backdrop focus:shadow-none enabled:hover:bg-passive-3 enabled:hover:text-foreground","text-mobile-menu-item md:text-tablet-menu-item lg:text-menu-item","disabled:cursor-not-allowed disabled:opacity-60",y),onClick:()=>{s(!n)},onBlur:p,tabIndex:"number"==typeof f?f:i.HF,role:"menuitemcheckbox","aria-checked":n},A),{},{children:[(0,r.jsx)("span",{className:"flex flex-grow items-center",children:g}),(0,r.jsxs)("div",{className:"flex items-center",children:[m&&(0,r.jsx)(a.J,{className:"mr-2",shortcut:m}),(0,r.jsx)(l.Z,{disabled:d,className:"pointer-events-none flex px-0",checked:n,onChange:s,tabIndex:i.HF,forceDesktopStyle:v})]})]}))})}))},57137:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(52322),i=n(29894),o=n(2784);const s=["children","action","type","slot","className"];function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u=(0,o.forwardRef)(((e,t)=>{let{children:n,action:o,type:a="primary",slot:c,className:u}=e,d=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,s);return(0,r.jsx)("button",l(l({ref:t,className:(0,i.classNames)("flex select-none whitespace-nowrap px-1 py-1 font-semibold focus:shadow-none focus:outline-none active:shadow-none active:outline-none active:brightness-50 disabled:text-neutral md:hidden","left"===c?"justify-start text-left":"justify-end text-right","cancel"===a||"destructive"===a?"text-danger":"text-info",u),onClick:o},d),{},{children:n}))}))},18329:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(52322),i=n(87901);const o=e=>{let{className:t,children:n}=e;return(0,r.jsx)("div",{className:(0,i.classNames)("grid w-full select-none grid-cols-[0.35fr_1fr_0.35fr] gap-2 text-[1.05rem] leading-6",t),"data-mobile-modal-header":!0,children:n})}},10878:(e,t,n)=>{"use strict";n.d(t,{Yb:()=>s,vU:()=>l,xY:()=>i});var r=n(64503);const i="cubic-bezier(.36,.66,.04,1)",o={vertical:{enter:{keyframes:[{transform:"translateY(100%)"},{transform:"translateY(0)"}],transformOrigin:"bottom"},exit:{keyframes:[{transform:"translateY(100%)"}],transformOrigin:"bottom"}},horizontal:{enter:{keyframes:[{transform:"translateX(100%)"},{transform:"translateX(0)"}],transformOrigin:"right"},exit:{keyframes:[{transform:"translateX(0)"},{transform:"translateX(100%)"}],transformOrigin:"right"}},nonMobile:{enter:{keyframes:[{transform:"scale(0.95)",opacity:0},{transform:"scale(1)",opacity:1}],transformOrigin:"center"},exit:{keyframes:[{transform:"scale(1)",opacity:1},{transform:"scale(0.95)",opacity:0}],transformOrigin:"center"}}},s={easing:i,duration:250,fill:"forwards"},a={duration:75},l=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"vertical",i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return(0,r.r)({open:e,enter:{keyframes:t?o[n].enter.keyframes:o.nonMobile.enter.keyframes,options:t?s:a,initialStyle:{transformOrigin:t?o[n].enter.transformOrigin:o.nonMobile.enter.transformOrigin}},enterCallback:e=>{t&&(e.scrollTop=0)},exit:{keyframes:t?o[n].exit.keyframes:o.nonMobile.exit.keyframes,options:t?s:a,initialStyle:{transformOrigin:t?o[n].exit.transformOrigin:o.nonMobile.exit.transformOrigin}}},i)}},73144:(e,t,n)=>{"use strict";n.d(t,{S:()=>o,n:()=>r});var r,i=n(72435);!function(e){e.Navigation="NavigationColumn",e.Items="ItemsColumn",e.Editor="EditorColumn"}(r||(r={}));const o={[r.Navigation]:i.N.NavigationColumn,[r.Items]:i.N.ItemsColumn,[r.Editor]:i.N.EditorColumn}},74522:(e,t,n)=>{"use strict";n.d(t,{G:()=>d,Z:()=>p});var r=n(52322),i=n(74547),o=n(2784),s=n(73144),a=n(34309),l=n(74455),c=n(38232);const u=(0,o.createContext)(void 0),d=()=>{const e=(0,o.useContext)(u);if(!e)throw new Error("Component must be a child of <ResponsivePaneProvider />");return e},h=(0,o.memo)((e=>{let{children:t}=e;return(0,r.jsx)(r.Fragment,{children:t})})),p=(0,a.Pi)((e=>{let{paneController:t,children:n}=e;const a=t.currentPane,d=(0,c.Y)(a),p=(0,o.useCallback)((e=>{t.presentPane(e)}),[t]),f=(0,i.x)();(0,o.useEffect)((()=>{const e=f((()=>(d.current===s.n.Editor||d.current===s.n.Navigation)&&(t.setPaneLayout(l.h.ItemSelection),!0)));return()=>{e&&e()}}),[f,d,t]);const g=(0,o.useMemo)((()=>({selectedPane:a,toggleAppPane:p,presentPane:t.presentPane,isListPaneCollapsed:t.isListPaneCollapsed,isNavigationPaneCollapsed:t.isNavigationPaneCollapsed,toggleListPane:t.toggleListPane,toggleNavigationPane:t.toggleNavigationPane,panes:t.panes,popToPane:t.popToPane,dismissLastPane:t.dismissLastPane,replacePanes:t.replacePanes,removePane:t.removePane,insertPaneAtIndex:t.insertPaneAtIndex,setPaneLayout:t.setPaneLayout,focusModeEnabled:t.focusModeEnabled})),[a,p,t.panes,t.isListPaneCollapsed,t.isNavigationPaneCollapsed,t.toggleListPane,t.toggleNavigationPane,t.presentPane,t.popToPane,t.dismissLastPane,t.replacePanes,t.removePane,t.insertPaneAtIndex,t.setPaneLayout,t.focusModeEnabled]);return(0,r.jsx)(u.Provider,{value:g,children:(0,r.jsx)(h,{children:n})})}))},32620:(e,t,n)=>{"use strict";n.d(t,{w:()=>p});var r=n(3555),i=n(24118);const o=(e,t,n,r,i)=>{const{width:o,height:s}=e,a=DOMRect.fromRect(e),l=i||0;switch(n){case"top":a.y=t.top-s-l;break;case"bottom":a.y=t.bottom+l;break;case"left":a.x=t.left-o-l;break;case"right":a.x=t.right+l}if("top"===n||"bottom"===n)switch(r){case"start":a.x=t.left;break;case"center":a.x=t.left-o/2+t.width/2;break;case"end":a.x=t.right-o}else switch(r){case"start":a.y=t.top;break;case"center":a.y=t.top-s/2+t.height/2;break;case"end":a.y=t.bottom-s}return a},s={top:"bottom",bottom:"top",left:"right",right:"left"},a=(e,t)=>{const n=t;return{top:e.top<n.top,left:e.left<n.left,bottom:e.bottom>n.bottom,right:e.right>n.right}},l={start:"end",end:"start"};function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const h=(e,t)=>{switch(e){case"top":switch(t){case"start":return"bottom left";case"center":return"bottom center";case"end":return"bottom right"}break;case"bottom":switch(t){case"start":return"top left";case"center":return"top center";case"end":return"top right"}break;case"left":switch(t){case"start":return"top right";case"center":return"top center";case"end":return"bottom right"}break;case"right":switch(t){case"start":return"top left";case"center":return"top center";case"end":return"bottom left"}}},p=e=>{let{align:t,anchorRect:n,documentRect:c,popoverRect:d,side:p,disableMobileFullscreenTakeover:f,disableApplyingMobileWidth:g,disableFlip:m,maxHeightFunction:y,offset:v}=e;if(!d||!n)return null;if(!matchMedia(r.Yd.md).matches&&!f)return null;const A=o(d,n,p,t),b=a(A,c),w=s[p],S=b[p]?w:p,C=(e=>{let{finalSide:t,preferredAlignment:n,collisions:r,popoverRect:i,buttonRect:s,documentRect:c}=e;const u="top"===t||"bottom"===t,d=u?"right":"bottom",h=u?"left":"top",p="start"===n,f="end"===n;if("center"===n){if(r[d])return"end";if(r[h])return"start"}else{const e=a(o(i,s,t,l[n]),c);if(p&&r[d]&&!e[h])return"end";if(f&&r[h]&&!e[d])return"start"}return n})({finalSide:m?p:S,preferredAlignment:t,collisions:b,popoverRect:d,buttonRect:n,documentRect:c}),E=o(d,n,m?p:S,C,v);let I=((e,t,n,i,o)=>{if(!matchMedia(r.Yd.md).matches&&!o)return"none";const s=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--safe-area-inset-top"));let a=0;if(t)switch(n){case"top":a=Math.abs(e.height-t.top),s>0&&(a+=s);break;case"bottom":a=t.bottom;break;case"left":case"right":switch(i){case"start":a=t.top;break;case"end":a=e.height-t.bottom}}return e.height-a-10})(c,n,m?p:S,C,f);return y&&"number"==typeof I&&(I=y(I)),(e=>{const{rect:t,disableMobileFullscreenTakeover:n=!1,disableApplyingMobileWidth:r=!1,maxHeight:o="none"}=e,s="none"!==o&&(!(0,i.Av)()||n),a=(0,i.Av)()&&n&&!r,l=(10,.1*window.innerWidth);return u(u({willChange:"transform","--translate-x":"".concat(a?l/2:Math.floor(t.x),"px"),"--translate-y":"".concat(Math.floor(t.y),"px"),"--offset":"".concat(e.offset,"px"),transform:"translate3d(var(--translate-x), var(--translate-y), 0)","--transform-origin":h(e.side,e.align),visibility:"visible"},s&&{maxHeight:"".concat(o,"px")}),a&&{width:"".concat(window.innerWidth-l,"px")})})({rect:E,side:m?p:S,align:C,disableMobileFullscreenTakeover:f,disableApplyingMobileWidth:g,maxHeight:I,offset:v})}},27055:(e,t,n)=>{"use strict";n.d(t,{Z:()=>j});var r=n(52322),i=n(3555),o=n(74547),s=n(2784),a=n(24118);const l=()=>{const e=(0,s.useRef)(null);(0,s.useEffect)((()=>{const t=(0,a.Av)();if(t&&!e.current){const t=document.createElement("style");t.textContent="body { overflow: hidden; }",document.body.appendChild(t),e.current=t}return()=>{t&&e.current&&e.current.remove()}}),[])};var c=n(29894),u=n(65737),d=n(57137),h=n(10878),p=n(18329),f=n(7453),g=n(88450),m=n(64503);const y=()=>(l(),null),v=e=>{let{open:t,requestClose:n,children:o,title:l,className:v,id:A,forceFullHeightOnMobile:b}=e;const w=(0,i.ac)(i.Jj.sm),[S,C,E]=(0,h.vU)(t,w),[,I]=(0,m.r)({open:t,enter:{keyframes:[{opacity:0},{opacity:.6}],options:h.Yb},exit:{keyframes:[{opacity:.6},{opacity:0}],options:h.Yb}});(0,s.useEffect)((()=>{if(!E)return;let e=null,t=0,r=0,i=Date.now(),o=0,s=!1,l=!1;const c=n=>{r=n.touches[0].clientY,t=E.getBoundingClientRect().y,i=Date.now(),e=(0,a.rP)(n.target),o=(null==e?void 0:e.scrollTop)||0,s=!!e&&o>0,l=!1},u=n=>{const i=n.touches[0].clientY-r,a=(null==e?void 0:e.scrollTop)||0;a!==o&&(l=!0),i<0||e&&a>0||l||s||(E.getBoundingClientRect().y>t&&e&&(e.style.overflowY="hidden"),E.animate({transform:["translate3d(0, ".concat(i,"px, 0)")]},{duration:0,fill:"forwards"}))},d=t=>{const o=E.getBoundingClientRect().y,a=.75*window.innerHeight,l=Date.now(),c=t.changedTouches[0].clientY-r;o<a&&c/(l-i)>2||o>a&&!s?n():E.animate({transform:["translate3d(0, 0, 0)"]},{duration:200,fill:"forwards"}),r=0,e&&(e.style.overflowY="")};return E.addEventListener("touchstart",c,!!g.Mk&&{passive:!0}),E.addEventListener("touchmove",u,!!g.Mk&&{passive:!0}),E.addEventListener("touchend",d,!!g.Mk&&{passive:!0}),()=>{E.removeEventListener("touchstart",c),E.removeEventListener("touchmove",u),E.removeEventListener("touchend",d)}}),[E,n]);const _=(0,s.useCallback)((e=>{e&&(e.close=n)}),[n]);return S?(0,r.jsxs)(u.Z,{children:[(0,r.jsx)(y,{}),(0,r.jsxs)("div",{className:"fixed left-0 top-0 z-modal h-full max-h-[var(--ios-viewport-height,_none)] w-full",children:[(0,r.jsx)("div",{className:"absolute z-0 h-full w-full bg-passive-4 opacity-0",ref:I}),(0,r.jsxs)("div",{ref:(0,f.l)([C,_]),className:(0,c.classNames)("z-1 absolute bottom-0 flex max-h-[calc(100%_-_max(var(--safe-area-inset-top),2rem))] min-h-[40%] w-full flex-col rounded-t-xl bg-passive-5 pb-safe-bottom",b&&"h-full"),style:{boxShadow:"0px -4px 8px rgba(0, 0, 0, 0.075)"},id:"popover/"+A,"data-popover":A,"data-mobile-popover":!0,children:[(0,r.jsx)("div",{className:"w-full rounded-t-xl bg-default",children:(0,r.jsx)("div",{className:"mx-auto mt-2 min-h-[0.3rem] w-12 rounded-full bg-passive-2"})}),(0,r.jsxs)(p.Z,{className:"border-b border-border bg-default px-2 py-1.5 text-lg",children:[(0,r.jsx)("div",{}),(0,r.jsx)("div",{className:"flex items-center justify-center font-semibold",children:l}),(0,r.jsx)(d.Z,{type:"primary",slot:"right",action:n,children:"Done"})]}),(0,r.jsx)("div",{className:(0,c.classNames)("h-full overflow-y-auto overscroll-none bg-passive-5",v),children:o})]})]})]}):null};var A=n(84075);const b=()=>(0,A.gn)()?document.body.getBoundingClientRect():document.documentElement.getBoundingClientRect();var w=n(32810),S=n(87901),C=n(32620),E=n(38167);function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach((function(t){x(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function x(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const P=e=>{let{align:t="end",anchorElement:n,anchorPoint:o,children:a,childPopovers:c,className:d,id:h,overrideZIndex:p,side:g="bottom",togglePopover:m,disableClickOutside:y,disableMobileFullscreenTakeover:v,disableFlip:I,disableApplyingMobileWidth:x,maxHeight:P,portal:k=!0,offset:B,hideOnClickInModal:O=!1,setAnimationElement:N,containerClassName:D,documentElement:j}=e;var T;const[M,F]=(0,s.useState)(null),R=(0,w.l)(M),L=n&&"current"in n?n.current:n,Q=(0,w.l)(L,{updateOnWindowResize:!0}),U=DOMRect.fromRect({x:null==o?void 0:o.x,y:null==o?void 0:o.y}),V=o?U:Q,K=(()=>{const[e,t]=(0,s.useState)(b());return(0,s.useEffect)((()=>{const e=()=>{window.clearTimeout(void 0),window.setTimeout((()=>{t(b())}),100)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),e})(),H=(0,i.ac)(i.Yd.md),G=(0,C.w)({align:t,anchorRect:V,documentRect:null!==(T=null==j?void 0:j.getBoundingClientRect())&&void 0!==T?T:K,popoverRect:null!=R?R:null==M?void 0:M.getBoundingClientRect(),side:g,disableMobileFullscreenTakeover:v,disableFlip:I,disableApplyingMobileWidth:x,maxHeightFunction:P,offset:B});let Y;G||(document.body.style.overflow="hidden"),(0,s.useLayoutEffect)((()=>()=>{document.body.style.overflow=""}),[]),!k&&M&&G&&(Y=(0,E.p)(M,G,j)),(e=>{let{popoverElement:t,anchorElement:n,togglePopover:r,childPopovers:i,disabled:o,hideOnClickInModal:a=!1}=e;(0,s.useEffect)((()=>{const e=e=>{var s;const l=e.target,c=null==t?void 0:t.contains(l),u=!!n&&(n===e.target||n.contains(l)),d=null===(s=l.closest("[data-popover]"))||void 0===s?void 0:s.getAttribute("data-popover"),h=d&&i.has(d),p=!(null==t?void 0:t.closest("[data-dialog], .sk-modal"))&&!!l.closest("[data-dialog], [data-backdrop], .sk-modal"),f=!!l.closest("#desktop-title-bar");c||u||h||f||!(!p||p&&a)||o||null==r||r()};return document.addEventListener("click",e,{capture:!0}),document.addEventListener("contextmenu",e,{capture:!0}),()=>{document.removeEventListener("click",e,{capture:!0}),document.removeEventListener("contextmenu",e,{capture:!0})}}),[n,i,t,r,o,a])})({popoverElement:M,anchorElement:L,togglePopover:m,childPopovers:c,hideOnClickInModal:O,disabled:y}),l();const z=(0,s.useRef)(!0),Z=(0,s.useCallback)((e=>{e&&e.scrollTop>0&&z.current&&(e.scrollTop=0,z.current=!1)}),[]),W=(0,s.useCallback)((e=>{e&&m&&(e.close=m)}),[m]);return(0,r.jsx)(u.Z,{disabled:!k,children:(0,r.jsx)("div",{className:(0,S.classNames)("absolute left-0 top-0 flex w-full min-w-80 cursor-auto flex-col md:h-auto md:max-w-xs",!v&&"h-full",p||"z-dropdown-menu",H||v?"invisible":"",D),style:_(_({},G),Y),ref:(0,f.l)([F,W]),id:"popover/"+h,"data-popover":h,onKeyDown:e=>{e.key===A.u8.Escape&&(e.stopPropagation(),null==m||m(),L&&L.focus())},onBlur:()=>{setTimeout((()=>{document.activeElement&&"IFRAME"===document.activeElement.tagName&&!document.activeElement.getAttribute("data-used-in-modal")&&(null==m||m())}))},children:(0,r.jsx)("div",{className:(0,S.classNames)("overflow-y-auto rounded border border-[--popover-border-color] bg-default shadow-main [backdrop-filter:var(--popover-backdrop-filter)] md:bg-[--popover-background-color]",H||v?"":"pb-safe-bottom pt-safe-top","transition-[transform,opacity] duration-75 [transform-origin:var(--transform-origin)] motion-reduce:transition-opacity",G?"scale-100 opacity-100":"scale-95 opacity-0",d),ref:(0,f.l)([Z,N]),onScroll:()=>{z.current=!1},children:a})})})};function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function B(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function O(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const N=(0,s.createContext)(null),D=e=>{const[t,n]=(0,m.r)({open:e.open,exit:{keyframes:[{opacity:0,transform:"scale(0.95)"}],reducedMotionKeyframes:[{opacity:0}],options:{duration:75}}});return t?(0,r.jsx)(P,B(B({setAnimationElement:n},e),{},{children:e.children})):null},j=e=>{const t=(0,s.useId)(),n=(0,o.x)();(e=>{const t=(0,s.useContext)(N);(0,s.useEffect)((()=>{const n=e;return null==t||t.registerChildPopover(n),()=>{null==t||t.unregisterChildPopover(n)}}),[t,e])})(t);const[a,l]=(0,s.useState)(new Set),c=(0,s.useCallback)((e=>{l((t=>new Set(t.add(e))))}),[]),u=(0,s.useCallback)((e=>{l((t=>(t.delete(e),new Set(t))))}),[]),d=(0,s.useMemo)((()=>({registerChildPopover:c,unregisterChildPopover:u})),[c,u]);return(0,s.useEffect)((()=>{let t;return e.open&&(t=n((()=>{var t;return null===(t=e.togglePopover)||void 0===t||t.call(e),!0}))),()=>{t&&t()}}),[n,e,e.open]),(0,s.useEffect)((()=>{const t=e.anchorElement&&"current"in e.anchorElement?e.anchorElement.current:e.anchorElement;return t&&(t.setAttribute("aria-haspopup","true"),e.open?t.setAttribute("aria-expanded","true"):t.removeAttribute("aria-expanded")),()=>{t&&(t.removeAttribute("aria-haspopup"),t.removeAttribute("aria-expanded"))}}),[e.anchorElement,e.open]),(0,i.ac)(i.Jj.sm)&&!e.disableMobileFullscreenTakeover?(0,r.jsx)(v,{open:e.open,requestClose:()=>{var t;null===(t=e.togglePopover)||void 0===t||t.call(e)},title:e.title,className:e.className,id:t,forceFullHeightOnMobile:e.forceFullHeightOnMobile,children:e.children}):(0,r.jsx)(N.Provider,{value:d,children:(0,r.jsx)(D,B(B({},e),{},{childPopovers:a,id:t}))})}},38167:(e,t,n)=>{"use strict";function r(e){if(!e)return null;const t=e.parentElement;return t?"absolute"===window.getComputedStyle(t).getPropertyValue("position")?t:r(t):null}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{p:()=>a});const a=(e,t,n)=>{const i=n||r(e)||e.parentElement,s=null==t?void 0:t["--translate-x"],a=null==t?void 0:t["--translate-y"],l=s?parseInt(s):0,c=a?parseInt(a):0;if(!i)return t;const u=i.getBoundingClientRect(),d=Math.floor(l-u.left),h=Math.floor(c-u.top);return o(o({},t),{},{"--translate-x":"".concat(d,"px"),"--translate-y":"".concat(h,"px")})}},65737:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(52322),i=n(2784),o=n(28316);const s=e=>{let{children:t,disabled:n=!1}=e;const[s,a]=(0,i.useState)(),l="portal/"+(0,i.useId)();return(0,i.useEffect)((()=>{const e=document.createElement("div");return e.id=l,document.body.append(e),a(e),()=>e.remove()}),[l]),n?(0,r.jsx)(r.Fragment,{children:t}):s?(0,o.createPortal)(t,s):null}},97168:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f,g:()=>p});var r=n(52322),i=n(29894),o=n(82619),s=n(2784),a=n(53846),l=n(88669),c=n(65378),u=n(44993),d=n(5778),h=n(3555);const p="ConfirmBeforeExit",f=e=>{let{application:t}=e;const[n,f]=(0,s.useState)((()=>{var e;return null===(e=t.getValue(p))||void 0===e||e})),g=(0,h.ac)(h.Jj.sm),m=(0,d.Z)(i.PrefKey.EditorSpellcheck),y=(0,d.Z)(i.PrefKey.NoteAddToParentFolders),v=(0,d.Z)(i.PrefKey.AlwaysShowSuperToolbar);return(0,r.jsx)(c.Z,{children:(0,r.jsxs)(u.Z,{children:[(0,r.jsx)(o.Dx,{children:"Defaults"}),t.platform===i.Platform.Android&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex justify-between gap-2 md:items-center",children:[(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)(o.QE,{children:"Always ask before closing app (Android)"}),(0,r.jsx)(o.xv,{children:"Whether a confirmation dialog should be shown before closing the app."})]}),(0,r.jsx)(l.Z,{onChange:()=>{const e=!n;f(e),t.setValue(p,e)},checked:n})]}),(0,r.jsx)(a.Z,{classes:"my-4"})]}),(0,r.jsxs)("div",{className:"flex justify-between gap-2 md:items-center",children:[(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)(o.QE,{children:"Spellcheck"}),(0,r.jsx)(o.xv,{children:"The default spellcheck value for new notes. Spellcheck can be configured per note from the note context menu. Spellcheck may degrade overall typing performance with long notes."})]}),(0,r.jsx)(l.Z,{onChange:()=>{t.toggleGlobalSpellcheck().catch(console.error)},checked:m})]}),(0,r.jsx)(a.Z,{classes:"my-4"}),(0,r.jsxs)("div",{className:"flex justify-between gap-2 md:items-center",children:[(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)(o.QE,{children:"Add all parent tags when adding a nested tag to a note"}),(0,r.jsx)(o.xv,{children:"When enabled, adding a nested tag to a note will automatically add all associated parent tags."})]}),(0,r.jsx)(l.Z,{onChange:()=>{t.setPreference(i.PrefKey.NoteAddToParentFolders,!y).catch(console.error)},checked:y})]}),(0,r.jsx)(a.Z,{classes:"my-4"}),!g&&(0,r.jsxs)("div",{className:"flex justify-between gap-2 md:items-center",children:[(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)(o.QE,{children:"Use always-visible toolbar in Super notes"}),(0,r.jsx)(o.xv,{children:"When enabled, the Super toolbar will always be shown at the top of the note. It can be temporarily toggled using Cmd/Ctrl+Shift+K. When disabled, the Super toolbar will only be shown as a floating toolbar when text is selected."})]}),(0,r.jsx)(l.Z,{onChange:()=>{t.setPreference(i.PrefKey.AlwaysShowSuperToolbar,!v).catch(console.error)},checked:v})]})]})})}},82619:(e,t,n)=>{"use strict";n.d(t,{Cr:()=>l,DR:()=>h,Dx:()=>s,KI:()=>u,QE:()=>a,Qj:()=>d,xv:()=>c});var r=n(52322),i=n(756),o=n(87901);const s=e=>{let{children:t,className:n}=e;return(0,r.jsx)("h2",{className:(0,o.classNames)("m-0 mb-1 text-lg font-bold text-info md:text-base",n),children:t})},a=e=>{let{children:t,className:n}=e;return(0,r.jsx)("h4",{className:(0,o.classNames)("m-0 mb-1 text-base font-medium lg:text-sm",n),children:t})},l=e=>{let{children:t,className:n}=e;return(0,r.jsx)("h4",{className:(0,o.classNames)("m-0 mb-1 text-base font-normal lg:text-sm",n),children:t})},c=e=>{let{children:t,className:n}=e;return(0,r.jsx)("p",{className:(0,o.classNames)("text-base lg:text-xs",n),children:t})},u=e=>{let{children:t,className:n}=e;return(0,r.jsx)("p",{className:(0,o.classNames)("text-sm lg:text-xs",n),children:t})},d=e=>{let{label:t,link:n,className:i,onClick:s}=e;return(0,r.jsx)("a",{target:"_blank",className:(0,o.classNames)("block w-fit rounded border border-solid border-border bg-normal-button px-4 py-1.5 text-base font-bold text-text hover:bg-contrast focus:bg-contrast lg:text-sm",i),href:n,onClick:s,children:t})},h=e=>{let{children:t,className:n,style:s}=e;const a=(0,i.c)(s);return(0,r.jsx)("div",{className:(0,o.classNames)("ml-2 rounded px-2 py-1 text-[10px] font-bold",n,a),children:t})}},65378:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(52322);const i=e=>{let{children:t}=e;return(0,r.jsx)("div",{className:"mb-3 flex max-w-full flex-col rounded border border-solid border-border bg-default p-6",children:t})}},44993:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(52322);const i=e=>{let{children:t,classes:n=""}=e;return(0,r.jsx)("div",{className:"flex flex-col ".concat(n),children:t})}},13500:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(52322);const i=e=>{let{checked:t,className:n,disabled:i}=e;return(0,r.jsx)("div",{className:"relative h-5 w-5 rounded-full border-2 border-solid md:h-4 md:w-4 ".concat(i?"opacity-50":""," ").concat(t?"border-info after:absolute after:left-1/2 after:top-1/2 after:h-3 after:w-3 after:-translate-x-1/2 after:-translate-y-1/2 after:rounded-full after:bg-info md:after:h-2 md:after:w-2":"border-passive-1"," ").concat(n)})}},88743:(e,t,n)=>{"use strict";n.d(t,{Z:()=>P});var r=n(52322),i=n(46462),o=n(6236),s=n(14191),a=n(13277),l=n(81548),c=n(40077);function u(e={}){var t,n=(0,c.S0)(e,[]);const r=null==(t=n.store)?void 0:t.getState(),i=(0,s.t)((0,c.EZ)((0,c.ih)({},n),{focusLoop:(0,l.LS)(n.focusLoop,null==r?void 0:r.focusLoop,!0)})),o=(0,c.EZ)((0,c.ih)({},i.getState()),{value:(0,l.LS)(n.value,null==r?void 0:r.value,n.defaultValue,null)}),u=(0,a.MT)(o,i,n.store);return(0,c.EZ)((0,c.ih)((0,c.ih)({},i),u),{setValue:e=>u.setState("value",e)})}var d=n(9587),h=n(45010),p=(0,h.re)([d.Lq],[d.al]),f=p.useContext,g=(p.useScopedContext,p.useProviderContext),m=(p.ContextProvider,p.ScopedContextProvider),y=n(38346),v=n(48104),A=n(70604),b=(0,h.Bi)((e=>{var t=e,{store:n}=t,i=(0,A.S0)(t,["store"]);const o=g();return n=n||o,(0,l.kG)(n,!1),i=(0,v.OJ)(i,(e=>(0,r.jsx)(m,{value:n,children:e})),[n]),i=(0,A.ih)({role:"radiogroup"},i),(0,y.Q)((0,A.ih)({store:n},i))})),w=(0,h.LM)((e=>{const t=b(e);return(0,h.az)("div",t)})),S=n(96332),C=n(74018),E=n(2784),I=(0,h.Bi)((e=>{var t=e,{store:n,name:r,value:i,checked:s}=t,a=(0,A.S0)(t,["store","name","value","checked"]);const c=f();n=n||c;const u=(0,v.Me)(a.id),d=(0,E.useRef)(null),h=(0,o.Kw)(n,(e=>null!=s?s:function(e,t){if(void 0!==t)return null!=e&&null!=t?t===e:!!t}(i,null==e?void 0:e.value)));(0,E.useEffect)((()=>{u&&h&&((null==n?void 0:n.getState().activeId)===u||null==n||n.setActiveId(u))}),[n,h,u]);const p=a.onChange,g=(w=(0,v.O)(d,a.as||"input"),S=a.type,"input"===w&&(!S||"radio"===S)),m=(0,l.EE)(a),[y,b]=(0,v.NW)();var w,S;(0,E.useEffect)((()=>{const e=d.current;e&&(g||(void 0!==h&&(e.checked=h),void 0!==r&&(e.name=r),void 0!==i&&(e.value=`${i}`)))}),[y,g,h,r,i]);const I=(0,v.zX)((e=>{if(m)return e.preventDefault(),void e.stopPropagation();g||(e.currentTarget.checked=!0,b()),null==p||p(e),e.defaultPrevented||null==n||n.setValue(i)})),_=a.onClick,x=(0,v.zX)((e=>{null==_||_(e),e.defaultPrevented||g||I(e)})),P=a.onFocus,k=(0,v.zX)((e=>{if(null==P||P(e),e.defaultPrevented)return;if(!g)return;if(!n)return;const{moves:t,activeId:r}=n.getState();t&&(u&&r!==u||I(e))}));return a=(0,A.EZ)((0,A.ih)({id:u,role:g?void 0:"radio",type:g?"radio":void 0,"aria-checked":h},a),{ref:(0,v.qq)(d,a.ref),onChange:I,onClick:x,onFocus:k}),a=(0,C.E)((0,A.ih)({store:n,clickOnEnter:!g},a)),(0,A.ih)({name:g?r:void 0,value:g?i:void 0,checked:h},a)})),_=(0,h.W5)((e=>{const t=I(e);return(0,h.az)("input",t)})),x=n(87901);const P=function(e){let{value:t,items:n,onChange:s,className:a}=e;const l=function(e={}){const[t,n]=(0,o.oR)(u,e);return function(e,t,n){return e=(0,i.b)(e,t,n),(0,o.XS)(e,n,"value","setValue"),e}(t,n,e)}({value:t,orientation:"horizontal",setValue(e){s(e)}});return(0,r.jsx)(w,{store:l,className:"flex divide-x divide-border rounded border border-border md:translucent-ui:border-[--popover-border-color] ".concat(null!=a?a:""),children:n.map((e=>{let{label:n,value:i}=e;return(0,r.jsxs)("label",{className:(0,x.classNames)("flex-grow select-none px-3.5 py-1.5 text-center","first:rounded-bl first:rounded-tl last:rounded-br last:rounded-tr",i===t&&"bg-info-backdrop font-medium text-info ring-1 ring-inset ring-info focus-within:ring-2"),children:[(0,r.jsx)(S.T,{children:(0,r.jsx)(_,{value:i})}),n]},i)}))})}},53846:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(52322);const i=e=>{let{classes:t=""}=e;return(0,r.jsx)("hr",{className:"min-h-[1px] w-full border-none bg-[--separator-color] ".concat(t)})}},41707:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(52322);const i=e=>{let{className:t}=e;return(0,r.jsx)("div",{className:"animate-spin rounded-full border border-solid border-info border-r-transparent ".concat(t)})}},75711:(e,t,n)=>{"use strict";n.d(t,{Z:()=>L});var r=n(52322),i=n(29894),o=n(2784),s=n(12216),a=n(6236),l=n(97254),c=n(13277),u=n(81548),d=n(40077);function h(e={}){var t;const n=null==(t=e.store)?void 0:t.getState(),r=(0,l.A)((0,d.EZ)((0,d.ih)({},e),{placement:(0,u.LS)(e.placement,null==n?void 0:n.placement,"top"),hideTimeout:(0,u.LS)(e.hideTimeout,null==n?void 0:n.hideTimeout,0)})),i=(0,d.EZ)((0,d.ih)({},r.getState()),{type:(0,u.LS)(e.type,null==n?void 0:n.type,"description"),skipTimeout:(0,u.LS)(e.skipTimeout,null==n?void 0:n.skipTimeout,300)}),o=(0,c.MT)(i,r,e.store);return(0,d.ih)((0,d.ih)({},r),o)}var p=n(89723),f=n(19922),g=n(45010),m=(0,g.re)([f.$M],[f.WS]),y=(m.useContext,m.useScopedContext,m.useProviderContext),v=(m.ContextProvider,m.ScopedContextProvider),A=n(48104),b=n(70604),w=(0,c.MT)({activeStore:null}),S=(0,g.Bi)((e=>{var t=e,{store:n,showOnHover:r=!0}=t,i=(0,b.S0)(t,["store","showOnHover"]);const s=y();n=n||s,(0,u.kG)(n,!1);const a=(0,o.useRef)(!1);(0,o.useEffect)((()=>(0,c.Z_)(n,["mounted"],(e=>{e.mounted||(a.current=!1)}))),[n]),(0,o.useEffect)((()=>(0,c.Z_)(n,["mounted","skipTimeout"],(e=>{if(!n)return;if(e.mounted){const{activeStore:e}=w.getState();return e!==n&&(null==e||e.hide()),w.setState("activeStore",n)}const t=setTimeout((()=>{const{activeStore:e}=w.getState();e===n&&w.setState("activeStore",null)}),e.skipTimeout);return()=>clearTimeout(t)}))),[n]);const l=i.onMouseEnter,d=(0,A.zX)((e=>{null==l||l(e),a.current=!0})),h=i.onFocusVisible,f=(0,A.zX)((e=>{null==h||h(e),e.defaultPrevented||(null==n||n.setAnchorElement(e.currentTarget),null==n||n.show())})),g=i.onBlur,m=(0,A.zX)((e=>{if(null==g||g(e),e.defaultPrevented)return;const{activeStore:t}=w.getState();t===n&&w.setState("activeStore",null)})),v=n.useState("type"),S=n.useState((e=>{var t;return null==(t=e.contentElement)?void 0:t.id}));return i=(0,b.EZ)((0,b.ih)({"aria-labelledby":"label"===v?S:void 0,"aria-describedby":"description"===v?S:void 0},i),{onMouseEnter:d,onFocusVisible:f,onBlur:m}),(0,p.S)((0,b.ih)({store:n,showOnHover:e=>{if(!a.current)return!1;if((0,u.Bk)(r,e))return!1;const{activeStore:t}=w.getState();return!t||(null==n||n.show(),!1)}},i))})),C=(0,g.LM)((e=>{const t=S(e);return(0,g.az)("div",t)})),E=n(23738),I=n(56278),_=n(10244),x=(0,g.Bi)((e=>{var t=e,{store:n,portal:i=!0,gutter:o=8,preserveTabOrder:s=!1,hideOnHoverOutside:a=!0,hideOnInteractOutside:l=!0}=t,c=(0,b.S0)(t,["store","portal","gutter","preserveTabOrder","hideOnHoverOutside","hideOnInteractOutside"]);const d=y();n=n||d,(0,u.kG)(n,!1),c=(0,A.OJ)(c,(e=>(0,r.jsx)(v,{value:n,children:e})),[n]);const h=n.useState((e=>"description"===e.type?"tooltip":"none"));return c=(0,b.ih)({role:h},c),(0,E.c)((0,b.EZ)((0,b.ih)({},c),{store:n,portal:i,gutter:o,preserveTabOrder:s,hideOnHoverOutside:e=>{if((0,u.Bk)(a,e))return!1;const t=null==n?void 0:n.getState().anchorElement;return!t||!("focusVisible"in t.dataset)},hideOnInteractOutside:e=>{if((0,u.Bk)(l,e))return!1;const t=null==n?void 0:n.getState().anchorElement;return!t||!(0,_.r3)(t,e.target)}}))})),P=(0,I.L5)((0,g.LM)((e=>{const t=x(e);return(0,g.az)("div",t)})),y),k=n(20038),B=n(3555),O=n(32620),N=n(38167),D=n(67955),j=n(24118);const T=["children","className","label","showOnMobile","showOnHover","interactive","type","side","documentElement"];function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function F(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function R(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const L=e=>{let{children:t,className:n,label:l,showOnMobile:c=!1,showOnHover:u=!0,interactive:d=!1,type:p="label",side:f,documentElement:g}=e,m=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,T);const[y,v]=(0,o.useState)(),A=(0,B.ac)(B.Jj.sm),b=function(e={}){const[t,n]=(0,a.oR)(h,e);return function(e,t,n){return e=(0,s.M)(e,t,n),(0,a.XS)(e,n,"type"),(0,a.XS)(e,n,"skipTimeout"),e}(t,n,e)}({timeout:A&&c?100:500,hideTimeout:0,skipTimeout:0,open:y,animated:!0,type:p}),w=(0,o.useRef)(null),{attachEvents:S,cleanupEvents:E}=(0,D.H)(w,(()=>{b.show(),setTimeout((()=>{b.hide()}),2e3)}));(0,o.useEffect)((()=>{if(A&&c)return S(),()=>{E()}}),[S,E,A,c]);const I=A?{}:{onClick:()=>b.hide()};return(0,o.useEffect)((()=>{const e=w.current;if(!e)return;const t=(0,j.rP)(e);if(!t)return;const n=()=>{b.hide()};return t.addEventListener("scroll",n),()=>{t.removeEventListener("scroll",n)}}),[b]),A&&!c?(0,r.jsx)(r.Fragment,{children:t}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(C,F(F({},I),{},{onBlur:()=>v(void 0),store:b,render:(0,r.jsx)(k.g7,{ref:w}),showOnHover:u,children:t})),(0,r.jsx)(P,F(F({tabIndex:void 0,autoFocusOnShow:!u,store:b,className:(0,i.classNames)("z-tooltip max-w-max rounded border border-border bg-contrast px-3 py-1.5 text-sm text-foreground shadow [backdrop-filter:var(--popover-backdrop-filter)] translucent-ui:border-[--popover-border-color] translucent-ui:bg-[--popover-background-color]","opacity-60 transition-opacity duration-75 [&[data-enter]]:opacity-100 [&[data-leave]]:opacity-60","focus-visible:shadow-none focus-visible:outline-none",n),updatePosition:()=>{const{popoverElement:e,anchorElement:t,open:n}=b.getState();!d&&e&&(e.style.pointerEvents="none");const r=g||document.querySelector(".main-ui-view");if(!(e&&t&&r&&n))return;const i=t.getBoundingClientRect(),o=e.getBoundingClientRect(),s=r.getBoundingClientRect(),a=(0,O.w)({align:"center",side:f||"bottom",anchorRect:i,popoverRect:o,documentRect:s,disableMobileFullscreenTakeover:!0,disableApplyingMobileWidth:!0,offset:m.gutter?m.gutter:6});if(a&&(Object.assign(e.style,a),!m.portal)){const t=(0,N.p)(e,a,m.portalElement instanceof HTMLElement?m.portalElement:void 0);e.style.setProperty("--translate-x",t["--translate-x"]),e.style.setProperty("--translate-y",t["--translate-y"])}}},m),{},{children:l}))]})}},32839:(e,t,n)=>{"use strict";n.d(t,{k:()=>Ln});var r=n(52322),i=n(2784),o=n(47166);const s="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?i.useLayoutEffect:i.useEffect;function a(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function l(){return function(e){const[t]=(0,o.g)(),n=(0,i.useMemo)((()=>e(t)),[t,e]),r=(0,i.useRef)(n.initialValueFn()),[a,l]=(0,i.useState)(r.current);return s((()=>{const{initialValueFn:e,subscribe:t}=n,i=e();return r.current!==i&&(r.current=i,l(i)),t((e=>{r.current=e,l(e)}))}),[n,e]),a}(a)}var c=n(31031);function u(e){return()=>function(e){if(!function(e,t=!0){if(e)return!1;let n=(0,c.Gv)().getTextContent();return t&&(n=n.trim()),""===n}(e,!1))return!1;const t=(0,c.Gv)().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e<n;e++){const n=t[e];if((0,c.k$)(n))return!1;if((0,c.F7)(n)){if(!(0,c.Rl)(n))return!1;if(0!==n.__indent)return!1;const t=n.getChildren(),r=t.length;for(let n=0;n<r;n++){const n=t[e];if(!(0,c.Gg)(n))return!1}}}return!0}(e)}var d=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})),h=n(29016),p=n(28316),f=n(9591);const g="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?i.useLayoutEffect:i.useEffect;function m(e){return e.getEditorState().read(u(e.isComposing()))}function y({contentEditable:e,placeholder:t,ErrorBoundary:n}){const[s]=(0,o.g)(),a=function(e,t){const[n,o]=(0,i.useState)((()=>e.getDecorators()));return g((()=>e.registerDecoratorListener((e=>{(0,p.flushSync)((()=>{o(e)}))}))),[e]),(0,i.useEffect)((()=>{o(e.getDecorators())}),[e]),(0,i.useMemo)((()=>{const o=[],s=Object.keys(n);for(let a=0;a<s.length;a++){const l=s[a],c=(0,r.jsx)(t,{onError:t=>e._onError(t),children:(0,r.jsx)(i.Suspense,{fallback:null,children:n[l]})}),u=e.getElementByKey(l);null!==u&&o.push((0,p.createPortal)(c,u,l))}return o}),[t,n,e])}(s,n);return function(e){g((()=>(0,h.qV)((0,f.ML)(e),function(e){const t=window.location.origin,n=n=>{if(n.origin!==t)return;const r=e.getRootElement();if(document.activeElement!==r)return;const i=n.data;if("string"==typeof i){let t;try{t=JSON.parse(i)}catch(e){return}if(t&&"nuanria_messaging"===t.protocol&&"request"===t.type){const r=t.payload;if(r&&"makeChanges"===r.functionId){const t=r.args;if(t){const[r,i,o,s,a,l]=t;e.update((()=>{const e=(0,c.dL)();if((0,c.OP)(e)){const t=e.anchor;let l=t.getNode(),u=0,d=0;if((0,c.Gg)(l)&&r>=0&&i>=0&&(u=r,d=r+i,e.setTextNodeRange(l,u,l,d)),u===d&&""===o||(e.insertRawText(o),l=t.getNode()),(0,c.Gg)(l)){u=s,d=s+a;const t=l.getTextContentSize();u=u>t?t:u,d=d>t?t:d,e.setTextNodeRange(l,u,l,d)}n.stopImmediatePropagation()}}))}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}(e))),[e])}(s),(0,r.jsxs)(r.Fragment,{children:[e,(0,r.jsx)(v,{content:t}),a]})}function v({content:e}){const[t]=(0,o.g)(),n=function(e){const[t,n]=(0,i.useState)((()=>m(e)));return g((()=>{function t(){const t=m(e);n(t)}return t(),(0,h.qV)(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(t),r=l();return n?"function"==typeof e?e(r):e:null}const A="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?i.useLayoutEffect:i.useEffect;function b({ariaActiveDescendant:e,ariaAutoComplete:t,ariaControls:n,ariaDescribedBy:s,ariaExpanded:a,ariaLabel:l,ariaLabelledBy:c,ariaMultiline:u,ariaOwns:d,ariaRequired:h,autoCapitalize:p,className:f,id:g,role:m="textbox",spellCheck:y=!0,style:v,tabIndex:b,"data-testid":w,...S}){const[C]=(0,o.g)(),[E,I]=(0,i.useState)(!1),_=(0,i.useCallback)((e=>{e&&e.ownerDocument&&e.ownerDocument.defaultView&&C.setRootElement(e)}),[C]);return A((()=>(I(C.isEditable()),C.registerEditableListener((e=>{I(e)})))),[C]),(0,r.jsx)("div",{...S,"aria-activedescendant":E?e:void 0,"aria-autocomplete":E?t:"none","aria-controls":E?n:void 0,"aria-describedby":s,"aria-expanded":E&&"combobox"===m?!!a:void 0,"aria-label":l,"aria-labelledby":c,"aria-multiline":u,"aria-owns":E?d:void 0,"aria-readonly":!E||void 0,"aria-required":h,autoCapitalize:p,className:f,contentEditable:E,"data-testid":w,id:g,ref:_,role:m,spellCheck:y,style:v,tabIndex:b})}const w="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?i.useLayoutEffect:i.useEffect;function S({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:t=!1,onChange:n}){const[r]=(0,o.g)();return w((()=>{if(n)return r.registerUpdateListener((({editorState:i,dirtyElements:o,dirtyLeaves:s,prevEditorState:a,tags:l})=>{t&&0===o.size&&0===s.size||e&&l.has("history-merge")||a.isEmpty()||n(i,r,l)}))}),[r,e,t,n]),null}const C="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?i.useLayoutEffect:i.useEffect;function E({onClear:e}){const[t]=(0,o.g)();return C((()=>t.registerCommand(c.BM,(n=>(t.update((()=>{if(null==e){const e=(0,c.Gv)(),t=(0,c.dL)(),n=(0,c.BE)();e.clear(),e.append(n),null!==t&&n.select(),(0,c.OP)(t)&&(t.format=0)}else e()})),!0)),c.VN)),[t,e]),null}var I=n(37146),_=n(27901);const x=[{dependencies:[_.HY],export:e=>(0,_.fs)(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{const i=(0,_.Dq)();r||null!=e.getNextSibling()?e.replace(i):e.insertBefore(i),i.selectNext()},type:"element"},...I.XC];function P({transformers:e=x}){const[t]=(0,o.g)();return(0,i.useEffect)((()=>(0,I.AB)(t,e)),[t,e]),null}var k,B=n(65268),O=(k=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)},k&&k.__esModule&&Object.prototype.hasOwnProperty.call(k,"default")?k.default:k);function N({hasCellMerge:e=!0,hasCellBackgroundColor:t=!0,hasTabHandler:n=!0}){const[r]=(0,o.g)();return(0,i.useEffect)((()=>(r.hasNodes([B.Fh,B.Cr,B.g0])||O(10),(0,h.qV)(r.registerCommand(B.bF,(({columns:e,rows:t,includeHeaders:n})=>{const r=(0,B.uv)(Number(t),Number(e),n);(0,h.z8)(r);const i=r.getFirstDescendant();return(0,c.Gg)(i)&&i.select(),!0}),c.VN),r.registerNodeTransform(B.Fh,(e=>{const[t]=(0,B.CS)(e,null,null),n=t.reduce(((e,t)=>Math.max(e,t.length)),0);for(let e=0;e<t.length;++e){const r=t[e].length;if(r===n)continue;const i=t[e][r-1].cell;for(let e=r;e<n;++e){const e=(0,B.ku)(0);e.append((0,c.BE)()),null!==i?i.insertAfter(e):(0,h.bV)(i,e)}}}))))),[r]),(0,i.useEffect)((()=>{const e=new Map,t=t=>{const i=t.getKey(),o=r.getElementByKey(i);if(o&&!e.has(i)){const s=(0,B.rN)(t,o,r,n);e.set(i,s)}};r.getEditorState().read((()=>{const e=(0,c.K8)(B.Fh);for(const n of e)(0,B.di)(n)&&t(n)}));const i=r.registerMutationListener(B.Fh,(n=>{for(const[i,o]of n)if("created"===o)r.getEditorState().read((()=>{const e=(0,c.gI)(i);(0,B.di)(e)&&t(e)}));else if("destroyed"===o){const t=e.get(i);void 0!==t&&(t.removeListeners(),e.delete(i))}}));return()=>{i();for(const[,t]of e)t.removeListeners()}}),[r,n]),(0,i.useEffect)((()=>{if(!e)return r.registerNodeTransform(B.Cr,(e=>{if(e.getColSpan()>1||e.getRowSpan()>1){const[,,t]=(0,B.$r)(e),[n]=(0,B.kr)(t,e,e),r=n.length,i=n[0].length;let o=t.getFirstChild();(0,B.to)(o)||O(175);const s=[];for(let e=0;e<r;e++){0!==e&&(o=o.getNextSibling(),(0,B.to)(o)||O(175));let t=null;for(let r=0;r<i;r++){const i=n[e][r],a=i.cell;if(i.startRow===e&&i.startColumn===r)t=a,s.push(a);else if(a.getColSpan()>1||a.getRowSpan()>1){(0,B.TF)(a)||O(176);const e=(0,B.ku)(a.__headerState);null!==t?t.insertAfter(e):(0,h.bV)(o,e)}}}for(const e of s)e.setColSpan(1),e.setRowSpan(1)}}))}),[r,e]),(0,i.useEffect)((()=>{if(!t)return r.registerNodeTransform(B.Cr,(e=>{null!==e.getBackgroundColor()&&e.setBackgroundColor(null)}))}),[r,t,e]),null}function D(e,t){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},D(e,t)}var j={error:null},T=function(e){var t,n;function r(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).state=j,t.resetErrorBoundary=function(){for(var e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];null==t.props.onReset||(e=t.props).onReset.apply(e,r),t.reset()},t}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,D(t,n),r.getDerivedStateFromError=function(e){return{error:e}};var o=r.prototype;return o.reset=function(){this.setState(j)},o.componentDidCatch=function(e,t){var n,r;null==(n=(r=this.props).onError)||n.call(r,e,t)},o.componentDidUpdate=function(e,t){var n,r,i,o,s=this.state.error,a=this.props.resetKeys;null!==s&&null!==t.error&&(void 0===(i=e.resetKeys)&&(i=[]),void 0===(o=a)&&(o=[]),i.length!==o.length||i.some((function(e,t){return!Object.is(e,o[t])})))&&(null==(n=(r=this.props).onResetKeysChange)||n.call(r,e.resetKeys,a),this.reset())},o.render=function(){var e=this.state.error,t=this.props,n=t.fallbackRender,r=t.FallbackComponent,o=t.fallback;if(null!==e){var s={error:e,resetErrorBoundary:this.resetErrorBoundary};if(i.isValidElement(o))return o;if("function"==typeof n)return n(s);if(r)return i.createElement(r,s);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},r}(i.Component);function M({children:e,onError:t}){return(0,r.jsx)(T,{fallback:(0,r.jsx)("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:t,children:e})}var F=n(31537);const R=new RegExp(function(){const{alpha:e,alphanumeric:t,hashChars:n}=function(){const e=String.fromCharCode,t="A-Za-zªµºÀ-ÖØ-öø-Ɂɐ-ˁˆ-ˑˠ-ˤˮͺΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϵϷ-ҁҊ-ӎӐ-ӹԀ-ԏԱ-Ֆՙա-ևא-תװ-ײء-غـ-يٮ-ٯٱ-ۓەۥ-ۦۮ-ۯۺ-ۼۿܐܒ-ܯݍ-ݭހ-ޥޱऄ-हऽॐक़-ॡॽঅ-ঌএ-ঐও-নপ-রলশ-হঽৎড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽૐૠ-ૡଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽଡ଼-ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡඅ-ඖක-නඳ-රලව-ෆก-ะา-ำเ-ๆກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆໜ-ໝༀཀ-ཇཉ-ཪྈ-ྋက-အဣ-ဧဩ-ဪၐ-ၕႠ-Ⴥა-ჺჼᄀ-ᅙᅟ-ᆢᆨ-ᇹሀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙶᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦩᧁ-ᧇᨀ-ᨖᴀ-ᶿḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₔℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℱℳ-ℹℼ-ℿⅅ-ⅉⰀ-Ⱞⰰ-ⱞⲀ-ⳤⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〆〱-〵〻-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄬㄱ-ㆎㆠ-ㆷㇰ-ㇿ㐀-䶵一-龻ꀀ-ꒌꠀ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢ가-힣豈-鶴侮-頻並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ̀-ͯ҃-֑҆-ֹֻ-ֽֿׁ-ׂׄ-ׇׅؐ-ًؕ-ٰٞۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ްँ-ः़ा-्॑-॔ॢ-ॣঁ-ঃ়া-ৄে-ৈো-্ৗৢ-ৣਁ-ਃ਼ਾ-ੂੇ-ੈੋ-੍ੰ-ੱઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣଁ-ଃ଼ା-ୃେ-ୈୋ-୍ୖ-ୗஂா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕ-ౖಂ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕ-ೖം-ഃാ-ൃെ-ൈൊ-്ൗං-ඃ්ා-ුූෘ-ෟෲ-ෳัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-༹༙༵༷༾-༿ཱ-྄྆-྇ྐ-ྗྙ-ྼ࿆ာ-ဲံ-္ၖ-ၙ፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳា-៓៝᠋-᠍ᢩᤠ-ᤫᤰ-᤻ᦰ-ᧀᧈ-ᧉᨗ-ᨛ᷀-᷃⃐-⃥⃜⃡-⃫〪-゙〯-゚ꠂ꠆ꠋꠣ-ꠧﬞ︀-️︠-︣À-ÖØ-öø-ÿĀ-ɏɓ-ɔɖ-ɗəɛɣɨɯɲʉʋʻ̀-ͯḀ-ỿЀ-ӿԀ-ԧⷠ-ⷿꙀ-֑ꚟ-ֿׁ-ׂׄ-ׇׅא-תװ-״﬒-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﭏؐ-ؚؠ-ٟٮ-ۓە-ۜ۞-۪ۨ-ۯۺ-ۼۿݐ-ݿࢠࢢ-ࢬࣤ-ࣾﭐ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼ‌-‌ก-ฺเ-๎ᄀ-ᇿ㄰-ㆅꥠ-꥿가-힯ힰ-퟿ᄀ-ᅵァ-ヺー-ヾヲ-゚0-9A-Za-zぁ-ゖ゙-ゞ㐀-䶿一-鿿"+e(173824)+"-"+e(177983)+e(177984)+"-"+e(178207)+e(194560)+"-"+e(195103)+"〃々〻";return{alpha:t,alphanumeric:t+"0-9٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉០-៩᠐-᠙᥆-᥏᧐-᧙0-9_",hashChars:"#\\uFF03"}}(),r="["+t+"]";return"(^|$|[^&/"+t+"])(["+n+"])("+r+"*["+e+"]"+r+"*)"}(),"i");function L(){const[e]=(0,o.g)();(0,i.useEffect)((()=>{if(!e.hasNodes([F.DT]))throw new Error("HashtagPlugin: HashtagNode not registered on editor")}),[e]);const t=(0,i.useCallback)((e=>(0,F.Vu)(e.getTextContent())),[]),n=(0,i.useCallback)((e=>{const t=R.exec(e);if(null===t)return null;const n=t[3].length+1,r=t.index+t[1].length;return{end:r+n,start:r}}),[]);return function(e,t,n){const[r]=(0,o.g)();(0,i.useEffect)((()=>(0,h.qV)(...function(e,t,n,r){const i=e=>e instanceof n,o=e=>{const t=(0,c.MX)(e.getTextContent());t.setFormat(e.getFormat()),e.replace(t)};return[e.registerNodeTransform(c.R2,(e=>{if(!e.isSimpleText())return;let n,s=e.getPreviousSibling(),a=e.getTextContent(),l=e;if((0,c.Gg)(s)){const n=s.getTextContent(),r=t(n+a);if(i(s)){if(null===r||0!==(e=>e.getLatest().__mode)(s))return void o(s);{const t=r.end-n.length;if(t>0){const r=n+a.slice(0,t);if(s.select(),s.setTextContent(r),t===a.length)e.remove();else{const n=a.slice(t);e.setTextContent(n)}return}}}else if(null===r||r.start<n.length)return}let u=0;for(;;){n=t(a);let e,h=null===n?"":a.slice(n.end);if(a=h,""===h){const e=l.getNextSibling();if((0,c.Gg)(e)){h=l.getTextContent()+e.getTextContent();const n=t(h);if(null===n)return void(i(e)?o(e):e.markDirty());if(0!==n.start)return}}if(null===n)return;if(0===n.start&&(0,c.Gg)(s)&&s.isTextEntity()){u+=n.end;continue}0===n.start?[e,l]=l.splitText(n.end):[,e,l]=l.splitText(n.start+u,n.end+u),void 0===e&&d(165,"nodeToReplace");const p=r(e);if(p.setFormat(e.getFormat()),e.replace(p),null==l)return;u=0,s=p}})),e.registerNodeTransform(n,(e=>{const n=e.getTextContent(),r=t(n);if(null===r||0!==r.start)return void o(e);if(n.length>r.end)return void e.splitText(r.end);const s=e.getPreviousSibling();(0,c.Gg)(s)&&s.isTextEntity()&&(o(s),o(e));const a=e.getNextSibling();(0,c.Gg)(a)&&a.isTextEntity()&&(o(a),i(e)&&o(e))}))]}(r,e,t,n))),[n,r,e,t])}(n,F.DT,t),null}const Q=0,U=1,V=2,K=0,H=1,G=2,Y=3,z=4;function Z(e,t,n,r,i){if(null===e||0===n.size&&0===r.size&&!i)return K;const o=t._selection,s=e._selection;if(i)return H;if(!((0,c.OP)(o)&&(0,c.OP)(s)&&s.isCollapsed()&&o.isCollapsed()))return K;const a=function(e,t,n){const r=e._nodeMap,i=[];for(const e of t){const t=r.get(e);void 0!==t&&i.push(t)}for(const[e,t]of n){if(!t)continue;const n=r.get(e);void 0===n||(0,c.wd)(n)||i.push(n)}return i}(t,n,r);if(0===a.length)return K;if(a.length>1){const n=t._nodeMap,r=n.get(o.anchor.key),i=n.get(s.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&(0,c.Gg)(r)&&1===r.__text.length&&1===o.anchor.offset?G:K}const l=a[0],u=e._nodeMap.get(l.__key);if(!(0,c.Gg)(u)||!(0,c.Gg)(l)||u.__mode!==l.__mode)return K;const d=u.__text,h=l.__text;if(d===h)return K;const p=o.anchor,f=s.anchor;if(p.key!==f.key||"text"!==p.type)return K;const g=p.offset,m=f.offset,y=h.length-d.length;return 1===y&&m===g-1?G:-1===y&&m===g+1?Y:-1===y&&m===g?z:K}function W(e,t){let n=Date.now(),r=K;return(i,o,s,a,l,u)=>{const d=Date.now();if(u.has("historic"))return r=K,n=d,V;const h=Z(i,o,a,l,e.isComposing()),p=(()=>{const p=null===s||s.editor===e,f=u.has("history-push");if(!f&&p&&u.has("history-merge"))return Q;if(null===i)return U;const g=o._selection;return a.size>0||l.size>0?!1===f&&h!==K&&h===r&&d<n+t&&p||1===a.size&&function(e,t,n){const r=t._nodeMap.get(e),i=n._nodeMap.get(e),o=t._selection,s=n._selection;let a=!1;return(0,c.OP)(o)&&(0,c.OP)(s)&&(a="element"===o.anchor.type&&"element"===o.focus.type&&"text"===s.anchor.type&&"text"===s.focus.type),!(a||!(0,c.Gg)(r)||!(0,c.Gg)(i))&&r.__type===i.__type&&r.__text===i.__text&&r.__mode===i.__mode&&r.__detail===i.__detail&&r.__style===i.__style&&r.__format===i.__format&&r.__parent===i.__parent}(Array.from(a)[0],i,o)?Q:U:null!==g?Q:V})();return n=d,r=h,p}}function q(e){e.undoStack=[],e.redoStack=[],e.current=null}function J({externalHistoryState:e}){const[t]=(0,o.g)();return function(e,t,n=1e3){const r=(0,i.useMemo)((()=>t||{current:null,redoStack:[],undoStack:[]}),[t]);(0,i.useEffect)((()=>function(e,t,n){const r=W(e,n),i=(0,h.qV)(e.registerCommand(c.$l,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==r.length){const i=t.current,o=r.pop();null!==i&&(n.push(i),e.dispatchCommand(c.r0,!0)),0===r.length&&e.dispatchCommand(c.yn,!1),t.current=o||null,o&&o.editor.setEditorState(o.editorState,{tag:"historic"})}}(e,t),!0)),c.VN),e.registerCommand(c.zq,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==n.length){const i=t.current;null!==i&&(r.push(i),e.dispatchCommand(c.yn,!0));const o=n.pop();0===n.length&&e.dispatchCommand(c.r0,!1),t.current=o||null,o&&o.editor.setEditorState(o.editorState,{tag:"historic"})}}(e,t),!0)),c.VN),e.registerCommand(c.BM,(()=>(q(t),!1)),c.VN),e.registerCommand(c.Nr,(()=>(q(t),e.dispatchCommand(c.r0,!1),e.dispatchCommand(c.yn,!1),!0)),c.VN),e.registerUpdateListener((({editorState:n,prevEditorState:i,dirtyLeaves:o,dirtyElements:s,tags:a})=>{const l=t.current,u=t.redoStack,d=t.undoStack,h=null===l?null:l.editorState;if(null!==l&&n===h)return;const p=r(i,n,l,o,s,a);if(p===U)0!==u.length&&(t.redoStack=[],e.dispatchCommand(c.r0,!1)),null!==l&&(d.push({...l}),e.dispatchCommand(c.yn,!0));else if(p===V)return;t.current={editor:e,editorState:n}})));return i}(e,r,n)),[n,e,r])}(t,e),null}var X=n(93261);function $({validateUrl:e}){const[t]=(0,o.g)();return(0,i.useEffect)((()=>{if(!t.hasNodes([X.GR]))throw new Error("LinkPlugin: LinkNode not registered on editor");return(0,h.qV)(t.registerCommand(X.k0,(t=>{if(null===t)return(0,X.Rf)(t),!0;if("string"==typeof t)return!(void 0!==e&&!e(t)||((0,X.Rf)(t),0));{const{url:e,target:n,rel:r,title:i}=t;return(0,X.Rf)(e,{rel:r,target:n,title:i}),!0}}),c.KB),void 0!==e?t.registerCommand(c.A1,(n=>{const r=(0,c.dL)();if(!(0,c.OP)(r)||r.isCollapsed()||!(0,h.nh)(n,ClipboardEvent))return!1;const i=n;if(null===i.clipboardData)return!1;const o=i.clipboardData.getData("text");return!!e(o)&&!r.getNodes().some((e=>(0,c.F7)(e)))&&(t.dispatchCommand(X.k0,o),n.preventDefault(),!0)}),c.KB):()=>{})}),[t,e]),null}var ee=n(22311);function te(){const[e]=(0,o.g)();return(0,i.useEffect)((()=>{if(!e.hasNodes([ee.EG,ee.NK]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")}),[e]),t=e,(0,i.useEffect)((()=>(0,h.qV)(t.registerCommand(ee.B3,(()=>((0,ee.up)(t,"number"),!0)),c.KB),t.registerCommand(ee.A3,(()=>((0,ee.up)(t,"bullet"),!0)),c.KB),t.registerCommand(ee.GS,(()=>((0,ee.J_)(t),!0)),c.KB),t.registerCommand(c.K0,(()=>!!(0,ee.sp)()),c.KB))),[t]),null;var t}function ne(){const[e]=(0,o.g)();return(0,i.useEffect)((()=>e.registerCommand(_.qL,(e=>{const t=(0,c.dL)();if(!(0,c.OP)(t))return!1;if(null!==t.focus.getNode()){const e=(0,_.Dq)();t.focus.getNode().getTopLevelElementOrThrow().insertBefore(e)}return!0}),c.VN)),[e]),null}var re=n(79014),ie=n(93559),oe=n(26786),se=n(25207),ae=n(2577);function le(e){return e instanceof HTMLElement}class ce{constructor(e,t){this._x=e,this._y=t}get x(){return this._x}get y(){return this._y}equals(e){let{x:t,y:n}=e;return this.x===t&&this.y===n}calcDeltaXTo(e){let{x:t}=e;return this.x-t}calcDeltaYTo(e){let{y:t}=e;return this.y-t}calcHorizontalDistanceTo(e){return Math.abs(this.calcDeltaXTo(e))}calcVerticalDistance(e){return Math.abs(this.calcDeltaYTo(e))}calcDistanceTo(e){return Math.sqrt(Math.pow(this.calcDeltaXTo(e),2)+Math.pow(this.calcDeltaYTo(e),2))}}class ue{constructor(e,t,n,r){const[i,o]=t<=r?[t,r]:[r,t],[s,a]=e<=n?[e,n]:[n,e];this._top=i,this._right=a,this._left=s,this._bottom=o}get top(){return this._top}get right(){return this._right}get bottom(){return this._bottom}get left(){return this._left}get width(){return Math.abs(this._left-this._right)}get height(){return Math.abs(this._bottom-this._top)}equals(e){let{top:t,left:n,bottom:r,right:i}=e;return t===this._top&&r===this._bottom&&n===this._left&&i===this._right}contains(e){if(function(e){return e instanceof ce}(e)){const{x:t,y:n}=e,r=n<this._top,i=n>this._bottom,o=t<this._left,s=t>this._right;return{reason:{isOnBottomSide:i,isOnLeftSide:o,isOnRightSide:s,isOnTopSide:r},result:!(r||i||o||s)}}{const{top:t,left:n,bottom:r,right:i}=e;return t>=this._top&&t<=this._bottom&&r>=this._top&&r<=this._bottom&&n>=this._left&&n<=this._right&&i>=this._left&&i<=this._right}}intersectsWith(e){const{left:t,top:n,width:r,height:i}=e,{left:o,top:s,width:a,height:l}=this;return(t+r>=o+a?t+r:o+a)-(t<=o?t:o)<=r+a&&(n+i>=s+l?n+i:s+l)-(n<=s?n:s)<=i+l}generateNewRect(e){let{left:t=this.left,top:n=this.top,right:r=this.right,bottom:i=this.bottom}=e;return new ue(t,n,r,i)}static fromLTRB(e,t,n,r){return new ue(e,t,n,r)}static fromLWTH(e,t,n,r){return new ue(e,n,e+t,n+r)}static fromPoints(e,t){const{y:n,x:r}=e,{y:i,x:o}=t;return ue.fromLTRB(r,n,o,i)}static fromDOM(e){const{top:t,width:n,left:r,height:i}=e.getBoundingClientRect();return ue.fromLWTH(r,n,t,i)}}const de=-2,he=2,pe="draggable-block-menu",fe="application/x-lexical-drag-block";let ge="";const me=24,ye=1,ve=-1,Ae=0;let be=1/0;function we(e,t,n){const r=e.getBoundingClientRect(),i=ue.fromDOM(t),{marginTop:o,marginBottom:s}=window.getComputedStyle(t),a=i.generateNewRect({bottom:i.bottom+parseFloat(s),left:r.left,right:r.right,top:i.top-parseFloat(o)}),l=Array.from(t.children),c=["UL","OL","LI"];if(c.includes(t.tagName))for(const t of l){if(0===t.children.length)continue;if(!c.includes(t.tagName))continue;const r=we(e,t,n);if(r.contains.result)return r}return{contains:a.contains(n),element:t}}function Se(e,t,n){const r=function(e){return e.getEditorState().read((()=>(0,c.Gv)().getChildrenKeys()))}(t);let i=null;return t.getEditorState().read((()=>{let o=0===(s=r.length)?1/0:be>=0&&be<s?be:Math.floor(s/2);var s;let a=Ae;for(;o>=0&&o<r.length;){const s=r[o],l=t.getElementByKey(s);if(null===l)break;const{contains:c,element:u}=we(e,l,n);if(c.result){i=u,be=o;break}a===Ae&&(a=c.reason.isOnTopSide?ve:c.reason.isOnBottomSide?ye:1/0),o+=a}})),i}function Ce(e,t,n,r){const i=window.getComputedStyle(t),{top:o,height:s}=t.getBoundingClientRect(),{top:a,width:l}=r.getBoundingClientRect();let c=o;n-o>s/2?c+=s+parseFloat(i.marginBottom):c-=parseFloat(i.marginTop);const u=c-a-he,d=me-de;e.style.transform="translate(".concat(d,"px, ").concat(u,"px)"),e.style.width="".concat(l-2*(me-de),"px"),e.style.opacity=".6"}function Ee(e){e&&(e.style.opacity="0")}function Ie(e){let{anchorElem:t=document.body}=e;const[n]=(0,o.g)();return function(e,t,n){const o=t.parentElement,s=(0,i.useRef)(null),a=(0,i.useRef)(null),[l,u]=(0,i.useState)(null),d=(0,i.useRef)(null);(0,i.useEffect)((()=>{function n(n){const r=n.target;if(!le(r))return void u(null);if(r.closest(".".concat(pe)))return;const i=Se(t,e,new ce(n.clientX,n.clientY));u(i)}function r(){u(null)}return null==o||o.addEventListener("mousemove",n),null==o||o.addEventListener("mouseleave",r),()=>{null==o||o.removeEventListener("mousemove",n),null==o||o.removeEventListener("mouseleave",r)}}),[o,t,e]),(0,i.useEffect)((()=>{s.current&&function(e,t,n){if(!e)return void(t.style.opacity="0");const r=e.getBoundingClientRect(),i=window.getComputedStyle(e),o=t.getBoundingClientRect(),s=n.getBoundingClientRect(),a=r.top+(parseInt(i.lineHeight,10)-o.height)/2-s.top,l=de;t.style.opacity="1",t.style.transform="translate(".concat(l,"px, ").concat(a,"px)")}(l,s.current,t)}),[t,l]);const g=(0,i.useCallback)(((e,t,n,r)=>{let i=e;const o=t.getParent(),s=e.getParent();if((0,ee.I3)(s)&&!(0,ee.I3)(o)){const t=(0,ee.FH)(s.getListType());t.append(e),i=t}const{top:a,height:l}=n.getBoundingClientRect();r-a>l/2?t.insertAfter(i):t.insertBefore(i)}),[]);return(0,i.useEffect)((()=>(0,h.qV)(e.registerCommand(c.kE,(n=>function(n){const[r]=(0,f.UW)(n);if(r)return!1;const{pageY:i,target:o}=n;if(!le(o))return!1;if(!ge)return!1;const s=Se(t,e,new ce(n.pageX,i)),l=a.current;return null!==s&&null!==l&&(Ce(l,s,i,t),n.preventDefault(),!0)}(n)),c.KB),e.registerCommand(c.mY,(()=>(Ee(a.current),ge="",!0)),c.KB),e.registerCommand(c.zD,(n=>function(n){const[r]=(0,f.UW)(n);if(r)return!1;const{target:i,dataTransfer:o,pageY:s}=n;if(!le(i))return!1;const a=(null==o?void 0:o.getData(fe))||"",l=(0,c.gI)(a);if(!l)return!1;const d=Se(t,e,new ce(n.pageX,s));if(!d)return!1;const h=(0,c.Xo)(d);return!!h&&(h===l||(g(l,h,d,n.pageY),u(null)),!0)}(n)),c.Eo))),[t,e,g]),(0,p.createPortal)((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"icon draggable-block-menu",ref:s,draggable:!0,onDragStart:function(t){const n=t.dataTransfer;if(!n||!l)return;!function(e,t){const{transform:n}=t.style;t.style.transform="translateZ(0)",e.setDragImage(t,0,0),setTimeout((()=>{t.style.transform=n}))}(n,l);let r="";e.update((()=>{const e=(0,c.Xo)(l);e&&(r=e.getKey())})),n.setData(fe,r),ge=r},onDragEnd:function(){Ee(a.current),ge=""},onTouchStart:function(){l&&e.update((()=>{const e=(0,c.Xo)(l);if(!e)return;const t=e.getKey();d.current=t}))},onTouchMove:function(n){const{pageX:r,pageY:i}=n.targetTouches[0],o=e.getRootElement();if(o){const{top:e,bottom:t}=o.getBoundingClientRect(),n=20;i-e<n?o.scrollTop-=n:t-i<n&&(o.scrollTop+=n)}const s=Se(t,e,new ce(r,i)),l=a.current;null!==s&&null!==l&&Ce(l,s,i,t)},onTouchEnd:function(n){Ee(a.current),e.update((()=>{const{pageX:r,pageY:i}=n.changedTouches[0],o=d.current||"",s=(0,c.gI)(o);if(!s)return;const a=Se(t,e,new ce(r,i));if(!a)return;const l=(0,c.Xo)(a);l&&l!==s&&g(s,l,a,i)})),u(null)},children:(0,r.jsx)("div",{className:n?"icon":"",children:(0,r.jsx)(ae.BlockIcon,{className:"pointer-events-none text-text"})})}),(0,r.jsx)("div",{className:"draggable-block-target-line",ref:a})]}),t)}(n,t,n._editable)}var _e=n(36153);function xe(){const[e]=(0,o.g)();return(0,i.useEffect)((()=>(0,_e.dM)(e)),[e]),null}function Pe(){const[e]=(0,o.g)();return(0,i.useEffect)((()=>e.registerCommand(c.dB,(t=>{const n=(0,c.dL)();return!!(0,c.OP)(n)&&(t.preventDefault(),e.dispatchCommand(t.shiftKey?c.cz:c.PU,void 0))}),c.VN))),null}var ke=n(91031),Be=n(57140),Oe=n(87901),Ne=n(68608),De=n(82931);function je(e,t){if(!e)throw new Error("Internal Lexical error: invariant() is meant to be replaced at compile time. There is no runtime version.")}var Te=n(27055),Me=n(79021),Fe=n(20896),Re=n(37211),Le=n(51694);function Qe(e){const t=e.getShape();return{columns:t.toX-t.fromX+1,rows:t.toY-t.fromY+1}}function Ue(e){if(1!==e.getChildrenSize())return!1;const t=e.getFirstChildOrThrow();return!(!(0,c.Rl)(t)||!t.isEmpty())}function Ve(e){let{onClose:t,tableCellNode:n,cellMerge:s}=e;const[a]=(0,o.g)(),l=(0,i.useRef)(null),[u,d]=(0,i.useState)(n),[h,p]=(0,i.useState)({columns:1,rows:1}),[f,g]=(0,i.useState)(!1),[m,y]=(0,i.useState)(!1);(0,i.useEffect)((()=>a.registerMutationListener(B.Cr,(e=>{"updated"===e.get(u.getKey())&&a.getEditorState().read((()=>{d(u.getLatest())}))}))),[a,u]),(0,i.useEffect)((()=>{a.getEditorState().read((()=>{const e=(0,c.dL)();if((0,B.zO)(e)){const t=Qe(e);p(Qe(e)),g(function(e){const t=e.getNodes(),n=[];let r=null,i=null,o=0;for(let e=0;e<t.length;e++){const s=t[e];if((0,B.TF)(s)){const e=s.getParentOrThrow();if(je((0,B.to)(e)),r!==e){if(null!==i&&o!==i)return!1;null!==r&&(i=o),r=e,o=0}const t=s.__colSpan;for(let e=0;e<t;e++)void 0===n[o+e]&&(n[o+e]=0),n[o+e]+=s.__rowSpan;o+=t}}return(null===i||o===i)&&n.every((e=>e===n[0]))}(e)&&(t.columns>1||t.rows>1))}y(function(){const e=(0,c.dL)();if((0,c.OP)(e)&&!e.isCollapsed()||(0,B.zO)(e)&&!e.anchor.is(e.focus)||!(0,c.OP)(e)&&!(0,B.zO)(e))return!1;const[t]=(0,B.$r)(e.anchor);return t.__colSpan>1||t.__rowSpan>1}())}))}),[a]);const v=(0,i.useCallback)((()=>{a.update((()=>{if(u.isAttached()){const e=(0,B.Yp)(u),t=a.getElementByKey(e.getKey());if(!t)throw new Error("Expected to find tableElement in DOM");const n=(0,B.ng)(t);null!==n&&n.clearHighlight(),e.markDirty(),d(u.getLatest())}(0,c.Gv)().selectStart()}))}),[a,u]),A=(0,i.useCallback)((e=>{a.update((()=>{(0,B.EX)(e),t()}))}),[a,t]),b=(0,i.useCallback)((e=>{a.update((()=>{for(let t=0;t<h.columns;t++)(0,B.rU)(e);t()}))}),[a,t,h.columns]),w=(0,i.useCallback)((()=>{a.update((()=>{(0,B.kS)(),t()}))}),[a,t]),S=(0,i.useCallback)((()=>{a.update((()=>{(0,B.Yp)(u).remove(),v(),t()}))}),[a,u,v,t]),C=(0,i.useCallback)((()=>{a.update((()=>{(0,B.bk)(),t()}))}),[a,t]),E=(0,i.useCallback)((e=>{a.update((()=>{const n=(0,B.Yp)(u),r=(0,B.q1)(u),i=n.getChildren();if(r>=i.length||r<0)throw new Error("Expected table cell to be inside of table row.");const o=i[r];if(!(0,B.to)(o))throw new Error("Expected table row");o.getChildren().forEach((t=>{if(!(0,B.TF)(t))throw new Error("Expected table cell");void 0!==e?t.setHeaderStyles(e):t.toggleHeaderStyle(B.xo.ROW)})),v(),t()}))}),[a,u,v,t]),I=(0,i.useCallback)((e=>{a.update((()=>{const n=(0,B.Yp)(u),r=(0,B.yb)(u),i=n.getChildren();for(let t=0;t<i.length;t++){const n=i[t];if(!(0,B.to)(n))throw new Error("Expected table row");const o=n.getChildren();if(r>=o.length||r<0)throw new Error("Expected table cell to be inside of table row.");const s=o[r];if(!(0,B.TF)(s))throw new Error("Expected table cell");void 0!==e?s.setHeaderStyles(e):s.toggleHeaderStyle(B.xo.COLUMN)}v(),t()}))}),[a,u,v,t]);let _=null;s&&(f?_=(0,r.jsx)(Re.Z,{onClick:()=>{a.update((()=>{const e=(0,c.dL)();if((0,B.zO)(e)){const{columns:n,rows:r}=Qe(e),i=e.getNodes();let o=null;for(let e=0;e<i.length;e++){const t=i[e];if((0,B.TF)(t))if(null===o){let e;t.setColSpan(n).setRowSpan(r),o=t,Ue(t)&&(0,c.Rl)(e=t.getFirstChild())&&e.remove()}else(0,B.TF)(o)&&(Ue(t)||o.append(...t.getChildren()),t.remove())}null!==o&&(0===o.getChildrenSize()&&o.append((0,c.BE)()),function(e){const t=e.getLastDescendant();(0,c.Gg)(t)?t.select():(0,c.F7)(t)?t.selectEnd():null!==t&&t.selectNext()}(o)),t()}}))},children:"Merge cells"}):m&&(_=(0,r.jsx)(Re.Z,{onClick:()=>{a.update((()=>{(0,B.eb)()}))},children:"Unmerge cells"})));const x=(u.__headerState&B.xo.ROW)===B.xo.ROW,P=(u.__headerState&B.xo.COLUMN)===B.xo.COLUMN;return(0,r.jsxs)(Fe.Z,{className:"dropdown !px-0",ref:l,a11yLabel:"Table actions menu",children:[_,!!_&&(0,r.jsx)(Le.Z,{}),(0,r.jsxs)(Re.Z,{onClick:()=>A(!1),children:["Insert ",1===h.rows?"row":"".concat(h.rows," rows")," above"]}),(0,r.jsxs)(Re.Z,{onClick:()=>A(!0),children:["Insert ",1===h.rows?"row":"".concat(h.rows," rows")," below"]}),(0,r.jsx)(Le.Z,{}),(0,r.jsxs)(Re.Z,{onClick:()=>b(!1),children:["Insert ",1===h.columns?"column":"".concat(h.columns," columns")," left"]}),(0,r.jsxs)(Re.Z,{onClick:()=>b(!0),children:["Insert ",1===h.columns?"column":"".concat(h.columns," columns")," right"]}),(0,r.jsx)(Le.Z,{}),(0,r.jsx)(Re.Z,{onClick:C,children:"Delete column"}),(0,r.jsx)(Re.Z,{onClick:w,children:"Delete row"}),(0,r.jsx)(Re.Z,{onClick:S,children:"Delete table"}),(0,r.jsx)(Le.Z,{}),(0,r.jsxs)(Re.Z,{onClick:()=>{E(x?B.xo.NO_STATUS:B.xo.ROW)},children:[x?"Remove":"Add"," row header"]}),(0,r.jsxs)(Re.Z,{onClick:()=>{I(P?B.xo.NO_STATUS:B.xo.COLUMN)},children:[P?"Remove":"Add"," column header"]})]})}function Ke(e){let{anchorElem:t,cellMerge:n}=e;const[s]=(0,o.g)(),a=(0,i.useRef)(null),l=(0,i.useRef)(null),[u,d]=(0,i.useState)(!1),[h,p]=(0,i.useState)(null),f=(0,i.useCallback)((()=>{const e=a.current,t=(0,c.dL)(),n=window.getSelection(),r=document.activeElement;if(null==t||null==e)return void p(null);const i=s.getRootElement();if((0,c.OP)(t)&&null!==i&&null!==n&&i.contains(n.anchorNode)){const e=(0,B.Fk)(t.anchor.getNode());if(null==e)return void p(null);if(null==s.getElementByKey(e.getKey()))return void p(null);p(e)}else r||p(null)}),[s]);(0,i.useEffect)((()=>s.registerUpdateListener((()=>{s.getEditorState().read((()=>{f()}))}))));const g=(0,i.useCallback)((()=>{const e=a.current;if(null!=e&&null!=h){const n=s.getElementByKey(h.getKey());if(null!=n){const r=n.getBoundingClientRect(),i=e.getBoundingClientRect(),o=t.getBoundingClientRect(),s=r.top-o.top+i.height/2-2,a=r.right-i.width-8-o.left;e.style.opacity="1",e.style.transform="translate(".concat(a,"px, ").concat(s,"px)")}else e.style.opacity="0",e.style.transform="translate(-10000px, -10000px)"}}),[a,h,s,t]);(0,i.useEffect)((()=>{g()}),[g]),(0,i.useEffect)((()=>{const e=s.getRootElement(),t=()=>{s.getEditorState().read((()=>{g()})),d(!1)};return window.addEventListener("resize",t),e&&e.addEventListener("scroll",t),()=>{window.removeEventListener("resize",t),e&&e.removeEventListener("scroll",t)}}),[s,t,g]);const m=(0,i.useRef)(h);return(0,i.useEffect)((()=>{m.current!==h&&d(!1),m.current=h}),[m,h]),(0,r.jsx)("div",{className:"absolute left-0 top-0 will-change-transform",ref:a,children:null!=h&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Me.Z,{label:"Open table actions menu",icon:"chevron-down",iconProps:{size:"small"},className:"!h-6 !min-w-6 bg-default md:!h-5 md:!min-w-5",onClick:e=>{e.stopPropagation(),d(!u)},ref:l}),(0,r.jsx)(Te.Z,{open:u,title:"Table actions",className:"py-1",anchorElement:l,disableMobileFullscreenTakeover:!0,children:(0,r.jsx)(Ve,{onClose:()=>d(!1),tableCellNode:h,cellMerge:n})})]})})}function He(e){let{anchorElem:t=document.body,cellMerge:n=!1}=e;const i=l();return(0,p.createPortal)(i?(0,r.jsx)(Ke,{anchorElem:t,cellMerge:n}):null,t)}var Ge=n(47931),Ye=n(75043),ze=n(64739),Ze=n(98572),We=n(9256),qe=n(89139),Je=n(4694),Xe=n(21490),$e=n(94652),et=n(22798),tt=n(66208),nt=n(30626),rt=n(3555),it=n(29894),ot=n(84075),st=n(48518),at=n(46513),lt=n(75711),ct=n(98296),ut=n(16902),dt=n(39661),ht=n(20174),pt=n(88450);function ft(e){return[e.getKey(),e.getTextContent(),e.getTag()]}function gt(e,t,n){if(null===t)return n;const r=ft(t);let i=[];if(null===e){if(n.length>0&&n[0][0]===t.__key)return n;i=[r,...n]}else for(let o=0;o<n.length;o++){const s=n[o][0];if(i.push(n[o]),s===e.getKey()&&s!==t.getKey()){if(o+1<n.length&&n[o+1][0]===t.__key)return n;i.push(r)}}return i}function mt(e,t){const n=[];for(const r of t)r[0]!==e&&n.push(r);return n}function yt(e,t){const n=[];for(const r of t)r[0]===e.getKey()?n.push(ft(e)):n.push(r);return n}function vt(e,t,n){const r=[],i=ft(t);e||r.push(i);for(const o of n)o[0]!==t.getKey()&&(r.push(o),e&&o[0]===e.getKey()&&r.push(i));return r}function At(e){let t=(0,h._G)(e);for(;null!==t&&!(0,f.rc)(t);)t=(0,h._G)(t);return t}function bt({children:e}){const[t,n]=(0,i.useState)([]),[r]=(0,o.g)();return(0,i.useEffect)((()=>{let e=[];r.getEditorState().read((()=>{const t=(0,c.Gv)().getChildren();for(const n of t)(0,f.rc)(n)&&e.push([n.getKey(),n.getTextContent(),n.getTag()]);n(e)}));const t=r.registerUpdateListener((({editorState:t,dirtyElements:r})=>{t.read((()=>{const t=r=>{for(const i of r.getChildren())if((0,f.rc)(i)){const t=At(i);e=vt(t,i,e),n(e)}else(0,c.F7)(i)&&t(i)};(0,c.Gv)().getChildren().forEach((e=>{(0,c.F7)(e)&&r.get(e.__key)&&t(e)}))}))})),i=r.registerMutationListener(f.c2,(t=>{r.getEditorState().read((()=>{for(const[n,r]of t)if("created"===r){const t=(0,c.gI)(n);if(null!==t){const n=At(t);e=gt(n,t,e)}}else if("destroyed"===r)e=mt(n,e);else if("updated"===r){const t=(0,c.gI)(n);if(null!==t){const n=At(t);e=vt(n,t,e)}}n(e)}))})),o=r.registerMutationListener(c.R2,(t=>{r.getEditorState().read((()=>{for(const[r,i]of t)if("updated"===i){const t=(0,c.gI)(r);if(null!==t){const r=t.getParentOrThrow();(0,f.rc)(r)&&(e=yt(r,e),n(e))}}}))}));return()=>{i(),o(),t()}}),[r]),e(t,r)}var wt=n(24118),St=n(32620);function Ct(e,t){const n=e.getRangeAt(0);let r;if(e.anchorNode===t){let e=t;for(;null!=e.firstElementChild;)e=e.firstElementChild;r=e.getBoundingClientRect()}else{const e=n.getClientRects();r=function(e){const t=Math.min(...e.map((e=>e.left))),n=Math.min(...e.map((e=>e.top))),r=Math.max(...e.map((e=>e.right))),i=Math.max(...e.map((e=>e.bottom)));return new DOMRect(t,n,r-t,i-n)}(Array.from(e))}return r}var Et=n(756),It=n(32810),_t=n(72435),xt=n(38167);const Pt=e=>{let{editor:t,setIsEditingLink:n,isMobile:o,linkNode:s,linkTextNode:a}=e;var l;const[u,d]=(0,i.useState)(""),[f,g]=(0,i.useState)("");(0,i.useEffect)((()=>{t.getEditorState().read((()=>{s&&d(s.getURL()),a&&g(a.getTextContent())}))}),[t,s,a]);const m=(0,i.useRef)(null),y=(0,i.useRef)(null),v=(0,i.useRef)(),A=(0,i.useRef)(),b=(0,i.useCallback)((()=>{A.current&&cancelAnimationFrame(A.current),A.current=requestAnimationFrame((()=>{var e,n;if(o)return void(null===(e=m.current)||void 0===e||e.focus());const r=window.getSelection(),i=t.getRootElement();null!==r&&null!==i&&i.contains(r.anchorNode)&&(v.current=Ct(r,i));const s=y.current;if(!s)return void setTimeout(b);if(!i)return;if(!v.current)return;const a=s.getBoundingClientRect(),l=i.getBoundingClientRect(),c=(0,St.w)({align:"center",side:"top",anchorRect:v.current,popoverRect:a,documentRect:l,offset:12,maxHeightFunction:()=>"none"});if(c){const e=(0,xt.p)(s,c);Object.entries(e).forEach((e=>{let[t,n]=e;s.style.setProperty(t,n)})),s.style.display="block",null===(n=m.current)||void 0===n||n.focus()}}))}),[t,o]);(0,It.g)(y.current,b),(0,i.useEffect)((()=>(b(),(0,h.qV)(t.registerUpdateListener((()=>{b()})),t.registerCommand(c.oj,(e=>(b(),!1)),c.KB)))),[t,b]);const w=()=>{""!==u&&t.dispatchCommand(X.k0,(e=>(e=String(e).trim()).match(/^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi)||e.match(/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i)?e:"https://")(u)),null!==a&&""!==f&&t.update((()=>{a.setTextContent(f)}),{discrete:!0}),n(!1)};return(0,i.useEffect)((()=>{const e=y.current;if(!e)return;const t=t=>{e.contains(t.relatedTarget)||n(!1)};return e.addEventListener("focusout",t),()=>{e.removeEventListener("focusout",t)}}),[n]),(0,p.createPortal)((0,r.jsx)("div",{className:(0,it.classNames)("absolute z-dropdown-menu rounded-lg border border-border bg-contrast px-2 py-1 shadow-sm shadow-contrast",o?"bottom-12 left-1/2 w-[calc(100%_-_1rem)] -translate-x-1/2":"left-0 top-0 hidden w-auto translate-x-0 translucent-ui:border-[--popover-border-color] translucent-ui:bg-[--popover-background-color] translucent-ui:[backdrop-filter:var(--popover-backdrop-filter)]"),ref:y,children:(0,r.jsxs)("div",{className:"flex flex-col gap-2 py-1",children:[a&&(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)(Ge.Z,{type:"plain-text",className:"flex-shrink-0"}),(0,r.jsx)("input",{value:f,onChange:e=>{g(e.target.value)},onKeyDown:e=>{e.key===ot.u8.Enter?(e.preventDefault(),w()):e.key===ot.u8.Escape&&(e.preventDefault(),n(!1))},className:"flex-grow rounded-sm border border-border bg-contrast p-1 text-text sm:min-w-[20ch] translucent-ui:md:border-0"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)(Ge.Z,{type:"link",className:"flex-shrink-0"}),(0,r.jsx)("input",{ref:m,value:u,onChange:e=>{d(e.target.value)},onKeyDown:e=>{e.key===ot.u8.Enter?(e.preventDefault(),w()):e.key===ot.u8.Escape&&(e.preventDefault(),n(!1))},className:"flex-grow rounded-sm border border-border bg-contrast p-1 text-text sm:min-w-[40ch] translucent-ui:md:border-0"})]}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-1.5",children:[(0,r.jsx)(lt.Z,{showOnMobile:!0,showOnHover:!0,label:"Cancel editing",children:(0,r.jsx)(Et.Z,{onClick:()=>{n(!1),t.focus()},onMouseDown:e=>e.preventDefault(),children:"Cancel"})}),(0,r.jsx)(lt.Z,{showOnMobile:!0,showOnHover:!0,label:"Save link",children:(0,r.jsx)(Et.Z,{primary:!0,onClick:w,onMouseDown:e=>e.preventDefault(),children:"Apply"})})]})]})}),null!==(l=document.getElementById(_t.N.SuperEditor))&&void 0!==l?l:document.body)};var kt=n(38232),Bt=n(5778),Ot=n(20266);const Nt=e=>{let{isMobile:t,editor:n,linkNode:o,setIsEditingLink:s}=e;var a;const l=(0,i.useRef)(null),[u,d]=(0,i.useMemo)((()=>{let e="",t=!1;return n.getEditorState().read((()=>{e=o.getURL(),t=(0,X.Xp)(o)})),[e,t]}),[n,o]),f=(0,i.useMemo)((()=>n.getElementByKey(o.getKey())),[n,o]),g=(0,i.useRef)(),m=(0,i.useCallback)((()=>{if(t)return;const e=window.getSelection(),r=n.getRootElement();null!==e&&null!==r&&r.contains(e.anchorNode)&&(g.current=Ct(e,r));const i=l.current;if(!i)return void setTimeout(m);if(!r)return;if(!f)return;const o=i.getBoundingClientRect(),s=r.getBoundingClientRect(),a=f.getBoundingClientRect(),c=(0,St.w)({align:"center",side:"top",anchorRect:a,popoverRect:o,documentRect:s,offset:12,maxHeightFunction:()=>"none"});if(c){const e=(0,xt.p)(i,c);Object.entries(e).forEach((e=>{let[t,n]=e;i.style.setProperty(t,n)})),i.style.opacity="1"}}),[n,t,f]);return(0,It.g)(l.current,m),(0,i.useEffect)((()=>(m(),(0,h.qV)(n.registerUpdateListener((()=>{m()})),n.registerCommand(c.oj,(e=>(m(),!1)),c.KB)))),[n,m]),u?(0,p.createPortal)((0,r.jsx)("div",{className:(0,it.classNames)("absolute z-dropdown-menu rounded-lg border border-border bg-contrast px-2 py-1 shadow-sm shadow-contrast",t?"bottom-12 left-1/2 w-[calc(100%_-_1rem)] -translate-x-1/2":"left-0 top-0 w-auto translate-x-0 opacity-0 translucent-ui:border-[--popover-border-color] translucent-ui:bg-[--popover-background-color] translucent-ui:[backdrop-filter:var(--popover-backdrop-filter)]"),ref:l,children:(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsxs)("a",{className:(0,it.classNames)("mr-1 flex flex-grow items-center gap-2 overflow-hidden whitespace-nowrap underline",d&&"py-2.5"),href:u,target:"_blank",rel:"noopener noreferrer",children:[(0,r.jsx)(Ge.Z,{type:"open-in",className:"ml-1 flex-shrink-0"}),(0,r.jsx)("div",{className:"max-w-[35ch] overflow-hidden text-ellipsis",children:u})]}),(0,r.jsx)(lt.Z,{showOnMobile:!0,showOnHover:!0,label:"Copy link",children:(0,r.jsx)("button",{className:"flex select-none items-center justify-center rounded p-2 enabled:hover:bg-default disabled:opacity-50 md:border md:border-transparent enabled:hover:md:translucent-ui:border-[--popover-border-color]",onClick:()=>{navigator.clipboard.writeText(u).catch(console.error)},onMouseDown:e=>e.preventDefault(),children:(0,r.jsx)(Ge.Z,{type:"copy",size:"medium"})})}),!d&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(lt.Z,{showOnMobile:!0,showOnHover:!0,label:"Edit link",children:(0,r.jsx)("button",{className:"flex select-none items-center justify-center rounded p-2 enabled:hover:bg-default disabled:opacity-50 md:border md:border-transparent enabled:hover:md:translucent-ui:border-[--popover-border-color]",onClick:()=>{s(!0)},onMouseDown:e=>e.preventDefault(),children:(0,r.jsx)(Ge.Z,{type:"pencil-filled",size:"medium"})})}),(0,r.jsx)(lt.Z,{showOnMobile:!0,showOnHover:!0,label:"Remove link",children:(0,r.jsx)("button",{className:"flex select-none items-center justify-center rounded p-2 enabled:hover:bg-default disabled:opacity-50 md:border md:border-transparent enabled:hover:md:translucent-ui:border-[--popover-border-color]",onClick:()=>{n.dispatchCommand(X.k0,null)},onMouseDown:e=>e.preventDefault(),children:(0,r.jsx)(Ge.Z,{type:"trash-filled",size:"medium"})})})]})]})}),null!==(a=document.getElementById(_t.N.SuperEditor))&&void 0!==a?a:document.body):null};var Dt=n(65123);const jt=["name","active","iconName","children","onSelect","disabled","className"],Tt=["name","iconName","active","onClick"];function Mt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ft(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mt(Object(n),!0).forEach((function(t){Rt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Rt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lt(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}const Qt=(0,c.fA)("TOGGLE_LINK_AND_EDIT_COMMAND"),Ut={bullet:"Bulleted List",check:"Check List",code:"Code Block",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",number:"Numbered List",paragraph:"Normal",quote:"Quote"},Vt={bullet:"list-bulleted",check:"list-check",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",number:"list-numbered",paragraph:"paragraph",quote:"quote"},Kt=(0,i.forwardRef)(((e,t)=>{let{name:n,active:i,iconName:s,children:a,onSelect:l,disabled:c,className:u}=e,d=Lt(e,jt);var h,p;const[f]=(0,o.g)(),g=(0,rt.ac)(rt.Jj.sm),m=null!==(p=null===(h=f.getRootElement())||void 0===h?void 0:h.parentElement)&&void 0!==p?p:document.body;return(0,r.jsx)(lt.Z,{showOnMobile:!0,showOnHover:!0,label:n,side:"top",portal:!1,portalElement:g?m:void 0,documentElement:m,children:(0,r.jsx)(ct.E,Ft(Ft({className:(0,it.classNames)("flex select-none items-center justify-center rounded p-0.5 focus:shadow-none focus:outline-none enabled:hover:bg-default enabled:focus-visible:bg-default disabled:opacity-50 md:border md:border-transparent enabled:hover:md:translucent-ui:border-[--popover-border-color]",u),onClick:()=>{l()},onMouseDown:e=>{e.preventDefault()},onContextMenu:e=>{f.focus(),e.preventDefault()},disabled:c,ref:t},d),{},{children:(0,r.jsx)("div",{className:(0,it.classNames)("flex items-center justify-center rounded p-2 transition-colors duration-75",i&&"bg-info text-info-contrast"),children:a||(s?(0,r.jsx)(Ge.Z,{type:s,size:"custom",className:"h-4 w-4 !text-current md:h-3.5 md:w-3.5 [&>path]:!text-current"}):null)})}))})})),Ht=e=>{let{name:t,iconName:n,active:i,onClick:o}=e,s=Lt(e,Tt);return(0,r.jsxs)(Re.Z,Ft(Ft({className:(0,it.classNames)("overflow-hidden md:py-2",i?"!bg-info !text-info-contrast":"hover:bg-contrast"),onClick:o,onMouseDown:e=>e.preventDefault()},s),{},{children:[(0,r.jsx)(Ge.Z,{type:n,className:"-mt-px mr-2.5 flex-shrink-0"}),(0,r.jsx)("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:t}),i&&(0,r.jsx)(Ge.Z,{type:"check",className:"ml-auto"})]}))},Gt=()=>{var e,t,n;const s=(0,st.I)(),a=(0,rt.ac)(rt.Jj.sm),[l,u]=(0,Ye.Z)(),[d]=(0,o.g)(),[p,g]=(0,i.useState)(d),[m,y]=(0,i.useState)((()=>d.isEditable())),[v,A]=(0,i.useState)("paragraph"),[b,w]=(0,i.useState)("left"),[S,C]=(0,i.useState)(!1),[E,I]=(0,i.useState)(!1),[_,x]=(0,i.useState)(!1),[P,k]=(0,i.useState)(!1),[B,O]=(0,i.useState)(!1),[N,D]=(0,i.useState)(!1),[j,T]=(0,i.useState)(!1),[M,F]=(0,i.useState)(!1),[R,L]=(0,i.useState)(null),[Q,U]=(0,i.useState)(null),[V,K]=(0,i.useState)(!1),[H,G]=(0,i.useState)(!1),Y=(0,i.useRef)(null),[z,Z]=(0,i.useState)(!1),W=(0,i.useRef)(null),[q,J]=(0,i.useState)(!1),$=(0,i.useRef)(null),[te,ne]=(0,i.useState)(!1),re=(0,i.useRef)(null),[ie,oe]=(0,i.useState)(!1),se=(0,i.useRef)(null),[ae,le]=(0,i.useState)(!1),[ce,ue]=(0,i.useState)(!1),de=(0,i.useRef)(null),he=(0,Bt.Z)(it.PrefKey.AlwaysShowSuperToolbar),[pe,fe]=(0,i.useState)(he),ge=(0,kt.Y)(pe),me=(0,i.useCallback)((()=>{const e=(0,c.dL)();if(!(0,c.OP)(e))return;if(a)return;if(ge.current)return;const t=de.current;if(!t)return;if(""===e.getTextContent())return void t.style.removeProperty("display");const n=window.getSelection(),r=p.getRootElement();if(null!==n&&null!==r&&r.contains(n.anchorNode)){const e=Ct(n,r),i=t.getBoundingClientRect(),o=r.getBoundingClientRect(),s=(0,St.w)({align:"start",side:"top",anchorRect:e,popoverRect:i,documentRect:o,offset:8,maxHeightFunction:()=>"none"});s&&(Object.entries(s).forEach((e=>{let[n,r]=e;"transform"!==n&&t.style.setProperty(n,r)})),t.style.setProperty("display","block"))}}),[p,a,ge]),ye=(0,i.useCallback)((()=>{const e=(0,c.dL)();if(!(0,c.OP)(e))return;const t=e.anchor.getNode(),n=t===e.focus.getNode();let r="root"===t.getKey()?t:(0,h.$s)(t,(e=>{const t=e.getParent();return null!==t&&(0,c._v)(t)}));null===r&&(r=t.getTopLevelElementOrThrow());const i=r.getKey(),o=p.getElementByKey(i);C(e.hasFormat("bold")),I(e.hasFormat("italic")),x(e.hasFormat("underline")),k(e.hasFormat("strikethrough")),O(e.hasFormat("subscript")),D(e.hasFormat("superscript")),T(e.hasFormat("code")),F(e.hasFormat("highlight"));const s=function(e){const t=e.anchor,n=e.focus,r=e.anchor.getNode(),i=e.focus.getNode();return r===i?r:e.isBackward()?(0,ze.P4)(n)?r:i:(0,ze.P4)(t)?i:r}(e),a=s.getParent();if(K(!1),(0,X.Pq)(s)&&n?L(s):(0,X.Pq)(a)&&n?L(a):L(null),((e,t)=>{const n=e.getParent();return(0,X.Pq)(n)&&1===n.getChildrenSize()&&(0,c.Gg)(e)&&n.getFirstChild()===e&&t.anchor.getNode()===t.focus.getNode()})(s,e)?U(s):U(null),null!==o)if((0,ee.I3)(r)){const e=(0,h.yD)(t,ee.EG),n=e?e.getListType():r.getListType();A(n)}else{const e=(0,f.rc)(r)?r.getTag():r.getType();e in Ut&&A(e)}w(((0,c.F7)(s)?s.getFormatType():null==a?void 0:a.getFormatType())||"left"),me()}),[p,me]),ve=(0,i.useCallback)((()=>{const e=de.current;e&&(e.style.removeProperty("--translate-x"),e.style.removeProperty("--translate-y"),e.style.removeProperty("transform"),e.style.removeProperty("transform-origin"),e.style.removeProperty("opacity"))}),[]),Ae=(0,i.useCallback)((()=>{p.update((()=>{const e=(0,c.dL)();if((0,c.OP)(e)){const t=e.anchor,n=e.focus,r=e.getNodes();if(t.key===n.key&&t.offset===n.offset)return;r.forEach(((e,i)=>{if((0,c.Gg)(e)){let o=e;0===i&&0!==t.offset&&(o=o.splitText(t.offset)[1]||o),i===r.length-1&&(o=o.splitText(n.offset)[0]||o),""!==o.__style&&o.setStyle(""),0!==o.__format&&(o.setFormat(0),(0,h.f8)(o).setFormat("")),e=o}else(0,f.rc)(e)||(0,f.O)(e)?e.replace((0,c.BE)(),!0):(0,Ot.F)(e)&&e.setFormat("")}))}}))}),[p]);(0,i.useEffect)((()=>{if(a)return;const e=p.getRootElement(),t=(0,wt.Ds)((()=>{p.getEditorState().read((()=>{me()}))}),50);return window.addEventListener("resize",t),e&&e.addEventListener("scroll",t),()=>{window.removeEventListener("resize",t),e&&e.removeEventListener("scroll",t)}}),[p,a,me]),(0,i.useEffect)((()=>(0,h.qV)(d.registerEditableListener((e=>{y(e)})),d.registerCommand(c.oj,((e,t)=>(ye(),g(t),!1)),c.jw))),[d,ye]),(0,i.useEffect)((()=>(0,h.qV)(p.registerUpdateListener((e=>{let{editorState:t}=e;t.read((()=>{ye()}))})),p.registerCommand(c.yn,(e=>(le(e),!1)),c.jw),p.registerCommand(c.r0,(e=>(ue(e),!1)),c.jw),p.registerCommand(Qt,(e=>null===e?(K(!1),p.dispatchCommand(X.k0,null)):(K(!0),!0)),c.KB))),[ye,p]),(0,i.useEffect)((()=>p.registerCommand(c.yb,(e=>{const t=e,{code:n,ctrlKey:r,metaKey:i,shiftKey:o}=t;return!("KeyK"!==n||!r&&!i||o||(t.preventDefault(),"readText"in navigator.clipboard?navigator.clipboard.readText().then((e=>{if(!pt.Wh.test(e))throw new Error("Not a valid URL");p.dispatchCommand(X.k0,e)})).catch((e=>{console.error(e),p.dispatchCommand(Qt,"")})):p.dispatchCommand(Qt,""),0))}),c.u6)),[p]);const be=(0,i.useRef)(null),[we,Se]=(0,i.useState)(!1),[Ce,Ee]=(0,i.useState)(!1),Ie=we||Ce,_e=a||pe;(0,i.useEffect)((()=>{const e=de.current,t=d.getRootElement();if(!t)return;const n=()=>Ee(!0),r=()=>Ee(!1),i=()=>Se(!0),o=t=>{var n;const r=t.relatedTarget,i=null==e?void 0:e.contains(r),o=null===(n=document.getElementById(_t.N.SuperEditor))||void 0===n?void 0:n.contains(r),s=be.current===r;(!i&&!o||s)&&Se(!1)};return t.addEventListener("focus",i),t.addEventListener("blur",o),e&&(e.addEventListener("focus",n),e.addEventListener("blur",r)),()=>{t.removeEventListener("focus",i),t.removeEventListener("blur",o),null==e||e.removeEventListener("focus",n),null==e||e.removeEventListener("blur",r)}}),[d]);const xe=(0,i.useRef)(null),Pe=(0,ut.r)();(0,i.useEffect)((()=>s.keyboardService.addCommandHandler({command:ot.Qx,category:"Super notes",description:"Toggle Super note toolbar",onKeyDown(e){if(!a&&he){if(e.preventDefault(),!pe)return fe(!0),ve(),void Pe.move(Pe.first());fe(!1),d.focus()}}})),[he,s.keyboardService,ve,d,a,pe,Pe]);const ke=null!==(n=null!==(e=document.getElementById(_t.N.SuperEditor))&&void 0!==e?e:null===(t=d.getRootElement())||void 0===t?void 0:t.parentElement)&&void 0!==n?n:document.body;return(0,r.jsxs)(r.Fragment,{children:[l,(0,r.jsxs)("div",{className:(0,it.classNames)("bg-contrast",m?"":"hidden opacity-0",a&&!Ie?"hidden":"",!a&&"border-b border-border bg-default",a?"":pe?"w-full px-1 py-1":"fixed left-0 top-0 z-tooltip hidden translate-x-[--translate-x] translate-y-[--translate-y] rounded border py-0.5 translucent-ui:border-[--popover-border-color] translucent-ui:bg-[--popover-background-color] translucent-ui:[backdrop-filter:var(--popover-backdrop-filter)]"),id:"super-mobile-toolbar",ref:de,children:[R&&!V&&(0,r.jsx)(Nt,{linkNode:R,isMobile:a,setIsEditingLink:K,editor:p},R.__key),V&&(0,r.jsx)(Pt,{editor:p,setIsEditingLink:K,isMobile:a,linkNode:R,linkTextNode:Q}),(0,r.jsxs)("div",{className:"flex w-full flex-shrink-0 border-t border-border md:border-0",children:[(0,r.jsxs)(dt.o,{className:"super-toolbar flex items-center gap-1 overflow-x-auto px-1 md:flex-wrap",ref:xe,store:Pe,children:[_e&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Kt,{name:"Table of Contents",iconName:"toc",active:H,onSelect:()=>G(!H),ref:Y}),(0,r.jsx)(Kt,{name:"Search",iconName:"search",onSelect:()=>s.keyboardService.triggerCommand(ot.Ix)}),(0,r.jsx)(Kt,{name:"Undo",iconName:"undo",disabled:!ae,onSelect:()=>d.dispatchCommand(c.$l,void 0)}),(0,r.jsx)(Kt,{name:"Redo",iconName:"redo",disabled:!ce,onSelect:()=>d.dispatchCommand(c.zq,void 0)})]}),(0,r.jsxs)(Kt,{name:"Formatting options",onSelect:()=>{J(!q)},ref:$,className:q?"md:bg-default":"",children:[(0,r.jsx)(Ge.Z,{type:Vt[v],size:"custom",className:"h-4 w-4 md:h-3.5 md:w-3.5"}),(0,r.jsx)(Ge.Z,{type:"chevron-down",size:"custom",className:"ml-2 h-4 w-4 md:h-3.5 md:w-3.5"})]}),(0,r.jsx)(Kt,{name:"Bold",iconName:"bold",active:S,onSelect:()=>d.dispatchCommand(c.Ew,"bold")}),(0,r.jsx)(Kt,{name:"Italic",iconName:"italic",active:E,onSelect:()=>d.dispatchCommand(c.Ew,"italic")}),(0,r.jsx)(Kt,{name:"Underline",iconName:"underline",active:_,onSelect:()=>d.dispatchCommand(c.Ew,"underline")}),(0,r.jsx)(Kt,{name:"Link",iconName:"link",active:!!R,onSelect:()=>{d.dispatchCommand(Qt,"")}}),(0,r.jsx)(Kt,{name:"Inline Code",iconName:"code-tags",active:j,onSelect:()=>d.dispatchCommand(c.Ew,"code")}),(0,r.jsxs)(Kt,{name:"Text style",onSelect:()=>{Z(!z)},ref:W,className:z?"md:bg-default":"",children:[(0,r.jsx)(Ge.Z,{type:"text",size:"custom",className:"h-4 w-4 md:h-3.5 md:w-3.5"}),(0,r.jsx)(Ge.Z,{type:"chevron-down",size:"custom",className:"ml-1 h-4 w-4 md:h-3.5 md:w-3.5"})]}),(0,r.jsxs)(Kt,{name:"Alignment",onSelect:()=>{ne(!te)},ref:re,className:te?"md:bg-default":"",children:[(0,r.jsx)(Ge.Z,{type:"align-left",size:"custom",className:"h-4 w-4 md:h-3.5 md:w-3.5"}),(0,r.jsx)(Ge.Z,{type:"chevron-down",size:"custom",className:"ml-2 h-4 w-4 md:h-3.5 md:w-3.5"})]}),(0,r.jsx)(Kt,{name:et.b.name,iconName:et.b.iconName,onSelect:()=>et.b.onSelect(d)}),(0,r.jsx)(Kt,{name:et.Cc.name,iconName:et.Cc.iconName,onSelect:()=>et.Cc.onSelect(d)}),_e&&(0,r.jsxs)(Kt,{name:"Insert",onSelect:()=>{oe(!ie)},ref:se,className:ie?"md:bg-default":"",children:[(0,r.jsx)(Ge.Z,{type:"add",size:"custom",className:"h-4 w-4 md:h-3.5 md:w-3.5"}),(0,r.jsx)(Ge.Z,{type:"chevron-down",size:"custom",className:"ml-2 h-4 w-4 md:h-3.5 md:w-3.5"})]})]}),a&&(0,r.jsx)("button",{className:"flex flex-shrink-0 items-center justify-center rounded border-l border-border px-3 py-3","aria-label":"Dismiss keyboard",ref:be,children:(0,r.jsx)(Ge.Z,{type:"keyboard-close",size:"medium"})})]})]}),(0,r.jsxs)(Te.Z,{title:"Table of contents",anchorElement:Y,open:H,togglePopover:()=>G(!H),side:a?"top":"bottom",align:"start",className:"py-1",disableMobileFullscreenTakeover:!0,disableFlip:!0,disableApplyingMobileWidth:!0,portal:!1,documentElement:ke,children:[(0,r.jsx)("div",{className:"mb-1.5 mt-1 px-3 text-sm font-semibold uppercase text-text",children:"Table of Contents"}),(0,r.jsx)(bt,{children:e=>e.length?(0,r.jsx)(Fe.Z,{a11yLabel:"Table of contents",className:"!px-0",children:e.map((e=>{let[t,n,i]=e;const o=parseInt(i.slice(1))||1;return o>3?null:(0,r.jsxs)(Re.Z,{className:"overflow-hidden md:py-2",onClick:()=>{G(!1),d.update((()=>{const e=(0,c.gI)(t);if(!e)return;e.selectEnd(),d.focus();const n=d.getElementByKey(t);n&&setTimeout((()=>{n.scrollIntoView({behavior:"smooth",block:"start"})}),1)}))},onMouseDown:e=>e.preventDefault(),style:{paddingLeft:"".concat((o-1)*(0,wt.cv)(1)+(0,wt.cv)(.75),"px")},children:[(0,r.jsx)(Ge.Z,{type:i,className:"-mt-px mr-2.5 flex-shrink-0"}),(0,r.jsx)("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:n})]},t)}))}):(0,r.jsx)("div",{className:"py-2 text-center",children:"No headings found"})})]}),(0,r.jsx)(Te.Z,{title:"Text formatting options",anchorElement:W,open:z,togglePopover:()=>Z(!z),side:a?"top":"bottom",align:"start",className:"py-1",disableMobileFullscreenTakeover:!0,disableFlip:!0,containerClassName:"md:!min-w-60 md:!w-auto",portal:!1,documentElement:ke,children:(0,r.jsxs)(Fe.Z,{a11yLabel:"Text formatting options",className:"!px-0",onClick:()=>Z(!1),children:[(0,r.jsx)(Ht,{name:"Highlight",iconName:"draw",active:M,onClick:()=>d.dispatchCommand(c.Ew,"highlight")}),(0,r.jsx)(Ht,{name:"Strikethrough",iconName:"strikethrough",active:P,onClick:()=>d.dispatchCommand(c.Ew,"strikethrough")}),(0,r.jsx)(Ht,{name:"Subscript",iconName:"subscript",active:B,onClick:()=>d.dispatchCommand(c.Ew,"subscript")}),(0,r.jsx)(Ht,{name:"Superscript",iconName:"superscript",active:N,onClick:()=>d.dispatchCommand(c.Ew,"superscript")}),(0,r.jsx)(Ht,{name:"Clear formatting",iconName:"trash",onClick:Ae})]})}),(0,r.jsx)(Te.Z,{title:"Block style",anchorElement:$,open:q,togglePopover:()=>J(!q),side:a?"top":"bottom",align:"start",className:"py-1",disableMobileFullscreenTakeover:!0,disableFlip:!0,containerClassName:"md:!min-w-60 md:!w-auto",portal:!1,documentElement:ke,children:(0,r.jsxs)(Fe.Z,{a11yLabel:"Block style",className:"!px-0",onClick:()=>J(!1),children:[(0,r.jsx)(Ht,{name:"Normal",iconName:"paragraph",active:"paragraph"===v,onClick:()=>tt.O.onSelect(d)}),(0,r.jsx)(Ht,{name:"Heading 1",iconName:"h1",active:"h1"===v,onClick:()=>$e.SH.onSelect(d)}),(0,r.jsx)(Ht,{name:"Heading 2",iconName:"h2",active:"h2"===v,onClick:()=>$e.p2.onSelect(d)}),(0,r.jsx)(Ht,{name:"Heading 3",iconName:"h3",active:"h3"===v,onClick:()=>$e.M8.onSelect(d)}),(0,r.jsx)(Le.Z,{}),(0,r.jsx)(Ht,{name:"Bulleted List",iconName:"list-bulleted",active:"bullet"===v,onClick:()=>We.Vb.onSelect(d)}),(0,r.jsx)(Ht,{name:"Numbered List",iconName:"list-numbered",active:"number"===v,onClick:()=>We.Ee.onSelect(d)}),(0,r.jsx)(Ht,{name:"Check List",iconName:"list-check",active:"check"===v,onClick:()=>We.vE.onSelect(d)}),(0,r.jsx)(Le.Z,{}),(0,r.jsx)(Ht,{name:"Quote",iconName:"quote",active:"quote"===v,onClick:()=>nt.V.onSelect(d)}),(0,r.jsx)(Ht,{name:"Code Block",iconName:"code",active:"code"===v,onClick:()=>qe.d.onSelect(d)})]})}),(0,r.jsx)(Te.Z,{title:"Alignment",anchorElement:re,open:te,togglePopover:()=>ne(!te),side:a?"top":"bottom",align:"start",className:"py-1",disableMobileFullscreenTakeover:!0,disableFlip:!0,containerClassName:"md:!min-w-60 md:!w-auto",portal:!1,documentElement:ke,children:(0,r.jsxs)(Fe.Z,{a11yLabel:"Alignment",className:"!px-0",onClick:()=>ne(!1),children:[(0,r.jsx)(Ht,{name:"Left align",iconName:"align-left",active:"left"===b,onClick:()=>Ze.vn.onSelect(d)}),(0,r.jsx)(Ht,{name:"Center align",iconName:"align-center",active:"center"===b,onClick:()=>Ze.QK.onSelect(d)}),(0,r.jsx)(Ht,{name:"Right align",iconName:"align-right",active:"right"===b,onClick:()=>Ze.zN.onSelect(d)}),(0,r.jsx)(Ht,{name:"Justify",iconName:"align-justify",active:"justify"===b,onClick:()=>Ze.Cj.onSelect(d)})]})}),(0,r.jsx)(Te.Z,{title:"Insert",anchorElement:se,open:ie,togglePopover:()=>oe(!ie),side:a?"top":"bottom",align:"start",className:"py-1",disableMobileFullscreenTakeover:!0,disableFlip:!0,containerClassName:"md:!min-w-60 md:!w-auto",portal:!1,documentElement:ke,children:(0,r.jsxs)(Fe.Z,{a11yLabel:"Insert",className:"!px-0",onClick:()=>oe(!1),children:[(0,r.jsx)(Ht,{name:"Table",iconName:"table",onClick:()=>u("Insert Table",(e=>(0,r.jsx)(De.n,{activeEditor:d,onClose:e})))}),(0,r.jsx)(Ht,{name:"Upload file",iconName:"file",onClick:()=>p.dispatchCommand(Dt.J,void 0)}),(0,r.jsx)(Ht,{name:"Image from URL",iconName:"image",onClick:()=>u("Insert image from URL",(e=>(0,r.jsx)(at.a,{onClose:e})))}),(0,r.jsx)(Ht,{name:Xe.j.name,iconName:Xe.j.iconName,onClick:()=>Xe.j.onSelect(d)}),(0,r.jsx)(Ht,{name:Je.J.name,iconName:Je.J.iconName,onClick:()=>Je.J.onSelect(d)}),(0,r.jsx)(Ht,{name:ht.SC.name,iconName:ht.SC.iconName,onClick:()=>ht.SC.onSelect(d)})]})})]})};var Yt=n(37658);const zt=function(){const e=[];for(const[t,n]of Object.entries(_e.Wq))e.push([t,n]);return e}(),Zt=()=>{const[e]=(0,o.g)(),[t,n]=(0,i.useState)(!1),[s,a]=(0,i.useState)(""),[l,u]=(0,i.useState)(null),d=(0,i.useCallback)((()=>{if(!e.isEditable())return void n(!1);const t=(0,c.dL)();if(!(0,c.OP)(t))return;const r=t.anchor.getNode();let i="root"===r.getKey()?r:(0,h.$s)(r,(e=>{const t=e.getParent();return null!==t&&(0,c._v)(t)}));null===i&&(i=r.getTopLevelElementOrThrow());const o=i.getKey();if(null!==e.getElementByKey(o))if(u(o),(0,_e.Pe)(i)){n(!0);const e=i.getLanguage();a(e?_e.md[e]||e:"")}else n(!1)}),[e]);(0,i.useEffect)((()=>(0,h.qV)(e.registerUpdateListener((e=>{let{editorState:t}=e;t.read((()=>{d()}))})))),[e,d]);const p=(0,i.useCallback)((t=>{e.update((()=>{if(null!==l){const e=(0,c.gI)(l);(0,_e.Pe)(e)&&e.setLanguage(t)}}))}),[e,l]);return t?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:"absolute right-6 top-13 rounded border border-border bg-default p-2",children:(0,r.jsx)(Yt.Z,{label:"Change code block language",items:zt.map((e=>{let[t,n]=e;return{label:n,value:t}})),value:(0,_e.r0)(s),onChange:e=>{p(e)}})})}):null};function Wt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wt(Object(n),!0).forEach((function(t){Jt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Jt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Xt=(0,i.createContext)(void 0),$t=()=>{const e=(0,i.useContext)(Xt);if(!e)throw new Error("useSuperSearchContext must be used within a SuperSearchContextProvider");return e},en={query:"",results:[],currentResultIndex:-1,isCaseSensitive:!1,isSearchActive:!1,isReplaceMode:!1},tn=(e,t)=>{switch(t.type){case"set-query":return qt(qt({},e),{},{query:t.query});case"set-results":return qt(qt({},e),{},{results:t.results,currentResultIndex:t.results.length>0?0:-1});case"clear-results":return qt(qt({},e),{},{results:[],currentResultIndex:-1});case"set-current-result-index":return qt(qt({},e),{},{currentResultIndex:t.index});case"toggle-search":return qt(qt({},en),{},{isSearchActive:!e.isSearchActive});case"toggle-case-sensitive":return qt(qt({},e),{},{isCaseSensitive:!e.isCaseSensitive});case"toggle-replace-mode":{const t=!e.isReplaceMode;return qt(qt({},e),{},{isSearchActive:!(!t||e.isSearchActive)||e.isSearchActive,isReplaceMode:t})}case"go-to-next-result":return qt(qt({},e),{},{currentResultIndex:e.results.length<1?-1:e.currentResultIndex+1<e.results.length?e.currentResultIndex+1:0});case"go-to-previous-result":return qt(qt({},e),{},{currentResultIndex:e.results.length<1?-1:e.currentResultIndex-1>=0?e.currentResultIndex-1:e.results.length-1});case"reset-search":return qt({},en)}},nn=e=>{let{children:t}=e;const[n,o]=(0,i.useReducer)(tn,en),s=(0,i.useRef)(new Set),a=(0,i.useCallback)((e=>(s.current.add(e),()=>{s.current.delete(e)})),[]),l=(0,i.useCallback)((e=>{s.current.forEach((t=>t(e)))}),[]),c=(0,i.useMemo)((()=>qt(qt({},n),{},{dispatch:o,addReplaceEventListener:a,dispatchReplaceEvent:l})),[a,l,n]);return(0,r.jsx)(Xt.Provider,{value:c,children:t})};var rn=n(44783),on=n(13959);const sn={keyframes:[{opacity:0,transform:"translateY(-100%)"},{opacity:1,transform:"translateY(0)"}],options:{easing:"ease-in-out",duration:150,fill:"forwards"},initialStyle:{transformOrigin:"top"}},an={keyframes:[{opacity:1,transform:"translateY(0)"},{opacity:0,transform:"translateY(-100%)"}],options:{easing:"ease-in-out",duration:150,fill:"forwards"},initialStyle:{transformOrigin:"top"}};var ln=n(64503);const cn=e=>{let{open:t,closeDialog:n}=e;const[s]=(0,o.g)(),{query:a,results:l,currentResultIndex:c,isCaseSensitive:u,isReplaceMode:d,dispatch:h,dispatchReplaceEvent:p}=$t(),[f,g]=(0,i.useState)(""),m=(0,i.useCallback)((e=>{e&&e.focus()}),[]),[y,v]=(0,ln.r)({open:t,enter:sn,exit:an}),A=(0,rn.o)(),b=(0,i.useMemo)((()=>(0,ot.Ld)(A.keyboardShortcutForCommand(ot.Ix))),[A]),w=(0,i.useMemo)((()=>(0,ot.Ld)(A.keyboardShortcutForCommand(ot.p6))),[A]),S=(0,i.useMemo)((()=>(0,ot.Ld)(A.keyboardShortcutForCommand(ot.zI))),[A]);return y?(0,r.jsxs)("div",{className:(0,Oe.classNames)("absolute left-2 right-6 top-2 z-10 flex select-none rounded border border-border bg-default md:left-auto",s.isEditable()?"md:top-13":"md:top-3"),ref:v,children:[s.isEditable()&&(0,r.jsx)("button",{className:"focus:ring-none border-r border-border px-1 hover:bg-contrast focus:shadow-inner focus:shadow-info",onClick:()=>{h({type:"toggle-replace-mode"})},title:"Toggle Replace Mode (".concat(w,")"),children:d?(0,r.jsx)(ae.ArrowDownIcon,{className:"h-4 w-4 fill-text"}):(0,r.jsx)(ae.ArrowRightIcon,{className:"h-4 w-4 fill-text"})}),(0,r.jsxs)("div",{className:"flex flex-col gap-2 px-2 py-2",onKeyDown:e=>{e.key===ot.u8.Escape&&n()},children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(on.Z,{placeholder:"Search",className:{container:(0,Oe.classNames)("flex-grow !text-[length:inherit]",!a.length&&"!py-1"),right:"!py-1"},value:a,onChange:e=>{h({type:"set-query",query:e})},onKeyDown:e=>{if("Enter"===e.key&&l.length){if(e.shiftKey)return void h({type:"go-to-previous-result"});h({type:"go-to-next-result"})}},ref:m,right:[(0,r.jsx)("div",{className:"min-w-[7ch] max-w-[7ch] flex-shrink-0 whitespace-nowrap text-right",children:a.length>0&&(0,r.jsxs)(r.Fragment,{children:[c>-1?c+1+" / ":null,l.length]})})]}),(0,r.jsxs)("label",{className:(0,Oe.classNames)("relative flex items-center rounded border px-1.5 py-1 focus-within:ring-2 focus-within:ring-info focus-within:ring-offset-2 focus-within:ring-offset-default",u?"border-info bg-info text-info-contrast":"border-border hover:bg-contrast"),title:"Case sensitive (".concat(S,")"),children:[(0,r.jsx)("input",{type:"checkbox",className:"absolute left-0 top-0 z-[1] m-0 h-full w-full cursor-pointer border border-transparent p-0 opacity-0 shadow-none outline-none",checked:u,onChange:()=>{h({type:"toggle-case-sensitive"})}}),(0,r.jsx)("span",{"aria-hidden":!0,children:"Aa"}),(0,r.jsx)("span",{className:"sr-only",children:"Case sensitive"})]}),(0,r.jsx)("button",{className:"flex items-center rounded border border-border p-1.5 hover:bg-contrast disabled:cursor-not-allowed",onClick:()=>{h({type:"go-to-previous-result"})},disabled:l.length<1,title:"Previous result (Shift + Enter)",children:(0,r.jsx)(ae.ArrowUpIcon,{className:"h-4 w-4 fill-current text-text"})}),(0,r.jsx)("button",{className:"flex items-center rounded border border-border p-1.5 hover:bg-contrast disabled:cursor-not-allowed",onClick:()=>{h({type:"go-to-next-result"})},disabled:l.length<1,title:"Next result (Enter)",children:(0,r.jsx)(ae.ArrowDownIcon,{className:"h-4 w-4 fill-current text-text"})}),(0,r.jsx)("button",{className:"flex items-center rounded border border-border p-1.5 hover:bg-contrast",onClick:()=>{n()},title:"Close (".concat(b,")"),children:(0,r.jsx)(ae.CloseIcon,{className:"h-4 w-4 fill-current text-text"})})]}),d&&(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2 md:flex-nowrap",children:[(0,r.jsx)("input",{type:"text",placeholder:"Replace",onChange:e=>{g(e.target.value)},onKeyDown:e=>{if("Enter"===e.key&&f&&l.length){if(e.ctrlKey&&e.altKey)return p({type:"all",replace:f}),void e.preventDefault();p({type:"next",replace:f}),e.preventDefault()}},className:"rounded border border-border bg-default p-1 px-2",ref:m}),(0,r.jsx)(Et.Z,{small:!0,onClick:()=>{p({type:"next",replace:f})},disabled:l.length<1||f.length<1,title:"Replace (Ctrl + Enter)",children:"Replace"}),(0,r.jsx)(Et.Z,{small:!0,onClick:()=>{p({type:"all",replace:f})},disabled:l.length<1||f.length<1,title:"Replace all (Ctrl + Alt + Enter)",children:"Replace all"})]})]})]}):null},un=()=>{const e=(0,st.I)(),[t]=(0,o.g)(),{query:n,currentResultIndex:s,results:a,isCaseSensitive:l,isSearchActive:u,dispatch:d,addReplaceEventListener:h}=$t(),p=(0,kt.Y)(n),f=(0,kt.Y)(s),g=(0,kt.Y)(l),m=(0,kt.Y)(a);(0,i.useEffect)((()=>e.keyboardService.addCommandHandlers([{command:ot.Ix,category:"Super notes",description:"Search in current note",onKeyDown:e=>{e.preventDefault(),e.stopPropagation(),d({type:"toggle-search"})}},{command:ot.p6,category:"Super notes",description:"Search and replace in current note",onKeyDown:e=>{t.isEditable()&&(e.preventDefault(),e.stopPropagation(),d({type:"toggle-replace-mode"}))}},{command:ot.zI,onKeyDown(){d({type:"toggle-case-sensitive"})}},{command:ot.yc,category:"Super notes",description:"Go to next search result",onKeyDown(e){e.preventDefault(),e.stopPropagation(),d({type:"go-to-next-result"})}},{command:ot.fq,category:"Super notes",description:"Go to previous search result",onKeyDown(e){e.preventDefault(),e.stopPropagation(),d({type:"go-to-previous-result"})}}])),[e.keyboardService,d,t]);const y=(0,i.useCallback)(((e,n)=>{document.querySelectorAll(".search-highlight").forEach((e=>{e.remove()})),e?t.getEditorState().read((()=>{const r=t.getRootElement();if(!r)return;const i=(e=>{const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);let r=n.nextNode();for(;r;)t.push(r),r=n.nextNode();return t})(r),o=[];i.forEach((t=>{const r=t.textContent||"",i=[];let s=-1;const a=n?r:r.toLowerCase(),l=n?e:e.toLowerCase();for(;-1!==(s=a.indexOf(l,s+1));)i.push(s);i.forEach((n=>{const r=n,i=r+e.length;o.push({node:t,startIndex:r,endIndex:i})}))})),d({type:"set-results",results:o})})):d({type:"clear-results"})}),[d,t]),v=(0,i.useMemo)((()=>(0,Oe.debounce)(y,250)),[y]),A=(0,i.useMemo)((()=>(0,Oe.debounce)(y,500)),[y]);(0,i.useEffect)((()=>{if(!n)return d({type:"clear-results"}),void d({type:"set-current-result-index",index:-1});v(n,g.current)}),[d,v,g,n]),(0,i.useEffect)((()=>{y(p.current,l)}),[y,l,p]),(0,i.useLayoutEffect)((()=>t.registerUpdateListener((e=>{let{dirtyElements:t,dirtyLeaves:n,prevEditorState:r,tags:i}=e;0===t.size&&0===n.size||i.has("history-merge")||r.isEmpty()||A(p.current,g.current)}))),[t,A,g,p]),(0,i.useEffect)((()=>h((e=>{const{replace:n,type:r}=e,i=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{node:r,startIndex:i,endIndex:o}=e,s=(0,c.Xo)(r);s&&(s instanceof c.R2&&s.spliceText(i,o-i,n,!0),t&&r.parentElement&&r.parentElement.scrollIntoView({block:"center"}))};t.update((()=>{if("next"===r){const e=m.current[f.current];if(!e)return;i(e,!0)}else"all"===r&&m.current.forEach((e=>i(e)));y(p.current,g.current)}))}))),[h,f,t,y,g,p,m]),(0,i.useEffect)((()=>{if(document.querySelectorAll(".search-highlight").forEach((e=>{e.remove()})),-1===s)return;const e=a[s];t.getEditorState().read((()=>{var n,r;const i=t.getRootElement(),o=null===(n=null==i?void 0:i.parentElement)||void 0===n?void 0:n.getElementsByClassName("search-highlight-container")[0];null===(r=e.node.parentElement)||void 0===r||r.scrollIntoView({block:"center"}),i&&o&&((e,t,n)=>{const r=t.getBoundingClientRect(),i=document.createRange();i.setStart(e.node,e.startIndex),i.setEnd(e.node,e.endIndex);const o=i.getClientRects();Array.from(o).forEach(((i,o)=>{const s="search-".concat(e.startIndex,"-").concat(e.endIndex,"-").concat(o);if(document.getElementById(s))return;const a=document.createElement("div");a.style.position="absolute",a.style.zIndex="1000",a.style.transform="translate(".concat(i.left-r.left,"px, ").concat(i.top-r.top+t.scrollTop,"px)"),a.style.width="".concat(i.width,"px"),a.style.height="".concat(i.height,"px"),a.style.backgroundColor="var(--sn-stylekit-info-color)",a.style.opacity="0.5",a.className="search-highlight",a.id=s,n.appendChild(a)}))})(e,i,o)}))}),[s,t,a]),(0,i.useEffect)((()=>{let e,n;if(t.getEditorState().read((()=>{var r;n=t.getRootElement(),e=null===(r=null==n?void 0:n.parentElement)||void 0===r?void 0:r.querySelector(".search-highlight-container")})),!n||!e)return;const r=new ResizeObserver((()=>{n&&e&&(e.style.height="".concat(n.scrollHeight,"px"),e.style.overflow="visible")}));r.observe(n);const i=()=>{n&&e&&(e.style.top="-".concat(n.scrollTop,"px"))};return n.addEventListener("scroll",i),()=>{r.disconnect(),null==n||n.removeEventListener("scroll",i)}}),[t]);const b=(0,i.useCallback)((()=>{if(0===a.length)return;const e=a[s];e&&t.update((()=>{const t=(0,c.vN)();(0,c.oq)(t);const n=(0,c.Xo)(e.node);(0,c.Gg)(n)&&n.select(e.startIndex,e.endIndex)}))}),[s,t,a]);return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(cn,{open:u,closeDialog:()=>{b(),d({type:"toggle-search"}),d({type:"reset-search"}),t.focus()}})})};var dn=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));function hn(e,t=(e=>e)){return n=>{const r=e.exec(n);return null===r?null:{index:r.index,length:r[0].length,text:r[0],url:t(r[0])}}}function pn(e,t){for(let n=0;n<t.length;n++){const r=t[n](e);if(r)return r}return null}const fn=/[.,;\s]/;function gn(e){return fn.test(e)}function mn(e){return gn(e[e.length-1])}function yn(e){return gn(e[0])}function vn(e){let t=e.getPreviousSibling();return(0,c.F7)(t)&&(t=t.getLastDescendant()),null===t||(0,c.A3)(t)||(0,c.Gg)(t)&&mn(t.getTextContent())}function An(e){let t=e.getNextSibling();return(0,c.F7)(t)&&(t=t.getFirstDescendant()),null===t||(0,c.A3)(t)||(0,c.Gg)(t)&&yn(t.getTextContent())}function bn(e,t,n,r){return!!(e>0?gn(n[e-1]):vn(r[0]))&&(t<n.length?gn(n[t]):An(r[r.length-1]))}function wn(e,t,n){const r=[],i=[],o=[];let s=0,a=0;const l=[...e];for(;l.length>0;){const e=l[0],c=e.getTextContent().length,u=a;a+c<=t?(r.push(e),s+=c):u>=n?o.push(e):i.push(e),a+=c,l.shift()}return[s,r,i,o]}function Sn(e,t,n,r){const i=(0,X.Ol)(r.url,r.attributes);if(1===e.length){let o,s=e[0];0===t?[o,s]=s.splitText(n):[,o,s]=s.splitText(t,n);const a=(0,c.MX)(r.text);return a.setFormat(o.getFormat()),a.setDetail(o.getDetail()),a.setStyle(o.getStyle()),i.append(a),o.replace(i),s}if(e.length>1){const r=e[0];let o,s=r.getTextContent().length;0===t?o=r:[,o]=r.splitText(t);const a=[];let l;for(let t=1;t<e.length;t++){const r=e[t],i=r.getTextContent().length,o=s;if(o<n)if(s+i<=n)a.push(r);else{const[e,t]=r.splitText(n-o);a.push(e),l=t}s+=i}const u=(0,c.dL)(),d=u?u.getNodes().find(c.Gg):void 0,h=(0,c.MX)(o.getTextContent());return h.setFormat(o.getFormat()),h.setDetail(o.getDetail()),h.setStyle(o.getStyle()),i.append(h,...a),d&&d===o&&((0,c.OP)(u)?h.select(u.anchor.offset,u.focus.offset):(0,c.iO)(u)&&h.select(0,h.getTextContent().length)),o.replace(i),l}}function Cn(e,t,n){const r=e.getChildren(),i=r.length;for(let t=0;t<i;t++){const i=r[t];if(!(0,c.Gg)(i)||!i.isSimpleText())return En(e),void n(null,e.getURL())}const o=e.getTextContent(),s=pn(o,t);if(null===s||s.text!==o)return En(e),void n(null,e.getURL());if(!vn(e)||!An(e))return En(e),void n(null,e.getURL());const a=e.getURL();if(a!==s.url&&(e.setURL(s.url),n(s.url,a)),s.attributes){const t=e.getRel();t!==s.attributes.rel&&(e.setRel(s.attributes.rel||null),n(s.attributes.rel||null,t));const r=e.getTarget();r!==s.attributes.target&&(e.setTarget(s.attributes.target||null),n(s.attributes.target||null,r))}}function En(e){const t=e.getChildren();for(let n=t.length-1;n>=0;n--)e.insertAfter(t[n]);return e.remove(),t.map((e=>e.getLatest()))}function In({matchers:e,onChange:t}){const[n]=(0,o.g)();return function(e,t,n){(0,i.useEffect)((()=>{e.hasNodes([X.qp])||dn(77);const r=(e,t)=>{n&&n(e,t)};return(0,h.qV)(e.registerNodeTransform(c.R2,(e=>{const n=e.getParentOrThrow(),i=e.getPreviousSibling();if((0,X.Xp)(n))Cn(n,t,r);else if(!(0,X.Pq)(n)){if(e.isSimpleText()&&(yn(e.getTextContent())||!(0,X.Xp)(i))){const n=function(e){const t=[e];let n=e.getNextSibling();for(;null!==n&&(0,c.Gg)(n)&&n.isSimpleText()&&(t.push(n),!/[\s]/.test(n.getTextContent()));)n=n.getNextSibling();return t}(e);!function(e,t,n){let r=[...e];const i=r.map((e=>e.getTextContent())).join("");let o,s=i,a=0;for(;(o=pn(s,t))&&null!==o;){const e=o.index,t=e+o.length;if(bn(a+e,a+t,i,r)){const[i,,s,l]=wn(r,a+e,a+t),c=Sn(s,a+e-i,a+t-i,o);r=c?[c,...l]:l,n(o.url,null),a=0}else a+=t;s=s.substring(t)}}(n,t,r)}!function(e,t,n){const r=e.getPreviousSibling(),i=e.getNextSibling(),o=e.getTextContent();(0,X.Xp)(r)&&!yn(o)&&(r.append(e),Cn(r,t,n),n(null,r.getURL())),(0,X.Xp)(i)&&!mn(o)&&(En(i),Cn(i,t,n),n(null,i.getURL()))}(e,t,r)}})))}),[e,t,n])}(n,e,t),null}const _n=[hn(pt.Wh,(e=>e.startsWith("http")?e:"https://".concat(e))),hn(pt.CU,(e=>"mailto:".concat(e)))];function xn(){return(0,r.jsx)(In,{matchers:_n})}var Pn=n(66498),kn=n(93632);function Bn(){const[e]=(0,o.g)();return(0,i.useEffect)((()=>(0,h.qV)(e.registerCommand(Pn.gD,(t=>{const n=new Date,r=(0,c.dL)();if(!(0,c.OP)(r))return!1;const i=r.focus.getNode(),o=r.focus.offset,s=(0,c.Rl)(i)&&0===o,a=t.includes("date"),l=t.includes("time"),u=[],d=s?(0,f.V1)("datetime"===t?"h1":"h2"):(0,c.BE)();if(a){const e=(0,c.MX)((0,kn.AF)(n,!1));e.setFormat("italic"),d.append(e)}if(l){const e=(0,c.MX)((0,kn.DZ)(n));e.toggleFormat("italic"),a&&e.toggleFormat("superscript"),d.append(e)}d.append((0,c.MX)(" ")),u.push(d);const h=(0,c.BE)();return s&&u.push(h),r.insertNodes(u),s&&e.dispatchCommand(_.qL,void 0),!0}),c.VN))),[e]),null}const On="abcdefghijklmnopqrstuvwxyz".split(""),Nn=On.map((e=>e.toUpperCase())),Dn="!£$%^&*()@~:;,./?{}=-_".split(""),jn=[...On,...Nn,...Dn],Tn=jn.length;function Mn(e){const t=Dn.some((t=>e.includes(t))),n=Nn.some((t=>e.includes(t)));return On.some((t=>e.includes(t)))&&n&&t}function Fn(){const[e]=(0,o.g)();return(0,i.useEffect)((()=>(0,h.qV)(e.registerCommand(Pn.wN,(e=>{const t=Number(e),n=(0,c.dL)();if(!(0,c.OP)(n))return!1;const r=(0,c.BE)(),i=function(e){const t=new Uint8Array(e);let n="";do{window.crypto.getRandomValues(t),n=[...t].map((e=>jn[e%Tn])).join("")}while(!Mn(n));return n}(t);return r.append((0,c.MX)(i)),n.insertNodes([r]),!0}),c.VN))),[e]),null}function Rn(){const e=(0,st.I)(),[t]=(0,o.g)();return(0,i.useEffect)((()=>{const n=(0,ot.dP)(e.platform);return(0,h.qV)(t.registerCommand(ee.d1,(()=>((0,ee.up)(t,"check"),!0)),c.KB),t.registerRootListener(((e,n)=>{function r(e,n){var r;const i=e.target;if(null===i||!(0,c.Re)(i))return;const o=i.firstChild;if(null!=o&&(0,c.Re)(o)&&("UL"===o.tagName||"OL"===o.tagName))return;const s=i.parentNode;if(!s||"check"!==s.__lexicalListType)return;null===(r=t.getRootElement())||void 0===r||r.focus();const a=i.getBoundingClientRect(),l=getComputedStyle(i),u=parseFloat(l.paddingLeft)||0,d=parseFloat(l.paddingRight)||0,p=parseFloat(l.lineHeight)||0,f=getComputedStyle(i,":before"),g=parseFloat(f.width)||0,m=e.pageX/(0,h.MZ)(i),y="rtl"===i.dir?m<a.right&&m>a.right-d:m>a.left&&m<a.left+(g||u),v=e.clientY>a.top&&e.clientY<a.top+p;y&&v&&n()}function i(e){r(e,(()=>{t.isEditable()&&t.update((()=>{const t=e.target;if(!e.target)return;const n=(0,c.Xo)(t);(0,ee.QG)(n)&&n.toggleChecked()}))}))}function o(e){r(e,(()=>{e.preventDefault()}))}null!==e&&(e.addEventListener("click",i),e.addEventListener("pointerdown",o)),null!==n&&(n.removeEventListener("click",i),n.removeEventListener("pointerdown",o))})),t.registerCommand(c.XN,(()=>{var t;if(!e.keyboardService.activeModifiers.has(n))return!1;const r=(0,c.dL)();if(!(0,c.OP)(r)||!r.isCollapsed())return!1;const i=r.focus.getNode(),o=i.getParent(),s=(0,ee.QG)(o)?o:i;return!(!(0,ee.QG)(s)||"check"!==(null===(t=s.getParent())||void 0===t?void 0:t.getListType())||(s.toggleChecked(),0))}),c.KB),e.keyboardService.registerExternalKeyboardShortcutHelpItem({platform:e.platform,modifiers:[n],key:"Enter",category:"Super notes",description:"Toggle checklist item"}))}),[e.keyboardService,e.platform,t]),null}const Ln=e=>{let{onChange:t,className:n,children:o,previewLength:s,spellcheck:a,ignoreFirstChange:l=!1,readonly:c,onFocus:u,onBlur:d}=e;const[h,p]=(0,i.useState)(!1),f=(0,i.useCallback)(((e,n)=>{!l||h?e.read((()=>{(0,ke.S)(e,s,t)})):p(!0)}),[l,h,s,t]),[g,m]=(0,i.useState)(null),v=(0,rt.ac)(rt.Jj.sm);return(0,r.jsxs)(r.Fragment,{children:[!v&&(0,r.jsx)(Gt,{}),(0,r.jsx)("div",{className:"relative min-h-0 flex-grow",children:(0,r.jsx)(y,{contentEditable:(0,r.jsx)("div",{id:"blocks-editor",className:"editor-scroller h-full min-h-0",children:(0,r.jsxs)("div",{className:"editor z-0 overflow-hidden",ref:e=>{null!==e&&m(e)},children:[(0,r.jsx)(b,{id:Be._,className:(0,Oe.classNames)("ContentEditable__root relative overflow-y-auto p-4 text-[length:--font-size] leading-[--line-height] focus:shadow-none focus:outline-none",n),spellCheck:a,onFocus:u,onBlur:d}),(0,r.jsx)("div",{className:"search-highlight-container pointer-events-none absolute left-0 top-0 h-full w-full"})]})}),placeholder:(0,r.jsxs)("div",{className:"pointer-events-none absolute left-4 top-4 text-[length:--font-size] text-passive-1",children:["Type ",(0,r.jsx)("span",{className:"rounded bg-passive-4-opacity-variant p-0.5",children:"/"})," for commands..."]}),ErrorBoundary:M})}),v&&(0,r.jsx)(Gt,{}),(0,r.jsx)(te,{}),(0,r.jsx)(P,{transformers:Ne.c}),(0,r.jsx)(N,{hasCellMerge:!0}),(0,r.jsx)(S,{onChange:f,ignoreSelectionChange:!0}),(0,r.jsx)(J,{}),(0,r.jsx)(ne,{}),(0,r.jsx)(E,{}),(0,r.jsx)(Rn,{}),(0,r.jsx)(xe,{}),(0,r.jsx)($,{}),(0,r.jsx)(L,{}),(0,r.jsx)(oe.ZP,{}),(0,r.jsx)(re.Z,{}),(0,r.jsx)(ie.Z,{}),(0,r.jsx)(se.ZP,{}),(0,r.jsx)(Pe,{}),(0,r.jsx)(De.V,{}),(0,r.jsx)(at.Z,{}),(0,r.jsx)(Zt,{}),(0,r.jsx)(nn,{children:(0,r.jsx)(un,{})}),(0,r.jsx)(Bn,{}),(0,r.jsx)(Fn,{}),(0,r.jsx)(xn,{}),!c&&g&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ie,{anchorElem:g}),(0,r.jsx)(He,{anchorElem:g,cellMerge:!0})]}),o]})}},59846:(e,t,n)=>{"use strict";n.d(t,{I:()=>p});var r=n(52322),i=n(47166),o=n(31031),s=n(2784);const a="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,l=a?s.useLayoutEffect:s.useEffect,c={tag:"history-merge"};function u({initialConfig:e,children:t}){const n=(0,s.useMemo)((()=>{const{theme:t,namespace:n,editor__DEPRECATED:r,nodes:s,onError:l,editorState:u,html:d}=e,h=(0,i.LI)(null,t);let p=r||null;if(null===p){const r=(0,o.Jh)({editable:e.editable,html:d,namespace:n,nodes:s,onError:e=>l(e,r),theme:t});!function(e,t){if(null!==t)if(void 0===t)e.update((()=>{const t=(0,o.Gv)();if(t.isEmpty()){const n=(0,o.BE)();t.append(n);const r=a?document.activeElement:null;(null!==(0,o.dL)()||null!==r&&r===e.getRootElement())&&n.select()}}),c);else if(null!==t)switch(typeof t){case"string":{const n=e.parseEditorState(t);e.setEditorState(n,c);break}case"object":e.setEditorState(t,c);break;case"function":e.update((()=>{(0,o.Gv)().isEmpty()&&t(e)}),c)}}(r,u),p=r}return[p,h]}),[]);return l((()=>{const t=e.editable,[r]=n;r.setEditable(void 0===t||t)}),[]),(0,r.jsx)(i.YK.Provider,{value:n,children:t})}var d=n(34521),h=n(41421);const p=e=>{let{initialValue:t,children:n,readonly:i,nodes:o=[]}=e;return(0,r.jsx)(u,{initialConfig:{namespace:"BlocksEditor",theme:d.Z,editable:!i,onError:e=>console.error(e),editorState:"string"==typeof t&&0===t.length?void 0:t,nodes:[...o,...h.G]},children:(0,r.jsx)(r.Fragment,{children:n})})}},57140:(e,t,n)=>{"use strict";n.d(t,{_:()=>r});const r="super-editor-content"},75043:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(52322),i=n(2784),o=n(3038);function s(){const[e,t]=(0,i.useState)(null),n=(0,i.useCallback)((()=>{t(null)}),[]),s=(0,i.useMemo)((()=>{if(null===e)return null;const{title:t,content:i,closeOnClickOutside:s}=e;return(0,r.jsx)(o.Z,{onClose:n,title:t,closeOnClickOutside:s,children:i})}),[e,n]),a=(0,i.useCallback)((function(e,r){t({closeOnClickOutside:!(arguments.length>2&&void 0!==arguments[2])||arguments[2],content:r(n),title:e})}),[n]);return[s,a]}},41421:(e,t,n)=>{"use strict";n.d(t,{G:()=>x,a:()=>P});var r=n(36153),i=n(31537),o=n(93261),s=n(22311),a=n(31031),l=n(29016);class c extends a.HX{static getType(){return"mark"}static clone(e){return new c(Array.from(e.__ids),e.__key)}static importDOM(){return null}static importJSON(e){const t=u(e.ids);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),ids:this.getIDs(),type:"mark",version:1}}constructor(e,t){super(t),this.__ids=e||[]}createDOM(e){const t=document.createElement("mark");return(0,l.Yo)(t,e.theme.mark),this.__ids.length>1&&(0,l.Yo)(t,e.theme.markOverlap),t}updateDOM(e,t,n){const r=e.__ids,i=this.__ids,o=r.length,s=i.length,a=n.theme.markOverlap;return o!==s&&(1===o?2===s&&(0,l.Yo)(t,a):1===s&&(0,l.PS)(t,a)),!1}hasID(e){const t=this.getIDs();for(let n=0;n<t.length;n++)if(e===t[n])return!0;return!1}getIDs(){const e=this.getLatest();return d(e)?e.__ids:[]}addID(e){const t=this.getWritable();if(d(t)){const n=t.__ids;t.__ids=n;for(let t=0;t<n.length;t++)if(e===n[t])return;n.push(e)}}deleteID(e){const t=this.getWritable();if(d(t)){const n=t.__ids;t.__ids=n;for(let t=0;t<n.length;t++)if(e===n[t])return void n.splice(t,1)}}insertNewAfter(e,t=!0){const n=u(this.__ids);return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!(0,a.OP)(t)||"html"===n)return!1;const r=t.anchor,i=t.focus,o=r.getNode(),s=i.getNode(),l=t.isBackward()?r.offset-i.offset:i.offset-r.offset;return this.isParentOf(o)&&this.isParentOf(s)&&this.getTextContent().length===l}excludeFromCopy(e){return"clone"!==e}}function u(e){return(0,a.U2)(new c(e))}function d(e){return e instanceof c}class h extends a.HX{static getType(){return"overflow"}static clone(e){return new h(e.__key)}static importJSON(e){return(0,a.U2)(new h)}static importDOM(){return null}constructor(e){super(e),this.__type="overflow"}exportJSON(){return{...super.exportJSON(),type:"overflow"}}createDOM(e){const t=document.createElement("span"),n=e.theme.characterLimit;return"string"==typeof n&&(t.className=n),t}updateDOM(e,t){return!1}insertNewAfter(e,t=!0){return this.getParentOrThrow().insertNewAfter(e,t)}excludeFromCopy(){return!0}}var p=n(27901),f=n(9591),g=n(65268),m=n(43800),y=n(59179),v=n(17594),A=n(57054),b=n(15960),w=n(59786),S=n(7355),C=n(49060),E=n(74205),I=n(78113);const _=[o.qp,r.o0,r.wg,v.hf,A.G2,b.iK,i.DT,f.c2,p.HY,o.GR,s.NK,c,h,f.rT,g.Cr,g.Fh,g.g0,m.je,y.gL,w.h,S.H,C.Mf,E.Ct,s.EG],x=_,P=[..._,I.r]},78113:(e,t,n)=>{"use strict";n.d(t,{A:()=>u,r:()=>c});var r=n(52322),i=n(20266),o=n(87901);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class c extends i.K{static getType(){return"file-export"}constructor(e,t){super(),this.__name=e,this.__mimeType=t}static clone(e){return new c(e.__name,e.__mimeType)}static importJSON(e){return new c(e.name,e.mimeType)}exportJSON(){return a(a({},super.exportJSON()),{},{name:this.__name,mimeType:this.__mimeType,version:1,type:"file-export"})}getZippableFileName(){return(0,o.parseAndCreateZippableFileName)(this.__name)}getTextContent(){return"".concat(this.__mimeType.startsWith("image/")?"!":"","[").concat(this.__name,"](./").concat(this.getZippableFileName(),")")}exportDOM(){const e="./".concat(this.getZippableFileName());if(this.__mimeType.startsWith("image/")){const t=document.createElement("img");return t.setAttribute("src",e),{element:t}}if(this.__mimeType.startsWith("audio")){const t=document.createElement("audio");t.setAttribute("controls","");const n=document.createElement("source");return n.setAttribute("src",e),n.setAttribute("type",this.__mimeType),t.appendChild(n),{element:t}}if(this.__mimeType.startsWith("video")){const t=document.createElement("video");t.setAttribute("controls","");const n=document.createElement("source");return n.setAttribute("src",e),n.setAttribute("type",this.__mimeType),t.appendChild(n),{element:t}}const t=document.createElement("object");return t.setAttribute("data",e),t.setAttribute("type",this.__mimeType),{element:t}}decorate(){return(0,r.jsx)(r.Fragment,{})}}function u(e,t){return new c(e,t)}},43800:(e,t,n)=>{"use strict";n.d(t,{je:()=>p,m2:()=>f});var r=n(52322),i=n(74667),o=n(20266),s=n(2784);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){const t=e.getAttribute("data-lexical-tweet-id");return t?{node:f(t)}:null}let d=!0;function h(e){let{className:t,format:n,loadingComponent:o,nodeKey:a,onError:l,onLoad:c,tweetID:u}=e;const h=(0,s.useRef)(null),p=(0,s.useRef)(""),[f,g]=(0,s.useState)(!1),m=(0,s.useCallback)((async()=>{try{await window.twttr.widgets.createTweet(u,h.current),g(!1),d=!1,c&&c()}catch(e){l&&l(String(e))}}),[l,c,u]);return(0,s.useEffect)((()=>{var e;if(u!==p.current){if(g(!0),d){const t=document.createElement("script");t.src="/dist/twitter-widgets.js",t.async=!0,null===(e=document.body)||void 0===e||e.appendChild(t),t.onload=m,l&&(t.onerror=l)}else m().catch(console.error);p&&(p.current=u)}}),[m,l,u]),(0,r.jsxs)(i.U,{className:t,format:n,nodeKey:a,children:[f?o:null,(0,r.jsx)("div",{style:{display:"inline-block",width:"550px"},ref:h})]})}class p extends o.K{static getType(){return"tweet"}static clone(e){return new p(e.__id,e.__format,e.__key)}static importJSON(e){const t=f(e.id);return t.setFormat(e.format),t}exportJSON(){return l(l({},super.exportJSON()),{},{id:this.getId(),type:"tweet",version:1})}static importDOM(){return{div:e=>e.hasAttribute("data-lexical-tweet-id")?{conversion:u,priority:2}:null}}exportDOM(){const e=document.createElement("div");e.setAttribute("data-lexical-tweet-id",this.__id);const t=document.createTextNode(this.getTextContent());return e.append(t),{element:e}}constructor(e,t,n){super(t,n),this.__id=e}getId(){return this.__id}getTextContent(e,t){return"https://twitter.com/i/web/status/".concat(this.__id)}decorate(e,t){const n=t.theme.embedBlock||{},i={base:n.base||"",focus:n.focus||""};return(0,r.jsx)(h,{className:i,format:this.__format,loadingComponent:"Loading...",nodeKey:this.getKey(),tweetID:this.__id})}isInline(){return!1}}function f(e){return new p(e)}},59179:(e,t,n)=>{"use strict";n.d(t,{gL:()=>d,kU:()=>h});var r=n(52322),i=n(74667),o=n(20266);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){let{className:t,format:n,nodeKey:o,videoID:s}=e;return(0,r.jsx)(i.U,{className:t,format:n,nodeKey:o,children:(0,r.jsx)("iframe",{width:"560",height:"315",src:"https://www.youtube.com/embed/".concat(s),frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,title:"YouTube video"})})}function u(e){const t=e.getAttribute("data-lexical-youtube");return t?{node:h(t)}:null}class d extends o.K{static getType(){return"youtube"}static clone(e){return new d(e.__id,e.__format,e.__key)}static importJSON(e){const t=h(e.videoID);return t.setFormat(e.format),t}exportJSON(){return a(a({},super.exportJSON()),{},{type:"youtube",version:1,videoID:this.__id})}exportDOM(){const e=document.createElement("iframe");return e.setAttribute("data-lexical-youtube",this.__id),e.setAttribute("width","560"),e.setAttribute("height","315"),e.setAttribute("src","https://www.youtube.com/embed/".concat(this.__id)),e.setAttribute("frameborder","0"),e.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"),e.setAttribute("allowfullscreen","true"),e.setAttribute("title","YouTube video"),{element:e}}static importDOM(){return{iframe:e=>e.hasAttribute("data-lexical-youtube")?{conversion:u,priority:1}:null}}constructor(e,t,n){super(t,n),this.__id=e}updateDOM(){return!1}getId(){return this.__id}getTextContent(e,t){return"https://www.youtube.com/watch?v=".concat(this.__id)}decorate(e,t){const n=t.theme.embedBlock||{},i={base:n.base||"",focus:n.focus||""};return(0,r.jsx)(c,{className:i,format:this.__format,nodeKey:this.getKey(),videoID:this.__id})}isInline(){return!1}}function h(e){return new d(e)}},34521:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={blockCursor:"Lexical__blockCursor",characterLimit:"Lexical__characterLimit",code:"Lexical__code",codeHighlight:{atrule:"Lexical__tokenAttr",attr:"Lexical__tokenAttr",boolean:"Lexical__tokenProperty",builtin:"Lexical__tokenSelector",cdata:"Lexical__tokenComment",char:"Lexical__tokenSelector",class:"Lexical__tokenFunction","class-name":"Lexical__tokenFunction",comment:"Lexical__tokenComment",constant:"Lexical__tokenProperty",deleted:"Lexical__tokenProperty",doctype:"Lexical__tokenComment",entity:"Lexical__tokenOperator",function:"Lexical__tokenFunction",important:"Lexical__tokenVariable",inserted:"Lexical__tokenSelector",keyword:"Lexical__tokenAttr",namespace:"Lexical__tokenVariable",number:"Lexical__tokenProperty",operator:"Lexical__tokenOperator",prolog:"Lexical__tokenComment",property:"Lexical__tokenProperty",punctuation:"Lexical__tokenPunctuation",regex:"Lexical__tokenVariable",selector:"Lexical__tokenSelector",string:"Lexical__tokenSelector",symbol:"Lexical__tokenProperty",tag:"Lexical__tokenProperty",url:"Lexical__tokenOperator",variable:"Lexical__tokenVariable"},embedBlock:{base:"Lexical__embedBlock",focus:"Lexical__embedBlockFocus"},hashtag:"Lexical__hashtag",heading:{h1:"Lexical__h1",h2:"Lexical__h2",h3:"Lexical__h3",h4:"Lexical__h4",h5:"Lexical__h5",h6:"Lexical__h6"},image:"editor-image",link:"Lexical__link",list:{listitem:"Lexical__listItem",listitemChecked:"Lexical__listItemChecked",listitemUnchecked:"Lexical__listItemUnchecked",nested:{listitem:"Lexical__nestedListItem"},olDepth:["Lexical__ol1","Lexical__ol2","Lexical__ol3","Lexical__ol4","Lexical__ol5"],ul:"Lexical__ul",checklist:"Lexical__checkList"},ltr:"Lexical__ltr",mark:"Lexical__mark",markOverlap:"Lexical__markOverlap",paragraph:"Lexical__paragraph",quote:"Lexical__quote",rtl:"Lexical__rtl",table:"Lexical__table",tableAddColumns:"Lexical__tableAddColumns",tableAddRows:"Lexical__tableAddRows",tableCell:"Lexical__tableCell",tableCellActionButton:"Lexical__tableCellActionButton",tableCellActionButtonContainer:"Lexical__tableCellActionButtonContainer",tableCellEditing:"Lexical__tableCellEditing",tableCellHeader:"Lexical__tableCellHeader",tableCellPrimarySelected:"Lexical__tableCellPrimarySelected",tableCellResizer:"Lexical__tableCellResizer",tableCellSelected:"Lexical__tableCellSelected",tableCellSortedIndicator:"Lexical__tableCellSortedIndicator",tableResizeRuler:"Lexical__tableCellResizeRuler",tableSelected:"Lexical__tableSelected",tableSelection:"Lexical__tableSelection",text:{bold:"Lexical__textBold",code:"Lexical__textCode",italic:"Lexical__textItalic",strikethrough:"Lexical__textStrikethrough",subscript:"Lexical__textSubscript",superscript:"Lexical__textSuperscript",underline:"Lexical__textUnderline",underlineStrikethrough:"Lexical__textUnderlineStrikethrough"}}},3038:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(52322),i=n(47166),o=n(2784),s=n(28316),a=n(47931),l=n(84075);function c(e){let{onClose:t,children:n,title:i,closeOnClickOutside:s}=e;const c=(0,o.useRef)(null);return(0,o.useEffect)((()=>{null!==c.current&&c.current.focus()}),[]),(0,o.useEffect)((()=>{let e=null;const n=e=>{e.key===l.u8.Escape&&t()},r=e=>{const n=e.target;null!==c.current&&!c.current.contains(n)&&s&&t()};return null!==c.current&&(e=c.current.parentElement,null!==e&&e.addEventListener("click",r)),window.addEventListener("keydown",n),()=>{window.removeEventListener("keydown",n),null!==e&&e.removeEventListener("click",r)}}),[s,t]),(0,r.jsx)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-[rgba(0,0,0,0.65)]",role:"dialog",children:(0,r.jsxs)("div",{className:"relative flex min-w-[min(80vw,_20rem)] flex-col rounded border border-border bg-default",tabIndex:-1,ref:c,children:[(0,r.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-3.5 py-2",children:[(0,r.jsx)("div",{className:"text-sm font-semibold",children:i}),(0,r.jsx)("button",{tabIndex:0,className:"ml-2 rounded p-1 font-bold hover:bg-contrast",onClick:t,children:(0,r.jsx)(a.Z,{type:"close"})})]}),(0,r.jsx)("div",{className:"px-3.5 py-3",children:n})]})})}function u(e){let{onClose:t,children:n,title:a,closeOnClickOutside:l=!0}=e;const[u,d]=(0,o.useState)(),[h]=(0,i.g)();return(0,o.useEffect)((()=>{var e,t;d(null!==(t=null===(e=h.getRootElement())||void 0===e?void 0:e.parentElement)&&void 0!==t?t:document.body)}),[h]),u?(0,s.createPortal)((0,r.jsx)(c,{onClose:t,title:a,closeOnClickOutside:l,children:n}),u):null}},68608:(e,t,n)=>{"use strict";n.d(t,{c:()=>m});var r=n(37146),i=n(65268),o=n(27901),s=n(31031),a=n(49060),l=n(74205);const c={dependencies:[o.HY],export:e=>(0,o.fs)(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{const i=(0,o.Dq)();r||null!=e.getNextSibling()?e.replace(i):e.insertBefore(i),i.selectNext()},type:"element"},u={dependencies:[a.Mf],export:e=>(0,a.Dq)(e)?"![".concat(e.__alt?e.__alt:"image","](").concat(e.__src,")"):null,importRegExp:/!(?:\[([^[]*)\])(?:\(([^(]+)\))/,regExp:/!(?:\[([^[]*)\])(?:\(([^(]+)\))$/,replace:(e,t)=>{const[,n,r]=t,i=(0,a.kx)(r,n);e.replace(i)},trigger:")",type:"text-match"},d={dependencies:[l.Ct],export:e=>(0,l.i0)(e)?e.getTextContent():null,importRegExp:/(?:\[([^[]*)\])(?:\((data:(.*);[^(]+)\))/,regExp:/(?:\[([^[]*)\])(?:\((data:(.*);[^(]+)\))$/,replace:(e,t)=>{const[,n,r,i]=t,o=(0,l.v9)(r,i,n);e.replace(o)},trigger:")",type:"text-match"},h=/^(?:\|)(.+)(?:\|)\s?$/,p=/^(\| ?:?-*:? ?)+\|\s?$/;function f(e){e=e.replace(/\\n/g,"\n");const t=(0,i.ku)(i.xo.NO_STATUS);return(0,r.Os)(e,m,t),t}function g(e){const t=e.match(h);return t&&t[1]?t[1].split("|").map((e=>f(e))):null}const m=[{dependencies:[i.Fh,i.g0,i.Cr],export:e=>{if(!(0,i.di)(e))return null;const t=[];for(const n of e.getChildren()){const e=[];if(!(0,i.to)(n))continue;let o=!1;for(const t of n.getChildren())(0,i.TF)(t)&&(e.push((0,r.JH)(m,t).replace(/\n/g,"\\n")),t.__headerState===i.xo.ROW&&(o=!0));t.push("| ".concat(e.join(" | ")," |")),o&&t.push("| ".concat(e.map((e=>"---")).join(" | ")," |"))}return t.join("\n")},regExp:h,replace:(e,t,n)=>{if(p.test(n[0])){const t=e.getPreviousSibling();if(!t||!(0,i.di)(t))return;const n=t.getChildren(),r=n[n.length-1];if(!r||!(0,i.to)(r))return;return r.getChildren().forEach((e=>{(0,i.TF)(e)&&e.toggleHeaderStyle(i.xo.ROW)})),void e.remove()}const r=g(n[0]);if(null==r)return;const o=[r];let a=e.getPreviousSibling(),l=r.length;for(;a&&(0,s.Rl)(a)&&1===a.getChildrenSize();){const e=a.getFirstChild();if(!(0,s.Gg)(e))break;const t=g(e.getTextContent());if(null==t)break;l=Math.max(l,t.length),o.unshift(t);const n=a.getPreviousSibling();a.remove(),a=n}const c=(0,i.gz)();for(const e of o){const t=(0,i.Xf)();c.append(t);for(let n=0;n<l;n++)t.append(n<e.length?e[n]:f(""))}const u=e.getPreviousSibling();(0,i.di)(u)&&function(e){const t=e.getFirstChild();return(0,i.to)(t)?t.getChildrenSize():0}(u)===l?(u.append(...c.getChildren()),e.remove()):e.replace(c),c.selectEnd()},type:"element"},r.T_,u,d,...r.VH,...r.Pr,...r.lL,c]},26786:(e,t,n)=>{"use strict";n.d(t,{GF:()=>m,ZP:()=>w});var r=n(52322),i=n(8802),o=n(47166),s=n(2784),a=n(28316),l=n(75043),c=n(79014),u=n(93559),d=n(29894),h=n(13959),p=n(756),f=n(24118);const g={contentName:"Youtube Video",exampleUrl:"https://www.youtube.com/watch?v=jNQXAC9IVRw",icon:(0,r.jsx)("i",{className:"icon youtube"}),iconName:"youtube",insertNode:(e,t)=>{e.dispatchCommand(u.A,t.id)},keywords:["youtube","video"],parseUrl:e=>{const t=/^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/.exec(e),n=t&&11===(null==t?void 0:t[2].length)?t[2]:null;return null!=n?{id:n,url:e}:null},type:"youtube-video"},m=[{contentName:"Tweet",exampleUrl:"https://twitter.com/jack/status/20",icon:(0,r.jsx)("i",{className:"icon tweet"}),iconName:"tweet",insertNode:(e,t)=>{e.dispatchCommand(c.H,t.id)},keywords:["tweet","twitter"],parseUrl:e=>{const t=/^https:\/\/twitter\.com\/(#!\/)?(\w+)\/status(es)*\/(\d+)$/.exec(e);return null!=t?{id:t[4],url:t[0]}:null},type:"tweet"},g];function y(e){let{index:t,isSelected:n,onClick:i,onMouseEnter:o,option:s}=e;return(0,r.jsx)("li",{tabIndex:-1,className:(0,d.classNames)("cursor-pointer rounded px-2 py-1",n&&"bg-info-backdrop"),ref:s.setRefElement,role:"option","aria-selected":n,id:"typeahead-item-"+t,onMouseEnter:o,onClick:i,children:(0,r.jsx)("span",{className:"text",children:s.title})},s.key)}function v(e){let{options:t,selectedItemIndex:n,onOptionClick:i,onOptionMouseEnter:o}=e;return(0,r.jsx)("div",{className:"typeahead-popover min-w-max rounded border border-border bg-default p-1",children:(0,r.jsx)("ul",{className:"list-none",children:t.map(((e,t)=>(0,r.jsx)(y,{index:t,isSelected:n===t,onClick:()=>i(e,t),onMouseEnter:()=>o(t),option:e},e.key)))})})}const A=(e,t)=>{let n;return r=>{window.clearTimeout(n),n=window.setTimeout((()=>{e(r)}),t)}};function b(e){let{embedConfig:t,onClose:n}=e;const[a,l]=(0,s.useState)(""),[c]=(0,o.g)(),[u,d]=(0,s.useState)(null),g=(0,s.useMemo)((()=>A((e=>{const n=i.HI.exec(e);null!=t&&null!=e&&null!=n?Promise.resolve(t.parseUrl(e)).then((e=>{d(e)})):null!=u&&d(null)}),200)),[t,u]),m=(0,s.useCallback)((e=>{e&&setTimeout((()=>e.focus()))}),[]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("label",{className:"flex flex-col gap-1.5",children:["URL:",(0,r.jsx)(h.Z,{value:a,onChange:e=>{l(e),g(e)},ref:m})]}),(0,r.jsx)("div",{className:"mt-2.5 flex justify-end",children:(0,r.jsx)(p.Z,{disabled:!u,onClick:()=>{null!=u&&(t.insertNode(c,u),n())},small:(0,f.Av)(),children:"Embed"})})]})}function w(){const[e,t]=(0,l.Z)();return(0,r.jsxs)(r.Fragment,{children:[e,(0,r.jsx)(i.vK,{embedConfigs:m,onOpenEmbedModalForConfig:e=>{t("Embed ".concat(e.contentName),(t=>(0,r.jsx)(b,{embedConfig:e,onClose:t})))},getMenuOptions:(e,t,n)=>[new i.WX("Dismiss",{onSelect:n}),new i.WX("Embed ".concat(e.contentName),{onSelect:t})],menuRenderFn:(e,t)=>{let{selectedIndex:n,options:i,selectOptionAndCleanUp:o,setHighlightedIndex:s}=t;return e.current?a.createPortal((0,r.jsx)("div",{className:"typeahead-popover auto-embed-menu",style:{marginLeft:e.current.style.width},children:(0,r.jsx)(v,{options:i,selectedItemIndex:n,onOptionClick:(e,t)=>{s(t),o(e)},onOptionMouseEnter:e=>{s(e)}})}),e.current):null}})]})}},57823:(e,t,n)=>{"use strict";n.d(t,{y:()=>i});var r=n(17906);class i extends r.n{constructor(e,t){super(e),this.title=e,this.keywords=t.keywords||[],this.iconName=t.iconName,this.keyboardShortcut=t.keyboardShortcut,this.onSelect=t.onSelect.bind(this)}}},98572:(e,t,n)=>{"use strict";n.d(t,{C1:()=>h,Cj:()=>l,F:()=>c,QK:()=>s,R8:()=>u,oe:()=>d,vn:()=>o,zN:()=>a});var r=n(31031),i=n(57823);const o={name:"Align left",iconName:"align-left",keywords:["align","justify","left"],onSelect:e=>e.dispatchCommand(r.RO,"left")},s={name:"Align center",iconName:"align-center",keywords:["align","justify","center"],onSelect:e=>e.dispatchCommand(r.RO,"center")},a={name:"Align right",iconName:"align-right",keywords:["align","justify","right"],onSelect:e=>e.dispatchCommand(r.RO,"right")},l={name:"Align justify",iconName:"align-justify",keywords:["align","justify","justify"],onSelect:e=>e.dispatchCommand(r.RO,"justify")};function c(e){return new i.y(o.name,{iconName:o.iconName,keywords:o.keywords,onSelect:()=>o.onSelect(e)})}function u(e){return new i.y(s.name,{iconName:s.iconName,keywords:s.keywords,onSelect:()=>s.onSelect(e)})}function d(e){return new i.y(a.name,{iconName:a.iconName,keywords:a.keywords,onSelect:()=>a.onSelect(e)})}function h(e){return new i.y(l.name,{iconName:l.iconName,keywords:l.keywords,onSelect:()=>l.onSelect(e)})}},89139:(e,t,n)=>{"use strict";n.d(t,{d:()=>a,i:()=>l});var r=n(64739),i=n(31031),o=n(36153),s=n(57823);const a={name:"Code Block",iconName:"code",keywords:["javascript","python","js","codeblock"],onSelect:e=>e.update((()=>{const e=(0,i.dL)();if((0,i.OP)(e))if(e.isCollapsed())(0,r.Hz)(e,(()=>(0,o.Ol)()));else{const t=e.getTextContent(),n=(0,o.Ol)();e.insertNodes([n]),e.insertRawText(t)}}))};function l(e){return new s.y(a.name,{iconName:a.iconName,keywords:a.keywords,onSelect:()=>a.onSelect(e)})}},4694:(e,t,n)=>{"use strict";n.d(t,{J:()=>o,e:()=>s});var r=n(25207),i=n(57823);const o={name:"Collapsible",iconName:"details-block",keywords:["collapse","collapsible","toggle"],onSelect:e=>e.dispatchCommand(r.sG,void 0)};function s(e){return new i.y(o.name,{iconName:o.iconName,keywords:o.keywords,onSelect:()=>o.onSelect(e)})}},21490:(e,t,n)=>{"use strict";n.d(t,{W:()=>s,j:()=>o});var r=n(27901),i=n(57823);const o={name:"Divider",iconName:"horizontal-rule",keywords:["horizontal rule","divider","hr"],onSelect:e=>e.dispatchCommand(r.qL,void 0)};function s(e){return new i.y(o.name,{iconName:o.iconName,keywords:o.keywords,onSelect:()=>o.onSelect(e)})}},94652:(e,t,n)=>{"use strict";n.d(t,{I:()=>u,M8:()=>d,SH:()=>a,p2:()=>c,sV:()=>h,vZ:()=>l});var r=n(64739),i=n(31031),o=n(9591),s=n(57823);const a={name:"Heading 1",iconName:"h1",keywords:["heading","header","h1"],onSelect:e=>e.update((()=>{const e=(0,i.dL)();(0,i.OP)(e)&&(0,r.Hz)(e,(()=>(0,o.V1)("h1")))}))};function l(e){return new s.y(a.name,{iconName:a.iconName,keywords:a.keywords,onSelect:()=>a.onSelect(e)})}const c={name:"Heading 2",iconName:"h2",keywords:["heading","header","h2"],onSelect:e=>e.update((()=>{const e=(0,i.dL)();(0,i.OP)(e)&&(0,r.Hz)(e,(()=>(0,o.V1)("h2")))}))};function u(e){return new s.y(c.name,{iconName:c.iconName,keywords:c.keywords,onSelect:()=>c.onSelect(e)})}const d={name:"Heading 3",iconName:"h3",keywords:["heading","header","h3"],onSelect:e=>e.update((()=>{const e=(0,i.dL)();(0,i.OP)(e)&&(0,r.Hz)(e,(()=>(0,o.V1)("h3")))}))};function h(e){return new s.y(d.name,{iconName:d.iconName,keywords:d.keywords,onSelect:()=>d.onSelect(e)})}},22798:(e,t,n)=>{"use strict";n.d(t,{$o:()=>l,Cc:()=>s,Gm:()=>a,b:()=>o});var r=n(31031),i=n(57823);const o={name:"Indent",iconName:"indent",keywords:["indent"],onSelect:e=>e.dispatchCommand(r.PU,void 0)},s={name:"Outdent",iconName:"outdent",keywords:["outdent"],onSelect:e=>e.dispatchCommand(r.cz,void 0)};function a(e){return new i.y(o.name,{iconName:o.iconName,keywords:o.keywords,onSelect:()=>o.onSelect(e)})}function l(e){return new i.y(s.name,{iconName:s.iconName,keywords:s.keywords,onSelect:()=>s.onSelect(e)})}},9256:(e,t,n)=>{"use strict";n.d(t,{EQ:()=>u,Ee:()=>a,PG:()=>c,T$:()=>l,Vb:()=>o,vE:()=>s});var r=n(22311),i=n(57823);const o={name:"Bulleted List",iconName:"list-bulleted",keywords:["bulleted list","unordered list","ul"],onSelect:e=>e.dispatchCommand(r.A3,void 0)},s={name:"Check List",iconName:"list-check",keywords:["check list","todo list"],onSelect:e=>e.dispatchCommand(r.d1,void 0)},a={name:"Numbered List",iconName:"list-numbered",keywords:["numbered list","ordered list","ol"],onSelect:e=>e.dispatchCommand(r.B3,void 0)};function l(e){return new i.y(o.name,{iconName:o.iconName,keywords:o.keywords,onSelect:()=>o.onSelect(e)})}function c(e){return new i.y(s.name,{iconName:s.iconName,keywords:s.keywords,onSelect:()=>s.onSelect(e)})}function u(e){return new i.y(a.name,{iconName:a.iconName,keywords:a.keywords,onSelect:()=>a.onSelect(e)})}},66208:(e,t,n)=>{"use strict";n.d(t,{O:()=>s,c:()=>a});var r=n(64739),i=n(31031),o=n(57823);const s={name:"Paragraph",iconName:"paragraph",keywords:["normal","paragraph","p","text"],onSelect:e=>e.update((()=>{const e=(0,i.dL)();(0,i.OP)(e)&&(0,r.Hz)(e,(()=>(0,i.BE)()))}))};function a(e){return new o.y(s.name,{iconName:s.iconName,keywords:s.keywords,onSelect:()=>s.onSelect(e)})}},20174:(e,t,n)=>{"use strict";n.d(t,{Kw:()=>a,SC:()=>s,ft:()=>l});var r=n(57823),i=n(66498);const o=8,s={name:"Generate cryptographically secure password",iconName:"password",keywords:["password","secure"],onSelect:e=>e.dispatchCommand(i.wN,String(16))};function a(e){return new r.y(s.name,{iconName:s.iconName,keywords:s.keywords,onSelect:()=>s.onSelect(e)})}function l(e,t){if(null==t)return[];const n=/^\d+$/.exec(t);if(!n)return[];const s=parseInt(n[0],10);return s<o?[]:[new r.y("Generate ".concat(s,"-character cryptographically secure password"),{iconName:"password",keywords:["password","secure"],onSelect:()=>e.dispatchCommand(i.wN,s.toString())})]}},30626:(e,t,n)=>{"use strict";n.d(t,{V:()=>a,t:()=>l});var r=n(64739),i=n(31031),o=n(9591),s=n(57823);const a={name:"Quote",iconName:"quote",keywords:["block quote"],onSelect:e=>e.update((()=>{const e=(0,i.dL)();(0,i.OP)(e)&&(0,r.Hz)(e,(()=>(0,o.Z1)()))}))};function l(e){return new s.y(a.name,{iconName:a.iconName,keywords:a.keywords,onSelect:()=>a.onSelect(e)})}},17594:(e,t,n)=>{"use strict";n.d(t,{_$:()=>c,hf:()=>l,rY:()=>u});var r=n(31031);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){return{node:c(void 0===e.open||e.open)}}class l extends r.HX{constructor(e,t){super(t),this.__open=null!=e&&e}static getType(){return"collapsible-container"}static clone(e){return new l(e.__open,e.__key)}createDOM(e,t){const n=document.createElement("details");return n.classList.add("Collapsible__container"),n.open=this.__open,n.addEventListener("toggle",(()=>{t.getEditorState().read((()=>this.getOpen()))!==n.open&&t.update((()=>this.toggleOpen()))})),n}updateDOM(e,t){return e.__open!==this.__open&&(t.open=this.__open),!1}static importDOM(){return{details:()=>({conversion:a,priority:1})}}static importJSON(e){return c(e.open)}exportDOM(){const e=document.createElement("details");return this.getLatest().__open&&e.setAttribute("open",""),{element:e}}exportJSON(){return o(o({},super.exportJSON()),{},{type:"collapsible-container",version:1,open:this.__open})}setOpen(e){this.getWritable().__open=e}getOpen(){return this.__open}toggleOpen(){this.setOpen(!this.getOpen())}}function c(e){return new l(e)}function u(e){return e instanceof l}},57054:(e,t,n)=>{"use strict";n.d(t,{G2:()=>l,f9:()=>c,oh:()=>u});var r=n(31031);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(){return{node:c()}}class l extends r.HX{static getType(){return"collapsible-content"}static clone(e){return new l(e.__key)}createDOM(e){const t=document.createElement("div");return t.classList.add("Collapsible__content"),t}updateDOM(e,t){return!1}static importDOM(){return{div:e=>e.hasAttribute("data-lexical-collapsible-content")?{conversion:a,priority:2}:null}}static importJSON(e){return c()}isShadowRoot(){return!0}exportDOM(){const e=document.createElement("div");return e.setAttribute("data-lexical-collapsible-content","true"),{element:e}}exportJSON(){return o(o({},super.exportJSON()),{},{type:"collapsible-content",version:1})}}function c(){return new l}function u(e){return e instanceof l}},15960:(e,t,n)=>{"use strict";n.d(t,{AD:()=>d,iK:()=>u,vW:()=>h});var r=n(31031),i=n(17594),o=n(57054);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(){return{node:d()}}class u extends r.HX{static getType(){return"collapsible-title"}constructor(e){let{formatType:t,key:n}=e;super(n),t&&super.setFormat(t)}static clone(e){return new u({key:e.__key})}createDOM(){const e=document.createElement("summary");e.classList.add("Collapsible__title");const t=this.getFormatType();return e.style.textAlign=t,e}updateDOM(e,t){return!1}static importDOM(){return{summary:()=>({conversion:c,priority:1})}}static importJSON(e){return d(e.format)}exportDOM(){return{element:document.createElement("summary")}}exportJSON(){return a(a({},super.exportJSON()),{},{type:"collapsible-title",version:1})}collapseAtStart(e){return this.getParentOrThrow().insertBefore(this),!0}insertNewAfter(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=this.getParentOrThrow();if(!(0,i.rY)(n))throw new Error("CollapsibleTitleNode expects to be child of CollapsibleContainerNode");if(n.getOpen()){const e=this.getNextSibling();if(!(0,o.oh)(e))throw new Error("CollapsibleTitleNode expects to have CollapsibleContentNode sibling");const t=e.getFirstChild();if((0,r.F7)(t))return t;{const t=(0,r.BE)();return e.append(t),t}}{const e=(0,r.BE)();return n.insertAfter(e,t),e}}}function d(e){return new u({formatType:e})}function h(e){return e instanceof u}},25207:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>h,sG:()=>u});var r=n(47166),i=n(29016),o=n(31031),s=n(2784),a=n(17594),l=n(57054),c=n(15960);const u=(0,o.fA)(),d=(0,o.fA)();function h(){const[e]=(0,r.g)();return(0,s.useEffect)((()=>{if(!e.hasNodes([a.hf,c.iK,l.G2]))throw new Error("CollapsiblePlugin: CollapsibleContainerNode, CollapsibleTitleNode, or CollapsibleContentNode not registered on editor");const t=()=>{var e;const t=(0,o.dL)();if((0,o.OP)(t)&&t.isCollapsed()&&0===t.anchor.offset){const n=(0,i.$s)(t.anchor.getNode(),a.rY);if((0,a.rY)(n)){const r=n.getParent();null!==r&&r.getFirstChild()===n&&t.anchor.key===(null===(e=n.getFirstDescendant())||void 0===e?void 0:e.getKey())&&n.insertBefore((0,o.BE)())}}return!1},n=()=>{const e=(0,o.dL)();if((0,o.OP)(e)&&e.isCollapsed()){const t=(0,i.$s)(e.anchor.getNode(),a.rY);if((0,a.rY)(t)){const n=t.getParent();if(null!==n&&n.getLastChild()===t){const n=t.getFirstDescendant(),r=t.getLastDescendant();(null!==r&&e.anchor.key===r.getKey()&&e.anchor.offset===r.getTextContentSize()||null!==n&&e.anchor.key===n.getKey()&&e.anchor.offset===n.getTextContentSize())&&t.insertAfter((0,o.BE)())}}}return!1};return(0,i.qV)(e.registerNodeTransform(l.G2,(e=>{const t=e.getParent();if(!(0,a.rY)(t)){const t=e.getChildren();for(const n of t)e.insertBefore(n);e.remove()}})),e.registerNodeTransform(c.iK,(e=>{const t=e.getParent();(0,a.rY)(t)||e.replace((0,o.BE)().append(...e.getChildren()))})),e.registerNodeTransform(a.hf,(e=>{const t=e.getChildren();if(2!==t.length||!(0,c.vW)(t[0])||!(0,l.oh)(t[1])){for(const n of t)e.insertBefore(n);e.remove()}})),e.registerCommand(o.Mt,(()=>{const e=(0,o.dL)();if(!(0,o.OP)(e)||!e.isCollapsed()||0!==e.anchor.offset)return!1;const t=e.anchor.getNode().getTopLevelElement();if(null===t)return!1;const n=t.getPreviousSibling();return!(!(0,a.rY)(n)||n.getOpen()||(n.setOpen(!0),0))}),o.KB),e.registerCommand(o.Zb,n,o.KB),e.registerCommand(o.Nm,n,o.KB),e.registerCommand(o._0,t,o.KB),e.registerCommand(o.u$,t,o.KB),e.registerCommand(o.K0,(()=>{var t;const n=null===(t=e._window)||void 0===t?void 0:t.event;if(n&&(n.ctrlKey||n.metaKey)&&"Enter"===n.key){const e=(0,o.DN)();if((0,o.OP)(e)&&e.isCollapsed()){const t=(0,i.$s)(e.anchor.getNode(),(e=>(0,o.F7)(e)&&!e.isInline()));if((0,c.vW)(t)){const n=t.getParent();if((0,a.rY)(n))return n.toggleOpen(),(0,o.oq)(e.clone()),!0}}}return!1}),o.KB),e.registerCommand(u,(()=>(e.update((()=>{const e=(0,c.AD)();(0,i.z8)((0,a._$)(!0).append(e,(0,l.f9)().append((0,o.BE)()))),e.select()})),!0)),o.VN),e.registerCommand(d,(t=>(e.update((()=>{const e=(0,o.gI)(t);(0,a.rY)(e)&&e.toggleOpen()})),!0)),o.VN))}),[e]),null}},66498:(e,t,n)=>{"use strict";n.d(t,{KG:()=>s,NP:()=>c,dq:()=>i,gD:()=>a,jM:()=>o,wN:()=>l});var r=n(31031);const i=(0,r.fA)("INSERT_FILE_COMMAND"),o=(0,r.fA)("UPLOAD_AND_INSERT_FILE_COMMAND"),s=(0,r.fA)("INSERT_BUBBLE_COMMAND"),a=(0,r.fA)("INSERT_DATETIME_COMMAND"),l=(0,r.fA)("INSERT_PASSWORD_COMMAND"),c=(0,r.fA)("INSERT_REMOTE_IMAGE_COMMAND")},65123:(e,t,n)=>{"use strict";n.d(t,{J:()=>v,Z:()=>b});var r=n(52322),i=n(66498),o=n(47166),s=n(2784),a=n(59786),l=n(31031),c=n(46003),u=n(29016),d=n(92249),h=n(47436),p=n(95768),f=n(48518),g=n(3038),m=n(756),y=n(24118);const v=(0,l.fA)("OPEN_FILE_UPLOAD_MODAL_COMMAND");function A(e){let{onClose:t}=e;const[n]=(0,o.g)(),[a,l]=(0,s.useState)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("input",{type:"file",onChange:e=>{const t=e.target.files;t&&1===t.length&&l(t[0])}}),(0,r.jsx)("div",{className:"mt-1.5 flex justify-end",children:(0,r.jsx)(m.Z,{onClick:()=>{a&&(n.dispatchCommand(i.jM,a),t())},disabled:!a,small:(0,y.Av)(),children:"Upload"})})]})}function b(e){let{currentNote:t}=e;const n=(0,f.I)(),[m]=(0,o.g)(),y=(0,d.o)(),b=(0,p.o)(),[w,S]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{if(!m.hasNodes([a.h]))throw new Error("FilePlugin: FileNode not registered on editor");const e=(e,t)=>{m.update((()=>{const n=(0,c.K5)(e);(0,l.od)([n]),(0,l._v)(n.getParentOrThrow())&&(0,u.JB)(n,l.BE).selectEnd();const r=(0,l.BE)();n.getParentOrThrow().insertAfter(r),r.selectEnd(),m.focus(),t&&t(n)}))};return(0,u.qV)(m.registerCommand(i.dq,(t=>(e(t),!0)),l.VN),m.registerCommand(i.jM,(r=>{const i=t;let o;return y.uploadNewFile(r,{showToast:!1,onUploadStart(t){e(t,(e=>o=e))}}).then((e=>{e?(b.linkItems(i,e),n.changeAndSaveItem.execute(e,(e=>{e.protected=i.protected}))):m.update((()=>null==o?void 0:o.remove()))})).catch(console.error),!0}),l.VN),m.registerCommand(v,(()=>(S(!0),!0)),l.u6),m.registerCommand(l.A1,(e=>{var t;const n=e instanceof ClipboardEvent?null===(t=e.clipboardData)||void 0===t?void 0:t.files:null;return!!(null==n?void 0:n.length)&&((e=>{Array.from(e).forEach((async e=>{m.dispatchCommand(i.jM,e)}))})(n),!0)}),l.u6))}),[n,t,m,y,b]),(0,s.useEffect)((()=>y.addEventObserver(((e,t)=>{if(e===h.p.FileUploadedToNote&&t[h.p.FileUploadedToNote]){const e=t[h.p.FileUploadedToNote].uuid;m.dispatchCommand(i.dq,e)}else if(e===h.p.UploadAndInsertFile&&t[h.p.UploadAndInsertFile]){const{fileOrHandle:e}=t[h.p.UploadAndInsertFile];e instanceof FileSystemFileHandle?e.getFile().then((e=>{m.dispatchCommand(i.jM,e)})).catch(console.error):m.dispatchCommand(i.jM,e)}}))),[y,m]),w?(0,r.jsx)(g.Z,{onClose:()=>S(!1),title:"Upload File",children:(0,r.jsx)(A,{onClose:()=>S(!1)})}):null}},59786:(e,t,n)=>{"use strict";n.d(t,{h:()=>b});var r=n(52322),i=n(20266),o=n(46003),s=n(74667),a=n(2784),l=n(31031),c=n(48518),u=n(25281),d=n(47166),h=n(73055),p=n(34309),f=n(41707),g=n(47436);const m=(0,p.Pi)((function(e){let{className:t,format:n,nodeKey:i,fileUuid:o,zoomLevel:p,setZoomLevel:m}=e;const y=(0,c.I)(),[v]=(0,d.g)(),[A,b]=(0,a.useState)((()=>y.items.findItem(o))),w=y.filesController.uploadProgressMap.get(o),[S,C]=(0,a.useState)(!1),E=(0,a.useRef)(null),I=(0,a.useMemo)((()=>new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting&&C(!0)}))}),{threshold:.25})),[]);(0,a.useEffect)((()=>{const e=E.current;if(e)return I.observe(e),()=>{I.unobserve(e)}}),[I]);const _=(0,a.useCallback)((e=>{v.update((()=>{m(e)}))}),[v,m]),[x,P]=(0,h.y)(i);if((0,a.useEffect)((()=>v.registerCommand(l.Kr,(e=>{var t,n;return!!(null===(t=E.current)||void 0===t?void 0:t.contains(e.target))&&(e.preventDefault(),null===(n=(0,l.gI)(i))||void 0===n||n.selectEnd(),setTimeout((()=>{P(!x)})),!0)}),l.KB)),[v,x,i,P]),(0,a.useEffect)((()=>y.filesController.addEventObserver(((e,t)=>{if(e===g.p.FileUploadFinished&&t[g.p.FileUploadFinished]){const{uploadedFile:e}=t[g.p.FileUploadFinished];e.uuid===o&&b(e)}}))),[y.filesController,o]),w&&(w.progress<100||!A)){const e=w.progress;return(0,r.jsx)(s.U,{className:t,format:n,nodeKey:i,children:(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-4 text-center",ref:E,children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(f.Z,{className:"h-4 w-4"}),'Uploading file "',w.file.name,'"... (',e,"%)"]}),(0,r.jsx)("div",{className:"w-full max-w-[50%] overflow-hidden rounded bg-contrast",children:(0,r.jsx)("div",{className:"h-2 rounded rounded-tl-none bg-info transition-[width] duration-100",role:"progressbar",style:{width:"".concat(e,"%")},"aria-valuenow":e})})]})})}return A?(0,r.jsx)(s.U,{className:t,format:n,nodeKey:i,children:(0,r.jsx)("div",{ref:E,children:S&&(0,r.jsx)(u.Z,{isEmbeddedInSuper:!0,file:A,application:y,imageZoomLevel:p,setImageZoomLevel:_})})}):(0,r.jsx)(s.U,{className:t,format:n,nodeKey:i,children:(0,r.jsxs)("div",{children:["Unable to find file ",o]})})}));function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){A(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function A(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class b extends i.K{static getType(){return"snfile"}static clone(e){return new b(e.__id,e.__format,e.__key,e.__zoomLevel)}static importJSON(e){const t=(0,o.K5)(e.fileUuid);return t.setFormat(e.format),t.setZoomLevel(e.zoomLevel),t}exportJSON(){return v(v({},super.exportJSON()),{},{fileUuid:this.getId(),version:1,type:"snfile",zoomLevel:this.__zoomLevel})}static importDOM(){return{div:e=>e.hasAttribute("data-lexical-file-uuid")?{conversion:o.Dv,priority:2}:null}}exportDOM(){const e=document.createElement("span");e.setAttribute("data-lexical-file-uuid",this.__id);const t=document.createTextNode(this.getTextContent());return e.append(t),{element:e}}constructor(e,t,n,r){super(t,n),this.__id=e,this.__zoomLevel=r||100}getId(){return this.__id}getTextContent(e,t){return"[File: ".concat(this.__id,"]")}setZoomLevel(e){this.getWritable().__zoomLevel=e}decorate(e,t){const n=t.theme.embedBlock||{},i={base:n.base||"",focus:n.focus||""};return(0,r.jsx)(m,{className:i,format:this.__format,nodeKey:this.getKey(),fileUuid:this.__id,zoomLevel:this.__zoomLevel,setZoomLevel:this.setZoomLevel.bind(this)})}}},46003:(e,t,n)=>{"use strict";n.d(t,{Dv:()=>i,K5:()=>o});var r=n(59786);function i(e){const t=e.getAttribute("data-lexical-file-uuid");return t?{node:o(t)}:null}function o(e){return new r.h(e)}},74205:(e,t,n)=>{"use strict";n.d(t,{v9:()=>b,i0:()=>A,Ct:()=>v});var r=n(52322),i=n(20266),o=n(74667),s=n(29894),a=n(47166),l=n(48518),c=n(2784),u=n(46003),d=n(84075),h=n(47931),p=n(41707);const f=e=>{let{className:t,src:n,mimeType:i,fileName:f,format:g,node:m,nodeKey:y}=e;const v=(0,l.I)(),[A]=(0,a.g)(),[b,w]=(0,c.useState)(!1),S=(0,c.useCallback)((async()=>{w(!0);try{const e=await fetch(n).then((e=>e.blob())),t=new File([e],f||v.generateUUID(),{type:i}),{filesController:r,linkingController:o}=v,s=await r.uploadNewFile(t,{showToast:!1});if(!s)return;A.update((()=>{const e=(0,u.K5)(s.uuid);m.replace(e)})),o.linkItemToSelectedItem(s)}catch(e){console.error(e)}finally{w(!1)}}),[v,A,f,i,m,n]),C="application/pdf"===i;return(0,r.jsxs)(o.U,{className:t,format:g,nodeKey:y,children:[i.startsWith("image")?(0,r.jsx)("div",{className:"relative flex min-h-[2rem] flex-col items-center gap-2.5",children:(0,r.jsx)("img",{alt:f,src:n})}):i.startsWith("video")?(0,r.jsx)("video",{className:"h-full w-full",controls:!0,autoPlay:!0,children:(0,r.jsx)("source",{src:n,type:i})}):i.startsWith("audio")?(0,r.jsx)("div",{className:"flex h-full w-full items-center justify-center",children:(0,r.jsx)("audio",{controls:!0,children:(0,r.jsx)("source",{src:n,type:i})})}):(0,r.jsx)("object",{className:(0,s.classNames)("h-full w-full",C&&"min-h-[65vh]"),data:C?n+"#view=FitV":n}),(0,r.jsx)("button",{className:(0,s.classNames)("mx-auto mt-2 flex items-center gap-2.5 rounded border border-border bg-default px-2.5 py-1.5",!b&&"hover:bg-info hover:text-info-contrast"),onClick:()=>{(v.platform===s.Platform.Ios||(0,d.gn)())&&document.activeElement&&document.activeElement.blur(),S().catch(console.error)},disabled:b,children:b?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.Z,{className:"h-4 w-4"}),"Saving..."]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Z,{type:"download"}),"Save to Files"]})})]})};function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function y(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class v extends i.K{static getType(){return"inline-file"}constructor(e,t,n){super(),this.__src=e,this.__mimeType=t,this.__fileName=n}static clone(e){return new v(e.__src,e.__mimeType,e.__fileName)}static importJSON(e){return b(e.src,e.mimeType,e.fileName)}exportJSON(){return m(m({},super.exportJSON()),{},{src:this.__src,mimeType:this.__mimeType,fileName:this.__fileName,version:1,type:"inline-file"})}static importDOM(){return{object:e=>"OBJECT"!==e.tagName?null:{conversion:()=>{if(!(e instanceof HTMLObjectElement))return null;const t=e.type||"application/octet-stream",n=e.getAttribute("data-file-name")||void 0;return{node:b(e.data,t,n)}},priority:2},img:e=>"IMG"!==e.tagName?null:{conversion:()=>{if(!(e instanceof HTMLImageElement))return null;const t=e.getAttribute("data-mime-type")||"image/png",n=e.getAttribute("data-file-name")||e.alt;return{node:b(e.currentSrc||e.src,t,n)}},priority:2},source:e=>{if("SOURCE"!==e.tagName)return null;const t=e.parentElement;return!t||"VIDEO"!==t.tagName&&"AUDIO"!==t.tagName?null:{conversion:()=>{if(!(e instanceof HTMLSourceElement))return null;const n=e.type||"VIDEO"===t.tagName?"video/mp4":"audio/mp3";return{node:b(e.src,n,e.getAttribute("data-file-name")||void 0)}},priority:2}}}}exportDOM(){if(this.__mimeType.startsWith("image/")){const e=document.createElement("img");return e.setAttribute("src",this.__src),e.setAttribute("data-mime-type",this.__mimeType),e.setAttribute("data-file-name",this.__fileName||""),{element:e}}if(this.__mimeType.startsWith("audio")){const e=document.createElement("audio");e.setAttribute("controls",""),e.setAttribute("data-file-name",this.__fileName||"");const t=document.createElement("source");return t.setAttribute("src",this.__src),t.setAttribute("type",this.__mimeType),e.appendChild(t),{element:e}}if(this.__mimeType.startsWith("video")){const e=document.createElement("video");e.setAttribute("controls",""),e.setAttribute("data-file-name",this.__fileName||"");const t=document.createElement("source");return t.setAttribute("src",this.__src),t.setAttribute("type",this.__mimeType),e.appendChild(t),{element:e}}const e=document.createElement("object");return e.setAttribute("data",this.__src),e.setAttribute("type",this.__mimeType),e.setAttribute("data-file-name",this.__fileName||""),{element:e}}getTextContent(){return"".concat(this.__mimeType.startsWith("image/")?"!":"","[").concat(this.__fileName,"](").concat(this.__src,")")}decorate(e,t){const n=t.theme.embedBlock||{},i={base:n.base||"",focus:n.focus||""};return(0,r.jsx)(f,{className:i,format:this.__format,node:this,nodeKey:this.getKey(),src:this.__src,mimeType:this.__mimeType,fileName:this.__fileName})}}function A(e){return e instanceof v}function b(e,t,n){return new v(e,t,n)}},7355:(e,t,n)=>{"use strict";n.d(t,{H:()=>f});var r=n(52322),i=n(31031),o=n(97247),s=n(2784),a=n(48518),l=n(26013),c=n(57751),u=n(95768),d=n(74522),h=n(47166);function p(e){let{itemUuid:t,node:n}=e;const i=(0,a.I)(),[o]=(0,h.g)(),p=(0,u.o)(),f=(0,s.useMemo)((()=>i.items.findItem(t)),[i,t]),{toggleAppPane:g}=(0,d.G)(),m=(0,s.useCallback)((async e=>{const t=await p.activateItem(e);t&&g(t)}),[g,p]),y=(0,s.useCallback)((async e=>{p.unlinkItemFromSelectedItem(e).catch(console.error),o.update((()=>{n.remove()}))}),[p,n,o]);if(!f)return(0,r.jsxs)("div",{children:["Unable to find item ",t]});const v=(0,c.X)(f,"linked");return(0,r.jsx)(l.Z,{className:"mx-0.5",link:v,activateItem:m,unlinkItem:y,isBidirectional:!1,inlineFlex:!0,wrappable:!0},v.id)}class f extends i.Ij{static getType(){return"snbubble"}static clone(e){return new f(e.__id,e.__key)}static importJSON(e){return(0,o.fj)(e.itemUuid)}exportJSON(){return{itemUuid:this.getId(),version:1,type:"snbubble"}}static importDOM(){return{div:e=>e.hasAttribute("data-lexical-item-uuid")?{conversion:o.fD,priority:2}:null}}createDOM(){return document.createElement("span")}exportDOM(){const e=document.createElement("span");e.setAttribute("data-lexical-item-uuid",this.__id);const t=document.createTextNode(this.getTextContent());return e.append(t),{element:e}}updateDOM(){return!1}constructor(e,t){super(t),this.__id=e}getId(){return this.__id}getTextContent(e,t){return"[Item: ".concat(this.__id,"]")}decorate(e){return(0,r.jsx)(p,{node:this,itemUuid:this.__id})}}},97247:(e,t,n)=>{"use strict";n.d(t,{fD:()=>i,fj:()=>o});var r=n(7355);function i(e){const t=e.getAttribute("data-lexical-item-uuid");return t?{node:o(t)}:null}function o(e){return new r.H(e)}},49060:(e,t,n)=>{"use strict";n.d(t,{kx:()=>C,Dq:()=>S,Mf:()=>w});var r=n(52322),i=n(20266),o=n(48518),s=n(47931),a=n(41707),l=n(24118),c=n(74667),u=n(47166),d=n(29894),h=n(31031),p=n(2784),f=n(46003),g=n(84075),m=n(73055);const y=e=>{let{className:t,src:n,alt:i,node:y,format:v,nodeKey:A}=e;const b=(0,o.I)(),[w]=(0,u.g)(),[S,C]=(0,p.useState)(!1),[E,I]=(0,p.useState)(!1),_=(0,p.useCallback)((async()=>{I(!0);try{const e=await fetch(n);if(!e.ok)return;const t=await e.blob(),r=new File([t],n,{type:t.type}),{filesController:i,linkingController:o}=b,s=await i.uploadNewFile(r,{showToast:!1});if(!s)return;w.update((()=>{const e=(0,f.K5)(s.uuid);y.replace(e)})),o.linkItemToSelectedItem(s)}catch(e){console.error(e)}finally{I(!1)}}),[b,w,y,n]),x=n.startsWith("data:"),P=b.isNativeMobileWeb()||(0,l.Z$)()||x,k=(0,p.useRef)(null),[B,O]=(0,m.y)(A);return(0,p.useEffect)((()=>w.registerCommand(h.Kr,(e=>{var t,n;return!!(null===(t=k.current)||void 0===t?void 0:t.contains(e.target))&&(e.preventDefault(),null===(n=(0,h.gI)(A))||void 0===n||n.selectEnd(),setTimeout((()=>{O(!B)})),!0)}),h.KB)),[w,B,A,O]),(0,r.jsx)(c.U,{className:t,format:v,nodeKey:A,children:(0,r.jsxs)("div",{ref:k,className:"relative flex min-h-[2rem] flex-col items-center gap-2.5",children:[(0,r.jsx)("img",{alt:i,src:n,onLoad:()=>{C(!0)}}),S&&P&&(0,r.jsx)("button",{className:(0,d.classNames)("flex items-center gap-2.5 rounded border border-border bg-default px-2.5 py-1.5",!E&&"hover:bg-info hover:text-info-contrast"),onClick:()=>{(b.platform===d.Platform.Ios||(0,g.gn)())&&document.activeElement&&document.activeElement.blur(),_().catch(console.error)},disabled:E,children:E?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Z,{className:"h-4 w-4"}),"Saving..."]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.Z,{type:"download"}),"Save image to Files"]})})]})})};function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function b(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class w extends i.K{static getType(){return"unencrypted-image"}constructor(e,t){super(),this.__src=e,this.__alt=t}static clone(e){return new w(e.__src,e.__alt)}static importJSON(e){return C(e.src,e.alt)}exportJSON(){return A(A({},super.exportJSON()),{},{src:this.__src,alt:this.__alt,version:1,type:"unencrypted-image"})}static importDOM(){return{img:e=>"IMG"!==e.tagName?null:{conversion:()=>e instanceof HTMLImageElement?{node:C(e.currentSrc||e.src,e.alt)}:null,priority:2}}}exportDOM(){const e=document.createElement("img");return this.__alt&&e.setAttribute("alt",this.__alt),e.setAttribute("src",this.__src),{element:e}}getTextContent(){return"![".concat(this.__alt||"image","](").concat(this.__src,")")}decorate(e,t){const n=t.theme.embedBlock||{},i={base:n.base||"",focus:n.focus||""};return(0,r.jsx)(y,{className:i,format:this.__format,nodeKey:this.getKey(),node:this,src:this.__src,alt:this.__alt})}}function S(e){return e instanceof w}function C(e,t){return new w(e,t)}},46513:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f,a:()=>p});var r=n(52322),i=n(47166),o=n(31031),s=n(2784),a=n(66498),l=n(49060),c=n(29016),u=n(13959),d=n(756),h=n(24118);function p(e){let{onClose:t}=e;const[n,o]=(0,s.useState)(""),[l]=(0,i.g)(),c=(0,s.useCallback)((e=>{e&&setTimeout((()=>e.focus()))}),[]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("label",{className:"flex flex-col gap-1.5",children:["URL:",(0,r.jsx)(u.Z,{value:n,onChange:o,ref:c})]}),(0,r.jsx)("div",{className:"mt-2.5 flex justify-end",children:(0,r.jsx)(d.Z,{onClick:()=>{n.length<1||(l.dispatchCommand(a.NP,n),t())},disabled:!n,small:(0,h.Av)(),children:"Confirm"})})]})}function f(){const[e]=(0,i.g)();return(0,s.useEffect)((()=>(0,c.qV)(e.registerCommand(a.NP,(e=>{const t=(0,l.kx)(e);(0,o.od)([t]),(0,o._v)(t.getParentOrThrow())&&(0,c.JB)(t,o.BE).selectEnd();const n=(0,o.BE)();return t.getParentOrThrow().insertAfter(n),!0}),o.u6),e.registerNodeTransform(l.Mf,(e=>{const t=e.getParent();t&&1===t.getChildrenSize()&&(t.insertBefore(e),t.remove())})))),[e]),null}},82931:(e,t,n)=>{"use strict";n.d(t,{V:()=>p,n:()=>h});var r=n(52322),i=n(65268),o=n(31031),s=n(2784),a=n(47166),l=n(29016),c=n(13959),u=n(756),d=n(24118);function h(e){let{activeEditor:t,onClose:n}=e;const[o,a]=(0,s.useState)("5"),[l,h]=(0,s.useState)("5"),p=(0,s.useCallback)((e=>{e&&setTimeout((()=>e.focus()))}),[]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("label",{className:"mb-2.5 flex items-center justify-between gap-3",children:["Rows:",(0,r.jsx)(c.Z,{type:"number",value:o,onChange:a,ref:p})]}),(0,r.jsxs)("label",{className:"mb-2.5 flex items-center justify-between gap-3",children:["Columns:",(0,r.jsx)(c.Z,{type:"number",value:l,onChange:h})]}),(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsx)(u.Z,{onClick:()=>{t.dispatchCommand(i.bF,{columns:l,rows:o}),n()},small:(0,d.Av)(),children:"Confirm"})})]})}function p(){const[e]=(0,a.g)();return(0,s.useEffect)((()=>(0,l.qV)(e.registerNodeTransform(i.g0,(e=>{e.getFirstChild()||e.remove()})),e.registerNodeTransform(i.Fh,(e=>{e.getFirstChild()||e.remove();const t=!!e.getNextSibling(),n=!!e.getPreviousSibling();e.getParent()&&(t?n||e.insertBefore((0,o.BE)()):e.insertAfter((0,o.BE)()))})))),[e]),null}},79014:(e,t,n)=>{"use strict";n.d(t,{H:()=>l,Z:()=>c});var r=n(47166),i=n(29016),o=n(31031),s=n(2784),a=n(43800);const l=(0,o.fA)("INSERT_TWEET_COMMAND");function c(){const[e]=(0,r.g)();return(0,s.useEffect)((()=>{if(!e.hasNodes([a.je]))throw new Error("TwitterPlugin: TweetNode not registered on editor");return e.registerCommand(l,(e=>{const t=(0,a.m2)(e);return(0,i.z8)(t),!0}),o.VN)}),[e]),null}},93559:(e,t,n)=>{"use strict";n.d(t,{A:()=>l,Z:()=>c});var r=n(47166),i=n(29016),o=n(31031),s=n(2784),a=n(59179);const l=(0,o.fA)("INSERT_YOUTUBE_COMMAND");function c(){const[e]=(0,r.g)();return(0,s.useEffect)((()=>{if(!e.hasNodes([a.gL]))throw new Error("YouTubePlugin: YouTubeNode not registered on editor");return e.registerCommand(l,(e=>{const t=(0,a.kU)(e);return(0,i.z8)(t),!0}),o.VN)}),[e]),null}},91031:(e,t,n)=>{"use strict";n.d(t,{S:()=>o,a:()=>i});var r=n(31031);function i(e,t){return e.length<=t?e:e.substring(0,t)+"..."}function o(e,t,n){const o=(0,r.Gv)().getAllTextNodes().slice(0,2);let s="";o.forEach(((e,t)=>{s+=e.getTextContent(),t!==o.length-1&&(s+="\n")})),t&&(s=i(s,t));try{const t=JSON.stringify(e.toJSON());null==n||n(t,s)}catch(e){console.error(e),window.alert("An invalid change was made inside the Super editor. Your change was not saved. Please report this error to the team: ".concat(JSON.stringify(e)))}}},88669:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(52322),i=n(96332),o=n(57189),s=n(29894);const a=e=>{let{checked:t,onChange:n,className:a,disabled:l=!1,tabIndex:c,forceDesktopStyle:u,children:d}=e;const h=t&&!l;return(0,r.jsxs)("label",{className:(0,s.classNames)(l?"opacity-50":"",a),children:[(0,r.jsx)(i.T,{children:(0,r.jsx)(o.X,{checked:t,onChange:e=>{n(e.target.checked)},tabIndex:c})}),(0,r.jsx)("div",{className:(0,s.classNames)("relative box-content inline-block flex-shrink-0 cursor-pointer rounded-full border-2 border-solid border-transparent bg-clip-padding transition-colors duration-150 ease-out","ring-2 ring-transparent focus-within:border-default focus-within:shadow-none focus-within:outline-none focus-within:ring-info",h?"bg-info":"bg-neutral",u?"h-4.5 w-8":"h-7 w-12 md:h-4.5 md:w-8"),children:(0,r.jsx)("div",{className:(0,s.classNames)("absolute top-1/2 block -translate-y-1/2 rounded-full bg-default transition-transform duration-150 ease-out",u?"left-[2px] h-3.5 w-3.5":"left-[0.15rem] h-6 w-6 md:left-[2px] md:h-3.5 md:w-3.5",t?u?"translate-x-[calc(2rem-1.125rem)]":"translate-x-[calc(3.25rem-1.5rem-0.5rem)] md:translate-x-[calc(2rem-1.125rem)]":"")})}),d]})}},4160:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(52322),i=n(47931);const o=e=>{let{contact:t}=e;return(0,r.jsxs)("div",{title:"Last edited by",className:"flex select-none items-center rounded bg-info px-1.5 py-1 text-info-contrast",children:[(0,r.jsx)(i.Z,{ariaLabel:"Shared by",type:"pencil",className:"mr-1 text-info-contrast",size:"medium"}),(0,r.jsx)("span",{className:"mr-auto overflow-hidden text-ellipsis text-sm font-semibold lg:text-xs",children:t.name})]})}},69170:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(52322),i=n(47931);const o=e=>{let{vault:t}=e;return(0,r.jsxs)("div",{title:"Vault name",className:"flex select-none items-center rounded border border-passive-2 px-1.5 py-1",children:[(0,r.jsx)(i.Z,{ariaLabel:"Shared in vault",type:t.iconString,className:"mr-1",size:"medium",emojiSize:"small"}),(0,r.jsx)("span",{className:"mr-auto overflow-hidden text-ellipsis text-sm font-semibold lg:text-xs",children:t.name})]})}},88450:(e,t,n)=>{"use strict";n.d(t,{CU:()=>s,Cp:()=>b,G9:()=>y,HF:()=>a,IN:()=>v,KX:()=>p,Mk:()=>A,Uj:()=>f,WB:()=>r,Wh:()=>o,Yx:()=>d,ZL:()=>l,gu:()=>h,jD:()=>u,l9:()=>g,t2:()=>m,xi:()=>i,z6:()=>c});const r="notes",i="navigation",o=/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/,s=/^([a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?)$/,a=-1,l=200,c=1e3,u=864e5,d=7,h=365,p=1e6,f="Tag folders",g="A Plus or Pro plan is required to enable Tag folders.",m="Smart Tags",y=/^(?=.*Chrome).*/i.test(navigator.userAgent),v={icon:"file-doc",subtleIcon:"format-align-left",iconClassName:"text-accessory-tint-1",iconTintNumber:1},A=(()=>{let e=!1;try{const t=Object.defineProperty({},"passive",{get:()=>{e=!0}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}return e})(),b=1.5*p},72435:(e,t,n)=>{"use strict";n.d(t,{N:()=>r});const r={ContentList:"notes-scrollable",EditorColumn:"editor-column",EditorContent:"editor-content",FileTextPreview:"file-text-preview",FileTitleEditor:"file-title-editor",ItemsColumn:"items-column",NavigationColumn:"navigation",NoteTextEditor:"note-text-editor",NoteTitleEditor:"note-title-editor",NoteOptionsButton:"note-options-button",RootId:"app-group-root",NoteStatusTooltip:"note-status-tooltip",ItemLinkAutocompleteInput:"item-link-autocomplete-input",SearchBar:"search-bar",ConflictResolutionButton:"conflict-resolution-button",SuperEditor:"super-editor"}},39537:(e,t,n)=>{"use strict";n.d(t,{$n:()=>a,CN:()=>g,Cp:()=>I,FG:()=>S,I0:()=>B,JT:()=>x,KV:()=>y,L0:()=>u,Lw:()=>s,OW:()=>h,PJ:()=>_,Sq:()=>p,X0:()=>f,X5:()=>P,YQ:()=>c,ZW:()=>O,Zh:()=>b,ac:()=>d,eI:()=>j,eh:()=>N,fv:()=>w,hy:()=>C,ip:()=>E,j0:()=>k,nS:()=>A,ng:()=>v,p7:()=>D,xU:()=>l,xZ:()=>T,zR:()=>o,zu:()=>m});var r=n(29894),i=n(24118);const o="There was an error syncing. Please try again. If all else fails, try signing out and signing back in.",s="A new update is ready to install. Please use the top-level 'Updates' menu to manage installation.",a="Are you sure you want to delete this tag? Deleting a tag will not delete its subtags or its notes.",l="This note is a placeholder and cannot be deleted. To remove from your list, simply navigate to a different note.",c="This note had editing disabled. If you'd like to delete it, enable editing, and try again.",u="This note has editing disabled. If you'd like to edit its options, enable editing, and try again.",d="This note has editing disabled. If you'd like to restore it to a previous revision, enable editing and try again.";function h(e,t){return t?"Are you sure you want to permanently delete ".concat(e,"?"):"Are you sure you want to move ".concat(e," to the trash?")}function p(e){return"Are you sure you want to permanently delete ".concat(e," note(s)?")}const f="This action will remove this workspace and its related data from this device. Your synced data will not be affected.",g="End-to-end encryption is enabled. Your data is encrypted on your device first, then synced to your private cloud.",m="Encryption is enabled. Your data is encrypted using your passcode before it is saved to your device storage.",y="Encryption is not enabled. Sign in, register, or add a passcode lock to enable encryption.",v="Your data has been successfully imported.",A="The two passcodes you entered do not match. Please try again.",b="The two passwords you entered do not match. Please try again.",w="Unable to open file. Ensure it is a proper JSON file and try again.",S="The file you selected is not a valid backup file. Please extract the contents of the zip file, then upload the contained .txt file.";function C(e){return"Import complete. ".concat(e," items were not imported because there was an error decrypting them. Make sure the password is correct and try again.")}const E="This backup file was created using an unsupported version of the application and cannot be imported here. Please update your application and try again.",I="The encryption upgrade is in progress. You may lose data if you quit the app. Are you sure you want to quit?",_="A passcode change is in progress. You may lose data if you quit the app. Are you sure you want to quit?",x="A passcode removal is in progress. You may lose data if you quit the app. Are you sure you want to quit?",P="Encryption upgrade available",k='Encryption version 004 is available. This version strengthens the encryption algorithms your account and local storage use. To learn more about this upgrade, visit our <a href="https://standardnotes.com/help/security" target="_blank">Security Upgrade page.</a>',B="Upgrade",O="This will delete the previously saved offline key.",N="Are you sure you want to permanently delete your account? You will be asked to confirm your account password in the next step. If you have an active paid subscription, cancel the subscription first. Otherwise, if you'd like to keep the subscription, you can re-register with the same email after deletion, and your subscription will be linked back up with your account.",D="There was an error while trying to update your settings. Please try again.",j={protectingNoteWithoutProtectionSources:"Access to this note will not be restricted until you set up a passcode or account.",trashItemsTitle:"Move to Trash",deleteItemsPermanentlyTitle:"Delete Permanently",trashNotesText:"Are you sure you want to move these notes to the trash?",trashFilesText:"Are you sure you want to move these files to the trash?",enterPasscode:"Please enter a passcode.",deleteMultipleFiles:"Are you sure you want to permanently delete these files?"},T={keyStorageInfo(e){if(!(0,i.Z$)())return null;if(!e.hasAccount())return null;const t=(0,i.Xf)(e.device),n=t===r.Platform.WindowsDesktop?"credential manager":t===r.Platform.MacDesktop?"keychain":"password manager";return"Your keys are currently stored in your operating system's ".concat(n,". Adding a passcode prevents even your operating system from reading them.")},deleteNotes(e){let t=arguments.length>2?arguments[2]:void 0;return 1===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1)?e?"Are you sure you want to permanently delete ".concat(t,"?"):"Are you sure you want to move ".concat(t," to the trash?"):e?"Are you sure you want to permanently delete these notes?":"Are you sure you want to move these notes to the trash?"},deleteFile:e=>"Are you sure you want to permanently delete ".concat(e,"?"),archiveLockedNotesAttempt(e){const t=e?"archive":"unarchive";return 1===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1)?"This note has editing disabled. If you'd like to ".concat(t," it, enable editing, and try again."):"One or more of these notes have editing disabled. If you'd like to ".concat(t," them, make sure editing is enabled on all of them, and try again.")},deleteLockedNotesAttempt(){return 1===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1)?"This note has editing disabled. If you'd like to delete it, enable editing, and try again.":"One or more of these notes have editing disabled. If you'd like to delete them, make sure editing is enabled on all of them, and try again."}}},97638:(e,t,n)=>{"use strict";n.d(t,{t:()=>r});const r="w-6 h-6 md:w-5 md:h-5"},91583:(e,t,n)=>{"use strict";n.d(t,{Ab:()=>o,sU:()=>r,zj:()=>i});const r="3.195.12",i=null!=window.electronRemoteBridge,o=null==window.electronRemoteBridge},23995:(e,t,n)=>{"use strict";n.d(t,{L:()=>i});var r=n(29894);class i{constructor(e){this.eventBus=e,this.dealloced=!1,this.disposers=[],this.eventObservers=[]}async publishCrossControllerEventSync(e,t){await this.eventBus.publishSync({type:e,payload:t},r.InternalEventPublishStrategy.SEQUENCE)}deinit(){this.dealloced=!0,this.eventBus=void 0;for(const e of this.disposers)e();this.disposers=void 0,this.eventObservers.length=0}addEventObserver(e){return this.eventObservers.push(e),()=>{(0,r.removeFromArray)(this.eventObservers,e)}}notifyEvent(e,t){this.eventObservers.forEach((n=>n(e,t)))}}},47436:(e,t,n)=>{"use strict";n.d(t,{p:()=>A,y:()=>b});var r=n(87985),i=n(87978),o=n(88450),s=n(84075),a=n(39537),l=n(22826),c=n(54310),u=n(87901),d=n(29894),h=n(54569),p=n(80075),f=n(23995),g=n(55088),m=n(91031);const y=[i.d.ToggleFileProtection],v=[i.d.DownloadFile,i.d.PreviewFile];var A;!function(e){e.FileUploadedToNote="FileUploadedToNote",e.FileUploadFinished="FileUploadFinished",e.UploadAndInsertFile="UploadAndInsertFile"}(A||(A={}));class b extends f.L{deinit(){super.deinit(),this.notesController=void 0,this.filePreviewModalController=void 0}constructor(e,t,r,f,g,A,b,w,S,C,E,I,_,x,P){super(P),this.notesController=e,this.filePreviewModalController=t,this.archiveService=r,this.vaultDisplayService=f,this.vaults=g,this.items=A,this.files=b,this.mutator=w,this.sync=S,this.protections=C,this.alerts=E,this.platform=I,this.mobileDevice=_,this._isNativeMobileWeb=x,this.allFiles=[],this.attachedFiles=[],this.showFileContextMenu=!1,this.showProtectedOverlay=!1,this.fileContextMenuLocation={x:0,y:0},this.shouldUseStreamingAPI=c.A7.available(),this.reader=this.shouldUseStreamingAPI?c.KC:c.Re,this.maxFileSize=this.reader.maximumFileSize(),this.uploadProgressMap=new Map,this.setShowFileContextMenu=e=>{this.showFileContextMenu=e},this.setShowProtectedOverlay=e=>{this.showProtectedOverlay=e},this.setFileContextMenuLocation=e=>{this.fileContextMenuLocation=e},this.reloadAllFiles=()=>{this.allFiles=this.items.getDisplayableFiles()},this.reloadAttachedFiles=()=>{const e=this.notesController.firstSelectedNote;e&&(this.attachedFiles=this.items.itemsReferencingItem(e).filter(d.isFile))},this.deleteFile=async e=>{if(await(0,s.VG)({text:'Are you sure you want to permanently delete "'.concat(e.name,'"?'),confirmButtonStyle:"danger"})){const t=(0,h.fz)({type:h.pC.Loading,message:'Deleting file "'.concat(e.name,'"...')});await this.files.deleteFile(e),(0,h.fz)({type:h.pC.Success,message:'Deleted file "'.concat(e.name,'"')}),(0,h.Xd)(t)}},this.attachFileToSelectedNote=async e=>{const t=this.notesController.firstSelectedNote;t?(await this.mutator.associateFileWithNote(e,t),this.sync.sync()):(0,h.fz)({type:h.pC.Error,message:"Could not attach file because selected note was deleted"})},this.detachFileFromNote=async e=>{const t=this.notesController.firstSelectedNote;t?(await this.mutator.disassociateFileWithNote(e,t),this.sync.sync()):(0,h.fz)({type:h.pC.Error,message:"Could not attach file because selected note was deleted"})},this.toggleFileProtection=async e=>{let t;return t=e.protected?await this.protections.unprotectFile(e):await this.protections.protectFile(e),this.sync.sync(),t?t.protected:e.protected},this.authorizeProtectedActionForFile=async(e,t)=>{const n=await this.protections.authorizeProtectedActionForItems([e],t);return n.length>0&&n.includes(e)},this.renameFile=async(e,t)=>{await this.mutator.renameFile(e,t),this.sync.sync()},this.handleFileAction=async e=>{const t=e.payload.file;let n=!0;if(t.protected&&!y.includes(e.type)&&(n=await this.authorizeProtectedActionForFile(t,d.ChallengeReason.AccessProtectedFile)),!n)return{didHandleAction:!1};switch(e.type){case i.d.AttachFileToNote:await this.attachFileToSelectedNote(t);break;case i.d.DetachFileToNote:await this.detachFileFromNote(t);break;case i.d.DeleteFile:await this.deleteFile(t);break;case i.d.DownloadFile:await this.downloadFile(t,e.payload.directoryHandle);break;case i.d.ToggleFileProtection:{const n=await this.toggleFileProtection(t);e.callback(n);break}case i.d.RenameFile:await this.renameFile(t,e.payload.name);break;case i.d.PreviewFile:this.filePreviewModalController.activate(t,e.payload.otherFiles)}return v.includes(e.type)||this.sync.sync().catch(console.error),{didHandleAction:!0}},this.getFileBlob=async e=>{const t=[];if(await this.files.downloadFile(e,(async e=>{t.push(e)})))return;const n=(0,l.L)(t);return new Blob([n],{type:e.mimeType})},this.alertIfFileExceedsSizeLimit=e=>!!(!this.shouldUseStreamingAPI&&this.maxFileSize&&e.size>=this.maxFileSize)&&(this.alerts.alert("This file exceeds the limits supported in this browser. To upload files greater than ".concat(this.maxFileSize/o.KX,"MB, please use the desktop application or the Chrome browser."),'Cannot upload file "'.concat(e.name,'"')).catch(console.error),!0),this.deleteFilesPermanently=async e=>{const t=a.eI.trashItemsTitle,n=1===e.length?a.xZ.deleteFile(e[0].name):a.eI.deleteMultipleFiles;await(0,s.VG)({title:t,text:n,confirmButtonStyle:"danger"})&&(await Promise.all(e.map((e=>this.files.deleteFile(e)))),this.sync.sync())},this.setProtectionForFiles=async(e,t)=>{e?await this.protections.protectItems(t)&&this.setShowProtectedOverlay(!0):await this.protections.unprotectItems(t,d.ChallengeReason.UnprotectFile)&&this.setShowProtectedOverlay(!1),this.sync.sync()},this.getDirectoryHandleForDownloads=async()=>{if(this.shouldUseStreamingAPI)return await window.showDirectoryPicker({startIn:"downloads"})},this.downloadFiles=async e=>{if(this.platform!==d.Platform.MacDesktop&&this.platform!==d.Platform.MacWeb)await Promise.all(e.map((e=>this.handleFileAction({type:i.d.DownloadFile,payload:{file:e}}))));else{let t;if(e.length>1)try{t=await this.getDirectoryHandleForDownloads()}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return;console.error(e)}for(const n of e)await this.handleFileAction({type:i.d.DownloadFile,payload:{file:n,directoryHandle:t}})}},this.downloadFilesAsZip=async e=>{if(!this.shouldUseStreamingAPI)throw new Error("Device does not support streaming API");const t=e.filter((e=>e.protected));if(t.length>0&&0===(await this.protections.authorizeProtectedActionForItems(t,d.ChallengeReason.AccessProtectedFile)).length)throw new Error("Authorization is required to download protected files");const r=await window.showSaveFilePicker({types:[{description:"ZIP file",accept:{"application/zip":[".zip"]}}]}),i=(0,h.fz)({type:h.pC.Progress,title:"Downloading ".concat(e.length," files as archive"),message:"Preparing archive..."});try{const t=await n.e(612).then(n.bind(n,75612)),o=await r.createWritable(),s=new t.ZipWriter(o,{level:0}),a=[];for(const t of e){const e=new TransformStream;let n=(0,u.parseAndCreateZippableFileName)(t.name);a.includes(n)&&(n="".concat(Date.now()," ").concat(n)),s.add(n,e.readable).catch(console.error),a.push(n);const r=e.writable.getWriter();await this.files.downloadFile(t,(async(e,n)=>{await r.write(e),(0,h.es)(i,{message:'Downloading "'.concat((0,m.a)(t.name,25),'"'),progress:Math.floor(n.percentComplete)})})).catch(console.error),await r.close()}await s.close()}finally{(0,h.Xd)(i)}(0,h.fz)({type:h.pC.Success,message:"Successfully downloaded ".concat(e.length," files as archive")})},(0,p.rC)(this,{allFiles:p.LO,attachedFiles:p.LO,showFileContextMenu:p.LO,fileContextMenuLocation:p.LO,showProtectedOverlay:p.LO,reloadAllFiles:p.aD,reloadAttachedFiles:p.aD,setShowFileContextMenu:p.aD,setShowProtectedOverlay:p.aD,setFileContextMenuLocation:p.aD,uploadProgressMap:p.LO}),this.disposers.push(A.streamItems(d.ContentType.TYPES.File,(()=>{this.reloadAllFiles(),this.reloadAttachedFiles()}))),this.disposers.push((0,p.U5)((()=>e.selectedNotes),(()=>{this.reloadAttachedFiles()})))}async downloadFile(e,t){let n="",i=!1;this.mobileDevice&&this.platform===d.Platform.Android&&(i=await this.mobileDevice.canDisplayNotifications());try{const o=this.shouldUseStreamingAPI?new c.A7(e.name):new c.N4,s=o instanceof c.A7;if(s){const n=t?await t.getFileHandle(e.name,{create:!0}):void 0;await o.selectFileToSaveTo(n)}n=this.mobileDevice&&i?await this.mobileDevice.displayNotification({title:'Downloading file "'.concat(e.name,'"'),android:{progress:{max:100,current:0,indeterminate:!0},onlyAlertOnce:!0}}):(0,h.fz)({type:h.pC.Progress,message:'Downloading file "'.concat(e.name,'" (0%)'),progress:0});const a=[];let u;const p=await this.files.downloadFile(e,(async(t,l)=>{s?await o.pushBytes(t):a.push(t);const c=Math.floor(l.percentComplete);this.mobileDevice&&i?this.mobileDevice.displayNotification({id:n,title:'Downloading file "'.concat(e.name,'"'),android:{progress:{max:100,current:c,indeterminate:!1},onlyAlertOnce:!0}}).catch(console.error):(0,h.es)(n,{message:(0,r.Qc)(l,e.name,{showPercent:!0}),progress:c}),u=l}));if(p instanceof d.ClientDisplayableError)throw new Error(p.text);if(s)await o.finish();else{const t=(0,l.L)(a),n=new Blob([t],{type:e.mimeType});await(0,g.c)({archiveService:this.archiveService,platform:this.platform,mobileDevice:this.mobileDevice,blob:n,filename:e.name,isNativeMobileWeb:this._isNativeMobileWeb.execute().getValue(),showToastOnAndroid:!1})}this.mobileDevice&&i?await this.mobileDevice.displayNotification({title:'Successfully downloaded file "'.concat(e.name,'"')}):(0,h.fz)({type:h.pC.Success,message:"Successfully downloaded file".concat(u&&"local"===u.source?" from local backup":"")})}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return;console.error(e),(0,h.fz)({type:h.pC.Error,message:"There was an error while downloading the file"})}n&&(this.mobileDevice&&i?this.mobileDevice.cancelNotification(n).catch(console.error):(0,h.Xd)(n))}async selectAndUploadNewFiles(e,t){(await this.reader.selectFiles()).forEach((async n=>{if(this.alertIfFileExceedsSizeLimit(n))return;const r=await this.uploadNewFile(n,{note:e});r&&t&&t(r)}))}async uploadNewFile(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{showToast:n=!0,note:r,onUploadStart:o,onUploadFinish:s}=t;let a,l=!1;n&&this.mobileDevice&&this.platform===d.Platform.Android&&(l=await this.mobileDevice.canDisplayNotifications());try{const t=this.files.minimumChunkSize(),c=e instanceof File?e:e instanceof FileSystemFileHandle&&this.shouldUseStreamingAPI?await e.getFile():void 0;if(!c)return;if(this.alertIfFileExceedsSizeLimit(c))return;const p=d.UuidGenerator.GenerateUuid();this.uploadProgressMap.set(p,{file:c,progress:0}),o&&o(p);const f=r?this.vaults.getItemVault(r):void 0,g=await this.files.beginNewFileUpload(c.size,f||this.vaultDisplayService.exclusivelyShownVault);if(g instanceof d.ClientDisplayableError)throw(0,h.fz)({type:h.pC.Error,message:"Unable to start upload session"}),new Error("Unable to start upload session");const m=g.getProgress().percentComplete;this.uploadProgressMap.set(p,{file:c,progress:m}),n&&(a=this.mobileDevice&&l?await this.mobileDevice.displayNotification({title:'Uploading file "'.concat(c.name,'"'),android:{progress:{max:100,current:m,indeterminate:!0},onlyAlertOnce:!0}}):(0,h.fz)({type:h.pC.Progress,message:'Uploading file "'.concat(c.name,'" (').concat(m,"%)"),progress:m}));const y=async e=>{let{data:t,index:n,isLast:r}=e;await this.files.pushBytesForUpload(g,t,n,r);const i=Math.round(g.getProgress().percentComplete);this.uploadProgressMap.set(p,{file:c,progress:i}),a&&(this.mobileDevice&&l?await this.mobileDevice.displayNotification({id:a,title:'Uploading file "'.concat(c.name,'"'),android:{progress:{max:100,current:i,indeterminate:!1},onlyAlertOnce:!0}}):(0,h.es)(a,{message:'Uploading file "'.concat(c.name,'" (').concat(i,"%)"),progress:i}))},v=await this.reader.readFile(c,t,y);if(!v.mimeType){const{ext:e}=(0,u.parseFileName)(c.name);v.mimeType=await this.archiveService.getMimeType(e)}const b=await this.files.finishUpload(g,v,p);if(b instanceof d.ClientDisplayableError)throw(0,h.fz)({type:h.pC.Error,message:b.text}),new Error(b.text);return s&&s(),this.notifyEvent(A.FileUploadFinished,{[A.FileUploadFinished]:{uploadedFile:b}}),a&&(this.mobileDevice&&l&&this.mobileDevice.cancelNotification(a).catch(console.error),(0,h.Xd)(a)),n&&(this.mobileDevice&&l?this.mobileDevice.displayNotification({id:b.uuid,title:'Uploaded file "'.concat(b.name,'"'),android:{actions:[{title:"Open",pressAction:{id:"open-file"}}]}}).catch(console.error):(0,h.fz)({type:h.pC.Success,message:'Uploaded file "'.concat(b.name,'"'),actions:[{label:"Open",handler:e=>{this.handleFileAction({type:i.d.PreviewFile,payload:{file:b}}),(0,h.Xd)(e)}}],autoClose:!0})),b}catch(e){console.error(e),a&&(this.mobileDevice&&l&&this.mobileDevice.cancelNotification(a).catch(console.error),(0,h.Xd)(a)),this.mobileDevice&&l?this.mobileDevice.displayNotification({title:"There was an error while uploading the file"}).catch(console.error):(0,h.fz)({type:h.pC.Error,message:"There was an error while uploading the file"})}}notifyObserversOfUploadedFileLinkingToCurrentNote(e){this.notifyEvent(A.FileUploadedToNote,{[A.FileUploadedToNote]:{uuid:e}})}uploadAndInsertFileToCurrentNote(e){this.notifyEvent(A.UploadAndInsertFile,{[A.UploadAndInsertFile]:{fileOrHandle:e}})}}},92249:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c,o:()=>a});var r=n(52322),i=n(2784),o=n(34309);const s=(0,i.createContext)(void 0),a=()=>{const e=(0,i.useContext)(s);if(!e)throw new Error("Component must be a child of <FilesControllerProvider />");return e},l=(0,i.memo)((e=>{let{children:t}=e;return(0,r.jsx)(r.Fragment,{children:t})})),c=(0,o.Pi)((e=>{let{controller:t,children:n}=e;return(0,r.jsx)(s.Provider,{value:t,children:(0,r.jsx)(l,{children:n})})}))},95768:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c,o:()=>a});var r=n(52322),i=n(2784),o=n(34309);const s=(0,i.createContext)(void 0),a=()=>{const e=(0,i.useContext)(s);if(!e)throw new Error("Component must be a child of <LinkingControllerProvider />");return e},l=(0,i.memo)((e=>{let{children:t}=e;return(0,r.jsx)(r.Fragment,{children:t})})),c=(0,o.Pi)((e=>{let{controller:t,children:n}=e;return(0,r.jsx)(s.Provider,{value:t,children:(0,r.jsx)(l,{children:n})})}))},61659:(e,t,n)=>{"use strict";n.d(t,{I:()=>h});var r=n(22325),i=n(29894),o=n(87901),s=n(88450);const a={Desktop:350,ImmediateChange:100,NativeMobileWeb:700,LargeNote:60*s.z6};var l=n(80075);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class h{constructor(e,t,n,r,i,o,s){this.item=e,this.items=t,this.mutator=n,this.sessions=r,this.sync=i,this.alerts=o,this._isNativeMobileWeb=s,this.savingLocallyPromise=null,this.status=void 0,(0,l.rC)(this,{status:l.LO,setStatus:l.aD})}setStatus(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.statusChangeTimeout&&clearTimeout(this.statusChangeTimeout),t?this.statusChangeTimeout=setTimeout((()=>{(0,l.z)((()=>{this.status=e}))}),400):this.status=e}showSavingStatus(){this.setStatus({type:"saving",message:"Saving…"},!1)}showAllChangesSavedStatus(){this.setStatus({type:"saved",message:"All changes saved"+(this.sessions.isSignedOut()?" offline":"")})}showWaitingToSyncLargeNoteStatus(){this.setStatus({type:"waiting",message:"Note is too large",description:"It will be synced less often. Changes will be saved offline normally."},!1)}showErrorStatus(e){e||(e={type:"error",message:"Sync Unreachable",description:"Changes saved offline"}),this.setStatus(e)}setItem(e){this.item=e}deinit(){this.syncTimeout&&clearTimeout(this.syncTimeout),this.largeNoteSyncTimeout&&clearTimeout(this.largeNoteSyncTimeout),this.statusChangeTimeout&&clearTimeout(this.statusChangeTimeout),this.savingLocallyPromise&&this.savingLocallyPromise.reject(),this.savingLocallyPromise=null,this.largeNoteSyncTimeout=void 0,this.syncTimeout=void 0,this.status=void 0,this.statusChangeTimeout=void 0,this.item=void 0}isLargeNote(e){return new Blob([e]).size>s.Cp}async saveAndAwaitLocalPropagation(e){this.savingLocallyPromise=(0,o.Deferred)(),this.syncTimeout&&clearTimeout(this.syncTimeout);const t=e.bypassDebouncer||this.sessions.isSignedOut()?a.ImmediateChange:this._isNativeMobileWeb.execute().getValue()?a.NativeMobileWeb:a.Desktop;return new Promise((n=>{const r=this.isLargeNote(e.text?e.text:this.item.text);r&&(this.showWaitingToSyncLargeNoteStatus(),this.queueLargeNoteSyncIfNeeded()),this.syncTimeout=setTimeout((()=>{this.undebouncedMutateAndSync(u(u({},e),{},{localOnly:r,onLocalPropagationComplete:()=>{this.savingLocallyPromise&&this.savingLocallyPromise.resolve(),n()}}))}),t)}))}queueLargeNoteSyncIfNeeded(){if(void 0===this.largeNoteSyncTimeout){const e=this.sessions.isSignedIn()?a.LargeNote:a.ImmediateChange;this.largeNoteSyncTimeout=setTimeout((()=>{this.largeNoteSyncTimeout=void 0,this.performSyncOfLargeItem()}),e)}}async performSyncOfLargeItem(){const e=this.items.findItem(this.item.uuid);e&&e.dirty&&this.sync.sync()}async undebouncedMutateAndSync(e){var t;this.items.findItem(this.item.uuid)?(await this.mutator.changeItem(this.item,(t=>{const n=t;if(e.customMutate&&e.customMutate(n),null!=e.title&&(n.title=e.title),null!=e.text&&(n.text=e.text),e.previews)n.preview_plain=e.previews.previewPlain,n.preview_html=e.previews.previewHtml;else if(!e.dontGeneratePreviews&&null!=e.text){const t=e.text||"",r=t.length>160,i=t.substring(0,160)+(r?"...":"");n.preview_plain=i,n.preview_html=void 0}}),e.isUserModified?r.MutationType.UpdateUserTimestamps:r.MutationType.NoUpdateUserTimestamps),this.sync.sync({mode:e.localOnly?i.SyncMode.LocalOnly:void 0}),this.queueLargeNoteSyncIfNeeded(),null===(t=e.onLocalPropagationComplete)||void 0===t||t.call(e)):this.alerts.alert(i.InfoStrings.InvalidNote)}syncOnlyIfLargeNote(){this.isLargeNote(this.item.text)&&this.performSyncOfLargeItem()}}},74455:(e,t,n)=>{"use strict";var r;n.d(t,{h:()=>r}),function(e){e.TagSelection="tag-selection",e.ItemSelection="item-selection",e.TableView="files-view",e.Editing="editing"}(r||(r={}))},7453:(e,t,n)=>{"use strict";function r(e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}n.d(t,{l:()=>r})},66724:(e,t,n)=>{"use strict";n.d(t,{m:()=>o});var r=n(52322),i=n(2784);const o=(e,t)=>((0,i.useEffect)((()=>{function n(n){var r,i;e&&n.origin===new URL(e).origin&&(null===(i=null===(r=null==n?void 0:n.data)||void 0===r?void 0:r.type)||void 0===i?void 0:i.includes("captcha"))&&t(n.data.token)}return window.addEventListener("message",n),()=>{window.removeEventListener("message",n)}}),[t]),e?(0,r.jsx)("iframe",{src:e,height:480}):null)},32810:(e,t,n)=>{"use strict";n.d(t,{g:()=>o,l:()=>i});var r=n(2784);const i=function(e){let{updateOnWindowResize:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{updateOnWindowResize:!1};const[n,i]=(0,r.useState)();return(0,r.useEffect)((()=>{let n;if(e){const r=new ResizeObserver((()=>{i(e.getBoundingClientRect())}));return r.observe(e),t&&(n=()=>{window.clearTimeout(void 0),window.setTimeout((()=>{i(e.getBoundingClientRect())}),100)},window.addEventListener("resize",n)),()=>{r.unobserve(e),n&&window.removeEventListener("resize",n)}}i(void 0)}),[e,t]),n},o=(e,t)=>{(0,r.useEffect)((()=>{let n;if(e){const r=new ResizeObserver((()=>{t()}));return r.observe(e),n=()=>{window.clearTimeout(void 0),window.setTimeout((()=>{t()}),100)},window.addEventListener("resize",n),()=>{r.unobserve(e),window.removeEventListener("resize",n)}}}),[e,t])}},20153:(e,t,n)=>{"use strict";n.d(t,{f:()=>a});var r=n(48518),i=n(95768),o=n(29894),s=n(2784);const a=e=>{const t=(0,r.I)(),n=(0,i.o)(),{getLinkedNotesForItem:a,getNotesLinkingToItem:l,getFilesLinksForItem:c,getLinkedTagsForItem:u}=n,[,d]=(0,s.useState)(Date.now()),h=a(e)||[],p=l(e)||[],{filesLinkedToItem:f,filesLinkingToItem:g}=c(e),m=u(e)||[];return(0,s.useEffect)((()=>t.items.streamItems([o.ContentType.TYPES.Note,o.ContentType.TYPES.File,o.ContentType.TYPES.Tag],(()=>{d(Date.now())}))),[t]),{notesLinkedToItem:h,notesLinkingToItem:p,filesLinkedToItem:f,filesLinkingToItem:g,tagsLinkedToItem:m}}},16786:(e,t,n)=>{"use strict";n.d(t,{j:()=>a});var r=n(48518),i=n(29894),o=n(2784),s=n(38232);const a=e=>{const t=(0,r.I)(),[n,a]=(0,o.useState)(),l=(0,s.Y)(n),[c,u]=(0,o.useState)(),[d,h]=(0,o.useState)(),p=(0,o.useCallback)((()=>{t.featuresController.isVaultsEnabled()&&(a(t.vaultDisplayService.getItemVault(e)),u((n=>t.sharedVaults.getItemLastEditedBy(e)||n)),h(t.sharedVaults.getItemSharedBy(e)))}),[t.featuresController,t.sharedVaults,t.vaultDisplayService,e]);return(0,o.useLayoutEffect)((()=>{p()}),[p]),(0,o.useEffect)((()=>t.items.streamItems(i.ContentType.TYPES.VaultListing,(e=>{let{changed:t,inserted:n}=e;const r=t.concat(n).find((e=>{var t;return e.uuid===(null===(t=l.current)||void 0===t?void 0:t.uuid)}));r&&a(r)}))),[t.items,l]),(0,o.useEffect)((()=>t.items.streamItems(i.ContentType.TYPES.Note,(t=>{let{changed:n}=t;n.find((t=>t.uuid===e.uuid))&&p()}))),[t.items,e.uuid,p]),{vault:n,lastEditedByContact:c,sharedByContact:d}}},64503:(e,t,n)=>{"use strict";n.d(t,{r:()=>l});var r=n(2784),i=n(38232);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const l=function(e){let{open:t,enter:n,enterCallback:o,exit:a,exitCallback:l}=e,c=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const[u,d]=(0,r.useState)(null),[h,p]=(0,r.useState)((()=>t));(0,r.useEffect)((()=>{(c||t)&&p(t)}),[c,t]);const f=(0,i.Y)(n),g=(0,i.Y)(o),m=(0,i.Y)(a),y=(0,i.Y)(l);return(0,r.useEffect)((()=>{if(!u)return;if(c)return void p(t);const e=window.matchMedia("(prefers-reduced-motion: reduce)").matches,n=f.current,r=g.current,i=m.current,o=y.current;if(e&&!(null==n?void 0:n.reducedMotionKeyframes)&&!(null==i?void 0:i.reducedMotionKeyframes))return void p(t);let a;if(t){if(!n)return p(!0),void(null==r||r(u));n.initialStyle&&Object.assign(u.style,n.initialStyle),a=u.animate(e&&n.reducedMotionKeyframes?n.reducedMotionKeyframes:n.keyframes,s(s({},n.options),{},{fill:"forwards"})),a.finished.then((()=>{null==r||r(u)})).catch((e=>{null!==(null==a?void 0:a.currentTime)&&console.error(e)}))}else{if(!i)return p(!1),void(null==o||o(u));i.initialStyle&&Object.assign(u.style,i.initialStyle),a=u.animate(e&&i.reducedMotionKeyframes?i.reducedMotionKeyframes:i.keyframes,s(s({},i.options),{},{fill:"forwards"})),a.finished.then((()=>{p(!1),null==o||o(u)})).catch((e=>{null!==(null==a?void 0:a.currentTime)&&console.error(e)}))}return()=>{null==a||a.cancel()}}),[t,u,f,g,m,y,c]),[h,d,u]}},91611:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(84075),i=n(88450),o=n(2784);const s=(e,t)=>{const{initialFocus:n=0,shouldAutoFocus:s=!1,shouldWrapAround:a=!0,resetLastFocusedOnBlur:l=!1}=t||{},c=(0,o.useRef)([]),u=(0,o.useCallback)((()=>{e&&(c.current=Array.from(e.querySelectorAll('button, div[role="button"]')),c.current[0]&&(c.current[0].tabIndex=0))}),[e]),d=(0,o.useRef)(n),h=(0,o.useCallback)((e=>{var t;d.current=e,null===(t=c.current[e])||void 0===t||t.focus()}),[]),p=(0,o.useCallback)(((e,t)=>{let n=e+1;for(n>t.length-1&&(n=a?0:e);t[n].disabled;)n++,n>t.length-1&&(n=a?0:e);return n}),[a]),f=(0,o.useCallback)(((e,t)=>{let n=e-1;for(n<0&&(n=a?t.length-1:e);t[n].disabled;)n--,n<0&&(n=a?t.length-1:e);return n}),[a]);(0,o.useEffect)((()=>{e&&(e.tabIndex=i.HF,u(),c.current[0]&&(c.current[0].tabIndex=0))}),[e,u]);const g=(0,o.useCallback)((e=>{var t,n;const i="INPUT"===(null===(t=document.activeElement)||void 0===t?void 0:t.tagName),o=!!(null===(n=document.activeElement)||void 0===n?void 0:n.closest('[role="listbox"]'));if(!(i||o||e.key!==r.u8.Up&&e.key!==r.u8.Down)){if(e.preventDefault(),e.key===r.u8.Up){const e=f(d.current,c.current);h(e)}if(e.key===r.u8.Down){const e=p(d.current,c.current);h(e)}}}),[h,p,f]),m=(0,o.useCallback)((()=>{const e=c.current;if(e.length<1)return;const t=Array.from(e).findIndex((e=>e.dataset.selected));let r=t>-1?t:n;r=p(r-1,e),h(r)}),[h,p,n]);(0,o.useEffect)((()=>{s&&setTimeout((()=>{m()}),20)}),[m,s]);const y=(0,o.useCallback)((t=>{(!e||!e.contains(t.relatedTarget))&&l&&(d.current=n)}),[e,n,l]);return(0,o.useEffect)((()=>{if(!e)return;e.addEventListener("keydown",g),e.addEventListener("focusout",y);const t=new MutationObserver((()=>{u()}));return t.observe(e,{childList:!0,subtree:!0}),()=>{e.removeEventListener("keydown",g),e.removeEventListener("focusout",y),t.disconnect()}}),[m,g,y,e,u]),{setInitialFocus:m}}},67955:(e,t,n)=>{"use strict";n.d(t,{H:()=>i});var r=n(2784);const i=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:370;const o=(0,r.useRef)(),s=(0,r.useRef)(),a=(0,r.useCallback)((()=>{o.current&&clearTimeout(o.current)}),[]),l=(0,r.useCallback)((n=>{a(),s.current={x:n.clientX,y:n.clientY},o.current=window.setTimeout((()=>{var r;null===(r=e.current)||void 0===r||r.addEventListener("mousedown",(e=>{e.preventDefault(),e.stopPropagation()}),{once:!0,capture:!0});const i=n.clientX,o=n.clientY;t(i,o)}),i)}),[a,i,e,t]),c=(0,r.useCallback)((e=>{!s.current||e.clientX===s.current.x&&e.clientY===s.current.y||a()}),[a]),u=(0,r.useCallback)((()=>{e.current&&(e.current.addEventListener("pointerdown",l),n&&e.current.addEventListener("pointermove",c),e.current.addEventListener("pointercancel",a),e.current.addEventListener("pointerup",a))}),[a,c,n,l,e]),d=(0,r.useCallback)((()=>{e.current&&(e.current.removeEventListener("pointerdown",l),n&&e.current.removeEventListener("pointermove",c),e.current.removeEventListener("pointercancel",a),e.current.removeEventListener("pointerup",a))}),[a,c,n,l,e]);return(0,r.useMemo)((()=>({attachEvents:u,cleanupEvents:d})),[u,d])}},3555:(e,t,n)=>{"use strict";n.d(t,{Jj:()=>o,Yd:()=>i,ac:()=>s});var r=n(2784);const i={sm:"(max-width: 767px)",md:"(min-width: 768px)",lg:"(min-width: 1024px)",xl:"(min-width: 1280px)","2xl":"(min-width:  1536px)",pointerFine:"(pointer: fine)"},o={sm:"(min-width: 0px) and (max-width: 767px)",md:"(min-width: 768px) and (max-width: 1023px)",lg:"(min-width: 1024px) and (max-width: 1279px)",xl:"(min-width: 1280px) and (max-width: 1536px)","2xl":"(min-width:  1536px)",pointerFine:"(pointer: fine)"},s=e=>{const[t,n]=(0,r.useState)((()=>window.matchMedia(e).matches));return(0,r.useEffect)((()=>{const t=e=>{n(e.matches)},r=window.matchMedia(e);return null!=r.addEventListener?r.addEventListener("change",t):r.addListener(t),()=>{const n=window.matchMedia(e);null!=n.removeEventListener?n.removeEventListener("change",t):n.removeListener(t)}}),[e]),t}},5778:(e,t,n)=>{"use strict";n.d(t,{D:()=>s,Z:()=>a});var r=n(48518),i=n(29894),o=n(2784);function s(e){const t=(0,r.I)(),[n,s]=(0,o.useState)(t.preferences.getLocalValue(e,i.PrefDefaults[e])),a=(0,o.useCallback)((n=>{t.preferences.setLocalValue(e,n)}),[t,e]);return(0,o.useEffect)((()=>t.addEventObserver((async()=>{const n=t.preferences.getLocalValue(e,i.PrefDefaults[e]);s(n)}),i.ApplicationEvent.LocalPreferencesChanged)),[t,e]),[n,a]}function a(e){const t=(0,r.I)(),[n,s]=(0,o.useState)(t.getPreference(e,i.PrefDefaults[e]));return(0,o.useEffect)((()=>t.addEventObserver((async()=>{const n=t.getPreference(e,i.PrefDefaults[e]);s(n)}),i.ApplicationEvent.PreferencesChanged)),[t,e]),n}},38232:(e,t,n)=>{"use strict";n.d(t,{Y:()=>i});var r=n(2784);function i(e){const t=(0,r.useRef)(e);return(0,r.useLayoutEffect)((()=>{t.current=e}),[e]),t}},54502:(e,t,n)=>{"use strict";n.d(t,{t:()=>i});var r=n(24118);const i=async(e,t,n,i)=>{if(!t)throw new Error("Share function being used outside mobile webview");const o=await(0,r.cN)(n);e.shareBase64AsFile(o,i)}},74547:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u,x:()=>l});var r=n(52322),i=n(97168),o=n(34309),s=n(2784);const a=(0,s.createContext)(null),l=()=>{const e=(0,s.useContext)(a);if(!e)throw new Error("Component must be a child of <AndroidBackHandlerProvider />");return e},c=(0,s.memo)((e=>{let{children:t}=e;return(0,r.jsx)(r.Fragment,{children:t})})),u=(0,o.Pi)((e=>{let{application:t,children:n}=e;const o=(0,s.useCallback)((e=>t.addAndroidBackHandlerEventListener(e)),[t]);return(0,s.useEffect)((()=>{t.setAndroidBackHandlerFallbackListener((()=>{var e;const n=null===(e=t.getValue(i.g))||void 0===e||e;return t.mobileDevice.exitApp(n),!0}))}),[t]),(0,r.jsx)(a.Provider,{value:o,children:(0,r.jsx)(c,{children:n})})}))},22826:(e,t,n)=>{"use strict";n.d(t,{L:()=>r});const r=e=>{const t=e.map((e=>e.length)).reduce(((e,t)=>e+t),0),n=new Uint8Array(t);let r=0;return e.forEach((e=>{n.set(e,r),r+=e.length})),n}},93632:(e,t,n)=>{"use strict";n.d(t,{AF:()=>s,An:()=>a,Bn:()=>h,Bt:()=>i,DZ:()=>l,Eu:()=>o,ML:()=>p,fi:()=>u,gx:()=>c,ng:()=>d});var r=n(29894);const i=e=>(0,r.dateToLocalizedString)(e),o=e=>{if(e)return"".concat(e.toDateString()," ").concat(e.toLocaleTimeString())},s=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n="".concat(e.toLocaleDateString(void 0,{weekday:"long",day:"numeric",month:"short",year:"numeric"}));return t?"".concat(n," at ").concat(e.toLocaleTimeString(void 0,{timeStyle:"short"})):n},a=e=>{const t="".concat(e.toLocaleDateString());return"".concat(t," at ").concat(e.toLocaleTimeString(void 0,{timeStyle:"short"}))},l=e=>e.toLocaleTimeString(void 0,{timeStyle:"short"});function c(e,t){return e.toLocaleDateString()===t.toLocaleDateString()}function u(e,t){const n=new Date(e);return n.setMonth(n.getMonth()+t,1),n}function d(e,t){return e.toLocaleString("default",{weekday:t})}function h(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}function p(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=e,i=t,o=!1;e>t&&(r=t,i=e,o=!0);const s=i.getFullYear()-r.getFullYear(),a=i.getMonth()-r.getMonth(),l=i.getDate()-r.getDate();let c=0;return!0===n&&l>0?c=1:!0!==n&&l<0&&(c=-1),(o?-1:1)*(12*s+a+c)}},55088:(e,t,n)=>{"use strict";n.d(t,{c:()=>l});var r=n(24118),i=n(87901),o=n(54569),s=n(54502),a=n(29894);const l=async e=>{var t;e.isNativeMobileWeb?e.mobileDevice&&e.platform===a.Platform.Ios?(0,s.t)(e.mobileDevice,e.isNativeMobileWeb,e.blob,e.filename):e.mobileDevice&&e.platform===a.Platform.Android&&async function(e,t,n){let s,a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];a&&(s=(0,o.fz)({type:o.pC.Loading,message:"Downloading ".concat(n,"..")}));const l=await(0,r.cN)(t),{name:c,ext:u}=(0,i.parseFileName)(n),d=(0,i.sanitizeFileName)(c);n="".concat(d,".").concat(u);const h=await e.downloadBase64AsFile(l,n);s&&(0,o.Xd)(s),a&&(h?(0,o.fz)({type:o.pC.Success,message:"Downloaded ".concat(n)}):(0,o.fz)({type:o.pC.Error,message:"Could not download ".concat(n)}))}(e.mobileDevice,e.blob,e.filename,null===(t=e.showToastOnAndroid)||void 0===t||t):e.archiveService.downloadData(e.blob,e.filename)}},43426:(e,t,n)=>{"use strict";n.d(t,{l:()=>i});var r=n(29894);function i(e,t){if(e instanceof r.SNTag)return{titlePrefix:t.items.getTagPrefixTitle(e),longTitle:t.items.getTagLongTitle(e)}}},81222:(e,t,n)=>{"use strict";n.d(t,{i:()=>o});var r=n(88450),i=n(84409);function o(e,t){switch(e){case void 0:case i.NoteType.Plain:return["plain-text",1];case i.NoteType.RichText:return["rich-text",1];case i.NoteType.Markdown:return["markdown",2];case i.NoteType.Authentication:return["authenticator",6];case i.NoteType.Spreadsheet:return["spreadsheets",5];case i.NoteType.Task:return["tasks",3];case i.NoteType.Code:return["code",4];case i.NoteType.Super:return[t?r.IN.subtleIcon:r.IN.icon,r.IN.iconTintNumber];case i.NoteType.Unknown:default:return["editor",1]}}},30383:(e,t,n)=>{"use strict";function r(e){let t="file-other";return"application/pdf"===e&&(t="file-pdf"),/word/.test(e)&&(t="file-doc"),/powerpoint|presentation/.test(e)&&(t="file-ppt"),/excel|spreadsheet/.test(e)&&(t="file-xls"),/^image\//.test(e)&&(t="file-image"),/^video\//.test(e)&&(t="file-mov"),/^audio\//.test(e)&&(t="file-music"),/(zip)|([tr]ar)|(7z)/.test(e)&&(t="file-zip"),t}n.d(t,{A:()=>r})},79323:(e,t,n)=>{"use strict";n.d(t,{b:()=>s});var r=n(29894),i=n(81222),o=n(30383);function s(e,t){if(e instanceof r.SNNote){const n=t.componentManager.editorForNote(e),[r,o]=(0,i.i)(n.noteType);return[r,"text-accessory-tint-".concat(o)]}if(e instanceof r.FileItem)return[(0,o.A)(e.mimeType),"text-info"];if(e instanceof r.SNTag)return[e.iconString,"text-info"];throw new Error("Unhandled case in getItemIcon")}},57751:(e,t,n)=>{"use strict";function r(e,t){return{id:"".concat(e.uuid,"-").concat(t),item:e,type:t}}n.d(t,{X:()=>r})},11032:(e,t,n)=>{"use strict";n.d(t,{R:()=>i,f:()=>o});var r=n(29894);function i(e){return e.title&&e.title.length>0?e.title:(0,r.isNote)(e)?e.preview_plain:""}function o(e,t,n){const i=function(e,t){var n;if((0,r.isNote)(e)){if(e.title.length>0)return e.title;if(!e.protected)return e.preview_plain}else if((0,r.isTag)(e))return t.items.getTagLongTitle(e);return null!==(n=e.title)&&void 0!==n?n:""}(e,n).toLowerCase(),o=i.includes(t.toLowerCase()),s=e.archived||e.trashed;return o&&!s}},90509:(e,t,n)=>{"use strict";n.d(t,{Q:()=>c});var r=n(29894),i=n(57751),o=n(11032);function s(e,t){let n=!1;const r=t.references.some((t=>t.uuid===e.uuid)),i=e.references.some((e=>e.uuid===(null==t?void 0:t.uuid)));return n=t.content_type===e.content_type?r:i||r,n}function a(e,t){return e.content_type===r.ContentType.TYPES.Tag&&e.title===t}const l=50;function c(e,t,n){let c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{returnEmptyIfQueryEmpty:!0},u=[];const d=[],h=[];let p=!1;const f={linkedResults:h,unlinkedItems:u,linkedItems:d,shouldShowCreateTag:p};if(!n)return f;if(!e.length&&c.returnEmptyIfQueryEmpty)return f;const g=(0,r.naturalSort)(t.items.getItems([r.ContentType.TYPES.Note,r.ContentType.TYPES.File,r.ContentType.TYPES.Tag]),"title"),m=[],y=[],v=[];for(let a=0;a<g.length;a++){const u=g[a];if(n.uuid===u.uuid)continue;if(c.contentType&&u.content_type!==c.contentType)continue;if(e.length&&!(0,o.f)(u,e,t))continue;if(s(u,n)){h.length<l&&h.push((0,i.X)(u,"linked")),d.push(u);continue}const p=null==c.contentType,f=(A=e,Math.max(10,3*A.length));u.content_type!==r.ContentType.TYPES.Tag||p&&!(m.length<f&&u.content_type===r.ContentType.TYPES.Tag)?u.content_type!==r.ContentType.TYPES.Note||p&&!(y.length<f)?u.content_type!==r.ContentType.TYPES.File||p&&!(v.length<f)||v.push(u):y.push(u):m.push(u)}var A;return u=[...m,...y,...v],p=!h.find((t=>a(t.item,e)))&&!u.find((t=>a(t,e))),{linkedResults:h,linkedItems:d,unlinkedItems:u,shouldShowCreateTag:p}}},1754:(e,t,n)=>{"use strict";n.d(t,{A1:()=>p,Av:()=>v,Ds:()=>h,Hs:()=>y,Ju:()=>m,KC:()=>d,Xf:()=>u,Yu:()=>b,Z$:()=>g,cN:()=>w,cv:()=>E,e1:()=>S,h6:()=>f,jb:()=>A,r8:()=>l,rP:()=>C,t2:()=>c});var r=n(29894),i=n(91583),o=n(88450),s=n(3555),a=n(84075);const l=!1;function c(){try{const e=navigator.platform.toLowerCase();let t="";return t=e.includes("iphone")||(0,a.gn)()?"ios":e.includes("android")||(0,a.Dt)()?"android":e.includes("mac")?"mac":e.includes("win")?"windows":(e.includes("linux"),"linux"),t+(g()?"-desktop":"-web")}catch(e){return"unknown-platform"}}function u(e){return"platform"in e?e.platform:(0,r.platformFromString)(c())}function d(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function h(e,t){let n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return()=>{const i=this,o=arguments,s=r&&!n;n&&clearTimeout(n),n=setTimeout((function(){n=null,r||e.apply(i,o)}),t),s&&e.apply(i,o)}}async function p(e,t){const n=window.onbeforeunload;try{window.onbeforeunload=()=>e,await t()}finally{window.onbeforeunload=n}}if(Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(e,t){if(null==this)throw new TypeError('"this" is null or not defined');const n=Object(this),r=n.length>>>0;if(0===r)return!1;const i=0|t;let o=Math.max(i>=0?i:r-Math.abs(i),0);for(;o<r;){if((s=n[o])===(a=e)||"number"==typeof s&&"number"==typeof a&&isNaN(s)&&isNaN(a))return!0;o++}var s,a;return!1}}),!i.Ab&&!i.zj)throw Error("Neither __WEB__ nor __DESKTOP__ is true. Check your configuration files.");function f(e){for(const t of Object.getOwnPropertyNames(e))try{delete e[t]}catch(e){}}function g(){return i.zj}const m=e=>o.CU.test(e),y=()=>{(0,a.gn)()&&(()=>{const e=document.querySelector("meta[name=viewport]");if(null!==e){let t=e.getAttribute("content");if(!t)return;const n=/maximum-scale=[0-9.]+/g;t=n.test(t)?t.replace(n,"maximum-scale=1.0"):[t,"maximum-scale=1.0"].join(", "),e.setAttribute("content",t)}})()},v=()=>window.matchMedia(s.Jj.sm).matches,A=()=>window.matchMedia(s.Jj.md).matches,b=()=>v()||A(),w=e=>new Promise(((t,n)=>{const r=new FileReader;r.onloadend=()=>{r.result&&"string"==typeof r.result?t(r.result):n()},r.readAsDataURL(e)})),S=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:512;const r=atob(e),i=[];for(let e=0;e<r.length;e+=n){const t=r.slice(e,e+n),o=new Array(t.length);for(let e=0;e<t.length;e++)o[e]=t.charCodeAt(e);const s=new Uint8Array(o);i.push(s)}return new Blob(i,{type:t})};function C(e){return e?e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth?e:C(e.parentElement):null}function E(e){return e*parseFloat(getComputedStyle(document.documentElement).fontSize)}},24118:(e,t,n)=>{"use strict";n.d(t,{Lf:()=>r.L,Ds:()=>o.Ds,h6:()=>o.h6,Hs:()=>o.Hs,cN:()=>o.cN,e1:()=>o.e1,Xf:()=>o.Xf,t2:()=>o.t2,rP:()=>o.rP,Z$:()=>o.Z$,r8:()=>o.r8,Ju:()=>o.Ju,Av:()=>o.Av,KC:()=>o.KC,Yu:()=>o.Yu,jb:()=>o.jb,A1:()=>o.A1,cv:()=>o.cv,RB:()=>i});var r=n(22826);const i=(e,t)=>{const n=((e,t)=>{const n=e.toLowerCase(),r=t.toLowerCase();return n.indexOf(r)})(e,t);return n<0?[e]:((e,t,n)=>{const r=t>e.length||t<0,i=n>e.length||n<0;return r||i||t>n?[e]:[e.slice(0,t),e.slice(t,n),e.slice(n)].filter((e=>e.length>0))})(e,n,n+t.length)};var o=n(1754)},86429:(e,t,n)=>{"use strict";const r=n(29894);e.exports=r},95766:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,o=a(e),s=o[0],l=o[1],c=new i(function(e,t,n){return 3*(t+n)/4-n}(0,s,l)),u=0,d=l>0?s-4:s;for(n=0;n<d;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===l&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[u++]=255&t),1===l&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],s=16383,a=0,c=r-i;a<c;a+=s)o.push(l(e,a,a+s>c?c:a+s));return 1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),o.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)n[s]=o[s],r[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,r){for(var i,o,s=[],a=t;a<r;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},48834:(e,t,n)=>{"use strict";const r=n(95766),i=n(62333),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.lW=l,t.h2=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return c(e,t,n)}function c(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|g(e,t);let r=a(n);const i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(W(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(W(e,ArrayBuffer)||e&&W(e.buffer,ArrayBuffer))return p(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(W(e,SharedArrayBuffer)||e&&W(e.buffer,SharedArrayBuffer)))return p(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return l.from(r,t,n);const i=function(e){if(l.isBuffer(e)){const t=0|f(e.length),n=a(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||q(e.length)?a(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return u(e),a(e<0?0:0|f(e))}function h(e){const t=e.length<0?0:0|f(e.length),n=a(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function p(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,l.prototype),r}function f(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function g(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||W(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(i)return r?-1:Y(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,t,n);case"utf8":case"utf-8":return _(this,t,n);case"ascii":return P(this,t,n);case"latin1":case"binary":return k(this,t,n);case"base64":return I(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),q(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:A(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):A(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function A(e,t,n,r,i){let o,s=1,a=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,l/=2,n/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let r=-1;for(o=n;o<a;o++)if(c(e,o)===c(t,-1===r?0:o-r)){if(-1===r&&(r=o),o-r+1===l)return r*s}else-1!==r&&(o-=o-r),r=-1}else for(n+l>a&&(n=a-l),o=n;o>=0;o--){let n=!0;for(let r=0;r<l;r++)if(c(e,o+r)!==c(t,r)){n=!1;break}if(n)return o}return-1}function b(e,t,n,r){n=Number(n)||0;const i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;const o=t.length;let s;for(r>o/2&&(r=o/2),s=0;s<r;++s){const r=parseInt(t.substr(2*s,2),16);if(q(r))return s;e[n+s]=r}return s}function w(e,t,n,r){return Z(Y(t,e.length-n),e,n,r)}function S(e,t,n,r){return Z(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function C(e,t,n,r){return Z(z(t),e,n,r)}function E(e,t,n,r){return Z(function(e,t){let n,r,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)n=e.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function I(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function _(e,t,n){n=Math.min(e.length,n);const r=[];let i=t;for(;i<n;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=n){let n,r,a,l;switch(s){case 1:t<128&&(o=t);break;case 2:n=e[i+1],128==(192&n)&&(l=(31&t)<<6|63&n,l>127&&(o=l));break;case 3:n=e[i+1],r=e[i+2],128==(192&n)&&128==(192&r)&&(l=(15&t)<<12|(63&n)<<6|63&r,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:n=e[i+1],r=e[i+2],a=e[i+3],128==(192&n)&&128==(192&r)&&128==(192&a)&&(l=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&a,l>65535&&l<1114112&&(o=l))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=s}return function(e){const t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=x));return n}(r)}l.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,n){return c(e,t,n)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,n){return function(e,t,n){return u(e),e<=0?a(e):void 0!==t?"string"==typeof n?a(e).fill(t,n):a(e).fill(t):a(e)}(e,t,n)},l.allocUnsafe=function(e){return d(e)},l.allocUnsafeSlow=function(e){return d(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(W(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),W(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const r=l.allocUnsafe(t);let i=0;for(n=0;n<e.length;++n){let t=e[n];if(W(t,Uint8Array))i+t.length>r.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,i)}i+=t.length}return r},l.byteLength=g,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)y(this,t,t+1);return this},l.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},l.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},l.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?_(this,0,e):m.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){let e="";const n=t.h2;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},o&&(l.prototype[o]=l.prototype.inspect),l.prototype.compare=function(e,t,n,r,i){if(W(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;let o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0);const a=Math.min(o,s),c=this.slice(r,i),u=e.slice(t,n);for(let e=0;e<a;++e)if(c[e]!==u[e]){o=c[e],s=u[e];break}return o<s?-1:s<o?1:0},l.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},l.prototype.indexOf=function(e,t,n){return v(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return v(this,e,t,n,!1)},l.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let o=!1;for(;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":case"latin1":case"binary":return S(this,e,t,n);case"base64":return C(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const x=4096;function P(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function k(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function B(e,t,n){const r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i="";for(let r=t;r<n;++r)i+=J[e[r]];return i}function O(e,t,n){const r=e.slice(t,n);let i="";for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+256*r[e+1]);return i}function N(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,n,r,i,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function j(e,t,n,r,i){V(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,n}function T(e,t,n,r,i){V(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n+7]=o,o>>=8,e[n+6]=o,o>>=8,e[n+5]=o,o>>=8,e[n+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=s,s>>=8,e[n+2]=s,s>>=8,e[n+1]=s,s>>=8,e[n]=s,n+8}function M(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function F(e,t,n,r,o){return t=+t,n>>>=0,o||M(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function R(e,t,n,r,o){return t=+t,n>>>=0,o||M(e,0,n,8),i.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const r=this.subarray(e,t);return Object.setPrototypeOf(r,l.prototype),r},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||N(e,t,this.length);let r=this[e],i=1,o=0;for(;++o<t&&(i*=256);)r+=this[e+o]*i;return r},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||N(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=X((function(e){K(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))})),l.prototype.readBigUInt64BE=X((function(e){K(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<<BigInt(32))+BigInt(i)})),l.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||N(e,t,this.length);let r=this[e],i=1,o=0;for(;++o<t&&(i*=256);)r+=this[e+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||N(e,t,this.length);let r=t,i=1,o=this[e+--r];for(;r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||N(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){e>>>=0,t||N(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=X((function(e){K(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),l.prototype.readBigInt64BE=X((function(e){K(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)})),l.prototype.readFloatLE=function(e,t){return e>>>=0,t||N(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||N(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||D(this,e,t,n,Math.pow(2,8*n)-1,0);let i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||D(this,e,t,n,Math.pow(2,8*n)-1,0);let i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigUInt64LE=X((function(e,t=0){return j(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeBigUInt64BE=X((function(e,t=0){return T(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);D(this,e,t,n,r-1,-r)}let i=0,o=1,s=0;for(this[t]=255&e;++i<n&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);D(this,e,t,n,r-1,-r)}let i=n-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigInt64LE=X((function(e,t=0){return j(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeBigInt64BE=X((function(e,t=0){return T(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeFloatLE=function(e,t,n){return F(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return F(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return R(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return R(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);const i=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},l.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){const t=e.charCodeAt(0);("utf8"===r&&t<128||"latin1"===r)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;let i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{const o=l.isBuffer(e)?e:l.from(e,r),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=o[i%s]}return this};const L={};function Q(e,t,n){L[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function U(e){let t="",n=e.length;const r="-"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function V(e,t,n,r,i,o){if(e>n||e<t){const r="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new L.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,n){K(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||H(t,e.length-(n+1))}(r,i,o)}function K(e,t){if("number"!=typeof e)throw new L.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,n){if(Math.floor(e)!==e)throw K(e,n),new L.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new L.ERR_BUFFER_OUT_OF_BOUNDS;throw new L.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}Q("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),Q("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),Q("ERR_OUT_OF_RANGE",(function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=U(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=U(i)),i+="n"),r+=` It must be ${t}. Received ${i}`,r}),RangeError);const G=/[^+/0-9A-Za-z-_]/g;function Y(e,t){let n;t=t||1/0;const r=e.length;let i=null;const o=[];for(let s=0;s<r;++s){if(n=e.charCodeAt(s),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function z(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Z(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function W(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function q(e){return e!=e}const J=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?$:e}function $(){throw new Error("BigInt not supported")}},57359:function(e,t,n){var r;e.exports=(r=r||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==n.g&&n.g.crypto&&(r=n.g.crypto),!r)try{r=n(50633)}catch(e){}var i=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),s={},a=s.lib={},l=a.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=a.WordArray=l.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||d).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o<i;o++){var s=n[o>>>2]>>>24-o%4*8&255;t[r+o>>>2]|=s<<24-(r+o)%4*8}else for(var a=0;a<i;a+=4)t[r+a>>>2]=n[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=l.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(i());return new c.init(t,e)}}),u=s.enc={},d=u.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new c.init(n,t/2)}},h=u.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new c.init(n,t)}},p=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(h.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return h.parse(unescape(encodeURIComponent(e)))}},f=a.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,i=r.words,o=r.sigBytes,s=this.blockSize,a=o/(4*s),l=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,u=e.min(4*l,o);if(l){for(var d=0;d<l;d+=s)this._doProcessBlock(i,d);n=i.splice(0,l),r.sigBytes-=u}return new c.init(n,u)},clone:function(){var e=l.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),g=(a.Hasher=f.extend({cfg:l.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new g.HMAC.init(e,n).finalize(t)}}}),s.algo={});return s}(Math),r)},8139:function(e,t,n){var r,i,o;e.exports=(r=n(57359),o=(i=r).lib.WordArray,i.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var i=[],o=0;o<n;o+=3)for(var s=(t[o>>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a<n;a++)i.push(r.charAt(s>>>6*(3-a)&63));var l=r.charAt(64);if(l)for(;i.length%4;)i.push(l);return i.join("")},parse:function(e){var t=e.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var i=0;i<n.length;i++)r[n.charCodeAt(i)]=i}var s=n.charAt(64);if(s){var a=e.indexOf(s);-1!==a&&(t=a)}return function(e,t,n){for(var r=[],i=0,s=0;s<t;s++)if(s%4){var a=n[e.charCodeAt(s-1)]<<s%4*2|n[e.charCodeAt(s)]>>>6-s%4*2;r[i>>>2]|=a<<24-i%4*8,i++}return o.create(r,i)}(e,t,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64)},79174:function(e,t,n){var r;e.exports=(r=n(57359),function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,s=t.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();var l=s.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,s=e[t+0],l=e[t+1],p=e[t+2],f=e[t+3],g=e[t+4],m=e[t+5],y=e[t+6],v=e[t+7],A=e[t+8],b=e[t+9],w=e[t+10],S=e[t+11],C=e[t+12],E=e[t+13],I=e[t+14],_=e[t+15],x=o[0],P=o[1],k=o[2],B=o[3];x=c(x,P,k,B,s,7,a[0]),B=c(B,x,P,k,l,12,a[1]),k=c(k,B,x,P,p,17,a[2]),P=c(P,k,B,x,f,22,a[3]),x=c(x,P,k,B,g,7,a[4]),B=c(B,x,P,k,m,12,a[5]),k=c(k,B,x,P,y,17,a[6]),P=c(P,k,B,x,v,22,a[7]),x=c(x,P,k,B,A,7,a[8]),B=c(B,x,P,k,b,12,a[9]),k=c(k,B,x,P,w,17,a[10]),P=c(P,k,B,x,S,22,a[11]),x=c(x,P,k,B,C,7,a[12]),B=c(B,x,P,k,E,12,a[13]),k=c(k,B,x,P,I,17,a[14]),x=u(x,P=c(P,k,B,x,_,22,a[15]),k,B,l,5,a[16]),B=u(B,x,P,k,y,9,a[17]),k=u(k,B,x,P,S,14,a[18]),P=u(P,k,B,x,s,20,a[19]),x=u(x,P,k,B,m,5,a[20]),B=u(B,x,P,k,w,9,a[21]),k=u(k,B,x,P,_,14,a[22]),P=u(P,k,B,x,g,20,a[23]),x=u(x,P,k,B,b,5,a[24]),B=u(B,x,P,k,I,9,a[25]),k=u(k,B,x,P,f,14,a[26]),P=u(P,k,B,x,A,20,a[27]),x=u(x,P,k,B,E,5,a[28]),B=u(B,x,P,k,p,9,a[29]),k=u(k,B,x,P,v,14,a[30]),x=d(x,P=u(P,k,B,x,C,20,a[31]),k,B,m,4,a[32]),B=d(B,x,P,k,A,11,a[33]),k=d(k,B,x,P,S,16,a[34]),P=d(P,k,B,x,I,23,a[35]),x=d(x,P,k,B,l,4,a[36]),B=d(B,x,P,k,g,11,a[37]),k=d(k,B,x,P,v,16,a[38]),P=d(P,k,B,x,w,23,a[39]),x=d(x,P,k,B,E,4,a[40]),B=d(B,x,P,k,s,11,a[41]),k=d(k,B,x,P,f,16,a[42]),P=d(P,k,B,x,y,23,a[43]),x=d(x,P,k,B,b,4,a[44]),B=d(B,x,P,k,C,11,a[45]),k=d(k,B,x,P,_,16,a[46]),x=h(x,P=d(P,k,B,x,p,23,a[47]),k,B,s,6,a[48]),B=h(B,x,P,k,v,10,a[49]),k=h(k,B,x,P,I,15,a[50]),P=h(P,k,B,x,m,21,a[51]),x=h(x,P,k,B,C,6,a[52]),B=h(B,x,P,k,f,10,a[53]),k=h(k,B,x,P,w,15,a[54]),P=h(P,k,B,x,l,21,a[55]),x=h(x,P,k,B,A,6,a[56]),B=h(B,x,P,k,_,10,a[57]),k=h(k,B,x,P,y,15,a[58]),P=h(P,k,B,x,E,21,a[59]),x=h(x,P,k,B,g,6,a[60]),B=h(B,x,P,k,S,10,a[61]),k=h(k,B,x,P,p,15,a[62]),P=h(P,k,B,x,b,21,a[63]),o[0]=o[0]+x|0,o[1]=o[1]+P|0,o[2]=o[2]+k|0,o[3]=o[3]+B|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;n[i>>>5]|=128<<24-i%32;var o=e.floor(r/4294967296),s=r;n[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),t.sigBytes=4*(n.length+1),this._process();for(var a=this._hash,l=a.words,c=0;c<4;c++){var u=l[c];l[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return a},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function c(e,t,n,r,i,o,s){var a=e+(t&n|~t&r)+i+s;return(a<<o|a>>>32-o)+t}function u(e,t,n,r,i,o,s){var a=e+(t&r|n&~r)+i+s;return(a<<o|a>>>32-o)+t}function d(e,t,n,r,i,o,s){var a=e+(t^n^r)+i+s;return(a<<o|a>>>32-o)+t}function h(e,t,n,r,i,o,s){var a=e+(n^(t|~r))+i+s;return(a<<o|a>>>32-o)+t}t.MD5=o._createHelper(l),t.HmacMD5=o._createHmacHelper(l)}(Math),r.MD5)},35796:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(39601),i=n.n(r),o=n(82609),s=n.n(o)()(i());s.push([e.id,":root{--sn-stylekit-neutral-color: #72767e;--sn-stylekit-neutral-contrast-color: #ffffff;--sn-stylekit-info-color: #086dd6;--sn-stylekit-info-color-darkened: #065cb5;--sn-stylekit-info-contrast-color: #ffffff;--sn-stylekit-info-backdrop-color: #2b6fcf0f;--sn-stylekit-success-color: #007662;--sn-stylekit-success-contrast-color: #ffffff;--sn-stylekit-warning-color: #ebad00;--sn-stylekit-warning-contrast-color: #ffffff;--sn-stylekit-danger-color: #cc2128;--sn-stylekit-danger-contrast-color: #ffffff;--sn-stylekit-danger-light-color: #f9e4e5;--sn-stylekit-shadow-color: #c8c8c8;--sn-stylekit-background-color: #ffffff;--sn-stylekit-border-color: #dfe1e4;--sn-stylekit-foreground-color: #19191c;--sn-stylekit-contrast-background-color: rgba(244, 245, 247, 1);--sn-stylekit-contrast-foreground-color: #2e2e2e;--sn-stylekit-contrast-border-color: #e3e3e3;--sn-stylekit-secondary-background-color: #eeeff1;--sn-stylekit-secondary-foreground-color: #2e2e2e;--sn-stylekit-secondary-border-color: #e3e3e3;--sn-stylekit-secondary-contrast-background-color: #e3e3e3;--sn-stylekit-secondary-contrast-foreground-color: #2e2e2e;--sn-stylekit-secondary-contrast-border-color: #a2a2a2;--sn-stylekit-editor-background-color: var(--sn-stylekit-background-color);--sn-stylekit-editor-foreground-color: var(--sn-stylekit-foreground-color);--sn-stylekit-paragraph-text-color: #454545;--sn-stylekit-input-placeholder-color: #a8a8a8;--sn-stylekit-input-border-color: #e3e3e3;--sn-stylekit-scrollbar-thumb-color: #dfdfdf;--sn-stylekit-scrollbar-track-border-color: #e7e7e7;--sn-stylekit-theme-type: light;--sn-stylekit-theme-name: sn-light;--sn-stylekit-passive-color-0: #515357;--sn-stylekit-passive-color-1: #72767e;--sn-stylekit-passive-color-2: #bbbec4;--sn-stylekit-passive-color-3: #dfe1e4;--sn-stylekit-passive-color-4: #eeeff1;--sn-stylekit-passive-color-4-opacity-variant: #bbbec43d;--sn-stylekit-passive-color-5: #f4f5f7;--sn-stylekit-passive-color-6: #e5e5e5;--sn-stylekit-passive-color-super-light: #f9f9f9;--sn-stylekit-accessory-tint-color-1: #086dd6;--sn-stylekit-accessory-tint-color-2: #ea6595;--sn-stylekit-accessory-tint-color-3: #ebad00;--sn-stylekit-accessory-tint-color-4: #7049cf;--sn-stylekit-accessory-tint-color-5: #1aa772;--sn-stylekit-accessory-tint-color-6: #f28c52}",""]);const a=s},57610:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(39601),i=n.n(r),o=n(82609),s=n.n(o)()(i());s.push([e.id,':root{--lexical-ordered-list-left-margin: 16px}.monospace-font{--lexical-ordered-list-left-margin: 42px}.Lexical__ol1{padding:0;margin:0;margin-left:var(--lexical-ordered-list-left-margin);list-style-position:outside}.Lexical__ol1.Lexical__rtl{margin-left:0;margin-right:var(--lexical-ordered-list-left-margin)}.Lexical__ol2{padding:0;margin:0;margin-left:var(--lexical-ordered-list-left-margin);list-style-position:outside}.Lexical__ol2.Lexical__rtl{margin-left:0;margin-right:var(--lexical-ordered-list-left-margin)}.Lexical__ol3{padding:0;margin:0;margin-left:var(--lexical-ordered-list-left-margin);list-style-position:outside}.Lexical__ol3.Lexical__rtl{margin-left:0;margin-right:var(--lexical-ordered-list-left-margin)}.Lexical__ol4{padding:0;margin:0;margin-left:var(--lexical-ordered-list-left-margin);list-style-position:outside}.Lexical__ol4.Lexical__rtl{margin-left:0;margin-right:var(--lexical-ordered-list-left-margin)}.Lexical__ol5{padding:0;margin:0;margin-left:var(--lexical-ordered-list-left-margin);list-style-position:outside}.Lexical__ol5.Lexical__rtl{margin-left:0;margin-right:var(--lexical-ordered-list-left-margin)}.Lexical__ol2{list-style-type:upper-alpha}.Lexical__ol3{list-style-type:lower-alpha}.Lexical__ol4{list-style-type:upper-roman}.Lexical__ol5{list-style-type:lower-roman}.Lexical__ul{padding:0;margin:0;margin-left:16px;list-style-position:outside}.Lexical__ul.Lexical__rtl{margin-left:0;margin-right:16px}.Lexical__checkList{margin-left:0}.Lexical__nestedListItem .Lexical__checkList{margin-left:16px}.Lexical__listItem{margin:0 0px}.Lexical__listItemChecked,.Lexical__listItemUnchecked{position:relative;padding-left:calc(var(--font-size) + .5rem);padding-right:calc(var(--font-size) + .5rem);list-style-type:none;outline:none;vertical-align:middle}.Lexical__listItemChecked:focus,.Lexical__listItemChecked:focus-within,.Lexical__listItemUnchecked:focus,.Lexical__listItemUnchecked:focus-within{outline:none;box-shadow:none}.Lexical__listItemChecked{text-decoration:line-through;opacity:.4}.Lexical__listItemUnchecked:before,.Lexical__listItemChecked:before{content:"";--size: 16px;width:var(--size);height:var(--size);left:0;top:calc(var(--line-height, 1)*var(--font-size)/2);transform:translateY(-50%);cursor:pointer;background-size:cover;position:absolute}.Lexical__listItemUnchecked[dir=rtl]:before,.Lexical__listItemChecked[dir=rtl]:before{left:auto;right:0}.Lexical__listItemUnchecked:before{border:1px solid #999;border-radius:2px}.Lexical__listItemChecked:before{border:1px solid var(--sn-stylekit-info-color);border-radius:2px;background-color:var(--sn-stylekit-info-color);background-repeat:no-repeat}.Lexical__listItemChecked:after{content:"";cursor:pointer;border-color:var(--sn-stylekit-info-contrast-color);border-style:solid;position:absolute;display:block;width:5px;height:11px;--top: calc(var(--line-height, 1) * var(--font-size) / 2);top:calc(var(--top) - 1px);left:5px;transform:translateY(-50%) rotate(45deg);border-width:0 2px 2px 0}.Lexical__nestedListItem{list-style-type:none}.Lexical__nestedListItem.Lexical__listItemUnchecked{padding-left:0}.Lexical__nestedListItem:before,.Lexical__nestedListItem:after{display:none}.Lexical__ltr{text-align:left}.Lexical__rtl{text-align:right}.Lexical__code{white-space:pre}.Lexical__paragraph{margin:0;position:relative}.Lexical__quote{margin:0;margin-left:20px;margin-bottom:10px;color:var(--sn-stylekit-passive-color-1);border-left-color:var(--sn-stylekit-passive-color-1);border-left-width:4px;border-left-style:solid;padding-left:16px}.Lexical__quote.Lexical__rtl{margin-left:0;margin-right:20px;border-left-color:rgba(0,0,0,0);border-right-color:var(--sn-stylekit-passive-color-1);border-right-width:4px;border-right-style:solid;padding-right:16px}.Lexical__h1{font-size:26px;color:var(--sn-stylekit-editor-foreground-color);font-weight:700;margin:0}.Lexical__h2{font-size:22px;color:var(--sn-stylekit-editor-foreground-color);font-weight:700;margin:0}.Lexical__h3{font-size:19px;font-weight:700;margin:0}.Lexical__textBold{font-weight:bold}.Lexical__textItalic{font-style:italic}.Lexical__textUnderline{text-decoration:underline}.Lexical__textStrikethrough{text-decoration:line-through}.Lexical__textUnderlineStrikethrough{text-decoration:underline line-through}.Lexical__textSubscript{font-size:.8em;vertical-align:sub !important}.Lexical__textSuperscript{font-size:.8em;vertical-align:super}.Lexical__textCode{background-color:var(--sn-stylekit-secondary-background-color);color:var(--sn-stylekit-info-color);padding:5px;border-radius:5px;font-family:Menlo,Consolas,Monaco,monospace;font-size:85%}.Lexical__hashtag{background-color:rgba(88,144,255,.15);border-bottom:1px solid rgba(88,144,255,.3)}.Lexical__link{color:var(--sn-stylekit-info-color);text-decoration:none}.Lexical__link:hover{text-decoration:underline}.Lexical__code{background-color:var(--sn-stylekit-contrast-background-color);font-family:var(--sn-stylekit-monospace-font),monospace;display:block;padding:1.25rem 1.35rem;margin:.5rem 0;tab-size:2;overflow-x:auto;position:relative;border-radius:.25rem}.Collapsible__container .Lexical__code{background-color:var(--sn-stylekit-background-color);border:1px solid var(--sn-stylekit-contrast-border-color)}.Lexical__table{border-collapse:collapse;border-spacing:0;max-width:100%;overflow-y:scroll;table-layout:fixed;width:calc(100% - 25px);margin:.5rem 0;color:var(--sn-stylekit-contrast-foreground-color)}.Lexical__tableSelection *::selection{background-color:rgba(0,0,0,0) !important}.Lexical__tableSelected{outline:2px solid #3c84f4}.Lexical__tableCell{border:1px solid var(--sn-stylekit-border-color);min-width:75px;vertical-align:top;text-align:start;padding:6px 8px;position:relative;cursor:default;outline:none}.Lexical__tableCellSortedIndicator{display:block;opacity:.5;position:absolute;bottom:0;left:0;width:100%;height:4px;background-color:#999}.Lexical__tableCellResizer{position:absolute;right:-4px;height:100%;width:8px;cursor:ew-resize;z-index:10;top:0}.Lexical__tableCellHeader{background-color:var(--sn-stylekit-contrast-background-color);border-color:var(--sn-stylekit-contrast-border-color);text-align:start}.Lexical__tableCellSelected{background-color:#c9dbf0}.Lexical__tableCellPrimarySelected{border:2px solid #3c84f4;display:block;height:calc(100% - 2px);position:absolute;width:calc(100% - 2px);left:-1px;top:-1px;z-index:2}.Lexical__tableCellEditing{box-shadow:0 0 5px rgba(0,0,0,.4);border-radius:3px}.Lexical__tableCellResizeRuler{display:block;position:absolute;width:1px;background-color:#3c84f4;height:100%;top:0}.Lexical__tableCellActionButtonContainer{display:block;right:5px;top:6px;position:absolute;z-index:4;width:20px;height:20px}.Lexical__tableCellActionButton{background-color:#eee;display:block;border:0;border-radius:20px;width:20px;height:20px;color:#222;cursor:pointer}.Lexical__tableCellActionButton:hover{background-color:#ddd}.Lexical__characterLimit{display:inline;background-color:#fbb !important}.Lexical__tokenComment{color:#708090}.Lexical__tokenPunctuation{color:#999}.Lexical__tokenProperty{color:#905}.Lexical__tokenSelector{color:#690}.Lexical__tokenOperator{color:#9a6e3a}.Lexical__tokenAttr{color:#07a}.Lexical__tokenVariable{color:#e90}.Lexical__tokenFunction{color:#dd4a68}.Lexical__mark{background:rgba(255,212,0,.14);border-bottom:2px solid rgba(255,212,0,.3);padding-bottom:2px}.Lexical__markOverlap{background:rgba(255,212,0,.3);border-bottom:2px solid rgba(255,212,0,.7)}.Lexical__mark.selected{background:rgba(255,212,0,.5);border-bottom:2px solid #ffd400}.Lexical__markOverlap.selected{background:rgba(255,212,0,.7);border-bottom:2px solid rgba(255,212,0,.7)}.Lexical__embedBlock{user-select:none}.Lexical__embedBlockFocus{outline:2px solid var(--sn-stylekit-info-color)}.Lexical__blockCursor{display:block;pointer-events:none;position:absolute}.Lexical__blockCursor:after{content:"";display:block;position:absolute;top:-2px;width:20px;border-top:1px solid var(--sn-stylekit-editor-foreground-color);animation:CursorBlink 1.1s steps(2, start) infinite}@keyframes CursorBlink{to{visibility:hidden}}',""]);const a=s},32204:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(39601),i=n.n(r),o=n(82609),s=n.n(o)()(i());s.push([e.id,".Lexical__listItemUnchecked,.Lexical__listItemChecked{min-height:18px;margin-bottom:4px}.Lexical__table{margin:10px 0}",""]);const a=s},82609:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(r)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(s[l]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);r&&s[u[0]]||(void 0!==o&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=o),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),i&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=i):u[4]="".concat(i)),t.push(u))}},t}},39601:e=>{"use strict";e.exports=function(e){return e[1]}},28879:function(e){e.exports=function(){"use strict";var e=6e4,t=36e5,n="millisecond",r="second",i="minute",o="hour",s="day",a="week",l="month",c="quarter",u="year",d="date",h="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},m=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},y={s:m,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),o=n-i<0,s=t.clone().add(r+(o?-1:1),l);return+(-(r+(n-i)/(o?i-s:s-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:u,w:a,d:s,D:d,h:o,m:i,s:r,ms:n,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},v="en",A={};A[v]=g;var b=function(e){return e instanceof E},w=function e(t,n,r){var i;if(!t)return v;if("string"==typeof t){var o=t.toLowerCase();A[o]&&(i=o),n&&(A[o]=n,i=o);var s=t.split("-");if(!i&&s.length>1)return e(s[0])}else{var a=t.name;A[a]=t,i=a}return!r&&i&&(v=i),i||!r&&v},S=function(e,t){if(b(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new E(n)},C=y;C.l=w,C.i=b,C.w=function(e,t){return S(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=w(e.locale,null,!0),this.parse(e)}var m=g.prototype;return m.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(C.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(p);if(r){var i=r[2]-1||0,o=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},m.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},m.$utils=function(){return C},m.isValid=function(){return!(this.$d.toString()===h)},m.isSame=function(e,t){var n=S(e);return this.startOf(t)<=n&&n<=this.endOf(t)},m.isAfter=function(e,t){return S(e)<this.startOf(t)},m.isBefore=function(e,t){return this.endOf(t)<S(e)},m.$g=function(e,t,n){return C.u(e)?this[t]:this.set(n,e)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(e,t){var n=this,c=!!C.u(t)||t,h=C.p(e),p=function(e,t){var r=C.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return c?r:r.endOf(s)},f=function(e,t){return C.w(n.toDate()[e].apply(n.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},g=this.$W,m=this.$M,y=this.$D,v="set"+(this.$u?"UTC":"");switch(h){case u:return c?p(1,0):p(31,11);case l:return c?p(1,m):p(0,m+1);case a:var A=this.$locale().weekStart||0,b=(g<A?g+7:g)-A;return p(c?y-b:y+(6-b),m);case s:case d:return f(v+"Hours",0);case o:return f(v+"Minutes",1);case i:return f(v+"Seconds",2);case r:return f(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(e){return this.startOf(e,!1)},m.$set=function(e,t){var a,c=C.p(e),h="set"+(this.$u?"UTC":""),p=(a={},a[s]=h+"Date",a[d]=h+"Date",a[l]=h+"Month",a[u]=h+"FullYear",a[o]=h+"Hours",a[i]=h+"Minutes",a[r]=h+"Seconds",a[n]=h+"Milliseconds",a)[c],f=c===s?this.$D+(t-this.$W):t;if(c===l||c===u){var g=this.clone().set(d,1);g.$d[p](f),g.init(),this.$d=g.set(d,Math.min(this.$D,g.daysInMonth())).$d}else p&&this.$d[p](f);return this.init(),this},m.set=function(e,t){return this.clone().$set(e,t)},m.get=function(e){return this[C.p(e)]()},m.add=function(n,c){var d,h=this;n=Number(n);var p=C.p(c),f=function(e){var t=S(h);return C.w(t.date(t.date()+Math.round(e*n)),h)};if(p===l)return this.set(l,this.$M+n);if(p===u)return this.set(u,this.$y+n);if(p===s)return f(1);if(p===a)return f(7);var g=(d={},d[i]=e,d[o]=t,d[r]=1e3,d)[p]||1,m=this.$d.getTime()+n*g;return C.w(m,this)},m.subtract=function(e,t){return this.add(-1*e,t)},m.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||h;var r=e||"YYYY-MM-DDTHH:mm:ssZ",i=C.z(this),o=this.$H,s=this.$m,a=this.$M,l=n.weekdays,c=n.months,u=n.meridiem,d=function(e,n,i,o){return e&&(e[n]||e(t,r))||i[n].slice(0,o)},p=function(e){return C.s(o%12||12,e,"0")},g=u||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(f,(function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return C.s(t.$y,4,"0");case"M":return a+1;case"MM":return C.s(a+1,2,"0");case"MMM":return d(n.monthsShort,a,c,3);case"MMMM":return d(c,a);case"D":return t.$D;case"DD":return C.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(n.weekdaysMin,t.$W,l,2);case"ddd":return d(n.weekdaysShort,t.$W,l,3);case"dddd":return l[t.$W];case"H":return String(o);case"HH":return C.s(o,2,"0");case"h":return p(1);case"hh":return p(2);case"a":return g(o,s,!0);case"A":return g(o,s,!1);case"m":return String(s);case"mm":return C.s(s,2,"0");case"s":return String(t.$s);case"ss":return C.s(t.$s,2,"0");case"SSS":return C.s(t.$ms,3,"0");case"Z":return i}return null}(e)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(n,d,h){var p,f=this,g=C.p(d),m=S(n),y=(m.utcOffset()-this.utcOffset())*e,v=this-m,A=function(){return C.m(f,m)};switch(g){case u:p=A()/12;break;case l:p=A();break;case c:p=A()/3;break;case a:p=(v-y)/6048e5;break;case s:p=(v-y)/864e5;break;case o:p=v/t;break;case i:p=v/e;break;case r:p=v/1e3;break;default:p=v}return h?p:C.a(p)},m.daysInMonth=function(){return this.endOf(l).$D},m.$locale=function(){return A[this.$L]},m.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=w(e,t,!0);return r&&(n.$L=r),n},m.clone=function(){return C.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},g}(),I=E.prototype;return S.prototype=I,[["$ms",n],["$s",r],["$m",i],["$H",o],["$W",s],["$M",l],["$y",u],["$D",d]].forEach((function(e){I[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),S.extend=function(e,t){return e.$i||(e(t,E,S),e.$i=!0),S},S.locale=w,S.isDayjs=b,S.unix=function(e){return S(1e3*e)},S.en=A[v],S.Ls=A,S.p={},S}()},57449:function(e){e.exports=function(){"use strict";return function(e,t){var n=t.prototype,r=n.format;n.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return r.bind(this)(e);var i=this.$utils(),o=(e||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(e){switch(e){case"Q":return Math.ceil((t.$M+1)/3);case"Do":return n.ordinal(t.$D);case"gggg":return t.weekYear();case"GGGG":return t.isoWeekYear();case"wo":return n.ordinal(t.week(),"W");case"w":case"ww":return i.s(t.week(),"w"===e?1:2,"0");case"W":case"WW":return i.s(t.isoWeek(),"W"===e?1:2,"0");case"k":case"kk":return i.s(String(0===t.$H?24:t.$H),"k"===e?1:2,"0");case"X":return Math.floor(t.$d.getTime()/1e3);case"x":return t.$d.getTime();case"z":return"["+t.offsetName()+"]";case"zzz":return"["+t.offsetName("long")+"]";default:return e}}));return r.bind(this)(o)}}}()},89945:function(e){e.exports=function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d\d/,r=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},a=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:"+"===t[0]?-n:n}(e)}],c=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},u=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?"pm":"PM");return n},d={A:[i,function(e){this.afternoon=u(e,!1)}],a:[i,function(e){this.afternoon=u(e,!0)}],S:[/\d/,function(e){this.milliseconds=100*+e}],SS:[n,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[r,a("seconds")],ss:[r,a("seconds")],m:[r,a("minutes")],mm:[r,a("minutes")],H:[r,a("hours")],h:[r,a("hours")],HH:[r,a("hours")],hh:[r,a("hours")],D:[r,a("day")],DD:[n,a("day")],Do:[i,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,"")===e&&(this.day=r)}],M:[r,a("month")],MM:[n,a("month")],MMM:[i,function(e){var t=c("months"),n=(c("monthsShort")||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[i,function(e){var t=c("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,a("year")],YY:[n,function(e){this.year=s(e)}],YYYY:[/\d{4}/,a("year")],Z:l,ZZ:l};function h(n){var r,i;r=n,i=o&&o.formats;for(var s=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var o=r&&r.toUpperCase();return n||i[r]||e[r]||i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),a=s.length,l=0;l<a;l+=1){var c=s[l],u=d[c],h=u&&u[0],p=u&&u[1];s[l]=p?{regex:h,parser:p}:c.replace(/^\[|\]$/g,"")}return function(e){for(var t={},n=0,r=0;n<a;n+=1){var i=s[n];if("string"==typeof i)r+=i.length;else{var o=i.regex,l=i.parser,c=e.slice(r),u=o.exec(c)[0];l.call(t,u),e=e.replace(u,"")}}return function(e){var t=e.afternoon;if(void 0!==t){var n=e.hours;t?n<12&&(e.hours+=12):12===n&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,s=e.args;this.$u=r;var a=s[1];if("string"==typeof a){var l=!0===s[2],c=!0===s[3],u=l||c,d=s[2];c&&(d=s[2]),o=this.$locale(),!l&&d&&(o=n.Ls[d]),this.$d=function(e,t,n){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var r=h(t)(e),i=r.year,o=r.month,s=r.day,a=r.hours,l=r.minutes,c=r.seconds,u=r.milliseconds,d=r.zone,p=new Date,f=s||(i||o?1:p.getDate()),g=i||p.getFullYear(),m=0;i&&!o||(m=o>0?o-1:p.getMonth());var y=a||0,v=l||0,A=c||0,b=u||0;return d?new Date(Date.UTC(g,m,f,y,v,A,b+60*d.offset*1e3)):n?new Date(Date.UTC(g,m,f,y,v,A,b)):new Date(g,m,f,y,v,A,b)}catch(e){return new Date("")}}(t,a,r),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(a)&&(this.$d=new Date("")),o={}}else if(a instanceof Array)for(var p=a.length,f=1;f<=p;f+=1){s[1]=a[f-1];var g=n.apply(this,s);if(g.isValid()){this.$d=g.$d,this.$L=g.$L,this.init();break}f===p&&(this.$d=new Date(""))}else i.call(this,e)}}}()},66653:function(e){e.exports=function(){"use strict";var e="day";return function(t,n,r){var i=function(t){return t.add(4-t.isoWeekday(),e)},o=n.prototype;o.isoWeekYear=function(){return i(this).year()},o.isoWeek=function(t){if(!this.$utils().u(t))return this.add(7*(t-this.isoWeek()),e);var n,o,s,a=i(this),l=(n=this.isoWeekYear(),s=4-(o=(this.$u?r.utc:r)().year(n).startOf("year")).isoWeekday(),o.isoWeekday()>4&&(s+=7),o.add(s,e));return a.diff(l,"week")+1},o.isoWeekday=function(e){return this.$utils().u(e)?this.day()||7:this.day(this.day()%7?e:e-7)};var s=o.startOf;o.startOf=function(e,t){var n=this.$utils(),r=!!n.u(t)||t;return"isoweek"===n.p(e)?r?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):s.bind(this)(e,t)}}}()},77491:function(e){e.exports=function(){"use strict";return function(e,t,n){e=e||{};var r=t.prototype,i={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function o(e,t,n,i){return r.fromToBase(e,t,n,i)}n.en.relativeTime=i,r.fromToBase=function(t,r,o,s,a){for(var l,c,u,d=o.$locale().relativeTime||i,h=e.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],p=h.length,f=0;f<p;f+=1){var g=h[f];g.d&&(l=s?n(t).diff(o,g.d,!0):o.diff(t,g.d,!0));var m=(e.rounding||Math.round)(Math.abs(l));if(u=l>0,m<=g.r||!g.r){m<=1&&f>0&&(g=h[f-1]);var y=d[g.l];a&&(m=a(""+m)),c="string"==typeof y?y.replace("%d",m):y(m,r,g.l,u);break}}if(r)return c;var v=u?d.future:d.past;return"function"==typeof v?v(c):v.replace("%s",c)},r.to=function(e,t){return o(e,t,this,!0)},r.from=function(e,t){return o(e,t,this)};var s=function(e){return e.$u?n.utc():n()};r.toNow=function(e){return this.to(s(this),e)},r.fromNow=function(e){return this.from(s(this),e)}}}()},67338:function(e){e.exports=function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(n,r,i){var o,s=function(e,n,r){void 0===r&&(r={});var i=new Date(e),o=function(e,n){void 0===n&&(n={});var r=n.timeZoneName||"short",i=e+"|"+r,o=t[i];return o||(o=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:r}),t[i]=o),o}(n,r);return o.formatToParts(i)},a=function(t,n){for(var r=s(t,n),o=[],a=0;a<r.length;a+=1){var l=r[a],c=l.type,u=l.value,d=e[c];d>=0&&(o[d]=parseInt(u,10))}var h=o[3],p=24===h?0:h,f=o[0]+"-"+o[1]+"-"+o[2]+" "+p+":"+o[4]+":"+o[5]+":000",g=+t;return(i.utc(f).valueOf()-(g-=g%1e3))/6e4},l=r.prototype;l.tz=function(e,t){void 0===e&&(e=o);var n=this.utcOffset(),r=this.toDate(),s=r.toLocaleString("en-US",{timeZone:e}),a=Math.round((r-new Date(s))/1e3/60),l=i(s).$set("millisecond",this.$ms).utcOffset(15*-Math.round(r.getTimezoneOffset()/15)-a,!0);if(t){var c=l.utcOffset();l=l.add(n-c,"minute")}return l.$x.$timezone=e,l},l.offsetName=function(e){var t=this.$x.$timezone||i.tz.guess(),n=s(this.valueOf(),t,{timeZoneName:e}).find((function(e){return"timezonename"===e.type.toLowerCase()}));return n&&n.value};var c=l.startOf;l.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return c.call(this,e,t);var n=i(this.format("YYYY-MM-DD HH:mm:ss:SSS"));return c.call(n,e,t).tz(this.$x.$timezone,!0)},i.tz=function(e,t,n){var r=n&&t,s=n||t||o,l=a(+i(),s);if("string"!=typeof e)return i(e).tz(s);var c=function(e,t,n){var r=e-60*t*1e3,i=a(r,n);if(t===i)return[r,t];var o=a(r-=60*(i-t)*1e3,n);return i===o?[r,i]:[e-60*Math.min(i,o)*1e3,Math.max(i,o)]}(i.utc(e,r).valueOf(),l,s),u=c[0],d=c[1],h=i(u).utcOffset(d);return h.$x.$timezone=s,h},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(e){o=e}}}()},53193:function(e){e.exports=function(){"use strict";return function(e,t,n){n.updateLocale=function(e,t){var r=n.Ls[e];if(r)return(t?Object.keys(t):[]).forEach((function(e){r[e]=t[e]})),r}}}()},10264:function(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,i,o){var s=i.prototype;o.utc=function(e){return new i({date:e,utc:!0,args:arguments})},s.utc=function(t){var n=o(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},s.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var a=s.parse;s.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),a.call(this,e)};var l=s.init;s.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var c=s.utcOffset;s.utcOffset=function(r,i){var o=this.$utils().u;if(o(r))return this.$u?0:o(this.$offset)?c.call(this):this.$offset;if("string"==typeof r&&(r=function(e){void 0===e&&(e="");var r=e.match(t);if(!r)return null;var i=(""+r[0]).match(n)||["-",0,0],o=i[0],s=60*+i[1]+ +i[2];return 0===s?0:"+"===o?s:-s}(r),null===r))return this;var s=Math.abs(r)<=16?60*r:r,a=this;if(i)return a.$offset=s,a.$u=0===r,a;if(0!==r){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(a=this.local().add(s+l,e)).$offset=s,a.$x.$localOffset=l}else a=this.utc();return a};var u=s.format;s.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return u.call(this,t)},s.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},s.isUTC=function(){return!!this.$u},s.toISOString=function(){return this.toDate().toISOString()},s.toString=function(){return this.toDate().toUTCString()};var d=s.toDate;s.toDate=function(e){return"s"===e&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var h=s.diff;s.diff=function(e,t,n){if(e&&this.$u===e.$u)return h.call(this,e,t,n);var r=this.local(),i=o(e).local();return h.call(r,i,t,n)}}}()},90742:function(e){e.exports=function(){"use strict";var e="week",t="year";return function(n,r,i){var o=r.prototype;o.week=function(n){if(void 0===n&&(n=null),null!==n)return this.add(7*(n-this.week()),"day");var r=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var o=i(this).startOf(t).add(1,t).date(r),s=i(this).endOf(e);if(o.isBefore(s))return 1}var a=i(this).startOf(t).date(r).startOf(e).subtract(1,"millisecond"),l=this.diff(a,e,!0);return l<0?i(this).startOf("week").week():Math.ceil(l)},o.weeks=function(e){return void 0===e&&(e=null),this.week(e)}}}()},42090:function(e){e.exports=function(){"use strict";return function(e,t){t.prototype.weekYear=function(){var e=this.month(),t=this.week(),n=this.year();return 1===t&&11===e?n+1:0===e&&t>=52?n-1:n}}}()},35368:function(e){e.exports=function(){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}function n(e,r,i){return n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,n,r){var i=[null];i.push.apply(i,n);var o=new(Function.bind.apply(e,i));return r&&t(o,r.prototype),o},n.apply(null,arguments)}function r(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var o=Object.hasOwnProperty,s=Object.setPrototypeOf,a=Object.isFrozen,l=Object.getPrototypeOf,c=Object.getOwnPropertyDescriptor,u=Object.freeze,d=Object.seal,h=Object.create,p="undefined"!=typeof Reflect&&Reflect,f=p.apply,g=p.construct;f||(f=function(e,t,n){return e.apply(t,n)}),u||(u=function(e){return e}),d||(d=function(e){return e}),g||(g=function(e,t){return n(e,r(t))});var m,y=P(Array.prototype.forEach),v=P(Array.prototype.pop),A=P(Array.prototype.push),b=P(String.prototype.toLowerCase),w=P(String.prototype.toString),S=P(String.prototype.match),C=P(String.prototype.replace),E=P(String.prototype.indexOf),I=P(String.prototype.trim),_=P(RegExp.prototype.test),x=(m=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g(m,t)});function P(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return f(e,t,r)}}function k(e,t,n){var r;n=null!==(r=n)&&void 0!==r?r:b,s&&s(e,null);for(var i=t.length;i--;){var o=t[i];if("string"==typeof o){var l=n(o);l!==o&&(a(t)||(t[i]=l),o=l)}e[o]=!0}return e}function B(e){var t,n=h(null);for(t in e)!0===f(o,e,[t])&&(n[t]=e[t]);return n}function O(e,t){for(;null!==e;){var n=c(e,t);if(n){if(n.get)return P(n.get);if("function"==typeof n.value)return P(n.value)}e=l(e)}return function(e){return console.warn("fallback value for",e),null}}var N=u(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),D=u(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),j=u(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),T=u(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),M=u(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),F=u(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),R=u(["#text"]),L=u(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),Q=u(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),U=u(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),V=u(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),K=d(/\{\{[\w\W]*|[\w\W]*\}\}/gm),H=d(/<%[\w\W]*|[\w\W]*%>/gm),G=d(/\${[\w\W]*}/gm),Y=d(/^data-[\-\w.\u00B7-\uFFFF]/),z=d(/^aria-[\-\w]+$/),Z=d(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),W=d(/^(?:\w+script|data):/i),q=d(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),J=d(/^html$/i),X=function(){return"undefined"==typeof window?null:window};return function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:X(),i=function(e){return t(e)};if(i.version="2.4.7",i.removed=[],!n||!n.document||9!==n.document.nodeType)return i.isSupported=!1,i;var o=n.document,s=n.document,a=n.DocumentFragment,l=n.HTMLTemplateElement,c=n.Node,d=n.Element,h=n.NodeFilter,p=n.NamedNodeMap,f=void 0===p?n.NamedNodeMap||n.MozNamedAttrMap:p,g=n.HTMLFormElement,m=n.DOMParser,P=n.trustedTypes,$=d.prototype,ee=O($,"cloneNode"),te=O($,"nextSibling"),ne=O($,"childNodes"),re=O($,"parentNode");if("function"==typeof l){var ie=s.createElement("template");ie.content&&ie.content.ownerDocument&&(s=ie.content.ownerDocument)}var oe=function(t,n){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var r=null,i="data-tt-policy-suffix";n.currentScript&&n.currentScript.hasAttribute(i)&&(r=n.currentScript.getAttribute(i));var o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(P,o),se=oe?oe.createHTML(""):"",ae=s,le=ae.implementation,ce=ae.createNodeIterator,ue=ae.createDocumentFragment,de=ae.getElementsByTagName,he=o.importNode,pe={};try{pe=B(s).documentMode?s.documentMode:{}}catch(e){}var fe={};i.isSupported="function"==typeof re&&le&&void 0!==le.createHTMLDocument&&9!==pe;var ge,me,ye=K,ve=H,Ae=G,be=Y,we=z,Se=W,Ce=q,Ee=Z,Ie=null,_e=k({},[].concat(r(N),r(D),r(j),r(M),r(R))),xe=null,Pe=k({},[].concat(r(L),r(Q),r(U),r(V))),ke=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Be=null,Oe=null,Ne=!0,De=!0,je=!1,Te=!0,Me=!1,Fe=!1,Re=!1,Le=!1,Qe=!1,Ue=!1,Ve=!1,Ke=!0,He=!1,Ge=!0,Ye=!1,ze={},Ze=null,We=k({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),qe=null,Je=k({},["audio","video","img","source","image","track"]),Xe=null,$e=k({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml",rt=nt,it=!1,ot=null,st=k({},[et,tt,nt],w),at=["application/xhtml+xml","text/html"],lt=null,ct=s.createElement("form"),ut=function(e){return e instanceof RegExp||e instanceof Function},dt=function(t){lt&&lt===t||(t&&"object"===e(t)||(t={}),t=B(t),ge=ge=-1===at.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,me="application/xhtml+xml"===ge?w:b,Ie="ALLOWED_TAGS"in t?k({},t.ALLOWED_TAGS,me):_e,xe="ALLOWED_ATTR"in t?k({},t.ALLOWED_ATTR,me):Pe,ot="ALLOWED_NAMESPACES"in t?k({},t.ALLOWED_NAMESPACES,w):st,Xe="ADD_URI_SAFE_ATTR"in t?k(B($e),t.ADD_URI_SAFE_ATTR,me):$e,qe="ADD_DATA_URI_TAGS"in t?k(B(Je),t.ADD_DATA_URI_TAGS,me):Je,Ze="FORBID_CONTENTS"in t?k({},t.FORBID_CONTENTS,me):We,Be="FORBID_TAGS"in t?k({},t.FORBID_TAGS,me):{},Oe="FORBID_ATTR"in t?k({},t.FORBID_ATTR,me):{},ze="USE_PROFILES"in t&&t.USE_PROFILES,Ne=!1!==t.ALLOW_ARIA_ATTR,De=!1!==t.ALLOW_DATA_ATTR,je=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Te=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,Me=t.SAFE_FOR_TEMPLATES||!1,Fe=t.WHOLE_DOCUMENT||!1,Qe=t.RETURN_DOM||!1,Ue=t.RETURN_DOM_FRAGMENT||!1,Ve=t.RETURN_TRUSTED_TYPE||!1,Le=t.FORCE_BODY||!1,Ke=!1!==t.SANITIZE_DOM,He=t.SANITIZE_NAMED_PROPS||!1,Ge=!1!==t.KEEP_CONTENT,Ye=t.IN_PLACE||!1,Ee=t.ALLOWED_URI_REGEXP||Ee,rt=t.NAMESPACE||nt,ke=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&ut(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ke.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&ut(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ke.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(ke.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Me&&(De=!1),Ue&&(Qe=!0),ze&&(Ie=k({},r(R)),xe=[],!0===ze.html&&(k(Ie,N),k(xe,L)),!0===ze.svg&&(k(Ie,D),k(xe,Q),k(xe,V)),!0===ze.svgFilters&&(k(Ie,j),k(xe,Q),k(xe,V)),!0===ze.mathMl&&(k(Ie,M),k(xe,U),k(xe,V))),t.ADD_TAGS&&(Ie===_e&&(Ie=B(Ie)),k(Ie,t.ADD_TAGS,me)),t.ADD_ATTR&&(xe===Pe&&(xe=B(xe)),k(xe,t.ADD_ATTR,me)),t.ADD_URI_SAFE_ATTR&&k(Xe,t.ADD_URI_SAFE_ATTR,me),t.FORBID_CONTENTS&&(Ze===We&&(Ze=B(Ze)),k(Ze,t.FORBID_CONTENTS,me)),Ge&&(Ie["#text"]=!0),Fe&&k(Ie,["html","head","body"]),Ie.table&&(k(Ie,["tbody"]),delete Be.tbody),u&&u(t),lt=t)},ht=k({},["mi","mo","mn","ms","mtext"]),pt=k({},["foreignobject","desc","title","annotation-xml"]),ft=k({},["title","style","font","a","script"]),gt=k({},D);k(gt,j),k(gt,T);var mt=k({},M);k(mt,F);var yt=function(e){A(i.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=se}catch(t){e.remove()}}},vt=function(e,t){try{A(i.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){A(i.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!xe[e])if(Qe||Ue)try{yt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},At=function(e){var t,n;if(Le)e="<remove></remove>"+e;else{var r=S(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===ge&&rt===nt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var i=oe?oe.createHTML(e):e;if(rt===nt)try{t=(new m).parseFromString(i,ge)}catch(e){}if(!t||!t.documentElement){t=le.createDocument(rt,"template",null);try{t.documentElement.innerHTML=it?se:i}catch(e){}}var o=t.body||t.documentElement;return e&&n&&o.insertBefore(s.createTextNode(n),o.childNodes[0]||null),rt===nt?de.call(t,Fe?"html":"body")[0]:Fe?t.documentElement:o},bt=function(e){return ce.call(e.ownerDocument||e,e,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT,null,!1)},wt=function(t){return"object"===e(c)?t instanceof c:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},St=function(e,t,n){fe[e]&&y(fe[e],(function(e){e.call(i,t,n,lt)}))},Ct=function(e){var t,n;if(St("beforeSanitizeElements",e,null),(n=e)instanceof g&&("string"!=typeof n.nodeName||"string"!=typeof n.textContent||"function"!=typeof n.removeChild||!(n.attributes instanceof f)||"function"!=typeof n.removeAttribute||"function"!=typeof n.setAttribute||"string"!=typeof n.namespaceURI||"function"!=typeof n.insertBefore||"function"!=typeof n.hasChildNodes))return yt(e),!0;if(_(/[\u0080-\uFFFF]/,e.nodeName))return yt(e),!0;var r=me(e.nodeName);if(St("uponSanitizeElement",e,{tagName:r,allowedTags:Ie}),e.hasChildNodes()&&!wt(e.firstElementChild)&&(!wt(e.content)||!wt(e.content.firstElementChild))&&_(/<[/\w]/g,e.innerHTML)&&_(/<[/\w]/g,e.textContent))return yt(e),!0;if("select"===r&&_(/<template/i,e.innerHTML))return yt(e),!0;if(!Ie[r]||Be[r]){if(!Be[r]&&It(r)){if(ke.tagNameCheck instanceof RegExp&&_(ke.tagNameCheck,r))return!1;if(ke.tagNameCheck instanceof Function&&ke.tagNameCheck(r))return!1}if(Ge&&!Ze[r]){var o=re(e)||e.parentNode,s=ne(e)||e.childNodes;if(s&&o)for(var a=s.length-1;a>=0;--a)o.insertBefore(ee(s[a],!0),te(e))}return yt(e),!0}return e instanceof d&&!function(e){var t=re(e);t&&t.tagName||(t={namespaceURI:rt,tagName:"template"});var n=b(e.tagName),r=b(t.tagName);return!!ot[e.namespaceURI]&&(e.namespaceURI===tt?t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&("annotation-xml"===r||ht[r]):Boolean(gt[n]):e.namespaceURI===et?t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&&pt[r]:Boolean(mt[n]):e.namespaceURI===nt?!(t.namespaceURI===tt&&!pt[r])&&!(t.namespaceURI===et&&!ht[r])&&!mt[n]&&(ft[n]||!gt[n]):!("application/xhtml+xml"!==ge||!ot[e.namespaceURI]))}(e)?(yt(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!_(/<\/no(script|embed|frames)/i,e.innerHTML)?(Me&&3===e.nodeType&&(t=e.textContent,t=C(t,ye," "),t=C(t,ve," "),t=C(t,Ae," "),e.textContent!==t&&(A(i.removed,{element:e.cloneNode()}),e.textContent=t)),St("afterSanitizeElements",e,null),!1):(yt(e),!0)},Et=function(e,t,n){if(Ke&&("id"===t||"name"===t)&&(n in s||n in ct))return!1;if(De&&!Oe[t]&&_(be,t));else if(Ne&&_(we,t));else if(!xe[t]||Oe[t]){if(!(It(e)&&(ke.tagNameCheck instanceof RegExp&&_(ke.tagNameCheck,e)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(e))&&(ke.attributeNameCheck instanceof RegExp&&_(ke.attributeNameCheck,t)||ke.attributeNameCheck instanceof Function&&ke.attributeNameCheck(t))||"is"===t&&ke.allowCustomizedBuiltInElements&&(ke.tagNameCheck instanceof RegExp&&_(ke.tagNameCheck,n)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(n))))return!1}else if(Xe[t]);else if(_(Ee,C(n,Ce,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==E(n,"data:")||!qe[e])if(je&&!_(Se,C(n,Ce,"")));else if(n)return!1;return!0},It=function(e){return e.indexOf("-")>0},_t=function(t){var n,r,o,s;St("beforeSanitizeAttributes",t,null);var a=t.attributes;if(a){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe};for(s=a.length;s--;){var c=n=a[s],u=c.name,d=c.namespaceURI;if(r="value"===u?n.value:I(n.value),o=me(u),l.attrName=o,l.attrValue=r,l.keepAttr=!0,l.forceKeepAttr=void 0,St("uponSanitizeAttribute",t,l),r=l.attrValue,!l.forceKeepAttr&&(vt(u,t),l.keepAttr))if(Te||!_(/\/>/i,r)){Me&&(r=C(r,ye," "),r=C(r,ve," "),r=C(r,Ae," "));var h=me(t.nodeName);if(Et(h,o,r)){if(!He||"id"!==o&&"name"!==o||(vt(u,t),r="user-content-"+r),oe&&"object"===e(P)&&"function"==typeof P.getAttributeType)if(d);else switch(P.getAttributeType(h,o)){case"TrustedHTML":r=oe.createHTML(r);break;case"TrustedScriptURL":r=oe.createScriptURL(r)}try{d?t.setAttributeNS(d,u,r):t.setAttribute(u,r),v(i.removed)}catch(e){}}}else vt(u,t)}St("afterSanitizeAttributes",t,null)}},xt=function e(t){var n,r=bt(t);for(St("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)St("uponSanitizeShadowNode",n,null),Ct(n)||(n.content instanceof a&&e(n.content),_t(n));St("afterSanitizeShadowDOM",t,null)};return i.sanitize=function(t){var r,s,l,u,d,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((it=!t)&&(t="\x3c!--\x3e"),"string"!=typeof t&&!wt(t)){if("function"!=typeof t.toString)throw x("toString is not a function");if("string"!=typeof(t=t.toString()))throw x("dirty is not a string, aborting")}if(!i.isSupported){if("object"===e(n.toStaticHTML)||"function"==typeof n.toStaticHTML){if("string"==typeof t)return n.toStaticHTML(t);if(wt(t))return n.toStaticHTML(t.outerHTML)}return t}if(Re||dt(h),i.removed=[],"string"==typeof t&&(Ye=!1),Ye){if(t.nodeName){var p=me(t.nodeName);if(!Ie[p]||Be[p])throw x("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof c)1===(s=(r=At("\x3c!----\x3e")).ownerDocument.importNode(t,!0)).nodeType&&"BODY"===s.nodeName||"HTML"===s.nodeName?r=s:r.appendChild(s);else{if(!Qe&&!Me&&!Fe&&-1===t.indexOf("<"))return oe&&Ve?oe.createHTML(t):t;if(!(r=At(t)))return Qe?null:Ve?se:""}r&&Le&&yt(r.firstChild);for(var f=bt(Ye?t:r);l=f.nextNode();)3===l.nodeType&&l===u||Ct(l)||(l.content instanceof a&&xt(l.content),_t(l),u=l);if(u=null,Ye)return t;if(Qe){if(Ue)for(d=ue.call(r.ownerDocument);r.firstChild;)d.appendChild(r.firstChild);else d=r;return(xe.shadowroot||xe.shadowrootmod)&&(d=he.call(o,d,!0)),d}var g=Fe?r.outerHTML:r.innerHTML;return Fe&&Ie["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&_(J,r.ownerDocument.doctype.name)&&(g="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+g),Me&&(g=C(g,ye," "),g=C(g,ve," "),g=C(g,Ae," ")),oe&&Ve?oe.createHTML(g):g},i.setConfig=function(e){dt(e),Re=!0},i.clearConfig=function(){lt=null,Re=!1},i.isValidAttribute=function(e,t,n){lt||dt({});var r=me(e),i=me(t);return Et(r,i,n)},i.addHook=function(e,t){"function"==typeof t&&(fe[e]=fe[e]||[],A(fe[e],t))},i.removeHook=function(e){if(fe[e])return v(fe[e])},i.removeHooks=function(e){fe[e]&&(fe[e]=[])},i.removeAllHooks=function(){fe={}},i}()}()},29661:e=>{var t=-1,n=1,r=0;function i(e,g,m,y,v){if(e===g)return e?[[r,e]]:[];if(null!=m){var b=function(e,t,n){var r="number"==typeof n?{index:n,length:0}:n.oldRange,i="number"==typeof n?null:n.newRange,o=e.length,s=t.length;if(0===r.length&&(null===i||0===i.length)){var a=r.index,l=e.slice(0,a),c=e.slice(a),u=i?i.index:null,d=a+s-o;if((null===u||u===d)&&!(d<0||d>s)){var h=t.slice(0,d);if((g=t.slice(d))===c){var p=Math.min(a,d);if((y=l.slice(0,p))===(b=h.slice(0,p)))return A(y,l.slice(p),h.slice(p),c)}}if(null===u||u===a){var f=a,g=(h=t.slice(0,f),t.slice(f));if(h===l){var m=Math.min(o-f,s-f);if((v=c.slice(c.length-m))===(w=g.slice(g.length-m)))return A(l,c.slice(0,c.length-m),g.slice(0,g.length-m),v)}}}if(r.length>0&&i&&0===i.length){var y=e.slice(0,r.index),v=e.slice(r.index+r.length);if(!(s<(p=y.length)+(m=v.length))){var b=t.slice(0,p),w=t.slice(s-m);if(y===b&&v===w)return A(y,e.slice(p,o-m),t.slice(p,s-m),v)}}return null}(e,g,m);if(b)return b}var w=s(e,g),S=e.substring(0,w);w=l(e=e.substring(w),g=g.substring(w));var C=e.substring(e.length-w),E=function(e,a){var c;if(!e)return[[n,a]];if(!a)return[[t,e]];var u=e.length>a.length?e:a,d=e.length>a.length?a:e,h=u.indexOf(d);if(-1!==h)return c=[[n,u.substring(0,h)],[r,d],[n,u.substring(h+d.length)]],e.length>a.length&&(c[0][0]=c[2][0]=t),c;if(1===d.length)return[[t,e],[n,a]];var p=function(e,t){var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||2*r.length<n.length)return null;function i(e,t,n){for(var r,i,o,a,c=e.substring(n,n+Math.floor(e.length/4)),u=-1,d="";-1!==(u=t.indexOf(c,u+1));){var h=s(e.substring(n),t.substring(u)),p=l(e.substring(0,n),t.substring(0,u));d.length<p+h&&(d=t.substring(u-p,u)+t.substring(u,u+h),r=e.substring(0,n-p),i=e.substring(n+h),o=t.substring(0,u-p),a=t.substring(u+h))}return 2*d.length>=e.length?[r,i,o,a,d]:null}var o,a,c,u,d,h=i(n,r,Math.ceil(n.length/4)),p=i(n,r,Math.ceil(n.length/2));return h||p?(o=p?h&&h[4].length>p[4].length?h:p:h,e.length>t.length?(a=o[0],c=o[1],u=o[2],d=o[3]):(u=o[0],d=o[1],a=o[2],c=o[3]),[a,c,u,d,o[4]]):null}(e,a);if(p){var f=p[0],g=p[1],m=p[2],y=p[3],v=p[4],A=i(f,m),b=i(g,y);return A.concat([[r,v]],b)}return function(e,r){for(var i=e.length,s=r.length,a=Math.ceil((i+s)/2),l=a,c=2*a,u=new Array(c),d=new Array(c),h=0;h<c;h++)u[h]=-1,d[h]=-1;u[l+1]=0,d[l+1]=0;for(var p=i-s,f=p%2!=0,g=0,m=0,y=0,v=0,A=0;A<a;A++){for(var b=-A+g;b<=A-m;b+=2){for(var w=l+b,S=(x=b===-A||b!==A&&u[w-1]<u[w+1]?u[w+1]:u[w-1]+1)-b;x<i&&S<s&&e.charAt(x)===r.charAt(S);)x++,S++;if(u[w]=x,x>i)m+=2;else if(S>s)g+=2;else if(f&&(I=l+p-b)>=0&&I<c&&-1!==d[I]&&x>=(E=i-d[I]))return o(e,r,x,S)}for(var C=-A+y;C<=A-v;C+=2){for(var E,I=l+C,_=(E=C===-A||C!==A&&d[I-1]<d[I+1]?d[I+1]:d[I-1]+1)-C;E<i&&_<s&&e.charAt(i-E-1)===r.charAt(s-_-1);)E++,_++;if(d[I]=E,E>i)v+=2;else if(_>s)y+=2;else if(!f){var x;if((w=l+p-C)>=0&&w<c&&-1!==u[w])if(S=l+(x=u[w])-w,x>=(E=i-E))return o(e,r,x,S)}}}return[[t,e],[n,r]]}(e,a)}(e=e.substring(0,e.length-w),g=g.substring(0,g.length-w));return S&&E.unshift([r,S]),C&&E.push([r,C]),f(E,v),y&&function(e){for(var i=!1,o=[],s=0,g=null,m=0,y=0,v=0,A=0,b=0;m<e.length;)e[m][0]==r?(o[s++]=m,y=A,v=b,A=0,b=0,g=e[m][1]):(e[m][0]==n?A+=e[m][1].length:b+=e[m][1].length,g&&g.length<=Math.max(y,v)&&g.length<=Math.max(A,b)&&(e.splice(o[s-1],0,[t,g]),e[o[s-1]+1][0]=n,s--,m=--s>0?o[s-1]:-1,y=0,v=0,A=0,b=0,g=null,i=!0)),m++;for(i&&f(e),function(e){function t(e,t){if(!e||!t)return 6;var n=e.charAt(e.length-1),r=t.charAt(0),i=n.match(c),o=r.match(c),s=i&&n.match(u),a=o&&r.match(u),l=s&&n.match(d),f=a&&r.match(d),g=l&&e.match(h),m=f&&t.match(p);return g||m?5:l||f?4:i&&!s&&a?3:s||a?2:i||o?1:0}for(var n=1;n<e.length-1;){if(e[n-1][0]==r&&e[n+1][0]==r){var i=e[n-1][1],o=e[n][1],s=e[n+1][1],a=l(i,o);if(a){var f=o.substring(o.length-a);i=i.substring(0,i.length-a),o=f+o.substring(0,o.length-a),s=f+s}for(var g=i,m=o,y=s,v=t(i,o)+t(o,s);o.charAt(0)===s.charAt(0);){i+=o.charAt(0),o=o.substring(1)+s.charAt(0),s=s.substring(1);var A=t(i,o)+t(o,s);A>=v&&(v=A,g=i,m=o,y=s)}e[n-1][1]!=g&&(g?e[n-1][1]=g:(e.splice(n-1,1),n--),e[n][1]=m,y?e[n+1][1]=y:(e.splice(n+1,1),n--))}n++}}(e),m=1;m<e.length;){if(e[m-1][0]==t&&e[m][0]==n){var w=e[m-1][1],S=e[m][1],C=a(w,S),E=a(S,w);C>=E?(C>=w.length/2||C>=S.length/2)&&(e.splice(m,0,[r,S.substring(0,C)]),e[m-1][1]=w.substring(0,w.length-C),e[m+1][1]=S.substring(C),m++):(E>=w.length/2||E>=S.length/2)&&(e.splice(m,0,[r,w.substring(0,E)]),e[m-1][0]=n,e[m-1][1]=S.substring(0,S.length-E),e[m+1][0]=t,e[m+1][1]=w.substring(E),m++),m++}m++}}(E),E}function o(e,t,n,r){var o=e.substring(0,n),s=t.substring(0,r),a=e.substring(n),l=t.substring(r),c=i(o,s),u=i(a,l);return c.concat(u)}function s(e,t){if(!e||!t||e.charAt(0)!==t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,o=0;n<i;)e.substring(o,i)==t.substring(o,i)?o=n=i:r=i,i=Math.floor((r-n)/2+n);return g(e.charCodeAt(i-1))&&i--,i}function a(e,t){var n=e.length,r=t.length;if(0==n||0==r)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var i=Math.min(n,r);if(e==t)return i;for(var o=0,s=1;;){var a=e.substring(i-s),l=t.indexOf(a);if(-1==l)return o;s+=l,0!=l&&e.substring(i-s)!=t.substring(0,s)||(o=s,s++)}}function l(e,t){if(!e||!t||e.slice(-1)!==t.slice(-1))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,o=0;n<i;)e.substring(e.length-i,e.length-o)==t.substring(t.length-i,t.length-o)?o=n=i:r=i,i=Math.floor((r-n)/2+n);return m(e.charCodeAt(e.length-i))&&i--,i}var c=/[^a-zA-Z0-9]/,u=/\s/,d=/[\r\n]/,h=/\n\r?\n$/,p=/^\r?\n\r?\n/;function f(e,i){e.push([r,""]);for(var o,a=0,c=0,u=0,d="",h="";a<e.length;)if(a<e.length-1&&!e[a][1])e.splice(a,1);else switch(e[a][0]){case n:u++,h+=e[a][1],a++;break;case t:c++,d+=e[a][1],a++;break;case r:var p=a-u-c-1;if(i){if(p>=0&&v(e[p][1])){var g=e[p][1].slice(-1);if(e[p][1]=e[p][1].slice(0,-1),d=g+d,h=g+h,!e[p][1]){e.splice(p,1),a--;var m=p-1;e[m]&&e[m][0]===n&&(u++,h=e[m][1]+h,m--),e[m]&&e[m][0]===t&&(c++,d=e[m][1]+d,m--),p=m}}y(e[a][1])&&(g=e[a][1].charAt(0),e[a][1]=e[a][1].slice(1),d+=g,h+=g)}if(a<e.length-1&&!e[a][1]){e.splice(a,1);break}if(d.length>0||h.length>0){d.length>0&&h.length>0&&(0!==(o=s(h,d))&&(p>=0?e[p][1]+=h.substring(0,o):(e.splice(0,0,[r,h.substring(0,o)]),a++),h=h.substring(o),d=d.substring(o)),0!==(o=l(h,d))&&(e[a][1]=h.substring(h.length-o)+e[a][1],h=h.substring(0,h.length-o),d=d.substring(0,d.length-o)));var A=u+c;0===d.length&&0===h.length?(e.splice(a-A,A),a-=A):0===d.length?(e.splice(a-A,A,[n,h]),a=a-A+1):0===h.length?(e.splice(a-A,A,[t,d]),a=a-A+1):(e.splice(a-A,A,[t,d],[n,h]),a=a-A+2)}0!==a&&e[a-1][0]===r?(e[a-1][1]+=e[a][1],e.splice(a,1)):a++,u=0,c=0,d="",h=""}""===e[e.length-1][1]&&e.pop();var b=!1;for(a=1;a<e.length-1;)e[a-1][0]===r&&e[a+1][0]===r&&(e[a][1].substring(e[a][1].length-e[a-1][1].length)===e[a-1][1]?(e[a][1]=e[a-1][1]+e[a][1].substring(0,e[a][1].length-e[a-1][1].length),e[a+1][1]=e[a-1][1]+e[a+1][1],e.splice(a-1,1),b=!0):e[a][1].substring(0,e[a+1][1].length)==e[a+1][1]&&(e[a-1][1]+=e[a+1][1],e[a][1]=e[a][1].substring(e[a+1][1].length)+e[a+1][1],e.splice(a+1,1),b=!0)),a++;b&&f(e,i)}function g(e){return e>=55296&&e<=56319}function m(e){return e>=56320&&e<=57343}function y(e){return m(e.charCodeAt(0))}function v(e){return g(e.charCodeAt(e.length-1))}function A(e,i,o,s){return v(e)||y(s)?null:function(e){for(var t=[],n=0;n<e.length;n++)e[n][1].length>0&&t.push(e[n]);return t}([[r,e],[t,i],[n,o],[r,s]])}function b(e,t,n,r){return i(e,t,n,r,!0)}b.INSERT=n,b.DELETE=t,b.EQUAL=r,e.exports=b},62333:(e,t)=>{t.read=function(e,t,n,r,i){var o,s,a=8*i-r-1,l=(1<<a)-1,c=l>>1,u=-7,d=n?i-1:0,h=n?-1:1,p=e[t+d];for(d+=h,o=p&(1<<-u)-1,p>>=-u,u+=a;u>0;o=256*o+e[t+d],d+=h,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=r;u>0;s=256*s+e[t+d],d+=h,u-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),o-=c}return(p?-1:1)*s*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var s,a,l,c=8*o-i-1,u=(1<<c)-1,d=u>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,f=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+d>=1?h/l:h*Math.pow(2,1-d))*l>=2&&(s++,l/=2),s+d>=u?(a=0,s=u):s+d>=1?(a=(t*l-1)*Math.pow(2,i),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[n+p]=255&a,p+=f,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[n+p]=255&s,p+=f,s/=256,c-=8);e[n+p-f]|=128*g}},39925:function(e,t,n){var r,i,o,s,a;a="object"==typeof(s=this).sodium&&"function"==typeof s.sodium.onload?s.sodium.onload:null,i=[t,n(39631)],r=function(e,t){"use strict";var n,r=t.ready.then((function(){function r(){if(0!==n._sodium_init())throw new Error("libsodium was not correctly initialized.");for(var t=["crypto_aead_chacha20poly1305_decrypt","crypto_aead_chacha20poly1305_decrypt_detached","crypto_aead_chacha20poly1305_encrypt","crypto_aead_chacha20poly1305_encrypt_detached","crypto_aead_chacha20poly1305_ietf_decrypt","crypto_aead_chacha20poly1305_ietf_decrypt_detached","crypto_aead_chacha20poly1305_ietf_encrypt","crypto_aead_chacha20poly1305_ietf_encrypt_detached","crypto_aead_chacha20poly1305_ietf_keygen","crypto_aead_chacha20poly1305_keygen","crypto_aead_xchacha20poly1305_ietf_decrypt","crypto_aead_xchacha20poly1305_ietf_decrypt_detached","crypto_aead_xchacha20poly1305_ietf_encrypt","crypto_aead_xchacha20poly1305_ietf_encrypt_detached","crypto_aead_xchacha20poly1305_ietf_keygen","crypto_auth","crypto_auth_hmacsha256","crypto_auth_hmacsha256_final","crypto_auth_hmacsha256_init","crypto_auth_hmacsha256_keygen","crypto_auth_hmacsha256_update","crypto_auth_hmacsha256_verify","crypto_auth_hmacsha512","crypto_auth_hmacsha512_final","crypto_auth_hmacsha512_init","crypto_auth_hmacsha512_keygen","crypto_auth_hmacsha512_update","crypto_auth_hmacsha512_verify","crypto_auth_keygen","crypto_auth_verify","crypto_box_beforenm","crypto_box_curve25519xchacha20poly1305_keypair","crypto_box_curve25519xchacha20poly1305_seal","crypto_box_curve25519xchacha20poly1305_seal_open","crypto_box_detached","crypto_box_easy","crypto_box_easy_afternm","crypto_box_keypair","crypto_box_open_detached","crypto_box_open_easy","crypto_box_open_easy_afternm","crypto_box_seal","crypto_box_seal_open","crypto_box_seed_keypair","crypto_core_ed25519_add","crypto_core_ed25519_from_hash","crypto_core_ed25519_from_uniform","crypto_core_ed25519_is_valid_point","crypto_core_ed25519_random","crypto_core_ed25519_scalar_add","crypto_core_ed25519_scalar_complement","crypto_core_ed25519_scalar_invert","crypto_core_ed25519_scalar_mul","crypto_core_ed25519_scalar_negate","crypto_core_ed25519_scalar_random","crypto_core_ed25519_scalar_reduce","crypto_core_ed25519_scalar_sub","crypto_core_ed25519_sub","crypto_core_hchacha20","crypto_core_hsalsa20","crypto_core_ristretto255_add","crypto_core_ristretto255_from_hash","crypto_core_ristretto255_is_valid_point","crypto_core_ristretto255_random","crypto_core_ristretto255_scalar_add","crypto_core_ristretto255_scalar_complement","crypto_core_ristretto255_scalar_invert","crypto_core_ristretto255_scalar_mul","crypto_core_ristretto255_scalar_negate","crypto_core_ristretto255_scalar_random","crypto_core_ristretto255_scalar_reduce","crypto_core_ristretto255_scalar_sub","crypto_core_ristretto255_sub","crypto_generichash","crypto_generichash_blake2b_salt_personal","crypto_generichash_final","crypto_generichash_init","crypto_generichash_keygen","crypto_generichash_update","crypto_hash","crypto_hash_sha256","crypto_hash_sha256_final","crypto_hash_sha256_init","crypto_hash_sha256_update","crypto_hash_sha512","crypto_hash_sha512_final","crypto_hash_sha512_init","crypto_hash_sha512_update","crypto_kdf_derive_from_key","crypto_kdf_keygen","crypto_kx_client_session_keys","crypto_kx_keypair","crypto_kx_seed_keypair","crypto_kx_server_session_keys","crypto_onetimeauth","crypto_onetimeauth_final","crypto_onetimeauth_init","crypto_onetimeauth_keygen","crypto_onetimeauth_update","crypto_onetimeauth_verify","crypto_pwhash","crypto_pwhash_scryptsalsa208sha256","crypto_pwhash_scryptsalsa208sha256_ll","crypto_pwhash_scryptsalsa208sha256_str","crypto_pwhash_scryptsalsa208sha256_str_verify","crypto_pwhash_str","crypto_pwhash_str_needs_rehash","crypto_pwhash_str_verify","crypto_scalarmult","crypto_scalarmult_base","crypto_scalarmult_ed25519","crypto_scalarmult_ed25519_base","crypto_scalarmult_ed25519_base_noclamp","crypto_scalarmult_ed25519_noclamp","crypto_scalarmult_ristretto255","crypto_scalarmult_ristretto255_base","crypto_secretbox_detached","crypto_secretbox_easy","crypto_secretbox_keygen","crypto_secretbox_open_detached","crypto_secretbox_open_easy","crypto_secretstream_xchacha20poly1305_init_pull","crypto_secretstream_xchacha20poly1305_init_push","crypto_secretstream_xchacha20poly1305_keygen","crypto_secretstream_xchacha20poly1305_pull","crypto_secretstream_xchacha20poly1305_push","crypto_secretstream_xchacha20poly1305_rekey","crypto_shorthash","crypto_shorthash_keygen","crypto_shorthash_siphashx24","crypto_sign","crypto_sign_detached","crypto_sign_ed25519_pk_to_curve25519","crypto_sign_ed25519_sk_to_curve25519","crypto_sign_ed25519_sk_to_pk","crypto_sign_ed25519_sk_to_seed","crypto_sign_final_create","crypto_sign_final_verify","crypto_sign_init","crypto_sign_keypair","crypto_sign_open","crypto_sign_seed_keypair","crypto_sign_update","crypto_sign_verify_detached","crypto_stream_chacha20","crypto_stream_chacha20_ietf_xor","crypto_stream_chacha20_ietf_xor_ic","crypto_stream_chacha20_keygen","crypto_stream_chacha20_xor","crypto_stream_chacha20_xor_ic","crypto_stream_keygen","crypto_stream_xchacha20_keygen","crypto_stream_xchacha20_xor","crypto_stream_xchacha20_xor_ic","randombytes_buf","randombytes_buf_deterministic","randombytes_close","randombytes_random","randombytes_set_implementation","randombytes_stir","randombytes_uniform","sodium_version_string"],r=[w,S,C,E,I,_,x,P,k,B,O,N,D,j,T,M,F,R,L,Q,U,V,K,H,G,Y,z,Z,W,q,J,X,$,ee,te,ne,re,ie,oe,se,ae,le,ce,ue,de,he,pe,fe,ge,me,ye,ve,Ae,be,we,Se,Ce,Ee,Ie,_e,xe,Pe,ke,Be,Oe,Ne,De,je,Te,Me,Fe,Re,Le,Qe,Ue,Ve,Ke,He,Ge,Ye,ze,Ze,We,qe,Je,Xe,$e,et,tt,nt,rt,it,ot,st,at,lt,ct,ut,dt,ht,pt,ft,gt,mt,yt,vt,At,bt,wt,St,Ct,Et,It,_t,xt,Pt,kt,Bt,Ot,Nt,Dt,jt,Tt,Mt,Ft,Rt,Lt,Qt,Ut,Vt,Kt,Ht,Gt,Yt,zt,Zt,Wt,qt,Jt,Xt,$t,en,tn,nn,rn,on,sn,an,ln,cn,un,dn,hn,pn,fn,gn,mn,yn,vn,An,bn,wn],i=0;i<r.length;i++)"function"==typeof n["_"+t[i]]&&(e[t[i]]=r[i]);var o=["SODIUM_LIBRARY_VERSION_MAJOR","SODIUM_LIBRARY_VERSION_MINOR","crypto_aead_chacha20poly1305_ABYTES","crypto_aead_chacha20poly1305_IETF_ABYTES","crypto_aead_chacha20poly1305_IETF_KEYBYTES","crypto_aead_chacha20poly1305_IETF_MESSAGEBYTES_MAX","crypto_aead_chacha20poly1305_IETF_NPUBBYTES","crypto_aead_chacha20poly1305_IETF_NSECBYTES","crypto_aead_chacha20poly1305_KEYBYTES","crypto_aead_chacha20poly1305_MESSAGEBYTES_MAX","crypto_aead_chacha20poly1305_NPUBBYTES","crypto_aead_chacha20poly1305_NSECBYTES","crypto_aead_chacha20poly1305_ietf_ABYTES","crypto_aead_chacha20poly1305_ietf_KEYBYTES","crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX","crypto_aead_chacha20poly1305_ietf_NPUBBYTES","crypto_aead_chacha20poly1305_ietf_NSECBYTES","crypto_aead_xchacha20poly1305_IETF_ABYTES","crypto_aead_xchacha20poly1305_IETF_KEYBYTES","crypto_aead_xchacha20poly1305_IETF_MESSAGEBYTES_MAX","crypto_aead_xchacha20poly1305_IETF_NPUBBYTES","crypto_aead_xchacha20poly1305_IETF_NSECBYTES","crypto_aead_xchacha20poly1305_ietf_ABYTES","crypto_aead_xchacha20poly1305_ietf_KEYBYTES","crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX","crypto_aead_xchacha20poly1305_ietf_NPUBBYTES","crypto_aead_xchacha20poly1305_ietf_NSECBYTES","crypto_auth_BYTES","crypto_auth_KEYBYTES","crypto_auth_hmacsha256_BYTES","crypto_auth_hmacsha256_KEYBYTES","crypto_auth_hmacsha512256_BYTES","crypto_auth_hmacsha512256_KEYBYTES","crypto_auth_hmacsha512_BYTES","crypto_auth_hmacsha512_KEYBYTES","crypto_box_BEFORENMBYTES","crypto_box_MACBYTES","crypto_box_MESSAGEBYTES_MAX","crypto_box_NONCEBYTES","crypto_box_PUBLICKEYBYTES","crypto_box_SEALBYTES","crypto_box_SECRETKEYBYTES","crypto_box_SEEDBYTES","crypto_box_curve25519xchacha20poly1305_BEFORENMBYTES","crypto_box_curve25519xchacha20poly1305_MACBYTES","crypto_box_curve25519xchacha20poly1305_MESSAGEBYTES_MAX","crypto_box_curve25519xchacha20poly1305_NONCEBYTES","crypto_box_curve25519xchacha20poly1305_PUBLICKEYBYTES","crypto_box_curve25519xchacha20poly1305_SEALBYTES","crypto_box_curve25519xchacha20poly1305_SECRETKEYBYTES","crypto_box_curve25519xchacha20poly1305_SEEDBYTES","crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES","crypto_box_curve25519xsalsa20poly1305_MACBYTES","crypto_box_curve25519xsalsa20poly1305_MESSAGEBYTES_MAX","crypto_box_curve25519xsalsa20poly1305_NONCEBYTES","crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES","crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES","crypto_box_curve25519xsalsa20poly1305_SEEDBYTES","crypto_core_ed25519_BYTES","crypto_core_ed25519_HASHBYTES","crypto_core_ed25519_NONREDUCEDSCALARBYTES","crypto_core_ed25519_SCALARBYTES","crypto_core_ed25519_UNIFORMBYTES","crypto_core_hchacha20_CONSTBYTES","crypto_core_hchacha20_INPUTBYTES","crypto_core_hchacha20_KEYBYTES","crypto_core_hchacha20_OUTPUTBYTES","crypto_core_hsalsa20_CONSTBYTES","crypto_core_hsalsa20_INPUTBYTES","crypto_core_hsalsa20_KEYBYTES","crypto_core_hsalsa20_OUTPUTBYTES","crypto_core_ristretto255_BYTES","crypto_core_ristretto255_HASHBYTES","crypto_core_ristretto255_NONREDUCEDSCALARBYTES","crypto_core_ristretto255_SCALARBYTES","crypto_core_salsa2012_CONSTBYTES","crypto_core_salsa2012_INPUTBYTES","crypto_core_salsa2012_KEYBYTES","crypto_core_salsa2012_OUTPUTBYTES","crypto_core_salsa20_CONSTBYTES","crypto_core_salsa20_INPUTBYTES","crypto_core_salsa20_KEYBYTES","crypto_core_salsa20_OUTPUTBYTES","crypto_generichash_BYTES","crypto_generichash_BYTES_MAX","crypto_generichash_BYTES_MIN","crypto_generichash_KEYBYTES","crypto_generichash_KEYBYTES_MAX","crypto_generichash_KEYBYTES_MIN","crypto_generichash_blake2b_BYTES","crypto_generichash_blake2b_BYTES_MAX","crypto_generichash_blake2b_BYTES_MIN","crypto_generichash_blake2b_KEYBYTES","crypto_generichash_blake2b_KEYBYTES_MAX","crypto_generichash_blake2b_KEYBYTES_MIN","crypto_generichash_blake2b_PERSONALBYTES","crypto_generichash_blake2b_SALTBYTES","crypto_hash_BYTES","crypto_hash_sha256_BYTES","crypto_hash_sha512_BYTES","crypto_kdf_BYTES_MAX","crypto_kdf_BYTES_MIN","crypto_kdf_CONTEXTBYTES","crypto_kdf_KEYBYTES","crypto_kdf_blake2b_BYTES_MAX","crypto_kdf_blake2b_BYTES_MIN","crypto_kdf_blake2b_CONTEXTBYTES","crypto_kdf_blake2b_KEYBYTES","crypto_kx_PUBLICKEYBYTES","crypto_kx_SECRETKEYBYTES","crypto_kx_SEEDBYTES","crypto_kx_SESSIONKEYBYTES","crypto_onetimeauth_BYTES","crypto_onetimeauth_KEYBYTES","crypto_onetimeauth_poly1305_BYTES","crypto_onetimeauth_poly1305_KEYBYTES","crypto_pwhash_ALG_ARGON2I13","crypto_pwhash_ALG_ARGON2ID13","crypto_pwhash_ALG_DEFAULT","crypto_pwhash_BYTES_MAX","crypto_pwhash_BYTES_MIN","crypto_pwhash_MEMLIMIT_INTERACTIVE","crypto_pwhash_MEMLIMIT_MAX","crypto_pwhash_MEMLIMIT_MIN","crypto_pwhash_MEMLIMIT_MODERATE","crypto_pwhash_MEMLIMIT_SENSITIVE","crypto_pwhash_OPSLIMIT_INTERACTIVE","crypto_pwhash_OPSLIMIT_MAX","crypto_pwhash_OPSLIMIT_MIN","crypto_pwhash_OPSLIMIT_MODERATE","crypto_pwhash_OPSLIMIT_SENSITIVE","crypto_pwhash_PASSWD_MAX","crypto_pwhash_PASSWD_MIN","crypto_pwhash_SALTBYTES","crypto_pwhash_STRBYTES","crypto_pwhash_argon2i_BYTES_MAX","crypto_pwhash_argon2i_BYTES_MIN","crypto_pwhash_argon2i_SALTBYTES","crypto_pwhash_argon2i_STRBYTES","crypto_pwhash_argon2id_BYTES_MAX","crypto_pwhash_argon2id_BYTES_MIN","crypto_pwhash_argon2id_SALTBYTES","crypto_pwhash_argon2id_STRBYTES","crypto_pwhash_scryptsalsa208sha256_BYTES_MAX","crypto_pwhash_scryptsalsa208sha256_BYTES_MIN","crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE","crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MAX","crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MIN","crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_SENSITIVE","crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE","crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MAX","crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN","crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_SENSITIVE","crypto_pwhash_scryptsalsa208sha256_SALTBYTES","crypto_pwhash_scryptsalsa208sha256_STRBYTES","crypto_scalarmult_BYTES","crypto_scalarmult_SCALARBYTES","crypto_scalarmult_curve25519_BYTES","crypto_scalarmult_curve25519_SCALARBYTES","crypto_scalarmult_ed25519_BYTES","crypto_scalarmult_ed25519_SCALARBYTES","crypto_scalarmult_ristretto255_BYTES","crypto_scalarmult_ristretto255_SCALARBYTES","crypto_secretbox_KEYBYTES","crypto_secretbox_MACBYTES","crypto_secretbox_MESSAGEBYTES_MAX","crypto_secretbox_NONCEBYTES","crypto_secretbox_xchacha20poly1305_KEYBYTES","crypto_secretbox_xchacha20poly1305_MACBYTES","crypto_secretbox_xchacha20poly1305_MESSAGEBYTES_MAX","crypto_secretbox_xchacha20poly1305_NONCEBYTES","crypto_secretbox_xsalsa20poly1305_KEYBYTES","crypto_secretbox_xsalsa20poly1305_MACBYTES","crypto_secretbox_xsalsa20poly1305_MESSAGEBYTES_MAX","crypto_secretbox_xsalsa20poly1305_NONCEBYTES","crypto_secretstream_xchacha20poly1305_ABYTES","crypto_secretstream_xchacha20poly1305_HEADERBYTES","crypto_secretstream_xchacha20poly1305_KEYBYTES","crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX","crypto_secretstream_xchacha20poly1305_TAG_FINAL","crypto_secretstream_xchacha20poly1305_TAG_MESSAGE","crypto_secretstream_xchacha20poly1305_TAG_PUSH","crypto_secretstream_xchacha20poly1305_TAG_REKEY","crypto_shorthash_BYTES","crypto_shorthash_KEYBYTES","crypto_shorthash_siphash24_BYTES","crypto_shorthash_siphash24_KEYBYTES","crypto_shorthash_siphashx24_BYTES","crypto_shorthash_siphashx24_KEYBYTES","crypto_sign_BYTES","crypto_sign_MESSAGEBYTES_MAX","crypto_sign_PUBLICKEYBYTES","crypto_sign_SECRETKEYBYTES","crypto_sign_SEEDBYTES","crypto_sign_ed25519_BYTES","crypto_sign_ed25519_MESSAGEBYTES_MAX","crypto_sign_ed25519_PUBLICKEYBYTES","crypto_sign_ed25519_SECRETKEYBYTES","crypto_sign_ed25519_SEEDBYTES","crypto_stream_KEYBYTES","crypto_stream_MESSAGEBYTES_MAX","crypto_stream_NONCEBYTES","crypto_stream_chacha20_IETF_KEYBYTES","crypto_stream_chacha20_IETF_MESSAGEBYTES_MAX","crypto_stream_chacha20_IETF_NONCEBYTES","crypto_stream_chacha20_KEYBYTES","crypto_stream_chacha20_MESSAGEBYTES_MAX","crypto_stream_chacha20_NONCEBYTES","crypto_stream_chacha20_ietf_KEYBYTES","crypto_stream_chacha20_ietf_MESSAGEBYTES_MAX","crypto_stream_chacha20_ietf_NONCEBYTES","crypto_stream_salsa2012_KEYBYTES","crypto_stream_salsa2012_MESSAGEBYTES_MAX","crypto_stream_salsa2012_NONCEBYTES","crypto_stream_salsa208_KEYBYTES","crypto_stream_salsa208_MESSAGEBYTES_MAX","crypto_stream_salsa208_NONCEBYTES","crypto_stream_salsa20_KEYBYTES","crypto_stream_salsa20_MESSAGEBYTES_MAX","crypto_stream_salsa20_NONCEBYTES","crypto_stream_xchacha20_KEYBYTES","crypto_stream_xchacha20_MESSAGEBYTES_MAX","crypto_stream_xchacha20_NONCEBYTES","crypto_stream_xsalsa20_KEYBYTES","crypto_stream_xsalsa20_MESSAGEBYTES_MAX","crypto_stream_xsalsa20_NONCEBYTES","crypto_verify_16_BYTES","crypto_verify_32_BYTES","crypto_verify_64_BYTES"];for(i=0;i<o.length;i++)"function"==typeof(a=n["_"+o[i].toLowerCase()])&&(e[o[i]]=a());var s=["SODIUM_VERSION_STRING","crypto_pwhash_STRPREFIX","crypto_pwhash_scryptsalsa208sha256_STRPREFIX"];for(i=0;i<s.length;i++){var a;"function"==typeof(a=n["_"+s[i].toLowerCase()])&&(e[s[i]]=n.UTF8ToString(a()))}}n=t;try{r();var i=new Uint8Array([98,97,108,108,115]),o=e.randombytes_buf(e.crypto_secretbox_NONCEBYTES),s=e.randombytes_buf(e.crypto_secretbox_KEYBYTES),a=e.crypto_secretbox_easy(i,o,s),l=e.crypto_secretbox_open_easy(a,o,s);if(e.memcmp(i,l))return}catch(e){if(null==n.useBackupModule)throw new Error("Both wasm and asm failed to load"+e)}n.useBackupModule(),r()}));function i(e){if("function"==typeof TextEncoder)return(new TextEncoder).encode(e);e=unescape(encodeURIComponent(e));for(var t=new Uint8Array(e.length),n=0,r=e.length;n<r;n++)t[n]=e.charCodeAt(n);return t}function o(e){if("function"==typeof TextDecoder)return new TextDecoder("utf-8",{fatal:!0}).decode(e);var t=8192,n=Math.ceil(e.length/t);if(n<=1)try{return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))}catch(e){throw new TypeError("The encoded data was not valid.")}for(var r="",i=0,s=0;s<n;s++){var a=Array.prototype.slice.call(e,s*t+i,(s+1)*t+i);if(0!=a.length){var l,c=a.length,u=0;do{var d=a[--c];d>=240?(u=4,l=!0):d>=224?(u=3,l=!0):d>=192?(u=2,l=!0):d<128&&(u=1,l=!0)}while(!l);for(var h=u-(a.length-c),p=0;p<h;p++)i--,a.pop();r+=o(a)}}return r}function s(e){e=b(null,e,"input");for(var t,n,r,i="",o=0;o<e.length;o++)r=87+(n=15&e[o])+(n-10>>8&-39)<<8|87+(t=e[o]>>>4)+(t-10>>8&-39),i+=String.fromCharCode(255&r)+String.fromCharCode(r>>>8);return i}var a={ORIGINAL:1,ORIGINAL_NO_PADDING:3,URLSAFE:5,URLSAFE_NO_PADDING:7};function l(e){if(null==e)return a.URLSAFE_NO_PADDING;if(e!==a.ORIGINAL&&e!==a.ORIGINAL_NO_PADDING&&e!==a.URLSAFE&&e!=a.URLSAFE_NO_PADDING)throw new Error("unsupported base64 variant");return e}function c(e,t){t=l(t),e=b(i,e,"input");var r,i=[],s=0|Math.floor(e.length/3),a=e.length-3*s,c=4*s+(0!==a?0==(2&t)?4:2+(a>>>1):0),u=new p(c+1),d=f(e);return i.push(d),i.push(u.address),0===n._sodium_bin2base64(u.address,u.length,d,e.length,t)&&y(i,"conversion failed"),u.length=c,r=o(u.to_Uint8Array()),m(i),r}function u(e,t){var n=t||"uint8array";if(!d(n))throw new Error(n+" output format is not available");if(e instanceof p){if("uint8array"===n)return e.to_Uint8Array();if("text"===n)return o(e.to_Uint8Array());if("hex"===n)return s(e.to_Uint8Array());if("base64"===n)return c(e.to_Uint8Array(),a.URLSAFE_NO_PADDING);throw new Error('What is output format "'+n+'"?')}if("object"==typeof e){for(var r=Object.keys(e),i={},l=0;l<r.length;l++)i[r[l]]=u(e[r[l]],n);return i}if("string"==typeof e)return e;throw new TypeError("Cannot format output")}function d(e){for(var t=["uint8array","text","hex","base64"],n=0;n<t.length;n++)if(t[n]===e)return!0;return!1}function h(e){if(e){if("string"!=typeof e)throw new TypeError("When defined, the output format must be a string");if(!d(e))throw new Error(e+" is not a supported output format")}}function p(e){this.length=e,this.address=g(e)}function f(e){var t=g(e.length);return n.HEAPU8.set(e,t),t}function g(e){var t=n._malloc(e);if(0===t)throw{message:"_malloc() failed",length:e};return t}function m(e){if(e)for(var t=0;t<e.length;t++)r=e[t],n._free(r);var r}function y(e,t){throw m(e),new Error(t)}function v(e,t){throw m(e),new TypeError(t)}function A(e,t,n){null==t&&v(e,n+" cannot be null or undefined")}function b(e,t,n){return A(e,t,n),t instanceof Uint8Array?t:"string"==typeof t?i(t):void v(e,"unsupported input type for "+n)}function w(e,t,r,i,o,s){var a=[];h(s);var l=null;null!=e&&(l=f(e=b(a,e,"secret_nonce")),e.length,a.push(l)),t=b(a,t,"ciphertext");var c,d=n._crypto_aead_chacha20poly1305_abytes(),g=t.length;g<d&&v(a,"ciphertext is too short"),c=f(t),a.push(c);var A=null,w=0;null!=r&&(A=f(r=b(a,r,"additional_data")),w=r.length,a.push(A)),i=b(a,i,"public_nonce");var S,C=0|n._crypto_aead_chacha20poly1305_npubbytes();i.length!==C&&v(a,"invalid public_nonce length"),S=f(i),a.push(S),o=b(a,o,"key");var E,I=0|n._crypto_aead_chacha20poly1305_keybytes();o.length!==I&&v(a,"invalid key length"),E=f(o),a.push(E);var _=new p(g-n._crypto_aead_chacha20poly1305_abytes()|0),x=_.address;if(a.push(x),0===n._crypto_aead_chacha20poly1305_decrypt(x,null,l,c,g,0,A,w,0,S,E)){var P=u(_,s);return m(a),P}y(a,"ciphertext cannot be decrypted using that key")}function S(e,t,r,i,o,s,a){var l=[];h(a);var c=null;null!=e&&(c=f(e=b(l,e,"secret_nonce")),e.length,l.push(c));var d=f(t=b(l,t,"ciphertext")),g=t.length;l.push(d),r=b(l,r,"mac");var A,w=0|n._crypto_box_macbytes();r.length!==w&&v(l,"invalid mac length"),A=f(r),l.push(A);var S=null,C=0;null!=i&&(S=f(i=b(l,i,"additional_data")),C=i.length,l.push(S)),o=b(l,o,"public_nonce");var E,I=0|n._crypto_aead_chacha20poly1305_npubbytes();o.length!==I&&v(l,"invalid public_nonce length"),E=f(o),l.push(E),s=b(l,s,"key");var _,x=0|n._crypto_aead_chacha20poly1305_keybytes();s.length!==x&&v(l,"invalid key length"),_=f(s),l.push(_);var P=new p(0|g),k=P.address;if(l.push(k),0===n._crypto_aead_chacha20poly1305_decrypt_detached(k,c,d,g,0,A,S,C,0,E,_)){var B=u(P,a);return m(l),B}y(l,"ciphertext cannot be decrypted using that key")}function C(e,t,r,i,o,s){var a=[];h(s);var l=f(e=b(a,e,"message")),c=e.length;a.push(l);var d=null,g=0;null!=t&&(d=f(t=b(a,t,"additional_data")),g=t.length,a.push(d));var A=null;null!=r&&(A=f(r=b(a,r,"secret_nonce")),r.length,a.push(A)),i=b(a,i,"public_nonce");var w,S=0|n._crypto_aead_chacha20poly1305_npubbytes();i.length!==S&&v(a,"invalid public_nonce length"),w=f(i),a.push(w),o=b(a,o,"key");var C,E=0|n._crypto_aead_chacha20poly1305_keybytes();o.length!==E&&v(a,"invalid key length"),C=f(o),a.push(C);var I=new p(c+n._crypto_aead_chacha20poly1305_abytes()|0),_=I.address;if(a.push(_),0===n._crypto_aead_chacha20poly1305_encrypt(_,null,l,c,0,d,g,0,A,w,C)){var x=u(I,s);return m(a),x}y(a,"invalid usage")}function E(e,t,r,i,o,s){var a=[];h(s);var l=f(e=b(a,e,"message")),c=e.length;a.push(l);var d=null,g=0;null!=t&&(d=f(t=b(a,t,"additional_data")),g=t.length,a.push(d));var A=null;null!=r&&(A=f(r=b(a,r,"secret_nonce")),r.length,a.push(A)),i=b(a,i,"public_nonce");var w,S=0|n._crypto_aead_chacha20poly1305_npubbytes();i.length!==S&&v(a,"invalid public_nonce length"),w=f(i),a.push(w),o=b(a,o,"key");var C,E=0|n._crypto_aead_chacha20poly1305_keybytes();o.length!==E&&v(a,"invalid key length"),C=f(o),a.push(C);var I=new p(0|c),_=I.address;a.push(_);var x=new p(0|n._crypto_aead_chacha20poly1305_abytes()),P=x.address;if(a.push(P),0===n._crypto_aead_chacha20poly1305_encrypt_detached(_,P,null,l,c,0,d,g,0,A,w,C)){var k=u({ciphertext:I,mac:x},s);return m(a),k}y(a,"invalid usage")}function I(e,t,r,i,o,s){var a=[];h(s);var l=null;null!=e&&(l=f(e=b(a,e,"secret_nonce")),e.length,a.push(l)),t=b(a,t,"ciphertext");var c,d=n._crypto_aead_chacha20poly1305_ietf_abytes(),g=t.length;g<d&&v(a,"ciphertext is too short"),c=f(t),a.push(c);var A=null,w=0;null!=r&&(A=f(r=b(a,r,"additional_data")),w=r.length,a.push(A)),i=b(a,i,"public_nonce");var S,C=0|n._crypto_aead_chacha20poly1305_ietf_npubbytes();i.length!==C&&v(a,"invalid public_nonce length"),S=f(i),a.push(S),o=b(a,o,"key");var E,I=0|n._crypto_aead_chacha20poly1305_ietf_keybytes();o.length!==I&&v(a,"invalid key length"),E=f(o),a.push(E);var _=new p(g-n._crypto_aead_chacha20poly1305_ietf_abytes()|0),x=_.address;if(a.push(x),0===n._crypto_aead_chacha20poly1305_ietf_decrypt(x,null,l,c,g,0,A,w,0,S,E)){var P=u(_,s);return m(a),P}y(a,"ciphertext cannot be decrypted using that key")}function _(e,t,r,i,o,s,a){var l=[];h(a);var c=null;null!=e&&(c=f(e=b(l,e,"secret_nonce")),e.length,l.push(c));var d=f(t=b(l,t,"ciphertext")),g=t.length;l.push(d),r=b(l,r,"mac");var A,w=0|n._crypto_box_macbytes();r.length!==w&&v(l,"invalid mac length"),A=f(r),l.push(A);var S=null,C=0;null!=i&&(S=f(i=b(l,i,"additional_data")),C=i.length,l.push(S)),o=b(l,o,"public_nonce");var E,I=0|n._crypto_aead_chacha20poly1305_ietf_npubbytes();o.length!==I&&v(l,"invalid public_nonce length"),E=f(o),l.push(E),s=b(l,s,"key");var _,x=0|n._crypto_aead_chacha20poly1305_ietf_keybytes();s.length!==x&&v(l,"invalid key length"),_=f(s),l.push(_);var P=new p(0|g),k=P.address;if(l.push(k),0===n._crypto_aead_chacha20poly1305_ietf_decrypt_detached(k,c,d,g,0,A,S,C,0,E,_)){var B=u(P,a);return m(l),B}y(l,"ciphertext cannot be decrypted using that key")}function x(e,t,r,i,o,s){var a=[];h(s);var l=f(e=b(a,e,"message")),c=e.length;a.push(l);var d=null,g=0;null!=t&&(d=f(t=b(a,t,"additional_data")),g=t.length,a.push(d));var A=null;null!=r&&(A=f(r=b(a,r,"secret_nonce")),r.length,a.push(A)),i=b(a,i,"public_nonce");var w,S=0|n._crypto_aead_chacha20poly1305_ietf_npubbytes();i.length!==S&&v(a,"invalid public_nonce length"),w=f(i),a.push(w),o=b(a,o,"key");var C,E=0|n._crypto_aead_chacha20poly1305_ietf_keybytes();o.length!==E&&v(a,"invalid key length"),C=f(o),a.push(C);var I=new p(c+n._crypto_aead_chacha20poly1305_ietf_abytes()|0),_=I.address;if(a.push(_),0===n._crypto_aead_chacha20poly1305_ietf_encrypt(_,null,l,c,0,d,g,0,A,w,C)){var x=u(I,s);return m(a),x}y(a,"invalid usage")}function P(e,t,r,i,o,s){var a=[];h(s);var l=f(e=b(a,e,"message")),c=e.length;a.push(l);var d=null,g=0;null!=t&&(d=f(t=b(a,t,"additional_data")),g=t.length,a.push(d));var A=null;null!=r&&(A=f(r=b(a,r,"secret_nonce")),r.length,a.push(A)),i=b(a,i,"public_nonce");var w,S=0|n._crypto_aead_chacha20poly1305_ietf_npubbytes();i.length!==S&&v(a,"invalid public_nonce length"),w=f(i),a.push(w),o=b(a,o,"key");var C,E=0|n._crypto_aead_chacha20poly1305_ietf_keybytes();o.length!==E&&v(a,"invalid key length"),C=f(o),a.push(C);var I=new p(0|c),_=I.address;a.push(_);var x=new p(0|n._crypto_aead_chacha20poly1305_ietf_abytes()),P=x.address;if(a.push(P),0===n._crypto_aead_chacha20poly1305_ietf_encrypt_detached(_,P,null,l,c,0,d,g,0,A,w,C)){var k=u({ciphertext:I,mac:x},s);return m(a),k}y(a,"invalid usage")}function k(e){var t=[];h(e);var r=new p(0|n._crypto_aead_chacha20poly1305_ietf_keybytes()),i=r.address;t.push(i),n._crypto_aead_chacha20poly1305_ietf_keygen(i);var o=u(r,e);return m(t),o}function B(e){var t=[];h(e);var r=new p(0|n._crypto_aead_chacha20poly1305_keybytes()),i=r.address;t.push(i),n._crypto_aead_chacha20poly1305_keygen(i);var o=u(r,e);return m(t),o}function O(e,t,r,i,o,s){var a=[];h(s);var l=null;null!=e&&(l=f(e=b(a,e,"secret_nonce")),e.length,a.push(l)),t=b(a,t,"ciphertext");var c,d=n._crypto_aead_xchacha20poly1305_ietf_abytes(),g=t.length;g<d&&v(a,"ciphertext is too short"),c=f(t),a.push(c);var A=null,w=0;null!=r&&(A=f(r=b(a,r,"additional_data")),w=r.length,a.push(A)),i=b(a,i,"public_nonce");var S,C=0|n._crypto_aead_xchacha20poly1305_ietf_npubbytes();i.length!==C&&v(a,"invalid public_nonce length"),S=f(i),a.push(S),o=b(a,o,"key");var E,I=0|n._crypto_aead_xchacha20poly1305_ietf_keybytes();o.length!==I&&v(a,"invalid key length"),E=f(o),a.push(E);var _=new p(g-n._crypto_aead_xchacha20poly1305_ietf_abytes()|0),x=_.address;if(a.push(x),0===n._crypto_aead_xchacha20poly1305_ietf_decrypt(x,null,l,c,g,0,A,w,0,S,E)){var P=u(_,s);return m(a),P}y(a,"ciphertext cannot be decrypted using that key")}function N(e,t,r,i,o,s,a){var l=[];h(a);var c=null;null!=e&&(c=f(e=b(l,e,"secret_nonce")),e.length,l.push(c));var d=f(t=b(l,t,"ciphertext")),g=t.length;l.push(d),r=b(l,r,"mac");var A,w=0|n._crypto_box_macbytes();r.length!==w&&v(l,"invalid mac length"),A=f(r),l.push(A);var S=null,C=0;null!=i&&(S=f(i=b(l,i,"additional_data")),C=i.length,l.push(S)),o=b(l,o,"public_nonce");var E,I=0|n._crypto_aead_xchacha20poly1305_ietf_npubbytes();o.length!==I&&v(l,"invalid public_nonce length"),E=f(o),l.push(E),s=b(l,s,"key");var _,x=0|n._crypto_aead_xchacha20poly1305_ietf_keybytes();s.length!==x&&v(l,"invalid key length"),_=f(s),l.push(_);var P=new p(0|g),k=P.address;if(l.push(k),0===n._crypto_aead_xchacha20poly1305_ietf_decrypt_detached(k,c,d,g,0,A,S,C,0,E,_)){var B=u(P,a);return m(l),B}y(l,"ciphertext cannot be decrypted using that key")}function D(e,t,r,i,o,s){var a=[];h(s);var l=f(e=b(a,e,"message")),c=e.length;a.push(l);var d=null,g=0;null!=t&&(d=f(t=b(a,t,"additional_data")),g=t.length,a.push(d));var A=null;null!=r&&(A=f(r=b(a,r,"secret_nonce")),r.length,a.push(A)),i=b(a,i,"public_nonce");var w,S=0|n._crypto_aead_xchacha20poly1305_ietf_npubbytes();i.length!==S&&v(a,"invalid public_nonce length"),w=f(i),a.push(w),o=b(a,o,"key");var C,E=0|n._crypto_aead_xchacha20poly1305_ietf_keybytes();o.length!==E&&v(a,"invalid key length"),C=f(o),a.push(C);var I=new p(c+n._crypto_aead_xchacha20poly1305_ietf_abytes()|0),_=I.address;if(a.push(_),0===n._crypto_aead_xchacha20poly1305_ietf_encrypt(_,null,l,c,0,d,g,0,A,w,C)){var x=u(I,s);return m(a),x}y(a,"invalid usage")}function j(e,t,r,i,o,s){var a=[];h(s);var l=f(e=b(a,e,"message")),c=e.length;a.push(l);var d=null,g=0;null!=t&&(d=f(t=b(a,t,"additional_data")),g=t.length,a.push(d));var A=null;null!=r&&(A=f(r=b(a,r,"secret_nonce")),r.length,a.push(A)),i=b(a,i,"public_nonce");var w,S=0|n._crypto_aead_xchacha20poly1305_ietf_npubbytes();i.length!==S&&v(a,"invalid public_nonce length"),w=f(i),a.push(w),o=b(a,o,"key");var C,E=0|n._crypto_aead_xchacha20poly1305_ietf_keybytes();o.length!==E&&v(a,"invalid key length"),C=f(o),a.push(C);var I=new p(0|c),_=I.address;a.push(_);var x=new p(0|n._crypto_aead_xchacha20poly1305_ietf_abytes()),P=x.address;if(a.push(P),0===n._crypto_aead_xchacha20poly1305_ietf_encrypt_detached(_,P,null,l,c,0,d,g,0,A,w,C)){var k=u({ciphertext:I,mac:x},s);return m(a),k}y(a,"invalid usage")}function T(e){var t=[];h(e);var r=new p(0|n._crypto_aead_xchacha20poly1305_ietf_keybytes()),i=r.address;t.push(i),n._crypto_aead_xchacha20poly1305_ietf_keygen(i);var o=u(r,e);return m(t),o}function M(e,t,r){var i=[];h(r);var o=f(e=b(i,e,"message")),s=e.length;i.push(o),t=b(i,t,"key");var a,l=0|n._crypto_auth_keybytes();t.length!==l&&v(i,"invalid key length"),a=f(t),i.push(a);var c=new p(0|n._crypto_auth_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_auth(d,o,s,0,a))){var g=u(c,r);return m(i),g}y(i,"invalid usage")}function F(e,t,r){var i=[];h(r);var o=f(e=b(i,e,"message")),s=e.length;i.push(o),t=b(i,t,"key");var a,l=0|n._crypto_auth_hmacsha256_keybytes();t.length!==l&&v(i,"invalid key length"),a=f(t),i.push(a);var c=new p(0|n._crypto_auth_hmacsha256_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_auth_hmacsha256(d,o,s,0,a))){var g=u(c,r);return m(i),g}y(i,"invalid usage")}function R(e,t){var r=[];h(t),A(r,e,"state_address");var i=new p(0|n._crypto_auth_hmacsha256_bytes()),o=i.address;if(r.push(o),0==(0|n._crypto_auth_hmacsha256_final(e,o))){var s=(n._free(e),u(i,t));return m(r),s}y(r,"invalid usage")}function L(e,t){var r=[];h(t);var i=null,o=0;null!=e&&(i=f(e=b(r,e,"key")),o=e.length,r.push(i));var s=new p(208).address;if(0==(0|n._crypto_auth_hmacsha256_init(s,i,o))){var a=s;return m(r),a}y(r,"invalid usage")}function Q(e){var t=[];h(e);var r=new p(0|n._crypto_auth_hmacsha256_keybytes()),i=r.address;t.push(i),n._crypto_auth_hmacsha256_keygen(i);var o=u(r,e);return m(t),o}function U(e,t,r){var i=[];h(r),A(i,e,"state_address");var o=f(t=b(i,t,"message_chunk")),s=t.length;i.push(o),0!=(0|n._crypto_auth_hmacsha256_update(e,o,s))&&y(i,"invalid usage"),m(i)}function V(e,t,r){var i=[];e=b(i,e,"tag");var o,s=0|n._crypto_auth_hmacsha256_bytes();e.length!==s&&v(i,"invalid tag length"),o=f(e),i.push(o);var a=f(t=b(i,t,"message")),l=t.length;i.push(a),r=b(i,r,"key");var c,u=0|n._crypto_auth_hmacsha256_keybytes();r.length!==u&&v(i,"invalid key length"),c=f(r),i.push(c);var d=0==(0|n._crypto_auth_hmacsha256_verify(o,a,l,0,c));return m(i),d}function K(e,t,r){var i=[];h(r);var o=f(e=b(i,e,"message")),s=e.length;i.push(o),t=b(i,t,"key");var a,l=0|n._crypto_auth_hmacsha512_keybytes();t.length!==l&&v(i,"invalid key length"),a=f(t),i.push(a);var c=new p(0|n._crypto_auth_hmacsha512_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_auth_hmacsha512(d,o,s,0,a))){var g=u(c,r);return m(i),g}y(i,"invalid usage")}function H(e,t){var r=[];h(t),A(r,e,"state_address");var i=new p(0|n._crypto_auth_hmacsha512_bytes()),o=i.address;if(r.push(o),0==(0|n._crypto_auth_hmacsha512_final(e,o))){var s=(n._free(e),u(i,t));return m(r),s}y(r,"invalid usage")}function G(e,t){var r=[];h(t);var i=null,o=0;null!=e&&(i=f(e=b(r,e,"key")),o=e.length,r.push(i));var s=new p(416).address;if(0==(0|n._crypto_auth_hmacsha512_init(s,i,o))){var a=s;return m(r),a}y(r,"invalid usage")}function Y(e){var t=[];h(e);var r=new p(0|n._crypto_auth_hmacsha512_keybytes()),i=r.address;t.push(i),n._crypto_auth_hmacsha512_keygen(i);var o=u(r,e);return m(t),o}function z(e,t,r){var i=[];h(r),A(i,e,"state_address");var o=f(t=b(i,t,"message_chunk")),s=t.length;i.push(o),0!=(0|n._crypto_auth_hmacsha512_update(e,o,s))&&y(i,"invalid usage"),m(i)}function Z(e,t,r){var i=[];e=b(i,e,"tag");var o,s=0|n._crypto_auth_hmacsha512_bytes();e.length!==s&&v(i,"invalid tag length"),o=f(e),i.push(o);var a=f(t=b(i,t,"message")),l=t.length;i.push(a),r=b(i,r,"key");var c,u=0|n._crypto_auth_hmacsha512_keybytes();r.length!==u&&v(i,"invalid key length"),c=f(r),i.push(c);var d=0==(0|n._crypto_auth_hmacsha512_verify(o,a,l,0,c));return m(i),d}function W(e){var t=[];h(e);var r=new p(0|n._crypto_auth_keybytes()),i=r.address;t.push(i),n._crypto_auth_keygen(i);var o=u(r,e);return m(t),o}function q(e,t,r){var i=[];e=b(i,e,"tag");var o,s=0|n._crypto_auth_bytes();e.length!==s&&v(i,"invalid tag length"),o=f(e),i.push(o);var a=f(t=b(i,t,"message")),l=t.length;i.push(a),r=b(i,r,"key");var c,u=0|n._crypto_auth_keybytes();r.length!==u&&v(i,"invalid key length"),c=f(r),i.push(c);var d=0==(0|n._crypto_auth_verify(o,a,l,0,c));return m(i),d}function J(e,t,r){var i=[];h(r),e=b(i,e,"publicKey");var o,s=0|n._crypto_box_publickeybytes();e.length!==s&&v(i,"invalid publicKey length"),o=f(e),i.push(o),t=b(i,t,"privateKey");var a,l=0|n._crypto_box_secretkeybytes();t.length!==l&&v(i,"invalid privateKey length"),a=f(t),i.push(a);var c=new p(0|n._crypto_box_beforenmbytes()),d=c.address;if(i.push(d),0==(0|n._crypto_box_beforenm(d,o,a))){var g=u(c,r);return m(i),g}y(i,"invalid usage")}function X(e){var t=[];h(e);var r=new p(0|n._crypto_box_curve25519xchacha20poly1305_publickeybytes()),i=r.address;t.push(i);var o=new p(0|n._crypto_box_curve25519xchacha20poly1305_secretkeybytes()),s=o.address;t.push(s),n._crypto_box_curve25519xchacha20poly1305_keypair(i,s);var a=u({publicKey:r,privateKey:o,keyType:"curve25519"},e);return m(t),a}function $(e,t,r){var i=[];h(r);var o=f(e=b(i,e,"message")),s=e.length;i.push(o),t=b(i,t,"publicKey");var a,l=0|n._crypto_box_curve25519xchacha20poly1305_publickeybytes();t.length!==l&&v(i,"invalid publicKey length"),a=f(t),i.push(a);var c=new p(s+n._crypto_box_curve25519xchacha20poly1305_sealbytes()|0),d=c.address;i.push(d),n._crypto_box_curve25519xchacha20poly1305_seal(d,o,s,0,a);var g=u(c,r);return m(i),g}function ee(e,t,r,i){var o=[];h(i),e=b(o,e,"ciphertext");var s,a=n._crypto_box_curve25519xchacha20poly1305_sealbytes(),l=e.length;l<a&&v(o,"ciphertext is too short"),s=f(e),o.push(s),t=b(o,t,"publicKey");var c,d=0|n._crypto_box_curve25519xchacha20poly1305_publickeybytes();t.length!==d&&v(o,"invalid publicKey length"),c=f(t),o.push(c),r=b(o,r,"secretKey");var g,y=0|n._crypto_box_curve25519xchacha20poly1305_secretkeybytes();r.length!==y&&v(o,"invalid secretKey length"),g=f(r),o.push(g);var A=new p(l-n._crypto_box_curve25519xchacha20poly1305_sealbytes()|0),w=A.address;o.push(w),n._crypto_box_curve25519xchacha20poly1305_seal_open(w,s,l,0,c,g);var S=u(A,i);return m(o),S}function te(e,t,r,i,o){var s=[];h(o);var a=f(e=b(s,e,"message")),l=e.length;s.push(a),t=b(s,t,"nonce");var c,d=0|n._crypto_box_noncebytes();t.length!==d&&v(s,"invalid nonce length"),c=f(t),s.push(c),r=b(s,r,"publicKey");var g,A=0|n._crypto_box_publickeybytes();r.length!==A&&v(s,"invalid publicKey length"),g=f(r),s.push(g),i=b(s,i,"privateKey");var w,S=0|n._crypto_box_secretkeybytes();i.length!==S&&v(s,"invalid privateKey length"),w=f(i),s.push(w);var C=new p(0|l),E=C.address;s.push(E);var I=new p(0|n._crypto_box_macbytes()),_=I.address;if(s.push(_),0==(0|n._crypto_box_detached(E,_,a,l,0,c,g,w))){var x=u({ciphertext:C,mac:I},o);return m(s),x}y(s,"invalid usage")}function ne(e,t,r,i,o){var s=[];h(o);var a=f(e=b(s,e,"message")),l=e.length;s.push(a),t=b(s,t,"nonce");var c,d=0|n._crypto_box_noncebytes();t.length!==d&&v(s,"invalid nonce length"),c=f(t),s.push(c),r=b(s,r,"publicKey");var g,A=0|n._crypto_box_publickeybytes();r.length!==A&&v(s,"invalid publicKey length"),g=f(r),s.push(g),i=b(s,i,"privateKey");var w,S=0|n._crypto_box_secretkeybytes();i.length!==S&&v(s,"invalid privateKey length"),w=f(i),s.push(w);var C=new p(l+n._crypto_box_macbytes()|0),E=C.address;if(s.push(E),0==(0|n._crypto_box_easy(E,a,l,0,c,g,w))){var I=u(C,o);return m(s),I}y(s,"invalid usage")}function re(e,t,r,i){var o=[];h(i);var s=f(e=b(o,e,"message")),a=e.length;o.push(s),t=b(o,t,"nonce");var l,c=0|n._crypto_box_noncebytes();t.length!==c&&v(o,"invalid nonce length"),l=f(t),o.push(l),r=b(o,r,"sharedKey");var d,g=0|n._crypto_box_beforenmbytes();r.length!==g&&v(o,"invalid sharedKey length"),d=f(r),o.push(d);var A=new p(a+n._crypto_box_macbytes()|0),w=A.address;if(o.push(w),0==(0|n._crypto_box_easy_afternm(w,s,a,0,l,d))){var S=u(A,i);return m(o),S}y(o,"invalid usage")}function ie(e){var t=[];h(e);var r=new p(0|n._crypto_box_publickeybytes()),i=r.address;t.push(i);var o=new p(0|n._crypto_box_secretkeybytes()),s=o.address;if(t.push(s),0==(0|n._crypto_box_keypair(i,s))){var a={publicKey:u(r,e),privateKey:u(o,e),keyType:"x25519"};return m(t),a}y(t,"internal error")}function oe(e,t,r,i,o,s){var a=[];h(s);var l=f(e=b(a,e,"ciphertext")),c=e.length;a.push(l),t=b(a,t,"mac");var d,g=0|n._crypto_box_macbytes();t.length!==g&&v(a,"invalid mac length"),d=f(t),a.push(d),r=b(a,r,"nonce");var A,w=0|n._crypto_box_noncebytes();r.length!==w&&v(a,"invalid nonce length"),A=f(r),a.push(A),i=b(a,i,"publicKey");var S,C=0|n._crypto_box_publickeybytes();i.length!==C&&v(a,"invalid publicKey length"),S=f(i),a.push(S),o=b(a,o,"privateKey");var E,I=0|n._crypto_box_secretkeybytes();o.length!==I&&v(a,"invalid privateKey length"),E=f(o),a.push(E);var _=new p(0|c),x=_.address;if(a.push(x),0==(0|n._crypto_box_open_detached(x,l,d,c,0,A,S,E))){var P=u(_,s);return m(a),P}y(a,"incorrect key pair for the given ciphertext")}function se(e,t,r,i,o){var s=[];h(o),e=b(s,e,"ciphertext");var a,l=n._crypto_box_macbytes(),c=e.length;c<l&&v(s,"ciphertext is too short"),a=f(e),s.push(a),t=b(s,t,"nonce");var d,g=0|n._crypto_box_noncebytes();t.length!==g&&v(s,"invalid nonce length"),d=f(t),s.push(d),r=b(s,r,"publicKey");var A,w=0|n._crypto_box_publickeybytes();r.length!==w&&v(s,"invalid publicKey length"),A=f(r),s.push(A),i=b(s,i,"privateKey");var S,C=0|n._crypto_box_secretkeybytes();i.length!==C&&v(s,"invalid privateKey length"),S=f(i),s.push(S);var E=new p(c-n._crypto_box_macbytes()|0),I=E.address;if(s.push(I),0==(0|n._crypto_box_open_easy(I,a,c,0,d,A,S))){var _=u(E,o);return m(s),_}y(s,"incorrect key pair for the given ciphertext")}function ae(e,t,r,i){var o=[];h(i);var s=f(e=b(o,e,"ciphertext")),a=e.length;o.push(s),t=b(o,t,"nonce");var l,c=0|n._crypto_box_noncebytes();t.length!==c&&v(o,"invalid nonce length"),l=f(t),o.push(l),r=b(o,r,"sharedKey");var d,g=0|n._crypto_box_beforenmbytes();r.length!==g&&v(o,"invalid sharedKey length"),d=f(r),o.push(d);var A=new p(a-n._crypto_box_macbytes()|0),w=A.address;if(o.push(w),0==(0|n._crypto_box_open_easy_afternm(w,s,a,0,l,d))){var S=u(A,i);return m(o),S}y(o,"incorrect secret key for the given ciphertext")}function le(e,t,r){var i=[];h(r);var o=f(e=b(i,e,"message")),s=e.length;i.push(o),t=b(i,t,"publicKey");var a,l=0|n._crypto_box_publickeybytes();t.length!==l&&v(i,"invalid publicKey length"),a=f(t),i.push(a);var c=new p(s+n._crypto_box_sealbytes()|0),d=c.address;if(i.push(d),0==(0|n._crypto_box_seal(d,o,s,0,a))){var g=u(c,r);return m(i),g}y(i,"invalid usage")}function ce(e,t,r,i){var o=[];h(i),e=b(o,e,"ciphertext");var s,a=n._crypto_box_sealbytes(),l=e.length;l<a&&v(o,"ciphertext is too short"),s=f(e),o.push(s),t=b(o,t,"publicKey");var c,d=0|n._crypto_box_publickeybytes();t.length!==d&&v(o,"invalid publicKey length"),c=f(t),o.push(c),r=b(o,r,"privateKey");var g,A=0|n._crypto_box_secretkeybytes();r.length!==A&&v(o,"invalid privateKey length"),g=f(r),o.push(g);var w=new p(l-n._crypto_box_sealbytes()|0),S=w.address;if(o.push(S),0==(0|n._crypto_box_seal_open(S,s,l,0,c,g))){var C=u(w,i);return m(o),C}y(o,"incorrect key pair for the given ciphertext")}function ue(e,t){var r=[];h(t),e=b(r,e,"seed");var i,o=0|n._crypto_box_seedbytes();e.length!==o&&v(r,"invalid seed length"),i=f(e),r.push(i);var s=new p(0|n._crypto_box_publickeybytes()),a=s.address;r.push(a);var l=new p(0|n._crypto_box_secretkeybytes()),c=l.address;if(r.push(c),0==(0|n._crypto_box_seed_keypair(a,c,i))){var d={publicKey:u(s,t),privateKey:u(l,t),keyType:"x25519"};return m(r),d}y(r,"invalid usage")}function de(e,t,r){var i=[];h(r),e=b(i,e,"p");var o,s=0|n._crypto_core_ed25519_bytes();e.length!==s&&v(i,"invalid p length"),o=f(e),i.push(o),t=b(i,t,"q");var a,l=0|n._crypto_core_ed25519_bytes();t.length!==l&&v(i,"invalid q length"),a=f(t),i.push(a);var c=new p(0|n._crypto_core_ed25519_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_core_ed25519_add(d,o,a))){var g=u(c,r);return m(i),g}y(i,"input is an invalid element")}function he(e,t){var r=[];h(t);var i=f(e=b(r,e,"r"));e.length,r.push(i);var o=new p(0|n._crypto_core_ed25519_bytes()),s=o.address;if(r.push(s),0==(0|n._crypto_core_ed25519_from_hash(s,i))){var a=u(o,t);return m(r),a}y(r,"invalid usage")}function pe(e,t){var r=[];h(t);var i=f(e=b(r,e,"r"));e.length,r.push(i);var o=new p(0|n._crypto_core_ed25519_bytes()),s=o.address;if(r.push(s),0==(0|n._crypto_core_ed25519_from_uniform(s,i))){var a=u(o,t);return m(r),a}y(r,"invalid usage")}function fe(e,t){var r=[];h(t),e=b(r,e,"repr");var i,o=0|n._crypto_core_ed25519_bytes();e.length!==o&&v(r,"invalid repr length"),i=f(e),r.push(i);var s=1==(0|n._crypto_core_ed25519_is_valid_point(i));return m(r),s}function ge(e){var t=[];h(e);var r=new p(0|n._crypto_core_ed25519_bytes()),i=r.address;t.push(i),n._crypto_core_ed25519_random(i);var o=u(r,e);return m(t),o}function me(e,t,r){var i=[];h(r),e=b(i,e,"x");var o,s=0|n._crypto_core_ed25519_scalarbytes();e.length!==s&&v(i,"invalid x length"),o=f(e),i.push(o),t=b(i,t,"y");var a,l=0|n._crypto_core_ed25519_scalarbytes();t.length!==l&&v(i,"invalid y length"),a=f(t),i.push(a);var c=new p(0|n._crypto_core_ed25519_scalarbytes()),d=c.address;i.push(d),n._crypto_core_ed25519_scalar_add(d,o,a);var g=u(c,r);return m(i),g}function ye(e,t){var r=[];h(t),e=b(r,e,"s");var i,o=0|n._crypto_core_ed25519_scalarbytes();e.length!==o&&v(r,"invalid s length"),i=f(e),r.push(i);var s=new p(0|n._crypto_core_ed25519_scalarbytes()),a=s.address;r.push(a),n._crypto_core_ed25519_scalar_complement(a,i);var l=u(s,t);return m(r),l}function ve(e,t){var r=[];h(t),e=b(r,e,"s");var i,o=0|n._crypto_core_ed25519_scalarbytes();e.length!==o&&v(r,"invalid s length"),i=f(e),r.push(i);var s=new p(0|n._crypto_core_ed25519_scalarbytes()),a=s.address;if(r.push(a),0==(0|n._crypto_core_ed25519_scalar_invert(a,i))){var l=u(s,t);return m(r),l}y(r,"invalid reciprocate")}function Ae(e,t,r){var i=[];h(r),e=b(i,e,"x");var o,s=0|n._crypto_core_ed25519_scalarbytes();e.length!==s&&v(i,"invalid x length"),o=f(e),i.push(o),t=b(i,t,"y");var a,l=0|n._crypto_core_ed25519_scalarbytes();t.length!==l&&v(i,"invalid y length"),a=f(t),i.push(a);var c=new p(0|n._crypto_core_ed25519_scalarbytes()),d=c.address;i.push(d),n._crypto_core_ed25519_scalar_mul(d,o,a);var g=u(c,r);return m(i),g}function be(e,t){var r=[];h(t),e=b(r,e,"s");var i,o=0|n._crypto_core_ed25519_scalarbytes();e.length!==o&&v(r,"invalid s length"),i=f(e),r.push(i);var s=new p(0|n._crypto_core_ed25519_scalarbytes()),a=s.address;r.push(a),n._crypto_core_ed25519_scalar_negate(a,i);var l=u(s,t);return m(r),l}function we(e){var t=[];h(e);var r=new p(0|n._crypto_core_ed25519_scalarbytes()),i=r.address;t.push(i),n._crypto_core_ed25519_scalar_random(i);var o=u(r,e);return m(t),o}function Se(e,t){var r=[];h(t),e=b(r,e,"sample");var i,o=0|n._crypto_core_ed25519_nonreducedscalarbytes();e.length!==o&&v(r,"invalid sample length"),i=f(e),r.push(i);var s=new p(0|n._crypto_core_ed25519_scalarbytes()),a=s.address;r.push(a),n._crypto_core_ed25519_scalar_reduce(a,i);var l=u(s,t);return m(r),l}function Ce(e,t,r){var i=[];h(r),e=b(i,e,"x");var o,s=0|n._crypto_core_ed25519_scalarbytes();e.length!==s&&v(i,"invalid x length"),o=f(e),i.push(o),t=b(i,t,"y");var a,l=0|n._crypto_core_ed25519_scalarbytes();t.length!==l&&v(i,"invalid y length"),a=f(t),i.push(a);var c=new p(0|n._crypto_core_ed25519_scalarbytes()),d=c.address;i.push(d),n._crypto_core_ed25519_scalar_sub(d,o,a);var g=u(c,r);return m(i),g}function Ee(e,t,r){var i=[];h(r),e=b(i,e,"p");var o,s=0|n._crypto_core_ed25519_bytes();e.length!==s&&v(i,"invalid p length"),o=f(e),i.push(o),t=b(i,t,"q");var a,l=0|n._crypto_core_ed25519_bytes();t.length!==l&&v(i,"invalid q length"),a=f(t),i.push(a);var c=new p(0|n._crypto_core_ed25519_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_core_ed25519_sub(d,o,a))){var g=u(c,r);return m(i),g}y(i,"input is an invalid element")}function Ie(e,t,r,i){var o=[];h(i),e=b(o,e,"input");var s,a=0|n._crypto_core_hchacha20_inputbytes();e.length!==a&&v(o,"invalid input length"),s=f(e),o.push(s),t=b(o,t,"privateKey");var l,c=0|n._crypto_core_hchacha20_keybytes();t.length!==c&&v(o,"invalid privateKey length"),l=f(t),o.push(l);var d=null;null!=r&&(d=f(r=b(o,r,"constant")),r.length,o.push(d));var g=new p(0|n._crypto_core_hchacha20_outputbytes()),A=g.address;if(o.push(A),0==(0|n._crypto_core_hchacha20(A,s,l,d))){var w=u(g,i);return m(o),w}y(o,"invalid usage")}function _e(e,t,r,i){var o=[];h(i),e=b(o,e,"input");var s,a=0|n._crypto_core_hsalsa20_inputbytes();e.length!==a&&v(o,"invalid input length"),s=f(e),o.push(s),t=b(o,t,"privateKey");var l,c=0|n._crypto_core_hsalsa20_keybytes();t.length!==c&&v(o,"invalid privateKey length"),l=f(t),o.push(l);var d=null;null!=r&&(d=f(r=b(o,r,"constant")),r.length,o.push(d));var g=new p(0|n._crypto_core_hsalsa20_outputbytes()),A=g.address;if(o.push(A),0==(0|n._crypto_core_hsalsa20(A,s,l,d))){var w=u(g,i);return m(o),w}y(o,"invalid usage")}function xe(e,t,r){var i=[];h(r),e=b(i,e,"p");var o,s=0|n._crypto_core_ristretto255_bytes();e.length!==s&&v(i,"invalid p length"),o=f(e),i.push(o),t=b(i,t,"q");var a,l=0|n._crypto_core_ristretto255_bytes();t.length!==l&&v(i,"invalid q length"),a=f(t),i.push(a);var c=new p(0|n._crypto_core_ristretto255_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_core_ristretto255_add(d,o,a))){var g=u(c,r);return m(i),g}y(i,"input is an invalid element")}function Pe(e,t){var r=[];h(t);var i=f(e=b(r,e,"r"));e.length,r.push(i);var o=new p(0|n._crypto_core_ristretto255_bytes()),s=o.address;if(r.push(s),0==(0|n._crypto_core_ristretto255_from_hash(s,i))){var a=u(o,t);return m(r),a}y(r,"invalid usage")}function ke(e,t){var r=[];h(t),e=b(r,e,"repr");var i,o=0|n._crypto_core_ristretto255_bytes();e.length!==o&&v(r,"invalid repr length"),i=f(e),r.push(i);var s=1==(0|n._crypto_core_ristretto255_is_valid_point(i));return m(r),s}function Be(e){var t=[];h(e);var r=new p(0|n._crypto_core_ristretto255_bytes()),i=r.address;t.push(i),n._crypto_core_ristretto255_random(i);var o=u(r,e);return m(t),o}function Oe(e,t,r){var i=[];h(r),e=b(i,e,"x");var o,s=0|n._crypto_core_ristretto255_scalarbytes();e.length!==s&&v(i,"invalid x length"),o=f(e),i.push(o),t=b(i,t,"y");var a,l=0|n._crypto_core_ristretto255_scalarbytes();t.length!==l&&v(i,"invalid y length"),a=f(t),i.push(a);var c=new p(0|n._crypto_core_ristretto255_scalarbytes()),d=c.address;i.push(d),n._crypto_core_ristretto255_scalar_add(d,o,a);var g=u(c,r);return m(i),g}function Ne(e,t){var r=[];h(t),e=b(r,e,"s");var i,o=0|n._crypto_core_ristretto255_scalarbytes();e.length!==o&&v(r,"invalid s length"),i=f(e),r.push(i);var s=new p(0|n._crypto_core_ristretto255_scalarbytes()),a=s.address;r.push(a),n._crypto_core_ristretto255_scalar_complement(a,i);var l=u(s,t);return m(r),l}function De(e,t){var r=[];h(t),e=b(r,e,"s");var i,o=0|n._crypto_core_ristretto255_scalarbytes();e.length!==o&&v(r,"invalid s length"),i=f(e),r.push(i);var s=new p(0|n._crypto_core_ristretto255_scalarbytes()),a=s.address;if(r.push(a),0==(0|n._crypto_core_ristretto255_scalar_invert(a,i))){var l=u(s,t);return m(r),l}y(r,"invalid reciprocate")}function je(e,t,r){var i=[];h(r),e=b(i,e,"x");var o,s=0|n._crypto_core_ristretto255_scalarbytes();e.length!==s&&v(i,"invalid x length"),o=f(e),i.push(o),t=b(i,t,"y");var a,l=0|n._crypto_core_ristretto255_scalarbytes();t.length!==l&&v(i,"invalid y length"),a=f(t),i.push(a);var c=new p(0|n._crypto_core_ristretto255_scalarbytes()),d=c.address;i.push(d),n._crypto_core_ristretto255_scalar_mul(d,o,a);var g=u(c,r);return m(i),g}function Te(e,t){var r=[];h(t),e=b(r,e,"s");var i,o=0|n._crypto_core_ristretto255_scalarbytes();e.length!==o&&v(r,"invalid s length"),i=f(e),r.push(i);var s=new p(0|n._crypto_core_ristretto255_scalarbytes()),a=s.address;r.push(a),n._crypto_core_ristretto255_scalar_negate(a,i);var l=u(s,t);return m(r),l}function Me(e){var t=[];h(e);var r=new p(0|n._crypto_core_ristretto255_scalarbytes()),i=r.address;t.push(i),n._crypto_core_ristretto255_scalar_random(i);var o=u(r,e);return m(t),o}function Fe(e,t){var r=[];h(t),e=b(r,e,"sample");var i,o=0|n._crypto_core_ristretto255_nonreducedscalarbytes();e.length!==o&&v(r,"invalid sample length"),i=f(e),r.push(i);var s=new p(0|n._crypto_core_ristretto255_scalarbytes()),a=s.address;r.push(a),n._crypto_core_ristretto255_scalar_reduce(a,i);var l=u(s,t);return m(r),l}function Re(e,t,r){var i=[];h(r),e=b(i,e,"x");var o,s=0|n._crypto_core_ristretto255_scalarbytes();e.length!==s&&v(i,"invalid x length"),o=f(e),i.push(o),t=b(i,t,"y");var a,l=0|n._crypto_core_ristretto255_scalarbytes();t.length!==l&&v(i,"invalid y length"),a=f(t),i.push(a);var c=new p(0|n._crypto_core_ristretto255_scalarbytes()),d=c.address;i.push(d),n._crypto_core_ristretto255_scalar_sub(d,o,a);var g=u(c,r);return m(i),g}function Le(e,t,r){var i=[];h(r),e=b(i,e,"p");var o,s=0|n._crypto_core_ristretto255_bytes();e.length!==s&&v(i,"invalid p length"),o=f(e),i.push(o),t=b(i,t,"q");var a,l=0|n._crypto_core_ristretto255_bytes();t.length!==l&&v(i,"invalid q length"),a=f(t),i.push(a);var c=new p(0|n._crypto_core_ristretto255_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_core_ristretto255_sub(d,o,a))){var g=u(c,r);return m(i),g}y(i,"input is an invalid element")}function Qe(e,t,r,i){var o=[];h(i),A(o,e,"hash_length"),("number"!=typeof e||(0|e)!==e||e<0)&&v(o,"hash_length must be an unsigned integer");var s=f(t=b(o,t,"message")),a=t.length;o.push(s);var l=null,c=0;null!=r&&(l=f(r=b(o,r,"key")),c=r.length,o.push(l));var d=new p(e|=0),g=d.address;if(o.push(g),0==(0|n._crypto_generichash(g,e,s,a,0,l,c))){var w=u(d,i);return m(o),w}y(o,"invalid usage")}function Ue(e,t,r,i,o){var s=[];h(o),A(s,e,"subkey_len"),("number"!=typeof e||(0|e)!==e||e<0)&&v(s,"subkey_len must be an unsigned integer");var a=null,l=0;null!=t&&(a=f(t=b(s,t,"key")),l=t.length,s.push(a)),r=b(s,r,"id");var c,d=0|n._crypto_generichash_blake2b_saltbytes();r.length!==d&&v(s,"invalid id length"),c=f(r),s.push(c),i=b(s,i,"ctx");var g,w=0|n._crypto_generichash_blake2b_personalbytes();i.length!==w&&v(s,"invalid ctx length"),g=f(i),s.push(g);var S=new p(0|e),C=S.address;if(s.push(C),0==(0|n._crypto_generichash_blake2b_salt_personal(C,e,null,0,0,a,l,c,g))){var E=u(S,o);return m(s),E}y(s,"invalid usage")}function Ve(e,t,r){var i=[];h(r),A(i,e,"state_address"),A(i,t,"hash_length"),("number"!=typeof t||(0|t)!==t||t<0)&&v(i,"hash_length must be an unsigned integer");var o=new p(t|=0),s=o.address;if(i.push(s),0==(0|n._crypto_generichash_final(e,s,t))){var a=(n._free(e),u(o,r));return m(i),a}y(i,"invalid usage")}function Ke(e,t,r){var i=[];h(r);var o=null,s=0;null!=e&&(o=f(e=b(i,e,"key")),s=e.length,i.push(o)),A(i,t,"hash_length"),("number"!=typeof t||(0|t)!==t||t<0)&&v(i,"hash_length must be an unsigned integer");var a=new p(357).address;if(0==(0|n._crypto_generichash_init(a,o,s,t))){var l=a;return m(i),l}y(i,"invalid usage")}function He(e){var t=[];h(e);var r=new p(0|n._crypto_generichash_keybytes()),i=r.address;t.push(i),n._crypto_generichash_keygen(i);var o=u(r,e);return m(t),o}function Ge(e,t,r){var i=[];h(r),A(i,e,"state_address");var o=f(t=b(i,t,"message_chunk")),s=t.length;i.push(o),0!=(0|n._crypto_generichash_update(e,o,s))&&y(i,"invalid usage"),m(i)}function Ye(e,t){var r=[];h(t);var i=f(e=b(r,e,"message")),o=e.length;r.push(i);var s=new p(0|n._crypto_hash_bytes()),a=s.address;if(r.push(a),0==(0|n._crypto_hash(a,i,o,0))){var l=u(s,t);return m(r),l}y(r,"invalid usage")}function ze(e,t){var r=[];h(t);var i=f(e=b(r,e,"message")),o=e.length;r.push(i);var s=new p(0|n._crypto_hash_sha256_bytes()),a=s.address;if(r.push(a),0==(0|n._crypto_hash_sha256(a,i,o,0))){var l=u(s,t);return m(r),l}y(r,"invalid usage")}function Ze(e,t){var r=[];h(t),A(r,e,"state_address");var i=new p(0|n._crypto_hash_sha256_bytes()),o=i.address;if(r.push(o),0==(0|n._crypto_hash_sha256_final(e,o))){var s=(n._free(e),u(i,t));return m(r),s}y(r,"invalid usage")}function We(e){var t=[];h(e);var r=new p(104).address;if(0==(0|n._crypto_hash_sha256_init(r))){var i=r;return m(t),i}y(t,"invalid usage")}function qe(e,t,r){var i=[];h(r),A(i,e,"state_address");var o=f(t=b(i,t,"message_chunk")),s=t.length;i.push(o),0!=(0|n._crypto_hash_sha256_update(e,o,s))&&y(i,"invalid usage"),m(i)}function Je(e,t){var r=[];h(t);var i=f(e=b(r,e,"message")),o=e.length;r.push(i);var s=new p(0|n._crypto_hash_sha512_bytes()),a=s.address;if(r.push(a),0==(0|n._crypto_hash_sha512(a,i,o,0))){var l=u(s,t);return m(r),l}y(r,"invalid usage")}function Xe(e,t){var r=[];h(t),A(r,e,"state_address");var i=new p(0|n._crypto_hash_sha512_bytes()),o=i.address;if(r.push(o),0==(0|n._crypto_hash_sha512_final(e,o))){var s=(n._free(e),u(i,t));return m(r),s}y(r,"invalid usage")}function $e(e){var t=[];h(e);var r=new p(208).address;if(0==(0|n._crypto_hash_sha512_init(r))){var i=r;return m(t),i}y(t,"invalid usage")}function et(e,t,r){var i=[];h(r),A(i,e,"state_address");var o=f(t=b(i,t,"message_chunk")),s=t.length;i.push(o),0!=(0|n._crypto_hash_sha512_update(e,o,s))&&y(i,"invalid usage"),m(i)}function tt(e,t,r,o,s){var a=[];h(s),A(a,e,"subkey_len"),("number"!=typeof e||(0|e)!==e||e<0)&&v(a,"subkey_len must be an unsigned integer"),A(a,t,"subkey_id"),("number"!=typeof t||(0|t)!==t||t<0)&&v(a,"subkey_id must be an unsigned integer"),"string"!=typeof r&&v(a,"ctx must be a string"),r=i(r+"\0"),null!=c&&r.length-1!==c&&v(a,"invalid ctx length");var l=f(r),c=r.length-1;a.push(l),o=b(a,o,"key");var d,g=0|n._crypto_kdf_keybytes();o.length!==g&&v(a,"invalid key length"),d=f(o),a.push(d);var y=new p(0|e),w=y.address;a.push(w),n._crypto_kdf_derive_from_key(w,e,t,t>>>24>>>8,l,d);var S=u(y,s);return m(a),S}function nt(e){var t=[];h(e);var r=new p(0|n._crypto_kdf_keybytes()),i=r.address;t.push(i),n._crypto_kdf_keygen(i);var o=u(r,e);return m(t),o}function rt(e,t,r,i){var o=[];h(i),e=b(o,e,"clientPublicKey");var s,a=0|n._crypto_kx_publickeybytes();e.length!==a&&v(o,"invalid clientPublicKey length"),s=f(e),o.push(s),t=b(o,t,"clientSecretKey");var l,c=0|n._crypto_kx_secretkeybytes();t.length!==c&&v(o,"invalid clientSecretKey length"),l=f(t),o.push(l),r=b(o,r,"serverPublicKey");var d,g=0|n._crypto_kx_publickeybytes();r.length!==g&&v(o,"invalid serverPublicKey length"),d=f(r),o.push(d);var A=new p(0|n._crypto_kx_sessionkeybytes()),w=A.address;o.push(w);var S=new p(0|n._crypto_kx_sessionkeybytes()),C=S.address;if(o.push(C),0==(0|n._crypto_kx_client_session_keys(w,C,s,l,d))){var E=u({sharedRx:A,sharedTx:S},i);return m(o),E}y(o,"invalid usage")}function it(e){var t=[];h(e);var r=new p(0|n._crypto_kx_publickeybytes()),i=r.address;t.push(i);var o=new p(0|n._crypto_kx_secretkeybytes()),s=o.address;if(t.push(s),0==(0|n._crypto_kx_keypair(i,s))){var a={publicKey:u(r,e),privateKey:u(o,e),keyType:"x25519"};return m(t),a}y(t,"internal error")}function ot(e,t){var r=[];h(t),e=b(r,e,"seed");var i,o=0|n._crypto_kx_seedbytes();e.length!==o&&v(r,"invalid seed length"),i=f(e),r.push(i);var s=new p(0|n._crypto_kx_publickeybytes()),a=s.address;r.push(a);var l=new p(0|n._crypto_kx_secretkeybytes()),c=l.address;if(r.push(c),0==(0|n._crypto_kx_seed_keypair(a,c,i))){var d={publicKey:u(s,t),privateKey:u(l,t),keyType:"x25519"};return m(r),d}y(r,"internal error")}function st(e,t,r,i){var o=[];h(i),e=b(o,e,"serverPublicKey");var s,a=0|n._crypto_kx_publickeybytes();e.length!==a&&v(o,"invalid serverPublicKey length"),s=f(e),o.push(s),t=b(o,t,"serverSecretKey");var l,c=0|n._crypto_kx_secretkeybytes();t.length!==c&&v(o,"invalid serverSecretKey length"),l=f(t),o.push(l),r=b(o,r,"clientPublicKey");var d,g=0|n._crypto_kx_publickeybytes();r.length!==g&&v(o,"invalid clientPublicKey length"),d=f(r),o.push(d);var A=new p(0|n._crypto_kx_sessionkeybytes()),w=A.address;o.push(w);var S=new p(0|n._crypto_kx_sessionkeybytes()),C=S.address;if(o.push(C),0==(0|n._crypto_kx_server_session_keys(w,C,s,l,d))){var E=u({sharedRx:A,sharedTx:S},i);return m(o),E}y(o,"invalid usage")}function at(e,t,r){var i=[];h(r);var o=f(e=b(i,e,"message")),s=e.length;i.push(o),t=b(i,t,"key");var a,l=0|n._crypto_onetimeauth_keybytes();t.length!==l&&v(i,"invalid key length"),a=f(t),i.push(a);var c=new p(0|n._crypto_onetimeauth_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_onetimeauth(d,o,s,0,a))){var g=u(c,r);return m(i),g}y(i,"invalid usage")}function lt(e,t){var r=[];h(t),A(r,e,"state_address");var i=new p(0|n._crypto_onetimeauth_bytes()),o=i.address;if(r.push(o),0==(0|n._crypto_onetimeauth_final(e,o))){var s=(n._free(e),u(i,t));return m(r),s}y(r,"invalid usage")}function ct(e,t){var r=[];h(t);var i=null;null!=e&&(i=f(e=b(r,e,"key")),e.length,r.push(i));var o=new p(144).address;if(0==(0|n._crypto_onetimeauth_init(o,i))){var s=o;return m(r),s}y(r,"invalid usage")}function ut(e){var t=[];h(e);var r=new p(0|n._crypto_onetimeauth_keybytes()),i=r.address;t.push(i),n._crypto_onetimeauth_keygen(i);var o=u(r,e);return m(t),o}function dt(e,t,r){var i=[];h(r),A(i,e,"state_address");var o=f(t=b(i,t,"message_chunk")),s=t.length;i.push(o),0!=(0|n._crypto_onetimeauth_update(e,o,s))&&y(i,"invalid usage"),m(i)}function ht(e,t,r){var i=[];e=b(i,e,"hash");var o,s=0|n._crypto_onetimeauth_bytes();e.length!==s&&v(i,"invalid hash length"),o=f(e),i.push(o);var a=f(t=b(i,t,"message")),l=t.length;i.push(a),r=b(i,r,"key");var c,u=0|n._crypto_onetimeauth_keybytes();r.length!==u&&v(i,"invalid key length"),c=f(r),i.push(c);var d=0==(0|n._crypto_onetimeauth_verify(o,a,l,0,c));return m(i),d}function pt(e,t,r,i,o,s,a){var l=[];h(a),A(l,e,"keyLength"),("number"!=typeof e||(0|e)!==e||e<0)&&v(l,"keyLength must be an unsigned integer");var c=f(t=b(l,t,"password")),d=t.length;l.push(c),r=b(l,r,"salt");var g,w=0|n._crypto_pwhash_saltbytes();r.length!==w&&v(l,"invalid salt length"),g=f(r),l.push(g),A(l,i,"opsLimit"),("number"!=typeof i||(0|i)!==i||i<0)&&v(l,"opsLimit must be an unsigned integer"),A(l,o,"memLimit"),("number"!=typeof o||(0|o)!==o||o<0)&&v(l,"memLimit must be an unsigned integer"),A(l,s,"algorithm"),("number"!=typeof s||(0|s)!==s||s<0)&&v(l,"algorithm must be an unsigned integer");var S=new p(0|e),C=S.address;if(l.push(C),0==(0|n._crypto_pwhash(C,e,0,c,d,0,g,i,0,o,s))){var E=u(S,a);return m(l),E}y(l,"invalid usage")}function ft(e,t,r,i,o,s){var a=[];h(s),A(a,e,"keyLength"),("number"!=typeof e||(0|e)!==e||e<0)&&v(a,"keyLength must be an unsigned integer");var l=f(t=b(a,t,"password")),c=t.length;a.push(l),r=b(a,r,"salt");var d,g=0|n._crypto_pwhash_scryptsalsa208sha256_saltbytes();r.length!==g&&v(a,"invalid salt length"),d=f(r),a.push(d),A(a,i,"opsLimit"),("number"!=typeof i||(0|i)!==i||i<0)&&v(a,"opsLimit must be an unsigned integer"),A(a,o,"memLimit"),("number"!=typeof o||(0|o)!==o||o<0)&&v(a,"memLimit must be an unsigned integer");var w=new p(0|e),S=w.address;if(a.push(S),0==(0|n._crypto_pwhash_scryptsalsa208sha256(S,e,0,l,c,0,d,i,0,o))){var C=u(w,s);return m(a),C}y(a,"invalid usage")}function gt(e,t,r,i,o,s,a){var l=[];h(a);var c=f(e=b(l,e,"password")),d=e.length;l.push(c);var g=f(t=b(l,t,"salt")),w=t.length;l.push(g),A(l,r,"opsLimit"),("number"!=typeof r||(0|r)!==r||r<0)&&v(l,"opsLimit must be an unsigned integer"),A(l,i,"r"),("number"!=typeof i||(0|i)!==i||i<0)&&v(l,"r must be an unsigned integer"),A(l,o,"p"),("number"!=typeof o||(0|o)!==o||o<0)&&v(l,"p must be an unsigned integer"),A(l,s,"keyLength"),("number"!=typeof s||(0|s)!==s||s<0)&&v(l,"keyLength must be an unsigned integer");var S=new p(0|s),C=S.address;if(l.push(C),0==(0|n._crypto_pwhash_scryptsalsa208sha256_ll(c,d,g,w,r,0,i,o,C,s))){var E=u(S,a);return m(l),E}y(l,"invalid usage")}function mt(e,t,r,i){var o=[];h(i);var s=f(e=b(o,e,"password")),a=e.length;o.push(s),A(o,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&v(o,"opsLimit must be an unsigned integer"),A(o,r,"memLimit"),("number"!=typeof r||(0|r)!==r||r<0)&&v(o,"memLimit must be an unsigned integer");var l=new p(0|n._crypto_pwhash_scryptsalsa208sha256_strbytes()).address;if(o.push(l),0==(0|n._crypto_pwhash_scryptsalsa208sha256_str(l,s,a,0,t,0,r))){var c=n.UTF8ToString(l);return m(o),c}y(o,"invalid usage")}function yt(e,t,r){var o=[];h(r),"string"!=typeof e&&v(o,"hashed_password must be a string"),e=i(e+"\0"),null!=a&&e.length-1!==a&&v(o,"invalid hashed_password length");var s=f(e),a=e.length-1;o.push(s);var l=f(t=b(o,t,"password")),c=t.length;o.push(l);var u=0==(0|n._crypto_pwhash_scryptsalsa208sha256_str_verify(s,l,c,0));return m(o),u}function vt(e,t,r,i){var o=[];h(i);var s=f(e=b(o,e,"password")),a=e.length;o.push(s),A(o,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&v(o,"opsLimit must be an unsigned integer"),A(o,r,"memLimit"),("number"!=typeof r||(0|r)!==r||r<0)&&v(o,"memLimit must be an unsigned integer");var l=new p(0|n._crypto_pwhash_strbytes()).address;if(o.push(l),0==(0|n._crypto_pwhash_str(l,s,a,0,t,0,r))){var c=n.UTF8ToString(l);return m(o),c}y(o,"invalid usage")}function At(e,t,r,o){var s=[];h(o),"string"!=typeof e&&v(s,"hashed_password must be a string"),e=i(e+"\0"),null!=l&&e.length-1!==l&&v(s,"invalid hashed_password length");var a=f(e),l=e.length-1;s.push(a),A(s,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&v(s,"opsLimit must be an unsigned integer"),A(s,r,"memLimit"),("number"!=typeof r||(0|r)!==r||r<0)&&v(s,"memLimit must be an unsigned integer");var c=0!=(0|n._crypto_pwhash_str_needs_rehash(a,t,0,r));return m(s),c}function bt(e,t,r){var o=[];h(r),"string"!=typeof e&&v(o,"hashed_password must be a string"),e=i(e+"\0"),null!=a&&e.length-1!==a&&v(o,"invalid hashed_password length");var s=f(e),a=e.length-1;o.push(s);var l=f(t=b(o,t,"password")),c=t.length;o.push(l);var u=0==(0|n._crypto_pwhash_str_verify(s,l,c,0));return m(o),u}function wt(e,t,r){var i=[];h(r),e=b(i,e,"privateKey");var o,s=0|n._crypto_scalarmult_scalarbytes();e.length!==s&&v(i,"invalid privateKey length"),o=f(e),i.push(o),t=b(i,t,"publicKey");var a,l=0|n._crypto_scalarmult_bytes();t.length!==l&&v(i,"invalid publicKey length"),a=f(t),i.push(a);var c=new p(0|n._crypto_scalarmult_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_scalarmult(d,o,a))){var g=u(c,r);return m(i),g}y(i,"weak public key")}function St(e,t){var r=[];h(t),e=b(r,e,"privateKey");var i,o=0|n._crypto_scalarmult_scalarbytes();e.length!==o&&v(r,"invalid privateKey length"),i=f(e),r.push(i);var s=new p(0|n._crypto_scalarmult_bytes()),a=s.address;if(r.push(a),0==(0|n._crypto_scalarmult_base(a,i))){var l=u(s,t);return m(r),l}y(r,"unknown error")}function Ct(e,t,r){var i=[];h(r),e=b(i,e,"n");var o,s=0|n._crypto_scalarmult_ed25519_scalarbytes();e.length!==s&&v(i,"invalid n length"),o=f(e),i.push(o),t=b(i,t,"p");var a,l=0|n._crypto_scalarmult_ed25519_bytes();t.length!==l&&v(i,"invalid p length"),a=f(t),i.push(a);var c=new p(0|n._crypto_scalarmult_ed25519_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_scalarmult_ed25519(d,o,a))){var g=u(c,r);return m(i),g}y(i,"invalid point or scalar is 0")}function Et(e,t){var r=[];h(t),e=b(r,e,"scalar");var i,o=0|n._crypto_scalarmult_ed25519_scalarbytes();e.length!==o&&v(r,"invalid scalar length"),i=f(e),r.push(i);var s=new p(0|n._crypto_scalarmult_ed25519_bytes()),a=s.address;if(r.push(a),0==(0|n._crypto_scalarmult_ed25519_base(a,i))){var l=u(s,t);return m(r),l}y(r,"scalar is 0")}function It(e,t){var r=[];h(t),e=b(r,e,"scalar");var i,o=0|n._crypto_scalarmult_ed25519_scalarbytes();e.length!==o&&v(r,"invalid scalar length"),i=f(e),r.push(i);var s=new p(0|n._crypto_scalarmult_ed25519_bytes()),a=s.address;if(r.push(a),0==(0|n._crypto_scalarmult_ed25519_base_noclamp(a,i))){var l=u(s,t);return m(r),l}y(r,"scalar is 0")}function _t(e,t,r){var i=[];h(r),e=b(i,e,"n");var o,s=0|n._crypto_scalarmult_ed25519_scalarbytes();e.length!==s&&v(i,"invalid n length"),o=f(e),i.push(o),t=b(i,t,"p");var a,l=0|n._crypto_scalarmult_ed25519_bytes();t.length!==l&&v(i,"invalid p length"),a=f(t),i.push(a);var c=new p(0|n._crypto_scalarmult_ed25519_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_scalarmult_ed25519_noclamp(d,o,a))){var g=u(c,r);return m(i),g}y(i,"invalid point or scalar is 0")}function xt(e,t,r){var i=[];h(r),e=b(i,e,"scalar");var o,s=0|n._crypto_scalarmult_ristretto255_scalarbytes();e.length!==s&&v(i,"invalid scalar length"),o=f(e),i.push(o),t=b(i,t,"element");var a,l=0|n._crypto_scalarmult_ristretto255_bytes();t.length!==l&&v(i,"invalid element length"),a=f(t),i.push(a);var c=new p(0|n._crypto_scalarmult_ristretto255_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_scalarmult_ristretto255(d,o,a))){var g=u(c,r);return m(i),g}y(i,"result is identity element")}function Pt(e,t){var r=[];h(t),e=b(r,e,"scalar");var i,o=0|n._crypto_core_ristretto255_scalarbytes();e.length!==o&&v(r,"invalid scalar length"),i=f(e),r.push(i);var s=new p(0|n._crypto_core_ristretto255_bytes()),a=s.address;if(r.push(a),0==(0|n._crypto_scalarmult_ristretto255_base(a,i))){var l=u(s,t);return m(r),l}y(r,"scalar is 0")}function kt(e,t,r,i){var o=[];h(i);var s=f(e=b(o,e,"message")),a=e.length;o.push(s),t=b(o,t,"nonce");var l,c=0|n._crypto_secretbox_noncebytes();t.length!==c&&v(o,"invalid nonce length"),l=f(t),o.push(l),r=b(o,r,"key");var d,g=0|n._crypto_secretbox_keybytes();r.length!==g&&v(o,"invalid key length"),d=f(r),o.push(d);var A=new p(0|a),w=A.address;o.push(w);var S=new p(0|n._crypto_secretbox_macbytes()),C=S.address;if(o.push(C),0==(0|n._crypto_secretbox_detached(w,C,s,a,0,l,d))){var E=u({mac:S,cipher:A},i);return m(o),E}y(o,"invalid usage")}function Bt(e,t,r,i){var o=[];h(i);var s=f(e=b(o,e,"message")),a=e.length;o.push(s),t=b(o,t,"nonce");var l,c=0|n._crypto_secretbox_noncebytes();t.length!==c&&v(o,"invalid nonce length"),l=f(t),o.push(l),r=b(o,r,"key");var d,g=0|n._crypto_secretbox_keybytes();r.length!==g&&v(o,"invalid key length"),d=f(r),o.push(d);var A=new p(a+n._crypto_secretbox_macbytes()|0),w=A.address;if(o.push(w),0==(0|n._crypto_secretbox_easy(w,s,a,0,l,d))){var S=u(A,i);return m(o),S}y(o,"invalid usage")}function Ot(e){var t=[];h(e);var r=new p(0|n._crypto_secretbox_keybytes()),i=r.address;t.push(i),n._crypto_secretbox_keygen(i);var o=u(r,e);return m(t),o}function Nt(e,t,r,i,o){var s=[];h(o);var a=f(e=b(s,e,"ciphertext")),l=e.length;s.push(a),t=b(s,t,"mac");var c,d=0|n._crypto_secretbox_macbytes();t.length!==d&&v(s,"invalid mac length"),c=f(t),s.push(c),r=b(s,r,"nonce");var g,A=0|n._crypto_secretbox_noncebytes();r.length!==A&&v(s,"invalid nonce length"),g=f(r),s.push(g),i=b(s,i,"key");var w,S=0|n._crypto_secretbox_keybytes();i.length!==S&&v(s,"invalid key length"),w=f(i),s.push(w);var C=new p(0|l),E=C.address;if(s.push(E),0==(0|n._crypto_secretbox_open_detached(E,a,c,l,0,g,w))){var I=u(C,o);return m(s),I}y(s,"wrong secret key for the given ciphertext")}function Dt(e,t,r,i){var o=[];h(i),e=b(o,e,"ciphertext");var s,a=n._crypto_secretbox_macbytes(),l=e.length;l<a&&v(o,"ciphertext is too short"),s=f(e),o.push(s),t=b(o,t,"nonce");var c,d=0|n._crypto_secretbox_noncebytes();t.length!==d&&v(o,"invalid nonce length"),c=f(t),o.push(c),r=b(o,r,"key");var g,A=0|n._crypto_secretbox_keybytes();r.length!==A&&v(o,"invalid key length"),g=f(r),o.push(g);var w=new p(l-n._crypto_secretbox_macbytes()|0),S=w.address;if(o.push(S),0==(0|n._crypto_secretbox_open_easy(S,s,l,0,c,g))){var C=u(w,i);return m(o),C}y(o,"wrong secret key for the given ciphertext")}function jt(e,t,r){var i=[];h(r),e=b(i,e,"header");var o,s=0|n._crypto_secretstream_xchacha20poly1305_headerbytes();e.length!==s&&v(i,"invalid header length"),o=f(e),i.push(o),t=b(i,t,"key");var a,l=0|n._crypto_secretstream_xchacha20poly1305_keybytes();t.length!==l&&v(i,"invalid key length"),a=f(t),i.push(a);var c=new p(52).address;if(0==(0|n._crypto_secretstream_xchacha20poly1305_init_pull(c,o,a))){var u=c;return m(i),u}y(i,"invalid usage")}function Tt(e,t){var r=[];h(t),e=b(r,e,"key");var i,o=0|n._crypto_secretstream_xchacha20poly1305_keybytes();e.length!==o&&v(r,"invalid key length"),i=f(e),r.push(i);var s=new p(52).address,a=new p(0|n._crypto_secretstream_xchacha20poly1305_headerbytes()),l=a.address;if(r.push(l),0==(0|n._crypto_secretstream_xchacha20poly1305_init_push(s,l,i))){var c={state:s,header:u(a,t)};return m(r),c}y(r,"invalid usage")}function Mt(e){var t=[];h(e);var r=new p(0|n._crypto_secretstream_xchacha20poly1305_keybytes()),i=r.address;t.push(i),n._crypto_secretstream_xchacha20poly1305_keygen(i);var o=u(r,e);return m(t),o}function Ft(e,t,r,i){var o=[];h(i),A(o,e,"state_address"),t=b(o,t,"cipher");var s,a=n._crypto_secretstream_xchacha20poly1305_abytes(),l=t.length;l<a&&v(o,"cipher is too short"),s=f(t),o.push(s);var c=null,d=0;null!=r&&(c=f(r=b(o,r,"ad")),d=r.length,o.push(c));var y=new p(l-n._crypto_secretstream_xchacha20poly1305_abytes()|0),w=y.address;o.push(w);var S,C=(S=g(1),o.push(S),(C=0===n._crypto_secretstream_xchacha20poly1305_pull(e,w,0,S,s,l,0,c,d)&&{tag:n.HEAPU8[S],message:y})&&{message:u(C.message,i),tag:C.tag});return m(o),C}function Rt(e,t,r,i,o){var s=[];h(o),A(s,e,"state_address");var a=f(t=b(s,t,"message_chunk")),l=t.length;s.push(a);var c=null,d=0;null!=r&&(c=f(r=b(s,r,"ad")),d=r.length,s.push(c)),A(s,i,"tag"),("number"!=typeof i||(0|i)!==i||i<0)&&v(s,"tag must be an unsigned integer");var g=new p(l+n._crypto_secretstream_xchacha20poly1305_abytes()|0),w=g.address;if(s.push(w),0==(0|n._crypto_secretstream_xchacha20poly1305_push(e,w,0,a,l,0,c,d,0,i))){var S=u(g,o);return m(s),S}y(s,"invalid usage")}function Lt(e,t){var r=[];return h(t),A(r,e,"state_address"),n._crypto_secretstream_xchacha20poly1305_rekey(e),m(r),!0}function Qt(e,t,r){var i=[];h(r);var o=f(e=b(i,e,"message")),s=e.length;i.push(o),t=b(i,t,"key");var a,l=0|n._crypto_shorthash_keybytes();t.length!==l&&v(i,"invalid key length"),a=f(t),i.push(a);var c=new p(0|n._crypto_shorthash_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_shorthash(d,o,s,0,a))){var g=u(c,r);return m(i),g}y(i,"invalid usage")}function Ut(e){var t=[];h(e);var r=new p(0|n._crypto_shorthash_keybytes()),i=r.address;t.push(i),n._crypto_shorthash_keygen(i);var o=u(r,e);return m(t),o}function Vt(e,t,r){var i=[];h(r);var o=f(e=b(i,e,"message")),s=e.length;i.push(o),t=b(i,t,"key");var a,l=0|n._crypto_shorthash_siphashx24_keybytes();t.length!==l&&v(i,"invalid key length"),a=f(t),i.push(a);var c=new p(0|n._crypto_shorthash_siphashx24_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_shorthash_siphashx24(d,o,s,0,a))){var g=u(c,r);return m(i),g}y(i,"invalid usage")}function Kt(e,t,r){var i=[];h(r);var o=f(e=b(i,e,"message")),s=e.length;i.push(o),t=b(i,t,"privateKey");var a,l=0|n._crypto_sign_secretkeybytes();t.length!==l&&v(i,"invalid privateKey length"),a=f(t),i.push(a);var c=new p(e.length+n._crypto_sign_bytes()|0),d=c.address;if(i.push(d),0==(0|n._crypto_sign(d,null,o,s,0,a))){var g=u(c,r);return m(i),g}y(i,"invalid usage")}function Ht(e,t,r){var i=[];h(r);var o=f(e=b(i,e,"message")),s=e.length;i.push(o),t=b(i,t,"privateKey");var a,l=0|n._crypto_sign_secretkeybytes();t.length!==l&&v(i,"invalid privateKey length"),a=f(t),i.push(a);var c=new p(0|n._crypto_sign_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_sign_detached(d,null,o,s,0,a))){var g=u(c,r);return m(i),g}y(i,"invalid usage")}function Gt(e,t){var r=[];h(t),e=b(r,e,"edPk");var i,o=0|n._crypto_sign_publickeybytes();e.length!==o&&v(r,"invalid edPk length"),i=f(e),r.push(i);var s=new p(0|n._crypto_scalarmult_scalarbytes()),a=s.address;if(r.push(a),0==(0|n._crypto_sign_ed25519_pk_to_curve25519(a,i))){var l=u(s,t);return m(r),l}y(r,"invalid key")}function Yt(e,t){var r=[];h(t),e=b(r,e,"edSk");var i,o=0|n._crypto_sign_secretkeybytes();e.length!==o&&v(r,"invalid edSk length"),i=f(e),r.push(i);var s=new p(0|n._crypto_scalarmult_scalarbytes()),a=s.address;if(r.push(a),0==(0|n._crypto_sign_ed25519_sk_to_curve25519(a,i))){var l=u(s,t);return m(r),l}y(r,"invalid key")}function zt(e,t){var r=[];h(t),e=b(r,e,"privateKey");var i,o=0|n._crypto_sign_secretkeybytes();e.length!==o&&v(r,"invalid privateKey length"),i=f(e),r.push(i);var s=new p(0|n._crypto_sign_publickeybytes()),a=s.address;if(r.push(a),0==(0|n._crypto_sign_ed25519_sk_to_pk(a,i))){var l=u(s,t);return m(r),l}y(r,"invalid key")}function Zt(e,t){var r=[];h(t),e=b(r,e,"privateKey");var i,o=0|n._crypto_sign_secretkeybytes();e.length!==o&&v(r,"invalid privateKey length"),i=f(e),r.push(i);var s=new p(0|n._crypto_sign_seedbytes()),a=s.address;if(r.push(a),0==(0|n._crypto_sign_ed25519_sk_to_seed(a,i))){var l=u(s,t);return m(r),l}y(r,"invalid key")}function Wt(e,t,r){var i=[];h(r),A(i,e,"state_address"),t=b(i,t,"privateKey");var o,s=0|n._crypto_sign_secretkeybytes();t.length!==s&&v(i,"invalid privateKey length"),o=f(t),i.push(o);var a=new p(0|n._crypto_sign_bytes()),l=a.address;if(i.push(l),0==(0|n._crypto_sign_final_create(e,l,null,o))){var c=(n._free(e),u(a,r));return m(i),c}y(i,"invalid usage")}function qt(e,t,r,i){var o=[];h(i),A(o,e,"state_address"),t=b(o,t,"signature");var s,a=0|n._crypto_sign_bytes();t.length!==a&&v(o,"invalid signature length"),s=f(t),o.push(s),r=b(o,r,"publicKey");var l,c=0|n._crypto_sign_publickeybytes();r.length!==c&&v(o,"invalid publicKey length"),l=f(r),o.push(l);var u=0==(0|n._crypto_sign_final_verify(e,s,l));return m(o),u}function Jt(e){var t=[];h(e);var r=new p(208).address;if(0==(0|n._crypto_sign_init(r))){var i=r;return m(t),i}y(t,"internal error")}function Xt(e){var t=[];h(e);var r=new p(0|n._crypto_sign_publickeybytes()),i=r.address;t.push(i);var o=new p(0|n._crypto_sign_secretkeybytes()),s=o.address;if(t.push(s),0==(0|n._crypto_sign_keypair(i,s))){var a={publicKey:u(r,e),privateKey:u(o,e),keyType:"ed25519"};return m(t),a}y(t,"internal error")}function $t(e,t,r){var i=[];h(r),e=b(i,e,"signedMessage");var o,s=n._crypto_sign_bytes(),a=e.length;a<s&&v(i,"signedMessage is too short"),o=f(e),i.push(o),t=b(i,t,"publicKey");var l,c=0|n._crypto_sign_publickeybytes();t.length!==c&&v(i,"invalid publicKey length"),l=f(t),i.push(l);var d=new p(a-n._crypto_sign_bytes()|0),g=d.address;if(i.push(g),0==(0|n._crypto_sign_open(g,null,o,a,0,l))){var A=u(d,r);return m(i),A}y(i,"incorrect signature for the given public key")}function en(e,t){var r=[];h(t),e=b(r,e,"seed");var i,o=0|n._crypto_sign_seedbytes();e.length!==o&&v(r,"invalid seed length"),i=f(e),r.push(i);var s=new p(0|n._crypto_sign_publickeybytes()),a=s.address;r.push(a);var l=new p(0|n._crypto_sign_secretkeybytes()),c=l.address;if(r.push(c),0==(0|n._crypto_sign_seed_keypair(a,c,i))){var d={publicKey:u(s,t),privateKey:u(l,t),keyType:"ed25519"};return m(r),d}y(r,"invalid usage")}function tn(e,t,r){var i=[];h(r),A(i,e,"state_address");var o=f(t=b(i,t,"message_chunk")),s=t.length;i.push(o),0!=(0|n._crypto_sign_update(e,o,s,0))&&y(i,"invalid usage"),m(i)}function nn(e,t,r){var i=[];e=b(i,e,"signature");var o,s=0|n._crypto_sign_bytes();e.length!==s&&v(i,"invalid signature length"),o=f(e),i.push(o);var a=f(t=b(i,t,"message")),l=t.length;i.push(a),r=b(i,r,"publicKey");var c,u=0|n._crypto_sign_publickeybytes();r.length!==u&&v(i,"invalid publicKey length"),c=f(r),i.push(c);var d=0==(0|n._crypto_sign_verify_detached(o,a,l,0,c));return m(i),d}function rn(e,t,r,i){var o=[];h(i),A(o,e,"outLength"),("number"!=typeof e||(0|e)!==e||e<0)&&v(o,"outLength must be an unsigned integer"),t=b(o,t,"key");var s,a=0|n._crypto_stream_chacha20_keybytes();t.length!==a&&v(o,"invalid key length"),s=f(t),o.push(s),r=b(o,r,"nonce");var l,c=0|n._crypto_stream_chacha20_noncebytes();r.length!==c&&v(o,"invalid nonce length"),l=f(r),o.push(l);var d=new p(0|e),g=d.address;o.push(g),n._crypto_stream_chacha20(g,e,0,l,s);var y=u(d,i);return m(o),y}function on(e,t,r,i){var o=[];h(i);var s=f(e=b(o,e,"input_message")),a=e.length;o.push(s),t=b(o,t,"nonce");var l,c=0|n._crypto_stream_chacha20_ietf_noncebytes();t.length!==c&&v(o,"invalid nonce length"),l=f(t),o.push(l),r=b(o,r,"key");var d,g=0|n._crypto_stream_chacha20_ietf_keybytes();r.length!==g&&v(o,"invalid key length"),d=f(r),o.push(d);var A=new p(0|a),w=A.address;if(o.push(w),0===n._crypto_stream_chacha20_ietf_xor(w,s,a,0,l,d)){var S=u(A,i);return m(o),S}y(o,"invalid usage")}function sn(e,t,r,i,o){var s=[];h(o);var a=f(e=b(s,e,"input_message")),l=e.length;s.push(a),t=b(s,t,"nonce");var c,d=0|n._crypto_stream_chacha20_ietf_noncebytes();t.length!==d&&v(s,"invalid nonce length"),c=f(t),s.push(c),A(s,r,"nonce_increment"),("number"!=typeof r||(0|r)!==r||r<0)&&v(s,"nonce_increment must be an unsigned integer"),i=b(s,i,"key");var g,w=0|n._crypto_stream_chacha20_ietf_keybytes();i.length!==w&&v(s,"invalid key length"),g=f(i),s.push(g);var S=new p(0|l),C=S.address;if(s.push(C),0===n._crypto_stream_chacha20_ietf_xor_ic(C,a,l,0,c,r,g)){var E=u(S,o);return m(s),E}y(s,"invalid usage")}function an(e){var t=[];h(e);var r=new p(0|n._crypto_stream_chacha20_keybytes()),i=r.address;t.push(i),n._crypto_stream_chacha20_keygen(i);var o=u(r,e);return m(t),o}function ln(e,t,r,i){var o=[];h(i);var s=f(e=b(o,e,"input_message")),a=e.length;o.push(s),t=b(o,t,"nonce");var l,c=0|n._crypto_stream_chacha20_noncebytes();t.length!==c&&v(o,"invalid nonce length"),l=f(t),o.push(l),r=b(o,r,"key");var d,g=0|n._crypto_stream_chacha20_keybytes();r.length!==g&&v(o,"invalid key length"),d=f(r),o.push(d);var A=new p(0|a),w=A.address;if(o.push(w),0===n._crypto_stream_chacha20_xor(w,s,a,0,l,d)){var S=u(A,i);return m(o),S}y(o,"invalid usage")}function cn(e,t,r,i,o){var s=[];h(o);var a=f(e=b(s,e,"input_message")),l=e.length;s.push(a),t=b(s,t,"nonce");var c,d=0|n._crypto_stream_chacha20_noncebytes();t.length!==d&&v(s,"invalid nonce length"),c=f(t),s.push(c),A(s,r,"nonce_increment"),("number"!=typeof r||(0|r)!==r||r<0)&&v(s,"nonce_increment must be an unsigned integer"),i=b(s,i,"key");var g,w=0|n._crypto_stream_chacha20_keybytes();i.length!==w&&v(s,"invalid key length"),g=f(i),s.push(g);var S=new p(0|l),C=S.address;if(s.push(C),0===n._crypto_stream_chacha20_xor_ic(C,a,l,0,c,r,0,g)){var E=u(S,o);return m(s),E}y(s,"invalid usage")}function un(e){var t=[];h(e);var r=new p(0|n._crypto_stream_keybytes()),i=r.address;t.push(i),n._crypto_stream_keygen(i);var o=u(r,e);return m(t),o}function dn(e){var t=[];h(e);var r=new p(0|n._crypto_stream_xchacha20_keybytes()),i=r.address;t.push(i),n._crypto_stream_xchacha20_keygen(i);var o=u(r,e);return m(t),o}function hn(e,t,r,i){var o=[];h(i);var s=f(e=b(o,e,"input_message")),a=e.length;o.push(s),t=b(o,t,"nonce");var l,c=0|n._crypto_stream_xchacha20_noncebytes();t.length!==c&&v(o,"invalid nonce length"),l=f(t),o.push(l),r=b(o,r,"key");var d,g=0|n._crypto_stream_xchacha20_keybytes();r.length!==g&&v(o,"invalid key length"),d=f(r),o.push(d);var A=new p(0|a),w=A.address;if(o.push(w),0===n._crypto_stream_xchacha20_xor(w,s,a,0,l,d)){var S=u(A,i);return m(o),S}y(o,"invalid usage")}function pn(e,t,r,i,o){var s=[];h(o);var a=f(e=b(s,e,"input_message")),l=e.length;s.push(a),t=b(s,t,"nonce");var c,d=0|n._crypto_stream_xchacha20_noncebytes();t.length!==d&&v(s,"invalid nonce length"),c=f(t),s.push(c),A(s,r,"nonce_increment"),("number"!=typeof r||(0|r)!==r||r<0)&&v(s,"nonce_increment must be an unsigned integer"),i=b(s,i,"key");var g,w=0|n._crypto_stream_xchacha20_keybytes();i.length!==w&&v(s,"invalid key length"),g=f(i),s.push(g);var S=new p(0|l),C=S.address;if(s.push(C),0===n._crypto_stream_xchacha20_xor_ic(C,a,l,0,c,r,0,g)){var E=u(S,o);return m(s),E}y(s,"invalid usage")}function fn(e,t){var r=[];h(t),A(r,e,"length"),("number"!=typeof e||(0|e)!==e||e<0)&&v(r,"length must be an unsigned integer");var i=new p(0|e),o=i.address;r.push(o),n._randombytes_buf(o,e);var s=u(i,t);return m(r),s}function gn(e,t,r){var i=[];h(r),A(i,e,"length"),("number"!=typeof e||(0|e)!==e||e<0)&&v(i,"length must be an unsigned integer"),t=b(i,t,"seed");var o,s=0|n._randombytes_seedbytes();t.length!==s&&v(i,"invalid seed length"),o=f(t),i.push(o);var a=new p(0|e),l=a.address;i.push(l),n._randombytes_buf_deterministic(l,e,o);var c=u(a,r);return m(i),c}function mn(e){h(e),n._randombytes_close()}function yn(e){h(e);var t=n._randombytes_random()>>>0;return m([]),t}function vn(e,t){var r=[];h(t);for(var i=n._malloc(24),o=0;o<6;o++)n.setValue(i+4*o,n.Runtime.addFunction(e[["implementation_name","random","stir","uniform","buf","close"][o]]),"i32");0!=(0|n._randombytes_set_implementation(i))&&y(r,"unsupported implementation"),m(r)}function An(e){h(e),n._randombytes_stir()}function bn(e,t){var r=[];h(t),A(r,e,"upper_bound"),("number"!=typeof e||(0|e)!==e||e<0)&&v(r,"upper_bound must be an unsigned integer");var i=n._randombytes_uniform(e)>>>0;return m(r),i}function wn(){var e=n._sodium_version_string(),t=n.UTF8ToString(e);return m([]),t}return p.prototype.to_Uint8Array=function(){var e=new Uint8Array(this.length);return e.set(n.HEAPU8.subarray(this.address,this.address+this.length)),e},e.add=function(e,t){if(!(e instanceof Uint8Array&&t instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can added");var n=e.length,r=0,i=0;if(t.length!=e.length)throw new TypeError("Arguments must have the same length");for(i=0;i<n;i++)r>>=8,r+=e[i]+t[i],e[i]=255&r},e.base64_variants=a,e.compare=function(e,t){if(!(e instanceof Uint8Array&&t instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be compared");if(e.length!==t.length)throw new TypeError("Only instances of identical length can be compared");for(var n=0,r=1,i=e.length;i-- >0;)n|=t[i]-e[i]>>8&r,r&=(t[i]^e[i])-1>>8;return n+n+r-1},e.from_base64=function(e,t){t=l(t);var r,i=[],o=new p(3*(e=b(i,e,"input")).length/4),s=f(e),a=g(4),c=g(4);return i.push(s),i.push(o.address),i.push(o.result_bin_len_p),i.push(o.b64_end_p),0!==n._sodium_base642bin(o.address,o.length,s,e.length,0,a,c,t)&&y(i,"invalid input"),n.getValue(c,"i32")-s!==e.length&&y(i,"incomplete input"),o.length=n.getValue(a,"i32"),r=o.to_Uint8Array(),m(i),r},e.from_hex=function(e){var t,r=[],i=new p((e=b(r,e,"input")).length/2),o=f(e),s=g(4);return r.push(o),r.push(i.address),r.push(i.hex_end_p),0!==n._sodium_hex2bin(i.address,i.length,o,e.length,0,0,s)&&y(r,"invalid input"),n.getValue(s,"i32")-o!==e.length&&y(r,"incomplete input"),t=i.to_Uint8Array(),m(r),t},e.from_string=i,e.increment=function(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be incremented");for(var t=256,n=0,r=e.length;n<r;n++)t>>=8,t+=e[n],e[n]=255&t},e.is_zero=function(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be checked");for(var t=0,n=0,r=e.length;n<r;n++)t|=e[n];return 0===t},e.libsodium=t,e.memcmp=function(e,t){if(!(e instanceof Uint8Array&&t instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be compared");if(e.length!==t.length)throw new TypeError("Only instances of identical length can be compared");for(var n=0,r=0,i=e.length;r<i;r++)n|=e[r]^t[r];return 0===n},e.memzero=function(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be wiped");for(var t=0,n=e.length;t<n;t++)e[t]=0},e.output_formats=function(){return["uint8array","text","hex","base64"]},e.pad=function(e,t){if(!(e instanceof Uint8Array))throw new TypeError("buffer must be a Uint8Array");if((t|=0)<=0)throw new Error("block size must be > 0");var r,i=[],o=g(4),s=1,a=0,l=0|e.length,c=new p(l+t);i.push(o),i.push(c.address);for(var u=c.address,d=c.address+l+t;u<d;u++)n.HEAPU8[u]=e[a],a+=s=1&~((65535&((l-=s)>>>48|l>>>32|l>>>16|l))-1>>16);return 0!==n._sodium_pad(o,c.address,e.length,t,c.length)&&y(i,"internal error"),c.length=n.getValue(o,"i32"),r=c.to_Uint8Array(),m(i),r},e.unpad=function(e,t){if(!(e instanceof Uint8Array))throw new TypeError("buffer must be a Uint8Array");if((t|=0)<=0)throw new Error("block size must be > 0");var r=[],i=f(e),o=g(4);return r.push(i),r.push(o),0!==n._sodium_unpad(o,i,e.length,t)&&y(r,"unsupported/invalid padding"),e=(e=new Uint8Array(e)).subarray(0,n.getValue(o,"i32")),m(r),e},e.ready=r,e.symbols=function(){return Object.keys(e).sort()},e.to_base64=c,e.to_hex=s,e.to_string=o,e},void 0!==(o=r.apply(t,i))&&(e.exports=o),a&&s.sodium.ready.then((function(){a(s.sodium)}))},39631:function(e,t,n){var r,i;r=function(t){"use strict";var r;void 0===(r=t)&&(r={});var i=r;"object"!=typeof i.sodium&&("object"==typeof n.g?i=n.g:"object"==typeof window&&(i=window)),"object"==typeof i.sodium&&"number"==typeof i.sodium.totalMemory&&(r.TOTAL_MEMORY=i.sodium.totalMemory);var o=r;return r.ready=new Promise((function(t,r){(d=o).onAbort=r,d.print=function(e){},d.printErr=function(e){},d.onRuntimeInitialized=function(){try{d._crypto_secretbox_keybytes(),t()}catch(e){r(e)}},d.useBackupModule=function(){return new Promise((function(t,r){(d={}).onAbort=r,d.onRuntimeInitialized=function(){Object.keys(o).forEach((function(e){"getRandomValue"!==e&&delete o[e]})),Object.keys(d).forEach((function(e){o[e]=d[e]})),t()};var i,s,a,l,c,u,d=void 0!==d?d:{},h=Object.assign({},d),p=[],f="object"==typeof window,g="function"==typeof importScripts,m="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,y="";m?(y=g?n(84371).dirname(y)+"/":"//",u=()=>{c||(l=n(68236),c=n(84371))},i=function(e,t){var n=ne(e);return n?t?n:n.toString():(u(),e=c.normalize(e),l.readFileSync(e,t?void 0:"utf8"))},a=e=>{var t=i(e,!0);return t.buffer||(t=new Uint8Array(t)),t},s=(e,t,n)=>{var r=ne(e);r&&t(r),u(),e=c.normalize(e),l.readFile(e,(function(e,r){e?n(e):t(r.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),p=process.argv.slice(2),e.exports=d,d.inspect=function(){return"[Emscripten Module object]"}):(f||g)&&(g?y=self.location.href:"undefined"!=typeof document&&document.currentScript&&(y=document.currentScript.src),y=0!==y.indexOf("blob:")?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf("/")+1):"",i=e=>{try{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText}catch(t){var n=ne(e);if(n)return function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r>255&&(r&=255),t.push(String.fromCharCode(r))}return t.join("")}(n);throw t}},g&&(a=e=>{try{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}catch(t){var n=ne(e);if(n)return n;throw t}}),s=(e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{if(200==r.status||0==r.status&&r.response)t(r.response);else{var i=ne(e);i?t(i.buffer):n()}},r.onerror=n,r.send(null)}),d.print;var v,A=d.printErr||void 0;Object.assign(d,h),h=null,d.arguments&&(p=d.arguments),d.thisProgram&&d.thisProgram,d.quit&&d.quit,d.wasmBinary&&(v=d.wasmBinary),d.noExitRuntime;var b,w={Memory:function(e){this.buffer=new ArrayBuffer(65536*e.initial)},Module:function(e){},Instance:function(e,t){this.exports=function(e){for(var t,n=new Uint8Array(123),r=25;r>=0;--r)n[48+r]=52+r,n[65+r]=r,n[97+r]=26+r;function i(e,t,r){for(var i,o,s=0,a=t,l=r.length,c=t+(3*l>>2)-("="==r[l-2])-("="==r[l-1]);s<l;s+=4)i=n[r.charCodeAt(s+1)],o=n[r.charCodeAt(s+2)],e[a++]=n[r.charCodeAt(s)]<<2|i>>4,a<c&&(e[a++]=i<<4|o>>2),a<c&&(e[a++]=o<<6|n[r.charCodeAt(s+3)])}return n[43]=62,n[47]=63,function(e){var n=e.a,r=n.buffer;n.grow=function(e){e|=0;var i=0|Tn(),d=i+e|0;if(i<d&&d<65536){var h=new ArrayBuffer(u(d,65536));new Int8Array(h).set(o),o=new Int8Array(h),s=new Int16Array(h),a=new Int32Array(h),l=new Uint8Array(h),new Uint16Array(h),c=new Uint32Array(h),new Float32Array(h),new Float64Array(h),r=h,n.buffer=r,t=l}return i};var o=new Int8Array(r),s=new Int16Array(r),a=new Int32Array(r),l=new Uint8Array(r),c=(new Uint16Array(r),new Uint32Array(r)),u=(new Float32Array(r),new Float64Array(r),Math.imul),d=(Math.fround,Math.abs,Math.clz32),h=(Math.min,Math.max,Math.floor,Math.ceil,Math.trunc,Math.sqrt,e.abort),p=e.b,f=e.c,g=e.d,m=e.e,y=5279280,v=0,A=0,b=0;function w(e,t){var n,r,i,s,c,u=0,d=0,h=0,p=0,f=0,g=0,m=0,v=0,A=0,w=0,S=0,C=0,E=0,I=0,_=0,x=0,P=0,k=0,B=0,O=0,N=0,D=0,j=0,T=0,M=0,F=0,R=0,L=0,Q=0,U=0,V=0,K=0,H=0,G=0,Y=0,z=0,Z=0,W=0,q=0,J=0,X=0,$=0,ee=0,te=0,ne=0,re=0,ie=0,oe=0,se=0,ae=0,le=0,ce=0,ue=0,de=0,he=0,pe=0,fe=0,ge=0,me=0,ye=0,ve=0;for(y=z=y-256|0;W=(K=H<<3)+(z+128|0)|0,te=l[4+(K=t+K|0)|0]|l[K+5|0]<<8|l[K+6|0]<<16|l[K+7|0]<<24,a[W>>2]=l[0|K]|l[K+1|0]<<8|l[K+2|0]<<16|l[K+3|0]<<24,a[W+4>>2]=te,16!=(0|(H=H+1|0)););for(n=pt(z,e,64),K=a[(t=n)>>2],H=a[t+4>>2],d=K,K=(te=a[t+32>>2])+(z=a[t+128>>2])|0,t=(J=a[t+36>>2])+a[t+132>>2]|0,t=K>>>0<z>>>0?t+1|0:t,z=K,t=t+H|0,z=t=(K=d+K|0)>>>0<z>>>0?t+1|0:t,V=we((H=K)^(l[0|(K=e- -64|0)]|l[K+1|0]<<8|l[K+2|0]<<16|l[K+3|0]<<24)^-1377402159,t^(l[K+4|0]|l[K+5|0]<<8|l[K+6|0]<<16|l[K+7|0]<<24)^1359893119,32),K=t=b,t=t+1779033703|0,d=te^(W=V-205731576|0),te=t=W>>>0<4089235720?t+1|0:t,x=we(d,J^t,24),J=t=b,G=K,d=V,t=t+z|0,t=(t=(V=x+H|0)>>>0<H>>>0?t+1|0:t)+(h=r=a[n+140>>2])|0,u=we(d^(O=H=(K=a[n+136>>2])+V|0),(w=O>>>0<V>>>0?t+1|0:t)^G,16),t=te+(f=b)|0,d=we((M=H=W+u|0)^x,(z=M>>>0<W>>>0?t+1|0:t)^J,63),v=b,W=a[n+12>>2],H=(x=a[n+144>>2])+(te=a[n+40>>2])|0,t=(ne=a[n+148>>2])+(J=a[n+44>>2])|0,G=H,t=(t=H>>>0<te>>>0?t+1|0:t)+W|0,t=(H=H+a[n+8>>2]|0)>>>0<G>>>0?t+1|0:t,V=we(H^(l[e+72|0]|l[e+73|0]<<8|l[e+74|0]<<16|l[e+75|0]<<24)^725511199,(l[e+76|0]|l[e+77|0]<<8|l[e+78|0]<<16|l[e+79|0]<<24)^t^-1694144372,32),G=we(S=te^(W=V-2067093701|0),J^(h=(te=b)-((V>>>0<2067093701)+1150833018|0)|0),24),P=a[n+156>>2],S=G,t=t+(J=b)|0,t=(t=(G=H+G|0)>>>0<H>>>0?t+1|0:t)+P|0,Z=we((B=H=G+a[n+152>>2]|0)^V,(I=B>>>0<G>>>0?t+1|0:t)^te,16),t=h+(D=b)|0,fe=H=W+Z|0,V=we(S^H,(W=H>>>0<W>>>0?t+1|0:t)^J,63),h=b,te=a[n+20>>2],H=(k=a[n+160>>2])+(G=a[n+48>>2])|0,t=(oe=a[n+164>>2])+(P=a[n+52>>2])|0,J=H,t=(t=H>>>0<G>>>0?t+1|0:t)+te|0,le=H=H+a[n+16>>2]|0,H=H>>>0<J>>>0?t+1|0:t,_=we(le^(l[e+80|0]|l[e+81|0]<<8|l[e+82|0]<<16|l[e+83|0]<<24)^-79577749,H^(l[e+84|0]|l[e+85|0]<<8|l[e+86|0]<<16|l[e+87|0]<<24)^528734635,32),te=t=b,t=t+1013904242|0,S=G^(J=_-23791573|0),G=t=J>>>0<4271175723?t+1|0:t,t=we(S,P^t,24),g=te,i=a[n+172>>2],p=t,S=_,_=t,le=t+le|0,t=(P=b)+H|0,t=(t=_>>>0>le>>>0?t+1|0:t)+(C=i)|0,Q=we(S^(C=H=(te=a[n+168>>2])+(_=le)|0),(j=_>>>0>C>>>0?t+1|0:t)^g,16),t=G+(E=b)|0,P=we(p^(T=H=J+Q|0),(G=T>>>0<J>>>0?t+1|0:t)^P,63),g=b,_=a[n+28>>2],J=(H=a[n+176>>2])+(le=a[n+56>>2])|0,t=(s=a[n+180>>2])+(N=a[n+60>>2])|0,t=(t=J>>>0<le>>>0?t+1|0:t)+_|0,t=(m=J)>>>0>(F=J=m+a[n+24>>2]|0)>>>0?t+1|0:t,p=we(F^(l[e+88|0]|l[e+89|0]<<8|l[e+90|0]<<16|l[e+91|0]<<24)^327033209,t^(l[e+92|0]|l[e+93|0]<<8|l[e+94|0]<<16|l[e+95|0]<<24)^1541459225,32),_=we(S=le^(A=(_=p)+1595750129|0),N^(le=(J=b)-((_>>>0<2699217167)+1521486533|0)|0),24),m=le,S=J,le=a[n+188>>2],L=_,t=(N=b)+t|0,t=(t=(F=_+F|0)>>>0<_>>>0?t+1|0:t)+le|0,Y=_=(J=a[n+184>>2])+F|0,p=we(_^p,(R=S)^(S=_>>>0<F>>>0?t+1|0:t),16),t=(t=m)+(m=b)|0,F=_=p+A|0,A=N,N=t=_>>>0<p>>>0?t+1|0:t,R=we(L^_,A^t,63),_=b,L=V,t=h+w|0,t=(t=(O=O+V|0)>>>0<V>>>0?t+1|0:t)+(A=q=a[n+196>>2])|0,A=T,O=we((T=V=(ie=a[n+192>>2])+(w=O)|0)^p,(V=w>>>0>T>>>0?t+1|0:t)^m,32),t=(t=G)+(G=b)|0,p=h,h=t=(w=A+(m=O)|0)>>>0<m>>>0?t+1|0:t,t=we(L^w,p^t,24),ce=a[n+204>>2],U=t,L=m,p=T,T=t,p=p+t|0,t=(m=b)+V|0,t=(t=p>>>0<T>>>0?t+1|0:t)+(A=ce)|0,X=V=(O=a[n+200>>2])+p|0,de=we(L^V,(T=p>>>0>V>>>0?t+1|0:t)^G,16),t=h+(p=b)|0,U=we(U^(A=G=w+de|0),(h=m)^(m=w>>>0>A>>>0?t+1|0:t),63),w=b,L=P,t=g+I|0,t=(t=(G=P+B|0)>>>0<P>>>0?t+1|0:t)+(h=ae=a[n+212>>2])|0,B=we((h=u)^(u=G=(V=a[n+208>>2])+(P=G)|0),(P=P>>>0>u>>>0?t+1|0:t)^f,32),t=N+(h=b)|0,G=we(L^(N=G=F+B|0),(t=F>>>0>N>>>0?t+1|0:t)^g,24),f=t,I=h,ee=a[n+220>>2],$=G,L=N,t=(g=b)+P|0,t=(t=(N=u+G|0)>>>0<G>>>0?t+1|0:t)+(F=ee)|0,I=we((N=G=(h=a[n+216>>2])+(P=N)|0)^B,(F=P>>>0>N>>>0?t+1|0:t)^I,16),t=(u=b)+f|0,ue=G=L+I|0,L=we($^G,(P=I>>>0>G>>>0?t+1|0:t)^g,63),g=b,$=R,t=_+j|0,t=(f=C+R|0)>>>0<C>>>0?t+1|0:t,C=f,t=t+(B=c=a[n+228>>2])|0,R=we((j=f=(G=a[n+224>>2])+f|0)^Z,(f=f>>>0<C>>>0?t+1|0:t)^D,32),t=(D=b)+z|0,M=C=R+M|0,z=we($^C,(t=C>>>0<R>>>0?t+1|0:t)^_,24),C=t,Z=a[n+236>>2],$=z,t=(_=b)+f|0,t=(t=(j=j+z|0)>>>0<z>>>0?t+1|0:t)+(B=Z)|0,pe=we((j=z=(re=a[n+232>>2])+(f=j)|0)^R,(B=D)^(D=f>>>0>j>>>0?t+1|0:t),16),t=(t=C)+(C=b)|0,_=we($^(R=z=(f=pe)+M|0),(M=f>>>0>R>>>0?t+1|0:t)^_,63),f=b,$=d,t=v+S|0,t=(t=(B=d+Y|0)>>>0<d>>>0?t+1|0:t)+(ge=a[n+244>>2])|0,t=(d=(z=a[n+240>>2])+(S=B)|0)>>>0<S>>>0?t+1|0:t,S=E,E=t,B=we(d^Q,S^t,32),t=(t=W)+(W=b)|0,Q=S=B+fe|0,Y=we($^S,(t=S>>>0<B>>>0?t+1|0:t)^v,24),v=t,S=W,fe=a[n+252>>2],he=Y,se=Q,Q=B,t=E+($=b)|0,t=(t=(B=d+Y|0)>>>0<d>>>0?t+1|0:t)+fe|0,t=(d=(W=a[n+248>>2])+(E=B)|0)>>>0<E>>>0?t+1|0:t,E=d,B=S,S=t,Y=we(Q^d,B^t,16),t=(B=b)+v|0,Q=we(he^(se=d=se+(Q=Y)|0),(d=d>>>0<Q>>>0?t+1|0:t)^$,63),$=t=b,v=t,he=I,t=T+ge|0,T=I=z+X|0,t=(t=I>>>0<z>>>0?t+1|0:t)+v|0,X=we(he^(v=I=I+Q|0),(I=v>>>0<T>>>0?t+1|0:t)^u,32),t=M+(T=b)|0,R=t=(u=R+X|0)>>>0<R>>>0?t+1|0:t,Q=we(Q^u,$^t,24),$=t=b,M=t,me=Q,t=I+ae|0,I=Q=v+V|0,t=(t=Q>>>0<v>>>0?t+1|0:t)+M|0,Q=X,X=v=me+I|0,he=we(Q^v,(M=T)^(T=v>>>0<I>>>0?t+1|0:t),16),t=R+(M=b)|0,R=t=(v=u+he|0)>>>0<u>>>0?t+1|0:t,Q=we(me^(u=v),t^$,63),I=b,t=w+oe|0,t=(t=(v=k+U|0)>>>0<k>>>0?t+1|0:t)+F|0,k=t=(v=v+N|0)>>>0<N>>>0?t+1|0:t,F=we(v^pe,t^C,32),t=(t=d)+(d=b)|0,t=(C=(N=F)+se|0)>>>0<N>>>0?t+1|0:t,N=w,w=t,U=we(C^U,N^t,24),oe=t=b,N=t,$=F,t=k+q|0,t=(t=(F=v+ie|0)>>>0<v>>>0?t+1|0:t)+N|0,t=(v=(k=F)+U|0)>>>0<k>>>0?t+1|0:t,k=v,N=t,pe=we($^v,t^d,16),t=w+(F=b)|0,$=d=C+pe|0,U=we(d^U,(v=d>>>0<C>>>0?t+1|0:t)^oe,63),d=b,t=g+ce|0,t=(t=(w=O+L|0)>>>0<O>>>0?t+1|0:t)+D|0,B=we((O=w=w+j|0)^Y,(w=w>>>0<j>>>0?t+1|0:t)^B,32),t=m+(D=b)|0,m=g,g=t=(C=A+B|0)>>>0<A>>>0?t+1|0:t,m=we(C^L,m^t,24),A=t=b,L=m,t=w+fe|0,t=(t=(m=O+W|0)>>>0<W>>>0?t+1|0:t)+A|0,ce=w=L+m|0,se=we(w^B,(O=D)^(D=w>>>0<m>>>0?t+1|0:t),16),t=g+(j=b)|0,O=w=C+se|0,B=we(L^w,(g=w>>>0<C>>>0?t+1|0:t)^A,63),w=b,A=_,t=f+Z|0,t=(t=(C=_+re|0)>>>0<_>>>0?t+1|0:t)+S|0,t=(_=C+E|0)>>>0<E>>>0?t+1|0:t,E=_,_=t,m=we(E^de,t^p,32),t=(t=P)+(P=b)|0,S=C=m+ue|0,p=we(A^C,(t=m>>>0>C>>>0?t+1|0:t)^f,24),A=f=b,C=t,t=_+s|0,t=(t=(E=E+H|0)>>>0<H>>>0?t+1|0:t)+f|0,t=(_=E+p|0)>>>0<E>>>0?t+1|0:t,f=S,E=_,S=_^m,m=t,P=f+(_=S=we(S,t^P,16))|0,t=(f=b)+C|0,Y=P,L=we(P^p,(_=P>>>0<_>>>0?t+1|0:t)^A,63),P=b,A=O,p=S,t=T+r|0,S=C=K+X|0,t=(t=C>>>0<K>>>0?t+1|0:t)+d|0,t=(C=C+U|0)>>>0<S>>>0?t+1|0:t,S=f,f=t,O=we(p^C,S^t,32),t=(t=g)+(g=b)|0,T=S=A+O|0,p=we(S^U,(t=S>>>0<O>>>0?t+1|0:t)^d,24),A=d=b,S=t,U=O,t=f+c|0,t=(t=(O=C+G|0)>>>0<C>>>0?t+1|0:t)+d|0,t=(f=(C=O)+p|0)>>>0<C>>>0?t+1|0:t,C=f,O=t,de=we(U^f,t^g,16),t=(t=S)+(S=b)|0,T=d=(g=de)+T|0,oe=we(f=d^p,(p=d>>>0<g>>>0?t+1|0:t)^A,63),g=b,t=w+N|0,t=(d=k+B|0)>>>0<k>>>0?t+1|0:t,k=d,t=t+(f=ue=a[n+132>>2])|0,f=t=(d=(A=a[n+128>>2])+d|0)>>>0<k>>>0?t+1|0:t,N=we(d^he,t^M,32),t=(t=_)+(_=b)|0,M=k=N+Y|0,B=we(k^B,(t=k>>>0<N>>>0?t+1|0:t)^w,24),U=w=b,k=t,Y=N,t=f+ne|0,t=(t=(N=d+x|0)>>>0<d>>>0?t+1|0:t)+w|0,N=d=(f=N)+B|0,d=we(Y^d,(w=_)^(_=d>>>0<f>>>0?t+1|0:t),16),t=(t=k)+(k=b)|0,M=w=d+M|0,Y=we(f=w^B,(B=d>>>0>w>>>0?t+1|0:t)^U,63),w=b,X=L,t=D+ee|0,D=f=h+ce|0,t=(t=f>>>0<h>>>0?t+1|0:t)+P|0,L=we((U=f=f+L|0)^pe,(f=f>>>0<D>>>0?t+1|0:t)^F,32),t=R+(D=b)|0,t=u>>>0>(F=u+L|0)>>>0?t+1|0:t,R=we(X^(u=F),t^P,24),ce=P=b,F=t,he=R,X=u,t=f+le|0,t=(t=(u=U+J|0)>>>0<J>>>0?t+1|0:t)+P|0,t=u>>>0>(f=u+R|0)>>>0?t+1|0:t,u=f,P=D,D=t,pe=we(f^L,P^t,16),t=(P=b)+F|0,F=f=X+(R=pe)|0,ce=we(he^f,(t=f>>>0<R>>>0?t+1|0:t)^ce,63),f=b,R=t,U=d,t=I+i|0,t=(t=(d=Q+te|0)>>>0<te>>>0?t+1|0:t)+m|0,t=(d=d+E|0)>>>0<E>>>0?t+1|0:t,E=d,m=j,j=t,L=we(d^se,m^t,32),t=(d=b)+v|0,X=we((m=L+$|0)^Q,(t=m>>>0<L>>>0?t+1|0:t)^I,24),v=t,I=d,Q=a[n+156>>2],he=m,t=j+($=b)|0,t=(t=(m=E+X|0)>>>0<E>>>0?t+1|0:t)+Q|0,E=t=m>>>0>(j=(d=a[n+152>>2])+m|0)>>>0?t+1|0:t,se=we(j^L,t^I,16),t=(t=v)+(v=b)|0,L=t=(m=se)>>>0>(I=he+m|0)>>>0?t+1|0:t,X=we((m=I)^X,t^$,63),$=t=b,I=t,he=F,t=O+ee|0,t=(t=(F=h+C|0)>>>0<C>>>0?t+1|0:t)+I|0,I=C=F+X|0,U=we(C^U,(O=k)^(k=C>>>0<F>>>0?t+1|0:t),32),t=(C=b)+R|0,O=t=(O=U)>>>0>(F=he+O|0)>>>0?t+1|0:t,X=we(X^F,$^t,24),$=t=b,R=t,he=U,t=k+q|0,t=(t=(U=I+ie|0)>>>0<I>>>0?t+1|0:t)+R|0,t=(I=(k=U)+X|0)>>>0<k>>>0?t+1|0:t,k=I,R=C,C=t,ie=we(he^I,R^t,16),t=O+(R=b)|0,t=(I=F+ie|0)>>>0<F>>>0?t+1|0:t,F=I,O=t,U=we(I^X,t^$,63),I=b,X=oe,t=g+c|0,t=(t=(q=G+oe|0)>>>0<G>>>0?t+1|0:t)+_|0,_=P,P=t=N>>>0>(q=N+q|0)>>>0?t+1|0:t,oe=we(q^pe,_^t,32),t=L+(_=b)|0,t=m>>>0>(N=m+oe|0)>>>0?t+1|0:t,m=g,g=t,L=we(X^N,m^t,24),X=t=b,m=t,$=L,t=P+ue|0,t=(t=(L=A+q|0)>>>0<A>>>0?t+1|0:t)+m|0,q=P=$+(A=L)|0,oe=we(P^oe,(m=P>>>0<A>>>0?t+1|0:t)^_,16),t=g+(A=b)|0,ue=P=N+oe|0,L=we($^P,(_=P>>>0<N>>>0?t+1|0:t)^X,63),P=b,X=Y,t=w+i|0,t=(t=(g=te+Y|0)>>>0<te>>>0?t+1|0:t)+D|0,t=(g=g+u|0)>>>0<u>>>0?t+1|0:t,u=g,N=v,v=t,Y=we(g^se,N^t,32),t=p+(g=b)|0,p=w,w=t=(D=T+Y|0)>>>0<T>>>0?t+1|0:t,T=we(X^D,p^t,24),p=t=b,$=T,t=v+ne|0,t=(t=(T=u+x|0)>>>0<x>>>0?t+1|0:t)+p|0,u=Y,Y=v=$+T|0,X=we(u^v,(N=v>>>0<T>>>0?t+1|0:t)^g,16),t=w+(T=b)|0,pe=v=D+X|0,p=we($^v,(w=v>>>0<D>>>0?t+1|0:t)^p,63),v=b,t=f+fe|0,t=(t=(g=W+ce|0)>>>0<W>>>0?t+1|0:t)+E|0,D=t=(g=g+j|0)>>>0<j>>>0?t+1|0:t,u=we(g^de,t^S,32),t=B+(j=b)|0,S=f,f=t=(E=M+u|0)>>>0<M>>>0?t+1|0:t,M=we(E^ce,S^t,24),B=t=b,S=t,$=u,t=D+Z|0,t=(t=(u=g+re|0)>>>0<g>>>0?t+1|0:t)+S|0,S=g=u+M|0,u=we($^g,(D=j)^(j=g>>>0<u>>>0?t+1|0:t),16),t=f+(D=b)|0,ce=g=E+u|0,M=we(g^M,(f=g>>>0<E>>>0?t+1|0:t)^B,63),g=b,t=C+ae|0,t=(t=(E=k+V|0)>>>0<k>>>0?t+1|0:t)+P|0,E=k=(C=E)+L|0,u=we(k^u,(B=D)^(D=C>>>0>k>>>0?t+1|0:t),32),t=(t=w)+(w=b)|0,C=P,P=t=u>>>0>(k=u+pe|0)>>>0?t+1|0:t,B=we(k^L,C^t,24),L=t=b,C=t,t=D+ge|0,t=(t=(E=E+z|0)>>>0<z>>>0?t+1|0:t)+C|0,de=D=E+B|0,pe=we(D^u,(C=D>>>0<E>>>0?t+1|0:t)^w,16),t=P+(E=b)|0,$=w=k+pe|0,B=we(w^B,(P=w>>>0<k>>>0?t+1|0:t)^L,63),w=b,L=p,t=m+Q|0,t=(t=(D=d+q|0)>>>0<d>>>0?t+1|0:t)+v|0,p=we((m=D=(k=D)+p|0)^ie,(D=m>>>0<k>>>0?t+1|0:t)^R,32),t=(t=f)+(f=b)|0,R=we(L^(u=k=p+ce|0),(t=p>>>0>u>>>0?t+1|0:t)^v,24),L=v=b,k=t,q=R,t=D+s|0,t=(t=(m=m+H|0)>>>0<H>>>0?t+1|0:t)+v|0,t=m>>>0>(D=m+R|0)>>>0?t+1|0:t,v=u,u=(m=D)^p,p=t,u=we(u,t^f,16),t=(R=b)+k|0,f=we(q^(se=v=v+u|0),(v=v>>>0<u>>>0?t+1|0:t)^L,63),D=b,q=M,t=N+le|0,N=k=J+Y|0,t=(t=k>>>0<J>>>0?t+1|0:t)+g|0,L=we((M=k=k+M|0)^oe,(k=k>>>0<N>>>0?t+1|0:t)^A,32),t=O+(N=b)|0,O=A=F+L|0,A=we(q^A,(t=A>>>0<F>>>0?t+1|0:t)^g,24),q=g=b,F=t,Y=O,t=k+r|0,t=(t=(O=M+K|0)>>>0<K>>>0?t+1|0:t)+g|0,t=(k=O+A|0)>>>0<O>>>0?t+1|0:t,O=k,g=N,N=t,he=we(k^L,g^t,16),t=(t=F)+(F=b)|0,L=we((g=Y+(k=he)|0)^A,(t=g>>>0<k>>>0?t+1|0:t)^q,63),k=b,A=g,M=t,t=I+j|0,j=g=S+U|0,t=(t=g>>>0<S>>>0?t+1|0:t)+(q=a[n+204>>2])|0,j=t=(g=(ie=a[n+200>>2])+g|0)>>>0<j>>>0?t+1|0:t,T=we(g^X,t^T,32),t=(t=_)+(_=b)|0,U=we((S=T+ue|0)^U,(t=S>>>0<T>>>0?t+1|0:t)^I,24),I=t,oe=a[n+164>>2],ue=S,t=j+(ce=b)|0,t=(t=(S=g+U|0)>>>0<g>>>0?t+1|0:t)+oe|0,j=g=(Y=a[n+160>>2])+S|0,S=t=g>>>0<S>>>0?t+1|0:t,X=we(g^T,t^_,16),t=(T=b)+I|0,U=we((ue=g=ue+(_=X)|0)^U,(g=g>>>0<_>>>0?t+1|0:t)^ce,63),ce=t=b,_=t,t=C+le|0,t=(t=(I=J+de|0)>>>0<J>>>0?t+1|0:t)+_|0,R=we((_=I=(C=I)+U|0)^u,(I=C>>>0>_>>>0?t+1|0:t)^R,32),t=(C=b)+M|0,M=A=(u=R)+A|0,U=we(U^A,ce^(t=u>>>0>A>>>0?t+1|0:t),24),ce=A=b,u=t,me=U,de=R,t=I+q|0,t=(t=(R=_+ie|0)>>>0<_>>>0?t+1|0:t)+A|0,R=_=(I=R)+U|0,U=we(de^_,(A=C)^(C=I>>>0>_>>>0?t+1|0:t),16),t=(A=b)+u|0,ce=we(me^(de=_=(I=U)+M|0),(_=I>>>0>_>>>0?t+1|0:t)^ce,63),I=b,t=w+Q|0,t=(t=(u=d+B|0)>>>0<d>>>0?t+1|0:t)+p|0,u=we((p=d=u+m|0)^he,(d=d>>>0<m>>>0?t+1|0:t)^F,32),t=(t=g)+(g=b)|0,F=w,w=t=(m=u+ue|0)>>>0<u>>>0?t+1|0:t,M=we(m^B,F^t,24),B=t=b,F=t,t=d+r|0,t=(t=(p=p+K|0)>>>0<K>>>0?t+1|0:t)+F|0,Q=d=p+M|0,ue=we(d^u,(F=d>>>0<p>>>0?t+1|0:t)^g,16),t=w+(p=b)|0,he=d=m+ue|0,u=we(d^M,(g=d>>>0<m>>>0?t+1|0:t)^B,63),d=b,M=f,t=D+Z|0,t=(t=(w=f+re|0)>>>0<f>>>0?t+1|0:t)+N|0,f=t=(w=w+O|0)>>>0<O>>>0?t+1|0:t,m=we(w^X,t^T,32),t=(t=P)+(P=b)|0,O=N=m+$|0,T=we(M^N,(t=m>>>0>N>>>0?t+1|0:t)^D,24),N=t,B=O,M=m,t=f+c|0,f=m=w+G|0,t=(t=m>>>0<w>>>0?t+1|0:t)+(D=b)|0,X=we(M^(m=w=m+T|0),(O=m>>>0<f>>>0?t+1|0:t)^P,16),t=(t=N)+(N=b)|0,f=T,T=P=B+(w=X)|0,M=we(f^P,(w=w>>>0>P>>>0?t+1|0:t)^D,63),P=b,t=k+ee|0,t=(t=(f=h+L|0)>>>0<h>>>0?t+1|0:t)+S|0,E=we((S=f=f+j|0)^pe,(f=f>>>0<j>>>0?t+1|0:t)^E,32),t=(t=v)+(v=b)|0,j=k,k=t=(D=E+se|0)>>>0<E>>>0?t+1|0:t,B=we(D^L,j^t,24),L=t=b,j=t,Z=E,t=f+ge|0,t=(t=(E=S+z|0)>>>0<z>>>0?t+1|0:t)+j|0,j=f=E+B|0,S=we(Z^f,(E=f>>>0<E>>>0?t+1|0:t)^v,16),t=k+(f=b)|0,t=(v=D+S|0)>>>0<D>>>0?t+1|0:t,D=v,k=t,B=we(v^B,t^L,63),v=b,Z=T,L=S,t=C+ne|0,t=(t=(S=x+R|0)>>>0<x>>>0?t+1|0:t)+d|0,t=(C=S+u|0)>>>0<S>>>0?t+1|0:t,S=C,T=f,f=t,T=we(L^C,T^t,32),t=(t=w)+(w=b)|0,R=we((R=u)^(u=C=Z+T|0),(t=u>>>0<T>>>0?t+1|0:t)^d,24),L=d=b,C=t,t=f+s|0,t=(t=(S=S+H|0)>>>0<H>>>0?t+1|0:t)+d|0,t=(f=S+R|0)>>>0<S>>>0?t+1|0:t,S=f,d=f^T,T=t,pe=we(d,t^w,16),t=(t=C)+(C=b)|0,u=d=(w=pe)+u|0,L=we(f=d^R,(R=d>>>0<w>>>0?t+1|0:t)^L,63),f=b,Z=M,t=F+i|0,w=d=Q+te|0,t=(t=d>>>0<te>>>0?t+1|0:t)+P|0,A=we((M=d=d+M|0)^U,(d=d>>>0<w>>>0?t+1|0:t)^A,32),t=k+(w=b)|0,F=we(Z^(k=F=D+A|0),(t=D>>>0>k>>>0?t+1|0:t)^P,24),U=P=b,D=t,Q=F,Z=k,t=d+ae|0,t=(t=(k=M+V|0)>>>0<V>>>0?t+1|0:t)+P|0,F=d=k+F|0,P=we(P=d^A,(A=d>>>0<k>>>0?t+1|0:t)^w,16),t=(k=b)+D|0,$=d=Z+P|0,Z=we(Q^d,(w=d>>>0<P>>>0?t+1|0:t)^U,63),D=b,M=B,t=O+oe|0,t=(d=m+Y|0)>>>0<m>>>0?t+1|0:t,m=d,t=t+v|0,t=(d=d+B|0)>>>0<m>>>0?t+1|0:t,m=d,O=t,B=we(d^ue,t^p,32),t=(d=b)+_|0,U=p=B+de|0,M=we(M^p,(t=p>>>0<B>>>0?t+1|0:t)^v,24),_=t,p=d,re=a[n+132>>2],Q=M,t=O+(v=b)|0,t=(t=(M=m+M|0)>>>0<m>>>0?t+1|0:t)+re|0,O=t=(m=(d=a[n+128>>2])+(O=M)|0)>>>0<O>>>0?t+1|0:t,de=we(m^B,t^p,16),t=(p=b)+_|0,Q=we(Q^(M=(B=de)+U|0),(t=B>>>0>M>>>0?t+1|0:t)^v,63),_=b,B=t,U=P,t=I+fe|0,t=(t=(P=W+ce|0)>>>0<W>>>0?t+1|0:t)+E|0,N=we((v=P=P+j|0)^X,(j=v>>>0<j>>>0?t+1|0:t)^N,32),t=(P=b)+g|0,X=we((E=N+he|0)^ce,(t=E>>>0<N>>>0?t+1|0:t)^I,24),g=t,I=P,ce=a[n+196>>2],he=X,se=E,t=j+(ue=b)|0,t=(t=(E=v+X|0)>>>0<v>>>0?t+1|0:t)+ce|0,j=v=(P=a[n+192>>2])+E|0,E=t=v>>>0<E>>>0?t+1|0:t,X=we(v^N,t^I,16),t=(t=g)+(g=b)|0,N=we(he^(se=v=se+(I=X)|0),(v=v>>>0<I>>>0?t+1|0:t)^ue,63),ue=t=b,I=t,he=M,t=T+q|0,t=(t=(M=S+ie|0)>>>0<S>>>0?t+1|0:t)+I|0,t=(S=(T=M)+N|0)>>>0<T>>>0?t+1|0:t,T=S,I=t,M=we(S^U,t^k,32),t=(k=b)+B|0,B=S=he+M|0,U=we(N^S,ue^(t=S>>>0<M>>>0?t+1|0:t),24),q=N=b,S=t,t=I+re|0,t=(t=(T=d+T|0)>>>0<d>>>0?t+1|0:t)+N|0,ie=I=T+U|0,ue=we(I^M,(N=I>>>0<T>>>0?t+1|0:t)^k,16),t=(t=S)+(S=b)|0,T=I=(k=ue)+B|0,q=we(I^U,(M=I>>>0<k>>>0?t+1|0:t)^q,63),k=b,t=f+i|0,t=(t=(I=L+te|0)>>>0<te>>>0?t+1|0:t)+A|0,F=t=(I=I+F|0)>>>0<F>>>0?t+1|0:t,B=we(I^de,t^p,32),t=(t=v)+(v=b)|0,t=(p=(A=B)+se|0)>>>0<A>>>0?t+1|0:t,A=f,f=t,U=we(p^L,A^t,24),L=t=b,A=t,se=B,t=F+le|0,t=(t=(B=I+J|0)>>>0<I>>>0?t+1|0:t)+A|0,F=I=B+U|0,A=t=I>>>0<B>>>0?t+1|0:t,de=we(se^I,t^v,16),t=f+(B=b)|0,se=v=p+de|0,U=we(v^U,(f=v>>>0<p>>>0?t+1|0:t)^L,63),v=b,t=D+ne|0,t=(t=(I=x+Z|0)>>>0<x>>>0?t+1|0:t)+O|0,p=g,g=t=m>>>0>(I=m+I|0)>>>0?t+1|0:t,L=we(I^X,p^t,32),t=R+(m=b)|0,t=u>>>0>(O=u+L|0)>>>0?t+1|0:t,u=D,D=t,u=we(O^Z,u^t,24),R=t=b,p=t,X=u,t=g+oe|0,t=(t=(u=I+Y|0)>>>0<I>>>0?t+1|0:t)+p|0,I=L,L=g=X+u|0,Z=we(I^g,(p=m)^(m=g>>>0<u>>>0?t+1|0:t),16),t=D+(p=b)|0,O=we(X^(u=g=O+Z|0),(I=u>>>0<O>>>0?t+1|0:t)^R,63),g=b,t=_+ae|0,t=(t=(D=V+Q|0)>>>0<V>>>0?t+1|0:t)+E|0,t=(D=D+j|0)>>>0<j>>>0?t+1|0:t,j=D,D=t,E=we(j^pe,t^C,32),t=(t=w)+(w=b)|0,R=C=E+$|0,Q=we(C^Q,(t=C>>>0<E>>>0?t+1|0:t)^_,24),oe=_=b,C=t,t=D+fe|0,t=(t=(j=j+W|0)>>>0<W>>>0?t+1|0:t)+_|0,j=t=(D=j+Q|0)>>>0<j>>>0?t+1|0:t,_=(w=E=we(D^E,t^w,16))+R|0,t=(t=C)+(C=b)|0,R=Q,Q=_,R=we(R^_,(w=w>>>0>_>>>0?t+1|0:t)^oe,63),_=b,X=u,Y=E,t=N+ge|0,N=E=z+ie|0,t=(t=E>>>0<z>>>0?t+1|0:t)+v|0,t=(E=E+U|0)>>>0<N>>>0?t+1|0:t,N=E,u=C,C=t,u=we(Y^E,u^t,32),t=(t=I)+(I=b)|0,Y=U,U=E=X+u|0,ie=we(Y^E,(t=u>>>0>E>>>0?t+1|0:t)^v,24),oe=v=b,E=t,t=C+r|0,t=(t=(N=N+K|0)>>>0<K>>>0?t+1|0:t)+v|0,Y=C=N+ie|0,X=we(C^u,(v=I)^(I=C>>>0<N>>>0?t+1|0:t),16),t=(C=b)+E|0,E=v=(N=X)+U|0,ie=we(v^ie,(N=v>>>0<N>>>0?t+1|0:t)^oe,63),v=b,U=O,t=A+ee|0,t=(t=(O=h+F|0)>>>0<F>>>0?t+1|0:t)+g|0,u=we((A=F=U+O|0)^ue,(u=S)^(S=O>>>0>A>>>0?t+1|0:t),32),t=(t=w)+(w=b)|0,O=g,g=t=u>>>0>(F=u+Q|0)>>>0?t+1|0:t,U=we(U^F,O^t,24),Q=t=b,O=t,t=S+c|0,t=(t=(A=A+G|0)>>>0<G>>>0?t+1|0:t)+O|0,O=t=(S=A+U|0)>>>0<A>>>0?t+1|0:t,w=we(S^u,t^w,16),t=g+(A=b)|0,t=(u=F+w|0)>>>0<F>>>0?t+1|0:t,F=u,u=t,Q=we(F^U,t^Q,63),g=b,$=R,t=m+s|0,t=(t=(R=L+H|0)>>>0<H>>>0?t+1|0:t)+_|0,L=we((U=m=$+R|0)^de,(m=m>>>0<R>>>0?t+1|0:t)^B,32),t=M+(R=b)|0,M=_,_=t=(B=T+L|0)>>>0<T>>>0?t+1|0:t,B=we($^(T=B),M^t,24),oe=t=b,M=t,$=B,t=m+ce|0,t=(t=(B=P+U|0)>>>0<P>>>0?t+1|0:t)+M|0,M=R,R=t=(m=$+B|0)>>>0<B>>>0?t+1|0:t,de=we(m^L,M^t,16),t=_+(M=b)|0,t=(B=T+de|0)>>>0<T>>>0?t+1|0:t,oe=we($^(T=B),t^oe,63),_=b,B=t,t=k+j|0,t=(t=(L=D+q|0)>>>0<D>>>0?t+1|0:t)+(ue=a[n+156>>2])|0,j=t=(D=(U=a[n+152>>2])+(j=L)|0)>>>0<j>>>0?t+1|0:t,L=we(D^Z,t^p,32),t=(t=f)+(f=b)|0,Z=we((p=L+se|0)^q,(t=p>>>0<L>>>0?t+1|0:t)^k,24),k=t,pe=a[n+236>>2],se=p,$=L,t=j+(q=b)|0,t=(t=(L=D+Z|0)>>>0<D>>>0?t+1|0:t)+pe|0,t=(D=(p=a[n+232>>2])+(j=L)|0)>>>0<j>>>0?t+1|0:t,j=f,f=t,$=we($^D,j^t,16),t=(t=k)+(k=b)|0,L=t=(j=se+(L=$)|0)>>>0<L>>>0?t+1|0:t,q=we(j^Z,t^q,63),Z=t=b,se=T,T=w,t=I+ne|0,t=(t=(w=x+Y|0)>>>0<x>>>0?t+1|0:t)+Z|0,A=we(T^(ne=x=w+q|0),(x=w>>>0>x>>>0?t+1|0:t)^A,32),t=(w=b)+B|0,B=I=se+A|0,Z=we(q^I,Z^(t=I>>>0<A>>>0?t+1|0:t),24),q=I=b,T=t,Y=A,t=x+c|0,t=(t=(A=G+ne|0)>>>0<G>>>0?t+1|0:t)+I|0,Y=we(Y^(I=x=A+Z|0),(A=I>>>0<A>>>0?t+1|0:t)^w,16),t=(t=T)+(T=b)|0,B=x=(w=Y)+B|0,ne=we(ne=x^Z,(Z=w>>>0>x>>>0?t+1|0:t)^q,63),w=b,t=v+s|0,t=(t=(x=H+ie|0)>>>0<H>>>0?t+1|0:t)+O|0,M=we((q=x=x+S|0)^de,(x=x>>>0<S>>>0?t+1|0:t)^M,32),t=L+(S=b)|0,t=(O=j+M|0)>>>0<j>>>0?t+1|0:t,j=O,L=v,v=t,L=we(O^ie,L^t,24),ie=t=b,O=t,se=M,t=x+ae|0,t=(t=(M=V+q|0)>>>0<V>>>0?t+1|0:t)+O|0,q=x=M+L|0,de=we(se^x,(O=S)^(S=x>>>0<M>>>0?t+1|0:t),16),t=v+(O=b)|0,t=(x=j+de|0)>>>0<j>>>0?t+1|0:t,j=x,M=t,L=we(x^L,t^ie,63),v=b,t=g+re|0,t=(t=(x=d+Q|0)>>>0<d>>>0?t+1|0:t)+R|0,t=m>>>0>(x=m+x|0)>>>0?t+1|0:t,m=x,x=t,R=we(m^$,t^k,32),t=N+(d=b)|0,t=E>>>0>(k=E+R|0)>>>0?t+1|0:t,E=g,g=t,N=we(k^Q,E^t,24),re=t=b,E=t,Q=N,t=x+ee|0,t=(t=(N=h+m|0)>>>0<h>>>0?t+1|0:t)+E|0,m=R,R=x=Q+(h=N)|0,ee=we(m^x,(E=h>>>0>x>>>0?t+1|0:t)^d,16),t=g+(N=b)|0,ie=x=k+ee|0,m=we(Q^x,(d=x>>>0<k>>>0?t+1|0:t)^re,63),x=b,t=_+ce|0,t=(t=(h=P+oe|0)>>>0<P>>>0?t+1|0:t)+f|0,t=(h=h+D|0)>>>0<D>>>0?t+1|0:t,D=h,h=t,k=we(D^X,t^C,32),t=u+(P=b)|0,f=_,_=t=(g=F+k|0)>>>0<F>>>0?t+1|0:t,C=we(g^oe,f^t,24),F=t=b,f=t,u=C,t=h+ue|0,t=(t=(D=D+U|0)>>>0<U>>>0?t+1|0:t)+f|0,f=h=D+C|0,C=we(h^k,(D=h>>>0<D>>>0?t+1|0:t)^P,16),t=_+(k=b)|0,re=h=g+C|0,u=we(u^h,(P=h>>>0<g>>>0?t+1|0:t)^F,63),h=b,t=v+A|0,t=(g=I+L|0)>>>0<I>>>0?t+1|0:t,I=g,t=t+(_=a[n+164>>2])|0,k=we((_=C)^(C=g=g+a[n+160>>2]|0),(g=g>>>0<I>>>0?t+1|0:t)^k,32),t=(t=d)+(d=b)|0,F=v,v=t=(I=k)>>>0>(_=I+ie|0)>>>0?t+1|0:t,F=we(_^L,F^t,24),A=t=b,I=t,L=k,t=g+pe|0,t=(t=(k=C+p|0)>>>0<p>>>0?t+1|0:t)+I|0,Q=we(L^(ie=g=k+F|0),(g=g>>>0<k>>>0?t+1|0:t)^d,16),t=v+(I=b)|0,t=(d=_+Q|0)>>>0<_>>>0?t+1|0:t,_=d,k=t,U=we(d^F,t^A,63),d=b,A=m,t=S+le|0,C=v=J+q|0,t=(t=v>>>0<J>>>0?t+1|0:t)+x|0,F=we((S=v=v+m|0)^Y,(v=v>>>0<C>>>0?t+1|0:t)^T,32),t=(t=P)+(P=b)|0,p=x,x=t=(m=F)>>>0>(C=m+re|0)>>>0?t+1|0:t,T=we(A^C,p^t,24),p=t=b,m=t,t=v+i|0,t=(t=(S=S+te|0)>>>0<te>>>0?t+1|0:t)+m|0,v=we((m=v=S+T|0)^F,(S=m>>>0<S>>>0?t+1|0:t)^P,16),t=x+(F=b)|0,t=C>>>0>(P=C+v|0)>>>0?t+1|0:t,P=(C=P)^T,T=t,L=we(P,t^p,63),x=b,Y=u,t=E+fe|0,t=(t=(P=R+W|0)>>>0<W>>>0?t+1|0:t)+h|0,u=we((A=P=(E=P)+u|0)^de,(P=A>>>0<E>>>0?t+1|0:t)^O,32),t=Z+(E=b)|0,p=h,h=t=(O=B+u|0)>>>0<B>>>0?t+1|0:t,R=we(Y^O,p^t,24),B=t=b,p=t,t=P+ge|0,t=(t=(A=A+z|0)>>>0<z>>>0?t+1|0:t)+p|0,Z=we((p=P=A+R|0)^u,(P=E)^(E=p>>>0<A>>>0?t+1|0:t),16),t=h+(A=b)|0,B=we((h=P=O+Z|0)^R,(t=h>>>0<O>>>0?t+1|0:t)^B,63),P=b,O=t,t=w+r|0,t=(t=(u=K+ne|0)>>>0<K>>>0?t+1|0:t)+D|0,f=t=(u=u+f|0)>>>0<f>>>0?t+1|0:t,R=we(u^ee,t^N,32),t=M+(D=b)|0,t=(N=j+R|0)>>>0<j>>>0?t+1|0:t,j=N,M=w,w=t,t=we(N^ne,M^t,24),ne=a[n+204>>2],Y=t,N=t,u=t+u|0,t=(M=b)+f|0,t=(t=u>>>0<N>>>0?t+1|0:t)+ne|0,t=(f=u+a[n+200>>2]|0)>>>0<u>>>0?t+1|0:t,u=D,D=t,ne=we(f^R,u^t,16),t=w+(N=b)|0,w=u=j+ne|0,R=we(Y^u,(j=u>>>0<j>>>0?t+1|0:t)^M,63),u=t=b,X=h,Y=v,t=g+c|0,v=h=G+ie|0,t=(t=h>>>0<G>>>0?t+1|0:t)+u|0,ee=we(Y^(M=h=h+R|0),(h=h>>>0<v>>>0?t+1|0:t)^F,32),t=(v=b)+O|0,F=t=(g=X+(F=ee)|0)>>>0<F>>>0?t+1|0:t,u=we(R^g,u^t,24),re=t=b,O=t,Y=u,t=h+i|0,t=(t=(u=M+te|0)>>>0<te>>>0?t+1|0:t)+O|0,O=h=Y+u|0,ee=we(h^ee,(u=h>>>0<u>>>0?t+1|0:t)^v,16),t=F+(R=b)|0,F=h=g+ee|0,v=we(Y^h,(M=h>>>0<g>>>0?t+1|0:t)^re,63),g=b,Y=U,t=d+r|0,t=(t=(h=K+U|0)>>>0<K>>>0?t+1|0:t)+S|0,A=we((U=h=h+m|0)^Z,(h=h>>>0<m>>>0?t+1|0:t)^A,32),t=j+(m=b)|0,t=w>>>0>(S=w+A|0)>>>0?t+1|0:t,w=S,S=d,d=t,S=we(Y^w,S^t,24),Z=t=b,j=t,Y=S,t=h+fe|0,t=(t=(S=U+W|0)>>>0<W>>>0?t+1|0:t)+j|0,re=h=Y+S|0,q=we(h^A,(j=h>>>0<S>>>0?t+1|0:t)^m,16),t=d+(m=b)|0,t=(h=w+q|0)>>>0<w>>>0?t+1|0:t,w=h,S=t,A=we(Y^h,t^Z,63),d=b,t=x+ge|0,t=(t=(h=L+z|0)>>>0<z>>>0?t+1|0:t)+E|0,t=(h=h+p|0)>>>0<p>>>0?t+1|0:t,p=h,h=t,U=we(p^ne,t^N,32),t=k+(E=b)|0,k=x,x=t=_>>>0>(N=_+U|0)>>>0?t+1|0:t,t=we((_=N)^L,k^t,24),L=a[n+236>>2],Y=t,N=t,p=t+p|0,t=(k=b)+h|0,t=(t=p>>>0<N>>>0?t+1|0:t)+L|0,t=(h=p+a[n+232>>2]|0)>>>0<p>>>0?t+1|0:t,N=h,p=E,E=t,Z=we(h^U,p^t,16),t=x+(p=b)|0,U=we(Y^(L=h=_+Z|0),(h=h>>>0<_>>>0?t+1|0:t)^k,63),x=b,Y=B,t=P+D|0,t=(t=(_=f+B|0)>>>0<f>>>0?t+1|0:t)+(k=a[n+164>>2])|0,B=we((k=_=(f=_)+a[n+160>>2]|0)^Q,(_=f>>>0>_>>>0?t+1|0:t)^I,32),t=T+(f=b)|0,t=C>>>0>(I=C+B|0)>>>0?t+1|0:t,C=P,P=t,C=we(Y^I,C^t,24),T=t=b,D=t,t=_+ae|0,t=(t=(k=k+V|0)>>>0<V>>>0?t+1|0:t)+D|0,k=we((ne=_=k+C|0)^B,(_=_>>>0<k>>>0?t+1|0:t)^f,16),t=P+(f=b)|0,t=(D=I+k|0)>>>0<I>>>0?t+1|0:t,I=D,D=t,B=we(I^C,t^T,63),P=b,T=k,t=d+u|0,t=(k=A+O|0)>>>0<O>>>0?t+1|0:t,O=k,t=t+(C=a[n+132>>2])|0,t=(k=k+a[n+128>>2]|0)>>>0<O>>>0?t+1|0:t,O=k,u=f,f=t,T=we(T^k,u^t,32),t=(t=h)+(h=b)|0,u=d,d=t=(C=T)>>>0>(k=C+L|0)>>>0?t+1|0:t,A=we(k^A,u^t,24),u=t=b,t=f+le|0,t=(t=(O=O+J|0)>>>0<J>>>0?t+1|0:t)+u|0,Q=we((ie=f=O+A|0)^T,(f=f>>>0<O>>>0?t+1|0:t)^h,16),t=d+(C=b)|0,t=(h=k+Q|0)>>>0<k>>>0?t+1|0:t,k=h,O=t,L=we(h^A,t^u,63),h=b,t=j+s|0,j=d=H+re|0,t=(t=d>>>0<H>>>0?t+1|0:t)+x|0,u=we((A=d=d+U|0)^ee,(d=d>>>0<j>>>0?t+1|0:t)^R,32),t=D+(j=b)|0,t=I>>>0>(T=I+u|0)>>>0?t+1|0:t,I=T,T=x,x=t,t=we(I^U,T^t,24),R=a[n+156>>2],U=t,T=t,A=t+A|0,t=(D=b)+d|0,t=(t=A>>>0<T>>>0?t+1|0:t)+R|0,t=(d=A+a[n+152>>2]|0)>>>0<A>>>0?t+1|0:t,T=d,A=j,j=t,ee=we(d^u,A^t,16),t=x+(A=b)|0,t=(d=I+ee|0)>>>0<I>>>0?t+1|0:t,I=d,u=D,D=t,U=we(U^d,u^t,63),d=b,t=P+E|0,E=x=N+B|0,t=(t=x>>>0<N>>>0?t+1|0:t)+(u=a[n+204>>2])|0,E=t=(x=x+a[n+200>>2]|0)>>>0<E>>>0?t+1|0:t,R=we(x^q,t^m,32),t=M+(N=b)|0,u=P,P=t=(m=F+R|0)>>>0<F>>>0?t+1|0:t,u=we(m^B,u^t,24),F=t=b,B=u,t=t+E|0,t=(t=(u=u+x|0)>>>0<x>>>0?t+1|0:t)+(M=a[n+148>>2])|0,t=(x=u+a[n+144>>2]|0)>>>0<u>>>0?t+1|0:t,E=x,u=N,N=t,re=we(x^R,u^t,16),t=P+(u=b)|0,P=F,F=t=m>>>0>(x=m+re|0)>>>0?t+1|0:t,M=we(B^(m=x),P^t,63),P=b,B=v,t=g+_|0,t=(t=(x=v+ne|0)>>>0<v>>>0?t+1|0:t)+(R=a[n+196>>2])|0,R=x=(v=x)+a[n+192>>2]|0,p=we(x^Z,(v=v>>>0>x>>>0?t+1|0:t)^p,32),t=S+(_=b)|0,S=x=w+p|0,x=we(B^x,(t=w>>>0>x>>>0?t+1|0:t)^g,24),w=t,Z=a[n+220>>2],$=x,X=S,Y=p,t=(g=b)+v|0,t=(t=(p=x+R|0)>>>0<x>>>0?t+1|0:t)+(B=Z)|0,ne=we(Y^(p=x=(S=a[n+216>>2])+(v=p)|0),(x=_)^(_=v>>>0>p>>>0?t+1|0:t),16),t=(t=w)+(w=b)|0,R=t=(v=ne)>>>0>(x=X+v|0)>>>0?t+1|0:t,t=we($^x,t^g,63),q=a[n+236>>2],Y=t,g=t,B=t+ie|0,t=(v=b)+f|0,t=(t=g>>>0>B>>>0?t+1|0:t)+q|0,ee=we((B=g=(f=B)+a[n+232>>2]|0)^ee,(g=g>>>0<f>>>0?t+1|0:t)^A,32),t=F+(f=b)|0,F=v,v=t=m>>>0>(A=m+ee|0)>>>0?t+1|0:t,A=t=we(Y^(m=A),F^t,24),B=t+B|0,t=(F=b)+g|0,t=Z+(A>>>0>B>>>0?t+1|0:t)|0,Z=g=S+B|0,ee=we(g^ee,(B=f)^(f=g>>>0<S>>>0?t+1|0:t),16),t=v+(S=b)|0,v=F,F=t=(g=m+ee|0)>>>0<m>>>0?t+1|0:t,v=we(A^(m=g),v^t,63),g=b,t=h+le|0,t=(t=(A=L+J|0)>>>0<J>>>0?t+1|0:t)+j|0,B=A=A+T|0,u=we(A^re,(j=A>>>0<T>>>0?t+1|0:t)^u,32),t=R+(T=b)|0,t=x>>>0>(A=x+u|0)>>>0?t+1|0:t,x=A,R=h,h=t,R=we(A^L,R^t,24),L=t=b,A=t,Y=u,t=j+ge|0,t=(t=(u=B+z|0)>>>0<z>>>0?t+1|0:t)+A|0,q=we(Y^(re=j=u+R|0),(j=u>>>0>j>>>0?t+1|0:t)^T,16),t=h+(T=b)|0,u=t=x>>>0>(A=x+q|0)>>>0?t+1|0:t,R=we(A^R,t^L,63),x=b,t=d+c|0,t=(t=(h=U+G|0)>>>0<G>>>0?t+1|0:t)+N|0,B=we((N=h=h+E|0)^ne,(h=h>>>0<E>>>0?t+1|0:t)^w,32),t=O+(w=b)|0,t=(E=k+B|0)>>>0<k>>>0?t+1|0:t,k=E,E=d,d=t,O=we(k^U,E^t,24),U=t=b,E=t,t=h+r|0,t=(t=(N=N+K|0)>>>0<K>>>0?t+1|0:t)+E|0,E=h=N+O|0,L=we(h^B,(L=w)^(w=h>>>0<N>>>0?t+1|0:t),16),t=d+(N=b)|0,t=(h=k+L|0)>>>0<k>>>0?t+1|0:t,k=h,d=h^O,O=t,B=we(d,t^U,63),h=b,Y=M,t=P+_|0,_=d=p+M|0,t=(t=d>>>0<p>>>0?t+1|0:t)+(U=a[n+156>>2])|0,_=t=(d=d+a[n+152>>2]|0)>>>0<_>>>0?t+1|0:t,M=we(d^Q,t^C,32),t=D+(C=b)|0,t=(p=I+M|0)>>>0<I>>>0?t+1|0:t,I=p,D=P,P=t,p=we(Y^p,D^t,24),D=t=b,Q=p,t=t+_|0,t=(t=(p=d+p|0)>>>0<d>>>0?t+1|0:t)+(U=a[n+204>>2])|0,ne=d=p+a[n+200>>2]|0,p=we(d^M,(_=d>>>0<p>>>0?t+1|0:t)^C,16),t=P+(C=b)|0,P=d=I+p|0,M=we(Q^d,(I=d>>>0<I>>>0?t+1|0:t)^D,63),d=b,U=R,t=f+i|0,t=(t=(D=Z+te|0)>>>0<te>>>0?t+1|0:t)+x|0,D=t=(f=D+R|0)>>>0<D>>>0?t+1|0:t,R=we(f^p,t^C,32),t=O+(C=b)|0,t=(p=k+R|0)>>>0<k>>>0?t+1|0:t,k=p,O=x,x=t,p=we(U^p,O^t,24),O=t=b,Q=p,t=t+D|0,t=(t=(p=f+p|0)>>>0<f>>>0?t+1|0:t)+(U=a[n+132>>2])|0,ie=we((Z=f=p+a[n+128>>2]|0)^R,(f=f>>>0<p>>>0?t+1|0:t)^C,16),t=x+(D=b)|0,t=(C=k+ie|0)>>>0<k>>>0?t+1|0:t,k=C,C=t,U=we(Q^k,t^O,63),x=b,t=j+fe|0,t=(t=(O=W+re|0)>>>0<W>>>0?t+1|0:t)+h|0,R=we((p=j=O+B|0)^ee,(j=O>>>0>p>>>0?t+1|0:t)^S,32),t=I+(S=b)|0,t=P>>>0>(O=P+R|0)>>>0?t+1|0:t,P=O,O=h,h=t,t=we(P^B,O^t,24),B=a[n+164>>2],Q=t,O=t,p=t+p|0,t=(I=b)+j|0,t=(t=p>>>0<O>>>0?t+1|0:t)+B|0,t=p>>>0>(j=p+a[n+160>>2]|0)>>>0?t+1|0:t,p=S,S=t,O=we(j^R,p^t,16),t=h+(p=b)|0,h=I,I=t=P>>>0>(R=P+O|0)>>>0?t+1|0:t,h=we(Q^R,h^t,63),P=b,Q=M,t=d+w|0,t=(t=(M=E+M|0)>>>0<E>>>0?t+1|0:t)+(B=a[n+196>>2])|0,B=we((M=w=(E=M)+a[n+192>>2]|0)^q,(w=w>>>0<E>>>0?t+1|0:t)^T,32),t=F+(E=b)|0,F=d,d=t=m>>>0>(T=m+B|0)>>>0?t+1|0:t,T=we(Q^(m=T),F^t,24),ee=t=b,F=t,Q=T,t=w+s|0,t=(t=(T=M+H|0)>>>0<H>>>0?t+1|0:t)+F|0,q=we((re=w=Q+T|0)^B,(w=w>>>0<T>>>0?t+1|0:t)^E,16),t=d+(E=b)|0,t=m>>>0>(F=m+q|0)>>>0?t+1|0:t,M=we(Q^(m=F),t^ee,63),d=b,F=t,Q=v,t=g+_|0,t=(t=(T=v+ne|0)>>>0<v>>>0?t+1|0:t)+(B=a[n+148>>2])|0,L=we((B=v=(_=T)+a[n+144>>2]|0)^L,(v=v>>>0<_>>>0?t+1|0:t)^N,32),t=u+(_=b)|0,u=g,g=t=A>>>0>(N=A+L|0)>>>0?t+1|0:t,A=we(Q^N,u^t,24),u=t=b,Q=A,t=v+ae|0,t=(t=(A=B+V|0)>>>0<V>>>0?t+1|0:t)+u|0,T=v=Q+A|0,L=we(v^L,(B=_)^(_=v>>>0<A>>>0?t+1|0:t),16),t=g+(A=b)|0,u=we(Q^(g=v=N+L|0),(N=g>>>0<N>>>0?t+1|0:t)^u,63),B=t=b,v=t,Q=m,t=f+s|0,t=(t=(m=H+Z|0)>>>0<H>>>0?t+1|0:t)+v|0,Z=f=m+u|0,p=we(f^O,(v=f>>>0<m>>>0?t+1|0:t)^p,32),t=(f=b)+F|0,F=t=(m=Q+p|0)>>>0<p>>>0?t+1|0:t,u=we(u^m,B^t,24),B=t=b,O=t,Q=p,t=v+fe|0,t=(t=(p=W+Z|0)>>>0<W>>>0?t+1|0:t)+O|0,Z=v=p+u|0,ne=we(Q^v,(O=f)^(f=v>>>0<p>>>0?t+1|0:t),16),t=F+(O=b)|0,F=t=(v=m+ne|0)>>>0<m>>>0?t+1|0:t,B=we((m=v)^u,t^B,63),v=b,t=x+ge|0,t=(t=(p=U+z|0)>>>0<z>>>0?t+1|0:t)+S|0,j=t=(p=p+j|0)>>>0<j>>>0?t+1|0:t,u=we(p^q,t^E,32),t=N+(E=b)|0,t=g>>>0>(S=g+u|0)>>>0?t+1|0:t,g=S,S=x,x=t,t=we(g^U,S^t,24),U=a[n+204>>2],Q=t,S=t,p=t+p|0,t=(N=b)+j|0,t=(t=S>>>0>p>>>0?t+1|0:t)+U|0,q=we((ee=j=p+a[n+200>>2]|0)^u,(j=p>>>0>j>>>0?t+1|0:t)^E,16),t=x+(E=b)|0,u=N,N=t=g>>>0>(S=g+q|0)>>>0?t+1|0:t,u=we(Q^S,u^t,63),x=b,U=h,t=w+P|0,t=(t=(g=h+re|0)>>>0<h>>>0?t+1|0:t)+(p=a[n+220>>2])|0,A=we((p=h=g+a[n+216>>2]|0)^L,(h=h>>>0<g>>>0?t+1|0:t)^A,32),t=C+(g=b)|0,t=(w=k+A|0)>>>0<k>>>0?t+1|0:t,k=P,P=t,t=we(U^w,k^t,24),U=a[n+156>>2],L=t,C=t,p=t+p|0,t=(k=b)+h|0,t=(t=C>>>0>p>>>0?t+1|0:t)+U|0,re=h=p+a[n+152>>2]|0,Q=we(h^A,(C=h>>>0<p>>>0?t+1|0:t)^g,16),t=P+(p=b)|0,t=(h=w+Q|0)>>>0<w>>>0?t+1|0:t,w=h,g=k,k=t,P=we(L^h,g^t,63),g=b,L=M,t=d+_|0,_=h=T+M|0,t=(t=h>>>0<T>>>0?t+1|0:t)+(A=a[n+132>>2])|0,_=t=(h=h+a[n+128>>2]|0)>>>0<_>>>0?t+1|0:t,M=we(h^ie,t^D,32),t=I+(D=b)|0,A=we(L^(I=T=R+M|0),(T=d)^(d=I>>>0<R>>>0?t+1|0:t),24),T=t=b,L=A,t=t+_|0,_=A=h+A|0,t=(t=A>>>0<h>>>0?t+1|0:t)+(R=a[n+196>>2])|0,A=h=A+a[n+192>>2]|0,R=we(h^M,(R=D)^(D=h>>>0<_>>>0?t+1|0:t),16),t=d+(_=b)|0,t=(h=I+R|0)>>>0<I>>>0?t+1|0:t,I=h,d=T,T=t,U=we(L^h,d^t,63),h=b,M=u,t=f+c|0,f=d=G+Z|0,t=(t=d>>>0<G>>>0?t+1|0:t)+x|0,t=(d=d+u|0)>>>0<f>>>0?t+1|0:t,f=_,_=t,R=we(d^R,f^t,32),t=k+(f=b)|0,k=u=w+R|0,u=we(M^u,(t=w>>>0>u>>>0?t+1|0:t)^x,24),w=t,Z=a[n+148>>2],Y=u,L=k,t=_+(x=b)|0,t=(t=(u=d+u|0)>>>0<d>>>0?t+1|0:t)+(M=Z)|0,ie=d=(k=a[n+144>>2])+u|0,oe=we(d^R,(_=f)^(f=d>>>0<u>>>0?t+1|0:t),16),t=(u=b)+w|0,R=d=L+(_=oe)|0,d=we(Y^d,(M=d>>>0<_>>>0?t+1|0:t)^x,63),_=b,L=P,t=g+j|0,t=(x=P+ee|0)>>>0<P>>>0?t+1|0:t,P=x,t=t+(w=a[n+236>>2])|0,O=we((j=x=x+a[n+232>>2]|0)^ne,(x=x>>>0<P>>>0?t+1|0:t)^O,32),t=T+(P=b)|0,t=(w=I+O|0)>>>0<I>>>0?t+1|0:t,I=g,g=t,T=we(L^w,I^t,24),L=t=b,I=t,t=x+le|0,t=(t=(j=j+J|0)>>>0<J>>>0?t+1|0:t)+I|0,ne=x=j+T|0,x=we(x^O,(I=x>>>0<j>>>0?t+1|0:t)^P,16),t=g+(j=b)|0,O=P=w+x|0,L=we(g=P^T,(T=w>>>0>P>>>0?t+1|0:t)^L,63),P=b,Y=U,t=C+r|0,w=g=K+re|0,t=(t=g>>>0<K>>>0?t+1|0:t)+h|0,w=t=(g=g+U|0)>>>0<w>>>0?t+1|0:t,U=we(g^q,t^E,32),t=F+(C=b)|0,t=m>>>0>(E=m+U|0)>>>0?t+1|0:t,F=we(Y^(m=E),t^h,24),E=t,ee=a[n+164>>2],$=F,X=m,t=w+(h=b)|0,t=(t=(F=g+F|0)>>>0<g>>>0?t+1|0:t)+ee|0,F=g=(m=a[n+160>>2])+(w=F)|0,re=we(g^U,(Y=C)^(C=g>>>0<w>>>0?t+1|0:t),16),t=(t=E)+(E=b)|0,t=(g=X+(w=re)|0)>>>0<w>>>0?t+1|0:t,w=g,U=h,h=t,U=we($^g,U^t,63),g=b,Y=B,t=v+ae|0,t=(t=(B=B+V|0)>>>0<V>>>0?t+1|0:t)+D|0,D=t=A>>>0>(B=A+B|0)>>>0?t+1|0:t,q=we(B^Q,t^p,32),t=N+(p=b)|0,N=A=S+q|0,A=we(Y^A,(Q=v)^(v=S>>>0>A>>>0?t+1|0:t),24),Q=t=b,S=t,Y=A,t=D+i|0,t=(t=(A=B+te|0)>>>0<te>>>0?t+1|0:t)+S|0,S=t=(D=Y+A|0)>>>0<A>>>0?t+1|0:t,q=we(D^q,t^p,16),t=v+(p=b)|0,t=(A=N+q|0)>>>0<N>>>0?t+1|0:t,N=A,A=t,B=we(Y^N,t^Q,63),Q=t=b,v=t,Y=x,t=f+ae|0,t=(t=(x=V+ie|0)>>>0<V>>>0?t+1|0:t)+v|0,j=we(Y^(f=V=x+B|0),(x=x>>>0>f>>>0?t+1|0:t)^j,32),t=h+(v=b)|0,ae=V=w+j|0,w=t=w>>>0>V>>>0?t+1|0:t,Q=V=we(B^V,Q^t,24),t=(h=b)+x|0,t=(t=(f=f+V|0)>>>0<V>>>0?t+1|0:t)+Z|0,Z=we((B=V=f+k|0)^j,(f=k>>>0>B>>>0?t+1|0:t)^v,16),t=(k=b)+w|0,ae=V=(x=Z)+ae|0,v=we(Q^V,(x=x>>>0>V>>>0?t+1|0:t)^h,63),w=b,Q=d,t=I+_|0,t=(t=(V=d+ne|0)>>>0<d>>>0?t+1|0:t)+(h=a[n+196>>2])|0,E=we((j=V=(d=V)+a[n+192>>2]|0)^re,(V=d>>>0>j>>>0?t+1|0:t)^E,32),t=A+(h=b)|0,I=_,_=t=(d=N+E|0)>>>0<N>>>0?t+1|0:t,A=t=we(Q^d,I^t,24),N=E,E=j,j=t,E=E+t|0,t=(I=b)+V|0,t=ee+(E>>>0<j>>>0?t+1|0:t)|0,ne=V=m+E|0,ee=we(N^V,(j=m>>>0>V>>>0?t+1|0:t)^h,16),t=_+(E=b)|0,A=we(A^(_=V=d+ee|0),(h=I)^(I=d>>>0>_>>>0?t+1|0:t),63),V=b,t=P+le|0,t=(t=(h=L+J|0)>>>0<J>>>0?t+1|0:t)+C|0,F=we((m=h=h+F|0)^q,(h=h>>>0<F>>>0?t+1|0:t)^p,32),t=M+(d=b)|0,p=P,P=t=(C=R+F|0)>>>0<R>>>0?t+1|0:t,p=we(C^L,p^t,24),R=t=b,N=t,t=h+s|0,t=(t=(m=m+H|0)>>>0<H>>>0?t+1|0:t)+N|0,N=h=m+p|0,L=we(h^F,(m=h>>>0<m>>>0?t+1|0:t)^d,16),t=P+(F=b)|0,d=we((d=p)^(p=h=C+L|0),(h=h>>>0<C>>>0?t+1|0:t)^R,63),P=b,t=g+r|0,t=(t=(C=K+U|0)>>>0<K>>>0?t+1|0:t)+S|0,R=C=C+D|0,u=we(C^oe,(D=C>>>0<D>>>0?t+1|0:t)^u,32),t=T+(C=b)|0,t=(S=O+u|0)>>>0<O>>>0?t+1|0:t,O=g,g=t,T=we(S^U,O^t,24),M=t=b,O=t,U=T,t=D+i|0,t=(t=(T=R+te|0)>>>0<te>>>0?t+1|0:t)+O|0,T=we((R=D=U+T|0)^u,(D=D>>>0<T>>>0?t+1|0:t)^C,16),t=g+(C=b)|0,t=S>>>0>(O=S+T|0)>>>0?t+1|0:t,S=O,O=t,u=we(U^S,t^M,63),g=b,Q=A,U=p,M=T,t=f+fe|0,t=(t=(T=B+W|0)>>>0<W>>>0?t+1|0:t)+V|0,A=we(M^(p=f=T+A|0),(f=p>>>0<T>>>0?t+1|0:t)^C,32),t=(t=h)+(h=b)|0,T=V,V=t=(C=U+A|0)>>>0<A>>>0?t+1|0:t,t=we(Q^C,T^t,24),M=a[n+220>>2],Q=t,U=A,T=p,p=t,A=T+t|0,t=(T=b)+f|0,t=(t=p>>>0>A>>>0?t+1|0:t)+M|0,U=we(U^(B=f=(p=A)+a[n+216>>2]|0),(f=f>>>0<p>>>0?t+1|0:t)^h,16),t=V+(p=b)|0,t=(h=C+U|0)>>>0<C>>>0?t+1|0:t,C=h,A=T,T=t,V=we(Q^h,A^t,63),h=b,Q=d,t=P+j|0,j=A=d+ne|0,t=(t=A>>>0<d>>>0?t+1|0:t)+(M=a[n+204>>2])|0,M=we((A=d=A+a[n+200>>2]|0)^Z,(d=d>>>0<j>>>0?t+1|0:t)^k,32),t=O+(k=b)|0,t=S>>>0>(j=S+M|0)>>>0?t+1|0:t,S=P,P=t,O=we(Q^j,S^t,24),Z=t=b,S=t,Q=O,t=d+ge|0,t=(t=(O=A+z|0)>>>0<z>>>0?t+1|0:t)+S|0,ne=d=Q+O|0,re=we(d^M,(S=k)^(k=d>>>0<O>>>0?t+1|0:t),16),t=P+(S=b)|0,t=(d=j+re|0)>>>0<j>>>0?t+1|0:t,j=d,O=t,d=we(Q^d,t^Z,63),P=b,Q=u,t=g+m|0,m=u=u+N|0,t=(t=u>>>0<N>>>0?t+1|0:t)+(M=Z=a[n+156>>2])|0,M=we((u=N=(A=a[n+152>>2])+u|0)^ee,(N=E)^(E=m>>>0>u>>>0?t+1|0:t),32),t=(t=x)+(x=b)|0,t=(m=M)>>>0>(N=m+ae|0)>>>0?t+1|0:t,m=g,g=t,ae=we(Q^N,m^t,24),ee=t=b,m=t,Q=ae,t=E+c|0,t=(t=(u=u+G|0)>>>0<G>>>0?t+1|0:t)+m|0,q=we((ae=E=u+ae|0)^M,(E=u>>>0>E>>>0?t+1|0:t)^x,16),t=g+(m=b)|0,M=we(Q^(g=x=N+q|0),(N=g>>>0<N>>>0?t+1|0:t)^ee,63),x=b,Q=v,t=w+D|0,D=u=v+R|0,t=(t=u>>>0<v>>>0?t+1|0:t)+(ee=a[n+236>>2])|0,R=we((u=v=u+a[n+232>>2]|0)^L,(D=u>>>0<D>>>0?t+1|0:t)^F,32),t=I+(F=b)|0,I=v=_+R|0,v=we(Q^v,(t=v>>>0<_>>>0?t+1|0:t)^w,24),w=t,L=a[n+132>>2],Y=v,Q=I,t=(_=b)+D|0,t=(t=(u=v+u|0)>>>0<v>>>0?t+1|0:t)+L|0,t=(v=(I=a[n+128>>2])+u|0)>>>0<u>>>0?t+1|0:t,D=v,u=F,F=t,ee=we(v^R,u^t,16),t=(t=w)+(w=b)|0,t=(v=Q+(u=ee)|0)>>>0<u>>>0?t+1|0:t,u=v,v=_,_=t,Q=t=we(Y^u,v^t,63),R=t,B=t+B|0,t=(v=b)+f|0,t=L+(B>>>0<R>>>0?t+1|0:t)|0,B=we((R=f=I+B|0)^re,(f=f>>>0<I>>>0?t+1|0:t)^S,32),t=N+(I=b)|0,t=g>>>0>(S=g+B|0)>>>0?t+1|0:t,g=S,S=v,v=t,S=we(Q^g,S^t,24),L=t=b,N=t,Q=S,t=f+r|0,t=(t=(S=R+K|0)>>>0<K>>>0?t+1|0:t)+N|0,re=we((R=f=Q+S|0)^B,(f=f>>>0<S>>>0?t+1|0:t)^I,16),t=v+(I=b)|0,S=t=g>>>0>(N=g+re|0)>>>0?t+1|0:t,B=we(Q^N,t^L,63),v=b,Q=V,t=h+k|0,t=(t=(g=V+ne|0)>>>0<V>>>0?t+1|0:t)+(L=a[n+148>>2])|0,m=we((L=V=g+a[n+144>>2]|0)^q,(V=g>>>0>V>>>0?t+1|0:t)^m,32),t=_+(g=b)|0,Y=t=we(Q^(_=k=u+m|0),(k=h)^(h=u>>>0>_>>>0?t+1|0:t),24),Q=m,m=t,u=t+L|0,t=(k=b)+V|0,t=Z+(u>>>0<m>>>0?t+1|0:t)|0,L=we(Q^(u=V=u+A|0),(m=A>>>0>u>>>0?t+1|0:t)^g,16),t=h+(A=b)|0,h=k,k=t=_>>>0>(V=_+L|0)>>>0?t+1|0:t,h=we(Y^(_=V),h^t,63),g=b,Q=d,t=P+E|0,t=(t=(V=d+ae|0)>>>0<d>>>0?t+1|0:t)+(Z=a[n+164>>2])|0,Z=we((E=V=(d=V)+a[n+160>>2]|0)^ee,(V=d>>>0>E>>>0?t+1|0:t)^w,32),t=T+(d=b)|0,t=(w=C+Z|0)>>>0<C>>>0?t+1|0:t,C=P,P=t,T=we(Q^w,C^t,24),ae=t=b,C=t,t=V+i|0,t=(t=(E=E+te|0)>>>0<te>>>0?t+1|0:t)+C|0,Q=Z,Z=V=E+T|0,ne=we(Q^V,(C=E>>>0>V>>>0?t+1|0:t)^d,16),t=P+(E=b)|0,t=w>>>0>(V=w+ne|0)>>>0?t+1|0:t,d=(w=V)^T,T=t,d=we(d,t^ae,63),P=b,Q=M,t=x+s|0,t=(t=(V=M+H|0)>>>0<H>>>0?t+1|0:t)+F|0,p=we((M=V=D+V|0)^U,(V=D>>>0>V>>>0?t+1|0:t)^p,32),t=O+(D=b)|0,t=j>>>0>(F=j+p|0)>>>0?t+1|0:t,j=F,F=x,x=t,O=we(Q^j,F^t,24),U=t=b,F=t,Q=O,t=V+le|0,t=(t=(O=M+J|0)>>>0<J>>>0?t+1|0:t)+F|0,p=we((F=V=Q+O|0)^p,(M=D)^(D=O>>>0>F>>>0?t+1|0:t),16),t=x+(O=b)|0,ae=V=j+p|0,M=we(Q^V,(x=j>>>0>V>>>0?t+1|0:t)^U,63),V=b,Q=h,t=g+f|0,f=j=h+R|0,t=(t=j>>>0<h>>>0?t+1|0:t)+(U=a[n+196>>2])|0,O=we((j=p)^(p=h=f+a[n+192>>2]|0),(h=h>>>0<f>>>0?t+1|0:t)^O,32),t=T+(f=b)|0,T=g,g=t=w>>>0>(j=w+O|0)>>>0?t+1|0:t,t=we(Q^(w=j),T^t,24),R=a[n+204>>2],Y=t,Q=O,O=t,T=t+p|0,t=(j=b)+h|0,t=(t=O>>>0>T>>>0?t+1|0:t)+R|0,U=h=(O=T)+a[n+200>>2]|0,ee=we(Q^h,(p=f)^(f=h>>>0<O>>>0?t+1|0:t),16),t=g+(O=b)|0,t=(h=w+ee|0)>>>0<w>>>0?t+1|0:t,w=h,g=j,j=t,h=we(Y^h,g^t,63),g=b,Q=d,t=m+P|0,m=p=d+u|0,t=(t=p>>>0<d>>>0?t+1|0:t)+(R=q=a[n+212>>2])|0,u=we((p=d=(T=a[n+208>>2])+p|0)^re,(d=d>>>0<m>>>0?t+1|0:t)^I,32),t=(t=x)+(x=b)|0,m=P,P=t=u>>>0>(I=u+ae|0)>>>0?t+1|0:t,t=we(Q^I,m^t,24),R=a[n+220>>2],Y=t,Q=u,u=p,p=t,u=u+t|0,t=(m=b)+d|0,t=(t=u>>>0<p>>>0?t+1|0:t)+R|0,ae=d=u+a[n+216>>2]|0,u=we(Q^d,(p=d>>>0<u>>>0?t+1|0:t)^x,16),t=P+(R=b)|0,d=m,m=t=(x=I+u|0)>>>0<I>>>0?t+1|0:t,x=we(Y^(I=x),d^t,63),d=b,Q=M,t=C+c|0,t=(t=(P=G+Z|0)>>>0<G>>>0?t+1|0:t)+V|0,C=t=(C=P)>>>0>(P=C+M|0)>>>0?t+1|0:t,L=we(P^L,t^A,32),t=S+(A=b)|0,S=V,V=t=N>>>0>(M=N+L|0)>>>0?t+1|0:t,M=we(Q^(N=M),S^t,24),S=t=b,Q=M,t=t+C|0,C=M=P+M|0,t=(t=M>>>0<P>>>0?t+1|0:t)+(Z=a[n+236>>2])|0,M=L,L=P=C+a[n+232>>2]|0,Z=we(M^P,(C=C>>>0>P>>>0?t+1|0:t)^A,16),t=V+(A=b)|0,N=t=(P=N+Z|0)>>>0<N>>>0?t+1|0:t,M=we(Q^P,t^S,63),V=b,Q=B,t=v+ge|0,t=(t=(S=B+z|0)>>>0<z>>>0?t+1|0:t)+D|0,t=(S=S+F|0)>>>0<F>>>0?t+1|0:t,F=S,D=t,B=we(S^ne,t^E,32),t=k+(E=b)|0,t=(S=_+B|0)>>>0<_>>>0?t+1|0:t,_=S,S=v,v=t,S=we(Q^_,S^t,24),ne=t=b,k=t,Q=S,t=D+fe|0,t=(t=(S=F+W|0)>>>0<W>>>0?t+1|0:t)+k|0,k=t=S>>>0>(D=Q+S|0)>>>0?t+1|0:t,B=we(D^B,t^E,16),t=v+(E=b)|0,t=(S=_+B|0)>>>0<_>>>0?t+1|0:t,_=S,S=t,F=we(Q^_,t^ne,63),ne=t=b,v=t,Q=u,t=f+ge|0,f=u=U+z|0,t=(t=u>>>0<z>>>0?t+1|0:t)+v|0,R=we(Q^(u=z=u+F|0),(z=f>>>0>u>>>0?t+1|0:t)^R,32),t=N+(v=b)|0,t=(f=P+R|0)>>>0<P>>>0?t+1|0:t,P=f,f=t,U=t=we(F^P,ne^t,24),F=t,u=t+u|0,t=(N=b)+z|0,t=q+(u>>>0<F>>>0?t+1|0:t)|0,R=we((u=z=u+T|0)^R,(F=T>>>0>u>>>0?t+1|0:t)^v,16),t=f+(T=b)|0,P=we(U^(f=z=P+R|0),(v=N)^(N=P>>>0>f>>>0?t+1|0:t),63),v=b,Q=h,t=g+p|0,t=(t=(z=h+ae|0)>>>0<h>>>0?t+1|0:t)+(U=a[n+164>>2])|0,A=we((U=z=(h=z)+a[n+160>>2]|0)^Z,(z=h>>>0>U>>>0?t+1|0:t)^A,32),t=S+(h=b)|0,t=(p=_+A|0)>>>0<_>>>0?t+1|0:t,_=p,S=g,g=t,t=we(Q^p,S^t,24),Z=a[n+196>>2],Y=t,Q=A,p=t,A=t+U|0,t=(S=b)+z|0,t=(t=p>>>0>A>>>0?t+1|0:t)+Z|0,U=we(Q^(A=z=(p=A)+a[n+192>>2]|0),(U=h)^(h=p>>>0>A>>>0?t+1|0:t),16),t=g+(Z=b)|0,S=we(Y^(g=z=_+U|0),(_=_>>>0>g>>>0?t+1|0:t)^S,63),z=b,Q=x,t=d+C|0,C=p=x+L|0,t=(t=p>>>0<x>>>0?t+1|0:t)+(ge=a[n+204>>2])|0,B=we((p=x=p+a[n+200>>2]|0)^B,(x=C>>>0>p>>>0?t+1|0:t)^E,32),t=j+(C=b)|0,t=w>>>0>(E=w+B|0)>>>0?t+1|0:t,w=E,E=d,d=t,E=we(Q^w,E^t,24),L=t=b,j=t,Q=E,t=x+fe|0,t=(t=(E=p+W|0)>>>0<W>>>0?t+1|0:t)+j|0,B=we((p=W=Q+(x=E)|0)^B,(E=C)^(C=x>>>0>p>>>0?t+1|0:t),16),t=d+(j=b)|0,W=we(Q^(d=W=w+B|0),(w=w>>>0>d>>>0?t+1|0:t)^L,63),x=b,Q=M,t=k+V|0,t=(t=(E=D+M|0)>>>0<D>>>0?t+1|0:t)+(L=a[n+236>>2])|0,O=we((M=D=E+a[n+232>>2]|0)^ee,(D=D>>>0<E>>>0?t+1|0:t)^O,32),t=m+(k=b)|0,t=I>>>0>(E=I+O|0)>>>0?t+1|0:t,I=E,E=V,V=t,m=we(Q^I,E^t,24),E=t=b,L=m,t=D+s|0,t=(t=(m=M+H|0)>>>0<H>>>0?t+1|0:t)+E|0,t=m>>>0>(H=L+m|0)>>>0?t+1|0:t,m=k,k=t,O=we((D=H)^O,m^t,16),t=V+(M=b)|0,m=E,E=t=I>>>0>(H=I+O|0)>>>0?t+1|0:t,H=we(L^(I=H),m^t,63),V=b,t=F+r|0,t=(t=(m=u+K|0)>>>0<K>>>0?t+1|0:t)+z|0,t=m>>>0>(K=m+S|0)>>>0?t+1|0:t,F=K,m=G+K|0,K=t,t=c+t|0,G=(u=m)>>>0<G>>>0?t+1|0:t,m=S,S=we(O^F,M^K,32),t=w+(F=b)|0,z=(d=O=we(m^(w=K=d+S|0),(K=d>>>0>w>>>0?t+1|0:t)^z,24))+u|0,t=(u=b)+G|0,t=d>>>0>z>>>0?t+1|0:t,d=z,a[n>>2]=d,a[n+4>>2]=t,z=t,t=we(d^S,t^F,16),m=G=b,a[n+120>>2]=t,a[n+124>>2]=m,G=t,w=t+w|0,t=m+K|0,a[n+80>>2]=w,t=w>>>0<G>>>0?t+1|0:t,a[n+84>>2]=t,ye=n,ve=we(O^w,t^u,63),a[ye+40>>2]=ve,a[n+44>>2]=b,u=W,t=h+x|0,t=(K=A+W|0)>>>0<W>>>0?t+1|0:t,W=K,t=t+(G=a[n+132>>2])|0,W=t=(K=K+a[n+128>>2]|0)>>>0<W>>>0?t+1|0:t,h=we(K^R,t^T,32),t=E+(w=b)|0,t=I>>>0>(G=I+h|0)>>>0?t+1|0:t,I=G,G=t,E=we(u^I,t^x,24),t=W+(m=b)|0,t=(x=E+K|0)>>>0<K>>>0?t+1|0:t,K=(W=a[n+144>>2])+x|0,t=a[n+148>>2]+t|0,t=K>>>0<W>>>0?t+1|0:t,a[n+8>>2]=K,a[n+12>>2]=t,t=we(h^K,t^w,16),x=K=b,a[n+96>>2]=t,a[n+100>>2]=x,K=t,W=t+I|0,t=x+G|0,t=K>>>0>W>>>0?t+1|0:t,K=W,a[n+88>>2]=K,a[n+92>>2]=t,ye=n,ve=we(E^K,t^m,63),a[ye+48>>2]=ve,a[n+52>>2]=b,u=J,t=C+V|0,J=K=p+H|0,t=(t=K>>>0<H>>>0?t+1|0:t)+(W=a[n+220>>2])|0,G=K=K+a[n+216>>2]|0,W=u+K|0,K=t=K>>>0<J>>>0?t+1|0:t,t=t+le|0,W=(x=W)>>>0<G>>>0?t+1|0:t,u=x,G=we(U^G,K^Z,32),t=N+(x=b)|0,V=we((h=K=f+G|0)^H,(K=f>>>0>h>>>0?t+1|0:t)^V,24),t=(w=b)+W|0,t=V>>>0>(H=u+V|0)>>>0?t+1|0:t,a[n+16>>2]=H,a[n+20>>2]=t,t=we(H^G,t^x,16),J=H=b,a[n+104>>2]=t,a[n+108>>2]=H,H=t,W=t+h|0,t=K+J|0,K=W,a[n+64>>2]=K,t=H>>>0>K>>>0?t+1|0:t,a[n+68>>2]=t,ye=n,ve=we(V^K,t^w,63),a[ye+56>>2]=ve,a[n+60>>2]=b,t=v+i|0,t=(t=(K=P+te|0)>>>0<P>>>0?t+1|0:t)+k|0,H=t=D>>>0>(K=D+K|0)>>>0?t+1|0:t,G=we(K^B,t^j,32),t=_+(V=b)|0,te=t=g>>>0>(W=g+G|0)>>>0?t+1|0:t,x=we(W^P,t^v,24),t=H+(h=b)|0,t=K>>>0>(J=K+x|0)>>>0?t+1|0:t,K=(H=a[n+152>>2])+J|0,t=a[n+156>>2]+t|0,t=K>>>0<H>>>0?t+1|0:t,a[n+24>>2]=K,a[n+28>>2]=t,t=we(K^G,t^V,16),a[n+112>>2]=t,H=b,a[n+116>>2]=H,K=t+W|0,t=H+te|0,t=K>>>0<W>>>0?t+1|0:t,a[n+72>>2]=K,a[n+76>>2]=t,ye=n,ve=we(x^K,t^h,63),a[ye+32>>2]=ve,a[n+36>>2]=b,t=a[n+68>>2]^(l[e+4|0]|l[e+5|0]<<8|l[e+6|0]<<16|l[e+7|0]<<24)^z,K=a[n+64>>2]^(l[0|e]|l[e+1|0]<<8|l[e+2|0]<<16|l[e+3|0]<<24)^d,o[0|e]=K,o[e+1|0]=K>>>8,o[e+2|0]=K>>>16,o[e+3|0]=K>>>24,o[e+4|0]=t,o[e+5|0]=t>>>8,o[e+6|0]=t>>>16,o[e+7|0]=t>>>24,H=1;t=(K=H<<3)+e|0,z=a[(K=n+K|0)>>2]^(l[0|t]|l[t+1|0]<<8|l[t+2|0]<<16|l[t+3|0]<<24),te=a[(W=K- -64|0)>>2],K=a[W+4>>2]^a[K+4>>2]^(l[t+4|0]|l[t+5|0]<<8|l[t+6|0]<<16|l[t+7|0]<<24),z^=te,o[0|t]=z,o[t+1|0]=z>>>8,o[t+2|0]=z>>>16,o[t+3|0]=z>>>24,o[t+4|0]=K,o[t+5|0]=K>>>8,o[t+6|0]=K>>>16,o[t+7|0]=K>>>24,8!=(0|(H=H+1|0)););y=n+256|0}function S(e,t,n,r,i,s,c){var u,d,h,p,f,g,m,v,A,w,S,C,I,_,x,P,k,B,O,N,D,j,T,M,F,R,L,Q,U,V,K,H,G,Y,z,W,q,J,X,$,ee,te=0,ne=0,ie=0,oe=0,se=0,ae=0,le=0,ce=0,ue=0,de=0,he=0,pe=0,fe=0,ge=0,me=0,ye=0,ve=0,Ae=0,be=0,we=0,Se=0,Ce=0,Ee=0,Ie=0,_e=0,xe=0,Pe=0,ke=0,Be=0,Oe=0,Ne=0,De=0,Te=0,Me=0,Fe=0,Re=0,Le=0,Qe=0,Ue=0,Ve=0,Ke=0,He=0,Ge=0,Ye=0,Ze=0,We=0,qe=0,Je=0,Xe=0,$e=0,et=0,nt=0,rt=0;return y=R=y-560|0,qt(ue=R+352|0,c),It(L=R+288|0,s,32,0),Z(ue,R+320|0,32,0),Z(ue,n,r,i),je(ue,u=R+224|0),te=l[s+32|0]|l[s+33|0]<<8|l[s+34|0]<<16|l[s+35|0]<<24,oe=l[s+36|0]|l[s+37|0]<<8|l[s+38|0]<<16|l[s+39|0]<<24,le=l[s+40|0]|l[s+41|0]<<8|l[s+42|0]<<16|l[s+43|0]<<24,ne=l[s+44|0]|l[s+45|0]<<8|l[s+46|0]<<16|l[s+47|0]<<24,se=l[s+48|0]|l[s+49|0]<<8|l[s+50|0]<<16|l[s+51|0]<<24,ae=l[s+52|0]|l[s+53|0]<<8|l[s+54|0]<<16|l[s+55|0]<<24,de=l[s+60|0]|l[s+61|0]<<8|l[s+62|0]<<16|l[s+63|0]<<24,s=l[s+56|0]|l[s+57|0]<<8|l[s+58|0]<<16|l[s+59|0]<<24,o[e+56|0]=s,o[e+57|0]=s>>>8,o[e+58|0]=s>>>16,o[e+59|0]=s>>>24,o[e+60|0]=de,o[e+61|0]=de>>>8,o[e+62|0]=de>>>16,o[e+63|0]=de>>>24,s=se,o[e+48|0]=s,o[e+49|0]=s>>>8,o[e+50|0]=s>>>16,o[e+51|0]=s>>>24,s=ae,o[e+52|0]=s,o[e+53|0]=s>>>8,o[e+54|0]=s>>>16,o[e+55|0]=s>>>24,s=le,o[e+40|0]=s,o[e+41|0]=s>>>8,o[e+42|0]=s>>>16,o[e+43|0]=s>>>24,s=ne,o[e+44|0]=s,o[e+45|0]=s>>>8,o[e+46|0]=s>>>16,o[e+47|0]=s>>>24,o[0|(s=e+32|0)]=te,o[s+1|0]=te>>>8,o[s+2|0]=te>>>16,o[s+3|0]=te>>>24,te=oe,o[s+4|0]=te,o[s+5|0]=te>>>8,o[s+6|0]=te>>>16,o[s+7|0]=te>>>24,E(u),re(R,u),tt(e,R),qt(ue,c),Z(ue,e,64,0),Z(ue,n,r,i),je(ue,e=R+160|0),E(e),o[0|L]=248&l[0|L],o[L+31|0]=63&l[L+31|0]|64,Ge=St(e),le=l[e+2|0]|l[e+3|0]<<8|l[e+4|0]<<16|l[e+5|0]<<24,Be=St(e+5|0),se=b,ne=l[e+7|0]|l[e+8|0]<<8|l[e+9|0]<<16|l[e+10|0]<<24,ue=l[e+10|0]|l[e+11|0]<<8|l[e+12|0]<<16|l[e+13|0]<<24,Ve=St(e+13|0),de=b,ce=l[e+15|0]|l[e+16|0]<<8|l[e+17|0]<<16|l[e+18|0]<<24,Oe=St(e+18|0),ge=b,Fe=St(e+21|0),r=l[e+23|0]|l[e+24|0]<<8|l[e+25|0]<<16|l[e+26|0]<<24,ae=St(e+26|0),n=b,i=l[e+28|0]|l[e+29|0]<<8|l[e+30|0]<<16|l[e+31|0]<<24,Ke=St(L),Se=l[(e=L)+2|0]|l[e+3|0]<<8|l[e+4|0]<<16|l[e+5|0]<<24,Re=St(e+5|0),_e=b,fe=l[e+7|0]|l[e+8|0]<<8|l[e+9|0]<<16|l[e+10|0]<<24,he=l[e+10|0]|l[e+11|0]<<8|l[e+12|0]<<16|l[e+13|0]<<24,We=St(e+13|0),Ce=b,ye=l[e+15|0]|l[e+16|0]<<8|l[e+17|0]<<16|l[e+18|0]<<24,Ye=St(e+18|0),be=b,Le=St(e+21|0),c=l[e+23|0]|l[e+24|0]<<8|l[e+25|0]<<16|l[e+26|0]<<24,pe=St(e+26|0),te=b,oe=l[e+28|0]|l[e+29|0]<<8|l[e+30|0]<<16|l[e+31|0]<<24,q=St(u),J=l[(e=u)+2|0]|l[e+3|0]<<8|l[e+4|0]<<16|l[e+5|0]<<24,X=St(e+5|0),$=b,ee=l[e+7|0]|l[e+8|0]<<8|l[e+9|0]<<16|l[e+10|0]<<24,Te=l[e+10|0]|l[e+11|0]<<8|l[e+12|0]<<16|l[e+13|0]<<24,$e=St(e+13|0),xe=b,Ae=l[e+15|0]|l[e+16|0]<<8|l[e+17|0]<<16|l[e+18|0]<<24,et=St(e+18|0),me=b,Qe=St(e+21|0),e=ze(d=oe>>>7|0,0,h=2097151&((3&(e=n))<<30|(n=ae)>>>2),0),n=b,oe=e,i=ze(p=2097151&((3&(e=te))<<30|(te=pe)>>>2),0,f=i>>>7|0,0),n=b+n|0,oe=e=oe+i|0,te=e>>>0<i>>>0?n+1|0:n,e=ze(h,ie,p,ie),i=b,n=(c=ze(g=c>>>5&2097151,0,f,0))+e|0,e=b+i|0,e=n>>>0<c>>>0?e+1|0:e,i=ze(d,0,m=r>>>5&2097151,0),r=b+e|0,r=(n=i+n|0)>>>0<i>>>0?r+1|0:r,i=n,Ne=r,ve=e=r-((n>>>0<4293918720)-1|0)|0,c=(2097151&e)<<11|(ae=n- -1048576|0)>>>21,e=(e>>21)+te|0,e=(r=c+oe|0)>>>0<c>>>0?e+1|0:e,c=r,Pe=e,De=te=e-((r>>>0<4293918720)-1|0)|0,n=te>>21,ke=(e=ze(d,0,f,0))-(Ee=-2097152&(we=e- -1048576|0))|0,e=((pe=b)-((e>>>0<Ee>>>0)+(r=pe-((e>>>0<4293918720)-1|0)|0)|0)|0)+n|0,G=te=ke+((2097151&te)<<11|(oe=c- -1048576|0)>>>21)|0,pe=e=te>>>0<ke>>>0?e+1|0:e,n=ze(te,e,-683901,-1),te=b,Q=(2097151&r)<<11|we>>>21,we=e=r>>21,e=(r=ze(Q,e,136657,0))+n|0,n=b+te|0,ke=e,Ee=e>>>0<r>>>0?n+1|0:n,e=ze(v=2097151&((1&(e=Ce))<<31|We>>>1),0,h,ie),n=b,te=ze(A=he>>>4&2097151,0,f,0),r=b+n|0,r=(e=te+e|0)>>>0<te>>>0?r+1|0:r,te=ze(w=ye>>>6&2097151,0,m,0),n=b+r|0,n=(e=te+e|0)>>>0<te>>>0?n+1|0:n,Ce=e,te=ze(S=2097151&Le,r=0,C=2097151&((7&(e=ge))<<29|Oe>>>3),0),e=b+n|0,n=e=(r=Ce+te|0)>>>0<te>>>0?e+1|0:e,e=(te=ze(I=2097151&((7&(e=be))<<29|Ye>>>3),0,_=2097151&Fe,0))+r|0,r=b+n|0,r=e>>>0<te>>>0?r+1|0:r,te=ze(g,0,x=ce>>>6&2097151,0),n=b+r|0,n=(e=te+e|0)>>>0<te>>>0?n+1|0:n,r=e,te=ze(p,ie,P=2097151&((1&(e=de))<<31|Ve>>>1),0),e=b+n|0,e=(r=r+te|0)>>>0<te>>>0?e+1|0:e,n=(te=ze(d,0,k=ue>>>4&2097151,0))+r|0,r=b+e|0,ge=n,ue=n>>>0<te>>>0?r+1|0:r,e=ze(h,ie,A,0),n=b,r=ze(B=fe>>>7&2097151,0,f,0),n=b+n|0,n=(e=r+e|0)>>>0<r>>>0?n+1|0:n,r=(te=ze(m,0,v,ie))+e|0,e=b+n|0,e=r>>>0<te>>>0?e+1|0:e,n=(te=ze(w,0,_,ie))+r|0,r=b+e|0,r=n>>>0<te>>>0?r+1|0:r,e=(te=ze(S,ie,x,0))+n|0,n=b+r|0,n=e>>>0<te>>>0?n+1|0:n,r=(te=ze(C,ie,I,ie))+e|0,e=b+n|0,e=r>>>0<te>>>0?e+1|0:e,te=ze(g,0,P,ie),n=b+e|0,n=(r=te+r|0)>>>0<te>>>0?n+1|0:n,te=ze(p,ie,k,0),e=b+n|0,e=(r=te+r|0)>>>0<te>>>0?e+1|0:e,n=(te=ze(d,0,O=ne>>>7&2097151,0))+r|0,r=b+e|0,r=n>>>0<te>>>0?r+1|0:r,te=n,de=r,e=r-((n>>>0<4293918720)-1|0)|0,r=n- -1048576|0,ce=e,n=ge,ge=(2097151&e)<<11|r>>>21,e=(e>>21)+ue|0,e=(ne=(n=ne=n+ge|0)>>>0<ge>>>0?e+1|0:e)+Ee|0,e=n>>>0>(ue=n+ke|0)>>>0?e+1|0:e,ne=ne-((n>>>0<4293918720)-1|0)|0,he=ue-(n=-2097152&(fe=n- -1048576|0))|0,ue=e-((n>>>0>ue>>>0)+ne|0)|0,ge=Pe-(((e=-2097152&oe)>>>0>c>>>0)+De|0)|0,U=c-e|0,c=ze(Q,we,-997805,-1),n=b+de|0,n=(e=c+te|0)>>>0<c>>>0?n+1|0:n,c=(te=ze(G,pe,136657,0))+e|0,e=b+n|0,e=c>>>0<te>>>0?e+1|0:e,n=c,c=ze(U,ge,-683901,-1),e=b+e|0,oe=(n=n+c|0)-(r&=-2097152)|0,de=(e=n>>>0<c>>>0?e+1|0:e)-((n>>>0<r>>>0)+ce|0)|0,e=ze(h,ie,B,0),r=b,n=e,c=ze(N=2097151&((3&(e=_e))<<30|Re>>>2),0,f,0),e=b+r|0,e=(n=n+c|0)>>>0<c>>>0?e+1|0:e,c=ze(m,0,A,0),r=b+e|0,r=(n=c+n|0)>>>0<c>>>0?r+1|0:r,e=(c=ze(v,ie,_,ie))+n|0,n=b+r|0,n=e>>>0<c>>>0?n+1|0:n,r=(c=ze(w,0,C,ie))+e|0,e=b+n|0,e=r>>>0<c>>>0?e+1|0:e,c=ze(S,ie,P,ie),n=b+e|0,n=(r=c+r|0)>>>0<c>>>0?n+1|0:n,c=ze(I,ie,x,0),e=b+n|0,e=(r=c+r|0)>>>0<c>>>0?e+1|0:e,n=(c=ze(g,0,k,0))+r|0,r=b+e|0,r=n>>>0<c>>>0?r+1|0:r,e=(c=ze(p,ie,O,0))+n|0,n=b+r|0,n=e>>>0<c>>>0?n+1|0:n,r=e,c=ze(d,0,D=2097151&((3&(e=se))<<30|Be>>>2),0),e=b+n|0,se=r=r+c|0,te=r>>>0<c>>>0?e+1|0:e,e=ze(h,ie,N,0),n=b,r=ze(j=Se>>>5&2097151,0,f,0),n=b+n|0,n=(e=r+e|0)>>>0<r>>>0?n+1|0:n,r=ze(m,0,B,0),n=b+n|0,n=(e=r+e|0)>>>0<r>>>0?n+1|0:n,r=(c=ze(A,0,_,ie))+e|0,e=b+n|0,e=r>>>0<c>>>0?e+1|0:e,n=r,r=ze(v,ie,C,ie),e=b+e|0,e=(n=n+r|0)>>>0<r>>>0?e+1|0:e,c=ze(w,0,x,0),r=b+e|0,r=(n=c+n|0)>>>0<c>>>0?r+1|0:r,e=(c=ze(S,ie,k,0))+n|0,n=b+r|0,n=e>>>0<c>>>0?n+1|0:n,r=ze(I,ie,P,ie),n=b+n|0,n=(e=r+e|0)>>>0<r>>>0?n+1|0:n,r=(c=ze(g,0,O,0))+e|0,e=b+n|0,e=r>>>0<c>>>0?e+1|0:e,n=r,r=ze(p,ie,D,0),e=b+e|0,e=(n=n+r|0)>>>0<r>>>0?e+1|0:e,c=ze(d,0,T=le>>>5&2097151,0),r=b+e|0,r=(n=c+n|0)>>>0<c>>>0?r+1|0:r,c=n,Be=r,Ve=n=r-((n>>>0<4293918720)-1|0)|0,e=(e=n>>21)+te|0,te=n=(r=(2097151&n)<<11|(be=c- -1048576|0)>>>21)+se|0,Oe=e=n>>>0<r>>>0?e+1|0:e,Fe=n=e-((n>>>0<4293918720)-1|0)|0,e=n>>21,n=(r=oe)+(oe=(2097151&n)<<11|(Pe=te- -1048576|0)>>>21)|0,r=e+de|0,r=n>>>0<oe>>>0?r+1|0:r,oe=n,Re=r,We=n=r-((n>>>0<4293918720)-1|0)|0,e=(e=n>>21)+ue|0,le=n=(r=(2097151&n)<<11|(De=oe- -1048576|0)>>>21)+he|0,Ee=e=n>>>0<r>>>0?e+1|0:e,Ye=n=e-((n>>>0<4293918720)-1|0)|0,Se=(2097151&n)<<11|(ce=le- -1048576|0)>>>21,ue=n>>21,e=ze(h,ie,w,0),n=b,se=ze(f,0,v,ie),r=b+n|0,r=(e=se+e|0)>>>0<se>>>0?r+1|0:r,se=ze(S,ie,_,ie),n=b+r|0,n=(e=se+e|0)>>>0<se>>>0?n+1|0:n,r=(se=ze(m,0,I,ie))+e|0,e=b+n|0,e=r>>>0<se>>>0?e+1|0:e,se=ze(g,0,C,ie),n=b+e|0,n=(r=se+r|0)>>>0<se>>>0?n+1|0:n,se=ze(p,ie,x,0),e=b+n|0,e=(r=se+r|0)>>>0<se>>>0?e+1|0:e,n=(se=ze(d,0,P,ie))+r|0,r=b+e|0,r=n>>>0<se>>>0?r+1|0:r,e=n,de=ze(Q,we,-683901,-1),n=b+r|0,n=(se=e+de|0)>>>0<de>>>0?n+1|0:n,de=se,se=r-((e>>>0<4293918720)-1|0)|0,r=de-(e=-2097152&(_e=e- -1048576|0))|0,de=n-((e>>>0>de>>>0)+se|0)|0,n=(e=r)+(r=(2097151&ne)<<11|fe>>>21)|0,e=(ne>>21)+de|0,e=n>>>0<r>>>0?e+1|0:e,r=Se,fe=n-(Se=-2097152&(de=n- -1048576|0))|0,n=(e-((ne=e-((n>>>0<4293918720)-1|0)|0)+(n>>>0<Se>>>0)|0)|0)+ue|0,Y=r=r+fe|0,Se=n=r>>>0<fe>>>0?n+1|0:n,ue=ze(r,n,-683901,-1),fe=b,e=ze(m,0,S,ie),r=b,n=(he=ze(f,0,w,0))+e|0,e=b+r|0,e=n>>>0<he>>>0?e+1|0:e,r=(he=ze(h,ie,I,ie))+n|0,n=b+e|0,n=r>>>0<he>>>0?n+1|0:n,he=ze(g,0,_,ie),e=b+n|0,e=(r=he+r|0)>>>0<he>>>0?e+1|0:e,n=(he=ze(p,ie,C,ie))+r|0,r=b+e|0,r=n>>>0<he>>>0?r+1|0:r,e=(he=ze(d,0,x,0))+n|0,n=b+r|0,n=e>>>0<he>>>0?n+1|0:n,r=e,e=(e=se>>21)+n|0,Ce=r=(e=(n=r=r+(se=(2097151&se)<<11|_e>>>21)|0)>>>0<se>>>0?e+1|0:e)-((n>>>0<4293918720)-1|0)|0,_e=n-(se=-2097152&(ke=n- -1048576|0))|0,r=e-((n>>>0<se>>>0)+r|0)|0,n=(n=(e=ne)>>21)+r|0,z=e=(ne=(2097151&e)<<11|(ne=de)>>>21)+_e|0,_e=n=e>>>0<ne>>>0?n+1|0:n,r=ze(e,n,136657,0),e=b+fe|0,nt=n=r+ue|0,Le=n>>>0<r>>>0?e+1|0:e,e=ze(_,ie,j,0),r=b,n=(ne=ze(M=2097151&Ke,0,m,0))+e|0,e=b+r|0,e=n>>>0<ne>>>0?e+1|0:e,ne=ze(C,ie,N,0),r=b+e|0,r=(n=ne+n|0)>>>0<ne>>>0?r+1|0:r,e=(ne=ze(x,0,B,0))+n|0,n=b+r|0,n=e>>>0<ne>>>0?n+1|0:n,r=(ne=ze(A,0,P,ie))+e|0,e=b+n|0,e=r>>>0<ne>>>0?e+1|0:e,ne=ze(v,ie,k,0),n=b+e|0,n=(r=ne+r|0)>>>0<ne>>>0?n+1|0:n,ne=ze(w,0,O,0),e=b+n|0,e=(r=ne+r|0)>>>0<ne>>>0?e+1|0:e,n=(ne=ze(S,ie,T,0))+r|0,r=b+e|0,r=n>>>0<ne>>>0?r+1|0:r,e=(ne=ze(I,ie,D,0))+n|0,n=b+r|0,n=e>>>0<ne>>>0?n+1|0:n,r=(ne=ze(g,0,F=2097151&Ge,0))+e|0,e=b+n|0,e=r>>>0<ne>>>0?e+1|0:e,ue=r=(ne=(l[u+23|0]|l[u+24|0]<<8|l[u+25|0]<<16|l[u+26|0]<<24)>>>5&2097151)+r|0,se=r>>>0<ne>>>0?e+1|0:e,e=ze(C,ie,j,0),n=b,ne=ze(_,ie,M,0),r=b+n|0,r=(e=ne+e|0)>>>0<ne>>>0?r+1|0:r,ne=ze(x,0,N,0),n=b+r|0,n=(e=ne+e|0)>>>0<ne>>>0?n+1|0:n,r=(ne=ze(P,ie,B,0))+e|0,e=b+n|0,e=r>>>0<ne>>>0?e+1|0:e,n=r,r=ze(A,0,k,0),e=b+e|0,e=(n=n+r|0)>>>0<r>>>0?e+1|0:e,r=(ne=ze(v,ie,O,0))+n|0,n=b+e|0,n=r>>>0<ne>>>0?n+1|0:n,e=(ne=ze(w,0,D,0))+r|0,r=b+n|0,r=e>>>0<ne>>>0?r+1|0:r,ne=ze(F,0,S,ie),n=b+r|0,n=(e=ne+e|0)>>>0<ne>>>0?n+1|0:n,r=(ne=ze(I,ie,T,0))+e|0,e=b+n|0,e=r>>>0<ne>>>0?e+1|0:e,ne=n=(n=r)+(r=2097151&Qe)|0,ye=e=n>>>0<r>>>0?e+1|0:e,Ge=e=e-((n>>>0<4293918720)-1|0)|0,de=n- -1048576|0,n=(r=e>>>21|0)+se|0,se=e=(he=ue)+(ue=(2097151&e)<<11|de>>>21)|0,Ke=e>>>0<ue>>>0?n+1|0:n,fe=i-(e=-2097152&ae)|0,qe=Ne-((e>>>0>i>>>0)+ve|0)|0,e=ze(h,ie,g,0),r=b,n=(i=ze(f,0,S,ie))+e|0,e=b+r|0,e=n>>>0<i>>>0?e+1|0:e,i=ze(p,ie,m,0),r=b+e|0,r=(n=i+n|0)>>>0<i>>>0?r+1|0:r,e=(i=ze(d,0,_,ie))+n|0,n=b+r|0,he=e,ae=e>>>0<i>>>0?n+1|0:n,e=ze(f,0,I,ie),n=b,r=ze(h,ie,S,ie),n=b+n|0,n=(e=r+e|0)>>>0<r>>>0?n+1|0:n,r=(i=ze(g,0,m,0))+e|0,e=b+n|0,e=r>>>0<i>>>0?e+1|0:e,n=r,r=ze(p,ie,_,ie),e=b+e|0,e=(n=n+r|0)>>>0<r>>>0?e+1|0:e,i=ze(d,0,C,ie),r=b+e|0,r=(n=i+n|0)>>>0<i>>>0?r+1|0:r,i=n,Ne=r,ve=n=r-((n>>>0<4293918720)-1|0)|0,e=he,he=(2097151&n)<<11|(ue=i- -1048576|0)>>>21,n=(n>>21)+ae|0,ae=r=e+he|0,Qe=n=r>>>0<he>>>0?n+1|0:n,he=r- -1048576|0,r=(e=(n=n-((r>>>0<4293918720)-1|0)|0)>>21)+qe|0,V=fe=(Xe=(2097151&n)<<11|he>>>21)+fe|0,fe=r=fe>>>0<Xe>>>0?r+1|0:r,e=ze(V,r,470296,0),r=b,he=Qe-((Me=n)+((n=-2097152&he)>>>0>ae>>>0)|0)|0,K=ae-n|0,ae=ze(U,ge,666643,0),n=b+r|0,n=(e=ae+e|0)>>>0<ae>>>0?n+1|0:n,r=(ae=ze(K,he,654183,0))+e|0,e=b+n|0,e=r>>>0<ae>>>0?e+1|0:e,ae=r,r=e,ue=Ne-(((e=-2097152&ue)>>>0>i>>>0)+ve|0)|0,i=n=i-e|0,Ce=(2097151&(n=Ce))<<11|ke>>>21,n=(e=n>>21)+ue|0,W=i=i+Ce|0,Ce=n=i>>>0<Ce>>>0?n+1|0:n,ue=Ke-(((e=se)>>>0<4293918720)-1|0)|0,He=e- -1048576|0,i=ze(i,n,-997805,-1),n=b+r|0,n=(e=i+ae|0)>>>0<i>>>0?n+1|0:n,i=e,r=se+e|0,e=n+Ke|0,e=r>>>0<i>>>0?e+1|0:e,ke=(n=r)-(r=-2097152&He)|0,qe=e-((n>>>0<r>>>0)+ue|0)|0,e=ze(K,he,470296,0),n=b,r=ze(V,fe,666643,0),n=b+n|0,n=(e=r+e|0)>>>0<r>>>0?n+1|0:n,r=(i=ze(W,Ce,654183,0))+e|0,e=b+n|0,n=r+ne|0,r=ye+(r>>>0<i>>>0?e+1|0:e)|0,r=n>>>0<ne>>>0?r+1|0:r,de=(e=n)-(n=-2097152&de)|0,ye=r-((e>>>0<n>>>0)+Ge|0)|0,e=ze(x,0,j,0),r=b,n=(i=ze(C,ie,M,0))+e|0,e=b+r|0,e=n>>>0<i>>>0?e+1|0:e,r=ze(P,ie,N,0),e=b+e|0,e=(n=r+n|0)>>>0<r>>>0?e+1|0:e,i=ze(k,0,B,0),r=b+e|0,r=(n=i+n|0)>>>0<i>>>0?r+1|0:r,e=(i=ze(A,0,O,0))+n|0,n=b+r|0,n=e>>>0<i>>>0?n+1|0:n,r=ze(v,ie,D,0),n=b+n|0,n=(e=r+e|0)>>>0<r>>>0?n+1|0:n,r=(i=ze(w,0,T,0))+e|0,e=b+n|0,e=r>>>0<i>>>0?e+1|0:e,n=r,r=ze(F,0,I,ie),e=b+e|0,e=(n=n+r|0)>>>0<r>>>0?e+1|0:e,r=n,n=e,ae=e=(i=2097151&((7&(e=me))<<29|et>>>3))+r|0,i=e>>>0<i>>>0?n+1|0:n,e=ze(P,ie,j,0),n=b,r=ze(x,0,M,0),n=b+n|0,n=(e=r+e|0)>>>0<r>>>0?n+1|0:n,r=(ne=ze(k,0,N,0))+e|0,e=b+n|0,e=r>>>0<ne>>>0?e+1|0:e,ne=ze(B,0,O,0),n=b+e|0,n=(r=ne+r|0)>>>0<ne>>>0?n+1|0:n,ne=ze(A,0,D,0),e=b+n|0,e=(r=ne+r|0)>>>0<ne>>>0?e+1|0:e,n=(ne=ze(v,ie,T,0))+r|0,r=b+e|0,r=n>>>0<ne>>>0?r+1|0:r,e=(ne=ze(F,0,w,0))+n|0,n=b+r|0,r=e,e=e>>>0<ne>>>0?n+1|0:n,ne=n=(n=r)+(r=Ae>>>6&2097151)|0,me=e=n>>>0<r>>>0?e+1|0:e,Ne=e=e-((n>>>0<4293918720)-1|0)|0,se=n- -1048576|0,n=(r=e>>>21|0)+i|0,i=e=(ve=ae)+(ae=(2097151&e)<<11|se>>>21)|0,ve=n=e>>>0<ae>>>0?n+1|0:n,Ge=e=n-((e>>>0<4293918720)-1|0)|0,n=de,de=(2097151&e)<<11|(ae=i- -1048576|0)>>>21,e=(e>>>21|0)+ye|0,ye=n=n+de|0,Ke=e=n>>>0<de>>>0?e+1|0:e,Qe=e=e-((n>>>0<4293918720)-1|0)|0,Ae=n- -1048576|0,n=(r=e>>21)+qe|0,n=(e=(de=(2097151&e)<<11|Ae>>>21)+ke|0)>>>0<de>>>0?n+1|0:n,r=e,de=e+nt|0,e=n+Le|0,e=r>>>0>de>>>0?e+1|0:e,Le=de,de=n-((r>>>0<4293918720)-1|0)|0,Je=Le-(n=-2097152&(Ze=r- -1048576|0))|0,Ue=e-((n>>>0>Le>>>0)+de|0)|0,n=ze(z,_e,-997805,-1),r=b+Ke|0,Me=e=n+ye|0,Le=e>>>0<n>>>0?r+1|0:r,e=ze(W,Ce,470296,0),r=b,n=(ye=ze(K,he,666643,0))+e|0,e=b+r|0,e=(e=n>>>0<ye>>>0?e+1|0:e)+ve|0,ye=(n=n+i|0)-(r=-2097152&ae)|0,ve=(e=n>>>0<i>>>0?e+1|0:e)-((n>>>0<r>>>0)+Ge|0)|0,r=ze(W,Ce,666643,0),n=b+me|0,me=e=r+ne|0,ae=e>>>0<r>>>0?n+1|0:n,e=ze(k,0,j,0),r=b,n=(i=ze(P,ie,M,0))+e|0,e=b+r|0,e=n>>>0<i>>>0?e+1|0:e,r=ze(O,0,N,0),e=b+e|0,e=(n=r+n|0)>>>0<r>>>0?e+1|0:e,i=ze(B,0,D,0),r=b+e|0,r=(n=i+n|0)>>>0<i>>>0?r+1|0:r,e=(i=ze(A,0,T,0))+n|0,n=b+r|0,n=e>>>0<i>>>0?n+1|0:n,r=ze(F,0,v,ie),n=b+n|0,n=(e=r+e|0)>>>0<r>>>0?n+1|0:n,r=e,i=2097151&((1&(e=xe))<<31|$e>>>1),e=n,xe=r=r+i|0,ne=r>>>0<i>>>0?e+1|0:e,e=ze(O,0,j,0),r=b,n=(i=ze(k,0,M,0))+e|0,e=b+r|0,e=n>>>0<i>>>0?e+1|0:e,r=(i=ze(N,0,D,0))+n|0,n=b+e|0,n=r>>>0<i>>>0?n+1|0:n,e=(i=ze(B,0,T,0))+r|0,r=b+n|0,r=e>>>0<i>>>0?r+1|0:r,i=ze(F,0,A,0),n=b+r|0,r=e=i+e|0,e=e>>>0<i>>>0?n+1|0:n,i=n=(n=r)+(r=Te>>>4&2097151)|0,Ge=e=n>>>0<r>>>0?e+1|0:e,Ke=e=e-((n>>>0<4293918720)-1|0)|0,Te=n- -1048576|0,n=(r=e>>>21|0)+ne|0,ne=e=(ke=xe)+(xe=(2097151&e)<<11|Te>>>21)|0,ke=n=e>>>0<xe>>>0?n+1|0:n,$e=e=n-((e>>>0<4293918720)-1|0)|0,n=me,me=(2097151&e)<<11|(xe=ne- -1048576|0)>>>21,e=(e>>>21|0)+ae|0,et=e=(e=(n=n+me|0)>>>0<me>>>0?e+1|0:e)-(((r=-2097152&se)>>>0>n>>>0)+Ne|0)|0,nt=e=e-(((se=n-r|0)>>>0<4293918720)-1|0)|0,r=(n=e>>21)+ve|0,Ne=e=(ae=(2097151&e)<<11|(me=se- -1048576|0)>>>21)+ye|0,qe=r=e>>>0<ae>>>0?r+1|0:r,Xe=e=r-((e>>>0<4293918720)-1|0)|0,ye=Ee-(((n=-2097152&ce)>>>0>le>>>0)+Ye|0)|0,H=le-n|0,le=(2097151&e)<<11|(ve=Ne- -1048576|0)>>>21,e=(e>>21)+Le|0,e=(r=le+Me|0)>>>0<le>>>0?e+1|0:e,n=(ae=ze(Y,Se,136657,0))+(r-(le=-2097152&Ae)|0)|0,r=b+(e-((r>>>0<le>>>0)+Qe|0)|0)|0,r=n>>>0<ae>>>0?r+1|0:r,le=ze(H,ye,-683901,-1),e=b+r|0,e=(n=le+n|0)>>>0<le>>>0?e+1|0:e,le=n,Ye=e,Le=e=e-((n>>>0<4293918720)-1|0)|0,r=(n=e>>21)+Ue|0,r=(e=(ae=(2097151&e)<<11|(Ae=le- -1048576|0)>>>21)+Je|0)>>>0<ae>>>0?r+1|0:r,ae=e,Qe=r,Je=e=r-((e>>>0<4293918720)-1|0)|0,rt=(2097151&e)<<11|(Ee=ae- -1048576|0)>>>21,Ue=e>>21,e=ze(m,0,j,0),r=b,n=(ce=ze(h,ie,M,0))+e|0,e=b+r|0,e=n>>>0<ce>>>0?e+1|0:e,r=(ce=ze(_,ie,N,0))+n|0,n=b+e|0,n=r>>>0<ce>>>0?n+1|0:n,e=(ce=ze(C,ie,B,0))+r|0,r=b+n|0,r=e>>>0<ce>>>0?r+1|0:r,n=(ce=ze(A,0,x,0))+e|0,e=b+r|0,e=n>>>0<ce>>>0?e+1|0:e,r=(ce=ze(v,ie,P,ie))+n|0,n=b+e|0,n=r>>>0<ce>>>0?n+1|0:n,ce=ze(w,0,k,0),e=b+n|0,e=(r=ce+r|0)>>>0<ce>>>0?e+1|0:e,ce=ze(S,ie,D,0),n=b+e|0,n=(r=ce+r|0)>>>0<ce>>>0?n+1|0:n,e=(ce=ze(I,ie,O,0))+r|0,r=b+n|0,r=e>>>0<ce>>>0?r+1|0:r,n=(ce=ze(g,0,T,0))+e|0,e=b+r|0,e=n>>>0<ce>>>0?e+1|0:e,r=(ce=ze(F,0,p,ie))+n|0,n=b+e|0,n=r>>>0<ce>>>0?n+1|0:n,Me=r,r=St(u+26|0),ce=2097151&((3&(e=b))<<30|r>>>2),e=n,e=(r=Me+ce|0)>>>0<ce>>>0?e+1|0:e,ce=r,Me=e,e=ze(U,ge,470296,0),n=b,r=ze(G,pe,666643,0),n=b+n|0,n=(e=r+e|0)>>>0<r>>>0?n+1|0:n,Ie=ze(V,fe,654183,0),r=b+n|0,r=(e=Ie+e|0)>>>0<Ie>>>0?r+1|0:r,Ie=ze(K,he,-997805,-1),n=b+r|0,n=(e=Ie+e|0)>>>0<Ie>>>0?n+1|0:n,r=(Ie=ze(W,Ce,136657,0))+e|0,e=b+n|0,e=(e=r>>>0<Ie>>>0?e+1|0:e)+Me|0,e=(n=r+ce|0)>>>0<r>>>0?e+1|0:e,r=n,ce=Me-(((n=ce)>>>0<4293918720)-1|0)|0,Me=n- -1048576|0,n=e+(n=ue>>>21|0)|0,n=(r=(ue=(2097151&ue)<<11|He>>>21)+r|0)>>>0<ue>>>0?n+1|0:n,r=(e=r)-(He=-2097152&Me)|0,Ie=ze(z,_e,-683901,-1),e=(n=n-((e>>>0<He>>>0)+ce|0)|0)+b|0,e=(ue=r+Ie|0)>>>0<Ie>>>0?e+1|0:e,Ie=ue,ue=n-((r>>>0<4293918720)-1|0)|0,He=r- -1048576|0,n=e+(n=de>>21)|0,n=(r=(de=(2097151&de)<<11|Ze>>>21)+Ie|0)>>>0<de>>>0?n+1|0:n,r=(e=r)-(Ze=-2097152&He)|0,e=(Ie=Ue)+(Ue=n-((e>>>0<Ze>>>0)+ue|0)|0)|0,e=r>>>0>(de=r+rt|0)>>>0?e+1|0:e,n=de,de=Ue-((r>>>0<4293918720)-1|0)|0,Ze=n-(r=-2097152&(Ue=r- -1048576|0))|0,rt=e-((n>>>0<r>>>0)+de|0)|0,Ie=ae-(e=-2097152&Ee)|0,Qe=Qe-((e>>>0>ae>>>0)+Je|0)|0,Je=le-(e=-2097152&Ae)|0,Ye=Ye-((e>>>0>le>>>0)+Le|0)|0,r=ze(z,_e,654183,0),e=b+qe|0,e=(n=r+Ne|0)>>>0<r>>>0?e+1|0:e,r=(ae=ze(Y,Se,-997805,-1))+(n-(le=-2097152&ve)|0)|0,n=b+(e-((n>>>0<le>>>0)+Xe|0)|0)|0,n=r>>>0<ae>>>0?n+1|0:n,le=ze(H,ye,136657,0),e=b+n|0,Ee=r=le+r|0,Ae=r>>>0<le>>>0?e+1|0:e,ae=oe-(e=-2097152&De)|0,Re=Re-((e>>>0>oe>>>0)+We|0)|0,e=ze(G,pe,-997805,-1),n=b,oe=ze(Q,we,654183,0),r=b+n|0,r=(e=oe+e|0)>>>0<oe>>>0?r+1|0:r,oe=ze(U,ge,136657,0),n=b+r|0,n=(e=oe+e|0)>>>0<oe>>>0?n+1|0:n,r=(oe=ze(V,fe,-683901,-1))+e|0,e=b+n|0,n=(e=r>>>0<oe>>>0?e+1|0:e)+Oe|0,n=(r=r+te|0)>>>0<te>>>0?n+1|0:n,oe=(e=r)-(r=-2097152&Pe)|0,Oe=n-((e>>>0<r>>>0)+Fe|0)|0,e=ze(G,pe,654183,0),n=b,te=ze(Q,we,470296,0),r=b+n|0,r=(e=te+e|0)>>>0<te>>>0?r+1|0:r,n=(te=ze(U,ge,-997805,-1))+e|0,e=b+r|0,r=n+c|0,n=Be+(n>>>0<te>>>0?e+1|0:e)|0,n=r>>>0<c>>>0?n+1|0:n,e=r,r=ze(V,fe,136657,0),n=b+n|0,n=(e=e+r|0)>>>0<r>>>0?n+1|0:n,r=(c=ze(K,he,-683901,-1))+e|0,e=b+n|0,e=r>>>0<c>>>0?e+1|0:e,te=(n=r)-(r=-2097152&be)|0,be=e-((n>>>0<r>>>0)+Ve|0)|0,e=ze(h,ie,j,0),r=b,n=(c=ze(f,0,M,0))+e|0,e=b+r|0,e=n>>>0<c>>>0?e+1|0:e,r=(c=ze(m,0,N,0))+n|0,n=b+e|0,n=r>>>0<c>>>0?n+1|0:n,c=ze(_,ie,B,0),e=b+n|0,e=(r=c+r|0)>>>0<c>>>0?e+1|0:e,c=ze(A,0,C,ie),n=b+e|0,n=(r=c+r|0)>>>0<c>>>0?n+1|0:n,e=(c=ze(v,ie,x,0))+r|0,r=b+n|0,r=e>>>0<c>>>0?r+1|0:r,n=(c=ze(w,0,P,ie))+e|0,e=b+r|0,e=n>>>0<c>>>0?e+1|0:e,r=(c=ze(S,ie,O,0))+n|0,n=b+e|0,n=r>>>0<c>>>0?n+1|0:n,c=ze(I,ie,k,0),e=b+n|0,e=(r=c+r|0)>>>0<c>>>0?e+1|0:e,c=ze(g,0,D,0),n=b+e|0,n=(r=c+r|0)>>>0<c>>>0?n+1|0:n,e=(c=ze(F,0,d,0))+r|0,r=b+n|0,r=e>>>0<c>>>0?r+1|0:r,n=(c=ze(p,ie,T,0))+e|0,e=b+r|0,e=n>>>0<c>>>0?e+1|0:e,e=(ce>>>21|0)+(n=(r=(c=(l[u+28|0]|l[u+29|0]<<8|l[u+30|0]<<16|l[u+31|0]<<24)>>>7|0)+n|0)>>>0<c>>>0?e+1|0:e)|0,e=(r=(c=(2097151&ce)<<11|Me>>>21)+r|0)>>>0<c>>>0?e+1|0:e,c=r,Pe=e,De=e=e-((r>>>0<4293918720)-1|0)|0,n=te,te=(2097151&e)<<11|(le=r- -1048576|0)>>>21,e=(e>>21)+be|0,e=(r=n+te|0)>>>0<te>>>0?e+1|0:e,te=r,Ne=e,ve=e=e-((r>>>0<4293918720)-1|0)|0,n=oe,oe=(2097151&e)<<11|(ie=r- -1048576|0)>>>21,e=(e>>21)+Oe|0,ce=e=(r=n+oe|0)>>>0<oe>>>0?e+1|0:e,be=e=e-((r>>>0<4293918720)-1|0)|0,Be=(2097151&e)<<11|(oe=r- -1048576|0)>>>21,e=(e>>21)+Re|0,Oe=ae=Be+ae|0,ae=e=ae>>>0<Be>>>0?e+1|0:e,e=(n=Ee)+(Ee=ze(Oe,e,-683901,-1))|0,n=b+Ae|0,Be=e,Ae=e>>>0<Ee>>>0?n+1|0:n,ce=ce-(((e=-2097152&oe)>>>0>r>>>0)+be|0)|0,Fe=r-e|0,n=ze(z,_e,470296,0)+se|0,e=et+b|0,e=n>>>0<se>>>0?e+1|0:e,r=(se=ze(Y,Se,654183,0))+(n-(oe=-2097152&me)|0)|0,n=b+(e-((n>>>0<oe>>>0)+nt|0)|0)|0,n=r>>>0<se>>>0?n+1|0:n,e=r,r=ze(H,ye,-997805,-1),n=b+n|0,n=(e=e+r|0)>>>0<r>>>0?n+1|0:n,r=(oe=ze(Oe,ae,136657,0))+e|0,e=b+n|0,e=r>>>0<oe>>>0?e+1|0:e,n=(oe=ze(Fe,ce,-683901,-1))+r|0,r=b+e|0,me=r=n>>>0<oe>>>0?r+1|0:r,Ee=r=r-((n>>>0<4293918720)-1|0)|0,e=(e=r>>21)+Ae|0,e=(r=(oe=(2097151&r)<<11|(se=n- -1048576|0)>>>21)+Be|0)>>>0<oe>>>0?e+1|0:e,oe=r,Ae=e,Be=r=e-((r>>>0<4293918720)-1|0)|0,Re=(2097151&r)<<11|(be=oe- -1048576|0)>>>21,r=(r>>21)+Ye|0,r=Re>>>0>(Ve=Re+Je|0)>>>0?r+1|0:r,Re=Ve,Ve=r,We=oe-(e=-2097152&be)|0,Be=Ae-((e>>>0>oe>>>0)+Be|0)|0,Ae=n-(e=-2097152&se)|0,me=me-((e>>>0>n>>>0)+Ee|0)|0,e=(r=ze(z,_e,666643,0))+(ne-(n=-2097152&xe)|0)|0,n=b+(ke-((n>>>0>ne>>>0)+$e|0)|0)|0,n=e>>>0<r>>>0?n+1|0:n,oe=ze(Y,Se,470296,0),r=b+n|0,r=(e=oe+e|0)>>>0<oe>>>0?r+1|0:r,n=(oe=ze(H,ye,654183,0))+e|0,e=b+r|0,be=n,oe=n>>>0<oe>>>0?e+1|0:e,ne=te-(e=-2097152&ie)|0,te=Ne-((e>>>0>te>>>0)+ve|0)|0,e=ze(G,pe,470296,0),r=b,n=(se=ze(Q,we,666643,0))+e|0,e=b+r|0,e=n>>>0<se>>>0?e+1|0:e,se=ze(U,ge,654183,0),r=b+e|0,r=(n=se+n|0)>>>0<se>>>0?r+1|0:r,se=ze(V,fe,-997805,-1),e=b+r|0,e=(n=se+n|0)>>>0<se>>>0?e+1|0:e,r=(se=ze(K,he,136657,0))+n|0,n=b+e|0,n=r>>>0<se>>>0?n+1|0:n,e=r,r=ze(W,Ce,-683901,-1),n=b+n|0,n=(e=e+r|0)>>>0<r>>>0?n+1|0:n,r=e+c|0,e=n+Pe|0,e=r>>>0<c>>>0?e+1|0:e,c=(n=r)-(r=-2097152&le)|0,r=e-((n>>>0<r>>>0)+De|0)|0,n=(e=c)+(c=(2097151&ue)<<11|He>>>21)|0,e=(ue>>21)+r|0,e=n>>>0<c>>>0?e+1|0:e,c=n,_e=e,fe=n=e-((n>>>0<4293918720)-1|0)|0,le=(2097151&n)<<11|(se=c- -1048576|0)>>>21,n=(n>>21)+te|0,xe=r=le+ne|0,ne=n=r>>>0<le>>>0?n+1|0:n,n=ze(r,n,-683901,-1),r=b+oe|0,r=(e=n+be|0)>>>0<n>>>0?r+1|0:r,n=(te=ze(Oe,ae,-997805,-1))+e|0,e=b+r|0,e=n>>>0<te>>>0?e+1|0:e,r=(te=ze(Fe,ce,136657,0))+n|0,n=b+e|0,De=r,ge=r>>>0<te>>>0?n+1|0:n,e=ze(D,0,j,0),r=b,n=(te=ze(O,0,M,0))+e|0,e=b+r|0,e=n>>>0<te>>>0?e+1|0:e,r=(te=ze(N,0,T,0))+n|0,n=b+e|0,n=r>>>0<te>>>0?n+1|0:n,e=(te=ze(F,0,B,0))+r|0,r=b+n|0,n=e,e=e>>>0<te>>>0?r+1|0:r,ie=n=(r=ee>>>7&2097151)+n|0,oe=n>>>0<r>>>0?e+1|0:e,e=ze(j,0,T,0),n=b,r=ze(D,0,M,0),n=b+n|0,n=(e=r+e|0)>>>0<r>>>0?n+1|0:n,te=ze(F,0,N,0),r=b+n|0,r=(e=te+e|0)>>>0<te>>>0?r+1|0:r,n=e,te=2097151&((3&(e=$))<<30|X>>>2),e=r,e=(n=n+te|0)>>>0<te>>>0?e+1|0:e,te=n,le=e,he=e=e-((n>>>0<4293918720)-1|0)|0,n=e>>>21|0,e=(r=ie)+(ie=(2097151&e)<<11|(ue=te- -1048576|0)>>>21)|0,r=n+oe|0,oe=e,Ce=r=e>>>0<ie>>>0?r+1|0:r,be=e=r-((e>>>0<4293918720)-1|0)|0,r=i+((2097151&e)<<11|(ie=oe- -1048576|0)>>>21)|0,e=Ge+(e>>>21|0)|0,e=r>>>0<i>>>0?e+1|0:e,n=(pe=ze(Y,Se,666643,0))+(r-(i=-2097152&Te)|0)|0,r=b+(e-((r>>>0<i>>>0)+Ke|0)|0)|0,e=(i=ze(H,ye,470296,0))+n|0,n=b+(n>>>0<pe>>>0?r+1|0:r)|0,n=e>>>0<i>>>0?n+1|0:n,r=(i=ze(xe,ne,136657,0))+e|0,e=b+n|0,e=r>>>0<i>>>0?e+1|0:e,n=r,r=ze(Oe,ae,654183,0),e=b+e|0,e=(n=n+r|0)>>>0<r>>>0?e+1|0:e,r=(i=ze(Fe,ce,-997805,-1))+n|0,n=b+e|0,pe=r,Se=n=r>>>0<i>>>0?n+1|0:n,Pe=n=n-((r>>>0<4293918720)-1|0)|0,i=(2097151&n)<<11|(we=r- -1048576|0)>>>21,n=(n>>21)+ge|0,i=n=(r=i+De|0)>>>0<i>>>0?n+1|0:n,De=n=n-((r>>>0<4293918720)-1|0)|0,Te=(2097151&n)<<11|(ge=r- -1048576|0)>>>21,n=(n>>21)+me|0,Ne=Ae=Te+Ae|0,Ae=Ae>>>0<Te>>>0?n+1|0:n,Te=i,n=c-(e=-2097152&se)|0,i=_e-((e>>>0>c>>>0)+fe|0)|0,e=(c=(2097151&de)<<11|Ue>>>21)+n|0,n=(de>>21)+i|0,i=e,_e=n=e>>>0<c>>>0?n+1|0:n,fe=e=n-((e>>>0<4293918720)-1|0)|0,se=n=e>>21,c=r,r=ze(me=(2097151&e)<<11|(de=i- -1048576|0)>>>21,n,-683901,-1),e=b+Te|0,e=(n=c+r|0)>>>0<r>>>0?e+1|0:e,Te=n-(r=-2097152&ge)|0,De=e-((n>>>0<r>>>0)+De|0)|0,r=ze(me,se,136657,0),n=b+Se|0,n=(e=r+pe|0)>>>0<r>>>0?n+1|0:n,ve=e-(r=-2097152&we)|0,Ee=n-((e>>>0<r>>>0)+Pe|0)|0,c=ze(H,ye,666643,0),r=b+(Ce-(((n=-2097152&ie)>>>0>oe>>>0)+be|0)|0)|0,r=(e=c+(oe-n|0)|0)>>>0<c>>>0?r+1|0:r,n=(c=ze(xe,ne,-997805,-1))+e|0,e=b+r|0,e=n>>>0<c>>>0?e+1|0:e,r=(c=ze(Oe,ae,470296,0))+n|0,n=b+e|0,n=r>>>0<c>>>0?n+1|0:n,e=r,r=ze(Fe,ce,654183,0),n=b+n|0,be=e=e+r|0,ie=e>>>0<r>>>0?n+1|0:n,pe=te,we=le,e=ze(F,0,j,0),r=b,n=(c=ze(T,0,M,0))+e|0,e=b+r|0,e=n>>>0<c>>>0?e+1|0:e,r=(n=(c=J>>>5&2097151)+n|0)>>>0<c>>>0?e+1|0:e,te=n,c=2097151&q,n=ze(F,0,M,0)+c|0,e=b,e=n>>>0<c>>>0?e+1|0:e,c=n,ge=e,Se=e=e-((n>>>0<4293918720)-1|0)|0,n=(n=e>>>21|0)+r|0,n=(e=(le=te)+(te=(2097151&e)<<11|(oe=c- -1048576|0)>>>21)|0)>>>0<te>>>0?n+1|0:n,te=e,Ce=n,ye=e=n-((e>>>0<4293918720)-1|0)|0,n=pe,pe=(2097151&e)<<11|(le=te- -1048576|0)>>>21,e=(e>>>21|0)+we|0,e=(r=n+pe|0)>>>0<pe>>>0?e+1|0:e,r=(pe=ze(xe,ne,654183,0))+((n=r)-(ue&=-2097152)|0)|0,n=b+(e-((16383&he)+(n>>>0<ue>>>0)|0)|0)|0,n=r>>>0<pe>>>0?n+1|0:n,e=r,r=ze(Oe,ae,666643,0),n=b+n|0,n=(e=e+r|0)>>>0<r>>>0?n+1|0:n,r=(ae=ze(Fe,ce,470296,0))+e|0,e=b+n|0,e=r>>>0<ae>>>0?e+1|0:e,ae=r,pe=e,we=e=e-((r>>>0<4293918720)-1|0)|0,he=(2097151&e)<<11|(ue=r- -1048576|0)>>>21,e=(e>>21)+ie|0,he=e=(r=he+be|0)>>>0<he>>>0?e+1|0:e,be=e=e-((r>>>0<4293918720)-1|0)|0,n=ve,ve=(2097151&e)<<11|(ie=r- -1048576|0)>>>21,e=(e>>21)+Ee|0,e=ve>>>0>(Pe=n+ve|0)>>>0?e+1|0:e,ve=Pe,Pe=e,e=(n=ze(me,se,-997805,-1))+r|0,r=b+he|0,r=e>>>0<n>>>0?r+1|0:r,ie=e-(n=-2097152&ie)|0,he=r-((e>>>0<n>>>0)+be|0)|0,r=ze(me,se,654183,0),n=b+pe|0,n=(e=r+ae|0)>>>0<r>>>0?n+1|0:n,pe=e-(r=-2097152&ue)|0,we=n-((e>>>0<r>>>0)+we|0)|0,n=(r=ze(xe,ne,470296,0))+(te-(e=-2097152&le)|0)|0,e=b+(Ce-((16383&ye)+(e>>>0>te>>>0)|0)|0)|0,e=n>>>0<r>>>0?e+1|0:e,r=(te=ze(Fe,ce,666643,0))+n|0,n=b+e|0,ae=r,te=r>>>0<te>>>0?n+1|0:n,e=(r=ze(xe,ne,666643,0))+(c-(n=-2097152&oe)|0)|0,n=b+(ge-((4095&Se)+(n>>>0>c>>>0)|0)|0)|0,n=e>>>0<r>>>0?n+1|0:n,r=e,le=n,ne=n=n-((e>>>0<4293918720)-1|0)|0,oe=ae,ae=(2097151&n)<<11|(c=e- -1048576|0)>>>21,n=(n>>21)+te|0,ae=n=(te=oe=oe+ae|0)>>>0<ae>>>0?n+1|0:n,ue=n=n-((te>>>0<4293918720)-1|0)|0,e=pe,pe=(2097151&n)<<11|(oe=te- -1048576|0)>>>21,n=(n>>21)+we|0,n=(ce=e+pe|0)>>>0<pe>>>0?n+1|0:n,pe=ce,ce=n,n=(e=te)+(te=ze(me,se,470296,0))|0,e=b+ae|0,e=n>>>0<te>>>0?e+1|0:e,oe=n-(te=-2097152&oe)|0,te=e-((n>>>0<te>>>0)+ue|0)|0,ae=oe,e=(r-(n=-2097152&c)|0)+(c=ze(me,se,666643,0))|0,n=b+(le-((n>>>0>r>>>0)+ne|0)|0)|0,oe=e,r=e,e=(e=(n=e>>>0<c>>>0?n+1|0:n)>>21)+te|0,e=(n=ae+(r=(2097151&n)<<11|r>>>21)|0)>>>0<r>>>0?e+1|0:e,le=n,r=n,n=(n=e>>21)+ce|0,se=e=(r=(2097151&e)<<11|r>>>21)+pe|0,c=(2097151&(n=e>>>0<r>>>0?n+1|0:n))<<11|(r=e)>>>21,r=(e=n>>21)+he|0,ae=n=c+ie|0,c=(2097151&(r=(e=n)>>>0<c>>>0?r+1|0:r))<<11|e>>>21,e=(n=r>>21)+Pe|0,ue=r=c+ve|0,c=(2097151&(e=(n=r)>>>0<c>>>0?e+1|0:e))<<11|n>>>21,n=(r=e>>21)+De|0,ce=e=c+Te|0,r=e,e=(e=(n=e>>>0<c>>>0?n+1|0:n)>>21)+Ae|0,e=(n=(r=(2097151&n)<<11|r>>>21)+Ne|0)>>>0<r>>>0?e+1|0:e,ie=n,r=n,n=(n=e>>21)+Be|0,pe=e=(r=(2097151&e)<<11|r>>>21)+We|0,c=(2097151&(n=e>>>0<r>>>0?n+1|0:n))<<11|(r=e)>>>21,r=(e=n>>21)+Ve|0,we=n=c+Re|0,c=(2097151&(r=(e=n)>>>0<c>>>0?r+1|0:r))<<11|e>>>21,e=(n=r>>21)+Qe|0,ge=r=c+Ie|0,c=(2097151&(e=(n=r)>>>0<c>>>0?e+1|0:e))<<11|n>>>21,n=(r=e>>21)+rt|0,Se=e=c+Ze|0,r=e,e=(n=e>>>0<c>>>0?n+1|0:n)>>21,r=(2097151&n)<<11|r>>>21,c=i-(n=-2097152&de)|0,n=(_e-((n>>>0>i>>>0)+fe|0)|0)+e|0,de=r=r+c|0,c=r=(n=(e=r)>>>0<c>>>0?n+1|0:n)>>21,e=ze(ne=(2097151&n)<<11|e>>>21,r,666643,0),n=b,te=e=e+(r=2097151&oe)|0,i=n=e>>>0<r>>>0?n+1|0:n,o[0|s]=e,o[s+1|0]=(255&n)<<24|e>>>8,r=2097151&le,n=ze(ne,c,470296,0)+r|0,e=b,oe=(le=(2097151&i)<<11|te>>>21)+n|0,n=(i>>21)+(e=n>>>0<r>>>0?e+1|0:e)|0,n=oe>>>0<le>>>0?n+1|0:n,o[s+4|0]=(2047&n)<<21|oe>>>11,e=n,o[s+3|0]=(7&e)<<29|oe>>>3,le=2097151&se,r=ze(ne,c,654183,0)+le|0,n=b,se=(2097151&e)<<11|oe>>>21,e=(e>>21)+(n=r>>>0<le>>>0?n+1|0:n)|0,n=e=se>>>0>(r=le=se+r|0)>>>0?e+1|0:e,o[s+6|0]=(63&e)<<26|r>>>6,le=0,e=oe&=2097151,o[s+2|0]=31&((65535&i)<<16|te>>>16)|e<<5,te=2097151&ae,i=ze(ne,c,-997805,-1)+te|0,e=b,se=(2097151&n)<<11|r>>>21,n=(n>>21)+(e=i>>>0<te>>>0?e+1|0:e)|0,n=(e=te=se+i|0)>>>0<se>>>0?n+1|0:n,o[s+9|0]=(511&n)<<23|e>>>9,o[s+8|0]=(1&n)<<31|e>>>1,i=0,te=(r=se=2097151&r)<<2,r=le,o[s+5|0]=te|(524287&r)<<13|oe>>>19,oe=2097151&ue,te=ze(ne,c,136657,0)+oe|0,r=b,r=te>>>0<oe>>>0?r+1|0:r,oe=te,te=r,r=n,n=(n>>=21)+te|0,n=(r=(ae=oe)+(oe=(2097151&r)<<11|e>>>21)|0)>>>0<oe>>>0?n+1|0:n,o[s+12|0]=(4095&n)<<20|r>>>12,o[s+11|0]=(15&n)<<28|r>>>4,te=0,oe=(e=le=2097151&e)<<7,e=i,i=se,o[s+7|0]=oe|(16383&e)<<18|i>>>14,i=(e=ze(ne,c,-683901,-1))+(c=2097151&ce)|0,e=b,e=i>>>0<c>>>0?e+1|0:e,c=i,i=e,oe=(2097151&(e=n))<<11|r>>>21,e=(n=e>>21)+i|0,e=(c=oe+c|0)>>>0<oe>>>0?e+1|0:e,o[s+14|0]=(127&e)<<25|c>>>7,oe=0,r=(n=ne=2097151&r)<<4,n=te,o[s+10|0]=r|(131071&n)<<15|le>>>17,n=e,e>>=21,i=r=(te=(2097151&n)<<11|c>>>21)+(2097151&ie)|0,n=r>>>0<te>>>0?e+1|0:e,o[s+17|0]=(1023&n)<<22|r>>>10,o[s+16|0]=(3&n)<<30|r>>>2,te=0,c=(e=le=2097151&c)<<1,e=oe,o[s+13|0]=c|(1048575&e)<<12|ne>>>20,e=n>>21,r=(n=(c=(2097151&n)<<11|r>>>21)+(2097151&pe)|0)>>>0<c>>>0?e+1|0:e,c=n,o[s+20|0]=(8191&r)<<19|n>>>13,o[s+19|0]=(31&r)<<27|n>>>5,n=(e=ne=2097151&i)<<6,e=te,o[s+15|0]=n|(32767&e)<<17|le>>>15,n=r>>21,le=i=(te=(2097151&r)<<11|c>>>21)+(2097151&we)|0,i=i>>>0<te>>>0?n+1|0:n,o[s+21|0]=le,n=(e=c)<<3,e=oe,o[s+18|0]=n|(262143&e)<<14|ne>>>18,e=le,o[s+22|0]=(255&i)<<24|e>>>8,n=i>>21,n=(e=(c=(2097151&i)<<11|e>>>21)+(2097151&ge)|0)>>>0<c>>>0?n+1|0:n,c=e,o[s+25|0]=(2047&n)<<21|e>>>11,o[s+24|0]=(7&n)<<29|e>>>3,e=n>>21,r=(n=(te=(2097151&n)<<11|c>>>21)+(2097151&Se)|0)>>>0<te>>>0?e+1|0:e,te=n,o[s+27|0]=(63&r)<<26|n>>>6,e=c&=2097151,o[s+23|0]=31&((65535&i)<<16|le>>>16)|e<<5,e=r>>21,e=(n=(r=(2097151&r)<<11|n>>>21)+(2097151&de)|0)>>>0<r>>>0?e+1|0:e,o[s+31|0]=(131071&e)<<15|n>>>17,o[s+30|0]=(511&e)<<23|n>>>9,o[s+29|0]=(1&e)<<31|n>>>1,i=0,e=(r=te&=2097151)<<2,r=oe,o[s+26|0]=e|(524287&r)<<13|c>>>19,e=i,o[s+28|0]=(16383&e)<<18|te>>>14|n<<7,bn(L,64),bn(u,64),t&&(a[t>>2]=64,a[t+4>>2]=0),y=R+560|0,0}function C(e,t,n,r){for(var i=0,o=0,s=0,c=0,u=0,d=0,h=0,p=0,f=0,g=0,m=0,y=0,v=0,A=0,w=0,S=0,C=0,E=0,I=0,_=0,x=0,P=0,k=0,B=0,O=0,N=0,D=0,j=0,T=0,M=0,F=0,R=0,L=0,Q=0,U=0,V=0,K=0,H=0,G=0,Y=0;c=(i=h<<3)+n|0,_=l[4+(i=t+i|0)|0]|l[i+5|0]<<8|l[i+6|0]<<16|l[i+7|0]<<24,s=(d=g=l[0|i]|l[i+1|0]<<8|l[i+2|0]<<16|l[i+3|0]<<24)<<24|d<<8&16711680,a[c>>2]=-16777216&((255&_)<<24|d>>>8)|16711680&((16777215&_)<<8|d>>>24)|_>>>8&65280|_>>>24,i=0,a[c+4>>2]=65280&(_<<24|d>>>8)|255&(_<<8|d>>>24)|s|i|i,16!=(0|(h=h+1|0)););for(t=pt(r,e,64);;){if(i=a[(r=_=(x=V<<3)+n|0)>>2],r=a[r+4>>2],c=we(v=a[t+32>>2],p=a[t+36>>2],14),s=b,c=we(v,p,18)^c,s^=b,c=we(v,p,41)^c,r=(b^s)+r|0,r=(i=c+i|0)>>>0<c>>>0?r+1|0:r,o=a[t+48>>2],i=(s=a[(c=x+34144|0)>>2])+i|0,r=a[c+4>>2]+r|0,r=i>>>0<s>>>0?r+1|0:r,c=(s=o^((y=a[t+40>>2])^o)&v)+i|0,i=(((A=a[t+52>>2])^(w=a[t+44>>2]))&p^A)+r|0,i=s>>>0>c>>>0?i+1|0:i,c=(s=a[t+56>>2])+c|0,r=a[t+60>>2]+i|0,r=s>>>0>c>>>0?r+1|0:r,s=c+(h=a[t+24>>2])|0,i=a[t+28>>2]+r|0,d=s,f=i=s>>>0<h>>>0?i+1|0:i,a[t+24>>2]=s,a[t+28>>2]=i,i=we(C=a[t>>2],h=a[t+4>>2],28),g=b,i=we(C,h,34)^i,s=b^g,g=c+(we(C,h,39)^i)|0,i=r+(b^s)|0,i=c>>>0>g>>>0?i+1|0:i,g=(S=C&((c=a[t+16>>2])|(u=a[t+8>>2]))|c&u)+g|0,r=(r=i)+(h&((i=a[t+20>>2])|(s=a[t+12>>2]))|i&s)|0,r=g>>>0<S>>>0?r+1|0:r,S=g,g=r,a[t+56>>2]=S,a[t+60>>2]=r,r=i,i=we(d,f,14),m=b,E=we(d,f,18)^i,m^=b,B=c,c=(i=o)+(o=(y^v)&d^y)|0,i=((p^w)&f^w)+A|0,i=c>>>0<o>>>0?i+1|0:i,o=we(d,f,41)^E,i=(b^m)+i|0,i=(c=o+c|0)>>>0<o>>>0?i+1|0:i,c=(m=a[(A=D=(o=8|x)+n|0)>>2])+c|0,i=a[A+4>>2]+i|0,i=c>>>0<m>>>0?i+1|0:i,c=(A=a[(o=o+34144|0)>>2])+c|0,i=a[o+4>>2]+i|0,i=c>>>0<A>>>0?i+1|0:i,m=c,A=r,r=i,i=A+i|0,i=(c=B+(o=c)|0)>>>0<o>>>0?i+1|0:i,o=c,A=i,a[t+16>>2]=o,a[t+20>>2]=i,i=we(S,g,28),c=b,E=we(S,g,34)^i,I=b^c,c=(i=m)+(m=(u|C)&S|u&C)|0,i=((s|h)&g|s&h)+r|0,i=c>>>0<m>>>0?i+1|0:i,m=we(S,g,39)^E,r=(b^I)+i|0,r=(c=m+c|0)>>>0<m>>>0?r+1|0:r,m=c,c=r,a[t+48>>2]=m,a[t+52>>2]=r,r=we(o,A,14),i=b,E=we(o,A,18)^r,I=b^i,B=u,i=((p^f)&A^p)+w|0,i=(r=(u=(d^v)&o^v)+y|0)>>>0<u>>>0?i+1|0:i,u=we(o,A,41)^E,i=(b^I)+i|0,i=(r=u+r|0)>>>0<u>>>0?i+1|0:i,u=(u=r)+(w=a[(r=j=(y=16|x)+n|0)>>2])|0,r=a[r+4>>2]+i|0,r=u>>>0<w>>>0?r+1|0:r,u=(y=a[(i=y+34144|0)>>2])+u|0,i=a[i+4>>2]+r|0,i=u>>>0<y>>>0?i+1|0:i,w=u,y=u,r=i,i=i+s|0,y=i=(u=B+u|0)>>>0<y>>>0?i+1|0:i,a[t+8>>2]=u,a[t+12>>2]=i,i=we(m,c,28),s=b,E=we(m,c,34)^i,s^=b,r=((h|g)&c|h&g)+r|0,r=(i=(i=w)+(w=(S|C)&m|S&C)|0)>>>0<w>>>0?r+1|0:r,w=we(m,c,39)^E,r=(b^s)+r|0,r=(i=w+i|0)>>>0<w>>>0?r+1|0:r,w=i,s=r,a[t+40>>2]=i,a[t+44>>2]=r,r=we(u,y,14),i=b,E=we(u,y,18)^r,I=b^i,B=C,i=(f^(f^A)&y)+p|0,i=(r=(C=d^(o^d)&u)+v|0)>>>0<C>>>0?i+1|0:i,p=(C=we(u,y,41)^E)+r|0,r=(b^I)+i|0,r=p>>>0<C>>>0?r+1|0:r,p=(v=a[(i=T=(C=24|x)+n|0)>>2])+p|0,i=a[i+4>>2]+r|0,i=p>>>0<v>>>0?i+1|0:i,r=(r=p)+(C=a[(p=C+34144|0)>>2])|0,i=a[p+4>>2]+i|0,v=r,p=B+r|0,r=(i=r>>>0<C>>>0?i+1|0:i)+h|0,C=r=p>>>0<v>>>0?r+1|0:r,a[t>>2]=p,a[t+4>>2]=r,r=we(w,s,28),h=b,E=we(w,s,34)^r,I=b^h,i=((c|g)&s|c&g)+i|0,i=(r=(h=(m|S)&w|m&S)+v|0)>>>0<h>>>0?i+1|0:i,h=(v=we(w,s,39)^E)+r|0,r=(b^I)+i|0,r=h>>>0<v>>>0?r+1|0:r,v=h,h=r,a[t+32>>2]=v,a[t+36>>2]=r,r=we(p,C,14),i=b,E=we(p,C,18)^r,I=b^i,O=S,i=f+(A^(y^A)&C)|0,i=(r=d+(o^(o^u)&p)|0)>>>0<d>>>0?i+1|0:i,d=we(p,C,41)^E,i=(b^I)+i|0,i=(r=d+r|0)>>>0<d>>>0?i+1|0:i,r=(S=a[(f=B=(d=32|x)+n|0)>>2])+r|0,i=a[f+4>>2]+i|0,i=r>>>0<S>>>0?i+1|0:i,r=(f=a[(d=d+34144|0)>>2])+r|0,i=a[d+4>>2]+i|0,i=r>>>0<f>>>0?i+1|0:i,S=r,f=r,d=O+r|0,r=i,i=i+g|0,f=i=d>>>0<f>>>0?i+1|0:i,a[t+56>>2]=d,a[t+60>>2]=i,i=we(v,h,28),g=b,E=we(v,h,34)^i,I=b^g,g=(i=S)+(S=(m|w)&v|m&w)|0,i=((s|c)&h|s&c)+r|0,i=g>>>0<S>>>0?i+1|0:i,S=we(v,h,39)^E,r=(b^I)+i|0,r=(g=S+g|0)>>>0<S>>>0?r+1|0:r,S=g,g=r,a[t+24>>2]=S,a[t+28>>2]=r,r=we(d,f,14),i=b,E=we(d,f,18)^r,I=b^i,O=m,i=A+(y^(y^C)&f)|0,i=(r=o+(u^(u^p)&d)|0)>>>0<o>>>0?i+1|0:i,o=we(d,f,41)^E,i=(b^I)+i|0,i=(r=o+r|0)>>>0<o>>>0?i+1|0:i,o=(o=r)+(m=a[(r=k=(A=40|x)+n|0)>>2])|0,r=a[r+4>>2]+i|0,r=o>>>0<m>>>0?r+1|0:r,o=(A=a[(i=A+34144|0)>>2])+o|0,i=a[i+4>>2]+r|0,m=o,r=i=o>>>0<A>>>0?i+1|0:i,i=i+c|0,A=i=(o=O+o|0)>>>0<m>>>0?i+1|0:i,a[t+48>>2]=o,a[t+52>>2]=i,i=we(S,g,28),c=b,E=we(S,g,34)^i,c^=b,r=((s|h)&g|s&h)+r|0,r=(i=(i=m)+(m=(w|v)&S|w&v)|0)>>>0<m>>>0?r+1|0:r,m=we(S,g,39)^E,r=(b^c)+r|0,r=(i=m+i|0)>>>0<m>>>0?r+1|0:r,m=i,c=r,a[t+16>>2]=i,a[t+20>>2]=r,r=we(o,A,14),i=b,E=we(o,A,18)^r,I=b^i,P=w,i=y+(C^(f^C)&A)|0,i=(r=u+(p^(d^p)&o)|0)>>>0<u>>>0?i+1|0:i,u=(y=we(o,A,41)^E)+r|0,r=(b^I)+i|0,r=u>>>0<y>>>0?r+1|0:r,u=(w=a[(i=O=(y=48|x)+n|0)>>2])+u|0,i=a[i+4>>2]+r|0,i=u>>>0<w>>>0?i+1|0:i,r=(r=u)+(y=a[(u=y+34144|0)>>2])|0,i=a[u+4>>2]+i|0,i=r>>>0<y>>>0?i+1|0:i,w=r,y=r,u=P+r|0,r=i+s|0,y=r=u>>>0<y>>>0?r+1|0:r,a[t+40>>2]=u,a[t+44>>2]=r,r=we(m,c,28),s=b,E=we(m,c,34)^r,I=b^s,i=((h|g)&c|h&g)+i|0,i=(r=(s=(S|v)&m|S&v)+w|0)>>>0<s>>>0?i+1|0:i,s=(w=we(m,c,39)^E)+r|0,r=(b^I)+i|0,r=s>>>0<w>>>0?r+1|0:r,w=s,s=r,a[t+8>>2]=w,a[t+12>>2]=r,r=we(u,y,14),i=b,E=we(u,y,18)^r,I=b^i,P=v,i=C+(f^(f^A)&y)|0,i=(r=p+(d^(o^d)&u)|0)>>>0<p>>>0?i+1|0:i,p=we(u,y,41)^E,i=(b^I)+i|0,i=(r=p+r|0)>>>0<p>>>0?i+1|0:i,r=(v=a[(C=R=(p=56|x)+n|0)>>2])+r|0,i=a[C+4>>2]+i|0,i=r>>>0<v>>>0?i+1|0:i,r=(C=a[(p=p+34144|0)>>2])+r|0,i=a[p+4>>2]+i|0,v=r,p=P+r|0,r=i=r>>>0<C>>>0?i+1|0:i,i=i+h|0,C=i=p>>>0<v>>>0?i+1|0:i,a[t+32>>2]=p,a[t+36>>2]=i,i=we(w,s,28),h=b,E=we(w,s,34)^i,I=b^h,h=(i=v)+(v=(m|S)&w|m&S)|0,i=((c|g)&s|c&g)+r|0,i=h>>>0<v>>>0?i+1|0:i,v=we(w,s,39)^E,r=(b^I)+i|0,r=(h=v+h|0)>>>0<v>>>0?r+1|0:r,v=h,h=r,a[t>>2]=v,a[t+4>>2]=r,r=we(p,C,14),i=b,E=we(p,C,18)^r,I=b^i,P=S,i=f+(A^(y^A)&C)|0,i=(r=d+(o^(o^u)&p)|0)>>>0<d>>>0?i+1|0:i,d=we(p,C,41)^E,i=(b^I)+i|0,i=(r=d+r|0)>>>0<d>>>0?i+1|0:i,d=(d=r)+(S=a[(r=K=(f=64|x)+n|0)>>2])|0,r=a[r+4>>2]+i|0,r=d>>>0<S>>>0?r+1|0:r,d=(f=a[(i=f+34144|0)>>2])+d|0,i=a[i+4>>2]+r|0,i=d>>>0<f>>>0?i+1|0:i,f=d,r=i,i=i+g|0,S=i=(d=P+d|0)>>>0<f>>>0?i+1|0:i,a[t+24>>2]=d,a[t+28>>2]=i,i=we(v,h,28),g=b,E=we(v,h,34)^i,g^=b,r=((s|c)&h|s&c)+r|0,r=(i=(i=f)+(f=(m|w)&v|m&w)|0)>>>0<f>>>0?r+1|0:r,f=we(v,h,39)^E,r=(b^g)+r|0,E=i=f+i|0,g=r=i>>>0<f>>>0?r+1|0:r,a[t+56>>2]=i,a[t+60>>2]=r,r=we(d,S,14),i=b,f=we(d,S,18)^r,I=b^i,i=A+(y^(y^C)&S)|0,i=(r=o+(u^(u^p)&d)|0)>>>0<o>>>0?i+1|0:i,o=(f=we(d,S,41)^f)+r|0,r=(b^I)+i|0,r=o>>>0<f>>>0?r+1|0:r,o=(A=a[(i=P=(f=72|x)+n|0)>>2])+o|0,i=a[i+4>>2]+r|0,i=o>>>0<A>>>0?i+1|0:i,r=(r=o)+(f=a[(o=f+34144|0)>>2])|0,i=a[o+4>>2]+i|0,i=r>>>0<f>>>0?i+1|0:i,f=r,o=r+m|0,r=i+c|0,m=r=o>>>0<f>>>0?r+1|0:r,a[t+16>>2]=o,a[t+20>>2]=r,r=we(E,g,28),c=b,A=we(E,g,34)^r,I=b^c,i=((s|h)&g|s&h)+i|0,i=(r=(c=(w|v)&E|w&v)+f|0)>>>0<c>>>0?i+1|0:i,c=(f=we(E,g,39)^A)+r|0,r=(b^I)+i|0,I=c,c=r=c>>>0<f>>>0?r+1|0:r,a[t+48>>2]=I,a[t+52>>2]=r,r=we(o,m,14),i=b,f=we(o,m,18)^r,A=b^i,i=y+(C^(S^C)&m)|0,i=(r=u+(p^(d^p)&o)|0)>>>0<u>>>0?i+1|0:i,u=we(o,m,41)^f,i=(b^A)+i|0,i=(r=u+r|0)>>>0<u>>>0?i+1|0:i,r=(A=a[(f=N=(u=80|x)+n|0)>>2])+r|0,i=a[f+4>>2]+i|0,i=r>>>0<A>>>0?i+1|0:i,r=(f=a[(u=u+34144|0)>>2])+r|0,i=a[u+4>>2]+i|0,i=r>>>0<f>>>0?i+1|0:i,f=r,u=r+w|0,r=i,i=i+s|0,y=i=u>>>0<f>>>0?i+1|0:i,a[t+8>>2]=u,a[t+12>>2]=i,i=we(I,c,28),s=b,A=we(I,c,34)^i,w=b^s,s=(i=f)+(f=(v|E)&I|v&E)|0,i=((h|g)&c|h&g)+r|0,i=s>>>0<f>>>0?i+1|0:i,f=we(I,c,39)^A,r=(b^w)+i|0,f=r=(s=f+s|0)>>>0<f>>>0?r+1|0:r,a[t+40>>2]=s,a[t+44>>2]=r,r=we(u,y,14),i=b,A=we(u,y,18)^r,w=b^i,i=C+(S^(m^S)&y)|0,i=(r=p+(d^(o^d)&u)|0)>>>0<p>>>0?i+1|0:i,p=we(u,y,41)^A,i=(b^w)+i|0,i=(r=p+r|0)>>>0<p>>>0?i+1|0:i,p=(p=r)+(C=a[(r=F=(A=88|x)+n|0)>>2])|0,r=a[r+4>>2]+i|0,r=p>>>0<C>>>0?r+1|0:r,p=(A=a[(i=A+34144|0)>>2])+p|0,i=a[i+4>>2]+r|0,i=p>>>0<A>>>0?i+1|0:i,A=p,r=i,i=i+h|0,C=i=(p=p+v|0)>>>0<A>>>0?i+1|0:i,a[t>>2]=p,a[t+4>>2]=i,i=we(s,f,28),h=b,w=we(s,f,34)^i,h^=b,r=((c|g)&f|c&g)+r|0,r=(i=(i=A)+(A=(E|I)&s|E&I)|0)>>>0<A>>>0?r+1|0:r,A=we(s,f,39)^w,r=(b^h)+r|0,h=i=A+i|0,A=r=i>>>0<A>>>0?r+1|0:r,a[t+32>>2]=i,a[t+36>>2]=r,r=we(p,C,14),i=b,w=we(p,C,18)^r,v=b^i,i=S+(m^(y^m)&C)|0,i=(r=d+(o^(o^u)&p)|0)>>>0<d>>>0?i+1|0:i,d=(S=we(p,C,41)^w)+r|0,r=(b^v)+i|0,r=d>>>0<S>>>0?r+1|0:r,d=(w=a[(i=H=(S=96|x)+n|0)>>2])+d|0,i=a[i+4>>2]+r|0,i=d>>>0<w>>>0?i+1|0:i,r=(r=d)+(S=a[(d=S+34144|0)>>2])|0,i=a[d+4>>2]+i|0,i=r>>>0<S>>>0?i+1|0:i,S=r,d=r+E|0,r=i+g|0,w=d,d=r=d>>>0<S>>>0?r+1|0:r,a[t+56>>2]=w,a[t+60>>2]=r,r=we(h,A,28),g=b,v=we(h,A,34)^r,E=b^g,i=((c|f)&A|c&f)+i|0,i=(r=(g=(s|I)&h|s&I)+S|0)>>>0<g>>>0?i+1|0:i,g=(S=we(h,A,39)^v)+r|0,r=(b^E)+i|0,r=g>>>0<S>>>0?r+1|0:r,S=g,g=r,a[t+24>>2]=S,a[t+28>>2]=r,r=we(w,d,14),i=b,v=we(w,d,18)^r,E=b^i,i=m+(y^(y^C)&d)|0,i=(r=o+(u^(u^p)&w)|0)>>>0<o>>>0?i+1|0:i,o=we(w,d,41)^v,i=(b^E)+i|0,i=(r=o+r|0)>>>0<o>>>0?i+1|0:i,r=(v=a[(m=G=(o=104|x)+n|0)>>2])+r|0,i=a[m+4>>2]+i|0,i=r>>>0<v>>>0?i+1|0:i,r=(m=a[(o=o+34144|0)>>2])+r|0,i=a[o+4>>2]+i|0,i=r>>>0<m>>>0?i+1|0:i,m=r,o=r+I|0,r=i,i=i+c|0,v=o,o=i=o>>>0<m>>>0?i+1|0:i,a[t+48>>2]=v,a[t+52>>2]=i,i=we(S,g,28),c=b,E=we(S,g,34)^i,I=b^c,c=(i=m)+(m=(s|h)&S|s&h)|0,i=((f|A)&g|f&A)+r|0,i=c>>>0<m>>>0?i+1|0:i,m=we(S,g,39)^E,r=(b^I)+i|0,r=(c=m+c|0)>>>0<m>>>0?r+1|0:r,m=c,c=r,a[t+16>>2]=m,a[t+20>>2]=r,r=we(v,o,14),i=b,E=we(v,o,18)^r,I=b^i,i=y+(C^(d^C)&o)|0,i=(r=u+(p^(p^w)&v)|0)>>>0<u>>>0?i+1|0:i,u=we(v,o,41)^E,i=(b^I)+i|0,i=(r=u+r|0)>>>0<u>>>0?i+1|0:i,u=(u=r)+(I=a[(r=E=(y=112|x)+n|0)>>2])|0,r=a[r+4>>2]+i|0,r=u>>>0<I>>>0?r+1|0:r,u=(y=a[(i=y+34144|0)>>2])+u|0,i=a[i+4>>2]+r|0,i=u>>>0<y>>>0?i+1|0:i,y=u,r=i,i=f+i|0,f=u=s+u|0,s=i=s>>>0>u>>>0?i+1|0:i,a[t+40>>2]=u,a[t+44>>2]=i,i=we(m,c,28),u=b,I=we(m,c,34)^i,u^=b,r=((g|A)&c|g&A)+r|0,r=(i=(i=y)+(y=(h|S)&m|h&S)|0)>>>0<y>>>0?r+1|0:r,y=we(m,c,39)^I,r=(b^u)+r|0,r=(i=y+i|0)>>>0<y>>>0?r+1|0:r,y=i,u=r,a[t+8>>2]=i,a[t+12>>2]=r,r=we(f,s,14),i=b,I=we(f,s,18)^r,M=b^i,i=C+(d^(o^d)&s)|0,i=(r=p+(w^(w^v)&f)|0)>>>0<p>>>0?i+1|0:i,s=(d=we(f,s,41)^I)+r|0,r=(b^M)+i|0,r=s>>>0<d>>>0?r+1|0:r,s=(p=a[(i=d=(o=120|x)+n|0)>>2])+s|0,i=a[i+4>>2]+r|0,i=s>>>0<p>>>0?i+1|0:i,r=(r=s)+(o=a[(s=o+34144|0)>>2])|0,i=a[s+4>>2]+i|0,i=r>>>0<o>>>0?i+1|0:i,o=r,s=h+r|0,r=i+A|0,a[t+32>>2]=s,a[t+36>>2]=s>>>0<h>>>0?r+1|0:r,r=we(y,u,28),s=b,h=we(y,u,34)^r,s^=b,i=((c|g)&u|c&g)+i|0,g=(r=(r=o)+(o=(m|S)&y|m&S)|0)+(c=we(y,u,39)^h)|0,r=(b^s)+(r>>>0<o>>>0?i+1|0:i)|0,a[t>>2]=g,a[t+4>>2]=c>>>0>g>>>0?r+1|0:r,64==(0|V)){for(;n=(r=Y<<3)+e|0,r=(_=a[(i=t+r|0)>>2])+a[n>>2]|0,i=a[n+4>>2]+a[i+4>>2]|0,a[n>>2]=r,a[n+4>>2]=r>>>0<_>>>0?i+1|0:i,8!=(0|(Y=Y+1|0)););break}h=((V=V+16|0)<<3)+n|0,f=r=a[E+4>>2],i=r>>>6|0,r=((63&r)<<26|(M=a[E>>2])>>>6)^we(M,r,19),i^=b,r=(r=we(M,f,61)^r)+(g=L=a[P>>2])|0,i=(v=a[P+4>>2])+(b^i)|0,i=r>>>0<g>>>0?i+1|0:i,r=(g=a[_>>2])+r|0,i=a[_+4>>2]+i|0,o=r,r=r>>>0<g>>>0?i+1|0:i,i=(c=g=a[D+4>>2])>>>7|0,g=((127&c)<<25|(s=a[D>>2])>>>7)^we(s,c,1),i^=b,u=o,o=we(s,c,8)^g,i=(b^i)+r|0,P=g=u+o|0,g=i=o>>>0>g>>>0?i+1|0:i,a[h>>2]=P,a[h+4>>2]=i,r=(r=s)+(s=Q=a[N>>2])|0,i=(E=a[N+4>>2])+c|0,i=r>>>0<s>>>0?i+1|0:i,s=r,r=i,A=c=a[d+4>>2],i=c>>>6|0,c=((63&c)<<26|(N=a[d>>2])>>>6)^we(N,c,19),h=b^i,c=we(N,A,61)^c,r=(b^h)+r|0,d=i=c+s|0,i=i>>>0<c>>>0?r+1|0:r,r=(s=c=a[j+4>>2])>>>7|0,c=((127&s)<<25|(h=a[j>>2])>>>7)^we(h,s,1),o=b^r,c=we(h,s,8)^c,i=(b^o)+i|0,w=r=c+d|0,c=i=r>>>0<c>>>0?i+1|0:i,a[_+136>>2]=r,a[_+140>>2]=i,r=(I=a[F+4>>2])+s|0,s=i=(i=h)+(h=U=a[F>>2])|0,i=i>>>0<h>>>0?r+1|0:r,r=we(P,g,19),h=b,d=we(P,g,61)^((63&g)<<26|P>>>6)^r,i=(b^g>>>6^h)+i|0,o=s=d+s|0,r=s>>>0<d>>>0?i+1|0:i,h=s=a[T+4>>2],i=s>>>7|0,s=((127&s)<<25|(d=a[T>>2])>>>7)^we(d,s,1),i^=b,u=o,o=we(d,h,8)^s,i=(b^i)+r|0,y=s=u+o|0,s=i=s>>>0<o>>>0?i+1|0:i,a[_+144>>2]=y,a[_+148>>2]=i,r=(D=a[H+4>>2])+h|0,h=i=(i=d)+(d=F=a[H>>2])|0,i=i>>>0<d>>>0?r+1|0:r,r=we(w,c,19),d=b,o=we(w,c,61)^((63&c)<<26|w>>>6)^r,i=(b^c>>>6^d)+i|0,r=o>>>0>(u=h=o+h|0)>>>0?i+1|0:i,i=(d=h=a[B+4>>2])>>>7|0,h=((127&d)<<25|(o=a[B>>2])>>>7)^we(o,d,1),i^=b,m=u,u=we(o,d,8)^h,i=(b^i)+r|0,C=h=m+u|0,h=i=h>>>0<u>>>0?i+1|0:i,a[_+152>>2]=C,a[_+156>>2]=i,r=(T=a[G+4>>2])+d|0,d=i=(i=o)+(o=j=a[G>>2])|0,i=i>>>0<o>>>0?r+1|0:r,r=we(y,s,19),o=b,u=we(y,s,61)^((63&s)<<26|y>>>6)^r,r=(b^s>>>6^o)+i|0,p=d=u+d|0,i=d>>>0<u>>>0?r+1|0:r,u=d=a[k+4>>2],r=d>>>7|0,d=((127&d)<<25|(o=a[k>>2])>>>7)^we(o,d,1),S=b^r,d=we(o,u,8)^d,i=(b^S)+i|0,S=r=d+p|0,d=i=r>>>0<d>>>0?i+1|0:i,a[_+160>>2]=r,a[_+164>>2]=i,r=u+f|0,r=(i=o+M|0)>>>0<o>>>0?r+1|0:r,o=i,i=r,r=we(C,h,19),u=b,p=we(C,h,61)^((63&h)<<26|C>>>6)^r,i=(b^h>>>6^u)+i|0,i=(o=p+o|0)>>>0<p>>>0?i+1|0:i,p=o,o=i,i=(u=a[O+4>>2])>>>7|0,m=((127&u)<<25|(r=a[O>>2])>>>7)^we(r,u,1),i^=b,m=we(r,u,8)^m,i=(b^i)+o|0,i=(p=m+p|0)>>>0<m>>>0?i+1|0:i,m=p,o=i,a[_+168>>2]=p,a[_+172>>2]=i,i=r,r=u+A|0,i=i>>>0>(u=p=i+N|0)>>>0?r+1|0:r,r=we(S,d,19),p=b,x=we(S,d,61)^((63&d)<<26|S>>>6)^r,i=(b^d>>>6^p)+i|0,B=u=x+u|0,r=u>>>0<x>>>0?i+1|0:i,x=u=a[R+4>>2],i=u>>>7|0,u=((127&u)<<25|(p=a[R>>2])>>>7)^we(p,u,1),k=b^i,u=we(p,x,8)^u,r=(b^k)+r|0,B=i=u+B|0,u=r=i>>>0<u>>>0?r+1|0:r,a[_+176>>2]=i,a[_+180>>2]=r,r=g+x|0,r=(i=p+P|0)>>>0<p>>>0?r+1|0:r,p=i,i=r,r=we(m,o,19),x=b,k=we(m,o,61)^((63&o)<<26|m>>>6)^r,i=(b^o>>>6^x)+i|0,O=p=k+p|0,p=p>>>0<k>>>0?i+1|0:i,k=x=a[K+4>>2],i=x>>>7|0,x=((127&x)<<25|(r=a[K>>2])>>>7)^we(r,x,1),i^=b,R=O,O=we(r,k,8)^x,i=(b^i)+p|0,p=i=(x=R+O|0)>>>0<O>>>0?i+1|0:i,a[_+184>>2]=x,a[_+188>>2]=i,i=r,r=c+k|0,i=i>>>0>(c=w=i+w|0)>>>0?r+1|0:r,r=we(B,u,19),w=b,k=we(B,u,61)^((63&u)<<26|B>>>6)^r,r=(b^u>>>6^w)+i|0,i=r=(c=k+c|0)>>>0<k>>>0?r+1|0:r,r=we(L,v,1),w=b,k=we(L,v,8)^((127&v)<<25|L>>>7)^r,i=(b^v>>>7^w)+i|0,w=c=k+c|0,c=i=c>>>0<k>>>0?i+1|0:i,a[_+192>>2]=w,a[_+196>>2]=i,r=s+v|0,s=i=y+L|0,i=r=i>>>0<y>>>0?r+1|0:r,r=we(x,p,19),y=b,v=we(x,p,61)^((63&p)<<26|x>>>6)^r,r=(b^p>>>6^y)+i|0,i=r=(s=v+s|0)>>>0<v>>>0?r+1|0:r,r=we(Q,E,1),y=b,v=we(Q,E,8)^((127&E)<<25|Q>>>7)^r,i=(b^E>>>7^y)+i|0,y=s=v+s|0,s=i=s>>>0<v>>>0?i+1|0:i,a[_+200>>2]=y,a[_+204>>2]=i,r=h+E|0,h=i=C+Q|0,i=r=i>>>0<C>>>0?r+1|0:r,r=we(w,c,19),C=b,v=we(w,c,61)^((63&c)<<26|w>>>6)^r,r=(b^c>>>6^C)+i|0,i=r=(h=v+h|0)>>>0<v>>>0?r+1|0:r,r=we(U,I,1),C=b,v=we(U,I,8)^((127&I)<<25|U>>>7)^r,i=(b^I>>>7^C)+i|0,C=h=v+h|0,h=i=h>>>0<v>>>0?i+1|0:i,a[_+208>>2]=C,a[_+212>>2]=i,r=d+I|0,d=i=S+U|0,i=r=i>>>0<S>>>0?r+1|0:r,r=we(y,s,19),S=b,v=d,d=r,r=s>>>6|0,d=we(y,s,61)^d^((63&s)<<26|y>>>6),r=(b^r^S)+i|0,i=r=(s=v+d|0)>>>0<d>>>0?r+1|0:r,r=we(F,D,1),d=b,y=we(F,D,8)^((127&D)<<25|F>>>7)^r,i=(b^D>>>7^d)+i|0,d=s=y+s|0,s=i=s>>>0<y>>>0?i+1|0:i,a[_+216>>2]=d,a[_+220>>2]=i,r=o+D|0,o=i=m+F|0,i=r=i>>>0<m>>>0?r+1|0:r,r=we(C,h,19),y=b,m=o,o=r,r=h>>>6|0,o=we(C,h,61)^o^((63&h)<<26|C>>>6),r=(b^r^y)+i|0,i=r=o>>>0>(h=m+o|0)>>>0?r+1|0:r,r=we(j,T,1),o=b,y=we(j,T,8)^((127&T)<<25|j>>>7)^r,i=(b^T>>>7^o)+i|0,h=i=(o=h=y+h|0)>>>0<y>>>0?i+1|0:i,a[_+224>>2]=o,a[_+228>>2]=i,r=u+T|0,u=i=B+j|0,i=r=i>>>0<j>>>0?r+1|0:r,r=we(d,s,19),y=b,m=r,r=s>>>6|0,d=we(d,s,61)^m^((63&s)<<26|d>>>6),r=(b^r^y)+i|0,i=r=(s=d+u|0)>>>0<d>>>0?r+1|0:r,r=we(M,f,1),d=b,u=we(M,f,8)^((127&f)<<25|M>>>7)^r,i=(b^f>>>7^d)+i|0,d=s=u+s|0,s=i=s>>>0<u>>>0?i+1|0:i,a[_+232>>2]=d,a[_+236>>2]=i,r=p+f|0,u=i=x+M|0,i=r=i>>>0<x>>>0?r+1|0:r,r=we(o,h,19),p=b,f=r,r=h>>>6|0,o=we(o,h,61)^f^((63&h)<<26|o>>>6),r=(b^r^p)+i|0,r=o>>>0>(h=o+u|0)>>>0?r+1|0:r,o=h,i=r,r=we(N,A,1),u=b,o=(p=we(N,A,8)^((127&A)<<25|N>>>7)^r)+o|0,i=(b^A>>>7^u)+i|0,a[(h=_)+240>>2]=o,a[h+244>>2]=o>>>0<p>>>0?i+1|0:i,r=c+A|0,c=i=w+N|0,i=r=i>>>0<w>>>0?r+1|0:r,r=we(d,s,19),h=b,o=r,r=s>>>6|0,s=we(d,s,61)^o^((63&s)<<26|d>>>6),r=(b^r^h)+i|0,i=r=s>>>0>(c=s+c|0)>>>0?r+1|0:r,r=we(P,g,1),s=b,h=r,r=g>>>7|0,g=(o=c)+(c=we(P,g,8)^h^((127&g)<<25|P>>>7))|0,i=(b^r^s)+i|0,a[_+248>>2]=g,a[_+252>>2]=c>>>0>g>>>0?i+1|0:i}}function E(e){var t,n,r,i,s,a,c,u,d,h,p,f,g,m,y,v,A,w=0,S=0,C=0,E=0,I=0,_=0,x=0,P=0,k=0,B=0,O=0,N=0,D=0,j=0,T=0,M=0,F=0,R=0,L=0,Q=0,U=0,V=0,K=0,H=0,G=0,Y=0,z=0,Z=0,W=0,q=0,J=0,X=0,$=0,ee=0,te=0,ne=0,re=0,ie=0,oe=0,se=0;f=St(e),ne=l[e+2|0]|l[e+3|0]<<8|l[e+4|0]<<16|l[e+5|0]<<24,g=St(e+5|0),Z=b,re=l[e+7|0]|l[e+8|0]<<8|l[e+9|0]<<16|l[e+10|0]<<24,X=l[e+10|0]|l[e+11|0]<<8|l[e+12|0]<<16|l[e+13|0]<<24,m=St(e+13|0),J=b,V=l[e+15|0]|l[e+16|0]<<8|l[e+17|0]<<16|l[e+18|0]<<24,W=St(e+18|0),j=b,P=St(e+21|0),_=l[e+23|0]|l[e+24|0]<<8|l[e+25|0]<<16|l[e+26|0]<<24,C=St(e+26|0),w=b,K=l[e+28|0]|l[e+29|0]<<8|l[e+30|0]<<16|l[e+31|0]<<24,$=l[e+31|0]|l[e+32|0]<<8|l[e+33|0]<<16|l[e+34|0]<<24,y=St(e+34|0),z=b,H=l[e+36|0]|l[e+37|0]<<8|l[e+38|0]<<16|l[e+39|0]<<24,q=St(e+39|0),M=b,x=St(e+42|0),E=l[e+44|0]|l[e+45|0]<<8|l[e+46|0]<<16|l[e+47|0]<<24,I=St(e+47|0),C=2097151&((3&w)<<30|C>>>2),w=ze(t=2097151&((3&(S=b))<<30|I>>>2),0,136657,0)+C|0,S=b,S=w>>>0<C>>>0?S+1|0:S,C=(I=ze(n=(l[e+49|0]|l[e+50|0]<<8|l[e+51|0]<<16|l[e+52|0]<<24)>>>7&2097151,0,-997805,-1))+w|0,w=b+S|0,w=C>>>0<I>>>0?w+1|0:w,S=(I=ze(r=(l[e+52|0]|l[e+53|0]<<8|l[e+54|0]<<16|l[e+55|0]<<24)>>>4&2097151,0,654183,0))+C|0,C=b+w|0,C=S>>>0<I>>>0?C+1|0:C,N=S,S=St(e+55|0),I=ze(i=2097151&((1&(w=b))<<31|S>>>1),0,470296,0),w=b+C|0,w=(S=N+I|0)>>>0<I>>>0?w+1|0:w,C=(I=ze(s=(l[e+57|0]|l[e+58|0]<<8|l[e+59|0]<<16|l[e+60|0]<<24)>>>6&2097151,0,666643,0))+S|0,S=b+w|0,S=C>>>0<I>>>0?S+1|0:S,I=C,k=S,C=S,O=E>>>5&2097151,E=2097151&x,S=ze(a=(l[e+60|0]|l[e+61|0]<<8|l[e+62|0]<<16|l[e+63|0]<<24)>>>3|0,0,-683901,-1)+E|0,w=b,w=S>>>0<E>>>0?w+1|0:w,E=S,L=w,G=S=w-((S>>>0<4293918720)-1|0)|0,w=O,O=(2097151&S)<<11|(N=E- -1048576|0)>>>21,S>>=21,u=x=w+O|0,B=S=x>>>0<O>>>0?S+1|0:S,x=ze(x,S,-683901,-1),S=b+C|0,Q=w=x+I|0,O=w>>>0<x>>>0?S+1|0:S,S=ze(t,U,-997805,-1),w=b,w=(S=(C=_>>>5&2097151)+S|0)>>>0<C>>>0?w+1|0:w,_=ze(n,0,654183,0),C=b+w|0,C=(S=_+S|0)>>>0<_>>>0?C+1|0:C,w=(_=ze(r,0,470296,0))+S|0,S=b+C|0,S=w>>>0<_>>>0?S+1|0:S,C=(_=ze(i,T,666643,0))+w|0,w=b+S|0,x=C,C=C>>>0<_>>>0?w+1|0:w,_=2097151&P,w=ze(t,U,654183,0)+_|0,S=b,S=w>>>0<_>>>0?S+1|0:S,_=(P=ze(n,0,470296,0))+w|0,w=b+S|0,w=_>>>0<P>>>0?w+1|0:w,P=ze(r,0,666643,0),S=b+w|0,P=S=(_=P+_|0)>>>0<P>>>0?S+1|0:S,Y=S=S-((_>>>0<4293918720)-1|0)|0,C=(w=S>>>21|0)+C|0,C=(S=(F=x)+(x=(2097151&S)<<11|(D=_- -1048576|0)>>>21)|0)>>>0<x>>>0?C+1|0:C,x=S,F=C,R=S=C-((S>>>0<4293918720)-1|0)|0,k=k-((I>>>0<4293918720)-1|0)|0,h=I- -1048576|0,w=Q,Q=(2097151&S)<<11|(C=x- -1048576|0)>>>21,S=(S>>21)+O|0,S=((w=I=w+Q|0)>>>0<Q>>>0?S+1|0:S)-(((I=-2097152&h)>>>0>w>>>0)+k|0)|0,ie=(w=w-I|0)-(I=-2097152&(p=w- -1048576|0))|0,oe=S-((O=S-((w>>>0<4293918720)-1|0)|0)+(w>>>0<I>>>0)|0)|0,S=ze(u,B,136657,0)+x|0,w=F+b|0,Q=S-(C&=-2097152)|0,R=(w=S>>>0<x>>>0?w+1|0:w)-((S>>>0<C>>>0)+R|0)|0,N=E-(w=-2097152&N)|0,ee=L-((w>>>0>E>>>0)+G|0)|0,C=2097151&((7&(w=M))<<29|q>>>3),w=ze(a,0,136657,0)+C|0,S=b,S=w>>>0<C>>>0?S+1|0:S,C=(I=ze(s,0,-683901,-1))+w|0,w=b+S|0,x=C,E=C>>>0<I>>>0?w+1|0:w,w=ze(i,T,-683901,-1),S=b,S=(w=(C=H>>>6&2097151)+w|0)>>>0<C>>>0?S+1|0:S,I=ze(a,0,-997805,-1),C=b+S|0,C=(w=I+w|0)>>>0<I>>>0?C+1|0:C,S=(I=ze(s,0,136657,0))+w|0,w=b+C|0,w=S>>>0<I>>>0?w+1|0:w,I=S,L=w,G=w=w-((S>>>0<4293918720)-1|0)|0,H=S- -1048576|0,S=(C=w>>21)+E|0,E=w=(M=x)+(x=(2097151&w)<<11|H>>>21)|0,M=S=w>>>0<x>>>0?S+1|0:S,F=w=S-((w>>>0<4293918720)-1|0)|0,S=N,N=(2097151&w)<<11|(x=E- -1048576|0)>>>21,w=(w>>21)+ee|0,d=S=S+N|0,N=w=S>>>0<N>>>0?w+1|0:w,C=ze(S,w,-683901,-1),w=b+R|0,se=S=C+Q|0,R=S>>>0<C>>>0?w+1|0:w,q=_,Q=P,C=2097151&((7&(w=j))<<29|W>>>3),w=ze(t,U,470296,0)+C|0,S=b,S=w>>>0<C>>>0?S+1|0:S,C=ze(n,0,666643,0),S=b+S|0,P=w=C+w|0,C=w>>>0<C>>>0?S+1|0:S,S=ze(t,U,666643,0),w=b,w=(S=(_=V>>>6&2097151)+S|0)>>>0<_>>>0?w+1|0:w,_=S,W=w,ee=w=w-((S>>>0<4293918720)-1|0)|0,S=(S=w>>>21|0)+C|0,C=w=(j=P)+(P=(2097151&w)<<11|(V=_- -1048576|0)>>>21)|0,te=S=w>>>0<P>>>0?S+1|0:S,v=w=S-((w>>>0<4293918720)-1|0)|0,P=M-(((S=-2097152&x)>>>0>E>>>0)+F|0)|0,c=E-S|0,x=(2097151&w)<<11|(j=C- -1048576|0)>>>21,w=(w>>>21|0)+Q|0,w=(E=x+q|0)>>>0<x>>>0?w+1|0:w,E=((S=E)-(x=-2097152&D)|0)+(D=ze(u,B,-997805,-1))|0,S=b+(w-((8191&Y)+(S>>>0<x>>>0)|0)|0)|0,S=E>>>0<D>>>0?S+1|0:S,w=E,E=ze(d,N,136657,0),S=b+S|0,S=(w=w+E|0)>>>0<E>>>0?S+1|0:S,E=(x=ze(c,P,-683901,-1))+w|0,w=b+S|0,Y=w=E>>>0<x>>>0?w+1|0:w,F=S=w-((E>>>0<4293918720)-1|0)|0,M=(2097151&S)<<11|(D=E- -1048576|0)>>>21,S=(S>>21)+R|0,R=S=(x=M+se|0)>>>0<M>>>0?S+1|0:S,w=(w=(S=S-((x>>>0<4293918720)-1|0)|0)>>21)+oe|0,w=(Q=(2097151&S)<<11|(M=x- -1048576|0)>>>21)>>>0>(q=Q+ie|0)>>>0?w+1|0:w,Q=q,q=w,ie=x-(w=-2097152&M)|0,oe=R-((w>>>0>x>>>0)+S|0)|0,se=E-(w=-2097152&D)|0,A=Y-((w>>>0>E>>>0)+F|0)|0,w=(E=ze(u,B,654183,0))+(C-(S=-2097152&j)|0)|0,C=b+(te-((8191&v)+(S>>>0>C>>>0)|0)|0)|0,C=w>>>0<E>>>0?C+1|0:C,S=(E=ze(d,N,-997805,-1))+w|0,w=b+C|0,w=S>>>0<E>>>0?w+1|0:w,C=(E=ze(c,P,136657,0))+S|0,S=b+w|0,Y=C,j=C>>>0<E>>>0?S+1|0:S,x=I-(w=-2097152&H)|0,G=L-((w>>>0>I>>>0)+G|0)|0,I=2097151&((1&(w=z))<<31|y>>>1),S=ze(r,0,-683901,-1)+I|0,w=b,w=S>>>0<I>>>0?w+1|0:w,C=ze(i,T,136657,0),w=b+w|0,w=(S=C+S|0)>>>0<C>>>0?w+1|0:w,C=(I=ze(a,0,654183,0))+S|0,S=b+w|0,S=C>>>0<I>>>0?S+1|0:S,w=C,C=ze(s,0,-997805,-1),S=b+S|0,D=w=w+C|0,E=w>>>0<C>>>0?S+1|0:S,w=ze(n,0,-683901,-1),C=b,C=(w=(S=$>>>4&2097151)+w|0)>>>0<S>>>0?C+1|0:C,S=(I=ze(r,0,136657,0))+w|0,w=b+C|0,w=S>>>0<I>>>0?w+1|0:w,C=(I=ze(i,T,-997805,-1))+S|0,S=b+w|0,S=C>>>0<I>>>0?S+1|0:S,I=ze(a,0,470296,0),w=b+S|0,w=(C=I+C|0)>>>0<I>>>0?w+1|0:w,I=ze(s,0,654183,0),S=b+w|0,S=(C=I+C|0)>>>0<I>>>0?S+1|0:S,I=C,M=S,$=S=S-((C>>>0<4293918720)-1|0)|0,w=(w=S>>21)+E|0,E=S=(C=(2097151&S)<<11|(H=C- -1048576|0)>>>21)+D|0,z=w=S>>>0<C>>>0?w+1|0:w,L=S=w-((S>>>0<4293918720)-1|0)|0,w=x,x=(2097151&S)<<11|(D=E- -1048576|0)>>>21,S=(S>>21)+G|0,F=C=w+x|0,x=S=C>>>0<x>>>0?S+1|0:S,S=ze(C,S,-683901,-1),C=b+j|0,G=w=S+Y|0,j=w>>>0<S>>>0?C+1|0:C,D=z-(((w=-2097152&D)>>>0>E>>>0)+L|0)|0,R=E-w|0,w=(C=ze(u,B,470296,0))+(_-(S=-2097152&V)|0)|0,S=b+(W-((2047&ee)+(S>>>0>_>>>0)|0)|0)|0,S=w>>>0<C>>>0?S+1|0:S,C=ze(d,N,654183,0),S=b+S|0,S=(w=C+w|0)>>>0<C>>>0?S+1|0:S,E=ze(c,P,-997805,-1),C=b+S|0,C=(w=E+w|0)>>>0<E>>>0?C+1|0:C,S=(E=ze(F,x,136657,0))+w|0,w=b+C|0,w=S>>>0<E>>>0?w+1|0:w,C=(E=ze(R,D,-683901,-1))+S|0,S=b+w|0,z=S=C>>>0<E>>>0?S+1|0:S,L=S=S-((C>>>0<4293918720)-1|0)|0,w=(w=S>>21)+j|0,w=(S=(E=(2097151&S)<<11|(_=C- -1048576|0)>>>21)+G|0)>>>0<E>>>0?w+1|0:w,E=S,j=w,G=S=w-((S>>>0<4293918720)-1|0)|0,W=(2097151&S)<<11|(V=E- -1048576|0)>>>21,S=(S>>21)+A|0,S=(Y=W+se|0)>>>0<W>>>0?S+1|0:S,W=Y,Y=S,ee=E-(w=-2097152&V)|0,G=j-((w>>>0>E>>>0)+G|0)|0,te=C-(w=-2097152&_)|0,z=z-((w>>>0>C>>>0)+L|0)|0,E=2097151&((1&(w=J))<<31|m>>>1),S=ze(u,B,666643,0)+E|0,w=b,w=S>>>0<E>>>0?w+1|0:w,C=(E=ze(d,N,470296,0))+S|0,S=b+w|0,S=C>>>0<E>>>0?S+1|0:S,E=ze(c,P,654183,0),w=b+S|0,w=(C=E+C|0)>>>0<E>>>0?w+1|0:w,S=(E=ze(F,x,-997805,-1))+C|0,C=b+w|0,C=S>>>0<E>>>0?C+1|0:C,w=(E=ze(R,D,136657,0))+S|0,S=b+C|0,_=w,E=w>>>0<E>>>0?S+1|0:S,B=I-(w=-2097152&H)|0,j=M-((w>>>0>I>>>0)+$|0)|0,w=ze(t,U,-683901,-1),S=b,S=(w=(C=K>>>7&2097151)+w|0)>>>0<C>>>0?S+1|0:S,I=ze(n,0,136657,0),C=b+S|0,C=(w=I+w|0)>>>0<I>>>0?C+1|0:C,S=(I=ze(r,0,-997805,-1))+w|0,w=b+C|0,w=S>>>0<I>>>0?w+1|0:w,C=(I=ze(i,T,654183,0))+S|0,S=b+w|0,S=C>>>0<I>>>0?S+1|0:S,I=ze(a,0,666643,0),w=b+S|0,w=(C=I+C|0)>>>0<I>>>0?w+1|0:w,I=ze(s,0,470296,0),S=b+w|0,w=S=(C=I+C|0)>>>0<I>>>0?S+1|0:S,S=k>>21,I=(k=(2097151&k)<<11|h>>>21)+C|0,C=w+S|0,H=C=I>>>0<k>>>0?C+1|0:C,V=w=C-((I>>>0<4293918720)-1|0)|0,k=(2097151&w)<<11|(U=I- -1048576|0)>>>21,w=(w>>21)+j|0,J=C=k+B|0,k=w=C>>>0<k>>>0?w+1|0:w,C=ze(C,w,-683901,-1),S=b+E|0,_=w=C+_|0,E=w>>>0<C>>>0?S+1|0:S,w=ze(d,N,666643,0),C=b,C=(w=(S=X>>>4&2097151)+w|0)>>>0<S>>>0?C+1|0:C,S=(T=ze(c,P,470296,0))+w|0,w=b+C|0,w=S>>>0<T>>>0?w+1|0:w,C=(T=ze(F,x,654183,0))+S|0,S=b+w|0,S=C>>>0<T>>>0?S+1|0:S,w=C,C=ze(R,D,-997805,-1),S=b+S|0,S=(w=w+C|0)>>>0<C>>>0?S+1|0:S,C=(T=ze(J,k,136657,0))+w|0,w=b+S|0,N=w=C>>>0<T>>>0?w+1|0:w,j=w=w-((C>>>0<4293918720)-1|0)|0,B=(2097151&w)<<11|(T=C- -1048576|0)>>>21,w=(w>>21)+E|0,_=w=(E=_=B+_|0)>>>0<B>>>0?w+1|0:w,M=w=w-((E>>>0<4293918720)-1|0)|0,K=(2097151&w)<<11|(B=E- -1048576|0)>>>21,w=(w>>21)+z|0,$=X=K+te|0,X=K>>>0>X>>>0?w+1|0:w,S=I-(w=-2097152&U)|0,I=H-((w>>>0>I>>>0)+V|0)|0,w=(w=O>>21)+I|0,I=S=(O=(2097151&O)<<11|p>>>21)+S|0,H=w=S>>>0<O>>>0?w+1|0:w,V=S=w-((S>>>0<4293918720)-1|0)|0,O=w=S>>21,L=E,E=ze(K=(2097151&S)<<11|(U=I- -1048576|0)>>>21,w,-683901,-1),S=b+_|0,S=(w=L+E|0)>>>0<E>>>0?S+1|0:S,z=w-(E=-2097152&B)|0,M=S-((w>>>0<E>>>0)+M|0)|0,S=ze(K,O,136657,0)+C|0,w=N+b|0,w=S>>>0<C>>>0?w+1|0:w,L=S-(C=-2097152&T)|0,te=w-((S>>>0<C>>>0)+j|0)|0,w=ze(c,P,666643,0),S=b,S=(w=(C=re>>>7&2097151)+w|0)>>>0<C>>>0?S+1|0:S,E=ze(F,x,470296,0),C=b+S|0,C=(w=E+w|0)>>>0<E>>>0?C+1|0:C,S=(E=ze(R,D,654183,0))+w|0,w=b+C|0,w=S>>>0<E>>>0?w+1|0:w,C=ze(J,k,-997805,-1),w=b+w|0,B=S=C+S|0,C=S>>>0<C>>>0?w+1|0:w,E=2097151&((3&(w=Z))<<30|g>>>2),w=ze(F,x,666643,0)+E|0,S=b,S=w>>>0<E>>>0?S+1|0:S,E=ze(R,D,470296,0),S=b+S|0,S=(w=E+w|0)>>>0<E>>>0?S+1|0:S,E=(_=ze(J,k,654183,0))+w|0,w=b+S|0,P=w=E>>>0<_>>>0?w+1|0:w,T=w=w-((E>>>0<4293918720)-1|0)|0,S=B,B=(2097151&w)<<11|(_=E- -1048576|0)>>>21,w=(w>>21)+C|0,B=w=(C=x=S+B|0)>>>0<B>>>0?w+1|0:w,N=w=w-((C>>>0<4293918720)-1|0)|0,Z=(2097151&w)<<11|(x=C- -1048576|0)>>>21,w=(w>>21)+te|0,w=(j=Z+L|0)>>>0<Z>>>0?w+1|0:w,Z=j,j=w,w=(S=ze(K,O,-997805,-1))+C|0,C=b+B|0,C=w>>>0<S>>>0?C+1|0:C,re=w-(S=-2097152&x)|0,L=C-((w>>>0<S>>>0)+N|0)|0,w=ze(K,O,654183,0)+E|0,S=P+b|0,N=w-(C=-2097152&_)|0,F=(S=w>>>0<E>>>0?S+1|0:S)-((w>>>0<C>>>0)+T|0)|0,w=ze(R,D,666643,0),C=b,C=(w=(S=ne>>>5&2097151)+w|0)>>>0<S>>>0?C+1|0:C,S=(E=ze(J,k,470296,0))+w|0,w=b+C|0,_=S,C=S>>>0<E>>>0?w+1|0:w,E=2097151&f,S=ze(J,k,666643,0)+E|0,w=b,w=S>>>0<E>>>0?w+1|0:w,E=S,P=w,k=w=w-((S>>>0<4293918720)-1|0)|0,C=(S=w>>21)+C|0,C=(w=(B=_)+(_=(2097151&w)<<11|(x=E- -1048576|0)>>>21)|0)>>>0<_>>>0?C+1|0:C,_=w,T=C,B=w=C-((w>>>0<4293918720)-1|0)|0,D=(2097151&w)<<11|(C=_- -1048576|0)>>>21,w=(w>>21)+F|0,w=(N=D+N|0)>>>0<D>>>0?w+1|0:w,D=N,N=w,w=ze(K,O,470296,0)+_|0,S=T+b|0,S=w>>>0<_>>>0?S+1|0:S,_=w-(C&=-2097152)|0,C=S-((w>>>0<C>>>0)+B|0)|0,B=_,S=(_=ze(K,O,666643,0))+(E-(w=-2097152&x)|0)|0,w=b+(P-((w>>>0>E>>>0)+k|0)|0)|0,w=S>>>0<_>>>0?w+1|0:w,_=S,E=S,S=(S=w>>21)+C|0,x=w=B+(E=(2097151&w)<<11|E>>>21)|0,E=(2097151&(S=w>>>0<E>>>0?S+1|0:S))<<11|(C=w)>>>21,C=(w=S>>21)+N|0,P=S=E+D|0,E=(2097151&(C=(w=S)>>>0<E>>>0?C+1|0:C))<<11|w>>>21,w=(S=C>>21)+L|0,T=C=E+re|0,E=(2097151&(w=(S=C)>>>0<E>>>0?w+1|0:w))<<11|S>>>21,S=(C=w>>21)+j|0,B=w=E+Z|0,C=w,w=(w=(S=w>>>0<E>>>0?S+1|0:S)>>21)+M|0,w=(S=(C=(2097151&S)<<11|C>>>21)+z|0)>>>0<C>>>0?w+1|0:w,N=S,C=S,S=(S=w>>21)+X|0,D=w=(C=(2097151&w)<<11|C>>>21)+$|0,E=(2097151&(S=w>>>0<C>>>0?S+1|0:S))<<11|(C=w)>>>21,C=(w=S>>21)+G|0,j=S=E+ee|0,E=(2097151&(C=(w=S)>>>0<E>>>0?C+1|0:C))<<11|w>>>21,w=(S=C>>21)+Y|0,M=C=E+W|0,E=(2097151&(w=(S=C)>>>0<E>>>0?w+1|0:w))<<11|S>>>21,S=(C=w>>21)+oe|0,ne=w=E+ie|0,C=w,w=(w=(S=w>>>0<E>>>0?S+1|0:S)>>21)+q|0,w=(S=(C=(2097151&S)<<11|C>>>21)+Q|0)>>>0<C>>>0?w+1|0:w,Z=S,C=S,S=w>>21,w=(2097151&w)<<11|C>>>21,E=I-(C=-2097152&U)|0,C=(H-((C>>>0>I>>>0)+V|0)|0)+S|0,U=w=w+E|0,O=(2097151&(C=w>>>0<E>>>0?C+1|0:C))<<11|w>>>21,E=w=C>>21,C=2097151&_,S=ze(O,w,666643,0)+C|0,w=b,_=S,I=w=S>>>0<C>>>0?w+1|0:w,o[0|e]=S,o[e+1|0]=(255&w)<<24|S>>>8,C=2097151&x,w=ze(O,E,470296,0)+C|0,S=b,C=(I>>21)+(S=w>>>0<C>>>0?S+1|0:S)|0,C=(x=(k=(2097151&I)<<11|_>>>21)+w|0)>>>0<k>>>0?C+1|0:C,o[e+4|0]=(2047&C)<<21|x>>>11,o[e+3|0]=(7&C)<<29|x>>>3,P&=2097151,S=ze(O,E,654183,0)+P|0,w=b,w=S>>>0<P>>>0?w+1|0:w,P=S,S=w,S=(w=C>>21)+S|0,S=(C=(k=P)+(P=(2097151&C)<<11|x>>>21)|0)>>>0<P>>>0?S+1|0:S,P=C,w=S,o[e+6|0]=(63&w)<<26|C>>>6,k=0,C=31&((65535&I)<<16|_>>>16),S=_=2097151&x,o[e+2|0]=C|S<<5,I=2097151&T,C=ze(O,E,-997805,-1)+I|0,S=b,S=C>>>0<I>>>0?S+1|0:S,I=C,C=S,C=(S=w>>21)+C|0,S=w=(x=I)+(I=(2097151&w)<<11|P>>>21)|0,C=w>>>0<I>>>0?C+1|0:C,o[e+9|0]=(511&C)<<23|w>>>9,o[e+8|0]=(1&C)<<31|w>>>1,I=0,x=(w=P&=2097151)<<2,w=k,o[e+5|0]=x|(524287&w)<<13|_>>>19,x=2097151&B,_=ze(O,E,136657,0)+x|0,w=b,w=_>>>0<x>>>0?w+1|0:w,x=_,_=w,k=(2097151&(w=C))<<11|S>>>21,w=(C=w>>21)+_|0,w=(C=x=k+x|0)>>>0<k>>>0?w+1|0:w,o[e+12|0]=(4095&w)<<20|C>>>12,o[e+11|0]=(15&w)<<28|C>>>4,_=0,B=(S=x=2097151&S)<<7,S=I,I=P,o[e+7|0]=B|(16383&S)<<18|I>>>14,I=(S=ze(O,E,-683901,-1))+(E=2097151&N)|0,S=b,S=E>>>0>I>>>0?S+1|0:S,E=I,I=S,P=(2097151&(S=w))<<11|C>>>21,S=(w>>=21)+I|0,S=(w=E=P+E|0)>>>0<P>>>0?S+1|0:S,o[e+14|0]=(127&S)<<25|w>>>7,E=(C=P=2097151&C)<<4,C=_,o[e+10|0]=E|(131071&C)<<15|x>>>17,_=(2097151&(C=S))<<11|w>>>21,C=(S>>=21)+(E=0)|0,C=(I=_+(2097151&D)|0)>>>0<_>>>0?C+1|0:C,o[e+17|0]=(1023&C)<<22|I>>>10,o[e+16|0]=(3&C)<<30|I>>>2,_=0,S=(w=k=2097151&w)<<1,w=E,o[e+13|0]=S|(1048575&w)<<12|P>>>20,w=S=C>>21,w=(C=(E=(2097151&C)<<11|I>>>21)+(2097151&j)|0)>>>0<E>>>0?w+1|0:w,E=C,o[e+20|0]=(8191&w)<<19|C>>>13,C=w,o[e+19|0]=(31&w)<<27|E>>>5,x=0,S=(w=O=2097151&I)<<6,w=_,o[e+15|0]=S|(32767&w)<<17|k>>>15,w=C>>21,P=I=(_=(2097151&C)<<11|E>>>21)+(2097151&M)|0,I=I>>>0<_>>>0?w+1|0:w,o[e+21|0]=P,S=(w=E)<<3,w=x,o[e+18|0]=S|(262143&w)<<14|O>>>18,S=P,o[e+22|0]=(255&I)<<24|S>>>8,C=I>>21,C=(S=(E=(2097151&I)<<11|S>>>21)+(2097151&ne)|0)>>>0<E>>>0?C+1|0:C,E=S,o[e+25|0]=(2047&C)<<21|S>>>11,o[e+24|0]=(7&C)<<29|S>>>3,w=S=C>>21,w=(C=(_=(2097151&C)<<11|E>>>21)+(2097151&Z)|0)>>>0<_>>>0?w+1|0:w,o[e+27|0]=(63&w)<<26|C>>>6,_=0,S=E&=2097151,o[e+23|0]=31&((65535&I)<<16|P>>>16)|S<<5,S=w>>21,S=(w=(x=(2097151&w)<<11|C>>>21)+(2097151&U)|0)>>>0<x>>>0?S+1|0:S,o[e+31|0]=(131071&S)<<15|w>>>17,o[e+30|0]=(511&S)<<23|w>>>9,o[e+29|0]=(1&S)<<31|w>>>1,I=0,S=(C=x=2097151&C)<<2,C=_,o[e+26|0]=S|(524287&C)<<13|E>>>19,S=e,e=I,o[S+28|0]=w<<7|(16383&e)<<18|x>>>14}function I(e,t,n,r,i,s,h,p,f,g,m,w){var S,C,E=0,I=0,x=0,P=0,k=0,N=0,j=0,T=0,M=0,F=0,L=0,Q=0,U=0,V=0,K=0,H=0,G=0,Y=0,z=0,Z=0,W=0,q=0,J=0,$=0,ee=0,te=0,ne=0,re=0,ie=0,oe=0,se=0,ae=0,ce=0,ue=0,de=0,he=0,pe=0,fe=0,ge=0,me=0,ye=0,ve=0,Ae=0,be=0,Se=0;if(y=S=y+-64|0,C=_(f)){if(a[S+32>>2]=0,a[S+36>>2]=0,a[S+24>>2]=0,a[S+28>>2]=0,a[S+20>>2]=h,a[S+16>>2]=s,a[S+12>>2]=i,a[S+8>>2]=r,a[S+4>>2]=f,a[S>>2]=C,a[S+56>>2]=0,a[S+52>>2]=n,a[S+48>>2]=n,a[S+44>>2]=t,a[S+40>>2]=e,e=0,y=k=y-48|0,!((t=le(S))||(t=-26,w-3>>>0<4294967294))){if(n=a[S+44>>2],t=a[S+48>>2],a[k>>2]=0,r=a[S+40>>2],a[k+28>>2]=t,a[k+12>>2]=-1,a[k+8>>2]=r,t=((r=n>>>0>(r=t<<3)>>>0?n:r)>>>0)/((n=t<<2)>>>0)|0,a[k+20>>2]=t,a[k+24>>2]=t<<2,a[k+16>>2]=u(t,n),t=a[S+52>>2],a[k+36>>2]=w,a[k+32>>2]=t,y=r=y-80|0,i=-25,!(!k|!S))if(t=_(a[k+20>>2]<<3),a[k+4>>2]=t,t){y=h=y-16|0,i=-22;e:if(!(!k|!(t=a[k+16>>2]))&&1024==(((s=t<<10)>>>0)/(t>>>0)|0)&&(t=_(12),a[k>>2]=t,t)){a[t>>2]=0,a[t+4>>2]=0,s>>>0>4294967168?t=48:(s>>>0>=4294967168?(a[8952]=48,n=0):(n=0,(t=_(76+(U=s>>>0<11?16:s+11&-8)|0))&&(n=t-8|0,63&t?(L=(-8&(j=a[(x=t-4|0)>>2]))-(N=(t=((t=(t+63&-64)-8|0)-n>>>0>15?0:64)+t|0)-n|0)|0,3&j?(a[t+4>>2]=L|1&a[t+4>>2]|2,a[4+(L=t+L|0)>>2]=1|a[L+4>>2],a[x>>2]=N|1&a[x>>2]|2,a[4+(L=n+N|0)>>2]=1|a[L+4>>2],D(n,N)):(n=a[n>>2],a[t+4>>2]=L,a[t>>2]=n+N)):t=n,3&(n=a[t+4>>2])&&((N=-8&n)>>>0<=U+16>>>0||(a[t+4>>2]=U|1&n|2,n=t+U|0,U=N-U|0,a[n+4>>2]=3|U,a[4+(N=t+N|0)>>2]=1|a[N+4>>2],D(n,U))),n=t+8|0)),(t=n)?(a[h+12>>2]=t,t=0):t=48),a[8952]=t;t:{if(t)a[h+12>>2]=0;else if(t=a[h+12>>2])break t;O(a[k>>2]),a[k>>2]=0;break e}a[a[k>>2]>>2]=t,a[a[k>>2]+4>>2]=t,a[a[k>>2]+8>>2]=s,i=0}if(y=h+16|0,i)Re(k,a[S+56>>2]);else{if(s=a[k+36>>2],h=t=y,y=t=t-448&-64,!r|!S||(Je(i=t- -64|0,0,0,64),Ot(n=t+60|0,a[S+48>>2]),on(i,n,4,0),Ot(n,a[S+4>>2]),on(i,n,4,0),Ot(n,a[S+44>>2]),on(i,n,4,0),Ot(n,a[S+40>>2]),on(i,n,4,0),Ot(n,19),on(i,n,4,0),Ot(n,s),on(i,n,4,0),Ot(n,a[S+12>>2]),on(i,n,4,0),(n=a[S+8>>2])&&(on(t- -64|0,n,a[S+12>>2],0),1&o[S+56|0]&&(bn(a[S+8>>2],a[S+12>>2]),a[S+12>>2]=0)),Ot(n=t+60|0,a[S+20>>2]),on(t- -64|0,n,4,0),(n=a[S+16>>2])&&on(t- -64|0,n,a[S+20>>2],0),Ot(n=t+60|0,a[S+28>>2]),on(t- -64|0,n,4,0),(n=a[S+24>>2])&&(on(t- -64|0,n,a[S+28>>2],0),2&l[S+56|0]&&(bn(a[S+24>>2],a[S+28>>2]),a[S+28>>2]=0)),Ot(n=t+60|0,a[S+36>>2]),on(t- -64|0,n,4,0),(n=a[S+32>>2])&&on(t- -64|0,n,a[S+36>>2],0),kt(t- -64|0,r,64)),y=h,bn(r- -64|0,8),i=0,y=t=y-1024|0,a[k+28>>2])for(s=r+68|0,n=r- -64|0;Ot(n,0),Ot(s,i),R(t,1024,r,72),Ke(a[a[k>>2]+4>>2]+(u(a[k+24>>2],i)<<10)|0,t),Ot(n,1),R(t,1024,r,72),Ke(1024+(a[a[k>>2]+4>>2]+(u(a[k+24>>2],i)<<10)|0)|0,t),(i=i+1|0)>>>0<c[k+28>>2];);bn(t,1024),y=t+1024|0,bn(r,72),i=0}}else i=-22;if(y=r+80|0,!(t=i)){if(a[k+8>>2])for(;;){if(r=e,ge=0,y=i=y-32|0,!(!k|!a[k+28>>2]))for(a[i+16>>2]=r,t=1;;){if(o[i+24|0]=ge,me=0,e=0,t)for(;;){a[i+28>>2]=0,e=a[i+28>>2],a[i+8>>2]=a[i+24>>2],a[i+12>>2]=e,a[i+20>>2]=me,e=a[i+20>>2],a[i>>2]=a[i+16>>2],a[i+4>>2]=e,e=0;e:if(k){t:{if(2==a[k+36>>2]){if(ye=a[k+4>>2],ve=1,(h=a[i>>2])|(s=l[i+8|0])>>>0>1)break t}else ye=a[k+4>>2];if(y=t=y-4096|0,An(t+3072|0),An(t+2048|0),!(!k|!i)&&(a[t+2048>>2]=a[i>>2],a[t+2052>>2]=0,a[t+2056>>2]=a[i+4>>2],a[t+2060>>2]=0,a[t+2064>>2]=l[i+8|0],a[t+2068>>2]=0,a[t+2072>>2]=a[k+16>>2],a[t+2076>>2]=0,a[t+2080>>2]=a[k+8>>2],a[t+2084>>2]=0,a[t+2088>>2]=a[k+36>>2],a[t+2092>>2]=0,a[k+20>>2]))for(;(n=127&e)||(h=s=a[t+2100>>2],x=s+1|0,h=(s=a[t+2096>>2]+1|0)?h:x,a[t+2096>>2]=s,a[t+2100>>2]=h,An(t),An(s=t+1024|0),B(h=t+3072|0,t+2048|0,t),B(h,t,s)),s=a[4+(n=(t+1024|0)+(n<<3)|0)>>2],a[(h=(e<<3)+ye|0)>>2]=a[n>>2],a[h+4>>2]=s,(e=e+1|0)>>>0<c[k+20>>2];);y=t+4096|0,s=l[i+8|0],h=a[i>>2],ve=0}if(e=255&s,!((h=h?0:!e<<1)>>>0>=(n=a[k+20>>2])>>>0))for(t=a[k+24>>2],e=(s=(u(t,a[i+4>>2])+h|0)+u(e,n)|0)+((s>>>0)%(t>>>0)|0?-1:t-1|0)|0;;){Ae=1==((s>>>0)%(t>>>0)|0)?s-1|0:e,U=a[k+28>>2],ve?(e=a[k>>2],N=a[e+4>>2]+(Ae<<10)|0):(e=a[k>>2],N=(h<<3)+ye|0),n=a[N>>2],N=a[N+4>>2],a[i+12>>2]=h,U=(N>>>0)%(U>>>0)|0,N=a[i+4>>2],L=l[i+8|0]?U:N,I=a[e+4>>2],P=a[i>>2],M=I+(u(t,e=P?U:L)<<10)|0,e=(0|e)==(0|N);t:if(a[i>>2])t=a[k+24>>2],U=a[k+20>>2],t=e?a[i+12>>2]+(t+(-1^U)|0)|0:(t-U|0)-!a[i+12>>2]|0,x=0,3!=(0|(e=l[i+8|0]))&&(x=u(U,e+1|0));else{if(!(t=l[i+8|0])){t=a[i+12>>2]-1|0,x=0;break t}if(t=u(t,a[k+20>>2]),U=a[i+12>>2],e){t=(t+U|0)-1|0,x=0;break t}t=t-!U|0,x=0}e=x+(L=t-1|0)|0,ze(n,0,n,0),ze(t,0,b,0),N=e-(t=b)|0,U=a[k+24>>2],E=0;t:{n:{r:{i:{o:{s:{a:{l:{c:{u:{if(t=(e>>>0<L>>>0)-(e>>>0<t>>>0)|0){if(!U)break u;break c}v=N-u((N>>>0)/(U>>>0)|0,U)|0,A=0,b=0;break t}if(!N)break l;break a}if(!((e=U-1|0)&U))break s;x=0-(L=(d(U)+33|0)-d(t)|0)|0;break i}v=0,A=t,b=0;break t}if((e=32-d(t)|0)>>>0<31)break o;break r}if(v=e&N,A=0,1==(0|U))break n;e=U?31-d(U-1^U)|0:32,b=(63&e)>>>0>=32?0:t>>>e|0;break t}L=e+1|0,x=63-e|0}if(n=31&(e=63&L),e>>>0>=32?(e=0,j=t>>>n|0):(e=t>>>n|0,j=((1<<n)-1&t)<<32-n|N>>>n),n=e,x=31&(e=63&x),e>>>0>=32?(e=N<<x,N=0):(e=(1<<x)-1&N>>>32-x|t<<x,N<<=x),t=e,L)for(F=-1!=(0|(x=U-1|0))?0:-1;j=(e=j<<1|t>>>31)-(H=U&(V=F-((n=n<<1|j>>>31)+(e>>>0>x>>>0)|0)>>31))|0,n=n-(e>>>0<H>>>0)|0,t=t<<1|N>>>31,N=E|N<<1,E=1&V,L=L-1|0;);v=j,A=n,b=t<<1|N>>>31;break t}v=N,A=t,t=0}b=t}if(b=A,e=(v<<10)+M|0,U=I+(Ae<<10)|0,n=I+(s<<10)|0,P)B(U,e,n);else{for(y=t=y-2048|0,yn(N=t+1024|0,e),et(N,U),yn(t,N),U=0,N=0;x=a[(L=(e=(t+1024|0)+(N<<7)|0)- -64|0)>>2],j=a[e+100>>2],T=x,F=a[L+4>>2],Q=a[e+96>>2],x=a[e+32>>2],I=a[e+36>>2],j=we(Q^(E=it(a[e>>2],a[e+4>>2],x,I)),j^(P=b),32),I=we(T=(F=it(T,F,j,M=b))^x,I^(x=b),24),T=x,ee=we((H=it(E,P,I,x=b))^j,(G=b)^M,16),x=we(I^(ne=it(F,T,ee,te=b)),(ue=b)^x,63),j=b,I=a[e+108>>2],K=a[e+72>>2],Q=a[e+76>>2],T=a[e+104>>2],E=a[e+40>>2],P=a[e+44>>2],I=we(T^(M=it(a[e+8>>2],a[e+12>>2],E,P)),I^(F=b),32),P=we(T=(re=it(K,Q,I,V=b))^E,P^(E=b),24),Q=re,he=we((T=I)^(re=it(M,F,P,I=b)),(de=b)^V,16),I=we(P^(ie=it(Q,E,he,pe=b)),(oe=b)^I,63),E=b,P=a[e+116>>2],K=a[e+80>>2],Q=a[e+84>>2],T=a[e+112>>2],M=a[e+48>>2],F=a[e+52>>2],P=we(T^(V=it(a[e+16>>2],a[e+20>>2],M,F)),P^(W=b),32),F=we(Q=(T=it(K,Q,P,se=b))^M,F^(M=b),24),K=T,Q=M,se=we(P^(W=it(V,W,F,M=b)),se^(T=b),16),P=we(F^(Q=it(K,Q,se,ae=b)),(q=b)^M,63),M=b,F=a[e+124>>2],ce=a[e+88>>2],J=a[e+92>>2],K=a[e+120>>2],V=a[e+56>>2],Y=a[e+60>>2],F=we(K^(z=it(a[e+24>>2],a[e+28>>2],V,Y)),F^(Z=b),32),J=Y=we(K=(fe=it(ce,J,F,$=b))^V,Y^(V=b),24),Z=we((K=F)^(Y=it(z,Z,Y,F=b)),(z=b)^$,16),F=we(J^(fe=it(fe,V,Z,$=b)),(ce=b)^F,63),V=b,J=Q,K=q,Q=we(Z^(H=it(H,G,I,E)),$^(G=b),32),I=we((Z=it(J,K,Q,q=b))^I,(K=E)^(E=b),24),G=it(K=H,G,I,H=b),a[e>>2]=G,$=b,a[e+4>>2]=$,G=we(G^Q,q^$,16),a[e+120>>2]=G,Q=b,a[e+124>>2]=Q,E=it(Z,E,G,Q),a[e+80>>2]=E,G=b,a[e+84>>2]=G,be=e,Se=we(I^E,H^G,63),a[be+40>>2]=Se,a[e+44>>2]=b,G=we(ee^(E=it(re,de,P,M)),te^(H=b),32),I=we(Q=P^(te=it(fe,ce,G,ee=b)),M^(P=b),24),M=it(Q=E,H,I,E=b),a[e+8>>2]=M,H=b,a[e+12>>2]=H,M=we(M^G,H^ee,16),a[e+96>>2]=M,H=b,a[e+100>>2]=H,P=it(te,P,M,H),a[e+88>>2]=P,M=b,a[e+92>>2]=M,be=e,Se=we(I^P,E^M,63),a[be+48>>2]=Se,a[e+52>>2]=b,M=we(he^(E=it(W,T,F,V)),pe^(P=b),32),I=we(T=F^(G=it(ne,ue,M,H=b)),V^(F=b),24),P=it(T=E,P,I,E=b),a[e+16>>2]=P,V=b,a[e+20>>2]=V,P=we(P^M,V^H,16),a[e+104>>2]=P,M=b,a[e+108>>2]=M,P=it(G,F,P,M),a[L>>2]=P,T=L,L=b,a[T+4>>2]=L,be=e,Se=we(I^P,E^L,63),a[be+56>>2]=Se,a[e+60>>2]=b,I=it(Y,z,x,j),F=it(ie,oe,P=we(se^I,ae^(E=b),32),M=b),I=it(I,E,L=we(T=x^F,j^(x=b),24),j=b),a[e+24>>2]=I,E=b,a[e+28>>2]=E,I=we(I^P,E^M,16),a[e+112>>2]=I,E=b,a[e+116>>2]=E,x=it(F,x,I,E),a[e+72>>2]=x,I=b,a[e+76>>2]=I,be=e,Se=we(x^L,I^j,63),a[be+32>>2]=Se,a[e+36>>2]=b,8!=(0|(N=N+1|0)););for(;N=a[512+(e=(t+1024|0)+(U<<4)|0)>>2],L=a[e+772>>2],T=N,Q=a[e+516>>2],E=a[e+768>>2],N=a[e+256>>2],x=a[e+260>>2],L=we(E^(j=it(a[e>>2],a[e+4>>2],N,x)),L^(I=b),32),x=we(T=(P=it(T,Q,L,E=b))^N,x^(N=b),24),T=N,H=we((F=it(j,I,x,N=b))^L,(V=b)^E,16),N=we(x^(ee=it(P,T,H,G=b)),(te=b)^N,63),L=b,x=a[e+780>>2],K=a[e+520>>2],Q=a[e+524>>2],T=a[e+776>>2],j=a[e+264>>2],I=a[e+268>>2],x=we(T^(E=it(a[e+8>>2],a[e+12>>2],j,I)),x^(P=b),32),I=we(T=(ne=it(K,Q,x,M=b))^j,I^(j=b),24),Q=ne,re=we((T=x)^(ne=it(E,P,I,x=b)),(ue=b)^M,16),x=we(I^(he=it(Q,j,re,de=b)),(pe=b)^x,63),j=b,I=a[e+900>>2],K=a[e+640>>2],Q=a[e+644>>2],T=a[e+896>>2],E=a[e+384>>2],P=a[e+388>>2],I=we(T^(M=it(a[e+128>>2],a[e+132>>2],E,P)),I^(ie=b),32),P=we(T=(W=it(K,Q,I,oe=b))^E,P^(E=b),24),Q=W,T=E,oe=we(I^(ie=it(M,ie,P,E=b)),oe^(W=b),16),I=we(P^(T=it(Q,T,oe,se=b)),(ae=b)^E,63),E=b,P=a[e+908>>2],ce=a[e+648>>2],J=a[e+652>>2],K=a[e+904>>2],M=a[e+392>>2],Q=a[e+396>>2],P=we(K^(q=it(a[e+136>>2],a[e+140>>2],M,Q)),P^(Y=b),32),J=Q=we(K=(Z=it(ce,J,P,z=b))^M,Q^(M=b),24),Y=we((K=P)^(Q=it(q,Y,Q,P=b)),(q=b)^z,16),P=we(J^(Z=it(Z,M,Y,z=b)),($=b)^P,63),M=b,J=T,K=ae,T=we(Y^(F=it(F,V,x,j)),z^(V=b),32),x=we((Y=it(J,K,T,ae=b))^x,(K=j)^(j=b),24),V=it(K=F,V,x,F=b),a[e>>2]=V,z=b,a[e+4>>2]=z,V=we(V^T,z^ae,16),a[e+904>>2]=V,T=b,a[e+908>>2]=T,j=it(Y,j,V,T),a[e+640>>2]=j,V=b,a[e+644>>2]=V,be=e,Se=we(x^j,F^V,63),a[be+264>>2]=Se,a[e+268>>2]=b,V=we(H^(j=it(ne,ue,I,E)),G^(F=b),32),x=we(x=I^(G=it(Z,$,V,H=b)),E^(I=b),24),E=it(E=j,F,x,j=b),a[e+8>>2]=E,F=b,a[e+12>>2]=F,E=we(E^V,F^H,16),a[e+768>>2]=E,F=b,a[e+772>>2]=F,I=it(G,I,E,F),a[e+648>>2]=I,E=b,a[e+652>>2]=E,be=e,Se=we(I^x,E^j,63),a[be+384>>2]=Se,a[e+388>>2]=b,j=it(ie,W,P,M),V=it(ee,te,E=we(re^j,de^(I=b),32),F=b),I=it(T=j,I,x=we(x=P^V,M^(P=b),24),j=b),a[e+128>>2]=I,M=b,a[e+132>>2]=M,I=we(I^E,M^F,16),a[e+776>>2]=I,E=b,a[e+780>>2]=E,I=it(V,P,I,E),a[e+512>>2]=I,E=b,a[e+516>>2]=E,be=e,Se=we(I^x,E^j,63),a[be+392>>2]=Se,a[e+396>>2]=b,I=we(oe^(x=it(Q,q,N,L)),se^(j=b),32),N=we((P=it(he,pe,I,E=b))^N,(T=L)^(L=b),24),j=it(T=x,j,N,x=b),a[e+136>>2]=j,M=b,a[e+140>>2]=M,j=we(I^j,E^M,16),a[e+896>>2]=j,I=b,a[e+900>>2]=I,L=it(P,L,j,I),a[e+520>>2]=L,j=b,a[e+524>>2]=j,be=e,Se=we(N^L,x^j,63),a[be+256>>2]=Se,a[e+260>>2]=b,8!=(0|(U=U+1|0)););yn(n,t),et(n,t+1024|0),y=t+2048|0}if((h=h+1|0)>>>0>=c[k+20>>2])break e;s=s+1|0,e=Ae+1|0,t=a[k+24>>2]}}if(!((e=a[k+28>>2])>>>0>(me=me+1|0)>>>0))break}if(t=e,4==(0|(ge=ge+1|0)))break}if(y=i+32|0,!((e=r+1|0)>>>0<c[k+8>>2]))break}if(y=t=y-2048|0,!(!S|!k)){if(yn(t+1024|0,(a[a[k>>2]+4>>2]+(a[k+24>>2]<<10)|0)-1024|0),c[k+28>>2]>=2)for(e=1;n=a[k+24>>2],et(t+1024|0,(a[a[k>>2]+4>>2]+(u(n,e)+n<<10)|0)-1024|0),(e=e+1|0)>>>0<c[k+28>>2];);for(n=t+1024|0,e=0;ot(i=(r=e<<3)+t|0,a[(r=n+r|0)>>2],a[r+4>>2]),128!=(0|(e=e+1|0)););R(a[S>>2],a[S+4>>2],t,1024),bn(n,1024),bn(t,1024),Re(k,a[S+56>>2])}y=t+2048|0,t=0}}y=k+48|0,n=t;e:if(t)bn(C,f);else{if(!(!g|!m)){y=e=y-16|0,t=-31;t:{n:{r:{i:switch(w-1|0){case 1:if(m>>>0<13)break n;t=l[1347]|l[1348]<<8|l[1349]<<16|l[1350]<<24,n=l[1343]|l[1344]<<8|l[1345]<<16|l[1346]<<24,o[0|g]=n,o[g+1|0]=n>>>8,o[g+2|0]=n>>>16,o[g+3|0]=n>>>24,o[g+4|0]=t,o[g+5|0]=t>>>8,o[g+6|0]=t>>>16,o[g+7|0]=t>>>24,t=l[1352]|l[1353]<<8|l[1354]<<16|l[1355]<<24,n=l[1348]|l[1349]<<8|l[1350]<<16|l[1351]<<24,o[g+5|0]=n,o[g+6|0]=n>>>8,o[g+7|0]=n>>>16,o[g+8|0]=n>>>24,o[g+9|0]=t,o[g+10|0]=t>>>8,o[g+11|0]=t>>>16,o[g+12|0]=t>>>24,r=-12,n=12;break r;case 0:break i;default:break t}if(m>>>0<12)break n;t=l[1335]|l[1336]<<8|l[1337]<<16|l[1338]<<24,n=l[1331]|l[1332]<<8|l[1333]<<16|l[1334]<<24,o[0|g]=n,o[g+1|0]=n>>>8,o[g+2|0]=n>>>16,o[g+3|0]=n>>>24,o[g+4|0]=t,o[g+5|0]=t>>>8,o[g+6|0]=t>>>16,o[g+7|0]=t>>>24,t=l[1339]|l[1340]<<8|l[1341]<<16|l[1342]<<24,o[g+8|0]=t,o[g+9|0]=t>>>8,o[g+10|0]=t>>>16,o[g+11|0]=t>>>24,r=-11,n=11}if(t=le(S))break t;if(Le(t=e+5|0,19),!((r=r+m|0)>>>0<=(t=Ne(t))>>>0)&&(n=pt(n+g|0,e+5|0,t+1|0),!((r=r-t|0)>>>0<4)&&(o[0|(t=t+n|0)]=36,o[t+1|0]=109,o[t+2|0]=61,o[t+3|0]=0,Le(n=e+5|0,a[S+44>>2]),!((r=r-3|0)>>>0<=(n=Ne(n))>>>0)&&(t=pt(t+3|0,e+5|0,n+1|0),!((r=r-n|0)>>>0<4)&&(o[0|(t=t+n|0)]=44,o[t+1|0]=116,o[t+2|0]=61,o[t+3|0]=0,Le(n=e+5|0,a[S+40>>2]),!((r=r-3|0)>>>0<=(n=Ne(n))>>>0)&&(t=pt(t+3|0,e+5|0,n+1|0),!((r=r-n|0)>>>0<4)&&(o[0|(t=t+n|0)]=44,o[t+1|0]=112,o[t+2|0]=61,o[t+3|0]=0,Le(n=e+5|0,a[S+48>>2]),!((r=r-3|0)>>>0<=(n=Ne(n))>>>0)&&(t=pt(t+3|0,e+5|0,n+1|0),!((r=r-n|0)>>>0<2)&&(o[0|(t=t+n|0)]=36,o[t+1|0]=0,X(n=t+1|0,r=r-1|0,a[S+16>>2],a[S+20>>2],3)))))))))){if(t=-31,(i=(i=r)-(r=Ne(n))|0)>>>0<2)break t;o[0|(t=n+r|0)]=36,o[t+1|0]=0,t=X(t+1|0,i-1|0,a[S>>2],a[S+4>>2],3)?0:-31;break t}}t=-31}if(y=e+16|0,t){bn(C,f),bn(g,m),n=-31;break e}}p&&pt(p,C,f),bn(C,f),n=0}O(C)}else n=-22;return y=S- -64|0,n}function _(e){var t,n=0,r=0,i=0,o=0,s=0,u=0,d=0,h=0,p=0,f=0,g=0,m=0;y=t=y-16|0;e:{t:{n:{r:{i:{o:{s:{a:{l:{c:{u:{if((e|=0)>>>0<=244){if(3&(n=(o=a[8965])>>>(r=(u=e>>>0<11?16:e+11&-8)>>>3|0)|0)){e=(s=a[35908+(n=(i=r+(1&(-1^n))|0)<<3)>>2])+8|0,(0|(r=a[s+8>>2]))!=(0|(n=n+35900|0))?(a[r+12>>2]=n,a[n+8>>2]=r):(g=35860,m=Et(-2,i)&o,a[g>>2]=m),n=i<<3,a[s+4>>2]=3|n,a[4+(n=n+s|0)>>2]=1|a[n+4>>2];break e}if((f=a[8967])>>>0>=u>>>0)break u;if(n){r=e=(n=(0-(e=(0-(e=2<<r)|e)&n<<r)&e)-1|0)>>>12&16,r|=e=(n=n>>>e|0)>>>5&8,r|=e=(n=n>>>e|0)>>>2&4,p=a[35908+(e=(r=((r|=e=(n=n>>>e|0)>>>1&2)|(e=(n=n>>>e|0)>>>1&1))+(n>>>e|0)|0)<<3)>>2],(0|(n=a[p+8>>2]))!=(0|(e=e+35900|0))?(a[n+12>>2]=e,a[e+8>>2]=n):(o=Et(-2,r)&o,a[8965]=o),e=p+8|0,a[p+4>>2]=3|u,s=(n=r<<3)-u|0,a[4+(i=u+p|0)>>2]=1|s,a[n+p>>2]=s,f&&(r=35900+((n=f>>>3|0)<<3)|0,p=a[8970],(n=1<<n)&o?n=a[r+8>>2]:(a[8965]=n|o,n=r),a[r+8>>2]=p,a[n+12>>2]=p,a[p+12>>2]=r,a[p+8>>2]=n),a[8970]=i,a[8967]=s;break e}if(!(d=a[8966]))break u;for(r=e=(n=(0-d&d)-1|0)>>>12&16,r|=e=(n=n>>>e|0)>>>5&8,r|=e=(n=n>>>e|0)>>>2&4,n=a[36164+(((r|=e=(n=n>>>e|0)>>>1&2)|(e=(n=n>>>e|0)>>>1&1))+(n>>>e|0)<<2)>>2],i=(-8&a[n+4>>2])-u|0,r=n;(e=a[r+16>>2])||(e=a[r+20>>2]);)i=(s=(r=(-8&a[e+4>>2])-u|0)>>>0<i>>>0)?r:i,n=s?e:n,r=e;if(h=a[n+24>>2],(0|(s=a[n+12>>2]))!=(0|n)){e=a[n+8>>2],a[e+12>>2]=s,a[s+8>>2]=e;break t}if(!(e=a[(r=n+20|0)>>2])){if(!(e=a[n+16>>2]))break c;r=n+16|0}for(;p=r,s=e,(e=a[(r=e+20|0)>>2])||(r=s+16|0,e=a[s+16>>2]););a[p>>2]=0;break t}if(u=-1,!(e>>>0>4294967231)&&(u=-8&(e=e+11|0),h=a[8966])){i=0-u|0,o=0,u>>>0<256||(o=31,u>>>0>16777215||(e=e>>>8|0,e<<=p=e+1048320>>>16&8,o=28+((e=((e<<=r=e+520192>>>16&4)<<(n=e+245760>>>16&2)>>>15|0)-(n|r|p)|0)<<1|u>>>e+21&1)|0));d:{h:{if(r=a[36164+(o<<2)>>2])for(e=0,n=u<<(31==(0|o)?0:25-(o>>>1|0)|0);;){if(!((p=(d=-8&a[r+4>>2])-u|0)>>>0>=i>>>0)&&(i=p,s=r,(0|u)==(0|d))){i=0,e=r;break h}if(p=a[r+20>>2],r=a[16+((n>>>29&4)+r|0)>>2],e=p?(0|p)==(0|r)?e:p:e,n<<=1,!r)break}else e=0;if(!(e|s)){if(s=0,!(e=(0-(e=2<<o)|e)&h))break u;r=e=(n=(e&0-e)-1|0)>>>12&16,r|=e=(n=n>>>e|0)>>>5&8,r|=e=(n=n>>>e|0)>>>2&4,e=a[36164+(((r|=e=(n=n>>>e|0)>>>1&2)|(e=(n=n>>>e|0)>>>1&1))+(n>>>e|0)<<2)>>2]}if(!e)break d}for(;i=(r=(n=(-8&a[e+4>>2])-u|0)>>>0<i>>>0)?n:i,s=r?e:s,e=(n=a[e+16>>2])||a[e+20>>2];);}if(!(!s|a[8967]-u>>>0<=i>>>0)){if(o=a[s+24>>2],(0|s)!=(0|(n=a[s+12>>2]))){e=a[s+8>>2],a[e+12>>2]=n,a[n+8>>2]=e;break n}if(!(e=a[(r=s+20|0)>>2])){if(!(e=a[s+16>>2]))break l;r=s+16|0}for(;p=r,n=e,(e=a[(r=e+20|0)>>2])||(r=n+16|0,e=a[n+16>>2]););a[p>>2]=0;break n}}}if((r=a[8967])>>>0>=u>>>0){i=a[8970],(n=r-u|0)>>>0>=16?(a[8967]=n,e=i+u|0,a[8970]=e,a[e+4>>2]=1|n,a[r+i>>2]=n,a[i+4>>2]=3|u):(a[8970]=0,a[8967]=0,a[i+4>>2]=3|r,a[4+(e=r+i|0)>>2]=1|a[e+4>>2]),e=i+8|0;break e}if((h=a[8968])>>>0>u>>>0){n=h-u|0,a[8968]=n,e=(r=a[8971])+u|0,a[8971]=e,a[e+4>>2]=1|n,a[r+4>>2]=3|u,e=r+8|0;break e}if(e=0,d=u+47|0,a[9083]?r=a[9085]:(a[9086]=-1,a[9087]=-1,a[9084]=4096,a[9085]=4096,a[9083]=t+12&-16^1431655768,a[9088]=0,a[9076]=0,r=4096),(r=(p=d+r|0)&(s=0-r|0))>>>0<=u>>>0)break e;if((i=a[9075])&&(o=(n=a[9073])+r|0)>>>0>i>>>0|n>>>0>=o>>>0)break e;if(4&l[36304])break o;u:{d:{if(i=a[8971])for(e=36308;;){if((n=a[e>>2])>>>0<=i>>>0&i>>>0<n+a[e+4>>2]>>>0)break d;if(!(e=a[e+8>>2]))break}if(-1==(0|(n=$e(0))))break s;if(o=r,(e=(i=a[9084])-1|0)&n&&(o=(r-n|0)+(e+n&0-i)|0),o>>>0<=u>>>0|o>>>0>2147483646)break s;if((i=a[9075])&&i>>>0<(s=(e=a[9073])+o|0)>>>0|e>>>0>=s>>>0)break s;if((0|n)!=(0|(e=$e(o))))break u;break i}if((o=s&p-h)>>>0>2147483646)break s;if((0|(n=$e(o)))==(a[e>>2]+a[e+4>>2]|0))break a;e=n}if(!(-1==(0|e)|u+48>>>0<=o>>>0)){if((n=(n=a[9085])+(d-o|0)&0-n)>>>0>2147483646){n=e;break i}if(-1!=(0|$e(n))){o=n+o|0,n=e;break i}$e(0-o|0);break s}if(n=e,-1!=(0|e))break i;break s}s=0;break t}n=0;break n}if(-1!=(0|n))break i}a[9076]=4|a[9076]}if(r>>>0>2147483646)break r;if(-1==(0|(n=$e(r)))|-1==(0|(e=$e(0)))|e>>>0<=n>>>0)break r;if((o=e-n|0)>>>0<=u+40>>>0)break r}e=a[9073]+o|0,a[9073]=e,e>>>0>c[9074]&&(a[9074]=e);i:{o:{s:{if(d=a[8971]){for(e=36308;;){if(((i=a[e>>2])+(r=a[e+4>>2])|0)==(0|n))break s;if(!(e=a[e+8>>2]))break}break o}for((e=a[8969])>>>0<=n>>>0&&e||(a[8969]=n),e=0,a[9078]=o,a[9077]=n,a[8973]=-1,a[8974]=a[9083],a[9080]=0;r=35900+(i=e<<3)|0,a[i+35908>>2]=r,a[i+35912>>2]=r,32!=(0|(e=e+1|0)););r=(i=o-40|0)-(e=n+8&7?-8-n&7:0)|0,a[8968]=r,e=e+n|0,a[8971]=e,a[e+4>>2]=1|r,a[4+(n+i|0)>>2]=40,a[8972]=a[9087];break i}if(!(8&l[e+12|0]|i>>>0>d>>>0|n>>>0<=d>>>0)){a[e+4>>2]=r+o,r=(e=d+8&7?-8-d&7:0)+d|0,a[8971]=r,e=(n=a[8968]+o|0)-e|0,a[8968]=e,a[r+4>>2]=1|e,a[4+(n+d|0)>>2]=40,a[8972]=a[9087];break i}}c[8969]>n>>>0&&(a[8969]=n),r=n+o|0,e=36308;o:{s:{a:{l:{c:{u:{for(;;){if((0|r)!=a[e>>2]){if(e=a[e+8>>2])continue;break u}break}if(!(8&l[e+12|0]))break c}for(e=36308;;){if((r=a[e>>2])>>>0<=d>>>0&&(s=r+a[e+4>>2]|0)>>>0>d>>>0)break l;e=a[e+8>>2]}}if(a[e>>2]=n,a[e+4>>2]=a[e+4>>2]+o,a[4+(p=(n+8&7?-8-n&7:0)+n|0)>>2]=3|u,u=(o=r+(r+8&7?-8-r&7:0)|0)-(h=u+p|0)|0,(0|o)==(0|d)){a[8971]=h,e=a[8968]+u|0,a[8968]=e,a[h+4>>2]=1|e;break s}if(a[8970]==(0|o)){a[8970]=h,e=a[8967]+u|0,a[8967]=e,a[h+4>>2]=1|e,a[e+h>>2]=e;break s}if(1==(3&(e=a[o+4>>2]))){s=-8&e;c:if(e>>>0<=255){if(r=a[o+8>>2],e=e>>>3|0,(0|(n=a[o+12>>2]))==(0|r)){g=35860,m=a[8965]&Et(-2,e),a[g>>2]=m;break c}a[r+12>>2]=n,a[n+8>>2]=r}else{if(d=a[o+24>>2],(0|o)==(0|(n=a[o+12>>2])))if((i=a[(e=o+20|0)>>2])||(i=a[(e=o+16|0)>>2])){for(;r=e,(i=a[(e=(n=i)+20|0)>>2])||(e=n+16|0,i=a[n+16>>2]););a[r>>2]=0}else n=0;else e=a[o+8>>2],a[e+12>>2]=n,a[n+8>>2]=e;if(d){r=a[o+28>>2];u:{if(a[(e=36164+(r<<2)|0)>>2]==(0|o)){if(a[e>>2]=n,n)break u;g=35864,m=a[8966]&Et(-2,r),a[g>>2]=m;break c}if(a[d+(a[d+16>>2]==(0|o)?16:20)>>2]=n,!n)break c}a[n+24>>2]=d,(e=a[o+16>>2])&&(a[n+16>>2]=e,a[e+24>>2]=n),(e=a[o+20>>2])&&(a[n+20>>2]=e,a[e+24>>2]=n)}}u=s+u|0,o=o+s|0}if(a[o+4>>2]=-2&a[o+4>>2],a[h+4>>2]=1|u,a[u+h>>2]=u,u>>>0<=255){n=35900+((e=u>>>3|0)<<3)|0,(r=a[8965])&(e=1<<e)?e=a[n+8>>2]:(a[8965]=e|r,e=n),a[n+8>>2]=h,a[e+12>>2]=h,a[h+12>>2]=n,a[h+8>>2]=e;break s}if(e=31,u>>>0<=16777215&&(e=u>>>8|0,e<<=i=e+1048320>>>16&8,e=28+((e=((e<<=r=e+520192>>>16&4)<<(n=e+245760>>>16&2)>>>15|0)-(n|r|i)|0)<<1|u>>>e+21&1)|0),a[h+28>>2]=e,a[h+16>>2]=0,a[h+20>>2]=0,i=36164+(e<<2)|0,(r=a[8966])&(n=1<<e)){for(e=u<<(31==(0|e)?0:25-(e>>>1|0)|0),n=a[i>>2];;){if(r=n,(-8&a[n+4>>2])==(0|u))break a;if(n=e>>>29|0,e<<=1,!(n=a[16+(i=r+(4&n)|0)>>2]))break}a[i+16>>2]=h,a[h+24>>2]=r}else a[8966]=n|r,a[i>>2]=h,a[h+24>>2]=i;a[h+12>>2]=h,a[h+8>>2]=h;break s}for(r=(i=o-40|0)-(e=n+8&7?-8-n&7:0)|0,a[8968]=r,e=e+n|0,a[8971]=e,a[e+4>>2]=1|r,a[4+(n+i|0)>>2]=40,a[8972]=a[9087],a[(r=(e=(s+(s-39&7?39-s&7:0)|0)-47|0)>>>0<d+16>>>0?d:e)+4>>2]=27,e=a[9080],a[r+16>>2]=a[9079],a[r+20>>2]=e,e=a[9078],a[r+8>>2]=a[9077],a[r+12>>2]=e,a[9079]=r+8,a[9078]=o,a[9077]=n,a[9080]=0,e=r+24|0;a[e+4>>2]=7,n=e+8|0,e=e+4|0,n>>>0<s>>>0;);if((0|r)==(0|d))break i;if(a[r+4>>2]=-2&a[r+4>>2],s=r-d|0,a[d+4>>2]=1|s,a[r>>2]=s,s>>>0<=255){n=35900+((e=s>>>3|0)<<3)|0,(r=a[8965])&(e=1<<e)?e=a[n+8>>2]:(a[8965]=e|r,e=n),a[n+8>>2]=d,a[e+12>>2]=d,a[d+12>>2]=n,a[d+8>>2]=e;break i}if(e=31,a[d+16>>2]=0,a[d+20>>2]=0,s>>>0<=16777215&&(e=s>>>8|0,e<<=i=e+1048320>>>16&8,e=28+((e=((e<<=r=e+520192>>>16&4)<<(n=e+245760>>>16&2)>>>15|0)-(n|r|i)|0)<<1|s>>>e+21&1)|0),a[d+28>>2]=e,i=36164+(e<<2)|0,(r=a[8966])&(n=1<<e)){for(e=s<<(31==(0|e)?0:25-(e>>>1|0)|0),n=a[i>>2];;){if(r=n,(0|s)==(-8&a[n+4>>2]))break o;if(n=e>>>29|0,e<<=1,!(n=a[16+(i=r+(4&n)|0)>>2]))break}a[i+16>>2]=d,a[d+24>>2]=r}else a[8966]=n|r,a[i>>2]=d,a[d+24>>2]=i;a[d+12>>2]=d,a[d+8>>2]=d;break i}e=a[r+8>>2],a[e+12>>2]=h,a[r+8>>2]=h,a[h+24>>2]=0,a[h+12>>2]=r,a[h+8>>2]=e}e=p+8|0;break e}e=a[r+8>>2],a[e+12>>2]=d,a[r+8>>2]=d,a[d+24>>2]=0,a[d+12>>2]=r,a[d+8>>2]=e}if(!((e=a[8968])>>>0<=u>>>0)){n=e-u|0,a[8968]=n,e=(r=a[8971])+u|0,a[8971]=e,a[e+4>>2]=1|n,a[r+4>>2]=3|u,e=r+8|0;break e}}a[8952]=48,e=0;break e}n:if(o){r=a[s+28>>2];r:{if(a[(e=36164+(r<<2)|0)>>2]==(0|s)){if(a[e>>2]=n,n)break r;h=Et(-2,r)&h,a[8966]=h;break n}if(a[o+(a[o+16>>2]==(0|s)?16:20)>>2]=n,!n)break n}a[n+24>>2]=o,(e=a[s+16>>2])&&(a[n+16>>2]=e,a[e+24>>2]=n),(e=a[s+20>>2])&&(a[n+20>>2]=e,a[e+24>>2]=n)}n:if(i>>>0<=15)e=i+u|0,a[s+4>>2]=3|e,a[4+(e=e+s|0)>>2]=1|a[e+4>>2];else if(a[s+4>>2]=3|u,a[4+(o=s+u|0)>>2]=1|i,a[o+i>>2]=i,i>>>0<=255)n=35900+((e=i>>>3|0)<<3)|0,(r=a[8965])&(e=1<<e)?e=a[n+8>>2]:(a[8965]=e|r,e=n),a[n+8>>2]=o,a[e+12>>2]=o,a[o+12>>2]=n,a[o+8>>2]=e;else{e=31,i>>>0<=16777215&&(e=i>>>8|0,e<<=p=e+1048320>>>16&8,e=28+((e=((e<<=r=e+520192>>>16&4)<<(n=e+245760>>>16&2)>>>15|0)-(n|r|p)|0)<<1|i>>>e+21&1)|0),a[o+28>>2]=e,a[o+16>>2]=0,a[o+20>>2]=0,n=36164+(e<<2)|0;r:{if((r=1<<e)&h){for(e=i<<(31==(0|e)?0:25-(e>>>1|0)|0),r=a[n>>2];;){if((-8&a[(n=r)+4>>2])==(0|i))break r;if(r=e>>>29|0,e<<=1,!(r=a[16+(p=(4&r)+n|0)>>2]))break}a[p+16>>2]=o}else a[8966]=r|h,a[n>>2]=o;a[o+24>>2]=n,a[o+12>>2]=o,a[o+8>>2]=o;break n}e=a[n+8>>2],a[e+12>>2]=o,a[n+8>>2]=o,a[o+24>>2]=0,a[o+12>>2]=n,a[o+8>>2]=e}e=s+8|0;break e}t:if(h){r=a[n+28>>2];n:{if(a[(e=36164+(r<<2)|0)>>2]==(0|n)){if(a[e>>2]=s,s)break n;g=35864,m=Et(-2,r)&d,a[g>>2]=m;break t}if(a[h+(a[h+16>>2]==(0|n)?16:20)>>2]=s,!s)break t}a[s+24>>2]=h,(e=a[n+16>>2])&&(a[s+16>>2]=e,a[e+24>>2]=s),(e=a[n+20>>2])&&(a[s+20>>2]=e,a[e+24>>2]=s)}i>>>0<=15?(e=i+u|0,a[n+4>>2]=3|e,a[4+(e=e+n|0)>>2]=1|a[e+4>>2]):(a[n+4>>2]=3|u,a[4+(s=n+u|0)>>2]=1|i,a[i+s>>2]=i,f&&(r=35900+((e=f>>>3|0)<<3)|0,p=a[8970],(e=1<<e)&o?e=a[r+8>>2]:(a[8965]=e|o,e=r),a[r+8>>2]=p,a[e+12>>2]=p,a[p+12>>2]=r,a[p+8>>2]=e),a[8970]=s,a[8967]=i),e=n+8|0}return y=t+16|0,0|e}function x(e,t,n){var r,i,o,s,l,c,d,h,p,f,g,m,y,v,A,w,S,C,E,I,_,x,P,k,B,O,N,D,j,T,M,F,R,L,Q,U,V,K,H,G,Y,z,Z,W,q,J,X,$,ee,te,ne,re,ie=0,oe=0,se=0,ae=0,le=0,ce=0,ue=0,de=0,he=0,pe=0,fe=0,ge=0,me=0,ye=0,ve=0,Ae=0,be=0,we=0,Se=0,Ce=0,Ee=0,Ie=0,_e=0,xe=0,Pe=0,ke=0;r=ie=Pe=a[n+4>>2],p=ie>>31,L=ie=(Ce=a[t+20>>2])<<1,ie=ze(r,p,ie,_=ie>>31),se=b,oe=ie,i=ie=a[n>>2],o=ie>>31,f=ie=a[t+24>>2],ge=ze(i,o,ie,s=ie>>31),ie=b+se|0,ie=(oe=oe+ge|0)>>>0<ge>>>0?ie+1|0:ie,se=oe,Q=oe=ae=a[n+8>>2],w=oe>>31,g=oe=a[t+16>>2],oe=se+(ge=ze(ae,w,oe,l=oe>>31))|0,se=b+ie|0,se=oe>>>0<ge>>>0?se+1|0:se,U=ie=le=a[n+12>>2],S=ie>>31,V=ie=(ge=a[t+12>>2])<<1,ie=(me=ze(le,S,ie,x=ie>>31))+oe|0,oe=b+se|0,oe=ie>>>0<me>>>0?oe+1|0:oe,se=ie,q=ie=Ae=a[n+16>>2],E=ie>>31,m=ie=a[t+8>>2],me=ze(Ae,E,ie,c=ie>>31),ie=b+oe|0,ie=(se=se+me|0)>>>0<me>>>0?ie+1|0:ie,Ee=se,J=oe=de=a[n+20>>2],P=oe>>31,K=oe=(me=a[t+4>>2])<<1,se=ze(de,P,oe,k=oe>>31),ie=b+ie|0,ie=(oe=Ee+se|0)>>>0<se>>>0?ie+1|0:ie,se=oe,X=oe=he=a[n+24>>2],H=oe>>31,y=oe=a[t>>2],Se=ze(he,H,oe,d=oe>>31),oe=b+ie|0,oe=(se=se+Se|0)>>>0<Se>>>0?oe+1|0:oe,B=a[n+28>>2],ye=ie=u(B,19),C=ie>>31,G=ie=(Se=a[t+36>>2])<<1,ie=(ve=ze(ye,C,ie,O=ie>>31))+se|0,se=b+oe|0,se=ie>>>0<ve>>>0?se+1|0:se,oe=ie,Y=a[n+32>>2],pe=ie=u(Y,19),ce=ie>>31,v=ie=a[t+32>>2],ve=ze(pe,ce,ie,h=ie>>31),ie=b+se|0,ie=(oe=oe+ve|0)>>>0<ve>>>0?ie+1|0:ie,$=a[n+36>>2],fe=n=u($,19),A=n>>31,z=t=(ve=a[t+28>>2])<<1,n=ze(n,A,t,N=t>>31),ie=b+ie|0,xe=t=n+oe|0,t=t>>>0<n>>>0?ie+1|0:ie,n=ze(g,l,r,p),ie=b,oe=ze(i,o,Ce,D=Ce>>31),se=b+ie|0,se=(n=oe+n|0)>>>0<oe>>>0?se+1|0:se,ie=ze(ae,w,ge,j=ge>>31),oe=b+se|0,oe=(n=ie+n|0)>>>0<ie>>>0?oe+1|0:oe,se=ze(m,c,le,S),ie=b+oe|0,ie=(n=se+n|0)>>>0<se>>>0?ie+1|0:ie,oe=ze(Ae,E,me,T=me>>31),ie=b+ie|0,ie=(n=oe+n|0)>>>0<oe>>>0?ie+1|0:ie,oe=ze(y,d,de,P),ie=b+ie|0,ie=(n=oe+n|0)>>>0<oe>>>0?ie+1|0:ie,se=n,Ie=n=u(he,19),n=se+(oe=ze(n,I=n>>31,Se,M=Se>>31))|0,se=b+ie|0,se=n>>>0<oe>>>0?se+1|0:se,ie=ze(v,h,ye,C),oe=b+se|0,oe=(n=ie+n|0)>>>0<ie>>>0?oe+1|0:oe,se=ze(pe,ce,ve,F=ve>>31),ie=b+oe|0,ie=(n=se+n|0)>>>0<se>>>0?ie+1|0:ie,oe=ze(fe,A,f,s),ie=b+ie|0,Ee=n=oe+n|0,n=n>>>0<oe>>>0?ie+1|0:ie,ie=ze(r,p,V,x),se=b,oe=(he=ze(i,o,g,l))+ie|0,ie=b+se|0,ie=oe>>>0<he>>>0?ie+1|0:ie,he=ze(m,c,ae,w),se=b+ie|0,se=(oe=he+oe|0)>>>0<he>>>0?se+1|0:se,ie=(he=ze(le,S,K,k))+oe|0,oe=b+se|0,oe=ie>>>0<he>>>0?oe+1|0:oe,se=(he=ze(y,d,Ae,E))+ie|0,ie=b+oe|0,ie=se>>>0<he>>>0?ie+1|0:ie,be=se,Z=oe=u(de,19),se=ze(oe,R=oe>>31,G,O),ie=b+ie|0,ie=(oe=be+se|0)>>>0<se>>>0?ie+1|0:ie,se=ze(v,h,Ie,I),ie=b+ie|0,ie=(oe=se+oe|0)>>>0<se>>>0?ie+1|0:ie,de=ze(ye,C,z,N),se=b+ie|0,se=(oe=de+oe|0)>>>0<de>>>0?se+1|0:se,ie=(de=ze(pe,ce,f,s))+oe|0,oe=b+se|0,oe=ie>>>0<de>>>0?oe+1|0:oe,se=(de=ze(fe,A,L,_))+ie|0,ie=b+oe|0,ie=se>>>0<de>>>0?ie+1|0:ie,de=se,te=ie,he=oe=se+33554432|0,ne=ie=oe>>>0<33554432?ie+1|0:ie,se=Ee,Ee=(67108863&ie)<<6|oe>>>26,ie=(ie>>26)+n|0,ie=(se=se+Ee|0)>>>0<Ee>>>0?ie+1|0:ie,re=n=(Ee=se)+16777216|0,ie=t+(oe=(se=n>>>0<16777216?ie+1|0:ie)>>25)|0,ie=(n=(se=(33554431&se)<<7|n>>>25)+xe|0)>>>0<se>>>0?ie+1|0:ie,_e=t=n+33554432|0,t=ie=t>>>0<33554432?ie+1|0:ie,ie=-67108864&_e,a[e+24>>2]=n-ie,n=ze(r,p,K,k),ie=b,oe=ze(i,o,m,c),se=b+ie|0,se=(n=oe+n|0)>>>0<oe>>>0?se+1|0:se,oe=ze(y,d,ae,w),ie=b+se|0,ie=(n=oe+n|0)>>>0<oe>>>0?ie+1|0:ie,se=n,le=n=u(le,19),oe=ze(n,xe=n>>31,G,O),ie=b+ie|0,ie=(n=se+oe|0)>>>0<oe>>>0?ie+1|0:ie,oe=n,ee=n=u(Ae,19),n=oe+(se=ze(v,h,n,W=n>>31))|0,oe=b+ie|0,oe=n>>>0<se>>>0?oe+1|0:oe,se=ze(z,N,Z,R),ie=b+oe|0,ie=(n=se+n|0)>>>0<se>>>0?ie+1|0:ie,oe=ze(f,s,Ie,I),se=b+ie|0,se=(n=oe+n|0)>>>0<oe>>>0?se+1|0:se,oe=ze(ye,C,L,_),ie=b+se|0,ie=(n=oe+n|0)>>>0<oe>>>0?ie+1|0:ie,oe=ze(pe,ce,g,l),ie=b+ie|0,ie=(n=oe+n|0)>>>0<oe>>>0?ie+1|0:ie,se=ze(fe,A,V,x),oe=b+ie|0,be=n=se+n|0,n=n>>>0<se>>>0?oe+1|0:oe,ie=ze(y,d,r,p),se=b,oe=(Ae=ze(i,o,me,T))+ie|0,ie=b+se|0,ie=oe>>>0<Ae>>>0?ie+1|0:ie,se=oe,Ae=oe=u(ae,19),oe=se+(ae=ze(oe,ue=oe>>31,Se,M))|0,se=b+ie|0,se=oe>>>0<ae>>>0?se+1|0:se,ae=ze(v,h,le,xe),ie=b+se|0,ie=(oe=ae+oe|0)>>>0<ae>>>0?ie+1|0:ie,se=ze(ee,W,ve,F),ie=b+ie|0,ie=(oe=se+oe|0)>>>0<se>>>0?ie+1|0:ie,se=(ae=ze(f,s,Z,R))+oe|0,oe=b+ie|0,oe=se>>>0<ae>>>0?oe+1|0:oe,ae=ze(Ie,I,Ce,D),ie=b+oe|0,ie=(se=ae+se|0)>>>0<ae>>>0?ie+1|0:ie,oe=(ae=ze(g,l,ye,C))+se|0,se=b+ie|0,se=oe>>>0<ae>>>0?se+1|0:se,ae=ze(pe,ce,ge,j),ie=b+se|0,ie=(oe=ae+oe|0)>>>0<ae>>>0?ie+1|0:ie,se=ze(fe,A,m,c),ie=b+ie|0,ke=oe=se+oe|0,ae=oe>>>0<se>>>0?ie+1|0:ie,ie=ze(ie=u(r,19),ie>>31,G,O),oe=b,se=ze(i,o,y,d),oe=b+oe|0,oe=(ie=se+ie|0)>>>0<se>>>0?oe+1|0:oe,se=(Pe=ze(v,h,Ae,ue))+ie|0,ie=b+oe|0,oe=(le=ze(le,xe,z,N))+se|0,se=b+(se>>>0<Pe>>>0?ie+1|0:ie)|0,se=oe>>>0<le>>>0?se+1|0:se,le=ze(f,s,ee,W),ie=b+se|0,ie=(oe=le+oe|0)>>>0<le>>>0?ie+1|0:ie,se=ze(L,_,Z,R),ie=b+ie|0,ie=(oe=se+oe|0)>>>0<se>>>0?ie+1|0:ie,se=(le=ze(g,l,Ie,I))+oe|0,oe=b+ie|0,oe=se>>>0<le>>>0?oe+1|0:oe,le=ze(ye,C,V,x),ie=b+oe|0,ie=(se=le+se|0)>>>0<le>>>0?ie+1|0:ie,oe=(le=ze(pe,ce,m,c))+se|0,se=b+ie|0,se=oe>>>0<le>>>0?se+1|0:se,le=ze(fe,A,K,k),ie=b+se|0,ie=(oe=le+oe|0)>>>0<le>>>0?ie+1|0:ie,le=oe,Pe=ie,xe=oe=oe+33554432|0,Ae=ie=oe>>>0<33554432?ie+1|0:ie,ue=(67108863&ie)<<6|oe>>>26,oe=(se=ie>>26)+ae|0,ae=ie=ue+ke|0,ie=ie>>>0<ue>>>0?oe+1|0:oe,ke=oe=ae+16777216|0,se=be,be=(33554431&(ie=oe>>>0<16777216?ie+1|0:ie))<<7|oe>>>25,ie=(ie>>25)+n|0,ie=(oe=se+be|0)>>>0<be>>>0?ie+1|0:ie,be=n=oe+33554432|0,n=ie=n>>>0<33554432?ie+1|0:ie,ie=-67108864&be,a[e+8>>2]=oe-ie,ie=ze(f,s,r,p),se=b,oe=(ue=ze(i,o,ve,F))+ie|0,ie=b+se|0,ie=oe>>>0<ue>>>0?ie+1|0:ie,se=ze(Q,w,Ce,D),ie=b+ie|0,ie=(oe=se+oe|0)>>>0<se>>>0?ie+1|0:ie,se=ze(g,l,U,S),ie=b+ie|0,ie=(oe=se+oe|0)>>>0<se>>>0?ie+1|0:ie,ue=ze(q,E,ge,j),se=b+ie|0,se=(oe=ue+oe|0)>>>0<ue>>>0?se+1|0:se,ie=(ue=ze(m,c,J,P))+oe|0,oe=b+se|0,oe=ie>>>0<ue>>>0?oe+1|0:oe,se=(ue=ze(me,T,X,H))+ie|0,ie=b+oe|0,ie=se>>>0<ue>>>0?ie+1|0:ie,oe=se,se=ze(y,d,B,ue=B>>31),ie=b+ie|0,ie=(oe=oe+se|0)>>>0<se>>>0?ie+1|0:ie,se=ze(pe,ce,Se,M),ie=b+ie|0,ie=(oe=se+oe|0)>>>0<se>>>0?ie+1|0:ie,we=ze(fe,A,v,h),se=b+ie|0,ie=t>>26,t=(_e=(67108863&t)<<6|_e>>>26)+(oe=we+oe|0)|0,oe=ie+(se=oe>>>0<we>>>0?se+1|0:se)|0,ie=oe=t>>>0<_e>>>0?oe+1|0:oe,_e=t=(se=t)+16777216|0,t=ie=t>>>0<16777216?ie+1|0:ie,ie=-33554432&_e,a[e+28>>2]=se-ie,ie=ze(m,c,r,p),oe=b,we=ze(i,o,ge,j),se=b+oe|0,se=(ie=we+ie|0)>>>0<we>>>0?se+1|0:se,we=ze(Q,w,me,T),oe=b+se|0,oe=(ie=we+ie|0)>>>0<we>>>0?oe+1|0:oe,se=(we=ze(y,d,U,S))+ie|0,ie=b+oe|0,ie=se>>>0<we>>>0?ie+1|0:ie,oe=se,se=ze(ee,W,Se,M),ie=b+ie|0,ie=(oe=oe+se|0)>>>0<se>>>0?ie+1|0:ie,se=ze(v,h,Z,R),ie=b+ie|0,ie=(oe=se+oe|0)>>>0<se>>>0?ie+1|0:ie,oe=(Ie=ze(Ie,I,ve,F))+oe|0,se=b+ie|0,ie=(ye=ze(f,s,ye,C))+oe|0,oe=b+(oe>>>0<Ie>>>0?se+1|0:se)|0,se=(pe=ze(pe,ce,Ce,D))+ie|0,ie=b+(ie>>>0<ye>>>0?oe+1|0:oe)|0,ie=se>>>0<pe>>>0?ie+1|0:ie,oe=se,se=ze(fe,A,g,l),ie=b+ie|0,pe=oe=oe+se|0,ie=(ie=oe>>>0<se>>>0?ie+1|0:ie)+(oe=n>>26)|0,ie=(n=pe+(se=(67108863&n)<<6|be>>>26)|0)>>>0<se>>>0?ie+1|0:ie,pe=n=(oe=n)+16777216|0,n=se=n>>>0<16777216?ie+1|0:ie,ie=-33554432&pe,a[e+12>>2]=oe-ie,ie=ze(r,p,z,N),se=b,oe=(ce=ze(i,o,v,h))+ie|0,ie=b+se|0,ie=oe>>>0<ce>>>0?ie+1|0:ie,se=ze(f,s,Q,w),ie=b+ie|0,ie=(oe=se+oe|0)>>>0<se>>>0?ie+1|0:ie,ce=ze(U,S,L,_),se=b+ie|0,se=(oe=ce+oe|0)>>>0<ce>>>0?se+1|0:se,ie=(ce=ze(g,l,q,E))+oe|0,oe=b+se|0,oe=ie>>>0<ce>>>0?oe+1|0:oe,se=(ce=ze(V,x,J,P))+ie|0,ie=b+oe|0,ie=se>>>0<ce>>>0?ie+1|0:ie,oe=se,se=ze(m,c,X,H),ie=b+ie|0,ie=(oe=oe+se|0)>>>0<se>>>0?ie+1|0:ie,se=ze(B,ue,K,k),ie=b+ie|0,ie=(oe=se+oe|0)>>>0<se>>>0?ie+1|0:ie,oe=(ye=ze(y,d,Y,ce=Y>>31))+oe|0,se=b+ie|0,ie=(fe=ze(fe,A,G,O))+oe|0,oe=b+(oe>>>0<ye>>>0?se+1|0:se)|0,oe=ie>>>0<fe>>>0?oe+1|0:oe,be=ie,ie=(ie=t>>25)+oe|0,ie=(t=be+(se=(33554431&t)<<7|_e>>>25)|0)>>>0<se>>>0?ie+1|0:ie,fe=t=(oe=t)+33554432|0,t=ie=t>>>0<33554432?ie+1|0:ie,ie=-67108864&fe,a[e+32>>2]=oe-ie,se=oe=de-(ie=-67108864&he)|0,ie=(ie=te-((ie>>>0>de>>>0)+ne|0)|0)+(oe=n>>25)|0,ie=(n=se+(de=(33554431&n)<<7|pe>>>25)|0)>>>0<de>>>0?ie+1|0:ie,ie=(Ee-(-33554432&re)|0)+((67108863&(ie=(oe=n+33554432|0)>>>0<33554432?ie+1|0:ie))<<6|oe>>>26)|0,a[e+20>>2]=ie,ie=-67108864&oe,a[e+16>>2]=n-ie,n=ze(v,h,r,p),ie=b,oe=ze(i,o,Se,M),ie=b+ie|0,ie=(n=oe+n|0)>>>0<oe>>>0?ie+1|0:ie,se=ze(Q,w,ve,F),oe=b+ie|0,oe=(n=se+n|0)>>>0<se>>>0?oe+1|0:oe,ie=ze(f,s,U,S),se=b+oe|0,se=(n=ie+n|0)>>>0<ie>>>0?se+1|0:se,oe=ze(q,E,Ce,D),ie=b+se|0,ie=(n=oe+n|0)>>>0<oe>>>0?ie+1|0:ie,oe=ze(g,l,J,P),ie=b+ie|0,ie=(n=oe+n|0)>>>0<oe>>>0?ie+1|0:ie,oe=ze(ge,j,X,H),ie=b+ie|0,ie=(n=oe+n|0)>>>0<oe>>>0?ie+1|0:ie,se=ze(m,c,B,ue),oe=b+ie|0,oe=(n=se+n|0)>>>0<se>>>0?oe+1|0:oe,ie=ze(Y,ce,me,T),se=b+oe|0,se=(n=ie+n|0)>>>0<ie>>>0?se+1|0:se,oe=ze(y,d,$,$>>31),ie=b+se|0,ie=(ie=(n=oe+n|0)>>>0<oe>>>0?ie+1|0:ie)+(oe=t>>26)|0,ie=(t=(se=n)+(n=(67108863&t)<<6|fe>>>26)|0)>>>0<n>>>0?ie+1|0:ie,ie=(n=t+16777216|0)>>>0<16777216?ie+1|0:ie,oe=-33554432&n,a[e+36>>2]=t-oe,se=ae-(-33554432&ke)|0,oe=le-(t=-67108864&xe)|0,Ce=Pe-((t>>>0>le>>>0)+Ae|0)|0,t=(n=ze((33554431&(t=ie))<<7|n>>>25,ie>>=25,19,0))+oe|0,oe=b+Ce|0,ie=oe=t>>>0<n>>>0?oe+1|0:oe,n=((67108863&(ie=(n=t+33554432|0)>>>0<33554432?ie+1|0:ie))<<6|(oe=n)>>>26)+se|0,a[e+4>>2]=n,n=e,e=-67108864&oe,a[n>>2]=t-e}function P(e,t){var n,r,i,o,s,l,c,d,h,p,f,g,m,v,A,w,S,C,E,I,_,x,P,B,O,N,D,j,T,M,F,R,L,Q,U,V,K,H,G,Y,z,Z=0,W=0,q=0,J=0,X=0,$=0,ee=0,te=0,ne=0,re=0,ie=0,oe=0,se=0,ae=0,le=0,ce=0,ue=0,de=0,he=0,pe=0,fe=0;y=x=y-48|0,k(e,t),k(C=e+80|0,F=t+40|0),n=e+120|0,c=Z=(ue=a[t+92>>2])<<1,d=Z>>31,h=Z=(ie=a[t+84>>2])<<1,Z=ze(c,d,Z,r=Z>>31),X=b,W=Z,N=Z=$=a[t+88>>2],q=ze(Z,ee=Z>>31,Z,ee),Z=b+X|0,Z=(W=W+q|0)>>>0<q>>>0?Z+1|0:Z,q=W,i=W=a[t+96>>2],p=W>>31,f=W=(se=a[t+80>>2])<<1,X=ze(i,p,W,o=W>>31),Z=b+Z|0,Z=(W=q+X|0)>>>0<X>>>0?Z+1|0:Z,J=W,X=a[t+108>>2],P=W=u(X,38),R=X,q=ze(W,E=W>>31,X,D=X>>31),Z=b+Z|0,Z=(W=J+q|0)>>>0<q>>>0?Z+1|0:Z,q=W,A=a[t+112>>2],de=ze(g=W=u(A,19),m=W>>31,W=(ne=a[t+104>>2])<<1,W>>31),W=b+Z|0,W=(q=q+de|0)>>>0<de>>>0?W+1|0:W,J=q,de=a[t+116>>2],s=Z=u(de,38),l=Z>>31,I=Z=(q=a[t+100>>2])<<1,ce=ze(s,l,Z,w=Z>>31),W=b+W|0,W=(Z=J+ce|0)>>>0<ce>>>0?W+1|0:W,ce=Z,K=Z=W<<1|Z>>>31,L=W=33554432+(ce<<=1)|0,H=Z=W>>>0<33554432?Z+1|0:Z,W=Z>>26,Z=(67108863&Z)<<6|L>>>26,he=W,W=ze(h,r,i,p),te=b,J=Z,_=Z=$<<1,ue=ze(Z,S=Z>>31,$=ue,j=$>>31),Z=b+te|0,Z=(W=ue+W|0)>>>0<ue>>>0?Z+1|0:Z,ue=q,te=(re=ze(q,B=q>>31,f,o))+W|0,W=b+Z|0,W=te>>>0<re>>>0?W+1|0:W,oe=te,Q=Z=X<<1,te=ze(g,m,Z,T=Z>>31),Z=b+W|0,Z=(X=oe+te|0)>>>0<te>>>0?Z+1|0:Z,W=X,X=ze(s,l,ne,v=ne>>31),Z=b+Z|0,Z=(W=W+X|0)>>>0<X>>>0?Z+1|0:Z,X=W,W=(W=Z<<1|W>>>31)+he|0,he=Z=J+(X<<=1)|0,Z=Z>>>0<X>>>0?W+1|0:W,G=W=he+16777216|0,X=W,W=(Z=W>>>0<16777216?Z+1|0:Z)>>25,Z=(33554431&Z)<<7|X>>>25,X=W,W=ze(c,d,$,j),te=b,J=Z,re=ze(i,p,_,S),Z=b+te|0,Z=(W=re+W|0)>>>0<re>>>0?Z+1|0:Z,te=ze(h,r,I,w),Z=b+Z|0,Z=(W=te+W|0)>>>0<te>>>0?Z+1|0:Z,te=(re=ze(f,o,ne,v))+W|0,W=b+Z|0,W=te>>>0<re>>>0?W+1|0:W,re=ze(g,m,A,O=A>>31),Z=b+W|0,Z=(te=re+te|0)>>>0<re>>>0?Z+1|0:Z,re=ze(s,l,Q,T),W=b+Z|0,W=(te=re+te|0)>>>0<re>>>0?W+1|0:W,re=(Z=te)<<1,Z=(W<<1|Z>>>31)+X|0,Z=(te=J+re|0)>>>0<re>>>0?Z+1|0:Z,fe=X=(W=te)+33554432|0,X=Z=X>>>0<33554432?Z+1|0:Z,Z=-67108864&fe,a[n+24>>2]=W-Z,Z=ze(Z=u(q,38),Z>>31,q,B),W=b,J=Z,q=ze(se,Z=se>>31,se,Z),W=b+W|0,W=(Z=J+q|0)>>>0<q>>>0?W+1|0:W,q=Z,oe=Z=u(ne,19),le=Z>>31,U=Z=i<<1,se=ze(oe,le,Z,M=Z>>31),Z=b+W|0,Z=(q=q+se|0)>>>0<se>>>0?Z+1|0:Z,W=q,q=ze(c,d,P,E),Z=b+Z|0,Z=(W=W+q|0)>>>0<q>>>0?Z+1|0:Z,q=(se=ze(g,m,_,S))+W|0,W=b+Z|0,W=q>>>0<se>>>0?W+1|0:W,se=ze(h,r,s,l),Z=b+W|0,Z=(q=se+q|0)>>>0<se>>>0?Z+1|0:Z,se=(W=q)<<1,z=Z=Z<<1|W>>>31,W=Z,te=Z=se+33554432|0,re=W=Z>>>0<33554432?W+1|0:W,Z=W>>26,W=(67108863&W)<<6|te>>>26,q=Z,Z=ze(oe,le,I,w),ae=b,pe=W,W=(ie=ze(f,o,J=ie,V=J>>31))+Z|0,Z=b+ae|0,Z=W>>>0<ie>>>0?Z+1|0:Z,ie=(ae=ze(i,p,P,E))+W|0,W=b+Z|0,W=ie>>>0<ae>>>0?W+1|0:W,ae=ze(c,d,g,m),Z=b+W|0,Z=(ie=ae+ie|0)>>>0<ae>>>0?Z+1|0:Z,ae=ze(s,l,N,ee),W=b+Z|0,W=(ie=ae+ie|0)>>>0<ae>>>0?W+1|0:W,ae=(Z=ie)<<1,Z=(W<<1|Z>>>31)+q|0,Z=(ie=pe+ae|0)>>>0<ae>>>0?Z+1|0:Z,ae=W=ie+16777216|0,q=W,W=(Z=W>>>0<16777216?Z+1|0:Z)>>25,Z=(33554431&Z)<<7|q>>>25,q=W,W=ze(f,o,N,ee),Y=b,pe=Z,J=ze(J,V,h,r),Z=b+Y|0,Z=(W=J+W|0)>>>0<J>>>0?Z+1|0:Z,J=(oe=ze(oe,le,ne,v))+W|0,W=b+Z|0,W=J>>>0<oe>>>0?W+1|0:W,oe=ze(I,w,P,E),Z=b+W|0,Z=(J=oe+J|0)>>>0<oe>>>0?Z+1|0:Z,W=J,J=ze(g,m,U,M),Z=b+Z|0,Z=(W=W+J|0)>>>0<J>>>0?Z+1|0:Z,J=(oe=ze(s,l,c,d))+W|0,W=b+Z|0,Z=(Z=(W=J>>>0<oe>>>0?W+1|0:W)<<1|J>>>31)+q|0,Z=(W=pe+(J<<=1)|0)>>>0<J>>>0?Z+1|0:Z,q=W,J=W,W=Z,oe=Z=q+33554432|0,q=W=Z>>>0<33554432?W+1|0:W,Z&=-67108864,a[n+8>>2]=J-Z,Z=ze(_,S,ue,B),W=b,J=ze(c,d,i,p),W=b+W|0,W=(Z=J+Z|0)>>>0<J>>>0?W+1|0:W,J=(le=ze(h,r,ne,v))+Z|0,Z=b+W|0,Z=J>>>0<le>>>0?Z+1|0:Z,le=ze(f,o,R,D),W=b+Z|0,W=(J=le+J|0)>>>0<le>>>0?W+1|0:W,le=ze(s,l,A,O),Z=b+W|0,pe=(W=J=le+J|0)<<1,Z=(Z=(W>>>0<le>>>0?Z+1|0:Z)<<1|W>>>31)+(W=X>>26)|0,Z=(X=pe+(J=(67108863&X)<<6|fe>>>26)|0)>>>0<J>>>0?Z+1|0:Z,J=X,W=Z,fe=Z=X+16777216|0,X=W=Z>>>0<16777216?W+1|0:W,Z&=-33554432,a[n+28>>2]=J-Z,Z=ze(f,o,$,j),$=b,W=(ee=ze(h,r,N,ee))+Z|0,Z=b+$|0,Z=W>>>0<ee>>>0?Z+1|0:Z,ee=ze(ne,v,P,E),Z=b+Z|0,Z=(W=ee+W|0)>>>0<ee>>>0?Z+1|0:Z,ee=($=ze(g,m,I,w))+W|0,W=b+Z|0,W=$>>>0>ee>>>0?W+1|0:W,Z=ee,ee=ze(s,l,i,p),W=b+W|0,W=(Z=Z+ee|0)>>>0<ee>>>0?W+1|0:W,ee=Z,Z=(Z=W<<1|Z>>>31)+(W=q>>26)|0,Z=(q=(J=ee<<1)+(ee=(67108863&q)<<6|oe>>>26)|0)>>>0<ee>>>0?Z+1|0:Z,ee=q=(W=q)+16777216|0,q=Z=q>>>0<16777216?Z+1|0:Z,Z=-33554432&ee,a[n+12>>2]=W-Z,Z=ze(ne,v,_,S),$=b,W=(J=ze(i,p,i,p))+Z|0,Z=b+$|0,Z=W>>>0<J>>>0?Z+1|0:Z,$=ze(c,d,I,w),Z=b+Z|0,Z=(W=$+W|0)>>>0<$>>>0?Z+1|0:Z,$=ze(h,r,Q,T),Z=b+Z|0,Z=(W=$+W|0)>>>0<$>>>0?Z+1|0:Z,$=(J=ze(f,o,A,O))+W|0,W=b+Z|0,W=J>>>0>$>>>0?W+1|0:W,Z=$,$=ze(s,l,de,J=de>>31),W=b+W|0,W=(Z=Z+$|0)>>>0<$>>>0?W+1|0:W,$=Z,Z=(Z=W<<1|Z>>>31)+(W=X>>25)|0,Z=(X=(oe=$<<1)+($=(33554431&X)<<7|fe>>>25)|0)>>>0<$>>>0?Z+1|0:Z,$=X=(W=X)+33554432|0,X=Z=X>>>0<33554432?Z+1|0:Z,Z=-67108864&$,a[n+32>>2]=W-Z,W=ce-(Z=-67108864&L)|0,ce=K-((Z>>>0>ce>>>0)+H|0)|0,Z=q>>25,q=(ee=(33554431&q)<<7|ee>>>25)+W|0,W=Z+ce|0,Z=W=q>>>0<ee>>>0?W+1|0:W,Z=((67108863&(Z=(W=q+33554432|0)>>>0<33554432?Z+1|0:Z))<<6|W>>>26)+(he=he-(-33554432&G)|0)|0,a[n+20>>2]=Z,Z=-67108864&W,a[n+16>>2]=q-Z,Z=ze(c,d,ne,v),W=b,q=ze(ue,B,U,M),W=b+W|0,W=(Z=q+Z|0)>>>0<q>>>0?W+1|0:W,q=(ne=ze(_,S,R,D))+Z|0,Z=b+W|0,Z=q>>>0<ne>>>0?Z+1|0:Z,ne=ze(h,r,A,O),W=b+Z|0,W=(q=ne+q|0)>>>0<ne>>>0?W+1|0:W,ne=ze(f,o,de,J),Z=b+W|0,J=(W=q=ne+q|0)<<1,Z=(Z=(W>>>0<ne>>>0?Z+1|0:Z)<<1|W>>>31)+(W=X>>26)|0,W=Z=(q=(67108863&X)<<6|$>>>26)>>>0>(X=J+q|0)>>>0?Z+1|0:Z,W=(Z=X+16777216|0)>>>0<16777216?W+1|0:W,q=-33554432&Z,a[n+36>>2]=X-q,ne=ze((33554431&W)<<7|Z>>>25,W>>25,19,0),W=b+(z-(((q=-67108864&te)>>>0>se>>>0)+re|0)|0)|0,W=(Z=ne+(se-q|0)|0)>>>0<ne>>>0?W+1|0:W,W=(ie-(-33554432&ae)|0)+((67108863&(W=(X=Z+33554432|0)>>>0<33554432?W+1|0:W))<<6|X>>>26)|0,a[n+4>>2]=W,W=-67108864&X,a[n>>2]=Z-W,me(Z=e+40|0,t,F),k(x,Z),me(Z,C,e),ge(C,C,e),ge(e,x,Z),ge(n,n,C),y=x+48|0}function k(e,t){var n,r,i,o,s,l,c,d,h,p,f,g,m,y,v,A,w,S,C,E,I,_,x,P,k,B,O,N,D,j,T,M,F,R,L,Q=0,U=0,V=0,K=0,H=0,G=0,Y=0,z=0,Z=0,W=0,q=0,J=0,X=0,$=0,ee=0,te=0,ne=0,re=0,ie=0;p=U=(Q=a[t+12>>2])<<1,Z=Q,Q=ze(U,s=U>>31,Q,k=Q>>31),K=b,U=Q,l=(Q=n=a[t+16>>2])>>31,w=Q=(Y=a[t+8>>2])<<1,V=ze(n,l,Q,m=Q>>31),Q=b+K|0,Q=(U=U+V|0)>>>0<V>>>0?Q+1|0:Q,K=U,y=U=(V=a[t+20>>2])<<1,v=U>>31,c=U=(G=a[t+4>>2])<<1,q=ze(y,v,U,r=U>>31),U=b+Q|0,U=(K=K+q|0)>>>0<q>>>0?U+1|0:U,E=Q=H=a[t+24>>2],f=Q>>31,d=Q=(X=a[t>>2])<<1,q=ze(H,f,Q,i=Q>>31),Q=b+U|0,Q=(K=q+K|0)>>>0<q>>>0?Q+1|0:Q,W=K,q=a[t+32>>2],A=U=u(q,19),K=ze(U,g=U>>31,q,I=q>>31),Q=b+Q|0,Q=(U=W+K|0)>>>0<K>>>0?Q+1|0:Q,W=U,_=a[t+36>>2],h=U=u(_,38),o=U>>31,j=t=(K=a[t+28>>2])<<1,ne=ze(U,o,t,B=t>>31),t=b+Q|0,W=U=W+ne|0,J=U>>>0<ne>>>0?t+1|0:t,t=ze(c,r,n,l),Q=b,U=ze(w,m,Z,k),Q=b+Q|0,Q=(t=U+t|0)>>>0<U>>>0?Q+1|0:Q,ne=V,z=ze(V,x=V>>31,d,i),U=b+Q|0,U=(t=z+t|0)>>>0<z>>>0?U+1|0:U,z=ze(A,g,j,B),Q=b+U|0,Q=(t=z+t|0)>>>0<z>>>0?Q+1|0:Q,U=ze(h,o,H,f),Q=b+Q|0,$=t=U+t|0,re=t>>>0<U>>>0?Q+1|0:Q,t=ze(c,r,p,s),U=b,Q=(z=ze(Y,S=Y>>31,Y,S))+t|0,t=b+U|0,t=Q>>>0<z>>>0?t+1|0:t,U=(z=ze(d,i,n,l))+Q|0,Q=b+t|0,Q=U>>>0<z>>>0?Q+1|0:Q,P=t=u(K,38),z=K,t=(K=ze(t,C=t>>31,K,O=K>>31))+U|0,U=b+Q|0,U=t>>>0<K>>>0?U+1|0:U,t=(Q=t)+(K=ze(A,g,t=H<<1,t>>31))|0,Q=b+U|0,Q=t>>>0<K>>>0?Q+1|0:Q,U=ze(h,o,y,v),Q=b+Q|0,N=t=U+t|0,F=Q=t>>>0<U>>>0?Q+1|0:Q,t=Q,T=Q=N+33554432|0,R=t=Q>>>0<33554432?t+1|0:t,Q=(Q=t>>26)+re|0,re=t=(U=(67108863&t)<<6|T>>>26)+$|0,U=t>>>0<U>>>0?Q+1|0:Q,L=t=t+16777216|0,Q=(Q=(U=t>>>0<16777216?U+1|0:U)>>25)+J|0,Q=(t=(U=(33554431&U)<<7|t>>>25)+W|0)>>>0<U>>>0?Q+1|0:Q,U=t,t=Q,ee=Q=U+33554432|0,K=t=Q>>>0<33554432?t+1|0:t,t=-67108864&Q,a[e+24>>2]=U-t,t=ze(d,i,Y,S),Q=b,W=ze(c,r,G,J=G>>31),U=b+Q|0,U=(t=W+t|0)>>>0<W>>>0?U+1|0:U,Q=t,W=t=u(H,19),t=Q+(H=ze(t,$=t>>31,H,f))|0,Q=b+U|0,Q=t>>>0<H>>>0?Q+1|0:Q,U=(H=ze(y,v,P,C))+t|0,t=b+Q|0,t=U>>>0<H>>>0?t+1|0:t,M=Q=n<<1,H=ze(A,g,Q,D=Q>>31),Q=b+t|0,Q=(U=H+U|0)>>>0<H>>>0?Q+1|0:Q,t=U,U=ze(h,o,p,s),Q=b+Q|0,ie=t=t+U|0,H=t>>>0<U>>>0?Q+1|0:Q,t=ze(y,v,W,$),Q=b,G=ze(d,i,G,J),U=b+Q|0,U=(t=G+t|0)>>>0<G>>>0?U+1|0:U,G=ze(n,l,P,C),Q=b+U|0,Q=(t=G+t|0)>>>0<G>>>0?Q+1|0:Q,U=(G=ze(A,g,p,s))+t|0,t=b+Q|0,t=U>>>0<G>>>0?t+1|0:t,G=ze(h,o,Y,S),Q=b+t|0,te=U=G+U|0,J=U>>>0<G>>>0?Q+1|0:Q,t=ze(t=u(V,38),t>>31,V,x),Q=b,V=t,U=ze(X,t=X>>31,X,t),Q=b+Q|0,Q=(t=V+U|0)>>>0<U>>>0?Q+1|0:Q,V=ze(W,$,M,D),U=b+Q|0,U=(t=V+t|0)>>>0<V>>>0?U+1|0:U,V=ze(p,s,P,C),Q=b+U|0,Q=(t=V+t|0)>>>0<V>>>0?Q+1|0:Q,U=(V=ze(A,g,w,m))+t|0,t=b+Q|0,t=U>>>0<V>>>0?t+1|0:t,V=ze(c,r,h,o),Q=b+t|0,G=U=V+U|0,W=Q=U>>>0<V>>>0?Q+1|0:Q,X=t=U+33554432|0,$=Q=t>>>0<33554432?Q+1|0:Q,U=(t=Q>>26)+J|0,J=Q=(V=(67108863&Q)<<6|X>>>26)+te|0,te=ie,Q=Q>>>0<V>>>0?U+1|0:U,ie=t=J+16777216|0,V=(33554431&(Q=t>>>0<16777216?Q+1|0:Q))<<7|t>>>25,Q=(Q>>25)+H|0,Q=(U=te+V|0)>>>0<V>>>0?Q+1|0:Q,H=U=(t=U)+33554432|0,V=Q=U>>>0<33554432?Q+1|0:Q,Q=-67108864&U,a[e+8>>2]=t-Q,t=ze(w,m,ne,x),Q=b,U=ze(n,l,p,s),Q=b+Q|0,Q=(t=U+t|0)>>>0<U>>>0?Q+1|0:Q,U=ze(c,r,E,f),Q=b+Q|0,Q=(t=U+t|0)>>>0<U>>>0?Q+1|0:Q,U=ze(d,i,z,O),Q=b+Q|0,Q=(t=U+t|0)>>>0<U>>>0?Q+1|0:Q,U=(te=ze(h,o,q,I))+t|0,t=b+Q|0,Q=K>>26,K=(ee=(67108863&K)<<6|ee>>>26)+U|0,U=(t=U>>>0<te>>>0?t+1|0:t)+Q|0,Q=(t=K)>>>0<ee>>>0?U+1|0:U,ee=U=t+16777216|0,K=Q=U>>>0<16777216?Q+1|0:Q,Q=-33554432&U,a[e+28>>2]=t-Q,t=ze(d,i,Z,k),U=b,Q=(Y=ze(c,r,Y,S))+t|0,t=b+U|0,t=Q>>>0<Y>>>0?t+1|0:t,Y=ze(E,f,P,C),U=b+t|0,U=(Q=Y+Q|0)>>>0<Y>>>0?U+1|0:U,t=(Y=ze(A,g,y,v))+Q|0,Q=b+U|0,Q=t>>>0<Y>>>0?Q+1|0:Q,U=ze(h,o,n,l),Q=b+Q|0,Q=(Q=(t=U+t|0)>>>0<U>>>0?Q+1|0:Q)+(U=V>>26)|0,U=t=(V=(67108863&V)<<6|H>>>26)+t|0,t=t>>>0<V>>>0?Q+1|0:Q,Y=Q=U+16777216|0,V=t=Q>>>0<16777216?t+1|0:t,t=-33554432&Q,a[e+12>>2]=U-t,t=ze(E,f,w,m),Q=b,U=ze(n,l,n,l),Q=b+Q|0,Q=(t=U+t|0)>>>0<U>>>0?Q+1|0:Q,U=ze(p,s,y,v),Q=b+Q|0,Q=(t=U+t|0)>>>0<U>>>0?Q+1|0:Q,U=(Z=ze(c,r,j,B))+t|0,t=b+Q|0,t=U>>>0<Z>>>0?t+1|0:t,Q=(Z=ze(d,i,q,I))+U|0,U=b+t|0,U=Q>>>0<Z>>>0?U+1|0:U,t=(Z=ze(h,o,_,H=_>>31))+Q|0,Q=b+U|0,Q=t>>>0<Z>>>0?Q+1|0:Q,U=t,Q=(t=K>>25)+Q|0,Q=(U=U+(K=(33554431&K)<<7|ee>>>25)|0)>>>0<K>>>0?Q+1|0:Q,Z=U=(t=U)+33554432|0,K=Q=U>>>0<33554432?Q+1|0:Q,Q=-67108864&U,a[e+32>>2]=t-Q,Q=V>>25,U=(V=(33554431&V)<<7|Y>>>25)+(N-(t=-67108864&T)|0)|0,t=Q+(F-((t>>>0>N>>>0)+R|0)|0)|0,Q=t=U>>>0<V>>>0?t+1|0:t,V=t=U+33554432|0,t=((67108863&(Q=t>>>0<33554432?Q+1|0:Q))<<6|t>>>26)+(re=re-(-33554432&L)|0)|0,a[e+20>>2]=t,t=-67108864&V,a[e+16>>2]=U-t,t=ze(p,s,E,f),U=b,Q=(V=ze(ne,x,M,D))+t|0,t=b+U|0,t=Q>>>0<V>>>0?t+1|0:t,U=(V=ze(w,m,z,O))+Q|0,Q=b+t|0,Q=U>>>0<V>>>0?Q+1|0:Q,t=(V=ze(c,r,q,I))+U|0,U=b+Q|0,U=t>>>0<V>>>0?U+1|0:U,V=ze(d,i,_,H),Q=b+U|0,U=t=V+t|0,Q=(t=t>>>0<V>>>0?Q+1|0:Q)+(Q=K>>26)|0,t=Q=(U=(K=(67108863&K)<<6|Z>>>26)+U|0)>>>0<K>>>0?Q+1|0:Q,t=(Q=U+16777216|0)>>>0<16777216?t+1|0:t,K=-33554432&Q,a[e+36>>2]=U-K,V=ze((33554431&t)<<7|Q>>>25,t>>25,19,0),Q=b+(W-(((U=-67108864&X)>>>0>G>>>0)+$|0)|0)|0,U=t=V+(G-U|0)|0,t=t>>>0<V>>>0?Q+1|0:Q,t=(J-(-33554432&ie)|0)+((67108863&(t=(Q=U+33554432|0)>>>0<33554432?t+1|0:t))<<6|Q>>>26)|0,a[e+4>>2]=t,t=e,e=-67108864&Q,a[t>>2]=U-e}function B(e,t,n){var r,i=0,o=0,s=0,l=0,c=0,u=0,d=0,h=0,p=0,f=0,g=0,m=0,v=0,A=0,w=0,S=0,C=0,E=0,I=0,_=0,x=0,P=0,k=0,B=0,O=0,N=0,D=0,j=0,T=0,M=0,F=0,R=0,L=0,Q=0,U=0,V=0,K=0,H=0;for(y=r=y-2048|0,yn(v=r+1024|0,t),et(v,e),yn(r,v),et(r,n),t=0,v=0;u=a[(f=(e=(r+1024|0)+(v<<7)|0)- -64|0)>>2],o=a[e+100>>2],c=u,h=a[f+4>>2],d=a[e+96>>2],u=a[e+32>>2],s=a[e+36>>2],l=we(d^(i=it(a[e>>2],a[e+4>>2],u,s)),(l=o)^(o=b),32),s=we(h=(c=it(c,h,l,d=b))^u,s^(u=b),24),h=u,k=we((w=it(i,o,s,u=b))^l,(A=b)^d,16),u=we(s^(O=it(c,h,k,B=b)),(R=b)^u,63),o=b,s=a[e+108>>2],h=a[e+72>>2],m=a[e+76>>2],g=a[e+104>>2],i=a[e+40>>2],l=a[e+44>>2],c=we(g^(d=it(a[e+8>>2],a[e+12>>2],i,l)),(c=s)^(s=b),32),l=we(h=(N=it(h,m,c,p=b))^i,l^(i=b),24),h=N,Q=we((N=it(d,m=s,l,s=b))^c,(L=b)^p,16),s=we(l^(D=it(h,i,Q,U=b)),(j=b)^s,63),i=b,l=a[e+116>>2],g=a[e+80>>2],S=a[e+84>>2],m=a[e+112>>2],d=a[e+48>>2],c=a[e+52>>2],m=we(m^(p=it(a[e+16>>2],a[e+20>>2],d,c)),(h=l)^(l=b),32),c=we(h=(g=it(g,S,m,T=b))^d,c^(d=b),24),h=g,g=we((g=m)^(m=it(p,m=l,c,l=b)),(p=T)^(T=b),16),l=we(c^(h=it(h,d,g,M=b)),(_=b)^l,63),d=b,c=a[e+124>>2],x=a[e+88>>2],F=a[e+92>>2],C=a[e+120>>2],p=a[e+56>>2],S=a[e+60>>2],C=we(C^(E=it(a[e+24>>2],a[e+28>>2],p,S)),(I=c)^(c=b),32),I=S=we(I=(F=it(x,F,C,P=b))^p,S^(p=b),24),C=we((S=it(E,x=c,S,c=b))^C,(E=b)^P,16),c=we(I^(F=it(F,p,C,P=b)),(V=b)^c,63),p=b,I=h,x=_,h=we(C^(w=it(w,A,s,i)),P^(A=b),32),s=we((C=it(I,x,h,_=b))^s,(P=b)^i,24),i=it(i=w,A,s,w=b),a[e>>2]=i,A=b,a[e+4>>2]=A,i=we(i^h,A^_,16),a[e+120>>2]=i,A=b,a[e+124>>2]=A,i=it(C,P,i,A),a[e+80>>2]=i,A=b,a[e+84>>2]=A,K=e,H=we(i^s,A^w,63),a[K+40>>2]=H,a[e+44>>2]=b,s=l,w=we(k^(i=it(N,L,l,d)),B^(l=b),32),s=we(s^(k=it(F,V,w,A=b)),(h=d)^(d=b),24),i=it(i,h=l,s,l=b),a[e+8>>2]=i,B=b,a[e+12>>2]=B,i=we(i^w,A^B,16),a[e+96>>2]=i,w=b,a[e+100>>2]=w,i=it(k,d,i,w),a[e+88>>2]=i,d=b,a[e+92>>2]=d,K=e,H=we(i^s,l^d,63),a[K+48>>2]=H,a[e+52>>2]=b,s=c,d=we(Q^(i=it(m,T,c,p)),U^(l=b),32),s=we(s^(w=it(O,R,d,c=b)),(h=p)^(p=b),24),i=it(i,h=l,s,l=b),a[e+16>>2]=i,A=b,a[e+20>>2]=A,i=we(i^d,c^A,16),a[e+104>>2]=i,d=b,a[e+108>>2]=d,i=it(w,p,i,d),a[f>>2]=i,c=f,f=b,a[c+4>>2]=f,K=e,H=we(i^s,l^f,63),a[K+56>>2]=H,a[e+60>>2]=b,c=u,i=we(g^(u=it(S,E,u,o)),M^(s=b),32),f=we(c^(d=it(D,j,i,l=b)),(f=o)^(o=b),24),u=it(u,c=s,f,s=b),a[e+24>>2]=u,c=b,a[e+28>>2]=c,u=we(i^u,l^c,16),a[e+112>>2]=u,i=b,a[e+116>>2]=i,u=it(d,o,u,i),a[e+72>>2]=u,o=b,a[e+76>>2]=o,K=e,H=we(u^f,s^o,63),a[K+32>>2]=H,a[e+36>>2]=b,8!=(0|(v=v+1|0)););for(;f=a[(v=512+(e=(r+1024|0)+(t<<4)|0)|0)>>2],u=a[e+772>>2],l=f,c=a[v+4>>2],d=a[e+768>>2],v=a[e+256>>2],f=a[e+260>>2],s=we(d^(o=it(a[e>>2],a[e+4>>2],v,f)),(s=u)^(u=b),32),f=we(c=(l=it(l,c,s,i=b))^v,f^(v=b),24),d=v,w=we((c=it(o,u,f,v=b))^s,(p=b)^i,16),v=we(f^(k=it(l,d,w,A=b)),(B=b)^v,63),f=b,u=a[e+780>>2],h=a[e+520>>2],m=a[e+524>>2],d=a[e+776>>2],o=a[e+264>>2],s=a[e+268>>2],l=we(d^(i=it(a[e+8>>2],a[e+12>>2],o,s)),(l=u)^(u=b),32),s=we(h=(O=it(h,m,l,d=b))^o,s^(o=b),24),h=O,N=we((O=it(i,m=u,s,u=b))^l,(R=b)^d,16),u=we(s^(Q=it(h,o,N,L=b)),(U=b)^u,63),o=b,s=a[e+900>>2],m=a[e+640>>2],g=a[e+644>>2],S=a[e+896>>2],i=a[e+384>>2],l=a[e+388>>2],D=we(S^(d=it(a[e+128>>2],a[e+132>>2],i,l)),(h=s)^(s=b),32),l=we(h=(m=it(m,g,D,j=b))^i,l^(i=b),24),h=m,m=we((m=D)^(D=it(d,g=s,l,s=b)),(d=j)^(j=b),16),s=we(l^(g=it(h,i,m,T=b)),(M=b)^s,63),i=b,l=a[e+908>>2],I=a[e+648>>2],x=a[e+652>>2],E=a[e+904>>2],d=a[e+392>>2],h=a[e+396>>2],S=we(E^(_=it(a[e+136>>2],a[e+140>>2],d,h)),(S=l)^(l=b),32),I=h=we(I=(C=it(I,x,S,E=b))^d,h^(d=b),24),S=we((h=it(_,x=l,h,l=b))^S,(_=b)^E,16),l=we(I^(C=it(C,d,S,E=b)),(P=b)^l,63),d=b,I=g,x=M,g=we(S^(c=it(c,p,u,o)),E^(p=b),32),u=we((S=it(I,x,g,M=b))^u,(E=b)^o,24),o=it(o=c,p,u,c=b),a[e>>2]=o,p=b,a[e+4>>2]=p,o=we(o^g,p^M,16),a[e+904>>2]=o,p=b,a[e+908>>2]=p,o=it(S,E,o,p),a[e+640>>2]=o,p=b,a[e+644>>2]=p,K=e,H=we(o^u,c^p,63),a[K+264>>2]=H,a[e+268>>2]=b,u=s,c=we(w^(o=it(O,R,s,i)),A^(s=b),32),u=we(u^(w=it(C,P,c,p=b)),(g=i)^(i=b),24),o=it(o,g=s,u,s=b),a[e+8>>2]=o,A=b,a[e+12>>2]=A,o=we(o^c,p^A,16),a[e+768>>2]=o,c=b,a[e+772>>2]=c,o=it(w,i,o,c),a[e+648>>2]=o,i=b,a[e+652>>2]=i,K=e,H=we(o^u,i^s,63),a[K+384>>2]=H,a[e+388>>2]=b,u=l,i=we(N^(o=it(D,j,l,d)),L^(s=b),32),u=we(u^(c=it(k,B,i,l=b)),(g=d)^(d=b),24),o=it(o,g=s,u,s=b),a[e+128>>2]=o,p=b,a[e+132>>2]=p,o=we(i^o,l^p,16),a[e+776>>2]=o,i=b,a[e+780>>2]=i,o=it(c,d,o,i),a[e+512>>2]=o,i=b,a[e+516>>2]=i,K=e,H=we(o^u,i^s,63),a[K+392>>2]=H,a[e+396>>2]=b,u=it(h,_,v,f),l=it(Q,U,s=we(m^u,T^(o=b),32),i=b),f=it(c=u,o,v=we(l^v,(d=b)^f,24),u=b),a[e+136>>2]=f,o=b,a[e+140>>2]=o,f=we(s^f,i^o,16),a[e+896>>2]=f,o=b,a[e+900>>2]=o,f=it(l,d,f,o),a[e+520>>2]=f,o=b,a[e+524>>2]=o,K=e,H=we(f^v,o^u,63),a[K+256>>2]=H,a[e+260>>2]=b,8!=(0|(t=t+1|0)););yn(n,r),et(n,r+1024|0),y=r+2048|0}function O(e){var t=0,n=0,r=0,i=0,o=0,s=0,l=0,u=0,d=0;e:if(e|=0){o=(r=e-8|0)+(e=-8&(t=a[e-4>>2]))|0;t:if(!(1&t)){if(!(3&t))break e;if((r=r-(t=a[r>>2])|0)>>>0<c[8969])break e;if(e=e+t|0,a[8970]==(0|r)){if(3==(3&(t=a[o+4>>2])))return a[8967]=e,a[o+4>>2]=-2&t,a[r+4>>2]=1|e,void(a[e+r>>2]=e)}else{if(t>>>0<=255){if(i=a[r+8>>2],t=t>>>3|0,(0|(n=a[r+12>>2]))==(0|i)){u=35860,d=a[8965]&Et(-2,t),a[u>>2]=d;break t}a[i+12>>2]=n,a[n+8>>2]=i;break t}if(l=a[r+24>>2],(0|r)==(0|(t=a[r+12>>2])))if((n=a[(i=r+20|0)>>2])||(n=a[(i=r+16|0)>>2])){for(;s=i,(n=a[(i=(t=n)+20|0)>>2])||(i=t+16|0,n=a[t+16>>2]););a[s>>2]=0}else t=0;else n=a[r+8>>2],a[n+12>>2]=t,a[t+8>>2]=n;if(!l)break t;i=a[r+28>>2];n:{if(a[(n=36164+(i<<2)|0)>>2]==(0|r)){if(a[n>>2]=t,t)break n;u=35864,d=a[8966]&Et(-2,i),a[u>>2]=d;break t}if(a[l+(a[l+16>>2]==(0|r)?16:20)>>2]=t,!t)break t}if(a[t+24>>2]=l,(n=a[r+16>>2])&&(a[t+16>>2]=n,a[n+24>>2]=t),!(n=a[r+20>>2]))break t;a[t+20>>2]=n,a[n+24>>2]=t}}if(!(r>>>0>=o>>>0)&&1&(t=a[o+4>>2])){t:{if(!(2&t)){if(a[8971]==(0|o)){if(a[8971]=r,e=a[8968]+e|0,a[8968]=e,a[r+4>>2]=1|e,a[8970]!=(0|r))break e;return a[8967]=0,void(a[8970]=0)}if(a[8970]==(0|o))return a[8970]=r,e=a[8967]+e|0,a[8967]=e,a[r+4>>2]=1|e,void(a[e+r>>2]=e);e=(-8&t)+e|0;n:if(t>>>0<=255){if(i=a[o+8>>2],t=t>>>3|0,(0|(n=a[o+12>>2]))==(0|i)){u=35860,d=a[8965]&Et(-2,t),a[u>>2]=d;break n}a[i+12>>2]=n,a[n+8>>2]=i}else{if(l=a[o+24>>2],(0|o)==(0|(t=a[o+12>>2])))if((n=a[(i=o+20|0)>>2])||(n=a[(i=o+16|0)>>2])){for(;s=i,(n=a[(i=(t=n)+20|0)>>2])||(i=t+16|0,n=a[t+16>>2]););a[s>>2]=0}else t=0;else n=a[o+8>>2],a[n+12>>2]=t,a[t+8>>2]=n;if(l){i=a[o+28>>2];r:{if(a[(n=36164+(i<<2)|0)>>2]==(0|o)){if(a[n>>2]=t,t)break r;u=35864,d=a[8966]&Et(-2,i),a[u>>2]=d;break n}if(a[l+(a[l+16>>2]==(0|o)?16:20)>>2]=t,!t)break n}a[t+24>>2]=l,(n=a[o+16>>2])&&(a[t+16>>2]=n,a[n+24>>2]=t),(n=a[o+20>>2])&&(a[t+20>>2]=n,a[n+24>>2]=t)}}if(a[r+4>>2]=1|e,a[e+r>>2]=e,a[8970]!=(0|r))break t;return void(a[8967]=e)}a[o+4>>2]=-2&t,a[r+4>>2]=1|e,a[e+r>>2]=e}if(e>>>0<=255)return t=35900+((e=e>>>3|0)<<3)|0,(n=a[8965])&(e=1<<e)?e=a[t+8>>2]:(a[8965]=e|n,e=t),a[t+8>>2]=r,a[e+12>>2]=r,a[r+12>>2]=t,void(a[r+8>>2]=e);i=31,a[r+16>>2]=0,a[r+20>>2]=0,e>>>0<=16777215&&(t=e>>>8|0,t<<=s=t+1048320>>>16&8,i=28+((t=((t<<=i=t+520192>>>16&4)<<(n=t+245760>>>16&2)>>>15|0)-(n|i|s)|0)<<1|e>>>t+21&1)|0),a[r+28>>2]=i,s=36164+(i<<2)|0;t:{n:{if((n=a[8966])&(t=1<<i)){for(i=e<<(31==(0|i)?0:25-(i>>>1|0)|0),t=a[s>>2];;){if(n=t,(-8&a[t+4>>2])==(0|e))break n;if(t=i>>>29|0,i<<=1,!(t=a[16+(s=n+(4&t)|0)>>2]))break}a[s+16>>2]=r,a[r+24>>2]=n}else a[8966]=t|n,a[s>>2]=r,a[r+24>>2]=s;a[r+12>>2]=r,a[r+8>>2]=r;break t}e=a[n+8>>2],a[e+12>>2]=r,a[n+8>>2]=r,a[r+24>>2]=0,a[r+12>>2]=n,a[r+8>>2]=e}e=a[8973]-1|0,a[8973]=e||-1}}}function N(e,t,n,r,i){var s,c,u,d,h,p,f,g,m,v,A,b,w,S,C,E=0,I=0,_=0,x=0,P=0,k=0,B=0,O=0,N=0,D=0,j=0,T=0,M=0,F=0,R=0,L=0,Q=0,U=0,V=0,K=0,H=0,G=0,Y=0,z=0,Z=0,W=0,q=0,J=0,X=0,$=0,ee=0,te=0,ne=0,re=0;for(y=s=y+-64|0,c=a[e+60>>2],u=a[e+56>>2],V=a[e+52>>2],Q=a[e+48>>2],d=a[e+44>>2],h=a[e+40>>2],p=a[e+36>>2],f=a[e+32>>2],g=a[e+28>>2],m=a[e+24>>2],v=a[e+20>>2],A=a[e+16>>2],b=a[e+12>>2],w=a[e+8>>2],S=a[e+4>>2],C=a[e>>2];;){if(!i&r>>>0>63|i)I=n;else{if(x=0,I=vt(s,0,64),r|i)for(;o[I+x|0]=l[t+x|0],!i&(x=x+1|0)>>>0<r>>>0|i;);t=I,G=n}for(K=20,O=C,N=S,D=w,j=b,x=A,P=v,n=m,T=g,k=f,B=p,M=h,F=c,L=u,E=V,_=Q,U=d;R=x,O=mn((x=x+O|0)^_,16),_=mn(R^(k=O+k|0),12),R=k,k=mn((k=O)^(O=x+_|0),8),x=mn(_^(R=R+k|0),7),_=P,N=mn((P=P+N|0)^E,16),E=mn(_^(B=N+B|0),12),_=B,B=mn((B=N)^(N=P+E|0),8),P=mn(E^(H=_+B|0),7),E=n,D=mn((n=n+D|0)^L,16),E=L=mn(E^(M=D+M|0),12),L=mn((_=D)^(D=n+L|0),8),n=mn(E^(M=L+M|0),7),E=T,j=mn((T=T+j|0)^F,16),_=E=mn(E^(F=j+U|0),12),U=F,F=mn((F=j)^(j=T+E|0),8),T=mn(_^(E=U+F|0),7),_=M,M=mn((O=P+O|0)^F,16),P=mn((_=_+M|0)^P,12),F=mn(M^(O=P+O|0),8),P=mn(P^(M=_+F|0),7),k=mn((N=n+N|0)^k,16),n=mn((E=k+E|0)^n,12),_=mn(k^(N=n+N|0),8),n=mn(n^(U=E+_|0),7),k=mn((D=T+D|0)^B,16),T=mn((B=k+R|0)^T,12),E=mn(k^(D=T+D|0),8),T=mn(T^(k=B+E|0),7),B=mn((j=x+j|0)^L,16),x=mn((R=B+H|0)^x,12),L=mn(B^(j=x+j|0),8),x=mn(x^(B=R+L|0),7),K=K-2|0;);if(K=l[t+4|0]|l[t+5|0]<<8|l[t+6|0]<<16|l[t+7|0]<<24,R=l[t+8|0]|l[t+9|0]<<8|l[t+10|0]<<16|l[t+11|0]<<24,H=l[t+12|0]|l[t+13|0]<<8|l[t+14|0]<<16|l[t+15|0]<<24,Y=l[t+16|0]|l[t+17|0]<<8|l[t+18|0]<<16|l[t+19|0]<<24,z=l[t+20|0]|l[t+21|0]<<8|l[t+22|0]<<16|l[t+23|0]<<24,Z=l[t+24|0]|l[t+25|0]<<8|l[t+26|0]<<16|l[t+27|0]<<24,W=l[t+28|0]|l[t+29|0]<<8|l[t+30|0]<<16|l[t+31|0]<<24,q=l[t+32|0]|l[t+33|0]<<8|l[t+34|0]<<16|l[t+35|0]<<24,J=l[t+36|0]|l[t+37|0]<<8|l[t+38|0]<<16|l[t+39|0]<<24,X=l[t+40|0]|l[t+41|0]<<8|l[t+42|0]<<16|l[t+43|0]<<24,$=l[t+44|0]|l[t+45|0]<<8|l[t+46|0]<<16|l[t+47|0]<<24,ee=l[t+48|0]|l[t+49|0]<<8|l[t+50|0]<<16|l[t+51|0]<<24,te=l[t+52|0]|l[t+53|0]<<8|l[t+54|0]<<16|l[t+55|0]<<24,ne=l[t+56|0]|l[t+57|0]<<8|l[t+58|0]<<16|l[t+59|0]<<24,re=l[t+60|0]|l[t+61|0]<<8|l[t+62|0]<<16|l[t+63|0]<<24,Ot(I,O+C^(l[0|t]|l[t+1|0]<<8|l[t+2|0]<<16|l[t+3|0]<<24)),Ot(I+4|0,N+S^K),Ot(I+8|0,D+w^R),Ot(I+12|0,j+b^H),Ot(I+16|0,x+A^Y),Ot(I+20|0,P+v^z),Ot(I+24|0,n+m^Z),Ot(I+28|0,T+g^W),Ot(I+32|0,k+f^q),Ot(I+36|0,B+p^J),Ot(I+40|0,X^M+h),Ot(I+44|0,$^U+d),Ot(I+48|0,ee^_+Q),Ot(I+52|0,te^E+V),Ot(I+56|0,ne^L+u),Ot(I+60|0,re^F+c),V=((Q=(n=Q)+1|0)>>>0<n>>>0)+V|0,!i&r>>>0<=64){if(!(!r|!i&r>>>0>63|0!=(0|i)))for(P=0;o[P+G|0]=l[I+P|0],(0|r)!=(0|(P=P+1|0)););a[e+52>>2]=V,a[e+48>>2]=Q,y=s- -64|0;break}t=t- -64|0,n=I- -64|0,i=i-1|0,i=(r=r+-64|0)>>>0<4294967232?i+1|0:i}}function D(e,t){var n,r=0,i=0,o=0,s=0,l=0,c=0,u=0;n=e+t|0;e:{t:if(!(1&(r=a[e+4>>2]))){if(!(3&r))break e;t=(r=a[e>>2])+t|0;n:{if((0|(e=e-r|0))!=a[8970]){if(r>>>0<=255){if(o=a[e+8>>2],r=r>>>3|0,(0|(i=a[e+12>>2]))!=(0|o))break n;c=35860,u=a[8965]&Et(-2,r),a[c>>2]=u;break t}if(l=a[e+24>>2],(0|(r=a[e+12>>2]))==(0|e))if((i=a[(o=e+20|0)>>2])||(i=a[(o=e+16|0)>>2])){for(;s=o,(i=a[(o=(r=i)+20|0)>>2])||(o=r+16|0,i=a[r+16>>2]););a[s>>2]=0}else r=0;else i=a[e+8>>2],a[i+12>>2]=r,a[r+8>>2]=i;if(!l)break t;o=a[e+28>>2];r:{if(a[(i=36164+(o<<2)|0)>>2]==(0|e)){if(a[i>>2]=r,r)break r;c=35864,u=a[8966]&Et(-2,o),a[c>>2]=u;break t}if(a[l+(a[l+16>>2]==(0|e)?16:20)>>2]=r,!r)break t}if(a[r+24>>2]=l,(i=a[e+16>>2])&&(a[r+16>>2]=i,a[i+24>>2]=r),!(i=a[e+20>>2]))break t;a[r+20>>2]=i,a[i+24>>2]=r;break t}if(3!=(3&(r=a[n+4>>2])))break t;return a[8967]=t,a[n+4>>2]=-2&r,a[e+4>>2]=1|t,void(a[n>>2]=t)}a[o+12>>2]=i,a[i+8>>2]=o}t:{if(!(2&(r=a[n+4>>2]))){if(a[8971]==(0|n)){if(a[8971]=e,t=a[8968]+t|0,a[8968]=t,a[e+4>>2]=1|t,a[8970]!=(0|e))break e;return a[8967]=0,void(a[8970]=0)}if(a[8970]==(0|n))return a[8970]=e,t=a[8967]+t|0,a[8967]=t,a[e+4>>2]=1|t,void(a[e+t>>2]=t);t=(-8&r)+t|0;n:if(r>>>0<=255){if(o=a[n+8>>2],r=r>>>3|0,(0|(i=a[n+12>>2]))==(0|o)){c=35860,u=a[8965]&Et(-2,r),a[c>>2]=u;break n}a[o+12>>2]=i,a[i+8>>2]=o}else{if(l=a[n+24>>2],(0|n)==(0|(r=a[n+12>>2])))if((o=a[(i=n+20|0)>>2])||(o=a[(i=n+16|0)>>2])){for(;s=i,(o=a[(i=(r=o)+20|0)>>2])||(i=r+16|0,o=a[r+16>>2]););a[s>>2]=0}else r=0;else i=a[n+8>>2],a[i+12>>2]=r,a[r+8>>2]=i;if(l){o=a[n+28>>2];r:{if(a[(i=36164+(o<<2)|0)>>2]==(0|n)){if(a[i>>2]=r,r)break r;c=35864,u=a[8966]&Et(-2,o),a[c>>2]=u;break n}if(a[l+(a[l+16>>2]==(0|n)?16:20)>>2]=r,!r)break n}a[r+24>>2]=l,(i=a[n+16>>2])&&(a[r+16>>2]=i,a[i+24>>2]=r),(i=a[n+20>>2])&&(a[r+20>>2]=i,a[i+24>>2]=r)}}if(a[e+4>>2]=1|t,a[e+t>>2]=t,a[8970]!=(0|e))break t;return void(a[8967]=t)}a[n+4>>2]=-2&r,a[e+4>>2]=1|t,a[e+t>>2]=t}if(t>>>0<=255)return r=35900+((t=t>>>3|0)<<3)|0,(i=a[8965])&(t=1<<t)?t=a[r+8>>2]:(a[8965]=t|i,t=r),a[r+8>>2]=e,a[t+12>>2]=e,a[e+12>>2]=r,void(a[e+8>>2]=t);o=31,a[e+16>>2]=0,a[e+20>>2]=0,t>>>0<=16777215&&(r=t>>>8|0,r<<=s=r+1048320>>>16&8,o=28+((r=((r<<=o=r+520192>>>16&4)<<(i=r+245760>>>16&2)>>>15|0)-(i|o|s)|0)<<1|t>>>r+21&1)|0),a[e+28>>2]=o,s=36164+(o<<2)|0;t:{if((i=a[8966])&(r=1<<o)){for(o=t<<(31==(0|o)?0:25-(o>>>1|0)|0),r=a[s>>2];;){if(i=r,(-8&a[r+4>>2])==(0|t))break t;if(r=o>>>29|0,o<<=1,!(r=a[16+(s=i+(4&r)|0)>>2]))break}a[s+16>>2]=e,a[e+24>>2]=i}else a[8966]=r|i,a[s>>2]=e,a[e+24>>2]=s;return a[e+12>>2]=e,void(a[e+8>>2]=e)}t=a[i+8>>2],a[t+12>>2]=e,a[i+8>>2]=e,a[e+24>>2]=0,a[e+12>>2]=i,a[e+8>>2]=t}}function j(e,t,n,r){var i=0,o=0,s=0,c=0,d=0,h=0,p=0,f=0,g=0,m=0,y=0,v=0,A=0,w=0,S=0,C=0,E=0,I=0,_=0,x=0,P=0,k=0,B=0,O=0,N=0;if(g=a[e+36>>2],c=a[e+32>>2],s=a[e+28>>2],o=a[e+24>>2],d=a[e+20>>2],!r&n>>>0>=16|r)for(P=!l[e+80|0]<<24,y=a[e+4>>2],k=u(y,5),w=a[e+8>>2],x=u(w,5),I=a[e+12>>2],_=u(I,5),i=a[e+16>>2],S=u(i,5),B=i,v=a[e>>2];i=ze(h=((l[t+3|0]|l[t+4|0]<<8|l[t+5|0]<<16|l[t+6|0]<<24)>>>2&67108863)+o|0,0,I,0),p=b,o=(m=ze(d=(67108863&(l[0|t]|l[t+1|0]<<8|l[t+2|0]<<16|l[t+3|0]<<24))+d|0,0,B,0))+i|0,i=b+p|0,i=o>>>0<m>>>0?i+1|0:i,f=o,o=ze(p=((l[t+6|0]|l[t+7|0]<<8|l[t+8|0]<<16|l[t+9|0]<<24)>>>4&67108863)+s|0,0,w,0),i=b+i|0,i=o>>>0>(s=f+o|0)>>>0?i+1|0:i,o=s,s=ze(m=((l[t+9|0]|l[t+10|0]<<8|l[t+11|0]<<16|l[t+12|0]<<24)>>>6|0)+c|0,0,y,0),i=b+i|0,i=s>>>0>(c=o+s|0)>>>0?i+1|0:i,o=c,c=ze(A=g+P+((l[t+12|0]|l[t+13|0]<<8|l[t+14|0]<<16|l[t+15|0]<<24)>>>8)|0,0,v,0),i=b+i|0,O=g=o+c|0,g=c>>>0>g>>>0?i+1|0:i,i=ze(h,0,w,0),s=b,c=(o=ze(d,0,I,0))+i|0,i=b+s|0,i=o>>>0>c>>>0?i+1|0:i,s=ze(p,0,y,0),i=b+i|0,i=s>>>0>(c=s+c|0)>>>0?i+1|0:i,s=ze(m,0,v,0),i=b+i|0,i=s>>>0>(c=s+c|0)>>>0?i+1|0:i,s=ze(A,0,S,0),i=b+i|0,N=c=s+c|0,c=s>>>0>c>>>0?i+1|0:i,i=ze(h,0,y,0),o=b,s=(C=ze(d,0,w,0))+i|0,i=b+o|0,i=s>>>0<C>>>0?i+1|0:i,o=ze(p,0,v,0),i=b+i|0,i=o>>>0>(s=o+s|0)>>>0?i+1|0:i,o=ze(m,0,S,0),i=b+i|0,i=o>>>0>(s=o+s|0)>>>0?i+1|0:i,o=ze(A,0,_,0),i=b+i|0,C=s=o+s|0,s=o>>>0>s>>>0?i+1|0:i,i=ze(h,0,v,0),f=b,o=(E=ze(d,0,y,0))+i|0,i=b+f|0,i=o>>>0<E>>>0?i+1|0:i,f=ze(p,0,S,0),i=b+i|0,i=(o=f+o|0)>>>0<f>>>0?i+1|0:i,f=ze(m,0,_,0),i=b+i|0,i=(o=f+o|0)>>>0<f>>>0?i+1|0:i,f=ze(A,0,x,0),i=b+i|0,i=(o=f+o|0)>>>0<f>>>0?i+1|0:i,f=o,o=i,i=ze(h,0,S,0),E=b,h=(d=ze(d,0,v,0))+i|0,i=b+E|0,i=h>>>0<d>>>0?i+1|0:i,d=ze(p,0,_,0),i=b+i|0,i=(h=d+h|0)>>>0<d>>>0?i+1|0:i,d=ze(m,0,x,0),i=b+i|0,i=(h=d+h|0)>>>0<d>>>0?i+1|0:i,d=ze(A,0,k,0),i=b+i|0,i=(h=d+h|0)>>>0<d>>>0?i+1|0:i,d=h,p=(67108863&i)<<6|h>>>26,i=o,p=(67108863&(i=(h=p+f|0)>>>0<p>>>0?i+1|0:i))<<6|(o=h)>>>26,i=s,i=(o=p+C|0)>>>0<p>>>0?i+1|0:i,p=o,o=(67108863&i)<<6|o>>>26,i=c,m=s=o+N|0,s=(67108863&(i=o>>>0>s>>>0?i+1|0:i))<<6|s>>>26,i=g,g=c=s+O|0,o=(67108863&h)+((i=u((67108863&(s>>>0>c>>>0?i+1|0:i))<<6|c>>>26,5)+(67108863&d)|0)>>>26|0)|0,s=67108863&p,c=67108863&m,g&=67108863,d=67108863&i,t=t+16|0,!(r=r-(n>>>0<16)|0)&(n=n-16|0)>>>0>15|r;);a[e+20>>2]=d,a[e+36>>2]=g,a[e+32>>2]=c,a[e+28>>2]=s,a[e+24>>2]=o}function T(e,t,n){var r,i,s,a,c=0,u=0,d=0,h=0,p=0;return y=s=y-160|0,It(t,n,32,0),o[0|t]=248&l[0|t],o[t+31|0]=63&l[t+31|0]|64,re(s,t),tt(e,s),u=l[(i=n)+8|0]|l[i+9|0]<<8|l[i+10|0]<<16|l[i+11|0]<<24,c=l[i+12|0]|l[i+13|0]<<8|l[i+14|0]<<16|l[i+15|0]<<24,d=l[i+16|0]|l[i+17|0]<<8|l[i+18|0]<<16|l[i+19|0]<<24,h=l[i+20|0]|l[i+21|0]<<8|l[i+22|0]<<16|l[i+23|0]<<24,p=l[0|i]|l[i+1|0]<<8|l[i+2|0]<<16|l[i+3|0]<<24,n=l[i+4|0]|l[i+5|0]<<8|l[i+6|0]<<16|l[i+7|0]<<24,a=l[i+28|0]|l[i+29|0]<<8|l[i+30|0]<<16|l[i+31|0]<<24,r=t,t=l[i+24|0]|l[i+25|0]<<8|l[i+26|0]<<16|l[i+27|0]<<24,o[r+24|0]=t,o[r+25|0]=t>>>8,o[r+26|0]=t>>>16,o[r+27|0]=t>>>24,o[r+28|0]=a,o[r+29|0]=a>>>8,o[r+30|0]=a>>>16,o[r+31|0]=a>>>24,o[r+16|0]=d,o[r+17|0]=d>>>8,o[r+18|0]=d>>>16,o[r+19|0]=d>>>24,o[r+20|0]=h,o[r+21|0]=h>>>8,o[r+22|0]=h>>>16,o[r+23|0]=h>>>24,o[r+8|0]=u,o[r+9|0]=u>>>8,o[r+10|0]=u>>>16,o[r+11|0]=u>>>24,o[r+12|0]=c,o[r+13|0]=c>>>8,o[r+14|0]=c>>>16,o[r+15|0]=c>>>24,o[0|r]=p,o[r+1|0]=p>>>8,o[r+2|0]=p>>>16,o[r+3|0]=p>>>24,o[r+4|0]=n,o[r+5|0]=n>>>8,o[r+6|0]=n>>>16,o[r+7|0]=n>>>24,d=l[(c=e)+8|0]|l[c+9|0]<<8|l[c+10|0]<<16|l[c+11|0]<<24,h=l[c+12|0]|l[c+13|0]<<8|l[c+14|0]<<16|l[c+15|0]<<24,p=l[c+16|0]|l[c+17|0]<<8|l[c+18|0]<<16|l[c+19|0]<<24,n=l[c+20|0]|l[c+21|0]<<8|l[c+22|0]<<16|l[c+23|0]<<24,t=l[0|c]|l[c+1|0]<<8|l[c+2|0]<<16|l[c+3|0]<<24,e=l[c+4|0]|l[c+5|0]<<8|l[c+6|0]<<16|l[c+7|0]<<24,u=l[c+28|0]|l[c+29|0]<<8|l[c+30|0]<<16|l[c+31|0]<<24,c=l[c+24|0]|l[c+25|0]<<8|l[c+26|0]<<16|l[c+27|0]<<24,o[r+56|0]=c,o[r+57|0]=c>>>8,o[r+58|0]=c>>>16,o[r+59|0]=c>>>24,o[r+60|0]=u,o[r+61|0]=u>>>8,o[r+62|0]=u>>>16,o[r+63|0]=u>>>24,o[r+48|0]=p,o[r+49|0]=p>>>8,o[r+50|0]=p>>>16,o[r+51|0]=p>>>24,o[r+52|0]=n,o[r+53|0]=n>>>8,o[r+54|0]=n>>>16,o[r+55|0]=n>>>24,o[r+40|0]=d,o[r+41|0]=d>>>8,o[r+42|0]=d>>>16,o[r+43|0]=d>>>24,o[r+44|0]=h,o[r+45|0]=h>>>8,o[r+46|0]=h>>>16,o[r+47|0]=h>>>24,o[r+32|0]=t,o[r+33|0]=t>>>8,o[r+34|0]=t>>>16,o[r+35|0]=t>>>24,o[r+36|0]=e,o[r+37|0]=e>>>8,o[r+38|0]=e>>>16,o[r+39|0]=e>>>24,y=s+160|0,0}function M(e,t,n){var r,i=0,s=0;y=r=y+-64|0;e:{if((n-65&255)>>>0>191){if(i=-1,!(l[e+80|0]|l[e+81|0]<<8|l[e+82|0]<<16|l[e+83|0]<<24|l[e+84|0]|l[e+85|0]<<8|l[e+86|0]<<16|l[e+87|0]<<24)){if((i=l[e+352|0]|l[e+353|0]<<8|l[e+354|0]<<16|l[e+355|0]<<24)>>>0>=129){if(ie(e,128),w(e,s=e+96|0),i=(l[e+352|0]|l[e+353|0]<<8|l[e+354|0]<<16|l[e+355|0]<<24)-128|0,o[e+352|0]=i,o[e+353|0]=i>>>8,o[e+354|0]=i>>>16,o[e+355|0]=i>>>24,i>>>0>=129)break e;pt(s,e+224|0,i),i=l[e+352|0]|l[e+353|0]<<8|l[e+354|0]<<16|l[e+355|0]<<24}ie(e,i),l[e+356|0]&&(o[e+88|0]=255,o[e+89|0]=255,o[e+90|0]=255,o[e+91|0]=255,o[e+92|0]=255,o[e+93|0]=255,o[e+94|0]=255,o[e+95|0]=255),o[e+80|0]=255,o[e+81|0]=255,o[e+82|0]=255,o[e+83|0]=255,o[e+84|0]=255,o[e+85|0]=255,o[e+86|0]=255,o[e+87|0]=255,vt((i=e+96|0)+(s=l[e+352|0]|l[e+353|0]<<8|l[e+354|0]<<16|l[e+355|0]<<24)|0,0,256-s|0),w(e,i),ot(r,l[0|e]|l[e+1|0]<<8|l[e+2|0]<<16|l[e+3|0]<<24,l[e+4|0]|l[e+5|0]<<8|l[e+6|0]<<16|l[e+7|0]<<24),ot(8|r,l[e+8|0]|l[e+9|0]<<8|l[e+10|0]<<16|l[e+11|0]<<24,l[e+12|0]|l[e+13|0]<<8|l[e+14|0]<<16|l[e+15|0]<<24),ot(r+16|0,l[e+16|0]|l[e+17|0]<<8|l[e+18|0]<<16|l[e+19|0]<<24,l[e+20|0]|l[e+21|0]<<8|l[e+22|0]<<16|l[e+23|0]<<24),ot(r+24|0,l[e+24|0]|l[e+25|0]<<8|l[e+26|0]<<16|l[e+27|0]<<24,l[e+28|0]|l[e+29|0]<<8|l[e+30|0]<<16|l[e+31|0]<<24),ot(r+32|0,l[e+32|0]|l[e+33|0]<<8|l[e+34|0]<<16|l[e+35|0]<<24,l[e+36|0]|l[e+37|0]<<8|l[e+38|0]<<16|l[e+39|0]<<24),ot(r+40|0,l[e+40|0]|l[e+41|0]<<8|l[e+42|0]<<16|l[e+43|0]<<24,l[e+44|0]|l[e+45|0]<<8|l[e+46|0]<<16|l[e+47|0]<<24),ot(r+48|0,l[e+48|0]|l[e+49|0]<<8|l[e+50|0]<<16|l[e+51|0]<<24,l[e+52|0]|l[e+53|0]<<8|l[e+54|0]<<16|l[e+55|0]<<24),ot(r+56|0,l[e+56|0]|l[e+57|0]<<8|l[e+58|0]<<16|l[e+59|0]<<24,l[e+60|0]|l[e+61|0]<<8|l[e+62|0]<<16|l[e+63|0]<<24),pt(t,r,n),bn(e,64),bn(i,256),i=0}return y=r- -64|0,i}Ut(),h()}p(1299,1161,306,1086),h()}function F(e,t){var n,r,i,o,s,c,u,d,h,p=0,f=0,g=0,m=0,y=0,v=0,A=0,w=0,S=0,C=0;n=l[0|t]|l[t+1|0]<<8|l[t+2|0]<<16|l[t+3|0]<<24,S=St(t+4|0),p=b,v=St(t+7|0),m=b,w=St(t+10|0),f=b,r=St(t+13|0),y=b,g=l[t+16|0]|l[t+17|0]<<8|l[t+18|0]<<16|l[t+19|0]<<24,i=St(t+20|0),o=b,s=St(t+23|0),c=b,u=St(t+26|0),d=b,h=St(t+29|0),t=f<<3|w>>>29,C=f=w<<3,w=f=f+16777216|0,f=t=f>>>0<16777216?t+1|0:t,A=v<<5,m=t=m<<5|v>>>27,p=t=p<<6|(v=S)>>>26,S=t=16777216+(v<<=6)|0,t=(t=(p=t>>>0<16777216?p+1|0:p)>>25)+m|0,t=(p=A+(A=(33554431&p)<<7|S>>>25)|0)>>>0<A>>>0?t+1|0:t,t=(C-(-33554432&w)|0)+((67108863&(t=(m=p+33554432|0)>>>0<33554432?t+1|0:t))<<6|m>>>26)|0,a[e+12>>2]=t,t=-67108864&m,a[e+8>>2]=p-t,t=0,m=g=(p=g)+16777216|0,g=t=g>>>0<16777216?1:t,C=p-(-33554432&m)|0,t=y<<2|(p=r)>>>30,y=p<<2,p=t,t=(t=f>>25)+p|0,p=t=(f=(A=y)+(y=(33554431&f)<<7|w>>>25)|0)>>>0<y>>>0?t+1|0:t,y=t=f+33554432|0,t=((67108863&(p=t>>>0<33554432?p+1|0:p))<<6|t>>>26)+C|0,a[e+20>>2]=t,t=-67108864&y,a[e+16>>2]=f-t,f=(p=i)<<7,t=(t=o<<7|p>>>25)+(p=g>>25)|0,t=(f=f+(g=(33554431&g)<<7|m>>>25)|0)>>>0<g>>>0?t+1|0:t,f=p=f,g=p=p+33554432|0,p=t=p>>>0<33554432?t+1|0:t,t=-67108864&g,a[e+24>>2]=f-t,t=c<<5|(f=s)>>>27,y=f<<=5,m=f=f+16777216|0,f=t=f>>>0<16777216?t+1|0:t,t=(y-(-33554432&m)|0)+((67108863&p)<<6|g>>>26)|0,a[e+28>>2]=t,g=(p=u)<<4,p=t=d<<4|p>>>28,t=(t=f>>25)+p|0,t=(f=(y=g)+(g=(33554431&f)<<7|m>>>25)|0)>>>0<g>>>0?t+1|0:t,f=p=f,g=p=p+33554432|0,p=t=p>>>0<33554432?t+1|0:t,t=-67108864&g,a[e+32>>2]=f-t,t=0,m=f=(f=h)<<2&33554428,t=(f=f+16777216|0)>>>0<16777216?t+1|0:t,p=(m-(33554432&f)|0)+((67108863&p)<<6|g>>>26)|0,a[e+36>>2]=p,f=ze((33554431&t)<<7|f>>>25,t>>>25|0,19,0),t=b,t=(p=f+n|0)>>>0<f>>>0?t+1|0:t,t=(v-(-33554432&S)|0)+((67108863&(t=(f=p+33554432|0)>>>0<33554432?t+1|0:t))<<6|f>>>26)|0,a[e+4>>2]=t,t=e,e=-67108864&f,a[t>>2]=p-e}function R(e,t,n,r){var i,s=0;i=s=y,y=s=s-576&-64,a[s+188>>2]=0,Ot(s+188|0,t);e:if(t>>>0<=64){if((0|Je(s+192|0,0,0,t))<0)break e;if((0|on(s+192|0,s+188|0,4,0))<0)break e;if((0|on(s+192|0,n,r,0))<0)break e;kt(s+192|0,e,t)}else if(!((0|Je(s+192|0,0,0,64))<0||(0|on(s+192|0,s+188|0,4,0))<0||(0|on(s+192|0,n,r,0))<0||(0|kt(s+192|0,s+112|0,64))<0)){if(n=a[s+116>>2],r=a[s+112>>2],o[0|e]=r,o[e+1|0]=r>>>8,o[e+2|0]=r>>>16,o[e+3|0]=r>>>24,o[e+4|0]=n,o[e+5|0]=n>>>8,o[e+6|0]=n>>>16,o[e+7|0]=n>>>24,n=a[s+124>>2],r=a[s+120>>2],o[e+8|0]=r,o[e+9|0]=r>>>8,o[e+10|0]=r>>>16,o[e+11|0]=r>>>24,o[e+12|0]=n,o[e+13|0]=n>>>8,o[e+14|0]=n>>>16,o[e+15|0]=n>>>24,n=a[s+140>>2],r=a[s+136>>2],o[e+24|0]=r,o[e+25|0]=r>>>8,o[e+26|0]=r>>>16,o[e+27|0]=r>>>24,o[e+28|0]=n,o[e+29|0]=n>>>8,o[e+30|0]=n>>>16,o[e+31|0]=n>>>24,n=a[s+132>>2],r=a[s+128>>2],o[e+16|0]=r,o[e+17|0]=r>>>8,o[e+18|0]=r>>>16,o[e+19|0]=r>>>24,o[e+20|0]=n,o[e+21|0]=n>>>8,o[e+22|0]=n>>>16,o[e+23|0]=n>>>24,e=e+32|0,(t=t-32|0)>>>0>=65)for(;;){if(pt(n=s+48|0,r=s+112|0,64),(0|De(r,64,n,64,0,0,0))<0)break e;if(n=a[s+116>>2],r=a[s+112>>2],o[0|e]=r,o[e+1|0]=r>>>8,o[e+2|0]=r>>>16,o[e+3|0]=r>>>24,o[e+4|0]=n,o[e+5|0]=n>>>8,o[e+6|0]=n>>>16,o[e+7|0]=n>>>24,n=a[s+124>>2],r=a[s+120>>2],o[e+8|0]=r,o[e+9|0]=r>>>8,o[e+10|0]=r>>>16,o[e+11|0]=r>>>24,o[e+12|0]=n,o[e+13|0]=n>>>8,o[e+14|0]=n>>>16,o[e+15|0]=n>>>24,n=a[s+140>>2],r=a[s+136>>2],o[e+24|0]=r,o[e+25|0]=r>>>8,o[e+26|0]=r>>>16,o[e+27|0]=r>>>24,o[e+28|0]=n,o[e+29|0]=n>>>8,o[e+30|0]=n>>>16,o[e+31|0]=n>>>24,n=a[s+132>>2],r=a[s+128>>2],o[e+16|0]=r,o[e+17|0]=r>>>8,o[e+18|0]=r>>>16,o[e+19|0]=r>>>24,o[e+20|0]=n,o[e+21|0]=n>>>8,o[e+22|0]=n>>>16,o[e+23|0]=n>>>24,e=e+32|0,!((t=t-32|0)>>>0>64))break}pt(n=s+48|0,r=s+112|0,64),(0|De(r,t,n,64,0,0,0))<0||pt(e,s+112|0,t)}bn(s+192|0,384),y=i}function L(e,t,n){var r,i,o,s,a,c,u,d,h,p,f,g,m=0,y=0,v=0,A=0,b=0,w=0,S=0,C=0,E=0,I=0,_=0,x=0,P=0,k=0,B=0,O=0,N=0,D=0,j=0,T=0,M=0;for(r=l[n+4|0]|l[n+5|0]<<8|l[n+6|0]<<16|l[n+7|0]<<24,i=l[n+8|0]|l[n+9|0]<<8|l[n+10|0]<<16|l[n+11|0]<<24,o=l[n+12|0]|l[n+13|0]<<8|l[n+14|0]<<16|l[n+15|0]<<24,s=l[n+16|0]|l[n+17|0]<<8|l[n+18|0]<<16|l[n+19|0]<<24,a=l[n+20|0]|l[n+21|0]<<8|l[n+22|0]<<16|l[n+23|0]<<24,c=l[n+24|0]|l[n+25|0]<<8|l[n+26|0]<<16|l[n+27|0]<<24,u=l[n+28|0]|l[n+29|0]<<8|l[n+30|0]<<16|l[n+31|0]<<24,_=1634760805,n=d=l[0|n]|l[n+1|0]<<8|l[n+2|0]<<16|l[n+3|0]<<24,v=r,B=i,A=o,x=857760878,b=h=l[0|t]|l[t+1|0]<<8|l[t+2|0]<<16|l[t+3|0]<<24,w=p=l[t+4|0]|l[t+5|0]<<8|l[t+6|0]<<16|l[t+7|0]<<24,S=f=l[t+8|0]|l[t+9|0]<<8|l[t+10|0]<<16|l[t+11|0]<<24,I=g=l[t+12|0]|l[t+13|0]<<8|l[t+14|0]<<16|l[t+15|0]<<24,P=2036477234,t=s,C=1797285236,E=u,m=c,y=a;A=mn(y+_|0,7)^A,S=mn(A+_|0,9)^S,O=mn(S+A|0,13)^y,j=mn(S+O|0,18),y=mn(n+x|0,7)^I,k=mn(y+x|0,9)^m,n=mn(y+k|0,13)^n,I=mn(k+n|0,18),E=mn(b+P|0,7)^E,v=mn(E+P|0,9)^v,b=mn(E+v|0,13)^b,T=mn(v+b|0,18),m=mn(t+C|0,7)^B,w=mn(m+C|0,9)^w,N=mn(m+w|0,13)^t,M=mn(w+N|0,18),n=mn((t=_^j)+m|0,7)^n,v=mn(n+t|0,9)^v,B=mn(n+v|0,13)^m,_=mn(v+B|0,18)^t,b=mn((t=x^I)+A|0,7)^b,w=mn(b+t|0,9)^w,A=mn(w+b|0,13)^A,x=mn(w+A|0,18)^t,t=mn((m=P^T)+y|0,7)^N,S=mn(t+m|0,9)^S,I=mn(t+S|0,13)^y,P=mn(S+I|0,18)^m,y=mn((C^=M)+E|0,7)^O,m=mn(y+C|0,9)^k,E=mn(m+y|0,13)^E,C=mn(m+E|0,18)^C,k=D>>>0<18,D=D+2|0,k;);Ot(e,_+1634760805|0),Ot(e+4|0,n+d|0),Ot(e+8|0,v+r|0),Ot(e+12|0,B+i|0),Ot(e+16|0,A+o|0),Ot(e+20|0,x+857760878|0),Ot(e+24|0,b+h|0),Ot(e+28|0,w+p|0),Ot(e+32|0,S+f|0),Ot(e+36|0,I+g|0),Ot(e+40|0,P+2036477234|0),Ot(e+44|0,t+s|0),Ot(e+48|0,y+a|0),Ot(e+52|0,m+c|0),Ot(e+56|0,E+u|0),Ot(e+60|0,C+1797285236|0)}function Q(e,t,n,r,i,s){var a,c=0,d=0,h=0,p=0,f=0,g=0,m=0,v=0,A=0;for(y=a=y-592|0,p=-1,f=e+32|0,c=32,d=1;h=(g=l[f+(c=c-1|0)|0])-(m=l[c+2752|0])>>8&d|255&h,d&=65535+(g^m)>>>8,c;);if(h&&!ye(e)){for(c=127&(-1^l[i+31|0]),h=30;c=-1^l[i+h|0]|c,h=h-1|0;);if(((255&c)-1&236-l[0|i])<<23>>31!=-1&&!ye(i)&&!Y(a+128|0,i)){qt(c=a+384|0,s),Z(c,e,32,0),Z(c,i,32,0),Z(c,t,n,r),je(c,t=a+320|0),E(t),y=r=y-2272|0,de(r+2016|0,t),de(r+1760|0,f),At(n=r+480|0,i=a+128|0),ft(t=r+320|0,i),ht(r,t),Ue(t,r,n),ht(n=r+160|0,t),At(i=r+640|0,n),Ue(t,r,i),ht(n,t),At(i=r+800|0,n),Ue(t,r,i),ht(n,t),At(i=r+960|0,n),Ue(t,r,i),ht(n,t),At(i=r+1120|0,n),Ue(t,r,i),ht(n,t),At(i=r+1280|0,n),Ue(t,r,i),ht(n,t),At(i=r+1440|0,n),Ue(t,r,i),ht(n,t),At(r+1600|0,n),wn(s=a+8|0),cn(s+40|0),cn(s+80|0),i=255;e:{for(;;){if(!(l[(t=i)+(r+2016|0)|0]|l[(r+1760|0)+t|0])){if(i=t-1|0,t)continue;break e}break}if(!((0|t)<0))for(;P(r+320|0,s),n=t,(0|(t=o[(r+2016|0)+t|0]))>0?(ht(i=r+160|0,c=r+320|0),Ue(c,i,(r+480|0)+u((254&t)>>>1|0,160)|0)):(0|t)>=0||(ht(i=r+160|0,c=r+320|0),Qe(c,i,(r+480|0)+u((0-t&254)>>>1|0,160)|0)),(0|(d=o[n+(r+1760|0)|0]))>0?(ht(t=r+160|0,i=r+320|0),Ge(i,t,u((254&d)>>>1|0,120)+1568|0)):(0|d)>=0||(ht(i=r+160|0,t=r+320|0),y=h=y-48|0,me(t,p=i+40|0,i),ge(c=t+40|0,p,i),x(p=t+80|0,t,40+(f=u((0-d&254)>>>1|0,120)+1568|0)|0),x(c,c,f),x(d=t+120|0,f+80|0,i+120|0),me(h,i=i+80|0,i),ge(t,p,c),me(c,p,c),ge(p,h,d),me(d,h,d),y=h+48|0),bt(s,r+320|0),t=n-1|0,(0|n)>0;);}y=r+2272|0,tt(t=a+288|0,s),v=-1,A=fn(t,e),p=((0|e)==(0|t)?v:A)|Ze(e,t,32)}}return y=a+592|0,p}function U(e,t,n){var r=0,i=0,o=0,s=0,a=0,c=0,u=0,d=0,h=0,p=0,f=0,g=0,m=0,y=0,v=0,A=0,b=0,w=0,S=0;for(o=2036477234,h=857760878,p=1634760805,s=1797285236,d=l[0|n]|l[n+1|0]<<8|l[n+2|0]<<16|l[n+3|0]<<24,r=l[n+4|0]|l[n+5|0]<<8|l[n+6|0]<<16|l[n+7|0]<<24,i=l[n+8|0]|l[n+9|0]<<8|l[n+10|0]<<16|l[n+11|0]<<24,c=l[n+12|0]|l[n+13|0]<<8|l[n+14|0]<<16|l[n+15|0]<<24,g=l[n+16|0]|l[n+17|0]<<8|l[n+18|0]<<16|l[n+19|0]<<24,m=l[n+20|0]|l[n+21|0]<<8|l[n+22|0]<<16|l[n+23|0]<<24,v=l[n+24|0]|l[n+25|0]<<8|l[n+26|0]<<16|l[n+27|0]<<24,A=l[n+28|0]|l[n+29|0]<<8|l[n+30|0]<<16|l[n+31|0]<<24,n=l[0|t]|l[t+1|0]<<8|l[t+2|0]<<16|l[t+3|0]<<24,f=l[t+4|0]|l[t+5|0]<<8|l[t+6|0]<<16|l[t+7|0]<<24,a=l[t+8|0]|l[t+9|0]<<8|l[t+10|0]<<16|l[t+11|0]<<24,t=l[t+12|0]|l[t+13|0]<<8|l[t+14|0]<<16|l[t+15|0]<<24;u=d,p=mn((y=n)^(n=d+p|0),16),u=g=mn(u^(d=p+g|0),12),g=mn((y=p)^(p=n+g|0),8),d=mn(u^(b=g+d|0),7),u=r,h=mn((n=r+h|0)^f,16),u=f=mn(u^(r=h+m|0),12),f=mn((y=h)^(h=n+f|0),8),n=mn(u^(m=f+r|0),7),u=i,r=mn((o=o+i|0)^a,16),u=a=mn(u^(i=r+v|0),12),y=mn(r^(a=o+a|0),8),o=mn(u^(r=y+i|0),7),s=mn((i=t)^(t=s+c|0),16),c=mn((i=s+A|0)^c,12),t=mn(s^(w=t+c|0),8),s=mn(c^(i=t+i|0),7),u=r,r=mn((r=t)^(t=n+p|0),16),n=mn((c=u+r|0)^n,12),t=mn(r^(p=t+n|0),8),r=mn(n^(v=c+t|0),7),u=i,i=mn((n=o+h|0)^g,16),o=mn((c=u+i|0)^o,12),n=mn(i^(h=n+o|0),8),i=mn(o^(A=c+n|0),7),c=mn((o=s+a|0)^f,16),s=mn((a=c+b|0)^s,12),f=mn(c^(o=o+s|0),8),c=mn(s^(g=a+f|0),7),a=mn((s=d+w|0)^y,16),d=mn((m=a+m|0)^d,12),a=mn(a^(s=s+d|0),8),d=mn(d^(m=m+a|0),7),10!=(0|(S=S+1|0)););Ot(e,p),Ot(e+4|0,h),Ot(e+8|0,o),Ot(e+12|0,s),Ot(e+16|0,n),Ot(e+20|0,f),Ot(e+24|0,a),Ot(e+28|0,t)}function V(e,t,n,r,i,s,l,c){e|=0,t|=0,n|=0,r|=0,i|=0,s|=0,l|=0;var u,d=0,h=0,p=0,f=0,g=0,m=0,v=0,A=0,b=0;y=u=y-16|0,un(c|=0);e:{t:if(r){A=4&c;n:for(;;){for(h=f;;){d=o[n+h|0];r:{if(A?(p=d+4&(d+65488>>>8^-1)&(57-d>>>8^-1)&255|((p=d-65|0)>>>8^-1)&p&(90-d>>>8^-1)&255|d+185&(d+65439>>>8^-1)&(122-d>>>8^-1)&255|63&(1+(16288^d)>>>8^-1)|62&(1+(16338^d)>>>8^-1),p|=(0-p>>>8^-1)&1+(65470^d)>>>8&255):(p=d+4&(d+65488>>>8^-1)&(57-d>>>8^-1)&255|((p=d-65|0)>>>8^-1)&p&(90-d>>>8^-1)&255|d+185&(d+65439>>>8^-1)&(122-d>>>8^-1)&255|63&(1+(16336^d)>>>8^-1)|62&(1+(16340^d)>>>8^-1),p|=(0-p>>>8^-1)&1+(65470^d)>>>8&255),255==(0|p)){if(!i)break t;if(Ae(i,d))break r;f=h;break t}if(v=p+(v<<6)|0,(f=g+6|0)>>>0<8)g=f;else{if(g=g-2|0,t>>>0<=m>>>0){a[u+12>>2]=h,a[8952]=68,b=1;break e}o[e+m|0]=v>>>g,m=m+1|0}if((f=h+1|0)>>>0<r>>>0)continue n;break t}if(!((h=h+1|0)>>>0<r>>>0))break}break}f=(e=f+1|0)>>>0<r>>>0?r:e}a[u+12>>2]=f}e:if(g>>>0>4)t=0,e=-1;else if(e=-1,t=0,!((-1<<g^-1)&v|b)){if(!(2&c)){t:{n:{if(c=g>>>1|0)for(e=a[u+12>>2];;){if(e>>>0>=r>>>0){h=68;break n}if(61!=(0|(f=o[e+n|0]))){if(h=28,!i)break n;if(!Ae(i,f))break n}else c=c-1|0;if(e=e+1|0,a[u+12>>2]=e,!c)break}e=0;break t}a[8952]=h,e=-1}if(e)break e}if(e=0,i){t:if(!((h=a[u+12>>2])>>>0>=r>>>0)){for(;;){if(!Ae(i,o[n+h|0]))break t;if((0|(h=h+1|0))==(0|r))break}h=r}a[u+12>>2]=h}t=m}return i=a[u+12>>2],l?a[l>>2]=n+i:(0|r)!=(0|i)&&(a[8952]=28,e=-1),s&&(a[s>>2]=t),y=u+16|0,0|e}function K(e,t,n){var r=0,i=0,o=0,s=0,a=0,c=0,u=0,d=0,h=0,p=0,f=0,g=0,m=0,y=0,v=0,A=0,b=0,w=0,S=0,C=0,E=0;for(i=2036477234,o=857760878,s=1634760805,a=1797285236,v=20,d=l[0|n]|l[n+1|0]<<8|l[n+2|0]<<16|l[n+3|0]<<24,y=l[n+4|0]|l[n+5|0]<<8|l[n+6|0]<<16|l[n+7|0]<<24,A=l[n+8|0]|l[n+9|0]<<8|l[n+10|0]<<16|l[n+11|0]<<24,g=l[n+12|0]|l[n+13|0]<<8|l[n+14|0]<<16|l[n+15|0]<<24,h=l[n+16|0]|l[n+17|0]<<8|l[n+18|0]<<16|l[n+19|0]<<24,c=l[n+20|0]|l[n+21|0]<<8|l[n+22|0]<<16|l[n+23|0]<<24,p=l[n+24|0]|l[n+25|0]<<8|l[n+26|0]<<16|l[n+27|0]<<24,f=l[n+28|0]|l[n+29|0]<<8|l[n+30|0]<<16|l[n+31|0]<<24,n=l[0|t]|l[t+1|0]<<8|l[t+2|0]<<16|l[t+3|0]<<24,u=l[t+4|0]|l[t+5|0]<<8|l[t+6|0]<<16|l[t+7|0]<<24,r=l[t+8|0]|l[t+9|0]<<8|l[t+10|0]<<16|l[t+11|0]<<24,t=l[t+12|0]|l[t+13|0]<<8|l[t+14|0]<<16|l[t+15|0]<<24;b=r,r=mn(s+c|0,7)^g,m=b^mn(r+s|0,9),w=mn(r+m|0,13)^c,g=mn(m+w|0,18),t=mn(o+d|0,7)^t,p=mn(t+o|0,9)^p,d=mn(t+p|0,13)^d,C=mn(p+d|0,18),f=mn(n+i|0,7)^f,c=mn(f+i|0,9)^y,S=mn(c+f|0,13)^n,E=mn(c+S|0,18),n=mn(a+h|0,7)^A,u=mn(n+a|0,9)^u,h=mn(n+u|0,13)^h,b=mn(u+h|0,18),d=mn((s^=g)+n|0,7)^d,y=mn(d+s|0,9)^c,A=mn(d+y|0,13)^n,s=mn(y+A|0,18)^s,n=mn((o^=C)+r|0,7)^S,u=mn(n+o|0,9)^u,g=mn(n+u|0,13)^r,o=mn(u+g|0,18)^o,h=mn((i^=E)+t|0,7)^h,r=mn(h+i|0,9)^m,t=mn(r+h|0,13)^t,i=mn(t+r|0,18)^i,c=mn((a^=b)+f|0,7)^w,p=mn(c+a|0,9)^p,f=mn(c+p|0,13)^f,a=mn(p+f|0,18)^a,m=v>>>0>2,v=v-2|0,m;);return Ot(e,s),Ot(e+4|0,o),Ot(e+8|0,i),Ot(e+12|0,a),Ot(e+16|0,n),Ot(e+20|0,u),Ot(e+24|0,r),Ot(e+28|0,t),0}function H(e){var t,n=0,r=0;y=t=y-48|0,n=l[28+(e|=0)|0]|l[e+29|0]<<8|l[e+30|0]<<16|l[e+31|0]<<24,a[t+24>>2]=l[e+24|0]|l[e+25|0]<<8|l[e+26|0]<<16|l[e+27|0]<<24,a[t+28>>2]=n,n=l[e+20|0]|l[e+21|0]<<8|l[e+22|0]<<16|l[e+23|0]<<24,a[t+16>>2]=l[e+16|0]|l[e+17|0]<<8|l[e+18|0]<<16|l[e+19|0]<<24,a[t+20>>2]=n,n=l[e+4|0]|l[e+5|0]<<8|l[e+6|0]<<16|l[e+7|0]<<24,a[t>>2]=l[0|e]|l[e+1|0]<<8|l[e+2|0]<<16|l[e+3|0]<<24,a[t+4>>2]=n,n=l[e+12|0]|l[e+13|0]<<8|l[e+14|0]<<16|l[e+15|0]<<24,a[t+8>>2]=l[e+8|0]|l[e+9|0]<<8|l[e+10|0]<<16|l[e+11|0]<<24,a[t+12>>2]=n,n=l[e+40|0]|l[e+41|0]<<8|l[e+42|0]<<16|l[e+43|0]<<24,a[t+32>>2]=l[e+36|0]|l[e+37|0]<<8|l[e+38|0]<<16|l[e+39|0]<<24,a[t+36>>2]=n,jn[a[8752]](t,t,40,0,e+32|0,0,e),n=a[t+28>>2],r=a[t+24>>2],o[e+24|0]=r,o[e+25|0]=r>>>8,o[e+26|0]=r>>>16,o[e+27|0]=r>>>24,o[e+28|0]=n,o[e+29|0]=n>>>8,o[e+30|0]=n>>>16,o[e+31|0]=n>>>24,n=a[t+20>>2],r=a[t+16>>2],o[e+16|0]=r,o[e+17|0]=r>>>8,o[e+18|0]=r>>>16,o[e+19|0]=r>>>24,o[e+20|0]=n,o[e+21|0]=n>>>8,o[e+22|0]=n>>>16,o[e+23|0]=n>>>24,n=a[t+12>>2],r=a[t+8>>2],o[e+8|0]=r,o[e+9|0]=r>>>8,o[e+10|0]=r>>>16,o[e+11|0]=r>>>24,o[e+12|0]=n,o[e+13|0]=n>>>8,o[e+14|0]=n>>>16,o[e+15|0]=n>>>24,n=a[t+4>>2],r=a[t>>2],o[0|e]=r,o[e+1|0]=r>>>8,o[e+2|0]=r>>>16,o[e+3|0]=r>>>24,o[e+4|0]=n,o[e+5|0]=n>>>8,o[e+6|0]=n>>>16,o[e+7|0]=n>>>24,n=a[t+36>>2],r=a[t+32>>2],o[e+36|0]=r,o[e+37|0]=r>>>8,o[e+38|0]=r>>>16,o[e+39|0]=r>>>24,o[e+40|0]=n,o[e+41|0]=n>>>8,o[e+42|0]=n>>>16,o[e+43|0]=n>>>24,Mt(e),y=t+48|0}function G(e,t){var n,r,i,s,l,c,d,h,p=0,f=0;y=n=y-48|0,r=a[t+28>>2],i=a[t+24>>2],s=a[t+20>>2],l=a[t+16>>2],c=a[t+12>>2],d=a[t+8>>2],h=a[t+4>>2],p=a[t>>2],f=a[t+36>>2],t=a[t+32>>2],p=u(((r+(i+(s+(l+(c+(d+(h+(p+(u(f,19)+16777216>>>25|0)>>26)>>25)>>26)>>25)>>26)>>25)>>26)>>25)+t>>26)+f>>25,19)+p|0,a[n>>2]=67108863&p,p=h+(p>>26)|0,a[n+4>>2]=33554431&p,p=d+(p>>25)|0,a[n+8>>2]=67108863&p,p=c+(p>>26)|0,a[n+12>>2]=33554431&p,p=l+(p>>25)|0,a[n+16>>2]=67108863&p,p=s+(p>>26)|0,a[n+20>>2]=33554431&p,p=i+(p>>25)|0,a[n+24>>2]=67108863&p,p=r+(p>>26)|0,a[n+28>>2]=33554431&p,t=t+(p>>25)|0,a[n+32>>2]=67108863&t,a[n+36>>2]=f+(t>>26)&33554431,t=a[n>>2],o[0|e]=t,o[e+2|0]=t>>>16,o[e+1|0]=t>>>8,f=a[n+4>>2],o[e+5|0]=f>>>14,o[e+4|0]=f>>>6,o[e+3|0]=f<<2|t>>>24,t=a[n+8>>2],o[e+8|0]=t>>>13,o[e+7|0]=t>>>5,o[e+6|0]=t<<3|f>>>22,f=a[n+12>>2],o[e+11|0]=f>>>11,o[e+10|0]=f>>>3,o[e+9|0]=f<<5|t>>>21,t=a[n+16>>2],o[e+15|0]=t>>>18,o[e+14|0]=t>>>10,o[e+13|0]=t>>>2,o[e+12|0]=t<<6|f>>>19,t=a[n+20>>2],o[e+16|0]=t,o[e+18|0]=t>>>16,o[e+17|0]=t>>>8,f=a[n+24>>2],o[e+21|0]=f>>>15,o[e+20|0]=f>>>7,o[e+19|0]=f<<1|t>>>24,t=a[n+28>>2],o[e+24|0]=t>>>13,o[e+23|0]=t>>>5,o[e+22|0]=t<<3|f>>>23,f=a[n+32>>2],o[e+27|0]=f>>>12,o[e+26|0]=f>>>4,o[e+25|0]=f<<4|t>>>21,t=a[n+36>>2],o[e+31|0]=t>>>18,o[e+30|0]=t>>>10,o[e+29|0]=t>>>2,o[e+28|0]=t<<6|f>>>20,y=n+48|0}function Y(e,t){var n,r,i,o,s,a=0,c=0,u=0;for(y=n=y-288|0,F(s=e+40|0,t),cn(c=e+80|0),k(r=n+240|0,s),x(i=n+192|0,r,1424),ge(r,r,c),me(i,i,c),k(o=n+144|0,i),x(o,o,i),k(e,o),x(e,e,i),x(e,e,r),y=c=y-144|0,k(a=c+96|0,e),k(u=c+48|0,a),k(u,u),x(u,e,u),x(a,a,u),k(a,a),x(a,u,a),k(u,a),a=1;k(u=c+48|0,u),5!=(0|(a=a+1|0)););for(x(a=c+96|0,u=c+48|0,a),k(u,a),a=1;k(u=c+48|0,u),10!=(0|(a=a+1|0)););for(x(a=c+48|0,a,c+96|0),k(c,a),a=1;k(c,c),20!=(0|(a=a+1|0)););for(x(a=c+48|0,c,a),a=1;k(u=c+48|0,u),11!=(0|(a=a+1|0)););for(x(a=c+96|0,u=c+48|0,a),k(u,a),a=1;k(u=c+48|0,u),50!=(0|(a=a+1|0)););for(x(a=c+48|0,a,c+96|0),k(c,a),a=1;k(c,c),100!=(0|(a=a+1|0)););for(x(a=c+48|0,c,a),a=1;k(u=c+48|0,u),51!=(0|(a=a+1|0)););x(a=c+96|0,c+48|0,a),k(a,a),k(a,a),x(e,a,e),y=c+144|0,x(e,e,o),x(e,e,r),k(c=n+96|0,e),x(c,c,i),ge(a=n+48|0,c,r);e:{if(!Nt(a)){if(me(n,n+96|0,n+240|0),c=-1,!Nt(n))break e;x(e,e,1472)}(0|Dt(e))==(l[t+31|0]>>>7|0)&&_e(e,e),x(e+120|0,e,s),c=0}return y=n+288|0,c}function z(e,t,n,r,i){var s,c,u=0,d=0,h=0;for(y=s=(y=c=y-416|0)-192|0,Pt(c),vt(s- -64|0,54,128),o[s+64|0]=54^l[0|i],u=1;o[0|(d=(s- -64|0)+u|0)]=l[0|d]^l[i+u|0],32!=(0|(u=u+1|0)););for(Z(c,u=s- -64|0,128,0),Pt(d=c+208|0),vt(u,92,128),o[s+64|0]=92^l[0|i],u=1;o[0|(h=(s- -64|0)+u|0)]=l[0|h]^l[i+u|0],32!=(0|(u=u+1|0)););return Z(d,i=s- -64|0,128,0),bn(i,128),bn(s,64),y=s+192|0,Z(c,t,n,r),y=n=(y=t=y+-64|0)-64|0,je(c,n),Z(r=c+208|0,n,64,0),je(r,t),bn(n,64),y=n- -64|0,n=a[t+28>>2],r=a[t+24>>2],o[e+24|0]=r,o[e+25|0]=r>>>8,o[e+26|0]=r>>>16,o[e+27|0]=r>>>24,o[e+28|0]=n,o[e+29|0]=n>>>8,o[e+30|0]=n>>>16,o[e+31|0]=n>>>24,n=a[t+20>>2],r=a[t+16>>2],o[e+16|0]=r,o[e+17|0]=r>>>8,o[e+18|0]=r>>>16,o[e+19|0]=r>>>24,o[e+20|0]=n,o[e+21|0]=n>>>8,o[e+22|0]=n>>>16,o[e+23|0]=n>>>24,n=a[t+12>>2],r=a[t+8>>2],o[e+8|0]=r,o[e+9|0]=r>>>8,o[e+10|0]=r>>>16,o[e+11|0]=r>>>24,o[e+12|0]=n,o[e+13|0]=n>>>8,o[e+14|0]=n>>>16,o[e+15|0]=n>>>24,n=a[t+4>>2],r=a[t>>2],o[0|e]=r,o[e+1|0]=r>>>8,o[e+2|0]=r>>>16,o[e+3|0]=r>>>24,o[e+4|0]=n,o[e+5|0]=n>>>8,o[e+6|0]=n>>>16,o[e+7|0]=n>>>24,y=t- -64|0,y=c+416|0,0}function Z(e,t,n,r){var i,s=0,c=0,u=0,d=0,h=0,p=0;y=i=y-704|0;e:if(n|r){if(u=r<<3|(s=n)>>>29,c=(h=a[e+72>>2])+(p=s<<3)|0,s=u+(d=a[e+76>>2])|0,a[e+72>>2]=c,s=c>>>0<p>>>0?s+1|0:s,a[e+76>>2]=s,u=(p=(0|s)==(0|d)&c>>>0<h>>>0|s>>>0<d>>>0)+a[(c=e- -64|0)>>2]|0,s=a[c+4>>2],s=u>>>0<p>>>0?s+1|0:s,u=(p=r>>>29|0)+u|0,a[c>>2]=u,a[c+4>>2]=u>>>0<p>>>0?s+1|0:s,c=0,s=0,(0|(u=0-((d=127&((7&d)<<29|h>>>3))>>>0>128)|0))==(0|r)&n>>>0<(h=128-d|0)>>>0|r>>>0<u>>>0)for(;;)if(o[80+(e+(h=c+d|0)|0)|0]=l[t+c|0],!((0|n)!=(0|(c=c+1|0))|(0|r)!=(0|(s=c?s:s+1|0))))break e;for(;o[80+(e+(p=c+d|0)|0)|0]=l[t+c|0],(0|h)!=(0|(c=c+1|0))|(0|(s=c?s:s+1|0))!=(0|u););if(C(e,e+80|0,i,s=i+640|0),t=t+h|0,!(r=r-((n>>>0<h>>>0)+u|0)|0)&(n=n-h|0)>>>0>127|r)for(;C(e,t,i,s),t=t+128|0,!(r=r-(n>>>0<128)|0)&(n=n-128|0)>>>0>127|r;);if(n|r)for(c=0,s=0;o[80+(e+c|0)|0]=l[t+c|0],(0|n)!=(0|(c=d=c+1|0))|(0|r)!=(0|(s=d?s:s+1|0)););bn(i,704)}return y=i+704|0,0}function W(e,t,n){var r,i,o,s=0;y=r=y-16|0,i=a[e+20>>2],a[e+20>>2]=0,o=a[e+4>>2],a[e+4>>2]=0,s=-26;e:{t:{n:switch(n-1|0){case 1:if(s=-32,Ve(t,1109,9))break e;t=t+9|0;break t;case 0:break n;default:break e}if(s=-32,Ve(t,1100,8))break e;t=t+8|0}if(!Ve(t,1352,3)&&(t=Ie(t+3|0,r+12|0))){if(s=-26,19!=a[r+12>>2])break e;if(!Ve(t,1364,3)&&(t=Ie(t+3|0,r+12|0))&&(a[e+44>>2]=a[r+12>>2],!Ve(t,1356,3)&&(t=Ie(t+3|0,r+12|0))&&(a[e+40>>2]=a[r+12>>2],!Ve(t,1360,3)&&(t=Ie(t+3|0,r+12|0))&&(n=a[r+12>>2],a[e+48>>2]=n,a[e+52>>2]=n,36==(0|(n=l[0|t]))&&(a[r+12>>2]=i,t=t+(36==(0|n))|0,!V(a[e+16>>2],i,t,Ne(t),0,r+12|0,r+8|0,3)&&(a[e+20>>2]=a[r+12>>2],t=a[r+8>>2],36==(0|(n=l[0|t]))&&(a[r+12>>2]=o,t=t+(36==(0|n))|0,!V(a[e>>2],o,t,Ne(t),0,r+12|0,r+8|0,3)))))))){if(a[e+4>>2]=a[r+12>>2],t=a[r+8>>2],s=le(e))break e;s=l[0|t]?-32:0;break e}}s=-32}return y=r+16|0,s}function q(e,t){var n,r,i,s,l,c,d,h,p,f,g,m=0,y=0,v=0,A=0,b=0,w=0;(y=a[e+56>>2])|(m=a[e+60>>2])&&(o[(A=e+y|0)- -64|0]=1,!(m=(v=y+1|0)?m:m+1|0)&v>>>0<=15&&vt(A+65|0,0,15-y|0),o[e+80|0]=1,j(e,e- -64|0,16,0)),p=a[e+52>>2],f=a[e+48>>2],g=a[e+44>>2],b=a[e+24>>2],v=a[e+28>>2]+(b>>>26|0)|0,y=a[e+32>>2]+(v>>>26|0)|0,i=a[e+36>>2]+(y>>>26|0)|0,c=67108863&y,v=(y=(67108863&b)+((m=a[e+20>>2]+u(i>>>26|0,5)|0)>>>26|0)|0)&(n=(s=(-67108864|i)+((d=c+((b=(w=67108863&v)+((m=y+((l=5+(A=67108863&m)|0)>>>26|0)|0)>>>26|0)|0)>>>26|0)|0)>>>26|0)|0)>>31)|(r=67108863&(h=(s>>>31|0)-1|0))&m,m=0,m=(y=v<<26|r&l|A&n)>>>0>(A=y+a[e+40>>2]|0)>>>0?1:m,Ot(t,A),y=0,y=(v=(w=w&n|b&r)<<20|v>>>6)>>>0>(b=v+g|0)>>>0?1:y,v=m,b=m+b|0,m=y,m=v>>>0>b>>>0?m+1|0:m,Ot(t+4|0,b),y=0,y=(v=(A=n&c|r&d)<<14|w>>>12)>>>0>(w=v+f|0)>>>0?1:y,v=m,w=m+w|0,m=y,m=v>>>0>w>>>0?m+1|0:m,Ot(t+8|0,w),Ot(y=t+12|0,m=m+(A=(t=(s&h|n&i)<<8|A>>>18)+p|0)|0),bn(e,88)}function J(e,t){var n,r,i=0;for(y=n=y-192|0,k(r=n+144|0,t),k(i=n+96|0,r),k(i,i),x(i,t,i),x(r,r,i),k(t=n+48|0,r),x(i,i,t),k(t,i),t=1;k(i=n+48|0,i),5!=(0|(t=t+1|0)););for(x(t=n+96|0,i=n+48|0,t),k(i,t),t=1;k(i=n+48|0,i),10!=(0|(t=t+1|0)););for(x(t=n+48|0,t,n+96|0),k(n,t),t=1;k(n,n),20!=(0|(t=t+1|0)););for(x(t=n+48|0,n,t),t=1;k(i=n+48|0,i),11!=(0|(t=t+1|0)););for(x(t=n+96|0,i=n+48|0,t),k(i,t),t=1;k(i=n+48|0,i),50!=(0|(t=t+1|0)););for(x(t=n+48|0,t,n+96|0),k(n,t),t=1;k(n,n),100!=(0|(t=t+1|0)););for(x(t=n+48|0,n,t),t=1;k(i=n+48|0,i),51!=(0|(t=t+1|0)););for(x(t=n+96|0,n+48|0,t),t=1;k(i=n+96|0,i),6!=(0|(t=t+1|0)););x(e,n+96|0,n+144|0),y=n+192|0}function X(e,t,n,r,i){e|=0,t|=0,n|=0,r|=0;var s=0,a=0,c=0,d=0,f=0,g=0,m=0,y=0;un(i|=0),a=(s=(r>>>0)/3|0)<<2,(s=u(s,-3)+r|0)&&(a=2&i?(2|a)+(s>>>1|0)|0:a+4|0);e:{t:{n:{if(t>>>0>a>>>0){if(!(4&i)){if(i=0,!r)break e;s=0;break n}if(i=0,!r)break e;for(s=0;;){for(f=(d=l[n+c|0])|f<<8,s=s+8|0;g=s,m=e+i|0,y=sn(f>>>(s=s-6|0)&63),o[0|m]=y,i=i+1|0,s>>>0>5;);if((0|(c=c+1|0))==(0|r))break}if(!s)break e;n=sn(d<<12-g&63);break t}Ut(),h()}for(;;){for(f=(d=l[n+c|0])|f<<8,s=s+8|0;g=s,m=e+i|0,y=an(f>>>(s=s-6|0)&63),o[0|m]=y,i=i+1|0,s>>>0>5;);if((0|(c=c+1|0))==(0|r))break}if(!s)break e;n=an(d<<12-g&63)}o[e+i|0]=n,i=i+1|0}e:{t:{if(i>>>0<=a>>>0){if(i>>>0<a>>>0)break t;a=i;break e}p(1048,1145,230,1375),h()}vt(e+i|0,61,a-i|0)}return vt(e+a|0,0,(t>>>0>(n=a+1|0)>>>0?t:n)-a|0),0|e}function $(e,t,n,r){var i=0,s=0,c=0,u=0,d=0,h=0;e:{if((u=a[e+56>>2])|(d=a[e+60>>2])){if(h=i=(c=(0|(i=0-((u>>>0>16)+d|0)|0))==(0|r)&n>>>0>(s=16-u|0)>>>0|r>>>0>i>>>0)?i:r,i|(s=c?s:n))for(c=0,i=0;o[(e+(d=c+u|0)|0)- -64|0]=l[t+c|0],u=a[e+56>>2],d=a[e+60>>2],(0|s)!=(0|(c=c+1|0))|(0|(i=c?i:i+1|0))!=(0|h););if(i=d+h|0,i=(u=s+u|0)>>>0<s>>>0?i+1|0:i,a[e+56>>2]=u,a[e+60>>2]=i,!i&u>>>0<16)break e;j(e,e- -64|0,16,0),a[e+56>>2]=0,a[e+60>>2]=0,n=(i=n)-s|0,r=r-((i>>>0<s>>>0)+h|0)|0,t=t+s|0}if(!r&n>>>0>=16|r&&(j(e,t,i=-16&n,r),n&=15,r=0,t=t+i|0),n|r){for(c=0,i=0;s=c+a[e+56>>2]|0,o[(e+s|0)- -64|0]=l[t+c|0],c=s=c+1|0,(0|n)!=(0|s)|(0|r)!=(0|(i=s?i:i+1|0)););t=r+a[e+60>>2]|0,t=(i=n+a[e+56>>2]|0)>>>0<n>>>0?t+1|0:t,a[e+56>>2]=i,a[e+60>>2]=t}}}function ee(e,t,n){var r,i,o,s,l,c,u,d,h,p,f,g,m=0,y=0,v=0,A=0,b=0,w=0,S=0,C=0,E=0;r=a[t+4>>2],i=a[e+4>>2],o=a[t+8>>2],y=a[e+8>>2],s=a[t+12>>2],v=a[e+12>>2],l=a[t+16>>2],A=a[e+16>>2],c=a[t+20>>2],b=a[e+20>>2],u=a[t+24>>2],w=a[e+24>>2],d=a[t+28>>2],S=a[e+28>>2],h=a[t+32>>2],C=a[e+32>>2],p=a[t+36>>2],E=a[e+36>>2],g=(n=0-n|0)&((f=a[t>>2])^(m=a[e>>2])),a[e>>2]=g^m,m=E,E=n&(E^p),a[e+36>>2]=m^E,m=C,C=n&(C^h),a[e+32>>2]=m^C,m=S,S=n&(S^d),a[e+28>>2]=m^S,m=w,w=n&(w^u),a[e+24>>2]=m^w,m=b,b=n&(b^c),a[e+20>>2]=m^b,m=A,A=n&(A^l),a[e+16>>2]=m^A,m=v,v=n&(v^s),a[e+12>>2]=m^v,m=y,y=n&(y^o),a[e+8>>2]=m^y,m=e,e=n&(r^i),a[m+4>>2]=e^i,a[t+36>>2]=E^p,a[t+32>>2]=C^h,a[t+28>>2]=S^d,a[t+24>>2]=w^u,a[t+20>>2]=b^c,a[t+16>>2]=A^l,a[t+12>>2]=v^s,a[t+8>>2]=y^o,a[t+4>>2]=e^r,a[t>>2]=f^g}function te(e,t){var n;a[e>>2]=67108863&(l[0|t]|l[t+1|0]<<8|l[t+2|0]<<16|l[t+3|0]<<24),a[e+4>>2]=(l[t+3|0]|l[t+4|0]<<8|l[t+5|0]<<16|l[t+6|0]<<24)>>>2&67108611,a[e+8>>2]=(l[t+6|0]|l[t+7|0]<<8|l[t+8|0]<<16|l[t+9|0]<<24)>>>4&67092735,a[e+12>>2]=(l[t+9|0]|l[t+10|0]<<8|l[t+11|0]<<16|l[t+12|0]<<24)>>>6&66076671,n=l[t+12|0]|l[t+13|0]<<8|l[t+14|0]<<16|l[t+15|0]<<24,a[e+20>>2]=0,a[e+24>>2]=0,a[e+28>>2]=0,a[e+32>>2]=0,a[e+36>>2]=0,a[e+16>>2]=n>>>8&1048575,a[e+40>>2]=l[t+16|0]|l[t+17|0]<<8|l[t+18|0]<<16|l[t+19|0]<<24,a[e+44>>2]=l[t+20|0]|l[t+21|0]<<8|l[t+22|0]<<16|l[t+23|0]<<24,a[e+48>>2]=l[t+24|0]|l[t+25|0]<<8|l[t+26|0]<<16|l[t+27|0]<<24,t=l[t+28|0]|l[t+29|0]<<8|l[t+30|0]<<16|l[t+31|0]<<24,o[e+80|0]=0,a[e+56>>2]=0,a[e+60>>2]=0,a[e+52>>2]=t}function ne(e,t,n,r){var i=0,s=0,a=0,c=0,u=0,d=0;if(n|r){if(!r&(s=256-(i=l[e+352|0]|l[e+353|0]<<8|l[e+354|0]<<16|l[e+355|0]<<24)|0)>>>0<n>>>0|r)for(d=e+224|0,c=e+96|0;pt(96+(e+i|0)|0,t,s),a=(l[e+352|0]|l[e+353|0]<<8|l[e+354|0]<<16|l[e+355|0]<<24)+s|0,o[e+352|0]=a,o[e+353|0]=a>>>8,o[e+354|0]=a>>>16,o[e+355|0]=a>>>24,ie(e,128),w(e,c),pt(c,d,128),i=(u=l[e+352|0]|l[e+353|0]<<8|l[e+354|0]<<16|l[e+355|0]<<24)-128|0,o[e+352|0]=i,o[e+353|0]=i>>>8,o[e+354|0]=i>>>16,o[e+355|0]=i>>>24,t=t+s|0,a=n,n=n-s|0,!(r=r-(s>>>0>a>>>0)|0)&(s=384-u|0)>>>0<n>>>0|r;);pt(96+(e+i|0)|0,t,n),t=n+(l[e+352|0]|l[e+353|0]<<8|l[e+354|0]<<16|l[e+355|0]<<24)|0,o[e+352|0]=t,o[e+353|0]=t>>>8,o[e+354|0]=t>>>16,o[e+355|0]=t>>>24}return 0}function re(e,t){var n,r=0,i=0,s=0,a=0;for(y=n=y-464|0;i=(n+400|0)+(r<<1)|0,a=l[t+r|0],o[i+1|0]=a>>>4,o[0|i]=15&a,32!=(0|(r=r+1|0)););for(r=0;t=((i=(t=r)+l[0|(r=(n+400|0)+s|0)]|0)<<24)- -134217728|0,o[0|r]=i-(t>>24&240),r=t>>28,63!=(0|(s=s+1|0)););for(o[n+463|0]=l[n+463|0]+r,Vt(e),r=1;Ce(n,r>>>1|0,o[(n+400|0)+r|0]),Ge(t=n+240|0,e,n),ht(e,t),t=r>>>0<62,r=r+2|0,t;);for(ft(t=n+240|0,e),bt(r=n+120|0,t),P(t,r),bt(r,t),P(t,r),bt(r,t),P(t,r),ht(e,t),r=0;Ce(n,r>>>1|0,o[(n+400|0)+r|0]),Ge(t=n+240|0,e,n),ht(e,t),t=r>>>0<62,r=r+2|0,t;);y=n+464|0}function ie(e,t){var n,r,i,s=0,a=0;i=1+(a=n=l[4+(s=e- -64|0)|0]|l[s+5|0]<<8|l[s+6|0]<<16|l[s+7|0]<<24)|0,a=(t=t+(a=r=l[0|s]|l[s+1|0]<<8|l[s+2|0]<<16|l[s+3|0]<<24)|0)>>>0<a>>>0?i:n,o[0|s]=t,o[s+1|0]=t>>>8,o[s+2|0]=t>>>16,o[s+3|0]=t>>>24,o[s+4|0]=a,o[s+5|0]=a>>>8,o[s+6|0]=a>>>16,o[s+7|0]=a>>>24,t=(s=(0|a)==(0|n)&t>>>0<r>>>0|a>>>0<n>>>0)+(l[e+72|0]|l[e+73|0]<<8|l[e+74|0]<<16|l[e+75|0]<<24)|0,a=l[e+76|0]|l[e+77|0]<<8|l[e+78|0]<<16|l[e+79|0]<<24,s=t>>>0<s>>>0?a+1|0:a,o[e+72|0]=t,o[e+73|0]=t>>>8,o[e+74|0]=t>>>16,o[e+75|0]=t>>>24,o[e+76|0]=s,o[e+77|0]=s>>>8,o[e+78|0]=s>>>16,o[e+79|0]=s>>>24}function oe(e,t){a[e>>2]=1634760805,a[e+4>>2]=857760878,a[e+8>>2]=2036477234,a[e+12>>2]=1797285236,a[e+16>>2]=l[0|t]|l[t+1|0]<<8|l[t+2|0]<<16|l[t+3|0]<<24,a[e+20>>2]=l[t+4|0]|l[t+5|0]<<8|l[t+6|0]<<16|l[t+7|0]<<24,a[e+24>>2]=l[t+8|0]|l[t+9|0]<<8|l[t+10|0]<<16|l[t+11|0]<<24,a[e+28>>2]=l[t+12|0]|l[t+13|0]<<8|l[t+14|0]<<16|l[t+15|0]<<24,a[e+32>>2]=l[t+16|0]|l[t+17|0]<<8|l[t+18|0]<<16|l[t+19|0]<<24,a[e+36>>2]=l[t+20|0]|l[t+21|0]<<8|l[t+22|0]<<16|l[t+23|0]<<24,a[e+40>>2]=l[t+24|0]|l[t+25|0]<<8|l[t+26|0]<<16|l[t+27|0]<<24,a[e+44>>2]=l[t+28|0]|l[t+29|0]<<8|l[t+30|0]<<16|l[t+31|0]<<24}function se(e,t,n,r,i,o,s){var l,c,u,d,h,p=0;return y=l=y-352|0,K(l,o,s),!((!i&r>>>0>e-n>>>0|0!=(0|i))&e>>>0>n>>>0)&(!i&r>>>0<=n-e>>>0|e>>>0>=n>>>0)||(n=nt(e,n,r)),a[l+56>>2]=0,a[l+60>>2]=0,a[l+48>>2]=0,a[l+52>>2]=0,a[l+40>>2]=0,a[l+44>>2]=0,a[l+32>>2]=0,a[l+36>>2]=0,(u=!((s=(p=!i&r>>>0<32)?r:32)|(p=p?i:0)))||pt(l- -64|0,n,s),d=o+16|0,Ht(c=l+32|0,c,h=s+32|0,o=h>>>0<32?p+1|0:p,d,l),hn(l+96|0,c),u||pt(e,l- -64|0,s),bn(l+32|0,64),!i&r>>>0>=33|i&&Kt(e+s|0,n+s|0,r-s|0,i-(p+(r>>>0<s>>>0)|0)|0,d,l),bn(l,32),nn(n=l+96|0,e,r,i),pn(n,t),bn(n,256),y=l+352|0,0}function ae(e,t,n,r,i,o,s){var l,c,u=0,d=0,h=0;y=l=y-96|0,K(l,o,s),s=l+32|0,c=o+16|0,jn[a[8760]](s,32,0,c,l),o=-1;e:{if(!(0|jn[a[8754]](n,t,r,i,s))){if(o=0,!e)break e;!((!i&r>>>0>t-e>>>0|0!=(0|i))&e>>>0<t>>>0)&(!i&r>>>0<=e-t>>>0|e>>>0<=t>>>0)||(t=nt(e,t,r)),n=(o=!i&r>>>0<32)?r:32,s=o=o?i:0,n|o?(d=pt(l- -64|0,t,n),u=o=l+32|0,o=s,Ht(u,u,h=n+32|0,o=h>>>0<32?o+1|0:o,c,l),pt(e,d,n)):(u=o=l+32|0,o=s,Ht(u,u,d=n+32|0,o=d>>>0<32?o+1|0:o,c,l)),o=0,!i&r>>>0<33||Kt(e+n|0,t+n|0,r-n|0,i-(s+(n>>>0>r>>>0)|0)|0,c,l)}bn(l,32)}return y=l+96|0,o}function le(e){var t=0,n=0,r=0;if(!e)return-25;if(!a[e>>2])return-1;if(t=-2,!(c[e+4>>2]<16)&&(a[e+8>>2]||(t=-18,!a[e+12>>2]))){if(n=a[e+20>>2],!a[e+16>>2])return n?-19:-6;if(t=-6,!(n>>>0<8)&&(a[e+24>>2]||(t=-20,!a[e+28>>2]))&&(a[e+32>>2]||(t=-21,!a[e+36>>2]))){if(!(n=a[e+48>>2]))return-16;if(t=-17,!(n>>>0>16777215||(t=-14,(r=a[e+44>>2])>>>0<8||(t=-15,r>>>0>2097152||(t=-14,n<<3>>>0>r>>>0))))){if(!a[e+40>>2])return-12;if(!(e=a[e+52>>2]))return-28;t=e>>>0>16777215?-29:0}}}return t}function ce(e,t,n){var r,i,o,s,l,c,u,d,h,p,f,g,m,y,v,A,b,w,S,C;f=a[t+4>>2],r=a[e+4>>2],g=a[t+8>>2],i=a[e+8>>2],m=a[t+12>>2],o=a[e+12>>2],y=a[t+16>>2],s=a[e+16>>2],v=a[t+20>>2],l=a[e+20>>2],A=a[t+24>>2],c=a[e+24>>2],b=a[t+28>>2],u=a[e+28>>2],w=a[t+32>>2],d=a[e+32>>2],S=a[t+36>>2],h=a[e+36>>2],p=a[e>>2],C=a[t>>2]^p,t=0-n|0,a[e>>2]=p^C&t,a[e+36>>2]=t&(h^S)^h,a[e+32>>2]=t&(d^w)^d,a[e+28>>2]=t&(u^b)^u,a[e+24>>2]=t&(c^A)^c,a[e+20>>2]=t&(l^v)^l,a[e+16>>2]=t&(s^y)^s,a[e+12>>2]=t&(o^m)^o,a[e+8>>2]=t&(i^g)^i,a[e+4>>2]=t&(r^f)^r}function ue(e,t,n,r,i,o,s,c,u,d){var h,p,f,g;return y=h=y-48|0,a[h+4>>2]=0,U(p=h+16|0,u,d),d=l[u+20|0]|l[u+21|0]<<8|l[u+22|0]<<16|l[u+23|0]<<24,a[h+8>>2]=l[u+16|0]|l[u+17|0]<<8|l[u+18|0]<<16|l[u+19|0]<<24,a[h+12>>2]=d,y=d=y-352|0,$t(f=d+32|0,64,g=h+4|0,p),hn(u=d+96|0,f),bn(f,64),nn(u,o,s,c),nn(u,34960,0-s&15,0),nn(u,t,n,r),nn(u,34960,0-n&15,0),ot(o=d+24|0,s,c),nn(u,o,8,0),ot(o,n,r),nn(u,o,8,0),pn(u,d),bn(u,256),i=dn(d,i),bn(d,16),e&&(i?(vt(e,0,n),i=-1):(_t(e,t,n,r,g,1,p),i=0)),y=d+352|0,bn(p,32),y=h+48|0,i}function de(e,t){for(var n=0,r=0,i=0,s=0,a=0,c=0,u=0,d=0;o[e+n|0]=l[(n>>>3|0)+t|0]>>>(7&n)&1,256!=(0|(n=n+1|0)););for(;;){c=(t=c)+1|0;e:if(l[0|(a=e+t|0)]&&(n=c,i=1,!(t>>>0>254)))for(;;){t:if(s=o[0|(r=e+n|0)])if((0|(d=(u=o[0|a])+(s<<=i)|0))<=15)o[0|a]=d,o[0|r]=0;else{if((0|(r=u-s|0))<-15)break e;for(o[0|a]=r;;){if(!l[0|(r=e+n|0)]){o[0|r]=1;break t}if(o[0|r]=0,r=n>>>0<255,n=n+1|0,!r)break}}if(i>>>0>5)break e;if(!((n=t+(i=i+1|0)|0)>>>0<256))break}if(256==(0|c))break}}function he(e,t,n,r){var i,o,s,l,c=0;y=i=y+-64|0,vt(i+8|0,0,52),c=Ne(e),a[i+20>>2]=c,a[i+36>>2]=c,a[i+4>>2]=c,o=_(c),a[i+32>>2]=o,s=_(c),a[i+16>>2]=s,l=_(c),a[i>>2]=l;e:if(!l|!o|!s||!(c=_(c)))O(o),O(s),O(l),e=-22;else{if(e=W(i,e,r)){O(a[i+32>>2]),O(a[i+16>>2]),O(a[i>>2]),O(c);break e}e=0,t=I(a[i+40>>2],a[i+44>>2],a[i+52>>2],t,n,a[i+16>>2],a[i+20>>2],c,a[i+4>>2],0,0,r),O(a[i+32>>2]),O(a[i+16>>2]),(t||Ze(c,a[i>>2],a[i+4>>2]))&&(e=-35),O(c),O(a[i>>2])}return y=i- -64|0,e}function pe(e,t,n,r,i){var o,s=0,c=0;y=o=y+-64|0;e:{t:{if(!n&(c=Ne(e))>>>0<128){if(a[o+56>>2]=0,a[o+48>>2]=0,a[o+52>>2]=0,a[o+40>>2]=0,a[o+44>>2]=0,n=0,c&&(n=c),!(s=_(n))|!(3&l[s-4|0])||vt(s,0,n),s)break t}else a[8952]=28;e=-1;break e}a[o+32>>2]=0,a[o+36>>2]=0,a[o+8>>2]=s,a[o+16>>2]=s,a[o+20>>2]=c,a[o>>2]=s,a[o+12>>2]=c,a[o+24>>2]=0,a[o+28>>2]=0,a[o+4>>2]=c,W(o,e,i)?(a[8952]=28,e=-1):e=(0|t)!=a[o+40>>2]|a[o+44>>2]!=(r>>>10|0),O(s)}return y=o- -64|0,e}function fe(e,t,n,r,i,o,s,c,u,d,h){var p,f,g,m;return y=p=y-48|0,a[p+4>>2]=0,U(f=p+16|0,d,h),h=l[d+20|0]|l[d+21|0]<<8|l[d+22|0]<<16|l[d+23|0]<<24,a[p+8>>2]=l[d+16|0]|l[d+17|0]<<8|l[d+18|0]<<16|l[d+19|0]<<24,a[p+12>>2]=h,y=h=y-336|0,$t(g=h+16|0,64,m=p+4|0,f),hn(d=h+80|0,g),bn(g,64),nn(d,s,c,u),nn(d,34960,0-c&15,0),_t(e,r,i,o,m,1,f),nn(d,e,i,o),nn(d,34960,0-i&15,0),ot(e=h+8|0,c,u),nn(d,e,8,0),ot(e,i,o),nn(d,e,8,0),pn(d,t),bn(d,256),n&&(a[n>>2]=16,a[n+4>>2]=0),y=h+336|0,bn(f,32),y=p+48|0,0}function ge(e,t,n){var r,i,o,s,l,c,u,d,h,p,f,g,m,y,v,A,b,w;r=a[n+4>>2],i=a[t+4>>2],o=a[n+8>>2],s=a[t+8>>2],l=a[n+12>>2],c=a[t+12>>2],u=a[n+16>>2],d=a[t+16>>2],h=a[n+20>>2],p=a[t+20>>2],f=a[n+24>>2],g=a[t+24>>2],m=a[n+28>>2],y=a[t+28>>2],v=a[n+32>>2],A=a[t+32>>2],b=a[n+36>>2],w=a[t+36>>2],a[e>>2]=a[t>>2]-a[n>>2],a[e+36>>2]=w-b,a[e+32>>2]=A-v,a[e+28>>2]=y-m,a[e+24>>2]=g-f,a[e+20>>2]=p-h,a[e+16>>2]=d-u,a[e+12>>2]=c-l,a[e+8>>2]=s-o,a[e+4>>2]=i-r}function me(e,t,n){var r,i,o,s,l,c,u,d,h,p,f,g,m,y,v,A,b,w;r=a[n+4>>2],i=a[t+4>>2],o=a[n+8>>2],s=a[t+8>>2],l=a[n+12>>2],c=a[t+12>>2],u=a[n+16>>2],d=a[t+16>>2],h=a[n+20>>2],p=a[t+20>>2],f=a[n+24>>2],g=a[t+24>>2],m=a[n+28>>2],y=a[t+28>>2],v=a[n+32>>2],A=a[t+32>>2],b=a[n+36>>2],w=a[t+36>>2],a[e>>2]=a[n>>2]+a[t>>2],a[e+36>>2]=b+w,a[e+32>>2]=v+A,a[e+28>>2]=m+y,a[e+24>>2]=f+g,a[e+20>>2]=h+p,a[e+16>>2]=u+d,a[e+12>>2]=l+c,a[e+8>>2]=o+s,a[e+4>>2]=r+i}function ye(e){var t,n=0,r=0,i=0,s=0;for(o[11+(t=y-16|0)|0]=0,o[t+12|0]=0,o[t+13|0]=0,o[t+14|0]=0,a[t+8>>2]=0;;){for(i=l[e+r|0],n=0;o[0|(s=(t+8|0)+n|0)]=l[0|s]|i^l[(2528+(n<<5)|0)+r|0],7!=(0|(n=n+1|0)););if(31==(0|(r=r+1|0)))break}for(r=127&l[e+31|0],e=0,n=0;o[0|(i=(t+8|0)+n|0)]=l[0|i]|r^l[2559+(n<<5)|0],7!=(0|(n=n+1|0)););for(n=0;n=l[(t+8|0)+e|0]-1|n,7!=(0|(e=e+1|0)););return n>>>8&1}function ve(e,t){var n=0,r=0,i=0,s=0;for(vt(pt(e,33984,64)- -64|0,0,293);r=(n=s<<3)+e|0,i=l[0|(n=t+n|0)]|l[n+1|0]<<8|l[n+2|0]<<16|l[n+3|0]<<24,n=(l[n+4|0]|l[n+5|0]<<8|l[n+6|0]<<16|l[n+7|0]<<24)^(l[r+4|0]|l[r+5|0]<<8|l[r+6|0]<<16|l[r+7|0]<<24),i^=l[0|r]|l[r+1|0]<<8|l[r+2|0]<<16|l[r+3|0]<<24,o[0|r]=i,o[r+1|0]=i>>>8,o[r+2|0]=i>>>16,o[r+3|0]=i>>>24,o[r+4|0]=n,o[r+5|0]=n>>>8,o[r+6|0]=n>>>16,o[r+7|0]=n>>>24,8!=(0|(s=s+1|0)););}function Ae(e,t){var n=0,r=0;e:if(r=255&t){if(3&e)for(;;){if(!(n=l[0|e])|(0|n)==(255&t))break e;if(!(3&(e=e+1|0)))break}t:if(!((-1^(n=a[e>>2]))&n-16843009&-2139062144))for(r=u(r,16843009);;){if((-1^(n^=r))&n-16843009&-2139062144)break t;if(n=a[e+4>>2],e=e+4|0,n-16843009&(-1^n)&-2139062144)break}for(;n=e,(r=l[0|e])&&(e=n+1|0,(0|r)!=(255&t)););e=n}else e=Ne(e)+e|0;return l[0|e]==(255&t)?e:0}function be(e,t,n){var r=0,i=0,s=0,l=0,c=0,u=0;if(n>>>0>=8)for(l=n>>>3|0,n=0;s=(r=n<<3)+e|0,c=(r=a[4+(i=t+r|0)>>2])<<24|(i=a[i>>2])>>>8,u=r<<8|i>>>24,r=-16777216&((255&r)<<24|i>>>8)|16711680&((16777215&r)<<8|i>>>24)|r>>>8&65280|r>>>24,o[0|s]=r,o[s+1|0]=r>>>8,o[s+2|0]=r>>>16,o[s+3|0]=r>>>24,r=i<<8&16711680|i<<24|65280&c|255&u,o[s+4|0]=r,o[s+5|0]=r>>>8,o[s+6|0]=r>>>16,o[s+7|0]=r>>>24,(0|l)!=(0|(n=n+1|0)););}function we(e,t,n){var r,i,o=0,s=0,a=0;return r=e,e=31&(o=a=63&n),o>>>0>=32?(e=-1<<e,o=0):e=(o=-1<<e)|(1<<e)-1&-1>>>32-e,i=o&r,s=e&t,o=31&a,a>>>0>=32?(e=0,a=s>>>o|0):(e=s>>>o|0,a=((1<<o)-1&s)<<32-o|i>>>o),o=e,n=31&(s=0-n&63),s>>>0>=32?(e=0,n=-1>>>n|0):n=(e=-1>>>n|0)|(1<<n)-1<<32-n,n&=r,t&=e,e=31&s,s>>>0>=32?(t=n<<e,e=0):(t=(1<<e)-1&n>>>32-e|t<<e,e=n<<e),b=t|o,e|a}function Se(e,t,n){var r=0,i=0,o=0,s=0;return s=e,e=0,i=31&(r=o=63&n),r=r>>>0>=32?-1>>>i|0:(e=-1>>>i|0)|(1<<i)-1<<32-i,r&=s,e&=t,i=31&o,o>>>0>=32?(e=r<<i,r=0):(e=(1<<i)-1&r>>>32-i|e<<i,r<<=i),i=e,e=31&(n=0-n&63),n>>>0>=32?(e=-1<<e,o=0):e=(o=-1<<e)|(1<<e)-1&-1>>>32-e,s&=o,t&=e,e=31&n,n>>>0>=32?(n=0,e=t>>>e|0):(n=t>>>e|0,e=((1<<e)-1&t)<<32-e|s>>>e),b=n|i,e|r}function Ce(e,t,n){var r,i,o,s;y=r=y-128|0,cn(e),cn(i=e+40|0),wn(o=e+80|0),jt(e,t=u(t,960)+2784|0,en(n=n-((0-(s=(128&n)>>>7|0)&n)<<1)<<24>>24,1)),jt(e,t+120|0,en(n,2)),jt(e,t+240|0,en(n,3)),jt(e,t+360|0,en(n,4)),jt(e,t+480|0,en(n,5)),jt(e,t+600|0,en(n,6)),jt(e,t+720|0,en(n,7)),jt(e,t+840|0,en(n,8)),ke(t=r+8|0,i),ke(r+48|0,e),_e(r+88|0,o),jt(e,t,s),y=r+128|0}function Ee(e,t,n,r,i,o,s,a,l,c){var u,d,h;return y=d=y-352|0,gn(h=d+32|0,64,l,c),hn(u=d+96|0,h),bn(h,64),nn(u,o,s,a),nn(u,34064,0-s&15,0),nn(u,t,n,r),nn(u,34064,0-n&15,0),ot(o=d+24|0,s,a),nn(u,o,8,0),ot(o,n,r),nn(u,o,8,0),pn(u,d),bn(u,256),i=dn(d,i),bn(d,16),e&&(i?(vt(e,0,n),i=-1):(qe(e,t,n,r,l,1,c),i=0)),y=d+352|0,i}function Ie(e,t){var n,r=0,i=0,o=0,s=0,c=0;e:if(!(((n=l[0|e])-58&255)>>>0<246)){for(i=n,r=e;;){if(s=r,o>>>0>429496729)break e;if((i=(255&i)-48|0)>>>0>(-1^(r=u(o,10)))>>>0)break e;if(o=r+i|0,!(((i=l[0|(r=s+1|0)])-58&255)>>>0>245))break}48==(0|n)&(0|e)!=(0|s)|(0|e)==(0|r)||(a[t>>2]=o,c=r)}return c}function _e(e,t){var n,r,i,o,s,l,c,u,d;n=a[t+4>>2],r=a[t+8>>2],i=a[t+12>>2],o=a[t+16>>2],s=a[t+20>>2],l=a[t+24>>2],c=a[t+28>>2],u=a[t+32>>2],d=a[t+36>>2],a[e>>2]=0-a[t>>2],a[e+36>>2]=0-d,a[e+32>>2]=0-u,a[e+28>>2]=0-c,a[e+24>>2]=0-l,a[e+20>>2]=0-s,a[e+16>>2]=0-o,a[e+12>>2]=0-i,a[e+8>>2]=0-r,a[e+4>>2]=0-n}function xe(e,t,n,r,i,o,s,l,c,u,d){var h,p,f;return y=p=y-336|0,gn(f=p+16|0,64,u,d),hn(h=p+80|0,f),bn(f,64),nn(h,s,l,c),nn(h,34064,0-l&15,0),qe(e,r,i,o,u,1,d),nn(h,e,i,o),nn(h,34064,0-i&15,0),ot(e=p+8|0,l,c),nn(h,e,8,0),ot(e,i,o),nn(h,e,8,0),pn(h,t),bn(h,256),n&&(a[n>>2]=16,a[n+4>>2]=0),y=p+336|0,0}function Pe(e,t,n,r,i,o,s,a,l,c){var u,d,h;return y=u=y-352|0,tn(h=u+32|0,l,c),hn(d=u+96|0,h),bn(h,64),nn(d,o,s,a),ot(o=u+24|0,s,a),nn(d,o,8,0),nn(d,t,n,r),ot(o,n,r),nn(d,o,8,0),pn(d,u),bn(d,256),i=dn(u,i),bn(u,16),e&&(i?(vt(e,0,n),i=-1):(xt(e,t,n,r,l,c),i=0)),y=u+352|0,i}function ke(e,t){var n,r,i,o,s,l,c,u,d;n=a[t+8>>2],r=a[t+12>>2],i=a[t+16>>2],o=a[t+20>>2],s=a[t+24>>2],l=a[t+28>>2],c=a[t>>2],u=a[t+4>>2],d=a[t+36>>2],a[e+32>>2]=a[t+32>>2],a[e+36>>2]=d,a[e+24>>2]=s,a[e+28>>2]=l,a[e+16>>2]=i,a[e+20>>2]=o,a[e+8>>2]=n,a[e+12>>2]=r,a[e>>2]=c,a[e+4>>2]=u}function Be(e,t,n){n?(a[e+48>>2]=l[0|n]|l[n+1|0]<<8|l[n+2|0]<<16|l[n+3|0]<<24,n=l[n+4|0]|l[n+5|0]<<8|l[n+6|0]<<16|l[n+7|0]<<24):(a[e+48>>2]=0,n=0),a[e+52>>2]=n,a[e+56>>2]=l[0|t]|l[t+1|0]<<8|l[t+2|0]<<16|l[t+3|0]<<24,a[e+60>>2]=l[t+4|0]|l[t+5|0]<<8|l[t+6|0]<<16|l[t+7|0]<<24}function Oe(e,t,n,r){var i;if(y=i=y-192|0,!(!n|(t-65&255)>>>0<=191|(r-65&255)>>>0<=191))return s[i+130>>1]=257,o[i+129|0]=r,o[i+128|0]=t,Rt(4|(t=i+128|0)),ot(8|t,0,0),vt(i+144|0,0,48),ve(e,t),vt(r+i|0,0,r<<24>>24<0?0:128-r|0),ne(t=e,e=pt(i,n,r),128,0),bn(e,128),y=e+192|0,0;Ut(),h()}function Ne(e){var t=0,n=0,r=0;e:{if(3&(t=e))for(;;){if(!l[0|t])break e;if(!(3&(t=t+1|0)))break}for(;n=t,t=t+4|0,!((-1^(r=a[n>>2]))&r-16843009&-2139062144););if(!(255&r))return n-e|0;for(;r=l[n+1|0],n=t=n+1|0,r;);}return t-e|0}function De(e,t,n,r,i,o,s){var a=0,l=0;return t-65>>>0<4294967232|s>>>0>64?e=-1:(l=a=y,y=a=a-384&-64,!(!(r|i)||n)|!e|((t&=255)-65&255)>>>0<=191|!(!(s&=255)||o)|s>>>0>=65?(Ut(),h()):(s?Oe(a,t,o,s):We(a,t),ne(a,n,r,i),M(a,e,t),y=l),e=0),e}function je(e,t){var n,r,i=0;y=n=y-704|0,(r=a[e+72>>2]>>>3&127)>>>0<=111?pt(80+(e+r|0)|0,34784,112-r|0):(pt((i=e+80|0)+r|0,34784,128-r|0),C(e,i,n,n+640|0),vt(i,0,112)),be(e+192|0,e- -64|0,16),C(e,e+80|0,n,n+640|0),be(t,e,64),bn(n,704),bn(e,208),y=n+704|0}function Te(e,t,n,r,i,o,s,l,c,u,d){var h,p,f;return y=p=y-336|0,tn(f=p+16|0,u,d),hn(h=p+80|0,f),bn(f,64),nn(h,s,l,c),ot(s=p+8|0,l,c),nn(h,s,8,0),xt(e,r,i,o,u,d),nn(h,e,i,o),ot(s,i,o),nn(h,s,8,0),pn(h,t),bn(h,256),n&&(a[n>>2]=16,a[n+4>>2]=0),y=p+336|0,0}function Me(e,t,n){a[e+48>>2]=n?l[0|n]|l[n+1|0]<<8|l[n+2|0]<<16|l[n+3|0]<<24:0,a[e+52>>2]=l[0|t]|l[t+1|0]<<8|l[t+2|0]<<16|l[t+3|0]<<24,a[e+56>>2]=l[t+4|0]|l[t+5|0]<<8|l[t+6|0]<<16|l[t+7|0]<<24,a[e+60>>2]=l[t+8|0]|l[t+9|0]<<8|l[t+10|0]<<16|l[t+11|0]<<24}function Fe(e,t,n,r,i,o,s){var l;return y=l=y-16|0,e=vt(e,0,128),!(r|o)&s>>>0<2147483649?!!(i|o)&s>>>0>8191?(st(l,16),e=I(i,s>>>10|0,1,t,n,l,16,0,32,e,128,2)?-1:0):(a[8952]=28,e=-1):(a[8952]=22,e=-1),y=l+16|0,e}function Re(e,t){var n=0;4&t&&((t=a[e>>2])&&bn(a[t+4>>2],a[e+16>>2]<<10),(t=a[e+4>>2])&&bn(t,a[e+20>>2]<<3)),O(a[e+4>>2]),a[e+4>>2]=0,(t=a[e>>2])&&(n=a[t>>2])&&O(n),O(t),a[e>>2]=0}function Le(e,t){var n,r,i=0,s=0,a=0,l=0;for(y=n=y-16|0,i=10;l=i,a=(t>>>0)/10|0,o[0|(s=(i=i-1|0)+(n+6|0)|0)]=t-u(a,10)|48,!(t>>>0<10)&&(t=a,i););r=pt(t=e,s,e=11-l|0)+e|0,o[0|r]=0,y=n+16|0}function Qe(e,t,n){var r,i,o,s=0;y=i=y-48|0,me(e,s=t+40|0,t),ge(r=e+40|0,s,t),x(s=e+80|0,e,n+40|0),x(r,r,n),x(o=e+120|0,n+120|0,t+120|0),x(e,t+80|0,n+80|0),me(i,e,e),ge(e,s,r),me(r,s,r),ge(s,i,o),me(o,i,o),y=i+48|0}function Ue(e,t,n){var r,i,o,s=0;y=i=y-48|0,me(e,s=t+40|0,t),ge(r=e+40|0,s,t),x(s=e+80|0,e,n),x(r,r,n+40|0),x(o=e+120|0,n+120|0,t+120|0),x(e,t+80|0,n+80|0),me(i,e,e),ge(e,s,r),me(r,s,r),me(s,i,o),ge(o,i,o),y=i+48|0}function Ve(e,t,n){var r=0,i=0,o=0;if(!n)return 0;e:if(r=l[0|e]){for(;;){if((i=l[0|t])&&!(!(n=n-1|0)|(0|r)!=(0|i))){if(t=t+1|0,r=l[e+1|0],e=e+1|0,r)continue;break e}break}o=r}return(255&o)-l[0|t]|0}function Ke(e,t){for(var n=0,r=0,i=0,o=0;i=(n=r<<3)+e|0,o=l[0|(n=t+n|0)]|l[n+1|0]<<8|l[n+2|0]<<16|l[n+3|0]<<24,n=l[n+4|0]|l[n+5|0]<<8|l[n+6|0]<<16|l[n+7|0]<<24,a[i>>2]=o,a[i+4>>2]=n,128!=(0|(r=r+1|0)););}function He(e,t,n){var r;if(a[12+(r=y-16|0)>>2]=e,a[r+8>>2]=t,t=0,a[r+4>>2]=0,(0|n)>0)for(;a[r+4>>2]=a[r+4>>2]|l[a[r+8>>2]+t|0]^l[a[r+12>>2]+t|0],(0|n)!=(0|(t=t+1|0)););return(a[r+4>>2]-1>>>8&1)-1|0}function Ge(e,t,n){var r,i,o,s=0;y=i=y-48|0,me(e,s=t+40|0,t),ge(r=e+40|0,s,t),x(s=e+80|0,e,n),x(r,r,n+40|0),x(o=e+120|0,n+80|0,t+120|0),me(i,t=t+80|0,t),ge(e,s,r),me(r,s,r),me(s,i,o),ge(o,i,o),y=i+48|0}function Ye(e,t,n){var r,i=0,s=0;if(y=r=y-16|0,o[r+15|0]=0,s=-1,!(0|jn[a[8758]](e,t,n))){for(;o[r+15|0]=l[e+i|0]|l[r+15|0],32!=(0|(i=i+1|0)););s=(l[r+15|0]<<23)-8388608>>31}return y=r+16|0,s}function ze(e,t,n,r){var i,o,s,a,l=0,c=0;return a=u(l=n>>>16|0,c=e>>>16|0),l=(65535&(c=((s=u(i=65535&n,o=65535&e))>>>16|0)+u(c,i)|0))+u(l,o)|0,b=(u(t,n)+a|0)+u(e,r)+(c>>>16)+(l>>>16)|0,65535&s|l<<16}function Ze(e,t,n){var r;if(a[12+(r=y-16|0)>>2]=e,a[r+8>>2]=t,t=0,o[r+7|0]=0,n)for(;o[r+7|0]=l[r+7|0]|l[a[r+8>>2]+t|0]^l[a[r+12>>2]+t|0],(0|n)!=(0|(t=t+1|0)););return(l[r+7|0]-1>>>8&1)-1|0}function We(e,t){var n;return y=n=y+-64|0,(t-65&255)>>>0<=191&&(Ut(),h()),o[n+3|0]=1,o[n+1|0]=0,o[n+2|0]=1,o[0|n]=t,Rt(4|n),ot(8|n,0,0),vt(n+16|0,0,48),ve(e,n),y=n- -64|0,0}function qe(e,t,n,r,i,o,s){var a=0,l=0;a=r,1==(((a=(l=n+63|0)>>>0<63?a+1|0:a)>>>6|0)+(0!=(0|(a=(63&a)<<26|l>>>6)))|0)&o>>>0>(l=0-a|0)>>>0&&(Ut(),h()),_t(e,t,n,r,i,o,s)}function Je(e,t,n,r){var i=0;i=-1;e:if(!(r-65>>>0<4294967232|n>>>0>64)){t:{if(!n||!t){if(!We(e,255&r))break t;break e}if(Oe(e,255&r,t,255&n))break e}i=0}return i}function Xe(e,t,n,r){return(r=(1+(e^r)>>>8^-1)&n|(1+(16321^e)>>>8^-1)&t|(t=e+65510>>>8&255)&e+65)|(n=e+65484>>>8|0)&e+71&(255^t)|e+252&e+65474>>>8&(-1^n)&255}function $e(e){var t,n;return(e=(t=a[8748])+(n=e+3&-4)|0)>>>0<=t>>>0&&n||e>>>0>Tn()<<16>>>0&&!(0|g(0|e))?(a[8952]=48,-1):(a[8748]=e,t)}function et(e,t){for(var n=0,r=0,i=0,o=0;r=(n=i<<3)+e|0,o=a[(n=t+n|0)>>2],n=a[r+4>>2]^a[n+4>>2],a[r>>2]=a[r>>2]^o,a[r+4>>2]=n,128!=(0|(i=i+1|0)););}function tt(e,t){var n,r,i,s,a;y=n=y-144|0,J(r=n+96|0,t+80|0),x(i=n+48|0,t,r),x(n,t+40|0,r),G(e,n),s=e,a=Dt(i)<<7^l[e+31|0],o[s+31|0]=a,y=n+144|0}function nt(e,t,n){var r=0;if(e>>>0<t>>>0)return pt(e,t,n);if(n)for(r=e+n|0,t=t+n|0;t=t-1|0,o[0|(r=r-1|0)]=l[0|t],n=n-1|0;);return e}function rt(e,t){var n,r=0;if(o[15+(n=y-16|0)|0]=0,t)for(;o[n+15|0]=l[e+r|0]|l[n+15|0],(0|(r=r+1|0))!=(0|t););return l[n+15|0]-1>>>8&1}function it(e,t,n,r){var i;return r=t+r|0,r=(i=e+n|0)>>>0<n>>>0?r+1|0:r,n=ze(e<<1&-2,1&(t=t<<1|e>>>31),n,0),e=b+r|0,b=e=(t=n+i|0)>>>0<n>>>0?e+1|0:e,t}function ot(e,t,n){o[0|e]=t,o[e+1|0]=t>>>8,o[e+2|0]=t>>>16,o[e+3|0]=t>>>24,o[e+4|0]=n,o[e+5|0]=n>>>8,o[e+6|0]=n>>>16,o[e+7|0]=n>>>24}function st(e,t){e|=0;var n=0,r=0,i=0;if(t|=0)for(;r=e+n|0,i=Ct(),o[0|r]=i,(0|(n=n+1|0))!=(0|t););}function at(e,t,n,r,i){var o,s;return e|=0,t|=0,n|=0,r|=0,y=o=(s=y)-128&-64,te(o,i|=0),$(o,t,n,r),q(o,e),y=s,0}function lt(e){var t=0,n=0,r=0;for(t=1;t=l[0|(r=e+n|0)]+t|0,o[0|r]=t,t=t>>>8|0,4!=(0|(n=n+1|0)););}function ct(e,t,n,r,i,o,s,a){var l,c=0;return y=l=y-32|0,c=-1,dt(l,s,a)||(c=Zt(e,t,n,r,i,o,l),bn(l,32)),y=l+32|0,c}function ut(e,t,n,r,i,o,s,a){var l,c=0;return y=l=y-32|0,c=-1,dt(l,s,a)||(c=Wt(e,t,n,r,i,o,l),bn(l,32)),y=l+32|0,c}function dt(e,t,n){e|=0;var r,i=0;return y=r=y-32|0,i=-1,Ye(r,n|=0,t|=0)||(i=K(e,34976,r)),y=r+32|0,0|i}function ht(e,t){var n,r,i;x(e,t,n=t+120|0),x(e+40|0,r=t+40|0,i=t+80|0),x(e+80|0,i,n),x(e+120|0,t,r)}function pt(e,t,n){var r=0;if(n)for(r=e;o[0|r]=l[0|t],r=r+1|0,t=t+1|0,n=n-1|0;);return e}function ft(e,t){var n,r;y=r=y-128|0,ke(n=r+8|0,t),ke(n+40|0,t+40|0),ke(n+80|0,t+80|0),P(e,n),y=r+128|0}function gt(e,t,n,r,i,o,s){return!r&n>>>0>=16|r?ut(e,t+16|0,t,n-16|0,r-(n>>>0<16)|0,i,o,s):-1}function mt(e,t){for(var n=0,r=0;o[0|(r=e+n|0)]=l[0|r]^l[t+n|0],8!=(0|(n=n+1|0)););}function yt(e,t,n){var r,i;y=r=(i=y)-384&-64,Tt(r,0,0,24),ln(r,t,32,0),ln(r,n,32,0),Lt(r,e,24),y=i}function vt(e,t,n){var r=0;if(n)for(r=e;o[0|r]=t,r=r+1|0,n=n-1|0;);return e}function At(e,t){var n;me(e,n=t+40|0,t),ge(e+40|0,n,t),ke(e+80|0,t+80|0),x(e+120|0,t+120|0,1520)}function bt(e,t){var n;x(e,t,n=t+120|0),x(e+40|0,t+40|0,t=t+80|0),x(e+80|0,t,n)}function wt(e,t,n,r,i,o,s){return!r&n>>>0>=4294967280|r&&(Ut(),h()),ct(e+16|0,e,t,n,r,i,o,s)}function St(e){var t;return t=l[0|e]|l[e+1|0]<<8,e=l[e+2|0],b=e>>>16|0,t|e<<16}function Ct(){var e,t;return y=e=y-16|0,o[e+15|0]=0,t=0|f(35048,e+15|0,0),y=e+16|0,0|t}function Et(e,t){var n=0;return(-1>>>(n=31&t)&e)<<n|((n=e)&-1<<(e=0-t&31))>>>e}function It(e,t,n,r){var i;return y=i=y-208|0,Pt(i),Z(i,t,n,r),je(i,e),y=i+208|0,0}function _t(e,t,n,r,i,o,s){1==(0|r)|r>>>0>1&&(Ut(),h()),jn[a[8752]](e,t,n,r,i,o,s)}function xt(e,t,n,r,i,o){1==(0|r)|r>>>0>1&&(Ut(),h()),jn[a[8751]](e,t,n,r,i,1,0,o)}function Pt(e){a[e+64>>2]=0,a[e+68>>2]=0,a[e+72>>2]=0,a[e+76>>2]=0,pt(e,34080,64)}function kt(e,t,n){return n>>>0>=256&&(p(1279,1206,107,1067),h()),M(e,t,255&n)}function Bt(){var e;y=e=y-16|0,o[e+15|0]=0,f(35084,e+15|0,0),y=e+16|0}function Ot(e,t){o[0|e]=t,o[e+1|0]=t>>>8,o[e+2|0]=t>>>16,o[e+3|0]=t>>>24}function Nt(e){var t;return y=t=y-32|0,G(t,e),e=rt(t,32),y=t+32|0,e}function Dt(e){var t;return y=t=y-32|0,G(t,e),y=t+32|0,1&o[0|t]}function jt(e,t,n){ce(e,t,n),ce(e+40|0,t+40|0,n),ce(e+80|0,t+80|0,n)}function Tt(e,t,n,r){return 0|Je(e|=0,t|=0,n|=0,r|=0)}function Mt(e){o[e+32|0]=1,o[e+33|0]=0,o[e+34|0]=0,o[e+35|0]=0}function Ft(e){a[e>>2]=0,a[e+4>>2]=0,a[e+8>>2]=0,a[e+12>>2]=0}function Rt(e){o[0|e]=0,o[e+1|0]=0,o[e+2|0]=0,o[e+3|0]=0}function Lt(e,t,n){return 0|kt(e|=0,t|=0,n|=0)}function Qt(e,t,n){return 0|Ye(e|=0,t|=0,n|=0)}function Ut(){var e;(e=a[9098])&&jn[0|e](),m(),h()}function Vt(e){wn(e),cn(e+40|0),cn(e+80|0),wn(e+120|0)}function Kt(e,t,n,r,i,o){jn[a[8761]](e,t,n,r,i,1,0,o)}function Ht(e,t,n,r,i,o){jn[a[8761]](e,t,n,r,i,0,0,o)}function Gt(e,t){return e|=0,st(t|=0,32),0|rn(e,t)}function Yt(e,t,n,r,i,o){return S(e,t,n,r,i,o,0),0}function zt(e,t,n,r,i,o,s){return De(e,t,n,r,i,o,s)}function Zt(e,t,n,r,i,o,s){return se(e,t,n,r,i,o,s)}function Wt(e,t,n,r,i,o,s){return ae(e,t,n,r,i,o,s)}function qt(e,t){Pt(e),t&&Z(e,34912,34,0)}function Jt(e,t,n,r,i){return Q(e,t,n,r,i,0)}function Xt(e,t){return 0|rn(e|=0,t|=0)}function $t(e,t,n,r){jn[a[8750]](e,t,0,n,r)}function en(e,t){return(255&(e^t))-1>>>31|0}function tn(e,t,n){jn[a[8749]](e,64,0,t,n)}function nn(e,t,n,r){jn[a[8756]](e,t,n,r)}function rn(e,t){return 0|jn[a[8759]](e,t)}function on(e,t,n,r){return ne(e,t,n,r)}function sn(e){return Xe(e,45,95,32704)}function an(e){return Xe(e,43,47,16320)}function ln(e,t,n,r){return on(e,t,n,r)}function cn(e){a[e>>2]=1,vt(e+4|0,0,36)}function un(e){1!=(-7&e)&&(Ut(),h())}function dn(e,t){return He(e,t,16)}function hn(e,t){jn[a[8755]](e,t)}function pn(e,t){jn[a[8757]](e,t)}function fn(e,t){return He(e,t,32)}function gn(e,t,n,r){$t(e,t,n,r)}function mn(e,t){return Et(e,t)}function yn(e,t){pt(e,t,1024)}function vn(e){st(e|=0,32)}function An(e){vt(e,0,1024)}function bn(e,t){vt(e,0,t)}function wn(e){vt(e,0,40)}function Sn(){return 32}function Cn(){return 24}function En(){return-17}function In(){return 64}function _n(){return 16}function xn(){return 1}function Pn(){return 2}function kn(){return 8}function Bn(){return 3}function On(){return 0}function Nn(){return-1}i(t=l,1024,"TGlic29kaXVtRFJHcmFuZG9tYnl0ZXMAYjY0X3BvcyA8PSBiNjRfbGVuAGNyeXB0b19nZW5lcmljaGFzaF9ibGFrZTJiX2ZpbmFsACRhcmdvbjJpACRhcmdvbjJpZAByYW5kb21ieXRlcy9yYW5kb21ieXRlcy5jAHNvZGl1bS9jb2RlY3MuYwBjcnlwdG9fZ2VuZXJpY2hhc2gvYmxha2UyYi9yZWYvYmxha2UyYi1yZWYuYwBjcnlwdG9fZ2VuZXJpY2hhc2gvYmxha2UyYi9yZWYvZ2VuZXJpY2hhc2hfYmxha2UyYi5jAGJ1Zl9sZW4gPD0gU0laRV9NQVgAb3V0bGVuIDw9IFVJTlQ4X01BWABTLT5idWZsZW4gPD0gQkxBS0UyQl9CTE9DS0JZVEVTACRhcmdvbjJpJHY9ACRhcmdvbjJpZCR2PQAsdD0ALHA9ACRtPQAxLjAuMTgAc29kaXVtX2JpbjJiYXNlNjQAJGFyZ29uMmkkACRhcmdvbjJpZCQ="),i(t,1424,"tnhZ/4Vy0wC9bhX/DwpqACnAAQCY6Hn/vDyg/5lxzv8At+L+tA1I/wAAAAAAAAAAsKAO/tPJhv+eGI8Af2k1AGAMvQCn1/v/n0yA/mpl4f8e/AQAkgyu"),i(t,1520,"WfGy/grlpv973Sr+HhTUAFKAAwAw0fMAd3lA/zLjnP8AbsUBZxuQ"),i(t,1568,"hTuMAb3xJP/4JcMBYNw3ALdMPv/DQj0AMkykAeGkTP9MPaP/dT4fAFGRQP92QQ4AonPW/waKLgB85vT/CoqPADQawgC49EwAgY8pAb70E/97qnr/YoFEAHnVkwBWZR7/oWebAIxZQ//v5b4BQwu1AMbwif7uRbz/Q5fuABMqbP/lVXEBMkSH/xFqCQAyZwH/UAGoASOYHv8QqLkBOFno/2XS/AAp+kcAzKpP/w4u7/9QTe8AvdZL/xGN+QAmUEz/vlV1AFbkqgCc2NABw8+k/5ZCTP+v4RD/jVBiAUzb8gDGonIALtqYAJsr8f6boGj/M7ulAAIRrwBCVKAB9zoeACNBNf5F7L8ALYb1AaN73QAgbhT/NBelALrWRwDpsGAA8u82ATlZigBTAFT/iKBkAFyOeP5ofL4AtbE+//opVQCYgioBYPz2AJeXP/7vhT4AIDicAC2nvf+OhbMBg1bTALuzlv76qg7/0qNOACU0lwBjTRoA7pzV/9XA0QFJLlQAFEEpATbOTwDJg5L+qm8Y/7EhMv6rJsv/Tvd0ANHdmQCFgLIBOiwZAMknOwG9E/wAMeXSAXW7dQC1s7gBAHLbADBekwD1KTgAfQ3M/vStdwAs3SD+VOoUAPmgxgHsfur/L2Oo/qrimf9ms9gA4o16/3pCmf629YYA4+QZAdY56//YrTj/tefSAHeAnf+BX4j/bn4zAAKpt/8HgmL+RbBe/3QE4wHZ8pH/yq0fAWkBJ/8ur0UA5C86/9fgRf7POEX/EP6L/xfP1P/KFH7/X9Vg/wmwIQDIBc//8SqA/iMhwP/45cQBgRF4APtnl/8HNHD/jDhC/yji9f/ZRiX+rNYJ/0hDhgGSwNb/LCZwAES4S//OWvsAleuNALWqOgB09O8AXJ0CAGatYgDpiWABfzHLAAWblAAXlAn/03oMACKGGv/bzIgAhggp/+BTK/5VGfcAbX8A/qmIMADud9v/563VAM4S/v4Iugf/fgkHAW8qSABvNOz+YD+NAJO/f/7NTsD/DmrtAbvbTACv87v+aVmtAFUZWQGi85QAAnbR/iGeCQCLoy7/XUYoAGwqjv5v/I7/m9+QADPlp/9J/Jv/XnQM/5ig2v+c7iX/s+rP/8UAs/+apI0A4cRoAAojGf7R1PL/Yf3e/rhl5QDeEn8BpIiH/x7PjP6SYfMAgcAa/slUIf9vCk7/k1Gy/wQEGACh7tf/Bo0hADXXDv8ptdD/54udALPL3f//uXEAveKs/3FC1v/KPi3/ZkAI/06uEP6FdUT/"),i(t,2560,"AQ=="),i(t,2592,"JuiVj8KyJ7BFw/SJ8u+Y8NXfrAXTxjM5sTgCiG1T/AXHF2pwPU3YT7o8C3YNEGcPKiBT+iw5zMZOx/13kqwDeuz///////////////////////////////////////9/7f///////////////////////////////////////3/u////////////////////////////////////////f+3T9VwaYxJY1pz3ot753hQ="),i(t,2783,"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"),i(t,33756,"AQ=="),i(t,33792,"AQ=="),i(t,33824,"4Ot6fDtBuK4WVuP68Z/EatoJjeucMrH9hmIFFl9JuABfnJW8o1CMJLHQsVWcg+9bBERcxFgcjobYIk7d0J8RV+z///////////////////////////////////////9/7f///////////////////////////////////////3/u////////////////////////////////////////fwjJvPNn5glqO6fKhIWuZ7sr+JT+cvNuPPE2HV869U+l0YLmrX9SDlEfbD4rjGgFm2u9Qfur2YMfeSF+ExnN4Fs="),i(t,34080,"CMm882fmCWo7p8qEha5nuyv4lP5y82488TYdXzr1T6XRguatf1IOUR9sPiuMaAWba71B+6vZgx95IX4TGc3gWyKuKNeYL4pCzWXvI5FEN3EvO03sz/vAtbzbiYGl27XpOLVI81vCVjkZ0AW28RHxWZtPGa+kgj+SGIFt2tVeHKtCAgOjmKoH2L5vcEUBW4MSjLLkTr6FMSTitP/Vw30MVW+Je/J0Xb5ysZYWO/6x3oA1Esclpwbcm5Qmac908ZvB0krxnsFpm+TjJU84hke+77XVjIvGncEPZZysd8yhDCR1AitZbyzpLYPkpm6qhHRK1PtBvdypsFy1UxGD2oj5dqvfZu5SUT6YEDK0LW3GMag/IfuYyCcDsOQO777Hf1m/wo+oPfML4MYlpwqTR5Gn1W+CA+BRY8oGcG4OCmcpKRT8L9JGhQq3JybJJlw4IRsu7SrEWvxtLE3fs5WdEw04U95jr4tUcwplqLJ3PLsKanbmru1HLsnCgTs1ghSFLHKSZAPxTKHov6IBMEK8S2YaqJGX+NBwi0vCML5UBqNRbMcYUu/WGeiS0RCpZVUkBpnWKiBxV4U1DvS40bsycKBqEMjQ0rgWwaQZU6tBUQhsNx6Z647fTHdIJ6hIm+G1vLA0Y1rJxbMMHDnLikHjSqrYTnPjY3dPypxbo7iy1vNvLmj8su9d7oKPdGAvF0NvY6V4cqvwoRR4yITsOWQaCALHjCgeYyP6/76Q6b2C3utsUKQVecay96P5vitTcuPyeHHGnGEm6s4+J8oHwsAhx7iG0R7r4M3WfdrqeNFu7n9PffW6bxdyqmfwBqaYyKLFfWMKrg35vgSYPxEbRxwTNQtxG4R9BCP1d9sokyTHQHuryjK8vskVCr6ePEwNEJzEZx1DtkI+y77UxUwqfmX8nCl/Wez61jqrb8tfF1hHSowZRGyA"),i(t,34912,"U2lnRWQyNTUxOSBubyBFZDI1NTE5IGNvbGxpc2lvbnMB"),i(t,34992,"MI5QAAEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0=");var Dn,jn=(Dn=[null,function(e,t,n,r,i){var o;return e|=0,r|=0,y=o=y+-64|0,(t|=0)|(n|=0)&&(oe(o,i|=0),Be(o,r,0),N(o,e=vt(e,0,t),e,t,n),bn(o,64)),y=o- -64|0,0},function(e,t,n,r,i){var o;return e|=0,r|=0,y=o=y+-64|0,(t|=0)|(n|=0)&&(oe(o,i|=0),Me(o,r,0),N(o,e=vt(e,0,t),e,t,n),bn(o,64)),y=o- -64|0,0},function(e,t,n,r,i,o,s,a){e|=0,t|=0,i|=0,o|=0,s|=0,a|=0;var l,c=0;return y=l=y-80|0,(n|=0)|(r|=0)&&(Ot(c=l+8|0,o),Ot(l+12|0,s),oe(o=l+16|0,a),Be(o,i,c),N(o,t,e,n,r),bn(o,64)),y=l+80|0,0},function(e,t,n,r,i,o,s){e|=0,t|=0,i|=0,o|=0,s|=0;var a,l=0;return y=a=y-80|0,(n|=0)|(r|=0)&&(Ot(l=a+12|0,o),oe(o=a+16|0,s),Me(o,i,l),N(o,t,e,n,r),bn(o,64)),y=a+80|0,0},at,function(e,t,n,r,i){var o;return e|=0,y=o=y-16|0,at(o,t|=0,n|=0,r|=0,i|=0),e=dn(e,o),y=o+16|0,0|e},function(e,t){return te(e|=0,t|=0),0},function(e,t,n,r){return $(e|=0,t|=0,n|=0,r|=0),0},function(e,t){return q(e|=0,t|=0),0},function(e,t,n){e|=0,t|=0,n|=0;var r,i=0,s=0,c=0,u=0,d=0,h=0,p=0,f=0,g=0,m=0,v=0,A=0,w=0,S=0,C=0,E=0,I=0,_=0,P=0,B=0,O=0,N=0,D=0,j=0,T=0,M=0,R=0,L=0,Q=0;for(u=-1,o[11+(s=(y=r=y-336|0)-16|0)|0]=0,o[s+12|0]=0,o[s+13|0]=0,o[s+14|0]=0,a[s+8>>2]=0;;){for(p=l[n+c|0],i=0;o[0|(d=(s+8|0)+i|0)]=l[0|d]|p^l[(33760+(i<<5)|0)+c|0],7!=(0|(i=i+1|0)););if(31==(0|(c=c+1|0)))break}for(p=127&l[n+31|0],c=0,i=0;o[0|(d=(s+8|0)+i|0)]=l[0|d]|p^l[33791+(i<<5)|0],7!=(0|(i=i+1|0)););for(i=0;i=l[(s+8|0)+c|0]-1|i,7!=(0|(c=c+1|0)););if(!(i>>>8&1)){for(u=0;o[e+u|0]=l[t+u|0],32!=(0|(u=u+1|0)););for(o[0|e]=248&l[0|e],o[e+31|0]=63&l[e+31|0]|64,F(t=r+288|0,n),cn(r+240|0),wn(r+192|0),ke(r+144|0,t),cn(r+96|0),n=254,t=0;i=t,ee(s=r+240|0,m=r+144|0,i^=t=l[(n>>>3|0)+e|0]>>>(7&n)&1),ee(h=r+192|0,u=r+96|0,i),N=n,n=n-1|0,ge(f=r+48|0,m,u),ge(r,s,h),me(s,s,h),me(h,m,u),x(u,f,s),x(h,h,r),k(f,r),k(r,s),me(m,u,h),ge(h,u,h),x(s,r,f),ge(r,r,f),k(h,h),S=i=a[r+4>>2],C=i>>31,E=i=a[r+8>>2],D=i>>31,A=i=a[r+12>>2],w=i>>31,I=i=a[r+16>>2],j=i>>31,g=i=a[r+20>>2],v=i>>31,_=i=a[r+24>>2],T=i>>31,M=i=a[r>>2],R=i>>31,s=ze(i=a[r+36>>2],i>>31,121666,0),i=b,L=c=s+16777216|0,p=i=c>>>0<16777216?i+1|0:i,P=s-(-33554432&c)|0,i=ze(i=a[r+32>>2],i>>31,121666,0),c=b,d=ze(s=a[r+28>>2],s>>31,121666,0),s=b,Q=i,B=i=d+16777216|0,c=(i=(s=i>>>0<16777216?s+1|0:s)>>25)+c|0,i=c=(s=Q+(O=(33554431&s)<<7|B>>>25)|0)>>>0<O>>>0?c+1|0:c,i=((67108863&(i=(c=s+33554432|0)>>>0<33554432?i+1|0:i))<<6|c>>>26)+P|0,a[u+36>>2]=i,i=-67108864&c,a[u+32>>2]=s-i,P=d-(-33554432&B)|0,s=ze(_,T,121666,0),_=b,c=ze(g,v,121666,0),i=b,d=s,g=s=c+16777216|0,v=(33554431&(i=s>>>0<16777216?i+1|0:i))<<7|s>>>25,i=(i>>25)+_|0,s=i=(d=d+v|0)>>>0<v>>>0?i+1|0:i,v=i=d+33554432|0,i=((67108863&(s=i>>>0<33554432?s+1|0:s))<<6|i>>>26)+P|0,a[u+28>>2]=i,i=-67108864&v,a[u+24>>2]=d-i,g=c-(-33554432&g)|0,i=ze(I,j,121666,0),I=b,d=ze(A,w,121666,0),s=b,c=i,A=i=d+16777216|0,w=(33554431&(s=i>>>0<16777216?s+1|0:s))<<7|i>>>25,s=(s>>25)+I|0,c=i=c+w|0,i=i>>>0<w>>>0?s+1|0:s,i=((67108863&(i=(s=c+33554432|0)>>>0<33554432?i+1|0:i))<<6|s>>>26)+g|0,a[u+20>>2]=i,i=-67108864&s,a[u+16>>2]=c-i,A=d-(-33554432&A)|0,i=ze(E,D,121666,0),E=b,d=ze(S,C,121666,0),c=b,g=i,S=i=d+16777216|0,s=i,i=(i=(c=i>>>0<16777216?c+1|0:c)>>25)+E|0,i=(s=g+(c=(33554431&c)<<7|s>>>25)|0)>>>0<c>>>0?i+1|0:i,c=s,s=i,C=i=c+33554432|0,i=((67108863&(s=i>>>0<33554432?s+1|0:s))<<6|i>>>26)+A|0,a[u+12>>2]=i,i=-67108864&C,a[u+8>>2]=c-i,i=ze((33554431&p)<<7|L>>>25,p>>25,19,0),c=b,s=(p=ze(M,R,121666,0))+i|0,i=b+c|0,c=s,s=s>>>0<p>>>0?i+1|0:i,p=i=c+33554432|0,i=(d-(-33554432&S)|0)+((67108863&(s=i>>>0<33554432?s+1|0:s))<<6|i>>>26)|0,a[u+4>>2]=i,i=-67108864&p,a[u>>2]=c-i,k(m,m),me(f,f,u),x(u,r+288|0,h),x(h,r,f),N;);ee(n=r+240|0,r+144|0,t),ee(i=r+192|0,r+96|0,t),J(i,i),x(n,n,i),G(e,n),u=0}return y=r+336|0,0|u},function(e,t){e|=0,t|=0;var n,r,i,s=0;for(y=n=y-208|0;o[e+s|0]=l[t+s|0],32!=(0|(s=s+1|0)););return o[0|e]=248&l[0|e],o[e+31|0]=63&l[e+31|0]|64,re(n+48|0,e),y=t=y-96|0,me(s=t+48|0,r=n+128|0,i=n+88|0),ge(t,r,i),J(t,t),x(n,s,t),y=t+96|0,G(e,n),y=n+208|0,0},function(e,t,n,r,i){e|=0,r|=0,i|=0;var s,c=0;if(y=s=y-112|0,(t|=0)|(n|=0)){c=l[i+28|0]|l[i+29|0]<<8|l[i+30|0]<<16|l[i+31|0]<<24,a[s+24>>2]=l[i+24|0]|l[i+25|0]<<8|l[i+26|0]<<16|l[i+27|0]<<24,a[s+28>>2]=c,c=l[i+20|0]|l[i+21|0]<<8|l[i+22|0]<<16|l[i+23|0]<<24,a[s+16>>2]=l[i+16|0]|l[i+17|0]<<8|l[i+18|0]<<16|l[i+19|0]<<24,a[s+20>>2]=c,c=l[i+4|0]|l[i+5|0]<<8|l[i+6|0]<<16|l[i+7|0]<<24,a[s>>2]=l[0|i]|l[i+1|0]<<8|l[i+2|0]<<16|l[i+3|0]<<24,a[s+4>>2]=c,c=l[i+12|0]|l[i+13|0]<<8|l[i+14|0]<<16|l[i+15|0]<<24,a[s+8>>2]=l[i+8|0]|l[i+9|0]<<8|l[i+10|0]<<16|l[i+11|0]<<24,a[s+12>>2]=c,i=l[0|r]|l[r+1|0]<<8|l[r+2|0]<<16|l[r+3|0]<<24,r=l[r+4|0]|l[r+5|0]<<8|l[r+6|0]<<16|l[r+7|0]<<24,a[s+104>>2]=0,a[s+108>>2]=0,a[s+96>>2]=i,a[s+100>>2]=r;e:{if(!n&t>>>0>=64|n){for(;;){for(L(e,s+96|0,s),i=8,r=1;r=l[0|(c=(s+96|0)+i|0)]+r|0,o[0|c]=r,r=r>>>8|0,16!=(0|(i=i+1|0)););if(e=e- -64|0,n=n-1|0,!(!(n=(t=t+-64|0)>>>0<4294967232?n+1|0:n)&t>>>0>63|n))break}if(!(t|n))break e}for(i=0,L(s+32|0,s+96|0,s);o[e+i|0]=l[(s+32|0)+i|0],(0|t)!=(0|(i=i+1|0)););}bn(s+32|0,64),bn(s,32)}return y=s+112|0,0},function(e,t,n,r,i,s,c,u){e|=0,t|=0,i|=0,s|=0,c|=0,u|=0;var d,h=0,p=0;if(y=d=y-112|0,(n|=0)|(r|=0)){for(h=l[u+28|0]|l[u+29|0]<<8|l[u+30|0]<<16|l[u+31|0]<<24,a[d+24>>2]=l[u+24|0]|l[u+25|0]<<8|l[u+26|0]<<16|l[u+27|0]<<24,a[d+28>>2]=h,h=l[u+20|0]|l[u+21|0]<<8|l[u+22|0]<<16|l[u+23|0]<<24,a[d+16>>2]=l[u+16|0]|l[u+17|0]<<8|l[u+18|0]<<16|l[u+19|0]<<24,a[d+20>>2]=h,h=l[u+4|0]|l[u+5|0]<<8|l[u+6|0]<<16|l[u+7|0]<<24,a[d>>2]=l[0|u]|l[u+1|0]<<8|l[u+2|0]<<16|l[u+3|0]<<24,a[d+4>>2]=h,h=8,p=l[u+12|0]|l[u+13|0]<<8|l[u+14|0]<<16|l[u+15|0]<<24,a[d+8>>2]=l[u+8|0]|l[u+9|0]<<8|l[u+10|0]<<16|l[u+11|0]<<24,a[d+12>>2]=p,u=l[i+4|0]|l[i+5|0]<<8|l[i+6|0]<<16|l[i+7|0]<<24,a[d+96>>2]=l[0|i]|l[i+1|0]<<8|l[i+2|0]<<16|l[i+3|0]<<24,a[d+100>>2]=u;o[(d+96|0)+h|0]=s,s=(255&c)<<24|s>>>8,c=c>>>8|0,16!=(0|(h=h+1|0)););if(!r&n>>>0>63|r)for(;;){for(h=0,L(d+32|0,d+96|0,d);o[e+h|0]=l[(d+32|0)+h|0]^l[t+h|0],u=1,64!=(0|(h=h+1|0)););for(h=8;i=l[0|(s=(d+96|0)+h|0)]+u|0,o[0|s]=i,u=i>>>8|0,16!=(0|(h=h+1|0)););if(t=t- -64|0,e=e- -64|0,r=r-1|0,!(!(r=(n=n+-64|0)>>>0<4294967232?r+1|0:r)&n>>>0>63|r))break}if(n|r)for(h=0,L(d+32|0,d+96|0,d);o[e+h|0]=l[(d+32|0)+h|0]^l[t+h|0],(0|n)!=(0|(h=h+1|0)););bn(d+32|0,64),bn(d,32)}return y=d+112|0,0}],Dn.grow=function(e){var t=this.length;return this.length=this.length+e,t},Dn.set=function(e,t){this[e]=t},Dn.get=function(e){return this[e]},Dn);function Tn(){return r.byteLength/65536|0}return{f:function(){},g:function(e,t,n,r,i,o,s,a,l,c,u,d){return 0|Te(e|=0,t|=0,n|=0,r|=0,(e=0)|(i|=0),o|=0,s|=0,e|(a|=0),l|=0,u|=0,d|=0)},h:function(e,t,n,r,i,o,s,l,c,u,d){return e|=0,t|=0,c|=0,c=r|=0,!(r=i|=0)&(i=0|c)>>>0<4294967280?(Te(e,e+i|0,0,n|=0,i,r,o|=0,s|=0,l|=0,u|=0,d|=0),t&&(r=(e=i+16|0)>>>0<16?r+1|0:r,a[t>>2]=e,a[t+4>>2]=r)):(Ut(),h()),0},i:function(e,t,n,r,i,o,s,a,l,c,u,d){return 0|xe(e|=0,t|=0,n|=0,r|=0,(e=0)|(i|=0),o|=0,s|=0,e|(a|=0),l|=0,u|=0,d|=0)},j:function(e,t,n,r,i,o,s,l,c,u,d){return e|=0,t|=0,c|=0,c=r|=0,!(r=i|=0)&(i=0|c)>>>0<4294967280?(xe(e,e+i|0,0,n|=0,i,r,o|=0,s|=0,l|=0,u|=0,d|=0),t&&(r=(e=i+16|0)>>>0<16?r+1|0:r,a[t>>2]=e,a[t+4>>2]=r)):(Ut(),h()),0},k:function(e,t,n,r,i,o,s,a,l,c,u){return 0|Pe(e|=0,n|=0,(e=0)|(r|=0),i|=0,o|=0,s|=0,e|(a|=0),l|=0,c|=0,u|=0)},l:function(e,t,n,r,i,o,s,l,c,u,d){return t|=0,n|=0,r|=0,i|=0,l|=0,l|=0,n=-1,!(o|=0)&(i|=0)>>>0>=16|o&&(n=Pe(e|=0,r,i-16|0,o-(i>>>0<16)|0,(r+i|0)-16|0,s|=0,l,c|=0,u|=0,d|=0)),t&&(a[t>>2]=n?0:i-16|0,a[t+4>>2]=n?0:o-(i>>>0<16)|0),0|n},m:function(e,t,n,r,i,o,s,a,l,c,u){return 0|Ee(e|=0,n|=0,(e=0)|(r|=0),i|=0,o|=0,s|=0,e|(a|=0),l|=0,c|=0,u|=0)},n:function(e,t,n,r,i,o,s,l,c,u,d){return t|=0,n|=0,r|=0,i|=0,l|=0,l|=0,n=-1,!(o|=0)&(i|=0)>>>0>=16|o&&(n=Ee(e|=0,r,i-16|0,o-(i>>>0<16)|0,(r+i|0)-16|0,s|=0,l,c|=0,u|=0,d|=0)),t&&(a[t>>2]=n?0:i-16|0,a[t+4>>2]=n?0:o-(i>>>0<16)|0),0|n},o:Sn,p:function(){return 12},q:On,r:_n,s:En,t:vn,u:Sn,v:kn,w:On,x:_n,y:En,z:vn,A:function(e,t,n,r,i,o,s,a,l,c,u,d){return 0|fe(e|=0,t|=0,n|=0,r|=0,(e=0)|(i|=0),o|=0,s|=0,e|(a|=0),l|=0,u|=0,d|=0)},B:function(e,t,n,r,i,o,s,l,c,u,d){return e|=0,t|=0,c|=0,c=r|=0,!(r=i|=0)&(i=0|c)>>>0<4294967280?(fe(e,e+i|0,0,n|=0,i,r,o|=0,s|=0,l|=0,u|=0,d|=0),t&&(r=(e=i+16|0)>>>0<16?r+1|0:r,a[t>>2]=e,a[t+4>>2]=r)):(Ut(),h()),0},C:function(e,t,n,r,i,o,s,a,l,c,u){return 0|ue(e|=0,n|=0,(e=0)|(r|=0),i|=0,o|=0,s|=0,e|(a|=0),l|=0,c|=0,u|=0)},D:function(e,t,n,r,i,o,s,l,c,u,d){return t|=0,n|=0,r|=0,i|=0,l|=0,l|=0,n=-1,!(o|=0)&(i|=0)>>>0>=16|o&&(n=ue(e|=0,r,i-16|0,o-(i>>>0<16)|0,(r+i|0)-16|0,s|=0,l,c|=0,u|=0,d|=0)),t&&(a[t>>2]=n?0:i-16|0,a[t+4>>2]=n?0:o-(i>>>0<16)|0),0|n},E:Sn,F:Cn,G:On,H:_n,I:En,J:vn,K:Sn,L:Sn,M:function(e,t,n,r,i){return 0|z(e|=0,t|=0,n|=0,r|=0,i|=0)},N:function(e,t,n,r,i){var o;return e|=0,y=o=y-32|0,z(o,t|=0,n|=0,r|=0,i|=0),t=fn(e,o),n=Ze(o,e,32),y=o+32|0,n|((0|e)==(0|o)?-1:t)},O:vn,P:Sn,Q:Sn,R:Sn,S:Sn,T:Cn,U:_n,V:En,W:function(e,t,n){e|=0,t|=0;var r,i=0;return y=r=y+-64|0,It(r,n|=0,32,0),n=a[r+28>>2],i=a[r+24>>2],o[t+24|0]=i,o[t+25|0]=i>>>8,o[t+26|0]=i>>>16,o[t+27|0]=i>>>24,o[t+28|0]=n,o[t+29|0]=n>>>8,o[t+30|0]=n>>>16,o[t+31|0]=n>>>24,n=a[r+20>>2],i=a[r+16>>2],o[t+16|0]=i,o[t+17|0]=i>>>8,o[t+18|0]=i>>>16,o[t+19|0]=i>>>24,o[t+20|0]=n,o[t+21|0]=n>>>8,o[t+22|0]=n>>>16,o[t+23|0]=n>>>24,n=a[r+12>>2],i=a[r+8>>2],o[t+8|0]=i,o[t+9|0]=i>>>8,o[t+10|0]=i>>>16,o[t+11|0]=i>>>24,o[t+12|0]=n,o[t+13|0]=n>>>8,o[t+14|0]=n>>>16,o[t+15|0]=n>>>24,n=a[r+4>>2],i=a[r>>2],o[0|t]=i,o[t+1|0]=i>>>8,o[t+2|0]=i>>>16,o[t+3|0]=i>>>24,o[t+4|0]=n,o[t+5|0]=n>>>8,o[t+6|0]=n>>>16,o[t+7|0]=n>>>24,bn(r,64),e=rn(e,t),y=r- -64|0,0|e},X:Gt,Y:dt,Z:function(e,t,n,r,i,o,s){return 0|Zt(e|=0,t|=0,n|=0,r|=0,i|=0,o|=0,s|=0)},_:function(e,t,n,r,i,o,s,a){return 0|ct(e|=0,t|=0,n|=0,r|=0,i|=0,o|=0,s|=0,a|=0)},$:function(e,t,n,r,i,o){return e|=0,t|=0,i|=0,o|=0,!(r|=0)&(n|=0)>>>0>=4294967280|r&&(Ut(),h()),0|Zt(e+16|0,e,t,n,r,i,o)},aa:function(e,t,n,r,i,o,s){return 0|wt(e|=0,t|=0,n|=0,r|=0,i|=0,o|=0,s|=0)},ba:function(e,t,n,r,i,o,s){return 0|Wt(e|=0,t|=0,n|=0,r|=0,i|=0,o|=0,s|=0)},ca:function(e,t,n,r,i,o,s,a){return 0|ut(e|=0,t|=0,n|=0,r|=0,i|=0,o|=0,s|=0,a|=0)},da:function(e,t,n,r,i,o){return t|=0,0|(!(r|=0)&(n|=0)>>>0>=16|r?Wt(e|=0,t+16|0,t,n-16|0,r-(n>>>0<16)|0,i|=0,o|=0):-1)},ea:function(e,t,n,r,i,o,s){return 0|gt(e|=0,t|=0,n|=0,r|=0,i|=0,o|=0,s|=0)},fa:function(e,t,n,r,i){e|=0,t|=0,i|=0;var s,l,c=0,u=0;return l=n|=0,n=r|=0,y=s=y-96|0,r=-1,Gt(s+32|0,s)||(yt(c=s- -64|0,u=s+32|0,i),r=wt(e+32|0,t,l,n,c,i,s),t=a[s+60>>2],n=a[s+56>>2],o[e+24|0]=n,o[e+25|0]=n>>>8,o[e+26|0]=n>>>16,o[e+27|0]=n>>>24,o[e+28|0]=t,o[e+29|0]=t>>>8,o[e+30|0]=t>>>16,o[e+31|0]=t>>>24,t=a[s+52>>2],n=a[s+48>>2],o[e+16|0]=n,o[e+17|0]=n>>>8,o[e+18|0]=n>>>16,o[e+19|0]=n>>>24,o[e+20|0]=t,o[e+21|0]=t>>>8,o[e+22|0]=t>>>16,o[e+23|0]=t>>>24,t=a[s+44>>2],n=a[s+40>>2],o[e+8|0]=n,o[e+9|0]=n>>>8,o[e+10|0]=n>>>16,o[e+11|0]=n>>>24,o[e+12|0]=t,o[e+13|0]=t>>>8,o[e+14|0]=t>>>16,o[e+15|0]=t>>>24,t=a[s+36>>2],n=a[s+32>>2],o[0|e]=n,o[e+1|0]=n>>>8,o[e+2|0]=n>>>16,o[e+3|0]=n>>>24,o[e+4|0]=t,o[e+5|0]=t>>>8,o[e+6|0]=t>>>16,o[e+7|0]=t>>>24,bn(s,32),bn(u,32),bn(c,24)),y=s+96|0,0|r},ga:function(e,t,n,r,i,o){e|=0,t|=0,o|=0;var s,a=0;return y=s=y-32|0,a=-1,!(r|=0)&(n|=0)>>>0>=48|r&&(yt(s,t,i|=0),a=gt(e,t+32|0,n-32|0,r-(n>>>0<32)|0,s,t,o)),y=s+32|0,0|a},ha:function(){return 48},ia:_n,ja:In,ka:Sn,la:_n,ma:In,na:Sn,oa:function(){return 384},pa:function(e,t,n,r,i,o,s){return 0|zt(e|=0,t|=0,n|=0,r|=0,i|=0,o|=0,s|=0)},qa:Tt,ra:function(e,t,n,r){return 0|ln(e|=0,t|=0,n|=0,r|=0)},sa:Lt,ta:vn,ua:In,va:function(e,t,n,r){return 0|It(e|=0,t|=0,n|=0,r|=0)},wa:_n,xa:In,ya:kn,za:Sn,Aa:function(e,t,n,r,i,c){e|=0,t|=0,n|=0,r|=0,c|=0;var u,d=0,p=0,f=0,g=0;return y=u=y-32|0,f=l[0|(i|=0)]|l[i+1|0]<<8|l[i+2|0]<<16|l[i+3|0]<<24,i=l[i+4|0]|l[i+5|0]<<8|l[i+6|0]<<16|l[i+7|0]<<24,a[u+24>>2]=0,a[u+28>>2]=0,a[u+16>>2]=f,a[u+20>>2]=i,ot(u,n,r),a[u+8>>2]=0,a[u+12>>2]=0,t-65>>>0<=4294967246?(a[8952]=28,e=-1):(n=u+16|0,t-65>>>0<4294967232?e=-1:(y=g=(r=y)-384&-64,!c|!e|((i=255&t)-65&255)>>>0<=191?(Ut(),h()):(y=p=y-192|0,!c|(i-65&255)>>>0<=191?(Ut(),h()):(s[p+130>>1]=257,o[p+129|0]=32,o[p+128|0]=i,Rt(4|(t=p+128|0)),ot(8|t,0,0),a[p+152>>2]=0,a[p+156>>2]=0,a[p+144>>2]=0,a[p+148>>2]=0,u?(f=l[u+4|0]|l[u+5|0]<<8|l[u+6|0]<<16|l[u+7|0]<<24,d=p+128|0,t=l[0|u]|l[u+1|0]<<8|l[u+2|0]<<16|l[u+3|0]<<24,o[d+32|0]=t,o[d+33|0]=t>>>8,o[d+34|0]=t>>>16,o[d+35|0]=t>>>24,o[d+36|0]=f,o[d+37|0]=f>>>8,o[d+38|0]=f>>>16,o[d+39|0]=f>>>24,f=l[u+12|0]|l[u+13|0]<<8|l[u+14|0]<<16|l[u+15|0]<<24,t=l[u+8|0]|l[u+9|0]<<8|l[u+10|0]<<16|l[u+11|0]<<24,o[d+40|0]=t,o[d+41|0]=t>>>8,o[d+42|0]=t>>>16,o[d+43|0]=t>>>24,o[d+44|0]=f,o[d+45|0]=f>>>8,o[d+46|0]=f>>>16,o[d+47|0]=f>>>24):(a[p+168>>2]=0,a[p+172>>2]=0,a[p+160>>2]=0,a[p+164>>2]=0),n?(f=l[n+4|0]|l[n+5|0]<<8|l[n+6|0]<<16|l[n+7|0]<<24,d=p+128|0,t=l[0|n]|l[n+1|0]<<8|l[n+2|0]<<16|l[n+3|0]<<24,o[d+48|0]=t,o[d+49|0]=t>>>8,o[d+50|0]=t>>>16,o[d+51|0]=t>>>24,o[d+52|0]=f,o[d+53|0]=f>>>8,o[d+54|0]=f>>>16,o[d+55|0]=f>>>24,f=l[n+12|0]|l[n+13|0]<<8|l[n+14|0]<<16|l[n+15|0]<<24,t=l[n+8|0]|l[n+9|0]<<8|l[n+10|0]<<16|l[n+11|0]<<24,o[d+56|0]=t,o[d+57|0]=t>>>8,o[d+58|0]=t>>>16,o[d+59|0]=t>>>24,o[d+60|0]=f,o[d+61|0]=f>>>8,o[d+62|0]=f>>>16,o[d+63|0]=f>>>24):(a[p+184>>2]=0,a[p+188>>2]=0,a[p+176>>2]=0,a[p+180>>2]=0),ve(g,p+128|0),vt(p+32|0,0,96),ne(g,t=pt(p,c,32),128,0),bn(t,128),y=t+192|0),ne(g,0,0,0),M(g,e,i),y=r),e=0)),y=u+32|0,0|e},Ba:vn,Ca:function(e,t,n){return e|=0,zt(t|=0,32,n|=0,32,0,0,0),0|Xt(e,t)},Da:function(e,t){return e|=0,st(t|=0,32),0|Xt(e,t)},Ea:function(e,t,n,r,i){t|=0,n|=0,r|=0,i|=0;var s,a,c=0,u=0;if(a=c=y,y=c=c-512&-64,s=(e|=0)||t){if(u=-1,!Qt(c+96|0,r,i)){for(r=t||e,e=0,Tt(t=c+128|0,0,0,64),ln(t,u=c+96|0,32,0),bn(u,32),ln(t,n,32,0),ln(t,i,32,0),Lt(t,c+32|0,64),bn(t,384);t=(c+32|0)+e|0,o[e+s|0]=l[0|t],o[e+r|0]=l[t+32|0],32!=(0|(e=e+1|0)););bn(c+32|0,64),u=0}return y=a,0|u}Ut(),h()},Fa:function(e,t,n,r,i){t|=0,n|=0,r|=0,i|=0;var s,a,c=0,u=0;if(a=c=y,y=c=c-512&-64,s=(e|=0)||t){if(u=-1,!Qt(c+96|0,r,i)){for(r=t||e,e=0,Tt(t=c+128|0,0,0,64),ln(t,u=c+96|0,32,0),bn(u,32),ln(t,i,32,0),ln(t,n,32,0),Lt(t,c+32|0,64),bn(t,384);t=(c+32|0)+e|0,o[e+r|0]=l[0|t],o[e+s|0]=l[t+32|0],32!=(0|(e=e+1|0)););bn(c+32|0,64),u=0}return y=a,0|u}Ut(),h()},Ga:Sn,Ha:Sn,Ia:Sn,Ja:Sn,Ka:xn,La:Pn,Ma:Pn,Na:_n,Oa:Nn,Pa:On,Qa:Nn,Ra:_n,Sa:function(){return 128},Ta:function(){return 1403},Ua:xn,Va:Nn,Wa:function(){return 8192},Xa:function(){return-2147483648},Ya:Pn,Za:function(){return 67108864},_a:Bn,$a:function(){return 268435456},ab:function(){return 4},bb:function(){return 1073741824},cb:function(e,t,n,r,i,o,s,l,c,u,d){var h;e|=0,t|=0,n|=0,r|=0,o|=0,s|=0,c|=0,u|=0,t|=0,h=0|(i|=0),i=0|(l|=0);e:{switch((d|=0)-1|0){case 0:e=vt(e,0,t);t:{if(1==(0|n)|n>>>0>1)a[8952]=22;else if(!n&t>>>0<=15)a[8952]=28;else if(!(o|c)&u>>>0<2147483649)if((!c&i>>>0>=3|0!=(0|c))&u>>>0>8191){if((0|e)!=(0|r)){e=I(i,u>>>10|0,1,r,h,s,16,e,t,0,0,1)?-1:0;break t}a[8952]=28}else a[8952]=28;else a[8952]=22;e=-1}break e;case 1:e=vt(e,0,t);t:{if(1==(0|n)|n>>>0>1)a[8952]=22;else if(!n&t>>>0<=15)a[8952]=28;else if(!(o|c)&u>>>0<2147483649)if(!!(i|c)&u>>>0>8191){if((0|e)!=(0|r)){e=I(i,u>>>10|0,1,r,h,s,16,e,t,0,0,2)?-1:0;break t}a[8952]=28}else a[8952]=28;else a[8952]=22;e=-1}break e}a[8952]=28,e=-1}return 0|e},db:function(e,t,n,r,i,o,s){return 0|Fe(e|=0,t|=0,(e=0)|(n|=0),r|=0,e|(i|=0),o|=0,s|=0)},eb:function(e,t,n,r,i,o,s,l){e|=0,t|=0,r|=0,o|=0,s|=0;var c=0;c=n|=0,c|=n=0,n|=i|=0;e:{switch((l|=0)-1|0){case 1:e=Fe(e,t,c,r,n,o,s);break e;default:Ut(),h();case 0:}y=i=y-16|0,e=vt(e,0,128),!(r|o)&s>>>0<2147483649?(!o&n>>>0>=3|0!=(0|o))&s>>>0>8191?(st(i,16),e=I(n,s>>>10|0,1,t,c,i,16,0,32,e,128,1)?-1:0):(a[8952]=28,e=-1):(a[8952]=22,e=-1),y=i+16|0}return 0|e},fb:function(e,t,n,r){t|=0,n|=0,r|=0;e:if(Ve(e|=0,1403,10))if(Ve(e,1393,9))a[8952]=28,e=-1;else{if(1==(0|r)|r>>>0>1)a[8952]=22;else{if(!(e=he(e,t,n,1)))break e;-35==(0|e)&&(a[8952]=28)}e=-1}else{if(1==(0|r)|r>>>0>1)a[8952]=22;else{if(!(e=he(e,t,n,2)))break e;-35==(0|e)&&(a[8952]=28)}e=-1}return 0|e},gb:function(e,t,n,r){return t|=0,n|=0,r|=0,Ve(e|=0,1403,10)?Ve(e,1393,9)?(a[8952]=28,e=-1):e=pe(e,t,n,r,1):e=pe(e,t,n,r,2),0|e},hb:Xt,ib:Qt,jb:Sn,kb:Sn,lb:Sn,mb:Cn,nb:_n,ob:En,pb:vn,qb:Zt,rb:function(e,t,n,r,i,o){return e|=0,t|=0,i|=0,o|=0,!(r|=0)&(n|=0)>>>0>=4294967280|r&&(Ut(),h()),se(e+16|0,e,t,n,r,i,o),0},sb:Wt,tb:function(e,t,n,r,i,o){return t|=0,0|(!(r|=0)&(n|=0)>>>0>=16|r?ae(e|=0,t+16|0,t,n-16|0,r-(n>>>0<16)|0,i|=0,o|=0):-1)},ub:vn,vb:function(e,t,n){return e|=0,n|=0,st(t|=0,24),U(e,t,n),Mt(e),n=l[t+16|0]|l[t+17|0]<<8|l[t+18|0]<<16|l[t+19|0]<<24,t=l[t+20|0]|l[t+21|0]<<8|l[t+22|0]<<16|l[t+23|0]<<24,o[e+44|0]=0,o[e+45|0]=0,o[e+46|0]=0,o[e+47|0]=0,o[e+48|0]=0,o[e+49|0]=0,o[e+50|0]=0,o[e+51|0]=0,o[e+36|0]=n,o[e+37|0]=n>>>8,o[e+38|0]=n>>>16,o[e+39|0]=n>>>24,o[e+40|0]=t,o[e+41|0]=t>>>8,o[e+42|0]=t>>>16,o[e+43|0]=t>>>24,0},wb:function(e,t,n){return U(e|=0,t|=0,n|=0),Mt(e),n=l[t+16|0]|l[t+17|0]<<8|l[t+18|0]<<16|l[t+19|0]<<24,t=l[t+20|0]|l[t+21|0]<<8|l[t+22|0]<<16|l[t+23|0]<<24,o[e+44|0]=0,o[e+45|0]=0,o[e+46|0]=0,o[e+47|0]=0,o[e+48|0]=0,o[e+49|0]=0,o[e+50|0]=0,o[e+51|0]=0,o[e+36|0]=n,o[e+37|0]=n>>>8,o[e+38|0]=n>>>16,o[e+39|0]=n>>>24,o[e+40|0]=t,o[e+41|0]=t>>>8,o[e+42|0]=t>>>16,o[e+43|0]=t>>>24,0},xb:H,yb:function(e,t,n,r,i,s,c,u,d,p){e|=0,t|=0,r|=0,c|=0,u|=0,d|=0,p|=0;var f=0,g=0,m=0,v=0;return g=i|=0,i=s|=0,s=0|g,u|=f,y=g=y-336|0,(n|=0)&&(a[n>>2]=0,a[n+4>>2]=0),!i&s>>>0<4294967279?(gn(m=g+16|0,64,v=e+32|0,e),hn(f=g+80|0,m),bn(m,64),nn(f,c,u,d),nn(f,34048,0-u&15,0),vt(m,0,64),o[g+16|0]=p,qe(m,m,64,0,v,1,e),nn(f,m,64,0),o[0|t]=l[g+16|0],qe(c=t+1|0,r,s,i,v,2,e),nn(f,c,s,i),nn(f,34048,15&s,0),ot(t=g+8|0,u,d),nn(f,t,8,0),ot(t,s- -64|0,i-((s>>>0<4294967232)-1|0)|0),nn(f,t,8,0),pn(f,t=s+c|0),bn(f,256),mt(e+36|0,t),lt(v),(2&p||rt(v,4))&&H(e),n&&(i=(e=s+17|0)>>>0<17?i+1|0:i,a[n>>2]=e,a[n+4>>2]=i),y=g+336|0):(Ut(),h()),0},zb:function(e,t,n,r,i,s,c,u,d,p){e|=0,t|=0,r|=0,i|=0,s|=0,c|=0,u|=0,p|=0;var f,g=0,m=0,v=0,A=0,b=0,w=0;s|=0,f=(d|=0)|g,y=g=y-352|0,(n|=0)&&(a[n>>2]=0,a[n+4>>2]=0),r&&(o[0|r]=255),w=-1;e:{t:{if(!(!c&s>>>0<17)){if(!(d=c-(s>>>0<17)|0)&(A=s-17|0)>>>0>=4294967279|d)break t;gn(m=g+32|0,64,b=e+32|0,e),hn(v=g+96|0,m),bn(m,64),nn(v,u,f,p),nn(v,34048,0-f&15,0),vt(m,0,64),o[g+32|0]=l[0|i],qe(m,m,64,0,b,1,e),u=l[g+32|0],o[g+32|0]=l[0|i],nn(v,m,64,0),nn(v,m=i+1|0,A,d),nn(v,34048,s-1&15,0),ot(i=g+24|0,f,p),nn(v,i,8,0),ot(i,s=s+47|0,c=s>>>0<47?c+1|0:c),nn(v,i,8,0),pn(v,g),bn(v,256),Ze(g,m+A|0,16)?bn(g,16):(qe(t,m,A,d,b,2,e),mt(e+36|0,g),lt(b),(2&u||rt(b,4))&&H(e),n&&(a[n>>2]=A,a[n+4>>2]=d),w=0,r&&(o[0|r]=u))}y=g+352|0;break e}Ut(),h()}return 0|w},Ab:function(){return 52},Bb:function(){return 17},Cb:Cn,Db:Sn,Eb:function(){return-18},Fb:On,Gb:xn,Hb:Pn,Ib:Bn,Jb:kn,Kb:_n,Lb:function(e,t,n,r,i){e|=0,t|=0,n|=0,r|=0;var o=0,s=0,a=0,c=0,u=0,d=0,h=0,p=0,f=0,g=0,m=0,y=0,v=0,A=0,w=0,S=0;if(s=i|=0,i=l[i+4|0]|l[i+5|0]<<8|l[i+6|0]<<16|l[i+7|0]<<24,d=1886610805^(o=l[0|s]|l[s+1|0]<<8|l[s+2|0]<<16|l[s+3|0]<<24),u=1936682341^i,o^=1852142177,h=1819895653^i,i=1852075885^(a=l[s+8|0]|l[s+9|0]<<8|l[s+10|0]<<16|l[s+11|0]<<24),c=1685025377^(s=l[s+12|0]|l[s+13|0]<<8|l[s+14|0]<<16|l[s+15|0]<<24),p=2037671283^a,f=1952801890^s,s=n,(0|(a=(t+n|0)-(g=7&n)|0))!=(0|t)){for(;m=l[0|t]|l[t+1|0]<<8|l[t+2|0]<<16|l[t+3|0]<<24,S=l[t+4|0]|l[t+5|0]<<8|l[t+6|0]<<16|l[t+7|0]<<24,v=Se(i,c,13),r=b,n=c+u|0,c=n=(d=i+d|0)>>>0<i>>>0?n+1|0:n,d=Se(u=d,n,32),A=b,p=Se(i=p^m,n=f^S,16),n=n+h|0,n=(i=i+o|0)>>>0<o>>>0?n+1|0:n,o=i,p=Se(i^=p,h=n^(f=b),21),f=b,v=Se(u^=v,r=c^=r,17),w=b,n=n+r|0,o=Se(c=o+u|0,n=c>>>0<o>>>0?n+1|0:n,32),r=b,v=Se(u=c^v,n^=w,13),w=b,c=n,y=u,n=h+A|0,h=u=i+d|0,i=n=u>>>0<i>>>0?n+1|0:n,n=n+c|0,d=u=y+u|0,c=n=u>>>0<h>>>0?n+1|0:n,n=Se(u,n,32),A=b,u=i^=f,i=Se(h^=p,i,16),p=b,f=n,y=i,n=r+u|0,o=n=(i=o+h|0)>>>0<o>>>0?n+1|0:n,n=(p^=n)+A|0,r=u=f+(h=y^i)|0,p=Se(h,p,21)^r,f=(u=r>>>0<h>>>0?n+1|0:n)^b,n=c^w,d=Se(c=d^v,n,17),n=n+o|0,n=(c=i+c|0)>>>0<i>>>0?n+1|0:n,i=(o=c)^d,c=n^(h=b),d=r^m,u^=S,o=Se(o,n,32),h=b,(0|a)!=(0|(t=t+8|0)););t=a}switch(n=s<<24,s=0,r=n,g-1|0){case 6:r|=l[t+6|0]<<16;case 5:r|=l[t+5|0]<<8;case 4:r|=l[t+4|0];case 3:s|=(a=l[t+3|0])<<24,r|=n=a>>>8|0;case 2:s|=(a=l[t+2|0])<<16,r|=n=a>>>16|0;case 1:s|=(a=l[t+1|0])<<8,r|=n=a>>>24|0;case 0:s=l[0|t]|s}return g=Se(i,c,13),m=b,n=c+u|0,a=t=i+d|0,i=n=t>>>0<i>>>0?n+1|0:n,c=Se(t,n,32),u=b,f=t=Se(d=s^p,n=t=r^f,16),n=n+h|0,n=(t=o+d|0)>>>0<o>>>0?n+1|0:n,o=t,h=Se(t^=f,d=n^(p=b),21),p=b,g=Se(a^=g,i^=m,17),m=b,n=n+i|0,n=(i=o+a|0)>>>0<o>>>0?n+1|0:n,o=i,i=Se(i,n,32),f=b,g=Se(a=o^g,n^=m,13),m=b,o=n,y=a,n=u+d|0,c=a=t+c|0,t=n=a>>>0<t>>>0?n+1|0:n,n=n+o|0,o=n=(a=y+a|0)>>>0<c>>>0?n+1|0:n,u=Se(a,n,32),d=b,p=t=Se(c^=h,n=t^=p,16),n=n+f|0,n=(t=i+c|0)>>>0<i>>>0?n+1|0:n,i=t,h=Se(t^=p,c=n^(h=b),21),p=b,g=Se(a^=g,o^=m,17),m=b,n=n+o|0,n=(o=i+a|0)>>>0<i>>>0?n+1|0:n,a=Se(i=o,n,32),f=b,g=Se(o=i^g,n^=m,13),m=b,i=n,y=o,n=c+d|0,n=(o=t+u|0)>>>0<t>>>0?n+1|0:n,t=s,s=o,c=t^o,t=n,n=(n^r)+i|0,r=n=(o=y+c|0)>>>0<c>>>0?n+1|0:n,c=Se(o,n,32),u=b,n=t^p,i=Se(t=s^h,n,16),s=b,d=i,n=n+f|0,n=(i=t+(255^a)|0)>>>0<t>>>0?n+1|0:n,a=Se(t=d^i,s^=n,21),d=b,p=Se(o^=g,r^=m,17),f=b,n=n+r|0,n=(r=i+o|0)>>>0<i>>>0?n+1|0:n,r=Se(i=r,n,32),h=b,p=Se(o=i^p,n^=f,13),f=b,i=n,y=o,n=s+u|0,s=o=t+c|0,t=n=o>>>0<t>>>0?n+1|0:n,n=n+i|0,i=n=(o=y+o|0)>>>0<s>>>0?n+1|0:n,c=Se(o,n,32),u=b,d=t=Se(s^=a,n=t^=d,16),n=n+h|0,n=(t=r+s|0)>>>0<r>>>0?n+1|0:n,r=t,a=Se(t^=d,s=n^(a=b),21),d=b,p=Se(o^=p,i^=f,17),f=b,n=n+i|0,r=Se(i=r+o|0,n=i>>>0<r>>>0?n+1|0:n,32),h=b,p=Se(o=i^p,n^=f,13),f=b,i=n,y=o,n=s+u|0,c=o=t+c|0,s=o,t=n=o>>>0<t>>>0?n+1|0:n,n=n+i|0,n=(o=y+o|0)>>>0<s>>>0?n+1|0:n,s=o,i=n,u=Se(o,n,32),g=b,c=t=Se(o=a^c,n=t^=d,16),n=n+h|0,n=(t=r+o|0)>>>0<r>>>0?n+1|0:n,r=t,t^=c,c=o=n^(a=b),a=Se(t,o,21),o=b,h=Se(s^=p,i^=f,17),p=b,n=n+i|0,r=Se(i=r+s|0,n=i>>>0<r>>>0?n+1|0:n,32),d=b,p=n^=p,h=Se(i^=h,n,13),s=b,f=a,n=c+g|0,c=a=t+u|0,t=n=a>>>0<t>>>0?n+1|0:n,f=o=Se(a^=f,n^=o,16),n=n+d|0,n=(o=r+a|0)>>>0<r>>>0?n+1|0:n,r=o,o=n,n=Se(f^r,n^(u=b),21),u=b,d=n,n=t+p|0,n=o+(s^=n=(a=i+c|0)>>>0<i>>>0?n+1|0:n)|0,n=(t=r+(i=a^h)|0)>>>0<r>>>0?n+1|0:n,r=d^t^Se(i,s,17),i=b^n^u,ot(e,Se(t,n,32)^r,b^i),0},Mb:function(e){st(e|=0,16)},Nb:function(){return 208},Ob:In,Pb:Sn,Qb:Sn,Rb:In,Sb:function(){return-65},Tb:function(e,t,n){return 0|T(e|=0,t|=0,n|=0)},Ub:function(e,t){var n;return e|=0,t|=0,y=n=y-32|0,st(n,32),T(e,t,n),bn(n,32),y=n+32|0,0},Vb:function(e,t,n,r,i,o){var s;return t|=0,i|=0,o|=0,y=s=y-16|0,Yt(e|=0,s+8|0,nt(e- -64|0,n|=0,n=r|=0),n,i,o),64!=a[s+8>>2]|a[s+12>>2]?(t&&(a[t>>2]=0,a[t+4>>2]=0),vt(e,0,n- -64|0),e=-1):(e=0,t&&(a[t>>2]=n- -64,a[t+4>>2]=i-((n>>>0<4294967232)-1|0))),y=s+16|0,0|e},Wb:function(e,t,n,r,i,o){e|=0,t|=0,n|=0;var s=0;e:{t:{if(s=r|=0,!(!(i|=0)&r>>>0<64||(r=i-1|0,s=i=s+-64|0,!(r=i>>>0<4294967232?r+1|0:r)&i>>>0>4294967231|r))){if(!Jt(n,i=n- -64|0,s,r,o|=0))break t;e&&vt(e,0,s)}if(n=-1,!t)break e;a[t>>2]=0,a[t+4>>2]=0;break e}t&&(a[t>>2]=s,a[t+4>>2]=r),n=0,e&&nt(e,i,s)}return 0|n},Xb:function(e,t,n,r,i,o){return 0|Yt(e|=0,t|=0,n|=0,r|=0,i|=0,o|=0)},Yb:function(e,t,n,r,i){return 0|Jt(e|=0,t|=0,n|=0,r|=0,i|=0)},Zb:function(e){return Pt(e|=0),0},_b:function(e,t,n,r){return 0|Z(e|=0,t|=0,n|=0,r|=0)},$b:function(e,t,n,r){var i;return t|=0,n|=0,r|=0,y=i=y+-64|0,je(e|=0,i),e=S(t,n,i,64,0,r,1),y=i- -64|0,0|e},ac:function(e,t,n){var r;return t|=0,n|=0,y=r=y+-64|0,je(e|=0,r),e=Q(t,r,64,0,n,1),y=r- -64|0,0|e},bc:function(e,t){e|=0;var n,r=0,i=0,s=0,a=0,l=0,c=0;if(y=n=y-256|0,c=-1,!ye(t|=0)&&!Y(n+96|0,t)){for(y=r=(y=a=y-160|0)-1760|0,At(s=r+480|0,i=n+96|0),ft(t=r+320|0,i),ht(r,t),Ue(t,r,s),ht(s=r+160|0,t),At(i=r+640|0,s),Ue(t,r,i),ht(s,t),At(i=r+800|0,s),Ue(t,r,i),ht(s,t),At(i=r+960|0,s),Ue(t,r,i),ht(s,t),At(i=r+1120|0,s),Ue(t,r,i),ht(s,t),At(i=r+1280|0,s),Ue(t,r,i),ht(s,t),At(i=r+1440|0,s),Ue(t,r,i),ht(s,t),At(r+1600|0,s),Vt(a),t=252;ft(r+320|0,a),s=t,(0|(t=o[t+33504|0]))>0?(ht(i=r+160|0,l=r+320|0),Ue(l,i,(r+480|0)+u((254&t)>>>1|0,160)|0)):(0|t)>=0||(ht(i=r+160|0,l=r+320|0),Qe(l,i,(r+480|0)+u((0-t&254)>>>1|0,160)|0)),ht(a,r+320|0),t=s-1|0,s;);y=r+1760|0,t=Nt(a),y=a+160|0,t&&(cn(n),ge(n,n,s=n+136|0),cn(t=n+48|0),me(t,t,s),J(n,n),x(t,t,n),G(e,t),c=0)}return y=n+256|0,0|c},cc:function(e,t){e|=0;var n,r=0;return y=n=y+-64|0,It(n,t|=0,32,0),o[0|n]=248&l[0|n],o[n+31|0]=63&l[n+31|0]|64,t=a[n+20>>2],r=a[n+16>>2],o[e+16|0]=r,o[e+17|0]=r>>>8,o[e+18|0]=r>>>16,o[e+19|0]=r>>>24,o[e+20|0]=t,o[e+21|0]=t>>>8,o[e+22|0]=t>>>16,o[e+23|0]=t>>>24,t=a[n+12>>2],r=a[n+8>>2],o[e+8|0]=r,o[e+9|0]=r>>>8,o[e+10|0]=r>>>16,o[e+11|0]=r>>>24,o[e+12|0]=t,o[e+13|0]=t>>>8,o[e+14|0]=t>>>16,o[e+15|0]=t>>>24,t=a[n+4>>2],r=a[n>>2],o[0|e]=r,o[e+1|0]=r>>>8,o[e+2|0]=r>>>16,o[e+3|0]=r>>>24,o[e+4|0]=t,o[e+5|0]=t>>>8,o[e+6|0]=t>>>16,o[e+7|0]=t>>>24,t=a[n+28>>2],r=a[n+24>>2],o[e+24|0]=r,o[e+25|0]=r>>>8,o[e+26|0]=r>>>16,o[e+27|0]=r>>>24,o[e+28|0]=t,o[e+29|0]=t>>>8,o[e+30|0]=t>>>16,o[e+31|0]=t>>>24,bn(n,64),y=n- -64|0,0},dc:Ct,ec:Bt,fc:function(e){var t=0,n=0;if((e|=0)>>>0>=2){for(n=(0-e>>>0)%(e>>>0)|0;(t=Ct())>>>0<n>>>0;);e=(t>>>0)%(e>>>0)|0}else e=0;return 0|e},gc:st,hc:function(e,t,n){gn(e|=0,t|=0,1024,n|=0)},ic:Sn,jc:function(){var e=0,t=0;return(e=a[9096])&&(e=a[e+20>>2])&&(t=0|jn[0|e]()),0|t},kc:function(e,t,n){e|=0,t|=0,1==(0|(n|=0))|n>>>0>1&&(p(1259,1119,197,1036),h()),st(e,t)},lc:function(e,t,n,r){e|=0,n|=0;var i=0,s=0,a=0;if(!((r|=0)>>>0>2147483646|r<<1>>>0>=(t|=0)>>>0)){if(t=0,r){for(;i=(t<<1)+e|0,s=15&(a=l[t+n|0]),o[i+1|0]=22272+((s<<8)+(s+65526&55552)|0)>>>8,s=i,i=a>>>4|0,o[0|s]=87+((i+65526>>>8&217)+i|0),(0|r)!=(0|(t=t+1|0)););t=r<<1}else t=0;return o[t+e|0]=0,0|e}Ut(),h()},mc:function(e,t,n,r,i,s,c){e|=0,t|=0,n|=0,i|=0,s|=0,c|=0;var u=0,d=0,h=0,p=0,f=0,g=0,m=0,y=0,v=0,A=0,b=0;e:if(r|=0){t:{n:{r:for(;;){for(d=u;;){i:{if(!(255&((v=(65526+(m=(223&(g=l[n+d|0]))-55&255)^m+65520)>>>8|0)|(h=65526+(A=48^g)>>>8|0)))){if(h=1,!i|255&f)break n;if(Ae(i,g))break i;u=d;break e}if(t>>>0<=p>>>0){a[8952]=68,h=0;break n}if(u=m&v|h&A,255&f?(o[e+p|0]=u|b,p=p+1|0):b=u<<4,f^=-1,h=1,(u=d+1|0)>>>0<r>>>0)continue r;break t}if(f=0,!((d=d+1|0)>>>0<r>>>0))break}break}u=(e=u+1|0)>>>0<r>>>0?r:e;break e}u=d}255&f?(a[8952]=28,y=-1,u=u-1|0,p=0):h||(p=0,y=-1)}return c?a[c>>2]=n+u:(0|r)!=(0|u)&&(a[8952]=28,y=-1),s&&(a[s>>2]=p),0|y},nc:function(e,t){var n;return e|=0,un(t|=0),e=u(n=(e>>>0)/3|0,-3)+e|0,1+(u(1&(e>>>1|e),2&t?e+1|0:4)+(n<<2)|0)|0},oc:X,pc:V,qc:function(){var e=0;return a[9097]?e=1:(a[8954]=0,y=e=y-16|0,Ft(e),a[e>>2]&&(Ft(e),vt(35820,0,40)),y=e+16|0,a[8953]=1,Bt(),st(36368,16),a[9097]=1,e=0),0|e},rc:function(e,t,n,r,i){e|=0,t|=0,n|=0,i|=0;var s,c=0,u=0,d=0;y=s=y-16|0;e:{if(r|=0){if(d=-1,(c=(c=r-1|0)-(u=c&r?(n>>>0)%(r>>>0)|0:n&c)|0)>>>0>=(-1^n)>>>0)break e;if(!((n=n+c|0)>>>0>=i>>>0))for(e&&(a[e>>2]=n+1),e=t+n|0,d=0,o[s+15|0]=0,n=0;i=t=e-n|0,u=l[0|t]&l[s+15|0],t=(n^c)-1>>>24|0,o[0|i]=u|128&t,o[s+15|0]=t|l[s+15|0],(0|r)!=(0|(n=n+1|0)););}else d=-1;return y=s+16|0,0|d}Ut(),h()},sc:function(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var i,o=0,s=0,c=0,u=0,d=0;if(a[12+(i=y-16|0)>>2]=0,r-1>>>0<n>>>0){for(d=(o=n-1|0)+t|0,n=0,t=0;u=((128^(s=l[d-n|0]))-1&a[i+12>>2]-1&c-1)>>>8&1,a[i+12>>2]=a[i+12>>2]|0-u&n,t|=u,c|=s,(0|r)!=(0|(n=n+1|0)););a[e>>2]=o-a[i+12>>2],e=t-1|0}else e=-1;return 0|e},tc:function(){return 1368},uc:function(){return 10},vc:Bn,wc:xn,xc:_,yc:O,zc:jn}}(e)}(ie)},instantiate:function(e,t){return{then:function(t){var n=new w.Module(e);t({instance:new w.Instance(n)})}}},RuntimeError:Error};v=[],"object"!=typeof w&&U("no native wasm support detected");var S,C,E,I,_,x,P,k=!1,B="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function O(e,t){return e?function(e,t,n){for(var r=t+n,i=t;e[i]&&!(i>=r);)++i;if(i-t>16&&e.subarray&&B)return B.decode(e.subarray(t,i));for(var o="";t<i;){var s=e[t++];if(128&s){var a=63&e[t++];if(192!=(224&s)){var l=63&e[t++];if((s=224==(240&s)?(15&s)<<12|a<<6|l:(7&s)<<18|a<<12|l<<6|63&e[t++])<65536)o+=String.fromCharCode(s);else{var c=s-65536;o+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else o+=String.fromCharCode((31&s)<<6|a)}else o+=String.fromCharCode(s)}return o}(E,e,t):""}function N(e){S=e,d.HEAP8=C=new Int8Array(e),d.HEAP16=I=new Int16Array(e),d.HEAP32=_=new Int32Array(e),d.HEAPU8=E=new Uint8Array(e),d.HEAPU16=new Uint16Array(e),d.HEAPU32=new Uint32Array(e),d.HEAPF32=x=new Float32Array(e),d.HEAPF64=P=new Float64Array(e)}var D,j=d.INITIAL_MEMORY||16777216;(b=d.wasmMemory?d.wasmMemory:new w.Memory({initial:j/65536,maximum:32768}))&&(S=b.buffer),j=S.byteLength,N(S);var T=[],M=[],F=[],R=0,L=null,Q=null;function U(e){throw d.onAbort&&d.onAbort(e),A(e="Aborted("+e+")"),k=!0,e+=". Build with -s ASSERTIONS=1 for more info.",new w.RuntimeError(e)}d.preloadedImages={},d.preloadedAudios={};var V,K,H,G,Y="data:application/octet-stream;base64,";function z(e){return e.startsWith(Y)}function Z(e){return e.startsWith("file://")}function W(e){try{if(e==V&&v)return new Uint8Array(v);var t=ne(e);if(t)return t;if(a)return a(e);throw"both async and sync fetching of the wasm failed"}catch(e){U(e)}}z(V="<<< WASM_BINARY_FILE >>>")||(K=V,V=d.locateFile?d.locateFile(K,y):y+K);var q={35048:function(){return d.getRandomValue()},35084:function(){if(void 0===d.getRandomValue)try{var e="object"==typeof window?window:self,t=void 0!==e.crypto?e.crypto:e.msCrypto,r=function(){var e=new Uint32Array(1);return t.getRandomValues(e),e[0]>>>0};r(),d.getRandomValue=r}catch(e){try{var i=n(22901),o=function(){var e=i.randomBytes(4);return(e[0]<<24|e[1]<<16|e[2]<<8|e[3])>>>0};o(),d.getRandomValue=o}catch(e){throw"No secure random number generator found"}}}};function J(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?X(n)():X(n)(t.arg):n(void 0===t.arg?null:t.arg)}else t(d)}}function X(e){return D.get(e)}var $=[];function ee(e){try{return b.grow(e-S.byteLength+65535>>>16),N(b.buffer),1}catch(e){}}var te="function"==typeof atob?atob:function(e){var t,n,r,i,o,s,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l="",c=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{t=a.indexOf(e.charAt(c++))<<2|(i=a.indexOf(e.charAt(c++)))>>4,n=(15&i)<<4|(o=a.indexOf(e.charAt(c++)))>>2,r=(3&o)<<6|(s=a.indexOf(e.charAt(c++))),l+=String.fromCharCode(t),64!==o&&(l+=String.fromCharCode(n)),64!==s&&(l+=String.fromCharCode(r))}while(c<e.length);return l};function ne(e){if(z(e))return function(e){if("boolean"==typeof m&&m){var t=Buffer.from(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}try{for(var n=te(e),r=new Uint8Array(n.length),i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}catch(e){throw new Error("Converting base64 string to bytes failed.")}}(e.slice(Y.length))}var re,ie={b:function(e,t,n,r){U("Assertion failed: "+O(e)+", at: "+[t?O(t):"unknown filename",n,r?O(r):"unknown function"])},e:function(){U("")},c:function(e,t,n){var r=function(e,t){var n;for($.length=0,t>>=2;n=E[e++];){var r=n<105;r&&1&t&&t++,$.push(r?P[t++>>1]:_[t]),++t}return $}(t,n);return q[e].apply(null,r)},d:function(e){var t,n=E.length,r=2147483648;if((e>>>=0)>r)return!1;for(var i=1;i<=4;i*=2){var o=n*(1+.2/i);if(o=Math.min(o,e+100663296),ee(Math.min(r,(t=Math.max(e,o))+(65536-t%65536)%65536)))return!0}return!1},a:b};function oe(e){function t(){re||(re=!0,d.calledRun=!0,k||(J(M),d.onRuntimeInitialized&&d.onRuntimeInitialized(),function(){if(d.postRun)for("function"==typeof d.postRun&&(d.postRun=[d.postRun]);d.postRun.length;)e=d.postRun.shift(),F.unshift(e);var e;J(F)}()))}e=e||p,R>0||(function(){if(d.preRun)for("function"==typeof d.preRun&&(d.preRun=[d.preRun]);d.preRun.length;)e=d.preRun.shift(),T.unshift(e);var e;J(T)}(),R>0||(d.setStatus?(d.setStatus("Running..."),setTimeout((function(){setTimeout((function(){d.setStatus("")}),1),t()}),1)):t()))}if(function(){var e={a:ie};function t(e,t){var n,r=e.exports;d.asm=r,D=d.asm.zc,n=d.asm.f,M.unshift(n),function(e){if(R--,d.monitorRunDependencies&&d.monitorRunDependencies(R),0==R&&(null!==L&&(clearInterval(L),L=null),Q)){var t=Q;Q=null,t()}}()}function n(e){t(e.instance)}function r(t){return function(){if(!v&&(f||g)){if("function"==typeof fetch&&!Z(V))return fetch(V,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+V+"'";return e.arrayBuffer()})).catch((function(){return W(V)}));if(s)return new Promise((function(e,t){s(V,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return W(V)}))}().then((function(t){return w.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){A("failed to asynchronously prepare wasm: "+e),U(e)}))}if(R++,d.monitorRunDependencies&&d.monitorRunDependencies(R),d.instantiateWasm)try{return d.instantiateWasm(e,t)}catch(e){return A("Module.instantiateWasm callback failed with error: "+e),!1}v||"function"!=typeof w.instantiateStreaming||z(V)||Z(V)||"function"!=typeof fetch?r(n):fetch(V,{credentials:"same-origin"}).then((function(t){return w.instantiateStreaming(t,e).then(n,(function(e){return A("wasm streaming compile failed: "+e),A("falling back to ArrayBuffer instantiation"),r(n)}))}))}(),d.___wasm_call_ctors=function(){return(d.___wasm_call_ctors=d.asm.f).apply(null,arguments)},d._crypto_aead_chacha20poly1305_encrypt_detached=function(){return(d._crypto_aead_chacha20poly1305_encrypt_detached=d.asm.g).apply(null,arguments)},d._crypto_aead_chacha20poly1305_encrypt=function(){return(d._crypto_aead_chacha20poly1305_encrypt=d.asm.h).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_encrypt_detached=function(){return(d._crypto_aead_chacha20poly1305_ietf_encrypt_detached=d.asm.i).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_encrypt=function(){return(d._crypto_aead_chacha20poly1305_ietf_encrypt=d.asm.j).apply(null,arguments)},d._crypto_aead_chacha20poly1305_decrypt_detached=function(){return(d._crypto_aead_chacha20poly1305_decrypt_detached=d.asm.k).apply(null,arguments)},d._crypto_aead_chacha20poly1305_decrypt=function(){return(d._crypto_aead_chacha20poly1305_decrypt=d.asm.l).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_decrypt_detached=function(){return(d._crypto_aead_chacha20poly1305_ietf_decrypt_detached=d.asm.m).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_decrypt=function(){return(d._crypto_aead_chacha20poly1305_ietf_decrypt=d.asm.n).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_keybytes=function(){return(d._crypto_aead_chacha20poly1305_ietf_keybytes=d.asm.o).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_npubbytes=function(){return(d._crypto_aead_chacha20poly1305_ietf_npubbytes=d.asm.p).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_nsecbytes=function(){return(d._crypto_aead_chacha20poly1305_ietf_nsecbytes=d.asm.q).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_abytes=function(){return(d._crypto_aead_chacha20poly1305_ietf_abytes=d.asm.r).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_messagebytes_max=function(){return(d._crypto_aead_chacha20poly1305_ietf_messagebytes_max=d.asm.s).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_keygen=function(){return(d._crypto_aead_chacha20poly1305_ietf_keygen=d.asm.t).apply(null,arguments)},d._crypto_aead_chacha20poly1305_keybytes=function(){return(d._crypto_aead_chacha20poly1305_keybytes=d.asm.u).apply(null,arguments)},d._crypto_aead_chacha20poly1305_npubbytes=function(){return(d._crypto_aead_chacha20poly1305_npubbytes=d.asm.v).apply(null,arguments)},d._crypto_aead_chacha20poly1305_nsecbytes=function(){return(d._crypto_aead_chacha20poly1305_nsecbytes=d.asm.w).apply(null,arguments)},d._crypto_aead_chacha20poly1305_abytes=function(){return(d._crypto_aead_chacha20poly1305_abytes=d.asm.x).apply(null,arguments)},d._crypto_aead_chacha20poly1305_messagebytes_max=function(){return(d._crypto_aead_chacha20poly1305_messagebytes_max=d.asm.y).apply(null,arguments)},d._crypto_aead_chacha20poly1305_keygen=function(){return(d._crypto_aead_chacha20poly1305_keygen=d.asm.z).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_encrypt_detached=function(){return(d._crypto_aead_xchacha20poly1305_ietf_encrypt_detached=d.asm.A).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_encrypt=function(){return(d._crypto_aead_xchacha20poly1305_ietf_encrypt=d.asm.B).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_decrypt_detached=function(){return(d._crypto_aead_xchacha20poly1305_ietf_decrypt_detached=d.asm.C).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_decrypt=function(){return(d._crypto_aead_xchacha20poly1305_ietf_decrypt=d.asm.D).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_keybytes=function(){return(d._crypto_aead_xchacha20poly1305_ietf_keybytes=d.asm.E).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_npubbytes=function(){return(d._crypto_aead_xchacha20poly1305_ietf_npubbytes=d.asm.F).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_nsecbytes=function(){return(d._crypto_aead_xchacha20poly1305_ietf_nsecbytes=d.asm.G).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_abytes=function(){return(d._crypto_aead_xchacha20poly1305_ietf_abytes=d.asm.H).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_messagebytes_max=function(){return(d._crypto_aead_xchacha20poly1305_ietf_messagebytes_max=d.asm.I).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_keygen=function(){return(d._crypto_aead_xchacha20poly1305_ietf_keygen=d.asm.J).apply(null,arguments)},d._crypto_auth_bytes=function(){return(d._crypto_auth_bytes=d.asm.K).apply(null,arguments)},d._crypto_auth_keybytes=function(){return(d._crypto_auth_keybytes=d.asm.L).apply(null,arguments)},d._crypto_auth=function(){return(d._crypto_auth=d.asm.M).apply(null,arguments)},d._crypto_auth_verify=function(){return(d._crypto_auth_verify=d.asm.N).apply(null,arguments)},d._crypto_auth_keygen=function(){return(d._crypto_auth_keygen=d.asm.O).apply(null,arguments)},d._crypto_box_seedbytes=function(){return(d._crypto_box_seedbytes=d.asm.P).apply(null,arguments)},d._crypto_box_publickeybytes=function(){return(d._crypto_box_publickeybytes=d.asm.Q).apply(null,arguments)},d._crypto_box_secretkeybytes=function(){return(d._crypto_box_secretkeybytes=d.asm.R).apply(null,arguments)},d._crypto_box_beforenmbytes=function(){return(d._crypto_box_beforenmbytes=d.asm.S).apply(null,arguments)},d._crypto_box_noncebytes=function(){return(d._crypto_box_noncebytes=d.asm.T).apply(null,arguments)},d._crypto_box_macbytes=function(){return(d._crypto_box_macbytes=d.asm.U).apply(null,arguments)},d._crypto_box_messagebytes_max=function(){return(d._crypto_box_messagebytes_max=d.asm.V).apply(null,arguments)},d._crypto_box_seed_keypair=function(){return(d._crypto_box_seed_keypair=d.asm.W).apply(null,arguments)},d._crypto_box_keypair=function(){return(d._crypto_box_keypair=d.asm.X).apply(null,arguments)},d._crypto_box_beforenm=function(){return(d._crypto_box_beforenm=d.asm.Y).apply(null,arguments)},d._crypto_box_detached_afternm=function(){return(d._crypto_box_detached_afternm=d.asm.Z).apply(null,arguments)},d._crypto_box_detached=function(){return(d._crypto_box_detached=d.asm._).apply(null,arguments)},d._crypto_box_easy_afternm=function(){return(d._crypto_box_easy_afternm=d.asm.$).apply(null,arguments)},d._crypto_box_easy=function(){return(d._crypto_box_easy=d.asm.aa).apply(null,arguments)},d._crypto_box_open_detached_afternm=function(){return(d._crypto_box_open_detached_afternm=d.asm.ba).apply(null,arguments)},d._crypto_box_open_detached=function(){return(d._crypto_box_open_detached=d.asm.ca).apply(null,arguments)},d._crypto_box_open_easy_afternm=function(){return(d._crypto_box_open_easy_afternm=d.asm.da).apply(null,arguments)},d._crypto_box_open_easy=function(){return(d._crypto_box_open_easy=d.asm.ea).apply(null,arguments)},d._crypto_box_seal=function(){return(d._crypto_box_seal=d.asm.fa).apply(null,arguments)},d._crypto_box_seal_open=function(){return(d._crypto_box_seal_open=d.asm.ga).apply(null,arguments)},d._crypto_box_sealbytes=function(){return(d._crypto_box_sealbytes=d.asm.ha).apply(null,arguments)},d._crypto_generichash_bytes_min=function(){return(d._crypto_generichash_bytes_min=d.asm.ia).apply(null,arguments)},d._crypto_generichash_bytes_max=function(){return(d._crypto_generichash_bytes_max=d.asm.ja).apply(null,arguments)},d._crypto_generichash_bytes=function(){return(d._crypto_generichash_bytes=d.asm.ka).apply(null,arguments)},d._crypto_generichash_keybytes_min=function(){return(d._crypto_generichash_keybytes_min=d.asm.la).apply(null,arguments)},d._crypto_generichash_keybytes_max=function(){return(d._crypto_generichash_keybytes_max=d.asm.ma).apply(null,arguments)},d._crypto_generichash_keybytes=function(){return(d._crypto_generichash_keybytes=d.asm.na).apply(null,arguments)},d._crypto_generichash_statebytes=function(){return(d._crypto_generichash_statebytes=d.asm.oa).apply(null,arguments)},d._crypto_generichash=function(){return(d._crypto_generichash=d.asm.pa).apply(null,arguments)},d._crypto_generichash_init=function(){return(d._crypto_generichash_init=d.asm.qa).apply(null,arguments)},d._crypto_generichash_update=function(){return(d._crypto_generichash_update=d.asm.ra).apply(null,arguments)},d._crypto_generichash_final=function(){return(d._crypto_generichash_final=d.asm.sa).apply(null,arguments)},d._crypto_generichash_keygen=function(){return(d._crypto_generichash_keygen=d.asm.ta).apply(null,arguments)},d._crypto_hash_bytes=function(){return(d._crypto_hash_bytes=d.asm.ua).apply(null,arguments)},d._crypto_hash=function(){return(d._crypto_hash=d.asm.va).apply(null,arguments)},d._crypto_kdf_bytes_min=function(){return(d._crypto_kdf_bytes_min=d.asm.wa).apply(null,arguments)},d._crypto_kdf_bytes_max=function(){return(d._crypto_kdf_bytes_max=d.asm.xa).apply(null,arguments)},d._crypto_kdf_contextbytes=function(){return(d._crypto_kdf_contextbytes=d.asm.ya).apply(null,arguments)},d._crypto_kdf_keybytes=function(){return(d._crypto_kdf_keybytes=d.asm.za).apply(null,arguments)},d._crypto_kdf_derive_from_key=function(){return(d._crypto_kdf_derive_from_key=d.asm.Aa).apply(null,arguments)},d._crypto_kdf_keygen=function(){return(d._crypto_kdf_keygen=d.asm.Ba).apply(null,arguments)},d._crypto_kx_seed_keypair=function(){return(d._crypto_kx_seed_keypair=d.asm.Ca).apply(null,arguments)},d._crypto_kx_keypair=function(){return(d._crypto_kx_keypair=d.asm.Da).apply(null,arguments)},d._crypto_kx_client_session_keys=function(){return(d._crypto_kx_client_session_keys=d.asm.Ea).apply(null,arguments)},d._crypto_kx_server_session_keys=function(){return(d._crypto_kx_server_session_keys=d.asm.Fa).apply(null,arguments)},d._crypto_kx_publickeybytes=function(){return(d._crypto_kx_publickeybytes=d.asm.Ga).apply(null,arguments)},d._crypto_kx_secretkeybytes=function(){return(d._crypto_kx_secretkeybytes=d.asm.Ha).apply(null,arguments)},d._crypto_kx_seedbytes=function(){return(d._crypto_kx_seedbytes=d.asm.Ia).apply(null,arguments)},d._crypto_kx_sessionkeybytes=function(){return(d._crypto_kx_sessionkeybytes=d.asm.Ja).apply(null,arguments)},d._crypto_pwhash_alg_argon2i13=function(){return(d._crypto_pwhash_alg_argon2i13=d.asm.Ka).apply(null,arguments)},d._crypto_pwhash_alg_argon2id13=function(){return(d._crypto_pwhash_alg_argon2id13=d.asm.La).apply(null,arguments)},d._crypto_pwhash_alg_default=function(){return(d._crypto_pwhash_alg_default=d.asm.Ma).apply(null,arguments)},d._crypto_pwhash_bytes_min=function(){return(d._crypto_pwhash_bytes_min=d.asm.Na).apply(null,arguments)},d._crypto_pwhash_bytes_max=function(){return(d._crypto_pwhash_bytes_max=d.asm.Oa).apply(null,arguments)},d._crypto_pwhash_passwd_min=function(){return(d._crypto_pwhash_passwd_min=d.asm.Pa).apply(null,arguments)},d._crypto_pwhash_passwd_max=function(){return(d._crypto_pwhash_passwd_max=d.asm.Qa).apply(null,arguments)},d._crypto_pwhash_saltbytes=function(){return(d._crypto_pwhash_saltbytes=d.asm.Ra).apply(null,arguments)},d._crypto_pwhash_strbytes=function(){return(d._crypto_pwhash_strbytes=d.asm.Sa).apply(null,arguments)},d._crypto_pwhash_strprefix=function(){return(d._crypto_pwhash_strprefix=d.asm.Ta).apply(null,arguments)},d._crypto_pwhash_opslimit_min=function(){return(d._crypto_pwhash_opslimit_min=d.asm.Ua).apply(null,arguments)},d._crypto_pwhash_opslimit_max=function(){return(d._crypto_pwhash_opslimit_max=d.asm.Va).apply(null,arguments)},d._crypto_pwhash_memlimit_min=function(){return(d._crypto_pwhash_memlimit_min=d.asm.Wa).apply(null,arguments)},d._crypto_pwhash_memlimit_max=function(){return(d._crypto_pwhash_memlimit_max=d.asm.Xa).apply(null,arguments)},d._crypto_pwhash_opslimit_interactive=function(){return(d._crypto_pwhash_opslimit_interactive=d.asm.Ya).apply(null,arguments)},d._crypto_pwhash_memlimit_interactive=function(){return(d._crypto_pwhash_memlimit_interactive=d.asm.Za).apply(null,arguments)},d._crypto_pwhash_opslimit_moderate=function(){return(d._crypto_pwhash_opslimit_moderate=d.asm._a).apply(null,arguments)},d._crypto_pwhash_memlimit_moderate=function(){return(d._crypto_pwhash_memlimit_moderate=d.asm.$a).apply(null,arguments)},d._crypto_pwhash_opslimit_sensitive=function(){return(d._crypto_pwhash_opslimit_sensitive=d.asm.ab).apply(null,arguments)},d._crypto_pwhash_memlimit_sensitive=function(){return(d._crypto_pwhash_memlimit_sensitive=d.asm.bb).apply(null,arguments)},d._crypto_pwhash=function(){return(d._crypto_pwhash=d.asm.cb).apply(null,arguments)},d._crypto_pwhash_str=function(){return(d._crypto_pwhash_str=d.asm.db).apply(null,arguments)},d._crypto_pwhash_str_alg=function(){return(d._crypto_pwhash_str_alg=d.asm.eb).apply(null,arguments)},d._crypto_pwhash_str_verify=function(){return(d._crypto_pwhash_str_verify=d.asm.fb).apply(null,arguments)},d._crypto_pwhash_str_needs_rehash=function(){return(d._crypto_pwhash_str_needs_rehash=d.asm.gb).apply(null,arguments)},d._crypto_scalarmult_base=function(){return(d._crypto_scalarmult_base=d.asm.hb).apply(null,arguments)},d._crypto_scalarmult=function(){return(d._crypto_scalarmult=d.asm.ib).apply(null,arguments)},d._crypto_scalarmult_bytes=function(){return(d._crypto_scalarmult_bytes=d.asm.jb).apply(null,arguments)},d._crypto_scalarmult_scalarbytes=function(){return(d._crypto_scalarmult_scalarbytes=d.asm.kb).apply(null,arguments)},d._crypto_secretbox_keybytes=function(){return(d._crypto_secretbox_keybytes=d.asm.lb).apply(null,arguments)},d._crypto_secretbox_noncebytes=function(){return(d._crypto_secretbox_noncebytes=d.asm.mb).apply(null,arguments)},d._crypto_secretbox_macbytes=function(){return(d._crypto_secretbox_macbytes=d.asm.nb).apply(null,arguments)},d._crypto_secretbox_messagebytes_max=function(){return(d._crypto_secretbox_messagebytes_max=d.asm.ob).apply(null,arguments)},d._crypto_secretbox_keygen=function(){return(d._crypto_secretbox_keygen=d.asm.pb).apply(null,arguments)},d._crypto_secretbox_detached=function(){return(d._crypto_secretbox_detached=d.asm.qb).apply(null,arguments)},d._crypto_secretbox_easy=function(){return(d._crypto_secretbox_easy=d.asm.rb).apply(null,arguments)},d._crypto_secretbox_open_detached=function(){return(d._crypto_secretbox_open_detached=d.asm.sb).apply(null,arguments)},d._crypto_secretbox_open_easy=function(){return(d._crypto_secretbox_open_easy=d.asm.tb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_keygen=function(){return(d._crypto_secretstream_xchacha20poly1305_keygen=d.asm.ub).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_init_push=function(){return(d._crypto_secretstream_xchacha20poly1305_init_push=d.asm.vb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_init_pull=function(){return(d._crypto_secretstream_xchacha20poly1305_init_pull=d.asm.wb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_rekey=function(){return(d._crypto_secretstream_xchacha20poly1305_rekey=d.asm.xb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_push=function(){return(d._crypto_secretstream_xchacha20poly1305_push=d.asm.yb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_pull=function(){return(d._crypto_secretstream_xchacha20poly1305_pull=d.asm.zb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_statebytes=function(){return(d._crypto_secretstream_xchacha20poly1305_statebytes=d.asm.Ab).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_abytes=function(){return(d._crypto_secretstream_xchacha20poly1305_abytes=d.asm.Bb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_headerbytes=function(){return(d._crypto_secretstream_xchacha20poly1305_headerbytes=d.asm.Cb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_keybytes=function(){return(d._crypto_secretstream_xchacha20poly1305_keybytes=d.asm.Db).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_messagebytes_max=function(){return(d._crypto_secretstream_xchacha20poly1305_messagebytes_max=d.asm.Eb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_tag_message=function(){return(d._crypto_secretstream_xchacha20poly1305_tag_message=d.asm.Fb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_tag_push=function(){return(d._crypto_secretstream_xchacha20poly1305_tag_push=d.asm.Gb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_tag_rekey=function(){return(d._crypto_secretstream_xchacha20poly1305_tag_rekey=d.asm.Hb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_tag_final=function(){return(d._crypto_secretstream_xchacha20poly1305_tag_final=d.asm.Ib).apply(null,arguments)},d._crypto_shorthash_bytes=function(){return(d._crypto_shorthash_bytes=d.asm.Jb).apply(null,arguments)},d._crypto_shorthash_keybytes=function(){return(d._crypto_shorthash_keybytes=d.asm.Kb).apply(null,arguments)},d._crypto_shorthash=function(){return(d._crypto_shorthash=d.asm.Lb).apply(null,arguments)},d._crypto_shorthash_keygen=function(){return(d._crypto_shorthash_keygen=d.asm.Mb).apply(null,arguments)},d._crypto_sign_statebytes=function(){return(d._crypto_sign_statebytes=d.asm.Nb).apply(null,arguments)},d._crypto_sign_bytes=function(){return(d._crypto_sign_bytes=d.asm.Ob).apply(null,arguments)},d._crypto_sign_seedbytes=function(){return(d._crypto_sign_seedbytes=d.asm.Pb).apply(null,arguments)},d._crypto_sign_publickeybytes=function(){return(d._crypto_sign_publickeybytes=d.asm.Qb).apply(null,arguments)},d._crypto_sign_secretkeybytes=function(){return(d._crypto_sign_secretkeybytes=d.asm.Rb).apply(null,arguments)},d._crypto_sign_messagebytes_max=function(){return(d._crypto_sign_messagebytes_max=d.asm.Sb).apply(null,arguments)},d._crypto_sign_seed_keypair=function(){return(d._crypto_sign_seed_keypair=d.asm.Tb).apply(null,arguments)},d._crypto_sign_keypair=function(){return(d._crypto_sign_keypair=d.asm.Ub).apply(null,arguments)},d._crypto_sign=function(){return(d._crypto_sign=d.asm.Vb).apply(null,arguments)},d._crypto_sign_open=function(){return(d._crypto_sign_open=d.asm.Wb).apply(null,arguments)},d._crypto_sign_detached=function(){return(d._crypto_sign_detached=d.asm.Xb).apply(null,arguments)},d._crypto_sign_verify_detached=function(){return(d._crypto_sign_verify_detached=d.asm.Yb).apply(null,arguments)},d._crypto_sign_init=function(){return(d._crypto_sign_init=d.asm.Zb).apply(null,arguments)},d._crypto_sign_update=function(){return(d._crypto_sign_update=d.asm._b).apply(null,arguments)},d._crypto_sign_final_create=function(){return(d._crypto_sign_final_create=d.asm.$b).apply(null,arguments)},d._crypto_sign_final_verify=function(){return(d._crypto_sign_final_verify=d.asm.ac).apply(null,arguments)},d._crypto_sign_ed25519_pk_to_curve25519=function(){return(d._crypto_sign_ed25519_pk_to_curve25519=d.asm.bc).apply(null,arguments)},d._crypto_sign_ed25519_sk_to_curve25519=function(){return(d._crypto_sign_ed25519_sk_to_curve25519=d.asm.cc).apply(null,arguments)},d._randombytes_random=function(){return(d._randombytes_random=d.asm.dc).apply(null,arguments)},d._randombytes_stir=function(){return(d._randombytes_stir=d.asm.ec).apply(null,arguments)},d._randombytes_uniform=function(){return(d._randombytes_uniform=d.asm.fc).apply(null,arguments)},d._randombytes_buf=function(){return(d._randombytes_buf=d.asm.gc).apply(null,arguments)},d._randombytes_buf_deterministic=function(){return(d._randombytes_buf_deterministic=d.asm.hc).apply(null,arguments)},d._randombytes_seedbytes=function(){return(d._randombytes_seedbytes=d.asm.ic).apply(null,arguments)},d._randombytes_close=function(){return(d._randombytes_close=d.asm.jc).apply(null,arguments)},d._randombytes=function(){return(d._randombytes=d.asm.kc).apply(null,arguments)},d._sodium_bin2hex=function(){return(d._sodium_bin2hex=d.asm.lc).apply(null,arguments)},d._sodium_hex2bin=function(){return(d._sodium_hex2bin=d.asm.mc).apply(null,arguments)},d._sodium_base64_encoded_len=function(){return(d._sodium_base64_encoded_len=d.asm.nc).apply(null,arguments)},d._sodium_bin2base64=function(){return(d._sodium_bin2base64=d.asm.oc).apply(null,arguments)},d._sodium_base642bin=function(){return(d._sodium_base642bin=d.asm.pc).apply(null,arguments)},d._sodium_init=function(){return(d._sodium_init=d.asm.qc).apply(null,arguments)},d._sodium_pad=function(){return(d._sodium_pad=d.asm.rc).apply(null,arguments)},d._sodium_unpad=function(){return(d._sodium_unpad=d.asm.sc).apply(null,arguments)},d._sodium_version_string=function(){return(d._sodium_version_string=d.asm.tc).apply(null,arguments)},d._sodium_library_version_major=function(){return(d._sodium_library_version_major=d.asm.uc).apply(null,arguments)},d._sodium_library_version_minor=function(){return(d._sodium_library_version_minor=d.asm.vc).apply(null,arguments)},d._sodium_library_minimal=function(){return(d._sodium_library_minimal=d.asm.wc).apply(null,arguments)},d._malloc=function(){return(d._malloc=d.asm.xc).apply(null,arguments)},d._free=function(){return(d._free=d.asm.yc).apply(null,arguments)},d.setValue=function(e,t,n="i8",r){switch("*"===n.charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":C[e>>0]=t;break;case"i16":I[e>>1]=t;break;case"i32":_[e>>2]=t;break;case"i64":G=[t>>>0,(H=t,+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],_[e>>2]=G[0],_[e+4>>2]=G[1];break;case"float":x[e>>2]=t;break;case"double":P[e>>3]=t;break;default:U("invalid type for setValue: "+n)}},d.getValue=function(e,t="i8",n){switch("*"===t.charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return C[e>>0];case"i16":return I[e>>1];case"i32":case"i64":return _[e>>2];case"float":return x[e>>2];case"double":return Number(P[e>>3]);default:U("invalid type for getValue: "+t)}return null},d.UTF8ToString=O,Q=function e(){re||oe(),re||(Q=e)},d.run=oe,d.preInit)for("function"==typeof d.preInit&&(d.preInit=[d.preInit]);d.preInit.length>0;)d.preInit.pop()();oe()}))};var i,s,a,l,c,u,d=void 0!==d?d:{},h=Object.assign({},d),p=[],f="object"==typeof window,g="function"==typeof importScripts,m="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,y="";m?(y=g?n(84371).dirname(y)+"/":"//",u=()=>{c||(l=n(68236),c=n(84371))},i=function(e,t){var n=ee(e);return n?t?n:n.toString():(u(),e=c.normalize(e),l.readFileSync(e,t?void 0:"utf8"))},a=e=>{var t=i(e,!0);return t.buffer||(t=new Uint8Array(t)),t},s=(e,t,n)=>{var r=ee(e);r&&t(r),u(),e=c.normalize(e),l.readFile(e,(function(e,r){e?n(e):t(r.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),p=process.argv.slice(2),e.exports=d,d.inspect=function(){return"[Emscripten Module object]"}):(f||g)&&(g?y=self.location.href:"undefined"!=typeof document&&document.currentScript&&(y=document.currentScript.src),y=0!==y.indexOf("blob:")?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf("/")+1):"",i=e=>{try{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText}catch(t){var n=ee(e);if(n)return function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r>255&&(r&=255),t.push(String.fromCharCode(r))}return t.join("")}(n);throw t}},g&&(a=e=>{try{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}catch(t){var n=ee(e);if(n)return n;throw t}}),s=(e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{if(200==r.status||0==r.status&&r.response)t(r.response);else{var i=ee(e);i?t(i.buffer):n()}},r.onerror=n,r.send(null)}),d.print;var v,A,b=d.printErr||void 0;Object.assign(d,h),h=null,d.arguments&&(p=d.arguments),d.thisProgram&&d.thisProgram,d.quit&&d.quit,d.wasmBinary&&(v=d.wasmBinary),d.noExitRuntime,"object"!=typeof WebAssembly&&L("no native wasm support detected");var w,S,C,E,I,_,x,P=!1,k="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function B(e,t){return e?function(e,t,n){for(var r=t+n,i=t;e[i]&&!(i>=r);)++i;if(i-t>16&&e.subarray&&k)return k.decode(e.subarray(t,i));for(var o="";t<i;){var s=e[t++];if(128&s){var a=63&e[t++];if(192!=(224&s)){var l=63&e[t++];if((s=224==(240&s)?(15&s)<<12|a<<6|l:(7&s)<<18|a<<12|l<<6|63&e[t++])<65536)o+=String.fromCharCode(s);else{var c=s-65536;o+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else o+=String.fromCharCode((31&s)<<6|a)}else o+=String.fromCharCode(s)}return o}(C,e,t):""}function O(e){w=e,d.HEAP8=S=new Int8Array(e),d.HEAP16=E=new Int16Array(e),d.HEAP32=I=new Int32Array(e),d.HEAPU8=C=new Uint8Array(e),d.HEAPU16=new Uint16Array(e),d.HEAPU32=new Uint32Array(e),d.HEAPF32=_=new Float32Array(e),d.HEAPF64=x=new Float64Array(e)}d.INITIAL_MEMORY;var N,D=[],j=[],T=[],M=0,F=null,R=null;function L(e){throw d.onAbort&&d.onAbort(e),b(e="Aborted("+e+")"),P=!0,e+=". Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(e)}d.preloadedImages={},d.preloadedAudios={};var Q,U,V,K,H="data:application/octet-stream;base64,";function G(e){return e.startsWith(H)}function Y(e){return e.startsWith("file://")}function z(e){try{if(e==Q&&v)return new Uint8Array(v);var t=ee(e);if(t)return t;if(a)return a(e);throw"both async and sync fetching of the wasm failed"}catch(e){L(e)}}G(Q="data:application/octet-stream;base64,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ASgCPDYCPCABQUBrIQEgAkFAayICIAVNDQALCyACIARPDQEDQCACIAEoAgA2AgAgAUEEaiEBIAJBBGoiAiAESQ0ACwwBCyADQQRJBEAgACECDAELIAAgA0EEayIESwRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAiABLQABOgABIAIgAS0AAjoAAiACIAEtAAM6AAMgAUEEaiEBIAJBBGoiAiAETQ0ACwsgAiADSQRAA0AgAiABLQAAOgAAIAFBAWohASACQQFqIgIgA0cNAAsLIAAL7AEBEn8gAigCBCEDIAEoAgQhBCACKAIIIQUgASgCCCEGIAIoAgwhByABKAIMIQggAigCECEJIAEoAhAhCiACKAIUIQsgASgCFCEMIAIoAhghDSABKAIYIQ4gAigCHCEPIAEoAhwhECACKAIgIREgASgCICESIAIoAiQhEyABKAIkIRQgACACKAIAIAEoAgBqNgIAIAAgEyAUajYCJCAAIBEgEmo2AiAgACAPIBBqNgIcIAAgDSAOajYCGCAAIAsgDGo2AhQgACAJIApqNgIQIAAgByAIajYCDCAAIAUgBmo2AgggACADIARqNgIEC0ABA38gACABIAFB+ABqIgIQCiAAQShqIAFBKGoiAyABQdAAaiIEEAogAEHQAGogBCACEAogAEH4AGogASADEAoLGAEBf0GonAIoAgAiAARAIAARDwALEAMAC+wBARJ/IAIoAgQhAyABKAIEIQQgAigCCCEFIAEoAgghBiACKAIMIQcgASgCDCEIIAIoAhAhCSABKAIQIQogAigCFCELIAEoAhQhDCACKAIYIQ0gASgCGCEOIAIoAhwhDyABKAIcIRAgAigCICERIAEoAiAhEiACKAIkIRMgASgCJCEUIAAgASgCACACKAIAazYCACAAIBQgE2s2AiQgACASIBFrNgIgIAAgECAPazYCHCAAIA4gDWs2AhggACAMIAtrNgIUIAAgCiAJazYCECAAIAggB2s2AgwgACAGIAVrNgIIIAAgBCADazYCBAsEAEEgCwoAIAAgASACEDgLzAwBB38CQCAARQ0AIABBCGsiAyAAQQRrKAIAIgFBeHEiAGohBQJAIAFBAXENACABQQNxRQ0BIAMgAygCACIBayIDQaSYAigCAEkNASAAIAFqIQAgA0GomAIoAgBHBEAgAUH/AU0EQCAD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IAAhAQJAIABBA3EEQANAIAEtAABFDQIgAUEBaiIBQQNxDQALCwNAIAEiAkEEaiEBIAIoAgAiA0F/cyADQYGChAhrcUGAgYKEeHFFDQALIANB/wFxRQRAIAIgAGsPCwNAIAItAAEhAyACQQFqIgEhAiADDQALCyABIABrCygAIAAgASACEFUgAEEoaiABQShqIAIQVSAAQdAAaiABQdAAaiACEFULEQAgACABQdSRAigCABEDABoLEQAgACABQcyRAigCABEDABoLCgAgACABIAIQFwsRACAAIAFzQf8BcUEBa0EfdguwAQEDfyMAQcAFayICJAACQCAAKAJIQQN2Qf8AcSIDQe8ATQRAIAAgA2pB0ABqQeCPAkHwACADaxARGgwBCyAAQdAAaiIEIANqQeCPAkGAASADaxARGiAAIAQgAiACQYAFahBHIARBAEHwABAPGgsgAEHAAWogAEFAa0EQEKUBIAAgAEHQAGogAiACQYAFahBHIAEgAEHAABClASACQcAFEAggAEHQARAIIAJBwAVqJAALCAAgAEEgEB0LRgEEfiABKQIIIQIgASkCECEDIAEpAhghBCABKQIAIQUgACABKQIgNwIgIAAgBDcCGCAAIAM3AhAgACACNwIIIAAgBTcCAAtSAQJ/QbCRAigCACIBIABBA2pBfHEiAmohAAJAIAJBACAAIAFNGw0AIAA/AEEQdEsEQCAAEAJFDQELQbCRAiAANgIAIAEPC0HglwJBMDYCAEF/CwwAIAAgAUGACBARGgv6BQEKfyMAQTBrIgIkACACIAEoAiAiAyABKAIcIgQgASgCGCIFIAEoAhQiBiABKAIQIgcgASgCDCIIIAEoAggiCSABKAIEIgogASgCACILIAEoAiQiAUETbEGAgIAIakEZdmpBGnVqQRl1akEadWpBGXVqQRp1akEZdWpBGnVqQRl1akEadSABakEZdUETbCALaiILQf///x9xNgIAIAIgCiALQRp1aiIKQf///w9xNgIEIAIgCSAKQRl1aiIJQf///x9xNgIIIAIgCCAJQRp1aiIIQf///w9xNgIMIAIgByAIQRl1aiIHQf///x9xNgIQIAIgBiAHQRp1aiIGQf///w9xNgIUIAIgBSAGQRl1aiIFQf///x9xNgIYIAIgBCAFQRp1aiIEQf///w9xNgIcIAIgAyAEQRl1aiID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IABBPGoiASAcKAIUEAkgAEFAayABQgQQFxogHCgCECIBBEAgAEFAayABIBw1AhQQFxoLIABBPGoiASAcKAIcEAkgAEFAayABQgQQFxoCQCAcKAIYIgFFDQAgAEFAayABIBw1AhwQFxogHC0AOEECcUUNACAcKAIYIBwoAhwQCCAcQQA2AhwLIABBPGoiASAcKAIkEAkgAEFAayABQgQQFxogHCgCICIBBEAgAEFAayABIBw1AiQQFxoLIABBQGsgBEHAABBMGgsgBiQAIARBQGtBCBAIQQAhAyMAQYAIayIAJAAgAigCHARAIARBxABqIQUgBEFAayEBA0AgAUEAEAkgBSADEAkgAEGACCAEQcgAEFogAigCACgCBCACKAIYIANsQQp0aiAAEIgBIAFBARAJIABBgAggBEHIABBaIAIoAgAoAgQgAigCGCADbEEKdGpBgAhqIAAQiAEgA0EBaiIDIAIoAhxJDQALCyAAQYAIEAggAEGACGokACAEQcgAEAhBACEDCyAEQdAAaiQAIAMiAA0AIAIoAggEQANAQQAhICMAQSBrIgMkAAJAIAJFDQAgAigCHEUNACADICU2AhBBASEBA0AgAyAgOgAYQQAhHkEAIQAgAQRAA0AgA0EANgIcIAMgAykDGDcDCCADIB42AhQgAyADKQMQNwMAQQAhAQJAIAJFDQACfwJAIAIoAiRBAkcEQCACKAIEIR8MAQsgAigCBCEfQQEgAygCACIFIAMtAAgiBEEBS3INARoLIwBBgCBrIgAkACAAQYAYahA+IABBgBBqED4CQCACRSADRXINACAAIAM1AgA3A4AQIAAgAzUCBDcDiBAgACADMQAINwOQECAAIAI1AhA3A5gQIAAgAjUCCDcDoBAgACACNQIkNwOoECACKAIURQ0AA0AgAUH/AHEiBEUEQCAAIAApA7AQQgF8NwOwECAAED4gAEGACGoiBRA+IABBgBhqIgYgAEGAEGogABBZIAYgACAFEFkLIB8gAUEDdGogAEGACGogBEEDdGopAwA3AwAgAUEBaiIBIAIoAhRJDQALCyAAQYAgaiQAIAMtAAghBCADKAIAIQVBAAshJkEAIARB/wFxIgFFQQF0IAUbIgUgAigCFCIETw0AQX8gAigCGCIAQQFrIAUgACADKAIEbGogASAEbGoiBCAAcBsgBGohAQNAIARB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AWsgHCgCACAcKAIEQQMQaBshAQwBC0FhIQELIABBEGokACABRQ0AICIgCBAIIAkgChAIQWEhAgwBCyAHBEAgByAiIAgQERoLICIgCBAIQQAhAgsgIhAYCyAcQUBrJAAgAgsrAQF/IwBB0AFrIgMkACADEDYgAyABIAIQGxogAyAAECcgA0HQAWokAEEACxwAIABCADcDQCAAQgA3A0ggAEGgigJBwAAQERoLBABBbwvBAQIFfwF+IAJQRQRAIAJBgAIgACgA4AIiBGsiA60iCFYEQCAAQeABaiEGIABB4ABqIQUDQCAAIARqQeAAaiABIAMQERogACAAKADgAiADajYA4AIgAEKAARBxIAAgBRB0IAUgBkGAARARGiAAIAAoAOACIgdBgAFrIgQ2AOACIAEgA2ohASACIAh9IgJBgAMgB2siA60iCFYNAAsLIAAgBGpB4ABqIAEgAqciARARGiAAIAAoAOACIAFqNgDgAgtBAAupAwEVfyABKAIEIQsgACgCBCEMIAEoAgghDSAAKAIIIQ4gASgCDCEPIAAoAgwhAyABKAIQIRAgACgCECEEIAEoAhQhESAAKAIUIQUgASgCGCESIAAoAhghBiABKAIcIRMgACgCHCEHIAEoAiAhFCAAKAIgIQggASgCJCEVIAAoAiQhCSAAQQAgAmsiAiABKAIAIhYgACgCACIKc3EiFyAKczYCACAAIAkgCSAVcyACcSIKczYCJCAAIAggCCAUcyACcSIJczYCICAAIAcgByATcyACcSIIczYCHCAAIAYgBiAScyACcSIHczYCGCAAIAUgBSARcyACcSIGczYCFCAAIAQgBCAQcyACcSIFczYCECAAIAMgAyAPcyACcSIEczYCDCAAIA4gDSAOcyACcSIDczYCCCAAIAwgCyAMcyACcSIAczYCBCABIAogFXM2AiQgASAJIBRzNgIgIAEgCCATczYCHCABIAcgEnM2AhggASAGIBFzNgIUIAEgBSAQczYCECABIAQgD3M2AgwgASADIA1zNgIIIAEgACALczYCBCABIBYgF3M2AgALQQECfyMAQYABayIDJAAgA0EIaiICIAEQKSACQShqIAFBKGoQKSACQdAAaiABQdAAahApIAAgAhAxIANBgAFqJAALMgEBfyAAIAEgAUH4AGoiAhAKIABBKGogAUEoaiABQdAAaiIB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KAIcIQkgASgCICETIAAoAiAhCiABKAIkIRQgACgCJCELIABBACACayICIAAoAgAiFSABKAIAc3EgFXM2AgAgACALIAsgFHMgAnFzNgIkIAAgCiAKIBNzIAJxczYCICAAIAkgCSAScyACcXM2AhwgACAIIAggEXMgAnFzNgIYIAAgByAHIBBzIAJxczYCFCAAIAYgBiAPcyACcXM2AhAgACAFIAUgDnMgAnFzNgIMIAAgBCAEIA1zIAJxczYCCCAAIAMgAyAMcyACcXM2AgQLJAEBfyMAQSBrIgEkACABIAAQLCABQSAQdSEAIAFBIGokACAAC6YEAg5+Cn8gACgCJCESIAAoAiAhEyAAKAIcIRQgACgCGCEVIAAoAhQhESACQhBaBEAgAC0AUEVBGHQhFiAAKAIEIhdBBWytIQ8gACgCCCIYQQVsrSENIAAoAgwiGUEFbK0hCyAAKAIQIhpBBWytIQkgGq0hECAZrSEOIBitIQwgF60hCiAANQIAIQgDQCABKAADQQJ2Qf///x9xIBVqrSIDIA5+IAEoAABB////H3EgEWqtIgQgEH58IAEoAAZBBHZB////H3EgFGqtIgUgDH58IAEoAAlBBnYgE2qtIgYgCn58IBIgFmogASgADEEIdmqtIgcgCH58IAMgDH4gBCAOfnwgBSAKfnwgBiAIfnwgByAJfnwgAyAKfiAEIAx+fCAFIAh+fCAGIAl+fCAHIAt+fCADIAh+IAQgCn58IAUgCX58IAYgC358IAcgDX58IAMgCX4gBCAIfnwgBSALfnwgBiANfnwgByAPfnwiA0IaiEL/////D4N8IgRCGohC/////w+DfCIFQhqIQv////8Pg3wiBkIaiEL/////D4N8IgdCGoinQQVsIAOnQf///x9xaiIRQRp2IASnQf///x9xaiEVIAWnQf///x9xIRQgBqdB////H3EhEyAHp0H///8fcSESIBFB////H3EhESABQRBqIQEgAkIQfSICQg9WDQALCyAAIBE2AhQgACASNgIkIAAgEzYCICAAIBQ2AhwgACAVNgIYC+8BAQJ/IABFBEBBZw8LIAAoAgBFBEBBfw8LAn9BfiAAKAIEQRBJDQAaIAAoAghFBEBBbiAAKAIMDQEaCyAAKAIUIQEgACgCEEUEQEFtQXogARsPC0F6IAFBCEkNABogACgCGEUEQEFs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IAEgFiAZhUEQEAUiFjcDcCABIBYgF3wiFjcDSCABIBMgFoVBPxAFNwMgIAAgASkDQCAeIAApAACFhTcAAEEBISEDQCAAICFBA3QiIGoiIiABICBqIiApAwAgIikAAIUgIEFAaykDAIU3AAAgIUEBaiIhQQhHDQALIAFBgAJqJAALRQECfyMAQRBrIgNBADoADyABBEADQCADIAAgAmotAAAgAy0AD3I6AA8gAkEBaiICIAFHDQALCyADLQAPQQFrQQh2QQFxCxkAIAAgASACIANCACAEQeSRAigCABESABoLEAAgACABQdyRAigCABEDAAsDAAEL9wEBBH8jAEGAAWsiAyQAIAAQHCAAQShqIgQQHCAAQdAAaiIFEDAgACABQcAHbEHgFWoiASACQQAgAkGAAXFBB3YiBmsgAnFBAXRrQRh0QRh1IgJBARAmECIgACABQfgAaiACQQIQJhAiIAAgAUHwAWogAkEDECYQIiAAIAFB6AJqIAJBBBAmECIgACABQeADaiACQQUQJhAiIAAgAUHYBGogAkEGECYQIiAAIAFB0AVqIAJBBxAmECIgACABQcgGaiACQQgQJhAiIANBCGoiASAEECkgA0EwaiAAECkgA0HYAGogBRCAASAAIAEgBhAiIANBgAFqJAALHQAgABAwIABBKGoQHCAAQdAAahAcIABB+ABqEDALgAIBCH8DQCAAIAJqIAEgAkEDdmotAAAgAkEHcXZBAXE6AAAgAkEBaiICQYACRw0ACwNAIAQiAUEBaiEEAkAgACABaiIGLQAARQ0AIAQhAkEBIQUgAUH+AUsNAANAAkAgACACaiIDLAAAIgdFDQAgByAFdCIHIAYsAAAiCGoiCUEPTARAIAYgCToAACADQQA6AAAMAQsgCCAHayIDQXFIDQIgBiADOgAAA0AgACACaiIDLQAARQRAIANBAToAAAwCCyADQQA6AAAgAkH/AUkhAyACQQFqIQIgAw0ACwsgBUEFSw0BIAVBAWoiBSABaiICQYACSQ0ACwsgBEGAAkcNAAsLlQEBBH8jAEEwayIFJAAgACABQShqIgMgARASIABBKGoiBCADIAEQFSAAQdAAaiIDIAAgAkEoahAKIAQgBCACEAogAEH4AGoiBiACQfgAaiABQfgAahAKIAAgAUHQAGogAkHQAGoQCiAFIAAgABASIAAgAyAE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AAAgA0IBfCIDIAJSDQALIAAgACkDOCACfDcDOAsLsgEBAX8gACABKAAAQf///x9xNgIAIAAgASgAA0ECdkGD/v8fcTYCBCAAIAEoAAZBBHZB/4H/H3E2AgggACABKAAJQQZ2Qf//wB9xNgIMIAEoAAwhAiAAQgA3AhQgAEIANwIcIABBADYCJCAAIAJBCHZB//8/cTYCECAAIAEoABA2AiggACABKAAUNgIsIAAgASgAGDYCMCABKAAcIQEgAEEAOgBQIABCADcDOCAAIAE2AjQLMAECfyMAIgVBgAFrQUBxIgQkACAEIAMQhAEgBCABIAIQgwEgBCAAEIIBIAUkAEEACwsAIAAgAUEgEIcBC2wBAX8jAEEQayIDIAA2AgwgAyABNgIIQQAhASADQQA2AgQgAkEASgRAA0AgAyADKAIEIAMoAgggAWotAAAgAygCDCABai0AAHNyNgIEIAFBAWoiASACRw0ACwsgAygCBEEBa0EIdkEBcUEBawspAQJ/A0AgACACQQN0IgNqIAEgA2opAAA3AwAgAkEBaiICQYABRw0ACwtyAQF/AkAgAUEEcUUNACAAKAIAIgEEQCABKAIEIAAoAhBBCnQQCAsgACgCBCIBRQ0AIAEgACgCFEEDdBAICyAAKAIEEBggAEEANgIEAkAgACgCACIBRQ0AIAEoAgAiAkUNACACEBgLIAEQGCAAQQA2AgALEAAgAEIANwIAIABCADcCCAspAQF/IwBBEGsiACQAIABBADoAD0GMkgIgAEEPakEAEAEaIABBEGokAAsoACACQoCAgIAQWgRAEBQACyAAIAEgAiADQgEgBEG8kQIoAgAREgAaCxYAIABCwAAgASACQbSRAigCABENABoLPQECfyMAIgRBgANrQUBxIgMkACADQQBBAEEYEEIaIAMgAUIgECUaIAMgAkIgECUaIAMgAEEYEEEaIAQkAAsqAQF/QX8hBiACQhBaBH8gACABQRBqIAEgAkIQfSADIAQgBRCQAQUgBgsLPAECfyMAQSBrIgckAEF/IQggByAFIAYQZEUEQCAAIAEgAiADIAQgBxBgIQggB0EgEAgLIAdBIGokACAICyUAIAJC8P///w9aBEAQFAALIABBEGogACABIAIgAyAEIAUQkgELPAECfyMAQSBrIgckAEF/IQggByAFIAYQZEUEQCAAIAEgAiAD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AUEgaiAIQiB9IAYgASAFEI8BIQcLIAZBIGokACAHC5kBAgJ/AX4gAq0gA61CIIaEIQcjAEHgAGsiAiQAQX8hAyACQSBqIAIQkwFFBEAgAkFAayIFIAJBIGoiBiAEEI4BIABBIGogASAHIAUgBCACEJEBIQMgACACKQM4NwAYIAAgAikDMDcAECAAIAIpAyg3AAggACACKQMgNwAAIAJBIBAIIAZBIBAIIAVBGBAICyACQeAAaiQAIAMLGQAgACABIAKtIAOtQiCGhCAEIAUgBhCPAQstAQF+IAKtIAOtQiCGhCIGQhBaBH8gACABQRBqIAEgBkIQfSAEIAUQYAVBfwsLGwAgACABIAIgA60gBK1CIIaEIAUgBiAHEJABCxgAIAAgASACIAOtIAStQiCGhCAFIAYQYAsZACAAIAEgAq0gA61CIIaEIAQgBSAGEJEBCy4BAX4gAq0gA61CIIaEIgZC8P///w9aBEAQFAALIABBEGogACABIAYgBCAFEGELGwAgACABIAIgA60gBK1CIIaEIAUgBiAHEJIBCxgAIAAgASACIAOtIAStQiCGhCAFIAYQYQtIAQF/IwBBIGsiBSQAIAUgASACrSADrUIghoQgBBCUARogACAFEIYBIQEgBSAAQSAQTyECIAVBIGokACACQX8gASAAIAVGG3ILFQAgACABIAKtIAOtQiCGhCAEEJQBC1sBAn4gB60gCK1CIIaEIQxBfyECIAStIAWtQiCGhCILQhBaBEAgACADIAtCEH0gAyALp2pBEGsgBiAMIAkgChCaASECCyABBEAgAUIAIAtCEH0gAhs3AwALIAILJQAgACACIAOtIAStQiCGhCAFIAYgB60gCK1CIIaEIAkgChCaAQtZAQJ+An8gBq0gB61CIIaEIQwgA60gBK1CIIaEIgtC8P///w9UBEAgACAAIAunakEAIAIgCyAFIAwgCSAKEJsBGiABBEAgASALQhB8NwMAC0EADAELEBQACwsnACAAIAEgAiADIAStIAWtQiCGhCAGIAetIAitQiCGhCAKIAsQmwELWwECfiAHrSAIrUIghoQhDEF/IQIgBK0gBa1CIIaEIgtCEFoEQCAAIAMgC0IQfSADIAunakEQayAGIAwgCSAKEKYBIQILIAEEQCABQgAgC0IQfSACGzcDAAsgAgslACAAIAIgA60gBK1CIIaE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QQ9xIgZBCHQgBkH2/wNqQYCyA3FqQYCuAWpBCHY6AAEgBCAFQQR2IgQgBEH2/wNqQQh2QdkBcWpB1wBqOgAAIAFBAWoiASADRw0ACyADQQF0BSABCyAAakEAOgAAIAAPCxAUAAssAQF/IwBBQGoiAyQAIAAgAxAnIAEgA0LAACACQQEQoQEhACADQUBrJAAgAAsuAQF/IwBBQGoiBCQAIAAgBBAnIAEgAiAEQsAAIANBARCjASEAIARBQGskACAACwgAIAAQNkEACywBAX8jAEEgayICJAAgAkEgEB0gACABIAIQpAEaIAJBIBAIIAJBIGokAEEACwsAIAAgASACEKQBCwUAQb9/CwUAQdABC20BAX8jAEFAaiICJAAgAiABQiAQNRogAiACLQAAQfgBcToAACACIAItAB9BP3FBwAByOgAfIAAgAikDEDcAECAAIAIpAwg3AAggACACKQMANwAAIAAgAikDGDcAGCACQcAAEAggAkFAayQAQQALnwQBB38jAEGAAmsiBSQAQX8hCAJAIAEQUQ0AIAVB4ABqIAEQfg0AIwBBoAFrIgYkACMAQeANayICJAAgAkHgA2oiAyAFQeAAaiIEEBkgAkHAAmoiASAEEDogAiABEBMgASACIAMQGiACQaABaiIDIAEQEyACQYAFaiIEIAMQGSABIAIgBBAaIAMgARATIAJBoAZqIgQgAxAZIAEgAiAEEBogAyABEBMgAkHAB2oiBCADEBkgASACIAQQGiADIAEQEyACQeAIaiIEIAMQGSABIAIgBBAaIAMgARATIAJBgApqIgQgAxAZIAEgAiAEEBogAyABEBMgAkGgC2oiBCADEBkgASACIAQQGiADIAEQEyACQcAMaiADEBkgBhB6QfwBIQEDQCACQcACaiAGEDoCQCABIgNB4IUCaiwAACIBQQBKBEAgAkGgAWoiBCACQcACaiIHEBMgByAEIAJB4ANqIAFB/gFxQQF2QaABbGoQGgwBCyABQQBODQAgAkGgAWoiBCACQcACaiIHEBMgByAEIAJB4ANqQQAgAWtB/gFxQQF2QaABbGoQfAsgBiACQcACahATIANBAWshASADDQALIAJB4A1qJAAgBhBWIQEgBkGgAWokACABRQ0AIAUQHCAFIAUgBUGIAWoiAxAVIAVBMGoiARAcIAEgASADEBIgBSAFEDwgASAB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xAGBEXgA+2eX/wc0cP+MOEL/KOL1/9lGJf6s1gn/SEOGAZLA1v8sJnAARLhL/85a+wCV640Atao6AHT07wBcnQIAZq1iAOmJYAF/McsABZuUABeUCf/TegwAIoYa/9vMiACGCCn/4FMr/lUZ9wBtfwD+qYgwAO532//nrdUAzhL+/gi6B/9+CQcBbypIAG807P5gP40Ak79//s1OwP8Oau0Bu9tMAK/zu/5pWa0AVRlZAaLzlAACdtH+IZ4JAIujLv9dRigAbCqO/m/8jv+b35AAM+Wn/0n8m/9edAz/mKDa/5zuJf+z6s//xQCz/5qkjQDhxGgACiMZ/tHU8v9h/d7+uGXlAN4SfwGkiIf/Hs+M/pJh8wCBwBr+yVQh/28KTv+TUbL/BAQYAKHu1/8GjSEANdcO/ym10P/ni50As8vd//+5cQC94qz/cULW/8o+Lf9mQAj/Tq4Q/oV1RP8AQYAUCwEBAEGgFAuwASbolY/CsiewRcP0ifLvmPDV36wF08YzObE4AohtU/wFxxdqcD1N2E+6PAt2DRBnDyogU/osOczGTsf9d5KsA3rs////////////////////////////////////////f+3///////////////////////////////////////9/7v///////////////////////////////////////3/t0/VcGmMSWNac96Le+d4UAEHfFQv88AEQhTuMAb3xJP/4JcMBYNw3ALdMPv/DQj0AMkykAeGkTP9MPaP/dT4fAFGRQP92QQ4AonPW/waKLgB85vT/CoqPADQawgC49EwAgY8pAb70E/97qnr/YoFEAHnVkwBWZR7/oWebAIxZQ//v5b4BQwu1AMbwif7uRbz/6nE8/yX/Of9Fsrb+gNCzAHYaff4DB9b/8TJN/1XLxf/Th/r/GTBk/7vVtP4RWGkAU9GeAQVzYgAErjz+qzdu/9m1Ef8UvKoAkpxm/lfWrv9yepsB6SyqAH8I7wHW7OoArwXbADFqPf8GQtD/Ampu/1HqE//Xa8D/Q5fuABMqbP/lVXEBMkSH/xFqCQAyZwH/UAGoASOYHv8QqLkBOFno/2XS/AAp+kcAzKpP/w4u7/9QTe8AvdZL/xGN+QAmUEz/vlV1AFbkqgCc2NABw8+k/5ZCTP+v4RD/jVBiAUzb8gDGonIALtqY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//////////////9/7f///////////////////////////////////////3/u////////////////////////////////////////fwjJvPNn5glqO6fKhIWuZ7sr+JT+cvNuPPE2HV869U+l0YLmrX9SDlEfbD4rjGgFm2u9Qfur2YMfeSF+ExnN4FsAQaCKAgvBBQjJvPNn5glqO6fKhIWuZ7sr+JT+cvNuPPE2HV869U+l0YLmrX9SDlEfbD4rjGgFm2u9Qfur2YMfeSF+ExnN4FsirijXmC+KQs1l7yORRDdxLztN7M/7wLW824mBpdu16Ti1SPNbwlY5GdAFtvER8VmbTxmvpII/khiBbdrVXhyrQgIDo5iqB9i+b3BFAVuDEoyy5E6+hTEk4rT/1cN9DFVviXvydF2+crGWFjv+sd6ANRLHJacG3JuUJmnPdPGbwdJK8Z7BaZvk4yVPOIZHvu+11YyLxp3BD2WcrHfMoQwkdQIrWW8s6S2D5KZuqoR0StT7Qb3cqbBctVMRg9qI+Xar32buUlE+mBAytC1txjGoPyH7mMgnA7DkDu++x39Zv8KPqD3zC+DGJacKk0eRp9VvggPgUWPKBnBuDgpnKSkU/C/SRoUKtycmySZcOCEbLu0qxFr8bSxN37OVnRMNOFPeY6+LVHMKZaiydzy7Cmp25q7tRy7JwoE7NYIUhSxykmQD8Uyh6L+iATBCvEtmGqiRl/jQcItLwjC+VAajUWzHGFLv1hnoktEQqWVVJAaZ1iogcVeFNQ70uNG7MnCgahDI0NK4FsGkGVOrQVEIbDcemeuO30x3SCeoSJvhtbywNGNaycWzDBw5y4pB40qq2E5z42N3T8qcW6O4stbzby5o/LLvXe6Cj3RgLxdDb2OleHKr8KEUeMiE7DlkGggCx4woHmMj+v++kOm9gt7rbFCkFXnGsvej+b4rU3Lj8nhxxpxhJurOPifKB8LAIce4htEe6+DN1n3a6njRbu5/T331um8Xcqpn8AammMiixX1jCq4N+b4EmD8RG0ccEzULcRuEfQQj9XfbKJMkx0B7q8oyvL7JFQq+njxMDRCcxGcdQ7ZCPsu+1MVMKn5l/Jwpf1ns+tY6q2/LXxdYR0qMGURsgABB4JACCyFTaWdFZDI1NTE5IG5vIEVkMjU1MTkgY29sbGlzaW9ucwEAQbCRAgs1MI5QAAEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0=")||(U=Q,Q=d.locateFile?d.locateFile(U,y):y+U);var Z={35048:function(){return d.getRandomValue()},35084:function(){if(void 0===d.getRandomValue)try{var e="object"==typeof window?window:self,t=void 0!==e.crypto?e.crypto:e.msCrypto,r=function(){var e=new Uint32Array(1);return t.getRandomValues(e),e[0]>>>0};r(),d.getRandomValue=r}catch(e){try{var i=n(22901),o=function(){var e=i.randomBytes(4);return(e[0]<<24|e[1]<<16|e[2]<<8|e[3])>>>0};o(),d.getRandomValue=o}catch(e){throw"No secure random number generator found"}}}};function W(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?q(n)():q(n)(t.arg):n(void 0===t.arg?null:t.arg)}else t(d)}}function q(e){return N.get(e)}var J=[];function X(e){try{return A.grow(e-w.byteLength+65535>>>16),O(A.buffer),1}catch(e){}}var $="function"==typeof atob?atob:function(e){var t,n,r,i,o,s,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l="",c=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{t=a.indexOf(e.charAt(c++))<<2|(i=a.indexOf(e.charAt(c++)))>>4,n=(15&i)<<4|(o=a.indexOf(e.charAt(c++)))>>2,r=(3&o)<<6|(s=a.indexOf(e.charAt(c++))),l+=String.fromCharCode(t),64!==o&&(l+=String.fromCharCode(n)),64!==s&&(l+=String.fromCharCode(r))}while(c<e.length);return l};function ee(e){if(G(e))return function(e){if("boolean"==typeof m&&m){var t=Buffer.from(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}try{for(var n=$(e),r=new Uint8Array(n.length),i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}catch(e){throw new Error("Converting base64 string to bytes failed.")}}(e.slice(H.length))}var te,ne={a:function(e,t,n,r){L("Assertion failed: "+B(e)+", at: "+[t?B(t):"unknown filename",n,r?B(r):"unknown function"])},d:function(){L("")},b:function(e,t,n){var r=function(e,t){var n;for(J.length=0,t>>=2;n=C[e++];){var r=n<105;r&&1&t&&t++,J.push(r?x[t++>>1]:I[t]),++t}return J}(t,n);return Z[e].apply(null,r)},e:function(e,t,n){C.copyWithin(e,t,t+n)},c:function(e){var t,n=C.length,r=2147483648;if((e>>>=0)>r)return!1;for(var i=1;i<=4;i*=2){var o=n*(1+.2/i);if(o=Math.min(o,e+100663296),X(Math.min(r,(t=Math.max(e,o))+(65536-t%65536)%65536)))return!0}return!1}};function re(e){function t(){te||(te=!0,d.calledRun=!0,P||(W(j),d.onRuntimeInitialized&&d.onRuntimeInitialized(),function(){if(d.postRun)for("function"==typeof d.postRun&&(d.postRun=[d.postRun]);d.postRun.length;)e=d.postRun.shift(),T.unshift(e);var e;W(T)}()))}e=e||p,M>0||(function(){if(d.preRun)for("function"==typeof d.preRun&&(d.preRun=[d.preRun]);d.preRun.length;)e=d.preRun.shift(),D.unshift(e);var e;W(D)}(),M>0||(d.setStatus?(d.setStatus("Running..."),setTimeout((function(){setTimeout((function(){d.setStatus("")}),1),t()}),1)):t()))}if(function(){var e={a:ne};function t(e,t){var n,r=e.exports;d.asm=r,O((A=d.asm.f).buffer),N=d.asm.Ac,n=d.asm.g,j.unshift(n),function(e){if(M--,d.monitorRunDependencies&&d.monitorRunDependencies(M),0==M&&(null!==F&&(clearInterval(F),F=null),R)){var t=R;R=null,t()}}()}function n(e){t(e.instance)}function r(t){return function(){if(!v&&(f||g)){if("function"==typeof fetch&&!Y(Q))return fetch(Q,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+Q+"'";return e.arrayBuffer()})).catch((function(){return z(Q)}));if(s)return new Promise((function(e,t){s(Q,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return z(Q)}))}().then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){b("failed to asynchronously prepare wasm: "+e),L(e)}))}if(M++,d.monitorRunDependencies&&d.monitorRunDependencies(M),d.instantiateWasm)try{return d.instantiateWasm(e,t)}catch(e){return b("Module.instantiateWasm callback failed with error: "+e),!1}v||"function"!=typeof WebAssembly.instantiateStreaming||G(Q)||Y(Q)||"function"!=typeof fetch?r(n):fetch(Q,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(n,(function(e){return b("wasm streaming compile failed: "+e),b("falling back to ArrayBuffer instantiation"),r(n)}))}))}(),d.___wasm_call_ctors=function(){return(d.___wasm_call_ctors=d.asm.g).apply(null,arguments)},d._crypto_aead_chacha20poly1305_encrypt_detached=function(){return(d._crypto_aead_chacha20poly1305_encrypt_detached=d.asm.h).apply(null,arguments)},d._crypto_aead_chacha20poly1305_encrypt=function(){return(d._crypto_aead_chacha20poly1305_encrypt=d.asm.i).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_encrypt_detached=function(){return(d._crypto_aead_chacha20poly1305_ietf_encrypt_detached=d.asm.j).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_encrypt=function(){return(d._crypto_aead_chacha20poly1305_ietf_encrypt=d.asm.k).apply(null,arguments)},d._crypto_aead_chacha20poly1305_decrypt_detached=function(){return(d._crypto_aead_chacha20poly1305_decrypt_detached=d.asm.l).apply(null,arguments)},d._crypto_aead_chacha20poly1305_decrypt=function(){return(d._crypto_aead_chacha20poly1305_decrypt=d.asm.m).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_decrypt_detached=function(){return(d._crypto_aead_chacha20poly1305_ietf_decrypt_detached=d.asm.n).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_decrypt=function(){return(d._crypto_aead_chacha20poly1305_ietf_decrypt=d.asm.o).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_keybytes=function(){return(d._crypto_aead_chacha20poly1305_ietf_keybytes=d.asm.p).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_npubbytes=function(){return(d._crypto_aead_chacha20poly1305_ietf_npubbytes=d.asm.q).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_nsecbytes=function(){return(d._crypto_aead_chacha20poly1305_ietf_nsecbytes=d.asm.r).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_abytes=function(){return(d._crypto_aead_chacha20poly1305_ietf_abytes=d.asm.s).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_messagebytes_max=function(){return(d._crypto_aead_chacha20poly1305_ietf_messagebytes_max=d.asm.t).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_keygen=function(){return(d._crypto_aead_chacha20poly1305_ietf_keygen=d.asm.u).apply(null,arguments)},d._crypto_aead_chacha20poly1305_keybytes=function(){return(d._crypto_aead_chacha20poly1305_keybytes=d.asm.v).apply(null,arguments)},d._crypto_aead_chacha20poly1305_npubbytes=function(){return(d._crypto_aead_chacha20poly1305_npubbytes=d.asm.w).apply(null,arguments)},d._crypto_aead_chacha20poly1305_nsecbytes=function(){return(d._crypto_aead_chacha20poly1305_nsecbytes=d.asm.x).apply(null,arguments)},d._crypto_aead_chacha20poly1305_abytes=function(){return(d._crypto_aead_chacha20poly1305_abytes=d.asm.y).apply(null,arguments)},d._crypto_aead_chacha20poly1305_messagebytes_max=function(){return(d._crypto_aead_chacha20poly1305_messagebytes_max=d.asm.z).apply(null,arguments)},d._crypto_aead_chacha20poly1305_keygen=function(){return(d._crypto_aead_chacha20poly1305_keygen=d.asm.A).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_encrypt_detached=function(){return(d._crypto_aead_xchacha20poly1305_ietf_encrypt_detached=d.asm.B).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_encrypt=function(){return(d._crypto_aead_xchacha20poly1305_ietf_encrypt=d.asm.C).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_decrypt_detached=function(){return(d._crypto_aead_xchacha20poly1305_ietf_decrypt_detached=d.asm.D).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_decrypt=function(){return(d._crypto_aead_xchacha20poly1305_ietf_decrypt=d.asm.E).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_keybytes=function(){return(d._crypto_aead_xchacha20poly1305_ietf_keybytes=d.asm.F).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_npubbytes=function(){return(d._crypto_aead_xchacha20poly1305_ietf_npubbytes=d.asm.G).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_nsecbytes=function(){return(d._crypto_aead_xchacha20poly1305_ietf_nsecbytes=d.asm.H).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_abytes=function(){return(d._crypto_aead_xchacha20poly1305_ietf_abytes=d.asm.I).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_messagebytes_max=function(){return(d._crypto_aead_xchacha20poly1305_ietf_messagebytes_max=d.asm.J).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_keygen=function(){return(d._crypto_aead_xchacha20poly1305_ietf_keygen=d.asm.K).apply(null,arguments)},d._crypto_auth_bytes=function(){return(d._crypto_auth_bytes=d.asm.L).apply(null,arguments)},d._crypto_auth_keybytes=function(){return(d._crypto_auth_keybytes=d.asm.M).apply(null,arguments)},d._crypto_auth=function(){return(d._crypto_auth=d.asm.N).apply(null,arguments)},d._crypto_auth_verify=function(){return(d._crypto_auth_verify=d.asm.O).apply(null,arguments)},d._crypto_auth_keygen=function(){return(d._crypto_auth_keygen=d.asm.P).apply(null,arguments)},d._crypto_box_seedbytes=function(){return(d._crypto_box_seedbytes=d.asm.Q).apply(null,arguments)},d._crypto_box_publickeybytes=function(){return(d._crypto_box_publickeybytes=d.asm.R).apply(null,arguments)},d._crypto_box_secretkeybytes=function(){return(d._crypto_box_secretkeybytes=d.asm.S).apply(null,arguments)},d._crypto_box_beforenmbytes=function(){return(d._crypto_box_beforenmbytes=d.asm.T).apply(null,arguments)},d._crypto_box_noncebytes=function(){return(d._crypto_box_noncebytes=d.asm.U).apply(null,arguments)},d._crypto_box_macbytes=function(){return(d._crypto_box_macbytes=d.asm.V).apply(null,arguments)},d._crypto_box_messagebytes_max=function(){return(d._crypto_box_messagebytes_max=d.asm.W).apply(null,arguments)},d._crypto_box_seed_keypair=function(){return(d._crypto_box_seed_keypair=d.asm.X).apply(null,arguments)},d._crypto_box_keypair=function(){return(d._crypto_box_keypair=d.asm.Y).apply(null,arguments)},d._crypto_box_beforenm=function(){return(d._crypto_box_beforenm=d.asm.Z).apply(null,arguments)},d._crypto_box_detached_afternm=function(){return(d._crypto_box_detached_afternm=d.asm._).apply(null,arguments)},d._crypto_box_detached=function(){return(d._crypto_box_detached=d.asm.$).apply(null,arguments)},d._crypto_box_easy_afternm=function(){return(d._crypto_box_easy_afternm=d.asm.aa).apply(null,arguments)},d._crypto_box_easy=function(){return(d._crypto_box_easy=d.asm.ba).apply(null,arguments)},d._crypto_box_open_detached_afternm=function(){return(d._crypto_box_open_detached_afternm=d.asm.ca).apply(null,arguments)},d._crypto_box_open_detached=function(){return(d._crypto_box_open_detached=d.asm.da).apply(null,arguments)},d._crypto_box_open_easy_afternm=function(){return(d._crypto_box_open_easy_afternm=d.asm.ea).apply(null,arguments)},d._crypto_box_open_easy=function(){return(d._crypto_box_open_easy=d.asm.fa).apply(null,arguments)},d._crypto_box_seal=function(){return(d._crypto_box_seal=d.asm.ga).apply(null,arguments)},d._crypto_box_seal_open=function(){return(d._crypto_box_seal_open=d.asm.ha).apply(null,arguments)},d._crypto_box_sealbytes=function(){return(d._crypto_box_sealbytes=d.asm.ia).apply(null,arguments)},d._crypto_generichash_bytes_min=function(){return(d._crypto_generichash_bytes_min=d.asm.ja).apply(null,arguments)},d._crypto_generichash_bytes_max=function(){return(d._crypto_generichash_bytes_max=d.asm.ka).apply(null,arguments)},d._crypto_generichash_bytes=function(){return(d._crypto_generichash_bytes=d.asm.la).apply(null,arguments)},d._crypto_generichash_keybytes_min=function(){return(d._crypto_generichash_keybytes_min=d.asm.ma).apply(null,arguments)},d._crypto_generichash_keybytes_max=function(){return(d._crypto_generichash_keybytes_max=d.asm.na).apply(null,arguments)},d._crypto_generichash_keybytes=function(){return(d._crypto_generichash_keybytes=d.asm.oa).apply(null,arguments)},d._crypto_generichash_statebytes=function(){return(d._crypto_generichash_statebytes=d.asm.pa).apply(null,arguments)},d._crypto_generichash=function(){return(d._crypto_generichash=d.asm.qa).apply(null,arguments)},d._crypto_generichash_init=function(){return(d._crypto_generichash_init=d.asm.ra).apply(null,arguments)},d._crypto_generichash_update=function(){return(d._crypto_generichash_update=d.asm.sa).apply(null,arguments)},d._crypto_generichash_final=function(){return(d._crypto_generichash_final=d.asm.ta).apply(null,arguments)},d._crypto_generichash_keygen=function(){return(d._crypto_generichash_keygen=d.asm.ua).apply(null,arguments)},d._crypto_hash_bytes=function(){return(d._crypto_hash_bytes=d.asm.va).apply(null,arguments)},d._crypto_hash=function(){return(d._crypto_hash=d.asm.wa).apply(null,arguments)},d._crypto_kdf_bytes_min=function(){return(d._crypto_kdf_bytes_min=d.asm.xa).apply(null,arguments)},d._crypto_kdf_bytes_max=function(){return(d._crypto_kdf_bytes_max=d.asm.ya).apply(null,arguments)},d._crypto_kdf_contextbytes=function(){return(d._crypto_kdf_contextbytes=d.asm.za).apply(null,arguments)},d._crypto_kdf_keybytes=function(){return(d._crypto_kdf_keybytes=d.asm.Aa).apply(null,arguments)},d._crypto_kdf_derive_from_key=function(){return(d._crypto_kdf_derive_from_key=d.asm.Ba).apply(null,arguments)},d._crypto_kdf_keygen=function(){return(d._crypto_kdf_keygen=d.asm.Ca).apply(null,arguments)},d._crypto_kx_seed_keypair=function(){return(d._crypto_kx_seed_keypair=d.asm.Da).apply(null,arguments)},d._crypto_kx_keypair=function(){return(d._crypto_kx_keypair=d.asm.Ea).apply(null,arguments)},d._crypto_kx_client_session_keys=function(){return(d._crypto_kx_client_session_keys=d.asm.Fa).apply(null,arguments)},d._crypto_kx_server_session_keys=function(){return(d._crypto_kx_server_session_keys=d.asm.Ga).apply(null,arguments)},d._crypto_kx_publickeybytes=function(){return(d._crypto_kx_publickeybytes=d.asm.Ha).apply(null,arguments)},d._crypto_kx_secretkeybytes=function(){return(d._crypto_kx_secretkeybytes=d.asm.Ia).apply(null,arguments)},d._crypto_kx_seedbytes=function(){return(d._crypto_kx_seedbytes=d.asm.Ja).apply(null,arguments)},d._crypto_kx_sessionkeybytes=function(){return(d._crypto_kx_sessionkeybytes=d.asm.Ka).apply(null,arguments)},d._crypto_pwhash_alg_argon2i13=function(){return(d._crypto_pwhash_alg_argon2i13=d.asm.La).apply(null,arguments)},d._crypto_pwhash_alg_argon2id13=function(){return(d._crypto_pwhash_alg_argon2id13=d.asm.Ma).apply(null,arguments)},d._crypto_pwhash_alg_default=function(){return(d._crypto_pwhash_alg_default=d.asm.Na).apply(null,arguments)},d._crypto_pwhash_bytes_min=function(){return(d._crypto_pwhash_bytes_min=d.asm.Oa).apply(null,arguments)},d._crypto_pwhash_bytes_max=function(){return(d._crypto_pwhash_bytes_max=d.asm.Pa).apply(null,arguments)},d._crypto_pwhash_passwd_min=function(){return(d._crypto_pwhash_passwd_min=d.asm.Qa).apply(null,arguments)},d._crypto_pwhash_passwd_max=function(){return(d._crypto_pwhash_passwd_max=d.asm.Ra).apply(null,arguments)},d._crypto_pwhash_saltbytes=function(){return(d._crypto_pwhash_saltbytes=d.asm.Sa).apply(null,arguments)},d._crypto_pwhash_strbytes=function(){return(d._crypto_pwhash_strbytes=d.asm.Ta).apply(null,arguments)},d._crypto_pwhash_strprefix=function(){return(d._crypto_pwhash_strprefix=d.asm.Ua).apply(null,arguments)},d._crypto_pwhash_opslimit_min=function(){return(d._crypto_pwhash_opslimit_min=d.asm.Va).apply(null,arguments)},d._crypto_pwhash_opslimit_max=function(){return(d._crypto_pwhash_opslimit_max=d.asm.Wa).apply(null,arguments)},d._crypto_pwhash_memlimit_min=function(){return(d._crypto_pwhash_memlimit_min=d.asm.Xa).apply(null,arguments)},d._crypto_pwhash_memlimit_max=function(){return(d._crypto_pwhash_memlimit_max=d.asm.Ya).apply(null,arguments)},d._crypto_pwhash_opslimit_interactive=function(){return(d._crypto_pwhash_opslimit_interactive=d.asm.Za).apply(null,arguments)},d._crypto_pwhash_memlimit_interactive=function(){return(d._crypto_pwhash_memlimit_interactive=d.asm._a).apply(null,arguments)},d._crypto_pwhash_opslimit_moderate=function(){return(d._crypto_pwhash_opslimit_moderate=d.asm.$a).apply(null,arguments)},d._crypto_pwhash_memlimit_moderate=function(){return(d._crypto_pwhash_memlimit_moderate=d.asm.ab).apply(null,arguments)},d._crypto_pwhash_opslimit_sensitive=function(){return(d._crypto_pwhash_opslimit_sensitive=d.asm.bb).apply(null,arguments)},d._crypto_pwhash_memlimit_sensitive=function(){return(d._crypto_pwhash_memlimit_sensitive=d.asm.cb).apply(null,arguments)},d._crypto_pwhash=function(){return(d._crypto_pwhash=d.asm.db).apply(null,arguments)},d._crypto_pwhash_str=function(){return(d._crypto_pwhash_str=d.asm.eb).apply(null,arguments)},d._crypto_pwhash_str_alg=function(){return(d._crypto_pwhash_str_alg=d.asm.fb).apply(null,arguments)},d._crypto_pwhash_str_verify=function(){return(d._crypto_pwhash_str_verify=d.asm.gb).apply(null,arguments)},d._crypto_pwhash_str_needs_rehash=function(){return(d._crypto_pwhash_str_needs_rehash=d.asm.hb).apply(null,arguments)},d._crypto_scalarmult_base=function(){return(d._crypto_scalarmult_base=d.asm.ib).apply(null,arguments)},d._crypto_scalarmult=function(){return(d._crypto_scalarmult=d.asm.jb).apply(null,arguments)},d._crypto_scalarmult_bytes=function(){return(d._crypto_scalarmult_bytes=d.asm.kb).apply(null,arguments)},d._crypto_scalarmult_scalarbytes=function(){return(d._crypto_scalarmult_scalarbytes=d.asm.lb).apply(null,arguments)},d._crypto_secretbox_keybytes=function(){return(d._crypto_secretbox_keybytes=d.asm.mb).apply(null,arguments)},d._crypto_secretbox_noncebytes=function(){return(d._crypto_secretbox_noncebytes=d.asm.nb).apply(null,arguments)},d._crypto_secretbox_macbytes=function(){return(d._crypto_secretbox_macbytes=d.asm.ob).apply(null,arguments)},d._crypto_secretbox_messagebytes_max=function(){return(d._crypto_secretbox_messagebytes_max=d.asm.pb).apply(null,arguments)},d._crypto_secretbox_keygen=function(){return(d._crypto_secretbox_keygen=d.asm.qb).apply(null,arguments)},d._crypto_secretbox_detached=function(){return(d._crypto_secretbox_detached=d.asm.rb).apply(null,arguments)},d._crypto_secretbox_easy=function(){return(d._crypto_secretbox_easy=d.asm.sb).apply(null,arguments)},d._crypto_secretbox_open_detached=function(){return(d._crypto_secretbox_open_detached=d.asm.tb).apply(null,arguments)},d._crypto_secretbox_open_easy=function(){return(d._crypto_secretbox_open_easy=d.asm.ub).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_keygen=function(){return(d._crypto_secretstream_xchacha20poly1305_keygen=d.asm.vb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_init_push=function(){return(d._crypto_secretstream_xchacha20poly1305_init_push=d.asm.wb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_init_pull=function(){return(d._crypto_secretstream_xchacha20poly1305_init_pull=d.asm.xb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_rekey=function(){return(d._crypto_secretstream_xchacha20poly1305_rekey=d.asm.yb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_push=function(){return(d._crypto_secretstream_xchacha20poly1305_push=d.asm.zb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_pull=function(){return(d._crypto_secretstream_xchacha20poly1305_pull=d.asm.Ab).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_statebytes=function(){return(d._crypto_secretstream_xchacha20poly1305_statebytes=d.asm.Bb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_abytes=function(){return(d._crypto_secretstream_xchacha20poly1305_abytes=d.asm.Cb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_headerbytes=function(){return(d._crypto_secretstream_xchacha20poly1305_headerbytes=d.asm.Db).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_keybytes=function(){return(d._crypto_secretstream_xchacha20poly1305_keybytes=d.asm.Eb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_messagebytes_max=function(){return(d._crypto_secretstream_xchacha20poly1305_messagebytes_max=d.asm.Fb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_tag_message=function(){return(d._crypto_secretstream_xchacha20poly1305_tag_message=d.asm.Gb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_tag_push=function(){return(d._crypto_secretstream_xchacha20poly1305_tag_push=d.asm.Hb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_tag_rekey=function(){return(d._crypto_secretstream_xchacha20poly1305_tag_rekey=d.asm.Ib).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_tag_final=function(){return(d._crypto_secretstream_xchacha20poly1305_tag_final=d.asm.Jb).apply(null,arguments)},d._crypto_shorthash_bytes=function(){return(d._crypto_shorthash_bytes=d.asm.Kb).apply(null,arguments)},d._crypto_shorthash_keybytes=function(){return(d._crypto_shorthash_keybytes=d.asm.Lb).apply(null,arguments)},d._crypto_shorthash=function(){return(d._crypto_shorthash=d.asm.Mb).apply(null,arguments)},d._crypto_shorthash_keygen=function(){return(d._crypto_shorthash_keygen=d.asm.Nb).apply(null,arguments)},d._crypto_sign_statebytes=function(){return(d._crypto_sign_statebytes=d.asm.Ob).apply(null,arguments)},d._crypto_sign_bytes=function(){return(d._crypto_sign_bytes=d.asm.Pb).apply(null,arguments)},d._crypto_sign_seedbytes=function(){return(d._crypto_sign_seedbytes=d.asm.Qb).apply(null,arguments)},d._crypto_sign_publickeybytes=function(){return(d._crypto_sign_publickeybytes=d.asm.Rb).apply(null,arguments)},d._crypto_sign_secretkeybytes=function(){return(d._crypto_sign_secretkeybytes=d.asm.Sb).apply(null,arguments)},d._crypto_sign_messagebytes_max=function(){return(d._crypto_sign_messagebytes_max=d.asm.Tb).apply(null,arguments)},d._crypto_sign_seed_keypair=function(){return(d._crypto_sign_seed_keypair=d.asm.Ub).apply(null,arguments)},d._crypto_sign_keypair=function(){return(d._crypto_sign_keypair=d.asm.Vb).apply(null,arguments)},d._crypto_sign=function(){return(d._crypto_sign=d.asm.Wb).apply(null,arguments)},d._crypto_sign_open=function(){return(d._crypto_sign_open=d.asm.Xb).apply(null,arguments)},d._crypto_sign_detached=function(){return(d._crypto_sign_detached=d.asm.Yb).apply(null,arguments)},d._crypto_sign_verify_detached=function(){return(d._crypto_sign_verify_detached=d.asm.Zb).apply(null,arguments)},d._crypto_sign_init=function(){return(d._crypto_sign_init=d.asm._b).apply(null,arguments)},d._crypto_sign_update=function(){return(d._crypto_sign_update=d.asm.$b).apply(null,arguments)},d._crypto_sign_final_create=function(){return(d._crypto_sign_final_create=d.asm.ac).apply(null,arguments)},d._crypto_sign_final_verify=function(){return(d._crypto_sign_final_verify=d.asm.bc).apply(null,arguments)},d._crypto_sign_ed25519_pk_to_curve25519=function(){return(d._crypto_sign_ed25519_pk_to_curve25519=d.asm.cc).apply(null,arguments)},d._crypto_sign_ed25519_sk_to_curve25519=function(){return(d._crypto_sign_ed25519_sk_to_curve25519=d.asm.dc).apply(null,arguments)},d._randombytes_random=function(){return(d._randombytes_random=d.asm.ec).apply(null,arguments)},d._randombytes_stir=function(){return(d._randombytes_stir=d.asm.fc).apply(null,arguments)},d._randombytes_uniform=function(){return(d._randombytes_uniform=d.asm.gc).apply(null,arguments)},d._randombytes_buf=function(){return(d._randombytes_buf=d.asm.hc).apply(null,arguments)},d._randombytes_buf_deterministic=function(){return(d._randombytes_buf_deterministic=d.asm.ic).apply(null,arguments)},d._randombytes_seedbytes=function(){return(d._randombytes_seedbytes=d.asm.jc).apply(null,arguments)},d._randombytes_close=function(){return(d._randombytes_close=d.asm.kc).apply(null,arguments)},d._randombytes=function(){return(d._randombytes=d.asm.lc).apply(null,arguments)},d._sodium_bin2hex=function(){return(d._sodium_bin2hex=d.asm.mc).apply(null,arguments)},d._sodium_hex2bin=function(){return(d._sodium_hex2bin=d.asm.nc).apply(null,arguments)},d._sodium_base64_encoded_len=function(){return(d._sodium_base64_encoded_len=d.asm.oc).apply(null,arguments)},d._sodium_bin2base64=function(){return(d._sodium_bin2base64=d.asm.pc).apply(null,arguments)},d._sodium_base642bin=function(){return(d._sodium_base642bin=d.asm.qc).apply(null,arguments)},d._sodium_init=function(){return(d._sodium_init=d.asm.rc).apply(null,arguments)},d._sodium_pad=function(){return(d._sodium_pad=d.asm.sc).apply(null,arguments)},d._sodium_unpad=function(){return(d._sodium_unpad=d.asm.tc).apply(null,arguments)},d._sodium_version_string=function(){return(d._sodium_version_string=d.asm.uc).apply(null,arguments)},d._sodium_library_version_major=function(){return(d._sodium_library_version_major=d.asm.vc).apply(null,arguments)},d._sodium_library_version_minor=function(){return(d._sodium_library_version_minor=d.asm.wc).apply(null,arguments)},d._sodium_library_minimal=function(){return(d._sodium_library_minimal=d.asm.xc).apply(null,arguments)},d._malloc=function(){return(d._malloc=d.asm.yc).apply(null,arguments)},d._free=function(){return(d._free=d.asm.zc).apply(null,arguments)},d.setValue=function(e,t,n="i8",r){switch("*"===n.charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":S[e>>0]=t;break;case"i16":E[e>>1]=t;break;case"i32":I[e>>2]=t;break;case"i64":K=[t>>>0,(V=t,+Math.abs(V)>=1?V>0?(0|Math.min(+Math.floor(V/4294967296),4294967295))>>>0:~~+Math.ceil((V-+(~~V>>>0))/4294967296)>>>0:0)],I[e>>2]=K[0],I[e+4>>2]=K[1];break;case"float":_[e>>2]=t;break;case"double":x[e>>3]=t;break;default:L("invalid type for setValue: "+n)}},d.getValue=function(e,t="i8",n){switch("*"===t.charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return S[e>>0];case"i16":return E[e>>1];case"i32":case"i64":return I[e>>2];case"float":return _[e>>2];case"double":return Number(x[e>>3]);default:L("invalid type for getValue: "+t)}return null},d.UTF8ToString=B,R=function e(){te||re(),te||(R=e)},d.run=re,d.preInit)for("function"==typeof d.preInit&&(d.preInit=[d.preInit]);d.preInit.length>0;)d.preInit.pop()();re()})).catch((function(){return o.useBackupModule()})),r},void 0===(i=r.apply(t,[t]))||(e.exports=i)},76635:function(e,t,n){var r;e=n.nmd(e),function(){var i,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",l=32,c=128,u=1/0,d=9007199254740991,h=NaN,p=4294967295,f=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",l],["partialRight",64],["rearg",256]],g="[object Arguments]",m="[object Array]",y="[object Boolean]",v="[object Date]",A="[object Error]",b="[object Function]",w="[object GeneratorFunction]",S="[object Map]",C="[object Number]",E="[object Object]",I="[object Promise]",_="[object RegExp]",x="[object Set]",P="[object String]",k="[object Symbol]",B="[object WeakMap]",O="[object ArrayBuffer]",N="[object DataView]",D="[object Float32Array]",j="[object Float64Array]",T="[object Int8Array]",M="[object Int16Array]",F="[object Int32Array]",R="[object Uint8Array]",L="[object Uint8ClampedArray]",Q="[object Uint16Array]",U="[object Uint32Array]",V=/\b__p \+= '';/g,K=/\b(__p \+=) '' \+/g,H=/(__e\(.*?\)|\b__t\)) \+\n'';/g,G=/&(?:amp|lt|gt|quot|#39);/g,Y=/[&<>"']/g,z=RegExp(G.source),Z=RegExp(Y.source),W=/<%-([\s\S]+?)%>/g,q=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(te.source),re=/^\s+/,ie=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,se=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,le=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,ue=/\\(\\)?/g,de=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,he=/\w*$/,pe=/^[-+]0x[0-9a-f]+$/i,fe=/^0b[01]+$/i,ge=/^\[object .+?Constructor\]$/,me=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,ve=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ae=/($^)/,be=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",Se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ce="\\u2700-\\u27bf",Ee="a-z\\xdf-\\xf6\\xf8-\\xff",Ie="A-Z\\xc0-\\xd6\\xd8-\\xde",_e="\\ufe0e\\ufe0f",xe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Pe="["+we+"]",ke="["+xe+"]",Be="["+Se+"]",Oe="\\d+",Ne="["+Ce+"]",De="["+Ee+"]",je="[^"+we+xe+Oe+Ce+Ee+Ie+"]",Te="\\ud83c[\\udffb-\\udfff]",Me="[^"+we+"]",Fe="(?:\\ud83c[\\udde6-\\uddff]){2}",Re="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+Ie+"]",Qe="\\u200d",Ue="(?:"+De+"|"+je+")",Ve="(?:"+Le+"|"+je+")",Ke="(?:['’](?:d|ll|m|re|s|t|ve))?",He="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ge="(?:"+Be+"|"+Te+")?",Ye="["+_e+"]?",ze=Ye+Ge+"(?:"+Qe+"(?:"+[Me,Fe,Re].join("|")+")"+Ye+Ge+")*",Ze="(?:"+[Ne,Fe,Re].join("|")+")"+ze,We="(?:"+[Me+Be+"?",Be,Fe,Re,Pe].join("|")+")",qe=RegExp("['’]","g"),Je=RegExp(Be,"g"),Xe=RegExp(Te+"(?="+Te+")|"+We+ze,"g"),$e=RegExp([Le+"?"+De+"+"+Ke+"(?="+[ke,Le,"$"].join("|")+")",Ve+"+"+He+"(?="+[ke,Le+Ue,"$"].join("|")+")",Le+"?"+Ue+"+"+Ke,Le+"+"+He,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Oe,Ze].join("|"),"g"),et=RegExp("["+Qe+we+Se+_e+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rt=-1,it={};it[D]=it[j]=it[T]=it[M]=it[F]=it[R]=it[L]=it[Q]=it[U]=!0,it[g]=it[m]=it[O]=it[y]=it[N]=it[v]=it[A]=it[b]=it[S]=it[C]=it[E]=it[_]=it[x]=it[P]=it[B]=!1;var ot={};ot[g]=ot[m]=ot[O]=ot[N]=ot[y]=ot[v]=ot[D]=ot[j]=ot[T]=ot[M]=ot[F]=ot[S]=ot[C]=ot[E]=ot[_]=ot[x]=ot[P]=ot[k]=ot[R]=ot[L]=ot[Q]=ot[U]=!0,ot[A]=ot[b]=ot[B]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},at=parseFloat,lt=parseInt,ct="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ut="object"==typeof self&&self&&self.Object===Object&&self,dt=ct||ut||Function("return this")(),ht=t&&!t.nodeType&&t,pt=ht&&e&&!e.nodeType&&e,ft=pt&&pt.exports===ht,gt=ft&&ct.process,mt=function(){try{return pt&&pt.require&&pt.require("util").types||gt&&gt.binding&&gt.binding("util")}catch(e){}}(),yt=mt&&mt.isArrayBuffer,vt=mt&&mt.isDate,At=mt&&mt.isMap,bt=mt&&mt.isRegExp,wt=mt&&mt.isSet,St=mt&&mt.isTypedArray;function Ct(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Et(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(r,s,n(s),e)}return r}function It(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function _t(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function xt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Pt(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function kt(e,t){return!(null==e||!e.length)&&Lt(e,t,0)>-1}function Bt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Ot(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Nt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Dt(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function jt(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Tt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Mt=Kt("length");function Ft(e,t,n){var r;return n(e,(function(e,n,i){if(t(e,n,i))return r=n,!1})),r}function Rt(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Lt(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):Rt(e,Ut,n)}function Qt(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function Ut(e){return e!=e}function Vt(e,t){var n=null==e?0:e.length;return n?Yt(e,t)/n:h}function Kt(e){return function(t){return null==t?i:t[e]}}function Ht(e){return function(t){return null==e?i:e[t]}}function Gt(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}function Yt(e,t){for(var n,r=-1,o=e.length;++r<o;){var s=t(e[r]);s!==i&&(n=n===i?s:n+s)}return n}function zt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Zt(e){return e?e.slice(0,hn(e)+1).replace(re,""):e}function Wt(e){return function(t){return e(t)}}function qt(e,t){return Ot(t,(function(t){return e[t]}))}function Jt(e,t){return e.has(t)}function Xt(e,t){for(var n=-1,r=e.length;++n<r&&Lt(t,e[n],0)>-1;);return n}function $t(e,t){for(var n=e.length;n--&&Lt(t,e[n],0)>-1;);return n}var en=Ht({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tn=Ht({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function nn(e){return"\\"+st[e]}function rn(e){return et.test(e)}function on(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function sn(e,t){return function(n){return e(t(n))}}function an(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n];s!==t&&s!==a||(e[n]=a,o[i++]=n)}return o}function ln(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function cn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function un(e){return rn(e)?function(e){for(var t=Xe.lastIndex=0;Xe.test(e);)++t;return t}(e):Mt(e)}function dn(e){return rn(e)?function(e){return e.match(Xe)||[]}(e):function(e){return e.split("")}(e)}function hn(e){for(var t=e.length;t--&&ie.test(e.charAt(t)););return t}var pn=Ht({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),fn=function e(t){var n,r=(t=null==t?dt:fn.defaults(dt.Object(),t,fn.pick(dt,nt))).Array,ie=t.Date,we=t.Error,Se=t.Function,Ce=t.Math,Ee=t.Object,Ie=t.RegExp,_e=t.String,xe=t.TypeError,Pe=r.prototype,ke=Se.prototype,Be=Ee.prototype,Oe=t["__core-js_shared__"],Ne=ke.toString,De=Be.hasOwnProperty,je=0,Te=(n=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Me=Be.toString,Fe=Ne.call(Ee),Re=dt._,Le=Ie("^"+Ne.call(De).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Qe=ft?t.Buffer:i,Ue=t.Symbol,Ve=t.Uint8Array,Ke=Qe?Qe.allocUnsafe:i,He=sn(Ee.getPrototypeOf,Ee),Ge=Ee.create,Ye=Be.propertyIsEnumerable,ze=Pe.splice,Ze=Ue?Ue.isConcatSpreadable:i,We=Ue?Ue.iterator:i,Xe=Ue?Ue.toStringTag:i,et=function(){try{var e=lo(Ee,"defineProperty");return e({},"",{}),e}catch(e){}}(),st=t.clearTimeout!==dt.clearTimeout&&t.clearTimeout,ct=ie&&ie.now!==dt.Date.now&&ie.now,ut=t.setTimeout!==dt.setTimeout&&t.setTimeout,ht=Ce.ceil,pt=Ce.floor,gt=Ee.getOwnPropertySymbols,mt=Qe?Qe.isBuffer:i,Mt=t.isFinite,Ht=Pe.join,gn=sn(Ee.keys,Ee),mn=Ce.max,yn=Ce.min,vn=ie.now,An=t.parseInt,bn=Ce.random,wn=Pe.reverse,Sn=lo(t,"DataView"),Cn=lo(t,"Map"),En=lo(t,"Promise"),In=lo(t,"Set"),_n=lo(t,"WeakMap"),xn=lo(Ee,"create"),Pn=_n&&new _n,kn={},Bn=Fo(Sn),On=Fo(Cn),Nn=Fo(En),Dn=Fo(In),jn=Fo(_n),Tn=Ue?Ue.prototype:i,Mn=Tn?Tn.valueOf:i,Fn=Tn?Tn.toString:i;function Rn(e){if(ea(e)&&!Ks(e)&&!(e instanceof Vn)){if(e instanceof Un)return e;if(De.call(e,"__wrapped__"))return Ro(e)}return new Un(e)}var Ln=function(){function e(){}return function(t){if(!$s(t))return{};if(Ge)return Ge(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Qn(){}function Un(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Vn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=p,this.__views__=[]}function Kn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Hn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Gn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Yn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Gn;++t<n;)this.add(e[t])}function zn(e){var t=this.__data__=new Hn(e);this.size=t.size}function Zn(e,t){var n=Ks(e),r=!n&&Vs(e),i=!n&&!r&&zs(e),o=!n&&!r&&!i&&la(e),s=n||r||i||o,a=s?zt(e.length,_e):[],l=a.length;for(var c in e)!t&&!De.call(e,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||mo(c,l))||a.push(c);return a}function Wn(e){var t=e.length;return t?e[Gr(0,t-1)]:i}function qn(e,t){return No(_i(e),or(t,0,e.length))}function Jn(e){return No(_i(e))}function Xn(e,t,n){(n!==i&&!Ls(e[t],n)||n===i&&!(t in e))&&rr(e,t,n)}function $n(e,t,n){var r=e[t];De.call(e,t)&&Ls(r,n)&&(n!==i||t in e)||rr(e,t,n)}function er(e,t){for(var n=e.length;n--;)if(Ls(e[n][0],t))return n;return-1}function tr(e,t,n,r){return ur(e,(function(e,i,o){t(r,e,n(e),o)})),r}function nr(e,t){return e&&xi(t,Ba(t),e)}function rr(e,t,n){"__proto__"==t&&et?et(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ir(e,t){for(var n=-1,o=t.length,s=r(o),a=null==e;++n<o;)s[n]=a?i:Ia(e,t[n]);return s}function or(e,t,n){return e==e&&(n!==i&&(e=e<=n?e:n),t!==i&&(e=e>=t?e:t)),e}function sr(e,t,n,r,o,s){var a,l=1&t,c=2&t,u=4&t;if(n&&(a=o?n(e,r,o,s):n(e)),a!==i)return a;if(!$s(e))return e;var d=Ks(e);if(d){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&De.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!l)return _i(e,a)}else{var h=ho(e),p=h==b||h==w;if(zs(e))return bi(e,l);if(h==E||h==g||p&&!o){if(a=c||p?{}:fo(e),!l)return c?function(e,t){return xi(e,uo(e),t)}(e,function(e,t){return e&&xi(t,Oa(t),e)}(a,e)):function(e,t){return xi(e,co(e),t)}(e,nr(a,e))}else{if(!ot[h])return o?e:{};a=function(e,t,n){var r,i=e.constructor;switch(t){case O:return wi(e);case y:case v:return new i(+e);case N:return function(e,t){var n=t?wi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case D:case j:case T:case M:case F:case R:case L:case Q:case U:return Si(e,n);case S:return new i;case C:case P:return new i(e);case _:return function(e){var t=new e.constructor(e.source,he.exec(e));return t.lastIndex=e.lastIndex,t}(e);case x:return new i;case k:return r=e,Mn?Ee(Mn.call(r)):{}}}(e,h,l)}}s||(s=new zn);var f=s.get(e);if(f)return f;s.set(e,a),oa(e)?e.forEach((function(r){a.add(sr(r,t,n,r,e,s))})):ta(e)&&e.forEach((function(r,i){a.set(i,sr(r,t,n,i,e,s))}));var m=d?i:(u?c?to:eo:c?Oa:Ba)(e);return It(m||e,(function(r,i){m&&(r=e[i=r]),$n(a,i,sr(r,t,n,i,e,s))})),a}function ar(e,t,n){var r=n.length;if(null==e)return!r;for(e=Ee(e);r--;){var o=n[r],s=t[o],a=e[o];if(a===i&&!(o in e)||!s(a))return!1}return!0}function lr(e,t,n){if("function"!=typeof e)throw new xe(o);return Po((function(){e.apply(i,n)}),t)}function cr(e,t,n,r){var i=-1,o=kt,s=!0,a=e.length,l=[],c=t.length;if(!a)return l;n&&(t=Ot(t,Wt(n))),r?(o=Bt,s=!1):t.length>=200&&(o=Jt,s=!1,t=new Yn(t));e:for(;++i<a;){var u=e[i],d=null==n?u:n(u);if(u=r||0!==u?u:0,s&&d==d){for(var h=c;h--;)if(t[h]===d)continue e;l.push(u)}else o(t,d,r)||l.push(u)}return l}Rn.templateSettings={escape:W,evaluate:q,interpolate:J,variable:"",imports:{_:Rn}},Rn.prototype=Qn.prototype,Rn.prototype.constructor=Rn,Un.prototype=Ln(Qn.prototype),Un.prototype.constructor=Un,Vn.prototype=Ln(Qn.prototype),Vn.prototype.constructor=Vn,Kn.prototype.clear=function(){this.__data__=xn?xn(null):{},this.size=0},Kn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Kn.prototype.get=function(e){var t=this.__data__;if(xn){var n=t[e];return n===s?i:n}return De.call(t,e)?t[e]:i},Kn.prototype.has=function(e){var t=this.__data__;return xn?t[e]!==i:De.call(t,e)},Kn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=xn&&t===i?s:t,this},Hn.prototype.clear=function(){this.__data__=[],this.size=0},Hn.prototype.delete=function(e){var t=this.__data__,n=er(t,e);return!(n<0||(n==t.length-1?t.pop():ze.call(t,n,1),--this.size,0))},Hn.prototype.get=function(e){var t=this.__data__,n=er(t,e);return n<0?i:t[n][1]},Hn.prototype.has=function(e){return er(this.__data__,e)>-1},Hn.prototype.set=function(e,t){var n=this.__data__,r=er(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Gn.prototype.clear=function(){this.size=0,this.__data__={hash:new Kn,map:new(Cn||Hn),string:new Kn}},Gn.prototype.delete=function(e){var t=so(this,e).delete(e);return this.size-=t?1:0,t},Gn.prototype.get=function(e){return so(this,e).get(e)},Gn.prototype.has=function(e){return so(this,e).has(e)},Gn.prototype.set=function(e,t){var n=so(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Yn.prototype.add=Yn.prototype.push=function(e){return this.__data__.set(e,s),this},Yn.prototype.has=function(e){return this.__data__.has(e)},zn.prototype.clear=function(){this.__data__=new Hn,this.size=0},zn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},zn.prototype.get=function(e){return this.__data__.get(e)},zn.prototype.has=function(e){return this.__data__.has(e)},zn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Hn){var r=n.__data__;if(!Cn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Gn(r)}return n.set(e,t),this.size=n.size,this};var ur=Bi(vr),dr=Bi(Ar,!0);function hr(e,t){var n=!0;return ur(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function pr(e,t,n){for(var r=-1,o=e.length;++r<o;){var s=e[r],a=t(s);if(null!=a&&(l===i?a==a&&!aa(a):n(a,l)))var l=a,c=s}return c}function fr(e,t){var n=[];return ur(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}function gr(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=go),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?gr(a,t-1,n,r,i):Nt(i,a):r||(i[i.length]=a)}return i}var mr=Oi(),yr=Oi(!0);function vr(e,t){return e&&mr(e,t,Ba)}function Ar(e,t){return e&&yr(e,t,Ba)}function br(e,t){return Pt(t,(function(t){return qs(e[t])}))}function wr(e,t){for(var n=0,r=(t=mi(t,e)).length;null!=e&&n<r;)e=e[Mo(t[n++])];return n&&n==r?e:i}function Sr(e,t,n){var r=t(e);return Ks(e)?r:Nt(r,n(e))}function Cr(e){return null==e?e===i?"[object Undefined]":"[object Null]":Xe&&Xe in Ee(e)?function(e){var t=De.call(e,Xe),n=e[Xe];try{e[Xe]=i;var r=!0}catch(e){}var o=Me.call(e);return r&&(t?e[Xe]=n:delete e[Xe]),o}(e):function(e){return Me.call(e)}(e)}function Er(e,t){return e>t}function Ir(e,t){return null!=e&&De.call(e,t)}function _r(e,t){return null!=e&&t in Ee(e)}function xr(e,t,n){for(var o=n?Bt:kt,s=e[0].length,a=e.length,l=a,c=r(a),u=1/0,d=[];l--;){var h=e[l];l&&t&&(h=Ot(h,Wt(t))),u=yn(h.length,u),c[l]=!n&&(t||s>=120&&h.length>=120)?new Yn(l&&h):i}h=e[0];var p=-1,f=c[0];e:for(;++p<s&&d.length<u;){var g=h[p],m=t?t(g):g;if(g=n||0!==g?g:0,!(f?Jt(f,m):o(d,m,n))){for(l=a;--l;){var y=c[l];if(!(y?Jt(y,m):o(e[l],m,n)))continue e}f&&f.push(m),d.push(g)}}return d}function Pr(e,t,n){var r=null==(e=Io(e,t=mi(t,e)))?e:e[Mo(Wo(t))];return null==r?i:Ct(r,e,n)}function kr(e){return ea(e)&&Cr(e)==g}function Br(e,t,n,r,o){return e===t||(null==e||null==t||!ea(e)&&!ea(t)?e!=e&&t!=t:function(e,t,n,r,o,s){var a=Ks(e),l=Ks(t),c=a?m:ho(e),u=l?m:ho(t),d=(c=c==g?E:c)==E,h=(u=u==g?E:u)==E,p=c==u;if(p&&zs(e)){if(!zs(t))return!1;a=!0,d=!1}if(p&&!d)return s||(s=new zn),a||la(e)?Xi(e,t,n,r,o,s):function(e,t,n,r,i,o,s){switch(n){case N:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case O:return!(e.byteLength!=t.byteLength||!o(new Ve(e),new Ve(t)));case y:case v:case C:return Ls(+e,+t);case A:return e.name==t.name&&e.message==t.message;case _:case P:return e==t+"";case S:var a=on;case x:var l=1&r;if(a||(a=ln),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=2,s.set(e,t);var u=Xi(a(e),a(t),r,i,o,s);return s.delete(e),u;case k:if(Mn)return Mn.call(e)==Mn.call(t)}return!1}(e,t,c,n,r,o,s);if(!(1&n)){var f=d&&De.call(e,"__wrapped__"),b=h&&De.call(t,"__wrapped__");if(f||b){var w=f?e.value():e,I=b?t.value():t;return s||(s=new zn),o(w,I,n,r,s)}}return!!p&&(s||(s=new zn),function(e,t,n,r,o,s){var a=1&n,l=eo(e),c=l.length;if(c!=eo(t).length&&!a)return!1;for(var u=c;u--;){var d=l[u];if(!(a?d in t:De.call(t,d)))return!1}var h=s.get(e),p=s.get(t);if(h&&p)return h==t&&p==e;var f=!0;s.set(e,t),s.set(t,e);for(var g=a;++u<c;){var m=e[d=l[u]],y=t[d];if(r)var v=a?r(y,m,d,t,e,s):r(m,y,d,e,t,s);if(!(v===i?m===y||o(m,y,n,r,s):v)){f=!1;break}g||(g="constructor"==d)}if(f&&!g){var A=e.constructor,b=t.constructor;A==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof A&&A instanceof A&&"function"==typeof b&&b instanceof b||(f=!1)}return s.delete(e),s.delete(t),f}(e,t,n,r,o,s))}(e,t,n,r,Br,o))}function Or(e,t,n,r){var o=n.length,s=o,a=!r;if(null==e)return!s;for(e=Ee(e);o--;){var l=n[o];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<s;){var c=(l=n[o])[0],u=e[c],d=l[1];if(a&&l[2]){if(u===i&&!(c in e))return!1}else{var h=new zn;if(r)var p=r(u,d,c,e,t,h);if(!(p===i?Br(d,u,3,r,h):p))return!1}}return!0}function Nr(e){return!(!$s(e)||(t=e,Te&&Te in t))&&(qs(e)?Le:ge).test(Fo(e));var t}function Dr(e){return"function"==typeof e?e:null==e?nl:"object"==typeof e?Ks(e)?Rr(e[0],e[1]):Fr(e):dl(e)}function jr(e){if(!wo(e))return gn(e);var t=[];for(var n in Ee(e))De.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Tr(e,t){return e<t}function Mr(e,t){var n=-1,i=Gs(e)?r(e.length):[];return ur(e,(function(e,r,o){i[++n]=t(e,r,o)})),i}function Fr(e){var t=ao(e);return 1==t.length&&t[0][2]?Co(t[0][0],t[0][1]):function(n){return n===e||Or(n,e,t)}}function Rr(e,t){return vo(e)&&So(t)?Co(Mo(e),t):function(n){var r=Ia(n,e);return r===i&&r===t?_a(n,e):Br(t,r,3)}}function Lr(e,t,n,r,o){e!==t&&mr(t,(function(s,a){if(o||(o=new zn),$s(s))!function(e,t,n,r,o,s,a){var l=_o(e,n),c=_o(t,n),u=a.get(c);if(u)Xn(e,n,u);else{var d=s?s(l,c,n+"",e,t,a):i,h=d===i;if(h){var p=Ks(c),f=!p&&zs(c),g=!p&&!f&&la(c);d=c,p||f||g?Ks(l)?d=l:Ys(l)?d=_i(l):f?(h=!1,d=bi(c,!0)):g?(h=!1,d=Si(c,!0)):d=[]:ra(c)||Vs(c)?(d=l,Vs(l)?d=ma(l):$s(l)&&!qs(l)||(d=fo(c))):h=!1}h&&(a.set(c,d),o(d,c,r,s,a),a.delete(c)),Xn(e,n,d)}}(e,t,a,n,Lr,r,o);else{var l=r?r(_o(e,a),s,a+"",e,t,o):i;l===i&&(l=s),Xn(e,a,l)}}),Oa)}function Qr(e,t){var n=e.length;if(n)return mo(t+=t<0?n:0,n)?e[t]:i}function Ur(e,t,n){t=t.length?Ot(t,(function(e){return Ks(e)?function(t){return wr(t,1===e.length?e[0]:e)}:e})):[nl];var r=-1;t=Ot(t,Wt(oo()));var i=Mr(e,(function(e,n,i){var o=Ot(t,(function(t){return t(e)}));return{criteria:o,index:++r,value:e}}));return function(e,t){var r=e.length;for(e.sort((function(e,t){return function(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,s=i.length,a=n.length;++r<s;){var l=Ci(i[r],o[r]);if(l)return r>=a?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}));r--;)e[r]=e[r].value;return e}(i)}function Vr(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var s=t[r],a=wr(e,s);n(a,s)&&qr(o,mi(s,e),a)}return o}function Kr(e,t,n,r){var i=r?Qt:Lt,o=-1,s=t.length,a=e;for(e===t&&(t=_i(t)),n&&(a=Ot(e,Wt(n)));++o<s;)for(var l=0,c=t[o],u=n?n(c):c;(l=i(a,u,l,r))>-1;)a!==e&&ze.call(a,l,1),ze.call(e,l,1);return e}function Hr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;mo(i)?ze.call(e,i,1):li(e,i)}}return e}function Gr(e,t){return e+pt(bn()*(t-e+1))}function Yr(e,t){var n="";if(!e||t<1||t>d)return n;do{t%2&&(n+=e),(t=pt(t/2))&&(e+=e)}while(t);return n}function zr(e,t){return ko(Eo(e,t,nl),e+"")}function Zr(e){return Wn(La(e))}function Wr(e,t){var n=La(e);return No(n,or(t,0,n.length))}function qr(e,t,n,r){if(!$s(e))return e;for(var o=-1,s=(t=mi(t,e)).length,a=s-1,l=e;null!=l&&++o<s;){var c=Mo(t[o]),u=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var d=l[c];(u=r?r(d,c,l):i)===i&&(u=$s(d)?d:mo(t[o+1])?[]:{})}$n(l,c,u),l=l[c]}return e}var Jr=Pn?function(e,t){return Pn.set(e,t),e}:nl,Xr=et?function(e,t){return et(e,"toString",{configurable:!0,enumerable:!1,value:$a(t),writable:!0})}:nl;function $r(e){return No(La(e))}function ei(e,t,n){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var s=r(o);++i<o;)s[i]=e[i+t];return s}function ti(e,t){var n;return ur(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n}function ni(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var o=r+i>>>1,s=e[o];null!==s&&!aa(s)&&(n?s<=t:s<t)?r=o+1:i=o}return i}return ri(e,t,nl,n)}function ri(e,t,n,r){var o=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(t=n(t))!=t,l=null===t,c=aa(t),u=t===i;o<s;){var d=pt((o+s)/2),h=n(e[d]),p=h!==i,f=null===h,g=h==h,m=aa(h);if(a)var y=r||g;else y=u?g&&(r||p):l?g&&p&&(r||!f):c?g&&p&&!f&&(r||!m):!f&&!m&&(r?h<=t:h<t);y?o=d+1:s=d}return yn(s,4294967294)}function ii(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n],a=t?t(s):s;if(!n||!Ls(a,l)){var l=a;o[i++]=0===s?0:s}}return o}function oi(e){return"number"==typeof e?e:aa(e)?h:+e}function si(e){if("string"==typeof e)return e;if(Ks(e))return Ot(e,si)+"";if(aa(e))return Fn?Fn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ai(e,t,n){var r=-1,i=kt,o=e.length,s=!0,a=[],l=a;if(n)s=!1,i=Bt;else if(o>=200){var c=t?null:Yi(e);if(c)return ln(c);s=!1,i=Jt,l=new Yn}else l=t?[]:a;e:for(;++r<o;){var u=e[r],d=t?t(u):u;if(u=n||0!==u?u:0,s&&d==d){for(var h=l.length;h--;)if(l[h]===d)continue e;t&&l.push(d),a.push(u)}else i(l,d,n)||(l!==a&&l.push(d),a.push(u))}return a}function li(e,t){return null==(e=Io(e,t=mi(t,e)))||delete e[Mo(Wo(t))]}function ci(e,t,n,r){return qr(e,t,n(wr(e,t)),r)}function ui(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?ei(e,r?0:o,r?o+1:i):ei(e,r?o+1:0,r?i:o)}function di(e,t){var n=e;return n instanceof Vn&&(n=n.value()),Dt(t,(function(e,t){return t.func.apply(t.thisArg,Nt([e],t.args))}),n)}function hi(e,t,n){var i=e.length;if(i<2)return i?ai(e[0]):[];for(var o=-1,s=r(i);++o<i;)for(var a=e[o],l=-1;++l<i;)l!=o&&(s[o]=cr(s[o]||a,e[l],t,n));return ai(gr(s,1),t,n)}function pi(e,t,n){for(var r=-1,o=e.length,s=t.length,a={};++r<o;){var l=r<s?t[r]:i;n(a,e[r],l)}return a}function fi(e){return Ys(e)?e:[]}function gi(e){return"function"==typeof e?e:nl}function mi(e,t){return Ks(e)?e:vo(e,t)?[e]:To(ya(e))}var yi=zr;function vi(e,t,n){var r=e.length;return n=n===i?r:n,!t&&n>=r?e:ei(e,t,n)}var Ai=st||function(e){return dt.clearTimeout(e)};function bi(e,t){if(t)return e.slice();var n=e.length,r=Ke?Ke(n):new e.constructor(n);return e.copy(r),r}function wi(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function Si(e,t){var n=t?wi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ci(e,t){if(e!==t){var n=e!==i,r=null===e,o=e==e,s=aa(e),a=t!==i,l=null===t,c=t==t,u=aa(t);if(!l&&!u&&!s&&e>t||s&&a&&c&&!l&&!u||r&&a&&c||!n&&c||!o)return 1;if(!r&&!s&&!u&&e<t||u&&n&&o&&!r&&!s||l&&n&&o||!a&&o||!c)return-1}return 0}function Ei(e,t,n,i){for(var o=-1,s=e.length,a=n.length,l=-1,c=t.length,u=mn(s-a,0),d=r(c+u),h=!i;++l<c;)d[l]=t[l];for(;++o<a;)(h||o<s)&&(d[n[o]]=e[o]);for(;u--;)d[l++]=e[o++];return d}function Ii(e,t,n,i){for(var o=-1,s=e.length,a=-1,l=n.length,c=-1,u=t.length,d=mn(s-l,0),h=r(d+u),p=!i;++o<d;)h[o]=e[o];for(var f=o;++c<u;)h[f+c]=t[c];for(;++a<l;)(p||o<s)&&(h[f+n[a]]=e[o++]);return h}function _i(e,t){var n=-1,i=e.length;for(t||(t=r(i));++n<i;)t[n]=e[n];return t}function xi(e,t,n,r){var o=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var l=t[s],c=r?r(n[l],e[l],l,n,e):i;c===i&&(c=e[l]),o?rr(n,l,c):$n(n,l,c)}return n}function Pi(e,t){return function(n,r){var i=Ks(n)?Et:tr,o=t?t():{};return i(n,e,oo(r,2),o)}}function ki(e){return zr((function(t,n){var r=-1,o=n.length,s=o>1?n[o-1]:i,a=o>2?n[2]:i;for(s=e.length>3&&"function"==typeof s?(o--,s):i,a&&yo(n[0],n[1],a)&&(s=o<3?i:s,o=1),t=Ee(t);++r<o;){var l=n[r];l&&e(t,l,r,s)}return t}))}function Bi(e,t){return function(n,r){if(null==n)return n;if(!Gs(n))return e(n,r);for(var i=n.length,o=t?i:-1,s=Ee(n);(t?o--:++o<i)&&!1!==r(s[o],o,s););return n}}function Oi(e){return function(t,n,r){for(var i=-1,o=Ee(t),s=r(t),a=s.length;a--;){var l=s[e?a:++i];if(!1===n(o[l],l,o))break}return t}}function Ni(e){return function(t){var n=rn(t=ya(t))?dn(t):i,r=n?n[0]:t.charAt(0),o=n?vi(n,1).join(""):t.slice(1);return r[e]()+o}}function Di(e){return function(t){return Dt(qa(Va(t).replace(qe,"")),e,"")}}function ji(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Ln(e.prototype),r=e.apply(n,t);return $s(r)?r:n}}function Ti(e){return function(t,n,r){var o=Ee(t);if(!Gs(t)){var s=oo(n,3);t=Ba(t),n=function(e){return s(o[e],e,o)}}var a=e(t,n,r);return a>-1?o[s?t[a]:a]:i}}function Mi(e){return $i((function(t){var n=t.length,r=n,s=Un.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new xe(o);if(s&&!l&&"wrapper"==ro(a))var l=new Un([],!0)}for(r=l?r:n;++r<n;){var c=ro(a=t[r]),u="wrapper"==c?no(a):i;l=u&&Ao(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[ro(u[0])].apply(l,u[3]):1==a.length&&Ao(a)?l[c]():l.thru(a)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&Ks(r))return l.plant(r).value();for(var i=0,o=n?t[i].apply(this,e):r;++i<n;)o=t[i].call(this,o);return o}}))}function Fi(e,t,n,o,s,a,l,u,d,h){var p=t&c,f=1&t,g=2&t,m=24&t,y=512&t,v=g?i:ji(e);return function c(){for(var A=arguments.length,b=r(A),w=A;w--;)b[w]=arguments[w];if(m)var S=io(c),C=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(b,S);if(o&&(b=Ei(b,o,s,m)),a&&(b=Ii(b,a,l,m)),A-=C,m&&A<h){var E=an(b,S);return Hi(e,t,Fi,c.placeholder,n,b,E,u,d,h-A)}var I=f?n:this,_=g?I[e]:e;return A=b.length,u?b=function(e,t){for(var n=e.length,r=yn(t.length,n),o=_i(e);r--;){var s=t[r];e[r]=mo(s,n)?o[s]:i}return e}(b,u):y&&A>1&&b.reverse(),p&&d<A&&(b.length=d),this&&this!==dt&&this instanceof c&&(_=v||ji(_)),_.apply(I,b)}}function Ri(e,t){return function(n,r){return function(e,t,n,r){return vr(e,(function(e,i,o){t(r,n(e),i,o)})),r}(n,e,t(r),{})}}function Li(e,t){return function(n,r){var o;if(n===i&&r===i)return t;if(n!==i&&(o=n),r!==i){if(o===i)return r;"string"==typeof n||"string"==typeof r?(n=si(n),r=si(r)):(n=oi(n),r=oi(r)),o=e(n,r)}return o}}function Qi(e){return $i((function(t){return t=Ot(t,Wt(oo())),zr((function(n){var r=this;return e(t,(function(e){return Ct(e,r,n)}))}))}))}function Ui(e,t){var n=(t=t===i?" ":si(t)).length;if(n<2)return n?Yr(t,e):t;var r=Yr(t,ht(e/un(t)));return rn(t)?vi(dn(r),0,e).join(""):r.slice(0,e)}function Vi(e){return function(t,n,o){return o&&"number"!=typeof o&&yo(t,n,o)&&(n=o=i),t=ha(t),n===i?(n=t,t=0):n=ha(n),function(e,t,n,i){for(var o=-1,s=mn(ht((t-e)/(n||1)),0),a=r(s);s--;)a[i?s:++o]=e,e+=n;return a}(t,n,o=o===i?t<n?1:-1:ha(o),e)}}function Ki(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ga(t),n=ga(n)),e(t,n)}}function Hi(e,t,n,r,o,s,a,c,u,d){var h=8&t;t|=h?l:64,4&(t&=~(h?64:l))||(t&=-4);var p=[e,t,o,h?s:i,h?a:i,h?i:s,h?i:a,c,u,d],f=n.apply(i,p);return Ao(e)&&xo(f,p),f.placeholder=r,Bo(f,e,t)}function Gi(e){var t=Ce[e];return function(e,n){if(e=ga(e),(n=null==n?0:yn(pa(n),292))&&Mt(e)){var r=(ya(e)+"e").split("e");return+((r=(ya(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Yi=In&&1/ln(new In([,-0]))[1]==u?function(e){return new In(e)}:al;function zi(e){return function(t){var n=ho(t);return n==S?on(t):n==x?cn(t):function(e,t){return Ot(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Zi(e,t,n,s,u,d,h,p){var f=2&t;if(!f&&"function"!=typeof e)throw new xe(o);var g=s?s.length:0;if(g||(t&=-97,s=u=i),h=h===i?h:mn(pa(h),0),p=p===i?p:pa(p),g-=u?u.length:0,64&t){var m=s,y=u;s=u=i}var v=f?i:no(e),A=[e,t,n,s,u,m,y,d,h,p];if(v&&function(e,t){var n=e[1],r=t[1],i=n|r,o=i<131,s=r==c&&8==n||r==c&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!o&&!s)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var l=t[3];if(l){var u=e[3];e[3]=u?Ei(u,l,t[4]):l,e[4]=u?an(e[3],a):t[4]}(l=t[5])&&(u=e[5],e[5]=u?Ii(u,l,t[6]):l,e[6]=u?an(e[5],a):t[6]),(l=t[7])&&(e[7]=l),r&c&&(e[8]=null==e[8]?t[8]:yn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(A,v),e=A[0],t=A[1],n=A[2],s=A[3],u=A[4],!(p=A[9]=A[9]===i?f?0:e.length:mn(A[9]-g,0))&&24&t&&(t&=-25),t&&1!=t)b=8==t||16==t?function(e,t,n){var o=ji(e);return function s(){for(var a=arguments.length,l=r(a),c=a,u=io(s);c--;)l[c]=arguments[c];var d=a<3&&l[0]!==u&&l[a-1]!==u?[]:an(l,u);return(a-=d.length)<n?Hi(e,t,Fi,s.placeholder,i,l,d,i,i,n-a):Ct(this&&this!==dt&&this instanceof s?o:e,this,l)}}(e,t,p):t!=l&&33!=t||u.length?Fi.apply(i,A):function(e,t,n,i){var o=1&t,s=ji(e);return function t(){for(var a=-1,l=arguments.length,c=-1,u=i.length,d=r(u+l),h=this&&this!==dt&&this instanceof t?s:e;++c<u;)d[c]=i[c];for(;l--;)d[c++]=arguments[++a];return Ct(h,o?n:this,d)}}(e,t,n,s);else var b=function(e,t,n){var r=1&t,i=ji(e);return function t(){return(this&&this!==dt&&this instanceof t?i:e).apply(r?n:this,arguments)}}(e,t,n);return Bo((v?Jr:xo)(b,A),e,t)}function Wi(e,t,n,r){return e===i||Ls(e,Be[n])&&!De.call(r,n)?t:e}function qi(e,t,n,r,o,s){return $s(e)&&$s(t)&&(s.set(t,e),Lr(e,t,i,qi,s),s.delete(t)),e}function Ji(e){return ra(e)?i:e}function Xi(e,t,n,r,o,s){var a=1&n,l=e.length,c=t.length;if(l!=c&&!(a&&c>l))return!1;var u=s.get(e),d=s.get(t);if(u&&d)return u==t&&d==e;var h=-1,p=!0,f=2&n?new Yn:i;for(s.set(e,t),s.set(t,e);++h<l;){var g=e[h],m=t[h];if(r)var y=a?r(m,g,h,t,e,s):r(g,m,h,e,t,s);if(y!==i){if(y)continue;p=!1;break}if(f){if(!Tt(t,(function(e,t){if(!Jt(f,t)&&(g===e||o(g,e,n,r,s)))return f.push(t)}))){p=!1;break}}else if(g!==m&&!o(g,m,n,r,s)){p=!1;break}}return s.delete(e),s.delete(t),p}function $i(e){return ko(Eo(e,i,Ho),e+"")}function eo(e){return Sr(e,Ba,co)}function to(e){return Sr(e,Oa,uo)}var no=Pn?function(e){return Pn.get(e)}:al;function ro(e){for(var t=e.name+"",n=kn[t],r=De.call(kn,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function io(e){return(De.call(Rn,"placeholder")?Rn:e).placeholder}function oo(){var e=Rn.iteratee||rl;return e=e===rl?Dr:e,arguments.length?e(arguments[0],arguments[1]):e}function so(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function ao(e){for(var t=Ba(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,So(i)]}return t}function lo(e,t){var n=function(e,t){return null==e?i:e[t]}(e,t);return Nr(n)?n:i}var co=gt?function(e){return null==e?[]:(e=Ee(e),Pt(gt(e),(function(t){return Ye.call(e,t)})))}:fl,uo=gt?function(e){for(var t=[];e;)Nt(t,co(e)),e=He(e);return t}:fl,ho=Cr;function po(e,t,n){for(var r=-1,i=(t=mi(t,e)).length,o=!1;++r<i;){var s=Mo(t[r]);if(!(o=null!=e&&n(e,s)))break;e=e[s]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Xs(i)&&mo(s,i)&&(Ks(e)||Vs(e))}function fo(e){return"function"!=typeof e.constructor||wo(e)?{}:Ln(He(e))}function go(e){return Ks(e)||Vs(e)||!!(Ze&&e&&e[Ze])}function mo(e,t){var n=typeof e;return!!(t=null==t?d:t)&&("number"==n||"symbol"!=n&&ye.test(e))&&e>-1&&e%1==0&&e<t}function yo(e,t,n){if(!$s(n))return!1;var r=typeof t;return!!("number"==r?Gs(n)&&mo(t,n.length):"string"==r&&t in n)&&Ls(n[t],e)}function vo(e,t){if(Ks(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!aa(e))||$.test(e)||!X.test(e)||null!=t&&e in Ee(t)}function Ao(e){var t=ro(e),n=Rn[t];if("function"!=typeof n||!(t in Vn.prototype))return!1;if(e===n)return!0;var r=no(n);return!!r&&e===r[0]}(Sn&&ho(new Sn(new ArrayBuffer(1)))!=N||Cn&&ho(new Cn)!=S||En&&ho(En.resolve())!=I||In&&ho(new In)!=x||_n&&ho(new _n)!=B)&&(ho=function(e){var t=Cr(e),n=t==E?e.constructor:i,r=n?Fo(n):"";if(r)switch(r){case Bn:return N;case On:return S;case Nn:return I;case Dn:return x;case jn:return B}return t});var bo=Oe?qs:gl;function wo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Be)}function So(e){return e==e&&!$s(e)}function Co(e,t){return function(n){return null!=n&&n[e]===t&&(t!==i||e in Ee(n))}}function Eo(e,t,n){return t=mn(t===i?e.length-1:t,0),function(){for(var i=arguments,o=-1,s=mn(i.length-t,0),a=r(s);++o<s;)a[o]=i[t+o];o=-1;for(var l=r(t+1);++o<t;)l[o]=i[o];return l[t]=n(a),Ct(e,this,l)}}function Io(e,t){return t.length<2?e:wr(e,ei(t,0,-1))}function _o(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var xo=Oo(Jr),Po=ut||function(e,t){return dt.setTimeout(e,t)},ko=Oo(Xr);function Bo(e,t,n){var r=t+"";return ko(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return It(f,(function(n){var r="_."+n[0];t&n[1]&&!kt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(se);return t?t[1].split(ae):[]}(r),n)))}function Oo(e){var t=0,n=0;return function(){var r=vn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function No(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n<t;){var s=Gr(n,o),a=e[s];e[s]=e[n],e[n]=a}return e.length=t,e}var Do,jo,To=(Do=Ds((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ee,(function(e,n,r,i){t.push(r?i.replace(ue,"$1"):n||e)})),t}),(function(e){return 500===jo.size&&jo.clear(),e})),jo=Do.cache,Do);function Mo(e){if("string"==typeof e||aa(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Fo(e){if(null!=e){try{return Ne.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ro(e){if(e instanceof Vn)return e.clone();var t=new Un(e.__wrapped__,e.__chain__);return t.__actions__=_i(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Lo=zr((function(e,t){return Ys(e)?cr(e,gr(t,1,Ys,!0)):[]})),Qo=zr((function(e,t){var n=Wo(t);return Ys(n)&&(n=i),Ys(e)?cr(e,gr(t,1,Ys,!0),oo(n,2)):[]})),Uo=zr((function(e,t){var n=Wo(t);return Ys(n)&&(n=i),Ys(e)?cr(e,gr(t,1,Ys,!0),i,n):[]}));function Vo(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:pa(n);return i<0&&(i=mn(r+i,0)),Rt(e,oo(t,3),i)}function Ko(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r-1;return n!==i&&(o=pa(n),o=n<0?mn(r+o,0):yn(o,r-1)),Rt(e,oo(t,3),o,!0)}function Ho(e){return null!=e&&e.length?gr(e,1):[]}function Go(e){return e&&e.length?e[0]:i}var Yo=zr((function(e){var t=Ot(e,fi);return t.length&&t[0]===e[0]?xr(t):[]})),zo=zr((function(e){var t=Wo(e),n=Ot(e,fi);return t===Wo(n)?t=i:n.pop(),n.length&&n[0]===e[0]?xr(n,oo(t,2)):[]})),Zo=zr((function(e){var t=Wo(e),n=Ot(e,fi);return(t="function"==typeof t?t:i)&&n.pop(),n.length&&n[0]===e[0]?xr(n,i,t):[]}));function Wo(e){var t=null==e?0:e.length;return t?e[t-1]:i}var qo=zr(Jo);function Jo(e,t){return e&&e.length&&t&&t.length?Kr(e,t):e}var Xo=$i((function(e,t){var n=null==e?0:e.length,r=ir(e,t);return Hr(e,Ot(t,(function(e){return mo(e,n)?+e:e})).sort(Ci)),r}));function $o(e){return null==e?e:wn.call(e)}var es=zr((function(e){return ai(gr(e,1,Ys,!0))})),ts=zr((function(e){var t=Wo(e);return Ys(t)&&(t=i),ai(gr(e,1,Ys,!0),oo(t,2))})),ns=zr((function(e){var t=Wo(e);return t="function"==typeof t?t:i,ai(gr(e,1,Ys,!0),i,t)}));function rs(e){if(!e||!e.length)return[];var t=0;return e=Pt(e,(function(e){if(Ys(e))return t=mn(e.length,t),!0})),zt(t,(function(t){return Ot(e,Kt(t))}))}function is(e,t){if(!e||!e.length)return[];var n=rs(e);return null==t?n:Ot(n,(function(e){return Ct(t,i,e)}))}var os=zr((function(e,t){return Ys(e)?cr(e,t):[]})),ss=zr((function(e){return hi(Pt(e,Ys))})),as=zr((function(e){var t=Wo(e);return Ys(t)&&(t=i),hi(Pt(e,Ys),oo(t,2))})),ls=zr((function(e){var t=Wo(e);return t="function"==typeof t?t:i,hi(Pt(e,Ys),i,t)})),cs=zr(rs),us=zr((function(e){var t=e.length,n=t>1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,is(e,n)}));function ds(e){var t=Rn(e);return t.__chain__=!0,t}function hs(e,t){return t(e)}var ps=$i((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return ir(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Vn&&mo(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:hs,args:[o],thisArg:i}),new Un(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)})),fs=Pi((function(e,t,n){De.call(e,n)?++e[n]:rr(e,n,1)})),gs=Ti(Vo),ms=Ti(Ko);function ys(e,t){return(Ks(e)?It:ur)(e,oo(t,3))}function vs(e,t){return(Ks(e)?_t:dr)(e,oo(t,3))}var As=Pi((function(e,t,n){De.call(e,n)?e[n].push(t):rr(e,n,[t])})),bs=zr((function(e,t,n){var i=-1,o="function"==typeof t,s=Gs(e)?r(e.length):[];return ur(e,(function(e){s[++i]=o?Ct(t,e,n):Pr(e,t,n)})),s})),ws=Pi((function(e,t,n){rr(e,n,t)}));function Ss(e,t){return(Ks(e)?Ot:Mr)(e,oo(t,3))}var Cs=Pi((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]})),Es=zr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&yo(e,t[0],t[1])?t=[]:n>2&&yo(t[0],t[1],t[2])&&(t=[t[0]]),Ur(e,gr(t,1),[])})),Is=ct||function(){return dt.Date.now()};function _s(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Zi(e,c,i,i,i,i,t)}function xs(e,t){var n;if("function"!=typeof t)throw new xe(o);return e=pa(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var Ps=zr((function(e,t,n){var r=1;if(n.length){var i=an(n,io(Ps));r|=l}return Zi(e,r,t,n,i)})),ks=zr((function(e,t,n){var r=3;if(n.length){var i=an(n,io(ks));r|=l}return Zi(t,r,e,n,i)}));function Bs(e,t,n){var r,s,a,l,c,u,d=0,h=!1,p=!1,f=!0;if("function"!=typeof e)throw new xe(o);function g(t){var n=r,o=s;return r=s=i,d=t,l=e.apply(o,n)}function m(e){var n=e-u;return u===i||n>=t||n<0||p&&e-d>=a}function y(){var e=Is();if(m(e))return v(e);c=Po(y,function(e){var n=t-(e-u);return p?yn(n,a-(e-d)):n}(e))}function v(e){return c=i,f&&r?g(e):(r=s=i,l)}function A(){var e=Is(),n=m(e);if(r=arguments,s=this,u=e,n){if(c===i)return function(e){return d=e,c=Po(y,t),h?g(e):l}(u);if(p)return Ai(c),c=Po(y,t),g(u)}return c===i&&(c=Po(y,t)),l}return t=ga(t)||0,$s(n)&&(h=!!n.leading,a=(p="maxWait"in n)?mn(ga(n.maxWait)||0,t):a,f="trailing"in n?!!n.trailing:f),A.cancel=function(){c!==i&&Ai(c),d=0,r=u=s=c=i},A.flush=function(){return c===i?l:v(Is())},A}var Os=zr((function(e,t){return lr(e,1,t)})),Ns=zr((function(e,t,n){return lr(e,ga(t)||0,n)}));function Ds(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new xe(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Ds.Cache||Gn),n}function js(e){if("function"!=typeof e)throw new xe(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ds.Cache=Gn;var Ts=yi((function(e,t){var n=(t=1==t.length&&Ks(t[0])?Ot(t[0],Wt(oo())):Ot(gr(t,1),Wt(oo()))).length;return zr((function(r){for(var i=-1,o=yn(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return Ct(e,this,r)}))})),Ms=zr((function(e,t){var n=an(t,io(Ms));return Zi(e,l,i,t,n)})),Fs=zr((function(e,t){var n=an(t,io(Fs));return Zi(e,64,i,t,n)})),Rs=$i((function(e,t){return Zi(e,256,i,i,i,t)}));function Ls(e,t){return e===t||e!=e&&t!=t}var Qs=Ki(Er),Us=Ki((function(e,t){return e>=t})),Vs=kr(function(){return arguments}())?kr:function(e){return ea(e)&&De.call(e,"callee")&&!Ye.call(e,"callee")},Ks=r.isArray,Hs=yt?Wt(yt):function(e){return ea(e)&&Cr(e)==O};function Gs(e){return null!=e&&Xs(e.length)&&!qs(e)}function Ys(e){return ea(e)&&Gs(e)}var zs=mt||gl,Zs=vt?Wt(vt):function(e){return ea(e)&&Cr(e)==v};function Ws(e){if(!ea(e))return!1;var t=Cr(e);return t==A||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ra(e)}function qs(e){if(!$s(e))return!1;var t=Cr(e);return t==b||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Js(e){return"number"==typeof e&&e==pa(e)}function Xs(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=d}function $s(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ea(e){return null!=e&&"object"==typeof e}var ta=At?Wt(At):function(e){return ea(e)&&ho(e)==S};function na(e){return"number"==typeof e||ea(e)&&Cr(e)==C}function ra(e){if(!ea(e)||Cr(e)!=E)return!1;var t=He(e);if(null===t)return!0;var n=De.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ne.call(n)==Fe}var ia=bt?Wt(bt):function(e){return ea(e)&&Cr(e)==_},oa=wt?Wt(wt):function(e){return ea(e)&&ho(e)==x};function sa(e){return"string"==typeof e||!Ks(e)&&ea(e)&&Cr(e)==P}function aa(e){return"symbol"==typeof e||ea(e)&&Cr(e)==k}var la=St?Wt(St):function(e){return ea(e)&&Xs(e.length)&&!!it[Cr(e)]},ca=Ki(Tr),ua=Ki((function(e,t){return e<=t}));function da(e){if(!e)return[];if(Gs(e))return sa(e)?dn(e):_i(e);if(We&&e[We])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[We]());var t=ho(e);return(t==S?on:t==x?ln:La)(e)}function ha(e){return e?(e=ga(e))===u||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function pa(e){var t=ha(e),n=t%1;return t==t?n?t-n:t:0}function fa(e){return e?or(pa(e),0,p):0}function ga(e){if("number"==typeof e)return e;if(aa(e))return h;if($s(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=$s(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Zt(e);var n=fe.test(e);return n||me.test(e)?lt(e.slice(2),n?2:8):pe.test(e)?h:+e}function ma(e){return xi(e,Oa(e))}function ya(e){return null==e?"":si(e)}var va=ki((function(e,t){if(wo(t)||Gs(t))xi(t,Ba(t),e);else for(var n in t)De.call(t,n)&&$n(e,n,t[n])})),Aa=ki((function(e,t){xi(t,Oa(t),e)})),ba=ki((function(e,t,n,r){xi(t,Oa(t),e,r)})),wa=ki((function(e,t,n,r){xi(t,Ba(t),e,r)})),Sa=$i(ir),Ca=zr((function(e,t){e=Ee(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&yo(t[0],t[1],o)&&(r=1);++n<r;)for(var s=t[n],a=Oa(s),l=-1,c=a.length;++l<c;){var u=a[l],d=e[u];(d===i||Ls(d,Be[u])&&!De.call(e,u))&&(e[u]=s[u])}return e})),Ea=zr((function(e){return e.push(i,qi),Ct(Da,i,e)}));function Ia(e,t,n){var r=null==e?i:wr(e,t);return r===i?n:r}function _a(e,t){return null!=e&&po(e,t,_r)}var xa=Ri((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Me.call(t)),e[t]=n}),$a(nl)),Pa=Ri((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Me.call(t)),De.call(e,t)?e[t].push(n):e[t]=[n]}),oo),ka=zr(Pr);function Ba(e){return Gs(e)?Zn(e):jr(e)}function Oa(e){return Gs(e)?Zn(e,!0):function(e){if(!$s(e))return function(e){var t=[];if(null!=e)for(var n in Ee(e))t.push(n);return t}(e);var t=wo(e),n=[];for(var r in e)("constructor"!=r||!t&&De.call(e,r))&&n.push(r);return n}(e)}var Na=ki((function(e,t,n){Lr(e,t,n)})),Da=ki((function(e,t,n,r){Lr(e,t,n,r)})),ja=$i((function(e,t){var n={};if(null==e)return n;var r=!1;t=Ot(t,(function(t){return t=mi(t,e),r||(r=t.length>1),t})),xi(e,to(e),n),r&&(n=sr(n,7,Ji));for(var i=t.length;i--;)li(n,t[i]);return n})),Ta=$i((function(e,t){return null==e?{}:function(e,t){return Vr(e,t,(function(t,n){return _a(e,n)}))}(e,t)}));function Ma(e,t){if(null==e)return{};var n=Ot(to(e),(function(e){return[e]}));return t=oo(t),Vr(e,n,(function(e,n){return t(e,n[0])}))}var Fa=zi(Ba),Ra=zi(Oa);function La(e){return null==e?[]:qt(e,Ba(e))}var Qa=Di((function(e,t,n){return t=t.toLowerCase(),e+(n?Ua(t):t)}));function Ua(e){return Wa(ya(e).toLowerCase())}function Va(e){return(e=ya(e))&&e.replace(ve,en).replace(Je,"")}var Ka=Di((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Ha=Di((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Ga=Ni("toLowerCase"),Ya=Di((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()})),za=Di((function(e,t,n){return e+(n?" ":"")+Wa(t)})),Za=Di((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Wa=Ni("toUpperCase");function qa(e,t,n){return e=ya(e),(t=n?i:t)===i?function(e){return tt.test(e)}(e)?function(e){return e.match($e)||[]}(e):function(e){return e.match(le)||[]}(e):e.match(t)||[]}var Ja=zr((function(e,t){try{return Ct(e,i,t)}catch(e){return Ws(e)?e:new we(e)}})),Xa=$i((function(e,t){return It(t,(function(t){t=Mo(t),rr(e,t,Ps(e[t],e))})),e}));function $a(e){return function(){return e}}var el=Mi(),tl=Mi(!0);function nl(e){return e}function rl(e){return Dr("function"==typeof e?e:sr(e,1))}var il=zr((function(e,t){return function(n){return Pr(n,e,t)}})),ol=zr((function(e,t){return function(n){return Pr(e,n,t)}}));function sl(e,t,n){var r=Ba(t),i=br(t,r);null!=n||$s(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=br(t,Ba(t)));var o=!($s(n)&&"chain"in n&&!n.chain),s=qs(e);return It(i,(function(n){var r=t[n];e[n]=r,s&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=_i(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Nt([this.value()],arguments))})})),e}function al(){}var ll=Qi(Ot),cl=Qi(xt),ul=Qi(Tt);function dl(e){return vo(e)?Kt(Mo(e)):function(e){return function(t){return wr(t,e)}}(e)}var hl=Vi(),pl=Vi(!0);function fl(){return[]}function gl(){return!1}var ml,yl=Li((function(e,t){return e+t}),0),vl=Gi("ceil"),Al=Li((function(e,t){return e/t}),1),bl=Gi("floor"),wl=Li((function(e,t){return e*t}),1),Sl=Gi("round"),Cl=Li((function(e,t){return e-t}),0);return Rn.after=function(e,t){if("function"!=typeof t)throw new xe(o);return e=pa(e),function(){if(--e<1)return t.apply(this,arguments)}},Rn.ary=_s,Rn.assign=va,Rn.assignIn=Aa,Rn.assignInWith=ba,Rn.assignWith=wa,Rn.at=Sa,Rn.before=xs,Rn.bind=Ps,Rn.bindAll=Xa,Rn.bindKey=ks,Rn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ks(e)?e:[e]},Rn.chain=ds,Rn.chunk=function(e,t,n){t=(n?yo(e,t,n):t===i)?1:mn(pa(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var s=0,a=0,l=r(ht(o/t));s<o;)l[a++]=ei(e,s,s+=t);return l},Rn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},Rn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],i=e;i--;)t[i-1]=arguments[i];return Nt(Ks(n)?_i(n):[n],gr(t,1))},Rn.cond=function(e){var t=null==e?0:e.length,n=oo();return e=t?Ot(e,(function(e){if("function"!=typeof e[1])throw new xe(o);return[n(e[0]),e[1]]})):[],zr((function(n){for(var r=-1;++r<t;){var i=e[r];if(Ct(i[0],this,n))return Ct(i[1],this,n)}}))},Rn.conforms=function(e){return function(e){var t=Ba(e);return function(n){return ar(n,e,t)}}(sr(e,1))},Rn.constant=$a,Rn.countBy=fs,Rn.create=function(e,t){var n=Ln(e);return null==t?n:nr(n,t)},Rn.curry=function e(t,n,r){var o=Zi(t,8,i,i,i,i,i,n=r?i:n);return o.placeholder=e.placeholder,o},Rn.curryRight=function e(t,n,r){var o=Zi(t,16,i,i,i,i,i,n=r?i:n);return o.placeholder=e.placeholder,o},Rn.debounce=Bs,Rn.defaults=Ca,Rn.defaultsDeep=Ea,Rn.defer=Os,Rn.delay=Ns,Rn.difference=Lo,Rn.differenceBy=Qo,Rn.differenceWith=Uo,Rn.drop=function(e,t,n){var r=null==e?0:e.length;return r?ei(e,(t=n||t===i?1:pa(t))<0?0:t,r):[]},Rn.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?ei(e,0,(t=r-(t=n||t===i?1:pa(t)))<0?0:t):[]},Rn.dropRightWhile=function(e,t){return e&&e.length?ui(e,oo(t,3),!0,!0):[]},Rn.dropWhile=function(e,t){return e&&e.length?ui(e,oo(t,3),!0):[]},Rn.fill=function(e,t,n,r){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&yo(e,t,n)&&(n=0,r=o),function(e,t,n,r){var o=e.length;for((n=pa(n))<0&&(n=-n>o?0:o+n),(r=r===i||r>o?o:pa(r))<0&&(r+=o),r=n>r?0:fa(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Rn.filter=function(e,t){return(Ks(e)?Pt:fr)(e,oo(t,3))},Rn.flatMap=function(e,t){return gr(Ss(e,t),1)},Rn.flatMapDeep=function(e,t){return gr(Ss(e,t),u)},Rn.flatMapDepth=function(e,t,n){return n=n===i?1:pa(n),gr(Ss(e,t),n)},Rn.flatten=Ho,Rn.flattenDeep=function(e){return null!=e&&e.length?gr(e,u):[]},Rn.flattenDepth=function(e,t){return null!=e&&e.length?gr(e,t=t===i?1:pa(t)):[]},Rn.flip=function(e){return Zi(e,512)},Rn.flow=el,Rn.flowRight=tl,Rn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},Rn.functions=function(e){return null==e?[]:br(e,Ba(e))},Rn.functionsIn=function(e){return null==e?[]:br(e,Oa(e))},Rn.groupBy=As,Rn.initial=function(e){return null!=e&&e.length?ei(e,0,-1):[]},Rn.intersection=Yo,Rn.intersectionBy=zo,Rn.intersectionWith=Zo,Rn.invert=xa,Rn.invertBy=Pa,Rn.invokeMap=bs,Rn.iteratee=rl,Rn.keyBy=ws,Rn.keys=Ba,Rn.keysIn=Oa,Rn.map=Ss,Rn.mapKeys=function(e,t){var n={};return t=oo(t,3),vr(e,(function(e,r,i){rr(n,t(e,r,i),e)})),n},Rn.mapValues=function(e,t){var n={};return t=oo(t,3),vr(e,(function(e,r,i){rr(n,r,t(e,r,i))})),n},Rn.matches=function(e){return Fr(sr(e,1))},Rn.matchesProperty=function(e,t){return Rr(e,sr(t,1))},Rn.memoize=Ds,Rn.merge=Na,Rn.mergeWith=Da,Rn.method=il,Rn.methodOf=ol,Rn.mixin=sl,Rn.negate=js,Rn.nthArg=function(e){return e=pa(e),zr((function(t){return Qr(t,e)}))},Rn.omit=ja,Rn.omitBy=function(e,t){return Ma(e,js(oo(t)))},Rn.once=function(e){return xs(2,e)},Rn.orderBy=function(e,t,n,r){return null==e?[]:(Ks(t)||(t=null==t?[]:[t]),Ks(n=r?i:n)||(n=null==n?[]:[n]),Ur(e,t,n))},Rn.over=ll,Rn.overArgs=Ts,Rn.overEvery=cl,Rn.overSome=ul,Rn.partial=Ms,Rn.partialRight=Fs,Rn.partition=Cs,Rn.pick=Ta,Rn.pickBy=Ma,Rn.property=dl,Rn.propertyOf=function(e){return function(t){return null==e?i:wr(e,t)}},Rn.pull=qo,Rn.pullAll=Jo,Rn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Kr(e,t,oo(n,2)):e},Rn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Kr(e,t,i,n):e},Rn.pullAt=Xo,Rn.range=hl,Rn.rangeRight=pl,Rn.rearg=Rs,Rn.reject=function(e,t){return(Ks(e)?Pt:fr)(e,js(oo(t,3)))},Rn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=oo(t,3);++r<o;){var s=e[r];t(s,r,e)&&(n.push(s),i.push(r))}return Hr(e,i),n},Rn.rest=function(e,t){if("function"!=typeof e)throw new xe(o);return zr(e,t=t===i?t:pa(t))},Rn.reverse=$o,Rn.sampleSize=function(e,t,n){return t=(n?yo(e,t,n):t===i)?1:pa(t),(Ks(e)?qn:Wr)(e,t)},Rn.set=function(e,t,n){return null==e?e:qr(e,t,n)},Rn.setWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:qr(e,t,n,r)},Rn.shuffle=function(e){return(Ks(e)?Jn:$r)(e)},Rn.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&yo(e,t,n)?(t=0,n=r):(t=null==t?0:pa(t),n=n===i?r:pa(n)),ei(e,t,n)):[]},Rn.sortBy=Es,Rn.sortedUniq=function(e){return e&&e.length?ii(e):[]},Rn.sortedUniqBy=function(e,t){return e&&e.length?ii(e,oo(t,2)):[]},Rn.split=function(e,t,n){return n&&"number"!=typeof n&&yo(e,t,n)&&(t=n=i),(n=n===i?p:n>>>0)?(e=ya(e))&&("string"==typeof t||null!=t&&!ia(t))&&!(t=si(t))&&rn(e)?vi(dn(e),0,n):e.split(t,n):[]},Rn.spread=function(e,t){if("function"!=typeof e)throw new xe(o);return t=null==t?0:mn(pa(t),0),zr((function(n){var r=n[t],i=vi(n,0,t);return r&&Nt(i,r),Ct(e,this,i)}))},Rn.tail=function(e){var t=null==e?0:e.length;return t?ei(e,1,t):[]},Rn.take=function(e,t,n){return e&&e.length?ei(e,0,(t=n||t===i?1:pa(t))<0?0:t):[]},Rn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?ei(e,(t=r-(t=n||t===i?1:pa(t)))<0?0:t,r):[]},Rn.takeRightWhile=function(e,t){return e&&e.length?ui(e,oo(t,3),!1,!0):[]},Rn.takeWhile=function(e,t){return e&&e.length?ui(e,oo(t,3)):[]},Rn.tap=function(e,t){return t(e),e},Rn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new xe(o);return $s(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Bs(e,t,{leading:r,maxWait:t,trailing:i})},Rn.thru=hs,Rn.toArray=da,Rn.toPairs=Fa,Rn.toPairsIn=Ra,Rn.toPath=function(e){return Ks(e)?Ot(e,Mo):aa(e)?[e]:_i(To(ya(e)))},Rn.toPlainObject=ma,Rn.transform=function(e,t,n){var r=Ks(e),i=r||zs(e)||la(e);if(t=oo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:$s(e)&&qs(o)?Ln(He(e)):{}}return(i?It:vr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Rn.unary=function(e){return _s(e,1)},Rn.union=es,Rn.unionBy=ts,Rn.unionWith=ns,Rn.uniq=function(e){return e&&e.length?ai(e):[]},Rn.uniqBy=function(e,t){return e&&e.length?ai(e,oo(t,2)):[]},Rn.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?ai(e,i,t):[]},Rn.unset=function(e,t){return null==e||li(e,t)},Rn.unzip=rs,Rn.unzipWith=is,Rn.update=function(e,t,n){return null==e?e:ci(e,t,gi(n))},Rn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:ci(e,t,gi(n),r)},Rn.values=La,Rn.valuesIn=function(e){return null==e?[]:qt(e,Oa(e))},Rn.without=os,Rn.words=qa,Rn.wrap=function(e,t){return Ms(gi(t),e)},Rn.xor=ss,Rn.xorBy=as,Rn.xorWith=ls,Rn.zip=cs,Rn.zipObject=function(e,t){return pi(e||[],t||[],$n)},Rn.zipObjectDeep=function(e,t){return pi(e||[],t||[],qr)},Rn.zipWith=us,Rn.entries=Fa,Rn.entriesIn=Ra,Rn.extend=Aa,Rn.extendWith=ba,sl(Rn,Rn),Rn.add=yl,Rn.attempt=Ja,Rn.camelCase=Qa,Rn.capitalize=Ua,Rn.ceil=vl,Rn.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=ga(n))==n?n:0),t!==i&&(t=(t=ga(t))==t?t:0),or(ga(e),t,n)},Rn.clone=function(e){return sr(e,4)},Rn.cloneDeep=function(e){return sr(e,5)},Rn.cloneDeepWith=function(e,t){return sr(e,5,t="function"==typeof t?t:i)},Rn.cloneWith=function(e,t){return sr(e,4,t="function"==typeof t?t:i)},Rn.conformsTo=function(e,t){return null==t||ar(e,t,Ba(t))},Rn.deburr=Va,Rn.defaultTo=function(e,t){return null==e||e!=e?t:e},Rn.divide=Al,Rn.endsWith=function(e,t,n){e=ya(e),t=si(t);var r=e.length,o=n=n===i?r:or(pa(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Rn.eq=Ls,Rn.escape=function(e){return(e=ya(e))&&Z.test(e)?e.replace(Y,tn):e},Rn.escapeRegExp=function(e){return(e=ya(e))&&ne.test(e)?e.replace(te,"\\$&"):e},Rn.every=function(e,t,n){var r=Ks(e)?xt:hr;return n&&yo(e,t,n)&&(t=i),r(e,oo(t,3))},Rn.find=gs,Rn.findIndex=Vo,Rn.findKey=function(e,t){return Ft(e,oo(t,3),vr)},Rn.findLast=ms,Rn.findLastIndex=Ko,Rn.findLastKey=function(e,t){return Ft(e,oo(t,3),Ar)},Rn.floor=bl,Rn.forEach=ys,Rn.forEachRight=vs,Rn.forIn=function(e,t){return null==e?e:mr(e,oo(t,3),Oa)},Rn.forInRight=function(e,t){return null==e?e:yr(e,oo(t,3),Oa)},Rn.forOwn=function(e,t){return e&&vr(e,oo(t,3))},Rn.forOwnRight=function(e,t){return e&&Ar(e,oo(t,3))},Rn.get=Ia,Rn.gt=Qs,Rn.gte=Us,Rn.has=function(e,t){return null!=e&&po(e,t,Ir)},Rn.hasIn=_a,Rn.head=Go,Rn.identity=nl,Rn.includes=function(e,t,n,r){e=Gs(e)?e:La(e),n=n&&!r?pa(n):0;var i=e.length;return n<0&&(n=mn(i+n,0)),sa(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Lt(e,t,n)>-1},Rn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:pa(n);return i<0&&(i=mn(r+i,0)),Lt(e,t,i)},Rn.inRange=function(e,t,n){return t=ha(t),n===i?(n=t,t=0):n=ha(n),function(e,t,n){return e>=yn(t,n)&&e<mn(t,n)}(e=ga(e),t,n)},Rn.invoke=ka,Rn.isArguments=Vs,Rn.isArray=Ks,Rn.isArrayBuffer=Hs,Rn.isArrayLike=Gs,Rn.isArrayLikeObject=Ys,Rn.isBoolean=function(e){return!0===e||!1===e||ea(e)&&Cr(e)==y},Rn.isBuffer=zs,Rn.isDate=Zs,Rn.isElement=function(e){return ea(e)&&1===e.nodeType&&!ra(e)},Rn.isEmpty=function(e){if(null==e)return!0;if(Gs(e)&&(Ks(e)||"string"==typeof e||"function"==typeof e.splice||zs(e)||la(e)||Vs(e)))return!e.length;var t=ho(e);if(t==S||t==x)return!e.size;if(wo(e))return!jr(e).length;for(var n in e)if(De.call(e,n))return!1;return!0},Rn.isEqual=function(e,t){return Br(e,t)},Rn.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:i)?n(e,t):i;return r===i?Br(e,t,i,n):!!r},Rn.isError=Ws,Rn.isFinite=function(e){return"number"==typeof e&&Mt(e)},Rn.isFunction=qs,Rn.isInteger=Js,Rn.isLength=Xs,Rn.isMap=ta,Rn.isMatch=function(e,t){return e===t||Or(e,t,ao(t))},Rn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:i,Or(e,t,ao(t),n)},Rn.isNaN=function(e){return na(e)&&e!=+e},Rn.isNative=function(e){if(bo(e))throw new we("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Nr(e)},Rn.isNil=function(e){return null==e},Rn.isNull=function(e){return null===e},Rn.isNumber=na,Rn.isObject=$s,Rn.isObjectLike=ea,Rn.isPlainObject=ra,Rn.isRegExp=ia,Rn.isSafeInteger=function(e){return Js(e)&&e>=-9007199254740991&&e<=d},Rn.isSet=oa,Rn.isString=sa,Rn.isSymbol=aa,Rn.isTypedArray=la,Rn.isUndefined=function(e){return e===i},Rn.isWeakMap=function(e){return ea(e)&&ho(e)==B},Rn.isWeakSet=function(e){return ea(e)&&"[object WeakSet]"==Cr(e)},Rn.join=function(e,t){return null==e?"":Ht.call(e,t)},Rn.kebabCase=Ka,Rn.last=Wo,Rn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=pa(n))<0?mn(r+o,0):yn(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Rt(e,Ut,o,!0)},Rn.lowerCase=Ha,Rn.lowerFirst=Ga,Rn.lt=ca,Rn.lte=ua,Rn.max=function(e){return e&&e.length?pr(e,nl,Er):i},Rn.maxBy=function(e,t){return e&&e.length?pr(e,oo(t,2),Er):i},Rn.mean=function(e){return Vt(e,nl)},Rn.meanBy=function(e,t){return Vt(e,oo(t,2))},Rn.min=function(e){return e&&e.length?pr(e,nl,Tr):i},Rn.minBy=function(e,t){return e&&e.length?pr(e,oo(t,2),Tr):i},Rn.stubArray=fl,Rn.stubFalse=gl,Rn.stubObject=function(){return{}},Rn.stubString=function(){return""},Rn.stubTrue=function(){return!0},Rn.multiply=wl,Rn.nth=function(e,t){return e&&e.length?Qr(e,pa(t)):i},Rn.noConflict=function(){return dt._===this&&(dt._=Re),this},Rn.noop=al,Rn.now=Is,Rn.pad=function(e,t,n){e=ya(e);var r=(t=pa(t))?un(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Ui(pt(i),n)+e+Ui(ht(i),n)},Rn.padEnd=function(e,t,n){e=ya(e);var r=(t=pa(t))?un(e):0;return t&&r<t?e+Ui(t-r,n):e},Rn.padStart=function(e,t,n){e=ya(e);var r=(t=pa(t))?un(e):0;return t&&r<t?Ui(t-r,n)+e:e},Rn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),An(ya(e).replace(re,""),t||0)},Rn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&yo(e,t,n)&&(t=n=i),n===i&&("boolean"==typeof t?(n=t,t=i):"boolean"==typeof e&&(n=e,e=i)),e===i&&t===i?(e=0,t=1):(e=ha(e),t===i?(t=e,e=0):t=ha(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var o=bn();return yn(e+o*(t-e+at("1e-"+((o+"").length-1))),t)}return Gr(e,t)},Rn.reduce=function(e,t,n){var r=Ks(e)?Dt:Gt,i=arguments.length<3;return r(e,oo(t,4),n,i,ur)},Rn.reduceRight=function(e,t,n){var r=Ks(e)?jt:Gt,i=arguments.length<3;return r(e,oo(t,4),n,i,dr)},Rn.repeat=function(e,t,n){return t=(n?yo(e,t,n):t===i)?1:pa(t),Yr(ya(e),t)},Rn.replace=function(){var e=arguments,t=ya(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Rn.result=function(e,t,n){var r=-1,o=(t=mi(t,e)).length;for(o||(o=1,e=i);++r<o;){var s=null==e?i:e[Mo(t[r])];s===i&&(r=o,s=n),e=qs(s)?s.call(e):s}return e},Rn.round=Sl,Rn.runInContext=e,Rn.sample=function(e){return(Ks(e)?Wn:Zr)(e)},Rn.size=function(e){if(null==e)return 0;if(Gs(e))return sa(e)?un(e):e.length;var t=ho(e);return t==S||t==x?e.size:jr(e).length},Rn.snakeCase=Ya,Rn.some=function(e,t,n){var r=Ks(e)?Tt:ti;return n&&yo(e,t,n)&&(t=i),r(e,oo(t,3))},Rn.sortedIndex=function(e,t){return ni(e,t)},Rn.sortedIndexBy=function(e,t,n){return ri(e,t,oo(n,2))},Rn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=ni(e,t);if(r<n&&Ls(e[r],t))return r}return-1},Rn.sortedLastIndex=function(e,t){return ni(e,t,!0)},Rn.sortedLastIndexBy=function(e,t,n){return ri(e,t,oo(n,2),!0)},Rn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=ni(e,t,!0)-1;if(Ls(e[n],t))return n}return-1},Rn.startCase=za,Rn.startsWith=function(e,t,n){return e=ya(e),n=null==n?0:or(pa(n),0,e.length),t=si(t),e.slice(n,n+t.length)==t},Rn.subtract=Cl,Rn.sum=function(e){return e&&e.length?Yt(e,nl):0},Rn.sumBy=function(e,t){return e&&e.length?Yt(e,oo(t,2)):0},Rn.template=function(e,t,n){var r=Rn.templateSettings;n&&yo(e,t,n)&&(t=i),e=ya(e),t=ba({},t,r,Wi);var o,s,a=ba({},t.imports,r.imports,Wi),l=Ba(a),c=qt(a,l),u=0,d=t.interpolate||Ae,h="__p += '",p=Ie((t.escape||Ae).source+"|"+d.source+"|"+(d===J?de:Ae).source+"|"+(t.evaluate||Ae).source+"|$","g"),f="//# sourceURL="+(De.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++rt+"]")+"\n";e.replace(p,(function(t,n,r,i,a,l){return r||(r=i),h+=e.slice(u,l).replace(be,nn),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),a&&(s=!0,h+="';\n"+a+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=l+t.length,t})),h+="';\n";var g=De.call(t,"variable")&&t.variable;if(g){if(ce.test(g))throw new we("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(s?h.replace(V,""):h).replace(K,"$1").replace(H,"$1;"),h="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var m=Ja((function(){return Se(l,f+"return "+h).apply(i,c)}));if(m.source=h,Ws(m))throw m;return m},Rn.times=function(e,t){if((e=pa(e))<1||e>d)return[];var n=p,r=yn(e,p);t=oo(t),e-=p;for(var i=zt(r,t);++n<e;)t(n);return i},Rn.toFinite=ha,Rn.toInteger=pa,Rn.toLength=fa,Rn.toLower=function(e){return ya(e).toLowerCase()},Rn.toNumber=ga,Rn.toSafeInteger=function(e){return e?or(pa(e),-9007199254740991,d):0===e?e:0},Rn.toString=ya,Rn.toUpper=function(e){return ya(e).toUpperCase()},Rn.trim=function(e,t,n){if((e=ya(e))&&(n||t===i))return Zt(e);if(!e||!(t=si(t)))return e;var r=dn(e),o=dn(t);return vi(r,Xt(r,o),$t(r,o)+1).join("")},Rn.trimEnd=function(e,t,n){if((e=ya(e))&&(n||t===i))return e.slice(0,hn(e)+1);if(!e||!(t=si(t)))return e;var r=dn(e);return vi(r,0,$t(r,dn(t))+1).join("")},Rn.trimStart=function(e,t,n){if((e=ya(e))&&(n||t===i))return e.replace(re,"");if(!e||!(t=si(t)))return e;var r=dn(e);return vi(r,Xt(r,dn(t))).join("")},Rn.truncate=function(e,t){var n=30,r="...";if($s(t)){var o="separator"in t?t.separator:o;n="length"in t?pa(t.length):n,r="omission"in t?si(t.omission):r}var s=(e=ya(e)).length;if(rn(e)){var a=dn(e);s=a.length}if(n>=s)return e;var l=n-un(r);if(l<1)return r;var c=a?vi(a,0,l).join(""):e.slice(0,l);if(o===i)return c+r;if(a&&(l+=c.length-l),ia(o)){if(e.slice(l).search(o)){var u,d=c;for(o.global||(o=Ie(o.source,ya(he.exec(o))+"g")),o.lastIndex=0;u=o.exec(d);)var h=u.index;c=c.slice(0,h===i?l:h)}}else if(e.indexOf(si(o),l)!=l){var p=c.lastIndexOf(o);p>-1&&(c=c.slice(0,p))}return c+r},Rn.unescape=function(e){return(e=ya(e))&&z.test(e)?e.replace(G,pn):e},Rn.uniqueId=function(e){var t=++je;return ya(e)+t},Rn.upperCase=Za,Rn.upperFirst=Wa,Rn.each=ys,Rn.eachRight=vs,Rn.first=Go,sl(Rn,(ml={},vr(Rn,(function(e,t){De.call(Rn.prototype,t)||(ml[t]=e)})),ml),{chain:!1}),Rn.VERSION="4.17.21",It(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Rn[e].placeholder=Rn})),It(["drop","take"],(function(e,t){Vn.prototype[e]=function(n){n=n===i?1:mn(pa(n),0);var r=this.__filtered__&&!t?new Vn(this):this.clone();return r.__filtered__?r.__takeCount__=yn(n,r.__takeCount__):r.__views__.push({size:yn(n,p),type:e+(r.__dir__<0?"Right":"")}),r},Vn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),It(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Vn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:oo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),It(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Vn.prototype[e]=function(){return this[n](1).value()[0]}})),It(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Vn.prototype[e]=function(){return this.__filtered__?new Vn(this):this[n](1)}})),Vn.prototype.compact=function(){return this.filter(nl)},Vn.prototype.find=function(e){return this.filter(e).head()},Vn.prototype.findLast=function(e){return this.reverse().find(e)},Vn.prototype.invokeMap=zr((function(e,t){return"function"==typeof e?new Vn(this):this.map((function(n){return Pr(n,e,t)}))})),Vn.prototype.reject=function(e){return this.filter(js(oo(e)))},Vn.prototype.slice=function(e,t){e=pa(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Vn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=pa(t))<0?n.dropRight(-t):n.take(t-e)),n)},Vn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Vn.prototype.toArray=function(){return this.take(p)},vr(Vn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Rn[r?"take"+("last"==t?"Right":""):t],s=r||/^find/.test(t);o&&(Rn.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,l=t instanceof Vn,c=a[0],u=l||Ks(t),d=function(e){var t=o.apply(Rn,Nt([e],a));return r&&h?t[0]:t};u&&n&&"function"==typeof c&&1!=c.length&&(l=u=!1);var h=this.__chain__,p=!!this.__actions__.length,f=s&&!h,g=l&&!p;if(!s&&u){t=g?t:new Vn(this);var m=e.apply(t,a);return m.__actions__.push({func:hs,args:[d],thisArg:i}),new Un(m,h)}return f&&g?e.apply(this,a):(m=this.thru(d),f?r?m.value()[0]:m.value():m)})})),It(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Pe[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Rn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ks(i)?i:[],e)}return this[n]((function(n){return t.apply(Ks(n)?n:[],e)}))}})),vr(Vn.prototype,(function(e,t){var n=Rn[t];if(n){var r=n.name+"";De.call(kn,r)||(kn[r]=[]),kn[r].push({name:t,func:n})}})),kn[Fi(i,2).name]=[{name:"wrapper",func:i}],Vn.prototype.clone=function(){var e=new Vn(this.__wrapped__);return e.__actions__=_i(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=_i(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=_i(this.__views__),e},Vn.prototype.reverse=function(){if(this.__filtered__){var e=new Vn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Vn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ks(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=yn(t,e+s);break;case"takeRight":e=mn(e,t-s)}}return{start:e,end:t}}(0,i,this.__views__),s=o.start,a=o.end,l=a-s,c=r?a:s-1,u=this.__iteratees__,d=u.length,h=0,p=yn(l,this.__takeCount__);if(!n||!r&&i==l&&p==l)return di(e,this.__actions__);var f=[];e:for(;l--&&h<p;){for(var g=-1,m=e[c+=t];++g<d;){var y=u[g],v=y.iteratee,A=y.type,b=v(m);if(2==A)m=b;else if(!b){if(1==A)continue e;break e}}f[h++]=m}return f},Rn.prototype.at=ps,Rn.prototype.chain=function(){return ds(this)},Rn.prototype.commit=function(){return new Un(this.value(),this.__chain__)},Rn.prototype.next=function(){this.__values__===i&&(this.__values__=da(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Rn.prototype.plant=function(e){for(var t,n=this;n instanceof Qn;){var r=Ro(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Rn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Vn){var t=e;return this.__actions__.length&&(t=new Vn(this)),(t=t.reverse()).__actions__.push({func:hs,args:[$o],thisArg:i}),new Un(t,this.__chain__)}return this.thru($o)},Rn.prototype.toJSON=Rn.prototype.valueOf=Rn.prototype.value=function(){return di(this.__wrapped__,this.__actions__)},Rn.prototype.first=Rn.prototype.head,We&&(Rn.prototype[We]=function(){return this}),Rn}();dt._=fn,(r=function(){return fn}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},34309:(e,t,n)=>{"use strict";n.d(t,{Pi:()=>v});var r=n(80075),i=n(2784);if(!i.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!r.rC)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var o=n(28316);function s(e){return(0,r.Gf)(e)}var a=function(){function e(e){var t=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(e){void 0===e&&(e=1e4),clearTimeout(t.sweepTimeout),t.sweepTimeout=void 0;var n=Date.now();t.registrations.forEach((function(r,i){n-r.registeredAt>=e&&(t.finalize(r.value),t.registrations.delete(i))})),t.registrations.size>0&&t.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){t.sweep(0)}})}return Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){this.registrations.set(n,{value:t,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.registrations.delete(e)}}),Object.defineProperty(e.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){void 0===this.sweepTimeout&&(this.sweepTimeout=setTimeout(this.sweep,1e4))}}),e}(),l=new("undefined"!=typeof FinalizationRegistry?FinalizationRegistry:a)((function(e){var t;null===(t=e.reaction)||void 0===t||t.dispose(),e.reaction=null})),c=!1;function u(){return c}var d=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s};function h(e){return"observer".concat(e)}var p=function(){};function f(){return new p}var g="function"==typeof Symbol&&Symbol.for,m=g?Symbol.for("react.forward_ref"):"function"==typeof i.forwardRef&&(0,i.forwardRef)((function(e){return null})).$$typeof,y=g?Symbol.for("react.memo"):"function"==typeof i.memo&&(0,i.memo)((function(e){return null})).$$typeof;function v(e,t){var n;if(y&&e.$$typeof===y)throw new Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");if(u())return e;var o=null!==(n=null==t?void 0:t.forwardRef)&&void 0!==n&&n,a=e,c=e.displayName||e.name;if(m&&e.$$typeof===m&&(o=!0,"function"!=typeof(a=e.render)))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var p,g,v=function(e,t){return function(e,t){if(void 0===t&&(t="observed"),u())return e();var n=d(i.useState(f),1)[0],o=d(i.useState(),2)[1],a=function(){return o([])},c=i.useRef(null);c.current||(c.current={reaction:null,mounted:!1,changedBeforeMount:!1});var p,g,m=c.current;if(m.reaction||(m.reaction=new r.le(h(t),(function(){m.mounted?a():m.changedBeforeMount=!0})),l.register(n,m,m)),i.useDebugValue(m.reaction,s),i.useEffect((function(){return l.unregister(m),m.mounted=!0,m.reaction?m.changedBeforeMount&&(m.changedBeforeMount=!1,a()):(m.reaction=new r.le(h(t),(function(){a()})),a()),function(){m.reaction.dispose(),m.reaction=null,m.mounted=!1,m.changedBeforeMount=!1}}),[]),m.reaction.track((function(){try{p=e()}catch(e){g=e}})),g)throw g;return p}((function(){return a(e,t)}),c)};return""!==c&&(v.displayName=c),e.contextTypes&&(v.contextTypes=e.contextTypes),o&&(v=(0,i.forwardRef)(v)),v=(0,i.memo)(v),p=e,g=v,Object.keys(p).forEach((function(e){b[e]||Object.defineProperty(g,e,Object.getOwnPropertyDescriptor(p,e))})),v}var A,b={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};(A=o.unstable_batchedUpdates)||(A=function(e){e()}),(0,r.jQ)({reactionScheduler:A}),l.finalizeAllImmediately},80075:(e,t,n)=>{"use strict";function r(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw new Error("number"==typeof e?"[MobX] minified error nr: "+e+(n.length?" "+n.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+e)}n.d(t,{EH:()=>Dt,Fl:()=>Oe,Gf:()=>Yt,LO:()=>xe,U5:()=>Mt,aD:()=>kt,gx:()=>rn,jQ:()=>Ht,ky:()=>mn,le:()=>mt,rC:()=>fn,z:()=>Ot});var i={};function o(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:i}var s=Object.assign,a=Object.getOwnPropertyDescriptor,l=Object.defineProperty,c=Object.prototype,u=[];Object.freeze(u);var d={};Object.freeze(d);var h="undefined"!=typeof Proxy,p=Object.toString();function f(){h||r("Proxy not available")}function g(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var m=function(){};function y(e){return"function"==typeof e}function v(e){switch(typeof e){case"string":case"symbol":case"number":return!0}return!1}function A(e){return null!==e&&"object"==typeof e}function b(e){if(!A(e))return!1;var t=Object.getPrototypeOf(e);if(null==t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n.toString()===p}function w(e){var t=null==e?void 0:e.constructor;return!!t&&("GeneratorFunction"===t.name||"GeneratorFunction"===t.displayName)}function S(e,t,n){l(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function C(e,t,n){l(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function E(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(e){return A(e)&&!0===e[n]}}function I(e){return e instanceof Map}function _(e){return e instanceof Set}var x=void 0!==Object.getOwnPropertySymbols,P="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:x?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function k(e){return null===e?null:"object"==typeof e?""+e:e}function B(e,t){return c.hasOwnProperty.call(e,t)}var O=Object.getOwnPropertyDescriptors||function(e){var t={};return P(e).forEach((function(n){t[n]=a(e,n)})),t};function N(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,"symbol"==typeof(i=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key))?i:String(i)),r)}var i}function D(e,t,n){return t&&N(e.prototype,t),n&&N(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function j(){return j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},j.apply(this,arguments)}function T(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,M(e,t)}function M(e,t){return M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},M(e,t)}function F(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function L(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return R(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?R(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var Q=Symbol("mobx-stored-annotations");function U(e){return Object.assign((function(t,n){V(t,n,e)}),e)}function V(e,t,n){B(e,Q)||S(e,Q,j({},e[Q])),function(e){return e.annotationType_===q}(n)||(e[Q][t]=n)}var K=Symbol("mobx administration"),H=function(){function e(e){void 0===e&&(e="Atom"),this.name_=void 0,this.isPendingUnobservation_=!1,this.isBeingObserved_=!1,this.observers_=new Set,this.diffValue_=0,this.lastAccessedBy_=0,this.lowestObserverState_=He.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=e}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach((function(e){return e()}))},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach((function(e){return e()}))},t.reportObserved=function(){return ft(this)},t.reportChanged=function(){ht(),gt(this),lt.stateVersion=lt.stateVersion<Number.MAX_SAFE_INTEGER?lt.stateVersion+1:Number.MIN_SAFE_INTEGER,pt()},t.toString=function(){return this.name_},e}(),G=E("Atom",H);function Y(e,t,n){void 0===t&&(t=m),void 0===n&&(n=m);var r=new H(e);return t!==m&&Qt(Ft,r,t,undefined),n!==m&&Lt(r,n),r}var z={identity:function(e,t){return e===t},structural:function(e,t){return cr(e,t)},default:function(e,t){return Object.is?Object.is(e,t):e===t?0!==e||1/e==1/t:e!=e&&t!=t},shallow:function(e,t){return cr(e,t,1)}};function Z(e,t,n){return tn(e)?e:Array.isArray(e)?xe.array(e,{name:n}):b(e)?xe.object(e,void 0,{name:n}):I(e)?xe.map(e,{name:n}):_(e)?xe.set(e,{name:n}):"function"!=typeof e||Nt(e)||en(e)?e:w(e)?Xt(e):Bt(n,e)}function W(e){return e}var q="override";function J(e,t){return{annotationType_:e,options_:t,make_:X,extend_:$}}function X(e,t,n,r){var i;if(null!=(i=this.options_)&&i.bound)return null===this.extend_(e,t,n,!1)?0:1;if(r===e.target_)return null===this.extend_(e,t,n,!1)?0:2;if(Nt(n.value))return 1;var o=ee(e,this,t,n,!1);return l(r,t,o),2}function $(e,t,n,r){var i=ee(e,this,t,n);return e.defineProperty_(t,i,r)}function ee(e,t,n,r,i){var o,s,a,l,c,u,d,h;void 0===i&&(i=lt.safeDescriptors),h=r,t.annotationType_,h.value;var p,f=r.value;return null!=(o=t.options_)&&o.bound&&(f=f.bind(null!=(p=e.proxy_)?p:e.target_)),{value:Fe(null!=(s=null==(a=t.options_)?void 0:a.name)?s:n.toString(),f,null!=(l=null==(c=t.options_)?void 0:c.autoAction)&&l,null!=(u=t.options_)&&u.bound?null!=(d=e.proxy_)?d:e.target_:void 0),configurable:!i||e.isPlainObject_,enumerable:!1,writable:!i}}function te(e,t){return{annotationType_:e,options_:t,make_:ne,extend_:re}}function ne(e,t,n,r){var i;if(r===e.target_)return null===this.extend_(e,t,n,!1)?0:2;if(null!=(i=this.options_)&&i.bound&&(!B(e.target_,t)||!en(e.target_[t]))&&null===this.extend_(e,t,n,!1))return 0;if(en(n.value))return 1;var o=ie(e,this,0,n,!1,!1);return l(r,t,o),2}function re(e,t,n,r){var i,o=ie(e,this,0,n,null==(i=this.options_)?void 0:i.bound);return e.defineProperty_(t,o,r)}function ie(e,t,n,r,i,o){var s;void 0===o&&(o=lt.safeDescriptors),s=r,t.annotationType_,s.value;var a,l=r.value;return en(l)||(l=Xt(l)),i&&((l=l.bind(null!=(a=e.proxy_)?a:e.target_)).isMobXFlow=!0),{value:l,configurable:!o||e.isPlainObject_,enumerable:!1,writable:!o}}function oe(e,t){return{annotationType_:e,options_:t,make_:se,extend_:ae}}function se(e,t,n){return null===this.extend_(e,t,n,!1)?0:1}function ae(e,t,n,r){return i=n,this.annotationType_,i.get,e.defineComputedProperty_(t,j({},this.options_,{get:n.get,set:n.set}),r);var i}function le(e,t){return{annotationType_:e,options_:t,make_:ce,extend_:ue}}function ce(e,t,n){return null===this.extend_(e,t,n,!1)?0:1}function ue(e,t,n,r){var i,o;return this.annotationType_,e.defineObservableProperty_(t,n.value,null!=(i=null==(o=this.options_)?void 0:o.enhancer)?i:Z,r)}var de="true",he=pe();function pe(e){return{annotationType_:de,options_:e,make_:fe,extend_:ge}}function fe(e,t,n,r){var i,o,s,a;if(n.get)return Oe.make_(e,t,n,r);if(n.set){var c=Fe(t.toString(),n.set);return r===e.target_?null===e.defineProperty_(t,{configurable:!lt.safeDescriptors||e.isPlainObject_,set:c})?0:2:(l(r,t,{configurable:!0,set:c}),2)}if(r!==e.target_&&"function"==typeof n.value)return w(n.value)?(null!=(a=this.options_)&&a.autoBind?Xt.bound:Xt).make_(e,t,n,r):(null!=(s=this.options_)&&s.autoBind?Bt.bound:Bt).make_(e,t,n,r);var u,d=!1===(null==(i=this.options_)?void 0:i.deep)?xe.ref:xe;return"function"==typeof n.value&&null!=(o=this.options_)&&o.autoBind&&(n.value=n.value.bind(null!=(u=e.proxy_)?u:e.target_)),d.make_(e,t,n,r)}function ge(e,t,n,r){var i,o,s;return n.get?Oe.extend_(e,t,n,r):n.set?e.defineProperty_(t,{configurable:!lt.safeDescriptors||e.isPlainObject_,set:Fe(t.toString(),n.set)},r):("function"==typeof n.value&&null!=(i=this.options_)&&i.autoBind&&(n.value=n.value.bind(null!=(s=e.proxy_)?s:e.target_)),(!1===(null==(o=this.options_)?void 0:o.deep)?xe.ref:xe).extend_(e,t,n,r))}var me={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};function ye(e){return e||me}Object.freeze(me);var ve=le("observable"),Ae=le("observable.ref",{enhancer:W}),be=le("observable.shallow",{enhancer:function(e,t,n){return null==e||zn(e)||Bn(e)||Fn(e)||Qn(e)?e:Array.isArray(e)?xe.array(e,{name:n,deep:!1}):b(e)?xe.object(e,void 0,{name:n,deep:!1}):I(e)?xe.map(e,{name:n,deep:!1}):_(e)?xe.set(e,{name:n,deep:!1}):void 0}}),we=le("observable.struct",{enhancer:function(e,t){return cr(e,t)?t:e}}),Se=U(ve);function Ce(e){return!0===e.deep?Z:!1===e.deep?W:(t=e.defaultDecorator)&&null!=(n=null==(r=t.options_)?void 0:r.enhancer)?n:Z;var t,n,r}function Ee(e,t,n){if(!v(t))return tn(e)?e:b(e)?xe.object(e,t,n):Array.isArray(e)?xe.array(e,t):I(e)?xe.map(e,t):_(e)?xe.set(e,t):"object"==typeof e&&null!==e?e:xe.box(e,t);V(e,t,ve)}s(Ee,Se);var Ie,_e,xe=s(Ee,{box:function(e,t){var n=ye(t);return new Ke(e,Ce(n),n.name,!0,n.equals)},array:function(e,t){var n=ye(t);return(!1===lt.useProxies||!1===n.proxy?ir:wn)(e,Ce(n),n.name)},map:function(e,t){var n=ye(t);return new Mn(e,Ce(n),n.name)},set:function(e,t){var n=ye(t);return new Ln(e,Ce(n),n.name)},object:function(e,t,n){return Gt(!1===lt.useProxies||!1===(null==n?void 0:n.proxy)?Hn({},n):function(e,t){var n,r;return f(),null!=(r=(n=(e=Hn(e,t))[K]).proxy_)?r:n.proxy_=new Proxy(e,an)}({},n),e,t)},ref:U(Ae),shallow:U(be),deep:Se,struct:U(we)}),Pe="computed",ke=oe(Pe),Be=oe("computed.struct",{equals:z.structural}),Oe=function(e,t){if(v(t))return V(e,t,ke);if(b(e))return U(oe(Pe,e));var n=b(t)?t:{};return n.get=e,n.name||(n.name=e.name||""),new Ye(n)};Object.assign(Oe,ke),Oe.struct=U(Be);var Ne,De=0,je=1,Te=null!=(Ie=null==(_e=a((function(){}),"name"))?void 0:_e.configurable)&&Ie,Me={value:"action",configurable:!0,writable:!1,enumerable:!1};function Fe(e,t,n,r){function i(){return Re(0,n,t,r||this,arguments)}return void 0===n&&(n=!1),i.isMobxAction=!0,Te&&(Me.value=e,l(i,"name",Me)),i}function Re(e,t,n,i,o){var s=function(e,t,n,r){var i=lt.trackingDerivation,o=!t||!i;ht();var s=lt.allowStateChanges;o&&(et(),s=Qe(!0));var a={runAsAction_:o,prevDerivation_:i,prevAllowStateChanges_:s,prevAllowStateReads_:nt(!0),notifySpy_:!1,startTime_:0,actionId_:je++,parentActionId_:De};return De=a.actionId_,a}(0,t);try{return n.apply(i,o)}catch(e){throw s.error_=e,e}finally{!function(e){De!==e.actionId_&&r(30),De=e.parentActionId_,void 0!==e.error_&&(lt.suppressReactionErrors=!0),Ue(e.prevAllowStateChanges_),rt(e.prevAllowStateReads_),pt(),e.runAsAction_&&tt(e.prevDerivation_),lt.suppressReactionErrors=!1}(s)}}function Le(e,t){var n=Qe(e);try{return t()}finally{Ue(n)}}function Qe(e){var t=lt.allowStateChanges;return lt.allowStateChanges=e,t}function Ue(e){lt.allowStateChanges=e}Ne=Symbol.toPrimitive;var Ve,Ke=function(e){function t(t,n,r,i,o){var s;return void 0===r&&(r="ObservableValue"),void 0===i&&(i=!0),void 0===o&&(o=z.default),(s=e.call(this,r)||this).enhancer=void 0,s.name_=void 0,s.equals=void 0,s.hasUnreportedChange_=!1,s.interceptors_=void 0,s.changeListeners_=void 0,s.value_=void 0,s.dehancer=void 0,s.enhancer=n,s.name_=r,s.equals=o,s.value_=n(t,void 0,r),s}T(t,e);var n=t.prototype;return n.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},n.set=function(e){this.value_,(e=this.prepareNewValue_(e))!==lt.UNCHANGED&&this.setNewValue_(e)},n.prepareNewValue_=function(e){if(ln(this)){var t=un(this,{object:this,type:vn,newValue:e});if(!t)return lt.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value_,this.name_),this.equals(this.value_,e)?lt.UNCHANGED:e},n.setNewValue_=function(e){var t=this.value_;this.value_=e,this.reportChanged(),dn(this)&&pn(this,{type:vn,object:this,newValue:e,oldValue:t})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(e){return cn(this,e)},n.observe_=function(e,t){return t&&e({observableKind:"value",debugObjectName:this.name_,object:this,type:vn,newValue:this.value_,oldValue:void 0}),hn(this,e)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+"["+this.value_+"]"},n.valueOf=function(){return k(this.get())},n[Ne]=function(){return this.valueOf()},t}(H);Ve=Symbol.toPrimitive;var He,Ge,Ye=function(){function e(e){this.dependenciesState_=He.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.isBeingObserved_=!1,this.isPendingUnobservation_=!1,this.observers_=new Set,this.diffValue_=0,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=He.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new Ze(null),this.name_=void 0,this.triggeredBy_=void 0,this.isComputing_=!1,this.isRunningSetter_=!1,this.derivation=void 0,this.setter_=void 0,this.isTracing_=Ge.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,e.get||r(31),this.derivation=e.get,this.name_=e.name||"ComputedValue",e.set&&(this.setter_=Fe("ComputedValue-setter",e.set)),this.equals_=e.equals||(e.compareStructural||e.struct?z.structural:z.default),this.scope_=e.context,this.requiresReaction_=e.requiresReaction,this.keepAlive_=!!e.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){!function(e){e.lowestObserverState_===He.UP_TO_DATE_&&(e.lowestObserverState_=He.POSSIBLY_STALE_,e.observers_.forEach((function(e){e.dependenciesState_===He.UP_TO_DATE_&&(e.dependenciesState_=He.POSSIBLY_STALE_,e.onBecomeStale_())})))}(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach((function(e){return e()}))},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach((function(e){return e()}))},t.get=function(){if(this.isComputing_&&r(32,this.name_,this.derivation),0!==lt.inBatch||0!==this.observers_.size||this.keepAlive_){if(ft(this),qe(this)){var e=lt.trackingContext;this.keepAlive_&&!e&&(lt.trackingContext=this),this.trackAndCompute()&&function(e){e.lowestObserverState_!==He.STALE_&&(e.lowestObserverState_=He.STALE_,e.observers_.forEach((function(t){t.dependenciesState_===He.POSSIBLY_STALE_?t.dependenciesState_=He.STALE_:t.dependenciesState_===He.UP_TO_DATE_&&(e.lowestObserverState_=He.UP_TO_DATE_)})))}(this),lt.trackingContext=e}}else qe(this)&&(this.warnAboutUntrackedRead_(),ht(),this.value_=this.computeValue_(!1),pt());var t=this.value_;if(We(t))throw t.cause;return t},t.set=function(e){if(this.setter_){this.isRunningSetter_&&r(33,this.name_),this.isRunningSetter_=!0;try{this.setter_.call(this.scope_,e)}finally{this.isRunningSetter_=!1}}else r(34,this.name_)},t.trackAndCompute=function(){var e=this.value_,t=this.dependenciesState_===He.NOT_TRACKING_,n=this.computeValue_(!0),r=t||We(e)||We(n)||!this.equals_(e,n);return r&&(this.value_=n),r},t.computeValue_=function(e){this.isComputing_=!0;var t,n=Qe(!1);if(e)t=Je(this,this.derivation,this.scope_);else if(!0===lt.disableErrorBoundaries)t=this.derivation.call(this.scope_);else try{t=this.derivation.call(this.scope_)}catch(e){t=new Ze(e)}return Ue(n),this.isComputing_=!1,t},t.suspend_=function(){this.keepAlive_||(Xe(this),this.value_=void 0)},t.observe_=function(e,t){var n=this,r=!0,i=void 0;return Dt((function(){var o=n.get();if(!r||t){var s=et();e({observableKind:"computed",debugObjectName:n.name_,type:vn,object:n,newValue:o,oldValue:i}),tt(s)}r=!1,i=o}))},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return k(this.get())},t[Ve]=function(){return this.valueOf()},e}(),ze=E("ComputedValue",Ye);!function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"}(He||(He={})),function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(Ge||(Ge={}));var Ze=function(e){this.cause=void 0,this.cause=e};function We(e){return e instanceof Ze}function qe(e){switch(e.dependenciesState_){case He.UP_TO_DATE_:return!1;case He.NOT_TRACKING_:case He.STALE_:return!0;case He.POSSIBLY_STALE_:for(var t=nt(!0),n=et(),r=e.observing_,i=r.length,o=0;o<i;o++){var s=r[o];if(ze(s)){if(lt.disableErrorBoundaries)s.get();else try{s.get()}catch(e){return tt(n),rt(t),!0}if(e.dependenciesState_===He.STALE_)return tt(n),rt(t),!0}}return it(e),tt(n),rt(t),!1}}function Je(e,t,n){var r=nt(!0);it(e),e.newObserving_=new Array(e.observing_.length+100),e.unboundDepsCount_=0,e.runId_=++lt.runId;var i,o=lt.trackingDerivation;if(lt.trackingDerivation=e,lt.inBatch++,!0===lt.disableErrorBoundaries)i=t.call(n);else try{i=t.call(n)}catch(e){i=new Ze(e)}return lt.inBatch--,lt.trackingDerivation=o,function(e){for(var t=e.observing_,n=e.observing_=e.newObserving_,r=He.UP_TO_DATE_,i=0,o=e.unboundDepsCount_,s=0;s<o;s++){var a=n[s];0===a.diffValue_&&(a.diffValue_=1,i!==s&&(n[i]=a),i++),a.dependenciesState_>r&&(r=a.dependenciesState_)}for(n.length=i,e.newObserving_=null,o=t.length;o--;){var l=t[o];0===l.diffValue_&&ut(l,e),l.diffValue_=0}for(;i--;){var c=n[i];1===c.diffValue_&&(c.diffValue_=0,ct(c,e))}r!==He.UP_TO_DATE_&&(e.dependenciesState_=r,e.onBecomeStale_())}(e),rt(r),i}function Xe(e){var t=e.observing_;e.observing_=[];for(var n=t.length;n--;)ut(t[n],e);e.dependenciesState_=He.NOT_TRACKING_}function $e(e){var t=et();try{return e()}finally{tt(t)}}function et(){var e=lt.trackingDerivation;return lt.trackingDerivation=null,e}function tt(e){lt.trackingDerivation=e}function nt(e){var t=lt.allowStateReads;return lt.allowStateReads=e,t}function rt(e){lt.allowStateReads=e}function it(e){if(e.dependenciesState_!==He.UP_TO_DATE_){e.dependenciesState_=He.UP_TO_DATE_;for(var t=e.observing_,n=t.length;n--;)t[n].lowestObserverState_=He.UP_TO_DATE_}}var ot=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0,this.stateVersion=Number.MIN_SAFE_INTEGER},st=!0,at=!1,lt=function(){var e=o();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(st=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new ot).version&&(st=!1),st?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new ot):(setTimeout((function(){at||r(35)}),1),new ot)}();function ct(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function ut(e,t){e.observers_.delete(t),0===e.observers_.size&&dt(e)}function dt(e){!1===e.isPendingUnobservation_&&(e.isPendingUnobservation_=!0,lt.pendingUnobservations.push(e))}function ht(){lt.inBatch++}function pt(){if(0==--lt.inBatch){At();for(var e=lt.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation_=!1,0===n.observers_.size&&(n.isBeingObserved_&&(n.isBeingObserved_=!1,n.onBUO()),n instanceof Ye&&n.suspend_())}lt.pendingUnobservations=[]}}function ft(e){var t=lt.trackingDerivation;return null!==t?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved_&&lt.trackingContext&&(e.isBeingObserved_=!0,e.onBO())),e.isBeingObserved_):(0===e.observers_.size&&lt.inBatch>0&&dt(e),!1)}function gt(e){e.lowestObserverState_!==He.STALE_&&(e.lowestObserverState_=He.STALE_,e.observers_.forEach((function(e){e.dependenciesState_===He.UP_TO_DATE_&&e.onBecomeStale_(),e.dependenciesState_=He.STALE_})))}var mt=function(){function e(e,t,n,r){void 0===e&&(e="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=He.NOT_TRACKING_,this.diffValue_=0,this.runId_=0,this.unboundDepsCount_=0,this.isDisposed_=!1,this.isScheduled_=!1,this.isTrackPending_=!1,this.isRunning_=!1,this.isTracing_=Ge.NONE,this.name_=e,this.onInvalidate_=t,this.errorHandler_=n,this.requiresObservable_=r}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled_||(this.isScheduled_=!0,lt.pendingReactions.push(this),At())},t.isScheduled=function(){return this.isScheduled_},t.runReaction_=function(){if(!this.isDisposed_){ht(),this.isScheduled_=!1;var e=lt.trackingContext;if(lt.trackingContext=this,qe(this)){this.isTrackPending_=!0;try{this.onInvalidate_()}catch(e){this.reportExceptionInDerivation_(e)}}lt.trackingContext=e,pt()}},t.track=function(e){if(!this.isDisposed_){ht(),this.isRunning_=!0;var t=lt.trackingContext;lt.trackingContext=this;var n=Je(this,e,void 0);lt.trackingContext=t,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&Xe(this),We(n)&&this.reportExceptionInDerivation_(n.cause),pt()}},t.reportExceptionInDerivation_=function(e){var t=this;if(this.errorHandler_)this.errorHandler_(e,this);else{if(lt.disableErrorBoundaries)throw e;var n="[mobx] uncaught error in '"+this+"'";lt.suppressReactionErrors||console.error(n,e),lt.globalReactionErrorHandlers.forEach((function(n){return n(e,t)}))}},t.dispose=function(){this.isDisposed_||(this.isDisposed_=!0,this.isRunning_||(ht(),Xe(this),pt()))},t.getDisposer_=function(e){var t=this,n=function n(){t.dispose(),null==e||null==e.removeEventListener||e.removeEventListener("abort",n)};return null==e||null==e.addEventListener||e.addEventListener("abort",n),n[K]=this,n},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(e){void 0===e&&(e=!1)},e}(),yt=100,vt=function(e){return e()};function At(){lt.inBatch>0||lt.isRunningReactions||vt(bt)}function bt(){lt.isRunningReactions=!0;for(var e=lt.pendingReactions,t=0;e.length>0;){++t===yt&&(console.error("[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var n=e.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction_()}lt.isRunningReactions=!1}var wt=E("Reaction",mt),St="action",Ct="autoAction",Et=J(St),It=J("action.bound",{bound:!0}),_t=J(Ct,{autoAction:!0}),xt=J("autoAction.bound",{autoAction:!0,bound:!0});function Pt(e){return function(t,n){return y(t)?Fe(t.name||"<unnamed action>",t,e):y(n)?Fe(t,n,e):v(n)?V(t,n,e?_t:Et):v(t)?U(J(e?Ct:St,{name:t,autoAction:e})):void 0}}var kt=Pt(!1);Object.assign(kt,Et);var Bt=Pt(!0);function Ot(e){return Re(e.name,!1,e,this,void 0)}function Nt(e){return y(e)&&!0===e.isMobxAction}function Dt(e,t){var n,r,i,o,s;void 0===t&&(t=d);var a,l=null!=(n=null==(r=t)?void 0:r.name)?n:"Autorun";if(t.scheduler||t.delay){var c=Tt(t),u=!1;a=new mt(l,(function(){u||(u=!0,c((function(){u=!1,a.isDisposed_||a.track(h)})))}),t.onError,t.requiresObservable)}else a=new mt(l,(function(){this.track(h)}),t.onError,t.requiresObservable);function h(){e(a)}return null!=(i=t)&&null!=(o=i.signal)&&o.aborted||a.schedule_(),a.getDisposer_(null==(s=t)?void 0:s.signal)}Object.assign(Bt,_t),kt.bound=U(It),Bt.bound=U(xt);var jt=function(e){return e()};function Tt(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:jt}function Mt(e,t,n){var r,i,o,s;void 0===n&&(n=d);var a,l,c,u,h=null!=(r=n.name)?r:"Reaction",p=kt(h,n.onError?(a=n.onError,l=t,function(){try{return l.apply(this,arguments)}catch(e){a.call(this,e)}}):t),f=!n.scheduler&&!n.delay,g=Tt(n),m=!0,y=!1,v=n.compareStructural?z.structural:n.equals||z.default,A=new mt(h,(function(){m||f?b():y||(y=!0,g(b))}),n.onError,n.requiresObservable);function b(){if(y=!1,!A.isDisposed_){var t=!1;A.track((function(){var n=Le(!1,(function(){return e(A)}));t=m||!v(c,n),u=c,c=n})),(m&&n.fireImmediately||!m&&t)&&p(c,u,A),m=!1}}return null!=(i=n)&&null!=(o=i.signal)&&o.aborted||A.schedule_(),A.getDisposer_(null==(s=n)?void 0:s.signal)}var Ft="onBO",Rt="onBUO";function Lt(e,t,n){return Qt(Rt,e,t,n)}function Qt(e,t,n,r){var i="function"==typeof r?or(t,n):or(t),o=y(r)?r:n,s=e+"L";return i[s]?i[s].add(o):i[s]=new Set([o]),function(){var e=i[s];e&&(e.delete(o),0===e.size&&delete i[s])}}var Ut="never",Vt="always",Kt="observed";function Ht(e){!0===e.isolateGlobalState&&function(){if((lt.pendingReactions.length||lt.inBatch||lt.isRunningReactions)&&r(36),at=!0,st){var e=o();0==--e.__mobxInstanceCount&&(e.__mobxGlobals=void 0),lt=new ot}}();var t,n,i=e.useProxies,s=e.enforceActions;if(void 0!==i&&(lt.useProxies=i===Vt||i!==Ut&&"undefined"!=typeof Proxy),"ifavailable"===i&&(lt.verifyProxies=!0),void 0!==s){var a=s===Vt?Vt:s===Kt;lt.enforceActions=a,lt.allowStateChanges=!0!==a&&a!==Vt}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach((function(t){t in e&&(lt[t]=!!e[t])})),lt.allowStateReads=!lt.observableRequiresReaction,e.reactionScheduler&&(t=e.reactionScheduler,n=vt,vt=function(e){return t((function(){return n(e)}))})}function Gt(e,t,n,r){var i=O(t),o=Hn(e,r)[K];ht();try{P(i).forEach((function(e){o.extend_(e,i[e],!n||!(e in n)||n[e])}))}finally{pt()}return e}function Yt(e,t){return zt(or(e,t))}function zt(e){var t,n={name:e.name_};return e.observing_&&e.observing_.length>0&&(n.dependencies=(t=e.observing_,Array.from(new Set(t))).map(zt)),n}var Zt=0;function Wt(){this.message="FLOW_CANCELLED"}Wt.prototype=Object.create(Error.prototype);var qt=te("flow"),Jt=te("flow.bound",{bound:!0}),Xt=Object.assign((function(e,t){if(v(t))return V(e,t,qt);var n=e,r=n.name||"<unnamed flow>",i=function(){var e,t=arguments,i=++Zt,o=kt(r+" - runid: "+i+" - init",n).apply(this,t),s=void 0,a=new Promise((function(t,n){var a=0;function l(e){var t;s=void 0;try{t=kt(r+" - runid: "+i+" - yield "+a++,o.next).call(o,e)}catch(e){return n(e)}u(t)}function c(e){var t;s=void 0;try{t=kt(r+" - runid: "+i+" - yield "+a++,o.throw).call(o,e)}catch(e){return n(e)}u(t)}function u(e){if(!y(null==e?void 0:e.then))return e.done?t(e.value):(s=Promise.resolve(e.value)).then(l,c);e.then(u,n)}e=n,l(void 0)}));return a.cancel=kt(r+" - runid: "+i+" - cancel",(function(){try{s&&$t(s);var t=o.return(void 0),n=Promise.resolve(t.value);n.then(m,m),$t(n),e(new Wt)}catch(t){e(t)}})),a};return i.isMobXFlow=!0,i}),qt);function $t(e){y(e.cancel)&&e.cancel()}function en(e){return!0===(null==e?void 0:e.isMobXFlow)}function tn(e){return function(e,t){return!!e&&(void 0!==t?!!zn(e)&&e[K].values_.has(t):zn(e)||!!e[K]||G(e)||wt(e)||ze(e))}(e)}function nn(e,t){void 0===t&&(t=void 0),ht();try{return e.apply(t)}finally{pt()}}function rn(e,t,n){return 1===arguments.length||t&&"object"==typeof t?function(e,t){var n,r,i;if(null!=t&&null!=(n=t.signal)&&n.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var o=new Promise((function(n,o){var s,a=on(e,n,j({},t,{onError:o}));r=function(){a(),o(new Error("WHEN_CANCELLED"))},i=function(){a(),o(new Error("WHEN_ABORTED"))},null==t||null==(s=t.signal)||null==s.addEventListener||s.addEventListener("abort",i)})).finally((function(){var e;return null==t||null==(e=t.signal)||null==e.removeEventListener?void 0:e.removeEventListener("abort",i)}));return o.cancel=r,o}(e,t):on(e,t,n||{})}function on(e,t,n){var r;if("number"==typeof n.timeout){var i=new Error("WHEN_TIMEOUT");r=setTimeout((function(){if(!s[K].isDisposed_){if(s(),!n.onError)throw i;n.onError(i)}}),n.timeout)}n.name="When";var o=Fe("When-effect",t),s=Dt((function(t){Le(!1,e)&&(t.dispose(),r&&clearTimeout(r),o())}),n);return s}function sn(e){return e[K]}Xt.bound=U(Jt);var an={has:function(e,t){return sn(e).has_(t)},get:function(e,t){return sn(e).get_(t)},set:function(e,t,n){var r;return!!v(t)&&(null==(r=sn(e).set_(t,n,!0))||r)},deleteProperty:function(e,t){var n;return!!v(t)&&(null==(n=sn(e).delete_(t,!0))||n)},defineProperty:function(e,t,n){var r;return null==(r=sn(e).defineProperty_(t,n))||r},ownKeys:function(e){return sn(e).ownKeys_()},preventExtensions:function(e){r(13)}};function ln(e){return void 0!==e.interceptors_&&e.interceptors_.length>0}function cn(e,t){var n=e.interceptors_||(e.interceptors_=[]);return n.push(t),g((function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}))}function un(e,t){var n=et();try{for(var i=[].concat(e.interceptors_||[]),o=0,s=i.length;o<s&&((t=i[o](t))&&!t.type&&r(14),t);o++);return t}finally{tt(n)}}function dn(e){return void 0!==e.changeListeners_&&e.changeListeners_.length>0}function hn(e,t){var n=e.changeListeners_||(e.changeListeners_=[]);return n.push(t),g((function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}))}function pn(e,t){var n=et(),r=e.changeListeners_;if(r){for(var i=0,o=(r=r.slice()).length;i<o;i++)r[i](t);tt(n)}}function fn(e,t,n){var r=Hn(e,n)[K];ht();try{null!=t||(t=function(e){return B(e,Q)||S(e,Q,j({},e[Q])),e[Q]}(e)),P(t).forEach((function(e){return r.make_(e,t[e])}))}finally{pt()}return e}var gn=Symbol("mobx-keys");function mn(e,t,n){if(b(e))return Gt(e,e,t,n);var r=Hn(e,n)[K];if(!e[gn]){var i=Object.getPrototypeOf(e),o=new Set([].concat(P(e),P(i)));o.delete("constructor"),o.delete(K),S(i,gn,o)}ht();try{e[gn].forEach((function(e){return r.make_(e,!t||!(e in t)||t[e])}))}finally{pt()}return e}var yn="splice",vn="update",An={get:function(e,t){var n=e[K];return t===K?n:"length"===t?n.getArrayLength_():"string"!=typeof t||isNaN(t)?B(Sn,t)?Sn[t]:e[t]:n.get_(parseInt(t))},set:function(e,t,n){var r=e[K];return"length"===t&&r.setArrayLength_(n),"symbol"==typeof t||isNaN(t)?e[t]=n:r.set_(parseInt(t),n),!0},preventExtensions:function(){r(15)}},bn=function(){function e(e,t,n,r){void 0===e&&(e="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=n,this.legacyMode_=r,this.atom_=new H(e),this.enhancer_=function(e,n){return t(e,n,"ObservableArray[..]")}}var t=e.prototype;return t.dehanceValue_=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.dehanceValues_=function(e){return void 0!==this.dehancer&&e.length>0?e.map(this.dehancer):e},t.intercept_=function(e){return cn(this,e)},t.observe_=function(e,t){return void 0===t&&(t=!1),t&&e({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),hn(this,e)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(e){("number"!=typeof e||isNaN(e)||e<0)&&r("Out of range: "+e);var t=this.values_.length;if(e!==t)if(e>t){for(var n=new Array(e-t),i=0;i<e-t;i++)n[i]=void 0;this.spliceWithArray_(t,0,n)}else this.spliceWithArray_(e,t-e)},t.updateArrayLength_=function(e,t){e!==this.lastKnownLength_&&r(16),this.lastKnownLength_+=t,this.legacyMode_&&t>0&&rr(e+t+1)},t.spliceWithArray_=function(e,t,n){var r=this;this.atom_;var i=this.values_.length;if(void 0===e?e=0:e>i?e=i:e<0&&(e=Math.max(0,i+e)),t=1===arguments.length?i-e:null==t?0:Math.max(0,Math.min(t,i-e)),void 0===n&&(n=u),ln(this)){var o=un(this,{object:this.proxy_,type:yn,index:e,removedCount:t,added:n});if(!o)return u;t=o.removedCount,n=o.added}if(n=0===n.length?n:n.map((function(e){return r.enhancer_(e,void 0)})),this.legacyMode_){var s=n.length-t;this.updateArrayLength_(i,s)}var a=this.spliceItemsIntoValues_(e,t,n);return 0===t&&0===n.length||this.notifyArraySplice_(e,n,a),this.dehanceValues_(a)},t.spliceItemsIntoValues_=function(e,t,n){var r;if(n.length<1e4)return(r=this.values_).splice.apply(r,[e,t].concat(n));var i=this.values_.slice(e,e+t),o=this.values_.slice(e+t);this.values_.length+=n.length-t;for(var s=0;s<n.length;s++)this.values_[e+s]=n[s];for(var a=0;a<o.length;a++)this.values_[e+n.length+a]=o[a];return i},t.notifyArrayChildUpdate_=function(e,t,n){var r=!this.owned_&&!1,i=dn(this),o=i||r?{observableKind:"array",object:this.proxy_,type:vn,debugObjectName:this.atom_.name_,index:e,newValue:t,oldValue:n}:null;this.atom_.reportChanged(),i&&pn(this,o)},t.notifyArraySplice_=function(e,t,n){var r=!this.owned_&&!1,i=dn(this),o=i||r?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:yn,index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;this.atom_.reportChanged(),i&&pn(this,o)},t.get_=function(e){if(!(this.legacyMode_&&e>=this.values_.length))return this.atom_.reportObserved(),this.dehanceValue_(this.values_[e]);console.warn("[mobx] Out of bounds read: "+e)},t.set_=function(e,t){var n=this.values_;if(this.legacyMode_&&e>n.length&&r(17,e,n.length),e<n.length){this.atom_;var i=n[e];if(ln(this)){var o=un(this,{type:vn,object:this.proxy_,index:e,newValue:t});if(!o)return;t=o.newValue}(t=this.enhancer_(t,i))!==i&&(n[e]=t,this.notifyArrayChildUpdate_(e,t,i))}else{for(var s=new Array(e+1-n.length),a=0;a<s.length-1;a++)s[a]=void 0;s[s.length-1]=t,this.spliceWithArray_(n.length,0,s)}},e}();function wn(e,t,n,r){void 0===n&&(n="ObservableArray"),void 0===r&&(r=!1),f();var i=new bn(n,t,r,!1);C(i.values_,K,i);var o=new Proxy(i.values_,An);if(i.proxy_=o,e&&e.length){var s=Qe(!0);i.spliceWithArray_(0,0,e),Ue(s)}return o}var Sn={clear:function(){return this.splice(0)},replace:function(e){var t=this[K];return t.spliceWithArray_(0,t.values_.length,e)},toJSON:function(){return this.slice()},splice:function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var o=this[K];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(e);case 2:return o.spliceWithArray_(e,t)}return o.spliceWithArray_(e,t,r)},spliceWithArray:function(e,t,n){return this[K].spliceWithArray_(e,t,n)},push:function(){for(var e=this[K],t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.spliceWithArray_(e.values_.length,0,n),e.values_.length},pop:function(){return this.splice(Math.max(this[K].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var e=this[K],t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.spliceWithArray_(0,0,n),e.values_.length},reverse:function(){return lt.trackingDerivation&&r(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){lt.trackingDerivation&&r(37,"sort");var e=this.slice();return e.sort.apply(e,arguments),this.replace(e),this},remove:function(e){var t=this[K],n=t.dehanceValues_(t.values_).indexOf(e);return n>-1&&(this.splice(n,1),!0)}};function Cn(e,t){"function"==typeof Array.prototype[e]&&(Sn[e]=t(e))}function En(e){return function(){var t=this[K];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_);return n[e].apply(n,arguments)}}function In(e){return function(t,n){var r=this,i=this[K];return i.atom_.reportObserved(),i.dehanceValues_(i.values_)[e]((function(e,i){return t.call(n,e,i,r)}))}}function _n(e){return function(){var t=this,n=this[K];n.atom_.reportObserved();var r=n.dehanceValues_(n.values_),i=arguments[0];return arguments[0]=function(e,n,r){return i(e,n,r,t)},r[e].apply(r,arguments)}}Cn("concat",En),Cn("flat",En),Cn("includes",En),Cn("indexOf",En),Cn("join",En),Cn("lastIndexOf",En),Cn("slice",En),Cn("toString",En),Cn("toLocaleString",En),Cn("every",In),Cn("filter",In),Cn("find",In),Cn("findIndex",In),Cn("flatMap",In),Cn("forEach",In),Cn("map",In),Cn("some",In),Cn("reduce",_n),Cn("reduceRight",_n);var xn,Pn,kn=E("ObservableArrayAdministration",bn);function Bn(e){return A(e)&&kn(e[K])}var On={},Nn="add",Dn="delete";xn=Symbol.iterator,Pn=Symbol.toStringTag;var jn,Tn,Mn=function(){function e(e,t,n){var i=this;void 0===t&&(t=Z),void 0===n&&(n="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[K]=On,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=t,this.name_=n,y(Map)||r(18),this.keysAtom_=Y("ObservableMap.keys()"),this.data_=new Map,this.hasMap_=new Map,Le(!0,(function(){i.merge(e)}))}var t=e.prototype;return t.has_=function(e){return this.data_.has(e)},t.has=function(e){var t=this;if(!lt.trackingDerivation)return this.has_(e);var n=this.hasMap_.get(e);if(!n){var r=n=new Ke(this.has_(e),W,"ObservableMap.key?",!1);this.hasMap_.set(e,r),Lt(r,(function(){return t.hasMap_.delete(e)}))}return n.get()},t.set=function(e,t){var n=this.has_(e);if(ln(this)){var r=un(this,{type:n?vn:Nn,object:this,newValue:t,name:e});if(!r)return this;t=r.newValue}return n?this.updateValue_(e,t):this.addValue_(e,t),this},t.delete=function(e){var t=this;if(this.keysAtom_,ln(this)&&!un(this,{type:Dn,object:this,name:e}))return!1;if(this.has_(e)){var n=dn(this),r=n?{observableKind:"map",debugObjectName:this.name_,type:Dn,object:this,oldValue:this.data_.get(e).value_,name:e}:null;return nn((function(){var n;t.keysAtom_.reportChanged(),null==(n=t.hasMap_.get(e))||n.setNewValue_(!1),t.data_.get(e).setNewValue_(void 0),t.data_.delete(e)})),n&&pn(this,r),!0}return!1},t.updateValue_=function(e,t){var n=this.data_.get(e);if((t=n.prepareNewValue_(t))!==lt.UNCHANGED){var r=dn(this),i=r?{observableKind:"map",debugObjectName:this.name_,type:vn,object:this,oldValue:n.value_,name:e,newValue:t}:null;n.setNewValue_(t),r&&pn(this,i)}},t.addValue_=function(e,t){var n=this;this.keysAtom_,nn((function(){var r,i=new Ke(t,n.enhancer_,"ObservableMap.key",!1);n.data_.set(e,i),t=i.value_,null==(r=n.hasMap_.get(e))||r.setNewValue_(!0),n.keysAtom_.reportChanged()}));var r=dn(this),i=r?{observableKind:"map",debugObjectName:this.name_,type:Nn,object:this,name:e,newValue:t}:null;r&&pn(this,i)},t.get=function(e){return this.has(e)?this.dehanceValue_(this.data_.get(e).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var e=this,t=this.keys();return hr({next:function(){var n=t.next(),r=n.done,i=n.value;return{done:r,value:r?void 0:e.get(i)}}})},t.entries=function(){var e=this,t=this.keys();return hr({next:function(){var n=t.next(),r=n.done,i=n.value;return{done:r,value:r?void 0:[i,e.get(i)]}}})},t[xn]=function(){return this.entries()},t.forEach=function(e,t){for(var n,r=L(this);!(n=r()).done;){var i=n.value,o=i[0],s=i[1];e.call(t,s,o,this)}},t.merge=function(e){var t=this;return Fn(e)&&(e=new Map(e)),nn((function(){b(e)?function(e){var t=Object.keys(e);if(!x)return t;var n=Object.getOwnPropertySymbols(e);return n.length?[].concat(t,n.filter((function(t){return c.propertyIsEnumerable.call(e,t)}))):t}(e).forEach((function(n){return t.set(n,e[n])})):Array.isArray(e)?e.forEach((function(e){var n=e[0],r=e[1];return t.set(n,r)})):I(e)?(e.constructor!==Map&&r(19,e),e.forEach((function(e,n){return t.set(n,e)}))):null!=e&&r(20,e)})),this},t.clear=function(){var e=this;nn((function(){$e((function(){for(var t,n=L(e.keys());!(t=n()).done;){var r=t.value;e.delete(r)}}))}))},t.replace=function(e){var t=this;return nn((function(){for(var n,i=function(e){if(I(e)||Fn(e))return e;if(Array.isArray(e))return new Map(e);if(b(e)){var t=new Map;for(var n in e)t.set(n,e[n]);return t}return r(21,e)}(e),o=new Map,s=!1,a=L(t.data_.keys());!(n=a()).done;){var l=n.value;if(!i.has(l))if(t.delete(l))s=!0;else{var c=t.data_.get(l);o.set(l,c)}}for(var u,d=L(i.entries());!(u=d()).done;){var h=u.value,p=h[0],f=h[1],g=t.data_.has(p);if(t.set(p,f),t.data_.has(p)){var m=t.data_.get(p);o.set(p,m),g||(s=!0)}}if(!s)if(t.data_.size!==o.size)t.keysAtom_.reportChanged();else for(var y=t.data_.keys(),v=o.keys(),A=y.next(),w=v.next();!A.done;){if(A.value!==w.value){t.keysAtom_.reportChanged();break}A=y.next(),w=v.next()}t.data_=o})),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(e,t){return hn(this,e)},t.intercept_=function(e){return cn(this,e)},D(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Pn,get:function(){return"Map"}}]),e}(),Fn=E("ObservableMap",Mn),Rn={};jn=Symbol.iterator,Tn=Symbol.toStringTag;var Ln=function(){function e(e,t,n){void 0===t&&(t=Z),void 0===n&&(n="ObservableSet"),this.name_=void 0,this[K]=Rn,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=n,y(Set)||r(22),this.atom_=Y(this.name_),this.enhancer_=function(e,r){return t(e,r,n)},e&&this.replace(e)}var t=e.prototype;return t.dehanceValue_=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.clear=function(){var e=this;nn((function(){$e((function(){for(var t,n=L(e.data_.values());!(t=n()).done;){var r=t.value;e.delete(r)}}))}))},t.forEach=function(e,t){for(var n,r=L(this);!(n=r()).done;){var i=n.value;e.call(t,i,i,this)}},t.add=function(e){var t=this;if(this.atom_,ln(this)&&!un(this,{type:Nn,object:this,newValue:e}))return this;if(!this.has(e)){nn((function(){t.data_.add(t.enhancer_(e,void 0)),t.atom_.reportChanged()}));var n=dn(this),r=n?{observableKind:"set",debugObjectName:this.name_,type:Nn,object:this,newValue:e}:null;n&&pn(this,r)}return this},t.delete=function(e){var t=this;if(ln(this)&&!un(this,{type:Dn,object:this,oldValue:e}))return!1;if(this.has(e)){var n=dn(this),r=n?{observableKind:"set",debugObjectName:this.name_,type:Dn,object:this,oldValue:e}:null;return nn((function(){t.atom_.reportChanged(),t.data_.delete(e)})),n&&pn(this,r),!0}return!1},t.has=function(e){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(e))},t.entries=function(){var e=0,t=Array.from(this.keys()),n=Array.from(this.values());return hr({next:function(){var r=e;return e+=1,r<n.length?{value:[t[r],n[r]],done:!1}:{done:!0}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var e=this,t=0,n=Array.from(this.data_.values());return hr({next:function(){return t<n.length?{value:e.dehanceValue_(n[t++]),done:!1}:{done:!0}}})},t.replace=function(e){var t=this;return Qn(e)&&(e=new Set(e)),nn((function(){Array.isArray(e)||_(e)?(t.clear(),e.forEach((function(e){return t.add(e)}))):null!=e&&r("Cannot initialize set from "+e)})),this},t.observe_=function(e,t){return hn(this,e)},t.intercept_=function(e){return cn(this,e)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[jn]=function(){return this.values()},D(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Tn,get:function(){return"Set"}}]),e}(),Qn=E("ObservableSet",Ln),Un=Object.create(null),Vn="remove",Kn=function(){function e(e,t,n,r){void 0===t&&(t=new Map),void 0===r&&(r=he),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=e,this.values_=t,this.name_=n,this.defaultAnnotation_=r,this.keysAtom_=new H("ObservableObject.keys"),this.isPlainObject_=b(this.target_)}var t=e.prototype;return t.getObservablePropValue_=function(e){return this.values_.get(e).get()},t.setObservablePropValue_=function(e,t){var n=this.values_.get(e);if(n instanceof Ye)return n.set(t),!0;if(ln(this)){var r=un(this,{type:vn,object:this.proxy_||this.target_,name:e,newValue:t});if(!r)return null;t=r.newValue}if((t=n.prepareNewValue_(t))!==lt.UNCHANGED){var i=dn(this),o=i?{type:vn,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:n.value_,name:e,newValue:t}:null;n.setNewValue_(t),i&&pn(this,o)}return!0},t.get_=function(e){return lt.trackingDerivation&&!B(this.target_,e)&&this.has_(e),this.target_[e]},t.set_=function(e,t,n){return void 0===n&&(n=!1),B(this.target_,e)?this.values_.has(e)?this.setObservablePropValue_(e,t):n?Reflect.set(this.target_,e,t):(this.target_[e]=t,!0):this.extend_(e,{value:t,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,n)},t.has_=function(e){if(!lt.trackingDerivation)return e in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var t=this.pendingKeys_.get(e);return t||(t=new Ke(e in this.target_,W,"ObservableObject.key?",!1),this.pendingKeys_.set(e,t)),t.get()},t.make_=function(e,t){if(!0===t&&(t=this.defaultAnnotation_),!1!==t){if(!(e in this.target_)){var n;if(null!=(n=this.target_[Q])&&n[e])return;r(1,t.annotationType_,this.name_+"."+e.toString())}for(var i=this.target_;i&&i!==c;){var o=a(i,e);if(o){var s=t.make_(this,e,o,i);if(0===s)return;if(1===s)break}i=Object.getPrototypeOf(i)}Zn(this,0,e)}},t.extend_=function(e,t,n,r){if(void 0===r&&(r=!1),!0===n&&(n=this.defaultAnnotation_),!1===n)return this.defineProperty_(e,t,r);var i=n.extend_(this,e,t,r);return i&&Zn(this,0,e),i},t.defineProperty_=function(e,t,n){void 0===n&&(n=!1);try{ht();var r=this.delete_(e);if(!r)return r;if(ln(this)){var i=un(this,{object:this.proxy_||this.target_,name:e,type:Nn,newValue:t.value});if(!i)return null;var o=i.newValue;t.value!==o&&(t=j({},t,{value:o}))}if(n){if(!Reflect.defineProperty(this.target_,e,t))return!1}else l(this.target_,e,t);this.notifyPropertyAddition_(e,t.value)}finally{pt()}return!0},t.defineObservableProperty_=function(e,t,n,r){void 0===r&&(r=!1);try{ht();var i=this.delete_(e);if(!i)return i;if(ln(this)){var o=un(this,{object:this.proxy_||this.target_,name:e,type:Nn,newValue:t});if(!o)return null;t=o.newValue}var s=Yn(e),a={configurable:!lt.safeDescriptors||this.isPlainObject_,enumerable:!0,get:s.get,set:s.set};if(r){if(!Reflect.defineProperty(this.target_,e,a))return!1}else l(this.target_,e,a);var c=new Ke(t,n,"ObservableObject.key",!1);this.values_.set(e,c),this.notifyPropertyAddition_(e,c.value_)}finally{pt()}return!0},t.defineComputedProperty_=function(e,t,n){void 0===n&&(n=!1);try{ht();var r=this.delete_(e);if(!r)return r;if(ln(this)&&!un(this,{object:this.proxy_||this.target_,name:e,type:Nn,newValue:void 0}))return null;t.name||(t.name="ObservableObject.key"),t.context=this.proxy_||this.target_;var i=Yn(e),o={configurable:!lt.safeDescriptors||this.isPlainObject_,enumerable:!1,get:i.get,set:i.set};if(n){if(!Reflect.defineProperty(this.target_,e,o))return!1}else l(this.target_,e,o);this.values_.set(e,new Ye(t)),this.notifyPropertyAddition_(e,void 0)}finally{pt()}return!0},t.delete_=function(e,t){if(void 0===t&&(t=!1),!B(this.target_,e))return!0;if(ln(this)&&!un(this,{object:this.proxy_||this.target_,name:e,type:Vn}))return null;try{var n,r;ht();var i,o=dn(this),s=this.values_.get(e),l=void 0;if(!s&&o&&(l=null==(i=a(this.target_,e))?void 0:i.value),t){if(!Reflect.deleteProperty(this.target_,e))return!1}else delete this.target_[e];if(s&&(this.values_.delete(e),s instanceof Ke&&(l=s.value_),gt(s)),this.keysAtom_.reportChanged(),null==(n=this.pendingKeys_)||null==(r=n.get(e))||r.set(e in this.target_),o){var c={type:Vn,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:l,name:e};o&&pn(this,c)}}finally{pt()}return!0},t.observe_=function(e,t){return hn(this,e)},t.intercept_=function(e){return cn(this,e)},t.notifyPropertyAddition_=function(e,t){var n,r,i=dn(this);if(i){var o=i?{type:Nn,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:e,newValue:t}:null;i&&pn(this,o)}null==(n=this.pendingKeys_)||null==(r=n.get(e))||r.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),P(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function Hn(e,t){var n;if(B(e,K))return e;var r=null!=(n=null==t?void 0:t.name)?n:"ObservableObject",i=new Kn(e,new Map,String(r),function(e){var t;return e?null!=(t=e.defaultDecorator)?t:pe(e):void 0}(t));return S(e,K,i),e}var Gn=E("ObservableObjectAdministration",Kn);function Yn(e){return Un[e]||(Un[e]={get:function(){return this[K].getObservablePropValue_(e)},set:function(t){return this[K].setObservablePropValue_(e,t)}})}function zn(e){return!!A(e)&&Gn(e[K])}function Zn(e,t,n){var r;null==(r=e.target_[Q])||delete r[n]}var Wn,qn,Jn=tr(0),Xn=0,$n=function(){};Wn=$n,qn=Array.prototype,Object.setPrototypeOf?Object.setPrototypeOf(Wn.prototype,qn):void 0!==Wn.prototype.__proto__?Wn.prototype.__proto__=qn:Wn.prototype=qn;var er=function(e,t,n){function r(t,n,r,i){var o;void 0===r&&(r="ObservableArray"),void 0===i&&(i=!1),o=e.call(this)||this;var s=new bn(r,n,i,!0);if(s.proxy_=F(o),C(F(o),K,s),t&&t.length){var a=Qe(!0);o.spliceWithArray(0,0,t),Ue(a)}return Object.defineProperty(F(o),"0",Jn),o}T(r,e);var i=r.prototype;return i.concat=function(){this[K].atom_.reportObserved();for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Array.prototype.concat.apply(this.slice(),t.map((function(e){return Bn(e)?e.slice():e})))},i[n]=function(){var e=this,t=0;return hr({next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0,value:void 0}}})},D(r,[{key:"length",get:function(){return this[K].getArrayLength_()},set:function(e){this[K].setArrayLength_(e)}},{key:t,get:function(){return"Array"}}]),r}($n,Symbol.toStringTag,Symbol.iterator);function tr(e){return{enumerable:!1,configurable:!0,get:function(){return this[K].get_(e)},set:function(t){this[K].set_(e,t)}}}function nr(e){l(er.prototype,""+e,tr(e))}function rr(e){if(e>Xn){for(var t=Xn;t<e+100;t++)nr(t);Xn=e}}function ir(e,t,n){return new er(e,t,n)}function or(e,t){if("object"==typeof e&&null!==e){if(Bn(e))return void 0!==t&&r(23),e[K].atom_;if(Qn(e))return e.atom_;if(Fn(e)){if(void 0===t)return e.keysAtom_;var n=e.data_.get(t)||e.hasMap_.get(t);return n||r(25,t,ar(e)),n}if(zn(e)){if(!t)return r(26);var i=e[K].values_.get(t);return i||r(27,t,ar(e)),i}if(G(e)||ze(e)||wt(e))return e}else if(y(e)&&wt(e[K]))return e[K];r(28)}function sr(e,t){return e||r(29),void 0!==t?sr(or(e,t)):G(e)||ze(e)||wt(e)||Fn(e)||Qn(e)?e:e[K]?e[K]:void r(24,e)}function ar(e,t){var n;if(void 0!==t)n=or(e,t);else{if(Nt(e))return e.name;n=zn(e)||Fn(e)||Qn(e)?sr(e):or(e)}return n.name_}Object.entries(Sn).forEach((function(e){var t=e[0],n=e[1];"concat"!==t&&S(er.prototype,t,n)})),rr(1e3);var lr=c.toString;function cr(e,t,n){return void 0===n&&(n=-1),ur(e,t,n)}function ur(e,t,n,r,i){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!=e)return t!=t;var o=typeof e;if("function"!==o&&"object"!==o&&"object"!=typeof t)return!1;var s=lr.call(e);if(s!==lr.call(t))return!1;switch(s){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":n>=0&&n++}e=dr(e),t=dr(t);var a="[object Array]"===s;if(!a){if("object"!=typeof e||"object"!=typeof t)return!1;var l=e.constructor,c=t.constructor;if(l!==c&&!(y(l)&&l instanceof l&&y(c)&&c instanceof c)&&"constructor"in e&&"constructor"in t)return!1}if(0===n)return!1;n<0&&(n=-1),i=i||[];for(var u=(r=r||[]).length;u--;)if(r[u]===e)return i[u]===t;if(r.push(e),i.push(t),a){if((u=e.length)!==t.length)return!1;for(;u--;)if(!ur(e[u],t[u],n-1,r,i))return!1}else{var d,h=Object.keys(e);if(u=h.length,Object.keys(t).length!==u)return!1;for(;u--;)if(!B(t,d=h[u])||!ur(e[d],t[d],n-1,r,i))return!1}return r.pop(),i.pop(),!0}function dr(e){return Bn(e)?e.slice():I(e)||Fn(e)||_(e)||Qn(e)?Array.from(e.entries()):e}function hr(e){return e[Symbol.iterator]=pr,e}function pr(){return this}["Symbol","Map","Set"].forEach((function(e){void 0===o()[e]&&r("MobX requires global '"+e+"' to be available or polyfilled")})),"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:function(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}},extras:{getDebugName:ar},$mobx:K})},84371:(e,t,n)=>{"use strict";var r="win32"===process.platform,i=n(43335);function o(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r];i&&"."!==i&&(".."===i?n.length&&".."!==n[n.length-1]?n.pop():t&&n.push(".."):n.push(i))}return n}function s(e){for(var t=e.length-1,n=0;n<=t&&!e[n];n++);for(var r=t;r>=0&&!e[r];r--);return 0===n&&r===t?e:n>r?[]:e.slice(n,r+1)}var a=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,l=/^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/,c={};function u(e){var t=a.exec(e),n=(t[1]||"")+(t[2]||""),r=t[3]||"",i=l.exec(r);return[n,i[1],i[2],i[3]]}function d(e){var t=a.exec(e),n=t[1]||"",r=!!n&&":"!==n[1];return{device:n,isUnc:r,isAbsolute:r||!!t[2],tail:t[3]}}function h(e){return"\\\\"+e.replace(/^[\\\/]+/,"").replace(/[\\\/]+/g,"\\")}c.resolve=function(){for(var e="",t="",n=!1,r=arguments.length-1;r>=-1;r--){var s;if(r>=0?s=arguments[r]:e?(s=process.env["="+e])&&s.substr(0,3).toLowerCase()===e.toLowerCase()+"\\"||(s=e+"\\"):s=process.cwd(),!i.isString(s))throw new TypeError("Arguments to path.resolve must be strings");if(s){var a=d(s),l=a.device,c=a.isUnc,u=a.isAbsolute,p=a.tail;if((!l||!e||l.toLowerCase()===e.toLowerCase())&&(e||(e=l),n||(t=p+"\\"+t,n=u),e&&n))break}}return c&&(e=h(e)),e+(n?"\\":"")+(t=o(t.split(/[\\\/]+/),!n).join("\\"))||"."},c.normalize=function(e){var t=d(e),n=t.device,r=t.isUnc,i=t.isAbsolute,s=t.tail,a=/[\\\/]$/.test(s);return(s=o(s.split(/[\\\/]+/),!i).join("\\"))||i||(s="."),s&&a&&(s+="\\"),r&&(n=h(n)),n+(i?"\\":"")+s},c.isAbsolute=function(e){return d(e).isAbsolute},c.join=function(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(!i.isString(n))throw new TypeError("Arguments to path.join must be strings");n&&e.push(n)}var r=e.join("\\");return/^[\\\/]{2}[^\\\/]/.test(e[0])||(r=r.replace(/^[\\\/]{2,}/,"\\")),c.normalize(r)},c.relative=function(e,t){e=c.resolve(e),t=c.resolve(t);for(var n=e.toLowerCase(),r=t.toLowerCase(),i=s(t.split("\\")),o=s(n.split("\\")),a=s(r.split("\\")),l=Math.min(o.length,a.length),u=l,d=0;d<l;d++)if(o[d]!==a[d]){u=d;break}if(0==u)return t;var h=[];for(d=u;d<o.length;d++)h.push("..");return(h=h.concat(i.slice(u))).join("\\")},c._makeLong=function(e){if(!i.isString(e))return e;if(!e)return"";var t=c.resolve(e);return/^[a-zA-Z]\:\\/.test(t)?"\\\\?\\"+t:/^\\\\[^?.]/.test(t)?"\\\\?\\UNC\\"+t.substring(2):e},c.dirname=function(e){var t=u(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},c.basename=function(e,t){var n=u(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},c.extname=function(e){return u(e)[3]},c.format=function(e){if(!i.isObject(e))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof e);var t=e.root||"";if(!i.isString(t))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof e.root);var n=e.dir,r=e.base||"";return n?n[n.length-1]===c.sep?n+r:n+c.sep+r:r},c.parse=function(e){if(!i.isString(e))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var t=u(e);if(!t||4!==t.length)throw new TypeError("Invalid path '"+e+"'");return{root:t[0],dir:t[0]+t[1].slice(0,-1),base:t[2],ext:t[3],name:t[2].slice(0,t[2].length-t[3].length)}},c.sep="\\",c.delimiter=";";var p=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,f={};function g(e){return p.exec(e).slice(1)}f.resolve=function(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?arguments[n]:process.cwd();if(!i.isString(r))throw new TypeError("Arguments to path.resolve must be strings");r&&(e=r+"/"+e,t="/"===r[0])}return(t?"/":"")+(e=o(e.split("/"),!t).join("/"))||"."},f.normalize=function(e){var t=f.isAbsolute(e),n=e&&"/"===e[e.length-1];return(e=o(e.split("/"),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e},f.isAbsolute=function(e){return"/"===e.charAt(0)},f.join=function(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];if(!i.isString(n))throw new TypeError("Arguments to path.join must be strings");n&&(e+=e?"/"+n:n)}return f.normalize(e)},f.relative=function(e,t){e=f.resolve(e).substr(1),t=f.resolve(t).substr(1);for(var n=s(e.split("/")),r=s(t.split("/")),i=Math.min(n.length,r.length),o=i,a=0;a<i;a++)if(n[a]!==r[a]){o=a;break}var l=[];for(a=o;a<n.length;a++)l.push("..");return(l=l.concat(r.slice(o))).join("/")},f._makeLong=function(e){return e},f.dirname=function(e){var t=g(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},f.basename=function(e,t){var n=g(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},f.extname=function(e){return g(e)[3]},f.format=function(e){if(!i.isObject(e))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof e);var t=e.root||"";if(!i.isString(t))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof e.root);return(e.dir?e.dir+f.sep:"")+(e.base||"")},f.parse=function(e){if(!i.isString(e))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var t=g(e);if(!t||4!==t.length)throw new TypeError("Invalid path '"+e+"'");return t[1]=t[1]||"",t[2]=t[2]||"",t[3]=t[3]||"",{root:t[0],dir:t[0]+t[1].slice(0,-1),base:t[2],ext:t[3],name:t[2].slice(0,t[2].length-t[3].length)}},f.sep="/",f.delimiter=":",e.exports=r?c:f,e.exports.posix=f,e.exports.win32=c},54089:()=>{Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean},18267:()=>{Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}},6869:()=>{!function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(Prism)},89651:()=>{!function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Prism)},83701:()=>{!function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism)},64883:()=>{Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript},25031:()=>{!function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(/<inner>/g,(function(){return t})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+o+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+o+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike","code-snippet"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n<r;n++){var i=t[n];if("code"===i.type){var o=i.content[1],s=i.content[3];if(o&&s&&"code-language"===o.type&&"code-block"===s.type&&"string"==typeof o.content){var a=o.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),l="language-"+(a=(/[a-z][\w-]*/i.exec(a)||[""])[0].toLowerCase());s.alias?"string"==typeof s.alias?s.alias=[s.alias,l]:s.alias.push(l):s.alias=[l]}}else e(i.content)}}(e.tokens)})),e.hooks.add("wrap",(function(t){if("code-block"===t.type){for(var n="",r=0,i=t.classes.length;r<i;r++){var o=t.classes[r],c=/language-(.+)/.exec(o);if(c){n=c[1];break}}var u=e.languages[n];if(u)t.content=e.highlight(t.content.replace(s,"").replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,(function(e,t){var n;return"#"===(t=t.toLowerCase())[0]?(n="x"===t[1]?parseInt(t.slice(2),16):Number(t.slice(1)),l(n)):a[t]||e})),u,n);else if(n&&"none"!==n&&e.plugins.autoloader){var d="md-"+(new Date).valueOf()+"-"+Math.floor(1e16*Math.random());t.attributes.id=d,e.plugins.autoloader.loadLanguages(n,(function(){var t=document.getElementById(d);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))}))}}}));var s=RegExp(e.languages.markup.tag.pattern.source,"gi"),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(Prism)},55744:()=>{Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&amp;/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml},81412:()=>{Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec["class-name"],Prism.languages.objc=Prism.languages.objectivec},93133:()=>{!function(e){var t=e.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};t.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:t},boolean:t.boolean,variable:t.variable}}(Prism)},93980:()=>{Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python},80037:()=>{!function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,(function(){return t}));t=t.replace(/<self>/g,(function(){return/[^\s\S]/.source})),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(Prism)},98513:()=>{Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}},54422:()=>{Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ \t]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift["string-literal"].forEach((function(e){e.inside.interpolation.inside=Prism.languages.swift}))},63083:()=>{!function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(Prism)},18476:(e,t,n)=>{var r=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof o?new o(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function e(t,n){var r,o;switch(n=n||{},i.util.type(t)){case"Object":if(o=i.util.objId(t),n[o])return n[o];for(var s in r={},n[o]=r,t)t.hasOwnProperty(s)&&(r[s]=e(t[s],n));return r;case"Array":return o=i.util.objId(t),n[o]?n[o]:(r=[],n[o]=r,t.forEach((function(t,i){r[i]=e(t,n)})),r);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return"none"},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,"gi"),""),e.classList.add("language-"+n)},currentScript:function(){if("undefined"==typeof document)return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName("script");for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r="no-"+t;e;){var i=e.classList;if(i.contains(t))return!0;if(i.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,t){var n=i.util.clone(i.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){var o=(r=r||i.languages)[e],s={};for(var a in o)if(o.hasOwnProperty(a)){if(a==t)for(var l in n)n.hasOwnProperty(l)&&(s[l]=n[l]);n.hasOwnProperty(a)||(s[a]=o[a])}var c=r[e];return r[e]=s,i.languages.DFS(i.languages,(function(t,n){n===c&&t!=e&&(this[t]=s)})),s},DFS:function e(t,n,r,o){o=o||{};var s=i.util.objId;for(var a in t)if(t.hasOwnProperty(a)){n.call(t,a,t[a],r||a);var l=t[a],c=i.util.type(l);"Object"!==c||o[s(l)]?"Array"!==c||o[s(l)]||(o[s(l)]=!0,e(l,n,a,o)):(o[s(l)]=!0,e(l,n,null,o))}}},plugins:{},highlightAll:function(e,t){i.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};i.hooks.run("before-highlightall",r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),i.hooks.run("before-all-elements-highlight",r);for(var o,s=0;o=r.elements[s++];)i.highlightElement(o,!0===t,r.callback)},highlightElement:function(t,n,r){var o=i.util.getLanguage(t),s=i.languages[o];i.util.setLanguage(t,o);var a=t.parentElement;a&&"pre"===a.nodeName.toLowerCase()&&i.util.setLanguage(a,o);var l={element:t,language:o,grammar:s,code:t.textContent};function c(e){l.highlightedCode=e,i.hooks.run("before-insert",l),l.element.innerHTML=l.highlightedCode,i.hooks.run("after-highlight",l),i.hooks.run("complete",l),r&&r.call(l.element)}if(i.hooks.run("before-sanity-check",l),(a=l.element.parentElement)&&"pre"===a.nodeName.toLowerCase()&&!a.hasAttribute("tabindex")&&a.setAttribute("tabindex","0"),!l.code)return i.hooks.run("complete",l),void(r&&r.call(l.element));if(i.hooks.run("before-highlight",l),l.grammar)if(n&&e.Worker){var u=new Worker(i.filename);u.onmessage=function(e){c(e.data)},u.postMessage(JSON.stringify({language:l.language,code:l.code,immediateClose:!0}))}else c(i.highlight(l.code,l.grammar,l.language));else c(i.util.encode(l.code))},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(i.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=i.tokenize(r.code,r.grammar),i.hooks.run("after-tokenize",r),o.stringify(i.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new l;return c(i,i.head,e),a(e,i,t,i.head,0),function(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}(i)},hooks:{all:{},add:function(e,t){var n=i.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=i.hooks.all[e];if(n&&n.length)for(var r,o=0;r=n[o++];)r(t)}},Token:o};function o(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function s(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var o=i[1].length;i.index+=o,i[0]=i[0].slice(o)}return i}function a(e,t,n,r,l,d){for(var h in n)if(n.hasOwnProperty(h)&&n[h]){var p=n[h];p=Array.isArray(p)?p:[p];for(var f=0;f<p.length;++f){if(d&&d.cause==h+","+f)return;var g=p[f],m=g.inside,y=!!g.lookbehind,v=!!g.greedy,A=g.alias;if(v&&!g.pattern.global){var b=g.pattern.toString().match(/[imsuy]*$/)[0];g.pattern=RegExp(g.pattern.source,b+"g")}for(var w=g.pattern||g,S=r.next,C=l;S!==t.tail&&!(d&&C>=d.reach);C+=S.value.length,S=S.next){var E=S.value;if(t.length>e.length)return;if(!(E instanceof o)){var I,_=1;if(v){if(!(I=s(w,C,e,y))||I.index>=e.length)break;var x=I.index,P=I.index+I[0].length,k=C;for(k+=S.value.length;x>=k;)k+=(S=S.next).value.length;if(C=k-=S.value.length,S.value instanceof o)continue;for(var B=S;B!==t.tail&&(k<P||"string"==typeof B.value);B=B.next)_++,k+=B.value.length;_--,E=e.slice(C,k),I.index-=C}else if(!(I=s(w,0,E,y)))continue;x=I.index;var O=I[0],N=E.slice(0,x),D=E.slice(x+O.length),j=C+E.length;d&&j>d.reach&&(d.reach=j);var T=S.prev;if(N&&(T=c(t,T,N),C+=N.length),u(t,T,_),S=c(t,T,new o(h,m?i.tokenize(O,m):O,A,O)),D&&c(t,S,D),_>1){var M={cause:h+","+f,reach:j};a(e,t,n,S.prev,C,M),d&&M.reach>d.reach&&(d.reach=M.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function c(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function u(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}if(e.Prism=i,o.stringify=function e(t,n){if("string"==typeof t)return t;if(Array.isArray(t)){var r="";return t.forEach((function(t){r+=e(t,n)})),r}var o={type:t.type,content:e(t.content,n),tag:"span",classes:["token",t.type],attributes:{},language:n},s=t.alias;s&&(Array.isArray(s)?Array.prototype.push.apply(o.classes,s):o.classes.push(s)),i.hooks.run("wrap",o);var a="";for(var l in o.attributes)a+=" "+l+'="'+(o.attributes[l]||"").replace(/"/g,"&quot;")+'"';return"<"+o.tag+' class="'+o.classes.join(" ")+'"'+a+">"+o.content+"</"+o.tag+">"},!e.document)return e.addEventListener?(i.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),r=n.language,o=n.code,s=n.immediateClose;e.postMessage(i.highlight(o,i.languages[r],r)),s&&e.close()}),!1),i):i;var d=i.util.currentScript();function h(){i.manual||i.highlightAll()}if(d&&(i.filename=d.src,d.hasAttribute("data-manual")&&(i.manual=!0)),!i.manual){var p=document.readyState;"loading"===p||"interactive"===p&&d&&d.defer?document.addEventListener("DOMContentLoaded",h):window.requestAnimationFrame?window.requestAnimationFrame(h):window.setTimeout(h,16)}return i}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=r),void 0!==n.g&&(n.g.Prism=r),r.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},r.languages.markup.tag.inside["attr-value"].inside.entity=r.languages.markup.entity,r.languages.markup.doctype.inside["internal-subset"].inside=r.languages.markup,r.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&amp;/,"&"))})),Object.defineProperty(r.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:r.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};i["language-"+t]={pattern:/[\s\S]+/,inside:r.languages[t]};var o={};o[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:i},r.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(r.languages.markup.tag,"addAttribute",{value:function(e,t){r.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:r.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),r.languages.html=r.languages.markup,r.languages.mathml=r.languages.markup,r.languages.svg=r.languages.markup,r.languages.xml=r.languages.extend("markup",{}),r.languages.ssml=r.languages.xml,r.languages.atom=r.languages.xml,r.languages.rss=r.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(r),r.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},r.languages.javascript=r.languages.extend("clike",{"class-name":[r.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),r.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,r.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:r.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:r.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:r.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:r.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:r.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),r.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:r.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),r.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),r.languages.markup&&(r.languages.markup.tag.addInlined("script","javascript"),r.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),r.languages.js=r.languages.javascript,function(){if(void 0!==r&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},t="data-src-status",n="loading",i="loaded",o="pre[data-src]:not(["+t+'="'+i+'"]):not(['+t+'="'+n+'"])';r.hooks.add("before-highlightall",(function(e){e.selector+=", "+o})),r.hooks.add("before-sanity-check",(function(s){var a=s.element;if(a.matches(o)){s.code="",a.setAttribute(t,n);var l=a.appendChild(document.createElement("CODE"));l.textContent="Loading…";var c=a.getAttribute("data-src"),u=s.language;if("none"===u){var d=(/\.(\w+)$/.exec(c)||[,"none"])[1];u=e[d]||d}r.util.setLanguage(l,u),r.util.setLanguage(a,u);var h=r.plugins.autoloader;h&&h.loadLanguages(u),function(e,n,o){var s=new XMLHttpRequest;s.open("GET",e,!0),s.onreadystatechange=function(){4==s.readyState&&(s.status<400&&s.responseText?function(e){a.setAttribute(t,i);var n=function(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||"");if(t){var n=Number(t[1]),r=t[2],i=t[3];return r?i?[n,Number(i)]:[n,void 0]:[n,n]}}(a.getAttribute("data-range"));if(n){var o=e.split(/\r\n?|\n/g),s=n[0],c=null==n[1]?o.length:n[1];s<0&&(s+=o.length),s=Math.max(0,Math.min(s-1,o.length)),c<0&&(c+=o.length),c=Math.max(0,Math.min(c,o.length)),e=o.slice(s,c).join("\n"),a.hasAttribute("data-start")||a.setAttribute("data-start",String(s+1))}l.textContent=e,r.highlightElement(l)}(s.responseText):s.status>=400?o("✖ Error "+s.status+" while fetching file: "+s.statusText):o("✖ Error: File does not exist or is empty"))},s.send(null)}(c,0,(function(e){a.setAttribute(t,"failed"),l.textContent=e}))}})),r.plugins.fileHighlight={highlight:function(e){for(var t,n=(e||document).querySelectorAll(o),i=0;t=n[i++];)r.highlightElement(t)}};var s=!1;r.fileHighlight=function(){s||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),s=!0),r.plugins.fileHighlight.highlight.apply(this,arguments)}}}()},52967:(e,t,n)=>{"use strict";var r=n(2784),i=n(22941);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,a={};function l(e,t){c(e,t),c(e+"Capture",t)}function c(e,t){for(a[e]=t,e=0;e<t.length;e++)s.add(t[e])}var u=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),d=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},f={};function g(e,t,n,r,i,o,s){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var m={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){m[e]=new g(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];m[t]=new g(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){m[e]=new g(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){m[e]=new g(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){m[e]=new g(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){m[e]=new g(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){m[e]=new g(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){m[e]=new g(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){m[e]=new g(e,5,!1,e.toLowerCase(),null,!1,!1)}));var y=/[\-:]([a-z])/g;function v(e){return e[1].toUpperCase()}function A(e,t,n,r){var i=m.hasOwnProperty(t)?m[t]:null;(null!==i?0!==i.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!d.call(f,e)||!d.call(p,e)&&(h.test(e)?f[e]=!0:(p[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(y,v);m[t]=new g(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(y,v);m[t]=new g(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(y,v);m[t]=new g(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){m[e]=new g(e,1,!1,e.toLowerCase(),null,!1,!1)})),m.xlinkHref=new g("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){m[e]=new g(e,1,!1,e.toLowerCase(),null,!0,!0)}));var b=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for("react.element"),S=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),_=Symbol.for("react.provider"),x=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),N=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var D=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var j=Symbol.iterator;function T(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=j&&e[j]||e["@@iterator"])?e:null}var M,F=Object.assign;function R(e){if(void 0===M)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);M=t&&t[1]||""}return"\n"+M+e}var L=!1;function Q(e,t){if(!e||L)return"";L=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&"string"==typeof t.stack){for(var i=t.stack.split("\n"),o=r.stack.split("\n"),s=i.length-1,a=o.length-1;1<=s&&0<=a&&i[s]!==o[a];)a--;for(;1<=s&&0<=a;s--,a--)if(i[s]!==o[a]){if(1!==s||1!==a)do{if(s--,0>--a||i[s]!==o[a]){var l="\n"+i[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=s&&0<=a);break}}}finally{L=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?R(e):""}function U(e){switch(e.tag){case 5:return R(e.type);case 16:return R("Lazy");case 13:return R("Suspense");case 19:return R("SuspenseList");case 0:case 2:case 15:return Q(e.type,!1);case 11:return Q(e.type.render,!1);case 1:return Q(e.type,!0);default:return""}}function V(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case C:return"Fragment";case S:return"Portal";case I:return"Profiler";case E:return"StrictMode";case k:return"Suspense";case B:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case x:return(e.displayName||"Context")+".Consumer";case _:return(e._context.displayName||"Context")+".Provider";case P:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case O:return null!==(t=e.displayName||null)?t:V(e.type)||"Memo";case N:t=e._payload,e=e._init;try{return V(e(t))}catch(e){}}return null}function K(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return V(t);case 8:return t===E?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function H(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function G(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function Y(e){e._valueTracker||(e._valueTracker=function(e){var t=G(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function z(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=G(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function Z(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function W(e,t){var n=t.checked;return F({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function q(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=H(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function J(e,t){null!=(t=t.checked)&&A(e,"checked",t,!1)}function X(e,t){J(e,t);var n=H(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ee(e,t.type,n):t.hasOwnProperty("defaultValue")&&ee(e,t.type,H(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function $(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ee(e,t,n){"number"===t&&Z(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var te=Array.isArray;function ne(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+H(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function re(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(o(91));return F({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ie(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(o(92));if(te(n)){if(1<n.length)throw Error(o(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:H(n)}}function oe(e,t){var n=H(t.value),r=H(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function se(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function ae(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function le(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?ae(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ce,ue,de=(ue=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ce=ce||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return ue(e,t)}))}:ue);function he(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var pe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},fe=["Webkit","ms","Moz","O"];function ge(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||pe.hasOwnProperty(e)&&pe[e]?(""+t).trim():t+"px"}function me(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=ge(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(pe).forEach((function(e){fe.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),pe[t]=pe[e]}))}));var ye=F({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ve(e,t){if(t){if(ye[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(o(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(o(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(o(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(o(62))}}function Ae(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var be=null;function we(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Se=null,Ce=null,Ee=null;function Ie(e){if(e=mi(e)){if("function"!=typeof Se)throw Error(o(280));var t=e.stateNode;t&&(t=vi(t),Se(e.stateNode,e.type,t))}}function _e(e){Ce?Ee?Ee.push(e):Ee=[e]:Ce=e}function xe(){if(Ce){var e=Ce,t=Ee;if(Ee=Ce=null,Ie(e),t)for(e=0;e<t.length;e++)Ie(t[e])}}function Pe(e,t){return e(t)}function ke(){}var Be=!1;function Oe(e,t,n){if(Be)return e(t,n);Be=!0;try{return Pe(e,t,n)}finally{Be=!1,(null!==Ce||null!==Ee)&&(ke(),xe())}}function Ne(e,t){var n=e.stateNode;if(null===n)return null;var r=vi(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(o(231,t,typeof n));return n}var De=!1;if(u)try{var je={};Object.defineProperty(je,"passive",{get:function(){De=!0}}),window.addEventListener("test",je,je),window.removeEventListener("test",je,je)}catch(ue){De=!1}function Te(e,t,n,r,i,o,s,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(e){this.onError(e)}}var Me=!1,Fe=null,Re=!1,Le=null,Qe={onError:function(e){Me=!0,Fe=e}};function Ue(e,t,n,r,i,o,s,a,l){Me=!1,Fe=null,Te.apply(Qe,arguments)}function Ve(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Ke(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&null!==(e=e.alternate)&&(t=e.memoizedState),null!==t)return t.dehydrated}return null}function He(e){if(Ve(e)!==e)throw Error(o(188))}function Ge(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=Ve(e)))throw Error(o(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var s=i.alternate;if(null===s){if(null!==(r=i.return)){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return He(i),e;if(s===r)return He(i),t;s=s.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=s;else{for(var a=!1,l=i.child;l;){if(l===n){a=!0,n=i,r=s;break}if(l===r){a=!0,r=i,n=s;break}l=l.sibling}if(!a){for(l=s.child;l;){if(l===n){a=!0,n=s,r=i;break}if(l===r){a=!0,r=s,n=i;break}l=l.sibling}if(!a)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(3!==n.tag)throw Error(o(188));return n.stateNode.current===n?e:t}(e))?Ye(e):null}function Ye(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=Ye(e);if(null!==t)return t;e=e.sibling}return null}var ze=i.unstable_scheduleCallback,Ze=i.unstable_cancelCallback,We=i.unstable_shouldYield,qe=i.unstable_requestPaint,Je=i.unstable_now,Xe=i.unstable_getCurrentPriorityLevel,$e=i.unstable_ImmediatePriority,et=i.unstable_UserBlockingPriority,tt=i.unstable_NormalPriority,nt=i.unstable_LowPriority,rt=i.unstable_IdlePriority,it=null,ot=null,st=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(at(e)/lt|0)|0},at=Math.log,lt=Math.LN2,ct=64,ut=4194304;function dt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ht(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=268435455&n;if(0!==s){var a=s&~i;0!==a?r=dt(a):0!=(o&=s)&&(r=dt(o))}else 0!=(s=n&~i)?r=dt(s):0!==o&&(r=dt(o));if(0===r)return 0;if(0!==t&&t!==r&&0==(t&i)&&((i=r&-r)>=(o=t&-t)||16===i&&0!=(4194240&o)))return t;if(0!=(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-st(t)),r|=e[n],t&=~i;return r}function pt(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function ft(e){return 0!=(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function gt(){var e=ct;return 0==(4194240&(ct<<=1))&&(ct=64),e}function mt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function yt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-st(t)]=n}function vt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-st(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var At=0;function bt(e){return 1<(e&=-e)?4<e?0!=(268435455&e)?16:536870912:4:1}var wt,St,Ct,Et,It,_t=!1,xt=[],Pt=null,kt=null,Bt=null,Ot=new Map,Nt=new Map,Dt=[],jt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Tt(e,t){switch(e){case"focusin":case"focusout":Pt=null;break;case"dragenter":case"dragleave":kt=null;break;case"mouseover":case"mouseout":Bt=null;break;case"pointerover":case"pointerout":Ot.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Nt.delete(t.pointerId)}}function Mt(e,t,n,r,i,o){return null===e||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},null!==t&&null!==(t=mi(t))&&St(t),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function Ft(e){var t=gi(e.target);if(null!==t){var n=Ve(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Ke(n)))return e.blockedOn=t,void It(e.priority,(function(){Ct(n)}))}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Rt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Wt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=mi(n))&&St(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);be=r,n.target.dispatchEvent(r),be=null,t.shift()}return!0}function Lt(e,t,n){Rt(e)&&n.delete(t)}function Qt(){_t=!1,null!==Pt&&Rt(Pt)&&(Pt=null),null!==kt&&Rt(kt)&&(kt=null),null!==Bt&&Rt(Bt)&&(Bt=null),Ot.forEach(Lt),Nt.forEach(Lt)}function Ut(e,t){e.blockedOn===t&&(e.blockedOn=null,_t||(_t=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Qt)))}function Vt(e){function t(t){return Ut(t,e)}if(0<xt.length){Ut(xt[0],e);for(var n=1;n<xt.length;n++){var r=xt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==Pt&&Ut(Pt,e),null!==kt&&Ut(kt,e),null!==Bt&&Ut(Bt,e),Ot.forEach(t),Nt.forEach(t),n=0;n<Dt.length;n++)(r=Dt[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Dt.length&&null===(n=Dt[0]).blockedOn;)Ft(n),null===n.blockedOn&&Dt.shift()}var Kt=b.ReactCurrentBatchConfig,Ht=!0;function Gt(e,t,n,r){var i=At,o=Kt.transition;Kt.transition=null;try{At=1,zt(e,t,n,r)}finally{At=i,Kt.transition=o}}function Yt(e,t,n,r){var i=At,o=Kt.transition;Kt.transition=null;try{At=4,zt(e,t,n,r)}finally{At=i,Kt.transition=o}}function zt(e,t,n,r){if(Ht){var i=Wt(e,t,n,r);if(null===i)Ur(e,t,r,Zt,n),Tt(e,r);else if(function(e,t,n,r,i){switch(t){case"focusin":return Pt=Mt(Pt,e,t,n,r,i),!0;case"dragenter":return kt=Mt(kt,e,t,n,r,i),!0;case"mouseover":return Bt=Mt(Bt,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return Ot.set(o,Mt(Ot.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,Nt.set(o,Mt(Nt.get(o)||null,e,t,n,r,i)),!0}return!1}(i,e,t,n,r))r.stopPropagation();else if(Tt(e,r),4&t&&-1<jt.indexOf(e)){for(;null!==i;){var o=mi(i);if(null!==o&&wt(o),null===(o=Wt(e,t,n,r))&&Ur(e,t,r,Zt,n),o===i)break;i=o}null!==i&&r.stopPropagation()}else Ur(e,t,r,null,n)}}var Zt=null;function Wt(e,t,n,r){if(Zt=null,null!==(e=gi(e=we(r))))if(null===(t=Ve(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=Ke(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Zt=e,null}function qt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Xe()){case $e:return 1;case et:return 4;case tt:case nt:return 16;case rt:return 536870912;default:return 16}default:return 16}}var Jt=null,Xt=null,$t=null;function en(){if($t)return $t;var e,t,n=Xt,r=n.length,i="value"in Jt?Jt.value:Jt.textContent,o=i.length;for(e=0;e<r&&n[e]===i[e];e++);var s=r-e;for(t=1;t<=s&&n[r-t]===i[o-t];t++);return $t=i.slice(e,1<t?1-t:void 0)}function tn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function nn(){return!0}function rn(){return!1}function on(e){function t(t,n,r,i,o){for(var s in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(s)&&(t=e[s],this[s]=t?t(i):i[s]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?nn:rn,this.isPropagationStopped=rn,this}return F(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=nn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=nn)},persist:function(){},isPersistent:nn}),t}var sn,an,ln,cn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},un=on(cn),dn=F({},cn,{view:0,detail:0}),hn=on(dn),pn=F({},dn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:En,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ln&&(ln&&"mousemove"===e.type?(sn=e.screenX-ln.screenX,an=e.screenY-ln.screenY):an=sn=0,ln=e),sn)},movementY:function(e){return"movementY"in e?e.movementY:an}}),fn=on(pn),gn=on(F({},pn,{dataTransfer:0})),mn=on(F({},dn,{relatedTarget:0})),yn=on(F({},cn,{animationName:0,elapsedTime:0,pseudoElement:0})),vn=on(F({},cn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),An=on(F({},cn,{data:0})),bn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Sn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Cn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Sn[e])&&!!t[e]}function En(){return Cn}var In=on(F({},dn,{key:function(e){if(e.key){var t=bn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=tn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?wn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:En,charCode:function(e){return"keypress"===e.type?tn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?tn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),_n=on(F({},pn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),xn=on(F({},dn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:En})),Pn=on(F({},cn,{propertyName:0,elapsedTime:0,pseudoElement:0})),kn=on(F({},pn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Bn=[9,13,27,32],On=u&&"CompositionEvent"in window,Nn=null;u&&"documentMode"in document&&(Nn=document.documentMode);var Dn=u&&"TextEvent"in window&&!Nn,jn=u&&(!On||Nn&&8<Nn&&11>=Nn),Tn=String.fromCharCode(32),Mn=!1;function Fn(e,t){switch(e){case"keyup":return-1!==Bn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Ln=!1,Qn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Un(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Qn[e.type]:"textarea"===t}function Vn(e,t,n,r){_e(r),0<(t=Kr(t,"onChange")).length&&(n=new un("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Kn=null,Hn=null;function Gn(e){Tr(e,0)}function Yn(e){if(z(yi(e)))return e}function zn(e,t){if("change"===e)return t}var Zn=!1;if(u){var Wn;if(u){var qn="oninput"in document;if(!qn){var Jn=document.createElement("div");Jn.setAttribute("oninput","return;"),qn="function"==typeof Jn.oninput}Wn=qn}else Wn=!1;Zn=Wn&&(!document.documentMode||9<document.documentMode)}function Xn(){Kn&&(Kn.detachEvent("onpropertychange",$n),Hn=Kn=null)}function $n(e){if("value"===e.propertyName&&Yn(Hn)){var t=[];Vn(t,Hn,e,we(e)),Oe(Gn,t)}}function er(e,t,n){"focusin"===e?(Xn(),Hn=n,(Kn=t).attachEvent("onpropertychange",$n)):"focusout"===e&&Xn()}function tr(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Yn(Hn)}function nr(e,t){if("click"===e)return Yn(t)}function rr(e,t){if("input"===e||"change"===e)return Yn(t)}var ir="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function or(e,t){if(ir(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!d.call(t,i)||!ir(e[i],t[i]))return!1}return!0}function sr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ar(e,t){var n,r=sr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=sr(r)}}function lr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?lr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function cr(){for(var e=window,t=Z();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=Z((e=t.contentWindow).document)}return t}function ur(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function dr(e){var t=cr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&lr(n.ownerDocument.documentElement,n)){if(null!==r&&ur(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=void 0===r.end?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=ar(n,o);var s=ar(n,r);i&&s&&(1!==e.rangeCount||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&((t=t.createRange()).setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var hr=u&&"documentMode"in document&&11>=document.documentMode,pr=null,fr=null,gr=null,mr=!1;function yr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;mr||null==pr||pr!==Z(r)||(r="selectionStart"in(r=pr)&&ur(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},gr&&or(gr,r)||(gr=r,0<(r=Kr(fr,"onSelect")).length&&(t=new un("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=pr)))}function vr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ar={animationend:vr("Animation","AnimationEnd"),animationiteration:vr("Animation","AnimationIteration"),animationstart:vr("Animation","AnimationStart"),transitionend:vr("Transition","TransitionEnd")},br={},wr={};function Sr(e){if(br[e])return br[e];if(!Ar[e])return e;var t,n=Ar[e];for(t in n)if(n.hasOwnProperty(t)&&t in wr)return br[e]=n[t];return e}u&&(wr=document.createElement("div").style,"AnimationEvent"in window||(delete Ar.animationend.animation,delete Ar.animationiteration.animation,delete Ar.animationstart.animation),"TransitionEvent"in window||delete Ar.transitionend.transition);var Cr=Sr("animationend"),Er=Sr("animationiteration"),Ir=Sr("animationstart"),_r=Sr("transitionend"),xr=new Map,Pr="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function kr(e,t){xr.set(e,t),l(t,[e])}for(var Br=0;Br<Pr.length;Br++){var Or=Pr[Br];kr(Or.toLowerCase(),"on"+(Or[0].toUpperCase()+Or.slice(1)))}kr(Cr,"onAnimationEnd"),kr(Er,"onAnimationIteration"),kr(Ir,"onAnimationStart"),kr("dblclick","onDoubleClick"),kr("focusin","onFocus"),kr("focusout","onBlur"),kr(_r,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Dr=new Set("cancel close invalid load scroll toggle".split(" ").concat(Nr));function jr(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,i,s,a,l,c){if(Ue.apply(this,arguments),Me){if(!Me)throw Error(o(198));var u=Fe;Me=!1,Fe=null,Re||(Re=!0,Le=u)}}(r,t,void 0,e),e.currentTarget=null}function Tr(e,t){t=0!=(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==o&&i.isPropagationStopped())break e;jr(i,a,c),o=l}else for(s=0;s<r.length;s++){if(l=(a=r[s]).instance,c=a.currentTarget,a=a.listener,l!==o&&i.isPropagationStopped())break e;jr(i,a,c),o=l}}}if(Re)throw e=Le,Re=!1,Le=null,e}function Mr(e,t){var n=t[hi];void 0===n&&(n=t[hi]=new Set);var r=e+"__bubble";n.has(r)||(Qr(t,e,2,!1),n.add(r))}function Fr(e,t,n){var r=0;t&&(r|=4),Qr(n,e,r,t)}var Rr="_reactListening"+Math.random().toString(36).slice(2);function Lr(e){if(!e[Rr]){e[Rr]=!0,s.forEach((function(t){"selectionchange"!==t&&(Dr.has(t)||Fr(t,!1,e),Fr(t,!0,e))}));var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Rr]||(t[Rr]=!0,Fr("selectionchange",!1,t))}}function Qr(e,t,n,r){switch(qt(t)){case 1:var i=Gt;break;case 4:i=Yt;break;default:i=zt}n=i.bind(null,t,n,e),i=void 0,!De||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Ur(e,t,n,r,i){var o=r;if(0==(1&t)&&0==(2&t)&&null!==r)e:for(;;){if(null===r)return;var s=r.tag;if(3===s||4===s){var a=r.stateNode.containerInfo;if(a===i||8===a.nodeType&&a.parentNode===i)break;if(4===s)for(s=r.return;null!==s;){var l=s.tag;if((3===l||4===l)&&((l=s.stateNode.containerInfo)===i||8===l.nodeType&&l.parentNode===i))return;s=s.return}for(;null!==a;){if(null===(s=gi(a)))return;if(5===(l=s.tag)||6===l){r=o=s;continue e}a=a.parentNode}}r=r.return}Oe((function(){var r=o,i=we(n),s=[];e:{var a=xr.get(e);if(void 0!==a){var l=un,c=e;switch(e){case"keypress":if(0===tn(n))break e;case"keydown":case"keyup":l=In;break;case"focusin":c="focus",l=mn;break;case"focusout":c="blur",l=mn;break;case"beforeblur":case"afterblur":l=mn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=fn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=gn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=xn;break;case Cr:case Er:case Ir:l=yn;break;case _r:l=Pn;break;case"scroll":l=hn;break;case"wheel":l=kn;break;case"copy":case"cut":case"paste":l=vn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=_n}var u=0!=(4&t),d=!u&&"scroll"===e,h=u?null!==a?a+"Capture":null:a;u=[];for(var p,f=r;null!==f;){var g=(p=f).stateNode;if(5===p.tag&&null!==g&&(p=g,null!==h&&null!=(g=Ne(f,h))&&u.push(Vr(f,g,p))),d)break;f=f.return}0<u.length&&(a=new l(a,c,null,n,i),s.push({event:a,listeners:u}))}}if(0==(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(a="mouseover"===e||"pointerover"===e)||n===be||!(c=n.relatedTarget||n.fromElement)||!gi(c)&&!c[di])&&(l||a)&&(a=i.window===i?i:(a=i.ownerDocument)?a.defaultView||a.parentWindow:window,l?(l=r,null!==(c=(c=n.relatedTarget||n.toElement)?gi(c):null)&&(c!==(d=Ve(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(l=null,c=r),l!==c)){if(u=fn,g="onMouseLeave",h="onMouseEnter",f="mouse","pointerout"!==e&&"pointerover"!==e||(u=_n,g="onPointerLeave",h="onPointerEnter",f="pointer"),d=null==l?a:yi(l),p=null==c?a:yi(c),(a=new u(g,f+"leave",l,n,i)).target=d,a.relatedTarget=p,g=null,gi(i)===r&&((u=new u(h,f+"enter",c,n,i)).target=p,u.relatedTarget=d,g=u),d=g,l&&c)e:{for(h=c,f=0,p=u=l;p;p=Hr(p))f++;for(p=0,g=h;g;g=Hr(g))p++;for(;0<f-p;)u=Hr(u),f--;for(;0<p-f;)h=Hr(h),p--;for(;f--;){if(u===h||null!==h&&u===h.alternate)break e;u=Hr(u),h=Hr(h)}u=null}else u=null;null!==l&&Gr(s,a,l,u,!1),null!==c&&null!==d&&Gr(s,d,c,u,!0)}if("select"===(l=(a=r?yi(r):window).nodeName&&a.nodeName.toLowerCase())||"input"===l&&"file"===a.type)var m=zn;else if(Un(a))if(Zn)m=rr;else{m=tr;var y=er}else(l=a.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===a.type||"radio"===a.type)&&(m=nr);switch(m&&(m=m(e,r))?Vn(s,m,n,i):(y&&y(e,a,r),"focusout"===e&&(y=a._wrapperState)&&y.controlled&&"number"===a.type&&ee(a,"number",a.value)),y=r?yi(r):window,e){case"focusin":(Un(y)||"true"===y.contentEditable)&&(pr=y,fr=r,gr=null);break;case"focusout":gr=fr=pr=null;break;case"mousedown":mr=!0;break;case"contextmenu":case"mouseup":case"dragend":mr=!1,yr(s,n,i);break;case"selectionchange":if(hr)break;case"keydown":case"keyup":yr(s,n,i)}var v;if(On)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else Ln?Fn(e,n)&&(A="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(A="onCompositionStart");A&&(jn&&"ko"!==n.locale&&(Ln||"onCompositionStart"!==A?"onCompositionEnd"===A&&Ln&&(v=en()):(Xt="value"in(Jt=i)?Jt.value:Jt.textContent,Ln=!0)),0<(y=Kr(r,A)).length&&(A=new An(A,e,null,n,i),s.push({event:A,listeners:y}),(v||null!==(v=Rn(n)))&&(A.data=v))),(v=Dn?function(e,t){switch(e){case"compositionend":return Rn(t);case"keypress":return 32!==t.which?null:(Mn=!0,Tn);case"textInput":return(e=t.data)===Tn&&Mn?null:e;default:return null}}(e,n):function(e,t){if(Ln)return"compositionend"===e||!On&&Fn(e,t)?(e=en(),$t=Xt=Jt=null,Ln=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return jn&&"ko"!==t.locale?null:t.data}}(e,n))&&0<(r=Kr(r,"onBeforeInput")).length&&(i=new An("onBeforeInput","beforeinput",null,n,i),s.push({event:i,listeners:r}),i.data=v)}Tr(s,t)}))}function Vr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Kr(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,o=i.stateNode;5===i.tag&&null!==o&&(i=o,null!=(o=Ne(e,n))&&r.unshift(Vr(e,o,i)),null!=(o=Ne(e,t))&&r.push(Vr(e,o,i))),e=e.return}return r}function Hr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Gr(e,t,n,r,i){for(var o=t._reactName,s=[];null!==n&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(null!==l&&l===r)break;5===a.tag&&null!==c&&(a=c,i?null!=(l=Ne(n,o))&&s.unshift(Vr(n,l,a)):i||null!=(l=Ne(n,o))&&s.push(Vr(n,l,a))),n=n.return}0!==s.length&&e.push({event:t,listeners:s})}var Yr=/\r\n?/g,zr=/\u0000|\uFFFD/g;function Zr(e){return("string"==typeof e?e:""+e).replace(Yr,"\n").replace(zr,"")}function Wr(e,t,n){if(t=Zr(t),Zr(e)!==t&&n)throw Error(o(425))}function qr(){}var Jr=null,Xr=null;function $r(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ei="function"==typeof setTimeout?setTimeout:void 0,ti="function"==typeof clearTimeout?clearTimeout:void 0,ni="function"==typeof Promise?Promise:void 0,ri="function"==typeof queueMicrotask?queueMicrotask:void 0!==ni?function(e){return ni.resolve(null).then(e).catch(ii)}:ei;function ii(e){setTimeout((function(){throw e}))}function oi(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&8===i.nodeType)if("/$"===(n=i.data)){if(0===r)return e.removeChild(i),void Vt(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=i}while(n);Vt(t)}function si(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function ai(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var li=Math.random().toString(36).slice(2),ci="__reactFiber$"+li,ui="__reactProps$"+li,di="__reactContainer$"+li,hi="__reactEvents$"+li,pi="__reactListeners$"+li,fi="__reactHandles$"+li;function gi(e){var t=e[ci];if(t)return t;for(var n=e.parentNode;n;){if(t=n[di]||n[ci]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=ai(e);null!==e;){if(n=e[ci])return n;e=ai(e)}return t}n=(e=n).parentNode}return null}function mi(e){return!(e=e[ci]||e[di])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function yi(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(o(33))}function vi(e){return e[ui]||null}var Ai=[],bi=-1;function wi(e){return{current:e}}function Si(e){0>bi||(e.current=Ai[bi],Ai[bi]=null,bi--)}function Ci(e,t){bi++,Ai[bi]=e.current,e.current=t}var Ei={},Ii=wi(Ei),_i=wi(!1),xi=Ei;function Pi(e,t){var n=e.type.contextTypes;if(!n)return Ei;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function ki(e){return null!=e.childContextTypes}function Bi(){Si(_i),Si(Ii)}function Oi(e,t,n){if(Ii.current!==Ei)throw Error(o(168));Ci(Ii,t),Ci(_i,n)}function Ni(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in t))throw Error(o(108,K(e)||"Unknown",i));return F({},n,r)}function Di(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ei,xi=Ii.current,Ci(Ii,e),Ci(_i,_i.current),!0}function ji(e,t,n){var r=e.stateNode;if(!r)throw Error(o(169));n?(e=Ni(e,t,xi),r.__reactInternalMemoizedMergedChildContext=e,Si(_i),Si(Ii),Ci(Ii,e)):Si(_i),Ci(_i,n)}var Ti=null,Mi=!1,Fi=!1;function Ri(e){null===Ti?Ti=[e]:Ti.push(e)}function Li(){if(!Fi&&null!==Ti){Fi=!0;var e=0,t=At;try{var n=Ti;for(At=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}Ti=null,Mi=!1}catch(t){throw null!==Ti&&(Ti=Ti.slice(e+1)),ze($e,Li),t}finally{At=t,Fi=!1}}return null}var Qi=[],Ui=0,Vi=null,Ki=0,Hi=[],Gi=0,Yi=null,zi=1,Zi="";function Wi(e,t){Qi[Ui++]=Ki,Qi[Ui++]=Vi,Vi=e,Ki=t}function qi(e,t,n){Hi[Gi++]=zi,Hi[Gi++]=Zi,Hi[Gi++]=Yi,Yi=e;var r=zi;e=Zi;var i=32-st(r)-1;r&=~(1<<i),n+=1;var o=32-st(t)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,zi=1<<32-st(t)+i|n<<i|r,Zi=o+e}else zi=1<<o|n<<i|r,Zi=e}function Ji(e){null!==e.return&&(Wi(e,1),qi(e,1,0))}function Xi(e){for(;e===Vi;)Vi=Qi[--Ui],Qi[Ui]=null,Ki=Qi[--Ui],Qi[Ui]=null;for(;e===Yi;)Yi=Hi[--Gi],Hi[Gi]=null,Zi=Hi[--Gi],Hi[Gi]=null,zi=Hi[--Gi],Hi[Gi]=null}var $i=null,eo=null,to=!1,no=null;function ro(e,t){var n=kc(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function io(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,$i=e,eo=si(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,$i=e,eo=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==Yi?{id:zi,overflow:Zi}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=kc(18,null,null,0)).stateNode=t,n.return=e,e.child=n,$i=e,eo=null,!0);default:return!1}}function oo(e){return 0!=(1&e.mode)&&0==(128&e.flags)}function so(e){if(to){var t=eo;if(t){var n=t;if(!io(e,t)){if(oo(e))throw Error(o(418));t=si(n.nextSibling);var r=$i;t&&io(e,t)?ro(r,n):(e.flags=-4097&e.flags|2,to=!1,$i=e)}}else{if(oo(e))throw Error(o(418));e.flags=-4097&e.flags|2,to=!1,$i=e}}}function ao(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;$i=e}function lo(e){if(e!==$i)return!1;if(!to)return ao(e),to=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!$r(e.type,e.memoizedProps)),t&&(t=eo)){if(oo(e))throw co(),Error(o(418));for(;t;)ro(e,t),t=si(t.nextSibling)}if(ao(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(o(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){eo=si(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}eo=null}}else eo=$i?si(e.stateNode.nextSibling):null;return!0}function co(){for(var e=eo;e;)e=si(e.nextSibling)}function uo(){eo=$i=null,to=!1}function ho(e){null===no?no=[e]:no.push(e)}var po=b.ReactCurrentBatchConfig;function fo(e,t){if(e&&e.defaultProps){for(var n in t=F({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var go=wi(null),mo=null,yo=null,vo=null;function Ao(){vo=yo=mo=null}function bo(e){var t=go.current;Si(go),e._currentValue=t}function wo(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function So(e,t){mo=e,vo=yo=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(ya=!0),e.firstContext=null)}function Co(e){var t=e._currentValue;if(vo!==e)if(e={context:e,memoizedValue:t,next:null},null===yo){if(null===mo)throw Error(o(308));yo=e,mo.dependencies={lanes:0,firstContext:e}}else yo=yo.next=e;return t}var Eo=null;function Io(e){null===Eo?Eo=[e]:Eo.push(e)}function _o(e,t,n,r){var i=t.interleaved;return null===i?(n.next=n,Io(t)):(n.next=i.next,i.next=n),t.interleaved=n,xo(e,r)}function xo(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Po=!1;function ko(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Bo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Oo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function No(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,0!=(2&_l)){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,xo(e,n)}return null===(i=r.interleaved)?(t.next=t,Io(r)):(t.next=i.next,i.next=t),r.interleaved=t,xo(e,n)}function Do(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!=(4194240&n))){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,vt(e,n)}}function jo(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===o?i=o=s:o=o.next=s,n=n.next}while(null!==n);null===o?i=o=t:o=o.next=t}else i=o=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function To(e,t,n,r){var i=e.updateQueue;Po=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(null!==a){i.shared.pending=null;var l=a,c=l.next;l.next=null,null===s?o=c:s.next=c,s=l;var u=e.alternate;null!==u&&(a=(u=u.updateQueue).lastBaseUpdate)!==s&&(null===a?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l)}if(null!==o){var d=i.baseState;for(s=0,u=c=l=null,a=o;;){var h=a.lane,p=a.eventTime;if((r&h)===h){null!==u&&(u=u.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var f=e,g=a;switch(h=t,p=n,g.tag){case 1:if("function"==typeof(f=g.payload)){d=f.call(p,d,h);break e}d=f;break e;case 3:f.flags=-65537&f.flags|128;case 0:if(null==(h="function"==typeof(f=g.payload)?f.call(p,d,h):f))break e;d=F({},d,h);break e;case 2:Po=!0}}null!==a.callback&&0!==a.lane&&(e.flags|=64,null===(h=i.effects)?i.effects=[a]:h.push(a))}else p={eventTime:p,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===u?(c=u=p,l=d):u=u.next=p,s|=h;if(null===(a=a.next)){if(null===(a=i.shared.pending))break;a=(h=a).next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}if(null===u&&(l=d),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,null!==(t=i.shared.interleaved)){i=t;do{s|=i.lane,i=i.next}while(i!==t)}else null===o&&(i.shared.lanes=0);jl|=s,e.lanes=s,e.memoizedState=d}}function Mo(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(null!==i){if(r.callback=null,r=n,"function"!=typeof i)throw Error(o(191,i));i.call(r)}}}var Fo=(new r.Component).refs;function Ro(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:F({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var Lo={isMounted:function(e){return!!(e=e._reactInternals)&&Ve(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Xl(),i=$l(e),o=Oo(r,i);o.payload=t,null!=n&&(o.callback=n),null!==(t=No(e,o,i))&&(ec(t,e,i,r),Do(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Xl(),i=$l(e),o=Oo(r,i);o.tag=1,o.payload=t,null!=n&&(o.callback=n),null!==(t=No(e,o,i))&&(ec(t,e,i,r),Do(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Xl(),r=$l(e),i=Oo(n,r);i.tag=2,null!=t&&(i.callback=t),null!==(t=No(e,i,r))&&(ec(t,e,r,n),Do(t,e,r))}};function Qo(e,t,n,r,i,o,s){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,o,s):!(t.prototype&&t.prototype.isPureReactComponent&&or(n,r)&&or(i,o))}function Uo(e,t,n){var r=!1,i=Ei,o=t.contextType;return"object"==typeof o&&null!==o?o=Co(o):(i=ki(t)?xi:Ii.current,o=(r=null!=(r=t.contextTypes))?Pi(e,i):Ei),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=Lo,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function Vo(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Lo.enqueueReplaceState(t,t.state,null)}function Ko(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=Fo,ko(e);var o=t.contextType;"object"==typeof o&&null!==o?i.context=Co(o):(o=ki(t)?xi:Ii.current,i.context=Pi(e,o)),i.state=e.memoizedState,"function"==typeof(o=t.getDerivedStateFromProps)&&(Ro(e,t,o,n),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&Lo.enqueueReplaceState(i,i.state,null),To(e,n,i,r),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4194308)}function Ho(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(o(309));var r=n.stateNode}if(!r)throw Error(o(147,e));var i=r,s=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===s?t.ref:(t=function(e){var t=i.refs;t===Fo&&(t=i.refs={}),null===e?delete t[s]:t[s]=e},t._stringRef=s,t)}if("string"!=typeof e)throw Error(o(284));if(!n._owner)throw Error(o(290,e))}return e}function Go(e,t){throw e=Object.prototype.toString.call(t),Error(o(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Yo(e){return(0,e._init)(e._payload)}function zo(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=Oc(e,t)).index=0,e.sibling=null,e}function s(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function a(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Tc(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function c(e,t,n,r){var o=n.type;return o===C?d(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===o||"object"==typeof o&&null!==o&&o.$$typeof===N&&Yo(o)===t.type)?((r=i(t,n.props)).ref=Ho(e,t,n),r.return=e,r):((r=Nc(n.type,n.key,n.props,null,e.mode,r)).ref=Ho(e,t,n),r.return=e,r)}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Mc(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function d(e,t,n,r,o){return null===t||7!==t.tag?((t=Dc(n,e.mode,r,o)).return=e,t):((t=i(t,n)).return=e,t)}function h(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=Tc(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case w:return(n=Nc(t.type,t.key,t.props,null,e.mode,n)).ref=Ho(e,null,t),n.return=e,n;case S:return(t=Mc(t,e.mode,n)).return=e,t;case N:return h(e,(0,t._init)(t._payload),n)}if(te(t)||T(t))return(t=Dc(t,e.mode,n,null)).return=e,t;Go(e,t)}return null}function p(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==i?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case w:return n.key===i?c(e,t,n,r):null;case S:return n.key===i?u(e,t,n,r):null;case N:return p(e,t,(i=n._init)(n._payload),r)}if(te(n)||T(n))return null!==i?null:d(e,t,n,r,null);Go(e,n)}return null}function f(e,t,n,r,i){if("string"==typeof r&&""!==r||"number"==typeof r)return l(t,e=e.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case w:return c(t,e=e.get(null===r.key?n:r.key)||null,r,i);case S:return u(t,e=e.get(null===r.key?n:r.key)||null,r,i);case N:return f(e,t,n,(0,r._init)(r._payload),i)}if(te(r)||T(r))return d(t,e=e.get(n)||null,r,i,null);Go(t,r)}return null}function g(i,o,a,l){for(var c=null,u=null,d=o,g=o=0,m=null;null!==d&&g<a.length;g++){d.index>g?(m=d,d=null):m=d.sibling;var y=p(i,d,a[g],l);if(null===y){null===d&&(d=m);break}e&&d&&null===y.alternate&&t(i,d),o=s(y,o,g),null===u?c=y:u.sibling=y,u=y,d=m}if(g===a.length)return n(i,d),to&&Wi(i,g),c;if(null===d){for(;g<a.length;g++)null!==(d=h(i,a[g],l))&&(o=s(d,o,g),null===u?c=d:u.sibling=d,u=d);return to&&Wi(i,g),c}for(d=r(i,d);g<a.length;g++)null!==(m=f(d,i,g,a[g],l))&&(e&&null!==m.alternate&&d.delete(null===m.key?g:m.key),o=s(m,o,g),null===u?c=m:u.sibling=m,u=m);return e&&d.forEach((function(e){return t(i,e)})),to&&Wi(i,g),c}function m(i,a,l,c){var u=T(l);if("function"!=typeof u)throw Error(o(150));if(null==(l=u.call(l)))throw Error(o(151));for(var d=u=null,g=a,m=a=0,y=null,v=l.next();null!==g&&!v.done;m++,v=l.next()){g.index>m?(y=g,g=null):y=g.sibling;var A=p(i,g,v.value,c);if(null===A){null===g&&(g=y);break}e&&g&&null===A.alternate&&t(i,g),a=s(A,a,m),null===d?u=A:d.sibling=A,d=A,g=y}if(v.done)return n(i,g),to&&Wi(i,m),u;if(null===g){for(;!v.done;m++,v=l.next())null!==(v=h(i,v.value,c))&&(a=s(v,a,m),null===d?u=v:d.sibling=v,d=v);return to&&Wi(i,m),u}for(g=r(i,g);!v.done;m++,v=l.next())null!==(v=f(g,i,m,v.value,c))&&(e&&null!==v.alternate&&g.delete(null===v.key?m:v.key),a=s(v,a,m),null===d?u=v:d.sibling=v,d=v);return e&&g.forEach((function(e){return t(i,e)})),to&&Wi(i,m),u}return function e(r,o,s,l){if("object"==typeof s&&null!==s&&s.type===C&&null===s.key&&(s=s.props.children),"object"==typeof s&&null!==s){switch(s.$$typeof){case w:e:{for(var c=s.key,u=o;null!==u;){if(u.key===c){if((c=s.type)===C){if(7===u.tag){n(r,u.sibling),(o=i(u,s.props.children)).return=r,r=o;break e}}else if(u.elementType===c||"object"==typeof c&&null!==c&&c.$$typeof===N&&Yo(c)===u.type){n(r,u.sibling),(o=i(u,s.props)).ref=Ho(r,u,s),o.return=r,r=o;break e}n(r,u);break}t(r,u),u=u.sibling}s.type===C?((o=Dc(s.props.children,r.mode,l,s.key)).return=r,r=o):((l=Nc(s.type,s.key,s.props,null,r.mode,l)).ref=Ho(r,o,s),l.return=r,r=l)}return a(r);case S:e:{for(u=s.key;null!==o;){if(o.key===u){if(4===o.tag&&o.stateNode.containerInfo===s.containerInfo&&o.stateNode.implementation===s.implementation){n(r,o.sibling),(o=i(o,s.children||[])).return=r,r=o;break e}n(r,o);break}t(r,o),o=o.sibling}(o=Mc(s,r.mode,l)).return=r,r=o}return a(r);case N:return e(r,o,(u=s._init)(s._payload),l)}if(te(s))return g(r,o,s,l);if(T(s))return m(r,o,s,l);Go(r,s)}return"string"==typeof s&&""!==s||"number"==typeof s?(s=""+s,null!==o&&6===o.tag?(n(r,o.sibling),(o=i(o,s)).return=r,r=o):(n(r,o),(o=Tc(s,r.mode,l)).return=r,r=o),a(r)):n(r,o)}}var Zo=zo(!0),Wo=zo(!1),qo={},Jo=wi(qo),Xo=wi(qo),$o=wi(qo);function es(e){if(e===qo)throw Error(o(174));return e}function ts(e,t){switch(Ci($o,t),Ci(Xo,e),Ci(Jo,qo),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:le(null,"");break;default:t=le(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Si(Jo),Ci(Jo,t)}function ns(){Si(Jo),Si(Xo),Si($o)}function rs(e){es($o.current);var t=es(Jo.current),n=le(t,e.type);t!==n&&(Ci(Xo,e),Ci(Jo,n))}function is(e){Xo.current===e&&(Si(Jo),Si(Xo))}var os=wi(0);function ss(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var as=[];function ls(){for(var e=0;e<as.length;e++)as[e]._workInProgressVersionPrimary=null;as.length=0}var cs=b.ReactCurrentDispatcher,us=b.ReactCurrentBatchConfig,ds=0,hs=null,ps=null,fs=null,gs=!1,ms=!1,ys=0,vs=0;function As(){throw Error(o(321))}function bs(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ir(e[n],t[n]))return!1;return!0}function ws(e,t,n,r,i,s){if(ds=s,hs=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,cs.current=null===e||null===e.memoizedState?ia:oa,e=n(r,i),ms){s=0;do{if(ms=!1,ys=0,25<=s)throw Error(o(301));s+=1,fs=ps=null,t.updateQueue=null,cs.current=sa,e=n(r,i)}while(ms)}if(cs.current=ra,t=null!==ps&&null!==ps.next,ds=0,fs=ps=hs=null,gs=!1,t)throw Error(o(300));return e}function Ss(){var e=0!==ys;return ys=0,e}function Cs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===fs?hs.memoizedState=fs=e:fs=fs.next=e,fs}function Es(){if(null===ps){var e=hs.alternate;e=null!==e?e.memoizedState:null}else e=ps.next;var t=null===fs?hs.memoizedState:fs.next;if(null!==t)fs=t,ps=e;else{if(null===e)throw Error(o(310));e={memoizedState:(ps=e).memoizedState,baseState:ps.baseState,baseQueue:ps.baseQueue,queue:ps.queue,next:null},null===fs?hs.memoizedState=fs=e:fs=fs.next=e}return fs}function Is(e,t){return"function"==typeof t?t(e):t}function _s(e){var t=Es(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=ps,i=r.baseQueue,s=n.pending;if(null!==s){if(null!==i){var a=i.next;i.next=s.next,s.next=a}r.baseQueue=i=s,n.pending=null}if(null!==i){s=i.next,r=r.baseState;var l=a=null,c=null,u=s;do{var d=u.lane;if((ds&d)===d)null!==c&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var h={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};null===c?(l=c=h,a=r):c=c.next=h,hs.lanes|=d,jl|=d}u=u.next}while(null!==u&&u!==s);null===c?a=r:c.next=l,ir(r,t.memoizedState)||(ya=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=c,n.lastRenderedState=r}if(null!==(e=n.interleaved)){i=e;do{s=i.lane,hs.lanes|=s,jl|=s,i=i.next}while(i!==e)}else null===i&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function xs(e){var t=Es(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(null!==i){n.pending=null;var a=i=i.next;do{s=e(s,a.action),a=a.next}while(a!==i);ir(s,t.memoizedState)||(ya=!0),t.memoizedState=s,null===t.baseQueue&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function Ps(){}function ks(e,t){var n=hs,r=Es(),i=t(),s=!ir(r.memoizedState,i);if(s&&(r.memoizedState=i,ya=!0),r=r.queue,Us(Ns.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||null!==fs&&1&fs.memoizedState.tag){if(n.flags|=2048,Ms(9,Os.bind(null,n,r,i,t),void 0,null),null===xl)throw Error(o(349));0!=(30&ds)||Bs(n,t,i)}return i}function Bs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=hs.updateQueue)?(t={lastEffect:null,stores:null},hs.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Os(e,t,n,r){t.value=n,t.getSnapshot=r,Ds(t)&&js(e)}function Ns(e,t,n){return n((function(){Ds(t)&&js(e)}))}function Ds(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ir(e,n)}catch(e){return!0}}function js(e){var t=xo(e,1);null!==t&&ec(t,e,1,-1)}function Ts(e){var t=Cs();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Is,lastRenderedState:e},t.queue=e,e=e.dispatch=$s.bind(null,hs,e),[t.memoizedState,e]}function Ms(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=hs.updateQueue)?(t={lastEffect:null,stores:null},hs.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Fs(){return Es().memoizedState}function Rs(e,t,n,r){var i=Cs();hs.flags|=e,i.memoizedState=Ms(1|t,n,void 0,void 0===r?null:r)}function Ls(e,t,n,r){var i=Es();r=void 0===r?null:r;var o=void 0;if(null!==ps){var s=ps.memoizedState;if(o=s.destroy,null!==r&&bs(r,s.deps))return void(i.memoizedState=Ms(t,n,o,r))}hs.flags|=e,i.memoizedState=Ms(1|t,n,o,r)}function Qs(e,t){return Rs(8390656,8,e,t)}function Us(e,t){return Ls(2048,8,e,t)}function Vs(e,t){return Ls(4,2,e,t)}function Ks(e,t){return Ls(4,4,e,t)}function Hs(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Gs(e,t,n){return n=null!=n?n.concat([e]):null,Ls(4,4,Hs.bind(null,t,e),n)}function Ys(){}function zs(e,t){var n=Es();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&bs(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Zs(e,t){var n=Es();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&bs(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ws(e,t,n){return 0==(21&ds)?(e.baseState&&(e.baseState=!1,ya=!0),e.memoizedState=n):(ir(n,t)||(n=gt(),hs.lanes|=n,jl|=n,e.baseState=!0),t)}function qs(e,t){var n=At;At=0!==n&&4>n?n:4,e(!0);var r=us.transition;us.transition={};try{e(!1),t()}finally{At=n,us.transition=r}}function Js(){return Es().memoizedState}function Xs(e,t,n){var r=$l(e);n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ea(e)?ta(t,n):null!==(n=_o(e,t,n,r))&&(ec(n,e,r,Xl()),na(n,t,r))}function $s(e,t,n){var r=$l(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ea(e))ta(t,i);else{var o=e.alternate;if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var s=t.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,ir(a,s)){var l=t.interleaved;return null===l?(i.next=i,Io(t)):(i.next=l.next,l.next=i),void(t.interleaved=i)}}catch(e){}null!==(n=_o(e,t,i,r))&&(ec(n,e,r,i=Xl()),na(n,t,r))}}function ea(e){var t=e.alternate;return e===hs||null!==t&&t===hs}function ta(e,t){ms=gs=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function na(e,t,n){if(0!=(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,vt(e,n)}}var ra={readContext:Co,useCallback:As,useContext:As,useEffect:As,useImperativeHandle:As,useInsertionEffect:As,useLayoutEffect:As,useMemo:As,useReducer:As,useRef:As,useState:As,useDebugValue:As,useDeferredValue:As,useTransition:As,useMutableSource:As,useSyncExternalStore:As,useId:As,unstable_isNewReconciler:!1},ia={readContext:Co,useCallback:function(e,t){return Cs().memoizedState=[e,void 0===t?null:t],e},useContext:Co,useEffect:Qs,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Rs(4194308,4,Hs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Rs(4194308,4,e,t)},useInsertionEffect:function(e,t){return Rs(4,2,e,t)},useMemo:function(e,t){var n=Cs();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Cs();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Xs.bind(null,hs,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Cs().memoizedState=e},useState:Ts,useDebugValue:Ys,useDeferredValue:function(e){return Cs().memoizedState=e},useTransition:function(){var e=Ts(!1),t=e[0];return e=qs.bind(null,e[1]),Cs().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=hs,i=Cs();if(to){if(void 0===n)throw Error(o(407));n=n()}else{if(n=t(),null===xl)throw Error(o(349));0!=(30&ds)||Bs(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,Qs(Ns.bind(null,r,s,e),[e]),r.flags|=2048,Ms(9,Os.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Cs(),t=xl.identifierPrefix;if(to){var n=Zi;t=":"+t+"R"+(n=(zi&~(1<<32-st(zi)-1)).toString(32)+n),0<(n=ys++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=vs++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},oa={readContext:Co,useCallback:zs,useContext:Co,useEffect:Us,useImperativeHandle:Gs,useInsertionEffect:Vs,useLayoutEffect:Ks,useMemo:Zs,useReducer:_s,useRef:Fs,useState:function(){return _s(Is)},useDebugValue:Ys,useDeferredValue:function(e){return Ws(Es(),ps.memoizedState,e)},useTransition:function(){return[_s(Is)[0],Es().memoizedState]},useMutableSource:Ps,useSyncExternalStore:ks,useId:Js,unstable_isNewReconciler:!1},sa={readContext:Co,useCallback:zs,useContext:Co,useEffect:Us,useImperativeHandle:Gs,useInsertionEffect:Vs,useLayoutEffect:Ks,useMemo:Zs,useReducer:xs,useRef:Fs,useState:function(){return xs(Is)},useDebugValue:Ys,useDeferredValue:function(e){var t=Es();return null===ps?t.memoizedState=e:Ws(t,ps.memoizedState,e)},useTransition:function(){return[xs(Is)[0],Es().memoizedState]},useMutableSource:Ps,useSyncExternalStore:ks,useId:Js,unstable_isNewReconciler:!1};function aa(e,t){try{var n="",r=t;do{n+=U(r),r=r.return}while(r);var i=n}catch(e){i="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:i,digest:null}}function la(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function ca(e,t){try{console.error(t.value)}catch(e){setTimeout((function(){throw e}))}}var ua="function"==typeof WeakMap?WeakMap:Map;function da(e,t,n){(n=Oo(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Vl||(Vl=!0,Kl=r),ca(0,t)},n}function ha(e,t,n){(n=Oo(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){ca(0,t)}}var o=e.stateNode;return null!==o&&"function"==typeof o.componentDidCatch&&(n.callback=function(){ca(0,t),"function"!=typeof r&&(null===Hl?Hl=new Set([this]):Hl.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function pa(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new ua;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Cc.bind(null,e,t,n),t.then(e,e))}function fa(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function ga(e,t,n,r,i){return 0==(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Oo(-1,1)).tag=2,No(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=i,e)}var ma=b.ReactCurrentOwner,ya=!1;function va(e,t,n,r){t.child=null===e?Wo(t,null,n,r):Zo(t,e.child,n,r)}function Aa(e,t,n,r,i){n=n.render;var o=t.ref;return So(t,i),r=ws(e,t,n,r,o,i),n=Ss(),null===e||ya?(to&&n&&Ji(t),t.flags|=1,va(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Va(e,t,i))}function ba(e,t,n,r,i){if(null===e){var o=n.type;return"function"!=typeof o||Bc(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Nc(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,wa(e,t,o,r,i))}if(o=e.child,0==(e.lanes&i)){var s=o.memoizedProps;if((n=null!==(n=n.compare)?n:or)(s,r)&&e.ref===t.ref)return Va(e,t,i)}return t.flags|=1,(e=Oc(o,r)).ref=t.ref,e.return=t,t.child=e}function wa(e,t,n,r,i){if(null!==e){var o=e.memoizedProps;if(or(o,r)&&e.ref===t.ref){if(ya=!1,t.pendingProps=r=o,0==(e.lanes&i))return t.lanes=e.lanes,Va(e,t,i);0!=(131072&e.flags)&&(ya=!0)}}return Ea(e,t,n,r,i)}function Sa(e,t,n){var r=t.pendingProps,i=r.children,o=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0==(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ci(Ol,Bl),Bl|=n;else{if(0==(1073741824&n))return e=null!==o?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ci(Ol,Bl),Bl|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==o?o.baseLanes:n,Ci(Ol,Bl),Bl|=r}else null!==o?(r=o.baseLanes|n,t.memoizedState=null):r=n,Ci(Ol,Bl),Bl|=r;return va(e,t,i,n),t.child}function Ca(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ea(e,t,n,r,i){var o=ki(n)?xi:Ii.current;return o=Pi(t,o),So(t,i),n=ws(e,t,n,r,o,i),r=Ss(),null===e||ya?(to&&r&&Ji(t),t.flags|=1,va(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Va(e,t,i))}function Ia(e,t,n,r,i){if(ki(n)){var o=!0;Di(t)}else o=!1;if(So(t,i),null===t.stateNode)Ua(e,t),Uo(t,n,r),Ko(t,n,r,i),r=!0;else if(null===e){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,c=n.contextType;c="object"==typeof c&&null!==c?Co(c):Pi(t,c=ki(n)?xi:Ii.current);var u=n.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof s.getSnapshotBeforeUpdate;d||"function"!=typeof s.UNSAFE_componentWillReceiveProps&&"function"!=typeof s.componentWillReceiveProps||(a!==r||l!==c)&&Vo(t,s,r,c),Po=!1;var h=t.memoizedState;s.state=h,To(t,r,s,i),l=t.memoizedState,a!==r||h!==l||_i.current||Po?("function"==typeof u&&(Ro(t,n,u,r),l=t.memoizedState),(a=Po||Qo(t,n,a,r,h,l,c))?(d||"function"!=typeof s.UNSAFE_componentWillMount&&"function"!=typeof s.componentWillMount||("function"==typeof s.componentWillMount&&s.componentWillMount(),"function"==typeof s.UNSAFE_componentWillMount&&s.UNSAFE_componentWillMount()),"function"==typeof s.componentDidMount&&(t.flags|=4194308)):("function"==typeof s.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=c,r=a):("function"==typeof s.componentDidMount&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,Bo(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:fo(t.type,a),s.props=c,d=t.pendingProps,h=s.context,l="object"==typeof(l=n.contextType)&&null!==l?Co(l):Pi(t,l=ki(n)?xi:Ii.current);var p=n.getDerivedStateFromProps;(u="function"==typeof p||"function"==typeof s.getSnapshotBeforeUpdate)||"function"!=typeof s.UNSAFE_componentWillReceiveProps&&"function"!=typeof s.componentWillReceiveProps||(a!==d||h!==l)&&Vo(t,s,r,l),Po=!1,h=t.memoizedState,s.state=h,To(t,r,s,i);var f=t.memoizedState;a!==d||h!==f||_i.current||Po?("function"==typeof p&&(Ro(t,n,p,r),f=t.memoizedState),(c=Po||Qo(t,n,c,r,h,f,l)||!1)?(u||"function"!=typeof s.UNSAFE_componentWillUpdate&&"function"!=typeof s.componentWillUpdate||("function"==typeof s.componentWillUpdate&&s.componentWillUpdate(r,f,l),"function"==typeof s.UNSAFE_componentWillUpdate&&s.UNSAFE_componentWillUpdate(r,f,l)),"function"==typeof s.componentDidUpdate&&(t.flags|=4),"function"==typeof s.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof s.componentDidUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof s.getSnapshotBeforeUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=f),s.props=r,s.state=f,s.context=l,r=c):("function"!=typeof s.componentDidUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof s.getSnapshotBeforeUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return _a(e,t,n,r,o,i)}function _a(e,t,n,r,i,o){Ca(e,t);var s=0!=(128&t.flags);if(!r&&!s)return i&&ji(t,n,!1),Va(e,t,o);r=t.stateNode,ma.current=t;var a=s&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&s?(t.child=Zo(t,e.child,null,o),t.child=Zo(t,null,a,o)):va(e,t,a,o),t.memoizedState=r.state,i&&ji(t,n,!0),t.child}function xa(e){var t=e.stateNode;t.pendingContext?Oi(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Oi(0,t.context,!1),ts(e,t.containerInfo)}function Pa(e,t,n,r,i){return uo(),ho(i),t.flags|=256,va(e,t,n,r),t.child}var ka,Ba,Oa,Na,Da={dehydrated:null,treeContext:null,retryLane:0};function ja(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ta(e,t,n){var r,i=t.pendingProps,s=os.current,a=!1,l=0!=(128&t.flags);if((r=l)||(r=(null===e||null!==e.memoizedState)&&0!=(2&s)),r?(a=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(s|=1),Ci(os,1&s),null===e)return so(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0==(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(l=i.children,e=i.fallback,a?(i=t.mode,a=t.child,l={mode:"hidden",children:l},0==(1&i)&&null!==a?(a.childLanes=0,a.pendingProps=l):a=jc(l,i,0,null),e=Dc(e,i,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=ja(n),t.memoizedState=Da,e):Ma(t,l));if(null!==(s=e.memoizedState)&&null!==(r=s.dehydrated))return function(e,t,n,r,i,s,a){if(n)return 256&t.flags?(t.flags&=-257,Fa(e,t,a,r=la(Error(o(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=jc({mode:"visible",children:r.children},i,0,null),(s=Dc(s,i,a,null)).flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,0!=(1&t.mode)&&Zo(t,e.child,null,a),t.child.memoizedState=ja(a),t.memoizedState=Da,s);if(0==(1&t.mode))return Fa(e,t,a,null);if("$!"===i.data){if(r=i.nextSibling&&i.nextSibling.dataset)var l=r.dgst;return r=l,Fa(e,t,a,r=la(s=Error(o(419)),r,void 0))}if(l=0!=(a&e.childLanes),ya||l){if(null!==(r=xl)){switch(a&-a){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}0!==(i=0!=(i&(r.suspendedLanes|a))?0:i)&&i!==s.retryLane&&(s.retryLane=i,xo(e,i),ec(r,e,i,-1))}return pc(),Fa(e,t,a,r=la(Error(o(421))))}return"$?"===i.data?(t.flags|=128,t.child=e.child,t=Ic.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,eo=si(i.nextSibling),$i=t,to=!0,no=null,null!==e&&(Hi[Gi++]=zi,Hi[Gi++]=Zi,Hi[Gi++]=Yi,zi=e.id,Zi=e.overflow,Yi=t),(t=Ma(t,r.children)).flags|=4096,t)}(e,t,l,i,r,s,n);if(a){a=i.fallback,l=t.mode,r=(s=e.child).sibling;var c={mode:"hidden",children:i.children};return 0==(1&l)&&t.child!==s?((i=t.child).childLanes=0,i.pendingProps=c,t.deletions=null):(i=Oc(s,c)).subtreeFlags=14680064&s.subtreeFlags,null!==r?a=Oc(r,a):(a=Dc(a,l,n,null)).flags|=2,a.return=t,i.return=t,i.sibling=a,t.child=i,i=a,a=t.child,l=null===(l=e.child.memoizedState)?ja(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},a.memoizedState=l,a.childLanes=e.childLanes&~n,t.memoizedState=Da,i}return e=(a=e.child).sibling,i=Oc(a,{mode:"visible",children:i.children}),0==(1&t.mode)&&(i.lanes=n),i.return=t,i.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=i,t.memoizedState=null,i}function Ma(e,t){return(t=jc({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Fa(e,t,n,r){return null!==r&&ho(r),Zo(t,e.child,null,n),(e=Ma(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Ra(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),wo(e.return,t,n)}function La(e,t,n,r,i){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function Qa(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(va(e,t,r.children,n),0!=(2&(r=os.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!=(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Ra(e,n,t);else if(19===e.tag)Ra(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ci(os,r),0==(1&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===ss(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),La(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===ss(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}La(t,!0,n,null,o);break;case"together":La(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ua(e,t){0==(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Va(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),jl|=t.lanes,0==(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(o(153));if(null!==t.child){for(n=Oc(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Oc(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Ka(e,t){if(!to)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ha(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=14680064&i.subtreeFlags,r|=14680064&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Ga(e,t,n){var r=t.pendingProps;switch(Xi(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ha(t),null;case 1:case 17:return ki(t.type)&&Bi(),Ha(t),null;case 3:return r=t.stateNode,ns(),Si(_i),Si(Ii),ls(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(lo(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0==(256&t.flags)||(t.flags|=1024,null!==no&&(ic(no),no=null))),Ba(e,t),Ha(t),null;case 5:is(t);var i=es($o.current);if(n=t.type,null!==e&&null!=t.stateNode)Oa(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(o(166));return Ha(t),null}if(e=es(Jo.current),lo(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[ci]=t,r[ui]=s,e=0!=(1&t.mode),n){case"dialog":Mr("cancel",r),Mr("close",r);break;case"iframe":case"object":case"embed":Mr("load",r);break;case"video":case"audio":for(i=0;i<Nr.length;i++)Mr(Nr[i],r);break;case"source":Mr("error",r);break;case"img":case"image":case"link":Mr("error",r),Mr("load",r);break;case"details":Mr("toggle",r);break;case"input":q(r,s),Mr("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Mr("invalid",r);break;case"textarea":ie(r,s),Mr("invalid",r)}for(var l in ve(n,s),i=null,s)if(s.hasOwnProperty(l)){var c=s[l];"children"===l?"string"==typeof c?r.textContent!==c&&(!0!==s.suppressHydrationWarning&&Wr(r.textContent,c,e),i=["children",c]):"number"==typeof c&&r.textContent!==""+c&&(!0!==s.suppressHydrationWarning&&Wr(r.textContent,c,e),i=["children",""+c]):a.hasOwnProperty(l)&&null!=c&&"onScroll"===l&&Mr("scroll",r)}switch(n){case"input":Y(r),$(r,s,!0);break;case"textarea":Y(r),se(r);break;case"select":case"option":break;default:"function"==typeof s.onClick&&(r.onclick=qr)}r=i,t.updateQueue=r,null!==r&&(t.flags|=4)}else{l=9===i.nodeType?i:i.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=ae(n)),"http://www.w3.org/1999/xhtml"===e?"script"===n?((e=l.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),"select"===n&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[ci]=t,e[ui]=r,ka(e,t,!1,!1),t.stateNode=e;e:{switch(l=Ae(n,r),n){case"dialog":Mr("cancel",e),Mr("close",e),i=r;break;case"iframe":case"object":case"embed":Mr("load",e),i=r;break;case"video":case"audio":for(i=0;i<Nr.length;i++)Mr(Nr[i],e);i=r;break;case"source":Mr("error",e),i=r;break;case"img":case"image":case"link":Mr("error",e),Mr("load",e),i=r;break;case"details":Mr("toggle",e),i=r;break;case"input":q(e,r),i=W(e,r),Mr("invalid",e);break;case"option":default:i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=F({},r,{value:void 0}),Mr("invalid",e);break;case"textarea":ie(e,r),i=re(e,r),Mr("invalid",e)}for(s in ve(n,i),c=i)if(c.hasOwnProperty(s)){var u=c[s];"style"===s?me(e,u):"dangerouslySetInnerHTML"===s?null!=(u=u?u.__html:void 0)&&de(e,u):"children"===s?"string"==typeof u?("textarea"!==n||""!==u)&&he(e,u):"number"==typeof u&&he(e,""+u):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(a.hasOwnProperty(s)?null!=u&&"onScroll"===s&&Mr("scroll",e):null!=u&&A(e,s,u,l))}switch(n){case"input":Y(e),$(e,r,!1);break;case"textarea":Y(e),se(e);break;case"option":null!=r.value&&e.setAttribute("value",""+H(r.value));break;case"select":e.multiple=!!r.multiple,null!=(s=r.value)?ne(e,!!r.multiple,s,!1):null!=r.defaultValue&&ne(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof i.onClick&&(e.onclick=qr)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return Ha(t),null;case 6:if(e&&null!=t.stateNode)Na(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(o(166));if(n=es($o.current),es(Jo.current),lo(t)){if(r=t.stateNode,n=t.memoizedProps,r[ci]=t,(s=r.nodeValue!==n)&&null!==(e=$i))switch(e.tag){case 3:Wr(r.nodeValue,n,0!=(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Wr(r.nodeValue,n,0!=(1&e.mode))}s&&(t.flags|=4)}else(r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[ci]=t,t.stateNode=r}return Ha(t),null;case 13:if(Si(os),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(to&&null!==eo&&0!=(1&t.mode)&&0==(128&t.flags))co(),uo(),t.flags|=98560,s=!1;else if(s=lo(t),null!==r&&null!==r.dehydrated){if(null===e){if(!s)throw Error(o(318));if(!(s=null!==(s=t.memoizedState)?s.dehydrated:null))throw Error(o(317));s[ci]=t}else uo(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Ha(t),s=!1}else null!==no&&(ic(no),no=null),s=!0;if(!s)return 65536&t.flags?t:null}return 0!=(128&t.flags)?(t.lanes=n,t):((r=null!==r)!=(null!==e&&null!==e.memoizedState)&&r&&(t.child.flags|=8192,0!=(1&t.mode)&&(null===e||0!=(1&os.current)?0===Nl&&(Nl=3):pc())),null!==t.updateQueue&&(t.flags|=4),Ha(t),null);case 4:return ns(),Ba(e,t),null===e&&Lr(t.stateNode.containerInfo),Ha(t),null;case 10:return bo(t.type._context),Ha(t),null;case 19:if(Si(os),null===(s=t.memoizedState))return Ha(t),null;if(r=0!=(128&t.flags),null===(l=s.rendering))if(r)Ka(s,!1);else{if(0!==Nl||null!==e&&0!=(128&e.flags))for(e=t.child;null!==e;){if(null!==(l=ss(e))){for(t.flags|=128,Ka(s,!1),null!==(r=l.updateQueue)&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;null!==n;)e=r,(s=n).flags&=14680066,null===(l=s.alternate)?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=l.childLanes,s.lanes=l.lanes,s.child=l.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=l.memoizedProps,s.memoizedState=l.memoizedState,s.updateQueue=l.updateQueue,s.type=l.type,e=l.dependencies,s.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ci(os,1&os.current|2),t.child}e=e.sibling}null!==s.tail&&Je()>Ql&&(t.flags|=128,r=!0,Ka(s,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=ss(l))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),Ka(s,!0),null===s.tail&&"hidden"===s.tailMode&&!l.alternate&&!to)return Ha(t),null}else 2*Je()-s.renderingStartTime>Ql&&1073741824!==n&&(t.flags|=128,r=!0,Ka(s,!1),t.lanes=4194304);s.isBackwards?(l.sibling=t.child,t.child=l):(null!==(n=s.last)?n.sibling=l:t.child=l,s.last=l)}return null!==s.tail?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Je(),t.sibling=null,n=os.current,Ci(os,r?1&n|2:1&n),t):(Ha(t),null);case 22:case 23:return cc(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&0!=(1&t.mode)?0!=(1073741824&Bl)&&(Ha(t),6&t.subtreeFlags&&(t.flags|=8192)):Ha(t),null;case 24:case 25:return null}throw Error(o(156,t.tag))}function Ya(e,t){switch(Xi(t),t.tag){case 1:return ki(t.type)&&Bi(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return ns(),Si(_i),Si(Ii),ls(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 5:return is(t),null;case 13:if(Si(os),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(o(340));uo()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Si(os),null;case 4:return ns(),null;case 10:return bo(t.type._context),null;case 22:case 23:return cc(),null;default:return null}}ka=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ba=function(){},Oa=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,es(Jo.current);var o,s=null;switch(n){case"input":i=W(e,i),r=W(e,r),s=[];break;case"select":i=F({},i,{value:void 0}),r=F({},r,{value:void 0}),s=[];break;case"textarea":i=re(e,i),r=re(e,r),s=[];break;default:"function"!=typeof i.onClick&&"function"==typeof r.onClick&&(e.onclick=qr)}for(u in ve(n,r),n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&null!=i[u])if("style"===u){var l=i[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else"dangerouslySetInnerHTML"!==u&&"children"!==u&&"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(a.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var c=r[u];if(l=null!=i?i[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(null!=c||null!=l))if("style"===u)if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(s||(s=[]),s.push(u,n)),n=c;else"dangerouslySetInnerHTML"===u?(c=c?c.__html:void 0,l=l?l.__html:void 0,null!=c&&l!==c&&(s=s||[]).push(u,c)):"children"===u?"string"!=typeof c&&"number"!=typeof c||(s=s||[]).push(u,""+c):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&(a.hasOwnProperty(u)?(null!=c&&"onScroll"===u&&Mr("scroll",e),s||l===c||(s=[])):(s=s||[]).push(u,c))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}},Na=function(e,t,n,r){n!==r&&(t.flags|=4)};var za=!1,Za=!1,Wa="function"==typeof WeakSet?WeakSet:Set,qa=null;function Ja(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(n){Sc(e,t,n)}else n.current=null}function Xa(e,t,n){try{n()}catch(n){Sc(e,t,n)}}var $a=!1;function el(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,void 0!==o&&Xa(t,n,o)}i=i.next}while(i!==r)}}function tl(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function nl(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"==typeof t?t(e):t.current=e}}function rl(e){var t=e.alternate;null!==t&&(e.alternate=null,rl(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&null!==(t=e.stateNode)&&(delete t[ci],delete t[ui],delete t[hi],delete t[pi],delete t[fi]),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function il(e){return 5===e.tag||3===e.tag||4===e.tag}function ol(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||il(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function sl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=qr));else if(4!==r&&null!==(e=e.child))for(sl(e,t,n),e=e.sibling;null!==e;)sl(e,t,n),e=e.sibling}function al(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(al(e,t,n),e=e.sibling;null!==e;)al(e,t,n),e=e.sibling}var ll=null,cl=!1;function ul(e,t,n){for(n=n.child;null!==n;)dl(e,t,n),n=n.sibling}function dl(e,t,n){if(ot&&"function"==typeof ot.onCommitFiberUnmount)try{ot.onCommitFiberUnmount(it,n)}catch(e){}switch(n.tag){case 5:Za||Ja(n,t);case 6:var r=ll,i=cl;ll=null,ul(e,t,n),cl=i,null!==(ll=r)&&(cl?(e=ll,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):ll.removeChild(n.stateNode));break;case 18:null!==ll&&(cl?(e=ll,n=n.stateNode,8===e.nodeType?oi(e.parentNode,n):1===e.nodeType&&oi(e,n),Vt(e)):oi(ll,n.stateNode));break;case 4:r=ll,i=cl,ll=n.stateNode.containerInfo,cl=!0,ul(e,t,n),ll=r,cl=i;break;case 0:case 11:case 14:case 15:if(!Za&&null!==(r=n.updateQueue)&&null!==(r=r.lastEffect)){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,void 0!==s&&(0!=(2&o)||0!=(4&o))&&Xa(n,t,s),i=i.next}while(i!==r)}ul(e,t,n);break;case 1:if(!Za&&(Ja(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Sc(n,t,e)}ul(e,t,n);break;case 21:ul(e,t,n);break;case 22:1&n.mode?(Za=(r=Za)||null!==n.memoizedState,ul(e,t,n),Za=r):ul(e,t,n);break;default:ul(e,t,n)}}function hl(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Wa),t.forEach((function(t){var r=_c.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function pl(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,a=t,l=a;e:for(;null!==l;){switch(l.tag){case 5:ll=l.stateNode,cl=!1;break e;case 3:case 4:ll=l.stateNode.containerInfo,cl=!0;break e}l=l.return}if(null===ll)throw Error(o(160));dl(s,a,i),ll=null,cl=!1;var c=i.alternate;null!==c&&(c.return=null),i.return=null}catch(e){Sc(i,t,e)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)fl(t,e),t=t.sibling}function fl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(pl(t,e),gl(e),4&r){try{el(3,e,e.return),tl(3,e)}catch(t){Sc(e,e.return,t)}try{el(5,e,e.return)}catch(t){Sc(e,e.return,t)}}break;case 1:pl(t,e),gl(e),512&r&&null!==n&&Ja(n,n.return);break;case 5:if(pl(t,e),gl(e),512&r&&null!==n&&Ja(n,n.return),32&e.flags){var i=e.stateNode;try{he(i,"")}catch(t){Sc(e,e.return,t)}}if(4&r&&null!=(i=e.stateNode)){var s=e.memoizedProps,a=null!==n?n.memoizedProps:s,l=e.type,c=e.updateQueue;if(e.updateQueue=null,null!==c)try{"input"===l&&"radio"===s.type&&null!=s.name&&J(i,s),Ae(l,a);var u=Ae(l,s);for(a=0;a<c.length;a+=2){var d=c[a],h=c[a+1];"style"===d?me(i,h):"dangerouslySetInnerHTML"===d?de(i,h):"children"===d?he(i,h):A(i,d,h,u)}switch(l){case"input":X(i,s);break;case"textarea":oe(i,s);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var f=s.value;null!=f?ne(i,!!s.multiple,f,!1):p!==!!s.multiple&&(null!=s.defaultValue?ne(i,!!s.multiple,s.defaultValue,!0):ne(i,!!s.multiple,s.multiple?[]:"",!1))}i[ui]=s}catch(t){Sc(e,e.return,t)}}break;case 6:if(pl(t,e),gl(e),4&r){if(null===e.stateNode)throw Error(o(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(t){Sc(e,e.return,t)}}break;case 3:if(pl(t,e),gl(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{Vt(t.containerInfo)}catch(t){Sc(e,e.return,t)}break;case 4:default:pl(t,e),gl(e);break;case 13:pl(t,e),gl(e),8192&(i=e.child).flags&&(s=null!==i.memoizedState,i.stateNode.isHidden=s,!s||null!==i.alternate&&null!==i.alternate.memoizedState||(Ll=Je())),4&r&&hl(e);break;case 22:if(d=null!==n&&null!==n.memoizedState,1&e.mode?(Za=(u=Za)||d,pl(t,e),Za=u):pl(t,e),gl(e),8192&r){if(u=null!==e.memoizedState,(e.stateNode.isHidden=u)&&!d&&0!=(1&e.mode))for(qa=e,d=e.child;null!==d;){for(h=qa=d;null!==qa;){switch(f=(p=qa).child,p.tag){case 0:case 11:case 14:case 15:el(4,p,p.return);break;case 1:Ja(p,p.return);var g=p.stateNode;if("function"==typeof g.componentWillUnmount){r=p,n=p.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(e){Sc(r,n,e)}}break;case 5:Ja(p,p.return);break;case 22:if(null!==p.memoizedState){Al(h);continue}}null!==f?(f.return=p,qa=f):Al(h)}d=d.sibling}e:for(d=null,h=e;;){if(5===h.tag){if(null===d){d=h;try{i=h.stateNode,u?"function"==typeof(s=i.style).setProperty?s.setProperty("display","none","important"):s.display="none":(l=h.stateNode,a=null!=(c=h.memoizedProps.style)&&c.hasOwnProperty("display")?c.display:null,l.style.display=ge("display",a))}catch(t){Sc(e,e.return,t)}}}else if(6===h.tag){if(null===d)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(t){Sc(e,e.return,t)}}else if((22!==h.tag&&23!==h.tag||null===h.memoizedState||h===e)&&null!==h.child){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;null===h.sibling;){if(null===h.return||h.return===e)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:pl(t,e),gl(e),4&r&&hl(e);case 21:}}function gl(e){var t=e.flags;if(2&t){try{e:{for(var n=e.return;null!==n;){if(il(n)){var r=n;break e}n=n.return}throw Error(o(160))}switch(r.tag){case 5:var i=r.stateNode;32&r.flags&&(he(i,""),r.flags&=-33),al(e,ol(e),i);break;case 3:case 4:var s=r.stateNode.containerInfo;sl(e,ol(e),s);break;default:throw Error(o(161))}}catch(t){Sc(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function ml(e,t,n){qa=e,yl(e,t,n)}function yl(e,t,n){for(var r=0!=(1&e.mode);null!==qa;){var i=qa,o=i.child;if(22===i.tag&&r){var s=null!==i.memoizedState||za;if(!s){var a=i.alternate,l=null!==a&&null!==a.memoizedState||Za;a=za;var c=Za;if(za=s,(Za=l)&&!c)for(qa=i;null!==qa;)l=(s=qa).child,22===s.tag&&null!==s.memoizedState?bl(i):null!==l?(l.return=s,qa=l):bl(i);for(;null!==o;)qa=o,yl(o,t,n),o=o.sibling;qa=i,za=a,Za=c}vl(e)}else 0!=(8772&i.subtreeFlags)&&null!==o?(o.return=i,qa=o):vl(e)}}function vl(e){for(;null!==qa;){var t=qa;if(0!=(8772&t.flags)){var n=t.alternate;try{if(0!=(8772&t.flags))switch(t.tag){case 0:case 11:case 15:Za||tl(5,t);break;case 1:var r=t.stateNode;if(4&t.flags&&!Za)if(null===n)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:fo(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;null!==s&&Mo(t,s,r);break;case 3:var a=t.updateQueue;if(null!==a){if(n=null,null!==t.child)switch(t.child.tag){case 5:case 1:n=t.child.stateNode}Mo(t,a,n)}break;case 5:var l=t.stateNode;if(null===n&&4&t.flags){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var u=t.alternate;if(null!==u){var d=u.memoizedState;if(null!==d){var h=d.dehydrated;null!==h&&Vt(h)}}}break;default:throw Error(o(163))}Za||512&t.flags&&nl(t)}catch(e){Sc(t,t.return,e)}}if(t===e){qa=null;break}if(null!==(n=t.sibling)){n.return=t.return,qa=n;break}qa=t.return}}function Al(e){for(;null!==qa;){var t=qa;if(t===e){qa=null;break}var n=t.sibling;if(null!==n){n.return=t.return,qa=n;break}qa=t.return}}function bl(e){for(;null!==qa;){var t=qa;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{tl(4,t)}catch(e){Sc(t,n,e)}break;case 1:var r=t.stateNode;if("function"==typeof r.componentDidMount){var i=t.return;try{r.componentDidMount()}catch(e){Sc(t,i,e)}}var o=t.return;try{nl(t)}catch(e){Sc(t,o,e)}break;case 5:var s=t.return;try{nl(t)}catch(e){Sc(t,s,e)}}}catch(e){Sc(t,t.return,e)}if(t===e){qa=null;break}var a=t.sibling;if(null!==a){a.return=t.return,qa=a;break}qa=t.return}}var wl,Sl=Math.ceil,Cl=b.ReactCurrentDispatcher,El=b.ReactCurrentOwner,Il=b.ReactCurrentBatchConfig,_l=0,xl=null,Pl=null,kl=0,Bl=0,Ol=wi(0),Nl=0,Dl=null,jl=0,Tl=0,Ml=0,Fl=null,Rl=null,Ll=0,Ql=1/0,Ul=null,Vl=!1,Kl=null,Hl=null,Gl=!1,Yl=null,zl=0,Zl=0,Wl=null,ql=-1,Jl=0;function Xl(){return 0!=(6&_l)?Je():-1!==ql?ql:ql=Je()}function $l(e){return 0==(1&e.mode)?1:0!=(2&_l)&&0!==kl?kl&-kl:null!==po.transition?(0===Jl&&(Jl=gt()),Jl):0!==(e=At)?e:e=void 0===(e=window.event)?16:qt(e.type)}function ec(e,t,n,r){if(50<Zl)throw Zl=0,Wl=null,Error(o(185));yt(e,n,r),0!=(2&_l)&&e===xl||(e===xl&&(0==(2&_l)&&(Tl|=n),4===Nl&&oc(e,kl)),tc(e,r),1===n&&0===_l&&0==(1&t.mode)&&(Ql=Je()+500,Mi&&Li()))}function tc(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var s=31-st(o),a=1<<s,l=i[s];-1===l?0!=(a&n)&&0==(a&r)||(i[s]=pt(a,t)):l<=t&&(e.expiredLanes|=a),o&=~a}}(e,t);var r=ht(e,e===xl?kl:0);if(0===r)null!==n&&Ze(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&Ze(n),1===t)0===e.tag?function(e){Mi=!0,Ri(e)}(sc.bind(null,e)):Ri(sc.bind(null,e)),ri((function(){0==(6&_l)&&Li()})),n=null;else{switch(bt(r)){case 1:n=$e;break;case 4:n=et;break;case 16:default:n=tt;break;case 536870912:n=rt}n=xc(n,nc.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function nc(e,t){if(ql=-1,Jl=0,0!=(6&_l))throw Error(o(327));var n=e.callbackNode;if(bc()&&e.callbackNode!==n)return null;var r=ht(e,e===xl?kl:0);if(0===r)return null;if(0!=(30&r)||0!=(r&e.expiredLanes)||t)t=fc(e,r);else{t=r;var i=_l;_l|=2;var s=hc();for(xl===e&&kl===t||(Ul=null,Ql=Je()+500,uc(e,t));;)try{mc();break}catch(t){dc(e,t)}Ao(),Cl.current=s,_l=i,null!==Pl?t=0:(xl=null,kl=0,t=Nl)}if(0!==t){if(2===t&&0!==(i=ft(e))&&(r=i,t=rc(e,i)),1===t)throw n=Dl,uc(e,0),oc(e,r),tc(e,Je()),n;if(6===t)oc(e,r);else{if(i=e.current.alternate,0==(30&r)&&!function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!ir(o(),i))return!1}catch(e){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(i)&&(2===(t=fc(e,r))&&0!==(s=ft(e))&&(r=s,t=rc(e,s)),1===t))throw n=Dl,uc(e,0),oc(e,r),tc(e,Je()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(o(345));case 2:case 5:Ac(e,Rl,Ul);break;case 3:if(oc(e,r),(130023424&r)===r&&10<(t=Ll+500-Je())){if(0!==ht(e,0))break;if(((i=e.suspendedLanes)&r)!==r){Xl(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=ei(Ac.bind(null,e,Rl,Ul),t);break}Ac(e,Rl,Ul);break;case 4:if(oc(e,r),(4194240&r)===r)break;for(t=e.eventTimes,i=-1;0<r;){var a=31-st(r);s=1<<a,(a=t[a])>i&&(i=a),r&=~s}if(r=i,10<(r=(120>(r=Je()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Sl(r/1960))-r)){e.timeoutHandle=ei(Ac.bind(null,e,Rl,Ul),r);break}Ac(e,Rl,Ul);break;default:throw Error(o(329))}}}return tc(e,Je()),e.callbackNode===n?nc.bind(null,e):null}function rc(e,t){var n=Fl;return e.current.memoizedState.isDehydrated&&(uc(e,t).flags|=256),2!==(e=fc(e,t))&&(t=Rl,Rl=n,null!==t&&ic(t)),e}function ic(e){null===Rl?Rl=e:Rl.push.apply(Rl,e)}function oc(e,t){for(t&=~Ml,t&=~Tl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-st(t),r=1<<n;e[n]=-1,t&=~r}}function sc(e){if(0!=(6&_l))throw Error(o(327));bc();var t=ht(e,0);if(0==(1&t))return tc(e,Je()),null;var n=fc(e,t);if(0!==e.tag&&2===n){var r=ft(e);0!==r&&(t=r,n=rc(e,r))}if(1===n)throw n=Dl,uc(e,0),oc(e,t),tc(e,Je()),n;if(6===n)throw Error(o(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ac(e,Rl,Ul),tc(e,Je()),null}function ac(e,t){var n=_l;_l|=1;try{return e(t)}finally{0===(_l=n)&&(Ql=Je()+500,Mi&&Li())}}function lc(e){null!==Yl&&0===Yl.tag&&0==(6&_l)&&bc();var t=_l;_l|=1;var n=Il.transition,r=At;try{if(Il.transition=null,At=1,e)return e()}finally{At=r,Il.transition=n,0==(6&(_l=t))&&Li()}}function cc(){Bl=Ol.current,Si(Ol)}function uc(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,ti(n)),null!==Pl)for(n=Pl.return;null!==n;){var r=n;switch(Xi(r),r.tag){case 1:null!=(r=r.type.childContextTypes)&&Bi();break;case 3:ns(),Si(_i),Si(Ii),ls();break;case 5:is(r);break;case 4:ns();break;case 13:case 19:Si(os);break;case 10:bo(r.type._context);break;case 22:case 23:cc()}n=n.return}if(xl=e,Pl=e=Oc(e.current,null),kl=Bl=t,Nl=0,Dl=null,Ml=Tl=jl=0,Rl=Fl=null,null!==Eo){for(t=0;t<Eo.length;t++)if(null!==(r=(n=Eo[t]).interleaved)){n.interleaved=null;var i=r.next,o=n.pending;if(null!==o){var s=o.next;o.next=i,r.next=s}n.pending=r}Eo=null}return e}function dc(e,t){for(;;){var n=Pl;try{if(Ao(),cs.current=ra,gs){for(var r=hs.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}gs=!1}if(ds=0,fs=ps=hs=null,ms=!1,ys=0,El.current=null,null===n||null===n.return){Nl=1,Dl=t,Pl=null;break}e:{var s=e,a=n.return,l=n,c=t;if(t=kl,l.flags|=32768,null!==c&&"object"==typeof c&&"function"==typeof c.then){var u=c,d=l,h=d.tag;if(0==(1&d.mode)&&(0===h||11===h||15===h)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var f=fa(a);if(null!==f){f.flags&=-257,ga(f,a,l,0,t),1&f.mode&&pa(s,u,t),c=u;var g=(t=f).updateQueue;if(null===g){var m=new Set;m.add(c),t.updateQueue=m}else g.add(c);break e}if(0==(1&t)){pa(s,u,t),pc();break e}c=Error(o(426))}else if(to&&1&l.mode){var y=fa(a);if(null!==y){0==(65536&y.flags)&&(y.flags|=256),ga(y,a,l,0,t),ho(aa(c,l));break e}}s=c=aa(c,l),4!==Nl&&(Nl=2),null===Fl?Fl=[s]:Fl.push(s),s=a;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t,jo(s,da(0,c,t));break e;case 1:l=c;var v=s.type,A=s.stateNode;if(0==(128&s.flags)&&("function"==typeof v.getDerivedStateFromError||null!==A&&"function"==typeof A.componentDidCatch&&(null===Hl||!Hl.has(A)))){s.flags|=65536,t&=-t,s.lanes|=t,jo(s,ha(s,l,t));break e}}s=s.return}while(null!==s)}vc(n)}catch(e){t=e,Pl===n&&null!==n&&(Pl=n=n.return);continue}break}}function hc(){var e=Cl.current;return Cl.current=ra,null===e?ra:e}function pc(){0!==Nl&&3!==Nl&&2!==Nl||(Nl=4),null===xl||0==(268435455&jl)&&0==(268435455&Tl)||oc(xl,kl)}function fc(e,t){var n=_l;_l|=2;var r=hc();for(xl===e&&kl===t||(Ul=null,uc(e,t));;)try{gc();break}catch(t){dc(e,t)}if(Ao(),_l=n,Cl.current=r,null!==Pl)throw Error(o(261));return xl=null,kl=0,Nl}function gc(){for(;null!==Pl;)yc(Pl)}function mc(){for(;null!==Pl&&!We();)yc(Pl)}function yc(e){var t=wl(e.alternate,e,Bl);e.memoizedProps=e.pendingProps,null===t?vc(e):Pl=t,El.current=null}function vc(e){var t=e;do{var n=t.alternate;if(e=t.return,0==(32768&t.flags)){if(null!==(n=Ga(n,t,Bl)))return void(Pl=n)}else{if(null!==(n=Ya(n,t)))return n.flags&=32767,void(Pl=n);if(null===e)return Nl=6,void(Pl=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}if(null!==(t=t.sibling))return void(Pl=t);Pl=t=e}while(null!==t);0===Nl&&(Nl=5)}function Ac(e,t,n){var r=At,i=Il.transition;try{Il.transition=null,At=1,function(e,t,n,r){do{bc()}while(null!==Yl);if(0!=(6&_l))throw Error(o(327));n=e.finishedWork;var i=e.finishedLanes;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(o(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-st(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}(e,s),e===xl&&(Pl=xl=null,kl=0),0==(2064&n.subtreeFlags)&&0==(2064&n.flags)||Gl||(Gl=!0,xc(tt,(function(){return bc(),null}))),s=0!=(15990&n.flags),0!=(15990&n.subtreeFlags)||s){s=Il.transition,Il.transition=null;var a=At;At=1;var l=_l;_l|=4,El.current=null,function(e,t){if(Jr=Ht,ur(e=cr())){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch(e){n=null;break e}var a=0,l=-1,c=-1,u=0,d=0,h=e,p=null;t:for(;;){for(var f;h!==n||0!==i&&3!==h.nodeType||(l=a+i),h!==s||0!==r&&3!==h.nodeType||(c=a+r),3===h.nodeType&&(a+=h.nodeValue.length),null!==(f=h.firstChild);)p=h,h=f;for(;;){if(h===e)break t;if(p===n&&++u===i&&(l=a),p===s&&++d===r&&(c=a),null!==(f=h.nextSibling))break;p=(h=p).parentNode}h=f}n=-1===l||-1===c?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Xr={focusedElem:e,selectionRange:n},Ht=!1,qa=t;null!==qa;)if(e=(t=qa).child,0!=(1028&t.subtreeFlags)&&null!==e)e.return=t,qa=e;else for(;null!==qa;){t=qa;try{var g=t.alternate;if(0!=(1024&t.flags))switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==g){var m=g.memoizedProps,y=g.memoizedState,v=t.stateNode,A=v.getSnapshotBeforeUpdate(t.elementType===t.type?m:fo(t.type,m),y);v.__reactInternalSnapshotBeforeUpdate=A}break;case 3:var b=t.stateNode.containerInfo;1===b.nodeType?b.textContent="":9===b.nodeType&&b.documentElement&&b.removeChild(b.documentElement);break;default:throw Error(o(163))}}catch(e){Sc(t,t.return,e)}if(null!==(e=t.sibling)){e.return=t.return,qa=e;break}qa=t.return}g=$a,$a=!1}(e,n),fl(n,e),dr(Xr),Ht=!!Jr,Xr=Jr=null,e.current=n,ml(n,e,i),qe(),_l=l,At=a,Il.transition=s}else e.current=n;if(Gl&&(Gl=!1,Yl=e,zl=i),0===(s=e.pendingLanes)&&(Hl=null),function(e){if(ot&&"function"==typeof ot.onCommitFiberRoot)try{ot.onCommitFiberRoot(it,e,void 0,128==(128&e.current.flags))}catch(e){}}(n.stateNode),tc(e,Je()),null!==t)for(r=e.onRecoverableError,n=0;n<t.length;n++)r((i=t[n]).value,{componentStack:i.stack,digest:i.digest});if(Vl)throw Vl=!1,e=Kl,Kl=null,e;0!=(1&zl)&&0!==e.tag&&bc(),0!=(1&(s=e.pendingLanes))?e===Wl?Zl++:(Zl=0,Wl=e):Zl=0,Li()}(e,t,n,r)}finally{Il.transition=i,At=r}return null}function bc(){if(null!==Yl){var e=bt(zl),t=Il.transition,n=At;try{if(Il.transition=null,At=16>e?16:e,null===Yl)var r=!1;else{if(e=Yl,Yl=null,zl=0,0!=(6&_l))throw Error(o(331));var i=_l;for(_l|=4,qa=e.current;null!==qa;){var s=qa,a=s.child;if(0!=(16&qa.flags)){var l=s.deletions;if(null!==l){for(var c=0;c<l.length;c++){var u=l[c];for(qa=u;null!==qa;){var d=qa;switch(d.tag){case 0:case 11:case 15:el(8,d,s)}var h=d.child;if(null!==h)h.return=d,qa=h;else for(;null!==qa;){var p=(d=qa).sibling,f=d.return;if(rl(d),d===u){qa=null;break}if(null!==p){p.return=f,qa=p;break}qa=f}}}var g=s.alternate;if(null!==g){var m=g.child;if(null!==m){g.child=null;do{var y=m.sibling;m.sibling=null,m=y}while(null!==m)}}qa=s}}if(0!=(2064&s.subtreeFlags)&&null!==a)a.return=s,qa=a;else e:for(;null!==qa;){if(0!=(2048&(s=qa).flags))switch(s.tag){case 0:case 11:case 15:el(9,s,s.return)}var v=s.sibling;if(null!==v){v.return=s.return,qa=v;break e}qa=s.return}}var A=e.current;for(qa=A;null!==qa;){var b=(a=qa).child;if(0!=(2064&a.subtreeFlags)&&null!==b)b.return=a,qa=b;else e:for(a=A;null!==qa;){if(0!=(2048&(l=qa).flags))try{switch(l.tag){case 0:case 11:case 15:tl(9,l)}}catch(e){Sc(l,l.return,e)}if(l===a){qa=null;break e}var w=l.sibling;if(null!==w){w.return=l.return,qa=w;break e}qa=l.return}}if(_l=i,Li(),ot&&"function"==typeof ot.onPostCommitFiberRoot)try{ot.onPostCommitFiberRoot(it,e)}catch(e){}r=!0}return r}finally{At=n,Il.transition=t}}return!1}function wc(e,t,n){e=No(e,t=da(0,t=aa(n,t),1),1),t=Xl(),null!==e&&(yt(e,1,t),tc(e,t))}function Sc(e,t,n){if(3===e.tag)wc(e,e,n);else for(;null!==t;){if(3===t.tag){wc(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Hl||!Hl.has(r))){t=No(t,e=ha(t,e=aa(n,e),1),1),e=Xl(),null!==t&&(yt(t,1,e),tc(t,e));break}}t=t.return}}function Cc(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=Xl(),e.pingedLanes|=e.suspendedLanes&n,xl===e&&(kl&n)===n&&(4===Nl||3===Nl&&(130023424&kl)===kl&&500>Je()-Ll?uc(e,0):Ml|=n),tc(e,t)}function Ec(e,t){0===t&&(0==(1&e.mode)?t=1:(t=ut,0==(130023424&(ut<<=1))&&(ut=4194304)));var n=Xl();null!==(e=xo(e,t))&&(yt(e,t,n),tc(e,n))}function Ic(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Ec(e,n)}function _c(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(o(314))}null!==r&&r.delete(t),Ec(e,n)}function xc(e,t){return ze(e,t)}function Pc(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kc(e,t,n,r){return new Pc(e,t,n,r)}function Bc(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Oc(e,t){var n=e.alternate;return null===n?((n=kc(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Nc(e,t,n,r,i,s){var a=2;if(r=e,"function"==typeof e)Bc(e)&&(a=1);else if("string"==typeof e)a=5;else e:switch(e){case C:return Dc(n.children,i,s,t);case E:a=8,i|=8;break;case I:return(e=kc(12,n,t,2|i)).elementType=I,e.lanes=s,e;case k:return(e=kc(13,n,t,i)).elementType=k,e.lanes=s,e;case B:return(e=kc(19,n,t,i)).elementType=B,e.lanes=s,e;case D:return jc(n,i,s,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case _:a=10;break e;case x:a=9;break e;case P:a=11;break e;case O:a=14;break e;case N:a=16,r=null;break e}throw Error(o(130,null==e?e:typeof e,""))}return(t=kc(a,n,t,i)).elementType=e,t.type=r,t.lanes=s,t}function Dc(e,t,n,r){return(e=kc(7,e,r,t)).lanes=n,e}function jc(e,t,n,r){return(e=kc(22,e,r,t)).elementType=D,e.lanes=n,e.stateNode={isHidden:!1},e}function Tc(e,t,n){return(e=kc(6,e,null,t)).lanes=n,e}function Mc(e,t,n){return(t=kc(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Fc(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=mt(0),this.expirationTimes=mt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Rc(e,t,n,r,i,o,s,a,l){return e=new Fc(e,t,n,a,l),1===t?(t=1,!0===o&&(t|=8)):t=0,o=kc(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ko(o),e}function Lc(e){if(!e)return Ei;e:{if(Ve(e=e._reactInternals)!==e||1!==e.tag)throw Error(o(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ki(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(o(171))}if(1===e.tag){var n=e.type;if(ki(n))return Ni(e,n,t)}return t}function Qc(e,t,n,r,i,o,s,a,l){return(e=Rc(n,r,!0,e,0,o,0,a,l)).context=Lc(null),n=e.current,(o=Oo(r=Xl(),i=$l(n))).callback=null!=t?t:null,No(n,o,i),e.current.lanes=i,yt(e,i,r),tc(e,r),e}function Uc(e,t,n,r){var i=t.current,o=Xl(),s=$l(i);return n=Lc(n),null===t.context?t.context=n:t.pendingContext=n,(t=Oo(o,s)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=No(i,t,s))&&(ec(e,i,s,o),Do(e,i,s)),s}function Vc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Kc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Hc(e,t){Kc(e,t),(e=e.alternate)&&Kc(e,t)}wl=function(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps||_i.current)ya=!0;else{if(0==(e.lanes&n)&&0==(128&t.flags))return ya=!1,function(e,t,n){switch(t.tag){case 3:xa(t),uo();break;case 5:rs(t);break;case 1:ki(t.type)&&Di(t);break;case 4:ts(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Ci(go,r._currentValue),r._currentValue=i;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(Ci(os,1&os.current),t.flags|=128,null):0!=(n&t.child.childLanes)?Ta(e,t,n):(Ci(os,1&os.current),null!==(e=Va(e,t,n))?e.sibling:null);Ci(os,1&os.current);break;case 19:if(r=0!=(n&t.childLanes),0!=(128&e.flags)){if(r)return Qa(e,t,n);t.flags|=128}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ci(os,os.current),r)break;return null;case 22:case 23:return t.lanes=0,Sa(e,t,n)}return Va(e,t,n)}(e,t,n);ya=0!=(131072&e.flags)}else ya=!1,to&&0!=(1048576&t.flags)&&qi(t,Ki,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ua(e,t),e=t.pendingProps;var i=Pi(t,Ii.current);So(t,n),i=ws(null,t,r,e,i,n);var s=Ss();return t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ki(r)?(s=!0,Di(t)):s=!1,t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,ko(t),i.updater=Lo,t.stateNode=i,i._reactInternals=t,Ko(t,r,e,n),t=_a(null,t,r,!0,s,n)):(t.tag=0,to&&s&&Ji(t),va(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ua(e,t),e=t.pendingProps,r=(i=r._init)(r._payload),t.type=r,i=t.tag=function(e){if("function"==typeof e)return Bc(e)?1:0;if(null!=e){if((e=e.$$typeof)===P)return 11;if(e===O)return 14}return 2}(r),e=fo(r,e),i){case 0:t=Ea(null,t,r,e,n);break e;case 1:t=Ia(null,t,r,e,n);break e;case 11:t=Aa(null,t,r,e,n);break e;case 14:t=ba(null,t,r,fo(r.type,e),n);break e}throw Error(o(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,Ea(e,t,r,i=t.elementType===r?i:fo(r,i),n);case 1:return r=t.type,i=t.pendingProps,Ia(e,t,r,i=t.elementType===r?i:fo(r,i),n);case 3:e:{if(xa(t),null===e)throw Error(o(387));r=t.pendingProps,i=(s=t.memoizedState).element,Bo(e,t),To(t,r,null,n);var a=t.memoizedState;if(r=a.element,s.isDehydrated){if(s={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=s,t.memoizedState=s,256&t.flags){t=Pa(e,t,r,n,i=aa(Error(o(423)),t));break e}if(r!==i){t=Pa(e,t,r,n,i=aa(Error(o(424)),t));break e}for(eo=si(t.stateNode.containerInfo.firstChild),$i=t,to=!0,no=null,n=Wo(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(uo(),r===i){t=Va(e,t,n);break e}va(e,t,r,n)}t=t.child}return t;case 5:return rs(t),null===e&&so(t),r=t.type,i=t.pendingProps,s=null!==e?e.memoizedProps:null,a=i.children,$r(r,i)?a=null:null!==s&&$r(r,s)&&(t.flags|=32),Ca(e,t),va(e,t,a,n),t.child;case 6:return null===e&&so(t),null;case 13:return Ta(e,t,n);case 4:return ts(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Zo(t,null,r,n):va(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,Aa(e,t,r,i=t.elementType===r?i:fo(r,i),n);case 7:return va(e,t,t.pendingProps,n),t.child;case 8:case 12:return va(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,a=i.value,Ci(go,r._currentValue),r._currentValue=a,null!==s)if(ir(s.value,a)){if(s.children===i.children&&!_i.current){t=Va(e,t,n);break e}}else for(null!==(s=t.child)&&(s.return=t);null!==s;){var l=s.dependencies;if(null!==l){a=s.child;for(var c=l.firstContext;null!==c;){if(c.context===r){if(1===s.tag){(c=Oo(-1,n&-n)).tag=2;var u=s.updateQueue;if(null!==u){var d=(u=u.shared).pending;null===d?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}s.lanes|=n,null!==(c=s.alternate)&&(c.lanes|=n),wo(s.return,n,t),l.lanes|=n;break}c=c.next}}else if(10===s.tag)a=s.type===t.type?null:s.child;else if(18===s.tag){if(null===(a=s.return))throw Error(o(341));a.lanes|=n,null!==(l=a.alternate)&&(l.lanes|=n),wo(a,n,t),a=s.sibling}else a=s.child;if(null!==a)a.return=s;else for(a=s;null!==a;){if(a===t){a=null;break}if(null!==(s=a.sibling)){s.return=a.return,a=s;break}a=a.return}s=a}va(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,So(t,n),r=r(i=Co(i)),t.flags|=1,va(e,t,r,n),t.child;case 14:return i=fo(r=t.type,t.pendingProps),ba(e,t,r,i=fo(r.type,i),n);case 15:return wa(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:fo(r,i),Ua(e,t),t.tag=1,ki(r)?(e=!0,Di(t)):e=!1,So(t,n),Uo(t,r,i),Ko(t,r,i,n),_a(null,t,r,!0,e,n);case 19:return Qa(e,t,n);case 22:return Sa(e,t,n)}throw Error(o(156,t.tag))};var Gc="function"==typeof reportError?reportError:function(e){console.error(e)};function Yc(e){this._internalRoot=e}function zc(e){this._internalRoot=e}function Zc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Wc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function qc(){}function Jc(e,t,n,r,i){var o=n._reactRootContainer;if(o){var s=o;if("function"==typeof i){var a=i;i=function(){var e=Vc(s);a.call(e)}}Uc(t,s,e,i)}else s=function(e,t,n,r,i){if(i){if("function"==typeof r){var o=r;r=function(){var e=Vc(s);o.call(e)}}var s=Qc(t,r,e,0,null,!1,0,"",qc);return e._reactRootContainer=s,e[di]=s.current,Lr(8===e.nodeType?e.parentNode:e),lc(),s}for(;i=e.lastChild;)e.removeChild(i);if("function"==typeof r){var a=r;r=function(){var e=Vc(l);a.call(e)}}var l=Rc(e,0,!1,null,0,!1,0,"",qc);return e._reactRootContainer=l,e[di]=l.current,Lr(8===e.nodeType?e.parentNode:e),lc((function(){Uc(t,l,n,r)})),l}(n,t,e,i,r);return Vc(s)}zc.prototype.render=Yc.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(o(409));Uc(e,t,null,null)},zc.prototype.unmount=Yc.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;lc((function(){Uc(null,e,null,null)})),t[di]=null}},zc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Et();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Dt.length&&0!==t&&t<Dt[n].priority;n++);Dt.splice(n,0,e),0===n&&Ft(e)}},wt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=dt(t.pendingLanes);0!==n&&(vt(t,1|n),tc(t,Je()),0==(6&_l)&&(Ql=Je()+500,Li()))}break;case 13:lc((function(){var t=xo(e,1);if(null!==t){var n=Xl();ec(t,e,1,n)}})),Hc(e,1)}},St=function(e){if(13===e.tag){var t=xo(e,134217728);null!==t&&ec(t,e,134217728,Xl()),Hc(e,134217728)}},Ct=function(e){if(13===e.tag){var t=$l(e),n=xo(e,t);null!==n&&ec(n,e,t,Xl()),Hc(e,t)}},Et=function(){return At},It=function(e,t){var n=At;try{return At=e,t()}finally{At=n}},Se=function(e,t,n){switch(t){case"input":if(X(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=vi(r);if(!i)throw Error(o(90));z(r),X(r,i)}}}break;case"textarea":oe(e,n);break;case"select":null!=(t=n.value)&&ne(e,!!n.multiple,t,!1)}},Pe=ac,ke=lc;var Xc={usingClientEntryPoint:!1,Events:[mi,yi,vi,_e,xe,ac]},$c={findFiberByHostInstance:gi,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},eu={bundleType:$c.bundleType,version:$c.version,rendererPackageName:$c.rendererPackageName,rendererConfig:$c.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:b.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Ge(e))?null:e.stateNode},findFiberByHostInstance:$c.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var tu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tu.isDisabled&&tu.supportsFiber)try{it=tu.inject(eu),ot=tu}catch(ue){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Xc,t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Zc(t))throw Error(o(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:S,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.createRoot=function(e,t){if(!Zc(e))throw Error(o(299));var n=!1,r="",i=Gc;return null!=t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onRecoverableError&&(i=t.onRecoverableError)),t=Rc(e,1,!1,null,0,n,0,r,i),e[di]=t.current,Lr(8===e.nodeType?e.parentNode:e),new Yc(t)},t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(o(188));throw e=Object.keys(e).join(","),Error(o(268,e))}return null===(e=Ge(t))?null:e.stateNode},t.flushSync=function(e){return lc(e)},t.hydrate=function(e,t,n){if(!Wc(t))throw Error(o(200));return Jc(null,e,t,!0,n)},t.hydrateRoot=function(e,t,n){if(!Zc(e))throw Error(o(405));var r=null!=n&&n.hydratedSources||null,i=!1,s="",a=Gc;if(null!=n&&(!0===n.unstable_strictMode&&(i=!0),void 0!==n.identifierPrefix&&(s=n.identifierPrefix),void 0!==n.onRecoverableError&&(a=n.onRecoverableError)),t=Qc(t,null,e,1,null!=n?n:null,i,0,s,a),e[di]=t.current,Lr(e),r)for(e=0;e<r.length;e++)i=(i=(n=r[e])._getVersion)(n._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new zc(t)},t.render=function(e,t,n){if(!Wc(t))throw Error(o(200));return Jc(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!Wc(e))throw Error(o(40));return!!e._reactRootContainer&&(lc((function(){Jc(null,null,e,!1,(function(){e._reactRootContainer=null,e[di]=null}))})),!0)},t.unstable_batchedUpdates=ac,t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Wc(n))throw Error(o(200));if(null==e||void 0===e._reactInternals)throw Error(o(38));return Jc(e,t,n,!1,r)},t.version="18.2.0-next-9e3b772b8-20220608"},17029:(e,t,n)=>{"use strict";var r=n(28316);t.s=r.createRoot,r.hydrateRoot},28316:(e,t,n)=>{"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(52967)},9670:(e,t)=>{"use strict";function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,i=e[r];if(!(0<o(i,t)))break e;e[r]=t,e[n]=i,n=r}}function r(e){return 0===e.length?null:e[0]}function i(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length,s=i>>>1;r<s;){var a=2*(r+1)-1,l=e[a],c=a+1,u=e[c];if(0>o(l,n))c<i&&0>o(u,l)?(e[r]=u,e[c]=n,r=c):(e[r]=l,e[a]=n,r=a);else{if(!(c<i&&0>o(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,h=null,p=3,f=!1,g=!1,m=!1,y="function"==typeof setTimeout?setTimeout:null,v="function"==typeof clearTimeout?clearTimeout:null,A="undefined"!=typeof setImmediate?setImmediate:null;function b(e){for(var t=r(u);null!==t;){if(null===t.callback)i(u);else{if(!(t.startTime<=e))break;i(u),t.sortIndex=t.expirationTime,n(c,t)}t=r(u)}}function w(e){if(m=!1,b(e),!g)if(null!==r(c))g=!0,D(S);else{var t=r(u);null!==t&&j(w,t.startTime-e)}}function S(e,n){g=!1,m&&(m=!1,v(_),_=-1),f=!0;var o=p;try{for(b(n),h=r(c);null!==h&&(!(h.expirationTime>n)||e&&!k());){var s=h.callback;if("function"==typeof s){h.callback=null,p=h.priorityLevel;var a=s(h.expirationTime<=n);n=t.unstable_now(),"function"==typeof a?h.callback=a:h===r(c)&&i(c),b(n)}else i(c);h=r(c)}if(null!==h)var l=!0;else{var d=r(u);null!==d&&j(w,d.startTime-n),l=!1}return l}finally{h=null,p=o,f=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var C,E=!1,I=null,_=-1,x=5,P=-1;function k(){return!(t.unstable_now()-P<x)}function B(){if(null!==I){var e=t.unstable_now();P=e;var n=!0;try{n=I(!0,e)}finally{n?C():(E=!1,I=null)}}else E=!1}if("function"==typeof A)C=function(){A(B)};else if("undefined"!=typeof MessageChannel){var O=new MessageChannel,N=O.port2;O.port1.onmessage=B,C=function(){N.postMessage(null)}}else C=function(){y(B,0)};function D(e){I=e,E||(E=!0,C())}function j(e,n){_=y((function(){e(t.unstable_now())}),n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){g||f||(g=!0,D(S))},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):x=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return r(c)},t.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var n=p;p=t;try{return e()}finally{p=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=p;p=e;try{return t()}finally{p=n}},t.unstable_scheduleCallback=function(e,i,o){var s=t.unstable_now();switch(o="object"==typeof o&&null!==o&&"number"==typeof(o=o.delay)&&0<o?s+o:s,e){case 1:var a=-1;break;case 2:a=250;break;case 5:a=1073741823;break;case 4:a=1e4;break;default:a=5e3}return e={id:d++,callback:i,priorityLevel:e,startTime:o,expirationTime:a=o+a,sortIndex:-1},o>s?(e.sortIndex=o,n(u,e),null===r(c)&&e===r(u)&&(m?(v(_),_=-1):m=!0,j(w,o-s))):(e.sortIndex=a,n(c,e),g||f||(g=!0,D(S))),e},t.unstable_shouldYield=k,t.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}},22941:(e,t,n)=>{"use strict";e.exports=n(9670)},11837:(e,t,n)=>{"use strict";var r=n(2784),i=Symbol.for("react.element"),o=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,o={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)s.call(t,r)&&!l.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:i,type:e,key:c,ref:u,props:o,_owner:a.current}}t.Fragment=o,t.jsx=c,t.jsxs=c},83426:(e,t)=>{"use strict";var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator,f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,m={};function y(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||f}function v(){}function A(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||f}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},v.prototype=y.prototype;var b=A.prototype=new v;b.constructor=A,g(b,y.prototype),b.isPureReactComponent=!0;var w=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},E={key:!0,ref:!0,__self:!0,__source:!0};function I(e,t,r){var i,o={},s=null,a=null;if(null!=t)for(i in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(s=""+t.key),t)S.call(t,i)&&!E.hasOwnProperty(i)&&(o[i]=t[i]);var l=arguments.length-2;if(1===l)o.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];o.children=c}if(e&&e.defaultProps)for(i in l=e.defaultProps)void 0===o[i]&&(o[i]=l[i]);return{$$typeof:n,type:e,key:s,ref:a,props:o,_owner:C.current}}function _(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var x=/\/+/g;function P(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function k(e,t,i,o,s){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var l=!1;if(null===e)l=!0;else switch(a){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case n:case r:l=!0}}if(l)return s=s(l=e),e=""===o?"."+P(l,0):o,w(s)?(i="",null!=e&&(i=e.replace(x,"$&/")+"/"),k(s,t,i,"",(function(e){return e}))):null!=s&&(_(s)&&(s=function(e,t){return{$$typeof:n,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(s,i+(!s.key||l&&l.key===s.key?"":(""+s.key).replace(x,"$&/")+"/")+e)),t.push(s)),1;if(l=0,o=""===o?".":o+":",w(e))for(var c=0;c<e.length;c++){var u=o+P(a=e[c],c);l+=k(a,t,i,u,s)}else if(u=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=p&&e[p]||e["@@iterator"])?e:null}(e),"function"==typeof u)for(e=u.call(e),c=0;!(a=e.next()).done;)l+=k(a=a.value,t,i,u=o+P(a,c++),s);else if("object"===a)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function B(e,t,n){if(null==e)return e;var r=[],i=0;return k(e,r,"","",(function(e){return t.call(n,e,i++)})),r}function O(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var N={current:null},D={transition:null},j={ReactCurrentDispatcher:N,ReactCurrentBatchConfig:D,ReactCurrentOwner:C};t.Children={map:B,forEach:function(e,t,n){B(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return B(e,(function(){t++})),t},toArray:function(e){return B(e,(function(e){return e}))||[]},only:function(e){if(!_(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=y,t.Fragment=i,t.Profiler=s,t.PureComponent=A,t.StrictMode=o,t.Suspense=u,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=j,t.cloneElement=function(e,t,r){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=g({},e.props),o=e.key,s=e.ref,a=e._owner;if(null!=t){if(void 0!==t.ref&&(s=t.ref,a=C.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)S.call(t,c)&&!E.hasOwnProperty(c)&&(i[c]=void 0===t[c]&&void 0!==l?l[c]:t[c])}var c=arguments.length-2;if(1===c)i.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];i.children=l}return{$$typeof:n,type:e.type,key:o,ref:s,props:i,_owner:a}},t.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:a,_context:e},e.Consumer=e},t.createElement=I,t.createFactory=function(e){var t=I.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=_,t.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:O}},t.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=D.transition;D.transition={};try{e()}finally{D.transition=t}},t.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},t.useCallback=function(e,t){return N.current.useCallback(e,t)},t.useContext=function(e){return N.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return N.current.useDeferredValue(e)},t.useEffect=function(e,t){return N.current.useEffect(e,t)},t.useId=function(){return N.current.useId()},t.useImperativeHandle=function(e,t,n){return N.current.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return N.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return N.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return N.current.useMemo(e,t)},t.useReducer=function(e,t,n){return N.current.useReducer(e,t,n)},t.useRef=function(e){return N.current.useRef(e)},t.useState=function(e){return N.current.useState(e)},t.useSyncExternalStore=function(e,t,n){return N.current.useSyncExternalStore(e,t,n)},t.useTransition=function(){return N.current.useTransition()},t.version="18.2.0"},2784:(e,t,n)=>{"use strict";e.exports=n(83426)},52322:(e,t,n)=>{"use strict";e.exports=n(11837)},20452:(e,t,n)=>{"use strict";var r=n(2784),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=r.useState,s=r.useEffect,a=r.useLayoutEffect,l=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=o({inst:{value:n,getSnapshot:t}}),i=r[0].inst,u=r[1];return a((function(){i.value=n,i.getSnapshot=t,c(i)&&u({inst:i})}),[e,n,t]),s((function(){return c(i)&&u({inst:i}),e((function(){c(i)&&u({inst:i})}))}),[e]),l(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},43100:(e,t,n)=>{"use strict";e.exports=n(20452)},44330:e=>{"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},10082:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},43335:(e,t,n)=>{var r=/%[sdj%]/g;t.format=function(e){if(!m(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(s(arguments[n]));return t.join(" ")}n=1;for(var i=arguments,o=i.length,a=String(e).replace(r,(function(e){if("%%"===e)return"%";if(n>=o)return e;switch(e){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch(e){return"[Circular]"}default:return e}})),l=i[n];n<o;l=i[++n])f(l)||!A(l)?a+=" "+l:a+=" "+s(l);return a},t.deprecate=function(e,r){if(y(n.g.process))return function(){return t.deprecate(e,r).apply(this,arguments)};if(!0===process.noDeprecation)return e;var i=!1;return function(){if(!i){if(process.throwDeprecation)throw new Error(r);process.traceDeprecation?console.trace(r):console.error(r),i=!0}return e.apply(this,arguments)}};var i,o={};function s(e,n){var r={seen:[],stylize:l};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),p(n)?r.showHidden=n:n&&t._extend(r,n),y(r.showHidden)&&(r.showHidden=!1),y(r.depth)&&(r.depth=2),y(r.colors)&&(r.colors=!1),y(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=a),c(r,e,r.depth)}function a(e,t){var n=s.styles[t];return n?"["+s.colors[n][0]+"m"+e+"["+s.colors[n][1]+"m":e}function l(e,t){return e}function c(e,n,r){if(e.customInspect&&n&&S(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return m(i)||(i=c(e,i,r)),i}var o=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(m(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return g(t)?e.stylize(""+t,"number"):p(t)?e.stylize(""+t,"boolean"):f(t)?e.stylize("null","null"):void 0}(e,n);if(o)return o;var s=Object.keys(n),a=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(n)),w(n)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return u(n);if(0===s.length){if(S(n)){var l=n.name?": "+n.name:"";return e.stylize("[Function"+l+"]","special")}if(v(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(b(n))return e.stylize(Date.prototype.toString.call(n),"date");if(w(n))return u(n)}var A,C="",E=!1,I=["{","}"];return h(n)&&(E=!0,I=["[","]"]),S(n)&&(C=" [Function"+(n.name?": "+n.name:"")+"]"),v(n)&&(C=" "+RegExp.prototype.toString.call(n)),b(n)&&(C=" "+Date.prototype.toUTCString.call(n)),w(n)&&(C=" "+u(n)),0!==s.length||E&&0!=n.length?r<0?v(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),A=E?function(e,t,n,r,i){for(var o=[],s=0,a=t.length;s<a;++s)_(t,String(s))?o.push(d(e,t,n,r,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(d(e,t,n,r,i,!0))})),o}(e,n,r,a,s):s.map((function(t){return d(e,n,r,a,t,E)})),e.seen.pop(),function(e,t,n){return e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n  ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}(A,C,I)):I[0]+C+I[1]}function u(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,n,r,i,o){var s,a,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(a=e.stylize("[Setter]","special")),_(r,i)||(s="["+i+"]"),a||(e.seen.indexOf(l.value)<0?(a=f(n)?c(e,l.value,null):c(e,l.value,n-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(e){return"  "+e})).join("\n").substr(2):"\n"+a.split("\n").map((function(e){return"   "+e})).join("\n")):a=e.stylize("[Circular]","special")),y(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function h(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function f(e){return null===e}function g(e){return"number"==typeof e}function m(e){return"string"==typeof e}function y(e){return void 0===e}function v(e){return A(e)&&"[object RegExp]"===C(e)}function A(e){return"object"==typeof e&&null!==e}function b(e){return A(e)&&"[object Date]"===C(e)}function w(e){return A(e)&&("[object Error]"===C(e)||e instanceof Error)}function S(e){return"function"==typeof e}function C(e){return Object.prototype.toString.call(e)}function E(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(y(i)&&(i=process.env.NODE_DEBUG||""),e=e.toUpperCase(),!o[e])if(new RegExp("\\b"+e+"\\b","i").test(i)){var n=process.pid;o[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,n,r)}}else o[e]=function(){};return o[e]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=h,t.isBoolean=p,t.isNull=f,t.isNullOrUndefined=function(e){return null==e},t.isNumber=g,t.isString=m,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=y,t.isRegExp=v,t.isObject=A,t.isDate=b,t.isError=w,t.isFunction=S,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(10082);var I=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function _(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,n;console.log("%s - %s",(e=new Date,n=[E(e.getHours()),E(e.getMinutes()),E(e.getSeconds())].join(":"),[e.getDate(),I[e.getMonth()],n].join(" ")),t.format.apply(t,arguments))},t.inherits=n(44330),t._extend=function(e,t){if(!t||!A(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}},60130:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NIL",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"v1",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"v3",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"v4",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"v5",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return l.default}});var r=h(n(27343)),i=h(n(46076)),o=h(n(85854)),s=h(n(13940)),a=h(n(15384)),l=h(n(25791)),c=h(n(77888)),u=h(n(49926)),d=h(n(9964));function h(e){return e&&e.__esModule?e:{default:e}}},2763:(e,t)=>{"use strict";function n(e){return 14+(e+64>>>9<<4)+1}function r(e,t){const n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function i(e,t,n,i,o,s){return r((a=r(r(t,e),r(i,s)))<<(l=o)|a>>>32-l,n);var a,l}function o(e,t,n,r,o,s,a){return i(t&n|~t&r,e,t,o,s,a)}function s(e,t,n,r,o,s,a){return i(t&r|n&~r,e,t,o,s,a)}function a(e,t,n,r,o,s,a){return i(t^n^r,e,t,o,s,a)}function l(e,t,n,r,o,s,a){return i(n^(t|~r),e,t,o,s,a)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return function(e){const t=[],n=32*e.length,r="0123456789abcdef";for(let i=0;i<n;i+=8){const n=e[i>>5]>>>i%32&255,o=parseInt(r.charAt(n>>>4&15)+r.charAt(15&n),16);t.push(o)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[n(t)-1]=t;let i=1732584193,c=-271733879,u=-1732584194,d=271733878;for(let t=0;t<e.length;t+=16){const n=i,h=c,p=u,f=d;i=o(i,c,u,d,e[t],7,-680876936),d=o(d,i,c,u,e[t+1],12,-389564586),u=o(u,d,i,c,e[t+2],17,606105819),c=o(c,u,d,i,e[t+3],22,-1044525330),i=o(i,c,u,d,e[t+4],7,-176418897),d=o(d,i,c,u,e[t+5],12,1200080426),u=o(u,d,i,c,e[t+6],17,-1473231341),c=o(c,u,d,i,e[t+7],22,-45705983),i=o(i,c,u,d,e[t+8],7,1770035416),d=o(d,i,c,u,e[t+9],12,-1958414417),u=o(u,d,i,c,e[t+10],17,-42063),c=o(c,u,d,i,e[t+11],22,-1990404162),i=o(i,c,u,d,e[t+12],7,1804603682),d=o(d,i,c,u,e[t+13],12,-40341101),u=o(u,d,i,c,e[t+14],17,-1502002290),c=o(c,u,d,i,e[t+15],22,1236535329),i=s(i,c,u,d,e[t+1],5,-165796510),d=s(d,i,c,u,e[t+6],9,-1069501632),u=s(u,d,i,c,e[t+11],14,643717713),c=s(c,u,d,i,e[t],20,-373897302),i=s(i,c,u,d,e[t+5],5,-701558691),d=s(d,i,c,u,e[t+10],9,38016083),u=s(u,d,i,c,e[t+15],14,-660478335),c=s(c,u,d,i,e[t+4],20,-405537848),i=s(i,c,u,d,e[t+9],5,568446438),d=s(d,i,c,u,e[t+14],9,-1019803690),u=s(u,d,i,c,e[t+3],14,-187363961),c=s(c,u,d,i,e[t+8],20,1163531501),i=s(i,c,u,d,e[t+13],5,-1444681467),d=s(d,i,c,u,e[t+2],9,-51403784),u=s(u,d,i,c,e[t+7],14,1735328473),c=s(c,u,d,i,e[t+12],20,-1926607734),i=a(i,c,u,d,e[t+5],4,-378558),d=a(d,i,c,u,e[t+8],11,-2022574463),u=a(u,d,i,c,e[t+11],16,1839030562),c=a(c,u,d,i,e[t+14],23,-35309556),i=a(i,c,u,d,e[t+1],4,-1530992060),d=a(d,i,c,u,e[t+4],11,1272893353),u=a(u,d,i,c,e[t+7],16,-155497632),c=a(c,u,d,i,e[t+10],23,-1094730640),i=a(i,c,u,d,e[t+13],4,681279174),d=a(d,i,c,u,e[t],11,-358537222),u=a(u,d,i,c,e[t+3],16,-722521979),c=a(c,u,d,i,e[t+6],23,76029189),i=a(i,c,u,d,e[t+9],4,-640364487),d=a(d,i,c,u,e[t+12],11,-421815835),u=a(u,d,i,c,e[t+15],16,530742520),c=a(c,u,d,i,e[t+2],23,-995338651),i=l(i,c,u,d,e[t],6,-198630844),d=l(d,i,c,u,e[t+7],10,1126891415),u=l(u,d,i,c,e[t+14],15,-1416354905),c=l(c,u,d,i,e[t+5],21,-57434055),i=l(i,c,u,d,e[t+12],6,1700485571),d=l(d,i,c,u,e[t+3],10,-1894986606),u=l(u,d,i,c,e[t+10],15,-1051523),c=l(c,u,d,i,e[t+1],21,-2054922799),i=l(i,c,u,d,e[t+8],6,1873313359),d=l(d,i,c,u,e[t+15],10,-30611744),u=l(u,d,i,c,e[t+6],15,-1560198380),c=l(c,u,d,i,e[t+13],21,1309151649),i=l(i,c,u,d,e[t+4],6,-145523070),d=l(d,i,c,u,e[t+11],10,-1120210379),u=l(u,d,i,c,e[t+2],15,718787259),c=l(c,u,d,i,e[t+9],21,-343485551),i=r(i,n),c=r(c,h),u=r(u,p),d=r(d,f)}return[i,c,u,d]}(function(e){if(0===e.length)return[];const t=8*e.length,r=new Uint32Array(n(t));for(let n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))}},74267:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};t.default=n},15384:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default="00000000-0000-0000-0000-000000000000"},9964:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(77888))&&r.__esModule?r:{default:r};t.default=function(e){if(!(0,i.default)(e))throw TypeError("Invalid UUID");let t;const n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n}},76678:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},41874:(e,t)=>{"use strict";let n;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(r)};const r=new Uint8Array(16)},13254:(e,t)=>{"use strict";function n(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:case 3:return t^n^r;case 2:return t&n^t&r^n&r}}function r(e,t){return e<<t|e>>>32-t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e){const t=[1518500249,1859775393,2400959708,3395469782],i=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const o=e.length/4+2,s=Math.ceil(o/16),a=new Array(s);for(let t=0;t<s;++t){const n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=e[64*t+4*r]<<24|e[64*t+4*r+1]<<16|e[64*t+4*r+2]<<8|e[64*t+4*r+3];a[t]=n}a[s-1][14]=8*(e.length-1)/Math.pow(2,32),a[s-1][14]=Math.floor(a[s-1][14]),a[s-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<s;++e){const o=new Uint32Array(80);for(let t=0;t<16;++t)o[t]=a[e][t];for(let e=16;e<80;++e)o[e]=r(o[e-3]^o[e-8]^o[e-14]^o[e-16],1);let s=i[0],l=i[1],c=i[2],u=i[3],d=i[4];for(let e=0;e<80;++e){const i=Math.floor(e/20),a=r(s,5)+n(i,l,c,u)+d+t[i]+o[e]>>>0;d=u,u=c,c=r(l,30)>>>0,l=s,s=a}i[0]=i[0]+s>>>0,i[1]=i[1]+l>>>0,i[2]=i[2]+c>>>0,i[3]=i[3]+u>>>0,i[4]=i[4]+d>>>0}return[i[0]>>24&255,i[0]>>16&255,i[0]>>8&255,255&i[0],i[1]>>24&255,i[1]>>16&255,i[1]>>8&255,255&i[1],i[2]>>24&255,i[2]>>16&255,i[2]>>8&255,255&i[2],i[3]>>24&255,i[3]>>16&255,i[3]>>8&255,255&i[3],i[4]>>24&255,i[4]>>16&255,i[4]>>8&255,255&i[4]]}},49926:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.unsafeStringify=s;var r,i=(r=n(77888))&&r.__esModule?r:{default:r};const o=[];for(let e=0;e<256;++e)o.push((e+256).toString(16).slice(1));function s(e,t=0){return(o[e[t+0]]+o[e[t+1]]+o[e[t+2]]+o[e[t+3]]+"-"+o[e[t+4]]+o[e[t+5]]+"-"+o[e[t+6]]+o[e[t+7]]+"-"+o[e[t+8]]+o[e[t+9]]+"-"+o[e[t+10]]+o[e[t+11]]+o[e[t+12]]+o[e[t+13]]+o[e[t+14]]+o[e[t+15]]).toLowerCase()}t.default=function(e,t=0){const n=s(e,t);if(!(0,i.default)(n))throw TypeError("Stringified UUID is invalid");return n}},27343:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(41874))&&r.__esModule?r:{default:r},o=n(49926);let s,a,l=0,c=0;t.default=function(e,t,n){let r=t&&n||0;const u=t||new Array(16);let d=(e=e||{}).node||s,h=void 0!==e.clockseq?e.clockseq:a;if(null==d||null==h){const t=e.random||(e.rng||i.default)();null==d&&(d=s=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==h&&(h=a=16383&(t[6]<<8|t[7]))}let p=void 0!==e.msecs?e.msecs:Date.now(),f=void 0!==e.nsecs?e.nsecs:c+1;const g=p-l+(f-c)/1e4;if(g<0&&void 0===e.clockseq&&(h=h+1&16383),(g<0||p>l)&&void 0===e.nsecs&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");l=p,c=f,a=h,p+=122192928e5;const m=(1e4*(268435455&p)+f)%4294967296;u[r++]=m>>>24&255,u[r++]=m>>>16&255,u[r++]=m>>>8&255,u[r++]=255&m;const y=p/4294967296*1e4&268435455;u[r++]=y>>>8&255,u[r++]=255&y,u[r++]=y>>>24&15|16,u[r++]=y>>>16&255,u[r++]=h>>>8|128,u[r++]=255&h;for(let e=0;e<6;++e)u[r+e]=d[e];return t||(0,o.unsafeStringify)(u)}},46076:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(18679)),i=o(n(2763));function o(e){return e&&e.__esModule?e:{default:e}}var s=(0,r.default)("v3",48,i.default);t.default=s},18679:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0,t.default=function(e,t,n){function r(e,r,s,a){var l;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=(0,o.default)(r)),16!==(null===(l=r)||void 0===l?void 0:l.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+e.length);if(c.set(r),c.set(e,r.length),c=n(c),c[6]=15&c[6]|t,c[8]=63&c[8]|128,s){a=a||0;for(let e=0;e<16;++e)s[a+e]=c[e];return s}return(0,i.unsafeStringify)(c)}try{r.name=e}catch(e){}return r.DNS=s,r.URL=a,r};var r,i=n(49926),o=(r=n(9964))&&r.__esModule?r:{default:r};const s="6ba7b810-9dad-11d1-80b4-00c04fd430c8";t.DNS=s;const a="6ba7b811-9dad-11d1-80b4-00c04fd430c8";t.URL=a},85854:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n(74267)),i=s(n(41874)),o=n(49926);function s(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t,n){if(r.default.randomUUID&&!t&&!e)return r.default.randomUUID();const s=(e=e||{}).random||(e.rng||i.default)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=s[e];return t}return(0,o.unsafeStringify)(s)}},13940:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(18679)),i=o(n(13254));function o(e){return e&&e.__esModule?e:{default:e}}var s=(0,r.default)("v5",80,i.default);t.default=s},77888:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(76678))&&r.__esModule?r:{default:r};t.default=function(e){return"string"==typeof e&&i.default.test(e)}},25791:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(77888))&&r.__esModule?r:{default:r};t.default=function(e){if(!(0,i.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}},50633:()=>{},22901:()=>{},68236:()=>{},40077:(e,t,n)=>{"use strict";n.d(t,{EZ:()=>d,S0:()=>h,ih:()=>u});var r=Object.defineProperty,i=Object.defineProperties,o=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,c=(e,t,n)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,u=(e,t)=>{for(var n in t||(t={}))a.call(t,n)&&c(e,n,t[n]);if(s)for(var n of s(t))l.call(t,n)&&c(e,n,t[n]);return e},d=(e,t)=>i(e,o(t)),h=(e,t)=>{var n={};for(var r in e)a.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&s)for(var r of s(e))t.indexOf(r)<0&&l.call(e,r)&&(n[r]=e[r]);return n}},23478:(e,t,n)=>{"use strict";function r(e){return Array.isArray(e)?e:void 0!==e?[e]:[]}function i(e){const t=[];for(const n of e)t.push(...n);return t}function o(e){return e.slice().reverse()}n.d(t,{GP:()=>o,JH:()=>i,qo:()=>r})},13277:(e,t,n)=>{"use strict";n.d(t,{CE:()=>h,Ld:()=>c,MT:()=>s,Ny:()=>f,S1:()=>l,Z_:()=>u,cY:()=>a,dC:()=>d,yt:()=>p});var r=n(81548),i=n(40077);function o(e,t){const n=e.__unstableInternals;return(0,r.kG)(n,"Invalid store"),n[t]}function s(e,...t){let n=e,o=n,a=Symbol(),c=r.ZT;const d=new Set,h=new Set,p=new Set,f=new Set,g=new Set,m=new WeakMap,y=new WeakMap,v=(e,t,n=f)=>(n.add(t),y.set(t,e),()=>{var e;null==(e=m.get(t))||e(),m.delete(t),y.delete(t),n.delete(t)}),A=(e,s,l=!1)=>{if(!(0,r.nr)(n,e))return;const c=(0,r.Ei)(s,n[e]);if(c===n[e])return;l||t.forEach((t=>{var n;null==(n=null==t?void 0:t.setState)||n.call(t,e,c)}));const u=n;n=(0,i.EZ)((0,i.ih)({},n),{[e]:c});const d=Symbol();a=d,h.add(e);const p=(t,r,i)=>{var o;const s=y.get(t);s&&!s.some((t=>i?i.has(t):t===e))||(null==(o=m.get(t))||o(),m.set(t,t(n,r)))};f.forEach((e=>{p(e,u)})),queueMicrotask((()=>{if(a!==d)return;const e=n;g.forEach((e=>{p(e,o,h)})),o=e,h.clear()}))},b={getState:()=>n,setState:A,__unstableInternals:{setup:e=>(p.add(e),()=>p.delete(e)),init:()=>{if(!t.length)return r.ZT;const e=d.size,i=Symbol();d.add(i);const o=()=>{d.delete(i),d.size||c()};if(e)return o;const s=(0,r.RR)(n).map((e=>(0,r.tS)(...t.map((t=>{var n;const i=null==(n=null==t?void 0:t.getState)?void 0:n.call(t);if(i&&(0,r.nr)(i,e))return u(t,[e],(t=>{A(e,t[e],!0)}))}))))),a=[];p.forEach((e=>a.push(e())));const h=t.map(l);return c=(0,r.tS)(...s,...a,...h),o},subscribe:(e,t)=>v(e,t),sync:(e,t)=>(m.set(t,t(n,n)),v(e,t)),batch:(e,t)=>(m.set(t,t(n,o)),v(e,t,g)),pick:e=>s((0,r.ei)(n,e),b),omit:e=>s((0,r.CE)(n,e),b)}};return b}function a(e,...t){if(e)return o(e,"setup")(...t)}function l(e,...t){if(e)return o(e,"init")(...t)}function c(e,...t){if(e)return o(e,"subscribe")(...t)}function u(e,...t){if(e)return o(e,"sync")(...t)}function d(e,...t){if(e)return o(e,"batch")(...t)}function h(e,...t){if(e)return o(e,"omit")(...t)}function p(...e){return s(e.reduce(((e,t)=>{var n;const r=null==(n=null==t?void 0:t.getState)?void 0:n.call(t);return r?(0,i.ih)((0,i.ih)({},e),r):e}),{}),...e)}function f(e,t){}},14191:(e,t,n)=>{"use strict";n.d(t,{t:()=>m});var r=n(13277),i=n(81548),o=n(10244),s=n(40077);function a(e={}){var t;(0,r.Ny)(e,e.store);const n=null==(t=e.store)?void 0:t.getState(),a=(0,i.LS)(e.items,null==n?void 0:n.items,e.defaultItems,[]),l=new Map(a.map((e=>[e.id,e]))),c={items:a,renderedItems:(0,i.LS)(null==n?void 0:n.renderedItems,[])},u=null==(d=e.store)?void 0:d.__unstablePrivateStore;var d;const h=(0,r.MT)({renderedItems:c.renderedItems},u),p=(0,r.MT)(c,e.store),f=()=>{const e=function(e){const t=e.map(((e,t)=>[t,e]));let n=!1;return t.sort((([e,t],[r,i])=>{const o=t.element,s=i.element;return o===s?0:o&&s?function(e,t){return Boolean(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}(o,s)?(e>r&&(n=!0),-1):(e<r&&(n=!0),1):0})),n?t.map((([e,t])=>t)):e}(h.getState().renderedItems);h.setState("renderedItems",e),p.setState("renderedItems",e)};(0,r.cY)(p,(()=>(0,r.S1)(h))),(0,r.cY)(h,(()=>(0,r.dC)(h,["renderedItems"],(e=>{let t=!0,n=requestAnimationFrame(f);if("function"!=typeof IntersectionObserver)return;const r=function(e){var t;const n=e.find((e=>!!e.element)),r=[...e].reverse().find((e=>!!e.element));let i=null==(t=null==n?void 0:n.element)?void 0:t.parentElement;for(;i&&(null==r?void 0:r.element);){if(r&&i.contains(r.element))return i;i=i.parentElement}return(0,o.Me)(i).body}(e.renderedItems),i=new IntersectionObserver((()=>{t?t=!1:(cancelAnimationFrame(n),n=requestAnimationFrame(f))}),{root:r});return e.renderedItems.forEach((e=>{e.element&&i.observe(e.element)})),()=>{cancelAnimationFrame(n),i.disconnect()}}))));const g=(e,t,n=!1)=>{let r;return t((t=>{const n=t.findIndex((({id:t})=>t===e.id)),i=t.slice();if(-1!==n){r=t[n];const o=(0,s.ih)((0,s.ih)({},r),e);i[n]=o,l.set(e.id,o)}else i.push(e),l.set(e.id,e);return i})),()=>{t((t=>{if(!r)return n&&l.delete(e.id),t.filter((({id:t})=>t!==e.id));const i=t.findIndex((({id:t})=>t===e.id));if(-1===i)return t;const o=t.slice();return o[i]=r,l.set(e.id,r),o}))}},m=e=>g(e,(e=>p.setState("items",e)),!0);return(0,s.EZ)((0,s.ih)({},p),{registerItem:m,renderItem:e=>(0,i.tS)(m(e),g(e,(e=>h.setState("renderedItems",e)))),item:e=>{if(!e)return null;let t=l.get(e);if(!t){const{items:n}=p.getState();t=n.find((t=>t.id===e)),t&&l.set(e,t)}return t||null},__unstablePrivateStore:h})}var l=n(23478),c={id:null};function u(e,t){return e.find((e=>t?!e.disabled&&e.id!==t:!e.disabled))}function d(e,t){return e.filter((e=>e.rowId===t))}function h(e){const t=[];for(const n of e){const e=t.find((e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===n.rowId}));e?e.push(n):t.push([n])}return t}function p(e){let t=0;for(const{length:n}of e)n>t&&(t=n);return t}function f(e,t,n){const r=p(e);for(const i of e)for(let e=0;e<r;e+=1){const r=i[e];if(!r||n&&r.disabled){const r=0===e&&n?u(i):i[e-1];i[e]=r&&t!==r.id&&n?r:{id:"__EMPTY_ITEM__",disabled:!0,rowId:null==r?void 0:r.rowId}}}return e}function g(e){const t=h(e),n=p(t),r=[];for(let e=0;e<n;e+=1)for(const n of t){const t=n[e];t&&r.push((0,s.EZ)((0,s.ih)({},t),{rowId:t.rowId?`${e}`:void 0}))}return r}function m(e={}){var t;const n=null==(t=e.store)?void 0:t.getState(),o=a(e),p=(0,i.LS)(e.activeId,null==n?void 0:n.activeId,e.defaultActiveId),m=(0,s.EZ)((0,s.ih)({},o.getState()),{activeId:p,baseElement:(0,i.LS)(null==n?void 0:n.baseElement,null),includesBaseElement:(0,i.LS)(e.includesBaseElement,null==n?void 0:n.includesBaseElement,null===p),moves:(0,i.LS)(null==n?void 0:n.moves,0),orientation:(0,i.LS)(e.orientation,null==n?void 0:n.orientation,"both"),rtl:(0,i.LS)(e.rtl,null==n?void 0:n.rtl,!1),virtualFocus:(0,i.LS)(e.virtualFocus,null==n?void 0:n.virtualFocus,!1),focusLoop:(0,i.LS)(e.focusLoop,null==n?void 0:n.focusLoop,!1),focusWrap:(0,i.LS)(e.focusWrap,null==n?void 0:n.focusWrap,!1),focusShift:(0,i.LS)(e.focusShift,null==n?void 0:n.focusShift,!1)}),y=(0,r.MT)(m,o,e.store);(0,r.cY)(y,(()=>(0,r.Z_)(y,["renderedItems","activeId"],(e=>{y.setState("activeId",(t=>{var n;return void 0!==t?t:null==(n=u(e.renderedItems))?void 0:n.id}))}))));const v=(e,t,n,r)=>{var i,o;const{activeId:s,rtl:a,focusLoop:h,focusWrap:p,includesBaseElement:f}=y.getState(),g=a&&"vertical"!==t?(0,l.GP)(e):e;if(null==s)return null==(i=u(g))?void 0:i.id;const m=g.find((e=>e.id===s));if(!m)return null==(o=u(g))?void 0:o.id;const v=!!m.rowId,A=g.indexOf(m),b=g.slice(A+1),w=d(b,m.rowId);if(void 0!==r){const e=function(e,t){return e.filter((e=>t?!e.disabled&&e.id!==t:!e.disabled))}(w,s),t=e.slice(r)[0]||e[e.length-1];return null==t?void 0:t.id}const S=function(e){return"vertical"===e?"horizontal":"horizontal"===e?"vertical":void 0}(v?t||"horizontal":t),C=h&&h!==S,E=v&&p&&p!==S;if(n=n||!v&&C&&f,C){const e=function(e,t,n=!1){const r=e.findIndex((e=>e.id===t));return[...e.slice(r+1),...n?[c]:[],...e.slice(0,r)]}(E&&!n?g:d(g,m.rowId),s,n),t=u(e,s);return null==t?void 0:t.id}if(E){const e=u(n?w:b,s);return n?(null==e?void 0:e.id)||null:null==e?void 0:e.id}const I=u(w,s);return!I&&n?null:null==I?void 0:I.id};return(0,s.EZ)((0,s.ih)((0,s.ih)({},o),y),{setBaseElement:e=>y.setState("baseElement",e),setActiveId:e=>y.setState("activeId",e),move:e=>{void 0!==e&&(y.setState("activeId",e),y.setState("moves",(e=>e+1)))},first:()=>{var e;return null==(e=u(y.getState().renderedItems))?void 0:e.id},last:()=>{var e;return null==(e=u((0,l.GP)(y.getState().renderedItems)))?void 0:e.id},next:e=>{const{renderedItems:t,orientation:n}=y.getState();return v(t,n,!1,e)},previous:e=>{var t;const{renderedItems:n,orientation:r,includesBaseElement:i}=y.getState(),o=!(null==(t=u(n))?void 0:t.rowId)&&i;return v((0,l.GP)(n),r,o,e)},down:e=>{const{activeId:t,renderedItems:n,focusShift:r,focusLoop:i,includesBaseElement:o}=y.getState(),s=r&&!e,a=g((0,l.JH)(f(h(n),t,s)));return v(a,"vertical",i&&"horizontal"!==i&&o,e)},up:e=>{const{activeId:t,renderedItems:n,focusShift:r,includesBaseElement:i}=y.getState(),o=r&&!e,s=g((0,l.GP)((0,l.JH)(f(h(n),t,o))));return v(s,"vertical",i,e)}})}},10244:(e,t,n)=>{"use strict";n.d(t,{AU:()=>A,Av:()=>c,Jj:()=>s,Me:()=>o,Nq:()=>i,SK:()=>m,eS:()=>g,iK:()=>u,lQ:()=>y,oq:()=>f,pn:()=>p,r3:()=>l,vY:()=>a,wB:()=>h,wy:()=>v});var r,i="undefined"!=typeof window&&!!(null==(r=window.document)?void 0:r.createElement);function o(e){return e?e.ownerDocument||e:document}function s(e){return o(e).defaultView||window}function a(e,t=!1){const{activeElement:n}=o(e);if(!(null==n?void 0:n.nodeName))return null;if(c(n)&&n.contentDocument)return a(n.contentDocument.body,t);if(t){const e=n.getAttribute("aria-activedescendant");if(e){const t=o(n).getElementById(e);if(t)return t}}return n}function l(e,t){return e===t||e.contains(t)}function c(e){return"IFRAME"===e.tagName}function u(e){const t=e.tagName.toLowerCase();return"button"===t||!("input"!==t||!e.type)&&-1!==d.indexOf(e.type)}var d=["button","color","file","image","reset","submit"];function h(e,t){return"matches"in e?e.matches(t):"msMatchesSelector"in e?e.msMatchesSelector(t):e.webkitMatchesSelector(t)}function p(e){const t=e;return t.offsetWidth>0||t.offsetHeight>0||e.getClientRects().length>0}function f(e,t){if("closest"in e)return e.closest(t);do{if(h(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}function g(e){try{const t=e instanceof HTMLInputElement&&null!==e.selectionStart,n="TEXTAREA"===e.tagName;return t||n||!1}catch(e){return!1}}function m(e,t){const n=null==e?void 0:e.getAttribute("role");return n&&-1!==["dialog","menu","listbox","tree","grid"].indexOf(n)?n:t}function y(e,t){var n;const r=m(e);return r&&null!=(n={menu:"menuitem",listbox:"option",tree:"treeitem",grid:"gridcell"}[r])?n:t}function v(e){if(!e)return null;if(e.clientHeight&&e.scrollHeight>e.clientHeight){const{overflowY:t}=getComputedStyle(e);if("visible"!==t&&"hidden"!==t)return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){const{overflowX:t}=getComputedStyle(e);if("visible"!==t&&"hidden"!==t)return e}return v(e.parentElement)||document.scrollingElement||document.body}function A(e,...t){/text|search|password|tel|url/i.test(e.type)&&e.setSelectionRange(...t)}},81548:(e,t,n)=>{"use strict";n.d(t,{Bk:()=>f,CE:()=>c,EE:()=>g,Ei:()=>o,LS:()=>m,RR:()=>p,Ue:()=>l,ZT:()=>i,ei:()=>u,kG:()=>h,nr:()=>s,tS:()=>a,yR:()=>d});var r=n(40077);function i(...e){}function o(e,t){return function(e){return"function"==typeof e}(e)?e("function"==typeof t?t():t):e}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function a(...e){return(...t)=>{for(const n of e)"function"==typeof n&&n(...t)}}function l(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function c(e,t){const n=(0,r.ih)({},e);for(const e of t)s(n,e)&&delete n[e];return n}function u(e,t){const n={};for(const r of t)s(e,r)&&(n[r]=e[r]);return n}function d(e){return e}function h(e,t){if(!e){if("string"!=typeof t)throw new Error("Invariant failed");throw new Error(t)}}function p(e){return Object.keys(e)}function f(e,...t){const n="function"==typeof e?e(...t):e;return null!=n&&!n}function g(e){return e.disabled||!0===e["aria-disabled"]||"true"===e["aria-disabled"]}function m(...e){for(const t of e)if(void 0!==t)return t}},41410:(e,t,n)=>{"use strict";n.d(t,{e:()=>a});var r=n(30925),i=n(13277),o=n(81548),s=n(40077);function a(e={}){var t=e,{popover:n}=t,a=(0,s.S0)(t,["popover"]);const l=(0,i.yt)(a.store,(0,i.CE)(n,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"]));(0,i.Ny)(a,l);const c=null==l?void 0:l.getState(),u=(0,r.n)((0,s.EZ)((0,s.ih)({},a),{store:l})),d=(0,o.LS)(a.placement,null==c?void 0:c.placement,"bottom"),h=(0,s.EZ)((0,s.ih)({},u.getState()),{placement:d,currentPlacement:d,anchorElement:(0,o.LS)(null==c?void 0:c.anchorElement,null),popoverElement:(0,o.LS)(null==c?void 0:c.popoverElement,null),arrowElement:(0,o.LS)(null==c?void 0:c.arrowElement,null),rendered:Symbol("rendered")}),p=(0,i.MT)(h,u,l);return(0,s.EZ)((0,s.ih)((0,s.ih)({},u),p),{setAnchorElement:e=>p.setState("anchorElement",e),setPopoverElement:e=>p.setState("popoverElement",e),setArrowElement:e=>p.setState("arrowElement",e),render:()=>p.setState("rendered",Symbol("rendered"))})}},30925:(e,t,n)=>{"use strict";n.d(t,{n:()=>i});var r=n(17122);function i(e={}){return(0,r.X)(e)}},29052:(e,t,n)=>{"use strict";n.d(t,{G6:()=>s,V5:()=>l,b1:()=>i,mL:()=>o,vU:()=>a});var r=n(10244);function i(){return r.Nq&&!!navigator.maxTouchPoints}function o(){return!!r.Nq&&/mac|iphone|ipad|ipod/i.test(navigator.platform)}function s(){return r.Nq&&o()&&/apple/i.test(navigator.vendor)}function a(){return r.Nq&&/firefox\//i.test(navigator.userAgent)}function l(){return r.Nq&&navigator.platform.startsWith("Mac")&&!i()}},17122:(e,t,n)=>{"use strict";n.d(t,{X:()=>s});var r=n(13277),i=n(81548),o=n(40077);function s(e={}){const t=(0,r.yt)(e.store,(0,r.CE)(e.disclosure,["contentElement","disclosureElement"]));(0,r.Ny)(e,t);const n=null==t?void 0:t.getState(),s=(0,i.LS)(e.open,null==n?void 0:n.open,e.defaultOpen,!1),a=(0,i.LS)(e.animated,null==n?void 0:n.animated,!1),l={open:s,animated:a,animating:!!a&&s,mounted:s,contentElement:(0,i.LS)(null==n?void 0:n.contentElement,null),disclosureElement:(0,i.LS)(null==n?void 0:n.disclosureElement,null)},c=(0,r.MT)(l,t);return(0,r.cY)(c,(()=>(0,r.Z_)(c,["animated","animating"],(e=>{e.animated||c.setState("animating",!1)})))),(0,r.cY)(c,(()=>(0,r.Ld)(c,["open"],(()=>{c.getState().animated&&c.setState("animating",!0)})))),(0,r.cY)(c,(()=>(0,r.Z_)(c,["open","animating"],(e=>{c.setState("mounted",e.open||e.animating)})))),(0,o.EZ)((0,o.ih)({},c),{setOpen:e=>c.setState("open",e),show:()=>c.setState("open",!0),hide:()=>c.setState("open",!1),toggle:()=>c.setState("open",(e=>!e)),stopAnimation:()=>c.setState("animating",!1),setContentElement:e=>c.setState("contentElement",e),setDisclosureElement:e=>c.setState("disclosureElement",e)})}},97254:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(41410),i=n(13277),o=n(81548),s=n(40077);function a(e={}){var t;const n=null==(t=e.store)?void 0:t.getState(),a=(0,r.e)((0,s.EZ)((0,s.ih)({},e),{placement:(0,o.LS)(e.placement,null==n?void 0:n.placement,"bottom")})),l=(0,o.LS)(e.timeout,null==n?void 0:n.timeout,500),c=(0,s.EZ)((0,s.ih)({},a.getState()),{timeout:l,showTimeout:(0,o.LS)(e.showTimeout,null==n?void 0:n.showTimeout),hideTimeout:(0,o.LS)(e.hideTimeout,null==n?void 0:n.hideTimeout),autoFocusOnShow:(0,o.LS)(null==n?void 0:n.autoFocusOnShow,!1)}),u=(0,i.MT)(c,a,e.store);return(0,s.EZ)((0,s.ih)((0,s.ih)({},a),u),{setAutoFocusOnShow:e=>u.setState("autoFocusOnShow",e)})}},99224:(e,t,n)=>{"use strict";n.d(t,{Ke:()=>s,N:()=>f,Ud:()=>a,Vr:()=>d,XN:()=>c,iN:()=>m,lO:()=>p,nm:()=>h,qx:()=>g,sE:()=>u,wC:()=>l});var r=n(29052),i=n(10244),o=n(40077);function s(e){return Boolean(e.currentTarget&&!(0,i.r3)(e.currentTarget,e.target))}function a(e){return e.target===e.currentTarget}function l(e){const t=e.currentTarget;if(!t)return!1;const n=(0,r.mL)();if(n&&!e.metaKey)return!1;if(!n&&!e.ctrlKey)return!1;const i=t.tagName.toLowerCase();return"a"===i||"button"===i&&"submit"===t.type||"input"===i&&"submit"===t.type}function c(e){const t=e.currentTarget;if(!t)return!1;const n=t.tagName.toLowerCase();return!!e.altKey&&("a"===n||"button"===n&&"submit"===t.type||"input"===n&&"submit"===t.type)}function u(e,t){const n=new FocusEvent("blur",t),r=e.dispatchEvent(n),i=(0,o.EZ)((0,o.ih)({},t),{bubbles:!0});return e.dispatchEvent(new FocusEvent("focusout",i)),r}function d(e,t){const n=new FocusEvent("focus",t),r=e.dispatchEvent(n),i=(0,o.EZ)((0,o.ih)({},t),{bubbles:!0});return e.dispatchEvent(new FocusEvent("focusin",i)),r}function h(e,t,n){const r=new KeyboardEvent(t,n);return e.dispatchEvent(r)}function p(e,t){const n=new MouseEvent("click",t);return e.dispatchEvent(n)}function f(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!(0,i.r3)(n,r)}function g(e,t,n){const r=requestAnimationFrame((()=>{e.removeEventListener(t,i,!0),n()})),i=()=>{cancelAnimationFrame(r),n()};return e.addEventListener(t,i,{once:!0,capture:!0}),r}function m(e,t,n,r=window){const i=[];try{r.document.addEventListener(e,t,n);for(const o of Array.from(r.frames))i.push(m(e,t,n,o))}catch(e){}return()=>{try{r.document.removeEventListener(e,t,n)}catch(e){}i.forEach((e=>e()))}}},15212:(e,t,n)=>{"use strict";n.d(t,{B_:()=>f,EB:()=>s,H1:()=>p,MN:()=>y,PY:()=>A,Qw:()=>g,SI:()=>c,YC:()=>u,e8:()=>h,k0:()=>d,ss:()=>v});var r=n(10244),i=n(40077),o="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function s(e){return!!(0,r.wB)(e,o)&&!!(0,r.pn)(e)&&!(0,r.oq)(e,"[inert]")}function a(e){if(!s(e))return!1;if(function(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}(e))return!1;if(!("form"in e))return!0;if(!e.form)return!0;if(e.checked)return!0;if("radio"!==e.type)return!0;const t=e.form.elements.namedItem(e.name);if(!t)return!0;if(!("length"in t))return!0;const n=(0,r.vY)(e);return!n||n===e||!("form"in n)||n.form!==e.form||n.name!==e.name}function l(e,t){const n=Array.from(e.querySelectorAll(o));t&&n.unshift(e);const i=n.filter(s);return i.forEach(((e,t)=>{if((0,r.Av)(e)&&e.contentDocument){const n=e.contentDocument.body;i.splice(t,1,...l(n))}})),i}function c(e,t,n){const i=Array.from(e.querySelectorAll(o)),s=i.filter(a);return t&&a(e)&&s.unshift(e),s.forEach(((e,t)=>{if((0,r.Av)(e)&&e.contentDocument){const r=c(e.contentDocument.body,!1,n);s.splice(t,1,...r)}})),!s.length&&n?i:s}function u(e,t,n){const[r]=c(e,t,n);return r||null}function d(e,t){return function(e,t,n,i){const o=(0,r.vY)(e),s=l(e,!1),c=s.indexOf(o),u=s.slice(c+1);return u.find(a)||(n?s.find(a):null)||(i?u[0]:null)||null}(document.body,0,e,t)}function h(e,t){return function(e,t,n,i){const o=(0,r.vY)(e),s=l(e,!1).reverse(),c=s.indexOf(o),u=s.slice(c+1);return u.find(a)||(n?s.find(a):null)||(i?u[0]:null)||null}(document.body,0,e,t)}function p(e){const t=(0,r.vY)(e);if(!t)return!1;if(t===e)return!0;const n=t.getAttribute("aria-activedescendant");return!!n&&n===e.id}function f(e){const t=(0,r.vY)(e);if(!t)return!1;if((0,r.r3)(e,t))return!0;const n=t.getAttribute("aria-activedescendant");return!!n&&"id"in e&&(n===e.id||!!e.querySelector(`#${CSS.escape(n)}`))}function g(e){!f(e)&&s(e)&&e.focus()}function m(e){var t;const n=null!=(t=e.getAttribute("tabindex"))?t:"";e.setAttribute("data-tabindex",n),e.setAttribute("tabindex","-1")}function y(e,t){c(e,t).forEach(m)}function v(e){const t=e.querySelectorAll("[data-tabindex]"),n=e=>{const t=e.getAttribute("data-tabindex");e.removeAttribute("data-tabindex"),t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")};e.hasAttribute("data-tabindex")&&n(e),t.forEach(n)}function A(e,t){"scrollIntoView"in e?(e.focus({preventScroll:!0}),e.scrollIntoView((0,i.ih)({block:"nearest",inline:"nearest"},t))):e.focus()}},98296:(e,t,n)=>{"use strict";n.d(t,{E:()=>l});var r=n(74018),i=n(20656),o=n(45010),s=n(70604),a=(0,o.Bi)((e=>{var t=e,{store:n}=t,o=(0,s.S0)(t,["store"]);const a=(0,i.h9)();return n=n||a,(0,r.E)((0,s.ih)({store:n},o))})),l=(0,o.W5)((e=>{const t=a(e);return(0,o.az)("button",t)}))},83222:(e,t,n)=>{"use strict";n.d(t,{S:()=>ve});var r=n(56278),i=n(59412),o=n(45010),s=n(48104),a=n(70604),l=n(2784),c=n(81548);function u(e){return e.split("-")[1]}function d(e){return"y"===e?"height":"width"}function h(e){return e.split("-")[0]}function p(e){return["top","bottom"].includes(h(e))?"x":"y"}function f(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,s=r.y+r.height/2-i.height/2,a=p(t),l=d(a),c=r[l]/2-i[l]/2,f="x"===a;let g;switch(h(t)){case"top":g={x:o,y:r.y-i.height};break;case"bottom":g={x:o,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:s};break;case"left":g={x:r.x-i.width,y:s};break;default:g={x:r.x,y:r.y}}switch(u(t)){case"start":g[a]-=c*(n&&f?-1:1);break;case"end":g[a]+=c*(n&&f?-1:1)}return g}const g=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=f(c,r,l),h=r,p={},g=0;for(let n=0;n<a.length;n++){const{name:o,fn:m}=a[n],{x:y,y:v,data:A,reset:b}=await m({x:u,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=y?y:u,d=null!=v?v:d,p={...p,[o]:{...p[o],...A}},b&&g<=50&&(g++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:e,floating:t,strategy:i}):b.rects),({x:u,y:d}=f(c,h,l))),n=-1)}return{x:u,y:d,placement:h,strategy:i,middlewareData:p}};function m(e,t){return"function"==typeof e?e(t):e}function y(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function v(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function A(e,t){var n;void 0===t&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=m(t,e),f=y(p),g=a[h?"floating"===d?"reference":"floating":d],A=v(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(g)))||n?g:g.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),b="floating"===d?{...s.floating,x:r,y:i}:s.reference,w=await(null==o.getOffsetParent?void 0:o.getOffsetParent(a.floating)),S=await(null==o.isElement?void 0:o.isElement(w))&&await(null==o.getScale?void 0:o.getScale(w))||{x:1,y:1},C=v(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:b,offsetParent:w,strategy:l}):b);return{top:(A.top-C.top+f.top)/S.y,bottom:(C.bottom-A.bottom+f.bottom)/S.y,left:(A.left-C.left+f.left)/S.x,right:(C.right-A.right+f.right)/S.x}}const b=Math.min,w=Math.max;function S(e,t,n){return w(e,b(t,n))}const C=(["top","right","bottom","left"].reduce(((e,t)=>e.concat(t,t+"-start",t+"-end")),[]),{left:"right",right:"left",bottom:"top",top:"bottom"});function E(e){return e.replace(/left|right|bottom|top/g,(e=>C[e]))}function I(e,t,n){void 0===n&&(n=!1);const r=u(e),i=p(e),o=d(i);let s="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=E(s)),{main:s,cross:E(s)}}const _={start:"end",end:"start"};function x(e){return e.replace(/start|end/g,(e=>_[e]))}function P(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function k(e){return P(e).getComputedStyle(e)}function B(e){return e instanceof P(e).Node}function O(e){return B(e)?(e.nodeName||"").toLowerCase():"#document"}function N(e){return e instanceof HTMLElement||e instanceof P(e).HTMLElement}function D(e){return"undefined"!=typeof ShadowRoot&&(e instanceof P(e).ShadowRoot||e instanceof ShadowRoot)}function j(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=k(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function T(e){return["table","td","th"].includes(O(e))}function M(e){const t=F(),n=k(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function F(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function R(e){return["html","body","#document"].includes(O(e))}const L=Math.min,Q=Math.max,U=Math.round,V=Math.floor,K=e=>({x:e,y:e});function H(e){const t=k(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=N(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=U(n)!==o||U(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function G(e){return e instanceof Element||e instanceof P(e).Element}function Y(e){return G(e)?e:e.contextElement}function z(e){const t=Y(e);if(!N(t))return K(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=H(t);let s=(o?U(n.width):n.width)/r,a=(o?U(n.height):n.height)/i;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const Z=K(0);function W(e){const t=P(e);return F()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Z}function q(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const i=e.getBoundingClientRect(),o=Y(e);let s=K(1);t&&(r?G(r)&&(s=z(r)):s=z(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==P(e))&&t}(o,n,r)?W(o):K(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,d=i.height/s.y;if(o){const e=P(o),t=r&&G(r)?P(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=z(n),t=n.getBoundingClientRect(),r=getComputedStyle(n),i=t.left+(n.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(n.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=o,n=P(n).frameElement}}return v({width:u,height:d,x:l,y:c})}function J(e){return G(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function X(e){var t;return null==(t=(B(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function $(e){return q(X(e)).left+J(e).scrollLeft}function ee(e){if("html"===O(e))return e;const t=e.assignedSlot||e.parentNode||D(e)&&e.host||X(e);return D(t)?t.host:t}function te(e){const t=ee(e);return R(t)?e.ownerDocument?e.ownerDocument.body:e.body:N(t)&&j(t)?t:te(t)}function ne(e,t){var n;void 0===t&&(t=[]);const r=te(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=P(r);return i?t.concat(o,o.visualViewport||[],j(r)?r:[]):t.concat(r,ne(r))}function re(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=P(e),r=X(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const e=F();(!e||e&&"fixed"===t)&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=X(e),n=J(e),r=e.ownerDocument.body,i=Q(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Q(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+$(e);const a=-n.scrollTop;return"rtl"===k(r).direction&&(s+=Q(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}(X(e));else if(G(t))r=function(e,t){const n=q(e,!0,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=N(e)?z(e):K(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:i*o.x,y:r*o.y}}(t,n);else{const n=W(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return v(r)}function ie(e,t){const n=ee(e);return!(n===t||!G(n)||R(n))&&("fixed"===k(n).position||ie(n,t))}function oe(e,t,n){const r=N(t),i=X(t),o="fixed"===n,s=q(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=K(0);if(r||!r&&!o)if(("body"!==O(t)||j(i))&&(a=J(t)),N(t)){const e=q(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else i&&(l.x=$(i));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function se(e,t){return N(e)&&"fixed"!==k(e).position?t?t(e):e.offsetParent:null}function ae(e,t){const n=P(e);if(!N(e))return n;let r=se(e,t);for(;r&&T(r)&&"static"===k(r).position;)r=se(r,t);return r&&("html"===O(r)||"body"===O(r)&&"static"===k(r).position&&!M(r))?n:r||function(e){let t=ee(e);for(;N(t)&&!R(t);){if(M(t))return t;t=ee(t)}return null}(e)||n}const le={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=N(n),o=X(n);if(n===o)return t;let s={scrollLeft:0,scrollTop:0},a=K(1);const l=K(0);if((i||!i&&"fixed"!==r)&&(("body"!==O(n)||j(o))&&(s=J(n)),N(n))){const e=q(n);a=z(n),l.x=e.x+n.clientLeft,l.y=e.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+l.x,y:t.y*a.y-s.scrollTop*a.y+l.y}},getDocumentElement:X,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[..."clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=ne(e).filter((e=>G(e)&&"body"!==O(e))),i=null;const o="fixed"===k(e).position;let s=o?ee(e):e;for(;G(s)&&!R(s);){const t=k(s),n=M(s);n||"fixed"!==t.position||(i=null),(o?!n&&!i:!n&&"static"===t.position&&i&&["absolute","fixed"].includes(i.position)||j(s)&&!n&&ie(e,s))?r=r.filter((e=>e!==s)):i=t,s=ee(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=o[0],a=o.reduce(((e,n)=>{const r=re(t,n,i);return e.top=Q(r.top,e.top),e.right=L(r.right,e.right),e.bottom=L(r.bottom,e.bottom),e.left=Q(r.left,e.left),e}),re(t,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:ae,getElementRects:async function(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||ae,o=this.getDimensions;return{reference:oe(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){return H(e)},getScale:z,isElement:G,isRTL:function(e){return"rtl"===getComputedStyle(e).direction}};var ce=n(52322);function ue(e=0,t=0,n=0,r=0){if("function"==typeof DOMRect)return new DOMRect(e,t,n,r);const i={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return(0,a.EZ)((0,a.ih)({},i),{toJSON:()=>i})}function de(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}function he(e){const t=window.devicePixelRatio||1;return Math.round(e*t)/t}function pe(e,t){return function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await async function(e,t){const{placement:n,platform:r,elements:i}=e,o=await(null==r.isRTL?void 0:r.isRTL(i.floating)),s=h(n),a=u(n),l="x"===p(n),c=["left","top"].includes(s)?-1:1,d=o&&l?-1:1,f=m(t,e);let{mainAxis:g,crossAxis:y,alignmentAxis:v}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&"number"==typeof v&&(y="end"===a?-1*v:v),l?{x:y*d,y:g*c}:{x:g*c,y:y*d}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}}((({placement:n})=>{var r;const i=((null==e?void 0:e.clientHeight)||0)/2,o="number"==typeof t.gutter?t.gutter+i:null!=(r=t.gutter)?r:i;return{crossAxis:n.split("-")[1]?void 0:t.shift,mainAxis:o,alignmentAxis:t.shift}}))}function fe(e){if(!1===e.flip)return;const t="string"==typeof e.flip?e.flip.split(" "):void 0;return(0,c.kG)(!t||t.every(de),!1),function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:s,platform:a,elements:l}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...v}=m(e,t),b=h(r),w=h(s)===s,S=await(null==a.isRTL?void 0:a.isRTL(l.floating)),C=p||(w||!y?[E(s)]:function(e){const t=E(e);return[x(e),t,x(t)]}(s));p||"none"===g||C.push(...function(e,t,n,r){const i=u(e);let o=function(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:s;default:return[]}}(h(e),"start"===n,r);return i&&(o=o.map((e=>e+"-"+i)),t&&(o=o.concat(o.map(x)))),o}(s,y,g,S));const _=[s,...C],P=await A(t,v),k=[];let B=(null==(n=i.flip)?void 0:n.overflows)||[];if(c&&k.push(P[b]),d){const{main:e,cross:t}=I(r,o,S);k.push(P[e],P[t])}if(B=[...B,{placement:r,overflows:k}],!k.every((e=>e<=0))){var O,N;const e=((null==(O=i.flip)?void 0:O.index)||0)+1,t=_[e];if(t)return{data:{index:e,overflows:B},reset:{placement:t}};let n=null==(N=B.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:N.placement;if(!n)switch(f){case"bestFit":{var D;const e=null==(D=B.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:D[0];e&&(n=e);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}}({padding:e.overflowPadding,fallbackPlacements:t})}function ge(e){if(e.slide||e.overlap)return function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=m(e,t),c={x:n,y:r},u=await A(t,l),d=p(h(i)),f=function(e){return"x"===e?"y":"x"}(d);let g=c[d],y=c[f];if(o){const e="y"===d?"bottom":"right";g=S(g+u["y"===d?"top":"left"],g,g-u[e])}if(s){const e="y"===f?"bottom":"right";y=S(y+u["y"===f?"top":"left"],y,y-u[e])}const v=a.fn({...t,[d]:g,[f]:y});return{...v,data:{x:v.x-n,y:v.y-r}}}}}({mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding})}function me(e){return function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:o}=t,{apply:s=(()=>{}),...a}=m(e,t),l=await A(t,a),c=h(n),d=u(n),f="x"===p(n),{width:g,height:y}=r.floating;let v,S;"top"===c||"bottom"===c?(v=c,S=d===(await(null==i.isRTL?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(S=c,v="end"===d?"top":"bottom");const C=y-l[v],E=g-l[S],I=!t.middlewareData.shift;let _=C,x=E;if(f){const e=g-l.left-l.right;x=d||I?b(E,e):e}else{const e=y-l.top-l.bottom;_=d||I?b(C,e):e}if(I&&!d){const e=w(l.left,0),t=w(l.right,0),n=w(l.top,0),r=w(l.bottom,0);f?x=g-2*(0!==e||0!==t?e+t:w(l.left,l.right)):_=y-2*(0!==n||0!==r?n+r:w(l.top,l.bottom))}await s({...t,availableWidth:x,availableHeight:_});const P=await i.getDimensions(o.floating);return g!==P.width||y!==P.height?{reset:{rects:!0}}:{}}}}({padding:e.overflowPadding,apply({elements:t,availableWidth:n,availableHeight:r,rects:i}){const o=t.floating,s=Math.round(i.reference.width);n=Math.floor(n),r=Math.floor(r),o.style.setProperty("--popover-anchor-width",`${s}px`),o.style.setProperty("--popover-available-width",`${n}px`),o.style.setProperty("--popover-available-height",`${r}px`),e.sameWidth&&(o.style.width=`${s}px`),e.fitViewport&&(o.style.maxWidth=`${n}px`,o.style.maxHeight=`${r}px`)}})}function ye(e,t){if(e)return(e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a}=t,{element:l,padding:c=0}=m(e,t)||{};if(null==l)return{};const h=y(c),f={x:n,y:r},g=p(i),v=d(g),A=await s.getDimensions(l),w="y"===g,C=w?"top":"left",E=w?"bottom":"right",I=w?"clientHeight":"clientWidth",_=o.reference[v]+o.reference[g]-f[g]-o.floating[v],x=f[g]-o.reference[g],P=await(null==s.getOffsetParent?void 0:s.getOffsetParent(l));let k=P?P[I]:0;k&&await(null==s.isElement?void 0:s.isElement(P))||(k=a.floating[I]||o.floating[v]);const B=_/2-x/2,O=k/2-A[v]/2-1,N=b(h[C],O),D=b(h[E],O),j=N,T=k-A[v]-D,M=k/2-A[v]/2+B,F=S(j,M,T),R=null!=u(i)&&M!=F&&o.reference[v]/2-(M<j?N:D)-A[v]/2<0?M<j?j-M:T-M:0;return{[g]:f[g]-R,data:{[g]:F,centerOffset:M-F+R}}}}))({element:e,padding:t.arrowPadding})}var ve=(0,o.Bi)((e=>{var t=e,{store:n,modal:o=!1,portal:u=!!o,preserveTabOrder:d=!0,autoFocusOnShow:h=!0,wrapperProps:p,fixed:f=!1,flip:m=!0,shift:y=0,slide:v=!0,overlap:A=!1,sameWidth:b=!1,fitViewport:w=!1,gutter:S,arrowPadding:C=4,overflowPadding:E=8,getAnchorRect:I,updatePosition:_}=t,x=(0,a.S0)(t,["store","modal","portal","preserveTabOrder","autoFocusOnShow","wrapperProps","fixed","flip","shift","slide","overlap","sameWidth","fitViewport","gutter","arrowPadding","overflowPadding","getAnchorRect","updatePosition"]);const P=(0,i.yL)();n=n||P,(0,c.kG)(n,!1);const k=n.useState("arrowElement"),B=n.useState("anchorElement"),O=n.useState("disclosureElement"),N=n.useState("popoverElement"),D=n.useState("contentElement"),j=n.useState("placement"),T=n.useState("mounted"),M=n.useState("rendered"),[F,R]=(0,l.useState)(!1),{portalRef:U,domReady:K}=(0,s.Hw)(u,x.portalRef),H=(0,s.zX)(I),G=(0,s.zX)(_),z=!!_;(0,s.Gw)((()=>{if(!(null==N?void 0:N.isConnected))return;N.style.setProperty("--popover-overflow-padding",`${E}px`);const e=function(e,t){return{contextElement:e||void 0,getBoundingClientRect:()=>{const n=e,r=null==t?void 0:t(n);return r||!n?function(e){if(!e)return ue();const{x:t,y:n,width:r,height:i}=e;return ue(t,n,r,i)}(r):n.getBoundingClientRect()}}}(B,H),t=async()=>{if(!T)return;const t=[pe(k,{gutter:S,shift:y}),fe({flip:m,overflowPadding:E}),ge({slide:v,overlap:A,overflowPadding:E}),ye(k,{arrowPadding:C}),me({sameWidth:b,fitViewport:w,overflowPadding:E})],r=await((e,t,n)=>{const r=new Map,i={platform:le,...n},o={...i.platform,_c:r};return g(e,t,{...i,platform:o})})(e,N,{placement:j,strategy:f?"fixed":"absolute",middleware:t});null==n||n.setState("currentPlacement",r.placement),R(!0);const i=he(r.x),o=he(r.y);if(Object.assign(N.style,{top:"0",left:"0",transform:`translate3d(${i}px,${o}px,0)`}),k&&r.middlewareData.arrow){const{x:e,y:t}=r.middlewareData.arrow,n=r.placement.split("-")[0];Object.assign(k.style,{left:null!=e?`${e}px`:"",top:null!=t?`${t}px`:"",[n]:"100%"})}},r=function(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=Y(e),u=i||o?[...c?ne(c):[],...ne(t)]:[];u.forEach((e=>{i&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const i=X(e);function o(){clearTimeout(n),r&&r.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),o();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const p={rootMargin:-V(u)+"px "+-V(i.clientWidth-(c+d))+"px "+-V(i.clientHeight-(u+h))+"px "+-V(c)+"px",threshold:Q(0,L(1,l))||1};let f=!0;function g(e){const t=e[0].intersectionRatio;if(t!==l){if(!f)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),100)}f=!1}try{r=new IntersectionObserver(g,{...p,root:i.ownerDocument})}catch(e){r=new IntersectionObserver(g,p)}r.observe(e)}(!0),o}(c,n):null;let h,p=-1,f=null;s&&(f=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{f&&f.observe(t)}))),n()})),c&&!l&&f.observe(c),f.observe(t));let g=l?q(e):null;return l&&function t(){const r=q(e);!g||r.x===g.x&&r.y===g.y&&r.width===g.width&&r.height===g.height||n(),g=r,h=requestAnimationFrame(t)}(),n(),()=>{u.forEach((e=>{i&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)})),d&&d(),f&&f.disconnect(),f=null,l&&cancelAnimationFrame(h)}}(e,N,(async()=>{z?(await G({updatePosition:t}),R(!0)):await t()}),{elementResize:"function"==typeof ResizeObserver});return()=>{R(!1),r()}}),[n,M,N,k,B,N,j,T,K,f,m,y,v,A,b,w,S,C,E,H,z,G]),(0,s.Gw)((()=>{if(!T)return;if(!K)return;if(!(null==N?void 0:N.isConnected))return;if(!(null==D?void 0:D.isConnected))return;const e=()=>{N.style.zIndex=getComputedStyle(D).zIndex};e();let t=requestAnimationFrame((()=>{t=requestAnimationFrame(e)}));return()=>cancelAnimationFrame(t)}),[T,K,N,D]);const Z=f?"fixed":"absolute";return x=(0,s.OJ)(x,(e=>(0,ce.jsx)("div",(0,a.EZ)((0,a.ih)({role:"presentation"},p),{style:(0,a.ih)({position:Z,top:0,left:0,width:"max-content"},null==p?void 0:p.style),ref:null==n?void 0:n.setPopoverElement,children:e}))),[n,Z,p]),x=(0,s.OJ)(x,(e=>(0,ce.jsx)(i.ZQ,{value:n,children:e})),[n]),x=(0,a.EZ)((0,a.ih)({"data-placing":F?void 0:""},x),{style:(0,a.ih)({position:"relative"},x.style)}),(0,r.Rh)((0,a.EZ)((0,a.ih)({store:n,modal:o,portal:u,preserveTabOrder:d,preserveTabOrderAnchor:O||B,autoFocusOnShow:F&&h},x),{portalRef:U}))}));(0,r.L5)((0,o.LM)((e=>{const t=ve(e);return(0,o.az)("div",t)})),i.yL)},45010:(e,t,n)=>{"use strict";n.d(t,{Bi:()=>h,LM:()=>c,W5:()=>u,az:()=>d,re:()=>p});var r=n(48104),i=n(43198),o=n(70604),s=n(2784),a=n(81548),l=n(52322);function c(e){return s.forwardRef(((t,n)=>e((0,o.ih)({ref:n},t))))}function u(e){const t=c(e);return s.memo(t)}function d(e,t){const n=t,{as:a,wrapElement:c,render:u}=n,d=(0,o.S0)(n,["as","wrapElement","render"]);let h;const p=(0,r.qq)(t.ref,(0,i.Yx)(u));if(a&&"string"!=typeof a)h=(0,l.jsx)(a,(0,o.EZ)((0,o.ih)({},d),{render:u}));else if(s.isValidElement(u)){const e=(0,o.EZ)((0,o.ih)({},u.props),{ref:p});h=s.cloneElement(u,(0,i.dG)(d,e))}else if(u)h=u(d);else if("function"==typeof t.children){const e=d,{children:n}=e,r=(0,o.S0)(e,["children"]);h=t.children(r)}else h=a?(0,l.jsx)(a,(0,o.ih)({},d)):(0,l.jsx)(e,(0,o.ih)({},d));return c?c(h):h}function h(e){return(t={})=>{const n=e(t),r={};for(const e in n)(0,a.nr)(n,e)&&void 0!==n[e]&&(r[e]=n[e]);return r}}function p(e=[],t=[]){const n=s.createContext(void 0),r=s.createContext(void 0),i=()=>s.useContext(n),a=t=>e.reduceRight(((e,n)=>(0,l.jsx)(n,(0,o.EZ)((0,o.ih)({},t),{children:e}))),(0,l.jsx)(n.Provider,(0,o.ih)({},t)));return{context:n,scopedContext:r,useContext:i,useScopedContext:(e=!1)=>{const t=s.useContext(r),n=i();return e?t:t||n},useProviderContext:()=>{const e=s.useContext(r),t=i();if(!e||e!==t)return t},ContextProvider:a,ScopedContextProvider:e=>(0,l.jsx)(a,(0,o.EZ)((0,o.ih)({},e),{children:t.reduceRight(((t,n)=>(0,l.jsx)(n,(0,o.EZ)((0,o.ih)({},e),{children:t}))),(0,l.jsx)(r.Provider,(0,o.ih)({},e)))}))}}},6236:(e,t,n)=>{"use strict";n.d(t,{Kw:()=>d,XS:()=>h,oR:()=>p});var r=n(48104),i=n(70604),o=n(2784),s=n(81548),a=n(13277),l=n(43100),{useSyncExternalStore:c}=l,u=()=>()=>{};function d(e,t=s.yR){const n=o.useCallback((t=>e?(0,a.Ld)(e,null,t):u()),[e]),r=()=>{const n="string"==typeof t?t:null,r="function"==typeof t?t:null,i=null==e?void 0:e.getState();return r?r(i):i&&n&&(0,s.nr)(i,n)?i[n]:void 0};return c(n,r,r)}function h(e,t,n,i){const l=(0,s.nr)(t,n)?t[n]:void 0,c=i?t[i]:void 0,u=(0,r.cP)({value:l,setValue:c}),d=o.useRef(!0);(0,r.Gw)((()=>(0,a.Z_)(e,[n],((e,t)=>{const{value:r,setValue:i}=u.current;i&&e[n]!==t[n]&&e[n]!==r&&(d.current=!1,i(e[n]))}))),[e,n]),(0,r.Gw)((()=>{if(void 0!==l)return d.current=!0,e.setState(n,l),(0,a.dC)(e,[n],(()=>{void 0!==l&&d.current&&e.setState(n,l)}))}))}function p(e,t){const[n,s]=o.useState((()=>e(t)));(0,r.Gw)((()=>(0,a.S1)(n)),[n]);const l=o.useCallback((e=>d(n,e)),[n]);return[o.useMemo((()=>(0,i.EZ)((0,i.ih)({},n),{useState:l})),[n,l]),(0,r.zX)((()=>{s((n=>e((0,i.ih)((0,i.ih)({},t),n.getState()))))}))]}},70604:(e,t,n)=>{"use strict";n.d(t,{EZ:()=>d,S0:()=>h,ih:()=>u});var r=Object.defineProperty,i=Object.defineProperties,o=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,c=(e,t,n)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,u=(e,t)=>{for(var n in t||(t={}))a.call(t,n)&&c(e,n,t[n]);if(s)for(var n of s(t))l.call(t,n)&&c(e,n,t[n]);return e},d=(e,t)=>i(e,o(t)),h=(e,t)=>{var n={};for(var r in e)a.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&s)for(var r of s(e))t.indexOf(r)<0&&l.call(e,r)&&(n[r]=e[r]);return n}},75235:(e,t,n)=>{"use strict";n.d(t,{L3:()=>o,MI:()=>s,dI:()=>i});var r=(0,n(45010).re)(),i=r.useContext,o=(r.useScopedContext,r.useProviderContext,r.ContextProvider),s=r.ScopedContextProvider},9460:(e,t,n)=>{"use strict";n.d(t,{EB:()=>c,TG:()=>l,bq:()=>h,ht:()=>u,jC:()=>d});var r=n(9587),i=n(59412),o=n(45010),s=n(2784),a=(0,o.re)([i.qo,r.Lq],[i.ZQ,r.al]),l=a.useContext,c=a.useScopedContext,u=a.useProviderContext,d=(a.ContextProvider,a.ScopedContextProvider),h=(0,s.createContext)(!1)},57189:(e,t,n)=>{"use strict";n.d(t,{X:()=>y});var r=n(45010),i=(0,r.re)(),o=i.useContext,s=(i.useScopedContext,i.useProviderContext,i.ContextProvider,i.ScopedContextProvider,n(2784)),a=(0,s.createContext)(!1),l=n(13271),c=n(6236),u=n(48104),d=n(70604),h=n(81548),p=n(52322);function f(e,t){t?e.indeterminate=!0:e.indeterminate&&(e.indeterminate=!1)}function g(e){return Array.isArray(e)?e.toString():e}var m=(0,r.Bi)((e=>{var t=e,{store:n,name:r,value:i,checked:m,defaultChecked:y}=t,v=(0,d.S0)(t,["store","name","value","checked","defaultChecked"]);const A=o();n=n||A;const[b,w]=(0,s.useState)(null!=y&&y),S=(0,c.Kw)(n,(e=>{if(void 0!==m)return m;if(void 0===(null==e?void 0:e.value))return b;if(null!=i){if(Array.isArray(e.value)){const t=g(i);return e.value.includes(t)}return e.value===i}return!Array.isArray(e.value)&&"boolean"==typeof e.value&&e.value})),C=(0,s.useRef)(null),E=(B=(0,u.O)(C,v.as||"input"),O=v.type,"input"===B&&(!O||"checkbox"===O)),I=S?"mixed"===S:void 0,_="mixed"!==S&&S,x=(0,h.EE)(v),[P,k]=(0,u.NW)();var B,O;(0,s.useEffect)((()=>{const e=C.current;e&&(f(e,I),E||(e.checked=_,void 0!==r&&(e.name=r),void 0!==i&&(e.value=`${i}`)))}),[P,I,E,_,r,i]);const N=v.onChange,D=(0,u.zX)((e=>{if(x)return e.stopPropagation(),void e.preventDefault();if(f(e.currentTarget,I),E||(e.currentTarget.checked=!e.currentTarget.checked,k()),null==N||N(e),e.defaultPrevented)return;const t=e.currentTarget.checked;w(t),null==n||n.setValue((e=>{if(null==i)return t;const n=g(i);return Array.isArray(e)?t?e.includes(n)?e:[...e,n]:e.filter((e=>e!==n)):e!==n&&n}))})),j=v.onClick,T=(0,u.zX)((e=>{null==j||j(e),e.defaultPrevented||E||D(e)}));return v=(0,u.OJ)(v,(e=>(0,p.jsx)(a.Provider,{value:_,children:e})),[_]),v=(0,d.EZ)((0,d.ih)({role:E?void 0:"checkbox",type:E?"checkbox":void 0,"aria-checked":S},v),{ref:(0,u.qq)(C,v.ref),onChange:D,onClick:T}),v=(0,l.Y)((0,d.ih)({clickOnEnter:!E},v)),(0,d.ih)({name:E?r:void 0,value:E?i:void 0,checked:_},v)})),y=(0,r.LM)((e=>{const t=m(e);return(0,r.az)("input",t)}))},48104:(e,t,n)=>{"use strict";var r;n.d(t,{Gw:()=>h,Hw:()=>E,Me:()=>m,NW:()=>w,O:()=>y,OJ:()=>C,XJ:()=>I,cP:()=>p,is:()=>b,m1:()=>_,qq:()=>g,rf:()=>A,vv:()=>v,yl:()=>S,zX:()=>f});var i=n(43198),o=n(70604),s=n(2784),a=n(10244),l=n(99224),c=(0,o.ih)({},r||(r=n.t(s,2))),u=c.useId,d=(c.useDeferredValue,c.useInsertionEffect),h=a.Nq?s.useLayoutEffect:s.useEffect;function p(e){const t=(0,s.useRef)(e);return h((()=>{t.current=e})),t}function f(e){const t=(0,s.useRef)((()=>{throw new Error("Cannot call an event handler while rendering.")}));return d?d((()=>{t.current=e})):t.current=e,(0,s.useCallback)(((...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)}),[])}function g(...e){return(0,s.useMemo)((()=>{if(e.some(Boolean))return t=>{e.forEach((e=>(0,i.k$)(e,t)))}}),e)}function m(e){if(u){const t=u();return e||t}const[t,n]=(0,s.useState)(e);return h((()=>{if(e||t)return;const r=Math.random().toString(36).substr(2,6);n(`id-${r}`)}),[e,t]),e||t}function y(e,t){const n=e=>{if("string"==typeof e)return e},[r,i]=(0,s.useState)((()=>n(t)));return h((()=>{const r=e&&"current"in e?e.current:e;i((null==r?void 0:r.tagName.toLowerCase())||n(t))}),[e,t]),r}function v(e,t,n){const[r,i]=(0,s.useState)(n);return h((()=>{const n=e&&"current"in e?e.current:e,r=null==n?void 0:n.getAttribute(t);null!=r&&i(r)}),[e,t]),r}function A(e,t){const n=(0,s.useRef)(!1);(0,s.useEffect)((()=>{if(n.current)return e();n.current=!0}),t),(0,s.useEffect)((()=>()=>{n.current=!1}),[])}function b(e,t){const n=(0,s.useRef)(!1);h((()=>{if(n.current)return e();n.current=!0}),t),h((()=>()=>{n.current=!1}),[])}function w(){return(0,s.useReducer)((()=>[]),[])}function S(e){return f("function"==typeof e?e:()=>e)}function C(e,t,n=[]){const r=(0,s.useCallback)((n=>(e.wrapElement&&(n=e.wrapElement(n)),t(n))),[...n,e.wrapElement]);return(0,o.EZ)((0,o.ih)({},e),{wrapElement:r})}function E(e=!1,t){const[n,r]=(0,s.useState)(null);return{portalRef:g(r,t),portalNode:n,domReady:!e||n}}function I(e,t,n){const r=e.onLoadedMetadataCapture,i=(0,s.useMemo)((()=>Object.assign((()=>{}),(0,o.EZ)((0,o.ih)({},r),{[t]:n}))),[r,t,n]);return[null==r?void 0:r[t],{onLoadedMetadataCapture:i}]}function _(){return(0,s.useEffect)((()=>{(0,l.iN)("mousemove",B,!0),(0,l.iN)("mousedown",O,!0),(0,l.iN)("mouseup",O,!0),(0,l.iN)("keydown",O,!0),(0,l.iN)("scroll",O,!0)}),[]),f((()=>x))}Symbol("setNextState");var x=!1,P=0,k=0;function B(e){(function(e){const t=e.movementX||e.screenX-P,n=e.movementY||e.screenY-k;return P=e.screenX,k=e.screenY,t||n||!1})(e)&&(x=!0)}function O(){x=!1}},79225:(e,t,n)=>{"use strict";n.d(t,{$3:()=>i,D2:()=>s,Gh:()=>d,JW:()=>u,al:()=>a,tt:()=>c,zS:()=>o});var r={id:null};function i(e,t,n=!1){const i=e.findIndex((e=>e.id===t));return[...e.slice(i+1),...n?[r]:[],...e.slice(0,i)]}function o(e,t){return e.find((e=>t?!e.disabled&&e.id!==t:!e.disabled))}function s(e,t){return t&&e.item(t)||null}function a(e){const t=[];for(const n of e){const e=t.find((e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===n.rowId}));e?e.push(n):t.push([n])}return t}var l=Symbol("FOCUS_SILENTLY");function c(e){e[l]=!0,e.focus()}function u(e){const t=e[l];return delete e[l],t}function d(e,t,n){if(!t)return!1;if(t===n)return!1;const r=e.item(t.id);return!(!r||n&&r.element===n)}},72455:(e,t,n)=>{"use strict";n.d(t,{I:()=>a,l:()=>s});var r=n(22457),i=n(6236),o=n(30925);function s(e,t,n){return(0,r.n)(e,t,n)}function a(e={}){const[t,n]=(0,i.oR)(o.n,e);return s(t,n,e)}},59412:(e,t,n)=>{"use strict";n.d(t,{ZQ:()=>l,lp:()=>o,qo:()=>a,yL:()=>s});var r=n(58915),i=(0,n(45010).re)([r.re],[r.Q9]),o=i.useContext,s=(i.useScopedContext,i.useProviderContext),a=i.ContextProvider,l=i.ScopedContextProvider},89723:(e,t,n)=>{"use strict";n.d(t,{S:()=>d,w:()=>h});var r=n(19922),i=n(43670),o=n(45010),s=n(48104),a=n(70604),l=n(2784),c=n(99224),u=n(81548),d=(0,o.Bi)((e=>{var t=e,{store:n,showOnHover:o=!0}=t,d=(0,a.S0)(t,["store","showOnHover"]);const h=(0,r.P9)();n=n||h,(0,u.kG)(n,!1);const p=(0,u.EE)(d),f=(0,l.useRef)(0);(0,l.useEffect)((()=>()=>window.clearTimeout(f.current)),[]),(0,l.useEffect)((()=>(0,c.iN)("mouseleave",(e=>{if(!n)return;const{anchorElement:t}=n.getState();t&&e.target===t&&(window.clearTimeout(f.current),f.current=0)}),!0)),[n]);const g=d.onMouseMove,m=(0,s.yl)(o),y=(0,s.m1)(),v=(0,s.zX)((e=>{if(null==g||g(e),p)return;if(!n)return;if(e.defaultPrevented)return;if(f.current)return;if(!y())return;if(!m(e))return;const t=e.currentTarget;n.setAnchorElement(t),n.setDisclosureElement(t);const{showTimeout:r,timeout:i}=n.getState(),o=()=>{f.current=0,y()&&(null==n||n.setAnchorElement(t),null==n||n.show(),queueMicrotask((()=>{null==n||n.setDisclosureElement(t)})))},s=null!=r?r:i;0===s?o():f.current=window.setTimeout(o,s)})),A=(0,l.useCallback)((e=>{if(!n)return;const{anchorElement:t}=n.getState();(null==t?void 0:t.isConnected)||n.setAnchorElement(e)}),[n]);return d=(0,a.EZ)((0,a.ih)({},d),{ref:(0,s.qq)(A,d.ref),onMouseMove:v}),(0,i.k)(d)})),h=(0,o.LM)((e=>{const t=d(e);return(0,o.az)("a",t)}))},12216:(e,t,n)=>{"use strict";n.d(t,{M:()=>s,z:()=>a});var r=n(93892),i=n(6236),o=n(97254);function s(e,t,n){return e=(0,r.k)(e,t,n),(0,i.XS)(e,n,"timeout"),(0,i.XS)(e,n,"showTimeout"),(0,i.XS)(e,n,"hideTimeout"),e}function a(e={}){const[t,n]=(0,i.oR)(o.A,e);return s(t,n,e)}},46462:(e,t,n)=>{"use strict";n.d(t,{b:()=>o});var r=n(6236),i=n(48104);function o(e,t,n){return e=function(e,t,n){return(0,i.rf)(t,[n.store]),(0,r.XS)(e,n,"items","setItems"),e}(e,t,n),(0,r.XS)(e,n,"activeId","setActiveId"),(0,r.XS)(e,n,"includesBaseElement"),(0,r.XS)(e,n,"virtualFocus"),(0,r.XS)(e,n,"orientation"),(0,r.XS)(e,n,"rtl"),(0,r.XS)(e,n,"focusLoop"),(0,r.XS)(e,n,"focusWrap"),(0,r.XS)(e,n,"focusShift"),e}},96332:(e,t,n)=>{"use strict";n.d(t,{S:()=>o,T:()=>s});var r=n(45010),i=n(70604),o=(0,r.Bi)((e=>(0,i.EZ)((0,i.ih)({},e),{style:(0,i.ih)({border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},e.style)}))),s=(0,r.LM)((e=>{const t=o(e);return(0,r.az)("span",t)}))},89776:(e,t,n)=>{"use strict";n.d(t,{p:()=>f,q:()=>p});var r=n(13271),i=n(45010),o=n(48104),s=n(70604),a=n(2784),l=n(10244),c=(0,i.Bi)((e=>{const t=(0,a.useRef)(null),n=(0,o.O)(t,e.as||"button"),[i,c]=(0,a.useState)((()=>!!n&&(0,l.iK)({tagName:n,type:e.type})));return(0,a.useEffect)((()=>{t.current&&c((0,l.iK)(t.current))}),[]),e=(0,s.EZ)((0,s.ih)({role:i||"a"===n?void 0:"button"},e),{ref:(0,o.qq)(t,e.ref)}),e=(0,r.Y)(e)}));(0,i.LM)((e=>{const t=c(e);return(0,i.az)("button",t)}));var u=n(75126),d=n(81548),h=Symbol("disclosure"),p=(0,i.Bi)((e=>{var t=e,{store:n,toggleOnClick:r=!0}=t,i=(0,s.S0)(t,["store","toggleOnClick"]);const l=(0,u.eR)();n=n||l,(0,d.kG)(n,!1);const p=(0,a.useRef)(null),[f,g]=(0,a.useState)(!1),m=n.useState("disclosureElement"),y=n.useState("open");(0,a.useEffect)((()=>{let e=m===p.current;(null==m?void 0:m.isConnected)||(null==n||n.setDisclosureElement(p.current),e=!0),g(y&&e)}),[m,n,y]);const v=i.onClick,A=(0,o.yl)(r),[b,w]=(0,o.XJ)(i,h,!0),S=(0,o.zX)((e=>{null==v||v(e),e.defaultPrevented||b||A(e)&&(null==n||n.setDisclosureElement(e.currentTarget),null==n||n.toggle())})),C=n.useState("contentElement");return i=(0,s.EZ)((0,s.ih)((0,s.ih)({"aria-expanded":f,"aria-controls":null==C?void 0:C.id},w),i),{ref:(0,o.qq)(p,i.ref),onClick:S}),c(i)})),f=(0,i.LM)((e=>{const t=p(e);return(0,i.az)("button",t)}))},54425:(e,t,n)=>{"use strict";n.d(t,{I:()=>m});var r=n(73026),i=n(46462),o=n(93892),s=n(6236),a=n(48104),l=n(70604),c=n(41410),u=n(14191),d=n(13277),h=n(81548),p=n(23478),f=n(40077);function g(e={}){var t=e,{combobox:n}=t,r=(0,f.S0)(t,["combobox"]);const i=(0,d.yt)(r.store,(0,d.CE)(n,["value","items","renderedItems","baseElement","arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"]));(0,d.Ny)(r,i);const o=i.getState(),s=(0,u.t)((0,f.EZ)((0,f.ih)({},r),{store:i,virtualFocus:(0,h.LS)(r.virtualFocus,o.virtualFocus,!0),includesBaseElement:(0,h.LS)(r.includesBaseElement,o.includesBaseElement,!1),activeId:(0,h.LS)(r.activeId,o.activeId,r.defaultActiveId,null),orientation:(0,h.LS)(r.orientation,o.orientation,"vertical")})),a=(0,c.e)((0,f.EZ)((0,f.ih)({},r),{store:i,placement:(0,h.LS)(r.placement,o.placement,"bottom-start")})),l=new String(""),g=(0,f.EZ)((0,f.ih)((0,f.ih)({},s.getState()),a.getState()),{value:(0,h.LS)(r.value,o.value,r.defaultValue,l),setValueOnMove:(0,h.LS)(r.setValueOnMove,o.setValueOnMove,!1),selectElement:(0,h.LS)(o.selectElement,null),labelElement:(0,h.LS)(o.labelElement,null)}),m=(0,d.MT)(g,s,a,i);return(0,d.cY)(m,(()=>(0,d.Z_)(m,["value","items"],(e=>{if(e.value!==l)return;if(!e.items.length)return;const t=e.items.find((e=>!e.disabled&&null!=e.value));null!=(null==t?void 0:t.value)&&m.setState("value",t.value)})))),(0,d.cY)(m,(()=>(0,d.Z_)(m,["mounted","items","value"],(e=>{if(n)return;if(e.mounted)return;const t=(0,p.qo)(e.value),r=t[t.length-1];if(null==r)return;const i=e.items.find((e=>!e.disabled&&e.value===r));i&&m.setState("activeId",i.id)})))),(0,d.cY)(m,(()=>(0,d.dC)(m,["setValueOnMove","moves"],(e=>{const{mounted:t,value:n,activeId:r}=m.getState();if(!e.setValueOnMove&&t)return;if(Array.isArray(n))return;if(!e.moves)return;if(!r)return;const i=s.item(r);i&&!i.disabled&&null!=i.value&&m.setState("value",i.value)})))),(0,f.EZ)((0,f.ih)((0,f.ih)((0,f.ih)({},s),a),m),{combobox:n,setValue:e=>m.setState("value",e),setSelectElement:e=>m.setState("selectElement",e),setLabelElement:e=>m.setState("labelElement",e)})}function m(e={}){const t=(0,r.Vo)();e=(0,l.EZ)((0,l.ih)({},e),{combobox:void 0!==e.combobox?e.combobox:t});const[n,c]=(0,s.oR)(g,e);return function(e,t,n){return(0,a.rf)(t,[n.combobox]),e=(0,i.b)(e,t,n),e=(0,o.k)(e,t,n),(0,s.XS)(e,n,"value","setValue"),(0,s.XS)(e,n,"setValueOnMove"),Object.assign(e,{combobox:n.combobox})}(n,c,e)}},93892:(e,t,n)=>{"use strict";n.d(t,{k:()=>s});var r=n(72455),i=n(6236),o=n(48104);function s(e,t,n){return(0,o.rf)(t,[n.popover]),e=(0,r.l)(e,t,n),(0,i.XS)(e,n,"placement"),e}},23978:(e,t,n)=>{"use strict";n.d(t,{R:()=>f});var r=n(46462),i=n(93892),o=n(6236),s=n(41410),a=n(14191),l=n(13277),c=n(81548),u=n(29052),d=n(40077),h=(0,u.G6)()&&(0,u.b1)();function p(e={}){var t;(0,l.Ny)(e,e.store);const n=null==(t=e.store)?void 0:t.getState(),r=(0,c.LS)(e.activeId,null==n?void 0:n.activeId,e.defaultActiveId,null),i=(0,a.t)((0,d.EZ)((0,d.ih)({},e),{activeId:r,includesBaseElement:(0,c.LS)(e.includesBaseElement,null==n?void 0:n.includesBaseElement,!0),orientation:(0,c.LS)(e.orientation,null==n?void 0:n.orientation,"vertical"),focusLoop:(0,c.LS)(e.focusLoop,null==n?void 0:n.focusLoop,!0),focusWrap:(0,c.LS)(e.focusWrap,null==n?void 0:n.focusWrap,!0),virtualFocus:(0,c.LS)(e.virtualFocus,null==n?void 0:n.virtualFocus,!h)})),o=(0,s.e)((0,d.EZ)((0,d.ih)({},e),{placement:(0,c.LS)(e.placement,null==n?void 0:n.placement,"bottom-start")})),u=(0,c.LS)(e.value,null==n?void 0:n.value,e.defaultValue,""),p=(0,c.LS)(e.selectedValue,null==n?void 0:n.selectedValue,e.defaultSelectedValue,""),f=Array.isArray(p),g=(0,d.EZ)((0,d.ih)((0,d.ih)({},i.getState()),o.getState()),{value:u,selectedValue:p,resetValueOnSelect:(0,c.LS)(e.resetValueOnSelect,null==n?void 0:n.resetValueOnSelect,f),resetValueOnHide:(0,c.LS)(e.resetValueOnHide,null==n?void 0:n.resetValueOnHide,f),activeValue:null==n?void 0:n.activeValue}),m=(0,l.MT)(g,i,o,e.store);return(0,l.cY)(m,(()=>(0,l.Z_)(m,["resetValueOnHide","mounted"],(e=>{e.resetValueOnHide&&(e.mounted||m.setState("value",u))})))),(0,l.cY)(m,(()=>(0,l.Z_)(m,["resetValueOnSelect","selectedValue"],(e=>{e.resetValueOnSelect&&m.setState("value",u)})))),(0,l.cY)(m,(()=>(0,l.dC)(m,["mounted"],(e=>{e.mounted||(m.setState("activeId",r),m.setState("moves",0))})))),(0,l.cY)(m,(()=>(0,l.Z_)(m,["moves","activeId"],((e,t)=>{e.moves===t.moves&&m.setState("activeValue",void 0)})))),(0,l.cY)(m,(()=>(0,l.dC)(m,["moves","renderedItems"],((e,t)=>{if(e.moves===t.moves)return;const{activeId:n}=m.getState(),r=i.item(n);m.setState("activeValue",null==r?void 0:r.value)})))),(0,d.EZ)((0,d.ih)((0,d.ih)((0,d.ih)({},o),i),m),{setValue:e=>m.setState("value",e),setSelectedValue:e=>m.setState("selectedValue",e)})}function f(e={}){const[t,n]=(0,o.oR)(p,e);return function(e,t,n){return e=(0,i.k)(e,t,n),e=(0,r.b)(e,t,n),(0,o.XS)(e,n,"value","setValue"),(0,o.XS)(e,n,"selectedValue","setSelectedValue"),(0,o.XS)(e,n,"resetValueOnHide"),(0,o.XS)(e,n,"resetValueOnSelect"),e}(t,n,e)}},38346:(e,t,n)=>{"use strict";n.d(t,{Q:()=>v});var r=n(79225),i=n(9587),o=n(43670),s=n(45010),a=n(48104),l=n(70604),c=n(2784),u=n(23478),d=n(10244),h=n(99224),p=n(15212),f=n(81548),g=n(52322);function m(e){return e.some((e=>!!e.rowId))}function y(e,t,n){return(0,a.zX)((i=>{var o;if(null==t||t(i),i.defaultPrevented)return;const s=e.getState(),a=null==(o=(0,r.D2)(e,s.activeId))?void 0:o.element;if(!a)return;if(!function(e,t){if(!(0,h.Ud)(e))return!1;if(function(e){return"Shift"===e.key||"Control"===e.key||"Alt"===e.key||"Meta"===e.key}(e))return!1;const n=e.target;if(!n)return!0;if((0,d.eS)(n)){if(function(e){return 1===e.key.length&&!e.ctrlKey&&!e.metaKey}(e))return!1;const n=m(t.renderedItems),r=null===t.activeId,i=n&&!r,o="Home"===e.key||"End"===e.key;if(!i&&o)return!1}return!e.isPropagationStopped()}(i,s))return;const c=i,{view:u}=c,p=(0,l.S0)(c,["view"]);a!==(null==n?void 0:n.current)&&a.focus(),(0,h.nm)(a,i.type,p)||i.preventDefault(),i.currentTarget.contains(a)&&i.stopPropagation()}))}var v=(0,s.Bi)((e=>{var t=e,{store:n,composite:s=!0,focusOnMove:v=s,moveOnKeyPress:A=!0}=t,b=(0,l.S0)(t,["store","composite","focusOnMove","moveOnKeyPress"]);const w=(0,i.po)();n=n||w,(0,f.kG)(n,!1);const S=(0,c.useRef)(null),C=function(e){const[t,n]=(0,c.useState)(!1),i=(0,c.useCallback)((()=>n(!0)),[]),o=e.useState((t=>(0,r.D2)(e,t.activeId)));return(0,c.useEffect)((()=>{const e=null==o?void 0:o.element;t&&e&&(n(!1),e.focus({preventScroll:!0}))}),[o,t]),i}(n),E=n.useState("moves");(0,c.useEffect)((()=>{var e;if(!n)return;if(!E)return;if(!s)return;if(!v)return;const{activeId:t}=n.getState(),i=null==(e=(0,r.D2)(n,t))?void 0:e.element;i&&(0,p.PY)(i)}),[n,E,s,v]),(0,a.Gw)((()=>{if(!n)return;if(!E)return;if(!s)return;const{baseElement:e,activeId:t}=n.getState();if(null!==t)return;if(!e)return;const r=S.current;S.current=null,r&&(0,h.sE)(r,{relatedTarget:e}),(0,p.H1)(e)?(0,h.Vr)(e,{relatedTarget:r}):e.focus()}),[n,E,s]);const I=n.useState("activeId"),_=n.useState("virtualFocus");(0,a.Gw)((()=>{var e;if(!n)return;if(!s)return;if(!_)return;const t=S.current;if(S.current=null,!t)return;const i=(null==(e=(0,r.D2)(n,I))?void 0:e.element)||(0,d.vY)(t);(0,h.sE)(t,{relatedTarget:i})}),[n,I,_,s]);const x=y(n,b.onKeyDownCapture,S),P=y(n,b.onKeyUpCapture,S),k=b.onFocusCapture,B=(0,a.zX)((e=>{if(null==k||k(e),e.defaultPrevented)return;if(!n)return;const{virtualFocus:t}=n.getState();if(!t)return;const i=e.relatedTarget,o=(0,r.JW)(e.currentTarget);(0,h.Ud)(e)&&o&&(e.stopPropagation(),S.current=i)})),O=b.onFocus,N=(0,a.zX)((e=>{if(null==O||O(e),e.defaultPrevented)return;if(!s)return;if(!n)return;const{relatedTarget:t}=e,{virtualFocus:i}=n.getState();i?(0,h.Ud)(e)&&!(0,r.Gh)(n,t)&&queueMicrotask(C):(0,h.Ud)(e)&&n.setActiveId(null)})),D=b.onBlurCapture,j=(0,a.zX)((e=>{var t;if(null==D||D(e),e.defaultPrevented)return;if(!n)return;const{virtualFocus:i,activeId:o}=n.getState();if(!i)return;const s=null==(t=(0,r.D2)(n,o))?void 0:t.element,a=e.relatedTarget,l=(0,r.Gh)(n,a),c=S.current;S.current=null,(0,h.Ud)(e)&&l?(a===s?c&&c!==a&&(0,h.sE)(c,e):s&&(0,h.sE)(s,e),e.stopPropagation()):!(0,r.Gh)(n,e.target)&&s&&(0,h.sE)(s,e)})),T=b.onKeyDown,M=(0,a.yl)(A),F=(0,a.zX)((e=>{var t;if(null==T||T(e),e.defaultPrevented)return;if(!n)return;if(!(0,h.Ud)(e))return;const{orientation:i,items:o,renderedItems:s,activeId:a}=n.getState(),l=(0,r.D2)(n,a);if(null==(t=null==l?void 0:l.element)?void 0:t.isConnected)return;const c="horizontal"!==i,d="vertical"!==i,p=m(s),f={ArrowUp:(p||c)&&(()=>{if(p){const e=o&&function(e){return(0,r.zS)((0,u.JH)((0,u.GP)((0,r.al)(e))))}(o);return null==e?void 0:e.id}return null==n?void 0:n.last()}),ArrowRight:(p||d)&&n.first,ArrowDown:(p||c)&&n.first,ArrowLeft:(p||d)&&n.last,Home:n.first,End:n.last,PageUp:n.first,PageDown:n.last},g=f[e.key];if(g){const t=g();if(void 0!==t){if(!M(e))return;e.preventDefault(),n.move(t)}}}));b=(0,a.OJ)(b,(e=>(0,g.jsx)(i.Lq,{value:n,children:e})),[n]);const R=n.useState((e=>{var t;if(n&&s&&e.virtualFocus)return null==(t=(0,r.D2)(n,e.activeId))?void 0:t.id}));b=(0,l.EZ)((0,l.ih)({"aria-activedescendant":R},b),{ref:(0,a.qq)(s?n.setBaseElement:null,b.ref),onKeyDownCapture:x,onKeyUpCapture:P,onFocusCapture:B,onFocus:N,onBlurCapture:j,onKeyDown:F});const L=n.useState((e=>s&&(e.virtualFocus||null===e.activeId)));return(0,o.k)((0,l.ih)({focusable:L},b))}));(0,s.LM)((e=>{const t=v(e);return(0,s.az)("div",t)}))},58915:(e,t,n)=>{"use strict";n.d(t,{Q9:()=>c,iw:()=>d,oE:()=>u,pQ:()=>a,re:()=>l});var r=n(75126),i=n(45010),o=n(2784),s=(0,i.re)([r.fg],[r.iG]),a=(s.useContext,s.useScopedContext,s.useProviderContext),l=s.ContextProvider,c=s.ScopedContextProvider,u=(0,o.createContext)(void 0),d=(0,o.createContext)(void 0)},51329:(e,t,n)=>{"use strict";n.d(t,{B:()=>p});var r=n(9587),i=n(45010),o=n(48104),s=n(70604),a=n(2784),l=n(10244),c=n(15212),u=n(81548);function d(e){const t=e.relatedTarget;return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null}var h=Symbol("composite-hover"),p=(0,i.Bi)((e=>{var t=e,{store:n,focusOnHover:i=!0,blurOnHoverEnd:p=!!i}=t,f=(0,s.S0)(t,["store","focusOnHover","blurOnHoverEnd"]);const g=(0,r.$)();n=n||g,(0,u.kG)(n,!1);const m=(0,o.m1)(),y=f.onMouseMove,v=(0,o.yl)(i),A=(0,o.zX)((e=>{if(null==y||y(e),!e.defaultPrevented&&m()&&v(e)){if(!(0,c.B_)(e.currentTarget)){const e=null==n?void 0:n.getState().baseElement;e&&!(0,c.H1)(e)&&e.focus()}null==n||n.setActiveId(e.currentTarget.id)}})),b=f.onMouseLeave,w=(0,o.yl)(p),S=(0,o.zX)((e=>{var t;null==b||b(e),e.defaultPrevented||m()&&(function(e){const t=d(e);return!!t&&(0,l.r3)(e.currentTarget,t)}(e)||function(e){let t=d(e);if(!t)return!1;do{if((0,u.nr)(t,h)&&t[h])return!0;t=t.parentElement}while(t);return!1}(e)||v(e)&&w(e)&&(null==n||n.setActiveId(null),null==(t=null==n?void 0:n.getState().baseElement)||t.focus()))})),C=(0,a.useCallback)((e=>{e&&(e[h]=!0)}),[]);return(0,s.EZ)((0,s.ih)({},f),{ref:(0,o.qq)(C,f.ref),onMouseMove:A,onMouseLeave:S})}));(0,i.W5)((e=>{const t=p(e);return(0,i.az)("div",t)}))},75248:(e,t,n)=>{"use strict";n.d(t,{p:()=>g});var r=n(79225),i=n(9587),o=n(45010),s=n(48104),a=n(70604),l=n(2784),c=n(10244),u=n(99224),d=n(81548),h="";function p(){h=""}function f(e,t){var n;const r=(null==(n=e.element)?void 0:n.textContent)||e.children;return!!r&&(0,d.Ue)(r).trim().toLowerCase().startsWith(t.toLowerCase())}var g=(0,o.Bi)((e=>{var t=e,{store:n,typeahead:o=!0}=t,g=(0,a.S0)(t,["store","typeahead"]);const m=(0,i.$)();n=n||m,(0,d.kG)(n,!1);const y=g.onKeyDownCapture,v=(0,l.useRef)(0),A=(0,s.zX)((e=>{if(null==y||y(e),e.defaultPrevented)return;if(!o)return;if(!n)return;const{items:t,activeId:i}=n.getState();if(!function(e){const t=e.target;return(!t||!(0,c.eS)(t))&&(!(" "!==e.key||!h.length)||1===e.key.length&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&/^[\p{Letter}\p{Number}]$/u.test(e.key))}(e))return p();let s=function(e){return e.filter((e=>!e.disabled))}(t);if(!function(e,t){if((0,u.Ud)(e))return!0;const n=e.target;return!!n&&t.some((e=>e.element===n))}(e,s))return p();e.preventDefault(),window.clearTimeout(v.current),v.current=window.setTimeout((()=>{h=""}),500);const a=e.key.toLowerCase();h+=a,s=function(e,t,n){if(!n)return e;const i=e.find((e=>e.id===n));return i&&f(i,t)?h!==t&&f(i,h)?e:(h=t,(0,r.$3)(e.filter((e=>f(e,h))),n).filter((e=>e.id!==n))):e}(s,a,i);const l=s.find((e=>f(e,h)));l?n.move(l.id):p()}));return(0,a.EZ)((0,a.ih)({},g),{onKeyDownCapture:A})}));(0,o.LM)((e=>{const t=g(e);return(0,o.az)("div",t)}))},23738:(e,t,n)=>{"use strict";function r(e){return[e.clientX,e.clientY]}function i(e,t){const[n,r]=e;let i=!1;for(let e=t.length,o=0,s=e-1;o<e;s=o++){const[a,l]=t[o],[c,u]=t[s],[,d]=t[0===s?e-1:s-1]||[0,0],h=(l-u)*(n-a)-(a-c)*(r-l);if(u<l){if(r>=u&&r<l){if(0===h)return!0;h>0&&(r===u?r>d&&(i=!i):i=!i)}}else if(l<u){if(r>l&&r<=u){if(0===h)return!0;h<0&&(r===u?r<d&&(i=!i):i=!i)}}else if(r==l&&(n>=c&&n<=a||n>=a&&n<=c))return!0}return i}function o(e,t){const n=e.getBoundingClientRect(),{top:r,right:i,bottom:o,left:s}=n,[a,l]=function(e,t){const{top:n,right:r,bottom:i,left:o}=t,[s,a]=e;return[s<o?"left":s>r?"right":null,a<n?"top":a>i?"bottom":null]}(t,n),c=[t];return a?("top"!==l&&c.push(["left"===a?s:i,r]),c.push(["left"===a?i:s,r]),c.push(["left"===a?i:s,o]),"bottom"!==l&&c.push(["left"===a?s:i,o])):"top"===l?(c.push([s,r]),c.push([s,o]),c.push([i,o]),c.push([i,r])):(c.push([s,o]),c.push([s,r]),c.push([i,r]),c.push([i,o])),c}n.d(t,{u:()=>S,c:()=>w});var s=n(83222),a=n(56278),l=n(19922),c=n(45010),u=n(48104),d=n(70604),h=n(2784),p=n(10244),f=n(99224),g=n(15212),m=n(81548),y=n(13277),v=n(52322);function A(e,t,n,r){return!!((0,g.B_)(t)||e&&((0,p.r3)(t,e)||n&&(0,p.r3)(n,e)||(null==r?void 0:r.some((t=>A(e,t,n))))))}var b=(0,h.createContext)(null),w=(0,c.Bi)((e=>{var t=e,{store:n,modal:a=!1,portal:c=!!a,hideOnEscape:g=!0,hideOnHoverOutside:w=!0,disablePointerEventsOnApproach:S=!!w}=t,C=(0,d.S0)(t,["store","modal","portal","hideOnEscape","hideOnHoverOutside","disablePointerEventsOnApproach"]);const E=(0,l.P9)();n=n||E,(0,m.kG)(n,!1);const I=(0,h.useRef)(null),[_,x]=(0,h.useState)([]),P=(0,h.useRef)(0),k=(0,h.useRef)(null),{portalRef:B,domReady:O}=(0,u.Hw)(c,C.portalRef),N=!!w,D=(0,u.yl)(w),j=!!S,T=(0,u.yl)(S),M=n.useState("open"),F=n.useState("mounted");(0,h.useEffect)((()=>{if(!O)return;if(!F)return;if(!N&&!j)return;const e=I.current;return e?(0,m.tS)((0,f.iN)("mousemove",(t=>{if(!n)return;const{anchorElement:s,hideTimeout:a,timeout:l}=n.getState(),c=k.current,u=t.target,d=s;if(A(u,e,d,_))return k.current=u&&d&&(0,p.r3)(d,u)?r(t):null,window.clearTimeout(P.current),void(P.current=0);if(!P.current){if(c){const n=r(t);if(i(n,o(e,c))){if(k.current=n,!T(t))return;return t.preventDefault(),void t.stopPropagation()}}D(t)&&(P.current=window.setTimeout((()=>{P.current=0,null==n||n.hide()}),null!=a?a:l))}}),!0),(()=>clearTimeout(P.current))):void 0}),[n,O,F,N,j,_,T,D]),(0,h.useEffect)((()=>{if(!O)return;if(!F)return;if(!j)return;const e=e=>{const t=I.current;if(!t)return;const n=k.current;if(!n)return;const s=o(t,n);if(i(r(e),s)){if(!T(e))return;e.preventDefault(),e.stopPropagation()}};return(0,m.tS)((0,f.iN)("mouseenter",e,!0),(0,f.iN)("mouseover",e,!0),(0,f.iN)("mouseout",e,!0),(0,f.iN)("mouseleave",e,!0))}),[O,F,j,T]),(0,h.useEffect)((()=>{O&&(M||null==n||n.setAutoFocusOnShow(!1))}),[n,O,M]);const R=(0,u.cP)(M);(0,h.useEffect)((()=>{if(O)return()=>{R.current||null==n||n.setAutoFocusOnShow(!1)}}),[n,O]);const L=(0,h.useContext)(b);(0,u.Gw)((()=>{if(a)return;if(!c)return;if(!F)return;if(!O)return;const e=I.current;return e?null==L?void 0:L(e):void 0}),[a,c,F,O]);const Q=(0,h.useCallback)((e=>{x((t=>[...t,e]));const t=null==L?void 0:L(e);return()=>{x((t=>t.filter((t=>t!==e)))),null==t||t()}}),[L]);C=(0,u.OJ)(C,(e=>(0,v.jsx)(l.WS,{value:n,children:(0,v.jsx)(b.Provider,{value:Q,children:e})})),[n,Q]),C=(0,d.EZ)((0,d.ih)({},C),{ref:(0,u.qq)(I,C.ref)}),C=function(e){var t=e,{store:n}=t,r=(0,d.S0)(t,["store"]);const[i,o]=(0,h.useState)(!1),s=n.useState("mounted");(0,h.useEffect)((()=>{s||o(!1)}),[s]);const a=r.onFocus,l=(0,u.zX)((e=>{null==a||a(e),e.defaultPrevented||o(!0)})),c=(0,h.useRef)(null);return(0,h.useEffect)((()=>(0,y.Z_)(n,["anchorElement"],(e=>{c.current=e.anchorElement}))),[]),(0,d.EZ)((0,d.ih)({autoFocusOnHide:i,finalFocus:c},r),{onFocus:l})}((0,d.ih)({store:n},C));const U=n.useState((e=>a||e.autoFocusOnShow));return(0,s.S)((0,d.EZ)((0,d.ih)({store:n,modal:a,portal:c,autoFocusOnShow:U},C),{portalRef:B,hideOnEscape:e=>!(0,m.Bk)(g,e)&&(requestAnimationFrame((()=>{requestAnimationFrame((()=>{null==n||n.hide()}))})),!0)}))})),S=(0,a.L5)((0,c.LM)((e=>{const t=w(e);return(0,c.az)("div",t)})),l.P9)},9587:(e,t,n)=>{"use strict";n.d(t,{$:()=>a,Ft:()=>h,Lq:()=>c,al:()=>u,po:()=>l,xt:()=>d});var r=n(75235),i=n(45010),o=n(2784),s=(0,i.re)([r.L3],[r.MI]),a=s.useContext,l=(s.useScopedContext,s.useProviderContext),c=s.ContextProvider,u=s.ScopedContextProvider,d=(0,o.createContext)(void 0),h=(0,o.createContext)(void 0)},43965:(e,t,n)=>{"use strict";n.d(t,{Q:()=>a});var r=n(59412),i=n(45010),o=n(48104),s=n(70604),a=(0,i.Bi)((e=>{var t=e,{store:n}=t,i=(0,s.S0)(t,["store"]);const a=(0,r.yL)();return n=n||a,(0,s.EZ)((0,s.ih)({},i),{ref:(0,o.qq)(null==n?void 0:n.setAnchorElement,i.ref)})}));(0,i.LM)((e=>{const t=a(e);return(0,i.az)("div",t)}))},43670:(e,t,n)=>{"use strict";n.d(t,{k:()=>b});var r=n(27177),i=n(45010),o=n(48104),s=n(70604),a=n(2784),l=n(10244),c=n(99224),u=n(15212),d=n(81548),h=(0,n(29052).G6)(),p=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"];function f(e){return!("input"!==e.tagName.toLowerCase()||!e.type||"radio"!==e.type&&"checkbox"!==e.type)}function g(e,t,n,r,i){return e?t?n&&!r?-1:void 0:n?i:i||0:i}function m(e,t){return(0,o.zX)((n=>{null==e||e(n),n.defaultPrevented||t&&(n.stopPropagation(),n.preventDefault())}))}var y=!0;function v(e){const t=e.target;t&&"hasAttribute"in t&&(t.hasAttribute("data-focus-visible")||(y=!1))}function A(e){e.metaKey||e.ctrlKey||e.altKey||(y=!0)}var b=(0,i.Bi)((e=>{var t=e,{focusable:n=!0,accessibleWhenDisabled:i,autoFocus:b,onFocusVisible:w}=t,S=(0,s.S0)(t,["focusable","accessibleWhenDisabled","autoFocus","onFocusVisible"]);const C=(0,a.useRef)(null);(0,a.useEffect)((()=>{n&&((0,c.iN)("mousedown",v,!0),(0,c.iN)("keydown",A,!0))}),[n]),h&&(0,a.useEffect)((()=>{if(!n)return;const e=C.current;if(!e)return;if(!f(e))return;const t=function(e){return"labels"in e?e.labels:null}(e);if(!t)return;const r=()=>queueMicrotask((()=>e.focus()));return t.forEach((e=>e.addEventListener("mouseup",r))),()=>{t.forEach((e=>e.removeEventListener("mouseup",r)))}}),[n]);const E=n&&(0,d.EE)(S),I=!!E&&!i,[_,x]=(0,a.useState)(!1);(0,a.useEffect)((()=>{n&&I&&_&&x(!1)}),[n,I,_]),(0,a.useEffect)((()=>{if(!n)return;if(!_)return;const e=C.current;if(!e)return;if("undefined"==typeof IntersectionObserver)return;const t=new IntersectionObserver((()=>{(0,u.EB)(e)||x(!1)}));return t.observe(e),()=>t.disconnect()}),[n,_]);const P=m(S.onKeyPressCapture,E),k=m(S.onMouseDownCapture,E),B=m(S.onClickCapture,E),O=S.onMouseDown,N=(0,o.zX)((e=>{if(null==O||O(e),e.defaultPrevented)return;if(!n)return;const t=e.currentTarget;if(!h)return;if((0,c.Ke)(e))return;if(!(0,l.iK)(t)&&!f(t))return;let r=!1;const i=()=>{r=!0};t.addEventListener("focusin",i,{capture:!0,once:!0}),(0,c.qx)(t,"mouseup",(()=>{t.removeEventListener("focusin",i,!0),r||(0,u.Qw)(t)}))})),D=(e,t)=>{if(t&&(e.currentTarget=t),!n)return;const r=e.currentTarget;r&&(0,u.H1)(r)&&(null==w||w(e),e.defaultPrevented||x(!0))},j=S.onKeyDownCapture,T=(0,o.zX)((e=>{if(null==j||j(e),e.defaultPrevented)return;if(!n)return;if(_)return;if(e.metaKey)return;if(e.altKey)return;if(e.ctrlKey)return;if(!(0,c.Ud)(e))return;const t=e.currentTarget;queueMicrotask((()=>D(e,t)))})),M=S.onFocusCapture,F=(0,o.zX)((e=>{if(null==M||M(e),e.defaultPrevented)return;if(!n)return;if(!(0,c.Ud)(e))return void x(!1);const t=e.currentTarget,r=()=>D(e,t);y||function(e){const{tagName:t,readOnly:n,type:r}=e;return"TEXTAREA"===t&&!n||"SELECT"===t&&!n||("INPUT"!==t||n?!!e.isContentEditable:p.includes(r))}(e.target)?queueMicrotask(r):function(e){return"combobox"===e.getAttribute("role")&&!!e.dataset.name}(e.target)?(0,c.qx)(e.target,"focusout",r):x(!1)})),R=S.onBlur,L=(0,o.zX)((e=>{null==R||R(e),n&&(0,c.N)(e)&&x(!1)})),Q=(0,a.useContext)(r.R),U=(0,o.zX)((e=>{n&&b&&e&&Q&&queueMicrotask((()=>{(0,u.H1)(e)||(0,u.EB)(e)&&e.focus()}))})),V=(0,o.O)(C,S.as),K=n&&function(e){return!e||"button"===e||"input"===e||"select"===e||"textarea"===e||"a"===e}(V),H=n&&function(e){return!e||"button"===e||"input"===e||"select"===e||"textarea"===e}(V),G=I?(0,s.ih)({pointerEvents:"none"},S.style):S.style;return(0,s.EZ)((0,s.ih)({"data-focus-visible":n&&_?"":void 0,"data-autofocus":!!b||void 0,"aria-disabled":!!E||void 0},S),{ref:(0,o.qq)(C,U,S.ref),style:G,tabIndex:g(n,I,K,H,S.tabIndex),disabled:!(!H||!I)||void 0,contentEditable:E?void 0:S.contentEditable,onKeyPressCapture:P,onClickCapture:B,onMouseDownCapture:k,onMouseDown:N,onKeyDownCapture:T,onFocusCapture:F,onBlur:L})}));(0,i.LM)((e=>(e=b(e),(0,i.az)("div",e))))},10114:(e,t,n)=>{"use strict";n.d(t,{fM:()=>g,k_:()=>y,xj:()=>f});var r=n(58915),i=n(75126),o=n(45010),s=n(6236),a=n(48104),l=n(70604),c=n(2784),u=n(81548),d=n(52322);function h(e,t){const n=setTimeout(t,e);return()=>clearTimeout(n)}function p(...e){return e.join(", ").split(", ").reduce(((e,t)=>{const n=1e3*parseFloat(t||"0s");return n>e?n:e}),0)}function f(e,t,n){return!(n||!1===t||e&&!t)}var g=(0,o.Bi)((e=>{var t=e,{store:n,alwaysVisible:o}=t,s=(0,l.S0)(t,["store","alwaysVisible"]);const g=(0,i.eR)();n=n||g,(0,u.kG)(n,!1);const m=(0,a.Me)(s.id),[y,v]=(0,c.useState)(null),A=n.useState("open"),b=n.useState("mounted"),w=n.useState("animated"),S=n.useState("contentElement");(0,a.Gw)((()=>{if(w){if(null==S?void 0:S.isConnected)return function(e){let t=requestAnimationFrame((()=>{t=requestAnimationFrame(e)}));return()=>cancelAnimationFrame(t)}((()=>{v(A?"enter":"leave")}));v(null)}}),[w,S,A]),(0,a.Gw)((()=>{if(!n)return;if(!w)return;if(!S)return;if(!y)return;if("enter"===y&&!A)return;if("leave"===y&&A)return;if("number"==typeof w)return h(w,n.stopAnimation);const{transitionDuration:e,animationDuration:t,transitionDelay:r,animationDelay:i}=getComputedStyle(S),o=p(r,i)+p(e,t);return o?h(o,n.stopAnimation):void 0}),[n,w,S,A,y]);const C=f(b,(s=(0,a.OJ)(s,(e=>(0,d.jsx)(r.Q9,{value:n,children:e})),[n])).hidden,o),E=C?(0,l.EZ)((0,l.ih)({},s.style),{display:"none"}):s.style;return(0,l.EZ)((0,l.ih)({id:m,"data-enter":"enter"===y?"":void 0,"data-leave":"leave"===y?"":void 0,hidden:C},s),{ref:(0,a.qq)(m?n.setContentElement:null,s.ref),style:E})})),m=(0,o.LM)((e=>{const t=g(e);return(0,o.az)("div",t)})),y=(0,o.LM)((e=>{var t=e,{unmountOnHide:n}=t,r=(0,l.S0)(t,["unmountOnHide"]);const o=(0,i.eR)(),a=r.store||o;return!1===(0,s.Kw)(a,(e=>!n||(null==e?void 0:e.mounted)))?null:(0,d.jsx)(m,(0,l.ih)({},r))}))},15945:(e,t,n)=>{"use strict";n.d(t,{n:()=>p});var r=n(59412),i=n(45010),o=n(70604),s=n(2784),a=n(81548),l=n(52322),c={top:"4,10 8,6 12,10",right:"6,4 10,8 6,12",bottom:"4,6 8,10 12,6",left:"10,4 6,8 10,12"},u=(0,i.Bi)((e=>{var t=e,{store:n,placement:i}=t,u=(0,o.S0)(t,["store","placement"]);const d=(0,r.lp)();n=n||d,(0,a.kG)(n,!1);const h=n.useState((e=>i||e.placement)).split("-")[0],p=c[h],f=(0,s.useMemo)((()=>(0,l.jsx)("svg",{display:"block",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5pt",viewBox:"0 0 16 16",height:"1em",width:"1em",children:(0,l.jsx)("polyline",{points:p})})),[p]);return(0,o.EZ)((0,o.ih)({children:f,"aria-hidden":!0},u),{style:(0,o.ih)({width:"1em",height:"1em",pointerEvents:"none"},u.style)})}));(0,i.LM)((e=>{const t=u(e);return(0,i.az)("span",t)}));var d=n(9460),h=(0,i.Bi)((e=>{var t=e,{store:n}=t,r=(0,o.S0)(t,["store"]);const i=(0,d.TG)();return n=n||i,u((0,o.ih)({store:n},r))})),p=(0,i.LM)((e=>{const t=h(e);return(0,i.az)("span",t)}))},13271:(e,t,n)=>{"use strict";n.d(t,{Y:()=>f});var r=n(43670),i=n(45010),o=n(48104),s=n(70604),a=n(2784),l=n(10244),c=n(99224),u=n(81548),d=n(29052);function h(e){if(!e.isTrusted)return!1;const t=e.currentTarget;return"Enter"===e.key?(0,l.iK)(t)||"SUMMARY"===t.tagName||"A"===t.tagName:" "===e.key&&((0,l.iK)(t)||"SUMMARY"===t.tagName||"INPUT"===t.tagName||"SELECT"===t.tagName)}var p=Symbol("command"),f=(0,i.Bi)((e=>{var t=e,{clickOnEnter:n=!0,clickOnSpace:i=!0}=t,f=(0,s.S0)(t,["clickOnEnter","clickOnSpace"]);const g=(0,a.useRef)(null),m=(0,o.O)(g,f.as),y=f.type,[v,A]=(0,a.useState)((()=>!!m&&(0,l.iK)({tagName:m,type:y})));(0,a.useEffect)((()=>{g.current&&A((0,l.iK)(g.current))}),[]);const[b,w]=(0,a.useState)(!1),S=(0,a.useRef)(!1),C=(0,u.EE)(f),[E,I]=(0,o.XJ)(f,p,!0),_=f.onKeyDown,x=(0,o.zX)((e=>{null==_||_(e);const t=e.currentTarget;if(e.defaultPrevented)return;if(E)return;if(C)return;if(!(0,c.Ud)(e))return;if((0,l.eS)(t))return;if(t.isContentEditable)return;const r=n&&"Enter"===e.key,o=i&&" "===e.key,a="Enter"===e.key&&!n,u=" "===e.key&&!i;if(a||u)e.preventDefault();else if(r||o){const n=h(e);if(r){if(!n){e.preventDefault();const n=e,{view:r}=n,i=(0,s.S0)(n,["view"]),o=()=>(0,c.lO)(t,i);(0,d.vU)()?(0,c.qx)(t,"keyup",o):queueMicrotask(o)}}else o&&(S.current=!0,n||(e.preventDefault(),w(!0)))}})),P=f.onKeyUp,k=(0,o.zX)((e=>{if(null==P||P(e),e.defaultPrevented)return;if(E)return;if(C)return;if(e.metaKey)return;const t=i&&" "===e.key;if(S.current&&t&&(S.current=!1,!h(e))){e.preventDefault(),w(!1);const t=e.currentTarget,n=e,{view:r}=n,i=(0,s.S0)(n,["view"]);queueMicrotask((()=>(0,c.lO)(t,i)))}}));return f=(0,s.EZ)((0,s.ih)((0,s.ih)({"data-active":b?"":void 0,type:v?"button":void 0},I),f),{ref:(0,o.qq)(g,f.ref),onKeyDown:x,onKeyUp:k}),(0,r.k)(f)}));(0,i.LM)((e=>(e=f(e),(0,i.az)("button",e))))},75126:(e,t,n)=>{"use strict";n.d(t,{eR:()=>i,fg:()=>o,iG:()=>s});var r=(0,n(45010).re)(),i=(r.useContext,r.useScopedContext,r.useProviderContext),o=r.ContextProvider,s=r.ScopedContextProvider},56278:(e,t,n)=>{"use strict";function r(e,...t){if(!e)return!1;const n=e.getAttribute("data-backdrop");return null!=n&&(""===n||"true"===n||!t.length||t.some((e=>n===e)))}n.d(t,{Vq:()=>ne,L5:()=>te,Rh:()=>ee});var i=new WeakMap;function o(e,t,n){i.has(e)||i.set(e,new Map);const r=i.get(e),o=r.get(t);if(!o)return r.set(t,n()),()=>{var e;null==(e=r.get(t))||e(),r.delete(t)};const s=n(),a=()=>{s(),o(),r.delete(t)};return r.set(t,a),()=>{r.get(t)===a&&(s(),r.set(t,o))}}function s(e,t,n){return o(e,t,(()=>{const r=e.getAttribute(t);return e.setAttribute(t,n),()=>{null==r?e.removeAttribute(t):e.setAttribute(t,r)}}))}function a(e,t,n){return o(e,t,(()=>{const r=t in e,i=e[t];return e[t]=n,()=>{r?e[t]=i:delete e[t]}}))}function l(e,t){return e?o(e,"style",(()=>{const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}})):()=>{}}var c=n(10244),u=n(81548),d=["SCRIPT","STYLE"];function h(e){return`__ariakit-dialog-snapshot-${e}`}function p(e,t,n){return!d.includes(t.tagName)&&!!function(e,t){const n=(0,c.Me)(t),r=h(e);if(!n.body[r])return!0;for(;;){if(t===n.body)return!1;if(t[r])return!0;if(!t.parentElement)return!1;t=t.parentElement}}(e,t)&&!n.some((e=>e&&(0,c.r3)(t,e)))}function f(e,t,n,r){for(let i of t){if(!(null==i?void 0:i.isConnected))continue;const o=t.some((e=>!!e&&e!==i&&e.contains(i))),s=(0,c.Me)(i),a=i;for(;i.parentElement&&i!==s.body;){if(null==r||r(i.parentElement,a),!o)for(const r of i.parentElement.children)p(e,r,t)&&n(r,a);i=i.parentElement}}}function g(e="",t=!1){return`__ariakit-dialog-${t?"ancestor":"outside"}${e?`-${e}`:""}`}function m(e,t=""){return(0,u.tS)(a(e,g("",!0),!0),a(e,g(t,!0),!0))}function y(e,t){if(e[g(t,!0)])return!0;const n=g(t);for(;;){if(e[n])return!0;if(!e.parentElement)return!1;e=e.parentElement}}function v(e,t){const n=[],i=t.map((e=>null==e?void 0:e.id));return f(e,t,(t=>{r(t,...i)||n.unshift(function(e,t=""){return(0,u.tS)(a(e,g(),!0),a(e,g(t),!0))}(t,e))}),((t,r)=>{r.hasAttribute("data-dialog")&&r.id!==e||n.unshift(m(t,e))})),()=>{n.forEach((e=>e()))}}var A=n(45010),b=((0,A.Bi)((e=>e)),(0,A.LM)((e=>(0,A.az)("div",e))));Object.assign(b,["a","button","details","dialog","div","form","h1","h2","h3","h4","h5","h6","header","img","input","label","li","nav","ol","p","section","select","span","textarea","ul","svg"].reduce(((e,t)=>(e[t]=(0,A.LM)((e=>(0,A.az)(t,e))),e)),{}));var w=n(10114),S=n(22457),C=n(48104),E=n(70604),I=n(2784),_=n(52322);function x({store:e,backdrop:t,backdropProps:n,alwaysVisible:r,hidden:i}){const o=(0,I.useRef)(null),s=(0,S.M)({disclosure:e}),a=e.useState("contentElement");(0,C.Gw)((()=>{const e=o.current,t=a;e&&t&&(e.style.zIndex=getComputedStyle(t).zIndex)}),[a]),(0,C.Gw)((()=>{const e=null==a?void 0:a.id;if(!e)return;const t=o.current;return t?m(t,e):void 0}),[a]),null!=i&&(n=(0,E.EZ)((0,E.ih)({},n),{hidden:i}));const l=(0,w.fM)((0,E.EZ)((0,E.ih)({store:s,role:"presentation","data-backdrop":(null==a?void 0:a.id)||"",alwaysVisible:r},n),{ref:(0,C.qq)(null==n?void 0:n.ref,o),style:(0,E.ih)({position:"fixed",top:0,right:0,bottom:0,left:0},null==n?void 0:n.style)}));if(!t)return null;if((0,I.isValidElement)(t))return(0,_.jsx)(b,(0,E.EZ)((0,E.ih)({},l),{render:t}));const c="boolean"!=typeof t?t:"div";return(0,_.jsx)(b,(0,E.EZ)((0,E.ih)({},l),{render:(0,_.jsx)(c,{})}))}var P=n(15212);function k(e,t){if(!("style"in e))return u.ZT;if("inert"in HTMLElement.prototype)return a(e,"inert",!0);const n=(0,P.SI)(e,!0).map((e=>(null==t?void 0:t.some((t=>t&&(0,c.r3)(t,e))))?u.ZT:s(e,"tabindex","-1")));return(0,u.tS)(...n,function(e){return s(e,"aria-hidden","true")}(e),l(e,{pointerEvents:"none",userSelect:"none",cursor:"default"}))}var B=n(28316),O=n(29052);var N=n(13277),D=(0,I.createContext)({}),j=n(99224);function T({store:e,type:t,listener:n,capture:r,domReady:i}){const o=(0,C.zX)(n),s=e.useState("open"),a=(0,I.useRef)(!1);(0,C.Gw)((()=>{if(!s)return;if(!i)return;const{contentElement:t}=e.getState();if(!t)return;const n=()=>{a.current=!0};return t.addEventListener("focusin",n,!0),()=>t.removeEventListener("focusin",n,!0)}),[e,s,i]),(0,I.useEffect)((()=>{if(s)return(0,j.iN)(t,(t=>{const{contentElement:n,disclosureElement:r}=e.getState(),i=t.target;n&&i&&function(e){return"HTML"===e.tagName||(0,c.r3)((0,c.Me)(e).body,e)}(i)&&((0,c.r3)(n,i)||function(e,t){if(!e)return!1;if((0,c.r3)(e,t))return!0;const n=t.getAttribute("aria-activedescendant");if(n){const t=(0,c.Me)(e).getElementById(n);if(t)return(0,c.r3)(e,t)}return!1}(r,i)||i.hasAttribute("data-focus-trap")||function(e,t){if(!("clientY"in e))return!1;const n=t.getBoundingClientRect();return 0!==n.width&&0!==n.height&&n.top<=e.clientY&&e.clientY<=n.top+n.height&&n.left<=e.clientX&&e.clientX<=n.left+n.width}(t,n)||a.current&&!y(i,n.id)||o(t))}),r)}),[s,r])}function M(e,t){return"function"==typeof e?e(t):!!e}var F=n(27177),R=(0,A.Bi)((e=>{var t=e,{autoFocusOnShow:n=!0}=t,r=(0,E.S0)(t,["autoFocusOnShow"]);return(0,C.OJ)(r,(e=>(0,_.jsx)(F.R.Provider,{value:n,children:e})),[n])}));(0,A.LM)((e=>{const t=R(e);return(0,A.az)("div",t)}));var L=(0,I.createContext)(0);function Q({level:e,children:t}){const n=(0,I.useContext)(L),r=Math.max(Math.min(e||n+1,6),1);return(0,_.jsx)(L.Provider,{value:r,children:t})}var U=n(96332),V=(0,A.Bi)((e=>(e=(0,E.EZ)((0,E.ih)({"data-focus-trap":"",tabIndex:0,"aria-hidden":!0},e),{style:(0,E.ih)({position:"fixed",top:0,left:0},e.style)}),(0,U.S)(e)))),K=(0,A.LM)((e=>{const t=V(e);return(0,A.az)("span",t)})),H=(0,I.createContext)(null),G=n(43198);function Y(e){queueMicrotask((()=>{null==e||e.focus()}))}var z=(0,A.Bi)((e=>{var t=e,{preserveTabOrder:n,preserveTabOrderAnchor:r,portalElement:i,portalRef:o,portal:s=!0}=t,a=(0,E.S0)(t,["preserveTabOrder","preserveTabOrderAnchor","portalElement","portalRef","portal"]);const l=(0,I.useRef)(null),u=(0,C.qq)(l,a.ref),d=(0,I.useContext)(H),[h,p]=(0,I.useState)(null),[f,g]=(0,I.useState)(null),m=(0,I.useRef)(null),y=(0,I.useRef)(null),v=(0,I.useRef)(null),A=(0,I.useRef)(null);return(0,C.Gw)((()=>{const e=l.current;if(!e||!s)return void p(null);const t=function(e,t){return t?"function"==typeof t?t(e):t:(0,c.Me)(e).createElement("div")}(e,i);if(!t)return void p(null);const n=t.isConnected;if(!n){const n=d||function(e){return(0,c.Me)(e).body}(e);n.appendChild(t)}return t.id||(t.id=e.id?`portal/${e.id}`:function(e="id"){return`${e?`${e}-`:""}${Math.random().toString(36).substr(2,6)}`}()),p(t),(0,G.k$)(o,t),n?void 0:()=>{t.remove(),(0,G.k$)(o,null)}}),[s,i,d,o]),(0,C.Gw)((()=>{if(!n)return;if(!r)return;const e=(0,c.Me)(r).createElement("span");return e.style.position="fixed",r.insertAdjacentElement("afterend",e),g(e),()=>{e.remove(),g(null)}}),[n,r]),(0,I.useEffect)((()=>{if(!h)return;if(!n)return;let e=0;const t=t=>{if((0,j.N)(t))return"focusin"===t.type?(0,P.ss)(h):(cancelAnimationFrame(e),void(e=requestAnimationFrame((()=>{(0,P.MN)(h,!0)}))))};return h.addEventListener("focusin",t,!0),h.addEventListener("focusout",t,!0),()=>{h.removeEventListener("focusin",t,!0),h.removeEventListener("focusout",t,!0)}}),[h,n]),a=(0,C.OJ)(a,(e=>{if(e=(0,_.jsx)(H.Provider,{value:h||d,children:e}),!s)return e;if(!h)return(0,_.jsx)("span",{ref:u,id:a.id,style:{position:"fixed"},hidden:!0});e=(0,_.jsxs)(_.Fragment,{children:[n&&h&&(0,_.jsx)(K,{ref:y,className:"__focus-trap-inner-before",onFocus:e=>{(0,j.N)(e,h)?Y((0,P.k0)()):Y(m.current)}}),e,n&&h&&(0,_.jsx)(K,{ref:v,className:"__focus-trap-inner-after",onFocus:e=>{(0,j.N)(e,h)?Y((0,P.e8)()):Y(A.current)}})]}),h&&(e=(0,B.createPortal)(e,h));let t=(0,_.jsxs)(_.Fragment,{children:[n&&h&&(0,_.jsx)(K,{ref:m,className:"__focus-trap-outer-before",onFocus:e=>{e.relatedTarget!==A.current&&(0,j.N)(e,h)?Y(y.current):Y((0,P.e8)())}}),n&&(0,_.jsx)("span",{"aria-owns":null==h?void 0:h.id,style:{position:"fixed"}}),n&&h&&(0,_.jsx)(K,{ref:A,className:"__focus-trap-outer-after",onFocus:e=>{if((0,j.N)(e,h))Y(v.current);else{const e=(0,P.k0)();if(e===y.current)return void requestAnimationFrame((()=>{var e;return null==(e=(0,P.k0)())?void 0:e.focus()}));Y(e)}}})]});return f&&n&&(t=(0,B.createPortal)(t,f)),(0,_.jsxs)(_.Fragment,{children:[t,e]})}),[h,d,s,a.id,n,f]),a=(0,E.EZ)((0,E.ih)({},a),{ref:u})}));(0,A.LM)((e=>{const t=z(e);return(0,A.az)("div",t)}));var Z=n(58915),W=n(43670),q=n(72455),J=n(6236),X=(0,O.G6)();function $(e,t=!1){if(!e)return null;const n="current"in e?e.current:e;return n?t?(0,P.EB)(n)?n:null:n:null}var ee=(0,A.Bi)((e=>{var t=e,{store:n,open:i,onClose:s,focusable:d=!0,modal:p=!0,portal:g=!!p,backdrop:m=!!p,backdropProps:A,hideOnEscape:b=!0,hideOnInteractOutside:S=!0,getPersistentElements:F,preventBodyScroll:L=!!p,autoFocusOnShow:U=!0,autoFocusOnHide:V=!0,initialFocus:K,finalFocus:H,unmountOnHide:G}=t,Y=(0,E.S0)(t,["store","open","onClose","focusable","modal","portal","backdrop","backdropProps","hideOnEscape","hideOnInteractOutside","getPersistentElements","preventBodyScroll","autoFocusOnShow","autoFocusOnHide","initialFocus","finalFocus","unmountOnHide"]);const J=(0,Z.pQ)(),ee=(0,I.useRef)(null),te=(0,q.I)({store:n||J,open:i,setOpen(e){if(e)return;const t=ee.current;if(!t)return;const n=new Event("close",{bubbles:!1,cancelable:!0});s&&t.addEventListener("close",s,{once:!0}),t.dispatchEvent(n),n.defaultPrevented&&te.setOpen(!0)}}),{portalRef:ne,domReady:re}=(0,C.Hw)(g,Y.portalRef),ie=Y.preserveTabOrder,oe=te.useState((e=>ie&&!p&&e.mounted)),se=(0,C.Me)(Y.id),ae=te.useState("open"),le=te.useState("mounted"),ce=te.useState("contentElement"),ue=(0,w.xj)(le,Y.hidden,Y.alwaysVisible);(function(e,t,n){const r=function({attribute:e,contentId:t,contentElement:n,enabled:r}){const[i,o]=(0,C.NW)(),s=(0,I.useCallback)((()=>{if(!r)return!1;if(!n)return!1;const{body:i}=(0,c.Me)(n),o=i.getAttribute(e);return!o||o===t}),[i,r,n,e,t]);return(0,I.useEffect)((()=>{if(!r)return;if(!t)return;if(!n)return;const{body:i}=(0,c.Me)(n);if(s())return i.setAttribute(e,t),()=>i.removeAttribute(e);const a=new MutationObserver((()=>(0,B.flushSync)(o)));return a.observe(i,{attributeFilter:[e]}),()=>a.disconnect()}),[i,r,t,n,s,e]),s}({attribute:"data-dialog-prevent-body-scroll",contentElement:e,contentId:t,enabled:n});(0,I.useEffect)((()=>{if(!r())return;if(!e)return;const t=(0,c.Me)(e),n=(0,c.Jj)(e),{documentElement:i,body:s}=t,a=i.style.getPropertyValue("--scrollbar-width"),d=a?parseInt(a):n.innerWidth-i.clientWidth,h=function(e){const t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}(i),p=(0,O.mL)()&&!(0,O.V5)();return(0,u.tS)((g="--scrollbar-width",m=`${d}px`,(f=i)?o(f,g,(()=>{const e=f.style.getPropertyValue(g);return f.style.setProperty(g,m),()=>{e?f.style.setProperty(g,e):f.style.removeProperty(g)}})):()=>{}),p?(()=>{var e,t;const{scrollX:r,scrollY:i,visualViewport:o}=n,a=null!=(e=null==o?void 0:o.offsetLeft)?e:0,c=null!=(t=null==o?void 0:o.offsetTop)?t:0,u=l(s,{position:"fixed",overflow:"hidden",top:-(i-Math.floor(c))+"px",left:-(r-Math.floor(a))+"px",right:"0",[h]:`${d}px`});return()=>{u(),n.scrollTo(r,i)}})():l(s,{overflow:"hidden",[h]:`${d}px`}));var f,g,m}),[r,e])})(ce,se,L&&!ue),function(e,t,n){const r=function(e){const t=(0,I.useRef)();return(0,I.useEffect)((()=>{if(e)return(0,j.iN)("mousedown",(e=>{t.current=e.target}),!0);t.current=null}),[e]),t}(e.useState("open")),i={store:e,domReady:n,capture:!0};T((0,E.EZ)((0,E.ih)({},i),{type:"click",listener:n=>{const{contentElement:i}=e.getState(),o=r.current;o&&(0,c.pn)(o)&&y(o,null==i?void 0:i.id)&&M(t,n)&&e.hide()}})),T((0,E.EZ)((0,E.ih)({},i),{type:"focusin",listener:n=>{const{contentElement:r}=e.getState();r&&n.target!==(0,c.Me)(r)&&M(t,n)&&e.hide()}})),T((0,E.EZ)((0,E.ih)({},i),{type:"contextmenu",listener:n=>{M(t,n)&&e.hide()}}))}(te,S,re);const{wrapElement:de,nestedDialogs:he}=function(e){const t=(0,I.useContext)(D),[n,r]=(0,I.useState)([]),i=(0,I.useCallback)((e=>{var n;return r((t=>[...t,e])),(0,u.tS)(null==(n=t.add)?void 0:n.call(t,e),(()=>{r((t=>t.filter((t=>t!==e))))}))}),[t]);(0,C.Gw)((()=>(0,N.Z_)(e,["open","contentElement"],(n=>{var r;if(n.open&&n.contentElement)return null==(r=t.add)?void 0:r.call(t,e)}))),[e,t]);const o=(0,I.useMemo)((()=>({store:e,add:i})),[e,i]);return{wrapElement:(0,I.useCallback)((e=>(0,_.jsx)(D.Provider,{value:o,children:e})),[o]),nestedDialogs:n}}(te);Y=(0,C.OJ)(Y,de,[de]),(0,C.Gw)((()=>{if(!ae)return;const e=ee.current,t=(0,c.vY)(e,!0);t&&"BODY"!==t.tagName&&(e&&(0,c.r3)(e,t)||te.setDisclosureElement(t))}),[te,ae]),X&&(0,I.useEffect)((()=>{if(!le)return;const{disclosureElement:e}=te.getState();if(!e)return;if(!(0,c.iK)(e))return;const t=()=>{let t=!1;const n=()=>{t=!0};e.addEventListener("focusin",n,{capture:!0,once:!0}),(0,j.qx)(e,"mouseup",(()=>{e.removeEventListener("focusin",n,!0),t||(0,P.Qw)(e)}))};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}}),[te,le]),(0,I.useEffect)((()=>{if(!p)return;if(!le)return;if(!re)return;const e=ee.current;return e?e.querySelector("[data-dialog-dismiss]")?void 0:function(e,t){const n=(0,c.Me)(e).createElement("button");return n.type="button",n.tabIndex=-1,n.textContent="Dismiss popup",Object.assign(n.style,{border:"0px",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute",whiteSpace:"nowrap",width:"1px"}),n.addEventListener("click",t),e.prepend(n),()=>{n.removeEventListener("click",t),n.remove()}}(e,te.hide):void 0}),[te,p,le,re]),(0,C.Gw)((()=>{if(ae)return;if(!le)return;if(!re)return;const e=ee.current;return e?k(e):void 0}),[ae,le,re]);const pe=ae&&re;(0,C.Gw)((()=>{if(!se)return;if(!pe)return;const e=ee.current;return function(e,t){const{body:n}=(0,c.Me)(t[0]),r=[];return f(e,t,(t=>{r.push(a(t,h(e),!0))})),(0,u.tS)(a(n,h(e),!0),(()=>r.forEach((e=>e()))))}(se,[e])}),[se,pe]);const fe=(0,C.zX)(F);(0,C.Gw)((()=>{if(!se)return;if(!pe)return;const{disclosureElement:e}=te.getState(),t=[ee.current,...fe()||[],...he.map((e=>e.getState().contentElement))];return p?(0,u.tS)(v(se,t),function(e,t){const n=[],i=t.map((e=>null==e?void 0:e.id));return f(e,t,(e=>{r(e,...i)||n.unshift(k(e,t))})),()=>{n.forEach((e=>e()))}}(se,t)):v(se,[e,...t])}),[se,te,pe,fe,he,p]);const ge=!!U,me=(0,C.yl)(U),[ye,ve]=(0,I.useState)(!1);(0,I.useEffect)((()=>{if(!ae)return;if(!ge)return;if(!re)return;if(!(null==ce?void 0:ce.isConnected))return;const e=$(K,!0)||ce.querySelector("[data-autofocus=true],[autofocus]")||(0,P.YC)(ce,!0,g&&oe)||ce,t=(0,P.EB)(e);me(t?e:null)&&(ve(!0),queueMicrotask((()=>{e.focus(),X&&e.scrollIntoView({block:"nearest",inline:"nearest"})})))}),[ae,ge,re,ce,K,g,oe,me]);const Ae=!!V,be=(0,C.yl)(V),[we,Se]=(0,I.useState)(!1);(0,I.useEffect)((()=>{if(ae)return Se(!0),()=>Se(!1)}),[ae]);const Ce=(0,I.useCallback)(((e,t=!0)=>{const{disclosureElement:n}=te.getState();if(function(e){const t=(0,c.vY)();return!(!t||e&&(0,c.r3)(e,t)||!(0,P.EB)(t))}(e))return;let r=$(H)||n;if(null==r?void 0:r.id){const e=(0,c.Me)(r),t=`[aria-activedescendant="${r.id}"]`,n=e.querySelector(t);n&&(r=n)}if(r&&!(0,P.EB)(r)){const e=(0,c.oq)(r,"[data-dialog]");if(e&&e.id){const t=(0,c.Me)(e),n=`[aria-controls~="${e.id}"]`,i=t.querySelector(n);i&&(r=i)}}const i=r&&(0,P.EB)(r);i||!t?be(i?r:null)&&i&&(null==r||r.focus()):requestAnimationFrame((()=>Ce(e,!1)))}),[te,H,be]);(0,C.Gw)((()=>{if(ae)return;if(!we)return;if(!Ae)return;const e=ee.current;Ce(e)}),[ae,we,re,Ae,Ce]),(0,I.useEffect)((()=>{if(!we)return;if(!Ae)return;const e=ee.current;return()=>Ce(e)}),[we,Ae,Ce]);const Ee=(0,C.yl)(b);(0,I.useEffect)((()=>{if(re&&le)return(0,j.iN)("keydown",(e=>{if("Escape"!==e.key)return;if(e.defaultPrevented)return;const t=ee.current;if(!t)return;if(y(t))return;const n=e.target;if(!n)return;const{disclosureElement:r}=te.getState();("BODY"===n.tagName||(0,c.r3)(t,n)||!r||(0,c.r3)(r,n))&&Ee(e)&&te.hide()}),!0)}),[te,re,le,Ee]);const Ie=(Y=(0,C.OJ)(Y,(e=>(0,_.jsx)(Q,{level:p?1:void 0,children:e})),[p])).hidden,_e=Y.alwaysVisible;Y=(0,C.OJ)(Y,(e=>m?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(x,{store:te,backdrop:m,backdropProps:A,hidden:Ie,alwaysVisible:_e}),e]}):e),[te,m,A,Ie,_e]);const[xe,Pe]=(0,I.useState)(),[ke,Be]=(0,I.useState)();return Y=(0,C.OJ)(Y,(e=>(0,_.jsx)(Z.Q9,{value:te,children:(0,_.jsx)(Z.oE.Provider,{value:Pe,children:(0,_.jsx)(Z.iw.Provider,{value:Be,children:e})})})),[te]),Y=(0,E.EZ)((0,E.ih)({id:se,"data-dialog":"",role:"dialog",tabIndex:d?-1:void 0,"aria-labelledby":xe,"aria-describedby":ke},Y),{ref:(0,C.qq)(ee,Y.ref)}),Y=R((0,E.EZ)((0,E.ih)({},Y),{autoFocusOnShow:ye})),Y=(0,w.fM)((0,E.ih)({store:te},Y)),Y=(0,W.k)((0,E.EZ)((0,E.ih)({},Y),{focusable:d})),z((0,E.EZ)((0,E.ih)({portal:g},Y),{portalRef:ne,preserveTabOrder:oe}))}));function te(e,t=Z.pQ){return(0,A.LM)((n=>{const r=t(),i=n.store||r;return(0,J.Kw)(i,(e=>!n.unmountOnHide||(null==e?void 0:e.mounted)||!!n.open))?(0,_.jsx)(e,(0,E.ih)({},n)):null}))}var ne=te((0,A.LM)((e=>{const t=ee(e);return(0,A.az)("div",t)})),Z.pQ)},16902:(e,t,n)=>{"use strict";n.d(t,{r:()=>c});var r=n(46462),i=n(6236),o=n(14191),s=n(81548),a=n(40077);function l(e={}){var t;const n=null==(t=e.store)?void 0:t.getState();return(0,o.t)((0,a.EZ)((0,a.ih)({},e),{orientation:(0,s.LS)(e.orientation,null==n?void 0:n.orientation,"horizontal"),focusLoop:(0,s.LS)(e.focusLoop,null==n?void 0:n.focusLoop,!0)}))}function c(e={}){const[t,n]=(0,i.oR)(l,e);return function(e,t,n){return(0,r.b)(e,t,n)}(t,n,e)}},27177:(e,t,n)=>{"use strict";n.d(t,{R:()=>r});var r=(0,n(2784).createContext)(!0)},22457:(e,t,n)=>{"use strict";n.d(t,{M:()=>a,n:()=>s});var r=n(6236),i=n(48104),o=n(17122);function s(e,t,n){return(0,i.rf)(t,[n.store,n.disclosure]),(0,r.XS)(e,n,"open","setOpen"),(0,r.XS)(e,n,"mounted","setMounted"),(0,r.XS)(e,n,"animated"),e}function a(e={}){const[t,n]=(0,r.oR)(o.X,e);return s(t,n,e)}},20656:(e,t,n)=>{"use strict";n.d(t,{VZ:()=>a,h9:()=>o,zI:()=>s});var r=n(9587),i=(0,n(45010).re)([r.Lq],[r.al]),o=i.useContext,s=(i.useScopedContext,i.useProviderContext),a=(i.ContextProvider,i.ScopedContextProvider)},19922:(e,t,n)=>{"use strict";n.d(t,{$M:()=>s,P9:()=>o,WS:()=>a});var r=n(59412),i=(0,n(45010).re)([r.qo],[r.ZQ]),o=(i.useContext,i.useScopedContext,i.useProviderContext),s=i.ContextProvider,a=i.ScopedContextProvider},25729:(e,t,n)=>{"use strict";n.d(t,{E:()=>g,m:()=>f});var r=n(75248),i=n(9460),o=n(38346),s=n(10114),a=n(45010),l=n(48104),c=n(70604),u=n(2784),d=n(99224),h=n(81548),p=n(52322),f=(0,a.Bi)((e=>{var t=e,{store:n,resetOnEscape:a=!0,hideOnEnter:f=!0,focusOnMove:g=!0,composite:m,alwaysVisible:y}=t,v=(0,c.S0)(t,["store","resetOnEscape","hideOnEnter","focusOnMove","composite","alwaysVisible"]);const A=(0,i.ht)();n=n||A,(0,h.kG)(n,!1);const b=(0,u.useRef)(null),w=(0,l.Me)(v.id),S=n.useState("value"),C=Array.isArray(S),[E,I]=(0,u.useState)(S),_=n.useState("mounted");(0,u.useEffect)((()=>{_||I(S)}),[_,S]),a=a&&!C;const x=v.onKeyDown,P=(0,l.yl)(a),k=(0,l.yl)(f),B=(0,l.zX)((e=>{null==x||x(e),e.defaultPrevented||("Escape"===e.key&&P(e)&&(null==n||n.setValue(E))," "!==e.key&&"Enter"!==e.key||(0,d.Ud)(e)&&k(e)&&(e.preventDefault(),null==n||n.hide()))}));v=(0,l.OJ)(v,(e=>(0,p.jsx)(i.jC,{value:n,children:e})),[n]);const O=n.useState((e=>{var t;return null==(t=e.labelElement)?void 0:t.id})),N=!!n.combobox;(m=null!=m?m:!N)&&(v=(0,c.ih)({role:"listbox"},v));const D=(0,l.vv)(b,"role",v.role),j=(m||"listbox"===D||"menu"===D||"tree"===D||"grid"===D)&&C||void 0,T=(0,s.xj)(_,v.hidden,y),M=T?(0,c.EZ)((0,c.ih)({},v.style),{display:"none"}):v.style;return v=(0,c.EZ)((0,c.ih)({id:w,"aria-labelledby":O,"aria-multiselectable":j,hidden:T},v),{ref:(0,l.qq)(w?n.setContentElement:null,b,v.ref),style:M,onKeyDown:B}),v=(0,o.Q)((0,c.EZ)((0,c.ih)({store:n},v),{composite:m})),(0,r.p)((0,c.ih)({store:n,typeahead:!N},v))})),g=(0,a.LM)((e=>{const t=f(e);return(0,a.az)("div",t)}))},73026:(e,t,n)=>{"use strict";n.d(t,{M$:()=>l,Vo:()=>c,XT:()=>h,du:()=>d,lK:()=>u});var r=n(9587),i=n(59412),o=n(45010),s=n(2784),a=(0,o.re)([i.qo,r.Lq],[i.ZQ,r.al]),l=(a.useContext,a.useScopedContext),c=a.useProviderContext,u=(a.ContextProvider,a.ScopedContextProvider),d=(0,s.createContext)(void 0),h=(0,s.createContext)(!1)},43198:(e,t,n)=>{"use strict";n.d(t,{Yx:()=>a,dG:()=>l,k$:()=>s});var r=n(70604),i=n(2784),o=n(81548);function s(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function a(e){return function(e){return!!e&&!!(0,i.isValidElement)(e)&&"ref"in e}(e)?e.ref:null}function l(e,t){const n=(0,r.ih)({},e);for(const i in t){if(!(0,o.nr)(t,i))continue;if("className"===i){const r="className";n[r]=e[r]?`${e[r]} ${t[r]}`:t[r];continue}if("style"===i){const i="style";n[i]=e[i]?(0,r.ih)((0,r.ih)({},e[i]),t[i]):t[i];continue}const s=t[i];if("function"==typeof s&&i.startsWith("on")){const t=e[i];if("function"==typeof t){n[i]=(...e)=>{s(...e),t(...e)};continue}}n[i]=s}return n}},74018:(e,t,n)=>{"use strict";n.d(t,{E:()=>A});var r=n(13271),i=n(75235),o=n(45010),s=n(48104),a=n(70604),l=n(2784),c=n(81548),u=(0,o.Bi)((e=>{var t=e,{store:n,shouldRegisterItem:r=!0,getItem:o=c.yR,element:u}=t,d=(0,a.S0)(t,["store","shouldRegisterItem","getItem","element"]);const h=(0,i.dI)();n=n||h;const p=(0,s.Me)(d.id),f=(0,l.useRef)(u);return(0,l.useEffect)((()=>{const e=f.current;if(!p)return;if(!e)return;if(!r)return;const t=o({id:p,element:e});return null==n?void 0:n.renderItem(t)}),[p,r,o,n]),(0,a.EZ)((0,a.ih)({},d),{ref:(0,s.qq)(f,d.ref)})}));(0,o.LM)((e=>{const t=u(e);return(0,o.az)("div",t)}));var d=n(79225),h=n(9587),p=n(6236),f=n(10244),g=n(99224),m=n(52322);function y(e,t=!1){const{top:n}=e.getBoundingClientRect();return t?n+e.clientHeight:n}function v(e,t,n,r=!1){var i;if(!t)return;if(!n)return;const{renderedItems:o}=t.getState(),s=(0,f.wy)(e);if(!s)return;const a=function(e,t=!1){const n=e.clientHeight,{top:r}=e.getBoundingClientRect(),i=1.5*Math.max(.875*n,n-40),o=t?n-i+r:i+r;return"HTML"===e.tagName?o+e.scrollTop:o}(s,r);let l,c;for(let e=0;e<o.length;e+=1){const o=l;if(l=n(e),!l)break;if(l===o)continue;const s=null==(i=(0,d.D2)(t,l))?void 0:i.element;if(!s)continue;const u=y(s,r)-a,h=Math.abs(u);if(r&&u<=0||!r&&u>=0){void 0!==c&&c<h&&(l=o);break}c=h}return l}var A=(0,o.Bi)((e=>{var t=e,{store:n,rowId:i,preventScrollOnKeyDown:o=!1,moveOnKeyPress:y=!0,tabbable:A=!1,getItem:b,"aria-setsize":w,"aria-posinset":S}=t,C=(0,a.S0)(t,["store","rowId","preventScrollOnKeyDown","moveOnKeyPress","tabbable","getItem","aria-setsize","aria-posinset"]);const E=(0,h.$)();n=n||E;const I=(0,s.Me)(C.id),_=(0,l.useRef)(null),x=(0,l.useContext)(h.Ft),P=(0,p.Kw)(n,(e=>i||(e&&(null==x?void 0:x.baseElement)&&x.baseElement===e.baseElement?x.id:void 0))),k=(0,c.EE)(C)&&!C.accessibleWhenDisabled,B=(0,l.useCallback)((e=>{const t=(0,a.EZ)((0,a.ih)({},e),{id:I||e.id,rowId:P,disabled:!!k});return b?b(t):t}),[I,P,k,b]),O=C.onFocus,N=(0,l.useRef)(!1),D=(0,s.zX)((e=>{if(null==O||O(e),e.defaultPrevented)return;if((0,g.Ke)(e))return;if(!I)return;if(!n)return;const{activeId:t,virtualFocus:r,baseElement:i}=n.getState();var o;(function(e,t){return!(0,g.Ud)(e)&&(0,d.Gh)(t,e.target)})(e,n)||(t!==I&&n.setActiveId(I),r&&(0,g.Ud)(e)&&((o=e.currentTarget).isContentEditable||(0,f.eS)(o)||"INPUT"===o.tagName&&!(0,f.iK)(o)||i&&(N.current=!0,e.relatedTarget===i||(0,d.Gh)(n,e.relatedTarget)?(0,d.tt)(i):i.focus())))})),j=C.onBlurCapture,T=(0,s.zX)((e=>{if(null==j||j(e),e.defaultPrevented)return;const t=null==n?void 0:n.getState();(null==t?void 0:t.virtualFocus)&&N.current&&(N.current=!1,e.preventDefault(),e.stopPropagation())})),M=C.onKeyDown,F=(0,s.yl)(o),R=(0,s.yl)(y),L=(0,s.zX)((e=>{if(null==M||M(e),e.defaultPrevented)return;if(!(0,g.Ud)(e))return;if(!n)return;const{currentTarget:t}=e,r=n.getState(),i=n.item(I),o=!!(null==i?void 0:i.rowId),s="horizontal"!==r.orientation,a="vertical"!==r.orientation,l={ArrowUp:(o||s)&&n.up,ArrowRight:(o||a)&&n.next,ArrowDown:(o||s)&&n.down,ArrowLeft:(o||a)&&n.previous,Home:()=>!o||e.ctrlKey?null==n?void 0:n.first():null==n?void 0:n.previous(-1),End:()=>!o||e.ctrlKey?null==n?void 0:n.last():null==n?void 0:n.next(-1),PageUp:()=>v(t,n,null==n?void 0:n.up,!0),PageDown:()=>v(t,n,null==n?void 0:n.down)}[e.key];if(l){const t=l();if(F(e)||void 0!==t){if(!R(e))return;e.preventDefault(),n.move(t)}}})),Q=(0,p.Kw)(n,(e=>(null==e?void 0:e.baseElement)||void 0)),U=(0,l.useMemo)((()=>({id:I,baseElement:Q})),[I,Q]);C=(0,s.OJ)(C,(e=>(0,m.jsx)(h.xt.Provider,{value:U,children:e})),[U]);const V=(0,p.Kw)(n,(e=>!!e&&e.activeId===I)),K=(0,p.Kw)(n,"virtualFocus"),H=function(e,t){const n=t.role,[r,i]=(0,l.useState)(n);return(0,s.Gw)((()=>{const t=e.current;t&&i(t.getAttribute("role")||n)}),[n]),r}(_,C);let G;V&&(function(e){return"option"===e||"treeitem"===e}(H)||K&&function(e){return"option"===e||"tab"===e||"treeitem"===e||"gridcell"===e||"row"===e||"columnheader"===e||"rowheader"===e}(H))&&(G=!0);const Y=(0,p.Kw)(n,(e=>null!=w?w:e&&(null==x?void 0:x.ariaSetSize)&&x.baseElement===e.baseElement?x.ariaSetSize:void 0)),z=(0,p.Kw)(n,(e=>{if(null!=S)return S;if(!e)return;if(!(null==x?void 0:x.ariaPosInSet))return;if(x.baseElement!==e.baseElement)return;const t=e.renderedItems.filter((e=>e.rowId===P));return x.ariaPosInSet+t.findIndex((e=>e.id===I))})),Z=(0,p.Kw)(n,(e=>!(null==e?void 0:e.renderedItems.length)||!e.virtualFocus&&(!!A||e.activeId===I)));return C=(0,a.EZ)((0,a.ih)({id:I,"aria-selected":G,"data-active-item":V?"":void 0},C),{ref:(0,s.qq)(_,C.ref),tabIndex:Z?C.tabIndex:-1,onFocus:D,onBlurCapture:T,onKeyDown:L}),C=(0,r.Y)(C),C=u((0,a.EZ)((0,a.ih)({store:n},C),{getItem:B,shouldRegisterItem:!!I&&C.shouldRegisterItem})),(0,a.EZ)((0,a.ih)({},C),{"aria-setsize":Y,"aria-posinset":z})}));(0,o.W5)((e=>{const t=A(e);return(0,o.az)("button",t)}))},60750:(e,t,n)=>{"use strict";n.d(t,{l:()=>m});var r=n(51329),i=n(73026),o=n(74018),s=n(45010),a=n(48104),l=n(70604),c=n(2784),u=n(10244),d=n(99224),h=n(15212),p=n(81548),f=n(52322),g=(0,s.Bi)((e=>{var t=e,{store:n,value:s,hideOnClick:g,selectValueOnClick:m=!0,setValueOnClick:y,focusOnHover:v=!1,moveOnKeyPress:A=!0,getItem:b}=t,w=(0,l.S0)(t,["store","value","hideOnClick","selectValueOnClick","setValueOnClick","focusOnHover","moveOnKeyPress","getItem"]);const S=(0,i.M$)();n=n||S,(0,p.kG)(n,!1);const C=(0,c.useCallback)((e=>{const t=(0,l.EZ)((0,l.ih)({},e),{value:s});return b?b(t):t}),[s,b]),E=n.useState((e=>Array.isArray(e.selectedValue)));y=null!=y?y:!E,g=null!=g?g:null!=s&&!E;const I=w.onClick,_=(0,a.yl)(y),x=(0,a.yl)(m),P=(0,a.yl)(g),k=(0,a.zX)((e=>{null==I||I(e),e.defaultPrevented||(0,d.XN)(e)||(0,d.wC)(e)||(null!=s&&(x(e)&&(null==n||n.setSelectedValue((e=>Array.isArray(e)?e.includes(s)?e.filter((e=>e!==s)):[...e,s]:s))),_(e)&&(null==n||n.setValue(s))),P(e)&&(null==n||n.move(null),null==n||n.hide()))})),B=w.onKeyDown,O=(0,a.zX)((e=>{if(null==B||B(e),e.defaultPrevented)return;const t=null==n?void 0:n.getState().baseElement;t&&((0,h.H1)(t)||(1===e.key.length||"Backspace"===e.key||"Delete"===e.key)&&(queueMicrotask((()=>t.focus())),(0,u.eS)(t)&&(null==n||n.setValue(t.value))))})),N=n.useState((e=>function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)}(e.selectedValue,s)));E&&null!=N&&(w["aria-selected"]=N),w=(0,a.OJ)(w,(e=>(0,f.jsx)(i.du.Provider,{value:s,children:(0,f.jsx)(i.XT.Provider,{value:null!=N&&N,children:e})})),[s,N]);const D=n.useState("contentElement");w=(0,l.EZ)((0,l.ih)({role:(0,u.lQ)(D),children:s},w),{onClick:k,onKeyDown:O});const j=(0,a.yl)(A);return w=(0,o.E)((0,l.EZ)((0,l.ih)({store:n},w),{getItem:C,moveOnKeyPress:e=>{if(!j(e))return!1;const t=new Event("combobox-item-move"),r=null==n?void 0:n.getState().baseElement;return null==r||r.dispatchEvent(t),!0}})),(0,r.B)((0,l.ih)({store:n,focusOnHover:v},w))})),m=(0,s.W5)((e=>{const t=g(e);return(0,s.az)("div",t)}))},51626:(e,t,n)=>{"use strict";n.d(t,{S:()=>v});var r=n(73026),i=n(10114),o=n(43670),s=n(45010),a=n(48104),l=n(70604),c=n(2784),u=n(99224),d=n(81548),h=n(52322),p=(0,s.Bi)((e=>{var t=e,{store:n,focusable:s=!0,alwaysVisible:p}=t,f=(0,l.S0)(t,["store","focusable","alwaysVisible"]);const g=(0,r.Vo)();n=n||g,(0,d.kG)(n,!1);const m=(0,c.useRef)(null),y=(0,a.Me)(f.id),v=f.onKeyDown,A=(0,a.zX)((e=>{null==v||v(e),e.defaultPrevented||"Escape"===e.key&&(null==n||n.move(null))})),b=(0,c.useRef)(!1),w=f.onFocusVisible,S=(0,a.zX)((e=>{if(null==w||w(e),e.defaultPrevented)return;if("focus"!==e.type)return;if(!n)return;const{virtualFocus:t}=n.getState();if(!t)return;const{relatedTarget:r,currentTarget:i}=e;r&&i.contains(r)||(b.current=!0,n.setState("virtualFocus",!1))})),C=f.onBlur,E=(0,a.zX)((e=>{null==C||C(e),e.defaultPrevented||b.current&&(0,u.N)(e)&&(b.current=!1,null==n||n.setState("virtualFocus",!0))}));f=(0,a.OJ)(f,(e=>(0,h.jsx)(r.lK,{value:n,children:e})),[n]);const I=n.useState("mounted"),_=(0,i.xj)(I,f.hidden,p),x=_?(0,l.EZ)((0,l.ih)({},f.style),{display:"none"}):f.style,P=n.useState((e=>Array.isArray(e.selectedValue))),k=(0,a.vv)(m,"role",f.role),B=("listbox"===k||"tree"===k||"grid"===k)&&P||void 0;return f=(0,l.EZ)((0,l.ih)({id:y,hidden:_,role:"listbox",tabIndex:s?-1:void 0,"aria-multiselectable":B},f),{ref:(0,a.qq)(y?n.setContentElement:null,m,f.ref),style:x,onKeyDown:A,onFocusVisible:S,onBlur:E}),(0,o.k)((0,l.ih)({focusable:s},f))}));(0,s.LM)((e=>{const t=p(e);return(0,s.az)("div",t)}));var f=n(83222),g=n(56278),m=n(10244),y=(0,s.Bi)((e=>{var t=e,{store:n,tabIndex:i,alwaysVisible:o,hideOnInteractOutside:s=!0}=t,a=(0,l.S0)(t,["store","tabIndex","alwaysVisible","hideOnInteractOutside"]);const c=(0,r.Vo)();n=n||c,(0,d.kG)(n,!1);const u=n.useState("baseElement");return a=p((0,l.ih)({store:n,alwaysVisible:o},a)),(0,f.S)((0,l.EZ)((0,l.ih)({store:n,alwaysVisible:o,autoFocusOnShow:!1,autoFocusOnHide:!1,finalFocus:u,preserveTabOrderAnchor:null},a),{modal:!1,hideOnInteractOutside:e=>{var t,r;const i=null==n?void 0:n.getState(),o=null==(t=null==i?void 0:i.contentElement)?void 0:t.id,a=null==(r=null==i?void 0:i.baseElement)?void 0:r.id;return!function(e,...t){if(!e)return!1;if("id"in e){const n=t.filter(Boolean).map((e=>`[aria-controls="${e}"]`)).join(", ");return!!n&&(0,m.wB)(e,n)}return!1}(e.target,o,a)&&("function"==typeof s?s(e):s)}}))})),v=(0,g.L5)((0,s.LM)((e=>{const t=y(e);return(0,s.az)("div",t)})),r.Vo)},32819:(e,t,n)=>{"use strict";n.d(t,{h:()=>v});var r=n(43965),i=n(73026),o=n(38346),s=n(45010),a=n(48104),l=n(70604),c=n(2784),u=n(10244),d=n(99224),h=n(15212),p=n(81548),f=n(28316);function g(e,t,n){if(!n)return!1;const r=e.find((e=>!e.disabled&&e.value));return(null==r?void 0:r.value)===t}function m(e,t){return!!t&&null!=e&&(e=(0,p.Ue)(e),t.length>e.length&&0===t.toLowerCase().indexOf(e.toLowerCase()))}var y=(0,s.Bi)((e=>{var t=e,{store:n,focusable:s=!0,autoSelect:y=!1,showOnChange:v=!0,setValueOnChange:A=!0,showOnMouseDown:b=!0,setValueOnClick:w=!0,showOnKeyDown:S=!0,moveOnKeyPress:C=!0,autoComplete:E="list"}=t,I=(0,l.S0)(t,["store","focusable","autoSelect","showOnChange","setValueOnChange","showOnMouseDown","setValueOnClick","showOnKeyDown","moveOnKeyPress","autoComplete"]);const _=(0,i.Vo)();n=n||_,(0,p.kG)(n,!1);const x=(0,c.useRef)(null),[P,k]=(0,a.NW)(),B=(0,c.useRef)(!1),O=(0,c.useRef)(!1),N=n.useState((e=>!!y&&e.virtualFocus)),D="inline"===E||"both"===E,[j,T]=(0,c.useState)(D);(0,a.is)((()=>{D&&T(!0)}),[D]);const M=n.useState("value"),F=n.useState((e=>D&&j?e.activeValue:void 0)),R=n.useState("renderedItems"),L=n.useState("open"),Q=n.useState("contentElement"),U=(0,c.useMemo)((()=>{if(!D)return M;if(!j)return M;if(g(R,F,N)){if(m(M,F)){const e=(null==F?void 0:F.slice(M.length))||"";return M+e}return M}return F||M}),[D,j,R,F,N,M]);(0,c.useEffect)((()=>{const e=x.current;if(!e)return;const t=()=>T(!0);return e.addEventListener("combobox-item-move",t),()=>{e.removeEventListener("combobox-item-move",t)}}),[]),(0,c.useEffect)((()=>{D&&j&&F&&g(R,F,N)&&m(M,F)&&queueMicrotask((()=>{const e=x.current;e&&(0,u.AU)(e,M.length,F.length)}))}),[P,D,j,F,R,N,M]);const V=(0,c.useRef)(null);(0,c.useEffect)((()=>{if(!L)return;if(!Q)return;const e=(0,u.wy)(Q);if(!e)return;V.current=e;const t=()=>{B.current=!1},r=()=>{if(!n)return;const{activeId:e}=n.getState();null!==e&&e!==n.first()&&(B.current=!1)},i={passive:!0,capture:!0};return e.addEventListener("wheel",t,i),e.addEventListener("scroll",r,i),()=>{e.removeEventListener("wheel",t,!0),e.removeEventListener("scroll",r,!0)}}),[L,Q,n]),(0,a.Gw)((()=>{M&&(O.current||(B.current=!0))}),[M]),(0,a.Gw)((()=>{L||(B.current=!1)}),[L]);const K=n.useState("resetValueOnSelect");(0,a.rf)((()=>{var e,t;if(!n)return;if(!N&&!K)return;if(!B.current)return;const{baseElement:r,contentElement:i,activeId:o}=n.getState();if(!r||(0,h.H1)(r)){if(null==i?void 0:i.hasAttribute("data-placing")){const e=new MutationObserver(k);return e.observe(i,{attributeFilter:["data-placing"]}),()=>e.disconnect()}if(N)n.move(null!=(e=n.first())?e:null);else{const e=null==(t=n.item(o))?void 0:t.element;e&&"scrollIntoView"in e&&e.scrollIntoView({block:"nearest",inline:"nearest"})}}}),[n,P,M,N,K,R]),(0,c.useEffect)((()=>{if(!D)return;const e=x.current;if(!e)return;const t=[e,Q].filter((e=>!!e)),r=e=>{t.every((t=>(0,d.N)(e,t)))&&(null==n||n.setValue(U))};return t.forEach((e=>e.addEventListener("focusout",r))),()=>{t.forEach((e=>e.removeEventListener("focusout",r)))}}),[D,Q,n,U]);const H=I.onChange,G=(0,a.yl)(v),Y=(0,a.yl)(A),z=(0,a.zX)((e=>{if(null==H||H(e),e.defaultPrevented)return;if(!n)return;const{value:t,selectionStart:r,selectionEnd:i}=e.target,o=e.nativeEvent;if(B.current=!0,function(e){return"input"===e.type}(o)&&(o.isComposing&&(B.current=!1,O.current=!0),D)){const e="insertText"===o.inputType||"insertCompositionText"===o.inputType,n=r===t.length;T(e&&n)}if(Y(e)){const o=t===n.getState().value;(0,f.flushSync)((()=>null==n?void 0:n.setValue(t))),(0,u.AU)(e.currentTarget,r,i),D&&N&&o&&k()}G(e)&&n.show(),N&&B.current||n.setActiveId(null)})),Z=I.onCompositionEnd,W=(0,a.zX)((e=>{B.current=!0,O.current=!1,null==Z||Z(e),e.defaultPrevented||N&&k()})),q=I.onMouseDown,J=(0,a.yl)(w),X=(0,a.yl)(b),$=(0,a.zX)((e=>{null==q||q(e),e.defaultPrevented||e.button||e.ctrlKey||n&&(n.setActiveId(null),J(e)&&n.setValue(U),X(e)&&(0,d.qx)(e.currentTarget,"mouseup",n.show))})),ee=I.onKeyDown,te=(0,a.yl)(S),ne=(0,a.zX)((e=>{if(null==ee||ee(e),e.defaultPrevented)return;if(e.ctrlKey)return;if(e.altKey)return;if(e.shiftKey)return;if(e.metaKey)return;if(!n)return;const{open:t,activeId:r}=n.getState();t||null===r&&("ArrowUp"!==e.key&&"ArrowDown"!==e.key||te(e)&&(e.preventDefault(),n.show()))})),re=I.onBlur,ie=(0,a.zX)((e=>{B.current=!1,null==re||re(e),e.defaultPrevented})),oe=(0,a.Me)(I.id),se=function(e){return"inline"===e||"list"===e||"both"===e||"none"===e}(E)?E:void 0;return I=(0,l.EZ)((0,l.ih)({id:oe,role:"combobox","aria-autocomplete":se,"aria-haspopup":(0,u.SK)(Q,"listbox"),"aria-expanded":L,"aria-controls":null==Q?void 0:Q.id,value:U},I),{ref:(0,a.qq)(x,I.ref),onChange:z,onCompositionEnd:W,onMouseDown:$,onKeyDown:ne,onBlur:ie}),I=(0,o.Q)((0,l.EZ)((0,l.ih)({store:n,focusable:s},I),{moveOnKeyPress:e=>!(0,p.Bk)(C,e)&&(D&&T(!0),!0)})),I=(0,r.Q)((0,l.ih)({store:n},I)),(0,l.ih)({autoComplete:"off"},I)})),v=(0,s.LM)((e=>{const t=y(e);return(0,s.az)("input",t)}))},57996:(e,t,n)=>{"use strict";n.d(t,{Q:()=>g});var r=n(51329),i=n(9460),o=n(74018),s=n(45010),a=n(48104),l=n(70604),c=n(2784),u=n(10244),d=n(99224),h=n(81548),p=n(52322),f=(0,s.Bi)((e=>{var t,n=e,{store:s,value:f,getItem:g,hideOnClick:m,setValueOnClick:y=null!=f,preventScrollOnKeyDown:v=!0,focusOnHover:A=!0}=n,b=(0,l.S0)(n,["store","value","getItem","hideOnClick","setValueOnClick","preventScrollOnKeyDown","focusOnHover"]);const w=(0,i.EB)();s=s||w,(0,h.kG)(s,!1);const S=(0,a.Me)(b.id),C=(0,h.EE)(b),E=(0,c.useCallback)((e=>{const t=(0,l.EZ)((0,l.ih)({},e),{value:C?void 0:f,children:f});return g?g(t):t}),[C,f,g]),I=s.useState((e=>Array.isArray(e.value)));m=null!=m?m:null!=f&&!I;const _=b.onClick,x=(0,a.yl)(y),P=(0,a.yl)(m),k=(0,a.zX)((e=>{null==_||_(e),e.defaultPrevented||(0,d.XN)(e)||(0,d.wC)(e)||(x(e)&&null!=f&&(null==s||s.setValue((e=>Array.isArray(e)?e.includes(f)?e.filter((e=>e!==f)):[...e,f]:f))),P(e)&&(null==s||s.hide()))})),B=s.useState((e=>function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)}(e.value,f)));b=(0,a.OJ)(b,(e=>(0,p.jsx)(i.bq.Provider,{value:null!=B&&B,children:e})),[B]);const O=s.useState("contentElement"),N=s.useState((e=>(e.activeId===S||!(null==s?void 0:s.item(e.activeId)))&&null!=e.value&&null!=f&&(Array.isArray(e.value)?e.value[e.value.length-1]===f:e.value===f)));b=(0,l.EZ)((0,l.ih)({id:S,role:(0,u.lQ)(O),"aria-selected":B,children:f},b),{autoFocus:null!=(t=b.autoFocus)?t:N,onClick:k}),b=(0,o.E)((0,l.ih)({store:s,getItem:E,preventScrollOnKeyDown:v},b));const D=(0,a.yl)(A);return(0,r.B)((0,l.EZ)((0,l.ih)({store:s},b),{focusOnHover:e=>{if(!D(e))return!1;const t=null==s?void 0:s.getState();return!!(null==t?void 0:t.open)}}))})),g=(0,s.W5)((e=>{const t=f(e);return(0,s.az)("div",t)}))},2363:(e,t,n)=>{"use strict";n.d(t,{P:()=>C});var r=n(89776),i=n(58915),o=n(45010),s=n(70604),a=n(10244),l=n(81548),c=(0,o.Bi)((e=>{var t=e,{store:n}=t,o=(0,s.S0)(t,["store"]);const c=(0,i.pQ)();n=n||c,(0,l.kG)(n,!1);const u=n.useState("contentElement");return o=(0,s.ih)({"aria-haspopup":(0,a.SK)(u,"dialog")},o),(0,r.q)((0,s.ih)({store:n},o))}));(0,o.LM)((e=>{const t=c(e);return(0,o.az)("button",t)}));var u=n(43965),d=n(59412),h=n(48104),p=n(52322),f=(0,o.Bi)((e=>{var t=e,{store:n}=t,r=(0,s.S0)(t,["store"]);const i=(0,d.yL)();n=n||i,(0,l.kG)(n,!1);const o=r.onClick,a=(0,h.zX)((e=>{null==n||n.setAnchorElement(e.currentTarget),null==o||o(e)}));return r=(0,h.OJ)(r,(e=>(0,p.jsx)(d.ZQ,{value:n,children:e})),[n]),r=(0,s.EZ)((0,s.ih)({},r),{onClick:a}),r=(0,u.Q)((0,s.ih)({store:n},r)),c((0,s.ih)({store:n},r))}));(0,o.LM)((e=>{const t=f(e);return(0,o.az)("button",t)}));var g=n(15945),m=n(75248),y=n(9460),v=n(2784),A=n(23478),b=n(99224);function w(e,t){return()=>{const n=t();if(!n)return;let r=0,i=e.item(n);const o=i;for(;i&&null==i.value;){const n=t(++r);if(!n)return;if(i=e.item(n),i===o)break}return null==i?void 0:i.id}}var S=(0,o.Bi)((e=>{var t=e,{store:n,name:r,form:i,required:o,showOnKeyDown:c=!0,moveOnKeyDown:u=!0,toggleOnClick:d=!1,toggleOnPress:S=!d}=t,C=(0,s.S0)(t,["store","name","form","required","showOnKeyDown","moveOnKeyDown","toggleOnClick","toggleOnPress"]);const E=(0,y.ht)();n=n||E,(0,l.kG)(n,!1),S=!d&&S;const I=C.onKeyDown,_=(0,h.yl)(c),x=(0,h.yl)(u),P=(0,h.yl)(S),k=n.useState("placement").split("-")[0],B=n.useState("value"),O=Array.isArray(B),N=(0,h.zX)((e=>{var t;if(null==I||I(e),e.defaultPrevented)return;if(!n)return;const{orientation:r,items:i,activeId:o}=n.getState();" "!==e.key&&"Enter"!==e.key||P(e)&&(e.preventDefault(),n.toggle());const s="horizontal"!==r,a="vertical"!==r,l=!!(null==(t=i.find((e=>!e.disabled&&null!=e.value)))?void 0:t.rowId),c={ArrowUp:(l||s)&&w(n,n.up),ArrowRight:(l||a)&&w(n,n.next),ArrowDown:(l||s)&&w(n,n.down),ArrowLeft:(l||a)&&w(n,n.previous)}[e.key];c&&x(e)&&(e.preventDefault(),n.move(c()));const u="top"===k||"bottom"===k;({ArrowDown:u,ArrowUp:u,ArrowLeft:"left"===k,ArrowRight:"right"===k})[e.key]&&_(e)&&(e.preventDefault(),n.show(),n.move(o))})),D=C.onMouseDown,j=(0,h.zX)((e=>{if(null==D||D(e),e.defaultPrevented)return;if(e.button)return;if(e.ctrlKey)return;if(!P(e))return;const t=e.currentTarget;(0,b.qx)(t,"focusin",(()=>{null==n||n.setDisclosureElement(t),null==n||n.toggle()}))}));C=(0,h.OJ)(C,(e=>(0,p.jsx)(y.jC,{value:n,children:e})),[n]);const[T,M]=(0,v.useState)(!1),F=(0,v.useRef)(!1);(0,v.useEffect)((()=>{const e=F.current;F.current=!1,e||M(!1)}),[B]);const R=n.useState((e=>{var t;return null==(t=e.labelElement)?void 0:t.id})),L=C["aria-label"],Q=C["aria-labelledby"]||R,U=n.useState("items"),V=(0,v.useMemo)((()=>[...new Set(U.map((e=>e.value)).filter((e=>null!=e)))]),[U]);C=(0,h.OJ)(C,(e=>r?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("select",{style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},tabIndex:-1,"aria-hidden":!0,"aria-label":L,"aria-labelledby":Q,name:r,form:i,required:o,value:B,multiple:O,onFocus:()=>{var e;return null==(e=null==n?void 0:n.getState().selectElement)?void 0:e.focus()},onChange:e=>{var t;F.current=!0,M(!0),null==n||n.setValue(O?(t=e.target,Array.from(t.selectedOptions).map((e=>e.value))):e.target.value)},children:[(0,A.qo)(B).map((e=>null==e||V.includes(e)?null:(0,p.jsx)("option",{value:e,children:e},e))),V.map((e=>(0,p.jsx)("option",{value:e,children:e},e)))]}),e]}):e),[n,L,Q,r,i,o,B,O,V]);const K=(0,p.jsxs)(p.Fragment,{children:[B,(0,p.jsx)(g.n,{})]}),H=n.useState("contentElement");return C=(0,s.EZ)((0,s.ih)({role:"combobox","aria-autocomplete":"none","aria-labelledby":R,"aria-haspopup":(0,a.SK)(H,"listbox"),"data-autofill":T?"":void 0,"data-name":r,children:K},C),{ref:(0,h.qq)(n.setSelectElement,C.ref),onKeyDown:N,onMouseDown:j}),C=f((0,s.ih)({store:n,toggleOnClick:d},C)),(0,m.p)((0,s.ih)({store:n},C))})),C=(0,o.LM)((e=>{const t=S(e);return(0,o.az)("button",t)}))},39661:(e,t,n)=>{"use strict";n.d(t,{o:()=>d});var r=n(38346),i=n(16902),o=n(20656),s=n(45010),a=n(48104),l=n(70604),c=n(52322),u=(0,s.Bi)((e=>{var t=e,{store:n,orientation:s,virtualFocus:u,focusLoop:d,rtl:h}=t,p=(0,l.S0)(t,["store","orientation","virtualFocus","focusLoop","rtl"]);const f=(0,o.zI)();n=n||f;const g=(0,i.r)({store:n,orientation:s,virtualFocus:u,focusLoop:d,rtl:h}),m=g.useState((e=>"both"===e.orientation?void 0:e.orientation));return p=(0,a.OJ)(p,(e=>(0,c.jsx)(o.VZ,{value:g,children:e})),[g]),p=(0,l.ih)({role:"toolbar","aria-orientation":m},p),(0,r.Q)((0,l.ih)({store:g},p))})),d=(0,s.LM)((e=>{const t=u(e);return(0,s.az)("div",t)}))},36153:(e,t,n)=>{"use strict";n.d(t,{Ol:()=>d,Pe:()=>h,Wq:()=>A,dM:()=>Q,md:()=>b,o0:()=>S,r0:()=>w,wg:()=>u}),n(18476),n(18267),n(64883),n(55744),n(25031),n(54089),n(89651),n(81412),n(98513),n(93133),n(93980),n(80037),n(54422),n(63083),n(83701),n(6869);var r=n(31031),i=n(29016);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var o,s=(o=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o;const a=e=>null!=e&&window.Prism.languages.hasOwnProperty(e)?e:void 0;function l(e,t){for(const n of e.childNodes){if((0,r.Re)(n)&&n.tagName===t)return!0;l(n,t)}return!1}const c="data-highlight-language";class u extends r.HX{static getType(){return"code"}static clone(e){return new u(e.__language,e.__key)}constructor(e,t){super(t),this.__language=a(e)}createDOM(e){const t=document.createElement("code");(0,i.Yo)(t,e.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();return n&&t.setAttribute(c,n),t}updateDOM(e,t,n){const r=this.__language,i=e.__language;return r?r!==i&&t.setAttribute(c,r):i&&t.removeAttribute(c),!1}exportDOM(e){const t=document.createElement("pre");(0,i.Yo)(t,e._config.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();return n&&t.setAttribute(c,n),{element:t}}static importDOM(){return{code:e=>null!=e.textContent&&(/\r?\n/.test(e.textContent)||l(e,"BR"))?{conversion:p,priority:1}:null,div:()=>({conversion:f,priority:1}),pre:()=>({conversion:p,priority:0}),table:e=>v(e)?{conversion:g,priority:3}:null,td:e=>{const t=e,n=t.closest("table");return t.classList.contains("js-file-line")||n&&v(n)?{conversion:m,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&v(t)?{conversion:m,priority:3}:null}}}static importJSON(e){const t=d(e.language);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),type:"code",version:1}}insertNewAfter(e,t=!0){const n=this.getChildren(),i=n.length;if(i>=2&&"\n"===n[i-1].getTextContent()&&"\n"===n[i-2].getTextContent()&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===i){n[i-1].remove(),n[i-2].remove();const e=(0,r.BE)();return this.insertAfter(e,t),e}const{anchor:o,focus:s}=e,a=(o.isBefore(s)?o:s).getNode();if((0,r.Gg)(a)){let e=_(a);const t=[];for(;;)if((0,r.rc)(e))t.push((0,r.S3)()),e=e.getNextSibling();else{if(!I(e))break;{let n=0;const r=e.getTextContent(),i=e.getTextContentSize();for(;n<i&&" "===r[n];)n++;if(0!==n&&t.push(E(" ".repeat(n))),n!==i)break;e=e.getNextSibling()}}const n=a.splitText(o.offset)[0],i=0===o.offset?0:1,s=n.getIndexWithinParent()+i,l=a.getParentOrThrow(),c=[(0,r.T)(),...t];l.splice(s,0,c);const u=t[t.length-1];u?u.select():0===o.offset?n.selectPrevious():n.getNextSibling().selectNext(0,0)}if(h(a)){const{offset:t}=e.anchor;a.splice(t,0,[(0,r.T)()]),a.select(t+1,t+1)}return null}canIndent(){return!1}collapseAtStart(){const e=(0,r.BE)();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}setLanguage(e){this.getWritable().__language=a(e)}getLanguage(){return this.getLatest().__language}}function d(e){return(0,r.U2)(new u(e))}function h(e){return e instanceof u}function p(e){return{node:d(e.getAttribute(c))}}function f(e){const t=e,n=y(t);return n||function(e){let t=e.parentElement;for(;null!==t;){if(y(t))return!0;t=t.parentElement}return!1}(t)?{node:n?d():null}:{node:null}}function g(){return{node:d()}}function m(){return{node:null}}function y(e){return null!==e.style.fontFamily.match("monospace")}function v(e){return e.classList.contains("js-file-line-container")}const A={c:"C",clike:"C-like",cpp:"C++",css:"CSS",html:"HTML",java:"Java",js:"JavaScript",markdown:"Markdown",objc:"Objective-C",plain:"Plain Text",powershell:"PowerShell",py:"Python",rust:"Rust",sql:"SQL",swift:"Swift",typescript:"TypeScript",xml:"XML"},b={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function w(e){return b[e]||e}class S extends r.R2{constructor(e,t,n){super(e,n),this.__highlightType=t}static getType(){return"code-highlight"}static clone(e){return new S(e.__text,e.__highlightType||void 0,e.__key)}getHighlightType(){return this.getLatest().__highlightType}canHaveFormat(){return!1}createDOM(e){const t=super.createDOM(e),n=C(e.theme,this.__highlightType);return(0,i.Yo)(t,n),t}updateDOM(e,t,n){const r=super.updateDOM(e,t,n),o=C(n.theme,e.__highlightType),s=C(n.theme,this.__highlightType);return o!==s&&(o&&(0,i.PS)(t,o),s&&(0,i.Yo)(t,s)),r}static importJSON(e){const t=E(e.text,e.highlightType);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType(),type:"code-highlight",version:1}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return d()}}function C(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function E(e,t){return(0,r.U2)(new S(e,t))}function I(e){return e instanceof S}function _(e){let t=e,n=e;for(;I(n)||(0,r.rc)(n);)t=n,n=n.getPreviousSibling();return t}function x(e){let t=e,n=e;for(;I(n)||(0,r.rc)(n);)t=n,n=n.getNextSibling();return t}const P={defaultLanguage:"javascript",tokenize(e,t){return window.Prism.tokenize(e,window.Prism.languages[t||""]||window.Prism.languages[this.defaultLanguage])}};function k(e,t,n){const i=e.getParent();h(i)?N(i,t,n):I(e)&&e.replace((0,r.MX)(e.__text))}function B(e,t){const n=t.getElementByKey(e.getKey());if(null===n)return;const i=e.getChildren(),o=i.length;if(o===n.__cachedChildrenLength)return;n.__cachedChildrenLength=o;let s="1",a=1;for(let e=0;e<o;e++)(0,r.A3)(i[e])&&(s+="\n"+ ++a);n.setAttribute("data-gutter",s)}const O=new Set;function N(e,t,n){const i=e.getKey();O.has(i)||(O.add(i),void 0===e.getLanguage()&&e.setLanguage(n.defaultLanguage),t.update((()=>{!function(e,t){const n=(0,r.gI)(e);if(!h(n)||!n.isAttached())return;const i=(0,r.dL)();if(!(0,r.OP)(i))return void t();const o=i.anchor,s=o.offset,a="element"===o.type&&(0,r.A3)(n.getChildAtIndex(o.offset-1));let l=0;if(!a){const e=o.getNode();l=s+e.getPreviousSiblings().reduce(((e,t)=>e+t.getTextContentSize()),0)}t()&&(a?o.getNode().select(s,s):n.getChildren().some((e=>{const t=(0,r.Gg)(e);if(t||(0,r.A3)(e)){const n=e.getTextContentSize();if(t&&n>=l)return e.select(l,l),!0;l-=n}return!1})))}(i,(()=>{const t=(0,r.gI)(i);if(!h(t)||!t.isAttached())return!1;const o=t.getTextContent(),s=D(n.tokenize(o,t.getLanguage()||n.defaultLanguage)),a=function(e,t){let n=0;for(;n<e.length&&j(e[n],t[n]);)n++;const r=e.length,i=t.length,o=Math.min(r,i)-n;let s=0;for(;s<o;)if(s++,!j(e[r-s],t[i-s])){s--;break}const a=r-s;return{from:n,nodesForReplacement:t.slice(n,i-s),to:a}}(t.getChildren(),s),{from:l,to:c,nodesForReplacement:u}=a;return!(l===c&&!u.length||(e.splice(l,c-l,u),0))}))}),{onUpdate:()=>{O.delete(i)},skipTransforms:!0}))}function D(e,t){const n=[];for(const i of e)if("string"==typeof i){const e=i.split(/(\n|\t)/),o=e.length;for(let i=0;i<o;i++){const o=e[i];"\n"===o||"\r\n"===o?n.push((0,r.T)()):"\t"===o?n.push((0,r.S3)()):o.length>0&&n.push(E(o,t))}}else{const{content:e}=i;"string"==typeof e?n.push(...D([e],i.type)):Array.isArray(e)&&n.push(...D(e,i.type))}return n}function j(e,t){return I(e)&&I(t)&&e.__text===t.__text&&e.__highlightType===t.__highlightType||(0,r.rc)(e)&&(0,r.rc)(t)||(0,r.A3)(e)&&(0,r.A3)(t)}function T(e){if(!(0,r.OP)(e))return!1;const t=e.anchor.getNode(),n=e.focus.getNode();if(t.is(n)&&h(t))return!0;const i=t.getParent();return h(i)&&i.is(n.getParent())}function M(e){const t=e.getNodes(),n=[[]];if(1===t.length&&h(t[0]))return n;let i=n[0];for(let e=0;e<t.length;e++){const o=t[e];I(o)||(0,r.rc)(o)||(0,r.A3)(o)||s(169),(0,r.A3)(o)?0!==e&&i.length>0&&(i=[],n.push(i)):i.push(o)}return n}function F(e){const t=(0,r.dL)();if(!(0,r.OP)(t)||!T(t))return!1;const n=M(t),i=n.length;if(n.length>1){for(let t=0;t<i;t++){const i=n[t];if(i.length>0){let n=i[0];0===t&&(n=_(n)),null!==n&&(e===r.PU?n.insertBefore((0,r.S3)()):(0,r.rc)(n)&&n.remove())}}return!0}const o=t.getNodes()[0];if(h(o)||I(o)||(0,r.rc)(o)||(0,r.A3)(o)||s(171),h(o))return e===r.PU&&t.insertNodes([(0,r.S3)()]),!0;const a=_(o);return null===a&&s(172),e===r.PU?(0,r.A3)(a)?a.insertAfter((0,r.S3)()):a.insertBefore((0,r.S3)()):(0,r.rc)(a)&&a.remove(),!0}function R(e,t){const n=(0,r.dL)();if(!(0,r.OP)(n))return!1;const{anchor:i,focus:o}=n,s=i.offset,a=o.offset,l=i.getNode(),c=o.getNode(),u=e===r._0;if(!T(n)||!I(l)&&!(0,r.rc)(l)||!I(c)&&!(0,r.rc)(c))return!1;if(!t.altKey){if(n.isCollapsed()){const e=l.getParentOrThrow();if(u&&0===s&&null===l.getPreviousSibling()){if(null===e.getPreviousSibling())return e.selectPrevious(),t.preventDefault(),!0}else if(!u&&s===l.getTextContentSize()&&null===l.getNextSibling()&&null===e.getNextSibling())return e.selectNext(),t.preventDefault(),!0}return!1}let d,h;if(l.isBefore(c)?(d=_(l),h=x(c)):(d=_(c),h=x(l)),null==d||null==h)return!1;const p=d.getNodesBetween(h);for(let e=0;e<p.length;e++){const t=p[e];if(!I(t)&&!(0,r.rc)(t)&&!(0,r.A3)(t))return!1}t.preventDefault(),t.stopPropagation();const f=u?d.getPreviousSibling():h.getNextSibling();if(!(0,r.A3)(f))return!0;const g=u?f.getPreviousSibling():f.getNextSibling();if(null==g)return!0;const m=I(g)||(0,r.rc)(g)||(0,r.A3)(g)?u?_(g):x(g):null;let y=null!=m?m:g;return f.remove(),p.forEach((e=>e.remove())),e===r._0?(p.forEach((e=>y.insertBefore(e))),y.insertBefore(f)):(y.insertAfter(f),y=f,p.forEach((e=>{y.insertAfter(e),y=e}))),n.setTextNodeRange(l,s,c,a),!0}function L(e,t){const n=(0,r.dL)();if(!(0,r.OP)(n))return!1;const{anchor:i,focus:o}=n,a=i.getNode(),l=o.getNode(),c=e===r.OJ;if(!I(a)&&!(0,r.rc)(a)||!I(l)&&!(0,r.rc)(l))return!1;if(c){const e=function(e,t){let n=null,i=null,o=e,a=t,l=e.getTextContent();for(;;){if(0===a){if(o=o.getPreviousSibling(),null===o)break;if(I(o)||(0,r.rc)(o)||(0,r.A3)(o)||s(167),(0,r.A3)(o)){n={node:o,offset:1};break}a=Math.max(0,o.getTextContentSize()-1),l=o.getTextContent()}else a--;const e=l[a];I(o)&&" "!==e&&(i={node:o,offset:a})}if(null!==i)return i;let c=null;if(t<e.getTextContentSize())I(e)&&(c=e.getTextContent()[t]);else{const t=e.getNextSibling();I(t)&&(c=t.getTextContent()[0])}if(null!==c&&" "!==c)return n;{const i=function(e,t){let n=e,i=t,o=e.getTextContent(),s=e.getTextContentSize();for(;;){if(!I(n)||i===s){if(n=n.getNextSibling(),null===n||(0,r.A3)(n))return null;I(n)&&(i=0,o=n.getTextContent(),s=n.getTextContentSize())}if(I(n)){if(" "!==o[i])return{node:n,offset:i};i++}}}(e,t);return null!==i?i:n}}(l,o.offset);if(null!==e){const{node:t,offset:i}=e;(0,r.A3)(t)?t.selectNext(0,0):n.setTextNodeRange(t,i,t,i)}else l.getParentOrThrow().selectStart()}else(function(e){const t=x(e);return(0,r.A3)(t)&&s(168),t})(l).select();return t.preventDefault(),t.stopPropagation(),!0}function Q(e,t){if(!e.hasNodes([u,S]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return null==t&&(t=P),(0,i.qV)(e.registerMutationListener(u,(t=>{e.update((()=>{for(const[n,i]of t)if("destroyed"!==i){const t=(0,r.gI)(n);null!==t&&B(t,e)}}))})),e.registerNodeTransform(u,(n=>N(n,e,t))),e.registerNodeTransform(r.R2,(n=>k(n,e,t))),e.registerNodeTransform(S,(n=>k(n,e,t))),e.registerCommand(r.dB,(t=>{const n=function(e){const t=(0,r.dL)();if(!(0,r.OP)(t)||!T(t))return null;const n=e?r.cz:r.PU,i=e?r.cz:r.cA;if(M(t).length>1)return n;const o=t.getNodes()[0];if(h(o)||I(o)||(0,r.rc)(o)||(0,r.A3)(o)||s(170),h(o))return n;const a=_(o),l=x(o),c=t.anchor,u=t.focus;let d,p;return u.isBefore(c)?(d=u,p=c):(d=c,p=u),null!==a&&null!==l&&d.key===a.getKey()&&0===d.offset&&p.key===l.getKey()&&p.offset===l.getTextContentSize()?n:i}(t.shiftKey);return null!==n&&(t.preventDefault(),e.dispatchCommand(n,void 0),!0)}),r.KB),e.registerCommand(r.cA,(()=>!!T((0,r.dL)())&&((0,r.od)([(0,r.S3)()]),!0)),r.KB),e.registerCommand(r.PU,(e=>F(r.PU)),r.KB),e.registerCommand(r.cz,(e=>F(r.cz)),r.KB),e.registerCommand(r._0,(e=>R(r._0,e)),r.KB),e.registerCommand(r.Zb,(e=>R(r.Zb,e)),r.KB),e.registerCommand(r.g8,(e=>L(r.g8,e)),r.KB),e.registerCommand(r.OJ,(e=>L(r.OJ,e)),r.KB))}},31537:(e,t,n)=>{"use strict";n.d(t,{DT:()=>o,Vu:()=>s});var r=n(29016),i=n(31031);class o extends i.R2{static getType(){return"hashtag"}static clone(e){return new o(e.__text,e.__key)}constructor(e,t){super(e,t)}createDOM(e){const t=super.createDOM(e);return(0,r.Yo)(t,e.theme.hashtag),t}static importJSON(e){const t=s(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"hashtag"}}canInsertTextBefore(){return!1}isTextEntity(){return!0}}function s(e=""){return(0,i.U2)(new o(e))}},67743:(e,t,n)=>{"use strict";n.d(t,{D:()=>i});var r=n(31031);function i(e){const t=(0,r.Jh)(e);return t._headless=!0,["registerDecoratorListener","registerRootListener","registerMutationListener","getRootElement","setRootElement","getElementByKey","focus","blur"].forEach((e=>{t[e]=()=>{throw new Error(`${e} is not supported in headless mode`)}})),t}},94900:(e,t,n)=>{"use strict";n.d(t,{S:()=>s,s:()=>o});var r=n(64739),i=n(31031);function o(e,t){const n=t.body?t.body.childNodes:[];let r=[];const o=[];for(let t=0;t<n.length;t++){const i=n[t];if(!l.has(i.nodeName)){const t=c(i,e,o,!1);null!==t&&(r=r.concat(t))}}return function(e){for(const t of e)t.getNextSibling()instanceof i.RG&&t.insertAfter((0,i.T)());for(const t of e){const e=t.getChildren();for(const n of e)t.insertBefore(n);t.remove()}}(o),r}function s(e,t){if("undefined"==typeof document||"undefined"==typeof window&&void 0===global.window)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const n=document.createElement("div"),r=(0,i.Gv)().getChildren();for(let i=0;i<r.length;i++)a(e,r[i],n,t);return n.innerHTML}function a(e,t,n,o=null){let s=null===o||t.isSelected(o);const l=(0,i.F7)(t)&&t.excludeFromCopy("html");let c=t;if(null!==o){let e=(0,r.B3)(t);e=(0,i.Gg)(e)&&null!==o?(0,r.bA)(o,e):e,c=e}const u=(0,i.F7)(c)?c.getChildren():[],d=e._nodes.get(c.getType());let h;h=d&&void 0!==d.exportDOM?d.exportDOM(e,c):c.exportDOM(e);const{element:p,after:f}=h;if(!p)return!1;const g=document.createDocumentFragment();for(let n=0;n<u.length;n++){const r=u[n],l=a(e,r,g,o);!s&&(0,i.F7)(t)&&l&&t.extractWithChild(r,o,"html")&&(s=!0)}if(s&&!l){if((0,i.Re)(p)&&p.append(g),n.append(p),f){const e=f.call(c,p);e&&p.replaceWith(e)}}else n.append(g);return s}const l=new Set(["STYLE","SCRIPT"]);function c(e,t,n,r,o=new Map,s){let a=[];if(l.has(e.nodeName))return a;let u=null;const d=function(e,t){const{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase());let i=null;if(void 0!==r)for(const t of r){const n=t(e);null!==n&&(null===i||(i.priority||0)<(n.priority||0))&&(i=n)}return null!==i?i.conversion:null}(e,t),h=d?d(e):null;let p=null;if(null!==h){p=h.after;const t=h.node;if(u=Array.isArray(t)?t[t.length-1]:t,null!==u){for(const[,e]of o)if(u=e(u,s),!u)break;u&&a.push(...Array.isArray(t)?t:[u])}null!=h.forChild&&o.set(e.nodeName,h.forChild)}const f=e.childNodes;let g=[];const m=(null==u||!(0,i._v)(u))&&(null!=u&&(0,i.ek)(u)||r);for(let e=0;e<f.length;e++)g.push(...c(f[e],t,n,m,new Map(o),u));return null!=p&&(g=p(g)),(0,i.lv)(e)&&(g=function(e,t,n){const r=e.style.textAlign,o=[];let s=[];for(let e=0;e<t.length;e++){const a=t[e];if((0,i.ek)(a))a.setFormat(r),o.push(a);else if(s.push(a),e===t.length-1||e<t.length-1&&(0,i.ek)(t[e+1])){const e=n();e.setFormat(r),e.append(...s),o.push(e),s=[]}}return o}(e,g,m?()=>{const e=new i.RG;return n.push(e),e}:i.BE)),null==u?a=a.concat(g):(0,i.F7)(u)&&u.append(...g),a}},93261:(e,t,n)=>{"use strict";n.d(t,{GR:()=>s,Ol:()=>d,Pq:()=>c,Rf:()=>f,Xp:()=>h,k0:()=>p,qp:()=>u,zV:()=>l});var r=n(29016),i=n(31031);const o=new Set(["http:","https:","mailto:","sms:","tel:"]);class s extends i.HX{static getType(){return"link"}static clone(e){return new s(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e,t={},n){super(n);const{target:r=null,rel:i=null,title:o=null}=t;this.__url=e,this.__target=r,this.__rel=i,this.__title=o}createDOM(e){const t=document.createElement("a");return t.href=this.sanitizeUrl(this.__url),null!==this.__target&&(t.target=this.__target),null!==this.__rel&&(t.rel=this.__rel),null!==this.__title&&(t.title=this.__title),(0,r.Yo)(t,e.theme.link),t}updateDOM(e,t,n){const r=this.__url,i=this.__target,o=this.__rel,s=this.__title;return r!==e.__url&&(t.href=r),i!==e.__target&&(i?t.target=i:t.removeAttribute("target")),o!==e.__rel&&(o?t.rel=o:t.removeAttribute("rel")),s!==e.__title&&(s?t.title=s:t.removeAttribute("title")),!1}static importDOM(){return{a:e=>({conversion:a,priority:1})}}static importJSON(e){const t=l(e.url,{rel:e.rel,target:e.target,title:e.title});return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}sanitizeUrl(e){try{const t=new URL(e);if(!o.has(t.protocol))return"about:blank"}catch(t){return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(e){this.getWritable().__url=e}getTarget(){return this.getLatest().__target}setTarget(e){this.getWritable().__target=e}getRel(){return this.getLatest().__rel}setRel(e){this.getWritable().__rel=e}getTitle(){return this.getLatest().__title}setTitle(e){this.getWritable().__title=e}insertNewAfter(e,t=!0){const n=l(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!(0,i.OP)(t))return!1;const r=t.anchor.getNode(),o=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(o)&&t.getTextContent().length>0}}function a(e){let t=null;if((0,i.bg)(e)){const n=e.textContent;(null!==n&&""!==n||e.children.length>0)&&(t=l(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function l(e,t){return(0,i.U2)(new s(e,t))}function c(e){return e instanceof s}class u extends s{static getType(){return"autolink"}static clone(e){return new u(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}static importJSON(e){const t=d(e.url,{rel:e.rel,target:e.target,title:e.title});return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(e,t=!0){const n=this.getParentOrThrow().insertNewAfter(e,t);if((0,i.F7)(n)){const e=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return n.append(e),e}return null}}function d(e,t){return(0,i.U2)(new u(e,t))}function h(e){return e instanceof u}const p=(0,i.fA)("TOGGLE_LINK_COMMAND");function f(e,t={}){const{target:n,title:r}=t,o=void 0===t.rel?"noreferrer":t.rel,s=(0,i.dL)();if(!(0,i.OP)(s))return;const a=s.extract();if(null===e)a.forEach((e=>{const t=e.getParent();if(c(t)){const e=t.getChildren();for(let n=0;n<e.length;n++)t.insertBefore(e[n]);t.remove()}}));else{if(1===a.length){const t=function(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}(a[0],c);if(null!==t)return t.setURL(e),void 0!==n&&t.setTarget(n),null!==o&&t.setRel(o),void(void 0!==r&&t.setTitle(r))}let t=null,s=null;a.forEach((a=>{const u=a.getParent();if(u!==s&&null!==u&&(!(0,i.F7)(a)||a.isInline())){if(c(u))return s=u,u.setURL(e),void 0!==n&&u.setTarget(n),null!==o&&s.setRel(o),void(void 0!==r&&s.setTitle(r));if(u.is(t)||(t=u,s=l(e,{rel:o,target:n,title:r}),c(u)?null===a.getPreviousSibling()?u.insertBefore(s):u.insertAfter(s):a.insertBefore(s)),c(a)){if(a.is(s))return;if(null!==s){const e=a.getChildren();for(let t=0;t<e.length;t++)s.append(e[t])}a.remove()}else null!==s&&s.append(a)}}))}}},22311:(e,t,n)=>{"use strict";n.d(t,{A3:()=>j,B3:()=>T,EG:()=>x,FH:()=>N,GS:()=>F,I3:()=>D,J_:()=>g,NK:()=>b,QG:()=>_,d1:()=>M,oU:()=>I,sp:()=>v,up:()=>d});var r=n(31031),i=n(29016),o=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)};function s(e){let t=e.getParent();D(t)||o(40);let n=t;for(;null!==n;)n=n.getParent(),D(n)&&(t=n);return t}function a(e){let t=[];const n=e.getChildren().filter(_);for(let e=0;e<n.length;e++){const r=n[e],i=r.getFirstChild();D(i)?t=t.concat(a(i)):t.push(r)}return t}function l(e){return _(e)&&D(e.getFirstChild())}function c(e){return I().append(e)}function u(e,t){return _(e)&&(0===t.length||1===t.length&&e.is(t[0])&&0===e.getChildrenSize())}function d(e,t){e.update((()=>{const e=(0,r.dL)();if(null!==e){const n=e.getNodes();if((0,r.OP)(e)){const i=e.getStartEndPoints();null===i&&o(143);const[s]=i,a=s.getNode(),l=a.getParent();if(u(a,n)){const e=N(t);if((0,r._v)(l)){a.replace(e);const t=I();(0,r.F7)(a)&&(t.setFormat(a.getFormatType()),t.setIndent(a.getIndent())),e.append(t)}else if(_(a)){const t=a.getParentOrThrow();h(e,t.getChildren()),t.replace(e)}return}}const i=new Set;for(let e=0;e<n.length;e++){const o=n[e];if(!(0,r.F7)(o)||!o.isEmpty()||_(o)||i.has(o.getKey())){if((0,r.H2)(o)){let e=o.getParent();for(;null!=e;){const n=e.getKey();if(D(e)){if(!i.has(n)){const r=N(t);h(r,e.getChildren()),e.replace(r),i.add(n)}break}{const o=e.getParent();if((0,r._v)(o)&&!i.has(n)){i.add(n),p(e,t);break}e=o}}}}else p(o,t)}}}))}function h(e,t){e.splice(e.getChildrenSize(),0,t)}function p(e,t){if(D(e))return e;const n=e.getPreviousSibling(),r=e.getNextSibling(),i=I();if(i.setFormat(e.getFormatType()),i.setIndent(e.getIndent()),h(i,e.getChildren()),D(n)&&t===n.getListType())return n.append(i),e.remove(),D(r)&&t===r.getListType()&&(h(n,r.getChildren()),r.remove()),n;if(D(r)&&t===r.getListType())return r.getFirstChildOrThrow().insertBefore(i),e.remove(),r;{const n=N(t);return n.append(i),e.replace(n),n}}function f(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&l(n)&&l(r)&&(f(n.getFirstChild(),r.getFirstChild()),r.remove());const i=t.getChildren();i.length>0&&e.append(...i),t.remove()}function g(e){e.update((()=>{const e=(0,r.dL)();if((0,r.OP)(e)){const t=new Set,n=e.getNodes(),o=e.anchor.getNode();if(u(o,n))t.add(s(o));else for(let e=0;e<n.length;e++){const o=n[e];if((0,r.H2)(o)){const e=(0,i.yD)(o,b);null!=e&&t.add(s(e))}}for(const n of t){let t=n;const i=a(n);for(const n of i){const i=(0,r.BE)();h(i,n.getChildren()),t.insertAfter(i),t=i,n.__key===e.anchor.key&&e.anchor.set(i.getKey(),0,"element"),n.__key===e.focus.key&&e.focus.set(i.getKey(),0,"element"),n.remove()}n.remove()}}}))}function m(e){const t=new Set;if(l(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(l(r)&&l(i)){const n=i.getFirstChild();if(D(n)){n.append(e);const i=r.getFirstChild();D(i)&&(h(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(l(r)){const t=r.getFirstChild();if(D(t)){const n=t.getFirstChild();null!==n&&n.insertBefore(e)}}else if(l(i)){const t=i.getFirstChild();D(t)&&t.append(e)}else if(D(n)){const t=I(),o=N(n.getListType());t.append(o),o.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function y(e){if(l(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(D(n?n.getParent():void 0)&&_(n)&&D(t)){const r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{const r=t.getListType(),i=I(),o=N(r);i.append(o),e.getPreviousSiblings().forEach((e=>o.append(e)));const s=I(),a=N(r);s.append(a),h(a,e.getNextSiblings()),n.insertBefore(i),n.insertAfter(s),n.replace(e)}}}function v(){const e=(0,r.dL)();if(!(0,r.OP)(e)||!e.isCollapsed())return!1;const t=e.anchor.getNode();if(!_(t)||0!==t.getChildrenSize())return!1;const n=s(t),i=t.getParent();D(i)||o(40);const a=i.getParent();let l;if((0,r._v)(a))l=(0,r.BE)(),n.insertAfter(l);else{if(!_(a))return!1;l=I(),a.insertAfter(l)}l.select();const c=t.getNextSiblings();if(c.length>0){const e=N(i.getListType());if((0,r.Rl)(l))l.insertAfter(e);else{const t=I();t.append(e),l.insertAfter(t)}c.forEach((t=>{t.remove(),e.append(t)}))}return function(e){let t=e;for(;null==t.getNextSibling()&&null==t.getPreviousSibling();){const e=t.getParent();if(null==e||!_(t)&&!D(t))break;t=e}t.remove()}(t),!0}function A(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}class b extends r.HX{static getType(){return"listitem"}static clone(e){return new b(e.__value,e.__checked,e.__key)}constructor(e,t,n){super(n),this.__value=void 0===e?1:e,this.__checked=t}createDOM(e){const t=document.createElement("li"),n=this.getParent();return D(n)&&"check"===n.getListType()&&S(t,this,null),t.value=this.__value,w(t,e.theme,this),t}updateDOM(e,t,n){const r=this.getParent();return D(r)&&"check"===r.getListType()&&S(t,this,e),t.value=this.__value,w(t,n.theme,this),!1}static transform(){return e=>{if(_(e)||o(144),null==e.__checked)return;const t=e.getParent();D(t)&&"check"!==t.getListType()&&null!=e.getChecked()&&e.setChecked(void 0)}}static importDOM(){return{li:()=>({conversion:C,priority:0})}}static importJSON(e){const t=I();return t.setChecked(e.checked),t.setValue(e.value),t.setFormat(e.format),t.setDirection(e.direction),t}exportDOM(e){const t=this.createDOM(e._config);return t.style.textAlign=this.getFormatType(),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if((0,r.F7)(n)&&this.canMergeWith(n)){const e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(_(e))return super.replace(e);this.setIndent(0);const n=this.getParentOrThrow();if(!D(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{const t=N(n.getListType());let r=this.getNextSibling();for(;r;){const e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}return t&&((0,r.F7)(e)||o(139),this.getChildren().forEach((t=>{e.append(t)}))),this.remove(),0===n.getChildrenSize()&&n.remove(),e}insertAfter(e,t=!0){const n=this.getParentOrThrow();if(D(n)||o(39),_(e))return super.insertAfter(e,t);const r=this.getNextSiblings();if(n.insertAfter(e,t),0!==r.length){const i=N(n.getListType());r.forEach((e=>i.append(e))),e.insertAfter(i,t)}return e}remove(e){const t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&l(t)&&l(n)&&(f(t.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(e,t=!0){const n=I(null==this.__checked&&void 0);return this.insertAfter(n,t),n}collapseAtStart(e){const t=(0,r.BE)();this.getChildren().forEach((e=>t.append(e)));const n=this.getParentOrThrow(),i=n.getParentOrThrow(),o=_(i);if(1===n.getChildrenSize())if(o)n.remove(),i.select();else{n.insertBefore(t),n.remove();const r=e.anchor,i=e.focus,o=t.getKey();"element"===r.type&&r.getNode().is(this)&&r.set(o,r.offset,"element"),"element"===i.type&&i.getNode().is(this)&&i.set(o,i.offset,"element")}else n.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){this.getWritable().__value=e}getChecked(){const e=this.getLatest();let t;const n=this.getParent();return D(n)&&(t=n.getListType()),"check"===t?Boolean(e.__checked):void 0}setChecked(e){this.getWritable().__checked=e}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){const e=this.getParent();if(null===e)return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;_(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){"number"==typeof e&&e>-1||o(117);let t=this.getIndent();for(;t!==e;)t<e?(m(this),t++):(y(this),t--);return this}canInsertAfter(e){return _(e)}canReplaceWith(e){return _(e)}canMergeWith(e){return(0,r.Rl)(e)||_(e)}extractWithChild(e,t){if(!(0,r.OP)(t))return!1;const n=t.anchor.getNode(),i=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(i)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return N("bullet")}}function w(e,t,n){const r=[],o=[],s=t.list,a=s?s.listitem:void 0;let l;if(s&&s.nested&&(l=s.nested.listitem),void 0!==a&&r.push(...A(a)),s){const e=n.getParent(),t=D(e)&&"check"===e.getListType(),i=n.getChecked();t&&!i||o.push(s.listitemUnchecked),t&&i||o.push(s.listitemChecked),t&&r.push(i?s.listitemChecked:s.listitemUnchecked)}if(void 0!==l){const e=A(l);n.getChildren().some((e=>D(e)))?r.push(...e):o.push(...e)}o.length>0&&(0,i.PS)(e,...o),r.length>0&&(0,i.Yo)(e,...r)}function S(e,t,n,r){D(t.getFirstChild())?(e.removeAttribute("role"),e.removeAttribute("tabIndex"),e.removeAttribute("aria-checked")):(e.setAttribute("role","checkbox"),e.setAttribute("tabIndex","-1"),n&&t.__checked===n.__checked||e.setAttribute("aria-checked",t.getChecked()?"true":"false"))}function C(e){if(e.classList.contains("task-list-item"))for(const t of e.children)if("INPUT"===t.tagName)return E(t);const t=e.getAttribute("aria-checked");return{node:I("true"===t||"false"!==t&&void 0)}}function E(e){return"checkbox"!==e.getAttribute("type")?{node:null}:{node:I(e.hasAttribute("checked"))}}function I(e){return(0,r.U2)(new b(void 0,e))}function _(e){return e instanceof b}class x extends r.HX{static getType(){return"list"}static clone(e){const t=e.__listType||O[e.__tag];return new x(t,e.__start,e.__key)}constructor(e,t,n){super(n);const r=O[e]||e;this.__listType=r,this.__tag="number"===r?"ol":"ul",this.__start=t}getTag(){return this.__tag}setListType(e){const t=this.getWritable();t.__listType=e,t.__tag="number"===e?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(e,t){const n=this.__tag,r=document.createElement(n);return 1!==this.__start&&r.setAttribute("start",String(this.__start)),r.__lexicalListType=this.__listType,P(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||(P(t,n.theme,this),!1)}static transform(){return e=>{D(e)||o(163),function(e){const t=e.getNextSibling();D(t)&&e.getListType()===t.getListType()&&f(e,t)}(e),function(e){const t="check"!==e.getListType();let n=e.getStart();for(const r of e.getChildren())_(r)&&(r.getValue()!==n&&r.setValue(n),t&&null!=r.getChecked()&&r.setChecked(void 0),D(r.getFirstChild())||n++)}(e)}}static importDOM(){return{ol:()=>({conversion:B,priority:0}),ul:()=>({conversion:B,priority:0})}}static importJSON(e){const t=N(e.listType,e.start);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportDOM(e){const{element:t}=super.exportDOM(e);return t&&(0,r.Re)(t)&&(1!==this.__start&&t.setAttribute("start",String(this.__start)),"check"===this.__listType&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if(_(n))super.append(n);else{const e=I();if(D(n))e.append(n);else if((0,r.F7)(n)){const t=(0,r.MX)(n.getTextContent());e.append(t)}else e.append(n);super.append(e)}}return this}extractWithChild(e){return _(e)}}function P(e,t,n){const r=[],s=[],a=t.list;if(void 0!==a){const e=a[`${n.__tag}Depth`]||[],t=function(e){let t=1,n=e.getParent();for(;null!=n;){if(_(n)){const e=n.getParent();if(D(e)){t++,n=e.getParent();continue}o(40)}return t}return t}(n)-1,i=t%e.length,l=e[i],c=a[n.__tag];let u;const d=a.nested,h=a.checklist;if(void 0!==d&&d.list&&(u=d.list),void 0!==c&&r.push(c),void 0!==h&&"check"===n.__listType&&r.push(h),void 0!==l){r.push(...A(l));for(let t=0;t<e.length;t++)t!==i&&s.push(n.__tag+t)}if(void 0!==u){const e=A(u);t>1?r.push(...e):s.push(...e)}}s.length>0&&(0,i.PS)(e,...s),r.length>0&&(0,i.Yo)(e,...r)}function k(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(_(r)){t.push(r);const e=r.getChildren();e.length>1&&e.forEach((e=>{D(e)&&t.push(c(e))}))}else t.push(c(r))}return t}function B(e){const t=e.nodeName.toLowerCase();let n=null;return"ol"===t?n=N("number",e.start):"ul"===t&&(n=function(e){if("check"===e.getAttribute("__lexicallisttype")||e.classList.contains("contains-task-list"))return!0;for(const t of e.childNodes)if((0,r.Re)(t)&&t.hasAttribute("aria-checked"))return!0;return!1}(e)?N("check"):N("bullet")),{after:k,node:n}}const O={ol:"number",ul:"bullet"};function N(e,t=1){return(0,r.U2)(new x(e,t))}function D(e){return e instanceof x}const j=(0,r.fA)("INSERT_UNORDERED_LIST_COMMAND"),T=(0,r.fA)("INSERT_ORDERED_LIST_COMMAND"),M=(0,r.fA)("INSERT_CHECK_LIST_COMMAND"),F=(0,r.fA)("REMOVE_LIST_COMMAND")},37146:(e,t,n)=>{"use strict";n.d(t,{AB:()=>j,JH:()=>q,Os:()=>W,Pr:()=>Y,T_:()=>V,VH:()=>G,XC:()=>Z,lL:()=>z});var r=n(31031),i=n(36153),o=n(22311),s=n(9591),a=n(29016),l=n(93261);function c(e,t){const n={};for(const r of e){const e=t(r);n[e]?n[e].push(r):n[e]=[r]}return n}function u(e){const t=c(e,(e=>e.type));return{element:t.element||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}const d=/[!-/:-@[-`{-~\s]/,h=/^\s{0,3}$/;function p(e){if(!(0,r.Rl)(e))return!1;const t=e.getFirstChild();return null==t||1===e.getChildrenSize()&&(0,r.Gg)(t)&&h.test(t.getTextContent())}function f(e,t,n,i){for(const r of t){const t=r.export(e,(e=>g(e,n,i)));if(null!=t)return t}return(0,r.F7)(e)?g(e,n,i):(0,r.k$)(e)?e.getTextContent():null}function g(e,t,n){const i=[],o=e.getChildren();e:for(const e of o){for(const r of n){const o=r.export(e,(e=>g(e,t,n)),((e,n)=>m(e,n,t)));if(null!=o){i.push(o);continue e}}(0,r.A3)(e)?i.push("\n"):(0,r.Gg)(e)?i.push(m(e,e.getTextContent(),t)):(0,r.F7)(e)?i.push(g(e,t,n)):(0,r.k$)(e)&&i.push(e.getTextContent())}return i.join("")}function m(e,t,n){const r=t.trim();let i=r;const o=new Set;for(const t of n){const n=t.format[0],r=t.tag;v(e,n)&&!o.has(n)&&(o.add(n),v(y(e,!0),n)||(i=r+i),v(y(e,!1),n)||(i+=r))}return t.replace(r,(()=>i))}function y(e,t){let n=t?e.getPreviousSibling():e.getNextSibling();if(!n){const r=e.getParentOrThrow();r.isInline()&&(n=t?r.getPreviousSibling():r.getNextSibling())}for(;n;){if((0,r.F7)(n)){if(!n.isInline())break;const e=t?n.getLastDescendant():n.getFirstDescendant();if((0,r.Gg)(e))return e;n=t?n.getPreviousSibling():n.getNextSibling()}if((0,r.Gg)(n))return n;if(!(0,r.F7)(n))return null}return null}function v(e,t){return(0,r.Gg)(e)&&e.hasFormat(t)}const A="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,b=A&&"documentMode"in document?document.documentMode:null;A&&"InputEvent"in window&&!b&&new window.InputEvent("input");const w=A&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),S=A&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,C=A&&/^(?=.*Chrome).*/i.test(navigator.userAgent),E=A&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!C,I=/^[ \t]*```(\w{1,10})?\s?$/;function _(e,t,n,i,l){const c=e.trim(),u=(0,r.MX)(c),d=(0,r.BE)();d.append(u),t.append(d);for(const{regExp:t,replace:r}of n){const n=e.match(t);if(n){u.setTextContent(e.slice(n[0].length)),r(d,[u],n,!0);break}}if(P(u,i,l),d.isAttached()&&c.length>0){const e=d.getPreviousSibling();if((0,r.Rl)(e)||(0,s.O)(e)||(0,o.I3)(e)){let t=e;if((0,o.I3)(e)){const n=e.getLastDescendant();t=null==n?null:(0,a.$s)(n,o.QG)}null!=t&&t.getTextContentSize()>0&&(t.splice(t.getChildrenSize(),0,[(0,r.T)(),...d.getChildren()]),d.remove())}}}function x(e,t,n){const o=e[t].match(I);if(o){let s=t;const a=e.length;for(;++s<a;)if(e[s].match(I)){const a=(0,i.Ol)(o[1]),l=(0,r.MX)(e.slice(t+1,s).join("\n"));return a.append(l),n.append(a),[a,s]}}return[null,t]}function P(e,t,n){const r=e.getTextContent(),i=function(e,t){const n=e.match(t.openTagsRegExp);if(null==n)return null;for(const r of n){const n=r.replace(/^\s/,""),i=t.fullMatchRegExpByTag[n];if(null==i)continue;const o=e.match(i),s=t.transformersByTag[n];if(null!=o&&null!=s){if(!1!==s.intraword)return o;const{index:t=0}=o,n=e[t-1],r=e[t+o[0].length];if((!n||d.test(n))&&(!r||d.test(r)))return o}}return null}(r,t);if(!i)return void k(e,n);let o,s,a;if(i[0]===r)o=e;else{const t=i.index||0,n=t+i[0].length;0===t?[o,s]=e.splitText(n):[a,o,s]=e.splitText(t,n)}o.setTextContent(i[2]);const l=t.transformersByTag[i[1]];if(l)for(const e of l.format)o.hasFormat(e)||o.toggleFormat(e);o.hasFormat("code")||P(o,t,n),a&&P(a,t,n),s&&P(s,t,n)}function k(e,t){let n=e;e:for(;n;){for(const e of t){const r=n.getTextContent().match(e.importRegExp);if(!r)continue;const i=r.index||0,o=i+r[0].length;let s,a;0===i?[s,n]=n.splitText(o):[,s,a]=n.splitText(i,o),a&&k(a,t),e.replace(s,r);continue e}break}}var B,O=(B=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})&&B.__esModule&&Object.prototype.hasOwnProperty.call(B,"default")?B.default:B;function N(e,t,n){const r=n.length;for(let i=t;i>=r;i--){const t=i-r;if(D(e,t,n,0,r)&&" "!==e[t+r])return t}return-1}function D(e,t,n,r,i){for(let o=0;o<i;o++)if(e[t+o]!==n[r+o])return!1;return!0}function j(e,t=Z){const n=u(t),o=c(n.textFormat,(({tag:e})=>e[e.length-1])),s=c(n.textMatch,(({trigger:e})=>e));for(const n of t){const t=n.type;if("element"===t||"text-match"===t){const t=n.dependencies;for(const n of t)e.hasNode(n)||O(173,n.getType())}}const a=(e,t,i)=>{(function(e,t,n,i){const o=e.getParent();if(!(0,r._v)(o)||e.getFirstChild()!==t)return!1;const s=t.getTextContent();if(" "!==s[n-1])return!1;for(const{regExp:r,replace:o}of i){const i=s.match(r);if(i&&i[0].length===n){const r=t.getNextSiblings(),[s,a]=t.splitText(n);return s.remove(),o(e,a?[a,...r]:r,i,!1),!0}}return!1})(e,t,i,n.element)||function(e,t,n){let r=e.getTextContent();const i=n[r[t-1]];if(null==i)return!1;t<r.length&&(r=r.slice(0,t));for(const t of i){const n=r.match(t.regExp);if(null===n)continue;const i=n.index||0,o=i+n[0].length;let s;return 0===i?[s]=e.splitText(o):[,s]=e.splitText(i,o),s.selectNext(0,0),t.replace(s,n),!0}return!1}(t,i,s)||function(e,t,n){const i=e.getTextContent(),o=t-1,s=i[o],a=n[s];if(!a)return!1;for(const t of a){const{tag:n}=t,a=n.length,l=o-a+1;if(a>1&&!D(i,l,n,0,a))continue;if(" "===i[l-1])continue;const c=i[o+1];if(!1===t.intraword&&c&&!d.test(c))continue;const u=e;let h=u,p=N(i,l,n),f=h;for(;p<0&&(f=f.getPreviousSibling())&&!(0,r.A3)(f);)if((0,r.Gg)(f)){const e=f.getTextContent();h=f,p=N(e,e.length,n)}if(p<0)continue;if(h===u&&p+a===l)continue;const g=h.getTextContent();if(p>0&&g[p-1]===s)continue;const m=g[p-1];if(!1===t.intraword&&m&&!d.test(m))continue;const y=u.getTextContent(),v=y.slice(0,l)+y.slice(o+1);u.setTextContent(v);const A=h===u?v:g;h.setTextContent(A.slice(0,p)+A.slice(p+a));const b=(0,r.dL)(),w=(0,r.vN)();(0,r.oq)(w);const S=o-a*(h===u?2:1)+1;w.anchor.set(h.__key,p,"text"),w.focus.set(u.__key,S,"text");for(const e of t.format)w.hasFormat(e)||w.formatText(e);w.anchor.set(w.focus.key,w.focus.offset,w.focus.type);for(const e of t.format)w.hasFormat(e)&&w.toggleFormat(e);return(0,r.OP)(b)&&(w.format=b.format),!0}}(t,i,o)};return e.registerUpdateListener((({tags:t,dirtyLeaves:n,editorState:o,prevEditorState:s})=>{if(t.has("collaboration")||t.has("historic"))return;if(e.isComposing())return;const l=o.read(r.dL),c=s.read(r.dL);if(!(0,r.OP)(c)||!(0,r.OP)(l)||!l.isCollapsed())return;const u=l.anchor.key,d=l.anchor.offset,h=o._nodeMap.get(u);!(0,r.Gg)(h)||!n.has(u)||1!==d&&d>c.anchor.offset+1||e.update((()=>{if(h.hasFormat("code"))return;const e=h.getParent();null===e||(0,i.Pe)(e)||a(e,h,l.anchor.offset)}))}))}const T=e=>(t,n,r)=>{const i=e(r);i.append(...n),t.replace(i),i.select(0,0)},M=e=>(t,n,r)=>{const i=t.getPreviousSibling(),s=t.getNextSibling(),a=(0,o.oU)("check"===e?"x"===r[3]:void 0);if((0,o.I3)(s)&&s.getListType()===e){const e=s.getFirstChild();null!==e?e.insertBefore(a):s.append(a),t.remove()}else if((0,o.I3)(i)&&i.getListType()===e)i.append(a),t.remove();else{const n=(0,o.FH)(e,"number"===e?Number(r[2]):void 0);n.append(a),t.replace(n)}a.append(...n),a.select(0,0);const l=function(e){const t=e.match(/\t/g),n=e.match(/ /g);let r=0;return t&&(r+=t.length),n&&(r+=Math.floor(n.length/4)),r}(r[1]);l&&a.setIndent(l)},F=(e,t,n)=>{const r=[],i=e.getChildren();let s=0;for(const a of i)if((0,o.QG)(a)){if(1===a.getChildrenSize()){const e=a.getFirstChild();if((0,o.I3)(e)){r.push(F(e,t,n+1));continue}}const i=" ".repeat(4*n),l=e.getListType(),c="number"===l?`${e.getStart()+s}. `:"check"===l?`- [${a.getChecked()?"x":" "}] `:"- ";r.push(i+c+t(a)),s++}return r.join("\n")},R={dependencies:[s.c2],export:(e,t)=>{if(!(0,s.rc)(e))return null;const n=Number(e.getTag().slice(1));return"#".repeat(n)+" "+t(e)},regExp:/^(#{1,6})\s/,replace:T((e=>{const t="h"+e[1].length;return(0,s.V1)(t)})),type:"element"},L={dependencies:[s.rT],export:(e,t)=>{if(!(0,s.O)(e))return null;const n=t(e).split("\n"),r=[];for(const e of n)r.push("> "+e);return r.join("\n")},regExp:/^>\s/,replace:(e,t,n,i)=>{if(i){const n=e.getPreviousSibling();if((0,s.O)(n))return n.splice(n.getChildrenSize(),0,[(0,r.T)(),...t]),n.select(0,0),void e.remove()}const o=(0,s.Z1)();o.append(...t),e.replace(o),o.select(0,0)},type:"element"},Q={dependencies:[i.wg],export:e=>{if(!(0,i.Pe)(e))return null;const t=e.getTextContent();return"```"+(e.getLanguage()||"")+(t?"\n"+t:"")+"\n```"},regExp:/^[ \t]*```(\w{1,10})?\s/,replace:T((e=>(0,i.Ol)(e?e[1]:void 0))),type:"element"},U={dependencies:[o.EG,o.NK],export:(e,t)=>(0,o.I3)(e)?F(e,t,0):null,regExp:/^(\s*)[-*+]\s/,replace:M("bullet"),type:"element"},V={dependencies:[o.EG,o.NK],export:(e,t)=>(0,o.I3)(e)?F(e,t,0):null,regExp:/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,replace:M("check"),type:"element"},K={dependencies:[o.EG,o.NK],export:(e,t)=>(0,o.I3)(e)?F(e,t,0):null,regExp:/^(\s*)(\d{1,})\.\s/,replace:M("number"),type:"element"},H={dependencies:[l.GR],export:(e,t,n)=>{if(!(0,l.Pq)(e))return null;const i=e.getTitle(),o=i?`[${e.getTextContent()}](${e.getURL()} "${i}")`:`[${e.getTextContent()}](${e.getURL()})`,s=e.getFirstChild();return 1===e.getChildrenSize()&&(0,r.Gg)(s)?n(s,o):o},importRegExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{const[,n,i,o]=t,s=(0,l.zV)(i,{title:o}),a=(0,r.MX)(n);a.setFormat(e.getFormat()),s.append(a),e.replace(s)},trigger:")",type:"text-match"},G=[R,L,Q,U,K],Y=[{format:["code"],tag:"`",type:"text-format"},{format:["bold","italic"],tag:"***",type:"text-format"},{format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},{format:["bold"],tag:"**",type:"text-format"},{format:["bold"],intraword:!1,tag:"__",type:"text-format"},{format:["highlight"],tag:"==",type:"text-format"},{format:["italic"],tag:"*",type:"text-format"},{format:["italic"],intraword:!1,tag:"_",type:"text-format"},{format:["strikethrough"],tag:"~~",type:"text-format"}],z=[H],Z=[...G,...Y,...z];function W(e,t=Z,n,i=!1){return function(e,t=!1){const n=u(e),i=function(e){const t={},n={},r=[];for(const i of e){const{tag:e}=i;t[e]=i;const o=e.replace(/(\*|\^|\+)/g,"\\$1");r.push(o),n[e]=w||S||E?new RegExp(`(${o})(?![${o}\\s])(.*?[^${o}\\s])${o}(?!${o})`):new RegExp(`(?<![\\\\${o}])(${o})((\\\\${o})?.*?[^${o}\\s](\\\\${o})?)((?<!\\\\)|(?<=\\\\\\\\))(${o})(?![\\\\${o}])`)}return{fullMatchRegExpByTag:n,openTagsRegExp:new RegExp((w||S||E?"":"(?<![\\\\])")+"("+r.join("|")+")","g"),transformersByTag:t}}(n.textFormat);return(e,o)=>{const s=e.split("\n"),a=s.length,l=o||(0,r.Gv)();l.clear();for(let e=0;e<a;e++){const t=s[e],[r,o]=x(s,e,l);null==r?_(t,l,n.element,i,n.textMatch):e=o}const c=l.getChildren();for(const e of c)!t&&p(e)&&l.getChildrenSize()>1&&e.remove();null!==(0,r.dL)()&&l.selectEnd()}}(t,i)(e,n)}function q(e=Z,t,n=!1){const i=function(e,t=!1){const n=u(e),i=!t,o=n.textFormat.filter((e=>1===e.format.length));return e=>{const t=[],s=(e||(0,r.Gv)()).getChildren();for(let e=0;e<s.length;e++){const r=s[e],a=f(r,n.element,o,n.textMatch);null!=a&&t.push(i&&e>0&&!p(r)&&!p(s[e-1])?"\n".concat(a):a)}return t.join("\n")}}(e,n);return i(t)}},8802:(e,t,n)=>{"use strict";n.d(t,{WX:()=>A,v3:()=>v,vK:()=>b,HI:()=>y});var r=n(93261),i=n(47166),o=n(31031),s=n(2784),a=n(29016),l=n(52322);const c="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?s.useLayoutEffect:s.useEffect;class u{constructor(e){this.key=e,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}setRefElement(e){this.ref={current:e}}}const d=e=>{const t=document.getElementById("typeahead-menu");if(!t)return;const n=t.getBoundingClientRect();n.top+n.height>window.innerHeight&&t.scrollIntoView({block:"center"}),n.top<0&&t.scrollIntoView({block:"center"}),e.scrollIntoView({block:"nearest"})};function h(e,t){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top>r.top&&n.top<r.bottom}function p(e,t,n,r){const[o]=(0,i.g)();(0,s.useEffect)((()=>{if(null!=t&&null!=e){const e=o.getRootElement(),i=null!=e?function(e,t){let n=getComputedStyle(e);const r="absolute"===n.position,i=/(auto|scroll)/;if("fixed"===n.position)return document.body;for(let t=e;t=t.parentElement;)if(n=getComputedStyle(t),(!r||"static"!==n.position)&&i.test(n.overflow+n.overflowY+n.overflowX))return t;return document.body}(e):document.body;let s=!1,a=h(t,i);const l=function(){s||(window.requestAnimationFrame((function(){n(),s=!1})),s=!0);const e=h(t,i);e!==a&&(a=e,null!=r&&r(e))},c=new ResizeObserver(n);return window.addEventListener("resize",n),document.addEventListener("scroll",l,{capture:!0,passive:!0}),c.observe(t),()=>{c.unobserve(t),window.removeEventListener("resize",n),document.removeEventListener("scroll",l,!0)}}}),[t,o,r,n,e])}const f=(0,o.fA)("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");function g({close:e,editor:t,anchorElementRef:n,resolution:r,options:i,menuRenderFn:l,onSelectOption:u,shouldSplitNodeWithQuery:h=!1,commandPriority:p=o.KB}){const[g,m]=(0,s.useState)(null),y=r.match&&r.match.matchingString;(0,s.useEffect)((()=>{m(0)}),[y]);const v=(0,s.useCallback)((n=>{t.update((()=>{const t=null!=r.match&&h?function(e){const t=(0,o.dL)();if(!(0,o.OP)(t)||!t.isCollapsed())return null;const n=t.anchor;if("text"!==n.type)return null;const r=n.getNode();if(!r.isSimpleText())return null;const i=n.offset,s=r.getTextContent().slice(0,i),a=e.replaceableString.length,l=i-function(e,t,n){let r=n;for(let n=r;n<=t.length;n++)e.substr(-n)===t.substr(0,n)&&(r=n);return r}(s,e.matchingString,a);if(l<0)return null;let c;return 0===l?[c]=r.splitText(i):[,c]=r.splitText(l,i),c}(r.match):null;u(n,t,e,r.match?r.match.matchingString:"")}))}),[t,h,r.match,u,e]),A=(0,s.useCallback)((e=>{const n=t.getRootElement();null!==n&&(n.setAttribute("aria-activedescendant","typeahead-item-"+e),m(e))}),[t]);return(0,s.useEffect)((()=>()=>{const e=t.getRootElement();null!==e&&e.removeAttribute("aria-activedescendant")}),[t]),c((()=>{null===i?m(null):null===g&&A(0)}),[i,g,A]),(0,s.useEffect)((()=>(0,a.qV)(t.registerCommand(f,(({option:e})=>!(!e.ref||null==e.ref.current||(d(e.ref.current),0))),p))),[t,A,p]),(0,s.useEffect)((()=>(0,a.qV)(t.registerCommand(o.Zb,(e=>{const n=e;if(null!==i&&i.length&&null!==g){const e=g!==i.length-1?g+1:0;A(e);const r=i[e];null!=r.ref&&r.ref.current&&t.dispatchCommand(f,{index:e,option:r}),n.preventDefault(),n.stopImmediatePropagation()}return!0}),p),t.registerCommand(o._0,(e=>{const t=e;if(null!==i&&i.length&&null!==g){const e=0!==g?g-1:i.length-1;A(e);const n=i[e];null!=n.ref&&n.ref.current&&d(n.ref.current),t.preventDefault(),t.stopImmediatePropagation()}return!0}),p),t.registerCommand(o.Zq,(t=>{const n=t;return n.preventDefault(),n.stopImmediatePropagation(),e(),!0}),p),t.registerCommand(o.dB,(e=>{const t=e;return null!==i&&null!==g&&null!=i[g]&&(t.preventDefault(),t.stopImmediatePropagation(),v(i[g]),!0)}),p),t.registerCommand(o.XN,(e=>null!==i&&null!==g&&null!=i[g]&&(null!==e&&(e.preventDefault(),e.stopImmediatePropagation()),v(i[g]),!0)),p))),[v,e,t,i,g,A,p]),l(n,(0,s.useMemo)((()=>({options:i,selectOptionAndCleanUp:v,selectedIndex:g,setHighlightedIndex:m})),[v,g,i]),r.match?r.match.matchingString:"")}function m({options:e,nodeKey:t,onClose:n,onOpen:r,onSelectOption:a,menuRenderFn:c,anchorClassName:u,commandPriority:d=o.KB,parent:h}){const[f]=(0,i.g)(),[m,y]=(0,s.useState)(null),v=function(e,t,n,r=document.body){const[o]=(0,i.g)(),a=(0,s.useRef)(document.createElement("div")),l=(0,s.useCallback)((()=>{a.current.style.top=a.current.style.bottom;const t=o.getRootElement(),i=a.current,s=i.firstChild;if(null!==t&&null!==e){const{left:o,top:l,width:c,height:u}=e.getRect(),d=a.current.offsetHeight;if(i.style.top=`${l+window.pageYOffset+d+3}px`,i.style.left=`${o+window.pageXOffset}px`,i.style.height=`${u}px`,i.style.width=`${c}px`,null!==s){s.style.top=`${l}`;const e=s.getBoundingClientRect(),n=e.height,r=e.width,a=t.getBoundingClientRect();o+r>a.right&&(i.style.left=`${a.right-r+window.pageXOffset}px`),(l+n>window.innerHeight||l+n>a.bottom)&&l-a.top>n+u&&(i.style.top=l-n+window.pageYOffset-u+"px")}i.isConnected||(null!=n&&(i.className=n),i.setAttribute("aria-label","Typeahead menu"),i.setAttribute("id","typeahead-menu"),i.setAttribute("role","listbox"),i.style.display="block",i.style.position="absolute",r.append(i)),a.current=i,t.setAttribute("aria-controls","typeahead-menu")}}),[o,e,n,r]);(0,s.useEffect)((()=>{const t=o.getRootElement();if(null!==e)return l(),()=>{null!==t&&t.removeAttribute("aria-controls");const e=a.current;null!==e&&e.isConnected&&e.remove()}}),[o,l,e]);const c=(0,s.useCallback)((n=>{null!==e&&(n||t(null))}),[e,t]);return p(e,a.current,l,c),a}(m,y,u,h),A=(0,s.useCallback)((()=>{y(null),null!=n&&null!==m&&n()}),[n,m]),b=(0,s.useCallback)((e=>{y(e),null!=r&&null===m&&r(e)}),[r,m]),w=(0,s.useCallback)((()=>{t?f.update((()=>{const e=(0,o.gI)(t),n=f.getElementByKey(t);var r;null!=e&&null!=n&&null==m&&(r=()=>b({getRect:()=>n.getBoundingClientRect()}),s.startTransition?s.startTransition(r):r())})):null==t&&null!=m&&A()}),[A,f,t,b,m]);return(0,s.useEffect)((()=>{w()}),[w,t]),(0,s.useEffect)((()=>{if(null!=t)return f.registerUpdateListener((({dirtyElements:e})=>{e.get(t)&&w()}))}),[f,w,t]),null===m||null===f?null:(0,l.jsx)(g,{close:A,resolution:m,editor:f,anchorElementRef:v,options:e,menuRenderFn:c,onSelectOption:a,commandPriority:d})}const y=/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/,v=(0,o.fA)("INSERT_EMBED_COMMAND");class A extends u{constructor(e,t){super(e),this.title=e,this.onSelect=t.onSelect.bind(this)}}function b({embedConfigs:e,onOpenEmbedModalForConfig:t,getMenuOptions:n,menuRenderFn:c,menuCommandPriority:u=o.KB}){const[d]=(0,i.g)(),[h,p]=(0,s.useState)(null),[f,g]=(0,s.useState)(null),y=(0,s.useCallback)((()=>{p(null),g(null)}),[]),A=(0,s.useCallback)((t=>{d.getEditorState().read((async function(){const n=(0,o.gI)(t);if((0,r.Pq)(n))for(let t=0;t<e.length;t++){const r=e[t];null!=await Promise.resolve(r.parseUrl(n.__url))&&(g(r),p(n.getKey()))}}))}),[d,e]);(0,s.useEffect)((()=>(0,a.qV)(...[r.GR,r.qp].map((e=>d.registerMutationListener(e,((...e)=>((e,{updateTags:t,dirtyLeaves:n})=>{for(const[r,i]of e)"created"===i&&t.has("paste")&&n.size<=3?A(r):r===h&&y()})(...e))))))),[A,d,e,h,y]),(0,s.useEffect)((()=>d.registerCommand(v,(n=>{const r=e.find((({type:e})=>e===n));return!!r&&(t(r),!0)}),o.VN)),[d,e,t]);const b=(0,s.useCallback)((async function(){if(null!=f&&null!=h){const e=d.getEditorState().read((()=>{const e=(0,o.gI)(h);return(0,r.Pq)(e)?e:null}));if((0,r.Pq)(e)){const t=await Promise.resolve(f.parseUrl(e.__url));null!=t&&d.update((()=>{(0,o.dL)()||e.selectEnd(),f.insertNode(d,t),e.isAttached()&&e.remove()}))}}}),[f,d,h]),w=(0,s.useMemo)((()=>null!=f&&null!=h?n(f,b,y):[]),[f,b,n,h,y]),S=(0,s.useCallback)(((e,t,n)=>{d.update((()=>{e.onSelect(t),n()}))}),[d]);return null!=h?(0,l.jsx)(m,{nodeKey:h,onClose:y,onSelectOption:S,options:w,menuRenderFn:c,commandPriority:u}):null}},74667:(e,t,n)=>{"use strict";n.d(t,{U:()=>u});var r=n(47166),i=n(20266),o=n(73055),s=n(29016),a=n(31031),l=n(2784),c=n(52322);function u({children:e,format:t,nodeKey:n,className:u}){const[d]=(0,r.g)(),[h,p,f]=(0,o.y)(n),g=(0,l.useRef)(null),m=(0,l.useCallback)((e=>{if(h&&(0,a.iO)((0,a.dL)())){e.preventDefault();const t=(0,a.gI)(n);if((0,a.k$)(t))return t.remove(),!0}return!1}),[h,n]);return(0,l.useEffect)((()=>(0,s.qV)(d.registerCommand(a.RO,(e=>{if(h){const t=(0,a.dL)();if((0,a.iO)(t)){const t=(0,a.gI)(n);(0,i.F)(t)&&t.setFormat(e)}else if((0,a.OP)(t)){const n=t.getNodes();for(const t of n)(0,i.F)(t)?t.setFormat(e):(0,s.f8)(t).setFormat(e)}return!0}return!1}),a.KB),d.registerCommand(a.Kr,(e=>e.target===g.current&&(e.preventDefault(),e.shiftKey||f(),p(!h),!0)),a.KB),d.registerCommand(a.MK,m,a.KB),d.registerCommand(a.aR,m,a.KB))),[f,d,h,n,m,p]),(0,c.jsx)("div",{className:[u.base,h?u.focus:null].filter(Boolean).join(" "),ref:g,style:{textAlign:t||void 0},children:e})}},47166:(e,t,n)=>{"use strict";n.d(t,{LI:()=>a,YK:()=>s,g:()=>l});var r,i=n(2784),o=(r=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;const s=(0,i.createContext)(null);function a(e,t){let n=null;return null!=e&&(n=e[1]),{getTheme:function(){return null!=t?t:null!=n?n.getTheme():null}}}function l(){const e=(0,i.useContext)(s);return null==e&&o(8),e}},20266:(e,t,n)=>{"use strict";n.d(t,{F:()=>o,K:()=>i});var r=n(31031);class i extends r.Ij{constructor(e,t){super(t),this.__format=e||""}exportJSON(){return{format:this.__format||"",type:"decorator-block",version:1}}canIndent(){return!1}createDOM(){return document.createElement("div")}updateDOM(){return!1}setFormat(e){this.getWritable().__format=e}isInline(){return!1}}function o(e){return e instanceof i}},27901:(e,t,n)=>{"use strict";n.d(t,{Dq:()=>p,HY:()=>d,fs:()=>f,qL:()=>c});var r=n(47166),i=n(73055),o=n(29016),s=n(31031),a=n(2784),l=n(52322);const c=(0,s.fA)("INSERT_HORIZONTAL_RULE_COMMAND");function u({nodeKey:e}){const[t]=(0,r.g)(),[n,l,c]=(0,i.y)(e),u=(0,a.useCallback)((t=>{if(n&&(0,s.iO)((0,s.dL)())){t.preventDefault();const n=(0,s.gI)(e);if(f(n))return n.remove(),!0}return!1}),[n,e]);return(0,a.useEffect)((()=>(0,o.qV)(t.registerCommand(s.Kr,(r=>{const i=t.getElementByKey(e);return r.target===i&&(r.shiftKey||c(),l(!n),!0)}),s.KB),t.registerCommand(s.MK,u,s.KB),t.registerCommand(s.aR,u,s.KB))),[c,t,n,e,u,l]),(0,a.useEffect)((()=>{const r=t.getElementByKey(e),i="selected";null!==r&&(n?(0,o.Yo)(r,i):(0,o.PS)(r,i))}),[t,n,e]),null}class d extends s.Ij{static getType(){return"horizontalrule"}static clone(e){return new d(e.__key)}static importJSON(e){return p()}static importDOM(){return{hr:()=>({conversion:h,priority:0})}}exportJSON(){return{type:"horizontalrule",version:1}}exportDOM(){return{element:document.createElement("hr")}}createDOM(e){const t=document.createElement("hr");return(0,o.Yo)(t,e.theme.hr),t}getTextContent(){return"\n"}isInline(){return!1}updateDOM(){return!1}decorate(){return(0,l.jsx)(u,{nodeKey:this.__key})}}function h(){return{node:p()}}function p(){return(0,s.U2)(new d)}function f(e){return e instanceof d}},17906:(e,t,n)=>{"use strict";n.d(t,{HQ:()=>y,n:()=>c,wd:()=>m});var r=n(47166),i=n(31031),o=n(2784),s=n(29016),a=n(52322);const l="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect;class c{constructor(e){this.key=e,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}setRefElement(e){this.ref={current:e}}}const u=e=>{const t=document.getElementById("typeahead-menu");if(!t)return;const n=t.getBoundingClientRect();n.top+n.height>window.innerHeight&&t.scrollIntoView({block:"center"}),n.top<0&&t.scrollIntoView({block:"center"}),e.scrollIntoView({block:"nearest"})};function d(e,t){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top>r.top&&n.top<r.bottom}function h(e,t,n,i){const[s]=(0,r.g)();(0,o.useEffect)((()=>{if(null!=t&&null!=e){const e=s.getRootElement(),r=null!=e?function(e,t){let n=getComputedStyle(e);const r="absolute"===n.position,i=/(auto|scroll)/;if("fixed"===n.position)return document.body;for(let t=e;t=t.parentElement;)if(n=getComputedStyle(t),(!r||"static"!==n.position)&&i.test(n.overflow+n.overflowY+n.overflowX))return t;return document.body}(e):document.body;let o=!1,a=d(t,r);const l=function(){o||(window.requestAnimationFrame((function(){n(),o=!1})),o=!0);const e=d(t,r);e!==a&&(a=e,null!=i&&i(e))},c=new ResizeObserver(n);return window.addEventListener("resize",n),document.addEventListener("scroll",l,{capture:!0,passive:!0}),c.observe(t),()=>{c.unobserve(t),window.removeEventListener("resize",n),document.removeEventListener("scroll",l,!0)}}}),[t,s,i,n,e])}const p=(0,i.fA)("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");function f({close:e,editor:t,anchorElementRef:n,resolution:r,options:a,menuRenderFn:c,onSelectOption:d,shouldSplitNodeWithQuery:h=!1,commandPriority:f=i.KB}){const[g,m]=(0,o.useState)(null),y=r.match&&r.match.matchingString;(0,o.useEffect)((()=>{m(0)}),[y]);const v=(0,o.useCallback)((n=>{t.update((()=>{const t=null!=r.match&&h?function(e){const t=(0,i.dL)();if(!(0,i.OP)(t)||!t.isCollapsed())return null;const n=t.anchor;if("text"!==n.type)return null;const r=n.getNode();if(!r.isSimpleText())return null;const o=n.offset,s=r.getTextContent().slice(0,o),a=e.replaceableString.length,l=o-function(e,t,n){let r=n;for(let n=r;n<=t.length;n++)e.substr(-n)===t.substr(0,n)&&(r=n);return r}(s,e.matchingString,a);if(l<0)return null;let c;return 0===l?[c]=r.splitText(o):[,c]=r.splitText(l,o),c}(r.match):null;d(n,t,e,r.match?r.match.matchingString:"")}))}),[t,h,r.match,d,e]),A=(0,o.useCallback)((e=>{const n=t.getRootElement();null!==n&&(n.setAttribute("aria-activedescendant","typeahead-item-"+e),m(e))}),[t]);return(0,o.useEffect)((()=>()=>{const e=t.getRootElement();null!==e&&e.removeAttribute("aria-activedescendant")}),[t]),l((()=>{null===a?m(null):null===g&&A(0)}),[a,g,A]),(0,o.useEffect)((()=>(0,s.qV)(t.registerCommand(p,(({option:e})=>!(!e.ref||null==e.ref.current||(u(e.ref.current),0))),f))),[t,A,f]),(0,o.useEffect)((()=>(0,s.qV)(t.registerCommand(i.Zb,(e=>{const n=e;if(null!==a&&a.length&&null!==g){const e=g!==a.length-1?g+1:0;A(e);const r=a[e];null!=r.ref&&r.ref.current&&t.dispatchCommand(p,{index:e,option:r}),n.preventDefault(),n.stopImmediatePropagation()}return!0}),f),t.registerCommand(i._0,(e=>{const t=e;if(null!==a&&a.length&&null!==g){const e=0!==g?g-1:a.length-1;A(e);const n=a[e];null!=n.ref&&n.ref.current&&u(n.ref.current),t.preventDefault(),t.stopImmediatePropagation()}return!0}),f),t.registerCommand(i.Zq,(t=>{const n=t;return n.preventDefault(),n.stopImmediatePropagation(),e(),!0}),f),t.registerCommand(i.dB,(e=>{const t=e;return null!==a&&null!==g&&null!=a[g]&&(t.preventDefault(),t.stopImmediatePropagation(),v(a[g]),!0)}),f),t.registerCommand(i.XN,(e=>null!==a&&null!==g&&null!=a[g]&&(null!==e&&(e.preventDefault(),e.stopImmediatePropagation()),v(a[g]),!0)),f))),[v,e,t,a,g,A,f]),c(n,(0,o.useMemo)((()=>({options:a,selectOptionAndCleanUp:v,selectedIndex:g,setHighlightedIndex:m})),[v,g,a]),r.match?r.match.matchingString:"")}const g="\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%'\"~=<>_:;";function m(e,{minLength:t=1,maxLength:n=75}){return(0,o.useCallback)((r=>{const i=new RegExp("(^|\\s|\\()(["+e+"]((?:[^"+e+g+"\\s]){0,"+n+"}))$").exec(r);if(null!==i){const e=i[1],n=i[3];if(n.length>=t)return{leadOffset:i.index+e.length,matchingString:n,replaceableString:i[2]}}return null}),[n,t,e])}function y({options:e,onQueryChange:t,onSelectOption:n,onOpen:s,onClose:l,menuRenderFn:c,triggerFn:u,anchorClassName:d,commandPriority:p=i.KB,parent:g}){const[m]=(0,r.g)(),[y,v]=(0,o.useState)(null),A=function(e,t,n,i=document.body){const[s]=(0,r.g)(),a=(0,o.useRef)(document.createElement("div")),l=(0,o.useCallback)((()=>{a.current.style.top=a.current.style.bottom;const t=s.getRootElement(),r=a.current,o=r.firstChild;if(null!==t&&null!==e){const{left:s,top:l,width:c,height:u}=e.getRect(),d=a.current.offsetHeight;if(r.style.top=`${l+window.pageYOffset+d+3}px`,r.style.left=`${s+window.pageXOffset}px`,r.style.height=`${u}px`,r.style.width=`${c}px`,null!==o){o.style.top=`${l}`;const e=o.getBoundingClientRect(),n=e.height,i=e.width,a=t.getBoundingClientRect();s+i>a.right&&(r.style.left=`${a.right-i+window.pageXOffset}px`),(l+n>window.innerHeight||l+n>a.bottom)&&l-a.top>n+u&&(r.style.top=l-n+window.pageYOffset-u+"px")}r.isConnected||(null!=n&&(r.className=n),r.setAttribute("aria-label","Typeahead menu"),r.setAttribute("id","typeahead-menu"),r.setAttribute("role","listbox"),r.style.display="block",r.style.position="absolute",i.append(r)),a.current=r,t.setAttribute("aria-controls","typeahead-menu")}}),[s,e,n,i]);(0,o.useEffect)((()=>{const t=s.getRootElement();if(null!==e)return l(),()=>{null!==t&&t.removeAttribute("aria-controls");const e=a.current;null!==e&&e.isConnected&&e.remove()}}),[s,l,e]);const c=(0,o.useCallback)((n=>{null!==e&&(n||t(null))}),[e,t]);return h(e,a.current,l,c),a}(y,v,d,g),b=(0,o.useCallback)((()=>{v(null),null!=l&&null!==y&&l()}),[l,y]),w=(0,o.useCallback)((e=>{v(e),null!=s&&null===y&&s(e)}),[s,y]);return(0,o.useEffect)((()=>{const e=m.registerUpdateListener((()=>{m.getEditorState().read((()=>{const e=m._window||window,n=e.document.createRange(),r=(0,i.dL)(),s=function(e){let t=null;return e.getEditorState().read((()=>{const e=(0,i.dL)();(0,i.OP)(e)&&(t=function(e){const t=e.anchor;if("text"!==t.type)return null;const n=t.getNode();if(!n.isSimpleText())return null;const r=t.offset;return n.getTextContent().slice(0,r)}(e))})),t}(m);if(!(0,i.OP)(r)||!r.isCollapsed()||null===s||null===n)return void b();const a=u(s,m);if(t(a?a.matchingString:null),null!==a&&!function(e,t){return 0===t&&e.getEditorState().read((()=>{const e=(0,i.dL)();if((0,i.OP)(e)){const t=e.anchor.getNode().getPreviousSibling();return(0,i.Gg)(t)&&t.isTextEntity()}return!1}))}(m,a.leadOffset)){const t=function(e,t,n){const r=n.getSelection();if(null===r||!r.isCollapsed)return!1;const i=r.anchorNode,o=e,s=r.anchorOffset;if(null==i||null==s)return!1;try{t.setStart(i,o),t.setEnd(i,s)}catch(e){return!1}return!0}(a.leadOffset,n,e);if(null!==t)return l=()=>w({getRect:()=>n.getBoundingClientRect(),match:a}),void(o.startTransition?o.startTransition(l):l())}var l;b()}))}));return()=>{e()}}),[m,u,t,y,b,w]),null===y||null===m?null:(0,a.jsx)(f,{close:b,resolution:y,editor:m,anchorElementRef:A,options:e,menuRenderFn:c,shouldSplitNodeWithQuery:!0,onSelectOption:n,commandPriority:p})}(0,i.fA)("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND")},73055:(e,t,n)=>{"use strict";n.d(t,{y:()=>a});var r=n(47166),i=n(31031),o=n(2784);function s(e,t){return e.getEditorState().read((()=>{const e=(0,i.gI)(t);return null!==e&&e.isSelected()}))}function a(e){const[t]=(0,r.g)(),[n,a]=(0,o.useState)((()=>s(t,e)));return(0,o.useEffect)((()=>{let n=!0;const r=t.registerUpdateListener((()=>{n&&a(s(t,e))}));return()=>{n=!1,r()}}),[t,e]),[n,(0,o.useCallback)((n=>{t.update((()=>{let t=(0,i.dL)();(0,i.iO)(t)||(t=(0,i.h5)(),(0,i.oq)(t)),(0,i.iO)(t)&&(n?t.add(e):t.delete(e))}))}),[t,e]),(0,o.useCallback)((()=>{t.update((()=>{const e=(0,i.dL)();(0,i.iO)(e)&&e.clear()}))}),[t])]}},9591:(e,t,n)=>{"use strict";n.d(t,{V1:()=>N,Z1:()=>_,rc:()=>D,O:()=>x,c2:()=>P,rT:()=>I,UW:()=>j,ML:()=>F});var r=n(94900),i=n(64739),o=n(29016),s=n(31031),a=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)};const l="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,c=e=>l?(e||window).getSelection():null;function u(e,t,n,o){const a=e.getData("application/x-lexical-editor");if(a)try{const e=JSON.parse(a);if(e.namespace===n._config.namespace&&Array.isArray(e.nodes))return d(n,function(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n],o=(0,s.oC)(r);(0,s.Gg)(o)&&(0,i.vV)(o),t.push(o)}return t}(e.nodes),t)}catch(e){}if(!o||"insertReplacementText"!==o.inputType||!e.types.includes("text/plain")){const i=e.getData("text/html");if(i)try{const e=(new DOMParser).parseFromString(i,"text/html");return d(n,(0,r.s)(n,e),t)}catch(e){}}const l=e.getData("text/plain")||e.getData("text/uri-list");if(null!=l)if((0,s.OP)(t)){const e=l.split(/(\r?\n|\t)/);""===e[e.length-1]&&e.pop();for(let t=0;t<e.length;t++){const n=(0,s.dL)();if((0,s.OP)(n)){const r=e[t];"\n"===r||"\r\n"===r?n.insertParagraph():"\t"===r?n.insertNodes([(0,s.S3)()]):n.insertText(r)}}}else t.insertRawText(l)}function d(e,t,n){e.dispatchCommand(s.zr,{nodes:t,selection:n})||n.insertNodes(t)}function h(e,t,n,r=[]){let o=null===t||n.isSelected(t);const l=(0,s.F7)(n)&&n.excludeFromCopy("html");let c=n;if(null!==t){let e=(0,i.B3)(n);e=(0,s.Gg)(e)&&null!==t?(0,i.bA)(t,e):e,c=e}const u=(0,s.F7)(c)?c.getChildren():[],d=function(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&a(58,n.name),(0,s.F7)(e)){const e=t.children;Array.isArray(e)||a(59,n.name)}return t}(c);if((0,s.Gg)(c)){const e=c.__text;e.length>0?d.text=e:o=!1}for(let r=0;r<u.length;r++){const i=u[r],a=h(e,t,i,d.children);!o&&(0,s.F7)(n)&&a&&n.extractWithChild(i,t,"clone")&&(o=!0)}if(o&&!l)r.push(d);else if(Array.isArray(d.children))for(let e=0;e<d.children.length;e++){const t=d.children[e];r.push(t)}return o}let p=null;async function f(e,t){if(null!==p)return!1;if(null!==t)return new Promise(((n,r)=>{e.update((()=>{n(g(e,t))}))}));const n=e.getRootElement(),r=null==e._window?window.document:e._window.document,i=c(e._window);if(null===n||null===i)return!1;const a=r.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(r.createTextNode("#")),n.append(a);const l=new Range;return l.setStart(a,0),l.setEnd(a,1),i.removeAllRanges(),i.addRange(l),new Promise(((t,n)=>{const i=e.registerCommand(s.LV,(n=>((0,o.nh)(n,ClipboardEvent)&&(i(),null!==p&&(window.clearTimeout(p),p=null),t(g(e,n))),!0)),s.jw);p=window.setTimeout((()=>{i(),p=null,t(!1)}),50),r.execCommand("copy"),a.remove()}))}function g(e,t){const n=c(e._window);if(!n)return!1;const i=n.anchorNode,o=n.focusNode;if(null!==i&&null!==o&&!(0,s.af)(e,i,o))return!1;t.preventDefault();const l=t.clipboardData,u=(0,s.dL)();if(null===l||null===u)return!1;const d=function(e){const t=(0,s.dL)();return null==t&&a(166),(0,s.OP)(t)&&t.isCollapsed()||0===t.getNodes().length?"":(0,r.S)(e,t)}(e),p=function(e){const t=(0,s.dL)();return null==t&&a(166),(0,s.OP)(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(function(e,t){const n=[],r=(0,s.Gv)().getChildren();for(let i=0;i<r.length;i++)h(e,t,r[i],n);return{namespace:e._config.namespace,nodes:n}}(e,t))}(e);let f="";return null!==u&&(f=u.getTextContent()),null!==d&&l.setData("text/html",d),null!==p&&l.setData("application/x-lexical-editor",p),l.setData("text/plain",f),!0}function m(e,t){if(void 0!==document.caretRangeFromPoint){const n=document.caretRangeFromPoint(e,t);return null===n?null:{node:n.startContainer,offset:n.startOffset}}if("undefined"!==document.caretPositionFromPoint){const n=document.caretPositionFromPoint(e,t);return null===n?null:{node:n.offsetNode,offset:n.offset}}return null}const y="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,v=y&&"documentMode"in document?document.documentMode:null;y&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),y&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);const A=!(!y||!("InputEvent"in window)||v)&&"getTargetRanges"in new window.InputEvent("input"),b=y&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),w=y&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,S=(y&&/Android/.test(navigator.userAgent),y&&/^(?=.*Chrome).*/i.test(navigator.userAgent)),C=y&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!S,E=(0,s.fA)("DRAG_DROP_PASTE_FILE");class I extends s.HX{static getType(){return"quote"}static clone(e){return new I(e.__key)}constructor(e){super(e)}createDOM(e){const t=document.createElement("blockquote");return(0,o.Yo)(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:O,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&(0,s.Re)(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){const t=_();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(e,t){const n=(0,s.BE)(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,t),n}collapseAtStart(){const e=(0,s.BE)();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}}function _(){return(0,s.U2)(new I)}function x(e){return e instanceof I}class P extends s.HX{static getType(){return"heading"}static clone(e){return new P(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}createDOM(e){const t=this.__tag,n=document.createElement(t),r=e.theme.heading;if(void 0!==r){const e=r[t];(0,o.Yo)(n,e)}return n}updateDOM(e,t){return!1}static importDOM(){return{h1:e=>({conversion:B,priority:0}),h2:e=>({conversion:B,priority:0}),h3:e=>({conversion:B,priority:0}),h4:e=>({conversion:B,priority:0}),h5:e=>({conversion:B,priority:0}),h6:e=>({conversion:B,priority:0}),p:e=>{const t=e.firstChild;return null!==t&&k(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>k(e)?{conversion:e=>({node:N("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&(0,s.Re)(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){const t=N(e.tag);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(e,t=!0){const n=e?e.anchor.offset:0,r=n!==this.getTextContentSize()&&e?N(this.getTag()):(0,s.BE)(),i=this.getDirection();if(r.setDirection(i),this.insertAfter(r,t),0===n&&!this.isEmpty()&&e){const e=(0,s.BE)();e.select(),this.replace(e,!0)}return r}collapseAtStart(){const e=this.isEmpty()?(0,s.BE)():N(this.getTag());return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}extractWithChild(){return!0}}function k(e){return"span"===e.nodeName.toLowerCase()&&"26pt"===e.style.fontSize}function B(e){const t=e.nodeName.toLowerCase();let n=null;return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t||(n=N(t),null!==e.style&&n.setFormat(e.style.textAlign)),{node:n}}function O(e){const t=_();return null!==e.style&&t.setFormat(e.style.textAlign),{node:t}}function N(e){return(0,s.U2)(new P(e))}function D(e){return e instanceof P}function j(e){let t=null;if((0,o.nh)(e,DragEvent)?t=e.dataTransfer:(0,o.nh)(e,ClipboardEvent)&&(t=e.clipboardData),null===t)return[!1,[],!1];const n=t.types,r=n.includes("Files"),i=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(t.files),i]}function T(e){const t=(0,s.dL)();if(!(0,s.OP)(t))return!1;const n=new Set,r=t.getNodes();for(let t=0;t<r.length;t++){const i=r[t],a=i.getKey();if(n.has(a))continue;const l=(0,o.$s)(i,(e=>(0,s.F7)(e)&&!e.isInline()));if(null===l)continue;const c=l.getKey();l.canIndent()&&!n.has(c)&&(n.add(c),e(l))}return n.size>0}function M(e){const t=(0,s.Xo)(e);return(0,s.k$)(t)}function F(e){return(0,o.qV)(e.registerCommand(s.Kr,(e=>{const t=(0,s.dL)();return!!(0,s.iO)(t)&&(t.clear(),!0)}),0),e.registerCommand(s.Mt,(e=>{const t=(0,s.dL)();return!!(0,s.OP)(t)&&(t.deleteCharacter(e),!0)}),s.VN),e.registerCommand(s.cj,(e=>{const t=(0,s.dL)();return!!(0,s.OP)(t)&&(t.deleteWord(e),!0)}),s.VN),e.registerCommand(s.n2,(e=>{const t=(0,s.dL)();return!!(0,s.OP)(t)&&(t.deleteLine(e),!0)}),s.VN),e.registerCommand(s.yF,(t=>{const n=(0,s.dL)();if("string"==typeof t)null!==n&&n.insertText(t);else{if(null===n)return!1;const r=t.dataTransfer;if(null!=r)u(r,n,e,t);else if((0,s.OP)(n)){const e=t.data;return e&&n.insertText(e),!0}}return!0}),s.VN),e.registerCommand(s.RJ,(()=>{const e=(0,s.dL)();return!!(0,s.OP)(e)&&(e.removeText(),!0)}),s.VN),e.registerCommand(s.Ew,(e=>{const t=(0,s.dL)();return!!(0,s.OP)(t)&&(t.formatText(e),!0)}),s.VN),e.registerCommand(s.RO,(e=>{const t=(0,s.dL)();if(!(0,s.OP)(t)&&!(0,s.iO)(t))return!1;const n=t.getNodes();for(const t of n){const n=(0,o.$s)(t,(e=>(0,s.F7)(e)&&!e.isInline()));null!==n&&n.setFormat(e)}return!0}),s.VN),e.registerCommand(s.WH,(e=>{const t=(0,s.dL)();return!!(0,s.OP)(t)&&(t.insertLineBreak(e),!0)}),s.VN),e.registerCommand(s.K0,(()=>{const e=(0,s.dL)();return!!(0,s.OP)(e)&&(e.insertParagraph(),!0)}),s.VN),e.registerCommand(s.cA,(()=>((0,s.od)([(0,s.S3)()]),!0)),s.VN),e.registerCommand(s.PU,(()=>T((e=>{const t=e.getIndent();e.setIndent(t+1)}))),s.VN),e.registerCommand(s.cz,(()=>T((e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}))),s.VN),e.registerCommand(s._0,(e=>{const t=(0,s.dL)();if((0,s.iO)(t)&&!M(e.target)){const e=t.getNodes();if(e.length>0)return e[0].selectPrevious(),!0}else if((0,s.OP)(t)){const n=(0,s.fL)(t.focus,!0);if(!e.shiftKey&&(0,s.k$)(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),e.preventDefault(),!0}return!1}),s.VN),e.registerCommand(s.Zb,(e=>{const t=(0,s.dL)();if((0,s.iO)(t)){const e=t.getNodes();if(e.length>0)return e[0].selectNext(0,0),!0}else if((0,s.OP)(t)){if(function(e){const t=e.focus;return"root"===t.key&&t.offset===(0,s.Gv)().getChildrenSize()}(t))return e.preventDefault(),!0;const n=(0,s.fL)(t.focus,!1);if(!e.shiftKey&&(0,s.k$)(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),e.preventDefault(),!0}return!1}),s.VN),e.registerCommand(s.u$,(e=>{const t=(0,s.dL)();if((0,s.iO)(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectPrevious(),!0}if(!(0,s.OP)(t))return!1;if((0,i.pi)(t,!0)){const n=e.shiftKey;return e.preventDefault(),(0,i.i0)(t,n,!0),!0}return!1}),s.VN),e.registerCommand(s.Nm,(e=>{const t=(0,s.dL)();if((0,s.iO)(t)&&!M(e.target)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectNext(0,0),!0}if(!(0,s.OP)(t))return!1;const n=e.shiftKey;return!!(0,i.pi)(t,!1)&&(e.preventDefault(),(0,i.i0)(t,n,!1),!0)}),s.VN),e.registerCommand(s.aR,(t=>{if(M(t.target))return!1;const n=(0,s.dL)();if(!(0,s.OP)(n))return!1;t.preventDefault();const{anchor:r}=n,i=r.getNode();return n.isCollapsed()&&0===r.offset&&!(0,s.wd)(i)&&(0,o.f8)(i).getIndent()>0?e.dispatchCommand(s.cz,void 0):e.dispatchCommand(s.Mt,!0)}),s.VN),e.registerCommand(s.MK,(t=>{if(M(t.target))return!1;const n=(0,s.dL)();return!!(0,s.OP)(n)&&(t.preventDefault(),e.dispatchCommand(s.Mt,!1))}),s.VN),e.registerCommand(s.XN,(t=>{const n=(0,s.dL)();if(!(0,s.OP)(n))return!1;if(null!==t){if((w||b||C)&&A)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(s.WH,!1)}return e.dispatchCommand(s.K0,void 0)}),s.VN),e.registerCommand(s.Zq,(()=>{const t=(0,s.dL)();return!!(0,s.OP)(t)&&(e.blur(),!0)}),s.VN),e.registerCommand(s.zD,(t=>{const[,n]=j(t);if(n.length>0){const r=m(t.clientX,t.clientY);if(null!==r){const{offset:t,node:i}=r,o=(0,s.Xo)(i);if(null!==o){const e=(0,s.vN)();if((0,s.Gg)(o))e.anchor.set(o.getKey(),t,"text"),e.focus.set(o.getKey(),t,"text");else{const t=o.getParentOrThrow().getKey(),n=o.getIndexWithinParent()+1;e.anchor.set(t,n,"element"),e.focus.set(t,n,"element")}const n=(0,s.S9)(e);(0,s.oq)(n)}e.dispatchCommand(E,n)}return t.preventDefault(),!0}const r=(0,s.dL)();return!!(0,s.OP)(r)}),s.VN),e.registerCommand(s.XI,(e=>{const[t]=j(e),n=(0,s.dL)();return!(t&&!(0,s.OP)(n))}),s.VN),e.registerCommand(s.kE,(e=>{const[t]=j(e),n=(0,s.dL)();if(t&&!(0,s.OP)(n))return!1;const r=m(e.clientX,e.clientY);if(null!==r){const t=(0,s.Xo)(r.node);(0,s.k$)(t)&&e.preventDefault()}return!0}),s.VN),e.registerCommand(s.Hr,(()=>((0,s.UL)(),!0)),s.VN),e.registerCommand(s.LV,(t=>(f(e,(0,o.nh)(t,ClipboardEvent)?t:null),!0)),s.VN),e.registerCommand(s.dR,(t=>(async function(e,t){await f(t,(0,o.nh)(e,ClipboardEvent)?e:null),t.update((()=>{const e=(0,s.dL)();(0,s.OP)(e)?e.removeText():(0,s.iO)(e)&&e.getNodes().forEach((e=>e.remove()))}))}(t,e),!0)),s.VN),e.registerCommand(s.A1,(t=>{const[,n,r]=j(t);return n.length>0&&!r?(e.dispatchCommand(E,n),!0):!(0,s.GA)(t.target)&&null!==(0,s.dL)()&&(function(e,t){e.preventDefault(),t.update((()=>{const n=(0,s.dL)(),r=(0,o.nh)(e,InputEvent)||(0,o.nh)(e,KeyboardEvent)?null:e.clipboardData;null!=r&&null!==n&&u(r,n,t)}),{tag:"paste"})}(t,e),!0)}),s.VN))}},64739:(e,t,n)=>{"use strict";n.d(t,{B3:()=>a,Hz:()=>d,P4:()=>c,bA:()=>l,i0:()=>p,pi:()=>h,vV:()=>u});var r,i=n(31031),o=(r=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;const s=new Map;function a(e){const t=e.constructor.clone(e);return t.__parent=e.__parent,t.__next=e.__next,t.__prev=e.__prev,(0,i.F7)(e)&&(0,i.F7)(t)?(r=e,(n=t).__first=r.__first,n.__last=r.__last,n.__size=r.__size,n.__format=r.__format,n.__indent=r.__indent,n.__dir=r.__dir,n):(0,i.Gg)(e)&&(0,i.Gg)(t)?function(e,t){return e.__format=t.__format,e.__style=t.__style,e.__mode=t.__mode,e.__detail=t.__detail,e}(t,e):(0,i.Rl)(e)&&(0,i.Rl)(t)?function(e,t){return e.__textFormat=t.__textFormat,e}(t,e):t;var n,r}function l(e,t){const n=e.getStartEndPoints();if(t.isSelected(e)&&!t.isSegmented()&&!t.isToken()&&null!==n){const[r,o]=n,s=e.isBackward(),a=r.getNode(),l=o.getNode(),c=t.is(a),u=t.is(l);if(c||u){const[n,r]=(0,i.cs)(e),o=a.is(l),c=t.is(s?l:a),u=t.is(s?a:l);let d,h=0;return o?(h=n>r?r:n,d=n>r?n:r):c?(h=s?r:n,d=void 0):u&&(h=0,d=s?n:r),t.__text=t.__text.slice(h,d),t}}return t}function c(e){if("text"===e.type)return e.offset===e.getNode().getTextContentSize();const t=e.getNode();return(0,i.F7)(t)||o(177),e.offset===t.getChildrenSize()}function u(e){const t=e.getStyle(),n=function(e){const t={},n=e.split(";");for(const e of n)if(""!==e){const[n,r]=e.split(/:([^]+)/);n&&r&&(t[n.trim()]=r.trim())}return t}(t);s.set(t,n)}function d(e,t){if(null===e)return;const n=e.getStartEndPoints(),r=n?n[0]:null;if(null!==r&&"root"===r.key){const e=t(),n=(0,i.Gv)(),r=n.getFirstChild();return void(r?r.replace(e,!0):n.append(e))}const s=e.getNodes(),a=null!==r&&function(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}(r.getNode(),f);a&&-1===s.indexOf(a)&&s.push(a);for(let e=0;e<s.length;e++){const n=s[e];if(!f(n))continue;(0,i.F7)(n)||o(178);const r=t();r.setFormat(n.getFormatType()),r.setIndent(n.getIndent()),n.replace(r,!0)}}function h(e,t){const n=(0,i.fL)(e.focus,t);return(0,i.k$)(n)&&!n.isIsolated()||(0,i.F7)(n)&&!n.isInline()&&!n.canBeEmpty()}function p(e,t,n){const r=function(e){const t=e.anchor.getNode();return"rtl"===((0,i.wd)(t)?t:t.getParentOrThrow()).getDirection()}(e);!function(e,t,n,r){e.modify(t?"extend":"move",n,"character")}(e,t,n?!r:r)}function f(e){if((0,i.k$)(e))return!1;if(!(0,i.F7)(e)||(0,i._v)(e))return!1;const t=e.getFirstChild(),n=null===t||(0,i.A3)(t)||(0,i.Gg)(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}},65268:(e,t,n)=>{"use strict";n.d(t,{$r:()=>T,CS:()=>j,Cr:()=>a,EX:()=>_,Fh:()=>ue,Fk:()=>b,TF:()=>u,Xf:()=>f,Yp:()=>S,bF:()=>d,bk:()=>k,di:()=>pe,eb:()=>N,g0:()=>h,gz:()=>he,kS:()=>P,kr:()=>D,ku:()=>c,ng:()=>G,q1:()=>C,rN:()=>H,rU:()=>x,to:()=>g,uv:()=>A,xo:()=>s,yb:()=>E,zO:()=>R});var r=n(29016),i=n(31031);const o=/^(\d+(?:\.\d+)?)px$/,s={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class a extends i.HX{static getType(){return"tablecell"}static clone(e){const t=new a(e.__headerState,e.__colSpan,e.__width,e.__key);return t.__rowSpan=e.__rowSpan,t.__backgroundColor=e.__backgroundColor,t}static importDOM(){return{td:e=>({conversion:l,priority:0}),th:e=>({conversion:l,priority:0})}}static importJSON(e){const t=e.colSpan||1,n=e.rowSpan||1,r=c(e.headerState,t,e.width||void 0);return r.__rowSpan=n,r.__backgroundColor=e.backgroundColor||null,r}constructor(e=s.NO_STATUS,t=1,n,r){super(r),this.__colSpan=t,this.__rowSpan=1,this.__headerState=e,this.__width=n,this.__backgroundColor=null}createDOM(e){const t=document.createElement(this.getTag());return this.__width&&(t.style.width=`${this.__width}px`),this.__colSpan>1&&(t.colSpan=this.__colSpan),this.__rowSpan>1&&(t.rowSpan=this.__rowSpan),null!==this.__backgroundColor&&(t.style.backgroundColor=this.__backgroundColor),(0,r.Yo)(t,e.theme.tableCell,this.hasHeader()&&e.theme.tableCellHeader),t}exportDOM(e){const{element:t}=super.exportDOM(e);if(t){const e=t;e.style.border="1px solid black",this.__colSpan>1&&(e.colSpan=this.__colSpan),this.__rowSpan>1&&(e.rowSpan=this.__rowSpan),e.style.width=`${this.getWidth()||75}px`,e.style.verticalAlign="top",e.style.textAlign="start";const n=this.getBackgroundColor();null!==n?e.style.backgroundColor=n:this.hasHeader()&&(e.style.backgroundColor="#f2f3f5")}return{element:t}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,type:"tablecell",width:this.getWidth()}}getColSpan(){return this.__colSpan}setColSpan(e){return this.getWritable().__colSpan=e,this}getRowSpan(){return this.__rowSpan}setRowSpan(e){return this.getWritable().__rowSpan=e,this}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(e){return this.getWritable().__headerState=e,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(e){return this.getWritable().__width=e,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(e){this.getWritable().__backgroundColor=e}toggleHeaderStyle(e){const t=this.getWritable();return(t.__headerState&e)===e?t.__headerState-=e:t.__headerState+=e,t}hasHeaderState(e){return(this.getHeaderStyles()&e)===e}hasHeader(){return this.getLatest().__headerState!==s.NO_STATUS}updateDOM(e){return e.__headerState!==this.__headerState||e.__width!==this.__width||e.__colSpan!==this.__colSpan||e.__rowSpan!==this.__rowSpan||e.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function l(e){const t=e,n=e.nodeName.toLowerCase();let r;o.test(t.style.width)&&(r=parseFloat(t.style.width));const a=c("th"===n?s.ROW:s.NO_STATUS,t.colSpan,r);a.__rowSpan=t.rowSpan;const l=t.style.backgroundColor;""!==l&&(a.__backgroundColor=l);const d=t.style,h=d.textDecoration.split(" "),p="700"===d.fontWeight||"bold"===d.fontWeight,f=h.includes("line-through"),g="italic"===d.fontStyle,m=h.includes("underline");return{after:e=>(0===e.length&&e.push((0,i.BE)()),e),forChild:(e,t)=>{if(u(t)&&!(0,i.F7)(e)){const t=(0,i.BE)();return(0,i.A3)(e)&&"\n"===e.getTextContent()?null:((0,i.Gg)(e)&&(p&&e.toggleFormat("bold"),f&&e.toggleFormat("strikethrough"),g&&e.toggleFormat("italic"),m&&e.toggleFormat("underline")),t.append(e),t)}return e},node:a}}function c(e,t=1,n){return(0,i.U2)(new a(e,t,n))}function u(e){return e instanceof a}const d=(0,i.fA)("INSERT_TABLE_COMMAND");class h extends i.HX{static getType(){return"tablerow"}static clone(e){return new h(e.__height,e.__key)}static importDOM(){return{tr:e=>({conversion:p,priority:0})}}static importJSON(e){return f(e.height)}constructor(e,t){super(t),this.__height=e}exportJSON(){return{...super.exportJSON(),...this.getHeight()&&{height:this.getHeight()},type:"tablerow",version:1}}createDOM(e){const t=document.createElement("tr");return this.__height&&(t.style.height=`${this.__height}px`),(0,r.Yo)(t,e.theme.tableRow),t}isShadowRoot(){return!0}setHeight(e){return this.getWritable().__height=e,this.__height}getHeight(){return this.getLatest().__height}updateDOM(e){return e.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function p(e){const t=e;let n;return o.test(t.style.height)&&(n=parseFloat(t.style.height)),{node:f(n)}}function f(e){return(0,i.U2)(new h(e))}function g(e){return e instanceof h}var m,y=(m=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})&&m.__esModule&&Object.prototype.hasOwnProperty.call(m,"default")?m.default:m;const v="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function A(e,t,n=!0){const r=he();for(let o=0;o<e;o++){const e=f();for(let r=0;r<t;r++){let t=s.NO_STATUS;"object"==typeof n?(0===o&&n.rows&&(t|=s.ROW),0===r&&n.columns&&(t|=s.COLUMN)):n&&(0===o&&(t|=s.ROW),0===r&&(t|=s.COLUMN));const a=c(t),l=(0,i.BE)();l.append((0,i.MX)()),a.append(l),e.append(a)}r.append(e)}return r}function b(e){const t=(0,r.$s)(e,(e=>u(e)));return u(t)?t:null}function w(e){const t=(0,r.$s)(e,(e=>g(e)));if(g(t))return t;throw new Error("Expected table cell to be inside of table row.")}function S(e){const t=(0,r.$s)(e,(e=>pe(e)));if(pe(t))return t;throw new Error("Expected table cell to be inside of table.")}function C(e){const t=w(e);return S(t).getChildren().findIndex((e=>e.is(t)))}function E(e){return w(e).getChildren().findIndex((t=>t.is(e)))}const I=(e,t)=>e===s.BOTH||e===t?t:s.NO_STATUS;function _(e=!0){const t=(0,i.dL)();(0,i.OP)(t)||R(t)||y(118);const n=t.focus.getNode(),[r,,o]=T(n),[a,l]=D(o,r,r),u=a[0].length,{startRow:d}=l;if(e){const e=d+r.__rowSpan-1,t=a[e],n=f();for(let r=0;r<u;r++){const{cell:o,startRow:a}=t[r];if(a+o.__rowSpan-1<=e){const e=t[r].cell.__headerState,o=I(e,s.COLUMN);n.append(c(o).append((0,i.BE)()))}else o.setRowSpan(o.__rowSpan+1)}const l=o.getChildAtIndex(e);g(l)||y(145),l.insertAfter(n)}else{const e=a[d],t=f();for(let n=0;n<u;n++){const{cell:r,startRow:o}=e[n];if(o===d){const r=e[n].cell.__headerState,o=I(r,s.COLUMN);t.append(c(o).append((0,i.BE)()))}else r.setRowSpan(r.__rowSpan+1)}const n=o.getChildAtIndex(d);g(n)||y(145),n.insertBefore(t)}}function x(e=!0){const t=(0,i.dL)();(0,i.OP)(t)||R(t)||y(118);const n=t.anchor.getNode(),r=t.focus.getNode(),[o]=T(n),[a,,l]=T(r),[u,d,h]=D(l,a,o),p=u.length,f=e?Math.max(d.startColumn,h.startColumn):Math.min(d.startColumn,h.startColumn),m=e?f+a.__colSpan-1:f-1,v=l.getFirstChild();g(v)||y(120);let A=null;function b(e=s.NO_STATUS){const t=c(e).append((0,i.BE)());return null===A&&(A=t),t}let w=v;e:for(let e=0;e<p;e++){if(0!==e){const e=w.getNextSibling();g(e)||y(121),w=e}const t=u[e],n=t[m<0?0:m].cell.__headerState,r=I(n,s.ROW);if(m<0){O(w,b(r));continue}const{cell:i,startColumn:o,startRow:a}=t[m];if(o+i.__colSpan-1<=m){let n=i,o=a,s=m;for(;o!==e&&n.__rowSpan>1;){if(s-=i.__colSpan,!(s>=0)){w.append(b(r));continue e}{const{cell:e,startRow:r}=t[s];n=e,o=r}}n.insertAfter(b(r))}else i.setColSpan(i.__colSpan+1)}null!==A&&B(A)}function P(){const e=(0,i.dL)();(0,i.OP)(e)||R(e)||y(118);const t=e.anchor.getNode(),n=e.focus.getNode(),[r,,o]=T(t),[s]=T(n),[a,l,c]=D(o,r,s),{startRow:u}=l,{startRow:d}=c,h=d+s.__rowSpan-1;if(a.length===h-u+1)return void o.remove();const p=a[0].length,f=a[h+1],m=o.getChildAtIndex(h+1);for(let e=h;e>=u;e--){for(let t=p-1;t>=0;t--){const{cell:n,startRow:r,startColumn:i}=a[e][t];if(i===t&&(e===u&&r<u&&n.setRowSpan(n.__rowSpan-(r-u)),r>=u&&r+n.__rowSpan-1>h))if(n.setRowSpan(n.__rowSpan-(h-r+1)),null===m&&y(122),0===t)O(m,n);else{const{cell:e}=f[t-1];e.insertAfter(n)}}const t=o.getChildAtIndex(e);g(t)||y(123,String(e)),t.remove()}if(void 0!==f){const{cell:e}=f[0];B(e)}else{const e=a[u-1],{cell:t}=e[0];B(t)}}function k(){const e=(0,i.dL)();(0,i.OP)(e)||R(e)||y(118);const t=e.anchor.getNode(),n=e.focus.getNode(),[r,,o]=T(t),[s]=T(n),[a,l,c]=D(o,r,s),{startColumn:u}=l,{startRow:d,startColumn:h}=c,p=Math.min(u,h),f=Math.max(u+r.__colSpan-1,h+s.__colSpan-1),g=f-p+1;if(a[0].length===f-p+1)return o.selectPrevious(),void o.remove();const m=a.length;for(let e=0;e<m;e++)for(let t=p;t<=f;t++){const{cell:n,startColumn:r}=a[e][t];if(r<p){if(t===p){const e=p-r;n.setColSpan(n.__colSpan-Math.min(g,n.__colSpan-e))}}else if(r+n.__colSpan-1>f){if(t===f){const e=f-r+1;n.setColSpan(n.__colSpan-e)}}else n.remove()}const v=a[d],A=v[h+s.__colSpan];if(void 0!==A){const{cell:e}=A;B(e)}else{const e=v[h-1],{cell:t}=e;B(t)}}function B(e){const t=e.getFirstDescendant();null==t?e.selectStart():t.getParentOrThrow().selectStart()}function O(e,t){const n=e.getFirstChild();null!==n?n.insertBefore(t):e.append(t)}function N(){const e=(0,i.dL)();(0,i.OP)(e)||R(e)||y(118);const t=e.anchor.getNode(),[n,r,o]=T(t),a=n.__colSpan,l=n.__rowSpan;if(a>1){for(let e=1;e<a;e++)n.insertAfter(c(s.NO_STATUS));n.setColSpan(1)}if(l>1){const[e,t]=D(o,n,n),{startColumn:i,startRow:u}=t;let d;for(let t=1;t<l;t++){const n=u+t,o=e[n];d=(d||r).getNextSibling(),g(d)||y(125);let l=null;for(let e=0;e<i;e++){const t=o[e],r=t.cell;t.startRow===n&&(l=r),r.__colSpan>1&&(e+=r.__colSpan-1)}if(null===l)for(let e=0;e<a;e++)O(d,c(s.NO_STATUS));else for(let e=0;e<a;e++)l.insertAfter(c(s.NO_STATUS))}n.setRowSpan(1)}}function D(e,t,n){const[r,i,o]=j(e,t,n);return null===i&&y(110),null===o&&y(111),[r,i,o]}function j(e,t,n){const r=[];let i=null,o=null;function s(e,s,a){const l={cell:a,startColumn:s,startRow:e},c=a.__rowSpan,u=a.__colSpan;for(let t=0;t<c;t++){void 0===r[e+t]&&(r[e+t]=[]);for(let n=0;n<u;n++)r[e+t][s+n]=l}null!==t&&t.is(a)&&(i=l),null!==n&&n.is(a)&&(o=l)}function a(e,t){return void 0===r[e]||void 0===r[e][t]}const l=e.getChildren();for(let e=0;e<l.length;e++){const t=l[e];g(t)||y(146);const n=t.getChildren();let r=0;for(const t of n){for(u(t)||y(147);!a(e,r);)r++;s(e,r,t),r+=t.__colSpan}}return[r,i,o]}function T(e){let t;if(e instanceof a)t=e;else if("__type"in e){const n=(0,r.$s)(e,u);u(n)||y(148),t=n}else{const n=(0,r.$s)(e.getNode(),u);u(n)||y(148),t=n}const n=t.getParent();g(n)||y(149);const i=n.getParent();return pe(i)||y(150),[t,n,i]}function M(e){const[t,,n]=T(e),r=n.getChildren(),i=r.length,o=r[0].getChildren().length,s=new Array(i);for(let e=0;e<i;e++)s[e]=new Array(o);for(let e=0;e<i;e++){const n=r[e].getChildren();let i=0;for(let r=0;r<n.length;r++){for(;s[e][i];)i++;const o=n[r],a=o.__rowSpan||1,l=o.__colSpan||1;for(let t=0;t<a;t++)for(let n=0;n<l;n++)s[e+t][i+n]=o;if(t===o)return{colSpan:l,columnIndex:i,rowIndex:e,rowSpan:a};i+=l}}return null}class F{constructor(e,t,n){this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=e}getStartEndPoints(){return[this.anchor,this.focus]}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!R(e)&&this.tableKey===e.tableKey&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)}set(e,t,n){this.dirty=!0,this.tableKey=e,this.anchor.key=t,this.focus.key=n,this._cachedNodes=null}clone(){return new F(this.tableKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.focus.getNode();(0,i.F7)(t)||y(151),(0,i.S9)(t.select(0,t.getChildrenSize())).insertNodes(e)}getShape(){const e=(0,i.gI)(this.anchor.key);u(e)||y(152);const t=M(e);null===t&&y(153);const n=(0,i.gI)(this.focus.key);u(n)||y(154);const r=M(n);null===r&&y(155);const o=Math.min(t.columnIndex,r.columnIndex),s=Math.max(t.columnIndex,r.columnIndex),a=Math.min(t.rowIndex,r.rowIndex),l=Math.max(t.rowIndex,r.rowIndex);return{fromX:Math.min(o,s),fromY:Math.min(a,l),toX:Math.max(o,s),toY:Math.max(a,l)}}getNodes(){const e=this._cachedNodes;if(null!==e)return e;const t=this.anchor.getNode(),n=this.focus.getNode(),o=(0,r.$s)(t,u),s=(0,r.$s)(n,u);u(o)||y(152),u(s)||y(154);const a=o.getParent();g(a)||y(156);const l=a.getParent();pe(l)||y(157);const c=s.getParents()[1];if(c!==l){if(l.isParentOf(s)){const e=c.getParent();null==e&&y(159),this.set(this.tableKey,s.getKey(),e.getKey())}else{const e=l.getParent();null==e&&y(158),this.set(this.tableKey,e.getKey(),s.getKey())}return this.getNodes()}const[d,h,p]=D(l,o,s);let f=Math.min(h.startColumn,p.startColumn),m=Math.min(h.startRow,p.startRow),v=Math.max(h.startColumn+h.cell.__colSpan-1,p.startColumn+p.cell.__colSpan-1),A=Math.max(h.startRow+h.cell.__rowSpan-1,p.startRow+p.cell.__rowSpan-1),b=f,w=m,S=f,C=m;function E(e){const{cell:t,startColumn:n,startRow:r}=e;f=Math.min(f,n),m=Math.min(m,r),v=Math.max(v,n+t.__colSpan-1),A=Math.max(A,r+t.__rowSpan-1)}for(;f<b||m<w||v>S||A>C;){if(f<b){const e=C-w,t=b-1;for(let n=0;n<=e;n++)E(d[w+n][t]);b=t}if(m<w){const e=S-b,t=w-1;for(let n=0;n<=e;n++)E(d[t][b+n]);w=t}if(v>S){const e=C-w,t=S+1;for(let n=0;n<=e;n++)E(d[w+n][t]);S=t}if(A>C){const e=S-b,t=C+1;for(let n=0;n<=e;n++)E(d[t][b+n]);C=t}}const I=[l];let _=null;for(let e=m;e<=A;e++)for(let t=f;t<=v;t++){const{cell:n}=d[e][t],r=n.getParent();g(r)||y(160),r!==_&&I.push(r),I.push(n,...Q(n)),_=r}return(0,i._$)()||(this._cachedNodes=I),I}getTextContent(){const e=this.getNodes();let t="";for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}}function R(e){return e instanceof F}function L(){const e=(0,i.Qd)("root",0,"element"),t=(0,i.Qd)("root",0,"element");return new F("root",e,t)}function Q(e){const t=[],n=[e];for(;n.length>0;){const r=n.pop();void 0===r&&y(112),(0,i.F7)(r)&&n.unshift(...r.getChildren()),r!==e&&t.push(r)}return t}class U{constructor(e,t){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=t,this.editor=e,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.trackTable(),this.isSelecting=!1}getTable(){return this.table}removeListeners(){Array.from(this.listenersToRemove).forEach((e=>e()))}trackTable(){const e=new MutationObserver((e=>{this.editor.update((()=>{let t=!1;for(let n=0;n<e.length;n++){const r=e[n].target.nodeName;if("TABLE"===r||"TBODY"===r||"THEAD"===r||"TR"===r){t=!0;break}}if(!t)return;const n=this.editor.getElementByKey(this.tableNodeKey);if(!n)throw new Error("Expected to find TableElement in DOM");this.table=z(n)}))}));this.editor.update((()=>{const t=this.editor.getElementByKey(this.tableNodeKey);if(!t)throw new Error("Expected to find TableElement in DOM");this.table=z(t),e.observe(t,{childList:!0,subtree:!0})}))}clearHighlight(){const e=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),e.update((()=>{if(!pe((0,i.gI)(this.tableNodeKey)))throw new Error("Expected TableNode.");const t=e.getElementByKey(this.tableNodeKey);if(!t)throw new Error("Expected to find TableElement in DOM");const n=z(t);Z(e,n,null),(0,i.oq)(null),e.dispatchCommand(i.oj,void 0)}))}enableHighlightStyle(){const e=this.editor;e.update((()=>{const t=e.getElementByKey(this.tableNodeKey);if(!t)throw new Error("Expected to find TableElement in DOM");(0,r.PS)(t,e._config.theme.tableSelection),t.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1}))}disableHighlightStyle(){const e=this.editor;e.update((()=>{const t=e.getElementByKey(this.tableNodeKey);if(!t)throw new Error("Expected to find TableElement in DOM");(0,r.Yo)(t,e._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0}))}updateTableTableSelection(e){if(null!==e&&e.tableKey===this.tableNodeKey){const t=this.editor;this.tableSelection=e,this.isHighlightingCells=!0,this.disableHighlightStyle(),Z(t,this.table,this.tableSelection)}else null==e?this.clearHighlight():(this.tableNodeKey=e.tableKey,this.updateTableTableSelection(e))}setFocusCellForSelection(e,t=!1){const n=this.editor;n.update((()=>{const r=(0,i.gI)(this.tableNodeKey);if(!pe(r))throw new Error("Expected TableNode.");if(!n.getElementByKey(this.tableNodeKey))throw new Error("Expected to find TableElement in DOM");const o=e.x,s=e.y;if(this.focusCell=e,null!==this.anchorCell){const e=K(n._window);e&&e.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(this.isHighlightingCells||this.anchorX===o&&this.anchorY===s&&!t){if(o===this.focusX&&s===this.focusY)return}else this.isHighlightingCells=!0,this.disableHighlightStyle();if(this.focusX=o,this.focusY=s,this.isHighlightingCells){const t=(0,i.Xo)(e.elem);if(null!=this.tableSelection&&null!=this.anchorCellNodeKey&&u(t)&&r.is(oe(t))){const e=t.getKey();this.tableSelection=this.tableSelection.clone()||L(),this.focusCellNodeKey=e,this.tableSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),(0,i.oq)(this.tableSelection),n.dispatchCommand(i.oj,void 0),Z(n,this.table,this.tableSelection)}}}))}setAnchorCellForSelection(e){this.isHighlightingCells=!1,this.anchorCell=e,this.anchorX=e.x,this.anchorY=e.y,this.editor.update((()=>{const t=(0,i.Xo)(e.elem);if(u(t)){const e=t.getKey();this.tableSelection=null!=this.tableSelection?this.tableSelection.clone():L(),this.anchorCellNodeKey=e}}))}formatCells(e){this.editor.update((()=>{const t=(0,i.dL)();R(t)||y(11);const n=(0,i.vN)(),r=n.anchor,o=n.focus;t.getNodes().forEach((t=>{u(t)&&0!==t.getTextContentSize()&&(r.set(t.getKey(),0,"element"),o.set(t.getKey(),t.getChildrenSize(),"element"),n.formatText(e))})),(0,i.oq)(t),this.editor.dispatchCommand(i.oj,void 0)}))}clearText(){const e=this.editor;e.update((()=>{const t=(0,i.gI)(this.tableNodeKey);if(!pe(t))throw new Error("Expected TableNode.");const n=(0,i.dL)();R(n)||y(11);const r=n.getNodes().filter(u);r.length!==this.table.columns*this.table.rows?(r.forEach((e=>{if((0,i.F7)(e)){const t=(0,i.BE)(),n=(0,i.MX)();t.append(n),e.append(t),e.getChildren().forEach((e=>{e!==t&&e.remove()}))}})),Z(e,this.table,null),(0,i.oq)(null),e.dispatchCommand(i.oj,void 0)):(t.selectPrevious(),t.remove(),(0,i.Gv)().selectStart())}))}}const V="__lexicalTableSelection",K=e=>v?(e||window).getSelection():null;function H(e,t,n,o){const s=n.getRootElement();if(null===s)throw new Error("No root element.");const a=new U(n,e.getKey()),l=n._window||window;!function(e,t){e[V]=t}(t,a);const c=()=>{const e=()=>{a.isSelecting=!1,l.removeEventListener("mouseup",e),l.removeEventListener("mousemove",t)},t=n=>{setTimeout((()=>{if(1&~n.buttons&&a.isSelecting)return a.isSelecting=!1,l.removeEventListener("mouseup",e),void l.removeEventListener("mousemove",t);const r=Y(n.target);null===r||a.anchorX===r.x&&a.anchorY===r.y||(n.preventDefault(),a.setFocusCellForSelection(r))}),0)};return{onMouseMove:t,onMouseUp:e}};t.addEventListener("mousedown",(e=>{setTimeout((()=>{if(0!==e.button)return;if(!l)return;const t=Y(e.target);null!==t&&(ae(e),a.setAnchorCellForSelection(t));const{onMouseUp:n,onMouseMove:r}=c();a.isSelecting=!0,l.addEventListener("mouseup",n),l.addEventListener("mousemove",r)}),0)}));const d=e=>{0===e.button&&n.update((()=>{const t=(0,i.dL)(),n=e.target;R(t)&&t.tableKey===a.tableNodeKey&&s.contains(n)&&a.clearHighlight()}))};l.addEventListener("mousedown",d),a.listenersToRemove.add((()=>l.removeEventListener("mousedown",d))),a.listenersToRemove.add(n.registerCommand(i.Zb,(t=>se(n,t,"down",e,a)),i.Eo)),a.listenersToRemove.add(n.registerCommand(i._0,(t=>se(n,t,"up",e,a)),i.Eo)),a.listenersToRemove.add(n.registerCommand(i.u$,(t=>se(n,t,"backward",e,a)),i.Eo)),a.listenersToRemove.add(n.registerCommand(i.Nm,(t=>se(n,t,"forward",e,a)),i.Eo)),a.listenersToRemove.add(n.registerCommand(i.Zq,(e=>{const t=(0,i.dL)();if(R(t)){const n=(0,r.$s)(t.focus.getNode(),u);if(u(n))return ae(e),n.selectEnd(),!0}return!1}),i.Eo)),[i.cj,i.n2,i.Mt].forEach((t=>{a.listenersToRemove.add(n.registerCommand(t,(t=>()=>{const n=(0,i.dL)();if(!$(n,e))return!1;if(R(n))return a.clearText(),!0;if((0,i.OP)(n)){const o=(0,r.$s)(n.anchor.getNode(),(e=>u(e)));if(!u(o))return!1;const s=n.anchor.getNode(),l=n.focus.getNode(),c=e.isParentOf(s),d=e.isParentOf(l);if(c&&!d||d&&!c)return a.clearText(),!0;const h=(0,r.$s)(n.anchor.getNode(),(e=>(0,i.F7)(e))),p=h&&(0,r.$s)(h,(e=>(0,i.F7)(e)&&u(e.getParent())));if(!(0,i.F7)(p)||!(0,i.F7)(h))return!1;if(t===i.n2&&null===p.getPreviousSibling())return!0}return!1})(t),i.jw))}));const h=t=>{const n=(0,i.dL)();if(!$(n,e))return!1;if(R(n))return t.preventDefault(),t.stopPropagation(),a.clearText(),!0;if((0,i.OP)(n)){const e=(0,r.$s)(n.anchor.getNode(),(e=>u(e)));if(!u(e))return!1}return!1};function p(t){const n=e.getCordsFromCellNode(t,a.table);return e.getDOMCellFromCordsOrThrow(n.x,n.y,a.table)}return a.listenersToRemove.add(n.registerCommand(i.aR,h,i.jw)),a.listenersToRemove.add(n.registerCommand(i.MK,h,i.jw)),a.listenersToRemove.add(n.registerCommand(i.Ew,(t=>{const n=(0,i.dL)();if(!$(n,e))return!1;if(R(n))return a.formatCells(t),!0;if((0,i.OP)(n)){const e=(0,r.$s)(n.anchor.getNode(),(e=>u(e)));if(!u(e))return!1}return!1}),i.jw)),a.listenersToRemove.add(n.registerCommand(i.RO,(t=>{const n=(0,i.dL)();if(!R(n)||!$(n,e))return!1;const r=n.anchor.getNode(),o=n.focus.getNode();if(!u(r)||!u(o))return!1;const[s,a,l]=D(e,r,o),c=Math.max(a.startRow,l.startRow),d=Math.max(a.startColumn,l.startColumn),h=Math.min(a.startRow,l.startRow),p=Math.min(a.startColumn,l.startColumn);for(let e=h;e<=c;e++)for(let n=p;n<=d;n++){const r=s[e][n].cell;r.setFormat(t);const o=r.getChildren();for(let e=0;e<o.length;e++){const n=o[e];(0,i.F7)(n)&&!n.isInline()&&n.setFormat(t)}}return!0}),i.jw)),a.listenersToRemove.add(n.registerCommand(i.yF,(t=>{const o=(0,i.dL)();if(!$(o,e))return!1;if(R(o))return a.clearHighlight(),!1;if((0,i.OP)(o)){const s=(0,r.$s)(o.anchor.getNode(),(e=>u(e)));if(!u(s))return!1;if("string"==typeof t){const r=ce(n,o,e);if(r)return le(r,e,[(0,i.MX)(t)]),!0}}return!1}),i.jw)),o&&a.listenersToRemove.add(n.registerCommand(i.dB,(t=>{const n=(0,i.dL)();if(!(0,i.OP)(n)||!n.isCollapsed()||!$(n,e))return!1;const r=ie(n.anchor.getNode());if(null===r)return!1;ae(t);const o=e.getCordsFromCellNode(r,a.table);return J(a,e,o.x,o.y,t.shiftKey?"backward":"forward"),!0}),i.jw)),a.listenersToRemove.add(n.registerCommand(i.m$,(t=>e.isSelected()),i.Eo)),a.listenersToRemove.add(n.registerCommand(i.zr,(e=>{const{nodes:t,selection:n}=e,o=n.getStartEndPoints(),s=R(n),a=(0,i.OP)(n)&&null!==(0,r.$s)(n.anchor.getNode(),(e=>u(e)))&&null!==(0,r.$s)(n.focus.getNode(),(e=>u(e)))||s;if(1!==t.length||!pe(t[0])||!a||null===o)return!1;const[l]=o,c=t[0],d=c.getChildren(),h=c.getFirstChildOrThrow().getChildrenSize(),p=c.getChildrenSize(),f=(0,r.$s)(l.getNode(),(e=>u(e))),m=f&&(0,r.$s)(f,(e=>g(e))),y=m&&(0,r.$s)(m,(e=>pe(e)));if(!u(f)||!g(m)||!pe(y))return!1;const v=m.getIndexWithinParent(),A=Math.min(y.getChildrenSize()-1,v+p-1),b=f.getIndexWithinParent(),w=Math.min(m.getChildrenSize()-1,b+h-1),S=Math.min(b,w),C=Math.min(v,A),E=Math.max(b,w),I=Math.max(v,A),_=y.getChildren();let x,P,k=0;for(let e=C;e<=I;e++){const t=_[e];if(!g(t))return!1;const n=d[k];if(!g(n))return!1;const r=t.getChildren(),o=n.getChildren();let s=0;for(let t=S;t<=E;t++){const n=r[t];if(!u(n))return!1;const a=o[s];if(!u(a))return!1;e===C&&t===S?x=n.getKey():e===I&&t===E&&(P=n.getKey());const l=n.getChildren();a.getChildren().forEach((e=>{(0,i.Gg)(e)?((0,i.BE)().append(e),n.append(e)):n.append(e)})),l.forEach((e=>e.remove())),s++}k++}if(x&&P){const e=L();e.set(t[0].getKey(),x,P),(0,i.oq)(e)}return!0}),i.jw)),a.listenersToRemove.add(n.registerCommand(i.oj,(()=>{const t=(0,i.dL)(),r=(0,i.DN)();if((0,i.OP)(t)){const{anchor:r,focus:o}=t,s=r.getNode(),u=o.getNode(),d=ie(s),h=ie(u),f=!(!d||!e.is(oe(d))),g=!(!h||!e.is(oe(h))),m=f!==g,y=f&&g,v=t.isBackward();if(m){const r=t.clone();g?r.focus.set(e.getParentOrThrow().getKey(),e.getIndexWithinParent(),"element"):r.anchor.set(e.getParentOrThrow().getKey(),v?e.getIndexWithinParent()+1:e.getIndexWithinParent(),"element"),(0,i.oq)(r),q(n,a)}else y&&(d.is(h)||(a.setAnchorCellForSelection(p(d)),a.setFocusCellForSelection(p(h),!0),a.isSelecting||setTimeout((()=>{const{onMouseUp:e,onMouseMove:t}=c();a.isSelecting=!0,l.addEventListener("mouseup",e),l.addEventListener("mousemove",t)}),0)))}else if(t&&R(t)&&t.is(r)&&t.tableKey===e.getKey()){const r=K(n._window);if(r&&r.anchorNode&&r.focusNode){const o=(0,i.Xo)(r.focusNode),s=o&&!e.is(oe(o)),a=(0,i.Xo)(r.anchorNode),l=a&&e.is(oe(a));if(s&&l&&r.rangeCount>0){const o=(0,i.Ug)(r,n);o&&(o.anchor.set(e.getKey(),t.isBackward()?e.getChildrenSize():0,"element"),r.removeAllRanges(),(0,i.oq)(o))}}}return t&&!t.is(r)&&(R(t)||R(r))&&a.tableSelection&&!a.tableSelection.is(r)?(R(t)&&t.tableKey===a.tableNodeKey?a.updateTableTableSelection(t):!R(t)&&R(r)&&r.tableKey===a.tableNodeKey&&a.updateTableTableSelection(null),!1):(a.hasHijackedSelectionStyles&&!e.isSelected()?function(e,t){t.enableHighlightStyle(),W(t.table,(e=>{const t=e.elem;e.highlighted=!1,re(0,e),t.getAttribute("style")||t.removeAttribute("style")}))}(0,a):!a.hasHijackedSelectionStyles&&e.isSelected()&&q(n,a),!1)}),i.jw)),a.listenersToRemove.add(n.registerCommand(i.K0,(()=>{const t=(0,i.dL)();if(!(0,i.OP)(t)||!t.isCollapsed()||!$(t,e))return!1;const r=ce(n,t,e);return!!r&&(le(r,e),!0)}),i.jw)),a}function G(e){return e[V]}function Y(e){let t=e;for(;null!=t;){const e=t.nodeName;if("TD"===e||"TH"===e){const e=t._cell;return void 0===e?null:e}t=t.parentNode}return null}function z(e){const t=[],n={columns:0,domRows:t,rows:0};let r=e.firstChild,i=0,o=0;for(t.length=0;null!=r;){const e=r.nodeName;if("TD"===e||"TH"===e){const e={elem:r,hasBackgroundColor:""!==r.style.backgroundColor,highlighted:!1,x:i,y:o};r._cell=e;let n=t[o];void 0===n&&(n=t[o]=[]),n[i]=e}else{const e=r.firstChild;if(null!=e){r=e;continue}}const n=r.nextSibling;if(null!=n){i++,r=n;continue}const s=r.parentNode;if(null!=s){const e=s.nextSibling;if(null==e)break;o++,i=0,r=e}}return n.columns=i+1,n.rows=o+1,n}function Z(e,t,n){const r=new Set(n?n.getNodes():[]);W(t,((e,t)=>{const n=e.elem;r.has(t)?(e.highlighted=!0,ne(0,e)):(e.highlighted=!1,re(0,e),n.getAttribute("style")||n.removeAttribute("style"))}))}function W(e,t){const{domRows:n}=e;for(let e=0;e<n.length;e++){const r=n[e];if(r)for(let n=0;n<r.length;n++){const o=r[n];if(!o)continue;const s=(0,i.Xo)(o.elem);null!==s&&t(o,s,{x:n,y:e})}}}function q(e,t){t.disableHighlightStyle(),W(t.table,(e=>{e.highlighted=!0,ne(0,e)}))}const J=(e,t,n,r,i)=>{const o="forward"===i;switch(i){case"backward":case"forward":return n!==(o?e.table.columns-1:0)?ee(t.getCellNodeFromCordsOrThrow(n+(o?1:-1),r,e.table),o):r!==(o?e.table.rows-1:0)?ee(t.getCellNodeFromCordsOrThrow(o?0:e.table.columns-1,r+(o?1:-1),e.table),o):o?t.selectNext():t.selectPrevious(),!0;case"up":return 0!==r?ee(t.getCellNodeFromCordsOrThrow(n,r-1,e.table),!1):t.selectPrevious(),!0;case"down":return r!==e.table.rows-1?ee(t.getCellNodeFromCordsOrThrow(n,r+1,e.table),!0):t.selectNext(),!0;default:return!1}},X=(e,t,n,r,i)=>{const o="forward"===i;switch(i){case"backward":case"forward":return n!==(o?e.table.columns-1:0)&&e.setFocusCellForSelection(t.getDOMCellFromCordsOrThrow(n+(o?1:-1),r,e.table)),!0;case"up":return 0!==r&&(e.setFocusCellForSelection(t.getDOMCellFromCordsOrThrow(n,r-1,e.table)),!0);case"down":return r!==e.table.rows-1&&(e.setFocusCellForSelection(t.getDOMCellFromCordsOrThrow(n,r+1,e.table)),!0);default:return!1}};function $(e,t){if((0,i.OP)(e)||R(e)){const n=t.isParentOf(e.anchor.getNode()),r=t.isParentOf(e.focus.getNode());return n&&r}return!1}function ee(e,t){t?e.selectStart():e.selectEnd()}const te="172,206,247";function ne(e,t){const n=t.elem,r=(0,i.Xo)(n);u(r)||y(131),null===r.getBackgroundColor()?n.style.setProperty("background-color",`rgb(${te})`):n.style.setProperty("background-image",`linear-gradient(to right, rgba(${te},0.85), rgba(${te},0.85))`),n.style.setProperty("caret-color","transparent")}function re(e,t){const n=t.elem,r=(0,i.Xo)(n);u(r)||y(131),null===r.getBackgroundColor()&&n.style.removeProperty("background-color"),n.style.removeProperty("background-image"),n.style.removeProperty("caret-color")}function ie(e){const t=(0,r.$s)(e,u);return u(t)?t:null}function oe(e){const t=(0,r.$s)(e,pe);return pe(t)?t:null}function se(e,t,n,o,s){if(("up"===n||"down"===n)&&function(e){const t=e.getRootElement();return!!t&&t.hasAttribute("aria-controls")&&"typeahead-menu"===t.getAttribute("aria-controls")}(e))return!1;const a=(0,i.dL)();if(!$(a,o)){if("backward"===n&&(0,i.OP)(a)&&a.isCollapsed()){const e=a.anchor.type,n=a.anchor.offset;if("element"!==e&&("text"!==e||0!==n))return!1;const o=a.anchor.getNode();if(!o)return!1;const s=(0,r.$s)(o,(e=>(0,i.F7)(e)&&!e.isInline()));if(!s)return!1;const l=s.getPreviousSibling();return!(!l||!pe(l)||(ae(t),l.selectEnd(),0))}return!1}if((0,i.OP)(a)&&a.isCollapsed()){const{anchor:l,focus:c}=a,d=(0,r.$s)(l.getNode(),u),h=(0,r.$s)(c.getNode(),u);if(!u(d)||!d.is(h))return!1;const p=oe(d);if(p!==o&&null!=p){const r=e.getElementByKey(p.getKey());if(null!=r)return s.table=z(r),se(e,t,n,p,s)}if("backward"===n||"forward"===n){const e=l.type,s=l.offset,c=l.getNode();if(!c)return!1;const d=a.getNodes();return(1!==d.length||!(0,i.k$)(d[0]))&&!!function(e,t,n,o){return function(e,t,n){return"element"===e&&("backward"===n?null===t.getPreviousSibling():null===t.getNextSibling())}(e,n,o)||function(e,t,n,o){const s=(0,r.$s)(n,(e=>(0,i.F7)(e)&&!e.isInline()));if(!s)return!1;const a="backward"===o?0===t:t===n.getTextContentSize();return"text"===e&&a&&("backward"===o?null===s.getPreviousSibling():null===s.getNextSibling())}(e,t,n,o)}(e,s,c,n)&&function(e,t,n,o){const s=(0,r.$s)(t,u);if(!u(s))return!1;const[a,l]=D(n,s,s);if(!function(e,t,n){const r=e[0][0],i=e[e.length-1][e[0].length-1],{startColumn:o,startRow:s}=t;return"backward"===n?o===r.startColumn&&s===r.startRow:o===i.startColumn&&s===i.startRow}(a,l,o))return!1;const c=function(e,t,n){const o=(0,r.$s)(e,(e=>(0,i.F7)(e)&&!e.isInline()));if(!o)return;const s="backward"===t?o.getPreviousSibling():o.getNextSibling();return s&&pe(s)?s:"backward"===t?n.getPreviousSibling():n.getNextSibling()}(t,o,n);return!(!c||pe(c)||(ae(e),"backward"===o?c.selectEnd():c.selectStart(),0))}(t,c,o,n)}const f=e.getElementByKey(d.__key),g=e.getElementByKey(l.key);if(null==g||null==f)return!1;let m;if("element"===l.type)m=g.getBoundingClientRect();else{const e=window.getSelection();if(null===e||0===e.rangeCount)return!1;m=e.getRangeAt(0).getBoundingClientRect()}const y="up"===n?d.getFirstChild():d.getLastChild();if(null==y)return!1;const v=e.getElementByKey(y.__key);if(null==v)return!1;const A=v.getBoundingClientRect();if("up"===n?A.top>m.top-m.height:m.bottom+m.height>A.bottom){ae(t);const e=o.getCordsFromCellNode(d,s.table);if(!t.shiftKey)return J(s,o,e.x,e.y,n);{const t=o.getDOMCellFromCordsOrThrow(e.x,e.y,s.table);s.setAnchorCellForSelection(t),s.setFocusCellForSelection(t,!0)}return!0}}else if(R(a)){const{anchor:i,focus:l}=a,c=(0,r.$s)(i.getNode(),u),d=(0,r.$s)(l.getNode(),u),[h]=a.getNodes(),p=e.getElementByKey(h.getKey());if(!u(c)||!u(d)||!pe(h)||null==p)return!1;s.updateTableTableSelection(a);const f=z(p),g=o.getCordsFromCellNode(c,f),m=o.getDOMCellFromCordsOrThrow(g.x,g.y,f);if(s.setAnchorCellForSelection(m),ae(t),t.shiftKey){const e=o.getCordsFromCellNode(d,f);return X(s,h,e.x,e.y,n)}return d.selectEnd(),!0}return!1}function ae(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}function le(e,t,n){const r=(0,i.BE)();"first"===e?t.insertBefore(r):t.insertAfter(r),r.append(...n||[]),r.selectEnd()}function ce(e,t,n){const i=n.getParent();if(!i)return;const o=e.getElementByKey(i.getKey());if(!o)return;const s=window.getSelection();if(!s||s.anchorNode!==o)return;const a=(0,r.$s)(t.anchor.getNode(),(e=>u(e)));if(!a)return;const l=(0,r.$s)(a,(e=>pe(e)));if(!pe(l)||!l.is(n))return;const[c,d]=D(n,a,a),h=c[0][0],p=c[c.length-1][c[0].length-1],{startRow:f,startColumn:g}=d,m=f===h.startRow&&g===h.startColumn,y=f===p.startRow&&g===p.startColumn;return m?"first":y?"last":void 0}class ue extends i.HX{static getType(){return"table"}static clone(e){return new ue(e.__key)}static importDOM(){return{table:e=>({conversion:de,priority:1})}}static importJSON(e){return he()}constructor(e){super(e)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(e,t){const n=document.createElement("table");return(0,r.Yo)(n,e.theme.table),n}updateDOM(){return!1}exportDOM(e){return{...super.exportDOM(e),after:e=>{if(e){const t=e.cloneNode(),n=document.createElement("colgroup"),r=document.createElement("tbody");(0,i.Re)(e)&&r.append(...e.children);const o=this.getFirstChildOrThrow();if(!g(o))throw new Error("Expected to find row node.");const s=o.getChildrenSize();for(let e=0;e<s;e++){const e=document.createElement("col");n.append(e)}return t.replaceChildren(n,r),t}}}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(e,t){const{rows:n,domRows:r}=t;for(let t=0;t<n;t++){const n=r[t];if(null==n)continue;const o=n.findIndex((t=>{if(!t)return;const{elem:n}=t;return(0,i.Xo)(n)===e}));if(-1!==o)return{x:o,y:t}}throw new Error("Cell not found in table.")}getDOMCellFromCords(e,t,n){const{domRows:r}=n,i=r[t];if(null==i)return null;const o=i[e];return null==o?null:o}getDOMCellFromCordsOrThrow(e,t,n){const r=this.getDOMCellFromCords(e,t,n);if(!r)throw new Error("Cell not found at cords.");return r}getCellNodeFromCords(e,t,n){const r=this.getDOMCellFromCords(e,t,n);if(null==r)return null;const o=(0,i.Xo)(r.elem);return u(o)?o:null}getCellNodeFromCordsOrThrow(e,t,n){const r=this.getCellNodeFromCords(e,t,n);if(!r)throw new Error("Node at cords not TableCellNode.");return r}canSelectBefore(){return!0}canIndent(){return!1}}function de(e){return{node:he()}}function he(){return(0,i.U2)(new ue)}function pe(e){return e instanceof ue}},29016:(e,t,n)=>{"use strict";n.d(t,{$s:()=>y,JB:()=>A,MZ:()=>S,PS:()=>p,Yo:()=>h,_G:()=>f,bV:()=>w,f8:()=>m,nh:()=>b,qV:()=>u,yD:()=>g,z8:()=>v});var r,i=n(31031),o=(r=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;const s="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,a=s&&"documentMode"in document?document.documentMode:null,l=(s&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),s&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent));!(!s||!("InputEvent"in window)||a)&&new window.InputEvent("input"),s&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),s&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window.MSStream,s&&/Android/.test(navigator.userAgent),s&&/^(?=.*Chrome).*/i.test(navigator.userAgent);function c(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}function u(...e){return()=>{e.forEach((e=>e()))}}s&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent);const d=l;function h(e,...t){const n=c(...t);n.length>0&&e.classList.add(...n)}function p(e,...t){const n=c(...t);n.length>0&&e.classList.remove(...n)}function f(e){let t=e;if((0,i.F7)(t)&&t.getChildrenSize()>0)t=t.getLastChild();else{let e=null;for(;null===e&&null!==t;)e=t.getPreviousSibling(),t=null===e?t.getParent():e}return t}function g(e,t){let n=e;for(;null!=n;){if(n instanceof t)return n;n=n.getParent()}return null}function m(e){const t=y(e,(e=>(0,i.F7)(e)&&!e.isInline()));return(0,i.F7)(t)||o(4,e.__key),t}const y=(e,t)=>{let n=e;for(;n!==(0,i.Gv)()&&null!=n;){if(t(n))return n;n=n.getParent()}return null};function v(e){const t=(0,i.dL)()||(0,i.DN)();if((0,i.OP)(t)){const{focus:n}=t,r=n.getNode(),o=n.offset;if((0,i._v)(r)){const t=r.getChildAtIndex(o);null==t?r.append(e):t.insertBefore(e),e.selectNext()}else{let t,n;(0,i.Gg)(r)?(t=r.getParentOrThrow(),n=r.getIndexWithinParent(),o>0&&(n+=1,r.splitText(o))):(t=r,n=o);const[,s]=(0,i.z9)(t,n);s.insertBefore(e),s.selectStart()}}else{if(null!=t){const n=t.getNodes();n[n.length-1].getTopLevelElementOrThrow().insertAfter(e)}else(0,i.Gv)().append(e);const n=(0,i.BE)();e.insertAfter(n),n.select()}return e.getLatest()}function A(e,t){const n=t();return e.replace(n),n.append(e),n}function b(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name}function w(e,t){const n=e.getFirstChild();null!==n?n.insertBefore(t):e.append(t)}function S(e){if(d)return 1;let t=1;for(;e;)t*=Number(window.getComputedStyle(e).getPropertyValue("zoom")),e=e.parentElement;return t}},20038:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}n.d(t,{g7:()=>s});var i=n(2784);function o(...e){return t=>e.forEach((e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t)))}const s=(0,i.forwardRef)(((e,t)=>{const{children:n,...o}=e,s=i.Children.toArray(n),l=s.find(c);if(l){const e=l.props.children,n=s.map((t=>t===l?i.Children.count(e)>1?i.Children.only(null):(0,i.isValidElement)(e)?e.props.children:null:t));return(0,i.createElement)(a,r({},o,{ref:t}),(0,i.isValidElement)(e)?(0,i.cloneElement)(e,void 0,n):null)}return(0,i.createElement)(a,r({},o,{ref:t}),n)}));s.displayName="Slot";const a=(0,i.forwardRef)(((e,t)=>{const{children:n,...r}=e;return(0,i.isValidElement)(n)?(0,i.cloneElement)(n,{...u(r,n.props),ref:t?o(t,n.ref):n.ref}):i.Children.count(n)>1?i.Children.only(null):null}));a.displayName="SlotClone";const l=({children:e})=>(0,i.createElement)(i.Fragment,null,e);function c(e){return(0,i.isValidElement)(e)&&e.type===l}function u(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...e)=>{o(...e),i(...e)}:i&&(n[r]=i):"style"===r?n[r]={...i,...o}:"className"===r&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}},31031:(e,t,n)=>{"use strict";function r(e){return{}}n.d(t,{$l:()=>m,A1:()=>d,A3:()=>fr,BE:()=>Wi,BM:()=>V,CK:()=>zi,DN:()=>si,Eo:()=>eo,Ew:()=>g,F7:()=>Fi,GA:()=>Xe,Gg:()=>Nr,Gv:()=>mt,H2:()=>ot,HX:()=>Mi,Hr:()=>U,Ij:()=>Li,Jh:()=>ro,K0:()=>c,K8:()=>Ft,KB:()=>Xi,Kr:()=>s,LV:()=>L,MK:()=>k,MX:()=>Or,Mt:()=>a,Nm:()=>A,Nr:()=>K,OJ:()=>S,OP:()=>Kr,PU:()=>N,Qd:()=>Rr,R2:()=>Sr,RG:()=>Yi,RJ:()=>h,RO:()=>T,Re:()=>tn,Rl:()=>qi,S3:()=>Tr,S9:()=>Ze,T:()=>pr,U2:()=>Zt,UL:()=>jt,Ug:()=>ri,VN:()=>Ji,WH:()=>l,XI:()=>M,XN:()=>I,Xo:()=>pt,Zb:()=>E,Zq:()=>P,_$:()=>bi,_0:()=>C,_v:()=>zt,aR:()=>x,af:()=>$e,bg:()=>en,cA:()=>O,cj:()=>p,cs:()=>zr,cz:()=>D,dB:()=>B,dL:()=>oi,dR:()=>Q,ek:()=>$r,fA:()=>r,fL:()=>Lt,g8:()=>b,gI:()=>dt,h5:()=>ni,iO:()=>Gr,jw:()=>to,k$:()=>Qi,kE:()=>F,lv:()=>rn,m$:()=>Y,mY:()=>R,n2:()=>f,oC:()=>xi,od:()=>di,oj:()=>i,oq:()=>vt,r0:()=>H,rc:()=>Mr,u$:()=>w,u6:()=>$i,vN:()=>ti,wd:()=>Vi,yF:()=>u,yb:()=>Z,yn:()=>G,z9:()=>$t,zD:()=>j,zq:()=>y,zr:()=>o});const i={},o={},s={},a={},l={},c={},u={},d={},h={},p={},f={},g={},m={},y={},v={},A={},b={},w={},S={},C={},E={},I={},_={},x={},P={},k={},B={},O={},N={},D={},j={},T={},M={},F={},R={},L={},Q={},U={},V={},K={},H={},G={},Y={},z={},Z={};var W=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const q="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,J=q&&"documentMode"in document?document.documentMode:null,X=q&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),$=q&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),ee=!(!q||!("InputEvent"in window)||J)&&"getTargetRanges"in new window.InputEvent("input"),te=q&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),ne=q&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,re=q&&/Android/.test(navigator.userAgent),ie=q&&/^(?=.*Chrome).*/i.test(navigator.userAgent),oe=q&&re&&ie,se=q&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!ie,ae=1,le=3,ce=0,ue=1,de=2,he=4,pe=8,fe=3|he|pe|240,ge=1,me=2,ye=3,ve=4,Ae=5,be=6,we=te||ne||se?" ":"​",Se="\n\n",Ce=$?" ":we,Ee="֑-߿יִ-﷽ﹰ-ﻼ",Ie="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",_e=new RegExp("^[^"+Ie+"]*["+Ee+"]"),xe=new RegExp("^[^"+Ee+"]*["+Ie+"]"),Pe={bold:1,code:16,highlight:128,italic:2,strikethrough:he,subscript:32,superscript:64,underline:pe},ke={directionless:1,unmergeable:2},Be={center:me,end:be,justify:ve,left:ge,right:ye,start:Ae},Oe={[me]:"center",[be]:"end",[ve]:"justify",[ge]:"left",[ye]:"right",[Ae]:"start"},Ne={normal:0,segmented:2,token:1},De={0:"normal",2:"segmented",1:"token"};function je(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}const Te=100;let Me=!1,Fe=0;function Re(e){Fe=e.timeStamp}function Le(e,t,n){return t.__lexicalLineBreak===e||void 0!==e[`__lexicalKey_${n._key}`]}function Qe(e,t,n){const r=Xt(n._window);let i=null,o=null;null!==r&&r.anchorNode===e&&(i=r.anchorOffset,o=r.focusOffset);const s=e.nodeValue;null!==s&&_t(t,s,i,o,!1)}function Ue(e,t,n){if(Kr(e)){const t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return t.nodeType===le&&n.isAttached()}function Ve(e,t,n){Me=!0;const r=performance.now()-Fe>Te;try{Ti(e,(()=>{const i=oi()||function(e){return e.getEditorState().read((()=>{const e=oi();return null!==e?e.clone():null}))}(e),o=new Map,s=e.getRootElement(),a=e._editorState,l=e._blockCursorElement;let c=!1,u="";for(let n=0;n<t.length;n++){const d=t[n],h=d.type,p=d.target;let f=pt(p,a);if(!(null===f&&p!==s||Qi(f)))if("characterData"===h)r&&Nr(f)&&Ue(i,p,f)&&Qe(p,f,e);else if("childList"===h){c=!0;const t=d.addedNodes;for(let n=0;n<t.length;n++){const r=t[n],i=ht(r),o=r.parentNode;if(null!=o&&r!==l&&null===i&&("BR"!==r.nodeName||!Le(r,o,e))){if($){const e=r.innerText||r.nodeValue;e&&(u+=e)}o.removeChild(r)}}const n=d.removedNodes,r=n.length;if(r>0){let t=0;for(let i=0;i<r;i++){const r=n[i];("BR"===r.nodeName&&Le(r,p,e)||l===r)&&(p.appendChild(r),t++)}r!==t&&(p===s&&(f=yt(a)),o.set(p,f))}}}if(o.size>0)for(const[t,n]of o)if(Fi(n)){const r=n.getChildrenKeys();let i=t.firstChild;for(let n=0;n<r.length;n++){const o=r[n],s=e.getElementByKey(o);null!==s&&(null==i?(t.appendChild(s),i=s):i!==s&&t.replaceChild(s,i),i=i.nextSibling)}}else Nr(n)&&n.markDirty();const d=n.takeRecords();if(d.length>0){for(let t=0;t<d.length;t++){const n=d[t],r=n.addedNodes,i=n.target;for(let t=0;t<r.length;t++){const n=r[t],o=n.parentNode;null==o||"BR"!==n.nodeName||Le(n,i,e)||o.removeChild(n)}}n.takeRecords()}null!==i&&(c&&(i.dirty=!0,vt(i)),$&&Qt(e)&&i.insertRawText(u))}))}finally{Me=!1}}function Ke(e){const t=e._observer;null!==t&&Ve(e,t.takeRecords(),t)}function He(e){!function(e){0===Fe&&Yt(e).addEventListener("textInput",Re,!0)}(e),e._observer=new MutationObserver(((t,n)=>{Ve(e,t,n)}))}function Ge(e,t){const n=e.__mode,r=e.__format,i=e.__style,o=t.__mode,s=t.__format,a=t.__style;return!(null!==n&&n!==o||null!==r&&r!==s||null!==i&&i!==a)}function Ye(e,t){const n=e.mergeWithSibling(t),r=Ei()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function ze(e){let t,n,r=e;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(t=r.getPreviousSibling())&&Nr(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){if(Ge(t,r)){r=Ye(t,r);break}break}t.remove()}for(;null!==(n=r.getNextSibling())&&Nr(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(Ge(r,n)){r=Ye(r,n);break}break}n.remove()}}else r.remove()}function Ze(e){return We(e.anchor),We(e.focus),e}function We(e){for(;"element"===e.type;){const t=e.getNode(),n=e.offset;let r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),Nr(r)){e.set(r.__key,i?r.getTextContentSize():0,"text");break}if(!Fi(r))break;e.set(r.__key,i?r.getChildrenSize():0,"element")}}let qe=1;const Je="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function Xe(e){const t=document.activeElement;if(null===t)return!1;const n=t.nodeName;return Qi(pt(e))&&("INPUT"===n||"TEXTAREA"===n||"true"===t.contentEditable&&null==t.__lexicalEditor)}function $e(e,t,n){const r=e.getRootElement();try{return null!==r&&r.contains(t)&&r.contains(n)&&null!==t&&!Xe(t)&&et(t)===e}catch(e){return!1}}function et(e){let t=e;for(;null!=t;){const e=t.__lexicalEditor;if(null!=e)return e;t=Ht(t)}return null}function tt(e){return e.isToken()||e.isSegmented()}function nt(e){return e.nodeType===le}function rt(e){let t=e;for(;null!=t;){if(nt(t))return t;t=t.firstChild}return null}function it(e,t,n){const r=Pe[t];if(null!==n&&(e&r)==(n&r))return e;let i=e^r;return"subscript"===t?i&=~Pe.superscript:"superscript"===t&&(i&=~Pe.subscript),i}function ot(e){return Nr(e)||fr(e)||Qi(e)}function st(e,t){if(null!=t)return void(e.__key=t);wi(),Si();const n=Ei(),r=Ci(),i=""+qe++;r._nodeMap.set(i,e),Fi(e)?n._dirtyElements.set(i,!0):n._dirtyLeaves.add(i),n._cloneNotNeeded.add(i),n._dirtyType=ue,e.__key=i}function at(e){const t=e.getParent();if(null!==t){const n=e.getWritable(),r=t.getWritable(),i=e.getPreviousSibling(),o=e.getNextSibling();if(null===i)if(null!==o){const e=o.getWritable();r.__first=o.__key,e.__prev=null}else r.__first=null;else{const e=i.getWritable();if(null!==o){const t=o.getWritable();t.__prev=e.__key,e.__next=t.__key}else e.__next=null;n.__prev=null}if(null===o)if(null!==i){const e=i.getWritable();r.__last=i.__key,e.__next=null}else r.__last=null;else{const e=o.getWritable();if(null!==i){const t=i.getWritable();t.__next=e.__key,e.__prev=t.__key}else e.__prev=null;n.__next=null}r.__size--,n.__parent=null}}function lt(e){Si();const t=e.getLatest(),n=t.__parent,r=Ci(),i=Ei(),o=r._nodeMap,s=i._dirtyElements;null!==n&&function(e,t,n){let r=e;for(;null!==r;){if(n.has(r))return;const e=t.get(r);if(void 0===e)break;n.set(r,!1),r=e.__parent}}(n,o,s);const a=t.__key;i._dirtyType=ue,Fi(e)?s.set(a,!0):i._dirtyLeaves.add(a)}function ct(e){wi();const t=Ei(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){const e=dt(n);null!==e&&e.getWritable()}if(null!==e){const t=dt(e);null!==t&&t.getWritable()}}}function ut(){return bi()?null:Ei()._compositionKey}function dt(e,t){const n=(t||Ci())._nodeMap.get(e);return void 0===n?null:n}function ht(e,t){const n=e[`__lexicalKey_${Ei()._key}`];return void 0!==n?dt(n,t):null}function pt(e,t){let n=e;for(;null!=n;){const e=ht(n,t);if(null!==e)return e;n=Ht(n)}return null}function ft(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function gt(e){return e.read((()=>mt().getTextContent()))}function mt(){return yt(Ci())}function yt(e){return e._nodeMap.get("root")}function vt(e){wi();const t=Ci();null!==e&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function At(e){const t=Ei(),n=function(e,t){let n=e;for(;null!=n;){const e=n[`__lexicalKey_${t._key}`];if(void 0!==e)return e;n=Ht(n)}return null}(e,t);return null===n?e===t.getRootElement()?dt("root"):null:dt(n)}function bt(e,t){return t?e.getTextContentSize():0}function wt(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function St(e){const t=[];let n=e;for(;null!==n;)t.push(n),n=n._parentEditor;return t}function Ct(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function Et(e){return e.nodeType===le?e.nodeValue:null}function It(e,t,n){const r=Xt(t._window);if(null===r)return;const i=r.anchorNode;let{anchorOffset:o,focusOffset:s}=r;if(null!==i){let t=Et(i);const r=pt(i);if(null!==t&&Nr(r)){if(t===we&&n){const e=n.length;t=n,o=e,s=e}null!==t&&_t(r,t,o,s,e)}}}function _t(e,t,n,r,i){let o=e;if(o.isAttached()&&(i||!o.isDirty())){const s=o.isComposing();let a=t;(s||i)&&t[t.length-1]===we&&(a=t.slice(0,-1));const l=o.getTextContent();if(i||a!==l){if(""===a){if(ct(null),te||ne||se)o.remove();else{const e=Ei();setTimeout((()=>{e.update((()=>{o.isAttached()&&o.remove()}))}),20)}return}const t=o.getParent(),i=si(),l=o.getTextContentSize(),c=ut(),u=o.getKey();if(o.isToken()||null!==c&&u===c&&!s||Kr(i)&&(null!==t&&!t.canInsertTextBefore()&&0===i.anchor.offset||i.anchor.key===e.__key&&0===i.anchor.offset&&!o.canInsertTextBefore()&&!s||i.focus.key===e.__key&&i.focus.offset===l&&!o.canInsertTextAfter()&&!s))return void o.markDirty();const d=oi();if(!Kr(d)||null===n||null===r)return void o.setTextContent(a);if(d.setTextNodeRange(o,n,o,r),o.isSegmented()){const e=Or(o.getTextContent());o.replace(e),o=e}o.setTextContent(a)}}}function xt(e){return"ArrowLeft"===e}function Pt(e){return"ArrowRight"===e}function kt(e,t){return X?e:t}function Bt(e){return"Enter"===e}function Ot(e){return"Backspace"===e}function Nt(e){return"Delete"===e}function Dt(e,t,n){return"a"===e.toLowerCase()&&kt(t,n)}function jt(){const e=mt();vt(Ze(e.select(0,e.getChildrenSize())))}function Tt(e,t){void 0===e.__lexicalClassNameCache&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,r=n[t];if(void 0!==r)return r;const i=e[t];if("string"==typeof i){const e=je(i);return n[t]=e,e}return i}function Mt(e,t,n,r,i){if(0===n.size)return;const o=r.__type,s=r.__key,a=t.get(o);void 0===a&&W(33,o);const l=a.klass;let c=e.get(l);void 0===c&&(c=new Map,e.set(l,c));const u=c.get(s),d="destroyed"===u&&"created"===i;(void 0===u||d)&&c.set(s,d?"updated":i)}function Ft(e){const t=Ci(),n=t._readOnly,r=e.getType(),i=t._nodeMap,o=[];for(const[,t]of i)t instanceof e&&t.__type===r&&(n||t.isAttached())&&o.push(t);return o}function Rt(e,t,n){const r=e.getParent();let i=n,o=e;return null!==r&&(t&&0===n?(i=o.getIndexWithinParent(),o=r):t||n!==o.getChildrenSize()||(i=o.getIndexWithinParent()+1,o=r)),o.getChildAtIndex(t?i-1:i)}function Lt(e,t){const n=e.offset;if("element"===e.type)return Rt(e.getNode(),t,n);{const r=e.getNode();if(t&&0===n||!t&&n===r.getTextContentSize()){const e=t?r.getPreviousSibling():r.getNextSibling();return null===e?Rt(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):e}}return null}function Qt(e){const t=Yt(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function Ut(e,t,n){return Ni(e,t,n)}function Vt(e){return!Vi(e)&&!e.isLastChild()&&!e.isInline()}function Kt(e,t){const n=e._keyToDOMMap.get(t);return void 0===n&&W(75,t),n}function Ht(e){const t=e.assignedSlot||e.parentElement;return null!==t&&11===t.nodeType?t.host:t}function Gt(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function Yt(e){const t=e._window;return null===t&&W(78),t}function zt(e){return Vi(e)||Fi(e)&&e.isShadowRoot()}function Zt(e){const t=Ei(),n=e.constructor.getType(),r=t._nodes.get(n);void 0===r&&W(97);const i=r.replace;if(null!==i){const t=i(e);return t instanceof e.constructor||W(98),t}return e}function Wt(e,t){!Vi(e.getParent())||Fi(t)||Qi(t)||W(99)}function qt(e){return(Qi(e)||Fi(e)&&!e.canBeEmpty())&&!e.isInline()}function Jt(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;null!==r&&r.removeChild(e)}function Xt(e){return q?(e||window).getSelection():null}function $t(e,t){let n=e.getChildAtIndex(t);null==n&&(n=e),zt(e)&&W(102);const r=e=>{const t=e.getParentOrThrow(),i=zt(t),o=e!==n||i?function(e){const t=e.constructor.clone(e);return st(t,null),t}(e):e;if(i)return Fi(e)&&Fi(o)||W(133),e.insertAfter(o),[e,o,o];{const[n,i,s]=r(t),a=e.getNextSiblings();return s.append(o,...a),[n,i,o]}},[i,o]=r(n);return[i,o]}function en(e){return tn(e)&&"A"===e.tagName}function tn(e){return 1===e.nodeType}function nn(e){const t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return null!==e.nodeName.match(t)}function rn(e){const t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return null!==e.nodeName.match(t)}function on(e){if(Vi(e)||Qi(e)&&!e.isInline())return!0;if(!Fi(e)||zt(e))return!1;const t=e.getFirstChild(),n=null===t||fr(t)||Nr(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function sn(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}function an(e,t,n,r,i,o){let s=e.getFirstChild();for(;null!==s;){const e=s.__key;s.__parent===t&&(Fi(s)&&an(s,e,n,r,i,o),n.has(e)||o.delete(e),i.push(e)),s=s.getNextSibling()}}let ln,cn,un,dn,hn,pn,fn,gn,mn,yn,vn="",An="",bn=null,wn="",Sn=!1,Cn=!1,En=null;function In(e,t){const n=fn.get(e);if(null!==t){const n=Qn(e);n.parentNode===t&&t.removeChild(n)}if(gn.has(e)||cn._keyToDOMMap.delete(e),Fi(n)){const e=Mn(n,fn);_n(e,0,e.length-1,null)}void 0!==n&&Mt(yn,un,dn,n,"destroyed")}function _n(e,t,n,r){let i=t;for(;i<=n;++i){const t=e[i];void 0!==t&&In(t,r)}}function xn(e,t){e.setProperty("text-align",t)}const Pn="40px";function kn(e,t){const n=ln.theme.indent;if("string"==typeof n){const r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}const r=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||Pn;e.style.setProperty("padding-inline-start",0===t?"":`calc(${t} * ${r})`)}function Bn(e,t){const n=e.style;0===t?xn(n,""):t===ge?xn(n,"left"):t===me?xn(n,"center"):t===ye?xn(n,"right"):t===ve?xn(n,"justify"):t===Ae?xn(n,"start"):t===be&&xn(n,"end")}function On(e,t,n){const r=gn.get(e);void 0===r&&W(60);const i=r.createDOM(ln,cn);if(function(e,t,n){const r=n._keyToDOMMap;t["__lexicalKey_"+n._key]=e,r.set(e,t)}(e,i,cn),Nr(r)?i.setAttribute("data-lexical-text","true"):Qi(r)&&i.setAttribute("data-lexical-decorator","true"),Fi(r)){const e=r.__indent,t=r.__size;if(0!==e&&kn(i,e),0!==t){const e=t-1;!function(e,t,n,r){const i=An;An="",Nn(e,n,0,t,r,null),Tn(n,r),An=i}(Mn(r,gn),e,r,i)}const n=r.__format;0!==n&&Bn(i,n),r.isInline()||jn(null,r,i),Vt(r)&&(vn+=Se,wn+=Se)}else{const t=r.getTextContent();if(Qi(r)){const t=r.decorate(cn,ln);null!==t&&Rn(e,t),i.contentEditable="false"}else Nr(r)&&(r.isDirectionless()||(An+=t));vn+=t,wn+=t}if(null!==t)if(null!=n)t.insertBefore(i,n);else{const e=t.__lexicalLineBreak;null!=e?t.insertBefore(i,e):t.appendChild(i)}return Mt(yn,un,dn,r,"created"),i}function Nn(e,t,n,r,i,o){const s=vn;vn="";let a=n;for(;a<=r;++a){On(e[a],i,o);const t=gn.get(e[a]);null!==t&&null===bn&&Nr(t)&&(bn=t.getFormat())}Vt(t)&&(vn+=Se),i.__lexicalTextContent=vn,vn=s+vn}function Dn(e,t){const n=t.get(e);return fr(n)||Qi(n)&&n.isInline()}function jn(e,t,n){const r=null!==e&&(0===e.__size||Dn(e.__last,fn)),i=0===t.__size||Dn(t.__last,gn);if(r){if(!i){const e=n.__lexicalLineBreak;null!=e&&n.removeChild(e),n.__lexicalLineBreak=null}}else if(i){const e=document.createElement("br");n.__lexicalLineBreak=e,n.appendChild(e)}}function Tn(e,t){const n=t.__lexicalDirTextContent,r=t.__lexicalDir;if(n!==An||r!==En){const n=""===An,o=n?En:(i=An,_e.test(i)?"rtl":xe.test(i)?"ltr":null);if(o!==r){const i=t.classList,s=ln.theme;let a=null!==r?s[r]:void 0,l=null!==o?s[o]:void 0;if(void 0!==a){if("string"==typeof a){const e=je(a);a=s[r]=e}i.remove(...a)}if(null===o||n&&"ltr"===o)t.removeAttribute("dir");else{if(void 0!==l){if("string"==typeof l){const e=je(l);l=s[o]=e}void 0!==l&&i.add(...l)}t.dir=o}Cn||(e.getWritable().__dir=o)}En=o,t.__lexicalDirTextContent=An,t.__lexicalDir=o}var i}function Mn(e,t){const n=[];let r=e.__first;for(;null!==r;){const e=t.get(r);void 0===e&&W(101),n.push(r),r=e.__next}return n}function Fn(e,t){const n=fn.get(e);let r=gn.get(e);void 0!==n&&void 0!==r||W(61);const i=Sn||pn.has(e)||hn.has(e),o=Kt(cn,e);if(n===r&&!i){if(Fi(n)){const e=o.__lexicalTextContent;void 0!==e&&(vn+=e,wn+=e);const t=o.__lexicalDirTextContent;void 0!==t&&(An+=t)}else{const e=n.getTextContent();Nr(n)&&!n.isDirectionless()&&(An+=e),wn+=e,vn+=e}return o}if(n!==r&&i&&Mt(yn,un,dn,r,"updated"),r.updateDOM(n,o,ln)){const n=On(e,null,null);return null===t&&W(62),t.replaceChild(n,o),In(e,null),n}if(Fi(n)&&Fi(r)){const e=r.__indent;e!==n.__indent&&kn(o,e);const t=r.__format;t!==n.__format&&Bn(o,t),i&&(function(e,t,n){const r=An;var i;An="",bn=null,function(e,t,n){const r=vn,i=e.__size,o=t.__size;if(vn="",1===i&&1===o){const r=e.__first,i=t.__first;if(r===i)Fn(r,n);else{const e=Qn(r),t=On(i,null,null);n.replaceChild(t,e),In(r,null)}const o=gn.get(i);null===bn&&Nr(o)&&(bn=o.getFormat())}else{const r=Mn(e,fn),s=Mn(t,gn);if(0===i)0!==o&&Nn(s,t,0,o-1,n,null);else if(0===o){if(0!==i){const e=null==n.__lexicalLineBreak;_n(r,0,i-1,e?null:n),e&&(n.textContent="")}}else!function(e,t,n,r,i,o){const s=r-1,a=i-1;let l,c,u=o.firstChild,d=0,h=0;for(;d<=s&&h<=a;){const e=t[d],r=n[h];if(e===r)u=Ln(Fn(r,o)),d++,h++;else{void 0===l&&(l=new Set(t)),void 0===c&&(c=new Set(n));const i=c.has(e),s=l.has(r);if(i)if(s){const e=Kt(cn,r);e===u?u=Ln(Fn(r,o)):(null!=u?o.insertBefore(e,u):o.appendChild(e),Fn(r,o)),d++,h++}else On(r,o,u),h++;else u=Ln(Qn(e)),In(e,o),d++}const i=gn.get(r);null!==i&&null===bn&&Nr(i)&&(bn=i.getFormat())}const p=d>s,f=h>a;if(p&&!f){const t=n[a+1];Nn(n,e,h,a,o,void 0===t?null:cn.getElementByKey(t))}else f&&!p&&_n(t,d,s,o)}(t,r,s,i,o,n)}Vt(t)&&(vn+=Se),n.__lexicalTextContent=vn,vn=r+vn}(e,t,n),Tn(t,n),qi(i=t)&&null!=bn&&bn!==i.__textFormat&&i.setTextFormat(bn),An=r,bn=null}(n,r,o),Vi(r)||r.isInline()||jn(n,r,o)),Vt(r)&&(vn+=Se,wn+=Se)}else{const t=r.getTextContent();if(Qi(r)){const t=r.decorate(cn,ln);null!==t&&Rn(e,t)}else Nr(r)&&!r.isDirectionless()&&(An+=t);vn+=t,wn+=t}if(!Cn&&Vi(r)&&r.__cachedText!==wn){const e=r.getWritable();e.__cachedText=wn,r=e}return o}function Rn(e,t){let n=cn._pendingDecorators;const r=cn._decorators;if(null===n){if(r[e]===t)return;n=ft(cn)}n[e]=t}function Ln(e){let t=e.nextSibling;return null!==t&&t===cn._blockCursorElement&&(t=t.nextSibling),t}function Qn(e){const t=mn.get(e);return void 0===t&&W(75,e),t}const Un=Object.freeze({}),Vn=[["keydown",function(e,t){if(Kn=e.timeStamp,Hn=e.key,t.isComposing())return;const{key:n,shiftKey:r,ctrlKey:i,metaKey:o,altKey:s}=e;Ut(t,v,e)||null!=n&&(function(e,t,n,r){return Pt(e)&&!t&&!r&&!n}(n,i,s,o)?Ut(t,A,e):function(e,t,n,r,i){return Pt(e)&&!r&&!n&&(t||i)}(n,i,r,s,o)?Ut(t,b,e):function(e,t,n,r){return xt(e)&&!t&&!r&&!n}(n,i,s,o)?Ut(t,w,e):function(e,t,n,r,i){return xt(e)&&!r&&!n&&(t||i)}(n,i,r,s,o)?Ut(t,S,e):function(e,t,n){return function(e){return"ArrowUp"===e}(e)&&!t&&!n}(n,i,o)?Ut(t,C,e):function(e,t,n){return function(e){return"ArrowDown"===e}(e)&&!t&&!n}(n,i,o)?Ut(t,E,e):function(e,t){return Bt(e)&&t}(n,r)?(qn=!0,Ut(t,I,e)):function(e){return" "===e}(n)?Ut(t,_,e):function(e,t){return X&&t&&"o"===e.toLowerCase()}(n,i)?(e.preventDefault(),qn=!0,Ut(t,l,!0)):function(e,t){return Bt(e)&&!t}(n,r)?(qn=!1,Ut(t,I,e)):function(e,t,n,r){return X?!t&&!n&&(Ot(e)||"h"===e.toLowerCase()&&r):!(r||t||n)&&Ot(e)}(n,s,o,i)?Ot(n)?Ut(t,x,e):(e.preventDefault(),Ut(t,a,!0)):function(e){return"Escape"===e}(n)?Ut(t,P,e):function(e,t,n,r,i){return X?!(n||r||i)&&(Nt(e)||"d"===e.toLowerCase()&&t):!(t||r||i)&&Nt(e)}(n,i,r,s,o)?Nt(n)?Ut(t,k,e):(e.preventDefault(),Ut(t,a,!1)):function(e,t,n){return Ot(e)&&(X?t:n)}(n,s,i)?(e.preventDefault(),Ut(t,p,!0)):function(e,t,n){return Nt(e)&&(X?t:n)}(n,s,i)?(e.preventDefault(),Ut(t,p,!1)):function(e,t){return X&&t&&Ot(e)}(n,o)?(e.preventDefault(),Ut(t,f,!0)):function(e,t){return X&&t&&Nt(e)}(n,o)?(e.preventDefault(),Ut(t,f,!1)):function(e,t,n,r){return"b"===e.toLowerCase()&&!t&&kt(n,r)}(n,s,o,i)?(e.preventDefault(),Ut(t,g,"bold")):function(e,t,n,r){return"u"===e.toLowerCase()&&!t&&kt(n,r)}(n,s,o,i)?(e.preventDefault(),Ut(t,g,"underline")):function(e,t,n,r){return"i"===e.toLowerCase()&&!t&&kt(n,r)}(n,s,o,i)?(e.preventDefault(),Ut(t,g,"italic")):function(e,t,n,r){return"Tab"===e&&!t&&!n&&!r}(n,s,i,o)?Ut(t,B,e):function(e,t,n,r){return"z"===e.toLowerCase()&&!t&&kt(n,r)}(n,r,o,i)?(e.preventDefault(),Ut(t,m,void 0)):function(e,t,n,r){return X?"z"===e.toLowerCase()&&n&&t:"y"===e.toLowerCase()&&r||"z"===e.toLowerCase()&&r&&t}(n,r,o,i)?(e.preventDefault(),Ut(t,y,void 0)):Gr(t._editorState._selection)?function(e,t,n,r){return!t&&"c"===e.toLowerCase()&&(X?n:r)}(n,r,o,i)?(e.preventDefault(),Ut(t,L,e)):function(e,t,n,r){return!t&&"x"===e.toLowerCase()&&(X?n:r)}(n,r,o,i)?(e.preventDefault(),Ut(t,Q,e)):Dt(n,o,i)&&(e.preventDefault(),Ut(t,U,e)):!$&&Dt(n,o,i)&&(e.preventDefault(),Ut(t,U,e)),function(e,t,n,r){return e||t||n||r}(i,r,s,o)&&Ut(t,Z,e))}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;n instanceof Node&&"touch"!==r&&Ti(t,(()=>{Qi(pt(n))||(Wn=!0)}))}],["compositionstart",function(e,t){Ti(t,(()=>{const n=oi();if(Kr(n)&&!t.isComposing()){const r=n.anchor,i=n.anchor.getNode();ct(r.key),(e.timeStamp<Kn+30||"element"===r.type||!n.isCollapsed()||i.getFormat()!==n.format||Nr(i)&&i.getStyle()!==n.style)&&Ut(t,u,Ce)}}))}],["compositionend",function(e,t){$?Jn=!0:Ti(t,(()=>{rr(t,e.data)}))}],["input",function(e,t){e.stopPropagation(),Ti(t,(()=>{const n=oi(),r=e.data,i=nr(e);if(null!=r&&Kr(n)&&$n(n,i,r,e.timeStamp,!1)){Jn&&(rr(t,r),Jn=!1);const i=n.anchor.getNode(),o=Xt(t._window);if(null===o)return;const s=n.isBackward(),a=s?n.anchor.offset:n.focus.offset,l=s?n.focus.offset:n.anchor.offset;ee&&!n.isCollapsed()&&Nr(i)&&null!==o.anchorNode&&i.getTextContent().slice(0,a)+r+i.getTextContent().slice(a+l)===Et(o.anchorNode)||Ut(t,u,r);const c=r.length;$&&c>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(n.anchor.offset-=c),te||ne||se||!t.isComposing()||(Kn=0,ct(null))}else It(!1,t,null!==r?r:void 0),Jn&&(rr(t,r||void 0),Jn=!1);wi(),Ke(Ei())})),Yn=null}],["click",function(e,t){Ti(t,(()=>{const n=oi(),r=Xt(t._window),i=si();if(r)if(Kr(n)){const t=n.anchor,o=t.getNode();"element"===t.type&&0===t.offset&&n.isCollapsed()&&!Vi(o)&&1===mt().getChildrenSize()&&o.getTopLevelElementOrThrow().isEmpty()&&null!==i&&n.is(i)?(r.removeAllRanges(),n.dirty=!0):3!==e.detail||n.isCollapsed()||o!==n.focus.getNode()&&(Fi(o)?o.select(0):o.getParentOrThrow().select(0))}else if("touch"===e.pointerType){const n=r.anchorNode;if(null!==n){const o=n.nodeType;o!==ae&&o!==le||vt(ii(i,r,t,e))}}Ut(t,s,e)}))}],["cut",Un],["copy",Un],["dragstart",Un],["dragover",Un],["dragend",Un],["paste",Un],["focus",Un],["blur",Un],["drop",Un]];ee&&Vn.push(["beforeinput",(e,t)=>function(e,t){const n=e.inputType,r=nr(e);"deleteCompositionText"===n||$&&Qt(t)||"insertCompositionText"!==n&&Ti(t,(()=>{const i=oi();if("deleteContentBackward"===n){if(null===i){const e=si();if(!Kr(e))return;vt(e.clone())}if(Kr(i)){const n=i.anchor.key===i.focus.key;if(o=e.timeStamp,"MediaLast"===Hn&&o<Kn+30&&t.isComposing()&&n){if(ct(null),Kn=0,setTimeout((()=>{Ti(t,(()=>{ct(null)}))}),30),Kr(i)){const e=i.anchor.getNode();e.markDirty(),i.format=e.getFormat(),Nr(e)||W(142),i.style=e.getStyle()}}else{ct(null),e.preventDefault();const r=i.anchor.getNode().getTextContent(),o=0===i.anchor.offset&&i.focus.offset===r.length;oe&&n&&!o||Ut(t,a,!0)}return}}var o;if(!Kr(i))return;const s=e.data;null!==Yn&&It(!1,t,Yn),i.dirty&&null===Yn||!i.isCollapsed()||Vi(i.anchor.getNode())||null===r||i.applyDOMRange(r),Yn=null;const v=i.anchor,A=i.focus,b=v.getNode(),w=A.getNode();if("insertText"!==n&&"insertTranspose"!==n)switch(e.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":Ut(t,u,e);break;case"insertFromComposition":ct(null),Ut(t,u,e);break;case"insertLineBreak":ct(null),Ut(t,l,!1);break;case"insertParagraph":ct(null),qn&&!ne?(qn=!1,Ut(t,l,!1)):Ut(t,c,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":Ut(t,d,e);break;case"deleteByComposition":(function(e,t){return e!==t||Fi(e)||Fi(t)||!e.isToken()||!t.isToken()})(b,w)&&Ut(t,h,e);break;case"deleteByDrag":case"deleteByCut":Ut(t,h,e);break;case"deleteContent":Ut(t,a,!1);break;case"deleteWordBackward":Ut(t,p,!0);break;case"deleteWordForward":Ut(t,p,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":Ut(t,f,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":Ut(t,f,!1);break;case"formatStrikeThrough":Ut(t,g,"strikethrough");break;case"formatBold":Ut(t,g,"bold");break;case"formatItalic":Ut(t,g,"italic");break;case"formatUnderline":Ut(t,g,"underline");break;case"historyUndo":Ut(t,m,void 0);break;case"historyRedo":Ut(t,y,void 0)}else{if("\n"===s)e.preventDefault(),Ut(t,l,!1);else if(s===Se)e.preventDefault(),Ut(t,c,void 0);else if(null==s&&e.dataTransfer){const t=e.dataTransfer.getData("text/plain");e.preventDefault(),i.insertRawText(t)}else null!=s&&$n(i,r,s,e.timeStamp,!0)?(e.preventDefault(),Ut(t,u,s)):Yn=s;Gn=e.timeStamp}}))}(e,t)]);let Kn=0,Hn=null,Gn=0,Yn=null;const zn=new WeakMap;let Zn=!1,Wn=!1,qn=!1,Jn=!1,Xn=[0,"",0,"root",0];function $n(e,t,n,r,i){const o=e.anchor,s=e.focus,a=o.getNode(),l=Ei(),c=Xt(l._window),u=null!==c?c.anchorNode:null,d=o.key,h=l.getElementByKey(d),p=n.length;return d!==s.key||!Nr(a)||(!i&&(!ee||Gn<r+50)||a.isDirty()&&p<2||wt(n))&&o.offset!==s.offset&&!a.isComposing()||tt(a)||a.isDirty()&&p>1||(i||!ee)&&null!==h&&!a.isComposing()&&u!==rt(h)||null!==c&&null!==t&&(!t.collapsed||t.startContainer!==c.anchorNode||t.startOffset!==c.anchorOffset)||a.getFormat()!==e.format||a.getStyle()!==e.style||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;const n=e.anchor.offset,r=t.getParentOrThrow(),i=t.isToken();return 0===n?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){const t=e.getPreviousSibling();return(Nr(t)||Fi(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,a)}function er(e,t){return null!==e&&null!==e.nodeValue&&e.nodeType===le&&0!==t&&t!==e.nodeValue.length}function tr(e,t,n){const{anchorNode:r,anchorOffset:o,focusNode:s,focusOffset:a}=e;Zn&&(Zn=!1,er(r,o)&&er(s,a))||Ti(t,(()=>{if(!n)return void vt(null);if(!$e(t,r,s))return;const l=oi();if(Kr(l)){const n=l.anchor,r=n.getNode();if(l.isCollapsed()){"Range"===e.type&&e.anchorNode===e.focusNode&&(l.dirty=!0);const i=Yt(t).event,o=i?i.timeStamp:performance.now(),[s,a,c,u,d]=Xn,h=mt(),p=!1===t.isComposing()&&""===h.getTextContent();if(o<d+200&&n.offset===c&&n.key===u)l.format=s,l.style=a;else if("text"===n.type)Nr(r)||W(141),l.format=r.getFormat(),l.style=r.getStyle();else if("element"===n.type&&!p){const e=n.getNode();e instanceof zi&&0===e.getChildrenSize()?l.format=e.getTextFormat():l.format=0,l.style=""}}else{const e=n.key,t=l.focus.key,r=l.getNodes(),i=r.length,s=l.isBackward(),c=s?a:o,u=s?o:a,d=s?t:e,h=s?e:t;let p=fe,f=!1;for(let e=0;e<i;e++){const t=r[e],n=t.getTextContentSize();if(Nr(t)&&0!==n&&!(0===e&&t.__key===d&&c===n||e===i-1&&t.__key===h&&0===u)&&(f=!0,p&=t.getFormat(),0===p))break}l.format=f?p:0}}Ut(t,i,void 0)}))}function nr(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return 0===t.length?null:t[0]}function rr(e,t){const n=e._compositionKey;if(ct(null),null!==n&&null!=t){if(""===t){const t=dt(n),r=rt(e.getElementByKey(n));return void(null!==r&&null!==r.nodeValue&&Nr(t)&&_t(t,r.nodeValue,null,null,!0))}if("\n"===t[t.length-1]){const t=oi();if(Kr(t)){const n=t.focus;return t.anchor.set(n.key,n.offset,n.type),void Ut(e,I,null)}}}It(!0,e,t)}function ir(e){let t=e.__lexicalEventHandles;return void 0===t&&(t=[],e.__lexicalEventHandles=t),t}const or=new Map;function sr(e){const t=e.target,n=Xt(null==t?null:9===t.nodeType?t.defaultView:t.ownerDocument.defaultView);if(null===n)return;const r=et(n.anchorNode);if(null===r)return;Wn&&(Wn=!1,Ti(r,(()=>{const t=si(),i=n.anchorNode;if(null===i)return;const o=i.nodeType;o!==ae&&o!==le||vt(ii(t,n,r,e))})));const i=St(r),o=i[i.length-1],s=o._key,a=or.get(s),l=a||o;l!==r&&tr(n,l,!1),tr(n,r,!0),r!==o?or.set(s,r):a&&or.delete(s)}function ar(e){e._lexicalHandled=!0}function lr(e){return!0===e._lexicalHandled}function cr(e,t,n){wi();const r=e.__key,i=e.getParent();if(null===i)return;const o=function(e){const t=oi();if(!Kr(t)||!Fi(e))return t;const{anchor:n,focus:r}=t,i=n.getNode(),o=r.getNode();return Gt(i,e)&&n.set(e.__key,0,"element"),Gt(o,e)&&r.set(e.__key,0,"element"),t}(e);let s=!1;if(Kr(o)&&t){const t=o.anchor,n=o.focus;t.key===r&&(ci(t,e,i,e.getPreviousSibling(),e.getNextSibling()),s=!0),n.key===r&&(ci(n,e,i,e.getPreviousSibling(),e.getNextSibling()),s=!0)}else Gr(o)&&t&&e.isSelected()&&e.selectPrevious();if(Kr(o)&&t&&!s){const t=e.getIndexWithinParent();at(e),ai(o,i,t,-1)}else at(e);n||zt(i)||i.canBeEmpty()||!i.isEmpty()||cr(i,t),t&&Vi(i)&&i.isEmpty()&&i.selectEnd()}class ur{static getType(){W(64,this.name)}static clone(e){W(65,this.name)}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,st(this,e)}getType(){return this.__type}isInline(){W(137,this.constructor.name)}isAttached(){let e=this.__key;for(;null!==e;){if("root"===e)return!0;const t=dt(e);if(null===t)break;e=t.__parent}return!1}isSelected(e){const t=e||oi();if(null==t)return!1;const n=t.getNodes().some((e=>e.__key===this.__key));return(Nr(this)||!Kr(t)||"element"!==t.anchor.type||"element"!==t.focus.type||t.anchor.key!==t.focus.key||t.anchor.offset!==t.focus.offset)&&n}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(null===e)return-1;let t=e.getFirstChild(),n=0;for(;null!==t;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return null===e?null:dt(e)}getParentOrThrow(){const e=this.getParent();return null===e&&W(66,this.__key),e}getTopLevelElement(){let e=this;for(;null!==e;){const t=e.getParent();if(zt(t))return Fi(e)||W(138),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return null===e&&W(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return null===e?null:dt(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(null===t)return e;let n=t.getFirstChild();for(;null!==n&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return null===e?null:dt(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=this.getParents(),n=e.getParents();Fi(this)&&t.unshift(this),Fi(e)&&n.unshift(e);const r=t.length,i=n.length;if(0===r||0===i||t[r-1]!==n[i-1])return null;const o=new Set(n);for(let e=0;e<r;e++){const n=t[e];if(o.has(n))return n}return null}is(e){return null!=e&&this.__key===e.__key}isBefore(e){if(this===e)return!1;if(e.isParentOf(this))return!0;if(this.isParentOf(e))return!1;const t=this.getCommonAncestor(e);let n=0,r=0,i=this;for(;;){const e=i.getParentOrThrow();if(e===t){n=i.getIndexWithinParent();break}i=e}for(i=e;;){const e=i.getParentOrThrow();if(e===t){r=i.getIndexWithinParent();break}i=e}return n<r}isParentOf(e){const t=this.__key;if(t===e.__key)return!1;let n=e;for(;null!==n;){if(n.__key===t)return!0;n=n.getParent()}return!1}getNodesBetween(e){const t=this.isBefore(e),n=[],r=new Set;let i=this;for(;null!==i;){const o=i.__key;if(r.has(o)||(r.add(o),n.push(i)),i===e)break;const s=Fi(i)?t?i.getFirstChild():i.getLastChild():null;if(null!==s){i=s;continue}const a=t?i.getNextSibling():i.getPreviousSibling();if(null!==a){i=a;continue}const l=i.getParentOrThrow();if(r.has(l.__key)||n.push(l),l===e)break;let c=null,u=l;do{if(null===u&&W(68),c=t?u.getNextSibling():u.getPreviousSibling(),u=u.getParent(),null===u)break;null!==c||r.has(u.__key)||n.push(u)}while(null===c);i=c}return t||n.reverse(),n}isDirty(){const e=Ei()._dirtyLeaves;return null!==e&&e.has(this.__key)}getLatest(){const e=dt(this.__key);return null===e&&W(113),e}getWritable(){wi();const e=Ci(),t=Ei(),n=e._nodeMap,r=this.__key,i=this.getLatest(),o=i.__parent,s=t._cloneNotNeeded,a=oi();if(null!==a&&a.setCachedNodes(null),s.has(r))return lt(i),i;const l=i.constructor.clone(i);return l.__parent=o,l.__next=i.__next,l.__prev=i.__prev,Fi(i)&&Fi(l)?(qi(i)&&qi(l)&&(l.__textFormat=i.__textFormat),l.__first=i.__first,l.__last=i.__last,l.__size=i.__size,l.__indent=i.__indent,l.__format=i.__format,l.__dir=i.__dir):Nr(i)&&Nr(l)&&(l.__format=i.__format,l.__style=i.__style,l.__mode=i.__mode,l.__detail=i.__detail),s.add(r),l.__key=r,lt(l),n.set(r,l),l}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){W(70)}updateDOM(e,t,n){W(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){W(72)}static importJSON(e){W(18,this.name)}static transform(){return null}remove(e){cr(this,!0,e)}replace(e,t){wi();let n=oi();null!==n&&(n=n.clone()),Wt(this,e);const r=this.getLatest(),i=this.__key,o=e.__key,s=e.getWritable(),a=this.getParentOrThrow().getWritable(),l=a.__size;at(s);const c=r.getPreviousSibling(),u=r.getNextSibling(),d=r.__prev,h=r.__next,p=r.__parent;if(cr(r,!1,!0),null===c?a.__first=o:c.getWritable().__next=o,s.__prev=d,null===u?a.__last=o:u.getWritable().__prev=o,s.__next=h,s.__parent=p,a.__size=l,t&&(Fi(this)&&Fi(s)||W(139),this.getChildren().forEach((e=>{s.append(e)}))),Kr(n)){vt(n);const e=n.anchor,t=n.focus;e.key===i&&Qr(e,s),t.key===i&&Qr(t,s)}return ut()===i&&ct(o),s}insertAfter(e,t=!0){wi(),Wt(this,e);const n=this.getWritable(),r=e.getWritable(),i=r.getParent(),o=oi();let s=!1,a=!1;if(null!==i){const t=e.getIndexWithinParent();if(at(r),Kr(o)){const e=i.__key,n=o.anchor,r=o.focus;s="element"===n.type&&n.key===e&&n.offset===t+1,a="element"===r.type&&r.key===e&&r.offset===t+1}}const l=this.getNextSibling(),c=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(null===l?c.__last=u:l.getWritable().__prev=u,c.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&Kr(o)){const e=this.getIndexWithinParent();ai(o,c,e+1);const t=c.__key;s&&o.anchor.set(t,e+2,"element"),a&&o.focus.set(t,e+2,"element")}return e}insertBefore(e,t=!0){wi(),Wt(this,e);const n=this.getWritable(),r=e.getWritable(),i=r.__key;at(r);const o=this.getPreviousSibling(),s=this.getParentOrThrow().getWritable(),a=n.__prev,l=this.getIndexWithinParent();null===o?s.__first=i:o.getWritable().__next=i,s.__size++,n.__prev=i,r.__prev=a,r.__next=n.__key,r.__parent=n.__parent;const c=oi();return t&&Kr(c)&&ai(c,this.getParentOrThrow(),l),e}isParentRequired(){return!1}createParentElementNode(){return Wi()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){wi();const n=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===n)return r.select(0,0);if(Fi(n))return n.select();if(!Nr(n)){const e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){wi();const n=this.getNextSibling(),r=this.getParentOrThrow();if(null===n)return r.select();if(Fi(n))return n.select(0,0);if(!Nr(n)){const e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}}class dr extends ur{static getType(){return"linebreak"}static clone(e){return new dr(e.__key)}constructor(e){super(e)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(e){const t=e.parentElement;if(null!==t){const n=t.firstChild;if(n===e||n.nextSibling===e&&gr(n)){const n=t.lastChild;if(n===e||n.previousSibling===e&&gr(n))return!0}}return!1}(e)?null:{conversion:hr,priority:0}}}static importJSON(e){return pr()}exportJSON(){return{type:"linebreak",version:1}}}function hr(e){return{node:pr()}}function pr(){return Zt(new dr)}function fr(e){return e instanceof dr}function gr(e){return e.nodeType===le&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function mr(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function yr(e,t){return 1&t?"strong":2&t?"em":"span"}function vr(e,t,n,r,i){const o=r.classList;let s=Tt(i,"base");void 0!==s&&o.add(...s),s=Tt(i,"underlineStrikethrough");let a=!1;const l=t&pe&&t&he;void 0!==s&&(n&pe&&n&he?(a=!0,l||o.add(...s)):l&&o.remove(...s));for(const e in Pe){const r=Pe[e];if(s=Tt(i,e),void 0!==s)if(n&r){if(a&&("underline"===e||"strikethrough"===e)){t&r&&o.remove(...s);continue}t&r&&(!l||"underline"!==e)&&"strikethrough"!==e||o.add(...s)}else t&r&&o.remove(...s)}}function Ar(e,t,n){const r=t.firstChild,i=n.isComposing(),o=e+(i?we:"");if(null==r)t.textContent=o;else{const e=r.nodeValue;if(e!==o)if(i||$){const[t,n,i]=function(e,t){const n=e.length,r=t.length;let i=0,o=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;o+i<n&&o+i<r&&e[n-o-1]===t[r-o-1];)o++;return[i,n-i-o,t.slice(i,r-o)]}(e,o);0!==n&&r.deleteData(t,n),r.insertData(t,i)}else r.nodeValue=o}}function br(e,t,n,r,i,o){Ar(i,e,t);const s=o.theme.text;void 0!==s&&vr(0,0,r,e,s)}function wr(e,t){const n=document.createElement(t);return n.appendChild(e),n}class Sr extends ur{static getType(){return"text"}static clone(e){return new Sr(e.__text,e.__key)}constructor(e,t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return De[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===ut()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=Pe[e];return!!(this.getFormat()&t)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return it(this.getLatest().__format,e,t)}canHaveFormat(){return!0}createDOM(e,t){const n=this.__format,r=mr(0,n),i=yr(0,n),o=null===r?i:r,s=document.createElement(o);let a=s;this.hasFormat("code")&&s.setAttribute("spellcheck","false"),null!==r&&(a=document.createElement(i),s.appendChild(a)),br(a,this,0,n,this.__text,e);const l=this.__style;return""!==l&&(s.style.cssText=l),s}updateDOM(e,t,n){const r=this.__text,i=e.__format,o=this.__format,s=mr(0,i),a=mr(0,o),l=yr(0,i),c=yr(0,o);if((null===s?l:s)!==(null===a?c:a))return!0;if(s===a&&l!==c){const e=t.firstChild;null==e&&W(48);const i=document.createElement(c);return br(i,this,0,o,r,n),t.replaceChild(i,e),!1}let u=t;null!==a&&null!==s&&(u=t.firstChild,null==u&&W(49)),Ar(r,u,this);const d=n.theme.text;void 0!==d&&i!==o&&vr(0,i,o,u,d);const h=e.__style,p=this.__style;return h!==p&&(t.style.cssText=p),!1}static importDOM(){return{"#text":()=>({conversion:xr,priority:0}),b:()=>({conversion:Er,priority:0}),code:()=>({conversion:Br,priority:0}),em:()=>({conversion:Br,priority:0}),i:()=>({conversion:Br,priority:0}),s:()=>({conversion:Br,priority:0}),span:()=>({conversion:Cr,priority:0}),strong:()=>({conversion:Br,priority:0}),sub:()=>({conversion:Br,priority:0}),sup:()=>({conversion:Br,priority:0}),u:()=>({conversion:Br,priority:0})}}static importJSON(e){const t=Or(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){let{element:t}=super.exportDOM(e);return null!==t&&tn(t)||W(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=wr(t,"b")),this.hasFormat("italic")&&(t=wr(t,"i")),this.hasFormat("strikethrough")&&(t=wr(t,"s")),this.hasFormat("underline")&&(t=wr(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format="string"==typeof e?Pe[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail="string"==typeof e?ke[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=it(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=Ne[e];if(this.__mode===t)return this;const n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){wi();let n=e,r=t;const i=oi(),o=this.getTextContent(),s=this.__key;if("string"==typeof o){const e=o.length;void 0===n&&(n=e),void 0===r&&(r=e)}else n=0,r=0;if(!Kr(i))return ei(s,n,s,r,"text","text");{const e=ut();e!==i.anchor.key&&e!==i.focus.key||ct(s),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){const i=this.getWritable(),o=i.__text,s=n.length;let a=e;a<0&&(a=s+a,a<0&&(a=0));const l=oi();if(r&&Kr(l)){const t=e+s;l.setTextNodeRange(i,t,i,t)}const c=o.slice(0,a)+n+o.slice(a+t);return i.__text=c,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){wi();const t=this.getLatest(),n=t.getTextContent(),r=t.__key,i=ut(),o=new Set(e),s=[],a=n.length;let l="";for(let e=0;e<a;e++)""!==l&&o.has(e)&&(s.push(l),l=""),l+=n[e];""!==l&&s.push(l);const c=s.length;if(0===c)return[];if(s[0]===n)return[t];const u=s[0],d=t.getParentOrThrow();let h;const p=t.getFormat(),f=t.getStyle(),g=t.__detail;let m=!1;t.isSegmented()?(h=Or(u),h.__format=p,h.__style=f,h.__detail=g,m=!0):(h=t.getWritable(),h.__text=u);const y=oi(),v=[h];let A=u.length;for(let e=1;e<c;e++){const t=s[e],n=t.length,o=Or(t).getWritable();o.__format=p,o.__style=f,o.__detail=g;const a=o.__key,l=A+n;if(Kr(y)){const e=y.anchor,t=y.focus;e.key===r&&"text"===e.type&&e.offset>A&&e.offset<=l&&(e.key=a,e.offset-=A,y.dirty=!0),t.key===r&&"text"===t.type&&t.offset>A&&t.offset<=l&&(t.key=a,t.offset-=A,y.dirty=!0)}i===r&&ct(a),A=l,v.push(o)}!function(e){const t=e.getPreviousSibling(),n=e.getNextSibling();null!==t&&lt(t),null!==n&&lt(n)}(this);const b=d.getWritable(),w=this.getIndexWithinParent();return m?(b.splice(w,0,v),this.remove()):b.splice(w,1,v),Kr(y)&&ai(y,d,w,c-1),v}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||W(50);const n=this.__key,r=e.__key,i=this.__text,o=i.length;ut()===r&&ct(n);const s=oi();if(Kr(s)){const i=s.anchor,a=s.focus;null!==i&&i.key===r&&(ui(i,t,n,e,o),s.dirty=!0),null!==a&&a.key===r&&(ui(a,t,n,e,o),s.dirty=!0)}const a=e.__text,l=t?a+i:i+a;this.setTextContent(l);const c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}}function Cr(e){return{forChild:Dr(e.style),node:null}}function Er(e){const t=e,n="normal"===t.style.fontWeight;return{forChild:Dr(t.style,n?void 0:"bold"),node:null}}const Ir=new WeakMap;function _r(e){return"PRE"===e.nodeName||e.nodeType===ae&&void 0!==e.style&&void 0!==e.style.whiteSpace&&e.style.whiteSpace.startsWith("pre")}function xr(e){const t=e;null===e.parentElement&&W(129);let n=t.textContent||"";if(null!==function(e){let t,n=e.parentNode;const r=[e];for(;null!==n&&void 0===(t=Ir.get(n))&&!_r(n);)r.push(n),n=n.parentNode;const i=void 0===t?n:t;for(let e=0;e<r.length;e++)Ir.set(r[e],i);return i}(t)){const e=n.split(/(\r?\n|\t)/),t=[],r=e.length;for(let n=0;n<r;n++){const r=e[n];"\n"===r||"\r\n"===r?t.push(pr()):"\t"===r?t.push(Tr()):""!==r&&t.push(Or(r))}return{node:t}}if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),""===n)return{node:null};if(" "===n[0]){let e=t,r=!0;for(;null!==e&&null!==(e=Pr(e,!1));){const t=e.textContent||"";if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(" "===n[n.length-1]){let e=t,r=!0;for(;null!==e&&null!==(e=Pr(e,!0));)if((e.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return""===n?{node:null}:{node:Or(n)}}function Pr(e,t){let n=e;for(;;){let e;for(;null===(e=t?n.nextSibling:n.previousSibling);){const e=n.parentElement;if(null===e)return null;n=e}if(n=e,n.nodeType===ae){const e=n.style.display;if(""===e&&!nn(n)||""!==e&&!e.startsWith("inline"))return null}let r=n;for(;null!==(r=t?n.firstChild:n.lastChild);)n=r;if(n.nodeType===le)return n;if("BR"===n.nodeName)return null}}const kr={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Br(e){const t=kr[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:Dr(e.style,t),node:null}}function Or(e=""){return Zt(new Sr(e))}function Nr(e){return e instanceof Sr}function Dr(e,t){const n=e.fontWeight,r=e.textDecoration.split(" "),i="700"===n||"bold"===n,o=r.includes("line-through"),s="italic"===e.fontStyle,a=r.includes("underline"),l=e.verticalAlign;return e=>Nr(e)?(i&&!e.hasFormat("bold")&&e.toggleFormat("bold"),o&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),s&&!e.hasFormat("italic")&&e.toggleFormat("italic"),a&&!e.hasFormat("underline")&&e.toggleFormat("underline"),"sub"!==l||e.hasFormat("subscript")||e.toggleFormat("subscript"),"super"!==l||e.hasFormat("superscript")||e.toggleFormat("superscript"),t&&!e.hasFormat(t)&&e.toggleFormat(t),e):e}class jr extends Sr{static getType(){return"tab"}static clone(e){const t=new jr(e.__key);return t.__text=e.__text,t.__format=e.__format,t.__style=e.__style,t}constructor(e){super("\t",e),this.__detail=2}static importDOM(){return null}static importJSON(e){const t=Tr();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){W(126)}setDetail(e){W(127)}setMode(e){W(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Tr(){return Zt(new jr)}function Mr(e){return e instanceof jr}class Fr{constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),n=e.getNode();const r=this.offset,i=e.offset;if(Fi(t)){const e=t.getDescendantByIndex(r);t=null!=e?e:t}if(Fi(n)){const e=n.getDescendantByIndex(i);n=null!=e?e:n}return t===n?r<i:t.isBefore(n)}getNode(){const e=dt(this.key);return null===e&&W(20),e}set(e,t,n){const r=this._selection,i=this.key;this.key=e,this.offset=t,this.type=n,bi()||(ut()===i&&ct(e),null!==r&&(r.setCachedNodes(null),r.dirty=!0))}}function Rr(e,t,n){return new Fr(e,t,n)}function Lr(e,t){let n=t.__key,r=e.offset,i="element";if(Nr(t)){i="text";const e=t.getTextContentSize();r>e&&(r=e)}else if(!Fi(t)){const e=t.getNextSibling();if(Nr(e))n=e.__key,r=0,i="text";else{const e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function Qr(e,t){if(Fi(t)){const n=t.getLastDescendant();Fi(n)||Nr(n)?Lr(e,n):Lr(e,t)}else Lr(e,t)}function Ur(e,t,n,r){e.key=t,e.offset=n,e.type=r}class Vr{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Gr(e))return!1;const t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every((e=>n.has(e)))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new Vr(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),n=t.length,r=t[n-1];let i;if(Nr(r))i=r.select();else{const e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let e=0;e<n;e++)t[e].remove()}getNodes(){const e=this._cachedNodes;if(null!==e)return e;const t=this._nodes,n=[];for(const e of t){const t=dt(e);null!==t&&n.push(t)}return bi()||(this._cachedNodes=n),n}getTextContent(){const e=this.getNodes();let t="";for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}}function Kr(e){return e instanceof Hr}class Hr{constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!Kr(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(null!==e)return e;const t=this.anchor,n=this.focus,r=t.isBefore(n),i=r?t:n,o=r?n:t;let s=i.getNode(),a=o.getNode();const l=i.offset,c=o.offset;if(Fi(s)){const e=s.getDescendantByIndex(l);s=null!=e?e:s}if(Fi(a)){let e=a.getDescendantByIndex(c);null!==e&&e!==s&&a.getChildAtIndex(c)===e&&(e=e.getPreviousSibling()),a=null!=e?e:a}let u;return u=s.is(a)?Fi(s)&&s.getChildrenSize()>0?[]:[s]:s.getNodesBetween(a),bi()||(this._cachedNodes=u),u}setTextNodeRange(e,t,n,r){Ur(this.anchor,e.__key,t,"text"),Ur(this.focus,n.__key,r,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const e=this.getNodes();if(0===e.length)return"";const t=e[0],n=e[e.length-1],r=this.anchor,i=this.focus,o=r.isBefore(i),[s,a]=zr(this);let l="",c=!0;for(let u=0;u<e.length;u++){const d=e[u];if(Fi(d)&&!d.isInline())c||(l+="\n"),c=!d.isEmpty();else if(c=!1,Nr(d)){let e=d.getTextContent();d===t?d===n?"element"===r.type&&"element"===i.type&&i.offset!==r.offset||(e=s<a?e.slice(s,a):e.slice(a,s)):e=o?e.slice(s):e.slice(a):d===n&&(e=o?e.slice(0,a):e.slice(0,s)),l+=e}else!Qi(d)&&!fr(d)||d===n&&this.isCollapsed()||(l+=d.getTextContent())}return l}applyDOMRange(e){const t=Ei(),n=t.getEditorState()._selection,r=Xr(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(null===r)return;const[i,o]=r;Ur(this.anchor,i.key,i.offset,i.type),Ur(this.focus,o.key,o.offset,o.type),this._cachedNodes=null}clone(){const e=this.anchor,t=this.focus;return new Hr(Rr(e.key,e.offset,e.type),Rr(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=it(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=Pe[e];return!!(this.format&t)}insertRawText(e){const t=e.split(/(\r?\n|\t)/),n=[],r=t.length;for(let e=0;e<r;e++){const r=t[e];"\n"===r||"\r\n"===r?n.push(pr()):"\t"===r?n.push(Tr()):n.push(Or(r))}this.insertNodes(n)}insertText(e){const t=this.anchor,n=this.focus,r=this.format,i=this.style;let o=t,s=n;!this.isCollapsed()&&n.isBefore(t)&&(o=n,s=t),"element"===o.type&&function(e,t,n,r){const i=e.getNode(),o=i.getChildAtIndex(e.offset),s=Or(),a=Vi(i)?Wi().append(s):s;s.setFormat(n),s.setStyle(r),null===o?i.append(a):o.insertBefore(a),e.is(t)&&t.set(s.__key,0,"text"),e.set(s.__key,0,"text")}(o,s,r,i);const a=o.offset;let l=s.offset;const c=this.getNodes(),u=c.length;let d=c[0];Nr(d)||W(26);const h=d.getTextContent().length,p=d.getParentOrThrow();let f=c[u-1];if(1===u&&"element"===s.type&&(l=h,s.set(o.key,l,"text")),this.isCollapsed()&&a===h&&(d.isSegmented()||d.isToken()||!d.canInsertTextAfter()||!p.canInsertTextAfter()&&null===d.getNextSibling())){let t=d.getNextSibling();if(Nr(t)&&t.canInsertTextBefore()&&!tt(t)||(t=Or(),t.setFormat(r),p.canInsertTextAfter()?d.insertAfter(t):p.insertAfter(t)),t.select(0,0),d=t,""!==e)return void this.insertText(e)}else if(this.isCollapsed()&&0===a&&(d.isSegmented()||d.isToken()||!d.canInsertTextBefore()||!p.canInsertTextBefore()&&null===d.getPreviousSibling())){let t=d.getPreviousSibling();if(Nr(t)&&!tt(t)||(t=Or(),t.setFormat(r),p.canInsertTextBefore()?d.insertBefore(t):p.insertBefore(t)),t.select(),d=t,""!==e)return void this.insertText(e)}else if(d.isSegmented()&&a!==h){const e=Or(d.getTextContent());e.setFormat(r),d.replace(e),d=e}else if(!this.isCollapsed()&&""!==e){const t=f.getParent();if(!p.canInsertTextBefore()||!p.canInsertTextAfter()||Fi(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(""),Jr(this.anchor,this.focus,null),void this.insertText(e)}if(1===u){if(d.isToken()){const t=Or(e);return t.select(),void d.replace(t)}const t=d.getFormat(),n=d.getStyle();if(a!==l||t===r&&n===i){if(Mr(d)){const t=Or(e);return t.setFormat(r),t.setStyle(i),t.select(),void d.replace(t)}}else{if(""!==d.getTextContent()){const t=Or(e);if(t.setFormat(r),t.setStyle(i),t.select(),0===a)d.insertBefore(t,!1);else{const[e]=d.splitText(a);e.insertAfter(t,!1)}return void(t.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length))}d.setFormat(r),d.setStyle(i)}const o=l-a;d=d.spliceText(a,o,e,!0),""===d.getTextContent()?d.remove():"text"===this.anchor.type&&(d.isComposing()?this.anchor.offset-=e.length:(this.format=t,this.style=n))}else{const t=new Set([...d.getParentKeys(),...f.getParentKeys()]),n=Fi(d)?d:d.getParentOrThrow();let r=Fi(f)?f:f.getParentOrThrow(),i=f;if(!n.is(r)&&r.isInline())do{i=r,r=r.getParentOrThrow()}while(r.isInline());if("text"===s.type&&(0!==l||""===f.getTextContent())||"element"===s.type&&f.getIndexWithinParent()<l)if(Nr(f)&&!f.isToken()&&l!==f.getTextContentSize()){if(f.isSegmented()){const e=Or(f.getTextContent());f.replace(e),f=e}Vi(s.getNode())||"text"!==s.type||(f=f.spliceText(0,l,"")),t.add(f.__key)}else{const e=f.getParentOrThrow();e.canBeEmpty()||1!==e.getChildrenSize()?f.remove():e.remove()}else t.add(f.__key);const o=r.getChildren(),p=new Set(c),g=n.is(r),m=n.isInline()&&null===d.getNextSibling()?n:d;for(let e=o.length-1;e>=0;e--){const t=o[e];if(t.is(d)||Fi(t)&&t.isParentOf(d))break;t.isAttached()&&(!p.has(t)||t.is(i)?g||m.insertAfter(t,!1):t.remove())}if(!g){let e=r,n=null;for(;null!==e;){const r=e.getChildren(),i=r.length;(0===i||r[i-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(d.isToken())if(a===h)d.select();else{const t=Or(e);t.select(),d.replace(t)}else d=d.spliceText(a,h-a,e,!0),""===d.getTextContent()?d.remove():d.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length);for(let e=1;e<u;e++){const n=c[e],r=n.__key;t.has(r)||n.remove()}}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed())return this.toggleFormat(e),void ct(null);const t=this.getNodes(),n=[];for(const e of t)Nr(e)&&n.push(e);const r=n.length;if(0===r)return this.toggleFormat(e),void ct(null);const i=this.anchor,o=this.focus,s=this.isBackward(),a=s?o:i,l=s?i:o;let c=0,u=n[0],d="element"===a.type?0:a.offset;if("text"===a.type&&d===u.getTextContentSize()&&(c=1,u=n[1],d=0),null==u)return;const h=u.getFormatFlags(e,null),p=r-1;let f=n[p];const g="text"===l.type?l.offset:f.getTextContentSize();if(u.is(f)){if(d===g)return;if(tt(u)||0===d&&g===u.getTextContentSize())u.setFormat(h);else{const e=u.splitText(d,g),t=0===d?e[0]:e[1];t.setFormat(h),"text"===a.type&&a.set(t.__key,0,"text"),"text"===l.type&&l.set(t.__key,g-d,"text")}return void(this.format=h)}0===d||tt(u)||([,u]=u.splitText(d),d=0),u.setFormat(h);const m=f.getFormatFlags(e,h);g>0&&(g===f.getTextContentSize()||tt(f)||([f]=f.splitText(g)),f.setFormat(m));for(let t=c+1;t<p;t++){const r=n[t],i=r.getFormatFlags(e,m);r.setFormat(i)}"text"===a.type&&a.set(u.__key,d,"text"),"text"===l.type&&l.set(f.__key,g,"text"),this.format=h|m}insertNodes(e){if(0===e.length)return;if("root"===this.anchor.key){this.insertParagraph();const t=oi();return Kr(t)||W(134),t.insertNodes(e)}const t=sn((this.isBackward()?this.focus:this.anchor).getNode(),on),n=e[e.length-1];if("__language"in t&&Fi(t)){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const r=hi(this);t.splice(r,0,e),n.selectEnd()}return}if(!e.some((e=>(Fi(e)||Qi(e))&&!e.isInline()))){Fi(t)||W(135);const r=hi(this);return t.splice(r,0,e),void n.selectEnd()}const r=function(e){const t=Wi();let n=null;for(let r=0;r<e.length;r++){const i=e[r],o=fr(i);if(o||Qi(i)&&i.isInline()||Fi(i)&&i.isInline()||Nr(i)||i.isParentRequired()){if(null===n&&(n=i.createParentElementNode(),t.append(n),o))continue;null!==n&&n.append(i)}else t.append(i),n=null}return t}(e),i=r.getLastDescendant(),o=r.getChildren(),s=e=>"__value"in e&&"__checked"in e,a=Fi(t)&&t.isEmpty()?null:this.insertParagraph(),l=o[o.length-1];let c=o[0];var u;Fi(u=c)&&on(u)&&!u.isEmpty()&&Fi(t)&&(!t.isEmpty()||s(t))&&(Fi(t)||W(135),t.append(...c.getChildren()),c=o[1]),c&&function(e,t,n){const r=t.getParentOrThrow().getLastChild();let i=t;const o=[t];for(;i!==r;)i.getNextSibling()||W(140),i=i.getNextSibling(),o.push(i);let s=e;for(const e of o)s=s.insertAfter(e)}(t,c);const d=sn(i,on);a&&Fi(d)&&(s(a)||on(l))&&(d.append(...a.getChildren()),a.remove()),Fi(t)&&t.isEmpty()&&t.remove(),i.selectEnd();const h=Fi(t)?t.getLastChild():null;fr(h)&&d!==t&&h.remove()}insertParagraph(){if("root"===this.anchor.key){const e=Wi();return mt().splice(this.anchor.offset,0,[e]),e.select(),e}const e=hi(this),t=sn(this.anchor.getNode(),on);Fi(t)||W(136);const n=t.getChildAtIndex(e),r=n?[n,...n.getNextSiblings()]:[],i=t.insertNewAfter(this,!1);return i?(i.append(...r),i.selectStart(),i):null}insertLineBreak(e){const t=pr();if(this.insertNodes([t]),e){const e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){const e=this.getNodes(),t=e.length,n=t-1,r=this.anchor,i=this.focus;let o=e[0],s=e[n];const[a,l]=zr(this);if(0===t)return[];if(1===t){if(Nr(o)&&!this.isCollapsed()){const e=a>l?l:a,t=a>l?a:l,n=o.splitText(e,t),r=0===e?n[0]:n[1];return null!=r?[r]:[]}return[o]}const c=r.isBefore(i);if(Nr(o)){const t=c?a:l;t===o.getTextContentSize()?e.shift():0!==t&&([,o]=o.splitText(t),e[0]=o)}if(Nr(s)){const t=s.getTextContent().length,r=c?l:a;0===r?e.pop():r!==t&&([s]=s.splitText(r),e[n]=s)}return e}modify(e,t,n){const r=this.focus,i=this.anchor,o="move"===e,s=Lt(r,t);if(Qi(s)&&!s.isIsolated()){if(o&&s.isKeyboardSelectable()){const e=ni();return e.add(s.__key),void vt(e)}const e=t?s.getPreviousSibling():s.getNextSibling();if(Nr(e)){const n=e.__key,s=t?e.getTextContent().length:0;return r.set(n,s,"text"),void(o&&i.set(n,s,"text"))}{const n=s.getParentOrThrow();let a,l;return Fi(e)?(l=e.__key,a=t?e.getChildrenSize():0):(a=s.getIndexWithinParent(),l=n.__key,t||a++),r.set(l,a,"element"),void(o&&i.set(l,a,"element"))}}const a=Ei(),l=Xt(a._window);if(!l)return;const c=a._blockCursorElement,u=a._rootElement;if(null===u||null===c||!Fi(s)||s.isInline()||s.canBeEmpty()||Jt(c,a,u),function(e,t,n,r){e.modify(t,n,r)}(l,e,t?"backward":"forward",n),l.rangeCount>0){const e=l.getRangeAt(0),n=this.anchor.getNode(),r=Vi(n)?n:function(e){let t=e.getParentOrThrow();for(;null!==t;){if(zt(t))return t;t=t.getParentOrThrow()}return t}(n);if(this.applyDOMRange(e),this.dirty=!0,!o){const n=this.getNodes(),i=[];let o=!1;for(let e=0;e<n.length;e++){const t=n[e];Gt(t,r)?i.push(t):o=!0}if(o&&i.length>0)if(t){const e=i[0];Fi(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{const e=i[i.length-1];Fi(e)?e.selectEnd():e.getParentOrThrow().selectEnd()}l.anchorNode===e.startContainer&&l.anchorOffset===e.startOffset||function(e){const t=e.focus,n=e.anchor,r=n.key,i=n.offset,o=n.type;Ur(n,t.key,t.offset,t.type),Ur(t,r,i,o),e._cachedNodes=null}(this)}}}forwardDeletion(e,t,n){if(!n&&("element"===e.type&&Fi(t)&&e.offset===t.getChildrenSize()||"text"===e.type&&e.offset===t.getTextContentSize())){const e=t.getParent(),n=t.getNextSibling()||(null===e?null:e.getNextSibling());if(Fi(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const t=this.anchor;let n=t.getNode();if(this.forwardDeletion(t,n,e))return;const r=this.focus,o=Lt(r,e);if(Qi(o)&&!o.isIsolated()){if(o.isKeyboardSelectable()&&Fi(n)&&0===n.getChildrenSize()){n.remove();const e=ni();e.add(o.__key),vt(e)}else o.remove(),Ei().dispatchCommand(i,void 0);return}if(!e&&Fi(o)&&Fi(n)&&n.isEmpty())return n.remove(),void o.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&0===t.offset&&("element"===t.type?t.getNode():t.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const i="text"===r.type?r.getNode():null;if(n="text"===t.type?t.getNode():null,null!==i&&i.isSegmented()){const t=r.offset,o=i.getTextContentSize();if(i.is(n)||e&&t!==o||!e&&0!==t)return void Zr(i,e,t)}else if(null!==n&&n.isSegmented()){const r=t.offset,o=n.getTextContentSize();if(n.is(i)||e&&0!==r||!e&&r!==o)return void Zr(n,e,r)}!function(e,t){const n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&"text"===n.type&&"text"===r.type){const e=n.offset,o=r.offset,s=e<o,a=s?e:o,l=s?o:e,c=l-1;a!==c&&(wt(i.getTextContent().slice(a,l))||(t?r.offset=c:n.offset=c))}}(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&"element"===this.anchor.type&&0===this.anchor.offset){const e=this.anchor.getNode();e.isEmpty()&&Vi(e.getParent())&&0===e.getIndexWithinParent()&&e.collapseAtStart(this)}}deleteLine(e){if(this.isCollapsed()){const t="element"===this.anchor.type;if(t&&this.insertText(" "),this.modify("extend",e,"lineboundary"),0===(e?this.focus:this.anchor).offset&&this.modify("extend",e,"character"),t){const t=e?this.anchor:this.focus;t.set(t.key,t.offset+1,t.type)}}this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function Gr(e){return e instanceof Vr}function Yr(e){const t=e.offset;if("text"===e.type)return t;const n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function zr(e){const t=e.getStartEndPoints();if(null===t)return[0,0];const[n,r]=t;return"element"===n.type&&"element"===r.type&&n.key===r.key&&n.offset===r.offset?[0,0]:[Yr(n),Yr(r)]}function Zr(e,t,n){const r=e,i=r.getTextContent().split(/(?=\s)/g),o=i.length;let s=0,a=0;for(let e=0;e<o;e++){const r=e===o-1;if(a=s,s+=i[e].length,t&&s===n||s>n||r){i.splice(e,1),r&&(a=void 0);break}}const l=i.join("").trim();""===l?r.remove():(r.setTextContent(l),r.select(a,a))}function Wr(e,t,n,r){let i,o=t;if(e.nodeType===ae){let s=!1;const a=e.childNodes,l=a.length,c=r._blockCursorElement;o===l&&(s=!0,o=l-1);let u=a[o],d=!1;if(u===c)u=a[o+1],d=!0;else if(null!==c){const n=c.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,c)&&o--}if(i=At(u),Nr(i))o=bt(i,s);else{let r=At(e);if(null===r)return null;if(Fi(r)){o=Math.min(r.getChildrenSize(),o);let e=r.getChildAtIndex(o);if(Fi(e)&&function(e,t,n){const r=e.getParent();return null===n||null===r||!r.canBeEmpty()||r!==n.getNode()}(e,0,n)){const t=s?e.getLastDescendant():e.getFirstDescendant();null===t?r=e:(e=t,r=Fi(e)?e:e.getParentOrThrow()),o=0}Nr(e)?(i=e,r=null,o=bt(e,s)):e!==r&&s&&!d&&o++}else{const n=r.getIndexWithinParent();o=0===t&&Qi(r)&&At(e)===r?n:n+1,r=r.getParentOrThrow()}if(Fi(r))return Rr(r.__key,o,"element")}}else i=At(e);return Nr(i)?Rr(i.__key,o,"text"):null}function qr(e,t,n){const r=e.offset,i=e.getNode();if(0===r){const r=i.getPreviousSibling(),o=i.getParent();if(t){if((n||!t)&&null===r&&Fi(o)&&o.isInline()){const t=o.getPreviousSibling();Nr(t)&&(e.key=t.__key,e.offset=t.getTextContent().length)}}else Fi(r)&&!n&&r.isInline()?(e.key=r.__key,e.offset=r.getChildrenSize(),e.type="element"):Nr(r)&&(e.key=r.__key,e.offset=r.getTextContent().length)}else if(r===i.getTextContent().length){const r=i.getNextSibling(),o=i.getParent();if(t&&Fi(r)&&r.isInline())e.key=r.__key,e.offset=0,e.type="element";else if((n||t)&&null===r&&Fi(o)&&o.isInline()&&!o.canInsertTextAfter()){const t=o.getNextSibling();Nr(t)&&(e.key=t.__key,e.offset=0)}}}function Jr(e,t,n){if("text"===e.type&&"text"===t.type){const r=e.isBefore(t),i=e.is(t);qr(e,r,i),qr(t,!r,i),i&&(t.key=e.key,t.offset=e.offset,t.type=e.type);const o=Ei();if(o.isComposing()&&o._compositionKey!==e.key&&Kr(n)){const r=n.anchor,i=n.focus;Ur(e,r.key,r.offset,r.type),Ur(t,i.key,i.offset,i.type)}}}function Xr(e,t,n,r,i,o){if(null===e||null===n||!$e(i,e,n))return null;const s=Wr(e,t,Kr(o)?o.anchor:null,i);if(null===s)return null;const a=Wr(n,r,Kr(o)?o.focus:null,i);if(null===a)return null;if("element"===s.type&&"element"===a.type){const t=At(e),r=At(n);if(Qi(t)&&Qi(r))return null}return Jr(s,a,o),[s,a]}function $r(e){return Fi(e)&&!e.isInline()}function ei(e,t,n,r,i,o){const s=Ci(),a=new Hr(Rr(e,t,i),Rr(n,r,o),0,"");return a.dirty=!0,s._selection=a,a}function ti(){const e=Rr("root",0,"element"),t=Rr("root",0,"element");return new Hr(e,t,0,"")}function ni(){return new Vr(new Set)}function ri(e,t){return ii(null,e,t,null)}function ii(e,t,n,r){const i=n._window;if(null===i)return null;const o=r||i.event,s=o?o.type:void 0,a="selectionchange"===s,l=!Me&&(a||"beforeinput"===s||"compositionstart"===s||"compositionend"===s||"click"===s&&o&&3===o.detail||"drop"===s||void 0===s);let c,u,d,h;if(Kr(e)&&!l)return e.clone();if(null===t)return null;if(c=t.anchorNode,u=t.focusNode,d=t.anchorOffset,h=t.focusOffset,a&&Kr(e)&&!$e(n,c,u))return e.clone();const p=Xr(c,d,u,h,n,e);if(null===p)return null;const[f,g]=p;return new Hr(f,g,Kr(e)?e.format:0,Kr(e)?e.style:"")}function oi(){return Ci()._selection}function si(){return Ei()._editorState._selection}function ai(e,t,n,r=1){const i=e.anchor,o=e.focus,s=i.getNode(),a=o.getNode();if(!t.is(s)&&!t.is(a))return;const l=t.__key;if(e.isCollapsed()){const t=i.offset;if(n<=t&&r>0||n<t&&r<0){const n=Math.max(0,t+r);i.set(l,n,"element"),o.set(l,n,"element"),li(e)}}else{const s=e.isBackward(),a=s?o:i,c=a.getNode(),u=s?i:o,d=u.getNode();if(t.is(c)){const e=a.offset;(n<=e&&r>0||n<e&&r<0)&&a.set(l,Math.max(0,e+r),"element")}if(t.is(d)){const e=u.offset;(n<=e&&r>0||n<e&&r<0)&&u.set(l,Math.max(0,e+r),"element")}}li(e)}function li(e){const t=e.anchor,n=t.offset,r=e.focus,i=r.offset,o=t.getNode(),s=r.getNode();if(e.isCollapsed()){if(!Fi(o))return;const e=o.getChildrenSize(),i=n>=e,s=i?o.getChildAtIndex(e-1):o.getChildAtIndex(n);if(Nr(s)){let e=0;i&&(e=s.getTextContentSize()),t.set(s.__key,e,"text"),r.set(s.__key,e,"text")}}else{if(Fi(o)){const e=o.getChildrenSize(),r=n>=e,i=r?o.getChildAtIndex(e-1):o.getChildAtIndex(n);if(Nr(i)){let e=0;r&&(e=i.getTextContentSize()),t.set(i.__key,e,"text")}}if(Fi(s)){const e=s.getChildrenSize(),t=i>=e,n=t?s.getChildAtIndex(e-1):s.getChildAtIndex(i);if(Nr(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,"text")}}}}function ci(e,t,n,r,i){let o=null,s=0,a=null;null!==r?(o=r.__key,Nr(r)?(s=r.getTextContentSize(),a="text"):Fi(r)&&(s=r.getChildrenSize(),a="element")):null!==i&&(o=i.__key,Nr(i)?a="text":Fi(i)&&(a="element")),null!==o&&null!==a?e.set(o,s,a):(s=t.getIndexWithinParent(),-1===s&&(s=n.getChildrenSize()),e.set(n.__key,s,"element"))}function ui(e,t,n,r,i){"text"===e.type?(e.key=n,t||(e.offset+=i)):e.offset>r.getIndexWithinParent()&&(e.offset-=1)}function di(e){let t=oi()||si();null===t&&(t=mt().selectEnd()),t.insertNodes(e)}function hi(e){let t=e;e.isCollapsed()||t.removeText();const n=oi();Kr(n)&&(t=n),Kr(t)||W(161);const r=t.anchor;let i=r.getNode(),o=r.offset;for(;!on(i);)[i,o]=pi(i,o);return o}function pi(e,t){const n=e.getParent();if(!n){const e=Wi();return mt().append(e),e.select(),[mt(),0]}if(Nr(e)){const r=e.splitText(t);if(0===r.length)return[n,e.getIndexWithinParent()];const i=0===t?0:1;return[n,r[0].getIndexWithinParent()+i]}if(!Fi(e)||0===t)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const n=new Hr(Rr(e.__key,t,"element"),Rr(e.__key,t,"element"),0,""),i=e.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}let fi=null,gi=null,mi=!1,yi=!1,vi=0;const Ai={characterData:!0,childList:!0,subtree:!0};function bi(){return mi||null!==fi&&fi._readOnly}function wi(){mi&&W(13)}function Si(){vi>99&&W(14)}function Ci(){return null===fi&&W(15),fi}function Ei(){return null===gi&&W(16),gi}function Ii(e,t,n){const r=t.__type,i=function(e,t){const n=e._nodes.get(t);return void 0===n&&W(30,t),n}(e,r);let o=n.get(r);void 0===o&&(o=Array.from(i.transforms),n.set(r,o));const s=o.length;for(let e=0;e<s&&(o[e](t),t.isAttached());e++);}function _i(e,t){return void 0!==e&&e.__key!==t&&e.isAttached()}function xi(e){return Pi(e,Ei()._nodes)}function Pi(e,t){const n=e.type,r=t.get(n);void 0===r&&W(17,n);const i=r.klass;e.type!==i.getType()&&W(18,i.name);const o=i.importJSON(e),s=e.children;if(Fi(o)&&Array.isArray(s))for(let e=0;e<s.length;e++){const n=Pi(s[e],t);o.append(n)}return o}function ki(e,t){const n=fi,r=mi,i=gi;fi=e,mi=!0,gi=null;try{return t()}finally{fi=n,mi=r,gi=i}}function Bi(e,t){const n=e._pendingEditorState,r=e._rootElement,o=e._headless||null===r;if(null===n)return;const s=e._editorState,a=s._selection,l=n._selection,c=e._dirtyType!==ce,u=fi,d=mi,h=gi,p=e._updating,f=e._observer;let g=null;if(e._pendingEditorState=null,e._editorState=n,!o&&c&&null!==f){gi=e,fi=n,mi=!1,e._updating=!0;try{const t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;f.disconnect(),g=function(e,t,n,r,i,o){vn="",wn="",An="",Sn=r===de,En=null,cn=n,ln=n._config,un=n._nodes,dn=cn._listeners.mutation,hn=i,pn=o,fn=e._nodeMap,gn=t._nodeMap,Cn=t._readOnly,mn=new Map(n._keyToDOMMap);const s=new Map;return yn=s,Fn("root",null),cn=void 0,un=void 0,hn=void 0,pn=void 0,fn=void 0,gn=void 0,ln=void 0,mn=void 0,yn=void 0,s}(s,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),yi)throw t;return no(e,null,r,n),He(e),e._dirtyType=de,yi=!0,Bi(e,s),void(yi=!1)}finally{f.observe(r,Ai),e._updating=p,fi=u,mi=d,gi=h}}n._readOnly||(n._readOnly=!0);const m=e._dirtyLeaves,y=e._dirtyElements,v=e._normalizedNodes,A=e._updateTags,b=e._deferred;c&&(e._dirtyType=ce,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),function(e,t){const n=e._decorators;let r=e._pendingDecorators||n;const i=t._nodeMap;let o;for(o in r)i.has(o)||(r===n&&(r=ft(e)),delete r[o])}(e,n);const w=o?null:Xt(e._window);if(e._editable&&null!==w&&(c||null===l||l.dirty)){gi=e,fi=n;try{if(null!==f&&f.disconnect(),c||null===l||l.dirty){const t=e._blockCursorElement;null!==t&&Jt(t,e,r),function(e,t,n,r,i,o,s){const a=r.anchorNode,l=r.focusNode,c=r.anchorOffset,u=r.focusOffset,d=document.activeElement;if(i.has("collaboration")&&d!==o||null!==d&&Xe(d))return;if(!Kr(t))return void(null!==e&&$e(n,a,l)&&r.removeAllRanges());const h=t.anchor,p=t.focus,f=h.key,g=p.key,m=Kt(n,f),y=Kt(n,g),v=h.offset,A=p.offset,b=t.format,w=t.style,S=t.isCollapsed();let C=m,E=y,I=!1;if("text"===h.type){C=rt(m);const e=h.getNode();I=e.getFormat()!==b||e.getStyle()!==w}else Kr(e)&&"text"===e.anchor.type&&(I=!0);var _,x,P,k,B;if("text"===p.type&&(E=rt(y)),null!==C&&null!==E&&(S&&(null===e||I||Kr(e)&&(e.format!==b||e.style!==w))&&(_=b,x=w,P=v,k=f,B=performance.now(),Xn=[_,x,P,k,B]),c!==v||u!==A||a!==C||l!==E||"Range"===r.type&&S||(null!==d&&o.contains(d)||o.focus({preventScroll:!0}),"element"===h.type))){try{r.setBaseAndExtent(C,v,E,A)}catch(e){}if(!i.has("skip-scroll-into-view")&&t.isCollapsed()&&null!==o&&o===document.activeElement){const e=t instanceof Hr&&"element"===t.anchor.type?C.childNodes[v]||null:r.rangeCount>0?r.getRangeAt(0):null;if(null!==e){let t;if(e instanceof Text){const n=document.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();!function(e,t,n){const r=n.ownerDocument,i=r.defaultView;if(null===i)return;let{top:o,bottom:s}=t,a=0,l=0,c=n;for(;null!==c;){const t=c===r.body;if(t)a=0,l=Yt(e).innerHeight;else{const e=c.getBoundingClientRect();a=e.top,l=e.bottom}let n=0;if(o<a?n=-(a-o):s>l&&(n=s-l),0!==n)if(t)i.scrollBy(0,n);else{const e=c.scrollTop;c.scrollTop+=n;const t=c.scrollTop-e;o-=t,s-=t}if(t)break;c=Ht(c)}}(n,t,o)}}Zn=!0}}(a,l,e,w,A,r)}(function(e,t,n){let r=e._blockCursorElement;if(Kr(n)&&n.isCollapsed()&&"element"===n.anchor.type&&t.contains(document.activeElement)){const i=n.anchor,o=i.getNode(),s=i.offset;let a=!1,l=null;if(s===o.getChildrenSize())qt(o.getChildAtIndex(s-1))&&(a=!0);else{const t=o.getChildAtIndex(s);if(qt(t)){const n=t.getPreviousSibling();(null===n||qt(n))&&(a=!0,l=e.getElementByKey(t.__key))}}if(a){const n=e.getElementByKey(o.__key);return null===r&&(e._blockCursorElement=r=function(e){const t=e.theme,n=document.createElement("div");n.contentEditable="false",n.setAttribute("data-lexical-cursor","true");let r=t.blockCursor;if(void 0!==r){if("string"==typeof r){const e=je(r);r=t.blockCursor=e}void 0!==r&&n.classList.add(...r)}return n}(e._config)),t.style.caretColor="transparent",void(null===l?n.appendChild(r):n.insertBefore(r,l))}}null!==r&&Jt(r,e,t)})(e,r,l),null!==f&&f.observe(r,Ai)}finally{gi=h,fi=u}}null!==g&&function(e,t,n,r,i){const o=Array.from(e._listeners.mutation),s=o.length;for(let e=0;e<s;e++){const[s,a]=o[e],l=t.get(a);void 0!==l&&s(l,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}(e,g,A,m,s),Kr(l)||null===l||null!==a&&a.is(l)||e.dispatchCommand(i,void 0);const S=e._pendingDecorators;null!==S&&(e._decorators=S,e._pendingDecorators=null,Oi("decorator",e,!0,S)),function(e,t,n){const r=gt(t),i=gt(n);r!==i&&Oi("textcontent",e,!0,i)}(e,t||s,n),Oi("update",e,!0,{dirtyElements:y,dirtyLeaves:m,editorState:n,normalizedNodes:v,prevEditorState:t||s,tags:A}),function(e,t){if(e._deferred=[],0!==t.length){const n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}(e,b),function(e){const t=e._updates;if(0!==t.length){const n=t.shift();if(n){const[t,r]=n;ji(e,t,r)}}}(e)}function Oi(e,t,n,...r){const i=t._updating;t._updating=n;try{const n=Array.from(t._listeners[e]);for(let e=0;e<n.length;e++)n[e].apply(null,r)}finally{t._updating=i}}function Ni(e,t,n){if(!1===e._updating||gi!==e){let r=!1;return e.update((()=>{r=Ni(e,t,n)})),r}const r=St(e);for(let i=4;i>=0;i--)for(let o=0;o<r.length;o++){const s=r[o]._commands.get(t);if(void 0!==s){const t=s[i];if(void 0!==t){const r=Array.from(t),i=r.length;for(let t=0;t<i;t++)if(!0===r[t](n,e))return!0}}}return!1}function Di(e,t){const n=e._updates;let r=t||!1;for(;0!==n.length;){const t=n.shift();if(t){const[n,i]=t;let o,s;void 0!==i&&(o=i.onUpdate,s=i.tag,i.skipTransforms&&(r=!0),o&&e._deferred.push(o),s&&e._updateTags.add(s)),n()}}return r}function ji(e,t,n){const r=e._updateTags;let i,o,s=!1,a=!1;void 0!==n&&(i=n.onUpdate,o=n.tag,null!=o&&r.add(o),s=n.skipTransforms||!1,a=n.discrete||!1),i&&e._deferred.push(i);const l=e._editorState;let c=e._pendingEditorState,u=!1;(null===c||c._readOnly)&&(c=e._pendingEditorState=new Gi(new Map((c||l)._nodeMap)),u=!0),c._flushSync=a;const d=fi,h=mi,p=gi,f=e._updating;fi=c,mi=!1,e._updating=!0,gi=e;try{u&&(e._headless?null!==l._selection&&(c._selection=l._selection.clone()):c._selection=function(e){const t=e.getEditorState()._selection,n=Xt(e._window);return Kr(t)||null==t?ii(t,n,e,null):t.clone()}(e));const n=e._compositionKey;t(),s=Di(e,s),function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(Kr(r)){const e=r.anchor,t=r.focus;let i;if("text"===e.type&&(i=e.getNode(),i.selectionTransform(n,r)),"text"===t.type){const e=t.getNode();i!==e&&e.selectionTransform(n,r)}}}(c,e),e._dirtyType!==ce&&(s?function(e,t){const n=t._dirtyLeaves,r=e._nodeMap;for(const e of n){const t=r.get(e);Nr(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&ze(t)}}(c,e):function(e,t){const n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,o=ut(),s=new Map;let a=n,l=a.size,c=r,u=c.size;for(;l>0||u>0;){if(l>0){t._dirtyLeaves=new Set;for(const e of a){const r=i.get(e);Nr(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&ze(r),void 0!==r&&_i(r,o)&&Ii(t,r,s),n.add(e)}if(a=t._dirtyLeaves,l=a.size,l>0){vi++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map;for(const e of c){const n=e[0],a=e[1];if("root"!==n&&!a)continue;const l=i.get(n);void 0!==l&&_i(l,o)&&Ii(t,l,s),r.set(n,a)}a=t._dirtyLeaves,l=a.size,c=t._dirtyElements,u=c.size,vi++}t._dirtyLeaves=n,t._dirtyElements=r}(c,e),Di(e),function(e,t,n,r){const i=e._nodeMap,o=t._nodeMap,s=[];for(const[e]of r){const t=o.get(e);void 0!==t&&(t.isAttached()||(Fi(t)&&an(t,e,i,o,s,r),i.has(e)||r.delete(e),s.push(e)))}for(const e of s)o.delete(e);for(const e of n){const t=o.get(e);void 0===t||t.isAttached()||(i.has(e)||n.delete(e),o.delete(e))}}(l,c,e._dirtyLeaves,e._dirtyElements)),n!==e._compositionKey&&(c._flushSync=!0);const r=c._selection;if(Kr(r)){const e=c._nodeMap,t=r.anchor.key,n=r.focus.key;void 0!==e.get(t)&&void 0!==e.get(n)||W(19)}else Gr(r)&&0===r._nodes.size&&(c._selection=null)}catch(t){return t instanceof Error&&e._onError(t),e._pendingEditorState=l,e._dirtyType=de,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void Bi(e)}finally{fi=d,mi=h,gi=p,e._updating=f,vi=0}const g=e._dirtyType!==ce||function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(null!==r){if(r.dirty||!r.is(n))return!0}else if(null!==n)return!0;return!1}(c,e);g?c._flushSync?(c._flushSync=!1,Bi(e)):u&&Je((()=>{Bi(e)})):(c._flushSync=!1,u&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function Ti(e,t,n){e._updating?e._updates.push([t,n]):ji(e,t,n)}class Mi extends ur{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__indent=0,this.__dir=null}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return Oe[e]||""}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()}isDirty(){const e=Ei()._dirtyElements;return null!==e&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return null!==t&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;null!==t;){if(Nr(t)&&e.push(t),Fi(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;Fi(e);){const t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;Fi(e);){const t=e.getLastChild();if(null===t)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),n=t.length;if(e>=n){const e=t[n-1];return Fi(e)&&e.getLastDescendant()||e||null}const r=t[e];return Fi(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const e=this.getLatest().__first;return null===e?null:dt(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return null===e&&W(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return null===e?null:dt(e)}getLastChildOrThrow(){const e=this.getLastChild();return null===e&&W(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;null!==n&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;null!==n&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e="";const t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){const i=t[r];e+=i.getTextContent(),Fi(i)&&r!==n-1&&!i.isInline()&&(e+=Se)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){const i=t[r];e+=i.getTextContentSize(),Fi(i)&&r!==n-1&&!i.isInline()&&(e+=Se.length)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(""!==e){const t=Be[e];return!!(this.getFormat()&t)}return!1}select(e,t){wi();const n=oi();let r=e,i=t;const o=this.getChildrenSize();if(!this.canBeEmpty())if(0===e&&0===t){const e=this.getFirstChild();if(Nr(e)||Fi(e))return e.select(0,0)}else if(!(void 0!==e&&e!==o||void 0!==t&&t!==o)){const e=this.getLastChild();if(Nr(e)||Fi(e))return e.select()}void 0===r&&(r=o),void 0===i&&(i=o);const s=this.__key;return Kr(n)?(n.anchor.set(s,r,"element"),n.focus.set(s,i,"element"),n.dirty=!0,n):ei(s,r,s,i,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach((e=>e.remove())),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=""!==e?Be[e]:0,this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){const r=n.length,i=this.getChildrenSize(),o=this.getWritable(),s=o.__key,a=[],l=[],c=this.getChildAtIndex(e+t);let u=null,d=i-t+r;if(0!==e)if(e===i)u=this.getLastChild();else{const t=this.getChildAtIndex(e);null!==t&&(u=t.getPreviousSibling())}if(t>0){let e=null===u?this.getFirstChild():u.getNextSibling();for(let n=0;n<t;n++){null===e&&W(100);const t=e.getNextSibling(),n=e.__key;at(e.getWritable()),l.push(n),e=t}}let h=u;for(let e=0;e<r;e++){const t=n[e];null!==h&&t.is(h)&&(u=h=h.getPreviousSibling());const r=t.getWritable();r.__parent===s&&d--,at(r);const i=t.__key;if(null===h)o.__first=i,r.__prev=null;else{const e=h.getWritable();e.__next=i,r.__prev=e.__key}t.__key===s&&W(76),r.__parent=s,a.push(i),h=t}if(e+t===i)null!==h&&(h.getWritable().__next=null,o.__last=h.__key);else if(null!==c){const e=c.getWritable();if(null!==h){const t=h.getWritable();e.__prev=h.__key,t.__next=c.__key}else e.__prev=null}if(o.__size=d,l.length){const e=oi();if(Kr(e)){const t=new Set(l),n=new Set(a),{anchor:r,focus:i}=e;Ri(r,t,n)&&ci(r,r.getNode(),this,u,c),Ri(i,t,n)&&ci(i,i.getNode(),this,u,c),0!==d||this.canBeEmpty()||zt(this)||this.remove()}}return o}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}}function Fi(e){return e instanceof Mi}function Ri(e,t,n){let r=e.getNode();for(;r;){const e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}class Li extends ur{constructor(e){super(e)}decorate(e,t){W(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Qi(e){return e instanceof Li}class Ui extends Mi{static getType(){return"root"}static clone(){return new Ui}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){W(51)}getTextContent(){const e=this.__cachedText;return!bi()&&Ei()._dirtyType!==ce||null===e?super.getTextContent():e}remove(){W(52)}replace(e){W(53)}insertBefore(e){W(54)}insertAfter(e){W(55)}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const n=e[t];Fi(n)||Qi(n)||W(56)}return super.append(...e)}static importJSON(e){const t=mt();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function Vi(e){return e instanceof Ui}function Ki(){return new Gi(new Map([["root",new Ui]]))}function Hi(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&W(130,n.name),Fi(e)){const r=t.children;Array.isArray(r)||W(59,n.name);const i=e.getChildren();for(let e=0;e<i.length;e++){const t=Hi(i[e]);r.push(t)}}return t}class Gi{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return 1===this._nodeMap.size&&null===this._selection}read(e){return ki(this,e)}clone(e){const t=new Gi(this._nodeMap,void 0===e?this._selection:e);return t._readOnly=!0,t}toJSON(){return ki(this,(()=>({root:Hi(mt())})))}}class Yi extends Mi{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class zi extends Mi{constructor(e){super(e),this.__textFormat=0}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=Pe[e];return!!(this.getTextFormat()&t)}static clone(e){return new zi(e.__key)}createDOM(e){const t=document.createElement("p"),n=Tt(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:Zi,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&tn(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n);const r=this.getIndent();r>0&&(t.style.textIndent=20*r+"px")}return{element:t}}static importJSON(e){const t=Wi();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),type:"paragraph",version:1}}insertNewAfter(e,t){const n=Wi();n.setTextFormat(e.format);const r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),this.insertAfter(n,t),n}collapseAtStart(){const e=this.getChildren();if(0===e.length||Nr(e[0])&&""===e[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function Zi(e){const t=Wi();if(e.style){t.setFormat(e.style.textAlign);const n=parseInt(e.style.textIndent,10)/20;n>0&&t.setIndent(n)}return{node:t}}function Wi(){return Zt(new zi)}function qi(e){return e instanceof zi}const Ji=0,Xi=1,$i=2,eo=3,to=4;function no(e,t,n,r){const i=e._keyToDOMMap;i.clear(),e._editorState=Ki(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=ce,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;const o=e._observer;null!==o&&(o.disconnect(),e._observer=null),null!==t&&(t.textContent=""),null!==n&&(n.textContent="",i.set("root",n))}function ro(e){const t=e||{},n=gi,r=t.theme||{},i=void 0===e?n:t.parentEditor||null,o=t.disableEvents||!1,s=Ki(),a=t.namespace||(null!==i?i._config.namespace:Ct()),l=t.editorState,c=[Ui,Sr,dr,jr,zi,Yi,...t.nodes||[]],{onError:u,html:d}=t,h=void 0===t.editable||t.editable;let p;if(void 0===e&&null!==n)p=n._nodes;else{p=new Map;for(let e=0;e<c.length;e++){let t=c[e],n=null,r=null;if("function"!=typeof t){const e=t;t=e.replace,n=e.with,r=e.withKlass||null}const i=t.getType(),o=t.transform(),s=new Set;null!==o&&s.add(o),p.set(i,{exportDOM:d&&d.export?d.export.get(t):void 0,klass:t,replace:n,replaceWithKlass:r,transforms:s})}}const f=new io(s,i,p,{disableEvents:o,namespace:a,theme:r},u||console.error,function(e,t){const n=new Map,r=new Set,i=e=>{Object.keys(e).forEach((t=>{let r=n.get(t);void 0===r&&(r=[],n.set(t,r)),r.push(e[t])}))};return e.forEach((e=>{const t=e.klass.importDOM;if(null==t||r.has(t))return;r.add(t);const n=t.call(e.klass);null!==n&&i(n)})),t&&i(t),n}(p,d?d.import:void 0),h);return void 0!==l&&(f._pendingEditorState=l,f._dirtyType=de),f}class io{constructor(e,t,n,r,i,o,s){this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=ce,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Ct(),this._onError=i,this._htmlConversions=o,this._editable=s,this._headless=null!==t&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,n){void 0===n&&W(35);const r=this._commands;r.has(e)||r.set(e,[new Set,new Set,new Set,new Set,new Set]);const i=r.get(e);void 0===i&&W(36,String(e));const o=i[n];return o.add(t),()=>{o.delete(t),i.every((e=>0===e.size))&&r.delete(e)}}registerMutationListener(e,t){let n=this._nodes.get(e.getType());void 0===n&&W(37,e.name);let r=e,i=null;for(;i=n.replaceWithKlass;)r=i,n=this._nodes.get(i.getType()),void 0===n&&W(37,i.name);const o=this._listeners.mutation;return o.set(t,r),()=>{o.delete(t)}}registerNodeTransformToKlass(e,t){const n=e.getType(),r=this._nodes.get(n);return void 0===r&&W(37,e.name),r.transforms.add(t),r}registerNodeTransform(e,t){const n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(null!=i){const e=this.registerNodeTransformToKlass(i,t);r.push(e)}var o;return o=e.getType(),Ti(this,(()=>{const e=Ci();if(e.isEmpty())return;if("root"===o)return void mt().markDirty();const t=e._nodeMap;for(const[,e]of t)e.markDirty()}),null===this._pendingEditorState?{tag:"history-merge"}:void 0),()=>{r.forEach((e=>e.transforms.delete(t)))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return Ut(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const n=Tt(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,no(this,t,e,r),null!==t&&(this._config.disableEvents||function(e){const t=e.ownerDocument,n=zn.get(t);void 0===n&&W(162);const r=n-1;r>=0||W(164),zn.set(t,r),0===r&&t.removeEventListener("selectionchange",sr);const i=e.__lexicalEditor;null!=i&&(function(e){if(null!==e._parentEditor){const t=St(e),n=t[t.length-1]._key;or.get(n)===e&&or.delete(n)}else or.delete(e._key)}(i),e.__lexicalEditor=null);const o=ir(e);for(let e=0;e<o.length;e++)o[e]();e.__lexicalEventHandles=[]}(t),null!=n&&t.classList.remove(...n)),null!==e){const t=function(e){const t=e.ownerDocument;return t&&t.defaultView||null}(e),r=e.style;r.userSelect="text",r.whiteSpace="pre-wrap",r.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=t,this._dirtyType=de,He(this),this._updateTags.add("history-merge"),Bi(this),this._config.disableEvents||function(e,t){const n=e.ownerDocument,r=zn.get(n);(void 0===r||r<1)&&n.addEventListener("selectionchange",sr),zn.set(n,(r||0)+1),e.__lexicalEditor=t;const i=ir(e);for(let n=0;n<Vn.length;n++){const[r,o]=Vn[n],s="function"==typeof o?e=>{lr(e)||(ar(e),(t.isEditable()||"click"===r)&&o(e,t))}:e=>{if(lr(e))return;ar(e);const n=t.isEditable();switch(r){case"cut":return n&&Ut(t,Q,e);case"copy":return Ut(t,L,e);case"paste":return n&&Ut(t,d,e);case"dragstart":return n&&Ut(t,M,e);case"dragover":return n&&Ut(t,F,e);case"dragend":return n&&Ut(t,R,e);case"focus":return n&&Ut(t,Y,e);case"blur":return n&&Ut(t,z,e);case"drop":return n&&Ut(t,j,e)}};e.addEventListener(r,s),i.push((()=>{e.removeEventListener(r,s)}))}}(e,this),null!=n&&e.classList.add(...n)}else this._editorState=r,this._pendingEditorState=null,this._window=null;Oi("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&W(38),Ke(this);const n=this._pendingEditorState,r=this._updateTags,i=void 0!==t?t.tag:null;null===n||n.isEmpty()||(null!=i&&r.add(i),Bi(this)),this._pendingEditorState=e,this._dirtyType=de,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=i&&r.add(i),Bi(this)}parseEditorState(e,t){return function(e,t,n){const r=Ki(),i=fi,o=mi,s=gi,a=t._dirtyElements,l=t._dirtyLeaves,c=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,fi=r,mi=!1,gi=t;try{const i=t._nodes;Pi(e.root,i),n&&n(),r._readOnly=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=a,t._dirtyLeaves=l,t._cloneNotNeeded=c,t._dirtyType=u,fi=i,mi=o,gi=s}return r}("string"==typeof e?JSON.parse(e):e,this,t)}update(e,t){Ti(this,e,t)}focus(e,t={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),Ti(this,(()=>{const e=oi(),n=mt();null!==e?e.dirty=!0:0!==n.getChildrenSize()&&("rootStart"===t.defaultSelection?n.selectStart():n.selectEnd())}),{onUpdate:()=>{n.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;null!==e&&e.blur();const t=Xt(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Oi("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}}},o={};function s(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={id:e,loaded:!1,exports:{}};return i[e].call(n.exports,n,n.exports,s),n.loaded=!0,n.exports}s.m=i,s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,s.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var i=Object.create(null);s.r(i);var o={};e=e||[null,t({}),t([]),t(t)];for(var a=2&r&&n;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((e=>o[e]=()=>n[e]));return o.default=()=>n,s.d(i,o),i},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,n)=>(s.f[n](e,t),t)),[])),s.u=e=>"./"+e+".app.js",s.miniCssF=e=>{},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},r="@standardnotes/web:",s.l=(e,t,i,o)=>{if(n[e])n[e].push(t);else{var a,l;if(void 0!==i)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var d=c[u];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==r+i){a=d;break}}a||(l=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,s.nc&&a.setAttribute("nonce",s.nc),a.setAttribute("data-webpack",r+i),a.src=e),n[e]=[t];var h=(t,r)=>{a.onerror=a.onload=null,clearTimeout(p);var i=n[e];if(delete n[e],a.parentNode&&a.parentNode.removeChild(a),i&&i.forEach((e=>e(r))),t)return t(r)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),l&&document.head.appendChild(a)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;s.g.importScripts&&(e=s.g.location+"");var t=s.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&!e;)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e})(),(()=>{s.b=document.baseURI||self.location.href;var e={179:0};s.f.j=(t,n)=>{var r=s.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var i=new Promise(((n,i)=>r=e[t]=[n,i]));n.push(r[2]=i);var o=s.p+s.u(t),a=new Error;s.l(o,(n=>{if(s.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var i=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+i+": "+o+")",a.name="ChunkLoadError",a.type=i,a.request=o,r[1](a)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,i,[o,a,l]=n,c=0;if(o.some((t=>0!==e[t]))){for(r in a)s.o(a,r)&&(s.m[r]=a[r]);l&&l(s)}for(t&&t(n);c<o.length;c++)i=o[c],s.o(e,i)&&e[i]&&e[i][0](),e[i]=0},n=self.webpackChunk_standardnotes_web=self.webpackChunk_standardnotes_web||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),(()=>{"use strict";var e=s(52322),t=s(24118),n=s(91583),r=s(29894),i=s(98418),o=s(39925),a=s(48834);const l={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let c;const u=new Uint8Array(16);function d(){if(!c&&(c="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!c))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return c(u)}const h=[];for(let e=0;e<256;++e)h.push((e+256).toString(16).slice(1));const p=function(e,t,n){if(l.randomUUID&&!t&&!e)return l.randomUUID();const r=(e=e||{}).random||(e.rng||d)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(h[e[t+0]]+h[e[t+1]]+h[e[t+2]]+h[e[t+3]]+"-"+h[e[t+4]]+h[e[t+5]]+"-"+h[e[t+6]]+h[e[t+7]]+"-"+h[e[t+8]]+h[e[t+9]]+"-"+h[e[t+10]]+h[e[t+11]]+h[e[t+12]]+h[e[t+13]]+h[e[t+14]]+h[e[t+15]]).toLowerCase()}(r)},f=o.base64_variants.ORIGINAL;function g(){return window}function m(){if(!g().crypto)throw Error("Could not obtain SubtleCrypto instance");return g().crypto.subtle}function y(e){return(0,o.from_string)(e)}function v(e){return(0,o.to_hex)(a.lW.from(e))}function A(e){return(0,o.from_hex)(e)}function b(e){return(0,o.from_base64)(e,f)}function w(e){return(0,o.to_base64)(a.lW.from(e),f)}const S="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var C,E;!function(e){e.AesCbc="AES-CBC",e.Sha512="SHA-512",e.Sha256="SHA-256",e.Pbkdf2="PBKDF2",e.Sha1="SHA-1",e.Hmac="HMAC"}(C||(C={})),function(e){e.DeriveBits="deriveBits",e.Encrypt="encrypt",e.Decrypt="decrypt",e.Sign="sign"}(E||(E={}));const I=new class{constructor(){this.ready=o.ready}async initialize(){await this.ready}deinit(){this.ready=null}generateUUID(){return p()}timingSafeEqual(e,t){return(0,i.timingSafeEqual)(e,t)}base64Encode(e){return function(e){return(0,o.to_base64)(e,f)}(e)}base64URLEncode(e){return function(e){return(0,o.to_base64)(e,o.base64_variants.URLSAFE_NO_PADDING)}(e)}base64Decode(e){return function(e){return(0,o.to_string)((0,o.from_base64)(e,f))}(e)}async pbkdf2(e,t,n,r){const i=y(e),o=await this.webCryptoImportKey(i,C.Pbkdf2,[E.DeriveBits]);return o?this.webCryptoDeriveBits(o,t,n,r):(console.error("Key is null, unable to continue"),null)}generateRandomKey(e){const t=e/8;return v(g().crypto.getRandomValues(new Uint8Array(t)))}async aes256CbcEncrypt(e,t,n){const r=A(n),i=A(t),o={name:C.AesCbc,iv:i},s=await this.webCryptoImportKey(r,o.name,[E.Encrypt]),a=y(e);return w(await crypto.subtle.encrypt(o,s,a))}async aes256CbcDecrypt(e,t,n){const r=A(n),i=A(t),s={name:C.AesCbc,iv:i},a=await this.webCryptoImportKey(r,s.name,[E.Decrypt]),l=b(e);try{return c=await crypto.subtle.decrypt(s,a,l),(0,o.to_string)(c)}catch{return null}var c}async hmac256(e,t){const n=A(t),r=await this.webCryptoImportKey(n,C.Hmac,[E.Sign],{name:C.Sha256}),i=y(e),o={name:C.Hmac};try{return v(await crypto.subtle.sign(o,r,i))}catch(e){return console.error("Error computing HMAC:",e),null}}async sha256(e){const t=y(e);return v(await crypto.subtle.digest(C.Sha256,t))}async hmac1(e,t){const n=A(t),r=await this.webCryptoImportKey(n,C.Hmac,[E.Sign],{name:C.Sha1}),i=y(e),o={name:C.Hmac};try{return v(await crypto.subtle.sign(o,r,i))}catch(e){return console.error("Error computing HMAC:",e),null}}async unsafeSha1(e){const t=y(e);return v(await crypto.subtle.digest(C.Sha1,t))}async webCryptoImportKey(e,t,n,r){return m().importKey("raw",e,{name:t,hash:r},!1,n)}async webCryptoDeriveBits(e,t,n,r){const i={name:C.Pbkdf2,salt:y(t),iterations:n,hash:{name:C.Sha512}};return m().deriveBits(i,e,r).then((e=>v(new Uint8Array(e))))}argon2(e,t,n,r,i){return o.crypto_pwhash(i,y(e),A(t),n,r,o.crypto_pwhash_ALG_DEFAULT,"hex")}xchacha20Encrypt(e,t,n,r){if(48!==t.length)throw Error("Nonce must be 24 bytes");return w(o.crypto_aead_xchacha20poly1305_ietf_encrypt(e,r||null,null,A(t),A(n)))}xchacha20Decrypt(e,t,n,r){if(48!==t.length)throw Error("Nonce must be 24 bytes");try{return o.crypto_aead_xchacha20poly1305_ietf_decrypt(null,b(e),r||null,A(t),A(n),"text")}catch{return null}}xchacha20StreamInitEncryptor(e){const t=o.crypto_secretstream_xchacha20poly1305_init_push(A(e));return{state:t.state,header:w(t.header)}}xchacha20StreamEncryptorPush(e,t,n,r=i.SodiumTag.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PUSH){return o.crypto_secretstream_xchacha20poly1305_push(e.state,t,n&&n.length>0?y(n):null,r)}xchacha20StreamInitDecryptor(e,t){const n=b(e);if(n.length!==i.SodiumConstant.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES)throw new Error(`Header must be ${i.SodiumConstant.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES} bytes long`);return{state:o.crypto_secretstream_xchacha20poly1305_init_pull(n,A(t))}}xchacha20StreamDecryptorPush(e,t,n){if(t.length<i.SodiumConstant.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES)throw new Error("Invalid ciphertext size");const r=o.crypto_secretstream_xchacha20poly1305_pull(e.state,t,n&&n.length>0?y(n):null);return!1!==r&&r}sodiumCryptoBoxEasyEncrypt(e,t,n,r){return w(o.crypto_box_easy(e,A(t),A(n),A(r)))}sodiumCryptoBoxEasyDecrypt(e,t,n,r){return o.crypto_box_open_easy(b(e),A(t),A(n),A(r),"text")}sodiumCryptoBoxSeedKeypair(e){const t=o.crypto_box_seed_keypair(A(e));return{publicKey:v(t.publicKey),privateKey:v(t.privateKey)}}sodiumCryptoSignSeedKeypair(e){const t=o.crypto_sign_seed_keypair(A(e));return{publicKey:v(t.publicKey),privateKey:v(t.privateKey)}}sodiumCryptoSign(e,t){return w(o.crypto_sign_detached(e,A(t)))}sodiumCryptoSignVerify(e,t,n){return o.crypto_sign_verify_detached(b(t),e,A(n))}sodiumCryptoKdfDeriveFromKey(e,t,n,r){if(8!==r.length)throw new Error("Context must be 8 bytes");return v(o.crypto_kdf_derive_from_key(n,t,r,A(e)))}sodiumCryptoGenericHash(e,t){return v(o.crypto_generichash(o.crypto_generichash_BYTES,e,t?A(t):null))}async generateOtpSecret(){const e=function(e){const t=e.byteLength,n=new Uint8Array(e);let r=0,i=0,o="";for(let e=0;e<t;e++)for(i=i<<8|n[e],r+=8;r>=5;)o+=S[i>>>r-5&31],r-=5;for(r>0&&(o+=S[i<<5-r&31]);o.length%8>0;)o+="=";return o}(g().crypto.getRandomValues(new Uint8Array(20)));return e}async hotpToken(e,t,n=6){const r=new Uint8Array(function(e){const t=e.toUpperCase().replace(/=+$/,"");for(let e=0;e<t.length;e++)if(!S.includes(t[e]))throw new Error(`Invalid RFC4648 char ${t[e]} at index ${e}`);const n=new Uint8Array(5*t.length/8|0);let r=0,i=0,o=0;for(let e=0;e<t.length;e++)o=o<<5|S.indexOf(t[e]),i+=5,i>=8&&(n[r++]=o>>>i-8&255,i-=8);return n.buffer}(e)),i=await this.webCryptoImportKey(r,C.Hmac,[E.Sign],{name:C.Sha1}),o=function(e){const t=new ArrayBuffer(8),n=new DataView(t),r=("0".repeat(64)+e.toString(2)).slice(-64);for(let e=0;e<64;e+=8){const t=parseInt(r.slice(e,e+8),2);n.setUint8(e/8,t)}return t}(t),s=function(e){const t=new Uint8Array(e),n=15&t[19],r=((127&t[n])<<24|t[n+1]<<16|t[n+2]<<8|t[n+3]).toString(2);return parseInt(r,2)}(await m().sign("HMAC",i,o));return("0".repeat(n)+s%10**n).slice(-n)}async totpToken(e,t,n=6,r=30){const i=Math.floor(t/r/1e3);return await this.hotpToken(e,i,n)}};var _=s(80075);function x(e){const t=new Uint8Array(e);let n="";for(const e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function P(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=(4-t.length%4)%4,r=t.padEnd(t.length+n,"="),i=atob(r),o=new ArrayBuffer(i.length),s=new Uint8Array(o);for(let e=0;e<i.length;e++)s[e]=i.charCodeAt(e);return o}function k(){return void 0!==window?.PublicKeyCredential&&"function"==typeof window.PublicKeyCredential}function B(e){const{id:t}=e;return{...e,id:P(t),transports:e.transports}}function O(e){return"localhost"===e||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}class N extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),this.name=r??n.name,this.code=t}}const D=new class{createNewAbortSignal(){if(this.controller){const e=new Error("Cancelling existing WebAuthn API call for new one");e.name="AbortError",this.controller.abort(e)}const e=new AbortController;return this.controller=e,e.signal}},j=["cross-platform","platform"];function T(e){if(e&&!(j.indexOf(e)<0))return e}async function M(e){if(!k())throw new Error("WebAuthn is not supported in this browser");var t;const n={publicKey:{...e,challenge:P(e.challenge),user:{...e.user,id:(t=e.user.id,(new TextEncoder).encode(t))},excludeCredentials:e.excludeCredentials?.map(B)}};let r;n.signal=D.createNewAbortSignal();try{r=await navigator.credentials.create(n)}catch(e){throw function({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new N({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if("ConstraintError"===e.name){if(!0===n.authenticatorSelection?.requireResidentKey)return new N({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if("required"===n.authenticatorSelection?.userVerification)return new N({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if("InvalidStateError"===e.name)return new N({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if("NotAllowedError"===e.name)return new N({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if("NotSupportedError"===e.name)return 0===n.pubKeyCredParams.filter((e=>"public-key"===e.type)).length?new N({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new N({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if("SecurityError"===e.name){const t=window.location.hostname;if(!O(t))return new N({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(n.rp.id!==t)return new N({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if("TypeError"===e.name){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new N({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if("UnknownError"===e.name)return new N({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return e}({error:e,options:n})}if(!r)throw new Error("Registration was not completed");const{id:i,rawId:o,response:s,type:a}=r;let l,c,u,d;if("function"==typeof s.getTransports&&(l=s.getTransports()),"function"==typeof s.getPublicKeyAlgorithm&&(c=s.getPublicKeyAlgorithm()),"function"==typeof s.getPublicKey){const e=s.getPublicKey();null!==e&&(u=x(e))}return"function"==typeof s.getAuthenticatorData&&(d=x(s.getAuthenticatorData())),{id:i,rawId:x(o),response:{attestationObject:x(s.attestationObject),clientDataJSON:x(s.clientDataJSON),transports:l,publicKeyAlgorithm:c,publicKey:u,authenticatorData:d},type:a,clientExtensionResults:r.getClientExtensionResults(),authenticatorAttachment:T(r.authenticatorAttachment)}}async function F(e,t=!1){if(!k())throw new Error("WebAuthn is not supported in this browser");let n;0!==e.allowCredentials?.length&&(n=e.allowCredentials?.map(B));const r={...e,challenge:P(e.challenge),allowCredentials:n},i={};if(t){if(!await function(){const e=window.PublicKeyCredential;return void 0===e.isConditionalMediationAvailable?new Promise((e=>e(!1))):e.isConditionalMediationAvailable()}())throw Error("Browser does not support WebAuthn autofill");if(document.querySelectorAll("input[autocomplete*='webauthn']").length<1)throw Error('No <input> with `"webauthn"` in its `autocomplete` attribute was detected');i.mediation="conditional",r.allowCredentials=[]}let o;i.publicKey=r,i.signal=D.createNewAbortSignal();try{o=await navigator.credentials.get(i)}catch(e){throw function({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new N({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if("NotAllowedError"===e.name)return new N({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if("SecurityError"===e.name){const t=window.location.hostname;if(!O(t))return new N({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(n.rpId!==t)return new N({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if("UnknownError"===e.name)return new N({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return e}({error:e,options:i})}if(!o)throw new Error("Authentication was not completed");const{id:s,rawId:a,response:l,type:c}=o;let u;var d;return l.userHandle&&(d=l.userHandle,u=new TextDecoder("utf-8").decode(d)),{id:s,rawId:x(a),response:{authenticatorData:x(l.authenticatorData),clientDataJSON:x(l.clientDataJSON),signature:x(l.signature),userHandle:u},type:c,clientExtensionResults:o.getClientExtensionResults(),authenticatorAttachment:T(o.authenticatorAttachment)}}var R,L=s(84075),Q=s(87901);!function(e){e[e.DailyNotes=0]="DailyNotes",e[e.NoteView=1]="NoteView",e[e.ItemsList=2]="ItemsList",e[e.NavigationList=3]="NavigationList",e[e.Viewport=4]="Viewport",e[e.Selection=5]="Selection",e[e.BlockEditor=6]="BlockEditor",e[e.Purchasing=7]="Purchasing",e[e.Panes=8]="Panes",e[e.U2F=9]="U2F"}(R||(R={}));const U={[R.DailyNotes]:!1,[R.NoteView]:!1,[R.ItemsList]:!1,[R.NavigationList]:!1,[R.Viewport]:!1,[R.Selection]:!1,[R.BlockEditor]:!1,[R.Purchasing]:!1,[R.Panes]:!1,[R.U2F]:!1};function V(e){if(t.r8&&U[e]){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(0,Q.log)(R[e],...r)}}const K=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r="".concat(e).concat(t);V(R.Viewport,"setCustomViewportHeight: ".concat(r)),document.documentElement.style.setProperty("--ios-viewport-height",r),document.body.style.height="var(--ios-viewport-height)",n&&window.dispatchEvent(new Event("resize"))};class H{constructor(e){this.onEvent=e,this.onVisibilityChange=()=>{const e="visible"===document.visibilityState?r.WebAppEvent.WindowDidFocus:r.WebAppEvent.WindowDidBlur;this.notifyEvent(e)},this.onFocusEvent=()=>{this.notifyEvent(r.WebAppEvent.WindowDidFocus)},this.onBlurEvent=()=>{this.notifyEvent(r.WebAppEvent.WindowDidBlur)},document.addEventListener("visibilitychange",this.onVisibilityChange),window.addEventListener("focus",this.onFocusEvent,!1),window.addEventListener("blur",this.onBlurEvent,!1)}notifyEvent(e){this.raceTimeout&&clearTimeout(this.raceTimeout),this.raceTimeout=setTimeout((()=>{this.onEvent(e)}),250)}deinit(){document.removeEventListener("visibilitychange",this.onVisibilityChange),window.removeEventListener("focus",this.onFocusEvent),window.removeEventListener("blur",this.onBlurEvent),this.onEvent=void 0}}class G{constructor(e){this.application=e,r.InternalFeatureService.get().enableFeature(r.InternalFeature.Vaults)}async purchaseMockSubscription(){var e;const t=null===(e=this.application.sessions.getUser())||void 0===e?void 0:e.email,n=await fetch("http://localhost:3124/events",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({eventType:"SUBSCRIPTION_PURCHASED",eventPayload:{userEmail:t,subscriptionId:2002,subscriptionName:"PRO_PLAN",subscriptionExpiresAt:1e3*((new Date).getTime()+36e5),timestamp:Date.now(),offline:!1,discountCode:null,limitedDiscountPurchased:!1,newSubscriber:!0,totalActiveSubscriptionsCount:1,userRegisteredAt:1,billingFrequency:12,payAmount:59}})});n.ok||console.error("Failed to publish mocked event: ".concat(n.status," ").concat(n.statusText))}}var Y=s(54569);const z={AndroidBackHandler:Symbol.for("AndroidBackHandler"),ArchiveManager:Symbol.for("ArchiveManager"),AutolockService:Symbol.for("AutolockService"),ChangelogService:Symbol.for("ChangelogService"),DesktopManager:Symbol.for("DesktopManager"),SuperConverter:Symbol.for("SuperConverter"),Importer:Symbol.for("Importer"),ItemGroupController:Symbol.for("ItemGroupController"),KeyboardService:Symbol.for("KeyboardService"),MobileWebReceiver:Symbol.for("MobileWebReceiver"),MomentsService:Symbol.for("MomentsService"),PersistenceService:Symbol.for("PersistenceService"),RouteService:Symbol.for("RouteService"),ThemeManager:Symbol.for("ThemeManager"),VaultDisplayService:Symbol.for("VaultDisplayService"),PluginsService:Symbol.for("PluginsService"),AccountMenuController:Symbol.for("AccountMenuController"),ActionsMenuController:Symbol.for("ActionsMenuController"),ApplicationEventObserver:Symbol.for("ApplicationEventObserver"),FeaturesController:Symbol.for("FeaturesController"),FilePreviewModalController:Symbol.for("FilePreviewModalController"),FilesController:Symbol.for("FilesController"),HistoryModalController:Symbol.for("HistoryModalController"),ImportModalController:Symbol.for("ImportModalController"),ItemListController:Symbol.for("ItemListController"),LinkingController:Symbol.for("LinkingController"),NavigationController:Symbol.for("NavigationController"),NoAccountWarningController:Symbol.for("NoAccountWarningController"),NotesController:Symbol.for("NotesController"),PaneController:Symbol.for("PaneController"),PreferencesController:Symbol.for("PreferencesController"),PurchaseFlowController:Symbol.for("PurchaseFlowController"),QuickSettingsController:Symbol.for("QuickSettingsController"),SearchOptionsController:Symbol.for("SearchOptionsController"),SubscriptionController:Symbol.for("SubscriptionController"),SyncStatusController:Symbol.for("SyncStatusController"),ToastService:Symbol.for("ToastService"),VaultSelectionMenuController:Symbol.for("VaultSelectionMenuController"),GetItemTags:Symbol.for("GetItemTags"),GetPurchaseFlowUrl:Symbol.for("GetPurchaseFlowUrl"),IsGlobalSpellcheckEnabled:Symbol.for("IsGlobalSpellcheckEnabled"),IsMobileDevice:Symbol.for("IsMobileDevice"),IsNativeIOS:Symbol.for("IsNativeIOS"),IsNativeMobileWeb:Symbol.for("IsNativeMobileWeb"),IsTabletOrMobileScreen:Symbol.for("IsTabletOrMobileScreen"),LoadPurchaseFlowUrl:Symbol.for("LoadPurchaseFlowUrl"),OpenSubscriptionDashboard:Symbol.for("OpenSubscriptionDashboard"),PanesForLayout:Symbol.for("PanesForLayout"),GetHost:Symbol.for("GetHost"),IsApplicationUsingThirdPartyHost:Symbol.for("IsApplicationUsingThirdPartyHost")};var Z=s(67743),W=s(31031),q=s(34521),J=s(41421),X=s(68608),$=s(94900),ee=s(59786),te=s(78113),ne=s(74205),re=s(36153),ie=s(22311),oe=s(9591),se=s(29016);const ae="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,le=ae&&"documentMode"in document?document.documentMode:null,ce=(ae&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ae&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),!(!ae||!("InputEvent"in window)||le)&&new window.InputEvent("input"),ae&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)),ue=ae&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,de=ae&&/^(?=.*Chrome).*/i.test(navigator.userAgent),he=ae&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!de;var pe=s(37146);function fe(e){const t=function(e,t){const n={};for(const t of e){const e=t.type;n[e]?n[e].push(t):n[e]=[t]}return n}(e);return{element:t.element||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}const ge=[...pe.VH,...pe.Pr,...pe.lL],me=/[!-/:-@[-`{-~\s]/,ye=/^\s{0,3}$/,ve=/^```(\w{1,10})?\s?$/;function Ae(e){if(!(0,W.Rl)(e))return!1;const t=e.getFirstChild();return null==t||1===e.getChildrenSize()&&(0,W.Gg)(t)&&ye.test(t.getTextContent())}function be(e,t,n,r,i){const o=e.trim(),s=(0,W.MX)(o),a=(0,W.BE)();a.append(s),t.append(a);for(const{regExp:t,replace:r}of n){const n=e.match(t);if(n){s.setTextContent(e.slice(n[0].length)),r(a,[s],n,!0);break}}if(Se(s,r,i),a.isAttached()&&o.length>0){const e=a.getPreviousSibling();if((0,W.Rl)(e)||(0,oe.O)(e)||(0,ie.I3)(e)){let t=e;if((0,ie.I3)(e)){const n=e.getLastDescendant();t=null==n?null:(0,se.$s)(n,ie.QG)}null!=t&&t.getTextContentSize()>0&&(t.splice(t.getChildrenSize(),0,[(0,W.T)(),...a.getChildren()]),a.remove())}}}function we(e,t,n){const r=e[t].match(ve);if(r){let i=t;const o=e.length;for(;++i<o;)if(e[i].match(ve)){const o=(0,re.Ol)(r[1]),s=(0,W.MX)(e.slice(t+1,i).join("\n"));return o.append(s),n.append(o),[o,i]}}return[null,t]}function Se(e,t,n){const r=e.getTextContent(),i=function(e,t){const n=e.match(t.openTagsRegExp);if(null==n)return null;for(const r of n){const n=r.replace(/^\s/,""),i=t.fullMatchRegExpByTag[n];if(null==i)continue;const o=e.match(i),s=t.transformersByTag[n];if(null!=o&&null!=s){if(!1!==s.intraword)return o;const{index:t=0}=o,n=e[t-1],r=e[t+o[0].length];if((!n||me.test(n))&&(!r||me.test(r)))return o}}return null}(r,t);if(!i)return void Ce(e,n);let o,s,a;if(i[0]===r)o=e;else{const t=i.index||0,n=t+i[0].length;0===t?[o,s]=e.splitText(n):[a,o,s]=e.splitText(t,n)}o.setTextContent(i[2]);const l=t.transformersByTag[i[1]];if(l)for(const e of l.format)o.hasFormat(e)||o.toggleFormat(e);o.hasFormat("code")||Se(o,t,n),a&&Se(a,t,n),s&&Se(s,t,n)}function Ce(e,t){let n=e;e:for(;n;){for(const e of t){const r=n.getTextContent().match(e.importRegExp);if(!r)continue;const i=r.index||0,o=i+r[0].length;let s,a;0===i?[s,n]=n.splitText(o):[,s,a]=n.splitText(i,o),a&&Ce(a,t),e.replace(s,r);continue e}break}}function Ee(e){let t=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return function(e){const t=fe(e),n=function(e){const t={},n={},r=[];for(const i of e){const{tag:e}=i;t[e]=i;const o=e.replace(/(\*|\^|\+)/g,"\\$1");r.push(o),n[e]=ce||ue||he?new RegExp("(".concat(o,")(?![").concat(o,"\\s])(.*?[^").concat(o,"\\s])").concat(o,"(?!").concat(o,")")):new RegExp("(?<![\\\\".concat(o,"])(").concat(o,")((\\\\").concat(o,")?.*?[^").concat(o,"\\s](\\\\").concat(o,")?)((?<!\\\\)|(?<=\\\\\\\\))(").concat(o,")(?![\\\\").concat(o,"])"))}return{fullMatchRegExpByTag:n,openTagsRegExp:new RegExp((ce||ue||he?"":"".concat("(?<![\\\\])"))+"("+r.join("|")+")","g"),transformersByTag:t}}(t.textFormat);return function(e,r){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=e.split("\n"),s=o.length,a=r||(0,W.Gv)();a.clear();for(let e=0;e<s;e++){const r=o[e],[i,s]=we(o,e,a);null==i?be(r,a,t.element,n,t.textMatch):e=s}if(!i){const e=a.getChildren();for(const t of e)Ae(t)&&t.remove()}null!==(0,W.dL)()&&a.selectEnd()}}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:ge)(e,t,n)}function Ie(e,t,n,r){for(const i of t){const o=i.export(e,(e=>_e(e,t,n,r)));if(null!=o)return o}return(0,W.F7)(e)?_e(e,t,n,r):(0,W.k$)(e)?e.getTextContent():null}function _e(e,t,n,r){const i=[],o=e.getChildren();e:for(const e of o){if((0,W.F7)(e))for(const s of t){const a=s.export(e,(e=>_e(e,t,n,r)));if(null!=a){i.push(a),o.indexOf(e)!==o.length-1&&i.push("\n");continue e}}for(const o of r){const s=o.export(e,(e=>_e(e,t,n,r)),((e,t)=>xe(e,t,n)));if(null!=s){i.push(s);continue e}}(0,W.A3)(e)?i.push("\n"):(0,W.Gg)(e)?i.push(xe(e,e.getTextContent(),n)):(0,W.F7)(e)?i.push(_e(e,t,n,r),"\n"):(0,W.k$)(e)&&i.push(e.getTextContent())}return i.join("")}function xe(e,t,n){const r=t.trim();let i=r;const o=new Set;for(const t of n){const n=t.format[0],r=t.tag;ke(e,n)&&!o.has(n)&&(o.add(n),ke(Pe(e,!0),n)||(i=r+i),ke(Pe(e,!1),n)||(i+=r))}return t.replace(r,i)}function Pe(e,t){let n=t?e.getPreviousSibling():e.getNextSibling();if(!n){const r=e.getParentOrThrow();r.isInline()&&(n=t?r.getPreviousSibling():r.getNextSibling())}for(;n;){if((0,W.F7)(n)){if(!n.isInline())break;const e=t?n.getLastDescendant():n.getFirstDescendant();if((0,W.Gg)(e))return e;n=t?n.getPreviousSibling():n.getNextSibling()}if((0,W.Gg)(n))return n;if(!(0,W.F7)(n))return null}return null}function ke(e,t){return(0,W.Gg)(e)&&e.hasFormat(t)}class Be{constructor(){this.convertOtherFormatToSuperString=(e,t,n)=>{if(0===e.length)return e;if("json"===t&&this.isValidSuperString(e))return e;this.importEditor.update((()=>{(0,W.Gv)().clear()}),{discrete:!0});let r=!1;if("html"===t){const t=(null==n?void 0:n.html)||{addLineBreaks:!0};this.importEditor.update((()=>{try{const n=(new DOMParser).parseFromString(e,"text/html"),r=(0,$.s)(this.importEditor,n),i=[];r.forEach((e=>{const n=e.getType();if("text"===n||"link"===n||"linebreak"===n||"unencrypted-image"===n||"inline-file"===n||"snfile"===n){const t=(0,W.BE)();return t.append(e),void i.push(t)}i.push(e),t.addLineBreaks&&i.push((0,W.BE)())})),(0,W.Gv)().selectEnd(),(0,W.od)(i.concat((0,W.BE)()))}catch(e){console.error(e),r=!0}}),{discrete:!0})}else this.importEditor.update((()=>{try{Ee(e,X.c,void 0,!0)}catch(e){console.error(e),r=!0}}),{discrete:!0});if(r)throw new Error("Could not import note. Check error console for details.");return JSON.stringify(this.importEditor.getEditorState())},this.importEditor=(0,Z.D)({namespace:"BlocksEditor",theme:q.Z,editable:!1,onError:e=>console.error(e),nodes:J.G}),this.exportEditor=(0,Z.D)({namespace:"BlocksEditor",theme:q.Z,editable:!1,onError:e=>console.error(e),nodes:J.a})}isValidSuperString(e){try{return this.importEditor.parseEditorState(e),!0}catch(e){return!1}}async convertSuperStringToOtherFormat(e,t,n){if(0===e.length)return e;const{embedBehavior:r,getFileItem:i,getFileBase64:o}=null!=n?n:{embedBehavior:"reference"};if("separate"===r&&!i)throw new Error('getFileItem must be provided when embedBehavior is "separate"');if("inline"===r&&!i&&!o)throw new Error('getFileItem and getFileBase64 must be provided when embedBehavior is "inline"');let a;if(this.exportEditor.setEditorState(this.exportEditor.parseEditorState(e)),await new Promise((e=>{this.exportEditor.update((()=>{if("reference"===r)return void e();if(!i)return void e();const n=(0,W.K8)(ee.h),s={};Promise.all(n.map((async e=>{const n=i(e.getId());if(!n)return;const a="pdf"!==t||n.mimeType.startsWith("image/");if("inline"===r&&o&&a){const t=await o(e.getId());if(!t)return;this.exportEditor.update((()=>{const r=(0,ne.v9)(t,n.mimeType,n.name);e.replace(r)}),{discrete:!0})}else this.exportEditor.update((()=>{s[n.name]=null==s[n.name]?0:s[n.name]+1;let t=n.name;if(s[t]>0){const{name:e,ext:r}=(0,Q.parseFileName)(t);t="".concat(e,"-").concat(n.uuid,".").concat(r)}const r=(0,te.A)(t,n.mimeType);e.replace(r)}),{discrete:!0})}))).then((()=>e())).catch(console.error)}),{discrete:!0})})),await new Promise((r=>{this.exportEditor.update((()=>{switch(t){case"txt":case"md":{const e=(0,W.K8)(W.CK);for(const t of e)t.isEmpty()&&t.remove();a=function(){let e=arguments.length>1?arguments[1]:void 0;const t=function(e){const t=fe(e),n=t.textFormat.filter((e=>1===e.format.length));return e=>{const r=[],i=(e||(0,W.Gv)()).getChildren();for(const e of i){const i=Ie(e,t.element,n,t.textMatch);null!=i&&r.push(i)}return r.join("\n\n")}}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:ge);return t(e)}(X.c),r();break}case"html":a=(0,$.S)(this.exportEditor),r();break;case"pdf":Promise.all([s.e(283),s.e(298),s.e(405)]).then(s.bind(s,63962)).then((e=>{let{$generatePDFFromNodes:t}=e;var i;t(this.exportEditor,(null===(i=null==n?void 0:n.pdf)||void 0===i?void 0:i.pageSize)||"A4").then((e=>{a=e,r()}))}));break;default:a=e,r()}}),{discrete:!0})})),"string"!=typeof a)throw new Error("Could not export note");return a}getEmbeddedFileIDsFromSuperString(e){if(0===e.length)return[];this.exportEditor.setEditorState(this.exportEditor.parseEditorState(e));const t=[];return this.exportEditor.getEditorState().read((()=>{(0,W.K8)(ee.h).forEach((e=>{const n=e.getId();t.includes(n)||t.push(n)}))})),t}}class Oe extends r.ApplicationService{constructor(e,t,n){super(e,new r.InternalEventBus),this.device=t,this.backups=n,this.updateObservers=[],this.dataLoaded=!1,this.needsInitialTextBackup=!1;const i=new Be;n.setSuperConverter(i)}async handleWatchedDirectoriesChanges(e){this.backups.importWatchedDirectoryChanges(e)}async handleHomeServerStarted(e){}beginTextBackupsTimer(){this.textBackupsInterval&&clearInterval(this.textBackupsInterval),this.needsInitialTextBackup=!0,this.textBackupsInterval=setInterval(this.saveDesktopBackup,432e5)}get webApplication(){return this.application}deinit(){this.updateObservers.length=0,super.deinit()}async onAppEvent(e){super.onAppEvent(e).catch(console.error),e===r.ApplicationEvent.LocalDataLoaded?(this.dataLoaded=!0,this.backups.isTextBackupsEnabled()&&this.beginTextBackupsTimer()):e===r.ApplicationEvent.MajorDataChange&&this.saveDesktopBackup()}async saveDesktopBackup(){var e;this.webApplication.notifyWebEvent(r.WebAppEvent.BeganBackupDownload);const t=await this.getBackupFile();t&&(await(null===(e=this.webApplication.fileBackups)||void 0===e?void 0:e.saveTextBackupData(t)),this.webApplication.notifyWebEvent(r.WebAppEvent.EndedBackupDownload,{success:!0}))}async getBackupFile(){const e=this.application.hasProtectionSources()?await this.application.createEncryptedBackupFile.execute({skipAuthorization:!0}):await this.application.createDecryptedBackupFile.execute();if(!e.isFailed())return JSON.stringify(e.getValue(),null,2)}getExtServerHost(){return(0,r.assert)(this.device.extensionsServerHost),this.device.extensionsServerHost}convertComponentForTransmission(e){return e.payloadRepresentation().ejected()}syncComponentsInstallation(e){Promise.all(e.map((e=>this.convertComponentForTransmission(e)))).then((e=>{this.device.syncComponents(e)})).catch(console.error)}registerUpdateObserver(e){const t={callback:e};return this.updateObservers.push(t),()=>{(0,r.removeFromArray)(this.updateObservers,t)}}searchText(e){this.lastSearchedText=e,this.device.onSearch(e)}redoSearch(){this.lastSearchedText&&this.searchText(this.lastSearchedText)}updateAvailable(){this.webApplication.notifyWebEvent(r.WebAppEvent.NewUpdateAvailable)}windowGainedFocus(){this.webApplication.notifyWebEvent(r.WebAppEvent.WindowDidFocus)}windowLostFocus(){this.webApplication.notifyWebEvent(r.WebAppEvent.WindowDidBlur),this.needsInitialTextBackup&&(this.needsInitialTextBackup=!1,this.saveDesktopBackup())}consoleLog(e){console.log(e)}async onComponentInstallationComplete(e){const t=this.application.items.findItem(e.uuid);if(!t)return;const n=(await this.application.changeAndSaveItem.execute(t,(t=>{const n=t;n.local_url=e.content.local_url,n.package_info=e.content.package_info,n.setAppDataItem(r.AppDataField.ComponentInstallError,void 0)}),void 0,r.PayloadEmitSource.DesktopComponentSync)).getValue();for(const e of this.updateObservers)e.callback(n)}}var Ne=s(32105),De=s(23995),je=s(93632);class Te{constructor(){}static async isSupported(){return!!navigator.mediaDevices&&(await navigator.mediaDevices.enumerateDevices()).some((e=>"videoinput"===e.kind))}async setDevice(e){var t;this.selectedDevice=null!==(t=this.devices.find((t=>t.deviceId===e)))&&void 0!==t?t:this.devices[0],this.stream=await navigator.mediaDevices.getUserMedia({video:{deviceId:this.selectedDevice.deviceId},audio:!1}),this.video.srcObject=this.stream,await this.video.play(),await this.awaitVideoReady(this.video)}async initialize(){var e,t;if(this.devices=(await navigator.mediaDevices.enumerateDevices()).filter((e=>"videoinput"===e.kind)),0===this.devices.length)return;this.selectedDevice=this.devices[0],this.stream=await navigator.mediaDevices.getUserMedia({video:{deviceId:this.selectedDevice.deviceId},audio:!1}),this.video=document.createElement("video"),this.video.playsInline=!0,this.video.style.position="absolute",this.video.style.display="none",this.video.oncontextmenu=e=>e.preventDefault(),this.canvas=document.createElement("canvas"),document.body.append(this.video),this.video.srcObject=this.stream,await this.video.play(),await this.awaitVideoReady(this.video);const n=this.stream.getVideoTracks()[0].getSettings();this.width=null!==(e=n.width)&&void 0!==e?e:1280,this.height=null!==(t=n.height)&&void 0!==t?t:720,this.canvas.width=this.width,this.canvas.height=this.height}async takePhoto(e){if(!this.canvas)return;const t=this.canvas.getContext("2d");null==t||t.drawImage(this.video,0,0,this.width,this.height);const n=this.canvas.toDataURL("image/png");if(n.length<1e5)return;const r=await fetch(n),i=await r.blob();return new File([i],e,{type:"image/png"})}finish(){var e,t,n;this.canvas&&this.video&&(this.video.pause(),null===(e=this.video.parentElement)||void 0===e||e.removeChild(this.video),null===(t=this.canvas.parentElement)||void 0===t||t.removeChild(this.canvas),this.video.remove(),this.canvas.remove(),null===(n=this.stream)||void 0===n||n.getTracks().forEach((e=>{e.stop()})))}async awaitVideoReady(e){return new Promise((t=>{e.addEventListener("canplaythrough",(()=>{t(null)}))}))}}const Me=t.r8&&!1;class Fe extends De.L{constructor(e,t,n,i,o,s,a,l,c){super(c),this.filesController=e,this.linkingController=t,this.storage=n,this.preferences=i,this.items=o,this.protections=s,this.desktopDevice=a,this._isMobileDevice=l,this.isEnabled=!1,this.enableMoments=()=>{this.storage.setValue(Ne.QtK.MomentsEnabled,!0),this.isEnabled=!0,this.beginTakingPhotos()},this.disableMoments=()=>{this.storage.setValue(Ne.QtK.MomentsEnabled,!1),this.isEnabled=!1,clearInterval(this.intervalReference)},this.takePhoto=async()=>{if(await this.protections.isLocked())return;const e="visible"===document.visibilityState;let t;if(e&&(t=(0,Y.fz)({type:Y.pC.Regular,message:"Capturing Moment...",pauseOnWindowBlur:!1})),this.desktopDevice&&!await this.desktopDevice.askForMediaAccess("camera"))return t&&(0,Y.Xd)(t),void(0,Y.fz)({type:Y.pC.Error,message:"Please enable Camera permissions for Standard Notes to enable Moments.",duration:3e3});const n="Moment ".concat((0,je.An)(new Date),".png"),i=new Te;await i.initialize(),this._isMobileDevice.execute().getValue()&&await(0,r.sleep)(2e3);let o=await i.takePhoto(n);if(!o&&(await(0,r.sleep)(1e3),o=await i.takePhoto(n),!o))return;t&&(0,Y.Xd)(t);const s=await this.filesController.uploadNewFile(o);if(s){e&&this.linkingController.linkItemToSelectedItem(s);const t=this.getDefaultTag();t&&this.linkingController.linkItems(s,t)}return i.finish(),s},(0,_.rC)(this,{isEnabled:_.LO,enableMoments:_.aD,disableMoments:_.aD}),c.addEventHandler(this,Ne.n9K.LocalDataLoaded),c.addEventHandler(this,Ne.Hh3.BiometricsSoftLockEngaged),c.addEventHandler(this,Ne.Hh3.BiometricsSoftLockDisengaged)}async handleEvent(e){var t;switch(e.type){case Ne.n9K.LocalDataLoaded:this.isEnabled=null!==(t=this.storage.getValue(Ne.QtK.MomentsEnabled))&&void 0!==t&&t,this.isEnabled&&this.beginTakingPhotos();break;case Ne.Hh3.BiometricsSoftLockEngaged:this.pauseMoments();break;case Ne.Hh3.BiometricsSoftLockDisengaged:this.resumeMoments()}}deinit(){super.deinit(),this.filesController=void 0}pauseMoments(){clearInterval(this.intervalReference)}resumeMoments(){this.isEnabled&&this.beginTakingPhotos()}beginTakingPhotos(){this.intervalReference&&clearInterval(this.intervalReference),this.takePhoto(),this.intervalReference=setInterval((()=>{this.takePhoto()}),Me?1e4:36e5)}getDefaultTag(){const e=this.preferences.getValue(r.PrefKey.MomentsDefaultTagUuid);if(e)return this.items.findItem(e)}}var Re=s(13500);const Le=["className"];function Qe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ue(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qe(Object(n),!0).forEach((function(t){Ve(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ve(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ke=t=>{let{className:n}=t,r=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,Le);return(0,e.jsxs)("div",{className:(0,Q.classNames)("flex",n),children:[(0,e.jsx)("input",Ue({type:"radio",className:"h-0 w-0 opacity-0"},r)),(0,e.jsx)(Re.Z,{checked:!!r.checked})]})};var He=s(2784),Ge=s(82619),Ye=s(65378),ze=s(44993);const Ze="ShouldPersistNoteState",We=t=>{let{application:n}=t;const[r,i]=(0,He.useState)(n.getValue(Ze)),o=e=>{n.setValue(Ze,e),i(e),e?n.persistence.persistCurrentState():n.persistence.clearPersistedValues()};return(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{className:"mb-2",children:"When opening the app, show..."}),(0,e.jsxs)("label",{className:"mb-2 flex items-center gap-2 text-base font-medium md:text-sm",children:[(0,e.jsx)(Ke,{name:"state-persistence",checked:!r,onChange:e=>{o(!e.target.checked)}}),"The first note in the list"]}),(0,e.jsxs)("label",{className:"flex items-center gap-2 text-base font-medium md:text-sm",children:[(0,e.jsx)(Ke,{name:"state-persistence",checked:!!r,onChange:e=>{o(e.target.checked)}}),"The last viewed note"]})]})})};var qe;!function(e){e.TagChanged="CrossControllerEvent:TagChanged",e.ActiveEditorChanged="CrossControllerEvent:ActiveEditorChanged",e.HydrateFromPersistedValues="CrossControllerEvent:HydrateFromPersistedValues",e.RequestValuePersistence="CrossControllerEvent:RequestValuePersistence",e.DisplayPremiumModal="CrossControllerEvent:DisplayPremiumModal",e.UnselectAllNotes="CrossControllerEvent:UnselectAllNotes"}(qe||(qe={}));class Je{constructor(e,t,n,i,o,s){this.itemListController=e,this.navigationController=t,this.storage=n,this.items=i,this.sync=o,this.eventBus=s,this.didHydrateOnce=!1,this.hydratePersistedValues=()=>{this.eventBus.publish({type:qe.HydrateFromPersistedValues,payload:this.persistenceEnabled?this.getPersistedValues():void 0})},s.addEventHandler(this,r.ApplicationEvent.LocalDataLoaded),s.addEventHandler(this,r.ApplicationEvent.LocalDataIncrementalLoad),s.addEventHandler(this,qe.HydrateFromPersistedValues),s.addEventHandler(this,qe.RequestValuePersistence)}async handleEvent(e){switch(e.type){case r.ApplicationEvent.LocalDataLoaded:this.didHydrateOnce||(this.hydratePersistedValues(),this.didHydrateOnce=!0);break;case r.ApplicationEvent.LocalDataIncrementalLoad:if(!(this.items.getItems([r.ContentType.TYPES.Note,r.ContentType.TYPES.Tag]).length>0))return;this.hydratePersistedValues(),this.didHydrateOnce=!0;break;case qe.HydrateFromPersistedValues:this.hydrateFromPersistedValues(e.payload);break;case qe.RequestValuePersistence:this.persistCurrentState()}}get persistenceEnabled(){var e;return null===(e=this.storage.getValue(Ze))||void 0===e||e}persistCurrentState(){const e={[L.UK.ItemListController]:this.itemListController.getPersistableValue(),[L.UK.NavigationController]:this.navigationController.getPersistableValue()};this.persistValues(e);const t=e["selected-items-controller"],n=e["navigation-controller"],r=[];t.selectedUuids.length&&r.push(...t.selectedUuids),n.selectedTagUuid&&r.push(n.selectedTagUuid),this.sync.setLaunchPriorityUuids(r)}hydrateFromPersistedValues(e){const t=null==e?void 0:e[L.UK.NavigationController];this.navigationController.hydrateFromPersistedValue(t);const n=null==e?void 0:e[L.UK.ItemListController];this.itemListController.hydrateFromPersistedValue(n)}persistValues(e){this.sync.isDatabaseLoaded()&&this.persistenceEnabled&&this.storage.setValue(L.Qt.MasterStatePersistenceKey,e)}clearPersistedValues(){this.sync.isDatabaseLoaded()&&this.storage.removeValue(L.Qt.MasterStatePersistenceKey)}getPersistedValues(){return this.storage.getValue(L.Qt.MasterStatePersistenceKey)}}class Xe{constructor(e){this.isOpen=!1,this.currentFile=void 0,this.otherFiles=[],this.eventObservers=[],this.deinit=()=>{this.eventObservers.forEach((e=>e())),this.currentFile=void 0,this.otherFiles=void 0},this.setCurrentFile=e=>{this.currentFile=e},this.activate=(e,t)=>{this.currentFile=e,t&&(this.otherFiles=t),this.isOpen=!0},this.dismiss=()=>{this.isOpen=!1},(0,_.rC)(this,{isOpen:_.LO,currentFile:_.LO,otherFiles:_.LO,activate:_.aD,dismiss:_.aD,setCurrentFile:_.aD}),this.eventObservers.push(e.streamItems(r.ContentType.TYPES.File,(e=>{let{changed:t,removed:n}=e;if(!this.currentFile)return;const r=t.find((e=>{var t;return e.uuid===(null===(t=this.currentFile)||void 0===t?void 0:t.uuid)}));if(r&&this.setCurrentFile(r),n.find((e=>{var t;return e.uuid===(null===(t=this.currentFile)||void 0===t?void 0:t.uuid)}))){if(!this.otherFiles.length)return this.dismiss(),void(this.currentFile=void 0);const e=this.otherFiles.findIndex((e=>{var t;return e.uuid===(null===(t=this.currentFile)||void 0===t?void 0:t.uuid)})),t=e+1<this.otherFiles.length?e+1:0;this.setCurrentFile(this.otherFiles[t]),this.otherFiles=this.otherFiles.filter((e=>{var t;return e.uuid!==(null===(t=this.currentFile)||void 0===t?void 0:t.uuid)}))}})))}}var $e=s(73144),et=s(3555);const tt=r.PrefDefaults[r.PrefKey.TagsPanelWidth],nt=r.PrefDefaults[r.PrefKey.NotesPanelWidth],rt="focus-mode",it="disable-focus-mode";class ot extends De.L{constructor(e,n,i,o,s){super(s),this.preferences=e,this.keyboardService=n,this._isTabletOrMobileScreen=i,this._panesForLayout=o,this.isInMobileView=(0,t.Av)(),this.disposers=[],this.panes=[],this.currentNavPanelWidth=0,this.currentItemsPanelWidth=0,this.focusModeEnabled=!1,this.listPaneExplicitelyCollapsed=!1,this.navigationPaneExplicitelyCollapsed=!1,this.mediumScreenMQHandler=e=>{e.matches?this.setIsInMobileView(!1):this.setIsInMobileView(!0)},this.setIsInMobileView=e=>{this.isInMobileView=e},this.setPaneLayout=e=>{V(R.Panes,"Set pane layout",e);const t=this._panesForLayout.execute(e).getValue();t.includes($e.n.Items)&&this.listPaneExplicitelyCollapsed&&(0,r.removeFromArray)(t,$e.n.Items),t.includes($e.n.Navigation)&&this.navigationPaneExplicitelyCollapsed&&(0,r.removeFromArray)(t,$e.n.Navigation),this.replacePanes(t)},this.replacePanes=e=>{V(R.Panes,"Replacing panes",e),this.panes=e},this.presentPane=e=>{V(R.Panes,"Presenting pane",e),e!==this.currentPane&&(e!==$e.n.Items||this.currentPane!==$e.n.Editor?this.currentPane!==e&&this.panes.push(e):this.dismissLastPane())},this.insertPaneAtIndex=(e,t)=>{V(R.Panes,"Inserting pane",e,"at index",t),this.panes.splice(t,0,e)},this.dismissLastPane=()=>(V(R.Panes,"Dismissing last pane"),this.panes.pop()),this.removePane=e=>{V(R.Panes,"Removing pane",e),(0,r.removeFromArray)(this.panes,e)},this.popToPane=e=>{V(R.Panes,"Popping to pane",e);let t=this.panes.length-1;for(;t>=0&&this.panes[t]!==e;)this.dismissLastPane(),t--},this.toggleListPane=()=>{this.panes.includes($e.n.Items)?(this.removePane($e.n.Items),this.listPaneExplicitelyCollapsed=!0):(this.panes.includes($e.n.Navigation)?this.insertPaneAtIndex($e.n.Items,1):this.insertPaneAtIndex($e.n.Items,0),this.listPaneExplicitelyCollapsed=!1)},this.toggleNavigationPane=()=>{this.panes.includes($e.n.Navigation)?(this.removePane($e.n.Navigation),this.navigationPaneExplicitelyCollapsed=!0):(this.insertPaneAtIndex($e.n.Navigation,0),this.navigationPaneExplicitelyCollapsed=!1)},this.setFocusModeEnabled=e=>{this.focusModeEnabled=e,e?document.body.classList.add(rt):document.body.classList.contains(rt)&&(document.body.classList.add(it),document.body.classList.remove(rt),setTimeout((()=>{document.body.classList.remove(it)}),1255))},(0,_.rC)(this,{panes:_.LO,isInMobileView:_.LO,currentNavPanelWidth:_.LO,currentItemsPanelWidth:_.LO,focusModeEnabled:_.LO,currentPane:_.Fl,previousPane:_.Fl,isListPaneCollapsed:_.Fl,isNavigationPaneCollapsed:_.Fl,setIsInMobileView:_.aD,toggleListPane:_.aD,toggleNavigationPane:_.aD,setCurrentItemsPanelWidth:_.aD,setCurrentNavPanelWidth:_.aD,presentPane:_.aD,dismissLastPane:_.aD,replacePanes:_.aD,popToPane:_.aD,removePane:_.aD,insertPaneAtIndex:_.aD,setPaneLayout:_.aD,setFocusModeEnabled:_.aD}),this.setCurrentNavPanelWidth(e.getValue(r.PrefKey.TagsPanelWidth,tt)),this.setCurrentItemsPanelWidth(e.getValue(r.PrefKey.NotesPanelWidth,nt));const a=this._isTabletOrMobileScreen.execute().getValue();this.panes=a.isTabletOrMobile?[$e.n.Navigation,$e.n.Items]:[$e.n.Navigation,$e.n.Items,$e.n.Editor];const l=window.matchMedia(et.Yd.md);null!=(null==l?void 0:l.addEventListener)?l.addEventListener("change",this.mediumScreenMQHandler):l.addListener(this.mediumScreenMQHandler),s.addEventHandler(this,r.ApplicationEvent.PreferencesChanged),this.disposers.push(n.addCommandHandler({command:L.yX,category:"General",description:"Toggle focus mode",onKeyDown:e=>(e.preventDefault(),this.setFocusModeEnabled(!this.focusModeEnabled),!0)}),n.addCommandHandler({command:L.p7,category:"General",description:"Toggle notes panel",onKeyDown:e=>{e.preventDefault(),this.toggleListPane()}}),n.addCommandHandler({command:L.Jr,category:"General",description:"Toggle tags panel",onKeyDown:e=>{e.preventDefault(),this.toggleNavigationPane()}}))}async handleEvent(e){e.type===r.ApplicationEvent.PreferencesChanged&&(this.setCurrentNavPanelWidth(this.preferences.getValue(r.PrefKey.TagsPanelWidth,tt)),this.setCurrentItemsPanelWidth(this.preferences.getValue(r.PrefKey.NotesPanelWidth,nt)))}setCurrentNavPanelWidth(e){this.currentNavPanelWidth=e}setCurrentItemsPanelWidth(e){this.currentItemsPanelWidth=e}deinit(){super.deinit();const e=window.matchMedia(et.Yd.md);null!=(null==e?void 0:e.removeEventListener)?e.removeEventListener("change",this.mediumScreenMQHandler):e.removeListener(this.mediumScreenMQHandler)}get currentPane(){return this.panes[this.panes.length-1]||this.panes[0]}get previousPane(){return this.panes[this.panes.length-2]||this.panes[0]}get isListPaneCollapsed(){return!this.panes.includes($e.n.Items)}get isNavigationPaneCollapsed(){return!this.panes.includes($e.n.Navigation)}}const st="account";class at extends De.L{constructor(e,t){super(t),this.routeService=e,this._open=!1,this.currentPane=st,this.setCurrentPane=e=>{this.currentPane=e},this.openPreferences=e=>{e&&(this.currentPane=e),this._open=!0},this.closePreferences=()=>{this._open=!1,this.currentPane=st,this.routeService.removeQueryParameterFromURL(L.YX.Settings)},(0,_.rC)(this,{_open:_.LO,currentPane:_.LO,openPreferences:_.aD,closePreferences:_.aD,setCurrentPane:_.aD,isOpen:_.Fl})}get isOpen(){return this._open}}var lt,ct;function ut(){return r.InternalFeatureService.get().isFeatureEnabled(r.InternalFeature.Vaults)}!function(e){e[e.UpgradePrompt=0]="UpgradePrompt",e[e.UpgradeSuccess=1]="UpgradeSuccess",e[e.SuperDemo=2]="SuperDemo"}(lt||(lt={})),ct||(ct={});class dt extends De.L{deinit(){super.deinit(),this.showPremiumAlert=void 0,this.closePremiumAlert=void 0,this.hasFolders=void 0,this.hasSmartViews=void 0,this.entitledToFiles=void 0,this.premiumAlertFeatureName=void 0,this.premiumAlertType=void 0,(0,t.h6)(this)}constructor(e,t){super(t),this.features=e,this.premiumAlertType=void 0,this.showPurchaseSuccessAlert=()=>{this.premiumAlertType=lt.UpgradeSuccess},this.showSuperDemoModal=()=>{this.premiumAlertType=lt.SuperDemo},this.hasFolders=this.isEntitledToFolders(),this.hasSmartViews=this.isEntitledToSmartViews(),this.entitledToFiles=this.isEntitledToFiles(),this.premiumAlertFeatureName=void 0,(0,_.rC)(this,{hasFolders:_.LO,hasSmartViews:_.LO,entitledToFiles:_.LO,premiumAlertType:_.LO,premiumAlertFeatureName:_.LO,showPremiumAlert:_.aD,closePremiumAlert:_.aD,showPurchaseSuccessAlert:_.aD}),t.addEventHandler(this,qe.DisplayPremiumModal),t.addEventHandler(this,r.ApplicationEvent.DidPurchaseSubscription),t.addEventHandler(this,r.ApplicationEvent.FeaturesAvailabilityChanged),t.addEventHandler(this,r.ApplicationEvent.Launched),t.addEventHandler(this,r.ApplicationEvent.LocalDataLoaded),t.addEventHandler(this,r.ApplicationEvent.UserRolesChanged),this.showPremiumAlert=this.showPremiumAlert.bind(this),this.closePremiumAlert=this.closePremiumAlert.bind(this)}async handleEvent(e){switch(e.type){case r.ApplicationEvent.DidPurchaseSubscription:this.showPurchaseSuccessAlert();break;case r.ApplicationEvent.FeaturesAvailabilityChanged:case r.ApplicationEvent.Launched:case r.ApplicationEvent.LocalDataLoaded:case r.ApplicationEvent.UserRolesChanged:(0,_.z)((()=>{this.hasFolders=this.isEntitledToFolders(),this.hasSmartViews=this.isEntitledToSmartViews(),this.entitledToFiles=this.isEntitledToFiles()}));break;case qe.DisplayPremiumModal:{const t=e.payload;this.showPremiumAlert(t.featureName)}}}async showPremiumAlert(e){return this.premiumAlertFeatureName=e,this.premiumAlertType=lt.UpgradePrompt,(0,_.gx)((()=>void 0===this.premiumAlertType))}closePremiumAlert(){this.premiumAlertType=void 0}isEntitledToFiles(){return this.features.getFeatureStatus(r.NativeFeatureIdentifier.create(r.NativeFeatureIdentifier.TYPES.Files).getValue())===r.FeatureStatus.Entitled}isEntitledToFolders(){return this.features.getFeatureStatus(r.NativeFeatureIdentifier.create(r.NativeFeatureIdentifier.TYPES.TagNesting).getValue())===r.FeatureStatus.Entitled}isEntitledToSmartViews(){return this.features.getFeatureStatus(r.NativeFeatureIdentifier.create(r.NativeFeatureIdentifier.TYPES.SmartFilters).getValue())===r.FeatureStatus.Entitled}isVaultsEnabled(){const e=this.features.isExperimentalFeatureEnabled(r.NativeFeatureIdentifier.TYPES.Vaults);return ut()||e||this.features.hasRole(r.RoleName.create(r.RoleName.NAMES.InternalTeamUser).getValue())}isEntitledToSharedVaults(){const e=this.features.getFeatureStatus(r.NativeFeatureIdentifier.create(r.NativeFeatureIdentifier.TYPES.SharedVaults).getValue())===r.FeatureStatus.Entitled;return ut()||e}}var ht=s(39537),pt=s(88450);const ft=e=>e.getDisplayableTags().filter((t=>!e.getTagParent(t))),gt=(e,t,n)=>!t.find((e=>e.title===n.title))||(null==e||e.alert("A tag with the name ".concat(n.title," already exists at this destination. Please rename this tag before moving and try again.")).catch(console.error),!1);var mt=s(74455);class yt{constructor(e){this.items=e,this.counts={},(0,_.ky)(this,{counts:_.LO.ref,update:_.aD})}update(e){const t=Object.assign({},this.counts);e.forEach((e=>{t[e.uuid]=this.items.countableNotesForTag(e)})),this.counts=t}}function vt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function At(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vt(Object(n),!0).forEach((function(t){bt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class wt extends De.L{constructor(e,n,i,o,s,a,l,c,u,d,h){super(h),this.featuresController=e,this.vaultDisplayService=n,this.keyboardService=i,this.paneController=o,this.sync=s,this.mutator=a,this.items=l,this.preferences=c,this.alerts=u,this._changeAndSaveItem=d,this.tags=[],this.smartViews=[],this.starredTags=[],this.allNotesCount_=0,this.allFilesCount_=0,this.selectedUuid=void 0,this.selected_=void 0,this.selectedLocation=void 0,this.previouslySelected_=void 0,this.editing_=void 0,this.addingSubtagTo=void 0,this.contextMenuOpen=!1,this.contextMenuClickLocation={x:0,y:0},this.contextMenuTag=void 0,this.contextMenuTagSection=void 0,this.searchQuery="",this.findAndSetTag=e=>{const t=[...this.tags,...this.smartViews].find((t=>t.uuid===e));t&&this.setSelectedTag(t,(0,r.isTag)(t)?t.starred?"favorites":"all":"views")},this.selectHydratedTagOrDefault=()=>{this.selectedUuid&&!this.selected_&&this.findAndSetTag(this.selectedUuid),this.selectedUuid||this.selectHomeNavigationView()},this.getPersistableValue=()=>({selectedTagUuid:this.selectedUuid?this.selectedUuid:r.SystemViewId.AllNotes}),this.hydrateFromPersistedValue=e=>{const t=[r.SystemViewId.Files];e&&!t.includes(e.selectedTagUuid)?e.selectedTagUuid&&(this.selectedUuid=e.selectedTagUuid,this.selectHydratedTagOrDefault()):this.selectHomeNavigationView()},this.setDisplayOptionsAndReloadTags=()=>{this.items.setTagsAndViewsDisplayOptions({searchQuery:{query:this.searchQuery,includeProtectedNoteText:!1}}),this.reloadTags()},this.setSearchQuery=e=>{this.searchQuery=e,this.setDisplayOptionsAndReloadTags()},h.addEventHandler(this,L.FJ.VaultDisplayOptionsChanged),this.tagsCountsState=new yt(l),this.smartViews=l.getSmartViews(),(0,_.rC)(this,{tags:_.LO,starredTags:_.LO,smartViews:_.LO.ref,allNotesCount_:_.LO,allFilesCount_:_.LO,allNotesCount:_.Fl,allFilesCount:_.Fl,setAllNotesCount:_.aD,setAllFilesCount:_.aD,selected_:_.LO,selectedLocation:_.LO,previouslySelected_:_.LO.ref,previouslySelected:_.Fl,editing_:_.LO.ref,selected:_.Fl,selectedUuid:_.LO,editingTag:_.Fl,addingSubtagTo:_.LO,setAddingSubtagTo:_.aD,assignParent:_.aD,rootTags:_.Fl,tagsCount:_.Fl,createNewTemplate:_.aD,undoCreateNewTag:_.aD,save:_.aD,remove:_.aD,contextMenuOpen:_.LO,contextMenuClickLocation:_.LO,setContextMenuOpen:_.aD,setContextMenuClickLocation:_.aD,contextMenuTag:_.LO,setContextMenuTag:_.aD,isInFilesView:_.Fl,hydrateFromPersistedValue:_.aD,searchQuery:_.LO,setSearchQuery:_.aD}),this.disposers.push(this.items.streamItems([r.ContentType.TYPES.Tag,r.ContentType.TYPES.SmartView],(e=>{let{changed:t,removed:n}=e;this.reloadTags(),this.contextMenuTag&&(0,r.FindItem)(n,this.contextMenuTag.uuid)&&this.setContextMenuTag(void 0),(0,_.z)((()=>{const e=this.selected_;if(!e)return;const i=(0,r.FindItem)(t,e.uuid)||(0,r.FindItem)(this.smartViews,e.uuid);i&&this.setSelectedTagInstance(i),(0,r.isSystemView)(e)||(0,r.FindItem)(n,e.uuid)&&this.setSelectedTagInstance(this.smartViews[0])}))}))),this.disposers.push(this.items.addNoteCountChangeObserver((e=>{if(e){const t=this.items.findItem(e);t&&this.tagsCountsState.update([t])}else this.setAllNotesCount(this.items.allCountableNotesCount()),this.setAllFilesCount(this.items.allCountableFilesCount())}))),this.disposers.push((0,_.U5)((()=>this.selectedUuid),(()=>{h.publish({type:qe.RequestValuePersistence,payload:void 0})}))),this.disposers.push(this.keyboardService.addCommandHandler({command:L.PV,category:"General",description:"Create new tag",onKeyDown:()=>{this.createNewTemplate()}})),this.setDisplayOptionsAndReloadTags=(0,t.Ds)(this.setDisplayOptionsAndReloadTags,50)}reloadTags(){(0,_.z)((()=>{this.tags=this.items.getDisplayableTags(),this.starredTags=this.tags.filter((e=>e.starred)),this.smartViews=this.items.getSmartViews().filter((e=>!this.isSearching||!(0,r.isSystemView)(e)))}))}async handleEvent(e){e.type===L.FJ.VaultDisplayOptionsChanged&&(this.reloadTags(),this.selectedUuid?this.findAndSetTag(this.selectedUuid):this.selectHomeNavigationView().catch(console.error))}deinit(){super.deinit(),this.featuresController=void 0,this.tags=void 0,this.smartViews=void 0,this.selected_=void 0,this.previouslySelected_=void 0,this.editing_=void 0,this.addingSubtagTo=void 0,this.featuresController=void 0,(0,t.h6)(this)}async createSubtagAndAssignParent(e,t){if(0===t.length)return void this.setAddingSubtagTo(void 0);const n=await this.mutator.createTagOrSmartView(t,this.vaultDisplayService.exclusivelyShownVault),r=this.items.getTagChildren(e);if(!gt(this.alerts,r,n))return this.setAddingSubtagTo(void 0),void this.remove(n,!1).catch(console.error);this.assignParent(n.uuid,e.uuid).catch(console.error),this.sync.sync().catch(console.error),(0,_.z)((()=>{this.setSelectedTag(n,"all")})),this.setAddingSubtagTo(void 0)}isInSmartView(){return this.selected instanceof r.SmartView}isInHomeView(){return this.selected instanceof r.SmartView&&this.selected.uuid===r.SystemViewId.AllNotes}get isInFilesView(){return this.selectedUuid===r.SystemViewId.Files}isTagFilesView(e){return e.uuid===r.SystemViewId.Files}tagUsesTableView(e){var t;const n=e instanceof r.SmartView&&Object.values(r.SystemViewId).includes(e.uuid)?null===(t=this.preferences.getValue(r.PrefKey.SystemViewPreferences))||void 0===t?void 0:t[e.uuid]:null==e?void 0:e.preferences;return Boolean(n)}isInAnySystemView(){return this.selected instanceof r.SmartView&&Object.values(r.SystemViewId).includes(this.selected.uuid)}isInSystemView(e){return this.selected instanceof r.SmartView&&this.selected.uuid===e}get selectedAsTag(){if(this.selected&&(0,r.isTag)(this.selected))return this.selected}setAddingSubtagTo(e){this.addingSubtagTo=e}setContextMenuOpen(e){this.contextMenuOpen=e}setContextMenuClickLocation(e){this.contextMenuClickLocation=e}setContextMenuTag(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";this.contextMenuTag=e,this.contextMenuTagSection=t}get allLocalRootTags(){return this.editing_ instanceof r.SNTag&&this.items.isTemplateItem(this.editing_)?[this.editing_,...this.rootTags]:this.rootTags}getNotesCount(e){return this.tagsCountsState.counts[e.uuid]||0}getChildren(e){if(this.items.isTemplateItem(e))return[];const t=this.items.getTagChildren(e),n=t.map((e=>e.uuid)),r=this.isSearching?t:this.tags.filter((e=>n.includes(e.uuid)));return r}isValidTagParent(e,t){return this.items.isValidTagParent(e,t)}hasParent(e){const t=this.items.findItem(e);return!!t&&!!t.parentId}async assignParent(e,t){const n=this.items.findItem(e),r=this.items.getTagParent(n);if((null==r?void 0:r.uuid)===t)return;const i=t&&this.items.findItem(t);if(i){const e=this.items.getTagChildren(i);if(!gt(this.alerts,e,n))return;await this.mutator.setTagParent(i,n)}else{const e=ft(this.items);if(!gt(this.alerts,e,n))return;await this.mutator.unsetTagParent(n)}await this.sync.sync()}get rootTags(){return this.tags.filter((e=>!this.items.getDisplayableTagParent(e)))}get tagsCount(){return this.tags.length}setAllNotesCount(e){this.allNotesCount_=e}setAllFilesCount(e){this.allFilesCount_=e}get allFilesCount(){return this.allFilesCount_}get allNotesCount(){return this.allNotesCount_}get previouslySelected(){return this.previouslySelected_}get selected(){return this.selected_}async setPanelWidthForTag(e,t){await this._changeAndSaveItem.execute(e,(e=>{e.preferences=At(At({},e.preferences),{},{panelWidth:t})}))}async setSelectedTag(e,t){let{userTriggered:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{userTriggered:!1};e&&e.conflictOf&&this._changeAndSaveItem.execute(e,(e=>{e.conflictOf=void 0})).catch(console.error),e&&(this.isTagFilesView(e)||this.tagUsesTableView(e))?this.paneController.setPaneLayout(mt.h.TableView):n&&this.paneController.setPaneLayout(mt.h.ItemSelection),this.previouslySelected_=this.selected_,await(0,_.z)((async()=>{this.setSelectedTagInstance(e),this.selectedLocation=t,e&&this.items.isTemplateItem(e)||await this.eventBus.publishSync({type:qe.TagChanged,payload:{tag:e,previousTag:this.previouslySelected_,userTriggered:n}},r.InternalEventPublishStrategy.SEQUENCE)}))}async selectHomeNavigationView(){await this.setSelectedTag(this.homeNavigationView,"views")}async selectFilesView(){await this.setSelectedTag(this.filesNavigationView,"views")}get homeNavigationView(){return this.smartViews[0]}get filesNavigationView(){return this.smartViews.find(this.isTagFilesView)}setSelectedTagInstance(e){(0,_.z)((()=>{this.selected_=e,this.selectedUuid=e?e.uuid:void 0}))}setExpanded(e,t){e.expanded!==t&&this._changeAndSaveItem.execute(e,(e=>{e.expanded=t})).catch(console.error)}async setFavorite(e,t){return this._changeAndSaveItem.execute(e,(e=>{e.starred=t})).catch(console.error)}setIcon(e,t){this._changeAndSaveItem.execute(e,(e=>{e.iconString=t})).catch(console.error)}get editingTag(){return this.editing_}setEditingTag(e){(0,_.z)((()=>{this.editing_=e,this.selected!==e&&this.setSelectedTag(e,this.selectedLocation||"all")}))}createNewTemplate(){if(this.editing_&&this.items.isTemplateItem(this.editing_))return;const e=this.items.createTemplateItem(r.ContentType.TYPES.Tag);(0,_.z)((()=>{this.selectedLocation="all",this.editing_=e}))}undoCreateNewTag(){this.editing_=void 0;const e=this.previouslySelected_||this.smartViews[0];this.setSelectedTag(e,this.selectedLocation||"views")}async remove(e,t){let n=!t;t&&(n=await(0,L.VG)({title:'Delete tag "'.concat(e.title,'"?'),text:ht.$n,confirmButtonStyle:"danger"})),n&&(this.mutator.deleteItem(e).then((()=>this.sync.sync())).catch(console.error),await this.setSelectedTag(this.smartViews[0],"views"))}async save(e,t){const n=this.items.isTemplateItem(e),i=n?e:this.items.findSureItem(e.uuid),o=0===t.length,s=t===i.title,a=i instanceof r.SNTag?((e,t)=>{const n=e=>e.filter((e=>e.uuid!==t.uuid)),r=!e.isTemplateItem(t)&&e.getTagParent(t);return n(r?e.getTagChildren(r):ft(e))})(this.items,i):[],l=a.some((e=>e.title.toLowerCase()===t.toLowerCase()));if((0,_.z)((()=>{this.editing_=void 0})),o||s)n&&this.undoCreateNewTag();else{if(l)return n&&this.undoCreateNewTag(),void this.alerts.alert("A tag with this name already exists.").catch(console.error);if(n){if(this.items.isSmartViewTitle(t)&&!this.featuresController.hasSmartViews)return void await this.featuresController.showPremiumAlert(pt.t2);const e=await this.mutator.createTagOrSmartView(t,this.vaultDisplayService.exclusivelyShownVault);this.sync.sync().catch(console.error),(0,_.z)((()=>{this.setSelectedTag(e,this.selectedLocation||"views")}))}else await this._changeAndSaveItem.execute(i,(e=>{e.title=t}))}}get isSearching(){return this.searchQuery.length>0}}class St extends De.L{constructor(e,t,n,i,o,s,a,l,c,u,d,h,p){super(p),this.itemListController=e,this.navigationController=t,this.itemControllerGroup=n,this.keyboardService=i,this.preferences=o,this.items=s,this.mutator=a,this.sync=l,this.protections=c,this.alerts=u,this._isGlobalSpellcheckEnabled=d,this._getItemTags=h,this.contextMenuOpen=!1,this.contextMenuClickLocation={x:0,y:0},this.contextMenuMaxHeight="auto",this.showProtectedWarning=!1,this.setContextMenuOpen=e=>{this.contextMenuOpen=e},(0,_.rC)(this,{contextMenuOpen:_.LO,showProtectedWarning:_.LO,selectedNotes:_.Fl,firstSelectedNote:_.Fl,selectedNotesCount:_.Fl,trashedNotesCount:_.Fl,setContextMenuOpen:_.aD,setContextMenuClickLocation:_.aD,setShowProtectedWarning:_.aD,unselectNotes:_.aD}),this.shouldLinkToParentFolders=o.getValue(r.PrefKey.NoteAddToParentFolders,r.PrefDefaults[r.PrefKey.NoteAddToParentFolders]),p.addEventHandler(this,r.ApplicationEvent.PreferencesChanged),p.addEventHandler(this,qe.UnselectAllNotes),this.disposers.push(this.keyboardService.addCommandHandler({command:L.Ib,category:"Current note",description:"Pin current note",onKeyDown:()=>{this.togglePinSelectedNotes()}}),this.keyboardService.addCommandHandler({command:L.Ak,category:"Current note",description:"Star current note",onKeyDown:()=>{this.toggleStarSelectedNotes()}})),this.disposers.push(this.itemControllerGroup.addActiveControllerChangeObserver((()=>{const e=this.itemControllerGroup.itemControllers.map((e=>e.item.uuid)),t=this.getSelectedNotesList().map((e=>e.uuid));for(const n of t)e.includes(n)||this.itemListController.deselectItem({uuid:n})})))}async handleEvent(e){e.type===r.ApplicationEvent.PreferencesChanged?this.shouldLinkToParentFolders=this.preferences.getValue(r.PrefKey.NoteAddToParentFolders,r.PrefDefaults[r.PrefKey.NoteAddToParentFolders]):e.type===qe.UnselectAllNotes&&this.unselectNotes()}deinit(){super.deinit(),this.lastSelectedNote=void 0,this.itemListController=void 0,this.navigationController=void 0,(0,t.h6)(this)}get selectedNotes(){return this.itemListController.getFilteredSelectedItems(r.ContentType.TYPES.Note)}get firstSelectedNote(){return Object.values(this.selectedNotes)[0]}get selectedNotesCount(){return this.dealloced?0:Object.keys(this.selectedNotes).length}get trashedNotesCount(){return this.items.trashedItems.length}setContextMenuClickLocation(e){this.contextMenuClickLocation=e}async changeSelectedNotes(e){await this.mutator.changeItems(this.getSelectedNotesList(),e,r.MutationType.NoUpdateUserTimestamps),this.sync.sync().catch(console.error)}setHideSelectedNotePreviews(e){this.changeSelectedNotes((t=>{t.hidePreview=e})).catch(console.error)}setLockSelectedNotes(e){this.changeSelectedNotes((t=>{t.locked=e})).catch(console.error)}async setTrashSelectedNotes(e){e?await this.deleteNotes(!1)&&(0,_.z)((()=>{this.contextMenuOpen=!1})):(await this.changeSelectedNotes((t=>{t.trashed=e})),(0,_.z)((()=>{this.contextMenuOpen=!1})))}async deleteNotesPermanently(){await this.deleteNotes(!0)}async deleteNotes(e){if(this.getSelectedNotesList().some((e=>e.locked))){const e=ht.xZ.deleteLockedNotesAttempt(this.selectedNotesCount);return this.alerts.alert(e).catch(console.error),!1}const t=e?ht.eI.deleteItemsPermanentlyTitle:ht.eI.trashItemsTitle;let n;if(1===this.selectedNotesCount){const e=this.getSelectedNotesList()[0];n=e.title.length?"'".concat(e.title,"'"):"this note"}const r=ht.xZ.deleteNotes(e,this.selectedNotesCount,n);return!!await(0,L.VG)({title:t,text:r,confirmButtonStyle:"danger"})&&(this.itemListController.selectNextItem(),e?(await this.mutator.deleteItems(this.getSelectedNotesList()),this.sync.sync()):await this.changeSelectedNotes((e=>{e.trashed=!0})),!0)}togglePinSelectedNotes(){this.selectedNotes.some((e=>e.pinned))?this.setPinSelectedNotes(!1):this.setPinSelectedNotes(!0)}toggleStarSelectedNotes(){this.selectedNotes.some((e=>e.starred))?this.setStarSelectedNotes(!1):this.setStarSelectedNotes(!0)}setPinSelectedNotes(e){this.changeSelectedNotes((t=>{t.pinned=e})).catch(console.error)}setStarSelectedNotes(e){this.changeSelectedNotes((t=>{t.starred=e})).catch(console.error)}async setArchiveSelectedNotes(e){this.getSelectedNotesList().some((e=>e.locked))?this.alerts.alert(ht.xZ.archiveLockedNotesAttempt(e,this.selectedNotesCount)).catch(console.error):(await this.changeSelectedNotes((t=>{t.archived=e})),(0,_.z)((()=>{this.itemListController.deselectAll(),this.contextMenuOpen=!1})))}async toggleArchiveSelectedNotes(){this.selectedNotes.some((e=>e.archived))?await this.setArchiveSelectedNotes(!1):await this.setArchiveSelectedNotes(!0)}async setProtectSelectedNotes(e){const t=this.getSelectedNotesList();e?(await this.protections.protectNotes(t),this.setShowProtectedWarning(!0)):(await this.protections.unprotectNotes(t),this.setShowProtectedWarning(!1)),this.sync.sync()}unselectNotes(){this.itemListController.deselectAll()}getSpellcheckStateForNote(e){return null!=e.spellcheck?e.spellcheck:this._isGlobalSpellcheckEnabled.execute().getValue()}async toggleGlobalSpellcheckForNote(e){await this.mutator.changeItem(e,(e=>{e.toggleSpellcheck()}),r.MutationType.NoUpdateUserTimestamps),this.sync.sync().catch(console.error)}getEditorWidthForNote(e){var t;return null!==(t=e.editorWidth)&&void 0!==t?t:this.preferences.getLocalValue(r.LocalPrefKey.EditorLineWidth,r.PrefDefaults[r.LocalPrefKey.EditorLineWidth])}async setNoteEditorWidth(e,t){await this.mutator.changeItem(e,(e=>{e.editorWidth=t}),r.MutationType.NoUpdateUserTimestamps),this.sync.sync().catch(console.error)}async addTagToSelectedNotes(e){const t=this.getSelectedNotesList();await Promise.all(t.map((async t=>{await this.mutator.addTagToNote(t,e,this.shouldLinkToParentFolders)}))),this.sync.sync().catch(console.error)}async removeTagFromSelectedNotes(e){const t=this.getSelectedNotesList();await this.mutator.changeItem(e,(e=>{for(const n of t)e.removeItemAsRelationship(n)})),this.sync.sync().catch(console.error)}isTagInSelectedNotes(e){return this.getSelectedNotesList().every((t=>this._getItemTags.execute(t).getValue().find((t=>t.uuid===e.uuid))))}setShowProtectedWarning(e){this.showProtectedWarning=e}async emptyTrash(){await(0,L.VG)({text:(0,ht.Sq)(this.trashedNotesCount),confirmButtonStyle:"danger"})&&(await this.mutator.emptyTrash(),this.sync.sync().catch(console.error))}getSelectedNotesList(){return Object.values(this.selectedNotes)}}var Ct,Et=s(84409),It=s(22325),_t=s(82648),xt=s(61659);function Pt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function kt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Bt{constructor(e,t,n,r,i,o,s,a,l,c){this.items=t,this.mutator=n,this.sync=r,this.sessions=i,this.preferences=o,this.components=s,this.alerts=a,this._isNativeMobileWeb=l,this.templateNoteOptions=c,this.dealloced=!1,this.isTemplateNote=!1,this.runtimeId="".concat(Math.random()),this.needsInit=!0,this.innerValueChangeObservers=[],this.disposers=[],e&&(this.item=e),c&&(this.defaultTagUuid=c.tag),this.defaultTagUuid&&(this.defaultTag=this.items.findItem(this.defaultTagUuid)),this.syncController=new xt.I(this.item,this.items,this.mutator,this.sessions,this.sync,this.alerts,this._isNativeMobileWeb)}deinit(){this.syncController.savingLocallyPromise?this.syncController.savingLocallyPromise.promise.then((()=>{this.performDeinitSafely()})):this.performDeinitSafely()}performDeinitSafely(){this.dealloced=!0;for(const e of this.disposers)e();this.disposers.length=0,this.innerValueChangeObservers.length=0}async initialize(){var e,t,n;if(!this.needsInit)throw Error("NoteViewController already initialized");V(R.NoteView,"Initializing NoteViewController"),this.needsInit=!1;const r=this.preferences.getValue(It.PrefKey.NoteAddToParentFolders,!0);if(!this.item){V(R.NoteView,"Initializing as template note");const i=this.components.getDefaultEditorIdentifier(this.defaultTag),o=(0,Et.noteTypeForEditorIdentifier)(i),s=this.items.createTemplateItem(_t.ContentType.TYPES.Note,{text:"",title:(null===(e=this.templateNoteOptions)||void 0===e?void 0:e.title)||"",noteType:o,editorIdentifier:i,references:[]},function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pt(Object(n),!0).forEach((function(t){kt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({created_at:(null===(t=this.templateNoteOptions)||void 0===t?void 0:t.createdAt)||new Date},(0,It.PayloadVaultOverrides)(null===(n=this.templateNoteOptions)||void 0===n?void 0:n.vault)));if(this.isTemplateNote=!0,this.item=s,this.syncController.setItem(this.item),this.defaultTagUuid){const e=this.items.findItem(this.defaultTagUuid);await this.mutator.addTagToNote(s,e,r)}this.notifyObservers(this.item,It.PayloadEmitSource.InitialObserverRegistrationPush)}this.streamItems()}notifyObservers(e,t){for(const n of this.innerValueChangeObservers)n(e,t)}streamItems(){this.dealloced||this.disposers.push(this.items.streamItems(_t.ContentType.TYPES.Note,(e=>{let{changed:t,inserted:n,source:r}=e;if(this.dealloced)return;const i=t.concat(n).find((e=>e.uuid===this.item.uuid));i&&(this.isTemplateNote=!1,this.item=i,this.notifyObservers(i,r))})))}insertTemplatedNote(){return V(R.NoteView,"Inserting template note"),this.isTemplateNote=!1,this.mutator.insertItem(this.item)}addNoteInnerValueChangeObserver(e){this.innerValueChangeObservers.push(e),this.item&&e(this.item,It.PayloadEmitSource.InitialObserverRegistrationPush);const t=this.innerValueChangeObservers;return()=>{(0,Q.removeFromArray)(t,e)}}async saveAndAwaitLocalPropagation(e){if(this.needsInit)throw Error("NoteViewController not initialized");V(R.NoteView,"Saving note",e),this.isTemplateNote&&await this.insertTemplatedNote(),await this.syncController.saveAndAwaitLocalPropagation(e)}get syncStatus(){return this.syncController.status}showSavingStatus(){this.syncController.showSavingStatus()}showAllChangesSavedStatus(){this.syncController.showAllChangesSavedStatus()}showErrorSyncStatus(e){this.syncController.showErrorStatus(e)}syncNow(){this.sync.sync().catch(console.error)}syncOnlyIfLargeNote(){this.syncController.syncOnlyIfLargeNote()}}!function(e){e[e.ItemStream=0]="ItemStream",e[e.SyncEvent=1]="SyncEvent",e[e.DisplayOptionsChange=2]="DisplayOptionsChange",e[e.Pagination=3]="Pagination",e[e.TagChange=4]="TagChange",e[e.UserTriggeredTagChange=5]="UserTriggeredTagChange",e[e.FilterTextChange=6]="FilterTextChange"}(Ct||(Ct={}));var Ot=s(28879),Nt=s.n(Ot),Dt=s(57449),jt=s.n(Dt),Tt=s(66653),Mt=s.n(Tt),Ft=s(10264),Rt=s.n(Ft),Lt=s(67338),Qt=s.n(Lt),Ut=s(42090),Vt=s.n(Ut),Kt=s(90742),Ht=s.n(Kt);function Gt(e,t){return Nt()(e).format(t)}Nt().extend(jt()),Nt().extend(Mt()),Nt().extend(Rt()),Nt().extend(Qt()),Nt().extend(Vt()),Nt().extend(Ht());const Yt=()=>{document.querySelectorAll('[role="dialog"], [data-popover]').forEach((e=>{"close"in e&&"function"==typeof e.close&&e.close()}))};class zt extends De.L{deinit(){super.deinit(),this.noteFilterText=void 0,this.notes=void 0,this.renderedItems=void 0,this.navigationController=void 0,this.searchOptionsController=void 0,window.onresize=void 0,(0,t.h6)(this)}constructor(e,n,i,o,s,a,l,c,u,d,h,p,f,g){var m;super(g),m=this,this.keyboardService=e,this.paneController=n,this.navigationController=i,this.searchOptionsController=o,this.itemManager=s,this.preferences=a,this.itemControllerGroup=l,this.vaultDisplayService=c,this.desktopManager=u,this.protections=d,this.options=h,this._isNativeMobileWeb=p,this._changeAndSaveItem=f,this.completedFullSync=!1,this.noteFilterText="",this.notes=[],this.items=[],this.notesToDisplay=0,this.pageSize=0,this.panelTitle="Notes",this.renderedItems=[],this.searchSubmitted=!1,this.showDisplayOptionsMenu=!1,this.displayOptions={sortBy:r.CollectionSort.CreatedAt,sortDirection:"dsc",includePinned:!0,includeArchived:!1,includeTrashed:!1,includeProtected:!0},this.webDisplayOptions={hideTags:!0,hideDate:!1,hideNotePreview:!1,hideEditorIcon:!1},this.isTableViewEnabled=!1,this.selectedUuids=(0,_.LO)(new Set),this.selectedItems={},this.isMultipleSelectionMode=!1,this.getPersistableValue=()=>({selectedUuids:Array.from(this.selectedUuids)}),this.hydrateFromPersistedValue=e=>{if(e&&!this.selectedUuids.size&&e.selectedUuids.length>0)if(this.options.allowNoteSelectionStatePersistence)this.selectUuids(e.selectedUuids);else{const t=this.itemManager.findItems(e.selectedUuids).filter((e=>!(0,r.isNote)(e)));this.selectUuids((0,r.Uuids)(t))}},this.setCompletedFullSync=e=>{this.completedFullSync=e},this.setShowDisplayOptionsMenu=e=>{this.showDisplayOptionsMenu=e},this.reloadPanelTitle=()=>{let e=this.panelTitle;if(this.isFiltering){const t=this.items.length;e="".concat(t," search results")}else this.navigationController.selected&&(e="".concat(this.navigationController.selected.title));this.panelTitle=e},this.reloadItems=async e=>{this.reloadItemsPromise&&await this.reloadItemsPromise,this.reloadItemsPromise=this.performReloadItems(e),await this.reloadItemsPromise},this.shouldLeaveSelectionUnchanged=e=>e instanceof Bt&&e.isTemplateNote,this.shouldCloseActiveItem=(e,t)=>{if(t===Ct.UserTriggeredTagChange)return V(R.Selection,"shouldCloseActiveItem true due to ItemsReloadSource.UserTriggeredTagChange"),!0;const n=this.items.find((t=>t.uuid===(null==e?void 0:e.uuid)));if(e&&(0,r.isFile)(e)&&!n)return V(R.Selection,"shouldCloseActiveItem closeBecauseActiveItemIsFileAndDoesntExistInUpdatedResults"),!0;const i=this.getFirstNonProtectedItem();if(i&&(0,r.isFile)(i)&&!n)return V(R.Selection,"shouldCloseActiveItem closePreviousItemWhenSwitchingToFilesBasedView"),!0;const o=this.noteFilterText.length>0;return n||o||!this.navigationController.isInAnySystemView()?(V(R.Selection,"shouldCloseActiveItem false"),!1):(V(R.Selection,"shouldCloseActiveItem closePreviousItemWhenSwitchingToFilesBasedView"),!0)},this.shouldSelectNextItemOrCreateNewNote=e=>{const t=this.navigationController.selected,n=null==e?void 0:e.trashed,i=null==e?void 0:e.archived;if(n){const e=t instanceof r.SmartView&&t.predicate.keypathIncludesString("trashed");return!(this.navigationController.isInSystemView(r.SystemViewId.TrashedNotes)||this.searchOptionsController.includeTrashed||e||this.displayOptions.includeTrashed)}if(i){const e=t instanceof r.SmartView&&t.predicate.keypathIncludesString("archived");return!(this.navigationController.isInSystemView(r.SystemViewId.ArchivedNotes)||this.searchOptionsController.includeArchived||e||this.displayOptions.includeArchived)}return!1},this.shouldSelectActiveItem=e=>!this.isItemSelected(e),this.shouldSelectFirstItem=e=>{if(this._isNativeMobileWeb.execute().getValue())return!1;const t=this.getFirstNonProtectedItem();if(t&&(0,r.isFile)(t))return!1;const n=this.navigationController.selected;if(n&&(0,r.isTag)(n)&&n.isDailyEntry)return!1;const i=e===Ct.UserTriggeredTagChange,o=!this.selectedUuids.size;return i||o},this.reloadNotesDisplayOptions=()=>{var e,t;const n=this.navigationController.selected,i=this.noteFilterText.toLowerCase();let o,s;i.length?(o=this.searchOptionsController.includeArchived,s=this.searchOptionsController.includeTrashed):(o=null!==(e=this.displayOptions.includeArchived)&&void 0!==e&&e,s=null!==(t=this.displayOptions.includeTrashed)&&void 0!==t&&t);const a={sortBy:this.displayOptions.sortBy,sortDirection:this.displayOptions.sortDirection,tags:n instanceof r.SNTag?[n]:[],views:n instanceof r.SmartView?[n]:[],includeArchived:o,includeTrashed:s,includePinned:this.displayOptions.includePinned,includeProtected:this.displayOptions.includeProtected,searchQuery:{query:i,includeProtectedNoteText:this.searchOptionsController.includeProtectedContents}};this.itemManager.setPrimaryItemDisplayOptions(a)},this.reloadDisplayPreferences=async e=>{let{userTriggered:t}=e;var n;const i={},o={},s=this.navigationController.selected,a=s&&(0,r.isSmartView)(s)&&(0,r.isSystemView)(s)?null===(n=this.preferences.getValue(r.PrefKey.SystemViewPreferences))||void 0===n?void 0:n[s.uuid]:null==s?void 0:s.preferences;this.isTableViewEnabled=Boolean(null==a?void 0:a.useTableView);const l=this.displayOptions.sortBy;let c=(null==a?void 0:a.sortBy)||this.preferences.getValue(r.PrefKey.SortNotesBy,r.PrefDefaults[r.PrefKey.SortNotesBy]);c!==r.CollectionSort.UpdatedAt&&"client_updated_at"!==c||(c=r.CollectionSort.UpdatedAt),i.sortBy=c;const u=this.displayOptions.sortDirection;i.sortDirection=!1===(0,r.useBoolean)(null==a?void 0:a.sortReverse,this.preferences.getValue(r.PrefKey.SortNotesReverse,r.PrefDefaults[r.PrefKey.SortNotesReverse]))?"dsc":"asc",i.includeArchived=(0,r.useBoolean)(null==a?void 0:a.showArchived,this.preferences.getValue(r.PrefKey.NotesShowArchived,r.PrefDefaults[r.PrefKey.NotesShowArchived])),i.includeTrashed=(0,r.useBoolean)(null==a?void 0:a.showTrashed,this.preferences.getValue(r.PrefKey.NotesShowTrashed,r.PrefDefaults[r.PrefKey.NotesShowTrashed])),i.includePinned=!(0,r.useBoolean)(null==a?void 0:a.hidePinned,this.preferences.getValue(r.PrefKey.NotesHidePinned,r.PrefDefaults[r.PrefKey.NotesHidePinned])),i.includeProtected=!(0,r.useBoolean)(null==a?void 0:a.hideProtected,this.preferences.getValue(r.PrefKey.NotesHideProtected,r.PrefDefaults[r.PrefKey.NotesHideProtected])),o.hideNotePreview=(0,r.useBoolean)(null==a?void 0:a.hideNotePreview,this.preferences.getValue(r.PrefKey.NotesHideNotePreview,r.PrefDefaults[r.PrefKey.NotesHideNotePreview])),o.hideDate=(0,r.useBoolean)(null==a?void 0:a.hideDate,this.preferences.getValue(r.PrefKey.NotesHideDate,r.PrefDefaults[r.PrefKey.NotesHideDate])),o.hideTags=(0,r.useBoolean)(null==a?void 0:a.hideTags,this.preferences.getValue(r.PrefKey.NotesHideTags,r.PrefDefaults[r.PrefKey.NotesHideTags])),o.hideEditorIcon=(0,r.useBoolean)(null==a?void 0:a.hideEditorIcon,this.preferences.getValue(r.PrefKey.NotesHideEditorIcon,r.PrefDefaults[r.PrefKey.NotesHideEditorIcon]));const d=i.sortBy!==this.displayOptions.sortBy||i.sortDirection!==this.displayOptions.sortDirection||i.includePinned!==this.displayOptions.includePinned||i.includeArchived!==this.displayOptions.includeArchived||i.includeTrashed!==this.displayOptions.includeTrashed||i.includeProtected!==this.displayOptions.includeProtected||o.hideNotePreview!==this.webDisplayOptions.hideNotePreview||o.hideDate!==this.webDisplayOptions.hideDate||o.hideEditorIcon!==this.webDisplayOptions.hideEditorIcon||o.hideTags!==this.webDisplayOptions.hideTags;if(this.displayOptions=i,this.webDisplayOptions=o,!d)return{didReloadItems:!1};this.reloadNotesDisplayOptions(),await this.reloadItems(t?Ct.UserTriggeredTagChange:Ct.DisplayOptionsChange);const h=l!==this.displayOptions.sortBy,p=u!==this.displayOptions.sortDirection;return(h||p)&&this.shouldSelectFirstItem(Ct.DisplayOptionsChange)&&await this.selectFirstItem(),{didReloadItems:!0}},this.titleForNewNote=e=>{var t,n,i;if(this.isFiltering)return this.noteFilterText;const o=this.navigationController.selected,s=o&&(0,r.isSmartView)(o)&&(0,r.isSystemView)(o)?null===(t=this.preferences.getValue(r.PrefKey.SystemViewPreferences))||void 0===t?void 0:t[o.uuid]:null==o?void 0:o.preferences,a=(null==s?void 0:s.newNoteTitleFormat)||this.preferences.getValue(r.PrefKey.NewNoteTitleFormat,r.PrefDefaults[r.PrefKey.NewNoteTitleFormat]);if(a===r.NewNoteTitleFormat.CurrentNoteCount)return"Note ".concat(this.notes.length+1);if(a===r.NewNoteTitleFormat.CustomFormat){const t=(null===(i=null===(n=this.navigationController.selected)||void 0===n?void 0:n.preferences)||void 0===i?void 0:i.customNoteTitleFormat)||this.preferences.getValue(r.PrefKey.CustomNoteTitleFormat,r.PrefDefaults[r.PrefKey.CustomNoteTitleFormat]);try{return Gt(e,t)}catch(t){return console.error(t),(0,je.AF)(e||new Date)}}return a===r.NewNoteTitleFormat.Empty?"":(0,je.AF)(e||new Date)},this.createNewNote=async(e,t,n)=>{this.publishCrossControllerEventSync(qe.UnselectAllNotes),this.navigationController.isInSmartView()&&!this.navigationController.isInHomeView()&&await this.navigationController.selectHomeNavigationView();const r=e||this.titleForNewNote(t),i=await this.createNewNoteController(r,t,n);this.scrollToItem(i.item)},this.createPlaceholderNote=()=>{if(!this.navigationController.isInSmartView()||this.navigationController.isInHomeView())return this.createNewNote()},this.paginate=()=>{var e;this.notesToDisplay+=this.pageSize,this.reloadItems(Ct.Pagination),this.searchSubmitted&&(null===(e=this.desktopManager)||void 0===e||e.searchText(this.noteFilterText))},this.resetPagination=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=document.documentElement.clientHeight;m.pageSize=Math.ceil(t/51),0===m.pageSize&&(m.pageSize=20),e&&m.notesToDisplay>m.pageSize||(m.notesToDisplay=m.pageSize)},this.getFirstNonProtectedItem=()=>this.items.find((e=>!e.protected)),this.selectFirstItem=async()=>{const e=this.getFirstNonProtectedItem();this.isTableViewEnabled&&!(0,t.Av)()||e&&(V(R.Selection,"Selecting first item",e.uuid),await this.selectItemWithScrollHandling(e,{userTriggered:!1,scrollIntoView:!1}),this.resetScrollPosition())},this.selectNextItemOrCreateNewNote=async()=>{const e=this.getFirstNonProtectedItem();e?(V(R.Selection,"selectNextItemOrCreateNewNote"),await this.selectItemWithScrollHandling(e,{userTriggered:!1,scrollIntoView:!1}).catch(console.error)):await this.createNewNote()},this.setNoteFilterText=e=>{e!==this.noteFilterText&&(this.noteFilterText=e,this.handleFilterTextChanged())},this.handleEditorChange=async()=>{var e,t;const n=null===(e=this.itemControllerGroup.activeItemViewController)||void 0===e?void 0:e.item;n&&n.conflictOf&&this._changeAndSaveItem.execute(n,(e=>{e.conflictOf=void 0})),this.isFiltering&&(null===(t=this.desktopManager)||void 0===t||t.searchText(this.noteFilterText))},this.resetScrollPosition=()=>{this.notesListScrollContainer&&(this.notesListScrollContainer.scrollTop=0,this.notesListScrollContainer.scrollLeft=0)},this.handleTagChange=async e=>{var t;const n=this.getActiveItemController();n instanceof Bt&&n.isTemplateNote&&this.closeItemController(n),this.resetScrollPosition(),this.setShowDisplayOptionsMenu(!1),this.setNoteFilterText(""),null===(t=this.desktopManager)||void 0===t||t.searchText(),this.resetPagination();const{didReloadItems:r}=await this.reloadDisplayPreferences({userTriggered:e});r||(this.reloadNotesDisplayOptions(),this.reloadItems(e?Ct.UserTriggeredTagChange:Ct.TagChange))},this.onFilterEnter=()=>{var e;this.searchSubmitted=!0,null===(e=this.desktopManager)||void 0===e||e.searchText(this.noteFilterText)},this.handleFilterTextChanged=()=>{this.searchSubmitted&&(this.searchSubmitted=!1),this.reloadNotesDisplayOptions(),this.reloadItems(Ct.FilterTextChange)},this.clearFilterText=()=>{this.setNoteFilterText(""),this.onFilterEnter(),this.handleFilterTextChanged(),this.resetPagination()},this.getSelectedItems=()=>Array.from(this.selectedUuids).map((e=>this.itemManager.findSureItem(e))).filter((e=>!!e)),this.getFilteredSelectedItems=e=>Object.values(this.selectedItems).filter((t=>!e||t.content_type===e)),this.setSelectedItems=()=>{this.selectedItems=Object.fromEntries(this.getSelectedItems().map((e=>[e.uuid,e])))},this.setSelectedUuids=e=>{V(R.Selection,"Setting selected uuids",e),this.selectedUuids=new Set(e),this.setSelectedItems()},this.removeSelectedItem=e=>{this.selectedUuids.delete(e),this.setSelectedUuids(this.selectedUuids),delete this.selectedItems[e]},this.deselectItem=e=>{var t;V(R.Selection,"Deselecting item",e.uuid),this.removeSelectedItem(e.uuid),e.uuid===(null===(t=this.lastSelectedItem)||void 0===t?void 0:t.uuid)&&(this.lastSelectedItem=void 0)},this.isItemSelected=e=>this.selectedUuids.has(e.uuid),this.selectItemsRange=async e=>{let{selectedItem:t,startingIndex:n,endingIndex:i}=e;const o=this.renderedItems,s=null!=n?n:o.findIndex((e=>{var t;return e.uuid==(null===(t=this.lastSelectedItem)||void 0===t?void 0:t.uuid)})),a=null!=i?i:o.findIndex((e=>e.uuid==(null==t?void 0:t.uuid)));let l=[];l=a>s?o.slice(s,a+1):o.slice(a,s+1);const c=await this.protections.authorizeProtectedActionForItems(l,r.ChallengeReason.SelectProtectedNote);for(const e of c)(0,_.z)((()=>{this.setSelectedUuids(this.selectedUuids.add(e.uuid)),this.lastSelectedItem=e,this.selectedItemsCount>1&&!this.isMultipleSelectionMode&&this.enableMultipleSelectionMode()}))},this.cancelMultipleSelection=()=>{this.keyboardService.cancelAllKeyboardModifiers(),this.isMultipleSelectionMode=!1;const e=this.firstSelectedItem;e?this.replaceSelection(e):this.deselectAll()},this.replaceSelection=e=>{this.deselectAll(),(0,_.z)((()=>this.setSelectedUuids(this.selectedUuids.add(e.uuid)))),this.lastSelectedItem=e},this.selectAll=()=>{const e=this.items.filter((e=>!e.protected)),t=e[e.length-1];this.setSelectedUuids(new Set((0,r.Uuids)(e))),this.lastSelectedItem=t,this.enableMultipleSelectionMode()},this.deselectAll=()=>{this.selectedUuids.clear(),this.setSelectedUuids(this.selectedUuids),this.lastSelectedItem=void 0},this.openSingleSelectedItem=async function(){let{userTriggered:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{userTriggered:!0};if(1===m.selectedItemsCount){const t=m.firstSelectedItem;t.content_type===r.ContentType.TYPES.Note?await m.openNote(t.uuid):t.content_type===r.ContentType.TYPES.File&&await m.openFile(t.uuid),m.paneController.isInMobileView&&!e||m.paneController.setPaneLayout(mt.h.Editing),m.paneController.isInMobileView&&e&&Yt()}},this.enableMultipleSelectionMode=()=>{this.isMultipleSelectionMode=!0},this.selectItem=async(e,n)=>{const i=this.itemManager.findItem(e);if(!i)return{didSelect:!1};V(R.Selection,"Select item",i.uuid);const o=this.keyboardService.activeModifiers.has(r.KeyboardModifier.Shift),s=this.selectedItemsCount>1,a=await this.protections.authorizeItemAccess(i);return n&&o&&!(0,t.Av)()?await this.selectItemsRange({selectedItem:i}):n&&this.isMultipleSelectionMode?this.selectedUuids.has(e)&&s?this.removeSelectedItem(e):a&&(this.selectedUuids.add(e),this.setSelectedUuids(this.selectedUuids),this.lastSelectedItem=i):(s||!this.selectedUuids.has(e))&&a&&(this.replaceSelection(i),await this.openSingleSelectedItem({userTriggered:null!=n&&n})),{didSelect:this.selectedUuids.has(e)}},this.selectItemWithScrollHandling=async(e,n)=>{let{userTriggered:r=!1,scrollIntoView:i=!0,animated:o=!0}=n;const{didSelect:s}=await this.selectItem(e.uuid,r),a=(0,t.Av)();s&&i&&!a&&this.scrollToItem(e,o)},this.scrollToItem=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=document.getElementById(e.uuid);null==n||n.scrollIntoView({behavior:t?"smooth":"auto"})},this.selectUuids=async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=m.itemManager.findItems(e).filter((e=>!(0,r.isFile)(e)));n.length<1||!t&&n.some((e=>e.protected&&(0,r.isFile)(e)))||(m.setSelectedUuids(new Set((0,r.Uuids)(n))),1===n.length&&m.openSingleSelectedItem({userTriggered:t}))},this.selectNextItem=function(){let{userTriggered:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{userTriggered:!0};const t=m.items;let n=t.findIndex((e=>{var t;return e.uuid===(null===(t=m.lastSelectedItem)||void 0===t?void 0:t.uuid)}))+1;for(;n<t.length;){const r=t[n];if(n++,r.protected)continue;m.selectItemWithScrollHandling(r,{userTriggered:e}).catch(console.error);const i=document.getElementById(r.uuid);return void(null==i||i.focus())}},this.selectPreviousItem=()=>{const e=this.items;if(!this.lastSelectedItem)return;let t=e.indexOf(this.lastSelectedItem)-1;for(;t>=0;){const n=e[t];if(t--,n.protected)continue;this.selectItemWithScrollHandling(n,{userTriggered:!0}).catch(console.error);const r=document.getElementById(n.uuid);return void(null==r||r.focus())}},(0,_.rC)(this,{completedFullSync:_.LO,displayOptions:_.LO.struct,webDisplayOptions:_.LO.struct,noteFilterText:_.LO,notes:_.LO,notesToDisplay:_.LO,panelTitle:_.LO,items:_.LO,renderedItems:_.LO,showDisplayOptionsMenu:_.LO,reloadItems:_.aD,reloadPanelTitle:_.aD,reloadDisplayPreferences:_.aD,resetPagination:_.aD,setCompletedFullSync:_.aD,setNoteFilterText:_.aD,setShowDisplayOptionsMenu:_.aD,onFilterEnter:_.aD,handleFilterTextChanged:_.aD,optionsSubtitle:_.Fl,activeControllerItem:_.Fl,selectedUuids:_.LO,selectedItems:_.LO,selectedItemsCount:_.Fl,selectedFiles:_.Fl,selectedFilesCount:_.Fl,firstSelectedItem:_.Fl,selectItem:_.aD,setSelectedUuids:_.aD,setSelectedItems:_.aD,hydrateFromPersistedValue:_.aD,isMultipleSelectionMode:_.LO,enableMultipleSelectionMode:_.aD,cancelMultipleSelection:_.aD}),g.addEventHandler(this,qe.TagChanged),g.addEventHandler(this,qe.ActiveEditorChanged),g.addEventHandler(this,L.FJ.VaultDisplayOptionsChanged),this.resetPagination(),this.disposers.push(s.streamItems([r.ContentType.TYPES.Note,r.ContentType.TYPES.File],(()=>{this.reloadItems(Ct.ItemStream)}))),this.disposers.push(s.streamItems([r.ContentType.TYPES.Tag,r.ContentType.TYPES.SmartView],(async e=>{let{changed:t,inserted:n}=e;const i=[...t,...n],{didReloadItems:o}=await this.reloadDisplayPreferences({userTriggered:!1});o||(this.reloadNotesDisplayOptions(),this.reloadItems(Ct.ItemStream)),this.navigationController.selected&&(0,r.findInArray)(i,"uuid",this.navigationController.selected.uuid)&&this.reloadPanelTitle()}))),g.addEventHandler(this,r.ApplicationEvent.PreferencesChanged),g.addEventHandler(this,r.ApplicationEvent.SignedIn),g.addEventHandler(this,r.ApplicationEvent.CompletedFullSync),g.addEventHandler(this,r.WebAppEvent.EditorDidFocus),this.disposers.push((0,_.U5)((()=>[this.searchOptionsController.includeProtectedContents,this.searchOptionsController.includeArchived,this.searchOptionsController.includeTrashed]),(()=>{this.reloadNotesDisplayOptions(),this.reloadItems(Ct.DisplayOptionsChange)}))),this.disposers.push((0,_.U5)((()=>this.selectedUuids),(()=>{g.publish({type:qe.RequestValuePersistence,payload:void 0})}))),this.disposers.push(this.itemManager.streamItems([r.ContentType.TYPES.Note,r.ContentType.TYPES.File],(e=>{let{changed:t,inserted:n,removed:r}=e;(0,_.z)((()=>{for(const e of r)this.removeSelectedItem(e.uuid);for(const e of[...t,...n])this.selectedItems[e.uuid]&&(this.selectedItems[e.uuid]=e)}))}))),this.disposers.push((0,_.U5)((()=>this.selectedItemsCount),((e,t)=>{(0===e||t>e&&1===e)&&this.cancelMultipleSelection()}))),window.onresize=(0,t.Ds)((()=>{this.resetPagination(!0)}),100)}async handleEvent(e){switch(e.type){case qe.TagChanged:{const t=e.payload;await this.handleTagChange(t.userTriggered);break}case qe.ActiveEditorChanged:await this.handleEditorChange();break;case L.FJ.VaultDisplayOptionsChanged:this.reloadItems(Ct.DisplayOptionsChange);break;case r.ApplicationEvent.PreferencesChanged:this.reloadDisplayPreferences({userTriggered:!1});break;case r.WebAppEvent.EditorDidFocus:this.setShowDisplayOptionsMenu(!1);break;case r.ApplicationEvent.SignedIn:this.itemControllerGroup.closeAllItemControllers(),this.selectFirstItem(),this.setCompletedFullSync(!1);break;case r.ApplicationEvent.CompletedFullSync:if(!this.completedFullSync){this.reloadItems(Ct.SyncEvent).then((()=>{var e;0===this.notes.length&&this.navigationController.selected instanceof r.SmartView&&this.navigationController.selected.uuid===r.SystemViewId.AllNotes&&""===this.noteFilterText&&!this.getActiveItemController()&&(null===(e=this.createPlaceholderNote())||void 0===e||e.catch(console.error))})),this.setCompletedFullSync(!0);break}}}get listLength(){return this.renderedItems.length}getActiveItemController(){return this.itemControllerGroup.activeItemViewController}get activeControllerItem(){var e;return null===(e=this.getActiveItemController())||void 0===e?void 0:e.item}async openNote(e){var t;if((null===(t=this.activeControllerItem)||void 0===t?void 0:t.uuid)===e)return;const n=this.itemManager.findItem(e);n?(await this.itemControllerGroup.createItemController({note:n}),await this.publishCrossControllerEventSync(qe.ActiveEditorChanged)):console.warn("Tried accessing a non-existant note of UUID "+e)}async openFile(e){var t;if((null===(t=this.getActiveItemController())||void 0===t?void 0:t.item.uuid)===e)return;const n=this.itemManager.findItem(e);n?await this.itemControllerGroup.createItemController({file:n}):console.warn("Tried accessing a non-existant file of UUID "+e)}get isFiltering(){return!!this.noteFilterText&&this.noteFilterText.length>0}async performReloadItems(e){if(!this.navigationController.selected)return;const t=this.itemManager.getDisplayableNotes(),n=this.itemManager.getDisplayableNotesAndFiles(),r=n.slice(0,this.notesToDisplay);(0,_.z)((()=>{this.notes=t,this.items=n,this.renderedItems=r})),await this.recomputeSelectionAfterItemsReload(e),this.reloadPanelTitle()}async recomputeSelectionAfterItemsReload(e){const n=this.getActiveItemController();if(this.shouldLeaveSelectionUnchanged(n))return void V(R.Selection,"Leaving selection unchanged");const r=null==n?void 0:n.item;if(n&&r&&this.shouldCloseActiveItem(r,e)){if(this.closeItemController(n),this.deselectItem(r),this.shouldSelectFirstItem(e)){if(this.isTableViewEnabled&&!(0,t.Av)())return;V(R.Selection,"Selecting next item after closing active one"),this.selectNextItem({userTriggered:!1})}}else r&&this.shouldSelectActiveItem(r)?(V(R.Selection,"Selecting active item"),await this.selectItem(r.uuid).catch(console.error)):this.shouldSelectFirstItem(e)?await this.selectFirstItem():this.shouldSelectNextItemOrCreateNewNote(r)?await this.selectNextItemOrCreateNewNote():V(R.Selection,"No selection change")}async createNewNoteController(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"editor";const i=this.navigationController.selected,o=i instanceof r.SNTag?i.uuid:void 0;return this.itemControllerGroup.createItemController({templateOptions:{title:e,tag:o,createdAt:t,autofocusBehavior:n,vault:this.vaultDisplayService.exclusivelyShownVault}})}get optionsSubtitle(){return this.displayOptions.includePinned||this.displayOptions.includeProtected?this.displayOptions.includePinned?this.displayOptions.includeProtected?void 0:"Excluding protected":"Excluding pinned":"Excluding pinned and protected"}get notesListScrollContainer(){return document.getElementById("notes-scrollable")}closeItemController(e){V(R.Selection,"Closing item controller",e.runtimeId),this.itemControllerGroup.closeItemController(e)}get isCurrentNoteTemplate(){const e=this.getActiveItemController();return!!e&&e instanceof Bt&&e.isTemplateNote}async insertCurrentIfTemplate(){const e=this.getActiveItemController();e&&e instanceof Bt&&e.isTemplateNote&&await e.insertTemplatedNote()}get selectedItemsCount(){return Object.keys(this.selectedItems).length}get selectedFiles(){return this.getFilteredSelectedItems(r.ContentType.TYPES.File)}get selectedFilesCount(){return this.selectedFiles.length}get firstSelectedItem(){return Object.values(this.selectedItems)[0]}}class Zt extends De.L{constructor(e,t){var n;super(t),this.sessions=e,this.hide=()=>{this.show=!1,L.tO.set(L.Qt.ShowNoAccountWarning,!1)},this.reset=()=>{L.tO.remove(L.Qt.ShowNoAccountWarning)},this.show=!e.isSignedIn()&&(null===(n=L.tO.get(L.Qt.ShowNoAccountWarning))||void 0===n||n),t.addEventHandler(this,r.ApplicationEvent.SignedIn),t.addEventHandler(this,r.ApplicationEvent.Started),(0,_.rC)(this,{show:_.LO,hide:_.aD})}async handleEvent(e){switch(e.type){case r.ApplicationEvent.SignedIn:(0,_.z)((()=>{this.show=!1}));break;case r.ApplicationEvent.Started:this.sessions.isSignedIn()&&(0,_.z)((()=>{this.show=!1}))}}}var Wt,qt=s(38318);class Jt extends De.L{deinit(){super.deinit(),this.notesAndTags=void 0,(0,t.h6)(this)}constructor(e,t,n){super(n),this.items=e,this._getHost=t,this.show=!1,this.signingOut=!1,this.otherSessionsSignOut=!1,this.server=void 0,this.notesAndTags=[],this.isEncryptionEnabled=!1,this.encryptionStatusString="",this.isBackupEncrypted=!1,this.showSignIn=!1,this.deletingAccount=!1,this.showRegister=!1,this.currentPane=qt.V.GeneralMenu,this.setShow=e=>{this.show=e,e&&this.setCurrentPane(qt.V.GeneralMenu)},this.closeAccountMenu=()=>{this.setShow(!1)},this.setSigningOut=e=>{this.signingOut=e},this.setServer=e=>{this.server=e},this.setIsEncryptionEnabled=e=>{this.isEncryptionEnabled=e},this.setEncryptionStatusString=e=>{this.encryptionStatusString=e},this.setIsBackupEncrypted=e=>{this.isBackupEncrypted=e},this.setShowSignIn=e=>{this.showSignIn=e},this.setShowRegister=e=>{this.showRegister=e},this.toggleShow=()=>{this.show?this.closeAccountMenu():this.setShow(!0)},this.setOtherSessionsSignOut=e=>{this.otherSessionsSignOut=e},this.setCurrentPane=e=>{this.currentPane=e},this.setDeletingAccount=e=>{this.deletingAccount=e},(0,_.rC)(this,{show:_.LO,signingOut:_.LO,otherSessionsSignOut:_.LO,server:_.LO,notesAndTags:_.LO,isEncryptionEnabled:_.LO,encryptionStatusString:_.LO,isBackupEncrypted:_.LO,showSignIn:_.LO,deletingAccount:_.LO,showRegister:_.LO,currentPane:_.LO,setShow:_.aD,toggleShow:_.aD,setSigningOut:_.aD,setIsEncryptionEnabled:_.aD,setEncryptionStatusString:_.aD,setIsBackupEncrypted:_.aD,setOtherSessionsSignOut:_.aD,setCurrentPane:_.aD,setServer:_.aD,setDeletingAccount:_.aD,notesAndTagsCount:_.Fl}),n.addEventHandler(this,r.ApplicationEvent.Launched),this.disposers.push(this.items.streamItems([r.ContentType.TYPES.Note,r.ContentType.TYPES.Tag],(()=>{(0,_.z)((()=>{this.notesAndTags=this.items.getItems([r.ContentType.TYPES.Note,r.ContentType.TYPES.Tag])}))})))}async handleEvent(e){e.type===r.ApplicationEvent.Launched&&(0,_.z)((()=>{this.setServer(this._getHost.execute().getValue())}))}get notesAndTagsCount(){return this.notesAndTags.length}}class Xt extends De.L{constructor(e,t,n,i){super(i),this.subscriptions=e,this.sessions=t,this.features=n,this.ALLOWED_SUBSCRIPTION_INVITATIONS=5,this.subscriptionInvitations=void 0,this.onlineSubscription=void 0,this.hasAccount=t.isSignedIn(),(0,_.rC)(this,{subscriptionInvitations:_.LO,hasAccount:_.LO,onlineSubscription:_.LO,usedInvitationsCount:_.Fl,allowedInvitationsCount:_.Fl,allInvitationsUsed:_.Fl}),i.addEventHandler(this,r.ApplicationEvent.Launched),i.addEventHandler(this,r.ApplicationEvent.SignedIn),i.addEventHandler(this,r.ApplicationEvent.UserRolesChanged),i.addEventHandler(this,r.SubscriptionManagerEvent.DidFetchSubscription)}deinit(){super.deinit(),this.subscriptionInvitations=void 0,(0,t.h6)(this)}async handleEvent(e){switch(e.type){case r.ApplicationEvent.Launched:this.sessions.isSignedIn()&&this.reloadSubscriptionInvitations().catch(console.error),(0,_.z)((()=>{this.hasAccount=this.sessions.isSignedIn()}));break;case r.ApplicationEvent.SignedIn:this.reloadSubscriptionInvitations().catch(console.error),(0,_.z)((()=>{this.hasAccount=this.sessions.isSignedIn()}));break;case r.SubscriptionManagerEvent.DidFetchSubscription:(0,_.z)((()=>{this.onlineSubscription=this.subscriptions.getOnlineSubscription()}));break;case r.ApplicationEvent.UserRolesChanged:this.reloadSubscriptionInvitations().catch(console.error)}}hasFirstPartyOnlineOrOfflineSubscription(){const e=this.features.hasFirstPartyOfflineSubscription();return this.sessions.isSignedIn()&&this.sessions.isSignedIntoFirstPartyServer()&&!!this.subscriptions.getOnlineSubscription()||e}get usedInvitationsCount(){var e,t;return null!==(t=null===(e=this.subscriptionInvitations)||void 0===e?void 0:e.filter((e=>[r.InvitationStatus.Accepted,r.InvitationStatus.Sent].includes(e.status))).length)&&void 0!==t?t:0}get allowedInvitationsCount(){return this.ALLOWED_SUBSCRIPTION_INVITATIONS}get allInvitationsUsed(){return this.usedInvitationsCount===this.ALLOWED_SUBSCRIPTION_INVITATIONS}async sendSubscriptionInvitation(e){const t=await this.subscriptions.inviteToSubscription(e);return t&&await this.reloadSubscriptionInvitations(),t}async cancelSubscriptionInvitation(e){const t=await this.subscriptions.cancelInvitation(e);return t&&await this.reloadSubscriptionInvitations(),t}async reloadSubscriptionInvitations(){this.subscriptionInvitations=await this.subscriptions.listSubscriptionInvitations()}}!function(e){e[e.SignIn=0]="SignIn",e[e.CreateAccount=1]="CreateAccount"}(Wt||(Wt={}));class $t extends De.L{constructor(e,t,n,i,o,s,a,l){var c;super(l),c=this,this.sessions=e,this.subscriptions=t,this.legacyApi=n,this.alerts=i,this.mobileDevice=o,this._loadPurchaseFlowUrl=s,this._isNativeIOS=a,this.isOpen=!1,this.currentPane=Wt.CreateAccount,this.setCurrentPane=e=>{this.currentPane=e},this.openPurchaseFlow=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.AppleIAPProductId.ProPlanYearly;c.sessions.getUser()?c._isNativeIOS.execute().getValue()?await c.beginIosIapPurchaseFlow(e):await c._loadPurchaseFlowUrl.execute():c.isOpen=!0},this.openPurchaseWebpage=async()=>{const e=await this._loadPurchaseFlowUrl.execute();e.isFailed()&&(console.error(e.getError()),this.alerts.alert(e.getError()))},this.beginIosIapPurchaseFlow=async e=>{var t;const n=await(null===(t=this.mobileDevice)||void 0===t?void 0:t.purchaseSubscriptionIAP(e));if(V(R.Purchasing,"BeginIosIapPurchaseFlow result",n),!n)return void this.alerts.alert("Your purchase was canceled or failed. Please try again.");const r=()=>{this.alerts.alert("There was an error confirming your purchase. Please contact support at help@standardnotes.com.")};V(R.Purchasing,"Confirming result with our server");const i=await this.legacyApi.getNewSubscriptionToken();if(!i)return V(R.Purchasing,"Unable to generate subscription token"),void r();const o=await this.subscriptions.confirmAppleIAP(n,i);V(R.Purchasing,"Server confirm result",o),o?this.alerts.alert("Please allow a few minutes for your subscription benefits to activate. You will see a confirmation alert in the app when your subscription is ready.","Your purchase was successful!"):r()},this.closePurchaseFlow=()=>{this.isOpen=!1},(0,_.rC)(this,{isOpen:_.LO,currentPane:_.LO,setCurrentPane:_.aD,openPurchaseFlow:_.aD,closePurchaseFlow:_.aD})}}var en=s(47436);class tn extends De.L{deinit(){super.deinit(),this.note=void 0}constructor(e,t,n){super(n),this.note=void 0,this.setNote=e=>{this.note=e},this.openModal=e=>{this.setNote(e)},this.dismissModal=()=>{this.setNote(void 0)},(0,_.rC)(this,{note:_.LO,setNote:_.aD}),this.disposers.push(t.addCommandHandler({command:L.Ek,category:"Current note",description:"Open note history",onKeyDown:()=>(this.openModal(e.firstSelectedNote),!0)}))}}function nn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nn(Object(n),!0).forEach((function(t){on(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function on(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class sn extends De.L{constructor(e,t,n,i,o,s,a){super(a),this.importer=e,this.navigationController=t,this.items=n,this.mutator=i,this.linkingController=o,this.preferences=s,this.isVisible=!1,this.addImportsToTag=!1,this.shouldCreateTag=!0,this.existingTagForImports=void 0,this.files=[],this.importTag=void 0,this.setIsVisible=e=>{this.isVisible=e},this.setAddImportsToTag=e=>{this.preferences.setValue(It.PrefKey.AddImportsToTag,e).catch(console.error)},this.setShouldCreateTag=e=>{this.preferences.setValue(It.PrefKey.AlwaysCreateNewTagForImports,e).catch(console.error)},this.setExistingTagForImports=e=>{this.preferences.setValue(It.PrefKey.ExistingTagForImports,null==e?void 0:e.uuid).catch(console.error)},this.getImportFromFile=(e,t)=>({id:r.UuidGenerator.GenerateUuid(),file:e,service:t,status:"pending"}),this.setFiles=(e,t)=>{this.files=e.map((e=>this.getImportFromFile(e,t)))},this.addFiles=(e,t)=>{this.files=[...this.files,...e.map((e=>this.getImportFromFile(e,t)))]},this.updateFile=e=>{this.files=this.files.map((t=>t.id===e.id?e:t))},this.removeFile=e=>{this.files=this.files.filter((t=>t.id!==e))},this.setImportTag=e=>{this.importTag=e},this.close=()=>{this.setIsVisible(!1),this.importTag&&this.navigationController.setSelectedTag(this.importTag,"all",{userTriggered:!0}).catch(console.error),this.setFiles([]),this.setImportTag(void 0)},this.parseAndImport=async()=>{if(0===this.files.length)return;const e=[];for(const t of this.files){if(!t.service)return;this.updateFile(rn(rn({},t),{},{status:"parsing"}));try{const{successful:n,errored:r}=await this.importer.importFromFile(t.file,t.service);e.push(...n),this.updateFile(rn(rn({},t),{},{status:"finished",successful:n,errored:r}))}catch(e){this.updateFile(rn(rn({},t),{},{status:"error",error:e instanceof Error?e:new Error("Could not import file")})),console.error(e)}}if(e.length&&this.addImportsToTag){const t=new Date;let n;if(this.shouldCreateTag){const i=this.items.createTemplateItem(r.ContentType.TYPES.Tag,{title:"Imported on ".concat(t.toLocaleString()),expanded:!1,iconString:"",references:e.filter((e=>e.content_type===r.ContentType.TYPES.Note)).map((e=>({content_type:r.ContentType.TYPES.Note,uuid:e.uuid})))});n=await this.mutator.insertItem(i)}else if(this.existingTagForImports)try{const t=this.items.findSureItem(this.existingTagForImports.uuid);await Promise.all(e.filter((e=>e.content_type===r.ContentType.TYPES.Note)).map((async e=>{const n=this.items.findSureItem(e.uuid);await this.linkingController.addTagToItem(t,n,!1)}))),n=this.items.findSureItem(this.existingTagForImports.uuid)}catch(e){console.error(e)}n&&this.setImportTag(n)}},(0,_.rC)(this,{isVisible:_.LO,setIsVisible:_.aD,addImportsToTag:_.LO,setAddImportsToTag:_.aD,shouldCreateTag:_.LO,setShouldCreateTag:_.aD,existingTagForImports:_.LO,setExistingTagForImports:_.aD,files:_.LO,setFiles:_.aD,addFiles:_.aD,updateFile:_.aD,removeFile:_.aD,importTag:_.LO,setImportTag:_.aD}),this.disposers.push(s.addEventObserver((e=>{e===r.PreferencesServiceEvent.PreferencesChanged&&(0,_.z)((()=>{this.addImportsToTag=s.getValue(It.PrefKey.AddImportsToTag,It.PrefDefaults[It.PrefKey.AddImportsToTag]),this.shouldCreateTag=s.getValue(It.PrefKey.AlwaysCreateNewTagForImports,It.PrefDefaults[It.PrefKey.AlwaysCreateNewTagForImports]);const e=s.getValue(It.PrefKey.ExistingTagForImports);this.existingTagForImports=e?this.items.findItem(e):void 0}))})))}}class an{constructor(e,t,n,r,i,o,s,a,l,c,u){this.application=e,this.routeService=t,this.purchaseFlowController=n,this.accountMenuController=r,this.preferencesController=i,this.syncStatusController=o,this.syncClient=s,this.sessionManager=a,this.subscriptionManager=l,this.toastService=c,this.userService=u}async handle(e){switch(e){case r.ApplicationEvent.Launched:{const e=this.routeService.getRoute();switch(e.type){case L.Yt.Purchase:this.purchaseFlowController.openPurchaseFlow();break;case L.Yt.Settings:if(void 0===this.sessionManager.getUser()){this.promptUserSignIn();break}this.preferencesController.openPreferences(),this.preferencesController.setCurrentPane(e.settingsParams.panel);break;case L.Yt.AcceptSubscriptionInvite:if(void 0===this.sessionManager.getUser()){this.promptUserSignIn();break}await this.acceptSubscriptionInvitation(e);break;case L.Yt.UserRequest:if(void 0===this.sessionManager.getUser()){this.promptUserSignIn();break}await this.sendUserRequest(e)}}break;case r.ApplicationEvent.SignedIn:{const e=this.routeService.getRoute();switch(e.type){case L.Yt.Settings:this.preferencesController.openPreferences(),this.preferencesController.setCurrentPane(e.settingsParams.panel);break;case L.Yt.AcceptSubscriptionInvite:await this.acceptSubscriptionInvitation(e);break;case L.Yt.UserRequest:await this.sendUserRequest(e)}}break;case r.ApplicationEvent.SyncStatusChanged:this.syncStatusController.update(this.syncClient.getSyncStatus());break;case r.ApplicationEvent.LocalDataLoaded:this.application.isNativeMobileWeb()&&this.application.handleInitialMobileScreenshotPrivacy()}}promptUserSignIn(){this.accountMenuController.setShow(!0),this.accountMenuController.setCurrentPane(qt.V.SignIn)}async acceptSubscriptionInvitation(e){const t=this.toastService.showToast(Y.pC.Loading,"Accepting invitation..."),n=await this.subscriptionManager.acceptInvitation(e.subscriptionInviteParams.inviteUuid);this.toastService.hideToast(t);const r=n.success?Y.pC.Success:Y.pC.Error,i=n.success?"Successfully joined a shared subscription.":n.message;this.toastService.showToast(r,i),this.routeService.removeQueryParameterFromURL(L.YX.AcceptSubscriptionInvite)}async sendUserRequest(e){const t=this.toastService.showToast(Y.pC.Loading,"Processing your request..."),n=await this.userService.submitUserRequest(e.userRequestParams.requestType);this.toastService.hideToast(t);const r=n?Y.pC.Success:Y.pC.Error,i=n?"We have received your request. Please check your email for further instructions.":"We could not process your request. Please try again or contact support if the issue persists.";this.toastService.showToast(r,i),this.routeService.removeQueryParameterFromURL(L.YX.UserRequest)}}class ln extends De.L{constructor(e,t){super(t),this.protections=e,this.includeProtectedContents=!1,this.includeArchived=!1,this.includeTrashed=!1,this.toggleIncludeArchived=()=>{this.includeArchived=!this.includeArchived},this.toggleIncludeTrashed=()=>{this.includeTrashed=!this.includeTrashed},this.refreshIncludeProtectedContents=()=>{this.includeProtectedContents=this.protections.hasUnprotectedAccessSession()},this.toggleIncludeProtectedContents=async()=>{this.includeProtectedContents?this.includeProtectedContents=!1:(await this.protections.authorizeSearchingProtectedNotesText(),(0,_.z)((()=>{this.refreshIncludeProtectedContents()})))},(0,_.rC)(this,{includeProtectedContents:_.LO,includeTrashed:_.LO,includeArchived:_.LO,toggleIncludeArchived:_.aD,toggleIncludeTrashed:_.aD,toggleIncludeProtectedContents:_.aD,refreshIncludeProtectedContents:_.aD}),t.addEventHandler(this,r.ApplicationEvent.UnprotectedSessionBegan),t.addEventHandler(this,r.ApplicationEvent.UnprotectedSessionExpired)}async handleEvent(e){(e.type===r.ApplicationEvent.UnprotectedSessionBegan||e.type===r.ApplicationEvent.UnprotectedSessionExpired)&&this.refreshIncludeProtectedContents()}}var cn=s(87978),un=s(57751);class dn extends De.L{constructor(e,t,n,i,o,s,a,l,c,u,d,h,p){var f;super(p),f=this,this.itemListController=e,this.filesController=t,this.subscriptionController=n,this.navigationController=i,this.featuresController=o,this.itemControllerGroup=s,this.vaultDisplayService=a,this.preferences=l,this.items=c,this.mutator=u,this.sync=d,this.vaults=h,this.isLinkingPanelOpen=!1,this.setIsLinkingPanelOpen=e=>{this.isLinkingPanelOpen=e},this.getFilesLinksForItem=e=>{if(!e||this.items.isTemplateItem(e))return{filesLinkedToItem:[],filesLinkingToItem:[]};const t=(0,r.naturalSort)(this.items.referencesForItem(e).filter(r.isFile),"title"),n=(0,r.naturalSort)(this.items.itemsReferencingItem(e).filter(r.isFile),"title");return e.content_type===r.ContentType.TYPES.File?{filesLinkedToItem:t.map((e=>(0,un.X)(e,"linked"))),filesLinkingToItem:n.map((e=>(0,un.X)(e,"linked-by")))}:{filesLinkedToItem:n.map((e=>(0,un.X)(e,"linked"))),filesLinkingToItem:t.map((e=>(0,un.X)(e,"linked-by")))}},this.getLinkedTagsForItem=e=>{if(e)return this.items.getSortedTagsForItem(e).map((e=>(0,un.X)(e,"linked")))},this.getLinkedNotesForItem=e=>!e||this.items.isTemplateItem(e)?[]:(0,r.naturalSort)(this.items.referencesForItem(e).filter(r.isNote),"title").map((e=>(0,un.X)(e,"linked"))),this.getNotesLinkingToItem=e=>e?(0,r.naturalSort)(this.items.itemsReferencingItem(e).filter(r.isNote),"title").map((e=>(0,un.X)(e,"linked-by"))):[],this.activateItem=async e=>{if(this.setIsLinkingPanelOpen(!1),e instanceof r.SNTag)return await this.navigationController.setSelectedTag(e,"all"),$e.n.Items;if(e instanceof r.SNNote){await this.navigationController.selectHomeNavigationView();const{didSelect:t}=await this.itemListController.selectItem(e.uuid,!0);if(t)return $e.n.Editor}else e instanceof r.FileItem&&await this.filesController.handleFileAction({type:cn.d.PreviewFile,payload:{file:e,otherFiles:[]}})},this.unlinkItems=async(e,t)=>{try{await this.mutator.unlinkItems(e,t)}catch(e){console.error(e)}this.sync.sync()},this.unlinkItemFromSelectedItem=async e=>{const t=this.itemListController.firstSelectedItem;t&&this.unlinkItems(t,e)},this.ensureActiveItemIsInserted=async()=>{const e=this.itemListController.getActiveItemController();e instanceof Bt&&e.isTemplateNote&&await e.insertTemplatedNote()},this.linkItems=async function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];var i;const o=async(e,t)=>{const n=await f.mutator.associateFileWithNote(t,e);if(f.featuresController.isVaultsEnabled()&&n){const r=f.vaults.getItemVault(e),i=f.vaults.getItemVault(n);if(r&&!i){const e=await f.vaults.moveItemToVault(r,t);e.isFailed()&&console.error(e.getError())}}};if((0,r.isNote)(e)){if((0,r.isNote)(t)&&!f.isEntitledToNoteLinking)return void f.publishCrossControllerEventSync(qe.DisplayPremiumModal,{featureName:"Note linking"});if(e.uuid===(null===(i=f.activeItem)||void 0===i?void 0:i.uuid)&&await f.ensureActiveItemIsInserted(),(0,r.isFile)(t))await o(e,t);else if((0,r.isNote)(t))await(async(e,t)=>{await f.mutator.linkNoteToNote(e,t)})(e,t);else{if(!(0,r.isTag)(t))throw Error("Invalid item type");await(async(e,t)=>{await f.addTagToItem(e,t,n)})(t,e)}}else{if(!(0,r.isFile)(e))throw new Error("First item must be a note or file");if((0,r.isNote)(t))await o(t,e);else if((0,r.isFile)(t))await(async(e,t)=>{await f.mutator.linkFileToFile(e,t)})(e,t);else{if(!(0,r.isTag)(t))throw Error("Invalid item to link");await(async(e,t)=>{await f.addTagToItem(e,t,n)})(t,e)}}n&&f.sync.sync()},this.linkItemToSelectedItem=async e=>{if(!this.isEntitledToNoteLinking&&e instanceof r.SNNote)return this.publishCrossControllerEventSync(qe.DisplayPremiumModal,{featureName:"Note linking"}),!1;await this.ensureActiveItemIsInserted();const t=this.activeItem;return!!t&&(await this.linkItems(t,e),!0)},this.createAndAddNewTag=async e=>{await this.ensureActiveItemIsInserted();const t=this.vaultDisplayService.exclusivelyShownVault,n=await this.mutator.findOrCreateTag(e,t),r=this.activeItem;if(r){const e=this.vaults.getItemVault(r);if(e){const t=await this.vaults.moveItemToVault(e,n);if(t.isFailed())throw new Error("Failed to move tag to item vault: ".concat(t.getError()));const i=t.getValue();await this.addTagToItem(i,r)}else await this.addTagToItem(n,r)}return n},this.addTagToItem=async function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];t instanceof r.SNNote?await f.mutator.addTagToNote(t,e,f.shouldLinkToParentFolders):t instanceof r.FileItem&&await f.mutator.addTagToFile(t,e,f.shouldLinkToParentFolders),n&&f.sync.sync().catch(console.error)},(0,_.rC)(this,{isLinkingPanelOpen:_.LO,isEntitledToNoteLinking:_.Fl,setIsLinkingPanelOpen:_.aD}),this.shouldLinkToParentFolders=l.getValue(r.PrefKey.NoteAddToParentFolders,r.PrefDefaults[r.PrefKey.NoteAddToParentFolders]),p.addEventHandler(this,r.ApplicationEvent.PreferencesChanged)}handleEvent(e){return e.type===r.ApplicationEvent.PreferencesChanged&&(this.shouldLinkToParentFolders=this.preferences.getValue(r.PrefKey.NoteAddToParentFolders,r.PrefDefaults[r.PrefKey.NoteAddToParentFolders])),Promise.resolve()}get isEntitledToNoteLinking(){return this.subscriptionController.hasFirstPartyOnlineOrOfflineSubscription()}get activeItem(){var e;return null===(e=this.itemControllerGroup.activeItemViewController)||void 0===e?void 0:e.item}}class hn{constructor(){this.inProgress=!1,this.errorMessage=void 0,this.humanReadablePercentage=void 0,this.update=e=>{var t;this.errorMessage=null===(t=e.error)||void 0===t?void 0:t.message,this.inProgress=e.syncInProgress;const n=e.getStats(),r=0===n.uploadCompletionCount?0:n.uploadCompletionCount/n.uploadTotalCount;this.humanReadablePercentage=0===r?void 0:r.toLocaleString(void 0,{style:"percent"})},(0,_.rC)(this,{inProgress:_.LO,errorMessage:_.LO,humanReadablePercentage:_.LO,update:_.aD})}}class pn{constructor(){this.hiddenSections={},this.toggleSectionVisibility=e=>{this.hiddenSections[e]=!this.hiddenSections[e]},this.reset=()=>{this.hiddenSections={}},(0,_.rC)(this,{hiddenSections:_.LO,toggleSectionVisibility:_.aD,reset:_.aD})}}class fn{constructor(e,t){this.item=e,this.items=t,this.dealloced=!1,this.runtimeId="".concat(Math.random())}deinit(){var e;this.dealloced=!0,null===(e=this.removeStreamObserver)||void 0===e||e.call(this),this.removeStreamObserver=void 0,this.item=void 0}async initialize(){this.streamItems()}streamItems(){this.removeStreamObserver=this.items.streamItems(_t.ContentType.TYPES.File,(e=>{let{changed:t,inserted:n}=e;if(this.dealloced)return;const r=t.concat(n).find((e=>e.uuid===this.item.uuid));r&&(this.item=r)}))}}class gn{constructor(e,t,n,r,i,o,s,a){this.items=e,this.mutator=t,this.sync=n,this.sessions=r,this.preferences=i,this.components=o,this.alerts=s,this._isNativeMobileWeb=a,this.itemControllers=[],this.changeObservers=[],this.eventObservers=[]}deinit(){this.items=void 0,this.eventObservers.forEach((e=>{e()})),this.changeObservers.length=0;for(const e of this.itemControllers)this.closeItemController(e,{notify:!1});this.itemControllers.length=0}async createItemController(e){let t;if(this.activeItemViewController&&this.closeItemController(this.activeItemViewController,{notify:!1}),e.file)t=new fn(e.file,this.items);else if(e.note)t=new Bt(e.note,this.items,this.mutator,this.sync,this.sessions,this.preferences,this.components,this.alerts,this._isNativeMobileWeb);else{if(!e.templateOptions)throw Error("Invalid input to createItemController");t=new Bt(void 0,this.items,this.mutator,this.sync,this.sessions,this.preferences,this.components,this.alerts,this._isNativeMobileWeb,e.templateOptions)}return this.itemControllers.push(t),await t.initialize(),this.notifyObservers(),t}closeItemController(e){let{notify:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{notify:!0};e instanceof Bt&&e.syncOnlyIfLargeNote(),e.deinit(),(0,Q.removeFromArray)(this.itemControllers,e),t&&this.notifyObservers()}closeActiveItemController(){const e=this.activeItemViewController;e&&this.closeItemController(e,{notify:!0})}closeAllItemControllers(){for(const e of this.itemControllers)this.closeItemController(e,{notify:!1});this.notifyObservers()}get activeItemViewController(){return this.itemControllers[0]}addActiveControllerChangeObserver(e){this.changeObservers.push(e),this.activeItemViewController&&e(this.activeItemViewController);const t=this.changeObservers;return()=>{(0,Q.removeFromArray)(t,e)}}notifyObservers(){for(const e of this.changeObservers)e(this.activeItemViewController)}}class mn{constructor(e){this.application=e,this.listeners=new Set,this.handleNativeMobileWindowMessage=e=>{if(""!==e.origin&&null!=e.origin)return;const t=e.data;try{const e=JSON.parse(t),{messageType:n,reactNativeEvent:r,messageData:i}=e;if("event"===n&&r){const e=r;this.handleNativeEvent(e,i)}}catch(e){console.log("[MobileWebReceiver] Error parsing message from React Native",e)}},this.addReactListener=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)}),this.listenForNativeMobileEvents()}deinit(){this.application=void 0,window.removeEventListener("message",this.handleNativeMobileWindowMessage),document.removeEventListener("message",this.handleNativeMobileWindowMessage)}listenForNativeMobileEvents(){const e=window,t=document;e.addEventListener("message",this.handleNativeMobileWindowMessage),t.addEventListener("message",this.handleNativeMobileWindowMessage)}handleNativeEvent(e,t){switch(e){case r.ReactNativeToWebEvent.EnteringBackground:this.application.handleMobileEnteringBackgroundEvent();break;case r.ReactNativeToWebEvent.GainingFocus:this.application.handleMobileGainingFocusEvent();break;case r.ReactNativeToWebEvent.LosingFocus:this.application.handleMobileLosingFocusEvent();break;case r.ReactNativeToWebEvent.ResumingFromBackground:this.application.handleMobileResumingFromBackgroundEvent();break;case r.ReactNativeToWebEvent.AndroidBackButtonPressed:this.application.handleAndroidBackButtonPressed();break;case r.ReactNativeToWebEvent.ColorSchemeChanged:this.application.handleMobileColorSchemeChangeEvent();break;case r.ReactNativeToWebEvent.KeyboardFrameWillChange:this.application.handleMobileKeyboardWillChangeFrameEvent(t);break;case r.ReactNativeToWebEvent.KeyboardFrameDidChange:this.application.handleMobileKeyboardDidChangeFrameEvent(t);break;case r.ReactNativeToWebEvent.ReceivedFile:this.application.handleReceivedFileEvent(t);break;case r.ReactNativeToWebEvent.ReceivedText:this.application.handleReceivedTextEvent(t);break;case r.ReactNativeToWebEvent.ReceivedLink:this.application.handleReceivedLinkEvent(t);break;case r.ReactNativeToWebEvent.OpenFilePreview:this.application.handleOpenFilePreviewEvent(t)}this.listeners.forEach((t=>t(e)))}}class yn{constructor(){this.listeners=new Set}setFallbackListener(e){this.fallbackListener=e}addEventListener(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notifyEvent(){let e=!1;for(const t of Array.from(this.listeners).reverse()){if(t())return void(e=!0);e=!1}!e&&this.fallbackListener&&this.fallbackListener()}}class vn{constructor(e){this.environment=e,this._isNativeMobileWeb=new L.Ab(this.environment)}execute(){const e=this._isNativeMobileWeb.execute().getValue(),n=(0,t.Yu)()||e,i=(0,t.jb)()||e&&!(0,t.Av)(),o=(0,t.Av)()||e&&!i;if(i&&o)throw Error("isTablet and isMobile cannot both be true");return r.Result.ok({isTabletOrMobile:n,isTablet:i,isMobile:o})}}class An{constructor(e){this._isTabletOrMobileScreen=e}execute(e){const t=this._isTabletOrMobileScreen.execute().getValue();if(t.isTablet){if(e===mt.h.TagSelection||e===mt.h.TableView)return r.Result.ok([$e.n.Navigation,$e.n.Items]);if(e===mt.h.ItemSelection||e===mt.h.Editing)return r.Result.ok([$e.n.Items,$e.n.Editor])}else{if(!t.isMobile)return e===mt.h.TableView?r.Result.ok([$e.n.Navigation,$e.n.Items]):r.Result.ok([$e.n.Navigation,$e.n.Items,$e.n.Editor]);if(e===mt.h.TagSelection)return r.Result.ok([$e.n.Navigation]);if(e===mt.h.ItemSelection||e===mt.h.TableView)return r.Result.ok([$e.n.Navigation,$e.n.Items]);if(e===mt.h.Editing)return r.Result.ok([$e.n.Navigation,$e.n.Items,$e.n.Editor])}throw Error("Unhandled pane layout")}}class bn{constructor(e,t){this.application=e,this._getPurchaseFlowUrl=t}async execute(){var e;const t=await this._getPurchaseFlowUrl.execute();if(t.isFailed())return t;const n=t.getValue(),i=this.application.routeService.getRoute(),o=i.type===L.Yt.Purchase?i.purchaseParams:{period:null,plan:null},s=o.period?"&period=".concat(o.period):"",a=o.plan?"&plan=".concat(o.plan):"";if(n){const t="".concat(n).concat(s).concat(a);return this.application.isNativeMobileWeb()?this.application.mobileDevice.openUrl(t):this.application.environment===r.Environment.Desktop?null===(e=this.application.desktopDevice)||void 0===e||e.openUrl(t):window.open("","_blank").location=t,r.Result.ok()}return r.Result.fail("Could not load purchase flow URL.")}}class wn{constructor(e,t,n){this.application=e,this.legacyApi=t,this.isApplicationUsingThirdPartyHostUseCase=n}async execute(){const e=window.location.origin,n=(0,t.Z$)()?"standardnotes://":e,i=this.isApplicationUsingThirdPartyHostUseCase.execute();if(i.isFailed())return r.Result.fail(i.getError());const o=i.getValue();if(this.application.sessions.isSignedOut()||o)return r.Result.ok("".concat(window.purchaseUrl,"/offline?&success_url=").concat(n));const s=await this.legacyApi.getNewSubscriptionToken();return s?r.Result.ok("".concat(window.purchaseUrl,"?subscription_token=").concat(s,"&success_url=").concat(n)):r.Result.fail("Could not get purchase flow URL.")}}class Sn{constructor(e,t){this.application=e,this.legacyApi=t}async execute(){const e=await this.legacyApi.getNewSubscriptionToken();if(!e)return r.Result.fail("Could not get subscription token.");const t="".concat(window.dashboardUrl,"?subscription_token=").concat(e);return this.application.device.environment===r.Environment.Mobile?(this.application.device.openUrl(t),r.Result.ok()):this.application.device.environment===r.Environment.Desktop?(window.open(t,"_blank"),r.Result.ok()):(window.open("","_blank").location=t,r.Result.ok())}}class Cn extends Q.DependencyContainer{constructor(e){super(),this.application=e,this.bind(z.SuperConverter,(()=>new Be)),this.bind(z.Importer,(()=>new L.q_(e.features,e.mutator,e.items,this.get(z.SuperConverter),this.get(z.FilesController),this.get(z.LinkingController),e.generateUuid,e.files))),this.bind(z.IsNativeIOS,(()=>new L.WY(e.environment,e.platform))),this.bind(z.OpenSubscriptionDashboard,(()=>new Sn(e,e.legacyApi))),this.bind(z.IsNativeMobileWeb,(()=>new L.Ab(e.environment))),this.bind(z.IsGlobalSpellcheckEnabled,(()=>new L.P$(e.preferences))),this.bind(z.MobileWebReceiver,(()=>{if(e.isNativeMobileWeb())return new mn(e)})),this.bind(z.AndroidBackHandler,(()=>{if(e.isNativeMobileWeb())return new yn})),this.bind(z.ItemGroupController,(()=>new gn(e.items,e.mutator,e.sync,e.sessions,e.preferences,e.componentManager,e.alerts,this.get(z.IsNativeMobileWeb)))),this.bind(z.RouteService,(()=>new L.MZ(this.application,this.application.events))),this.bind(z.KeyboardService,(()=>new L.i8(e.platform,e.environment))),this.bind(z.ArchiveManager,(()=>new L.jB(e))),this.bind(z.ThemeManager,(()=>new L.Ve(e,e.preferences,e.componentManager,e.events))),this.bind(z.AutolockService,(()=>e.isNativeMobileWeb()?void 0:new L.BD(e,e.events))),this.bind(z.DesktopManager,(()=>(0,r.isDesktopDevice)(e.device)?new Oe(e,e.device,e.fileBackups):void 0)),this.bind(z.ChangelogService,(()=>new L.BQ(e.environment,e.storage))),this.bind(z.PluginsService,(()=>new L.zo(e.items,e.mutator,e.sync,e.legacyApi,e.alerts,e.options.crypto))),this.bind(z.IsMobileDevice,(()=>new L.hJ(this.get(z.IsNativeMobileWeb)))),this.bind(z.MomentsService,(()=>new Fe(this.get(z.FilesController),this.get(z.LinkingController),e.storage,e.preferences,e.items,e.protections,e.desktopDevice,this.get(z.IsMobileDevice),e.events))),this.bind(z.VaultDisplayService,(()=>new L.r9(e,e.events))),this.bind(z.PersistenceService,(()=>new Je(this.get(z.ItemListController),this.get(z.NavigationController),e.storage,e.items,e.sync,e.events))),this.bind(z.FilePreviewModalController,(()=>new Xe(e.items))),this.bind(z.PaneController,(()=>new ot(e.preferences,this.get(z.KeyboardService),this.get(z.IsTabletOrMobileScreen),this.get(z.PanesForLayout),e.events))),this.bind(z.PanesForLayout,(()=>new An(this.get(z.IsTabletOrMobileScreen)))),this.bind(z.GetHost,(()=>new r.GetHost(e.legacyApi))),this.bind(z.IsApplicationUsingThirdPartyHost,(()=>new r.IsApplicationUsingThirdPartyHost(this.get(z.GetHost)))),this.bind(z.IsTabletOrMobileScreen,(()=>new vn(e.environment))),this.bind(z.PreferencesController,(()=>new at(this.get(z.RouteService),e.events))),this.bind(z.FeaturesController,(()=>new dt(e.features,e.events))),this.bind(z.NavigationController,(()=>new wt(this.get(z.FeaturesController),this.get(z.VaultDisplayService),this.get(z.KeyboardService),this.get(z.PaneController),e.sync,e.mutator,e.items,e.preferences,e.alerts,e.changeAndSaveItem,e.events))),this.bind(z.NotesController,(()=>new St(this.get(z.ItemListController),this.get(z.NavigationController),this.get(z.ItemGroupController),this.get(z.KeyboardService),e.preferences,e.items,e.mutator,e.sync,e.protections,e.alerts,this.get(z.IsGlobalSpellcheckEnabled),this.get(z.GetItemTags),e.events))),this.bind(z.GetItemTags,(()=>new L.$e(e.items))),this.bind(z.SearchOptionsController,(()=>new ln(e.protections,e.events))),this.bind(z.LinkingController,(()=>new dn(this.get(z.ItemListController),this.get(z.FilesController),this.get(z.SubscriptionController),this.get(z.NavigationController),this.get(z.FeaturesController),this.get(z.ItemGroupController),this.get(z.VaultDisplayService),e.preferences,e.items,e.mutator,e.sync,e.vaults,e.events))),this.bind(z.ItemListController,(()=>new zt(this.get(z.KeyboardService),this.get(z.PaneController),this.get(z.NavigationController),this.get(z.SearchOptionsController),e.items,e.preferences,this.get(z.ItemGroupController),this.get(z.VaultDisplayService),this.get(z.DesktopManager),e.protections,e.options,this.get(z.IsNativeMobileWeb),e.changeAndSaveItem,e.events))),this.bind(z.NoAccountWarningController,(()=>new Zt(e.sessions,e.events))),this.bind(z.AccountMenuController,(()=>new Jt(e.items,e.getHost,e.events))),this.bind(z.SubscriptionController,(()=>new Xt(e.subscriptions,e.sessions,e.features,e.events))),this.bind(z.PurchaseFlowController,(()=>new $t(e.sessions,e.subscriptions,e.legacyApi,e.alerts,e.mobileDevice,this.get(z.LoadPurchaseFlowUrl),this.get(z.IsNativeIOS),e.events))),this.bind(z.LoadPurchaseFlowUrl,(()=>new bn(e,this.get(z.GetPurchaseFlowUrl)))),this.bind(z.GetPurchaseFlowUrl,(()=>new wn(e,e.legacyApi,this.get(z.IsApplicationUsingThirdPartyHost)))),this.bind(z.SyncStatusController,(()=>new hn)),this.bind(z.ActionsMenuController,(()=>new pn)),this.bind(z.FilesController,(()=>new en.y(this.get(z.NotesController),this.get(z.FilePreviewModalController),this.get(z.ArchiveManager),this.get(z.VaultDisplayService),e.vaults,e.items,e.files,e.mutator,e.sync,e.protections,e.alerts,e.platform,e.mobileDevice,this.get(z.IsNativeMobileWeb),e.events))),this.bind(z.HistoryModalController,(()=>new tn(this.get(z.NotesController),this.get(z.KeyboardService),e.events))),this.bind(z.ImportModalController,(()=>new sn(this.get(z.Importer),this.get(z.NavigationController),e.items,e.mutator,this.get(z.LinkingController),e.preferences,e.events))),this.bind(z.ToastService,(()=>new L.kl)),this.bind(z.ApplicationEventObserver,(()=>new an(e,e.routeService,this.get(z.PurchaseFlowController),this.get(z.AccountMenuController),this.get(z.PreferencesController),this.get(z.SyncStatusController),e.sync,e.sessions,e.subscriptions,this.get(z.ToastService),e.user)))}}class En extends r.SNApplication{constructor(e,t,n,i,o){super({environment:e.environment,platform:t,deviceInterface:e,crypto:I,alertService:new L.GW,identifier:n,defaultHost:i,appVersion:e.appVersion,webSocketUrl:o,apiVersion:t===r.Platform.Ios||t===r.Platform.Android?r.ApiVersion.v0:r.ApiVersion.v1,loadBatchSize:e.environment===r.Environment.Mobile?250:r.ApplicationOptionsDefaults.loadBatchSize,sleepBetweenBatches:e.environment===r.Environment.Mobile?250:r.ApplicationOptionsDefaults.sleepBetweenBatches,allowMultipleSelection:e.environment!==r.Environment.Mobile,allowNoteSelectionStatePersistence:e.environment!==r.Environment.Mobile,u2fAuthenticatorRegistrationPromptFunction:M,u2fAuthenticatorVerificationPromptFunction:F}),this.enableUnfinishedFeatures=null===window||void 0===window?void 0:window.enabledUnfinishedFeatures,this.deps=new Cn(this),this.webEventObservers=[],this.disposers=[],this.isSessionsModalVisible=!1,this.openSessionsModal=()=>{this.isSessionsModalVisible=!0},this.closeSessionsModal=()=>{this.isSessionsModalVisible=!1},this.addNativeMobileEventListener=e=>{if(this.mobileWebReceiver)return this.mobileWebReceiver.addReactListener(e)},(0,_.rC)(this,{dealloced:_.LO,preferencesController:_.Fl,isSessionsModalVisible:_.LO,openSessionsModal:_.aD,closeSessionsModal:_.aD}),this.createBackgroundServices()}createBackgroundServices(){var e=this;this.mobileWebReceiver,this.autolockService,this.persistence,this.environment!==r.Environment.Clipper&&this.themeManager,this.momentsService,this.routeService,t.r8&&(this.devMode=new G(this)),this.isNativeMobileWeb()||this.webOrDesktopDevice.setApplication(this);const n=this.deps.get(z.ApplicationEventObserver);this.disposers.push(this.addEventObserver(n.handle.bind(n))),this.isNativeMobileWeb()&&(this.disposers.push(this.addEventObserver((async e=>{this.mobileDevice.notifyApplicationEvent(e)}))),console.log=function(){e.mobileDevice.consoleLog(...arguments)}),(0,t.Z$)()||(this.visibilityObserver=new H((e=>{this.notifyWebEvent(e)})))}deinit(e,t){this.isNativeMobileWeb()||this.webOrDesktopDevice.removeApplication(this),super.deinit(e,t);for(const e of this.disposers)e();this.disposers.length=0,this.deps.deinit();try{this.webEventObservers.length=0,this.visibilityObserver&&(this.visibilityObserver.deinit(),this.visibilityObserver=void 0)}catch(e){console.error("Error while deiniting application",e)}}addWebEventObserver(e){return this.webEventObservers.push(e),()=>{(0,Q.removeFromArray)(this.webEventObservers,e)}}notifyWebEvent(e,t){for(const n of this.webEventObservers)n(e,t);this.events.publish({type:e,payload:t})}publishPanelDidResizeEvent(e,t,n){const i={panel:e,collapsed:n,width:t};this.notifyWebEvent(r.WebAppEvent.PanelResized,i)}get desktopDevice(){if((0,r.isDesktopDevice)(this.device))return this.device}getInternalFeatureService(){return r.InternalFeatureService.get()}isNativeIOS(){return this.deps.get(z.IsNativeIOS).execute().getValue()}get isMobileDevice(){return this.deps.get(z.IsMobileDevice).execute().getValue()}get hideOutboundSubscriptionLinks(){return this.isNativeIOS()}get mobileDevice(){return this.device}get webOrDesktopDevice(){return this.device}async checkForSecurityUpdate(){return this.protocolUpgradeAvailable()}performDesktopTextBackup(){var e;return null===(e=this.desktopManager)||void 0===e?void 0:e.saveDesktopBackup()}isGlobalSpellcheckEnabled(){return this.deps.get(z.IsGlobalSpellcheckEnabled).execute().getValue()}getItemTags(e){return this.items.itemsReferencingItem(e).filter((e=>e.content_type===r.ContentType.TYPES.Tag))}get version(){return this.device.appVersion}async toggleGlobalSpellcheck(){const e=this.isGlobalSpellcheckEnabled();return this.setPreference(r.PrefKey.EditorSpellcheck,!e)}async handleMobileEnteringBackgroundEvent(){await this.lockApplicationAfterMobileEventIfApplicable()}async handleMobileGainingFocusEvent(){}handleInitialMobileScreenshotPrivacy(){this.platform===r.Platform.Android&&(this.protections.getMobileScreenshotPrivacyEnabled()?this.mobileDevice.setAndroidScreenshotPrivacy(!0):this.mobileDevice.setAndroidScreenshotPrivacy(!1))}async handleMobileLosingFocusEvent(){this.protections.getMobileScreenshotPrivacyEnabled()&&this.mobileDevice.stopHidingMobileInterfaceFromScreenshots(),await this.lockApplicationAfterMobileEventIfApplicable()}async handleMobileResumingFromBackgroundEvent(){this.protections.getMobileScreenshotPrivacyEnabled()&&this.mobileDevice.hideMobileInterfaceFromScreenshots()}handleMobileColorSchemeChangeEvent(){this.themeManager.handleMobileColorSchemeChangeEvent()}handleMobileKeyboardWillChangeFrameEvent(e){e.contentHeight>0&&K(e.contentHeight,"px",!0),e.isFloatingKeyboard&&K(100,"vh",!0),this.notifyWebEvent(r.WebAppEvent.MobileKeyboardWillChangeFrame,e)}handleMobileKeyboardDidChangeFrameEvent(e){this.notifyWebEvent(r.WebAppEvent.MobileKeyboardDidChangeFrame,e)}handleOpenFilePreviewEvent(e){let{id:t}=e;const n=this.items.findItem(t);n&&this.filesController.handleFileAction({type:cn.d.PreviewFile,payload:{file:n}}).catch(console.error)}handleReceivedFileEvent(e){const n=this.filesController,r=(0,t.e1)(e.data,e.mimeType),i=new File([r],e.name,{type:e.mimeType});n.uploadNewFile(i).catch(console.error)}async handleReceivedTextEvent(e){let{text:t,title:n}=e;const i=n||this.itemListController.titleForNewNote(),o=this.items.createTemplateItem(r.ContentType.TYPES.Note,{title:i,text:t,references:[]}),s=await this.mutator.insertItem(o);this.itemListController.selectItem(s.uuid,!0).catch(console.error),(0,Y.fz)({type:Y.pC.Success,message:"Successfully created note from shared text"})}async handleReceivedLinkEvent(e){let{link:t,title:n}=e;const r=new URL(t).pathname.split("/"),i=r[r.length-1];if(i&&/\.(png|svg|webp|jpe?g)/.test(i)){const e=(0,Y.fz)({type:Y.pC.Loading,message:"Fetching image from link..."});try{const e=await fetch(t);if(!e.ok)throw new Error("".concat(e.status,": Could not fetch image"));const n=await e.blob(),r=new File([n],i,{type:n.type});this.filesController.uploadNewFile(r).catch(console.error)}catch(e){console.error(e)}finally{(0,Y.Xd)(e)}}else this.handleReceivedTextEvent({title:n,text:t}).catch(console.error)}async lockApplicationAfterMobileEventIfApplicable(){if(await this.protections.isLocked())return;const e=this.protections.hasBiometricsEnabled(),t=this.hasPasscode(),n=this.protections.getMobilePasscodeTiming(),i=this.protections.getMobileBiometricsTiming(),o=t&&n===r.MobileUnlockTiming.Immediately,s=e&&i===r.MobileUnlockTiming.Immediately;o?await this.lock():s&&this.protections.softLockBiometrics()}handleAndroidBackButtonPressed(){void 0!==this.androidBackHandler&&this.androidBackHandler.notifyEvent()}addAndroidBackHandlerEventListener(e){if(void 0!==this.androidBackHandler)return this.androidBackHandler.addEventListener(e)}setAndroidBackHandlerFallbackListener(e){void 0!==this.androidBackHandler&&this.androidBackHandler.setFallbackListener(e)}isAuthorizedToRenderItem(e){return!e.protected||!this.hasProtectionSources()||this.protections.hasUnprotectedAccessSession()}entitledToPerTagPreferences(){return this.hasValidFirstPartySubscription()}get entitledToFiles(){return this.featuresController.entitledToFiles}showPremiumModal(e){this.featuresController.showPremiumAlert(e)}hasValidFirstPartySubscription(){return this.subscriptionController.hasFirstPartyOnlineOrOfflineSubscription()}async openPurchaseFlow(){await this.purchaseFlowController.openPurchaseFlow()}showAccountMenu(){this.accountMenuController.setShow(!0)}hideAccountMenu(){this.accountMenuController.setShow(!1)}get isFullU2FClient(){return this.environment===r.Environment.Web}openPreferences(e){this.preferencesController.openPreferences(),e&&this.preferencesController.setCurrentPane(e)}generateUUID(){return this.options.crypto.generateUUID()}get routeService(){return this.deps.get(z.RouteService)}get androidBackHandler(){return this.deps.get(z.AndroidBackHandler)}get vaultDisplayService(){return this.deps.get(z.VaultDisplayService)}get desktopManager(){return this.deps.get(z.DesktopManager)}get autolockService(){return this.deps.get(z.AutolockService)}get archiveService(){return this.deps.get(z.ArchiveManager)}get paneController(){return this.deps.get(z.PaneController)}get linkingController(){return this.deps.get(z.LinkingController)}get changelogService(){return this.deps.get(z.ChangelogService)}get pluginsService(){return this.deps.get(z.PluginsService)}get momentsService(){return this.deps.get(z.MomentsService)}get themeManager(){return this.deps.get(z.ThemeManager)}get keyboardService(){return this.deps.get(z.KeyboardService)}get featuresController(){return this.deps.get(z.FeaturesController)}get filesController(){return this.deps.get(z.FilesController)}get filePreviewModalController(){return this.deps.get(z.FilePreviewModalController)}get notesController(){return this.deps.get(z.NotesController)}get importModalController(){return this.deps.get(z.ImportModalController)}get navigationController(){return this.deps.get(z.NavigationController)}get historyModalController(){return this.deps.get(z.HistoryModalController)}get syncStatusController(){return this.deps.get(z.SyncStatusController)}get itemListController(){return this.deps.get(z.ItemListController)}get importer(){return this.deps.get(z.Importer)}get subscriptionController(){return this.deps.get(z.SubscriptionController)}get purchaseFlowController(){return this.deps.get(z.PurchaseFlowController)}get persistence(){return this.deps.get(z.PersistenceService)}get itemControllerGroup(){return this.deps.get(z.ItemGroupController)}get noAccountWarningController(){return this.deps.get(z.NoAccountWarningController)}get searchOptionsController(){return this.deps.get(z.SearchOptionsController)}get openSubscriptionDashboard(){return this.deps.get(z.OpenSubscriptionDashboard)}get mobileWebReceiver(){return this.deps.get(z.MobileWebReceiver)}get accountMenuController(){return this.deps.get(z.AccountMenuController)}get preferencesController(){return this.deps.get(z.PreferencesController)}get isNativeMobileWebUseCase(){return this.deps.get(z.IsNativeMobileWeb)}}class In extends r.SNApplicationGroup{constructor(e,t,n){super(t),this.defaultSyncServerHost=e,this.webSocketUrl=n}async initialize(){const e=this.defaultSyncServerHost,n=this.webSocketUrl;await super.initialize({applicationCreator:async(r,i)=>((e,n,r,i,o)=>{const s=(0,t.Xf)(i);return new En(n,s,e.identifier,r,o)})(r,i,e,i,n)}),(0,t.Z$)()&&(window.webClient=this.primaryApplication.desktopManager)}deinit(){super.deinit(),(0,t.Z$)()&&delete window.webClient}}class _n extends He.Component{constructor(e,t){super(e),this.application=t,this.reactionDisposers=[]}componentDidMount(){this.addAppEventObserver()}deinit(){var e;null===(e=this.unsubApp)||void 0===e||e.call(this);for(const e of this.reactionDisposers)e();this.reactionDisposers.length=0,this.unsubApp=void 0,this.application=void 0,this.props=void 0,this.state=void 0}componentWillUnmount(){this.deinit()}autorun(e){this.reactionDisposers.push((0,_.EH)(e))}addAppEventObserver(){this.application.isStarted()&&this.onAppStart().catch(console.error),this.application.isLaunched()&&this.onAppLaunch().catch(console.error),this.unsubApp=this.application.addEventObserver((async(e,t)=>{this.application&&(this.onAppEvent(e,t),e===r.ApplicationEvent.Started?await this.onAppStart():e===r.ApplicationEvent.Launched?await this.onAppLaunch():e===r.ApplicationEvent.CompletedIncrementalSync?this.onAppIncrementalSync():e===r.ApplicationEvent.CompletedFullSync?this.onAppFullSync():e===r.ApplicationEvent.KeyStatusChanged?this.onAppKeyChange().catch(console.error):e===r.ApplicationEvent.LocalDataLoaded&&this.onLocalDataLoaded())}))}onAppEvent(e,t){}async onAppStart(){}onLocalDataLoaded(){}async onAppLaunch(){}async onAppKeyChange(){}onAppIncrementalSync(){}onAppFullSync(){}}var xn=s(47931);const Pn=class extends _n{constructor(e){super(e,e.application),this.close=()=>{this.props.close()}}render(){return(0,e.jsx)("div",{className:"sn-component",children:(0,e.jsxs)("div",{id:"sync-resolution-menu",className:"absolute bottom-[40px] left-[inherit] right-0 z-footer-bar-item-panel mt-4 flex max-h-[85vh] min-w-[300px] flex-col border border-solid border-border bg-default shadow-main",children:[(0,e.jsxs)("div",{className:"flex flex-shrink-0 items-center justify-between border-b border-solid border-border bg-contrast px-6 py-3 text-text",children:[(0,e.jsx)("div",{className:"text-base font-medium",children:"Out of Sync"}),(0,e.jsx)("a",{onClick:this.close,className:"text-sm font-bold text-info",children:"Close"})]}),(0,e.jsx)("div",{className:"h-full flex-grow overflow-scroll overflow-x-auto overflow-y-auto p-6 text-sm leading-tight",children:(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)("div",{className:"mb-3.5",children:"We've detected that the data in the current application session may not match the data on the server. An attempt was made to auto-resolve the issue, but it was unable to reconcile the differences."}),(0,e.jsx)("div",{className:"sk-p sk-panel-row mb-3.5",children:(0,e.jsxs)("div",{className:"sk-panel-column",children:[(0,e.jsx)("div",{className:"mb-2 font-bold",children:"Option 1 — Restart Application:"}),(0,e.jsx)("div",{children:"Quit the application and re-open it. Sometimes, this may resolve the issue."})]})}),(0,e.jsx)("div",{className:"sk-p sk-panel-row",children:(0,e.jsxs)("div",{className:"sk-panel-column",children:[(0,e.jsx)("div",{className:"mb-2 font-bold",children:"Option 2 — Sign Out and Back In:"}),(0,e.jsx)("div",{children:"Sign out of your account, then sign back in. This will ensure your data is consistent with the server. Be sure to download a backup of your data before doing so."})]})})]})})]})})}};var kn;!function(e){e[e.UserInteraction=0]="UserInteraction",e[e.Script=1]="Script"}(kn||(kn={}));var Bn=s(44783),On=s(27055),Nn=s(34309),Dn=s(61293);const jn=n=>{let{application:r,onToggle:i,onClose:o,isEnabled:s}=n;const a=(0,He.useCallback)((()=>{i(!s),o()}),[i,s,o]),l=(0,He.useMemo)((()=>r.keyboardService.keyboardShortcutForCommand(L.yX)),[r]);return r.isNativeMobileWeb()||(0,t.Av)()?null:(0,e.jsx)(Dn.Z,{onChange:a,shortcut:l,checked:s,children:"Focus Mode"})},Tn=t=>{let{ctaRef:n,onClose:r}=t;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"flex justify-end p-1",children:(0,e.jsx)("button",{className:"flex cursor-pointer border-0 bg-transparent p-0",onClick:r,"aria-label":"Close modal",children:(0,e.jsx)(xn.Z,{className:"text-neutral",type:"close"})})}),(0,e.jsx)("div",{className:"mx-auto mb-5 flex h-24 w-24 items-center justify-center rounded-[50%] bg-contrast","aria-hidden":!0,children:(0,e.jsx)(xn.Z,{className:"h-24 w-24 px-7 py-2 text-[50px]",size:"custom",type:"🎉"})}),(0,e.jsx)("div",{className:"mb-1 text-center text-lg font-bold",children:"Your purchase was successful!"})]}),(0,e.jsx)("div",{className:"mb-2 px-4.5 text-center text-sm text-passive-1",children:"Enjoy your new powered up experience."}),(0,e.jsx)("div",{className:"p-4",children:(0,e.jsx)("button",{onClick:r,className:"no-border w-full cursor-pointer rounded bg-info py-2 font-bold text-info-contrast hover:brightness-125 focus:brightness-125",ref:n,children:"Continue"})})]})};var Mn=s(73703);const Fn=t=>{let{featureName:n,ctaRef:i,application:o,hasSubscription:s,onClose:a,onClick:l,inline:c,preferHorizontalLayout:u=!1}=t;const d=(0,He.useCallback)((()=>{l&&l(),Yt(),s&&!o.isNativeIOS()?o.openSubscriptionDashboard.execute():o.openPurchaseFlow(),a&&a()}),[o,s,a,l]);return(0,e.jsxs)("div",{className:u?"flex flex-wrap items-center gap-4 md:flex-nowrap":"",children:[!c&&(0,e.jsx)("div",{className:"flex justify-end p-1",children:(0,e.jsx)("button",{className:"flex cursor-pointer border-0 bg-transparent p-0",onClick:a,"aria-label":"Close modal",children:(0,e.jsx)(xn.Z,{className:"text-neutral",type:"close"})})}),(0,e.jsx)("div",{className:(0,r.classNames)("flex items-center justify-center rounded-[50%] bg-contrast",u?"h-12 w-12 flex-shrink-0":"mx-auto mb-5 h-24 w-24"),"aria-hidden":!0,children:(0,e.jsx)(xn.Z,{className:(0,r.classNames)(u?"h-8 w-8":"h-12 w-12",Mn.K),size:"custom",type:Mn._})}),(0,e.jsxs)("div",{className:u?"":"mb-2",children:[(0,e.jsx)("div",{className:(0,r.classNames)("mb-1 text-lg font-bold",u?"text-left":"text-center"),children:"Enable Advanced Features"}),(0,e.jsxs)("div",{className:(0,r.classNames)("text-sm text-passive-1",u?"text-left":"px-4.5 text-center"),children:[n&&(0,e.jsxs)("span",{children:["To take advantage of ",(0,e.jsx)("span",{className:"font-semibold",children:n})," and other advanced features, upgrade your current plan."]}),!n&&(0,e.jsx)("span",{children:"To take advantage of all the advanced features Standard Notes has to offer, upgrade your current plan."}),o.isNativeIOS()&&(0,e.jsxs)("div",{className:"mt-2",children:[(0,e.jsx)("div",{className:"mb-2 font-bold",children:"The Professional Plan costs $119.99/year and includes benefits like"}),(0,e.jsxs)("ul",{className:"list-inside list-[circle]",children:[(0,e.jsx)("li",{children:"100GB encrypted file storage"}),(0,e.jsx)("li",{children:"Access to all note types, including Super, markdown, rich text, authenticator, tasks, and spreadsheets"}),(0,e.jsx)("li",{children:"Access to Daily Notebooks and Moments journals"}),(0,e.jsx)("li",{children:"Note history going back indefinitely"}),(0,e.jsx)("li",{children:"Nested folders for your tags"}),(0,e.jsx)("li",{children:"Premium support"})]})]})]})]}),(0,e.jsx)("button",{onClick:d,className:(0,r.classNames)("no-border cursor-pointer rounded bg-info py-2 font-bold text-info-contrast hover:brightness-125 focus:brightness-125",u?"w-full px-4 md:ml-auto md:w-auto":"my-2 w-full"),ref:i,children:"Upgrade"})]})},Rn=()=>{const e=getComputedStyle(document.documentElement);return{hasTopInset:!!parseInt(e.getPropertyValue("--safe-area-inset-top")),hasRightInset:!!parseInt(e.getPropertyValue("--safe-area-inset-right")),hasBottomInset:!!parseInt(e.getPropertyValue("--safe-area-inset-bottom")),hasLeftInset:!!parseInt(e.getPropertyValue("--safe-area-inset-left"))}};var Ln=s(756),Qn=s(57137),Un=s(18329),Vn=s(38232),Kn=s(74547);const Hn=e=>{let{close:t}=e;const n=(0,Kn.x)(),r=(0,Vn.Y)(t);return(0,He.useEffect)((()=>{const e=n((()=>(r.current(),!0)));return()=>{e&&e()}}),[n,r]),null},Gn=t=>{let{title:n,close:i,actions:o=[],className:s,customHeader:a,disableCustomHeader:l=!1,customFooter:c,children:u}=t;const d=(0,He.useMemo)((()=>o.sort(((e,t)=>"cancel"===e.type?-1:"cancel"===t.type?1:"destructive"===e.type?-1:"destructive"===t.type?1:"secondary"===e.type?-1:"secondary"===t.type?1:0)).filter((e=>!e.hidden))),[o]);if(d.filter((e=>"primary"===e.type)).length>1)throw new Error("Modal can only have 1 primary action");if(d.filter((e=>"cancel"===e.type)).length>1)throw new Error("Modal can only have 1 cancel action");const h=(0,et.ac)(et.Jj.sm),p=d.find((e=>"left"===e.mobileSlot)),f=d.find((e=>"right"===e.mobileSlot)),g=d.findIndex((e=>"primary"===e.type)),m=d.filter((e=>"primary"!==e.type&&"cancel"!==e.type)),[y,v]=(0,He.useState)(!1),A=(0,He.useRef)(null),{hasTopInset:b,hasBottomInset:w}=Rn();return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Hn,{close:i}),a&&!l?a:(0,e.jsx)("div",{className:(0,r.classNames)("flex w-full flex-shrink-0 select-none items-center justify-between rounded-t border-b border-solid border-border bg-default px-2 text-text md:px-4.5 md:py-3 md:translucent-ui:bg-transparent",b?"pb-1.5 pt-safe-top":"py-1.5"),children:(0,e.jsxs)(Un.Z,{className:"flex-row items-center justify-between md:flex md:gap-0",children:[p?(0,e.jsx)(Qn.Z,{type:p.type,action:p.onClick,disabled:p.disabled,slot:"left",children:p.label}):(0,e.jsx)("div",{className:"md:hidden"}),(0,e.jsxs)("div",{className:"flex items-center justify-center gap-2 overflow-hidden text-center font-semibold text-text md:flex-grow md:text-left md:text-lg",children:[m.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Qn.Z,{type:"secondary",action:()=>v((e=>!e)),slot:"left",ref:A,children:(0,e.jsx)("div",{className:"rounded-full border border-border p-0.5",children:(0,e.jsx)(xn.Z,{type:"more"})})}),(0,e.jsx)(On.Z,{title:"Advanced",open:y,anchorElement:A,disableMobileFullscreenTakeover:!0,togglePopover:()=>v((e=>!e)),align:"start",portal:!1,className:"!fixed divide-y divide-border border border-border",children:m.filter((e=>"cancel"!==e.type)).map(((t,n)=>(0,e.jsx)("button",{className:(0,r.classNames)("p-2 text-base font-semibold hover:bg-contrast focus:bg-info-backdrop focus:shadow-none focus:outline-none","destructive"===t.type&&"text-danger"),onClick:()=>{t.onClick(),v(!1)},disabled:t.disabled,children:t.label},n)))})]}),(0,e.jsx)("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap ",children:n})]}),(0,e.jsx)("div",{className:"hidden items-center gap-2 md:flex",children:(0,e.jsx)("button",{tabIndex:0,className:"ml-2 rounded p-1 font-bold hover:bg-contrast",onClick:i,children:(0,e.jsx)(xn.Z,{type:"close"})})}),f?(0,e.jsx)(Qn.Z,{type:f.type,action:f.onClick,disabled:f.disabled,slot:"right",children:f.label}):null]})}),(0,e.jsx)("div",{className:(0,r.classNames)("flex-grow overflow-y-auto",s),children:u}),c||d.length>0&&(0,e.jsx)("div",{className:(0,r.classNames)("hidden items-center justify-start gap-3 border-t border-border px-2.5 py-2 md:flex md:px-4 md:py-4",w&&"pb-safe-bottom"),children:d.map(((t,n)=>(0,e.jsx)(Ln.Z,{primary:"primary"===t.type,colorStyle:"destructive"===t.type?"danger":void 0,onClick:t.onClick,className:(0,r.classNames)(t.mobileSlot?"hidden md:block":"",n===g&&"ml-auto"),"data-type":t.type,disabled:t.disabled,small:h,children:t.label},n)))})]})};var Yn=s(32839),zn=s(59846),Zn=s(47166),Wn=s(17906),qn=s(75043),Jn=s(82931);(0,Q.classNames)("z-dropdown-menu w-full","cursor-auto flex-col overflow-y-auto rounded bg-default h-auto");const Xn=(0,Q.classNames)("flex w-full items-center text-base overflow-hidden hover:bg-contrast hover:text-foreground","cursor-pointer m-0 focus:bg-info focus:text-info-contrast");function $n(t){let{index:n,isSelected:i,onClick:o,onMouseEnter:s,option:a}=t;return(0,e.jsxs)("li",{tabIndex:-1,className:(0,r.classNames)("gap-3 border-b-[0.5px] border-border px-3 py-2",i&&"bg-info-backdrop",Xn),ref:a.setRefElement,role:"option","aria-selected":i,id:"typeahead-item-"+n,onMouseEnter:s,onClick:o,children:[(0,e.jsx)(xn.Z,{type:a.iconName,className:"h-5 w-5 flex-shrink-0"}),(0,e.jsx)("div",{className:"text-editor",children:a.title})]},a.key)}var er=s(20174),tr=s(57823),nr=s(65268);function rr(e,t){const n=[];if(null==t)return n;const r=new RegExp(/^([1-9]|10)x([1-9]|10)$/),i=new RegExp(/^([1-9]|10)x?$/),o=r.exec(t),s=i.exec(t);if(o){const[t,r]=o[0].split("x").map((e=>parseInt(e,10)));n.push(new tr.y("".concat(t,"x").concat(r," Table"),{iconName:"table",keywords:["table"],onSelect:()=>e.dispatchCommand(nr.bF,{columns:String(r),rows:String(t)})}))}else if(s){const t=parseInt(s[0],10);n.push(...Array.from({length:5},((e,t)=>t+1)).map((n=>new tr.y("".concat(t,"x").concat(n," Table"),{iconName:"table",keywords:["table"],onSelect:()=>e.dispatchCommand(nr.bF,{columns:String(n),rows:String(t)})}))))}return n}var ir=s(66498);function or(e){return function(e){return[{name:"Current date and time",iconName:"authenticator",keywords:["date","current"],onSelect:()=>e.dispatchCommand(ir.gD,"datetime")},{name:"Current time",iconName:"authenticator",keywords:["time","current"],onSelect:()=>e.dispatchCommand(ir.gD,"time")},{name:"Current date",iconName:"authenticator",keywords:["date","current"],onSelect:()=>e.dispatchCommand(ir.gD,"date")}]}(e).map((e=>new tr.y(e.name,{iconName:e.iconName,keywords:e.keywords,onSelect:e.onSelect})))}var sr=s(48518);function ar(e){return new tr.y("Image from URL",{iconName:"image",keywords:["image","url"],onSelect:e})}var lr=s(46513),cr=s(66208),ur=s(94652),dr=s(22798),hr=s(98572),pr=s(9256),fr=s(89139),gr=s(30626),mr=s(21490),yr=s(4694),vr=s(8802),Ar=s(26786);function br(e){return function(e){return Ar.GF.map((t=>({name:"Embed ".concat(t.contentName),iconName:t.iconName,keywords:[...t.keywords,"embed"],onSelect:()=>e.dispatchCommand(vr.v3,t.type)})))}(e).map((e=>new tr.y(e.name,{iconName:e.iconName,keywords:e.keywords,onSelect:e.onSelect})))}var wr=s(65123);function Sr(e){return new tr.y("Upload file",{iconName:"file",keywords:["image","upload","file"],onSelect:()=>e.dispatchCommand(wr.J,void 0)})}function Cr(n){let{popoverZIndex:r}=n;const[i]=(0,Zn.g)(),o=(0,sr.I)(),[s,a]=(0,qn.Z)(),[l,c]=(0,He.useState)(null),u=(0,Wn.wd)("/",{minLength:0}),d=(0,He.useMemo)((()=>{const t=o.isNativeMobileWeb()?[(0,dr.Gm)(i),(0,dr.$o)(i)]:[],n=[(0,cr.c)(i),(0,ur.vZ)(i),(0,ur.I)(i),(0,ur.sV)(i),...t,(r=()=>a("Insert Table",(t=>(0,e.jsx)(Jn.n,{activeEditor:i,onClose:t}))),new tr.y("Table",{iconName:"table",keywords:["table","grid","spreadsheet","rows","columns"],onSelect:r})),ar((()=>{a("Insert image from URL",(t=>(0,e.jsx)(lr.a,{onClose:t})))})),Sr(i),(0,pr.EQ)(i),(0,pr.T$)(i),(0,pr.PG)(i),(0,gr.t)(i),(0,fr.i)(i),(0,mr.W)(i),...or(i),(0,hr.F)(i),(0,hr.R8)(i),(0,hr.oe)(i),(0,hr.C1)(i),(0,er.Kw)(i),(0,yr.e)(i),...br(i)];var r;const s=[...rr(i,l||""),...(0,er.ft)(i,l||"")];return l?[...s,...n.filter((e=>!(!new RegExp(l,"gi").exec(e.title)&&null==e.keywords)&&e.keywords.some((e=>new RegExp(l,"gi").exec(e)))))]:n}),[i,l,a,o]),h=(0,He.useCallback)(((e,t,n,r)=>{i.update((()=>{t&&t.remove(),e.onSelect(r),n()}))}),[i]);return(0,e.jsxs)(e.Fragment,{children:[s,(0,e.jsx)(Wn.HQ,{onQueryChange:c,onSelectOption:h,triggerFn:u,options:d,menuRenderFn:(n,i)=>{let{selectedIndex:o,selectOptionAndCleanUp:s,setHighlightedIndex:a}=i;return n.current&&d.length?(0,e.jsx)(On.Z,{title:"Block picker",align:"start",anchorElement:n.current,open:!0,disableMobileFullscreenTakeover:!0,side:(0,t.Av)()?"top":"bottom",maxHeight:e=>e/2,overrideZIndex:r,children:(0,e.jsx)("ul",{children:d.map(((t,n)=>(0,e.jsx)($n,{index:n,isSelected:o===n,onClick:()=>{a(n),s(t)},onMouseEnter:()=>{a(n)},option:t},t.key)))})}):null}})]})}var Er=s(5778);const Ir=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n={ExtraSmall:t?"text-xs":"0.75rem",Small:t?"text-sm":"0.875rem",Normal:t?"text-editor":"var(--sn-stylekit-font-size-editor)",Medium:t?"text-lg":"1.125rem",Large:t?"text-xl":"1.25rem"},r={ExtraSmall:t?"text-sm":"0.875rem",Small:t?"text-editor":"var(--sn-stylekit-font-size-editor)",Normal:t?"text-lg":"1.125rem",Medium:t?"text-xl":"1.25rem",Large:t?"text-2xl":"1.5rem"},i={ExtraSmall:t?"text-sm":"0.875rem",Small:t?"text-editor":"var(--sn-stylekit-font-size-editor)",Normal:t?"text-base":"1rem",Medium:t?"text-xl":"1.25rem",Large:t?"text-2xl":"1.5rem"},o=(0,et.ac)(et.Jj.md),s=(0,et.ac)(et.Jj.sm);return o?i[e]:s?r[e]:n[e]};var _r=s(32810);const xr=t=>{let{hasSubscription:n,onClose:i}=t;const o=(0,sr.I)(),[s]=(0,Er.D)(r.LocalPrefKey.EditorLineHeight),[a]=(0,Er.D)(r.LocalPrefKey.EditorFontSize),l=Ir(a,!1),c=(0,He.useRef)(null),[u,d]=(0,He.useState)(null),h=(0,_r.l)(u,{updateOnWindowResize:!0});return(0,e.jsxs)("div",{className:"flex h-full flex-col",ref:d,children:[(0,e.jsx)("div",{className:(0,r.classNames)("flex-shrink-0 border-b border-border p-4",h&&h.height<500?"hidden md:block":""),children:(0,e.jsx)(Fn,{featureName:"Super notes",ctaRef:c,application:o,hasSubscription:n,inline:!0,preferHorizontalLayout:!0,onClick:i})}),(0,e.jsx)("div",{className:"relative flex h-full min-h-0 flex-col",style:{"--line-height":r.EditorLineHeightValues[s],"--font-size":l},children:(0,e.jsx)(zn.I,{initialValue:(new Be).convertOtherFormatToSuperString('<div>\n\t<h1>This is a demo of Super notes</h1>\n\t<p><br></p>\n\t<p>Super notes are our new <b>rich text</b> experience. With Super notes, you can create <b>rich</b>, <i>dynamic</i> text with powerful options.</p>\n  <p><br></p>\n\t<h2><span>Lists</span></h2>\n  <p><br></p>\n  <ul>\n    <li value="1"><span>Type </span><code spellcheck="false"><span>-</span></code><span> followed by a space in begin a\n        list</span></li>\n    <li value="2"><span>Type </span><code spellcheck="false"><span>1.</span></code><span> followed by a space in begin a numbered\n        list</span></li>\n    <li value="3"><span>Type </span><code spellcheck="false"><span>[]</span></code><span> followed by a space\n        to begin a checklist </span></li>\n  </ul>\n\t<p><br></p>\n\t<ul>\n    <li value="1"><span>A list</span></li>\n    <li value="2">\n      <ul>\n        <li value="1"><span>Indent the list</span></li>\n        <li value="2">\n          <ul>\n            <li value="1"><span>And even more</span></li>\n          </ul>\n        </li>\n      </ul>\n    </li>\n  </ul>\n  <p><br></p>\n\t<ol>\n\t\t<li value="1"><span>A numbered list</span></li>\n\t\t<li value="2"><span>With multiple levels</span></li>\n\t\t<li value="3"><span>And even more</span></li>\n\t</ol>\n  <p><br></p>\n  <ul __lexicallisttype="check">\n    <li role="checkbox" tabindex="-1" aria-checked="false" value="1">\n      <span>Create</span>\n    </li>\n    <li role="checkbox" tabindex="-1" aria-checked="true" value="2">\n      <span>a</span>\n    </li>\n    <li role="checkbox" tabindex="-1" aria-checked="true" value="3">\n      <span>checklist</span>\n    </li>\n  </ul>\n\t<p><br></p>\n\t<h2><span>Images</span></h2>\n  <p><br></p>\n  <p>You can add images to your note by selecting the "Image from URL" option from the <code spellcheck="false"><span>/</span></code> menu or Insert menu in the toolbar.</p>\n  <p><br></p>\n  <p><img src="https://standardnotes.com/static/292c6ba50c69a3ae4f8b1883e7f505f6/1f7f6/vault-wide.jpg" /></p>\n  <p><br></p>\n\t<h2><span>Collapsible sections</span></h2>\n\t<p><br></p>\n\t<details open="">\n    <summary><span>Collapsible section</span></summary>\n    <div data-lexical-collapsible-content="true">\n      <p><span>Collapsible sections can include all\n          other types of content like</span></p>\n      <p><br></p>\n      <h2><span>Heading</span></h2>\n      <p><br></p>\n      <ul>\n        <li value="1"><span>a list</span></li>\n      </ul>\n      <ol>\n        <li value="1"><span>numbered</span></li>\n      </ol>\n      <ul __lexicallisttype="check">\n        <li role="checkbox" tabindex="-1" aria-checked="false" value="1"><span>check\n            list</span>\n        </li>\n      </ul>\n      <p><br></p>\n      <pre spellcheck="false" data-highlight-language="javascript"><span>A</span><span> code block</span></pre>\n      <p><br></p>\n      <p><span>You can even nest collapsible\n          sections.</span></p>\n      <p><br></p>\n      <details open="">\n        <summary><span>Nested collapsible section</span></summary>\n        <div data-lexical-collapsible-content="true">\n          <blockquote><span>Quote</span></blockquote>\n        </div>\n      </details>\n    </div>\n  </details>\n\t<p><br></p>\n\t<h2><span>Code blocks</span></h2>\n  <p><br></p>\n  <p><span>Type </span><code spellcheck="false"><span >```</span></code><span> followed by a space to create a code\n      block. You can choose the language when your\n      cursor is within the code block.</span></p>\n  <p><br></p>\n  <pre spellcheck="false"\n    data-highlight-language="js"><span >function</span><span> </span><span >main</span><span >(</span><span >)</span><span> </span><span >{</span><br><span>\t</span><span >const</span><span> variable </span><span >=</span><span> </span><span >"string"</span><span >;</span><br><span>\t</span><span >return</span><span> </span><span >TEST</span><span >;</span><br><span >}</span></pre>\n\t<p><br></p>\n  <h2><span>Tables</span></h2>\n  <table>\n    <colgroup>\n      <col>\n      <col>\n      <col>\n    </colgroup>\n    <tbody>\n      <tr>\n        <th>\n          <p><span>Header</span></p>\n        </th>\n        <th>\n          <p><span>Column 1</span></p>\n        </th>\n        <th>\n          <p><span>Column 2</span></p>\n        </th>\n      </tr>\n      <tr>\n        <th>\n          <p><span>Row 1</span></p>\n        </th>\n        <td>\n          <p><span>Row 1 x Column 1</span></p>\n        </td>\n        <td>\n          <p><span>Row 1 x Column 2</span></p>\n        </td>\n      </tr>\n      <tr>\n        <th>\n          <p><span>Row 2</span></p>\n        </th>\n        <td>\n          <p><span>Row 2 x Column 1</span></p>\n        </td>\n        <td>\n          <p><span>Row 2 x Column 2</span></p>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n\t<p><br></p>\n\t<h2><span>Passwords</span></h2>\n  <p><span>You can generate a secure password using\n\tthe "Generate password" command using the </span><code spellcheck="false"><span >/</span></code><span>\n\tmenu.</span></p>\n\t<p><br></p>\n  <ul>\n    <li value="1"><span>}:hcMrIFgaijpkyz</span></li>\n    <li value="2"><span>*raF/qi$m?y?iiBS</span></li>\n    <li value="3"><span>YuVmWf(gOD&amp;=vjbB</span></li>\n  </ul>\n</div>',"html",{html:{addLineBreaks:!1}}),children:(0,e.jsx)(Yn.k,{className:"blocks-editor h-full bg-default",children:(0,e.jsx)(Cr,{popoverZIndex:"z-modal"})})})})]})},Pr=t=>{let{application:n,featureName:r,hasSubscription:i,onClose:o,type:s=lt.UpgradePrompt}=t;const a=(0,He.useRef)(null),l=s===lt.SuperDemo,c=(0,et.ac)(et.Jj.sm);return(0,e.jsxs)(Gn,{close:o,title:l?"Try out Super":"Upgrade",className:l?"":"px-6 py-5",customHeader:l?void 0:(0,e.jsx)(e.Fragment,{}),actions:l?[{label:"Done",type:"primary",onClick:o,hidden:!c,mobileSlot:"right"}]:void 0,children:[s===lt.UpgradePrompt&&(0,e.jsx)(Fn,{featureName:r,ctaRef:a,application:n,hasSubscription:i,onClose:o}),s===lt.UpgradeSuccess&&(0,e.jsx)(Tn,{ctaRef:a,onClose:o}),s===lt.SuperDemo&&(0,e.jsx)(xr,{hasSubscription:i,onClose:o})]})};var kr=s(7453),Br=s(72455),Or=s(56278),Nr=s(10878);const Dr=["isOpen","children","animationVariant","close","className","backdropClassName","animate"];function jr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Tr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jr(Object(n),!0).forEach((function(t){Mr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Mr(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Fr=(0,He.forwardRef)(((t,n)=>{let{isOpen:i,children:o,animationVariant:s,close:a,className:l,backdropClassName:c,animate:u}=t,d=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,Dr);const h=(0,et.ac)(et.Jj.sm),[p,f]=(0,Nr.vU)(i,h,s,"mobile"===u&&!h||"desktop"===u&&h),g=(0,Br.I)({open:p,setOpen:e=>{e||a()},animated:!h}),m=(0,He.useId)(),y=(0,He.useCallback)((()=>{const e="portal/"+m,t=document.getElementById(e);t&&t.remove();const n=document.createElement("div");return n.id=e,n.className="fixed flex items-center justify-center left-0 top-0 z-modal h-full w-full pointer-events-none",n.setAttribute("data-dialog-portal",""),document.body.appendChild(n),n}),[m]),v=(0,He.useCallback)((e=>{e&&(e.close=a)}),[a]);return p?(0,e.jsx)(Or.Vq,Tr(Tr({tabIndex:0,className:(0,r.classNames)("pointer-events-auto z-[1] m-0 flex h-full w-full flex-col border-[--popover-border-color] bg-default p-0 md:h-auto md:max-h-[85vh] md:w-160 md:rounded md:border md:bg-[--popover-background-color] md:shadow-main md:[backdrop-filter:var(--popover-backdrop-filter)]","focus-visible:shadow-none focus-visible:outline-none",l),backdrop:(0,e.jsx)("div",{className:(0,r.classNames)("pointer-events-auto absolute z-0 h-full w-full bg-passive-5 opacity-0","md:opacity-50 md:transition-opacity md:duration-75 [&[data-enter]]:md:opacity-75",c),onClick:a}),ref:(0,kr.l)([f,v,n]),store:g,modal:!1,portal:!0,portalElement:y,preventBodyScroll:!0,hideOnInteractOutside:!1},d),{},{children:o})):null})),Rr=(0,He.createContext)(null),Lr=Rr.Provider,Qr=()=>{const e=(0,He.useContext)(Rr);if(!e)throw new Error("invalid PremiumModal context");return e},Ur=(0,Nn.Pi)((t=>{let{application:n,children:i}=t;const o=n.featuresController.premiumAlertFeatureName||"",s=n.hasValidFirstPartySubscription(),a=(0,He.useCallback)((e=>{n.featuresController.showPremiumAlert(e).catch(console.error)}),[n.featuresController]),l=(0,He.useCallback)((()=>{n.featuresController.closePremiumAlert()}),[n.featuresController]),c=(0,He.useCallback)((()=>{n.featuresController.showSuperDemoModal()}),[n.featuresController]),u=(0,He.useMemo)((()=>({activate:a,showSuperDemo:c})),[a,c]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Fr,{isOpen:null!=n.featuresController.premiumAlertType,close:l,className:(0,r.classNames)("w-full",n.featuresController.premiumAlertType===lt.SuperDemo?"md:!h-full md:w-full md:max-w-[70vw]":"!h-auto max-w-[90vw] md:max-w-89"),backdropClassName:"!opacity-50",children:(0,e.jsx)(Pr,{application:n,featureName:o,hasSubscription:s,onClose:l,type:n.featuresController.premiumAlertType})}),(0,e.jsx)(Lr,{value:u,children:i})]})}));Ur.displayName="PremiumModalProvider";const Vr=(0,Nn.Pi)((t=>{let{application:n,children:r}=t;return(0,e.jsx)(Ur,{application:n,children:r})}));var Kr=s(77059),Hr=s(68242);const Gr=n=>{let{uiFeature:i}=n;const o=(0,sr.I)(),s=(0,Bn.o)(),a=Qr(),l=(0,He.useMemo)((()=>o.features.isThirdPartyFeature(i.featureIdentifier)),[o,i.featureIdentifier]),c=(0,He.useMemo)((()=>o.features.getFeatureStatus(i.uniqueIdentifier)===r.FeatureStatus.Entitled),[o,i.uniqueIdentifier]),u=(0,He.useMemo)((()=>c||l),[c,l]),d=(0,He.useCallback)((()=>{u?(i.layerable||!o.componentManager.isThemeActive(i))&&o.componentManager.toggleTheme(i):a.activate("".concat(i.displayName," theme"))}),[o,u,i,a]),h=(0,He.useCallback)((e=>{e.preventDefault(),d()}),[d]),p=o.isNativeMobileWeb()||(0,t.Av)(),f=i.featureIdentifier===r.NativeFeatureIdentifier.TYPES.DynamicTheme&&p,g=(0,He.useMemo)((()=>{if(i.featureIdentifier===r.NativeFeatureIdentifier.TYPES.DarkTheme)return s.keyboardShortcutForCommand(L.Xc)}),[s,i.featureIdentifier]);if(f)return null;const m=!!i&&o.componentManager.isThemeActive(i),y=i.dockIcon;return i.layerable?(0,e.jsxs)(Dn.Z,{checked:m,onChange:()=>d(),children:[!u&&(0,e.jsx)(xn.Z,{type:Mn._,className:(0,Q.classNames)(Mn.K,"mr-2")}),i.displayName]}):(0,e.jsxs)(Kr.Z,{checked:m,onClick:h,children:[(0,e.jsx)("span",{className:(0,Q.classNames)("mr-auto",m?"font-semibold":void 0),children:i.displayName}),g&&(0,e.jsx)(Hr.J,{className:"mr-2",shortcut:g}),i&&u?(0,e.jsx)("div",{className:"h-5 w-5 rounded-full",style:{backgroundColor:null==y?void 0:y.background_color}}):(0,e.jsx)(xn.Z,{type:Mn._,className:(0,Q.classNames)(Mn.K,"ml-auto")})]})},Yr=e=>e.featureIdentifier===r.NativeFeatureIdentifier.TYPES.DarkTheme,zr=(e,t)=>{const n=e.layerable,r=t.layerable;return n&&!r?1:!n&&r?-1:!Yr(e)&&Yr(t)?1:e.displayName.toLowerCase()<t.displayName.toLowerCase()?-1:1};var Zr=s(74522);const Wr=(0,Nn.Pi)((()=>{const{isListPaneCollapsed:t,isNavigationPaneCollapsed:n,toggleListPane:r,toggleNavigationPane:i}=(0,Zr.G)(),o=(0,Bn.o)(),s=(0,He.useMemo)((()=>o.keyboardShortcutForCommand(L.Jr)),[o]),a=(0,He.useMemo)((()=>o.keyboardShortcutForCommand(L.p7)),[o]);return(0,e.jsxs)("div",{className:"hidden md:block pointer-coarse:md-only:hidden pointer-coarse:lg-only:hidden",children:[(0,e.jsx)(Dn.Z,{className:"items-center",checked:!n,onChange:i,shortcut:s,children:"Show Tags Panel"}),(0,e.jsx)(Dn.Z,{className:"items-center",checked:!t,onChange:r,shortcut:a,children:"Show Notes Panel"})]})}));var qr=s(20896),Jr=s(38403);const Xr=(0,Nn.Pi)((t=>{let{closeMenu:n}=t;const i=(0,sr.I)(),{focusModeEnabled:o,setFocusModeEnabled:s}=i.paneController,[a,l]=(0,He.useState)([]),[c,u]=(0,He.useState)([]),d=!i.componentManager.getActiveThemes().find((e=>!e.layerable)),h=(0,He.useRef)(null),p=(0,He.useRef)(null),f=(0,He.useCallback)((()=>{const e=new L.os(i.items),{thirdParty:t,native:n}=e.execute({excludeLayerable:!1});l([...t,...n].sort(zr))}),[i]),g=(0,He.useCallback)((()=>{const e=i.items.getDisplayableComponents().filter((e=>!e.isTheme()&&[r.ComponentArea.EditorStack].includes(e.area)&&e.identifier!==r.NativeFeatureIdentifier.TYPES.DeprecatedFoldersComponent));u(e)}),[i]);(0,He.useEffect)((()=>{a.length||f()}),[f,a.length]),(0,He.useEffect)((()=>{const e=i.items.streamItems(r.ContentType.TYPES.Theme,(()=>{f()}));return()=>{e()}}),[i,f]),(0,He.useEffect)((()=>i.preferences.addEventObserver((e=>{e===r.PreferencesServiceEvent.LocalPreferencesChanged&&f()}))),[i,f]),(0,He.useEffect)((()=>{const e=i.items.streamItems(r.ContentType.TYPES.Component,(()=>{g()}));return()=>{e()}}),[i,g]),(0,He.useEffect)((()=>{var e;null===(e=h.current)||void 0===e||e.focus()}),[]);const m=(0,He.useCallback)((e=>{i.componentManager.toggleComponent(e)}),[i]),y=(0,He.useCallback)((()=>{const e=i.componentManager.getActiveThemes().find((e=>!e.layerable));e&&i.componentManager.toggleTheme(e)}),[i]),v=(0,He.useCallback)((()=>{y()}),[y]);return(0,e.jsxs)(qr.Z,{a11yLabel:"Quick settings menu",children:[c.length>0&&(0,e.jsx)(Jr.Z,{title:"Tools",children:c.map((t=>(0,e.jsxs)(Dn.Z,{onChange:()=>{m(t)},checked:i.componentManager.isComponentActive(t),children:[(0,e.jsx)(xn.Z,{type:"window",className:"mr-2 text-neutral"}),t.displayName]},t.uuid)))}),(0,e.jsxs)(Jr.Z,{title:"Appearance",children:[(0,e.jsx)(Kr.Z,{checked:d,onClick:v,ref:p,children:"Default"}),a.map((t=>(0,e.jsx)(Gr,{uiFeature:t},t.uniqueIdentifier.value)))]}),(0,e.jsx)(jn,{application:i,onToggle:s,onClose:n,isEnabled:o}),(0,e.jsx)(Wr,{})]})}));var $r=s(75711),ei=s(79021);const ti=t=>{let{application:n,isMobileNavigation:i=!1}=t;const o=(0,He.useRef)(null),s=(0,Bn.o)(),[a,l]=(0,He.useState)(!1),c=()=>l(!a);return(0,He.useEffect)((()=>{const e=new r.UIFeature((0,r.GetDarkThemeFeature)());return s.addCommandHandler({command:L.Xc,category:"General",description:"Toggle dark mode",onKeyDown:()=>(n.componentManager.toggleTheme(e),!0)})}),[n,s]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)($r.Z,{label:"Open quick settings menu",children:i?(0,e.jsx)(ei.Z,{className:"ml-2.5 bg-default",onClick:c,label:"Go to vaults menu",icon:"themes"}):(0,e.jsx)("button",{onClick:c,className:"flex h-full w-8 cursor-pointer items-center justify-center",ref:o,children:(0,e.jsx)("div",{className:"h-5",children:(0,e.jsx)(xn.Z,{type:"themes",className:(0,Q.classNames)(a&&"text-info","rounded hover:text-info")})})})}),(0,e.jsx)(On.Z,{title:"Quick settings",togglePopover:c,anchorElement:o,open:a,side:"top",align:"start",className:"md:py-2",children:(0,e.jsx)(Xr,{closeMenu:c})})]})};var ni=s(91819);const ri=(0,Nn.Pi)((t=>{let{mainApplicationGroup:n}=t;const r=(0,sr.I)(),{currentPane:i}=r.accountMenuController,o=(0,He.useCallback)((()=>{r.accountMenuController.closeAccountMenu()}),[r]),s=(0,He.useCallback)((e=>{r.accountMenuController.setCurrentPane(e)}),[r]),a=(0,He.useCallback)((e=>{e.key===L.u8.Escape&&(i===qt.V.GeneralMenu?o():i===qt.V.ConfirmPassword?s(qt.V.Register):s(qt.V.GeneralMenu))}),[o,i,s]);return(0,e.jsx)("div",{id:"account-menu",className:"sn-component",onKeyDown:a,children:(0,e.jsx)(ni.Z,{mainApplicationGroup:n,menuPane:i,setMenuPane:s,closeMenu:o})})})),ii=(0,Nn.Pi)((t=>{let{hasError:n,controller:r,mainApplicationGroup:i,onClickOutside:o,toggleMenu:s,user:a}=t;const l=(0,He.useRef)(null),{show:c}=r;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)($r.Z,{label:"Open account menu",children:(0,e.jsx)("button",{ref:l,onClick:s,className:(0,Q.classNames)(c?"bg-border":"","flex h-full w-8 cursor-pointer items-center justify-center rounded-full"),children:(0,e.jsx)("div",{className:n?"text-danger":a?"text-info":"text-neutral",children:(0,e.jsx)(xn.Z,{type:"account-circle",className:"h-5 w-5 hover:text-info"})})})}),(0,e.jsx)(On.Z,{title:"Account",anchorElement:l,open:c,togglePopover:s,side:"top",align:"start",className:"py-2",children:(0,e.jsx)(ri,{onClickOutside:o,mainApplicationGroup:i})})]})})),oi=(0,Nn.Pi)((t=>{let{application:n,featuresController:r,subscriptionContoller:i}=t;const o=!r.hasFolders,s=i.hasAccount,a=i.hasFirstPartyOnlineOrOfflineSubscription(),l=(0,He.useCallback)((()=>{s&&n.isNativeIOS()?n.showPremiumModal():n.openPurchaseFlow()}),[n,s]);return!o||a?null:(0,e.jsx)("div",{className:"flex h-full items-center px-2",children:(0,e.jsx)("button",{className:"rounded bg-info px-1.5 py-0.5 text-sm font-bold uppercase text-info-contrast hover:brightness-125 lg:text-xs",onClick:l,children:s?"Unlock features":"Sign up to sync"})})})),si=t=>{let{count:n,position:i,className:o}=t;return n?(0,e.jsx)("div",{className:(0,r.classNames)("flex aspect-square h-5 w-5 items-center justify-center rounded-full border border-info-contrast bg-info text-[0.75rem] font-bold text-info-contrast md:text-[0.65rem]","absolute bottom-full translate-y-3 md:translate-y-2","left"===i?"right-full md:translate-x-2":"left-full -translate-x-3 md:-translate-x-2.5",o),children:n}):null},ai=t=>{let{openPreferences:n}=t;const i=(0,sr.I)(),o=(0,Bn.o)(),s=(0,He.useMemo)((()=>(0,L.Ld)(o.keyboardShortcutForCommand(L.QD))),[o]),[a,l]=(0,He.useState)((()=>i.changelogService.getLastReadVersion())),c=(0,He.useMemo)((()=>!(!a||i.isNativeMobileWeb())&&(0,r.compareSemVersions)(i.version,a)>0),[i,a]);(0,He.useEffect)((()=>i.changelogService.addLastReadChangeListener(l)),[i.changelogService]);const u=(0,He.useCallback)((()=>{n(c)}),[c,n]),[d,h]=(0,He.useState)();return(0,He.useEffect)((()=>i.status.addEventObserver(((e,t)=>{e===r.StatusServiceEvent.PreferencesBubbleCountChanged&&h(t)}))),[i.status]),(0,et.ac)(et.Jj.sm)?(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)(ei.Z,{className:"ml-2.5 bg-default",onClick:u,label:"Go to preferences",icon:"tune"}),(0,e.jsx)(si,{position:"right",count:d})]}):(0,e.jsx)($r.Z,{label:"Open preferences (".concat(s,")"),children:(0,e.jsxs)("button",{onClick:u,className:"group relative flex h-full w-8 cursor-pointer items-center justify-center",children:[(0,e.jsxs)("div",{className:"relative h-5",children:[(0,e.jsx)(xn.Z,{type:"tune",className:"rounded group-hover:text-info"}),(0,e.jsx)(si,{position:"right",count:d})]}),c&&(0,e.jsx)("div",{className:"absolute right-0.5 top-0.5 h-2 w-2 rounded-full bg-info"})]})})};var li=s(88743),ci=s(37211),ui=s(13959),di=s(41707);const hi=t=>{let{vault:n,members:r,closeModal:i}=t;const o=(0,sr.I)(),[s,a]=(0,He.useState)(null),[l,c]=(0,He.useState)(!1),u=(0,He.useCallback)((async()=>{if(s&&n.isSharedVaultListing())try{c(!0);const e=await o.vaultUsers.designateSurvivor(n,s.user_uuid);if(e.isFailed())throw new Error(e.getError());await o.sync.sync(),i()}catch(e){console.error(e)}finally{c(!1)}}),[o.sync,o.vaultUsers,i,s,n]),d=(0,He.useMemo)((()=>[{label:l?(0,e.jsx)(di.Z,{className:"h-5 w-5 border-info-contrast"}):"Designate survivor",onClick:u,type:"primary",mobileSlot:"right",disabled:!s||l,hidden:0===r.length},{label:"Cancel",onClick:i,type:"cancel",mobileSlot:"left"}]),[i,u,l,r.length,s]);return(0,e.jsx)(Gn,{title:"Designate survivor",close:i,actions:d,className:"px-4.5 py-4",children:(0,e.jsx)("div",{className:"flex flex-col gap-3",children:r.map((t=>{const n=(null==s?void 0:s.uuid)===t.uuid,r=o.contacts.findContactForServerUser(t);return r?o.vaultUsers.isVaultUserOwner(t)?null:(0,e.jsxs)("label",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[(0,e.jsx)("input",{className:"h-4 w-4 self-center accent-info",type:"radio",name:"survivor",checked:n,onClick:()=>a(t)}),(0,e.jsx)("div",{className:"col-start-2 text-sm font-semibold",children:r.name}),(0,e.jsx)("div",{className:"col-start-2 opacity-90",children:r.contactUuid})]},t.uuid):null}))})})},pi=t=>{let{members:n,isCurrentUserAdmin:r,vault:i,onChange:o}=t;const s=(0,sr.I)(),a=(0,He.useCallback)((async e=>{i.isSharedVaultListing()&&(await s.vaultUsers.removeUserFromSharedVault(i,e.user_uuid),o())}),[s.vaultUsers,i,o]),l=i.isSharedVaultListing()&&!i.sharing.designatedSurvivor,[c,u]=(0,He.useState)(!1),d=()=>u(!1);return(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mb-3 text-lg",children:"Vault Members"}),l&&n.length>1&&r&&(0,e.jsxs)("div",{className:"bg-danger-faded mb-3 grid grid-cols-[auto,1fr] gap-x-[0.65rem] gap-y-0.5 overflow-hidden rounded p-2.5 text-danger",children:[(0,e.jsx)(xn.Z,{type:"warning",className:"place-self-center"}),(0,e.jsx)("div",{className:"text-base font-semibold",children:"No designated survivor"}),(0,e.jsx)("div",{className:"col-start-2",children:"Vaults that have no designated survivor will be deleted when the owner account is deleted. In order to ensure that no data is lost, please designate a survivor who will be transferred ownership of the vault."}),(0,e.jsx)(Ln.Z,{small:!0,className:"col-start-2 mt-1.5",onClick:()=>u(!0),children:"Designate survivor"}),(0,e.jsx)(Fr,{isOpen:c,close:d,children:(0,e.jsx)(hi,{vault:i,members:n,closeModal:d})})]}),(0,e.jsx)("div",{className:"space-y-3.5",children:n.map((t=>{const n=s.vaultUsers.isVaultUserOwner(t),i=s.contacts.findContactForServerUser(t),o=s.vaultUsers.getFormattedMemberPermission(t.permission);return(0,e.jsxs)("div",{className:"grid grid-cols-[auto,1fr] gap-x-[0.65rem] gap-y-0.5 text-base font-medium md:text-sm",children:[(0,e.jsx)(xn.Z,{type:"user",className:"col-start-1 col-end-2 place-self-center"}),(0,e.jsxs)("div",{className:"flex items-center gap-2 overflow-hidden text-ellipsis text-base font-bold",children:[(0,e.jsx)("span",{children:(null==i?void 0:i.name)||t.user_uuid}),i?(0,e.jsxs)("div",{className:"flex items-center gap-1 rounded bg-success px-1 py-0.5 text-xs text-success-contrast",children:[(0,e.jsx)(xn.Z,{type:"check-circle",size:"small"}),"Trusted"]}):(0,e.jsxs)("div",{className:"flex items-center gap-1 rounded bg-danger px-1 py-0.5 pr-1.5 text-xs text-danger-contrast",children:[(0,e.jsx)(xn.Z,{type:"clear-circle-filled",size:"small"}),"Untrusted"]}),t.is_designated_survivor&&(0,e.jsxs)("div",{className:"flex items-center gap-1 rounded bg-info px-1 py-0.5 text-xs text-success-contrast",children:[(0,e.jsx)(xn.Z,{type:"security",size:"small"}),"Designated survivor"]})]}),(0,e.jsx)("div",{className:"col-start-2 row-start-2",children:o}),r&&!n&&(0,e.jsx)(Ln.Z,{className:"col-start-2 row-start-3 mt-1",label:"Remove From Vault",onClick:()=>a(t),small:!0})]},(null==i?void 0:i.uuid)||t.user_uuid)}))})]})},fi=t=>{let{invites:n,onChange:r,isAdmin:i}=t;const o=(0,sr.I)(),s=(0,He.useCallback)((async e=>{await o.vaultInvites.deleteInvite(e),r()}),[o.vaultInvites,r]);return(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mb-3 text-lg",children:"Pending Invites"}),(0,e.jsx)("div",{className:"space-y-3.5",children:n.map((t=>{const n=o.contacts.findContactForInvite(t),r=o.vaultUsers.getFormattedMemberPermission(t.permission);return(0,e.jsxs)("div",{className:"grid grid-cols-[auto,1fr] gap-x-[0.65rem] gap-y-0.5 text-base font-medium md:text-sm",children:[(0,e.jsx)(xn.Z,{type:"user",className:"col-start-1 col-end-2 place-self-center"}),(0,e.jsxs)("div",{className:"flex items-center gap-2 overflow-hidden text-ellipsis text-base font-bold",children:[(0,e.jsx)("span",{children:(null==n?void 0:n.name)||t.user_uuid}),n?(0,e.jsxs)("div",{className:"flex items-center gap-1 rounded bg-success px-1 py-0.5 text-xs text-success-contrast",children:[(0,e.jsx)(xn.Z,{type:"check-circle",size:"small"}),"Trusted"]}):(0,e.jsxs)("div",{className:"flex items-center gap-1 rounded bg-danger px-1 py-0.5 pr-1.5 text-xs text-danger-contrast",children:[(0,e.jsx)(xn.Z,{type:"clear-circle-filled",size:"small"}),"Untrusted"]})]}),(0,e.jsx)("div",{className:"col-start-2 row-start-2",children:r}),i&&(0,e.jsx)(Ln.Z,{label:"Cancel Invite",className:"col-start-2 row-start-3 mt-1",onClick:()=>s(t),small:!0})]},t.uuid)}))})]})};var gi=s(91467);const mi=[{value:r.KeySystemPasswordType.Randomized,label:"Randomized (Recommended)",description:"Your vault key will be randomly generated and synced to your account."},{value:r.KeySystemPasswordType.UserInputted,label:"Custom (Advanced)",description:"Choose your own key for your vault. This is an advanced option and is not recommended for most users."}],yi=t=>{let{value:n,onChange:i,onCustomKeyChange:o}=t;const[s,a]=(0,He.useState)("");return(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mb-3 text-lg",children:"Vault Key Type"}),(0,e.jsx)("div",{className:"mb-1 space-y-3",children:mi.map((t=>{const o=n===t.value;return(0,e.jsxs)("label",{className:"grid grid-cols-[auto,1fr] gap-x-[0.65rem] gap-y-1 text-base font-medium md:text-sm",children:[(0,e.jsx)(Ke,{className:"col-start-1 col-end-2 place-self-center",name:"option",checked:o,onChange:()=>{i(t.value)}}),(0,e.jsx)("div",{className:(0,r.classNames)("select-none",o?"font-semibold":""),children:t.label}),(0,e.jsx)("div",{className:"col-start-2 row-start-2 text-sm opacity-80",children:t.description})]},t.value)}))}),n===r.KeySystemPasswordType.UserInputted&&(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(gi.Z,{placeholder:"Choose a password",id:"key-input",value:s,onChange:e=>{a(e),o(e)},type:"password"})})]})},vi=[{value:r.KeySystemRootKeyStorageMode.Synced,label:"Synced (Recommended)",description:"Your vault key will be encrypted and synced to your account and automatically available on your other devices."},{value:r.KeySystemRootKeyStorageMode.Local,label:"Local",description:"Your vault key will be encrypted and saved locally on this device. You will need to manually enter your vault key on your other devices."},{value:r.KeySystemRootKeyStorageMode.Ephemeral,label:"Ephemeral",description:"Your vault key will only be stored in memory and will be forgotten when you close the app. You will need to manually enter your vault key on your other devices."}],Ai=t=>{let{value:n,onChange:i}=t;return(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mb-3 text-lg",children:"Vault Key Storage Mode"}),(0,e.jsx)("div",{className:"space-y-3",children:vi.map((t=>{const o=n===t.value;return(0,e.jsxs)("label",{className:"grid grid-cols-[auto,1fr] gap-x-[0.65rem] gap-y-1 text-base font-medium md:text-sm",children:[(0,e.jsx)(Ke,{className:"col-start-1 col-end-2 place-self-center",name:"option",checked:o,onChange:()=>{i(t.value)}}),(0,e.jsx)("div",{className:(0,r.classNames)("select-none",o?"font-semibold":""),children:t.label}),(0,e.jsx)("div",{className:"col-start-2 row-start-2 text-sm opacity-80",children:t.description})]},t.value)}))})]})},bi=e=>{const t=(0,sr.I)(),[n,i]=(0,He.useState)();if((0,He.useEffect)((()=>{if(!e)return;const n=new r.LiveItem(e,t.items,(e=>{i(e)}));return()=>n.deinit()}),[e,t]),e)return n};var wi=s(37658),Si=s(62872);const Ci=(0,He.forwardRef)(((t,n)=>{let{type:r,label:i,currentType:o,selectTab:s}=t;const a=o===r;return(0,e.jsx)("button",{className:"relative mr-2 cursor-pointer border-0 pb-1.5 text-mobile-menu-item focus:shadow-none md:text-tablet-menu-item lg:text-menu-item ".concat(a?"font-medium text-info":"text-text"),onClick:()=>{s(r)},ref:n,children:i})})),Ei=t=>{let{selectedValue:n,onIconChange:i,platform:o,className:s,useIconGrid:a,iconGridClassName:l,autoFocus:c}=t;const u=(0,He.useMemo)((()=>Object.keys(Si.p)),[]),d=(0,He.useMemo)((()=>u.map((e=>({label:e,value:e,icon:e})))),[u]),h=(0,xn.R)(n),p=o===r.Platform.MacWeb||o===r.Platform.MacDesktop,f=o===r.Platform.WindowsWeb||o===r.Platform.WindowsDesktop,g=(0,He.useRef)(null),[m,y]=(0,He.useState)(!0),[v,A]=(0,He.useState)(h?"emoji":"icon"),[b,w]=(0,He.useState)(h?n:"");(0,He.useEffect)((()=>{w(h?n:"")}),[h,n]);const S=e=>{"reset"===e?(i(void 0),w("")):A(e)},C=e=>{i(e)},E=(0,He.useCallback)((e=>{e&&setTimeout((()=>{e.focus()}))}),[]);return(0,e.jsxs)("div",{className:"flex h-full flex-grow flex-col ".concat(s),children:[(0,e.jsxs)("div",{className:"flex",children:[(0,e.jsx)(Ci,{label:"Icon",type:"icon",currentType:v,selectTab:S}),(0,e.jsx)(Ci,{label:"Emoji",type:"emoji",currentType:v,selectTab:S}),(0,e.jsx)(Ci,{label:"Reset",type:"reset",currentType:v,selectTab:S})]}),(0,e.jsxs)("div",{className:(0,Q.classNames)("mt-1 h-full min-h-0","icon"===v&&"overflow-auto"),children:["icon"===v&&(a?(0,e.jsx)("div",{className:(0,Q.classNames)("flex w-full flex-wrap items-center gap-6 p-1 md:max-h-24 md:gap-4 md:p-0",l),children:u.map(((t,n)=>(0,e.jsx)("button",{onClick:()=>{C(t)},ref:0===n?E:void 0,children:(0,e.jsx)(xn.Z,{type:t})},t)))}):(0,e.jsx)(wi.Z,{fullWidth:!0,label:"Change the icon for a tag",items:d,value:n,onChange:C})),"emoji"===v&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ui.Z,{ref:g,autocomplete:!1,autofocus:null!=c?c:m,type:"text",value:b,onChange:e=>(e=>{var t;w(e),1===function(e){try{return[...(new Intl.Segmenter).segment(e)].length}catch(t){return[...e].length}}(e)?(i(e),null===(t=g.current)||void 0===t||t.blur(),y(!1)):y(!0)})(e)}),(0,e.jsx)("div",{className:"mt-2 text-sm text-passive-0 lg:text-xs",children:"Use your keyboard to enter or paste in an emoji character."}),p&&(0,e.jsx)("div",{className:"mt-2 text-sm text-passive-0 lg:text-xs",children:"On macOS: ⌘ + ⌃ + Space bar to bring up emoji picker."}),f&&(0,e.jsx)("div",{className:"mt-2 text-sm text-passive-0 lg:text-xs",children:"On Windows: Windows key + . to bring up emoji picker."})]})]})]})};var Ii=s(22457),_i=s(89776),xi=s(10114);const Pi=t=>{let{onCloseDialog:n,existingVaultUuid:i,creatingSharedVault:o}=t;const s=(0,sr.I)(),a=bi(i),[l,c]=(0,He.useState)(""),[u,d]=(0,He.useState)(""),[h,p]=(0,He.useState)("safe-square"),[f,g]=(0,He.useState)([]),[m,y]=(0,He.useState)([]),[v,A]=(0,He.useState)(!1),[b,w]=(0,He.useState)(!0),[S,C]=(0,He.useState)(r.KeySystemPasswordType.Randomized),[E,I]=(0,He.useState)(r.KeySystemRootKeyStorageMode.Synced),[_,x]=(0,He.useState)(void 0),[P,k]=(0,He.useState)(!1),B=(0,He.useRef)(null);(0,He.useEffect)((()=>{var e,t;a&&(c(null!==(e=a.name)&&void 0!==e?e:""),d(null!==(t=a.description)&&void 0!==t?t:""),p(a.iconString),C(a.rootKeyParams.passwordType),I(a.keyStorageMode))}),[s.vaults,a]);const O=(0,He.useCallback)((async()=>{if(a&&a.isSharedVaultListing()){w(a.isSharedVaultListing()&&s.vaultUsers.isCurrentUserSharedVaultAdmin(a)),A(!0);const e=await s.vaultUsers.getSharedVaultUsersFromServer(a);e&&g(e);const t=await s.vaultInvites.getOutboundInvites(a);(0,r.isClientDisplayableError)(t)||y(t),A(!1)}}),[s,a]);(0,He.useEffect)((()=>{O()}),[s.vaults,O]);const N=(0,He.useCallback)((()=>{n()}),[n]),D=(0,He.useCallback)((async e=>{var t;if(!l)return void(null===(t=B.current)||void 0===t||t.focus());e.name===l&&e.description===u&&e.iconString===h||await s.vaults.changeVaultMetadata(e,{name:l,description:u,iconString:h});const n=e.keyPasswordType!==S,i=e.keyStorageMode!==E;(n||i)&&await s.vaults.changeVaultKeyOptions({vault:e,newPasswordOptions:n?(()=>{if(!n)throw new Error("Password type is not changing");if(S===r.KeySystemPasswordType.UserInputted){if(!_)throw new Error("Custom password is not set");return{passwordType:S,userInputtedPassword:_}}return{passwordType:S}})():void 0,newStorageMode:i?E:void 0}),N()}),[s.vaults,_,u,N,h,E,l,S]),j=(0,He.useCallback)((async()=>{var e;if(l){if(S===r.KeySystemPasswordType.UserInputted){if(!_)throw new Error("Custom key is not set");o?await s.sharedVaults.createSharedVault({name:l,description:u,iconString:h,storagePreference:E,userInputtedPassword:_}):await s.vaults.createUserInputtedPasswordVault({name:l,description:u,iconString:h,storagePreference:E,userInputtedPassword:_})}else o?await s.sharedVaults.createSharedVault({name:l,description:u,iconString:h,storagePreference:E,userInputtedPassword:void 0}):await s.vaults.createRandomizedVault({name:l,description:u,iconString:h});N()}else null===(e=B.current)||void 0===e||e.focus()}),[s.sharedVaults,s.vaults,o,_,u,N,h,E,l,S]),T=(0,He.useCallback)((async()=>{P||(k(!0),a?await D(a):await j(),k(!1))}),[P,a,D,j]),M=(0,He.useMemo)((()=>[{label:a?"Save Vault":o?"Create Shared Vault":"Create Vault",onClick:T,type:"primary",mobileSlot:"right",disabled:P},{label:"Cancel",onClick:N,type:"cancel",mobileSlot:"left"}]),[o,a,N,T,P]),[F,R]=(0,He.useState)(!1),L=(0,He.useRef)(null),Q=(0,He.useCallback)((()=>{R((e=>!e))}),[]),U=(0,Ii.M)(),V=U.useState("open");return a&&s.vaultLocks.isVaultLocked(a)?(0,e.jsx)("div",{children:"Vault is locked."}):(0,e.jsx)(Gn,{title:a?"Edit Vault":"Create New Vault",close:N,actions:M,children:(0,e.jsxs)("div",{className:"flex w-full flex-col space-y-3.5 px-4.5 py-4",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-lg",children:"Vault Info"}),(0,e.jsx)("div",{className:"mt-1",children:"The vault name and description are end-to-end encrypted."}),(0,e.jsxs)("div",{className:"mt-3.5 flex items-center gap-3",children:[(0,e.jsx)($r.Z,{className:"!z-modal",label:"Choose icon",children:(0,e.jsx)(Ln.Z,{className:"!px-1.5",ref:L,onClick:Q,children:(0,e.jsx)(xn.Z,{type:h})})}),(0,e.jsx)(On.Z,{title:"Choose icon",open:F,anchorElement:L,togglePopover:Q,align:"start",overrideZIndex:"z-modal",hideOnClickInModal:!0,children:(0,e.jsx)("div",{className:"p-2",children:(0,e.jsx)(Ei,{selectedValue:h||"safe-square",onIconChange:e=>{p(null!=e?e:"safe-square"),Q()},platform:s.platform,useIconGrid:!0})})}),(0,e.jsx)(ui.Z,{className:{container:"flex-grow"},ref:B,value:l,placeholder:"Vault Name",onChange:e=>{c(e)}})]}),(0,e.jsx)(ui.Z,{className:{container:"mt-3"},value:u,placeholder:"Vault description",onChange:e=>{d(e)}})]}),a?v?(0,e.jsxs)("div",{className:"flex items-center gap-3 py-2 text-base",children:[(0,e.jsx)(di.Z,{className:"h-5 w-5"}),"Loading collaboration info..."]}):(0,e.jsxs)(e.Fragment,{children:[f.length>0&&(0,e.jsx)(pi,{vault:a,members:f,onChange:O,isCurrentUserAdmin:b}),m.length>0&&(0,e.jsx)(fi,{invites:m,onChange:O,isAdmin:b})]}):null,(0,e.jsxs)(_i.p,{store:U,className:"flex items-center justify-between focus:shadow-none focus:outline-none",children:[(0,e.jsx)("div",{className:"text-lg",children:"Advanced options"}),(0,e.jsx)(xn.Z,{type:V?"chevron-up":"chevron-down"})]}),(0,e.jsxs)(xi.k_,{className:"space-y-3.5 pb-3",store:U,children:[(0,e.jsx)(yi,{value:S,onChange:C,onCustomKeyChange:x}),(0,e.jsx)(Ai,{value:E,onChange:I})]})]})})},ki=t=>{let{isVaultModalOpen:n,closeVaultModal:r,vault:i,creatingSharedVault:o}=t;return(0,e.jsx)(Fr,{className:"md:max-h-[70vh]",isOpen:n,close:r,children:(0,e.jsx)(Pi,{creatingSharedVault:o,existingVaultUuid:null==i?void 0:i.uuid,onCloseDialog:r})})},Bi=e=>{const t=(0,sr.I)(),n=e.keyPasswordType===r.KeySystemPasswordType.UserInputted&&e.keyStorageMode===r.KeySystemRootKeyStorageMode.Ephemeral,[i,o]=(0,He.useState)((()=>t.vaultLocks.isVaultLocked(e)));(0,He.useEffect)((()=>t.vaultLocks.addEventObserver((n=>{n!==r.VaultLockServiceEvent.VaultLocked&&n!==r.VaultLockServiceEvent.VaultUnlocked||o(t.vaultLocks.isVaultLocked(e))}))),[t.vaultLocks,e]);const s=(0,He.useCallback)((async()=>{n&&(i?t.vaultDisplayService.unlockVault(e).catch(console.error):t.vaultLocks.lockNonPersistentVault(e).catch(console.error))}),[t.vaultDisplayService,t.vaultLocks,n,i,e]),a=!e.isSharedVaultListing()||t.vaultUsers.isCurrentUserSharedVaultAdmin(e),l=!e.isSharedVaultListing()||t.vaultUsers.isCurrentUserSharedVaultOwner(e),c=(0,He.useCallback)((async()=>!t.vaultLocks.isVaultLocked(e)||await t.vaultDisplayService.unlockVault(e)),[t,e]);return{canShowLockOption:n,isLocked:i,toggleLock:s,ensureVaultIsUnlocked:c,isCurrentUserAdmin:a,isCurrentUserOwner:l}},Oi=t=>{let{vault:n}=t;const{canShowLockOption:r,isLocked:i,toggleLock:o,ensureVaultIsUnlocked:s}=Bi(n),[a,l]=(0,He.useState)(!1),c=(0,He.useCallback)((async()=>{await s()&&l(!0)}),[s]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(qr.Z,{a11yLabel:"Vault options menu",children:[(0,e.jsxs)(ci.Z,{onClick:c,children:[(0,e.jsx)(xn.Z,{type:"pencil-filled",className:"mr-2"}),"Edit vault"]}),r&&(0,e.jsxs)(ci.Z,{onClick:o,children:[(0,e.jsx)(xn.Z,{type:"lock",className:"mr-2"}),i?"Unlock":"Lock"," vault"]})]}),(0,e.jsx)(ki,{vault:n,isVaultModalOpen:a,closeVaultModal:()=>l(!1)})]})},Ni=t=>{let{vault:n,children:i}=t;const[o,s]=(0,He.useState)(!1),a=(0,He.useRef)(null),l=()=>{s((e=>!e))};return(0,e.jsxs)("div",{className:"group flex items-center gap-3 px-3 focus-within:bg-info-backdrop",children:[i,(0,e.jsx)("button",{className:(0,r.classNames)("flex-shrink-0 rounded-full border border-border p-1 hover:bg-default focus:bg-default group-focus-within:bg-default",o&&"bg-default"),onClick:l,ref:a,children:(0,e.jsx)(xn.Z,{type:"more",size:"small"})}),(0,e.jsx)(On.Z,{title:"Vault options",open:o,anchorElement:a,side:"top",align:"start",className:"py-1",togglePopover:l,children:(0,e.jsx)(Oi,{vault:n})})]})},Di=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),[n,i]=(0,He.useState)((()=>t.vaults.getVaults()));(0,He.useEffect)((()=>t.items.streamItems(r.ContentType.TYPES.VaultListing,(()=>{i(t.vaults.getVaults())}))),[t.items,t.vaults]);const o=(0,He.useCallback)((e=>!t.vaultDisplayService.isVaultDisabledOrLocked(e)),[t]),s=(0,He.useCallback)((e=>{o(e)?t.vaultDisplayService.hideVault(e):t.vaultDisplayService.unhideVault(e)}),[o,t]);return(0,e.jsxs)(qr.Z,{a11yLabel:"Vault selection menu",children:[!n.length&&(0,e.jsx)("div",{className:"py-1 text-center",children:"No vaults found"}),n.map((n=>(0,e.jsx)(Ni,{vault:n,children:(0,e.jsxs)(Dn.Z,{className:"flex-grow !px-0 focus:!bg-transparent",onChange:()=>{s(n)},checked:o(n),children:[(0,e.jsx)(xn.Z,{type:n.iconString,className:"mr-2 text-neutral"}),(0,e.jsxs)("div",{className:"flex w-full items-center gap-1",children:[n.name,t.vaultLocks.isVaultLocked(n)&&(0,e.jsx)(xn.Z,{className:"ml-1",type:"lock",size:"small"})]})]})},n.uuid)))]})})),ji=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),[n,i]=(0,He.useState)((()=>t.vaults.getVaults()));(0,He.useEffect)((()=>t.items.streamItems(r.ContentType.TYPES.VaultListing,(()=>{i(t.vaults.getVaults())}))),[t.items,t.vaults]);const o=(0,He.useCallback)((e=>t.vaultDisplayService.isVaultExclusivelyShown(e)),[t]),s=(0,He.useCallback)((e=>{t.vaultDisplayService.showOnlyVault(e)}),[t]);return(0,e.jsxs)(qr.Z,{a11yLabel:"Vault selection menu",children:[!n.length&&(0,e.jsx)("div",{className:"py-1 text-center",children:"No vaults found"}),n.map((n=>(0,e.jsx)(Ni,{vault:n,children:(0,e.jsxs)(Kr.Z,{className:"!px-0 focus:!bg-transparent md:!py-[0.455rem]",checked:o(n),onClick:()=>s(n),children:[n.name,t.vaultLocks.isVaultLocked(n)&&(0,e.jsx)(xn.Z,{className:"ml-1",type:"lock",size:"small"})]},n.uuid)},n.uuid)))]})}));var Ti=s(51694);const Mi=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),[n,r]=(0,He.useState)(t.vaultDisplayService.isInExclusiveDisplayMode()?"single":"many");return(0,e.jsxs)(qr.Z,{a11yLabel:"Vault selection menu",children:[(0,e.jsx)(li.Z,{items:[{label:"Multiple",value:"many"},{label:"One",value:"single"}],value:n,onChange:e=>(e=>{r(e),"many"===e&&t.vaultDisplayService.exclusivelyShownVault&&t.vaultDisplayService.changeToMultipleVaultDisplayMode()})(e),className:"m-3 mt-1"}),"many"===n&&(0,e.jsx)(Di,{}),"single"===n&&(0,e.jsx)(ji,{}),(0,e.jsx)(Ti.Z,{}),(0,e.jsx)(ci.Z,{icon:"settings",onClick:()=>{t.preferencesController.openPreferences("vaults")},children:"Open vault settings"})]})})),Fi=(0,Nn.Pi)((t=>{let{isMobileNavigation:n=!1}=t;const r=(0,sr.I)(),i=(0,He.useRef)(null),o=r.vaultDisplayService.exclusivelyShownVault,[s,a]=(0,He.useState)(!1),l=()=>a(!s);return r.featuresController.isVaultsEnabled()?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)($r.Z,{label:"Open vault selection menu",children:n?(0,e.jsx)(ei.Z,{className:"ml-2.5 bg-default",onClick:l,label:"Go to vaults menu",icon:"safe-square"}):(0,e.jsx)("button",{onClick:l,className:"flex h-full cursor-pointer items-center justify-center",ref:i,children:(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)(xn.Z,{type:"safe-square",className:(0,Q.classNames)(s?"text-info":o?"text-success":"","rounded hover:text-info")}),o&&(0,e.jsx)("div",{className:(0,Q.classNames)("ml-1 text-xs font-bold",s&&"text-info"),children:o.name})]})})}),(0,e.jsx)(On.Z,{title:"Vault options",togglePopover:l,anchorElement:i,open:s,side:"top",align:"start",className:"py-2",children:(0,e.jsx)(Mi,{})})]}):null})),Ri=class extends _n{constructor(e){super(e,e.application),this.didCheckForOffline=!1,this.completedInitialSync=!1,this.showingDownloadStatus=!1,this.securityUpdateClickHandler=async()=>{await(0,L.VG)({title:ht.X5,text:ht.j0,confirmButtonText:ht.I0})&&(0,t.A1)(ht.Cp,(async()=>{await this.application.upgradeProtocolVersion()})).catch(console.error)},this.accountMenuClickHandler=()=>{this.application.accountMenuController.toggleShow()},this.syncResolutionClickHandler=()=>{this.setState({showSyncResolution:!this.state.showSyncResolution})},this.closeAccountMenu=()=>{this.application.accountMenuController.setShow(!1),this.application.accountMenuController.setCurrentPane(qt.V.GeneralMenu)},this.lockClickHandler=()=>{this.application.lock().catch(console.error)},this.onNewUpdateAvailable=()=>{this.setState({newUpdateAvailable:!0})},this.newUpdateClickHandler=()=>{this.setState({newUpdateAvailable:!1}),this.application.alerts.alert(ht.Lw).catch(console.error)},this.betaMessageClickHandler=()=>{(0,L.Ne)({title:"You are using a beta version of the app",text:"If you wish to go back to a stable version, make sure to sign out of this beta app first."}).catch(console.error)},this.clickOutsideAccountMenu=()=>{this.application.accountMenuController.closeAccountMenu()},this.openPreferences=e=>{e&&this.application.preferencesController.setCurrentPane("whats-new"),this.application.preferencesController.openPreferences()},this.state={hasError:!1,offline:!0,outOfSync:!1,dataUpgradeAvailable:!1,hasPasscode:!1,descriptors:e.applicationGroup.getDescriptors(),showBetaWarning:!1,showSyncResolution:!1,newUpdateAvailable:!1},this.webEventListenerDestroyer=e.application.addWebEventObserver(((e,t)=>{const n=this.application.status;switch(e){case r.WebAppEvent.NewUpdateAvailable:this.onNewUpdateAvailable();break;case r.WebAppEvent.EditorDidFocus:t.eventSource===kn.UserInteraction&&this.closeAccountMenu();break;case r.WebAppEvent.BeganBackupDownload:n.setMessage("Saving local backup…");break;case r.WebAppEvent.EndedBackupDownload:{const e="Successfully saved backup.",r="Unable to save local backup.";n.setMessage(t.success?e:r),setTimeout((()=>{n.message!==e&&n.message!==r||n.setMessage("")}),2e3);break}}}))}deinit(){this.removeStatusObserver(),this.removeStatusObserver=void 0,this.webEventListenerDestroyer(),this.webEventListenerDestroyer=void 0,super.deinit(),(0,t.h6)(this)}componentDidMount(){super.componentDidMount(),this.removeStatusObserver=this.application.status.addEventObserver(((e,t)=>{e===r.StatusServiceEvent.MessageChanged&&this.setState({arbitraryStatusMessage:t})}))}reloadUpgradeStatus(){this.application.checkForSecurityUpdate().then((e=>{this.setState({dataUpgradeAvailable:e})})).catch(console.error)}async onAppLaunch(){super.onAppLaunch().catch(console.error),this.reloadPasscodeStatus().catch(console.error),this.reloadUser(),this.reloadUpgradeStatus(),this.updateOfflineStatus(),this.findErrors()}reloadUser(){this.user=this.application.sessions.getUser()}async reloadPasscodeStatus(){const e=this.application.hasPasscode();this.setState({hasPasscode:e})}async onAppKeyChange(){super.onAppKeyChange().catch(console.error),this.reloadPasscodeStatus().catch(console.error)}onAppEvent(e,t){switch(e){case r.ApplicationEvent.KeyStatusChanged:this.reloadUpgradeStatus();break;case r.ApplicationEvent.EnteredOutOfSync:this.setState({outOfSync:!0});break;case r.ApplicationEvent.ExitedOutOfSync:this.setState({outOfSync:!1});break;case r.ApplicationEvent.CompletedFullSync:this.completedInitialSync||(this.application.status.setMessage(""),this.completedInitialSync=!0),this.didCheckForOffline||(this.didCheckForOffline=!0,this.state.offline&&0===this.application.items.getNoteCount()&&this.application.accountMenuController.setShow(!0)),this.findErrors(),this.updateOfflineStatus(),this.setState({failedSyncError:void 0});break;case r.ApplicationEvent.SyncStatusChanged:this.updateSyncStatus();break;case r.ApplicationEvent.FailedSync:this.updateSyncStatus(),this.findErrors(),this.updateOfflineStatus(),this.setState({failedSyncError:(0,r.getErrorMessageFromErrorResponseBody)(t,"Sync error. Please try again later.")});break;case r.ApplicationEvent.LocalDataIncrementalLoad:case r.ApplicationEvent.LocalDataLoaded:this.updateLocalDataStatus();break;case r.ApplicationEvent.SignedIn:case r.ApplicationEvent.SignedOut:this.reloadUser();break;case r.ApplicationEvent.WillSync:this.completedInitialSync||this.application.status.setMessage("Syncing…")}}updateSyncStatus(){const e=this.application.status,t=this.application.sync.getSyncStatus(),n=t.getStats();if(t.hasError())e.setMessage("Unable to Sync");else if(n.downloadCount>20){const t="Downloading ".concat(n.downloadCount," items. Keep app open.");e.setMessage(t),this.showingDownloadStatus=!0}else if(this.showingDownloadStatus)this.showingDownloadStatus=!1,e.setMessage("Download Complete."),setTimeout((()=>{e.setMessage("")}),2e3);else if(n.uploadTotalCount>20){const t=(0===n.uploadCompletionCount?0:n.uploadCompletionCount/n.uploadTotalCount).toLocaleString(void 0,{style:"percent"});e.setMessage("Syncing ".concat(n.uploadTotalCount," items (").concat(t," complete)"))}else e.setMessage("")}updateLocalDataStatus(){const e=this.application.status,t=this.application.sync.getSyncStatus().getStats(),n=this.application.isEncryptionAvailable();if(t.localDataDone)return void e.setMessage("");const r="".concat(t.localDataCurrent,"/").concat(t.localDataTotal," items..."),i=n?"Decrypting ".concat(r):"Loading ".concat(r);e.setMessage(i)}updateOfflineStatus(){this.setState({offline:this.application.sessions.isSignedOut()})}findErrors(){this.setState({hasError:this.application.sync.getSyncStatus().hasError()})}render(){return(0,e.jsx)("div",{className:"sn-component",children:(0,e.jsxs)("footer",{id:"footer-bar",className:"z-footer-bar hidden h-8 w-full select-none items-center justify-between border-t border-border bg-contrast px-3 text-text md:flex",children:[(0,e.jsxs)("div",{className:"left flex h-full flex-shrink-0",children:[(0,e.jsx)("div",{className:"sk-app-bar-item relative z-footer-bar-item ml-0 select-none",children:(0,e.jsx)(ii,{hasError:this.state.hasError,controller:this.application.accountMenuController,mainApplicationGroup:this.props.applicationGroup,onClickOutside:this.clickOutsideAccountMenu,toggleMenu:this.accountMenuClickHandler,user:this.user})}),(0,e.jsx)("div",{className:"relative z-footer-bar-item select-none",children:(0,e.jsx)(ai,{openPreferences:this.openPreferences})}),(0,e.jsx)("div",{className:"relative z-footer-bar-item select-none",children:(0,e.jsx)(ti,{application:this.application})}),(0,e.jsx)("div",{className:"relative z-footer-bar-item  ml-1.5 select-none",children:(0,e.jsx)(Fi,{})}),(0,e.jsx)(oi,{application:this.application,featuresController:this.application.featuresController,subscriptionContoller:this.application.subscriptionController}),this.state.showBetaWarning&&(0,e.jsx)(He.Fragment,{children:(0,e.jsx)("div",{className:"relative z-footer-bar-item ml-3 flex select-none items-center border-l border-solid border-border pl-3",children:(0,e.jsx)("a",{onClick:this.betaMessageClickHandler,className:"no-decoration title text-xs font-bold",children:"You are using a beta version of the app"})})})]}),(0,e.jsx)("div",{className:"center max-h-full overflow-hidden px-4",children:this.state.arbitraryStatusMessage&&(0,e.jsx)("div",{className:"relative z-footer-bar-item max-h-full select-none items-center overflow-hidden text-ellipsis whitespace-nowrap text-xs font-bold text-neutral",children:this.state.arbitraryStatusMessage})}),(0,e.jsxs)("div",{className:"right flex h-full flex-shrink-0",children:[this.state.failedSyncError&&(0,e.jsxs)("div",{className:"relative z-footer-bar-item flex select-none items-center text-xs font-bold text-neutral",children:["Sync error: ",this.state.failedSyncError]}),this.state.dataUpgradeAvailable&&(0,e.jsx)("div",{onClick:this.securityUpdateClickHandler,className:"relative z-footer-bar-item flex select-none items-center text-xs font-bold text-success",children:"Encryption upgrade available."}),this.state.newUpdateAvailable&&(0,e.jsx)("div",{onClick:this.newUpdateClickHandler,className:"relative z-footer-bar-item ml-3 flex select-none items-center text-xs font-bold text-info",children:"New update available."}),(this.state.outOfSync||this.state.showSyncResolution)&&(0,e.jsxs)("div",{className:"relative z-footer-bar-item ml-3 flex flex-shrink-0 select-none items-center",children:[this.state.outOfSync&&(0,e.jsx)("div",{onClick:this.syncResolutionClickHandler,className:"text-xs font-bold text-warning",children:"Potentially Out of Sync"}),this.state.showSyncResolution&&(0,e.jsx)(Pn,{close:this.syncResolutionClickHandler,application:this.application})]}),this.state.offline&&(0,e.jsx)("div",{className:"relative z-footer-bar-item ml-3 flex flex-shrink-0 select-none items-center text-xs font-bold",children:"Offline"}),this.state.hasPasscode&&(0,e.jsx)($r.Z,{label:"Lock application",children:(0,e.jsx)("div",{id:"lock-item",onClick:this.lockClickHandler,title:"Locks application and wipes unencrypted data from memory.",className:"relative z-footer-bar-item ml-3 flex cursor-pointer select-none items-center border-l border-solid border-border pl-2 hover:text-info",children:(0,e.jsx)(xn.Z,{type:"lock-filled",size:"custom",className:"h-4.5 w-4.5"})})})]})]})})}},Li=["children","closeDialog","className"];function Qi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ui(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Vi=t=>{let{children:n,closeDialog:i,className:o}=t,s=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,Li);const a=(0,Br.I)(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qi(Object(n),!0).forEach((function(t){Ui(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({open:!0},s)),l=(0,He.useCallback)((e=>{e&&(e.close=i)}),[i]);return(0,e.jsxs)(Or.Vq,{store:a,role:"alertdialog",className:"pointer-events-auto fixed left-0 top-0 z-modal flex h-full w-full items-center justify-center",modal:!1,portal:!0,preventBodyScroll:!0,ref:l,children:[(0,e.jsx)("div",{className:"absolute z-0 h-full w-full bg-passive-5 opacity-25 md:opacity-75",role:"presentation",onClick:i}),(0,e.jsx)("div",{className:(0,r.classNames)("z-[1] w-[95vw] rounded border border-[--popover-border-color] bg-[--popover-background-color] px-6 py-5 shadow-xl [backdrop-filter:var(--popover-backdrop-filter)] md:w-auto",!(null==o?void 0:o.includes("max-w-"))&&"max-w-[600px]",o),children:n})]})};function Ki(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Hi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ki(Object(n),!0).forEach((function(t){Gi(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ki(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Gi(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Yi=t=>{let{application:n}=t;const[i,o,s,a,l]=function(e){const[t,n]=(0,He.useState)([]),[i,o]=(0,He.useState)(Date.now()),[s,a]=(0,He.useState)(!0),[l,c]=(0,He.useState)("");return(0,He.useEffect)((()=>{(async()=>{var t,i,o;a(!0);const s=await e.getSessions();if((0,r.isErrorResponse)(s))(null===(i=null===(t=s.data)||void 0===t?void 0:t.error)||void 0===i?void 0:i.message)?c(null===(o=s.data)||void 0===o?void 0:o.error.message):c("An unknown error occured while loading sessions.");else{const e=s.data;n(e),c("")}a(!1)})().catch(console.error)}),[e,i]),[t,function(){o(Date.now())},s,async function(i){const o=t,s=e.revokeSession(i),a=t.slice(),l=t.findIndex((e=>e.uuid===i));a[l]=Hi(Hi({},a[l]),{},{revoking:!0}),n(a);const u=await s;u?(0,r.isErrorResponse)(u)?(c((0,r.getErrorFromErrorResponse)(u).message||"An unknown error occured while revoking the session."),n(o)):n(t.filter((e=>e.uuid!==i))):n(o)},l]}(n),[c,u]=(0,He.useState)(""),d=()=>u(""),h=(0,He.useRef)(null),p=(0,He.useMemo)((()=>new Intl.DateTimeFormat(void 0,{year:"numeric",month:"long",day:"numeric",weekday:"long",hour:"numeric",minute:"numeric"})),[]),f=()=>{u("")},g=(0,He.useMemo)((()=>[{label:"Close",onClick:n.closeSessionsModal,type:"cancel",mobileSlot:"left"},{label:"Refresh",onClick:o,type:"primary",mobileSlot:"right"}]),[o,n.closeSessionsModal]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Gn,{title:"Active Sessions",close:n.closeSessionsModal,actions:g,children:(0,e.jsx)("div",{className:"px-4 py-4",children:s?(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(di.Z,{className:"h-3 w-3"}),(0,e.jsx)("h2",{className:"sk-p sessions-modal-refreshing",children:"Loading sessions"})]}):(0,e.jsxs)(e.Fragment,{children:[l&&(0,e.jsx)("div",{role:"alert",className:"sk-p bold",children:l}),i.length>0&&(0,e.jsx)("ul",{children:i.map((t=>(0,e.jsxs)("li",{children:[(0,e.jsx)("h2",{className:"text-base font-bold",children:t.device_info}),t.current?(0,e.jsx)("span",{className:"font-bold text-info",children:"Current session"}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("p",{children:["Signed in on ",p.format(new Date(t.created_at))]}),(0,e.jsx)(Ln.Z,{primary:!0,small:!0,colorStyle:"danger",disabled:t.revoking,onClick:()=>u(t.uuid),children:(0,e.jsx)("span",{children:"Revoke"})})]})]},t.uuid)))})]})})}),c&&(0,e.jsxs)(Vi,{closeDialog:f,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between text-lg font-bold",children:[r.SessionStrings.RevokeTitle,(0,e.jsx)("button",{className:"rounded p-1 font-bold hover:bg-contrast",onClick:f,children:(0,e.jsx)(xn.Z,{type:"close"})})]}),(0,e.jsx)("div",{className:"sk-panel-row",children:(0,e.jsx)("p",{className:"text-base text-foreground lg:text-sm",children:r.SessionStrings.RevokeText})}),(0,e.jsxs)("div",{className:"mt-4 flex justify-end gap-2",children:[(0,e.jsx)(Ln.Z,{ref:h,onClick:d,children:(0,e.jsx)("span",{children:r.SessionStrings.RevokeCancelButton})}),(0,e.jsx)(Ln.Z,{primary:!0,colorStyle:"danger",onClick:()=>{d(),a(c).catch(console.error)},children:(0,e.jsx)("span",{children:r.SessionStrings.RevokeConfirmButton})})]})]})]})},zi=(0,Nn.Pi)((t=>{let{application:n}=t;return(0,e.jsx)(Fr,{isOpen:n.isSessionsModalVisible,close:n.closeSessionsModal,className:"sessions-modal",children:(0,e.jsx)(Yi,{application:n})})}));class Zi{static async load(){const e=new Map;return(0,r.GetFeatures)().forEach((t=>{e.set(t.identifier,"Latest")})),new Zi(e)}constructor(e){this.latestVersionsMap=e,(0,_.ky)(this,{latestVersionsMap:_.LO.ref})}getVersion(e){return this.latestVersionsMap.get(e.package_info.identifier)}}const Wi=[{id:"whats-new",label:"What's New",icon:"asterisk",order:0},{id:"account",label:"Account",icon:"user",order:1},{id:"general",label:"General",icon:"settings",order:3},{id:"security",label:"Security",icon:"security",order:4},{id:"backups",label:"Backups",icon:"restore",order:5},{id:"appearance",label:"Appearance",icon:"themes",order:6},{id:"listed",label:"Listed",icon:"listed",order:7},{id:"shortcuts",label:"Shortcuts",icon:"keyboard",order:8},{id:"plugins",label:"Plugins",icon:"dashboard",order:8},{id:"accessibility",label:"Accessibility",icon:"accessibility",order:9},{id:"get-free-month",label:"Get a free month",icon:"star",order:10},{id:"help-feedback",label:"Help & feedback",icon:"help",order:11}],qi=[{id:"whats-new",label:"What's New",icon:"asterisk",order:0},{id:"account",label:"Account",icon:"user",order:1},{id:"general",label:"General",icon:"settings",order:3},{id:"security",label:"Security",icon:"security",order:4},{id:"backups",label:"Backups",icon:"restore",order:5},{id:"appearance",label:"Appearance",icon:"themes",order:6},{id:"listed",label:"Listed",icon:"listed",order:7},{id:"plugins",label:"Plugins",icon:"dashboard",order:8},{id:"help-feedback",label:"Help & feedback",icon:"help",order:11}];function Ji(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ji(Object(n),!0).forEach((function(t){$i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ji(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function $i(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class eo{constructor(e,n){this.application=e,this._enableUnfinishedFeatures=n,this._selectedPane="account",this._extensionLatestVersions=new Zi(new Map),this.selectPane=e=>{this._selectedPane=e};const r=this._enableUnfinishedFeatures?Wi.slice():qi.slice();e.featuresController.isVaultsEnabled()&&r.push({id:"vaults",label:"Vaults",icon:"safe-square",order:5}),(0,t.Z$)()&&r.push({id:"home-server",label:"Home Server",icon:"server",order:5}),this._menu=r.sort(((e,t)=>e.order-t.order)),this.loadLatestVersions(),(0,_.ky)(this,{_twoFactorAuth:_.LO,_selectedPane:_.LO,_extensionPanes:_.LO.ref,_extensionLatestVersions:_.LO.ref,loadLatestVersions:_.aD,updateMenuBubbleCounts:_.aD}),this.application.status.addEventObserver((e=>{e===Ne.rW4.PreferencesBubbleCountChanged&&this.updateMenuBubbleCounts()}))}updateMenuBubbleCounts(){this._menu=this._menu.map((e=>Xi(Xi({},e),{},{bubbleCount:this.application.status.getPreferencesBubbleCount(e.id)})))}loadLatestVersions(){Zi.load().then((e=>{e&&(this._extensionLatestVersions=e)})).catch(console.error)}get extensionsLatestVersions(){return this._extensionLatestVersions}get menuItems(){return this._menu.map((e=>Xi(Xi({},e),{},{selected:e.id===this._selectedPane,bubbleCount:this.application.status.getPreferencesBubbleCount(e.id),hasErrorIndicator:this.sectionHasBubble(e.id)})))}get selectedMenuItem(){return this._menu.find((e=>e.id===this._selectedPane))}get selectedPaneId(){return null!=this.selectedMenuItem?this.selectedMenuItem.id:"account"}sectionHasBubble(e){return"security"===e&&this.application.items.invalidNonVaultedItems.length>0}}const to=()=>(0,e.jsx)("button",{className:"peer flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-full bg-danger text-danger-contrast",children:(0,e.jsx)(xn.Z,{type:"warning",size:"small"})}),no=t=>{let{iconType:n,label:i,selected:o,onClick:s,bubbleCount:a,hasErrorIndicator:l}=t;return(0,e.jsxs)("div",{className:"preferences-menu-item box-border flex h-auto w-auto min-w-42 cursor-pointer select-none flex-row items-center justify-start rounded border border-solid px-4 py-2 text-sm hover:border-border hover:bg-default ".concat(o?"selected border-info font-bold text-info":"border-transparent"),onClick:e=>{e.preventDefault(),s()},children:[(0,e.jsxs)("div",{className:"relative mr-1",children:[(0,e.jsx)(xn.Z,{className:(0,r.classNames)("text-base",o?"text-info":"text-neutral"),type:n}),(0,e.jsx)(si,{position:"left",count:a})]}),(0,e.jsx)("div",{className:"min-w-1"}),i,l&&(0,e.jsx)("span",{className:"ml-2",children:(0,e.jsx)(to,{})})]})},ro=(0,Nn.Pi)((t=>{let{menu:n}=t;const{selectedPaneId:r,selectPane:i,menuItems:o}=n,s=(0,He.useMemo)((()=>o.map((e=>({icon:e.icon,label:e.label,value:e.id})))),[o]);return(0,e.jsxs)("div",{className:"border-b border-border bg-default px-5 py-2 md:border-0 md:bg-[--preferences-background-color] md:px-0 md:py-0",children:[(0,e.jsx)("div",{className:"hidden min-w-55 flex-col overflow-y-auto px-3 py-6 md:flex",children:o.map((t=>(0,e.jsx)(no,{iconType:t.icon,label:t.label,selected:t.selected,bubbleCount:t.bubbleCount,hasErrorIndicator:t.hasErrorIndicator,onClick:()=>{i(t.id)}},t.id)))}),(0,e.jsx)("div",{className:"md:hidden",children:(0,e.jsx)(wi.Z,{items:s,label:"Preferences Menu",value:r,onChange:e=>{i(e)},classNameOverride:{wrapper:"relative",button:"focus:outline-none focus:shadow-none focus:ring-none"},popoverPlacement:"bottom"})})]})})),io=t=>{let{children:n}=t;return(0,e.jsxs)("div",{className:"flex min-h-0 flex-grow flex-col overflow-y-auto text-foreground md:flex-row",children:[(0,e.jsx)("div",{className:"flex flex-grow flex-col items-center px-3 py-6 md:px-0",children:(0,e.jsx)("div",{className:"flex max-w-full flex-col md:w-125 md:max-w-125",children:null!=n&&Array.isArray(n)?n.filter((e=>null!=e)):n})}),(0,e.jsx)("div",{className:"hidden flex-shrink basis-[13.75rem] md:block"})]})};var oo=s(53846),so=s(55088);const ao=(0,Nn.Pi)((t=>{let{application:n}=t;const r=(0,He.useRef)(null),[i,o]=(0,He.useState)(!1),{isBackupEncrypted:s,isEncryptionEnabled:a,setIsBackupEncrypted:l,setIsEncryptionEnabled:c,setEncryptionStatusString:u}=n.accountMenuController,d=(0,He.useCallback)((()=>{const e=n.hasAccount(),t=n.hasPasscode(),r=e||t,i=e?ht.CN:t?ht.zu:ht.KV;u(i),c(r),l(r)}),[n,u,l,c]);(0,He.useEffect)((()=>{d()}),[d]);const h=async e=>{o(!0);const t=await n.importData(e);o(!1);let r=ht.ng;t.isFailed()?r=t.getError():t.getValue().errorCount&&(r=(0,ht.hy)(t.getValue().errorCount)),(0,L.Ne)({text:r})};return(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)(Ye.Z,{children:[(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Data backups"}),(0,e.jsx)(Ge.QE,{children:"Download a backup of all your text-based data"}),a&&(0,e.jsx)("form",{className:"sk-panel-form sk-panel-row",children:(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsxs)("label",{className:"flex items-center gap-2",children:[(0,e.jsx)("input",{type:"radio",onChange:()=>l(!0),checked:s}),(0,e.jsx)("span",{className:"text-base font-medium md:text-sm",children:"Encrypted"})]}),(0,e.jsxs)("label",{className:"flex items-center gap-2",children:[(0,e.jsx)("input",{type:"radio",onChange:()=>l(!1),checked:!s}),(0,e.jsx)("span",{className:"text-base font-medium md:text-sm",children:"Decrypted"})]})]})}),(0,e.jsx)(Ln.Z,{onClick:async()=>{const e=s?await n.createEncryptedBackupFile.execute():await n.createDecryptedBackupFile.execute();if(e.isFailed())return;const t=e.getValue(),r=new Blob([JSON.stringify(t,null,2)],{type:"text/json"});if(s){const e="Standard Notes Encrypted Backup and Import File - ".concat(n.archiveService.formattedDateForExports()),t=(0,Q.sanitizeFileName)(e)+".txt";(0,so.c)({archiveService:n.archiveService,platform:n.platform,mobileDevice:n.mobileDevice,blob:r,filename:t,isNativeMobileWeb:n.isNativeMobileWeb(),showToastOnAndroid:void 0})}else{const e=await n.archiveService.getZippedDecryptedItemsBlob(t),r="Standard Notes Backup - ".concat(n.archiveService.formattedDateForExports()),i=(0,Q.sanitizeFileName)(r)+".zip";(0,so.c)({archiveService:n.archiveService,platform:n.platform,mobileDevice:n.mobileDevice,blob:e,filename:i,isNativeMobileWeb:n.isNativeMobileWeb(),showToastOnAndroid:void 0})}},label:"Download backup",className:"mt-2"})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{children:"Import a previously saved backup file"}),(0,e.jsxs)("div",{className:"mt-3 flex flex-row items-center",children:[(0,e.jsx)(Ln.Z,{label:"Import backup",onClick:e=>{if(e instanceof KeyboardEvent){const{code:t}=e;if("Enter"!==t&&"Space"!==t)return;e.preventDefault()}r.current.click()}}),(0,e.jsx)("input",{type:"file",ref:r,onChange:async e=>{var t,r;const{files:i}=e.target;if(!i)return;const s=i[0],a=await(async e=>{if("application/zip"!==e.type)return new Promise((t=>{const r=new FileReader;r.onload=e=>{var r;try{const n=JSON.parse(null===(r=e.target)||void 0===r?void 0:r.result);t(n)}catch(e){n.alerts.alert(ht.fv).catch(console.error)}},r.readAsText(e)}));n.alerts.alert(ht.FG).catch(console.error)})(s);if(!a)return;const l=a.version||(null===(t=a.keyParams)||void 0===t?void 0:t.version)||(null===(r=a.auth_params)||void 0===r?void 0:r.version);l?n.encryption.supportedVersions().includes(l)?await h(a):(o(!1),(0,L.Ne)({text:ht.ip})):await h(a)},className:"hidden"}),i&&(0,e.jsx)(di.Z,{className:"ml-4"})]})]})]})})})),lo=(0,Nn.Pi)((n=>{let{application:i}=n;const[o,s]=(0,He.useState)(!1),[a,l]=(0,He.useState)(r.EmailBackupFrequency.Disabled),[c,u]=(0,He.useState)([]),d=i.hasAccount(),h=(0,He.useCallback)((async()=>{if(i.sessions.getUser()){s(!0);try{const e=await i.settings.listSettings();l(e.getSettingValue(r.SettingName.create(r.SettingName.NAMES.EmailBackupFrequency).getValue(),r.EmailBackupFrequency.Disabled))}catch(e){console.error(e)}finally{s(!1)}}}),[i]);(0,He.useEffect)((()=>{const e=[];for(const t in r.EmailBackupFrequency){const n=r.EmailBackupFrequency[t];e.push({value:n,label:i.settings.getEmailBackupFrequencyOptionLabel(n)})}u(e),h().catch(console.error)}),[i,h]);return(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Email backups"}),!(0,t.Z$)()&&(0,e.jsx)(Ge.xv,{className:"mb-3",children:"Receive daily encrypted email backups of all your notes directly in your email inbox."}),(0,e.jsxs)("div",{className:"".concat(d?"":"pointer-events-none cursor-default opacity-50"),children:[(0,e.jsx)(Ge.QE,{children:"Frequency"}),(0,e.jsx)(Ge.xv,{children:"How often to receive backups."}),(0,e.jsx)("div",{className:"mt-2",children:o?(0,e.jsx)(di.Z,{className:"h-5 w-5 flex-shrink-0"}):(0,e.jsx)(wi.Z,{label:"Select email frequency",items:c,value:a,onChange:e=>{(async e=>{const t=a;l(e),await(async(e,t)=>{try{return await i.settings.updateSetting(e,t,!1),!0}catch(e){return i.alerts.alert(ht.p7).catch(console.error),!1}})(r.SettingName.create(r.SettingName.NAMES.EmailBackupFrequency).getValue(),e)||l(t)})(e).catch(console.error)}})})]})]})})}));var co=s(54310);const uo=t=>{let{icon:n,status:r,checkmark:i=!0}=t;return(0,e.jsxs)("div",{className:"text-input no-border my-1 flex min-h-8 w-full flex-row items-center rounded bg-contrast px-3 py-1.5 focus-within:ring-info",children:[n,(0,e.jsx)("div",{className:"min-h-1 min-w-3"}),(0,e.jsx)("div",{className:"flex-grow text-sm text-text",children:r}),(0,e.jsx)("div",{className:"min-h-1 min-w-3"}),i&&(0,e.jsx)(xn.Z,{className:"min-h-4 min-w-4 text-success",type:"check-bold"})]})},ho=t=>{let{application:n}=t;const[i,o]=(0,He.useState)(void 0),[s,a]=(0,He.useState)(void 0),[l,c]=(0,He.useState)(void 0),[u,d]=(0,He.useState)(!1),h=(0,He.useMemo)((()=>new co.XQ),[]);(0,He.useEffect)((()=>{i?n.files.decryptBackupMetadataFile(i).then(a):a(void 0)}),[i,n]);const p=(0,He.useCallback)((async()=>{const e=await n.files.selectFile(h);"aborted"!==e&&"failed"!==e&&c(e)}),[n,h]),f=(0,He.useCallback)((async()=>{if(!s||!l)return;d(!0);const e=await n.files.readBackupFileAndSaveDecrypted(l,s,h);"success"===e?(n.alerts.alert("<strong>".concat(s.name,"</strong> has been successfully decrypted and saved to your chosen directory.")),c(void 0),a(void 0),o(void 0)):"failed"===e&&n.alerts.alert("Unable to save file to local directory. This may be caused by failure to decrypt, or failure to save the file locally."),d(!1)}),[s,n,l,h]),g=(0,He.useCallback)((async e=>{const t=await e.text(),r=n.files.isFileNameFileBackupRelated(e.name);if(!1!==r)if("binary"!==r)try{const e=JSON.parse(t);o(e)}catch(e){console.error(e)}else n.alerts.alert("Please drag the metadata file instead of the encrypted data file.")}),[n.alerts,n.files]),m=(0,He.useCallback)((e=>{e.stopPropagation()}),[]),y=(0,He.useCallback)((e=>{e.stopPropagation()}),[]),v=(0,He.useCallback)((e=>{e.stopPropagation()}),[]),A=(0,He.useCallback)((async e=>{var t;e.preventDefault(),e.stopPropagation();const n=null===(t=e.dataTransfer)||void 0===t?void 0:t.items;if(!n||0===n.length)return;const r=n[0].getAsFile();r&&(await g(r).catch(console.error),e.dataTransfer.clearData())}),[g]);return(0,He.useEffect)((()=>(window.addEventListener("dragenter",y),window.addEventListener("dragleave",v),window.addEventListener("dragover",m),window.addEventListener("drop",A),()=>{window.removeEventListener("dragenter",y),window.removeEventListener("dragleave",v),window.removeEventListener("dragover",m),window.removeEventListener("drop",A)})),[y,A,m,v]),i?(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)(ze.Z,{children:[!s&&(0,e.jsx)(Ge.xv,{children:"Attempting to decrypt metadata file..."}),s&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.Dx,{children:"Backup Decryption"}),(0,e.jsx)(uo,{status:s.name,icon:(0,e.jsx)(xn.Z,{type:"attachment-file",className:"min-h-5 min-w-5"}),checkmark:!0}),(0,e.jsx)(oo.Z,{classes:"mt-3 mb-3"}),(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)(Ge.QE,{children:"1. Choose related data file"}),(0,e.jsxs)(Ge.xv,{className:"em mr-3 text-xs ".concat(l?"success font-bold":""),children:[i.file.uuid,"/",r.FileBackupsConstantsV1.BinaryFileName]})]}),(0,e.jsx)("div",{children:(0,e.jsx)(Ln.Z,{label:"Choose",className:"min-w-40 px-1 text-xs",onClick:p,disabled:!!l})})]}),(0,e.jsx)(oo.Z,{classes:"mt-3 mb-3"}),(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)(Ge.QE,{children:"2. Decrypt and save file to your computer"}),(0,e.jsx)("div",{children:(0,e.jsx)(Ln.Z,{label:u?void 0:"Save",className:"min-w-40 px-1 text-xs",onClick:f,disabled:u||!l,children:u&&(0,e.jsx)("div",{className:"flex w-full justify-center",children:(0,e.jsx)(di.Z,{className:"h-5 w-5"})})})})]})]})]})}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(Ge.xv,{className:"mb-2",children:["To decrypt a backup file, drag and drop the file's respective ",(0,e.jsx)("i",{children:"metadata.sn.json"})," file here or select it below."]}),(0,e.jsx)(Ln.Z,{onClick:()=>{co.Re.selectFiles().then((async e=>{if(0===e.length)return;const t=e[0];g(t).catch(console.error)})).catch(console.error)},children:"Select file"})]})};var po=s(88669);const fo=(0,Nn.Pi)((t=>{let{backupsService:n}=t;const r=(0,sr.I)(),[i,o]=(0,He.useState)(n.isFilesBackupsEnabled()),[s,a]=(0,He.useState)(n.getFilesBackupsLocation()),l=(0,He.useCallback)((async()=>{const e=await n.changeFilesBackupsLocation();a(e)}),[n]),c=(0,He.useCallback)((async()=>{await n.openFilesBackupsLocation()}),[n]),u=(0,He.useCallback)((async()=>{i?n.disableFilesBackups():await n.enableFilesBackups(),o(n.isFilesBackupsEnabled()),a(n.getFilesBackupsLocation())}),[n,i]);return(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)(Ye.Z,{children:[(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Automatic file backups"}),(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)("div",{className:"mr-10 flex flex-col",children:(0,e.jsx)(Ge.QE,{children:"Automatically save encrypted backups of your uploaded files to this computer."})}),(0,e.jsx)(po.Z,{onChange:u,checked:i})]}),!i&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(oo.Z,{classes:"mt-2.5 mb-4"}),(0,e.jsx)(Ge.xv,{children:"File backups are not enabled. Enable to choose where your files are backed up."})]})]}),i&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsx)(ze.Z,{children:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.xv,{className:"mb-3",children:"Files backups are enabled. When you upload a new file on any device and open this application, files will be backed up in encrypted form to:"}),(0,e.jsx)(uo,{status:s||"Not Set",icon:(0,e.jsx)(xn.Z,{type:"attachment-file",className:"min-h-5 min-w-5"}),checkmark:!1}),(0,e.jsxs)("div",{className:"mt-2.5 flex flex-row",children:[(0,e.jsx)(Ln.Z,{label:"Open Location",className:"mr-3 text-xs",onClick:c}),(0,e.jsx)(Ln.Z,{label:"Change Location",className:"mr-3 text-xs",onClick:l})]})]})})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsx)(ze.Z,{children:(0,e.jsx)(ho,{application:r})})]})})})),go=t=>{let{application:n}=t;const r=(0,He.useMemo)((()=>n.fileBackups),[n]);return r?(0,e.jsx)(fo,{backupsService:r}):(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)(Ye.Z,{children:[(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Automatic file backups"}),(0,e.jsx)(Ge.QE,{children:"Automatically save encrypted backups of your files."}),(0,e.jsx)(Ge.xv,{className:"mt-3",children:"To enable file backups, use the Standard Notes desktop application."})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsx)(ze.Z,{children:(0,e.jsx)(ho,{application:n})})]})})},mo=(0,Nn.Pi)((t=>{let{backupsService:n}=t;const r=(0,sr.I)(),[i,o]=(0,He.useState)(n.isTextBackupsEnabled()),[s,a]=(0,He.useState)(n.getTextBackupsLocation()),l=(0,He.useCallback)((async()=>{const e=await n.changeTextBackupsLocation();a(e)}),[n]),c=(0,He.useCallback)((async()=>{await n.openTextBackupsLocation()}),[n]),u=(0,He.useCallback)((async()=>{i?n.disableTextBackups():await n.enableTextBackups(),o(n.isTextBackupsEnabled()),a(n.getTextBackupsLocation())}),[i,n]),d=(0,He.useCallback)((async()=>{var e;null===(e=r.desktopManager)||void 0===e||e.saveDesktopBackup()}),[r]);return(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)(Ye.Z,{children:[(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Automatic Encrypted Text Backups"}),(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)("div",{className:"mr-10 flex flex-col",children:(0,e.jsx)(Ge.QE,{children:"Automatically save encrypted text backups of all your note and tag data to this computer."})}),(0,e.jsx)(po.Z,{onChange:u,checked:i})]}),!i&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(oo.Z,{classes:"mt-2.5 mb-4"}),(0,e.jsx)(Ge.xv,{children:"Text backups are not enabled. Enable to choose where your data is backed up."})]})]}),i&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.xv,{className:"mb-3",children:"Text backups are enabled and saved to:"}),(0,e.jsx)(uo,{status:s||"Not Set",icon:(0,e.jsx)(xn.Z,{type:"attachment-file",className:"min-h-5 min-w-5"}),checkmark:!1}),(0,e.jsxs)("div",{className:"mt-2.5 flex flex-row",children:[(0,e.jsx)(Ln.Z,{label:"Open Location",className:"mr-3 text-xs",onClick:c}),(0,e.jsx)(Ln.Z,{label:"Change Location",className:"mr-3 text-xs",onClick:l})]})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsx)(Ge.xv,{className:"mb-3",children:"Backups are saved automatically throughout the day. You can perform a one-time backup now below."}),(0,e.jsx)("div",{className:"flex flex-row",children:(0,e.jsx)(Ln.Z,{label:"Perform Backup",className:"mr-3 text-xs",onClick:d})})]})]})]})})})),yo=t=>{let{application:n}=t;const r=(0,He.useMemo)((()=>n.fileBackups),[n]);return r?(0,e.jsx)(mo,{backupsService:r}):(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Automatic text backups"}),(0,e.jsx)(Ge.QE,{children:"Automatically save encrypted and decrypted backups of your note and tag data."}),(0,e.jsx)(Ge.xv,{className:"mt-3",children:"To enable text backups, use the Standard Notes desktop application."})]})})})},vo=(0,Nn.Pi)((t=>{let{backupsService:n}=t;const[r,i]=(0,He.useState)(n.isPlaintextBackupsEnabled()),[o,s]=(0,He.useState)(n.getPlaintextBackupsLocation()),a=(0,He.useCallback)((async()=>{const e=await n.changePlaintextBackupsLocation();s(e)}),[n]),l=(0,He.useCallback)((async()=>{await n.openPlaintextBackupsLocation()}),[n]),c=(0,He.useCallback)((async()=>{r?n.disablePlaintextBackups():await n.enablePlaintextBackups(),i(n.isPlaintextBackupsEnabled()),s(n.getPlaintextBackupsLocation())}),[r,n]);return(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)(Ye.Z,{children:[(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Automatic plaintext backups"}),(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)("div",{className:"mr-10 flex flex-col",children:(0,e.jsx)(Ge.QE,{children:"Automatically save backups of all your notes to this computer into plaintext, non-encrypted folders."})}),(0,e.jsx)(po.Z,{onChange:c,checked:r})]}),!r&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(oo.Z,{classes:"mt-2.5 mb-4"}),(0,e.jsx)(Ge.xv,{children:"Plaintext backups are not enabled. Enable to choose where your data is backed up."})]})]}),r&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsx)(ze.Z,{children:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.xv,{className:"mb-3",children:"Plaintext backups are enabled and saved to:"}),(0,e.jsx)(uo,{status:o||"Not Set",icon:(0,e.jsx)(xn.Z,{type:"attachment-file",className:"min-h-5 min-w-5"}),checkmark:!1}),(0,e.jsxs)("div",{className:"mt-2.5 flex flex-row",children:[(0,e.jsx)(Ln.Z,{label:"Open Location",className:"mr-3 text-xs",onClick:l}),(0,e.jsx)(Ln.Z,{label:"Change Location",className:"mr-3 text-xs",onClick:a})]})]})})]})]})})})),Ao=()=>{const t=(0,sr.I)(),n=(0,He.useMemo)((()=>t.fileBackups),[t]);return n?(0,e.jsx)(vo,{backupsService:n}):(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Automatic plaintext backups"}),(0,e.jsx)(Ge.QE,{children:"Automatically save backups of all your notes into plaintext, non-encrypted folders."}),(0,e.jsx)(Ge.xv,{className:"mt-3",children:"To enable plaintext backups, use the Standard Notes desktop application."})]})})})},bo=(0,Nn.Pi)((t=>{let{application:n}=t;const r=!n.sessions.isSignedIntoFirstPartyServer();return(0,e.jsxs)(io,{children:[(0,e.jsx)(ao,{application:n}),(0,e.jsx)(yo,{application:n}),(0,e.jsx)(Ao,{}),(0,e.jsx)(go,{application:n}),!r&&(0,e.jsx)(lo,{application:n})]})})),wo=t=>{let{application:n}=t;const[i,o]=(0,Er.D)(r.LocalPrefKey.EditorLineHeight),s=(0,He.useMemo)((()=>Object.values(r.EditorLineHeight).map((e=>({label:e,value:e})))),[]),[a,l]=(0,Er.D)(r.LocalPrefKey.EditorMonospaceEnabled),[c,u]=(0,Er.D)(r.LocalPrefKey.EditorFontSize),d=(0,He.useMemo)((()=>Object.values(r.EditorFontSize).map((e=>({label:e,value:e})))),[]),[h]=(0,Er.D)(r.LocalPrefKey.EditorLineWidth),p=(0,He.useCallback)((()=>{n.keyboardService.triggerCommand(L.Wu,!0)}),[n.keyboardService]);return(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Editor"}),(0,e.jsxs)("div",{className:"mt-2",children:[(0,e.jsxs)("div",{className:"flex justify-between gap-2 md:items-center",children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)(Ge.QE,{children:"Monospace Font"}),(0,e.jsx)(Ge.xv,{children:"Toggles the font style in plaintext and Super notes"})]}),(0,e.jsx)(po.Z,{onChange:()=>{l(!a)},checked:a})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)("div",{children:[(0,e.jsx)(Ge.QE,{children:"Font size"}),(0,e.jsx)(Ge.xv,{children:"Sets the font size in plaintext and Super notes"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(wi.Z,{label:"Select the font size for plaintext notes",items:d,value:c,onChange:e=>{u(e)}})})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)("div",{children:[(0,e.jsx)(Ge.QE,{children:"Line height"}),(0,e.jsx)(Ge.xv,{children:"Sets the line height (leading) in plaintext and Super notes"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(wi.Z,{label:"Select the line height for plaintext notes",items:s,value:i,onChange:e=>{o(e)}})})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)("div",{children:[(0,e.jsx)(Ge.QE,{children:"Editor width"}),(0,e.jsx)(Ge.xv,{children:"Sets the max editor width for all notes"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsxs)("button",{className:"flex w-full min-w-55 items-center justify-between rounded border border-border bg-default px-3.5 py-1.5 text-left text-base text-foreground md:w-fit lg:text-sm",onClick:p,children:[h===r.EditorLineWidth.FullWidth?"Full width":h,(0,e.jsx)(xn.Z,{type:"chevron-down",size:"normal"})]})})]})]})]})})},So=(0,Nn.Pi)((t=>{let{application:n}=t;const i=Qr(),[o,s]=(0,He.useState)([]),[a,l]=(0,Er.D)(r.LocalPrefKey.AutoLightThemeIdentifier),[c,u]=(0,Er.D)(r.LocalPrefKey.AutoDarkThemeIdentifier),[d,h]=(0,Er.D)(r.LocalPrefKey.UseSystemColorScheme),[p,f]=(0,Er.D)(r.LocalPrefKey.UseTranslucentUI);return(0,He.useEffect)((()=>{const e=new L.os(n.items),{thirdParty:t,native:i}=e.execute({excludeLayerable:!0}),o=[];o.push({label:"Default",value:"Default"}),o.push(...i.map((e=>({label:e.displayName,value:e.featureIdentifier,icon:n.features.getFeatureStatus(e.uniqueIdentifier)!==r.FeatureStatus.Entitled?Mn._:void 0})))),o.push(...t.map((e=>({label:e.displayName,value:e.featureIdentifier})))),s((0,r.naturalSort)(o,"label"))}),[n]),(0,e.jsxs)(io,{children:[(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Themes"}),(0,e.jsxs)("div",{className:"mt-2",children:[(0,e.jsxs)("div",{className:"flex justify-between gap-2 md:items-center",children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)(Ge.QE,{children:"Disable translucent UI"}),(0,e.jsx)(Ge.xv,{children:"Use opaque style for UI elements instead of translucency"})]}),(0,e.jsx)(po.Z,{onChange:()=>{f(!p)},checked:!p})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)("div",{className:"flex justify-between gap-2 md:items-center",children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)(Ge.QE,{children:"Use system color scheme"}),(0,e.jsx)(Ge.xv,{children:"Automatically change active theme based on your system settings."})]}),(0,e.jsx)(po.Z,{onChange:()=>{h(!d),n.preferences.getLocalValue(r.LocalPrefKey.AutoLightThemeIdentifier)||l(a),n.preferences.getLocalValue(r.LocalPrefKey.AutoDarkThemeIdentifier)||u(c),h(!d)},checked:d})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)("div",{children:[(0,e.jsx)(Ge.QE,{children:"Automatic Light Theme"}),(0,e.jsx)(Ge.xv,{children:"Theme to be used for system light mode:"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(wi.Z,{label:"Select the automatic light theme",items:o,value:a,onChange:e=>{const t=o.find((t=>t.value===e));t&&t.icon===Mn._?i.activate("".concat(t.label," theme")):l(e)},disabled:!d})})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)("div",{children:[(0,e.jsx)(Ge.QE,{children:"Automatic Dark Theme"}),(0,e.jsx)(Ge.xv,{children:"Theme to be used for system dark mode:"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(wi.Z,{label:"Select the automatic dark theme",items:o,value:c,onChange:e=>{const t=o.find((t=>t.value===e));t&&t.icon===Mn._?i.activate("".concat(t.label," theme")):u(e)},disabled:!d})})]})]})]})}),(0,e.jsx)(wo,{application:n})]})})),Co=(0,Nn.Pi)((t=>{let{application:n}=t;const[i,o]=(0,He.useState)((()=>n.getPreference(r.PrefKey.UpdateSavingStatusIndicator,r.PrefDefaults[r.PrefKey.UpdateSavingStatusIndicator])));return(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Tools"}),(0,e.jsx)("div",{children:(0,e.jsxs)("div",{className:"flex justify-between gap-2 md:items-center",children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)(Ge.QE,{children:"Show note saving status while editing"}),(0,e.jsx)(Ge.xv,{children:"Control whether the animated saving status is shown while editing. Error statuses are always shown regardless of preference."})]}),(0,e.jsx)(po.Z,{onChange:()=>{o(!i),n.setPreference(r.PrefKey.UpdateSavingStatusIndicator,!i).catch(console.error)},checked:i})]})})]})})}));var Eo=s(97168);const Io=t=>{let{name:n,description:r,toggleFeature:i,isEnabled:o}=t;return(0,e.jsxs)("div",{className:"flex justify-between gap-2 md:items-center",children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)(Ge.QE,{children:n}),(0,e.jsx)(Ge.xv,{children:r})]}),(0,e.jsx)(po.Z,{onChange:i,checked:o})]})},_o=t=>{let{application:n}=t;const[i,o]=(0,He.useState)([]),[s,a]=(0,He.useState)((()=>n.getPreference(r.PrefKey.PaneGesturesEnabled,r.PrefDefaults[r.PrefKey.PaneGesturesEnabled])));(0,He.useEffect)((()=>n.addSingleEventObserver(r.ApplicationEvent.PreferencesChanged,(async()=>{a(n.getPreference(r.PrefKey.PaneGesturesEnabled,r.PrefDefaults[r.PrefKey.PaneGesturesEnabled]))}))),[n]);const l=(0,He.useCallback)((()=>{const e=n.features.getExperimentalFeatures().map((e=>{var t,i;const o=(0,r.FindNativeFeature)(e);return{identifier:e,name:null!==(t=null==o?void 0:o.name)&&void 0!==t?t:e,description:null!==(i=null==o?void 0:o.description)&&void 0!==i?i:"",isEnabled:n.features.isExperimentalFeatureEnabled(e),isEntitled:n.features.getFeatureStatus(r.NativeFeatureIdentifier.create(e).getValue())===r.FeatureStatus.Entitled}})).filter((e=>e.identifier!==r.NativeFeatureIdentifier.TYPES.Vaults||ut()));o(e)}),[n]);(0,He.useEffect)((()=>{l()}),[l]);const c=Qr(),u=(0,et.ac)(et.Jj.sm)&&"boolean"==typeof s;return(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Labs"}),(0,e.jsxs)("div",{children:[u&&(0,e.jsx)(Io,{name:"Pane switch gestures",description:"Allows using gestures to navigate",isEnabled:s,toggleFeature:()=>{n.setPreference(r.PrefKey.PaneGesturesEnabled,!s)}}),i.map(((t,r)=>{let{identifier:o,name:s,description:a,isEnabled:u,isEntitled:d}=t;const h=i.length>1&&r!==i.length-1;return(0,e.jsxs)(He.Fragment,{children:[(0,e.jsx)(Io,{name:s,description:a,toggleFeature:()=>{d?(n.features.toggleExperimentalFeature(o),l()):c.activate(s)},isEnabled:u}),h&&(0,e.jsx)(oo.Z,{classes:"mt-2.5 mb-3"})]},o)})),0===i.length&&!u&&(0,e.jsx)("div",{className:"flex items-center justify-between",children:(0,e.jsx)("div",{className:"flex flex-col",children:(0,e.jsx)(Ge.xv,{children:"No experimental features available."})})})]})]})})},xo=(0,Nn.Pi)((t=>{let{application:n,onSuccess:i}=t;const[o,s]=(0,He.useState)(""),[a,l]=(0,He.useState)(!1),[c,u]=(0,He.useState)(!1),[d,h]=(0,He.useState)(!1);(0,He.useEffect)((()=>{n.features.hasOfflineRepo()&&h(!0)}),[n]);const p=async e=>{e.preventDefault();const t=n.homeServer,s=t&&await t.isHomeServerEnabled(),a=s&&await t.isHomeServerRunning();if(s){if(!a)return void await n.alerts.alert("Please start your home server before activating offline features.");const e=n.sessions.getUser();if(!e)return;const i=n.features.parseOfflineEntitlementsCode(o);if(i instanceof r.ClientDisplayableError)return void await n.alerts.alert(i.text);const s=await t.activatePremiumFeatures(e.email,i.subscriptionId);if(s.isFailed())return void await n.alerts.alert(s.getError())}const c=await n.features.setOfflineFeaturesCode(o);c instanceof r.ClientDisplayableError?await n.alerts.alert(c.text):(l(!0),h(!0),u(!1),i&&i())};return n.hasAccount()&&n.sessions.isSignedIntoFirstPartyServer()&&!d?null:(0,e.jsx)(e.Fragment,{children:(0,e.jsx)("div",{className:"flex items-center justify-between",children:(0,e.jsxs)("div",{className:"mt-3 flex w-full flex-col",children:[(0,e.jsxs)("div",{className:"flex flex-row items-center justify-between",children:[(0,e.jsxs)(Ge.QE,{children:[!d&&"Activate"," Offline Subscription"]}),(0,e.jsx)("a",{href:"https://standardnotes.com/help/59/can-i-use-standard-notes-totally-offline",target:"_blank",rel:"noreferrer",className:"text-info",children:"Learn more"})]}),(0,e.jsxs)("form",{onSubmit:p,children:[(0,e.jsx)("div",{className:"mt-2",children:!d&&(0,e.jsx)(ui.Z,{onChange:e=>s(e),placeholder:"Offline Subscription Code",value:o,disabled:a,className:{container:"mb-3"}})}),(a||c)&&(0,e.jsxs)("div",{className:"info mb-3 mt-3",children:["Your offline subscription code has been successfully ",a?"activated":"removed","."]}),d&&(0,e.jsx)(Ln.Z,{colorStyle:"danger",label:"Remove offline key",onClick:()=>{(async()=>{n.alerts.confirm(ht.ZW,"Remove offline key?","Remove Offline Key",r.ButtonType.Danger,"Cancel").then((async e=>{e&&await(async()=>{await n.features.deleteOfflineFeatureRepo(),l(!1),h(!1),s(""),u(!0)})()})).catch((e=>{n.alerts.alert(e).catch(console.error)}))})().catch(console.error)}}),!d&&!a&&(0,e.jsx)(Ln.Z,{hidden:0===o.length,label:"Submit",primary:!0,disabled:""===o,onClick:e=>p(e)})]})]})})})}));var Po=s(2577);const ko=t=>{let{title:n,className:i="",children:o,onClick:s}=t;const a=(0,He.useRef)(null),[l,c]=(0,He.useState)(!1);return(0,e.jsxs)("div",{className:i,children:[(0,e.jsxs)("div",{className:"relative flex cursor-pointer items-center justify-between hover:underline",onClick:()=>{c(!l),s&&s(!l)},children:[(0,e.jsx)(Ge.Dx,{children:n}),(0,e.jsx)(Po.ArrowDownCheckmarkIcon,{className:(0,r.classNames)("h-5 w-5 text-info",l&&"rotate-180")})]}),(0,e.jsx)("div",{className:"accordion-contents-container cursor-auto","data-is-expanded":l,ref:a,children:o})]})},Bo=(0,Nn.Pi)((()=>{const t=(0,sr.I)();return t.hasAccount()&&t.sessions.isSignedIntoFirstPartyServer()&&!t.features.hasOfflineRepo()?null:(0,e.jsx)(Ye.Z,{children:(0,e.jsx)(ze.Z,{children:(0,e.jsx)(ko,{title:"Offline activation",children:(0,e.jsx)("div",{className:"flex flex-row items-center",children:(0,e.jsx)("div",{className:"flex max-w-full flex-grow flex-col",children:t.platform!==r.Platform.Ios&&(0,e.jsx)(xo,{application:t})})})})})})})),Oo={title:"Title","title.length":"Title Length",text:"Text","text.length":"Text Length",noteType:"Note Type",authorizedForListed:"Authorized For Listed",editorIdentifier:"Editor Identifier",userModifiedDate:"User Modified Date",serverUpdatedAt:"Server Updated At",created_at:"Created At",conflict_of:"Conflict Of",protected:"Protected",trashed:"Trashed",pinned:"Pinned",archived:"Archived",locked:"Locked",starred:"Starred",hidePreview:"Hide Preview",spellcheck:"Spellcheck"},No={title:"string","title.length":"number",text:"string","text.length":"number",noteType:"noteType",authorizedForListed:"boolean",editorIdentifier:"editorIdentifier",userModifiedDate:"date",serverUpdatedAt:"date",created_at:"date",conflict_of:"string",protected:"boolean",trashed:"boolean",pinned:"boolean",archived:"boolean",locked:"boolean",starred:"boolean",hidePreview:"boolean",spellcheck:"boolean"};var Do=s(81222);function jo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function To(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jo(Object(n),!0).forEach((function(t){Mo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Mo(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fo(e){const t=[];return t.push(...(0,Et.GetIframeAndNativeEditors)().map((e=>{const[t,n]=(0,Do.i)(e.note_type);return To(To({label:e.name,value:e.identifier,id:Et.NativeFeatureIdentifier.create(e.identifier).getValue()},t?{icon:t}:null),n?{iconClassName:(0,r.classNames)("text-accessory-tint-".concat(n),e.note_type===Et.NoteType.Plain&&"group-hover:text-info-contrast")}:null)}))),t.push(...e.componentManager.thirdPartyComponentsForArea(Et.ComponentArea.Editor).filter((e=>{const t=(0,Et.FindNativeFeature)(e.identifier);return!t||t.deprecated})).map((e=>{const[t,n]=(0,Do.i)(e.noteType);return To(To({label:e.displayName,value:e.identifier},t?{icon:t}:null),n?{iconClassName:"text-accessory-tint-".concat(n)}:null)}))),t.sort(((e,t)=>e.label.toLowerCase()<t.label.toLowerCase()?-1:1)),t}const Ro=t=>{let{keypath:n,value:i,setValue:o}=t;const s=(0,sr.I)(),a=No[n],l=Fo(s);return"noteType"===a?(0,e.jsx)("select",{className:"flex-grow rounded border border-border bg-default px-2 py-1.5 focus:outline focus:outline-1 focus:outline-info",value:i,onChange:e=>{o(e.target.value)},children:Object.entries(r.NoteType).map((t=>{let[n,r]=t;return(0,e.jsx)("option",{value:r,children:n},n)}))}):"editorIdentifier"===a?(0,e.jsx)("select",{className:"flex-grow rounded border border-border bg-default px-2 py-1.5 focus:outline focus:outline-1 focus:outline-info",value:i,onChange:e=>{o(e.target.value)},children:l.map((t=>(0,e.jsx)("option",{value:t.value,children:t.label},t.value)))}):"string"===a||"date"===a?(0,e.jsx)("input",{className:"flex-grow rounded border border-border bg-default px-2 py-1.5",value:i,onChange:e=>{o(e.target.value)}}):"boolean"===a?(0,e.jsxs)("select",{className:"flex-grow rounded border border-border bg-default px-2 py-1.5 focus:outline focus:outline-1 focus:outline-info",value:i,onChange:e=>{o(e.target.value)},children:[(0,e.jsx)("option",{value:"true",children:"True"}),(0,e.jsx)("option",{value:"false",children:"False"})]}):"number"===a?(0,e.jsx)("input",{type:"number",className:"flex-grow rounded border border-border bg-default px-2 py-1.5",value:i,onChange:e=>{o(e.target.value)}}):null},Lo=(0,Nn.Pi)((t=>{let{controller:n}=t;const{operator:i,setOperator:o,predicates:s,setPredicate:a,changePredicateKeypath:l,addPredicate:c,removePredicate:u}=n;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsxs)("label",{className:"flex items-center gap-2",children:[(0,e.jsx)("input",{type:"radio",name:"predicate",value:"and",checked:"and"===i,onChange:e=>{o(e.target.value)}}),"Should match ALL conditions"]}),(0,e.jsxs)("label",{className:"flex items-center gap-2",children:[(0,e.jsx)("input",{type:"radio",name:"predicate",value:"or",checked:"or"===i,onChange:e=>{o(e.target.value)}}),"Should match ANY conditions"]})]}),s.map(((t,n)=>(0,e.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,e.jsxs)("div",{className:"flex w-full flex-col gap-2 md:flex-row md:items-center",children:[0!==n&&(0,e.jsx)("div",{className:"mr-2 text-sm font-semibold",children:"and"===i?"AND":"OR"}),(0,e.jsx)("select",{className:"flex-grow rounded border border-border bg-default px-2 py-1.5 focus:outline focus:outline-1 focus:outline-info",value:t.keypath,onChange:e=>{l(n,e.target.value)},children:Object.entries(Oo).map((t=>{let[n,r]=t;return(0,e.jsx)("option",{value:n,children:r},n)}))}),(0,e.jsx)("select",{className:"rounded border border-border bg-default px-2 py-1.5 focus:outline focus:outline-1 focus:outline-info",value:t.operator,onChange:e=>{a(n,{operator:e.target.value})},children:r.AllNonCompoundPredicateOperators.map((t=>(0,e.jsx)("option",{value:t,children:t},t)))}),t.keypath&&(0,e.jsx)(Ro,{keypath:t.keypath,value:"string"!=typeof t.value?JSON.stringify(t.value):t.value,setValue:e=>{a(n,{value:e})}}),0!==n&&(0,e.jsx)("button",{className:"rounded border border-border p-1 text-danger","aria-label":"Remove condition",onClick:()=>{u(n)},children:(0,e.jsx)(xn.Z,{type:"trash"})})]}),n===s.length-1&&(0,e.jsx)(Ln.Z,{className:"flex items-center gap-2",onClick:()=>{c()},children:"Add another condition"})]},n))),s.some((e=>"date"===No[e.keypath]))&&(0,e.jsxs)("div",{className:"flex flex-col gap-2 rounded-md border-2 border-info-backdrop bg-info-backdrop px-4 py-3 [&_code]:rounded [&_code]:bg-default [&_code]:px-1.5 [&_code]:py-1",children:[(0,e.jsx)("div",{className:"text-sm font-semibold",children:"Date Examples:"}),(0,e.jsxs)("ul",{className:"space-y-2 pl-4",children:[(0,e.jsxs)("li",{children:["To get all the items modified within the last 7 days, you can use ",(0,e.jsx)("code",{children:"User Modified Date"})," ",(0,e.jsx)("code",{children:">"})," ",(0,e.jsx)("code",{children:"7.days.ago"})]}),(0,e.jsxs)("li",{children:["To get all the items created before June 2022, you can use ",(0,e.jsx)("code",{children:"Created At"})," ",(0,e.jsx)("code",{children:"<"})," ",(0,e.jsx)("code",{children:"06/01/2022"})]})]})]})]})})),Qo=["state","id","children"];function Uo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Uo(Object(n),!0).forEach((function(t){Ko(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ko(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ho=t=>{let{state:n,id:r,children:i}=t,o=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,Qo);const{activeTab:s}=n;return s===r?(0,e.jsx)("div",Vo(Vo({role:"tabpanel",id:"tab-panel-".concat(r),"aria-labelledby":"tab-control-".concat(r)},o),{},{children:i})):null},Go=(0,He.createContext)(void 0),Yo=["id","className","children"];function zo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zo(Object(n),!0).forEach((function(t){Wo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Wo(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const qo=t=>{let{id:n,className:r,children:i}=t,o=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,Yo);const{state:s}=(()=>{const e=(0,He.useContext)(Go);if(void 0===e)throw new Error("useTabStateContext must be used within a <TabList/>");if(void 0===e.state)throw new Error("Tab state must be provided to the parent <TabList/>");return e})(),{activeTab:a,setActiveTab:l}=s,c=a===n;return(0,e.jsx)("button",Zo(Zo({role:"tab",id:"tab-control-".concat(n),onClick:()=>{l(n)},"aria-selected":c,"aria-controls":"tab-panel-".concat(n),className:(0,Q.classNames)("relative cursor-pointer border-0 bg-default px-3 py-2.5 text-sm focus:shadow-inner md:translucent-ui:bg-transparent",c?"font-medium text-info":"text-text",c&&"after:absolute after:bottom-0 after:left-0 after:h-[2px] after:w-full after:bg-info",r)},o),{},{children:i}))},Jo=["state","children"];function Xo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xo(Object(n),!0).forEach((function(t){es(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function es(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ts=t=>{let{state:n,children:r}=t,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,Jo);const o=(0,He.useMemo)((()=>({state:n})),[n]);return(0,e.jsx)(Go.Provider,{value:o,children:(0,e.jsx)("div",$o($o({role:"tablist"},i),{},{children:r}))})},ns=t=>{let{tabs:n,state:i,className:o,children:s}=t;return(0,e.jsxs)("div",{className:(0,r.classNames)("overflow-hidden rounded-md border border-border",o),children:[(0,e.jsx)(ts,{state:i,className:"border-b border-border",children:n.map((t=>{let{id:n,title:r}=t;return(0,e.jsx)(qo,{id:n,className:"first:rounded-tl-md",children:r},n)}))}),s]})},rs=t=>{let{code:n}=t;const r=(0,He.useRef)(null),[i,o]=(0,He.useState)(!1),[s,a]=(0,He.useState)(!1);return(0,e.jsxs)("div",{className:"group relative",onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[(0,e.jsx)("pre",{className:"overflow-auto rounded-md bg-default px-2.5 py-1.5",children:n}),(0,e.jsxs)("div",{className:"absolute right-1.5 top-1.5",children:[(0,e.jsx)("button",{ref:r,className:(0,Q.classNames)("peer rounded border border-border bg-default p-2 text-text hover:bg-contrast",!s&&"hidden"),onClick:()=>{navigator.clipboard.writeText(n).then((()=>{o(!0),setTimeout((()=>{var e;o(!1),null===(e=r.current)||void 0===e||e.blur()}),1e3)}),(()=>{(0,Y.fz)({type:Y.pC.Error,message:"Failed to copy to clipboard"}),o(!1)}))},children:(0,e.jsx)(xn.Z,{type:"copy",size:"small"})}),(0,e.jsx)("div",{className:(0,Q.classNames)(i&&s?"":"hidden","absolute right-0 top-full min-w-max translate-x-2 translate-y-1 select-none rounded border border-border bg-default px-3 py-1.5 text-left md:peer-hover:block"),children:i?"Copied!":"Copy example to clipboard"})]})]})},is=(0,Nn.Pi)((t=>{let{controller:n,platform:i}=t;const{isSaving:o,title:s,setTitle:a,icon:l,setIcon:c,closeModal:u,saveCurrentSmartView:d,predicateController:h,customPredicateJson:p,setCustomPredicateJson:f,isCustomJsonValidPredicate:g,setIsCustomJsonValidPredicate:m,validateAndPrettifyCustomPredicate:y}=n,v=(0,He.useRef)(null),A=(0,He.useRef)(null),[b,w]=(0,He.useState)(!1),S=(0,He.useRef)(null),C=(0,Ii.M)(),E=C.useState("open"),I=()=>{w((e=>!e))},_=(e=>{let{defaultTab:t}={defaultTab:"builder"};const[n,r]=(0,He.useState)(t);return{activeTab:n,setActiveTab:r}})(),x=(0,He.useCallback)((()=>{var e;s.length?"custom"!==_.activeTab||g?d():y():null===(e=v.current)||void 0===e||e.focus()}),[g,d,_.activeTab,s.length,y]),P="builder"===_.activeTab||g;(0,He.useEffect)((()=>{A.current&&"custom"===_.activeTab&&!1===g&&A.current.focus()}),[g,_.activeTab]);const k=(0,He.useMemo)((()=>[{label:"Cancel",onClick:u,disabled:o,type:"cancel",mobileSlot:"left"},{label:o?(0,e.jsx)(di.Z,{className:"h-4.5 w-4.5"}):P?"Save":"Validate",onClick:x,disabled:o,mobileSlot:"right",type:"primary"}]),[P,u,o,x]);return(0,e.jsx)(Gn,{title:"Add Smart View",close:u,actions:k,children:(0,e.jsx)("div",{className:"px-4 py-4",children:(0,e.jsxs)("div",{className:"flex h-full flex-col gap-4",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,e.jsx)("div",{className:"text-sm font-semibold",children:"Title:"}),(0,e.jsx)("input",{className:"rounded border border-border bg-default px-2 py-1 md:translucent-ui:bg-transparent",value:s,onChange:e=>{a(e.target.value)},ref:v})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,e.jsx)("div",{className:"text-sm font-semibold",children:"Icon:"}),(0,e.jsx)("button",{className:"rounded border border-border p-2","aria-label":"Change icon",onClick:I,ref:S,children:(0,e.jsx)(xn.Z,{type:l||r.SmartViewDefaultIconName})}),(0,e.jsx)(On.Z,{title:"Choose icon",open:b,anchorElement:S,togglePopover:I,align:"start",overrideZIndex:"z-modal",children:(0,e.jsx)("div",{className:"p-2",children:(0,e.jsx)(Ei,{selectedValue:l||r.SmartViewDefaultIconName,onIconChange:e=>{c(null!=e?e:r.SmartViewDefaultIconName),I()},platform:i,useIconGrid:!0})})})]}),(0,e.jsxs)("div",{className:"flex flex-grow flex-col gap-2.5",children:[(0,e.jsx)("div",{className:"text-sm font-semibold",children:"Predicate:"}),(0,e.jsxs)(ns,{className:"flex flex-grow flex-col",tabs:[{id:"builder",title:"Builder"},{id:"custom",title:"Custom (JSON)"}],state:_,children:[(0,e.jsx)(Ho,{state:_,id:"builder",className:"flex flex-col gap-2.5 p-4",children:(0,e.jsx)(Lo,{controller:h})}),(0,e.jsxs)(Ho,{state:_,id:"custom",className:"flex flex-grow flex-col",children:[(0,e.jsx)("textarea",{className:"h-full min-h-[10rem] w-full flex-grow resize-none bg-default px-2.5 py-1.5 font-mono text-sm",value:p,onChange:e=>{f(e.target.value),m(void 0)},spellCheck:!1,ref:A}),p&&!1===g&&(0,e.jsx)("div",{className:"border-t border-border px-2.5 py-1.5 text-sm text-danger",children:"Invalid JSON. Double check your entry and try again."})]})]}),"custom"===_.activeTab&&(0,e.jsxs)("div",{className:"flex flex-col gap-1.5 rounded-md border-2 border-info-backdrop bg-info-backdrop px-4 py-3",children:[(0,e.jsxs)(_i.p,{store:C,className:"flex items-center justify-between focus:shadow-none focus:outline-none",children:[(0,e.jsx)("div",{className:"text-sm font-semibold",children:"Examples"}),(0,e.jsx)(xn.Z,{type:E?"chevron-up":"chevron-down"})]}),(0,e.jsxs)(xi.k_,{store:C,className:(0,Q.classNames)(E&&"flex","flex-col gap-2.5"),children:[(0,e.jsx)("div",{className:"text-sm font-medium",children:"1. List notes that are conflicted copies of another note:"}),(0,e.jsx)(rs,{code:'{\n  "keypath": "content.conflict_of.length",\n  "operator": ">",\n  "value": 0\n}'}),(0,e.jsx)("div",{className:"text-sm font-medium",children:"2. List notes that have the tag `todo` but not the tag `completed`:"}),(0,e.jsx)(rs,{code:'{\n  "operator": "and",\n  "value": [\n    {\n      "operator": "not",\n      "value": {\n        "keypath": "tags",\n        "operator": "includes",\n        "value": {\n          "keypath": "title",\n          "operator": "=",\n          "value": "completed"\n        }\n      }\n    },\n    {\n      "keypath": "tags",\n      "operator": "includes",\n      "value": {\n        "keypath": "title",\n        "operator": "=",\n        "value": "todo"\n      }\n    }\n  ]\n}\n'})]})]})]})]})})})}));function os(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ss(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?os(Object(n),!0).forEach((function(t){as(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):os(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function as(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class ls{constructor(){this.operator="and",this.predicates=[{keypath:"title",operator:"!=",value:""}],this.setOperator=e=>{this.operator=e},this.setPredicate=(e,t)=>{const n=this.predicates[e];this.predicates[e]=ss(ss({},n),t)},this.changePredicateKeypath=(e,t)=>{const n=this.predicates[e].keypath,i=No[t];if(No[n]!==i)switch(i){case"string":this.setPredicate(e,{value:""});break;case"boolean":this.setPredicate(e,{value:!0});break;case"number":this.setPredicate(e,{value:0});break;case"noteType":this.setPredicate(e,{value:Object.values(r.NoteType)[0]});break;case"editorIdentifier":this.setPredicate(e,{value:Et.NativeFeatureIdentifier.TYPES.PlainEditor});break;case"date":this.setPredicate(e,{value:"1.days.ago"})}this.setPredicate(e,{keypath:t})},this.addPredicate=()=>{this.predicates.push({keypath:"title",operator:"!=",value:""})},this.removePredicate=e=>{this.predicates.splice(e,1)},(0,_.rC)(this,{operator:_.LO,setOperator:_.aD,predicates:_.LO,setPredicate:_.aD,addPredicate:_.aD,removePredicate:_.aD})}toJson(){return{operator:this.operator,value:this.predicates}}resetState(){this.operator="and",this.predicates=[{keypath:"title",operator:"!=",value:""}]}}class cs{constructor(e){this.application=e,this.isAddingSmartView=!1,this.isSaving=!1,this.title="",this.icon=r.SmartViewDefaultIconName,this.predicateController=new ls,this.customPredicateJson=void 0,this.isCustomJsonValidPredicate=void 0,this.setIsAddingSmartView=e=>{this.isAddingSmartView=e},this.setIsSaving=e=>{this.isSaving=e},this.setTitle=e=>{this.title=e},this.setIcon=e=>{this.icon=e},this.setCustomPredicateJson=e=>{this.customPredicateJson=e},this.setIsCustomJsonValidPredicate=e=>{this.isCustomJsonValidPredicate=e},this.closeModal=()=>{this.setIsAddingSmartView(!1),this.setTitle(""),this.setIcon(""),this.setIsSaving(!1),this.predicateController.resetState(),this.setCustomPredicateJson(""),this.setIsCustomJsonValidPredicate(void 0)},this.saveCurrentSmartView=async()=>{if(this.setIsSaving(!0),!this.title)return void this.setIsSaving(!1);const e=this.customPredicateJson&&this.isCustomJsonValidPredicate?JSON.parse(this.customPredicateJson):this.predicateController.toJson(),t=(0,r.predicateFromJson)(e);await this.application.mutator.createSmartView({title:this.title,predicate:t,iconString:this.icon,vault:this.application.vaultDisplayService.exclusivelyShownVault}),this.setIsSaving(!1),this.closeModal()},this.validateAndPrettifyCustomPredicate=()=>{if(this.customPredicateJson)try{const e=JSON.parse(this.customPredicateJson);(0,r.predicateFromJson)(e)?(this.setCustomPredicateJson(JSON.stringify(e,null,2)),this.setIsCustomJsonValidPredicate(!0)):this.setIsCustomJsonValidPredicate(!1)}catch(e){return void this.setIsCustomJsonValidPredicate(!1)}else this.setIsCustomJsonValidPredicate(!1)},(0,_.rC)(this,{isAddingSmartView:_.LO,setIsAddingSmartView:_.aD,isSaving:_.LO,setIsSaving:_.aD,title:_.LO,setTitle:_.aD,icon:_.LO,setIcon:_.aD,customPredicateJson:_.LO,isCustomJsonValidPredicate:_.LO,setCustomPredicateJson:_.aD,setIsCustomJsonValidPredicate:_.aD})}}const us=(0,Nn.Pi)((t=>{let{controller:n,platform:i}=t;const{view:o,title:s,setTitle:a,predicateJson:l,setPredicateJson:c,isPredicateJsonValid:u,setIsPredicateJsonValid:d,icon:h,setIcon:p,save:f,isSaving:g,closeDialog:m,deleteView:y}=n,v=(0,He.useRef)(null),A=(0,He.useRef)(null),[b,w]=(0,He.useState)(!1),S=(0,He.useRef)(null),C=(0,He.useCallback)((()=>{w((e=>!e))}),[]),E=(0,He.useCallback)((async()=>{var e;s.length?f():null===(e=v.current)||void 0===e||e.focus()}),[f,s.length]);(0,He.useEffect)((()=>{A.current&&!1===u&&A.current.focus()}),[u]);const I=(0,He.useMemo)((()=>[{label:"Delete",onClick:y,disabled:g,type:"destructive"},{label:"Cancel",onClick:m,disabled:g,type:"cancel",mobileSlot:"left"},{label:g?(0,e.jsx)(di.Z,{className:"h-4.5 w-4.5"}):"Save",onClick:E,disabled:g,type:"primary",mobileSlot:"right"}]),[m,y,g,E]);return o?(0,e.jsx)(Gn,{title:'Edit Smart View "'.concat(o.title,'"'),close:m,actions:I,children:(0,e.jsx)("div",{className:"px-4 py-4",children:(0,e.jsxs)("div",{className:"flex h-full flex-col gap-4",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,e.jsx)("div",{className:"text-sm font-semibold",children:"Title:"}),(0,e.jsx)("input",{className:"rounded border border-border bg-default px-2 py-1 md:translucent-ui:bg-transparent",value:s,onChange:e=>{a(e.target.value)},ref:v})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,e.jsx)("div",{className:"text-sm font-semibold",children:"Icon:"}),(0,e.jsx)("button",{className:"rounded border border-border p-2","aria-label":"Change icon",onClick:C,ref:S,children:(0,e.jsx)(xn.Z,{type:h||r.SmartViewDefaultIconName})}),(0,e.jsx)(On.Z,{title:"Choose icon",open:b,anchorElement:S,togglePopover:C,align:"start",overrideZIndex:"z-modal",children:(0,e.jsx)("div",{className:"p-2",children:(0,e.jsx)(Ei,{selectedValue:h||r.SmartViewDefaultIconName,onIconChange:e=>{p(e||r.SmartViewDefaultIconName),C()},platform:i,useIconGrid:!0})})})]}),(0,e.jsxs)("div",{className:"flex flex-grow flex-col gap-2.5",children:[(0,e.jsx)("div",{className:"text-sm font-semibold",children:"Predicate:"}),(0,e.jsxs)("div",{className:"flex flex-grow flex-col overflow-hidden rounded-md border border-border",children:[(0,e.jsx)("textarea",{className:"h-full min-h-[10rem] w-full flex-grow resize-none bg-default px-2.5 py-1.5 font-mono text-sm md:translucent-ui:bg-transparent",value:l,onChange:e=>{c(e.target.value),d(!0)},spellCheck:!1,ref:A}),!u&&(0,e.jsx)("div",{className:"border-t border-border px-2.5 py-1.5 text-sm text-danger",children:"Invalid JSON. Double check your entry and try again."})]})]})]})})}):null})),ds=t=>{let{view:n,onEdit:r,onDelete:i}=t;const o=(0,He.useCallback)((()=>i(n)),[i,n]);return(0,e.jsxs)("div",{className:"flex items-center gap-2 py-1.5",children:[(0,e.jsx)(xn.Z,{type:n.iconString,size:"custom",className:"h-5.5 w-5.5 flex-shrink-0"}),(0,e.jsx)("span",{className:"mr-auto overflow-hidden text-ellipsis text-sm",children:n.title}),(0,e.jsx)(Ln.Z,{small:!0,onClick:r,children:"Edit"}),(0,e.jsx)(Ln.Z,{small:!0,onClick:o,children:"Delete"})]})},hs=t=>{let{application:n,title:r,message:i,className:o}=t;return(0,e.jsxs)("div",{className:(0,Q.classNames)("grid grid-cols-1 rounded-md border border-border p-4",o),children:[(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)(xn.Z,{className:(0,Q.classNames)("-ml-1 mr-1 h-5 w-5",Mn.K),type:Mn._}),(0,e.jsx)("h1",{className:"sk-h3 m-0 text-sm font-semibold",children:r})]}),(0,e.jsx)("p",{className:"col-start-1 col-end-3 m-0 mt-1 text-sm",children:i}),(0,e.jsx)(Ln.Z,{primary:!0,small:!0,className:"col-start-1 col-end-3 mt-3 justify-self-start uppercase",onClick:()=>{n.isNativeIOS()?n.showPremiumModal():n.openPurchaseFlow()},children:"Upgrade Features"})]})};class ps{constructor(e){this.application=e,this.title="",this.icon=r.SmartViewDefaultIconName,this.predicateJson="",this.isPredicateJsonValid=!1,this.isSaving=!1,this.view=void 0,this.setTitle=e=>{this.title=e},this.setIcon=e=>{this.icon=e},this.setPredicateJson=e=>{this.predicateJson=e},this.setIsPredicateJsonValid=e=>{this.isPredicateJsonValid=e},this.setView=e=>{this.view=e,e&&(this.setTitle(e.title),this.setIcon(e.iconString),this.setPredicateJson(JSON.stringify(e.predicate.toJson(),null,2)),this.setIsPredicateJsonValid(!0))},this.setIsSaving=e=>{this.isSaving=e},this.closeDialog=()=>{this.setView(void 0),this.setTitle(""),this.setIcon(r.SmartViewDefaultIconName),this.setPredicateJson("")},this.save=async()=>{this.view&&(this.validateAndPrettifyCustomPredicate(),this.isPredicateJsonValid&&(this.setIsSaving(!0),await this.application.changeAndSaveItem.execute(this.view,(e=>{e.title=this.title,e.iconString=this.icon||r.SmartViewDefaultIconName,e.predicate=JSON.parse(this.predicateJson)})),this.setIsSaving(!1),this.closeDialog()))},this.deleteView=async()=>{if(!this.view)return;const e=this.view;this.closeDialog(),await(0,L.VG)({text:ht.$n,confirmButtonStyle:"danger"})&&this.application.mutator.deleteItem(e).then((()=>this.application.sync.sync())).catch(console.error)},this.validateAndPrettifyCustomPredicate=()=>{try{const e=JSON.parse(this.predicateJson);(0,r.predicateFromJson)(e)?(this.setPredicateJson(JSON.stringify(e,null,2)),this.setIsPredicateJsonValid(!0)):this.setIsPredicateJsonValid(!1)}catch(e){return void this.setIsPredicateJsonValid(!1)}},(0,_.rC)(this,{title:_.LO,icon:_.LO,predicateJson:_.LO,isPredicateJsonValid:_.LO,isSaving:_.LO,view:_.LO,setTitle:_.aD,setIcon:_.aD,setPredicateJson:_.aD,setIsPredicateJsonValid:_.aD,setIsSaving:_.aD,setView:_.aD})}}const fs=(0,Nn.Pi)((t=>{let{application:n,featuresController:i}=t;const o=(0,He.useMemo)((()=>new cs(n)),[n]),s=(0,He.useMemo)((()=>new ps(n)),[n]),[a,l]=(0,He.useState)((()=>n.items.getSmartViews().filter((e=>!(0,r.isSystemView)(e)))));(0,He.useEffect)((()=>n.items.streamItems([r.ContentType.TYPES.SmartView],(()=>{l(n.items.getSmartViews().filter((e=>!(0,r.isSystemView)(e))))}))),[n]);const c=(0,He.useCallback)((async e=>{await(0,L.VG)({text:ht.$n,confirmButtonStyle:"danger"})&&n.mutator.deleteItem(e).then((()=>n.sync.sync())).catch(console.error)}),[n.mutator,n.sync]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Smart Views"}),!i.hasSmartViews&&(0,e.jsx)(hs,{className:"mt-2",application:n,title:"Upgrade for smart views",message:"Create smart views to organize your notes according to conditions you define."}),i.hasSmartViews&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"my-2 flex flex-col",children:a.map((t=>(0,e.jsx)(ds,{view:t,onEdit:()=>s.setView(t),onDelete:c},t.uuid)))}),(0,e.jsx)(Ln.Z,{onClick:()=>{o.setIsAddingSmartView(!0)},children:"Create Smart View"})]})]})}),(0,e.jsx)(Fr,{isOpen:!!s.view,close:s.closeDialog,children:(0,e.jsx)(us,{controller:s,platform:n.platform})}),(0,e.jsx)(Fr,{isOpen:o.isAddingSmartView,close:o.closeModal,children:(0,e.jsx)(is,{controller:o,platform:n.platform})})]})}));var gs=s(81959),ms=s(26013);const ys=(0,Nn.Pi)((t=>{let{application:n}=t;const i=n.momentsService.isEnabled,o=Qr(),s=(0,Er.Z)(r.PrefKey.MomentsDefaultTagUuid),[a,l]=(0,He.useState)();(0,He.useEffect)((()=>{if(!s)return void l(void 0);const e=n.items.findItem(s);l(e)}),[s,n]);const c=(0,He.useCallback)((()=>{n.featuresController.entitledToFiles?n.momentsService.enableMoments():o.activate("Moments")}),[n,o]),u=(0,He.useCallback)((()=>{n.momentsService.disableMoments()}),[n]),d=(0,He.useCallback)((()=>{i?u():c()}),[i,c,u]),h=(0,He.useCallback)((()=>{n.featuresController.entitledToFiles?n.momentsService.takePhoto():o.activate("Moments")}),[n,o]),p=(0,He.useCallback)((e=>{n.setPreference(r.PrefKey.MomentsDefaultTagUuid,e.uuid)}),[n]),f=(0,He.useCallback)((async()=>{n.setPreference(r.PrefKey.MomentsDefaultTagUuid,void 0)}),[n]);return(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex items-start",children:[(0,e.jsx)(Ge.Dx,{children:"Moments"}),(0,e.jsx)(Ge.DR,{style:"success",children:"Labs"}),(0,e.jsx)(Ge.DR,{style:"info",children:"Professional"})]}),(0,e.jsx)(po.Z,{onChange:d,checked:i})]}),(0,e.jsx)(Ge.QE,{children:"Your personal photo journal"}),i&&(0,e.jsxs)("div",{className:"mb-2 flex items-center",children:[a&&(0,e.jsx)("div",{children:(0,e.jsx)(ms.Z,{className:"m-1 mr-2",link:(0,un.X)(a,"linked"),unlinkItem:f,isBidirectional:!1,inlineFlex:!0})}),(0,e.jsx)(gs.Z,{onSelection:p,placeholder:"Select tag to save Moments to...",contentTypes:[r.ContentType.TYPES.Tag]})]}),(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)("div",{className:"flex flex-col"}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.xv,{children:"Moments lets you capture photos of yourself throughout the day, creating a visual record of your life, one photo at a time. Using your webcam or mobile selfie-cam, Moments takes a photo of you every half hour. All photos are end-to-end encrypted and stored in your files. Enable Moments on a per-device basis to get started."}),(0,e.jsx)("div",{className:"mt-5 flex flex-row flex-wrap gap-3",children:(0,e.jsx)(Ln.Z,{colorStyle:"info",onClick:h,children:"Capture Present Moment"})})]})]})]})})})),vs=[{label:"Current date and time",value:r.NewNoteTitleFormat.CurrentDateAndTime},{label:"Current note count",value:r.NewNoteTitleFormat.CurrentNoteCount},{label:"Custom format",value:r.NewNoteTitleFormat.CustomFormat},{label:"Empty",value:r.NewNoteTitleFormat.Empty}];class As extends He.Component{constructor(e){super(e),this.state={}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(e,t)}render(){return this.state.error?(0,e.jsxs)("div",{className:"text-danger",children:[(0,e.jsx)("span",{children:"Something went wrong rendering this component: "}),(0,e.jsx)("span",{className:"font-bold",children:this.state.error.message})]}):this.props.children}}const bs="https://day.js.org/docs/en/display/format#list-of-all-available-formats",ws=()=>{const t=(0,sr.I)(),n=Qr(),[i,o]=(0,He.useState)([]);(0,He.useEffect)((()=>{o(Fo(t))}),[t]);const[s,a]=(0,He.useState)(r.NativeFeatureIdentifier.TYPES.PlainEditor),[l,c]=(0,He.useState)(r.NewNoteTitleFormat.CurrentDateAndTime),[u,d]=(0,He.useState)(""),h=(0,He.useCallback)((()=>{const e=t.componentManager.getDefaultEditorIdentifier();a(e),c(t.getPreference(r.PrefKey.NewNoteTitleFormat,r.PrefDefaults[r.PrefKey.NewNoteTitleFormat])),d(t.getPreference(r.PrefKey.CustomNoteTitleFormat,r.PrefDefaults[r.PrefKey.CustomNoteTitleFormat]))}),[t]);(0,He.useEffect)((()=>{h()}),[h]);const p=(0,He.useCallback)((e=>{let o;const s=r.NativeFeatureIdentifier.create(e);if(s.isFailed()){const n=t.componentManager.findComponentWithPackageIdentifier(e);n&&(o=r.Uuid.create(n.uuid).getValue())}else o=s.getValue();if(o)if(t.features.getFeatureStatus(o)===r.FeatureStatus.Entitled)a(e),t.setPreference(r.PrefKey.DefaultEditorIdentifier,e);else{if(s.getValue().value===r.NativeFeatureIdentifier.TYPES.SuperEditor)return void n.showSuperDemo();const t=i.find((t=>t.value===e));t&&n.activate(t.label)}}),[t,i,n]),f=(0,He.useCallback)((e=>{c(e),t.setPreference(r.PrefKey.NewNoteTitleFormat,e)}),[t]),g=(0,He.useRef)();return(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"New Note Defaults"}),(0,e.jsxs)("div",{className:"mt-2",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)(Ge.QE,{children:"Note Type"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(wi.Z,{label:"Select the default note type",items:i,value:s,onChange:e=>p(e)})})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)("div",{children:[(0,e.jsx)(Ge.QE,{children:"Title Format"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(wi.Z,{label:"Select the format for the note title",items:vs,value:l,onChange:f})}),l===r.NewNoteTitleFormat.CustomFormat&&(0,e.jsxs)("div",{className:"mt-2",children:[(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)("input",{className:(0,r.classNames)("w-full min-w-55 rounded border border-solid border-passive-3 bg-default px-2 py-1.5 text-base md:w-auto md:translucent-ui:bg-transparent lg:text-sm","focus-within:ring-2 focus-within:ring-info"),placeholder:"e.g. YYYY-MM-DD",value:u,onChange:e=>{const n=e.currentTarget.value;d(n),g.current&&clearTimeout(g.current),g.current=window.setTimeout((async()=>{t.setPreference(r.PrefKey.CustomNoteTitleFormat,n)}),25)},spellCheck:!1})}),(0,e.jsxs)("div",{className:"mt-3 text-neutral",children:[(0,e.jsx)("span",{className:"font-bold",children:"Preview: "}),(0,e.jsx)(As,{children:(0,e.jsx)("em",{children:Gt(void 0,u)})})]}),(0,e.jsxs)("div",{className:"mt-2 text-neutral",children:[(0,e.jsx)("a",{className:"underline",href:bs,rel:"noreferrer",target:"_blank",onClick:e=>{t.isNativeMobileWeb()&&(e.preventDefault(),t.mobileDevice.openUrl(bs))},children:"Options"}),". Use ",(0,e.jsx)("code",{children:"[]"})," to escape formatting."]})]})]})]})]})})},Ss=(0,Nn.Pi)((()=>{const t=(0,sr.I)();return(0,e.jsxs)(io,{children:[(0,e.jsx)(We,{application:t}),(0,e.jsx)(Eo.Z,{application:t}),(0,e.jsx)(ws,{}),(0,e.jsx)(Co,{application:t}),(0,e.jsx)(fs,{application:t,featuresController:t.featuresController}),(0,e.jsx)(ys,{application:t}),(0,e.jsx)(_o,{application:t}),(0,e.jsx)(Bo,{})]})})),Cs=(0,Nn.Pi)((t=>{let{application:n}=t;return(0,e.jsx)(Ye.Z,{children:(0,e.jsx)(ze.Z,{children:(0,e.jsxs)("div",{className:"flex flex-col items-center px-4 md:px-12",children:[(0,e.jsx)(Po.AccountIllustration,{className:"mb-3"}),(0,e.jsx)(Ge.Dx,{children:"You're not signed in"}),(0,e.jsx)("div",{className:"mb-3 text-center text-base lg:text-sm",children:"Sign in to sync your notes and preferences across all your devices and enable end-to-end encryption."}),(0,e.jsx)(Ln.Z,{primary:!0,label:"Create free account",onClick:()=>{n.preferencesController.closePreferences(),n.accountMenuController.setCurrentPane(qt.V.Register),n.accountMenuController.setShow(!0)},className:"mb-3"}),(0,e.jsxs)("div",{className:"text-base lg:text-sm",children:["Already have an account?"," ",(0,e.jsx)("button",{className:"cursor-pointer border-0 bg-default p-0 text-info underline",onClick:()=>{n.preferencesController.closePreferences(),n.accountMenuController.setCurrentPane(qt.V.SignIn),n.accountMenuController.setShow(!0)},children:"Sign in"})]})]})})})})),Es="block mb-1",Is=t=>{let{setNewEmail:n,setCurrentPassword:r}=t;return(0,e.jsxs)("div",{className:"flex w-full flex-col",children:[(0,e.jsxs)("div",{className:"mb-3",children:[(0,e.jsx)("label",{className:Es,htmlFor:"change-email-email-input",children:"New Email"}),(0,e.jsx)(ui.Z,{type:"email",id:"change-email-email-input",onChange:e=>{n(e)}})]}),(0,e.jsxs)("div",{className:"mb-2",children:[(0,e.jsx)("label",{className:Es,htmlFor:"change-email-password-input",children:"Current Password"}),(0,e.jsx)(gi.Z,{id:"change-email-password-input",type:"password",onChange:e=>{r(e)}})]})]})},_s=()=>(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mb-2 font-bold text-info",children:"Your email has been successfully changed."}),(0,e.jsx)("p",{children:"Please ensure you are running the latest version of Standard Notes on all platforms to ensure maximum compatibility."})]});var xs,Ps;!function(e){e.Default="Continue",e.GeneratingKeys="Generating Keys...",e.Finish="Finish"}(xs||(xs={})),function(e){e[e.InitialStep=0]="InitialStep",e[e.FinishStep=1]="FinishStep"}(Ps||(Ps={}));const ks=t=>{let{onCloseDialog:n,application:r}=t;const[i,o]=(0,He.useState)(""),[s,a]=(0,He.useState)(""),[l,c]=(0,He.useState)(!1),[u,d]=(0,He.useState)(!1),[h,p]=(0,He.useState)(xs.Default),[f,g]=(0,He.useState)(Ps.InitialStep);(0,He.useEffect)((()=>(window.onbeforeunload=()=>!0,()=>{window.onbeforeunload=null})),[]);const m=r.alerts,y=(0,He.useCallback)((async()=>{if(!i||0===i.length)return m.alert("Please enter your current password.").catch(console.error),!1;return await r.validateAccountPassword(i)||(m.alert("The current password you entered is not correct. Please try again.").catch(console.error),!1)}),[r,m,i]),v=()=>{p(xs.Default),c(!1)},A=(0,He.useCallback)((async()=>{await r.performDesktopTextBackup(),d(!0);const e=!(await r.changeEmail(s,i)).error;return d(!1),e}),[r,i,s]),b=(0,He.useCallback)((()=>{u?m.alert("Cannot close window until pending tasks are complete.").catch(console.error):n()}),[m,u,n]),w=(0,He.useCallback)((async()=>{u||l||(f!==Ps.FinishStep?(c(!0),p(xs.GeneratingKeys),await y()&&await A()?(c(!1),p(xs.Finish),g(Ps.FinishStep)):v()):b())}),[f,b,l,u,A,y]),S=(0,He.useCallback)((()=>{u?m.alert("Cannot close window until pending tasks are complete.").catch(console.error):n()}),[m,u,n]),C=(0,He.useMemo)((()=>[{label:"Cancel",onClick:S,type:"cancel",mobileSlot:"left"},{label:h,onClick:w,type:"primary",mobileSlot:"right"}]),[S,w,h]);return(0,e.jsx)(Gn,{title:"Change Email",close:S,actions:C,children:(0,e.jsxs)("div",{className:"px-4.5 py-4",children:[f===Ps.InitialStep&&(0,e.jsx)(Is,{setNewEmail:a,setCurrentPassword:o}),f===Ps.FinishStep&&(0,e.jsx)(_s,{})]})})},Bs=t=>{let{onCurrentPasswordChange:n,onNewPasswordChange:r,onNewPasswordConfirmationChange:i}=t;const[o,s]=(0,He.useState)(""),[a,l]=(0,He.useState)(""),[c,u]=(0,He.useState)("");return(0,e.jsx)("div",{className:"flex flex-col pb-1.5",children:(0,e.jsxs)("form",{children:[(0,e.jsx)("label",{htmlFor:"password-wiz-current-password",className:"mb-1 block",children:"Current Password"}),(0,e.jsx)(gi.Z,{autofocus:!0,id:"password-wiz-current-password",value:o,onChange:e=>{s(e),n(e)},type:"password"}),(0,e.jsx)("div",{className:"min-h-2"}),(0,e.jsx)("label",{htmlFor:"password-wiz-new-password",className:"mb-1 block",children:"New Password"}),(0,e.jsx)(gi.Z,{id:"password-wiz-new-password",value:a,onChange:e=>{l(e),r(e)},type:"password"}),(0,e.jsx)("div",{className:"min-h-2"}),(0,e.jsx)("label",{htmlFor:"password-wiz-confirm-new-password",className:"mb-1 block",children:"Confirm New Password"}),(0,e.jsx)(gi.Z,{id:"password-wiz-confirm-new-password",value:c,onChange:e=>{u(e),i(e)},type:"password"})]})})},Os=t=>{let{className:n}=t;return(0,e.jsx)("div",{role:"presentation",className:(0,r.classNames)("peer flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-full bg-success text-success-contrast",n),children:(0,e.jsx)(xn.Z,{type:"check",size:"small"})})},Ns=()=>(0,e.jsx)("div",{className:"flex flex-col gap-1",children:(0,e.jsxs)("div",{className:"flex flex-row items-start gap-3",children:[(0,e.jsx)("div",{className:"pt-1",children:(0,e.jsx)(Os,{})}),(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)("div",{className:"text-base font-bold",children:"Your password has been successfully changed."}),(0,e.jsx)("p",{children:"Ensure you are running the latest version of Standard Notes on all platforms for maximum compatibility."})]})]})}),Ds=t=>{let{onContinue:n,setContinueEnabled:r}=t;const i=(0,sr.I)(),[o,s]=(0,He.useState)(!0),[a,l]=(0,He.useState)(!0),[c,u]=(0,He.useState)(!0),[d,h]=(0,He.useState)(),p=(0,He.useCallback)((()=>{a||c||o?r(!1):"yes"!==d?n():r(!0)}),[c,a,o,d,n,r]);return(0,He.useEffect)((()=>{p()}),[c,a,o,p]),(0,He.useEffect)((()=>{(async()=>{await i.sync.sync(),s(!1)})()}),[i.sync]),(0,He.useEffect)((()=>{(async()=>{await i.asymmetric.downloadAndProcessInboundMessages(),l(!1)})()}),[i.asymmetric]),(0,He.useEffect)((()=>{(async()=>{await i.vaultInvites.downloadInboundInvites();const e=i.vaultInvites.getCachedPendingInviteRecords().length>0;h(e?"yes":"no"),u(!1)})()}),[i]),o||a||c?(0,e.jsxs)("div",{className:"flex flex-row items-center gap-3",children:[(0,e.jsx)(di.Z,{className:"h-3 w-3"}),(0,e.jsx)("p",{className:"",children:"Checking for data conflicts..."})]}):"no"===d?null:(0,e.jsx)("div",{className:"flex flex-col",children:(0,e.jsx)("p",{children:"You have pending vault invites. Changing your password will delete these invites. It is recommended you accept or decline these invites before changing your password. If you choose to continue, these invites will be deleted."})})};function js(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ts(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?js(Object(n),!0).forEach((function(t){Ms(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):js(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ms(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Fs="Continue",Rs="Generating Keys...";var Ls;!function(e){e.PreprocessingStep="preprocessing-step",e.PasswordStep="password-step",e.FinishStep="finish-step"}(Ls||(Ls={}));const Qs=class extends _n{constructor(e){super(e,e.application),this.nextStep=async()=>{this.state.lockContinue||this.state.isContinuing||(this.state.step!==Ls.FinishStep?this.state.step!==Ls.PreprocessingStep?(this.setState({isContinuing:!0,showSpinner:!0,continueTitle:Rs}),await this.validateCurrentPassword()&&await this.processPasswordChange()?this.setState({isContinuing:!1,showSpinner:!1,continueTitle:"Finish",step:Ls.FinishStep}):this.resetContinueState()):this.setState({step:Ls.PasswordStep}):this.dismiss())},this.dismiss=()=>{this.state.processing?this.application.alerts.alert("Cannot close window until pending tasks are complete.").catch(console.error):this.props.dismissModal()},this.handleCurrentPasswordInputChange=e=>{this.setFormDataState({currentPassword:e}).catch(console.error)},this.handleNewPasswordInputChange=e=>{this.setFormDataState({newPassword:e}).catch(console.error)},this.handleNewPasswordConfirmationInputChange=e=>{this.setFormDataState({newPasswordConfirmation:e}).catch(console.error)},this.setContinueEnabled=e=>{this.setState({lockContinue:!e})},this.nextStepFromPreprocessing=()=>{this.state.lockContinue?this.setState({lockContinue:!1},(()=>{this.nextStep()})):this.nextStep()},this.registerWindowUnloadStopper();const t={formData:{},continueTitle:Fs};e.application.featuresController.isVaultsEnabled()?this.state=Ts(Ts({},t),{},{lockContinue:!0,step:Ls.PreprocessingStep}):this.state=Ts(Ts({},t),{},{lockContinue:!1,step:Ls.PasswordStep})}componentDidMount(){super.componentDidMount()}componentWillUnmount(){super.componentWillUnmount(),window.onbeforeunload=null}registerWindowUnloadStopper(){window.onbeforeunload=()=>!0}resetContinueState(){this.setState({showSpinner:!1,continueTitle:Fs,isContinuing:!1})}async validateCurrentPassword(){var e;const t=this.state.formData.currentPassword,n=this.state.formData.newPassword;if(!t||0===t.length)return this.application.alerts.alert("Please enter your current password.").catch(console.error),!1;if(!n||0===n.length)return this.application.alerts.alert("Please enter a new password.").catch(console.error),!1;if(n!==this.state.formData.newPasswordConfirmation)return this.application.alerts.alert("Your new password does not match its confirmation.").catch(console.error),this.setFormDataState({status:void 0}).catch(console.error),!1;if(!(null===(e=this.application.sessions.getUser())||void 0===e?void 0:e.email))return this.application.alerts.alert("We don't have your email stored. Please sign out then log back in to fix this issue.").catch(console.error),this.setFormDataState({status:void 0}).catch(console.error),!1;const r=await this.application.validateAccountPassword(this.state.formData.currentPassword);return r||this.application.alerts.alert("The current password you entered is not correct. Please try again.").catch(console.error),r}async processPasswordChange(){await this.application.performDesktopTextBackup(),this.setState({lockContinue:!0,processing:!0}),await this.setFormDataState({status:"Processing encryption keys…"});const e=this.state.formData.newPassword,t=!(await this.application.changePassword(this.state.formData.currentPassword,e)).error;return this.setState({processing:!1,lockContinue:!1}),t?this.setState({formData:Ts(Ts({},this.state.formData),{},{status:"Successfully changed password."})}):this.setFormDataState({status:"Unable to process your password. Please try again."}).catch(console.error),t}async setFormDataState(e){return this.setState({formData:Ts(Ts({},this.state.formData),e)})}render(){return(0,e.jsx)("div",{className:"sn-component h-full w-full md:h-auto md:w-auto",id:"password-wizard",children:(0,e.jsx)(Gn,{title:"Change Password",close:this.dismiss,actions:[{label:"Cancel",onClick:this.dismiss,type:"cancel",mobileSlot:"left"},{label:this.state.continueTitle===Rs&&(0,t.Av)()?(0,e.jsx)(di.Z,{className:"h-4 w-4"}):this.state.continueTitle,onClick:this.nextStep,type:"primary",mobileSlot:"right",disabled:this.state.lockContinue}],children:(0,e.jsxs)("div",{className:"px-4.5 py-4",children:[this.state.step===Ls.PreprocessingStep&&(0,e.jsx)(Ds,{onContinue:this.nextStepFromPreprocessing,setContinueEnabled:this.setContinueEnabled}),this.state.step===Ls.PasswordStep&&(0,e.jsx)(Bs,{onCurrentPasswordChange:this.handleCurrentPasswordInputChange,onNewPasswordChange:this.handleNewPasswordInputChange,onNewPasswordConfirmationChange:this.handleNewPasswordConfirmationInputChange}),this.state.step===Ls.FinishStep&&(0,e.jsx)(Ns,{})]})})})}},Us=(0,Nn.Pi)((t=>{let{application:n}=t;const[i,o]=(0,He.useState)(!1),[s,a]=(0,He.useState)(!1),l=n.sessions.getUser(),c=n.getUserPasswordCreationDate(),u=(0,r.dateToLocalizedString)(c),d=(0,He.useCallback)((()=>{a(!0)}),[]),h=(0,He.useCallback)((()=>{a(!1)}),[]),p=()=>o(!1);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Credentials"}),(0,e.jsx)(Ge.QE,{children:"Email"}),(0,e.jsxs)(Ge.xv,{children:["You're signed in as ",(0,e.jsx)("span",{className:"wrap font-bold",children:null==l?void 0:l.email})]}),(0,e.jsx)(Ln.Z,{className:"mt-3 min-w-20",label:"Change email",onClick:()=>{o(!0)}}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsx)(Ge.QE,{children:"Password"}),(0,e.jsxs)(Ge.xv,{children:["Current password was set on ",(0,e.jsx)("span",{className:"font-bold",children:u})]}),(0,e.jsx)(Ln.Z,{className:"mt-3 min-w-20",label:"Change password",onClick:d}),(0,e.jsx)(Fr,{isOpen:i,close:p,children:(0,e.jsx)(ks,{onCloseDialog:p,application:n})})]})}),(0,e.jsx)(Fr,{isOpen:s,close:h,children:(0,e.jsx)(Qs,{application:n,dismissModal:h})})]})})),Vs=(0,Nn.Pi)((t=>{let{application:n}=t;const[i,o]=(0,He.useState)(!1),[s,a]=(0,He.useState)((0,je.Bt)(n.sync.getLastSyncDate()));return(0,e.jsx)(Ye.Z,{children:(0,e.jsx)(ze.Z,{children:(0,e.jsx)("div",{className:"flex flex-row items-center",children:(0,e.jsxs)("div",{className:"flex flex-grow flex-col",children:[(0,e.jsx)(Ge.Dx,{children:"Sync"}),(0,e.jsxs)(Ge.xv,{children:["Last synced ",(0,e.jsxs)("span",{className:"font-bold",children:["on ",s]})]}),(0,e.jsx)(Ln.Z,{className:"mt-3 min-w-20",label:"Sync now",disabled:i,onClick:async()=>{o(!0);const e=await n.sync.sync({queueStrategy:r.SyncQueueStrategy.ForceSpawnNew,checkIntegrity:!0});o(!1),e&&e.error?n.alerts.alert(ht.zR).catch(console.error):a((0,je.Bt)(n.sync.getLastSyncDate()))}})]})})})})})),Ks=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),{userSubscriptionName:n,userSubscriptionExpirationDate:r,isUserSubscriptionExpired:i,isUserSubscriptionCanceled:o}=t.subscriptions,s=null==r?void 0:r.toLocaleString();return o?(0,e.jsxs)(Ge.xv,{className:"mt-1",children:["Your"," ",(0,e.jsxs)("span",{className:"font-bold",children:["Standard Notes",n?" ":"",n]})," ","subscription has been canceled"," ",i?(0,e.jsxs)("span",{className:"font-bold",children:["and expired on ",s]}):(0,e.jsxs)("span",{className:"font-bold",children:["but will remain valid until ",s]}),". You may resubscribe below if you wish."]}):i?(0,e.jsxs)(Ge.xv,{className:"mt-1",children:["Your"," ",(0,e.jsxs)("span",{className:"font-bold",children:["Standard Notes",n?" ":"",n]})," ","subscription ",(0,e.jsxs)("span",{className:"font-bold",children:["expired on ",s]}),". You may resubscribe below if you wish."]}):(0,e.jsxs)(Ge.xv,{className:"mt-1",children:["Your"," ",(0,e.jsxs)("span",{className:"font-bold",children:["Standard Notes",n?" ":"",n]})," ","subscription will be ",(0,e.jsxs)("span",{className:"font-bold",children:["renewed on ",s]}),"."]})})),Hs=(0,Nn.Pi)((()=>{const t=(0,sr.I)();return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ks,{}),(0,e.jsx)(Ln.Z,{className:"mr-3 mt-3 min-w-20",label:"Manage subscription",onClick:async()=>{t.openSubscriptionDashboard.execute()}})]})})),Gs=t=>{let{application:n}=t;const[r,i]=(0,He.useState)(!1),[o,s]=(0,He.useState)(void 0);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.xv,{children:"You don't have a Standard Notes subscription yet."}),r&&(0,e.jsx)(Ge.xv,{children:"Redirecting you to the subscription page..."}),o&&(0,e.jsx)(Ge.xv,{className:"text-danger",children:o}),(0,e.jsxs)("div",{className:"flex",children:[!n.hideOutboundSubscriptionLinks&&(0,e.jsx)(Ge.Qj,{className:"mr-3 mt-3 min-w-20",label:"Learn More",link:window.plansUrl}),n.hasAccount()&&(0,e.jsx)(Ln.Z,{className:"mt-3 min-w-20",primary:!0,label:"Subscribe",onClick:async()=>{i(!0);try{n.isNativeIOS()?n.showPremiumModal():n.openPurchaseFlow()}catch(e){s("There was an error when attempting to redirect you to the subscription page.")}finally{i(!1)}}})]})]})},Ys=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),[n,i]=(0,He.useState)(t.subscriptionController.onlineSubscription);return(0,He.useEffect)((()=>t.subscriptions.addEventObserver((e=>{e===r.SubscriptionManagerEvent.DidFetchSubscription&&i(t.subscriptionController.onlineSubscription)}))),[t.subscriptions,t.subscriptionController]),(0,He.useEffect)((()=>{t.subscriptions.fetchOnlineSubscription()}),[t.subscriptions]),(0,e.jsx)(Ye.Z,{children:(0,e.jsx)(ze.Z,{children:(0,e.jsx)("div",{className:"flex flex-row items-center",children:(0,e.jsxs)("div",{className:"flex flex-grow flex-col",children:[(0,e.jsx)(Ge.Dx,{children:"Subscription"}),n?(0,e.jsx)(Hs,{}):(0,e.jsx)(Gs,{application:t})]})})})})}));function zs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zs(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ws=(0,Nn.Pi)((t=>{let{application:n}=t;const r=(0,He.useRef)(null),i=(0,He.useCallback)((()=>{n.accountMenuController.setOtherSessionsSignOut(!1)}),[n]),o=(0,He.useCallback)((()=>{n.revokeAllOtherSessions().catch(console.error),i(),n.alerts.alert("You have successfully revoked your sessions from other devices.",void 0,"Finish").catch(console.error)}),[n,i]);return(0,e.jsxs)(Vi,{closeDialog:i,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between text-lg font-bold capitalize",children:["End all other sessions?",(0,e.jsx)("button",{className:"rounded p-1 font-bold hover:bg-contrast",onClick:i,children:(0,e.jsx)(xn.Z,{type:"close"})})]}),(0,e.jsx)("div",{className:"sk-panel-row",children:(0,e.jsx)("p",{className:"text-base text-foreground lg:text-sm",children:"This action will sign out all other devices signed into your account, and remove your data from those devices when they next regain connection to the internet. You may sign back in on those devices at any time."})}),(0,e.jsxs)("div",{className:"mt-4 flex justify-end gap-2",children:[(0,e.jsx)(Ln.Z,{ref:r,onClick:i,children:"Cancel"}),(0,e.jsx)(Ln.Z,{primary:!0,colorStyle:"danger",onClick:o,children:"End Sessions"})]})]})}));Ws.displayName="ConfirmOtherSessionsSignOut";const qs=(0,Nn.Pi)((t=>t.application.accountMenuController.otherSessionsSignOut?(0,e.jsx)(Ws,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zs(Object(n),!0).forEach((function(t){Zs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},t)):null)),Js=(0,Nn.Pi)((()=>{const t=(0,sr.I)();return(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Clear workspace"}),(0,e.jsx)(Ge.xv,{className:"mb-3",children:"Remove all data related to the current workspace from the application."}),(0,e.jsx)(Ln.Z,{colorStyle:"danger",label:"Clear workspace",onClick:()=>{t.accountMenuController.setSigningOut(!0)}})]})})})),Xs=(0,Nn.Pi)((t=>{let{application:n}=t;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(Ye.Z,{children:[(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Sign out"}),(0,e.jsx)(Ge.QE,{children:"Other devices"}),(0,e.jsx)(Ge.xv,{children:"Want to sign out on all devices except this one?"}),(0,e.jsxs)("div",{className:"mt-3 flex flex-row flex-wrap gap-3",children:[(0,e.jsx)(Ln.Z,{label:"Sign out other sessions",onClick:()=>{n.accountMenuController.setOtherSessionsSignOut(!0)}}),(0,e.jsx)(Ln.Z,{label:"Manage sessions",onClick:()=>n.openSessionsModal()})]})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{children:"This workspace"}),(0,e.jsx)(Ge.xv,{children:"Remove all data related to the current workspace from the application."}),(0,e.jsx)(Ln.Z,{className:"mt-3",colorStyle:"danger",label:"Sign out workspace",onClick:()=>{n.accountMenuController.setSigningOut(!0)}})]})]}),(0,e.jsx)(qs,{application:n})]})}));Xs.displayName="SignOutView";const $s=(0,Nn.Pi)((t=>{let{application:n}=t;return n.hasAccount()?(0,e.jsx)(Xs,{application:n}):(0,e.jsx)(Js,{})})),ea=t=>{let{application:n}=t;const[i,o]=(0,He.useState)(!0),[s,a]=(0,He.useState)(0),[l,c]=(0,He.useState)(0);return(0,He.useEffect)((()=>{(async()=>{const e=await n.settings.getSubscriptionSetting(r.SettingName.create(r.SettingName.NAMES.FileUploadBytesUsed).getValue());if(e&&a(parseFloat(e)),n.sessions.isSignedIntoFirstPartyServer()){const e=await n.settings.getSubscriptionSetting(r.SettingName.create(r.SettingName.NAMES.FileUploadBytesLimit).getValue());e&&c(parseFloat(e))}o(!1)})().catch(console.error)}),[n]),(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Files"}),(0,e.jsx)(Ge.QE,{children:"Storage Quota"}),i?(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(di.Z,{className:"h-3 w-3"})}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"mb-1 mt-1",children:[(0,e.jsx)("span",{className:"font-semibold",children:(0,co.vU)(s)})," of"," ",(0,e.jsx)("span",{children:n.sessions.isSignedIntoFirstPartyServer()?(0,co.vU)(l):"∞"})," ","used"]}),(0,e.jsx)("progress",{className:"progress-bar w-full","aria-label":"Files storage used",value:s,max:l})]})]})})},ta=t=>{let{application:n,text:r}=t;const[i,o]=(0,He.useState)(!1),[s,a]=(0,He.useState)(void 0);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.xv,{children:r}),i&&(0,e.jsx)(Ge.xv,{children:"Redirecting you to the subscription page..."}),s&&(0,e.jsx)(Ge.xv,{className:"text-danger",children:s}),(0,e.jsxs)("div",{className:"flex",children:[!n.hideOutboundSubscriptionLinks&&(0,e.jsx)(Ge.Qj,{className:"mr-3 mt-3 min-w-20",label:"Learn More",link:window.plansUrl}),n.hasAccount()&&(0,e.jsx)(Ln.Z,{className:"mt-3 min-w-20",primary:!0,label:"Upgrade",onClick:async()=>{o(!0);try{n.isNativeIOS()?n.showPremiumModal():n.openPurchaseFlow()}catch(e){a("There was an error when attempting to redirect you to the subscription page.")}finally{o(!1)}}})]})]})},na=(0,Nn.Pi)((t=>{let{subscriptionState:n,application:i}=t;const[o,s]=(0,He.useState)(!1),{usedInvitationsCount:a,subscriptionInvitations:l}=n,c=null==l?void 0:l.filter((e=>[r.InvitationStatus.Sent,r.InvitationStatus.Accepted].includes(e.status)));return 0===a?(0,e.jsx)(Ge.xv,{className:"mb-3 mt-1",children:"Make your first subscription invite below."}):(0,e.jsxs)("div",{children:[(0,e.jsx)(Ge.Cr,{className:"mb-2 text-info",children:"Active Invites"}),null==c?void 0:c.map((t=>(0,e.jsxs)("div",{className:"mb-4 mt-1",children:[(0,e.jsxs)(Ge.xv,{children:[t.inviteeIdentifier," ",(0,e.jsxs)("span",{className:"text-info",children:["(",t.status,")"]})]}),t.status!==r.InvitationStatus.Canceled&&(0,e.jsx)(Ln.Z,{className:"mt-2 min-w-20",label:"Cancel",onClick:()=>(async e=>{if(o)return void i.alerts.alert("Cancelation already in progress.").catch(console.error);if(!await i.alerts.confirm("All uploaded files of this user will be removed. This action cannot be undone.","Are you sure you want to cancel this invitation?","Cancel Invitation",r.ButtonType.Danger))return;s(!0);const t=await n.cancelSubscriptionInvitation(e);s(!1),t||i.alerts.alert("Could not cancel invitation. Please try again or contact support if the issue persists.").catch(console.error)})(t.uuid)})]},t.uuid))),!n.allInvitationsUsed&&(0,e.jsx)(oo.Z,{classes:"my-4"})]})})),ra=t=>{let{setInviteeEmail:n}=t;return(0,e.jsx)("div",{className:"flex w-full flex-col",children:(0,e.jsxs)("div",{className:"mb-3",children:[(0,e.jsx)("label",{className:"mb-1 block font-bold",htmlFor:"invite-email-input",children:"Invitee Email"}),(0,e.jsx)(ui.Z,{type:"email",className:{container:"mt-4"},id:"invite-email-input",onChange:e=>{n(e)}}),(0,e.jsxs)("p",{className:"mt-4",children:[(0,e.jsx)("span",{className:"font-bold",children:"Note: "}),"The invitee must have an existing account with Standard Notes. If they do not have an account yet, instruct them to make an account first."]})]})})},ia=()=>(0,e.jsxs)("div",{children:[(0,e.jsx)(Ge.Dx,{className:"mb-2",children:"Invite processed successfully."}),(0,e.jsx)("div",{className:"mt-2",children:"If an account is found with that email, they will receive an email with your invitation."})]});var oa,sa;!function(e){e.Default="Invite",e.Sending="Sending...",e.Finish="Finish"}(oa||(oa={})),function(e){e[e.InitialStep=0]="InitialStep",e[e.FinishStep=1]="FinishStep"}(sa||(sa={}));const aa=n=>{let{onCloseDialog:r,application:i,subscriptionState:o}=n;const[s,a]=(0,He.useState)(oa.Default),[l,c]=(0,He.useState)(""),[u,d]=(0,He.useState)(!1),[h,p]=(0,He.useState)(!1),[f,g]=(0,He.useState)(sa.InitialStep),m=(0,He.useCallback)((async()=>!!(0,t.Ju)(l)||(i.alerts.alert("The email you entered has an invalid format. Please review your input and try again.").catch(console.error),!1)),[i.alerts,l]),y=(0,He.useCallback)((()=>{h?i.alerts.alert("Cannot close window until pending tasks are complete.").catch(console.error):r()}),[i.alerts,h,r]),v=()=>{a(oa.Default),d(!1)},A=(0,He.useCallback)((async()=>{p(!0);const e=await o.sendSubscriptionInvitation(l);return p(!1),e}),[l,o]),b=(0,He.useCallback)((async()=>{if(!h&&!u)if(f!==sa.FinishStep){if(d(!0),a(oa.Sending),await m())return await A()?(d(!1),a(oa.Finish),void g(sa.FinishStep)):(i.alerts.alert("An error occurred while sending the invite. Please try again or contact support if the issue persists.").catch(console.error),void v());v()}else y()}),[i.alerts,f,y,u,h,A,m]),w=(0,He.useMemo)((()=>[{label:s,onClick:b,type:"primary",mobileSlot:"right",disabled:h},{label:"Cancel",onClick:y,type:"cancel",mobileSlot:"left",hidden:f===sa.FinishStep}]),[f,y,b,h,s]);return(0,e.jsx)(Gn,{title:"Share Your Subscription",close:y,actions:w,children:(0,e.jsxs)("div",{className:"px-4.5 py-4",children:[f===sa.InitialStep&&(0,e.jsx)(ra,{setInviteeEmail:c}),f===sa.FinishStep&&(0,e.jsx)(ia,{})]})})},la=(0,Nn.Pi)((t=>{let{subscriptionState:n}=t;const{usedInvitationsCount:r,allowedInvitationsCount:i}=n;return(0,e.jsxs)(Ge.xv,{className:"mt-1",children:["You've used ",(0,e.jsx)("span",{className:"font-bold",children:r})," out of ",i," ","subscription invites."]})})),ca=(0,Nn.Pi)((t=>{let{application:n}=t;const[i,o]=(0,He.useState)(!1),s=n.subscriptionController,a=n.sessions.isCurrentSessionReadOnly(),l=n.features.getFeatureStatus(r.NativeFeatureIdentifier.create(r.NativeFeatureIdentifier.TYPES.SubscriptionSharing).getValue())===r.FeatureStatus.Entitled&&!a,c=()=>o(!1);return(0,e.jsx)(Ye.Z,{children:(0,e.jsx)(ze.Z,{children:(0,e.jsx)("div",{className:"flex flex-row items-center",children:(0,e.jsxs)("div",{className:"flex flex-grow flex-col",children:[(0,e.jsx)(Ge.Dx,{className:"mb-2",children:"Subscription sharing"}),l?(0,e.jsxs)("div",{children:[(0,e.jsx)(la,{subscriptionState:s}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsx)(na,{subscriptionState:s,application:n}),!s.allInvitationsUsed&&(0,e.jsx)(Ln.Z,{className:"min-w-20",label:"Invite",onClick:()=>o(!0)}),(0,e.jsx)(Fr,{isOpen:i,close:c,children:(0,e.jsx)(aa,{onCloseDialog:c,application:n,subscriptionState:s})})]}):(0,e.jsx)(ta,{application:n,text:(0,e.jsxs)("span",{children:["Subscription sharing is available only on the ",(0,e.jsx)("span",{className:"font-bold",children:"Professional"})," plan. Please upgrade in order to share your subscription."]})})]})})})})})),ua=(0,Nn.Pi)((t=>{let{application:n}=t;const[i,o]=(0,He.useState)(r.MuteSignInEmailsOption.NotMuted),[s,a]=(0,He.useState)(r.MuteMarketingEmailsOption.NotMuted),[l,c]=(0,He.useState)(!0),u=n.features.getFeatureStatus(r.NativeFeatureIdentifier.create(r.NativeFeatureIdentifier.TYPES.SignInAlerts).getValue())===r.FeatureStatus.Entitled,d=(0,He.useCallback)((async()=>{if(n.sessions.getUser()){c(!0);try{const e=await n.settings.listSettings();o(e.getSettingValue(r.SettingName.create(r.SettingName.NAMES.MuteSignInEmails).getValue(),r.MuteSignInEmailsOption.NotMuted)),a(e.getSettingValue(r.SettingName.create(r.SettingName.NAMES.MuteMarketingEmails).getValue(),r.MuteMarketingEmailsOption.NotMuted))}catch(e){console.error(e)}finally{c(!1)}}}),[n]);return(0,He.useEffect)((()=>{d().catch(console.error)}),[d]),(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Email"}),(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex items-start justify-between gap-2 md:items-center",children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)(Ge.QE,{children:"Mute sign-in notification emails"}),u?(0,e.jsx)(Ge.xv,{children:"Disables email notifications when a new sign-in occurs on your account. (Email notifications are available only to paid subscribers)."}):(0,e.jsx)(ta,{application:n,text:(0,e.jsxs)("span",{children:["Sign-in notification emails are available only on a"," ",(0,e.jsx)("span",{className:"font-bold",children:"subscription"})," plan. Please upgrade in order to enable sign-in notifications."]})})]}),l?(0,e.jsx)(di.Z,{className:"h-5 w-5 flex-shrink-0"}):u&&(0,e.jsx)(po.Z,{onChange:async()=>{const e=i,t=e===r.MuteSignInEmailsOption.Muted?r.MuteSignInEmailsOption.NotMuted:r.MuteSignInEmailsOption.Muted;o(t),await(async(e,t)=>{try{return await n.settings.updateSubscriptionSetting(e,t,!1),!0}catch(e){return n.alerts.alert(ht.p7).catch(console.error),!1}})(r.SettingName.create(r.SettingName.NAMES.MuteSignInEmails).getValue(),t)||o(e)},checked:i===r.MuteSignInEmailsOption.Muted})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)("div",{className:"flex items-start justify-between gap-2 md:items-center",children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)(Ge.QE,{children:"Mute marketing notification emails"}),(0,e.jsx)(Ge.xv,{children:"Disables email notifications with special deals and promotions."})]}),l?(0,e.jsx)(di.Z,{className:"h-5 w-5 flex-shrink-0"}):(0,e.jsx)(po.Z,{onChange:async()=>{const e=s,t=e===r.MuteMarketingEmailsOption.Muted?r.MuteMarketingEmailsOption.NotMuted:r.MuteMarketingEmailsOption.Muted;a(t),await(async(e,t)=>{try{return await n.settings.updateSetting(e,t,!1),!0}catch(e){return n.alerts.alert(ht.p7).catch(console.error),!1}})(r.SettingName.create(r.SettingName.NAMES.MuteMarketingEmails).getValue(),t)||a(e)},checked:s===r.MuteMarketingEmailsOption.Muted})]})]})]})})})),da=(0,Nn.Pi)((t=>{let{application:n}=t;return n.hasAccount()?(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Delete account"}),(0,e.jsx)(Ge.xv,{children:"This action is irreversible. After deletion completes, you will be signed out on all devices."}),(0,e.jsx)("div",{className:"mt-3 flex flex-row flex-wrap gap-3",children:(0,e.jsx)(Ln.Z,{colorStyle:"danger",label:"Delete my account",onClick:()=>{n.accountMenuController.setDeletingAccount(!0)}})})]})}):null})),ha=(0,Nn.Pi)((t=>{let{application:n}=t;const r=!n.sessions.isSignedIntoFirstPartyServer();return(0,e.jsxs)(io,{children:[n.hasAccount()?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Us,{application:n}),(0,e.jsx)(Vs,{application:n})]}):(0,e.jsx)(Cs,{application:n}),(0,e.jsx)(Ys,{}),(0,e.jsx)(ca,{application:n}),n.hasAccount()&&n.featuresController.entitledToFiles&&(0,e.jsx)(ea,{application:n}),n.hasAccount()&&!r&&(0,e.jsx)(ua,{application:n}),(0,e.jsx)($s,{application:n}),(0,e.jsx)(da,{application:n})]})})),pa=(e,t)=>"".concat(e," ").concat(t),fa=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),n=(new r.StaticItemCounter).countNotesAndTags(t.items.getItems([r.ContentType.TYPES.Note,r.ContentType.TYPES.Tag])),i=t.items.getItems([r.ContentType.TYPES.File]),o=pa(n.notes,"notes"),s=pa(n.tags,"tags"),a=pa(n.archived,"archived notes"),l=pa(n.deleted,"trashed notes"),c=pa(i.length,"files"),u=(0,e.jsx)(xn.Z,{type:"rich-text",className:"min-h-5 min-w-5"}),d=(0,e.jsx)(xn.Z,{type:"hashtag",className:"min-h-5 min-w-5"}),h=(0,e.jsx)(xn.Z,{type:"archive",className:"min-h-5 min-w-5"}),p=(0,e.jsx)(xn.Z,{type:"trash",className:"min-h-5 min-w-5"}),f=(0,e.jsx)(xn.Z,{type:"folder",className:"min-h-5 min-w-5"});return(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)("div",{className:"flex flex-row flex-wrap items-start pt-1.5 md:pb-1",children:[(0,e.jsx)(uo,{status:o,icon:u}),(0,e.jsx)("div",{className:"min-w-3"}),(0,e.jsx)(uo,{status:c,icon:f}),(0,e.jsx)("div",{className:"min-w-3"}),(0,e.jsx)(uo,{status:s,icon:d}),(0,e.jsx)("div",{className:"min-w-3"}),(0,e.jsx)(uo,{status:a,icon:h}),(0,e.jsx)("div",{className:"min-w-3"}),(0,e.jsx)(uo,{status:l,icon:p})]})})})),ga=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),n=t.hasAccount(),r=t.hasPasscode(),i=t.isEncryptionAvailable(),o=n?ht.CN:r?ht.zu:ht.KV;return(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Encryption"}),(0,e.jsx)(Ge.xv,{children:o}),i&&(0,e.jsx)(fa,{})]})})})),ma=(0,Nn.Pi)((n=>{let{application:i}=n;const o=i.isNativeMobileWeb(),s=ht.xZ.keyStorageInfo(i),{setIsEncryptionEnabled:a,setIsBackupEncrypted:l,setEncryptionStatusString:c}=i.accountMenuController,u=(0,He.useRef)(null),[d,h]=(0,He.useState)(),[p,f]=(0,He.useState)(),[g,m]=(0,He.useState)(null),[y,v]=(0,He.useState)(!1),[A,b]=(0,He.useState)(!1),[w,S]=(0,He.useState)(!i.isEphemeralSession()),[C,E]=(0,He.useState)(i.hasPasscode()),[I,_]=(0,He.useState)((()=>i.protections.getMobilePasscodeTimingOptions())),x=()=>{b(!0),v(!0)},P=(0,He.useCallback)((async()=>{var e;const t=await(null===(e=i.autolockService)||void 0===e?void 0:e.getAutoLockInterval());m(t)}),[i]),k=(0,He.useCallback)((()=>{const e=i.hasAccount(),t=i.hasPasscode();E(t);const n=e||t,r=e?ht.CN:t?ht.zu:ht.KV;c(r),a(n),l(n)}),[i,c,l,a]),B=async e=>{if(e.preventDefault(),d&&0!==d.length||await(0,L.Ne)({text:ht.eI.enterPasscode}),d!==p)return await(0,L.Ne)({text:ht.nS}),void v(!0);await(0,t.A1)(ht.PJ,(async()=>{(i.hasPasscode()?await i.changePasscode(d):await i.addPasscode(d))||v(!0)})),h(void 0),f(void 0),b(!1),k()};(0,He.useEffect)((()=>{k()}),[k]),(0,He.useEffect)((()=>{o||P().catch(console.error)}),[P,o]),(0,He.useEffect)((()=>{var e;y&&(null===(e=u.current)||void 0===e||e.focus(),v(!1))}),[y]),(0,He.useEffect)((()=>{const e=i.addEventObserver((async()=>{S(!i.isEphemeralSession()),E(i.hasPasscode()),b(!1)}),r.ApplicationEvent.KeyStatusChanged);return()=>{e()}}),[i]);const O=i.autolockService;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Passcode lock"}),!C&&w&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.xv,{className:"mb-3",children:"Add a passcode to lock the application and encrypt on-device key storage."}),s&&(0,e.jsx)(Ge.xv,{className:"mb-3",children:s}),!A&&(0,e.jsx)(Ln.Z,{label:"Add passcode",onClick:x,primary:!0})]}),!C&&!w&&(0,e.jsx)(Ge.xv,{children:'Adding a passcode is not supported in temporary sessions. Please sign out, then sign back in with the "Stay signed in" option checked.'}),A&&(0,e.jsxs)("form",{className:"sk-panel-form",onSubmit:B,children:[(0,e.jsx)(gi.Z,{type:"password",ref:u,value:d||"",onChange:e=>{h(e)},placeholder:"Passcode"}),(0,e.jsx)(gi.Z,{className:{container:"mt-2"},type:"password",value:p||"",onChange:e=>{f(e)},placeholder:"Confirm Passcode"}),(0,e.jsx)(Ln.Z,{primary:!0,onClick:B,label:"Set Passcode",className:"mr-3 mt-3"}),(0,e.jsx)(Ln.Z,{onClick:()=>{b(!1),h(void 0),f(void 0)},label:"Cancel"})]}),C&&!A&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.xv,{children:"Passcode lock is enabled."}),(0,e.jsxs)("div",{className:"mt-3 flex flex-row",children:[(0,e.jsx)(Ln.Z,{label:"Change Passcode",onClick:()=>{x()},className:"mr-3"}),(0,e.jsx)(Ln.Z,{colorStyle:"danger",label:"Remove Passcode",onClick:async()=>{await(0,t.A1)(ht.JT,(async()=>{var e;await i.removePasscode()&&(o||(await(null===(e=i.autolockService)||void 0===e?void 0:e.deleteAutolockPreference()),await P()),k())}))}})]})]})]})}),C&&O&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"min-h-3"}),(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Autolock"}),(0,e.jsx)(Ge.xv,{className:"mb-3",children:"The autolock timer begins when the window or tab loses focus."}),(0,e.jsx)("div",{className:"flex flex-row items-center",children:O.getAutoLockIntervalOptions().map((t=>(0,e.jsx)("a",{className:(0,Q.classNames)("mr-3 cursor-pointer rounded",t.value===g?"bg-info px-1.5 py-0.5 text-info-contrast":"text-info"),onClick:()=>(async e=>{var t;await i.authorizeAutolockIntervalChange()&&(await(null===(t=i.autolockService)||void 0===t?void 0:t.setAutoLockInterval(e)),P().catch(console.error))})(t.value),children:t.label},t.value)))})]})})]}),C&&o&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"min-h-3"}),(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Passcode Autolock"}),(0,e.jsx)("div",{className:"flex flex-row items-center",children:(0,e.jsxs)("div",{className:"mt-2 flex flex-row items-center",children:[(0,e.jsx)("div",{className:"mr-3",children:"Require Passcode"}),I.map((t=>(0,e.jsx)("a",{className:(0,Q.classNames)("mr-3 cursor-pointer rounded px-1.5 py-0.5",t.selected?"bg-info text-info-contrast":"text-info"),onClick:()=>{var e;e=t.key,i.protections.setMobilePasscodeTiming(e),_(i.protections.getMobilePasscodeTimingOptions())},children:t.title},t.key)))]})})]})})]})]})})),ya=(0,Nn.Pi)((t=>{let{application:n}=t;const[i,o]=(0,He.useState)(r.LogSessionUserAgentOption.Enabled),[s,a]=(0,He.useState)(!0),l=(0,He.useCallback)((async()=>{if(n.sessions.getUser()){a(!0);try{const e=await n.settings.listSettings();o(e.getSettingValue(r.SettingName.create(r.SettingName.NAMES.LogSessionUserAgent).getValue(),r.LogSessionUserAgentOption.Enabled))}catch(e){console.error(e)}finally{a(!1)}}}),[n]);return(0,He.useEffect)((()=>{l().catch(console.error)}),[l]),(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Privacy"}),(0,e.jsx)("div",{children:(0,e.jsxs)("div",{className:"flex justify-between gap-2 md:items-center",children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)(Ge.QE,{children:"Session user agent logging"}),(0,e.jsx)(Ge.xv,{children:"User agent logging allows you to identify the devices or browsers signed into your account. For increased privacy, you can disable this feature, which will remove all saved user agent values from our server, and disable future logging of this value."})]}),s?(0,e.jsx)(di.Z,{className:"h-5 w-5 flex-shrink-0"}):(0,e.jsx)(po.Z,{onChange:async()=>{const e=i,t=e===r.LogSessionUserAgentOption.Enabled?r.LogSessionUserAgentOption.Disabled:r.LogSessionUserAgentOption.Enabled;o(t),await(async(e,t)=>{try{return await n.settings.updateSetting(e,t,!1),!0}catch(e){return n.alerts.alert(ht.p7).catch(console.error),!1}})(r.SettingName.create(r.SettingName.NAMES.LogSessionUserAgent).getValue(),t)||o(e)},checked:i===r.LogSessionUserAgentOption.Enabled})]})})]})})})),va=n=>{let{application:i}=n;const[o,s]=(0,He.useState)((()=>i.hasProtectionSources())),a=(0,He.useCallback)((()=>{const e=i.getProtectionSessionExpiryDate(),n=new Date;if(e>n){let r;return r=(0,t.KC)(e,n)?new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"numeric"}):new Intl.DateTimeFormat(void 0,{weekday:"long",day:"numeric",month:"short",hour:"numeric",minute:"numeric"}),r.format(e)}return null}),[i]),[l,c]=(0,He.useState)(a());return(0,He.useEffect)((()=>{const e=i.addEventObserver((async()=>{c(a())}),r.ApplicationEvent.UnprotectedSessionBegan),t=i.addEventObserver((async()=>{c(a())}),r.ApplicationEvent.UnprotectedSessionExpired),n=i.addEventObserver((async()=>{s(i.hasProtectionSources())}),r.ApplicationEvent.KeyStatusChanged);return()=>{e(),t(),n()}}),[i,a]),o?(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Protections"}),l?(0,e.jsxs)(Ge.xv,{className:"text-info",children:["Unprotected access expires at ",l,"."]}):(0,e.jsx)(Ge.xv,{className:"text-info",children:"Protections are enabled."}),(0,e.jsx)(Ge.xv,{className:"mt-2",children:"Actions like viewing or searching protected notes, exporting decrypted backups, or revoking an active session require additional authentication such as entering your account password or application passcode."}),l&&(0,e.jsx)(Ln.Z,{className:"mt-3",primary:!0,label:"End Unprotected Access",onClick:()=>{i.clearProtectionSession().catch(console.error)}})]})}):null},Aa=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),[n,i]=(0,He.useState)(t.items.invalidNonVaultedItems);(0,He.useEffect)((()=>t.items.streamItems(r.ContentType.TYPES.Any,(()=>{i(t.items.invalidNonVaultedItems)}))),[t]);const o=e=>{const t=r.ContentType.create(e.content_type);let n=null;return t.isFailed()||(n=t.getValue().getDisplayName()),n?"".concat(n[0].toUpperCase()).concat(n.slice(1)):"Item of type ".concat(e.content_type)},s=async e=>{await t.alerts.confirm("Are you sure you want to permanently delete ".concat(e.length," item(s)?"),void 0,"Delete",r.ButtonType.Danger)&&(t.mutator.deleteItems(e).then((()=>{t.sync.sync()})),i(t.items.invalidItems))};return 0===n.length?null:(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsxs)(Ge.Dx,{className:"flex flex-row items-center gap-2",children:[(0,e.jsx)(to,{}),"Error decrypting items"]}),(0,e.jsx)(Ge.xv,{children:"".concat(n.length," items are errored and could not be decrypted.")}),(0,e.jsxs)("div",{className:"flex",children:[(0,e.jsx)(Ln.Z,{className:"mr-2 mt-3 min-w-20",label:"Export all",onClick:()=>{t.archiveService.downloadEncryptedItems(n)}}),(0,e.jsx)(Ln.Z,{className:"mr-2 mt-3 min-w-20",colorStyle:"danger",label:"Delete all",onClick:()=>{s(n)}})]}),(0,e.jsx)(oo.Z,{classes:"mt-2.5 mb-3"}),n.map(((i,a)=>(0,e.jsxs)(He.Fragment,{children:[(0,e.jsx)("div",{className:"flex items-center justify-between",children:(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)(Ge.QE,{children:"".concat(o(i)," created on ").concat(i.createdAtString)}),(0,e.jsxs)(Ge.xv,{children:["Item ID: ",i.uuid]}),(0,e.jsxs)(Ge.xv,{children:["Last Modified: ",i.updatedAtString]}),(0,e.jsxs)("div",{className:"flex",children:[(0,e.jsx)(Ln.Z,{className:"mr-2 mt-3 min-w-20",label:"Attempt decryption",onClick:()=>{(e=>{const n=t.canAttemptDecryptionOfItem(e);n instanceof r.ClientDisplayableError?t.alerts.showErrorAlert(n):t.presentKeyRecoveryWizard()})(i)}}),(0,e.jsx)(Ln.Z,{className:"mr-2 mt-3 min-w-20",label:"Export",onClick:()=>{t.archiveService.downloadEncryptedItem(i)}}),(0,e.jsx)(Ln.Z,{className:"mr-2 mt-3 min-w-20",colorStyle:"danger",label:"Delete",onClick:()=>{(async e=>{s([e])})(i)}})]})]})}),a<n.length-1&&(0,e.jsx)(oo.Z,{classes:"mt-2.5 mb-3"})]},i.uuid)))]})})})),ba=(0,Nn.Pi)((t=>{let{application:n}=t;const[i,o]=(0,He.useState)(!1),[s,a]=(0,He.useState)(!1),[l,c]=(0,He.useState)((()=>n.protections.getMobileBiometricsTimingOptions()));(0,He.useEffect)((()=>{const e=n.protections.hasBiometricsEnabled();o(e),(async()=>{var e,t;const r=await(null===(t=(e=n.device).getDeviceBiometricsAvailability)||void 0===t?void 0:t.call(e));a(r)})()}),[n]);const u=async e=>{n.protections.setMobileBiometricsTiming(e),c((()=>n.protections.getMobileBiometricsTimingOptions()))},d=(0,He.useCallback)((async()=>{await n.protections.disableBiometrics()&&o(!1)}),[n]),h=i?"Disable Biometrics Lock":"Enable Biometrics Lock";return s?(0,e.jsx)("div",{children:(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Biometrics Lock"}),(0,e.jsx)(Ln.Z,{className:"mt-1",label:h,onClick:async()=>{i?await d():(o(!0),n.protections.enableBiometrics(),await u(r.MobileUnlockTiming.OnQuit))},primary:!0}),i&&(0,e.jsxs)("div",{className:"mt-2 flex flex-row items-center",children:[(0,e.jsx)("div",{className:"mr-3",children:"Require Biometrics"}),l.map((t=>(0,e.jsx)("a",{className:(0,Q.classNames)("mr-3 cursor-pointer rounded px-1.5 py-0.5",t.selected?"bg-info text-info-contrast":"text-info"),onClick:()=>{u(t.key)},children:t.title},t.key)))]})]})})}):null})),wa=(0,Nn.Pi)((t=>{let{application:n}=t;const[r,i]=(0,He.useState)(!1);(0,He.useEffect)((()=>{const e=n.protections.getMobileScreenshotPrivacyEnabled();i(e)}),[n]);const o=(0,L.gn)()?"Multitasking Privacy":"Multitasking/Screenshot Privacy",s=r?"Disable ".concat(o):"Enable ".concat(o);return(0,e.jsx)("div",{children:(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:o}),(0,e.jsx)(Ln.Z,{className:"mt-1",label:s,onClick:async()=>{const e=!r;i(e),n.protections.setMobileScreenshotPrivacyEnabled(e),n.device.setAndroidScreenshotPrivacy(e)},primary:!0})]})})})}));class Sa{constructor(e,t,n,r,i){this.mfa=e,this.email=t,this._secretKey=n,this._cancelActivation=r,this._enabled2FA=i,this.type="two-factor-activation",this._2FAVerification="none",this.inputSecretKey="",this.inputOtpToken="",this._activationStep="scan-qr-code",(0,_.ky)(this,{_secretKey:_.LO,_authCode:_.LO,_step:_.LO,_enable2FAVerification:_.LO,inputOtpToken:_.LO,inputSecretKey:_.LO},{autoBind:!0})}get secretKey(){return this._secretKey}get activationStep(){return this._activationStep}get verificationStatus(){return this._2FAVerification}get qrCode(){return"otpauth://totp/2FA?secret=".concat(this._secretKey,"&issuer=Standard%20Notes&label=").concat(this.email)}cancelActivation(){this._cancelActivation()}openScanQRCode(){"save-secret-key"===this._activationStep&&(this._activationStep="scan-qr-code")}openSaveSecretKey(){["scan-qr-code","verification"].includes(this._activationStep)&&(this._activationStep="save-secret-key")}openVerification(){this.inputOtpToken="",this.inputSecretKey="","save-secret-key"===this._activationStep&&(this._activationStep="verification",this._2FAVerification="none")}openSuccess(){"verification"===this._activationStep&&(this._activationStep="success")}setInputSecretKey(e){this.inputSecretKey=e}setInputOtpToken(e){this.inputOtpToken=e}enable2FA(){this.inputSecretKey===this._secretKey?this.mfa.enableMfa(this.inputSecretKey,this.inputOtpToken).then((0,_.aD)((()=>{this._2FAVerification="valid",this.openSuccess()}))).catch((0,_.aD)((()=>{this._2FAVerification="invalid-auth-code"}))):this._2FAVerification="invalid-secret"}finishActivation(){"success"===this._activationStep&&this._enabled2FA()}}const Ca=e=>"two-factor-activation"===(null==e?void 0:e.type),Ea=e=>"two-factor-enabled"===e;class Ia{constructor(e,t,n){this.sessions=e,this.mfa=t,this.callback=n,this._status="fetching",this._errorMessage=null,(0,_.ky)(this,{_status:_.LO,_errorMessage:_.LO,deactivateMfa:_.aD,startActivation:_.aD},{autoBind:!0})}startActivation(){const e=(0,_.aD)((()=>this._status="two-factor-disabled")),t=(0,_.aD)((()=>{this._status="two-factor-enabled",this.fetchStatus()}));this.mfa.generateMfaSecret().then((0,_.aD)((n=>{var r;this._status=new Sa(this.mfa,null===(r=this.sessions.getUser())||void 0===r?void 0:r.email,n,e,t)}))).catch((0,_.aD)((e=>{this.setError(e.message)})))}deactivate2FA(){this.mfa.disableMfa().then((0,_.aD)((()=>{this.fetchStatus()}))).catch((0,_.aD)((e=>{this.setError(e.message)})))}isLoggedIn(){return null!=this.sessions.getUser()}fetchStatus(){this.isLoggedIn()&&this.mfa.isMfaActivated().then((0,_.aD)((e=>{this._status=e?"two-factor-enabled":"two-factor-disabled",this.setError(null),this.callback&&this.callback(this._status)}))).catch((0,_.aD)((e=>{this._status="two-factor-disabled",this.setError(e.message)})))}setError(e){this._errorMessage=e}toggle2FA(){if(this.isLoggedIn())return"two-factor-disabled"===this._status?this.startActivation():"two-factor-enabled"===this._status?this.deactivate2FA():void 0}get errorMessage(){return this._errorMessage}get status(){return this._status}}const _a=(0,Nn.Pi)((()=>void 0===(0,sr.I)().sessions.getUser()?(0,e.jsx)(Ge.Dx,{children:"Hardware security key authentication not available"}):(0,e.jsx)(Ge.Dx,{children:"Hardware security key authentication"}))),xa=(0,Nn.Pi)((t=>{let{is2FAEnabled:n}=t;const r=(0,sr.I)();return void 0===r.sessions.getUser()?(0,e.jsx)(Ge.xv,{children:"Sign in or register for an account to configure hardware security keys."}):(0,e.jsxs)("div",{children:[(0,e.jsx)(Ge.xv,{children:"Authenticate with a hardware security key such as YubiKey."}),!r.isFullU2FClient&&(0,e.jsx)(Ge.xv,{className:"italic",children:"Please visit the web app in order to add a hardware security key."}),!n&&(0,e.jsx)(Ge.xv,{className:"italic",children:"You must enable two-factor authentication before adding a hardware security key."})]})})),Pa=(0,Nn.Pi)((t=>{let{addAuthenticator:n,onDeviceAddingModalToggle:r,onDeviceAdded:i}=t;const o=(0,sr.I)(),[s,a]=(0,He.useState)(""),[l,c]=(0,He.useState)(""),u=(0,He.useCallback)((e=>{a(e)}),[]),d=(0,He.useCallback)((async()=>{if(!s)return void c("Device name is required");const e=o.sessions.getUser();if(void 0===e)return void c("User not found");const t=await n.execute({userUuid:e.uuid,authenticatorName:s});t.isFailed()?c(t.getError()):(r(!1),await i())}),[s,c,o,n,r,i]),h=()=>{r(!1)},p=(0,et.ac)(et.Jj.sm);return(0,e.jsx)(Gn,{title:"Add Security Key",close:h,actions:[{label:"Cancel",type:"cancel",onClick:h,mobileSlot:"left",hidden:!p},{label:(0,e.jsxs)(e.Fragment,{children:["Add ",(0,e.jsx)("span",{className:"hidden md:inline",children:"Device"})]}),type:"primary",onClick:d,mobileSlot:"right"}],children:(0,e.jsx)("div",{className:"flex px-4 py-4",children:(0,e.jsxs)("div",{className:"ml-4 flex flex-grow flex-col gap-1",children:[(0,e.jsx)("label",{htmlFor:"u2f-device-name",className:"mb-2 text-sm font-semibold",children:"Device Name"}),(0,e.jsx)(ui.Z,{autofocus:!0,id:"u2f-device-name",className:{container:"w-92"},value:s,onChange:u,onEnter:d}),l&&(0,e.jsx)("div",{className:"mt-1.5 text-danger",children:l})]})})})})),ka=(0,Nn.Pi)((t=>{let{application:n,devices:r,onError:i,onDeviceDeleted:o}=t;const s=(0,He.useCallback)((async e=>{const t=await n.deleteAuthenticator.execute({authenticatorId:e});t.isFailed()?i(t.getError()):await o()}),[n,o,i]);return(0,e.jsx)("div",{children:r.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.QE,{children:"Devices"}),(0,e.jsx)("div",{className:"flex flex-grow flex-col divide-y divide-border",children:r.map((t=>(0,e.jsxs)("div",{className:"flex items-center py-2",children:[(0,e.jsx)(xn.Z,{type:"security"}),(0,e.jsx)("div",{className:"ml-2 mr-auto text-sm",children:t.name}),(0,e.jsx)(Ln.Z,{small:!0,label:"Delete",onClick:async()=>s(t.id)},t.id)]},"device-".concat(t.id))))})]})})})),Ba=t=>{let{application:n}=t;const[r,i]=(0,He.useState)(),[o,s]=(0,He.useState)();return(0,e.jsxs)("div",{className:"grid grid-cols-1 rounded-md border border-border p-4",children:[(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)(xn.Z,{className:"-ml-1 mr-1 h-5 w-5 text-info group-disabled:text-passive-2",type:"asterisk"}),(0,e.jsx)("h1",{className:"sk-h3 m-0 text-sm font-semibold",children:"Save your recovery code"})]}),(0,e.jsx)("p",{className:"col-start-1 col-end-3 m-0 mt-1 text-sm",children:"Your recovery code allows you access to your account in the event you lose your 2FA authenticating device or app. Save your recovery code in a safe place outside your account."}),o&&(0,e.jsx)("div",{children:o}),!r&&(0,e.jsx)(Ln.Z,{primary:!0,small:!0,className:"col-start-1 col-end-3 mt-3 justify-self-start uppercase",onClick:async()=>{if(!await n.challenges.promptForAccountPassword())return;const e=await n.getRecoveryCodes.execute();e.isFailed()?s(e.getError()):i(e.getValue())},children:"Show Recovery Code"}),r&&(0,e.jsxs)("div",{className:"group relative mt-2 rounded border border-border px-3 py-2 text-sm font-semibold",children:[(0,e.jsx)($r.Z,{label:"Copy to clipboard",className:"!z-modal",children:(0,e.jsx)("button",{className:"absolute right-2 top-2 flex rounded border border-border bg-default p-1 opacity-0 hover:bg-contrast focus:opacity-100 group-hover:opacity-100",onClick:()=>{navigator.clipboard.writeText(r)},children:(0,e.jsx)(xn.Z,{type:"copy",size:"small"})})}),r]})]})},Oa=(0,Nn.Pi)((t=>{let{application:n,is2FAEnabled:r,loadAuthenticatorsCallback:i}=t;const[o,s]=(0,He.useState)(!1),[a,l]=(0,He.useState)([]),[c,u]=(0,He.useState)(""),d=(0,He.useCallback)((()=>{s(!0)}),[]),h=(0,He.useCallback)((async()=>{const e=await n.listAuthenticators.execute();if(e.isFailed())return void u(e.getError());const t=e.getValue();l(t),i(t)}),[u,l,n,i]);return(0,He.useEffect)((()=>{h().catch(console.error)}),[h]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(Ye.Z,{children:[(0,e.jsx)(ze.Z,{children:(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)(_a,{}),(0,e.jsx)(xa,{is2FAEnabled:r})]})}),(0,e.jsxs)(ze.Z,{classes:"mt-2",children:[c&&(0,e.jsx)("div",{className:"text-danger",children:c}),(0,e.jsx)(ka,{application:n,devices:a,onError:u,onDeviceDeleted:h}),(0,e.jsx)(Ln.Z,{className:"mt-1",disabled:!n.isFullU2FClient||!r,label:"Add Device",primary:!0,onClick:d})]}),a.length>0&&(0,e.jsx)(ze.Z,{children:(0,e.jsx)("div",{className:"mt-3",children:(0,e.jsx)(Ba,{application:n})})})]}),(0,e.jsx)(Fr,{isOpen:o,close:()=>s(!1),children:(0,e.jsx)(Pa,{onDeviceAddingModalToggle:s,onDeviceAdded:h,addAuthenticator:n.addAuthenticator})})]})}));var Na=s(99456);const Da=t=>{let{copyValue:n}=t;const[r,i]=(0,He.useState)(!1);return(0,e.jsx)(Na.Z,{focusable:!1,title:"Copy to clipboard",icon:r?"check":"copy",className:"".concat(r?"success":void 0," p-0"),onClick:()=>{var e;null===(e=null===navigator||void 0===navigator?void 0:navigator.clipboard)||void 0===e||e.writeText(n).catch(console.error),i((()=>!0))}})},ja=t=>{let{className:n=""}=t;return(0,e.jsx)("div",{className:"inline-block min-h-1 min-w-1 rounded-full bg-text ".concat(n," mr-2")})},Ta=(0,Nn.Pi)((t=>{let{activation:n}=t;return(0,e.jsx)("div",{className:"h-33 flex flex-row items-center px-4 py-4",children:(0,e.jsxs)("div",{className:"flex flex-grow flex-col",children:[(0,e.jsxs)("div",{className:"flex flex-row flex-wrap items-center gap-1",children:[(0,e.jsx)(ja,{}),(0,e.jsxs)("div",{className:"text-sm",children:[(0,e.jsx)("b",{children:"Save your secret key"})," ",(0,e.jsx)("a",{target:"_blank",href:"https://standardnotes.com/help/21/where-should-i-store-my-two-factor-authentication-secret-key",children:"somewhere safe"}),":"]}),(0,e.jsx)(ui.Z,{disabled:!0,right:[(0,e.jsx)(Da,{copyValue:n.secretKey}),(0,e.jsx)(Na.Z,{focusable:!1,title:"Download",icon:"download",className:"p-0",onClick:()=>{!function(e){const t=document.createElement("a"),n=new Blob([e],{type:"text/plain;charset=utf-8"});t.href=window.URL.createObjectURL(n),t.setAttribute("download","standardnotes_2fa_key.txt"),document.body.appendChild(t),t.click(),t.remove(),window.URL.revokeObjectURL(t.href)}(n.secretKey)}})],value:n.secretKey,className:{container:"ml-2"}})]}),(0,e.jsx)("div",{className:"h-2"}),(0,e.jsxs)("div",{className:"flex flex-row items-center",children:[(0,e.jsx)(ja,{}),(0,e.jsx)("div",{className:"min-w-1"}),(0,e.jsxs)("div",{className:"text-sm",children:["You can use this key to generate codes if you lose access to your authenticator app.",(0,e.jsx)("br",{}),(0,e.jsxs)("a",{target:"_blank",rel:"noreferrer noopener",className:"underline hover:no-underline",href:"https://standardnotes.com/help/22/what-happens-if-i-lose-my-2fa-device-and-my-secret-key",children:["Learn more",(0,e.jsx)(xn.Z,{className:"ml-1 inline",type:"open-in",size:"small"})]})]})]})]})})}));var Ma,Fa=Object.defineProperty,Ra=Object.getOwnPropertySymbols,La=Object.prototype.hasOwnProperty,Qa=Object.prototype.propertyIsEnumerable,Ua=(e,t,n)=>t in e?Fa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Va=(e,t)=>{for(var n in t||(t={}))La.call(t,n)&&Ua(e,n,t[n]);if(Ra)for(var n of Ra(t))Qa.call(t,n)&&Ua(e,n,t[n]);return e},Ka=(e,t)=>{var n={};for(var r in e)La.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Ra)for(var r of Ra(e))t.indexOf(r)<0&&Qa.call(e,r)&&(n[r]=e[r]);return n};(e=>{const t=class{constructor(e,n,r,i){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version value out of range");if(i<-1||i>7)throw new RangeError("Mask value out of range");this.size=4*e+17;let s=[];for(let e=0;e<this.size;e++)s.push(!1);for(let e=0;e<this.size;e++)this.modules.push(s.slice()),this.isFunction.push(s.slice());this.drawFunctionPatterns();const a=this.addEccAndInterleave(r);if(this.drawCodewords(a),-1==i){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const n=this.getPenaltyScore();n<e&&(i=t,e=n),this.applyMask(t)}}o(0<=i&&i<=7),this.mask=i,this.applyMask(i),this.drawFormatBits(i),this.isFunction=[]}static encodeText(n,r){const i=e.QrSegment.makeSegments(n);return t.encodeSegments(i,r)}static encodeBinary(n,r){const i=e.QrSegment.makeBytes(n);return t.encodeSegments([i],r)}static encodeSegments(e,n,i=1,s=40,l=-1,c=!0){if(!(t.MIN_VERSION<=i&&i<=s&&s<=t.MAX_VERSION)||l<-1||l>7)throw new RangeError("Invalid value");let u,d;for(u=i;;u++){const r=8*t.getNumDataCodewords(u,n),i=a.getTotalBits(e,u);if(i<=r){d=i;break}if(u>=s)throw new RangeError("Data too long")}for(const e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])c&&d<=8*t.getNumDataCodewords(u,e)&&(n=e);let h=[];for(const t of e){r(t.mode.modeBits,4,h),r(t.numChars,t.mode.numCharCountBits(u),h);for(const e of t.getData())h.push(e)}o(h.length==d);const p=8*t.getNumDataCodewords(u,n);o(h.length<=p),r(0,Math.min(4,p-h.length),h),r(0,(8-h.length%8)%8,h),o(h.length%8==0);for(let e=236;h.length<p;e^=253)r(e,8,h);let f=[];for(;8*f.length<h.length;)f.push(0);return h.forEach(((e,t)=>f[t>>>3]|=e<<7-(7&t))),new t(u,n,f,l)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)0==n&&0==r||0==n&&r==t-1||n==t-1&&0==r||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const t=this.errorCorrectionLevel.formatBits<<3|e;let n=t;for(let e=0;e<10;e++)n=n<<1^1335*(n>>>9);const r=21522^(t<<10|n);o(r>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,i(r,e));this.setFunctionModule(8,7,i(r,6)),this.setFunctionModule(8,8,i(r,7)),this.setFunctionModule(7,8,i(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,i(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,i(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,i(r,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^7973*(e>>>11);const t=this.version<<12|e;o(t>>>18==0);for(let e=0;e<18;e++){const n=i(t,e),r=this.size-11+e%3,o=Math.floor(e/3);this.setFunctionModule(r,o,n),this.setFunctionModule(o,r,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){const i=Math.max(Math.abs(r),Math.abs(n)),o=e+r,s=t+n;0<=o&&o<this.size&&0<=s&&s<this.size&&this.setFunctionModule(o,s,2!=i&&4!=i)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,1!=Math.max(Math.abs(r),Math.abs(n)))}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){const n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw new RangeError("Invalid argument");const i=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],s=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],a=Math.floor(t.getNumRawDataModules(n)/8),l=i-a%i,c=Math.floor(a/i);let u=[];const d=t.reedSolomonComputeDivisor(s);for(let n=0,r=0;n<i;n++){let i=e.slice(r,r+c-s+(n<l?0:1));r+=i.length;const o=t.reedSolomonComputeRemainder(i,d);n<l&&i.push(0),u.push(i.concat(o))}let h=[];for(let e=0;e<u[0].length;e++)u.forEach(((t,n)=>{(e!=c-s||n>=l)&&h.push(t[e])}));return o(h.length==a),h}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let r=0;r<this.size;r++)for(let o=0;o<2;o++){const s=t-o,a=0==(t+1&2)?this.size-1-r:r;!this.isFunction[a][s]&&n<8*e.length&&(this.modules[a][s]=i(e[n>>>3],7-(7&n)),n++)}}o(n==8*e.length)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,i=0,o=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[n][s]==r?(i++,5==i?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,o),r||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),r=this.modules[n][s],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,o)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,i=0,o=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[s][n]==r?(i++,5==i?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,o),r||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),r=this.modules[s][n],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,o)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){const i=this.modules[n][r];i==this.modules[n][r+1]&&i==this.modules[n+1][r]&&i==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(const e of this.modules)n=e.reduce(((e,t)=>e+(t?1:0)),n);const r=this.size*this.size,i=Math.ceil(Math.abs(20*n-10*r)/r)-1;return o(0<=i&&i<=9),e+=i*t.PENALTY_N4,o(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{const e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2));let n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version number out of range");let n=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return o(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let i=0;i<e;i++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map((e=>0));for(const i of e){const e=i^r.shift();r.push(0),n.forEach(((n,i)=>r[i]^=t.reedSolomonMultiply(n,e)))}return r}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");let n=0;for(let r=7;r>=0;r--)n=n<<1^285*(n>>>7),n^=(t>>>r&1)*e;return o(n>>>8==0),n}finderPenaltyCountPatterns(e){const t=e[1];o(t<=3*this.size);const n=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(n&&e[0]>=4*t&&e[6]>=t?1:0)+(n&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};let n=t;function r(e,t,n){if(t<0||t>31||e>>>t!=0)throw new RangeError("Value out of range");for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function i(e,t){return 0!=(e>>>t&1)}function o(e){if(!e)throw new Error("Assertion error")}n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],n.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=n;const s=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}static makeBytes(e){let t=[];for(const n of e)r(n,8,t);return new s(s.Mode.BYTE,e.length,t)}static makeNumeric(e){if(!s.isNumeric(e))throw new RangeError("String contains non-numeric characters");let t=[];for(let n=0;n<e.length;){const i=Math.min(e.length-n,3);r(parseInt(e.substr(n,i),10),3*i+1,t),n+=i}return new s(s.Mode.NUMERIC,e.length,t)}static makeAlphanumeric(e){if(!s.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");let t,n=[];for(t=0;t+2<=e.length;t+=2){let i=45*s.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t));i+=s.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t+1)),r(i,11,n)}return t<e.length&&r(s.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)),6,n),new s(s.Mode.ALPHANUMERIC,e.length,n)}static makeSegments(e){return""==e?[]:s.isNumeric(e)?[s.makeNumeric(e)]:s.isAlphanumeric(e)?[s.makeAlphanumeric(e)]:[s.makeBytes(s.toUtf8ByteArray(e))]}static makeEci(e){let t=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)r(e,8,t);else if(e<16384)r(2,2,t),r(e,14,t);else{if(!(e<1e6))throw new RangeError("ECI assignment value out of range");r(6,3,t),r(e,21,t)}return new s(s.Mode.ECI,0,t)}static isNumeric(e){return s.NUMERIC_REGEX.test(e)}static isAlphanumeric(e){return s.ALPHANUMERIC_REGEX.test(e)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(const r of e){const e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)"%"!=e.charAt(n)?t.push(e.charCodeAt(n)):(t.push(parseInt(e.substr(n+1,2),16)),n+=2);return t}};let a=s;a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=a})(Ma||(Ma={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};let n=t;n.LOW=new t(0,1),n.MEDIUM=new t(1,0),n.QUARTILE=new t(2,3),n.HIGH=new t(3,2),e.Ecc=n})(t=e.QrCode||(e.QrCode={}))})(Ma||(Ma={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};let n=t;n.NUMERIC=new t(1,[10,12,14]),n.ALPHANUMERIC=new t(2,[9,11,13]),n.BYTE=new t(4,[8,16,16]),n.KANJI=new t(8,[8,10,12]),n.ECI=new t(7,[0,0,0]),e.Mode=n})(t=e.QrSegment||(e.QrSegment={}))})(Ma||(Ma={}));var Ha=Ma,Ga={L:Ha.QrCode.Ecc.LOW,M:Ha.QrCode.Ecc.MEDIUM,Q:Ha.QrCode.Ecc.QUARTILE,H:Ha.QrCode.Ecc.HIGH},Ya=128,za="L",Za="#FFFFFF",Wa="#000000",qa=!1,Ja=4,Xa=.1;function $a(e,t=0){const n=[];return e.forEach((function(e,r){let i=null;e.forEach((function(o,s){if(!o&&null!==i)return n.push(`M${i+t} ${r+t}h${s-i}v1H${i+t}z`),void(i=null);if(s!==e.length-1)o&&null===i&&(i=s);else{if(!o)return;null===i?n.push(`M${s+t},${r+t} h1v1H${s+t}z`):n.push(`M${i+t},${r+t} h${s+1-i}v1H${i+t}z`)}}))})),n.join("")}function el(e,t){return e.slice().map(((e,n)=>n<t.y||n>=t.y+t.h?e:e.map(((e,n)=>(n<t.x||n>=t.x+t.w)&&e))))}function tl(e,t,n,r){if(null==r)return null;const i=n?Ja:0,o=e.length+2*i,s=Math.floor(t*Xa),a=o/t,l=(r.width||s)*a,c=(r.height||s)*a,u=null==r.x?e.length/2-l/2:r.x*a,d=null==r.y?e.length/2-c/2:r.y*a;let h=null;if(r.excavate){let e=Math.floor(u),t=Math.floor(d);h={x:e,y:t,w:Math.ceil(l+u-e),h:Math.ceil(c+d-t)}}return{x:u,y:d,h:c,w:l,excavation:h}}var nl=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}();function rl(e){const t=e,{value:n,size:r=Ya,level:i=za,bgColor:o=Za,fgColor:s=Wa,includeMargin:a=qa,style:l,imageSettings:c}=t,u=Ka(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),d=null==c?void 0:c.src,h=(0,He.useRef)(null),p=(0,He.useRef)(null),[f,g]=(0,He.useState)(!1);(0,He.useEffect)((()=>{if(null!=h.current){const e=h.current,t=e.getContext("2d");if(!t)return;let l=Ha.QrCode.encodeText(n,Ga[i]).getModules();const u=a?Ja:0,d=l.length+2*u,f=tl(l,r,a,c),g=p.current,m=null!=f&&null!==g&&g.complete&&0!==g.naturalHeight&&0!==g.naturalWidth;m&&null!=f.excavation&&(l=el(l,f.excavation));const y=window.devicePixelRatio||1;e.height=e.width=r*y;const v=r/d*y;t.scale(v,v),t.fillStyle=o,t.fillRect(0,0,d,d),t.fillStyle=s,nl?t.fill(new Path2D($a(l,u))):l.forEach((function(e,n){e.forEach((function(e,r){e&&t.fillRect(r+u,n+u,1,1)}))})),m&&t.drawImage(g,f.x+u,f.y+u,f.w,f.h)}})),(0,He.useEffect)((()=>{g(!1)}),[d]);const m=Va({height:r,width:r},l);let y=null;return null!=d&&(y=He.createElement("img",{src:d,key:d,style:{display:"none"},onLoad:()=>{g(!0)},ref:p})),He.createElement(He.Fragment,null,He.createElement("canvas",Va({style:m,height:r,width:r,ref:h},u)),y)}function il(e){const t=e,{value:n,size:r=Ya,level:i=za,bgColor:o=Za,fgColor:s=Wa,includeMargin:a=qa,imageSettings:l}=t,c=Ka(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let u=Ha.QrCode.encodeText(n,Ga[i]).getModules();const d=a?Ja:0,h=u.length+2*d,p=tl(u,r,a,l);let f=null;null!=l&&null!=p&&(null!=p.excavation&&(u=el(u,p.excavation)),f=He.createElement("image",{xlinkHref:l.src,height:p.h,width:p.w,x:p.x+d,y:p.y+d,preserveAspectRatio:"none"}));const g=$a(u,d);return He.createElement("svg",Va({height:r,width:r,viewBox:`0 0 ${h} ${h}`},c),He.createElement("path",{fill:o,d:`M0,0 h${h}v${h}H0z`,shapeRendering:"crispEdges"}),He.createElement("path",{fill:s,d:g,shapeRendering:"crispEdges"}),f)}var ol=e=>{const t=e,{renderAs:n}=t,r=Ka(t,["renderAs"]);return"svg"===n?He.createElement(il,Va({},r)):He.createElement(rl,Va({},r))},sl=s(12216),al=s(89723),ll=s(23738);const cl=()=>{const t=(0,sl.z)({showTimeout:100});return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(al.w,{store:t,children:(0,e.jsx)(xn.Z,{type:"info"})}),(0,e.jsx)(ll.u,{store:t,className:" max-w-76 rounded border border-border bg-default px-3 py-2 text-sm",children:"Some apps, like Google Authenticator, do not back up and restore your secret keys if you lose your device or get a new one."})]})},ul=(0,Nn.Pi)((t=>{let{activation:n}=t;const r=(0,et.ac)(et.Jj.sm);return(0,e.jsxs)("div",{className:"h-33 flex flex-col items-center gap-5 px-4 py-4 md:flex-row",children:[(0,e.jsx)("div",{className:"flex items-center justify-center bg-info",children:(0,e.jsx)(ol,{className:"border-2 border-solid border-neutral-contrast",value:n.qrCode,size:r?200:150})}),(0,e.jsxs)("div",{className:"flex flex-grow flex-col gap-2",children:[(0,e.jsxs)("div",{className:"flex flex-row items-center",children:[(0,e.jsx)(ja,{}),(0,e.jsx)("div",{className:"min-w-1"}),(0,e.jsxs)("div",{className:"text-sm",children:["Open your ",(0,e.jsx)("b",{children:"authenticator app"}),"."]}),(0,e.jsx)("div",{className:"min-w-2"}),(0,e.jsx)(cl,{})]}),(0,e.jsxs)("div",{className:"flex flex-row items-center",children:[(0,e.jsx)(ja,{className:"mt-2 self-start"}),(0,e.jsx)("div",{className:"min-w-1"}),(0,e.jsxs)("div",{className:"flex-grow text-sm",children:[(0,e.jsx)("b",{children:"Scan this QR code"})," or ",(0,e.jsx)("b",{children:"add this secret key"}),":"]})]}),(0,e.jsx)(ui.Z,{className:{container:"w-92 ml-4"},disabled:!0,value:n.secretKey,right:[(0,e.jsx)(Da,{copyValue:n.secretKey})]})]})]})})),dl=(0,Nn.Pi)((t=>{let{activation:n}=t;const r="invalid-secret"===n.verificationStatus?"border-danger":"",i="invalid-auth-code"===n.verificationStatus?"border-danger":"";return(0,e.jsx)("div",{className:"h-33 flex flex-row items-center px-4 py-4",children:(0,e.jsxs)("div",{className:"flex flex-grow flex-col gap-4",children:[(0,e.jsxs)("div",{className:"flex flex-row flex-wrap items-center gap-1",children:[(0,e.jsxs)("div",{className:"text-sm",children:[(0,e.jsx)(ja,{className:"align-middle"}),(0,e.jsxs)("span",{className:"align-middle",children:["Enter your ",(0,e.jsx)("b",{children:"secret key"}),":"]})]}),(0,e.jsx)(ui.Z,{className:{container:"ml-2 w-full md:w-96 ".concat(r)},onChange:n.setInputSecretKey})]}),(0,e.jsxs)("div",{className:"flex flex-row flex-wrap items-center gap-1",children:[(0,e.jsxs)("div",{className:"text-sm",children:[(0,e.jsx)(ja,{className:"align-middle"}),(0,e.jsxs)("span",{className:"align-middle",children:["Verify the ",(0,e.jsx)("b",{children:"authentication code"})," generated by your authenticator app:"]})]}),(0,e.jsx)(ui.Z,{className:{container:"ml-2 w-full md:w-30 ".concat(i)},onChange:n.setInputOtpToken})]}),"invalid-auth-code"===n.verificationStatus&&(0,e.jsx)("div",{className:"flex-grow text-sm text-danger",children:"Incorrect authentication code, please try again."}),"invalid-secret"===n.verificationStatus&&(0,e.jsx)("div",{className:"flex-grow text-sm text-danger",children:"Incorrect secret key, please try again."})]})})})),hl=(0,Nn.Pi)((()=>(0,e.jsx)("div",{className:"flex flex-row items-center px-4 py-4",children:(0,e.jsx)("div",{className:"flex flex-row items-center justify-center pt-2",children:(0,e.jsx)(Ge.QE,{children:"Two-factor authentication has been successfully enabled for your account."})})}))),pl=(0,Nn.Pi)((t=>{let{activation:n}=t;switch(n.activationStep){case"scan-qr-code":return(0,e.jsx)(ul,{activation:n});case"save-secret-key":return(0,e.jsx)(Ta,{activation:n});case"verification":return(0,e.jsx)(dl,{activation:n});case"success":return(0,e.jsx)(hl,{activation:n})}})),fl=(0,Nn.Pi)((t=>{let{auth:n}=t;return n.isLoggedIn()?(0,e.jsx)(Ge.Dx,{children:"Two-factor authentication"}):(0,e.jsx)(Ge.Dx,{children:"Two-factor authentication not available"})})),gl=(0,Nn.Pi)((t=>{let{auth:n}=t;return n.isLoggedIn()?(0,e.jsx)(Ge.xv,{children:"An extra layer of security when logging in to your account."}):(0,e.jsx)(Ge.xv,{children:"Sign in or register for an account to configure 2FA."})})),ml=(0,Nn.Pi)((t=>{let{auth:n,canDisable2FA:r}=t;if(!n.isLoggedIn())return null;if("fetching"===n.status)return(0,e.jsx)(di.Z,{className:"h-4 w-4"});const i="two-factor-enabled"===n.status&&!r;return(0,e.jsx)(po.Z,{checked:(o=n.status,!("two-factor-disabled"===o)),onChange:n.toggle2FA,disabled:i});var o})),yl=(0,Nn.Pi)((t=>{let{auth:n,application:r,canDisable2FA:i}=t;const o="fetching"!==n.status&&Ca(n.status),s=o?"scan-qr-code"===n.status.activationStep?"Step 1 of 3 - Scan QR code":"save-secret-key"===n.status.activationStep?"Step 2 of 3 - Save secret key":"verification"===n.status.activationStep?"Step 3 of 3 - Verification":"success"===n.status.activationStep?"Successfully Enabled":"":"",a=()=>{"fetching"!==n.status&&Ca(n.status)&&("success"===n.status.activationStep&&n.status.finishActivation(),n.status.cancelActivation())},l=o?[{label:"Cancel",onClick:n.status.cancelActivation,type:"cancel",mobileSlot:"left",hidden:"scan-qr-code"!==n.status.activationStep},{label:"Back",onClick:"save-secret-key"===n.status.activationStep?n.status.openScanQRCode:n.status.openSaveSecretKey,type:"cancel",mobileSlot:"left",hidden:"save-secret-key"!==n.status.activationStep&&"verification"!==n.status.activationStep},{label:"Next",onClick:"scan-qr-code"===n.status.activationStep?n.status.openSaveSecretKey:"save-secret-key"===n.status.activationStep?n.status.openVerification:n.status.enable2FA,type:"primary",mobileSlot:"right",hidden:"success"===n.status.activationStep},{label:"Finish",onClick:n.status.finishActivation,type:"primary",mobileSlot:"right",hidden:"success"!==n.status.activationStep}]:[];return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(Ye.Z,{children:[(0,e.jsx)(ze.Z,{children:(0,e.jsxs)("div",{className:"flex flex-row gap-2 md:items-center",children:[(0,e.jsxs)("div",{className:"flex flex-grow flex-col",children:[(0,e.jsx)(fl,{auth:n}),(0,e.jsx)(gl,{auth:n})]}),(0,e.jsx)(ml,{auth:n,canDisable2FA:i})]})}),null!=n.errorMessage&&(0,e.jsx)(ze.Z,{children:(0,e.jsx)(Ge.xv,{className:"text-danger",children:n.errorMessage})}),"fetching"!==n.status&&Ea(n.status)&&(0,e.jsx)(ze.Z,{children:(0,e.jsx)("div",{className:"mt-3",children:(0,e.jsx)(Ba,{application:r})})})]}),(0,e.jsx)(Fr,{isOpen:o,close:a,children:(0,e.jsx)(Gn,{title:s,close:a,actions:l,children:o&&(0,e.jsx)(pl,{activation:n.status})})})]})})),vl=t=>{const n=t.application.isNativeMobileWeb(),[i,o]=(0,He.useState)(!1),[s,a]=(0,He.useState)(!0),[l]=(0,He.useState)((()=>new Ia(t.application.sessions,t.application.mfa,(e=>o(Ea(e))))));(0,He.useEffect)((()=>{l.fetchStatus()}),[l]);const c=t.application.features.getFeatureStatus(r.NativeFeatureIdentifier.create(r.NativeFeatureIdentifier.TYPES.UniversalSecondFactor).getValue())===r.FeatureStatus.Entitled&&void 0!==t.application.sessions.getUser();return(0,e.jsxs)(io,{children:[(0,e.jsx)(ga,{}),t.application.items.invalidNonVaultedItems.length>0&&(0,e.jsx)(Aa,{}),(0,e.jsx)(va,{application:t.application}),(0,e.jsx)(yl,{auth:l,application:t.application,canDisable2FA:s}),c&&(0,e.jsx)(Oa,{application:t.application,is2FAEnabled:i,loadAuthenticatorsCallback:e=>{a(0===e.length)}}),n&&(0,e.jsx)(wa,{application:t.application}),(0,e.jsx)(ma,{application:t.application}),n&&(0,e.jsx)(ba,{application:t.application}),t.application.sessions.getUser()&&(0,e.jsx)(ya,{application:t.application})]})},Al=t=>{let{account:n,showSeparator:r,application:i}=t;const[o,s]=(0,He.useState)(!1),[a,l]=(0,He.useState)();return(0,He.useEffect)((()=>{(async()=>{s(!0);const e=await i.listed.getListedAccountInfo(n);l(e),s(!1)})().catch(console.error)}),[n,i]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.QE,{className:"em",children:null==a?void 0:a.display_name}),(0,e.jsx)("div",{className:"mb-2"}),(0,e.jsxs)("div",{className:"flex",children:[o?(0,e.jsx)(di.Z,{className:"h-4 w-4"}):null,a&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.Qj,{className:"mr-2",label:"Open Blog",link:a.author_url}),(0,e.jsx)(Ge.Qj,{className:"mr-2",label:"Settings",link:a.settings_url})]})]}),r&&(0,e.jsx)(oo.Z,{classes:"mt-2.5 mb-3"})]})},bl=(0,Nn.Pi)((t=>{let{application:n}=t;const[i,o]=(0,He.useState)([]),[s,a]=(0,He.useState)(),l=(0,He.useCallback)((async()=>{n.hasAccount()&&o(await n.listed.getListedAccounts())}),[n]);(0,He.useEffect)((()=>{l().catch(console.error)}),[l]);const c=(0,He.useCallback)((()=>{a(!0),(async()=>{const e=await n.listed.requestNewListedAccount();if(e){const t=await n.alerts.confirm("Your new Listed blog has been successfully created! You can publish a new post to your blog from Standard Notes via the <i>Actions</i> menu in the editor pane. Open your blog settings to begin setting it up.",void 0,"Open Settings",r.ButtonType.Info,"Later");if(l().catch(console.error),t){const t=await n.listed.getListedAccountInfo(e);t&&n.device.openUrl(null==t?void 0:t.settings_url)}}a(!1)})().catch(console.error)}),[n,l]);return(0,e.jsxs)(io,{children:[i.length>0&&(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsxs)(Ge.Dx,{children:["Your ",1===i.length?"blog":"blogs"," on Listed"]}),(0,e.jsx)("div",{className:"h-2 w-full"}),i.map(((t,r,i)=>(0,e.jsx)(Al,{account:t,showSeparator:r!==i.length-1,application:n},t.authorId)))]})}),(0,e.jsxs)(Ye.Z,{children:[(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"About Listed"}),(0,e.jsx)("div",{className:"h-2 w-full"}),(0,e.jsx)(Ge.QE,{children:"What is Listed?"}),(0,e.jsxs)(Ge.xv,{children:["Listed is a free blogging platform that allows you to create a public journal published directly from your notes."," ",!n.sessions.getUser()&&"To get started, sign in or register for a Standard Notes account."]}),(0,e.jsx)("a",{className:"mt-2 text-info",target:"_blank",href:"https://listed.to",rel:"noreferrer noopener",children:"Learn more"})]}),n.sessions.getUser()&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{children:"Get Started"}),(0,e.jsx)(Ge.xv,{children:"Create a free Listed author account to get started."}),(0,e.jsx)(Ln.Z,{className:"mt-3",disabled:s,label:s?"Creating account...":"Create new author",onClick:c})]})]})]})]})})),wl=t=>{let{application:n}=t;const r=e=>{var t;n.isNativeMobileWeb()&&(e.preventDefault(),t=e.currentTarget.href,n.isNativeMobileWeb()&&n.mobileDevice.openUrl(t))};return(0,e.jsxs)(io,{children:[(0,e.jsxs)(Ye.Z,{children:[(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Frequently asked questions"}),(0,e.jsx)("div",{className:"h-2 w-full"}),(0,e.jsx)(Ge.QE,{children:"Who can read my private notes?"}),(0,e.jsxs)(Ge.xv,{children:["Quite simply: no one but you. Not us, not your ISP, not a hacker, and not a government agency. As long as you keep your password safe, and your password is reasonably strong, then you are the only person in the world with the ability to decrypt your notes. For more on how we handle your privacy and security, check out our easy to read"," ",(0,e.jsx)("a",{target:"_blank",className:"underline hover:no-underline",href:"https://standardnotes.com/privacy",onClick:r,children:"Privacy Manifesto."})]}),n.isNativeIOS()&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.Qj,{className:"mt-3",label:"Privacy Policy",link:"https://standardnotes.com/privacy",onClick:r}),(0,e.jsx)(Ge.Qj,{className:"mt-3",label:"Terms of Use",link:"https://www.apple.com/legal/internet-services/itunes/dev/stdeula/",onClick:r})]})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{children:"Can I collaborate with others on a note?"}),(0,e.jsx)(Ge.xv,{children:"Because of our encrypted architecture, Standard Notes does not currently provide a real-time collaboration solution. Multiple users can share the same account however, but editing at the same time may result in sync conflicts, which may result in the duplication of notes."})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{children:"Can I use Standard Notes totally offline?"}),(0,e.jsxs)(Ge.xv,{children:["Standard Notes can be used totally offline without an account, and without an internet connection. You can find"," ",(0,e.jsx)("a",{target:"_blank",className:"underline hover:no-underline",href:"https://standardnotes.com/help/59/can-i-use-standard-notes-totally-offline",onClick:r,children:"more details here."})]})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{children:"Can’t find your question here?"}),(0,e.jsx)(Ge.Qj,{className:"mt-3",label:"Open FAQ",link:"https://standardnotes.com/help",onClick:r})]})]}),(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Community forum"}),(0,e.jsx)(Ge.xv,{children:"If you have an issue, found a bug or want to suggest a feature, you can browse or post to the forum. It’s recommended for non-account related issues."}),(0,e.jsx)(Ge.Qj,{className:"mt-3",label:"Go to the forum",link:"https://standardnotes.com/forum",onClick:r})]})}),(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Community groups"}),(0,e.jsx)(Ge.xv,{children:"Want to meet other passionate note-takers and privacy enthusiasts? Want to share your feedback with us? Join the Standard Notes Discord for discussions on security, themes, editors and more."}),(0,e.jsx)(Ge.Qj,{className:"mt-3",link:"https://standardnotes.com/discord",label:"Join our Discord",onClick:r})]})}),(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Account related issue?"}),(0,e.jsx)(Ge.xv,{children:"Send an email to help@standardnotes.com and we’ll sort it out."}),(0,e.jsx)(Ge.Qj,{className:"mt-3",link:"mailto: help@standardnotes.com",label:"Email us",onClick:r})]})})]})},Sl=["mobile:","dev:"];function Cl(e){let t=function(e){return e.charAt(0).toUpperCase()+e.slice(1)}(e);return t=function(e){return e.replace(/\(.*\)/g,"")}(t),t}function El(e,t){const n=e.parsed[t];if(!n)return;const r=n.map(Cl).filter((e=>{return t=e,!(Sl.some((e=>t.toLowerCase().includes(e.toLowerCase())))||function(e){return 1===e.trim().split(" ").length}(e));var t}));return 0!==r.length?r:void 0}const Il=t=>{let{items:n,sectionName:r}=t;return n?(0,e.jsxs)("div",{children:[(0,e.jsx)(Ge.QE,{children:r}),(0,e.jsx)("ul",{className:"list-inside",children:n.map(((t,n)=>(0,e.jsx)("li",{children:t},n)))})]}):null},_l=n=>{let{application:i}=n;const[o,s]=(0,He.useState)(null),a=i.version,l=(0,He.useMemo)((()=>i.changelogService.getLastReadVersion()),[i]);if((0,He.useEffect)((()=>{i.changelogService.getChangelog().then(s).catch(console.error)}),[i]),(0,He.useEffect)((()=>{o&&i.changelogService.markAsRead()}),[o,i]),!o)return(0,e.jsx)("div",{className:"flex h-full w-full items-center text-center",children:(0,e.jsx)("span",{className:"w-full font-bold",children:"Loading..."})});const c=o.versions.findIndex((e=>e.version&&(El(e,"Bug Fixes")||El(e,"Features"))));return(0,e.jsx)(io,{children:o.versions.map(((n,o)=>{const s=El(n,"Bug Fixes"),u=El(n,"Features");if(!s&&!u)return null;if(!n.version)return null;const d=l&&(0,r.compareSemVersions)(n.version,l)>0,h=o===c,p=(0,t.Z$)()&&h;return(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex justify-between",children:[(0,e.jsxs)("div",{className:"flex items-start",children:[(0,e.jsx)(Ge.Dx,{className:"mb-3 flex",children:n.version}),n.version===a&&(0,e.jsx)("div",{className:"ml-2 select-none rounded bg-info px-2 py-1 text-[10px] font-bold text-info-contrast",children:"Your Version"}),h&&(0,e.jsx)("div",{className:"ml-2 select-none rounded bg-success px-2 py-1 text-[10px] font-bold text-success-contrast",children:"Latest Version"}),d&&(0,e.jsx)("div",{className:"ml-2 select-none rounded bg-success px-2 py-1 text-[10px] font-bold text-success-contrast",children:"New"})]}),p&&(0,e.jsx)(Ge.Qj,{label:"Open Downloads",link:i.changelogService.getDesktopDownloadsUrl(n.version),className:"mb-3"})]}),(0,e.jsx)(Il,{sectionName:"Features",items:u}),u&&s&&(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsx)(Il,{sectionName:"Bug Fixes",items:s})]},n.version)},n.version)}))})},xl=t=>{let{setHomeServerConfigurationChangedCallback:n,homeServerConfiguration:r}=t;const[i,o]=(0,He.useState)(r.authJwtSecret),[s,a]=(0,He.useState)(r.jwtSecret),[l,c]=(0,He.useState)(r.pseudoKeyParamsKey),[u,d]=(0,He.useState)(r.valetTokenSecret),[h,p]=(0,He.useState)(r.port),[f,g]=(0,He.useState)(!1),[m,y]=(0,He.useState)(r.logLevel);(0,He.useEffect)((()=>{const e=r.authJwtSecret!==i||r.jwtSecret!==s||r.pseudoKeyParamsKey!==l||r.valetTokenSecret!==u||r.port!==h||r.logLevel!==m;g(e)}),[r,m,i,s,l,u,h,g]);const v=(0,He.useCallback)((async()=>{r.authJwtSecret=i,r.jwtSecret=s,r.pseudoKeyParamsKey=l,r.valetTokenSecret=u,r.port=h,r.logLevel=null!=m?m:r.logLevel,n(r),g(!1)}),[n,r,m,i,s,l,u,h]);return(0,e.jsx)(Ye.Z,{children:(0,e.jsx)(ze.Z,{children:(0,e.jsxs)(ko,{title:"Advanced settings",children:[(0,e.jsx)("div",{className:"flex flex-row items-center",children:(0,e.jsxs)("div",{className:"flex max-w-full flex-grow flex-col",children:[(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{className:"mt-2",children:"Auth JWT Secret"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(ui.Z,{placeholder:"Auth JWT Secret",defaultValue:null==r?void 0:r.authJwtSecret,onChange:o})})]}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{className:"mt-2",children:"JWT Secret"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(ui.Z,{placeholder:"JWT Secret",defaultValue:null==r?void 0:r.jwtSecret,onChange:a})})]}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{className:"mt-2",children:"Encryption Server Key"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(ui.Z,{placeholder:"Encryption Server Key",defaultValue:null==r?void 0:r.encryptionServerKey,disabled:!0})})]}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{className:"mt-2",children:"Pseudo Params Key"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(ui.Z,{placeholder:"Pseudo Params Key",defaultValue:null==r?void 0:r.pseudoKeyParamsKey,onChange:c})})]}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{className:"mt-2",children:"Valet Token Secret"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(ui.Z,{placeholder:"Valet Token Secret",defaultValue:null==r?void 0:r.valetTokenSecret,onChange:d})})]}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{className:"mt-2",children:"Port"}),(0,e.jsx)("div",{className:"text-xs",children:"Changing the port will require you to sign out of all existing sessions."}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(ui.Z,{placeholder:"Port",defaultValue:null==r?void 0:r.port.toString(),onChange:e=>p(Number(e))})})]}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{className:"mt-2",children:"Log Level"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(wi.Z,{label:"Log level",items:[{label:"Error",value:"error"},{label:"Warning",value:"warn"},{label:"Info",value:"info"},{label:"Debug",value:"debug"}],value:m,onChange:y})})]})]})}),f&&(0,e.jsx)(Ln.Z,{className:"mt-3 min-w-20",primary:!0,label:"Apply & Restart",onClick:v})]})})})},Pl=t=>{let{setHomeServerConfigurationChangedCallback:n,homeServerConfiguration:r}=t;var i,o,s,a,l,c,u,d,h,p,f;const[g,m]=(0,He.useState)(!1),[y,v]=(0,He.useState)(r.databaseEngine),[A,b]=(0,He.useState)("mysql"===r.databaseEngine),[w,S]=(0,He.useState)((null===(i=r.mysqlConfiguration)||void 0===i?void 0:i.database)||""),[C,E]=(0,He.useState)((null===(o=r.mysqlConfiguration)||void 0===o?void 0:o.host)||""),[I,_]=(0,He.useState)((null===(s=r.mysqlConfiguration)||void 0===s?void 0:s.password)||""),[x,P]=(0,He.useState)((null===(a=r.mysqlConfiguration)||void 0===a?void 0:a.port)||3306),[k,B]=(0,He.useState)((null===(l=r.mysqlConfiguration)||void 0===l?void 0:l.username)||"");(0,He.useEffect)((()=>{var e,t,n,i,o;const s=r.databaseEngine!==y;b("mysql"===y);let a=!1;if("mysql"===y)return a=!!(w&&C&&I&&x&&k)&&((null===(e=r.mysqlConfiguration)||void 0===e?void 0:e.username)!==k||(null===(t=r.mysqlConfiguration)||void 0===t?void 0:t.password)!==I||(null===(n=r.mysqlConfiguration)||void 0===n?void 0:n.host)!==C||(null===(i=r.mysqlConfiguration)||void 0===i?void 0:i.port)!==x||(null===(o=r.mysqlConfiguration)||void 0===o?void 0:o.database)!==w),void m(a||s);m(s)}),[r,y,w,C,I,x,k]);const O=(0,He.useCallback)((async()=>{r.databaseEngine=y,"mysql"===y&&(r.mysqlConfiguration={username:k,password:I,host:C,port:x,database:w}),n(r),m(!1)}),[r,y,n,k,I,C,x,w]);return(0,e.jsx)(Ye.Z,{children:(0,e.jsx)(ze.Z,{children:(0,e.jsxs)(ko,{title:"Database",children:[(0,e.jsx)("div",{className:"flex flex-row items-center",children:(0,e.jsxs)("div",{className:"flex max-w-full flex-grow flex-col",children:[(0,e.jsx)(li.Z,{items:[{label:"SQLite",value:"sqlite"},{label:"MySQL",value:"mysql"}],value:y,onChange:v}),A&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"mt-2",children:["In order to connect to a MySQL database, ensure that your system has MySQL installed. For detailed instructions, visit the"," ",(0,e.jsx)("a",{className:"text-info",href:"https://dev.mysql.com/doc/mysql-installation-excerpt/8.0/en/",children:"MySQL website."})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{className:"mt-2",children:"Database Username"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(ui.Z,{placeholder:"username",defaultValue:null===(c=null==r?void 0:r.mysqlConfiguration)||void 0===c?void 0:c.username,onChange:B})})]}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{className:"mt-2",children:"Database Password"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(ui.Z,{placeholder:"password",defaultValue:null===(u=null==r?void 0:r.mysqlConfiguration)||void 0===u?void 0:u.password,onChange:_,type:"password"})})]}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{className:"mt-2",children:"Database Host"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(ui.Z,{placeholder:"host",defaultValue:null===(d=null==r?void 0:r.mysqlConfiguration)||void 0===d?void 0:d.host,onChange:E})})]}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{className:"mt-2",children:"Database Port"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(ui.Z,{placeholder:"port",defaultValue:(null===(h=null==r?void 0:r.mysqlConfiguration)||void 0===h?void 0:h.port)?null===(p=null==r?void 0:r.mysqlConfiguration)||void 0===p?void 0:p.port.toString():"",onChange:e=>P(Number(e))})})]}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{className:"mt-2",children:"Database Name"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(ui.Z,{placeholder:"name",defaultValue:null===(f=null==r?void 0:r.mysqlConfiguration)||void 0===f?void 0:f.database,onChange:S})})]})]})]})}),g&&(0,e.jsx)(Ln.Z,{className:"mt-3 min-w-20",primary:!0,label:"Apply & Restart",onClick:O})]})})})};var kl=s(72435);const Bl=t=>{let{status:n,className:r,homeServerService:i}=t;const o=(0,sr.I)(),[s,a]=(0,He.useState)(""),[l,c]=(0,He.useState)(""),[u,d]=(0,He.useState)("");let h,p;switch(null==n?void 0:n.state){case"online":h="bg-success text-success-contrast",p="check";break;case"error":h="bg-danger text-danger-contrast",p="warning";break;default:h="bg-contrast",p="sync"}return(0,He.useEffect)((()=>{!async function(){const e=o.sessions.getUser();e?await o.isUsingHomeServer()?(a("You are currently signed into your home server under ".concat(e.email)),d("bg-success text-success-contrast"),c("check")):(a("You are not currently signed into your home server. To use your home server, sign out of ".concat(e.email,", then sign in or register using ").concat(await i.getHomeServerUrl(),".")),d("bg-warning text-warning-contrast"),c("warning")):(a("You are not currently signed into your home server. To use your home server, sign in or register using ".concat(await i.getHomeServerUrl())),d("bg-warning text-warning-contrast"),c("warning"))}()}),[o,i,a]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"mt-2.5 flex flex-row items-center",children:[(0,e.jsx)("div",{className:"note-status-tooltip-container relative",children:(0,e.jsx)("div",{className:(0,Q.classNames)("peer flex h-5 w-5 items-center justify-center rounded-full",h,r),"aria-describedby":kl.N.NoteStatusTooltip,children:(0,e.jsx)(xn.Z,{className:"restarting"===(null==n?void 0:n.state)?"animate-spin":"",type:p,size:"small"})})}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mr-3 font-bold",children:null==n?void 0:n.message}),(0,e.jsx)("div",{className:"mr-3",children:null==n?void 0:n.description})]})]}),"restarting"!==(null==n?void 0:n.state)&&(0,e.jsxs)("div",{className:"mt-2.5 flex flex-row items-center",children:[(0,e.jsx)("div",{className:"note-status-tooltip-container relative",children:(0,e.jsx)("div",{className:(0,Q.classNames)("peer flex h-5 w-5 items-center justify-center rounded-full",u,r),"aria-describedby":kl.N.NoteStatusTooltip,children:(0,e.jsx)(xn.Z,{type:l,size:"small"})})}),(0,e.jsx)("div",{children:(0,e.jsx)("div",{className:"mr-3",children:s})})]})]})},Ol=()=>{const t=1500,n=(0,sr.I)(),i=n.homeServer,o=n.features,s=n.sessions,a=(0,He.useRef)(null),[l,c]=(0,He.useState)(!0),[u,d]=(0,He.useState)(!1),[h,p]=(0,He.useState)([]),[f,g]=(0,He.useState)(),[m,y]=(0,He.useState)(""),[v,A]=(0,He.useState)(!1),[b,w]=(0,He.useState)(!1),[S,C]=(0,He.useState)(!1),[E,I]=(0,He.useState)(null),[_,x]=(0,He.useState)(null),[P,k]=(0,He.useState)(!1),B=(0,He.useCallback)((async()=>{var t;const n=await i.getHomeServerStatus();g({state:"on"===n.status?"online":n.errorMessage?"error":"offline",message:"on"===n.status?"Online":n.errorMessage?"Offline":"Starting...",description:"on"===n.status?(0,e.jsxs)(e.Fragment,{children:["Accessible on local network at"," ",(0,e.jsx)("a",{href:n.url,className:"font-bold text-info",target:"_blank",children:n.url})]}):null!==(t=n.errorMessage)&&void 0!==t?t:"Your home server is offline."})}),[i,g]),O=(0,He.useCallback)((async()=>{if(!_){const e=await i.getHomeServerConfiguration();e&&x(e)}}),[_,i]),N=(0,He.useCallback)((async()=>{if("restarting"!==(null==f?void 0:f.state))if(P){g({state:"restarting",message:"Shutting down..."});const e=await i.disableHomeServer();if(await(0,r.sleep)(t),e.isFailed()&&await i.isHomeServerRunning())return void g({state:"error",message:e.getError()});k(await i.isHomeServerEnabled()),await B()}else g({state:"restarting",message:"Starting..."}),await i.enableHomeServer(),k(await i.isHomeServerEnabled()),await(0,r.sleep)(t),await B(),O()}),[P,i,f,B,O]),D=(0,He.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null!==E&&clearInterval(E),e&&d(!1),p([])}),[p,E]),j=(0,He.useCallback)((async()=>{D(),p(await i.getHomeServerLogs());const e=setInterval((async()=>{p(await i.getHomeServerLogs())}),5e3);I(e)}),[i,D]);(0,He.useEffect)((()=>{!async function(){const e=await i.getHomeServerDataLocation();e&&y(e)}(),async function(){k(await i.isHomeServerEnabled())}(),A(o.hasOfflineRepo()),w(s.isSignedIn()),O(),B()}),[o,s,i,B,O]);const T=(0,He.useCallback)((async e=>{try{g({state:"restarting",message:"Applying changes and restarting..."}),x(e),await i.stopHomeServer(),await(0,r.sleep)(t),await i.setHomeServerConfiguration(e),D(!0);const n=await i.startHomeServer();void 0!==n&&g({state:"error",message:n}),B()}catch(e){g({state:"error",message:e.message})}}),[i,g,x,B,D]),M=(0,He.useCallback)((async e=>{try{if(await i.stopHomeServer(),void 0===e){const t=await i.getHomeServerDataLocation(),n=await i.changeHomeServerDataLocation();if(n.isFailed())return g({state:"error",message:"".concat(n.getError(),". Restoring to initial location in a moment...")}),await(0,r.sleep)(3e3),void await M(t);e=n.getValue()}g({state:"restarting",message:"Applying changes and restarting..."}),await(0,r.sleep)(t),y(e),D(!0);const n=await i.startHomeServer();void 0!==n&&g({state:"error",message:n}),B()}catch(e){g({state:"error",message:e.message})}}),[i,g,y,B,D]),F=(0,He.useCallback)((async()=>{try{await i.openHomeServerDataLocation()}catch(e){g({state:"error",message:e.message})}}),[i]);function R(e){const{scrollHeight:t,scrollTop:n,clientHeight:r}=e;return n+r>=t}return(0,He.useLayoutEffect)((()=>{a.current&&c(R(a.current))}),[h]),(0,He.useEffect)((()=>{const e=()=>{a.current&&c(R(a.current))},t=a.current;return t&&t.addEventListener("scroll",e),()=>{t&&t.removeEventListener("scroll",e),null!==E&&clearInterval(E)}}),[E]),(0,He.useEffect)((()=>{a.current&&l&&(a.current.scrollTop=a.current.scrollHeight)}),[h,l]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"flex items-center justify-between",children:(0,e.jsxs)("div",{className:"flex items-start",children:[(0,e.jsx)(Ge.Dx,{children:"Home Server"}),(0,e.jsx)(Ge.DR,{style:"success",children:"Labs"})]})}),(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)("div",{className:"mr-10 flex flex-col",children:(0,e.jsx)(Ge.QE,{children:"Sync your data on a private cloud running on your home computer."})}),(0,e.jsx)(po.Z,{disabled:"restarting"===(null==f?void 0:f.state),onChange:N,checked:P})]}),P&&(0,e.jsxs)("div",{children:[(0,e.jsx)(Bl,{className:"mr-3",status:f,homeServerService:i}),"restarting"!==(null==f?void 0:f.state)&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.xv,{className:"mb-3",children:"Home server is enabled. All data is stored at:"}),(0,e.jsx)(uo,{status:m||"Not Set",icon:(0,e.jsx)(xn.Z,{type:"attachment-file",className:"min-h-5 min-w-5"}),checkmark:!1}),(0,e.jsxs)("div",{className:"mt-2.5 flex flex-row",children:[(0,e.jsx)(Ln.Z,{label:"Open Location",className:"mr-3 text-xs",onClick:F}),(0,e.jsx)(Ln.Z,{label:"Change Location",className:"mr-3 text-xs",onClick:()=>M()})]})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsx)(Ye.Z,{children:(0,e.jsx)(ze.Z,{children:(0,e.jsx)(ko,{title:"Logs",onClick:()=>{const e=!u;e?j():E&&(clearInterval(E),I(null)),d(e)},children:(0,e.jsx)("div",{className:"flex flex-row items-center",children:(0,e.jsx)("div",{className:"flex max-w-full flex-grow flex-col",children:(0,e.jsx)("textarea",{ref:a,disabled:!0,className:"h-[500px] overflow-y-auto whitespace-pre-wrap bg-contrast p-2",value:h.join("\n")})})})})})}),_&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsx)(Pl,{homeServerConfiguration:_,setHomeServerConfigurationChangedCallback:T}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsx)(xl,{homeServerConfiguration:_,setHomeServerConfigurationChangedCallback:T})]}),b&&!v&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)("div",{className:"mt-2 grid grid-cols-1 rounded-md border border-border p-4",children:[(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)(xn.Z,{className:(0,r.classNames)("-ml-1 mr-1 h-5 w-5",Mn.K),type:Mn._}),(0,e.jsx)("h1",{className:"sk-h3 m-0 text-sm font-semibold",children:"Activate Premium Features"})]}),(0,e.jsx)("p",{className:"col-start-1 col-end-3 m-0 mt-1 text-sm",children:"Enter your purchased offline subscription code to activate all the features offered by your home server, likes files support and Super notes."}),(0,e.jsx)(Ln.Z,{primary:!0,small:!0,className:"col-start-1 col-end-3 mt-3 justify-self-start uppercase",onClick:()=>{C(!S)},children:S?"Close":"Activate Premium Features"}),S&&(0,e.jsx)(xo,{application:n,onSuccess:()=>{A(!0),C(!1)}})]})]})]})]})]})},Nl=()=>(0,e.jsxs)(io,{children:[(0,e.jsx)(Ye.Z,{children:(0,e.jsx)(ze.Z,{children:(0,e.jsx)(Ol,{})})}),(0,e.jsxs)(Ye.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Remote access"}),(0,e.jsx)(Ge.QE,{children:"Accessing your home server while on the go is easy and secure with Tailscale."}),(0,e.jsxs)("ol",{className:"ml-3 mt-3 list-outside list-decimal",children:[(0,e.jsxs)("li",{children:["Register on"," ",(0,e.jsx)("a",{className:"text-info",href:"https://tailscale.com/",children:"Tailscale.com"})," ","for free."]}),(0,e.jsx)("li",{className:"mt-2",children:"Download Tailscale on this computer and complete the Tailscale setup wizard until you are presented with the IP address of your computer. It should start with something like 100.xxx..."}),(0,e.jsx)("li",{className:"mt-2",children:"Download Tailscale on your mobile device and sign into your Tailscale account."}),(0,e.jsx)("li",{className:"mt-2",children:"Activate the Tailscale VPN on your mobile device."}),(0,e.jsx)("li",{className:"mt-2",children:"Open Standard Notes on your mobile device and sign into your home server by specifying the sync server URL during sign in. The URL will be the Tailscale-based IP address of this computer, followed by the port number of your home server. For example, if your computer Tailscale IP address is 100.112.45.106 and your home server is running on port 3127, your sync server URL will be http://100.112.45.106:3127."})]})]}),(0,e.jsxs)(Ye.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Backing up your data"}),(0,e.jsx)(Ge.QE,{children:"For automatic backups, you can place your server's data inside of a synced cloud folder, like Dropbox, Tresorit, or iCloud Drive."}),(0,e.jsxs)("ol",{className:"ml-3 mt-3 list-outside list-decimal",children:[(0,e.jsx)("li",{children:'Change your server\'s data location by selecting "Change Location" in the Home Server section above.'}),(0,e.jsx)("li",{className:"mt-2",children:"Select a cloud drive to store your server's data in."}),(0,e.jsx)("li",{className:"mt-2",children:"Restart your home server."})]}),(0,e.jsx)(Ge.xv,{className:"mt-3",children:"Your Standard Notes data is always end-to-end encrypted on disk, so your cloud provider will not be able to read your notes or files."})]})]}),Dl=t=>{let{onCloseDialog:n,fromInvite:i,onAddContact:o,editContactUuid:s}=t;const a=(0,sr.I)(),[l,c]=(0,He.useState)(""),[u,d]=(0,He.useState)(""),[h,p]=(0,He.useState)(void 0),f=(0,He.useCallback)((()=>{n()}),[n]);(0,He.useEffect)((()=>{i&&d(a.contacts.getCollaborationIDFromInvite(i.invite))}),[a.contacts,i]),(0,He.useEffect)((()=>{if(s){const e=a.contacts.findContact(s);if(!e)throw new Error("Contact with uuid ".concat(s," not found"));p(e),c(e.name),d(a.contacts.getCollaborationIDForTrustedContact(e))}}),[a.contacts,a.vaults,s]);const g=(0,He.useCallback)((async()=>{if(h)a.contacts.editTrustedContactFromCollaborationID(h,{name:l,collaborationID:u}),f();else try{const e=await a.contacts.addTrustedContactFromCollaborationID(u,l);e?(null==o||o(e),f()):a.alerts.alert("Unable to create contact. Please try again.")}catch(e){e instanceof r.ClientDisplayableError&&a.alerts.showErrorAlert(e).catch(console.error),console.error(e)}}),[h,a.contacts,a.alerts,l,u,f,o]),m=(0,He.useMemo)((()=>[{label:s?"Save Contact":"Add Contact",onClick:g,type:"primary",mobileSlot:"right"},{label:"Cancel",onClick:f,type:"cancel",mobileSlot:"left"}]),[s,f,g]),y=(0,He.useCallback)((e=>{e&&setTimeout((()=>{e.focus()}))}),[]);return(0,e.jsx)(Gn,{title:s?"Edit Contact":"Add New Contact",close:f,actions:m,children:(0,e.jsxs)("div",{className:"mb-3 flex w-full flex-col gap-4 px-4.5 pb-1.5 pt-4",children:[(0,e.jsxs)("label",{children:[(0,e.jsx)("div",{className:"mb-1",children:"Contact Name"}),(0,e.jsx)(ui.Z,{id:"invite-name-input",value:l,onChange:e=>{c(e)},ref:y,onEnter:g})]}),!(null==h?void 0:h.isMe)&&(0,e.jsxs)("label",{children:[(0,e.jsx)("div",{className:"mb-1",children:"CollaborationID"}),(0,e.jsx)(ui.Z,{id:"invite-email-input",value:u,onChange:e=>{d(e)},onEnter:g})]}),!s&&(0,e.jsx)("p",{children:"Ask your contact for their Standard Notes CollaborationID via secure email or chat. Then, enter it here to add them as a contact."})]})})};var jl=s(96332);const Tl=t=>{let{contact:n}=t;const i=(0,sr.I)(),[o,s]=(0,He.useState)(!1),a=()=>s(!1),l=i.contacts.getCollaborationIDForTrustedContact(n),c=(0,He.useCallback)((async()=>{if(await i.alerts.confirm("Are you sure you want to delete this contact?")){const e=await i.contacts.deleteContact(n);e.isFailed()&&i.alerts.alertV2({text:e.getError()}).catch(console.error)}}),[i.alerts,i.contacts,n]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Fr,{isOpen:o,close:a,children:(0,e.jsx)(Dl,{editContactUuid:n.contactUuid,onCloseDialog:a})}),(0,e.jsxs)("div",{className:"flex items-start gap-3.5 rounded-lg border border-border px-3.5 py-2.5 shadow-sm",children:[(0,e.jsxs)("div",{className:"grid grid-cols-[1fr,auto] grid-rows-2 place-items-center gap-x-3.5 gap-y-1 overflow-hidden",children:[(0,e.jsx)(xn.Z,{type:"user",size:"custom",className:"h-5 w-5 flex-shrink-0"}),(0,e.jsx)("span",{className:(0,r.classNames)("w-full overflow-hidden text-ellipsis text-base font-bold",n.isMe?"text-info":""),children:n.name}),(0,e.jsx)("span",{className:"col-start-2 w-full overflow-hidden text-ellipsis text-sm brightness-75",children:l})]}),(0,e.jsxs)("div",{className:"flex gap-3",children:[(0,e.jsx)($r.Z,{label:"Edit contact",children:(0,e.jsxs)(Ln.Z,{className:"!px-2 py-2",onClick:()=>s(!0),children:[(0,e.jsx)(jl.T,{children:"Edit"}),(0,e.jsx)(xn.Z,{type:"pencil-filled",size:"medium"})]})}),!n.isMe&&(0,e.jsx)($r.Z,{label:"Delete contact",children:(0,e.jsxs)(Ln.Z,{className:"!px-2 py-2",onClick:c,children:[(0,e.jsx)(jl.T,{children:"Delete"}),(0,e.jsx)(xn.Z,{type:"trash-filled",className:"text-danger",size:"medium"})]})})]})]})]})};function Ml(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ml(Object(n),!0).forEach((function(t){Rl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ml(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Rl(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ll=t=>{let{vault:n,onCloseDialog:i}=t;const o=(0,sr.I)(),[s,a]=(0,He.useState)([]),[l,c]=(0,He.useState)(!1),[u,d]=(0,He.useState)([]),[h,p]=(0,He.useState)(!1);(0,He.useEffect)((()=>{(async()=>{c(!0);const e=await o.vaultInvites.getInvitableContactsForSharedVault(n);d(e),c(!1)})()}),[o.vaultInvites,n]);const f=(0,He.useCallback)((()=>{i()}),[i]),g=(0,He.useCallback)((async()=>{p(!0);for(const e of s){const t=u.find((t=>t.uuid===e.uuid));t&&await o.vaultInvites.inviteContactToSharedVault(n,t,r.SharedVaultUserPermission.PERMISSIONS[e.permission])}p(!1),f()}),[f,s,u,o.vaultInvites,n]),m=(0,He.useCallback)((e=>{const t={uuid:e.uuid,permission:"Read"};a((n=>n.find((t=>t.uuid===e.uuid))?n.filter((t=>t.uuid!==e.uuid)):[...n,t]))}),[a]),y=(0,He.useMemo)((()=>[{label:h?(0,e.jsx)(di.Z,{className:"h-5 w-5 border-info-contrast"}):"Invite Selected Contacts",onClick:g,type:"primary",mobileSlot:"right",disabled:h,hidden:0===u.length},{label:"Cancel",onClick:f,type:"cancel",mobileSlot:"left"}]),[u.length,f,g,h]);return(0,e.jsx)(Gn,{title:"Add New Contact",close:f,actions:y,children:(0,e.jsx)("div",{className:(0,r.classNames)("flex w-full flex-col gap-3 px-4.5 py-4",l&&"items-center"),children:l?(0,e.jsx)(di.Z,{className:"h-5 w-5"}):u.length>0?u.map((t=>{const n=s.find((e=>e.uuid===t.uuid)),i=!!n;return(0,e.jsxs)("div",{className:(0,r.classNames)("grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",i&&"py-0.5"),children:[(0,e.jsx)("input",{id:t.uuid,className:"h-4 w-4 self-center accent-info",type:"checkbox",checked:i,onChange:()=>m(t)}),(0,e.jsxs)("label",{htmlFor:t.uuid,className:"col-start-2",children:[(0,e.jsx)("div",{className:"text-sm font-semibold",children:t.name}),(0,e.jsx)("div",{className:"opacity-90",children:t.contactUuid})]}),i&&(0,e.jsx)(wi.Z,{showLabel:!0,label:"Permission:",classNameOverride:{wrapper:"col-start-2"},items:Object.keys(r.SharedVaultUserPermission.PERMISSIONS).map((e=>({label:o.vaultUsers.getFormattedMemberPermission(e.toLowerCase()),value:e}))),value:n.permission,onChange:e=>{a((n=>n.map((n=>n.uuid===t.uuid?Fl(Fl({},n),{},{permission:e}):n))))}})]},t.uuid)})):(0,e.jsx)("div",{className:"text-sm",children:"No contacts available to invite."})})})},Ql=t=>{let{vault:n}=t;var i,o,s;const a=(0,sr.I)(),l=a.hasAccount()&&a.featuresController.isEntitledToSharedVaults(),[c,u]=(0,He.useState)(!1),d=()=>u(!1),[h,p]=(0,He.useState)(!1),{isCurrentUserAdmin:f,isCurrentUserOwner:g,isLocked:m,canShowLockOption:y,toggleLock:v,ensureVaultIsUnlocked:A}=Bi(n),b=(0,He.useCallback)((async()=>{if(await a.alerts.confirm("Deleting a vault will permanently delete all its items and files.","Are you sure you want to delete this vault?",void 0,r.ButtonType.Danger)&&(await a.vaults.authorizeVaultDeletion(n)).getValue())if(n.isSharedVaultListing()){const e=await a.sharedVaults.deleteSharedVault(n);(0,r.isClientDisplayableError)(e)&&a.alerts.showErrorAlert(e)}else await a.vaults.deleteVault(n)||a.alerts.alert("Unable to delete vault. Please try again.")}),[a.alerts,a.sharedVaults,a.vaults,n]),w=(0,He.useCallback)((async()=>{if(!n.isSharedVaultListing())return;if(!await a.alerts.confirm("All items and files in this vault will be removed from your account.","Are you sure you want to leave this vault?",void 0,r.ButtonType.Danger))return;const e=await a.vaultUsers.leaveSharedVault(n);(0,r.isClientDisplayableError)(e)&&(a.alerts.alert("Unable to leave vault. Please try again."),console.error(e))}),[a,n]),S=(0,He.useCallback)((async()=>{await a.sharedVaults.convertVaultToSharedVault(n)}),[a.sharedVaults,n]),C=(0,He.useCallback)((async()=>{await A()&&p(!0)}),[A]),E=(0,He.useCallback)((async()=>{await A()&&u(!0)}),[A]);return(0,e.jsxs)(e.Fragment,{children:[n.isSharedVaultListing()&&(0,e.jsx)(Fr,{isOpen:c,close:d,children:(0,e.jsx)(Ll,{vault:n,onCloseDialog:d})}),(0,e.jsx)(ki,{vault:n,isVaultModalOpen:h,closeVaultModal:()=>p(!1)}),(0,e.jsxs)("div",{className:"flex flex-row gap-3.5 rounded-lg border border-border px-3.5 py-2.5 shadow-sm",children:[(0,e.jsx)(xn.Z,{type:n.iconString,size:"custom",className:"mt-2.5 h-5.5 w-5.5 flex-shrink-0"}),(0,e.jsxs)("div",{className:"flex flex-col gap-1.5 py-1.5",children:[(0,e.jsx)("span",{className:"overflow-hidden text-ellipsis text-base font-bold",children:n.name}),n.description&&(0,e.jsx)("span",{className:"overflow-hidden text-ellipsis text-sm",children:n.description}),(0,e.jsxs)("span",{className:"overflow-hidden text-ellipsis text-sm",children:["Vault ID: ",n.systemIdentifier]}),!!(null===(i=n.sharing)||void 0===i?void 0:i.fileBytesUsed)&&(0,e.jsxs)("span",{className:"overflow-hidden text-ellipsis text-sm",children:["File storage used: ",(0,co.vU)(null!==(s=null===(o=n.sharing)||void 0===o?void 0:o.fileBytesUsed)&&void 0!==s?s:0)]}),(0,e.jsxs)("div",{className:"mt-2 flex w-full flex-wrap gap-3",children:[(0,e.jsx)(Ln.Z,{label:"Edit",onClick:C}),y&&(0,e.jsx)(Ln.Z,{label:m?"Unlock":"Lock",onClick:v}),g&&(0,e.jsx)(Ln.Z,{colorStyle:"danger",label:"Delete",onClick:b}),!g&&n.isSharedVaultListing()&&(0,e.jsx)(Ln.Z,{label:"Leave Vault",onClick:w}),f?n.isSharedVaultListing()?(0,e.jsx)(Ln.Z,{colorStyle:"info",label:"Invite Contacts",onClick:E}):l?(0,e.jsx)(Ln.Z,{colorStyle:"info",label:"Enable Collaboration",onClick:S}):null:null]})]})]})]})},Ul=t=>{let{inviteRecord:n}=t;const r=(0,sr.I)(),[i,o]=(0,He.useState)(!1),s=n.trusted,a=n.message.data,l=(0,He.useCallback)((()=>{o(!0)}),[]),c=(0,He.useCallback)((async()=>{const e=await r.vaultInvites.acceptInvite(n);e.isFailed()&&await r.alerts.alert(e.getError())}),[r,n]),u=()=>o(!1),d=r.contacts.getCollaborationIDFromInvite(n.invite),h=r.contacts.findSenderContactForInvite(n.invite),p=r.vaultUsers.getFormattedMemberPermission(n.invite.permission);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Fr,{isOpen:i,close:u,children:(0,e.jsx)(Dl,{fromInvite:n,onCloseDialog:u})}),(0,e.jsxs)("div",{className:"flex gap-3.5 rounded-lg border border-border px-3.5 py-2.5 shadow",children:[(0,e.jsx)(xn.Z,{type:"archive",size:"custom",className:"mt-1.5 h-5.5 w-5.5 flex-shrink-0"}),(0,e.jsxs)("div",{className:"flex flex-col gap-2 overflow-hidden py-1.5",children:[(0,e.jsxs)("div",{className:"overflow-hidden text-ellipsis text-sm",children:["Vault Name: ",a.metadata.name]}),a.metadata.description&&(0,e.jsxs)("div",{className:"overflow-hidden text-ellipsis text-sm",children:["Vault Description: ",a.metadata.description]}),h?(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsxs)("span",{className:"overflow-hidden text-ellipsis text-sm",children:["Trusted Sender: ",h.name]}),(0,e.jsx)(Os,{className:"!h-4 !w-4"})]}):(0,e.jsxs)("div",{className:"w-full overflow-hidden whitespace-pre-wrap break-words text-sm",children:["Sender CollaborationID: ",(0,e.jsx)("span",{className:"font-mono text-xs",children:d})]}),(0,e.jsxs)("div",{className:"overflow-hidden text-ellipsis text-sm",children:["Permission: ",p]}),(0,e.jsx)("div",{className:"",children:s?(0,e.jsx)(Ln.Z,{label:"Accept Invite",className:"text-xs",onClick:c}):(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{children:"The sender of this invite is not trusted. To accept this invite, first add the sender as a trusted contact."}),(0,e.jsx)(Ln.Z,{label:"Add Trusted Contact",className:"mr-3 mt-2 text-xs",onClick:l})]})})]})]})]})},Vl=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),n=t.hasAccount(),i=t.featuresController.isEntitledToSharedVaults(),[o,s]=(0,He.useState)([]),[a,l]=(0,He.useState)(!0),[c,u]=(0,He.useState)([]),[d,h]=(0,He.useState)([]),[p,f]=(0,He.useState)(!1),g=()=>f(!1),[m,y]=(0,He.useState)(!1),[v,A]=(0,He.useState)(!1),b=t.vaults,w=t.contacts,S=t.features,C=(0,He.useCallback)((async()=>{const e=b.getVaults(),n=e.filter((e=>!e.isSharedVaultListing()||t.vaultUsers.isCurrentUserSharedVaultOwner(e)));S.hasMinimumRole(r.RoleName.NAMES.ProUser)?l(!0):S.hasMinimumRole(r.RoleName.NAMES.PlusUser)?l(n.length<3):l(n.length<1),s(e)}),[b,S,t.vaultUsers]),E=(0,He.useCallback)((async()=>{u(t.vaultInvites.getCachedPendingInviteRecords())}),[t.vaultInvites]);(0,He.useEffect)((()=>t.vaultInvites.addEventObserver((e=>{e===r.VaultInviteServiceEvent.InvitesReloaded&&E()}))),[t.vaultInvites,E]);const I=(0,He.useCallback)((async()=>{h(w.getAllContacts())}),[w]),_=(0,He.useCallback)((async()=>{await Promise.all([C(),E(),I()])}),[I,E,C]);(0,He.useEffect)((()=>t.sharedVaults.addEventObserver((e=>{e===r.SharedVaultServiceEvent.SharedVaultStatusChanged&&_()}))),[t.sharedVaults,_]),(0,He.useEffect)((()=>t.sharedVaults.addEventObserver((e=>{e===r.SharedVaultServiceEvent.SharedVaultFileStorageUsageChanged&&_()}))),[t.sharedVaults,_]),(0,He.useEffect)((()=>t.vaultUsers.addEventObserver((e=>{e===r.VaultUserServiceEvent.UsersChanged&&_()}))),[t.vaultUsers,_]),(0,He.useEffect)((()=>t.vaultInvites.addEventObserver((()=>{_()}))),[t.vaultInvites,_]),(0,He.useEffect)((()=>t.items.streamItems([r.ContentType.TYPES.VaultListing,r.ContentType.TYPES.TrustedContact],(()=>{_()}))),[t,_]),(0,He.useEffect)((()=>{t.vaultInvites.downloadInboundInvites(),_()}),[_,t.vaultInvites]);const x=(0,He.useCallback)((async()=>{A(!0)}),[]),P=(0,He.useCallback)((async()=>{y(!0),A(!0)}),[]),k=(0,He.useCallback)((()=>{f(!0)}),[]);return(0,e.jsxs)(io,{children:[(0,e.jsx)(Fr,{isOpen:p,close:g,children:(0,e.jsx)(Dl,{onCloseDialog:g})}),(0,e.jsx)(ki,{isVaultModalOpen:v,creatingSharedVault:m,closeVaultModal:()=>{A(!1),y(!1)}}),c.length>0&&(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Incoming Invites"}),(0,e.jsx)("div",{className:"my-2 flex flex-col gap-3.5",children:c.map((t=>(0,e.jsx)(Ul,{inviteRecord:t},t.invite.uuid)))})]})}),n&&i&&(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Contacts"}),d.length>0&&(0,e.jsx)("div",{className:"my-2 flex flex-col gap-3.5",children:d.map((t=>(0,e.jsx)(Tl,{contact:t},t.uuid)))}),(0,e.jsx)("div",{className:"mt-2.5 flex flex-row",children:(0,e.jsx)(Ln.Z,{label:"Add New Contact",className:"mr-3",onClick:k})})]})}),n&&i&&(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"CollaborationID"}),(0,e.jsx)(Ge.QE,{children:"Share your CollaborationID with collaborators to join their vaults."}),w.isCollaborationEnabled()?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("code",{className:"mt-2.5 overflow-hidden whitespace-pre-wrap break-words rounded border border-border bg-contrast p-3",children:w.getCollaborationID()}),(0,e.jsx)(Ln.Z,{label:"Copy ID",className:"mt-2",onClick:async()=>{try{await navigator.clipboard.writeText(w.getCollaborationID()),(0,Y.fz)({type:Y.pC.Success,message:"Copied to clipboard"})}catch(e){(0,Y.fz)({type:Y.pC.Error,message:"Failed to copy to clipboard"}),console.error(e)}}})]}):(0,e.jsx)("div",{className:"mt-2.5 flex flex-row",children:(0,e.jsx)(Ln.Z,{label:"Enable Vault Sharing",className:"mr-3 text-xs",onClick:()=>w.enableCollaboration()})})]})}),(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Vaults"}),o.length>0&&(0,e.jsx)("div",{className:"my-2 flex flex-col gap-3.5",children:o.map((t=>(0,e.jsx)(Ql,{vault:t},t.uuid)))}),a?(0,e.jsxs)("div",{className:"mt-2.5 flex gap-3",children:[(0,e.jsx)(Ln.Z,{label:"Create Vault",onClick:x}),n&&i&&(0,e.jsx)(Ln.Z,{label:"Create Shared Vault",onClick:P})]}):(0,e.jsx)("div",{className:"mt-3.5",children:(0,e.jsx)(ta,{application:t,text:(0,e.jsx)("span",{children:"Please upgrade in order to increase your vault limit."})})})]})})]})})),Kl=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),n=t.hasAccount(),i=t.getUserVersion(),o=i&&(0,r.compareVersions)(i,r.ProtocolVersion.V004)<0;return n&&o?(0,e.jsx)(io,{children:(0,e.jsxs)(Ye.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Account update required"}),(0,e.jsx)(Ge.QE,{children:"In order to use Vaults, you must update your account to use the latest data encryption version."}),(0,e.jsx)(Ln.Z,{primary:!0,className:"mt-3",onClick:()=>t.upgradeProtocolVersion().catch(console.error),children:"Update Account"})]})}):(0,e.jsx)(Vl,{})})),Hl=t=>{let{plugin:n,callback:i}=t,o=null;const s=r.ContentType.create(n.content_type);s.isFailed()||(o=s.getValue().getDisplayName());const a=[{label:"Name",value:n.name},{label:"Description",value:n.description},{label:"Version",value:n.version},{label:"Hosted URL",value:n.url},{label:"Download URL",value:n.download_url},{label:"Extension Type",value:o}];return(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Confirm Extension"}),a.map((t=>{if(t.value)return(0,e.jsxs)(He.Fragment,{children:[(0,e.jsx)(Ge.QE,{children:t.label}),(0,e.jsx)(Ge.xv,{className:"wrap mb-2",children:t.value})]},t.value)})),(0,e.jsxs)("div",{className:"mt-3 flex flex-row",children:[(0,e.jsx)(Ln.Z,{className:"min-w-20",label:"Cancel",onClick:()=>i(!1)}),(0,e.jsx)("div",{className:"min-w-3"}),(0,e.jsx)(Ln.Z,{className:"min-w-20",label:"Install",onClick:()=>i(!0)})]})]})},Gl=(0,Nn.Pi)((t=>{let{className:n=""}=t;const r=(0,sr.I)(),[i,o]=(0,He.useState)(""),[s,a]=(0,He.useState)(void 0),l=(0,He.useRef)(null);return(0,He.useEffect)((()=>{var e;s&&(null===(e=l.current)||void 0===e||e.scrollIntoView({behavior:"smooth"}))}),[s,l]),(0,e.jsx)("div",{className:n,children:(0,e.jsxs)("div",{children:[!s&&(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)("div",{children:(0,e.jsx)(ui.Z,{placeholder:"Enter Plugin URL",value:i,onChange:e=>{o(e)}})}),(0,e.jsx)(Ln.Z,{hidden:0===i.length,disabled:0===i.length,className:"mt-4 min-w-20",primary:!0,label:"Install",onClick:()=>(async e=>{const t=await r.pluginsService.getPluginDetailsFromUrl(e);t&&a(t)})(i)})]}),s&&(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Hl,{plugin:s,callback:async e=>{e&&s&&await r.pluginsService.installExternalPlugin(s),a(void 0),o("")}}),(0,e.jsx)("div",{ref:l})]})]})})})),Yl=t=>{let{plugin:n}=t;const i=(0,sr.I)(),o=(0,He.useCallback)((async()=>{const e=await i.pluginsService.installPlugin(n);e?i.alerts.alertV2({text:"".concat(e.name," has been successfully installed.")}):i.alerts.alertV2({text:"Failed to install plugin"})}),[i,n]),s=n.content_type===r.ContentType.TYPES.Theme?"theme":"note type",a=i.hasValidFirstPartySubscription();return(0,e.jsxs)("div",{className:"align-center my-2.5 flex items-center justify-between md:items-center",children:[(0,e.jsxs)("div",{className:"mr-5",children:[(0,e.jsx)(Ge.QE,{className:"mb-0 text-info",children:n.name}),(0,e.jsxs)(Ge.KI,{className:"mb-1",children:["A ",(0,e.jsx)("strong",{children:s})," by ",n.publisher]}),n.description&&(0,e.jsx)(Ge.KI,{className:"text-neutral",children:n.description})]}),(0,e.jsx)(Ln.Z,{disabled:!a,small:!0,className:"cursor-pointer",onClick:o,children:"Install"})]})},zl=()=>{const t=(0,He.useRef)(null),n=(0,sr.I)(),r=n.hasValidFirstPartySubscription();return(0,e.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 top-0 flex flex-col items-center justify-center",children:[(0,e.jsx)("div",{className:"absolute h-full w-full bg-default opacity-[86%]"}),(0,e.jsx)("div",{className:"border-1 z-10 rounded border border-border bg-default p-5",children:(0,e.jsx)(Fn,{featureName:"Plugin Gallery",ctaRef:t,application:n,hasSubscription:r,inline:!0,onClick:()=>{n.preferencesController.closePreferences()}})})]})},Zl=((0,Nn.Pi)(zl),(0,Nn.Pi)((()=>{const t=(0,sr.I)(),[n,i]=(0,He.useState)(null),o=(0,He.useCallback)((()=>{t.pluginsService.getInstallablePlugins().then(i).catch(console.error)}),[t]);(0,He.useEffect)((()=>{o()}),[o]),(0,He.useEffect)((()=>{t.items.streamItems([r.ContentType.TYPES.Component,r.ContentType.TYPES.Theme],o)}),[t,o]);const s=t.hasValidFirstPartySubscription();return(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Browse Plugins"}),(0,e.jsxs)(Ge.xv,{className:"text-neutral",children:["Plugins run in a secure sandbox and can only access data you allow it. Note types allow specialized editing experiences, but in most cases, the ",(0,e.jsx)("strong",{children:"built-in Super note type"})," can encapsulate any functionality found in plugins."]}),!n&&(0,e.jsx)("div",{className:"mb-3 mt-5 flex h-full w-full items-center",children:(0,e.jsx)("span",{className:"w-full font-bold",children:"Loading..."})}),(0,e.jsx)("div",{className:"mt-2",children:null==n?void 0:n.map(((t,r)=>(0,e.jsxs)("div",{children:[(0,e.jsx)(Yl,{plugin:t}),r<n.length-1&&(0,e.jsx)(oo.Z,{})]},t.name)))})]}),(0,e.jsx)(oo.Z,{}),(0,e.jsx)(Ge.xv,{className:"mt-4 text-danger",children:"Plugins may not be actively maintained. Standard Notes cannot attest to the quality or user experience of these plugins, and is not responsible for any data loss that may arise from their use."}),!s&&(0,e.jsx)(zl,{})]})}))),Wl=t=>{let{plugin:n}=t;const i=(0,sr.I)(),o="identifier"in n&&i.features.isThirdPartyFeature(n.identifier),[s,a]=(0,He.useState)(!1),[l,c]=(0,He.useState)(n.name),u=o,d=(0,He.useRef)(null);(0,He.useEffect)((()=>{var e;s&&(null===(e=d.current)||void 0===e||e.focus())}),[d,s]);const[h,p]=(0,He.useState)(n.displayName);return(0,e.jsxs)("div",{className:"align-center my-2.5 flex items-center justify-between md:items-center",children:[(0,e.jsx)("input",{ref:d,disabled:!s||!u,autoComplete:"off",className:"no-border mr-2 flex-grow rounded-sm bg-default px-0 py-1 text-sm font-bold text-text",type:"text",value:l,onChange:e=>{let{target:t}=e;return c(null==t?void 0:t.value)}}),s&&(0,e.jsxs)("div",{className:"flex gap-1",children:[(0,e.jsx)(Ln.Z,{small:!0,className:"cursor-pointer",onClick:()=>{var e;l&&(p(e=l),i.changeAndSaveItem.execute(n,(t=>{t.name=e})).then((e=>{const t=e.getValue();p(t.name)})).catch(console.error),a(!1))},children:"Confirm"}),(0,e.jsx)(Ln.Z,{small:!0,className:"cursor-pointer",onClick:()=>{c(n.name),a(!1)},children:"Cancel"})]}),!s&&(0,e.jsxs)("div",{className:"flex flex-row flex-wrap justify-end gap-2",children:[u&&!s&&(0,e.jsx)(Ln.Z,{small:!0,className:"cursor-pointer",onClick:()=>{c(n.name),a(!0)},children:"Rename"}),(0,e.jsx)(Ln.Z,{small:!0,className:"min-w-20",label:"Uninstall",onClick:async()=>{i.alerts.confirm("Are you sure you want to uninstall this plugin?","Uninstall Plugin?","Uninstall",r.ButtonType.Danger,"Cancel").then((async e=>{e&&(await i.mutator.deleteItem(n),i.sync.sync())})).catch((e=>{i.alerts.alert(e).catch(console.error)}))}})]})]})},ql=t=>{let{plugin:n}=t;return(0,e.jsx)(ze.Z,{children:(0,e.jsx)(Wl,{plugin:n})})},Jl=(0,Nn.Pi)((t=>{let{pluginsLatestVersions:n,className:i=""}=t;const o=(0,sr.I)(),[s,a]=(0,He.useState)((e=>e.items.getItems([r.ContentType.TYPES.ActionsExtension,r.ContentType.TYPES.Component,r.ContentType.TYPES.Theme]))(o)),l=(0,He.useCallback)((()=>{const e=o.items.getItems([r.ContentType.TYPES.ActionsExtension,r.ContentType.TYPES.Component,r.ContentType.TYPES.Theme]);a(e)}),[o.items]);(0,He.useEffect)((()=>{o.items.streamItems([r.ContentType.TYPES.Component,r.ContentType.TYPES.Theme,r.ContentType.TYPES.ActionsExtension],l)}),[o,l]);const c=s.filter((e=>!(null==e.package_info)));return(0,e.jsxs)("div",{className:i,children:[0===c.length&&(0,e.jsx)("div",{className:"text-neutral",children:"No plugins installed."}),c.length>0&&(0,e.jsx)("div",{className:"divide-y divide-border",children:c.sort(((e,t)=>{var n,r;return null===(n=e.displayName)||void 0===n?void 0:n.toLowerCase().localeCompare(null===(r=t.displayName)||void 0===r?void 0:r.toLowerCase())})).map((t=>(0,e.jsx)(ql,{plugin:t,latestVersion:n.getVersion(t)},t.uuid)))})]})})),Xl=(0,Nn.Pi)((t=>{let{pluginsLatestVersions:n}=t;return(0,e.jsxs)(io,{children:[(0,e.jsx)(Ye.Z,{children:(0,e.jsx)(ze.Z,{children:(0,e.jsx)(Zl,{})})}),(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Manage Plugins"}),(0,e.jsx)(Jl,{className:"mt-3",pluginsLatestVersions:n})]})}),(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Install Custom Plugin"}),(0,e.jsx)(Gl,{className:"mt-3"})]})})]})})),$l=(0,Nn.Pi)((t=>{let{menu:n,application:r}=t;switch(n.selectedPaneId){case"general":default:return(0,e.jsx)(Ss,{});case"account":return(0,e.jsx)(ha,{application:r});case"appearance":return(0,e.jsx)(So,{application:r});case"home-server":return(0,e.jsx)(Nl,{});case"security":return(0,e.jsx)(vl,{application:r});case"vaults":return(0,e.jsx)(Kl,{});case"backups":return(0,e.jsx)(bo,{application:r});case"listed":return(0,e.jsx)(bl,{application:r});case"shortcuts":case"accessibility":case"get-free-month":return null;case"plugins":return(0,e.jsx)(Xl,{pluginsLatestVersions:n.extensionsLatestVersions});case"help-feedback":return(0,e.jsx)(wl,{application:r});case"whats-new":return(0,e.jsx)(_l,{application:r})}}));function ec(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ec(Object(n),!0).forEach((function(t){nc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ec(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function nc(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const rc=(0,Nn.Pi)((t=>(0,e.jsxs)("div",{className:"flex min-h-0 flex-grow flex-col md:flex-row md:justify-between",children:[(0,e.jsx)(ro,{menu:t.menu}),(0,e.jsx)("div",{className:"min-h-0 flex-grow overflow-auto bg-[--preferences-background-color]",tabIndex:pt.HF,children:(0,e.jsx)($l,tc({},t))})]}))),ic=(0,Nn.Pi)((t=>{let{application:n,closePreferences:i}=t;const o=(0,He.useMemo)((()=>new eo(n,n.enableUnfinishedFeatures)),[n]);(0,He.useEffect)((()=>{o.selectPane(n.preferencesController.currentPane)}),[o,n.preferencesController.currentPane]);const s=(0,et.ac)(et.Jj.sm),a=(0,Kn.x)();(0,He.useEffect)((()=>{const e=a((()=>(i(),!0)));return()=>{e&&e()}}),[a,i]);const{hasTopInset:l}=Rn(),c=(0,He.useMemo)((()=>[{label:(0,e.jsxs)("span",{className:"flex items-center",children:[(0,e.jsx)(xn.Z,{type:"chevron-left",size:"large"}),"Back"]}),type:"primary",mobileSlot:"left",onClick:i}]),[i]);return(0,e.jsx)(Gn,{close:i,title:"Preferences",className:"flex flex-col",customHeader:(0,e.jsxs)("div",{className:(0,r.classNames)("flex w-full flex-row items-center justify-between border-b border-solid border-border bg-default px-3 pb-2 md:p-3",l?"pt-safe-top":"pt-2"),"data-preferences-header":!0,children:[(0,e.jsx)("div",{className:"hidden h-8 w-8 md:block"}),(0,e.jsx)("h1",{className:"text-base font-bold md:text-lg",children:"Your preferences for Standard Notes"}),(0,e.jsx)(ei.Z,{onClick:()=>{i()},icon:"close",label:"Close preferences"})]}),disableCustomHeader:s,actions:c,customFooter:(0,e.jsx)(e.Fragment,{}),children:(0,e.jsx)(rc,{menu:o,application:n,closePreferences:i})})})),oc=(e,n,i)=>{const{gesture:o="pan",requiresStartFromEdge:s=!0}=i||{},a=(0,sr.I)(),l=(0,He.useRef)(null),[c,u]=(0,He.useState)(null),d=(0,Vn.Y)(n),h=(0,et.ac)(et.Jj.sm),p=(0,et.ac)("(prefers-reduced-motion: reduce)"),f="pan"===o&&p?"swipe":o,[g,m]=(0,He.useState)((()=>a.getPreference(r.PrefKey.PaneGesturesEnabled,r.PrefDefaults[r.PrefKey.PaneGesturesEnabled])));return(0,He.useEffect)((()=>a.addSingleEventObserver(r.ApplicationEvent.PreferencesChanged,(async()=>{m(a.getPreference(r.PrefKey.PaneGesturesEnabled,r.PrefDefaults[r.PrefKey.PaneGesturesEnabled]))}))),[a]),(0,He.useEffect)((()=>{var n;if(!c)return;if(!h)return;if(!g)return;l.current=(null===(n=c.parentElement)||void 0===n?void 0:n.querySelector('[data-pane-underlay="'.concat(c.id,'"]')))||null;let r,i=0,o=Date.now(),a=0,u=o,p=null,m=null,y=!1;const v=s?25:45,A="right"===e?25:window.innerWidth-25,b=window.innerWidth/2.5,w=e=>{y=!0,setTimeout((()=>{"hidden"===e.target.style.overflowY&&(y=!1)}),5)},S=n=>{i=0,a=0,o=Date.now(),u=o,p=null,m=null,y=!1;const l=n.touches[0];i=l.clientX,a=l.clientX,("right"===e&&i>A||"left"===e&&i<A)&&s?y=!0:(r=(0,t.rP)(n.target),r&&(m=r.style.overflowY,r.addEventListener("scroll",w,!!pt.Mk&&{passive:!0}),r.scrollWidth>r.clientWidth&&(p="x")),c.style.willChange="transform")},C=t=>{if(!l.current){const t=document.createElement("div");t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.width="100%",t.style.height="100%","pan"===f?t.style.backgroundColor="#000":(t.style.background="right"===e?"linear-gradient(to right, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0))":"linear-gradient(to left, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0))",t.style.pointerEvents="none"),t.style.opacity="0",t.style.willChange="opacity",t.setAttribute("role","presentation"),t.ariaHidden="true",t.setAttribute("data-pane-underlay",c.id),"pan"===f?c.before(t):c.after(t),l.current=t}"pan"===f&&c.animate([{transform:"translate3d(".concat(t,"px, 0, 0)")}],{duration:0,fill:"forwards"});const n="pan"===f?Math.min(window.innerWidth/Math.abs(t)/10,.65):Math.min(Math.abs(t)/100,.65);l.current.animate([{opacity:n}],{duration:0,fill:"forwards"})},E=t=>{if("x"===p)return;if(y)return;const n=t.touches[0];a=n.clientX,u=Date.now();const l=a-i;if(l<v)return;const c=s||u-o>150&&a>A;if(r&&"hidden"!==r.style.overflowY&&c&&(r.style.overflowY="hidden"),document.activeElement&&document.activeElement.blur(),"pan"===f){const t="right"===e?Math.max(l-v,0):Math.min(l+v,0);C(t)}else{const t="right"===e?Math.max(l,0):Math.min(l,0);C(t)}},I=()=>{l.current&&l.current.animate([{opacity:0}],{easing:"cubic-bezier(.36,.66,.04,1)",duration:500,fill:"forwards"}).finished.then((()=>{l.current&&(l.current.remove(),l.current=null)})).catch(console.error)},_=()=>{if(r&&(r.removeEventListener("scroll",w),"hidden"===r.style.overflowY&&(r.style.overflowY=m||"")),y)return C(0),void I();const t=a-i;c.style.willChange="","right"===e&&t>b||"left"===e&&t<-b?d.current(c):C(0),I()};return c.addEventListener("touchstart",S,!!pt.Mk&&{passive:!0}),c.addEventListener("touchmove",E,!!pt.Mk&&{passive:!0}),c.addEventListener("touchend",_,!!pt.Mk&&{passive:!0}),()=>{c.removeEventListener("touchstart",S),c.removeEventListener("touchmove",E),c.removeEventListener("touchend",_),I()}}),[e,c,h,d,g,f,s]),[u]};function sc(e){(/Safari/.test(navigator.userAgent)||/AppleWebKit/.test(navigator.userAgent))&&(e.style.opacity="0.999",setTimeout((()=>{e.style.opacity="1.0"}),0))}const ac=(0,Nn.Pi)((t=>{let{application:n}=t;const r=(0,Bn.o)();(0,He.useEffect)((()=>r.addCommandHandler({command:L.QD,category:"General",description:"Open preferences",onKeyDown:()=>n.preferencesController.openPreferences()})),[r,n]);const[i]=oc("right",(async e=>{const t=e.animate([{transform:"translateX(100%)",opacity:0}],{easing:Nr.xY,duration:250,fill:"both"});await t.finished,sc(e),t.finish(),n.preferencesController.closePreferences()}));return(0,e.jsx)(Fr,{isOpen:n.preferencesController.isOpen,ref:i,animate:"mobile",animationVariant:"horizontal",close:n.preferencesController.closePreferences,className:"md:h-full md:!max-h-full md:!w-full md:!border-0",children:(0,e.jsx)(ic,{closePreferences:n.preferencesController.closePreferences,application:n})})})),lc=t=>{let{application:n,onValueChange:r,prompt:i,buttonRef:o}=t;const[s,a]=(0,He.useState)(!1);return(0,e.jsx)("div",{className:"min-w-76",children:(0,e.jsx)(Ln.Z,{primary:!0,fullWidth:!0,colorStyle:s?"success":"info",onClick:async()=>{const e=await n.mobileDevice.authenticateWithBiometrics();a(e),r(e,i)},ref:o,children:s?(0,e.jsxs)("span",{className:"flex items-center justify-center gap-3",children:[(0,e.jsx)(xn.Z,{type:"check-circle"}),"Biometrics successful"]}):"Tap to use biometrics"})})},cc=t.r8?"http://localhost:3001/?route=u2f":"https://app.standardnotes.com/?route=u2f",uc=t=>{let{contextData:n,onResponse:r,apiHost:i}=t;const o=(0,He.useRef)(null);return(0,He.useEffect)((()=>{const e=e=>{var t;V(R.U2F,"Native client received message",e),e.origin!==new URL(cc).origin?V(R.U2F,"Not sending data to U2F iframe; origin does not match",e.origin,new URL(cc).origin):e.data.mountedAuthView?(null===(t=o.current)||void 0===t?void 0:t.contentWindow)&&(V(R.U2F,"Sending contextData to U2F iframe",n),o.current.contentWindow.postMessage({username:n.username,apiHost:i},cc)):e.data.assertionResponse&&(V(R.U2F,"Received assertion response from U2F iframe",e.data.assertionResponse),r(e.data.assertionResponse))};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}}),[n,r,i]),(0,e.jsx)("iframe",{ref:o,src:cc,className:"h-40 w-full",title:"U2F",allow:"publickey-credentials-get",id:"u2f"})},dc=t=>{let{application:n,onValueChange:i,prompt:o,buttonRef:s,contextData:a}=t;const[l,c]=(0,He.useState)(null),[u,d]=(0,He.useState)("");return n.isFullU2FClient||(0,L.Dt)()?(0,e.jsxs)("div",{className:"min-w-76",children:[u&&(0,e.jsx)("div",{className:"text-red-500",children:u}),(0,e.jsx)(Ln.Z,{primary:!0,fullWidth:!0,colorStyle:l?"success":"info",onClick:async()=>{const e=r.Username.create(a.username);if(e.isFailed())return void d(e.getError());const t=e.getValue();let s=null;if((0,L.Dt)()){const e=await n.getAuthenticatorAuthenticationOptions.execute({username:t.value});if(e.isFailed())return void d(e.getError());const r=e.getValue();s=await n.mobileDevice.authenticateWithU2F(JSON.stringify(r))}else{const e=await n.getAuthenticatorAuthenticationResponse.execute({username:t.value});if(e.isFailed())return void d(e.getError());s=e.getValue()}null!==s?(c(s),i(s,o)):d("Failed to obtain device response")},ref:s,children:l?(0,e.jsxs)("span",{className:"flex items-center justify-center gap-3",children:[(0,e.jsx)(xn.Z,{type:"check-circle"}),"Obtained Device Response"]}):"Authenticate Device"})]}):(0,e.jsx)(uc,{contextData:a,apiHost:n.getHost.execute().getValue()||window.defaultSyncServer,onResponse:e=>{i(e,o)}})},hc=t=>{let{application:n,prompt:i,values:o,index:s,onValueChange:a,isInvalid:l,contextData:c}=t;const u=(0,He.useRef)(null),d=(0,He.useRef)(null),h=(0,He.useRef)(null),p=(0,He.useCallback)((async()=>{var e,t,s;if(i.validation===r.ChallengeValidation.Biometric){if(n.isNativeMobileWeb()&&"active"!==await n.mobileDevice.getAppState())return;if("boolean"==typeof o[i.id].value)return;return void(null===(e=d.current)||void 0===e||e.click())}const a=null===(t=u.current)||void 0===t?void 0:t.closest("form");(null==a?void 0:a.contains(document.activeElement))||null===(s=u.current)||void 0===s||s.focus()}),[n,i.id,i.validation,o]);return(0,He.useEffect)((()=>{if(!n.isNativeMobileWeb())return;const e=n.addNativeMobileEventListener((e=>{e===r.ReactNativeToWebEvent.GainingFocus&&p()}));return()=>{e&&e()}}),[p,n]),(0,He.useEffect)((()=>{0!==s||p()}),[p,s]),(0,He.useEffect)((()=>{var e;l&&(null===(e=u.current)||void 0===e||e.focus())}),[l]),(0,e.jsxs)("div",{className:"mb-3 w-full",children:[i.validation===r.ChallengeValidation.ProtectionSessionDuration?(0,e.jsxs)("div",{className:"min-w-76",children:[(0,e.jsx)("div",{className:"mb-2 text-sm font-medium",children:"Allow protected access for"}),(0,e.jsx)("div",{className:"flex items-center justify-between rounded bg-passive-4 p-1",children:r.ProtectionSessionDurations.map((t=>{const n=t.valueInSeconds===o[i.id].value;return(0,e.jsxs)("label",{className:"relative flex cursor-pointer items-center justify-center rounded px-2 py-1.5 text-center focus-within:ring-2 focus-within:ring-info ".concat(n?"bg-default font-semibold text-foreground":"text-passive-0 hover:bg-passive-3"),children:[(0,e.jsx)("input",{type:"radio",name:"session-duration-".concat(i.id),className:"absolute left-0 top-0 m-0 h-px w-px appearance-none focus:shadow-none focus:outline-none",style:{marginRight:0},checked:n,onChange:e=>{e.preventDefault(),a(t.valueInSeconds,i)}}),t.label]},t.label)}))})]}):i.validation===r.ChallengeValidation.Biometric?(0,e.jsx)(lc,{application:n,onValueChange:a,prompt:i,buttonRef:d}):i.validation===r.ChallengeValidation.Authenticator?(0,e.jsx)(dc,{application:n,onValueChange:a,prompt:i,buttonRef:h,contextData:c}):i.secureTextEntry?(0,e.jsx)(gi.Z,{ref:u,placeholder:i.placeholder,className:{container:"w-full max-w-76 ".concat(l?"border-danger":"")},onChange:e=>a(e,i)}):(0,e.jsx)(ui.Z,{ref:u,placeholder:i.placeholder,className:{container:"w-full max-w-76 ".concat(l?"border-danger":"")},onChange:e=>a(e,i)}),l&&(0,e.jsx)("div",{className:"mt-2 text-sm text-danger",children:"Invalid authentication, please try again."})]},i.id)};var pc=s(49258);const fc=t=>{let{mainApplicationGroup:n}=t;const r=(0,He.useRef)(null),i=(0,He.useRef)(null),[o,s]=(0,He.useState)(!1),a=(0,He.useCallback)((()=>{s((e=>!e))}),[]);return(0,e.jsxs)("div",{ref:i,children:[(0,e.jsxs)(Ln.Z,{ref:r,onClick:a,className:"mt-2 flex min-w-76 items-center justify-center",children:[(0,e.jsx)(xn.Z,{type:"user-switch",className:"mr-2 text-neutral"}),"Switch workspace"]}),(0,e.jsx)(On.Z,{title:"Switch workspace",align:"center",anchorElement:r,open:o,overrideZIndex:"z-modal",side:"right",togglePopover:a,children:(0,e.jsx)(pc.Z,{mainApplicationGroup:n,hideWorkspaceOptions:!0})})]})};function gc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function mc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gc(Object(n),!0).forEach((function(t){yc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function yc(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const vc=t=>{let{application:n,mainApplicationGroup:i,challenge:o,onDismiss:s}=t;const a=(0,He.useRef)(null),[l,c]=(0,He.useState)((()=>{var e;const t={};for(const n of o.prompts)t[n.id]={prompt:n,value:null!==(e=n.initialValue)&&void 0!==e?e:"",invalid:!1};return t})),[u,d]=(0,He.useState)(!1),[h,p]=(0,He.useState)(!1),[,f]=(0,He.useState)([]),g=[r.ChallengeReason.ApplicationUnlock,r.ChallengeReason.Migration].includes(o.reason),m=o.reason===r.ChallengeReason.ApplicationUnlock,y=(0,He.useCallback)((()=>{const e=((e,t)=>{let n=!1;const r=mc({},e);for(const e of t){const t=r[e.id];"string"==typeof t.value&&0===t.value.length&&(r[e.id].invalid=!0,n=!0)}if(!n)return r})(l,o.prompts);if(!e)return;if(u||h)return;d(!0),p(!0);const t=[];for(const n of Object.values(e)){const e=n.value,r={prompt:n.prompt,value:e};t.push(r)}const r=t.map((e=>e.prompt));p(r.length>0),f(r),setTimeout((()=>{t.length>0?o.customHandler?o.customHandler(o,t):n.submitValuesForChallenge(o,t).catch(console.error):p(!1),d(!1)}),50)}),[n,o,h,u,l]),v=(0,He.useCallback)(((e,t)=>{const n=mc({},l);n[t.id].invalid=!1,n[t.id].value=e,c(n)}),[l]),A=(0,He.useCallback)((()=>{o.cancelable&&(n.cancelChallenge(o),null==s||s(o))}),[n,o,s]);(0,He.useEffect)((()=>{const e=n.addChallengeObserver(o,{onValidValue:e=>{c((t=>{const n=mc({},t);return n[e.prompt.id].invalid=!1,n})),f((t=>{const n=t.slice();return(0,r.removeFromArray)(n,e.prompt),p(n.length>0),n}))},onInvalidValue:e=>{c((t=>{const n=mc({},t);return n[e.prompt.id].invalid=!0,n})),e.prompt.validates?f((t=>{const n=t.slice();return(0,r.removeFromArray)(n,e.prompt),p(n.length>0),n})):(f([]),p(!1))},onComplete:()=>{null==s||s(o)},onCancel:()=>{null==s||s(o)}});return()=>{e()}}),[n,o,s]);const b=o.prompts.find((e=>e.validation===r.ChallengeValidation.Biometric)),w=o.prompts.find((e=>e.validation===r.ChallengeValidation.Authenticator)),S=1===o.prompts.length&&!!b,C=1===o.prompts.length&&!!w,E=!!b&&!!l[b.id].value,I=!!w&&!!l[w.id].value,_=o.prompts.some((e=>e.secureTextEntry)),x=!(S||C);(0,He.useEffect)((()=>{var e;const t=_&&E;if(S&&E||C&&I)y();else if(t){const t=null===(e=a.current)||void 0===e?void 0:e.querySelector('input[type="password"]');null==t||t.focus()}}),[E,S,y,_,C,I]),(0,He.useEffect)((()=>{const e=n.addAndroidBackHandlerEventListener((()=>(o.cancelable&&A(),!0)));return()=>{e&&e()}}),[n,A,o.cancelable]);const P=(0,et.ac)(et.Jj.sm),k=o.reason===r.ChallengeReason.ApplicationUnlock,[B,O]=(0,He.useState)(null),N=(0,_r.l)(B,{updateOnWindowResize:!0});return(0,e.jsx)(Fr,{isOpen:!0,ref:O,close:A,hideOnInteractOutside:!1,backdropClassName:k?"bg-passive-5":"",className:(0,Q.classNames)("sn-component challenge-modal relative m-0 flex h-full w-full flex-col items-center rounded border-solid border-border bg-default p-0 md:h-auto md:!w-max",!P&&"shadow-overlay-light"),children:(0,e.jsxs)(Gn,{title:"Authenticate",close:A,customHeader:(0,e.jsx)(e.Fragment,{}),customFooter:(0,e.jsx)(e.Fragment,{}),disableCustomHeader:P,actions:[{label:"Cancel",onClick:A,type:"primary",hidden:!o.cancelable,mobileSlot:"right"}],children:[o.cancelable&&(0,e.jsx)("button",{onClick:A,"aria-label":"Close modal",className:"absolute right-4 top-4 hidden cursor-pointer border-0 bg-transparent p-1 md:flex",children:(0,e.jsx)(xn.Z,{type:"close",className:"text-neutral"})}),(0,e.jsxs)("div",{className:"flex min-h-0 w-full flex-grow flex-col items-center overflow-auto p-8",children:[(0,e.jsx)(Po.ProtectedIllustration,{className:(0,Q.classNames)("mb-4 h-30 w-30 flex-shrink-0",N&&N.height<500?"hidden md:block":"")}),(0,e.jsx)("div",{className:"mb-3 max-w-76 text-center text-lg font-bold",children:o.heading}),o.subheading&&(0,e.jsx)("div",{className:"break-word mb-4 max-w-76 text-center text-sm",children:o.subheading}),(0,e.jsx)("form",{className:"flex w-full max-w-76 flex-col items-center md:min-w-76",onSubmit:e=>{e.preventDefault(),y()},ref:a,children:o.prompts.map(((t,r)=>(0,e.jsx)(hc,{application:n,prompt:t,values:l,index:r,onValueChange:v,isInvalid:l[t.id].invalid,contextData:t.contextData},t.id)))}),x&&(0,e.jsx)(Ln.Z,{primary:!0,disabled:h,className:"mb-3.5 mt-1 min-w-76",onClick:y,children:h?"Generating Keys...":"Submit"}),g&&(0,e.jsxs)(Ln.Z,{className:"flex min-w-76 items-center justify-center",onClick:()=>{n.alerts.confirm("If you forgot your local passcode, your only option is to clear your local data from this device and sign back in to your account.","Forgot passcode?","Delete local data",r.ButtonType.Danger).then((e=>{e&&n.user.signOut().catch(console.error)})).catch(console.error)},children:[(0,e.jsx)(xn.Z,{type:"help",className:"mr-2 text-neutral"}),"Forgot passcode?"]}),m&&(0,e.jsx)(fc,{mainApplicationGroup:i})]})]})},o.id)},Ac=e=>{const t={[r.NoteType.Plain]:[],[r.NoteType.Super]:[],[r.NoteType.RichText]:[],[r.NoteType.Markdown]:[],[r.NoteType.Task]:[],[r.NoteType.Code]:[],[r.NoteType.Spreadsheet]:[],[r.NoteType.Authentication]:[],[r.NoteType.Unknown]:[]};return((e,t)=>{for(const n of(0,r.GetIframeAndNativeEditors)())t.features.isExperimentalFeature(n.identifier)||n.deprecated||e[n.note_type].push({isEntitled:t.features.getFeatureStatus(r.NativeFeatureIdentifier.create(n.identifier).getValue())===r.FeatureStatus.Entitled,uiFeature:new r.UIFeature(n)})})(t,e),((e,t)=>{const n=t.componentManager.thirdPartyComponentsForArea(r.ComponentArea.Editor).sort(((e,t)=>e.displayName.toLowerCase()<t.displayName.toLowerCase()?-1:1));for(const i of n){const n=(0,r.FindNativeFeature)(i.identifier);if(n){e[n.note_type].push({isEntitled:t.features.getFeatureStatus(r.NativeFeatureIdentifier.create(n.identifier).getValue())===r.FeatureStatus.Entitled,uiFeature:new r.UIFeature(n)});continue}const o=i.noteType,s={uiFeature:new r.UIFeature(i),isEntitled:t.features.getFeatureStatus(r.Uuid.create(i.uuid).getValue())===r.FeatureStatus.Entitled};e[o].push(s)}})(t,e),(e=>{const t=(0,r.GetSuperNoteFeature)();return[{icon:pt.IN.icon,iconClassName:pt.IN.iconClassName,title:t.name,items:e[r.NoteType.Super],featured:!0},{icon:"rich-text",iconClassName:"text-accessory-tint-1",title:"Rich text",items:e[r.NoteType.RichText]},{icon:"markdown",iconClassName:"text-accessory-tint-2",title:"Markdown text",items:e[r.NoteType.Markdown]},{icon:"tasks",iconClassName:"text-accessory-tint-3",title:"Todo",items:e[r.NoteType.Task]},{icon:"code",iconClassName:"text-accessory-tint-4",title:"Code",items:e[r.NoteType.Code]},{icon:"spreadsheets",iconClassName:"text-accessory-tint-5",title:"Spreadsheet",items:e[r.NoteType.Spreadsheet]},{icon:"authenticator",iconClassName:"text-accessory-tint-6",title:"Authentication",items:e[r.NoteType.Authentication]},{icon:"plain-text",iconClassName:"text-accessory-tint-1",title:"Plain text",items:e[r.NoteType.Plain]},{icon:"editor",iconClassName:"text-neutral",title:"Others",items:e[r.NoteType.Unknown]}]})(t)},bc=e=>{const t=document.querySelector(":root"),n="--sn-stylekit-editor-font-family";e?t.style.setProperty(n,"var(--sn-stylekit-monospace-font)"):t.style.setProperty(n,"var(--sn-stylekit-sans-serif-font)"),document.documentElement.classList.toggle("monospace-font",e)};var wc=s(91031),Sc=s(71881),Cc=s(72604);function Ec(t){let{index:n,isSelected:i,onClick:o,onMouseEnter:s,option:a,searchQuery:l}=t;return(0,e.jsxs)("li",{tabIndex:-1,className:(0,r.classNames)("gap-4",Xn,i&&"bg-info-backdrop",a.item&&"px-3 py-2"),ref:a.setRefElement,role:"option","aria-selected":i,id:"typeahead-item-"+n,onMouseEnter:s,onClick:o,children:[a.item&&(0,e.jsx)(Sc.Z,{item:a.item,searchQuery:l}),!a.item&&(0,e.jsx)(Cc.d,{searchQuery:l,onClickCallback:o,isFocused:i})]},a.key)}class Ic extends Wn.n{constructor(e,t,n){super(t||""),this.item=e,this.label=t,this.options=n,this.key=(null==e?void 0:e.uuid)||t}}var _c=s(90509),xc=s(95768);const Pc=n=>{let{currentNote:i}=n;const o=(0,sr.I)(),[s]=(0,Zn.g)(),a=(0,xc.o)(),[l,c]=(0,He.useState)(""),u=function(e,t){let{minLength:n=1,maxLength:r=75}={minLength:0};return(0,He.useCallback)((e=>{const t=new RegExp("(^|\\s|\\()([@](\\S(?:[^@]){0,"+r+"}))$").exec(e);if(null!==t){const e=t[1],r=t[3];if(r.length>=n)return{leadOffset:t.index+e.length,matchingString:r,replaceableString:t[2]}}return null}),[r,n,"@"])}(),d=(0,He.useCallback)(((e,t,n,r)=>{s.update((()=>{t&&t.remove(),e.options.onSelect(r),n()}))}),[s]),h=(0,He.useMemo)((()=>{const{linkedItems:e,unlinkedItems:t,shouldShowCreateTag:n}=(0,_c.Q)(l||"",o,i,{returnEmptyIfQueryEmpty:!1}),c=[...e,...t].map((e=>new Ic(e,e.title||"",{onSelect:t=>{a.linkItems(i,e),e.content_type===r.ContentType.TYPES.File?s.dispatchCommand(ir.dq,e.uuid):s.dispatchCommand(ir.KG,e.uuid)}})));return n&&c.push(new Ic(void 0,"",{onSelect:async e=>{const t=await a.createAndAddNewTag(e||"");s.dispatchCommand(ir.KG,t.uuid)}})),c}),[o,s,i,l,a]);return(0,e.jsx)(Wn.HQ,{onQueryChange:c,onSelectOption:d,triggerFn:u,options:h,menuRenderFn:(n,r)=>{let{selectedIndex:i,selectOptionAndCleanUp:o,setHighlightedIndex:s}=r;return n.current&&h.length?(0,e.jsx)(On.Z,{title:"Select item",align:"start",anchorElement:n,open:!0,disableMobileFullscreenTakeover:!0,side:(0,t.Av)()?"top":"bottom",maxHeight:e=>e/2,children:(0,e.jsx)("ul",{children:h.map(((t,n)=>(0,e.jsx)(Ec,{searchQuery:l||"",index:n,isSelected:i===n,onClick:()=>{s(n),o(t)},onMouseEnter:()=>{s(n)},option:t},t.key)))})}):null}})};var kc=s(7355),Bc=s(97247);function Oc(){const[e]=(0,Zn.g)();return(0,He.useEffect)((()=>{if(!e.hasNodes([kc.H]))throw new Error("ItemBubblePlugin: BubbleNode not registered on editor");return e.registerCommand(ir.KG,(e=>{const t=(0,Bc.fj)(e);return(0,W.od)([t]),(0,W._v)(t.getParentOrThrow())&&(0,se.JB)(t,W.BE).selectEnd(),!0}),W.VN)}),[e]),null}function Nc(e){let{nodeType:t,onRemove:n}=e;const[r]=(0,Zn.g)(),i=(0,He.useRef)(new Map);return(0,He.useEffect)((()=>{const e=r.registerMutationListener(t,(e=>{r.getEditorState().read((()=>{for(const[t,r]of e)if("updated"===r||"created"===r){const e=(0,W.gI)(t);if(e){const n=e.getId();i.current.set(t,n)}}else if("destroyed"===r){const e=i.current.get(t);e&&n(e)}}))}));return()=>{e()}})),null}var Dc=s(92249);function jc(e){let{providerCallback:t}=e;const[n]=(0,Zn.g)();return(0,He.useEffect)((()=>{t((e=>{n.update((()=>{const t=n.parseEditorState(e);n.setEditorState(t)}))}))}),[n,t]),null}function Tc(e){let{onMarkdown:t}=e;const[n]=(0,Zn.g)();return(0,He.useEffect)((()=>{n.update((()=>{const e=(0,W.Gv)(),n=(0,W.K8)(W.CK);for(const e of n)e.isEmpty()&&e.remove();const r=(0,pe.JH)(X.c);e.clear().append((0,re.Ol)("markdown").append((0,W.MX)(r))),e.selectEnd(),t(r)}))}),[n,t]),null}const Mc=t=>{let{note:n,closeDialog:r}=t;const[i,o]=(0,He.useState)(""),[s,a]=(0,He.useState)(!1),l=(0,He.useCallback)((()=>{var e;e=i,navigator.clipboard?navigator.clipboard.writeText(e):function(e){const t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}catch(e){console.error("Unable to copy",e)}document.body.removeChild(t)}(e),a(!0),setTimeout((()=>{a(!1)}),1500)}),[i]),c=(0,He.useCallback)((e=>{o(e)}),[]),u=(0,et.ac)(et.Jj.sm),d=(0,He.useMemo)((()=>[{label:s?"Copied":"Copy",type:"primary",onClick:l,mobileSlot:"left"},{label:"Done",type:"cancel",onClick:r,mobileSlot:"right",hidden:!u}]),[r,l,s,u]);return(0,e.jsx)(Gn,{title:"Markdown Preview",close:r,actions:d,children:(0,e.jsx)("div",{className:"relative w-full px-4 py-4",children:(0,e.jsx)(As,{children:(0,e.jsx)(zn.I,{readonly:!0,initialValue:n.text,children:(0,e.jsx)(Yn.k,{readonly:!0,className:"relative resize-none text-base focus:shadow-none focus:outline-none",spellcheck:n.spellcheck,children:(0,e.jsx)(Tc,{onMarkdown:c})})})})})})},Fc=(0,He.forwardRef)(((e,t)=>{const[n]=(0,Zn.g)();(0,He.useImperativeHandle)(t,(()=>({getMarkdown:()=>r()})));const r=(0,He.useCallback)((()=>n.getEditorState().read((()=>(0,pe.JH)(X.c)))),[n]);return null})),Rc=Fc,Lc=e=>{let{note:t}=e;const n=(0,sr.I)(),[i]=(0,Zn.g)(),[o,s]=(0,He.useState)(t.locked);return(0,He.useEffect)((()=>n.items.streamItems(r.ContentType.TYPES.Note,(e=>{let{changed:n}=e;const r=n.find((e=>e.uuid===t.uuid));r&&s(r.locked)}))),[n,t.uuid]),(0,He.useEffect)((()=>{i.update((()=>{i.setEditable(!o)}))}),[i,o]),null},Qc=()=>(0,e.jsx)("button",{className:"peer flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-full bg-warning text-warning-contrast",children:(0,e.jsx)(xn.Z,{type:"warning",size:"small"})}),Uc=(e,t,n)=>{switch(e){case r.FeatureStatus.InCurrentPlanButExpired:return t?"Your subscription expired on ".concat((0,r.dateToLocalizedString)(t)):"Your subscription expired.";case r.FeatureStatus.NoUserSubscription:return"You do not have an active subscription";case r.FeatureStatus.NotInCurrentPlan:return"Please upgrade your plan to access ".concat(n);default:return"".concat(n," is valid and you should not be seeing this message")}},Vc=t=>{let{featureStatus:n,feature:r}=t;const i=(0,sr.I)(),o=i.subscriptions.userSubscriptionExpirationDate,s=(0,He.useCallback)((()=>{i.openSubscriptionDashboard.execute()}),[i]);return(0,e.jsx)("div",{className:"sn-component",children:(0,e.jsxs)("div",{className:"flex min-h-[1.625rem] w-full select-none items-center justify-between border-b border-border bg-contrast px-2 py-2.5 text-text",children:[(0,e.jsx)("div",{className:"left",children:(0,e.jsxs)("div",{className:"flex items-start",children:[(0,e.jsx)("div",{className:"mt-1",children:(0,e.jsx)(Qc,{})}),(0,e.jsxs)("div",{className:"ml-2",children:[(0,e.jsx)("strong",{children:Uc(n,o,r.name)}),(0,e.jsxs)("div",{className:"sk-p",children:[r.name," is in a read-only state."]})]})]})}),(0,e.jsx)("div",{className:"right",children:(0,e.jsx)(Ln.Z,{onClick:s,primary:!0,colorStyle:"success",small:!0,children:"Manage subscription"})})]})})};function Kc(e){let{isEnabled:t}=e;const n=(0,sr.I)(),[i]=(0,Zn.g)(),[o,s]=(0,He.useState)(!1);return(0,He.useEffect)((()=>{if(t){if(n.platform===r.Platform.Ios)return i.registerUpdateListener((()=>{if(o)return;const e=i.getRootElement();e&&(e.focus(),s(!0))}));i.focus()}}),[n.platform,o,i,t]),null}function Hc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Gc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hc(Object(n),!0).forEach((function(t){Yc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Yc(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const zc=t=>{let{application:n,linkingController:i,filesController:o,spellcheck:s,controller:a,readonly:l,onFocus:c,onBlur:u}=t;const d=(0,He.useRef)(a.item),h=(0,He.useRef)(),p=(0,He.useRef)(!1),[f,g]=(0,He.useState)(!1),m=(0,He.useRef)(null),[y,v]=(0,He.useState)(r.FeatureStatus.Entitled);(0,He.useEffect)((()=>{v(n.features.getFeatureStatus(r.NativeFeatureIdentifier.create(r.NativeFeatureIdentifier.TYPES.SuperEditor).getValue(),{inContextOfItem:d.current}))}),[n.features]);const A=(0,Bn.o)();(0,He.useEffect)((()=>A.addCommandHandler({command:L.YN,category:"Super notes",description:"Show markdown preview for current note",onKeyDown:()=>g(!0)})),[A]),(0,He.useEffect)((()=>{const e=n.platform,t=(0,L.dP)(n.platform);return A.registerExternalKeyboardShortcutHelpItems([{key:"b",modifiers:[t],description:"Bold",category:"Formatting",platform:e},{key:"i",modifiers:[t],description:"Italic",category:"Formatting",platform:e},{key:"u",modifiers:[t],description:"Underline",category:"Formatting",platform:e},{key:"k",modifiers:[t],description:"Link",category:"Formatting",platform:e}])}),[n.platform,A]);const b=(0,He.useCallback)((()=>{g(!1)}),[]);(0,He.useEffect)((()=>n.actions.addPayloadRequestHandler((e=>{var t,n;if(e===d.current.uuid){const e=d.current.payload.ejected();return Gc(Gc({},e),{},{content:Gc(Gc({},e.content),{},{text:null!==(n=null===(t=m.current)||void 0===t?void 0:t.getMarkdown())&&void 0!==n?n:e.content.text})})}}))),[n]);const w=(0,He.useCallback)((async(e,t)=>{!0!==p.current?a.saveAndAwaitLocalPropagation({text:e,isUserModified:!0,previews:{previewPlain:t,previewHtml:void 0}}):p.current=!1}),[a]),S=(0,He.useCallback)((e=>{const t=n.items.findItem(e);t&&i.unlinkItemFromSelectedItem(t).catch(console.error)}),[i,n]);(0,He.useEffect)((()=>a.addNoteInnerValueChangeObserver(((e,t)=>{var n;if(e.uuid!==d.current.uuid)throw Error("Editor received changes for non-current note");(0,r.isPayloadSourceRetrieved)(t)&&(p.current=!0,null===(n=h.current)||void 0===n||n.call(h,e.text)),d.current=e}))),[a,a.item.uuid]);const[C]=(0,Er.D)(r.LocalPrefKey.EditorLineHeight),[E]=(0,Er.D)(r.LocalPrefKey.EditorFontSize),I=Ir(E,!1),_=(0,He.useRef)(null);(0,He.useEffect)((()=>{const e=e=>{var t;"A"===e.target.tagName&&((null===(t=e.target.getAttribute("href"))||void 0===t?void 0:t.startsWith("http"))||e.preventDefault())},t=_.current;return t&&t.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e)}}),[]);const x=(0,He.useCallback)((e=>{n.notifyWebEvent(r.WebAppEvent.EditorDidFocus,{eventSource:kn.UserInteraction}),null==c||c(e)}),[n,c]);return(0,e.jsxs)("div",{id:kl.N.SuperEditor,className:"font-editor relative flex h-full w-full flex-col",style:{"--line-height":r.EditorLineHeightValues[C],"--font-size":I},ref:_,children:[y!==r.FeatureStatus.Entitled&&(0,e.jsx)(Vc,{featureStatus:y,feature:(0,r.GetSuperNoteFeature)()}),(0,e.jsxs)(As,{children:[(0,e.jsx)(xc.Z,{controller:i,children:(0,e.jsx)(Dc.Z,{controller:o,children:(0,e.jsx)(zn.I,{readonly:d.current.locked||l,initialValue:d.current.text,children:(0,e.jsxs)(Yn.k,{onChange:w,className:"blocks-editor h-full resize-none",previewLength:160,spellcheck:s,readonly:d.current.locked||l,onFocus:x,onBlur:u,children:[(0,e.jsx)(Pc,{currentNote:d.current}),(0,e.jsx)(wr.Z,{currentNote:d.current}),(0,e.jsx)(Oc,{}),(0,e.jsx)(Rc,{ref:m}),(0,e.jsx)(jc,{providerCallback:e=>h.current=e}),(0,e.jsx)(Nc,{nodeType:kc.H,onRemove:S}),(0,e.jsx)(Nc,{nodeType:ee.h,onRemove:S}),void 0===l&&(0,e.jsx)(Lc,{note:d.current}),(0,e.jsx)(Kc,{isEnabled:a.isTemplateNote}),(0,e.jsx)(Cr,{})]})})})}),(0,e.jsx)(Fr,{isOpen:f,close:b,children:(0,e.jsx)(Mc,{note:d.current,closeDialog:b})})]})]})};function Zc(e){let{text:t,format:n,onChange:r,customImportFunction:i}=e;const[o]=(0,Zn.g)();return(0,He.useEffect)((()=>{0===t.trim().length||(i?i(o,t):o.update((()=>{if("md"===n)Ee(t,X.c,void 0,!0);else{const e=(new DOMParser).parseFromString(t,"text/html"),n=(0,$.s)(o,e),r=(0,W.vN)(),i=(0,W.BE)();r.insertNodes([i,...n])}})))}),[o,t,n,i]),(0,He.useEffect)((()=>o.registerUpdateListener((e=>{let{editorState:t}=e;t.read((()=>{(0,wc.S)(t,160,r)}))}))),[o,r]),null}const Wc=t=>{let{note:n,application:i,closeDialog:o,onComplete:s}=t;const a=0===n.text.length,l=function(e){try{JSON.parse(e)}catch(e){return!1}return!0}(n.text),[c,u]=(0,He.useState)({text:"",previewPlain:""}),d=!n.noteType||[r.NoteType.Plain,r.NoteType.Markdown,r.NoteType.Code,r.NoteType.Task].includes(n.noteType)?"md":"html",h=(0,He.useCallback)(((e,t)=>{u({text:e,previewPlain:t})}),[]),p=(0,He.useCallback)((async(e,t)=>{const r=new Bt(n,i.items,i.mutator,i.sync,i.sessions,i.preferences,i.componentManager,i.alerts,i.isNativeMobileWebUseCase);await r.initialize(),await r.saveAndAwaitLocalPropagation({text:e,previews:{previewPlain:t,previewHtml:void 0},isUserModified:!0,bypassDebouncer:!0})}),[i,n]),f=(0,He.useCallback)((async()=>{o(),await p(c.text,c.previewPlain),s()}),[o,p,s,c]);(0,He.useEffect)((()=>{a&&f()}),[a,f]);const g=(0,He.useCallback)((async()=>{await i.alerts.confirm((0,Q.spaceSeparatedStrings)("This option is useful if you switched this note's type from Super to another plaintext-based format, and want to return to Super.","To use this option, the preview in the convert window should display a language format known as JSON.","If this is not the case, cancel this prompt."),"Are you sure?")&&(o(),await p(n.text,n.preview_plain),s())}),[o,i,n,s,p]),m=(0,He.useMemo)((()=>[{label:"Cancel",onClick:o,type:"cancel",mobileSlot:"left"},{label:"Convert",onClick:f,mobileSlot:"right",type:"primary"},{label:"Convert As-Is",onClick:g,type:"secondary",hidden:!l}]),[l,o,f,g]),[y]=(0,Er.D)(r.LocalPrefKey.EditorLineHeight),[v]=(0,Er.D)(r.LocalPrefKey.EditorFontSize),A=Ir(v,!1);return a?null:(0,e.jsxs)(Gn,{title:"Convert to Super note",close:o,actions:m,children:[(0,e.jsx)("div",{className:"border-b border-border px-4 py-4 text-sm font-normal text-neutral md:py-3",children:"The following is a preview of how your note will look when converted to Super. Super notes use a custom format under the hood. Converting your note will transition it from plaintext to the custom Super format."}),(0,e.jsx)("div",{className:"relative w-full px-4 py-4",style:{"--line-height":r.EditorLineHeightValues[y],"--font-size":A},children:(0,e.jsx)(As,{children:(0,e.jsx)(zn.I,{readonly:!0,initialValue:void 0,children:(0,e.jsx)(Yn.k,{readonly:!0,onChange:h,ignoreFirstChange:!1,className:"relative resize-none text-base focus:shadow-none focus:outline-none",previewLength:160,spellcheck:n.spellcheck,children:(0,e.jsx)(Zc,{text:n.text,format:d,onChange:h})})})})})]})},qc=()=>(0,e.jsx)("div",{className:"sn-component",children:(0,e.jsx)("div",{className:"sk-panel static",children:(0,e.jsx)("div",{className:"sk-panel-content",children:(0,e.jsxs)("div",{className:"sk-panel-section stretch",children:[(0,e.jsx)("div",{className:"sk-panel-column"}),(0,e.jsx)("div",{className:"text-base font-bold",children:"You have restricted this component to not use a hosted version."}),(0,e.jsx)("div",{className:"sk-subtitle",children:"Locally-installed components are not available in the web application."}),(0,e.jsx)("div",{className:"sk-panel-row"}),(0,e.jsx)("div",{className:"sk-panel-row",children:(0,e.jsxs)("div",{className:"sk-panel-column",children:[(0,e.jsx)("div",{className:"sk-p",children:"To continue, choose from the following options:"}),(0,e.jsxs)("ul",{className:"mt-3 list-disc pl-8",children:[(0,e.jsxs)("li",{className:"sk-p mb-1",children:["Enable the Hosted option for this component by opening the Preferences ",">"," General ",">"," Advanced Settings menu and toggling 'Use hosted when local is unavailable' under this component's options. Then press Reload."]}),(0,e.jsx)("li",{className:"sk-p",children:"Use the desktop application."})]})]})})]})})})}),Jc=t=>{let{componentName:n}=t;return(0,e.jsx)("div",{className:"sn-component",children:(0,e.jsx)("div",{className:"sk-panel static",children:(0,e.jsx)("div",{className:"sk-panel-content",children:(0,e.jsxs)("div",{className:"sk-panel-section stretch",children:[(0,e.jsx)("div",{className:"sk-panel-section-title",children:"This extension is missing its URL property."}),(0,e.jsxs)("p",{children:["In order to access your note immediately, please switch from ",n," to the Plain Editor."]}),(0,e.jsx)("br",{}),(0,e.jsx)("p",{children:"Please contact help@standardnotes.com to remedy this issue."})]})})})})},Xc=t=>{let{deprecationMessage:n,dismissDeprecationMessage:r}=t;return(0,e.jsx)("div",{className:"sn-component",children:(0,e.jsxs)("div",{className:"flex min-h-[1.625rem] w-full select-none items-center justify-between border-b border-border bg-contrast px-2 py-2.5 text-text",children:[(0,e.jsx)("div",{className:"left",children:(0,e.jsx)("div",{className:"sk-app-bar-item",children:(0,e.jsx)("div",{className:"text-xs font-bold text-warning",children:n||"This extension is deprecated."})})}),(0,e.jsx)("div",{className:"right",children:(0,e.jsx)(Ln.Z,{primary:!0,onClick:r,small:!0,children:"Dismiss"})})]})})},$c=t=>{let{componentName:n,reloadIframe:r}=t;return(0,e.jsx)("div",{className:"sn-component",children:(0,e.jsxs)("div",{className:"flex min-h-[1.625rem] w-full select-none items-center justify-between border-b border-border bg-contrast px-2 py-2.5 text-text",children:[(0,e.jsx)("div",{className:"left",children:(0,e.jsx)("div",{className:"sk-app-bar-item",children:(0,e.jsxs)("div",{className:"sk-label.warning",children:["There was an issue loading ",n,"."]})})}),(0,e.jsx)("div",{className:"right",children:(0,e.jsx)(Ln.Z,{primary:!0,onClick:r,small:!0,children:"Reload"})})]})})};function eu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eu(Object(n),!0).forEach((function(t){nu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function nu(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ru=(0,Nn.Pi)((t=>{let{onLoad:n,componentViewer:i,requestReload:o,readonly:s=!1,usedInModal:a=!1}=t;const l=(0,sr.I)(),c=(0,He.useRef)(null),[u,d]=(0,He.useState)(void 0),[h,p]=(0,He.useState)(!1),[f,g]=(0,He.useState)(!0),[m,y]=(0,He.useState)(i.getFeatureStatus()),[v,A]=(0,He.useState)(!0),[b,w]=(0,He.useState)(void 0),[S,C]=(0,He.useState)(void 0),[E,I]=(0,He.useState)(!1),[_,x]=(0,He.useState)(!1),P=i.getComponentOrFeatureItem(),k=(0,He.useCallback)((()=>{y(i.getFeatureStatus()),i.lockReadonly||i.setReadonly(m!==r.FeatureStatus.Entitled||s),A(i.shouldRender()),f&&!v&&g(!1),w(i.getError()),C(P.deprecationMessage)}),[i,f,v,P.deprecationMessage,m,s]);(0,He.useEffect)((()=>{k()}),[k]),(0,He.useEffect)((()=>l.subscriptions.addEventObserver((e=>{e===r.SubscriptionManagerEvent.DidFetchSubscription&&k()}))),[l.subscriptions,k]);const B=(0,He.useCallback)((()=>{"hidden"!==document.visibilityState&&h&&(null==o||o(i))}),[h,i,o]);(0,He.useEffect)((()=>{const e=setTimeout((()=>{g(!1),p(!0),_?document.addEventListener("visibilitychange",B):(x(!0),null==o||o(i))}),4e3);return d(e),()=>{e&&clearTimeout(e)}}),[i]);const O=(0,He.useCallback)((()=>{const e=c.current.contentWindow;u&&clearTimeout(u);try{i.setWindow(e)}catch(e){console.error(e)}setTimeout((()=>{g(!1),p(!1),null==n||n()}),35)}),[i,n,u]);(0,He.useEffect)((()=>{const e=i.addEventObserver((e=>{e===r.ComponentViewerEvent.FeatureStatusUpdated&&y(i.getFeatureStatus())}));return()=>{e()}}),[i]),(0,He.useEffect)((()=>{const e=i.addActionObserver(((e,t)=>{switch(e){case r.ComponentAction.KeyDown:l.keyboardService.handleComponentKeyDown(t.keyboardModifier);break;case r.ComponentAction.KeyUp:l.keyboardService.handleComponentKeyUp(t.keyboardModifier);break;case r.ComponentAction.Click:l.notesController.setContextMenuOpen(!1);break;default:return}}));return()=>{e()}}),[i,l]),(0,He.useEffect)((()=>{var e;const t=null===(e=l.desktopManager)||void 0===e?void 0:e.registerUpdateObserver((e=>{e.uuid===P.uniqueIdentifier.value&&(null==o||o(i))}));return()=>{null==t||t()}}),[l,o,i,P]);const N=(0,He.useMemo)((()=>{const e=["allow-scripts","allow-top-navigation-by-user-activation","allow-popups","allow-modals","allow-forms","allow-downloads"];return P.isNativeFeature&&e.push("allow-popups-to-escape-sandbox"),l.isNativeMobileWeb()&&P.isNativeFeature&&e.push("allow-same-origin"),e}),[l,P]);return(0,e.jsxs)(e.Fragment,{children:[h&&(0,e.jsx)($c,{componentName:P.displayName,reloadIframe:()=>{k(),null==o||o(i,!0)}}),m!==r.FeatureStatus.Entitled&&(0,e.jsx)(Vc,{featureStatus:m,feature:P.featureDescription}),S&&!E&&(0,e.jsx)(Xc,{deprecationMessage:S,dismissDeprecationMessage:()=>{I(!0)}}),b===r.ComponentViewerError.OfflineRestricted&&(0,e.jsx)(qc,{}),b===r.ComponentViewerError.MissingUrl&&(0,e.jsx)(Jc,{componentName:P.displayName}),P.uniqueIdentifier&&v&&(0,e.jsx)("iframe",tu(tu({className:"h-full w-full flex-grow bg-transparent",ref:c,onLoad:O,"data-component-viewer-id":i.identifier,frameBorder:0,src:i.url||"",sandbox:N.join(" ")},a&&{"data-used-in-modal":!0}),{},{children:"Loading"})),f&&(0,e.jsx)("div",{className:"loading-overlay"})]})})),iu=t=>{let{note:n,convertTo:i,closeDialog:o,onComplete:s}=t;const a=(0,sr.I)(),{uiFeature:l}=i,c=(0,He.useMemo)((()=>{if(l){const e=l.fileType;if(e)return e}return l.noteType===r.NoteType.Markdown?"md":l.noteType===r.NoteType.RichText?"html":l.noteType===r.NoteType.Plain?"txt":"json"}),[l]),[u,d]=(0,He.useState)("");(0,He.useEffect)((()=>{(async()=>{if(0===n.text.length)return n.text;try{return(new Be).convertSuperStringToOtherFormat(n.text,c)}catch(e){console.error(e)}return n.text})().then(d).catch(console.error)}),[c,n]);const h=(0,He.useMemo)((()=>{if(!l||!(0,r.isUIFeatureAnIframeFeature)(l))return;const e=a.items.createTemplateItem(r.ContentType.TYPES.Note,{title:n.title,text:u,references:n.references});return a.componentManager.createComponentViewer(l,{readonlyItem:e})}),[a.componentManager,a.items,l,u,n.references,n.title]);(0,He.useEffect)((()=>()=>{h&&a.componentManager.destroyComponentViewer(h)}),[a.componentManager,h]);const p=(0,He.useCallback)((async e=>{const t=new Bt(n,a.items,a.mutator,a.sync,a.sessions,a.preferences,a.componentManager,a.alerts,a.isNativeMobileWebUseCase);await t.initialize(),await t.saveAndAwaitLocalPropagation({text:e,isUserModified:!0,bypassDebouncer:!0})}),[a,n]),f=(0,He.useCallback)((async()=>{await p(u),s(),o()}),[o,u,s,p]),g=0===n.text.length;(0,He.useEffect)((()=>{g&&f()}),[g,f]);const m=(0,He.useCallback)((async()=>{await a.alerts.confirm((0,r.spaceSeparatedStrings)("This option is useful if you want to edit the note's content which is in Super's JSON format directly.",'This format is not human-readable. If you want to convert the note to a human-readable format, please use the "Convert" option instead.'),"Are you sure?")&&(o(),await p(n.text),s())}),[o,a,n,s,p]),y=(0,He.useMemo)((()=>[{label:"Cancel",onClick:o,type:"cancel",mobileSlot:"left"},{label:"Convert",onClick:f,mobileSlot:"right",type:"primary"},{label:"Convert As-Is",onClick:m,type:"secondary"}]),[o,f,m]);return(0,e.jsxs)(Gn,{title:"Convert to ".concat(l.displayName),close:o,actions:y,className:"flex flex-col !overflow-hidden",children:["txt"===c||"md"===c?(0,e.jsxs)("div",{className:"flex items-start border-b border-border p-4 text-sm",children:[(0,e.jsx)(xn.Z,{type:"warning",className:"mr-2 flex-shrink-0"}),"Conversion from Super's format to Markdown/Plaintext can be lossy. Please review the converted note before saving."]}):null,h?(0,e.jsx)("div",{className:"component-view min-h-0",children:(0,e.jsx)(ru,{usedInModal:!0,readonly:!0,componentViewer:h},h.identifier)}):(0,e.jsx)("div",{className:"h-full min-h-0 overflow-hidden",children:(0,e.jsx)("textarea",{readOnly:!0,className:"font-editor h-full w-full resize-none border-0 bg-default p-4 text-editor text-text",value:u})})]})},ou=t=>{let{application:n,closeMenu:i,note:o,onSelect:s,setDisableClickOutside:a}=t;const[l,c]=(0,He.useState)([]),[u,d]=(0,He.useState)(!1),h=(0,He.useCallback)((()=>{const e=Ac(n);if(c(e),o&&o.editorIdentifier){let t=!1;for(const n of e)for(const e of n.items)if(e.uiFeature.featureIdentifier===o.editorIdentifier){t=!0;break}d(!t)}}),[n,o]);(0,He.useEffect)((()=>{n.items.streamItems([r.ContentType.TYPES.Component],h)}),[n,h]),(0,He.useEffect)((()=>{h()}),[h]);const[p,f]=(0,He.useState)(),[g,m]=(0,He.useState)(null),y=!!g&&(null==o?void 0:o.noteType)!==r.NoteType.Super&&!!(null==o?void 0:o.text.length)&&g.uiFeature.noteType===r.NoteType.Super,v=!!g&&(null==o?void 0:o.noteType)===r.NoteType.Super&&g.uiFeature.noteType!==r.NoteType.Super;(0,He.useEffect)((()=>{o&&f(n.componentManager.editorForNote(o))}),[n,o]);const A=Qr(),b=(0,He.useCallback)((e=>{if(p)return e.uiFeature.featureIdentifier===p.featureIdentifier;const t=e.uiFeature.noteType===(null==o?void 0:o.noteType),n=!(null==o?void 0:o.noteType)&&e.uiFeature.noteType===r.NoteType.Plain,i=(null==o?void 0:o.noteType)===r.NoteType.Unknown&&e.uiFeature.noteType===r.NoteType.Plain;return t||n||i}),[p,o]),w=(0,He.useCallback)((async(e,t)=>{e.isComponent&&e.asComponent.conflictOf&&n.changeAndSaveItem.execute(e.asComponent,(e=>{e.conflictOf=void 0})),await n.itemListController.insertCurrentIfTemplate(),await n.changeAndSaveItem.execute(t,(t=>{const n=t;n.noteType=e.noteType,n.editorIdentifier=e.featureIdentifier})),f(n.componentManager.editorForNote(t)),e.featureIdentifier===r.NativeFeatureIdentifier.TYPES.PlainEditor&&bc(n.preferences.getLocalValue(r.LocalPrefKey.EditorMonospaceEnabled))}),[n]),S=(0,He.useCallback)((e=>{const t=e||g;t&&o&&(w(t.uiFeature,o).catch(console.error),i())}),[g,o,i,w]),C=(0,He.useCallback)((async e=>{if(!e.isEntitled)return e.uiFeature.featureIdentifier===r.NativeFeatureIdentifier.TYPES.SuperEditor?void A.showSuperDemo():void A.activate(e.uiFeature.displayName);if(!o)return;if(o.locked)return void n.alerts.alert(ht.L0).catch(console.error);if(e.uiFeature.noteType===r.NoteType.Super){if(0===o.text.length)return void S(e);if(o.noteType===r.NoteType.Super)return;return m(e),void(null==a||a(!0))}if(o.noteType===r.NoteType.Super&&o.text.length>0)return m(e),void(null==a||a(!0));let t=!0;e.uiFeature&&n.componentManager.doesEditorChangeRequireAlert(p,e.uiFeature)&&(t=await n.componentManager.showEditorChangeAlert()),t&&w(e.uiFeature,o).catch(console.error),i(),s&&s(e.uiFeature)}),[o,i,s,A,n.alerts,n.componentManager,a,S,p,w]),E=!o||o.noteType&&[r.NoteType.Plain,r.NoteType.Markdown,r.NoteType.RichText,r.NoteType.Task,r.NoteType.Code,r.NoteType.Unknown].includes(o.noteType),I=()=>{m(null),null==a||a(!1)},_=()=>{m(null),null==a||a(!1)},x=(0,He.useCallback)((()=>{n.openPreferences("plugins")}),[n]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(qr.Z,{className:"pb-1 pt-0.5",a11yLabel:"Change note type menu",children:[(0,e.jsx)(Jr.Z,{children:(0,e.jsxs)("div",{className:"flex items-center justify-between py-3 pr-4 md:pb-1 md:pt-0",children:[(0,e.jsxs)("div",{className:"px-3",children:[(0,e.jsx)("h2",{className:"text-base font-bold",children:"Choose a note type"}),u&&(0,e.jsx)("p",{className:"mr-2 pt-1 text-xs text-warning",children:"Unable to find system editor for this note. Select Manage Plugins to reinstall this editor."})]}),(0,e.jsx)("button",{className:"cursor-pointer whitespace-nowrap text-right text-xs text-info",onClick:x,children:"Manage Plugins"})]})}),l.filter((e=>e.items&&e.items.length)).map((t=>{const n=(e=>e.title.toLowerCase().replace(/\s/,"-"))(t);return(0,e.jsx)(Jr.Z,{children:t.items.map((n=>(0,e.jsx)(Kr.Z,{onClick:()=>{C(n).catch(console.error)},className:"flex-row-reversed py-2",checked:b(n),info:n.uiFeature.description,children:(0,e.jsxs)("div",{className:"flex flex-grow items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex items-center ".concat(t.featured?"font-bold":""),children:[t.icon&&(0,e.jsx)(xn.Z,{type:t.icon,className:"mr-2 ".concat(t.iconClassName)}),n.uiFeature.displayName,n.isLabs&&(0,e.jsx)(Ge.DR,{className:"px-1.5 py-0.5",style:"success",children:"Labs"}),n.uiFeature.featureIdentifier===r.NativeFeatureIdentifier.TYPES.SuperEditor&&!b(n)&&E&&(0,e.jsx)(Ge.DR,{className:"px-1.5 py-0.5 text-[9px]",style:"info",children:"Recommended"})]}),!n.isEntitled&&(0,e.jsx)(xn.Z,{type:Mn._,className:Mn.K})]})},n.uiFeature.uniqueIdentifier.value)))},n)}))]}),(0,e.jsx)(Fr,{isOpen:y,close:I,children:o&&(0,e.jsx)(Wc,{note:o,application:n,onComplete:S,closeDialog:I})}),(0,e.jsx)(Fr,{isOpen:v,close:_,className:"md:h-full md:max-h-[90%]",children:o&&g&&(0,e.jsx)(iu,{note:o,convertTo:g,closeDialog:_,onComplete:S})})]})},su=t=>{let{application:n,note:r,iconClassName:i,disabled:o}=t;const[s,a]=(0,He.useState)(!1),l=(0,He.useRef)(null),c=(0,He.useRef)(null),u=(0,He.useCallback)((async()=>{a((e=>!e))}),[]),d=(0,He.useMemo)((()=>n.keyboardService.keyboardShortcutForCommand(L.AX)),[n]);return(0,e.jsxs)("div",{ref:l,children:[(0,e.jsxs)(ci.Z,{className:"justify-between",onClick:u,onKeyDown:e=>{e.key===L.u8.Escape&&a(!1)},disabled:o,ref:c,children:[(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)(xn.Z,{type:"dashboard",className:"".concat(i," mr-2 text-neutral")}),"Change note type"]}),(0,e.jsxs)("div",{className:"flex",children:[d&&(0,e.jsx)(Hr.J,{className:"mr-2",shortcut:d}),(0,e.jsx)(xn.Z,{type:"chevron-right",className:"text-neutral"})]})]}),(0,e.jsx)(On.Z,{title:"Change note type",align:"start",anchorElement:c,className:"md:pb-1",open:s,side:"right",togglePopover:u,children:(0,e.jsx)(ou,{application:n,note:r,closeMenu:()=>{a(!1)}})})]})},au=t=>{let{action:n,note:r,application:i,group:o,reloadMenuGroup:s}=t;const[a,l]=(0,He.useState)(!1),c=(0,He.useCallback)((async()=>{a||(l(!0),await i.actions.runAction(n,r),l(!1),s(o).catch(console.error))}),[i,n,o,a,r,s]);return(0,e.jsx)("button",{onClick:c,className:"flex w-full cursor-pointer items-center border-0 bg-transparent px-3 py-2 text-left text-sm text-text hover:bg-contrast hover:text-foreground focus:bg-info-backdrop focus:shadow-none",children:(0,e.jsxs)("div",{className:"flex w-full flex-row items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)("div",{className:"font-semibold",children:n.label}),n.access_type&&(0,e.jsxs)("div",{className:"mt-0.5 text-xs text-passive-0",children:["Uses ",(0,e.jsx)("strong",{children:n.access_type})," access to this note."]})]}),a&&(0,e.jsx)(di.Z,{className:"h-3 w-3"})]})},n.url)},lu=t=>{let{application:n,note:r}=t;const[i,o]=(0,He.useState)([]),[s,a]=(0,He.useState)(!0),[l,c]=(0,He.useState)(!1);(0,He.useEffect)((()=>{(async()=>{n.listed.isNoteAuthorizedForListed(r)||await n.listed.authorizeNoteForListed(r),c(n.listed.isNoteAuthorizedForListed(r))})()}),[n,r]);const u=(0,He.useCallback)((async e=>{if(!l)return;const t=await n.listed.getListedAccountInfo(e.account,r.uuid);if(!t)return;const s={name:t.display_name,account:e.account,actions:t.actions},a=i.map((e=>s.account.authorId===e.account.authorId?s:e));o(a)}),[n,i,r,l]);return(0,He.useEffect)((()=>{(async()=>{if(n.hasAccount()){if(l)try{const e=await n.listed.getListedAccounts();if(!e.length)throw new Error("No Listed accounts found");const t=[];await Promise.all(e.map((async e=>{const i=await n.listed.getListedAccountInfo(e,r.uuid);i?t.push({name:i.display_name,account:e,actions:i.actions}):t.push({name:e.authorId,account:e,actions:[]})}))),o(t.sort(((e,t)=>e.name.toString().toLowerCase()<t.name.toString().toLowerCase()?-1:1)))}catch(e){console.error(e)}finally{a(!1)}}else a(!1)})()}),[n,r.uuid,l]),l?(0,e.jsxs)(e.Fragment,{children:[s&&(0,e.jsx)("div",{className:"flex w-full items-center justify-center p-4",children:(0,e.jsx)(di.Z,{className:"h-5 w-5"})}),!s&&i.length?(0,e.jsx)(e.Fragment,{children:i.map((t=>(0,e.jsx)(Jr.Z,{title:(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)(xn.Z,{type:"notes",className:"mr-2 text-info"})," ",t.name]}),children:t.actions.length?t.actions.map((i=>(0,e.jsx)(au,{action:i,note:r,group:t,application:n,reloadMenuGroup:u},i.url))):(0,e.jsx)("div",{className:"select-none px-3 py-2 text-sm text-passive-0",children:"No actions available"})},t.account.authorId)))}):null,s||i.length?null:(0,e.jsx)("div",{className:"flex w-full items-center justify-center px-4 py-6",children:(0,e.jsx)("div",{className:"select-none text-sm text-passive-0",children:"No Listed accounts found"})})]}):null},cu=t=>{let{application:n,note:r,iconClassName:i}=t;const o=(0,He.useRef)(null),s=(0,He.useRef)(null),[a,l]=(0,He.useState)(!1),c=(0,He.useCallback)((async()=>{n.listed.isNoteAuthorizedForListed(r)||await n.listed.authorizeNoteForListed(r),n.listed.isNoteAuthorizedForListed(r)&&l((e=>!e))}),[n,r]);return(0,e.jsxs)("div",{ref:o,children:[(0,e.jsxs)(ci.Z,{className:"justify-between",onClick:c,onKeyDown:e=>{e.key===L.u8.Escape&&l(!1)},ref:s,children:[(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)(xn.Z,{type:"listed",className:"mr-2 text-neutral ".concat(i)}),"Listed actions"]}),(0,e.jsx)(xn.Z,{type:"chevron-right",className:"text-neutral"})]}),(0,e.jsx)(On.Z,{title:"Listed",togglePopover:c,anchorElement:s,open:a,side:"right",align:"end",className:"px-4 md:px-0 md:pt-0",children:(0,e.jsx)(lu,{application:n,note:r})})]})};var uu=s(43426);const du=(0,Nn.Pi)((t=>{let{navigationController:n,linkingController:i,selectedItems:o,iconClassName:s,disabled:a}=t;const l=(0,sr.I)(),c=(0,He.useRef)(null),u=(0,He.useRef)(null),[d,h]=(0,He.useState)(!1),p=(0,He.useCallback)((()=>{h((e=>!e))}),[]),f=e=>o.every((t=>l.getItemTags(t).find((t=>t.uuid===e.uuid))));return(0,e.jsxs)("div",{ref:c,children:[(0,e.jsxs)(ci.Z,{className:"justify-between",onClick:p,onKeyDown:e=>{e.key===L.u8.Escape&&h(!1)},ref:u,disabled:a,children:[(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)(xn.Z,{type:"hashtag",className:s}),"Add tag"]}),(0,e.jsx)(xn.Z,{type:"chevron-right",className:"text-neutral"})]}),(0,e.jsx)(On.Z,{title:"Add tag",togglePopover:p,anchorElement:u,open:d,side:"right",align:"start",className:"py-2",overrideZIndex:"z-modal",children:(0,e.jsx)(qr.Z,{a11yLabel:"Tag selection menu",className:"!px-0",children:n.tags.map((t=>{var n;return(0,e.jsxs)(ci.Z,{onClick:()=>{f(t)?(e=>{o.forEach((t=>i.unlinkItems(t,e)))})(t):(e=>{o.forEach((t=>i.linkItems(t,e)))})(t)},children:[t.iconString&&(0,e.jsx)(xn.Z,{type:t.iconString,size:"custom",className:"ml-0.5 mr-1.5 h-7 w-7 text-2xl text-neutral lg:h-6 lg:w-6 lg:text-lg"}),(0,e.jsx)("span",{className:(0,r.classNames)("overflow-hidden overflow-ellipsis whitespace-nowrap",f(t)?"font-bold":""),children:null===(n=(0,uu.l)(t,l))||void 0===n?void 0:n.longTitle})]},t.uuid)}))})})]})}));var hu=s(57610),pu=s(35796),fu=s(32204),gu=s(1754);const mu=(e,t)=>t.noteType===r.NoteType.Super?e.getPreference(r.PrefKey.SuperNoteExportFormat,r.PrefDefaults[r.PrefKey.SuperNoteExportFormat]):e.componentManager.editorForNote(t).fileType,yu=(e,t)=>{const n=mu(e,t);return"".concat(t.title,".").concat(n)},vu=new Be,Au=async(e,t,n)=>{const i=mu(e,t);let o;switch(i){case"html":o="text/html";break;case"json":o="application/json";break;case"md":o="text/markdown";break;case"pdf":o="application/pdf";break;default:o="text/plain"}if(t.noteType===r.NoteType.Super){const s=await vu.convertSuperStringToOtherFormat(t.text,i,{embedBehavior:n,getFileItem:t=>e.items.findItem(t),getFileBase64:async t=>{const n=e.items.findItem(t);if(!n)return;const r=await e.filesController.getFileBlob(n);return r?await(0,gu.cN)(r):void 0},pdf:{pageSize:e.getPreference(r.PrefKey.SuperNoteExportPDFPageSize,r.PrefDefaults[r.PrefKey.SuperNoteExportPDFPageSize])}}),a="md"===i&&e.getPreference(r.PrefKey.SuperNoteExportUseMDFrontmatter,r.PrefDefaults[r.PrefKey.SuperNoteExportUseMDFrontmatter]),l="html"===i?((e,t)=>'<!DOCTYPE html>\n<html>\n  <head>\n    <meta charset="utf-8" />\n    <title>'.concat(e.title,"</title>\n    <style>\n").concat(pu.Z.toString(),"\n").concat(hu.Z.toString(),"\n").concat(fu.Z.toString(),'\n    </style>\n  </head>\n  <body style="--font-size: 1rem; --line-height: 1.5; font-size: var(--font-size); line-height: var(--line-height);">\n    ').concat(t,"\n  </body>\n</html>\n"))(t,s):a?((e,t)=>"---\ntitle: ".concat(e.title,"\ncreated_at: ").concat(e.created_at.toISOString(),"\nupdated_at: ").concat(e.serverUpdatedAt.toISOString(),"\nuuid: ").concat(e.uuid,"\n---\n\n").concat(t,"\n"))(t,s):s;return"pdf"===i?await fetch(l).then((e=>e.blob())):new Blob([l],{type:o})}return new Blob([t.text],{type:o})},bu=e=>e.text.includes('"type":"snfile"'),wu=(e,t,n)=>!!(e=>e.noteType===r.NoteType.Super)(e)&&"json"!==t&&"pdf"!==t&&"separate"===n&&bu(e),Su=async(e,t,n)=>{try{const r={},i=vu.getEmbeddedFileIDsFromSuperString(t.text);for(const t of i){const i=e.items.findItem(t);if(!i)continue;const o=await e.filesController.getFileBlob(i);if(!o)continue;r[i.title]=null==r[i.title]?0:r[i.title]+1;let s=i.title;if(r[i.title]>0){const{name:e,ext:t}=(0,Q.parseFileName)(i.title);s="".concat(e,"-").concat(i.uuid,".").concat(t)}n.addBlob((0,Q.parseAndCreateZippableFileName)(s),o)}}catch(e){console.error(e)}},Cu=async(e,t)=>{if(0===t.length)return;const n=e.getPreference(r.PrefKey.SuperNoteExportFormat,r.PrefDefaults[r.PrefKey.SuperNoteExportFormat]),i="pdf"===n?"inline":e.getPreference(r.PrefKey.SuperNoteExportEmbedBehavior,r.PrefDefaults[r.PrefKey.SuperNoteExportEmbedBehavior]);if(1===t.length&&!wu(t[0],n,i))return{blob:await Au(e,t[0],i),fileName:yu(e,t[0])};const o=new((await s.e(612).then(s.bind(s,75612))).fs.FS),{root:a}=o;if(1===t.length&&wu(t[0],n,i)){const n=await Au(e,t[0],i),r=(0,Q.parseAndCreateZippableFileName)(yu(e,t[0]));return a.addBlob(r,n),await Su(e,t[0],a),{blob:await o.exportBlob(),fileName:r+".zip"}}const l={};for(const r of t){const t=await Au(e,r,i),o=(0,Q.parseAndCreateZippableFileName)(yu(e,r));l[o]=null==l[o]?0:l[o]+1;const s=l[o],c=(0,Q.parseAndCreateZippableFileName)(o,s>0?" - ".concat(s):"");if(!wu(r,n,i)){a.addBlob(c,t);continue}const{name:u}=(0,Q.parseFileName)(c),d=a.addDirectory(u);d.addBlob(c,t),await Su(e,r,d)}return{blob:await o.exportBlob(),fileName:"Standard Notes Export - ".concat(e.archiveService.formattedDateForExports(),".zip")}},Eu=()=>(0,e.jsx)("div",{className:"text-center",children:"This item is protected. Please authorize first."});var Iu=s(97638);const _u=(e,t)=>{const{words:n,characters:r,paragraphs:i}=(0,He.useMemo)((()=>(e=>{try{return JSON.parse(e),{characters:"N/A",words:"N/A",paragraphs:"N/A"}}catch(t){const n=e.length,r=(e=>0===e.trim().length?0:e.split(/\s+/).length)(e),i=(e=>0===e.trim().length?0:e.replace(/\n$/gm,"").split(/\n/).length)(e);return{characters:n,words:r,paragraphs:i}}})(t.text)),[t.text]),o=(0,He.useMemo)((()=>"number"==typeof n?(e=>{const t=Math.round(e/200);return 0===t?"< 1 minute":"".concat(t," ").concat(t>1?"minutes":"minute")})(n):"N/A"),[n]),s=(0,He.useMemo)((()=>(0,je.Eu)(t.userModifiedDate)),[t.userModifiedDate]),a=(0,He.useMemo)((()=>(0,je.Eu)(t.serverUpdatedAt)),[t.serverUpdatedAt]),l=(0,He.useMemo)((()=>(0,je.Eu)(t.created_at)),[t.created_at]),c=(0,He.useMemo)((()=>new Blob([t.text]).size),[t.text]),u=e.componentManager.editorForNote(t).fileType;return{size:c,words:n,characters:r,paragraphs:i,readTime:o,userModifiedDate:s,serverUpdatedAt:a,dateCreated:l,format:u}},xu=t=>{let{application:n,note:i,className:o}=t;const{size:s,words:a,characters:l,paragraphs:c,readTime:u,userModifiedDate:d,dateCreated:h,format:p}=_u(n,i),f="number"==typeof a&&("txt"===p||"md"===p);return(0,e.jsxs)("div",{className:(0,r.classNames)("select-text px-3 py-1.5 text-sm font-medium text-neutral lg:text-xs",o),children:[f?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"mb-1",children:[a," words · ",l," characters · ",c," paragraphs"]}),(0,e.jsxs)("div",{className:"mb-1",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Read time:"})," ",u]})]}):null,(0,e.jsxs)("div",{className:"mb-1",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Last modified:"})," ",d]}),(0,e.jsxs)("div",{className:"mb-1",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Created:"})," ",h]}),(0,e.jsxs)("div",{className:"mb-1",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Note ID:"})," ",i.uuid]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("span",{className:"font-semibold",children:"Size:"})," ",(0,co.vU)(s)]})]})},Pu="text-neutral mr-2 ".concat(Iu.t),ku=t=>{let{editorForNote:n,notesController:r,note:i,disabled:o}=t;const s=n.featureDescription.spellcheckControl,a=!s||(i?r.getSpellcheckStateForNote(i):void 0);return(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsxs)(Dn.Z,{checked:Boolean(a),onChange:()=>{r.toggleGlobalSpellcheckForNote(i).catch(console.error)},disabled:o||!s,children:[(0,e.jsx)(xn.Z,{type:"notes",className:Pu}),"Spellcheck"]}),!s&&(0,e.jsx)("p",{className:"px-3 py-1.5 text-xs",children:"Spellcheck cannot be controlled for this editor."})]})},Bu=t=>{let{note:n}=t;return new Blob([n.text]).size>pt.Cp?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(oo.Z,{classes:"mt-2"}),(0,e.jsxs)("div",{className:"bg-warning-faded relative flex items-center px-3 py-3.5",children:[(0,e.jsx)(xn.Z,{type:"warning",className:"mr-3 flex-shrink-0 text-accessory-tint-3"}),(0,e.jsx)("div",{className:"leading-140% max-w-80% select-none text-warning",children:"This note may have trouble syncing to the mobile application due to its size."})]})]}):null},Ou=t=>{let{closeMenu:n}=t;const r=(0,Bn.o)(),i=(0,He.useMemo)((()=>r.keyboardShortcutForCommand(L.YN)),[r]),o=(0,He.useMemo)((()=>r.keyboardShortcutForCommand(L.Ix)),[r]),s=(0,He.useCallback)((()=>{r.triggerCommand(L.YN)}),[r]),a=(0,He.useCallback)((()=>{r.triggerCommand(L.Ix),n()}),[n,r]);return(0,e.jsxs)(Jr.Z,{children:[(0,e.jsxs)(ci.Z,{onClick:a,children:[(0,e.jsx)(xn.Z,{type:"search",className:Pu}),"Find in note",o&&(0,e.jsx)(Hr.J,{className:"ml-auto",shortcut:o})]}),(0,e.jsxs)(ci.Z,{onClick:s,children:[(0,e.jsx)(xn.Z,{type:"markdown",className:Pu}),"Show Markdown",i&&(0,e.jsx)(Hr.J,{className:"ml-auto",shortcut:i})]})]})},Nu=t=>{let{notes:n,exportNotes:i,close:o}=t;const s=(0,sr.I)(),a=(0,Er.Z)(r.PrefKey.SuperNoteExportFormat),l=(0,Er.Z)(r.PrefKey.SuperNoteExportEmbedBehavior),c=(0,Er.Z)(r.PrefKey.SuperNoteExportUseMDFrontmatter),u=(0,Er.Z)(r.PrefKey.SuperNoteExportPDFPageSize);(0,He.useEffect)((()=>{"json"===a&&"separate"===l&&s.setPreference(r.PrefKey.SuperNoteExportEmbedBehavior,"reference"),"md"===a&&"reference"===l&&s.setPreference(r.PrefKey.SuperNoteExportEmbedBehavior,"separate"),"pdf"===a&&"inline"!==l&&s.setPreference(r.PrefKey.SuperNoteExportEmbedBehavior,"inline")}),[s,l,a]);const d=n.some(bu),h=!["json","pdf"].includes(a);return(0,e.jsxs)(Gn,{title:"Export notes",className:"p-4",close:o,actions:[{label:"Cancel",type:"cancel",onClick:o,mobileSlot:"left"},{label:"Export",type:"primary",onClick:()=>{o(),i()},mobileSlot:"right"}],children:[(0,e.jsxs)("div",{className:"mb-2",children:[(0,e.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[(0,e.jsxs)("div",{className:"text-base",children:["Choose export format ",n.length>1?"for Super notes":""]}),(0,e.jsx)(wi.Z,{label:"Export format",items:[{label:"Super (.json)",value:"json"},{label:"Markdown (.md)",value:"md"},{label:"HTML",value:"html"},{label:"PDF",value:"pdf"}],value:a,onChange:e=>{s.setPreference(r.PrefKey.SuperNoteExportFormat,e)},classNameOverride:{wrapper:"w-full md:w-fit"}})]}),"md"===a&&(0,e.jsx)("div",{className:"mt-2 text-xs text-passive-0",children:"Note that conversion to Markdown is not lossless. Some features like collapsible blocks and formatting like superscript/subscript may not be correctly converted."})]}),"pdf"===a&&(0,e.jsxs)("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-2",children:[(0,e.jsx)("div",{className:"text-base",children:"Page size"}),(0,e.jsx)(wi.Z,{label:"Page size",items:[{label:"A3",value:"A3"},{label:"A4",value:"A4"},{label:"Letter",value:"LETTER"},{label:"Legal",value:"LEGAL"},{label:"Tabloid",value:"TABLOID"}],value:u,onChange:e=>{s.setPreference(r.PrefKey.SuperNoteExportPDFPageSize,e)},classNameOverride:{wrapper:"w-full md:w-fit"}})]}),"md"===a&&(0,e.jsx)("div",{className:"mt-4",children:(0,e.jsx)(po.Z,{checked:c,onChange:e=>{s.setPreference(r.PrefKey.SuperNoteExportUseMDFrontmatter,e)},className:"!flex items-center",children:(0,e.jsx)("span",{className:"ml-2",children:"Export with frontmatter"})})}),h&&d&&(0,e.jsxs)("div",{className:"mb-2 mt-4 flex flex-wrap items-center justify-between gap-2",children:[(0,e.jsx)("div",{className:"text-base",children:"Embedded files"}),(0,e.jsx)(wi.Z,{label:"Embedded files",items:[{label:"Inline",value:"inline"},{label:"Export separately",value:"separate"}].concat("md"!==a?[{label:"Keep as reference",value:"reference"}]:[]),value:l,onChange:e=>{s.setPreference(r.PrefKey.SuperNoteExportEmbedBehavior,e)}})]})]})},Du=(0,Nn.Pi)((t=>{let{items:n}=t;const i=(0,sr.I)(),o=i.vaults.getVaults(),s=(0,He.useCallback)((async e=>{if(!i.vaultLocks.isVaultLocked(e)||await i.vaultDisplayService.unlockVault(e))for(const t of n){const n=await i.vaults.moveItemToVault(e,t);n.isFailed()&&console.error(n.getError())}}),[i,n]),a=(0,He.useCallback)((async()=>{for(const e of n){const t=i.vaults.getItemVault(e);if(t){if(i.vaultLocks.isVaultLocked(t)&&!await i.vaultDisplayService.unlockVault(t))return;await i.vaults.removeItemFromVault(e)}}}),[i,n]),l=e=>n.every((t=>t.key_system_identifier===e.systemIdentifier)),c=n.some((e=>i.vaults.isItemInVault(e))),u=1===n.length?i.vaults.getItemVault(n[0]):void 0;return(0,e.jsxs)(qr.Z,{a11yLabel:"Vault selection menu",children:[c&&(0,e.jsxs)(ci.Z,{onClick:()=>{a()},children:[(0,e.jsx)(xn.Z,{type:"close",className:"mr-2 text-neutral"}),"Move out of ",u?u.name:"vaults"]}),!o.length&&(0,e.jsx)("div",{className:"flex flex-col items-center justify-center py-1",children:"No vaults found"}),o.map((t=>u?null:(0,e.jsxs)(ci.Z,{onClick:()=>{l(t)?a():s(t)},className:l(t)?"font-bold":"",disabled:t.isSharedVaultListing()&&i.vaultUsers.isCurrentUserReadonlyVaultMember(t),children:[(0,e.jsx)(xn.Z,{type:t.iconString,size:"custom",className:(0,r.classNames)("mr-2 h-6 w-6 text-neutral md:h-5 md:w-5",l(t)?"text-info":"")}),(0,e.jsxs)("div",{className:"flex w-full items-center",children:[t.name,i.vaultLocks.isVaultLocked(t)&&(0,e.jsx)(xn.Z,{className:"ml-1",type:"lock",size:"small"})]})]},t.uuid)))]})})),ju=(0,Nn.Pi)((t=>{let{iconClassName:n,items:r,disabled:i}=t;const o=(0,sr.I)(),s=(0,He.useRef)(null),[a,l]=(0,He.useState)(!1),c=(0,He.useCallback)((()=>{l((e=>!e))}),[]);return o.featuresController.isVaultsEnabled()?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(ci.Z,{className:"justify-between",onClick:c,onKeyDown:e=>{e.key===L.u8.Escape&&l(!1)},ref:s,disabled:i,children:[(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)(xn.Z,{type:"safe-square",className:n}),"Move to vault"]}),(0,e.jsx)(xn.Z,{type:"chevron-right",className:"text-neutral"})]}),(0,e.jsx)(On.Z,{title:"Move to vault",togglePopover:c,anchorElement:s,open:a,side:"right",align:"start",className:"py-2",overrideZIndex:"z-modal",children:(0,e.jsx)(Du,{items:r})})]}):null}));var Tu=s(54502);const Mu=Iu.t,Fu="text-danger mr-2 ".concat(Mu),Ru="text-warning mr-2 ".concat(Mu),Lu="text-success mr-2 ".concat(Mu),Qu=(0,Nn.Pi)((t=>{let{notes:n,closeMenu:i}=t;const o=(0,sr.I)(),[s,a]=(0,He.useState)(!1),{toggleAppPane:l}=(0,Zr.G)(),c=e=>{const t=n.filter(e),r=n.filter((t=>!e(t)));return t.length>r.length},u=c((e=>e.hidePreview)),d=c((e=>e.locked)),h=c((e=>e.protected)),p=n.some((e=>e.archived)),f=n.some((e=>!e.archived)),g=n.some((e=>e.trashed)),m=n.some((e=>!e.trashed)),y=n.some((e=>e.pinned)),v=n.some((e=>!e.pinned)),A=n.some((e=>e.starred)),b=(0,He.useMemo)((()=>n[0]?o.componentManager.editorForNote(n[0]):void 0),[o.componentManager,n]);(0,He.useEffect)((()=>{const e=o.keyboardService.addCommandHandler({command:L.Ur,onKeyDown:()=>{a(!0)},onKeyUp:()=>{a(!1)}});return()=>{e()}}),[o]);const[w,S]=(0,He.useState)(!1),C=(0,He.useCallback)((()=>{S(!1)}),[]),E=(0,He.useCallback)((async()=>{if(0===n.length)return;const e=(0,Y.fz)({type:Y.pC.Progress,message:"Exporting ".concat(n.length," ").concat((0,r.pluralize)(n.length,"note","notes"),"...")});try{const t=await Cu(o,n);if(!t)return;const{blob:r,fileName:i}=t;(0,so.c)({archiveService:o.archiveService,platform:o.platform,mobileDevice:o.mobileDevice,blob:r,filename:i,isNativeMobileWeb:o.isNativeMobileWeb()}),(0,Y.Xd)(e)}catch(t){console.error(t),(0,Y.fz)({type:Y.pC.Error,message:"Could not export notes"}),(0,Y.Xd)(e)}}),[o,n]),I=(0,He.useCallback)((()=>{n.some((e=>e.noteType===r.NoteType.Super))?S(!0):E().catch(console.error)}),[E,n]),_=(0,He.useCallback)((()=>{Cu(o,n).then((e=>{if(!e)return;const{blob:t,fileName:n}=e;(0,Tu.t)(o.mobileDevice,o.isNativeMobileWeb(),t,n).catch(console.error)})).catch(console.error)}),[o,n]),x=(0,He.useCallback)((()=>{matchMedia(et.Jj.sm).matches&&l($e.n.Items),i()}),[i,l]),P=(0,He.useCallback)((async()=>{await Promise.all(n.map((e=>o.mutator.duplicateItem(e).then((e=>(0,Y.fz)({type:Y.pC.Regular,message:'Duplicated note "'.concat(e.title,'"'),actions:[{label:"Open",handler:t=>{o.itemListController.selectUuids([e.uuid],!0).catch(console.error),(0,Y.Xd)(t)}}],autoClose:!0}))).catch(console.error)))),o.sync.sync(),x()}),[o.mutator,o.itemListController,o.sync,x,n]),k=(0,He.useCallback)((()=>{o.historyModalController.openModal(o.notesController.firstSelectedNote)}),[o.historyModalController,o.notesController.firstSelectedNote]),B=(0,He.useMemo)((()=>o.keyboardService.keyboardShortcutForCommand(L.Ek)),[o]),O=(0,He.useMemo)((()=>o.keyboardService.keyboardShortcutForCommand(L.Ib)),[o]),N=(0,He.useMemo)((()=>o.keyboardService.keyboardShortcutForCommand(L.Ak)),[o]),D=(0,He.useCallback)((()=>{o.keyboardService.triggerCommand(L.Wu)}),[o.keyboardService]),j=(0,He.useMemo)((()=>o.keyboardService.keyboardShortcutForCommand(L.Wu)),[o]);if(n.some((e=>!o.isAuthorizedToRenderItem(e))))return(0,e.jsx)(Eu,{});const T=n.some((e=>{var t;return null===(t=o.vaults.getItemVault(e))||void 0===t?void 0:t.isSharedVaultListing()})),M=n.some((e=>{const t=o.vaults.getItemVault(e);return(null==t?void 0:t.isSharedVaultListing())&&o.vaultUsers.isCurrentUserReadonlyVaultMember(t)})),F=n.every((e=>{const t=o.vaults.getItemVault(e);return!(null==t?void 0:t.isSharedVaultListing())||o.vaultUsers.isCurrentUserSharedVaultAdmin(t)}));return 0===n.length?null:(0,e.jsxs)(e.Fragment,{children:[1===n.length&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Jr.Z,{children:(0,e.jsxs)(ci.Z,{onClick:k,children:[(0,e.jsx)(xn.Z,{type:"history",className:Pu}),"Note history",B&&(0,e.jsx)(Hr.J,{className:"ml-auto",shortcut:B})]})}),(0,e.jsx)(Jr.Z,{children:(0,e.jsxs)(ci.Z,{onClick:D,disabled:M,children:[(0,e.jsx)(xn.Z,{type:"line-width",className:Pu}),"Editor width",j&&(0,e.jsx)(Hr.J,{className:"ml-auto",shortcut:j})]})})]}),(0,e.jsxs)(Jr.Z,{children:[(0,e.jsxs)(Dn.Z,{checked:d,onChange:e=>{o.notesController.setLockSelectedNotes(e)},disabled:M,children:[(0,e.jsx)(xn.Z,{type:"pencil-off",className:Pu}),"Prevent editing"]}),(0,e.jsxs)(Dn.Z,{checked:!u,onChange:e=>{o.notesController.setHideSelectedNotePreviews(!e)},disabled:M,children:[(0,e.jsx)(xn.Z,{type:"rich-text",className:Pu}),"Show preview"]}),(0,e.jsxs)(Dn.Z,{checked:h,onChange:e=>{o.notesController.setProtectSelectedNotes(e).catch(console.error)},disabled:M,children:[(0,e.jsx)(xn.Z,{type:"lock",className:Pu}),"Password protect"]})]}),1===n.length&&(0,e.jsx)(Jr.Z,{children:(0,e.jsx)(su,{iconClassName:Pu,application:o,note:n[0],disabled:M})}),(0,e.jsxs)(Jr.Z,{className:n.length>1?"md:!mb-2":"",children:[o.featuresController.isVaultsEnabled()&&(0,e.jsx)(ju,{iconClassName:Pu,items:n,disabled:!F}),o.navigationController.tagsCount>0&&(0,e.jsx)(du,{iconClassName:Pu,navigationController:o.navigationController,selectedItems:n,linkingController:o.linkingController,disabled:M}),(0,e.jsxs)(ci.Z,{onClick:()=>{o.notesController.setStarSelectedNotes(!A)},disabled:M,children:[(0,e.jsx)(xn.Z,{type:"star",className:Pu}),A?"Unstar":"Star",N&&(0,e.jsx)(Hr.J,{className:"ml-auto",shortcut:N})]}),v&&(0,e.jsxs)(ci.Z,{onClick:()=>{o.notesController.setPinSelectedNotes(!0)},disabled:M,children:[(0,e.jsx)(xn.Z,{type:"pin",className:Pu}),"Pin to top",O&&(0,e.jsx)(Hr.J,{className:"ml-auto",shortcut:O})]}),y&&(0,e.jsxs)(ci.Z,{onClick:()=>{o.notesController.setPinSelectedNotes(!1)},disabled:M,children:[(0,e.jsx)(xn.Z,{type:"unpin",className:Pu}),"Unpin",O&&(0,e.jsx)(Hr.J,{className:"ml-auto",shortcut:O})]}),(0,e.jsxs)(ci.Z,{onClick:I,children:[(0,e.jsx)(xn.Z,{type:"download",className:Pu}),"Export"]}),o.platform===r.Platform.Android&&(0,e.jsxs)(ci.Z,{onClick:_,children:[(0,e.jsx)(xn.Z,{type:"share",className:Pu}),"Share"]}),(0,e.jsxs)(ci.Z,{onClick:P,disabled:M,children:[(0,e.jsx)(xn.Z,{type:"copy",className:Pu}),"Duplicate"]}),f&&(0,e.jsxs)(ci.Z,{onClick:async()=>{await o.notesController.setArchiveSelectedNotes(!0).catch(console.error),x()},disabled:M,children:[(0,e.jsx)(xn.Z,{type:"archive",className:Ru}),(0,e.jsx)("span",{className:"text-warning",children:"Archive"})]}),p&&(0,e.jsxs)(ci.Z,{onClick:async()=>{await o.notesController.setArchiveSelectedNotes(!1).catch(console.error),x()},disabled:M,children:[(0,e.jsx)(xn.Z,{type:"unarchive",className:Ru}),(0,e.jsx)("span",{className:"text-warning",children:"Unarchive"})]}),m&&(s?(0,e.jsxs)(ci.Z,{disabled:M,onClick:async()=>{await o.notesController.deleteNotesPermanently(),x()},children:[(0,e.jsx)(xn.Z,{type:"close",className:"mr-2 text-danger"}),(0,e.jsx)("span",{className:"text-danger",children:"Delete permanently"})]}):(0,e.jsxs)(ci.Z,{onClick:async()=>{await o.notesController.setTrashSelectedNotes(!0),x()},disabled:M,children:[(0,e.jsx)(xn.Z,{type:"trash",className:Fu}),(0,e.jsx)("span",{className:"text-danger",children:"Move to trash"})]})),g&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(ci.Z,{onClick:async()=>{await o.notesController.setTrashSelectedNotes(!1),x()},disabled:M,children:[(0,e.jsx)(xn.Z,{type:"restore",className:Lu}),(0,e.jsx)("span",{className:"text-success",children:"Restore"})]}),(0,e.jsxs)(ci.Z,{disabled:M,onClick:async()=>{await o.notesController.deleteNotesPermanently(),x()},children:[(0,e.jsx)(xn.Z,{type:"close",className:"mr-2 text-danger"}),(0,e.jsx)("span",{className:"text-danger",children:"Delete permanently"})]}),(0,e.jsx)(ci.Z,{onClick:async()=>{await o.notesController.emptyTrash(),x()},disabled:M,children:(0,e.jsxs)("div",{className:"flex items-start",children:[(0,e.jsx)(xn.Z,{type:"trash-sweep",className:"mr-2 text-danger"}),(0,e.jsxs)("div",{className:"flex-row",children:[(0,e.jsx)("div",{className:"text-danger",children:"Empty Trash"}),(0,e.jsxs)("div",{className:"text-xs",children:[o.notesController.trashedNotesCount," notes in Trash"]})]})]})})]})]}),1===n.length&&(0,e.jsxs)(e.Fragment,{children:[n[0].noteType===r.NoteType.Super&&(0,e.jsx)(Ou,{closeMenu:i}),!T&&(0,e.jsx)(Jr.Z,{children:(0,e.jsx)(cu,{iconClassName:Pu,application:o,note:n[0]})}),b&&(0,e.jsx)(Jr.Z,{children:(0,e.jsx)(ku,{editorForNote:b,notesController:o.notesController,note:n[0],disabled:M})}),(0,e.jsx)(xu,{className:"mb-2",application:o,note:n[0]}),(0,e.jsx)(Bu,{note:n[0]})]}),(0,e.jsx)(Fr,{isOpen:w,close:C,className:"md:max-w-[25vw]",children:(0,e.jsx)(Nu,{notes:n,exportNotes:E,close:C})})]})})),Uu=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),{contextMenuOpen:n,contextMenuClickLocation:r,setContextMenuOpen:i}=t.notesController,o=()=>i(!n),[s,a]=(0,He.useState)(!1),l=(0,He.useCallback)((e=>{a(e)}),[]);return(0,e.jsx)(On.Z,{title:"Note options",align:"start",anchorPoint:{x:r.x,y:r.y},disableClickOutside:s,open:n,togglePopover:o,children:(0,e.jsx)(qr.Z,{className:"select-none",a11yLabel:"Note context menu",children:(0,e.jsx)(Qu,{notes:t.notesController.selectedNotes,requestDisableClickOutside:l,closeMenu:o})})})})),Vu=(0,He.forwardRef)(((t,n)=>{let{id:r,type:i,label:o,disabled:s,value:a,isInvalid:l,onChange:c,className:u="",labelClassName:d="",inputClassName:h=""}=t;const[p,f]=(0,He.useState)(!1),g="absolute ".concat(p?"text-info":"text-neutral"," ").concat(p||a?"flex top-0 left-2 pt-1.5 px-1":"hidden"," ").concat(l?"text-danger":""," ").concat(d),m="w-full h-full ".concat(p||a?"pt-6 pb-2":"py-2.5"," px-3 text-sm border border-solid border-border rounded placeholder:font-medium focus:ring-info ").concat(l?"border-danger placeholder:text-danger":""," ").concat(h);return(0,e.jsxs)("div",{className:"".concat("relative bg-default"," ").concat(u),children:[(0,e.jsx)("label",{htmlFor:r,className:g,children:o}),(0,e.jsx)("input",{id:r,className:m,placeholder:p?"":o,type:i,value:a,onChange:c,onFocus:()=>f(!0),onBlur:()=>f(!1),ref:n,disabled:s})]})})),Ku=Vu;var Hu=s(66724);const Gu=(0,Nn.Pi)((n=>{let{application:i}=n;const{setCurrentPane:o}=i.purchaseFlowController,[s,a]=(0,He.useState)(""),[l,c]=(0,He.useState)(""),[u,d]=(0,He.useState)(""),[h,p]=(0,He.useState)(!1),[f,g]=(0,He.useState)(!1),[m,y]=(0,He.useState)(!1),[v,A]=(0,He.useState)(""),[b,w]=(0,He.useState)(""),S=(0,He.useCallback)((()=>{p(!0),i.register(s,l,v).then((()=>{i.accountMenuController.closeAccountMenu(),i.accountMenuController.setCurrentPane(qt.V.GeneralMenu)})).catch((e=>{console.error(e),i.alerts.alert(e).catch(console.error)})).finally((()=>{p(!1)}))}),[i,s,v,l]),C=(0,Hu.m)(b,(e=>{A(e),w("")}));(0,He.useEffect)((()=>{v&&S()}),[v,S]);const E=(0,He.useCallback)((()=>{i.getCaptchaUrl().then((e=>{if((0,r.isErrorResponse)(e))throw new Error;const{captchaUIUrl:t}=e.data;t?w(t):(w(""),S())})).catch((e=>{console.error(e),w(""),S()}))}),[i,S]),I=(0,He.useRef)(null),_=(0,He.useRef)(null),x=(0,He.useRef)(null);(0,He.useEffect)((()=>{var e;I.current&&(null===(e=I.current)||void 0===e||e.focus())}),[]);const P=async()=>{var e,n,r,i,o;if(s){if(!(0,t.Ju)(s))return g(!0),void(null===(n=null==I?void 0:I.current)||void 0===n||n.focus());if(l){if(u)return l!==u?(d(""),y(!0),void(null===(o=null==x?void 0:x.current)||void 0===o||o.focus())):void E();null===(i=null==x?void 0:x.current)||void 0===i||i.focus()}else null===(r=null==_?void 0:_.current)||void 0===r||r.focus()}else null===(e=null==I?void 0:I.current)||void 0===e||e.focus()},k=(0,e.jsx)("form",{onSubmit:P,children:(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)(Ku,{className:"min-w-auto md:min-w-90 ".concat(f?"mb-2":"mb-4"),id:"purchase-sign-in-email",type:"email",label:"Email",value:s,onChange:e=>{a(e.target.value),g(!1)},ref:I,disabled:h,isInvalid:f}),f?(0,e.jsx)("div",{className:"mb-4 text-danger",children:"Please provide a valid email."}):null,(0,e.jsx)(Ku,{className:"min-w-auto mb-4 md:min-w-90",id:"purchase-create-account-password",type:"password",label:"Password",value:l,onChange:e=>{c(e.target.value)},ref:_,disabled:h}),(0,e.jsx)(Ku,{className:"min-w-auto md:min-w-90 ".concat(m?"mb-2":"mb-4"),id:"create-account-confirm",type:"password",label:"Repeat password",value:u,onChange:e=>{d(e.target.value),y(!1)},ref:x,disabled:h,isInvalid:m}),m?(0,e.jsx)("div",{className:"mb-4 text-danger",children:"Passwords don't match. Please try again."}):null]})});return(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)(Po.CircleIcon,{className:"absolute -left-28 top-[40%] h-8 w-8"}),(0,e.jsx)(Po.BlueDotIcon,{className:"absolute -left-10 top-[35%] h-4 w-4"}),(0,e.jsx)(Po.DiamondIcon,{className:"absolute -bottom-5 left-0 -z-[1] h-26 w-26 -translate-x-1/2"}),(0,e.jsx)(Po.CircleIcon,{className:"absolute -right-20 bottom-[35%] h-8 w-8"}),(0,e.jsx)(Po.BlueDotIcon,{className:"absolute -right-10 bottom-[25%] h-4 w-4"}),(0,e.jsx)(Po.DiamondIcon,{className:"absolute -right-2 top-0 -z-[1] h-18 w-18 translate-x-1/2"}),(0,e.jsxs)("div",{className:"mr-0 lg:mr-12",children:[(0,e.jsx)("h1",{className:"mb-2 mt-0 text-2xl font-bold",children:"Create your free account"}),(0,e.jsx)("div",{className:"mb-4 text-sm font-medium",children:"to continue to Standard Notes."}),b?C:k,(0,e.jsxs)("div",{className:"flex flex-col-reverse items-start justify-between md:flex-row md:items-center",children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)("button",{onClick:()=>{o(Wt.SignIn)},disabled:h,className:"mb-2 flex cursor-pointer items-start border-0 bg-default p-0 font-medium text-info hover:underline",children:"Sign in instead"}),!i.isNativeIOS()&&(0,e.jsx)("button",{onClick:()=>{i.purchaseFlowController.openPurchaseWebpage()},disabled:h,className:"flex cursor-pointer items-start border-0 bg-default p-0 font-medium text-info hover:underline",children:"Subscribe without account"})]}),(0,e.jsx)(Ln.Z,{className:"mb-4 py-2.5 md:mb-0",primary:!0,label:h?"Creating account...":"Create account",onClick:P,disabled:h})]})]}),(0,e.jsx)(Po.CreateAccountIllustration,{className:"hidden lg:block"})]})})),Yu=(0,Nn.Pi)((n=>{let{application:i}=n;const{setCurrentPane:o}=i.purchaseFlowController,[s,a]=(0,He.useState)(""),[l,c]=(0,He.useState)(""),[u,d]=(0,He.useState)(!1),[h,p]=(0,He.useState)(!1),[f,g]=(0,He.useState)(!1),[m,y]=(0,He.useState)(""),[v,A]=(0,He.useState)(""),[b,w]=(0,He.useState)(!1),[S,C]=(0,He.useState)(""),E=(0,Hu.m)(v,(e=>{C(e),w(!1),A("")})),I=(0,He.useRef)(null),_=(0,He.useRef)(null);(0,He.useEffect)((()=>{var e;I.current&&(null===(e=I.current)||void 0===e||e.focus())}),[]);const x=async()=>{var e,n,o,a;if(s){if(!(0,t.Ju)(s))return p(!0),void(null===(n=null==I?void 0:I.current)||void 0===n||n.focus());if(l)if(v)w(!0);else{d(!0);try{const e=await i.signIn(s,l,void 0,void 0,void 0,void 0,S),t=(0,r.getCaptchaHeader)(e);if(t)return void A(t);if(A(""),(0,r.isErrorResponse)(e))throw new Error(null===(a=e.data.error)||void 0===a?void 0:a.message);i.purchaseFlowController.closePurchaseFlow(),i.purchaseFlowController.openPurchaseFlow()}catch(e){console.error(e),e.toString().includes("Invalid email or password")?(p(!0),g(!0),y("Invalid email or password."),c("")):i.alerts.alert(e).catch(console.error)}finally{d(!1)}}else null===(o=null==_?void 0:_.current)||void 0===o||o.focus()}else null===(e=null==I?void 0:I.current)||void 0===e||e.focus()},P=(0,e.jsxs)("form",{onSubmit:x,children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)(Ku,{className:"min-w-auto sm:min-w-90 ".concat(h&&!m?"mb-2":"mb-4"),id:"purchase-sign-in-email",type:"email",label:"Email",value:s,onChange:e=>{a(e.target.value),p(!1)},ref:I,disabled:u,isInvalid:h}),h&&!m?(0,e.jsx)("div",{className:"mb-4 text-danger",children:"Please provide a valid email."}):null,(0,e.jsx)(Ku,{className:"min-w-auto sm:min-w-90 ".concat(m?"mb-2":"mb-4"),id:"purchase-sign-in-password",type:"password",label:"Password",value:l,onChange:e=>{c(e.target.value),g(!1),y("")},ref:_,disabled:u,isInvalid:f}),m?(0,e.jsx)("div",{className:"mb-4 text-danger",children:m}):null]}),(0,e.jsx)(Ln.Z,{className:"".concat(u?"min-w-30":"min-w-24"," mb-5 py-2.5"),primary:!0,label:u?"Signing in...":"Sign in",onClick:x,disabled:u})]});return(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)(Po.CircleIcon,{className:"absolute -left-56 top-[35%] h-8 w-8"}),(0,e.jsx)(Po.BlueDotIcon,{className:"absolute -left-40 top-[30%] h-4 w-4"}),(0,e.jsx)(Po.DiamondIcon,{className:"absolute -bottom-5 left-0 -z-[1] h-26 w-26 -translate-x-1/2"}),(0,e.jsx)(Po.CircleIcon,{className:"absolute -right-56 bottom-[30%] h-8 w-8"}),(0,e.jsx)(Po.BlueDotIcon,{className:"absolute -right-44 bottom-[20%] h-4 w-4"}),(0,e.jsx)(Po.DiamondIcon,{className:"absolute -right-2 top-0 -z-[1] h-18 w-18 translate-x-1/2"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h1",{className:"mb-2 mt-0 text-2xl font-bold",children:"Sign in"}),(0,e.jsx)("div",{className:"mb-4 text-sm font-medium",children:"to continue to Standard Notes."}),b?E:P,(0,e.jsxs)("div",{className:"text-sm font-medium text-passive-1",children:["Don’t have an account yet?"," ",(0,e.jsx)("a",{className:"text-info ".concat(u?"cursor-not-allowed":"cursor-pointer "),onClick:()=>{u||o(Wt.CreateAccount)},children:"Create account"})]})]})]})})),zu=t=>{let{currentPane:n,application:r}=t;switch(n){case Wt.CreateAccount:return(0,e.jsx)(Gu,{application:r});case Wt.SignIn:return(0,e.jsx)(Yu,{application:r})}},Zu=(0,Nn.Pi)((t=>{let{application:n}=t;const{currentPane:r}=n.purchaseFlowController;return(0,e.jsx)("div",{className:"absolute left-0 top-0 z-purchase-flow flex h-full w-full items-center justify-center overflow-hidden bg-passive-super-light",children:(0,e.jsxs)("div",{className:"relative w-fit",children:[(0,e.jsxs)("div",{className:"rounded-0 relative mb-4 w-full border border-solid border-border bg-default px-8 py-8 md:rounded md:p-12",children:[(0,e.jsx)("button",{className:"absolute right-4 top-4 rounded-full p-1 hover:bg-info-backdrop",onClick:()=>{n.purchaseFlowController.closePurchaseFlow()},children:(0,e.jsx)(xn.Z,{type:"close",className:"text-neutral"})}),(0,e.jsx)(Po.SNLogoFull,{className:"mb-5 h-7"}),(0,e.jsx)(zu,{currentPane:r,application:n})]}),(0,e.jsxs)("div",{className:"flex justify-end px-4 md:px-0",children:[(0,e.jsx)("a",{className:"mr-3 font-medium text-passive-1",href:"https://standardnotes.com/privacy",target:"_blank",rel:"noopener noreferrer",children:"Privacy"}),(0,e.jsx)("a",{className:"font-medium text-passive-1",href:"https://standardnotes.com/help",target:"_blank",rel:"noopener noreferrer",children:"Help"})]})]})})})),Wu=(0,Nn.Pi)((t=>{let{application:n}=t;return n.purchaseFlowController.isOpen?(0,e.jsx)(Zu,{application:n}):null}));var qu=s(91611);const Ju=t=>{let{children:n,isSelected:r,onClick:i}=t;return(0,e.jsxs)("button",{tabIndex:pt.HF,className:"flex w-full cursor-pointer items-center border-0 bg-transparent px-3 py-2.5 text-left text-sm text-text hover:bg-contrast hover:text-foreground focus:bg-info-backdrop focus:shadow-none ".concat(r?"bg-info-backdrop":""),onClick:i,"data-selected":r,children:[(0,e.jsx)(Re.Z,{checked:r,className:"mr-2"}),n]})},Xu=t=>{let{legacyHistory:n,noteHistoryController:r,onSelectRevision:i}=t;const{selectLegacyRevision:o,selectedEntry:s}=r,[a,l]=(0,He.useState)(null);return(0,qu.Z)(a),(0,e.jsxs)("div",{className:"flex h-full w-full flex-col focus:shadow-none ".concat((null==n?void 0:n.length)?"":"items-center justify-center"),ref:l,children:[null==n?void 0:n.map((t=>{var n,r;const a=null===(n=null==s?void 0:s.subactions)||void 0===n?void 0:n[0].url,l=null===(r=t.subactions)||void 0===r?void 0:r[0].url;return(0,e.jsx)(Ju,{isSelected:a===l,onClick:()=>{o(t),i()},children:t.label},l)})),!(null==n?void 0:n.length)&&(0,e.jsx)("div",{className:"select-none text-sm text-passive-0",children:"No legacy history found"})]})},$u=e=>e.toLocaleDateString(void 0,{month:"long",year:"numeric"}),ed="Today",td="This Week",nd="More Than A Year Ago",rd=e=>{const t=[{title:ed,entries:[]},{title:td,entries:[]},{title:nd,entries:[]}];return null==e||e.forEach((e=>{var n,r,i;const o=((e,t)=>{var n;const r=new Date,i=new Date(null!==(n=e.created_at)&&void 0!==n?n:e.payload.updated_at),o=((e,t)=>{const n=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),r=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate());return Math.round((n-r)/pt.jD)})(r,i);if(0===o)return t.findIndex((e=>e.title===ed));if(o>0&&o<pt.Yx)return t.findIndex((e=>e.title===td));if(o>pt.gu)return t.findIndex((e=>e.title===nd));const s=$u(i);return t.findIndex((e=>e.title===s))})(e,t);var s;o>-1?null===(r=null===(n=t[o])||void 0===n?void 0:n.entries)||void 0===r||r.push(e):(s={title:$u(new Date(null!==(i=e.created_at)&&void 0!==i?i:e.payload.updated_at)),entries:[e]},t.splice(t.length-1,0,s))})),t},id=(0,Nn.Pi)((t=>{let{features:n,noteHistoryController:r,onSelectRevision:i}=t;const{remoteHistory:o,isFetchingRemoteHistory:s,selectRemoteRevision:a,selectedEntry:l}=r,[c,u]=(0,He.useState)(null);(0,qu.Z)(c);const d=(0,He.useMemo)((()=>null==o?void 0:o.map((e=>e.entries)).flat().length),[o]);return(0,e.jsxs)("div",{className:"flex h-full w-full flex-col focus:shadow-none ".concat(s||!d?"items-center justify-center":""),ref:u,children:[s&&(0,e.jsx)(di.Z,{className:"h-5 w-5"}),null==o?void 0:o.map((t=>t.entries&&t.entries.length?(0,e.jsxs)(He.Fragment,{children:[(0,e.jsx)("div",{className:"mb-1 mt-2.5 select-none px-3 text-sm font-semibold uppercase text-passive-0",children:t.title}),t.entries.map((t=>{return(0,e.jsx)(Ju,{isSelected:(null==l?void 0:l.uuid)===t.uuid,onClick:()=>{a(t),i()},children:(0,e.jsxs)("div",{className:"flex flex-grow items-center justify-between",children:[(0,e.jsx)("div",{children:(r=t,new Date(r.created_at).toLocaleString())}),!n.hasMinimumRole(t.required_role)&&(0,e.jsx)(xn.Z,{type:Mn._,className:Mn.K})]})},t.uuid);var r}))]},t.title):null)),!d&&!s&&(0,e.jsx)("div",{className:"select-none text-sm text-passive-0",children:"No remote history found"})]})}));var od;!function(e){e.Session="Session",e.Remote="Remote",e.Legacy="Legacy"}(od||(od={}));const sd=(0,Nn.Pi)((t=>{let{noteHistoryController:n,onSelectRevision:r}=t;const{sessionHistory:i,selectedRevision:o,selectSessionRevision:s}=n,[a,l]=(0,He.useState)(null);(0,qu.Z)(a);const c=(0,He.useMemo)((()=>null==i?void 0:i.map((e=>e.entries)).flat().length),[i]);return(0,e.jsxs)("div",{className:"flex h-full w-full flex-col focus:shadow-none ".concat(c?"":"items-center justify-center"),ref:l,children:[null==i?void 0:i.map((t=>t.entries&&t.entries.length?(0,e.jsxs)(He.Fragment,{children:[(0,e.jsx)("div",{className:"mb-1 mt-2.5 select-none px-3 text-sm font-semibold uppercase text-passive-0",children:t.title}),t.entries.map(((t,n)=>(0,e.jsx)(Ju,{isSelected:(null==o?void 0:o.payload.updated_at)===t.payload.updated_at,onClick:()=>{s(t),r()},children:t.previewTitle()},n)))]},t.title):null)),!c&&(0,e.jsx)("div",{className:"select-none text-sm text-passive-0",children:"No session history found"})]})})),ad=(0,Nn.Pi)((t=>{let{features:n,noteHistoryController:r,selectMobileModalTab:i}=t;const{legacyHistory:o,currentTab:s,selectTab:a}=r,l=t=>{let{type:n}=t;const r=s===n;return(0,e.jsx)("button",{className:"relative cursor-pointer border-0 bg-default px-3 py-2.5 text-sm focus:shadow-inner ".concat(r?"font-medium text-info shadow-bottom":"text-text"),onClick:()=>{a(n)},children:n})},c=(0,He.useCallback)((()=>{i("Content")}),[i]);return(0,e.jsxs)("div",{className:"flex h-full flex-grow flex-col overflow-auto border-r border-solid border-border",children:[(0,e.jsxs)("div",{className:"flex border-b border-solid border-border",children:[(0,e.jsx)(l,{type:od.Remote}),(0,e.jsx)(l,{type:od.Session}),o&&o.length>0&&(0,e.jsx)(l,{type:od.Legacy})]}),(0,e.jsx)("div",{className:"h-full min-h-0 overflow-auto py-1.5",children:(0,e.jsx)((()=>{switch(s){case od.Remote:return(0,e.jsx)(id,{onSelectRevision:c,features:n,noteHistoryController:r});case od.Session:return(0,e.jsx)(sd,{onSelectRevision:c,noteHistoryController:r});case od.Legacy:return(0,e.jsx)(Xu,{onSelectRevision:c,legacyHistory:o,noteHistoryController:r})}}),{})})]})})),ld=(0,Nn.Pi)((t=>{let{dismissModal:n,noteHistoryController:r,readonly:i=!1}=t;const{selectedRevision:o,restoreRevision:s,restoreRevisionAsCopy:a,selectedEntry:l,deleteRemoteRevision:c}=r,[u,d]=(0,He.useState)(!1),h=(0,He.useCallback)((()=>{o&&(s(o),n())}),[n,s,o]),p=(0,He.useCallback)((async()=>{o&&(a(o),n())}),[n,a,o]),f=(0,He.useCallback)((async()=>{l&&(d(!0),await c(l),d(!1))}),[c,l]);return(0,e.jsxs)("div",{className:"flex min-h-6 flex-shrink-0 flex-wrap items-center gap-2.5 border-t border-solid border-border px-2.5 py-2 md:justify-between",children:[(0,e.jsx)(Ln.Z,{className:"py-1.35",label:"Close",onClick:n}),o&&l&&!i&&(0,e.jsxs)(e.Fragment,{children:[l.uuid&&(0,e.jsx)(Ln.Z,{className:"md:ml-auto",onClick:f,children:u?(0,e.jsx)(di.Z,{className:"my-1 h-3 w-3"}):"Delete this revision"}),(0,e.jsx)(Ln.Z,{className:l.uuid?"":"md:ml-auto",label:"Restore as a copy",onClick:p}),(0,e.jsx)(Ln.Z,{className:"",label:"Restore version",onClick:h,primary:!0})]})]})})),cd=e=>"Version history is limited to ".concat((e=>{switch(e){case"Core":return"30 days";case"Plus":return"365 days";default:return"the current session's changes"}})(e)," in the ").concat(e," plan"),ud=(0,Nn.Pi)((()=>{const t=(0,sr.I)();let n="free";return t.subscriptions.hasOnlineSubscription()&&(t.subscriptions.isUserSubscriptionCanceled||t.subscriptions.isUserSubscriptionExpired||(n=t.subscriptions.userSubscriptionName)),(0,e.jsx)("div",{className:"flex h-full w-full items-center justify-center",children:(0,e.jsxs)("div",{className:"max-w-40% flex flex-col items-center px-8 text-center",children:[(0,e.jsx)(Po.HistoryLockedIllustration,{}),(0,e.jsx)("div",{className:"mb-1 mt-2 text-lg font-bold",children:"Can't access this version"}),(0,e.jsxs)("div",{className:"leading-140% mb-4 text-passive-0",children:[cd(n),". Learn more about our other plans to upgrade your history capacity."]}),(0,e.jsx)(Ln.Z,{primary:!0,label:"Discover plans",onClick:()=>{window.plansUrl&&window.location.assign(window.plansUrl)}})]})})}));var dd;!function(e){e[e.Idle=0]="Idle",e[e.Loading=1]="Loading",e[e.Loaded=2]="Loaded",e[e.NotEntitled=3]="NotEntitled"}(dd||(dd={}));var hd=s(66743);const pd=n=>{let{note:i,content:o,showLinkedItems:s=!0,scrollPos:a,shouldSyncScroll:l,onScroll:c}=n;const u=(0,sr.I)(),d=(0,xc.o)(),h=(0,et.ac)(et.Jj.sm),p=(0,He.useMemo)((()=>{const e=u.componentManager.editorForNote(i);if(!(0,r.isUIFeatureAnIframeFeature)(e))return;const t=u.items.createTemplateItem(r.ContentType.TYPES.Note,o);return u.componentManager.createComponentViewer(e,{readonlyItem:t})}),[u.componentManager,u.items,o,i]);(0,He.useEffect)((()=>()=>{p&&u.componentManager.destroyComponentViewer(p)}),[u,p]);const f=(0,He.useRef)(null),g=(0,He.useRef)(),m=(0,He.useCallback)((()=>{var e;if(!g.current&&(g.current=null===(e=f.current)||void 0===e?void 0:e.querySelector("textarea, .ContentEditable__root"),g.current&&!(g.current.scrollHeight>g.current.clientHeight))){const e=(0,t.rP)(g.current);e&&(g.current=e)}}),[]);(0,He.useEffect)((()=>{var e;l&&f.current&&(g.current||m(),null===(e=g.current)||void 0===e||e.scrollTo({top:a}))}),[a,m,l]),(0,He.useEffect)((function(){if(i.noteType!==r.NoteType.Super)return;m();const e=g.current;if(!e)return;const t=e=>{null==c||c(e)};return e.addEventListener("scroll",t),()=>{e.removeEventListener("scroll",t)}}),[i.noteType,c,m]);const[y]=(0,Er.D)(r.LocalPrefKey.EditorLineHeight),[v]=(0,Er.D)(r.LocalPrefKey.EditorFontSize),A=Ir(v,!1);return(0,e.jsxs)("div",{className:"flex h-full flex-grow flex-col overflow-hidden",ref:f,children:[(0,e.jsx)("div",{className:(0,r.classNames)("w-full px-4 pt-4 text-base font-bold",p&&"pb-4"),children:(0,e.jsx)("div",{className:"title",children:o.title})}),s&&(0,e.jsx)(hd.Z,{item:i,linkingController:d,readonly:!0,className:{base:"mt-2 px-4",withToggle:"!mt-1 !pt-0"},isCollapsedByDefault:h}),p?(0,e.jsx)("div",{className:"component-view",children:(0,e.jsx)(ru,{componentViewer:p},p.identifier)}):o.noteType===r.NoteType.Super?(0,e.jsx)(As,{children:(0,e.jsx)("div",{className:"w-full flex-grow overflow-hidden overflow-y-auto",style:{"--line-height":r.EditorLineHeightValues[y],"--font-size":A},children:(0,e.jsx)(zn.I,{readonly:!0,initialValue:o.text,children:(0,e.jsx)(Yn.k,{readonly:!0,className:"blocks-editor relative h-full resize-none p-4 text-base focus:shadow-none focus:outline-none",spellcheck:o.spellcheck})},o.text)})}):(0,e.jsx)("div",{className:"relative mt-3 min-h-0 flex-grow overflow-hidden",children:o.text.length?(0,e.jsx)("textarea",{readOnly:!0,className:"font-editor h-full w-full resize-none border-0 bg-default p-4 pt-0 text-editor text-text",value:o.text,onScroll:c}):(0,e.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-passive-0",children:"Empty note."})})]})},fd=(0,Nn.Pi)((t=>{let{noteHistoryController:n,note:r}=t;const{selectedRevision:i,contentState:o}=n;switch(o){case dd.Idle:return(0,e.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 select-none text-sm text-passive-0",children:"No revision selected"});case dd.Loading:return(0,e.jsx)(di.Z,{className:"absolute left-1/2 top-1/2 h-5 w-5 -translate-x-1/2 -translate-y-1/2"});case dd.Loaded:return i?(0,e.jsx)(pd,{note:r,content:i.payload.content,showLinkedItems:!1}):null;case dd.NotEntitled:return(0,e.jsx)(ud,{});default:return null}}));function gd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function md(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gd(Object(n),!0).forEach((function(t){yd(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function yd(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class vd{constructor(e,t,n,i,o,s,a,l,c,u,d,h,p){this.note=e,this.itemListController=t,this.features=n,this.items=i,this.mutator=o,this.sync=s,this.actions=a,this.history=l,this.alerts=c,this._getRevision=u,this._listRevisions=d,this._deleteRevision=h,this._changeAndSaveItem=p,this.remoteHistory=[],this.isFetchingRemoteHistory=!1,this.sessionHistory=[],this.legacyHistory=[],this.selectedRevision=void 0,this.selectedEntry=void 0,this.contentState=dd.Idle,this.currentTab=od.Remote,this.setSelectedRevision=e=>{this.selectedRevision=e},this.setSelectedEntry=e=>{this.selectedEntry=e},this.clearSelection=()=>{this.setSelectedEntry(void 0),this.setSelectedRevision(void 0)},this.selectTab=e=>{this.currentTab=e,this.clearSelection(),this.setContentState(dd.Idle),this.selectFirstRevision()},this.setIsFetchingRemoteHistory=e=>{this.isFetchingRemoteHistory=e},this.setContentState=e=>{this.contentState=e},this.selectRemoteRevision=async e=>{if(this.note){if(!this.features.hasMinimumRole(e.required_role))return this.setContentState(dd.NotEntitled),void this.setSelectedRevision(void 0);this.setContentState(dd.Loading),this.clearSelection();try{this.setSelectedEntry(e);const t=await this._getRevision.execute({itemUuid:this.note.uuid,revisionUuid:e.uuid});if(t.isFailed())throw new Error(t.getError());const n=t.getValue();this.setSelectedRevision(n)}catch(e){this.clearSelection(),console.error(e)}finally{this.setContentState(dd.Loaded)}}},this.selectLegacyRevision=async e=>{var t;if(this.clearSelection(),this.setContentState(dd.Loading),this.note)try{if(!(null===(t=e.subactions)||void 0===t?void 0:t[0]))throw new Error("Could not find revision action url");this.setSelectedEntry(e);const n=await this.actions.runAction(e.subactions[0],this.note);if(!n)throw new Error("Could not fetch revision");this.setSelectedRevision(n.item)}catch(e){console.error(e),this.setSelectedRevision(void 0)}finally{this.setContentState(dd.Loaded)}},this.selectSessionRevision=e=>{this.clearSelection(),this.setSelectedEntry(e),this.setSelectedRevision(e),this.setContentState(dd.Loaded)},this.selectFirstRevision=()=>{switch(this.currentTab){case od.Remote:{const e=this.flattenedRemoteHistory[0];e&&this.selectRemoteRevision(e);break}case od.Session:{const e=this.flattenedSessionHistory[0];e&&this.selectSessionRevision(e);break}case od.Legacy:{const e=this.legacyHistory[0];e&&this.selectLegacyRevision(e);break}}},this.selectPrevOrNextRemoteRevision=e=>{const t=this.flattenedRemoteHistory.findIndex((t=>(null==t?void 0:t.uuid)===e.uuid)),n=this.flattenedRemoteHistory[t-1],r=this.flattenedRemoteHistory[t+1];n?this.selectRemoteRevision(n):r&&this.selectRemoteRevision(r)},this.setRemoteHistory=e=>{this.remoteHistory=e},this.fetchRemoteHistory=async()=>{if(this.setRemoteHistory([]),this.note){this.setIsFetchingRemoteHistory(!0);try{const e=await this._listRevisions.execute({itemUuid:this.note.uuid});if(e.isFailed())throw new Error(e.getError());const t=e.getValue();this.setRemoteHistory(rd(t))}catch(e){console.error(e)}finally{this.setIsFetchingRemoteHistory(!1)}}},this.setLegacyHistory=e=>{this.legacyHistory=e},this.fetchLegacyHistory=async()=>{this.actions.getExtensions().forEach((async e=>{if(!this.note)return;const t=await this.actions.loadExtensionInContextOfItem(e,this.note);t&&(null==t?void 0:t.actions.some((e=>e.verb===r.ActionVerb.Nested)))&&this.setLegacyHistory(t.actions.filter((e=>{var t;return null===(t=e.subactions)||void 0===t?void 0:t[0]})))}))},this.setSessionHistory=e=>{this.sessionHistory=e},this.fetchAllHistory=async()=>{this.resetHistoryState(),this.note&&(this.setSessionHistory(rd(this.history.sessionHistoryForItem(this.note))),await this.fetchRemoteHistory(),await this.fetchLegacyHistory(),this.selectFirstRevision())},this.resetHistoryState=()=>{this.remoteHistory=[],this.sessionHistory=[],this.legacyHistory=[]},this.restoreRevision=async e=>{const t=this.items.findItem(e.payload.uuid);if(null==t?void 0:t.locked)return void this.alerts.alert(ht.ac).catch(console.error);const n=await(0,L.VG)({text:"Are you sure you want to replace the current note's contents with what you see in this preview?",confirmButtonStyle:"danger"});if(!t)throw new Error("Original note not found.");n&&this._changeAndSaveItem.execute(t,(t=>{t.setCustomContent(e.payload.content)}),!0,r.PayloadEmitSource.RemoteRetrieved)},this.restoreRevisionAsCopy=async e=>{const t=this.items.findSureItem(e.payload.uuid),n=await this.mutator.duplicateItem(t,!1,md(md({},e.payload.content),{},{title:e.payload.content.title?e.payload.content.title+" (copy)":void 0}));this.sync.sync(),this.itemListController.selectItem(n.uuid).catch(console.error)},this.deleteRemoteRevision=async e=>{if(!await this.alerts.confirm("Are you sure you want to delete this revision?","Delete revision?","Delete revision",r.ButtonType.Danger,"Cancel")||!this.note)return;const t=await this._deleteRevision.execute({itemUuid:this.note.uuid,revisionUuid:e.uuid});if(t.isFailed())throw new Error(t.getError());this.clearSelection(),this.selectPrevOrNextRemoteRevision(e),await this.fetchRemoteHistory()},(0,_.rC)(this,{selectedRevision:_.LO,setSelectedRevision:_.aD,selectedEntry:_.LO,setSelectedEntry:_.aD,remoteHistory:_.LO,setRemoteHistory:_.aD,isFetchingRemoteHistory:_.LO,setIsFetchingRemoteHistory:_.aD,sessionHistory:_.LO,setSessionHistory:_.aD,legacyHistory:_.LO,setLegacyHistory:_.aD,resetHistoryState:_.aD,currentTab:_.LO,selectTab:_.aD,contentState:_.LO,setContentState:_.aD}),this.fetchAllHistory()}get flattenedRemoteHistory(){return this.remoteHistory.map((e=>e.entries)).flat()}get flattenedSessionHistory(){return this.sessionHistory.map((e=>e.entries)).flat()}}var Ad=s(16786);const bd=(0,Nn.Pi)((t=>{let{dismissModal:n,note:r}=t;const i=(0,sr.I)(),[o]=(0,He.useState)((()=>new vd(r,i.itemListController,i.features,i.items,i.mutator,i.sync,i.actions,i.history,i.alerts,i.getRevision,i.listRevisions,i.deleteRevision,i.changeAndSaveItem))),[s,a]=(0,He.useState)("List"),l=(0,He.useRef)(null),[c,u]=(0,He.useState)(!1),d=()=>u((e=>!e)),{vault:h}=(0,Ad.j)(r),p=!!h&&i.vaultUsers.isCurrentUserReadonlyVaultMember(h);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(Un.Z,{className:"items-center border-b border-border px-2 py-1 md:hidden",children:[(0,e.jsx)(Qn.Z,{type:"secondary",action:d,slot:"left",ref:l,children:(0,e.jsx)("div",{className:"rounded-full border border-border p-0.5",children:(0,e.jsx)(xn.Z,{type:"more"})})}),(0,e.jsxs)(On.Z,{title:"Advanced",open:c,anchorElement:l,disableMobileFullscreenTakeover:!0,togglePopover:d,align:"start",portal:!1,className:"w-1/2 !min-w-0 divide-y divide-border border border-border",children:[(0,e.jsx)("button",{onClick:()=>{a("List"),d()},className:"p-1.5 text-base font-semibold hover:bg-contrast focus:bg-info-backdrop focus:shadow-none focus:outline-none",children:"List"}),(0,e.jsx)("button",{onClick:()=>{a("Content"),d()},className:"p-1.5 text-base font-semibold hover:bg-contrast focus:bg-info-backdrop focus:shadow-none focus:outline-none",children:"Content"})]}),(0,e.jsx)("div",{className:"text-center text-base font-semibold",children:"History"}),(0,e.jsx)(Qn.Z,{type:"primary",slot:"right",action:n,children:"Done"})]}),(0,e.jsxs)("div",{className:"flex min-h-0 flex-grow",children:[(0,e.jsx)("div",{className:(0,Q.classNames)("w-full md:flex md:w-auto md:min-w-60","List"===s?"flex":"hidden"),children:(0,e.jsx)(ad,{features:i.features,noteHistoryController:o,selectMobileModalTab:a})}),(0,e.jsx)("div",{className:(0,Q.classNames)("relative flex-grow flex-col md:flex","Content"===s?"flex":"hidden"),children:(0,e.jsx)(fd,{noteHistoryController:o,note:r})})]}),(0,e.jsx)(ld,{dismissModal:n,noteHistoryController:o,readonly:p})]})})),wd=(0,He.forwardRef)(((n,r)=>{let{children:i,onDismiss:o}=n;const s=(0,Br.I)({open:!0}),a=(0,He.useCallback)((e=>{e&&(e.close=o)}),[o]);return(0,e.jsxs)(Or.Vq,{store:s,"aria-label":"Note revision history",ref:(0,kr.l)([a,r]),className:"fixed left-0 top-0 z-modal h-full w-full",children:[(0,e.jsx)("div",{className:"absolute z-0 h-full w-full bg-passive-5 opacity-0 md:opacity-75",role:"presentation",onClick:o}),(0,e.jsx)("div",{className:(0,Q.classNames)("absolute z-[1] my-0 flex h-full w-full flex-col rounded-md bg-[--modal-background-color]","p-0 pb-safe-bottom pt-safe-top shadow-lg md:max-h-[90%] md:w-[90%] md:max-w-[90%]","md:left-1/2 md:top-1/2 md:-translate-x-1/2 md:-translate-y-1/2 md:transform",(0,t.t2)()),children:i})]})})),Sd=(0,Nn.Pi)((t=>{let{application:n}=t;const r=(0,Kn.x)(),i=Boolean(n.historyModalController.note&&n.isAuthorizedToRenderItem(n.historyModalController.note));(0,He.useEffect)((()=>{let e;return i&&(e=r((()=>(n.historyModalController.dismissModal(),!0)))),()=>{e&&e()}}),[r,n,i]);const o=(0,et.ac)(et.Jj.sm),[s,a]=(0,Nr.vU)(i,o);return s?(0,e.jsx)(wd,{onDismiss:n.historyModalController.dismissModal,ref:a,children:!!n.historyModalController.note&&(0,e.jsx)(bd,{application:n,dismissModal:n.historyModalController.dismissModal,note:n.historyModalController.note})}):null}));function Cd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ed(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Id=n=>{let{application:r,applicationGroup:i}=n;var o,s,a;const l=(null===(o=r.fileBackups)||void 0===o?void 0:o.isFilesBackupsEnabled())||(null===(s=r.fileBackups)||void 0===s?void 0:s.isPlaintextBackupsEnabled())||(null===(a=r.fileBackups)||void 0===a?void 0:a.isTextBackupsEnabled()),c=(0,He.useRef)(null),u=(0,He.useCallback)((()=>{r.accountMenuController.setSigningOut(!1)}),[r.accountMenuController]),d=i.getDescriptors().length>1&&(0,t.Z$)(),h=(0,He.useCallback)((()=>{r.user.signOut().catch(console.error),u()}),[r,u]);return(0,e.jsxs)(Vi,{closeDialog:u,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between text-lg font-bold",children:["Sign out workspace?",(0,e.jsx)("button",{className:"rounded p-1 font-bold hover:bg-contrast",onClick:u,children:(0,e.jsx)(xn.Z,{type:"close"})})]}),(0,e.jsx)("div",{className:"sk-panel-row",children:(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-base text-foreground lg:text-sm",children:ht.X0}),d&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("br",{}),(0,e.jsxs)("p",{className:"text-base text-foreground lg:text-sm",children:[(0,e.jsx)("strong",{children:"Note: "}),"Because you have other workspaces signed in, this sign out may leave logs and other metadata of your session on this device. For a more robust sign out that performs a hard clear of all app-related data, use the ",(0,e.jsx)("i",{children:"Sign out all workspaces"})," option under ",(0,e.jsx)("i",{children:"Switch workspace"}),"."]})]})]})}),l&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(oo.Z,{classes:"my-2"}),(0,e.jsxs)("div",{className:"flex",children:[(0,e.jsx)("div",{className:"sk-panel-row"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-base text-foreground lg:text-sm",children:"Local backups are enabled for this workspace. Review your backup files manually to decide what to keep."}),(0,e.jsx)("button",{className:"sk-a mt-2 cursor-pointer rounded p-0 capitalize lg:text-sm",onClick:()=>{var e;null===(e=r.fileBackups)||void 0===e||e.openAllDirectoriesContainingBackupFiles()},children:"View backup files"})]})]})]}),(0,e.jsxs)("div",{className:"mt-4 flex justify-end gap-2",children:[(0,e.jsx)(Ln.Z,{ref:c,onClick:u,children:"Cancel"}),(0,e.jsx)(Ln.Z,{primary:!0,colorStyle:"danger",onClick:h,children:r.hasAccount()?"Sign Out":"Delete Workspace"})]})]})};Id.displayName="ConfirmSignoutModal";const _d=(0,Nn.Pi)((t=>t.application.accountMenuController.signingOut?(0,e.jsx)(Id,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cd(Object(n),!0).forEach((function(t){Ed(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},t)):null)),xd=(t,n)=>{const r=Si.p[t];return(0,e.jsx)(r,{className:n})},Pd=t=>{let{file:n}=t;return(0,e.jsxs)("div",{className:"flex min-w-70 flex-col p-4",children:[(0,e.jsxs)("div",{className:"mb-4 flex items-center",children:[(0,e.jsx)(xn.Z,{type:"info",className:"mr-2"}),(0,e.jsx)("div",{className:"font-semibold",children:"File information"})]}),(0,e.jsxs)("div",{className:"mb-3",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Type:"})," ",n.mimeType]}),(0,e.jsxs)("div",{className:"mb-3",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Decrypted Size:"})," ",(0,co.vU)(n.decryptedSize)]}),(0,e.jsxs)("div",{className:"mb-3",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Encrypted Size:"})," ",(0,co.vU)(n.encryptedSize)]}),(0,e.jsxs)("div",{className:"mb-3",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Created:"})," ",n.created_at.toLocaleString()]}),(0,e.jsxs)("div",{className:"mb-3",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Last Modified:"})," ",n.userModifiedDate.toLocaleString()]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("span",{className:"font-semibold",children:"File ID:"})," ",n.uuid]})]})};var kd=s(25281),Bd=s(30383);const Od=t=>{let{file:n}=t;const r=(0,sr.I)(),[i,o]=(0,He.useState)(void 0),[s,a]=(0,He.useState)(void 0);(0,He.useEffect)((()=>{var e;null===(e=r.fileBackups)||void 0===e||e.getFileBackupInfo(n).then(o)}),[r,n]),(0,He.useEffect)((()=>{var e;i&&(null===(e=r.fileBackups)||void 0===e||e.getFileBackupAbsolutePath(i).then(a))}),[i,r]);const l=(0,He.useCallback)((()=>{var e;i&&(null===(e=r.fileBackups)||void 0===e||e.openFileBackup(i))}),[i,r]),c=(0,He.useCallback)((()=>{r.openPreferences("backups")}),[r]);return r.fileBackups?(0,e.jsxs)(Jr.Z,{children:[i&&(0,e.jsx)(ci.Z,{icon:"check-circle",iconClassName:"text-success mt-1 ".concat(Iu.t),className:"items-start",onClick:l,children:(0,e.jsxs)("div",{className:"ml-2",children:[(0,e.jsxs)("div",{className:"font-semibold text-success",children:["Backed up on ",(0,je.An)(i.backedUpOn)]}),(0,e.jsx)("div",{className:"text-xs text-neutral",children:s})]})}),!i&&r.fileBackups&&(0,e.jsx)(ci.Z,{icon:"safe-square",className:"items-start",iconClassName:"text-neutral mt-1 ".concat(Iu.t),onClick:c,children:(0,e.jsxs)("div",{className:"ml-2",children:[(0,e.jsx)("div",{children:"Configure file backups"}),(0,e.jsx)("div",{className:"text-xs text-neutral",children:"File not backed up locally"})]})})]}):null},Nd=(0,Nn.Pi)((t=>{let{closeMenu:n,isFileAttachedToNote:r,renameToggleCallback:i,shouldShowRenameOption:o,shouldShowAttachOption:s,selectedFiles:a}=t;const l=(0,sr.I)(),{shouldUseStreamingAPI:c,handleFileAction:u}=l.filesController,{toggleAppPane:d}=(0,Zr.G)(),h=(0,He.useMemo)((()=>a.some((e=>e.protected))),[a]),p=(0,He.useMemo)((()=>a.length>1),[a.length]),f=c&&p,g=(0,He.useMemo)((()=>a.map((e=>e.decryptedSize)).reduce(((e,t)=>e+t),0)),[a]),m=(0,He.useCallback)((()=>{const e=a[0];u({type:cn.d.DetachFileToNote,payload:{file:e}}),n()}),[n,u,a]),y=(0,He.useCallback)((()=>{const e=a[0];u({type:cn.d.AttachFileToNote,payload:{file:e}}),n()}),[n,u,a]),v=(0,He.useCallback)((()=>{d($e.n.Items),n()}),[n,d]),A=a.some((e=>{const t=l.vaults.getItemVault(e);return(null==t?void 0:t.isSharedVaultListing())&&l.vaultUsers.isCurrentUserReadonlyVaultMember(t)})),b=a.every((e=>{const t=l.vaults.getItemVault(e);return!(null==t?void 0:t.isSharedVaultListing())||l.vaultUsers.isCurrentUserSharedVaultAdmin(t)}));return 0===a.length?(0,e.jsx)("div",{className:"text-center",children:"No files selected"}):(0,e.jsxs)(e.Fragment,{children:[1===a.length&&(r||s)&&(0,e.jsx)(Jr.Z,{children:r?(0,e.jsxs)(ci.Z,{onClick:m,children:[(0,e.jsx)(xn.Z,{type:"link-off",className:"mr-2 text-neutral"}),"Detach from note"]}):s?(0,e.jsxs)(ci.Z,{onClick:y,children:[(0,e.jsx)(xn.Z,{type:"link",className:"mr-2 text-neutral"}),"Attach to note"]}):null}),(0,e.jsxs)(Jr.Z,{children:[l.featuresController.isVaultsEnabled()&&(0,e.jsx)(ju,{iconClassName:Pu,items:a,disabled:!b}),(0,e.jsx)(du,{navigationController:l.navigationController,linkingController:l.linkingController,selectedItems:a,iconClassName:"text-neutral mr-2 ".concat(Iu.t),disabled:A}),(0,e.jsxs)(Dn.Z,{checked:h,onChange:e=>{l.filesController.setProtectionForFiles(e,a)},disabled:A,children:[(0,e.jsx)(xn.Z,{type:"lock",className:"mr-2 text-neutral ".concat(Iu.t)}),"Password protect"]})]}),(0,e.jsxs)(Jr.Z,{children:[(0,e.jsxs)(ci.Z,{onClick:()=>{l.filesController.downloadFiles(a),n()},children:[(0,e.jsx)(xn.Z,{type:"download",className:"mr-2 text-neutral ".concat(Iu.t)}),"Download ",f?"separately":""]}),f&&(0,e.jsxs)(ci.Z,{onClick:()=>{l.filesController.downloadFilesAsZip(a).catch((e=>{e instanceof DOMException&&"AbortError"===e.name||(console.error(e),(0,Y.fz)({type:Y.pC.Error,message:e.message||"Failed to download files as archive"}))})),n()},children:[(0,e.jsx)(xn.Z,{type:"download",className:"mr-2 text-neutral ".concat(Iu.t)}),"Download as archive"]}),o&&(0,e.jsxs)(ci.Z,{onClick:()=>{null==i||i(!0)},disabled:A,children:[(0,e.jsx)(xn.Z,{type:"pencil",className:"mr-2 text-neutral ".concat(Iu.t)}),"Rename"]}),(0,e.jsxs)(ci.Z,{onClick:()=>{v(),l.filesController.deleteFilesPermanently(a)},disabled:A,children:[(0,e.jsx)(xn.Z,{type:"trash",className:"mr-2 text-danger ".concat(Iu.t)}),(0,e.jsx)("span",{className:"text-danger",children:"Delete permanently"})]})]}),(0,e.jsx)(Od,{file:a[0]}),(0,e.jsxs)("div",{className:"px-3 pb-0.5 pt-1 text-xs font-medium text-neutral",children:[!p&&(0,e.jsxs)("div",{className:"mb-1",children:[(0,e.jsx)("span",{className:"font-semibold",children:"File ID:"})," ",a[0].uuid]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("span",{className:"font-semibold",children:p?"Total Size:":"Size:"})," ",(0,co.vU)(g)]})]})]})})),Dd=(0,Nn.Pi)((t=>{let{application:n}=t;const{currentFile:i,setCurrentFile:o,otherFiles:s,dismiss:a}=n.filePreviewModalController,[l,c]=(0,He.useState)(!1),u=(0,He.useRef)(null),[d,h]=(0,He.useState)(!1),[p,f]=(0,He.useState)(!1),[g,m]=(0,He.useState)(!1),y=(0,He.useRef)(null),v=(0,He.useRef)(null),A=(0,He.useCallback)((e=>{if(!i)return null;if(![L.u8.Left,L.u8.Right,L.u8.Escape].includes(e.key)||e.target===u.current)return;e.preventDefault();const t=s.findIndex((e=>e.uuid===i.uuid));switch(e.key){case L.u8.Left:{const e=t-1>=0?t-1:s.length-1,n=s[e];n&&o(n);break}case L.u8.Right:{const e=t+1<s.length?t+1:0,n=s[e];n&&o(n);break}case L.u8.Escape:a()}}),[i,a,s,o]),b=(0,He.useMemo)((()=>i?xd((0,Bd.A)(i.mimeType),"w-6 h-6 flex-shrink-0"):null),[i]),w=(0,He.useCallback)((e=>{e&&e.focus()}),[]),S=(0,He.useCallback)((async()=>{if(!i)return null;if(u.current){const e=u.current.value;if(e&&e!==i.name)return await n.mutator.renameFile(i,e),c(!1),void o(n.items.findSureItem(i.uuid));c(!1)}}),[n.items,n.mutator,i,o]),C=(0,et.ac)(et.Jj.sm),E=()=>f((e=>!e)),I=()=>f(!1),_=()=>m((e=>!e)),x=()=>h((e=>!e));if(!i)return null;const P=n.vaults.getItemVault(i),k=(null==P?void 0:P.isSharedVaultListing())&&n.vaultUsers.isCurrentUserReadonlyVaultMember(P);return(0,e.jsx)(Gn,{title:i.name,close:a,actions:[{label:"Done",type:"primary",onClick:a,hidden:!C,mobileSlot:"right"},{label:"Show file options",type:"secondary",onClick:E,hidden:!C},{label:"".concat(g?"Hide":"Show"," file info"),type:"secondary",onClick:_,hidden:!C},{label:"".concat(d?"Hide":"Show"," links section"),type:"secondary",onClick:x,hidden:!C}],customHeader:(0,e.jsx)(e.Fragment,{}),disableCustomHeader:C,children:(0,e.jsxs)("div",{className:"flex h-full w-full flex-col focus:shadow-none focus:outline-none",tabIndex:pt.HF,onKeyDown:A,ref:w,children:[(0,e.jsxs)("div",{className:"hidden min-h-6 flex-shrink-0 flex-wrap items-center justify-between gap-2 border-0 border-b border-solid border-border px-4 py-3 focus:shadow-none md:flex",children:[(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)("div",{className:"h-6 w-6",children:b}),l?(0,e.jsx)(ui.Z,{defaultValue:i.name,className:{container:"ml-3",input:"p-1",right:"items-stretch !p-0"},onKeyDown:e=>{e.key===L.u8.Enter&&S()},right:[(0,e.jsx)("button",{className:"flex h-full items-center justify-center border-l border-border px-2 py-1.5 text-neutral hover:bg-passive-4",title:"Submit",onClick:S,children:(0,e.jsx)(xn.Z,{type:"check",size:"small"})})],ref:(0,kr.l)([u,w])}):(0,e.jsx)("span",{className:"ml-3 font-medium",children:i.name})]}),(0,e.jsxs)("div",{className:"flex items-center",children:[!k&&(0,e.jsx)($r.Z,{label:"Rename file",className:"!z-modal",children:(0,e.jsx)("button",{className:"mr-4 flex cursor-pointer rounded border border-solid border-border bg-transparent p-1.5 hover:bg-contrast",onClick:()=>c((e=>!e)),"aria-label":"Rename file",children:(0,e.jsx)(xn.Z,{type:"pencil-filled",className:"text-neutral"})})}),(0,e.jsx)($r.Z,{label:"Show linked items",className:"!z-modal",children:(0,e.jsx)("button",{className:"mr-4 flex cursor-pointer rounded border border-solid border-border bg-transparent p-1.5 hover:bg-contrast",onClick:x,"aria-label":"Show linked items",children:(0,e.jsx)(xn.Z,{type:"link",className:"text-neutral"})})}),(0,e.jsx)($r.Z,{label:"Show file options",className:"!z-modal",children:(0,e.jsx)("button",{className:"mr-4 flex cursor-pointer rounded border border-solid border-border bg-transparent p-1.5 hover:bg-contrast",onClick:E,ref:y,"aria-label":"Show file options",children:(0,e.jsx)(xn.Z,{type:"more",className:"text-neutral"})})}),(0,e.jsx)(On.Z,{title:"File options",open:p,anchorElement:y,togglePopover:I,side:"bottom",align:"start",className:"md:pb-2",overrideZIndex:"z-modal",children:(0,e.jsx)(qr.Z,{a11yLabel:"File context menu",children:(0,e.jsx)(Nd,{selectedFiles:[i],closeMenu:I,shouldShowRenameOption:!1,shouldShowAttachOption:!1})})}),(0,e.jsx)($r.Z,{label:"Show file info",className:"!z-modal",children:(0,e.jsx)("button",{className:"mr-4 flex cursor-pointer rounded border border-solid border-border bg-transparent p-1.5 hover:bg-contrast",onClick:_,"aria-label":"Show file info",children:(0,e.jsx)(xn.Z,{type:"info",className:"text-neutral"})})}),(0,e.jsx)("button",{ref:v,onClick:a,"aria-label":"Close modal",className:"flex cursor-pointer rounded border-0 bg-transparent p-1 hover:bg-contrast",children:(0,e.jsx)(xn.Z,{type:"close",className:"text-neutral"})})]})]}),d&&(0,e.jsx)("div",{className:"-mt-1 min-h-0 flex-shrink-0 border-b border-border px-3.5 py-1.5",children:(0,e.jsx)(hd.Z,{linkingController:n.linkingController,item:i,readonly:k})}),(0,e.jsxs)("div",{className:"flex min-h-0 flex-grow flex-col-reverse md:flex-row",children:[(0,e.jsx)("div",{className:(0,r.classNames)("relative flex max-w-full flex-grow items-center justify-center",g&&"border-t border-border md:border-b-0 md:border-r"),children:(0,e.jsx)(kd.Z,{file:i,application:n},i.uuid)}),g&&(0,e.jsx)(Pd,{file:i})]})]})})}));Dd.displayName="FilePreviewModal";const jd=(0,Nn.Pi)((t=>{let{application:n}=t;return(0,e.jsx)(Fr,{"aria-label":"File preview modal",isOpen:n.filePreviewModalController.isOpen,close:n.filePreviewModalController.dismiss,className:"md:!h-full md:max-h-[90%] md:!w-full md:max-w-[90%]",autoFocusOnShow:!1,children:(0,e.jsx)(Dd,{application:n})})})),Td=(0,Nn.Pi)((t=>{let{filesController:n,itemListController:r}=t;const{showFileContextMenu:i,setShowFileContextMenu:o,fileContextMenuLocation:s}=n,{selectedFiles:a}=r;return(0,e.jsx)(On.Z,{title:"File options",open:i,anchorPoint:s,togglePopover:()=>o(!i),align:"start",className:"md:pb-2",children:(0,e.jsx)(qr.Z,{a11yLabel:"File context menu",children:(0,e.jsx)(Nd,{selectedFiles:a,closeMenu:()=>o(!1),shouldShowRenameOption:!1,shouldShowAttachOption:!1})})})}));Td.displayName="FileContextMenu";const Md=(0,Nn.Pi)((t=>{let{filesController:n,itemListController:r}=t;const{showFileContextMenu:i}=n,{selectedFiles:o}=r,s=o[0];return i&&s?(0,e.jsx)(Td,{filesController:n,itemListController:r}):null})),Fd=t=>{let{children:n,className:r}=t;const{hasBottomInset:i}=Rn();return(0,e.jsx)("div",{className:(0,Q.classNames)("flex items-center justify-end gap-3 border-t border-border px-4 py-4",i&&"pb-safe-bottom",r),children:n})},Rd=t=>{let{callback:n,component:r,dismiss:i,permissionsString:o}=t;const s=(0,He.useCallback)((()=>{n(!0),i()}),[n,i]),a=(0,He.useCallback)((()=>{n(!1),i()}),[n,i]);return(0,e.jsx)(Gn,{title:"Activate Plugin",close:a,actions:[{label:"Cancel",onClick:a,type:"cancel",mobileSlot:"left"},{label:"Continue",onClick:s,type:"primary",mobileSlot:"right"}],customFooter:(0,e.jsx)(Fd,{className:"hidden md:flex",children:(0,e.jsx)(Ln.Z,{primary:!0,fullWidth:!0,onClick:s,className:"block",children:"Continue"})}),children:(0,e.jsxs)("div",{className:"px-4 py-4",children:[(0,e.jsxs)("div",{className:"text-base",children:[(0,e.jsx)("strong",{children:r.displayName})," would like to interact with your ",o]}),(0,e.jsx)("div",{className:"sk-panel-row [word-break:break-word]",children:(0,e.jsx)("p",{className:"sk-p",children:"Plugins use an offline messaging system to communicate and can only access the current note."})})]})})},Ld=t=>{let{application:n}=t;const[i,o]=(0,He.useState)(),s=(0,He.useCallback)((e=>{o(e)}),[]),a=(0,He.useCallback)((()=>{o(void 0)}),[]),l=(0,He.useCallback)((()=>{n.componentManager.setPermissionDialogUIHandler(s)}),[n,s]);return(0,He.useEffect)((()=>{n.isStarted()&&l();const e=n.addEventObserver((async e=>{e===r.ApplicationEvent.Started&&l()}));return()=>{e()}}),[n,l]),(0,e.jsx)(Fr,{isOpen:!!i,close:a,className:"md:!w-[350px]",children:i&&(0,e.jsx)(Rd,{callback:i.callback,dismiss:a,component:i.component,permissionsString:i.permissionsString})})},Qd=(0,Nn.Pi)((t=>{let{navigationController:n,isEntitledToFolders:i,selectedTag:o}=t;const s=(0,sr.I)(),a=Qr(),{contextMenuOpen:l,contextMenuClickLocation:c}=n,u=(0,He.useCallback)((()=>{i?(n.setContextMenuOpen(!1),n.setAddingSubtagTo(o)):a.activate("Folders")}),[i,n,o,a]),d=(0,He.useCallback)((()=>{n.remove(o,!0).catch(console.error)}),[n,o]),h=(0,He.useMemo)((()=>(0,je.Eu)(o.userModifiedDate)),[o.userModifiedDate]),p=(0,He.useCallback)((()=>{n.setFavorite(o,!o.starred).catch(console.error),n.setContextMenuOpen(!1)}),[n,o]),f=(0,He.useMemo)((()=>(0,je.Eu)(o.created_at)),[o.created_at]),g=(0,He.useRef)(null);(0,He.useEffect)((()=>{l&&setTimeout((()=>{var e;null===(e=g.current)||void 0===e||e.focus()}))}),[l]);const m=(0,He.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!g.current)return;const t=g.current.value.trim();n.save(o,t).catch(console.error).finally((()=>{e&&n.setContextMenuOpen(!1)}))}),[n,o]);return(0,e.jsxs)(On.Z,{title:"Tag options",open:l,anchorPoint:c,togglePopover:()=>n.setContextMenuOpen(!l),className:"py-2",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1 px-4 py-0.5 text-mobile-menu-item md:px-3 md:text-tablet-menu-item lg:text-menu-item",children:[(0,e.jsx)("div",{className:"font-semibold",children:"Name"}),(0,e.jsxs)("div",{className:"flex gap-2.5",children:[(0,e.jsx)(ui.Z,{ref:g,className:{container:"flex-grow",input:"text-mobile-menu-item md:text-tablet-menu-item lg:text-menu-item"},defaultValue:o.title,onBlur:()=>m(),onKeyDown:e=>{e.key===L.u8.Enter&&m(!0)}},o.uuid),(0,e.jsx)("button",{"aria-label":"Save tag name",className:"rounded border border-border bg-transparent px-1.5 active:bg-default translucent-ui:border-[--popover-border-color] md:hidden",onClick:()=>m(!0),children:(0,e.jsx)(xn.Z,{type:"check"})})]})]}),(0,e.jsx)(oo.Z,{classes:"my-2"}),(0,e.jsxs)(qr.Z,{a11yLabel:"Tag context menu",children:[(0,e.jsx)(Ei,{onIconChange:e=>{n.setIcon(o,e||r.DefaultTagIconName)},selectedValue:o.iconString,platform:s.platform,className:"py-1.5 md:px-3",useIconGrid:!0,iconGridClassName:"max-h-30",autoFocus:!1},o.uuid),(0,e.jsxs)(Jr.Z,{children:[s.featuresController.isVaultsEnabled()&&(0,e.jsx)(ju,{iconClassName:"mr-2 text-neutral",items:[o]}),(0,e.jsx)(ci.Z,{className:"justify-between py-1.5",onClick:p,children:(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)(xn.Z,{type:"star",className:"mr-2 text-neutral"}),o.starred?"Unfavorite":"Favorite"]})}),(0,e.jsxs)(ci.Z,{className:"justify-between py-1.5",onClick:u,children:[(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)(xn.Z,{type:"add",className:"mr-2 text-neutral"}),"Add subtag"]}),!i&&(0,e.jsx)(xn.Z,{type:Mn._,className:Mn.K})]}),(0,e.jsxs)(ci.Z,{className:"py-1.5",onClick:d,children:[(0,e.jsx)(xn.Z,{type:"trash",className:"mr-2 text-danger"}),(0,e.jsx)("span",{className:"text-danger",children:"Delete"})]})]})]}),(0,e.jsx)(oo.Z,{classes:"my-2"}),(0,e.jsxs)("div",{className:"px-4 pb-1.5 pt-1 text-sm font-medium text-neutral md:px-3 lg:text-xs",children:[(0,e.jsxs)("div",{className:"mb-1",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Last modified:"})," ",h]}),(0,e.jsxs)("div",{className:"mb-1",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Created:"})," ",f]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("span",{className:"font-semibold",children:"Tag ID:"})," ",o.uuid]})]})]})})),Ud=(0,Nn.Pi)((t=>{let{navigationController:n,featuresController:i}=t;const o=n.contextMenuTag;return o&&o instanceof r.SNTag?(0,e.jsx)(Qd,{navigationController:n,isEntitledToFolders:i.hasFolders,selectedTag:o}):null})),Vd=(e,t)=>{var n;const r=null===(n=e.dataTransfer)||void 0===n?void 0:n.items;return!!r&&Array.from(r).some((e=>"file"===e.kind&&!((e,t)=>{var n;const r=(null===(n=e.getAsFile())||void 0===n?void 0:n.name)||"";return!1!==t.files.isFileNameFileBackupRelated(r)})(e,t)))};var Kd=s(65737);const Hd=(0,He.createContext)(null),Gd=()=>{const e=(0,He.useContext)(Hd);if(!e)throw new Error("Current component must be a child of <FileDragNDropProvider />");return e},Yd=(0,He.memo)((t=>{let{children:n}=t;return(0,e.jsx)(e.Fragment,{children:n})})),zd=t=>{let{application:n,children:r}=t;const i=Qr(),[o,s]=(0,He.useState)(!1),[a,l]=(0,He.useState)(""),c=(0,He.useRef)(null),u=(0,He.useCallback)((e=>{if(c.current){const t=e.getBoundingClientRect();c.current.style.width="".concat(t.width,"px"),c.current.style.height="".concat(t.height,"px"),c.current.style.transform="translate(".concat(t.x,"px, ").concat(t.y,"px)")}}),[]),d=(0,He.useCallback)((()=>{c.current&&(c.current.style.width="",c.current.style.height="",c.current.style.transform="")}),[]),h=(0,He.useRef)(new Map),p=(0,He.useCallback)(((e,t)=>{e.setAttribute("data-file-drag-target",""),h.current.set(e,t)}),[]),f=(0,He.useCallback)((e=>{e.removeAttribute("data-file-drag-target"),h.current.delete(e)}),[]),g=(0,He.useRef)(0),m=(0,He.useCallback)((()=>{s(!1),l(""),d()}),[d]),y=(0,He.useCallback)((e=>{Vd(e,n)&&(e.preventDefault(),e.stopPropagation())}),[n]),v=(0,He.useCallback)((e=>{Vd(e,n)&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer&&e.dataTransfer.clearData())}),[n]),A=(0,He.useCallback)((e=>{var t,r;if(!Vd(e,n))return;e.preventDefault(),e.stopPropagation(),d();let i=null;if(e.target instanceof HTMLElement&&(i=e.target.closest("[data-file-drag-target]")),g.current=g.current+1,null===(t=e.dataTransfer)||void 0===t?void 0:t.items.length)if(s(!0),i){u(i);const e=null===(r=h.current.get(i))||void 0===r?void 0:r.tooltipText;e&&l(e)}else l(""),d()}),[u,n,d]),b=(0,He.useCallback)((e=>{Vd(e,n)&&(e.preventDefault(),e.stopPropagation(),g.current=g.current-1,g.current>0||m())}),[n,m]),w=(0,He.useCallback)((e=>{var t;if(!Vd(e,n))return void m();e.preventDefault(),e.stopPropagation();let r=null;e.target instanceof HTMLElement&&(r=e.target.closest("[data-file-drag-target]")),m(),n.featuresController.entitledToFiles?(null===(t=e.dataTransfer)||void 0===t?void 0:t.items.length)&&(Array.from(e.dataTransfer.items).forEach((async e=>{const t=co.KC.available()?await e.getAsFileSystemHandle():e.getAsFile();if(!t)return;const i=r?h.current.get(r):void 0;if(null==i?void 0:i.handleFileUpload)return void i.handleFileUpload(t);const o=await n.filesController.uploadNewFile(t,{note:null==i?void 0:i.note});o&&(null==i?void 0:i.callback)&&i.callback(o)})),g.current=0):i.activate("Files")}),[n,i,m]);(0,He.useEffect)((()=>{const e=document.getElementById(kl.N.RootId);if(e)return e.addEventListener("dragstart",v),e.addEventListener("dragenter",A),e.addEventListener("dragleave",b),e.addEventListener("dragover",y),e.addEventListener("drop",w),()=>{e.removeEventListener("dragstart",v),e.removeEventListener("dragenter",A),e.removeEventListener("dragleave",b),e.removeEventListener("dragover",y),e.removeEventListener("drop",w)}}),[A,w,y,b,v]);const S=(0,He.useMemo)((()=>({isDraggingFiles:o,addDragTarget:p,removeDragTarget:f})),[p,o,f]);return(0,e.jsxs)(Hd.Provider,{value:S,children:[(0,e.jsx)(Yd,{children:r}),o?(0,e.jsx)(e.Fragment,{children:(0,e.jsx)("div",{className:"pointer-events-none absolute bottom-8 left-1/2 z-dropdown-menu -translate-x-1/2 rounded border-2 border-info bg-default px-5 py-3 shadow-main",children:a.length?a:"Drop your files to upload them"})}):null,(0,e.jsx)(Kd.Z,{children:(0,e.jsx)("div",{className:(0,Q.classNames)("overlay pointer-events-none absolute top-0 left-0 z-footer-bar h-full w-full border-2 border-info before:block before:h-full before:w-full before:bg-info before:opacity-20",o?"visible":"invisible"),ref:c})})]})};function Zd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Wd(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const qd=t=>{let{application:n}=t;const r=(0,He.useCallback)((()=>{n.accountMenuController.setDeletingAccount(!1)}),[n.accountMenuController]),i=(0,He.useRef)(null),o=(0,He.useCallback)((()=>{n.user.deleteAccount().catch(console.error),r()}),[n.user,r]);return(0,e.jsxs)(Vi,{closeDialog:r,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between text-lg font-bold",children:["Delete account?",(0,e.jsx)("button",{className:"rounded p-1 font-bold hover:bg-contrast",onClick:r,children:(0,e.jsx)(xn.Z,{type:"close"})})]}),(0,e.jsx)("div",{className:"sk-panel-row",children:(0,e.jsx)("div",{children:(0,e.jsx)("p",{className:"text-base text-foreground lg:text-sm",children:ht.eh})})}),(0,e.jsxs)("div",{className:"mt-4 flex justify-end gap-2",children:[(0,e.jsx)(Ln.Z,{ref:i,onClick:r,children:"Cancel"}),(0,e.jsx)(Ln.Z,{primary:!0,colorStyle:"danger",onClick:o,children:"Delete my account for good"})]})]})};qd.displayName="ConfirmDeleteAccountModal";const Jd=(0,Nn.Pi)((t=>t.application.accountMenuController.deletingAccount?(0,e.jsx)(qd,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zd(Object(n),!0).forEach((function(t){Wd(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},t)):null));function Xd(){const[e,n]=(0,He.useState)(0),r=(0,sr.I)(),i=(0,He.useMemo)((()=>new vn(r.environment)),[r]);return(0,He.useEffect)((()=>{const e=(0,t.Ds)((()=>{n(window.innerWidth)}),100);return window.addEventListener("resize",e),e(),()=>{window.removeEventListener("resize",e)}}),[]),i.execute().getValue()}const $d=e=>{const t=(0,He.useRef)();return(0,He.useEffect)((()=>{t.current=e})),t.current},eh=t=>{let{item:n}=t;return n.conflictOf?(0,e.jsx)("div",{className:"mt-0.5 flex flex-wrap items-center",children:(0,e.jsx)("div",{className:"mr-1 mt-2 rounded bg-danger px-1.5 py-1 text-danger-contrast",children:(0,e.jsx)("div",{className:"text-center text-xs font-bold",children:"Conflicted Copy"})})}):null},th=t=>{let{hideTags:n,tags:r}=t;return n||!r.length?null:(0,e.jsx)("div",{className:"mt-1.5 flex flex-wrap gap-2 overflow-hidden text-sm lg:text-xs",children:r.map((t=>(0,e.jsxs)("span",{className:"inline-flex items-center rounded bg-passive-4-opacity-variant px-1.5 py-1 text-foreground",children:[(0,e.jsx)(xn.Z,{type:t.iconString,className:"mr-1 text-passive-1",size:"small"}),(0,e.jsx)("span",{children:t.title})]},t.uuid)))})},nh=t=>{let{item:n,hideDate:i,sortBy:o}=t;const s=o===r.CollectionSort.UpdatedAt;return i&&!n.protected?null:(0,e.jsxs)("div",{className:"leading-1.4 mt-1 text-sm opacity-50 lg:text-xs",children:[n.protected&&(0,e.jsxs)("span",{children:["Protected ",i?"":" • "]}),!i&&s&&(0,e.jsxs)("span",{children:["Modified ",n.updatedAtString||"Now"]}),!i&&!s&&(0,e.jsx)("span",{children:n.createdAtString||"Now"})]})};var rh=s(67955);const ih=(e,t)=>{const{attachEvents:n,cleanupEvents:r}=(0,rh.H)(e,t,!0),i=(0,He.useCallback)((e=>{e.preventDefault(),t(e.clientX,e.clientY)}),[t]);(0,He.useEffect)((()=>{const t=e.current;if(!t)return;const o=(0,L.gn)();return t.addEventListener("contextmenu",i),o&&n(),()=>{t.removeEventListener("contextmenu",i),o&&r()}}),[n,r,e,i,t])},oh=t=>{let{item:n,hasFiles:i=!1,hasBorder:o=!0,isFileBackedUp:s=!1,className:a}=t;return(0,e.jsxs)("div",{className:(0,r.classNames)("flex items-start pl-0",o&&"border-b border-solid border-border",a),children:[n.locked&&(0,e.jsx)("span",{className:"flex items-center",title:"Editing Disabled",children:(0,e.jsx)(xn.Z,{ariaLabel:"Editing Disabled",type:"pencil-off",className:"text-info",size:"medium"})}),n.trashed&&(0,e.jsx)("span",{className:"ml-1.5 flex items-center",title:"Trashed",children:(0,e.jsx)(xn.Z,{ariaLabel:"Trashed",type:"trash-filled",className:"text-danger",size:"medium"})}),n.archived&&(0,e.jsx)("span",{className:"ml-1.5 flex items-center",title:"Archived",children:(0,e.jsx)(xn.Z,{ariaLabel:"Archived",type:"archive",className:"text-accessory-tint-3",size:"medium"})}),i&&(0,e.jsx)("span",{className:"ml-1.5 flex items-center",title:"Files",children:(0,e.jsx)(xn.Z,{ariaLabel:"Files",type:"attachment-file",className:"text-info",size:"medium"})}),n.starred&&(0,e.jsx)("span",{className:"ml-1.5 flex items-center",title:"Starred",children:(0,e.jsx)(xn.Z,{ariaLabel:"Starred",type:"star-filled",className:"text-warning",size:"medium"})}),s&&(0,e.jsx)("span",{className:"ml-1.5 flex items-center",title:"File is backed up locally",children:(0,e.jsx)(xn.Z,{ariaLabel:"File is backed up locally",type:"check-circle",className:"text-info",size:"medium"})})]})};var sh=s(69170);const ah=t=>{let{contact:n}=t;return(0,e.jsxs)("div",{title:"Shared by contact",className:"flex items-center rounded bg-info px-1.5 py-1 text-neutral-contrast",children:[(0,e.jsx)(xn.Z,{ariaLabel:"Shared by contact",type:"archive",className:"mr-1 text-info-contrast",size:"medium"}),(0,e.jsx)("div",{className:"text-center text-sm font-semibold lg:text-xs",children:n.name})]})},lh=t=>{let{item:n,className:i}=t;const{vault:o,sharedByContact:s}=(0,Ad.j)(n);return o?(0,e.jsxs)("div",{className:(0,r.classNames)("flex flex-wrap items-center gap-2",i),children:[(0,e.jsx)(sh.Z,{vault:o}),s&&(0,e.jsx)(ah,{contact:s})]}):null},ch=(0,Nn.Pi)((t=>{let{filesController:n,hideDate:r,hideIcon:i,hideTags:o,item:s,onSelect:a,selected:l,sortBy:c,tags:u}=t;const{setPaneLayout:d}=(0,Zr.G)(),h=(0,sr.I)(),[p,f]=(0,He.useState)(void 0);(0,He.useEffect)((()=>{var e;null===(e=h.fileBackups)||void 0===e||e.getFileBackupInfo(s).then(f)}),[h,s]);const g=(0,He.useRef)(null),m=(0,He.useCallback)(((e,t)=>{n.setShowFileContextMenu(!1),n.setFileContextMenuLocation({x:e,y:t}),n.setShowFileContextMenu(!0)}),[n]),y=(0,He.useCallback)((async(e,t)=>{let n=l;if(!l){const{didSelect:e}=await a(s);e&&(n=!0)}n&&m(e,t)}),[l,a,s,m]),v=(0,He.useCallback)((async()=>{const{didSelect:e}=await a(s,!0);e&&d(mt.h.Editing)}),[s,a,d]);return ih(g,y),(0,e.jsxs)("div",{ref:g,role:"button",className:(0,Q.classNames)("content-list-item flex w-full cursor-pointer items-stretch text-text",l&&"selected border-l-2px border-solid border-info"),id:s.uuid,onClick:v,children:[i?(0,e.jsx)("div",{className:"pr-4"}):(0,e.jsx)("div",{className:"mr-0 flex flex-col items-center justify-between p-4.5 pr-3",children:(0,e.jsx)((()=>xd((0,Bd.A)(s.mimeType),"w-5 h-5 flex-shrink-0")),{})}),(0,e.jsxs)("div",{className:"min-w-0 flex-grow border-b border-solid border-border px-0 py-4",children:[(0,e.jsx)("div",{className:"flex items-start justify-between overflow-hidden text-base font-semibold leading-[1.3]",children:(0,e.jsx)("div",{className:"break-word mr-2",children:s.title})}),(0,e.jsx)(nh,{item:s,hideDate:r,sortBy:c}),(0,e.jsx)(th,{hideTags:o,tags:u}),(0,e.jsx)(eh,{item:s}),(0,e.jsx)(lh,{item:s,className:"mt-1.5"})]}),(0,e.jsx)(oh,{className:"p-4",item:s,isFileBackedUp:!!p})]})})),uh=t=>{let{item:n,hidePreview:i,lineLimit:o=1}=t;return n.hidePreview||n.protected||i?null:(0,e.jsxs)("div",{className:(0,r.classNames)("overflow-hidden overflow-ellipsis text-base lg:text-sm",n.archived?"opacity-60":""),children:[n.preview_html&&(0,e.jsx)("div",{className:"my-1",dangerouslySetInnerHTML:{__html:(0,r.sanitizeHtmlString)(n.preview_html)}}),!n.preview_html&&n.preview_plain&&(0,e.jsx)("div",{className:"leading-1.3 line-clamp-".concat(o," mt-1 overflow-hidden"),children:n.preview_plain})]})},dh=t=>{let{item:n}=t;return(0,e.jsxs)("div",{className:(0,r.classNames)("break-word mr-2 overflow-hidden text-lg font-semibold leading-[1.3] lg:text-base lg:leading-[1.3]",n.archived?"opacity-60":""),children:[n.pinned&&(0,e.jsx)("span",{className:"mr-1.5 inline-flex rounded-full bg-info p-0.5 text-info-contrast",children:(0,e.jsx)(xn.Z,{type:"pin-filled",size:"custom",className:"h-3 w-3"})}),n.title]})},hh="application/x-sn-drag-tag",ph="application/x-sn-drag-note",fh=["checked","className"];function gh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function mh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gh(Object(n),!0).forEach((function(t){yh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function yh(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const vh=t=>{let{checked:n,className:r}=t,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,fh);return(0,e.jsx)("div",mh(mh({className:(0,Q.classNames)("relative h-5 w-5 rounded border-2 md:h-4 md:w-4",n?"border-info bg-info":"border-passive-1",r),role:"presentation"},i),{},{children:n&&(0,e.jsx)(xn.Z,{type:"check",className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-info-contrast",size:"small"})}))},Ah=(0,Nn.Pi)((t=>{let{application:n,notesController:i,onSelect:o,hideDate:s,hideIcon:a,hideTags:l,hidePreview:c,item:u,selected:d,sortBy:h,tags:p,isPreviousItemTiled:f,isNextItemTiled:g}=t;const m=(0,He.useRef)(null),y=bi(u.uuid),v=y?n.componentManager.editorForNote(y):void 0,A=(null==y?void 0:y.noteType)?y.noteType:v?v.noteType:void 0,[b,w]=(0,Do.i)(A),S=n.items.itemsReferencingItem(u).filter(r.isFile).length>0,C=(0,et.ac)(et.Jj.sm),E=(0,He.useCallback)((e=>{!C&&(e.ctrlKey||e.metaKey)&&!n.itemListController.isMultipleSelectionMode&&n.itemListController.enableMultipleSelectionMode(),!d||n.itemListController.isMultipleSelectionMode?o(u,!0).catch(console.error):n.itemListController.openSingleSelectedItem({userTriggered:!0}).catch(console.error)}),[n.itemListController,C,u,o,d]);ih(m,(async(e,t)=>{if(C)return n.itemListController.isMultipleSelectionMode||n.itemListController.replaceSelection(u),void n.itemListController.enableMultipleSelectionMode();let r=d;if(!d){const{didSelect:e}=await o(u);e&&(r=!0)}r&&((e,t)=>{i.setContextMenuClickLocation({x:e,y:t}),i.setContextMenuOpen(!0)})(e,t)})),V(R.ItemsList,"Rendering note list item",u.title);const I=!g,_=(0,He.useRef)();return(0,e.jsxs)("div",{ref:m,role:"button",className:(0,Q.classNames)("content-list-item flex w-full cursor-pointer items-stretch border-l-2 text-text",d?"selected ".concat(n.itemListController.isMultipleSelectionMode?"border-info":"border-accessory-tint-".concat(w)):"border-transparent",f&&"mt-3 border-t border-t-border",g&&"mb-3 border-b border-b-border"),id:u.uuid,onClick:E,draggable:!C&&!n.itemListController.isMultipleSelectionMode,onDragStart:e=>{if(!m.current)return;const{dataTransfer:t}=e,n=(()=>{if(!m.current)throw new Error("List item ref is not set");const e=m.current.cloneNode(!0);return Array.from(e.childNodes[1].childNodes).forEach(((e,t)=>{0!==t&&e.remove()})),e.childNodes[2].remove(),e instanceof HTMLDivElement&&(e.style.width="".concat(m.current.clientWidth,"px"),e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.zIndex="-100000",document.body.appendChild(e),_.current=e),e})();t.setDragImage(n,0,0),t.setData(ph,u.uuid)},onDragLeave:()=>{_.current&&_.current.remove()},children:[n.itemListController.isMultipleSelectionMode?(0,e.jsx)("div",{className:"mr-0 flex flex-col items-center justify-between gap-2 p-4 pr-4",children:(0,e.jsx)(vh,{className:"md:!h-5 md:!w-5",checked:d})}):a?(0,e.jsx)("div",{className:"pr-4"}):(0,e.jsx)("div",{className:"mr-0 flex flex-col items-center justify-between gap-2 p-4 pr-4",children:(0,e.jsx)(xn.Z,{type:b,className:"text-accessory-tint-".concat(w)})}),(0,e.jsxs)("div",{className:"min-w-0 flex-grow ".concat(I&&"border-b border-solid border-border"," px-0 py-4"),children:[(0,e.jsx)(dh,{item:u}),(0,e.jsx)(uh,{item:u,hidePreview:c}),(0,e.jsx)(nh,{item:u,hideDate:s,sortBy:h}),(0,e.jsx)(th,{hideTags:l,tags:p}),(0,e.jsx)(eh,{item:u}),(0,e.jsx)(lh,{item:u,className:"mt-1.5"})]}),(0,e.jsx)(oh,{className:"p-4",item:u,hasFiles:S,hasBorder:I})]})}));function bh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bh(Object(n),!0).forEach((function(t){Sh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Sh(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ch=He.memo((t=>{switch(t.item.content_type){case r.ContentType.TYPES.Note:return(0,e.jsx)(Ah,wh(wh({},t),{},{item:t.item}));case r.ContentType.TYPES.File:return(0,e.jsx)(ch,wh(wh({},t),{},{item:t.item}));default:return null}}),((e,t)=>!function(e,t){const n=["onSelect","hideDate","hideIcon","hideTags","hidePreview","selected","sortBy","isPreviousItemTiled","isNextItemTiled"];for(const r of n)if(e[r]!==t[r])return!0;return!(e.item===t.item||!function(e,t){if(e.uuid!==t.uuid)return!0;const n=["title","protected","updatedAtString","createdAtString","hidePreview","preview_html","preview_plain","archived","starred","pinned"];for(const r of n)if(e[r]!==t[r])return!0;return!1}(e.item,t.item))||function(e,t){return!(e===t||e.length===t.length&&(0===e.length&&0===t.length||(0,r.Uuids)(e).sort().join()===(0,r.Uuids)(t).sort().join()&&e.map((e=>e.title)).sort().join()===t.map((e=>e.title)).sort().join()))}(e.tags,t.tags)}(e,t))),Eh=(0,Nn.Pi)((t=>{let{application:n,items:i,selectedUuids:o,paginate:s}=t;const{filesController:a,itemListController:l,navigationController:c,notesController:u}=n,{selectPreviousItem:d,selectNextItem:h}=l,{hideTags:p,hideDate:f,hideNotePreview:g,hideEditorIcon:m}=l.webDisplayOptions,{sortBy:y}=l.displayOptions,v=c.selected,A=(0,He.useCallback)((e=>{const t=pt.ZL,n=e.target;n.scrollTop+n.offsetHeight>=n.scrollHeight-t&&s()}),[s]),b=(0,He.useCallback)((e=>{e.key===L.u8.Up?(e.preventDefault(),d()):e.key===L.u8.Down&&(e.preventDefault(),h())}),[h,d]),w=(0,He.useCallback)(((e,t)=>l.selectItem(e.uuid,t)),[l]),S=(0,He.useCallback)((e=>{if(p)return[];if(!v)return[];const t=n.getItemTags(e);return v instanceof r.SNTag&&1===t.length?[]:t}),[p,v,n]);return(0,e.jsx)("div",{className:(0,Q.classNames)("infinite-scroll overflow-y-auto overflow-x-hidden focus:shadow-none focus:outline-none","md:max-h-full pointer-coarse:md:overflow-y-auto","flex-grow pb-2"),id:kl.N.ContentList,onScroll:A,onKeyDown:b,tabIndex:pt.HF,children:i.map((t=>(0,e.jsx)(Ch,{application:n,item:t,selected:o.has(t.uuid),hideDate:f,hidePreview:g,hideTags:p,hideIcon:m,sortBy:y,filesController:a,onSelect:w,tags:S(t),notesController:u},t.uuid)))})})),Ih=(0,Nn.Pi)((t=>{let{accountMenuController:n,noAccountWarningController:r}=t;const i=(0,He.useCallback)((e=>{e.stopPropagation(),n.setShow(!0)}),[n]),o=(0,He.useCallback)((()=>{r.hide()}),[r]);return(0,e.jsxs)("div",{className:"mt-4 grid grid-cols-1 rounded-md border border-border p-4",children:[(0,e.jsx)("h1",{className:"sk-h3 m-0 text-base font-semibold lg:text-sm",children:"Data not backed up"}),(0,e.jsx)("p",{className:"col-start-1 col-end-3 m-0 mt-1 text-base lg:text-sm",children:"Sign in or register to sync your notes to your other devices with end-to-end encryption."}),(0,e.jsx)(Ln.Z,{primary:!0,small:!0,className:"col-start-1 col-end-3 mt-3 justify-self-start uppercase",onClick:i,children:"Open Account menu"}),(0,e.jsx)("button",{onClick:o,title:"Ignore warning","aria-label":"Ignore warning",style:{height:"20px"},className:"col-start-2 row-start-1 m-0 cursor-pointer rounded-md border-0 bg-transparent p-0 text-neutral hover:text-info",children:(0,e.jsx)(xn.Z,{type:"close",className:"block"})})]})})),_h=(0,Nn.Pi)((t=>{let{accountMenuController:n,noAccountWarningController:r}=t;return r.show?(0,e.jsx)(Ih,{accountMenuController:n,noAccountWarningController:r}):null})),xh="https://day.js.org/docs/en/display/format#list-of-all-available-formats";function Ph(t){let{format:n}=t;return(0,e.jsx)("em",{children:Gt(void 0,n)})}const kh=(0,Nn.Pi)((t=>{let{application:n,selectedTag:i,mode:o,changePreferencesCallback:s,disabled:a}=t;var l;const c=Qr(),u=(0,r.isSmartView)(i)&&(0,r.isSystemView)(i)?null===(l=n.getPreference(r.PrefKey.SystemViewPreferences))||void 0===l?void 0:l[i.uuid]:i.preferences,[d,h]=(0,He.useState)([]),[p,f]=(0,He.useState)(r.NativeFeatureIdentifier.TYPES.PlainEditor),[g,m]=(0,He.useState)(r.NewNoteTitleFormat.CurrentDateAndTime),[y,v]=(0,He.useState)(""),A=(0,He.useCallback)((()=>n.componentManager.getDefaultEditorIdentifier()),[n]),b=(0,He.useCallback)((()=>{if("tag"===o&&(null==u?void 0:u.editorIdentifier))f(null==u?void 0:u.editorIdentifier);else{const e=A();f(e)}"tag"===o&&(null==u?void 0:u.newNoteTitleFormat)?m(null==u?void 0:u.newNoteTitleFormat):m(n.getPreference(r.PrefKey.NewNoteTitleFormat,r.PrefDefaults[r.PrefKey.NewNoteTitleFormat]))}),[o,null==u?void 0:u.editorIdentifier,null==u?void 0:u.newNoteTitleFormat,A,n]);(0,He.useEffect)((()=>{"tag"===o&&(null==u?void 0:u.customNoteTitleFormat)?v(null==u?void 0:u.customNoteTitleFormat):v(n.getPreference(r.PrefKey.CustomNoteTitleFormat,r.PrefDefaults[r.PrefKey.CustomNoteTitleFormat]))}),[n,o,i,null==u?void 0:u.customNoteTitleFormat]),(0,He.useEffect)((()=>{b()}),[b]),(0,He.useEffect)((()=>{h(Fo(n))}),[n]);const w=(0,He.useCallback)((e=>{let t;const i=r.NativeFeatureIdentifier.create(e);if(i.isFailed()){const i=n.componentManager.findComponentWithPackageIdentifier(e);i&&(t=r.Uuid.create(i.uuid).getValue())}else t=i.getValue();if(t)if(n.features.getFeatureStatus(t)===r.FeatureStatus.Entitled)f(e),"global"===o?n.setPreference(r.PrefKey.DefaultEditorIdentifier,e):s({editorIdentifier:e});else{const t=d.find((t=>t.value===e));t&&c.activate(t.label)}}),[n,o,d,c,s]),S=(0,He.useRef)();return(0,e.jsxs)("div",{className:"px-3 py-3",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-mobile-menu-item md:text-menu-item",children:"Note Type"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(wi.Z,{disabled:a,fullWidth:!0,label:"Select the default note type",items:d,value:p,onChange:e=>w(e)})})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mt-3 text-mobile-menu-item md:text-menu-item",children:"Title Format"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(wi.Z,{disabled:a,fullWidth:!0,label:"Select the format for the note title",items:vs,value:g,onChange:e=>{m(e),"global"===o?n.setPreference(r.PrefKey.NewNoteTitleFormat,e):s({newNoteTitleFormat:e})}})})]}),g===r.NewNoteTitleFormat.CustomFormat&&(0,e.jsxs)("div",{className:"mt-2",children:[(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)("input",{disabled:a,className:(0,Q.classNames)("w-full min-w-55 rounded border border-solid border-passive-3 bg-default px-2 py-1.5 text-sm md:translucent-ui:bg-transparent","focus-within:ring-2 focus-within:ring-info"),placeholder:"e.g. YYYY-MM-DD",value:y,onChange:e=>{const t=e.currentTarget.value;v(t),S.current&&clearTimeout(S.current),S.current=window.setTimeout((async()=>{"tag"===o?s({customNoteTitleFormat:t}):n.setPreference(r.PrefKey.CustomNoteTitleFormat,t)}),25)},spellCheck:!1})}),(0,e.jsxs)("div",{className:"mt-3 text-neutral",children:[(0,e.jsx)("span",{className:"font-bold",children:"Preview: "}),(0,e.jsx)(As,{children:(0,e.jsx)(Ph,{format:y})})]}),(0,e.jsxs)("div",{className:"mt-2 text-neutral",children:[(0,e.jsx)("a",{className:"underline",href:xh,rel:"noreferrer",target:"_blank",onClick:e=>{n.isNativeMobileWeb()&&(e.preventDefault(),n.mobileDevice.openUrl(xh))},children:"Options"}),". Use ",(0,e.jsx)("code",{children:"[]"})," to escape formatting."]})]})]})}));function Bh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Oh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bh(Object(n),!0).forEach((function(t){Nh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Nh(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Dh=t=>{let{enabled:n,reverse:r}=t;return n?(0,e.jsx)(xn.Z,{type:r?"arrows-sort-up":"arrows-sort-down",className:"h-6 w-6 text-neutral md:h-5 md:w-6",size:"custom"}):null},jh=t=>{let{mode:n,label:r,icon:i,currentMode:o,setCurrentMode:s}=t;const a=o===n;return(0,e.jsx)("button",{className:(0,Q.classNames)("relative cursor-pointer rounded-full border-2 border-solid border-transparent px-2 py-1 text-mobile-menu-item focus:shadow-none md:py-0 lg:text-sm",a?"bg-info text-info-contrast":"bg-transparent text-text hover:bg-info-backdrop focus:bg-info-backdrop"),onClick:()=>{s(n)},children:(0,e.jsxs)("div",{className:"flex items-center justify-center",children:[i&&(0,e.jsx)(xn.Z,{size:"custom",type:i,className:(0,Q.classNames)("mr-1 h-4.5 w-4.5 cursor-pointer md:h-3.5 md:w-3.5",a?"text-info-contrast":"text-neutral")}),(0,e.jsx)("div",{children:r})]})})},Th=(0,Nn.Pi)((t=>{let{application:n,isFilesSmartView:i,selectedTag:o,paneController:s}=t;var a;const l=(0,r.isTag)(o),c=(0,r.isSmartView)(o)&&(0,r.isSystemView)(o),u=c?null===(a=n.getPreference(r.PrefKey.SystemViewPreferences))||void 0===a?void 0:a[o.uuid]:o.preferences,d=n.subscriptionController.hasFirstPartyOnlineOrOfflineSubscription(),[h,p]=(0,He.useState)(d&&l||u?"tag":"global"),[f,g]=(0,He.useState)({}),m="tag"===h&&!d,y="daily"===(null==u?void 0:u.entryMode),v=(0,He.useCallback)((()=>{const e={sortBy:n.getPreference(r.PrefKey.SortNotesBy,r.PrefDefaults[r.PrefKey.SortNotesBy]),sortReverse:n.getPreference(r.PrefKey.SortNotesReverse,r.PrefDefaults[r.PrefKey.SortNotesReverse]),showArchived:n.getPreference(r.PrefKey.NotesShowArchived,r.PrefDefaults[r.PrefKey.NotesShowArchived]),showTrashed:n.getPreference(r.PrefKey.NotesShowTrashed,r.PrefDefaults[r.PrefKey.NotesShowTrashed]),hideProtected:n.getPreference(r.PrefKey.NotesHideProtected,r.PrefDefaults[r.PrefKey.NotesHideProtected]),hidePinned:n.getPreference(r.PrefKey.NotesHidePinned,r.PrefDefaults[r.PrefKey.NotesHidePinned]),hideNotePreview:n.getPreference(r.PrefKey.NotesHideNotePreview,r.PrefDefaults[r.PrefKey.NotesHideNotePreview]),hideDate:n.getPreference(r.PrefKey.NotesHideDate,r.PrefDefaults[r.PrefKey.NotesHideDate]),hideTags:n.getPreference(r.PrefKey.NotesHideTags,r.PrefDefaults[r.PrefKey.NotesHideTags]),hideEditorIcon:n.getPreference(r.PrefKey.NotesHideEditorIcon,r.PrefDefaults[r.PrefKey.NotesHideEditorIcon]),newNoteTitleFormat:n.getPreference(r.PrefKey.NewNoteTitleFormat,r.PrefDefaults[r.PrefKey.NewNoteTitleFormat]),customNoteTitleFormat:n.getPreference(r.PrefKey.CustomNoteTitleFormat,r.PrefDefaults[r.PrefKey.CustomNoteTitleFormat])};g("global"===h?e:Oh(Oh({},e),u))}),[n,h,u]);(0,He.useEffect)((()=>{v()}),[v]);const A=(0,He.useCallback)((async e=>{for(const t of Object.keys(e)){const r=e[t];await n.setPreference(t,r).catch(console.error),v()}}),[n,v]),b=(0,He.useCallback)((async e=>{if(!o)return;if(!c)return;const t=n.getPreference(r.PrefKey.SystemViewPreferences)||{},i=t[o.uuid]||{};await n.setPreference(r.PrefKey.SystemViewPreferences,Oh(Oh({},t),{},{[o.uuid]:Oh(Oh({},i),e)})),v()}),[n,c,v,o]),w=(0,He.useCallback)((async e=>{"global"===h?await A(e):c?await b(e):await n.changeAndSaveItem.execute(o,(t=>{t.preferences=Oh(Oh({},t.preferences),e)}))}),[h,c,A,b,n,o]),S=(0,He.useCallback)((async()=>{if(c)return await n.setPreference(r.PrefKey.SystemViewPreferences,Oh(Oh({},n.getPreference(r.PrefKey.SystemViewPreferences)),{},{[o.uuid]:void 0})),void v();n.changeAndSaveItem.execute(o,(e=>{e.preferences=void 0}))}),[n,c,v,o]),C=(0,He.useCallback)((()=>{w({sortReverse:!f.sortReverse})}),[f,w]),E=(0,He.useCallback)((e=>{f.sortBy===e?C():w({sortBy:e})}),[f.sortBy,C,w]),I=(0,He.useCallback)((()=>{E(r.CollectionSort.UpdatedAt)}),[E]),_=(0,He.useCallback)((()=>{E(r.CollectionSort.CreatedAt)}),[E]),x=(0,He.useCallback)((()=>{E(r.CollectionSort.Title)}),[E]),P=(0,He.useCallback)((()=>{w({hideNotePreview:!f.hideNotePreview})}),[f,w]),k=(0,He.useCallback)((()=>{w({hideDate:!f.hideDate})}),[f,w]),B=(0,He.useCallback)((()=>{w({hideTags:!f.hideTags})}),[f,w]),O=(0,He.useCallback)((()=>{w({hidePinned:!f.hidePinned})}),[f,w]),N=(0,He.useCallback)((()=>{w({showArchived:!f.showArchived})}),[f,w]),D=(0,He.useCallback)((()=>{w({showTrashed:!f.showTrashed})}),[f,w]),j=(0,He.useCallback)((()=>{w({hideProtected:!f.hideProtected})}),[f,w]),T=(0,He.useCallback)((()=>{w({hideEditorIcon:!f.hideEditorIcon})}),[f,w]),M=(0,He.useCallback)((()=>{w({entryMode:y?"normal":"daily"})}),[y,w]),F=(0,He.useCallback)((()=>{const e=!f.useTableView;w({useTableView:e}),e&&s.setPaneLayout(mt.h.TableView)}),[f.useTableView,w,s]),R=(0,et.ac)(et.Jj.sm),L=Boolean(i||f.useTableView),U=L&&!R;return(0,e.jsxs)(qr.Z,{className:"text-sm",a11yLabel:"Notes list options menu",children:[(0,e.jsx)("div",{className:"my-1 px-3 text-base font-semibold uppercase text-text lg:text-xs",children:"Preferences for"}),(0,e.jsxs)("div",{className:(0,Q.classNames)("mt-1.5 flex w-full justify-between px-3",!m&&"mb-3"),children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)(jh,{label:"Global",mode:"global",currentMode:h,setCurrentMode:p}),(0,e.jsx)(jh,{label:o.title,icon:o.iconString,mode:"tag",currentMode:h,setCurrentMode:p})]}),"tag"===h&&(0,e.jsx)("button",{className:"text-base lg:text-sm",onClick:S,children:"Reset"})]}),m&&(0,e.jsx)(hs,{className:"m-2 mb-3 mt-2",application:n,title:"Upgrade for per-tag preferences",message:"Create powerful workflows and organizational layouts with per-tag display preferences and the all-new Daily Notebook calendar layout."}),(0,e.jsxs)(Jr.Z,{title:"Sort by",children:[(0,e.jsx)(Kr.Z,{disabled:m||y,className:"py-2",onClick:I,checked:f.sortBy===r.CollectionSort.UpdatedAt,children:(0,e.jsxs)("div",{className:"ml-1 flex flex-grow items-center justify-between md:ml-2",children:[(0,e.jsx)("span",{children:"Date modified"}),(0,e.jsx)(Dh,{enabled:f.sortBy===r.CollectionSort.UpdatedAt,reverse:f.sortReverse})]})}),(0,e.jsx)(Kr.Z,{disabled:m||y,className:"py-2",onClick:_,checked:f.sortBy===r.CollectionSort.CreatedAt,children:(0,e.jsxs)("div",{className:"ml-1 flex flex-grow items-center justify-between md:ml-2",children:[(0,e.jsx)("span",{children:"Creation date"}),(0,e.jsx)(Dh,{enabled:f.sortBy===r.CollectionSort.CreatedAt,reverse:f.sortReverse})]})}),(0,e.jsx)(Kr.Z,{disabled:m||y,className:"py-2",onClick:x,checked:f.sortBy===r.CollectionSort.Title,children:(0,e.jsxs)("div",{className:"ml-1 flex flex-grow items-center justify-between md:ml-2",children:[(0,e.jsx)("span",{children:"Title"}),(0,e.jsx)(Dh,{enabled:f.sortBy===r.CollectionSort.Title,reverse:f.sortReverse})]})})]}),(0,e.jsxs)(Jr.Z,{title:"View",children:[!U&&!i&&(0,e.jsx)(Dn.Z,{disabled:m,className:"py-1 hover:bg-contrast focus:bg-info-backdrop",checked:!f.hideNotePreview,onChange:P,children:(0,e.jsx)("div",{className:"max-w-3/4 flex flex-col",children:"Show note preview"})}),(0,e.jsx)(Dn.Z,{disabled:m,className:"py-1 hover:bg-contrast focus:bg-info-backdrop",checked:!f.hideDate,onChange:k,children:"Show date"}),(0,e.jsx)(Dn.Z,{disabled:m,className:"py-1 hover:bg-contrast focus:bg-info-backdrop",checked:!f.hideTags,onChange:B,children:"Show tags"}),(0,e.jsx)(Dn.Z,{disabled:m,className:"py-1 hover:bg-contrast focus:bg-info-backdrop",checked:!f.hideEditorIcon,onChange:T,children:"Show icon"})]}),!U&&(0,e.jsxs)(Jr.Z,{title:"Other",children:[(0,e.jsx)(Dn.Z,{disabled:m,className:"py-1 hover:bg-contrast focus:bg-info-backdrop",checked:!f.hidePinned,onChange:O,children:"Show pinned"}),(0,e.jsx)(Dn.Z,{disabled:m,className:"py-1 hover:bg-contrast focus:bg-info-backdrop",checked:!f.hideProtected,onChange:j,children:"Show protected"}),(0,e.jsx)(Dn.Z,{disabled:m,className:"py-1 hover:bg-contrast focus:bg-info-backdrop",checked:Boolean(f.showArchived),onChange:N,children:"Show archived"}),(0,e.jsx)(Dn.Z,{disabled:m,className:"py-1 hover:bg-contrast focus:bg-info-backdrop",checked:Boolean(f.showTrashed),onChange:D,children:"Show trashed"})]}),"tag"===h&&!c&&!L&&(0,e.jsx)(Jr.Z,{children:(0,e.jsx)(Dn.Z,{disabled:m,className:"py-1 hover:bg-contrast focus:bg-info-backdrop",checked:y,onChange:M,children:(0,e.jsxs)("div",{className:"flex flex-col pr-5",children:[(0,e.jsxs)("div",{className:"flex flex-row items-center",children:[(0,e.jsx)("div",{className:"text-base font-semibold uppercase text-text lg:text-xs",children:"Daily Notebook"}),(0,e.jsx)(Ge.DR,{className:"!py-0.5 px-1.5",style:"success",children:"Labs"})]}),(0,e.jsx)("div",{className:"mt-1",children:"Capture new notes daily with a calendar-based layout"})]})})}),"tag"===h&&!c&&!y&&(0,e.jsx)(Jr.Z,{children:(0,e.jsx)(Dn.Z,{disabled:m,className:"py-1 hover:bg-contrast focus:bg-info-backdrop",checked:L,onChange:F,children:(0,e.jsxs)("div",{className:"flex flex-col pr-5",children:[(0,e.jsxs)("div",{className:"flex flex-row items-center",children:[(0,e.jsx)("div",{className:"text-base font-semibold uppercase text-text lg:text-xs",children:"Table view"}),(0,e.jsx)(Ge.DR,{className:"!py-0.5 px-1.5",style:"success",children:"Labs"})]}),(0,e.jsx)("div",{className:"mt-1",children:"Display the notes and files in the current tag in a table layout"})]})})}),!U&&(!c||"global"===h)&&(0,e.jsx)(Jr.Z,{title:"New note defaults",children:(0,e.jsx)(kh,{disabled:m,application:n,selectedTag:o,mode:h,changePreferencesCallback:w})})]})})),Mh=()=>{const t=(0,sr.I)(),{setPaneLayout:n}=(0,Zr.G)(),{isTabletOrMobile:i,isMobile:o}=Xd(),[s,a]=(0,He.useState)((()=>t.status.totalPreferencesBubbleCount?t.status.totalPreferencesBubbleCount.toString():void 0));return(0,He.useEffect)((()=>t.status.addEventObserver(((e,t)=>{e===r.StatusServiceEvent.PreferencesBubbleCountChanged&&a(t)}))),[t.status]),(0,e.jsxs)("div",{className:(0,r.classNames)(i?"flex":"hidden","relative h-10 w-10","mr-3"),children:[(0,e.jsx)(ei.Z,{onClick:()=>{n(mt.h.TagSelection)},label:"Open navigation menu",icon:"menu-variant"}),o&&s&&(0,e.jsx)(si,{position:"right",count:s})]})},Fh=(0,Nn.Pi)((t=>{let{filesController:n,close:i}=t;const[o,s]=(0,He.useState)((0,je.AF)(new Date)),[a,l]=(0,He.useState)((()=>new Te)),[c,u]=(0,He.useState)(!1),[d,h]=(0,He.useState)(),p=(0,He.useRef)(null),f=(0,He.useRef)(null);(0,He.useEffect)((()=>{if(a)return u(!1),(async()=>{await a.initialize(),f.current&&(a.video.style.position="",a.video.style.display="",a.video.style.height="100%",f.current.append(a.video)),u(!0)})(),()=>{a.video&&a.finish()}}),[a]);const g=(0,He.useCallback)((async()=>{if(!a)return;const e=await a.takePhoto(o);h(e),l(void 0)}),[o,a]),m=(0,He.useMemo)((()=>(null==a?void 0:a.devices)?a.devices.map((e=>({label:e.label||"Camera (".concat(e.deviceId.slice(0,10),")"),value:e.deviceId}))):[]),[null==a?void 0:a.devices]),y=(0,He.useCallback)((()=>{var e;o?d&&(n.uploadNewFile(d),i()):null===(e=p.current)||void 0===e||e.focus()}),[d,i,o,n]);return(0,e.jsx)(Gn,{title:"Take a photo",close:i,actions:[{label:"Capture",onClick:g,type:"primary",mobileSlot:"right",hidden:!!d},{label:"Upload",onClick:y,type:"primary",mobileSlot:"right",hidden:!d},{label:"Cancel",onClick:i,type:"cancel",mobileSlot:"left"},{label:"Retry",onClick:()=>{h(void 0),l(new Te)},type:"secondary"}],children:(0,e.jsxs)("div",{className:"px-4 py-4",children:[(0,e.jsx)("div",{className:"mb-4 flex flex-col",children:(0,e.jsxs)("label",{className:"text-sm font-medium text-neutral",children:["File name:",(0,e.jsx)(ui.Z,{className:{container:"mt-1"},value:o,onChange:e=>s(e),ref:p})]})}),(0,e.jsxs)("div",{className:"mt-2",children:[(0,e.jsx)("div",{className:"text-sm font-medium text-neutral",children:"Preview:"}),!c&&(0,e.jsx)("div",{className:"mt-1 w-full",children:(0,e.jsxs)("div",{className:"flex h-64 w-full items-center justify-center gap-2 rounded-md bg-contrast text-base",children:[(0,e.jsx)(xn.Z,{type:"camera",className:"text-neutral-300"}),"Initializing..."]})}),(0,e.jsx)("div",{className:(0,r.classNames)("mt-1 w-full",d&&"hidden"),ref:f}),d&&(0,e.jsx)("div",{className:"mt-1 w-full",children:(0,e.jsx)("img",{src:URL.createObjectURL(d),alt:"Captured photo"})})]}),a&&m.length>1&&!d&&(0,e.jsx)("div",{className:"mt-4",children:(0,e.jsxs)("label",{className:"text-sm font-medium text-neutral",children:["Device:",(0,e.jsx)(wi.Z,{label:"Photo Capture Device",items:m,value:a.selectedDevice.deviceId,onChange:e=>{a.setDevice(e)},classNameOverride:{wrapper:"mt-1"}})]})})]})})}));class Rh{constructor(e){this.fileName=e,this.dataReadyPromise=(0,r.Deferred)(),this.onData=async e=>{const t=new Blob([e.data],{type:"video/mp4"}),n=URL.createObjectURL(t),r=await fetch(n),i=await r.blob(),o=new File([i],this.fileName,{type:"video/mp4"});this.dataReadyPromise.resolve(o)}}static async isSupported(){return(await navigator.mediaDevices.enumerateDevices()).some((e=>"videoinput"===e.kind))}async initialize(){var e,t;this.stream=await navigator.mediaDevices.getUserMedia({video:!0,audio:!0}),this.recorder=new MediaRecorder(this.stream),this.video=document.createElement("video"),this.video.playsInline=!0,this.video.style.position="absolute",this.video.style.display="none",this.video.volume=0,this.canvas=document.createElement("canvas"),document.body.append(this.video),this.video.srcObject=this.stream,await this.video.play(),await this.awaitVideoReady(this.video);const n=this.stream.getVideoTracks()[0].getSettings();this.width=null!==(e=n.width)&&void 0!==e?e:1280,this.height=null!==(t=n.height)&&void 0!==t?t:720,this.canvas.width=this.width,this.canvas.height=this.height}async startRecording(){this.recorder.start(),this.recorder.ondataavailable=this.onData}async stop(){var e,t;return this.video.pause(),"inactive"!==this.recorder.state&&this.recorder.stop(),null===(e=this.video.parentElement)||void 0===e||e.removeChild(this.video),null===(t=this.canvas.parentElement)||void 0===t||t.removeChild(this.canvas),this.video.remove(),this.canvas.remove(),this.stream.getTracks().forEach((e=>{e.stop()})),this.dataReadyPromise.promise}async awaitVideoReady(e){return new Promise((t=>{e.addEventListener("canplaythrough",(()=>{t(null)}))}))}}const Lh=(0,Nn.Pi)((t=>{let{filesController:n,close:i}=t;const[o,s]=(0,He.useState)((0,je.AF)(new Date)),[a,l]=(0,He.useState)((()=>new Rh(o))),[c,u]=(0,He.useState)(!1),[d,h]=(0,He.useState)(!1),[p,f]=(0,He.useState)(),g=(0,He.useRef)(null),m=(0,He.useRef)(null);(0,He.useEffect)((()=>((async()=>{await a.initialize(),m.current&&(a.video.style.position="",a.video.style.display="",a.video.style.height="100%",m.current.append(a.video)),u(!0)})(),()=>{a.video&&a.stop()})),[a]);const y=(0,He.useCallback)((async()=>{await a.startRecording(),h(!0)}),[a]),v=(0,He.useCallback)((()=>{var e;if(!o)return void(null===(e=g.current)||void 0===e||e.focus());if(!p)return;const t=new File([p],o,{type:p.type});n.uploadNewFile(t),i()}),[p,i,o,n]),A=(0,He.useMemo)((()=>{if(p)return URL.createObjectURL(p)}),[p]);return(0,e.jsx)(Gn,{title:"Record a video",close:i,actions:[{label:"Cancel",onClick:i,type:"cancel",mobileSlot:"left"},{label:"Record",onClick:y,type:"primary",mobileSlot:"right",hidden:!!p||d},{label:"Stop",onClick:async()=>{const e=await a.stop();h(!1),f(e)},type:"primary",mobileSlot:"right",hidden:!!p||!d},{label:"Retry",onClick:()=>{f(void 0),l(new Rh(o)),u(!1)},type:"secondary",hidden:!p},{label:"Upload",onClick:v,type:"primary",mobileSlot:"right",hidden:!p}],children:(0,e.jsxs)("div",{className:"px-4 py-4",children:[(0,e.jsx)("div",{className:"mb-4 flex flex-col",children:(0,e.jsxs)("label",{className:"text-sm font-medium text-neutral",children:["File name:",(0,e.jsx)(ui.Z,{className:{container:"mt-1"},value:o,onChange:e=>s(e),ref:g})]})}),(0,e.jsxs)("div",{className:"mt-2",children:[(0,e.jsx)("div",{className:"text-sm font-medium text-neutral",children:"Preview:"}),!c&&(0,e.jsx)("div",{className:"mt-1 w-full",children:(0,e.jsxs)("div",{className:"flex h-64 w-full items-center justify-center gap-2 rounded-md bg-contrast text-base",children:[(0,e.jsx)(xn.Z,{type:"camera",className:"text-neutral-300"}),"Initializing..."]})}),(0,e.jsx)("div",{className:(0,r.classNames)("mt-1 w-full",p&&"hidden"),ref:m}),p&&(0,e.jsx)("div",{className:"mt-1 w-full",children:(0,e.jsx)("video",{src:A,controls:!0})})]})]})})})),Qh=t=>{let{filesController:n,isDailyEntry:i,addButtonLabel:o,isInFilesSmartView:s,addNewItem:a}=t;const l=(0,He.useRef)(null),[c,u]=(0,He.useState)(!1),[d,h]=(0,He.useState)(!1),[p,f]=(0,He.useState)();(0,He.useEffect)((()=>{(async()=>{h(await Te.isSupported())})()}),[]);const g=s&&d,m=()=>{f(void 0)};return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)($r.Z,{label:o,children:(0,e.jsx)("button",{className:(0,r.classNames)("z-editor-title-bar hidden h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-solid border-transparent hover:brightness-125 md:flex",i?"bg-danger text-danger-contrast":"bg-info text-info-contrast"),"aria-label":o,onClick:()=>{g?u((e=>!e)):a()},ref:l,children:(0,e.jsx)(xn.Z,{type:"add",size:"custom",className:"h-5 w-5"})})}),g&&(0,e.jsx)(On.Z,{title:"Add item",open:c,anchorElement:l,togglePopover:()=>{u((e=>!e))},side:"bottom",align:"center",className:"py-2",children:(0,e.jsxs)(qr.Z,{a11yLabel:"test",children:[(0,e.jsxs)(ci.Z,{onClick:()=>{a(),u(!1)},children:[(0,e.jsx)(xn.Z,{type:"add",className:"mr-2"}),o]}),(0,e.jsxs)(ci.Z,{onClick:async()=>{f("photo"),u(!1)},children:[(0,e.jsx)(xn.Z,{type:"camera",className:"mr-2"}),"Take photo"]}),(0,e.jsxs)(ci.Z,{onClick:async()=>{f("video"),u(!1)},children:[(0,e.jsx)(xn.Z,{type:"camera",className:"mr-2"}),"Record video"]})]})}),(0,e.jsx)(Fr,{isOpen:"photo"===p,close:m,children:(0,e.jsx)(Fh,{filesController:n,close:m})}),(0,e.jsx)(Fr,{isOpen:"video"===p,close:m,children:(0,e.jsx)(Lh,{filesController:n,close:m})})]})},Uh=["className"];function Vh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Kh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vh(Object(n),!0).forEach((function(t){Hh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Hh(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Gh=t=>{let{className:n}=t,r=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,Uh);return(0,e.jsx)("button",Kh(Kh({className:(0,Q.classNames)("flex cursor-pointer border-0 bg-transparent p-0",n)},r),{},{children:(0,e.jsx)(xn.Z,{type:"clear-circle-filled",className:"text-neutral"})}))},Yh=(0,Nn.Pi)((t=>{let{itemListController:n}=t;const i=(0,He.useRef)(null),{noteFilterText:o,setNoteFilterText:s,clearFilterText:a}=n,[l,c]=(0,He.useState)(!1);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ui.Z,{autocomplete:!1,id:kl.N.SearchBar,className:{container:(0,r.classNames)(l?"scale-x-1 opacity-100":"scale-x-0 opacity-0","origin-right px-1 transition-all duration-200 ease-in-out"),input:"text-base placeholder:text-passive-0 lg:text-sm"},placeholder:"Search...",value:o,ref:e=>{e&&document.activeElement!==e&&e.focus()},onChange:e=>s(e),left:[(0,e.jsx)(xn.Z,{type:"search",className:"mr-1 h-4.5 w-4.5 flex-shrink-0 text-passive-1"})],right:[o&&(0,e.jsx)(Gh,{onClick:a})],roundedFull:!0}),(0,e.jsx)(ei.Z,{ref:i,className:l?"rotate-90 transition-transform duration-200 ease-in-out":"",onClick:()=>{c(!l)},icon:l?"close":"search",label:"Search"})]})})),zh=(0,He.memo)((t=>{let{application:n,panelTitle:i,icon:o,addButtonLabel:s,addNewItem:a,isFilesSmartView:l,isTableViewEnabled:c,optionsSubtitle:u,selectedTag:d,filesController:h,itemListController:p,paneController:f}=t;const g=(0,He.useRef)(null),m=(0,He.useRef)(null),y=(0,r.isTag)(d)&&d.isDailyEntry,v=(0,et.ac)(et.Jj.sm),A=(0,et.ac)(et.Yd.md),b=!(0,et.ac)(et.Yd.pointerFine),w=A&&b,[S,C]=(0,He.useState)(""),[E,I]=(0,He.useState)(!1),_=v&&(!!S||E);(0,He.useEffect)((()=>n.addEventObserver((async e=>{if(e===r.ApplicationEvent.CompletedInitialSync)return void C("");if(e===r.ApplicationEvent.EnteredOutOfSync)return void I(!0);if(e===r.ApplicationEvent.ExitedOutOfSync)return void I(!1);const t=n.sync.getSyncStatus(),{localDataDone:i,localDataCurrent:o,localDataTotal:s}=t.getStats();if(e!==r.ApplicationEvent.SyncStatusChanged)return e===r.ApplicationEvent.LocalDataIncrementalLoad||e===r.ApplicationEvent.LocalDataLoaded?i?void C(""):void C("Loading ".concat(o,"/").concat(s," items...")):void 0;C(t.syncInProgress&&!n.sync.completedOnlineDownloadFirstSync?"Syncing...":"")}))),[n]);const[x,P]=(0,He.useState)(!1),k=(0,He.useCallback)((()=>{P((e=>!e))}),[]),B=(0,He.useMemo)((()=>(0,e.jsx)("div",{className:"flex",children:(0,e.jsxs)("div",{className:"relative",ref:g,children:[(0,e.jsx)(ei.Z,{className:(0,Q.classNames)(x?"bg-contrast":void 0),onClick:k,ref:m,icon:"sort-descending",label:"Display options menu"}),(0,e.jsx)(On.Z,{open:x,anchorElement:m,togglePopover:k,align:"start",className:"py-2",title:"Display options",children:(0,e.jsx)(Th,{application:n,isFilesSmartView:l,selectedTag:d,paneController:f})})]})})),[x,k,n,l,d,f]),O=(0,He.useMemo)((()=>(0,e.jsx)(Qh,{isInFilesSmartView:l,isDailyEntry:y,addButtonLabel:s,addNewItem:a,filesController:h})),[s,a,h,y,l]),N=(0,He.useMemo)((()=>!c||v?null:(0,e.jsx)(Yh,{itemListController:p})),[c,v,p]),D=(0,He.useMemo)((()=>(0,e.jsx)("div",{className:"flex min-w-0 flex-grow flex-col break-words pt-1 lg:pt-0",children:(0,e.jsxs)("div",{className:(0,Q.classNames)("flex min-w-0 flex-grow",u||_?"":"items-center"),children:[o&&(0,e.jsx)(xn.Z,{type:o,size:"custom",className:(0,Q.classNames)("ml-0.5 mr-2 h-7 w-7 flex-shrink-0 text-2xl text-neutral lg:h-6 lg:w-6 lg:text-lg",u&&"md:mt-0.5")}),(0,e.jsxs)("div",{className:"mr-2 flex min-w-0 flex-col break-words",children:[(0,e.jsx)("div",{className:"text-2xl font-semibold text-text md:text-lg",children:i}),_&&(0,e.jsx)("div",{className:(0,Q.classNames)("-mt-1 text-xs md:mt-0",E?"text-warning":"text-passive-0"),children:E?"Potentially Out of Sync":S}),u&&(0,e.jsx)("div",{className:"text-xs text-passive-0",children:u}),(0,e.jsx)(lh,{className:"mt-1",item:d})]})]})})),[u,_,o,i,E,S,d]),j=(0,He.useMemo)((()=>(0,e.jsxs)("div",{className:"flex w-full justify-between md:flex",children:[(0,e.jsx)(Mh,{}),D,(0,e.jsxs)("div",{className:"flex items-start gap-3 md:items-center",children:[N,B,O]})]})),[D,N,B,O]),T=(0,He.useMemo)((()=>(0,e.jsxs)("div",{className:"w-full flex-col",children:[(0,e.jsxs)("div",{className:"mb-2 flex justify-between",children:[(0,e.jsx)(Mh,{}),(0,e.jsxs)("div",{className:"flex",children:[B,O]})]}),D]})),[B,O,D]);return(0,e.jsxs)("div",{className:"section-title-bar-header items-start gap-1",children:[!w&&j,w&&T]})})),Zh=t=>{let{label:n,selected:i,onSelect:o}=t;return(0,e.jsx)("button",{role:"checkbox","aria-checked":i,className:(0,r.classNames)("active:border-info active:bg-info active:text-neutral-contrast flex-grow cursor-pointer rounded-full border border-solid px-2 py-1 text-center transition text-sm",i?"text-neutral-contrast border-info bg-info":"text-neutral border-secondary-border bg-default"),onClick:o,children:n})},Wh=(0,Nn.Pi)((t=>{let{searchOptions:n}=t;const{includeProtectedContents:r,includeArchived:i,includeTrashed:o}=n,s=(0,He.useCallback)((async()=>{await n.toggleIncludeProtectedContents()}),[n]);return(0,e.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",onMouseDown:e=>e.preventDefault(),children:[(0,e.jsx)(Zh,{label:"Protected Contents",selected:r,onSelect:s}),(0,e.jsx)(Zh,{label:"Archived",selected:i,onSelect:n.toggleIncludeArchived}),(0,e.jsx)(Zh,{label:"Trashed",selected:o,onSelect:n.toggleIncludeTrashed})]})})),qh=(0,Nn.Pi)((t=>{let{itemListController:n,searchOptionsController:r,hideOptions:i=!1}=t;const o=(0,He.useRef)(null),{noteFilterText:s,setNoteFilterText:a,clearFilterText:l,onFilterEnter:c}=n,[u,d]=(0,He.useState)(!1),h=(0,He.useCallback)((e=>{a(e)}),[a]),p=(0,He.useCallback)((e=>{e.key===L.u8.Enter&&c()}),[c]),f=(0,He.useCallback)((()=>d(!0)),[]),g=(0,He.useCallback)((()=>d(!1)),[]),m=(0,He.useCallback)((()=>{var e;l(),null===(e=o.current)||void 0===e||e.focus()}),[l]);return(0,e.jsxs)("div",{className:"pb-0.5 pt-3",role:"search",children:[(0,e.jsx)(ui.Z,{autocomplete:!1,id:kl.N.SearchBar,className:{container:"px-1",input:"text-base placeholder:text-passive-0 lg:text-sm"},placeholder:"Search...",value:s,ref:o,onBlur:g,onChange:h,onFocus:f,onKeyUp:p,left:[(0,e.jsx)(xn.Z,{type:"search",className:"mr-1 h-4.5 w-4.5 flex-shrink-0 text-passive-1"})],right:[s&&(0,e.jsx)(Gh,{onClick:m})],roundedFull:!0}),(u||s)&&!i&&(0,e.jsx)("div",{className:"animate-fade-from-top",children:(0,e.jsx)(Wh,{searchOptions:r})})]})}));function Jh(e){return e.toLocaleDateString()}const Xh=e=>{const t=Jh(e);return{dateKey:t,date:e,day:e.getDate(),isToday:t===Jh(new Date),id:t,weekday:(0,je.ng)(e,"short")}};function $h(e,t,n){let r,i;if(e.length>0)r=e[0].date,i=e[e.length-1].date;else{const e=new Date;r=e,i=e}for(let o=1;o<=n;o++)if("front"===t){const t=(0,Q.addDaysToDate)(r,o),n=Xh(t);e.unshift(n)}else{const t=(0,Q.addDaysToDate)(i,-o),n=Xh(t);e.push(n)}return e}function ep(e,t){const n=Math.random()*(t-e)+e;return Math.floor(n)}const tp=t=>{let{rows:n}=t;const[r,i]=(0,He.useState)([]),[o,s]=(0,He.useState)(null),a=(0,He.useCallback)((()=>{const e=[];for(let t=0;t<n;t++){const t=ep(70,100);e.push(t)}i(e)}),[i,n]);(0,He.useEffect)((()=>{a()}),[n,a]);const l=(0,He.useCallback)((()=>{a();const e=setInterval((()=>{a()}),750);s(e)}),[s,a]),c=(0,He.useCallback)((()=>{o&&(clearInterval(o),s(null))}),[o,s]);return(0,e.jsx)("div",{onMouseEnter:l,onMouseLeave:c,className:"w-full",children:r.map(((t,n)=>(0,e.jsx)("div",{style:{width:"".concat(t,"%")},className:"transition-slowest ease my-4 h-7 bg-passive-4-opacity-variant pb-3 transition-width duration-1000"},n)))})},np=t=>{let{day:n,hasActivity:r,weekday:i}=t;return(0,e.jsx)("div",{className:"mr-5",children:(0,e.jsxs)("div",{className:"".concat(r?"bg-danger text-danger-contrast":"bg-neutral text-neutral-contrast"," h-19 w-18 rounded p-2 text-center"),children:[(0,e.jsx)("div",{className:"text-sm font-bold",children:i}),(0,e.jsx)("div",{className:"text-4xl font-bold",children:n})]})})},rp=(0,He.forwardRef)(((t,n)=>{let{item:i,tags:o=[],section:s,onClick:a,selected:l,hideDate:c=!1,hidePreview:u=!1,hideTags:d=!1}=t;return(0,e.jsxs)("div",{ref:n,onClick:a,className:"content-list-item flex w-full cursor-pointer items-stretch text-text ".concat(l&&"selected border-l-2 border-solid border-danger"),id:s.id,children:[(0,e.jsx)("div",{className:"min-w-0 flex-grow border-b border-solid border-border px-4 py-4",children:(0,e.jsxs)("div",{className:"flex items-start overflow-hidden text-base",children:[(0,e.jsx)(np,{weekday:s.weekday,hasActivity:null!=i,day:s.day}),(0,e.jsxs)("div",{className:"w-full leading-[1.3]",children:[i&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(dh,{item:i}),(0,r.isNote)(i)&&(0,e.jsx)(uh,{hidePreview:u,item:i,lineLimit:5}),(0,e.jsx)(nh,{item:i,hideDate:c,sortBy:"created_at"}),(0,e.jsx)(th,{hideTags:d,tags:o})]}),!i&&(0,e.jsxs)("div",{className:"w-full",children:[(0,e.jsx)("div",{className:"break-word mr-2 font-semibold",children:(0,je.AF)(s.date,!1)}),(0,e.jsx)(tp,{rows:1})]})]})]})}),i&&(0,e.jsx)(oh,{item:i,hasFiles:!1})]})})),ip=t=>{let{day:n,type:r,isToday:i,onClick:o,isLastMonth:s}=t,a="";return a+=i?"bg-danger text-danger-contrast font-bold":s?"text-passive-3":"empty"===r?"bg-transparent hover:bg-contrast":"item"===r?"bg-danger-light text-danger font-bold":"bg-contrast",(0,e.jsx)("div",{className:"h-7 w-[14.2%] p-0.5",children:(0,e.jsx)("div",{className:"".concat(a," flex h-full w-full cursor-pointer items-center justify-center rounded"),onClick:o,children:n},n)})},op=[31,28,31,30,31,30,31,31,30,31,30,31],sp=[31,29,31,30,31,30,31,31,30,31,30,31],ap=["Mo","Tu","We","Th","Fr","Sa","Su"],lp=["January","February","March","April","May","June","July","August","September","October","November","December"];function cp(e){return e.toLocaleDateString()}function up(e){const t=new Date(e.getFullYear(),e.getMonth(),1).getDay();return 0===t?7:t}function dp(e,t,n){const r=e[0].date,i=e[e.length-1].date;for(let o=1;o<=n;o++)if("front"===t){const t=(0,je.fi)(r,-o);e.unshift({date:t})}else{const t=(0,je.fi)(i,o);e.push({date:t})}return e}const hp=t=>{let{activities:n,startDate:r,onDateSelect:i,selectedDay:o,className:s}=t;const a=(0,He.useMemo)((()=>function(e){const t={};for(const n of e){const e=cp(n.date);t[e]||(t[e]=[]),t[e].push(n)}return t}(n)),[n]),[l,c]=(0,He.useState)(r||new Date),[u,d]=(0,He.useState)(l.getMonth()),[h,p]=(0,He.useState)(l.getFullYear()),[f,g]=(0,He.useState)(up(l));(0,He.useEffect)((()=>{c(r),d(r.getMonth()),p(r.getFullYear()),g(up(r))}),[r]);const m=new Date,y=function(e){return e%4==0&&e%100!=0||e%400==0}(h)?sp:op,v=Array(y[u]+(f-1)).fill(null);return(0,e.jsx)("div",{className:"w-300 ".concat(s," min-h-[210px]"),children:(0,e.jsxs)("div",{className:"ml-auto mr-auto w-70",children:[(0,e.jsx)("div",{className:"flex w-full flex-wrap",children:ap.map((t=>(0,e.jsx)("div",{className:"flex h-8 w-[14.2%] items-center justify-center",children:t},t)))}),(0,e.jsx)("div",{className:"flex w-full flex-wrap",children:v.map(((t,n)=>{const r=n-(f-2),s=new Date(h,u,r),l=s.getDate(),c=a[cp(s)]||[],d=o&&(0,je.gx)(o,s),p=c.length>0?"item":d?"template":"empty";return(0,e.jsx)(ip,{isLastMonth:r<=0,day:l,isToday:(0,je.gx)(s,m),onClick:()=>i(s),type:p},n)}))})]})})},pp=(0,He.forwardRef)(((t,n)=>{let{children:r,paginateFront:i,paginateEnd:o,direction:s="vertical",onElementVisibility:a,className:l,isMobileScreen:c}=t;const u=(0,He.useRef)(null),d=(0,He.useRef)(null),[h,p]=(0,He.useState)(!0),[f,g]=(0,He.useState)(!1),m=(0,He.useRef)(null),[y,v]=(0,He.useState)(0),[A,b]=(0,He.useState)(!1);(0,He.useImperativeHandle)(n,(()=>({scrollToElementId(e){S(e)}})));const w=(0,He.useMemo)((()=>new IntersectionObserver((e=>{const t=e.find((e=>e.isIntersecting));t&&(null==a||a(t.target.id))}),{threshold:1})),[a]);(0,He.useEffect)((()=>{const e=Array.from(m.current.children);for(const t of e)w.observe(t);return()=>{for(const t of e)w.unobserve(t)}}),[w,r]);const S=(0,He.useCallback)((e=>{const t=document.getElementById(e);t?(V(R.DailyNotes,"Scrolling to element",e),t.scrollIntoView({behavior:"auto",block:"center",inline:"center"})):V(R.DailyNotes,"Element not found",e)}),[]);(0,He.useLayoutEffect)((()=>{m.current&&A&&("vertical"===s?(m.current.scrollTop+=m.current.scrollHeight-y,c&&g(!0)):m.current.scrollLeft+=m.current.scrollWidth-y,b(!1))}),[A,y,s,c]),(0,He.useLayoutEffect)((()=>{f&&setTimeout((()=>{m.current&&(V(R.DailyNotes,"[InfiniteScroller] Applying mobile pagination fix"),m.current.scrollTop+=m.current.scrollHeight-y,g(!1))}),50)}),[f,y]);const C=(0,He.useCallback)((()=>{v("vertical"===s?m.current.scrollHeight:m.current.scrollWidth),b(!0),i()}),[i,s]),E=(0,He.useCallback)((()=>{o()}),[o]),I=(0,He.useMemo)((()=>new IntersectionObserver((e=>{if(e[0].isIntersecting){if(h)return V(R.DailyNotes,"[InfiniteScroller] Ignoring first front sentinel event"),void p(!1);C()}}),{threshold:.5})),[C,h]);(0,He.useEffect)((()=>{u.current&&I.observe(u.current)}),[I,u]);const _=(0,He.useMemo)((()=>new IntersectionObserver((e=>{e[0].isIntersecting&&E()}),{threshold:.5})),[E]);return(0,He.useEffect)((()=>{d.current&&_.observe(d.current)}),[_,d]),(0,e.jsxs)("div",{ref:m,className:l,style:{overflowY:"scroll",flexDirection:"vertical"===s?"column":"row"},children:[(0,e.jsx)("div",{style:{width:1,height:1,backgroundColor:"transparent"},ref:u}),r,(0,e.jsx)("div",{style:{width:1,height:1,backgroundColor:"transparent"},ref:d})]})})),fp=(0,He.forwardRef)(((n,r)=>{let{activities:i,onDateSelect:o,selectedDay:s,className:a,children:l}=n;const[c,u]=(0,He.useState)(!(0,t.Av)()),[d,h]=(0,He.useState)(!1),p=(0,He.useRef)(null),f=$d(s),[g,m]=(0,He.useState)(new Date),y=new Date,[v,A]=(0,He.useState)((()=>{const e=[{date:y}];return dp(e,"front",2),dp(e,"end",2),e})),b=(0,He.useCallback)((e=>{for(const t of v)if((0,je.Bn)(t.date,e))return!0;return!1}),[v]),w=(0,He.useCallback)((e=>{A(function(e,t){const n=e[0].date,r=e[e.length-1].date,i=t.getTime()<n.getTime();return dp(e,i?"front":"end",Math.abs(i?(0,je.ML)(n,t):(0,je.ML)(r,t)))}(v,e))}),[v]),S=(0,He.useCallback)((e=>{var t;const n=k(e);null===(t=p.current)||void 0===t||t.scrollToElementId(n)}),[p]),C=(0,He.useCallback)((e=>{b(e)||w(e),V(R.DailyNotes,"[Calendar] Scrolling to month",e,"from goToMonth"),m(e),S(e)}),[b,w,S]);(0,He.useImperativeHandle)(r,(()=>({goToMonth(e){C(e)}})),[C]);const E=(0,He.useCallback)((e=>{const t=[{date:e}];dp(t,"front",1),dp(t,"end",1),A(t)}),[A]);(0,He.useEffect)((()=>{if(s){if(f&&(0,je.gx)(f,s))return void V(R.DailyNotes,"[Calendar] selectedDay has changed, but is same as previous",s);V(R.DailyNotes,"[Calendar] selectedDay has changed, going to month:",s),C(s)}}),[s,C,f]),(0,He.useEffect)((()=>{d&&c&&(V(R.DailyNotes,"[Calendar] Scrolling to month",g,"from restoreScrollAfterExpand useEffect"),S(g),h(!1))}),[c,S,g,d,h]);const I=(0,He.useCallback)((()=>{V(R.DailyNotes,"[Calendar] paginateLeft"),A((e=>{const t=e.slice();return dp(t,"front",2),t}))}),[A]),_=(0,He.useCallback)((()=>{V(R.DailyNotes,"[Calendar] paginateRight"),A((e=>{const t=e.slice();return dp(t,"end",2),t}))}),[A]),x=(0,He.useCallback)((e=>{const t=v.findIndex((t=>k(t.date)===e));if(t>=0){const e=v[t];V(R.DailyNotes,"[Calendar] Month element did become visible, setting activeDate",e),m(e.date)}}),[v]),P=(0,He.useCallback)((()=>{h(!0),u(!c)}),[c,u,h]),k=e=>"month-".concat(e.getFullYear(),"-").concat(e.getMonth()),B=(0,He.useCallback)((e=>{E(e),o(e)}),[o,E]);return(0,e.jsxs)("div",{className:"border-b border-solid border-border",children:[(0,e.jsxs)("div",{onClick:P,className:(0,Q.classNames)("text-md flex cursor-pointer items-center justify-center px-4 py-2","text-center font-bold hover:bg-contrast"),children:[lp[g.getMonth()]," ",g.getFullYear()]}),c&&(0,e.jsx)(pp,{paginateFront:I,paginateEnd:_,direction:"horizontal",onElementVisibility:x,ref:p,className:a,isMobileScreen:(0,t.Av)(),children:v.map((t=>{const n=k(t.date);return(0,e.jsx)("div",{id:n,children:(0,e.jsx)(hp,{className:"mx-2",activities:i,onDateSelect:B,startDate:t.date,selectedDay:s},n)},n)}))}),c&&l]})})),gp=n=>{let{items:i,itemListController:o,onSelect:s,selectedUuids:a,selectedTag:l}=n;var c;const{toggleAppPane:u}=(0,Zr.G)(),[d,h]=(0,He.useState)(!1),[p,f]=(0,He.useState)(),[g,m]=(0,He.useState)(),y=(0,He.useRef)(null),[v,A]=(0,He.useState)(),b=(0,He.useRef)(null),[w,S]=(0,He.useState)((()=>function(e){const t=[Xh(new Date)];return $h(t,"front",4),$h(t,"end",5)}())),{hideTags:C,hideDate:E,hideNotePreview:I}=o.webDisplayOptions,_=(0,He.useMemo)((()=>(e=>{const t={};for(const n of e){const e=Jh(n.created_at);t[e]||(t[e]=[]),t[e].push(n)}return t})(i)),[i]),x=(0,He.useMemo)((()=>function(e,t){var n;if(!e)return 0;const r=e.date;let i=-1,o=!0,s=0;for(;o;){const e=t[Jh((0,Q.addDaysToDate)(r,i))];if(!e||0===(null==e?void 0:e.length)){o=!1;break}s++,i--}return s+((null===(n=t[Jh(e.date)])||void 0===n?void 0:n.length)>0?1:0)}(p,_)),[p,_]);(0,He.useEffect)((()=>{f(w.find((e=>e.isToday)))}),[w]),(0,He.useLayoutEffect)((()=>{var e;p&&b.current&&(null===(e=b.current)||void 0===e||e.scrollToElementId(p.id))}),[p,b]);const P=(0,He.useMemo)((()=>i.map((e=>({date:e.created_at,item:e})))),[i]),k=(0,He.useCallback)((()=>{V(R.DailyNotes,"[ContentList] paginateBottom"),S((e=>{const t=e.slice();return $h(t,"end",10),t}))}),[S]),B=(0,He.useCallback)((()=>{V(R.DailyNotes,"[ContentList] paginateTop"),S((e=>{const t=e.slice();return $h(t,"front",10),t}))}),[S]),O=(0,He.useCallback)((e=>{var t;const n=w.find((t=>t.id===e));n&&n!==v?(A(n),V(R.DailyNotes,"[ContentList] Item did become visible for date",n.date),null===(t=null==y?void 0:y.current)||void 0===t||t.goToMonth(n.date)):V(R.DailyNotes,"[ContentList] Ignoring duplicate day visibility")}),[w,v]),N=(0,He.useCallback)((async(e,t,n)=>{await s(t,n),u($e.n.Editor),m(e.date)}),[s,u]),D=(0,He.useCallback)((e=>{m(e),o.createNewNote(void 0,e,"editor"),u($e.n.Editor)}),[m,o,u]),j=(0,He.useCallback)((e=>w.find((t=>Jh(e)===t.dateKey))),[w]);(0,He.useEffect)((()=>{if(d){if(h(!1),!p)return;const e=_[p.id];if((null==e?void 0:e.length)>0){const t=e[0],n=j(t.created_at);n&&N(n,e[0],!1)}else{D(p.date);const e=document.getElementById(p.id);null==e||e.scrollIntoView({behavior:"auto"})}}}),[d,N,D,p,j,_]),(0,He.useEffect)((()=>{h(!0)}),[l.uuid]);const T=(0,He.useCallback)((e=>{const t=Xh(e),n=_[t.id];(null==n?void 0:n.length)>0?N(t,n[0],!1):t&&D(t.date)}),[N,D,_]),M=g&&(null===(c=_[Jh(g)])||void 0===c?void 0:c.length)>0;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(fp,{activities:P,activityType:"created",onDateSelect:T,selectedDay:g,selectedDayType:g?M?"item":"template":void 0,ref:y,className:"flex-column flex",children:x>0&&(0,e.jsxs)("div",{className:"flex w-full items-center justify-center border-t border-solid border-border bg-secondary-background p-2",children:[(0,e.jsx)("span",{className:"opacity-50",children:"Current Streak"}),(0,e.jsxs)("span",{className:"ml-1.5 font-bold",children:[x," ",(0,r.pluralize)(x,"Day","Days")]})]})}),(0,e.jsx)(pp,{paginateFront:B,paginateEnd:k,direction:"vertical",onElementVisibility:O,className:"flex-1",ref:b,isMobileScreen:(0,t.Av)(),children:w.map((t=>{const n=_[t.id];return n?n.map((n=>(0,e.jsx)(rp,{selected:a.has(n.uuid),section:t,id:t.id,item:n,hideDate:E,hidePreview:I,hideTags:C,onClick:()=>N(t,n,!0)},n.uuid))):(0,e.jsx)(rp,{selected:g&&t.id===Jh(g),section:t,id:t.id,onClick:()=>D(t.date)},t.dateKey)}))})]})};var mp;!function(e){e.Files="Encrypted File Storage",e.Super="Super notes"}(mp||(mp={}));const yp={transform:"translate3d(0, 0, 0)"},vp=t=>{let{label:n,style:i,onClick:o}=t;const s=(0,Ln.c)(i);return(0,e.jsx)("button",{className:(0,r.classNames)("fixed bottom-6 right-6 z-editor-title-bar ml-3 flex h-15 w-15 cursor-pointer items-center","justify-center rounded-full border border-solid border-transparent ".concat(s),"hover:brightness-125"),title:n,"aria-label":n,onClick:o,style:yp,children:(0,e.jsx)(xn.Z,{type:"add",size:"custom",className:"h-8 w-8"})})};function Ap(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ap(Object(n),!0).forEach((function(t){wp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ap(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wp(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sp(t){let{row:n,index:i,canSelectRows:o,handleRowClick:s,handleRowContextMenu:a,handleActivateRow:l}=t;const[c,u]=(0,He.useState)(!1),[d,h]=(0,He.useState)(!1),p=c||d,f=n.cells.filter((e=>!e.hidden));return(0,e.jsx)("div",bp(bp({role:"row",id:n.id,"aria-rowindex":i+2},o?{"aria-selected":n.isSelected}:{}),{},{className:"group relative contents",onMouseEnter:()=>{u(!0)},onMouseLeave:()=>{u(!1)},onClick:e=>s(e,n.id),onDoubleClick:()=>l(n.id),onContextMenu:a(n.id),onFocus:()=>{h(!0)},onBlur:e=>{var t;(null===(t=e.relatedTarget)||void 0===t?void 0:t.closest('[id="'.concat(n.id,'"]')))||h(!1)},children:f.map(((t,s,a)=>(0,e.jsxs)("div",{role:"gridcell","aria-rowindex":i+2,"aria-colindex":t.colIndex+1,className:(0,r.classNames)("relative flex items-center overflow-hidden border-b border-border px-3 py-4 focus:border-info",n.isSelected&&"bg-info-backdrop",o&&"cursor-pointer",o&&p&&"bg-contrast"),tabIndex:-1,children:[t.render,n.rowActions&&s===a.length-1&&(0,e.jsxs)("div",{className:(0,r.classNames)("absolute right-0 top-0 flex h-full items-center p-2",n.isSelected||p?"":"invisible",d&&"visible"),children:[(0,e.jsx)("div",{className:"z-[1]",children:n.rowActions}),(0,e.jsx)("div",{className:(0,r.classNames)("absolute right-0 top-0 z-0 h-full w-full backdrop-blur-[2px]",n.isSelected||p?"":"invisible")})]})]},s)))}))}const Cp=Math.ceil(document.documentElement.clientHeight/50)||20,Ep=function(t){let{table:n}=t;const i=(0,sr.I)(),[o,s]=(0,He.useState)(Cp),a=(0,He.useCallback)((()=>{s((e=>e+Cp))}),[]),l=(0,He.useCallback)((e=>{const t=e.target;t.scrollTop+t.offsetHeight>=t.scrollHeight-200&&a()}),[a]),{id:c,headers:u,rows:d,colCount:h,rowCount:p,selectRow:f,multiSelectRow:g,rangeSelectUpToRow:m,handleRowContextMenu:y,handleActivateRow:v,selectedRows:A,selectionActions:b,canSelectRows:w,canSelectMultipleRows:S,showSelectionActions:C}=n,E=(0,He.useRef)(0),I=(0,He.useRef)(0),_=(0,He.useCallback)((e=>{const t=e.target,n=t.closest('[role="row"]'),r=t.closest('[role="gridcell"],[role="columnheader"]');n&&(E.current=parseInt(n.getAttribute("aria-rowindex")||"0")),r&&(I.current=parseInt(r.getAttribute("aria-colindex")||"0"))}),[]),x=(0,He.useCallback)((e=>{document.activeElement.closest('[role="grid"]')!==e.target&&(E.current=0,I.current=0)}),[]),P=(0,He.useCallback)((e=>{const t=e.currentTarget,n=t.querySelectorAll('[role="row"]'),r=Array.from(n).find((e=>e.getAttribute("aria-rowindex")===E.current.toString())),o=Array.from(r?r.querySelectorAll("[tabindex]"):[]),s=u.length,a=(e,n)=>{const r=t.querySelector('[role="row"][aria-rowindex="'.concat(e,'"]'));if(!r)return;const i=r.querySelector('[aria-colindex="'.concat(n,'"]'));i&&i.focus()};switch(e.key){case L.u8.Up:e.preventDefault(),E.current>1&&a(E.current-1,I.current);break;case L.u8.Down:e.preventDefault(),E.current<=p&&a(E.current+1,I.current);break;case L.u8.Left:{if(e.preventDefault(),!o)return;const t=o.findIndex((e=>parseInt(e.getAttribute("aria-colindex")||"0")===I.current));if(0===t)return;const n=o[t-1];if(!n)return;n.focus();break}case L.u8.Right:{if(e.preventDefault(),!o)return;const t=o.findIndex((e=>parseInt(e.getAttribute("aria-colindex")||"0")===I.current));if(t===o.length-1)return;const n=o[t+1];if(!n)return;n.focus();break}case L.u8.Home:if(e.preventDefault(),e.ctrlKey)a(1,1);else{if(!o)return;const e=o[0];if(!e)return;const t=parseInt(e.getAttribute("aria-colindex")||"0");t>0&&a(E.current,t)}break;case L.u8.End:{if(e.preventDefault(),e.ctrlKey)return void a(n.length,s||h);if(!o)return;const t=o[o.length-1];if(!t)return;const r=parseInt(t.getAttribute("aria-colindex")||"0");r>0&&a(E.current,r);break}case L.u8.PageUp:{e.preventDefault();const t=E.current-5;a(t>0?t:1,I.current);break}case L.u8.PageDown:{e.preventDefault();const t=E.current+5;t<=n.length?a(t,I.current):a(n.length,I.current);break}case L.u8.Enter:{const t=e.target.closest('[role="columnheader"]');if(t&&t.getAttribute("data-can-sort"))return e.preventDefault(),void t.click();const n=null==r?void 0:r.id;n&&(e.preventDefault(),v(n));break}case L.u8.Space:{const t=e.target,n=null==r?void 0:r.id;if(!n)return;if("gridcell"!==t.getAttribute("role"))return;e.preventDefault(),(i.keyboardService.isMac?e.metaKey:e.ctrlKey)&&S?g(n):e.shiftKey&&S?m(n):f(n);break}}}),[i.keyboardService.isMac,S,h,v,u.length,g,m,p,f]),k=(0,He.useCallback)(((e,t)=>{w&&((i.keyboardService.isMac?e.metaKey:e.ctrlKey)&&S?g(t):e.shiftKey&&S?m(t):f(t))}),[i.keyboardService.isMac,S,w,g,m,f]);return(0,e.jsxs)("div",{className:"block min-h-0 overflow-auto",onScroll:l,children:[C&&A.length>=2&&(0,e.jsxs)("div",{className:"sticky top-0 z-[2] flex items-center justify-between border-b border-border bg-default px-3 py-2",children:[(0,e.jsxs)("span",{className:"text-info-0 text-sm font-medium",children:[A.length," selected"]}),A.length>0&&b]}),(0,e.jsxs)("div",{className:"relative grid w-full overflow-x-hidden px-3",role:"grid","aria-colcount":h,"aria-rowcount":p,"aria-multiselectable":S,onFocus:_,onBlur:x,onKeyDown:P,id:"table-".concat(c),children:[(0,e.jsx)("div",{role:"row","aria-rowindex":1,className:"contents",children:u.filter((e=>!e.hidden)).map(((t,n)=>(0,e.jsx)("div",bp(bp({role:"columnheader","aria-rowindex":1,"aria-colindex":t.colIndex+1,"aria-sort":t.isSorting?t.sortReversed?"descending":"ascending":"none",className:(0,r.classNames)("border-b border-border px-3 pb-2 pt-3 text-left text-sm font-medium text-passive-0",t.sortBy&&"cursor-pointer hover:bg-info-backdrop hover:underline focus:border-info focus:bg-info-backdrop"),style:{gridColumn:n+1},onClick:t.onSortChange,"data-can-sort":!!t.sortBy||void 0},t.sortBy&&{tabIndex:0===n?0:-1}),{},{children:(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[t.name,t.isSorting&&(0,e.jsx)(xn.Z,{type:t.sortReversed?"arrow-up":"arrow-down",size:"custom",className:"h-4.5 w-4.5 text-passive-1"})]})}),n.toString())))}),(0,e.jsx)("div",{className:"contents whitespace-nowrap",children:d.slice(0,o).map(((t,n)=>(0,e.jsx)(Sp,{row:t,index:n,canSelectRows:w,handleRowClick:k,handleRowContextMenu:y,handleActivateRow:v},t.id)))})]})]})},Ip=(0,Nn.Pi)((t=>{let{createAndAddNewTag:n,linkItems:i,results:o,searchQuery:s,shouldShowCreateTag:a,onClickCallback:l,isEntitledToNoteLinking:c,item:u}=t;const d=(0,He.useCallback)((e=>{n(e),null==l||l()}),[n,l]);return(0,e.jsxs)("div",{className:"my-1",children:[o.map((t=>{const n=!c&&t instanceof r.SNNote;return(0,e.jsxs)("button",{className:"flex w-full items-center justify-between gap-4 overflow-hidden px-3 py-2 hover:bg-contrast hover:text-foreground focus:bg-info-backdrop",onClick:()=>{i(u,t),null==l||l()},children:[(0,e.jsx)(Sc.Z,{item:t,searchQuery:s}),n&&(0,e.jsx)(xn.Z,{type:Mn._,className:"ml-auto flex-shrink-0 text-info"})]},t.uuid)})),a&&(0,e.jsx)(Cc.d,{searchQuery:s,onClickCallback:d})]})}));var _p=s(79323);const xp=t=>{let{file:n,closeMenu:r,handleFileAction:i,setIsRenamingFile:o}=t;const[s,a]=(0,He.useState)(n.protected);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(ci.Z,{onClick:()=>{i({type:cn.d.PreviewFile,payload:{file:n,otherFiles:[]}}),r()},children:[(0,e.jsx)(xn.Z,{type:"file",className:"mr-2 text-neutral"}),"Preview file"]}),(0,e.jsx)(oo.Z,{classes:"my-1"}),(0,e.jsxs)(Dn.Z,{className:"justify-between",checked:s,onChange:()=>{i({type:cn.d.ToggleFileProtection,payload:{file:n},callback:e=>{a(e)}}).catch(console.error)},children:[(0,e.jsx)(xn.Z,{type:"lock",className:"mr-2 text-neutral"}),"Password protect"]}),(0,e.jsx)(oo.Z,{classes:"my-1"}),(0,e.jsxs)(ci.Z,{onClick:()=>{i({type:cn.d.DownloadFile,payload:{file:n}}).catch(console.error),r()},children:[(0,e.jsx)(xn.Z,{type:"download",className:"mr-2 text-neutral"}),"Download"]}),(0,e.jsxs)(ci.Z,{onClick:()=>{o(!0),r()},children:[(0,e.jsx)(xn.Z,{type:"pencil",className:"mr-2 text-neutral"}),"Rename"]}),(0,e.jsxs)(ci.Z,{onClick:()=>{i({type:cn.d.DeleteFile,payload:{file:n}}).catch(console.error),r()},children:[(0,e.jsx)(xn.Z,{type:"trash",className:"mr-2 text-danger"}),(0,e.jsx)("span",{className:"text-danger",children:"Delete permanently"})]}),(0,e.jsx)(Od,{file:n})]})},Pp=t=>{let{activateItem:n,item:i,searchQuery:o,unlinkItem:s,handleFileAction:a}=t;var l;const c=(0,He.useRef)(null),u=(0,sr.I)(),[d,h]=(0,He.useState)(!1),p=()=>h((e=>!e)),[f,g]=(0,He.useState)(!1),[m,y]=(0,_p.b)(i,u),v=null!==(l=i.title)&&void 0!==l?l:"";return(0,e.jsxs)("div",{className:"relative flex items-center justify-between",children:[f&&i instanceof r.FileItem?(0,e.jsxs)("div",{className:"flex flex-grow items-center gap-4 py-2 pl-3 pr-12",children:[(0,e.jsx)(xn.Z,{type:m,className:(0,Q.classNames)("flex-shrink-0",y)}),(0,e.jsx)("input",{className:"min-w-0 flex-grow bg-default text-sm",defaultValue:v,onKeyDown:e=>{e.key===L.u8.Escape?g(!1):e.key===L.u8.Enter&&(async e=>{i instanceof r.FileItem&&(await a({type:cn.d.RenameFile,payload:{file:i,name:e}}),g(!1))})(e.currentTarget.value)},ref:e=>{e&&e.focus()}})]}):(0,e.jsx)("button",{className:"flex max-w-full flex-grow items-center justify-between gap-4 py-2 pl-3 pr-12 text-sm hover:bg-info-backdrop focus:bg-info-backdrop",onClick:()=>n(i),onContextMenu:e=>{e.preventDefault(),p()},children:(0,e.jsx)(Sc.Z,{item:i,searchQuery:o})}),(0,e.jsx)("button",{className:"absolute right-3 top-1/2 h-7 w-7 -translate-y-1/2 cursor-pointer rounded-full border-0 bg-transparent p-1 hover:bg-contrast",onClick:p,ref:c,children:(0,e.jsx)(xn.Z,{type:"more",className:"text-neutral"})}),(0,e.jsxs)(On.Z,{title:"Options",open:d,togglePopover:p,anchorElement:c,side:"bottom",align:"center",className:"py-2",children:[(0,e.jsxs)(ci.Z,{onClick:()=>{s(),p()},children:[(0,e.jsx)(xn.Z,{type:"link-off",className:"mr-2 text-danger"}),"Unlink"]}),i instanceof r.FileItem&&(0,e.jsx)(xp,{file:i,closeMenu:p,handleFileAction:a,setIsRenamingFile:g}),(0,e.jsx)(oo.Z,{classes:"my-2"}),(0,e.jsxs)("div",{className:"mt-1 px-3 py-1 text-xs font-medium text-neutral",children:[(0,e.jsxs)("div",{className:"mb-1",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Created at:"})," ",(0,je.Eu)(i.created_at)]}),(0,e.jsxs)("div",{className:"mb-1",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Modified at:"})," ",(0,je.Eu)(i.userModifiedDate)]}),(0,e.jsxs)("div",{className:"mb-1",children:[(0,e.jsx)("span",{className:"font-semibold",children:"ID:"})," ",i.uuid]}),i instanceof r.FileItem&&(0,e.jsxs)("div",{children:[(0,e.jsx)("span",{className:"font-semibold",children:"Size:"})," ",(0,co.vU)(i.decryptedSize)]})]})]})]})};var kp=s(20153);const Bp=(0,Nn.Pi)((t=>{let{item:n}=t;const i=(0,sr.I)(),{linkItems:o,unlinkItems:s,activateItem:a,createAndAddNewTag:l,isEntitledToNoteLinking:c}=i.linkingController,{notesLinkedToItem:u,notesLinkingToItem:d,filesLinkedToItem:h,filesLinkingToItem:p,tagsLinkedToItem:f}=(0,kp.f)(n),{entitledToFiles:g}=i.featuresController,m=(0,He.useRef)(null),[y,v]=(0,He.useState)(""),A=!!y.length,{linkedResults:b,unlinkedItems:w,shouldShowCreateTag:S}=(0,_c.Q)(y,i,n),C=(0,He.useCallback)((e=>{e&&e.focus()}),[]);return(0,e.jsxs)("div",{children:[(0,e.jsx)("form",{className:(0,Q.classNames)("sticky top-0 z-10 bg-default px-2.5 pt-2.5 md:translucent-ui:bg-transparent",b.length||w.length||d.length?"border-b border-border pb-2.5":"pb-1"),children:(0,e.jsx)(ui.Z,{type:"text",className:{container:(0,Q.classNames)(A?"py-0":"px-0.5 py-1.5","md:translucent-ui:bg-default"),input:"placeholder:text-passive-0"},placeholder:"Search items to link...",value:y,onChange:v,ref:(0,kr.l)([C,m]),right:[A&&(0,e.jsx)(Gh,{onClick:()=>{var e;v(""),null===(e=m.current)||void 0===e||e.focus()}})]})}),(0,e.jsx)("div",{className:"divide-y divide-border",children:A?(0,e.jsxs)(e.Fragment,{children:[(!!w.length||S)&&(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mb-1 mt-3 px-3 text-menu-item font-semibold uppercase text-passive-0",children:"Unlinked"}),(0,e.jsx)(Ip,{createAndAddNewTag:l,linkItems:o,results:w,searchQuery:y,shouldShowCreateTag:S,isEntitledToNoteLinking:c,onClickCallback:()=>{var e;v(""),null===(e=m.current)||void 0===e||e.focus()},item:n})]}),!!b.length&&(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mb-1 mt-3 px-3 text-menu-item font-semibold uppercase text-passive-0",children:"Linked"}),(0,e.jsx)("div",{className:"my-1",children:b.map((t=>(0,e.jsx)(Pp,{item:t.item,searchQuery:y,unlinkItem:()=>s(n,t.item),activateItem:a,handleFileAction:i.filesController.handleFileAction},t.id)))})]})]}):(0,e.jsxs)(e.Fragment,{children:[!!f.length&&(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mb-1 mt-3 px-3 text-menu-item font-semibold uppercase text-passive-0",children:"Linked Tags"}),(0,e.jsx)("div",{className:"my-1",children:f.map((t=>(0,e.jsx)(Pp,{item:t.item,searchQuery:y,unlinkItem:()=>s(n,t.item),activateItem:a,handleFileAction:i.filesController.handleFileAction},t.id)))})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mb-1 mt-3 px-3 text-menu-item font-semibold uppercase text-passive-0",children:"Linked Files"}),(0,e.jsxs)("div",{className:"my-1",children:[(0,e.jsxs)("button",{className:"flex w-full cursor-pointer items-center gap-3 bg-transparent px-3 py-2 text-left text-base text-text hover:bg-info-backdrop hover:text-foreground focus:bg-info-backdrop focus:shadow-none md:text-sm",onClick:async()=>{g?i.filesController.selectAndUploadNewFiles(n instanceof r.SNNote?n:void 0,(e=>{o(n,e)})):i.featuresController.showPremiumAlert(mp.Files)},children:[(0,e.jsx)(xn.Z,{type:"add"}),"Upload and link file(s)"]}),h.map((t=>(0,e.jsx)(Pp,{item:t.item,searchQuery:y,unlinkItem:()=>s(n,t.item),activateItem:a,handleFileAction:i.filesController.handleFileAction},t.id)))]})]}),!!p.length&&(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mb-1 mt-3 px-3 text-menu-item font-semibold uppercase text-passive-0",children:"Files Linking To Current File"}),(0,e.jsx)("div",{className:"my-1",children:p.map((t=>(0,e.jsx)(Pp,{item:t.item,searchQuery:y,unlinkItem:()=>s(n,t.item),activateItem:a,handleFileAction:i.filesController.handleFileAction},t.id)))})]}),!!u.length&&(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mb-1 mt-3 px-3 text-menu-item font-semibold uppercase text-passive-0",children:"Linked Notes"}),(0,e.jsx)("div",{className:"my-1",children:u.map((t=>(0,e.jsx)(Pp,{item:t.item,searchQuery:y,unlinkItem:()=>s(n,t.item),activateItem:a,handleFileAction:i.filesController.handleFileAction},t.id)))})]}),!!d.length&&(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mb-1 mt-3 px-3 text-menu-item font-semibold uppercase text-passive-0",children:"Notes Linking To This Note"}),(0,e.jsx)("div",{className:"my-1",children:d.map((t=>(0,e.jsx)(Pp,{item:t.item,searchQuery:y,unlinkItem:()=>s(n,t.item),activateItem:a,handleFileAction:i.filesController.handleFileAction},t.id)))})]})]})})]})}));function Op(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Np(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Op(Object(n),!0).forEach((function(t){Dp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Op(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Dp(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const jp=t=>{let{items:n}=t;const[i,o]=(0,He.useState)(!1),s=(0,He.useRef)(null),a=(0,He.useMemo)((()=>n.every((e=>e instanceof r.SNNote))),[n]),l=(0,He.useMemo)((()=>n.every((e=>e instanceof r.FileItem))),[n]);return a||l?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("button",{className:"rounded-full border border-border bg-default p-1",ref:s,onClick:e=>{e.preventDefault(),e.stopPropagation(),o((e=>!e))},children:(0,e.jsx)(xn.Z,{type:"more"})}),(0,e.jsx)(On.Z,{title:"File options",open:i,anchorElement:s,togglePopover:()=>{o(!1)},side:"bottom",align:"start",className:"py-2",children:(0,e.jsxs)(qr.Z,{a11yLabel:"File context menu",children:[l&&(0,e.jsx)(Nd,{closeMenu:()=>{o(!1)},shouldShowRenameOption:!1,shouldShowAttachOption:!1,selectedFiles:n}),a&&(0,e.jsx)(Qu,{notes:n,closeMenu:()=>{o(!1)}})]})})]}):null},Tp=t=>{let{item:n}=t;const[r,i]=(0,He.useState)(!1),o=(0,He.useRef)(null);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("button",{className:"rounded-full border border-border bg-default p-1",ref:o,onClick:e=>{e.preventDefault(),e.stopPropagation(),i((e=>!e))},children:(0,e.jsx)(xn.Z,{type:"link"})}),(0,e.jsx)(On.Z,{title:"Linked items",open:r,anchorElement:o,togglePopover:()=>{i(!1)},side:"bottom",align:"start",className:"py-2",children:(0,e.jsx)(Bp,{item:n})})]})},Mp=t=>{let{item:n,hideIcon:i}=t;const o=(0,sr.I)(),[s,a]=(0,He.useState)(void 0),l=n instanceof r.FileItem,c=(0,r.isNote)(n)?o.componentManager.editorForNote(n):void 0,u=(0,r.isNote)(n)?n.noteType:c?c.noteType:void 0,[d,h]=(0,Do.i)(u);return(0,He.useEffect)((()=>{var e;l&&(null===(e=o.fileBackups)||void 0===e||e.getFileBackupInfo(n).then(a))}),[o,l,n]),(0,e.jsxs)("div",{className:"flex items-center gap-3 whitespace-normal",children:[(0,e.jsxs)("span",{className:"relative",children:[i?null:l?xd((0,Bd.A)(n.mimeType),"w-6 h-6 flex-shrink-0"):(0,e.jsx)(xn.Z,{type:d,className:"text-accessory-tint-".concat(h)}),s&&(0,e.jsx)("div",{className:"absolute bottom-1 right-1 translate-x-1/2 translate-y-1/2 rounded-full bg-default text-success",title:"File is backed up locally",children:(0,e.jsx)(xn.Z,{size:"small",type:"check-circle-filled"})})]}),(0,e.jsx)("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap text-sm font-medium",children:n.title}),(0,e.jsx)(lh,{item:n}),n.protected&&(0,e.jsx)("span",{className:"flex items-center",title:"File is protected",children:(0,e.jsx)(xn.Z,{ariaLabel:"File is protected",type:"lock-filled",className:"h-3.5 w-3.5 text-passive-1",size:"custom"})})]})},Fp=t=>{let{item:n}=t;const{notesLinkedToItem:r,notesLinkingToItem:i,filesLinkedToItem:o,filesLinkingToItem:s,tagsLinkedToItem:a}=(0,kp.f)(n),l=(0,sr.I)(),c=r.concat(i,o,s,a);return c.length?(0,e.jsxs)("div",{className:"flex items-center gap-2 overflow-hidden",children:[(0,e.jsx)(ms.Z,{className:"overflow-hidden border border-transparent hover:border-border focus:border-info focus:shadow-none",link:c[0],unlinkItem:async e=>{l.mutator.unlinkItems(n,e)},isBidirectional:!1},c[0].id),c.length-1>=1&&(0,e.jsxs)("span",{children:["and ",c.length-1," more..."]})]}):null},Rp=t=>{let{application:n,items:i}=t;const o=i.some((e=>e instanceof r.FileItem)),{sortBy:s,sortDirection:a}=n.itemListController.displayOptions,l="asc"===a,{hideDate:c,hideEditorIcon:u,hideTags:d}=n.itemListController.webDisplayOptions,h=(0,He.useCallback)((async(e,t)=>{const i=n.navigationController.selected;if(i)if(i.uuid!==r.SystemViewId.Files)(0,r.isSmartView)(i)&&(0,r.isSystemView)(i)||await n.changeAndSaveItem.execute(i,(n=>{n.preferences=Np(Np({},n.preferences),{},{sortBy:e,sortReverse:t})}));else{const i=n.getPreference(r.PrefKey.SystemViewPreferences)||{},o=i[r.SystemViewId.Files]||{};await n.setPreference(r.PrefKey.SystemViewPreferences,Np(Np({},i),{},{[r.SystemViewId.Files]:Np(Np({},o),{},{sortBy:e,sortReverse:t})}))}}),[n]),[p,f]=(0,He.useState)(void 0),[g,m]=(0,He.useState)(void 0),y=(0,et.ac)(et.Jj.sm),v=(0,et.ac)(et.Jj.md),A=(0,et.ac)(et.Jj.lg),b=(0,He.useMemo)((()=>[{name:"Name",sortBy:"title",cell:t=>(0,e.jsx)(Mp,{item:t,hideIcon:u})},{name:"Upload date",sortBy:"created_at",cell:e=>(0,je.Eu)(e.created_at),hidden:y||c},{name:"Size",sortBy:"decryptedSize",cell:e=>e instanceof r.FileItem?(0,co.vU)(e.decryptedSize):null,hidden:y||!o},{name:"Attached to",hidden:y||v||A||d,cell:t=>(0,e.jsx)(Fp,{item:t})}]),[c,u,d,A,v,y,o]),w=(0,He.useCallback)((e=>e.uuid),[]),S=function(e){let{data:t,columns:n,sortBy:i,sortReversed:o,onSortChange:s,getRowId:a,enableRowSelection:l,enableMultipleRowSelection:c,selectedRowIds:u,onRowSelectionChange:d,onRowActivate:h,onRowContextMenu:p,rowActions:f,selectionActions:g,showSelectionActions:m}=e;const[y,v]=(0,He.useState)(u||[]),A=(0,He.useRef)(r.UuidGenerator.GenerateUuid());(0,He.useEffect)((()=>{u&&v(u)}),[u]),(0,He.useEffect)((()=>{d&&d(y)}),[y,d]);const b=(0,He.useMemo)((()=>n.map(((e,t)=>({name:e.name,isSorting:i&&i===e.sortBy,sortBy:e.sortBy,sortReversed:o,onSortChange:()=>{s&&e.sortBy&&s(e.sortBy,i===e.sortBy&&!o)},hidden:e.hidden||!1,colIndex:t})))),[n,s,i,o]),w=(0,He.useMemo)((()=>t.map(((e,t)=>{const r=n.map(((t,n)=>({render:t.cell(e),hidden:t.hidden||!1,colIndex:n}))),i=a?a(e):t.toString();return{id:i,isSelected:!!l&&y.includes(i),cells:r,rowData:e,rowActions:f?f(e):void 0}}))),[n,t,l,a,f,y]),S=(0,He.useCallback)((e=>{l&&v([e])}),[l]),C=(0,He.useCallback)((e=>{l&&c&&v((t=>t.includes(e)?t.filter((t=>t!==e)):[...t,e]))}),[c,l]),E=(0,He.useCallback)((e=>{if(!l||!c)return;const t=w.findIndex((e=>e.id===y[y.length-1])),n=w.findIndex((t=>t.id===e)),r=Math.min(t,n),i=Math.max(t,n),o=w.slice(r,i+1).map((e=>e.id));v(o)}),[c,l,w,y]),I=(0,He.useCallback)((e=>{var t;if(!h)return;const n=null===(t=w.find((t=>t.id===e)))||void 0===t?void 0:t.rowData;n&&h(n)}),[h,w]),_=(0,He.useCallback)((e=>t=>{var n;if(!p)return;t.preventDefault();const r=null===(n=w.find((t=>t.id===e)))||void 0===n?void 0:n.rowData;r&&(v([e]),p(t.clientX,t.clientY,r))}),[p,w]),x=(0,He.useMemo)((()=>n.length),[n]),P=(0,He.useMemo)((()=>t.length),[t.length]);return(0,He.useMemo)((()=>({id:A.current,headers:b,rows:w,colCount:x,rowCount:P,selectRow:S,multiSelectRow:C,rangeSelectUpToRow:E,handleActivateRow:I,handleRowContextMenu:_,selectedRows:y,canSelectRows:l||!1,canSelectMultipleRows:c||!1,selectionActions:g?g(y):void 0,showSelectionActions:m||!1})),[b,w,x,P,S,C,E,I,_,y,l,c,g,m])}({data:i,sortBy:s,sortReversed:l,onSortChange:h,getRowId:w,columns:b,enableRowSelection:!0,enableMultipleRowSelection:!0,onRowActivate(e){e instanceof r.FileItem&&n.filesController.handleFileAction({type:cn.d.PreviewFile,payload:{file:e,otherFiles:i.filter((e=>e instanceof r.FileItem))}})},onRowContextMenu(e,t,n){m({x:e,y:t}),f(n)},rowActions:t=>{const r=n.vaults.getItemVault(t),i=(null==r?void 0:r.isSharedVaultListing())&&n.vaultUsers.isCurrentUserReadonlyVaultMember(r);return(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[!i&&(0,e.jsx)(Tp,{item:t}),(0,e.jsx)(jp,{items:[t]})]})},selectionActions:t=>(0,e.jsx)(jp,{items:i.filter((e=>t.includes(e.uuid)))}),showSelectionActions:!0}),C=()=>{m(void 0),f(void 0)};return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ep,{table:S}),g&&p&&(0,e.jsxs)(On.Z,{title:"Options",open:!0,anchorPoint:g,togglePopover:()=>{m(void 0),f(void 0)},side:"bottom",align:"start",className:"py-2",children:[p instanceof r.FileItem&&(0,e.jsx)(qr.Z,{a11yLabel:"File context menu",children:(0,e.jsx)(Nd,{closeMenu:C,shouldShowRenameOption:!1,shouldShowAttachOption:!1,selectedFiles:[p]})}),p instanceof r.SNNote&&(0,e.jsx)(qr.Z,{className:"select-none",a11yLabel:"Note context menu",children:(0,e.jsx)(Qu,{notes:[p],closeMenu:C})})]})]})},Lp=t=>{let{addNewItem:n}=t;return(0,e.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-center",children:[(0,e.jsx)(Po.FilesIllustration,{className:"h-32 w-32"}),(0,e.jsx)("div",{className:"mb-2 mt-4 text-lg font-bold",children:"You don't have any files yet"}),(0,e.jsx)("div",{className:"mb-4 max-w-[35ch] text-center text-sm text-passive-0",children:"Files attached to your notes appear here. You can also upload files directly from this page."}),(0,e.jsx)(Ln.Z,{primary:!0,onClick:n,children:"Upload files"})]})},Qp=(0,Nn.Pi)((t=>{let{notesController:n,navigationController:i}=t;const{selectedNotes:o}=n,{selected:s}=i,a=o.some((e=>e.archived));return(0,e.jsxs)("div",{className:"flex w-full bg-contrast pb-safe-bottom",children:[(0,e.jsx)("button",{className:"flex-grow px-2 py-3 active:bg-passive-3",onClick:()=>n.togglePinSelectedNotes(),children:(0,e.jsx)(xn.Z,{type:"pin",className:"mx-auto text-info",size:"large"})}),(0,e.jsx)("button",{className:"flex-grow px-2 py-3 active:bg-passive-3",onClick:()=>n.toggleArchiveSelectedNotes().catch(console.error),children:(0,e.jsx)(xn.Z,{type:a?"unarchive":"archive",className:"mx-auto text-info",size:"large"})}),(0,e.jsx)("button",{className:"flex-grow px-2 py-3 active:bg-passive-3",onClick:()=>{const e=s&&(0,r.isSmartView)(s)&&s.uuid===r.SystemViewId.TrashedNotes,t=o.every((e=>e.trashed));e||t?n.deleteNotesPermanently().catch(console.error):n.setTrashSelectedNotes(!0).catch(console.error)},children:(0,e.jsx)(xn.Z,{type:"trash",className:"mx-auto text-info",size:"large"})}),(0,e.jsx)("button",{className:"flex-grow px-2 py-3 active:bg-passive-3",onClick:()=>n.setContextMenuOpen(!0),children:(0,e.jsx)(xn.Z,{type:"more",className:"mx-auto text-info",size:"large"})})]})})),Up=(0,He.forwardRef)(((t,n)=>{let{application:i,className:o,id:s,children:a,onPanelWidthLoad:l}=t;const{paneController:c,accountMenuController:u,filesController:d,itemListController:h,navigationController:p,noAccountWarningController:f,searchOptionsController:g,linkingController:m,notesController:y}=i,{setPaneLayout:v,panes:A}=(0,Zr.G)(),{selected:b,selectedAsTag:w}=p,{completedFullSync:S,createNewNote:C,optionsSubtitle:E,paginate:I,panelTitle:_,renderedItems:x,items:P,isCurrentNoteTemplate:k,isTableViewEnabled:B,selectedUuids:O,selectNextItem:N,selectPreviousItem:D}=h,j=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,He.useRef)(t);return(0,He.useEffect)((()=>{e&&("function"==typeof e?e(n.current):e.current=n.current)}),[e]),n}(n),{addDragTarget:T,removeDragTarget:M}=Gd();(0,He.useEffect)((()=>i.addWebEventObserver(((e,t)=>{if(e===r.WebAppEvent.PanelResized){const{panel:e,width:n}=t;e===pt.WB&&(w?p.setPanelWidthForTag(w,n):i.setPreference(r.PrefKey.NotesPanelWidth,n).catch(console.error))}}))),[i,p,w]),(0,He.useEffect)((()=>{var e;const t=(null===(e=null==b?void 0:b.preferences)||void 0===e?void 0:e.panelWidth)||i.getPreference(r.PrefKey.NotesPanelWidth);t&&l(t)}),[b,i,l]);const F=(0,He.useCallback)((async e=>{const t=p.selected;t&&(p.isInAnySystemView()||p.isInSmartView()?console.error("Trying to link uploaded files to smart view"):await m.linkItems(e,t))}),[p,m]);(0,He.useEffect)((()=>{const e=j.current,t=p.selected,n=!p.isInAnySystemView()&&!p.isInSmartView();return e&&n&&t&&T(e,{tooltipText:'Drop your files to upload and link them to tag "'.concat(t.title,'"'),callback:F}),()=>{e&&M(e)}}),[T,F,p,p.selected,M,j]);const R=null==b?void 0:b.iconString,U=(0,He.useMemo)((()=>p.isInFilesView),[p.isInFilesView]),V=(0,He.useCallback)((async()=>{if(U){if(!i.entitledToFiles)return void i.showPremiumModal(mp.Files);d.selectAndUploadNewFiles()}else await C(),v(mt.h.Editing)}),[U,i,d,C,v]),K=(0,et.ac)(et.Jj.sm),H=(U||B)&&!K;(0,He.useEffect)((()=>{const e=document.getElementById(kl.N.SearchBar);return i.keyboardService.addCommandHandlers([{command:L.kS,category:"General",description:"Create new note",onKeyDown:e=>{e.preventDefault(),V()}},{command:L.QE,category:"Notes list",description:"Go to next item",elements:[document.body,...e?[e]:[]],onKeyDown:()=>{e===document.activeElement&&(null==e||e.blur()),H||N()}},{command:L.um,category:"Notes list",description:"Go to previous item",element:document.body,onKeyDown:()=>{H||D()}},{command:L.RL,category:"General",description:"Toggle global search",onKeyDown:t=>{e&&(t.preventDefault(),e.focus())}},{command:L.ZC,onKeyDown:()=>{e&&e.blur()}},{command:L.hh,category:"General",description:"Select all items",onKeyDown:e=>{e.target.closest("#".concat(kl.N.ContentList))&&(e.preventDefault(),h.selectAll())}}])}),[V,i.keyboardService,C,h,N,D,H]);const G=(0,He.useMemo)((()=>i.keyboardService.keyboardShortcutForCommand(L.kS)),[i]),Y=(0,He.useMemo)((()=>U?"Upload file":"Create a new note in the selected tag (".concat(G&&(0,L.Ld)(G),")")),[U,G]),z=null==w?void 0:w.isDailyEntry,Z=(0,He.useCallback)((async(e,t)=>{await h.selectItemWithScrollHandling(e,{userTriggered:!0,scrollIntoView:!1===t,animated:!1})}),[h]);(0,He.useEffect)((()=>{var e;A.includes($e.n.Editor)||null===(e=j.current)||void 0===e||e.style.removeProperty("width")}),[O,j,k,x,A]);const[W]=oc("right",(()=>v(mt.h.TagSelection)),{requiresStartFromEdge:i.platform!==r.Platform.Android});return(0,e.jsxs)("div",{id:s,className:(0,Q.classNames)(o,"sn-component section h-full overflow-hidden pt-safe-top"),"aria-label":"Notes & Files",ref:(0,kr.l)([j,W]),children:[K&&!h.isMultipleSelectionMode&&(0,e.jsx)(vp,{onClick:V,label:Y,style:z?"danger":"info"}),(0,e.jsx)("div",{id:"items-title-bar",className:"section-title-bar border-b border-solid border-border",children:(0,e.jsxs)("div",{id:"items-title-bar-container",children:[b&&(0,e.jsx)(zh,{application:i,panelTitle:_,icon:R,addButtonLabel:Y,addNewItem:V,isFilesSmartView:U,isTableViewEnabled:B||U,optionsSubtitle:E,selectedTag:b,filesController:d,itemListController:h,paneController:c}),(!H||K)&&(0,e.jsx)(qh,{itemListController:h,searchOptionsController:g,hideOptions:H}),(0,e.jsx)(_h,{accountMenuController:u,noAccountWarningController:f})]})}),h.isMultipleSelectionMode&&(0,e.jsxs)("div",{className:"flex items-center border-b border-l-2 border-border border-l-transparent py-2.5 pr-4",children:[(0,e.jsx)("div",{className:"px-4",children:(0,e.jsx)($r.Z,{label:"Select all items",showOnHover:!0,showOnMobile:!0,children:(0,e.jsx)("button",{className:"ml-auto rounded border border-border p-1 hover:bg-contrast",onClick:()=>{h.selectAll()},children:(0,e.jsx)(xn.Z,{type:"select-all",size:"medium"})})})}),(0,e.jsxs)("div",{className:"text-base font-semibold md:text-sm",children:[h.selectedItemsCount," selected"]}),(0,e.jsx)($r.Z,{label:"Cancel multiple selection",showOnHover:!0,showOnMobile:!0,children:(0,e.jsx)("button",{className:"ml-auto rounded border border-border p-1 hover:bg-contrast",onClick:()=>{h.cancelMultipleSelection()},children:(0,e.jsx)(xn.Z,{type:"close",size:"medium"})})})]}),w&&z&&(0,e.jsx)(gp,{items:P,selectedTag:w,selectedUuids:O,itemListController:h,onSelect:Z}),z||!S||x.length?null:U?(0,e.jsx)(Lp,{addNewItem:V}):(0,e.jsx)("p",{className:"empty-items-list opacity-50",children:"No items."}),z||S||x.length?null:(0,e.jsx)("p",{className:"empty-items-list opacity-50",children:"Loading..."}),!z&&x.length?H?(0,e.jsx)(Rp,{items:P,application:i}):(0,e.jsx)(Eh,{items:x,selectedUuids:O,application:i,paginate:I}):null,K&&h.isMultipleSelectionMode&&(0,e.jsx)(Qp,{notesController:y,navigationController:p}),(0,e.jsx)("div",{className:"absolute bottom-0 h-safe-bottom w-full"}),a]})})),Vp=(0,Nn.Pi)(Up);var Kp,Hp;!function(e){e.Right="right",e.Left="left"}(Kp||(Kp={})),function(e){e.WidthOnly="WidthOnly",e.OffsetAndWidth="OffsetAndWidth"}(Hp||(Hp={}));class Gp extends He.Component{constructor(e){var n;super(e),n=this,this.resizerElementRef=(0,He.createRef)(),this.isAtMaxWidth=()=>Math.abs(Math.round(this.lastWidth+this.lastLeft)-Math.round(this.getParentRect().width))<5,this.finishSettingWidth=()=>{this.props.collapsable&&this.setState({collapsed:this.isCollapsed()})},this.setWidth=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];0===e&&(e=n.computeMaxWidth()),e<n.minWidth&&(e=n.minWidth);const r=n.getParentRect();e>r.width&&(e=r.width);const i=n.appFrame.width-n.props.panel.getBoundingClientRect().x;e>i&&(e=i);const o=Math.round(e+n.lastLeft)===Math.round(r.width);return n.props.modifyElementWidth&&(o?n.props.type===Hp.WidthOnly?n.props.panel.style.removeProperty("width"):n.props.panel.style.width="calc(100% - ".concat(n.lastLeft,"px)"):n.props.panel.style.width=e+"px"),n.lastWidth=e,t&&(n.finishSettingWidth(),n.props.resizeFinishCallback&&n.props.resizeFinishCallback(n.lastWidth,n.lastLeft,n.isAtMaxWidth(),n.isCollapsed())),n.props.widthEventCallback&&n.props.widthEventCallback(e),e},this.setLeft=e=>{this.props.panel.style.left=e+"px",this.lastLeft=e},this.onDblClick=()=>{var e,t;this.isCollapsed()?this.setWidth(this.widthBeforeLastDblClick||this.props.defaultWidth||0):(this.widthBeforeLastDblClick=this.lastWidth,this.setWidth(this.minWidth)),this.finishSettingWidth(),null===(t=(e=this.props).resizeFinishCallback)||void 0===t||t.call(e,this.lastWidth,this.lastLeft,this.isAtMaxWidth(),this.isCollapsed())},this.handleResize=()=>{const e=this.isAtMaxWidth()?this.computeMaxWidth():this.props.panel.scrollWidth;this.startWidth=e,this.lastWidth=e,this.handleWidthEvent(),this.finishSettingWidth()},this.onMouseDown=e=>{this.addInvisibleOverlay(),this.lastDownX=e.clientX,this.startWidth=this.props.panel.scrollWidth,this.startLeft=this.props.panel.offsetLeft,this.setState({pressed:!0})},this.onMouseUp=()=>{if(this.removeInvisibleOverlay(),!this.state.pressed)return;this.setState({pressed:!1});const e=this.isAtMaxWidth();this.props.resizeFinishCallback&&this.props.resizeFinishCallback(this.lastWidth,this.lastLeft,e,this.isCollapsed()),this.finishSettingWidth()},this.onMouseMove=e=>{this.state.pressed&&(e.preventDefault(),this.props.side===Kp.Left?this.handleLeftEvent(e):this.handleWidthEvent(e))},this.addInvisibleOverlay=()=>{if(this.overlay)return;const e=document.createElement("div");e.id="resizer-overlay",this.overlay=e,document.body.prepend(this.overlay)},this.removeInvisibleOverlay=()=>{this.overlay&&(this.overlay.remove(),this.overlay=void 0)},this.state={collapsed:!1,pressed:!1},this.minWidth=e.minWidth||5,this.startLeft=e.panel.offsetLeft,this.startWidth=e.panel.scrollWidth,this.lastDownX=0,this.lastLeft=e.panel.offsetLeft,this.lastWidth=e.panel.scrollWidth,this.widthBeforeLastDblClick=0,this.setWidth(this.props.width),this.setLeft(this.props.left),document.addEventListener("mouseup",this.onMouseUp),document.addEventListener("mousemove",this.onMouseMove),this.debouncedResizeHandler=(0,t.Ds)(this.handleResize,250),this.props.type===Hp.OffsetAndWidth&&window.addEventListener("resize",this.debouncedResizeHandler)}componentDidMount(){var e;null===(e=this.resizerElementRef.current)||void 0===e||e.addEventListener("dblclick",this.onDblClick)}componentDidUpdate(e){this.lastWidth=this.props.panel.scrollWidth,this.props.width!=e.width&&this.setWidth(this.props.width),this.props.left!==e.left&&(this.setLeft(this.props.left),this.setWidth(this.props.width));const t=this.isCollapsed();t!==this.state.collapsed&&this.setState({collapsed:t})}componentWillUnmount(){var e;null===(e=this.resizerElementRef.current)||void 0===e||e.removeEventListener("dblclick",this.onDblClick),document.removeEventListener("mouseup",this.onMouseUp),document.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("resize",this.debouncedResizeHandler)}get appFrame(){var e;return null===(e=document.getElementById("app"))||void 0===e?void 0:e.getBoundingClientRect()}getParentRect(){return this.props.panel.parentNode?this.props.panel.parentNode.getBoundingClientRect():new DOMRect}isCollapsed(){return this.lastWidth<=this.minWidth}handleWidthEvent(e){let t;e?t=e.clientX:(t=0,this.lastDownX=0);const n=t-this.lastDownX,r=this.startWidth+n,i=this.setWidth(r,!1);this.props.widthEventCallback&&this.props.widthEventCallback(i)}handleLeftEvent(e){const t=this.props.panel.getBoundingClientRect();let n=(e.clientX||t.x)-this.lastDownX,r=this.startLeft+n;r<0&&(r=0,n=-this.startLeft);const i=this.getParentRect();let o=this.startWidth-n;o<this.minWidth&&(o=this.minWidth),o>i.width&&(o=i.width),r+o>i.width&&(r=i.width-o),this.setLeft(r),this.setWidth(o,!1)}computeMaxWidth(){let e=this.getParentRect().width-this.props.left;return e<this.minWidth&&(e=this.minWidth),e}render(){return(0,e.jsx)("div",{className:(0,Q.classNames)("panel-resizer","absolute right-0 top-0 z-panel-resizer","hidden h-full w-[4px] cursor-col-resize border-y-0 bg-[color:var(--panel-resizer-background-color)] md:block",this.props.alwaysVisible||this.state.collapsed||this.state.pressed?" opacity-100":"opacity-0",this.props.hoverable&&"hover:opacity-100",this.props.side===Kp.Left&&"left-0 right-auto"),onMouseDown:this.onMouseDown,ref:this.resizerElementRef})}}const Yp=Gp,zp=(0,Nn.Pi)((t=>{let{view:n,tagsState:i,setEditingSmartView:o}=t;const s=(0,sr.I)(),[a,l]=(0,He.useState)(n.title||""),c=(0,He.useRef)(null),u=i.selected===n,d=i.editingTag===n;(0,He.useEffect)((()=>{l(n.title||"")}),[l,n]);const h=(0,He.useCallback)((async()=>{await i.setSelectedTag(n,"views",{userTriggered:!0})}),[i,n]),p=(0,He.useCallback)((()=>{i.save(n,a).catch(console.error),l(n.title)}),[i,n,a,l]),f=(0,He.useCallback)((e=>{const t=e.target.value;l(t)}),[l]),g=(0,He.useCallback)((e=>{var t;"Enter"===e.code&&(null===(t=c.current)||void 0===t||t.blur(),e.preventDefault())}),[c]);(0,He.useEffect)((()=>{var e;d&&(null===(e=c.current)||void 0===e||e.focus())}),[c,d]);const m=(0,He.useCallback)((()=>{o(n)}),[o,n]),y=(0,He.useCallback)((()=>{i.remove(n,!0).catch(console.error)}),[i,n]),v=((e,t)=>({[r.SystemViewId.StarredNotes]:"text-warning"}[e.uuid]||(t?"text-info":"text-neutral")))(n,u),[A,b]=(0,He.useState)(0);return(0,He.useEffect)((()=>{if(n.uuid===r.SystemViewId.Conflicts)return s.items.streamItems(r.ContentType.TYPES.Note,(()=>{b(s.items.numberOfNotesWithConflicts())}))}),[s,n]),n.uuid!==r.SystemViewId.Conflicts||A?(0,e.jsxs)("button",{tabIndex:pt.HF,className:(0,Q.classNames)("tag group px-3.5 py-0.5 focus-visible:!shadow-inner md:py-0",u&&"selected",!1),onClick:h,onContextMenu:e=>{e.preventDefault(),e.stopPropagation(),(0,r.isSystemView)(n)||m()},style:{paddingLeft:"".concat(14,"px")},children:[(0,e.jsxs)("div",{className:"tag-info",children:[(0,e.jsx)("div",{className:"tag-icon mr-2",children:(0,e.jsx)(xn.Z,{type:n.iconString,className:(0,Q.classNames)(v,"group-hover:text-text")})}),d?(0,e.jsx)("input",{className:"title editing text-mobile-navigation-list-item lg:text-navigation-list-item",id:"react-tag-".concat(n.uuid),onBlur:p,onInput:f,value:a,onKeyUp:g,spellCheck:!1,ref:c}):(0,e.jsx)("div",{className:"title overflow-hidden text-left text-mobile-navigation-list-item lg:text-navigation-list-item",id:"react-tag-".concat(n.uuid),children:a}),(0,e.jsxs)("div",{className:"count text-base lg:text-sm",children:[n.uuid===r.SystemViewId.AllNotes&&i.allNotesCount,n.uuid===r.SystemViewId.Files&&i.allFilesCount,n.uuid===r.SystemViewId.Conflicts&&A]})]}),!(0,r.isSystemView)(n)&&(0,e.jsxs)("div",{className:"meta",children:[n.conflictOf&&(0,e.jsx)("div",{className:"-mt-1 text-[0.625rem] font-bold text-danger",children:"Conflicted Copy"}),u&&(0,e.jsxs)("div",{className:"menu",children:[(0,e.jsx)("a",{className:"item",onClick:m,children:"Edit"}),(0,e.jsx)("a",{className:"item",onClick:y,children:"Delete"})]})]})]}):null})),Zp=(0,Nn.Pi)((t=>{let{navigationController:n,featuresController:r,setEditingSmartView:i}=t;const o=n.smartViews,[s,a]=(0,He.useState)(null);return(0,qu.Z)(s,{initialFocus:0,shouldAutoFocus:!1,shouldWrapAround:!1,resetLastFocusedOnBlur:!0}),0===o.length&&n.isSearching?(0,e.jsx)("div",{className:"px-4 py-1 text-base opacity-60 lg:text-sm",children:"No smart views found. Try a different search."}):(0,e.jsx)("div",{ref:a,children:o.map((t=>(0,e.jsx)(zp,{view:t,tagsState:n,features:r,setEditingSmartView:i},t.uuid)))})})),Wp=(0,Nn.Pi)((t=>{let{application:n,navigationController:r,featuresController:i}=t;const o=Qr(),s=(0,He.useMemo)((()=>new cs(n)),[n]),a=(0,He.useMemo)((()=>new ps(n)),[n]),l=(0,He.useCallback)((()=>{i.hasSmartViews?s.setIsAddingSmartView(!0):o.activate(pt.t2)}),[s,o,i.hasSmartViews]);return(0,e.jsxs)("section",{children:[(0,e.jsx)("div",{className:"section-title-bar",children:(0,e.jsxs)("div",{className:"section-title-bar-header",children:[(0,e.jsx)("div",{className:"title text-base md:text-sm",children:(0,e.jsx)("span",{className:"font-bold",children:"Views"})}),!r.isSearching&&(0,e.jsx)(Na.Z,{focusable:!0,icon:"add",title:"Create a new smart view",className:"p-0 text-neutral",onClick:l})]})}),(0,e.jsx)(Zp,{navigationController:r,featuresController:i,setEditingSmartView:a.setView}),(0,e.jsx)(Fr,{isOpen:!!a.view,close:a.closeDialog,children:(0,e.jsx)(us,{controller:a,platform:n.platform})}),(0,e.jsx)(Fr,{isOpen:s.isAddingSmartView,close:s.closeModal,children:(0,e.jsx)(is,{controller:s,platform:n.platform})})]})})),qp=(0,Nn.Pi)((t=>{let{tagsState:n}=t;const[r,i]=(0,He.useState)(!1),o=(0,He.useCallback)((()=>{i(!1)}),[]),s=(0,He.useCallback)((e=>{e.dataTransfer.types.includes(hh)&&(e.preventDefault(),i(!0))}),[]),a=(0,He.useCallback)((e=>{i(!1);const t=e.dataTransfer.getData(hh);t&&t&&n.assignParent(t,void 0)}),[n]);return(0,e.jsxs)("div",{className:(0,Q.classNames)("root-drop",r&&"active is-drag-over"),onDragExit:o,onDragOver:s,onDragLeave:o,onDrop:a,children:[(0,e.jsx)(xn.Z,{className:"text-neutral",type:"link-off"}),(0,e.jsxs)("p",{className:"content",children:["Move the tag here to ",(0,e.jsx)("br",{}),"remove it from its folder."]})]})})),Jp=(0,Nn.Pi)((t=>{let{tag:n,type:i,features:o,navigationController:s,level:a,onContextMenu:l,linkingController:c}=t;const u=(0,sr.I)(),[d,h]=(0,He.useState)(n.title||""),[p,f]=(0,He.useState)(""),g=(0,He.useRef)(null),m=(0,He.useRef)(null),y=(0,He.useRef)(null),v=s.contextMenuTag===n&&s.contextMenuOpen&&s.contextMenuTagSection===i,A=s.selected===n&&s.selectedLocation===i,b=s.editingTag===n&&s.selectedLocation===i,w=s.addingSubtagTo===n&&(s.contextMenuTag===n?s.contextMenuTagSection===i:s.selectedLocation===i),S=(0,_.Fl)((()=>s.getNotesCount(n))),C=(0,_.Fl)((()=>s.getChildren(n))).get(),E=C.length>0,I=o.hasFolders,x=Qr(),[P,k]=(0,He.useState)(n.expanded),[B,O]=(0,He.useState)(E),[N,D]=(0,He.useState)(!1);(0,He.useEffect)((()=>{!B&&E&&k(!0),O(E)}),[B,E]),(0,He.useEffect)((()=>{h(n.title||"")}),[h,n]);const j=(0,He.useCallback)((e=>{E&&(k(e),s.isSearching||s.setExpanded(n,e))}),[E,s,n]),T=(0,He.useCallback)((e=>{null==e||e.stopPropagation(),j(!P)}),[P,j]);(0,He.useEffect)((()=>{s.isSearching||k(n.expanded)}),[s.isSearching,n]);const M=(0,He.useCallback)((async()=>{await s.setSelectedTag(n,i,{userTriggered:!0})}),[s,n,i]),F=(0,He.useCallback)((()=>{s.save(n,d).catch(console.error),h(n.title)}),[s,n,d,h]),U=(0,He.useCallback)((e=>{const t=e.target.value;h(t)}),[h]),K=(0,He.useCallback)((e=>{var t;e.key===L.u8.Enter&&(null===(t=g.current)||void 0===t||t.blur(),e.preventDefault())}),[g]);(0,He.useEffect)((()=>{var e;b&&(null===(e=g.current)||void 0===e||e.focus())}),[g,b]);const H=(0,He.useCallback)((e=>{const t=e.target.value;f(t)}),[]),G=(0,He.useCallback)((()=>{s.createSubtagAndAssignParent(n,p).catch(console.error),f("")}),[p,n,s]),Y=(0,He.useCallback)((e=>{var t;e.key===L.u8.Enter&&(e.preventDefault(),null===(t=m.current)||void 0===t||t.blur())}),[m]);(0,He.useEffect)((()=>{var e;w&&(null===(e=m.current)||void 0===e||e.focus())}),[m,w]);const z=(0,He.useCallback)((e=>{var t;if(e.preventDefault(),e.stopPropagation(),!y.current)return;const r=s.contextMenuOpen,o=null===(t=y.current)||void 0===t?void 0:t.getBoundingClientRect();r?s.setContextMenuOpen(!1):l(n,i,o.right,o.top)}),[s,l,n,i]),Z=(0,He.useRef)(null),{addDragTarget:W,removeDragTarget:q}=Gd();(0,He.useEffect)((()=>{const e=Z.current;return e&&W(e,{tooltipText:'Drop your files to upload and link them to tag "'.concat(n.title,'"'),async callback(e){await c.linkItems(e,n)}}),()=>{e&&q(e)}}),[W,c,q,n]),V(R.NavigationList,"Rendering TagsListItem");const J=(0,He.useCallback)((e=>{e.dataTransfer.setData(hh,n.uuid)}),[n.uuid]),X=(0,He.useCallback)((e=>{(e.dataTransfer.types.includes(hh)||e.dataTransfer.types.includes(ph))&&(e.preventDefault(),D(!0))}),[]),$=(0,He.useCallback)((()=>{D(!1)}),[]),ee=(0,He.useCallback)((e=>{(e.dataTransfer.types.includes(hh)||e.dataTransfer.types.includes(ph))&&e.preventDefault()}),[]),te=(0,He.useCallback)((async e=>{D(!1);const t=e.dataTransfer.getData(hh),i=e.dataTransfer.getData(ph);if(t){if(!s.isValidTagParent(n,{uuid:t}))return;return I?void s.assignParent(t,n.uuid):void x.activate(pt.Uj)}if(i){const e=s.selected,t=e instanceof r.SNTag&&e.uuid!==n.uuid,o=u.items.findSureItem(i);return await c.linkItems(o,n),void(t&&await c.unlinkItems(o,e))}}),[u.items,I,c,s,x,n]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{role:"button",tabIndex:pt.HF,className:(0,Q.classNames)("tag group px-3.5 py-0.5 focus-visible:!shadow-inner md:py-0",(A||v)&&"selected",N&&"is-drag-over"),onClick:M,onKeyDown:e=>{e.key===L.u8.Enter||e.key===L.u8.Space?M().catch(console.error):e.key===L.u8.Left?j(!1):e.key===L.u8.Right&&j(!0)},ref:Z,style:{paddingLeft:"".concat(21*a+14,"px")},onContextMenu:e=>{e.preventDefault(),l(n,i,e.clientX,e.clientY)},draggable:!s.isSearching,onDragStart:J,onDragEnter:X,onDragExit:$,onDragOver:ee,onDragLeave:$,onDrop:te,children:[(0,e.jsxs)("div",{className:"tag-info",title:d,children:[(0,e.jsx)("div",{onClick:M,className:"tag-icon draggable mr-2",children:(0,e.jsx)(xn.Z,{type:n.iconString,className:(0,Q.classNames)("cursor-pointer group-hover:text-text",A?"text-info":"text-neutral")})}),b&&(0,e.jsx)("input",{className:"title editing overflow-hidden text-mobile-navigation-list-item focus:shadow-none focus:outline-none lg:text-navigation-list-item",id:"react-tag-".concat(n.uuid,"-").concat(i),onBlur:F,onInput:U,value:d,onKeyDown:K,spellCheck:!1,ref:g}),!b&&(0,e.jsx)(e.Fragment,{children:(0,e.jsx)("div",{className:"title overflow-hidden text-left text-mobile-navigation-list-item focus:shadow-none focus:outline-none lg:text-navigation-list-item",id:"react-tag-".concat(n.uuid,"-").concat(i),children:d})}),(0,e.jsxs)("div",{className:"flex items-center",children:[A&&(0,e.jsx)("a",{role:"button",className:"mr-2 cursor-pointer border-0 bg-transparent hover:bg-contrast focus:shadow-inner",onClick:z,onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},ref:y,children:(0,e.jsx)(xn.Z,{type:"more",className:"text-neutral"})}),E&&(0,e.jsx)("a",{role:"button",className:"focus:shadow-inner ".concat(P?"cursor-n-resize":"cursor-s-resize"," ").concat(P?"opened":"closed"," "),onClick:T,children:(0,e.jsx)(xn.Z,{className:"text-neutral",size:"large",type:P?"menu-arrow-down-alt":"menu-arrow-right"})}),(0,e.jsx)("div",{onClick:E?T:void 0,className:"count text-base lg:text-sm ".concat(E?P?"cursor-n-resize":"cursor-s-resize":""),children:S.get()})]})]}),n.conflictOf&&(0,e.jsx)("div",{className:"-mt-1 text-[0.625rem] font-bold text-danger",children:"Conflicted Copy"})]}),w&&(0,e.jsx)("div",{className:"tag overflow-hidden",style:{paddingLeft:"".concat(21*(a+1)+14,"px")},children:(0,e.jsxs)("div",{className:"tag-info",children:[(0,e.jsx)("div",{className:"flex h-full min-w-[22px] items-center border-0 bg-transparent p-0"}),(0,e.jsx)("div",{className:"tag-icon mr-1",children:(0,e.jsx)(xn.Z,{type:"hashtag",className:"mr-1 text-neutral"})}),(0,e.jsx)("input",{className:"title w-full text-mobile-navigation-list-item focus:shadow-none focus:outline-none lg:text-navigation-list-item",type:"text",ref:m,onBlur:G,onKeyDown:Y,value:p,onInput:H})]})}),P&&(0,e.jsx)(e.Fragment,{children:C.map((t=>(0,e.jsx)(Jp,{level:a+1,tag:t,type:i,navigationController:s,features:o,linkingController:c,onContextMenu:l},t.uuid)))})]})}));Jp.displayName="TagsListItem";const Xp=(0,Nn.Pi)((t=>{let{type:n}=t;const r=(0,sr.I)(),i="all"===n?r.navigationController.allLocalRootTags:r.navigationController.starredTags,o=(0,He.useCallback)(((e,t)=>{r.navigationController.setContextMenuClickLocation({x:e,y:t}),r.navigationController.setContextMenuOpen(!0)}),[r]),s=(0,He.useCallback)(((e,t,n,i)=>{r.navigationController.setContextMenuTag(e,t),o(n,i)}),[r,o]),[a,l]=(0,He.useState)(null);return(0,qu.Z)(a,{initialFocus:0,shouldAutoFocus:!1,shouldWrapAround:!1,resetLastFocusedOnBlur:!0}),0===i.length?(0,e.jsx)("div",{className:"px-4 text-base opacity-50 lg:text-sm",children:r.navigationController.isSearching?"No tags found. Try a different search.":"No tags or folders. Create one using the add button above."}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{ref:l,children:i.map((t=>(0,e.jsx)(Jp,{level:0,tag:t,type:n,navigationController:r.navigationController,features:r.featuresController,linkingController:r.linkingController,onContextMenu:s},t.uuid)))}),"all"===n&&(0,e.jsx)(qp,{tagsState:r.navigationController})]})}));var $p=s(86429);const ef=(0,Nn.Pi)((t=>{let{tags:n}=t;const r=(0,Bn.o)(),i=(0,He.useMemo)((()=>(0,L.Ld)(r.keyboardShortcutForCommand(L.PV))),[r]);return(0,e.jsx)(Na.Z,{focusable:!0,icon:"add",title:"Create a new tag (".concat(i,")"),className:"p-0 text-neutral",onClick:()=>n.createNewTemplate()})})),tf=(0,Nn.Pi)((t=>{let{features:n,hasMigration:r,onClickMigration:i}=t;const o=n.hasFolders,s=Qr(),a=(0,He.useCallback)((()=>{s.activate(pt.Uj)}),[s]);return o?(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)("div",{className:"title text-base md:text-sm",children:[(0,e.jsx)("span",{className:"font-bold",children:"Folders"}),r&&(0,e.jsx)("label",{className:"ml-1 cursor-pointer font-bold text-info",onClick:i,children:"Migration Available"})]})}):(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)("div",{className:"title text-base md:text-sm",children:[(0,e.jsx)("span",{className:"font-bold",children:"Tags"}),(0,e.jsx)($r.Z,{label:pt.l9,children:(0,e.jsx)("label",{className:"ml-1 cursor-pointer font-bold text-passive-2",onClick:a,children:"Folders"})})]})})})),nf=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),[n,r]=(0,He.useState)(!1),i=(0,He.useCallback)((()=>{r(t.items.hasTagsNeedingFoldersMigration())}),[t]);(0,He.useEffect)((()=>{const e=t.addEventObserver((async e=>{[$p.ApplicationEvent.CompletedInitialSync,$p.ApplicationEvent.SignedIn].includes(e)&&i()}));return()=>{e()}}),[t,i]);const o=(0,He.useCallback)((async()=>{await t.alerts.confirm('<i>Introducing native, built-in nested tags without requiring the legacy Folders extension.</i><br/></br>  To get started, we\'ll need to migrate any tags containing a dot character to the new system.<br/></br>  This migration will convert any tags with dots appearing in their name into a natural hierarchy that is compatible with the new nested tags feature. Running this migration will remove any "." characters appearing in tag names.',"New: Folders to Nested Tags","Run Migration")&&t.mutator.migrateTagsToFolders().then((()=>{t.sync.sync(),i()})).catch(console.error)}),[t,i]);return(0,e.jsxs)(e.Fragment,{children:[t.navigationController.starredTags.length>0&&(0,e.jsxs)("section",{children:[(0,e.jsx)("div",{className:"section-title-bar",children:(0,e.jsx)("div",{className:"section-title-bar-header",children:(0,e.jsx)("div",{className:"title text-base md:text-sm",children:(0,e.jsx)("span",{className:"font-bold",children:"Favorites"})})})}),(0,e.jsx)(Xp,{type:"favorites"})]}),(0,e.jsxs)("section",{children:[(0,e.jsx)("div",{className:"section-title-bar",children:(0,e.jsxs)("div",{className:"section-title-bar-header",children:[(0,e.jsx)(tf,{features:t.featuresController,hasMigration:n,onClickMigration:o}),!t.navigationController.isSearching&&(0,e.jsx)(ef,{tags:t.navigationController,features:t.featuresController})]})}),(0,e.jsx)(Xp,{type:"all"})]})]})})),rf=(0,Nn.Pi)((t=>{let{navigationController:n}=t;const{searchQuery:i,setSearchQuery:o}=n,s=(0,He.useRef)(null),a=(0,He.useCallback)((()=>{var e;o(""),null===(e=s.current)||void 0===e||e.focus()}),[o]),[l,c]=(0,He.useState)(!1),u=(0,He.useRef)(null);return(0,He.useEffect)((()=>{const e=u.current;if(!e)return;const t=e.parentElement;if(!t)return;const n=()=>{const{scrollTop:e}=t;c(e>0)};return t.addEventListener("scroll",n),()=>{t.removeEventListener("scroll",n)}}),[]),(0,e.jsx)("div",{className:(0,r.classNames)("sticky top-0 bg-[inherit] px-4 pt-4",l&&"after:absolute after:left-0 after:top-full after:-z-[1] after:block after:h-4 after:w-full after:border-b after:border-border after:bg-[inherit]"),role:"search",ref:u,children:(0,e.jsx)(ui.Z,{ref:s,autocomplete:!1,className:{container:"!bg-default px-1",input:"text-base placeholder:text-passive-0 lg:text-sm"},placeholder:"Search tags...",value:i,onChange:o,left:[(0,e.jsx)(xn.Z,{type:"search",className:"mr-1 h-4.5 w-4.5 flex-shrink-0 text-passive-1"})],right:[i&&(0,e.jsx)(Gh,{onClick:a})],roundedFull:!0})})})),of=(0,He.forwardRef)(((t,n)=>{let{application:i,className:o,children:s,id:a}=t;const{setPaneLayout:l}=(0,Zr.G)(),[c,u]=(0,He.useState)((()=>i.hasPasscode()));(0,He.useEffect)((()=>i.addEventObserver((async()=>{u(i.hasPasscode())}),r.ApplicationEvent.KeyStatusChanged)),[i]),(0,He.useEffect)((()=>i.addWebEventObserver(((e,t)=>{if(e===r.WebAppEvent.PanelResized){const{panel:e,width:n}=t;e===pt.xi&&i.setPreference(r.PrefKey.TagsPanelWidth,n).catch(console.error)}}))),[i]);const[d]=oc("left",(e=>{l(mt.h.ItemSelection),e.style.left="0"}),{gesture:"swipe"}),{hasBottomInset:h}=Rn();return(0,e.jsxs)("div",{id:a,className:(0,Q.classNames)(o,"sn-component section pb-[50px] md:pb-0","h-full max-h-full overflow-hidden pt-safe-top md:h-full md:max-h-full md:min-h-0"),ref:(0,kr.l)([n,d]),children:[(0,e.jsxs)("div",{id:"navigation-content",className:"flex-grow overflow-y-auto overflow-x-hidden",children:[(0,e.jsx)(rf,{navigationController:i.navigationController}),(0,e.jsx)(Wp,{application:i,featuresController:i.featuresController,navigationController:i.navigationController}),(0,e.jsx)(nf,{})]}),(0,e.jsxs)("div",{className:(0,Q.classNames)("fixed bottom-0 flex min-h-[50px] w-full items-center border-t border-border bg-contrast","px-3.5 pt-2.5 md:hidden",h?"pb-safe-bottom":"pb-2.5"),children:[(0,e.jsx)(ei.Z,{className:"mr-auto bg-default",onClick:()=>{l(mt.h.ItemSelection)},label:"Go to items list",icon:"chevron-left"}),(0,e.jsx)(oi,{application:i,subscriptionContoller:i.subscriptionController,featuresController:i.featuresController}),(0,e.jsx)(ei.Z,{className:"ml-2.5 bg-default",onClick:()=>{i.accountMenuController.toggleShow()},label:"Go to account menu",icon:"account-circle"}),c&&(0,e.jsx)(ei.Z,{id:"lock-item",onClick:()=>i.lock(),label:"Locks application and wipes unencrypted data from memory.",className:"ml-2.5 bg-default",icon:"lock-filled"}),(0,e.jsx)(ai,{openPreferences:()=>i.preferencesController.openPreferences()}),(0,e.jsx)(ti,{application:i,isMobileNavigation:!0}),i.featuresController.isVaultsEnabled()&&(0,e.jsx)(Fi,{isMobileNavigation:!0})]}),s]})})),sf=(0,Nn.Pi)(of),af=(0,Nn.Pi)((t=>{let{notesController:n,onClick:r,onClickPreprocessing:i,onButtonBlur:o}=t;const[s,a]=(0,He.useState)(!1),l=(0,He.useRef)(null),c=(0,He.useCallback)((async()=>{const e=!s;e&&i&&await i(),a(e),r&&r()}),[s,i,r]),[u,d]=(0,He.useState)(!1),h=(0,He.useCallback)((e=>{d(e)}),[]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ei.Z,{id:kl.N.NoteOptionsButton,label:"Note options menu",onClick:c,onBlur:o,ref:l,icon:"more"}),(0,e.jsx)(On.Z,{title:"Note options",disableClickOutside:u,togglePopover:c,anchorElement:l,open:s,className:"select-none",children:(0,e.jsx)(qr.Z,{a11yLabel:"Note options menu",children:(0,e.jsx)(Qu,{notes:n.selectedNotes,requestDisableClickOutside:h,closeMenu:c})})})]})})),lf=(0,Nn.Pi)((t=>{let{className:n="",notesController:r,onClickPreprocessing:i}=t;const o=r.selectedNotes.some((e=>e.pinned)),s=(0,He.useCallback)((async()=>{i&&await i(),r.togglePinSelectedNotes()}),[i,r]),a=(0,Bn.o)(),l=(0,He.useMemo)((()=>(0,L.Ld)(a.keyboardShortcutForCommand(L.Ib))),[a]),c=o?"Unpin note (".concat(l,")"):"Pin note (".concat(l,")");return(0,e.jsxs)("button",{className:(0,Q.classNames)("sn-icon-button flex h-10 min-w-10 cursor-pointer items-center justify-center","focus:bg-contras rounded-full border border-solid border-border text-neutral hover:bg-contrast","md:h-8 md:min-w-8 ".concat(o?"toggled":""),n),onClick:s,title:c,"aria-label":c,children:[(0,e.jsx)(jl.T,{children:"Pin selected notes"}),(0,e.jsx)(xn.Z,{type:"pin",className:"block"})]})})),cf=t=>{let{application:n,notes:i,setDisableClickOutside:o}=t;const s=Qr(),[a,l]=(0,He.useState)(),[c,u]=(0,He.useState)([]),d=(0,He.useMemo)((()=>i.some((e=>e.locked))),[i]),h=(0,He.useMemo)((()=>Ac(n)),[n]),p=(0,He.useCallback)((async(e,t)=>{e.isComponent&&e.asComponent.conflictOf&&n.changeAndSaveItem.execute(e.asComponent,(e=>{e.conflictOf=void 0})),await n.changeAndSaveItem.execute(t,(t=>{const n=t;n.noteType=e.noteType,n.editorIdentifier=e.featureIdentifier}))}),[n]),f=(0,He.useCallback)((async e=>{if(!e.isEntitled)return e.uiFeature.featureIdentifier===r.NativeFeatureIdentifier.TYPES.SuperEditor?void s.showSuperDemo():void s.activate(e.uiFeature.displayName);if(d)n.alerts.alert(ht.L0);else{if(e.uiFeature.noteType===r.NoteType.Super)return o(!0),l(e),void u(i);if(!i.some((t=>{const r=n.componentManager.editorForNote(t);return n.componentManager.doesEditorChangeRequireAlert(r,e.uiFeature)}))||await n.componentManager.showEditorChangeAlert())for(const t of i)p(e.uiFeature,t)}}),[n.alerts,n.componentManager,d,i,s,p,o]),g=h.filter((e=>e.items&&e.items.length)),m=(null==a?void 0:a.uiFeature.noteType)===r.NoteType.Super&&c.length>0,y=(0,He.useCallback)((()=>{const e=c.slice(1);if(0===e.length)return l(void 0),u([]),void o(!1);u(e)}),[c,o]),v=(0,He.useCallback)((()=>{a&&(p(a.uiFeature,c[0]),y())}),[y,c,a,p]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(qr.Z,{a11yLabel:"Change note type",children:g.map((t=>(0,e.jsx)(Jr.Z,{children:t.items.map((n=>(0,e.jsx)(ci.Z,{onClick:()=>{f(n).catch(console.error)},className:"flex-row-reversed py-2",children:(0,e.jsxs)("div",{className:"flex flex-grow items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex items-center",children:[t.icon&&(0,e.jsx)(xn.Z,{type:t.icon,className:"mr-2 ".concat(t.iconClassName)}),n.uiFeature.displayName,n.isLabs&&(0,e.jsx)(Ge.DR,{className:"px-1.5 py-0.5",style:"success",children:"Labs"})]}),!n.isEntitled&&(0,e.jsx)(xn.Z,{type:Mn._,className:Mn.K})]})},n.uiFeature.uniqueIdentifier.value)))},(e=>e.title.toLowerCase().replace(/\s/,"-"))(t))))}),(0,e.jsx)(Fr,{isOpen:m,close:y,children:c[0]&&(0,e.jsx)(Wc,{note:c[0],application:n,onComplete:v,closeDialog:y})})]})},uf=t=>{let{application:n,notesController:r}=t;const i=(0,He.useRef)(null),[o,s]=(0,He.useState)(!1),a=()=>s((e=>!e)),[l,c]=(0,He.useState)(!1);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ei.Z,{label:"Change note type",onClick:a,ref:i,icon:"plain-text"}),(0,e.jsx)(On.Z,{title:"Change note type",togglePopover:a,disableClickOutside:l,anchorElement:i,open:o,className:"md:pb-1",children:(0,e.jsx)(cf,{application:n,notes:r.selectedNotes,setDisableClickOutside:c})})]})},df=(0,Nn.Pi)((t=>{let{application:n}=t;const{notesController:r,itemListController:i}=n,o=r.selectedNotesCount,s=(0,He.useCallback)((()=>{i.cancelMultipleSelection()}),[i]);return(0,e.jsxs)("div",{className:"flex h-full flex-col items-center",children:[(0,e.jsxs)("div",{className:"flex w-full items-center justify-between p-4",children:[(0,e.jsxs)("h1",{className:"m-0 text-lg font-bold",children:[o," selected notes"]}),(0,e.jsxs)("div",{className:"flex",children:[(0,e.jsx)("div",{className:"mr-3",children:(0,e.jsx)(uf,{application:n,notesController:r})}),(0,e.jsx)("div",{className:"mr-3",children:(0,e.jsx)(lf,{notesController:r})}),(0,e.jsx)(af,{notesController:r})]})]}),(0,e.jsxs)("div",{className:"flex min-h-full w-full max-w-md flex-grow flex-col items-center justify-center md:min-h-0",children:[(0,e.jsx)(Po.IlNotesIcon,{className:"block"}),(0,e.jsxs)("h2",{className:"m-0 mt-4 text-center text-lg font-bold",children:[o," selected notes"]}),(0,e.jsx)("p",{className:"mt-2 max-w-60 text-center text-sm",children:"Actions will be performed on all selected notes."}),(0,e.jsx)(Ln.Z,{className:"mt-2.5",onClick:s,children:"Cancel multiple selection"})]})]})})),hf=(0,Nn.Pi)((t=>{let{itemListController:n}=t;const[r,i]=(0,He.useState)(!1),o=(0,He.useRef)(null),s=(0,He.useCallback)((()=>i((e=>!e))),[]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ei.Z,{label:"File options menu",onClick:s,ref:o,icon:"more"}),(0,e.jsx)(On.Z,{title:"File options",togglePopover:s,anchorElement:o,open:r,className:"md:pb-2",children:(0,e.jsx)(qr.Z,{a11yLabel:"File options panel",children:(0,e.jsx)(Nd,{selectedFiles:n.selectedFiles,closeMenu:()=>{i(!1)},shouldShowAttachOption:!1,shouldShowRenameOption:!1})})})]})})),pf=(0,Nn.Pi)((t=>{let{itemListController:n}=t;const r=n.selectedFilesCount,i=(0,He.useCallback)((()=>{n.cancelMultipleSelection()}),[n]);return(0,e.jsxs)("div",{className:"flex h-full flex-col items-center",children:[(0,e.jsxs)("div",{className:"flex w-full items-center justify-between p-4",children:[(0,e.jsxs)("h1",{className:"m-0 text-lg font-bold",children:[r," selected files"]}),(0,e.jsx)("div",{children:(0,e.jsx)(hf,{itemListController:n})})]}),(0,e.jsxs)("div",{className:"flex min-h-full w-full max-w-md flex-grow flex-col items-center justify-center",children:[(0,e.jsx)(Po.IlNotesIcon,{className:"block"}),(0,e.jsxs)("h2",{className:"m-0 mt-4 text-center text-lg font-bold",children:[r," selected files"]}),(0,e.jsx)("p",{className:"mt-2 max-w-60 text-center text-sm",children:"Actions will be performed on all selected files."}),(0,e.jsx)(Ln.Z,{className:"mt-2.5",onClick:i,children:"Cancel multiple selection"})]})]})})),ff=()=>{const{panes:t,replacePanes:n,setPaneLayout:i}=(0,Zr.G)(),{isTablet:o,isTabletOrMobile:s,isMobile:a}=Xd(),l=t.includes($e.n.Items),c=o&&!l?"chevron-right":"chevron-left",u=o?l?"Hide items list":"Show items list":"Go to items list";return(0,e.jsx)(ei.Z,{className:(0,r.classNames)(s?"flex":"hidden","mr-3"),onClick:()=>{a?i(mt.h.ItemSelection):l?n([$e.n.Editor]):i(mt.h.ItemSelection)},label:u,icon:c,iconClassName:"h-6 w-6"})},gf=t=>{let{showAccountMenu:n,onViewItem:r,hasProtectionSources:i,itemType:o}=t;const s=i?"Authenticate to view this ".concat(o,"."):"Add a passcode or create an account to require authentication to view this ".concat(o,".");return(0,e.jsx)("div",{"aria-label":"Protected overlay",className:"section editor sn-component p-5",children:(0,e.jsxs)("div",{className:"flex h-full flex-grow flex-col justify-center md:flex-row md:items-center",children:[(0,e.jsx)("div",{className:"mb-auto p-4 md:hidden",children:(0,e.jsx)(ff,{})}),(0,e.jsxs)("div",{className:"mb-auto flex max-w-md flex-col items-center justify-center text-center md:mb-0",children:[(0,e.jsxs)("h1",{className:"m-0 w-full text-2xl font-bold",children:["This ",o," is protected"]}),(0,e.jsx)("p",{className:"mt-2 w-full text-lg",children:s}),(0,e.jsxs)("div",{className:"mt-4 flex gap-3",children:[!i&&(0,e.jsx)(Ln.Z,{primary:!0,small:!0,onClick:()=>{n()},children:"Open account menu"}),(0,e.jsx)(Ln.Z,{small:!0,onClick:r,children:i?"Authenticate":"View ".concat(o)})]})]})]})})},mf=(0,Nn.Pi)((t=>{let{linkingController:n,onClick:r,onClickPreprocessing:i}=t;const{activeItem:o,isLinkingPanelOpen:s,setIsLinkingPanelOpen:a}=n,l=(0,He.useRef)(null),c=(0,He.useCallback)((async()=>{const e=!s;e&&i&&await i(),a(e),r&&r()}),[s,r,i,a]);return o?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ei.Z,{label:"Linked items panel",onClick:c,ref:l,icon:"link"}),(0,e.jsx)(On.Z,{title:"Linked items",togglePopover:c,anchorElement:l,open:s,className:"pb-2",forceFullHeightOnMobile:!0,children:(0,e.jsx)(Bp,{item:o})})]}):null})),yf=(0,Nn.Pi)((t=>{let{application:n,file:i}=t;const{vault:o}=(0,Ad.j)(i),[s,a]=(0,He.useState)(!1);(0,He.useEffect)((()=>{o&&a(n.vaultUsers.isCurrentUserReadonlyVaultMember(o))}),[n.vaultUsers,o]),(0,He.useEffect)((()=>n.vaultUsers.addEventObserver(((e,t)=>{var i;if(e===r.VaultUserServiceEvent.InvalidatedUserCacheForVault){if(t!==(null===(i=null==o?void 0:o.sharing)||void 0===i?void 0:i.sharedVaultUuid))return;a(!!o&&n.vaultUsers.isCurrentUserReadonlyVaultMember(o))}}))),[n.vaultUsers,o]);const l=(0,He.useRef)(),c=(0,He.useRef)(null),[u,d]=(0,He.useState)(!1),h=()=>{d((e=>!e))},p=(0,He.useCallback)((async e=>{l.current&&clearTimeout(l.current);const t=n.sessions.isSignedOut()?100:350;l.current=window.setTimeout((async()=>{await n.mutator.renameFile(i,e.target.value),n.sync.sync()}),t)}),[n,i]),f=(0,He.useRef)(null),{addDragTarget:g,removeDragTarget:m}=Gd();return(0,He.useEffect)((()=>{const e=f.current;return e&&g(e,{tooltipText:"Drop your files to upload and link them to the current file",async callback(e){await n.linkingController.linkItems(e,i)}}),()=>{e&&m(e)}}),[g,i,m,n.linkingController]),(0,e.jsxs)("div",{className:"sn-component section editor","aria-label":"File",ref:f,children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[s&&(0,e.jsxs)("div",{className:"bg-warning-faded relative flex items-center px-3.5 py-2 text-sm text-accessory-tint-3",children:[(0,e.jsx)(xn.Z,{type:"pencil-off",className:"mr-3"}),"This file is readonly"]}),(0,e.jsxs)("div",{className:"content-title-bar section-title-bar section-title-bar z-editor-title-bar w-full",id:"file-title-bar",children:[(0,e.jsxs)("div",{className:"flex h-8 items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex flex-grow items-center",children:[(0,e.jsx)(ff,{}),(0,e.jsx)("div",{className:"title flex-grow overflow-auto",children:(0,e.jsx)("input",{className:"input text-lg",id:kl.N.FileTitleEditor,onChange:p,onFocus:e=>{e.target.select()},spellCheck:!1,defaultValue:i.name,autoComplete:"off",disabled:s})})]}),(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[!s&&(0,e.jsx)(mf,{linkingController:n.linkingController}),(0,e.jsx)(ei.Z,{label:"File information panel",onClick:h,ref:c,icon:"info"}),(0,e.jsx)(On.Z,{title:"Details",open:u,togglePopover:h,anchorElement:c,side:"bottom",align:"center",children:(0,e.jsx)(Pd,{file:i})}),(0,e.jsx)(hf,{itemListController:n.itemListController})]})]}),(0,e.jsx)("div",{className:"hidden md:flex",children:(0,e.jsx)(hd.Z,{item:i,linkingController:n.linkingController,readonly:s})})]})]}),(0,e.jsx)("div",{className:"flex min-h-0 flex-grow flex-col",children:(0,e.jsx)(kd.Z,{file:i,application:n},i.uuid)})]})})),vf=(0,Nn.Pi)((t=>{let{application:n,file:i}=t;const[o,s]=(0,He.useState)(!1);(0,He.useEffect)((()=>{n.filesController.setShowProtectedOverlay(!n.isAuthorizedToRenderItem(i))}),[n,i,n.filesController]),(0,He.useEffect)((()=>{s(n.filesController.showProtectedOverlay)}),[n.filesController.showProtectedOverlay]);const a=(0,He.useCallback)((async()=>{let e=!0;n.hasProtectionSources()&&(e=await n.protections.authorizeItemAccess(i)),e&&s(!1)}),[n,i]);return(0,He.useEffect)((()=>n.addEventObserver((async e=>{e===r.ApplicationEvent.UnprotectedSessionBegan?s(!1):e===r.ApplicationEvent.UnprotectedSessionExpired&&s(!n.isAuthorizedToRenderItem(i))}))),[n,i]),o?(0,e.jsx)(gf,{showAccountMenu:n.showAccountMenu,hasProtectionSources:n.hasProtectionSources(),onViewItem:a,itemType:"file"}):(0,e.jsx)(yf,{application:n,file:i})})),Af=(0,Nn.Pi)((t=>{let{noteViewController:n,onClick:i,onClickPreprocessing:o}=t;var s;const a=(0,sr.I)(),l=a.notesController.firstSelectedNote,[c,u]=(0,He.useState)(!1),d=(0,He.useRef)(null),h=(0,He.useRef)(null),[p,f]=(0,He.useState)((()=>l?a.componentManager.editorForNote(l):void 0)),g=(null==n?void 0:n.isTemplateNote)?(0,r.noteTypeForEditorIdentifier)(a.componentManager.getDefaultEditorIdentifier((null===(s=n.templateNoteOptions)||void 0===s?void 0:s.tag)?a.items.findItem(n.templateNoteOptions.tag):void 0)):l&&l.noteType!=r.NoteType.Unknown?l.noteType:p?p.noteType:r.NoteType.Unknown,[m,y]=(0,Do.i)(g,!0),[v,A]=(0,He.useState)(!1),b=(0,He.useCallback)((async()=>{const e=!c;e&&o&&await o(),u(e),i&&i()}),[c,o,i]);(0,He.useEffect)((()=>a.keyboardService.addCommandHandler({command:L.AX,category:"Current note",description:"Change note type",onKeyDown:()=>{b()}})),[a,b]);const w=(0,He.useMemo)((()=>a.keyboardService.keyboardShortcutForCommand(L.AX)),[a]);return(0,e.jsxs)("div",{ref:h,children:[(0,e.jsx)(ei.Z,{label:"Change note type (".concat(w&&(0,L.Ld)(w),")"),onClick:b,ref:d,icon:m,iconClassName:"text-accessory-tint-".concat(y)}),(0,e.jsx)(On.Z,{title:"Change note type",togglePopover:b,disableClickOutside:v,anchorElement:d,open:c,className:"md:pb-1",children:(0,e.jsx)(ou,{application:a,note:l,setDisableClickOutside:A,closeMenu:()=>{u(!1)},onSelect:e=>{f(e)}})})]})})),bf="border border-solid w-3 h-3 p-0 rounded-full flex-shrink-0",wf=t=>{let{style:n}=t;switch(n){case"neutral":return(0,e.jsx)("div",{className:"".concat(bf," border-neutral bg-neutral")});case"info":return(0,e.jsx)("div",{className:"".concat(bf," border-info bg-info")});case"danger":return(0,e.jsx)("div",{className:"".concat(bf," border-danger bg-danger")})}},Sf=t=>{let{onClick:n,noteLocked:r}=t;const[i,o]=(0,He.useState)((()=>r)),s=i?"bg-warning-faded":"bg-info-faded",a=i?"text-accessory-tint-3":"text-accessory-tint-1",l=i?"text-warning":"text-accessory-tint-1",c=i?"Note editing disabled.":"Enable editing";return(0,e.jsxs)("div",{className:"relative flex items-center ".concat(s," cursor-pointer px-3.5 py-2 text-sm"),onMouseLeave:()=>{o(!0)},onMouseOver:()=>{o(!1)},onClick:n,children:[i?(0,e.jsx)(xn.Z,{type:"pencil-off",className:"".concat(a," mr-3 flex fill-current")}):(0,e.jsx)(xn.Z,{type:"pencil",className:"".concat(a," mr-3 flex fill-current")}),(0,e.jsx)("span",{className:l,children:c})]})},Cf=t=>{let{note:n,linkingController:i,noteViewElement:o,filesController:s}=t;const a=(0,sr.I)(),{isDraggingFiles:l,addDragTarget:c,removeDragTarget:u}=Gd();return(0,He.useEffect)((()=>{const e=o;if(e){const t="Drop your files to upload and link them to the current note";n.noteType===r.NoteType.Super?c(e,{tooltipText:t,handleFileUpload:e=>{s.uploadAndInsertFileToCurrentNote(e)},note:n}):c(e,{tooltipText:t,callback:async e=>{await i.linkItems(n,e),a.changeAndSaveItem.execute(e,(e=>{e.protected=n.protected})),s.notifyObserversOfUploadedFileLinkingToCurrentNote(e.uuid)},note:n})}return()=>{e&&u(e)}}),[c,i,n,o,u,s,a]),l?(0,e.jsx)("div",{id:"file-drag-iframe-overlay",className:"absolute left-0 top-0 z-dropdown-menu h-full w-full"}):null};var Ef=s(57140);const If=(0,He.forwardRef)(((t,n)=>{let{application:i,spellcheck:o,controller:s,locked:a,onFocus:l,onBlur:c}=t;const[u,d]=(0,He.useState)(),[h,p]=(0,He.useState)(!1),[f,g]=(0,He.useState)(),[m,y]=(0,He.useState)(),v=Ir(m||r.EditorFontSize.Normal),A=$d(o),b=(0,He.useRef)(),w=(0,He.useRef)(!1),S=(0,He.useRef)(!1),C=(0,He.useRef)(s.item),[E,I]=(0,He.useState)(!1),_=(0,He.useRef)(),x=(0,He.useRef)(null);(0,He.useImperativeHandle)(n,(()=>({focus(){O()}}))),(0,He.useEffect)((()=>()=>{var e,t;null===(e=x.current)||void 0===e||e.disconnect(),null===(t=_.current)||void 0===t||t.call(_),_.current=void 0,x.current=null}),[]),(0,He.useEffect)((()=>s.addNoteInnerValueChangeObserver(((e,t)=>{if(e.uuid!==C.current.uuid)throw Error("Editor received changes for non-current note");E||((0,r.isPayloadSourceRetrieved)(t)||null==u||e.editorIdentifier!==C.current.editorIdentifier||e.noteType!==C.current.noteType)&&d(e.text),C.current=e}))),[s,u,s.item.uuid,s.item.editorIdentifier,s.item.noteType,E]);const P=(0,He.useCallback)((()=>{S.current||(w.current=!0),i.notifyWebEvent(r.WebAppEvent.EditorDidFocus,{eventSource:b.current}),b.current=void 0,l()}),[i,S,b,l]),k=(0,He.useCallback)((e=>{b.current=void 0,c(e)}),[b,c]),B=(0,He.useCallback)((()=>{var e,t;w.current&&(w.current=!1,S.current=!0,null===(e=document.getElementById("note-text-editor"))||void 0===e||e.blur(),null===(t=document.getElementById("note-text-editor"))||void 0===t||t.focus(),S.current=!1)}),[w]);(0,He.useEffect)((()=>i.addWebEventObserver((e=>{e===r.WebAppEvent.MobileKeyboardWillChangeFrame&&B()}))),[i,B]);const O=(0,He.useCallback)((()=>{const e=document.getElementById(kl.N.NoteTextEditor);e&&(b.current=kn.Script,e.focus())}),[]);(0,He.useEffect)((()=>{var e;s.isTemplateNote&&"editor"===(null===(e=s.templateNoteOptions)||void 0===e?void 0:e.autofocusBehavior)&&O()}),[s,O]);const N=(0,He.useCallback)((()=>{const e=i.preferences.getLocalValue(r.LocalPrefKey.EditorLineHeight,r.PrefDefaults[r.LocalPrefKey.EditorLineHeight]),t=i.preferences.getLocalValue(r.LocalPrefKey.EditorFontSize,r.PrefDefaults[r.LocalPrefKey.EditorFontSize]);g(e),y(t)}),[i]);(0,He.useEffect)((()=>(N(),i.addSingleEventObserver(r.ApplicationEvent.PreferencesChanged,(async()=>{N()})))),[N,i]),(0,He.useEffect)((()=>{void 0!==A&&o!==A&&(p(!0),setTimeout((()=>{p(!1)}),0))}),[o,A]);const D=(0,He.useCallback)((e=>{if(_.current||!e)return;V(R.NoteView,"On system editor ref");const t=document.getElementById(kl.N.NoteTextEditor);if(!t)return void console.error("Editor is not yet mounted; unable to add tab observer.");_.current=i.keyboardService.addCommandHandler({element:t,command:L.gE,onKeyDown:e=>{if(!(document.hidden||C.current.locked||e.shiftKey)){if(e.preventDefault(),!document.execCommand("insertText",!1,"\t")){const e=t.selectionStart||0,n=t.selectionEnd||0,r="    ";t.value=t.value.substring(0,e)+r+t.value.substring(n),t.selectionStart=t.selectionEnd=e+4}d(t.value),s.saveAndAwaitLocalPropagation({text:t.value,bypassDebouncer:!0,isUserModified:!0})}}});const n=new MutationObserver((e=>{for(const r of e)r.removedNodes.forEach((e=>{var r;e.isEqualNode(t)&&(null===(r=_.current)||void 0===r||r.call(_),_.current=void 0,n.disconnect())}))}));n.observe(t.parentElement,{childList:!0}),x.current=n}),[i.keyboardService,s]);return h?null:(0,e.jsx)("textarea",{autoComplete:"off",dir:"auto",id:kl.N.NoteTextEditor,onChange:e=>{let{currentTarget:t}=e;const n=t.value;d(n),I(!0),s.saveAndAwaitLocalPropagation({text:n,isUserModified:!0}).then((()=>{I(!1)}))},onFocus:P,onBlur:k,readOnly:a,ref:D,spellCheck:o,value:u,className:(0,Q.classNames)("editable font-editor flex-grow",f&&"leading-".concat(f.toLowerCase()),v,(0,L.gn)()&&"!pb-12")})})),_f={[r.EditorLineWidth.Narrow]:"512px",[r.EditorLineWidth.Wide]:"720px",[r.EditorLineWidth.Dynamic]:"80%",[r.EditorLineWidth.FullWidth]:"100%"},xf={[r.EditorLineWidth.Narrow]:"auto",[r.EditorLineWidth.Wide]:"auto",[r.EditorLineWidth.Dynamic]:"10%",[r.EditorLineWidth.FullWidth]:"0"};var Pf=s(77491),kf=s.n(Pf),Bf=s(53193),Of=s.n(Bf);Nt().extend(Of()),Nt().extend(kf()),Nt().updateLocale("en",{relativeTime:{future:"in %s",past:"%s ago",s:"%ds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}});const Nf=t=>{let{className:n,onClick:r,icon:i,isTooltipVisible:o,setIsTooltipVisible:s,children:a,animateIcon:l=!1}=t;const c=(0,He.useRef)(null);return(0,e.jsxs)("div",{className:"note-status-tooltip-container",children:[(0,e.jsxs)("button",{className:(0,Q.classNames)("peer flex h-5 w-5 cursor-pointer items-center justify-center rounded-full",n),onClick:r,ref:c,children:[(0,e.jsx)(xn.Z,{className:l?"animate-spin":"",type:i,size:"small"}),(0,e.jsx)(jl.T,{children:"Note sync status"})]}),(0,e.jsx)(On.Z,{title:"Note sync status",open:o,togglePopover:()=>s((e=>!e)),className:"px-3 py-2",containerClassName:"!min-w-0 !w-auto max-w-[90vw]",anchorElement:c,side:"bottom",align:"center",offset:6,disableMobileFullscreenTakeover:!0,disableApplyingMobileWidth:!0,children:a})]})},Df=(0,Nn.Pi)((t=>{let{note:n,status:i,syncTakingTooLong:o,updateSavingIndicator:s=r.PrefDefaults[r.PrefKey.UpdateSavingStatusIndicator]}=t;const a=(0,sr.I)(),[l,c]=(0,He.useState)(!1),u=(0,He.useCallback)((()=>{c((e=>!e))}),[]),d=(0,He.useCallback)((()=>{a.setPreference(r.PrefKey.UpdateSavingStatusIndicator,!s)}),[a,s]);return s&&!i?null:i&&"error"===i.type?(0,e.jsxs)(Nf,{className:"bg-danger text-danger-contrast",onClick:u,icon:"warning",isTooltipVisible:l,setIsTooltipVisible:c,children:[(0,e.jsx)("div",{className:"text-sm font-bold text-danger",children:i.message}),i.description&&(0,e.jsx)("div",{className:"mt-0.5",children:i.description})]}):o?(0,e.jsx)(Nf,{className:"bg-warning text-warning-contrast",onClick:u,icon:i&&"saving"===i.type?"sync":"warning",isTooltipVisible:l,setIsTooltipVisible:c,children:i?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"text-sm font-bold text-warning",children:i.message}),i.description&&(0,e.jsx)("div",{className:"mt-0.5",children:i.description})]}):(0,e.jsx)("div",{className:"text-sm font-bold text-warning",children:"Sync taking too long"})}):s&&i?(0,e.jsxs)(Nf,{className:(0,Q.classNames)("saving"===i.type&&"bg-contrast","saved"===i.type&&"bg-success text-success-contrast","waiting"===i.type&&"bg-warning text-warning-contrast"),onClick:u,icon:"saving"===i.type?"sync":"waiting"===i.type?"clock":"check",animateIcon:"saving"===i.type,isTooltipVisible:l,setIsTooltipVisible:c,children:[(0,e.jsx)("div",{className:"text-sm font-bold",children:i.message}),i.description&&(0,e.jsx)("div",{className:"mt-0.5",children:i.description}),"waiting"===i.type&&n.lastSyncEnd&&(0,e.jsxs)("div",{className:"mt-0.5",children:["Last synced ",(h=n.lastSyncEnd,Nt()(h).fromNow())]}),"waiting"===i.type?(0,e.jsx)(Ln.Z,{small:!0,className:"mt-1",onClick:()=>{a.sync.sync().catch(console.error),u()},children:"Sync now"}):(0,e.jsx)(Ln.Z,{small:!0,className:"mt-1",onClick:d,children:"Disable status updates"})]}):(0,e.jsxs)(Nf,{className:"bg-contrast text-passive-1",onClick:u,icon:"info",isTooltipVisible:l,setIsTooltipVisible:c,children:[(0,e.jsx)("div",{className:"text-sm font-bold",children:"Note status updates are disabled"}),(0,e.jsx)(Ln.Z,{small:!0,className:"mt-1",onClick:d,children:"Enable status updates"})]});var h}));var jf=s(4160);const Tf=t=>{let{item:n}=t;const{vault:r,lastEditedByContact:i}=(0,Ad.j)(n);return r?(0,e.jsxs)("div",{className:"flex flex-wrap items-start gap-2",children:[(0,e.jsx)(sh.Z,{vault:r}),i&&(0,e.jsx)(jf.Z,{contact:i})]}):null};var Mf=s(54425),Ff=s(16902),Rf=s(39661),Lf=s(98296),Qf=s(2363),Uf=s(15945),Vf=s(25729),Kf=s(57996),Hf=s(57189),Gf=s(29661),Yf=s.n(Gf);const zf=t=>{let{state:n,text:i}=t;return(0,e.jsx)("span",{"data-diff":n!==Yf().EQUAL?n:void 0,className:(0,r.classNames)("whitespace-pre-wrap",n===Yf().INSERT&&"bg-success text-success-contrast",n===Yf().DELETE&&"bg-danger text-danger-contrast"),children:i})},Zf=t=>{let{selectedNotes:n,convertSuperToMarkdown:i}=t;const[o,s]=(0,He.useState)([]),[a,l]=(0,He.useState)([]);(0,He.useEffect)((()=>{(async()=>{const e=n[0],t=e.title,o=e.noteType===r.NoteType.Super&&i?await(new Be).convertSuperStringToOtherFormat(e.text,"md"):e.text,a=n[1],c=a.title,u=a.noteType===r.NoteType.Super&&i?await(new Be).convertSuperStringToOtherFormat(a.text,"md"):a.text,d=Yf()(t,c,void 0,!0),h=Yf()(o,u,void 0,!0);s(d),l(h)})().catch(console.error)}),[i,n]);const[c,u]=(0,He.useState)(null),[d,h]=(0,He.useState)(null),[p,f]=(0,He.useState)(!1);return(0,He.useEffect)((()=>{c&&f(c.scrollHeight>c.clientHeight)}),[c,a]),(0,He.useEffect)((()=>{if(!c||!d)return;if(!p)return;if(!a.length)return;d.innerHTML="";const e=c.getBoundingClientRect(),t=d.getBoundingClientRect();c.querySelectorAll("[data-diff]").forEach((n=>{const r=n.getAttribute("data-diff");if(!r)return;const i=parseInt(r),o=n.getBoundingClientRect(),s=(o.top-e.top)/c.scrollHeight,a=t.height*s,l=o.height/c.scrollHeight,u=t.height*l,h=document.createElement("div");h.className="absolute top-0 left-0 w-full bg-".concat(i===Yf().INSERT?"success":"danger"," opacity-50"),h.style.height="".concat(u,"px"),h.style.top="".concat(a,"px"),d.appendChild(h)}))}),[c,p,a,d]),(0,e.jsxs)("div",{className:"force-custom-scrollbar relative flex flex-grow flex-col overflow-hidden",children:[(0,e.jsx)("div",{className:"w-full px-4 py-4 text-base font-bold",children:o.map(((t,n)=>{let[r,i]=t;return(0,e.jsx)(zf,{state:r,text:i},n)}))}),(0,e.jsx)("pre",{className:"font-editor min-h-0 w-full flex-grow overflow-y-auto whitespace-pre-wrap p-4 pt-0 text-editor [&::-webkit-scrollbar]:bg-transparent",ref:u,children:a.map(((t,n)=>{let[r,i]=t;return(0,e.jsx)(zf,{state:r,text:i},n)}))}),p&&(0,e.jsx)("div",{className:"absolute right-0 top-0 z-[-1] h-full w-[19px] border-l border-border",ref:h})]})},Wf=t=>{let{isSelected:n,onClick:i,title:o,note:s,disabled:a}=t;const l=(0,sr.I)(),{words:c,characters:u,paragraphs:d,serverUpdatedAt:h,dateCreated:p,format:f}=_u(l,s);return(0,e.jsxs)("button",{tabIndex:pt.HF,className:(0,r.classNames)("flex w-full select-none flex-col overflow-hidden border-l-2 bg-transparent px-3 py-2.5 pl-4 text-left text-sm text-text",n?"border-info bg-info-backdrop":"border-transparent",a?"cursor-not-allowed opacity-75":"cursor-pointer hover:bg-contrast hover:text-foreground focus:bg-info-backdrop focus:shadow-none"),onClick:i,"data-selected":n,disabled:a,children:[(0,e.jsxs)("div",{className:"mb-1.5 flex items-center gap-2",children:[(0,e.jsx)(vh,{checked:n}),(0,e.jsx)("div",{className:"font-semibold",children:o})]}),(0,e.jsxs)("div",{className:"w-full text-sm text-neutral lg:text-xs",children:[(0,e.jsxs)("div",{className:"mb-1.5 flex items-center gap-2",children:[(0,e.jsx)($r.Z,{gutter:8,label:"Last modified",className:"!z-modal",children:(0,e.jsx)("div",{className:"flex-shrink-0",children:(0,e.jsx)(xn.Z,{type:"restore",size:"medium"})})}),(0,e.jsx)(jl.T,{children:"Last modified"})," ",h]}),(0,e.jsxs)("div",{className:"mb-1.5 flex items-center gap-2",children:[(0,e.jsx)($r.Z,{gutter:8,label:"Created",className:"!z-modal",children:(0,e.jsx)("div",{className:"flex-shrink-0",children:(0,e.jsx)(xn.Z,{type:"pencil-filled",size:"medium"})})}),(0,e.jsx)(jl.T,{children:"Created"})," ",p]}),(0,e.jsxs)("div",{className:"mb-1.5 flex items-center gap-2 overflow-hidden",children:[(0,e.jsx)($r.Z,{gutter:8,label:"Note ID",className:"!z-modal",children:(0,e.jsx)("div",{className:"flex-shrink-0",children:(0,e.jsx)(xn.Z,{type:"info",size:"medium"})})}),(0,e.jsx)(jl.T,{children:"Note ID"}),(0,e.jsx)("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:s.uuid})]}),"number"!=typeof c||"txt"!==f&&"md"!==f?null:(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)($r.Z,{gutter:8,label:"".concat(c," words"),className:"!z-modal",children:(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(xn.Z,{type:"line-width",size:"medium"}),c]})}),(0,e.jsx)($r.Z,{gutter:8,label:"".concat(u," characters"),className:"!z-modal",children:(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(xn.Z,{type:"bold",size:"small"}),(0,e.jsx)("span",{children:u})]})}),(0,e.jsx)($r.Z,{gutter:8,label:"".concat(d," paragraphs"),className:"!z-modal",children:(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(xn.Z,{type:"paragraph",size:"medium"}),(0,e.jsx)("span",{children:d})]})})]})]})]})},qf=t=>{let{currentNote:n,conflictedNotes:i,close:o}=t;const s=(0,He.useMemo)((()=>[n].concat(i)),[i,n]),a=(0,sr.I)(),[l,c]=(0,He.useState)([n.uuid]),u=(0,He.useMemo)((()=>s.filter((e=>l.includes(e.uuid)))),[s,l]),d=(0,He.useCallback)((async e=>{await a.mutator.changeItem(e,(e=>{e.trashed=!0,e.conflictOf=void 0})).catch(console.error),c([s[0].uuid])}),[s,a.mutator]),h=(0,He.useCallback)((async e=>{await a.mutator.deleteItem(e).then((()=>a.sync.sync())).catch(console.error).then((()=>{c([s[0].uuid])}))}),[s,a.mutator,a.sync]),[p,f]=(0,He.useState)("move-to-trash"),g=(0,Mf.I)({value:p,setValue:e=>f(e)}),[m,y]=(0,He.useState)(!1),v=(0,He.useCallback)((async()=>{const e="delete-permanently"===p,t="This will keep only the selected versions and ".concat(e?"delete the other versions permanently.":"move the other versions to the trash."," Are you sure?");if(await(0,L.VG)({title:"Keep only selected versions?",text:t,confirmButtonStyle:"danger"})){const t=s.filter((e=>!l.includes(e.uuid)));g.hide(),y(!0),await Promise.all(t.map((t=>e?h(t):d(t)))),await a.mutator.changeItems(u,(e=>{e.conflictOf=void 0})),y(!1),a.itemListController.selectItem(u[0].uuid,!0),a.sync.sync(),o()}}),[s,a,o,h,g,p,u,l,d]),A=(0,et.ac)(et.Jj.sm),b=(0,He.useMemo)((()=>[{label:"Cancel",onClick:o,type:"cancel",mobileSlot:"left"}]),[o]),[w,S]=(0,He.useState)(null);(0,qu.Z)(w);const[C,E]=(0,He.useState)("list"),I=(0,Ff.r)(),_=g.useState("open"),[x,P]=(0,He.useState)(null),[k,B]=(0,He.useState)(A?"diff":"preview"),O="preview"===k;(0,He.useEffect)((()=>{2!==u.length&&B("preview"),A&&2===u.length&&B("diff")}),[A,u.length]);const N=u.some((e=>e.noteType===r.NoteType.Super))&&!O,[D,j]=(0,He.useState)(!0),[T,M]=(0,He.useState)(0),[F,R]=(0,He.useState)(!0),Q=(0,He.useCallback)((e=>{let{target:t}=e;M(t.scrollTop)}),[]);return(0,e.jsxs)(Gn,{title:"Resolve conflicts",className:"flex flex-col overflow-x-hidden md:flex-row",actions:b,close:o,customFooter:(0,e.jsxs)(Fd,{className:u.length>1?"hidden md:flex":"",children:[(0,e.jsx)(Ln.Z,{className:"mr-auto hidden md:inline-block",onClick:o,disabled:m,children:"Cancel"}),(0,e.jsxs)(Rf.o,{className:"flex w-full items-stretch text-info-contrast md:w-auto",store:I,children:[(0,e.jsx)(Lf.E,{onClick:v,className:"flex-grow rounded rounded-r-none bg-info px-3 py-1.5 text-base font-bold ring-info ring-offset-2 ring-offset-default hover:brightness-110 focus:ring-0 focus-visible:ring-2 focus-visible:brightness-110 lg:text-sm",disabled:m,children:m?(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(di.Z,{className:"h-4 w-4 border-info-contrast"})}):(0,e.jsxs)(e.Fragment,{children:["Keep selected, ","move-to-trash"===p?"trash others":"delete others"]})}),(0,e.jsx)(Qf.P,{ref:P,render:(0,e.jsxs)(Lf.E,{className:"relative rounded rounded-l-none bg-info px-3 py-1.5 ring-info hover:brightness-110 focus:ring-0 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-default focus-visible:brightness-110",disabled:m,children:[(0,e.jsx)(Uf.n,{className:"block rotate-180"}),(0,e.jsx)("div",{className:"absolute left-0 top-0 h-full w-[2px] bg-info brightness-[.85]"})]}),store:g}),(0,e.jsx)(On.Z,{title:"Conflict options",open:_,togglePopover:g.toggle,anchorElement:x,overrideZIndex:"z-modal",side:"top",align:"end",offset:4,hideOnClickInModal:!0,children:(0,e.jsxs)(Vf.E,{className:"cursor-pointer divide-y divide-border [&>[data-active-item]]:bg-passive-5",store:g,children:[(0,e.jsxs)(Kf.Q,{className:"px-2.5 py-2 hover:bg-passive-5",value:"move-to-trash",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1 text-sm font-bold text-text",children:["move-to-trash"===p?(0,e.jsx)(xn.Z,{type:"check-bold",size:"small"}):(0,e.jsx)("div",{className:"h-3.5 w-3.5"}),"Move others to trash"]}),(0,e.jsx)("div",{className:"ml-4.5 text-neutral",children:"Only the selected version will be kept; others will be moved to trash."})]}),(0,e.jsxs)(Kf.Q,{className:"px-2.5 py-2 hover:bg-passive-5",value:"delete-permanently",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1 text-sm font-bold text-text",children:["delete-permanently"===p?(0,e.jsx)(xn.Z,{type:"check-bold",size:"small"}):(0,e.jsx)("div",{className:"h-3.5 w-3.5"}),"Delete others permanently"]}),(0,e.jsx)("div",{className:"ml-4.5 text-neutral",children:"Only the selected version will be kept; others will be deleted permanently."})]})]})})]})]}),children:[(0,e.jsxs)("div",{className:"flex border-b border-border md:hidden",children:[(0,e.jsx)("button",{className:(0,r.classNames)("relative cursor-pointer border-0 bg-default px-3 py-2.5 text-sm focus:shadow-inner","list"===C?"font-medium text-info shadow-bottom":"text-text"),onClick:()=>{E("list")},children:"List"}),(0,e.jsx)("button",{className:(0,r.classNames)("relative cursor-pointer border-0 bg-default px-3 py-2.5 text-sm focus:shadow-inner","preview"===C?"font-medium text-info shadow-bottom":"text-text"),onClick:()=>{E("preview")},children:"Preview"})]}),(0,e.jsx)("div",{className:(0,r.classNames)("w-full overflow-y-auto border-r border-border py-1.5 md:flex md:w-auto md:min-w-60 md:flex-col","list"!==C&&"hidden md:flex"),ref:S,children:s.map(((t,n)=>(0,e.jsx)(Wf,{disabled:m,isSelected:l.includes(t.uuid),onClick:()=>{c((e=>e.includes(t.uuid)?e.length>1?e.filter((e=>e!==t.uuid)):e:e.length>1?e.slice(1).concat(t.uuid):e.concat(t.uuid))),E("preview")},title:0===n?"Current version":"Version ".concat(n+1),note:t},t.uuid)))}),(0,e.jsxs)("div",{className:(0,r.classNames)("flex w-full flex-grow flex-col overflow-hidden","preview"!==C&&"hidden md:flex"),children:[O&&(0,e.jsx)("div",{className:(0,r.classNames)("min-h-0 w-full flex-grow divide-x divide-border pb-0.5",A?"flex":"grid grid-rows-1"),style:A?void 0:{gridTemplateColumns:"repeat(".concat(u.length,", 1fr)")},children:u.map((t=>(0,e.jsx)(pd,{note:t,content:t.content,scrollPos:T,shouldSyncScroll:F,onScroll:Q},t.uuid)))}),!O&&2===u.length&&(0,e.jsx)(Zf,{selectedNotes:u,convertSuperToMarkdown:D}),2===u.length&&(0,e.jsxs)("div",{className:"flex min-h-11 items-center justify-center gap-2 border-t border-border px-4 py-1.5",children:[O&&(0,e.jsx)($r.Z,{className:"!z-modal !max-w-[50ch]",label:F?"Scrolling is synced":"Scrolling is not synced. Click to sync.",showOnMobile:!0,children:(0,e.jsxs)("div",{className:"relative rounded-full p-1 hover:bg-contrast",children:[(0,e.jsx)(xn.Z,{type:F?"link":"link-off",className:"text-neutral"}),(0,e.jsx)(Hf.X,{className:"absolute bottom-0 left-0 right-0 top-0 cursor-pointer opacity-0",checked:F,onChange:()=>R((e=>!e))})]})}),!A&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:N?"ml-9":"",children:"Preview Mode"}),(0,e.jsx)(po.Z,{checked:!O,onChange:function(e){B(e?"diff":"preview")}})]}),(0,e.jsx)("div",{className:O?"mr-9":"",children:"Diff Mode"}),N&&(0,e.jsx)($r.Z,{interactive:!0,className:"!z-modal !max-w-[50ch]",label:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"mb-2",children:"Super notes use JSON under the hood to create rich and flexible documents. While neatly organized, it's not ideal to read or compare manually. Instead, this diff compares a Markdown rendition of the notes."}),(0,e.jsxs)("label",{className:"mb-1 flex select-none items-center gap-2",children:[(0,e.jsx)(po.Z,{checked:!D,onChange:e=>j(!e)}),"Compare JSON instead"]})]}),showOnMobile:!0,showOnHover:!1,children:(0,e.jsx)("button",{className:"rounded-full p-1 hover:bg-contrast",children:(0,e.jsx)(xn.Z,{type:"info",className:"text-neutral"})})})]})]})]})},Jf=class extends _n{constructor(e){super(e,e.application),this.protectionTimeoutId=null,this.setPlainEditorRef=e=>{this.plainEditorRef=e||void 0},this.authorizeAndDismissProtectedWarning=async()=>{let e=!0;this.application.hasProtectionSources()&&(e=await this.application.authorizeNoteAccess(this.note)),e&&(this.setShowProtectedOverlay(!1),this.focusTitle())},this.editorComponentViewerRequestsReload=async(e,t)=>{if(this.state.editorComponentViewerDidAlreadyReload&&!t)return;const n=e.getComponentOrFeatureItem();this.application.componentManager.destroyComponentViewer(e),this.setState({editorComponentViewer:void 0,editorComponentViewerDidAlreadyReload:!0},(()=>{this.setState({editorComponentViewer:this.createComponentViewer(n),editorStateDidLoad:!0})}))},this.onTitleEnter=e=>{let{key:t,currentTarget:n}=e;var r;t===L.u8.Enter&&(n.blur(),null===(r=this.plainEditorRef)||void 0===r||r.focus())},this.onTitleChange=e=>{let{currentTarget:t}=e;V(R.NoteView,"Performing save after title change");const n=t.value;this.setState({editorTitle:n}),this.controller.saveAndAwaitLocalPropagation({title:n,isUserModified:!0,dontGeneratePreviews:!0}).catch(console.error)},this.onPanelResizeFinish=async(e,t,n)=>{n?await this.application.setPreference(r.PrefKey.EditorWidth,null):null!=e&&await this.application.setPreference(r.PrefKey.EditorWidth,e),null!=t&&await this.application.setPreference(r.PrefKey.EditorLeft,t),this.application.sync.sync().catch(console.error)},this.stackComponentExpanded=e=>!!this.state.stackComponentViewers.find((t=>t.componentUniqueIdentifier.value===e.uuid)),this.toggleStackComponent=async e=>{e.isExplicitlyEnabledForItem(this.note.uuid)?await this.application.mutator.runTransactionalMutation(((e,t)=>({itemUuid:e.uuid,mutate:e=>{const n=e;n.removeAssociatedItemId(t.uuid),n.disassociateWithItem(t.uuid)}}))(e,this.note)):await this.application.mutator.runTransactionalMutation(((e,t)=>({itemUuid:e.uuid,mutate:e=>{const n=e;n.removeDisassociatedItemId(t.uuid),n.associateWithItem(t.uuid)}}))(e,this.note)),this.application.sync.sync().catch(console.error)},this.ensureNoteIsInsertedBeforeUIAction=async()=>{this.controller.isTemplateNote&&await this.controller.insertTemplatedNote()},this.onEditorFocus=()=>{this.setState({editorFocused:!0})},this.onEditorBlur=e=>{var t;(null===(t=e.relatedTarget)||void 0===t?void 0:t.id)!==kl.N.NoteOptionsButton&&this.setState({editorFocused:!1})},this.toggleConflictResolutionModal=()=>{this.setState((e=>({showConflictResolutionModal:!e.showConflictResolutionModal})))},this.triggerSyncOnAction=()=>{this.controller.syncNow()},this.controller=e.controller,this.onEditorComponentLoad=()=>{var e;this.controller&&!this.controller.dealloced&&(null===(e=this.application.desktopManager)||void 0===e||e.redoSearch())},this.debounceReloadEditorComponent=(0,t.Ds)(this.debounceReloadEditorComponent.bind(this),25);const n=this.application.vaults.getItemVault(this.controller.item);this.state={availableStackComponents:[],editorStateDidLoad:!1,editorTitle:"",editorLineWidth:r.PrefDefaults[r.LocalPrefKey.EditorLineWidth],isDesktop:(0,t.Z$)(),noteStatus:void 0,noteLocked:this.controller.item.locked,readonly:n?this.application.vaultUsers.isCurrentUserReadonlyVaultMember(n):void 0,showProtectedWarning:!1,spellcheck:!0,stackComponentViewers:[],syncTakingTooLong:!1,editorFeatureIdentifier:this.controller.item.editorIdentifier,noteType:this.controller.item.noteType,conflictedNotes:[],showConflictResolutionModal:!1},this.noteViewElementRef=(0,He.createRef)(),this.editorContentRef=(0,He.createRef)()}deinit(){var e,t,n,r,i;super.deinit(),this.controller=void 0,null===(e=this.removeNoteStreamObserver)||void 0===e||e.call(this),this.removeNoteStreamObserver=void 0,null===(t=this.removeInnerNoteObserver)||void 0===t||t.call(this),this.removeInnerNoteObserver=void 0,null===(n=this.removeComponentManagerObserver)||void 0===n||n.call(this),this.removeComponentManagerObserver=void 0,null===(r=this.removeTrashKeyObserver)||void 0===r||r.call(this),this.removeTrashKeyObserver=void 0,null===(i=this.removeVaultUsersEventHandler)||void 0===i||i.call(this),this.removeVaultUsersEventHandler=void 0,this.clearNoteProtectionInactivityTimer(),this.ensureNoteIsInsertedBeforeUIAction=void 0,this.onEditorComponentLoad=void 0,this.onPanelResizeFinish=void 0,this.authorizeAndDismissProtectedWarning=void 0,this.editorComponentViewerRequestsReload=void 0,this.onTitleEnter=void 0,this.onTitleChange=void 0,this.onPanelResizeFinish=void 0,this.stackComponentExpanded=void 0,this.toggleStackComponent=void 0,this.debounceReloadEditorComponent=void 0,this.editorContentRef=void 0,this.plainEditorRef=void 0}getState(){return this.state}get note(){return this.controller.item}shouldComponentUpdate(e,t){for(const e of Object.keys(t)){const n=this.state[e],r=t[e];if(Array.isArray(n)&&Array.isArray(r)){if(!(0,Q.compareArrayReferences)(n,r))return V(R.NoteView,"Rendering due to array state change",e,n,r),!0}else if(n!==r)return V(R.NoteView,"Rendering due to state change",e,n,r),!0}return!1}componentDidMount(){super.componentDidMount(),this.removeVaultUsersEventHandler=this.application.vaultUsers.addEventObserver(((e,t)=>{var n;if(e===r.VaultUserServiceEvent.InvalidatedUserCacheForVault){const e=this.application.vaults.getItemVault(this.note);if(t!==(null===(n=null==e?void 0:e.sharing)||void 0===n?void 0:n.sharedVaultUuid))return;this.setState({readonly:e?this.application.vaultUsers.isCurrentUserReadonlyVaultMember(e):void 0})}})),this.registerKeyboardShortcuts(),this.removeInnerNoteObserver=this.controller.addNoteInnerValueChangeObserver(((e,t)=>{this.onNoteInnerChange(e,t)})),this.autorun((()=>{const e=this.controller.syncStatus,t=this.application.paneController.focusModeEnabled,n=this.state.focusModeEnabled!==t;this.setState({showProtectedWarning:this.application.notesController.showProtectedWarning,noteStatus:e,saveError:"error"===(null==e?void 0:e.type),syncTakingTooLong:!1,focusModeEnabled:t}),!t&&n&&this.controller.syncOnlyIfLargeNote()})),this.reloadEditorComponent().catch(console.error),this.reloadStackComponents().catch(console.error);const e=this.note.protected&&(!this.application.hasProtectionSources()||!this.application.protections.hasUnprotectedAccessSession());this.setShowProtectedOverlay(e),this.reloadPreferences().catch(console.error),this.controller.isTemplateNote&&setTimeout((()=>{var e;"title"===(null===(e=this.controller.templateNoteOptions)||void 0===e?void 0:e.autofocusBehavior)&&this.focusTitle()}))}componentDidUpdate(e,t){null!=this.state.showProtectedWarning&&t.showProtectedWarning!==this.state.showProtectedWarning&&this.reloadEditorComponent().catch(console.error)}onNoteInnerChange(e,t){if(V(R.NoteView,"On inner note change",r.PayloadEmitSource[t]),e.uuid!==this.note.uuid)throw Error("Editor received changes for non-current note");let n=this.state.editorTitle;if((0,r.isPayloadSourceRetrieved)(t)&&(n=e.title),this.state.editorTitle||(n=e.title),n!==this.state.editorTitle&&this.setState({editorTitle:n}),e.last_edited_by_uuid!==this.state.noteLastEditedByUuid&&this.setState({noteLastEditedByUuid:e.last_edited_by_uuid}),e.locked!==this.state.noteLocked&&this.setState({noteLocked:e.locked}),e.editorIdentifier===this.state.editorFeatureIdentifier&&e.noteType===this.state.noteType||(this.setState({editorFeatureIdentifier:e.editorIdentifier,noteType:e.noteType,editorTitle:e.title}),this.reloadEditorComponent()),this.reloadSpellcheck().catch(console.error),this.reloadLineWidth(),(t!==r.PayloadEmitSource.LocalInserted||!e.dirty)&&(e.lastSyncBegan||e.dirty)){const t=this.controller.syncStatus,n="waiting"===(null==t?void 0:t.type);if(e.lastSyncEnd){const t=e.lastSyncBegan&&e.lastSyncBegan.getTime()>e.lastSyncEnd.getTime(),r=e.lastSyncBegan&&e.lastSyncEnd.getTime()>e.lastSyncBegan.getTime();t?this.controller.showSavingStatus():this.state.noteStatus&&r&&!n&&this.controller.showAllChangesSavedStatus()}else e.lastSyncBegan&&this.controller.showSavingStatus()}}componentWillUnmount(){var e;this.state.editorComponentViewer&&(null===(e=this.application.componentManager)||void 0===e||e.destroyComponentViewer(this.state.editorComponentViewer)),super.componentWillUnmount()}async onAppLaunch(){await super.onAppLaunch(),this.streamItems()}async onAppEvent(e){var t;if(!(null===(t=this.controller)||void 0===t?void 0:t.dealloced))switch(e){case r.ApplicationEvent.LocalPreferencesChanged:case r.ApplicationEvent.PreferencesChanged:this.reloadPreferences(),this.reloadStackComponents();break;case r.ApplicationEvent.HighLatencySync:this.setState({syncTakingTooLong:!0});break;case r.ApplicationEvent.CompletedFullSync:{this.setState({syncTakingTooLong:!1});const e=this.state.saveError;!this.note.dirty&&e&&this.controller.showAllChangesSavedStatus();break}case r.ApplicationEvent.FailedSync:this.note.dirty&&this.controller.showErrorSyncStatus();break;case r.ApplicationEvent.LocalDatabaseWriteError:this.controller.showErrorSyncStatus({type:"error",message:"Offline Saving Issue",description:"Changes not saved"});break;case r.ApplicationEvent.UnprotectedSessionBegan:this.setShowProtectedOverlay(!1);break;case r.ApplicationEvent.UnprotectedSessionExpired:this.note.protected&&this.hideProtectedNoteIfInactive()}}getSecondsElapsedSinceLastEdit(){return(Date.now()-this.note.userModifiedDate.getTime())/1e3}hideProtectedNoteIfInactive(){const e=this.getSecondsElapsedSinceLastEdit();if(e>=r.ProposedSecondsToDeferUILevelSessionExpirationDuringActiveInteraction)this.setShowProtectedOverlay(!0);else{const t=r.ProposedSecondsToDeferUILevelSessionExpirationDuringActiveInteraction-e;this.startNoteProtectionInactivityTimer(t)}}startNoteProtectionInactivityTimer(e){this.clearNoteProtectionInactivityTimer(),this.protectionTimeoutId=setTimeout((()=>{this.hideProtectedNoteIfInactive()}),1e3*e)}clearNoteProtectionInactivityTimer(){this.protectionTimeoutId&&clearTimeout(this.protectionTimeoutId)}streamItems(){this.removeNoteStreamObserver=this.application.items.streamItems(r.ContentType.TYPES.Note,(async()=>{this.note&&this.setState({conflictedNotes:this.application.items.conflictsOf(this.note.uuid)})}))}createComponentViewer(e){if(!e)throw Error("Cannot create component viewer for undefined component");return this.application.componentManager.createComponentViewer(e,{uuid:this.note.uuid})}debounceReloadEditorComponent(){this.reloadEditorComponent().catch(console.error)}destroyCurrentEditorComponent(){const e=this.state.editorComponentViewer;e&&(this.application.componentManager.destroyComponentViewer(e),this.setState({editorComponentViewer:void 0}))}async reloadEditorComponent(){if(V(R.NoteView,"Reload editor component"),this.state.showProtectedWarning)return void this.destroyCurrentEditorComponent();const e=this.application.componentManager.editorForNote(this.note);(0,r.isUIFeatureAnIframeFeature)(e)&&this.controller.isTemplateNote&&await this.controller.insertTemplatedNote();const t=this.state.editorComponentViewer;t&&t.componentUniqueIdentifier!==e.uniqueIdentifier&&this.destroyCurrentEditorComponent(),(0,r.isUIFeatureAnIframeFeature)(e)?this.setState({editorComponentViewer:this.createComponentViewer(e),editorStateDidLoad:!0}):(bc(this.state.monospaceFont),this.setState({editorStateDidLoad:!0}))}hasAvailableExtensions(){return this.application.actions.extensionsInContextOfItem(this.note).length>0}focusTitle(){var e;null===(e=document.getElementById(kl.N.NoteTitleEditor))||void 0===e||e.focus()}setShowProtectedOverlay(e){this.application.notesController.setShowProtectedWarning(e)}async deleteNote(e){if(this.controller.isTemplateNote)return void this.application.alerts.alert(ht.xU).catch(console.error);if(this.note.locked)return void this.application.alerts.alert(ht.YQ).catch(console.error);const t=this.note.title.length?"'".concat(this.note.title,"'"):"this note",n=(0,ht.OW)(t,e);await(0,L.VG)({text:n,confirmButtonStyle:"danger"})&&(e?this.performNoteDeletion(this.note):this.controller.saveAndAwaitLocalPropagation({title:this.state.editorTitle,bypassDebouncer:!0,dontGeneratePreviews:!0,isUserModified:!0,customMutate:e=>{e.trashed=!0}}).catch(console.error))}performNoteDeletion(e){this.application.mutator.deleteItem(e).then((()=>this.application.sync.sync())).catch(console.error)}async reloadSpellcheck(){const e=this.application.notesController.getSpellcheckStateForNote(this.note);e!==this.state.spellcheck&&(bc(this.state.monospaceFont),this.setState({spellcheck:e}))}reloadLineWidth(){const e=this.application.notesController.getEditorWidthForNote(this.note);this.setState({editorLineWidth:e})}async reloadPreferences(){V(R.NoteView,"Reload preferences");const e=this.application.preferences.getLocalValue(r.LocalPrefKey.EditorMonospaceEnabled,r.PrefDefaults[r.LocalPrefKey.EditorMonospaceEnabled]),t=this.application.getPreference(r.PrefKey.UpdateSavingStatusIndicator,r.PrefDefaults[r.PrefKey.UpdateSavingStatusIndicator]),n=this.application.getPreference(r.PrefKey.PaneGesturesEnabled,r.PrefDefaults[r.PrefKey.PaneGesturesEnabled]);await this.reloadSpellcheck(),this.reloadLineWidth(),this.setState({monospaceFont:e,updateSavingIndicator:t,paneGestureEnabled:n}),bc(e)}async reloadStackComponents(){V(R.NoteView,"Reload stack components");const e=this.application.componentManager.thirdPartyComponentsForArea(r.ComponentArea.EditorStack).filter((e=>this.application.componentManager.isComponentActive(e))).sort(((e,t)=>e.name.toLowerCase()<t.name.toLowerCase()?-1:1)),t=e.filter((e=>!this.state.stackComponentViewers.find((t=>t.componentUniqueIdentifier.value===e.uuid)))),n=this.state.stackComponentViewers.filter((t=>!e.find((e=>e.uuid===t.componentUniqueIdentifier.value)))),i=[];for(const e of t)i.push(this.application.componentManager.createComponentViewer(new r.UIFeature(e),{uuid:this.note.uuid}));for(const e of n)this.application.componentManager.destroyComponentViewer(e);this.setState({availableStackComponents:e,stackComponentViewers:i})}registerKeyboardShortcuts(){this.removeTrashKeyObserver=this.application.keyboardService.addCommandHandler({command:L.jd,notTags:["INPUT","TEXTAREA"],notElementIds:[Ef._],onKeyDown:()=>{this.deleteNote(!1).catch(console.error)}})}render(){if(this.controller.dealloced)return null;if(this.state.showProtectedWarning||!this.application.isAuthorizedToRenderItem(this.note))return(0,e.jsx)(gf,{showAccountMenu:()=>this.application.showAccountMenu(),hasProtectionSources:this.application.hasProtectionSources(),onViewItem:this.authorizeAndDismissProtectedWarning,itemType:"note"});const n=!(0,t.Av)()||!this.state.editorFocused,i=this.note.noteType===r.NoteType.Super?"super":this.state.editorStateDidLoad&&!this.state.editorComponentViewer?"plain":this.state.editorComponentViewer?"component":"plain",o=this.state.conflictedNotes.length>0&&!this.state.readonly;return(0,e.jsxs)("div",{"aria-label":"Note",className:"section editor sn-component h-full md:max-h-full",ref:this.noteViewElementRef,children:[this.note&&(0,e.jsx)(Cf,{note:this.note,linkingController:this.application.linkingController,filesController:this.application.filesController,noteViewElement:this.noteViewElementRef.current}),this.state.readonly&&(0,e.jsxs)("div",{className:"bg-warning-faded flex items-center px-3.5 py-2 text-sm text-accessory-tint-3",children:[(0,e.jsx)(xn.Z,{type:"pencil-off",className:"mr-3"}),"You don't have permission to edit this note"]}),this.state.noteLocked&&(0,e.jsx)(Sf,{onClick:()=>this.application.notesController.setLockSelectedNotes(!this.state.noteLocked),noteLocked:this.state.noteLocked}),this.note&&(0,e.jsxs)("div",{id:"editor-title-bar",className:"content-title-bar section-title-bar z-editor-title-bar w-full bg-default pt-4",children:[(0,e.jsxs)("div",{className:(0,Q.classNames)("mb-2 flex justify-between md:mb-0 md:flex-nowrap md:gap-4 xl:items-center",o?"items-center":"items-start",n?"flex-wrap gap-2 ":"flex-nowrap gap-4"),children:[(0,e.jsxs)("div",{className:(0,Q.classNames)(this.state.noteLocked&&"locked","flex flex-grow items-center"),children:[(0,e.jsx)(ff,{}),(0,e.jsx)("div",{className:"title flex-grow overflow-auto",children:(0,e.jsx)("input",{className:"input text-lg",disabled:this.state.noteLocked||this.state.readonly,id:kl.N.NoteTitleEditor,onChange:this.onTitleChange,onFocus:e=>{e.target.select()},onKeyUp:this.onTitleEnter,spellCheck:!1,value:this.state.editorTitle,autoComplete:"off"})}),(0,e.jsx)(Df,{note:this.note,status:this.state.noteStatus,syncTakingTooLong:this.state.syncTakingTooLong,updateSavingIndicator:this.state.updateSavingIndicator})]}),o&&(0,e.jsxs)(Ln.Z,{id:kl.N.ConflictResolutionButton,className:"flex items-center",primary:!0,colorStyle:"warning",small:!0,onClick:this.toggleConflictResolutionModal,children:[(0,e.jsx)(xn.Z,{type:"merge",size:"small",className:"mr-2"}),this.state.conflictedNotes.length," ",(0,Q.pluralize)(this.state.conflictedNotes.length,"conflict","conflicts")]}),(0,e.jsxs)("div",{className:"note-view-options-buttons flex items-center gap-3",children:[!this.state.readonly&&n&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(mf,{linkingController:this.application.linkingController,onClick:this.triggerSyncOnAction,onClickPreprocessing:this.ensureNoteIsInsertedBeforeUIAction}),(0,e.jsx)(Af,{noteViewController:this.controller,onClick:this.triggerSyncOnAction,onClickPreprocessing:this.ensureNoteIsInsertedBeforeUIAction}),(0,e.jsx)(lf,{notesController:this.application.notesController,onClickPreprocessing:this.ensureNoteIsInsertedBeforeUIAction})]}),(0,e.jsx)(af,{notesController:this.application.notesController,onClick:this.triggerSyncOnAction,onClickPreprocessing:this.ensureNoteIsInsertedBeforeUIAction,onButtonBlur:()=>{this.setState({editorFocused:!1})}})]})]}),(0,e.jsx)("div",{className:"mb-1 mt-2.5 md:hidden",children:(0,e.jsx)(Tf,{item:this.note})}),(0,e.jsx)("div",{className:"hidden md:block",children:(0,e.jsx)(hd.Z,{item:this.note,linkingController:this.application.linkingController,readonly:this.state.readonly})})]}),(0,e.jsxs)("div",{id:kl.N.EditorContent,className:(0,Q.classNames)(kl.N.EditorContent,"z-editor-content overflow-auto sm:[&>*]:mx-[var(--editor-margin)] sm:[&>*]:max-w-[var(--editor-max-width)]"),style:{"--editor-margin":xf[this.state.editorLineWidth],"--editor-max-width":_f[this.state.editorLineWidth]},ref:this.editorContentRef,children:["component"===i&&this.state.editorComponentViewer&&(0,e.jsxs)("div",{className:"component-view relative flex-grow",children:[this.state.paneGestureEnabled&&(0,e.jsx)("div",{className:"absolute left-0 top-0 h-full w-[20px] md:hidden"}),(0,e.jsx)(ru,{componentViewer:this.state.editorComponentViewer,onLoad:this.onEditorComponentLoad,requestReload:this.editorComponentViewerRequestsReload,readonly:this.state.readonly},this.state.editorComponentViewer.identifier)]}),"plain"===i&&(0,e.jsx)(If,{application:this.application,spellcheck:this.state.spellcheck,ref:this.setPlainEditorRef,controller:this.controller,locked:this.state.noteLocked||!!this.state.readonly,onFocus:this.onEditorFocus,onBlur:this.onEditorBlur}),"super"===i&&(0,e.jsx)("div",{className:(0,Q.classNames)("blocks-editor w-full flex-grow overflow-hidden"),children:(0,e.jsx)(zc,{application:this.application,linkingController:this.application.linkingController,filesController:this.application.filesController,spellcheck:this.state.spellcheck,controller:this.controller,readonly:this.state.readonly,onFocus:this.onEditorFocus,onBlur:this.onEditorBlur},this.note.uuid)})]}),(0,e.jsxs)("div",{id:"editor-pane-component-stack",children:[this.state.availableStackComponents.length>0&&(0,e.jsx)("div",{id:"component-stack-menu-bar",className:"flex h-6 w-full items-center justify-between border-t border-solid border-border bg-contrast px-2 py-0 text-text",children:(0,e.jsx)("div",{className:"flex h-full",children:this.state.availableStackComponents.map((t=>{const n=this.application.componentManager.isComponentActive(t);return(0,e.jsxs)("div",{onClick:()=>{this.toggleStackComponent(t).catch(console.error)},className:"flex flex-grow cursor-pointer items-center justify-center [&:not(:first-child)]:ml-3",children:[(0,e.jsxs)("div",{className:"flex h-full items-center [&:not(:first-child)]:ml-2",children:[this.stackComponentExpanded(t)&&n&&(0,e.jsx)(wf,{style:"info"}),!this.stackComponentExpanded(t)&&(0,e.jsx)(wf,{style:"neutral"})]}),(0,e.jsx)("div",{className:"flex h-full items-center [&:not(:first-child)]:ml-2",children:(0,e.jsx)("div",{className:"whitespace-nowrap text-xs font-bold",children:t.name})})]},t.uuid)}))})}),(0,e.jsx)("div",{className:"sn-component",children:this.state.stackComponentViewers.map((t=>(0,e.jsx)("div",{className:"component-view component-stack-item",children:(0,e.jsx)(ru,{componentViewer:t},t.identifier)},t.identifier)))})]}),(0,e.jsx)(Fr,{isOpen:this.state.showConflictResolutionModal,close:this.toggleConflictResolutionModal,className:"md:h-full md:w-[70vw]",children:(0,e.jsx)(qf,{currentNote:this.note,conflictedNotes:this.state.conflictedNotes,close:this.toggleConflictResolutionModal})})]})}},Xf=class extends _n{constructor(e){super(e,e.application),this.state={showMultipleSelectedNotes:!1,showMultipleSelectedFiles:!1,controllers:[],selectedFile:void 0}}componentDidMount(){super.componentDidMount();const e=this.application.itemControllerGroup;this.removeChangeObserver=this.application.itemControllerGroup.addActiveControllerChangeObserver((()=>{const t=e.itemControllers;this.setState({controllers:t})})),this.autorun((()=>{this.application.notesController&&this.setState({showMultipleSelectedNotes:this.application.notesController.selectedNotesCount>1}),this.application.itemListController&&this.setState({showMultipleSelectedFiles:this.application.itemListController.selectedFilesCount>1})})),this.autorun((()=>{this.application.itemListController&&this.setState({selectedFile:this.application.itemListController.selectedFiles[0]})})),this.autorun((()=>{this.application.paneController&&this.setState({selectedPane:this.application.paneController.currentPane,isInMobileView:this.application.paneController.isInMobileView})}))}deinit(){var e;null===(e=this.removeChangeObserver)||void 0===e||e.call(this),this.removeChangeObserver=void 0,super.deinit()}render(){const t=!this.state.showMultipleSelectedNotes&&!this.state.showMultipleSelectedFiles,n=this.state.controllers.length>0;return(0,e.jsxs)(e.Fragment,{children:[this.state.showMultipleSelectedNotes&&(0,e.jsx)(df,{application:this.application}),this.state.showMultipleSelectedFiles&&(0,e.jsx)(pf,{itemListController:this.application.itemListController}),t&&n&&(0,e.jsx)(e.Fragment,{children:this.state.controllers.map((t=>t instanceof Bt?(0,e.jsx)(Jf,{application:this.application,controller:t},t.runtimeId):(0,e.jsx)(vf,{application:this.application,file:t.item},t.runtimeId)))})]})}},$f=(0,He.forwardRef)(((t,n)=>{let{application:r,className:i,id:o}=t;const{setPaneLayout:s}=(0,Zr.G)(),[a]=oc("right",(()=>{s(mt.h.ItemSelection)}));return(0,e.jsx)("div",{id:o,ref:(0,kr.l)([n,a]),className:"flex h-full flex-grow flex-col bg-default pt-safe-top ".concat(i),children:(0,e.jsx)(Xf,{className:i,application:r})})}));function eg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eg(Object(n),!0).forEach((function(t){ng(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ng(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const rg=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),n=Xd(),{isTabletOrMobile:i,isTablet:o,isMobile:s}=n,a=$d(n),l=(0,Zr.G)(),c=$d(l),[u,d]=(0,He.useState)([]),[h,p]=(0,He.useState)([]),[f,g]=(0,He.useState)([]),[m,y]=(0,He.useState)(t.getPreference(r.PrefKey.TagsPanelWidth,220)),[v,A]=(0,He.useState)(null),[b,w]=(0,He.useState)(t.getPreference(r.PrefKey.NotesPanelWidth,400)),[S,C]=(0,He.useState)(null),E=!i,[I,_]=(0,He.useState)(null),x=(0,et.ac)("(prefers-reduced-motion: reduce)"),P=s&&!x;(0,He.useEffect)((()=>{if(!P)return;const e=l.panes,t=null==c?void 0:c.panes;t?function(e,t){const n=t.slice(0,t.length-1);return n.length===e.length&&n.every(((t,n)=>t===e[n]))}(t,e)&&p([e[e.length-1]]):p([])}),[l.panes,null==c?void 0:c.panes,P]),(0,He.useEffect)((()=>{if(!P)return;const e=l.panes,t=null==c?void 0:c.panes;t?function(e,t){const n=e.slice(0,e.length-1);return n.length===t.length&&n.every(((e,n)=>e===t[n]))}(t,e)&&g([t[t.length-1]]):g([])}),[l.panes,null==c?void 0:c.panes,P]),(0,He.useEffect)((()=>{d(l.panes)}),[l.panes]),(0,He.useEffect)((()=>{h&&0!==(null==h?void 0:h.length)&&(h.length>1?console.warn("More than one pane pending entrance. This is not supported."):async function(e){V(R.Panes,"Animating pane entrance transition from offscreen to the right",e);const t=document.getElementById(e);if(!t)return;const n=t.animate([{transform:"translateX(100%)"},{transform:"translateX(0)"}],{duration:200,easing:"ease-in-out",fill:"both"});await n.finished,sc(t)}($e.S[h[0]]).then((()=>{p([])})))}),[h]),(0,He.useEffect)((()=>{f&&0!==(null==f?void 0:f.length)&&(f.length>1?console.warn("More than one pane pending exit. This is not supported."):async function(e){V(R.Panes,"Animating pane exit transition offscreen to the right",e);const t=document.getElementById(e);if(!t)return;const n=t.animate([{transform:"translateX(100%)"}],{duration:200,easing:"ease-in-out",fill:"both"});await n.finished}($e.S[f[0]]).then((()=>{g([])})))}),[f]),(0,He.useEffect)((()=>{const e=t.addEventObserver((async()=>{const e=t.getPreference(r.PrefKey.TagsPanelWidth,220);y(e)}),r.ApplicationEvent.PreferencesChanged);return()=>{e()}}),[t]);const k=(0,He.useCallback)((e=>{y(e)}),[]),B=(0,He.useCallback)((e=>{w(e)}),[]),O=(0,He.useCallback)((e=>{w(e)}),[]),N=(0,He.useCallback)(((e,n,r,i)=>{t.publishPanelDidResizeEvent(pt.xi,e,i)}),[t]),D=(0,He.useCallback)(((e,n,r,i)=>{t.publishPanelDidResizeEvent(pt.WB,e,i)}),[t]);(0,He.useEffect)((()=>{o&&!(null==a?void 0:a.isTablet)?l.selectedPane!==$e.n.Navigation&&l.removePane($e.n.Navigation):o||!(null==a?void 0:a.isTablet)||l.panes.includes($e.n.Navigation)||l.insertPaneAtIndex($e.n.Navigation,0)}),[o,l,a]);const j=[...u,...f];return V(R.Panes,"Rendering panes",j),(0,e.jsx)("div",{id:"app",className:"app ".concat(s?"w-full":"grid"),style:tg({},(()=>{const e=l.panes,t=e.length;if(s)return{};switch(t){case 1:return{gridTemplateColumns:"auto"};case 2:return l.focusModeEnabled?{gridTemplateColumns:"0 1fr"}:o?{gridTemplateColumns:"1fr 2fr"}:e[0]===$e.n.Navigation?{gridTemplateColumns:"".concat(m,"px auto")}:{gridTemplateColumns:"".concat(b,"px auto")};case 3:return l.focusModeEnabled?{gridTemplateColumns:"0 0 1fr"}:{gridTemplateColumns:"".concat(m,"px ").concat(b,"px 2fr")};default:return{}}})()),children:j.map(((n,o)=>{const a=null==h?void 0:h.includes(n),l=((e,t,n)=>{const r="app-pane app-pane-".concat(n+1," h-full content");return s?"absolute top-0 left-0 w-full flex flex-col ".concat(r," ").concat(t?"translate-x-[100%]":"translate-x-0 "):"flex flex-col relative overflow-hidden ".concat(r)})(0,null!=a&&a,o);return n===$e.n.Navigation?(0,e.jsx)(sf,{id:kl.N.NavigationColumn,ref:A,className:(0,r.classNames)(l,i?"w-full":""),application:t,children:E&&v&&(0,e.jsx)(Yp,{collapsable:!0,defaultWidth:m,hoverable:!0,left:0,minWidth:48,modifyElementWidth:!1,panel:v,resizeFinishCallback:N,side:Kp.Right,type:Hp.WidthOnly,width:m,widthEventCallback:k})},"navigation-pane"):n===$e.n.Items?(0,e.jsx)(Vp,{id:kl.N.ItemsColumn,className:l,ref:C,application:t,onPanelWidthLoad:O,children:E&&S&&(0,e.jsx)(Yp,{collapsable:!0,defaultWidth:400,hoverable:!0,left:0,minWidth:200,modifyElementWidth:!1,panel:S,resizeFinishCallback:D,side:Kp.Right,type:Hp.WidthOnly,width:b,widthEventCallback:B})},"content-list-view"):n===$e.n.Editor?(0,e.jsx)(As,{children:(0,e.jsx)($f,{id:kl.N.EditorColumn,ref:_,className:l,application:t})},"editor-pane"):void 0}))})})),ig=()=>(0,e.jsx)("div",{className:"z-modal flex h-30 w-full items-center bg-danger text-center text-info-contrast",children:(0,e.jsxs)("div",{className:"w-full text-center text-xl font-bold",children:["app.standardnotes.org is no longer maintained. Please switch to"," ",(0,e.jsx)("a",{className:"underline",href:"https://app.standardnotes.com",children:"app.standardnotes.com"})]})});var og=s(75126);function sg(t={}){const n=(0,Ii.M)(t);return(0,e.jsx)(og.fg,{value:n,children:t.children})}function ag(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ag(Object(n),!0).forEach((function(t){cg(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ag(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function cg(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ug={evernote:"bg-[#14cc45] text-[#000]",simplenote:"bg-[#3360cc] text-default","google-keep":"bg-[#fbbd00] text-[#000]",aegis:"bg-[#0d47a1] text-default",plaintext:"bg-default border border-border",html:"bg-accessory-tint-2",super:"bg-accessory-tint-1 text-accessory-tint-1"},dg={evernote:"evernote",simplenote:"simplenote","google-keep":"gkeep",aegis:"aegis",plaintext:"plain-text",html:"rich-text",super:"file-doc"},hg=t=>{let{errored:n}=t;return(0,e.jsxs)(sg,{children:[(0,e.jsx)(_i.p,{children:(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(xn.Z,{type:"warning",className:"flex-shrink-0 text-danger",size:"small"}),"Could not import ",n.length," ",(0,r.pluralize)(n.length,"item","items")," (click for details)"]})}),(0,e.jsx)(xi.k_,{className:"w-full overflow-hidden pl-5",children:n.map(((t,n)=>(0,e.jsxs)("div",{className:"flex w-full items-center gap-1 overflow-hidden",children:[(0,e.jsxs)("span",{children:[n+1,"."]}),(0,e.jsxs)("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap font-semibold",children:[t.name,":"]}),(0,e.jsx)("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:t.error.message})]},n)))})]})},pg=t=>{let{file:n}=t;if("finished"!==n.status)return null;const{notes:i,tags:o,files:s}=(e=>{let t=0,n=0,i=0;for(const o of e)o.content_type===r.ContentType.TYPES.Note?t++:o.content_type===r.ContentType.TYPES.Tag?n++:o.content_type===r.ContentType.TYPES.File&&i++;return{notes:t,tags:n,files:i}})(n.successful),a=[i>0?"".concat(i," ").concat((0,r.pluralize)(i,"note","notes")):"",o>0?"".concat(o," ").concat((0,r.pluralize)(o,"tag","tags")):"",s>0?"".concat(s," ").concat((0,r.pluralize)(s,"file","files")):""].filter(Boolean).join(", ");return(0,e.jsxs)(e.Fragment,{children:[n.successful.length>0&&(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(xn.Z,{type:"check-circle-filled",className:"flex-shrink-0 text-success",size:"small"}),(0,e.jsxs)("span",{children:[a," imported"]})]}),n.errored.length>0&&(0,e.jsx)(hg,{errored:n.errored})]})},fg=(0,Nn.Pi)((t=>{let{file:n,updateFile:i,removeFile:o,importer:s}=t;const[a,l]=(0,He.useState)(!1),[c,u]=(0,He.useState)(!1),d=(0,He.useCallback)((async e=>{e||u(!0),i(lg(lg({},n),{},{service:e,status:"pending"}))}),[n,i]);return(0,He.useEffect)((()=>{void 0===n.service&&(async()=>{l(!0);const e=await s.detectService(n.file);d(e),l(!1)})()}),[n,s,d]),(0,e.jsxs)("div",{className:(0,r.classNames)("flex gap-2 overflow-hidden px-2 py-2.5",null==n.service?"flex-col items-start md:flex-row md:items-center":"items-center"),children:[(0,e.jsxs)("div",{className:"mr-auto flex w-full items-center",children:[n.service&&(0,e.jsx)("div",{className:(0,r.classNames)("mr-4 rounded p-2",ug[n.service]),children:(0,e.jsx)(xn.Z,{type:dg[n.service],size:"medium"})}),(0,e.jsxs)("div",{className:"flex w-full flex-col overflow-hidden",children:[(0,e.jsx)("div",{children:n.file.name}),a?(0,e.jsx)("div",{className:"text-xs opacity-75",children:"Detecting service..."}):(0,e.jsxs)("div",{className:(0,r.classNames)("finished"!==n.status&&"line-clamp-3","w-full text-xs opacity-75"),children:["pending"===n.status&&n.service&&"Ready to import","pending"===n.status&&!n.service&&"Could not auto-detect service. Please select manually.","parsing"===n.status&&"Parsing...","importing"===n.status&&"Importing...","uploading-files"===n.status&&"Uploading and embedding files...","error"===n.status&&n.error.message,(0,e.jsx)(pg,{file:n})]})]})]}),"pending"===n.status&&(0,e.jsxs)("div",{className:"flex items-center",children:[c?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("form",{className:"flex items-center",onSubmit:e=>{e.preventDefault();const t=e.target.elements[0];d(t.value),u(!1)},children:[(0,e.jsxs)("select",{className:"mr-2 rounded border border-border bg-default px-2 py-1 text-sm",defaultValue:n.service?n.service:void 0,children:[(0,e.jsx)("option",{value:"evernote",children:"Evernote"}),(0,e.jsx)("option",{value:"simplenote",children:"Simplenote"}),(0,e.jsx)("option",{value:"google-keep",children:"Google Keep"}),(0,e.jsx)("option",{value:"aegis",children:"Aegis"}),(0,e.jsx)("option",{value:"plaintext",children:"Plaintext"}),(0,e.jsx)("option",{value:"html",children:"HTML"}),(0,e.jsx)("option",{value:"super",children:"Super"})]}),(0,e.jsx)("button",{"aria-label":"Choose service",type:"submit",className:"rounded border border-border bg-default p-1.5 hover:bg-contrast",children:(0,e.jsx)(xn.Z,{type:"check",size:"medium"})})]}),(0,e.jsx)("button",{"aria-label":"Cancel",className:"ml-2 rounded border border-border bg-default p-1.5 hover:bg-contrast",onClick:()=>{u(!1)},children:(0,e.jsx)(xn.Z,{type:"close",size:"medium"})})]}):(0,e.jsx)("button",{"aria-label":"Change service",className:"rounded border border-border bg-default p-1.5 hover:bg-contrast",onClick:()=>{u(!0)},children:(0,e.jsx)(xn.Z,{type:"settings",size:"medium"})}),(0,e.jsx)("button",{"aria-label":"Remove",className:"ml-2 rounded border border-border bg-default p-1.5 hover:bg-contrast",onClick:()=>{o(n.id)},children:(0,e.jsx)(xn.Z,{type:"trash",size:"medium"})})]}),"finished"===n.status&&n.successful.length>0&&0===n.errored.length&&(0,e.jsx)(xn.Z,{type:"check-circle-filled",className:"flex-shrink-0 text-success"}),"error"===n.status&&(0,e.jsx)(xn.Z,{type:"warning",className:"flex-shrink-0 text-danger"})]})})),gg=(0,Nn.Pi)((t=>{let{setFiles:n,selectFiles:i}=t;const o=(0,sr.I)();return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("button",{onClick:()=>i(),className:"flex min-h-[30vh] w-full flex-col items-center justify-center gap-2 rounded border-2 border-dashed border-info p-2 hover:border-4",onDragStart:e=>e.preventDefault(),onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault();const t=Array.from(e.dataTransfer.files);n(t)},children:[(0,e.jsx)("div",{className:"text-lg font-semibold",children:"Drag and drop files to auto-detect and import"}),(0,e.jsx)("div",{className:"text-sm",children:"Or click to open file picker"})]}),(0,e.jsx)("div",{className:"my-4 w-full text-center",children:"or import from:"}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[(0,e.jsxs)(Ln.Z,{className:"flex items-center !py-2",onClick:()=>i("evernote"),children:[(0,e.jsx)(xn.Z,{type:"evernote",className:"mr-2 text-[#14cc45]"}),"Evernote"]}),(0,e.jsxs)(Ln.Z,{className:"flex items-center !py-2",onClick:()=>i("google-keep"),children:[(0,e.jsx)(xn.Z,{type:"gkeep",className:"mr-2 text-[#fbbd00]"}),"Google Keep"]}),(0,e.jsxs)(Ln.Z,{className:"flex items-center !py-2",onClick:()=>i("simplenote"),children:[(0,e.jsx)(xn.Z,{type:"simplenote",className:"mr-2 text-[#3360cc]"}),"Simplenote"]}),(0,e.jsxs)(Ln.Z,{className:"flex items-center !py-2",onClick:()=>i("aegis"),children:[(0,e.jsx)(xn.Z,{type:"aegis",className:"mr-2 rounded bg-[#0d47a1] p-1 text-[#fff]",size:"normal"}),"Aegis"]}),(0,e.jsxs)(Ln.Z,{className:"flex items-center !py-2",onClick:()=>i("plaintext"),children:[(0,e.jsx)(xn.Z,{type:"plain-text",className:"mr-2 text-info"}),"Plaintext / Markdown"]}),(0,e.jsxs)(Ln.Z,{className:"flex items-center !py-2",onClick:()=>i("html"),children:[(0,e.jsx)(xn.Z,{type:"rich-text",className:"mr-2 text-accessory-tint-2"}),"HTML"]}),(0,e.jsxs)(Ln.Z,{className:"flex items-center !py-2",onClick:()=>{o.features.getFeatureStatus(r.NativeFeatureIdentifier.create(r.NativeFeatureIdentifier.TYPES.SuperEditor).getValue())===r.FeatureStatus.Entitled?i("super").catch(console.error):o.showPremiumModal(mp.Super)},children:[(0,e.jsx)(xn.Z,{type:"file-doc",className:"mr-2 text-accessory-tint-1"}),"Super (JSON)"]})]})]})})),mg=(0,Nn.Pi)((t=>{let{importModalController:n}=t;const i=(0,sr.I)(),{files:o,setFiles:s,addFiles:a,addImportsToTag:l,setAddImportsToTag:c,shouldCreateTag:u,setShouldCreateTag:d,existingTagForImports:h,setExistingTagForImports:p,updateFile:f,removeFile:g,parseAndImport:m,isVisible:y,close:v}=n,A=o.length>0&&o.every((e=>"pending"===e.status&&e.service)),b=o.length>0&&o.every((e=>"finished"===e.status||"error"===e.status)),w=(0,He.useMemo)((()=>[{label:"Import",type:"primary",onClick:m,hidden:!A,mobileSlot:"right",disabled:!A||!u&&!h},{label:b?"Close":"Cancel",type:"cancel",onClick:v,mobileSlot:"left"}]),[v,h,b,A,m,u]),S=(0,He.useCallback)((async e=>{const t=await co.Re.selectFiles();a(t,e)}),[a]);return(0,e.jsx)(Fr,{isOpen:y,close:v,children:(0,e.jsxs)(Gn,{title:"Import",close:v,actions:w,className:"flex flex-col",children:[(0,e.jsxs)("div",{className:"min-h-0 flex-grow overflow-y-auto px-4 py-4",children:[!o.length&&(0,e.jsx)(gg,{setFiles:s,selectFiles:S}),o.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"divide-y divide-border",children:o.map((t=>(0,e.jsx)(fg,{file:t,updateFile:f,removeFile:g,importer:i.importer},t.id)))}),!b&&(0,e.jsx)(Ln.Z,{className:"mt-4",onClick:()=>{S().catch(console.error)},small:!0,children:"Add files"})]})]}),o.length>0&&(0,e.jsxs)("div",{className:"flex flex-col gap-3 border-t border-border px-4 py-4 md:gap-2 md:py-3",children:[(0,e.jsx)(po.Z,{className:"flex items-center gap-2",checked:l,onChange:c,children:(0,e.jsx)("span",{className:"text-sm",children:"Add all imported notes to tag"})}),l&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("label",{className:"mt-1.5 flex items-center gap-2 text-sm",children:[(0,e.jsx)("input",{type:"radio",name:"import-tag",className:"h-6 w-6 md:h-4 md:w-4",checked:u,onChange:()=>{d(!0)}}),"Create new tag"]}),(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,e.jsx)("input",{type:"radio",name:"import-tag",className:"h-6 w-6 md:h-4 md:w-4",checked:!u,onChange:()=>{d(!1)}}),"Add to existing tag"]}),h&&(0,e.jsx)(ms.Z,{className:"m-1 mr-2",link:(0,un.X)(h,"linked"),unlinkItem:async()=>{p(void 0)},isBidirectional:!1,inlineFlex:!0})]}),!u&&(0,e.jsx)("div",{className:"ml-8 md:ml-6",children:(0,e.jsx)(gs.Z,{onSelection:e=>p(e),placeholder:"Select tag to add imported notes to...",contentTypes:[r.ContentType.TYPES.Tag]})})]})]})]})]})})})),yg=()=>{const t=(0,sr.I)(),[n,i]=(0,He.useState)(!1),[o,s]=(0,He.useState)((()=>{var e;return!!(null===(e=document.activeElement)||void 0===e?void 0:e.closest("#blocks-editor,#super-mobile-toolbar"))}));return(0,He.useEffect)((()=>t.addNativeMobileEventListener((e=>{e===r.ReactNativeToWebEvent.KeyboardWillShow?i(!0):e===r.ReactNativeToWebEvent.KeyboardWillHide&&i(!1)}))),[t]),(0,He.useEffect)((()=>{const e=()=>{var e;s(!!(null===(e=document.activeElement)||void 0===e?void 0:e.closest("#blocks-editor,#super-mobile-toolbar")))};return document.addEventListener("focusin",e),document.addEventListener("focusout",e),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",e)}}),[]),n?(0,e.jsx)("button",{className:(0,r.classNames)("absolute bottom-1.5 right-3 rounded-full border border-border bg-contrast p-2.5",o&&"hidden"),children:(0,e.jsx)(xn.Z,{type:"keyboard-close"})}):null},vg=t=>{let{className:n}=t;return(0,e.jsx)("div",{className:(0,r.classNames)("relative h-[2px] w-full bg-current","before:absolute before:-left-px before:top-1/2 before:h-0 before:w-0 before:-translate-y-1/2 before:border-b-[6px] before:border-r-[6px] before:border-t-[6px] before:border-current before:border-b-transparent before:border-t-transparent","after:absolute after:-right-px after:top-1/2 after:h-0 after:w-0 after:-translate-y-1/2 after:border-b-[6px] after:border-l-[6px] after:border-t-[6px] after:border-current after:border-b-transparent after:border-t-transparent",n)})},Ag=t=>{let{initialValue:n,handleChange:i,close:o,note:s}=t;const a=(0,et.ac)(et.Jj.sm),[l,c]=(0,He.useState)((()=>n)),[u,d]=(0,He.useState)(!1),h=(0,He.useMemo)((()=>[{label:"Narrow",value:r.EditorLineWidth.Narrow},{label:"Wide",value:r.EditorLineWidth.Wide},{label:"Dynamic",value:r.EditorLineWidth.Dynamic},{label:"Full width",value:r.EditorLineWidth.FullWidth}]),[]),p=(0,He.useCallback)((()=>{i(l,u),o()}),[o,i,u,l]),f=(0,He.useMemo)((()=>[{label:"Cancel",type:"cancel",onClick:o,mobileSlot:"left"},{label:"Done",type:"primary",onClick:p,mobileSlot:"right"}]),[p,o]),g=(0,e.jsx)("div",{className:"text-center text-sm text-passive-2",children:(0,e.jsxs)("div",{className:l!==r.EditorLineWidth.Dynamic?"hidden":"",children:[(0,e.jsx)("div",{className:"mb-2",children:xf[l]}),(0,e.jsx)(vg,{})]})});return(0,e.jsxs)(Gn,{title:"Set editor width",close:o,customHeader:(0,e.jsx)(e.Fragment,{}),customFooter:(0,e.jsx)(e.Fragment,{}),disableCustomHeader:a,actions:f,className:"flex min-h-[50vh] flex-col",children:[(0,e.jsx)("div",{className:"flex min-h-0 flex-grow flex-col overflow-hidden rounded bg-passive-5 p-4 pb-0",children:(0,e.jsxs)("div",{className:(0,r.classNames)("grid flex-grow grid-cols-[0fr_1fr_0fr] gap-3 rounded rounded-b-none bg-default px-2 pt-4 shadow-[0_1px_4px_rgba(0,0,0,0.12),0_2px_8px_rgba(0,0,0,0.04)] transition-all duration-200 md:px-4",l===r.EditorLineWidth.Narrow&&"md:grid-cols-[1fr_60%_1fr]",l===r.EditorLineWidth.Wide&&"md:grid-cols-[1fr_70%_1fr]",l===r.EditorLineWidth.Dynamic&&"md:grid-cols-[1fr_80%_1fr]",l===r.EditorLineWidth.FullWidth&&"md:grid-cols-[1fr_95%_1fr]"),children:[g,(0,e.jsxs)("div",{className:"flex flex-col text-info",children:[(0,e.jsx)("div",{className:"mb-2 text-center text-sm",children:l===r.EditorLineWidth.Narrow||l===r.EditorLineWidth.Wide?"Max. ".concat(_f[l]):_f[l]}),(0,e.jsx)(vg,{}),(0,e.jsx)("div",{className:"w-full flex-grow bg-[linear-gradient(transparent_50%,var(--sn-stylekit-info-color)_50%)] bg-[length:100%_2.5rem] bg-repeat-y opacity-10"})]}),g]})}),!!s&&(0,e.jsx)("div",{className:"border-t border-border bg-default px-4 py-2",children:(0,e.jsxs)("label",{className:"flex items-center gap-2",children:[(0,e.jsx)(po.Z,{checked:u,onChange:d}),"Set globally ",null!=s.editorWidth&&"(will not apply to current note)"]})}),(0,e.jsxs)(Fd,{className:"justify-center md:justify-between",children:[(0,e.jsx)(li.Z,{items:h,value:l,onChange:e=>c(e)}),(0,e.jsxs)("div",{className:"hidden items-center gap-2 md:flex",children:[(0,e.jsx)(Ln.Z,{onClick:o,children:"Cancel"}),(0,e.jsx)(Ln.Z,{onClick:p,primary:!0,children:"Apply"})]})]})]})},bg=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),{notesController:n}=t,[i,o]=(0,He.useState)(!1),[s,a]=(0,He.useState)(!1),l=1!==n.selectedNotesCount||s?void 0:n.selectedNotes[0],c=l?n.getEditorWidthForNote(l):t.preferences.getLocalValue(r.LocalPrefKey.EditorLineWidth,r.PrefDefaults[r.LocalPrefKey.EditorLineWidth]),u=(0,He.useCallback)(((e,i)=>{l&&!i?n.setNoteEditorWidth(l,e).catch(console.error):t.preferences.setLocalValue(r.LocalPrefKey.EditorLineWidth,e)}),[t,l,n]),d=(0,He.useCallback)((()=>{o((e=>!e))}),[]);return(0,He.useEffect)((()=>t.keyboardService.addCommandHandler({command:L.Wu,category:"Current note",description:"Change editor width",onKeyDown:(e,t)=>{a(!("boolean"!=typeof t||!t)&&t),d()}})),[t,d]),(0,e.jsx)(Fr,{isOpen:i,close:d,className:"select-none md:min-w-[40vw]",children:(0,e.jsx)(Ag,{initialValue:c,handleChange:u,close:d,note:l})})})),wg=e=>e.reduce(((e,t)=>(e[t.category].push(t),e)),{"Current note":[],Formatting:[],"Super notes":[],"Notes list":[],General:[]}),Sg=t=>{let{item:n}=t;return(0,e.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2.5",children:[(0,e.jsx)("div",{children:n.description}),(0,e.jsx)(Hr.J,{className:"ml-auto",shortcut:n,small:!1,dimmed:!1})]})},Cg=(0,Nn.Pi)((t=>{let{keyboardService:n}=t;const[r,i]=(0,He.useState)(!1),[o,s]=(0,He.useState)((()=>wg(n.getRegisteredKeyboardShorcutHelpItems()))),a=(0,He.useCallback)((()=>{i(!1)}),[]);(0,He.useEffect)((()=>n.addCommandHandler({command:L.ZL,category:"General",description:"Toggle keyboard shortcuts help",onKeyDown:()=>{s(wg(n.getRegisteredKeyboardShorcutHelpItems())),i((e=>!e))}})),[n]);const l=(0,He.useMemo)((()=>[{label:"Cancel",onClick:a,type:"cancel",mobileSlot:"left"}]),[a]);return(0,e.jsx)(Fr,{isOpen:r,close:a,children:(0,e.jsx)(Gn,{title:"Keyboard shortcuts",close:a,actions:l,children:Object.entries(o).map((t=>{let[n,r]=t;return r.length>0&&(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"p-4 pb-0.5 pt-4 text-base font-semibold capitalize",children:n}),r.map(((t,n)=>(0,e.jsx)(Sg,{item:t},n)))]},n)}))})})})),Eg=(0,He.lazy)((()=>Promise.all([s.e(667),s.e(108)]).then(s.bind(s,33108)))),Ig=n=>{let{application:i,mainApplicationGroup:o}=n;const s=(0,t.t2)(),[a,l]=(0,He.useState)(!1),[c,u]=(0,He.useState)(!0),[d,h]=(0,He.useState)([]),p=(0,He.useRef)(null),f=(0,He.useRef)(null);(0,He.useEffect)((()=>{const e=i.desktopManager;e&&i.componentManager.setDesktopManager(e),i.prepareForLaunch({receiveChallenge:async e=>{const t=d.slice();t.push(e),h(t)}}).then((()=>{i.launch()})).catch(console.error)}),[i]);const g=(0,He.useCallback)((e=>{const t=d.slice();(0,r.removeFromArray)(t,e),h(t)}),[d]),m=(0,He.useCallback)((()=>{u(i.hasPasscode())}),[i]),y=(0,He.useCallback)((()=>{const e=i.routeService.getRoute();if(e.type!==L.Yt.Demo)return;const t=e.demoParams.token;if(!t||i.hasAccount())return;const n=i.status.addMessage("Preparing demo...");i.user.populateSessionFromDemoShareToken(t).then((()=>{i.status.removeMessage(n),i.hideAccountMenu()}))}),[i]),v=(0,He.useCallback)((()=>{l(!0),u(!1),y()}),[y]);(0,He.useEffect)((()=>{i.isStarted()&&m(),i.isLaunched()&&v();const e=i.addEventObserver((async e=>{e===r.ApplicationEvent.Started?m():e===r.ApplicationEvent.Launched?v():e===r.ApplicationEvent.LocalDatabaseReadError?f.current||(0,L.Ne)({text:"Unable to load local database. Please restart the app and try again."}).then((()=>{f.current=null})).catch(console.error):e===r.ApplicationEvent.LocalDatabaseWriteError?p.current||(p.current=(0,L.Ne)({text:"Unable to write to local database. Please restart the app and try again."}).then((()=>{p.current=null})).catch(console.error)):e===r.ApplicationEvent.SyncTooManyRequests&&(0,Y.fz)({type:Y.pC.Error,message:"Too many requests. Please try again later."})}));return()=>{e()}}),[i,v,m]),(0,He.useEffect)((()=>i.protections.addEventObserver((async e=>{e===Ne.Hh3.BiometricsSoftLockEngaged?u(!0):e===Ne.Hh3.BiometricsSoftLockDisengaged&&u(!1)}))),[i]),(0,He.useEffect)((()=>{const e=i.addWebEventObserver((async e=>{e!==r.WebAppEvent.WindowDidFocus&&e!==r.WebAppEvent.WindowDidBlur||await i.protections.isLocked()||i.sync.sync().catch(console.error)}));return()=>{e()}}),[i]);const A=(0,He.useMemo)((()=>!c&&a),[c,a]),b=(0,He.useCallback)((()=>d.map((t=>(0,e.jsx)("div",{className:"sk-modal",children:(0,e.jsx)(vc,{application:i,mainApplicationGroup:o,challenge:t,onDismiss:g},"".concat(t.id).concat(i.ephemeralIdentifier))},"".concat(t.id).concat(i.ephemeralIdentifier))))),[d,o,g,i]);if(!A)return(0,e.jsx)(sr.Z,{application:i,children:(0,e.jsx)(Kn.Z,{application:i,children:b()})});const w=i.routeService.getRoute();return w.type===L.Yt.AppViewRoute&&"extension"===w.appViewRouteParam?(0,e.jsx)(sr.Z,{application:i,children:(0,e.jsx)(Bn.Z,{service:i.keyboardService,children:(0,e.jsx)(Kn.Z,{application:i,children:(0,e.jsx)(Zr.Z,{paneController:i.paneController,children:(0,e.jsx)(Vr,{application:i,children:(0,e.jsx)(xc.Z,{controller:i.linkingController,children:(0,e.jsxs)(zd,{application:i,children:[(0,e.jsx)(Eg,{applicationGroup:o}),(0,e.jsx)(Y.Ix,{}),(0,e.jsx)(jd,{application:i}),b()]})})})})})})}):(0,e.jsx)(sr.Z,{application:i,children:(0,e.jsx)(Bn.Z,{service:i.keyboardService,children:(0,e.jsx)(Kn.Z,{application:i,children:(0,e.jsx)(Zr.Z,{paneController:i.paneController,children:(0,e.jsx)(Vr,{application:i,children:(0,e.jsx)(xc.Z,{controller:i.linkingController,children:(0,e.jsxs)("div",{className:s+" main-ui-view sn-component h-full",children:[(0,e.jsx)(zd,{application:i,children:(0,e.jsx)(rg,{})}),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ri,{application:i,applicationGroup:o}),(0,e.jsx)(zi,{application:i}),(0,e.jsx)(ac,{application:i}),(0,e.jsx)(Sd,{application:i})]}),b(),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Uu,{}),(0,e.jsx)(Ud,{navigationController:i.navigationController,featuresController:i.featuresController}),(0,e.jsx)(Md,{filesController:i.filesController,itemListController:i.itemListController}),(0,e.jsx)(Wu,{application:i}),(0,e.jsx)(_d,{applicationGroup:o,application:i}),(0,e.jsx)(Y.Ix,{}),(0,e.jsx)(jd,{application:i}),(0,e.jsx)(Ld,{application:i}),(0,e.jsx)(bg,{}),(0,e.jsx)(Jd,{application:i}),(0,e.jsx)(mg,{importModalController:i.importModalController}),(0,e.jsx)(Cg,{keyboardService:i.keyboardService})]}),i.routeService.isDotOrg&&(0,e.jsx)(ig,{}),(0,L.gn)()&&(0,e.jsx)(yg,{})]})})})})})})})},_g=(0,Nn.Pi)((t=>{let{application:n,children:r}=t;return n.dealloced?null:(0,e.jsx)(e.Fragment,{children:r})})),xg=t=>(0,e.jsx)("div",{className:"flex h-full w-full items-center justify-center bg-passive-5",role:"alert",children:(0,e.jsx)("div",{className:"challenge-modal shadow-overlay-light relative flex max-w-125 flex-col items-center rounded border border-solid border-border bg-default p-6",children:(0,e.jsx)("div",{className:"text-base lg:text-xs",children:t})})});class Pg extends He.Component{constructor(e){if(super(e),e.device.isDeviceDestroyed())return void(this.state={deviceDestroyed:!0});this.group=new In(e.server,e.device,e.websocketUrl),window.mainApplicationGroup=this.group,this.applicationObserverRemover=this.group.addEventObserver(((e,t)=>{if(e===r.ApplicationGroupEvent.PrimaryApplicationSet){const e=t;this.application=e.application,this.setState({activeApplication:this.application})}else if(e===r.ApplicationGroupEvent.DeviceWillRestart){const e=t;this.setState({dealloced:!0,deallocSource:e.source})}})),this.state={},this.group.initialize().catch(console.error);const n=(0,t.t2)();document.body.classList.contains(n)||document.body.classList.add(n),pt.G9&&document.body.classList.add("chromium")}deinit(){var e,t;this.application=void 0,null===(e=this.applicationObserverRemover)||void 0===e||e.call(this),this.applicationObserverRemover=void 0,null===(t=this.group)||void 0===t||t.deinit(),this.group=void 0,this.setState({dealloced:!0,activeApplication:void 0}),(0,this.props.onDestroy)()}render(){if(this.state.deviceDestroyed){const e="Secure memory has destroyed this application instance. ".concat((0,t.Z$)()?"Restart the app to continue.":"Close this browser tab and open a new one to continue.");return xg(e)}if(this.state.dealloced){const e=this.state.deallocSource===r.DeinitSource.Lock?"Locking workspace...":"Switching workspace...";return xg(e)}return this.group&&this.state.activeApplication&&!this.state.activeApplication.dealloced?(0,e.jsx)("div",{id:this.state.activeApplication.identifier,className:"h-full",children:(0,e.jsx)(_g,{application:this.state.activeApplication,children:(0,e.jsx)(Ig,{mainApplicationGroup:this.group,application:this.state.activeApplication},this.state.activeApplication.ephemeralIdentifier)})},this.state.activeApplication.ephemeralIdentifier):null}}const kg=Pg,Bg="items",Og="readwrite";class Ng{constructor(e,t){this.databaseName=e,this.alertService=t,this.locked=!0}deinit(){this.alertService=void 0,this.db=void 0}unlock(){this.locked=!1}static async getAllDatabaseNames(){if(window.indexedDB.databases)return(await window.indexedDB.databases()).map((e=>e.name)).filter((e=>e&&e.length>0))}static async deleteAll(e){if(null!=window.indexedDB.databases){const t=await this.getAllDatabaseNames();t&&(e=(0,r.uniqueArray)([...t,...e]))}for(const t of e){const e=new Ng(t);await e.clearAllPayloads(),e.deinit()}}async openDatabase(e){if(this.locked)throw Error("Attempting to open locked database");if(this.db)return this.db;const t=window.indexedDB.open(this.databaseName,1);return new Promise(((n,r)=>{t.onerror=e=>{const t=e.target;t.errorCode?this.showAlert("Offline database issue: "+t.errorCode):this.displayOfflineAlert(),r(new Error("Unable to open db"))},t.onblocked=e=>{r(Error("IndexedDB open request blocked"))},t.onsuccess=e=>{const t=e.target.result;t.onversionchange=()=>{t.close()},t.onerror=e=>{const t=null==e?void 0:e.target;throw Error("Database error: "+t.errorCode)},this.db=t,n(t)},t.onupgradeneeded=t=>{const n=t.target.result;n.onversionchange=()=>{n.close()};const r=n.createObjectStore(Bg,{keyPath:"uuid"});r.createIndex("uuid","uuid",{unique:!0}),r.transaction.oncomplete=()=>{1===n.version&&e&&e&&e()}}}))}async getAllPayloads(){const e=await this.openDatabase();return new Promise((t=>{const n=e.transaction(Bg).objectStore(Bg),r=[];n.openCursor().onsuccess=e=>{const n=e.target.result;n?(r.push(n.value),n.continue()):t(r)}}))}async getPayloadsForKeys(e){if(0===e.length)return[];const t=await this.openDatabase();return new Promise((n=>{const r=t.transaction(Bg).objectStore(Bg),i=[];let o=0;for(const t of e){const s=r.get(t);s.onsuccess=t=>{const r=t.target.result;r&&i.push(r),o++,o===e.length&&n(i)},s.onerror=()=>{o++,o===e.length&&n(i)}}}))}async getAllKeys(){const e=await this.openDatabase();return new Promise((t=>{const n=e.transaction(Bg).objectStore(Bg).getAllKeys();n.onsuccess=function(){const e=n.result.map((e=>(0,r.isString)(e)?e:JSON.stringify(e)));t(e)}}))}async savePayload(e){return this.savePayloads([e])}async savePayloads(e){if(0===e.length)return;const t=(await this.openDatabase()).transaction(Bg,Og);return new Promise(((n,r)=>{t.oncomplete=()=>{},t.onerror=e=>{const t=e.target;this.showGenericError(t.error)},t.onabort=e=>{const t=e.target.error;"QuotaExceededError"===t.name?this.showAlert("Unable to save changes locally because your device is out of space. Please free up some disk space and try again, otherwise, your data may end up in an inconsistent state."):this.showGenericError(t),r(t)};const i=t.objectStore(Bg);this.putItems(i,e).then(n).catch(console.error)}))}async putItems(e,t){await Promise.all(t.map((t=>new Promise((n=>{const r=e.put(t);r.onerror=n,r.onsuccess=n})))))}async deletePayload(e){const t=await this.openDatabase();return new Promise(((n,r)=>{const i=t.transaction(Bg,Og).objectStore(Bg).delete(e);i.onsuccess=()=>{n()},i.onerror=r}))}async clearAllPayloads(){const e=window.indexedDB.deleteDatabase(this.databaseName);return new Promise(((t,n)=>{e.onerror=()=>{n(Error("Error deleting database."))},e.onsuccess=()=>{this.db=void 0,t()},e.onblocked=e=>{this.showAlert("Your browser is blocking Standard Notes from deleting the local database. Make sure there are no other open windows of this app and try again. If the issue persists, please manually delete app data to sign out."),n(Error("Delete request blocked"))}}))}showAlert(e){this.alertService?this.alertService.alert(e).catch(console.error):window.alert(e)}showGenericError(e){const t="Unable to save changes locally due to an unknown system issue. "+"Issue Code: ".concat(e.code," Issue Name: ").concat(e.name,".");this.showAlert(t)}displayOfflineAlert(){this.showAlert("There was an issue loading your offline database. This could happen for two reasons:\n\n1. You're in a private window in your browser. We can't save your data without access to the local database. Please use a non-private window.\n\n2. You have two windows of the app open at the same time. Please close any other app instances and reload the page.")}}function Dg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function jg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Dg(Object(n),!0).forEach((function(t){Tg(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Tg(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Mg{constructor(e){this.appVersion=e,this.databases=[]}setApplication(e){const t=new Ng(e.identifier,e.alerts);this.databases.push(t)}removeApplication(e){const t=this.databaseForIdentifier(e.identifier);t&&(t.deinit(),this.databases=this.databases.filter((e=>e!==t)))}deinit(){for(const e of this.databases)e.deinit();this.databases=[]}async getJsonParsedRawStorageValue(e){const t=await this.getRawStorageValue(e);if(null!=t)try{return JSON.parse(t)}catch(e){return t}}databaseForIdentifier(e){return this.databases.find((t=>t.databaseName===e))}async clearAllDataFromDevice(e){return await this.clearRawKeychainValue(),await this.removeAllRawStorageValues(),await Ng.deleteAll(e),{killsApplication:!1}}async getRawStorageValue(e){const t=localStorage.getItem(e);if(null!=t)return t}async setRawStorageValue(e,t){localStorage.setItem(e,t)}async removeRawStorageValue(e){localStorage.removeItem(e)}async removeAllRawStorageValues(){localStorage.clear()}async removeRawStorageValuesForIdentifier(e){await this.removeRawStorageValue((0,r.namespacedKey)(e,r.RawStorageKey.SnjsVersion)),await this.removeRawStorageValue((0,r.namespacedKey)(e,r.RawStorageKey.StorageObject))}async openDatabase(e){return this.databaseForIdentifier(e).unlock(),new Promise(((t,n)=>{this.databaseForIdentifier(e).openDatabase((()=>{t({isNewDatabase:!0})})).then((()=>{t({isNewDatabase:!1})})).catch((e=>{n(e)}))}))}async getDatabaseLoadChunks(e,t){const n=await this.getAllDatabaseEntries(t),{itemsKeyPayloads:i,keySystemRootKeyPayloads:o,keySystemItemsKeyPayloads:s,contentTypePriorityPayloads:a,remainingPayloads:l}=(0,r.GetSortedPayloadsByPriority)(n,e),c={entries:i},u={entries:o},d={entries:s},h={entries:a},p=[];for(let t=0;t<l.length;t+=e.batchSize)p.push({entries:l.slice(t,t+e.batchSize)});return{fullEntries:{itemsKeys:c,keySystemRootKeys:u,keySystemItemsKeys:d,remainingChunks:[h,...p]},remainingChunksItemCount:a.length+l.length}}async getAllDatabaseEntries(e){return this.databaseForIdentifier(e).getAllPayloads()}getDatabaseEntries(e,t){return this.databaseForIdentifier(e).getPayloadsForKeys(t)}async saveDatabaseEntry(e,t){return this.databaseForIdentifier(t).savePayload(e)}async saveDatabaseEntries(e,t){return this.databaseForIdentifier(t).savePayloads(e)}async removeDatabaseEntry(e,t){return this.databaseForIdentifier(t).deletePayload(e)}async removeAllDatabaseEntries(e){return this.databaseForIdentifier(e).clearAllPayloads()}async getNamespacedKeychainValue(e){const t=await this.getKeychainValue();if(t)return t[e]}async setNamespacedKeychainValue(e,t){let n=await this.getKeychainValue();return n||(n={}),this.setKeychainValue(jg(jg({},n),{},{[t]:e}))}async clearNamespacedKeychainValue(e){const t=await this.getKeychainValue();if(t)return delete t[e],this.setKeychainValue(t)}setRawKeychainValue(e){return this.setKeychainValue(e)}openUrl(e){const t=window.open(e,"_blank");t&&t.focus()}async performSoftReset(){window.location.reload()}}const Fg="keychain",Rg="destroyed",Lg="true";class Qg extends Mg{constructor(){super(...arguments),this.environment=r.Environment.Web}async getKeychainValue(){const e=localStorage.getItem(Fg);return e?JSON.parse(e):{}}async setKeychainValue(e){localStorage.setItem(Fg,JSON.stringify(e))}async clearRawKeychainValue(){localStorage.removeItem(Fg)}async performHardReset(){const e=new URL(window.location.href);e.searchParams.append(Rg,Lg),window.location.replace(e.href)}isDeviceDestroyed(){return new URL(window.location.href).searchParams.get(Rg)===Lg}}var Ug=s(17029);const Vg=()=>{const[t,n]=(0,He.useState)(""),[r,i]=(0,He.useState)(null),[o,s]=(0,He.useState)(null),a="file://";(0,He.useEffect)((()=>{window.parent.postMessage({mountedAuthView:!0},a)}),[]),(0,He.useEffect)((()=>{const e=e=>{V(R.U2F,"U2F iframe received message",e),e.origin!==a?V(R.U2F,"Not setting username; origin does not match",e.origin,a):e.data.username&&(n(e.data.username),i(e.data.apiHost),s(e.source))};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}}),[]);const[l,c]=(0,He.useState)(""),[u,d]=(0,He.useState)(""),h=(0,He.useCallback)((async()=>{c(""),d("");try{if(!t||!o)throw new Error("No username provided");const e=await fetch("".concat(r,"/v1/authenticators/generate-authentication-options"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:t})}),n=await e.json();if(!n.data||!n.data.options)throw new Error("No options returned from server");c("Waiting for security key...");const i=await F(n.data.options);o.postMessage({assertionResponse:i},a),c("Authentication successful!")}catch(e){if(!e)return;d(JSON.stringify(e)),console.error(e)}}),[o,t,r]);return(0,e.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2",children:[(0,e.jsx)("div",{className:"mb-2 text-center",children:"Insert your hardware security key, then press the button below to authenticate."}),(0,e.jsx)(Ln.Z,{onClick:h,children:"Authenticate"}),(0,e.jsxs)("div",{className:"mt-2",children:[(0,e.jsx)("div",{children:l}),(0,e.jsx)("div",{className:"text-danger",children:u})]})]})};let Kg=0;const Hg=async function(n,i,o,s){let a;r.SNLog.onLog=console.log,r.SNLog.onError=console.error;const l=()=>{const e=document.getElementById(kl.N.RootId);a.unmount(),e.remove(),c()},c=()=>{const c=document.createElement("div");c.id=kl.N.RootId,c.className="h-full";const u=document.body.appendChild(c);a=(0,Ug.s)(u),(0,t.Hs)(),i.platform===r.Platform.Android&&document.documentElement.style.setProperty("--sn-stylekit-monospace-font",'"Roboto Mono", "Droid Sans Mono", monospace');const d=new L.mc(window.location.href);d.type!==L.Yt.AppViewRoute||"u2f"!==d.appViewRouteParam?(a.render((0,e.jsx)(kg,{server:n,device:i,enableUnfinished:o,websocketUrl:s,onDestroy:l},Kg++)),window.ReactNativeWebView&&window.ReactNativeWebView.postMessage("appLoaded")):a.render((0,e.jsx)(Vg,{}))};"complete"===document.readyState||"interactive"===document.readyState?c():window.addEventListener("DOMContentLoaded",(function e(){c(),window.removeEventListener("DOMContentLoaded",e)}))};n.Ab?setTimeout((()=>{const e=window.reactNativeDevice||new Qg(n.sU);window.isClipper&&(e.environment=r.Environment.Clipper),window.platform=(0,t.Xf)(e),Hg(window.defaultSyncServer,e,window.enabledUnfinishedFeatures,window.websocketUrl).catch(console.error)}),0):window.startApplication=Hg})()})();
          //# sourceMappingURL=app.js.map
          Evidence
          10.0.2.2
          Solution

          Remove the private IP address from the HTTP response body. For comments, use JSP/ASP/PHP comment instead of HTML/JavaScript comment which can be seen by client browsers.

  5. Risk=Low, Confidence=Low (1)

    1. https://app.standardnotes.com (1)

      1. Timestamp Disclosure - Unix (1)
        1. GET https://app.standardnotes.com/app.js
          Alert tags
          Alert description

          A timestamp was disclosed by the application/web server. - Unix

          Other info

          1732584193, which evaluates to: 2024-11-25 19:23:13.

          Request
          Request line and header section (260 bytes)
          GET https://app.standardnotes.com/app.js HTTP/1.1
          host: app.standardnotes.com
          user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0
          pragma: no-cache
          cache-control: no-cache
          referer: https://app.standardnotes.com/
          
          
          Request body (0 bytes)
          Response
          Status line and header section (1606 bytes)
          HTTP/1.1 200 OK
          Date: Thu, 24 Oct 2024 00:02:56 GMT
          Content-Type: text/javascript
          Connection: keep-alive
          x-amz-id-2: qygA8vqkoNTnay5obYKWvx2TTfUFFuJ6HnW7q7ycQNKH5oFANqGBpn9vlJtqmjaNXKqno6Dz0Pc=
          x-amz-request-id: QH1GAMYCF6WH7AQV
          last-modified: Mon, 14 Oct 2024 13:09:55 GMT
          etag: W/"80832e08f7c979c6dd306e2efaf221b2"
          vary: Accept-Encoding
          vary: Origin
          x-frame-options: SAMEORIGIN
          referrer-policy: no-referrer-when-downgrade
          content-security-policy: default-src https: 'self'; base-uri 'self'; child-src * blob:; connect-src api.standardnotes.com sync.standardnotes.org files.standardnotes.com ws://sockets.standardnotes.com raw.githubusercontent.com listed.to blob:; font-src * data:; form-action 'self'; frame-ancestors * file:; frame-src * blob:; img-src 'self' * data: blob:; manifest-src 'self'; media-src 'self' blob: *.standardnotes.com; object-src 'self' blob: *.standardnotes.com; script-src 'self' 'sha256-r26E+iPOhx7KM7cKn4trOSoD8u5E7wL7wwJ8UrR+rGs=' 'wasm-unsafe-eval'; style-src * 'unsafe-hashes' 'sha256-jpJOxTrdc58x4woq2mVygDDIvjIAGNkLZ2yfx4ppdXo=' 'sha256-tbWZ4NP1341cpcrZVDn7B3o9bt/muXgduILAnC0Zbaw=';
          x-content-type-options: nosniff
          strict-transport-security: max-age=31536000; includeSubDomains; preload
          access-control-allow-origin: *
          x-cache: Miss from cloudfront
          via: 1.1 d6ada58e0613f9fa5d29f16dca3993b6.cloudfront.net (CloudFront)
          x-amz-cf-pop: ATL59-P3
          x-amz-cf-id: Gc04d9jFioWz-VXXZuLY1Hpy6o_Cy-bNjlkDIks2aTyTmf06FgiiHg==
          Cache-Control: max-age=14400
          CF-Cache-Status: HIT
          Age: 6865
          Server: cloudflare
          CF-RAY: 8d75b36cef4cbd03-ATL
          content-length: 4045834
          
          
          Response body (4045834 bytes)
          /*! For license information please see app.js.LICENSE.txt */
          (()=>{var e,t,n,r,i={87244:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContentDecoder=void 0,t.ContentDecoder=class{decode(e,t=3){try{const n=t>0?e.substring(t):e,r=Buffer.from(n,"base64").toString();return JSON.parse(r)}catch(e){return{}}}encode(e,t=3){const n=JSON.stringify(e),r=Buffer.from(n).toString("base64");return r.padStart(r.length+t,"0")}}},21467:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},35411:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},30717:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},97936:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},79955:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},85413:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EmailMessageIdentifier=void 0,(n=t.EmailMessageIdentifier||(t.EmailMessageIdentifier={})).WELCOME_EMAIL="WELCOME_EMAIL",n.ACCOUNT_CLAIM="ACCOUNT_CLAIM",n.ACCOUNT_RESET="ACCOUNT_RESET",n.ACTIVATION_CODE="ACTIVATION_CODE",n.VERSION_ADOPTION_REPORT="VERSION_ADOPTION_REPORT",n.FAILED_DROPBOX_BACKUP="FAILED_DROPBOX_BACKUP",n.FAILED_GOOGLE_DRIVE_BACKUP="FAILED_GOOGLE_DRIVE_BACKUP",n.FAILED_ONE_DRIVE_BACKUP="FAILED_ONE_DRIVE_BACKUP",n.DATA_BACKUP="DATA_BACKUP",n.FAILED_BACKUP_ATTACHMENT_TOO_BIG="FAILED_BACKUP_ATTACHMENT_TOO_BIG",n.OFFLINE_SUBSCRIPTION_ACCESS="OFFLINE_SUBSCRIPTION_ACCESS",n.SIGN_IN="SIGN_IN",n.SHARED_SUBSCRIPTION_INVITATION="SHARED_SUBSCRIPTION_INVITATION",n.ENCOURAGE_EMAIL_BACKUPS="ENCOURAGE_EMAIL_BACKUPS",n.ENCOURAGE_SUBSCRIPTION_PURCHASING="ENCOURAGE_SUBSCRIPTION_PURCHASING",n.EXIT_INTERVIEW="EXIT_INTERVIEW",n.STUDENT_DISCOUNT_REQUESTED="STUDENT_DISCOUNT_REQUESTED",n.STUDENT_DISCOUNT_APPROVED="STUDENT_DISCOUNT_APPROVED",n.MARKETING_CAMPAIGN_FILES="MARKETING_CAMPAIGN_FILES",n.MARKETING_BLACK_FRIDAY_2022="MARKETING_BLACK_FRIDAY_2022",n.MARKETING_BLACK_FRIDAY_2022_REMINDER="MARKETING_BLACK_FRIDAY_2022_REMINDER",n.PAYMENT_FAILED="PAYMENT_FAILED",n.SEND_INVOICE="SEND_INVOICE",n.DISCOUNT_NOTICE="DISCOUNT_NOTICE",n.REFUND_NOTICE="REFUND_NOTICE",n.REFUND_REQUESTED="REFUND_REQUESTED",n.RATE_ADJUSTMENT_NOTICE="RATE_ADJUSTMENT_NOTICE",n.EXIT_DISCOUNT="EXIT_DISCOUNT",n.SUBSCRIPTION_CANCELLED="SUBSCRIPTION_CANCELLED"},35219:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},89125:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},86070:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},68597:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},38427:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},45551:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9650:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.KeyParamsOrigination=void 0,(n=t.KeyParamsOrigination||(t.KeyParamsOrigination={})).Registration="registration",n.EmailChange="email-change",n.PasswordChange="password-change",n.ProtocolUpgrade="protocol-upgrade",n.PasscodeCreate="passcode-create",n.PasscodeChange="passcode-change"},32806:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PaymentType=void 0,(n=t.PaymentType||(t.PaymentType={})).Initial="initial",n.Renewal="renewal"},56253:(e,t)=>{"use strict";var n;function r(e,t){return Number(e)-Number(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.isVersionLessThanOrEqualTo=t.leftVersionGreaterThanOrEqualToRight=t.compareVersions=t.protocolVersionFromEncryptedString=t.ProtocolVersionLength=t.isProtocolVersionExpired=t.ProtocolExpirationDates=t.ProtocolVersionLastNonrootItemsKey=t.ProtocolVersionLatest=t.ProtocolVersion=void 0,function(e){e.V001="001",e.V002="002",e.V003="003",e.V004="004"}(n=t.ProtocolVersion||(t.ProtocolVersion={})),t.ProtocolVersionLatest=n.V004,t.ProtocolVersionLastNonrootItemsKey=n.V003,t.ProtocolExpirationDates=Object.freeze({[n.V001]:Date.parse("2018-01-01"),[n.V002]:Date.parse("2020-01-01")}),t.isProtocolVersionExpired=function(e){const n=t.ProtocolExpirationDates[e];return!!n&&(new Date).getTime()>n},t.ProtocolVersionLength=3,t.protocolVersionFromEncryptedString=function(e){const r=e.substring(0,t.ProtocolVersionLength);if(Object.values(n).includes(r))return r;throw Error(`Unrecognized protocol version ${r}`)},t.compareVersions=r,t.leftVersionGreaterThanOrEqualToRight=function(e,t){return r(e,t)>=0},t.isVersionLessThanOrEqualTo=function(e,t){return r(e,t)<=0}},52410:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionBillingFrequency=void 0,(n=t.SubscriptionBillingFrequency||(t.SubscriptionBillingFrequency={}))[n.Monthly=1]="Monthly",n[n.Annual=12]="Annual",n[n.FiveYear=60]="FiveYear"},74911:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionName=void 0,(n=t.SubscriptionName||(t.SubscriptionName={})).PlusPlan="PLUS_PLAN",n.ProPlan="PRO_PLAN"},83402:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},62665:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},90235:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserRequestType=void 0,(t.UserRequestType||(t.UserRequestType={})).ExitDiscount="exit-discount"},25560:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(87244),t),i(n(21467),t),i(n(35411),t),i(n(97936),t),i(n(79955),t),i(n(30717),t),i(n(85413),t),i(n(35219),t),i(n(89125),t),i(n(86070),t),i(n(68597),t),i(n(38427),t),i(n(45551),t),i(n(9650),t),i(n(32806),t),i(n(56253),t),i(n(52410),t),i(n(74911),t),i(n(83402),t),i(n(62665),t),i(n(90235),t)},20875:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(25560),t)},50569:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LegacySession=void 0;const r=n(93461),i=n(33969),o=n(42544);class s extends r.ValueObject{get accessToken(){return this.props.token}constructor(e){super(e)}static create(e){return o.Validator.isNotEmpty(e).isFailed()?i.Result.fail("Could not create legacy session. Token value is empty"):i.Result.ok(new s({token:e}))}}t.LegacySession=s},89957:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},87879:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Session=void 0;const r=n(93461),i=n(33969);class o extends r.ValueObject{get accessToken(){return this.props.accessToken}get refreshToken(){return this.props.refreshToken}isReadOnly(){return this.props.readonlyAccess||!1}constructor(e){super(e)}static create(e,t,n){return i.Result.ok(new o({accessToken:e,refreshToken:t,readonlyAccess:n}))}}t.Session=o},92932:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},65085:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionToken=void 0;const r=n(93461),i=n(33969),o=n(42544);class s extends r.ValueObject{get value(){return this.props.value}get expiresAt(){return this.props.expiresAt}constructor(e){super(e)}static create(e,t){return o.Validator.isNotEmpty(e).isFailed()?i.Result.fail("Could not create session token. Token value is empty"):o.Validator.isNotEmpty(t).isFailed()?i.Result.fail("Could not create session token. Token expiration is empty"):i.Result.ok(new s({value:e,expiresAt:t}))}}t.SessionToken=s},38487:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43324:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CacheEntry=void 0;const r=n(77546),i=n(33969);class o extends r.Entity{constructor(e,t){super(e,t)}static create(e,t){return i.Result.ok(new o(e,t))}}t.CacheEntry=o},78881:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},67794:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},84287:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContentType=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get value(){return this.props.value}constructor(e){super(e),this.displayNamesMap={[o.TYPES.ActionsExtension]:"action-based extension",[o.TYPES.Component]:"component",[o.TYPES.Editor]:"editor",[o.TYPES.File]:"file",[o.TYPES.FilesafeCredentials]:"FileSafe credential",[o.TYPES.FilesafeFileMetadata]:"FileSafe file",[o.TYPES.FilesafeIntegration]:"FileSafe integration",[o.TYPES.ItemsKey]:"encryption key",[o.TYPES.Note]:"note",[o.TYPES.SmartView]:"smart view",[o.TYPES.Tag]:"tag",[o.TYPES.Theme]:"theme",[o.TYPES.UserPrefs]:"user preferences"}}static create(e){return null===e?r.Result.ok(new o({value:null})):Object.values(this.TYPES).includes(e)?r.Result.ok(new o({value:e})):r.Result.fail(`Invalid content type: ${e}`)}getDisplayName(){return this.value?this.displayNamesMap[this.value]||this.value:null}}o.TYPES={Any:"*",Item:"SF|Item",KeySystemItemsKey:"SN|KeySystemItemsKey",KeySystemRootKey:"SN|KeySystemRootKey",TrustedContact:"SN|TrustedContact",VaultListing:"SN|VaultListing",RootKey:"SN|RootKey|NoSync",ItemsKey:"SN|ItemsKey",EncryptedStorage:"SN|EncryptedStorage",Note:"Note",Tag:"Tag",SmartView:"SN|SmartTag",Component:"SN|Component",Editor:"SN|Editor",ActionsExtension:"Extension",UserPrefs:"SN|UserPreferences",HistorySession:"SN|HistorySession",Theme:"SN|Theme",File:"SN|File",FilesafeCredentials:"SN|FileSafe|Credentials",FilesafeFileMetadata:"SN|FileSafe|FileMetadata",FilesafeIntegration:"SN|FileSafe|Integration",ExtensionRepo:"SN|ExtensionRepo"},t.ContentType=o},4273:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},92339:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Dates=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get createdAt(){return this.props.createdAt}get updatedAt(){return this.props.updatedAt}constructor(e){super(e)}static create(e,t){return e instanceof Date?t instanceof Date?r.Result.ok(new o({createdAt:e,updatedAt:t})):r.Result.fail(`Could not create Dates. Update date should be a date object, given: ${t}`):r.Result.fail(`Could not create Dates. Creation date should be a date object, given: ${e}`)}}t.Dates=o},57154:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},63666:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Email=void 0;const r=n(93461),i=n(33969),o=n(42544);class s extends r.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){if(o.Validator.isString(e).isFailed())return i.Result.fail("Email must be a string");const t=e.trim().toLowerCase(),n=o.Validator.isValidEmail(t);return n.isFailed()?i.Result.fail(n.getError()):i.Result.ok(new s({value:t}))}}t.Email=s},63931:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},65180:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RoleName=void 0;const r=n(93461),i=n(33969);class o extends r.ValueObject{get value(){return this.props.value}hasMoreOrEqualPowerTo(e){switch(this.value){case o.NAMES.InternalTeamUser:return!0;case o.NAMES.ProUser:return[o.NAMES.CoreUser,o.NAMES.PlusUser,o.NAMES.ProUser].includes(e.value);case o.NAMES.PlusUser:return[o.NAMES.CoreUser,o.NAMES.PlusUser].includes(e.value);case o.NAMES.CoreUser:case o.NAMES.VaultsUser:return[o.NAMES.CoreUser].includes(e.value);default:throw new Error(`Invalid role name: ${this.value}`)}}constructor(e){super(e)}static create(e){return Object.values(this.NAMES).includes(e)?i.Result.ok(new o({value:e})):i.Result.fail(`Invalid role name: ${e}`)}}o.NAMES={CoreUser:"CORE_USER",PlusUser:"PLUS_USER",ProUser:"PRO_USER",InternalTeamUser:"INTERNAL_TEAM_USER",VaultsUser:"VAULTS_USER"},t.RoleName=o},60216:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RoleNameCollection=void 0;const r=n(93461),i=n(33969),o=n(65180);class s extends r.ValueObject{get value(){return this.props.value}includes(e){for(const t of this.props.value)if(t.value===e.value)return!0;return!1}hasARoleNameWithMoreOrEqualPowerTo(e){for(const t of this.props.value)if(t.hasMoreOrEqualPowerTo(e))return!0;return!1}equals(e){if(this.props.value.length!==e.value.length)return!1;for(const t of e.value)if(!this.includes(t))return!1;return!0}constructor(e){super(e)}static create(e){const t=[];for(const n of e){const e=o.RoleName.create(n);if(e.isFailed())return i.Result.fail(e.getError());t.push(e.getValue())}return i.Result.ok(new s({value:t}))}}t.RoleNameCollection=s},78060:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},49565:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},77803:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Timestamps=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get createdAt(){return this.props.createdAt}get updatedAt(){return this.props.updatedAt}constructor(e){super(e)}static create(e,t){return isNaN(e)||"number"!=typeof e?r.Result.fail(`Could not create Timestamps. Creation date should be a number, given: ${e}`):isNaN(t)||"number"!=typeof t?r.Result.fail(`Could not create Timestamps. Update date should be a number, given: ${t}`):r.Result.ok(new o({createdAt:e,updatedAt:t}))}}t.Timestamps=o},95332:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},96806:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Username=void 0;const r=n(93461),i=n(33969),o=n(42544);class s extends r.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){if(o.Validator.isString(e).isFailed())return i.Result.fail("Username must be a string");const t=e.trim().toLowerCase();return o.Validator.isNotEmpty(t).isFailed()?i.Result.fail("Username cannot be empty"):i.Result.ok(new s({value:t}))}isPotentiallyAPrivateUsernameAccount(){return 64===this.value.length&&!this.value.includes("@")}}t.Username=s},29835:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},26477:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Uuid=void 0;const r=n(93461),i=n(33969),o=n(42544);class s extends r.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){const t=o.Validator.isValidUuid(e);return t.isFailed()?i.Result.fail(t.getError()):i.Result.ok(new s({value:e}))}}t.Uuid=s},55928:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},69838:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Aggregate=void 0;const r=n(77546);class i extends r.Entity{constructor(){super(...arguments),this.changesOnAggregateRoot=[]}addChange(e){this.changesOnAggregateRoot.push(e)}flushChanges(){this.changesOnAggregateRoot=[]}getChanges(){return this.changesOnAggregateRoot}}t.Aggregate=i},39653:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Change=void 0;const r=n(33969);class i{constructor(e){this.props=Object.freeze(e)}static create(e){return Object.values(i.TYPES).includes(e.changeType)?r.Result.ok(new i(e)):r.Result.fail("Invalid change type")}}i.TYPES={Add:"add",Remove:"remove",Modify:"modify"},t.Change=i},24128:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},77546:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Entity=void 0;const r=n(85193);class i{constructor(e,t){this.props=e,this._id=t||new r.UniqueEntityId}get id(){return this._id}equals(e){return null!=e&&null!=e&&(this===e||e instanceof i&&this._id.equals(e._id))}}t.Entity=i},2602:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Id=void 0,t.Id=class{constructor(e){this.value=e}equals(e){return null!=e&&e instanceof this.constructor&&e.toValue()===this.value}toString(){return String(this.value)}toValue(){return this.value}}},33969:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Result=void 0;class n{constructor(e,t,n){this.isSuccess=e,this.error=t,this.value=n,Object.freeze(this)}isFailed(){return!this.isSuccess}getValue(){if(!this.isSuccess)throw new Error(`Cannot get value of an unsuccessfull result: ${this.error}`);return this.value}getError(){if(this.isSuccess||void 0===this.error)throw new Error("Cannot get an error of a successfull result");return this.error}static ok(e){return new n(!0,void 0,e)}static fail(e){return new n(!1,e)}}t.Result=n},85193:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueEntityId=void 0;const r=n(60130),i=n(2602);class o extends i.Id{constructor(e){super(e||(0,r.v4)())}}t.UniqueEntityId=o},42544:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Validator=void 0;const r=n(33969);class i{static isValidUuid(e){return null!==String(e).toLowerCase().match(i.UUID_ANY_VERSION_AND_VARIANT_REGEX)?r.Result.ok():r.Result.fail(`Given value is not a valid uuid: ${e}`)}static isValidEmail(e){return null!==String(e).toLowerCase().match(i.EMAIL_REGEX)?r.Result.ok():r.Result.fail(`Given value is not a valid email address: ${e}`)}static isString(e){return"string"==typeof e?r.Result.ok():r.Result.fail("Given value is not a string: "+typeof e)}static isNotEmpty(e){return e instanceof Array&&0===e.length||null==e||""===e?r.Result.fail(`Given value is empty: ${e}`):r.Result.ok()}static isNotEmptyString(e){const t=i.isString(e);if(t.isFailed())return t;const n=i.isNotEmpty(e);return n.isFailed()?n:r.Result.ok()}}i.UUID_ANY_VERSION_AND_VARIANT_REGEX=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,i.EMAIL_REGEX=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,t.Validator=i},93461:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueObject=void 0,t.ValueObject=class{constructor(e){this.props=Object.freeze(e)}equals(e){return null!=e&&JSON.stringify(this.props)===JSON.stringify(e.props)}}},21797:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},82806:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ControllerContainer=void 0,t.ControllerContainer=class{constructor(){this.controllerMethodsMap=new Map}register(e,t){this.controllerMethodsMap.set(e,t)}get(e){return this.controllerMethodsMap.get(e)}}},30048:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},95951:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmailLevel=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){return Object.values(this.LEVELS).includes(e)?r.Result.ok(new o({value:e})):r.Result.fail(`Invalid subscription rejection level: ${e}`)}}o.LEVELS={System:"SYSTEM",SignIn:"SIGN_IN",Marketing:"MARKETING",FailedCloudBackup:"FAILED_CLOUD_BACKUP",FailedEmailBackup:"FAILED_EMAIL_BACKUP"},t.EmailLevel=o},78690:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},12677:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractEnv=void 0,t.AbstractEnv=class{constructor(e={}){this.env={},this.overrides=e}get(e,t=!1){if(this.env||this.load(),this.overrides[e])return this.overrides[e];if(!process.env[e]&&!t)throw new Error(`Environment variable ${e} not set`);return process.env[e]}getAll(){return this.env||this.load(),this.env}}},49321:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},26112:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationPayload=void 0;const r=n(93461),i=n(33969),o=n(1166),s=n(26477),a=n(63011);class l extends r.ValueObject{constructor(e){super(e)}toString(){var e,t;return JSON.stringify({version:this.props.version,type:this.props.type.value,primaryIdentifier:this.props.primaryIdentifier.value,primaryIndentifierType:this.props.primaryIndentifierType.value,secondaryIdentifier:null===(e=this.props.secondaryIdentifier)||void 0===e?void 0:e.value,secondaryIdentifierType:null===(t=this.props.secondaryIdentifierType)||void 0===t?void 0:t.value})}static createFromString(e){try{const t=JSON.parse(e),n=o.NotificationType.create(t.type);if(n.isFailed())return i.Result.fail(n.getError());const r=n.getValue(),c=s.Uuid.create(t.primaryIdentifier);if(c.isFailed())return i.Result.fail(c.getError());const u=c.getValue(),d=a.NotificationPayloadIdentifierType.create(t.primaryIndentifierType);if(d.isFailed())return i.Result.fail(d.getError());const h=d.getValue();let p,f;if(t.secondaryIdentifier){const e=s.Uuid.create(t.secondaryIdentifier);if(e.isFailed())return i.Result.fail(e.getError());p=e.getValue()}if(t.secondaryIdentifierType){const e=a.NotificationPayloadIdentifierType.create(t.secondaryIdentifierType);if(e.isFailed())return i.Result.fail(e.getError());f=e.getValue()}return l.create({version:t.version,type:r,primaryIdentifier:u,primaryIndentifierType:h,secondaryIdentifier:p,secondaryIdentifierType:f})}catch(e){return i.Result.fail(e.message)}}static create(e){return void 0===e.secondaryIdentifier&&e.type.equals(o.NotificationType.create(o.NotificationType.TYPES.SharedVaultItemRemoved).getValue())?i.Result.fail(`Item uuid is required for ${o.NotificationType.TYPES.SharedVaultItemRemoved} notification type`):i.Result.ok(new l(e))}}t.NotificationPayload=l},63011:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationPayloadIdentifierType=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{constructor(e){super(e)}get value(){return this.props.value}static create(e){return Object.values(this.TYPES).includes(e)?r.Result.ok(new o({value:e})):r.Result.fail(`Invalid notification payload identifier type: ${e}`)}}o.TYPES={SharedVaultUuid:"shared_vault_uuid",UserUuid:"user_uuid",SharedVaultInviteUuid:"shared_vault_invite_uuid",ItemUuid:"item_uuid"},t.NotificationPayloadIdentifierType=o},33980:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},98719:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1166:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationType=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){return Object.values(this.TYPES).includes(e)?r.Result.ok(new o({value:e})):r.Result.fail(`Invalid notification type: ${e}`)}}o.TYPES={SharedVaultItemRemoved:"shared_vault_item_removed",SelfRemovedFromSharedVault:"self_removed_from_shared_vault",UserRemovedFromSharedVault:"user_removed_from_shared_vault",UserDesignatedAsSurvivor:"user_designated_as_survivor",UserAddedToSharedVault:"user_added_to_shared_vault",SharedVaultInviteCanceled:"shared_vault_invite_canceled",SharedVaultFileUploaded:"shared_vault_file_uploaded",SharedVaultFileRemoved:"shared_vault_file_removed"},t.NotificationType=o},33479:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},98401:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},93738:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceContainer=void 0,t.ServiceContainer=class{constructor(){this.serviceMap=new Map}register(e,t){this.serviceMap.set(e.value,t)}get(e){return this.serviceMap.get(e.value)}}},19055:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5775:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceIdentifier=void 0;const r=n(93461),i=n(33969);class o extends r.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){return Object.values(this.NAMES).includes(e)?i.Result.ok(new o({value:e})):i.Result.fail(`Invalid subscription plan name: ${e}`)}}o.NAMES={AnalyticsWorker:"AnalyticsWorker",AnalyticsScheduledTask:"AnalyticsScheduledTask",ApiGateway:"ApiGateway",Auth:"Auth",AuthWorker:"AuthWorker",AuthScheduledTask:"AuthScheduledTask",SyncingServer:"SyncingServer",SyncingServerWorker:"SyncingServerWorker",Revisions:"Revisions",RevisionsWorker:"RevisionsWorker",Files:"Files",FilesWorker:"FilesWorker",SchedulerWorker:"SchedulerWorker",SchedulerScheduledTask:"SchedulerScheduledTask",Email:"Email",EmailWorker:"EmailWorker",EmailBounceProcessor:"EmailBounceProcessor",EmailScheduledTask:"EmailScheduledTask",Websockets:"Websockets",WebsocketsWorker:"WebsocketsWorker"},t.ServiceIdentifier=o},55334:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},35491:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},41406:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SettingName=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get value(){return this.props.value}isSensitive(){return[o.NAMES.MfaSecret,o.NAMES.ExtensionKey].includes(this.props.value)}isASubscriptionSetting(){return[o.NAMES.FileUploadBytesLimit,o.NAMES.FileUploadBytesUsed,o.NAMES.MuteSignInEmails].includes(this.props.value)}isARegularOnlySubscriptionSetting(){return[o.NAMES.FileUploadBytesLimit,o.NAMES.FileUploadBytesUsed].includes(this.props.value)}isASharedAndRegularOnlySubscriptionSetting(){return[o.NAMES.MuteSignInEmails].includes(this.props.value)}constructor(e){super(e)}static create(e){return Object.values(this.NAMES).includes(e)?r.Result.ok(new o({value:e})):r.Result.fail(`Invalid setting name: ${e}`)}}o.NAMES={MfaSecret:"MFA_SECRET",ExtensionKey:"EXTENSION_KEY",EmailBackupFrequency:"EMAIL_BACKUP_FREQUENCY",DropboxBackupFrequency:"DROPBOX_BACKUP_FREQUENCY",DropboxBackupToken:"DROPBOX_BACKUP_TOKEN",OneDriveBackupFrequency:"ONE_DRIVE_BACKUP_FREQUENCY",OneDriveBackupToken:"ONE_DRIVE_BACKUP_TOKEN",GoogleDriveBackupFrequency:"GOOGLE_DRIVE_BACKUP_FREQUENCY",GoogleDriveBackupToken:"GOOGLE_DRIVE_BACKUP_TOKEN",MuteFailedBackupsEmails:"MUTE_FAILED_BACKUPS_EMAILS",MuteFailedCloudBackupsEmails:"MUTE_FAILED_CLOUD_BACKUPS_EMAILS",MuteSignInEmails:"MUTE_SIGN_IN_EMAILS",MuteMarketingEmails:"MUTE_MARKETING_EMAILS",ListedAuthorSecrets:"LISTED_AUTHOR_SECRETS",LogSessionUserAgent:"LOG_SESSION_USER_AGENT",RecoveryCodes:"RECOVERY_CODES",FileUploadBytesLimit:"FILE_UPLOAD_BYTES_LIMIT",FileUploadBytesUsed:"FILE_UPLOAD_BYTES_USED"},t.SettingName=o},10262:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},94478:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultUser=void 0;const r=n(77546),i=n(33969);class o extends r.Entity{constructor(e,t){super(e,t)}static create(e,t){return i.Result.ok(new o(e,t))}}t.SharedVaultUser=o},95626:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultUserPermission=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){return Object.values(this.PERMISSIONS).includes(e)?r.Result.ok(new o({value:e})):r.Result.fail(`Invalid shared vault user permission ${e}`)}}o.PERMISSIONS={Read:"read",Write:"write",Admin:"admin"},t.SharedVaultUserPermission=o},27369:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},76226:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},96829:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionPlanName=void 0;const r=n(93461),i=n(33969);class o extends r.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){return Object.values(this.NAMES).includes(e)?i.Result.ok(new o({value:e})):i.Result.fail(`Invalid subscription plan name: ${e}`)}}o.NAMES={PlusPlan:"PLUS_PLAN",ProPlan:"PRO_PLAN"},t.SubscriptionPlanName=o},13709:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},11829:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},17505:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},69749:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(50569),t),i(n(89957),t),i(n(87879),t),i(n(92932),t),i(n(65085),t),i(n(38487),t),i(n(43324),t),i(n(78881),t),i(n(67794),t),i(n(84287),t),i(n(4273),t),i(n(92339),t),i(n(57154),t),i(n(63666),t),i(n(63931),t),i(n(65180),t),i(n(49565),t),i(n(60216),t),i(n(78060),t),i(n(77803),t),i(n(95332),t),i(n(96806),t),i(n(29835),t),i(n(26477),t),i(n(55928),t),i(n(69838),t),i(n(39653),t),i(n(24128),t),i(n(77546),t),i(n(2602),t),i(n(33969),t),i(n(85193),t),i(n(42544),t),i(n(93461),t),i(n(21797),t),i(n(82806),t),i(n(30048),t),i(n(95951),t),i(n(78690),t),i(n(12677),t),i(n(49321),t),i(n(26112),t),i(n(63011),t),i(n(33980),t),i(n(98719),t),i(n(1166),t),i(n(33479),t),i(n(98401),t),i(n(93738),t),i(n(19055),t),i(n(5775),t),i(n(55334),t),i(n(35491),t),i(n(41406),t),i(n(10262),t),i(n(94478),t),i(n(95626),t),i(n(27369),t),i(n(76226),t),i(n(96829),t),i(n(13709),t),i(n(11829),t),i(n(17505),t)},82648:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(69749),t)},26927:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ApiVersion=void 0,function(e){e.v0="20200115",e.v1="20240226"}(n||(t.ApiVersion=n={}))},57819:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(26927),t)},7941:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.AuthApiOperations=void 0,function(e){e[e.GenerateRecoveryCodes=0]="GenerateRecoveryCodes",e[e.GetRecoveryKeyParams=1]="GetRecoveryKeyParams",e[e.SignInWithRecoveryCodes=2]="SignInWithRecoveryCodes"}(n||(t.AuthApiOperations=n={}))},80605:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AuthApiService=void 0;const i=n(29898),o=n(38130),s=n(7941);t.AuthApiService=class{constructor(e,t){this.authServer=e,this.apiVersion=t,this.operationsInProgress=new Map}generateRecoveryCodes(){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthApiOperations.GenerateRecoveryCodes))throw new i.ApiCallError(o.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthApiOperations.GenerateRecoveryCodes,!0);try{return yield this.authServer.generateRecoveryCodes()}catch(e){throw new i.ApiCallError(o.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthApiOperations.GenerateRecoveryCodes,!1)}}))}recoveryKeyParams(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthApiOperations.GetRecoveryKeyParams))throw new i.ApiCallError(o.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthApiOperations.GetRecoveryKeyParams,!0);try{return yield this.authServer.recoveryKeyParams({api_version:this.apiVersion,code_challenge:e.codeChallenge,recovery_codes:e.recoveryCodes,username:e.username})}catch(e){throw new i.ApiCallError(o.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthApiOperations.GetRecoveryKeyParams,!1)}}))}signInWithRecoveryCodes(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthApiOperations.SignInWithRecoveryCodes))throw new i.ApiCallError(o.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthApiOperations.SignInWithRecoveryCodes,!0);try{return yield this.authServer.signInWithRecoveryCodes({api_version:this.apiVersion,code_verifier:e.codeVerifier,password:e.password,recovery_codes:e.recoveryCodes,username:e.username,hvm_token:e.hvmToken})}catch(e){throw new i.ApiCallError(o.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthApiOperations.SignInWithRecoveryCodes,!1)}}))}}},73987:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},66527:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.AuthenticatorApiOperations=void 0,function(e){e[e.List=0]="List",e[e.Delete=1]="Delete",e[e.GenerateRegistrationOptions=2]="GenerateRegistrationOptions",e[e.GenerateAuthenticationOptions=3]="GenerateAuthenticationOptions",e[e.VerifyRegistrationResponse=4]="VerifyRegistrationResponse"}(n||(t.AuthenticatorApiOperations=n={}))},60356:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AuthenticatorApiService=void 0;const i=n(38130),o=n(29898),s=n(66527);t.AuthenticatorApiService=class{constructor(e){this.authenticatorServer=e,this.operationsInProgress=new Map}list(){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthenticatorApiOperations.List))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthenticatorApiOperations.List,!0);try{return yield this.authenticatorServer.list({})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthenticatorApiOperations.List,!1)}}))}delete(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthenticatorApiOperations.Delete))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthenticatorApiOperations.Delete,!0);try{return yield this.authenticatorServer.delete({authenticatorId:e})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthenticatorApiOperations.Delete,!1)}}))}generateRegistrationOptions(){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthenticatorApiOperations.GenerateRegistrationOptions))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthenticatorApiOperations.GenerateRegistrationOptions,!0);try{return yield this.authenticatorServer.generateRegistrationOptions()}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthenticatorApiOperations.GenerateRegistrationOptions,!1)}}))}verifyRegistrationResponse(e,t,n){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthenticatorApiOperations.VerifyRegistrationResponse))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthenticatorApiOperations.VerifyRegistrationResponse,!0);try{return yield this.authenticatorServer.verifyRegistrationResponse({userUuid:e,name:t,attestationResponse:n})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthenticatorApiOperations.VerifyRegistrationResponse,!1)}}))}generateAuthenticationOptions(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthenticatorApiOperations.GenerateAuthenticationOptions))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthenticatorApiOperations.GenerateAuthenticationOptions,!0);try{return yield this.authenticatorServer.generateAuthenticationOptions({username:e})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthenticatorApiOperations.GenerateAuthenticationOptions,!1)}}))}}},4405:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},23624:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.RevisionApiOperations=void 0,function(e){e[e.List=0]="List",e[e.Delete=1]="Delete",e[e.Get=2]="Get"}(n||(t.RevisionApiOperations=n={}))},33416:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RevisionApiService=void 0;const i=n(38130),o=n(29898),s=n(23624);t.RevisionApiService=class{constructor(e){this.revisionServer=e,this.operationsInProgress=new Map}listRevisions(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.RevisionApiOperations.List))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.RevisionApiOperations.List,!0);try{return yield this.revisionServer.listRevisions({itemUuid:e})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.RevisionApiOperations.List,!1)}}))}getRevision(e,t){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.RevisionApiOperations.Get))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.RevisionApiOperations.Get,!0);try{return yield this.revisionServer.getRevision({itemUuid:e,revisionUuid:t})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.RevisionApiOperations.Get,!1)}}))}deleteRevision(e,t){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.RevisionApiOperations.Delete))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.RevisionApiOperations.Delete,!0);try{return yield this.revisionServer.deleteRevision({itemUuid:e,revisionUuid:t})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.RevisionApiOperations.Delete,!1)}}))}}},68888:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},17737:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionApiOperations=void 0,function(e){e[e.Inviting=0]="Inviting",e[e.CancelingInvite=1]="CancelingInvite",e[e.ListingInvites=2]="ListingInvites",e[e.AcceptingInvite=3]="AcceptingInvite",e[e.ConfirmAppleIAP=4]="ConfirmAppleIAP",e[e.GetSubscription=5]="GetSubscription",e[e.GetAvailableSubscriptions=6]="GetAvailableSubscriptions"}(n||(t.SubscriptionApiOperations=n={}))},37856:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionApiService=void 0;const i=n(38130),o=n(29898),s=n(95658),a=n(17737);t.SubscriptionApiService=class{constructor(e,t){this.subscriptionServer=e,this.apiVersion=t,this.operationsInProgress=new Map}listInvites(){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.ListingInvites))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.ListingInvites,!0);try{return yield this.subscriptionServer.listInvites({[s.ApiEndpointParam.ApiVersion]:this.apiVersion})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.ListingInvites,!1)}}))}cancelInvite(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.CancelingInvite))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.CancelingInvite,!0);try{return yield this.subscriptionServer.cancelInvite({[s.ApiEndpointParam.ApiVersion]:this.apiVersion,inviteUuid:e})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.CancelingInvite,!1)}}))}invite(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.Inviting))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.Inviting,!0);try{return yield this.subscriptionServer.invite({[s.ApiEndpointParam.ApiVersion]:this.apiVersion,identifier:e})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.Inviting,!1)}}))}acceptInvite(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.AcceptingInvite))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.AcceptingInvite,!0);try{return yield this.subscriptionServer.acceptInvite({inviteUuid:e})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.AcceptingInvite,!1)}}))}confirmAppleIAP(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.ConfirmAppleIAP))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.ConfirmAppleIAP,!0);try{return yield this.subscriptionServer.confirmAppleIAP(e)}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.ConfirmAppleIAP,!1)}}))}getUserSubscription(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.GetSubscription))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.GetSubscription,!0);try{return yield this.subscriptionServer.getUserSubscription(e)}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.GetSubscription,!1)}}))}getAvailableSubscriptions(){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.GetAvailableSubscriptions))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.GetAvailableSubscriptions,!0);try{return yield this.subscriptionServer.getAvailableSubscriptions()}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.GetAvailableSubscriptions,!1)}}))}}},57898:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},13167:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.UserApiOperations=void 0,function(e){e[e.Registering=0]="Registering",e[e.SubmittingRequest=1]="SubmittingRequest",e[e.DeletingAccount=2]="DeletingAccount",e[e.UpdatingUser=3]="UpdatingUser"}(n||(t.UserApiOperations=n={}))},45869:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.UserApiService=void 0;const i=n(38130),o=n(29898),s=n(95658),a=n(13167);t.UserApiService=class{constructor(e,t,n){this.userServer=e,this.userRequestServer=t,this.apiVersion=n,this.operationsInProgress=new Map}deleteAccount(e){return r(this,void 0,void 0,(function*(){this.lockOperation(a.UserApiOperations.DeletingAccount);try{const t=yield this.userServer.deleteAccount({userUuid:e});return this.unlockOperation(a.UserApiOperations.DeletingAccount),t}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}}))}submitUserRequest(e){return r(this,void 0,void 0,(function*(){this.lockOperation(a.UserApiOperations.SubmittingRequest);try{const t=yield this.userRequestServer.submitUserRequest({userUuid:e.userUuid,requestType:e.requestType});return this.unlockOperation(a.UserApiOperations.SubmittingRequest),t}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}}))}register(e){return r(this,void 0,void 0,(function*(){this.lockOperation(a.UserApiOperations.Registering);try{const t=yield this.userServer.register(Object.assign({[s.ApiEndpointParam.ApiVersion]:this.apiVersion,password:e.serverPassword,email:e.email,hvm_token:e.hvmToken,ephemeral:e.ephemeral},e.keyParams.getPortableValue()));return this.unlockOperation(a.UserApiOperations.Registering),t}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericRegistrationFail)}}))}updateUser(e){return r(this,void 0,void 0,(function*(){this.lockOperation(a.UserApiOperations.UpdatingUser);try{const t=yield this.userServer.update({[s.ApiEndpointParam.ApiVersion]:this.apiVersion,user_uuid:e.userUuid});return this.unlockOperation(a.UserApiOperations.UpdatingUser),t}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}}))}lockOperation(e){if(this.operationsInProgress.get(e))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(e,!0)}unlockOperation(e){this.operationsInProgress.set(e,!1)}}},56824:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},67958:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.WebSocketApiOperations=void 0,function(e){e[e.CreatingConnectionToken=0]="CreatingConnectionToken"}(n||(t.WebSocketApiOperations=n={}))},62984:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.WebSocketApiService=void 0;const i=n(38130),o=n(29898),s=n(67958);t.WebSocketApiService=class{constructor(e){this.webSocketServer=e,this.operationsInProgress=new Map}createConnectionToken(){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.WebSocketApiOperations.CreatingConnectionToken))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.WebSocketApiOperations.CreatingConnectionToken,!0);try{const e=yield this.webSocketServer.createConnectionToken({});return this.operationsInProgress.set(s.WebSocketApiOperations.CreatingConnectionToken,!1),e}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}}))}}},95736:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},37729:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7941),t),i(n(80605),t),i(n(73987),t),i(n(66527),t),i(n(60356),t),i(n(4405),t),i(n(23624),t),i(n(33416),t),i(n(68888),t),i(n(17737),t),i(n(37856),t),i(n(57898),t),i(n(13167),t),i(n(45869),t),i(n(56824),t),i(n(62984),t),i(n(95736),t)},29898:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ApiCallError=void 0;class n extends Error{constructor(e){super(e),Object.setPrototypeOf(this,n.prototype)}}t.ApiCallError=n},38130:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorMessage=void 0,function(e){e.RegistrationInProgress="An existing registration request is already in progress.",e.GenericRegistrationFail="A server error occurred while trying to register. Please try again.",e.RateLimited="Too many successive server requests. Please wait a few minutes and try again.",e.InsufficientPasswordMessage="Your password must be at least %LENGTH% characters in length. For your security, please choose a longer password or, ideally, a passphrase, and try again.",e.PasscodeRequired="Your passcode is required in order to register for an account.",e.GenericInProgress="An existing request is already in progress.",e.GenericFail="A server error occurred. Please try again."}(n||(t.ErrorMessage=n={}))},65148:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(29898),t),i(n(38130),t)},60256:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.FetchRequestHandler=void 0;const i=n(95658),o=n(22325),s=n(76635),a=n(65148);t.FetchRequestHandler=class{constructor(e,t,n,r){this.snjsVersion=e,this.appVersion=t,this.environment=n,this.logger=r}handleRequest(e){return r(this,void 0,void 0,(function*(){const t=this.createRequest(e);return yield this.runRequest(t,this.createRequestBody(e))}))}createRequest(e){e.params&&e.verb===i.HttpVerb.Get&&Object.keys(e.params).length>0&&(e.url=this.urlForUrlAndParams(e.url,e.params));const t={};if(!e.external){t["X-SNJS-Version"]=this.snjsVersion;const n=`${o.Environment[this.environment]}-${this.appVersion}`;t["X-Application-Version"]=n,e.authentication&&(t.Authorization="Bearer "+e.authentication)}let n=!1;return e.customHeaders&&e.customHeaders.length>0&&e.customHeaders.forEach((({key:e,value:r})=>{t[e]=r,"Content-Type"===e&&(n=!0)})),n||e.external||(t["Content-Type"]="application/json"),new Request(e.url,{method:e.verb,headers:t,credentials:"include"})}runRequest(e,t){return r(this,void 0,void 0,(function*(){try{const n=yield fetch(e,{body:t});return yield this.handleFetchResponse(n)}catch(e){return{status:i.HttpStatusCode.InternalServerError,headers:new Map,data:{error:{message:"message"in e?e.message:"Unknown error"}}}}}))}handleFetchResponse(e){var t,n;return r(this,void 0,void 0,(function*(){const r=e.status,o={status:r,headers:new Map,data:{}};e.headers.forEach(((e,t)=>{o.headers.set(t,e)}));try{if(r!==i.HttpStatusCode.NoContent){let r;const i=(null===(t=o.headers)||void 0===t?void 0:t.get("content-type"))||(null===(n=o.headers)||void 0===n?void 0:n.get("Content-Type"));r=(null==i?void 0:i.includes("application/json"))?JSON.parse(yield e.text()):yield e.arrayBuffer(),r.data||(o.data=r),(0,s.isString)(r)||Object.assign(o,r)}}catch(e){this.logger.error(JSON.stringify(e))}if(r>=i.HttpStatusCode.Success&&r<i.HttpStatusCode.InternalServerError)return r===i.HttpStatusCode.Forbidden&&(0,i.isErrorResponse)(o)&&(o.data.error?o.data.error.message=a.ErrorMessage.RateLimited:o.data.error={message:a.ErrorMessage.RateLimited}),o;{const e=o;return e.data||(e.data={error:{message:"Unknown error"}}),(0,s.isString)(e.data)&&(e.data={error:{message:e.data}}),e.data.error||(e.data.error={message:"Unknown error"}),e}}))}urlForUrlAndParams(e,t){const n=Object.keys(t).map((e=>e+"="+encodeURIComponent(t[e]))).join("&");return e.includes("?")?e+"&"+n:e+"?"+n}createRequestBody(e){return void 0!==e.params&&[i.HttpVerb.Post,i.HttpVerb.Put,i.HttpVerb.Patch,i.HttpVerb.Delete].includes(e.verb)?JSON.stringify(e.params):e.rawBytes}}},56176:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},93763:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.HttpService=void 0;const i=n(87901),o=n(82648),s=n(95658),a=n(41325),l=n(60256);t.HttpService=class{constructor(e,t,n,r,i){this.environment=e,this.appVersion=t,this.snjsVersion=n,this.apiVersion=r,this.logger=i,this.__simulateNextSessionRefreshResponseDrop=!1,this.loggingEnabled=!1,this.requestHandler=new l.FetchRequestHandler(this.snjsVersion,this.appVersion,this.environment,this.logger)}setCallbacks(e,t){this.updateMetaCallback=e,this.refreshSessionCallback=t}deinit(){this.session=void 0,this.updateMetaCallback=void 0,this.refreshSessionCallback=void 0}setSession(e){this.session=e}setHost(e){this.host=e}getHost(){return this.host}getSessionAccessToken(){if(this.session)return this.session instanceof o.Session?this.session.accessToken.value:this.session.accessToken}get(e,t,n){var o;return r(this,void 0,void 0,(function*(){if(!this.host)throw new Error("Attempting to make network request before host is set");return this.runHttp({url:(0,i.joinPaths)(this.host,e),params:t,verb:s.HttpVerb.Get,authentication:null!==(o=null==n?void 0:n.authentication)&&void 0!==o?o:this.getSessionAccessToken()})}))}getExternal(e,t){return r(this,void 0,void 0,(function*(){return this.runHttp({url:e,params:t,verb:s.HttpVerb.Get,external:!0})}))}post(e,t,n){var o;return r(this,void 0,void 0,(function*(){if(!this.host)throw new Error("Attempting to make network request before host is set");return this.runHttp({url:(0,i.joinPaths)(this.host,e),params:t,verb:s.HttpVerb.Post,authentication:null!==(o=null==n?void 0:n.authentication)&&void 0!==o?o:this.getSessionAccessToken(),customHeaders:null==n?void 0:n.headers})}))}put(e,t,n){var o;return r(this,void 0,void 0,(function*(){return this.runHttp({url:(0,i.joinPaths)(this.host,e),params:t,verb:s.HttpVerb.Put,authentication:null!==(o=null==n?void 0:n.authentication)&&void 0!==o?o:this.getSessionAccessToken()})}))}patch(e,t,n){var o;return r(this,void 0,void 0,(function*(){return this.runHttp({url:(0,i.joinPaths)(this.host,e),params:t,verb:s.HttpVerb.Patch,authentication:null!==(o=null==n?void 0:n.authentication)&&void 0!==o?o:this.getSessionAccessToken()})}))}delete(e,t,n){var o;return r(this,void 0,void 0,(function*(){return this.runHttp({url:(0,i.joinPaths)(this.host,e),params:t,verb:s.HttpVerb.Delete,authentication:null!==(o=null==n?void 0:n.authentication)&&void 0!==o?o:this.getSessionAccessToken()})}))}runHttp(e){var t;return r(this,void 0,void 0,(function*(){this.__latencySimulatorMs&&(yield(0,i.sleep)(this.__latencySimulatorMs,!0)),e.params=e.params?this.params(e.params):void 0;const n=e.url===(0,i.joinPaths)(this.host,a.Paths.v1.refreshSession);this.inProgressRefreshSessionPromise&&!n&&(yield this.inProgressRefreshSessionPromise,e.authentication=this.getSessionAccessToken());const r=yield this.requestHandler.handleRequest(e);if(this.loggingEnabled&&(0,s.isErrorResponse)(r)&&this.logger.error("Request failed",e,r),r.meta&&!e.external&&(null===(t=this.updateMetaCallback)||void 0===t||t.call(this,r.meta)),r.status===s.HttpStatusCode.ExpiredAccessToken&&!n&&!e.external){if(this.inProgressRefreshSessionPromise)yield this.inProgressRefreshSessionPromise;else if(e.authentication===this.getSessionAccessToken()){this.inProgressRefreshSessionPromise=this.refreshSession();const e=yield this.inProgressRefreshSessionPromise;let t=!1;if(e.isFailed()||(t=!(0,s.isErrorResponse)(e.getValue())),this.inProgressRefreshSessionPromise=void 0,!t)return r}return e.authentication=this.getSessionAccessToken(),this.runHttp(e)}return r}))}refreshSession(){var e;return r(this,void 0,void 0,(function*(){if(!this.session)return o.Result.fail("No session to refresh");if(this.session instanceof o.LegacySession)return o.Result.fail("Cannot refresh legacy session");const t=yield this.post(a.Paths.v1.refreshSession,{access_token:this.session.accessToken.value,refresh_token:this.session.refreshToken.value});if(this.__simulateNextSessionRefreshResponseDrop)return this.__simulateNextSessionRefreshResponseDrop=!1,o.Result.fail("Simulating a dropped response");if((0,s.isErrorResponse)(t))return o.Result.ok(t);t.meta&&(null===(e=this.updateMetaCallback)||void 0===e||e.call(this,t.meta));const n=o.SessionToken.create(t.data.session.access_token,t.data.session.access_expiration);if(n.isFailed())return o.Result.fail(n.getError());const r=n.getValue(),i=o.SessionToken.create(t.data.session.refresh_token,t.data.session.refresh_expiration);if(i.isFailed())return o.Result.fail(i.getError());const l=i.getValue(),c=o.Session.create(r,l,t.data.session.readonly_access);return c.isFailed()?o.Result.fail(c.getError()):(this.setSession(c.getValue()),this.refreshSessionCallback(this.session),o.Result.ok(t))}))}params(e){return Object.assign(Object.assign({},e),{[s.ApiEndpointParam.ApiVersion]:this.apiVersion})}}},11751:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},23792:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.XMLHttpRequestState=void 0,function(e){e[e.Completed=4]="Completed"}(n||(t.XMLHttpRequestState=n={}))},59774:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(93763),t),i(n(60256),t),i(n(56176),t),i(n(11751),t),i(n(23792),t)},6813:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4960:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8433:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},72548:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},37280:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},25618:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1179:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},68805:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},90327:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},57726:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},75146:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},45512:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(95658)},15829:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(95658)},609:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(95658)},79329:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(95658)},30163:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},33488:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(95658)},19298:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(95658)},57826:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},74815:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},72816:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(6813),t),i(n(4960),t),i(n(8433),t),i(n(72548),t),i(n(37280),t),i(n(25618),t),i(n(1179),t),i(n(68805),t),i(n(90327),t),i(n(57726),t),i(n(75146),t),i(n(45512),t),i(n(15829),t),i(n(609),t),i(n(79329),t),i(n(30163),t),i(n(33488),t),i(n(19298),t),i(n(57826),t),i(n(74815),t)},63404:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},62299:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},30785:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},86237:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},89996:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},27528:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},98259:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},51109:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},89304:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9712:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6605:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},25513:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},99614:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},68533:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},66722:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6497:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},96741:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5209:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5918:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},39761:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(63404),t),i(n(62299),t),i(n(30785),t),i(n(86237),t),i(n(89996),t),i(n(27528),t),i(n(98259),t),i(n(51109),t),i(n(89304),t),i(n(98259),t),i(n(51109),t),i(n(89304),t),i(n(9712),t),i(n(6605),t),i(n(25513),t),i(n(99614),t),i(n(68533),t),i(n(66722),t),i(n(6497),t),i(n(96741),t),i(n(5209),t),i(n(5918),t)},1807:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AsymmetricMessageServer=void 0;const r=n(18109);t.AsymmetricMessageServer=class{constructor(e){this.httpService=e}createMessage(e){return this.httpService.post(r.AsymmetricMessagesPaths.createMessage,{recipient_uuid:e.recipientUuid,encrypted_message:e.encryptedMessage,replaceability_identifier:e.replaceabilityIdentifier})}getInboundUserMessages(){return this.httpService.get(r.AsymmetricMessagesPaths.getInboundUserMessages())}getOutboundUserMessages(){return this.httpService.get(r.AsymmetricMessagesPaths.getOutboundUserMessages())}getMessages(){return this.httpService.get(r.AsymmetricMessagesPaths.getMessages)}deleteMessage(e){return this.httpService.delete(r.AsymmetricMessagesPaths.deleteMessage(e.messageUuid))}deleteAllInboundMessages(){return this.httpService.delete(r.AsymmetricMessagesPaths.deleteAllInboundMessages)}}},71101:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},18109:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AsymmetricMessagesPaths=void 0,t.AsymmetricMessagesPaths={createMessage:"/v1/messages",getMessages:"/v1/messages",updateMessage:e=>`/v1/messages/${e}`,getInboundUserMessages:()=>"/v1/messages",getOutboundUserMessages:()=>"/v1/messages/outbound",deleteMessage:e=>`/v1/messages/${e}`,deleteAllInboundMessages:"/v1/messages/inbound"}},8982:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AuthServer=void 0;const i=n(41325);t.AuthServer=class{constructor(e){this.httpService=e}generateRecoveryCodes(){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.generateRecoveryCodes)}))}recoveryKeyParams(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.recoveryKeyParams,e)}))}signInWithRecoveryCodes(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.signInWithRecoveryCodes,e)}))}}},75325:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},41325:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v1:Object.assign(Object.assign({},{refreshSession:"/v1/sessions/refresh"}),{generateRecoveryCodes:"/v1/recovery/codes",recoveryKeyParams:"/v1/recovery/login-params",signInWithRecoveryCodes:"/v1/recovery/login"})}},24610:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AuthenticatorServer=void 0;const i=n(35821);t.AuthenticatorServer=class{constructor(e){this.httpService=e}list(e){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v1.listAuthenticators,e)}))}delete(e){return r(this,void 0,void 0,(function*(){return this.httpService.delete(i.Paths.v1.deleteAuthenticator(e.authenticatorId),e)}))}generateRegistrationOptions(){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v1.generateRegistrationOptions)}))}verifyRegistrationResponse(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.verifyRegistrationResponse,e)}))}generateAuthenticationOptions(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.generateAuthenticationOptions,e)}))}}},1471:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},35821:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v1:Object.assign({},{listAuthenticators:"/v1/authenticators",deleteAuthenticator:e=>`/v1/authenticators/${e}`,generateRegistrationOptions:"/v1/authenticators/generate-registration-options",verifyRegistrationResponse:"/v1/authenticators/verify-registration",generateAuthenticationOptions:"/v1/authenticators/generate-authentication-options"})}},92272:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v2:Object.assign({},{listRevisions:e=>`/v2/items/${e}/revisions`,getRevision:(e,t)=>`/v2/items/${e}/revisions/${t}`,deleteRevision:(e,t)=>`/v2/items/${e}/revisions/${t}`})}},9784:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RevisionServer=void 0;const i=n(92272);t.RevisionServer=class{constructor(e){this.httpService=e}listRevisions(e){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v2.listRevisions(e.itemUuid))}))}getRevision(e){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v2.getRevision(e.itemUuid,e.revisionUuid))}))}deleteRevision(e){return r(this,void 0,void 0,(function*(){return this.httpService.delete(i.Paths.v2.deleteRevision(e.itemUuid,e.revisionUuid))}))}}},35213:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},83625:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultsPaths=void 0,t.SharedVaultsPaths={getSharedVaults:"/v1/shared-vaults",createSharedVault:"/v1/shared-vaults",deleteSharedVault:e=>`/v1/shared-vaults/${e}`,updateSharedVault:e=>`/v1/shared-vaults/${e}`,createSharedVaultFileValetToken:e=>`/v1/shared-vaults/${e}/valet-tokens`}},29497:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultServer=void 0;const r=n(83625);t.SharedVaultServer=class{constructor(e){this.httpService=e}getSharedVaults(){return this.httpService.get(r.SharedVaultsPaths.getSharedVaults)}createSharedVault(){return this.httpService.post(r.SharedVaultsPaths.createSharedVault)}deleteSharedVault(e){return this.httpService.delete(r.SharedVaultsPaths.deleteSharedVault(e.sharedVaultUuid))}createSharedVaultFileValetToken(e){let t;return e.sharedVaultOwnerUuid&&(t=[{key:"x-shared-vault-owner-context",value:e.sharedVaultOwnerUuid}]),this.httpService.post(r.SharedVaultsPaths.createSharedVaultFileValetToken(e.sharedVaultUuid),{file_uuid:e.fileUuid,remote_identifier:e.remoteIdentifier,operation:e.operation,unencrypted_file_size:e.unencryptedFileSize,move_operation_type:e.moveOperationType,shared_vault_to_shared_vault_move_target_uuid:e.sharedVaultToSharedVaultMoveTargetUuid},{headers:t})}}},41773:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},39593:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultInvitesPaths=void 0,t.SharedVaultInvitesPaths={createInvite:e=>`/v1/shared-vaults/${e}/invites`,updateInvite:(e,t)=>`/v1/shared-vaults/${e}/invites/${t}`,acceptInvite:(e,t)=>`/v1/shared-vaults/${e}/invites/${t}/accept`,declineInvite:(e,t)=>`/v1/shared-vaults/${e}/invites/${t}/decline`,getInboundUserInvites:()=>"/v1/shared-vaults/invites",getOutboundUserInvites:()=>"/v1/shared-vaults/invites/outbound",getSharedVaultInvites:e=>`/v1/shared-vaults/${e}/invites`,deleteInvite:(e,t)=>`/v1/shared-vaults/${e}/invites/${t}`,deleteAllSharedVaultInvites:e=>`/v1/shared-vaults/${e}/invites`,deleteAllInboundInvites:"/v1/shared-vaults/invites/inbound",deleteAllOutboundInvites:"/v1/shared-vaults/invites/outbound"}},55784:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultInvitesServer=void 0;const r=n(39593);t.SharedVaultInvitesServer=class{constructor(e){this.httpService=e}createInvite(e){return this.httpService.post(r.SharedVaultInvitesPaths.createInvite(e.sharedVaultUuid),{recipient_uuid:e.recipientUuid,encrypted_message:e.encryptedMessage,permission:e.permission.value})}updateInvite(e){var t;return this.httpService.patch(r.SharedVaultInvitesPaths.updateInvite(e.sharedVaultUuid,e.inviteUuid),{encrypted_message:e.encryptedMessage,permission:null===(t=e.permission)||void 0===t?void 0:t.value})}acceptInvite(e){return this.httpService.post(r.SharedVaultInvitesPaths.acceptInvite(e.sharedVaultUuid,e.inviteUuid))}declineInvite(e){return this.httpService.post(r.SharedVaultInvitesPaths.declineInvite(e.sharedVaultUuid,e.inviteUuid))}getInboundUserInvites(){return this.httpService.get(r.SharedVaultInvitesPaths.getInboundUserInvites())}getOutboundUserInvites(){return this.httpService.get(r.SharedVaultInvitesPaths.getOutboundUserInvites())}getSharedVaultInvites(e){return this.httpService.get(r.SharedVaultInvitesPaths.getSharedVaultInvites(e.sharedVaultUuid))}deleteInvite(e){return this.httpService.delete(r.SharedVaultInvitesPaths.deleteInvite(e.sharedVaultUuid,e.inviteUuid))}deleteAllSharedVaultInvites(e){return this.httpService.delete(r.SharedVaultInvitesPaths.deleteAllSharedVaultInvites(e.sharedVaultUuid))}deleteAllInboundInvites(){return this.httpService.delete(r.SharedVaultInvitesPaths.deleteAllInboundInvites)}deleteAllOutboundInvites(){return this.httpService.delete(r.SharedVaultInvitesPaths.deleteAllOutboundInvites)}}},49224:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},77183:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultUsersPaths=void 0,t.SharedVaultUsersPaths={getSharedVaultUsers:e=>`/v1/shared-vaults/${e}/users`,deleteSharedVaultUser:(e,t)=>`/v1/shared-vaults/${e}/users/${t}`,designateSurvivor:(e,t)=>`/v1/shared-vaults/${e}/users/${t}/designate-survivor`}},75569:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultUsersServer=void 0;const i=n(77183);t.SharedVaultUsersServer=class{constructor(e){this.httpService=e}designateSurvivor(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.SharedVaultUsersPaths.designateSurvivor(e.sharedVaultUuid.value,e.sharedVaultMemberUuid.value))}))}getSharedVaultUsers(e){return this.httpService.get(i.SharedVaultUsersPaths.getSharedVaultUsers(e.sharedVaultUuid))}deleteSharedVaultUser(e){return this.httpService.delete(i.SharedVaultUsersPaths.deleteSharedVaultUser(e.sharedVaultUuid,e.userUuid))}}},7307:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},63385:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v1:Object.assign(Object.assign(Object.assign(Object.assign({},{invite:"/v1/subscription-invites",acceptInvite:e=>`/v1/subscription-invites/${e}/accept`,declineInvite:e=>`/v1/subscription-invites/${e}/decline`,cancelInvite:e=>`/v1/subscription-invites/${e}`,listInvites:"/v1/subscription-invites"}),{confirmAppleIAP:"/v1/subscriptions/apple_iap_confirm"}),{subscription:e=>`/v1/users/${e}/subscription`}),{availableSubscriptions:"/v2/subscriptions"})}},83527:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionServer=void 0;const i=n(63385);t.SubscriptionServer=class{constructor(e){this.httpService=e}acceptInvite(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.acceptInvite(e.inviteUuid),e)}))}declineInvite(e){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v1.declineInvite(e.inviteUuid),e)}))}cancelInvite(e){return r(this,void 0,void 0,(function*(){return this.httpService.delete(i.Paths.v1.cancelInvite(e.inviteUuid),e)}))}listInvites(e){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v1.listInvites,e)}))}invite(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.invite,e)}))}confirmAppleIAP(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.confirmAppleIAP,e)}))}getUserSubscription(e){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v1.subscription(e.userUuid),e)}))}getAvailableSubscriptions(){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v1.availableSubscriptions)}))}}},79804:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},32288:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v1:Object.assign({},{register:"/v1/users",updateAccount:e=>`/v1/users/${e}`,deleteAccount:e=>`/v1/users/${e}`})}},87466:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.UserServer=void 0;const i=n(32288);t.UserServer=class{constructor(e){this.httpService=e}deleteAccount(e){return r(this,void 0,void 0,(function*(){return this.httpService.delete(i.Paths.v1.deleteAccount(e.userUuid),e)}))}register(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.register,e)}))}update(e){return r(this,void 0,void 0,(function*(){return this.httpService.patch(i.Paths.v1.updateAccount(e.user_uuid),e)}))}}},14786:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4633:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v1:Object.assign({},{submitUserRequest:e=>`/v1/users/${e}/requests`})}},59181:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.UserRequestServer=void 0;const i=n(4633);t.UserRequestServer=class{constructor(e){this.httpService=e}submitUserRequest(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.submitUserRequest(e.userUuid),e)}))}}},39594:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1276:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v1:Object.assign({},{createConnectionToken:"/v1/sockets/tokens"})}},81355:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.WebSocketServer=void 0;const i=n(1276);t.WebSocketServer=class{constructor(e){this.httpService=e}createConnectionToken(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.createConnectionToken,e)}))}}},7404:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},87267:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(8982),t),i(n(75325),t),i(n(24610),t),i(n(1471),t),i(n(9784),t),i(n(35213),t),i(n(1807),t),i(n(71101),t),i(n(29497),t),i(n(41773),t),i(n(75569),t),i(n(7307),t),i(n(83527),t),i(n(79804),t),i(n(55784),t),i(n(49224),t),i(n(87466),t),i(n(14786),t),i(n(59181),t),i(n(39594),t),i(n(81355),t),i(n(7404),t)},74907:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(57819),t),i(n(37729),t),i(n(65148),t),i(n(59774),t),i(n(72816),t),i(n(39761),t),i(n(87267),t)},70781:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(74907),t)},46981:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentAction=void 0,function(e){e.SetSize="set-size",e.StreamItems="stream-items",e.StreamContextItem="stream-context-item",e.SaveItems="save-items",e.CreateItem="create-item",e.CreateItems="create-items",e.DeleteItems="delete-items",e.SetComponentData="set-component-data",e.RequestPermissions="request-permissions",e.DuplicateItem="duplicate-item",e.ComponentRegistered="component-registered",e.ActivateThemes="themes",e.Reply="reply",e.ThemesActivated="themes-activated",e.KeyDown="key-down",e.KeyUp="key-up",e.Click="click"}(n||(t.ComponentAction=n={}))},40611:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentArea=void 0,function(e){e.Editor="editor-editor",e.Themes="themes",e.EditorStack="editor-stack"}(n||(t.ComponentArea=n={}))},92898:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentFlag=void 0,function(e){e.New="New",e.Deprecated="Deprecated"}(n||(t.ComponentFlag=n={}))},45556:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6812:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.noteTypeForEditorIdentifier=t.NoteType=void 0;const r=n(36178);var i;!function(e){e.Authentication="authentication",e.Code="code",e.Markdown="markdown",e.RichText="rich-text",e.Spreadsheet="spreadsheet",e.Task="task",e.Plain="plain-text",e.Super="super",e.Unknown="unknown"}(i||(t.NoteType=i={})),t.noteTypeForEditorIdentifier=function(e){const t=(0,r.FindNativeFeature)(e);return t&&t.note_type?t.note_type:i.Unknown}},75482:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7675:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},92164:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},15077:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},45661:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43834:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},36178:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GetDeprecatedEditors=t.GetDarkThemeFeature=t.GetNativeThemes=t.GetPlainNoteFeature=t.GetSuperNoteFeature=t.GetIframeEditors=t.GetIframeAndNativeEditors=t.FindNativeTheme=t.FindNativeFeature=t.GetFeatures=void 0;const r=n(84135),i=n(4891),o=n(9711),s=n(10379),a=n(85771),l=n(2258),c=n(88280),u=n(88277),d=n(40611);function h(){return[...(0,i.serverFeatures)(),...(0,o.clientFeatures)(),...(0,c.themes)(),...(0,u.nativeEditors)(),...(0,l.IframeEditors)(),...(0,a.experimentalFeatures)(),...(0,s.GetDeprecatedFeatures)()]}function p(e){return h().find((t=>t.identifier===e))}t.GetFeatures=h,t.FindNativeFeature=p,t.FindNativeTheme=function(e){return(0,c.themes)().find((t=>t.identifier===e))},t.GetIframeAndNativeEditors=function(){return[...(0,l.IframeEditors)(),...(0,u.nativeEditors)()]},t.GetIframeEditors=function(){return(0,l.IframeEditors)()},t.GetSuperNoteFeature=function(){return p(r.NativeFeatureIdentifier.TYPES.SuperEditor)},t.GetPlainNoteFeature=function(){return p(r.NativeFeatureIdentifier.TYPES.PlainEditor)},t.GetNativeThemes=function(){return(0,c.themes)()},t.GetDarkThemeFeature=function(){return(0,c.themes)().find((e=>e.identifier===r.NativeFeatureIdentifier.TYPES.DarkTheme))},t.GetDeprecatedEditors=function(){return(0,s.GetDeprecatedFeatures)().filter((e=>e.area===d.ComponentArea.Editor))}},49774:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},84135:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExperimentalFeatures=t.NativeFeatureIdentifier=void 0;const r=n(82648);class i extends r.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){return Object.values(this.TYPES).includes(e)?r.Result.ok(new i({value:e})):r.Result.fail(`Invalid feature identifier: ${e}`)}}t.NativeFeatureIdentifier=i,i.TYPES={DailyEmailBackup:"org.standardnotes.daily-email-backup",Files:"org.standardnotes.files",FilesLowStorageTier:"org.standardnotes.files-low-storage-tier",FilesMaximumStorageTier:"org.standardnotes.files-max-storage-tier",ListedCustomDomain:"org.standardnotes.listed-custom-domain",NoteHistory30Days:"org.standardnotes.note-history-30",NoteHistory365Days:"org.standardnotes.note-history-365",NoteHistoryUnlimited:"org.standardnotes.note-history-unlimited",SignInAlerts:"com.standardnotes.sign-in-alerts",SmartFilters:"org.standardnotes.smart-filters",TagNesting:"org.standardnotes.tag-nesting",TwoFactorAuth:"org.standardnotes.two-factor-auth",UniversalSecondFactor:"org.standardnotes.universal-second-factor",SubscriptionSharing:"org.standardnotes.subscription-sharing",AutobiographyTheme:"org.standardnotes.theme-autobiography",DynamicTheme:"org.standardnotes.theme-dynamic",DarkTheme:"org.standardnotes.theme-focus",FuturaTheme:"org.standardnotes.theme-futura",MidnightTheme:"org.standardnotes.theme-midnight",SolarizedDarkTheme:"org.standardnotes.theme-solarized-dark",TitaniumTheme:"org.standardnotes.theme-titanium",ProtonTheme:"com.standardnotes.theme-proton",PlainEditor:"com.standardnotes.plain-text",SuperEditor:"com.standardnotes.super-editor",SheetsEditor:"org.standardnotes.standard-sheets",TokenVaultEditor:"org.standardnotes.token-vault",Clipper:"org.standardnotes.clipper",Vaults:"org.standardnotes.vaults",SharedVaults:"org.standardnotes.shared-vaults",DeprecatedCodeEditor:"org.standardnotes.code-editor",DeprecatedMarkdownProEditor:"org.standardnotes.advanced-markdown-editor",DeprecatedPlusEditor:"org.standardnotes.plus-editor",DeprecatedTaskEditor:"org.standardnotes.simple-task-editor",DeprecatedMarkdownVisualEditor:"org.standardnotes.markdown-visual-editor",DeprecatedBoldEditor:"org.standardnotes.bold-editor",DeprecatedMarkdownBasicEditor:"org.standardnotes.simple-markdown-editor",DeprecatedMarkdownMathEditor:"org.standardnotes.fancy-markdown-editor",DeprecatedMarkdownMinimistEditor:"org.standardnotes.minimal-markdown-editor",DeprecatedFoldersComponent:"org.standardnotes.folders",DeprecatedFileSafe:"org.standardnotes.file-safe",LegacyFileSafeIdentifier:"org.standardnotes.legacy.file-safe"},t.ExperimentalFeatures=[i.TYPES.Vaults]},39219:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},42116:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},95100:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},58635:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEditorFeatureDescription=t.isIframeComponentFeatureDescription=t.isThemeFeatureDescription=void 0;const r=n(82648),i=n(40611);t.isThemeFeatureDescription=function(e){return"content_type"in e&&e.content_type===r.ContentType.TYPES.Theme},t.isIframeComponentFeatureDescription=function(e){return"content_type"in e&&e.content_type===r.ContentType.TYPES.Component&&[i.ComponentArea.Editor,i.ComponentArea.EditorStack].includes(e.area)},t.isEditorFeatureDescription=function(e){return null!=e.note_type||e.area===i.ComponentArea.Editor}},53908:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9711:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clientFeatures=void 0;const r=n(80),i=n(84135),o=n(82648);t.clientFeatures=function(){return[{name:"Tag Nesting",availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser],identifier:i.NativeFeatureIdentifier.TYPES.TagNesting,permission_name:r.PermissionName.TagNesting,description:"Organize your tags into folders."},{name:"Smart Filters",availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser],identifier:i.NativeFeatureIdentifier.TYPES.SmartFilters,permission_name:r.PermissionName.SmartFilters,description:"Create smart filters for viewing notes matching specific criteria."},{name:"Encrypted files",availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser],identifier:i.NativeFeatureIdentifier.TYPES.Files,permission_name:r.PermissionName.Files,description:""},{name:"Clipper",availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser],identifier:i.NativeFeatureIdentifier.TYPES.Clipper,permission_name:r.PermissionName.Clipper,description:""}]}},10379:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GetDeprecatedFeatures=void 0;const r=n(82648),i=n(80),o=n(84135),s=n(6812),a=n(38732),l=n(46981),c=n(40611);t.GetDeprecatedFeatures=function(){const e=(0,a.FillIframeEditorDefaults)({name:"Code",spellcheckControl:!0,identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedCodeEditor,permission_name:i.PermissionName.DeprecatedCodeEditor,note_type:s.NoteType.Code,file_type:"txt",interchangeable:!0,deprecated:!0,index_path:"index.html",description:"Syntax highlighting and convenient keyboard shortcuts for over 120 programming languages. Ideal for code snippets and procedures.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/code.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),t=(0,a.FillIframeEditorDefaults)({name:"Rich Text",note_type:s.NoteType.RichText,file_type:"html",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedPlusEditor,permission_name:i.PermissionName.DeprecatedPlusEditor,spellcheckControl:!0,deprecated:!0,description:"From highlighting to custom font sizes and colors, to tables and lists, this editor is perfect for crafting any document.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/plus-editor.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),n=(0,a.FillIframeEditorDefaults)({name:"Markdown",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedMarkdownProEditor,note_type:s.NoteType.Markdown,file_type:"md",permission_name:i.PermissionName.DeprecatedMarkdownProEditor,spellcheckControl:!0,deprecated:!0,description:"A fully featured Markdown editor that supports live preview, a styling toolbar, and split pane support.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/adv-markdown.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),u=(0,a.FillIframeEditorDefaults)({name:"Checklist",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedTaskEditor,note_type:s.NoteType.Task,spellcheckControl:!0,file_type:"md",interchangeable:!1,deprecated:!0,permission_name:i.PermissionName.DeprecatedTaskEditor,description:'A great way to manage short-term and long-term to-do"s. You can mark tasks as completed, change their order, and edit the text naturally in place.',thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/task-editor.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),d=(0,a.FillIframeEditorDefaults)({name:"Alternative Rich Text",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedBoldEditor,note_type:s.NoteType.RichText,file_type:"html",component_permissions:[{name:l.ComponentAction.StreamContextItem,content_types:[r.ContentType.TYPES.Note]},{name:l.ComponentAction.StreamItems,content_types:[r.ContentType.TYPES.FilesafeCredentials,r.ContentType.TYPES.FilesafeFileMetadata,r.ContentType.TYPES.FilesafeIntegration]}],spellcheckControl:!0,deprecated:!0,permission_name:i.PermissionName.BoldEditor,description:"A simple and peaceful rich editor that helps you write and think clearly.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/bold.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),h=(0,a.FillIframeEditorDefaults)({name:"Basic Markdown",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedMarkdownBasicEditor,note_type:s.NoteType.Markdown,spellcheckControl:!0,file_type:"md",deprecated:!0,permission_name:i.PermissionName.MarkdownBasicEditor,description:"A Markdown editor with dynamic split-pane preview.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/simple-markdown.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),p=(0,a.FillIframeEditorDefaults)({name:"Markdown Alternative",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedMarkdownVisualEditor,note_type:s.NoteType.Markdown,file_type:"md",deprecated:!0,permission_name:i.PermissionName.MarkdownVisualEditor,spellcheckControl:!0,description:"A WYSIWYG-style Markdown editor that renders Markdown in preview-mode while you type without displaying any syntax.",index_path:"build/index.html",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]});return[e,t,n,u,d,h,(0,a.FillIframeEditorDefaults)({name:"Minimal Markdown",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedMarkdownMinimistEditor,note_type:s.NoteType.Markdown,file_type:"md",index_path:"index.html",permission_name:i.PermissionName.MarkdownMinimistEditor,spellcheckControl:!0,deprecated:!0,description:"A minimal Markdown editor with live rendering and in-text search via Ctrl/Cmd + F",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/min-markdown.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),(0,a.FillIframeEditorDefaults)({name:"Markdown with Math",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedMarkdownMathEditor,spellcheckControl:!0,permission_name:i.PermissionName.MarkdownMathEditor,note_type:s.NoteType.Markdown,file_type:"md",deprecated:!0,index_path:"index.html",description:"A beautiful split-pane Markdown editor with synced-scroll, LaTeX support, and colorful syntax.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/fancy-markdown.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),p,(0,a.FillIframeEditorDefaults)({name:"FileSafe",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedFileSafe,component_permissions:[{name:l.ComponentAction.StreamContextItem,content_types:[r.ContentType.TYPES.Note]},{name:l.ComponentAction.StreamItems,content_types:[r.ContentType.TYPES.FilesafeCredentials,r.ContentType.TYPES.FilesafeFileMetadata,r.ContentType.TYPES.FilesafeIntegration]}],permission_name:i.PermissionName.ComponentFilesafe,area:c.ComponentArea.EditorStack,deprecated:!0,description:"Encrypted attachments for your notes using your Dropbox, Google Drive, or WebDAV server. Limited to 50MB per file.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/FileSafe-banner.png",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]})]}},85771:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.experimentalFeatures=void 0;const r=n(82648),i=n(84135),o=n(80);t.experimentalFeatures=function(){return[{name:"Private vaults",description:"Private vaults allow you to store notes, files and tags into separate, encrypted vaults.",availableInRoles:[r.RoleName.NAMES.CoreUser,r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser],identifier:i.NativeFeatureIdentifier.TYPES.Vaults,permission_name:o.PermissionName.Vaults}]}},2258:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IframeEditors=void 0;const r=n(80),i=n(84135),o=n(6812),s=n(38732),a=n(82648);t.IframeEditors=function(){return[(0,s.FillIframeEditorDefaults)({name:"Authenticator",note_type:o.NoteType.Authentication,file_type:"json",interchangeable:!1,identifier:i.NativeFeatureIdentifier.TYPES.TokenVaultEditor,permission_name:r.PermissionName.TokenVaultEditor,description:"Encrypt and protect your 2FA secrets for all your internet accounts. Authenticator handles your 2FA secrets so that you never lose them again, or have to start over when you get a new device.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/token-vault.png",availableInRoles:[a.RoleName.NAMES.PlusUser,a.RoleName.NAMES.ProUser]}),(0,s.FillIframeEditorDefaults)({name:"Spreadsheet",identifier:i.NativeFeatureIdentifier.TYPES.SheetsEditor,note_type:o.NoteType.Spreadsheet,file_type:"json",interchangeable:!1,permission_name:r.PermissionName.SheetsEditor,description:"A powerful spreadsheet editor with formatting and formula support. Not recommended for large data sets, as encryption of such data may decrease editor performance.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/spreadsheets.png",availableInRoles:[a.RoleName.NAMES.PlusUser,a.RoleName.NAMES.ProUser]})]}},88277:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nativeEditors=void 0;const r=n(82648),i=n(6812),o=n(84135),s=n(80);t.nativeEditors=function(){return[{name:"Super",note_type:i.NoteType.Super,identifier:o.NativeFeatureIdentifier.TYPES.SuperEditor,spellcheckControl:!0,file_type:"json",interchangeable:!1,availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser],permission_name:s.PermissionName.SuperEditor,description:"The best way to edit notes. Type / to bring up the block selection menu, or @ to embed images or link other tags and notes. Type - then space to start a list, or [] then space to start a checklist. Drag and drop an image or file to embed it in your note. Cmd/Ctrl + F to bring up search and replace."},{name:"Plain Text",note_type:i.NoteType.Plain,spellcheckControl:!0,file_type:"txt",interchangeable:!0,identifier:o.NativeFeatureIdentifier.TYPES.PlainEditor,availableInRoles:[r.RoleName.NAMES.CoreUser,r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser],permission_name:s.PermissionName.PlainEditor}]}},4891:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serverFeatures=void 0;const r=n(80),i=n(84135),o=n(82648);t.serverFeatures=function(){return[{name:"Two factor authentication",identifier:i.NativeFeatureIdentifier.TYPES.TwoFactorAuth,permission_name:r.PermissionName.TwoFactorAuth,availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser]},{name:"U2F authentication",identifier:i.NativeFeatureIdentifier.TYPES.UniversalSecondFactor,permission_name:r.PermissionName.UniversalSecondFactor,availableInRoles:[o.RoleName.NAMES.ProUser]},{name:"Unlimited note history",identifier:i.NativeFeatureIdentifier.TYPES.NoteHistoryUnlimited,permission_name:r.PermissionName.NoteHistoryUnlimited,availableInRoles:[o.RoleName.NAMES.ProUser]},{name:"365 days note history",identifier:i.NativeFeatureIdentifier.TYPES.NoteHistory365Days,permission_name:r.PermissionName.NoteHistory365Days,availableInRoles:[o.RoleName.NAMES.PlusUser]},{name:"Email backups",identifier:i.NativeFeatureIdentifier.TYPES.DailyEmailBackup,permission_name:r.PermissionName.DailyEmailBackup,availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser]},{name:"Sign-in email alerts",identifier:i.NativeFeatureIdentifier.TYPES.SignInAlerts,permission_name:r.PermissionName.SignInAlerts,availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser]},{name:"Files maximum storage tier",identifier:i.NativeFeatureIdentifier.TYPES.FilesMaximumStorageTier,permission_name:r.PermissionName.FilesMaximumStorageTier,availableInRoles:[o.RoleName.NAMES.ProUser]},{name:"Files low storage tier",identifier:i.NativeFeatureIdentifier.TYPES.FilesLowStorageTier,permission_name:r.PermissionName.FilesLowStorageTier,availableInRoles:[o.RoleName.NAMES.PlusUser]},{name:"Files medium storage tier",identifier:i.NativeFeatureIdentifier.TYPES.SubscriptionSharing,permission_name:r.PermissionName.SubscriptionSharing,availableInRoles:[o.RoleName.NAMES.ProUser]},{name:"Listed Custom Domain",identifier:i.NativeFeatureIdentifier.TYPES.ListedCustomDomain,permission_name:r.PermissionName.ListedCustomDomain,availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser]},{name:"Shared Vaults",identifier:i.NativeFeatureIdentifier.TYPES.SharedVaults,permission_name:r.PermissionName.SharedVaults,availableInRoles:[o.RoleName.NAMES.InternalTeamUser]}]}},88280:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.themes=void 0;const r=n(80),i=n(84135),o=n(82504),s=n(82648);t.themes=function(){const e=(0,o.FillThemeComponentDefaults)({name:"Midnight",identifier:i.NativeFeatureIdentifier.TYPES.MidnightTheme,permission_name:r.PermissionName.MidnightTheme,isDark:!0,dock_icon:{type:"circle",background_color:"#086DD6",foreground_color:"#ffffff",border_color:"#086DD6"},availableInRoles:[s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser]}),t=(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Futura",identifier:i.NativeFeatureIdentifier.TYPES.FuturaTheme,permission_name:r.PermissionName.FuturaTheme,isDark:!0,dock_icon:{type:"circle",background_color:"#fca429",foreground_color:"#ffffff",border_color:"#fca429"}}),n=(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Solarized Dark",identifier:i.NativeFeatureIdentifier.TYPES.SolarizedDarkTheme,permission_name:r.PermissionName.SolarizedDarkTheme,isDark:!0,dock_icon:{type:"circle",background_color:"#2AA198",foreground_color:"#ffffff",border_color:"#2AA198"}}),a=(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Autobiography",identifier:i.NativeFeatureIdentifier.TYPES.AutobiographyTheme,permission_name:r.PermissionName.AutobiographyTheme,dock_icon:{type:"circle",background_color:"#9D7441",foreground_color:"#ECE4DB",border_color:"#9D7441"}}),l=(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.CoreUser,s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Dark",identifier:i.NativeFeatureIdentifier.TYPES.DarkTheme,permission_name:r.PermissionName.FocusedTheme,clientControlled:!0,isDark:!0,dock_icon:{type:"circle",background_color:"#a464c2",foreground_color:"#ffffff",border_color:"#a464c2"}}),c=(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Titanium",identifier:i.NativeFeatureIdentifier.TYPES.TitaniumTheme,permission_name:r.PermissionName.TitaniumTheme,dock_icon:{type:"circle",background_color:"#6e2b9e",foreground_color:"#ffffff",border_color:"#6e2b9e"}}),u=(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Dynamic Panels",identifier:i.NativeFeatureIdentifier.TYPES.DynamicTheme,permission_name:r.PermissionName.ThemeDynamic,layerable:!0,no_mobile:!0});return[e,t,n,a,l,(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.CoreUser,s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Carbon",identifier:i.NativeFeatureIdentifier.TYPES.ProtonTheme,permission_name:r.PermissionName.ProtonTheme,dock_icon:{type:"circle",background_color:"#16141c",foreground_color:"#ffffff",border_color:"#4a4658"}}),c,u]}},38732:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FillIframeEditorDefaults=void 0;const r=n(82648),i=n(46981),o=n(40611);t.FillIframeEditorDefaults=function(e){return e.index_path||(e.index_path="dist/index.html"),e.component_permissions||(e.component_permissions=[{name:i.ComponentAction.StreamContextItem,content_types:[r.ContentType.TYPES.Note]}]),e.content_type=r.ContentType.TYPES.Component,e.area||(e.area=o.ComponentArea.Editor),null==e.interchangeable&&(e.interchangeable=!0),e}},82504:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FillThemeComponentDefaults=void 0;const r=n(82648),i=n(40611);t.FillThemeComponentDefaults=function(e){return e.index_path||(e.index_path="index.css"),e.content_type=r.ContentType.TYPES.Theme,e.area||(e.area=i.ComponentArea.Themes),e}},93625:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},80:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PermissionName=void 0,function(e){e.AccountSwitcher="app:account-switcher",e.AutobiographyTheme="theme:autobiography",e.BoldEditor="editor:bold",e.DeprecatedCodeEditor="editor:code-editor",e.ComponentFilesafe="component:filesafe",e.ComponentFolders="component:folders",e.DailyEmailBackup="server:daily-email-backup",e.Files="app:files",e.FilesMaximumStorageTier="server:files-max-storage-tier",e.FilesLowStorageTier="server:files-low-storage-tier",e.FocusedTheme="theme:focused",e.FocusMode="app:focus-mode",e.FuturaTheme="theme:futura",e.ListedCustomDomain="listed:custom-domain",e.MarkdownBasicEditor="editor:markdown-basic",e.MarkdownMathEditor="editor:markdown-math",e.MarkdownMinimistEditor="editor:markdown-minimist",e.DeprecatedMarkdownProEditor="editor:markdown-pro",e.MarkdownVisualEditor="editor:markdown-visual",e.MidnightTheme="theme:midnight",e.NoteHistory30Days="server:note-history-30-days",e.NoteHistory365Days="server:note-history-365-days",e.NoteHistoryUnlimited="server:note-history-unlimited",e.PlainEditor="editor:plain",e.DeprecatedPlusEditor="editor:plus",e.SheetsEditor="editor:sheets",e.SignInAlerts="server:sign-in-alerts",e.SmartFilters="app:smart-filters",e.SolarizedDarkTheme="theme:solarized-dark",e.TagNesting="app:tag-nesting",e.DeprecatedTaskEditor="editor:task-editor",e.ThemeDynamic="theme:dynamic",e.TitaniumTheme="theme:titanium",e.TokenVaultEditor="editor:token-vault",e.TwoFactorAuth="server:two-factor-auth",e.UniversalSecondFactor="server:universal-second-factor",e.SubscriptionSharing="server:subscription-sharing",e.SuperEditor="editor:super-editor",e.Clipper="app:clipper",e.Vaults="app:vaults",e.SharedVaults="server:shared-vaults",e.ProtonTheme="theme:proton"}(n||(t.PermissionName=n={}))},34404:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7675),t),i(n(84135),t),i(n(36178),t),i(n(58635),t),i(n(95100),t),i(n(15077),t),i(n(39219),t),i(n(49774),t),i(n(45661),t),i(n(92164),t),i(n(43834),t),i(n(42116),t),i(n(53908),t),i(n(93625),t),i(n(80),t),i(n(46981),t),i(n(40611),t),i(n(92898),t),i(n(45556),t),i(n(6812),t),i(n(75482),t)},84409:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(34404),t)},54310:(e,t,n)=>{"use strict";n.d(t,{Re:()=>l,N4:()=>u,XQ:()=>f,KC:()=>d,A7:()=>p,vU:()=>a});var r=n(87985);const i=1024,o=1048576,s=1073741824;function a(e){let t=e,n="B";return e>=s?(t=e/s,n="GB"):e>=o?(t=e/o,n="MB"):e>=i&&(t=e/i,n="KB"),`${Number.isInteger(t)?t:t.toFixed(2)} ${n}`}const l={selectFiles:function(){const e=function(){let e=document.getElementById(c);return e||(e=document.createElement("input"),e.id=c,e.type="file",e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.height="1px",e.style.width="1px",e.style.opacity="0",e.style.zIndex="-50",e.multiple=!0,document.body.appendChild(e),e)}();return new Promise((t=>{e.onchange=async n=>{const r=n.target,i=[];for(const e of Array.from(r.files))i.push(e);t(i),e.value=""},e.click()}))},readFile:async function(e,t,n){const i=await async function(e){const t=new FileReader;return t.readAsArrayBuffer(e),new Promise((e=>{t.onload=t=>{const n=t.target.result;e(new Uint8Array(n))}}))}(e),o=new r.M1(t,n),s=2e6;for(let e=0;e<i.length;e+=s){const t=e+s,n=i.slice(e,t),r=t>=i.length;await o.addBytes(n,r)}return{name:e.name,mimeType:e.type}},available:function(){return!0},maximumFileSize:function(){return 5e7}},c="classic-reader-file-input";class u{constructor(){this.loggingEnabled=!1}log(...e){this.loggingEnabled&&console.log(e)}static maximumFileSize(){return 5e7}saveFile(e,t){this.log("Saving file to disk..."),function(e,t){const n=document.createElement("a"),r=new Blob([t],{type:"text/plain;charset=utf-8"});n.href=window.URL.createObjectURL(r),n.setAttribute("download",e),document.body.appendChild(n),n.click(),n.remove(),window.URL.revokeObjectURL(n.href)}(e,t),this.log("Closing write stream")}}const d={getFilesFromHandles:h,selectFiles:async function(){let e;try{e=await window.showOpenFilePicker({multiple:!0})}catch(t){e=[]}return h(e)},readFile:async function(e,t,n){const i=new r.M1(t,n),o=e.stream().getReader();let s;const a=async e=>{if(!e.done)return s&&await i.addBytes(s,!1),s=e.value,o.read().then(a);await i.addBytes(s,!0)};return await o.read().then(a),{name:e.name,mimeType:e.type}},available:function(){return null!=window.showOpenFilePicker},maximumFileSize:function(){}};function h(e){return Promise.all(e.map((e=>e.getFile())))}class p{constructor(e){this.name=e,this.loggingEnabled=!1}log(...e){this.loggingEnabled&&console.log(e)}static available(){return null!=window.showSaveFilePicker}async selectFileToSaveTo(e){this.log("Showing save file picker");const t=e||await window.showSaveFilePicker({suggestedName:this.name});this.writableStream=await t.createWritable()}async pushBytes(e){if(!this.writableStream)throw Error("Must call selectFileToSaveTo first");this.log("Writing chunk to disk of size",e.length),await this.writableStream.write(e)}async finish(){if(!this.writableStream)throw Error("Must call selectFileToSaveTo first");this.log("Closing write stream"),await this.writableStream.close()}}class f{async selectDirectory(){try{return{nativeHandle:await window.showDirectoryPicker()}}catch(e){return"aborted"}}async createFile(e,t){const n=await e.nativeHandle.getFileHandle(t,{create:!0}),r=await n.createWritable();return{nativeHandle:n,writableStream:r}}async createDirectory(e,t){return{nativeHandle:await e.nativeHandle.getDirectoryHandle(t,{create:!0})}}async saveBytes(e,t){return await e.writableStream.write(t),"success"}async saveString(e,t){return await e.writableStream.write(t),"success"}async closeFileWriteStream(e){return await e.writableStream.close(),"success"}async selectFile(){try{return{nativeHandle:(await window.showOpenFilePicker())[0]}}catch(e){return"aborted"}}async readFile(e,t){const n=(await e.nativeHandle.getFile()).stream().getReader();let r;const i=async e=>{if(!e.done)return r&&await t(r,!1),r=e.value,n.read().then(i);await t(r,!0)};return await n.read().then(i),"success"}}},87985:(e,t,n)=>{"use strict";n.d(t,{M1:()=>r,Qc:()=>s}),n(87901);class r{constructor(e,t){this.minimumChunkSize=e,this.onChunk=t,this.loggingEnabled=!1,this.bytes=new Uint8Array,this.index=1}log(...e){this.loggingEnabled&&console.log(e)}async addBytes(e,t){this.bytes=new Uint8Array([...this.bytes,...e]),this.log(`Chunker adding ${e.length}, total size ${this.bytes.length}`),(this.bytes.length>=this.minimumChunkSize||t)&&await this.popBytes(t)}async popBytes(e){const t=Math.max(this.minimumChunkSize,this.bytes.length),n=this.bytes.slice(0,t);this.bytes=new Uint8Array([...this.bytes.slice(t)]),this.log(`Chunker popping ${n.length}, total size in queue ${this.bytes.length}`),await this.onChunk({data:n,index:this.index++,isLast:e})}}var i,o;function s(e,t,n){const r=Math.floor(e.percentComplete);let i=`Downloading file ${"network"===e.source?"":"memcache"===e.source?"from cache":"from backup"} "${t}"`;return n.showPercent&&(i+=` (${r}%)`),i}n(95658),n(98418),(o=i||(i={}))[o.FilesPackage=0]="FilesPackage",i.FilesPackage,i.FilesPackage},2577:e=>{"use strict";var t;self,t=()=>(()=>{var e={578:(e,t)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var r=Symbol.for("react.element"),i=(Symbol.for("react.portal"),Symbol.for("react.fragment"),Symbol.for("react.strict_mode"),Symbol.for("react.profiler"),Symbol.for("react.provider"),Symbol.for("react.context"),Symbol.for("react.forward_ref"),Symbol.for("react.suspense"),Symbol.for("react.memo"),Symbol.for("react.lazy"),Symbol.iterator,{isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}}),o=Object.assign,s={};function a(e,t,n){this.props=e,this.context=t,this.refs=s,this.updater=n||i}function l(){}function c(e,t,n){this.props=e,this.context=t,this.refs=s,this.updater=n||i}a.prototype.isReactComponent={},a.prototype.setState=function(e,t){if("object"!==n(e)&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},a.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},l.prototype=a.prototype;var u=c.prototype=new l;u.constructor=c,o(u,a.prototype),u.isPureReactComponent=!0,Array.isArray;var d=Object.prototype.hasOwnProperty,h=null,p={key:!0,ref:!0,__self:!0,__source:!0};t.createElement=function(e,t,n){var i,o={},s=null,a=null;if(null!=t)for(i in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(s=""+t.key),t)d.call(t,i)&&!p.hasOwnProperty(i)&&(o[i]=t[i]);var l=arguments.length-2;if(1===l)o.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];o.children=c}if(e&&e.defaultProps)for(i in l=e.defaultProps)void 0===o[i]&&(o[i]=l[i]);return{$$typeof:r,type:e,key:s,ref:a,props:o,_owner:h}}},694:(e,t,n)=>{e.exports=n(578)}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{n.r(r),n.d(r,{AccessibilityIcon:()=>i,AccountCardDetailsOutlineIcon:()=>s,AccountCircleIcon:()=>l,AccountIllustration:()=>u,AccountVariantIcon:()=>h,AddBoldIcon:()=>f,AddIcon:()=>m,AddTextIcon:()=>v,AegisIcon:()=>b,ArchiveIcon:()=>S,ArrowDownCheckmarkIcon:()=>E,ArrowDownIcon:()=>_,ArrowLeftIcon:()=>P,ArrowRightIcon:()=>B,ArrowUpIcon:()=>Q,ArrowsHorizontalIcon:()=>N,ArrowsSortDownIcon:()=>j,ArrowsSortUpIcon:()=>M,ArrowsVerticalIcon:()=>R,AsteriskIcon:()=>V,AttachmentFileIcon:()=>H,AuthenticatorIcon:()=>Y,AuthenticatorVariantIcon:()=>Z,BackIosIcon:()=>q,BackspaceIcon:()=>X,BlockIcon:()=>ee,BlueDotIcon:()=>ne,BoldIcon:()=>ie,BoxFilledIcon:()=>se,BoxIcon:()=>le,CameraIcon:()=>ue,CaretRightIcon:()=>he,CheckAllIcon:()=>fe,CheckBoldIcon:()=>me,CheckCircleFilledIcon:()=>ve,CheckCircleIcon:()=>be,CheckIcon:()=>Se,CheckListIcon:()=>Ee,ChevronDownIcon:()=>_e,ChevronLeftIcon:()=>Pe,ChevronRightIcon:()=>Be,ChevronUpIcon:()=>Ne,CircleIcon:()=>je,ClearCircleFilledIcon:()=>Me,ClockIcon:()=>Qe,CloseCircleFilledIcon:()=>Re,CloseIcon:()=>Ve,CloudOffIcon:()=>He,CodeIcon:()=>Ye,CodeTagsIcon:()=>Ze,ColorFillIcon:()=>qe,CopyIcon:()=>Xe,CreateAccountIllustration:()=>et,DashboardIcon:()=>nt,DetailsBlockIcon:()=>la,DiamondFilledIcon:()=>it,DiamondIcon:()=>st,DownloadIcon:()=>lt,DragIcon:()=>ut,DrawIcon:()=>ht,EditorFilledIcon:()=>ft,EditorIcon:()=>mt,EmailFilledIcon:()=>vt,EmailIcon:()=>bt,EnterIcon:()=>St,EvernoteIcon:()=>Et,EyeFilledIcon:()=>_t,EyeIcon:()=>Pt,EyeOffFilledIcon:()=>Bt,EyeOffIcon:()=>Nt,FeedbackIcon:()=>jt,FileDocIcon:()=>Mt,FileErrorIcon:()=>Rt,FileFilledIcon:()=>Qt,FileIcon:()=>Vt,FileImageIcon:()=>Ht,FileMovIcon:()=>Yt,FileMusicIcon:()=>Zt,FileOtherIcon:()=>qt,FilePdfIcon:()=>Xt,FilePptIcon:()=>en,FileSelectedIcon:()=>nn,FileXlsIcon:()=>an,FileZipIcon:()=>cn,FilesIllustration:()=>on,FolderFilledIcon:()=>dn,FolderIcon:()=>pn,FolderKeyFilledIcon:()=>gn,FormatAlignCenterIcon:()=>yn,FormatAlignJustifyIcon:()=>An,FormatAlignLeftIcon:()=>wn,FormatAlignRightIcon:()=>Cn,ForwardIosIcon:()=>In,FullscreenExitIcon:()=>xn,FullscreenIcon:()=>kn,GiftOutlineIcon:()=>On,GoogleKeepIcon:()=>Dn,GroupIcon:()=>Tn,HashtagFilledIcon:()=>Fn,HashtagIcon:()=>Ln,HashtagOffIcon:()=>Un,HeartFilledIcon:()=>Kn,HelpFilledIcon:()=>Gn,HelpIcon:()=>zn,HistoryIcon:()=>Wn,HistoryLockedIllustration:()=>Jn,IconsSpriteStylekit:()=>$n,IlNotesIcon:()=>tr,ImageIcon:()=>rr,IndentIcon:()=>or,InfoIcon:()=>ar,ItalicIcon:()=>cr,KeyboardCloseIcon:()=>dr,KeyboardCommandIcon:()=>pr,KeyboardFilledIcon:()=>gr,KeyboardIcon:()=>yr,KeyboardOptionIcon:()=>Ar,KeyboardShiftIcon:()=>wr,KeyboardShowIcon:()=>Cr,LexicalCheck:()=>ha,LexicalCode:()=>fa,LexicalDraggableBlockMenu:()=>fl,LexicalHorizontalRule:()=>ma,LexicalLink:()=>va,LexicalListOL:()=>ba,LexicalListUL:()=>Sa,LexicalPencilFill:()=>hl,LexicalQuote:()=>Ea,LexicalTable:()=>_a,LexicalTextCenter:()=>Pa,LexicalTextJustify:()=>Ba,LexicalTextLeft:()=>Na,LexicalTextParagraph:()=>ja,LexicalTextRight:()=>Ma,LexicalTweet:()=>Ra,LexicalYoutube:()=>Qa,LifebuoyIcon:()=>Ir,LineWidthIcon:()=>xr,LinkIcon:()=>kr,LinkOffIcon:()=>Or,ListBulleted:()=>Dr,ListNumbered:()=>Lr,ListedFilledIcon:()=>Tr,ListedIcon:()=>Fr,LockFilledIcon:()=>Ur,LockIcon:()=>Kr,MarkdownIcon:()=>Gr,MenuArrowDownAlt:()=>zr,MenuArrowDownIcon:()=>Wr,MenuArrowRightIcon:()=>Jr,MenuCloseIcon:()=>$r,MenuOpenIcon:()=>ti,MenuVariantIcon:()=>ri,MergeIcon:()=>oi,MoreIcon:()=>ai,MoreVertIcon:()=>ci,NoPreviewIllustration:()=>di,NotesFilledIcon:()=>pi,NotesIcon:()=>gi,OpenInIcon:()=>yi,OutdentIcon:()=>Ai,PasswordIcon:()=>wi,PencilFilledIcon:()=>Ci,PencilIcon:()=>Ii,PencilOffIcon:()=>xi,PinFilledIcon:()=>ki,PinIcon:()=>Oi,PlainTextIcon:()=>Di,PlusCircleFilledIcon:()=>Ti,PlusCircleIcon:()=>Fi,PremiumFeatureIcon:()=>Li,PremiumIllustration:()=>Ui,PrintIcon:()=>Ki,ProtectedIllustration:()=>Gi,RedoIcon:()=>zi,ReorderIcon:()=>Wi,ReplaceAllIcon:()=>Ji,ReplaceIcon:()=>$i,RestoreIcon:()=>to,RichTextIcon:()=>ro,SNLogoAltIcon:()=>Qo,SNLogoFull:()=>Vo,SNLogoIcon:()=>Ho,SafeIcon:()=>oo,SafeSquareFilledIcon:()=>ao,SafeSquareIcon:()=>co,SaveIcon:()=>ho,SearchIcon:()=>fo,SearchIosIcon:()=>mo,SecurityIcon:()=>vo,SelectAllIcon:()=>bo,SendIcon:()=>So,ServerIcon:()=>Eo,SettingsFilledIcon:()=>_o,SettingsIcon:()=>Po,ShareIcon:()=>Bo,ShortcutButtonIcon:()=>No,SignInIcon:()=>jo,SignOutIcon:()=>Mo,SimplenoteIcon:()=>Ro,SortDescendingIcon:()=>Yo,SpreadsheetsIcon:()=>Zo,StarCircleFilled:()=>qo,StarFilledIcon:()=>Xo,StarIcon:()=>es,StarVariantFilledIcon:()=>ns,StrikethroughIcon:()=>is,SubscriptIcon:()=>ss,SubtractIcon:()=>ls,SuperscriptIcon:()=>us,SyncIcon:()=>hs,TableOfContentsIcon:()=>ua,TasksIcon:()=>fs,TextCircleIcon:()=>ms,TextIcon:()=>vs,TextParagraphLongIcon:()=>bs,ThemesFilledIcon:()=>Ss,ThemesIcon:()=>Es,TimerIcon:()=>_s,TrashFilledIcon:()=>Ps,TrashIcon:()=>Bs,TrashSweepFilledIcon:()=>Ns,TrashSweepIcon:()=>js,TuneIcon:()=>Ms,TypeBold:()=>Va,TypeH1:()=>Ha,TypeH2:()=>Ya,TypeH3:()=>Za,TypeH4:()=>qa,TypeH5:()=>Xa,TypeH6:()=>el,TypeItalic:()=>nl,TypeStrikethrough:()=>il,TypeSubscript:()=>sl,TypeSuperscript:()=>ll,TypeUnderline:()=>ul,UnarchiveIcon:()=>Rs,UnderlineIcon:()=>Qs,UndoIcon:()=>Vs,UnpinIcon:()=>Hs,UploadIcon:()=>Ys,UserAddIcon:()=>Zs,UserFilledIcon:()=>qs,UserIcon:()=>Xs,UserSwitch:()=>ea,ViewIcon:()=>na,WarningIcon:()=>ia,WindowIcon:()=>sa});var e=n(694);function t(){return t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},t.apply(this,arguments)}const i=function(n){return e.createElement("svg",t({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),e.createElement("path",{d:"M17.5 7.5h-5v10.833h-1.667v-5H9.167v5H7.5V7.5h-5V5.833h15V7.5ZM10 1.667A1.667 1.667 0 1 1 10 5a1.667 1.667 0 0 1 0-3.333Z"}))};function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}const s=function(t){return e.createElement("svg",o({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M18.333 2.5H1.667A1.729 1.729 0 0 0 0 4.167v11.666A1.728 1.728 0 0 0 1.667 17.5h16.666A1.728 1.728 0 0 0 20 15.833V4.167A1.728 1.728 0 0 0 18.333 2.5Zm0 13.333H1.667V4.167h16.666v11.666Zm-6.666-1.666v-1.042c0-1.383-2.784-2.083-4.167-2.083s-4.167.7-4.167 2.083v1.042h8.334ZM7.5 5.833A2.083 2.083 0 1 0 7.5 10a2.083 2.083 0 0 0 0-4.167Zm4.167 0v.834h5v-.834h-5Zm0 1.667v.833h5V7.5h-5Zm0 1.667V10H15v-.833h-3.333Z"}))};function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a.apply(this,arguments)}const l=function(t){return e.createElement("svg",a({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 16a6.027 6.027 0 0 1-5-2.667c.025-1.666 3.333-2.583 5-2.583 1.667 0 4.975.917 5 2.583A6.027 6.027 0 0 1 10 16Zm0-11.833a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5Zm0-2.5A8.333 8.333 0 1 0 18.333 10c0-4.608-3.75-8.333-8.333-8.333Z"}))};function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}const u=function(t){return e.createElement("svg",c({width:120,height:120,fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("circle",{cx:60,cy:60,r:60,fill:"#F4F5F7"}),e.createElement("g",{filter:"url(#a)"},e.createElement("rect",{x:31,y:31,width:58,height:58,rx:4,fill:"#fff"}),e.createElement("rect",{x:64,y:45,width:17,height:4,rx:2,fill:"#BBBEC4"}),e.createElement("rect",{x:64,y:51,width:17,height:4,rx:2,fill:"#BBBEC4"}),e.createElement("rect",{x:64,y:57,width:17,height:4,rx:2,fill:"#BBBEC4"}),e.createElement("path",{d:"M54 45a7.5 7.5 0 1 1 0 15 7.5 7.5 0 0 1 0-15Zm0 16.875c5.006 0 15 2.494 15 7.5V75H39v-5.625c0-5.006 9.994-7.5 15-7.5Z",fill:"#BBBEC4"})),e.createElement("defs",null,e.createElement("filter",{id:"a",x:19,y:23,width:82,height:82,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},e.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),e.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.createElement("feOffset",{dy:4}),e.createElement("feGaussianBlur",{stdDeviation:6}),e.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.16 0"}),e.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_118_16"}),e.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_118_16",result:"shape"}))))};function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d.apply(this,arguments)}const h=function(t){return e.createElement("svg",d({viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("circle",{cx:16,cy:16,r:16,fill:"#DFE1E4"}),e.createElement("path",{d:"M16 5a6.5 6.5 0 1 1 0 13 6.5 6.5 0 0 1 0-13Zm0 14.625c4.339 0 13 2.161 13 6.5V32H3v-5.875c0-4.339 8.661-6.5 13-6.5Z"}))};function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p.apply(this,arguments)}const f=function(t){return e.createElement("svg",p({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{clipRule:"evenodd",d:"M11.385 11.385h4.23a1.385 1.385 0 0 0 0-2.77h-4.23v-4.23a1.385 1.385 0 1 0-2.77 0v4.23h-4.23a1.385 1.385 0 0 0 0 2.77h4.23v4.23a1.385 1.385 0 0 0 2.77 0v-4.23Z"}))};function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},g.apply(this,arguments)}const m=function(t){return e.createElement("svg",g({viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M13.6 8a.8.8 0 0 1-.8.8h-4v4a.8.8 0 1 1-1.6 0v-4h-4a.8.8 0 1 1 0-1.6h4v-4a.8.8 0 0 1 1.6 0v4h4a.8.8 0 0 1 .8.8Z"}))};function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},y.apply(this,arguments)}const v=function(t){return e.createElement("svg",y({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M1.667 13.333h6.666v-1.666H1.667v1.666ZM15 11.667V8.333h-1.667v3.334H10v1.666h3.333v3.334H15v-3.334h3.333v-1.666H15ZM11.667 5h-10v1.667h10V5Zm0 3.333h-10V10h10V8.333Z"}))};function A(){return A=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},A.apply(this,arguments)}const b=function(t){return e.createElement("svg",A({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},t),e.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M19.59 40a2.4 2.4 0 0 1-3.28-.88l-.48-.82A2.4 2.4 0 0 1 20 35.91l.48.82a2.42 2.42 0 0 1-.89 3.27Zm10.85 0a2.4 2.4 0 0 1-3.28-.88l-5.64-9.76A2.4 2.4 0 1 1 25.68 27l5.64 9.77a2.39 2.39 0 0 1-.88 3.23Zm10.86 0a2.42 2.42 0 0 1-3.3-.86L25.67 17.75a1.92 1.92 0 0 0-3.33 0L10 39.14a2.42 2.42 0 0 1-2.09 1.2A2.37 2.37 0 0 1 6.7 40a2.4 2.4 0 0 1-.88-3.28l16.1-27.86a2.4 2.4 0 0 1 4.16 0l16.1 27.88A2.4 2.4 0 0 1 41.3 40Z"}))};function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w.apply(this,arguments)}const S=function(t){return e.createElement("svg",w({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M15.444 12.333h-3.11a2.333 2.333 0 1 1-4.667 0H4.556V4.556h10.888v7.777Zm0-9.333H4.556C3.692 3 3 3.7 3 4.556v10.888A1.556 1.556 0 0 0 4.556 17h10.888A1.556 1.556 0 0 0 17 15.444V4.556A1.556 1.556 0 0 0 15.444 3Z"}),e.createElement("path",{d:"M13.111 8.444h-1.555V6.111H8.444v2.333H6.89L10 11.555l3.111-3.11Z"}))};function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},C.apply(this,arguments)}const E=function(t){return e.createElement("svg",C({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m6.417 6.908 3.825 3.825 3.825-3.825 1.175 1.183-5 5-5-5 1.175-1.183Z",fill:"currentColor"}))};function I(){return I=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},I.apply(this,arguments)}const _=function(t){return e.createElement("svg",I({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M9.234 3.4H10.9v10l3.992-3.992a.837.837 0 0 1 1.183 1.184L10.067 16.6 4.059 10.59a.837.837 0 1 1 1.183-1.183L9.234 13.4v-10Z"}))};function x(){return x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},x.apply(this,arguments)}const P=function(t){return e.createElement("svg",x({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M16.667 9.167v1.666h-10l3.991 3.992a.837.837 0 1 1-1.183 1.183L3.467 10l6.008-6.008a.837.837 0 1 1 1.183 1.183L6.667 9.167h10Z"}))};function k(){return k=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},k.apply(this,arguments)}const B=function(t){return e.createElement("svg",k({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M3.467 10.833V9.167h10L9.475 5.175a.837.837 0 1 1 1.183-1.183L16.667 10l-6.009 6.008a.837.837 0 1 1-1.183-1.183l3.992-3.992h-10Z"}))};function O(){return O=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},O.apply(this,arguments)}const N=function(t){return e.createElement("svg",O({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m17.5 7.5-3.333-3.333v2.5H8.333v1.666h5.834v2.5L17.5 7.5ZM5.833 9.167 2.5 12.5l3.333 3.333v-2.5h5.834v-1.666H5.833v-2.5Z"}))};function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},D.apply(this,arguments)}const j=function(t){return e.createElement("svg",D({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M7.5 2.5 4.167 5.833h2.5v5.834h1.666V5.833h2.5L7.5 2.5Z"}),e.createElement("path",{d:"M13.333 8.333v5.834h2.5L12.5 17.5l-3.334-3.333h2.5V8.333h1.667Z",fill:"#086DD6"}))};function T(){return T=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},T.apply(this,arguments)}const M=function(t){return e.createElement("svg",T({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M7.5 2.5 4.167 5.833h2.5v5.834h1.666V5.833h2.5L7.5 2.5Z",fill:"#086DD6"}),e.createElement("path",{d:"M13.333 8.333v5.834h2.5L12.5 17.5l-3.334-3.333h2.5V8.333h1.667Z"}))};function F(){return F=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},F.apply(this,arguments)}const R=function(t){return e.createElement("svg",F({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M7.5 2.5 4.167 5.833h2.5v5.834h1.666V5.833h2.5L7.5 2.5Zm1.667 11.667L12.5 17.5l3.333-3.333h-2.5V8.333h-1.666v5.834h-2.5Z"}))};function L(){return L=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},L.apply(this,arguments)}const Q=function(t){return e.createElement("svg",L({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10.9 16.6H9.234v-10l-3.992 3.992a.837.837 0 0 1-1.183-1.184L10.067 3.4l6.008 6.008a.837.837 0 1 1-1.183 1.184L10.9 6.6v10Z"}))};function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U.apply(this,arguments)}const V=function(t){return e.createElement("svg",U({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M8.55 3h2.9l-.573 5.537 4.674-3.248L17 7.711 11.754 10 17 12.289l-1.45 2.422-4.673-3.248.572 5.537H8.551l.572-5.537-4.674 3.248L3 12.289 8.246 10 3 7.711l1.45-2.422 4.673 3.248L8.551 3Z"}))};function K(){return K=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},K.apply(this,arguments)}const H=function(t){return e.createElement("svg",K({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M15.417 13.333H5.833a3.333 3.333 0 0 1 0-6.666H16.25a2.083 2.083 0 0 1 0 4.166H7.5a.833.833 0 1 1 0-1.666h7.917v-1.25H7.5a2.083 2.083 0 1 0 0 4.166h8.75a3.333 3.333 0 0 0 0-6.666H5.834a4.583 4.583 0 1 0 0 9.166h9.583v-1.25Z"}))};function G(){return G=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},G.apply(this,arguments)}const Y=function(t){return e.createElement("svg",G({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M9.167 14.167a.833.833 0 1 0 1.666 0 .833.833 0 0 0-1.666 0Zm0-11.667v3.333h1.666v-1.6c2.825.409 5 2.825 5 5.767a5.833 5.833 0 1 1-11.666 0c0-1.4.491-2.683 1.316-3.683L10 10.833l1.175-1.175-5.667-5.666v.016A7.46 7.46 0 0 0 2.5 10 7.5 7.5 0 1 0 10 2.5h-.833ZM15 10a.833.833 0 1 0-1.667 0A.833.833 0 0 0 15 10ZM5 10a.833.833 0 1 0 1.667 0A.833.833 0 0 0 5 10Z"}))};function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},z.apply(this,arguments)}const Z=function(t){return e.createElement("svg",z({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M9.167 14.167a.833.833 0 1 0 1.666 0 .833.833 0 0 0-1.666 0Zm0-11.667v3.333h1.666v-1.6c2.825.409 5 2.825 5 5.767a5.833 5.833 0 1 1-11.666 0c0-1.4.491-2.683 1.316-3.683L10 10.833l1.175-1.175-5.667-5.666v.016A7.46 7.46 0 0 0 2.5 10 7.5 7.5 0 1 0 10 2.5h-.833ZM15 10a.833.833 0 1 0-1.667 0A.833.833 0 0 0 15 10ZM5 10a.833.833 0 1 0 1.667 0A.833.833 0 0 0 5 10Z"}))};function W(){return W=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},W.apply(this,arguments)}const q=function(t){return e.createElement("svg",W({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M12.36 16.964a1.136 1.136 0 0 0 1.929-.806c0-.308-.13-.601-.358-.821L8.397 9.949l5.534-5.37a1.17 1.17 0 0 0 .358-.823c0-.626-.513-1.13-1.14-1.13-.317 0-.577.105-.789.317L6.118 9.046c-.277.269-.415.562-.415.912 0 .341.13.634.415.911l6.242 6.095Z"}))};function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},J.apply(this,arguments)}const X=function(t){return e.createElement("svg",J({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},t),e.createElement("path",{fill:"currentColor",d:"m11.4 16 2.6-2.6 2.6 2.6 1.4-1.4-2.6-2.6L18 9.4 16.6 8 14 10.6 11.4 8 10 9.4l2.6 2.6-2.6 2.6 1.4 1.4ZM3 12l4.35-6.15q.275-.4.713-.625T9 5h10q.825 0 1.413.588T21 7v10q0 .825-.588 1.413T19 19H9q-.5 0-.938-.225t-.712-.625L3 12Z"}))};function $(){return $=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$.apply(this,arguments)}const ee=function(t){return e.createElement("svg",$({width:9,height:14,xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M1.667 3.333a1.667 1.667 0 1 1 0-3.333 1.667 1.667 0 0 1 0 3.333Zm0 5a1.667 1.667 0 1 1 0-3.333 1.667 1.667 0 0 1 0 3.333Zm0 5a1.667 1.667 0 1 1 0-3.333 1.667 1.667 0 0 1 0 3.333Zm5-10a1.667 1.667 0 1 1 0-3.333 1.667 1.667 0 0 1 0 3.333Zm0 5a1.667 1.667 0 1 1 0-3.333 1.667 1.667 0 0 1 0 3.333Zm0 5a1.667 1.667 0 1 1 0-3.333 1.667 1.667 0 0 1 0 3.333Z",fill:"currentColor",fillRule:"nonzero"}))};function te(){return te=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},te.apply(this,arguments)}const ne=function(t){return e.createElement("svg",te({viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M9.372 12.747a6.167 6.167 0 0 0 3.381-8.04 6.167 6.167 0 0 0-8.041-3.375A6.167 6.167 0 0 0 1.33 9.37a6.167 6.167 0 0 0 8.042 3.376Z",fill:"#BED7FE"}))};function re(){return re=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},re.apply(this,arguments)}const ie=function(t){return e.createElement("svg",re({viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10.024 15.201c.505 0 .93-.058 1.275-.175.352-.123.636-.288.853-.495.224-.208.384-.45.48-.73.102-.285.153-.59.153-.914 0-.66-.223-1.18-.67-1.555-.442-.383-1.142-.574-2.1-.574H7.243v4.443h2.78ZM7.244 4.78v4.375h2.243c.959 0 1.675-.188 2.148-.564.473-.376.71-.917.71-1.623 0-.772-.225-1.329-.672-1.673-.441-.343-1.134-.515-2.08-.515h-2.35ZM9.593 3c.882 0 1.636.087 2.262.263.627.168 1.141.411 1.544.729.403.317.697.706.882 1.166.192.454.288.966.288 1.536 0 .331-.052.652-.154.963-.096.305-.25.593-.46.865a3.356 3.356 0 0 1-.777.72 4.462 4.462 0 0 1-1.112.534c1.956.422 2.934 1.475 2.934 3.16 0 .596-.112 1.144-.336 1.643-.217.493-.537.92-.958 1.284-.416.356-.93.635-1.544.836-.614.2-1.314.301-2.1.301H5V3h4.593Z"}))};function oe(){return oe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oe.apply(this,arguments)}const se=function(t){return e.createElement("svg",oe({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M3 3h14v3.111H3V3Zm.778 3.889h12.444V17H3.778V6.889Zm4.278 2.333a.389.389 0 0 0-.39.39v1.166h4.667V9.61a.389.389 0 0 0-.389-.389H8.056Z"}))};function ae(){return ae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ae.apply(this,arguments)}const le=function(t){return e.createElement("svg",ae({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M16.222 17H3.778V8.444h1.555v7h9.334v-7h1.555V17ZM3 3h14v4.667H3V3Zm5.056 6.222h3.888c.218 0 .39.171.39.39v1.166H7.666V9.61c0-.218.17-.389.389-.389Zm-3.5-4.666V6.11h10.888V4.556H4.556Z"}))};function ce(){return ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ce.apply(this,arguments)}const ue=function(t){return e.createElement("svg",ce({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M16.667 3.333h-2.642L12.5 1.667h-5L5.975 3.333H3.333A1.667 1.667 0 0 0 1.667 5v10a1.667 1.667 0 0 0 1.666 1.667h13.334A1.667 1.667 0 0 0 18.333 15V5a1.667 1.667 0 0 0-1.666-1.667Zm0 11.667H3.333V5h3.375l1.525-1.667h3.534L13.292 5h3.375v10ZM10 5.833a4.167 4.167 0 1 0 0 8.334 4.167 4.167 0 0 0 0-8.334Zm0 6.667a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5Z"}))};function de(){return de=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},de.apply(this,arguments)}const he=function(t){return e.createElement("svg",de({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 9 16"},t),e.createElement("path",{fill:"currentColor",d:"M7.62 7.18 2.79 3.03c-.7-.6-1.79-.1-1.79.82v8.29c0 .93 1.09 1.42 1.79.82l4.83-4.14c.5-.43.5-1.21 0-1.64Z"}))};function pe(){return pe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pe.apply(this,arguments)}const fe=function(t){return e.createElement("svg",pe({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M.41 13.41 6 19l1.41-1.42L1.83 12 .41 13.41Zm21.83-7.83L11.66 16.17 7.5 12l-1.43 1.41L11.66 19l12-12-1.42-1.42ZM18 7l-1.41-1.42-6.35 6.35 1.42 1.41L18 7Z"}))};function ge(){return ge=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ge.apply(this,arguments)}const me=function(t){return e.createElement("svg",ge({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m7.5 17.017-5.175-5.175 2.358-2.359L7.5 12.308l8.233-8.241 2.359 2.358L7.5 17.017Z"}))};function ye(){return ye=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ye.apply(this,arguments)}const ve=function(t){return e.createElement("svg",ye({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.005 18.34a8.335 8.335 0 1 0 0-16.67 8.335 8.335 0 0 0 0 16.67ZM8.57 14 5 10.16l1.007-1.09 2.564 2.756L13.993 6 15 7.09 8.571 14Z",fill:"currentColor"}))};function Ae(){return Ae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ae.apply(this,arguments)}const be=function(t){return e.createElement("svg",Ae({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 1.667c-4.583 0-8.333 3.75-8.333 8.333s3.75 8.333 8.333 8.333 8.333-3.75 8.333-8.333S14.583 1.667 10 1.667Zm0 15A6.676 6.676 0 0 1 3.333 10 6.676 6.676 0 0 1 10 3.333 6.676 6.676 0 0 1 16.667 10 6.676 6.676 0 0 1 10 16.667Zm3.825-10.35-5.492 5.491-2.158-2.15L5 10.833l3.333 3.334L15 7.5l-1.175-1.183Z"}))};function we(){return we=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},we.apply(this,arguments)}const Se=function(t){return e.createElement("svg",we({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m17.5 5.833-10 10-4.583-4.583 1.175-1.175 3.408 3.4 8.825-8.817L17.5 5.833Z"}))};function Ce(){return Ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ce.apply(this,arguments)}const Ee=function(t){return e.createElement("svg",Ce({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},t),e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zM3.854 2.146a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 1 1 .708-.708L2 3.293l1.146-1.147a.5.5 0 0 1 .708 0zm0 4a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 1 1 .708-.708L2 7.293l1.146-1.147a.5.5 0 0 1 .708 0zm0 4a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 0 1 .708-.708l.146.147 1.146-1.147a.5.5 0 0 1 .708 0z"}))};function Ie(){return Ie=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ie.apply(this,arguments)}const _e=function(t){return e.createElement("svg",Ie({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m6.176 7.15 3.825 3.825 3.825-3.825 1.175 1.183-5 5-5-5L6.176 7.15Z"}))};function xe(){return xe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xe.apply(this,arguments)}const Pe=function(t){return e.createElement("svg",xe({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m13.092 6.417-3.824 3.825 3.824 3.825-1.183 1.175-5-5 5-5 1.183 1.175Z"}))};function ke(){return ke=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ke.apply(this,arguments)}const Be=function(t){return e.createElement("svg",ke({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m6.91 14.067 3.824-3.825L6.91 6.417l1.184-1.175 5 5-5 5-1.184-1.175Z"}))};function Oe(){return Oe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Oe.apply(this,arguments)}const Ne=function(t){return e.createElement("svg",Oe({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m13.826 13.334-3.825-3.825-3.825 3.825-1.175-1.184 5-5 5 5-1.175 1.184Z"}))};function De(){return De=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},De.apply(this,arguments)}const je=function(t){return e.createElement("svg",De({viewBox:"0 0 55 55",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},t),e.createElement("rect",{opacity:.36,width:54.564,height:54.564,rx:27.282,fill:"url(#a)"}),e.createElement("defs",null,e.createElement("pattern",{id:"a",patternContentUnits:"objectBoundingBox",width:.082,height:.082},e.createElement("use",{xlinkHref:"#b",transform:"scale(.00916)"})),e.createElement("image",{id:"b",width:9,height:9,xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAtSURBVHgB1dChDQAACAPBHwn23wVWAYMkxdKkVacKkF1jj80oyDfoFxgD1UdRPHMLOJmKMAEAAAAASUVORK5CYII="})))};function Te(){return Te=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Te.apply(this,arguments)}const Me=function(t){return e.createElement("svg",Te({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M12.946 12.946a.833.833 0 0 1-1.178 0L10 11.178l-1.768 1.768a.833.833 0 1 1-1.178-1.178L8.82 10 7.054 8.232a.833.833 0 1 1 1.178-1.178L10 8.82l1.768-1.767a.833.833 0 1 1 1.178 1.178L11.178 10l1.768 1.768a.833.833 0 0 1 0 1.178Zm2.946-8.839A8.334 8.334 0 1 0 4.107 15.893 8.334 8.334 0 0 0 15.892 4.107Z",fill:"currentColor"}))};function Fe(){return Fe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fe.apply(this,arguments)}const Re=function(t){return e.createElement("svg",Fe({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("circle",{cx:10,cy:10,r:10,fill:"#F4F5F7"}),e.createElement("path",{d:"M14.197 6.743a.665.665 0 1 0-.94-.94L10 9.06 6.743 5.803a.665.665 0 0 0-.94.94L9.06 10l-3.257 3.257a.665.665 0 0 0 .94.94L10 10.94l3.257 3.257a.665.665 0 1 0 .94-.94L10.94 10l3.257-3.257Z",fill:"#515357"}))};function Le(){return Le=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Le.apply(this,arguments)}const Qe=function(t){return e.createElement("svg",Le({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},t),e.createElement("path",{fill:"currentColor",d:"M12 20a8 8 0 0 0 8-8 8 8 0 0 0-8-8 8 8 0 0 0-8 8 8 8 0 0 0 8 8m0-18a10 10 0 0 1 10 10 10 10 0 0 1-10 10C6.47 22 2 17.5 2 12A10 10 0 0 1 12 2m.5 5v5.25l4.5 2.67-.75 1.23L11 13V7z"}))};function Ue(){return Ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ue.apply(this,arguments)}const Ve=function(t){return e.createElement("svg",Ue({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M15.246 5.93a.83.83 0 1 0-1.175-1.176L10 8.825l-4.072-4.07a.83.83 0 1 0-1.175 1.174L8.825 10l-4.07 4.07a.83.83 0 1 0 1.174 1.176L10 11.176l4.07 4.07a.83.83 0 1 0 1.176-1.175L11.176 10l4.07-4.072Z"}))};function Ke(){return Ke=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ke.apply(this,arguments)}const He=function(t){return e.createElement("svg",Ke({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M6.442 8.333 13.108 15H5a3.333 3.333 0 0 1 0-6.667h1.442ZM2.5 4.392l2.292 2.275C2.133 6.792 0 8.975 0 11.667a5 5 0 0 0 5 5h9.775l1.667 1.666 1.058-1.058L3.558 3.333 2.5 4.392Zm13.625 3.966A6.242 6.242 0 0 0 10 3.333a6.09 6.09 0 0 0-3.333.975l1.208 1.217a4.583 4.583 0 0 1 6.708 4.058V10h1.25a2.5 2.5 0 0 1 2.5 2.5c0 .942-.533 1.758-1.3 2.183l1.209 1.209A4.17 4.17 0 0 0 20 12.5c0-2.2-1.708-3.983-3.875-4.142Z"}))};function Ge(){return Ge=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ge.apply(this,arguments)}const Ye=function(t){return e.createElement("svg",Ge({viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m10.742 2.5 1.633.333L9.258 17.5l-1.633-.333L10.742 2.5Zm5.583 7.5-2.992-2.992V4.65l5.35 5.35-5.35 5.342v-2.359L16.325 10ZM1.317 10l5.35-5.35v2.358L3.675 10l2.992 2.983v2.359L1.317 10Z"}))};function ze(){return ze=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ze.apply(this,arguments)}const Ze=function(t){return e.createElement("svg",ze({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M12.167 13.833 16 10l-3.833-3.833L13.333 5l5 5-5 5-1.166-1.167Zm-4.334 0L4 10l3.833-3.833L6.667 5l-5 5 5 5 1.166-1.167Z"}))};function We(){return We=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},We.apply(this,arguments)}const qe=function(t){return e.createElement("svg",We({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M15.833 11.583s-1.666 1.809-1.666 2.917a1.667 1.667 0 1 0 3.333 0c0-1.108-1.667-2.917-1.667-2.917Zm-11.491-1.25 3.991-3.991 3.992 3.991H4.342ZM13.8 9.45 6.35 2 5.175 3.175l1.983 1.983L2.867 9.45c-.492.467-.492 1.275 0 1.767L7.45 15.8c.242.242.567.367.883.367.317 0 .642-.125.884-.367l4.583-4.583c.492-.492.492-1.3 0-1.767Z"}))};function Je(){return Je=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Je.apply(this,arguments)}const Xe=function(t){return e.createElement("svg",Je({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M1.667 3.666a2 2 0 0 1 2-2h7.667a2 2 0 0 1 2 2v9.667H3.667a2 2 0 0 1-2-2V3.666Zm14.667 3a2 2 0 0 1 2 2v7.667a2 2 0 0 1-2 2H8.667a2 2 0 0 1-2-2V15h8.334V6.666h1.333Zm-13-3.333v8.333h8.333V3.333H3.334Z"}))};function $e(){return $e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$e.apply(this,arguments)}const et=function(t){return e.createElement("svg",$e({width:320,height:292,fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},t),e.createElement("path",{opacity:.36,d:"M28.293 250.445s119.325-68.117 263.415 0H28.293Z",fill:"url(#a)"}),e.createElement("path",{d:"M91.802 33.601 28.69 47.885a4.8 4.8 0 0 0-3.622 5.741l21.7 95.884a4.8 4.8 0 0 0 5.742 3.622l63.112-14.283a4.8 4.8 0 0 0 3.622-5.742l-21.7-95.883a4.8 4.8 0 0 0-5.742-3.623Z",fill:"#3F3D56"}),e.createElement("path",{d:"M31.3 65.229a2.144 2.144 0 1 0 0-4.288 2.144 2.144 0 0 0 0 4.288ZM33.443 73.09a2.144 2.144 0 1 0 0-4.287 2.144 2.144 0 0 0 0 4.287ZM47.377 130.616a2.144 2.144 0 1 0 0-4.288 2.144 2.144 0 0 0 0 4.288ZM49.521 138.476a2.144 2.144 0 1 0 0-4.288 2.144 2.144 0 0 0 0 4.288Z",fill:"#fff"}),e.createElement("path",{d:"m91.536 73.477-43.518 9.85 1.642 7.252 43.518-9.849-1.642-7.253Z",fill:"#F5F5F5"}),e.createElement("path",{d:"M149.289 70.248 76.813 86.65l23.819 105.248 72.477-16.403-23.82-105.247Z",fill:"#2B6FCF"}),e.createElement("path",{d:"m225.719 52.95-72.476 16.403 23.819 105.248 72.476-16.403-23.819-105.247Z",fill:"#3F3D56"}),e.createElement("path",{d:"m135.842 85.268-43.518 9.85 1.641 7.252 43.518-9.849-1.641-7.253ZM147.062 101.154l-58.024 13.132.41 1.813 58.024-13.131-.41-1.814ZM148.019 105.386l-58.024 13.132.41 1.813 58.025-13.132-.411-1.813ZM148.977 109.616l-58.024 13.132.41 1.813 58.024-13.132-.41-1.813ZM119.713 120.687l-27.803 6.292.41 1.814 27.804-6.293-.411-1.813ZM124.902 123.96l-32.034 7.25.41 1.813 32.035-7.25-.411-1.813ZM151.849 122.31l-58.024 13.131.41 1.814 58.025-13.132-.411-1.813ZM152.807 126.541l-58.024 13.132.41 1.813 58.025-13.132-.411-1.813ZM149.533 131.729 95.74 143.903l.41 1.814 53.794-12.175-.411-1.813ZM154.722 135.003l-58.024 13.132.41 1.813 58.025-13.132-.411-1.813ZM127.876 145.526l-30.22 6.839.41 1.813 30.221-6.839-.411-1.813Z",fill:"#F5F5F5"}),e.createElement("path",{opacity:.3,d:"m209.358 132.168-32.034 7.25.411 1.813 32.034-7.25-.411-1.813ZM236.306 130.517l-58.024 13.131.41 1.814 58.024-13.132-.41-1.813ZM237.263 134.747l-58.024 13.132.411 1.813 58.024-13.132-.411-1.813ZM233.99 139.936l-53.793 12.174.41 1.814 53.793-12.175-.41-1.813ZM239.178 143.209l-58.024 13.132.411 1.813 58.024-13.132-.411-1.813Z",fill:"#2B6FCF"}),e.createElement("path",{d:"m156.112 146.76-35.056 7.934 5.471 24.177 35.057-7.934-5.472-24.177Z",fill:"#F5F5F5"}),e.createElement("path",{opacity:.3,d:"m197.607 66.207-35.056 7.934 5.471 24.176 35.057-7.933-5.472-24.177ZM231.919 91.481l-35.056 7.934 5.471 24.177 35.057-7.934-5.472-24.177Z",fill:"#2B6FCF"}),e.createElement("g",{opacity:.5,fill:"#47E6B1"},e.createElement("path",{opacity:.5,d:"M67.386 214.327h-1.072v6.074h1.072v-6.074Z"}),e.createElement("path",{opacity:.5,d:"M69.888 217.9v-1.072h-6.075v1.072h6.075Z"})),e.createElement("g",{opacity:.5,fill:"#47E6B1"},e.createElement("path",{opacity:.5,d:"M184.224 32h-1.072v6.074h1.072V32Z"}),e.createElement("path",{opacity:.5,d:"M186.726 35.573v-1.072h-6.075v1.072h6.075Z"})),e.createElement("g",{opacity:.5,fill:"#47E6B1"},e.createElement("path",{opacity:.5,d:"M317.499 76.663h-1.072v6.074h1.072v-6.074Z"}),e.createElement("path",{opacity:.5,d:"M320 80.236v-1.072h-6.074v1.072H320Z"})),e.createElement("path",{opacity:.5,d:"M128.733 213.722a1.314 1.314 0 0 1-.732-1.587.651.651 0 0 0 .029-.146.662.662 0 0 0-.43-.657.656.656 0 0 0-.826.35 1.31 1.31 0 0 1-1.587.732.654.654 0 0 0-.145-.029.663.663 0 0 0-.658.43.656.656 0 0 0 .351.826 1.314 1.314 0 0 1 .731 1.587.655.655 0 0 0 .814.817.656.656 0 0 0 .34-.235.61.61 0 0 0 .073-.129c.129-.296.362-.534.654-.669.293-.134.625-.157.933-.063a.659.659 0 0 0 .803-.401.656.656 0 0 0-.35-.826ZM180.97 258.26a1.316 1.316 0 0 1-.669-.654 1.319 1.319 0 0 1-.063-.933.651.651 0 0 0 .029-.146.662.662 0 0 0-.43-.657.656.656 0 0 0-.826.35 1.31 1.31 0 0 1-1.587.732.651.651 0 0 0-.146-.029.662.662 0 0 0-.657.43.656.656 0 0 0 .35.826 1.31 1.31 0 0 1 .732 1.587.654.654 0 0 0-.029.145.663.663 0 0 0 .43.658.656.656 0 0 0 .826-.35c.129-.296.362-.534.654-.669.293-.134.625-.157.933-.063a.654.654 0 0 0 .145.029.663.663 0 0 0 .658-.43.656.656 0 0 0-.35-.826ZM4.391 107.5a1.313 1.313 0 0 1-.731-1.587.628.628 0 0 0-.077-.545.656.656 0 0 0-1.15.093 1.315 1.315 0 0 1-1.587.731.657.657 0 0 0-.453 1.227 1.317 1.317 0 0 1 .732 1.587.627.627 0 0 0 .077.546.66.66 0 0 0 1.077.036.622.622 0 0 0 .073-.129 1.31 1.31 0 0 1 1.587-.732.657.657 0 0 0 .145.029.665.665 0 0 0 .658-.429.66.66 0 0 0-.221-.754.64.64 0 0 0-.13-.073ZM313.529 161.788a1.31 1.31 0 0 1-.731-1.587.651.651 0 0 0-.078-.545.652.652 0 0 0-.737-.272.66.66 0 0 0-.34.235.722.722 0 0 0-.073.13 1.31 1.31 0 0 1-1.586.731.653.653 0 0 0-.546.078.658.658 0 0 0-.036 1.077c.04.029.083.053.129.072a1.318 1.318 0 0 1 .732 1.587.6.6 0 0 0-.029.146.653.653 0 0 0 .429.657.659.659 0 0 0 .754-.221.63.63 0 0 0 .073-.129 1.31 1.31 0 0 1 1.586-.732.62.62 0 0 0 .546-.077.662.662 0 0 0 .272-.737.658.658 0 0 0-.365-.413Z",fill:"#4D8AF0"}),e.createElement("path",{opacity:.5,d:"M38.445 196.819a2.144 2.144 0 1 0 0-4.288 2.144 2.144 0 0 0 0 4.288Z",fill:"#F55F44"}),e.createElement("path",{opacity:.5,d:"M114.907 36.288a2.144 2.144 0 1 0 0-4.288 2.144 2.144 0 0 0 0 4.288Z",fill:"#4D8AF0"}),e.createElement("path",{opacity:.5,d:"M165.716 197.766a2.144 2.144 0 1 0 0-4.288 2.144 2.144 0 0 0 0 4.288Z",fill:"#47E6B1"}),e.createElement("path",{opacity:.5,d:"M289.343 251.362a2.144 2.144 0 1 0 0-4.288 2.144 2.144 0 0 0 0 4.288Z",fill:"#F55F44"}),e.createElement("path",{d:"m248.302 78.978-63.113 14.284a4.801 4.801 0 0 0-3.622 5.741l21.7 95.884a4.8 4.8 0 0 0 5.742 3.622l63.112-14.283a4.8 4.8 0 0 0 3.622-5.742l-21.7-95.883a4.8 4.8 0 0 0-5.741-3.623Z",fill:"#2B6FCF"}),e.createElement("path",{d:"M187.798 110.607a2.143 2.143 0 1 0 0-4.287 2.143 2.143 0 0 0 0 4.287ZM189.942 118.467a2.143 2.143 0 1 0 0-4.286 2.143 2.143 0 0 0 0 4.286ZM203.876 175.994a2.144 2.144 0 1 0 0-4.288 2.144 2.144 0 0 0 0 4.288ZM206.02 183.854a2.144 2.144 0 1 0 0-4.288 2.144 2.144 0 0 0 0 4.288Z",fill:"#fff"}),e.createElement("path",{d:"m248.035 118.855-43.518 9.849 1.642 7.253 43.518-9.849-1.642-7.253Z",fill:"#F5F5F5"}),e.createElement("defs",null,e.createElement("pattern",{id:"a",patternContentUnits:"objectBoundingBox",width:.017,height:.149},e.createElement("use",{xlinkHref:"#b",transform:"scale(.0019 .01652)"})),e.createElement("image",{id:"b",width:9,height:9,xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAtSURBVHgB1dChDQAACAPBHwn23wVWAYMkxdKkVacKkF1jj80oyDfoFxgD1UdRPHMLOJmKMAEAAAAASUVORK5CYII="})))};function tt(){return tt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tt.apply(this,arguments)}const nt=function(t){return e.createElement("svg",tt({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M15.833 4.167v1.666H12.5V4.167h3.333Zm-8.333 0v5H4.167v-5H7.5Zm8.333 6.666v5H12.5v-5h3.333ZM7.5 14.167v1.666H4.167v-1.666H7.5ZM17.5 2.5h-6.667v5H17.5v-5Zm-8.333 0H2.5v8.333h6.667V2.5ZM17.5 9.167h-6.667V17.5H17.5V9.167ZM9.167 12.5H2.5v5h6.667v-5Z"}))};function rt(){return rt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rt.apply(this,arguments)}const it=function(t){return e.createElement("svg",rt({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m5 2.5-3.333 5L10 18.333 18.333 7.5 15 2.5H5Z"}))};function ot(){return ot=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ot.apply(this,arguments)}const st=function(t){return e.createElement("svg",ot({viewBox:"0 0 104 104",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},t),e.createElement("rect",{opacity:.36,y:52,width:73.539,height:73.539,rx:8,transform:"rotate(-45 0 52)",fill:"url(#a)"}),e.createElement("defs",null,e.createElement("pattern",{id:"a",patternContentUnits:"objectBoundingBox",width:.061,height:.061},e.createElement("use",{xlinkHref:"#b",transform:"scale(.0068)"})),e.createElement("image",{id:"b",width:9,height:9,xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAtSURBVHgB1dChDQAACAPBHwn23wVWAYMkxdKkVacKkF1jj80oyDfoFxgD1UdRPHMLOJmKMAEAAAAASUVORK5CYII="})))};function at(){return at=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},at.apply(this,arguments)}const lt=function(t){return e.createElement("svg",at({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M11 3.5v6h1.17L10 11.67 7.83 9.5H9v-6h2Zm2-2H7v6H3l7 7 7-7h-4v-6Zm4 15H3v2h14v-2Z"}))};function ct(){return ct=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ct.apply(this,arguments)}const ut=function(t){return e.createElement("svg",ct({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M17.5 9.167h-15V7.5h15v1.667Zm0 1.666h-15V12.5h15v-1.667Z"}))};function dt(){return dt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dt.apply(this,arguments)}const ht=function(t){return e.createElement("svg",dt({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M8.125 17.375c1.483-.583 1.158-2.192.408-3.208-.741-1.042-1.766-1.759-2.8-2.45A8.18 8.18 0 0 1 3.783 10c-.233-.275-.708-.783-.225-.883.492-.1 1.342.383 1.775.566.759.317 1.509.684 2.209 1.117l.841-1.417c-1.3-.858-2.966-1.616-4.516-1.841-.884-.134-1.817.05-2.117 1.008-.267.825.158 1.658.642 2.308 1.141 1.525 2.916 2.259 4.241 3.575.284.275.625.6.792.984.175.366.133.391-.258.391-1.034 0-2.325-.808-3.167-1.341l-.842 1.416c1.275.784 3.409 2.009 4.967 1.492Zm9.242-13a.463.463 0 0 0 0-.658l-1.084-1.084a.468.468 0 0 0-.65 0l-.85.85 1.734 1.734.85-.842ZM9.167 9.1v1.733H10.9l5.125-5.125-1.733-1.733L9.167 9.1Z"}))};function pt(){return pt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pt.apply(this,arguments)}const ft=function(t){return e.createElement("svg",pt({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M2.5 6.018V4.41h1.667v-.804c0-.892.75-1.607 1.666-1.607h5v5.625l2.084-1.205L15 7.625V2h.833c.875 0 1.667.763 1.667 1.607v12.857c0 .844-.792 1.607-1.667 1.607h-10c-.875 0-1.666-.763-1.666-1.607v-.803H2.5v-1.607h1.667v-3.215H2.5V9.232h1.667V6.018H2.5Zm3.333 3.214H4.167v1.607h1.666V9.232Zm0-3.214V4.41H4.167v1.607h1.666Zm0 9.643v-1.607H4.167v1.607h1.666Z"}))};function gt(){return gt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gt.apply(this,arguments)}const mt=function(t){return e.createElement("svg",gt({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M14.167 3.607V8.43L12.5 6.82 10.833 8.43V3.607H7.5v12.857h8.333V3.607h-1.666ZM2.5 6.017V4.412h1.667v-.804c0-.892.75-1.607 1.666-1.607h10c.875 0 1.667.763 1.667 1.607v12.857c0 .844-.792 1.607-1.667 1.607h-10c-.875 0-1.666-.763-1.666-1.607v-.803H2.5v-1.607h1.667v-3.215H2.5V9.232h1.667V6.018H2.5Zm1.667-1.606v1.607h1.666V4.41H4.167Zm0 11.25h1.666v-1.607H4.167v1.607Zm0-4.822h1.666V9.232H4.167v1.607Z"}))};function yt(){return yt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yt.apply(this,arguments)}const vt=function(t){return e.createElement("svg",yt({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m16.933 7.09.235-.146V4.098l-.765.478L10 8.577 3.599 4.576l-.765-.478v2.846l.235.147 6.667 4.166.265.166.265-.166 6.667-4.166ZM3.334 3.834h13.334c.642 0 1.166.52 1.166 1.167v10a1.167 1.167 0 0 1-1.166 1.167H3.334A1.167 1.167 0 0 1 2.167 15V5a1.16 1.16 0 0 1 1.167-1.167Z",stroke:"#72767E"}))};function At(){return At=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},At.apply(this,arguments)}const bt=function(t){return e.createElement("svg",At({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M3.333 3.333h13.334A1.667 1.667 0 0 1 18.332 5v10a1.667 1.667 0 0 1-1.666 1.667H3.332c-.925 0-1.667-.75-1.667-1.667V5a1.66 1.66 0 0 1 1.667-1.667ZM10 9.167 16.666 5H3.333L10 9.167ZM3.333 15h13.334V6.975L10 11.133 3.333 6.975V15Z"}))};function wt(){return wt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wt.apply(this,arguments)}const St=function(t){return e.createElement("svg",wt({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m16.26 12.167-5 5-1.183-1.184L13.068 13H3.76V3h1.667v8.333h7.641L10.077 8.35l1.183-1.183 5 5Z"}))};function Ct(){return Ct=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ct.apply(this,arguments)}const Et=function(t){return e.createElement("svg",Ct({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},t),e.createElement("path",{fill:"currentColor",d:"M15.09 11.63s.19-1.28.91-1.28c.76 0 1.78 1.71 1.78 1.71s-2.32-.43-2.69-.43M19 4.69c-.36-.6-2.17-1.28-3.11-1.28H13.5S12.7 2 10.88 2c-1.83 0-1.71.81-1.71 1.5v2.82l-.83.87H4.5s-1.06.72-1.06 2.25c0 1.56.48 6.91 3.69 7.41 3.8.58 4.45-1.18 4.45-1.39 0-.9.02-2.25.02-2.25s1.11 2.12 2.79 2.12 2.65.97 2.65 1.96v1.84S17 20.28 16 20.28h-2.11s-.69-.54-.69-1.28c0-.75.33-.95.73-.95.39 0 .72.04.72.04v-1.56s-3.18-.03-3.18 2.41c0 2.43 1.66 3.06 2.99 3.06h2.17s3.93-.5 3.93-8.25S19.33 5.28 19 4.69M7.5 6.31H4.26l4.06-4.09V5.5l-.82.81Z"}))};function It(){return It=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},It.apply(this,arguments)}const _t=function(t){return e.createElement("svg",It({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 7.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5Zm0 6.667a4.167 4.167 0 1 1 0-8.334 4.167 4.167 0 0 1 0 8.334ZM10 3.75C5.833 3.75 2.275 6.342.833 10c1.442 3.658 5 6.25 9.167 6.25s7.725-2.592 9.167-6.25c-1.442-3.658-5-6.25-9.167-6.25Z"}))};function xt(){return xt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xt.apply(this,arguments)}const Pt=function(t){return e.createElement("svg",xt({viewBox:"0 0 16 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M8 3a2 2 0 1 1 0 4 2 2 0 0 1 0-4Zm0-3c3.333 0 6.18 2.073 7.333 5-1.153 2.927-4 5-7.333 5S1.82 7.927.667 5C1.82 2.073 4.667 0 8 0ZM2.12 5a6.547 6.547 0 0 0 11.76 0A6.547 6.547 0 0 0 2.12 5Z"}))};function kt(){return kt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kt.apply(this,arguments)}const Bt=function(t){return e.createElement("svg",kt({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m9.858 7.5 2.642 2.633V10A2.5 2.5 0 0 0 10 7.5h-.142Zm-3.583.667 1.292 1.291c-.042.175-.067.35-.067.542a2.5 2.5 0 0 0 2.5 2.5c.183 0 .367-.025.542-.067l1.291 1.292a4.13 4.13 0 0 1-1.833.442A4.167 4.167 0 0 1 5.833 10c0-.658.167-1.275.442-1.833ZM1.667 3.558l1.9 1.9.375.375A9.86 9.86 0 0 0 .833 10c1.442 3.658 5 6.25 9.167 6.25 1.292 0 2.525-.25 3.65-.7l.358.35 2.434 2.433 1.058-1.058L2.725 2.5 1.667 3.558ZM10 5.833A4.167 4.167 0 0 1 14.167 10c0 .533-.109 1.05-.3 1.517l2.441 2.441A9.869 9.869 0 0 0 19.167 10c-1.442-3.658-5-6.25-9.167-6.25a9.872 9.872 0 0 0-3.333.583l1.808 1.792A4.208 4.208 0 0 1 10 5.833Z"}))};function Ot(){return Ot=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ot.apply(this,arguments)}const Nt=function(t){return e.createElement("svg",Ot({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m1.667 4.392 1.066-1.059 13.934 13.934-1.059 1.066-2.566-2.566A9.647 9.647 0 0 1 10 16.25c-4.167 0-7.725-2.592-9.167-6.25a9.795 9.795 0 0 1 2.659-3.783L1.667 4.392ZM10 7.5a2.5 2.5 0 0 1 2.358 3.333L9.167 7.642A2.5 2.5 0 0 1 10 7.5Zm0-3.75c4.167 0 7.725 2.592 9.167 6.25a9.824 9.824 0 0 1-3.334 4.325l-1.183-1.192A8.219 8.219 0 0 0 17.35 10 8.184 8.184 0 0 0 10 5.417c-.908 0-1.8.15-2.633.416L6.083 4.558A9.887 9.887 0 0 1 10 3.75ZM2.65 10A8.184 8.184 0 0 0 10 14.583c.575 0 1.142-.058 1.667-.175l-1.9-1.908A2.553 2.553 0 0 1 7.5 10.233L4.667 7.392A8.212 8.212 0 0 0 2.65 10Z"}))};function Dt(){return Dt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dt.apply(this,arguments)}const jt=function(t){return e.createElement("svg",Dt({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M7.5 18.333c-.5 0-.833-.333-.833-.833V15H3.333c-.916 0-1.666-.75-1.666-1.667v-10c0-.916.75-1.666 1.666-1.666h13.334c.916 0 1.666.75 1.666 1.666v10c0 .917-.75 1.667-1.666 1.667h-5.084L8.5 18.083a.756.756 0 0 1-.583.25H7.5Zm.833-5v2.584l2.584-2.584h5.75v-10H3.333v10h5ZM13.583 5l-1.166 2.5h1.75v3.333h-3.334v-3.5L11.917 5h1.666Zm-5 0L7.417 7.5h1.75v3.333H5.833v-3.5L6.917 5h1.666Z"}))};function Tt(){return Tt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tt.apply(this,arguments)}const Mt=function(t){return e.createElement("svg",Tt({viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M1 5a4 4 0 0 1 4-4h22a4 4 0 0 1 4 4v22a4 4 0 0 1-4 4H5a4 4 0 0 1-4-4V5Z",fill:"currentColor"}),e.createElement("path",{d:"M8.5 8.5h15v1.667h-15V8.5Zm0 3.333h10V13.5h-10v-1.667Zm0 3.334h15v1.666h-15v-1.666Zm0 3.333h10v1.667h-10V18.5Zm0 3.333h15V23.5h-15v-1.667Z",fill:"#fff"}))};function Ft(){return Ft=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ft.apply(this,arguments)}const Rt=function(t){return e.createElement("svg",Ft({viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M19.535 19.535a1 1 0 0 1-1.414 0L16 17.415l-2.122 2.12a1 1 0 1 1-1.414-1.414L14.585 16l-2.12-2.121a1 1 0 0 1 1.413-1.415L16 14.586l2.121-2.122a1 1 0 1 1 1.414 1.415L17.414 16l2.121 2.121a1 1 0 0 1 0 1.415ZM23.071 8.93A10 10 0 1 0 8.929 23.07 10 10 0 0 0 23.071 8.93Z",fill:"#CC2128"}))};function Lt(){return Lt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lt.apply(this,arguments)}const Qt=function(t){return e.createElement("svg",Lt({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10.75 7.75h4.125L10.75 3.625V7.75ZM5.5 2.5h6L16 7v9a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 4 16V4c0-.833.668-1.5 1.5-1.5Zm6.75 12V13H5.5v1.5h6.75Zm2.25-3V10h-9v1.5h9Z"}))};function Ut(){return Ut=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ut.apply(this,arguments)}const Vt=function(t){return e.createElement("svg",Ut({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M5.5 2.5A1.5 1.5 0 0 0 4 4v12a1.5 1.5 0 0 0 1.5 1.5h9A1.5 1.5 0 0 0 16 16V7l-4.5-4.5h-6Zm0 1.5h5.25v3.75h3.75V16h-9V4ZM7 10v1.5h6V10H7Zm0 3v1.5h3.75V13H7Z"}))};function Kt(){return Kt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kt.apply(this,arguments)}const Ht=function(t){return e.createElement("svg",Kt({viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M1 5a4 4 0 0 1 4-4h22a4 4 0 0 1 4 4v22a4 4 0 0 1-4 4H5a4 4 0 0 1-4-4V5Z",className:"text-accessory-tint-4",fill:"currentColor"}),e.createElement("path",{d:"M24 14.4V24H8l8-8 3.2 3.2 4.8-4.8Zm-11.2-4a2.4 2.4 0 1 1-4.801 0 2.4 2.4 0 0 1 4.801 0Z",fill:"#fff"}))};function Gt(){return Gt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gt.apply(this,arguments)}const Yt=function(t){return e.createElement("svg",Gt({viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M1 5a4 4 0 0 1 4-4h22a4 4 0 0 1 4 4v22a4 4 0 0 1-4 4H5a4 4 0 0 1-4-4V5Z",fill:"#F28C52"}),e.createElement("path",{d:"M12 9.14v14l11-7-11-7Z",fill:"#fff"}))};function zt(){return zt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zt.apply(this,arguments)}const Zt=function(t){return e.createElement("svg",zt({viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M1 5a4 4 0 0 1 4-4h22a4 4 0 0 1 4 4v22a4 4 0 0 1-4 4H5a4 4 0 0 1-4-4V5Z",fill:"#F28C52"}),e.createElement("path",{d:"M23.5 8.5v10.417a2.917 2.917 0 1 1-1.667-2.634v-4.891L13.5 13.167v7.416a2.917 2.917 0 1 1-1.667-2.633V11L23.5 8.5Z",fill:"#fff"}))};function Wt(){return Wt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wt.apply(this,arguments)}const qt=function(t){return e.createElement("svg",Wt({viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M1 5a4 4 0 0 1 4-4h22a4 4 0 0 1 4 4v22a4 4 0 0 1-4 4H5a4 4 0 0 1-4-4V5Z",fill:"#515357"}),e.createElement("path",{d:"M24.4 10v2H7.6v-2h16.8ZM7.6 22H16v-2H7.6v2Zm0-5h16.8v-2H7.6v2Z",fill:"#fff"}))};function Jt(){return Jt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jt.apply(this,arguments)}const Xt=function(t){return e.createElement("svg",Jt({viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M1 5a4 4 0 0 1 4-4h22a4 4 0 0 1 4 4v22a4 4 0 0 1-4 4H5a4 4 0 0 1-4-4V5Z",fill:"#CC2128"}),e.createElement("path",{d:"M24.983 18.292c-.458-.734-1.558-1.009-3.391-1.009-.642 0-1.284 0-1.925.092-.459-.275-.917-.55-1.284-.825-.916-.733-1.741-2.108-2.383-3.758 0 0 0-.092.092-.184.458-1.925.916-4.308 0-5.316-.275-.275-.55-.367-.917-.367h-.367c-.55 0-1.008.55-1.191 1.1-.55 1.925-.184 3.025.366 4.767-.366 1.375-.825 2.841-1.65 4.4-.458 1.008-1.008 1.925-1.375 2.658-.55.275-1.008.55-1.283.733-1.742 1.1-2.658 2.384-2.75 3.117-.092.275-.092.55 0 .733v.092l.733.458c.184.092.459.184.642.184 1.192 0 2.567-1.375 4.4-4.584.092 0 .183-.091.275-.091 1.558-.459 3.392-.825 5.958-1.1 1.467.733 3.3 1.1 4.4 1.1.642 0 1.1-.184 1.375-.459.275-.275.367-.641.459-1.008 0-.275 0-.55-.184-.733ZM8.117 24.158c.091-.55.733-1.558 1.833-2.475.183-.091.367-.275.733-.458-1.1 1.742-1.925 2.658-2.566 2.933ZM14.9 7.933c.092-.091.092-.183.183-.183l.184.092c.275.366.275.825.091 1.65v.275c-.091.366-.091.733-.275 1.191-.366-1.375-.366-2.383-.183-3.025Zm-1.833 11.55-.184.092c.092-.458.459-1.008.734-1.558.641-1.284 1.191-2.475 1.466-3.575.642 1.375 1.375 2.383 2.292 3.208.183.183.367.367.642.458-1.284.184-3.025.642-4.95 1.375Zm11.091-.091h-.366c-.642 0-1.742-.275-2.842-.734.092-.183.275-.183.367-.183 2.108 0 2.658.367 2.841.55.092.092.092.092.092.183 0 .092 0 .092-.092.184Z",fill:"#fff"}))};function $t(){return $t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$t.apply(this,arguments)}const en=function(t){return e.createElement("svg",$t({viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M1 5a4 4 0 0 1 4-4h22a4 4 0 0 1 4 4v22a4 4 0 0 1-4 4H5a4 4 0 0 1-4-4V5Z",fill:"#EBAD00"}),e.createElement("path",{fill:"#fff",d:"M5 9h22v14H5z"}))};function tn(){return tn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tn.apply(this,arguments)}const nn=function(t){return e.createElement("svg",tn({viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.006 26.008c5.524 0 10.002-4.478 10.002-10.002 0-5.524-4.478-10.002-10.002-10.002-5.524 0-10.002 4.478-10.002 10.002 0 5.524 4.478 10.002 10.002 10.002Zm-1.72-5.208L10 16.193l1.209-1.308 3.077 3.308L20.79 11.2 22 12.508 14.286 20.8Z",fill:"#086DD6"}))};function rn(){return rn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rn.apply(this,arguments)}const on=function(t){return e.createElement("svg",rn({viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("circle",{cx:60,cy:60,r:60,fill:"#F4F5F7"}),e.createElement("g",{filter:"url(#a)"},e.createElement("path",{d:"M39.75 26h27L87 46.4v40.8a6.826 6.826 0 0 1-1.977 4.808A6.725 6.725 0 0 1 80.25 94h-40.5C36.004 94 33 90.94 33 87.2V32.8c0-3.774 3.004-6.8 6.75-6.8Z",fill:"#fff"})),e.createElement("rect",{x:40,y:63,width:40,height:6,rx:3,fill:"#BBBEC4"}),e.createElement("rect",{x:40,y:74,width:22,height:6,rx:3,fill:"#BBBEC4"}),e.createElement("path",{d:"M63.474 33.82c0-.877 1.049-1.329 1.687-.726l15.537 14.68c.658.62.218 1.726-.686 1.726H64.474a1 1 0 0 1-1-1V33.82Z",fill:"#BBBEC4"}),e.createElement("defs",null,e.createElement("filter",{id:"a",x:21,y:18,width:78,height:92,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},e.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),e.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.createElement("feOffset",{dy:4}),e.createElement("feGaussianBlur",{stdDeviation:6}),e.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.16 0"}),e.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_647_28"}),e.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_647_28",result:"shape"}))))};function sn(){return sn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sn.apply(this,arguments)}const an=function(t){return e.createElement("svg",sn({viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M1 5a4 4 0 0 1 4-4h22a4 4 0 0 1 4 4v22a4 4 0 0 1-4 4H5a4 4 0 0 1-4-4V5Z",fill:"#1AA772"}),e.createElement("path",{d:"M12.364 22H8v-3h4.364v3Zm0-4.5H8v-3h4.364v3Zm0-4.5H8v-3h4.364v3Zm5.818 9h-4.364v-3h4.364v3Zm0-4.5h-4.364v-3h4.364v3Zm0-4.5h-4.364v-3h4.364v3ZM19.636 22H24v-3h-4.364v3ZM19.636 17.5H24v-3h-4.364v3ZM19.636 13H24v-3h-4.364v3Z",fill:"#fff"}))};function ln(){return ln=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ln.apply(this,arguments)}const cn=function(t){return e.createElement("svg",ln({viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M1 5a4 4 0 0 1 4-4h22a4 4 0 0 1 4 4v22a4 4 0 0 1-4 4H5a4 4 0 0 1-4-4V5Z",fill:"#515357"}),e.createElement("path",{d:"M19 23h-3v-3h-3v-3h3v-3h-3v-3h3V8h-3V5h3v3h3v3h-3v3h3v3h-3v3h3v3Z",fill:"#fff"}))};function un(){return un=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},un.apply(this,arguments)}const dn=function(t){return e.createElement("svg",un({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M8.334 3.333h-5A1.66 1.66 0 0 0 1.667 5v10a1.667 1.667 0 0 0 1.667 1.667h13.333A1.667 1.667 0 0 0 18.335 15V6.667c0-.925-.75-1.667-1.666-1.667H10L8.334 3.333Z"}))};function hn(){return hn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hn.apply(this,arguments)}const pn=function(t){return e.createElement("svg",hn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M16.667 15H3.333V6.667h13.334V15Zm0-10H10L8.333 3.333h-5A1.66 1.66 0 0 0 1.667 5v10a1.667 1.667 0 0 0 1.666 1.667h13.334A1.667 1.667 0 0 0 18.333 15V6.667c0-.925-.75-1.667-1.666-1.667Z"}))};function fn(){return fn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fn.apply(this,arguments)}const gn=function(t){return e.createElement("svg",fn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M3.333 3.333A1.667 1.667 0 0 0 1.667 5v10a1.667 1.667 0 0 0 1.666 1.667h13.334A1.667 1.667 0 0 0 18.333 15V6.667A1.667 1.667 0 0 0 16.667 5H10L8.333 3.333h-5Zm5.834 5c1.091 0 2.016.7 2.358 1.667h4.308v1.667H15v1.666h-1.667v-1.666h-1.808a2.492 2.492 0 0 1-2.358 1.666 2.5 2.5 0 1 1 0-5Zm0 1.667a.833.833 0 1 0 0 1.666.833.833 0 0 0 0-1.666Z"}))};function mn(){return mn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mn.apply(this,arguments)}const yn=function(t){return e.createElement("svg",mn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M2.5 2.5h15v1.667h-15V2.5Zm3.333 3.333h8.334V7.5H5.833V5.833ZM2.5 9.167h15v1.666h-15V9.167ZM5.833 12.5h8.334v1.667H5.833V12.5ZM2.5 15.833h15V17.5h-15v-1.667Z"}))};function vn(){return vn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vn.apply(this,arguments)}const An=function(t){return e.createElement("svg",vn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M2.5 2.5h15v1.667h-15V2.5Zm0 3.333h15V7.5h-15V5.833Zm0 3.334h15v1.666h-15V9.167Zm0 3.333h15v1.667h-15V12.5Zm0 3.333h15V17.5h-15v-1.667Z"}))};function bn(){return bn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bn.apply(this,arguments)}const wn=function(t){return e.createElement("svg",bn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M2.5 2.5h15v1.667h-15V2.5Zm0 3.333h10V7.5h-10V5.833Zm0 3.334h15v1.666h-15V9.167Zm0 3.333h10v1.667h-10V12.5Zm0 3.333h15V17.5h-15v-1.667Z"}))};function Sn(){return Sn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Sn.apply(this,arguments)}const Cn=function(t){return e.createElement("svg",Sn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M2.5 2.5h15v1.667h-15V2.5Zm5 3.333h10V7.5h-10V5.833Zm-5 3.334h15v1.666h-15V9.167Zm5 3.333h10v1.667h-10V12.5Zm-5 3.333h15V17.5h-15v-1.667Z"}))};function En(){return En=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},En.apply(this,arguments)}const In=function(t){return e.createElement("svg",En({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M7.632 2.95a1.136 1.136 0 0 0-1.929.806c0 .31.13.603.358.822l5.534 5.388-5.534 5.37a1.17 1.17 0 0 0-.358.823c0 .627.513 1.131 1.14 1.131.317 0 .577-.106.789-.317l6.242-6.104c.276-.268.415-.561.415-.911 0-.342-.13-.635-.415-.912L7.631 2.951Z"}))};function _n(){return _n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_n.apply(this,arguments)}const xn=function(t){return e.createElement("svg",_n({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M11.667 11.667h4.166v1.666h-2.5v2.5h-1.666v-4.166Zm-7.5 0h4.166v4.166H6.667v-2.5h-2.5v-1.666Zm2.5-7.5h1.666v4.166H4.167V6.667h2.5v-2.5Zm9.166 2.5v1.666h-4.166V4.167h1.666v2.5h2.5Z"}))};function Pn(){return Pn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pn.apply(this,arguments)}const kn=function(t){return e.createElement("svg",Pn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M4.167 4.167h4.166v1.666h-2.5v2.5H4.167V4.167Zm7.5 0h4.166v4.166h-1.666v-2.5h-2.5V4.167Zm2.5 7.5h1.666v4.166h-4.166v-1.666h2.5v-2.5Zm-5.834 2.5v1.666H4.167v-4.166h1.666v2.5h2.5Z"}))};function Bn(){return Bn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bn.apply(this,arguments)}const On=function(t){return e.createElement("svg",Bn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M17.576 10v6c0 .398-.16.78-.444 1.06-.284.282-.67.44-1.071.44H3.939c-.401 0-.787-.158-1.07-.44A1.493 1.493 0 0 1 2.423 16v-6a.761.761 0 0 1-.535-.22.746.746 0 0 1-.222-.53V7c0-.398.16-.78.444-1.06.284-.282.67-.44 1.07-.44h2.402a2.239 2.239 0 0 1 .537-2.341A2.284 2.284 0 0 1 7.727 2.5c.758 0 1.425.375 1.841.93v-.008L10 4l.432-.578v.008a2.305 2.305 0 0 1 1.84-.93c.604 0 1.182.237 1.608.659a2.239 2.239 0 0 1 .537 2.341h2.401c.402 0 .787.158 1.072.44.284.28.443.662.443 1.06v2.25c0 .199-.08.39-.221.53a.761.761 0 0 1-.536.22ZM3.939 16h5.304v-6H3.939v6Zm12.122 0v-6h-5.303v6h5.303ZM7.727 4c-.2 0-.393.079-.535.22a.746.746 0 0 0 0 1.06.761.761 0 0 0 1.071 0 .746.746 0 0 0 0-1.06.761.761 0 0 0-.536-.22Zm4.546 0c-.201 0-.394.079-.536.22a.746.746 0 0 0 0 1.06.762.762 0 0 0 1.072 0 .746.746 0 0 0 0-1.06.762.762 0 0 0-.536-.22ZM3.182 7v1.5h6.06V7h-6.06Zm7.576 0v1.5h6.06V7h-6.06Z"}))};function Nn(){return Nn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nn.apply(this,arguments)}const Dn=function(t){return e.createElement("svg",Nn({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},t),e.createElement("path",{fill:"currentColor",d:"M4 2h16a2 2 0 0 1 2 2v13.33L17.33 22H4a2 2 0 0 1-2-2V4c0-1.1.9-2 2-2m13 15v3.25L20.25 17H17m-7 2h4v-1h1v-5a5.002 5.002 0 0 0-3-9 5.002 5.002 0 0 0-3 9v5h1v1m4-2h-4v-2h4v2M12 5c2.21 0 4 1.79 4 4 0 1.5-.8 2.77-2 3.46V14h-4v-1.54C8.8 11.77 8 10.5 8 9c0-2.21 1.79-4 4-4Z"}))};function jn(){return jn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jn.apply(this,arguments)}const Tn=function(t){return e.createElement("svg",jn({viewBox:"0 -80 700 700",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M493.79 250.57c57.176 0 102.58 45.406 102.58 102.58v67.266c-35.316 11.773-70.629 18.5-105.95 18.5v-60.539c0-45.406-20.18-85.766-53.812-110.99 16.816-11.773 36.996-16.816 57.176-16.816zm-287.57 0c20.18 0 40.359 5.047 57.176 16.816-31.953 25.227-53.812 65.586-53.812 110.99v60.539c-35.316 0-70.629-5.047-105.95-18.5v-67.266c0-57.176 47.086-102.58 102.58-102.58zm144.62 1.684c68.949 0 124.45 57.176 124.45 126.12v82.402c-87.449 30.27-169.85 30.27-250.57 0v-82.402c0-68.95 57.176-126.12 126.12-126.12zm0-174.89c45.406 0 84.086 36.996 84.086 84.086 0 47.086-38.68 84.086-84.086 84.086-47.086 0-84.086-36.996-84.086-84.086 0-47.086 36.996-84.086 84.086-84.086zm-144.62 28.59c20.18 0 36.996 8.41 50.449 21.863-10.09 26.906-6.727 58.859 8.41 84.086-13.453 20.18-33.633 31.953-58.859 31.953-38.68 0-68.949-30.27-68.949-68.95 0-36.995 30.27-68.948 68.95-68.948zm287.57 0c38.68 0 68.949 31.953 68.949 68.949 0 38.68-30.27 68.949-68.949 68.949-23.543 0-45.406-11.773-57.176-31.953 15.137-25.227 18.5-57.176 8.41-84.086 11.773-13.453 30.27-21.863 48.77-21.863z",fillRule:"evenodd"}))};function Mn(){return Mn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mn.apply(this,arguments)}const Fn=function(t){return e.createElement("svg",Mn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.6 3.5H7v3.4H3.5v1.6H7v2.9H3.5V13H7v3.5h1.6V13h2.9v3.5h1.6V13h3.4v-1.6h-3.4V8.5h3.4V6.9h-3.4V3.5h-1.6v3.4H8.6V3.5Zm0 5v2.9h2.9V8.5H8.6Z",fill:"#086DD6"}))};function Rn(){return Rn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rn.apply(this,arguments)}const Ln=function(t){return e.createElement("svg",Rn({viewBox:"0 0 20 20",fillRule:"evenodd",clipRule:"evenodd",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M8.6 3.5H7v3.4H3.5v1.6H7v2.9H3.5V13H7v3.5h1.6V13h2.9v3.5h1.6V13h3.4v-1.6h-3.4V8.5h3.4V6.9h-3.4V3.5h-1.6v3.4H8.6V3.5Zm0 5v2.9h2.9V8.5H8.6Z"}))};function Qn(){return Qn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qn.apply(this,arguments)}const Un=function(t){return e.createElement("svg",Qn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{clipRule:"evenodd",d:"M1.75 4.108 2.93 2.93 17.07 17.072l-1.179 1.178-2.792-2.792V16.5h-1.6v-2.642L10.642 13H8.6v3.5H7V13H3.5v-1.6H7V9.358L6.142 8.5H3.5V6.9h1.042L1.75 4.108ZM8.6 11.4v-.442l.442.442H8.6Z"}),e.createElement("path",{d:"M15.356 13H16.5v-1.6h-2.744l1.6 1.6ZM13.1 10.744V8.5h3.4V6.9h-3.4V3.5h-1.6v3.4H9.256l1.6 1.6h.644v.644l1.6 1.6ZM8.6 6.244V3.5H7v1.144l1.6 1.6ZM8.6 10.958v.442h.442l-.442-.442Z"}),e.createElement("path",{d:"M11.5 8.5h-.644l.644.644V8.5Z"}))};function Vn(){return Vn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vn.apply(this,arguments)}const Kn=function(t){return e.createElement("svg",Vn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m10 17.792-1.21-1.1C4.5 12.8 1.667 10.225 1.667 7.083c0-2.575 2.016-4.583 4.583-4.583 1.45 0 2.842.675 3.75 1.733A5.011 5.011 0 0 1 13.75 2.5c2.567 0 4.583 2.008 4.583 4.583 0 3.142-2.833 5.717-7.125 9.609L10 17.792Z"}))};function Hn(){return Hn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hn.apply(this,arguments)}const Gn=function(t){return e.createElement("svg",Hn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m12.558 9.375-.75.767c-.6.6-.975 1.108-.975 2.358H9.167v-.417c0-.925.375-1.758.975-2.358l1.033-1.05c.308-.3.492-.717.492-1.175a1.666 1.666 0 1 0-3.334 0H6.667a3.333 3.333 0 0 1 6.666 0c0 .733-.3 1.392-.775 1.875Zm-1.725 6.458H9.167v-1.666h1.666v1.666ZM10 1.667A8.333 8.333 0 1 0 18.333 10c0-4.608-3.75-8.333-8.333-8.333Z"}))};function Yn(){return Yn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yn.apply(this,arguments)}const zn=function(t){return e.createElement("svg",Yn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M9.167 15h1.666v-1.667H9.167V15ZM10 1.667a8.333 8.333 0 1 0 0 16.666 8.333 8.333 0 0 0 0-16.666Zm0 15A6.676 6.676 0 0 1 3.333 10 6.676 6.676 0 0 1 10 3.333 6.676 6.676 0 0 1 16.667 10 6.676 6.676 0 0 1 10 16.667ZM10 5a3.333 3.333 0 0 0-3.333 3.333h1.666a1.667 1.667 0 1 1 3.334 0c0 1.667-2.5 1.459-2.5 4.167h1.666c0-1.875 2.5-2.083 2.5-4.167A3.333 3.333 0 0 0 10 5Z"}))};function Zn(){return Zn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zn.apply(this,arguments)}const Wn=function(t){return e.createElement("svg",Zn({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M11.667 6.667h-1.25v4.166l3.566 2.117.6-1.008-2.916-1.734V6.667ZM11.25 2.5a7.5 7.5 0 0 0-7.5 7.5h-2.5l3.3 3.358L7.917 10h-2.5a5.833 5.833 0 1 1 5.833 5.833 5.786 5.786 0 0 1-4.117-1.716L5.95 15.3a7.413 7.413 0 0 0 5.3 2.2 7.5 7.5 0 0 0 0-15Z"}))};function qn(){return qn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qn.apply(this,arguments)}const Jn=function(t){return e.createElement("svg",qn({width:120,height:120,fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("circle",{cx:60,cy:60,r:60,fill:"#F4F5F7"}),e.createElement("g",{filter:"url(#a)"},e.createElement("path",{d:"M78.75 45.333c1.658 0 3.247.642 4.42 1.786a6.02 6.02 0 0 1 1.83 4.31v30.476a6.02 6.02 0 0 1-1.83 4.31A6.331 6.331 0 0 1 78.75 88h-37.5a6.331 6.331 0 0 1-4.42-1.785 6.02 6.02 0 0 1-1.83-4.31V51.429c0-3.383 2.813-6.096 6.25-6.096h3.125v-6.095c0-4.041 1.646-7.917 4.577-10.775C51.882 25.605 55.856 24 60 24c2.052 0 4.084.394 5.98 1.16a15.657 15.657 0 0 1 5.069 3.303 15.218 15.218 0 0 1 3.387 4.944 14.912 14.912 0 0 1 1.189 5.831v6.095h3.125ZM60 30.095a9.497 9.497 0 0 0-6.63 2.678 9.03 9.03 0 0 0-2.745 6.465v6.095h18.75v-6.095a9.03 9.03 0 0 0-2.746-6.465A9.497 9.497 0 0 0 60 30.095Z",fill:"#fff"})),e.createElement("path",{d:"M61.071 61.389h-1.928v6.389l5.503 3.245.925-1.546-4.5-2.657v-5.431Z",fill:"#BBBEC4",stroke:"#BBBEC4",strokeWidth:2}),e.createElement("path",{d:"M60.857 52c-3.75 0-7.348 1.528-10 4.247-2.653 2.72-4.143 6.407-4.143 10.253H42l6.223 6.493L54.57 66.5h-4.714c0-2.991 1.16-5.86 3.222-7.975a10.864 10.864 0 0 1 7.778-3.303c2.918 0 5.715 1.188 7.778 3.303a11.424 11.424 0 0 1 3.222 7.975c0 2.991-1.159 5.86-3.222 7.975a10.864 10.864 0 0 1-7.778 3.303c-3.033 0-5.783-1.273-7.763-3.32l-2.231 2.289C53.424 79.389 56.929 81 60.857 81c3.751 0 7.348-1.528 10-4.247C73.51 74.033 75 70.346 75 66.5s-1.49-7.534-4.142-10.253c-2.653-2.72-6.25-4.247-10-4.247Z",fill:"#BBBEC4",stroke:"#BBBEC4"}),e.createElement("defs",null,e.createElement("filter",{id:"a",x:23,y:16,width:74,height:88,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},e.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),e.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.createElement("feOffset",{dy:4}),e.createElement("feGaussianBlur",{stdDeviation:6}),e.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.16 0"}),e.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_39_37"}),e.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_39_37",result:"shape"}))))};function Xn(){return Xn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xn.apply(this,arguments)}const $n=function(t){return e.createElement("svg",Xn({xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("svg",Xn({width:20,height:20,fill:"none",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M11.667 6.667h-1.25v4.166l3.566 2.117.6-1.008-2.916-1.734V6.667zM11.25 2.5a7.5 7.5 0 0 0-7.5 7.5h-2.5l3.3 3.358L7.917 10h-2.5a5.833 5.833 0 1 1 5.833 5.833 5.786 5.786 0 0 1-4.117-1.716L5.95 15.3a7.413 7.413 0 0 0 5.3 2.2 7.5 7.5 0 0 0 0-15z",fill:"#72767E"})),e.createElement("svg",Xn({width:20,height:20,fill:"none",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{fill:"#72767E",d:"M14.167 12.5 10 8.333 5.833 12.5h8.334z"})),e.createElement("svg",Xn({width:20,height:20,fill:"none",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M5.833 8.333 10 12.5l4.167-4.167H5.833z",fill:"#72767E"})),e.createElement("svg",Xn({width:20,height:20,fill:"none",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M14.537 9.4a7.306 7.306 0 0 0-4.722-1.733c-3.182 0-5.87 2.02-6.815 4.813l1.615.52c.718-2.127 2.771-3.667 5.2-3.667 1.335 0 2.553.48 3.504 1.254L10.842 13H17V7l-2.463 2.4z",fill:"#72767E"})),e.createElement("svg",Xn({width:20,height:20,fill:"none",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M2.5 7.5h5v5h-5v-5zm0-3.333h15v1.666h-15V4.166zm15 3.333v1.666H9.167V7.5H17.5zm0 3.333V12.5H9.167v-1.667H17.5zm-15 3.333h11.667v1.667H2.5v-1.667z",fill:"#72767E"})),e.createElement("svg",Xn({width:20,height:20,fill:"none",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10.181 7.667A7.3 7.3 0 0 0 5.462 9.4L3 7v6h6.155L6.68 10.587a5.523 5.523 0 0 1 3.501-1.254c2.421 0 4.48 1.54 5.198 3.667L17 12.48c-.95-2.793-3.639-4.813-6.819-4.813z",fill:"#72767E"})))};function er(){return er=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},er.apply(this,arguments)}const tr=function(t){return e.createElement("svg",er({width:120,height:120,fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("circle",{cx:60,cy:60,r:60,fill:"#F4F5F7"}),e.createElement("g",{filter:"url(#a)"},e.createElement("rect",{x:21.505,y:49.353,width:40,height:40,rx:4,transform:"rotate(-15 21.505 49.353)",fill:"#fff"})),e.createElement("rect",{x:29.889,y:57.459,width:28,height:4,rx:2,transform:"rotate(-15 29.889 57.46)",fill:"#BBBEC4"}),e.createElement("rect",{x:31.959,y:65.186,width:28,height:4,rx:2,transform:"rotate(-15 31.96 65.186)",fill:"#BBBEC4"}),e.createElement("rect",{x:34.03,y:72.914,width:16,height:4,rx:2,transform:"rotate(-15 34.03 72.914)",fill:"#BBBEC4"}),e.createElement("g",{filter:"url(#b)"},e.createElement("rect",{x:40,y:32,width:56,height:56,rx:4,fill:"#fff"})),e.createElement("rect",{x:48,y:46,width:40,height:6,rx:3,fill:"#BBBEC4"}),e.createElement("rect",{x:48,y:57,width:40,height:6,rx:3,fill:"#BBBEC4"}),e.createElement("rect",{x:48,y:68,width:22,height:6,rx:3,fill:"#BBBEC4"}),e.createElement("defs",null,e.createElement("filter",{id:"a",x:10.403,y:31.898,width:71.194,height:71.194,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},e.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),e.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),e.createElement("feOffset",{dy:4}),e.createElement("feGaussianBlur",{stdDeviation:6}),e.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.16 0"}),e.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow"}),e.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),e.createElement("filter",{id:"b",x:28,y:24,width:80,height:80,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},e.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),e.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),e.createElement("feOffset",{dy:4}),e.createElement("feGaussianBlur",{stdDeviation:6}),e.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.16 0"}),e.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow"}),e.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"}))))};function nr(){return nr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nr.apply(this,arguments)}const rr=function(t){return e.createElement("svg",nr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M15.833 15.833H4.167V4.167h11.666v11.666Zm0-13.333H4.167A1.667 1.667 0 0 0 2.5 4.167v11.666A1.666 1.666 0 0 0 4.167 17.5h11.666a1.666 1.666 0 0 0 1.667-1.667V4.167A1.667 1.667 0 0 0 15.833 2.5Zm-4.2 7.742-2.291 2.95-1.634-1.967-2.291 2.942h9.166l-2.95-3.925Z"}))};function ir(){return ir=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ir.apply(this,arguments)}const or=function(t){return e.createElement("svg",ir({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},t),e.createElement("path",{fill:"currentColor",d:"M2 3.5a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm.646 2.146a.5.5 0 0 1 .708 0l2 2a.5.5 0 0 1 0 .708l-2 2a.5.5 0 0 1-.708-.708L4.293 8 2.646 6.354a.5.5 0 0 1 0-.708zM7 6.5a.5.5 0 0 1 .5-.5h6a.5.5 0 0 1 0 1h-6a.5.5 0 0 1-.5-.5zm0 3a.5.5 0 0 1 .5-.5h6a.5.5 0 0 1 0 1h-6a.5.5 0 0 1-.5-.5zm-5 3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"}))};function sr(){return sr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sr.apply(this,arguments)}const ar=function(t){return e.createElement("svg",sr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M9.167 7.5h1.666V5.833H9.167V7.5ZM10 16.667A6.675 6.675 0 0 1 3.333 10 6.676 6.676 0 0 1 10 3.333 6.675 6.675 0 0 1 16.667 10 6.675 6.675 0 0 1 10 16.667Zm0-15a8.333 8.333 0 1 0 0 16.666 8.333 8.333 0 0 0 0-16.666Zm-.833 12.5h1.666v-5H9.167v5Z"}))};function lr(){return lr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lr.apply(this,arguments)}const cr=function(t){return e.createElement("svg",lr({viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.268 17.2h4.84l.131-.881-.112-.07a3.268 3.268 0 0 0-.644-.297 5.934 5.934 0 0 0-.512-.16l2.108-11.548c.199-.048.409-.106.63-.172l.008-.003c.271-.095.525-.198.763-.307l.094-.044.165-.918H8.902l-.187.892.14.068c.222.107.437.209.647.303l.01.004c.16.061.327.115.5.162L7.905 15.768c-.461.09-.93.247-1.404.471l-.096.046-.137.915ZM6.5 17l.087-.58L6.5 17Zm1.577-1.06Z"}))};function ur(){return ur=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ur.apply(this,arguments)}const dr=function(t){return e.createElement("svg",ur({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M3.333 2.5a1.667 1.667 0 0 0-1.666 1.667V12.5a1.667 1.667 0 0 0 1.666 1.667h13.334a1.667 1.667 0 0 0 1.666-1.667V4.167A1.667 1.667 0 0 0 16.667 2.5H3.333Zm0 1.667h13.334V12.5H3.333V4.167ZM4.167 5v1.667h1.666V5H4.167Zm2.5 0v1.667h1.666V5H6.667Zm2.5 0v1.667h1.666V5H9.167Zm2.5 0v1.667h1.666V5h-1.666Zm2.5 0v1.667h1.666V5h-1.666Zm-10 2.5v1.667h1.666V7.5H4.167Zm2.5 0v1.667h1.666V7.5H6.667Zm2.5 0v1.667h1.666V7.5H9.167Zm2.5 0v1.667h1.666V7.5h-1.666Zm2.5 0v1.667h1.666V7.5h-1.666Zm-7.5 2.5v1.667h6.666V10H6.667ZM13.333 15.833 10 19.167l-3.333-3.334h6.666Z"}))};function hr(){return hr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hr.apply(this,arguments)}const pr=function(t){return e.createElement("svg",hr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M5 1.667A3.333 3.333 0 0 1 8.333 5v1.667h3.334V5A3.333 3.333 0 1 1 15 8.333h-1.667v3.334H15A3.333 3.333 0 1 1 11.667 15v-1.667H8.333V15A3.333 3.333 0 1 1 5 11.667h1.667V8.333H5a3.333 3.333 0 0 1 0-6.666ZM13.333 15A1.667 1.667 0 1 0 15 13.333h-1.667V15Zm-1.666-6.667H8.333v3.334h3.334V8.333Zm-6.667 5A1.667 1.667 0 1 0 6.667 15v-1.667H5ZM6.667 5A1.667 1.667 0 1 0 5 6.667h1.667V5ZM15 6.667A1.667 1.667 0 1 0 13.333 5v1.667H15Z"}))};function fr(){return fr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fr.apply(this,arguments)}const gr=function(t){return e.createElement("svg",fr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M15.833 8.333h-1.666V6.667h1.666v1.666Zm0 2.5h-1.666V9.167h1.666v1.666Zm-2.5-2.5h-1.666V6.667h1.666v1.666Zm0 2.5h-1.666V9.167h1.666v1.666Zm0 3.334H6.667V12.5h6.666v1.667Zm-7.5-5.834H4.167V6.667h1.666v1.666Zm0 2.5H4.167V9.167h1.666v1.666Zm.834-1.666h1.666v1.666H6.667V9.167Zm0-2.5h1.666v1.666H6.667V6.667Zm2.5 2.5h1.666v1.666H9.167V9.167Zm0-2.5h1.666v1.666H9.167V6.667Zm7.5-2.5H3.333a1.66 1.66 0 0 0-1.666 1.666v8.334a1.667 1.667 0 0 0 1.666 1.666h13.334a1.667 1.667 0 0 0 1.666-1.666V5.833c0-.925-.75-1.666-1.666-1.666Z"}))};function mr(){return mr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mr.apply(this,arguments)}const yr=function(t){return e.createElement("svg",mr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M3.333 4.167a1.667 1.667 0 0 0-1.666 1.666v8.334a1.667 1.667 0 0 0 1.666 1.666h13.334a1.667 1.667 0 0 0 1.666-1.666V5.833a1.667 1.667 0 0 0-1.666-1.666H3.333Zm0 1.666h13.334v8.334H3.333V5.833Zm.834.834v1.666h1.666V6.667H4.167Zm2.5 0v1.666h1.666V6.667H6.667Zm2.5 0v1.666h1.666V6.667H9.167Zm2.5 0v1.666h1.666V6.667h-1.666Zm2.5 0v1.666h1.666V6.667h-1.666Zm-10 2.5v1.666h1.666V9.167H4.167Zm2.5 0v1.666h1.666V9.167H6.667Zm2.5 0v1.666h1.666V9.167H9.167Zm2.5 0v1.666h1.666V9.167h-1.666Zm2.5 0v1.666h1.666V9.167h-1.666Zm-7.5 2.5v1.666h6.666v-1.666H6.667Z"}))};function vr(){return vr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vr.apply(this,arguments)}const Ar=function(t){return e.createElement("svg",vr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M2.5 3.333h5.092L13.458 15H17.5v1.667h-5.1L6.533 5H2.5V3.333Zm9.167 0H17.5V5h-5.833V3.333Z"}))};function br(){return br=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},br.apply(this,arguments)}const wr=function(t){return e.createElement("svg",br({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M13.5 16.833v-6.666H16l-6-6.309-6 6.309h2.5v6.666h7ZM10 1.5l9.333 10.333h-4.166V18.5H4.833v-6.667H.667L10 1.5Z"}))};function Sr(){return Sr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Sr.apply(this,arguments)}const Cr=function(t){return e.createElement("svg",Sr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M3.333 5.833A1.667 1.667 0 0 0 1.667 7.5v8.333A1.667 1.667 0 0 0 3.333 17.5h13.334a1.667 1.667 0 0 0 1.666-1.667V7.5a1.667 1.667 0 0 0-1.666-1.667H3.333Zm0 1.667h13.334v8.333H3.333V7.5Zm.834.833V10h1.666V8.333H4.167Zm2.5 0V10h1.666V8.333H6.667Zm2.5 0V10h1.666V8.333H9.167Zm2.5 0V10h1.666V8.333h-1.666Zm2.5 0V10h1.666V8.333h-1.666Zm-10 2.5V12.5h1.666v-1.667H4.167Zm2.5 0V12.5h1.666v-1.667H6.667Zm2.5 0V12.5h1.666v-1.667H9.167Zm2.5 0V12.5h1.666v-1.667h-1.666Zm2.5 0V12.5h1.666v-1.667h-1.666Zm-7.5 2.5V15h6.666v-1.667H6.667ZM6.667 3.833 10 .5l3.334 3.333H6.667Z"}))};function Er(){return Er=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Er.apply(this,arguments)}const Ir=function(t){return e.createElement("svg",Er({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M16.492 12.842a7.097 7.097 0 0 0 0-5.684l-2.284 1.034c.5 1.15.5 2.458.009 3.616l2.275 1.034ZM12.85 3.508a7.117 7.117 0 0 0-5.692 0l1.034 2.275a4.603 4.603 0 0 1 3.625.009l1.033-2.284ZM3.508 7.15a7.137 7.137 0 0 0 0 5.7l2.284-1.042c-.5-1.15-.5-2.466 0-3.625L3.508 7.15Zm3.65 9.342a7.083 7.083 0 0 0 5.692-.009l-1.033-2.275c-1.15.5-2.467.5-3.617.009l-1.042 2.275ZM10 1.667a8.333 8.333 0 1 1 0 16.666 8.333 8.333 0 0 1 0-16.666Zm0 5a3.333 3.333 0 1 0 0 6.666 3.333 3.333 0 0 0 0-6.666Z"}))};function _r(){return _r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_r.apply(this,arguments)}const xr=function(t){return e.createElement("svg",_r({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m17.083 15-2.5 2.5v-1.667H4.167v-1.666h10.416V12.5l2.5 2.5ZM8.442 8.333h3.125L10 4.142 8.442 8.333ZM10.625 2.5l3.958 9.167H12.85l-.767-1.825H7.917l-.767 1.825H5.417L9.375 2.5h1.25Z"}))};function Pr(){return Pr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pr.apply(this,arguments)}const kr=function(t){return e.createElement("svg",Pr({viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M8.825 11.175a.811.811 0 0 1 0 1.183.84.84 0 0 1-1.183 0 4.17 4.17 0 0 1 0-5.891l2.95-2.95a4.17 4.17 0 0 1 5.891 0 4.17 4.17 0 0 1 0 5.891l-1.241 1.242a5.758 5.758 0 0 0-.334-2.017l.392-.4a2.485 2.485 0 0 0 0-3.533 2.485 2.485 0 0 0-3.533 0L8.825 7.642a2.485 2.485 0 0 0 0 3.533Zm2.35-3.533a.84.84 0 0 1 1.183 0 4.17 4.17 0 0 1 0 5.891l-2.95 2.95a4.17 4.17 0 0 1-5.891 0 4.17 4.17 0 0 1 0-5.891L4.758 9.35c-.008.683.1 1.367.334 2.025l-.392.392a2.485 2.485 0 0 0 0 3.533 2.485 2.485 0 0 0 3.533 0l2.942-2.942a2.485 2.485 0 0 0 0-3.533.811.811 0 0 1 0-1.183Z"}))};function Br(){return Br=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Br.apply(this,arguments)}const Or=function(t){return e.createElement("svg",Br({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M14.167 5.833h-3.334v1.584h3.334A2.586 2.586 0 0 1 16.75 10c0 1.192-.817 2.192-1.925 2.5l1.217 1.2c1.358-.692 2.291-2.075 2.291-3.7a4.167 4.167 0 0 0-4.166-4.167Zm-.834 3.334h-1.825l1.667 1.666h.158V9.167ZM1.667 3.558 4.258 6.15a4.16 4.16 0 0 0-1.37 6.796 4.167 4.167 0 0 0 2.945 1.22h3.334v-1.583H5.833A2.586 2.586 0 0 1 3.25 10a2.58 2.58 0 0 1 2.3-2.558l1.725 1.725h-.608v1.666h2.275l1.891 1.892v1.442h1.442l3.342 3.333 1.05-1.05L2.725 2.5 1.667 3.558Z"}))};function Nr(){return Nr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nr.apply(this,arguments)}const Dr=function(t){return e.createElement("svg",Nr({viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M5.833 3.167H17.5v1.666H5.833V3.167Zm0 7.666V9.167H17.5v1.666H5.833Zm-2.5-8.083a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5Zm0 6a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5Zm2.5 8.083v-1.666H17.5v1.666H5.833Zm-2.5-2.083a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5Z"}))};function jr(){return jr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jr.apply(this,arguments)}const Tr=function(t){return e.createElement("svg",jr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{clipRule:"evenodd",d:"M2 4.286A2.286 2.286 0 0 1 4.286 2h11.428A2.286 2.286 0 0 1 18 4.286v11.428A2.286 2.286 0 0 1 15.714 18H4.286A2.286 2.286 0 0 1 2 15.714V4.286Zm7.805 2.03c.142-.045.365-.075.668-.09V6c-.463.023-1.123.034-1.98.034-.9 0-1.564-.011-1.993-.034v.226c.277.015.48.045.605.09a.394.394 0 0 1 .265.26c.05.128.076.335.076.622v5.604c0 .287-.025.494-.076.622a.393.393 0 0 1-.265.26c-.126.045-.328.075-.605.09V14c.908-.023 2.279-.034 4.112-.034 1.354 0 2.316.011 2.888.034a14.745 14.745 0 0 1-.088-1.785c0-.407.012-.739.037-.995h-.29c-.126.761-.399 1.371-.82 1.83-.411.46-.903.69-1.475.69h-.618c-.236 0-.408-.019-.517-.056a.36.36 0 0 1-.215-.215c-.042-.113-.063-.29-.063-.531v-5.74c0-.287.026-.494.076-.622a.43.43 0 0 1 .278-.26Z"}))};function Mr(){return Mr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mr.apply(this,arguments)}const Fr=function(t){return e.createElement("svg",Mr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.286 3.6h11.428c.379 0 .686.307.686.686v11.428a.686.686 0 0 1-.686.686H4.286a.686.686 0 0 1-.686-.686V4.286c0-.379.307-.686.686-.686ZM2 4.286A2.286 2.286 0 0 1 4.286 2h11.428A2.286 2.286 0 0 1 18 4.286v11.428A2.286 2.286 0 0 1 15.714 18H4.286A2.286 2.286 0 0 1 2 15.714V4.286Zm7.805 2.03c.142-.045.365-.075.668-.09V6c-.463.023-1.123.034-1.98.034-.9 0-1.564-.011-1.993-.034v.226c.277.015.48.045.605.09a.394.394 0 0 1 .265.26c.05.128.076.335.076.622v5.604c0 .287-.025.494-.076.622a.393.393 0 0 1-.265.26c-.126.045-.328.075-.605.09V14c.908-.023 2.279-.034 4.112-.034 1.354 0 2.316.011 2.888.034a14.745 14.745 0 0 1-.088-1.785c0-.407.012-.739.037-.995h-.29c-.126.761-.399 1.371-.82 1.83-.411.46-.903.69-1.475.69h-.618c-.236 0-.408-.019-.517-.056a.36.36 0 0 1-.215-.215c-.042-.113-.063-.29-.063-.531v-5.74c0-.287.026-.494.076-.622a.43.43 0 0 1 .278-.26Z",fill:"currentColor"}))};function Rr(){return Rr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rr.apply(this,arguments)}const Lr=function(t){return e.createElement("svg",Rr({viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M5.833 3.167H17.5v1.666H5.833V3.167Zm0 7.666V9.167H17.5v1.666H5.833Zm0 6v-1.666H17.5v1.666H5.833ZM4.024 2.364V6h-.987V3.273h-.021l-.796.476V2.91l.895-.547h.91ZM2.241 12v-.71l1.357-1.122c.09-.075.167-.145.23-.21a.794.794 0 0 0 .15-.204.506.506 0 0 0 .053-.233.453.453 0 0 0-.06-.24.391.391 0 0 0-.163-.152.512.512 0 0 0-.242-.055.512.512 0 0 0-.241.055.383.383 0 0 0-.16.161.545.545 0 0 0-.057.26H2.17c0-.256.058-.476.173-.66.115-.185.277-.328.486-.427.21-.1.455-.15.737-.15.291 0 .543.048.756.141.215.093.38.223.496.39a1.072 1.072 0 0 1 .089 1.009c-.058.138-.163.29-.313.457a6.39 6.39 0 0 1-.64.596l-.342.284v.022h1.42V12h-2.79ZM3.662 18.05c-.287 0-.541-.05-.764-.148a1.274 1.274 0 0 1-.522-.41 1.003 1.003 0 0 1-.191-.6h.994c.001.07.022.133.064.188.043.055.1.097.174.128.073.03.157.046.252.046a.574.574 0 0 0 .242-.048.396.396 0 0 0 .163-.136.338.338 0 0 0 .057-.2.293.293 0 0 0-.068-.195.44.44 0 0 0-.19-.133.77.77 0 0 0-.282-.048h-.37v-.681h.37a.655.655 0 0 0 .26-.048.407.407 0 0 0 .175-.134.308.308 0 0 0 .062-.195.326.326 0 0 0-.051-.188.36.36 0 0 0-.15-.128.582.582 0 0 0-.46.002.403.403 0 0 0-.165.133.34.34 0 0 0-.062.195h-.944c0-.222.062-.419.183-.59a1.23 1.23 0 0 1 .5-.4c.212-.098.455-.146.73-.146.269 0 .506.046.712.137.207.09.369.216.485.376.117.159.175.34.174.545a.638.638 0 0 1-.21.5.912.912 0 0 1-.536.232v.028c.294.032.514.122.662.27.148.147.221.331.219.554a.884.884 0 0 1-.192.566 1.265 1.265 0 0 1-.534.387c-.228.094-.49.14-.787.14Z"}))};function Qr(){return Qr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qr.apply(this,arguments)}const Ur=function(t){return e.createElement("svg",Qr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 14.167a1.666 1.666 0 1 0 0-3.333 1.666 1.666 0 0 0 0 3.333Zm5-7.5a1.667 1.667 0 0 1 1.667 1.666v8.334A1.667 1.667 0 0 1 15 18.333H5a1.667 1.667 0 0 1-1.667-1.666V8.333c0-.925.75-1.666 1.667-1.666h.833V5a4.167 4.167 0 0 1 8.334 0v1.667H15ZM10 2.5A2.5 2.5 0 0 0 7.5 5v1.667h5V5A2.5 2.5 0 0 0 10 2.5Z"}))};function Vr(){return Vr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vr.apply(this,arguments)}const Kr=function(t){return e.createElement("svg",Vr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 14.167c-.925 0-1.666-.75-1.666-1.667A1.667 1.667 0 1 1 10 14.167Zm5 2.5V8.333H5v8.334h10Zm0-10a1.667 1.667 0 0 1 1.667 1.666v8.334A1.667 1.667 0 0 1 15 18.333H5c-.925 0-1.667-.75-1.667-1.666V8.333A1.66 1.66 0 0 1 5 6.667h.833V5a4.167 4.167 0 1 1 8.334 0v1.667H15ZM10 2.5A2.5 2.5 0 0 0 7.5 5v1.667h5V5A2.5 2.5 0 0 0 10 2.5Z"}))};function Hr(){return Hr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hr.apply(this,arguments)}const Gr=function(t){return e.createElement("svg",Hr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M12.5 3.333V5H15v10h-2.5v1.667h4.167V3.333H12.5Zm-9.167 0v13.334H7.5V15H5V5h2.5V3.333H3.333Z"}))};function Yr(){return Yr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yr.apply(this,arguments)}const zr=function(t){return e.createElement("svg",Yr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M5.833 8.333 10 12.5l4.167-4.167H5.833Z"}))};function Zr(){return Zr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zr.apply(this,arguments)}const Wr=function(t){return e.createElement("svg",Zr({viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M.667.667 4 4 7.333.667H.667Z"}))};function qr(){return qr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qr.apply(this,arguments)}const Jr=function(t){return e.createElement("svg",qr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m7.917 14.583 4.166-4.166L7.917 6.25v8.333Z"}))};function Xr(){return Xr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xr.apply(this,arguments)}const $r=function(t){return e.createElement("svg",Xr({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m17.5 13.008-1.175 1.159L12.15 10l4.175-4.167L17.5 6.992 14.533 10l2.967 3.008ZM2.5 5h10.833v1.667H2.5V5Zm0 5.833V9.167h8.333v1.666H2.5ZM2.5 15v-1.667h10.833V15H2.5Z"}))};function ei(){return ei=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ei.apply(this,arguments)}const ti=function(t){return e.createElement("svg",ei({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m2.5 13.008 1.175 1.159L7.85 10 3.675 5.833 2.5 6.992 5.467 10 2.5 13.008ZM17.5 5H6.667v1.667H17.5V5Zm0 5.833V9.167H9.167v1.666H17.5Zm0 4.167v-1.667H6.667V15H17.5Z"}))};function ni(){return ni=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ni.apply(this,arguments)}const ri=function(t){return e.createElement("svg",ni({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M17 5v1.667H3V5h14ZM3 15h14v-1.667H3V15Zm0-4.167h14V9.167H3v1.666Z"}))};function ii(){return ii=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ii.apply(this,arguments)}const oi=function(t){return e.createElement("svg",ii({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m8 17 4-4h3.2c.4 1.2 1.5 2 2.8 2 1.7 0 3-1.3 3-3s-1.3-3-3-3c-1.3 0-2.4.8-2.8 2H12L8 7V3H3v5h3l4.2 4L6 16H3v5h5v-4Z"}))};function si(){return si=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},si.apply(this,arguments)}const ai=function(t){return e.createElement("svg",si({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M13.333 10a1.666 1.666 0 1 1 3.333 0 1.666 1.666 0 0 1-3.333 0Zm-5 0a1.667 1.667 0 1 1 3.334 0 1.667 1.667 0 0 1-3.334 0Zm-5 0a1.667 1.667 0 1 1 3.334 0 1.667 1.667 0 0 1-3.334 0Z"}))};function li(){return li=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},li.apply(this,arguments)}const ci=function(t){return e.createElement("svg",li({viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M12 8.666a1.667 1.667 0 1 1 0-3.333 1.667 1.667 0 0 1 0 3.333Zm0 5a1.667 1.667 0 1 1 0-3.333 1.667 1.667 0 0 1 0 3.333Zm0 5a1.667 1.667 0 1 1 0-3.333 1.667 1.667 0 0 1 0 3.333Z"}))};function ui(){return ui=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ui.apply(this,arguments)}const di=function(t){return e.createElement("svg",ui({viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("circle",{cx:60,cy:60,r:60,fill:"#F4F5F7"}),e.createElement("g",{filter:"url(#a)"},e.createElement("path",{fill:"#BBBEC4",d:"M31 46.001h58v33H31z"}),e.createElement("path",{d:"M89 37.444V58.68l-9.667-9.699-12.889 12.921-12.888-12.889-12.89 12.89-9.666-9.7V37.444A6.445 6.445 0 0 1 37.444 31h45.112A6.445 6.445 0 0 1 89 37.444Zm-9.667 20.687L89 67.83v14.726A6.445 6.445 0 0 1 82.556 89H37.444A6.445 6.445 0 0 1 31 82.556V61.353l9.667 9.635 12.889-12.89 12.888 12.89",fill:"#fff"})),e.createElement("defs",null,e.createElement("filter",{id:"a",x:19,y:23,width:82,height:82,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},e.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),e.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.createElement("feOffset",{dy:4}),e.createElement("feGaussianBlur",{stdDeviation:6}),e.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.16 0"}),e.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_1572_1023"}),e.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_1572_1023",result:"shape"}))))};function hi(){return hi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hi.apply(this,arguments)}const pi=function(t){return e.createElement("svg",hi({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M11.556 13.889H6.11v-1.556h5.445v1.556Zm2.333-3.111H6.11V9.222h7.778v1.556Zm0-3.111H6.11V6.11h7.778v1.556ZM15.444 3H4.556A1.55 1.55 0 0 0 3 4.556v10.888A1.556 1.556 0 0 0 4.556 17h10.888A1.556 1.556 0 0 0 17 15.444V4.556C17 3.692 16.3 3 15.444 3Z"}))};function fi(){return fi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fi.apply(this,arguments)}const gi=function(t){return e.createElement("svg",fi({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M4.556 3A1.55 1.55 0 0 0 3 4.556v10.888A1.55 1.55 0 0 0 4.556 17h10.888A1.55 1.55 0 0 0 17 15.444V4.556A1.55 1.55 0 0 0 15.444 3H4.556Zm0 1.556h10.888v10.888H4.556V4.556ZM6.11 6.11v1.556h7.778V6.11H6.11Zm0 3.111v1.556h7.778V9.222H6.11Zm0 3.111v1.556h5.445v-1.556H6.11Z"}))};function mi(){return mi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mi.apply(this,arguments)}const yi=function(t){return e.createElement("svg",mi({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M11.667 2.5v1.667h2.991l-8.191 8.191 1.175 1.175 8.191-8.191v2.991H17.5V2.5h-5.833Zm4.166 13.333H4.167V4.167H10V2.5H4.167c-.925 0-1.667.75-1.667 1.667v11.666A1.666 1.666 0 0 0 4.167 17.5h11.666a1.666 1.666 0 0 0 1.667-1.667V10h-1.667v5.833Z"}))};function vi(){return vi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vi.apply(this,arguments)}const Ai=function(t){return e.createElement("svg",vi({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},t),e.createElement("path",{fill:"currentColor",d:"M2 3.5a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm10.646 2.146a.5.5 0 0 1 .708.708L11.707 8l1.647 1.646a.5.5 0 0 1-.708.708l-2-2a.5.5 0 0 1 0-.708l2-2zM2 6.5a.5.5 0 0 1 .5-.5h6a.5.5 0 0 1 0 1h-6a.5.5 0 0 1-.5-.5zm0 3a.5.5 0 0 1 .5-.5h6a.5.5 0 0 1 0 1h-6a.5.5 0 0 1-.5-.5zm0 3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"}))};function bi(){return bi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bi.apply(this,arguments)}const wi=function(t){return e.createElement("svg",bi({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M16.2 7.8h4.2v8.4h-4.2v1.68a.84.84 0 0 0 .84.84h1.68v1.68h-2.1c-.462 0-1.26-.378-1.26-.84 0 .462-.798.84-1.26.84H12v-1.68h1.68a.84.84 0 0 0 .84-.84V6.12a.84.84 0 0 0-.84-.84H12V3.6h2.1c.462 0 1.26.378 1.26.84 0-.462.798-.84 1.26-.84h2.1v1.68h-1.68a.84.84 0 0 0-.84.84V7.8Zm-12.6 0h9.24v1.68H5.28v5.04h7.56v1.68H3.6V7.8Zm15.12 6.72V9.48H16.2v5.04h2.52ZM9.06 12a1.26 1.26 0 1 0-2.52 0 1.26 1.26 0 0 0 2.52 0Zm3.78-.932a1.254 1.254 0 0 0-1.78.092 1.238 1.238 0 0 0 .1 1.772 1.24 1.24 0 0 0 1.68 0v-1.864Z"}))};function Si(){return Si=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Si.apply(this,arguments)}const Ci=function(t){return e.createElement("svg",Si({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M17.258 5.867c.325-.325.325-.867 0-1.175l-1.95-1.95c-.308-.325-.85-.325-1.175 0L12.6 4.267l3.125 3.125 1.533-1.525ZM2.5 14.375V17.5h3.125l9.217-9.225-3.125-3.125L2.5 14.375Z"}))};function Ei(){return Ei=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ei.apply(this,arguments)}const Ii=function(t){return e.createElement("svg",Ei({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m11.717 7.5.783.783-7.567 7.55h-.766v-.766l7.55-7.567Zm3-5a.834.834 0 0 0-.584.242l-1.525 1.525 3.125 3.125 1.525-1.525c.325-.325.325-.867 0-1.175l-1.95-1.95a.818.818 0 0 0-.591-.242Zm-3 2.658L2.5 14.375V17.5h3.125l9.217-9.217-3.125-3.125Z"}))};function _i(){return _i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_i.apply(this,arguments)}const xi=function(t){return e.createElement("svg",_i({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m9.25 7.9 3-3 2.85 2.85-3 3-1.05-1.05L13 7.675 12.325 7l-1.95 1.95L9.25 7.9Zm8.025-3.45L15.55 2.725a.81.81 0 0 0-.525-.225.81.81 0 0 0-.525.225l-1.35 1.35L16 6.925 17.275 5.5c.3-.225.3-.75 0-1.05ZM16 16.525l-.975.975-4.875-4.875L6.85 16H4v-2.85l3.375-3.375-4.875-4.8L3.475 4 16 16.525Zm-6.9-4.95-.675-.675L5.5 13.825v.675h.675L9.1 11.575Z"}))};function Pi(){return Pi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pi.apply(this,arguments)}const ki=function(t){return e.createElement("svg",Pi({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M13 10V4h.75V2.5h-7.5V4H7v6l-2.5 1.5V13h4.9v4.5h1.2V13h4.9v-1.5L13 10Z"}))};function Bi(){return Bi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bi.apply(this,arguments)}const Oi=function(t){return e.createElement("svg",Bi({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M13 10V4h.75V2.5h-7.5V4H7v6l-2.5 1.5V13h4.9v4.5h1.2V13h4.9v-1.5L13 10Zm-6.4 1.5 1.9-.9V4h3v6.6l1.9.9H6.6Z"}))};function Ni(){return Ni=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ni.apply(this,arguments)}const Di=function(t){return e.createElement("svg",Ni({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M17 5v1.667H3V5h14ZM3 15h7v-1.667H3V15Zm0-4.167h14V9.167H3v1.666Z"}))};function ji(){return ji=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ji.apply(this,arguments)}const Ti=function(t){return e.createElement("svg",ji({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M14.167 10c0 .46-.373.833-.834.833h-2.5v2.5a.833.833 0 1 1-1.666 0v-2.5h-2.5a.833.833 0 1 1 0-1.666h2.5v-2.5a.833.833 0 0 1 1.666 0v2.5h2.5c.46 0 .834.373.834.833ZM10 1.667a8.333 8.333 0 1 0 0 16.666 8.333 8.333 0 0 0 0-16.666Z"}))};function Mi(){return Mi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mi.apply(this,arguments)}const Fi=function(t){return e.createElement("svg",Mi({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10.005 16.673a6.677 6.677 0 0 1-6.668-6.668 6.677 6.677 0 0 1 6.668-6.668 6.677 6.677 0 0 1 6.668 6.668 6.677 6.677 0 0 1-6.668 6.668Zm0-15.003a8.335 8.335 0 1 0 0 16.67 8.335 8.335 0 0 0 0-16.67Zm.833 5a.833.833 0 1 0-1.667 0v2.501h-2.5a.833.833 0 1 0 0 1.667h2.5v2.5a.833.833 0 1 0 1.667 0v-2.5h2.5a.833.833 0 1 0 0-1.667h-2.5v-2.5Z"}))};function Ri(){return Ri=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ri.apply(this,arguments)}const Li=function(t){return e.createElement("svg",Ri({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("rect",{opacity:.36,x:1,y:1,width:18,height:18,rx:9,fill:"#BBBEC4"}),e.createElement("path",{d:"M6.667 12H8c0 .72.913 1.333 2 1.333 1.086 0 2-.613 2-1.333 0-.733-.694-1-2.16-1.353C8.427 10.293 6.667 9.853 6.667 8c0-1.193.98-2.207 2.333-2.547V4h2v1.453c1.353.34 2.333 1.354 2.333 2.547H12c0-.72-.914-1.333-2-1.333-1.087 0-2 .613-2 1.333 0 .733.693 1 2.16 1.353 1.413.354 3.173.794 3.173 2.647 0 1.193-.98 2.207-2.333 2.547V16H9v-1.453c-1.354-.34-2.333-1.354-2.333-2.547Z"}))};function Qi(){return Qi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qi.apply(this,arguments)}const Ui=function(t){return e.createElement("svg",Qi({width:120,height:120,fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("circle",{cx:60,cy:60,r:60,fill:"#F4F5F7"}),e.createElement("g",{filter:"url(#a)"},e.createElement("rect",{x:31,y:31,width:58,height:58,rx:4,fill:"#fff"}),e.createElement("path",{d:"M50 66h4c0 2.16 2.74 4 6 4s6-1.84 6-4c0-2.2-2.08-3-6.48-4.06C55.28 60.88 50 59.56 50 54c0-3.58 2.94-6.62 7-7.64V42h6v4.36c4.06 1.02 7 4.06 7 7.64h-4c0-2.16-2.74-4-6-4s-6 1.84-6 4c0 2.2 2.08 3 6.48 4.06C64.72 59.12 70 60.44 70 66c0 3.58-2.94 6.62-7 7.64V78h-6v-4.36c-4.06-1.02-7-4.06-7-7.64Z",fill:"#BBBEC4"})),e.createElement("defs",null,e.createElement("filter",{id:"a",x:19,y:23,width:82,height:82,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},e.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),e.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.createElement("feOffset",{dy:4}),e.createElement("feGaussianBlur",{stdDeviation:6}),e.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.16 0"}),e.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_5_1809"}),e.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_5_1809",result:"shape"}))))};function Vi(){return Vi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vi.apply(this,arguments)}const Ki=function(t){return e.createElement("svg",Vi({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M15 2.5H5v3.333h10V2.5Zm.833 7.5a.833.833 0 1 1 0-1.666.833.833 0 0 1 0 1.666Zm-2.5 5.833H6.667v-4.166h6.666v4.166Zm2.5-9.166H4.167a2.5 2.5 0 0 0-2.5 2.5v5H5V17.5h10v-3.333h3.333v-5a2.5 2.5 0 0 0-2.5-2.5Z"}))};function Hi(){return Hi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hi.apply(this,arguments)}const Gi=function(t){return e.createElement("svg",Hi({viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("circle",{cx:60,cy:60,r:60,fill:"#F4F5F7"}),e.createElement("g",{filter:"url(#a)"},e.createElement("path",{d:"M78.75 45.333c1.658 0 3.247.642 4.42 1.786a6.02 6.02 0 0 1 1.83 4.31v30.476a6.02 6.02 0 0 1-1.83 4.31A6.331 6.331 0 0 1 78.75 88h-37.5a6.331 6.331 0 0 1-4.42-1.785 6.02 6.02 0 0 1-1.83-4.31V51.429c0-3.383 2.813-6.096 6.25-6.096h3.125v-6.095c0-4.041 1.646-7.917 4.577-10.775C51.882 25.605 55.856 24 60 24c2.052 0 4.084.394 5.98 1.16a15.657 15.657 0 0 1 5.069 3.303 15.218 15.218 0 0 1 3.387 4.944 14.912 14.912 0 0 1 1.189 5.831v6.095h3.125ZM60 30.095a9.497 9.497 0 0 0-6.63 2.678 9.03 9.03 0 0 0-2.745 6.465v6.095h18.75v-6.095a9.03 9.03 0 0 0-2.746-6.465A9.497 9.497 0 0 0 60 30.095Z",fill:"#fff"})),e.createElement("circle",{cx:60,cy:67,r:6,fill:"#BBBEC4"}),e.createElement("defs",null,e.createElement("filter",{id:"a",x:23,y:16,width:74,height:88,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},e.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),e.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.createElement("feOffset",{dy:4}),e.createElement("feGaussianBlur",{stdDeviation:6}),e.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.16 0"}),e.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_638_9"}),e.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_638_9",result:"shape"}))))};function Yi(){return Yi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yi.apply(this,arguments)}const zi=function(t){return e.createElement("svg",Yi({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M14.537 9.4a7.306 7.306 0 0 0-4.722-1.733c-3.182 0-5.87 2.02-6.815 4.813l1.615.52c.718-2.127 2.771-3.667 5.2-3.667 1.335 0 2.553.48 3.504 1.254L10.842 13H17V7l-2.463 2.4Z"}))};function Zi(){return Zi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zi.apply(this,arguments)}const Wi=function(t){return e.createElement("svg",Zi({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M3 15h18v-2H3v2Zm0 4h18v-2H3v2Zm0-8h18V9H3v2Zm0-6v2h18V5H3Z"}))};function qi(){return qi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qi.apply(this,arguments)}const Ji=function(t){return e.createElement("svg",qi({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},t),e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.6 2.677c.147-.31.356-.465.626-.465.248 0 .44.118.573.353.134.236.201.557.201.966 0 .443-.078.798-.235 1.067-.156.268-.365.402-.627.402-.237 0-.416-.125-.537-.374h-.008v.31H11V1h.593v1.677h.008zm-.016 1.1a.78.78 0 0 0 .107.426c.071.113.163.169.274.169.136 0 .24-.072.314-.216.075-.145.113-.35.113-.615 0-.22-.035-.39-.104-.514-.067-.124-.164-.187-.29-.187-.12 0-.219.062-.297.185a.886.886 0 0 0-.117.48v.272zM4.12 7.695 2 5.568l.662-.662 1.006 1v-1.51A1.39 1.39 0 0 1 5.055 3H7.4v.905H5.055a.49.49 0 0 0-.468.493l.007 1.5.949-.944.656.656-2.08 2.085zM9.356 4.93H10V3.22C10 2.408 9.685 2 9.056 2c-.135 0-.285.024-.45.073a1.444 1.444 0 0 0-.388.167v.665c.237-.203.487-.304.75-.304.261 0 .392.156.392.469l-.6.103c-.506.086-.76.406-.76.961 0 .263.061.473.183.631A.61.61 0 0 0 8.69 5c.29 0 .509-.16.657-.48h.009v.41zm.004-1.355v.193a.75.75 0 0 1-.12.436.368.368 0 0 1-.313.17.276.276 0 0 1-.22-.095.38.38 0 0 1-.08-.248c0-.222.11-.351.332-.389l.4-.067zM7 12.93h-.644v-.41h-.009c-.148.32-.367.48-.657.48a.61.61 0 0 1-.507-.235c-.122-.158-.183-.368-.183-.63 0-.556.254-.876.76-.962l.6-.103c0-.313-.13-.47-.392-.47-.263 0-.513.102-.75.305v-.665c.095-.063.224-.119.388-.167.165-.049.315-.073.45-.073.63 0 .944.407.944 1.22v1.71zm-.64-1.162v-.193l-.4.068c-.222.037-.333.166-.333.388 0 .1.027.183.08.248a.276.276 0 0 0 .22.095.368.368 0 0 0 .312-.17c.08-.116.12-.26.12-.436zM9.262 13c.321 0 .568-.058.738-.173v-.71a.9.9 0 0 1-.552.207.619.619 0 0 1-.5-.215c-.12-.145-.181-.345-.181-.598 0-.26.063-.464.189-.612a.644.644 0 0 1 .516-.223c.194 0 .37.069.528.207v-.749c-.129-.09-.338-.134-.626-.134-.417 0-.751.14-1.001.422-.249.28-.373.662-.373 1.148 0 .42.116.764.349 1.03.232.267.537.4.913.4zM2 9l1-1h9l1 1v5l-1 1H3l-1-1V9zm1 0v5h9V9H3zm3-2 1-1h7l1 1v5l-1 1V7H6z",clipRule:"evenodd"}))};function Xi(){return Xi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xi.apply(this,arguments)}const $i=function(t){return e.createElement("svg",Xi({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},t),e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"m3.221 3.739 2.261 2.269L7.7 3.784l-.7-.7-1.012 1.007-.008-1.6a.523.523 0 0 1 .5-.526H8V1H6.48A1.482 1.482 0 0 0 5 2.489V4.1L3.927 3.033l-.706.706zm6.67 1.794h.01c.183.311.451.467.806.467.393 0 .706-.168.94-.503.236-.335.353-.78.353-1.333 0-.511-.1-.913-.301-1.207-.201-.295-.488-.442-.86-.442-.405 0-.718.194-.938.581h-.01V1H9v4.919h.89v-.386zm-.015-1.061v-.34c0-.248.058-.448.175-.601a.54.54 0 0 1 .445-.23.49.49 0 0 1 .436.233c.104.154.155.368.155.643 0 .33-.056.587-.169.768a.524.524 0 0 1-.47.27.495.495 0 0 1-.411-.211.853.853 0 0 1-.16-.532zM9 12.769c-.256.154-.625.231-1.108.231-.563 0-1.02-.178-1.369-.533-.349-.355-.523-.813-.523-1.374 0-.648.186-1.158.56-1.53.374-.376.875-.563 1.5-.563.433 0 .746.06.94.179v.998a1.26 1.26 0 0 0-.792-.276c-.325 0-.583.1-.774.298-.19.196-.283.468-.283.816 0 .338.09.603.272.797.182.191.431.287.749.287.282 0 .558-.092.828-.276v.946zM4 7 3 8v6l1 1h7l1-1V8l-1-1H4zm0 1h7v6H4V8z",clipRule:"evenodd"}))};function eo(){return eo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},eo.apply(this,arguments)}const to=function(t){return e.createElement("svg",eo({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 2.5A7.5 7.5 0 0 0 2.5 10H0l3.333 3.333L6.667 10h-2.5A5.833 5.833 0 1 1 10 15.833a5.946 5.946 0 0 1-3.383-1.083l-1.2 1.2A7.595 7.595 0 0 0 10 17.5a7.5 7.5 0 0 0 0-15Zm1.667 7.5a1.667 1.667 0 1 0-3.333 0 1.667 1.667 0 0 0 3.333 0Z"}))};function no(){return no=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},no.apply(this,arguments)}const ro=function(t){return e.createElement("svg",no({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M2.5 7.5h5v5h-5v-5Zm0-3.333h15v1.666h-15V4.166Zm15 3.333v1.666H9.167V7.5H17.5Zm0 3.333V12.5H9.167v-1.667H17.5Zm-15 3.333h11.667v1.667H2.5v-1.667Z"}))};function io(){return io=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},io.apply(this,arguments)}const oo=function(t){return e.createElement("svg",io({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M3.333 3.333A1.667 1.667 0 0 0 1.667 5v9.167a1.667 1.667 0 0 0 1.666 1.666v.834H5v-.834h9.167v.834h1.666v-.834a1.666 1.666 0 0 0 1.667-1.666v-.834h.833v-1.666H17.5V7.5h.833V5.833H17.5V5a1.667 1.667 0 0 0-1.667-1.667h-12.5Zm0 1.667h12.5v9.167h-12.5V5Zm7.917 1.25a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667ZM4.167 7.5v4.167h1.666V7.5H4.167Zm7.083.417a1.667 1.667 0 1 1 0 3.333 1.667 1.667 0 0 1 0-3.333Z"}))};function so(){return so=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},so.apply(this,arguments)}const ao=function(t){return e.createElement("svg",so({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M16 2c.825 0 1.5.686 1.5 1.524v12.19c0 .838-.675 1.524-1.5 1.524h-.75V18h-3v-.762h-4.5V18h-3v-.762H4c-.825 0-1.5-.686-1.5-1.524V3.524C2.5 2.686 3.175 2 4 2h12Zm-2.25 7.619c0-.762-.225-1.524-.6-2.133l1.125-1.143-1.05-1.067L12.1 6.42c-.6-.38-1.35-.61-2.1-.61s-1.5.23-2.1.61L6.85 5.276 5.725 6.42 6.85 7.562c-.375.533-.6 1.295-.6 2.057s.225 1.524.6 2.133l-1.125 1.143 1.125 1.067 1.125-1.143c.525.381 1.275.61 2.025.61s1.5-.229 2.1-.61l1.125 1.143 1.05-1.067-1.125-1.143c.375-.61.6-1.371.6-2.133ZM10 7.333c1.275 0 2.25.99 2.25 2.286 0 1.295-.975 2.286-2.25 2.286s-2.25-.99-2.25-2.286c0-1.295.975-2.286 2.25-2.286Zm0 3.81c.825 0 1.5-.686 1.5-1.524s-.675-1.524-1.5-1.524-1.5.686-1.5 1.524.675 1.524 1.5 1.524Z"}))};function lo(){return lo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lo.apply(this,arguments)}const co=function(t){return e.createElement("svg",lo({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M8.5 9.62c0-.839.675-1.525 1.5-1.525s1.5.686 1.5 1.524-.675 1.524-1.5 1.524-1.5-.686-1.5-1.524Zm-1.65 4.342-1.125-1.067 1.125-1.143a4.144 4.144 0 0 1-.6-2.133c0-.762.225-1.524.6-2.057L5.725 6.419 6.85 5.276 7.9 6.42c.6-.38 1.35-.61 2.1-.61s1.5.23 2.1.61l1.125-1.143 1.05 1.067-1.125 1.143c.375.61.6 1.371.6 2.133s-.225 1.524-.6 2.133l1.125 1.143-1.05 1.067-1.125-1.143c-.6.381-1.35.61-2.1.61s-1.5-.229-2.025-.61L6.85 13.962ZM10 7.333c-1.275 0-2.25.99-2.25 2.286 0 1.295.975 2.286 2.25 2.286s2.25-.99 2.25-2.286c0-1.295-.975-2.286-2.25-2.286ZM16 2c.825 0 1.5.686 1.5 1.524v12.19c0 .838-.675 1.524-1.5 1.524h-.75V18h-3v-.762h-4.5V18h-3v-.762H4c-.825 0-1.5-.686-1.5-1.524V3.524C2.5 2.686 3.175 2 4 2h12Zm0 13.714V3.524H4v12.19h12Z"}))};function uo(){return uo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uo.apply(this,arguments)}const ho=function(t){return e.createElement("svg",uo({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M17 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V7l-4-4Zm2 16H5V5h11.17L19 7.83V19Zm-7-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3ZM6 6h9v4H6V6Z"}))};function po(){return po=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},po.apply(this,arguments)}const fo=function(t){return e.createElement("svg",po({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M7.917 2.5a5.417 5.417 0 0 1 5.416 5.417 5.43 5.43 0 0 1-1.3 3.525l.225.225h.659l4.166 4.166-1.25 1.25-4.166-4.166v-.659l-.225-.225a5.43 5.43 0 0 1-3.525 1.3 5.416 5.416 0 1 1 0-10.833Zm0 1.667a3.734 3.734 0 0 0-3.75 3.75 3.734 3.734 0 0 0 3.75 3.75 3.734 3.734 0 0 0 3.75-3.75 3.734 3.734 0 0 0-3.75-3.75Z"}))};function go(){return go=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},go.apply(this,arguments)}const mo=function(t){return e.createElement("svg",go({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M8.874 14.017a4.99 4.99 0 0 0 2.91-.938l3.086 3.086a.742.742 0 0 0 .534.215c.423 0 .722-.325.722-.742a.717.717 0 0 0-.208-.52l-3.066-3.074A4.987 4.987 0 0 0 13.88 9.01a5.02 5.02 0 0 0-5.006-5.006A5.02 5.02 0 0 0 3.867 9.01a5.02 5.02 0 0 0 5.007 5.007Zm0-1.08c-2.149 0-3.926-1.778-3.926-3.927 0-2.148 1.777-3.925 3.926-3.925 2.148 0 3.925 1.777 3.925 3.925 0 2.149-1.777 3.926-3.925 3.926Z"}))};function yo(){return yo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yo.apply(this,arguments)}const vo=function(t){return e.createElement("svg",yo({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 10h5.444c-.412 2.99-2.55 5.658-5.444 6.487V10H4.556V5.855L10 3.593V10Zm0-8L3 4.91v4.363c0 4.036 2.987 7.803 7 8.727 4.013-.924 7-4.69 7-8.727V4.909L10 2Z"}))};function Ao(){return Ao=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ao.apply(this,arguments)}const bo=function(t){return e.createElement("svg",Ao({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M9.167 5.833H17.5V7.5H9.167V5.833Zm0 6.667H17.5v1.666H9.167V12.5Zm-5 4.166L1.25 13.75l1.175-1.175 1.742 1.733 3.825-3.816 1.175 1.174-5 5ZM1.25 7.083 4.167 10l5-5-1.175-1.175-3.825 3.817-1.742-1.734L1.25 7.083Z"}))};function wo(){return wo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wo.apply(this,arguments)}const So=function(t){return e.createElement("svg",wo({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M.833 18.333 20 10 .833 1.667v6.481L14.523 10 .834 11.852v6.481Z"}))};function Co(){return Co=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Co.apply(this,arguments)}const Eo=function(t){return e.createElement("svg",Co({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10.833 15.833h.834a.833.833 0 0 1 .833.834h5.833v1.666H12.5a.833.833 0 0 1-.833.834H8.333a.833.833 0 0 1-.833-.834H1.667v-1.666H7.5a.833.833 0 0 1 .833-.834h.834v-1.666H3.333a.833.833 0 0 1-.833-.834V10a.833.833 0 0 1 .833-.833h13.334A.833.833 0 0 1 17.5 10v3.333a.833.833 0 0 1-.833.834h-5.834v1.666ZM3.333 2.5h13.334a.833.833 0 0 1 .833.833v3.334a.833.833 0 0 1-.833.833H3.333a.833.833 0 0 1-.833-.833V3.333a.833.833 0 0 1 .833-.833ZM7.5 5.833h.833V4.167H7.5v1.666Zm0 6.667h.833v-1.667H7.5V12.5ZM4.167 4.167v1.666h1.666V4.167H4.167Zm0 6.666V12.5h1.666v-1.667H4.167Z"}))};function Io(){return Io=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Io.apply(this,arguments)}const _o=function(t){return e.createElement("svg",Io({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 12.917a2.916 2.916 0 1 1 0-5.833 2.916 2.916 0 0 1 0 5.833Zm6.192-2.109A6.48 6.48 0 0 0 16.25 10c0-.275-.025-.55-.058-.833l1.758-1.359a.42.42 0 0 0 .1-.533l-1.667-2.883a.41.41 0 0 0-.508-.184l-2.075.834a6.04 6.04 0 0 0-1.408-.817l-.309-2.208a.421.421 0 0 0-.416-.35H8.333a.421.421 0 0 0-.416.35l-.309 2.208a6.04 6.04 0 0 0-1.408.817l-2.075-.834a.41.41 0 0 0-.508.184L1.95 7.275a.41.41 0 0 0 .1.533l1.758 1.359A7.126 7.126 0 0 0 3.75 10c0 .275.025.542.058.808L2.05 12.192a.41.41 0 0 0-.1.533l1.667 2.883c.1.184.325.25.508.184L6.2 14.95a5.79 5.79 0 0 0 1.408.825l.309 2.208c.033.2.208.35.416.35h3.334c.208 0 .383-.15.416-.35l.309-2.208a6.07 6.07 0 0 0 1.408-.825l2.075.842c.183.066.408 0 .508-.184l1.667-2.883a.42.42 0 0 0-.1-.533l-1.758-1.384Z"}))};function xo(){return xo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xo.apply(this,arguments)}const Po=function(t){return e.createElement("svg",xo({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 6.667a3.333 3.333 0 1 1 0 6.666 3.333 3.333 0 0 1 0-6.666Zm0 1.666a1.667 1.667 0 1 0 0 3.334 1.667 1.667 0 0 0 0-3.334Zm-1.667 10a.421.421 0 0 1-.416-.35l-.309-2.208A5.79 5.79 0 0 1 6.2 14.95l-2.075.842a.419.419 0 0 1-.508-.184L1.95 12.725a.41.41 0 0 1 .1-.533l1.758-1.384L3.75 10l.058-.833L2.05 7.808a.41.41 0 0 1-.1-.533l1.667-2.883a.41.41 0 0 1 .508-.184l2.075.834a6.04 6.04 0 0 1 1.408-.817l.309-2.208c.033-.2.208-.35.416-.35h3.334c.208 0 .383.15.416.35l.309 2.208a6.04 6.04 0 0 1 1.408.817l2.075-.834a.41.41 0 0 1 .508.184l1.667 2.883a.41.41 0 0 1-.1.533l-1.758 1.359.058.833-.058.833 1.758 1.359c.158.125.208.35.1.533l-1.667 2.883a.41.41 0 0 1-.508.184l-2.075-.834a6.042 6.042 0 0 1-1.408.817l-.309 2.208a.421.421 0 0 1-.416.35H8.333Zm1.042-15-.308 2.175c-1 .209-1.884.742-2.525 1.484l-2.009-.867-.625 1.083L5.667 8.5a4.625 4.625 0 0 0 0 3L3.9 12.8l.625 1.083 2.025-.866a4.536 4.536 0 0 0 2.508 1.466l.309 2.184h1.266l.309-2.175a4.598 4.598 0 0 0 2.508-1.475l2.025.866.625-1.083-1.767-1.292a4.65 4.65 0 0 0 0-3.008l1.759-1.292-.625-1.083-2.009.867a4.517 4.517 0 0 0-2.525-1.475l-.308-2.184h-1.25Z"}))};function ko(){return ko=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ko.apply(this,arguments)}const Bo=function(t){return e.createElement("svg",ko({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M14.667 13.315c-.591 0-1.12.241-1.525.619l-5.545-3.335c.039-.185.07-.37.07-.563 0-.193-.031-.378-.07-.562L13.08 6.17c.42.402.972.65 1.587.65.619 0 1.212-.253 1.65-.705A2.452 2.452 0 0 0 17 4.41c0-.64-.246-1.253-.683-1.705A2.296 2.296 0 0 0 14.667 2c-.62 0-1.213.254-1.65.706a2.452 2.452 0 0 0-.684 1.705c0 .193.031.378.07.562L6.92 8.276a2.284 2.284 0 0 0-1.587-.65c-.619 0-1.212.253-1.65.705A2.452 2.452 0 0 0 3 10.036c0 .64.246 1.253.683 1.705a2.296 2.296 0 0 0 1.65.706c.615 0 1.167-.25 1.587-.65l5.538 3.334a2.353 2.353 0 0 0-.062.53c0 1.294 1.018 2.339 2.27 2.339 1.253 0 2.272-1.045 2.272-2.338 0-.623-.24-1.22-.665-1.66a2.235 2.235 0 0 0-1.606-.687Z"}))};function Oo(){return Oo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Oo.apply(this,arguments)}const No=function(t){return e.createElement("svg",Oo({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("rect",{x:.5,y:.5,width:19,height:19,rx:3.5,fill:"#fff",stroke:"#DFE1E4"}),e.createElement("path",{d:"M5.5 6h3.055l3.52 7H14.5v1h-3.06L7.92 7H5.5V6ZM11 6h3.5v1H11V6Z"}))};function Do(){return Do=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Do.apply(this,arguments)}const jo=function(t){return e.createElement("svg",Do({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M15.833 2.5H4.167A1.66 1.66 0 0 0 2.5 4.167V7.5h1.667V4.167h11.666v11.666H4.167V12.5H2.5v3.333A1.666 1.666 0 0 0 4.167 17.5h11.666a1.666 1.666 0 0 0 1.667-1.667V4.167c0-.925-.75-1.667-1.667-1.667ZM8.4 12.983l1.183 1.184L13.75 10 9.583 5.833 8.4 7.008l2.158 2.159H2.5v1.666h8.058L8.4 12.983Z"}))};function To(){return To=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},To.apply(this,arguments)}const Mo=function(t){return e.createElement("svg",To({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m11.733 12.992 2.159-2.159H5.833V9.167h8.059l-2.159-2.159 1.184-1.175L17.083 10l-4.166 4.167-1.184-1.175Zm4.1-10.492A1.666 1.666 0 0 1 17.5 4.167v3.891l-1.667-1.666V4.167H4.167v11.666h11.666v-2.225l1.667-1.666v3.891a1.666 1.666 0 0 1-1.667 1.667H4.167c-.925 0-1.667-.75-1.667-1.667V4.167A1.66 1.66 0 0 1 4.167 2.5h11.666Z"}))};function Fo(){return Fo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fo.apply(this,arguments)}const Ro=function(t){return e.createElement("svg",Fo({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},t),e.createElement("path",{fill:"currentColor",d:"M3.466 3.62c-.004.052-.014.104-.018.158-.406 4.626 2.747 8.548 8.03 9.994 2.024.553 5.374 2.018 5.06 5.599a5.063 5.063 0 0 1-1.803 3.46c-1.022.857-2.308 1.21-3.64 1.166C5.147 23.794 0 18.367 0 12.05a11.95 11.95 0 0 1 3.467-8.428zM9.82 1.032C10.727.27 11.876-.046 13.055.005 18.996.27 24 5.67 24 11.936a11.94 11.94 0 0 1-2.667 7.536c.332-4.908-2.94-8.897-8.59-10.441-2.337-.64-4.749-2.274-4.514-4.948A4.467 4.467 0 0 1 9.82 1.03z"}))};function Lo(){return Lo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lo.apply(this,arguments)}const Qo=function(t){return e.createElement("svg",Lo({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M12.004 9.604v4.293h1.6V9.604c0-1.94-1.612-3.512-3.601-3.512-1.99 0-3.603 1.572-3.603 3.512v4.293h1.601V9.604c0-1.078.896-1.951 2.002-1.951 1.105 0 2 .873 2 1.95Z"}),e.createElement("path",{clipRule:"evenodd",d:"M1.667 3.333c0-.92.746-1.667 1.666-1.667h13.334c.92 0 1.666.747 1.666 1.667v13.334c0 .92-.746 1.666-1.666 1.666H3.333c-.92 0-1.666-.746-1.666-1.666V3.332ZM3.333 2.5h13.334c.46 0 .833.373.833.833v13.334c0 .46-.373.833-.833.833H3.333a.833.833 0 0 1-.833-.834V3.333c0-.46.373-.833.833-.833Z"}))};function Uo(){return Uo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Uo.apply(this,arguments)}const Vo=function(t){return e.createElement("svg",Uo({viewBox:"0 0 148 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 5c0-2.761 2.242-5 5.008-5h15.024a5.004 5.004 0 0 1 5.008 5v15c0 2.761-2.242 5-5.008 5H5.008A5.004 5.004 0 0 1 0 20V5Zm5.008-2.813h15.024A2.815 2.815 0 0 1 22.849 5v15a2.815 2.815 0 0 1-2.817 2.813H5.008A2.815 2.815 0 0 1 2.191 20V5a2.815 2.815 0 0 1 2.817-2.813Zm10.157 9.686v5.854h2.187v-5.854c0-2.645-2.203-4.79-4.92-4.79s-4.92 2.145-4.92 4.79v5.854h2.187v-5.854c0-1.47 1.223-2.661 2.733-2.661s2.733 1.191 2.733 2.66Zm57.436 5.848h1.834V6h-1.93v5.225h-.049a3.018 3.018 0 0 0-.37-.388 2.74 2.74 0 0 0-.547-.372 3.066 3.066 0 0 0-.724-.279 3.344 3.344 0 0 0-.95-.124c-.547 0-1.05.103-1.512.31-.461.197-.858.47-1.19.822-.333.351-.59.765-.773 1.24a4.249 4.249 0 0 0-.274 1.535c0 .548.086 1.065.258 1.55.182.476.434.894.756 1.256.333.352.73.636 1.19.853.473.207 1.004.31 1.594.31.547 0 1.056-.114 1.528-.341a2.585 2.585 0 0 0 1.127-.992h.032v1.116Zm-4.393-2.884a3.038 3.038 0 0 1-.129-.868c0-.29.043-.574.13-.853.096-.29.235-.547.417-.775.183-.227.413-.408.692-.543.28-.144.606-.217.982-.217.354 0 .67.073.95.217.278.145.514.331.707.559.204.227.354.485.45.775.108.29.162.579.162.868 0 .29-.054.579-.161.868-.097.28-.247.532-.45.76-.194.227-.43.413-.709.558a2.16 2.16 0 0 1-.95.202c-.375 0-.702-.073-.98-.218a2.13 2.13 0 0 1-.693-.558 2.484 2.484 0 0 1-.418-.775ZM39.662 9.04c-.215-.269-.52-.491-.917-.667a2.681 2.681 0 0 0-1.175-.279c-.236 0-.472.031-.708.093-.236.052-.45.14-.644.264a1.456 1.456 0 0 0-.483.465 1.248 1.248 0 0 0-.176.682c0 .248.053.46.16.636.108.175.252.325.435.45.193.123.424.232.692.325.268.093.563.186.885.279.364.113.74.243 1.126.387.397.145.757.336 1.078.574.333.238.601.538.805.9.214.361.322.81.322 1.348 0 .59-.113 1.106-.338 1.55a3.227 3.227 0 0 1-.901 1.086c-.376.29-.816.506-1.32.65A5.748 5.748 0 0 1 36.91 18c-.74 0-1.464-.13-2.172-.388-.708-.268-1.287-.661-1.738-1.178l1.448-1.302a2.9 2.9 0 0 0 1.11.883c.473.218.934.326 1.384.326.236 0 .478-.026.724-.077.247-.063.467-.16.66-.295.204-.134.365-.3.483-.496.129-.207.193-.46.193-.76 0-.29-.07-.527-.21-.713a1.72 1.72 0 0 0-.562-.496 3.849 3.849 0 0 0-.837-.372l-1.014-.326a10.304 10.304 0 0 1-1.03-.372 3.563 3.563 0 0 1-.933-.573 2.869 2.869 0 0 1-.66-.869c-.171-.351-.257-.785-.257-1.302 0-.558.118-1.039.354-1.442.247-.403.563-.734.95-.992a4.176 4.176 0 0 1 1.335-.59 5.912 5.912 0 0 1 1.528-.2c.58 0 1.164.097 1.754.294.601.196 1.121.49 1.561.883l-1.32 1.396Zm2.13 1.24v1.488h1.351v3.473c0 .362.032.703.097 1.024.075.31.204.589.386.837.193.238.45.429.772.573.322.135.74.202 1.255.202.215 0 .44-.02.676-.062.236-.031.44-.078.612-.14l-.065-1.457a2.026 2.026 0 0 1-.402.124c-.15.02-.29.031-.418.031-.43 0-.708-.108-.837-.325-.118-.218-.177-.491-.177-.822v-3.458h1.93V10.28h-1.93V8.124h-1.899v2.155h-1.352Zm11.325 6.496h.049v.946h1.802v-4.527c0-.372-.054-.744-.161-1.117a2.49 2.49 0 0 0-.531-1.007c-.258-.3-.612-.543-1.062-.729-.44-.186-1.003-.279-1.69-.279a5.43 5.43 0 0 0-1.754.295 4.406 4.406 0 0 0-1.512.883l.997 1.132c.247-.238.558-.44.934-.605a2.885 2.885 0 0 1 1.174-.248c.483 0 .896.114 1.24.341.353.218.53.559.53 1.024v.186c-.6 0-1.217.03-1.85.093a7.09 7.09 0 0 0-1.706.34c-.515.177-.938.43-1.271.76-.322.331-.483.776-.483 1.334 0 .434.091.8.274 1.1.193.29.429.528.708.714.29.176.6.3.933.372.343.083.67.124.982.124.547 0 1.035-.103 1.464-.31.429-.217.74-.491.933-.822Zm-.418-2.45h.434v.264c0 .59-.171 1.054-.515 1.396-.343.34-.847.511-1.512.511-.161 0-.322-.015-.483-.046a1.435 1.435 0 0 1-.434-.155 1.03 1.03 0 0 1-.322-.28.852.852 0 0 1-.113-.45c0-.278.097-.495.29-.65.193-.166.434-.29.724-.372.29-.093.606-.15.95-.17.342-.032.67-.047.98-.047Zm6.353-4.046h-1.835v7.442h1.931v-4.093c0-.248.038-.491.113-.729.075-.248.182-.465.322-.65.15-.187.338-.337.563-.45.225-.125.493-.187.804-.187.311 0 .558.062.74.186.194.124.344.285.451.481.108.186.177.398.21.636.032.238.048.465.048.682v4.124h1.93V13.07c0-.383-.053-.755-.16-1.117a2.628 2.628 0 0 0-.515-.96 2.374 2.374 0 0 0-.885-.667c-.354-.176-.783-.264-1.288-.264-.579 0-1.083.145-1.512.434-.419.28-.714.605-.885.977h-.032v-1.194Zm22.524 6.496h-.048c-.193.33-.504.605-.933.822-.43.207-.917.31-1.465.31-.31 0-.638-.041-.981-.124a3.026 3.026 0 0 1-.933-.372 2.543 2.543 0 0 1-.708-.713c-.183-.3-.274-.667-.274-1.101 0-.558.161-1.003.483-1.333.332-.331.756-.584 1.271-.76a7.089 7.089 0 0 1 1.706-.341c.633-.062 1.25-.093 1.85-.093v-.186c0-.465-.177-.806-.53-1.024-.344-.227-.757-.34-1.24-.34-.407 0-.799.082-1.174.247a3.174 3.174 0 0 0-.934.605l-.997-1.132c.44-.393.944-.687 1.512-.883a5.43 5.43 0 0 1 1.754-.295c.687 0 1.25.093 1.69.28.45.185.804.428 1.062.728.257.3.434.635.53 1.008.108.372.162.744.162 1.116v4.527h-1.803v-.946Zm-.032-2.45h-.434c-.311 0-.638.016-.982.047-.343.02-.66.078-.95.17-.289.083-.53.207-.723.373-.193.155-.29.372-.29.65 0 .177.038.327.113.45.085.114.193.207.322.28.128.072.273.124.434.155.16.03.322.046.483.046.665 0 1.169-.17 1.512-.511.344-.342.515-.807.515-1.396v-.263Zm4.084-4.046h1.85v1.24h.033c.214-.434.515-.785.901-1.054s.837-.403 1.352-.403c.075 0 .155.005.241.016.086 0 .16.01.225.03v1.706a2.693 2.693 0 0 0-.338-.062 2.16 2.16 0 0 0-.257-.016c-.44 0-.794.078-1.062.233a1.905 1.905 0 0 0-.933 1.225c-.054.227-.08.408-.08.542v3.985h-1.932v-7.442Zm13.431 7.442h-1.834v-1.116h-.032a2.585 2.585 0 0 1-1.127.992 3.475 3.475 0 0 1-1.528.341c-.59 0-1.121-.103-1.593-.31a3.915 3.915 0 0 1-1.191-.853 4.057 4.057 0 0 1-.757-1.256 4.62 4.62 0 0 1-.257-1.55c0-.548.091-1.06.274-1.535.182-.475.44-.889.772-1.24.332-.352.73-.626 1.19-.822.462-.207.966-.31 1.513-.31.354 0 .67.041.95.124.279.072.52.165.724.28.214.113.397.237.547.371.15.135.273.264.37.388h.048V6h1.931v11.72Zm-6.356-3.752c0 .29.043.579.129.868.096.29.236.548.418.775.183.228.413.414.692.559.28.144.606.217.982.217.354 0 .67-.068.95-.202.278-.145.514-.33.707-.558.204-.228.354-.48.45-.76.108-.29.162-.579.162-.868 0-.29-.054-.579-.161-.868a2.186 2.186 0 0 0-.45-.775 2.318 2.318 0 0 0-.709-.559 2.03 2.03 0 0 0-.95-.217c-.375 0-.702.073-.98.217-.28.135-.51.316-.693.543a2.482 2.482 0 0 0-.418.775 2.886 2.886 0 0 0-.129.853Zm12.821-7.225h2.688l5.294 8.217h.032V6.744h2.027v10.977h-2.574l-5.407-8.48h-.032v8.48h-2.028V6.744Zm12.009 7.225c0-.59.107-1.121.322-1.597.225-.486.525-.9.901-1.24.375-.341.82-.605 1.335-.79a4.793 4.793 0 0 1 1.642-.28c.579 0 1.126.093 1.641.28.515.185.96.449 1.335.79.376.34.671.754.885 1.24.226.476.338 1.008.338 1.597 0 .59-.112 1.127-.338 1.612a3.788 3.788 0 0 1-.885 1.256c-.375.341-.82.61-1.335.806a4.566 4.566 0 0 1-1.641.295c-.58 0-1.127-.098-1.642-.295a4.166 4.166 0 0 1-1.335-.806 3.998 3.998 0 0 1-.901-1.256 3.94 3.94 0 0 1-.322-1.612Zm1.963 0c0 .29.043.579.129.868.096.29.236.548.418.775.182.228.413.414.692.559.279.144.611.217.998.217.386 0 .718-.073.997-.218.279-.144.51-.33.692-.558.183-.227.317-.485.402-.775.097-.29.145-.579.145-.868 0-.29-.048-.574-.145-.853a2.221 2.221 0 0 0-.402-.775 1.962 1.962 0 0 0-.692-.543c-.279-.144-.611-.217-.997-.217-.387 0-.719.073-.998.217-.279.135-.51.316-.692.543a2.479 2.479 0 0 0-.418.775 2.88 2.88 0 0 0-.129.853Zm7.198-2.202V10.28h1.352V8.124h1.899v2.155h1.931v1.488h-1.931v3.458c0 .33.059.604.177.822.128.217.407.325.836.325.129 0 .269-.01.419-.03.15-.032.284-.073.402-.125l.064 1.457a2.93 2.93 0 0 1-.611.14 3.922 3.922 0 0 1-.676.062c-.515 0-.933-.067-1.255-.202a2.06 2.06 0 0 1-.772-.573 2.308 2.308 0 0 1-.386-.837 5.142 5.142 0 0 1-.097-1.024v-3.473h-1.352Zm13.949 2.326v.248c0 .083-.006.166-.016.248h-5.874c.022.269.092.517.21.744.128.217.295.409.498.574.204.155.435.279.692.372.258.093.526.14.805.14.483 0 .89-.083 1.223-.248.332-.176.606-.414.821-.714l1.287.993c-.762.992-1.867 1.488-3.315 1.488a5.002 5.002 0 0 1-1.657-.264 4.141 4.141 0 0 1-1.32-.775 3.62 3.62 0 0 1-.869-1.21c-.204-.485-.305-1.033-.305-1.643 0-.599.101-1.142.305-1.627.215-.497.504-.915.869-1.256.365-.352.794-.62 1.287-.806a4.443 4.443 0 0 1 1.626-.295c.536 0 1.03.088 1.48.264.461.165.858.418 1.191.76.332.33.59.749.772 1.255.193.496.29 1.08.29 1.752Zm-1.931-.837c0-.238-.038-.465-.113-.682a1.445 1.445 0 0 0-.901-.962 1.912 1.912 0 0 0-.804-.155c-.58 0-1.073.17-1.481.512-.397.33-.617.76-.66 1.287h3.959Zm8.033-.992a2.136 2.136 0 0 0-.708-.559 2.003 2.003 0 0 0-.982-.248c-.311 0-.595.062-.853.186a.64.64 0 0 0-.386.62c0 .29.14.497.419.62.289.114.708.233 1.255.357.289.062.579.145.869.248.3.104.568.243.804.419.247.165.445.377.596.636.15.248.225.553.225.914 0 .455-.091.843-.274 1.163-.171.31-.407.563-.708.76a2.848 2.848 0 0 1-1.029.419c-.387.093-.789.139-1.207.139a5.092 5.092 0 0 1-1.754-.31 3.79 3.79 0 0 1-1.416-.915l1.271-1.147c.214.269.493.49.837.667.343.175.724.263 1.142.263.14 0 .279-.015.418-.046.151-.031.285-.078.403-.14a.875.875 0 0 0 .306-.279.744.744 0 0 0 .112-.419c0-.31-.15-.532-.45-.666-.29-.135-.73-.269-1.32-.403a7.95 7.95 0 0 1-.853-.233 3.2 3.2 0 0 1-.724-.388 1.904 1.904 0 0 1-.515-.604c-.128-.238-.193-.532-.193-.884 0-.413.086-.77.258-1.07.182-.3.418-.542.708-.728.289-.197.616-.341.981-.434.365-.094.74-.14 1.127-.14.557 0 1.099.093 1.625.28.536.185.96.47 1.271.852l-1.255 1.07Z",fill:"#086DD6"}))};function Ko(){return Ko=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ko.apply(this,arguments)}const Ho=function(t){return e.createElement("svg",Ko({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{clipRule:"evenodd",d:"M4.286 3.6h11.428c.379 0 .686.307.686.686v11.428a.686.686 0 0 1-.686.686H4.286a.686.686 0 0 1-.686-.686V4.286c0-.379.307-.686.686-.686ZM2 4.286A2.286 2.286 0 0 1 4.286 2h11.428A2.286 2.286 0 0 1 18 4.286v11.428A2.286 2.286 0 0 1 15.714 18H4.286A2.286 2.286 0 0 1 2 15.714V4.286Zm9.937 5.254v4.293h1.601V9.54c0-1.94-1.613-3.512-3.602-3.512-1.99 0-3.603 1.572-3.603 3.512v4.293h1.602V9.54c0-1.078.896-1.951 2-1.951 1.106 0 2.002.873 2.002 1.951Z"}))};function Go(){return Go=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Go.apply(this,arguments)}const Yo=function(t){return e.createElement("svg",Go({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M8.333 10.833V9.167h5.834a.833.833 0 0 1 0 1.666H8.333Zm0 5v-1.666h2.5a.833.833 0 1 1 0 1.666h-2.5Zm0-10V4.167H17.5a.833.833 0 0 1 0 1.666H8.333ZM5 14.167h2.083l-2.916 2.916-2.917-2.916h2.083V3.333H5v10.834Z"}))};function zo(){return zo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zo.apply(this,arguments)}const Zo=function(t){return e.createElement("svg",zo({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M4 3h12c.398 0 .78.155 1.06.432.282.276.44.65.44 1.042v11.052c0 .391-.158.766-.44 1.042A1.514 1.514 0 0 1 16 17H4c-.398 0-.78-.155-1.06-.432a1.46 1.46 0 0 1-.44-1.042V4.474c0-.391.158-.766.44-1.042A1.514 1.514 0 0 1 4 3Zm0 2.947v2.21h3v-2.21H4Zm4.5 0v2.21h3v-2.21h-3Zm7.5 2.21v-2.21h-3v2.21h3ZM4 9.633v2.21h3v-2.21H4Zm0 5.894h3v-2.21H4v2.21Zm4.5-5.894v2.21h3v-2.21h-3Zm0 5.894h3v-2.21h-3v2.21Zm7.5 0v-2.21h-3v2.21h3Zm0-5.894h-3v2.21h3v-2.21Z"}))};function Wo(){return Wo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wo.apply(this,arguments)}const qo=function(t){return e.createElement("svg",Wo({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M13.525 15 10 12.875 6.475 15l.933-4.008L4.3 8.3l4.1-.35L10 4.167l1.6 3.775 4.1.35-3.108 2.691.933 4.017ZM10 1.667c-4.608 0-8.333 3.75-8.333 8.333A8.333 8.333 0 1 0 10 1.667Z"}))};function Jo(){return Jo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jo.apply(this,arguments)}const Xo=function(t){return e.createElement("svg",Jo({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m12.462 7.202 5.4.458a.2.2 0 0 1 .113.35l-4.1 3.553a.2.2 0 0 0-.064.196l1.231 5.28a.2.2 0 0 1-.298.216l-4.64-2.8a.2.2 0 0 0-.207 0l-4.642 2.8a.2.2 0 0 1-.298-.216l1.224-5.28a.2.2 0 0 0-.064-.196L2.024 8.01a.2.2 0 0 1 .114-.35l5.4-.458a.2.2 0 0 0 .167-.121l2.11-4.98a.2.2 0 0 1 .37 0l2.11 4.98a.2.2 0 0 0 .167.12Z"}))};function $o(){return $o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$o.apply(this,arguments)}const es=function(t){return e.createElement("svg",$o({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10.104 12.887a.2.2 0 0 0-.207 0l-2.625 1.585a.2.2 0 0 1-.299-.216l.692-2.989a.2.2 0 0 0-.064-.196l-2.318-2.01a.2.2 0 0 1 .114-.35l3.058-.26a.2.2 0 0 0 .167-.12l1.194-2.82a.2.2 0 0 1 .368 0l1.194 2.82a.2.2 0 0 0 .167.12l3.058.26a.2.2 0 0 1 .114.35L12.4 11.07a.2.2 0 0 0-.063.196l.69 2.99a.2.2 0 0 1-.297.215l-2.625-1.585Zm7.871-4.877a.2.2 0 0 0-.114-.35l-5.4-.458a.2.2 0 0 1-.166-.121l-2.11-4.98a.2.2 0 0 0-.37 0l-2.11 4.98a.2.2 0 0 1-.167.12l-5.4.46a.2.2 0 0 0-.114.35l4.093 3.552a.2.2 0 0 1 .064.196l-1.224 5.28a.2.2 0 0 0 .298.217l4.642-2.802a.2.2 0 0 1 .206 0l4.641 2.801a.2.2 0 0 0 .298-.216l-1.231-5.28a.2.2 0 0 1 .064-.196l4.1-3.553Z"}))};function ts(){return ts=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ts.apply(this,arguments)}const ns=function(t){return e.createElement("svg",ts({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 .833 7.5 7.5.833 10 7.5 12.5l2.5 6.667 2.5-6.667 6.667-2.5L12.5 7.5 10 .833Z"}))};function rs(){return rs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rs.apply(this,arguments)}const is=function(t){return e.createElement("svg",rs({viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.468 5.384a.766.766 0 0 1-.187.239.395.395 0 0 1-.25.076c-.107 0-.23-.051-.366-.153a5.322 5.322 0 0 0-.518-.353 3.396 3.396 0 0 0-.732-.352 2.904 2.904 0 0 0-1.027-.163 2.79 2.79 0 0 0-.99.163c-.28.101-.515.244-.706.429-.19.178-.336.39-.437.639a2.14 2.14 0 0 0-.143.791c0 .369.086.674.259.916.178.241.41.448.696.62.158.095.328.183.51.264H6.67a3.74 3.74 0 0 1-.067-.15c-.172-.42-.258-.934-.258-1.545 0-.49.089-.963.267-1.42a3.6 3.6 0 0 1 .777-1.212 3.774 3.774 0 0 1 1.268-.849C9.157 3.108 9.727 3 10.37 3c.72 0 1.381.124 1.982.372a4.508 4.508 0 0 1 1.58 1.049l-.464.963ZM8.148 10H16v1.5h-1.96c.107.33.16.714.16 1.151 0 .604-.098 1.17-.294 1.698-.191.527-.47.988-.84 1.383a3.946 3.946 0 0 1-1.365.934c-.536.223-1.146.334-1.83.334-.411 0-.81-.044-1.197-.134a5.605 5.605 0 0 1-1.098-.352 5.997 5.997 0 0 1-.973-.563 5.157 5.157 0 0 1-.803-.744l.545-.973a.786.786 0 0 1 .187-.19.46.46 0 0 1 .259-.077c.125 0 .268.07.428.21.167.14.37.296.607.467.244.166.533.318.866.458.34.14.75.21 1.232.21.393 0 .744-.054 1.053-.162a2.17 2.17 0 0 0 .777-.477c.214-.21.378-.46.491-.753.113-.293.17-.617.17-.973 0-.4-.087-.728-.26-.982a2.075 2.075 0 0 0-.434-.465H4V10h4.148Z"}))};function os(){return os=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},os.apply(this,arguments)}const ss=function(t){return e.createElement("svg",os({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 426.85",fill:"currentColor",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",imageRendering:"optimizeQuality",fillRule:"evenodd",clipRule:"evenodd"},t),e.createElement("path",{fillRule:"nonzero",d:"M174.2 125.3 266.74 0h76.65L212.88 173.99l135.9 180.45H272l-97.84-131.8-97.52 131.8H0L135.88 174 5.07 0h77.04l92.09 125.3zm322.38 301.55H373.5v-24.14l2.43-6.43c5.45-6.3 60.34-69.48 60.34-69.63 2.94-3.38 5.44-6.34 7.47-8.87 2.25-2.78 4.35-5.51 6.3-8.17 1.95-2.65 3.64-5.1 5.08-7.31 1.48-2.29 2.77-4.43 3.84-6.39.98-1.81 1.89-3.66 2.69-5.53.74-1.73 1.34-3.4 1.8-4.96.4-1.38.72-2.83.95-4.32.2-1.32.31-2.63.31-3.91 0-4.79-.59-8.86-1.77-12.22-1.05-3-2.61-5.55-4.66-7.63-.9-.89-1.97-1.73-3.21-2.49v-.05c-1.25-.77-2.64-1.42-4.13-1.94-1.77-.58-3.74-1.04-5.92-1.36-2.22-.33-4.72-.49-7.5-.49-2.97 0-5.62.19-7.92.56-2.27.37-4.37.92-6.29 1.64-1.74.66-3.37 1.49-4.84 2.46h-.04c-1.37.9-2.67 2.01-3.91 3.31a29.328 29.328 0 0 0-3.45 4.53 28.145 28.145 0 0 0-2.47 5.1c-.67 1.89-1.19 3.95-1.55 6.16-.34 2.15-.52 4.62-.52 7.39v15.42h-32.44l-2.49-8.39c-1.6-5.43-2.02-10.97-1.59-16.39.46-5.81 1.93-11.59 3.94-16.98 1.5-4.03 3.43-7.92 5.78-11.67v-.04c2.31-3.68 5-7.15 8.05-10.4 3.16-3.38 6.62-6.37 10.36-8.93 3.67-2.51 7.68-4.64 12.03-6.37a67.26 67.26 0 0 1 13.17-3.73v-.05c4.52-.8 9.25-1.21 14.18-1.21 4.38 0 8.75.34 13.07 1.03 4.33.69 8.4 1.71 12.19 3.05 3.9 1.38 7.65 3.18 11.24 5.36h.05c3.51 2.13 6.78 4.63 9.79 7.46 3.1 2.9 5.85 6.14 8.22 9.69 2.4 3.58 4.36 7.37 5.88 11.34 1.46 3.86 2.58 8.02 3.33 12.45.72 4.33 1.09 8.8 1.09 13.39 0 3.11-.28 6.39-.84 9.83-.52 3.22-1.31 6.5-2.35 9.8-.94 3.08-2.21 6.28-3.74 9.55a92.644 92.644 0 0 1-5.12 9.43l-.05.09c-1.97 3.13-3.91 6.09-5.82 8.84-2.02 2.9-4.26 5.98-6.7 9.2-2.15 2.83-4.71 6.08-7.67 9.73-2.77 3.42-5.63 6.85-8.57 10.26l-30.31 35.42H512v37.51h-15.42z"}))};function as(){return as=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},as.apply(this,arguments)}const ls=function(t){return e.createElement("svg",as({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},t),e.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:2,d:"M20 12H4"}))};function cs(){return cs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cs.apply(this,arguments)}const us=function(t){return e.createElement("svg",cs({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 475.8",fill:"currentColor",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",imageRendering:"optimizeQuality",fillRule:"evenodd",clipRule:"evenodd"},t),e.createElement("path",{fillRule:"nonzero",d:"m174.2 246.66 92.54-125.3h76.65L212.88 295.35l135.9 180.45H272L174.16 344 76.63 475.8H0l135.89-180.43L5.07 121.36h77.04l92.09 125.3zm322.38-33.24H373.5v-24.13l2.42-6.43c5.46-6.29 60.35-69.48 60.35-69.63 2.94-3.38 5.44-6.34 7.48-8.87 2.24-2.78 4.34-5.51 6.29-8.17 1.95-2.65 3.64-5.09 5.08-7.31 1.49-2.29 2.77-4.43 3.84-6.39a63.99 63.99 0 0 0 2.69-5.53c.74-1.74 1.34-3.39 1.8-4.96.41-1.38.73-2.83.95-4.32.2-1.32.31-2.63.31-3.91 0-4.79-.59-8.86-1.77-12.22-1.05-3-2.61-5.55-4.66-7.63-.9-.89-1.97-1.73-3.2-2.49v-.05c-1.26-.77-2.64-1.42-4.14-1.94-1.76-.58-3.74-1.04-5.92-1.36-2.22-.33-4.72-.49-7.5-.49-2.98 0-5.62.19-7.92.56-2.26.37-4.37.92-6.29 1.64-1.75.66-3.37 1.49-4.84 2.46h-.04c-1.36.9-2.67 2.01-3.9 3.31-1.34 1.43-2.5 2.95-3.46 4.53a27.446 27.446 0 0 0-2.46 5.1c-.68 1.89-1.2 3.95-1.56 6.16-.34 2.15-.51 4.62-.51 7.39v15.42h-32.45l-2.48-8.39c-1.61-5.43-2.03-10.97-1.6-16.39.46-5.81 1.94-11.59 3.94-16.98 1.5-4.03 3.43-7.92 5.78-11.67v-.04c2.32-3.68 5-7.15 8.05-10.4 3.16-3.38 6.62-6.36 10.36-8.93 3.67-2.51 7.69-4.64 12.03-6.37a67.26 67.26 0 0 1 13.17-3.73v-.05C427.86.41 432.59 0 437.52 0c4.38 0 8.74.34 13.08 1.03 4.32.69 8.39 1.71 12.18 3.05 3.9 1.38 7.65 3.18 11.25 5.36h.04c3.51 2.13 6.78 4.63 9.79 7.46 3.11 2.9 5.85 6.14 8.23 9.69 2.39 3.58 4.35 7.37 5.87 11.34 1.47 3.86 2.58 8.02 3.33 12.45.72 4.33 1.09 8.8 1.09 13.39 0 3.11-.28 6.39-.84 9.83-.51 3.23-1.3 6.5-2.35 9.8-.94 3.08-2.2 6.27-3.74 9.55a92.644 92.644 0 0 1-5.12 9.43l-.05.09c-1.96 3.13-3.91 6.09-5.82 8.84-2.02 2.9-4.26 5.98-6.7 9.2-2.15 2.83-4.71 6.08-7.67 9.74-2.77 3.41-5.63 6.84-8.57 10.25l-30.3 35.42H512v37.5h-15.42z"}))};function ds(){return ds=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ds.apply(this,arguments)}const hs=function(t){return e.createElement("svg",ds({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 15a5 5 0 0 0 5-5c0-.833-.208-1.642-.583-2.333l1.216-1.217A6.61 6.61 0 0 1 16.667 10 6.666 6.666 0 0 1 10 16.667v2.5l-3.333-3.334L10 12.5V15Zm0-11.667v-2.5l3.333 3.334L10 7.5V5a5 5 0 0 0-5 5c0 .833.208 1.642.583 2.333L4.367 13.55A6.61 6.61 0 0 1 3.333 10 6.667 6.667 0 0 1 10 3.333Z"}))};function ps(){return ps=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ps.apply(this,arguments)}const fs=function(t){return e.createElement("svg",ps({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M15.833 15.833H4.167V4.167H12.5V2.5H4.167A1.66 1.66 0 0 0 2.5 4.167v11.666A1.666 1.666 0 0 0 4.167 17.5h11.666a1.666 1.666 0 0 0 1.667-1.667V9.167h-1.667v6.666ZM6.592 8.4 5.417 9.583l3.75 3.75L17.5 5l-1.175-1.183-7.158 7.158L6.592 8.4Z"}))};function gs(){return gs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gs.apply(this,arguments)}const ms=function(t){return e.createElement("svg",gs({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{clipRule:"evenodd",d:"M3.337 10.005a6.677 6.677 0 0 0 6.668 6.668 6.677 6.677 0 0 0 6.668-6.668 6.677 6.677 0 0 0-6.668-6.668 6.677 6.677 0 0 0-6.668 6.668Zm3.478-7.7a8.335 8.335 0 1 1 6.38 15.4 8.335 8.335 0 0 1-6.38-15.4ZM9.235 5.3h1.53l3.536 8.4h-1.267a.644.644 0 0 1-.389-.117.64.64 0 0 1-.22-.288l-.697-1.729H8.272l-.697 1.73a.673.673 0 0 1-.214.277l-.005.004a.64.64 0 0 1-.39.123H5.698l3.535-8.4Zm.764 1.981a4.697 4.697 0 0 1-.081.22L8.78 10.32h2.445l-1.142-2.826a4.692 4.692 0 0 1-.084-.212Z"}))};function ys(){return ys=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ys.apply(this,arguments)}const vs=function(t){return e.createElement("svg",ys({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"m12.473 11.784-2.038-5.43c-.146-.37-.293-.839-.44-1.404-.07.28-.143.54-.22.78-.07.24-.14.455-.21.643l-2.028 5.411h4.936ZM16.5 17h-1.569a.686.686 0 0 1-.44-.137.766.766 0 0 1-.248-.35l-1.215-3.247H6.972l-1.214 3.246a.822.822 0 0 1-.25.342.68.68 0 0 1-.44.146H3.5L8.972 3h2.056L16.5 17Z"}))};function As(){return As=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},As.apply(this,arguments)}const bs=function(t){return e.createElement("svg",As({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M3.333 4.167h13.334v1.666H3.333V4.167Zm0 3.333h13.334v1.667H3.333V7.5Zm0 3.333h13.334V12.5H3.333v-1.667Zm0 3.334h8.334v1.666H3.333v-1.666Z"}))};function ws(){return ws=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ws.apply(this,arguments)}const Ss=function(t){return e.createElement("svg",ws({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M14.583 10a1.25 1.25 0 1 1 0-2.5 1.25 1.25 0 0 1 0 2.5Zm-2.5-3.333a1.25 1.25 0 1 1 0-2.5 1.25 1.25 0 0 1 0 2.5Zm-4.166 0a1.25 1.25 0 1 1 0-2.5 1.25 1.25 0 0 1 0 2.5ZM5.417 10a1.25 1.25 0 1 1 0-2.5 1.25 1.25 0 0 1 0 2.5ZM10 2.5a7.5 7.5 0 0 0 0 15 1.25 1.25 0 0 0 1.25-1.25c0-.325-.125-.617-.325-.833a1.25 1.25 0 0 1 .933-2.083h1.475A4.167 4.167 0 0 0 17.5 9.166C17.5 5.483 14.142 2.5 10 2.5Z"}))};function Cs(){return Cs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Cs.apply(this,arguments)}const Es=function(t){return e.createElement("svg",Cs({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 18a7.999 7.999 0 1 1 0-16c4.4 0 8 3.2 8 7.2a4.8 4.8 0 0 1-4.8 4.8h-1.44c-.24 0-.4.16-.4.4 0 .08.08.16.08.24.32.4.48.88.48 1.36.08 1.12-.8 2-1.92 2Zm0-14.4a6.4 6.4 0 1 0 0 12.8c.24 0 .4-.16.4-.4 0-.16-.08-.24-.08-.32-.32-.4-.48-.8-.48-1.28 0-1.12.88-2 2-2h1.36a3.2 3.2 0 0 0 3.2-3.2c0-3.12-2.88-5.6-6.4-5.6ZM5.6 8.4c.64 0 1.2.56 1.2 1.2 0 .64-.56 1.2-1.2 1.2-.64 0-1.2-.56-1.2-1.2 0-.64.56-1.2 1.2-1.2ZM8 5.2c.64 0 1.2.56 1.2 1.2 0 .64-.56 1.2-1.2 1.2-.64 0-1.2-.56-1.2-1.2 0-.64.56-1.2 1.2-1.2Zm4 0c.64 0 1.2.56 1.2 1.2 0 .64-.56 1.2-1.2 1.2-.64 0-1.2-.56-1.2-1.2 0-.64.56-1.2 1.2-1.2Zm2.4 3.2c.64 0 1.2.56 1.2 1.2 0 .64-.56 1.2-1.2 1.2-.64 0-1.2-.56-1.2-1.2 0-.64.56-1.2 1.2-1.2Z"}))};function Is(){return Is=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Is.apply(this,arguments)}const _s=function(t){return e.createElement("svg",Is({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 2a8 8 0 1 1 0 16 8 8 0 0 1 0-16Zm0 1.6a6.4 6.4 0 1 0 0 12.8 6.4 6.4 0 0 0 0-12.8Zm3.92 2.48c1.04.96 1.68 2.4 1.68 3.92s-.72 2.88-1.68 3.92-2.4 1.68-3.92 1.68-2.88-.64-3.92-1.68L10 10V4.4c1.52 0 2.96.64 3.92 1.68Z"}))};function xs(){return xs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xs.apply(this,arguments)}const Ps=function(t){return e.createElement("svg",xs({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M7.5 2.5v.833H3.333V5h.834v10.833A1.666 1.666 0 0 0 5.833 17.5h8.334a1.667 1.667 0 0 0 1.666-1.667V5h.834V3.333H12.5V2.5h-5Zm0 4.167h1.667v7.5H7.5v-7.5Zm3.333 0H12.5v7.5h-1.667v-7.5Z"}))};function ks(){return ks=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ks.apply(this,arguments)}const Bs=function(t){return e.createElement("svg",ks({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M7.5 2.5v.833H3.333V5h.834v10.833A1.666 1.666 0 0 0 5.833 17.5h8.334a1.667 1.667 0 0 0 1.666-1.667V5h.834V3.333H12.5V2.5h-5ZM5.833 5h8.334v10.833H5.833V5ZM7.5 6.667v7.5h1.667v-7.5H7.5Zm3.333 0v7.5H12.5v-7.5h-1.667Z"}))};function Os(){return Os=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Os.apply(this,arguments)}const Ns=function(t){return e.createElement("svg",Os({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M12.5 13.333h3.333V15H12.5v-1.667Zm0-6.666h5.833v1.666H12.5V6.667Zm0 3.333h5v1.667h-5V10Zm-10 5a1.667 1.667 0 0 0 1.667 1.667h5A1.667 1.667 0 0 0 10.833 15V6.667H2.5V15Zm9.167-10.833h-2.5l-.834-.834H5l-.833.834h-2.5v1.666h10V4.167Z"}))};function Ds(){return Ds=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ds.apply(this,arguments)}const js=function(t){return e.createElement("svg",Ds({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M12.5 13.333h3.333V15H12.5v-1.667Zm0-6.666h5.833v1.666H12.5V6.667Zm0 3.333h5v1.667h-5V10ZM9.167 8.333V15h-5V8.333h5Zm1.666-1.666H2.5V15a1.667 1.667 0 0 0 1.667 1.667h5A1.667 1.667 0 0 0 10.833 15V6.667Zm.834-2.5h-2.5l-.834-.834H5l-.833.834h-2.5v1.666h10V4.167Z"}))};function Ts(){return Ts=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ts.apply(this,arguments)}const Ms=function(t){return e.createElement("svg",Ts({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M2.5 14.167v1.666h5v-1.666h-5Zm0-10v1.666h8.333V4.167H2.5ZM10.833 17.5v-1.667H17.5v-1.666h-6.667V12.5H9.167v5h1.666Zm-5-10v1.667H2.5v1.666h3.333V12.5H7.5v-5H5.833ZM17.5 10.833V9.167H9.167v1.666H17.5Zm-5-3.333h1.667V5.833H17.5V4.167h-3.333V2.5H12.5v5Z"}))};function Fs(){return Fs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fs.apply(this,arguments)}const Rs=function(t){return e.createElement("svg",Fs({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{clipRule:"evenodd",d:"M12.333 12.333h3.111V4.556H4.556v7.777h3.11a2.333 2.333 0 1 0 4.667 0ZM4.556 3h10.888A1.556 1.556 0 0 1 17 4.556v10.888A1.556 1.556 0 0 1 15.444 17H4.556A1.556 1.556 0 0 1 3 15.444V4.556C3 3.7 3.692 3 4.556 3Zm3.888 5.917H6.89L10 5.806l3.111 3.11h-1.556v2.334h-3.11V8.917Z"}))};function Ls(){return Ls=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ls.apply(this,arguments)}const Qs=function(t){return e.createElement("svg",Ls({viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.332 12.708c-.392.16-.836.24-1.332.24-.496 0-.94-.08-1.332-.24a2.805 2.805 0 0 1-.995-.67 2.994 2.994 0 0 1-.623-1.04 4.062 4.062 0 0 1-.207-1.33V2.5H5v7.177c0 .694.115 1.335.346 1.924.23.59.562 1.099.995 1.528.432.43.957.765 1.574 1.008.617.242 1.312.363 2.085.363.773 0 1.468-.121 2.085-.363a4.575 4.575 0 0 0 1.574-1.008c.433-.43.764-.939.995-1.528.23-.589.346-1.23.346-1.924V2.5h-1.834v7.177c0 .484-.072.928-.216 1.33-.144.396-.352.74-.623 1.032-.271.286-.603.51-.995.669ZM15 16H5v1.5h10V16Z"}))};function Us(){return Us=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Us.apply(this,arguments)}const Vs=function(t){return e.createElement("svg",Us({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10.181 7.667A7.3 7.3 0 0 0 5.462 9.4L3 7v6h6.155L6.68 10.587a5.523 5.523 0 0 1 3.501-1.254c2.421 0 4.48 1.54 5.198 3.667L17 12.48c-.95-2.793-3.639-4.813-6.819-4.813Z"}))};function Ks(){return Ks=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ks.apply(this,arguments)}const Hs=function(t){return e.createElement("svg",Ks({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{clipRule:"evenodd",d:"M7 9.69 1.667 4.357l1.178-1.179L16.987 17.32 15.81 18.5l-5.209-5.21V17.5H9.4V13H4.5v-1.5L7 10v-.31Zm1.81 1.81H6.6l1.5-.71.71.71ZM11.5 4v5.476L15.024 13h.476v-1.5L13 10V4h.75V2.5h-7.5V4H7v.976l1.5 1.5V4h3Z"}))};function Gs(){return Gs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gs.apply(this,arguments)}const Ys=function(t){return e.createElement("svg",Gs({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M7 8.5v6h6v-6h4l-7-7-7 7h4Zm3-4.2 2.2 2.2H11v6H9v-6H7.8L10 4.3Zm7 12.2H3v2h14v-2Z"}))};function zs(){return zs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zs.apply(this,arguments)}const Zs=function(t){return e.createElement("svg",zs({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M12.5 3.333a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667Zm0 1.584a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5Zm-9.167.916v2.5h-2.5V10h2.5v2.5H5V10h2.5V8.333H5v-2.5H3.333Zm9.167 5c-2.225 0-6.667 1.109-6.667 3.334v2.5h13.334v-2.5c0-2.225-4.442-3.334-6.667-3.334Zm0 1.584c2.475 0 5.083 1.216 5.083 1.75v.916H7.417v-.916c0-.534 2.583-1.75 5.083-1.75Z"}))};function Ws(){return Ws=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ws.apply(this,arguments)}const qs=function(t){return e.createElement("svg",Ws({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 3a3.5 3.5 0 1 1 0 7 3.5 3.5 0 0 1 0-7Zm0 7.875c2.336 0 7 1.164 7 3.5V17H3v-2.625c0-2.336 4.664-3.5 7-3.5Z"}))};function Js(){return Js=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Js.apply(this,arguments)}const Xs=function(t){return e.createElement("svg",Js({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10 3a3.5 3.5 0 1 1 0 7 3.5 3.5 0 0 1 0-7Zm0 1.75a1.75 1.75 0 1 0 0 3.5 1.75 1.75 0 0 0 0-3.5Zm0 6.125c2.336 0 7 1.164 7 3.5V17H3v-2.625c0-2.336 4.664-3.5 7-3.5Zm0 1.662c-2.599 0-5.338 1.278-5.338 1.838v.963h10.675v-.963c0-.56-2.738-1.838-5.337-1.838Z"}))};function $s(){return $s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$s.apply(this,arguments)}const ea=function(t){return e.createElement("svg",$s({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M15.833 17.5v-1.667H12.5v-1.666h3.333V12.5l2.5 2.5-2.5 2.5Zm-5-2.5c0 .592.125 1.158.35 1.667H1.667v-2.5c0-1.842 2.983-3.334 6.666-3.334.834 0 1.634.075 2.375.217a9.637 9.637 0 0 1 1.884.55 4.164 4.164 0 0 0-1.759 3.4Zm-7.5-.833V15h5.834c0-.867.191-1.692.533-2.433L8.333 12.5c-2.758 0-5 .75-5 1.667Zm5-10.834a3.333 3.333 0 1 1 0 6.667 3.333 3.333 0 0 1 0-6.667Zm0 1.667a1.667 1.667 0 1 0 0 3.333 1.667 1.667 0 0 0 0-3.333Z"}))};function ta(){return ta=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ta.apply(this,arguments)}const na=function(t){return e.createElement("svg",ta({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M2.5 4.167v11.666h15.833V4.167H2.5Zm1.667 1.666h12.5v3.334h-12.5V5.833Zm0 8.334v-3.334H7.5v3.334H4.167Zm5 0v-3.334h7.5v3.334h-7.5Z"}))};function ra(){return ra=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ra.apply(this,arguments)}const ia=function(t){return e.createElement("svg",ra({viewBox:"0 0 20 20",fill:"#fff",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M10.833 10.834H9.167v-5h1.666v5Zm0 3.333H9.167V12.5h1.666v1.667ZM10 1.667a8.333 8.333 0 1 0 0 16.667 8.333 8.333 0 0 0 0-16.667Z",fill:"currentColor"}))};function oa(){return oa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oa.apply(this,arguments)}const sa=function(t){return e.createElement("svg",oa({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M3.333 3.333h13.334v13.334H3.333V3.333ZM5 6.667V15h10V6.667H5Z"}))};function aa(){return aa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},aa.apply(this,arguments)}const la=function(t){return e.createElement("svg",aa({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},t),e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M0 4.13v1.428a.5.5 0 0 0 .725.446l.886-.446.377-.19L2 5.362l1.404-.708.07-.036.662-.333.603-.304a.5.5 0 0 0 0-.893l-.603-.305-.662-.333-.07-.036L2 1.706l-.012-.005-.377-.19-.886-.447A.5.5 0 0 0 0 1.51v2.62ZM7.25 2a.75.75 0 0 0 0 1.5h7a.25.25 0 0 1 .25.25v8.5a.25.25 0 0 1-.25.25h-9.5a.25.25 0 0 1-.25-.25V6.754a.75.75 0 0 0-1.5 0v5.496c0 .966.784 1.75 1.75 1.75h9.5A1.75 1.75 0 0 0 16 12.25v-8.5A1.75 1.75 0 0 0 14.25 2h-7Zm-.5 4a.75.75 0 0 0 0 1.5h5.5a.75.75 0 0 0 0-1.5h-5.5ZM6 9.25a.75.75 0 0 1 .75-.75h3.5a.75.75 0 0 1 0 1.5h-3.5A.75.75 0 0 1 6 9.25Z",clipRule:"evenodd"}))};function ca(){return ca=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ca.apply(this,arguments)}const ua=function(t){return e.createElement("svg",ca({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},t),e.createElement("path",{fill:"currentColor",d:"M3 17v-2h14v2H3Zm0-4v-2h14v2H3Zm0-4V7h14v2H3Zm17 8q-.425 0-.713-.288T19 16q0-.425.288-.713T20 15q.425 0 .713.288T21 16q0 .425-.288.713T20 17Zm0-4q-.425 0-.713-.288T19 12q0-.425.288-.713T20 11q.425 0 .713.288T21 12q0 .425-.288.713T20 13Zm0-4q-.425 0-.713-.288T19 8q0-.425.288-.713T20 7q.425 0 .713.288T21 8q0 .425-.288.713T20 9Z"}))};function da(){return da=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},da.apply(this,arguments)}const ha=function(t){return e.createElement("svg",da({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-check-square"},t),e.createElement("path",{d:"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"}),e.createElement("path",{d:"M10.97 4.97a.75.75 0 0 1 1.071 1.05l-3.992 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425a.235.235 0 0 1 .02-.022z"}))};function pa(){return pa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pa.apply(this,arguments)}const fa=function(t){return e.createElement("svg",pa({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-code"},t),e.createElement("path",{d:"M5.854 4.854a.5.5 0 1 0-.708-.708l-3.5 3.5a.5.5 0 0 0 0 .708l3.5 3.5a.5.5 0 0 0 .708-.708L2.707 8l3.147-3.146zm4.292 0a.5.5 0 0 1 .708-.708l3.5 3.5a.5.5 0 0 1 0 .708l-3.5 3.5a.5.5 0 0 1-.708-.708L13.293 8l-3.147-3.146z"}))};function ga(){return ga=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ga.apply(this,arguments)}const ma=function(t){return e.createElement("svg",ga({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-file-break"},t),e.createElement("path",{d:"M0 10.5a.5.5 0 0 1 .5-.5h15a.5.5 0 0 1 0 1H.5a.5.5 0 0 1-.5-.5zM12 0H4a2 2 0 0 0-2 2v7h1V2a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v7h1V2a2 2 0 0 0-2-2zm2 12h-1v2a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-2H2v2a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-2z"}))};function ya(){return ya=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ya.apply(this,arguments)}const va=function(t){return e.createElement("svg",ya({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-link"},t),e.createElement("path",{d:"M6.354 5.5H4a3 3 0 0 0 0 6h3a3 3 0 0 0 2.83-4H9c-.086 0-.17.01-.25.031A2 2 0 0 1 7 10.5H4a2 2 0 1 1 0-4h1.535c.218-.376.495-.714.82-1z"}),e.createElement("path",{d:"M9 5.5a3 3 0 0 0-2.83 4h1.098A2 2 0 0 1 9 6.5h3a2 2 0 1 1 0 4h-1.535a4.02 4.02 0 0 1-.82 1H12a3 3 0 1 0 0-6H9z"}))};function Aa(){return Aa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Aa.apply(this,arguments)}const ba=function(t){return e.createElement("svg",Aa({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-list-ol"},t),e.createElement("path",{fillRule:"evenodd",d:"M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5z"}),e.createElement("path",{d:"M1.713 11.865v-.474H2c.217 0 .363-.137.363-.317 0-.185-.158-.31-.361-.31-.223 0-.367.152-.373.31h-.59c.016-.467.373-.787.986-.787.588-.002.954.291.957.703a.595.595 0 0 1-.492.594v.033a.615.615 0 0 1 .569.631c.003.533-.502.8-1.051.8-.656 0-1-.37-1.008-.794h.582c.008.178.186.306.422.309.254 0 .424-.145.422-.35-.002-.195-.155-.348-.414-.348h-.3zm-.004-4.699h-.604v-.035c0-.408.295-.844.958-.844.583 0 .96.326.96.756 0 .389-.257.617-.476.848l-.537.572v.03h1.054V9H1.143v-.395l.957-.99c.138-.142.293-.304.293-.508 0-.18-.147-.32-.342-.32a.33.33 0 0 0-.342.338v.041zM2.564 5h-.635V2.924h-.031l-.598.42v-.567l.629-.443h.635V5z"}))};function wa(){return wa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wa.apply(this,arguments)}const Sa=function(t){return e.createElement("svg",wa({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-list-ul"},t),e.createElement("path",{fillRule:"evenodd",d:"M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm-3 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm0 4a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm0 4a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"}))};function Ca(){return Ca=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ca.apply(this,arguments)}const Ea=function(t){return e.createElement("svg",Ca({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},t),e.createElement("path",{fill:"currentColor",d:"M9 22c-.6 0-1-.4-1-1v-3H4c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2h-6.1l-3.7 3.7c-.2.2-.4.3-.7.3H9m1-6v3.1l3.1-3.1H20V4H4v12h6m6.3-10-1.4 3H17v4h-4V8.8L14.3 6h2m-6 0L8.9 9H11v4H7V8.8L8.3 6h2Z"}))};function Ia(){return Ia=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ia.apply(this,arguments)}const _a=function(t){return e.createElement("svg",Ia({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},t),e.createElement("path",{fill:"currentColor",d:"M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2zm15 2h-4v3h4V4zm0 4h-4v3h4V8zm0 4h-4v3h3a1 1 0 0 0 1-1v-2zm-5 3v-3H6v3h4zm-5 0v-3H1v2a1 1 0 0 0 1 1h3zm-4-4h4V8H1v3zm0-4h4V4H1v3zm5-3v3h4V4H6zm4 4H6v3h4V8z"}))};function xa(){return xa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xa.apply(this,arguments)}const Pa=function(t){return e.createElement("svg",xa({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-text-center"},t),e.createElement("path",{fillRule:"evenodd",d:"M4 12.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"}))};function ka(){return ka=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ka.apply(this,arguments)}const Ba=function(t){return e.createElement("svg",ka({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-justify"},t),e.createElement("path",{fillRule:"evenodd",d:"M2 12.5a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"}))};function Oa(){return Oa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Oa.apply(this,arguments)}const Na=function(t){return e.createElement("svg",Oa({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-text-left"},t),e.createElement("path",{fillRule:"evenodd",d:"M2 12.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"}))};function Da(){return Da=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Da.apply(this,arguments)}const ja=function(t){return e.createElement("svg",Da({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-text-paragraph"},t),e.createElement("path",{fillRule:"evenodd",d:"M2 12.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm4-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5z"}))};function Ta(){return Ta=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ta.apply(this,arguments)}const Ma=function(t){return e.createElement("svg",Ta({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-text-right"},t),e.createElement("path",{fillRule:"evenodd",d:"M6 12.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-4-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm4-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-4-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"}))};function Fa(){return Fa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fa.apply(this,arguments)}const Ra=function(t){return e.createElement("svg",Fa({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},t),e.createElement("path",{fill:"currentColor",d:"M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23Z"}))};function La(){return La=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},La.apply(this,arguments)}const Qa=function(t){return e.createElement("svg",La({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},t),e.createElement("path",{fill:"currentColor",d:"m10 15 5.19-3L10 9v6m11.56-7.83c.13.47.22 1.1.28 1.9.07.8.1 1.49.1 2.09L22 12c0 2.19-.16 3.8-.44 4.83-.25.9-.83 1.48-1.73 1.73-.47.13-1.33.22-2.65.28-1.3.07-2.49.1-3.59.1L12 19c-4.19 0-6.8-.16-7.83-.44-.9-.25-1.48-.83-1.73-1.73-.13-.47-.22-1.1-.28-1.9-.07-.8-.1-1.49-.1-2.09L2 12c0-2.19.16-3.8.44-4.83.25-.9.83-1.48 1.73-1.73.47-.13 1.33-.22 2.65-.28 1.3-.07 2.49-.1 3.59-.1L12 5c4.19 0 6.8.16 7.83.44.9.25 1.48.83 1.73 1.73Z"}))};function Ua(){return Ua=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ua.apply(this,arguments)}const Va=function(t){return e.createElement("svg",Ua({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-type-bold"},t),e.createElement("path",{d:"M8.21 13c2.106 0 3.412-1.087 3.412-2.823 0-1.306-.984-2.283-2.324-2.386v-.055a2.176 2.176 0 0 0 1.852-2.14c0-1.51-1.162-2.46-3.014-2.46H3.843V13H8.21zM5.908 4.674h1.696c.963 0 1.517.451 1.517 1.244 0 .834-.629 1.32-1.73 1.32H5.908V4.673zm0 6.788V8.598h1.73c1.217 0 1.88.492 1.88 1.415 0 .943-.643 1.449-1.832 1.449H5.907z"}))};function Ka(){return Ka=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ka.apply(this,arguments)}const Ha=function(t){return e.createElement("svg",Ka({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},t),e.createElement("path",{fill:"currentColor",d:"M8.637 13V3.669H7.379V7.62H2.758V3.67H1.5V13h1.258V8.728h4.62V13h1.259zm5.329 0V3.669h-1.244L10.5 5.316v1.265l2.16-1.565h.062V13h1.244z"}))};function Ga(){return Ga=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ga.apply(this,arguments)}const Ya=function(t){return e.createElement("svg",Ga({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},t),e.createElement("path",{fill:"currentColor",d:"M7.638 13V3.669H6.38V7.62H1.759V3.67H.5V13h1.258V8.728h4.62V13h1.259zm3.022-6.733v-.048c0-.889.63-1.668 1.716-1.668.957 0 1.675.608 1.675 1.572 0 .855-.554 1.504-1.067 2.085l-3.513 3.999V13H15.5v-1.094h-4.245v-.075l2.481-2.844c.875-.998 1.586-1.784 1.586-2.953 0-1.463-1.155-2.556-2.919-2.556-1.941 0-2.966 1.326-2.966 2.74v.049h1.223z"}))};function za(){return za=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},za.apply(this,arguments)}const Za=function(t){return e.createElement("svg",za({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},t),e.createElement("path",{fill:"currentColor",d:"M7.637 13V3.669H6.379V7.62H1.758V3.67H.5V13h1.258V8.728h4.62V13h1.259zm3.625-4.272h1.018c1.142 0 1.935.67 1.949 1.674.013 1.005-.78 1.737-2.01 1.73-1.08-.007-1.853-.588-1.935-1.32H9.108c.069 1.327 1.224 2.386 3.083 2.386 1.935 0 3.343-1.155 3.309-2.789-.027-1.51-1.251-2.16-2.037-2.249v-.068c.704-.123 1.764-.91 1.723-2.229-.035-1.353-1.176-2.4-2.954-2.385-1.873.006-2.857 1.162-2.898 2.358h1.196c.062-.69.711-1.299 1.696-1.299.998 0 1.695.622 1.695 1.525.007.922-.718 1.592-1.695 1.592h-.964v1.074z"}))};function Wa(){return Wa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wa.apply(this,arguments)}const qa=function(t){return e.createElement("svg",Wa({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-type-h1"},t),e.createElement("path",{d:"M7.637 13V3.669H6.379V7.62H1.758V3.67H.5V13h1.258V8.728h4.62V13Zm5.337.2v-2.328H9.108V9.828l3.441-6.35h1.632v6.141H15.5v1.253h-1.319V13.2Zm-2.615-3.581h2.615V6.7L13 4.689l-.872 1.7z"}))};function Ja(){return Ja=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ja.apply(this,arguments)}const Xa=function(t){return e.createElement("svg",Ja({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-type-h1"},t),e.createElement("path",{d:"M7.637 13V3.669H6.379V7.62H1.758V3.67H.5V13h1.258V8.728h4.62V13Zm2.755-5.791a3.763 3.763 0 0 1 2.113-.517 2.973 2.973 0 0 1 2.995 3.1 3.45 3.45 0 0 1-.9 2.442 3.111 3.111 0 0 1-2.393.968 3.327 3.327 0 0 1-2.094-.671 2.758 2.758 0 0 1-1.007-2h1.284a1.387 1.387 0 0 0 .511 1.1 2.384 2.384 0 0 0 1.4.421 1.819 1.819 0 0 0 1.479-.638 2.042 2.042 0 0 0 .437-1.514 2.17 2.17 0 0 0-.567-1.584 1.958 1.958 0 0 0-1.468-.58 2.358 2.358 0 0 0-1.79.789H9.108V3.478h5.931v1.134h-4.647Z"}))};function $a(){return $a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$a.apply(this,arguments)}const el=function(t){return e.createElement("svg",$a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-type-h1"},t),e.createElement("path",{d:"M7.637 13V3.669H6.379V7.62H1.758V3.67H.5V13h1.258V8.728h4.62V13Zm5.039-6.13a2.823 2.823 0 0 1 1.419.364 2.69 2.69 0 0 1 1.022 1.05 3.327 3.327 0 0 1 .383 1.642 3.594 3.594 0 0 1-.39 1.7 2.878 2.878 0 0 1-1.1 1.158 3.165 3.165 0 0 1-1.635.416 2.812 2.812 0 0 1-1.734-.545A3.49 3.49 0 0 1 9.51 11.1a6.515 6.515 0 0 1-.4-2.411A7.726 7.726 0 0 1 9.542 6a4.289 4.289 0 0 1 1.233-1.851 2.831 2.831 0 0 1 1.889-.673A2.7 2.7 0 0 1 13.8 3.7a2.463 2.463 0 0 1 .812.586 2.886 2.886 0 0 1 .514.8 2.768 2.768 0 0 1 .223.861H14a1.488 1.488 0 0 0-.453-.923 1.346 1.346 0 0 0-.935-.329 1.509 1.509 0 0 0-1.072.425 2.839 2.839 0 0 0-.71 1.18 6.808 6.808 0 0 0-.323 1.771 2.639 2.639 0 0 1 .918-.889 2.48 2.48 0 0 1 1.251-.312Zm-.285 5.117a1.617 1.617 0 0 0 .91-.256 1.752 1.752 0 0 0 .614-.713 2.336 2.336 0 0 0 .223-1.037 2.211 2.211 0 0 0-.217-1.01 1.6 1.6 0 0 0-.6-.666 1.671 1.671 0 0 0-.892-.236 1.833 1.833 0 0 0-1.164.377 2.4 2.4 0 0 0-.743 1.009 3.749 3.749 0 0 0 .6 1.845 1.5 1.5 0 0 0 1.269.687Z"}))};function tl(){return tl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tl.apply(this,arguments)}const nl=function(t){return e.createElement("svg",tl({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-type-italic"},t),e.createElement("path",{d:"M7.991 11.674 9.53 4.455c.123-.595.246-.71 1.347-.807l.11-.52H7.211l-.11.52c1.06.096 1.128.212 1.005.807L6.57 11.674c-.123.595-.246.71-1.346.806l-.11.52h3.774l.11-.52c-1.06-.095-1.129-.211-1.006-.806z"}))};function rl(){return rl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rl.apply(this,arguments)}const il=function(t){return e.createElement("svg",rl({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-type-strikethrough"},t),e.createElement("path",{d:"M6.333 5.686c0 .31.083.581.27.814H5.166a2.776 2.776 0 0 1-.099-.76c0-1.627 1.436-2.768 3.48-2.768 1.969 0 3.39 1.175 3.445 2.85h-1.23c-.11-1.08-.964-1.743-2.25-1.743-1.23 0-2.18.602-2.18 1.607zm2.194 7.478c-2.153 0-3.589-1.107-3.705-2.81h1.23c.144 1.06 1.129 1.703 2.544 1.703 1.34 0 2.31-.705 2.31-1.675 0-.827-.547-1.374-1.914-1.675L8.046 8.5H1v-1h14v1h-3.504c.468.437.675.994.675 1.697 0 1.826-1.436 2.967-3.644 2.967z"}))};function ol(){return ol=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ol.apply(this,arguments)}const sl=function(t){return e.createElement("svg",ol({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M11.354 14.5v-.665l1.553-1.438c.132-.128.243-.243.332-.345.091-.102.16-.203.207-.3.047-.1.07-.207.07-.322a.574.574 0 0 0-.326-.546.748.748 0 0 0-.343-.077.721.721 0 0 0-.35.082.557.557 0 0 0-.23.232.753.753 0 0 0-.08.36h-.876c0-.286.065-.534.194-.744a1.3 1.3 0 0 1 .543-.488 1.8 1.8 0 0 1 .806-.172c.312 0 .584.055.816.166.233.11.414.261.543.456.13.194.194.418.194.669 0 .165-.033.327-.098.488-.064.16-.178.339-.343.535a7.918 7.918 0 0 1-.697.7l-.637.625v.03h1.832v.754h-3.11ZM5.04 4.273l1.92 3.196h.068l1.93-3.196h1.803L8.073 8.636 10.805 13H8.972L7.03 9.825h-.068L5.018 13H3.194l2.757-4.364-2.723-4.363H5.04Z",fill:"currentColor"}))};function al(){return al=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},al.apply(this,arguments)}const ll=function(t){return e.createElement("svg",al({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M11.354 6v-.665l1.553-1.438c.132-.128.243-.243.332-.345a1.31 1.31 0 0 0 .207-.3c.047-.1.07-.207.07-.322a.574.574 0 0 0-.326-.545.748.748 0 0 0-.343-.077.721.721 0 0 0-.35.08.557.557 0 0 0-.23.233.753.753 0 0 0-.08.36h-.876c0-.286.065-.534.194-.744a1.3 1.3 0 0 1 .543-.488 1.8 1.8 0 0 1 .806-.172c.312 0 .584.055.816.166.233.11.414.261.543.456.13.194.194.417.194.669 0 .165-.033.327-.098.488-.064.16-.178.339-.343.535a7.92 7.92 0 0 1-.697.7l-.637.625v.03h1.832V6h-3.11ZM5.04 4.273l1.92 3.196h.068l1.93-3.196h1.803L8.073 8.636 10.805 13H8.972L7.03 9.825h-.068L5.018 13H3.194l2.757-4.364-2.723-4.363H5.04Z",fill:"currentColor"}))};function cl(){return cl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cl.apply(this,arguments)}const ul=function(t){return e.createElement("svg",cl({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-type-underline"},t),e.createElement("path",{d:"M5.313 3.136h-1.23V9.54c0 2.105 1.47 3.623 3.917 3.623s3.917-1.518 3.917-3.623V3.136h-1.23v6.323c0 1.49-.978 2.57-2.687 2.57-1.709 0-2.687-1.08-2.687-2.57V3.136zM12.5 15h-9v-1h9v1z"}))};function dl(){return dl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dl.apply(this,arguments)}const hl=function(t){return e.createElement("svg",dl({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"bi bi-pencil-fill"},t),e.createElement("path",{d:"M12.854.146a.5.5 0 0 0-.707 0L10.5 1.793 14.207 5.5l1.647-1.646a.5.5 0 0 0 0-.708l-3-3zm.646 6.061L9.793 2.5 3.293 9H3.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.207l6.5-6.5zm-7.468 7.468A.5.5 0 0 1 6 13.5V13h-.5a.5.5 0 0 1-.5-.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.5-.5V10h-.5a.499.499 0 0 1-.175-.032l-.179.178a.5.5 0 0 0-.11.168l-2 5a.5.5 0 0 0 .65.65l5-2a.5.5 0 0 0 .168-.11l.178-.178z"}))};function pl(){return pl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pl.apply(this,arguments)}const fl=function(t){return e.createElement("svg",pl({xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",viewBox:"0 0 24 24",fill:"currentColor"},t),e.createElement("path",{stroke:"currentColor",d:"M8.5 10a2 2 0 1 0 2 2 2 2 0 0 0-2-2Zm0 7a2 2 0 1 0 2 2 2 2 0 0 0-2-2Zm7-10a2 2 0 1 0-2-2 2 2 0 0 0 2 2Zm-7-4a2 2 0 1 0 2 2 2 2 0 0 0-2-2Zm7 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2Zm0-7a2 2 0 1 0 2 2 2 2 0 0 0-2-2Z"}))}})(),r})(),e.exports=t()},56974:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},15866:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},35376:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},76317:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentViewerEvent=void 0,function(e){e.FeatureStatusUpdated="FeatureStatusUpdated"}(n||(t.ComponentViewerEvent=n={}))},88076:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},68763:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.KeyboardModifier=void 0,function(e){e.Shift="Shift",e.Ctrl="Control",e.Meta="Meta"}(n||(t.KeyboardModifier=n={}))},75895:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},74601:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3668:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},42405:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FillItemContentSpecialized=t.FillItemContent=void 0;const r=n(71458),i=n(68716);function o(e){return e.references||(e.references=[]),e.appData||(e.appData={[r.DefaultAppDomain]:{}}),e.appData[r.DefaultAppDomain]||(e.appData[r.DefaultAppDomain]={}),e.appData[r.DefaultAppDomain][i.AppDataField.UserModifiedDate]||(e.appData[r.DefaultAppDomain][i.AppDataField.UserModifiedDate]=(new Date).toString()),e}t.FillItemContent=o,t.FillItemContentSpecialized=function(e){return o(e)}},95698:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},55930:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},36186:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},80537:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createComponentCreatedContextPayload=void 0,t.createComponentCreatedContextPayload=function(e){return{content_type:e.content_type,content:e.content,created_at:e.created_at,deleted:!1,uuid:e.uuid}}},1482:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreateComponentRetrievedContextPayload=void 0,t.CreateComponentRetrievedContextPayload=function(e){return{content_type:e.content_type,content:e.content,created_at:e.created_at,deleted:!1,uuid:e.uuid}}},69087:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},70359:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkRemotePayloadAllowed=t.FilterDisallowedRemotePayloadsAndMap=void 0;const r=n(78381);function i(e){return(0,r.isCorruptTransferPayload)(e)?{disallowed:e}:(0,r.isEncryptedTransferPayload)(e)||null==e.content?{allowed:e}:{disallowed:e}}t.FilterDisallowedRemotePayloadsAndMap=function(e){const t=[],n=[];for(const o of e){const e=i(o);void 0===e.allowed?n.push(o):t.push((r=e.allowed,Object.assign(Object.assign({},r),{__passed_filter__:!0})))}var r;return{filtered:t,disallowed:n}},t.checkRemotePayloadAllowed=i},13214:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreateDecryptedBackupFileContextPayload=t.CreateEncryptedBackupFileContextPayload=void 0,t.CreateEncryptedBackupFileContextPayload=function(e){return{auth_hash:e.auth_hash,content_type:e.content_type,content:e.content,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!1,duplicate_of:e.duplicate_of,enc_item_key:e.enc_item_key,items_key_id:e.items_key_id,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid}},t.CreateDecryptedBackupFileContextPayload=function(e){return{content_type:e.content_type,content:e.content,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!1,duplicate_of:e.duplicate_of,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid}}},84034:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreateDeletedLocalStorageContextPayload=t.CreateDecryptedLocalStorageContextPayload=t.CreateEncryptedLocalStorageContextPayload=t.isEncryptedLocalStoragePayload=void 0;const r=n(87901),i=n(78381);t.isEncryptedLocalStoragePayload=function(e){return(0,i.isEncryptedTransferPayload)(e)},t.CreateEncryptedLocalStorageContextPayload=function(e){return{auth_hash:e.auth_hash,content_type:e.content_type,content:e.content,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!1,dirty:null!=e.dirty&&e.dirty,duplicate_of:e.duplicate_of,enc_item_key:e.enc_item_key,errorDecrypting:e.errorDecrypting,items_key_id:e.items_key_id,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,waitingForKey:e.waitingForKey,user_uuid:e.user_uuid,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid,last_edited_by_uuid:e.last_edited_by_uuid,signatureData:e.signatureData}},t.CreateDecryptedLocalStorageContextPayload=function(e){return{content_type:e.content_type,content:e.content,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!1,duplicate_of:e.duplicate_of,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,dirty:(0,r.useBoolean)(e.dirty,!1),user_uuid:e.user_uuid,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid,last_edited_by_uuid:e.last_edited_by_uuid,signatureData:e.signatureData}},t.CreateDeletedLocalStorageContextPayload=function(e){return{content_type:e.content_type,content:void 0,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!0,dirty:!0,duplicate_of:e.duplicate_of,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,user_uuid:e.user_uuid,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid,last_edited_by_uuid:e.last_edited_by_uuid,signatureData:e.signatureData}}},51600:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreateOfflineSyncPushContextPayload=void 0;const r=n(59180);t.CreateOfflineSyncPushContextPayload=function(e){const t={content:void 0,content_type:e.content_type,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!1,duplicate_of:e.duplicate_of,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid};return(0,r.isDecryptedPayload)(e)?Object.assign(Object.assign({},t),{content:e.content}):Object.assign(Object.assign({},t),{deleted:e.deleted})}},30429:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreateOfflineSyncSavedPayload=void 0;const r=n(59180);t.CreateOfflineSyncSavedPayload=function(e){return{content_type:e.content_type,created_at_timestamp:e.created_at_timestamp,deleted:(0,r.isDeletedPayload)(e),updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid}}},18592:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreateDeletedServerSyncPushPayload=t.CreateEncryptedServerSyncPushPayload=void 0,t.CreateEncryptedServerSyncPushPayload=function(e){return{content_type:e.content_type,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!1,duplicate_of:e.duplicate_of,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,content:e.content,enc_item_key:e.enc_item_key,items_key_id:e.items_key_id,auth_hash:e.auth_hash,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid}},t.CreateDeletedServerSyncPushPayload=function(e){return{content_type:e.content_type,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!0,duplicate_of:e.duplicate_of,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,content:void 0,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid}}},2116:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreateServerSyncSavedPayload=void 0;const r=n(87901);t.CreateServerSyncSavedPayload=function(e){return{content_type:e.content_type,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:(0,r.useBoolean)(e.deleted,!1),updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid,user_uuid:e.user_uuid,duplicate_of:e.duplicate_of,last_edited_by_uuid:e.last_edited_by_uuid}}},18973:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7563:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43740:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DecryptedItem=void 0;const r=n(87901),i=n(68716),o=n(71458),s=n(97127),a=n(41035);class l extends s.GenericItem{constructor(e){super(e),this.protected=!1,this.trashed=!1,this.pinned=!1,this.archived=!1,this.locked=!1,this.starred=!1;const t=this.getAppDomainValueWithDefault(i.AppDataField.UserModifiedDate,this.serverUpdatedAt||0);this.userModifiedDate=new Date(t),this.conflictOf=e.content.conflict_of,this.updatedAtString=(0,r.dateToLocalizedString)(this.userModifiedDate),this.protected=(0,r.useBoolean)(this.payload.content.protected,!1),this.trashed=(0,r.useBoolean)(this.payload.content.trashed,!1),this.starred=(0,r.useBoolean)(this.payload.content.starred,!1),this.pinned=this.getAppDomainValueWithDefault(i.AppDataField.Pinned,!1),this.archived=this.getAppDomainValueWithDefault(i.AppDataField.Archived,!1),this.locked=this.getAppDomainValueWithDefault(i.AppDataField.Locked,!1)}static DefaultAppDomain(){return o.DefaultAppDomain}get content(){return this.payload.content}get references(){return this.payload.content.references||[]}isReferencingItem(e){return null!=this.references.find((t=>t.uuid===e.uuid))}getDomainData(e){const t=this.payload.content.appData;if(t)return t[e]}getAppDomainValue(e){const t=this.getDomainData(o.DefaultAppDomain);return null==t?void 0:t[e]}getAppDomainValueWithDefault(e,t){const n=this.getDomainData(o.DefaultAppDomain);return(null==n?void 0:n[e])||t}payloadRepresentation(e){return this.payload.copy(e)}contentKeysToIgnoreWhenCheckingEquality(){return["conflict_of"]}appDataContentKeysToIgnoreWhenCheckingEquality(){return[i.AppDataField.UserModifiedDate]}getContentCopy(){return JSON.parse(JSON.stringify(this.content))}isItemContentEqualWith(e){return(0,a.ItemContentsEqual)(this.payload.content,e.payload.content,this.contentKeysToIgnoreWhenCheckingEquality(),this.appDataContentKeysToIgnoreWhenCheckingEquality())}}t.DecryptedItem=l},78438:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeletedItem=void 0;const r=n(97127);class i extends r.GenericItem{constructor(e){super(e),this.deleted=!0}payloadRepresentation(e){return this.payload.copy(e)}}t.DeletedItem=i},80406:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EncryptedItem=void 0;const r=n(97127);class i extends r.GenericItem{constructor(e){super(e)}get version(){return this.payload.version}payloadRepresentation(e){return this.payload.copy(e)}get errorDecrypting(){return this.payload.errorDecrypting}get waitingForKey(){return this.payload.waitingForKey}get content(){return this.payload.content}get auth_hash(){return this.payload.auth_hash}}t.EncryptedItem=i},97127:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GenericItem=void 0;const r=n(87901),i=n(33545),o=n(89223),s=n(43610),a=n(94515),l=n(63418);t.GenericItem=class{constructor(e){this.payload=e,this.duplicateOf=e.duplicate_of,this.createdAtString=this.created_at&&(0,r.dateToLocalizedString)(this.created_at),this.userModifiedDate=this.serverUpdatedAt||new Date,this.updatedAtString=(0,r.dateToLocalizedString)(this.userModifiedDate),setTimeout((()=>{(0,r.deepFreeze)(this)}),0)}get uuid(){return this.payload.uuid}get content_type(){return this.payload.content_type}get created_at(){return this.payload.created_at}get key_system_identifier(){return this.payload.key_system_identifier}get user_uuid(){return this.payload.user_uuid}get shared_vault_uuid(){return this.payload.shared_vault_uuid}get last_edited_by_uuid(){return this.payload.last_edited_by_uuid}get signatureData(){return this.payload.signatureData}get serverUpdatedAt(){return this.payload.serverUpdatedAt}get serverUpdatedAtTimestamp(){return this.payload.updated_at_timestamp}get updated_at(){return this.serverUpdatedAt}get dirty(){return this.payload.dirty}get lastSyncBegan(){return this.payload.lastSyncBegan}get lastSyncEnd(){return this.payload.lastSyncEnd}get duplicate_of(){return this.payload.duplicate_of}payloadRepresentation(e){return this.payload.copy(e)}get neverSynced(){return!this.serverUpdatedAt||0===this.serverUpdatedAt.getTime()}get isSingleton(){return!1}singletonPredicate(){throw"Must override SNItem.singletonPredicate"}get singletonStrategy(){return a.SingletonStrategy.KeepEarliest}strategyWhenConflictingWithItem(e,t){if((0,l.isEncryptedErroredItem)(this))return s.ConflictStrategy.KeepBaseDuplicateApply;if(this.isSingleton)return s.ConflictStrategy.KeepBase;if((0,l.isDeletedItem)(this))return s.ConflictStrategy.KeepApply;if((0,l.isDeletedItem)(e))return this.payload.source===o.PayloadSource.FileImport?s.ConflictStrategy.KeepBase:s.ConflictStrategy.KeepApply;if(!(0,l.isDecryptedItem)(e)||!(0,l.isDecryptedItem)(this))return s.ConflictStrategy.KeepBaseDuplicateApply;if(!(0,i.ItemContentsDiffer)(this,e))return s.ConflictStrategy.KeepApply;if((0,i.ItemContentsDiffer)(this,e,["references"])){if(t&&!(0,i.ItemContentsDiffer)(t.itemFromPayload(),e))return s.ConflictStrategy.KeepBase;const n=2e4;return e.payload.source===o.PayloadSource.FileImport||Date.now()-this.userModifiedDate.getTime()<n?s.ConflictStrategy.KeepBaseDuplicateApply:s.ConflictStrategy.DuplicateBaseKeepApply}return s.ConflictStrategy.KeepBaseMergeRefs}satisfiesPredicate(e){return e.matchesItem(this)}}},81667:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},91251:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},89169:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},12421:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},63418:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEncryptedErroredItem=t.isDecryptedOrDeletedItem=t.isDeletedItem=t.isNotEncryptedItem=t.isEncryptedItem=t.isDecryptedItem=void 0;const r=n(13566);function i(e){return"payload"in e&&(0,r.isDecryptedPayload)(e.payload)}function o(e){return(0,r.isEncryptedPayload)(e.payload)}function s(e){return(0,r.isDeletedPayload)(e.payload)}t.isDecryptedItem=i,t.isEncryptedItem=o,t.isNotEncryptedItem=function(e){return!o(e)},t.isDeletedItem=s,t.isDecryptedOrDeletedItem=function(e){return i(e)||s(e)},t.isEncryptedErroredItem=function(e){return o(e)&&!0===e.errorDecrypting}},589:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},14584:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DecryptedItemMutator=void 0;const r=n(87901),i=n(4250),o=n(68716),s=n(71458),a=n(56634),l=n(13743);class c extends a.ItemMutator{constructor(e,t){super(e,t);const n=(0,r.Copy)(this.immutablePayload.content);this.mutableContent=n}getResult(){return this.type===i.MutationType.NonDirtying?this.immutablePayload.copy({content:this.mutableContent}):(this.type===i.MutationType.UpdateUserTimestamps?this.userModifiedDate=new Date:this.immutableItem.userModifiedDate||(this.userModifiedDate=new Date(this.immutableItem.serverUpdatedAt)),this.immutablePayload.copy({content:this.mutableContent,dirty:!0,dirtyIndex:(0,l.getIncrementedDirtyIndex)(),signatureData:void 0,last_edited_by_uuid:void 0}))}setBeginSync(e,t){this.immutablePayload=this.immutablePayload.copy({content:this.mutableContent,lastSyncBegan:e,globalDirtyIndexAtLastSync:t})}setCustomContent(e){this.mutableContent=(0,r.Copy)(e)}set userModifiedDate(e){this.setAppDataItem(o.AppDataField.UserModifiedDate,e)}set conflictOf(e){this.mutableContent.conflict_of=e}set protected(e){this.mutableContent.protected=e}set trashed(e){this.mutableContent.trashed=e}set starred(e){this.mutableContent.starred=e}set pinned(e){this.setAppDataItem(o.AppDataField.Pinned,e)}set archived(e){this.setAppDataItem(o.AppDataField.Archived,e)}set locked(e){this.setAppDataItem(o.AppDataField.Locked,e)}setDomainData(e,t){this.mutableContent.appData||(this.mutableContent.appData={[s.DefaultAppDomain]:{}}),this.mutableContent.appData[t]=e}setDomainDataKey(e,t,n){this.mutableContent.appData||(this.mutableContent.appData={[s.DefaultAppDomain]:{}}),this.mutableContent.appData[n]||(this.mutableContent.appData[n]={}),this.mutableContent.appData[n][e]=t}setAppDataItem(e,t){this.setDomainDataKey(e,t,s.DefaultAppDomain)}e2ePendingRefactor_addItemAsRelationship(e){const t=this.mutableContent.references||[];t.find((t=>t.uuid===e.uuid))||t.push({uuid:e.uuid,content_type:e.content_type}),this.mutableContent.references=t}removeItemAsRelationship(e){let t=this.mutableContent.references||[];t=t.filter((t=>t.uuid!==e.uuid)),this.mutableContent.references=t}}t.DecryptedItemMutator=c},94220:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeleteItemMutator=void 0;const r=n(452),i=n(56634),o=n(4250),s=n(13743);class a extends i.ItemMutator{getDeletedResult(){const e=this.type!==o.MutationType.NonDirtying;return new r.DeletedPayload(Object.assign(Object.assign({},this.immutablePayload.ejected()),{deleted:!0,content:void 0,dirty:!!e||this.immutablePayload.dirty,dirtyIndex:e?(0,s.getIncrementedDirtyIndex)():this.immutablePayload.dirtyIndex}),this.immutablePayload.source)}getResult(){throw Error("Must use getDeletedResult")}}t.DeleteItemMutator=a},56634:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ItemMutator=void 0;const r=n(4250),i=n(13743),o=n(21662);t.ItemMutator=class{constructor(e,t){this.immutableItem=e,this.type=t,this.immutablePayload=e.payload}getUuid(){return this.immutablePayload.uuid}getItem(){return this.immutableItem}getResult(){return this.type===r.MutationType.NonDirtying?this.immutablePayload.copy():this.immutablePayload.copy({dirty:!0,dirtyIndex:(0,i.getIncrementedDirtyIndex)()})}setBeginSync(e,t){this.immutablePayload=this.immutablePayload.copy({lastSyncBegan:e,globalDirtyIndexAtLastSync:t})}set key_system_identifier(e){if((0,o.ContentTypeUsesRootKeyEncryption)(this.immutableItem.content_type))throw new Error("Cannot set key_system_identifier on a root key encrypted item");this.immutablePayload=this.immutablePayload.copy({key_system_identifier:e})}set shared_vault_uuid(e){if((0,o.ContentTypeUsesRootKeyEncryption)(this.immutableItem.content_type))throw new Error("Cannot set shared_vault_uuid on a root key encrypted item");this.immutablePayload=this.immutablePayload.copy({shared_vault_uuid:e})}set errorDecrypting(e){throw Error("This method is no longer implemented")}set updated_at(e){throw Error("This method is no longer implemented")}set updated_at_timestamp(e){throw Error("This method is no longer implemented")}}},8898:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},68716:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.AppDataField=void 0,function(e){e.Pinned="pinned",e.Archived="archived",e.Locked="locked",e.UserModifiedDate="client_updated_at",e.DefaultEditor="defaultEditor",e.MobileRules="mobileRules",e.NotAvailableOnMobile="notAvailableOnMobile",e.MobileActive="mobileActive",e.LastSize="lastSize",e.LegacyPrefersPlainEditor="prefersPlainEditor",e.ComponentInstallError="installError"}(n||(t.AppDataField=n={}))},43610:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ConflictStrategy=void 0,function(e){e[e.KeepBase=1]="KeepBase",e[e.KeepApply=2]="KeepApply",e[e.KeepBaseDuplicateApply=3]="KeepBaseDuplicateApply",e[e.DuplicateBaseKeepApply=4]="DuplicateBaseKeepApply",e[e.KeepBaseMergeRefs=5]="KeepBaseMergeRefs"}(n||(t.ConflictStrategy=n={}))},71458:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentDataDomain=t.DefaultAppDomain=void 0,t.DefaultAppDomain="org.standardnotes.sn",t.ComponentDataDomain="org.standardnotes.sn.components"},15579:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},91298:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4250:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MutationType=void 0,function(e){e[e.UpdateUserTimestamps=1]="UpdateUserTimestamps",e[e.NoUpdateUserTimestamps=2]="NoUpdateUserTimestamps",e[e.NonDirtying=3]="NonDirtying"}(n||(t.MutationType=n={}))},94515:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SingletonStrategy=void 0,function(e){e[e.KeepEarliest=1]="KeepEarliest"}(n||(t.SingletonStrategy=n={}))},50292:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(89661),t),i(n(78961),t),i(n(2445),t),i(n(64236),t),i(n(4744),t),i(n(27542),t),i(n(96933),t),i(n(77533),t),i(n(80421),t),i(n(43740),t),i(n(43740),t),i(n(78438),t),i(n(80406),t),i(n(97127),t),i(n(81667),t),i(n(91251),t),i(n(89169),t),i(n(12421),t),i(n(63418),t),i(n(589),t),i(n(14584),t),i(n(94220),t),i(n(56634),t),i(n(8898),t),i(n(68716),t),i(n(43610),t),i(n(71458),t),i(n(15579),t),i(n(91298),t),i(n(4250),t),i(n(94515),t)},89262:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DecryptedPayload=void 0;const r=n(87901),i=n(42405),o=n(89223),s=n(33264);class a extends s.PurePayload{constructor(e,t=o.PayloadSource.Constructor){super(e,t),this.content=(0,r.Copy)((0,i.FillItemContent)(e.content)),this.deleted=!1}get references(){return this.content.references||[]}getReference(e){const t=this.references.find((t=>t.uuid===e));if(!t)throw new Error("Reference not found");return t}ejected(){return Object.assign(Object.assign({},super.ejected()),{content:this.content,deleted:this.deleted})}copy(e,t=this.source){return new a(Object.assign(Object.assign({},this.ejected()),e),t)}copyAsSyncResolved(e,t=this.source){return new a(Object.assign(Object.assign({},this.ejected()),e),t)}}t.DecryptedPayload=a},452:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeletedPayload=void 0;const r=n(89223),i=n(33264);class o extends i.PurePayload{constructor(e,t=r.PayloadSource.Constructor){super(e,t),this.deleted=!0,this.content=void 0}get discardable(){return!this.dirty}ejected(){return Object.assign(Object.assign({},super.ejected()),{deleted:this.deleted,content:void 0})}copy(e,t=this.source){return new o(Object.assign(Object.assign({},this.ejected()),e),t)}copyAsSyncResolved(e,t=this.source){return new o(Object.assign(Object.assign({},this.ejected()),e),t)}}t.DeletedPayload=o},86731:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EncryptedPayload=void 0;const r=n(80910),i=n(89223),o=n(33264);class s extends o.PurePayload{constructor(e,t=i.PayloadSource.Constructor){super(e,t);const n=(0,r.ProtocolVersionFromEncryptedString)(e.content);if(n.isFailed())throw new Error("EncryptedPayload constructor versionResult is failed");this.auth_hash=e.auth_hash,this.content=e.content,this.deleted=!1,this.enc_item_key=e.enc_item_key,this.errorDecrypting=e.errorDecrypting,this.items_key_id=e.items_key_id,this.version=n.getValue(),this.waitingForKey=e.waitingForKey}ejected(){return Object.assign(Object.assign({},super.ejected()),{enc_item_key:this.enc_item_key,items_key_id:this.items_key_id,auth_hash:this.auth_hash,errorDecrypting:this.errorDecrypting,waitingForKey:this.waitingForKey,content:this.content,deleted:this.deleted})}copy(e,t=this.source){return new s(Object.assign(Object.assign({},this.ejected()),e),t)}copyAsSyncResolved(e,t=this.source){return new s(Object.assign(Object.assign({},this.ejected()),e),t)}}t.EncryptedPayload=s},33264:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PurePayload=void 0;const r=n(87901),i=n(89223),o=n(21662);t.PurePayload=class{constructor(e,t=i.PayloadSource.Constructor){var n,s,a,l;if(!e.uuid)throw Error(`Attempting to construct payload with null uuid\n        Content type: ${e.content_type}`);if(e.key_system_identifier&&(0,o.ContentTypeUsesRootKeyEncryption)(e.content_type))throw new Error("Rootkey-encrypted payload should not have a key system identifier");this.source=t,this.uuid=e.uuid,this.content=e.content,this.content_type=e.content_type,this.deleted=(0,r.useBoolean)(e.deleted,!1),this.dirty=e.dirty,this.duplicate_of=e.duplicate_of,this.updated_at=new Date(e.updated_at||0),this.updated_at_timestamp=e.updated_at_timestamp||0,this.updated_at_timestamp<0&&(this.updated_at_timestamp=0,this.updated_at=new Date(0)),this.created_at=new Date(e.created_at||new Date),this.created_at_timestamp=e.created_at_timestamp||0,this.created_at_timestamp<0&&(this.created_at_timestamp=this.updated_at_timestamp,this.created_at=this.updated_at),this.lastSyncBegan=e.lastSyncBegan?new Date(e.lastSyncBegan):void 0,this.lastSyncEnd=e.lastSyncEnd?new Date(e.lastSyncEnd):void 0,this.dirtyIndex=e.dirtyIndex,this.globalDirtyIndexAtLastSync=e.globalDirtyIndexAtLastSync,this.user_uuid=null!==(n=e.user_uuid)&&void 0!==n?n:void 0,this.key_system_identifier=null!==(s=e.key_system_identifier)&&void 0!==s?s:void 0,this.shared_vault_uuid=null!==(a=e.shared_vault_uuid)&&void 0!==a?a:void 0,this.last_edited_by_uuid=null!==(l=e.last_edited_by_uuid)&&void 0!==l?l:void 0,this.signatureData=e.signatureData,setTimeout((()=>{(0,r.deepFreeze)(this)}),0)}ejected(){return{uuid:this.uuid,content:this.content,deleted:this.deleted,content_type:this.content_type,created_at:this.created_at,updated_at:this.updated_at,created_at_timestamp:this.created_at_timestamp,updated_at_timestamp:this.updated_at_timestamp,dirty:this.dirty,duplicate_of:this.duplicate_of,dirtyIndex:this.dirtyIndex,globalDirtyIndexAtLastSync:this.globalDirtyIndexAtLastSync,lastSyncBegan:this.lastSyncBegan,lastSyncEnd:this.lastSyncEnd,key_system_identifier:this.key_system_identifier,user_uuid:this.user_uuid,shared_vault_uuid:this.shared_vault_uuid,last_edited_by_uuid:this.last_edited_by_uuid,signatureData:this.signatureData}}get serverUpdatedAt(){return this.updated_at}get serverUpdatedAtTimestamp(){return this.updated_at_timestamp}}},83732:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},75310:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3008:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},59296:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},13566:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isErrorDecryptingPayload=t.isDeletedPayload=t.isEncryptedPayload=t.isDecryptedPayload=void 0;const r=n(78381);t.isDecryptedPayload=function(e){return(0,r.isDecryptedTransferPayload)(e)},t.isEncryptedPayload=function(e){return(0,r.isEncryptedTransferPayload)(e)},t.isDeletedPayload=function(e){return(0,r.isDeletedTransferPayload)(e)},t.isErrorDecryptingPayload=function(e){return(0,r.isErrorDecryptingTransferPayload)(e)}},92238:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},55340:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadTimestampDefaults=void 0,t.PayloadTimestampDefaults=function(){return{updated_at:new Date(0),created_at:new Date,updated_at_timestamp:0,created_at_timestamp:0}}},21989:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadVaultOverrides=void 0,t.PayloadVaultOverrides=function(e){return e?{key_system_identifier:e.systemIdentifier,shared_vault_uuid:e.isSharedVaultListing()?e.sharing.sharedVaultUuid:void 0}:{}}},62935:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.isPayloadSourceRetrieved=t.isPayloadSourceInternalChange=t.PayloadEmitSource=void 0,function(e){e[e.InitialObserverRegistrationPush=1]="InitialObserverRegistrationPush",e[e.LocalChanged=2]="LocalChanged",e[e.LocalInserted=3]="LocalInserted",e[e.LocalDatabaseLoaded=4]="LocalDatabaseLoaded",e[e.OfflineSyncSaved=5]="OfflineSyncSaved",e[e.LocalRetrieved=6]="LocalRetrieved",e[e.FileImport=7]="FileImport",e[e.ComponentRetrieved=8]="ComponentRetrieved",e[e.ComponentCreated=9]="ComponentCreated",e[e.PreSyncSave=10]="PreSyncSave",e[e.RemoteRetrieved=11]="RemoteRetrieved",e[e.RemoteSaved=12]="RemoteSaved",e[e.DesktopComponentSync=13]="DesktopComponentSync"}(n||(t.PayloadEmitSource=n={})),t.isPayloadSourceInternalChange=function(e){return[n.RemoteSaved,n.PreSyncSave].includes(e)},t.isPayloadSourceRetrieved=function(e){return[n.RemoteRetrieved,n.ComponentRetrieved].includes(e)}},89223:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadSource=void 0,function(e){e[e.Constructor=1]="Constructor",e[e.LocalDatabaseLoaded=2]="LocalDatabaseLoaded",e[e.RemoteRetrieved=3]="RemoteRetrieved",e[e.RemoteSaved=4]="RemoteSaved",e[e.FileImport=5]="FileImport"}(n||(t.PayloadSource=n={}))},59180:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(33264),t),i(n(89262),t),i(n(86731),t),i(n(452),t),i(n(83732),t),i(n(75310),t),i(n(3008),t),i(n(59296),t),i(n(13566),t),i(n(92238),t),i(n(89223),t),i(n(62935),t),i(n(55340),t),i(n(21989),t)},89661:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2445:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},78961:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ContentReferenceType=void 0,function(e){e.TagToParentTag="TagToParentTag",e.TagToFile="TagToFile",e.FileToNote="FileToNote",e.FileToFile="FileToFile",e.NoteToNote="NoteToNote"}(n||(t.ContentReferenceType=n={}))},64236:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4744:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isTagToParentTagReference=t.isLegacyTagToNoteReference=t.isReference=t.isLegacyAnonymousReference=void 0;const r=n(82648),i=n(78961);t.isLegacyAnonymousReference=e=>void 0===e.reference_type,t.isReference=e=>void 0!==e.reference_type,t.isLegacyTagToNoteReference=(e,t)=>{const n=e.content_type===r.ContentType.TYPES.Note,i=t.content_type===r.ContentType.TYPES.Tag;return n&&i},t.isTagToParentTagReference=e=>(0,t.isReference)(e)&&e.reference_type===i.ContentReferenceType.TagToParentTag},27542:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},96933:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},77533:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},80421:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},69421:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},57978:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},95520:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7834:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},49762:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isCorruptTransferPayload=t.isDeletedTransferPayload=t.isErrorDecryptingTransferPayload=t.isEncryptedTransferPayload=t.isDecryptedTransferPayload=void 0;const r=n(82648),i=n(87901);function o(e){return"content"in e&&(0,i.isString)(e.content)}t.isDecryptedTransferPayload=function(e){return(0,i.isObject)(e.content)},t.isEncryptedTransferPayload=o,t.isErrorDecryptingTransferPayload=function(e){return o(e)&&!0===e.errorDecrypting},t.isDeletedTransferPayload=function(e){return"deleted"in e&&!0===e.deleted},t.isCorruptTransferPayload=function(e){const t=!0===e.deleted&&null!=e.content,n=r.ContentType.create(e.content_type);return null==e.uuid||t||n.isFailed()}},78381:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(69421),t),i(n(57978),t),i(n(95520),t),i(n(7834),t),i(n(49762),t)},21907:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},66675:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.InvitationStatus=void 0,function(e){e.Sent="sent",e.Canceled="canceled",e.Accepted="accepted",e.Declined="declined"}(n||(t.InvitationStatus=n={}))},90656:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.InviteeIdentifierType=void 0,function(e){e.Email="email",e.Hash="hash",e.Uuid="uuid"}(n||(t.InviteeIdentifierType=n={}))},93715:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.InviterIdentifierType=void 0,function(e){e.Email="email",e.Uuid="uuid"}(n||(t.InviterIdentifierType=n={}))},84457:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Environment=void 0,function(e){e[e.Web=1]="Web",e[e.Desktop=2]="Desktop",e[e.Mobile=3]="Mobile",e[e.Clipper=4]="Clipper"}(n||(t.Environment=n={}))},656:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Platform=void 0,function(e){e[e.Ios=1]="Ios",e[e.Android=2]="Android",e[e.MacWeb=3]="MacWeb",e[e.MacDesktop=4]="MacDesktop",e[e.WindowsWeb=5]="WindowsWeb",e[e.WindowsDesktop=6]="WindowsDesktop",e[e.LinuxWeb=7]="LinuxWeb",e[e.LinuxDesktop=8]="LinuxDesktop"}(n||(t.Platform=n={}))},255:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},62846:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.KeySystemPasswordType=void 0,function(e){e.UserInputted="user_inputted",e.Randomized="randomized"}(n||(t.KeySystemPasswordType=n={}))},29899:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},22296:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},52174:(e,t)=>{"use strict";var n;function r(e,t){return Number(e)-Number(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.isVersionLessThanOrEqualTo=t.leftVersionGreaterThanOrEqualToRight=t.compareVersions=t.ProtocolVersionLength=t.isProtocolVersionExpired=t.ProtocolExpirationDates=t.ProtocolVersionLastNonrootItemsKey=t.ProtocolVersionLatest=t.ProtocolVersion=void 0,function(e){e.V001="001",e.V002="002",e.V003="003",e.V004="004"}(n||(t.ProtocolVersion=n={})),t.ProtocolVersionLatest=n.V004,t.ProtocolVersionLastNonrootItemsKey=n.V003,t.ProtocolExpirationDates=Object.freeze({[n.V001]:Date.parse("2018-01-01"),[n.V002]:Date.parse("2020-01-01")}),t.isProtocolVersionExpired=function(e){const n=t.ProtocolExpirationDates[e];return!!n&&(new Date).getTime()>n},t.ProtocolVersionLength=3,t.compareVersions=r,t.leftVersionGreaterThanOrEqualToRight=function(e,t){return r(e,t)>=0},t.isVersionLessThanOrEqualTo=function(e,t){return r(e,t)<=0}},80910:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolVersionFromEncryptedString=void 0;const r=n(82648),i=n(52174);t.ProtocolVersionFromEncryptedString=function(e){try{const t=e.substring(0,i.ProtocolVersionLength);if(Object.values(i.ProtocolVersion).includes(t))return r.Result.ok(t)}catch(e){return r.Result.fail(JSON.stringify(e))}return r.Result.fail(`Invalid encrypted string ${e}`)}},87192:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},71109:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},32099:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},55430:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},33738:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},64130:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.AsymmetricMessagePayloadType=void 0,function(e){e.ContactShare="contact-share",e.SharedVaultRootKeyChanged="shared-vault-root-key-changed",e.SenderKeypairChanged="sender-keypair-changed",e.SharedVaultMetadataChanged="shared-vault-metadata-changed",e.SharedVaultInvite="shared-vault-invite"}(n||(t.AsymmetricMessagePayloadType=n={}))},18018:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},14770:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},45698:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},63070:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},32151:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},71165:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Collection=void 0;const r=n(87901),i=n(76635);t.Collection=class{constructor(e=!1,t,n,i,o){this.map={},this.typedMap={},this.dirtyIndex=new Set,this.nondeletedIndex=new Set,this.invalidsIndex=new Set,this.isDecryptedElement=e=>(0,r.isObject)(e.content),this.isEncryptedElement=e=>"content"in e&&(0,r.isString)(e.content),this.isErrorDecryptingElement=e=>this.isEncryptedElement(e),this.isDeletedElement=e=>"deleted"in e&&!0===e.deleted,this.isNonDeletedElement=e=>!this.isDeletedElement(e),e?(this.map=t,this.typedMap=n,this.referenceMap=i,this.conflictMap=o):(this.referenceMap=new r.UuidMap,this.conflictMap=new r.UuidMap)}uuids(){return Object.keys(this.map)}all(e){var t;if(e){if(Array.isArray(e)){const t=[];for(const n of e)(0,r.extendArray)(t,this.typedMap[n]||[]);return t}return(null===(t=this.typedMap[e])||void 0===t?void 0:t.slice())||[]}return Object.keys(this.map).map((e=>this.map[e]))}nondeletedElements(){const e=Array.from(this.nondeletedIndex);return this.findAll(e).filter(this.isNonDeletedElement)}invalidElements(){const e=Array.from(this.invalidsIndex);return this.findAll(e)}dirtyElements(){const e=Array.from(this.dirtyIndex);return this.findAll(e)}findAll(e){const t=[];for(const n of e){const e=this.map[n];e&&t.push(e)}return t}find(e){return this.map[e]}has(e){return null!=this.find(e)}findAllIncludingBlanks(e){const t=[];for(const n of e){const e=this.map[n];t.push(e)}return t}set(e){if(0!==(e=Array.isArray(e)?e:[e]).length)for(const t of e){if(this.map[t.uuid]=t,this.setToTypedMap(t),this.isErrorDecryptingElement(t)?this.invalidsIndex.add(t.uuid):this.invalidsIndex.delete(t.uuid),this.isDecryptedElement(t)){const e=t.content.conflict_of;e&&!t.content.trashed&&this.conflictMap.establishRelationship(e,t.uuid);const n=e&&t.content.trashed,r=!e&&this.conflictMap.getInverseRelationships(t.uuid).length>0,i=this.conflictMap.existsInDirectMap(t.uuid)&&0===this.conflictMap.getDirectRelationships(t.uuid).length;(r||i||n)&&this.conflictMap.removeFromMap(t.uuid),this.referenceMap.setAllRelationships(t.uuid,t.references.map((e=>e.uuid)))}t.dirty?this.dirtyIndex.add(t.uuid):this.dirtyIndex.delete(t.uuid),t.deleted?(this.nondeletedIndex.delete(t.uuid),(this.conflictMap.existsInDirectMap(t.uuid)||this.conflictMap.existsInInverseMap(t.uuid))&&this.conflictMap.removeFromMap(t.uuid)):this.nondeletedIndex.add(t.uuid)}else console.warn("Attempting to set 0 elements onto collection")}discard(e){e=Array.isArray(e)?e:[e];for(const t of e)this.deleteFromTypedMap(t),delete this.map[t.uuid],this.conflictMap.removeFromMap(t.uuid),this.referenceMap.removeFromMap(t.uuid)}uuidReferencesForUuid(e){return this.referenceMap.getDirectRelationships(e)}uuidsThatReferenceUuid(e){return this.referenceMap.getInverseRelationships(e)}referencesForElement(e){const t=this.referenceMap.getDirectRelationships(e.uuid);return this.findAll(t)}conflictsOf(e){const t=this.conflictMap.getDirectRelationships(e);return this.findAll(t)}elementsReferencingElement(e,t){const n=this.uuidsThatReferenceUuid(e.uuid),r=this.findAll(n);return t?r.filter((e=>e.content_type===t)):r}setToTypedMap(e){const t=this.typedMap[e.content_type]||[];(0,i.remove)(t,{uuid:e.uuid}),t.push(e),this.typedMap[e.content_type]=t}deleteFromTypedMap(e){const t=this.typedMap[e.content_type]||[];(0,i.remove)(t,{uuid:e.uuid}),this.typedMap[e.content_type]=t}uuidsOfItemsWithConflicts(){return this.conflictMap.getAllDirectKeys()}}},92207:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CollectionSort=void 0,t.CollectionSort={CreatedAt:"created_at",UpdatedAt:"userModifiedDate",Title:"title"}},36883:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ItemCollection=void 0;const r=n(63418),i=n(71165);class o extends i.Collection{onChange(e){const t=e.changed.concat(e.inserted);t.length>0&&this.set(t),this.discard(e.discarded)}findDecrypted(e){const t=this.find(e);if(t)return(0,r.isDecryptedItem)(t)?t:void 0}findAllDecrypted(e){return this.findAll(e).filter(r.isDecryptedItem)}findAllDecryptedWithBlanks(e){return this.findAllIncludingBlanks(e).map((e=>{if(null==e||(0,r.isDecryptedItem)(e))return e}))}allDecrypted(e){return this.all(e).filter(r.isDecryptedItem)}}t.ItemCollection=o},17441:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ItemCounter=void 0;const r=n(87901),i=n(4862),o=n(50292),s=n(45408),a=n(19688),l=n(52197),c=n(59017),u=n(79256),d=n(41574),h=n(82648);t.ItemCounter=class{constructor(e,t=[]){this.collection=e,this.observers=t,this.tagToItemsMap={},this.allCountableItems=new Set,this.countableItemsByType=new Map,this.isItemCountable=e=>!!(0,o.isDecryptedItem)(e)&&(this.passesAllFilters(e)&&!e.archived&&!e.trashed&&!e.conflictOf)}addCountChangeObserver(e){this.observers.push(e);const t=this.observers;return()=>{(0,r.removeFromArray)(t,e)}}setDisplayOptions(e){this.displayOptions=e,this.receiveItemChanges(this.collection.all())}setVaultDisplayOptions(e){this.vaultDisplayOptions=e,this.receiveItemChanges(this.collection.all())}allCountableItemsCount(){return this.allCountableItems.size}allCountableNotesCount(){var e;return(null===(e=this.countableItemsByType.get(h.ContentType.TYPES.Note))||void 0===e?void 0:e.size)||0}allCountableFilesCount(){var e;return(null===(e=this.countableItemsByType.get(h.ContentType.TYPES.File))||void 0===e?void 0:e.size)||0}countableItemsForTag(e){var t;return(null===(t=this.tagToItemsMap[e.uuid])||void 0===t?void 0:t.size)||0}onChange(e){const t=[...e.changed,...e.inserted,...e.discarded].filter((e=>e.content_type===h.ContentType.TYPES.Note||e.content_type===h.ContentType.TYPES.File)),n=[...e.changed,...e.inserted].filter(o.isDecryptedItem).filter(i.isTag);this.receiveItemChanges(t),this.receiveTagChanges(n)}passesAllFilters(e){if(!this.displayOptions)return!0;const t=[new s.CollectionCriteriaValidator(this.collection,e)];if(this.vaultDisplayOptions){const n=this.vaultDisplayOptions.getOptions();(0,d.isExclusionaryOptionsValue)(n)?t.push(new a.ExcludeVaultsCriteriaValidator([...n.exclude,...n.locked],e)):t.push(new l.ExclusiveVaultCriteriaValidator(n.exclusive,e))}return"hiddenContentTypes"in this.displayOptions&&this.displayOptions.hiddenContentTypes&&t.push(new c.HiddenContentCriteriaValidator(this.displayOptions.hiddenContentTypes,e)),"customFilter"in this.displayOptions&&this.displayOptions.customFilter&&t.push(new u.CustomFilterCriteriaValidator(this.displayOptions.customFilter,e)),t.every((e=>e.passes()))}notifyObservers(e){for(const t of this.observers)t(e)}receiveTagChanges(e){for(const t of e){const e=t.references.filter((e=>e.content_type===h.ContentType.TYPES.Note||e.content_type===h.ContentType.TYPES.File)).map((e=>e.uuid)).filter((e=>this.allCountableItems.has(e))),n=this.tagToItemsMap[t.uuid];this.tagToItemsMap[t.uuid]=new Set(e),(null==n?void 0:n.size)!==e.length&&this.notifyObservers(t.uuid)}}receiveItemChanges(e){var t,n;const r=this.allCountableItems.size;for(const r of e){const e=this.isItemCountable(r);e?(this.allCountableItems.add(r.uuid),this.countableItemsByType.has(r.content_type)||this.countableItemsByType.set(r.content_type,new Set),null===(t=this.countableItemsByType.get(r.content_type))||void 0===t||t.add(r.uuid)):(this.allCountableItems.delete(r.uuid),null===(n=this.countableItemsByType.get(r.content_type))||void 0===n||n.delete(r.uuid));const i=this.collection.uuidsThatReferenceUuid(r.uuid);for(const t of i){const n=this.setForTag(t),i=n.size;e?n.add(r.uuid):n.delete(r.uuid),i!==n.size&&this.notifyObservers(t)}}r!==this.allCountableItems.size&&this.notifyObservers(void 0)}setForTag(e){let t=this.tagToItemsMap[e];return t||(t=new Set,this.tagToItemsMap[e]=t),t}}},51833:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImmutablePayloadCollection=void 0;const r=n(19759);class i extends r.PayloadCollection{get payloads(){return this.all()}static WithPayloads(e=[]){const t=new i;return e.length>0&&t.set(e),Object.freeze(t),t}static FromCollection(e){const t=Object.freeze(Object.assign({},e.map)),n=Object.freeze(Object.assign({},e.typedMap)),r=Object.freeze(e.referenceMap.makeCopy()),o=Object.freeze(e.conflictMap.makeCopy()),s=new i(!0,t,n,r,o);return Object.freeze(s),s}mutableCopy(){const e=Object.assign({},this.map),t=Object.assign({},this.typedMap),n=this.referenceMap.makeCopy(),i=this.conflictMap.makeCopy();return new r.PayloadCollection(!0,e,t,n,i)}}t.ImmutablePayloadCollection=i},19759:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadCollection=void 0;const r=n(71165);class i extends r.Collection{integrityPayloads(){return this.nondeletedElements().map((e=>({uuid:e.uuid,updated_at_timestamp:e.serverUpdatedAtTimestamp})))}}t.PayloadCollection=i},9611:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSyncDelta=void 0;const r=n(87901);t.extendSyncDelta=function(e,t){(0,r.extendArray)(e.emits,t.emits),t.ignored&&(e.ignored||(e.ignored=[]),(0,r.extendArray)(e.ignored,t.ignored))}},38067:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConflictDelta=void 0;const r=n(87901),i=n(82648),o=n(73277),s=n(97873),a=n(43610),l=n(27446),c=n(37807),u=n(13566),d=n(38656),h=n(13743);t.ConflictDelta=class{constructor(e,t,n,r){this.baseCollection=e,this.basePayload=t,this.applyPayload=n,this.historyMap=r}result(){if(this.applyPayload.content_type===i.ContentType.TYPES.ItemsKey)return new d.ItemsKeyDelta(this.baseCollection,[this.applyPayload]).result();const e=this.getConflictStrategy();return{emits:this.handleStrategy(e),ignored:[]}}getConflictStrategy(){const e=(0,u.isErrorDecryptingPayload)(this.basePayload),t=(0,u.isErrorDecryptingPayload)(this.applyPayload);if(e||t){if(e&&!t)return a.ConflictStrategy.KeepBaseDuplicateApply;if(!e&&t)return a.ConflictStrategy.DuplicateBaseKeepApply;if(e&&t)return a.ConflictStrategy.KeepApply}else{if((0,u.isDecryptedPayload)(this.basePayload)){const e=this.baseCollection.conflictsOf(this.applyPayload.uuid)[0];if(e&&(0,u.isDecryptedPayload)(e)&&(0,u.isDecryptedPayload)(this.applyPayload)&&(0,c.PayloadContentsEqual)(e,this.applyPayload))return a.ConflictStrategy.KeepBase;{const e=(0,o.CreateDecryptedItemFromPayload)(this.basePayload),t=(0,o.CreateItemFromPayload)(this.applyPayload),n=this.historyMap[this.basePayload.uuid]||[],r=s.historyMapFunctions.getNewestRevision(n);return e.strategyWhenConflictingWithItem(t,r)}}if((0,u.isDeletedPayload)(this.basePayload)||(0,u.isDeletedPayload)(this.applyPayload))return(0,u.isDeletedPayload)(this.basePayload),(0,u.isDeletedPayload)(this.applyPayload),a.ConflictStrategy.KeepApply}throw Error("Unhandled strategy in Conflict Delta getConflictStrategy")}handleStrategy(e){if(e===a.ConflictStrategy.KeepBase)return this.handleKeepBaseStrategy();if(e===a.ConflictStrategy.KeepApply)return this.handleKeepApplyStrategy();if(e===a.ConflictStrategy.KeepBaseDuplicateApply)return this.handleKeepBaseDuplicateApplyStrategy();if(e===a.ConflictStrategy.DuplicateBaseKeepApply)return this.handleDuplicateBaseKeepApply();if(e===a.ConflictStrategy.KeepBaseMergeRefs)return this.handleKeepBaseMergeRefsStrategy();throw Error("Unhandled strategy in conflict delta payloadsByHandlingStrategy")}handleKeepBaseStrategy(){const e=this.applyPayload.serverUpdatedAt,t=this.applyPayload.updated_at_timestamp;return[this.basePayload.copyAsSyncResolved({updated_at:e,updated_at_timestamp:t,dirtyIndex:(0,h.getIncrementedDirtyIndex)(),dirty:!0,lastSyncEnd:new Date},this.applyPayload.source)]}handleKeepApplyStrategy(){return[this.applyPayload.copyAsSyncResolved({lastSyncBegan:this.basePayload.lastSyncBegan,lastSyncEnd:new Date,dirty:!1},this.applyPayload.source)]}handleKeepBaseDuplicateApplyStrategy(){const e=this.applyPayload.serverUpdatedAt,t=this.applyPayload.updated_at_timestamp,n=this.basePayload.copyAsSyncResolved({updated_at:e,updated_at_timestamp:t,dirty:!0,dirtyIndex:(0,h.getIncrementedDirtyIndex)(),lastSyncEnd:new Date},this.applyPayload.source),r=(0,l.PayloadsByDuplicating)({payload:this.applyPayload,baseCollection:this.baseCollection,isConflict:!0,source:this.applyPayload.source});return[n].concat(r)}handleDuplicateBaseKeepApply(){const e=(0,l.PayloadsByDuplicating)({payload:this.basePayload,baseCollection:this.baseCollection,isConflict:!0,source:this.applyPayload.source}),t=this.applyPayload.copyAsSyncResolved({lastSyncBegan:this.basePayload.lastSyncBegan,dirty:!1,lastSyncEnd:new Date},this.applyPayload.source);return e.concat([t])}handleKeepBaseMergeRefsStrategy(){if(!(0,u.isDecryptedPayload)(this.basePayload)||!(0,u.isDecryptedPayload)(this.applyPayload))return[];const e=(0,r.uniqCombineObjArrays)(this.basePayload.content.references,this.applyPayload.content.references,["uuid","content_type"]),t=this.applyPayload.serverUpdatedAt,n=this.applyPayload.updated_at_timestamp;return[this.basePayload.copyAsSyncResolved({updated_at:t,updated_at_timestamp:n,dirty:!0,dirtyIndex:(0,h.getIncrementedDirtyIndex)(),lastSyncEnd:new Date,content:Object.assign(Object.assign({},this.basePayload.content),{references:e})},this.applyPayload.source)]}}},33076:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaFileImport=void 0;const r=n(38067),i=n(59180),o=n(9611),s=n(13743);t.DeltaFileImport=class{constructor(e,t,n){this.baseCollection=e,this.applyPayloads=t,this.historyMap=n}result(){const e={emits:[],ignored:[],source:i.PayloadEmitSource.FileImport};for(const t of this.applyPayloads){const n=this.resolvePayload(t,e);(0,o.extendSyncDelta)(e,n)}return e}resolvePayload(e,t){let n=t.emits.find((t=>(0,i.isDecryptedPayload)(t)&&t.content.conflict_of===e.uuid));if(n||(n=t.emits.find((t=>t.uuid===e.uuid))),!n){const t=this.baseCollection.find(e.uuid);t&&(0,i.isDecryptedPayload)(t)&&(n=t)}return n?new r.ConflictDelta(this.baseCollection,n,e,this.historyMap).result():{emits:[e.copyAsSyncResolved({dirty:!0,dirtyIndex:(0,s.getIncrementedDirtyIndex)(),lastSyncEnd:new Date(0)})],ignored:[]}}}},38656:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ItemsKeyDelta=void 0;const r=n(59180),i=n(72990);t.ItemsKeyDelta=class{constructor(e,t){this.baseCollection=e,this.applyPayloads=t}result(){const e=[],t=[];for(const n of this.applyPayloads){const o=this.baseCollection.find(n.uuid);if(o)if((0,r.isEncryptedPayload)(n)&&(0,r.isDecryptedPayload)(o)){const r=o.copyAsSyncResolved({updated_at_timestamp:n.updated_at_timestamp,updated_at:n.updated_at,dirty:!1,lastSyncEnd:new Date});e.push(r),t.push(n)}else e.push((0,i.payloadByFinalizingSyncState)(n,this.baseCollection));else e.push((0,i.payloadByFinalizingSyncState)(n,this.baseCollection))}return{emits:e,ignored:t}}}},9910:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaOfflineSaved=void 0;const r=n(59180),i=n(72990);t.DeltaOfflineSaved=class{constructor(e,t){this.baseCollection=e,this.applyContextualPayloads=t}result(){const e=[];for(const t of this.applyContextualPayloads){const n=this.baseCollection.find(t.uuid);n&&e.push((0,i.payloadByFinalizingSyncState)(n,this.baseCollection))}return{emits:e,source:r.PayloadEmitSource.OfflineSyncSaved}}}},28504:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaOutOfSync=void 0;const r=n(59180),i=n(13566),o=n(37807),s=n(38067),a=n(82648),l=n(38656),c=n(72990),u=n(9611);t.DeltaOutOfSync=class{constructor(e,t,n){this.baseCollection=e,this.applyCollection=t,this.historyMap=n}result(){const e={emits:[],ignored:[],source:r.PayloadEmitSource.RemoteRetrieved};for(const t of this.applyCollection.all()){if(t.content_type===a.ContentType.TYPES.ItemsKey){const n=new l.ItemsKeyDelta(this.baseCollection,[t]).result();(0,u.extendSyncDelta)(e,n);continue}const n=this.baseCollection.find(t.uuid);if(!n){e.emits.push((0,c.payloadByFinalizingSyncState)(t,this.baseCollection));continue}const r=(0,i.isDecryptedPayload)(n),d=(0,i.isDecryptedPayload)(t);if(d!==r||d&&r&&!(0,o.PayloadContentsEqual)(t,n)){const r=new s.ConflictDelta(this.baseCollection,n,t,this.historyMap);(0,u.extendSyncDelta)(e,r.result())}else e.emits.push((0,c.payloadByFinalizingSyncState)(t,this.baseCollection))}return e}}},9579:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaRemoteDataConflicts=void 0;const r=n(38067),i=n(59180),o=n(9611),s=n(72990);t.DeltaRemoteDataConflicts=class{constructor(e,t,n){this.baseCollection=e,this.conflicts=t,this.historyMap=n}result(){const e={emits:[],ignored:[],source:i.PayloadEmitSource.RemoteRetrieved};for(const t of this.conflicts){const n=this.baseCollection.find(t.server_item.uuid);if(null==n){e.emits.push((0,s.payloadByFinalizingSyncState)(t.server_item,this.baseCollection));continue}const i=new r.ConflictDelta(this.baseCollection,n,t.server_item,this.historyMap);(0,o.extendSyncDelta)(e,i.result())}return e}}},34319:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaRemoteRejected=void 0;const r=n(89223),i=n(59180),o=n(84625),s=n(95658),a=n(27446),l=n(82648);t.DeltaRemoteRejected=class{constructor(e,t){this.baseCollection=e,this.conflicts=t}result(){const e=[],t=[s.ConflictType.SharedVaultInsufficientPermissionsError,s.ConflictType.SharedVaultNotMemberError,s.ConflictType.SharedVaultInvalidState,s.ConflictType.SharedVaultSnjsVersionError];for(const n of this.conflicts)t.includes(n.type)?e.push(...this.handleVaultError(n)):(0,s.conflictParamsHasServerItemAndUnsavedItem)(n)?e.push(...this.getResultForConflictWithServerItemAndUnsavedItem(n)):(0,s.conflictParamsHasOnlyServerItem)(n)?e.push(...this.getResultForConflictWithOnlyServerItem(n)):(0,s.conflictParamsHasOnlyUnsavedItem)(n)&&e.push(...this.getResultForConflictWithOnlyUnsavedItem(n));return{emits:e,source:i.PayloadEmitSource.RemoteSaved}}handleVaultError(e){const t=this.baseCollection.find(e.unsaved_item.uuid);return t?e.type===s.ConflictType.SharedVaultNotMemberError?this.resultByDuplicatingBasePayloadAsNonVaultedAndRemovingBaseItemLocally(t):t.content_type===l.ContentType.TYPES.KeySystemItemsKey?this.discardChangesOfBasePayload(t):e.server_item?this.resultByDuplicatingBasePayloadAsNonVaultedAndTakingServerPayloadAsCanonical(t,e.server_item):this.resultByDuplicatingBasePayloadAsNonVaultedAndDiscardingChangesOfOriginal(t):[]}discardChangesOfBasePayload(e){return[e.copyAsSyncResolved({dirty:!1,lastSyncEnd:new Date},r.PayloadSource.RemoteSaved)]}getResultForConflictWithOnlyUnsavedItem(e){const t=this.baseCollection.find(e.unsaved_item.uuid);return t?[t.copyAsSyncResolved({dirty:!1,lastSyncEnd:new Date},r.PayloadSource.RemoteSaved)]:[]}getResultForConflictWithOnlyServerItem(e){const t=this.baseCollection.find(e.server_item.uuid);return t?this.resultByDuplicatingBasePayloadIntoNewUuidAndTakingServerPayloadAsCanonical(t,e.server_item):[]}getResultForConflictWithServerItemAndUnsavedItem(e){const t=this.baseCollection.find(e.server_item.uuid);return t?this.resultByDuplicatingBasePayloadIntoNewUuidAndTakingServerPayloadAsCanonical(t,e.server_item):[]}resultByDuplicatingBasePayloadIntoNewUuidAndTakingServerPayloadAsCanonical(e,t){const n=(0,a.PayloadsByDuplicating)({payload:e,baseCollection:this.baseCollection,isConflict:!0,source:t.source}),r=t.copyAsSyncResolved({lastSyncBegan:e.lastSyncBegan,dirty:!1,lastSyncEnd:new Date},t.source);return n.concat([r])}resultByDuplicatingBasePayloadAsNonVaultedAndTakingServerPayloadAsCanonical(e,t){const n=(0,a.PayloadsByDuplicating)({payload:e.copy({key_system_identifier:void 0,shared_vault_uuid:void 0}),baseCollection:this.baseCollection,isConflict:!0,source:t.source}),r=t.copyAsSyncResolved({lastSyncBegan:e.lastSyncBegan,dirty:!1,lastSyncEnd:new Date},t.source);return n.concat([r])}resultByDuplicatingBasePayloadAsNonVaultedAndDiscardingChangesOfOriginal(e){return[...(0,a.PayloadsByDuplicating)({payload:e.copy({key_system_identifier:void 0,shared_vault_uuid:void 0}),baseCollection:this.baseCollection,isConflict:!0,source:e.source}),...this.discardChangesOfBasePayload(e)]}resultByDuplicatingBasePayloadAsNonVaultedAndRemovingBaseItemLocally(e){return[...(0,a.PayloadsByDuplicating)({payload:e.copy({key_system_identifier:void 0,shared_vault_uuid:void 0}),baseCollection:this.baseCollection,isConflict:!0,source:e.source}),new i.DeletedPayload(Object.assign(Object.assign(Object.assign({},e),{content:void 0,deleted:!0,key_system_identifier:void 0,shared_vault_uuid:void 0}),(0,o.BuildSyncResolvedParams)({dirty:!1,lastSyncEnd:new Date})),r.PayloadSource.RemoteSaved)]}}},79603:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaRemoteRetrieved=void 0;const r=n(38067),i=n(13566),o=n(59180),s=n(82648),a=n(72990),l=n(38656),c=n(9611);t.DeltaRemoteRetrieved=class{constructor(e,t,n,r){this.baseCollection=e,this.applyCollection=t,this.itemsSavedOrSaving=n,this.historyMap=r}isUuidOfPayloadCurrentlySavingOrSaved(e){return null!=this.itemsSavedOrSaving.find((t=>t.uuid===e))}result(){const e={emits:[],ignored:[],source:o.PayloadEmitSource.RemoteRetrieved},t=[];for(const n of this.applyCollection.all()){if(n.content_type===s.ContentType.TYPES.ItemsKey||n.content_type===s.ContentType.TYPES.KeySystemItemsKey){const t=new l.ItemsKeyDelta(this.baseCollection,[n]).result();(0,c.extendSyncDelta)(e,t);continue}if(this.isUuidOfPayloadCurrentlySavingOrSaved(n.uuid)){t.push(n);continue}const r=this.baseCollection.find(n.uuid);!(null==r?void 0:r.dirty)||(0,i.isErrorDecryptingPayload)(r)?e.emits.push((0,a.payloadByFinalizingSyncState)(n,this.baseCollection)):t.push(n)}for(const n of t){if(!(0,i.isDecryptedPayload)(n))continue;const t=this.baseCollection.find(n.uuid);if(!t)continue;const o=new r.ConflictDelta(this.baseCollection,t,n,this.historyMap);(0,c.extendSyncDelta)(e,o.result())}return e}}},50910:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaRemoteSaved=void 0;const r=n(452),i=n(89223),o=n(13566),s=n(59180),a=n(72990),l=n(84625),c=n(13743);t.DeltaRemoteSaved=class{constructor(e,t){this.baseCollection=e,this.applyContextualPayloads=t}result(){const e=[];for(const t of this.applyContextualPayloads){const n=this.baseCollection.find(t.uuid);if(n)if((0,o.isDeletedPayload)(n)){const o=!t.deleted,s=t.deleted;if(o){const n=new r.DeletedPayload(Object.assign(Object.assign(Object.assign({},t),{deleted:!0,content:void 0,dirtyIndex:(0,c.getIncrementedDirtyIndex)()}),(0,l.BuildSyncResolvedParams)({dirty:!0,lastSyncEnd:new Date})),i.PayloadSource.RemoteSaved);e.push(n)}else if(s){const r=n.copy(Object.assign(Object.assign(Object.assign({},t),{deleted:!0}),(0,l.BuildSyncResolvedParams)({dirty:!1,lastSyncEnd:new Date})),i.PayloadSource.RemoteSaved);e.push(r)}}else{const r=(0,a.payloadByFinalizingSyncState)(n.copy(Object.assign(Object.assign({},t),{deleted:!1}),i.PayloadSource.RemoteSaved),this.baseCollection);e.push(r)}else{const n=new r.DeletedPayload(Object.assign(Object.assign(Object.assign({},t),{deleted:!0,content:void 0}),(0,l.BuildSyncResolvedParams)({dirty:!1,lastSyncEnd:new Date})),i.PayloadSource.RemoteSaved);e.push(n)}}return{emits:e,source:s.PayloadEmitSource.RemoteSaved}}}},16484:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaRemoteUuidConflicts=void 0;const r=n(87901),i=n(51833),o=n(15005),s=n(13566),a=n(59180);t.DeltaRemoteUuidConflicts=class{constructor(e,t){this.baseCollection=e,this.conflicts=t}result(){const e=[],t=this.baseCollection.mutableCopy();for(const n of this.conflicts){const a=e.find((e=>e.uuid===n.unsaved_item.uuid))||n.unsaved_item;if(!(0,s.isDecryptedPayload)(a))continue;const l=(0,o.PayloadsByAlternatingUuid)(a,i.ImmutablePayloadCollection.FromCollection(t));t.set(l),(0,r.filterFromArray)(e,(e=>(0,r.Uuids)(l).includes(e.uuid))),(0,r.extendArray)(e,l)}return{emits:e,source:a.PayloadEmitSource.RemoteRetrieved}}}},72990:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.payloadsByFinalizingSyncState=t.payloadByFinalizingSyncState=void 0;const r=n(13743);function i(e,t){const n=t.find(e.uuid);if(!n)return e.copyAsSyncResolved({dirty:!1,lastSyncEnd:new Date});const i=!(!n.dirtyIndex||!n.globalDirtyIndexAtLastSync)&&n.dirtyIndex>n.globalDirtyIndexAtLastSync;return e.copyAsSyncResolved({dirty:i,dirtyIndex:i?(0,r.getIncrementedDirtyIndex)():void 0,lastSyncEnd:new Date})}t.payloadByFinalizingSyncState=i,t.payloadsByFinalizingSyncState=function(e,t){return e.map((e=>i(e,t)))}},84625:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BuildSyncResolvedParams=void 0,t.BuildSyncResolvedParams=function(e){return e}},22517:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(38067),t),i(n(33076),t),i(n(28504),t),i(n(9579),t),i(n(79603),t),i(n(50910),t),i(n(9910),t),i(n(16484),t),i(n(34319),t),i(n(9611),t)},13743:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCurrentDirtyIndex=t.getIncrementedDirtyIndex=void 0;let n=0;t.getIncrementedDirtyIndex=function(){return n++,n},t.getCurrentDirtyIndex=function(){return n}},55823:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},91176:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.computeFiltersForDisplayOptions=t.computeUnifiedFilterForDisplayOptions=void 0;const r=n(8698),i=n(50149),o=n(35509),s=n(41138),a=n(82648);function l(e,t){var n;const l=[];let c;if(e.views&&e.views.length>0){const n=new r.CompoundPredicate("and",e.views.map((e=>e.predicate)));c=n,l.push((e=>{if(n.keypathIncludesString("tags")){const r=i.ItemWithTags.Create(e.payload,e,t.elementsReferencingElement(e,a.ContentType.TYPES.Tag));return n.matchesItem(r)}return n.matchesItem(e)}))}if(e.tags&&e.tags.length>0)for(const t of e.tags)l.push((e=>t.isReferencingItem(e)));if(!1!==e.includePinned||(null==c?void 0:c.keypathIncludesString("pinned"))||l.push((e=>!e.pinned)),!1!==e.includeProtected||(null==c?void 0:c.keypathIncludesString("protected"))||l.push((e=>!e.protected)),!1!==e.includeTrashed||(null==c?void 0:c.keypathIncludesString("trashed"))||l.push((e=>!e.trashed)),!1!==e.includeArchived||(null==c?void 0:c.keypathIncludesString("archived"))||l.push((e=>!e.archived)),e.searchQuery){const n=e.searchQuery;l.push((e=>(0,o.itemMatchesQuery)(e,n,t)))}return(null==c?void 0:c.keypathIncludesString("conflict_of"))||(null===(n=e.views)||void 0===n?void 0:n.some((e=>e.uuid===s.SystemViewId.TrashedNotes)))||l.push((e=>!e.conflictOf)),l}t.computeUnifiedFilterForDisplayOptions=function(e,t,n=[]){const r=l(e,t).concat(n);return e=>(0,o.itemPassesFilters)(e,r)},t.computeFiltersForDisplayOptions=l},40257:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ItemDisplayController=void 0;const r=n(87901),i=n(50292),o=n(99548),s=n(45408),a=n(79256),l=n(19688),c=n(52197),u=n(59017),d=n(41574);t.ItemDisplayController=class{constructor(e,t,n,r){this.collection=e,this.contentTypes=t,this.options=n,this.vaultOptions=r,this.sortMap={},this.sortedItems=[],this.needsSort=!0,this.filterThenSortElements(this.collection.all(this.contentTypes))}items(){return this.sortedItems}hasExclusiveVaultOptions(){return!!this.vaultOptions&&!(0,d.isExclusionaryOptionsValue)(this.vaultOptions.getOptions())}getDisplayOptions(){return this.options}setVaultDisplayOptions(e){this.vaultOptions=e,this.needsSort=!0,this.filterThenSortElements(this.collection.all(this.contentTypes))}setDisplayOptions(e){this.options=Object.assign(Object.assign({},this.options),e),this.needsSort=!0,this.filterThenSortElements(this.collection.all(this.contentTypes))}onCollectionChange(e){const t=[...e.changed,...e.inserted,...e.discarded].filter((e=>this.contentTypes.includes(e.content_type)));this.filterThenSortElements(t)}passesAllFilters(e){const t=[new s.CollectionCriteriaValidator(this.collection,e)];if(this.vaultOptions){const n=this.vaultOptions.getOptions();(0,d.isExclusionaryOptionsValue)(n)?t.push(new l.ExcludeVaultsCriteriaValidator([...n.exclude,...n.locked],e)):t.push(new c.ExclusiveVaultCriteriaValidator(n.exclusive,e))}return"hiddenContentTypes"in this.options&&this.options.hiddenContentTypes&&t.push(new u.HiddenContentCriteriaValidator(this.options.hiddenContentTypes,e)),"customFilter"in this.options&&this.options.customFilter&&t.push(new a.CustomFilterCriteriaValidator(this.options.customFilter,e)),t.every((e=>e.passes()))}filterThenSortElements(e){for(const t of e){const e=this.sortMap[t.uuid],n=null!=e?this.sortedItems[e]:void 0,o=()=>{null!=e&&(delete this.sortMap[t.uuid],this.sortedItems[e]=void 0,this.needsSort=!0)};if((0,i.isDeletedItem)(t)||(0,i.isEncryptedItem)(t))o();else if(this.passesAllFilters(t))if(null!=n){const i=n[this.options.sortBy],o=t[this.options.sortBy];this.sortedItems[e]=t;const s=n.pinned!==t.pinned;(0,r.compareValues)(i,o)&&!s||(this.needsSort=!0)}else this.sortedItems.push(t),this.needsSort=!0;else o()}this.needsSort&&(this.needsSort=!1,this.resortItems())}resortItems(){const e=this.sortedItems.sort(((e,t)=>(0,o.sortTwoItems)(e,t,this.options.sortBy,this.options.sortDirection))),t=[];let n=0;for(const r of e)r&&(t.push(r),this.sortMap[r.uuid]=n,n++);this.sortedItems=t}}},50149:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ItemWithTags=void 0;const r=n(87901),i=n(50292);class o extends i.DecryptedItem{constructor(e,t,n){super(e),this.item=t,this.tags=n,this.transferInItemPropertiesSoRootLevelPredicateKeyPathsCanBeMatched(t),this.tags=n||e.content.tags}transferInItemPropertiesSoRootLevelPredicateKeyPathsCanBeMatched(e){Object.assign(this,(0,r.omitByCopy)(e,["title","text"]))}static Create(e,t,n){return new o(e,t,n)}get tagsCount(){var e;return(null===(e=this.tags)||void 0===e?void 0:e.length)||0}get title(){return this.item.title}get text(){return this.item.text}}t.ItemWithTags=o},35509:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.itemMatchesQuery=t.itemPassesFilters=t.notesAndFilesMatchingOptions=void 0;const r=n(82648),i=n(91176);var o;function s(e,t){for(const n of t)if(!n(e))return!1;return!0}function a(e,t){var n,r;if(0===t.length)return o.TitleAndText;const i=null===(n=e.title)||void 0===n?void 0:n.toLowerCase(),s=null===(r=e.text)||void 0===r?void 0:r.toLowerCase(),a=t.toLowerCase(),l=a.split(" "),c=function(e){const t=e.match(/"(.*?)"/);return t?t[1]:null}(a);if(c)return((null==i?void 0:i.includes(c))?o.Title:o.None)+((null==s?void 0:s.includes(c))?o.Text:o.None);if(function(e){return!!e.match(/\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b/)}(a))return e.uuid===a?o.Uuid:o.None;const u=i&&l.every((e=>i.indexOf(e)>=0)),d=s&&l.every((e=>s.indexOf(e)>=0));return(u?o.Title:0)+(d?o.Text:0)}!function(e){e[e.None=0]="None",e[e.Title=1]="Title",e[e.Text=2]="Text",e[e.TitleAndText=3]="TitleAndText",e[e.Uuid=5]="Uuid"}(o||(o={})),t.notesAndFilesMatchingOptions=function(e,t,n){const r=(0,i.computeFiltersForDisplayOptions)(e,n);return t.filter((e=>s(e,r)))},t.itemPassesFilters=s,t.itemMatchesQuery=function(e,t,n){const i=n.elementsReferencingElement(e,r.ContentType.TYPES.Tag).some((e=>a(e,t.query)!==o.None));if(e.protected&&!t.includeProtectedNoteText){const n=a(e,t.query);return n===o.Title||n===o.TitleAndText||i}return a(e,t.query)!==o.None||i}},29816:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},74379:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},99548:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sortTwoItems=t.KeepSameOrder=t.SortRightFirst=t.SortLeftFirst=void 0;const r=n(87901),i=n(92207);t.SortLeftFirst=-1,t.SortRightFirst=1,t.KeepSameOrder=0,t.sortTwoItems=function e(n,o,s,a,l=!1){if(!n)return t.SortLeftFirst;if(!o)return t.SortRightFirst;if(!l){if(n.pinned&&o.pinned)return e(n,o,s,a,!0);if(n.pinned)return t.SortLeftFirst;if(o.pinned)return t.SortRightFirst}const c=n[s]||"",u=o[s]||"",d="asc"===a;let h=t.KeepSameOrder;h=s===i.CollectionSort.Title&&(0,r.isString)(c)&&(0,r.isString)(u)&&c.length>0&&u.length>0?c.localeCompare(u,"en",{numeric:!0}):c>u?t.SortRightFirst:c<u?t.SortLeftFirst:t.KeepSameOrder;const p=h===t.SortLeftFirst,f=h===t.SortRightFirst;return p?d?t.SortLeftFirst:t.SortRightFirst:f?d?t.SortRightFirst:t.SortLeftFirst:t.KeepSameOrder}},93974:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},45408:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CollectionCriteriaValidator=void 0,t.CollectionCriteriaValidator=class{constructor(e,t){this.collection=e,this.element=t}passes(){return this.collection.has(this.element.uuid)}}},79256:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CustomFilterCriteriaValidator=void 0,t.CustomFilterCriteriaValidator=class{constructor(e,t){this.customFilter=e,this.element=t}passes(){return this.customFilter(this.element)}}},19688:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExcludeVaultsCriteriaValidator=void 0,t.ExcludeVaultsCriteriaValidator=class{constructor(e,t){this.excludeVaults=e,this.element=t}passes(){return!this.excludeVaults.some((e=>this.element.key_system_identifier===e))}}},52197:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExclusiveVaultCriteriaValidator=void 0,t.ExclusiveVaultCriteriaValidator=class{constructor(e,t){this.exclusiveVault=e,this.element=t}passes(){return this.element.key_system_identifier===this.exclusiveVault}}},59017:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HiddenContentCriteriaValidator=void 0,t.HiddenContentCriteriaValidator=class{constructor(e,t){this.hiddenContentTypes=e,this.element=t}passes(){return!this.hiddenContentTypes.includes(this.element.content_type)}}},67104:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VaultDisplayOptions=void 0;const r=n(87901),i=n(41574);function o(e){return e.map((e=>e.systemIdentifier))}class s{constructor(e){this.options=e}getOptions(){return this.options}getExclusivelyShownVault(){if((0,i.isExclusionaryOptionsValue)(this.options))throw new Error("Not in exclusive display mode");return this.options.exclusive}isInExclusiveDisplayMode(){return!(0,i.isExclusionaryOptionsValue)(this.options)}isVaultExplicitlyExcluded(e){if((0,i.isExclusionaryOptionsValue)(this.options))return this.options.exclude.some((t=>t===e.systemIdentifier));if(this.options.exclusive)return this.options.exclusive!==e.systemIdentifier;throw new Error("Invalid vault display options")}isVaultExclusivelyShown(e){return!(0,i.isExclusionaryOptionsValue)(this.options)&&this.options.exclusive===e.systemIdentifier}isVaultDisabledOrLocked(e){return!(!(0,i.isExclusionaryOptionsValue)(this.options)||!this.options.locked.find((t=>t===e.systemIdentifier)))||this.isVaultExplicitlyExcluded(e)}getPersistableValue(){return this.options}newOptionsByIntakingLockedVaults(e){return(0,i.isExclusionaryOptionsValue)(this.options)?new s({exclude:this.options.exclude,locked:o(e)}):new s({exclusive:this.options.exclusive})}newOptionsByExcludingVault(e,t){return this.newOptionsByExcludingVaults([e],t)}newOptionsByExcludingVaults(e,t){return(0,i.isExclusionaryOptionsValue)(this.options)?new s({exclude:(0,r.uniqueArray)([...this.options.exclude,...o(e)]),locked:o(t)}):new s({exclude:o(e),locked:o(t)})}newOptionsByUnexcludingVault(e,t){return(0,i.isExclusionaryOptionsValue)(this.options)?new s({exclude:this.options.exclude.filter((t=>t!==e.systemIdentifier)),locked:o(t)}):new s({exclude:[],locked:o(t)})}static FromPersistableValue(e){return new s(e)}}t.VaultDisplayOptions=s},41574:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isExclusionaryOptionsValue=void 0,t.isExclusionaryOptionsValue=function(e){return"exclude"in e||"locked"in e}},30561:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(55823),t),i(n(91176),t),i(n(40257),t),i(n(50149),t),i(n(29816),t),i(n(35509),t),i(n(74379),t),i(n(93974),t),i(n(67104),t),i(n(41574),t)},87332:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContentTypeUsesKeySystemRootKeyEncryption=void 0;const r=n(82648);t.ContentTypeUsesKeySystemRootKeyEncryption=function(e){return e===r.ContentType.TYPES.KeySystemItemsKey}},21662:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContentTypeUsesRootKeyEncryption=void 0;const r=n(96084);t.ContentTypeUsesRootKeyEncryption=function(e){return(0,r.ContentTypesUsingRootKeyEncryption)().includes(e)}},96084:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContentTypesUsingRootKeyEncryption=void 0;const r=n(82648);t.ContentTypesUsingRootKeyEncryption=function(){return[r.ContentType.TYPES.RootKey,r.ContentType.TYPES.ItemsKey,r.ContentType.TYPES.EncryptedStorage,r.ContentType.TYPES.TrustedContact,r.ContentType.TYPES.KeySystemRootKey]}},47469:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},74958:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNativeFeature=t.isItemBasedFeature=t.isUIFeatureAnIframeFeature=void 0;const r=n(84409);t.isUIFeatureAnIframeFeature=function(e){return(0,r.isIframeComponentFeatureDescription)(e.featureDescription)},t.isItemBasedFeature=function(e){return"uuid"in e},t.isNativeFeature=function(e){return!("uuid"in e)}},36053:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIFeature=void 0;const r=n(84409),i=n(74958),o=n(82648),s=n(52659);t.UIFeature=class{constructor(e){this.item=e}get isComponent(){return(0,i.isItemBasedFeature)(this.item)}get isThemeComponent(){return(0,i.isItemBasedFeature)(this.item)&&(0,s.isTheme)(this.item)}get asComponent(){if((0,i.isItemBasedFeature)(this.item))return this.item;throw new Error("Cannot cast item to component")}get asTheme(){if((0,i.isItemBasedFeature)(this.item))return this.item;throw new Error("Cannot cast item to component")}get asFeatureDescription(){if((0,i.isNativeFeature)(this.item))return this.item;throw new Error("Cannot cast item to feature description")}get isNativeFeature(){return void 0!==(0,r.FindNativeFeature)(this.featureIdentifier)}get uniqueIdentifier(){return(0,i.isNativeFeature)(this.item)?r.NativeFeatureIdentifier.create(this.item.identifier).getValue():o.Uuid.create(this.item.uuid).getValue()}get featureIdentifier(){return this.item.identifier}get noteType(){var e;if((0,i.isNativeFeature)(this.item)&&(0,r.isEditorFeatureDescription)(this.item))return null!==(e=this.item.note_type)&&void 0!==e?e:r.NoteType.Unknown;if((0,i.isItemBasedFeature)(this.item))return this.item.noteType;throw new Error("Invalid component or feature description")}get fileType(){var e,t;if((0,i.isNativeFeature)(this.item)&&(0,r.isEditorFeatureDescription)(this.item))return this.item.file_type;if((0,i.isItemBasedFeature)(this.item)&&(0,r.isEditorFeatureDescription)(this.item.package_info))return null!==(t=null===(e=this.item.package_info)||void 0===e?void 0:e.file_type)&&void 0!==t?t:"txt";throw new Error("Invalid component or feature description")}get displayName(){var e;return(0,i.isNativeFeature)(this.item)?null!==(e=this.item.name)&&void 0!==e?e:"":this.item.displayName}get description(){var e,t;return(0,i.isNativeFeature)(this.item)?null!==(e=this.item.description)&&void 0!==e?e:"":null!==(t=this.item.package_info.description)&&void 0!==t?t:""}get deprecationMessage(){return(0,i.isNativeFeature)(this.item)?this.item.deprecation_message:this.item.deprecationMessage}get expirationDate(){return(0,i.isNativeFeature)(this.item)?this.item.expires_at?new Date(this.item.expires_at):void 0:this.item.valid_until}get featureDescription(){return(0,i.isNativeFeature)(this.item)?this.item:this.item.package_info}get acquiredPermissions(){var e;if((0,i.isNativeFeature)(this.item)&&(0,r.isIframeComponentFeatureDescription)(this.item))return null!==(e=this.item.component_permissions)&&void 0!==e?e:[];if((0,i.isItemBasedFeature)(this.item))return this.item.permissions;throw new Error("Invalid component or feature description")}get area(){return"area"in this.item?this.item.area:r.ComponentArea.Editor}get layerable(){var e;return(0,i.isItemBasedFeature)(this.item)&&(0,s.isTheme)(this.item)?this.item.layerableTheme:!!(0,r.isThemeFeatureDescription)(this.asFeatureDescription)&&null!==(e=this.asFeatureDescription.layerable)&&void 0!==e&&e}get dockIcon(){return(0,i.isItemBasedFeature)(this.item)&&(0,s.isTheme)(this.item)?this.asTheme.package_info.dock_icon:(0,r.isThemeFeatureDescription)(this.asFeatureDescription)?this.asFeatureDescription.dock_icon:void 0}}},18284:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},24715:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreateHistoryEntryForPayload=void 0;const r=n(82648),i=n(69375),o=n(94068);t.CreateHistoryEntryForPayload=function(e,t){return new(e.content_type===r.ContentType.TYPES.Note?o.NoteHistoryEntry:i.HistoryEntry)(e,t)}},69375:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HistoryEntry=void 0;const r=n(87901),i=n(73277);t.HistoryEntry=class{constructor(e,t){var n;this.defaultContentKeyToDiffOn="text",this.payload=e.copy(),this.previousEntry=t,this.hasPreviousEntry=!(0,r.isNullOrUndefined)(t);const i=this.payload.content[this.defaultContentKeyToDiffOn];if(i)if(t){const e=(null===(n=t.payload.content[this.defaultContentKeyToDiffOn])||void 0===n?void 0:n.length)||0;this.textCharDiffLength=i.length-e}else this.textCharDiffLength=i.length;else this.textCharDiffLength=0}itemFromPayload(){return(0,i.CreateDecryptedItemFromPayload)(this.payload)}isSameAsEntry(e){if(!e)return!1;const t=this.itemFromPayload(),n=e.itemFromPayload();return!(t.userModifiedDate.getTime()!==n.userModifiedDate.getTime())&&t.isItemContentEqualWith(n)}isDiscardable(){return!1}operationVector(){return void 0!==this.textCharDiffLength?this.hasPreviousEntry&&0!==this.textCharDiffLength?this.textCharDiffLength<0?-1:1:0:1}deltaSize(){return void 0!==this.textCharDiffLength?Math.abs(this.textCharDiffLength):1}}},30545:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},97873:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.historyMapFunctions=void 0,t.historyMapFunctions={getNewestRevision:e=>e[0]}},94068:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoteHistoryEntry=void 0;const r=n(87901),i=n(69375);class o extends i.HistoryEntry{previewTitle(){return this.payload.updated_at.getTime()>0?this.payload.updated_at.toLocaleString():this.payload.created_at.toLocaleString()}previewSubTitle(){return this.hasPreviousEntry?this.textCharDiffLength<0?-1*this.textCharDiffLength+" characters removed":this.textCharDiffLength>0?`${this.textCharDiffLength} characters added`:"Title or metadata changed":`${this.textCharDiffLength} characters loaded`}isDiscardable(){return(0,r.isEmpty)(this.payload.content.text)}}t.NoteHistoryEntry=o},78274:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(24715),t),i(n(69375),t),i(n(97873),t),i(n(94068),t),i(n(30545),t)},47479:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreateItemDelta=void 0,t.CreateItemDelta=function(e){return{changed:e.changed||[],inserted:e.inserted||[],discarded:e.discarded||[],ignored:e.ignored||[],unerrored:e.unerrored||[]}}},21626:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8698:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CompoundPredicate=void 0,t.CompoundPredicate=class{constructor(e,t){this.operator=e,this.predicates=t}matchesItem(e){if("and"===this.operator){for(const t of this.predicates)if(!t.matchesItem(e))return!1;return!0}if("or"===this.operator){for(const t of this.predicates)if(t.matchesItem(e))return!0;return!1}return!1}keypathIncludesString(e){for(const t of this.predicates)if(t.keypathIncludesString(e))return!0;return!1}toJson(){return{operator:this.operator,value:this.predicates.map((e=>e.toJson()))}}}},26550:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.predicateFromDSLString=t.predicateFromJson=t.includesPredicateFromArguments=t.notPredicateFromArguments=t.compoundPredicateFromArguments=t.predicateFromArguments=void 0;const r=n(8698),i=n(80389),o=n(21271),s=n(73067),a=n(78688);function l(e,t,n){if(o.AllPredicateCompoundOperators.includes(t))return c(t,n);if("not"===t)return new s.NotPredicate(u(n));if("includes"===t&&e)return function(e){return!!o.SureValueNonObjectTypesAsStrings.includes(typeof e)||!!Array.isArray(e)&&!d(e)}(n)?new a.Predicate(e,t,n):new i.IncludesPredicate(e,u(n));if(e)return new a.Predicate(e,t,n);throw Error("Invalid predicate arguments")}function c(e,t){const n=t.map((e=>u(e)));return new r.CompoundPredicate(e,n)}function u(e){if(Array.isArray(e))throw Error("Invalid predicateFromJson value");return l(e.keypath,e.operator,d(e.value)?h(e.value):e.value)}function d(e){return Array.isArray(e)&&o.AllPredicateOperators.includes(e[1])}function h(e){const t=e[2];let n;if(Array.isArray(t)){const e=t;n=Array.isArray(e[0])?e.map((e=>h(e))):d(t[1])?h(e):t}else n=t;return{keypath:e[0],operator:e[1],value:n}}t.predicateFromArguments=l,t.compoundPredicateFromArguments=c,t.notPredicateFromArguments=function(e){const t=u(e);return new s.NotPredicate(t)},t.includesPredicateFromArguments=function(e,t){const n=u(t);return new i.IncludesPredicate(e,n)},t.predicateFromJson=u,t.predicateFromDSLString=function(e){try{const t=JSON.parse(e.substring(1,e.length));return t.shift(),u(h(t))}catch(e){throw Error(`Invalid smart view syntax ${JSON.stringify(e)}`)}}},80389:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IncludesPredicate=void 0,t.IncludesPredicate=class{constructor(e,t){this.keypath=e,this.predicate=t}matchesItem(e){const t=this.keypath.split(".").reduce(((e,t)=>e&&e[t]),e);return!!Array.isArray(t)&&t.some((e=>this.predicate.matchesItem(e)))}keypathIncludesString(e){return this.keypath.includes(e)}toJson(){return{keypath:this.keypath,operator:"includes",value:this.predicate.toJson()}}}},21271:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SureValueNonObjectTypesAsStrings=t.AllPredicateOperators=t.AllNonCompoundPredicateOperators=t.AllPredicateCompoundOperators=void 0,t.AllPredicateCompoundOperators=["and","or"],t.AllNonCompoundPredicateOperators=["!=","=","<",">","<=",">=","startsWith","in","matches","not","includes"],t.AllPredicateOperators=[...t.AllPredicateCompoundOperators,...t.AllNonCompoundPredicateOperators],t.SureValueNonObjectTypesAsStrings=["number","string","boolean"]},73067:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotPredicate=void 0,t.NotPredicate=class{constructor(e){this.predicate=e}matchesItem(e){return!this.predicate.matchesItem(e)}keypathIncludesString(e){return this.predicate.keypathIncludesString(e)}toJson(){return{operator:"not",value:this.predicate.toJson()}}}},21014:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.valueMatchesTargetValue=void 0;const r=n(87901),i=n(58506);t.valueMatchesTargetValue=function e(t,n,o){if(null==o)return!1;if("string"==typeof o&&o.includes(".ago")&&(o=(0,i.dateFromDSLDateString)(o)),"string"==typeof o&&(o=o.toLowerCase()),"string"==typeof t&&(t=t.toLowerCase()),t instanceof Date&&"string"==typeof o&&(o=new Date(o)),"not"===n)return!e(t,"=",o);if(null==t){const e=[!1,"",null,void 0,NaN].includes(o);return"!="===n?!e:e}if("="===n)return Array.isArray(t)?JSON.stringify(t)===JSON.stringify(o):t===o;if("!="===n)return Array.isArray(t)?JSON.stringify(t)!==JSON.stringify(o):t!==o;if("<"===n)return t<o;if(">"===n)return t>o;if("<="===n)return t<=o;if(">="===n)return t>=o;if("startsWith"===n)return t.startsWith(o);if("in"===n&&Array.isArray(o))return o.includes(t);if("includes"===n){if((0,r.isString)(t))return t.includes(o);if((0,r.isString)(o)&&((0,r.isString)(t)||Array.isArray(t)))return t.includes(o)}return"matches"===n&&new RegExp(o).test(t)}},78688:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Predicate=void 0;const r=n(21014);t.Predicate=class{constructor(e,t,n){this.keypath=e,this.operator=t,this.targetValue=n,"true"!==this.targetValue&&"false"!==this.targetValue||(this.targetValue=JSON.parse(this.targetValue))}keypathIncludesString(e){return this.keypath.includes(e)}matchesItem(e){const t=this.keypath.split(".").reduce(((e,t)=>e&&e[t]),e);return(0,r.valueMatchesTargetValue)(t,this.operator,this.targetValue)}toJson(){return{keypath:this.keypath,operator:this.operator,value:this.targetValue}}}},58506:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dateFromDSLDateString=void 0,t.dateFromDSLDateString=function(e){const t=e.split("."),n=t[1],r=new Date,i=parseInt(t[0]);return"days"===n?r.setDate(r.getDate()-i):"hours"===n?r.setHours(r.getHours()-i):"months"===n?r.setMonth(r.getMonth()-i):"years"===n&&r.setFullYear(r.getFullYear()-i),r}},59020:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SNActionsExtension=void 0;const r=n(43740),i=n(43610);class o extends r.DecryptedItem{constructor(e){super(e),this.actions=[],this.name=e.content.name||"",this.description=e.content.description||"",this.url=e.content.hosted_url||e.content.url,this.supported_types=e.content.supported_types,this.package_info=this.payload.content.package_info||{},this.deprecation=e.content.deprecation,this.actions=e.content.actions}get displayName(){return this.name}get thirdPartyPackageInfo(){return this.package_info}get isListedExtension(){return"org.standardnotes.listed"===this.package_info.identifier}actionsWithContextForItem(e){return this.actions.filter((t=>t.context===e.content_type||"Item"===t.context))}strategyWhenConflictingWithItem(e,t){return i.ConflictStrategy.KeepBase}}t.SNActionsExtension=o},27539:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActionsExtensionMutator=void 0;const r=n(14584);class i extends r.DecryptedItemMutator{set description(e){this.mutableContent.description=e}set supported_types(e){this.mutableContent.supported_types=e}set actions(e){this.mutableContent.actions=e}set deprecation(e){this.mutableContent.deprecation=e}}t.ActionsExtensionMutator=i},82531:(e,t)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.ActionVerb=t.ActionAccessType=void 0,function(e){e.Encrypted="encrypted",e.Decrypted="decrypted"}(n||(t.ActionAccessType=n={})),function(e){e.Get="get",e.Render="render",e.Show="show",e.Post="post",e.Nested="nested"}(r||(t.ActionVerb=r={}))},40826:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(59020),t),i(n(27539),t),i(n(82531),t)},35922:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentItem=void 0;const r=n(87901),i=n(84409),o=n(68716),s=n(43610),a=n(43740),l=n(78688),c=n(82648);class u extends a.DecryptedItem{constructor(e){var t,n,o;super(e),this.permissions=[],e.content.hosted_url&&(0,r.isValidUrl)(e.content.hosted_url)?this.hosted_url=e.content.hosted_url:e.content.url&&(0,r.isValidUrl)(e.content.url)?this.hosted_url=e.content.url:e.content.legacy_url&&(0,r.isValidUrl)(e.content.legacy_url)&&(this.hosted_url=e.content.legacy_url),this.local_url=e.content.local_url,this.valid_until=new Date(e.content.valid_until||0),this.offlineOnly=null!==(t=e.content.offlineOnly)&&void 0!==t&&t,this.name=e.content.name,this.content_type===c.ContentType.TYPES.Theme?this.area=i.ComponentArea.Themes:this.area=e.content.area,this.package_info=e.content.package_info||{},this.permissions=e.content.permissions||[],this.autoupdateDisabled=null!==(n=e.content.autoupdateDisabled)&&void 0!==n&&n,this.disassociatedItemIds=e.content.disassociatedItemIds||[],this.associatedItemIds=e.content.associatedItemIds||[],this.legacy_url=e.content.hosted_url?void 0:e.content.url,this.legacyComponentData=this.payload.content.componentData||{},this.legacyActive=null!==(o=e.content.active)&&void 0!==o&&o}strategyWhenConflictingWithItem(e,t){return s.ConflictStrategy.KeepBase}get isSingleton(){return!0}get displayName(){var e;return(null===(e=(0,i.FindNativeFeature)(this.identifier))||void 0===e?void 0:e.name)||this.name}singletonPredicate(){return new l.Predicate("identifier","=",this.identifier)}isTheme(){return this.content_type===c.ContentType.TYPES.Theme||this.area===i.ComponentArea.Themes}legacyIsDefaultEditor(){return!0===this.getAppDomainValue(o.AppDataField.DefaultEditor)}hasValidHostedUrl(){return null!=(this.hosted_url||this.legacy_url)}contentKeysToIgnoreWhenCheckingEquality(){return["active","disassociatedItemIds","associatedItemIds",...super.contentKeysToIgnoreWhenCheckingEquality()]}isExplicitlyEnabledForItem(e){return-1!==this.associatedItemIds.indexOf(e)}isExplicitlyDisabledForItem(e){return-1!==this.disassociatedItemIds.indexOf(e)}get isExpired(){return this.valid_until.getTime()>0&&this.valid_until<=new Date}get identifier(){return this.package_info.identifier}get thirdPartyPackageInfo(){return this.package_info}get noteType(){var e;return(0,i.isEditorFeatureDescription)(this.package_info)&&null!==(e=this.package_info.note_type)&&void 0!==e?e:i.NoteType.Unknown}get isDeprecated(){var e;let t=null!==(e=this.package_info.flags)&&void 0!==e?e:[];return t=t.map((e=>e.toLowerCase())),t.includes(i.ComponentFlag.Deprecated)}get deprecationMessage(){return this.package_info.deprecation_message}get layerableTheme(){var e;if(!this.isTheme())return!1;const t=this.package_info;return null!==(e=null==t?void 0:t.layerable)&&void 0!==e&&e}}t.ComponentItem=u},12740:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},80755:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43246:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentMutator=void 0;const r=n(87901),i=n(14584);class o extends i.DecryptedItemMutator{set package_info(e){this.mutableContent.package_info=e}set local_url(e){this.mutableContent.local_url=e}set hosted_url(e){this.mutableContent.hosted_url=e}set valid_until(e){this.mutableContent.valid_until=e}set permissions(e){this.mutableContent.permissions=e}set name(e){this.mutableContent.name=e}set offlineOnly(e){this.mutableContent.offlineOnly=e}associateWithItem(e){const t=this.mutableContent.associatedItemIds||[];(0,r.addIfUnique)(t,e),this.mutableContent.associatedItemIds=t}disassociateWithItem(e){const t=this.mutableContent.disassociatedItemIds||[];(0,r.addIfUnique)(t,e),this.mutableContent.disassociatedItemIds=t}removeAssociatedItemId(e){(0,r.removeFromArray)(this.mutableContent.associatedItemIds||[],e)}removeDisassociatedItemId(e){(0,r.removeFromArray)(this.mutableContent.disassociatedItemIds||[],e)}}t.ComponentMutator=o},78446:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},54218:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isComponentOrTheme=t.isTheme=t.isComponent=void 0;const r=n(50292),i=n(82648);t.isComponent=function(e){return!!(0,r.isDecryptedItem)(e)&&e.content_type===i.ContentType.TYPES.Component},t.isTheme=function(e){return!!(0,r.isDecryptedItem)(e)&&e.content_type===i.ContentType.TYPES.Theme},t.isComponentOrTheme=function(e){return!!(0,r.isDecryptedItem)(e)&&(e.content_type===i.ContentType.TYPES.Component||e.content_type===i.ContentType.TYPES.Theme)}},52659:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(35922),t),i(n(43246),t),i(n(12740),t),i(n(80755),t),i(n(78446),t),i(n(54218),t)},55159:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SNEditor=void 0;const r=n(43740);class i extends r.DecryptedItem{constructor(e){super(e),this.notes=[],this.data={},this.url=e.content.url,this.name=e.content.name,this.data=e.content.data||{},this.isDefault=e.content.default,this.systemEditor=e.content.systemEditor}}t.SNEditor=i},10123:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(55159),t)},73886:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SNFeatureRepo=void 0;const r=n(87901),i=n(43740);class o extends i.DecryptedItem{get migratedToUserSetting(){return(0,r.useBoolean)(this.payload.content.migratedToUserSetting,!1)}get migratedToOfflineEntitlements(){return(0,r.useBoolean)(this.payload.content.migratedToOfflineEntitlements,!1)}get onlineUrl(){return this.payload.content.url}get offlineFeaturesUrl(){return this.payload.content.offlineFeaturesUrl}get offlineKey(){return this.payload.content.offlineKey}}t.SNFeatureRepo=o},75299:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FeatureRepoMutator=void 0;const r=n(14584);class i extends r.DecryptedItemMutator{set migratedToUserSetting(e){this.mutableContent.migratedToUserSetting=e}set migratedToOfflineEntitlements(e){this.mutableContent.migratedToOfflineEntitlements=e}set offlineFeaturesUrl(e){this.mutableContent.offlineFeaturesUrl=e}set offlineKey(e){this.mutableContent.offlineKey=e}}t.FeatureRepoMutator=i},12310:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(73886),t),i(n(75299),t)},86154:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileItem=t.isFile=void 0;const r=n(82648),i=n(43740),o=n(50292);t.isFile=e=>e.content_type===r.ContentType.TYPES.File;class s extends i.DecryptedItem{constructor(e){super(e),this.remoteIdentifier=this.content.remoteIdentifier,this.name=this.content.name,this.key=this.content.key,this.content.size&&this.content.chunkSizes?(this.decryptedSize=this.content.size,this.encryptedChunkSizes=this.content.chunkSizes):(this.decryptedSize=this.content.decryptedSize,this.encryptedChunkSizes=this.content.encryptedChunkSizes),this.encryptionHeader=this.content.encryptionHeader,this.mimeType=this.content.mimeType}strategyWhenConflictingWithItem(e){return e.key!==this.key||e.encryptionHeader!==this.encryptionHeader||e.remoteIdentifier!==this.remoteIdentifier||JSON.stringify(e.encryptedChunkSizes)!==JSON.stringify(this.encryptedChunkSizes)?o.ConflictStrategy.KeepBaseDuplicateApply:o.ConflictStrategy.KeepBase}get encryptedSize(){return this.encryptedChunkSizes.reduce(((e,t)=>e+t),0)}get title(){return this.name}}t.FileItem=s},78037:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},82422:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileMutator=void 0;const r=n(82648),i=n(78961),o=n(14584);class s extends o.DecryptedItemMutator{set name(e){this.mutableContent.name=e}set encryptionHeader(e){this.mutableContent.encryptionHeader=e}addNote(e){const t={reference_type:i.ContentReferenceType.FileToNote,content_type:r.ContentType.TYPES.Note,uuid:e.uuid},n=this.mutableContent.references||[];n.push(t),this.mutableContent.references=n}removeNote(e){const t=this.immutableItem.references.filter((t=>t.uuid!==e.uuid));this.mutableContent.references=t}addFile(e){if(this.immutableItem.isReferencingItem(e))return;const t={uuid:e.uuid,content_type:r.ContentType.TYPES.File,reference_type:i.ContentReferenceType.FileToFile};this.mutableContent.references.push(t)}removeFile(e){this.mutableContent.references=this.mutableContent.references.filter((t=>t.uuid!==e.uuid))}}t.FileMutator=s},33447:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.FileProtocolV1Constants=void 0,function(e){e[e.KeySize=256]="KeySize"}(n||(t.FileProtocolV1Constants=n={}))},25698:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(86154),t),i(n(82422),t),i(n(78037),t),i(n(33447),t)},87500:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2836:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},52493:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},82412:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},23811:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},19725:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},82818:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeySystemRootKey=t.isKeySystemRootKey=void 0;const r=n(50292),i=n(82648);t.isKeySystemRootKey=function(e){return e.content_type===i.ContentType.TYPES.KeySystemRootKey};class o extends r.DecryptedItem{constructor(e){super(e),this.keyParams=e.content.keyParams,this.systemIdentifier=e.content.systemIdentifier,this.key=e.content.key,this.keyVersion=e.content.keyVersion,this.token=e.content.token}strategyWhenConflictingWithItem(e,t){const n=this.keyParams.creationTimestamp;return e.keyParams.creationTimestamp>n?r.ConflictStrategy.KeepApply:r.ConflictStrategy.KeepBase}get itemsKey(){return this.key}get key_system_identifier(){}get shared_vault_uuid(){}isEqual(e){return this.itemsKey===e.itemsKey&&this.token===e.token}}t.KeySystemRootKey=o},95132:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},31750:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},64836:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeySystemRootKeyMutator=void 0;const r=n(50292);class i extends r.DecryptedItemMutator{}t.KeySystemRootKeyMutator=i},28819:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.KeySystemRootKeyStorageMode=void 0,function(e){e.Synced="synced",e.Local="local",e.Ephemeral="ephemeral"}(n||(t.KeySystemRootKeyStorageMode=n={}))},2636:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SNNote=t.isNote=void 0;const r=n(68716),i=n(84409),o=n(43740),s=n(82648);t.isNote=e=>e.content_type===s.ContentType.TYPES.Note;class a extends o.DecryptedItem{constructor(e){super(e),this.hidePreview=!1,this.title=String(this.payload.content.title||""),this.text=String(this.payload.content.text||""),this.hidePreview=Boolean(this.payload.content.hidePreview),this.preview_plain=String(this.payload.content.preview_plain||""),this.preview_html=String(this.payload.content.preview_html||""),this.spellcheck=this.payload.content.spellcheck,this.editorWidth=this.payload.content.editorWidth,this.noteType=this.payload.content.noteType,this.editorIdentifier=this.payload.content.editorIdentifier,this.authorizedForListed=this.payload.content.authorizedForListed||!1,this.noteType||this.getAppDomainValueWithDefault(r.AppDataField.LegacyPrefersPlainEditor,!1)&&(this.noteType=i.NoteType.Plain)}}t.SNNote=a},38856:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},39273:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoteMutator=void 0;const r=n(14584),i=n(50292),o=n(82648);class s extends r.DecryptedItemMutator{set title(e){this.mutableContent.title=e}set text(e){this.mutableContent.text=e}set hidePreview(e){this.mutableContent.hidePreview=e}set preview_plain(e){this.mutableContent.preview_plain=e}set preview_html(e){this.mutableContent.preview_html=e}set spellcheck(e){this.mutableContent.spellcheck=e}set editorWidth(e){this.mutableContent.editorWidth=e}set noteType(e){this.mutableContent.noteType=e}set editorIdentifier(e){this.mutableContent.editorIdentifier=e}set authorizedForListed(e){this.mutableContent.authorizedForListed=e}toggleSpellcheck(){null==this.mutableContent.spellcheck?this.mutableContent.spellcheck=!1:this.mutableContent.spellcheck=!this.mutableContent.spellcheck}addNote(e){if(this.immutableItem.isReferencingItem(e))return;const t={uuid:e.uuid,content_type:o.ContentType.TYPES.Note,reference_type:i.ContentReferenceType.NoteToNote};this.mutableContent.references.push(t)}removeNote(e){this.mutableContent.references=this.mutableContent.references.filter((t=>t.uuid!==e.uuid))}}t.NoteMutator=s},42006:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(2636),t),i(n(39273),t),i(n(38856),t)},12775:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmartView=t.isSmartView=t.isSystemView=t.SMART_TAG_DSL_PREFIX=void 0;const r=n(82648),i=n(43740),o=n(26550),s=n(78748),a=n(47899);function l(e){return Object.values(s.SystemViewId).includes(e.uuid)}t.SMART_TAG_DSL_PREFIX="![",t.isSystemView=l,t.isSmartView=e=>e.content_type===r.ContentType.TYPES.SmartView;class c extends i.DecryptedItem{constructor(e){super(e),this.title=String(this.content.title||""),l(this)?this.iconString=(0,a.systemViewIcon)(this.uuid):this.iconString=this.payload.content.iconString||a.SmartViewDefaultIconName,this.preferences=this.payload.content.preferences;try{this.predicate=this.content.predicate&&(0,o.predicateFromJson)(this.content.predicate)}catch(e){console.error(e)}}}t.SmartView=c},11070:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BuildSmartViews=void 0;const r=n(89262),i=n(12775),o=n(78748),s=n(42405),a=n(78688),l=n(8698),c=n(59180),u=n(82648);function d(e){const t=[new a.Predicate("content_type","=",u.ContentType.TYPES.Note)];return!1===e.includeTrashed&&t.push(new a.Predicate("trashed","=",!1)),!1===e.includeArchived&&t.push(new a.Predicate("archived","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}function h(e){const t=[new a.Predicate("content_type","=",u.ContentType.TYPES.File)];return!1===e.includeTrashed&&t.push(new a.Predicate("trashed","=",!1)),!1===e.includeArchived&&t.push(new a.Predicate("archived","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}function p(e){const t=[new a.Predicate("archived","=",!0),new a.Predicate("content_type","=",u.ContentType.TYPES.Note)];return!1===e.includeTrashed&&t.push(new a.Predicate("trashed","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}function f(e){const t=[new a.Predicate("trashed","=",!0),new a.Predicate("content_type","=",u.ContentType.TYPES.Note)];return!1===e.includeArchived&&t.push(new a.Predicate("archived","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}function g(e){const t=[new a.Predicate("content_type","=",u.ContentType.TYPES.Note),new a.Predicate("tagsCount","=",0)];return!1===e.includeArchived&&t.push(new a.Predicate("archived","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}function m(e){const t=[new a.Predicate("starred","=",!0),new a.Predicate("content_type","=",u.ContentType.TYPES.Note)];return!1===e.includeTrashed&&t.push(new a.Predicate("trashed","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}function y(e){const t=[new a.Predicate("content_type","=",u.ContentType.TYPES.Note)];return!1===e.includeTrashed&&t.push(new a.Predicate("trashed","=",!1)),!1===e.includeArchived&&t.push(new a.Predicate("archived","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}t.BuildSmartViews=function(e){const t=new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.AllNotes,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Notes",predicate:d(e).toJson()})}))),n=new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.Files,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Files",predicate:h(e).toJson()})}))),a=new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.ArchivedNotes,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Archived",predicate:p(e).toJson()})}))),l=new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.TrashedNotes,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Trash",predicate:f(e).toJson()})}))),v=new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.UntaggedNotes,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Untagged",predicate:g(e).toJson()})})));return[t,n,new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.StarredNotes,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Starred",predicate:m(e).toJson()})}))),a,l,v,new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.Conflicts,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Conflicts",predicate:y(e).toJson()})})))]}},50986:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},47899:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmartViewDefaultIconName=t.systemViewIcon=t.SmartViewIcons=void 0;const r=n(78748);t.SmartViewIcons={[r.SystemViewId.AllNotes]:"notes",[r.SystemViewId.Files]:"folder",[r.SystemViewId.ArchivedNotes]:"archive",[r.SystemViewId.TrashedNotes]:"trash",[r.SystemViewId.UntaggedNotes]:"hashtag-off",[r.SystemViewId.StarredNotes]:"star-filled",[r.SystemViewId.Conflicts]:"merge"},t.systemViewIcon=function(e){return t.SmartViewIcons[e]},t.SmartViewDefaultIconName="restore"},54196:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmartViewMutator=void 0;const r=n(87458);class i extends r.TagMutator{constructor(e,t){super(e,t)}set predicate(e){this.mutableContent.predicate=e}}t.SmartViewMutator=i},78748:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SystemViewId=void 0,function(e){e.AllNotes="all-notes",e.Files="files",e.ArchivedNotes="archived-notes",e.TrashedNotes="trashed-notes",e.UntaggedNotes="untagged-notes",e.StarredNotes="starred-notes",e.Conflicts="conflicts"}(n||(t.SystemViewId=n={}))},41138:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(12775),t),i(n(11070),t),i(n(78748),t),i(n(50986),t),i(n(54196),t),i(n(47899),t)},4862:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SNTag=t.isTag=t.DefaultTagIconName=t.TagFolderDelimitter=void 0;const r=n(43740),i=n(4744),o=n(82648);t.TagFolderDelimitter=".",t.DefaultTagIconName="hashtag",t.isTag=e=>e.content_type===o.ContentType.TYPES.Tag;class s extends r.DecryptedItem{constructor(e){super(e),this.title=this.payload.content.title||"",this.expanded=null==this.payload.content.expanded||this.payload.content.expanded,this.iconString=this.payload.content.iconString||t.DefaultTagIconName,this.preferences=this.payload.content.preferences}get isDailyEntry(){var e;return"daily"===(null===(e=this.preferences)||void 0===e?void 0:e.entryMode)}get noteReferences(){return this.payload.references.filter((e=>e.content_type===o.ContentType.TYPES.Note))}get noteCount(){return this.noteReferences.length}get parentId(){const e=this.references.find(i.isTagToParentTagReference);return null==e?void 0:e.uuid}static arrayToDisplayString(e){return e.sort(((e,t)=>e.title>t.title?1:-1)).map((e=>"#"+e.title)).join(" ")}}t.SNTag=s},33913:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},74332:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TagMutator=void 0;const r=n(4744),i=n(78961),o=n(14584),s=n(82648);class a extends o.DecryptedItemMutator{constructor(e,t){super(e,t),this.mutablePreferences=this.mutableContent.preferences}set title(e){this.mutableContent.title=e}set expanded(e){this.mutableContent.expanded=e}set iconString(e){this.mutableContent.iconString=e}get preferences(){return this.mutablePreferences||(this.mutableContent.preferences={},this.mutablePreferences=this.mutableContent.preferences),this.mutablePreferences}set preferences(e){this.mutablePreferences=e,this.mutableContent.preferences=this.mutablePreferences}makeChildOf(e){const t=this.immutableItem.references.filter((e=>!(0,r.isTagToParentTagReference)(e))),n={reference_type:i.ContentReferenceType.TagToParentTag,content_type:s.ContentType.TYPES.Tag,uuid:e.uuid};t.push(n),this.mutableContent.references=t}unsetParent(){this.mutableContent.references=this.immutableItem.references.filter((e=>!(0,r.isTagToParentTagReference)(e)))}addFile(e){if(this.immutableItem.isReferencingItem(e))return;const t={reference_type:i.ContentReferenceType.TagToFile,content_type:s.ContentType.TYPES.File,uuid:e.uuid};this.mutableContent.references.push(t)}removeFile(e){this.mutableContent.references=this.mutableContent.references.filter((t=>t.uuid!==e.uuid))}addNote(e){this.immutableItem.isReferencingItem(e)||this.mutableContent.references.push({uuid:e.uuid,content_type:e.content_type})}removeNote(e){this.mutableContent.references=this.mutableContent.references.filter((t=>t.uuid!==e.uuid))}}t.TagMutator=a},72680:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},87458:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(4862),t),i(n(74332),t),i(n(33913),t),i(n(72680),t)},82602:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},63195:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TrustedContactMutator=void 0;const r=n(50292),i=n(68092);class o extends r.DecryptedItemMutator{set name(e){this.mutableContent.name=e}addPublicKey(e){const t=new i.ContactPublicKeySet({encryption:e.encryption,signing:e.signing,timestamp:new Date,previousKeySet:this.immutableItem.publicKeySet});this.mutableContent.publicKeySet=t}replacePublicKeySet(e){this.mutableContent.publicKeySet=e}}t.TrustedContactMutator=o},68092:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContactPublicKeySet=void 0;class n{constructor(e){this.encryption=e.encryption,this.signing=e.signing,this.timestamp=e.timestamp,this.previousKeySet=e.previousKeySet}findKeySetWithSigningKey(e){return this.signing===e?this:this.previousKeySet?this.previousKeySet.findKeySetWithSigningKey(e):void 0}findKeySetWithPublicKey(e){return this.encryption===e?this:this.previousKeySet?this.previousKeySet.findKeySetWithPublicKey(e):void 0}asJson(){return{encryption:this.encryption,signing:this.signing,timestamp:this.timestamp,previousKeySet:this.previousKeySet?this.previousKeySet.asJson():void 0}}mutableCopy(){return new n({encryption:this.encryption,signing:this.signing,timestamp:this.timestamp,previousKeySet:this.previousKeySet?n.FromJson(this.previousKeySet.asJson()):void 0})}static FromJson(e){return new n({encryption:e.encryption,signing:e.signing,timestamp:new Date(e.timestamp),previousKeySet:e.previousKeySet?n.FromJson(e.previousKeySet):void 0})}}t.ContactPublicKeySet=n},21436:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},79609:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TrustedContact=void 0;const r=n(50292),i=n(68092),o=n(78688),s=n(19332);class a extends r.DecryptedItem{constructor(e){super(e),this.name=e.content.name,this.contactUuid=e.content.contactUuid,this.publicKeySet=i.ContactPublicKeySet.FromJson(e.content.publicKeySet),this.isMe=e.content.isMe}get isSingleton(){return!0}singletonPredicate(){return a.singletonPredicate}hasCurrentOrPreviousSigningPublicKey(e){return void 0!==this.publicKeySet.findKeySetWithSigningKey(e)}getTrustStatusForPublicKey(e){return this.publicKeySet.encryption===e?s.PublicKeyTrustStatus.Trusted:this.publicKeySet.findKeySetWithPublicKey(e)?s.PublicKeyTrustStatus.Previous:s.PublicKeyTrustStatus.NotTrusted}getTrustStatusForSigningPublicKey(e){return this.publicKeySet.signing===e?s.PublicKeyTrustStatus.Trusted:this.publicKeySet.findKeySetWithSigningKey(e)?s.PublicKeyTrustStatus.Previous:s.PublicKeyTrustStatus.NotTrusted}strategyWhenConflictingWithItem(e,t){return r.ConflictStrategy.KeepBase}}t.TrustedContact=a,a.singletonPredicate=new o.Predicate("isMe","=",!0)},15845:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5478:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},19332:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PublicKeyTrustStatus=void 0,function(e){e.Trusted="Trusted",e.Previous="Previous",e.NotTrusted="NotTrusted"}(n||(t.PublicKeyTrustStatus=n={}))},79319:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},68933:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EditorFontSize=void 0,function(e){e.ExtraSmall="ExtraSmall",e.Small="Small",e.Normal="Normal",e.Medium="Medium",e.Large="Large"}(n||(t.EditorFontSize=n={}))},97876:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EditorLineHeightValues=t.EditorLineHeight=void 0,function(e){e.None="None",e.Tight="Tight",e.Snug="Snug",e.Normal="Normal",e.Relaxed="Relaxed",e.Loose="Loose"}(n||(t.EditorLineHeight=n={})),t.EditorLineHeightValues={None:1,Tight:1.25,Snug:1.375,Normal:1.5,Relaxed:1.625,Loose:2}},20610:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EditorLineWidth=void 0,function(e){e.Narrow="Narrow",e.Wide="Wide",e.Dynamic="Dynamic",e.FullWidth="FullWidth"}(n||(t.EditorLineWidth=n={}))},23688:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.NewNoteTitleFormat=void 0,function(e){e.CurrentDateAndTime="CurrentDateAndTime",e.CurrentNoteCount="CurrentNoteCount",e.CustomFormat="CustomFormat",e.Empty="Empty"}(n||(t.NewNoteTitleFormat=n={}))},68126:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PrefDefaults=void 0;const r=n(84409),i=n(92207),o=n(68933),s=n(97876),a=n(20610),l=n(70659),c=n(23688);t.PrefDefaults={[l.PrefKey.TagsPanelWidth]:220,[l.PrefKey.NotesPanelWidth]:350,[l.PrefKey.EditorWidth]:null,[l.PrefKey.EditorLeft]:null,[l.PrefKey.DEPRECATED_EditorMonospaceEnabled]:!1,[l.PrefKey.EditorSpellcheck]:!0,[l.PrefKey.EditorResizersEnabled]:!1,[l.PrefKey.DEPRECATED_EditorLineHeight]:s.EditorLineHeight.Normal,[l.PrefKey.DEPRECATED_EditorLineWidth]:a.EditorLineWidth.FullWidth,[l.PrefKey.DEPRECATED_EditorFontSize]:o.EditorFontSize.Normal,[l.PrefKey.SortNotesBy]:i.CollectionSort.CreatedAt,[l.PrefKey.SortNotesReverse]:!1,[l.PrefKey.NotesShowArchived]:!1,[l.PrefKey.NotesShowTrashed]:!1,[l.PrefKey.NotesHidePinned]:!1,[l.PrefKey.NotesHideProtected]:!1,[l.PrefKey.NotesHideNotePreview]:!1,[l.PrefKey.NotesHideDate]:!1,[l.PrefKey.NotesHideTags]:!1,[l.PrefKey.NotesHideEditorIcon]:!1,[l.PrefKey.DEPRECATED_UseSystemColorScheme]:!1,[l.PrefKey.DEPRECATED_UseTranslucentUI]:!0,[l.PrefKey.DEPRECATED_AutoLightThemeIdentifier]:"Default",[l.PrefKey.DEPRECATED_AutoDarkThemeIdentifier]:r.NativeFeatureIdentifier.TYPES.DarkTheme,[l.PrefKey.NoteAddToParentFolders]:!0,[l.PrefKey.NewNoteTitleFormat]:c.NewNoteTitleFormat.CurrentDateAndTime,[l.PrefKey.CustomNoteTitleFormat]:"YYYY-MM-DD [at] hh:mm A",[l.PrefKey.UpdateSavingStatusIndicator]:!0,[l.PrefKey.PaneGesturesEnabled]:!0,[l.PrefKey.MomentsDefaultTagUuid]:void 0,[l.PrefKey.ClipperDefaultTagUuid]:void 0,[l.PrefKey.DefaultEditorIdentifier]:r.NativeFeatureIdentifier.TYPES.PlainEditor,[l.PrefKey.SuperNoteExportFormat]:"json",[l.PrefKey.SuperNoteExportEmbedBehavior]:"reference",[l.PrefKey.SuperNoteExportUseMDFrontmatter]:!0,[l.PrefKey.SuperNoteExportPDFPageSize]:"A4",[l.PrefKey.SystemViewPreferences]:{},[l.PrefKey.AuthenticatorNames]:"",[l.PrefKey.ComponentPreferences]:{},[l.PrefKey.DEPRECATED_ActiveThemes]:[],[l.PrefKey.ActiveComponents]:[],[l.PrefKey.AlwaysShowSuperToolbar]:!0,[l.PrefKey.AddImportsToTag]:!0,[l.PrefKey.AlwaysCreateNewTagForImports]:!0,[l.PrefKey.ExistingTagForImports]:void 0}},70659:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PrefKey=void 0,function(e){e.TagsPanelWidth="tagsPanelWidth",e.NotesPanelWidth="notesPanelWidth",e.EditorWidth="editorWidth",e.EditorLeft="editorLeft",e.EditorSpellcheck="spellcheck",e.EditorResizersEnabled="marginResizersEnabled",e.SortNotesBy="sortBy",e.SortNotesReverse="sortReverse",e.NotesShowArchived="showArchived",e.NotesShowTrashed="showTrashed",e.NotesHideProtected="hideProtected",e.NotesHidePinned="hidePinned",e.NotesHideNotePreview="hideNotePreview",e.NotesHideDate="hideDate",e.NotesHideTags="hideTags",e.NotesHideEditorIcon="hideEditorIcon",e.NoteAddToParentFolders="noteAddToParentFolders",e.NewNoteTitleFormat="newNoteTitleFormat",e.CustomNoteTitleFormat="customNoteTitleFormat",e.UpdateSavingStatusIndicator="updateSavingStatusIndicator",e.DefaultEditorIdentifier="defaultEditorIdentifier",e.MomentsDefaultTagUuid="momentsDefaultTagUuid",e.ClipperDefaultTagUuid="clipperDefaultTagUuid",e.SystemViewPreferences="systemViewPreferences",e.SuperNoteExportFormat="superNoteExportFormat",e.SuperNoteExportEmbedBehavior="superNoteExportEmbedBehavior",e.SuperNoteExportUseMDFrontmatter="superNoteExportUseMDFrontmatter",e.SuperNoteExportPDFPageSize="superNoteExportPDFPageSize",e.AuthenticatorNames="authenticatorNames",e.PaneGesturesEnabled="paneGesturesEnabled",e.ComponentPreferences="componentPreferences",e.ActiveComponents="activeComponents",e.AlwaysShowSuperToolbar="alwaysShowSuperToolbar",e.AddImportsToTag="addImportsToTag",e.AlwaysCreateNewTagForImports="alwaysCreateNewTagForImports",e.ExistingTagForImports="existingTagForImports",e.DEPRECATED_ActiveThemes="activeThemes",e.DEPRECATED_UseSystemColorScheme="useSystemColorScheme",e.DEPRECATED_UseTranslucentUI="useTranslucentUI",e.DEPRECATED_AutoLightThemeIdentifier="autoLightThemeIdentifier",e.DEPRECATED_AutoDarkThemeIdentifier="autoDarkThemeIdentifier",e.DEPRECATED_EditorMonospaceEnabled="monospaceFont",e.DEPRECATED_EditorLineHeight="editorLineHeight",e.DEPRECATED_EditorLineWidth="editorLineWidth",e.DEPRECATED_EditorFontSize="editorFontSize"}(n||(t.PrefKey=n={}))},87070:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SNUserPrefs=void 0;const r=n(82648),i=n(43740),o=n(78688);class s extends i.DecryptedItem{get isSingleton(){return!0}singletonPredicate(){return s.singletonPredicate}getPref(e){return this.getAppDomainValue(e)}}t.SNUserPrefs=s,s.singletonPredicate=new o.Predicate("content_type","=",r.ContentType.TYPES.UserPrefs)},34660:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserPrefsMutator=void 0;const r=n(14584);class i extends r.DecryptedItemMutator{setPref(e,t){this.setAppDataItem(e,t)}}t.UserPrefsMutator=i},53840:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(87070),t),i(n(34660),t),i(n(70659),t),i(n(97876),t),i(n(68933),t),i(n(20610),t),i(n(23688),t),i(n(79319),t),i(n(68126),t)},3396:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VaultListing=t.DefaultVaultIconName=void 0;const r=n(50292);t.DefaultVaultIconName="safe-square";class i extends r.DecryptedItem{constructor(e){super(e),this.systemIdentifier=e.content.systemIdentifier,this.rootKeyParams=e.content.rootKeyParams,this.keyStorageMode=e.content.keyStorageMode,this.name=e.content.name,this.description=e.content.description,this.iconString=e.content.iconString||t.DefaultVaultIconName,this.sharing=e.content.sharing}strategyWhenConflictingWithItem(e,t){const n=this.rootKeyParams.creationTimestamp;return e.rootKeyParams.creationTimestamp>n?r.ConflictStrategy.KeepApply:r.ConflictStrategy.KeepBase}get keyPasswordType(){return this.rootKeyParams.passwordType}isSharedVaultListing(){return null!=this.sharing}get key_system_identifier(){}get shared_vault_uuid(){}}t.VaultListing=i},52897:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},59402:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},82259:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VaultListingMutator=void 0;const r=n(50292);class i extends r.DecryptedItemMutator{set name(e){this.mutableContent.name=e}set description(e){this.mutableContent.description=e}set iconString(e){this.mutableContent.iconString=e}set sharing(e){this.mutableContent.sharing=e}set rootKeyParams(e){this.mutableContent.rootKeyParams=e}set keyStorageMode(e){this.mutableContent.keyStorageMode=e}}t.VaultListingMutator=i},44957:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},53555:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},40249:(e,t)=>{"use strict";function n(e,t){return e.find((e=>e.uuid===t))}Object.defineProperty(t,"__esModule",{value:!0}),t.SureFindItem=t.FindItem=void 0,t.FindItem=n,t.SureFindItem=function(e,t){return n(e,t)}},33545:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ItemContentsDiffer=void 0;const r=n(41035);t.ItemContentsDiffer=function(e,t,n=[]){return!(0,r.ItemContentsEqual)(e.content,t.content,[...e.contentKeysToIgnoreWhenCheckingEquality(),...n],e.appDataContentKeysToIgnoreWhenCheckingEquality())}},41035:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ItemContentsEqual=void 0;const r=n(87901),i=n(71458);t.ItemContentsEqual=function(e,t,n,o){const s=(0,r.sortedCopy)(e);if(s.appData){const e=s.appData[i.DefaultAppDomain];(0,r.omitInPlace)(e,o),e?0===Object.keys(e).length&&delete s.appData:delete s.appData}(0,r.omitInPlace)(s,n);const a=(0,r.sortedCopy)(t);if(a.appData){const e=a.appData[i.DefaultAppDomain];(0,r.omitInPlace)(e,o),e?0===Object.keys(e).length&&delete a.appData:delete a.appData}return(0,r.omitInPlace)(a,n),JSON.stringify(s)===JSON.stringify(a)}},73277:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreateItemFromPayload=t.CreateDecryptedItemFromPayload=t.RegisterItemClass=t.CreateDecryptedMutatorForItem=void 0;const r=n(80406),i=n(86154),o=n(73886),s=n(59020),a=n(35922),l=n(55159),c=n(43740),u=n(2636),d=n(12775),h=n(4862),p=n(87070),f=n(82422),g=n(34660),m=n(27539),y=n(43246),v=n(74332),A=n(39273),b=n(14584),w=n(78438),S=n(41138),C=n(79609),E=n(63195),I=n(82818),_=n(64836),x=n(3396),P=n(82259),k=n(59180),B=n(82648),O={[B.ContentType.TYPES.ActionsExtension]:{itemClass:s.SNActionsExtension,mutatorClass:m.ActionsExtensionMutator},[B.ContentType.TYPES.Component]:{itemClass:a.ComponentItem,mutatorClass:y.ComponentMutator},[B.ContentType.TYPES.KeySystemRootKey]:{itemClass:I.KeySystemRootKey,mutatorClass:_.KeySystemRootKeyMutator},[B.ContentType.TYPES.TrustedContact]:{itemClass:C.TrustedContact,mutatorClass:E.TrustedContactMutator},[B.ContentType.TYPES.VaultListing]:{itemClass:x.VaultListing,mutatorClass:P.VaultListingMutator},[B.ContentType.TYPES.Editor]:{itemClass:l.SNEditor},[B.ContentType.TYPES.ExtensionRepo]:{itemClass:o.SNFeatureRepo},[B.ContentType.TYPES.File]:{itemClass:i.FileItem,mutatorClass:f.FileMutator},[B.ContentType.TYPES.Note]:{itemClass:u.SNNote,mutatorClass:A.NoteMutator},[B.ContentType.TYPES.SmartView]:{itemClass:d.SmartView,mutatorClass:S.SmartViewMutator},[B.ContentType.TYPES.Tag]:{itemClass:h.SNTag,mutatorClass:v.TagMutator},[B.ContentType.TYPES.Theme]:{itemClass:a.ComponentItem,mutatorClass:y.ComponentMutator},[B.ContentType.TYPES.UserPrefs]:{itemClass:p.SNUserPrefs,mutatorClass:g.UserPrefsMutator}};function N(e){const t=O[e.content_type];return new(t?t.itemClass:c.DecryptedItem)(e)}t.CreateDecryptedMutatorForItem=function(e,t){var n;const r=null===(n=O[e.content_type])||void 0===n?void 0:n.mutatorClass;return r?new r(e,t):new b.DecryptedItemMutator(e,t)},t.RegisterItemClass=function(e,t,n){const r={itemClass:t,mutatorClass:n};O[e]=r},t.CreateDecryptedItemFromPayload=N,t.CreateItemFromPayload=function(e){if((0,k.isDecryptedPayload)(e))return N(e);if((0,k.isEncryptedPayload)(e))return new r.EncryptedItem(e);if((0,k.isDeletedPayload)(e))return new w.DeletedItem(e);throw Error("Unhandled case in CreateItemFromPayload")}},74527:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopyPayloadWithContentOverride=void 0;const r=n(88141);t.CopyPayloadWithContentOverride=function(e,t){const n=Object.assign(Object.assign({},e.ejected()),{content:Object.assign(Object.assign({},e.content),t)});return(0,r.CreatePayload)(n,e.source)}},88141:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreatePayload=void 0;const r=n(86731),i=n(452),o=n(89262),s=n(78381);t.CreatePayload=function(e,t){if((0,s.isDecryptedTransferPayload)(e))return new o.DecryptedPayload(e,t);if((0,s.isEncryptedTransferPayload)(e))return new r.EncryptedPayload(e,t);if((0,s.isDeletedTransferPayload)(e))return new i.DeletedPayload(e,t);throw Error("Unhandled case in CreatePayload")}},15658:(e,t)=>{"use strict";function n(e,t){return e.find((e=>e.uuid===t))}Object.defineProperty(t,"__esModule",{value:!0}),t.SureFindPayload=t.FindPayload=void 0,t.FindPayload=n,t.SureFindPayload=function(e,t){return n(e,t)}},37807:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadContentsEqual=void 0;const r=n(73277);t.PayloadContentsEqual=function(e,t){const n=(0,r.CreateDecryptedItemFromPayload)(e),i=(0,r.CreateDecryptedItemFromPayload)(t);return n.isItemContentEqualWith(i)}},50723:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreateNonDecryptedPayloadSplit=t.CreatePayloadSplitWithDiscardables=t.CreatePayloadSplit=void 0;const r=n(13566);t.CreatePayloadSplit=function(e){const t={encrypted:[],decrypted:[],deleted:[]};for(const n of e)if((0,r.isDecryptedPayload)(n))t.decrypted.push(n);else if((0,r.isEncryptedPayload)(n))t.encrypted.push(n);else{if(!(0,r.isDeletedPayload)(n))throw Error("Unhandled case in CreatePayloadSplit");t.deleted.push(n)}return t},t.CreatePayloadSplitWithDiscardables=function(e){const t={encrypted:[],decrypted:[],deleted:[],discardable:[]};for(const n of e)if((0,r.isDecryptedPayload)(n))t.decrypted.push(n);else if((0,r.isEncryptedPayload)(n))t.encrypted.push(n);else{if(!(0,r.isDeletedPayload)(n))throw Error("Unhandled case in CreatePayloadSplitWithDiscardables");n.discardable?t.discardable.push(n):t.deleted.push(n)}return t},t.CreateNonDecryptedPayloadSplit=function(e){const t={encrypted:[],deleted:[]};for(const n of e)if((0,r.isEncryptedPayload)(n))t.encrypted.push(n);else{if(!(0,r.isDeletedPayload)(n))throw Error("Unhandled case in CreateNonDecryptedPayloadSplit");t.deleted.push(n)}return t}},15005:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadsByAlternatingUuid=void 0;const r=n(452),i=n(87901),o=n(13566),s=n(72208),a=n(13743),l=n(82648);t.PayloadsByAlternatingUuid=function(e,t){const n=[],c=e.copyAsSyncResolved({uuid:i.UuidGenerator.GenerateUuid(),dirty:!0,dirtyIndex:(0,a.getIncrementedDirtyIndex)(),lastSyncBegan:void 0,lastSyncEnd:new Date,duplicate_of:e.uuid});n.push(c);const u=(0,s.PayloadsByUpdatingReferencingPayloadReferences)(e,t,[c],[e.uuid]);if((0,i.extendArray)(n,u),e.content_type===l.ContentType.TYPES.ItemsKey){const r=t.all().filter((t=>(0,o.isEncryptedPayload)(t)&&t.items_key_id===e.uuid)).map((e=>e.copyAsSyncResolved({items_key_id:c.uuid,dirty:!0,dirtyIndex:(0,a.getIncrementedDirtyIndex)(),lastSyncEnd:new Date})));r.length>0&&(0,i.extendArray)(n,r)}const d=new r.DeletedPayload({created_at:e.created_at,updated_at:e.updated_at,created_at_timestamp:e.created_at_timestamp,updated_at_timestamp:e.updated_at_timestamp,dirty:!1,content:void 0,uuid:e.uuid,content_type:e.content_type,deleted:!0},e.source);return n.push(d),n}},27446:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadsByDuplicating=void 0;const r=n(87901),i=n(72208),o=n(13566),s=n(13743);t.PayloadsByDuplicating=function(e){const{payload:t,baseCollection:n,isConflict:a,additionalContent:l,source:c}=e,u=[],d={uuid:r.UuidGenerator.GenerateUuid(),dirty:!0,dirtyIndex:(0,s.getIncrementedDirtyIndex)(),lastSyncBegan:void 0,lastSyncEnd:new Date,duplicate_of:t.uuid};let h;if((0,o.isDecryptedPayload)(t)){const e=Object.assign(Object.assign({},t.content),l);a&&(e.conflict_of=t.uuid),h=t.copyAsSyncResolved(Object.assign(Object.assign({},d),{content:e,deleted:!1}))}else h=t.copyAsSyncResolved(Object.assign({},d),c||t.source);if(u.push(h),(0,o.isDecryptedPayload)(t)&&(0,o.isDecryptedPayload)(h)){const e=(0,i.PayloadsByUpdatingReferencingPayloadReferences)(t,n,[h]);(0,r.extendArray)(u,e)}return u}},72208:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadsByUpdatingReferencingPayloadReferences=void 0;const r=n(76635),i=n(59180),o=n(13743);t.PayloadsByUpdatingReferencingPayloadReferences=function(e,t,n=[],s=[]){const a=t.elementsReferencingElement(e).filter(i.isDecryptedPayload),l=[];for(const t of a){const i=t.content.references.slice(),a=t.getReference(e.uuid);for(const e of n){const t=Object.assign(Object.assign({},a),{uuid:e.uuid,content_type:e.content_type});i.push(t)}for(const e of s)(0,r.remove)(i,{uuid:e});const c=t.copyAsSyncResolved({dirty:!0,dirtyIndex:(0,o.getIncrementedDirtyIndex)(),lastSyncEnd:new Date,content:Object.assign(Object.assign({},t.content),{references:i})});l.push(c)}return l}},64475:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(56974),t),i(n(15866),t),i(n(35376),t),i(n(76317),t),i(n(88076),t),i(n(68763),t),i(n(75895),t),i(n(74601),t),i(n(3668),t),i(n(42405),t),i(n(95698),t),i(n(55930),t),i(n(36186),t),i(n(80537),t),i(n(1482),t),i(n(69087),t),i(n(70359),t),i(n(13214),t),i(n(84034),t),i(n(51600),t),i(n(30429),t),i(n(18592),t),i(n(2116),t),i(n(18973),t),i(n(7563),t),i(n(50292),t),i(n(59180),t),i(n(78381),t),i(n(21907),t),i(n(66675),t),i(n(90656),t),i(n(93715),t),i(n(84457),t),i(n(656),t),i(n(255),t),i(n(62846),t),i(n(29899),t),i(n(22296),t),i(n(52174),t),i(n(80910),t),i(n(87192),t),i(n(71109),t),i(n(32099),t),i(n(55430),t),i(n(33738),t),i(n(64130),t),i(n(18018),t),i(n(14770),t),i(n(45698),t),i(n(63070),t),i(n(32151),t),i(n(92207),t),i(n(36883),t),i(n(17441),t),i(n(51833),t),i(n(19759),t),i(n(22517),t),i(n(13743),t),i(n(30561),t),i(n(40257),t),i(n(93974),t),i(n(96084),t),i(n(87332),t),i(n(21662),t),i(n(47469),t),i(n(74958),t),i(n(36053),t),i(n(18284),t),i(n(78274),t),i(n(47479),t),i(n(21626),t),i(n(8698),t),i(n(26550),t),i(n(80389),t),i(n(21271),t),i(n(21271),t),i(n(73067),t),i(n(21014),t),i(n(78688),t),i(n(58506),t),i(n(40826),t),i(n(52659),t),i(n(10123),t),i(n(12310),t),i(n(25698),t),i(n(87500),t),i(n(2836),t),i(n(52493),t),i(n(82412),t),i(n(23811),t),i(n(19725),t),i(n(82818),t),i(n(95132),t),i(n(31750),t),i(n(64836),t),i(n(28819),t),i(n(42006),t),i(n(41138),t),i(n(87458),t),i(n(82602),t),i(n(63195),t),i(n(68092),t),i(n(21436),t),i(n(79609),t),i(n(15845),t),i(n(5478),t),i(n(19332),t),i(n(53840),t),i(n(3396),t),i(n(52897),t),i(n(59402),t),i(n(82259),t),i(n(44957),t),i(n(53555),t),i(n(40249),t),i(n(33545),t),i(n(41035),t),i(n(73277),t),i(n(74527),t),i(n(88141),t),i(n(15658),t),i(n(37807),t),i(n(15005),t),i(n(27446),t),i(n(50723),t)},22325:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(64475),t)},34789:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},88645:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},29590:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},77345:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},79594:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},81563:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},29547:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},89398:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},41278:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},48126:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},60346:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},39881:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},11706:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},74113:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},68224:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},14116:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},22893:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},94764:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isClientDisplayableError=t.ClientDisplayableError=void 0;const r=n(92961);class i{constructor(e,t,n){this.text=e,this.title=t,this.tag=n,console.error("Client Displayable Error:",e,t||"",n||"")}static FromError(e){return new i(e.message,void 0,e.tag)}static FromString(e){return new i(e)}static FromNetworkError(e){return new i((0,r.getErrorFromErrorResponse)(e).message)}}t.ClientDisplayableError=i,t.isClientDisplayableError=function(e){return e instanceof i}},89408:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},23632:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},37525:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},22039:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43129:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},27196:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43630:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},53980:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},46707:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},13838:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},95573:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},42338:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},32176:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DeprecatedStatusCode=void 0,function(e){e[e.LocalValidationError=10]="LocalValidationError",e[e.CanceledMfa=11]="CanceledMfa",e[e.HttpStatusMinSuccess=200]="HttpStatusMinSuccess",e[e.HttpStatusNoContent=204]="HttpStatusNoContent",e[e.HttpStatusMaxSuccess=299]="HttpStatusMaxSuccess",e[e.HttpStatusExpiredAccessToken=498]="HttpStatusExpiredAccessToken",e[e.HttpStatusInvalidSession=401]="HttpStatusInvalidSession",e[e.HttpStatusForbidden=403]="HttpStatusForbidden",e[e.HttpBadRequest=400]="HttpBadRequest"}(n||(t.DeprecatedStatusCode=n={}))},67545:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorTag=void 0,function(e){e.MfaInvalid="mfa-invalid",e.MfaRequired="mfa-required",e.U2FRequired="u2f-required",e.RefreshTokenInvalid="invalid-refresh-token",e.RefreshTokenExpired="expired-refresh-token",e.AccessTokenExpired="expired-access-token",e.ParametersInvalid="invalid-parameters",e.RevokedSession="revoked-session",e.AuthInvalid="invalid-auth",e.ReadOnlyAccess="read-only-access",e.ExpiredItemShare="expired-item-share",e.ClientValidationError="client-validation-error",e.ClientCanceledMfa="client-canceled-mfa"}(n||(t.ErrorTag=n={}))},64404:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},48379:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},11910:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},44323:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},53251:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},23269:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorFromErrorResponse=t.getErrorMessageFromErrorResponseBody=t.getCaptchaHeader=t.isErrorResponse=void 0,t.isErrorResponse=function(e){var t;return null!=(null===(t=e.data)||void 0===t?void 0:t.error)||e.status>=400},t.getCaptchaHeader=function(e){var t;return(null===(t=e.headers)||void 0===t?void 0:t.get("x-captcha-required"))||null},t.getErrorMessageFromErrorResponseBody=function(e,t){let n=t||"Unknown error";return e&&"object"==typeof e&&"error"in e&&e.error&&"object"==typeof e.error&&"message"in e.error&&(n=e.error.message),n},t.getErrorFromErrorResponse=function(e){return e.data.error||{message:"Unknown error"}}},58009:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},95778:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.HttpStatusCode=void 0,function(e){e[e.Success=200]="Success",e[e.NoContent=204]="NoContent",e[e.MultipleChoices=300]="MultipleChoices",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.Forbidden=403]="Forbidden",e[e.Gone=410]="Gone",e[e.ExpiredAccessToken=498]="ExpiredAccessToken",e[e.InternalServerError=500]="InternalServerError"}(n||(t.HttpStatusCode=n={}))},37204:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.HttpVerb=void 0,function(e){e.Get="GET",e.Post="POST",e.Put="PUT",e.Patch="PATCH",e.Delete="DELETE"}(n||(t.HttpVerb=n={}))},92961:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(67545),t),i(n(48379),t),i(n(11910),t),i(n(44323),t),i(n(53251),t),i(n(23269),t),i(n(58009),t),i(n(37204),t),i(n(46707),t),i(n(13838),t),i(n(95573),t),i(n(42338),t),i(n(32176),t),i(n(95778),t),i(n(64404),t)},72646:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ApiEndpointParam=void 0,function(e){e.LastSyncToken="sync_token",e.PaginationToken="cursor_token",e.SyncDlLimit="limit",e.SyncPayloads="items",e.ApiVersion="api",e.SharedVaultUuids="shared_vault_uuids"}(n||(t.ApiEndpointParam=n={}))},21799:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6579:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.conflictParamsHasOnlyUnsavedItem=t.conflictParamsHasOnlyServerItem=t.conflictParamsHasServerItemAndUnsavedItem=void 0,t.conflictParamsHasServerItemAndUnsavedItem=function(e){return void 0!==e.server_item&&void 0!==e.unsaved_item},t.conflictParamsHasOnlyServerItem=function(e){return void 0!==e.server_item},t.conflictParamsHasOnlyUnsavedItem=function(e){return void 0!==e.unsaved_item}},68655:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ConflictType=void 0,function(e){e.ConflictingData="sync_conflict",e.UuidConflict="uuid_conflict",e.ContentTypeError="content_type_error",e.ContentError="content_error",e.ReadOnlyError="readonly_error",e.UuidError="uuid_error",e.InvalidServerItem="invalid_server_item",e.SharedVaultSnjsVersionError="shared_vault_snjs_version_error",e.SharedVaultInsufficientPermissionsError="shared_vault_insufficient_permissions_error",e.SharedVaultNotMemberError="shared_vault_not_member_error",e.SharedVaultInvalidState="shared_vault_invalid_state"}(n||(t.ConflictType=n={}))},95833:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},46911:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},20459:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(72646)},74397:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},80653:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},96579:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},42374:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},51658:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},22487:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},20421:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},20780:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},34455:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6976:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1539:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},81526:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},13177:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},86682:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2564:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ValetTokenOperation=void 0,function(e){e.Read="read",e.Write="write",e.Delete="delete",e.Move="move"}(n||(t.ValetTokenOperation=n={}))},98819:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9283:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},39805:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},28022:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},80933:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},22906:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},65802:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},44877:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},13562:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},23324:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},35956:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88645),t),i(n(29590),t),i(n(77345),t),i(n(79594),t),i(n(29547),t),i(n(89398),t),i(n(41278),t),i(n(48126),t),i(n(60346),t),i(n(39881),t),i(n(11706),t),i(n(74113),t),i(n(68224),t),i(n(14116),t),i(n(22893),t),i(n(81563),t),i(n(13177),t),i(n(86682),t),i(n(2564),t),i(n(81526),t),i(n(94764),t),i(n(89408),t),i(n(23632),t),i(n(37525),t),i(n(22039),t),i(n(43129),t),i(n(43630),t),i(n(53980),t),i(n(27196),t),i(n(92961),t),i(n(34455),t),i(n(1539),t),i(n(6976),t),i(n(34789),t),i(n(72646),t),i(n(21799),t),i(n(6579),t),i(n(68655),t),i(n(95833),t),i(n(20459),t),i(n(74397),t),i(n(80653),t),i(n(46911),t),i(n(96579),t),i(n(42374),t),i(n(51658),t),i(n(22487),t),i(n(20421),t),i(n(98819),t),i(n(9283),t),i(n(39805),t),i(n(28022),t),i(n(80933),t),i(n(22906),t),i(n(65802),t),i(n(44877),t),i(n(13562),t),i(n(23324),t),i(n(20780),t),i(n(34455),t),i(n(6976),t),i(n(1539),t)},95658:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(35956),t)},32105:(e,t,n)=>{"use strict";var r,i,o,s,a;n.d(t,{mvL:()=>k,wcN:()=>y,c9N:()=>l,n9K:()=>I,Ugm:()=>v,L$3:()=>r,tv4:()=>T,FEo:()=>R,Ps8:()=>O,NiJ:()=>B,tQn:()=>N,iKc:()=>ee,dH$:()=>ie,Hh3:()=>ae,rW4:()=>ve,QtK:()=>d,qt7:()=>ce,h21:()=>ke}),(o=r||(r={}))[o.Info=0]="Info",o[o.Danger=1]="Danger";class l{showErrorAlert(e){return this.alert(e.text,e.title)}}!function(e){e.MetaReceived="MetaReceived",e.SessionRefreshed="SessionRefreshed"}(i||(i={})),n(95658),(a=s||(s={})).UserRoleMessageReceived="WebSocketMessageReceived",a.NotificationAddedForUser="NotificationAddedForUser",a.MessageSentToUser="MessageSentToUser",a.UserInvitedToSharedVault="UserInvitedToSharedVault",a.ItemsChangedOnServer="ItemsChangedOnServer";var c,u,d,h,p,f,g,m=n(87901);(p=c||(c={})).ASYNC="ASYNC",p.SEQUENCE="SEQUENCE";class y{constructor(e){this.internalEventBus=e,this.eventObservers=[],this.loggingEnabled=!1,this.criticalPromises=[],this.eventDisposers=[]}addEventObserver(e){this.eventObservers.push(e);const t=this.eventObservers;return()=>{(0,m.removeFromArray)(t,e)}}async notifyEvent(e,t){var n;for(const n of this.eventObservers)await n(e,t);null===(n=this.internalEventBus)||void 0===n||n.publish({type:e,payload:t})}async notifyEventSync(e,t){var n;for(const n of this.eventObservers)await n(e,t);await(null===(n=this.internalEventBus)||void 0===n?void 0:n.publishSync({type:e,payload:t},c.SEQUENCE))}getDiagnostics(){return Promise.resolve(void 0)}async blockDeinit(){await Promise.all(this.criticalPromises)}deinit(){this.eventObservers.length=0,this.internalEventBus=void 0,this.criticalPromises=void 0;for(const e of this.eventDisposers)e();this.eventDisposers=[]}async executeCriticalFunction(e){const t=e();return this.criticalPromises.push(t),t}getServiceName(){return this.constructor.name}isApplicationService(){return!0}}(g=u||(u={})).StorageObject="storage",g.DescriptorRecord="descriptors",g.SnjsVersion="snjs_version",g.HomeServerEnabled="home_server_enabled",g.HomeServerDataLocation="home_serve_data_location",(f=d||(d={})).RootKeyParams="ROOT_KEY_PARAMS",f.WrappedRootKey="WRAPPED_ROOT_KEY",f.RootKeyWrapperKeyParams="ROOT_KEY_WRAPPER_KEY_PARAMS",f.Session="session",f.User="user",f.ServerHost="server",f.LegacyUuid="uuid",f.LastSyncToken="syncToken",f.PaginationToken="cursorToken",f.BiometricsState="biometrics_state",f.MobilePasscodeTiming="passcode_timing",f.MobileBiometricsTiming="biometrics_timing",f.MobilePasscodeKeyboardType="passcodeKeyboardType",f.MobilePreferences="preferences",f.MobileScreenshotPrivacyEnabled="screenshotPrivacy_enabled",f.ProtectionExpirey="SessionExpiresAtKey",f.ProtectionSessionLength="SessionLengthKey",f.KeyRecoveryUndecryptableItems="key_recovery_undecryptable",f.WebSocketUrl="webSocket_url",f.UserRoles="user_roles",f.OfflineUserRoles="offline_user_roles",f.ExperimentalFeatures="experimental_features",f.DeinitMode="deinit_mode",f.CodeVerifier="code_verifier",f.LaunchPriorityUuids="launch_priority_uuids",f.LastReadChangelogVersion="last_read_changelog_version",f.MomentsEnabled="moments_enabled",f.TextBackupsEnabled="text_backups_enabled",f.TextBackupsLocation="text_backups_location",f.PlaintextBackupsEnabled="plaintext_backups_enabled",f.PlaintextBackupsLocation="plaintext_backups_location",f.FileBackupsEnabled="file_backups_enabled",f.FileBackupsLocation="file_backups_location",f.VaultSelectionOptions="vault_selection_options",f.Subscription="subscription",f.LocalPreferences="local_preferences",function(e){e.MobileFirstRun="first_run"}(h||(h={}));var v,A,b,w,S,C=n(82648);(S=v||(v={}))[S.PreparingForLaunch_0=0]="PreparingForLaunch_0",S[S.ReadyForLaunch_05=.5]="ReadyForLaunch_05",S[S.StorageDecrypted_09=.9]="StorageDecrypted_09",S[S.Launched_10=1]="Launched_10",S[S.LoadingDatabase_11=1.1]="LoadingDatabase_11",S[S.LoadedDatabase_12=1.2]="LoadedDatabase_12",S[S.FullSyncCompleted_13=1.3]="FullSyncCompleted_13",S[S.SignedIn_30=3]="SignedIn_30",function(e){e.Soft="Soft",e.Hard="Hard"}(A||(A={})),(w=b||(b={}))[w.SignOut=1]="SignOut",w[w.Lock=2]="Lock",w[w.SwitchWorkspace=3]="SwitchWorkspace",w[w.SignOutAll=4]="SignOutAll";var E,I,_,x,P=n(22325);(_=E||(E={})).SyncCompletedWithAllItemsUploaded="SyncCompletedWithAllItemsUploaded",_.SyncCompletedWithAllItemsUploadedAndDownloaded="SyncCompletedWithAllItemsUploadedAndDownloaded",_.PaginatedSyncRequestCompleted="PaginatedSyncRequestCompleted",_.SyncDidBeginProcessing="sync:did-begin-processing",_.DownloadFirstSyncCompleted="sync:download-first-completed",_.SyncTakingTooLong="sync:taking-too-long",_.SyncError="sync:error",_.InvalidSession="sync:invalid-session",_.MajorDataChange="major-data-change",_.LocalDataIncrementalLoad="local-data-incremental-load",_.LocalDataLoaded="local-data-loaded",_.EnterOutOfSync="enter-out-of-sync",_.ExitOutOfSync="exit-out-of-sync",_.StatusChanged="status-changed",_.DatabaseWriteError="database-write-error",_.DatabaseReadError="database-read-error",_.SyncRequestsIntegrityCheck="sync:requests-integrity-check",_.ReceivedRemoteSharedVaults="received-shared-vaults",_.ReceivedSharedVaultInvites="received-shared-vault-invites",_.ReceivedNotifications="received-user-events",_.ReceivedAsymmetricMessages="received-asymmetric-messages",_.TooManyRequests="too-many-requests",(x=I||(I={})).SignedIn="Application:SignedIn",x.SignedOut="Application:SignedOut",x.CompletedFullSync="Application:CompletedFullSync",x.FailedSync="Application:FailedSync",x.HighLatencySync="Application:HighLatencySync",x.EnteredOutOfSync="Application:EnteredOutOfSync",x.ExitedOutOfSync="Application:ExitedOutOfSync",x.ApplicationStageChanged="Application:ApplicationStageChanged",x.Started="Application:Started",x.Launched="Application:Launched",x.LocalDataLoaded="Application:LocalDataLoaded",x.KeyStatusChanged="Application:KeyStatusChanged",x.MajorDataChange="Application:MajorDataChange",x.CompletedRestart="Application:CompletedRestart",x.LocalDataIncrementalLoad="Application:LocalDataIncrementalLoad",x.SyncStatusChanged="Application:SyncStatusChanged",x.WillSync="Application:WillSync",x.InvalidSyncSession="Application:InvalidSyncSession",x.LocalDatabaseReadError="Application:LocalDatabaseReadError",x.LocalDatabaseWriteError="Application:LocalDatabaseWriteError",x.CompletedIncrementalSync="Application:CompletedIncrementalSync",x.MigrationsLoaded="Application:MigrationsLoaded",x.StorageReady="Application:StorageReady",x.PreferencesChanged="Application:PreferencesChanged",x.LocalPreferencesChanged="Application:LocalPreferencesChanged",x.UnprotectedSessionBegan="Application:UnprotectedSessionBegan",x.UserRolesChanged="Application:UserRolesChanged",x.FeaturesAvailabilityChanged="Application:FeaturesAvailabilityChanged",x.UnprotectedSessionExpired="Application:UnprotectedSessionExpired",x.CompletedInitialSync="Application:CompletedInitialSync",x.DidPurchaseSubscription="Application:DidPurchaseSubscription",x.SyncTooManyRequests="Application:SyncTooManyRequests",n(84409);const k="Error downloading package details. Please check the\n  extension link and try again.",B={UnlockApplication:"Authentication is required to unlock the application",NoteAccess:"Authentication is required to view this note",FileAccess:"Authentication is required to access this file",ImportFile:"Authentication is required to import a backup file",AddPasscode:"Authentication is required to add a passcode",RemovePasscode:"Authentication is required to remove your passcode",ChangePasscode:"Authentication is required to change your passcode",ChangeAutolockInterval:"Authentication is required to change autolock timer duration",RevokeSession:"Authentication is required to revoke a session",EnterAccountPassword:"Enter your account password",EnterLocalPasscode:"Enter your application passcode",EnterPasscodeForMigration:"Your application passcode is required to perform an upgrade of your local data storage structure.",EnterPasscodeForRootResave:"Enter your application passcode to continue",EnterCredentialsForProtocolUpgrade:"Enter your credentials to perform encryption upgrade",EnterCredentialsForDecryptedBackupDownload:"Enter your credentials to download a decrypted backup",AccountPasswordPlaceholder:"Account Password",LocalPasscodePlaceholder:"Application Passcode",DecryptEncryptedFile:"Enter the account password associated with the import file",ExportBackup:"Authentication is required to export a backup",DisableBiometrics:"Authentication is required to disable biometrics",UnprotectNote:"Authentication is required to unprotect a note",UnprotectFile:"Authentication is required to unprotect a file",SearchProtectedNotesText:"Authentication is required to search protected contents",SelectProtectedNote:"Authentication is required to select a protected note",DisableMfa:"Authentication is required to disable two-factor authentication",DeleteAccount:"Authentication is required to delete your account",ListedAuthorization:"Authentication is required to approve this note for Listed",UnlockVault:e=>`Unlock ${e}`,DeleteVault:e=>`Delete ${e}`,EnterVaultPassword:"Enter the password for this vault"};var O,N,D,j;(D=O||(O={}))[D.AccessProtectedFile=0]="AccessProtectedFile",D[D.AccessProtectedNote=1]="AccessProtectedNote",D[D.AddPasscode=2]="AddPasscode",D[D.ApplicationUnlock=3]="ApplicationUnlock",D[D.ChangeAutolockInterval=4]="ChangeAutolockInterval",D[D.ChangePasscode=5]="ChangePasscode",D[D.CreateDecryptedBackupWithProtectedItems=6]="CreateDecryptedBackupWithProtectedItems",D[D.Custom=7]="Custom",D[D.DecryptEncryptedFile=8]="DecryptEncryptedFile",D[D.DisableBiometrics=9]="DisableBiometrics",D[D.DisableMfa=10]="DisableMfa",D[D.ExportBackup=11]="ExportBackup",D[D.ImportFile=12]="ImportFile",D[D.Migration=13]="Migration",D[D.ProtocolUpgrade=14]="ProtocolUpgrade",D[D.RemovePasscode=15]="RemovePasscode",D[D.ResaveRootKey=16]="ResaveRootKey",D[D.RevokeSession=17]="RevokeSession",D[D.SearchProtectedNotesText=18]="SearchProtectedNotesText",D[D.SelectProtectedNote=19]="SelectProtectedNote",D[D.UnprotectFile=20]="UnprotectFile",D[D.UnprotectNote=21]="UnprotectNote",D[D.DeleteAccount=22]="DeleteAccount",D[D.AuthorizeNoteForListed=23]="AuthorizeNoteForListed";class T{constructor(e,t,n,r,i){this.prompts=e,this.reason=t,this.cancelable=n,this._heading=r,this._subheading=i,this.id=Math.random()}get modalTitle(){return this.reason===O.Migration?"Storage Update":"Authentication Required"}get heading(){if(this._heading)return this._heading;switch(this.reason){case O.ApplicationUnlock:return B.UnlockApplication;case O.Migration:return B.EnterLocalPasscode;case O.ResaveRootKey:return B.EnterPasscodeForRootResave;case O.ProtocolUpgrade:return B.EnterCredentialsForProtocolUpgrade;case O.AccessProtectedNote:return B.NoteAccess;case O.AccessProtectedFile:return B.FileAccess;case O.ImportFile:return B.ImportFile;case O.AddPasscode:return B.AddPasscode;case O.RemovePasscode:return B.RemovePasscode;case O.ChangePasscode:return B.ChangePasscode;case O.ChangeAutolockInterval:return B.ChangeAutolockInterval;case O.CreateDecryptedBackupWithProtectedItems:return B.EnterCredentialsForDecryptedBackupDownload;case O.RevokeSession:return B.RevokeSession;case O.DecryptEncryptedFile:return B.DecryptEncryptedFile;case O.ExportBackup:return B.ExportBackup;case O.DisableBiometrics:return B.DisableBiometrics;case O.UnprotectNote:return B.UnprotectNote;case O.UnprotectFile:return B.UnprotectFile;case O.SearchProtectedNotesText:return B.SearchProtectedNotesText;case O.SelectProtectedNote:return B.SelectProtectedNote;case O.DisableMfa:return B.DisableMfa;case O.DeleteAccount:return B.DeleteAccount;case O.AuthorizeNoteForListed:return B.ListedAuthorization;case O.Custom:return"";default:return(0,m.assertUnreachable)(this.reason)}}get subheading(){return this._subheading?this._subheading:this.reason===O.Migration?B.EnterPasscodeForMigration:void 0}hasPromptForValidationType(e){for(const t of this.prompts)if(t.validation===e)return!0;return!1}}(j=N||(N={}))[j.None=0]="None",j[j.LocalPasscode=1]="LocalPasscode",j[j.AccountPassword=2]="AccountPassword",j[j.Biometric=3]="Biometric",j[j.ProtectionSessionDuration=4]="ProtectionSessionDuration",j[j.Authenticator=5]="Authenticator";const M="Account Password",F="Application Passcode";class R{constructor(e,t,n,r=!0,i,o,s){switch(this.validation=e,this.secureTextEntry=r,this.keyboardType=i,this.initialValue=o,this.contextData=s,this.id=Math.random(),this.validation){case N.AccountPassword:this.title=null!=t?t:M,this.placeholder=null!=n?n:M,this.validates=!0;break;case N.LocalPasscode:this.title=null!=t?t:F,this.placeholder=null!=n?n:F,this.validates=!0;break;case N.Biometric:this.title=null!=t?t:"Biometrics",this.placeholder=null!=n?n:"",this.validates=!0;break;case N.Authenticator:this.title=null!=t?t:"Security Key",this.placeholder=null!=n?n:"",this.validates=!0;break;case N.ProtectionSessionDuration:this.title=null!=t?t:"Remember For",this.placeholder=null!=n?n:"",this.validates=!0;break;case N.None:this.title=null!=t?t:"",this.placeholder=null!=n?n:"",this.validates=!1;break;default:(0,m.assertUnreachable)(this.validation)}Object.freeze(this)}}var L,Q,U,V,K,H;!function(e){e.Alphanumeric="default",e.Numeric="numeric"}(L||(L={})),function(e){e.OfflineRestricted="OfflineRestricted",e.MissingUrl="MissingUrl"}(Q||(Q={})),U||(U={}),(V||(V={})).Vaults="vaults",(H=K||(K={})).NotApplicable="NotApplicable",H.Trusted="Trusted",H.SignedWithNonCurrentKey="SignedWithNonCurrentKey",H.NotTrusted="NotTrusted";var G=n(98418);const Y=Object.freeze({SaltSeedLength:128,PbkdfMinCost:3e3,PbkdfCostsUsed:[3e3,5e3,1e4,6e4],PbkdfOutputLength:512,EncryptionKeyLength:256});var z,Z,W,q,J,X,$,ee,te,ne,re,ie,oe,se,ae,le,ce,ue,de,he,pe,fe,ge,me,ye,ve,Ae,be,we,Se,Ce,Ee,Ie,_e,xe,Pe,ke,Be,Oe,Ne,De;Object.freeze({SaltSeedLength:128,PbkdfMinCost:3e3,PbkdfCostsUsed:Y.PbkdfCostsUsed.concat([1e5,101e3,102e3,103e3]),ImprobablePbkdfCostsUsed:[3e3,5e3],PbkdfOutputLength:768,EncryptionKeyLength:256,EncryptionIvLength:128}),Object.freeze({SaltSeedLength:256,PbkdfCost:11e4,PbkdfOutputLength:768,EncryptionKeyLength:256,EncryptionIvLength:128}),Object.freeze({ArgonSaltSeedLength:256,ArgonSaltLength:128,ArgonIterations:5,ArgonMemLimit:67108864,ArgonOutputKeyBytes:64,EncryptionKeyLength:256,EncryptionNonceLength:192,AsymmetricEncryptionNonceLength:192,MasterKeyEncryptionKeyPairSubKeyNumber:1,MasterKeyEncryptionKeyPairSubKeyContext:"sn-pkc-e",MasterKeyEncryptionKeyPairSubKeyBytes:G.SodiumConstant.crypto_box_SEEDBYTES,MasterKeySigningKeyPairSubKeyNumber:2,MasterKeySigningKeyPairSubKeyContext:"sn-pkc-s",MasterKeySigningKeyPairSubKeyBytes:G.SodiumConstant.crypto_sign_SEEDBYTES,PayloadKeyHashingKeySubKeyNumber:1,PayloadKeyHashingKeySubKeyContext:"sn-sym-h",PayloadKeyHashingKeySubKeyBytes:G.SodiumConstant.crypto_generichash_KEYBYTES}),(Z=z||(z={})).Encrypted="Encrypted",Z.EncryptedWithNonEncryptedItemsKey="EncryptedWithNonEncryptedItemsKey",Z.FullyDecrypted="FullyDecrypted",Z.Corrupt="Corrupt";class je extends P.DecryptedItem{constructor(e){super(e),this.keyVersion=e.content.version,this.isDefault=e.content.isDefault,this.itemsKey=this.payload.content.itemsKey}strategyWhenConflictingWithItem(e,t){return P.ConflictStrategy.KeepBase}get dataAuthenticationKey(){if(this.keyVersion===P.ProtocolVersion.V004)throw"Attempting to access legacy data authentication key.";return this.payload.content.dataAuthenticationKey}}class Te extends P.DecryptedItemMutator{set isDefault(e){this.mutableContent.isDefault=e}}(0,P.RegisterItemClass)(C.ContentType.TYPES.ItemsKey,je,Te);class Me extends P.DecryptedItem{constructor(e){super(e),this.creationTimestamp=e.content.creationTimestamp,this.keyVersion=e.content.version,this.itemsKey=this.payload.content.itemsKey,this.rootKeyToken=this.payload.content.rootKeyToken}strategyWhenConflictingWithItem(e,t){return P.ConflictStrategy.KeepBase}}class Fe extends P.DecryptedItemMutator{}(0,P.RegisterItemClass)(C.ContentType.TYPES.KeySystemItemsKey,Me,Fe),n(20875),(W||(W={})).RootKeyStatusChanged="RootKeyStatusChanged",(q||(q={})).RootKeyManagerKeyStatusChanged="RootKeyManagerKeyStatusChanged",(te=J||(J={}))[te.RootKeyNone=0]="RootKeyNone",te[te.RootKeyOnly=1]="RootKeyOnly",te[te.RootKeyPlusWrapper=2]="RootKeyPlusWrapper",te[te.WrapperOnly=3]="WrapperOnly",function(e){e.NewUpdateAvailable="NewUpdateAvailable",e.EditorDidFocus="EditorDidFocus",e.BeganBackupDownload="BeganBackupDownload",e.EndedBackupDownload="EndedBackupDownload",e.PanelResized="PanelResized",e.WindowDidFocus="WindowDidFocus",e.WindowDidBlur="WindowDidBlur",e.MobileKeyboardDidChangeFrame="MobileKeyboardDidChangeFrame",e.MobileKeyboardWillChangeFrame="MobileKeyboardWillChangeFrame"}(X||(X={})),function(e){e.UserRolesChanged="UserRolesChanged",e.FeaturesAvailabilityChanged="Features:FeaturesAvailabilityChanged",e.DidPurchaseSubscription="DidPurchaseSubscription"}($||($={})),function(e){e.NoUserSubscription="NoUserSubscription",e.NotInCurrentPlan="NotInCurrentPlan",e.InCurrentPlanButExpired="InCurrentPlanButExpired",e.Entitled="Entitled"}(ee||(ee={})),n(87985),n(70781),(ne||(ne={})).IntegrityCheckCompleted="IntegrityCheckCompleted",function(e){e[e.AReferencesB=0]="AReferencesB",e[e.BReferencesA=1]="BReferencesA",e[e.NoRelationship=2]="NoRelationship"}(re||(re={})),function(e){e.ActiveThemes="activeThemes",e.UseSystemColorScheme="useSystemColorScheme",e.UseTranslucentUI="useTranslucentUI",e.AutoLightThemeIdentifier="autoLightThemeIdentifier",e.AutoDarkThemeIdentifier="autoDarkThemeIdentifier",e.EditorMonospaceEnabled="monospaceFont",e.EditorLineHeight="editorLineHeight",e.EditorLineWidth="editorLineWidth",e.EditorFontSize="editorFontSize"}(ie||(ie={})),function(e){e.LocalPreferencesChanged="LocalPreferencesChanged",e.PreferencesChanged="PreferencesChanged"}(oe||(oe={})),function(e){e.Immediately="immediately",e.OnQuit="on-quit"}(se||(se={})),function(e){e.UnprotectedSessionBegan="Protection:UnprotectedSessionBegan",e.UnprotectedSessionExpired="Protection:UnprotectedSessionExpired",e.BiometricsSoftLockEngaged="Protection:BiometricsSoftLockEngaged",e.BiometricsSoftLockDisengaged="Protection:BiometricsSoftLockDisengaged"}(ae||(ae={})),(ge=le||(le={}))[ge.Default=1]="Default",ge[ge.Ephemeral=2]="Ephemeral",(fe=ce||(ce={}))[fe.Default=1]="Default",fe[fe.Nonwrapped=2]="Nonwrapped",function(e){e.Wrapped="wrapped",e.Unwrapped="unwrapped",e.Nonwrapped="nonwrapped"}(ue||(ue={})),(ye=de||(de={})).Restored="SessionEvent:SessionRestored",ye.Revoked="SessionEvent:SessionRevoked",ye.UserKeyPairChanged="SessionEvent:UserKeyPairChanged",(me=he||(he={})).SharedVaultStatusChanged="SharedVaultStatusChanged",me.SharedVaultFileStorageUsageChanged="SharedVaultFileStorageUsageChanged",(pe||(pe={})).NotificationReceived="NotificationReceived",P.AsymmetricMessagePayloadType.SharedVaultRootKeyChanged,P.AsymmetricMessagePayloadType.SharedVaultMetadataChanged,(Ae=ve||(ve={})).MessageChanged="MessageChanged",Ae.PreferencesBubbleCountChanged="PreferencesBubbleCountChanged",function(e){e.ProPlanYearly="pro_plan_yearly",e.PlusPlanYearly="plus_plan_yearly"}(be||(be={})),(we||(we={})).DidFetchSubscription="Subscription:DidFetchSubscription",function(e){e.Default="Default",e.DownloadFirst="DownloadFirst",e.LocalOnly="LocalOnly"}(Se||(Se={})),function(e){e[e.ResolveOnNext=1]="ResolveOnNext",e[e.ForceSpawnNew=2]="ForceSpawnNew"}(Ce||(Ce={})),function(e){e.External="External",e.SpawnQueue="SpawnQueue",e.ResolveQueue="ResolveQueue",e.MoreDirtyItems="MoreDirtyItems",e.DownloadFirst="DownloadFirst",e.AfterDownloadFirst="AfterDownloadFirst",e.IntegrityCheck="IntegrityCheck",e.ResolveOutOfSync="ResolveOutOfSync"}(Ee||(Ee={})),(_e=Ie||(Ie={})).SignedInOrRegistered="SignedInOrRegistered",_e.SignedOut="SignedOut",xe||(xe={}),(Oe=Pe||(Pe={})).InviteSent="VaultInviteServiceEvent.InviteSent",Oe.InvitesReloaded="VaultInviteServiceEvent.InvitesReloaded",(Ne=ke||(ke={})).VaultUnlocked="VaultUnlocked",Ne.VaultLocked="VaultLocked",(De=Be||(Be={})).UsersChanged="VaultUserServiceEvent.UsersChanged",De.InvalidatedAllUserCache="VaultUserServiceEvent.InvalidatedUserCache",De.InvalidatedUserCacheForVault="VaultUserServiceEvent.InvalidatedUserCacheForVault"},8430:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},91440:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},21404:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},63180:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(8430),t),i(n(91440),t),i(n(21404),t)},45575:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},83372:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(45575),t)},41335:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},90176:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timingSafeEqual=void 0,t.timingSafeEqual=function(e,t){const n=String(e);let r=String(t);const i=n.length;let o=0;i!==r.length&&(r=n,o=1);for(let e=0;e<i;e++)o|=n.charCodeAt(e)^r.charCodeAt(e);return 0===o}},78492:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(41335),t),i(n(90176),t)},26734:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},68101:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(26734),t)},88602:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},84370:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1282:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},69422:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},51234:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SodiumConstant=void 0,t.SodiumConstant={CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_STATEBYTES:52,CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES:17,CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES:24,CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES:32,CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX:274877906816,crypto_box_SEEDBYTES:32,crypto_sign_SEEDBYTES:32,crypto_generichash_KEYBYTES:32}},58081:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},42565:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SodiumTag=void 0,function(e){e[e.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PUSH=0]="CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PUSH",e[e.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PULL=1]="CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PULL",e[e.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY=2]="CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY",e[e.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL=3]="CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL"}(n||(t.SodiumTag=n={}))},67918:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},39296:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},91338:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},83395:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},21084:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},30418:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88602),t),i(n(84370),t),i(n(1282),t),i(n(69422),t),i(n(51234),t),i(n(58081),t),i(n(42565),t),i(n(67918),t),i(n(39296),t),i(n(91338),t),i(n(83395),t),i(n(21084),t)},98418:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(63180),t),i(n(83372),t),i(n(78492),t),i(n(68101),t),i(n(30418),t)},29894:e=>{"use strict";var t;self,t=()=>(()=>{var e={87244:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContentDecoder=void 0,t.ContentDecoder=class{decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;try{const n=t>0?e.substring(t):e,r=Buffer.from(n,"base64").toString();return JSON.parse(r)}catch(e){return{}}}encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;const n=JSON.stringify(e),r=Buffer.from(n).toString("base64");return r.padStart(r.length+t,"0")}}},21467:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},35411:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},30717:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},97936:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},79955:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},85413:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EmailMessageIdentifier=void 0,(n=t.EmailMessageIdentifier||(t.EmailMessageIdentifier={})).WELCOME_EMAIL="WELCOME_EMAIL",n.ACCOUNT_CLAIM="ACCOUNT_CLAIM",n.ACCOUNT_RESET="ACCOUNT_RESET",n.ACTIVATION_CODE="ACTIVATION_CODE",n.VERSION_ADOPTION_REPORT="VERSION_ADOPTION_REPORT",n.FAILED_DROPBOX_BACKUP="FAILED_DROPBOX_BACKUP",n.FAILED_GOOGLE_DRIVE_BACKUP="FAILED_GOOGLE_DRIVE_BACKUP",n.FAILED_ONE_DRIVE_BACKUP="FAILED_ONE_DRIVE_BACKUP",n.DATA_BACKUP="DATA_BACKUP",n.FAILED_BACKUP_ATTACHMENT_TOO_BIG="FAILED_BACKUP_ATTACHMENT_TOO_BIG",n.OFFLINE_SUBSCRIPTION_ACCESS="OFFLINE_SUBSCRIPTION_ACCESS",n.SIGN_IN="SIGN_IN",n.SHARED_SUBSCRIPTION_INVITATION="SHARED_SUBSCRIPTION_INVITATION",n.ENCOURAGE_EMAIL_BACKUPS="ENCOURAGE_EMAIL_BACKUPS",n.ENCOURAGE_SUBSCRIPTION_PURCHASING="ENCOURAGE_SUBSCRIPTION_PURCHASING",n.EXIT_INTERVIEW="EXIT_INTERVIEW",n.STUDENT_DISCOUNT_REQUESTED="STUDENT_DISCOUNT_REQUESTED",n.STUDENT_DISCOUNT_APPROVED="STUDENT_DISCOUNT_APPROVED",n.MARKETING_CAMPAIGN_FILES="MARKETING_CAMPAIGN_FILES",n.MARKETING_BLACK_FRIDAY_2022="MARKETING_BLACK_FRIDAY_2022",n.MARKETING_BLACK_FRIDAY_2022_REMINDER="MARKETING_BLACK_FRIDAY_2022_REMINDER",n.PAYMENT_FAILED="PAYMENT_FAILED",n.SEND_INVOICE="SEND_INVOICE",n.DISCOUNT_NOTICE="DISCOUNT_NOTICE",n.REFUND_NOTICE="REFUND_NOTICE",n.REFUND_REQUESTED="REFUND_REQUESTED",n.RATE_ADJUSTMENT_NOTICE="RATE_ADJUSTMENT_NOTICE",n.EXIT_DISCOUNT="EXIT_DISCOUNT",n.SUBSCRIPTION_CANCELLED="SUBSCRIPTION_CANCELLED"},35219:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},89125:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},86070:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},68597:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},38427:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},45551:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},9650:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.KeyParamsOrigination=void 0,(n=t.KeyParamsOrigination||(t.KeyParamsOrigination={})).Registration="registration",n.EmailChange="email-change",n.PasswordChange="password-change",n.ProtocolUpgrade="protocol-upgrade",n.PasscodeCreate="passcode-create",n.PasscodeChange="passcode-change"},32806:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PaymentType=void 0,(n=t.PaymentType||(t.PaymentType={})).Initial="initial",n.Renewal="renewal"},56253:(e,t)=>{var n;function r(e,t){return Number(e)-Number(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.isVersionLessThanOrEqualTo=t.leftVersionGreaterThanOrEqualToRight=t.compareVersions=t.protocolVersionFromEncryptedString=t.ProtocolVersionLength=t.isProtocolVersionExpired=t.ProtocolExpirationDates=t.ProtocolVersionLastNonrootItemsKey=t.ProtocolVersionLatest=t.ProtocolVersion=void 0,function(e){e.V001="001",e.V002="002",e.V003="003",e.V004="004"}(n=t.ProtocolVersion||(t.ProtocolVersion={})),t.ProtocolVersionLatest=n.V004,t.ProtocolVersionLastNonrootItemsKey=n.V003,t.ProtocolExpirationDates=Object.freeze({[n.V001]:Date.parse("2018-01-01"),[n.V002]:Date.parse("2020-01-01")}),t.isProtocolVersionExpired=function(e){const n=t.ProtocolExpirationDates[e];return!!n&&(new Date).getTime()>n},t.ProtocolVersionLength=3,t.protocolVersionFromEncryptedString=function(e){const r=e.substring(0,t.ProtocolVersionLength);if(Object.values(n).includes(r))return r;throw Error("Unrecognized protocol version ".concat(r))},t.compareVersions=r,t.leftVersionGreaterThanOrEqualToRight=function(e,t){return r(e,t)>=0},t.isVersionLessThanOrEqualTo=function(e,t){return r(e,t)<=0}},52410:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionBillingFrequency=void 0,(n=t.SubscriptionBillingFrequency||(t.SubscriptionBillingFrequency={}))[n.Monthly=1]="Monthly",n[n.Annual=12]="Annual",n[n.FiveYear=60]="FiveYear"},74911:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionName=void 0,(n=t.SubscriptionName||(t.SubscriptionName={})).PlusPlan="PLUS_PLAN",n.ProPlan="PRO_PLAN"},83402:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},62665:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},90235:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UserRequestType=void 0,(t.UserRequestType||(t.UserRequestType={})).ExitDiscount="exit-discount"},25560:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(87244),t),i(n(21467),t),i(n(35411),t),i(n(97936),t),i(n(79955),t),i(n(30717),t),i(n(85413),t),i(n(35219),t),i(n(89125),t),i(n(86070),t),i(n(68597),t),i(n(38427),t),i(n(45551),t),i(n(9650),t),i(n(32806),t),i(n(56253),t),i(n(52410),t),i(n(74911),t),i(n(83402),t),i(n(62665),t),i(n(90235),t)},20875:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(25560),t)},50569:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LegacySession=void 0;const r=n(93461),i=n(33969),o=n(42544);class s extends r.ValueObject{get accessToken(){return this.props.token}constructor(e){super(e)}static create(e){return o.Validator.isNotEmpty(e).isFailed()?i.Result.fail("Could not create legacy session. Token value is empty"):i.Result.ok(new s({token:e}))}}t.LegacySession=s},89957:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},87879:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Session=void 0;const r=n(93461),i=n(33969);class o extends r.ValueObject{get accessToken(){return this.props.accessToken}get refreshToken(){return this.props.refreshToken}isReadOnly(){return this.props.readonlyAccess||!1}constructor(e){super(e)}static create(e,t,n){return i.Result.ok(new o({accessToken:e,refreshToken:t,readonlyAccess:n}))}}t.Session=o},92932:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},65085:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SessionToken=void 0;const r=n(93461),i=n(33969),o=n(42544);class s extends r.ValueObject{get value(){return this.props.value}get expiresAt(){return this.props.expiresAt}constructor(e){super(e)}static create(e,t){return o.Validator.isNotEmpty(e).isFailed()?i.Result.fail("Could not create session token. Token value is empty"):o.Validator.isNotEmpty(t).isFailed()?i.Result.fail("Could not create session token. Token expiration is empty"):i.Result.ok(new s({value:e,expiresAt:t}))}}t.SessionToken=s},38487:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},43324:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CacheEntry=void 0;const r=n(77546),i=n(33969);class o extends r.Entity{constructor(e,t){super(e,t)}static create(e,t){return i.Result.ok(new o(e,t))}}t.CacheEntry=o},78881:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},67794:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},84287:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContentType=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get value(){return this.props.value}constructor(e){super(e),this.displayNamesMap={[o.TYPES.ActionsExtension]:"action-based extension",[o.TYPES.Component]:"component",[o.TYPES.Editor]:"editor",[o.TYPES.File]:"file",[o.TYPES.FilesafeCredentials]:"FileSafe credential",[o.TYPES.FilesafeFileMetadata]:"FileSafe file",[o.TYPES.FilesafeIntegration]:"FileSafe integration",[o.TYPES.ItemsKey]:"encryption key",[o.TYPES.Note]:"note",[o.TYPES.SmartView]:"smart view",[o.TYPES.Tag]:"tag",[o.TYPES.Theme]:"theme",[o.TYPES.UserPrefs]:"user preferences"}}static create(e){return null===e?r.Result.ok(new o({value:null})):Object.values(this.TYPES).includes(e)?r.Result.ok(new o({value:e})):r.Result.fail("Invalid content type: ".concat(e))}getDisplayName(){return this.value?this.displayNamesMap[this.value]||this.value:null}}o.TYPES={Any:"*",Item:"SF|Item",KeySystemItemsKey:"SN|KeySystemItemsKey",KeySystemRootKey:"SN|KeySystemRootKey",TrustedContact:"SN|TrustedContact",VaultListing:"SN|VaultListing",RootKey:"SN|RootKey|NoSync",ItemsKey:"SN|ItemsKey",EncryptedStorage:"SN|EncryptedStorage",Note:"Note",Tag:"Tag",SmartView:"SN|SmartTag",Component:"SN|Component",Editor:"SN|Editor",ActionsExtension:"Extension",UserPrefs:"SN|UserPreferences",HistorySession:"SN|HistorySession",Theme:"SN|Theme",File:"SN|File",FilesafeCredentials:"SN|FileSafe|Credentials",FilesafeFileMetadata:"SN|FileSafe|FileMetadata",FilesafeIntegration:"SN|FileSafe|Integration",ExtensionRepo:"SN|ExtensionRepo"},t.ContentType=o},4273:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},92339:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Dates=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get createdAt(){return this.props.createdAt}get updatedAt(){return this.props.updatedAt}constructor(e){super(e)}static create(e,t){return e instanceof Date?t instanceof Date?r.Result.ok(new o({createdAt:e,updatedAt:t})):r.Result.fail("Could not create Dates. Update date should be a date object, given: ".concat(t)):r.Result.fail("Could not create Dates. Creation date should be a date object, given: ".concat(e))}}t.Dates=o},57154:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},63666:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Email=void 0;const r=n(93461),i=n(33969),o=n(42544);class s extends r.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){if(o.Validator.isString(e).isFailed())return i.Result.fail("Email must be a string");const t=e.trim().toLowerCase(),n=o.Validator.isValidEmail(t);return n.isFailed()?i.Result.fail(n.getError()):i.Result.ok(new s({value:t}))}}t.Email=s},63931:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},65180:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RoleName=void 0;const r=n(93461),i=n(33969);class o extends r.ValueObject{get value(){return this.props.value}hasMoreOrEqualPowerTo(e){switch(this.value){case o.NAMES.InternalTeamUser:return!0;case o.NAMES.ProUser:return[o.NAMES.CoreUser,o.NAMES.PlusUser,o.NAMES.ProUser].includes(e.value);case o.NAMES.PlusUser:return[o.NAMES.CoreUser,o.NAMES.PlusUser].includes(e.value);case o.NAMES.CoreUser:case o.NAMES.VaultsUser:return[o.NAMES.CoreUser].includes(e.value);default:throw new Error("Invalid role name: ".concat(this.value))}}constructor(e){super(e)}static create(e){return Object.values(this.NAMES).includes(e)?i.Result.ok(new o({value:e})):i.Result.fail("Invalid role name: ".concat(e))}}o.NAMES={CoreUser:"CORE_USER",PlusUser:"PLUS_USER",ProUser:"PRO_USER",InternalTeamUser:"INTERNAL_TEAM_USER",VaultsUser:"VAULTS_USER"},t.RoleName=o},60216:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RoleNameCollection=void 0;const r=n(93461),i=n(33969),o=n(65180);class s extends r.ValueObject{get value(){return this.props.value}includes(e){for(const t of this.props.value)if(t.value===e.value)return!0;return!1}hasARoleNameWithMoreOrEqualPowerTo(e){for(const t of this.props.value)if(t.hasMoreOrEqualPowerTo(e))return!0;return!1}equals(e){if(this.props.value.length!==e.value.length)return!1;for(const t of e.value)if(!this.includes(t))return!1;return!0}constructor(e){super(e)}static create(e){const t=[];for(const n of e){const e=o.RoleName.create(n);if(e.isFailed())return i.Result.fail(e.getError());t.push(e.getValue())}return i.Result.ok(new s({value:t}))}}t.RoleNameCollection=s},78060:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},49565:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},77803:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Timestamps=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get createdAt(){return this.props.createdAt}get updatedAt(){return this.props.updatedAt}constructor(e){super(e)}static create(e,t){return isNaN(e)||"number"!=typeof e?r.Result.fail("Could not create Timestamps. Creation date should be a number, given: ".concat(e)):isNaN(t)||"number"!=typeof t?r.Result.fail("Could not create Timestamps. Update date should be a number, given: ".concat(t)):r.Result.ok(new o({createdAt:e,updatedAt:t}))}}t.Timestamps=o},95332:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},96806:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Username=void 0;const r=n(93461),i=n(33969),o=n(42544);class s extends r.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){if(o.Validator.isString(e).isFailed())return i.Result.fail("Username must be a string");const t=e.trim().toLowerCase();return o.Validator.isNotEmpty(t).isFailed()?i.Result.fail("Username cannot be empty"):i.Result.ok(new s({value:t}))}isPotentiallyAPrivateUsernameAccount(){return 64===this.value.length&&!this.value.includes("@")}}t.Username=s},29835:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},26477:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Uuid=void 0;const r=n(93461),i=n(33969),o=n(42544);class s extends r.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){const t=o.Validator.isValidUuid(e);return t.isFailed()?i.Result.fail(t.getError()):i.Result.ok(new s({value:e}))}}t.Uuid=s},55928:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},69838:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Aggregate=void 0;const r=n(77546);class i extends r.Entity{constructor(){super(...arguments),this.changesOnAggregateRoot=[]}addChange(e){this.changesOnAggregateRoot.push(e)}flushChanges(){this.changesOnAggregateRoot=[]}getChanges(){return this.changesOnAggregateRoot}}t.Aggregate=i},39653:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Change=void 0;const r=n(33969);class i{constructor(e){this.props=Object.freeze(e)}static create(e){return Object.values(i.TYPES).includes(e.changeType)?r.Result.ok(new i(e)):r.Result.fail("Invalid change type")}}i.TYPES={Add:"add",Remove:"remove",Modify:"modify"},t.Change=i},24128:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},77546:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Entity=void 0;const r=n(85193);class i{constructor(e,t){this.props=e,this._id=t||new r.UniqueEntityId}get id(){return this._id}equals(e){return null!=e&&null!=e&&(this===e||e instanceof i&&this._id.equals(e._id))}}t.Entity=i},2602:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Id=void 0,t.Id=class{constructor(e){this.value=e}equals(e){return null!=e&&e instanceof this.constructor&&e.toValue()===this.value}toString(){return String(this.value)}toValue(){return this.value}}},33969:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Result=void 0;class n{constructor(e,t,n){this.isSuccess=e,this.error=t,this.value=n,Object.freeze(this)}isFailed(){return!this.isSuccess}getValue(){if(!this.isSuccess)throw new Error("Cannot get value of an unsuccessfull result: ".concat(this.error));return this.value}getError(){if(this.isSuccess||void 0===this.error)throw new Error("Cannot get an error of a successfull result");return this.error}static ok(e){return new n(!0,void 0,e)}static fail(e){return new n(!1,e)}}t.Result=n},85193:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueEntityId=void 0;const r=n(31777),i=n(2602);class o extends i.Id{constructor(e){super(e||(0,r.v4)())}}t.UniqueEntityId=o},42544:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Validator=void 0;const r=n(33969);class i{static isValidUuid(e){return null!==String(e).toLowerCase().match(i.UUID_ANY_VERSION_AND_VARIANT_REGEX)?r.Result.ok():r.Result.fail("Given value is not a valid uuid: ".concat(e))}static isValidEmail(e){return null!==String(e).toLowerCase().match(i.EMAIL_REGEX)?r.Result.ok():r.Result.fail("Given value is not a valid email address: ".concat(e))}static isString(e){return"string"==typeof e?r.Result.ok():r.Result.fail("Given value is not a string: ".concat(typeof e))}static isNotEmpty(e){return e instanceof Array&&0===e.length||null==e||""===e?r.Result.fail("Given value is empty: ".concat(e)):r.Result.ok()}static isNotEmptyString(e){const t=i.isString(e);if(t.isFailed())return t;const n=i.isNotEmpty(e);return n.isFailed()?n:r.Result.ok()}}i.UUID_ANY_VERSION_AND_VARIANT_REGEX=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,i.EMAIL_REGEX=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,t.Validator=i},93461:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueObject=void 0,t.ValueObject=class{constructor(e){this.props=Object.freeze(e)}equals(e){return null!=e&&JSON.stringify(this.props)===JSON.stringify(e.props)}}},21797:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},82806:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ControllerContainer=void 0,t.ControllerContainer=class{constructor(){this.controllerMethodsMap=new Map}register(e,t){this.controllerMethodsMap.set(e,t)}get(e){return this.controllerMethodsMap.get(e)}}},30048:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},95951:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EmailLevel=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){return Object.values(this.LEVELS).includes(e)?r.Result.ok(new o({value:e})):r.Result.fail("Invalid subscription rejection level: ".concat(e))}}o.LEVELS={System:"SYSTEM",SignIn:"SIGN_IN",Marketing:"MARKETING",FailedCloudBackup:"FAILED_CLOUD_BACKUP",FailedEmailBackup:"FAILED_EMAIL_BACKUP"},t.EmailLevel=o},78690:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},12677:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractEnv=void 0,t.AbstractEnv=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.env={},this.overrides=e}get(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.env||this.load(),this.overrides[e])return this.overrides[e];if(!process.env[e]&&!t)throw new Error("Environment variable ".concat(e," not set"));return process.env[e]}getAll(){return this.env||this.load(),this.env}}},49321:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},26112:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationPayload=void 0;const r=n(93461),i=n(33969),o=n(1166),s=n(26477),a=n(63011);class l extends r.ValueObject{constructor(e){super(e)}toString(){var e,t;return JSON.stringify({version:this.props.version,type:this.props.type.value,primaryIdentifier:this.props.primaryIdentifier.value,primaryIndentifierType:this.props.primaryIndentifierType.value,secondaryIdentifier:null===(e=this.props.secondaryIdentifier)||void 0===e?void 0:e.value,secondaryIdentifierType:null===(t=this.props.secondaryIdentifierType)||void 0===t?void 0:t.value})}static createFromString(e){try{const t=JSON.parse(e),n=o.NotificationType.create(t.type);if(n.isFailed())return i.Result.fail(n.getError());const r=n.getValue(),c=s.Uuid.create(t.primaryIdentifier);if(c.isFailed())return i.Result.fail(c.getError());const u=c.getValue(),d=a.NotificationPayloadIdentifierType.create(t.primaryIndentifierType);if(d.isFailed())return i.Result.fail(d.getError());const h=d.getValue();let p,f;if(t.secondaryIdentifier){const e=s.Uuid.create(t.secondaryIdentifier);if(e.isFailed())return i.Result.fail(e.getError());p=e.getValue()}if(t.secondaryIdentifierType){const e=a.NotificationPayloadIdentifierType.create(t.secondaryIdentifierType);if(e.isFailed())return i.Result.fail(e.getError());f=e.getValue()}return l.create({version:t.version,type:r,primaryIdentifier:u,primaryIndentifierType:h,secondaryIdentifier:p,secondaryIdentifierType:f})}catch(e){return i.Result.fail(e.message)}}static create(e){return void 0===e.secondaryIdentifier&&e.type.equals(o.NotificationType.create(o.NotificationType.TYPES.SharedVaultItemRemoved).getValue())?i.Result.fail("Item uuid is required for ".concat(o.NotificationType.TYPES.SharedVaultItemRemoved," notification type")):i.Result.ok(new l(e))}}t.NotificationPayload=l},63011:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationPayloadIdentifierType=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{constructor(e){super(e)}get value(){return this.props.value}static create(e){return Object.values(this.TYPES).includes(e)?r.Result.ok(new o({value:e})):r.Result.fail("Invalid notification payload identifier type: ".concat(e))}}o.TYPES={SharedVaultUuid:"shared_vault_uuid",UserUuid:"user_uuid",SharedVaultInviteUuid:"shared_vault_invite_uuid",ItemUuid:"item_uuid"},t.NotificationPayloadIdentifierType=o},33980:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},98719:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},1166:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationType=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){return Object.values(this.TYPES).includes(e)?r.Result.ok(new o({value:e})):r.Result.fail("Invalid notification type: ".concat(e))}}o.TYPES={SharedVaultItemRemoved:"shared_vault_item_removed",SelfRemovedFromSharedVault:"self_removed_from_shared_vault",UserRemovedFromSharedVault:"user_removed_from_shared_vault",UserDesignatedAsSurvivor:"user_designated_as_survivor",UserAddedToSharedVault:"user_added_to_shared_vault",SharedVaultInviteCanceled:"shared_vault_invite_canceled",SharedVaultFileUploaded:"shared_vault_file_uploaded",SharedVaultFileRemoved:"shared_vault_file_removed"},t.NotificationType=o},33479:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},98401:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},93738:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceContainer=void 0,t.ServiceContainer=class{constructor(){this.serviceMap=new Map}register(e,t){this.serviceMap.set(e.value,t)}get(e){return this.serviceMap.get(e.value)}}},19055:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5775:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceIdentifier=void 0;const r=n(93461),i=n(33969);class o extends r.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){return Object.values(this.NAMES).includes(e)?i.Result.ok(new o({value:e})):i.Result.fail("Invalid subscription plan name: ".concat(e))}}o.NAMES={AnalyticsWorker:"AnalyticsWorker",AnalyticsScheduledTask:"AnalyticsScheduledTask",ApiGateway:"ApiGateway",Auth:"Auth",AuthWorker:"AuthWorker",AuthScheduledTask:"AuthScheduledTask",SyncingServer:"SyncingServer",SyncingServerWorker:"SyncingServerWorker",Revisions:"Revisions",RevisionsWorker:"RevisionsWorker",Files:"Files",FilesWorker:"FilesWorker",SchedulerWorker:"SchedulerWorker",SchedulerScheduledTask:"SchedulerScheduledTask",Email:"Email",EmailWorker:"EmailWorker",EmailBounceProcessor:"EmailBounceProcessor",EmailScheduledTask:"EmailScheduledTask",Websockets:"Websockets",WebsocketsWorker:"WebsocketsWorker"},t.ServiceIdentifier=o},55334:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},35491:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},41406:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SettingName=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get value(){return this.props.value}isSensitive(){return[o.NAMES.MfaSecret,o.NAMES.ExtensionKey].includes(this.props.value)}isASubscriptionSetting(){return[o.NAMES.FileUploadBytesLimit,o.NAMES.FileUploadBytesUsed,o.NAMES.MuteSignInEmails].includes(this.props.value)}isARegularOnlySubscriptionSetting(){return[o.NAMES.FileUploadBytesLimit,o.NAMES.FileUploadBytesUsed].includes(this.props.value)}isASharedAndRegularOnlySubscriptionSetting(){return[o.NAMES.MuteSignInEmails].includes(this.props.value)}constructor(e){super(e)}static create(e){return Object.values(this.NAMES).includes(e)?r.Result.ok(new o({value:e})):r.Result.fail("Invalid setting name: ".concat(e))}}o.NAMES={MfaSecret:"MFA_SECRET",ExtensionKey:"EXTENSION_KEY",EmailBackupFrequency:"EMAIL_BACKUP_FREQUENCY",DropboxBackupFrequency:"DROPBOX_BACKUP_FREQUENCY",DropboxBackupToken:"DROPBOX_BACKUP_TOKEN",OneDriveBackupFrequency:"ONE_DRIVE_BACKUP_FREQUENCY",OneDriveBackupToken:"ONE_DRIVE_BACKUP_TOKEN",GoogleDriveBackupFrequency:"GOOGLE_DRIVE_BACKUP_FREQUENCY",GoogleDriveBackupToken:"GOOGLE_DRIVE_BACKUP_TOKEN",MuteFailedBackupsEmails:"MUTE_FAILED_BACKUPS_EMAILS",MuteFailedCloudBackupsEmails:"MUTE_FAILED_CLOUD_BACKUPS_EMAILS",MuteSignInEmails:"MUTE_SIGN_IN_EMAILS",MuteMarketingEmails:"MUTE_MARKETING_EMAILS",ListedAuthorSecrets:"LISTED_AUTHOR_SECRETS",LogSessionUserAgent:"LOG_SESSION_USER_AGENT",RecoveryCodes:"RECOVERY_CODES",FileUploadBytesLimit:"FILE_UPLOAD_BYTES_LIMIT",FileUploadBytesUsed:"FILE_UPLOAD_BYTES_USED"},t.SettingName=o},10262:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},94478:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultUser=void 0;const r=n(77546),i=n(33969);class o extends r.Entity{constructor(e,t){super(e,t)}static create(e,t){return i.Result.ok(new o(e,t))}}t.SharedVaultUser=o},95626:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultUserPermission=void 0;const r=n(33969),i=n(93461);class o extends i.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){return Object.values(this.PERMISSIONS).includes(e)?r.Result.ok(new o({value:e})):r.Result.fail("Invalid shared vault user permission ".concat(e))}}o.PERMISSIONS={Read:"read",Write:"write",Admin:"admin"},t.SharedVaultUserPermission=o},27369:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},76226:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},96829:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionPlanName=void 0;const r=n(93461),i=n(33969);class o extends r.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){return Object.values(this.NAMES).includes(e)?i.Result.ok(new o({value:e})):i.Result.fail("Invalid subscription plan name: ".concat(e))}}o.NAMES={PlusPlan:"PLUS_PLAN",ProPlan:"PRO_PLAN"},t.SubscriptionPlanName=o},13709:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},11829:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},17505:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},69749:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(50569),t),i(n(89957),t),i(n(87879),t),i(n(92932),t),i(n(65085),t),i(n(38487),t),i(n(43324),t),i(n(78881),t),i(n(67794),t),i(n(84287),t),i(n(4273),t),i(n(92339),t),i(n(57154),t),i(n(63666),t),i(n(63931),t),i(n(65180),t),i(n(49565),t),i(n(60216),t),i(n(78060),t),i(n(77803),t),i(n(95332),t),i(n(96806),t),i(n(29835),t),i(n(26477),t),i(n(55928),t),i(n(69838),t),i(n(39653),t),i(n(24128),t),i(n(77546),t),i(n(2602),t),i(n(33969),t),i(n(85193),t),i(n(42544),t),i(n(93461),t),i(n(21797),t),i(n(82806),t),i(n(30048),t),i(n(95951),t),i(n(78690),t),i(n(12677),t),i(n(49321),t),i(n(26112),t),i(n(63011),t),i(n(33980),t),i(n(98719),t),i(n(1166),t),i(n(33479),t),i(n(98401),t),i(n(93738),t),i(n(19055),t),i(n(5775),t),i(n(55334),t),i(n(35491),t),i(n(41406),t),i(n(10262),t),i(n(94478),t),i(n(95626),t),i(n(27369),t),i(n(76226),t),i(n(96829),t),i(n(13709),t),i(n(11829),t),i(n(17505),t)},82648:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(69749),t)},74350:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EmailBackupFrequency=void 0,(n=t.EmailBackupFrequency||(t.EmailBackupFrequency={})).Disabled="disabled",n.Daily="daily",n.Weekly="weekly"},80030:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},64684:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.LogSessionUserAgentOption=void 0,(n=t.LogSessionUserAgentOption||(t.LogSessionUserAgentOption={})).Disabled="disabled",n.Enabled="enabled"},22208:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MuteFailedBackupsEmailsOption=void 0,(n=t.MuteFailedBackupsEmailsOption||(t.MuteFailedBackupsEmailsOption={})).Muted="muted",n.NotMuted="not_muted"},49532:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MuteMarketingEmailsOption=void 0,(n=t.MuteMarketingEmailsOption||(t.MuteMarketingEmailsOption={})).Muted="muted",n.NotMuted="not_muted"},19639:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MuteSignInEmailsOption=void 0,(n=t.MuteSignInEmailsOption||(t.MuteSignInEmailsOption={})).Muted="muted",n.NotMuted="not_muted"},50174:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(74350),t),i(n(80030),t),i(n(64684),t),i(n(22208),t),i(n(49532),t),i(n(19639),t)},73606:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(50174),t)},59154:function(e){e.exports=function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}function n(e,r,i){return n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,n,r){var i=[null];i.push.apply(i,n);var o=new(Function.bind.apply(e,i));return r&&t(o,r.prototype),o},n.apply(null,arguments)}function r(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var o=Object.hasOwnProperty,s=Object.setPrototypeOf,a=Object.isFrozen,l=Object.getPrototypeOf,c=Object.getOwnPropertyDescriptor,u=Object.freeze,d=Object.seal,h=Object.create,p="undefined"!=typeof Reflect&&Reflect,f=p.apply,g=p.construct;f||(f=function(e,t,n){return e.apply(t,n)}),u||(u=function(e){return e}),d||(d=function(e){return e}),g||(g=function(e,t){return n(e,r(t))});var m,y=P(Array.prototype.forEach),v=P(Array.prototype.pop),A=P(Array.prototype.push),b=P(String.prototype.toLowerCase),w=P(String.prototype.toString),S=P(String.prototype.match),C=P(String.prototype.replace),E=P(String.prototype.indexOf),I=P(String.prototype.trim),_=P(RegExp.prototype.test),x=(m=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g(m,t)});function P(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return f(e,t,r)}}function k(e,t,n){var r;n=null!==(r=n)&&void 0!==r?r:b,s&&s(e,null);for(var i=t.length;i--;){var o=t[i];if("string"==typeof o){var l=n(o);l!==o&&(a(t)||(t[i]=l),o=l)}e[o]=!0}return e}function B(e){var t,n=h(null);for(t in e)!0===f(o,e,[t])&&(n[t]=e[t]);return n}function O(e,t){for(;null!==e;){var n=c(e,t);if(n){if(n.get)return P(n.get);if("function"==typeof n.value)return P(n.value)}e=l(e)}return function(e){return console.warn("fallback value for",e),null}}var N=u(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),D=u(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),j=u(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),T=u(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),M=u(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),F=u(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),R=u(["#text"]),L=u(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),Q=u(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),U=u(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),V=u(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),K=d(/\{\{[\w\W]*|[\w\W]*\}\}/gm),H=d(/<%[\w\W]*|[\w\W]*%>/gm),G=d(/\${[\w\W]*}/gm),Y=d(/^data-[\-\w.\u00B7-\uFFFF]/),z=d(/^aria-[\-\w]+$/),Z=d(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),W=d(/^(?:\w+script|data):/i),q=d(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),J=d(/^html$/i),X=function(){return"undefined"==typeof window?null:window};return function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:X(),i=function(e){return t(e)};if(i.version="2.4.7",i.removed=[],!n||!n.document||9!==n.document.nodeType)return i.isSupported=!1,i;var o=n.document,s=n.document,a=n.DocumentFragment,l=n.HTMLTemplateElement,c=n.Node,d=n.Element,h=n.NodeFilter,p=n.NamedNodeMap,f=void 0===p?n.NamedNodeMap||n.MozNamedAttrMap:p,g=n.HTMLFormElement,m=n.DOMParser,P=n.trustedTypes,$=d.prototype,ee=O($,"cloneNode"),te=O($,"nextSibling"),ne=O($,"childNodes"),re=O($,"parentNode");if("function"==typeof l){var ie=s.createElement("template");ie.content&&ie.content.ownerDocument&&(s=ie.content.ownerDocument)}var oe=function(t,n){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var r=null,i="data-tt-policy-suffix";n.currentScript&&n.currentScript.hasAttribute(i)&&(r=n.currentScript.getAttribute(i));var o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(P,o),se=oe?oe.createHTML(""):"",ae=s,le=ae.implementation,ce=ae.createNodeIterator,ue=ae.createDocumentFragment,de=ae.getElementsByTagName,he=o.importNode,pe={};try{pe=B(s).documentMode?s.documentMode:{}}catch(e){}var fe={};i.isSupported="function"==typeof re&&le&&void 0!==le.createHTMLDocument&&9!==pe;var ge,me,ye=K,ve=H,Ae=G,be=Y,we=z,Se=W,Ce=q,Ee=Z,Ie=null,_e=k({},[].concat(r(N),r(D),r(j),r(M),r(R))),xe=null,Pe=k({},[].concat(r(L),r(Q),r(U),r(V))),ke=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Be=null,Oe=null,Ne=!0,De=!0,je=!1,Te=!0,Me=!1,Fe=!1,Re=!1,Le=!1,Qe=!1,Ue=!1,Ve=!1,Ke=!0,He=!1,Ge=!0,Ye=!1,ze={},Ze=null,We=k({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),qe=null,Je=k({},["audio","video","img","source","image","track"]),Xe=null,$e=k({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml",rt=nt,it=!1,ot=null,st=k({},[et,tt,nt],w),at=["application/xhtml+xml","text/html"],lt=null,ct=s.createElement("form"),ut=function(e){return e instanceof RegExp||e instanceof Function},dt=function(t){lt&&lt===t||(t&&"object"===e(t)||(t={}),t=B(t),ge=ge=-1===at.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,me="application/xhtml+xml"===ge?w:b,Ie="ALLOWED_TAGS"in t?k({},t.ALLOWED_TAGS,me):_e,xe="ALLOWED_ATTR"in t?k({},t.ALLOWED_ATTR,me):Pe,ot="ALLOWED_NAMESPACES"in t?k({},t.ALLOWED_NAMESPACES,w):st,Xe="ADD_URI_SAFE_ATTR"in t?k(B($e),t.ADD_URI_SAFE_ATTR,me):$e,qe="ADD_DATA_URI_TAGS"in t?k(B(Je),t.ADD_DATA_URI_TAGS,me):Je,Ze="FORBID_CONTENTS"in t?k({},t.FORBID_CONTENTS,me):We,Be="FORBID_TAGS"in t?k({},t.FORBID_TAGS,me):{},Oe="FORBID_ATTR"in t?k({},t.FORBID_ATTR,me):{},ze="USE_PROFILES"in t&&t.USE_PROFILES,Ne=!1!==t.ALLOW_ARIA_ATTR,De=!1!==t.ALLOW_DATA_ATTR,je=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Te=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,Me=t.SAFE_FOR_TEMPLATES||!1,Fe=t.WHOLE_DOCUMENT||!1,Qe=t.RETURN_DOM||!1,Ue=t.RETURN_DOM_FRAGMENT||!1,Ve=t.RETURN_TRUSTED_TYPE||!1,Le=t.FORCE_BODY||!1,Ke=!1!==t.SANITIZE_DOM,He=t.SANITIZE_NAMED_PROPS||!1,Ge=!1!==t.KEEP_CONTENT,Ye=t.IN_PLACE||!1,Ee=t.ALLOWED_URI_REGEXP||Ee,rt=t.NAMESPACE||nt,ke=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&ut(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ke.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&ut(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ke.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(ke.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Me&&(De=!1),Ue&&(Qe=!0),ze&&(Ie=k({},r(R)),xe=[],!0===ze.html&&(k(Ie,N),k(xe,L)),!0===ze.svg&&(k(Ie,D),k(xe,Q),k(xe,V)),!0===ze.svgFilters&&(k(Ie,j),k(xe,Q),k(xe,V)),!0===ze.mathMl&&(k(Ie,M),k(xe,U),k(xe,V))),t.ADD_TAGS&&(Ie===_e&&(Ie=B(Ie)),k(Ie,t.ADD_TAGS,me)),t.ADD_ATTR&&(xe===Pe&&(xe=B(xe)),k(xe,t.ADD_ATTR,me)),t.ADD_URI_SAFE_ATTR&&k(Xe,t.ADD_URI_SAFE_ATTR,me),t.FORBID_CONTENTS&&(Ze===We&&(Ze=B(Ze)),k(Ze,t.FORBID_CONTENTS,me)),Ge&&(Ie["#text"]=!0),Fe&&k(Ie,["html","head","body"]),Ie.table&&(k(Ie,["tbody"]),delete Be.tbody),u&&u(t),lt=t)},ht=k({},["mi","mo","mn","ms","mtext"]),pt=k({},["foreignobject","desc","title","annotation-xml"]),ft=k({},["title","style","font","a","script"]),gt=k({},D);k(gt,j),k(gt,T);var mt=k({},M);k(mt,F);var yt=function(e){A(i.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=se}catch(t){e.remove()}}},vt=function(e,t){try{A(i.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){A(i.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!xe[e])if(Qe||Ue)try{yt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},At=function(e){var t,n;if(Le)e="<remove></remove>"+e;else{var r=S(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===ge&&rt===nt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var i=oe?oe.createHTML(e):e;if(rt===nt)try{t=(new m).parseFromString(i,ge)}catch(e){}if(!t||!t.documentElement){t=le.createDocument(rt,"template",null);try{t.documentElement.innerHTML=it?se:i}catch(e){}}var o=t.body||t.documentElement;return e&&n&&o.insertBefore(s.createTextNode(n),o.childNodes[0]||null),rt===nt?de.call(t,Fe?"html":"body")[0]:Fe?t.documentElement:o},bt=function(e){return ce.call(e.ownerDocument||e,e,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT,null,!1)},wt=function(t){return"object"===e(c)?t instanceof c:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},St=function(e,t,n){fe[e]&&y(fe[e],(function(e){e.call(i,t,n,lt)}))},Ct=function(e){var t,n;if(St("beforeSanitizeElements",e,null),(n=e)instanceof g&&("string"!=typeof n.nodeName||"string"!=typeof n.textContent||"function"!=typeof n.removeChild||!(n.attributes instanceof f)||"function"!=typeof n.removeAttribute||"function"!=typeof n.setAttribute||"string"!=typeof n.namespaceURI||"function"!=typeof n.insertBefore||"function"!=typeof n.hasChildNodes))return yt(e),!0;if(_(/[\u0080-\uFFFF]/,e.nodeName))return yt(e),!0;var r=me(e.nodeName);if(St("uponSanitizeElement",e,{tagName:r,allowedTags:Ie}),e.hasChildNodes()&&!wt(e.firstElementChild)&&(!wt(e.content)||!wt(e.content.firstElementChild))&&_(/<[/\w]/g,e.innerHTML)&&_(/<[/\w]/g,e.textContent))return yt(e),!0;if("select"===r&&_(/<template/i,e.innerHTML))return yt(e),!0;if(!Ie[r]||Be[r]){if(!Be[r]&&It(r)){if(ke.tagNameCheck instanceof RegExp&&_(ke.tagNameCheck,r))return!1;if(ke.tagNameCheck instanceof Function&&ke.tagNameCheck(r))return!1}if(Ge&&!Ze[r]){var o=re(e)||e.parentNode,s=ne(e)||e.childNodes;if(s&&o)for(var a=s.length-1;a>=0;--a)o.insertBefore(ee(s[a],!0),te(e))}return yt(e),!0}return e instanceof d&&!function(e){var t=re(e);t&&t.tagName||(t={namespaceURI:rt,tagName:"template"});var n=b(e.tagName),r=b(t.tagName);return!!ot[e.namespaceURI]&&(e.namespaceURI===tt?t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&("annotation-xml"===r||ht[r]):Boolean(gt[n]):e.namespaceURI===et?t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&&pt[r]:Boolean(mt[n]):e.namespaceURI===nt?!(t.namespaceURI===tt&&!pt[r])&&!(t.namespaceURI===et&&!ht[r])&&!mt[n]&&(ft[n]||!gt[n]):!("application/xhtml+xml"!==ge||!ot[e.namespaceURI]))}(e)?(yt(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!_(/<\/no(script|embed|frames)/i,e.innerHTML)?(Me&&3===e.nodeType&&(t=e.textContent,t=C(t,ye," "),t=C(t,ve," "),t=C(t,Ae," "),e.textContent!==t&&(A(i.removed,{element:e.cloneNode()}),e.textContent=t)),St("afterSanitizeElements",e,null),!1):(yt(e),!0)},Et=function(e,t,n){if(Ke&&("id"===t||"name"===t)&&(n in s||n in ct))return!1;if(De&&!Oe[t]&&_(be,t));else if(Ne&&_(we,t));else if(!xe[t]||Oe[t]){if(!(It(e)&&(ke.tagNameCheck instanceof RegExp&&_(ke.tagNameCheck,e)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(e))&&(ke.attributeNameCheck instanceof RegExp&&_(ke.attributeNameCheck,t)||ke.attributeNameCheck instanceof Function&&ke.attributeNameCheck(t))||"is"===t&&ke.allowCustomizedBuiltInElements&&(ke.tagNameCheck instanceof RegExp&&_(ke.tagNameCheck,n)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(n))))return!1}else if(Xe[t]);else if(_(Ee,C(n,Ce,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==E(n,"data:")||!qe[e])if(je&&!_(Se,C(n,Ce,"")));else if(n)return!1;return!0},It=function(e){return e.indexOf("-")>0},_t=function(t){var n,r,o,s;St("beforeSanitizeAttributes",t,null);var a=t.attributes;if(a){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe};for(s=a.length;s--;){var c=n=a[s],u=c.name,d=c.namespaceURI;if(r="value"===u?n.value:I(n.value),o=me(u),l.attrName=o,l.attrValue=r,l.keepAttr=!0,l.forceKeepAttr=void 0,St("uponSanitizeAttribute",t,l),r=l.attrValue,!l.forceKeepAttr&&(vt(u,t),l.keepAttr))if(Te||!_(/\/>/i,r)){Me&&(r=C(r,ye," "),r=C(r,ve," "),r=C(r,Ae," "));var h=me(t.nodeName);if(Et(h,o,r)){if(!He||"id"!==o&&"name"!==o||(vt(u,t),r="user-content-"+r),oe&&"object"===e(P)&&"function"==typeof P.getAttributeType)if(d);else switch(P.getAttributeType(h,o)){case"TrustedHTML":r=oe.createHTML(r);break;case"TrustedScriptURL":r=oe.createScriptURL(r)}try{d?t.setAttributeNS(d,u,r):t.setAttribute(u,r),v(i.removed)}catch(e){}}}else vt(u,t)}St("afterSanitizeAttributes",t,null)}},xt=function e(t){var n,r=bt(t);for(St("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)St("uponSanitizeShadowNode",n,null),Ct(n)||(n.content instanceof a&&e(n.content),_t(n));St("afterSanitizeShadowDOM",t,null)};return i.sanitize=function(t){var r,s,l,u,d,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((it=!t)&&(t="\x3c!--\x3e"),"string"!=typeof t&&!wt(t)){if("function"!=typeof t.toString)throw x("toString is not a function");if("string"!=typeof(t=t.toString()))throw x("dirty is not a string, aborting")}if(!i.isSupported){if("object"===e(n.toStaticHTML)||"function"==typeof n.toStaticHTML){if("string"==typeof t)return n.toStaticHTML(t);if(wt(t))return n.toStaticHTML(t.outerHTML)}return t}if(Re||dt(h),i.removed=[],"string"==typeof t&&(Ye=!1),Ye){if(t.nodeName){var p=me(t.nodeName);if(!Ie[p]||Be[p])throw x("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof c)1===(s=(r=At("\x3c!----\x3e")).ownerDocument.importNode(t,!0)).nodeType&&"BODY"===s.nodeName||"HTML"===s.nodeName?r=s:r.appendChild(s);else{if(!Qe&&!Me&&!Fe&&-1===t.indexOf("<"))return oe&&Ve?oe.createHTML(t):t;if(!(r=At(t)))return Qe?null:Ve?se:""}r&&Le&&yt(r.firstChild);for(var f=bt(Ye?t:r);l=f.nextNode();)3===l.nodeType&&l===u||Ct(l)||(l.content instanceof a&&xt(l.content),_t(l),u=l);if(u=null,Ye)return t;if(Qe){if(Ue)for(d=ue.call(r.ownerDocument);r.firstChild;)d.appendChild(r.firstChild);else d=r;return(xe.shadowroot||xe.shadowrootmod)&&(d=he.call(o,d,!0)),d}var g=Fe?r.outerHTML:r.innerHTML;return Fe&&Ie["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&_(J,r.ownerDocument.doctype.name)&&(g="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+g),Me&&(g=C(g,ye," "),g=C(g,ve," "),g=C(g,Ae," ")),oe&&Ve?oe.createHTML(g):g},i.setConfig=function(e){dt(e),Re=!0},i.clearConfig=function(){lt=null,Re=!1},i.isValidAttribute=function(e,t,n){lt||dt({});var r=me(e),i=me(t);return Et(r,i,n)},i.addHook=function(e,t){"function"==typeof t&&(fe[e]=fe[e]||[],A(fe[e],t))},i.removeHook=function(e){if(fe[e])return v(fe[e])},i.removeHooks=function(e){fe[e]&&(fe[e]=[])},i.removeAllHooks=function(){fe={}},i}()}()},84213:function(e,t,n){var r;e=n.nmd(e),function(){var i,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",l=32,c=128,u=1/0,d=9007199254740991,h=NaN,p=4294967295,f=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",l],["partialRight",64],["rearg",256]],g="[object Arguments]",m="[object Array]",y="[object Boolean]",v="[object Date]",A="[object Error]",b="[object Function]",w="[object GeneratorFunction]",S="[object Map]",C="[object Number]",E="[object Object]",I="[object Promise]",_="[object RegExp]",x="[object Set]",P="[object String]",k="[object Symbol]",B="[object WeakMap]",O="[object ArrayBuffer]",N="[object DataView]",D="[object Float32Array]",j="[object Float64Array]",T="[object Int8Array]",M="[object Int16Array]",F="[object Int32Array]",R="[object Uint8Array]",L="[object Uint8ClampedArray]",Q="[object Uint16Array]",U="[object Uint32Array]",V=/\b__p \+= '';/g,K=/\b(__p \+=) '' \+/g,H=/(__e\(.*?\)|\b__t\)) \+\n'';/g,G=/&(?:amp|lt|gt|quot|#39);/g,Y=/[&<>"']/g,z=RegExp(G.source),Z=RegExp(Y.source),W=/<%-([\s\S]+?)%>/g,q=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(te.source),re=/^\s+/,ie=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,se=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,le=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,ue=/\\(\\)?/g,de=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,he=/\w*$/,pe=/^[-+]0x[0-9a-f]+$/i,fe=/^0b[01]+$/i,ge=/^\[object .+?Constructor\]$/,me=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,ve=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ae=/($^)/,be=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",Se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ce="\\u2700-\\u27bf",Ee="a-z\\xdf-\\xf6\\xf8-\\xff",Ie="A-Z\\xc0-\\xd6\\xd8-\\xde",_e="\\ufe0e\\ufe0f",xe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Pe="["+we+"]",ke="["+xe+"]",Be="["+Se+"]",Oe="\\d+",Ne="["+Ce+"]",De="["+Ee+"]",je="[^"+we+xe+Oe+Ce+Ee+Ie+"]",Te="\\ud83c[\\udffb-\\udfff]",Me="[^"+we+"]",Fe="(?:\\ud83c[\\udde6-\\uddff]){2}",Re="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+Ie+"]",Qe="\\u200d",Ue="(?:"+De+"|"+je+")",Ve="(?:"+Le+"|"+je+")",Ke="(?:['’](?:d|ll|m|re|s|t|ve))?",He="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ge="(?:"+Be+"|"+Te+")?",Ye="["+_e+"]?",ze=Ye+Ge+"(?:"+Qe+"(?:"+[Me,Fe,Re].join("|")+")"+Ye+Ge+")*",Ze="(?:"+[Ne,Fe,Re].join("|")+")"+ze,We="(?:"+[Me+Be+"?",Be,Fe,Re,Pe].join("|")+")",qe=RegExp("['’]","g"),Je=RegExp(Be,"g"),Xe=RegExp(Te+"(?="+Te+")|"+We+ze,"g"),$e=RegExp([Le+"?"+De+"+"+Ke+"(?="+[ke,Le,"$"].join("|")+")",Ve+"+"+He+"(?="+[ke,Le+Ue,"$"].join("|")+")",Le+"?"+Ue+"+"+Ke,Le+"+"+He,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Oe,Ze].join("|"),"g"),et=RegExp("["+Qe+we+Se+_e+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rt=-1,it={};it[D]=it[j]=it[T]=it[M]=it[F]=it[R]=it[L]=it[Q]=it[U]=!0,it[g]=it[m]=it[O]=it[y]=it[N]=it[v]=it[A]=it[b]=it[S]=it[C]=it[E]=it[_]=it[x]=it[P]=it[B]=!1;var ot={};ot[g]=ot[m]=ot[O]=ot[N]=ot[y]=ot[v]=ot[D]=ot[j]=ot[T]=ot[M]=ot[F]=ot[S]=ot[C]=ot[E]=ot[_]=ot[x]=ot[P]=ot[k]=ot[R]=ot[L]=ot[Q]=ot[U]=!0,ot[A]=ot[b]=ot[B]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},at=parseFloat,lt=parseInt,ct="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ut="object"==typeof self&&self&&self.Object===Object&&self,dt=ct||ut||Function("return this")(),ht=t&&!t.nodeType&&t,pt=ht&&e&&!e.nodeType&&e,ft=pt&&pt.exports===ht,gt=ft&&ct.process,mt=function(){try{return pt&&pt.require&&pt.require("util").types||gt&&gt.binding&&gt.binding("util")}catch(e){}}(),yt=mt&&mt.isArrayBuffer,vt=mt&&mt.isDate,At=mt&&mt.isMap,bt=mt&&mt.isRegExp,wt=mt&&mt.isSet,St=mt&&mt.isTypedArray;function Ct(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Et(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(r,s,n(s),e)}return r}function It(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function _t(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function xt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Pt(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function kt(e,t){return!(null==e||!e.length)&&Lt(e,t,0)>-1}function Bt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Ot(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Nt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Dt(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function jt(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Tt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Mt=Kt("length");function Ft(e,t,n){var r;return n(e,(function(e,n,i){if(t(e,n,i))return r=n,!1})),r}function Rt(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Lt(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):Rt(e,Ut,n)}function Qt(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function Ut(e){return e!=e}function Vt(e,t){var n=null==e?0:e.length;return n?Yt(e,t)/n:h}function Kt(e){return function(t){return null==t?i:t[e]}}function Ht(e){return function(t){return null==e?i:e[t]}}function Gt(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}function Yt(e,t){for(var n,r=-1,o=e.length;++r<o;){var s=t(e[r]);s!==i&&(n=n===i?s:n+s)}return n}function zt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Zt(e){return e?e.slice(0,hn(e)+1).replace(re,""):e}function Wt(e){return function(t){return e(t)}}function qt(e,t){return Ot(t,(function(t){return e[t]}))}function Jt(e,t){return e.has(t)}function Xt(e,t){for(var n=-1,r=e.length;++n<r&&Lt(t,e[n],0)>-1;);return n}function $t(e,t){for(var n=e.length;n--&&Lt(t,e[n],0)>-1;);return n}var en=Ht({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tn=Ht({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function nn(e){return"\\"+st[e]}function rn(e){return et.test(e)}function on(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function sn(e,t){return function(n){return e(t(n))}}function an(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n];s!==t&&s!==a||(e[n]=a,o[i++]=n)}return o}function ln(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function cn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function un(e){return rn(e)?function(e){for(var t=Xe.lastIndex=0;Xe.test(e);)++t;return t}(e):Mt(e)}function dn(e){return rn(e)?function(e){return e.match(Xe)||[]}(e):function(e){return e.split("")}(e)}function hn(e){for(var t=e.length;t--&&ie.test(e.charAt(t)););return t}var pn=Ht({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),fn=function e(t){var n,r=(t=null==t?dt:fn.defaults(dt.Object(),t,fn.pick(dt,nt))).Array,ie=t.Date,we=t.Error,Se=t.Function,Ce=t.Math,Ee=t.Object,Ie=t.RegExp,_e=t.String,xe=t.TypeError,Pe=r.prototype,ke=Se.prototype,Be=Ee.prototype,Oe=t["__core-js_shared__"],Ne=ke.toString,De=Be.hasOwnProperty,je=0,Te=(n=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Me=Be.toString,Fe=Ne.call(Ee),Re=dt._,Le=Ie("^"+Ne.call(De).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Qe=ft?t.Buffer:i,Ue=t.Symbol,Ve=t.Uint8Array,Ke=Qe?Qe.allocUnsafe:i,He=sn(Ee.getPrototypeOf,Ee),Ge=Ee.create,Ye=Be.propertyIsEnumerable,ze=Pe.splice,Ze=Ue?Ue.isConcatSpreadable:i,We=Ue?Ue.iterator:i,Xe=Ue?Ue.toStringTag:i,et=function(){try{var e=lo(Ee,"defineProperty");return e({},"",{}),e}catch(e){}}(),st=t.clearTimeout!==dt.clearTimeout&&t.clearTimeout,ct=ie&&ie.now!==dt.Date.now&&ie.now,ut=t.setTimeout!==dt.setTimeout&&t.setTimeout,ht=Ce.ceil,pt=Ce.floor,gt=Ee.getOwnPropertySymbols,mt=Qe?Qe.isBuffer:i,Mt=t.isFinite,Ht=Pe.join,gn=sn(Ee.keys,Ee),mn=Ce.max,yn=Ce.min,vn=ie.now,An=t.parseInt,bn=Ce.random,wn=Pe.reverse,Sn=lo(t,"DataView"),Cn=lo(t,"Map"),En=lo(t,"Promise"),In=lo(t,"Set"),_n=lo(t,"WeakMap"),xn=lo(Ee,"create"),Pn=_n&&new _n,kn={},Bn=Fo(Sn),On=Fo(Cn),Nn=Fo(En),Dn=Fo(In),jn=Fo(_n),Tn=Ue?Ue.prototype:i,Mn=Tn?Tn.valueOf:i,Fn=Tn?Tn.toString:i;function Rn(e){if(ea(e)&&!Ks(e)&&!(e instanceof Vn)){if(e instanceof Un)return e;if(De.call(e,"__wrapped__"))return Ro(e)}return new Un(e)}var Ln=function(){function e(){}return function(t){if(!$s(t))return{};if(Ge)return Ge(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Qn(){}function Un(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Vn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=p,this.__views__=[]}function Kn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Hn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Gn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Yn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Gn;++t<n;)this.add(e[t])}function zn(e){var t=this.__data__=new Hn(e);this.size=t.size}function Zn(e,t){var n=Ks(e),r=!n&&Vs(e),i=!n&&!r&&zs(e),o=!n&&!r&&!i&&la(e),s=n||r||i||o,a=s?zt(e.length,_e):[],l=a.length;for(var c in e)!t&&!De.call(e,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||mo(c,l))||a.push(c);return a}function Wn(e){var t=e.length;return t?e[Gr(0,t-1)]:i}function qn(e,t){return No(_i(e),or(t,0,e.length))}function Jn(e){return No(_i(e))}function Xn(e,t,n){(n!==i&&!Ls(e[t],n)||n===i&&!(t in e))&&rr(e,t,n)}function $n(e,t,n){var r=e[t];De.call(e,t)&&Ls(r,n)&&(n!==i||t in e)||rr(e,t,n)}function er(e,t){for(var n=e.length;n--;)if(Ls(e[n][0],t))return n;return-1}function tr(e,t,n,r){return ur(e,(function(e,i,o){t(r,e,n(e),o)})),r}function nr(e,t){return e&&xi(t,Ba(t),e)}function rr(e,t,n){"__proto__"==t&&et?et(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ir(e,t){for(var n=-1,o=t.length,s=r(o),a=null==e;++n<o;)s[n]=a?i:Ia(e,t[n]);return s}function or(e,t,n){return e==e&&(n!==i&&(e=e<=n?e:n),t!==i&&(e=e>=t?e:t)),e}function sr(e,t,n,r,o,s){var a,l=1&t,c=2&t,u=4&t;if(n&&(a=o?n(e,r,o,s):n(e)),a!==i)return a;if(!$s(e))return e;var d=Ks(e);if(d){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&De.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!l)return _i(e,a)}else{var h=ho(e),p=h==b||h==w;if(zs(e))return bi(e,l);if(h==E||h==g||p&&!o){if(a=c||p?{}:fo(e),!l)return c?function(e,t){return xi(e,uo(e),t)}(e,function(e,t){return e&&xi(t,Oa(t),e)}(a,e)):function(e,t){return xi(e,co(e),t)}(e,nr(a,e))}else{if(!ot[h])return o?e:{};a=function(e,t,n){var r,i=e.constructor;switch(t){case O:return wi(e);case y:case v:return new i(+e);case N:return function(e,t){var n=t?wi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case D:case j:case T:case M:case F:case R:case L:case Q:case U:return Si(e,n);case S:return new i;case C:case P:return new i(e);case _:return function(e){var t=new e.constructor(e.source,he.exec(e));return t.lastIndex=e.lastIndex,t}(e);case x:return new i;case k:return r=e,Mn?Ee(Mn.call(r)):{}}}(e,h,l)}}s||(s=new zn);var f=s.get(e);if(f)return f;s.set(e,a),oa(e)?e.forEach((function(r){a.add(sr(r,t,n,r,e,s))})):ta(e)&&e.forEach((function(r,i){a.set(i,sr(r,t,n,i,e,s))}));var m=d?i:(u?c?to:eo:c?Oa:Ba)(e);return It(m||e,(function(r,i){m&&(r=e[i=r]),$n(a,i,sr(r,t,n,i,e,s))})),a}function ar(e,t,n){var r=n.length;if(null==e)return!r;for(e=Ee(e);r--;){var o=n[r],s=t[o],a=e[o];if(a===i&&!(o in e)||!s(a))return!1}return!0}function lr(e,t,n){if("function"!=typeof e)throw new xe(o);return Po((function(){e.apply(i,n)}),t)}function cr(e,t,n,r){var i=-1,o=kt,s=!0,a=e.length,l=[],c=t.length;if(!a)return l;n&&(t=Ot(t,Wt(n))),r?(o=Bt,s=!1):t.length>=200&&(o=Jt,s=!1,t=new Yn(t));e:for(;++i<a;){var u=e[i],d=null==n?u:n(u);if(u=r||0!==u?u:0,s&&d==d){for(var h=c;h--;)if(t[h]===d)continue e;l.push(u)}else o(t,d,r)||l.push(u)}return l}Rn.templateSettings={escape:W,evaluate:q,interpolate:J,variable:"",imports:{_:Rn}},Rn.prototype=Qn.prototype,Rn.prototype.constructor=Rn,Un.prototype=Ln(Qn.prototype),Un.prototype.constructor=Un,Vn.prototype=Ln(Qn.prototype),Vn.prototype.constructor=Vn,Kn.prototype.clear=function(){this.__data__=xn?xn(null):{},this.size=0},Kn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Kn.prototype.get=function(e){var t=this.__data__;if(xn){var n=t[e];return n===s?i:n}return De.call(t,e)?t[e]:i},Kn.prototype.has=function(e){var t=this.__data__;return xn?t[e]!==i:De.call(t,e)},Kn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=xn&&t===i?s:t,this},Hn.prototype.clear=function(){this.__data__=[],this.size=0},Hn.prototype.delete=function(e){var t=this.__data__,n=er(t,e);return!(n<0||(n==t.length-1?t.pop():ze.call(t,n,1),--this.size,0))},Hn.prototype.get=function(e){var t=this.__data__,n=er(t,e);return n<0?i:t[n][1]},Hn.prototype.has=function(e){return er(this.__data__,e)>-1},Hn.prototype.set=function(e,t){var n=this.__data__,r=er(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Gn.prototype.clear=function(){this.size=0,this.__data__={hash:new Kn,map:new(Cn||Hn),string:new Kn}},Gn.prototype.delete=function(e){var t=so(this,e).delete(e);return this.size-=t?1:0,t},Gn.prototype.get=function(e){return so(this,e).get(e)},Gn.prototype.has=function(e){return so(this,e).has(e)},Gn.prototype.set=function(e,t){var n=so(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Yn.prototype.add=Yn.prototype.push=function(e){return this.__data__.set(e,s),this},Yn.prototype.has=function(e){return this.__data__.has(e)},zn.prototype.clear=function(){this.__data__=new Hn,this.size=0},zn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},zn.prototype.get=function(e){return this.__data__.get(e)},zn.prototype.has=function(e){return this.__data__.has(e)},zn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Hn){var r=n.__data__;if(!Cn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Gn(r)}return n.set(e,t),this.size=n.size,this};var ur=Bi(vr),dr=Bi(Ar,!0);function hr(e,t){var n=!0;return ur(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function pr(e,t,n){for(var r=-1,o=e.length;++r<o;){var s=e[r],a=t(s);if(null!=a&&(l===i?a==a&&!aa(a):n(a,l)))var l=a,c=s}return c}function fr(e,t){var n=[];return ur(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}function gr(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=go),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?gr(a,t-1,n,r,i):Nt(i,a):r||(i[i.length]=a)}return i}var mr=Oi(),yr=Oi(!0);function vr(e,t){return e&&mr(e,t,Ba)}function Ar(e,t){return e&&yr(e,t,Ba)}function br(e,t){return Pt(t,(function(t){return qs(e[t])}))}function wr(e,t){for(var n=0,r=(t=mi(t,e)).length;null!=e&&n<r;)e=e[Mo(t[n++])];return n&&n==r?e:i}function Sr(e,t,n){var r=t(e);return Ks(e)?r:Nt(r,n(e))}function Cr(e){return null==e?e===i?"[object Undefined]":"[object Null]":Xe&&Xe in Ee(e)?function(e){var t=De.call(e,Xe),n=e[Xe];try{e[Xe]=i;var r=!0}catch(e){}var o=Me.call(e);return r&&(t?e[Xe]=n:delete e[Xe]),o}(e):function(e){return Me.call(e)}(e)}function Er(e,t){return e>t}function Ir(e,t){return null!=e&&De.call(e,t)}function _r(e,t){return null!=e&&t in Ee(e)}function xr(e,t,n){for(var o=n?Bt:kt,s=e[0].length,a=e.length,l=a,c=r(a),u=1/0,d=[];l--;){var h=e[l];l&&t&&(h=Ot(h,Wt(t))),u=yn(h.length,u),c[l]=!n&&(t||s>=120&&h.length>=120)?new Yn(l&&h):i}h=e[0];var p=-1,f=c[0];e:for(;++p<s&&d.length<u;){var g=h[p],m=t?t(g):g;if(g=n||0!==g?g:0,!(f?Jt(f,m):o(d,m,n))){for(l=a;--l;){var y=c[l];if(!(y?Jt(y,m):o(e[l],m,n)))continue e}f&&f.push(m),d.push(g)}}return d}function Pr(e,t,n){var r=null==(e=Io(e,t=mi(t,e)))?e:e[Mo(Wo(t))];return null==r?i:Ct(r,e,n)}function kr(e){return ea(e)&&Cr(e)==g}function Br(e,t,n,r,o){return e===t||(null==e||null==t||!ea(e)&&!ea(t)?e!=e&&t!=t:function(e,t,n,r,o,s){var a=Ks(e),l=Ks(t),c=a?m:ho(e),u=l?m:ho(t),d=(c=c==g?E:c)==E,h=(u=u==g?E:u)==E,p=c==u;if(p&&zs(e)){if(!zs(t))return!1;a=!0,d=!1}if(p&&!d)return s||(s=new zn),a||la(e)?Xi(e,t,n,r,o,s):function(e,t,n,r,i,o,s){switch(n){case N:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case O:return!(e.byteLength!=t.byteLength||!o(new Ve(e),new Ve(t)));case y:case v:case C:return Ls(+e,+t);case A:return e.name==t.name&&e.message==t.message;case _:case P:return e==t+"";case S:var a=on;case x:var l=1&r;if(a||(a=ln),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=2,s.set(e,t);var u=Xi(a(e),a(t),r,i,o,s);return s.delete(e),u;case k:if(Mn)return Mn.call(e)==Mn.call(t)}return!1}(e,t,c,n,r,o,s);if(!(1&n)){var f=d&&De.call(e,"__wrapped__"),b=h&&De.call(t,"__wrapped__");if(f||b){var w=f?e.value():e,I=b?t.value():t;return s||(s=new zn),o(w,I,n,r,s)}}return!!p&&(s||(s=new zn),function(e,t,n,r,o,s){var a=1&n,l=eo(e),c=l.length;if(c!=eo(t).length&&!a)return!1;for(var u=c;u--;){var d=l[u];if(!(a?d in t:De.call(t,d)))return!1}var h=s.get(e),p=s.get(t);if(h&&p)return h==t&&p==e;var f=!0;s.set(e,t),s.set(t,e);for(var g=a;++u<c;){var m=e[d=l[u]],y=t[d];if(r)var v=a?r(y,m,d,t,e,s):r(m,y,d,e,t,s);if(!(v===i?m===y||o(m,y,n,r,s):v)){f=!1;break}g||(g="constructor"==d)}if(f&&!g){var A=e.constructor,b=t.constructor;A==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof A&&A instanceof A&&"function"==typeof b&&b instanceof b||(f=!1)}return s.delete(e),s.delete(t),f}(e,t,n,r,o,s))}(e,t,n,r,Br,o))}function Or(e,t,n,r){var o=n.length,s=o,a=!r;if(null==e)return!s;for(e=Ee(e);o--;){var l=n[o];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<s;){var c=(l=n[o])[0],u=e[c],d=l[1];if(a&&l[2]){if(u===i&&!(c in e))return!1}else{var h=new zn;if(r)var p=r(u,d,c,e,t,h);if(!(p===i?Br(d,u,3,r,h):p))return!1}}return!0}function Nr(e){return!(!$s(e)||(t=e,Te&&Te in t))&&(qs(e)?Le:ge).test(Fo(e));var t}function Dr(e){return"function"==typeof e?e:null==e?nl:"object"==typeof e?Ks(e)?Rr(e[0],e[1]):Fr(e):dl(e)}function jr(e){if(!wo(e))return gn(e);var t=[];for(var n in Ee(e))De.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Tr(e,t){return e<t}function Mr(e,t){var n=-1,i=Gs(e)?r(e.length):[];return ur(e,(function(e,r,o){i[++n]=t(e,r,o)})),i}function Fr(e){var t=ao(e);return 1==t.length&&t[0][2]?Co(t[0][0],t[0][1]):function(n){return n===e||Or(n,e,t)}}function Rr(e,t){return vo(e)&&So(t)?Co(Mo(e),t):function(n){var r=Ia(n,e);return r===i&&r===t?_a(n,e):Br(t,r,3)}}function Lr(e,t,n,r,o){e!==t&&mr(t,(function(s,a){if(o||(o=new zn),$s(s))!function(e,t,n,r,o,s,a){var l=_o(e,n),c=_o(t,n),u=a.get(c);if(u)Xn(e,n,u);else{var d=s?s(l,c,n+"",e,t,a):i,h=d===i;if(h){var p=Ks(c),f=!p&&zs(c),g=!p&&!f&&la(c);d=c,p||f||g?Ks(l)?d=l:Ys(l)?d=_i(l):f?(h=!1,d=bi(c,!0)):g?(h=!1,d=Si(c,!0)):d=[]:ra(c)||Vs(c)?(d=l,Vs(l)?d=ma(l):$s(l)&&!qs(l)||(d=fo(c))):h=!1}h&&(a.set(c,d),o(d,c,r,s,a),a.delete(c)),Xn(e,n,d)}}(e,t,a,n,Lr,r,o);else{var l=r?r(_o(e,a),s,a+"",e,t,o):i;l===i&&(l=s),Xn(e,a,l)}}),Oa)}function Qr(e,t){var n=e.length;if(n)return mo(t+=t<0?n:0,n)?e[t]:i}function Ur(e,t,n){t=t.length?Ot(t,(function(e){return Ks(e)?function(t){return wr(t,1===e.length?e[0]:e)}:e})):[nl];var r=-1;t=Ot(t,Wt(oo()));var i=Mr(e,(function(e,n,i){var o=Ot(t,(function(t){return t(e)}));return{criteria:o,index:++r,value:e}}));return function(e,t){var r=e.length;for(e.sort((function(e,t){return function(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,s=i.length,a=n.length;++r<s;){var l=Ci(i[r],o[r]);if(l)return r>=a?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}));r--;)e[r]=e[r].value;return e}(i)}function Vr(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var s=t[r],a=wr(e,s);n(a,s)&&qr(o,mi(s,e),a)}return o}function Kr(e,t,n,r){var i=r?Qt:Lt,o=-1,s=t.length,a=e;for(e===t&&(t=_i(t)),n&&(a=Ot(e,Wt(n)));++o<s;)for(var l=0,c=t[o],u=n?n(c):c;(l=i(a,u,l,r))>-1;)a!==e&&ze.call(a,l,1),ze.call(e,l,1);return e}function Hr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;mo(i)?ze.call(e,i,1):li(e,i)}}return e}function Gr(e,t){return e+pt(bn()*(t-e+1))}function Yr(e,t){var n="";if(!e||t<1||t>d)return n;do{t%2&&(n+=e),(t=pt(t/2))&&(e+=e)}while(t);return n}function zr(e,t){return ko(Eo(e,t,nl),e+"")}function Zr(e){return Wn(La(e))}function Wr(e,t){var n=La(e);return No(n,or(t,0,n.length))}function qr(e,t,n,r){if(!$s(e))return e;for(var o=-1,s=(t=mi(t,e)).length,a=s-1,l=e;null!=l&&++o<s;){var c=Mo(t[o]),u=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var d=l[c];(u=r?r(d,c,l):i)===i&&(u=$s(d)?d:mo(t[o+1])?[]:{})}$n(l,c,u),l=l[c]}return e}var Jr=Pn?function(e,t){return Pn.set(e,t),e}:nl,Xr=et?function(e,t){return et(e,"toString",{configurable:!0,enumerable:!1,value:$a(t),writable:!0})}:nl;function $r(e){return No(La(e))}function ei(e,t,n){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var s=r(o);++i<o;)s[i]=e[i+t];return s}function ti(e,t){var n;return ur(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n}function ni(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var o=r+i>>>1,s=e[o];null!==s&&!aa(s)&&(n?s<=t:s<t)?r=o+1:i=o}return i}return ri(e,t,nl,n)}function ri(e,t,n,r){var o=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(t=n(t))!=t,l=null===t,c=aa(t),u=t===i;o<s;){var d=pt((o+s)/2),h=n(e[d]),p=h!==i,f=null===h,g=h==h,m=aa(h);if(a)var y=r||g;else y=u?g&&(r||p):l?g&&p&&(r||!f):c?g&&p&&!f&&(r||!m):!f&&!m&&(r?h<=t:h<t);y?o=d+1:s=d}return yn(s,4294967294)}function ii(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n],a=t?t(s):s;if(!n||!Ls(a,l)){var l=a;o[i++]=0===s?0:s}}return o}function oi(e){return"number"==typeof e?e:aa(e)?h:+e}function si(e){if("string"==typeof e)return e;if(Ks(e))return Ot(e,si)+"";if(aa(e))return Fn?Fn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ai(e,t,n){var r=-1,i=kt,o=e.length,s=!0,a=[],l=a;if(n)s=!1,i=Bt;else if(o>=200){var c=t?null:Yi(e);if(c)return ln(c);s=!1,i=Jt,l=new Yn}else l=t?[]:a;e:for(;++r<o;){var u=e[r],d=t?t(u):u;if(u=n||0!==u?u:0,s&&d==d){for(var h=l.length;h--;)if(l[h]===d)continue e;t&&l.push(d),a.push(u)}else i(l,d,n)||(l!==a&&l.push(d),a.push(u))}return a}function li(e,t){return null==(e=Io(e,t=mi(t,e)))||delete e[Mo(Wo(t))]}function ci(e,t,n,r){return qr(e,t,n(wr(e,t)),r)}function ui(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?ei(e,r?0:o,r?o+1:i):ei(e,r?o+1:0,r?i:o)}function di(e,t){var n=e;return n instanceof Vn&&(n=n.value()),Dt(t,(function(e,t){return t.func.apply(t.thisArg,Nt([e],t.args))}),n)}function hi(e,t,n){var i=e.length;if(i<2)return i?ai(e[0]):[];for(var o=-1,s=r(i);++o<i;)for(var a=e[o],l=-1;++l<i;)l!=o&&(s[o]=cr(s[o]||a,e[l],t,n));return ai(gr(s,1),t,n)}function pi(e,t,n){for(var r=-1,o=e.length,s=t.length,a={};++r<o;){var l=r<s?t[r]:i;n(a,e[r],l)}return a}function fi(e){return Ys(e)?e:[]}function gi(e){return"function"==typeof e?e:nl}function mi(e,t){return Ks(e)?e:vo(e,t)?[e]:To(ya(e))}var yi=zr;function vi(e,t,n){var r=e.length;return n=n===i?r:n,!t&&n>=r?e:ei(e,t,n)}var Ai=st||function(e){return dt.clearTimeout(e)};function bi(e,t){if(t)return e.slice();var n=e.length,r=Ke?Ke(n):new e.constructor(n);return e.copy(r),r}function wi(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function Si(e,t){var n=t?wi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ci(e,t){if(e!==t){var n=e!==i,r=null===e,o=e==e,s=aa(e),a=t!==i,l=null===t,c=t==t,u=aa(t);if(!l&&!u&&!s&&e>t||s&&a&&c&&!l&&!u||r&&a&&c||!n&&c||!o)return 1;if(!r&&!s&&!u&&e<t||u&&n&&o&&!r&&!s||l&&n&&o||!a&&o||!c)return-1}return 0}function Ei(e,t,n,i){for(var o=-1,s=e.length,a=n.length,l=-1,c=t.length,u=mn(s-a,0),d=r(c+u),h=!i;++l<c;)d[l]=t[l];for(;++o<a;)(h||o<s)&&(d[n[o]]=e[o]);for(;u--;)d[l++]=e[o++];return d}function Ii(e,t,n,i){for(var o=-1,s=e.length,a=-1,l=n.length,c=-1,u=t.length,d=mn(s-l,0),h=r(d+u),p=!i;++o<d;)h[o]=e[o];for(var f=o;++c<u;)h[f+c]=t[c];for(;++a<l;)(p||o<s)&&(h[f+n[a]]=e[o++]);return h}function _i(e,t){var n=-1,i=e.length;for(t||(t=r(i));++n<i;)t[n]=e[n];return t}function xi(e,t,n,r){var o=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var l=t[s],c=r?r(n[l],e[l],l,n,e):i;c===i&&(c=e[l]),o?rr(n,l,c):$n(n,l,c)}return n}function Pi(e,t){return function(n,r){var i=Ks(n)?Et:tr,o=t?t():{};return i(n,e,oo(r,2),o)}}function ki(e){return zr((function(t,n){var r=-1,o=n.length,s=o>1?n[o-1]:i,a=o>2?n[2]:i;for(s=e.length>3&&"function"==typeof s?(o--,s):i,a&&yo(n[0],n[1],a)&&(s=o<3?i:s,o=1),t=Ee(t);++r<o;){var l=n[r];l&&e(t,l,r,s)}return t}))}function Bi(e,t){return function(n,r){if(null==n)return n;if(!Gs(n))return e(n,r);for(var i=n.length,o=t?i:-1,s=Ee(n);(t?o--:++o<i)&&!1!==r(s[o],o,s););return n}}function Oi(e){return function(t,n,r){for(var i=-1,o=Ee(t),s=r(t),a=s.length;a--;){var l=s[e?a:++i];if(!1===n(o[l],l,o))break}return t}}function Ni(e){return function(t){var n=rn(t=ya(t))?dn(t):i,r=n?n[0]:t.charAt(0),o=n?vi(n,1).join(""):t.slice(1);return r[e]()+o}}function Di(e){return function(t){return Dt(qa(Va(t).replace(qe,"")),e,"")}}function ji(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Ln(e.prototype),r=e.apply(n,t);return $s(r)?r:n}}function Ti(e){return function(t,n,r){var o=Ee(t);if(!Gs(t)){var s=oo(n,3);t=Ba(t),n=function(e){return s(o[e],e,o)}}var a=e(t,n,r);return a>-1?o[s?t[a]:a]:i}}function Mi(e){return $i((function(t){var n=t.length,r=n,s=Un.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new xe(o);if(s&&!l&&"wrapper"==ro(a))var l=new Un([],!0)}for(r=l?r:n;++r<n;){var c=ro(a=t[r]),u="wrapper"==c?no(a):i;l=u&&Ao(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[ro(u[0])].apply(l,u[3]):1==a.length&&Ao(a)?l[c]():l.thru(a)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&Ks(r))return l.plant(r).value();for(var i=0,o=n?t[i].apply(this,e):r;++i<n;)o=t[i].call(this,o);return o}}))}function Fi(e,t,n,o,s,a,l,u,d,h){var p=t&c,f=1&t,g=2&t,m=24&t,y=512&t,v=g?i:ji(e);return function c(){for(var A=arguments.length,b=r(A),w=A;w--;)b[w]=arguments[w];if(m)var S=io(c),C=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(b,S);if(o&&(b=Ei(b,o,s,m)),a&&(b=Ii(b,a,l,m)),A-=C,m&&A<h){var E=an(b,S);return Hi(e,t,Fi,c.placeholder,n,b,E,u,d,h-A)}var I=f?n:this,_=g?I[e]:e;return A=b.length,u?b=function(e,t){for(var n=e.length,r=yn(t.length,n),o=_i(e);r--;){var s=t[r];e[r]=mo(s,n)?o[s]:i}return e}(b,u):y&&A>1&&b.reverse(),p&&d<A&&(b.length=d),this&&this!==dt&&this instanceof c&&(_=v||ji(_)),_.apply(I,b)}}function Ri(e,t){return function(n,r){return function(e,t,n,r){return vr(e,(function(e,i,o){t(r,n(e),i,o)})),r}(n,e,t(r),{})}}function Li(e,t){return function(n,r){var o;if(n===i&&r===i)return t;if(n!==i&&(o=n),r!==i){if(o===i)return r;"string"==typeof n||"string"==typeof r?(n=si(n),r=si(r)):(n=oi(n),r=oi(r)),o=e(n,r)}return o}}function Qi(e){return $i((function(t){return t=Ot(t,Wt(oo())),zr((function(n){var r=this;return e(t,(function(e){return Ct(e,r,n)}))}))}))}function Ui(e,t){var n=(t=t===i?" ":si(t)).length;if(n<2)return n?Yr(t,e):t;var r=Yr(t,ht(e/un(t)));return rn(t)?vi(dn(r),0,e).join(""):r.slice(0,e)}function Vi(e){return function(t,n,o){return o&&"number"!=typeof o&&yo(t,n,o)&&(n=o=i),t=ha(t),n===i?(n=t,t=0):n=ha(n),function(e,t,n,i){for(var o=-1,s=mn(ht((t-e)/(n||1)),0),a=r(s);s--;)a[i?s:++o]=e,e+=n;return a}(t,n,o=o===i?t<n?1:-1:ha(o),e)}}function Ki(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ga(t),n=ga(n)),e(t,n)}}function Hi(e,t,n,r,o,s,a,c,u,d){var h=8&t;t|=h?l:64,4&(t&=~(h?64:l))||(t&=-4);var p=[e,t,o,h?s:i,h?a:i,h?i:s,h?i:a,c,u,d],f=n.apply(i,p);return Ao(e)&&xo(f,p),f.placeholder=r,Bo(f,e,t)}function Gi(e){var t=Ce[e];return function(e,n){if(e=ga(e),(n=null==n?0:yn(pa(n),292))&&Mt(e)){var r=(ya(e)+"e").split("e");return+((r=(ya(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Yi=In&&1/ln(new In([,-0]))[1]==u?function(e){return new In(e)}:al;function zi(e){return function(t){var n=ho(t);return n==S?on(t):n==x?cn(t):function(e,t){return Ot(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Zi(e,t,n,s,u,d,h,p){var f=2&t;if(!f&&"function"!=typeof e)throw new xe(o);var g=s?s.length:0;if(g||(t&=-97,s=u=i),h=h===i?h:mn(pa(h),0),p=p===i?p:pa(p),g-=u?u.length:0,64&t){var m=s,y=u;s=u=i}var v=f?i:no(e),A=[e,t,n,s,u,m,y,d,h,p];if(v&&function(e,t){var n=e[1],r=t[1],i=n|r,o=i<131,s=r==c&&8==n||r==c&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!o&&!s)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var l=t[3];if(l){var u=e[3];e[3]=u?Ei(u,l,t[4]):l,e[4]=u?an(e[3],a):t[4]}(l=t[5])&&(u=e[5],e[5]=u?Ii(u,l,t[6]):l,e[6]=u?an(e[5],a):t[6]),(l=t[7])&&(e[7]=l),r&c&&(e[8]=null==e[8]?t[8]:yn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(A,v),e=A[0],t=A[1],n=A[2],s=A[3],u=A[4],!(p=A[9]=A[9]===i?f?0:e.length:mn(A[9]-g,0))&&24&t&&(t&=-25),t&&1!=t)b=8==t||16==t?function(e,t,n){var o=ji(e);return function s(){for(var a=arguments.length,l=r(a),c=a,u=io(s);c--;)l[c]=arguments[c];var d=a<3&&l[0]!==u&&l[a-1]!==u?[]:an(l,u);return(a-=d.length)<n?Hi(e,t,Fi,s.placeholder,i,l,d,i,i,n-a):Ct(this&&this!==dt&&this instanceof s?o:e,this,l)}}(e,t,p):t!=l&&33!=t||u.length?Fi.apply(i,A):function(e,t,n,i){var o=1&t,s=ji(e);return function t(){for(var a=-1,l=arguments.length,c=-1,u=i.length,d=r(u+l),h=this&&this!==dt&&this instanceof t?s:e;++c<u;)d[c]=i[c];for(;l--;)d[c++]=arguments[++a];return Ct(h,o?n:this,d)}}(e,t,n,s);else var b=function(e,t,n){var r=1&t,i=ji(e);return function t(){return(this&&this!==dt&&this instanceof t?i:e).apply(r?n:this,arguments)}}(e,t,n);return Bo((v?Jr:xo)(b,A),e,t)}function Wi(e,t,n,r){return e===i||Ls(e,Be[n])&&!De.call(r,n)?t:e}function qi(e,t,n,r,o,s){return $s(e)&&$s(t)&&(s.set(t,e),Lr(e,t,i,qi,s),s.delete(t)),e}function Ji(e){return ra(e)?i:e}function Xi(e,t,n,r,o,s){var a=1&n,l=e.length,c=t.length;if(l!=c&&!(a&&c>l))return!1;var u=s.get(e),d=s.get(t);if(u&&d)return u==t&&d==e;var h=-1,p=!0,f=2&n?new Yn:i;for(s.set(e,t),s.set(t,e);++h<l;){var g=e[h],m=t[h];if(r)var y=a?r(m,g,h,t,e,s):r(g,m,h,e,t,s);if(y!==i){if(y)continue;p=!1;break}if(f){if(!Tt(t,(function(e,t){if(!Jt(f,t)&&(g===e||o(g,e,n,r,s)))return f.push(t)}))){p=!1;break}}else if(g!==m&&!o(g,m,n,r,s)){p=!1;break}}return s.delete(e),s.delete(t),p}function $i(e){return ko(Eo(e,i,Ho),e+"")}function eo(e){return Sr(e,Ba,co)}function to(e){return Sr(e,Oa,uo)}var no=Pn?function(e){return Pn.get(e)}:al;function ro(e){for(var t=e.name+"",n=kn[t],r=De.call(kn,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function io(e){return(De.call(Rn,"placeholder")?Rn:e).placeholder}function oo(){var e=Rn.iteratee||rl;return e=e===rl?Dr:e,arguments.length?e(arguments[0],arguments[1]):e}function so(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function ao(e){for(var t=Ba(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,So(i)]}return t}function lo(e,t){var n=function(e,t){return null==e?i:e[t]}(e,t);return Nr(n)?n:i}var co=gt?function(e){return null==e?[]:(e=Ee(e),Pt(gt(e),(function(t){return Ye.call(e,t)})))}:fl,uo=gt?function(e){for(var t=[];e;)Nt(t,co(e)),e=He(e);return t}:fl,ho=Cr;function po(e,t,n){for(var r=-1,i=(t=mi(t,e)).length,o=!1;++r<i;){var s=Mo(t[r]);if(!(o=null!=e&&n(e,s)))break;e=e[s]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Xs(i)&&mo(s,i)&&(Ks(e)||Vs(e))}function fo(e){return"function"!=typeof e.constructor||wo(e)?{}:Ln(He(e))}function go(e){return Ks(e)||Vs(e)||!!(Ze&&e&&e[Ze])}function mo(e,t){var n=typeof e;return!!(t=null==t?d:t)&&("number"==n||"symbol"!=n&&ye.test(e))&&e>-1&&e%1==0&&e<t}function yo(e,t,n){if(!$s(n))return!1;var r=typeof t;return!!("number"==r?Gs(n)&&mo(t,n.length):"string"==r&&t in n)&&Ls(n[t],e)}function vo(e,t){if(Ks(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!aa(e))||$.test(e)||!X.test(e)||null!=t&&e in Ee(t)}function Ao(e){var t=ro(e),n=Rn[t];if("function"!=typeof n||!(t in Vn.prototype))return!1;if(e===n)return!0;var r=no(n);return!!r&&e===r[0]}(Sn&&ho(new Sn(new ArrayBuffer(1)))!=N||Cn&&ho(new Cn)!=S||En&&ho(En.resolve())!=I||In&&ho(new In)!=x||_n&&ho(new _n)!=B)&&(ho=function(e){var t=Cr(e),n=t==E?e.constructor:i,r=n?Fo(n):"";if(r)switch(r){case Bn:return N;case On:return S;case Nn:return I;case Dn:return x;case jn:return B}return t});var bo=Oe?qs:gl;function wo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Be)}function So(e){return e==e&&!$s(e)}function Co(e,t){return function(n){return null!=n&&n[e]===t&&(t!==i||e in Ee(n))}}function Eo(e,t,n){return t=mn(t===i?e.length-1:t,0),function(){for(var i=arguments,o=-1,s=mn(i.length-t,0),a=r(s);++o<s;)a[o]=i[t+o];o=-1;for(var l=r(t+1);++o<t;)l[o]=i[o];return l[t]=n(a),Ct(e,this,l)}}function Io(e,t){return t.length<2?e:wr(e,ei(t,0,-1))}function _o(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var xo=Oo(Jr),Po=ut||function(e,t){return dt.setTimeout(e,t)},ko=Oo(Xr);function Bo(e,t,n){var r=t+"";return ko(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return It(f,(function(n){var r="_."+n[0];t&n[1]&&!kt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(se);return t?t[1].split(ae):[]}(r),n)))}function Oo(e){var t=0,n=0;return function(){var r=vn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function No(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n<t;){var s=Gr(n,o),a=e[s];e[s]=e[n],e[n]=a}return e.length=t,e}var Do,jo,To=(Do=Ds((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ee,(function(e,n,r,i){t.push(r?i.replace(ue,"$1"):n||e)})),t}),(function(e){return 500===jo.size&&jo.clear(),e})),jo=Do.cache,Do);function Mo(e){if("string"==typeof e||aa(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Fo(e){if(null!=e){try{return Ne.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ro(e){if(e instanceof Vn)return e.clone();var t=new Un(e.__wrapped__,e.__chain__);return t.__actions__=_i(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Lo=zr((function(e,t){return Ys(e)?cr(e,gr(t,1,Ys,!0)):[]})),Qo=zr((function(e,t){var n=Wo(t);return Ys(n)&&(n=i),Ys(e)?cr(e,gr(t,1,Ys,!0),oo(n,2)):[]})),Uo=zr((function(e,t){var n=Wo(t);return Ys(n)&&(n=i),Ys(e)?cr(e,gr(t,1,Ys,!0),i,n):[]}));function Vo(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:pa(n);return i<0&&(i=mn(r+i,0)),Rt(e,oo(t,3),i)}function Ko(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r-1;return n!==i&&(o=pa(n),o=n<0?mn(r+o,0):yn(o,r-1)),Rt(e,oo(t,3),o,!0)}function Ho(e){return null!=e&&e.length?gr(e,1):[]}function Go(e){return e&&e.length?e[0]:i}var Yo=zr((function(e){var t=Ot(e,fi);return t.length&&t[0]===e[0]?xr(t):[]})),zo=zr((function(e){var t=Wo(e),n=Ot(e,fi);return t===Wo(n)?t=i:n.pop(),n.length&&n[0]===e[0]?xr(n,oo(t,2)):[]})),Zo=zr((function(e){var t=Wo(e),n=Ot(e,fi);return(t="function"==typeof t?t:i)&&n.pop(),n.length&&n[0]===e[0]?xr(n,i,t):[]}));function Wo(e){var t=null==e?0:e.length;return t?e[t-1]:i}var qo=zr(Jo);function Jo(e,t){return e&&e.length&&t&&t.length?Kr(e,t):e}var Xo=$i((function(e,t){var n=null==e?0:e.length,r=ir(e,t);return Hr(e,Ot(t,(function(e){return mo(e,n)?+e:e})).sort(Ci)),r}));function $o(e){return null==e?e:wn.call(e)}var es=zr((function(e){return ai(gr(e,1,Ys,!0))})),ts=zr((function(e){var t=Wo(e);return Ys(t)&&(t=i),ai(gr(e,1,Ys,!0),oo(t,2))})),ns=zr((function(e){var t=Wo(e);return t="function"==typeof t?t:i,ai(gr(e,1,Ys,!0),i,t)}));function rs(e){if(!e||!e.length)return[];var t=0;return e=Pt(e,(function(e){if(Ys(e))return t=mn(e.length,t),!0})),zt(t,(function(t){return Ot(e,Kt(t))}))}function is(e,t){if(!e||!e.length)return[];var n=rs(e);return null==t?n:Ot(n,(function(e){return Ct(t,i,e)}))}var os=zr((function(e,t){return Ys(e)?cr(e,t):[]})),ss=zr((function(e){return hi(Pt(e,Ys))})),as=zr((function(e){var t=Wo(e);return Ys(t)&&(t=i),hi(Pt(e,Ys),oo(t,2))})),ls=zr((function(e){var t=Wo(e);return t="function"==typeof t?t:i,hi(Pt(e,Ys),i,t)})),cs=zr(rs),us=zr((function(e){var t=e.length,n=t>1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,is(e,n)}));function ds(e){var t=Rn(e);return t.__chain__=!0,t}function hs(e,t){return t(e)}var ps=$i((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return ir(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Vn&&mo(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:hs,args:[o],thisArg:i}),new Un(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)})),fs=Pi((function(e,t,n){De.call(e,n)?++e[n]:rr(e,n,1)})),gs=Ti(Vo),ms=Ti(Ko);function ys(e,t){return(Ks(e)?It:ur)(e,oo(t,3))}function vs(e,t){return(Ks(e)?_t:dr)(e,oo(t,3))}var As=Pi((function(e,t,n){De.call(e,n)?e[n].push(t):rr(e,n,[t])})),bs=zr((function(e,t,n){var i=-1,o="function"==typeof t,s=Gs(e)?r(e.length):[];return ur(e,(function(e){s[++i]=o?Ct(t,e,n):Pr(e,t,n)})),s})),ws=Pi((function(e,t,n){rr(e,n,t)}));function Ss(e,t){return(Ks(e)?Ot:Mr)(e,oo(t,3))}var Cs=Pi((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]})),Es=zr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&yo(e,t[0],t[1])?t=[]:n>2&&yo(t[0],t[1],t[2])&&(t=[t[0]]),Ur(e,gr(t,1),[])})),Is=ct||function(){return dt.Date.now()};function _s(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Zi(e,c,i,i,i,i,t)}function xs(e,t){var n;if("function"!=typeof t)throw new xe(o);return e=pa(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var Ps=zr((function(e,t,n){var r=1;if(n.length){var i=an(n,io(Ps));r|=l}return Zi(e,r,t,n,i)})),ks=zr((function(e,t,n){var r=3;if(n.length){var i=an(n,io(ks));r|=l}return Zi(t,r,e,n,i)}));function Bs(e,t,n){var r,s,a,l,c,u,d=0,h=!1,p=!1,f=!0;if("function"!=typeof e)throw new xe(o);function g(t){var n=r,o=s;return r=s=i,d=t,l=e.apply(o,n)}function m(e){var n=e-u;return u===i||n>=t||n<0||p&&e-d>=a}function y(){var e=Is();if(m(e))return v(e);c=Po(y,function(e){var n=t-(e-u);return p?yn(n,a-(e-d)):n}(e))}function v(e){return c=i,f&&r?g(e):(r=s=i,l)}function A(){var e=Is(),n=m(e);if(r=arguments,s=this,u=e,n){if(c===i)return function(e){return d=e,c=Po(y,t),h?g(e):l}(u);if(p)return Ai(c),c=Po(y,t),g(u)}return c===i&&(c=Po(y,t)),l}return t=ga(t)||0,$s(n)&&(h=!!n.leading,a=(p="maxWait"in n)?mn(ga(n.maxWait)||0,t):a,f="trailing"in n?!!n.trailing:f),A.cancel=function(){c!==i&&Ai(c),d=0,r=u=s=c=i},A.flush=function(){return c===i?l:v(Is())},A}var Os=zr((function(e,t){return lr(e,1,t)})),Ns=zr((function(e,t,n){return lr(e,ga(t)||0,n)}));function Ds(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new xe(o);var n=function n(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Ds.Cache||Gn),n}function js(e){if("function"!=typeof e)throw new xe(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ds.Cache=Gn;var Ts=yi((function(e,t){var n=(t=1==t.length&&Ks(t[0])?Ot(t[0],Wt(oo())):Ot(gr(t,1),Wt(oo()))).length;return zr((function(r){for(var i=-1,o=yn(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return Ct(e,this,r)}))})),Ms=zr((function(e,t){var n=an(t,io(Ms));return Zi(e,l,i,t,n)})),Fs=zr((function(e,t){var n=an(t,io(Fs));return Zi(e,64,i,t,n)})),Rs=$i((function(e,t){return Zi(e,256,i,i,i,t)}));function Ls(e,t){return e===t||e!=e&&t!=t}var Qs=Ki(Er),Us=Ki((function(e,t){return e>=t})),Vs=kr(function(){return arguments}())?kr:function(e){return ea(e)&&De.call(e,"callee")&&!Ye.call(e,"callee")},Ks=r.isArray,Hs=yt?Wt(yt):function(e){return ea(e)&&Cr(e)==O};function Gs(e){return null!=e&&Xs(e.length)&&!qs(e)}function Ys(e){return ea(e)&&Gs(e)}var zs=mt||gl,Zs=vt?Wt(vt):function(e){return ea(e)&&Cr(e)==v};function Ws(e){if(!ea(e))return!1;var t=Cr(e);return t==A||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ra(e)}function qs(e){if(!$s(e))return!1;var t=Cr(e);return t==b||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Js(e){return"number"==typeof e&&e==pa(e)}function Xs(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=d}function $s(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ea(e){return null!=e&&"object"==typeof e}var ta=At?Wt(At):function(e){return ea(e)&&ho(e)==S};function na(e){return"number"==typeof e||ea(e)&&Cr(e)==C}function ra(e){if(!ea(e)||Cr(e)!=E)return!1;var t=He(e);if(null===t)return!0;var n=De.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ne.call(n)==Fe}var ia=bt?Wt(bt):function(e){return ea(e)&&Cr(e)==_},oa=wt?Wt(wt):function(e){return ea(e)&&ho(e)==x};function sa(e){return"string"==typeof e||!Ks(e)&&ea(e)&&Cr(e)==P}function aa(e){return"symbol"==typeof e||ea(e)&&Cr(e)==k}var la=St?Wt(St):function(e){return ea(e)&&Xs(e.length)&&!!it[Cr(e)]},ca=Ki(Tr),ua=Ki((function(e,t){return e<=t}));function da(e){if(!e)return[];if(Gs(e))return sa(e)?dn(e):_i(e);if(We&&e[We])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[We]());var t=ho(e);return(t==S?on:t==x?ln:La)(e)}function ha(e){return e?(e=ga(e))===u||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function pa(e){var t=ha(e),n=t%1;return t==t?n?t-n:t:0}function fa(e){return e?or(pa(e),0,p):0}function ga(e){if("number"==typeof e)return e;if(aa(e))return h;if($s(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=$s(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Zt(e);var n=fe.test(e);return n||me.test(e)?lt(e.slice(2),n?2:8):pe.test(e)?h:+e}function ma(e){return xi(e,Oa(e))}function ya(e){return null==e?"":si(e)}var va=ki((function(e,t){if(wo(t)||Gs(t))xi(t,Ba(t),e);else for(var n in t)De.call(t,n)&&$n(e,n,t[n])})),Aa=ki((function(e,t){xi(t,Oa(t),e)})),ba=ki((function(e,t,n,r){xi(t,Oa(t),e,r)})),wa=ki((function(e,t,n,r){xi(t,Ba(t),e,r)})),Sa=$i(ir),Ca=zr((function(e,t){e=Ee(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&yo(t[0],t[1],o)&&(r=1);++n<r;)for(var s=t[n],a=Oa(s),l=-1,c=a.length;++l<c;){var u=a[l],d=e[u];(d===i||Ls(d,Be[u])&&!De.call(e,u))&&(e[u]=s[u])}return e})),Ea=zr((function(e){return e.push(i,qi),Ct(Da,i,e)}));function Ia(e,t,n){var r=null==e?i:wr(e,t);return r===i?n:r}function _a(e,t){return null!=e&&po(e,t,_r)}var xa=Ri((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Me.call(t)),e[t]=n}),$a(nl)),Pa=Ri((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Me.call(t)),De.call(e,t)?e[t].push(n):e[t]=[n]}),oo),ka=zr(Pr);function Ba(e){return Gs(e)?Zn(e):jr(e)}function Oa(e){return Gs(e)?Zn(e,!0):function(e){if(!$s(e))return function(e){var t=[];if(null!=e)for(var n in Ee(e))t.push(n);return t}(e);var t=wo(e),n=[];for(var r in e)("constructor"!=r||!t&&De.call(e,r))&&n.push(r);return n}(e)}var Na=ki((function(e,t,n){Lr(e,t,n)})),Da=ki((function(e,t,n,r){Lr(e,t,n,r)})),ja=$i((function(e,t){var n={};if(null==e)return n;var r=!1;t=Ot(t,(function(t){return t=mi(t,e),r||(r=t.length>1),t})),xi(e,to(e),n),r&&(n=sr(n,7,Ji));for(var i=t.length;i--;)li(n,t[i]);return n})),Ta=$i((function(e,t){return null==e?{}:function(e,t){return Vr(e,t,(function(t,n){return _a(e,n)}))}(e,t)}));function Ma(e,t){if(null==e)return{};var n=Ot(to(e),(function(e){return[e]}));return t=oo(t),Vr(e,n,(function(e,n){return t(e,n[0])}))}var Fa=zi(Ba),Ra=zi(Oa);function La(e){return null==e?[]:qt(e,Ba(e))}var Qa=Di((function(e,t,n){return t=t.toLowerCase(),e+(n?Ua(t):t)}));function Ua(e){return Wa(ya(e).toLowerCase())}function Va(e){return(e=ya(e))&&e.replace(ve,en).replace(Je,"")}var Ka=Di((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Ha=Di((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Ga=Ni("toLowerCase"),Ya=Di((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()})),za=Di((function(e,t,n){return e+(n?" ":"")+Wa(t)})),Za=Di((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Wa=Ni("toUpperCase");function qa(e,t,n){return e=ya(e),(t=n?i:t)===i?function(e){return tt.test(e)}(e)?function(e){return e.match($e)||[]}(e):function(e){return e.match(le)||[]}(e):e.match(t)||[]}var Ja=zr((function(e,t){try{return Ct(e,i,t)}catch(e){return Ws(e)?e:new we(e)}})),Xa=$i((function(e,t){return It(t,(function(t){t=Mo(t),rr(e,t,Ps(e[t],e))})),e}));function $a(e){return function(){return e}}var el=Mi(),tl=Mi(!0);function nl(e){return e}function rl(e){return Dr("function"==typeof e?e:sr(e,1))}var il=zr((function(e,t){return function(n){return Pr(n,e,t)}})),ol=zr((function(e,t){return function(n){return Pr(e,n,t)}}));function sl(e,t,n){var r=Ba(t),i=br(t,r);null!=n||$s(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=br(t,Ba(t)));var o=!($s(n)&&"chain"in n&&!n.chain),s=qs(e);return It(i,(function(n){var r=t[n];e[n]=r,s&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=_i(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Nt([this.value()],arguments))})})),e}function al(){}var ll=Qi(Ot),cl=Qi(xt),ul=Qi(Tt);function dl(e){return vo(e)?Kt(Mo(e)):function(e){return function(t){return wr(t,e)}}(e)}var hl=Vi(),pl=Vi(!0);function fl(){return[]}function gl(){return!1}var ml,yl=Li((function(e,t){return e+t}),0),vl=Gi("ceil"),Al=Li((function(e,t){return e/t}),1),bl=Gi("floor"),wl=Li((function(e,t){return e*t}),1),Sl=Gi("round"),Cl=Li((function(e,t){return e-t}),0);return Rn.after=function(e,t){if("function"!=typeof t)throw new xe(o);return e=pa(e),function(){if(--e<1)return t.apply(this,arguments)}},Rn.ary=_s,Rn.assign=va,Rn.assignIn=Aa,Rn.assignInWith=ba,Rn.assignWith=wa,Rn.at=Sa,Rn.before=xs,Rn.bind=Ps,Rn.bindAll=Xa,Rn.bindKey=ks,Rn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ks(e)?e:[e]},Rn.chain=ds,Rn.chunk=function(e,t,n){t=(n?yo(e,t,n):t===i)?1:mn(pa(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var s=0,a=0,l=r(ht(o/t));s<o;)l[a++]=ei(e,s,s+=t);return l},Rn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},Rn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],i=e;i--;)t[i-1]=arguments[i];return Nt(Ks(n)?_i(n):[n],gr(t,1))},Rn.cond=function(e){var t=null==e?0:e.length,n=oo();return e=t?Ot(e,(function(e){if("function"!=typeof e[1])throw new xe(o);return[n(e[0]),e[1]]})):[],zr((function(n){for(var r=-1;++r<t;){var i=e[r];if(Ct(i[0],this,n))return Ct(i[1],this,n)}}))},Rn.conforms=function(e){return function(e){var t=Ba(e);return function(n){return ar(n,e,t)}}(sr(e,1))},Rn.constant=$a,Rn.countBy=fs,Rn.create=function(e,t){var n=Ln(e);return null==t?n:nr(n,t)},Rn.curry=function e(t,n,r){var o=Zi(t,8,i,i,i,i,i,n=r?i:n);return o.placeholder=e.placeholder,o},Rn.curryRight=function e(t,n,r){var o=Zi(t,16,i,i,i,i,i,n=r?i:n);return o.placeholder=e.placeholder,o},Rn.debounce=Bs,Rn.defaults=Ca,Rn.defaultsDeep=Ea,Rn.defer=Os,Rn.delay=Ns,Rn.difference=Lo,Rn.differenceBy=Qo,Rn.differenceWith=Uo,Rn.drop=function(e,t,n){var r=null==e?0:e.length;return r?ei(e,(t=n||t===i?1:pa(t))<0?0:t,r):[]},Rn.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?ei(e,0,(t=r-(t=n||t===i?1:pa(t)))<0?0:t):[]},Rn.dropRightWhile=function(e,t){return e&&e.length?ui(e,oo(t,3),!0,!0):[]},Rn.dropWhile=function(e,t){return e&&e.length?ui(e,oo(t,3),!0):[]},Rn.fill=function(e,t,n,r){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&yo(e,t,n)&&(n=0,r=o),function(e,t,n,r){var o=e.length;for((n=pa(n))<0&&(n=-n>o?0:o+n),(r=r===i||r>o?o:pa(r))<0&&(r+=o),r=n>r?0:fa(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Rn.filter=function(e,t){return(Ks(e)?Pt:fr)(e,oo(t,3))},Rn.flatMap=function(e,t){return gr(Ss(e,t),1)},Rn.flatMapDeep=function(e,t){return gr(Ss(e,t),u)},Rn.flatMapDepth=function(e,t,n){return n=n===i?1:pa(n),gr(Ss(e,t),n)},Rn.flatten=Ho,Rn.flattenDeep=function(e){return null!=e&&e.length?gr(e,u):[]},Rn.flattenDepth=function(e,t){return null!=e&&e.length?gr(e,t=t===i?1:pa(t)):[]},Rn.flip=function(e){return Zi(e,512)},Rn.flow=el,Rn.flowRight=tl,Rn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},Rn.functions=function(e){return null==e?[]:br(e,Ba(e))},Rn.functionsIn=function(e){return null==e?[]:br(e,Oa(e))},Rn.groupBy=As,Rn.initial=function(e){return null!=e&&e.length?ei(e,0,-1):[]},Rn.intersection=Yo,Rn.intersectionBy=zo,Rn.intersectionWith=Zo,Rn.invert=xa,Rn.invertBy=Pa,Rn.invokeMap=bs,Rn.iteratee=rl,Rn.keyBy=ws,Rn.keys=Ba,Rn.keysIn=Oa,Rn.map=Ss,Rn.mapKeys=function(e,t){var n={};return t=oo(t,3),vr(e,(function(e,r,i){rr(n,t(e,r,i),e)})),n},Rn.mapValues=function(e,t){var n={};return t=oo(t,3),vr(e,(function(e,r,i){rr(n,r,t(e,r,i))})),n},Rn.matches=function(e){return Fr(sr(e,1))},Rn.matchesProperty=function(e,t){return Rr(e,sr(t,1))},Rn.memoize=Ds,Rn.merge=Na,Rn.mergeWith=Da,Rn.method=il,Rn.methodOf=ol,Rn.mixin=sl,Rn.negate=js,Rn.nthArg=function(e){return e=pa(e),zr((function(t){return Qr(t,e)}))},Rn.omit=ja,Rn.omitBy=function(e,t){return Ma(e,js(oo(t)))},Rn.once=function(e){return xs(2,e)},Rn.orderBy=function(e,t,n,r){return null==e?[]:(Ks(t)||(t=null==t?[]:[t]),Ks(n=r?i:n)||(n=null==n?[]:[n]),Ur(e,t,n))},Rn.over=ll,Rn.overArgs=Ts,Rn.overEvery=cl,Rn.overSome=ul,Rn.partial=Ms,Rn.partialRight=Fs,Rn.partition=Cs,Rn.pick=Ta,Rn.pickBy=Ma,Rn.property=dl,Rn.propertyOf=function(e){return function(t){return null==e?i:wr(e,t)}},Rn.pull=qo,Rn.pullAll=Jo,Rn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Kr(e,t,oo(n,2)):e},Rn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Kr(e,t,i,n):e},Rn.pullAt=Xo,Rn.range=hl,Rn.rangeRight=pl,Rn.rearg=Rs,Rn.reject=function(e,t){return(Ks(e)?Pt:fr)(e,js(oo(t,3)))},Rn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=oo(t,3);++r<o;){var s=e[r];t(s,r,e)&&(n.push(s),i.push(r))}return Hr(e,i),n},Rn.rest=function(e,t){if("function"!=typeof e)throw new xe(o);return zr(e,t=t===i?t:pa(t))},Rn.reverse=$o,Rn.sampleSize=function(e,t,n){return t=(n?yo(e,t,n):t===i)?1:pa(t),(Ks(e)?qn:Wr)(e,t)},Rn.set=function(e,t,n){return null==e?e:qr(e,t,n)},Rn.setWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:qr(e,t,n,r)},Rn.shuffle=function(e){return(Ks(e)?Jn:$r)(e)},Rn.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&yo(e,t,n)?(t=0,n=r):(t=null==t?0:pa(t),n=n===i?r:pa(n)),ei(e,t,n)):[]},Rn.sortBy=Es,Rn.sortedUniq=function(e){return e&&e.length?ii(e):[]},Rn.sortedUniqBy=function(e,t){return e&&e.length?ii(e,oo(t,2)):[]},Rn.split=function(e,t,n){return n&&"number"!=typeof n&&yo(e,t,n)&&(t=n=i),(n=n===i?p:n>>>0)?(e=ya(e))&&("string"==typeof t||null!=t&&!ia(t))&&!(t=si(t))&&rn(e)?vi(dn(e),0,n):e.split(t,n):[]},Rn.spread=function(e,t){if("function"!=typeof e)throw new xe(o);return t=null==t?0:mn(pa(t),0),zr((function(n){var r=n[t],i=vi(n,0,t);return r&&Nt(i,r),Ct(e,this,i)}))},Rn.tail=function(e){var t=null==e?0:e.length;return t?ei(e,1,t):[]},Rn.take=function(e,t,n){return e&&e.length?ei(e,0,(t=n||t===i?1:pa(t))<0?0:t):[]},Rn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?ei(e,(t=r-(t=n||t===i?1:pa(t)))<0?0:t,r):[]},Rn.takeRightWhile=function(e,t){return e&&e.length?ui(e,oo(t,3),!1,!0):[]},Rn.takeWhile=function(e,t){return e&&e.length?ui(e,oo(t,3)):[]},Rn.tap=function(e,t){return t(e),e},Rn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new xe(o);return $s(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Bs(e,t,{leading:r,maxWait:t,trailing:i})},Rn.thru=hs,Rn.toArray=da,Rn.toPairs=Fa,Rn.toPairsIn=Ra,Rn.toPath=function(e){return Ks(e)?Ot(e,Mo):aa(e)?[e]:_i(To(ya(e)))},Rn.toPlainObject=ma,Rn.transform=function(e,t,n){var r=Ks(e),i=r||zs(e)||la(e);if(t=oo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:$s(e)&&qs(o)?Ln(He(e)):{}}return(i?It:vr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Rn.unary=function(e){return _s(e,1)},Rn.union=es,Rn.unionBy=ts,Rn.unionWith=ns,Rn.uniq=function(e){return e&&e.length?ai(e):[]},Rn.uniqBy=function(e,t){return e&&e.length?ai(e,oo(t,2)):[]},Rn.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?ai(e,i,t):[]},Rn.unset=function(e,t){return null==e||li(e,t)},Rn.unzip=rs,Rn.unzipWith=is,Rn.update=function(e,t,n){return null==e?e:ci(e,t,gi(n))},Rn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:ci(e,t,gi(n),r)},Rn.values=La,Rn.valuesIn=function(e){return null==e?[]:qt(e,Oa(e))},Rn.without=os,Rn.words=qa,Rn.wrap=function(e,t){return Ms(gi(t),e)},Rn.xor=ss,Rn.xorBy=as,Rn.xorWith=ls,Rn.zip=cs,Rn.zipObject=function(e,t){return pi(e||[],t||[],$n)},Rn.zipObjectDeep=function(e,t){return pi(e||[],t||[],qr)},Rn.zipWith=us,Rn.entries=Fa,Rn.entriesIn=Ra,Rn.extend=Aa,Rn.extendWith=ba,sl(Rn,Rn),Rn.add=yl,Rn.attempt=Ja,Rn.camelCase=Qa,Rn.capitalize=Ua,Rn.ceil=vl,Rn.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=ga(n))==n?n:0),t!==i&&(t=(t=ga(t))==t?t:0),or(ga(e),t,n)},Rn.clone=function(e){return sr(e,4)},Rn.cloneDeep=function(e){return sr(e,5)},Rn.cloneDeepWith=function(e,t){return sr(e,5,t="function"==typeof t?t:i)},Rn.cloneWith=function(e,t){return sr(e,4,t="function"==typeof t?t:i)},Rn.conformsTo=function(e,t){return null==t||ar(e,t,Ba(t))},Rn.deburr=Va,Rn.defaultTo=function(e,t){return null==e||e!=e?t:e},Rn.divide=Al,Rn.endsWith=function(e,t,n){e=ya(e),t=si(t);var r=e.length,o=n=n===i?r:or(pa(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Rn.eq=Ls,Rn.escape=function(e){return(e=ya(e))&&Z.test(e)?e.replace(Y,tn):e},Rn.escapeRegExp=function(e){return(e=ya(e))&&ne.test(e)?e.replace(te,"\\$&"):e},Rn.every=function(e,t,n){var r=Ks(e)?xt:hr;return n&&yo(e,t,n)&&(t=i),r(e,oo(t,3))},Rn.find=gs,Rn.findIndex=Vo,Rn.findKey=function(e,t){return Ft(e,oo(t,3),vr)},Rn.findLast=ms,Rn.findLastIndex=Ko,Rn.findLastKey=function(e,t){return Ft(e,oo(t,3),Ar)},Rn.floor=bl,Rn.forEach=ys,Rn.forEachRight=vs,Rn.forIn=function(e,t){return null==e?e:mr(e,oo(t,3),Oa)},Rn.forInRight=function(e,t){return null==e?e:yr(e,oo(t,3),Oa)},Rn.forOwn=function(e,t){return e&&vr(e,oo(t,3))},Rn.forOwnRight=function(e,t){return e&&Ar(e,oo(t,3))},Rn.get=Ia,Rn.gt=Qs,Rn.gte=Us,Rn.has=function(e,t){return null!=e&&po(e,t,Ir)},Rn.hasIn=_a,Rn.head=Go,Rn.identity=nl,Rn.includes=function(e,t,n,r){e=Gs(e)?e:La(e),n=n&&!r?pa(n):0;var i=e.length;return n<0&&(n=mn(i+n,0)),sa(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Lt(e,t,n)>-1},Rn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:pa(n);return i<0&&(i=mn(r+i,0)),Lt(e,t,i)},Rn.inRange=function(e,t,n){return t=ha(t),n===i?(n=t,t=0):n=ha(n),function(e,t,n){return e>=yn(t,n)&&e<mn(t,n)}(e=ga(e),t,n)},Rn.invoke=ka,Rn.isArguments=Vs,Rn.isArray=Ks,Rn.isArrayBuffer=Hs,Rn.isArrayLike=Gs,Rn.isArrayLikeObject=Ys,Rn.isBoolean=function(e){return!0===e||!1===e||ea(e)&&Cr(e)==y},Rn.isBuffer=zs,Rn.isDate=Zs,Rn.isElement=function(e){return ea(e)&&1===e.nodeType&&!ra(e)},Rn.isEmpty=function(e){if(null==e)return!0;if(Gs(e)&&(Ks(e)||"string"==typeof e||"function"==typeof e.splice||zs(e)||la(e)||Vs(e)))return!e.length;var t=ho(e);if(t==S||t==x)return!e.size;if(wo(e))return!jr(e).length;for(var n in e)if(De.call(e,n))return!1;return!0},Rn.isEqual=function(e,t){return Br(e,t)},Rn.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:i)?n(e,t):i;return r===i?Br(e,t,i,n):!!r},Rn.isError=Ws,Rn.isFinite=function(e){return"number"==typeof e&&Mt(e)},Rn.isFunction=qs,Rn.isInteger=Js,Rn.isLength=Xs,Rn.isMap=ta,Rn.isMatch=function(e,t){return e===t||Or(e,t,ao(t))},Rn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:i,Or(e,t,ao(t),n)},Rn.isNaN=function(e){return na(e)&&e!=+e},Rn.isNative=function(e){if(bo(e))throw new we("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Nr(e)},Rn.isNil=function(e){return null==e},Rn.isNull=function(e){return null===e},Rn.isNumber=na,Rn.isObject=$s,Rn.isObjectLike=ea,Rn.isPlainObject=ra,Rn.isRegExp=ia,Rn.isSafeInteger=function(e){return Js(e)&&e>=-9007199254740991&&e<=d},Rn.isSet=oa,Rn.isString=sa,Rn.isSymbol=aa,Rn.isTypedArray=la,Rn.isUndefined=function(e){return e===i},Rn.isWeakMap=function(e){return ea(e)&&ho(e)==B},Rn.isWeakSet=function(e){return ea(e)&&"[object WeakSet]"==Cr(e)},Rn.join=function(e,t){return null==e?"":Ht.call(e,t)},Rn.kebabCase=Ka,Rn.last=Wo,Rn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=pa(n))<0?mn(r+o,0):yn(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Rt(e,Ut,o,!0)},Rn.lowerCase=Ha,Rn.lowerFirst=Ga,Rn.lt=ca,Rn.lte=ua,Rn.max=function(e){return e&&e.length?pr(e,nl,Er):i},Rn.maxBy=function(e,t){return e&&e.length?pr(e,oo(t,2),Er):i},Rn.mean=function(e){return Vt(e,nl)},Rn.meanBy=function(e,t){return Vt(e,oo(t,2))},Rn.min=function(e){return e&&e.length?pr(e,nl,Tr):i},Rn.minBy=function(e,t){return e&&e.length?pr(e,oo(t,2),Tr):i},Rn.stubArray=fl,Rn.stubFalse=gl,Rn.stubObject=function(){return{}},Rn.stubString=function(){return""},Rn.stubTrue=function(){return!0},Rn.multiply=wl,Rn.nth=function(e,t){return e&&e.length?Qr(e,pa(t)):i},Rn.noConflict=function(){return dt._===this&&(dt._=Re),this},Rn.noop=al,Rn.now=Is,Rn.pad=function(e,t,n){e=ya(e);var r=(t=pa(t))?un(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Ui(pt(i),n)+e+Ui(ht(i),n)},Rn.padEnd=function(e,t,n){e=ya(e);var r=(t=pa(t))?un(e):0;return t&&r<t?e+Ui(t-r,n):e},Rn.padStart=function(e,t,n){e=ya(e);var r=(t=pa(t))?un(e):0;return t&&r<t?Ui(t-r,n)+e:e},Rn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),An(ya(e).replace(re,""),t||0)},Rn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&yo(e,t,n)&&(t=n=i),n===i&&("boolean"==typeof t?(n=t,t=i):"boolean"==typeof e&&(n=e,e=i)),e===i&&t===i?(e=0,t=1):(e=ha(e),t===i?(t=e,e=0):t=ha(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var o=bn();return yn(e+o*(t-e+at("1e-"+((o+"").length-1))),t)}return Gr(e,t)},Rn.reduce=function(e,t,n){var r=Ks(e)?Dt:Gt,i=arguments.length<3;return r(e,oo(t,4),n,i,ur)},Rn.reduceRight=function(e,t,n){var r=Ks(e)?jt:Gt,i=arguments.length<3;return r(e,oo(t,4),n,i,dr)},Rn.repeat=function(e,t,n){return t=(n?yo(e,t,n):t===i)?1:pa(t),Yr(ya(e),t)},Rn.replace=function(){var e=arguments,t=ya(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Rn.result=function(e,t,n){var r=-1,o=(t=mi(t,e)).length;for(o||(o=1,e=i);++r<o;){var s=null==e?i:e[Mo(t[r])];s===i&&(r=o,s=n),e=qs(s)?s.call(e):s}return e},Rn.round=Sl,Rn.runInContext=e,Rn.sample=function(e){return(Ks(e)?Wn:Zr)(e)},Rn.size=function(e){if(null==e)return 0;if(Gs(e))return sa(e)?un(e):e.length;var t=ho(e);return t==S||t==x?e.size:jr(e).length},Rn.snakeCase=Ya,Rn.some=function(e,t,n){var r=Ks(e)?Tt:ti;return n&&yo(e,t,n)&&(t=i),r(e,oo(t,3))},Rn.sortedIndex=function(e,t){return ni(e,t)},Rn.sortedIndexBy=function(e,t,n){return ri(e,t,oo(n,2))},Rn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=ni(e,t);if(r<n&&Ls(e[r],t))return r}return-1},Rn.sortedLastIndex=function(e,t){return ni(e,t,!0)},Rn.sortedLastIndexBy=function(e,t,n){return ri(e,t,oo(n,2),!0)},Rn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=ni(e,t,!0)-1;if(Ls(e[n],t))return n}return-1},Rn.startCase=za,Rn.startsWith=function(e,t,n){return e=ya(e),n=null==n?0:or(pa(n),0,e.length),t=si(t),e.slice(n,n+t.length)==t},Rn.subtract=Cl,Rn.sum=function(e){return e&&e.length?Yt(e,nl):0},Rn.sumBy=function(e,t){return e&&e.length?Yt(e,oo(t,2)):0},Rn.template=function(e,t,n){var r=Rn.templateSettings;n&&yo(e,t,n)&&(t=i),e=ya(e),t=ba({},t,r,Wi);var o,s,a=ba({},t.imports,r.imports,Wi),l=Ba(a),c=qt(a,l),u=0,d=t.interpolate||Ae,h="__p += '",p=Ie((t.escape||Ae).source+"|"+d.source+"|"+(d===J?de:Ae).source+"|"+(t.evaluate||Ae).source+"|$","g"),f="//# sourceURL="+(De.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++rt+"]")+"\n";e.replace(p,(function(t,n,r,i,a,l){return r||(r=i),h+=e.slice(u,l).replace(be,nn),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),a&&(s=!0,h+="';\n"+a+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=l+t.length,t})),h+="';\n";var g=De.call(t,"variable")&&t.variable;if(g){if(ce.test(g))throw new we("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(s?h.replace(V,""):h).replace(K,"$1").replace(H,"$1;"),h="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var m=Ja((function(){return Se(l,f+"return "+h).apply(i,c)}));if(m.source=h,Ws(m))throw m;return m},Rn.times=function(e,t){if((e=pa(e))<1||e>d)return[];var n=p,r=yn(e,p);t=oo(t),e-=p;for(var i=zt(r,t);++n<e;)t(n);return i},Rn.toFinite=ha,Rn.toInteger=pa,Rn.toLength=fa,Rn.toLower=function(e){return ya(e).toLowerCase()},Rn.toNumber=ga,Rn.toSafeInteger=function(e){return e?or(pa(e),-9007199254740991,d):0===e?e:0},Rn.toString=ya,Rn.toUpper=function(e){return ya(e).toUpperCase()},Rn.trim=function(e,t,n){if((e=ya(e))&&(n||t===i))return Zt(e);if(!e||!(t=si(t)))return e;var r=dn(e),o=dn(t);return vi(r,Xt(r,o),$t(r,o)+1).join("")},Rn.trimEnd=function(e,t,n){if((e=ya(e))&&(n||t===i))return e.slice(0,hn(e)+1);if(!e||!(t=si(t)))return e;var r=dn(e);return vi(r,0,$t(r,dn(t))+1).join("")},Rn.trimStart=function(e,t,n){if((e=ya(e))&&(n||t===i))return e.replace(re,"");if(!e||!(t=si(t)))return e;var r=dn(e);return vi(r,Xt(r,dn(t))).join("")},Rn.truncate=function(e,t){var n=30,r="...";if($s(t)){var o="separator"in t?t.separator:o;n="length"in t?pa(t.length):n,r="omission"in t?si(t.omission):r}var s=(e=ya(e)).length;if(rn(e)){var a=dn(e);s=a.length}if(n>=s)return e;var l=n-un(r);if(l<1)return r;var c=a?vi(a,0,l).join(""):e.slice(0,l);if(o===i)return c+r;if(a&&(l+=c.length-l),ia(o)){if(e.slice(l).search(o)){var u,d=c;for(o.global||(o=Ie(o.source,ya(he.exec(o))+"g")),o.lastIndex=0;u=o.exec(d);)var h=u.index;c=c.slice(0,h===i?l:h)}}else if(e.indexOf(si(o),l)!=l){var p=c.lastIndexOf(o);p>-1&&(c=c.slice(0,p))}return c+r},Rn.unescape=function(e){return(e=ya(e))&&z.test(e)?e.replace(G,pn):e},Rn.uniqueId=function(e){var t=++je;return ya(e)+t},Rn.upperCase=Za,Rn.upperFirst=Wa,Rn.each=ys,Rn.eachRight=vs,Rn.first=Go,sl(Rn,(ml={},vr(Rn,(function(e,t){De.call(Rn.prototype,t)||(ml[t]=e)})),ml),{chain:!1}),Rn.VERSION="4.17.21",It(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Rn[e].placeholder=Rn})),It(["drop","take"],(function(e,t){Vn.prototype[e]=function(n){n=n===i?1:mn(pa(n),0);var r=this.__filtered__&&!t?new Vn(this):this.clone();return r.__filtered__?r.__takeCount__=yn(n,r.__takeCount__):r.__views__.push({size:yn(n,p),type:e+(r.__dir__<0?"Right":"")}),r},Vn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),It(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Vn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:oo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),It(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Vn.prototype[e]=function(){return this[n](1).value()[0]}})),It(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Vn.prototype[e]=function(){return this.__filtered__?new Vn(this):this[n](1)}})),Vn.prototype.compact=function(){return this.filter(nl)},Vn.prototype.find=function(e){return this.filter(e).head()},Vn.prototype.findLast=function(e){return this.reverse().find(e)},Vn.prototype.invokeMap=zr((function(e,t){return"function"==typeof e?new Vn(this):this.map((function(n){return Pr(n,e,t)}))})),Vn.prototype.reject=function(e){return this.filter(js(oo(e)))},Vn.prototype.slice=function(e,t){e=pa(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Vn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=pa(t))<0?n.dropRight(-t):n.take(t-e)),n)},Vn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Vn.prototype.toArray=function(){return this.take(p)},vr(Vn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Rn[r?"take"+("last"==t?"Right":""):t],s=r||/^find/.test(t);o&&(Rn.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,l=t instanceof Vn,c=a[0],u=l||Ks(t),d=function(e){var t=o.apply(Rn,Nt([e],a));return r&&h?t[0]:t};u&&n&&"function"==typeof c&&1!=c.length&&(l=u=!1);var h=this.__chain__,p=!!this.__actions__.length,f=s&&!h,g=l&&!p;if(!s&&u){t=g?t:new Vn(this);var m=e.apply(t,a);return m.__actions__.push({func:hs,args:[d],thisArg:i}),new Un(m,h)}return f&&g?e.apply(this,a):(m=this.thru(d),f?r?m.value()[0]:m.value():m)})})),It(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Pe[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Rn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ks(i)?i:[],e)}return this[n]((function(n){return t.apply(Ks(n)?n:[],e)}))}})),vr(Vn.prototype,(function(e,t){var n=Rn[t];if(n){var r=n.name+"";De.call(kn,r)||(kn[r]=[]),kn[r].push({name:t,func:n})}})),kn[Fi(i,2).name]=[{name:"wrapper",func:i}],Vn.prototype.clone=function(){var e=new Vn(this.__wrapped__);return e.__actions__=_i(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=_i(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=_i(this.__views__),e},Vn.prototype.reverse=function(){if(this.__filtered__){var e=new Vn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Vn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ks(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=yn(t,e+s);break;case"takeRight":e=mn(e,t-s)}}return{start:e,end:t}}(0,i,this.__views__),s=o.start,a=o.end,l=a-s,c=r?a:s-1,u=this.__iteratees__,d=u.length,h=0,p=yn(l,this.__takeCount__);if(!n||!r&&i==l&&p==l)return di(e,this.__actions__);var f=[];e:for(;l--&&h<p;){for(var g=-1,m=e[c+=t];++g<d;){var y=u[g],v=y.iteratee,A=y.type,b=v(m);if(2==A)m=b;else if(!b){if(1==A)continue e;break e}}f[h++]=m}return f},Rn.prototype.at=ps,Rn.prototype.chain=function(){return ds(this)},Rn.prototype.commit=function(){return new Un(this.value(),this.__chain__)},Rn.prototype.next=function(){this.__values__===i&&(this.__values__=da(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Rn.prototype.plant=function(e){for(var t,n=this;n instanceof Qn;){var r=Ro(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Rn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Vn){var t=e;return this.__actions__.length&&(t=new Vn(this)),(t=t.reverse()).__actions__.push({func:hs,args:[$o],thisArg:i}),new Un(t,this.__chain__)}return this.thru($o)},Rn.prototype.toJSON=Rn.prototype.valueOf=Rn.prototype.value=function(){return di(this.__wrapped__,this.__actions__)},Rn.prototype.first=Rn.prototype.head,We&&(Rn.prototype[We]=function(){return this}),Rn}();dt._=fn,(r=function(){return fn}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},70439:(e,t,n)=>{const r=n(37520),i=Symbol("max"),o=Symbol("length"),s=Symbol("lengthCalculator"),a=Symbol("allowStale"),l=Symbol("maxAge"),c=Symbol("dispose"),u=Symbol("noDisposeOnSet"),d=Symbol("lruList"),h=Symbol("cache"),p=Symbol("updateAgeOnGet"),f=()=>1,g=(e,t,n)=>{const r=e[h].get(t);if(r){const t=r.value;if(m(e,t)){if(v(e,r),!e[a])return}else n&&(e[p]&&(r.value.now=Date.now()),e[d].unshiftNode(r));return t.value}},m=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[l]&&n>e[l]},y=e=>{if(e[o]>e[i])for(let t=e[d].tail;e[o]>e[i]&&null!==t;){const n=t.prev;v(e,t),t=n}},v=(e,t)=>{if(t){const n=t.value;e[c]&&e[c](n.key,n.value),e[o]-=n.length,e[h].delete(n.key),e[d].removeNode(t)}};class A{constructor(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}}const b=(e,t,n,r)=>{let i=n.value;m(e,i)&&(v(e,n),e[a]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[i]=e.max||1/0;const t=e.length||f;if(this[s]="function"!=typeof t?f:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[c]=e.dispose,this[u]=e.noDisposeOnSet||!1,this[p]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,y(this)}get max(){return this[i]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,y(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=f),e!==this[s]&&(this[s]=e,this[o]=0,this[d].forEach((e=>{e.length=this[s](e.value,e.key),this[o]+=e.length}))),y(this)}get lengthCalculator(){return this[s]}get length(){return this[o]}get itemCount(){return this[d].length}rforEach(e,t){t=t||this;for(let n=this[d].tail;null!==n;){const r=n.prev;b(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[d].head;null!==n;){const r=n.next;b(this,e,n,t),n=r}}keys(){return this[d].toArray().map((e=>e.key))}values(){return this[d].toArray().map((e=>e.value))}reset(){this[c]&&this[d]&&this[d].length&&this[d].forEach((e=>this[c](e.key,e.value))),this[h]=new Map,this[d]=new r,this[o]=0}dump(){return this[d].map((e=>!m(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[d]}set(e,t,n){if((n=n||this[l])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const r=n?Date.now():0,a=this[s](t,e);if(this[h].has(e)){if(a>this[i])return v(this,this[h].get(e)),!1;const s=this[h].get(e).value;return this[c]&&(this[u]||this[c](e,s.value)),s.now=r,s.maxAge=n,s.value=t,this[o]+=a-s.length,s.length=a,this.get(e),y(this),!0}const p=new A(e,t,a,r,n);return p.length>this[i]?(this[c]&&this[c](e,t),!1):(this[o]+=p.length,this[d].unshift(p),this[h].set(e,this[d].head),y(this),!0)}has(e){if(!this[h].has(e))return!1;const t=this[h].get(e).value;return!m(this,t)}get(e){return g(this,e,!0)}peek(e){return g(this,e,!1)}pop(){const e=this[d].tail;return e?(v(this,e),e.value):null}del(e){v(this,this[h].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{const e=i-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[h].forEach(((e,t)=>g(this,t,!1)))}}},74732:(e,t,n)=>{const r=Symbol("SemVer ANY");class i{static get ANY(){return r}constructor(e,t){if(t=o(t),e instanceof i){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),c("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===r?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(e){const t=this.options.loose?s[a.COMPARATORLOOSE]:s[a.COMPARATOR],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: ".concat(e));this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new u(n[2],this.options.loose):this.semver=r}toString(){return this.value}test(e){if(c("Comparator.test",e,this.options.loose),this.semver===r||e===r)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):!((t=o(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=i;const o=n(81042),{safeRe:s,t:a}=n(47045),l=n(30706),c=n(52997),u=n(47566),d=n(13246)},13246:(e,t,n)=>{class r{constructor(e,t){if(t=o(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof s)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(this.raw));if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!m(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&y(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&f)|(this.options.loose&&g))+":"+e,n=i.get(t);if(n)return n;const r=this.options.loose,o=r?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(o,k(this.options.includePrerelease)),a("hyphen replace",e),e=e.replace(c[u.COMPARATORTRIM],d),a("comparator trim",e),e=e.replace(c[u.TILDETRIM],h),a("tilde trim",e),e=e.replace(c[u.CARETTRIM],p),a("caret trim",e);let l=e.split(" ").map((e=>A(e,this.options))).join(" ").split(/\s+/).map((e=>P(e,this.options)));r&&(l=l.filter((e=>(a("loose invalid filter",e,this.options),!!e.match(c[u.COMPARATORLOOSE]))))),a("range list",l);const y=new Map,v=l.map((e=>new s(e,this.options)));for(const e of v){if(m(e))return[e];y.set(e.value,e)}y.size>1&&y.has("")&&y.delete("");const b=[...y.values()];return i.set(t,b),b}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some((n=>v(n,t)&&e.set.some((e=>v(e,t)&&n.every((n=>e.every((e=>n.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(B(this.set[t],e,this.options))return!0;return!1}}e.exports=r;const i=new(n(70439))({max:1e3}),o=n(81042),s=n(74732),a=n(52997),l=n(47566),{safeRe:c,t:u,comparatorTrimReplace:d,tildeTrimReplace:h,caretTrimReplace:p}=n(47045),{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:g}=n(46212),m=e=>"<0.0.0-0"===e.value,y=e=>""===e.value,v=(e,t)=>{let n=!0;const r=e.slice();let i=r.pop();for(;n&&r.length;)n=r.every((e=>i.intersects(e,t))),i=r.pop();return n},A=(e,t)=>(a("comp",e,t),e=C(e,t),a("caret",e),e=w(e,t),a("tildes",e),e=I(e,t),a("xrange",e),e=x(e,t),a("stars",e),e),b=e=>!e||"x"===e.toLowerCase()||"*"===e,w=(e,t)=>e.trim().split(/\s+/).map((e=>S(e,t))).join(" "),S=(e,t)=>{const n=t.loose?c[u.TILDELOOSE]:c[u.TILDE];return e.replace(n,((t,n,r,i,o)=>{let s;return a("tilde",e,t,n,r,i,o),b(n)?s="":b(r)?s=">=".concat(n,".0.0 <").concat(+n+1,".0.0-0"):b(i)?s=">=".concat(n,".").concat(r,".0 <").concat(n,".").concat(+r+1,".0-0"):o?(a("replaceTilde pr",o),s=">=".concat(n,".").concat(r,".").concat(i,"-").concat(o," <").concat(n,".").concat(+r+1,".0-0")):s=">=".concat(n,".").concat(r,".").concat(i," <").concat(n,".").concat(+r+1,".0-0"),a("tilde return",s),s}))},C=(e,t)=>e.trim().split(/\s+/).map((e=>E(e,t))).join(" "),E=(e,t)=>{a("caret",e,t);const n=t.loose?c[u.CARETLOOSE]:c[u.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,i,o,s)=>{let l;return a("caret",e,t,n,i,o,s),b(n)?l="":b(i)?l=">=".concat(n,".0.0").concat(r," <").concat(+n+1,".0.0-0"):b(o)?l="0"===n?">=".concat(n,".").concat(i,".0").concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".0").concat(r," <").concat(+n+1,".0.0-0"):s?(a("replaceCaret pr",s),l="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(o,"-").concat(s," <").concat(n,".").concat(i,".").concat(+o+1,"-0"):">=".concat(n,".").concat(i,".").concat(o,"-").concat(s," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(o,"-").concat(s," <").concat(+n+1,".0.0-0")):(a("no pr"),l="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(o).concat(r," <").concat(n,".").concat(i,".").concat(+o+1,"-0"):">=".concat(n,".").concat(i,".").concat(o).concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(o," <").concat(+n+1,".0.0-0")),a("caret return",l),l}))},I=(e,t)=>(a("replaceXRanges",e,t),e.split(/\s+/).map((e=>_(e,t))).join(" ")),_=(e,t)=>{e=e.trim();const n=t.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return e.replace(n,((n,r,i,o,s,l)=>{a("xRange",e,n,r,i,o,s,l);const c=b(i),u=c||b(o),d=u||b(s),h=d;return"="===r&&h&&(r=""),l=t.includePrerelease?"-0":"",c?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&h?(u&&(o=0),s=0,">"===r?(r=">=",u?(i=+i+1,o=0,s=0):(o=+o+1,s=0)):"<="===r&&(r="<",u?i=+i+1:o=+o+1),"<"===r&&(l="-0"),n="".concat(r+i,".").concat(o,".").concat(s).concat(l)):u?n=">=".concat(i,".0.0").concat(l," <").concat(+i+1,".0.0-0"):d&&(n=">=".concat(i,".").concat(o,".0").concat(l," <").concat(i,".").concat(+o+1,".0-0")),a("xRange return",n),n}))},x=(e,t)=>(a("replaceStars",e,t),e.trim().replace(c[u.STAR],"")),P=(e,t)=>(a("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?u.GTE0PRE:u.GTE0],"")),k=e=>(t,n,r,i,o,s,a,l,c,u,d,h,p)=>(n=b(r)?"":b(i)?">=".concat(r,".0.0").concat(e?"-0":""):b(o)?">=".concat(r,".").concat(i,".0").concat(e?"-0":""):s?">=".concat(n):">=".concat(n).concat(e?"-0":""),l=b(c)?"":b(u)?"<".concat(+c+1,".0.0-0"):b(d)?"<".concat(c,".").concat(+u+1,".0-0"):h?"<=".concat(c,".").concat(u,".").concat(d,"-").concat(h):e?"<".concat(c,".").concat(u,".").concat(+d+1,"-0"):"<=".concat(l),"".concat(n," ").concat(l).trim()),B=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(a(e[n].semver),e[n].semver!==s.ANY&&e[n].semver.prerelease.length>0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}},47566:(e,t,n)=>{const r=n(52997),{MAX_LENGTH:i,MAX_SAFE_INTEGER:o}=n(46212),{safeRe:s,t:a}=n(47045),l=n(81042),{compareIdentifiers:c}=n(70476);class u{constructor(e,t){if(t=l(t),e instanceof u){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError('Invalid version. Must be a string. Got type "'.concat(typeof e,'".'));if(e.length>i)throw new TypeError("version is longer than ".concat(i," characters"));r("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?s[a.LOOSE]:s[a.FULL]);if(!n)throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<o)return t}return e})):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version="".concat(this.major,".").concat(this.minor,".").concat(this.patch),this.prerelease.length&&(this.version+="-".concat(this.prerelease.join("."))),this.version}toString(){return this.version}compare(e){if(r("SemVer.compare",this.version,this.options,e),!(e instanceof u)){if("string"==typeof e&&e===this.version)return 0;e=new u(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof u||(e=new u(e,this.options)),c(this.major,e.major)||c(this.minor,e.minor)||c(this.patch,e.patch)}comparePre(e){if(e instanceof u||(e=new u(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const n=this.prerelease[t],i=e.prerelease[t];if(r("prerelease compare",t,n,i),void 0===n&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===n)return-1;if(n!==i)return c(n,i)}while(++t)}compareBuild(e){e instanceof u||(e=new u(e,this.options));let t=0;do{const n=this.build[t],i=e.build[t];if(r("prerelease compare",t,n,i),void 0===n&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===n)return-1;if(n!==i)return c(n,i)}while(++t)}inc(e,t,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===c(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error("invalid increment argument: ".concat(e))}return this.raw=this.format(),this.build.length&&(this.raw+="+".concat(this.build.join("."))),this}}e.exports=u},53245:(e,t,n)=>{const r=n(92293);e.exports=(e,t)=>{const n=r(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},30706:(e,t,n)=>{const r=n(88119),i=n(86530),o=n(99480),s=n(4975),a=n(17604),l=n(13818);e.exports=(e,t,n,c)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return r(e,n,c);case"!=":return i(e,n,c);case">":return o(e,n,c);case">=":return s(e,n,c);case"<":return a(e,n,c);case"<=":return l(e,n,c);default:throw new TypeError("Invalid operator: ".concat(t))}}},14767:(e,t,n)=>{const r=n(47566),i=n(92293),{safeRe:o,t:s}=n(47045);e.exports=(e,t)=>{if(e instanceof r)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){let t;for(;(t=o[s.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&t.index+t[0].length===n.index+n[0].length||(n=t),o[s.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;o[s.COERCERTL].lastIndex=-1}else n=e.match(o[s.COERCE]);return null===n?null:i("".concat(n[2],".").concat(n[3]||"0",".").concat(n[4]||"0"),t)}},46525:(e,t,n)=>{const r=n(47566);e.exports=(e,t,n)=>{const i=new r(e,n),o=new r(t,n);return i.compare(o)||i.compareBuild(o)}},97957:(e,t,n)=>{const r=n(23969);e.exports=(e,t)=>r(e,t,!0)},23969:(e,t,n)=>{const r=n(47566);e.exports=(e,t,n)=>new r(e,n).compare(new r(t,n))},15713:(e,t,n)=>{const r=n(92293);e.exports=(e,t)=>{const n=r(e,null,!0),i=r(t,null,!0),o=n.compare(i);if(0===o)return null;const s=o>0,a=s?n:i,l=s?i:n,c=!!a.prerelease.length;if(l.prerelease.length&&!c)return l.patch||l.minor?a.patch?"patch":a.minor?"minor":"major":"major";const u=c?"pre":"";return n.major!==i.major?u+"major":n.minor!==i.minor?u+"minor":n.patch!==i.patch?u+"patch":"prerelease"}},88119:(e,t,n)=>{const r=n(23969);e.exports=(e,t,n)=>0===r(e,t,n)},99480:(e,t,n)=>{const r=n(23969);e.exports=(e,t,n)=>r(e,t,n)>0},4975:(e,t,n)=>{const r=n(23969);e.exports=(e,t,n)=>r(e,t,n)>=0},31528:(e,t,n)=>{const r=n(47566);e.exports=(e,t,n,i,o)=>{"string"==typeof n&&(o=i,i=n,n=void 0);try{return new r(e instanceof r?e.version:e,n).inc(t,i,o).version}catch(e){return null}}},17604:(e,t,n)=>{const r=n(23969);e.exports=(e,t,n)=>r(e,t,n)<0},13818:(e,t,n)=>{const r=n(23969);e.exports=(e,t,n)=>r(e,t,n)<=0},85685:(e,t,n)=>{const r=n(47566);e.exports=(e,t)=>new r(e,t).major},49597:(e,t,n)=>{const r=n(47566);e.exports=(e,t)=>new r(e,t).minor},86530:(e,t,n)=>{const r=n(23969);e.exports=(e,t,n)=>0!==r(e,t,n)},92293:(e,t,n)=>{const r=n(47566);e.exports=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e instanceof r)return e;try{return new r(e,t)}catch(e){if(!n)return null;throw e}}},79708:(e,t,n)=>{const r=n(47566);e.exports=(e,t)=>new r(e,t).patch},55558:(e,t,n)=>{const r=n(92293);e.exports=(e,t)=>{const n=r(e,t);return n&&n.prerelease.length?n.prerelease:null}},8552:(e,t,n)=>{const r=n(23969);e.exports=(e,t,n)=>r(t,e,n)},92143:(e,t,n)=>{const r=n(46525);e.exports=(e,t)=>e.sort(((e,n)=>r(n,e,t)))},47311:(e,t,n)=>{const r=n(13246);e.exports=(e,t,n)=>{try{t=new r(t,n)}catch(e){return!1}return t.test(e)}},11517:(e,t,n)=>{const r=n(46525);e.exports=(e,t)=>e.sort(((e,n)=>r(e,n,t)))},25443:(e,t,n)=>{const r=n(92293);e.exports=(e,t)=>{const n=r(e,t);return n?n.version:null}},27374:(e,t,n)=>{const r=n(47045),i=n(46212),o=n(47566),s=n(70476),a=n(92293),l=n(25443),c=n(53245),u=n(31528),d=n(15713),h=n(85685),p=n(49597),f=n(79708),g=n(55558),m=n(23969),y=n(8552),v=n(97957),A=n(46525),b=n(11517),w=n(92143),S=n(99480),C=n(17604),E=n(88119),I=n(86530),_=n(4975),x=n(13818),P=n(30706),k=n(14767),B=n(74732),O=n(13246),N=n(47311),D=n(58052),j=n(39225),T=n(21433),M=n(88598),F=n(5011),R=n(36854),L=n(27028),Q=n(40178),U=n(34729),V=n(91047),K=n(74632);e.exports={parse:a,valid:l,clean:c,inc:u,diff:d,major:h,minor:p,patch:f,prerelease:g,compare:m,rcompare:y,compareLoose:v,compareBuild:A,sort:b,rsort:w,gt:S,lt:C,eq:E,neq:I,gte:_,lte:x,cmp:P,coerce:k,Comparator:B,Range:O,satisfies:N,toComparators:D,maxSatisfying:j,minSatisfying:T,minVersion:M,validRange:F,outside:R,gtr:L,ltr:Q,intersects:U,simplifyRange:V,subset:K,SemVer:o,re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:s.compareIdentifiers,rcompareIdentifiers:s.rcompareIdentifiers}},46212:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},52997:e=>{const t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return console.error("SEMVER",...t)}:()=>{};e.exports=t},70476:e=>{const t=/^[0-9]+$/,n=(e,n)=>{const r=t.test(e),i=t.test(n);return r&&i&&(e=+e,n=+n),e===n?0:r&&!i?-1:i&&!r?1:e<n?-1:1};e.exports={compareIdentifiers:n,rcompareIdentifiers:(e,t)=>n(t,e)}},81042:e=>{const t=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:n},47045:(e,t,n)=>{const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:o}=n(46212),s=n(52997),a=(t=e.exports={}).re=[],l=t.safeRe=[],c=t.src=[],u=t.t={};let d=0;const h="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",o],[h,i]],f=(e,t,n)=>{const r=(e=>{for(const[t,n]of p)e=e.split("".concat(t,"*")).join("".concat(t,"{0,").concat(n,"}")).split("".concat(t,"+")).join("".concat(t,"{1,").concat(n,"}"));return e})(t),i=d++;s(e,i,t),u[e]=i,c[i]=t,a[i]=new RegExp(t,n?"g":void 0),l[i]=new RegExp(r,n?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-]".concat(h,"*")),f("MAINVERSION","(".concat(c[u.NUMERICIDENTIFIER],")\\.")+"(".concat(c[u.NUMERICIDENTIFIER],")\\.")+"(".concat(c[u.NUMERICIDENTIFIER],")")),f("MAINVERSIONLOOSE","(".concat(c[u.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(c[u.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(c[u.NUMERICIDENTIFIERLOOSE],")")),f("PRERELEASEIDENTIFIER","(?:".concat(c[u.NUMERICIDENTIFIER],"|").concat(c[u.NONNUMERICIDENTIFIER],")")),f("PRERELEASEIDENTIFIERLOOSE","(?:".concat(c[u.NUMERICIDENTIFIERLOOSE],"|").concat(c[u.NONNUMERICIDENTIFIER],")")),f("PRERELEASE","(?:-(".concat(c[u.PRERELEASEIDENTIFIER],"(?:\\.").concat(c[u.PRERELEASEIDENTIFIER],")*))")),f("PRERELEASELOOSE","(?:-?(".concat(c[u.PRERELEASEIDENTIFIERLOOSE],"(?:\\.").concat(c[u.PRERELEASEIDENTIFIERLOOSE],")*))")),f("BUILDIDENTIFIER","".concat(h,"+")),f("BUILD","(?:\\+(".concat(c[u.BUILDIDENTIFIER],"(?:\\.").concat(c[u.BUILDIDENTIFIER],")*))")),f("FULLPLAIN","v?".concat(c[u.MAINVERSION]).concat(c[u.PRERELEASE],"?").concat(c[u.BUILD],"?")),f("FULL","^".concat(c[u.FULLPLAIN],"$")),f("LOOSEPLAIN","[v=\\s]*".concat(c[u.MAINVERSIONLOOSE]).concat(c[u.PRERELEASELOOSE],"?").concat(c[u.BUILD],"?")),f("LOOSE","^".concat(c[u.LOOSEPLAIN],"$")),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE","".concat(c[u.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),f("XRANGEIDENTIFIER","".concat(c[u.NUMERICIDENTIFIER],"|x|X|\\*")),f("XRANGEPLAIN","[v=\\s]*(".concat(c[u.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(c[u.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(c[u.XRANGEIDENTIFIER],")")+"(?:".concat(c[u.PRERELEASE],")?").concat(c[u.BUILD],"?")+")?)?"),f("XRANGEPLAINLOOSE","[v=\\s]*(".concat(c[u.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(c[u.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(c[u.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(c[u.PRERELEASELOOSE],")?").concat(c[u.BUILD],"?")+")?)?"),f("XRANGE","^".concat(c[u.GTLT],"\\s*").concat(c[u.XRANGEPLAIN],"$")),f("XRANGELOOSE","^".concat(c[u.GTLT],"\\s*").concat(c[u.XRANGEPLAINLOOSE],"$")),f("COERCE","".concat("(^|[^\\d])(\\d{1,").concat(r,"})")+"(?:\\.(\\d{1,".concat(r,"}))?")+"(?:\\.(\\d{1,".concat(r,"}))?")+"(?:$|[^\\d])"),f("COERCERTL",c[u.COERCE],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM","(\\s*)".concat(c[u.LONETILDE],"\\s+"),!0),t.tildeTrimReplace="$1~",f("TILDE","^".concat(c[u.LONETILDE]).concat(c[u.XRANGEPLAIN],"$")),f("TILDELOOSE","^".concat(c[u.LONETILDE]).concat(c[u.XRANGEPLAINLOOSE],"$")),f("LONECARET","(?:\\^)"),f("CARETTRIM","(\\s*)".concat(c[u.LONECARET],"\\s+"),!0),t.caretTrimReplace="$1^",f("CARET","^".concat(c[u.LONECARET]).concat(c[u.XRANGEPLAIN],"$")),f("CARETLOOSE","^".concat(c[u.LONECARET]).concat(c[u.XRANGEPLAINLOOSE],"$")),f("COMPARATORLOOSE","^".concat(c[u.GTLT],"\\s*(").concat(c[u.LOOSEPLAIN],")$|^$")),f("COMPARATOR","^".concat(c[u.GTLT],"\\s*(").concat(c[u.FULLPLAIN],")$|^$")),f("COMPARATORTRIM","(\\s*)".concat(c[u.GTLT],"\\s*(").concat(c[u.LOOSEPLAIN],"|").concat(c[u.XRANGEPLAIN],")"),!0),t.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE","^\\s*(".concat(c[u.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(c[u.XRANGEPLAIN],")")+"\\s*$"),f("HYPHENRANGELOOSE","^\\s*(".concat(c[u.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(c[u.XRANGEPLAINLOOSE],")")+"\\s*$"),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},27028:(e,t,n)=>{const r=n(36854);e.exports=(e,t,n)=>r(e,t,">",n)},34729:(e,t,n)=>{const r=n(13246);e.exports=(e,t,n)=>(e=new r(e,n),t=new r(t,n),e.intersects(t,n))},40178:(e,t,n)=>{const r=n(36854);e.exports=(e,t,n)=>r(e,t,"<",n)},39225:(e,t,n)=>{const r=n(47566),i=n(13246);e.exports=(e,t,n)=>{let o=null,s=null,a=null;try{a=new i(t,n)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(o&&-1!==s.compare(e)||(o=e,s=new r(o,n)))})),o}},21433:(e,t,n)=>{const r=n(47566),i=n(13246);e.exports=(e,t,n)=>{let o=null,s=null,a=null;try{a=new i(t,n)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(o&&1!==s.compare(e)||(o=e,s=new r(o,n)))})),o}},88598:(e,t,n)=>{const r=n(47566),i=n(13246),o=n(99480);e.exports=(e,t)=>{e=new i(e,t);let n=new r("0.0.0");if(e.test(n))return n;if(n=new r("0.0.0-0"),e.test(n))return n;n=null;for(let t=0;t<e.set.length;++t){const i=e.set[t];let s=null;i.forEach((e=>{const t=new r(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":s&&!o(t,s)||(s=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: ".concat(e.operator))}})),!s||n&&!o(n,s)||(n=s)}return n&&e.test(n)?n:null}},36854:(e,t,n)=>{const r=n(47566),i=n(74732),{ANY:o}=i,s=n(13246),a=n(47311),l=n(99480),c=n(17604),u=n(13818),d=n(4975);e.exports=(e,t,n,h)=>{let p,f,g,m,y;switch(e=new r(e,h),t=new s(t,h),n){case">":p=l,f=u,g=c,m=">",y=">=";break;case"<":p=c,f=d,g=l,m="<",y="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,h))return!1;for(let n=0;n<t.set.length;++n){const r=t.set[n];let s=null,a=null;if(r.forEach((e=>{e.semver===o&&(e=new i(">=0.0.0")),s=s||e,a=a||e,p(e.semver,s.semver,h)?s=e:g(e.semver,a.semver,h)&&(a=e)})),s.operator===m||s.operator===y)return!1;if((!a.operator||a.operator===m)&&f(e,a.semver))return!1;if(a.operator===y&&g(e,a.semver))return!1}return!0}},91047:(e,t,n)=>{const r=n(47311),i=n(23969);e.exports=(e,t,n)=>{const o=[];let s=null,a=null;const l=e.sort(((e,t)=>i(e,t,n)));for(const e of l)r(e,t,n)?(a=e,s||(s=e)):(a&&o.push([s,a]),a=null,s=null);s&&o.push([s,null]);const c=[];for(const[e,t]of o)e===t?c.push(e):t||e!==l[0]?t?e===l[0]?c.push("<=".concat(t)):c.push("".concat(e," - ").concat(t)):c.push(">=".concat(e)):c.push("*");const u=c.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return u.length<d.length?u:t}},74632:(e,t,n)=>{const r=n(13246),i=n(74732),{ANY:o}=i,s=n(47311),a=n(23969),l=[new i(">=0.0.0-0")],c=[new i(">=0.0.0")],u=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===o){if(1===t.length&&t[0].semver===o)return!0;e=n.includePrerelease?l:c}if(1===t.length&&t[0].semver===o){if(n.includePrerelease)return!0;t=c}const r=new Set;let i,u,p,f,g,m,y;for(const t of e)">"===t.operator||">="===t.operator?i=d(i,t,n):"<"===t.operator||"<="===t.operator?u=h(u,t,n):r.add(t.semver);if(r.size>1)return null;if(i&&u){if(p=a(i.semver,u.semver,n),p>0)return null;if(0===p&&(">="!==i.operator||"<="!==u.operator))return null}for(const e of r){if(i&&!s(e,String(i),n))return null;if(u&&!s(e,String(u),n))return null;for(const r of t)if(!s(e,String(r),n))return!1;return!0}let v=!(!u||n.includePrerelease||!u.semver.prerelease.length)&&u.semver,A=!(!i||n.includePrerelease||!i.semver.prerelease.length)&&i.semver;v&&1===v.prerelease.length&&"<"===u.operator&&0===v.prerelease[0]&&(v=!1);for(const e of t){if(y=y||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,i)if(A&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===A.major&&e.semver.minor===A.minor&&e.semver.patch===A.patch&&(A=!1),">"===e.operator||">="===e.operator){if(f=d(i,e,n),f===e&&f!==i)return!1}else if(">="===i.operator&&!s(i.semver,String(e),n))return!1;if(u)if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),"<"===e.operator||"<="===e.operator){if(g=h(u,e,n),g===e&&g!==u)return!1}else if("<="===u.operator&&!s(u.semver,String(e),n))return!1;if(!e.operator&&(u||i)&&0!==p)return!1}return!(i&&m&&!u&&0!==p||u&&y&&!i&&0!==p||A||v)},d=(e,t,n)=>{if(!e)return t;const r=a(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},h=(e,t,n)=>{if(!e)return t;const r=a(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e===t)return!0;e=new r(e,n),t=new r(t,n);let i=!1;e:for(const r of e.set){for(const e of t.set){const t=u(r,e,n);if(i=i||null!==t,t)continue e}if(i)return!1}return!0}},58052:(e,t,n)=>{const r=n(13246);e.exports=(e,t)=>new r(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},5011:(e,t,n)=>{const r=n(13246);e.exports=(e,t)=>{try{return new r(e,t).range||"*"}catch(e){return null}}},31777:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NIL",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"v1",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"v3",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"v4",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"v5",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return l.default}});var r=h(n(53108)),i=h(n(95532)),o=h(n(7210)),s=h(n(53025)),a=h(n(8239)),l=h(n(26507)),c=h(n(53946)),u=h(n(40835)),d=h(n(5366));function h(e){return e&&e.__esModule?e:{default:e}}},95645:(e,t)=>{function n(e){return 14+(e+64>>>9<<4)+1}function r(e,t){const n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function i(e,t,n,i,o,s){return r((a=r(r(t,e),r(i,s)))<<(l=o)|a>>>32-l,n);var a,l}function o(e,t,n,r,o,s,a){return i(t&n|~t&r,e,t,o,s,a)}function s(e,t,n,r,o,s,a){return i(t&r|n&~r,e,t,o,s,a)}function a(e,t,n,r,o,s,a){return i(t^n^r,e,t,o,s,a)}function l(e,t,n,r,o,s,a){return i(n^(t|~r),e,t,o,s,a)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return function(e){const t=[],n=32*e.length,r="0123456789abcdef";for(let i=0;i<n;i+=8){const n=e[i>>5]>>>i%32&255,o=parseInt(r.charAt(n>>>4&15)+r.charAt(15&n),16);t.push(o)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[n(t)-1]=t;let i=1732584193,c=-271733879,u=-1732584194,d=271733878;for(let t=0;t<e.length;t+=16){const n=i,h=c,p=u,f=d;i=o(i,c,u,d,e[t],7,-680876936),d=o(d,i,c,u,e[t+1],12,-389564586),u=o(u,d,i,c,e[t+2],17,606105819),c=o(c,u,d,i,e[t+3],22,-1044525330),i=o(i,c,u,d,e[t+4],7,-176418897),d=o(d,i,c,u,e[t+5],12,1200080426),u=o(u,d,i,c,e[t+6],17,-1473231341),c=o(c,u,d,i,e[t+7],22,-45705983),i=o(i,c,u,d,e[t+8],7,1770035416),d=o(d,i,c,u,e[t+9],12,-1958414417),u=o(u,d,i,c,e[t+10],17,-42063),c=o(c,u,d,i,e[t+11],22,-1990404162),i=o(i,c,u,d,e[t+12],7,1804603682),d=o(d,i,c,u,e[t+13],12,-40341101),u=o(u,d,i,c,e[t+14],17,-1502002290),c=o(c,u,d,i,e[t+15],22,1236535329),i=s(i,c,u,d,e[t+1],5,-165796510),d=s(d,i,c,u,e[t+6],9,-1069501632),u=s(u,d,i,c,e[t+11],14,643717713),c=s(c,u,d,i,e[t],20,-373897302),i=s(i,c,u,d,e[t+5],5,-701558691),d=s(d,i,c,u,e[t+10],9,38016083),u=s(u,d,i,c,e[t+15],14,-660478335),c=s(c,u,d,i,e[t+4],20,-405537848),i=s(i,c,u,d,e[t+9],5,568446438),d=s(d,i,c,u,e[t+14],9,-1019803690),u=s(u,d,i,c,e[t+3],14,-187363961),c=s(c,u,d,i,e[t+8],20,1163531501),i=s(i,c,u,d,e[t+13],5,-1444681467),d=s(d,i,c,u,e[t+2],9,-51403784),u=s(u,d,i,c,e[t+7],14,1735328473),c=s(c,u,d,i,e[t+12],20,-1926607734),i=a(i,c,u,d,e[t+5],4,-378558),d=a(d,i,c,u,e[t+8],11,-2022574463),u=a(u,d,i,c,e[t+11],16,1839030562),c=a(c,u,d,i,e[t+14],23,-35309556),i=a(i,c,u,d,e[t+1],4,-1530992060),d=a(d,i,c,u,e[t+4],11,1272893353),u=a(u,d,i,c,e[t+7],16,-155497632),c=a(c,u,d,i,e[t+10],23,-1094730640),i=a(i,c,u,d,e[t+13],4,681279174),d=a(d,i,c,u,e[t],11,-358537222),u=a(u,d,i,c,e[t+3],16,-722521979),c=a(c,u,d,i,e[t+6],23,76029189),i=a(i,c,u,d,e[t+9],4,-640364487),d=a(d,i,c,u,e[t+12],11,-421815835),u=a(u,d,i,c,e[t+15],16,530742520),c=a(c,u,d,i,e[t+2],23,-995338651),i=l(i,c,u,d,e[t],6,-198630844),d=l(d,i,c,u,e[t+7],10,1126891415),u=l(u,d,i,c,e[t+14],15,-1416354905),c=l(c,u,d,i,e[t+5],21,-57434055),i=l(i,c,u,d,e[t+12],6,1700485571),d=l(d,i,c,u,e[t+3],10,-1894986606),u=l(u,d,i,c,e[t+10],15,-1051523),c=l(c,u,d,i,e[t+1],21,-2054922799),i=l(i,c,u,d,e[t+8],6,1873313359),d=l(d,i,c,u,e[t+15],10,-30611744),u=l(u,d,i,c,e[t+6],15,-1560198380),c=l(c,u,d,i,e[t+13],21,1309151649),i=l(i,c,u,d,e[t+4],6,-145523070),d=l(d,i,c,u,e[t+11],10,-1120210379),u=l(u,d,i,c,e[t+2],15,718787259),c=l(c,u,d,i,e[t+9],21,-343485551),i=r(i,n),c=r(c,h),u=r(u,p),d=r(d,f)}return[i,c,u,d]}(function(e){if(0===e.length)return[];const t=8*e.length,r=new Uint32Array(n(t));for(let n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))}},88945:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};t.default=n},8239:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default="00000000-0000-0000-0000-000000000000"},5366:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(53946))&&r.__esModule?r:{default:r};t.default=function(e){if(!(0,i.default)(e))throw TypeError("Invalid UUID");let t;const n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n}},66979:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},52185:(e,t)=>{let n;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(r)};const r=new Uint8Array(16)},2743:(e,t)=>{function n(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:case 3:return t^n^r;case 2:return t&n^t&r^n&r}}function r(e,t){return e<<t|e>>>32-t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e){const t=[1518500249,1859775393,2400959708,3395469782],i=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const o=e.length/4+2,s=Math.ceil(o/16),a=new Array(s);for(let t=0;t<s;++t){const n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=e[64*t+4*r]<<24|e[64*t+4*r+1]<<16|e[64*t+4*r+2]<<8|e[64*t+4*r+3];a[t]=n}a[s-1][14]=8*(e.length-1)/Math.pow(2,32),a[s-1][14]=Math.floor(a[s-1][14]),a[s-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<s;++e){const o=new Uint32Array(80);for(let t=0;t<16;++t)o[t]=a[e][t];for(let e=16;e<80;++e)o[e]=r(o[e-3]^o[e-8]^o[e-14]^o[e-16],1);let s=i[0],l=i[1],c=i[2],u=i[3],d=i[4];for(let e=0;e<80;++e){const i=Math.floor(e/20),a=r(s,5)+n(i,l,c,u)+d+t[i]+o[e]>>>0;d=u,u=c,c=r(l,30)>>>0,l=s,s=a}i[0]=i[0]+s>>>0,i[1]=i[1]+l>>>0,i[2]=i[2]+c>>>0,i[3]=i[3]+u>>>0,i[4]=i[4]+d>>>0}return[i[0]>>24&255,i[0]>>16&255,i[0]>>8&255,255&i[0],i[1]>>24&255,i[1]>>16&255,i[1]>>8&255,255&i[1],i[2]>>24&255,i[2]>>16&255,i[2]>>8&255,255&i[2],i[3]>>24&255,i[3]>>16&255,i[3]>>8&255,255&i[3],i[4]>>24&255,i[4]>>16&255,i[4]>>8&255,255&i[4]]}},40835:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.unsafeStringify=s;var r,i=(r=n(53946))&&r.__esModule?r:{default:r};const o=[];for(let e=0;e<256;++e)o.push((e+256).toString(16).slice(1));function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(o[e[t+0]]+o[e[t+1]]+o[e[t+2]]+o[e[t+3]]+"-"+o[e[t+4]]+o[e[t+5]]+"-"+o[e[t+6]]+o[e[t+7]]+"-"+o[e[t+8]]+o[e[t+9]]+"-"+o[e[t+10]]+o[e[t+11]]+o[e[t+12]]+o[e[t+13]]+o[e[t+14]]+o[e[t+15]]).toLowerCase()}t.default=function(e){const t=s(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0);if(!(0,i.default)(t))throw TypeError("Stringified UUID is invalid");return t}},53108:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(52185))&&r.__esModule?r:{default:r},o=n(40835);let s,a,l=0,c=0;t.default=function(e,t,n){let r=t&&n||0;const u=t||new Array(16);let d=(e=e||{}).node||s,h=void 0!==e.clockseq?e.clockseq:a;if(null==d||null==h){const t=e.random||(e.rng||i.default)();null==d&&(d=s=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==h&&(h=a=16383&(t[6]<<8|t[7]))}let p=void 0!==e.msecs?e.msecs:Date.now(),f=void 0!==e.nsecs?e.nsecs:c+1;const g=p-l+(f-c)/1e4;if(g<0&&void 0===e.clockseq&&(h=h+1&16383),(g<0||p>l)&&void 0===e.nsecs&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");l=p,c=f,a=h,p+=122192928e5;const m=(1e4*(268435455&p)+f)%4294967296;u[r++]=m>>>24&255,u[r++]=m>>>16&255,u[r++]=m>>>8&255,u[r++]=255&m;const y=p/4294967296*1e4&268435455;u[r++]=y>>>8&255,u[r++]=255&y,u[r++]=y>>>24&15|16,u[r++]=y>>>16&255,u[r++]=h>>>8|128,u[r++]=255&h;for(let e=0;e<6;++e)u[r+e]=d[e];return t||(0,o.unsafeStringify)(u)}},95532:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(78183)),i=o(n(95645));function o(e){return e&&e.__esModule?e:{default:e}}var s=(0,r.default)("v3",48,i.default);t.default=s},78183:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0,t.default=function(e,t,n){function r(e,r,s,a){var l;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=(0,o.default)(r)),16!==(null===(l=r)||void 0===l?void 0:l.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+e.length);if(c.set(r),c.set(e,r.length),c=n(c),c[6]=15&c[6]|t,c[8]=63&c[8]|128,s){a=a||0;for(let e=0;e<16;++e)s[a+e]=c[e];return s}return(0,i.unsafeStringify)(c)}try{r.name=e}catch(e){}return r.DNS=s,r.URL=a,r};var r,i=n(40835),o=(r=n(5366))&&r.__esModule?r:{default:r};const s="6ba7b810-9dad-11d1-80b4-00c04fd430c8";t.DNS=s;const a="6ba7b811-9dad-11d1-80b4-00c04fd430c8";t.URL=a},7210:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n(88945)),i=s(n(52185)),o=n(40835);function s(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t,n){if(r.default.randomUUID&&!t&&!e)return r.default.randomUUID();const s=(e=e||{}).random||(e.rng||i.default)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=s[e];return t}return(0,o.unsafeStringify)(s)}},53025:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(78183)),i=o(n(2743));function o(e){return e&&e.__esModule?e:{default:e}}var s=(0,r.default)("v5",80,i.default);t.default=s},53946:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(66979))&&r.__esModule?r:{default:r};t.default=function(e){return"string"==typeof e&&i.default.test(e)}},26507:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(53946))&&r.__esModule?r:{default:r};t.default=function(e){if(!(0,i.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}},82908:e=>{e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},37520:(e,t,n)=>{function r(e){var t=this;if(t instanceof r||(t=new r),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var n=0,i=arguments.length;n<i;n++)t.push(arguments[n]);return t}function i(e,t,n){var r=t===e.head?new a(n,null,t,e):new a(n,t,t.next,e);return null===r.next&&(e.tail=r),null===r.prev&&(e.head=r),e.length++,r}function o(e,t){e.tail=new a(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function s(e,t){e.head=new a(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function a(e,t,n,r){if(!(this instanceof a))return new a(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}e.exports=r,r.Node=a,r.create=r,r.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},r.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},r.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},r.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},r.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)s(this,arguments[e]);return this.length},r.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},r.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},r.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;null!==n;r++)e.call(t,n.value,r,this),n=n.next},r.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;null!==n;r--)e.call(t,n.value,r,this),n=n.prev},r.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&t<e;t++)n=n.next;if(t===e&&null!==n)return n.value},r.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&t<e;t++)n=n.prev;if(t===e&&null!==n)return n.value},r.prototype.map=function(e,t){t=t||this;for(var n=new r,i=this.head;null!==i;)n.push(e.call(t,i.value,this)),i=i.next;return n},r.prototype.mapReverse=function(e,t){t=t||this;for(var n=new r,i=this.tail;null!==i;)n.push(e.call(t,i.value,this)),i=i.prev;return n},r.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},r.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},r.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},r.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},r.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&i<e;i++)o=o.next;for(;null!==o&&i<t;i++,o=o.next)n.push(o.value);return n},r.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)n.push(o.value);return n},r.prototype.splice=function(e,t){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,r=this.head;null!==r&&n<e;n++)r=r.next;var o=[];for(n=0;r&&n<t;n++)o.push(r.value),r=this.removeNode(r);for(null===r&&(r=this.tail),r!==this.head&&r!==this.tail&&(r=r.prev),n=0;n<(arguments.length<=2?0:arguments.length-2);n++)r=i(this,r,n+2<2||arguments.length<=n+2?void 0:arguments[n+2]);return o},r.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};try{n(82908)(r)}catch(e){}},26927:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ApiVersion=void 0,function(e){e.v0="20200115",e.v1="20240226"}(n||(t.ApiVersion=n={}))},57819:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(26927),t)},7941:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.AuthApiOperations=void 0,function(e){e[e.GenerateRecoveryCodes=0]="GenerateRecoveryCodes",e[e.GetRecoveryKeyParams=1]="GetRecoveryKeyParams",e[e.SignInWithRecoveryCodes=2]="SignInWithRecoveryCodes"}(n||(t.AuthApiOperations=n={}))},80605:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AuthApiService=void 0;const i=n(29898),o=n(38130),s=n(7941);t.AuthApiService=class{constructor(e,t){this.authServer=e,this.apiVersion=t,this.operationsInProgress=new Map}generateRecoveryCodes(){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthApiOperations.GenerateRecoveryCodes))throw new i.ApiCallError(o.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthApiOperations.GenerateRecoveryCodes,!0);try{return yield this.authServer.generateRecoveryCodes()}catch(e){throw new i.ApiCallError(o.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthApiOperations.GenerateRecoveryCodes,!1)}}))}recoveryKeyParams(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthApiOperations.GetRecoveryKeyParams))throw new i.ApiCallError(o.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthApiOperations.GetRecoveryKeyParams,!0);try{return yield this.authServer.recoveryKeyParams({api_version:this.apiVersion,code_challenge:e.codeChallenge,recovery_codes:e.recoveryCodes,username:e.username})}catch(e){throw new i.ApiCallError(o.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthApiOperations.GetRecoveryKeyParams,!1)}}))}signInWithRecoveryCodes(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthApiOperations.SignInWithRecoveryCodes))throw new i.ApiCallError(o.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthApiOperations.SignInWithRecoveryCodes,!0);try{return yield this.authServer.signInWithRecoveryCodes({api_version:this.apiVersion,code_verifier:e.codeVerifier,password:e.password,recovery_codes:e.recoveryCodes,username:e.username,hvm_token:e.hvmToken})}catch(e){throw new i.ApiCallError(o.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthApiOperations.SignInWithRecoveryCodes,!1)}}))}}},73987:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},66527:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.AuthenticatorApiOperations=void 0,function(e){e[e.List=0]="List",e[e.Delete=1]="Delete",e[e.GenerateRegistrationOptions=2]="GenerateRegistrationOptions",e[e.GenerateAuthenticationOptions=3]="GenerateAuthenticationOptions",e[e.VerifyRegistrationResponse=4]="VerifyRegistrationResponse"}(n||(t.AuthenticatorApiOperations=n={}))},60356:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AuthenticatorApiService=void 0;const i=n(38130),o=n(29898),s=n(66527);t.AuthenticatorApiService=class{constructor(e){this.authenticatorServer=e,this.operationsInProgress=new Map}list(){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthenticatorApiOperations.List))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthenticatorApiOperations.List,!0);try{return yield this.authenticatorServer.list({})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthenticatorApiOperations.List,!1)}}))}delete(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthenticatorApiOperations.Delete))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthenticatorApiOperations.Delete,!0);try{return yield this.authenticatorServer.delete({authenticatorId:e})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthenticatorApiOperations.Delete,!1)}}))}generateRegistrationOptions(){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthenticatorApiOperations.GenerateRegistrationOptions))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthenticatorApiOperations.GenerateRegistrationOptions,!0);try{return yield this.authenticatorServer.generateRegistrationOptions()}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthenticatorApiOperations.GenerateRegistrationOptions,!1)}}))}verifyRegistrationResponse(e,t,n){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthenticatorApiOperations.VerifyRegistrationResponse))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthenticatorApiOperations.VerifyRegistrationResponse,!0);try{return yield this.authenticatorServer.verifyRegistrationResponse({userUuid:e,name:t,attestationResponse:n})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthenticatorApiOperations.VerifyRegistrationResponse,!1)}}))}generateAuthenticationOptions(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.AuthenticatorApiOperations.GenerateAuthenticationOptions))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.AuthenticatorApiOperations.GenerateAuthenticationOptions,!0);try{return yield this.authenticatorServer.generateAuthenticationOptions({username:e})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.AuthenticatorApiOperations.GenerateAuthenticationOptions,!1)}}))}}},4405:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},23624:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.RevisionApiOperations=void 0,function(e){e[e.List=0]="List",e[e.Delete=1]="Delete",e[e.Get=2]="Get"}(n||(t.RevisionApiOperations=n={}))},33416:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RevisionApiService=void 0;const i=n(38130),o=n(29898),s=n(23624);t.RevisionApiService=class{constructor(e){this.revisionServer=e,this.operationsInProgress=new Map}listRevisions(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.RevisionApiOperations.List))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.RevisionApiOperations.List,!0);try{return yield this.revisionServer.listRevisions({itemUuid:e})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.RevisionApiOperations.List,!1)}}))}getRevision(e,t){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.RevisionApiOperations.Get))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.RevisionApiOperations.Get,!0);try{return yield this.revisionServer.getRevision({itemUuid:e,revisionUuid:t})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.RevisionApiOperations.Get,!1)}}))}deleteRevision(e,t){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.RevisionApiOperations.Delete))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.RevisionApiOperations.Delete,!0);try{return yield this.revisionServer.deleteRevision({itemUuid:e,revisionUuid:t})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(s.RevisionApiOperations.Delete,!1)}}))}}},68888:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},17737:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionApiOperations=void 0,function(e){e[e.Inviting=0]="Inviting",e[e.CancelingInvite=1]="CancelingInvite",e[e.ListingInvites=2]="ListingInvites",e[e.AcceptingInvite=3]="AcceptingInvite",e[e.ConfirmAppleIAP=4]="ConfirmAppleIAP",e[e.GetSubscription=5]="GetSubscription",e[e.GetAvailableSubscriptions=6]="GetAvailableSubscriptions"}(n||(t.SubscriptionApiOperations=n={}))},37856:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionApiService=void 0;const i=n(38130),o=n(29898),s=n(95658),a=n(17737);t.SubscriptionApiService=class{constructor(e,t){this.subscriptionServer=e,this.apiVersion=t,this.operationsInProgress=new Map}listInvites(){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.ListingInvites))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.ListingInvites,!0);try{return yield this.subscriptionServer.listInvites({[s.ApiEndpointParam.ApiVersion]:this.apiVersion})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.ListingInvites,!1)}}))}cancelInvite(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.CancelingInvite))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.CancelingInvite,!0);try{return yield this.subscriptionServer.cancelInvite({[s.ApiEndpointParam.ApiVersion]:this.apiVersion,inviteUuid:e})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.CancelingInvite,!1)}}))}invite(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.Inviting))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.Inviting,!0);try{return yield this.subscriptionServer.invite({[s.ApiEndpointParam.ApiVersion]:this.apiVersion,identifier:e})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.Inviting,!1)}}))}acceptInvite(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.AcceptingInvite))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.AcceptingInvite,!0);try{return yield this.subscriptionServer.acceptInvite({inviteUuid:e})}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.AcceptingInvite,!1)}}))}confirmAppleIAP(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.ConfirmAppleIAP))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.ConfirmAppleIAP,!0);try{return yield this.subscriptionServer.confirmAppleIAP(e)}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.ConfirmAppleIAP,!1)}}))}getUserSubscription(e){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.GetSubscription))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.GetSubscription,!0);try{return yield this.subscriptionServer.getUserSubscription(e)}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.GetSubscription,!1)}}))}getAvailableSubscriptions(){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(a.SubscriptionApiOperations.GetAvailableSubscriptions))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(a.SubscriptionApiOperations.GetAvailableSubscriptions,!0);try{return yield this.subscriptionServer.getAvailableSubscriptions()}finally{this.operationsInProgress.set(a.SubscriptionApiOperations.GetAvailableSubscriptions,!1)}}))}}},57898:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},13167:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.UserApiOperations=void 0,function(e){e[e.Registering=0]="Registering",e[e.SubmittingRequest=1]="SubmittingRequest",e[e.DeletingAccount=2]="DeletingAccount",e[e.UpdatingUser=3]="UpdatingUser"}(n||(t.UserApiOperations=n={}))},45869:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.UserApiService=void 0;const i=n(38130),o=n(29898),s=n(95658),a=n(13167);t.UserApiService=class{constructor(e,t,n){this.userServer=e,this.userRequestServer=t,this.apiVersion=n,this.operationsInProgress=new Map}deleteAccount(e){return r(this,void 0,void 0,(function*(){this.lockOperation(a.UserApiOperations.DeletingAccount);try{const t=yield this.userServer.deleteAccount({userUuid:e});return this.unlockOperation(a.UserApiOperations.DeletingAccount),t}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}}))}submitUserRequest(e){return r(this,void 0,void 0,(function*(){this.lockOperation(a.UserApiOperations.SubmittingRequest);try{const t=yield this.userRequestServer.submitUserRequest({userUuid:e.userUuid,requestType:e.requestType});return this.unlockOperation(a.UserApiOperations.SubmittingRequest),t}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}}))}register(e){return r(this,void 0,void 0,(function*(){this.lockOperation(a.UserApiOperations.Registering);try{const t=yield this.userServer.register(Object.assign({[s.ApiEndpointParam.ApiVersion]:this.apiVersion,password:e.serverPassword,email:e.email,hvm_token:e.hvmToken,ephemeral:e.ephemeral},e.keyParams.getPortableValue()));return this.unlockOperation(a.UserApiOperations.Registering),t}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericRegistrationFail)}}))}updateUser(e){return r(this,void 0,void 0,(function*(){this.lockOperation(a.UserApiOperations.UpdatingUser);try{const t=yield this.userServer.update({[s.ApiEndpointParam.ApiVersion]:this.apiVersion,user_uuid:e.userUuid});return this.unlockOperation(a.UserApiOperations.UpdatingUser),t}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}}))}lockOperation(e){if(this.operationsInProgress.get(e))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(e,!0)}unlockOperation(e){this.operationsInProgress.set(e,!1)}}},56824:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},67958:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.WebSocketApiOperations=void 0,function(e){e[e.CreatingConnectionToken=0]="CreatingConnectionToken"}(n||(t.WebSocketApiOperations=n={}))},62984:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.WebSocketApiService=void 0;const i=n(38130),o=n(29898),s=n(67958);t.WebSocketApiService=class{constructor(e){this.webSocketServer=e,this.operationsInProgress=new Map}createConnectionToken(){return r(this,void 0,void 0,(function*(){if(this.operationsInProgress.get(s.WebSocketApiOperations.CreatingConnectionToken))throw new o.ApiCallError(i.ErrorMessage.GenericInProgress);this.operationsInProgress.set(s.WebSocketApiOperations.CreatingConnectionToken,!0);try{const e=yield this.webSocketServer.createConnectionToken({});return this.operationsInProgress.set(s.WebSocketApiOperations.CreatingConnectionToken,!1),e}catch(e){throw new o.ApiCallError(i.ErrorMessage.GenericFail)}}))}}},95736:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},37729:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7941),t),i(n(80605),t),i(n(73987),t),i(n(66527),t),i(n(60356),t),i(n(4405),t),i(n(23624),t),i(n(33416),t),i(n(68888),t),i(n(17737),t),i(n(37856),t),i(n(57898),t),i(n(13167),t),i(n(45869),t),i(n(56824),t),i(n(62984),t),i(n(95736),t)},29898:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ApiCallError=void 0;class n extends Error{constructor(e){super(e),Object.setPrototypeOf(this,n.prototype)}}t.ApiCallError=n},38130:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorMessage=void 0,function(e){e.RegistrationInProgress="An existing registration request is already in progress.",e.GenericRegistrationFail="A server error occurred while trying to register. Please try again.",e.RateLimited="Too many successive server requests. Please wait a few minutes and try again.",e.InsufficientPasswordMessage="Your password must be at least %LENGTH% characters in length. For your security, please choose a longer password or, ideally, a passphrase, and try again.",e.PasscodeRequired="Your passcode is required in order to register for an account.",e.GenericInProgress="An existing request is already in progress.",e.GenericFail="A server error occurred. Please try again."}(n||(t.ErrorMessage=n={}))},65148:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(29898),t),i(n(38130),t)},60256:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.FetchRequestHandler=void 0;const i=n(95658),o=n(22325),s=n(84213),a=n(65148);t.FetchRequestHandler=class{constructor(e,t,n,r){this.snjsVersion=e,this.appVersion=t,this.environment=n,this.logger=r}handleRequest(e){return r(this,void 0,void 0,(function*(){const t=this.createRequest(e);return yield this.runRequest(t,this.createRequestBody(e))}))}createRequest(e){e.params&&e.verb===i.HttpVerb.Get&&Object.keys(e.params).length>0&&(e.url=this.urlForUrlAndParams(e.url,e.params));const t={};if(!e.external){t["X-SNJS-Version"]=this.snjsVersion;const n="".concat(o.Environment[this.environment],"-").concat(this.appVersion);t["X-Application-Version"]=n,e.authentication&&(t.Authorization="Bearer "+e.authentication)}let n=!1;return e.customHeaders&&e.customHeaders.length>0&&e.customHeaders.forEach((e=>{let{key:r,value:i}=e;t[r]=i,"Content-Type"===r&&(n=!0)})),n||e.external||(t["Content-Type"]="application/json"),new Request(e.url,{method:e.verb,headers:t,credentials:"include"})}runRequest(e,t){return r(this,void 0,void 0,(function*(){try{const n=yield fetch(e,{body:t});return yield this.handleFetchResponse(n)}catch(e){return{status:i.HttpStatusCode.InternalServerError,headers:new Map,data:{error:{message:"message"in e?e.message:"Unknown error"}}}}}))}handleFetchResponse(e){var t,n;return r(this,void 0,void 0,(function*(){const r=e.status,o={status:r,headers:new Map,data:{}};e.headers.forEach(((e,t)=>{o.headers.set(t,e)}));try{if(r!==i.HttpStatusCode.NoContent){let r;const i=(null===(t=o.headers)||void 0===t?void 0:t.get("content-type"))||(null===(n=o.headers)||void 0===n?void 0:n.get("Content-Type"));r=(null==i?void 0:i.includes("application/json"))?JSON.parse(yield e.text()):yield e.arrayBuffer(),r.data||(o.data=r),(0,s.isString)(r)||Object.assign(o,r)}}catch(e){this.logger.error(JSON.stringify(e))}if(r>=i.HttpStatusCode.Success&&r<i.HttpStatusCode.InternalServerError)return r===i.HttpStatusCode.Forbidden&&(0,i.isErrorResponse)(o)&&(o.data.error?o.data.error.message=a.ErrorMessage.RateLimited:o.data.error={message:a.ErrorMessage.RateLimited}),o;{const e=o;return e.data||(e.data={error:{message:"Unknown error"}}),(0,s.isString)(e.data)&&(e.data={error:{message:e.data}}),e.data.error||(e.data.error={message:"Unknown error"}),e}}))}urlForUrlAndParams(e,t){const n=Object.keys(t).map((e=>e+"="+encodeURIComponent(t[e]))).join("&");return e.includes("?")?e+"&"+n:e+"?"+n}createRequestBody(e){return void 0!==e.params&&[i.HttpVerb.Post,i.HttpVerb.Put,i.HttpVerb.Patch,i.HttpVerb.Delete].includes(e.verb)?JSON.stringify(e.params):e.rawBytes}}},56176:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},93763:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.HttpService=void 0;const i=n(87901),o=n(82648),s=n(95658),a=n(41325),l=n(60256);t.HttpService=class{constructor(e,t,n,r,i){this.environment=e,this.appVersion=t,this.snjsVersion=n,this.apiVersion=r,this.logger=i,this.__simulateNextSessionRefreshResponseDrop=!1,this.loggingEnabled=!1,this.requestHandler=new l.FetchRequestHandler(this.snjsVersion,this.appVersion,this.environment,this.logger)}setCallbacks(e,t){this.updateMetaCallback=e,this.refreshSessionCallback=t}deinit(){this.session=void 0,this.updateMetaCallback=void 0,this.refreshSessionCallback=void 0}setSession(e){this.session=e}setHost(e){this.host=e}getHost(){return this.host}getSessionAccessToken(){if(this.session)return this.session instanceof o.Session?this.session.accessToken.value:this.session.accessToken}get(e,t,n){var o;return r(this,void 0,void 0,(function*(){if(!this.host)throw new Error("Attempting to make network request before host is set");return this.runHttp({url:(0,i.joinPaths)(this.host,e),params:t,verb:s.HttpVerb.Get,authentication:null!==(o=null==n?void 0:n.authentication)&&void 0!==o?o:this.getSessionAccessToken()})}))}getExternal(e,t){return r(this,void 0,void 0,(function*(){return this.runHttp({url:e,params:t,verb:s.HttpVerb.Get,external:!0})}))}post(e,t,n){var o;return r(this,void 0,void 0,(function*(){if(!this.host)throw new Error("Attempting to make network request before host is set");return this.runHttp({url:(0,i.joinPaths)(this.host,e),params:t,verb:s.HttpVerb.Post,authentication:null!==(o=null==n?void 0:n.authentication)&&void 0!==o?o:this.getSessionAccessToken(),customHeaders:null==n?void 0:n.headers})}))}put(e,t,n){var o;return r(this,void 0,void 0,(function*(){return this.runHttp({url:(0,i.joinPaths)(this.host,e),params:t,verb:s.HttpVerb.Put,authentication:null!==(o=null==n?void 0:n.authentication)&&void 0!==o?o:this.getSessionAccessToken()})}))}patch(e,t,n){var o;return r(this,void 0,void 0,(function*(){return this.runHttp({url:(0,i.joinPaths)(this.host,e),params:t,verb:s.HttpVerb.Patch,authentication:null!==(o=null==n?void 0:n.authentication)&&void 0!==o?o:this.getSessionAccessToken()})}))}delete(e,t,n){var o;return r(this,void 0,void 0,(function*(){return this.runHttp({url:(0,i.joinPaths)(this.host,e),params:t,verb:s.HttpVerb.Delete,authentication:null!==(o=null==n?void 0:n.authentication)&&void 0!==o?o:this.getSessionAccessToken()})}))}runHttp(e){var t;return r(this,void 0,void 0,(function*(){this.__latencySimulatorMs&&(yield(0,i.sleep)(this.__latencySimulatorMs,!0)),e.params=e.params?this.params(e.params):void 0;const n=e.url===(0,i.joinPaths)(this.host,a.Paths.v1.refreshSession);this.inProgressRefreshSessionPromise&&!n&&(yield this.inProgressRefreshSessionPromise,e.authentication=this.getSessionAccessToken());const r=yield this.requestHandler.handleRequest(e);if(this.loggingEnabled&&(0,s.isErrorResponse)(r)&&this.logger.error("Request failed",e,r),r.meta&&!e.external&&(null===(t=this.updateMetaCallback)||void 0===t||t.call(this,r.meta)),r.status===s.HttpStatusCode.ExpiredAccessToken&&!n&&!e.external){if(this.inProgressRefreshSessionPromise)yield this.inProgressRefreshSessionPromise;else if(e.authentication===this.getSessionAccessToken()){this.inProgressRefreshSessionPromise=this.refreshSession();const e=yield this.inProgressRefreshSessionPromise;let t=!1;if(e.isFailed()||(t=!(0,s.isErrorResponse)(e.getValue())),this.inProgressRefreshSessionPromise=void 0,!t)return r}return e.authentication=this.getSessionAccessToken(),this.runHttp(e)}return r}))}refreshSession(){var e;return r(this,void 0,void 0,(function*(){if(!this.session)return o.Result.fail("No session to refresh");if(this.session instanceof o.LegacySession)return o.Result.fail("Cannot refresh legacy session");const t=yield this.post(a.Paths.v1.refreshSession,{access_token:this.session.accessToken.value,refresh_token:this.session.refreshToken.value});if(this.__simulateNextSessionRefreshResponseDrop)return this.__simulateNextSessionRefreshResponseDrop=!1,o.Result.fail("Simulating a dropped response");if((0,s.isErrorResponse)(t))return o.Result.ok(t);t.meta&&(null===(e=this.updateMetaCallback)||void 0===e||e.call(this,t.meta));const n=o.SessionToken.create(t.data.session.access_token,t.data.session.access_expiration);if(n.isFailed())return o.Result.fail(n.getError());const r=n.getValue(),i=o.SessionToken.create(t.data.session.refresh_token,t.data.session.refresh_expiration);if(i.isFailed())return o.Result.fail(i.getError());const l=i.getValue(),c=o.Session.create(r,l,t.data.session.readonly_access);return c.isFailed()?o.Result.fail(c.getError()):(this.setSession(c.getValue()),this.refreshSessionCallback(this.session),o.Result.ok(t))}))}params(e){return Object.assign(Object.assign({},e),{[s.ApiEndpointParam.ApiVersion]:this.apiVersion})}}},11751:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},23792:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.XMLHttpRequestState=void 0,function(e){e[e.Completed=4]="Completed"}(n||(t.XMLHttpRequestState=n={}))},59774:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(93763),t),i(n(60256),t),i(n(56176),t),i(n(11751),t),i(n(23792),t)},6813:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4960:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},8433:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},72548:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},37280:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},25618:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},1179:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},68805:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},90327:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},57726:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},75146:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},45512:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),n(95658)},15829:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),n(95658)},609:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),n(95658)},79329:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),n(95658)},30163:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},33488:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),n(95658)},19298:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),n(95658)},57826:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},74815:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},72816:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(6813),t),i(n(4960),t),i(n(8433),t),i(n(72548),t),i(n(37280),t),i(n(25618),t),i(n(1179),t),i(n(68805),t),i(n(90327),t),i(n(57726),t),i(n(75146),t),i(n(45512),t),i(n(15829),t),i(n(609),t),i(n(79329),t),i(n(30163),t),i(n(33488),t),i(n(19298),t),i(n(57826),t),i(n(74815),t)},63404:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},62299:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},30785:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},86237:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},89996:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},27528:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},98259:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},51109:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},89304:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},9712:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6605:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},25513:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},99614:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},68533:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},66722:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6497:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},96741:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5209:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5918:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},39761:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(63404),t),i(n(62299),t),i(n(30785),t),i(n(86237),t),i(n(89996),t),i(n(27528),t),i(n(98259),t),i(n(51109),t),i(n(89304),t),i(n(98259),t),i(n(51109),t),i(n(89304),t),i(n(9712),t),i(n(6605),t),i(n(25513),t),i(n(99614),t),i(n(68533),t),i(n(66722),t),i(n(6497),t),i(n(96741),t),i(n(5209),t),i(n(5918),t)},1807:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AsymmetricMessageServer=void 0;const r=n(18109);t.AsymmetricMessageServer=class{constructor(e){this.httpService=e}createMessage(e){return this.httpService.post(r.AsymmetricMessagesPaths.createMessage,{recipient_uuid:e.recipientUuid,encrypted_message:e.encryptedMessage,replaceability_identifier:e.replaceabilityIdentifier})}getInboundUserMessages(){return this.httpService.get(r.AsymmetricMessagesPaths.getInboundUserMessages())}getOutboundUserMessages(){return this.httpService.get(r.AsymmetricMessagesPaths.getOutboundUserMessages())}getMessages(){return this.httpService.get(r.AsymmetricMessagesPaths.getMessages)}deleteMessage(e){return this.httpService.delete(r.AsymmetricMessagesPaths.deleteMessage(e.messageUuid))}deleteAllInboundMessages(){return this.httpService.delete(r.AsymmetricMessagesPaths.deleteAllInboundMessages)}}},71101:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},18109:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AsymmetricMessagesPaths=void 0,t.AsymmetricMessagesPaths={createMessage:"/v1/messages",getMessages:"/v1/messages",updateMessage:e=>"/v1/messages/".concat(e),getInboundUserMessages:()=>"/v1/messages",getOutboundUserMessages:()=>"/v1/messages/outbound",deleteMessage:e=>"/v1/messages/".concat(e),deleteAllInboundMessages:"/v1/messages/inbound"}},8982:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AuthServer=void 0;const i=n(41325);t.AuthServer=class{constructor(e){this.httpService=e}generateRecoveryCodes(){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.generateRecoveryCodes)}))}recoveryKeyParams(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.recoveryKeyParams,e)}))}signInWithRecoveryCodes(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.signInWithRecoveryCodes,e)}))}}},75325:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},41325:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v1:Object.assign(Object.assign({},{refreshSession:"/v1/sessions/refresh"}),{generateRecoveryCodes:"/v1/recovery/codes",recoveryKeyParams:"/v1/recovery/login-params",signInWithRecoveryCodes:"/v1/recovery/login"})}},24610:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AuthenticatorServer=void 0;const i=n(35821);t.AuthenticatorServer=class{constructor(e){this.httpService=e}list(e){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v1.listAuthenticators,e)}))}delete(e){return r(this,void 0,void 0,(function*(){return this.httpService.delete(i.Paths.v1.deleteAuthenticator(e.authenticatorId),e)}))}generateRegistrationOptions(){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v1.generateRegistrationOptions)}))}verifyRegistrationResponse(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.verifyRegistrationResponse,e)}))}generateAuthenticationOptions(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.generateAuthenticationOptions,e)}))}}},1471:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},35821:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v1:Object.assign({},{listAuthenticators:"/v1/authenticators",deleteAuthenticator:e=>"/v1/authenticators/".concat(e),generateRegistrationOptions:"/v1/authenticators/generate-registration-options",verifyRegistrationResponse:"/v1/authenticators/verify-registration",generateAuthenticationOptions:"/v1/authenticators/generate-authentication-options"})}},92272:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v2:Object.assign({},{listRevisions:e=>"/v2/items/".concat(e,"/revisions"),getRevision:(e,t)=>"/v2/items/".concat(e,"/revisions/").concat(t),deleteRevision:(e,t)=>"/v2/items/".concat(e,"/revisions/").concat(t)})}},9784:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RevisionServer=void 0;const i=n(92272);t.RevisionServer=class{constructor(e){this.httpService=e}listRevisions(e){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v2.listRevisions(e.itemUuid))}))}getRevision(e){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v2.getRevision(e.itemUuid,e.revisionUuid))}))}deleteRevision(e){return r(this,void 0,void 0,(function*(){return this.httpService.delete(i.Paths.v2.deleteRevision(e.itemUuid,e.revisionUuid))}))}}},35213:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},83625:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultsPaths=void 0,t.SharedVaultsPaths={getSharedVaults:"/v1/shared-vaults",createSharedVault:"/v1/shared-vaults",deleteSharedVault:e=>"/v1/shared-vaults/".concat(e),updateSharedVault:e=>"/v1/shared-vaults/".concat(e),createSharedVaultFileValetToken:e=>"/v1/shared-vaults/".concat(e,"/valet-tokens")}},29497:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultServer=void 0;const r=n(83625);t.SharedVaultServer=class{constructor(e){this.httpService=e}getSharedVaults(){return this.httpService.get(r.SharedVaultsPaths.getSharedVaults)}createSharedVault(){return this.httpService.post(r.SharedVaultsPaths.createSharedVault)}deleteSharedVault(e){return this.httpService.delete(r.SharedVaultsPaths.deleteSharedVault(e.sharedVaultUuid))}createSharedVaultFileValetToken(e){let t;return e.sharedVaultOwnerUuid&&(t=[{key:"x-shared-vault-owner-context",value:e.sharedVaultOwnerUuid}]),this.httpService.post(r.SharedVaultsPaths.createSharedVaultFileValetToken(e.sharedVaultUuid),{file_uuid:e.fileUuid,remote_identifier:e.remoteIdentifier,operation:e.operation,unencrypted_file_size:e.unencryptedFileSize,move_operation_type:e.moveOperationType,shared_vault_to_shared_vault_move_target_uuid:e.sharedVaultToSharedVaultMoveTargetUuid},{headers:t})}}},41773:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},39593:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultInvitesPaths=void 0,t.SharedVaultInvitesPaths={createInvite:e=>"/v1/shared-vaults/".concat(e,"/invites"),updateInvite:(e,t)=>"/v1/shared-vaults/".concat(e,"/invites/").concat(t),acceptInvite:(e,t)=>"/v1/shared-vaults/".concat(e,"/invites/").concat(t,"/accept"),declineInvite:(e,t)=>"/v1/shared-vaults/".concat(e,"/invites/").concat(t,"/decline"),getInboundUserInvites:()=>"/v1/shared-vaults/invites",getOutboundUserInvites:()=>"/v1/shared-vaults/invites/outbound",getSharedVaultInvites:e=>"/v1/shared-vaults/".concat(e,"/invites"),deleteInvite:(e,t)=>"/v1/shared-vaults/".concat(e,"/invites/").concat(t),deleteAllSharedVaultInvites:e=>"/v1/shared-vaults/".concat(e,"/invites"),deleteAllInboundInvites:"/v1/shared-vaults/invites/inbound",deleteAllOutboundInvites:"/v1/shared-vaults/invites/outbound"}},55784:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultInvitesServer=void 0;const r=n(39593);t.SharedVaultInvitesServer=class{constructor(e){this.httpService=e}createInvite(e){return this.httpService.post(r.SharedVaultInvitesPaths.createInvite(e.sharedVaultUuid),{recipient_uuid:e.recipientUuid,encrypted_message:e.encryptedMessage,permission:e.permission.value})}updateInvite(e){var t;return this.httpService.patch(r.SharedVaultInvitesPaths.updateInvite(e.sharedVaultUuid,e.inviteUuid),{encrypted_message:e.encryptedMessage,permission:null===(t=e.permission)||void 0===t?void 0:t.value})}acceptInvite(e){return this.httpService.post(r.SharedVaultInvitesPaths.acceptInvite(e.sharedVaultUuid,e.inviteUuid))}declineInvite(e){return this.httpService.post(r.SharedVaultInvitesPaths.declineInvite(e.sharedVaultUuid,e.inviteUuid))}getInboundUserInvites(){return this.httpService.get(r.SharedVaultInvitesPaths.getInboundUserInvites())}getOutboundUserInvites(){return this.httpService.get(r.SharedVaultInvitesPaths.getOutboundUserInvites())}getSharedVaultInvites(e){return this.httpService.get(r.SharedVaultInvitesPaths.getSharedVaultInvites(e.sharedVaultUuid))}deleteInvite(e){return this.httpService.delete(r.SharedVaultInvitesPaths.deleteInvite(e.sharedVaultUuid,e.inviteUuid))}deleteAllSharedVaultInvites(e){return this.httpService.delete(r.SharedVaultInvitesPaths.deleteAllSharedVaultInvites(e.sharedVaultUuid))}deleteAllInboundInvites(){return this.httpService.delete(r.SharedVaultInvitesPaths.deleteAllInboundInvites)}deleteAllOutboundInvites(){return this.httpService.delete(r.SharedVaultInvitesPaths.deleteAllOutboundInvites)}}},49224:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},77183:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultUsersPaths=void 0,t.SharedVaultUsersPaths={getSharedVaultUsers:e=>"/v1/shared-vaults/".concat(e,"/users"),deleteSharedVaultUser:(e,t)=>"/v1/shared-vaults/".concat(e,"/users/").concat(t),designateSurvivor:(e,t)=>"/v1/shared-vaults/".concat(e,"/users/").concat(t,"/designate-survivor")}},75569:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SharedVaultUsersServer=void 0;const i=n(77183);t.SharedVaultUsersServer=class{constructor(e){this.httpService=e}designateSurvivor(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.SharedVaultUsersPaths.designateSurvivor(e.sharedVaultUuid.value,e.sharedVaultMemberUuid.value))}))}getSharedVaultUsers(e){return this.httpService.get(i.SharedVaultUsersPaths.getSharedVaultUsers(e.sharedVaultUuid))}deleteSharedVaultUser(e){return this.httpService.delete(i.SharedVaultUsersPaths.deleteSharedVaultUser(e.sharedVaultUuid,e.userUuid))}}},7307:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},63385:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v1:Object.assign(Object.assign(Object.assign(Object.assign({},{invite:"/v1/subscription-invites",acceptInvite:e=>"/v1/subscription-invites/".concat(e,"/accept"),declineInvite:e=>"/v1/subscription-invites/".concat(e,"/decline"),cancelInvite:e=>"/v1/subscription-invites/".concat(e),listInvites:"/v1/subscription-invites"}),{confirmAppleIAP:"/v1/subscriptions/apple_iap_confirm"}),{subscription:e=>"/v1/users/".concat(e,"/subscription")}),{availableSubscriptions:"/v2/subscriptions"})}},83527:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionServer=void 0;const i=n(63385);t.SubscriptionServer=class{constructor(e){this.httpService=e}acceptInvite(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.acceptInvite(e.inviteUuid),e)}))}declineInvite(e){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v1.declineInvite(e.inviteUuid),e)}))}cancelInvite(e){return r(this,void 0,void 0,(function*(){return this.httpService.delete(i.Paths.v1.cancelInvite(e.inviteUuid),e)}))}listInvites(e){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v1.listInvites,e)}))}invite(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.invite,e)}))}confirmAppleIAP(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.confirmAppleIAP,e)}))}getUserSubscription(e){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v1.subscription(e.userUuid),e)}))}getAvailableSubscriptions(){return r(this,void 0,void 0,(function*(){return this.httpService.get(i.Paths.v1.availableSubscriptions)}))}}},79804:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},32288:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v1:Object.assign({},{register:"/v1/users",updateAccount:e=>"/v1/users/".concat(e),deleteAccount:e=>"/v1/users/".concat(e)})}},87466:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.UserServer=void 0;const i=n(32288);t.UserServer=class{constructor(e){this.httpService=e}deleteAccount(e){return r(this,void 0,void 0,(function*(){return this.httpService.delete(i.Paths.v1.deleteAccount(e.userUuid),e)}))}register(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.register,e)}))}update(e){return r(this,void 0,void 0,(function*(){return this.httpService.patch(i.Paths.v1.updateAccount(e.user_uuid),e)}))}}},14786:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4633:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v1:Object.assign({},{submitUserRequest:e=>"/v1/users/".concat(e,"/requests")})}},59181:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.UserRequestServer=void 0;const i=n(4633);t.UserRequestServer=class{constructor(e){this.httpService=e}submitUserRequest(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.submitUserRequest(e.userUuid),e)}))}}},39594:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},1276:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Paths=void 0,t.Paths={v1:Object.assign({},{createConnectionToken:"/v1/sockets/tokens"})}},81355:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.WebSocketServer=void 0;const i=n(1276);t.WebSocketServer=class{constructor(e){this.httpService=e}createConnectionToken(e){return r(this,void 0,void 0,(function*(){return this.httpService.post(i.Paths.v1.createConnectionToken,e)}))}}},7404:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},87267:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(8982),t),i(n(75325),t),i(n(24610),t),i(n(1471),t),i(n(9784),t),i(n(35213),t),i(n(1807),t),i(n(71101),t),i(n(29497),t),i(n(41773),t),i(n(75569),t),i(n(7307),t),i(n(83527),t),i(n(79804),t),i(n(55784),t),i(n(49224),t),i(n(87466),t),i(n(14786),t),i(n(59181),t),i(n(39594),t),i(n(81355),t),i(n(7404),t)},74907:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(57819),t),i(n(37729),t),i(n(65148),t),i(n(59774),t),i(n(72816),t),i(n(39761),t),i(n(87267),t)},70781:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(74907),t)},73936:(e,t,n)=>{n.d(t,{U:()=>o,q:()=>i});var r=n(99299);function i(e){return null!=e.shared_vault_uuid}function o(e){var t;const n=e.split(r.X);return{version:n[0],nonce:n[1],ciphertext:n[2],authenticatedData:n[3],additionalData:null!==(t=n[4])&&void 0!==t?t:"e30="}}},99299:(e,t,n)=>{n.d(t,{X:()=>i,s:()=>r});const r="004_Asym",i=":"},86999:(e,t,n)=>{n.d(t,{qX:()=>l,lx:()=>ke,Nv:()=>I,H$:()=>_,mU:()=>x,ao:()=>P,jl:()=>k,nJ:()=>Se,Ak:()=>we,C4:()=>C,$l:()=>fe,FX:()=>E,sP:()=>Ee,G6:()=>Ce,tn:()=>p,LW:()=>B,fD:()=>O,yv:()=>g,NC:()=>m,nx:()=>A,rU:()=>h,d1:()=>j,QR:()=>M,Er:()=>R,iN:()=>he,t$:()=>S,Gw:()=>w,xg:()=>Ie,KX:()=>_e,xo:()=>i,$4:()=>o,_0:()=>s,eC:()=>a,Am:()=>b,ZP:()=>pe,UH:()=>H.U,oO:()=>be,qw:()=>H.q,Gl:()=>Ae,xi:()=>me,XL:()=>ge,dS:()=>d,mX:()=>f});var r=n(98418);const i=Object.freeze({SaltSeedLength:128,PbkdfMinCost:3e3,PbkdfCostsUsed:[3e3,5e3,1e4,6e4],PbkdfOutputLength:512,EncryptionKeyLength:256}),o=Object.freeze({SaltSeedLength:128,PbkdfMinCost:3e3,PbkdfCostsUsed:i.PbkdfCostsUsed.concat([1e5,101e3,102e3,103e3]),ImprobablePbkdfCostsUsed:[3e3,5e3],PbkdfOutputLength:768,EncryptionKeyLength:256,EncryptionIvLength:128}),s=Object.freeze({SaltSeedLength:256,PbkdfCost:11e4,PbkdfOutputLength:768,EncryptionKeyLength:256,EncryptionIvLength:128}),a=Object.freeze({ArgonSaltSeedLength:256,ArgonSaltLength:128,ArgonIterations:5,ArgonMemLimit:67108864,ArgonOutputKeyBytes:64,EncryptionKeyLength:256,EncryptionNonceLength:192,AsymmetricEncryptionNonceLength:192,MasterKeyEncryptionKeyPairSubKeyNumber:1,MasterKeyEncryptionKeyPairSubKeyContext:"sn-pkc-e",MasterKeyEncryptionKeyPairSubKeyBytes:r.SodiumConstant.crypto_box_SEEDBYTES,MasterKeySigningKeyPairSubKeyNumber:2,MasterKeySigningKeyPairSubKeyContext:"sn-pkc-s",MasterKeySigningKeyPairSubKeyBytes:r.SodiumConstant.crypto_sign_SEEDBYTES,PayloadKeyHashingKeySubKeyNumber:1,PayloadKeyHashingKeySubKeyContext:"sn-sym-h",PayloadKeyHashingKeySubKeyBytes:r.SodiumConstant.crypto_generichash_KEYBYTES});var l;!function(e){e.Encrypted="Encrypted",e.EncryptedWithNonEncryptedItemsKey="EncryptedWithNonEncryptedItemsKey",e.FullyDecrypted="FullyDecrypted",e.Corrupt="Corrupt"}(l||(l={}));var c=n(82648),u=n(22325);function d(e){return e.content_type===c.ContentType.TYPES.ItemsKey}class h extends u.DecryptedItem{constructor(e){super(e),this.keyVersion=e.content.version,this.isDefault=e.content.isDefault,this.itemsKey=this.payload.content.itemsKey}strategyWhenConflictingWithItem(e,t){return u.ConflictStrategy.KeepBase}get dataAuthenticationKey(){if(this.keyVersion===u.ProtocolVersion.V004)throw"Attempting to access legacy data authentication key.";return this.payload.content.dataAuthenticationKey}}class p extends u.DecryptedItemMutator{set isDefault(e){this.mutableContent.isDefault=e}}function f(e){return e.content_type===c.ContentType.TYPES.KeySystemItemsKey}(0,u.RegisterItemClass)(c.ContentType.TYPES.ItemsKey,h,p);class g extends u.DecryptedItem{constructor(e){super(e),this.creationTimestamp=e.content.creationTimestamp,this.keyVersion=e.content.version,this.itemsKey=this.payload.content.itemsKey,this.rootKeyToken=this.payload.content.rootKeyToken}strategyWhenConflictingWithItem(e,t){return u.ConflictStrategy.KeepBase}}class m extends u.DecryptedItemMutator{}(0,u.RegisterItemClass)(c.ContentType.TYPES.KeySystemItemsKey,g,m);var y=n(87901),v=n(20875);function A(e){if(e.version)return e.version;const t=e.pw_cost,n=i.PbkdfCostsUsed.includes(t),r=o.PbkdfCostsUsed.includes(t);return n&&!r?v.ProtocolVersion.V001:r&&!n?v.ProtocolVersion.V002:r&&n&&e.pw_nonce&&o.ImprobablePbkdfCostsUsed.includes(t)?v.ProtocolVersion.V001:v.ProtocolVersion.V002}const b=["identifier","pw_cost","pw_nonce","pw_salt","version","origination","created"];class w{constructor(e){this.content=Object.assign(Object.assign({},e),{origination:e.origination||v.KeyParamsOrigination.Registration,version:e.version||A(e)})}get isKeyParamsObject(){return!0}get identifier(){return this.content004.identifier||this.content002.email}get version(){return this.content.version}get origination(){return this.content.origination}get content001(){return this.content}get content002(){return this.content}get content003(){return this.content}get content004(){return this.content}get createdDate(){if(this.content004.created)return new Date(Number(this.content004.created))}compare(e){if(this.version!==e.version)return!1;if([v.ProtocolVersion.V004,v.ProtocolVersion.V003].includes(this.version))return this.identifier===e.identifier&&this.content004.pw_nonce===e.content003.pw_nonce;if([v.ProtocolVersion.V002,v.ProtocolVersion.V001].includes(this.version))return this.identifier===e.identifier&&this.content002.pw_salt===e.content001.pw_salt;throw Error("Unhandled version in KeyParams.compare")}getPortableValue(){return(0,y.pickByCopy)(this.content,b)}}class S extends u.DecryptedItem{constructor(e){super(e),this.keyParams=new w(e.content.keyParams)}get keyVersion(){return this.content.version}get itemsKey(){return this.masterKey}get masterKey(){return this.content.masterKey}get serverPassword(){return this.content.serverPassword}get encryptionKeyPair(){return this.content.encryptionKeyPair}get signingKeyPair(){return this.content.signingKeyPair}get dataAuthenticationKey(){return this.content.dataAuthenticationKey}compare(e){return this.keyVersion===e.keyVersion&&(this.serverPassword&&e.serverPassword?(0,r.timingSafeEqual)(this.masterKey,e.masterKey)&&(0,r.timingSafeEqual)(this.serverPassword,e.serverPassword):(0,r.timingSafeEqual)(this.masterKey,e.masterKey))}persistableValueWhenWrapping(){return Object.assign(Object.assign({},this.getKeychainValue()),{keyParams:this.keyParams.getPortableValue()})}getKeychainValue(){const e={version:this.keyVersion,masterKey:this.masterKey,encryptionKeyPair:this.encryptionKeyPair,signingKeyPair:this.signingKeyPair};return this.dataAuthenticationKey&&(e.dataAuthenticationKey=this.dataAuthenticationKey),e}}function C(e){const t=y.UuidGenerator.GenerateUuid(),n=new u.DecryptedPayload(Object.assign({uuid:t,content_type:c.ContentType.TYPES.RootKey,content:E(e)},(0,u.PayloadTimestampDefaults)()));return new S(n)}function E(e){return e.version||(e.dataAuthenticationKey?e.version=u.ProtocolVersion.V002:e.version=u.ProtocolVersion.V001),(0,u.FillItemContentSpecialized)(e)}function I(e){return k(e)}function _(e){return k(e)}function x(e){return k(e)}function P(e){return k(e)}function k(e){if("content"in e)throw Error("Raw key params shouldnt have content; perhaps you passed in a SNRootKeyParams object.");return new w(e)}function B(e,t){return k({identifier:t||e.identifier,pw_cost:e.pw_cost,pw_nonce:e.pw_nonce,pw_salt:e.pw_salt,version:A(e),origination:e.origination,created:e.created})}const O={KeyRecoveryLoginFlowPrompt:e=>{var t;const n=null===(t=e.createdDate)||void 0===t?void 0:t.toLocaleString();switch(e.origination){case v.KeyParamsOrigination.EmailChange:return"Enter your account password as it was when you changed your email on ".concat(n,".");case v.KeyParamsOrigination.PasswordChange:return"Enter your account password after it was changed on ".concat(n,".");case v.KeyParamsOrigination.Registration:return"Enter your account password as it was when you registered ".concat(n,".");case v.KeyParamsOrigination.ProtocolUpgrade:return"Enter your account password as it was when you upgraded your encryption version on ".concat(n,".");case v.KeyParamsOrigination.PasscodeChange:return"Enter your application passcode after it was changed on ".concat(n,".");case v.KeyParamsOrigination.PasscodeCreate:return"Enter your application passcode as it was when you created it on ".concat(n,".");default:throw Error("Unhandled KeyParamsOrigination case for KeyRecoveryLoginFlowPrompt")}},KeyRecoveryLoginFlowReason:"Your account password is required to revalidate your session.",KeyRecoveryLoginFlowInvalidPassword:"Incorrect credentials entered. Please try again.",KeyRecoveryRootKeyReplaced:"Your credentials have successfully been updated.",KeyRecoveryPasscodeRequiredTitle:"Passcode Required",KeyRecoveryPasscodeRequiredText:"You must enter your passcode in order to save your new credentials.",KeyRecoveryPasswordRequired:"Your account password is required to recover an encryption key.",KeyRecoveryKeyRecovered:"Your key has successfully been recovered.",KeyRecoveryUnableToRecover:"Unable to recover your key with the attempted password. Please try again."};var N=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};const D="00000000000000000000000000000000";class j{constructor(e){this.crypto=e}getEncryptionDisplayName(){return"AES-256"}get version(){return v.ProtocolVersion.V001}generateNewItemsKeyContent(){const e=i.EncryptionKeyLength,t=this.crypto.generateRandomKey(e);return(0,u.FillItemContent)({itemsKey:t,version:v.ProtocolVersion.V001})}createItemsKey(){const e=new u.DecryptedPayload(Object.assign({uuid:y.UuidGenerator.GenerateUuid(),content_type:c.ContentType.TYPES.ItemsKey,content:this.generateNewItemsKeyContent()},(0,u.PayloadTimestampDefaults)()));return(0,u.CreateDecryptedItemFromPayload)(e)}createRootKey(e,t,n){return N(this,void 0,void 0,(function*(){const r=i.PbkdfMinCost,o=this.crypto.generateRandomKey(i.SaltSeedLength),s=yield this.crypto.unsafeSha1(e+"SN"+o),a=I({email:e,pw_cost:r,pw_nonce:o,pw_salt:s,version:v.ProtocolVersion.V001,origination:n,created:"".concat(Date.now())});return this.deriveKey(t,a)}))}getPayloadAuthenticatedDataForExternalUse(e){}computeRootKey(e,t){return N(this,void 0,void 0,(function*(){return this.deriveKey(e,t)}))}decryptString(e,t){return N(this,void 0,void 0,(function*(){return this.crypto.aes256CbcDecrypt(e,D,t)}))}encryptString(e,t){return N(this,void 0,void 0,(function*(){return this.crypto.aes256CbcEncrypt(e,D,t)}))}generateEncryptedParametersAsync(e,t){return N(this,void 0,void 0,(function*(){const n=this.crypto.generateRandomKey(2*i.EncryptionKeyLength),r=yield this.encryptString(n,t.itemsKey),o=(0,y.firstHalfOfString)(n),s=(0,y.secondHalfOfString)(n),a=yield this.encryptString(JSON.stringify(e.content),o),l=t.keyVersion+a,c=yield this.crypto.hmac256(l,s);if(!c)throw Error("Error generating hmac256 authHash");return{uuid:e.uuid,content_type:e.content_type,items_key_id:d(t)?t.uuid:void 0,content:l,enc_item_key:r,auth_hash:c,version:this.version,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid}}))}generateDecryptedParametersAsync(e,t){return N(this,void 0,void 0,(function*(){if(!e.enc_item_key)return console.error(Error("Missing item encryption key, skipping decryption.")),{uuid:e.uuid,errorDecrypting:!0};let n=e.enc_item_key;n=this.version+n;const r=this.encryptionComponentsFromString(n,t.itemsKey),i=yield this.decryptString(r.ciphertext,r.key);if(!i)return console.error("Error decrypting parameters",e),{uuid:e.uuid,errorDecrypting:!0};const o=(0,y.firstHalfOfString)(i),s=this.encryptionComponentsFromString(e.content,o),a=yield this.decryptString(s.ciphertext,s.key);return a?{uuid:e.uuid,content:JSON.parse(a),signatureData:{required:!1,contentHash:""}}:{uuid:e.uuid,errorDecrypting:!0}}))}encryptionComponentsFromString(e,t){const n=e.substring(0,v.ProtocolVersionLength);return{ciphertext:e.substring(v.ProtocolVersionLength,e.length),version:n,key:t}}deriveKey(e,t){return N(this,void 0,void 0,(function*(){const n=yield this.crypto.pbkdf2(e,t.content001.pw_salt,t.content001.pw_cost,i.PbkdfOutputLength);if(!n)throw Error("Error deriving PBKDF2 key");const r=(0,y.splitString)(n,2);return C({serverPassword:r[0],masterKey:r[1],version:v.ProtocolVersion.V001,keyParams:t.getPortableValue()})}))}createRandomizedKeySystemRootKey(e){throw new Error("Method not implemented.")}createUserInputtedKeySystemRootKey(e){throw new Error("Method not implemented.")}deriveUserInputtedKeySystemRootKey(e){throw new Error("Method not implemented.")}createKeySystemItemsKey(e,t,n){throw new Error("Method not implemented.")}versionForAsymmetricallyEncryptedString(e){throw new Error("Method not implemented.")}asymmetricEncrypt(e){throw new Error("Method not implemented.")}asymmetricDecrypt(e){throw new Error("Method not implemented.")}asymmetricDecryptOwnMessage(e){throw new Error("Method not implemented.")}asymmetricSignatureVerifyDetached(e){throw new Error("Method not implemented.")}asymmetricStringGetAdditionalData(e){throw new Error("Method not implemented.")}getSenderPublicKeySetFromAsymmetricallyEncryptedString(e){throw new Error("Method not implemented.")}}var T=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class M extends j{get version(){return v.ProtocolVersion.V002}generateNewItemsKeyContent(){const e=o.EncryptionKeyLength,t=this.crypto.generateRandomKey(e),n=this.crypto.generateRandomKey(e);return u.FillItemContent({itemsKey:t,dataAuthenticationKey:n,version:v.ProtocolVersion.V002})}createItemsKey(){const e=new u.DecryptedPayload(Object.assign({uuid:y.UuidGenerator.GenerateUuid(),content_type:c.ContentType.TYPES.ItemsKey,content:this.generateNewItemsKeyContent()},(0,u.PayloadTimestampDefaults)()));return u.CreateDecryptedItemFromPayload(e)}createRootKey(e,t,n){return T(this,void 0,void 0,(function*(){const r=y.lastElement(o.PbkdfCostsUsed),i=this.crypto.generateRandomKey(o.SaltSeedLength),s=yield this.crypto.unsafeSha1(e+":"+i),a=_({email:e,pw_nonce:i,pw_cost:r,pw_salt:s,version:v.ProtocolVersion.V002,origination:n,created:"".concat(Date.now())});return this.deriveKey(t,a)}))}computeRootKey(e,t){return T(this,void 0,void 0,(function*(){return this.deriveKey(e,t)}))}decryptString002(e,t,n){return T(this,void 0,void 0,(function*(){return this.crypto.aes256CbcDecrypt(e,n,t)}))}encryptString002(e,t,n){return T(this,void 0,void 0,(function*(){return this.crypto.aes256CbcEncrypt(e,n,t)}))}encryptTextParams(e,t,n,r,i,s){return T(this,void 0,void 0,(function*(){const a=this.crypto.generateRandomKey(o.EncryptionIvLength),l=yield this.encryptString002(e,t,a),c=[i,r,a,l].join(":"),u=yield this.crypto.hmac256(c,n);if(!u)throw Error("Error generating hmac256 authHash");const d=[i,u,r,a,l];if(s){const e=this.crypto.base64Encode(JSON.stringify(s.content));d.push(e)}return d.join(":")}))}decryptTextParams(e,t,n,r,i,o){return T(this,void 0,void 0,(function*(){if(!n)throw"Attempting to decryptTextParams with null encryptionKey";const s=yield this.crypto.hmac256(e,o);if(!s)throw Error("Error generating hmac256 localAuthHash");return!1===this.crypto.timingSafeEqual(i,s)?(console.error(Error("Auth hash does not match.")),null):this.decryptString002(t,n,r)}))}getPayloadAuthenticatedDataForExternalUse(e){const t=this.encryptionComponentsFromString002(e.enc_item_key).keyParams;if(!t)return;const n=JSON.parse(this.crypto.base64Decode(t));return Object.assign({},n)}generateEncryptedParametersAsync(e,t){return T(this,void 0,void 0,(function*(){const n=this.crypto.generateRandomKey(2*o.EncryptionKeyLength),r=yield this.encryptTextParams(n,t.itemsKey,t.dataAuthenticationKey,e.uuid,t.keyVersion,t instanceof S?t.keyParams:void 0),i=y.firstHalfOfString(n),s=y.secondHalfOfString(n),a=yield this.encryptTextParams(JSON.stringify(e.content),i,s,e.uuid,t.keyVersion,t instanceof S?t.keyParams:void 0);return{uuid:e.uuid,content_type:e.content_type,items_key_id:d(t)?t.uuid:void 0,content:a,enc_item_key:r,version:this.version,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid}}))}generateDecryptedParametersAsync(e,t){return T(this,void 0,void 0,(function*(){if(!e.enc_item_key)return console.error(Error("Missing item encryption key, skipping decryption.")),{uuid:e.uuid,errorDecrypting:!0};const n=e.enc_item_key,r=this.encryptionComponentsFromString002(n,t.itemsKey,t.dataAuthenticationKey),i=yield this.decryptTextParams(r.ciphertextToAuth,r.contentCiphertext,r.encryptionKey,r.iv,r.authHash,r.authKey);if(!i)return console.error("Error decrypting item_key parameters",e),{uuid:e.uuid,errorDecrypting:!0};const o=y.firstHalfOfString(i),s=y.secondHalfOfString(i),a=this.encryptionComponentsFromString002(e.content,o,s),l=yield this.decryptTextParams(a.ciphertextToAuth,a.contentCiphertext,a.encryptionKey,a.iv,a.authHash,a.authKey);return l?{uuid:e.uuid,content:JSON.parse(l),signatureData:{required:!1,contentHash:""}}:{uuid:e.uuid,errorDecrypting:!0}}))}deriveKey(e,t){return T(this,void 0,void 0,(function*(){const n=yield this.crypto.pbkdf2(e,t.content002.pw_salt,t.content002.pw_cost,o.PbkdfOutputLength);if(!n)throw Error("Error deriving PBKDF2 key");const r=y.splitString(n,3);return C({serverPassword:r[0],masterKey:r[1],dataAuthenticationKey:r[2],version:v.ProtocolVersion.V002,keyParams:t.getPortableValue()})}))}encryptionComponentsFromString002(e,t,n){const r=e.split(":");return{encryptionVersion:r[0],authHash:r[1],uuid:r[2],iv:r[3],contentCiphertext:r[4],keyParams:r[5],ciphertextToAuth:[r[0],r[2],r[3],r[4]].join(":"),encryptionKey:t,authKey:n}}}var F=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class R extends M{get version(){return v.ProtocolVersion.V003}generateNewItemsKeyContent(){const e=s.EncryptionKeyLength,t=this.crypto.generateRandomKey(e),n=this.crypto.generateRandomKey(e);return(0,u.FillItemContent)({itemsKey:t,dataAuthenticationKey:n,version:v.ProtocolVersion.V003})}createItemsKey(){const e=this.generateNewItemsKeyContent(),t=new u.DecryptedPayload(Object.assign({uuid:y.UuidGenerator.GenerateUuid(),content_type:c.ContentType.TYPES.ItemsKey,content:(0,u.FillItemContent)(e)},(0,u.PayloadTimestampDefaults)()));return(0,u.CreateDecryptedItemFromPayload)(t)}computeRootKey(e,t){return F(this,void 0,void 0,(function*(){return this.deriveKey(e,t)}))}deriveKey(e,t){return F(this,void 0,void 0,(function*(){const n=yield this.generateSalt(t.content003.identifier,v.ProtocolVersion.V003,s.PbkdfCost,t.content003.pw_nonce),r=yield this.crypto.pbkdf2(e,n,s.PbkdfCost,s.PbkdfOutputLength);if(!r)throw Error("Error deriving PBKDF2 key");const i=(0,y.splitString)(r,3);return C({serverPassword:i[0],masterKey:i[1],dataAuthenticationKey:i[2],version:v.ProtocolVersion.V003,keyParams:t.getPortableValue()})}))}createRootKey(e,t,n){return F(this,void 0,void 0,(function*(){const r=v.ProtocolVersion.V003,i=this.crypto.generateRandomKey(s.SaltSeedLength),o=x({identifier:e,pw_nonce:i,version:r,origination:n,created:"".concat(Date.now())});return this.deriveKey(t,o)}))}generateSalt(e,t,n,r){return F(this,void 0,void 0,(function*(){return yield this.crypto.sha256([e,"SF",t,n,r].join(":"))}))}}var L=n(99299);class Q{constructor(e){this.crypto=e}execute(e){return this.crypto.base64Encode(JSON.stringify(y.sortedCopy(y.omitUndefinedCopy(e))))}}class U{constructor(e){this.crypto=e,this.base64DataUsecase=new Q(this.crypto)}execute(e){const t=this.crypto.generateRandomKey(a.AsymmetricEncryptionNonceLength),n=this.crypto.sodiumCryptoBoxEasyEncrypt(e.stringToEncrypt,t,e.recipientPublicKey,e.senderKeyPair.privateKey),r={signingData:{publicKey:e.senderSigningKeyPair.publicKey,signature:this.crypto.sodiumCryptoSign(n,e.senderSigningKeyPair.privateKey)},senderPublicKey:e.senderKeyPair.publicKey};return[L.s,t,n,this.base64DataUsecase.execute(r)].join(":")}}class V{constructor(e){this.crypto=e}execute(e){return JSON.parse(this.crypto.base64Decode(e))}}class K{constructor(e){this.crypto=e,this.parseBase64Usecase=new V(this.crypto)}execute(e){const[t,n,r,i]=e.stringToDecrypt.split(":"),o=this.parseBase64Usecase.execute(i);try{const t=this.crypto.sodiumCryptoBoxEasyDecrypt(r,n,o.senderPublicKey,e.recipientSecretKey);return t?{plaintext:t,signatureVerified:this.crypto.sodiumCryptoSignVerify(r,o.signingData.signature,o.signingData.publicKey),signaturePublicKey:o.signingData.publicKey,senderPublicKey:o.senderPublicKey}:null}catch(e){return null}}}var H=n(73936);class G{constructor(e){this.crypto=e}execute(e,t){const n=JSON.parse(this.crypto.base64Decode(e));return(0,y.sortedCopy)(Object.assign(Object.assign({},n),t))}executeRaw(e){return JSON.parse(this.crypto.base64Decode(e))}}class Y{constructor(e){this.crypto=e}execute(e,t){return this.crypto.sodiumCryptoGenericHash(e,t.key)}}class z{constructor(e){this.crypto=e,this.parseBase64Usecase=new V(this.crypto),this.hashUseCase=new Y(this.crypto)}execute(e,t,n,r){const i=this.hashUseCase.execute(n.plaintext,t),o=this.hashUseCase.execute(r.plaintext,t),s=this.parseBase64Usecase.execute(n.additionalData),a=this.parseBase64Usecase.execute(r.additionalData),l=(0,H.q)(e);if(!s.signingData||!a.signingData)return l?{required:!0,contentHash:o,result:{passes:!1,publicKey:"",signature:""}}:{required:!1,contentHash:o};if(s.signingData.publicKey!==a.signingData.publicKey)return{required:l,contentHash:o,result:{passes:!1,publicKey:"",signature:""}};const c=s.signingData.publicKey,u=this.verifySignature(i,s.signingData.signature,c),d=this.verifySignature(o,a.signingData.signature,c);let h=!0;const p=e.signatureData;return p&&p.contentHash===o&&(p.required||p.result)&&(h=p.result.passes),{required:l,contentHash:o,result:{passes:u&&d&&h,publicKey:c,signature:a.signingData.signature}}}verifySignature(e,t,n){return this.crypto.sodiumCryptoSignVerify(e,t,n)}}class Z{constructor(e){this.crypto=e}execute(e){return{key:this.crypto.sodiumCryptoKdfDeriveFromKey(e.itemsKey,a.PayloadKeyHashingKeySubKeyNumber,a.PayloadKeyHashingKeySubKeyBytes,a.PayloadKeyHashingKeySubKeyContext)}}}class W{constructor(e){this.crypto=e,this.base64DataUsecase=new Q(this.crypto),this.stringToAuthenticatedDataUseCase=new G(this.crypto),this.signingVerificationUseCase=new z(this.crypto),this.deriveHashingKeyUseCase=new Z(this.crypto)}execute(e,t){const n=this.decryptContentKey(e,t);if(!n)return console.error("Error decrypting contentKey from parameters",e),{uuid:e.uuid,errorDecrypting:!0};const r=this.decryptContent(e,n.decrypted);if(!r)return{uuid:e.uuid,errorDecrypting:!0};const i=this.deriveHashingKeyUseCase.execute(t),o=this.signingVerificationUseCase.execute(e,i,{additionalData:n.components.additionalData,plaintext:n.decrypted},{additionalData:r.components.additionalData,plaintext:r.decrypted});return{uuid:e.uuid,content:JSON.parse(r.decrypted),signatureData:o}}decryptContent(e,t){const n=(0,H.U)(e.content);return this.decrypt(e,n,t)}decryptContentKey(e,t){const n=(0,H.U)(e.enc_item_key);return this.decrypt(e,n,t.itemsKey)}decrypt(e,t,n){const r=this.stringToAuthenticatedDataUseCase.executeRaw(t.authenticatedData),i=/[A-Z]/.test(r.u),o=this.stringToAuthenticatedDataUseCase.execute(t.authenticatedData,{u:i?e.uuid.toUpperCase():e.uuid,v:e.version,ksi:e.key_system_identifier,svu:e.shared_vault_uuid}),s=this.base64DataUsecase.execute(o),a=this.crypto.xchacha20Decrypt(t.ciphertext,t.nonce,n,s);return a?{decrypted:a,components:t,authenticatedDataString:s}:null}}class q{execute(e,t){const n={u:e.uuid,v:u.ProtocolVersion.V004};if(e.key_system_identifier&&(n.ksi=e.key_system_identifier),e.shared_vault_uuid&&(n.svu=e.shared_vault_uuid),(0,u.ContentTypeUsesRootKeyEncryption)(e.content_type))return Object.assign(Object.assign({},n),{kp:t.keyParams.content});if((0,u.ContentTypeUsesKeySystemRootKeyEncryption)(e.content_type)){if(!(0,u.isKeySystemRootKey)(t))throw Error("Attempting to use non-key system root key ".concat(t.content_type," for item content type ").concat(e.content_type));return Object.assign(Object.assign({},n),{kp:t.keyParams})}if(!d(t)&&!f(t))throw Error("Attempting to use non-items key for regular item.");return n}}class J{constructor(e){this.crypto=e}execute(e,t,n,r){const i=this.crypto.generateRandomKey(a.EncryptionNonceLength),o=this.encryptString(e,t,i,n);return[u.ProtocolVersion.V004,i,o,n,r].join(L.X)}encryptString(e,t,n,r){if(!n)throw"encryptString null nonce";if(!t)throw"encryptString null rawKey";return this.crypto.xchacha20Encrypt(e,n,t,r)}}class X{constructor(e){this.crypto=e,this.hashUseCase=new Y(this.crypto)}execute(e,t,n){const r=this.hashUseCase.execute(e,t);if(!n)return{additionalData:{},plaintextHash:r};const i=this.crypto.sodiumCryptoSign(r,n.privateKey);return{additionalData:{signingData:{publicKey:n.publicKey,signature:i}},plaintextHash:r}}}class ${constructor(e){this.crypto=e,this.generateProtocolStringUseCase=new J(this.crypto),this.generateAuthenticatedDataUseCase=new q,this.generateAdditionalDataUseCase=new X(this.crypto),this.encodeBase64DataUsecase=new Q(this.crypto),this.deriveHashingKeyUseCase=new Z(this.crypto)}execute(e,t,n){if((0,H.q)(e)&&!n)throw Error("Payload requires signing but no signing key pair was provided.");const r=this.generateAuthenticatedDataUseCase.execute(e,t),i=this.deriveHashingKeyUseCase.execute(t),{contentKey:o,encryptedContentKey:s}=this.generateEncryptedContentKey(t,i,r,n),{encryptedContent:a}=this.generateEncryptedContent(e,i,o,r,n);return{uuid:e.uuid,content_type:e.content_type,items_key_id:d(t)||f(t)?t.uuid:void 0,content:a,enc_item_key:s,version:u.ProtocolVersion.V004,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid}}generateEncryptedContent(e,t,n,r,i){const o=JSON.stringify(e.content),{additionalData:s}=this.generateAdditionalDataUseCase.execute(o,t,i);return{encryptedContent:this.generateProtocolStringUseCase.execute(o,n,this.encodeBase64DataUsecase.execute(r),this.encodeBase64DataUsecase.execute(s))}}generateEncryptedContentKey(e,t,n,r){const i=this.crypto.generateRandomKey(a.EncryptionKeyLength),{additionalData:o}=this.generateAdditionalDataUseCase.execute(i,t,r);return{contentKey:i,encryptedContentKey:this.generateProtocolStringUseCase.execute(i,e.itemsKey,this.encodeBase64DataUsecase.execute(n),this.encodeBase64DataUsecase.execute(o))}}}var ee=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class te{constructor(e){this.crypto=e}execute(e,t){return ee(this,void 0,void 0,(function*(){const n=t.content004.pw_nonce,r=yield this.generateSalt(t.content004.identifier,n),i=this.crypto.argon2(e,r,a.ArgonIterations,a.ArgonMemLimit,a.ArgonOutputKeyBytes),o=(0,y.splitString)(i,2),s=o[0],l=o[1],c=this.crypto.sodiumCryptoKdfDeriveFromKey(s,a.MasterKeyEncryptionKeyPairSubKeyNumber,a.MasterKeyEncryptionKeyPairSubKeyBytes,a.MasterKeyEncryptionKeyPairSubKeyContext),d=this.crypto.sodiumCryptoBoxSeedKeypair(c),h=this.crypto.sodiumCryptoKdfDeriveFromKey(s,a.MasterKeySigningKeyPairSubKeyNumber,a.MasterKeySigningKeyPairSubKeyBytes,a.MasterKeySigningKeyPairSubKeyContext),p=this.crypto.sodiumCryptoSignSeedKeypair(h);return C({masterKey:s,serverPassword:l,version:u.ProtocolVersion.V004,keyParams:t.getPortableValue(),encryptionKeyPair:d,signingKeyPair:p})}))}generateSalt(e,t){return ee(this,void 0,void 0,(function*(){const n=yield this.crypto.sha256([e,t].join(L.X));return(0,y.truncateHexString)(n,a.ArgonSaltLength)}))}}class ne{constructor(e){this.crypto=e,this.parseStringUseCase=new V(this.crypto)}execute(e){const t=(0,H.U)(e.enc_item_key).authenticatedData;return this.parseStringUseCase.execute(t)}}class re{constructor(e){this.crypto=e}execute(e,t,n){return r=this,i=void 0,s=function*(){const r=v.ProtocolVersion.V004,i=this.crypto.generateRandomKey(a.ArgonSaltSeedLength),o=P({identifier:e,pw_nonce:i,version:r,origination:n,created:"".concat(Date.now())});return new te(this.crypto).execute(t,o)},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(n,a)}l((s=s.apply(r,i||[])).next())}));var r,i,o,s}}class ie{constructor(e){this.crypto=e}execute(e){const t=this.crypto.generateRandomKey(a.EncryptionKeyLength),n=(0,u.FillItemContentSpecialized)({itemsKey:t,creationTimestamp:(new Date).getTime(),version:u.ProtocolVersion.V004,rootKeyToken:e.rootKeyToken}),r=Object.assign({uuid:e.uuid,content_type:c.ContentType.TYPES.KeySystemItemsKey,key_system_identifier:e.keySystemIdentifier,shared_vault_uuid:e.sharedVaultUuid,content:n,dirty:!0},(0,u.PayloadTimestampDefaults)()),i=new u.DecryptedPayload(r);return(0,u.CreateDecryptedItemFromPayload)(i)}}class oe{constructor(e){this.crypto=e}execute(e){const t=e.keyParams.seed,n=this.generateSalt(e.keyParams.systemIdentifier,t),r=this.crypto.argon2(e.password,n,a.ArgonIterations,a.ArgonMemLimit,a.ArgonOutputKeyBytes),i=(0,y.splitString)(r,2),o=i[0],s=i[1],l=y.UuidGenerator.GenerateUuid(),d={systemIdentifier:e.keyParams.systemIdentifier,key:o,keyVersion:u.ProtocolVersion.V004,keyParams:e.keyParams,token:s},h=new u.DecryptedPayload(Object.assign({uuid:l,content_type:c.ContentType.TYPES.KeySystemRootKey,content:(0,u.FillItemContentSpecialized)(d)},(0,u.PayloadTimestampDefaults)()));return new u.KeySystemRootKey(h)}generateSalt(e,t){const n=this.crypto.sodiumCryptoGenericHash([e,t].join(L.X));return(0,y.truncateHexString)(n,a.ArgonSaltLength)}}class se{constructor(e){this.crypto=e}execute(e){const t=u.ProtocolVersion.V004,n=this.crypto.generateRandomKey(a.ArgonSaltSeedLength),r=this.crypto.generateRandomKey(32),i={systemIdentifier:e.systemIdentifier,passwordType:u.KeySystemPasswordType.Randomized,creationTimestamp:(new Date).getTime(),seed:n,version:t};return new oe(this.crypto).execute({password:r,keyParams:i})}}class ae{constructor(e){this.crypto=e}execute(e){const t=u.ProtocolVersion.V004,n=this.crypto.generateRandomKey(a.ArgonSaltSeedLength),r={systemIdentifier:e.systemIdentifier,passwordType:u.KeySystemPasswordType.UserInputted,creationTimestamp:(new Date).getTime(),seed:n,version:t};return new oe(this.crypto).execute({password:e.userInputtedPassword,keyParams:r})}}class le{constructor(e){this.crypto=e,this.parseBase64Usecase=new V(this.crypto)}execute(e){const[t,n,r,i]=e.encryptedString.split(":"),o=this.parseBase64Usecase.execute(i);try{return{signatureVerified:this.crypto.sodiumCryptoSignVerify(r,o.signingData.signature,o.signingData.publicKey),signaturePublicKey:o.signingData.publicKey,senderPublicKey:o.senderPublicKey}}catch(e){return{signatureVerified:!1}}}}class ce{constructor(e){this.crypto=e,this.parseBase64Usecase=new V(this.crypto)}execute(e){const[t,n,r,i]=e.encryptedString.split(":"),o=this.parseBase64Usecase.execute(i);return c.Result.ok(o)}}class ue{constructor(e){this.crypto=e,this.parseBase64Usecase=new V(this.crypto)}execute(e){const[t,n,r,i]=e.message.split(":"),o=this.parseBase64Usecase.execute(i);try{const t=this.crypto.sodiumCryptoBoxEasyDecrypt(r,n,e.recipientPublicKey,e.ownPrivateKey);if(!t)return c.Result.fail("Could not decrypt message");const i=this.crypto.sodiumCryptoSignVerify(r,o.signingData.signature,o.signingData.publicKey);return c.Result.ok({plaintext:t,signatureVerified:i,signaturePublicKey:o.signingData.publicKey,senderPublicKey:o.senderPublicKey})}catch(e){return c.Result.fail("Could not decrypt message")}}}var de=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class he{constructor(e){this.crypto=e}getEncryptionDisplayName(){return"XChaCha20-Poly1305"}get version(){return v.ProtocolVersion.V004}generateNewItemsKeyContent(){const e=this.crypto.generateRandomKey(a.EncryptionKeyLength);return(0,u.FillItemContentSpecialized)({itemsKey:e,version:v.ProtocolVersion.V004})}createItemsKey(){const e=new u.DecryptedPayload(Object.assign({uuid:y.UuidGenerator.GenerateUuid(),content_type:c.ContentType.TYPES.ItemsKey,content:this.generateNewItemsKeyContent(),key_system_identifier:void 0,shared_vault_uuid:void 0},(0,u.PayloadTimestampDefaults)()));return(0,u.CreateDecryptedItemFromPayload)(e)}createRandomizedKeySystemRootKey(e){return new se(this.crypto).execute(e)}createUserInputtedKeySystemRootKey(e){return new ae(this.crypto).execute(e)}deriveUserInputtedKeySystemRootKey(e){return new oe(this.crypto).execute({keyParams:e.keyParams,password:e.userInputtedPassword})}createKeySystemItemsKey(e,t,n,r){return new ie(this.crypto).execute({uuid:e,keySystemIdentifier:t,sharedVaultUuid:n,rootKeyToken:r})}computeRootKey(e,t){return de(this,void 0,void 0,(function*(){return new te(this.crypto).execute(e,t)}))}createRootKey(e,t,n){return de(this,void 0,void 0,(function*(){return new re(this.crypto).execute(e,t,n)}))}getPayloadAuthenticatedDataForExternalUse(e){return new ne(this.crypto).execute(e)}generateEncryptedParameters(e,t,n){return new $(this.crypto).execute(e,t,n)}generateDecryptedParameters(e,t){return new W(this.crypto).execute(e,t)}asymmetricEncrypt(e){return new U(this.crypto).execute(e)}asymmetricDecrypt(e){return new K(this.crypto).execute(e)}asymmetricDecryptOwnMessage(e){return new ue(this.crypto).execute(e)}asymmetricSignatureVerifyDetached(e){return new le(this.crypto).execute({encryptedString:e})}asymmetricStringGetAdditionalData(e){return new ce(this.crypto).execute(e)}getSenderPublicKeySetFromAsymmetricallyEncryptedString(e){const[t,n,r,i]=e.split(":"),o=new V(this.crypto).execute(i);return{encryption:o.senderPublicKey,signing:o.signingData.publicKey}}versionForAsymmetricallyEncryptedString(e){const[t]=e.split(":");return t.split("_")[0]}}function pe(e,t){if(e===u.ProtocolVersion.V001)return new j(t);if(e===u.ProtocolVersion.V002)return new M(t);if(e===u.ProtocolVersion.V003)return new R(t);if(e===u.ProtocolVersion.V004)return new he(t);throw Error("Unable to find operator for version ".concat(e))}class fe{constructor(e){this.crypto=e,this.operators={},this.crypto=e}deinit(){this.crypto=void 0,this.operators={}}operatorForVersion(e){const t=e;let n=this.operators[t];return n||(n=pe(e,this.crypto),this.operators[t]=n),n}defaultOperator(){return this.operatorForVersion(v.ProtocolVersionLatest)}}function ge(e){return e.errorDecrypting}function me(e){return{uuid:e.uuid,content:e.content,content_type:e.content_type,items_key_id:e.items_key_id,enc_item_key:e.enc_item_key,version:e.version,auth_hash:e.auth_hash,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid,signatureData:e.signatureData}}function ye(e){return"generateEncryptedParametersAsync"in e}var ve=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};function Ae(e,t,n,r){return ve(this,void 0,void 0,(function*(){const i=n.operatorForVersion(t.keyVersion);let o;if(o=ye(i)?yield i.generateEncryptedParametersAsync(e,t):i.generateEncryptedParameters(e,t,r),!o)throw"Unable to generate encryption parameters";return o}))}function be(e,t,n){return ve(this,void 0,void 0,(function*(){const r=n.operatorForVersion(e.version);try{return ye(r)?yield r.generateDecryptedParametersAsync(me(e),t):r.generateDecryptedParameters(me(e),t)}catch(t){return console.error("Error decrypting payload",e,t),{uuid:e.uuid,errorDecrypting:!0}}}))}function we(e){const t={};return e.rootKeyEncryption&&(t.usesRootKeyWithKeyLookup={items:e.rootKeyEncryption}),e.keySystemRootKeyEncryption&&(t.usesKeySystemRootKeyWithKeyLookup={items:e.keySystemRootKeyEncryption}),e.itemsKeyEncryption&&(t.usesItemsKeyWithKeyLookup={items:e.itemsKeyEncryption}),t}function Se(e){const t={};return e.rootKeyEncryption&&(t.usesRootKeyWithKeyLookup={items:e.rootKeyEncryption}),e.keySystemRootKeyEncryption&&(t.usesKeySystemRootKeyWithKeyLookup={items:e.keySystemRootKeyEncryption}),e.itemsKeyEncryption&&(t.usesItemsKeyWithKeyLookup={items:e.itemsKeyEncryption}),t}function Ce(e,t){var n,r,i,o,s,a;const l=null===(n=t.usesItemsKey)||void 0===n?void 0:n.items.find((t=>t.uuid===e));if(l)return l;const c=null===(r=t.usesRootKey)||void 0===r?void 0:r.items.find((t=>t.uuid===e));if(c)return c;const u=null===(i=t.usesKeySystemRootKey)||void 0===i?void 0:i.items.find((t=>t.uuid===e));if(u)return u;const d=null===(o=t.usesItemsKeyWithKeyLookup)||void 0===o?void 0:o.items.find((t=>t.uuid===e));if(d)return d;const h=null===(s=t.usesRootKeyWithKeyLookup)||void 0===s?void 0:s.items.find((t=>t.uuid===e));if(h)return h;const p=null===(a=t.usesKeySystemRootKeyWithKeyLookup)||void 0===a?void 0:a.items.find((t=>t.uuid===e));if(p)return p;throw Error("Cannot find payload in encryption split")}function Ee(e,t){var n,r,i,o,s,a;const l=null===(n=t.usesItemsKey)||void 0===n?void 0:n.items.find((t=>t.uuid===e));if(l)return l;const c=null===(r=t.usesRootKey)||void 0===r?void 0:r.items.find((t=>t.uuid===e));if(c)return c;const u=null===(i=t.usesKeySystemRootKey)||void 0===i?void 0:i.items.find((t=>t.uuid===e));if(u)return u;const d=null===(o=t.usesItemsKeyWithKeyLookup)||void 0===o?void 0:o.items.find((t=>t.uuid===e));if(d)return d;const h=null===(s=t.usesRootKeyWithKeyLookup)||void 0===s?void 0:s.items.find((t=>t.uuid===e));if(h)return h;const p=null===(a=t.usesKeySystemRootKeyWithKeyLookup)||void 0===a?void 0:a.items.find((t=>t.uuid===e));if(p)return p;throw Error("Cannot find payload in encryption split")}function Ie(e){const t=[],n=[],r=[];for(const i of e)(0,u.ContentTypeUsesRootKeyEncryption)(i.content_type)?t.push(i):(0,u.ContentTypeUsesKeySystemRootKeyEncryption)(i.content_type)?r.push(i):n.push(i);return{rootKeyEncryption:t.length>0?t:void 0,itemsKeyEncryption:n.length>0?n:void 0,keySystemRootKeyEncryption:r.length>0?r:void 0}}class _e{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.message=e,t&&console.error("StandardException raised: ",e)}}var xe=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};const Pe="StandardNotes-PrivateUsername-V1";function ke(e,t){return xe(this,void 0,void 0,(function*(){const n=yield e.hmac256(yield e.sha256(Pe),yield e.sha256(t.trim().toLowerCase()));if(null!=n)return n}))}},46981:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentAction=void 0,function(e){e.SetSize="set-size",e.StreamItems="stream-items",e.StreamContextItem="stream-context-item",e.SaveItems="save-items",e.CreateItem="create-item",e.CreateItems="create-items",e.DeleteItems="delete-items",e.SetComponentData="set-component-data",e.RequestPermissions="request-permissions",e.DuplicateItem="duplicate-item",e.ComponentRegistered="component-registered",e.ActivateThemes="themes",e.Reply="reply",e.ThemesActivated="themes-activated",e.KeyDown="key-down",e.KeyUp="key-up",e.Click="click"}(n||(t.ComponentAction=n={}))},40611:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentArea=void 0,function(e){e.Editor="editor-editor",e.Themes="themes",e.EditorStack="editor-stack"}(n||(t.ComponentArea=n={}))},92898:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentFlag=void 0,function(e){e.New="New",e.Deprecated="Deprecated"}(n||(t.ComponentFlag=n={}))},45556:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6812:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.noteTypeForEditorIdentifier=t.NoteType=void 0;const r=n(36178);var i;!function(e){e.Authentication="authentication",e.Code="code",e.Markdown="markdown",e.RichText="rich-text",e.Spreadsheet="spreadsheet",e.Task="task",e.Plain="plain-text",e.Super="super",e.Unknown="unknown"}(i||(t.NoteType=i={})),t.noteTypeForEditorIdentifier=function(e){const t=(0,r.FindNativeFeature)(e);return t&&t.note_type?t.note_type:i.Unknown}},75482:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7675:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},92164:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},15077:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},45661:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},43834:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},36178:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GetDeprecatedEditors=t.GetDarkThemeFeature=t.GetNativeThemes=t.GetPlainNoteFeature=t.GetSuperNoteFeature=t.GetIframeEditors=t.GetIframeAndNativeEditors=t.FindNativeTheme=t.FindNativeFeature=t.GetFeatures=void 0;const r=n(84135),i=n(4891),o=n(9711),s=n(10379),a=n(85771),l=n(2258),c=n(88280),u=n(88277),d=n(40611);function h(){return[...(0,i.serverFeatures)(),...(0,o.clientFeatures)(),...(0,c.themes)(),...(0,u.nativeEditors)(),...(0,l.IframeEditors)(),...(0,a.experimentalFeatures)(),...(0,s.GetDeprecatedFeatures)()]}function p(e){return h().find((t=>t.identifier===e))}t.GetFeatures=h,t.FindNativeFeature=p,t.FindNativeTheme=function(e){return(0,c.themes)().find((t=>t.identifier===e))},t.GetIframeAndNativeEditors=function(){return[...(0,l.IframeEditors)(),...(0,u.nativeEditors)()]},t.GetIframeEditors=function(){return(0,l.IframeEditors)()},t.GetSuperNoteFeature=function(){return p(r.NativeFeatureIdentifier.TYPES.SuperEditor)},t.GetPlainNoteFeature=function(){return p(r.NativeFeatureIdentifier.TYPES.PlainEditor)},t.GetNativeThemes=function(){return(0,c.themes)()},t.GetDarkThemeFeature=function(){return(0,c.themes)().find((e=>e.identifier===r.NativeFeatureIdentifier.TYPES.DarkTheme))},t.GetDeprecatedEditors=function(){return(0,s.GetDeprecatedFeatures)().filter((e=>e.area===d.ComponentArea.Editor))}},49774:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},84135:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExperimentalFeatures=t.NativeFeatureIdentifier=void 0;const r=n(82648);class i extends r.ValueObject{get value(){return this.props.value}constructor(e){super(e)}static create(e){return Object.values(this.TYPES).includes(e)?r.Result.ok(new i({value:e})):r.Result.fail("Invalid feature identifier: ".concat(e))}}t.NativeFeatureIdentifier=i,i.TYPES={DailyEmailBackup:"org.standardnotes.daily-email-backup",Files:"org.standardnotes.files",FilesLowStorageTier:"org.standardnotes.files-low-storage-tier",FilesMaximumStorageTier:"org.standardnotes.files-max-storage-tier",ListedCustomDomain:"org.standardnotes.listed-custom-domain",NoteHistory30Days:"org.standardnotes.note-history-30",NoteHistory365Days:"org.standardnotes.note-history-365",NoteHistoryUnlimited:"org.standardnotes.note-history-unlimited",SignInAlerts:"com.standardnotes.sign-in-alerts",SmartFilters:"org.standardnotes.smart-filters",TagNesting:"org.standardnotes.tag-nesting",TwoFactorAuth:"org.standardnotes.two-factor-auth",UniversalSecondFactor:"org.standardnotes.universal-second-factor",SubscriptionSharing:"org.standardnotes.subscription-sharing",AutobiographyTheme:"org.standardnotes.theme-autobiography",DynamicTheme:"org.standardnotes.theme-dynamic",DarkTheme:"org.standardnotes.theme-focus",FuturaTheme:"org.standardnotes.theme-futura",MidnightTheme:"org.standardnotes.theme-midnight",SolarizedDarkTheme:"org.standardnotes.theme-solarized-dark",TitaniumTheme:"org.standardnotes.theme-titanium",ProtonTheme:"com.standardnotes.theme-proton",PlainEditor:"com.standardnotes.plain-text",SuperEditor:"com.standardnotes.super-editor",SheetsEditor:"org.standardnotes.standard-sheets",TokenVaultEditor:"org.standardnotes.token-vault",Clipper:"org.standardnotes.clipper",Vaults:"org.standardnotes.vaults",SharedVaults:"org.standardnotes.shared-vaults",DeprecatedCodeEditor:"org.standardnotes.code-editor",DeprecatedMarkdownProEditor:"org.standardnotes.advanced-markdown-editor",DeprecatedPlusEditor:"org.standardnotes.plus-editor",DeprecatedTaskEditor:"org.standardnotes.simple-task-editor",DeprecatedMarkdownVisualEditor:"org.standardnotes.markdown-visual-editor",DeprecatedBoldEditor:"org.standardnotes.bold-editor",DeprecatedMarkdownBasicEditor:"org.standardnotes.simple-markdown-editor",DeprecatedMarkdownMathEditor:"org.standardnotes.fancy-markdown-editor",DeprecatedMarkdownMinimistEditor:"org.standardnotes.minimal-markdown-editor",DeprecatedFoldersComponent:"org.standardnotes.folders",DeprecatedFileSafe:"org.standardnotes.file-safe",LegacyFileSafeIdentifier:"org.standardnotes.legacy.file-safe"},t.ExperimentalFeatures=[i.TYPES.Vaults]},39219:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},42116:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},95100:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},58635:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isEditorFeatureDescription=t.isIframeComponentFeatureDescription=t.isThemeFeatureDescription=void 0;const r=n(82648),i=n(40611);t.isThemeFeatureDescription=function(e){return"content_type"in e&&e.content_type===r.ContentType.TYPES.Theme},t.isIframeComponentFeatureDescription=function(e){return"content_type"in e&&e.content_type===r.ContentType.TYPES.Component&&[i.ComponentArea.Editor,i.ComponentArea.EditorStack].includes(e.area)},t.isEditorFeatureDescription=function(e){return null!=e.note_type||e.area===i.ComponentArea.Editor}},53908:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},9711:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clientFeatures=void 0;const r=n(80),i=n(84135),o=n(82648);t.clientFeatures=function(){return[{name:"Tag Nesting",availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser],identifier:i.NativeFeatureIdentifier.TYPES.TagNesting,permission_name:r.PermissionName.TagNesting,description:"Organize your tags into folders."},{name:"Smart Filters",availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser],identifier:i.NativeFeatureIdentifier.TYPES.SmartFilters,permission_name:r.PermissionName.SmartFilters,description:"Create smart filters for viewing notes matching specific criteria."},{name:"Encrypted files",availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser],identifier:i.NativeFeatureIdentifier.TYPES.Files,permission_name:r.PermissionName.Files,description:""},{name:"Clipper",availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser],identifier:i.NativeFeatureIdentifier.TYPES.Clipper,permission_name:r.PermissionName.Clipper,description:""}]}},10379:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GetDeprecatedFeatures=void 0;const r=n(82648),i=n(80),o=n(84135),s=n(6812),a=n(38732),l=n(46981),c=n(40611);t.GetDeprecatedFeatures=function(){const e=(0,a.FillIframeEditorDefaults)({name:"Code",spellcheckControl:!0,identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedCodeEditor,permission_name:i.PermissionName.DeprecatedCodeEditor,note_type:s.NoteType.Code,file_type:"txt",interchangeable:!0,deprecated:!0,index_path:"index.html",description:"Syntax highlighting and convenient keyboard shortcuts for over 120 programming languages. Ideal for code snippets and procedures.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/code.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),t=(0,a.FillIframeEditorDefaults)({name:"Rich Text",note_type:s.NoteType.RichText,file_type:"html",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedPlusEditor,permission_name:i.PermissionName.DeprecatedPlusEditor,spellcheckControl:!0,deprecated:!0,description:"From highlighting to custom font sizes and colors, to tables and lists, this editor is perfect for crafting any document.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/plus-editor.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),n=(0,a.FillIframeEditorDefaults)({name:"Markdown",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedMarkdownProEditor,note_type:s.NoteType.Markdown,file_type:"md",permission_name:i.PermissionName.DeprecatedMarkdownProEditor,spellcheckControl:!0,deprecated:!0,description:"A fully featured Markdown editor that supports live preview, a styling toolbar, and split pane support.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/adv-markdown.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),u=(0,a.FillIframeEditorDefaults)({name:"Checklist",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedTaskEditor,note_type:s.NoteType.Task,spellcheckControl:!0,file_type:"md",interchangeable:!1,deprecated:!0,permission_name:i.PermissionName.DeprecatedTaskEditor,description:'A great way to manage short-term and long-term to-do"s. You can mark tasks as completed, change their order, and edit the text naturally in place.',thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/task-editor.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),d=(0,a.FillIframeEditorDefaults)({name:"Alternative Rich Text",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedBoldEditor,note_type:s.NoteType.RichText,file_type:"html",component_permissions:[{name:l.ComponentAction.StreamContextItem,content_types:[r.ContentType.TYPES.Note]},{name:l.ComponentAction.StreamItems,content_types:[r.ContentType.TYPES.FilesafeCredentials,r.ContentType.TYPES.FilesafeFileMetadata,r.ContentType.TYPES.FilesafeIntegration]}],spellcheckControl:!0,deprecated:!0,permission_name:i.PermissionName.BoldEditor,description:"A simple and peaceful rich editor that helps you write and think clearly.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/bold.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),h=(0,a.FillIframeEditorDefaults)({name:"Basic Markdown",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedMarkdownBasicEditor,note_type:s.NoteType.Markdown,spellcheckControl:!0,file_type:"md",deprecated:!0,permission_name:i.PermissionName.MarkdownBasicEditor,description:"A Markdown editor with dynamic split-pane preview.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/simple-markdown.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),p=(0,a.FillIframeEditorDefaults)({name:"Markdown Alternative",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedMarkdownVisualEditor,note_type:s.NoteType.Markdown,file_type:"md",deprecated:!0,permission_name:i.PermissionName.MarkdownVisualEditor,spellcheckControl:!0,description:"A WYSIWYG-style Markdown editor that renders Markdown in preview-mode while you type without displaying any syntax.",index_path:"build/index.html",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]});return[e,t,n,u,d,h,(0,a.FillIframeEditorDefaults)({name:"Minimal Markdown",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedMarkdownMinimistEditor,note_type:s.NoteType.Markdown,file_type:"md",index_path:"index.html",permission_name:i.PermissionName.MarkdownMinimistEditor,spellcheckControl:!0,deprecated:!0,description:"A minimal Markdown editor with live rendering and in-text search via Ctrl/Cmd + F",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/min-markdown.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),(0,a.FillIframeEditorDefaults)({name:"Markdown with Math",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedMarkdownMathEditor,spellcheckControl:!0,permission_name:i.PermissionName.MarkdownMathEditor,note_type:s.NoteType.Markdown,file_type:"md",deprecated:!0,index_path:"index.html",description:"A beautiful split-pane Markdown editor with synced-scroll, LaTeX support, and colorful syntax.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/fancy-markdown.jpg",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]}),p,(0,a.FillIframeEditorDefaults)({name:"FileSafe",identifier:o.NativeFeatureIdentifier.TYPES.DeprecatedFileSafe,component_permissions:[{name:l.ComponentAction.StreamContextItem,content_types:[r.ContentType.TYPES.Note]},{name:l.ComponentAction.StreamItems,content_types:[r.ContentType.TYPES.FilesafeCredentials,r.ContentType.TYPES.FilesafeFileMetadata,r.ContentType.TYPES.FilesafeIntegration]}],permission_name:i.PermissionName.ComponentFilesafe,area:c.ComponentArea.EditorStack,deprecated:!0,description:"Encrypted attachments for your notes using your Dropbox, Google Drive, or WebDAV server. Limited to 50MB per file.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/FileSafe-banner.png",availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser]})]}},85771:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.experimentalFeatures=void 0;const r=n(82648),i=n(84135),o=n(80);t.experimentalFeatures=function(){return[{name:"Private vaults",description:"Private vaults allow you to store notes, files and tags into separate, encrypted vaults.",availableInRoles:[r.RoleName.NAMES.CoreUser,r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser],identifier:i.NativeFeatureIdentifier.TYPES.Vaults,permission_name:o.PermissionName.Vaults}]}},2258:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IframeEditors=void 0;const r=n(80),i=n(84135),o=n(6812),s=n(38732),a=n(82648);t.IframeEditors=function(){return[(0,s.FillIframeEditorDefaults)({name:"Authenticator",note_type:o.NoteType.Authentication,file_type:"json",interchangeable:!1,identifier:i.NativeFeatureIdentifier.TYPES.TokenVaultEditor,permission_name:r.PermissionName.TokenVaultEditor,description:"Encrypt and protect your 2FA secrets for all your internet accounts. Authenticator handles your 2FA secrets so that you never lose them again, or have to start over when you get a new device.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/token-vault.png",availableInRoles:[a.RoleName.NAMES.PlusUser,a.RoleName.NAMES.ProUser]}),(0,s.FillIframeEditorDefaults)({name:"Spreadsheet",identifier:i.NativeFeatureIdentifier.TYPES.SheetsEditor,note_type:o.NoteType.Spreadsheet,file_type:"json",interchangeable:!1,permission_name:r.PermissionName.SheetsEditor,description:"A powerful spreadsheet editor with formatting and formula support. Not recommended for large data sets, as encryption of such data may decrease editor performance.",thumbnail_url:"https://assets.standardnotes.com/screenshots/models/editors/spreadsheets.png",availableInRoles:[a.RoleName.NAMES.PlusUser,a.RoleName.NAMES.ProUser]})]}},88277:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.nativeEditors=void 0;const r=n(82648),i=n(6812),o=n(84135),s=n(80);t.nativeEditors=function(){return[{name:"Super",note_type:i.NoteType.Super,identifier:o.NativeFeatureIdentifier.TYPES.SuperEditor,spellcheckControl:!0,file_type:"json",interchangeable:!1,availableInRoles:[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser],permission_name:s.PermissionName.SuperEditor,description:"The best way to edit notes. Type / to bring up the block selection menu, or @ to embed images or link other tags and notes. Type - then space to start a list, or [] then space to start a checklist. Drag and drop an image or file to embed it in your note. Cmd/Ctrl + F to bring up search and replace."},{name:"Plain Text",note_type:i.NoteType.Plain,spellcheckControl:!0,file_type:"txt",interchangeable:!0,identifier:o.NativeFeatureIdentifier.TYPES.PlainEditor,availableInRoles:[r.RoleName.NAMES.CoreUser,r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser],permission_name:s.PermissionName.PlainEditor}]}},4891:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.serverFeatures=void 0;const r=n(80),i=n(84135),o=n(82648);t.serverFeatures=function(){return[{name:"Two factor authentication",identifier:i.NativeFeatureIdentifier.TYPES.TwoFactorAuth,permission_name:r.PermissionName.TwoFactorAuth,availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser]},{name:"U2F authentication",identifier:i.NativeFeatureIdentifier.TYPES.UniversalSecondFactor,permission_name:r.PermissionName.UniversalSecondFactor,availableInRoles:[o.RoleName.NAMES.ProUser]},{name:"Unlimited note history",identifier:i.NativeFeatureIdentifier.TYPES.NoteHistoryUnlimited,permission_name:r.PermissionName.NoteHistoryUnlimited,availableInRoles:[o.RoleName.NAMES.ProUser]},{name:"365 days note history",identifier:i.NativeFeatureIdentifier.TYPES.NoteHistory365Days,permission_name:r.PermissionName.NoteHistory365Days,availableInRoles:[o.RoleName.NAMES.PlusUser]},{name:"Email backups",identifier:i.NativeFeatureIdentifier.TYPES.DailyEmailBackup,permission_name:r.PermissionName.DailyEmailBackup,availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser]},{name:"Sign-in email alerts",identifier:i.NativeFeatureIdentifier.TYPES.SignInAlerts,permission_name:r.PermissionName.SignInAlerts,availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser]},{name:"Files maximum storage tier",identifier:i.NativeFeatureIdentifier.TYPES.FilesMaximumStorageTier,permission_name:r.PermissionName.FilesMaximumStorageTier,availableInRoles:[o.RoleName.NAMES.ProUser]},{name:"Files low storage tier",identifier:i.NativeFeatureIdentifier.TYPES.FilesLowStorageTier,permission_name:r.PermissionName.FilesLowStorageTier,availableInRoles:[o.RoleName.NAMES.PlusUser]},{name:"Files medium storage tier",identifier:i.NativeFeatureIdentifier.TYPES.SubscriptionSharing,permission_name:r.PermissionName.SubscriptionSharing,availableInRoles:[o.RoleName.NAMES.ProUser]},{name:"Listed Custom Domain",identifier:i.NativeFeatureIdentifier.TYPES.ListedCustomDomain,permission_name:r.PermissionName.ListedCustomDomain,availableInRoles:[o.RoleName.NAMES.PlusUser,o.RoleName.NAMES.ProUser]},{name:"Shared Vaults",identifier:i.NativeFeatureIdentifier.TYPES.SharedVaults,permission_name:r.PermissionName.SharedVaults,availableInRoles:[o.RoleName.NAMES.InternalTeamUser]}]}},88280:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.themes=void 0;const r=n(80),i=n(84135),o=n(82504),s=n(82648);t.themes=function(){const e=(0,o.FillThemeComponentDefaults)({name:"Midnight",identifier:i.NativeFeatureIdentifier.TYPES.MidnightTheme,permission_name:r.PermissionName.MidnightTheme,isDark:!0,dock_icon:{type:"circle",background_color:"#086DD6",foreground_color:"#ffffff",border_color:"#086DD6"},availableInRoles:[s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser]}),t=(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Futura",identifier:i.NativeFeatureIdentifier.TYPES.FuturaTheme,permission_name:r.PermissionName.FuturaTheme,isDark:!0,dock_icon:{type:"circle",background_color:"#fca429",foreground_color:"#ffffff",border_color:"#fca429"}}),n=(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Solarized Dark",identifier:i.NativeFeatureIdentifier.TYPES.SolarizedDarkTheme,permission_name:r.PermissionName.SolarizedDarkTheme,isDark:!0,dock_icon:{type:"circle",background_color:"#2AA198",foreground_color:"#ffffff",border_color:"#2AA198"}}),a=(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Autobiography",identifier:i.NativeFeatureIdentifier.TYPES.AutobiographyTheme,permission_name:r.PermissionName.AutobiographyTheme,dock_icon:{type:"circle",background_color:"#9D7441",foreground_color:"#ECE4DB",border_color:"#9D7441"}}),l=(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.CoreUser,s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Dark",identifier:i.NativeFeatureIdentifier.TYPES.DarkTheme,permission_name:r.PermissionName.FocusedTheme,clientControlled:!0,isDark:!0,dock_icon:{type:"circle",background_color:"#a464c2",foreground_color:"#ffffff",border_color:"#a464c2"}}),c=(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Titanium",identifier:i.NativeFeatureIdentifier.TYPES.TitaniumTheme,permission_name:r.PermissionName.TitaniumTheme,dock_icon:{type:"circle",background_color:"#6e2b9e",foreground_color:"#ffffff",border_color:"#6e2b9e"}}),u=(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Dynamic Panels",identifier:i.NativeFeatureIdentifier.TYPES.DynamicTheme,permission_name:r.PermissionName.ThemeDynamic,layerable:!0,no_mobile:!0});return[e,t,n,a,l,(0,o.FillThemeComponentDefaults)({availableInRoles:[s.RoleName.NAMES.CoreUser,s.RoleName.NAMES.PlusUser,s.RoleName.NAMES.ProUser],name:"Carbon",identifier:i.NativeFeatureIdentifier.TYPES.ProtonTheme,permission_name:r.PermissionName.ProtonTheme,dock_icon:{type:"circle",background_color:"#16141c",foreground_color:"#ffffff",border_color:"#4a4658"}}),c,u]}},38732:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FillIframeEditorDefaults=void 0;const r=n(82648),i=n(46981),o=n(40611);t.FillIframeEditorDefaults=function(e){return e.index_path||(e.index_path="dist/index.html"),e.component_permissions||(e.component_permissions=[{name:i.ComponentAction.StreamContextItem,content_types:[r.ContentType.TYPES.Note]}]),e.content_type=r.ContentType.TYPES.Component,e.area||(e.area=o.ComponentArea.Editor),null==e.interchangeable&&(e.interchangeable=!0),e}},82504:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FillThemeComponentDefaults=void 0;const r=n(82648),i=n(40611);t.FillThemeComponentDefaults=function(e){return e.index_path||(e.index_path="index.css"),e.content_type=r.ContentType.TYPES.Theme,e.area||(e.area=i.ComponentArea.Themes),e}},93625:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},80:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PermissionName=void 0,function(e){e.AccountSwitcher="app:account-switcher",e.AutobiographyTheme="theme:autobiography",e.BoldEditor="editor:bold",e.DeprecatedCodeEditor="editor:code-editor",e.ComponentFilesafe="component:filesafe",e.ComponentFolders="component:folders",e.DailyEmailBackup="server:daily-email-backup",e.Files="app:files",e.FilesMaximumStorageTier="server:files-max-storage-tier",e.FilesLowStorageTier="server:files-low-storage-tier",e.FocusedTheme="theme:focused",e.FocusMode="app:focus-mode",e.FuturaTheme="theme:futura",e.ListedCustomDomain="listed:custom-domain",e.MarkdownBasicEditor="editor:markdown-basic",e.MarkdownMathEditor="editor:markdown-math",e.MarkdownMinimistEditor="editor:markdown-minimist",e.DeprecatedMarkdownProEditor="editor:markdown-pro",e.MarkdownVisualEditor="editor:markdown-visual",e.MidnightTheme="theme:midnight",e.NoteHistory30Days="server:note-history-30-days",e.NoteHistory365Days="server:note-history-365-days",e.NoteHistoryUnlimited="server:note-history-unlimited",e.PlainEditor="editor:plain",e.DeprecatedPlusEditor="editor:plus",e.SheetsEditor="editor:sheets",e.SignInAlerts="server:sign-in-alerts",e.SmartFilters="app:smart-filters",e.SolarizedDarkTheme="theme:solarized-dark",e.TagNesting="app:tag-nesting",e.DeprecatedTaskEditor="editor:task-editor",e.ThemeDynamic="theme:dynamic",e.TitaniumTheme="theme:titanium",e.TokenVaultEditor="editor:token-vault",e.TwoFactorAuth="server:two-factor-auth",e.UniversalSecondFactor="server:universal-second-factor",e.SubscriptionSharing="server:subscription-sharing",e.SuperEditor="editor:super-editor",e.Clipper="app:clipper",e.Vaults="app:vaults",e.SharedVaults="server:shared-vaults",e.ProtonTheme="theme:proton"}(n||(t.PermissionName=n={}))},34404:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7675),t),i(n(84135),t),i(n(36178),t),i(n(58635),t),i(n(95100),t),i(n(15077),t),i(n(39219),t),i(n(49774),t),i(n(45661),t),i(n(92164),t),i(n(43834),t),i(n(42116),t),i(n(53908),t),i(n(93625),t),i(n(80),t),i(n(46981),t),i(n(40611),t),i(n(92898),t),i(n(45556),t),i(n(6812),t),i(n(75482),t)},80215:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(34404),t)},86311:(e,t,n)=>{n.d(t,{M1:()=>s,BI:()=>m,y4:()=>b,yW:()=>c,YT:()=>f,VA:()=>h,IL:()=>v,F9:()=>i,bA:()=>y,WE:()=>l,Qc:()=>B,mQ:()=>k,Qf:()=>S});var r=n(87901);class i{constructor(e){this.maxSize=e,this.cache={},this.orderedQueue=[]}add(e,t){if(t.encryptedBytes.length>this.maxSize)return!1;for(;this.size+t.encryptedBytes.length>this.maxSize;)this.remove(this.orderedQueue[0]);return this.cache[e]=t,this.orderedQueue.push(e),!0}get size(){return Object.values(this.cache).map((e=>e.encryptedBytes.length)).reduce(((e,t)=>e+t),0)}get(e){return this.cache[e]}remove(e){delete this.cache[e],(0,r.removeFromArray)(this.orderedQueue,e)}clear(){this.cache={},this.orderedQueue=[]}}var o=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class s{constructor(e,t){this.minimumChunkSize=e,this.onChunk=t,this.loggingEnabled=!1,this.bytes=new Uint8Array,this.index=1}log(){if(this.loggingEnabled){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];console.log(t)}}addBytes(e,t){return o(this,void 0,void 0,(function*(){this.bytes=new Uint8Array([...this.bytes,...e]),this.log("Chunker adding ".concat(e.length,", total size ").concat(this.bytes.length)),(this.bytes.length>=this.minimumChunkSize||t)&&(yield this.popBytes(t))}))}popBytes(e){return o(this,void 0,void 0,(function*(){const t=Math.max(this.minimumChunkSize,this.bytes.length),n=this.bytes.slice(0,t);this.bytes=new Uint8Array([...this.bytes.slice(t)]),this.log("Chunker popping ".concat(n.length,", total size in queue ").concat(this.bytes.length)),yield this.onChunk({data:n,index:this.index++,isLast:e})}))}}var a=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class l{constructor(e,t,n){this.chunkSizes=e,this.source=t,this.onChunk=n,this.bytes=new Uint8Array,this.index=1,this.remainingChunks=[],this.remainingChunks=e.slice(),this.fileSize=e.reduce(((e,t)=>e+t),0)}get bytesPopped(){return this.fileSize-this.bytesRemaining}get bytesRemaining(){return this.remainingChunks.reduce(((e,t)=>e+t),0)}needsPop(){return this.remainingChunks.length>0&&this.bytes.length>=this.remainingChunks[0]}addBytes(e){return a(this,void 0,void 0,(function*(){this.bytes=new Uint8Array([...this.bytes,...e]),this.needsPop()&&(yield this.popBytes())}))}popBytes(){return a(this,void 0,void 0,(function*(){const e=this.remainingChunks[0],t=this.bytes.slice(0,e);this.bytes=new Uint8Array([...this.bytes.slice(e)]),this.remainingChunks.shift(),yield this.onChunk({data:t,index:this.index++,isLast:this.index===this.chunkSizes.length-1,progress:{encryptedFileSize:this.fileSize,encryptedBytesDownloaded:this.bytesPopped,encryptedBytesRemaining:this.bytesRemaining,percentComplete:this.bytesPopped/this.fileSize*100,source:this.source}}),this.needsPop()&&(yield this.popBytes())}))}}const c={Version:"1.0.0",MetadataFileName:"metadata.sn.json",BinaryFileName:"file.encrypted"};var u=n(95658),d=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class h{constructor(e,t,n){this.file=e,this.api=t,this.valetToken=n,this.aborted=!1,this.abortDeferred=(0,r.Deferred)(),this.totalBytesDownloaded=0}getProgress(){const e=this.file.encryptedChunkSizes.reduce(((e,t)=>e+t),0);return{encryptedFileSize:e,encryptedBytesDownloaded:this.totalBytesDownloaded,encryptedBytesRemaining:e-this.totalBytesDownloaded,percentComplete:this.totalBytesDownloaded/e*100,source:"network"}}run(e){return d(this,void 0,void 0,(function*(){return this.performDownload(e)}))}performDownload(e){return d(this,void 0,void 0,(function*(){const t=this.api.downloadFile({file:this.file,chunkIndex:0,valetToken:this.valetToken,contentRangeStart:0,onBytesReceived:t=>d(this,void 0,void 0,(function*(){this.aborted||(this.totalBytesDownloaded+=t.byteLength,yield e(t,this.getProgress(),this.abort))})),ownershipType:this.file.shared_vault_uuid?"shared-vault":"user"});return yield Promise.race([this.abortDeferred.promise,t])}))}abort(){this.aborted=!0,this.abortDeferred.resolve("aborted")}}var p=n(98418);class f{constructor(e,t){this.file=e,this.crypto=t,this.decryptor=this.crypto.xchacha20StreamInitDecryptor(this.file.encryptionHeader,this.file.key)}decryptBytes(e){const t=this.crypto.xchacha20StreamDecryptorPush(this.decryptor,e,this.file.remoteIdentifier);if(!1===t)return;const n=t.tag===p.SodiumTag.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL;return{decryptedBytes:t.message,isFinalChunk:n}}}var g=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class m{constructor(e,t,n,r){this.file=e,this.crypto=t,this.api=n,this.downloader=new h(this.file,this.api,r)}createDecryptor(){return new f(this.file,this.crypto)}run(e){return g(this,void 0,void 0,(function*(){const t=this.createDecryptor();let n;const r=yield this.downloader.run(((r,i,o)=>g(this,void 0,void 0,(function*(){const s=t.decryptBytes(r);if(!s||0===s.decryptedBytes.length)return n=new u.ClientDisplayableError("Failed to decrypt chunk"),void o();const a=s.decryptedBytes;yield e({decrypted:{decryptedBytes:a},encrypted:{encryptedBytes:r},progress:i})}))));return{success:!(r instanceof u.ClientDisplayableError),error:"aborted"===r?void 0:r||n,aborted:"aborted"===r}}))}abort(){this.downloader.abort()}}class y{constructor(e){this.apiService=e}uploadBytes(e,t,n,r){return i=this,o=void 0,a=function*(){return yield this.apiService.uploadFileBytes(r,t,n,e)},new((s=void 0)||(s=Promise))((function(e,t){function n(e){try{l(a.next(e))}catch(e){t(e)}}function r(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(n,r)}l((a=a.apply(i,o||[])).next())}));var i,o,s,a}}class v{constructor(e,t){this.file=e,this.crypto=t}initializeHeader(){return this.stream=this.crypto.xchacha20StreamInitEncryptor(this.file.key),this.stream.header}pushBytes(e,t){if(!this.stream)throw new Error("FileEncryptor must call initializeHeader first");const n=t?p.SodiumTag.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL:void 0;return this.crypto.xchacha20StreamEncryptorPush(this.stream,e,this.file.remoteIdentifier,n)}}var A=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class b{constructor(e,t,n,r,i){this.file=e,this.valetToken=t,this.crypto=n,this.api=r,this.vault=i,this.encryptedChunkSizes=[],this.totalBytesPushedInDecryptedTerms=0,this.totalBytesUploadedInDecryptedTerms=0,this.encryptor=new v(e,this.crypto),this.uploader=new y(this.api),this.encryptionHeader=this.encryptor.initializeHeader()}getValetToken(){return this.valetToken}getProgress(){const e=this.file.decryptedSize;return{decryptedFileSize:e,decryptedBytesUploaded:this.totalBytesUploadedInDecryptedTerms,decryptedBytesRemaining:e-this.totalBytesUploadedInDecryptedTerms,percentComplete:this.totalBytesUploadedInDecryptedTerms/e*100}}getResult(){return{encryptionHeader:this.encryptionHeader,finalDecryptedSize:this.totalBytesPushedInDecryptedTerms,key:this.file.key,remoteIdentifier:this.file.remoteIdentifier}}pushBytes(e,t,n){return A(this,void 0,void 0,(function*(){this.totalBytesPushedInDecryptedTerms+=e.byteLength;const r=this.encryptBytes(e,n);this.encryptedChunkSizes.push(r.length);const i=yield this.uploadBytes(r,t);return i&&(this.totalBytesUploadedInDecryptedTerms+=e.byteLength),i}))}encryptBytes(e,t){return this.encryptor.pushBytes(e,t)}uploadBytes(e,t){return A(this,void 0,void 0,(function*(){return yield this.uploader.uploadBytes(e,this.vault&&this.vault.sharing?"shared-vault":"user",t,this.valetToken)}))}}var w=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};function S(e,t,n,r,i){return w(this,void 0,void 0,(function*(){const o=new f(t,r),s=new l(t.encryptedChunkSizes,"local",(e=>w(this,void 0,void 0,(function*(){const t=o.decryptBytes(e.data);t&&(yield i(t.decryptedBytes))}))));return yield n.readFile(e,(e=>w(this,void 0,void 0,(function*(){yield s.addBytes(e)}))))}))}const C=!1;var E;!function(e){e[e.FilesPackage=0]="FilesPackage"}(E||(E={}));const I={[E.FilesPackage]:!1},_={[E.FilesPackage]:"green"};function x(e){if(C&&I[e]){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];(0,r.logWithColor)(E[e],_[e],...n)}}var P=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};function k(e,t,n,r){return P(this,void 0,void 0,(function*(){x(E.FilesPackage,"Reading and decrypting backup file",e.uuid,"chunk sizes",e.encryptedChunkSizes);const i=new f(e,n),o=new l(e.encryptedChunkSizes,"local",(e=>P(this,void 0,void 0,(function*(){x(E.FilesPackage,"OrderedByteChunker did pop bytes",e.data.length,e.progress);const t=i.decryptBytes(e.data);t&&(yield r(Object.assign(Object.assign({},e),{data:t.decryptedBytes})))})))),s=yield t.readEncryptedFileFromBackup(e.uuid,(e=>P(this,void 0,void 0,(function*(){x(E.FilesPackage,"Got file chunk from backup service",e.data.length,e.progress),yield o.addBytes(e.data)}))));return x(E.FilesPackage,"Finished reading and decrypting backup file",e.uuid),s}))}function B(e,t,n){const r=Math.floor(e.percentComplete),i="network"===e.source?"":"memcache"===e.source?"from cache":"from backup";let o="Downloading file ".concat(i,' "').concat(t,'"');return n.showPercent&&(o+=" (".concat(r,"%)")),o}},56974:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},15866:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},35376:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},76317:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentViewerEvent=void 0,function(e){e.FeatureStatusUpdated="FeatureStatusUpdated"}(n||(t.ComponentViewerEvent=n={}))},88076:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},68763:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.KeyboardModifier=void 0,function(e){e.Shift="Shift",e.Ctrl="Control",e.Meta="Meta"}(n||(t.KeyboardModifier=n={}))},75895:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},74601:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},3668:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},42405:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FillItemContentSpecialized=t.FillItemContent=void 0;const r=n(71458),i=n(68716);function o(e){return e.references||(e.references=[]),e.appData||(e.appData={[r.DefaultAppDomain]:{}}),e.appData[r.DefaultAppDomain]||(e.appData[r.DefaultAppDomain]={}),e.appData[r.DefaultAppDomain][i.AppDataField.UserModifiedDate]||(e.appData[r.DefaultAppDomain][i.AppDataField.UserModifiedDate]=(new Date).toString()),e}t.FillItemContent=o,t.FillItemContentSpecialized=function(e){return o(e)}},95698:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},55930:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},36186:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},80537:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createComponentCreatedContextPayload=void 0,t.createComponentCreatedContextPayload=function(e){return{content_type:e.content_type,content:e.content,created_at:e.created_at,deleted:!1,uuid:e.uuid}}},1482:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateComponentRetrievedContextPayload=void 0,t.CreateComponentRetrievedContextPayload=function(e){return{content_type:e.content_type,content:e.content,created_at:e.created_at,deleted:!1,uuid:e.uuid}}},69087:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},70359:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.checkRemotePayloadAllowed=t.FilterDisallowedRemotePayloadsAndMap=void 0;const r=n(78381);function i(e){return(0,r.isCorruptTransferPayload)(e)?{disallowed:e}:(0,r.isEncryptedTransferPayload)(e)||null==e.content?{allowed:e}:{disallowed:e}}t.FilterDisallowedRemotePayloadsAndMap=function(e){const t=[],n=[];for(const o of e){const e=i(o);void 0===e.allowed?n.push(o):t.push((r=e.allowed,Object.assign(Object.assign({},r),{__passed_filter__:!0})))}var r;return{filtered:t,disallowed:n}},t.checkRemotePayloadAllowed=i},13214:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateDecryptedBackupFileContextPayload=t.CreateEncryptedBackupFileContextPayload=void 0,t.CreateEncryptedBackupFileContextPayload=function(e){return{auth_hash:e.auth_hash,content_type:e.content_type,content:e.content,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!1,duplicate_of:e.duplicate_of,enc_item_key:e.enc_item_key,items_key_id:e.items_key_id,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid}},t.CreateDecryptedBackupFileContextPayload=function(e){return{content_type:e.content_type,content:e.content,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!1,duplicate_of:e.duplicate_of,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid}}},84034:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateDeletedLocalStorageContextPayload=t.CreateDecryptedLocalStorageContextPayload=t.CreateEncryptedLocalStorageContextPayload=t.isEncryptedLocalStoragePayload=void 0;const r=n(87901),i=n(78381);t.isEncryptedLocalStoragePayload=function(e){return(0,i.isEncryptedTransferPayload)(e)},t.CreateEncryptedLocalStorageContextPayload=function(e){return{auth_hash:e.auth_hash,content_type:e.content_type,content:e.content,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!1,dirty:null!=e.dirty&&e.dirty,duplicate_of:e.duplicate_of,enc_item_key:e.enc_item_key,errorDecrypting:e.errorDecrypting,items_key_id:e.items_key_id,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,waitingForKey:e.waitingForKey,user_uuid:e.user_uuid,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid,last_edited_by_uuid:e.last_edited_by_uuid,signatureData:e.signatureData}},t.CreateDecryptedLocalStorageContextPayload=function(e){return{content_type:e.content_type,content:e.content,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!1,duplicate_of:e.duplicate_of,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,dirty:(0,r.useBoolean)(e.dirty,!1),user_uuid:e.user_uuid,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid,last_edited_by_uuid:e.last_edited_by_uuid,signatureData:e.signatureData}},t.CreateDeletedLocalStorageContextPayload=function(e){return{content_type:e.content_type,content:void 0,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!0,dirty:!0,duplicate_of:e.duplicate_of,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,user_uuid:e.user_uuid,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid,last_edited_by_uuid:e.last_edited_by_uuid,signatureData:e.signatureData}}},51600:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateOfflineSyncPushContextPayload=void 0;const r=n(59180);t.CreateOfflineSyncPushContextPayload=function(e){const t={content:void 0,content_type:e.content_type,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!1,duplicate_of:e.duplicate_of,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid};return(0,r.isDecryptedPayload)(e)?Object.assign(Object.assign({},t),{content:e.content}):Object.assign(Object.assign({},t),{deleted:e.deleted})}},30429:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateOfflineSyncSavedPayload=void 0;const r=n(59180);t.CreateOfflineSyncSavedPayload=function(e){return{content_type:e.content_type,created_at_timestamp:e.created_at_timestamp,deleted:(0,r.isDeletedPayload)(e),updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid}}},18592:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateDeletedServerSyncPushPayload=t.CreateEncryptedServerSyncPushPayload=void 0,t.CreateEncryptedServerSyncPushPayload=function(e){return{content_type:e.content_type,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!1,duplicate_of:e.duplicate_of,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,content:e.content,enc_item_key:e.enc_item_key,items_key_id:e.items_key_id,auth_hash:e.auth_hash,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid}},t.CreateDeletedServerSyncPushPayload=function(e){return{content_type:e.content_type,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:!0,duplicate_of:e.duplicate_of,updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,content:void 0,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid}}},2116:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateServerSyncSavedPayload=void 0;const r=n(87901);t.CreateServerSyncSavedPayload=function(e){return{content_type:e.content_type,created_at_timestamp:e.created_at_timestamp,created_at:e.created_at,deleted:(0,r.useBoolean)(e.deleted,!1),updated_at_timestamp:e.updated_at_timestamp,updated_at:e.updated_at,uuid:e.uuid,key_system_identifier:e.key_system_identifier,shared_vault_uuid:e.shared_vault_uuid,user_uuid:e.user_uuid,duplicate_of:e.duplicate_of,last_edited_by_uuid:e.last_edited_by_uuid}}},18973:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7563:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},43740:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DecryptedItem=void 0;const r=n(87901),i=n(68716),o=n(71458),s=n(97127),a=n(41035);class l extends s.GenericItem{constructor(e){super(e),this.protected=!1,this.trashed=!1,this.pinned=!1,this.archived=!1,this.locked=!1,this.starred=!1;const t=this.getAppDomainValueWithDefault(i.AppDataField.UserModifiedDate,this.serverUpdatedAt||0);this.userModifiedDate=new Date(t),this.conflictOf=e.content.conflict_of,this.updatedAtString=(0,r.dateToLocalizedString)(this.userModifiedDate),this.protected=(0,r.useBoolean)(this.payload.content.protected,!1),this.trashed=(0,r.useBoolean)(this.payload.content.trashed,!1),this.starred=(0,r.useBoolean)(this.payload.content.starred,!1),this.pinned=this.getAppDomainValueWithDefault(i.AppDataField.Pinned,!1),this.archived=this.getAppDomainValueWithDefault(i.AppDataField.Archived,!1),this.locked=this.getAppDomainValueWithDefault(i.AppDataField.Locked,!1)}static DefaultAppDomain(){return o.DefaultAppDomain}get content(){return this.payload.content}get references(){return this.payload.content.references||[]}isReferencingItem(e){return null!=this.references.find((t=>t.uuid===e.uuid))}getDomainData(e){const t=this.payload.content.appData;if(t)return t[e]}getAppDomainValue(e){const t=this.getDomainData(o.DefaultAppDomain);return null==t?void 0:t[e]}getAppDomainValueWithDefault(e,t){const n=this.getDomainData(o.DefaultAppDomain);return(null==n?void 0:n[e])||t}payloadRepresentation(e){return this.payload.copy(e)}contentKeysToIgnoreWhenCheckingEquality(){return["conflict_of"]}appDataContentKeysToIgnoreWhenCheckingEquality(){return[i.AppDataField.UserModifiedDate]}getContentCopy(){return JSON.parse(JSON.stringify(this.content))}isItemContentEqualWith(e){return(0,a.ItemContentsEqual)(this.payload.content,e.payload.content,this.contentKeysToIgnoreWhenCheckingEquality(),this.appDataContentKeysToIgnoreWhenCheckingEquality())}}t.DecryptedItem=l},78438:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DeletedItem=void 0;const r=n(97127);class i extends r.GenericItem{constructor(e){super(e),this.deleted=!0}payloadRepresentation(e){return this.payload.copy(e)}}t.DeletedItem=i},80406:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EncryptedItem=void 0;const r=n(97127);class i extends r.GenericItem{constructor(e){super(e)}get version(){return this.payload.version}payloadRepresentation(e){return this.payload.copy(e)}get errorDecrypting(){return this.payload.errorDecrypting}get waitingForKey(){return this.payload.waitingForKey}get content(){return this.payload.content}get auth_hash(){return this.payload.auth_hash}}t.EncryptedItem=i},97127:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GenericItem=void 0;const r=n(87901),i=n(33545),o=n(89223),s=n(43610),a=n(94515),l=n(63418);t.GenericItem=class{constructor(e){this.payload=e,this.duplicateOf=e.duplicate_of,this.createdAtString=this.created_at&&(0,r.dateToLocalizedString)(this.created_at),this.userModifiedDate=this.serverUpdatedAt||new Date,this.updatedAtString=(0,r.dateToLocalizedString)(this.userModifiedDate),setTimeout((()=>{(0,r.deepFreeze)(this)}),0)}get uuid(){return this.payload.uuid}get content_type(){return this.payload.content_type}get created_at(){return this.payload.created_at}get key_system_identifier(){return this.payload.key_system_identifier}get user_uuid(){return this.payload.user_uuid}get shared_vault_uuid(){return this.payload.shared_vault_uuid}get last_edited_by_uuid(){return this.payload.last_edited_by_uuid}get signatureData(){return this.payload.signatureData}get serverUpdatedAt(){return this.payload.serverUpdatedAt}get serverUpdatedAtTimestamp(){return this.payload.updated_at_timestamp}get updated_at(){return this.serverUpdatedAt}get dirty(){return this.payload.dirty}get lastSyncBegan(){return this.payload.lastSyncBegan}get lastSyncEnd(){return this.payload.lastSyncEnd}get duplicate_of(){return this.payload.duplicate_of}payloadRepresentation(e){return this.payload.copy(e)}get neverSynced(){return!this.serverUpdatedAt||0===this.serverUpdatedAt.getTime()}get isSingleton(){return!1}singletonPredicate(){throw"Must override SNItem.singletonPredicate"}get singletonStrategy(){return a.SingletonStrategy.KeepEarliest}strategyWhenConflictingWithItem(e,t){if((0,l.isEncryptedErroredItem)(this))return s.ConflictStrategy.KeepBaseDuplicateApply;if(this.isSingleton)return s.ConflictStrategy.KeepBase;if((0,l.isDeletedItem)(this))return s.ConflictStrategy.KeepApply;if((0,l.isDeletedItem)(e))return this.payload.source===o.PayloadSource.FileImport?s.ConflictStrategy.KeepBase:s.ConflictStrategy.KeepApply;if(!(0,l.isDecryptedItem)(e)||!(0,l.isDecryptedItem)(this))return s.ConflictStrategy.KeepBaseDuplicateApply;if(!(0,i.ItemContentsDiffer)(this,e))return s.ConflictStrategy.KeepApply;if((0,i.ItemContentsDiffer)(this,e,["references"])){if(t&&!(0,i.ItemContentsDiffer)(t.itemFromPayload(),e))return s.ConflictStrategy.KeepBase;const n=2e4;return e.payload.source===o.PayloadSource.FileImport||Date.now()-this.userModifiedDate.getTime()<n?s.ConflictStrategy.KeepBaseDuplicateApply:s.ConflictStrategy.DuplicateBaseKeepApply}return s.ConflictStrategy.KeepBaseMergeRefs}satisfiesPredicate(e){return e.matchesItem(this)}}},81667:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},91251:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},89169:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},12421:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},63418:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isEncryptedErroredItem=t.isDecryptedOrDeletedItem=t.isDeletedItem=t.isNotEncryptedItem=t.isEncryptedItem=t.isDecryptedItem=void 0;const r=n(13566);function i(e){return"payload"in e&&(0,r.isDecryptedPayload)(e.payload)}function o(e){return(0,r.isEncryptedPayload)(e.payload)}function s(e){return(0,r.isDeletedPayload)(e.payload)}t.isDecryptedItem=i,t.isEncryptedItem=o,t.isNotEncryptedItem=function(e){return!o(e)},t.isDeletedItem=s,t.isDecryptedOrDeletedItem=function(e){return i(e)||s(e)},t.isEncryptedErroredItem=function(e){return o(e)&&!0===e.errorDecrypting}},589:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},14584:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DecryptedItemMutator=void 0;const r=n(87901),i=n(4250),o=n(68716),s=n(71458),a=n(56634),l=n(13743);class c extends a.ItemMutator{constructor(e,t){super(e,t);const n=(0,r.Copy)(this.immutablePayload.content);this.mutableContent=n}getResult(){return this.type===i.MutationType.NonDirtying?this.immutablePayload.copy({content:this.mutableContent}):(this.type===i.MutationType.UpdateUserTimestamps?this.userModifiedDate=new Date:this.immutableItem.userModifiedDate||(this.userModifiedDate=new Date(this.immutableItem.serverUpdatedAt)),this.immutablePayload.copy({content:this.mutableContent,dirty:!0,dirtyIndex:(0,l.getIncrementedDirtyIndex)(),signatureData:void 0,last_edited_by_uuid:void 0}))}setBeginSync(e,t){this.immutablePayload=this.immutablePayload.copy({content:this.mutableContent,lastSyncBegan:e,globalDirtyIndexAtLastSync:t})}setCustomContent(e){this.mutableContent=(0,r.Copy)(e)}set userModifiedDate(e){this.setAppDataItem(o.AppDataField.UserModifiedDate,e)}set conflictOf(e){this.mutableContent.conflict_of=e}set protected(e){this.mutableContent.protected=e}set trashed(e){this.mutableContent.trashed=e}set starred(e){this.mutableContent.starred=e}set pinned(e){this.setAppDataItem(o.AppDataField.Pinned,e)}set archived(e){this.setAppDataItem(o.AppDataField.Archived,e)}set locked(e){this.setAppDataItem(o.AppDataField.Locked,e)}setDomainData(e,t){this.mutableContent.appData||(this.mutableContent.appData={[s.DefaultAppDomain]:{}}),this.mutableContent.appData[t]=e}setDomainDataKey(e,t,n){this.mutableContent.appData||(this.mutableContent.appData={[s.DefaultAppDomain]:{}}),this.mutableContent.appData[n]||(this.mutableContent.appData[n]={}),this.mutableContent.appData[n][e]=t}setAppDataItem(e,t){this.setDomainDataKey(e,t,s.DefaultAppDomain)}e2ePendingRefactor_addItemAsRelationship(e){const t=this.mutableContent.references||[];t.find((t=>t.uuid===e.uuid))||t.push({uuid:e.uuid,content_type:e.content_type}),this.mutableContent.references=t}removeItemAsRelationship(e){let t=this.mutableContent.references||[];t=t.filter((t=>t.uuid!==e.uuid)),this.mutableContent.references=t}}t.DecryptedItemMutator=c},94220:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DeleteItemMutator=void 0;const r=n(452),i=n(56634),o=n(4250),s=n(13743);class a extends i.ItemMutator{getDeletedResult(){const e=this.type!==o.MutationType.NonDirtying;return new r.DeletedPayload(Object.assign(Object.assign({},this.immutablePayload.ejected()),{deleted:!0,content:void 0,dirty:!!e||this.immutablePayload.dirty,dirtyIndex:e?(0,s.getIncrementedDirtyIndex)():this.immutablePayload.dirtyIndex}),this.immutablePayload.source)}getResult(){throw Error("Must use getDeletedResult")}}t.DeleteItemMutator=a},56634:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ItemMutator=void 0;const r=n(4250),i=n(13743),o=n(21662);t.ItemMutator=class{constructor(e,t){this.immutableItem=e,this.type=t,this.immutablePayload=e.payload}getUuid(){return this.immutablePayload.uuid}getItem(){return this.immutableItem}getResult(){return this.type===r.MutationType.NonDirtying?this.immutablePayload.copy():this.immutablePayload.copy({dirty:!0,dirtyIndex:(0,i.getIncrementedDirtyIndex)()})}setBeginSync(e,t){this.immutablePayload=this.immutablePayload.copy({lastSyncBegan:e,globalDirtyIndexAtLastSync:t})}set key_system_identifier(e){if((0,o.ContentTypeUsesRootKeyEncryption)(this.immutableItem.content_type))throw new Error("Cannot set key_system_identifier on a root key encrypted item");this.immutablePayload=this.immutablePayload.copy({key_system_identifier:e})}set shared_vault_uuid(e){if((0,o.ContentTypeUsesRootKeyEncryption)(this.immutableItem.content_type))throw new Error("Cannot set shared_vault_uuid on a root key encrypted item");this.immutablePayload=this.immutablePayload.copy({shared_vault_uuid:e})}set errorDecrypting(e){throw Error("This method is no longer implemented")}set updated_at(e){throw Error("This method is no longer implemented")}set updated_at_timestamp(e){throw Error("This method is no longer implemented")}}},8898:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},68716:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.AppDataField=void 0,function(e){e.Pinned="pinned",e.Archived="archived",e.Locked="locked",e.UserModifiedDate="client_updated_at",e.DefaultEditor="defaultEditor",e.MobileRules="mobileRules",e.NotAvailableOnMobile="notAvailableOnMobile",e.MobileActive="mobileActive",e.LastSize="lastSize",e.LegacyPrefersPlainEditor="prefersPlainEditor",e.ComponentInstallError="installError"}(n||(t.AppDataField=n={}))},43610:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ConflictStrategy=void 0,function(e){e[e.KeepBase=1]="KeepBase",e[e.KeepApply=2]="KeepApply",e[e.KeepBaseDuplicateApply=3]="KeepBaseDuplicateApply",e[e.DuplicateBaseKeepApply=4]="DuplicateBaseKeepApply",e[e.KeepBaseMergeRefs=5]="KeepBaseMergeRefs"}(n||(t.ConflictStrategy=n={}))},71458:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentDataDomain=t.DefaultAppDomain=void 0,t.DefaultAppDomain="org.standardnotes.sn",t.ComponentDataDomain="org.standardnotes.sn.components"},15579:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},91298:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4250:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MutationType=void 0,function(e){e[e.UpdateUserTimestamps=1]="UpdateUserTimestamps",e[e.NoUpdateUserTimestamps=2]="NoUpdateUserTimestamps",e[e.NonDirtying=3]="NonDirtying"}(n||(t.MutationType=n={}))},94515:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SingletonStrategy=void 0,function(e){e[e.KeepEarliest=1]="KeepEarliest"}(n||(t.SingletonStrategy=n={}))},50292:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(89661),t),i(n(78961),t),i(n(2445),t),i(n(64236),t),i(n(4744),t),i(n(27542),t),i(n(96933),t),i(n(77533),t),i(n(80421),t),i(n(43740),t),i(n(43740),t),i(n(78438),t),i(n(80406),t),i(n(97127),t),i(n(81667),t),i(n(91251),t),i(n(89169),t),i(n(12421),t),i(n(63418),t),i(n(589),t),i(n(14584),t),i(n(94220),t),i(n(56634),t),i(n(8898),t),i(n(68716),t),i(n(43610),t),i(n(71458),t),i(n(15579),t),i(n(91298),t),i(n(4250),t),i(n(94515),t)},89262:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DecryptedPayload=void 0;const r=n(87901),i=n(42405),o=n(89223),s=n(33264);class a extends s.PurePayload{constructor(e){super(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.PayloadSource.Constructor),this.content=(0,r.Copy)((0,i.FillItemContent)(e.content)),this.deleted=!1}get references(){return this.content.references||[]}getReference(e){const t=this.references.find((t=>t.uuid===e));if(!t)throw new Error("Reference not found");return t}ejected(){return Object.assign(Object.assign({},super.ejected()),{content:this.content,deleted:this.deleted})}copy(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.source;return new a(Object.assign(Object.assign({},this.ejected()),e),t)}copyAsSyncResolved(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.source;return new a(Object.assign(Object.assign({},this.ejected()),e),t)}}t.DecryptedPayload=a},452:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DeletedPayload=void 0;const r=n(89223),i=n(33264);class o extends i.PurePayload{constructor(e){super(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.PayloadSource.Constructor),this.deleted=!0,this.content=void 0}get discardable(){return!this.dirty}ejected(){return Object.assign(Object.assign({},super.ejected()),{deleted:this.deleted,content:void 0})}copy(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.source;return new o(Object.assign(Object.assign({},this.ejected()),e),t)}copyAsSyncResolved(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.source;return new o(Object.assign(Object.assign({},this.ejected()),e),t)}}t.DeletedPayload=o},86731:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EncryptedPayload=void 0;const r=n(80910),i=n(89223),o=n(33264);class s extends o.PurePayload{constructor(e){super(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.PayloadSource.Constructor);const t=(0,r.ProtocolVersionFromEncryptedString)(e.content);if(t.isFailed())throw new Error("EncryptedPayload constructor versionResult is failed");this.auth_hash=e.auth_hash,this.content=e.content,this.deleted=!1,this.enc_item_key=e.enc_item_key,this.errorDecrypting=e.errorDecrypting,this.items_key_id=e.items_key_id,this.version=t.getValue(),this.waitingForKey=e.waitingForKey}ejected(){return Object.assign(Object.assign({},super.ejected()),{enc_item_key:this.enc_item_key,items_key_id:this.items_key_id,auth_hash:this.auth_hash,errorDecrypting:this.errorDecrypting,waitingForKey:this.waitingForKey,content:this.content,deleted:this.deleted})}copy(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.source;return new s(Object.assign(Object.assign({},this.ejected()),e),t)}copyAsSyncResolved(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.source;return new s(Object.assign(Object.assign({},this.ejected()),e),t)}}t.EncryptedPayload=s},33264:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PurePayload=void 0;const r=n(87901),i=n(89223),o=n(21662);t.PurePayload=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.PayloadSource.Constructor;var n,s,a,l;if(!e.uuid)throw Error("Attempting to construct payload with null uuid\n        Content type: ".concat(e.content_type));if(e.key_system_identifier&&(0,o.ContentTypeUsesRootKeyEncryption)(e.content_type))throw new Error("Rootkey-encrypted payload should not have a key system identifier");this.source=t,this.uuid=e.uuid,this.content=e.content,this.content_type=e.content_type,this.deleted=(0,r.useBoolean)(e.deleted,!1),this.dirty=e.dirty,this.duplicate_of=e.duplicate_of,this.updated_at=new Date(e.updated_at||0),this.updated_at_timestamp=e.updated_at_timestamp||0,this.updated_at_timestamp<0&&(this.updated_at_timestamp=0,this.updated_at=new Date(0)),this.created_at=new Date(e.created_at||new Date),this.created_at_timestamp=e.created_at_timestamp||0,this.created_at_timestamp<0&&(this.created_at_timestamp=this.updated_at_timestamp,this.created_at=this.updated_at),this.lastSyncBegan=e.lastSyncBegan?new Date(e.lastSyncBegan):void 0,this.lastSyncEnd=e.lastSyncEnd?new Date(e.lastSyncEnd):void 0,this.dirtyIndex=e.dirtyIndex,this.globalDirtyIndexAtLastSync=e.globalDirtyIndexAtLastSync,this.user_uuid=null!==(n=e.user_uuid)&&void 0!==n?n:void 0,this.key_system_identifier=null!==(s=e.key_system_identifier)&&void 0!==s?s:void 0,this.shared_vault_uuid=null!==(a=e.shared_vault_uuid)&&void 0!==a?a:void 0,this.last_edited_by_uuid=null!==(l=e.last_edited_by_uuid)&&void 0!==l?l:void 0,this.signatureData=e.signatureData,setTimeout((()=>{(0,r.deepFreeze)(this)}),0)}ejected(){return{uuid:this.uuid,content:this.content,deleted:this.deleted,content_type:this.content_type,created_at:this.created_at,updated_at:this.updated_at,created_at_timestamp:this.created_at_timestamp,updated_at_timestamp:this.updated_at_timestamp,dirty:this.dirty,duplicate_of:this.duplicate_of,dirtyIndex:this.dirtyIndex,globalDirtyIndexAtLastSync:this.globalDirtyIndexAtLastSync,lastSyncBegan:this.lastSyncBegan,lastSyncEnd:this.lastSyncEnd,key_system_identifier:this.key_system_identifier,user_uuid:this.user_uuid,shared_vault_uuid:this.shared_vault_uuid,last_edited_by_uuid:this.last_edited_by_uuid,signatureData:this.signatureData}}get serverUpdatedAt(){return this.updated_at}get serverUpdatedAtTimestamp(){return this.updated_at_timestamp}}},83732:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},75310:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},3008:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},59296:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},13566:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isErrorDecryptingPayload=t.isDeletedPayload=t.isEncryptedPayload=t.isDecryptedPayload=void 0;const r=n(78381);t.isDecryptedPayload=function(e){return(0,r.isDecryptedTransferPayload)(e)},t.isEncryptedPayload=function(e){return(0,r.isEncryptedTransferPayload)(e)},t.isDeletedPayload=function(e){return(0,r.isDeletedTransferPayload)(e)},t.isErrorDecryptingPayload=function(e){return(0,r.isErrorDecryptingTransferPayload)(e)}},92238:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},55340:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadTimestampDefaults=void 0,t.PayloadTimestampDefaults=function(){return{updated_at:new Date(0),created_at:new Date,updated_at_timestamp:0,created_at_timestamp:0}}},21989:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadVaultOverrides=void 0,t.PayloadVaultOverrides=function(e){return e?{key_system_identifier:e.systemIdentifier,shared_vault_uuid:e.isSharedVaultListing()?e.sharing.sharedVaultUuid:void 0}:{}}},62935:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.isPayloadSourceRetrieved=t.isPayloadSourceInternalChange=t.PayloadEmitSource=void 0,function(e){e[e.InitialObserverRegistrationPush=1]="InitialObserverRegistrationPush",e[e.LocalChanged=2]="LocalChanged",e[e.LocalInserted=3]="LocalInserted",e[e.LocalDatabaseLoaded=4]="LocalDatabaseLoaded",e[e.OfflineSyncSaved=5]="OfflineSyncSaved",e[e.LocalRetrieved=6]="LocalRetrieved",e[e.FileImport=7]="FileImport",e[e.ComponentRetrieved=8]="ComponentRetrieved",e[e.ComponentCreated=9]="ComponentCreated",e[e.PreSyncSave=10]="PreSyncSave",e[e.RemoteRetrieved=11]="RemoteRetrieved",e[e.RemoteSaved=12]="RemoteSaved",e[e.DesktopComponentSync=13]="DesktopComponentSync"}(n||(t.PayloadEmitSource=n={})),t.isPayloadSourceInternalChange=function(e){return[n.RemoteSaved,n.PreSyncSave].includes(e)},t.isPayloadSourceRetrieved=function(e){return[n.RemoteRetrieved,n.ComponentRetrieved].includes(e)}},89223:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadSource=void 0,function(e){e[e.Constructor=1]="Constructor",e[e.LocalDatabaseLoaded=2]="LocalDatabaseLoaded",e[e.RemoteRetrieved=3]="RemoteRetrieved",e[e.RemoteSaved=4]="RemoteSaved",e[e.FileImport=5]="FileImport"}(n||(t.PayloadSource=n={}))},59180:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(33264),t),i(n(89262),t),i(n(86731),t),i(n(452),t),i(n(83732),t),i(n(75310),t),i(n(3008),t),i(n(59296),t),i(n(13566),t),i(n(92238),t),i(n(89223),t),i(n(62935),t),i(n(55340),t),i(n(21989),t)},89661:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},2445:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},78961:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ContentReferenceType=void 0,function(e){e.TagToParentTag="TagToParentTag",e.TagToFile="TagToFile",e.FileToNote="FileToNote",e.FileToFile="FileToFile",e.NoteToNote="NoteToNote"}(n||(t.ContentReferenceType=n={}))},64236:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4744:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isTagToParentTagReference=t.isLegacyTagToNoteReference=t.isReference=t.isLegacyAnonymousReference=void 0;const r=n(82648),i=n(78961);t.isLegacyAnonymousReference=e=>void 0===e.reference_type,t.isReference=e=>void 0!==e.reference_type,t.isLegacyTagToNoteReference=(e,t)=>{const n=e.content_type===r.ContentType.TYPES.Note,i=t.content_type===r.ContentType.TYPES.Tag;return n&&i},t.isTagToParentTagReference=e=>(0,t.isReference)(e)&&e.reference_type===i.ContentReferenceType.TagToParentTag},27542:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},96933:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},77533:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},80421:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},69421:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},57978:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},95520:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7834:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},49762:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isCorruptTransferPayload=t.isDeletedTransferPayload=t.isErrorDecryptingTransferPayload=t.isEncryptedTransferPayload=t.isDecryptedTransferPayload=void 0;const r=n(82648),i=n(87901);function o(e){return"content"in e&&(0,i.isString)(e.content)}t.isDecryptedTransferPayload=function(e){return(0,i.isObject)(e.content)},t.isEncryptedTransferPayload=o,t.isErrorDecryptingTransferPayload=function(e){return o(e)&&!0===e.errorDecrypting},t.isDeletedTransferPayload=function(e){return"deleted"in e&&!0===e.deleted},t.isCorruptTransferPayload=function(e){const t=!0===e.deleted&&null!=e.content,n=r.ContentType.create(e.content_type);return null==e.uuid||t||n.isFailed()}},78381:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(69421),t),i(n(57978),t),i(n(95520),t),i(n(7834),t),i(n(49762),t)},21907:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},66675:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.InvitationStatus=void 0,function(e){e.Sent="sent",e.Canceled="canceled",e.Accepted="accepted",e.Declined="declined"}(n||(t.InvitationStatus=n={}))},90656:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.InviteeIdentifierType=void 0,function(e){e.Email="email",e.Hash="hash",e.Uuid="uuid"}(n||(t.InviteeIdentifierType=n={}))},93715:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.InviterIdentifierType=void 0,function(e){e.Email="email",e.Uuid="uuid"}(n||(t.InviterIdentifierType=n={}))},84457:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Environment=void 0,function(e){e[e.Web=1]="Web",e[e.Desktop=2]="Desktop",e[e.Mobile=3]="Mobile",e[e.Clipper=4]="Clipper"}(n||(t.Environment=n={}))},656:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Platform=void 0,function(e){e[e.Ios=1]="Ios",e[e.Android=2]="Android",e[e.MacWeb=3]="MacWeb",e[e.MacDesktop=4]="MacDesktop",e[e.WindowsWeb=5]="WindowsWeb",e[e.WindowsDesktop=6]="WindowsDesktop",e[e.LinuxWeb=7]="LinuxWeb",e[e.LinuxDesktop=8]="LinuxDesktop"}(n||(t.Platform=n={}))},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},62846:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.KeySystemPasswordType=void 0,function(e){e.UserInputted="user_inputted",e.Randomized="randomized"}(n||(t.KeySystemPasswordType=n={}))},29899:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},22296:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},52174:(e,t)=>{var n;function r(e,t){return Number(e)-Number(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.isVersionLessThanOrEqualTo=t.leftVersionGreaterThanOrEqualToRight=t.compareVersions=t.ProtocolVersionLength=t.isProtocolVersionExpired=t.ProtocolExpirationDates=t.ProtocolVersionLastNonrootItemsKey=t.ProtocolVersionLatest=t.ProtocolVersion=void 0,function(e){e.V001="001",e.V002="002",e.V003="003",e.V004="004"}(n||(t.ProtocolVersion=n={})),t.ProtocolVersionLatest=n.V004,t.ProtocolVersionLastNonrootItemsKey=n.V003,t.ProtocolExpirationDates=Object.freeze({[n.V001]:Date.parse("2018-01-01"),[n.V002]:Date.parse("2020-01-01")}),t.isProtocolVersionExpired=function(e){const n=t.ProtocolExpirationDates[e];return!!n&&(new Date).getTime()>n},t.ProtocolVersionLength=3,t.compareVersions=r,t.leftVersionGreaterThanOrEqualToRight=function(e,t){return r(e,t)>=0},t.isVersionLessThanOrEqualTo=function(e,t){return r(e,t)<=0}},80910:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolVersionFromEncryptedString=void 0;const r=n(82648),i=n(52174);t.ProtocolVersionFromEncryptedString=function(e){try{const t=e.substring(0,i.ProtocolVersionLength);if(Object.values(i.ProtocolVersion).includes(t))return r.Result.ok(t)}catch(e){return r.Result.fail(JSON.stringify(e))}return r.Result.fail("Invalid encrypted string ".concat(e))}},87192:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},71109:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},32099:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},55430:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},33738:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},64130:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.AsymmetricMessagePayloadType=void 0,function(e){e.ContactShare="contact-share",e.SharedVaultRootKeyChanged="shared-vault-root-key-changed",e.SenderKeypairChanged="sender-keypair-changed",e.SharedVaultMetadataChanged="shared-vault-metadata-changed",e.SharedVaultInvite="shared-vault-invite"}(n||(t.AsymmetricMessagePayloadType=n={}))},18018:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},14770:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},45698:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},63070:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},32151:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},71165:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Collection=void 0;const r=n(87901),i=n(84213);t.Collection=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;this.map={},this.typedMap={},this.dirtyIndex=new Set,this.nondeletedIndex=new Set,this.invalidsIndex=new Set,this.isDecryptedElement=e=>(0,r.isObject)(e.content),this.isEncryptedElement=e=>"content"in e&&(0,r.isString)(e.content),this.isErrorDecryptingElement=e=>this.isEncryptedElement(e),this.isDeletedElement=e=>"deleted"in e&&!0===e.deleted,this.isNonDeletedElement=e=>!this.isDeletedElement(e),e?(this.map=t,this.typedMap=n,this.referenceMap=i,this.conflictMap=o):(this.referenceMap=new r.UuidMap,this.conflictMap=new r.UuidMap)}uuids(){return Object.keys(this.map)}all(e){var t;if(e){if(Array.isArray(e)){const t=[];for(const n of e)(0,r.extendArray)(t,this.typedMap[n]||[]);return t}return(null===(t=this.typedMap[e])||void 0===t?void 0:t.slice())||[]}return Object.keys(this.map).map((e=>this.map[e]))}nondeletedElements(){const e=Array.from(this.nondeletedIndex);return this.findAll(e).filter(this.isNonDeletedElement)}invalidElements(){const e=Array.from(this.invalidsIndex);return this.findAll(e)}dirtyElements(){const e=Array.from(this.dirtyIndex);return this.findAll(e)}findAll(e){const t=[];for(const n of e){const e=this.map[n];e&&t.push(e)}return t}find(e){return this.map[e]}has(e){return null!=this.find(e)}findAllIncludingBlanks(e){const t=[];for(const n of e){const e=this.map[n];t.push(e)}return t}set(e){if(0!==(e=Array.isArray(e)?e:[e]).length)for(const t of e){if(this.map[t.uuid]=t,this.setToTypedMap(t),this.isErrorDecryptingElement(t)?this.invalidsIndex.add(t.uuid):this.invalidsIndex.delete(t.uuid),this.isDecryptedElement(t)){const e=t.content.conflict_of;e&&!t.content.trashed&&this.conflictMap.establishRelationship(e,t.uuid);const n=e&&t.content.trashed,r=!e&&this.conflictMap.getInverseRelationships(t.uuid).length>0,i=this.conflictMap.existsInDirectMap(t.uuid)&&0===this.conflictMap.getDirectRelationships(t.uuid).length;(r||i||n)&&this.conflictMap.removeFromMap(t.uuid),this.referenceMap.setAllRelationships(t.uuid,t.references.map((e=>e.uuid)))}t.dirty?this.dirtyIndex.add(t.uuid):this.dirtyIndex.delete(t.uuid),t.deleted?(this.nondeletedIndex.delete(t.uuid),(this.conflictMap.existsInDirectMap(t.uuid)||this.conflictMap.existsInInverseMap(t.uuid))&&this.conflictMap.removeFromMap(t.uuid)):this.nondeletedIndex.add(t.uuid)}else console.warn("Attempting to set 0 elements onto collection")}discard(e){e=Array.isArray(e)?e:[e];for(const t of e)this.deleteFromTypedMap(t),delete this.map[t.uuid],this.conflictMap.removeFromMap(t.uuid),this.referenceMap.removeFromMap(t.uuid)}uuidReferencesForUuid(e){return this.referenceMap.getDirectRelationships(e)}uuidsThatReferenceUuid(e){return this.referenceMap.getInverseRelationships(e)}referencesForElement(e){const t=this.referenceMap.getDirectRelationships(e.uuid);return this.findAll(t)}conflictsOf(e){const t=this.conflictMap.getDirectRelationships(e);return this.findAll(t)}elementsReferencingElement(e,t){const n=this.uuidsThatReferenceUuid(e.uuid),r=this.findAll(n);return t?r.filter((e=>e.content_type===t)):r}setToTypedMap(e){const t=this.typedMap[e.content_type]||[];(0,i.remove)(t,{uuid:e.uuid}),t.push(e),this.typedMap[e.content_type]=t}deleteFromTypedMap(e){const t=this.typedMap[e.content_type]||[];(0,i.remove)(t,{uuid:e.uuid}),this.typedMap[e.content_type]=t}uuidsOfItemsWithConflicts(){return this.conflictMap.getAllDirectKeys()}}},92207:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CollectionSort=void 0,t.CollectionSort={CreatedAt:"created_at",UpdatedAt:"userModifiedDate",Title:"title"}},36883:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ItemCollection=void 0;const r=n(63418),i=n(71165);class o extends i.Collection{onChange(e){const t=e.changed.concat(e.inserted);t.length>0&&this.set(t),this.discard(e.discarded)}findDecrypted(e){const t=this.find(e);if(t)return(0,r.isDecryptedItem)(t)?t:void 0}findAllDecrypted(e){return this.findAll(e).filter(r.isDecryptedItem)}findAllDecryptedWithBlanks(e){return this.findAllIncludingBlanks(e).map((e=>{if(null==e||(0,r.isDecryptedItem)(e))return e}))}allDecrypted(e){return this.all(e).filter(r.isDecryptedItem)}}t.ItemCollection=o},17441:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ItemCounter=void 0;const r=n(87901),i=n(4862),o=n(50292),s=n(45408),a=n(19688),l=n(52197),c=n(59017),u=n(79256),d=n(41574),h=n(82648);t.ItemCounter=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.collection=e,this.observers=t,this.tagToItemsMap={},this.allCountableItems=new Set,this.countableItemsByType=new Map,this.isItemCountable=e=>!!(0,o.isDecryptedItem)(e)&&this.passesAllFilters(e)&&!e.archived&&!e.trashed&&!e.conflictOf}addCountChangeObserver(e){this.observers.push(e);const t=this.observers;return()=>{(0,r.removeFromArray)(t,e)}}setDisplayOptions(e){this.displayOptions=e,this.receiveItemChanges(this.collection.all())}setVaultDisplayOptions(e){this.vaultDisplayOptions=e,this.receiveItemChanges(this.collection.all())}allCountableItemsCount(){return this.allCountableItems.size}allCountableNotesCount(){var e;return(null===(e=this.countableItemsByType.get(h.ContentType.TYPES.Note))||void 0===e?void 0:e.size)||0}allCountableFilesCount(){var e;return(null===(e=this.countableItemsByType.get(h.ContentType.TYPES.File))||void 0===e?void 0:e.size)||0}countableItemsForTag(e){var t;return(null===(t=this.tagToItemsMap[e.uuid])||void 0===t?void 0:t.size)||0}onChange(e){const t=[...e.changed,...e.inserted,...e.discarded].filter((e=>e.content_type===h.ContentType.TYPES.Note||e.content_type===h.ContentType.TYPES.File)),n=[...e.changed,...e.inserted].filter(o.isDecryptedItem).filter(i.isTag);this.receiveItemChanges(t),this.receiveTagChanges(n)}passesAllFilters(e){if(!this.displayOptions)return!0;const t=[new s.CollectionCriteriaValidator(this.collection,e)];if(this.vaultDisplayOptions){const n=this.vaultDisplayOptions.getOptions();(0,d.isExclusionaryOptionsValue)(n)?t.push(new a.ExcludeVaultsCriteriaValidator([...n.exclude,...n.locked],e)):t.push(new l.ExclusiveVaultCriteriaValidator(n.exclusive,e))}return"hiddenContentTypes"in this.displayOptions&&this.displayOptions.hiddenContentTypes&&t.push(new c.HiddenContentCriteriaValidator(this.displayOptions.hiddenContentTypes,e)),"customFilter"in this.displayOptions&&this.displayOptions.customFilter&&t.push(new u.CustomFilterCriteriaValidator(this.displayOptions.customFilter,e)),t.every((e=>e.passes()))}notifyObservers(e){for(const t of this.observers)t(e)}receiveTagChanges(e){for(const t of e){const e=t.references.filter((e=>e.content_type===h.ContentType.TYPES.Note||e.content_type===h.ContentType.TYPES.File)).map((e=>e.uuid)).filter((e=>this.allCountableItems.has(e))),n=this.tagToItemsMap[t.uuid];this.tagToItemsMap[t.uuid]=new Set(e),(null==n?void 0:n.size)!==e.length&&this.notifyObservers(t.uuid)}}receiveItemChanges(e){var t,n;const r=this.allCountableItems.size;for(const r of e){const e=this.isItemCountable(r);e?(this.allCountableItems.add(r.uuid),this.countableItemsByType.has(r.content_type)||this.countableItemsByType.set(r.content_type,new Set),null===(t=this.countableItemsByType.get(r.content_type))||void 0===t||t.add(r.uuid)):(this.allCountableItems.delete(r.uuid),null===(n=this.countableItemsByType.get(r.content_type))||void 0===n||n.delete(r.uuid));const i=this.collection.uuidsThatReferenceUuid(r.uuid);for(const t of i){const n=this.setForTag(t),i=n.size;e?n.add(r.uuid):n.delete(r.uuid),i!==n.size&&this.notifyObservers(t)}}r!==this.allCountableItems.size&&this.notifyObservers(void 0)}setForTag(e){let t=this.tagToItemsMap[e];return t||(t=new Set,this.tagToItemsMap[e]=t),t}}},51833:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ImmutablePayloadCollection=void 0;const r=n(19759);class i extends r.PayloadCollection{get payloads(){return this.all()}static WithPayloads(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=new i;return e.length>0&&t.set(e),Object.freeze(t),t}static FromCollection(e){const t=Object.freeze(Object.assign({},e.map)),n=Object.freeze(Object.assign({},e.typedMap)),r=Object.freeze(e.referenceMap.makeCopy()),o=Object.freeze(e.conflictMap.makeCopy()),s=new i(!0,t,n,r,o);return Object.freeze(s),s}mutableCopy(){const e=Object.assign({},this.map),t=Object.assign({},this.typedMap),n=this.referenceMap.makeCopy(),i=this.conflictMap.makeCopy();return new r.PayloadCollection(!0,e,t,n,i)}}t.ImmutablePayloadCollection=i},19759:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadCollection=void 0;const r=n(71165);class i extends r.Collection{integrityPayloads(){return this.nondeletedElements().map((e=>({uuid:e.uuid,updated_at_timestamp:e.serverUpdatedAtTimestamp})))}}t.PayloadCollection=i},9611:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendSyncDelta=void 0;const r=n(87901);t.extendSyncDelta=function(e,t){(0,r.extendArray)(e.emits,t.emits),t.ignored&&(e.ignored||(e.ignored=[]),(0,r.extendArray)(e.ignored,t.ignored))}},38067:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ConflictDelta=void 0;const r=n(87901),i=n(82648),o=n(73277),s=n(97873),a=n(43610),l=n(27446),c=n(37807),u=n(13566),d=n(38656),h=n(13743);t.ConflictDelta=class{constructor(e,t,n,r){this.baseCollection=e,this.basePayload=t,this.applyPayload=n,this.historyMap=r}result(){if(this.applyPayload.content_type===i.ContentType.TYPES.ItemsKey)return new d.ItemsKeyDelta(this.baseCollection,[this.applyPayload]).result();const e=this.getConflictStrategy();return{emits:this.handleStrategy(e),ignored:[]}}getConflictStrategy(){const e=(0,u.isErrorDecryptingPayload)(this.basePayload),t=(0,u.isErrorDecryptingPayload)(this.applyPayload);if(e||t){if(e&&!t)return a.ConflictStrategy.KeepBaseDuplicateApply;if(!e&&t)return a.ConflictStrategy.DuplicateBaseKeepApply;if(e&&t)return a.ConflictStrategy.KeepApply}else{if((0,u.isDecryptedPayload)(this.basePayload)){const e=this.baseCollection.conflictsOf(this.applyPayload.uuid)[0];if(e&&(0,u.isDecryptedPayload)(e)&&(0,u.isDecryptedPayload)(this.applyPayload)&&(0,c.PayloadContentsEqual)(e,this.applyPayload))return a.ConflictStrategy.KeepBase;{const e=(0,o.CreateDecryptedItemFromPayload)(this.basePayload),t=(0,o.CreateItemFromPayload)(this.applyPayload),n=this.historyMap[this.basePayload.uuid]||[],r=s.historyMapFunctions.getNewestRevision(n);return e.strategyWhenConflictingWithItem(t,r)}}if((0,u.isDeletedPayload)(this.basePayload)||(0,u.isDeletedPayload)(this.applyPayload))return(0,u.isDeletedPayload)(this.basePayload),(0,u.isDeletedPayload)(this.applyPayload),a.ConflictStrategy.KeepApply}throw Error("Unhandled strategy in Conflict Delta getConflictStrategy")}handleStrategy(e){if(e===a.ConflictStrategy.KeepBase)return this.handleKeepBaseStrategy();if(e===a.ConflictStrategy.KeepApply)return this.handleKeepApplyStrategy();if(e===a.ConflictStrategy.KeepBaseDuplicateApply)return this.handleKeepBaseDuplicateApplyStrategy();if(e===a.ConflictStrategy.DuplicateBaseKeepApply)return this.handleDuplicateBaseKeepApply();if(e===a.ConflictStrategy.KeepBaseMergeRefs)return this.handleKeepBaseMergeRefsStrategy();throw Error("Unhandled strategy in conflict delta payloadsByHandlingStrategy")}handleKeepBaseStrategy(){const e=this.applyPayload.serverUpdatedAt,t=this.applyPayload.updated_at_timestamp;return[this.basePayload.copyAsSyncResolved({updated_at:e,updated_at_timestamp:t,dirtyIndex:(0,h.getIncrementedDirtyIndex)(),dirty:!0,lastSyncEnd:new Date},this.applyPayload.source)]}handleKeepApplyStrategy(){return[this.applyPayload.copyAsSyncResolved({lastSyncBegan:this.basePayload.lastSyncBegan,lastSyncEnd:new Date,dirty:!1},this.applyPayload.source)]}handleKeepBaseDuplicateApplyStrategy(){const e=this.applyPayload.serverUpdatedAt,t=this.applyPayload.updated_at_timestamp,n=this.basePayload.copyAsSyncResolved({updated_at:e,updated_at_timestamp:t,dirty:!0,dirtyIndex:(0,h.getIncrementedDirtyIndex)(),lastSyncEnd:new Date},this.applyPayload.source),r=(0,l.PayloadsByDuplicating)({payload:this.applyPayload,baseCollection:this.baseCollection,isConflict:!0,source:this.applyPayload.source});return[n].concat(r)}handleDuplicateBaseKeepApply(){const e=(0,l.PayloadsByDuplicating)({payload:this.basePayload,baseCollection:this.baseCollection,isConflict:!0,source:this.applyPayload.source}),t=this.applyPayload.copyAsSyncResolved({lastSyncBegan:this.basePayload.lastSyncBegan,dirty:!1,lastSyncEnd:new Date},this.applyPayload.source);return e.concat([t])}handleKeepBaseMergeRefsStrategy(){if(!(0,u.isDecryptedPayload)(this.basePayload)||!(0,u.isDecryptedPayload)(this.applyPayload))return[];const e=(0,r.uniqCombineObjArrays)(this.basePayload.content.references,this.applyPayload.content.references,["uuid","content_type"]),t=this.applyPayload.serverUpdatedAt,n=this.applyPayload.updated_at_timestamp;return[this.basePayload.copyAsSyncResolved({updated_at:t,updated_at_timestamp:n,dirty:!0,dirtyIndex:(0,h.getIncrementedDirtyIndex)(),lastSyncEnd:new Date,content:Object.assign(Object.assign({},this.basePayload.content),{references:e})},this.applyPayload.source)]}}},33076:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaFileImport=void 0;const r=n(38067),i=n(59180),o=n(9611),s=n(13743);t.DeltaFileImport=class{constructor(e,t,n){this.baseCollection=e,this.applyPayloads=t,this.historyMap=n}result(){const e={emits:[],ignored:[],source:i.PayloadEmitSource.FileImport};for(const t of this.applyPayloads){const n=this.resolvePayload(t,e);(0,o.extendSyncDelta)(e,n)}return e}resolvePayload(e,t){let n=t.emits.find((t=>(0,i.isDecryptedPayload)(t)&&t.content.conflict_of===e.uuid));if(n||(n=t.emits.find((t=>t.uuid===e.uuid))),!n){const t=this.baseCollection.find(e.uuid);t&&(0,i.isDecryptedPayload)(t)&&(n=t)}return n?new r.ConflictDelta(this.baseCollection,n,e,this.historyMap).result():{emits:[e.copyAsSyncResolved({dirty:!0,dirtyIndex:(0,s.getIncrementedDirtyIndex)(),lastSyncEnd:new Date(0)})],ignored:[]}}}},38656:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ItemsKeyDelta=void 0;const r=n(59180),i=n(72990);t.ItemsKeyDelta=class{constructor(e,t){this.baseCollection=e,this.applyPayloads=t}result(){const e=[],t=[];for(const n of this.applyPayloads){const o=this.baseCollection.find(n.uuid);if(o)if((0,r.isEncryptedPayload)(n)&&(0,r.isDecryptedPayload)(o)){const r=o.copyAsSyncResolved({updated_at_timestamp:n.updated_at_timestamp,updated_at:n.updated_at,dirty:!1,lastSyncEnd:new Date});e.push(r),t.push(n)}else e.push((0,i.payloadByFinalizingSyncState)(n,this.baseCollection));else e.push((0,i.payloadByFinalizingSyncState)(n,this.baseCollection))}return{emits:e,ignored:t}}}},9910:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaOfflineSaved=void 0;const r=n(59180),i=n(72990);t.DeltaOfflineSaved=class{constructor(e,t){this.baseCollection=e,this.applyContextualPayloads=t}result(){const e=[];for(const t of this.applyContextualPayloads){const n=this.baseCollection.find(t.uuid);n&&e.push((0,i.payloadByFinalizingSyncState)(n,this.baseCollection))}return{emits:e,source:r.PayloadEmitSource.OfflineSyncSaved}}}},28504:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaOutOfSync=void 0;const r=n(59180),i=n(13566),o=n(37807),s=n(38067),a=n(82648),l=n(38656),c=n(72990),u=n(9611);t.DeltaOutOfSync=class{constructor(e,t,n){this.baseCollection=e,this.applyCollection=t,this.historyMap=n}result(){const e={emits:[],ignored:[],source:r.PayloadEmitSource.RemoteRetrieved};for(const t of this.applyCollection.all()){if(t.content_type===a.ContentType.TYPES.ItemsKey){const n=new l.ItemsKeyDelta(this.baseCollection,[t]).result();(0,u.extendSyncDelta)(e,n);continue}const n=this.baseCollection.find(t.uuid);if(!n){e.emits.push((0,c.payloadByFinalizingSyncState)(t,this.baseCollection));continue}const r=(0,i.isDecryptedPayload)(n),d=(0,i.isDecryptedPayload)(t);if(d!==r||d&&r&&!(0,o.PayloadContentsEqual)(t,n)){const r=new s.ConflictDelta(this.baseCollection,n,t,this.historyMap);(0,u.extendSyncDelta)(e,r.result())}else e.emits.push((0,c.payloadByFinalizingSyncState)(t,this.baseCollection))}return e}}},9579:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaRemoteDataConflicts=void 0;const r=n(38067),i=n(59180),o=n(9611),s=n(72990);t.DeltaRemoteDataConflicts=class{constructor(e,t,n){this.baseCollection=e,this.conflicts=t,this.historyMap=n}result(){const e={emits:[],ignored:[],source:i.PayloadEmitSource.RemoteRetrieved};for(const t of this.conflicts){const n=this.baseCollection.find(t.server_item.uuid);if(null==n){e.emits.push((0,s.payloadByFinalizingSyncState)(t.server_item,this.baseCollection));continue}const i=new r.ConflictDelta(this.baseCollection,n,t.server_item,this.historyMap);(0,o.extendSyncDelta)(e,i.result())}return e}}},34319:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaRemoteRejected=void 0;const r=n(89223),i=n(59180),o=n(84625),s=n(95658),a=n(27446),l=n(82648);t.DeltaRemoteRejected=class{constructor(e,t){this.baseCollection=e,this.conflicts=t}result(){const e=[],t=[s.ConflictType.SharedVaultInsufficientPermissionsError,s.ConflictType.SharedVaultNotMemberError,s.ConflictType.SharedVaultInvalidState,s.ConflictType.SharedVaultSnjsVersionError];for(const n of this.conflicts)t.includes(n.type)?e.push(...this.handleVaultError(n)):(0,s.conflictParamsHasServerItemAndUnsavedItem)(n)?e.push(...this.getResultForConflictWithServerItemAndUnsavedItem(n)):(0,s.conflictParamsHasOnlyServerItem)(n)?e.push(...this.getResultForConflictWithOnlyServerItem(n)):(0,s.conflictParamsHasOnlyUnsavedItem)(n)&&e.push(...this.getResultForConflictWithOnlyUnsavedItem(n));return{emits:e,source:i.PayloadEmitSource.RemoteSaved}}handleVaultError(e){const t=this.baseCollection.find(e.unsaved_item.uuid);return t?e.type===s.ConflictType.SharedVaultNotMemberError?this.resultByDuplicatingBasePayloadAsNonVaultedAndRemovingBaseItemLocally(t):t.content_type===l.ContentType.TYPES.KeySystemItemsKey?this.discardChangesOfBasePayload(t):e.server_item?this.resultByDuplicatingBasePayloadAsNonVaultedAndTakingServerPayloadAsCanonical(t,e.server_item):this.resultByDuplicatingBasePayloadAsNonVaultedAndDiscardingChangesOfOriginal(t):[]}discardChangesOfBasePayload(e){return[e.copyAsSyncResolved({dirty:!1,lastSyncEnd:new Date},r.PayloadSource.RemoteSaved)]}getResultForConflictWithOnlyUnsavedItem(e){const t=this.baseCollection.find(e.unsaved_item.uuid);return t?[t.copyAsSyncResolved({dirty:!1,lastSyncEnd:new Date},r.PayloadSource.RemoteSaved)]:[]}getResultForConflictWithOnlyServerItem(e){const t=this.baseCollection.find(e.server_item.uuid);return t?this.resultByDuplicatingBasePayloadIntoNewUuidAndTakingServerPayloadAsCanonical(t,e.server_item):[]}getResultForConflictWithServerItemAndUnsavedItem(e){const t=this.baseCollection.find(e.server_item.uuid);return t?this.resultByDuplicatingBasePayloadIntoNewUuidAndTakingServerPayloadAsCanonical(t,e.server_item):[]}resultByDuplicatingBasePayloadIntoNewUuidAndTakingServerPayloadAsCanonical(e,t){const n=(0,a.PayloadsByDuplicating)({payload:e,baseCollection:this.baseCollection,isConflict:!0,source:t.source}),r=t.copyAsSyncResolved({lastSyncBegan:e.lastSyncBegan,dirty:!1,lastSyncEnd:new Date},t.source);return n.concat([r])}resultByDuplicatingBasePayloadAsNonVaultedAndTakingServerPayloadAsCanonical(e,t){const n=(0,a.PayloadsByDuplicating)({payload:e.copy({key_system_identifier:void 0,shared_vault_uuid:void 0}),baseCollection:this.baseCollection,isConflict:!0,source:t.source}),r=t.copyAsSyncResolved({lastSyncBegan:e.lastSyncBegan,dirty:!1,lastSyncEnd:new Date},t.source);return n.concat([r])}resultByDuplicatingBasePayloadAsNonVaultedAndDiscardingChangesOfOriginal(e){return[...(0,a.PayloadsByDuplicating)({payload:e.copy({key_system_identifier:void 0,shared_vault_uuid:void 0}),baseCollection:this.baseCollection,isConflict:!0,source:e.source}),...this.discardChangesOfBasePayload(e)]}resultByDuplicatingBasePayloadAsNonVaultedAndRemovingBaseItemLocally(e){return[...(0,a.PayloadsByDuplicating)({payload:e.copy({key_system_identifier:void 0,shared_vault_uuid:void 0}),baseCollection:this.baseCollection,isConflict:!0,source:e.source}),new i.DeletedPayload(Object.assign(Object.assign(Object.assign({},e),{content:void 0,deleted:!0,key_system_identifier:void 0,shared_vault_uuid:void 0}),(0,o.BuildSyncResolvedParams)({dirty:!1,lastSyncEnd:new Date})),r.PayloadSource.RemoteSaved)]}}},79603:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaRemoteRetrieved=void 0;const r=n(38067),i=n(13566),o=n(59180),s=n(82648),a=n(72990),l=n(38656),c=n(9611);t.DeltaRemoteRetrieved=class{constructor(e,t,n,r){this.baseCollection=e,this.applyCollection=t,this.itemsSavedOrSaving=n,this.historyMap=r}isUuidOfPayloadCurrentlySavingOrSaved(e){return null!=this.itemsSavedOrSaving.find((t=>t.uuid===e))}result(){const e={emits:[],ignored:[],source:o.PayloadEmitSource.RemoteRetrieved},t=[];for(const n of this.applyCollection.all()){if(n.content_type===s.ContentType.TYPES.ItemsKey||n.content_type===s.ContentType.TYPES.KeySystemItemsKey){const t=new l.ItemsKeyDelta(this.baseCollection,[n]).result();(0,c.extendSyncDelta)(e,t);continue}if(this.isUuidOfPayloadCurrentlySavingOrSaved(n.uuid)){t.push(n);continue}const r=this.baseCollection.find(n.uuid);!(null==r?void 0:r.dirty)||(0,i.isErrorDecryptingPayload)(r)?e.emits.push((0,a.payloadByFinalizingSyncState)(n,this.baseCollection)):t.push(n)}for(const n of t){if(!(0,i.isDecryptedPayload)(n))continue;const t=this.baseCollection.find(n.uuid);if(!t)continue;const o=new r.ConflictDelta(this.baseCollection,t,n,this.historyMap);(0,c.extendSyncDelta)(e,o.result())}return e}}},50910:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaRemoteSaved=void 0;const r=n(452),i=n(89223),o=n(13566),s=n(59180),a=n(72990),l=n(84625),c=n(13743);t.DeltaRemoteSaved=class{constructor(e,t){this.baseCollection=e,this.applyContextualPayloads=t}result(){const e=[];for(const t of this.applyContextualPayloads){const n=this.baseCollection.find(t.uuid);if(n)if((0,o.isDeletedPayload)(n)){const o=!t.deleted,s=t.deleted;if(o){const n=new r.DeletedPayload(Object.assign(Object.assign(Object.assign({},t),{deleted:!0,content:void 0,dirtyIndex:(0,c.getIncrementedDirtyIndex)()}),(0,l.BuildSyncResolvedParams)({dirty:!0,lastSyncEnd:new Date})),i.PayloadSource.RemoteSaved);e.push(n)}else if(s){const r=n.copy(Object.assign(Object.assign(Object.assign({},t),{deleted:!0}),(0,l.BuildSyncResolvedParams)({dirty:!1,lastSyncEnd:new Date})),i.PayloadSource.RemoteSaved);e.push(r)}}else{const r=(0,a.payloadByFinalizingSyncState)(n.copy(Object.assign(Object.assign({},t),{deleted:!1}),i.PayloadSource.RemoteSaved),this.baseCollection);e.push(r)}else{const n=new r.DeletedPayload(Object.assign(Object.assign(Object.assign({},t),{deleted:!0,content:void 0}),(0,l.BuildSyncResolvedParams)({dirty:!1,lastSyncEnd:new Date})),i.PayloadSource.RemoteSaved);e.push(n)}}return{emits:e,source:s.PayloadEmitSource.RemoteSaved}}}},16484:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DeltaRemoteUuidConflicts=void 0;const r=n(87901),i=n(51833),o=n(15005),s=n(13566),a=n(59180);t.DeltaRemoteUuidConflicts=class{constructor(e,t){this.baseCollection=e,this.conflicts=t}result(){const e=[],t=this.baseCollection.mutableCopy();for(const n of this.conflicts){const a=e.find((e=>e.uuid===n.unsaved_item.uuid))||n.unsaved_item;if(!(0,s.isDecryptedPayload)(a))continue;const l=(0,o.PayloadsByAlternatingUuid)(a,i.ImmutablePayloadCollection.FromCollection(t));t.set(l),(0,r.filterFromArray)(e,(e=>(0,r.Uuids)(l).includes(e.uuid))),(0,r.extendArray)(e,l)}return{emits:e,source:a.PayloadEmitSource.RemoteRetrieved}}}},72990:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.payloadsByFinalizingSyncState=t.payloadByFinalizingSyncState=void 0;const r=n(13743);function i(e,t){const n=t.find(e.uuid);if(!n)return e.copyAsSyncResolved({dirty:!1,lastSyncEnd:new Date});const i=!(!n.dirtyIndex||!n.globalDirtyIndexAtLastSync)&&n.dirtyIndex>n.globalDirtyIndexAtLastSync;return e.copyAsSyncResolved({dirty:i,dirtyIndex:i?(0,r.getIncrementedDirtyIndex)():void 0,lastSyncEnd:new Date})}t.payloadByFinalizingSyncState=i,t.payloadsByFinalizingSyncState=function(e,t){return e.map((e=>i(e,t)))}},84625:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BuildSyncResolvedParams=void 0,t.BuildSyncResolvedParams=function(e){return e}},22517:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(38067),t),i(n(33076),t),i(n(28504),t),i(n(9579),t),i(n(79603),t),i(n(50910),t),i(n(9910),t),i(n(16484),t),i(n(34319),t),i(n(9611),t)},13743:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getCurrentDirtyIndex=t.getIncrementedDirtyIndex=void 0;let n=0;t.getIncrementedDirtyIndex=function(){return n++,n},t.getCurrentDirtyIndex=function(){return n}},55823:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},91176:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.computeFiltersForDisplayOptions=t.computeUnifiedFilterForDisplayOptions=void 0;const r=n(8698),i=n(50149),o=n(35509),s=n(41138),a=n(82648);function l(e,t){var n;const l=[];let c;if(e.views&&e.views.length>0){const n=new r.CompoundPredicate("and",e.views.map((e=>e.predicate)));c=n,l.push((e=>{if(n.keypathIncludesString("tags")){const r=i.ItemWithTags.Create(e.payload,e,t.elementsReferencingElement(e,a.ContentType.TYPES.Tag));return n.matchesItem(r)}return n.matchesItem(e)}))}if(e.tags&&e.tags.length>0)for(const t of e.tags)l.push((e=>t.isReferencingItem(e)));if(!1!==e.includePinned||(null==c?void 0:c.keypathIncludesString("pinned"))||l.push((e=>!e.pinned)),!1!==e.includeProtected||(null==c?void 0:c.keypathIncludesString("protected"))||l.push((e=>!e.protected)),!1!==e.includeTrashed||(null==c?void 0:c.keypathIncludesString("trashed"))||l.push((e=>!e.trashed)),!1!==e.includeArchived||(null==c?void 0:c.keypathIncludesString("archived"))||l.push((e=>!e.archived)),e.searchQuery){const n=e.searchQuery;l.push((e=>(0,o.itemMatchesQuery)(e,n,t)))}return(null==c?void 0:c.keypathIncludesString("conflict_of"))||(null===(n=e.views)||void 0===n?void 0:n.some((e=>e.uuid===s.SystemViewId.TrashedNotes)))||l.push((e=>!e.conflictOf)),l}t.computeUnifiedFilterForDisplayOptions=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const r=l(e,t).concat(n);return e=>(0,o.itemPassesFilters)(e,r)},t.computeFiltersForDisplayOptions=l},40257:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ItemDisplayController=void 0;const r=n(87901),i=n(50292),o=n(99548),s=n(45408),a=n(79256),l=n(19688),c=n(52197),u=n(59017),d=n(41574);t.ItemDisplayController=class{constructor(e,t,n,r){this.collection=e,this.contentTypes=t,this.options=n,this.vaultOptions=r,this.sortMap={},this.sortedItems=[],this.needsSort=!0,this.filterThenSortElements(this.collection.all(this.contentTypes))}items(){return this.sortedItems}hasExclusiveVaultOptions(){return!!this.vaultOptions&&!(0,d.isExclusionaryOptionsValue)(this.vaultOptions.getOptions())}getDisplayOptions(){return this.options}setVaultDisplayOptions(e){this.vaultOptions=e,this.needsSort=!0,this.filterThenSortElements(this.collection.all(this.contentTypes))}setDisplayOptions(e){this.options=Object.assign(Object.assign({},this.options),e),this.needsSort=!0,this.filterThenSortElements(this.collection.all(this.contentTypes))}onCollectionChange(e){const t=[...e.changed,...e.inserted,...e.discarded].filter((e=>this.contentTypes.includes(e.content_type)));this.filterThenSortElements(t)}passesAllFilters(e){const t=[new s.CollectionCriteriaValidator(this.collection,e)];if(this.vaultOptions){const n=this.vaultOptions.getOptions();(0,d.isExclusionaryOptionsValue)(n)?t.push(new l.ExcludeVaultsCriteriaValidator([...n.exclude,...n.locked],e)):t.push(new c.ExclusiveVaultCriteriaValidator(n.exclusive,e))}return"hiddenContentTypes"in this.options&&this.options.hiddenContentTypes&&t.push(new u.HiddenContentCriteriaValidator(this.options.hiddenContentTypes,e)),"customFilter"in this.options&&this.options.customFilter&&t.push(new a.CustomFilterCriteriaValidator(this.options.customFilter,e)),t.every((e=>e.passes()))}filterThenSortElements(e){for(const t of e){const e=this.sortMap[t.uuid],n=null!=e?this.sortedItems[e]:void 0,o=()=>{null!=e&&(delete this.sortMap[t.uuid],this.sortedItems[e]=void 0,this.needsSort=!0)};if((0,i.isDeletedItem)(t)||(0,i.isEncryptedItem)(t))o();else if(this.passesAllFilters(t))if(null!=n){const i=n[this.options.sortBy],o=t[this.options.sortBy];this.sortedItems[e]=t;const s=n.pinned!==t.pinned;(0,r.compareValues)(i,o)&&!s||(this.needsSort=!0)}else this.sortedItems.push(t),this.needsSort=!0;else o()}this.needsSort&&(this.needsSort=!1,this.resortItems())}resortItems(){const e=this.sortedItems.sort(((e,t)=>(0,o.sortTwoItems)(e,t,this.options.sortBy,this.options.sortDirection))),t=[];let n=0;for(const r of e)r&&(t.push(r),this.sortMap[r.uuid]=n,n++);this.sortedItems=t}}},50149:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ItemWithTags=void 0;const r=n(87901),i=n(50292);class o extends i.DecryptedItem{constructor(e,t,n){super(e),this.item=t,this.tags=n,this.transferInItemPropertiesSoRootLevelPredicateKeyPathsCanBeMatched(t),this.tags=n||e.content.tags}transferInItemPropertiesSoRootLevelPredicateKeyPathsCanBeMatched(e){Object.assign(this,(0,r.omitByCopy)(e,["title","text"]))}static Create(e,t,n){return new o(e,t,n)}get tagsCount(){var e;return(null===(e=this.tags)||void 0===e?void 0:e.length)||0}get title(){return this.item.title}get text(){return this.item.text}}t.ItemWithTags=o},35509:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.itemMatchesQuery=t.itemPassesFilters=t.notesAndFilesMatchingOptions=void 0;const r=n(82648),i=n(91176);var o;function s(e,t){for(const n of t)if(!n(e))return!1;return!0}function a(e,t){var n,r;if(0===t.length)return o.TitleAndText;const i=null===(n=e.title)||void 0===n?void 0:n.toLowerCase(),s=null===(r=e.text)||void 0===r?void 0:r.toLowerCase(),a=t.toLowerCase(),l=a.split(" "),c=function(e){const t=e.match(/"(.*?)"/);return t?t[1]:null}(a);if(c)return((null==i?void 0:i.includes(c))?o.Title:o.None)+((null==s?void 0:s.includes(c))?o.Text:o.None);if(function(e){return!!e.match(/\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b/)}(a))return e.uuid===a?o.Uuid:o.None;const u=i&&l.every((e=>i.indexOf(e)>=0)),d=s&&l.every((e=>s.indexOf(e)>=0));return(u?o.Title:0)+(d?o.Text:0)}!function(e){e[e.None=0]="None",e[e.Title=1]="Title",e[e.Text=2]="Text",e[e.TitleAndText=3]="TitleAndText",e[e.Uuid=5]="Uuid"}(o||(o={})),t.notesAndFilesMatchingOptions=function(e,t,n){const r=(0,i.computeFiltersForDisplayOptions)(e,n);return t.filter((e=>s(e,r)))},t.itemPassesFilters=s,t.itemMatchesQuery=function(e,t,n){const i=n.elementsReferencingElement(e,r.ContentType.TYPES.Tag).some((e=>a(e,t.query)!==o.None));if(e.protected&&!t.includeProtectedNoteText){const n=a(e,t.query);return n===o.Title||n===o.TitleAndText||i}return a(e,t.query)!==o.None||i}},29816:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},74379:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},99548:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sortTwoItems=t.KeepSameOrder=t.SortRightFirst=t.SortLeftFirst=void 0;const r=n(87901),i=n(92207);t.SortLeftFirst=-1,t.SortRightFirst=1,t.KeepSameOrder=0,t.sortTwoItems=function e(n,o,s,a){let l=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(!n)return t.SortLeftFirst;if(!o)return t.SortRightFirst;if(!l){if(n.pinned&&o.pinned)return e(n,o,s,a,!0);if(n.pinned)return t.SortLeftFirst;if(o.pinned)return t.SortRightFirst}const c=n[s]||"",u=o[s]||"",d="asc"===a;let h=t.KeepSameOrder;h=s===i.CollectionSort.Title&&(0,r.isString)(c)&&(0,r.isString)(u)&&c.length>0&&u.length>0?c.localeCompare(u,"en",{numeric:!0}):c>u?t.SortRightFirst:c<u?t.SortLeftFirst:t.KeepSameOrder;const p=h===t.SortLeftFirst,f=h===t.SortRightFirst;return p?d?t.SortLeftFirst:t.SortRightFirst:f?d?t.SortRightFirst:t.SortLeftFirst:t.KeepSameOrder}},93974:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},45408:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CollectionCriteriaValidator=void 0,t.CollectionCriteriaValidator=class{constructor(e,t){this.collection=e,this.element=t}passes(){return this.collection.has(this.element.uuid)}}},79256:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CustomFilterCriteriaValidator=void 0,t.CustomFilterCriteriaValidator=class{constructor(e,t){this.customFilter=e,this.element=t}passes(){return this.customFilter(this.element)}}},19688:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExcludeVaultsCriteriaValidator=void 0,t.ExcludeVaultsCriteriaValidator=class{constructor(e,t){this.excludeVaults=e,this.element=t}passes(){return!this.excludeVaults.some((e=>this.element.key_system_identifier===e))}}},52197:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExclusiveVaultCriteriaValidator=void 0,t.ExclusiveVaultCriteriaValidator=class{constructor(e,t){this.exclusiveVault=e,this.element=t}passes(){return this.element.key_system_identifier===this.exclusiveVault}}},59017:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.HiddenContentCriteriaValidator=void 0,t.HiddenContentCriteriaValidator=class{constructor(e,t){this.hiddenContentTypes=e,this.element=t}passes(){return!this.hiddenContentTypes.includes(this.element.content_type)}}},67104:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VaultDisplayOptions=void 0;const r=n(87901),i=n(41574);function o(e){return e.map((e=>e.systemIdentifier))}class s{constructor(e){this.options=e}getOptions(){return this.options}getExclusivelyShownVault(){if((0,i.isExclusionaryOptionsValue)(this.options))throw new Error("Not in exclusive display mode");return this.options.exclusive}isInExclusiveDisplayMode(){return!(0,i.isExclusionaryOptionsValue)(this.options)}isVaultExplicitlyExcluded(e){if((0,i.isExclusionaryOptionsValue)(this.options))return this.options.exclude.some((t=>t===e.systemIdentifier));if(this.options.exclusive)return this.options.exclusive!==e.systemIdentifier;throw new Error("Invalid vault display options")}isVaultExclusivelyShown(e){return!(0,i.isExclusionaryOptionsValue)(this.options)&&this.options.exclusive===e.systemIdentifier}isVaultDisabledOrLocked(e){return!(!(0,i.isExclusionaryOptionsValue)(this.options)||!this.options.locked.find((t=>t===e.systemIdentifier)))||this.isVaultExplicitlyExcluded(e)}getPersistableValue(){return this.options}newOptionsByIntakingLockedVaults(e){return(0,i.isExclusionaryOptionsValue)(this.options)?new s({exclude:this.options.exclude,locked:o(e)}):new s({exclusive:this.options.exclusive})}newOptionsByExcludingVault(e,t){return this.newOptionsByExcludingVaults([e],t)}newOptionsByExcludingVaults(e,t){return(0,i.isExclusionaryOptionsValue)(this.options)?new s({exclude:(0,r.uniqueArray)([...this.options.exclude,...o(e)]),locked:o(t)}):new s({exclude:o(e),locked:o(t)})}newOptionsByUnexcludingVault(e,t){return(0,i.isExclusionaryOptionsValue)(this.options)?new s({exclude:this.options.exclude.filter((t=>t!==e.systemIdentifier)),locked:o(t)}):new s({exclude:[],locked:o(t)})}static FromPersistableValue(e){return new s(e)}}t.VaultDisplayOptions=s},41574:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isExclusionaryOptionsValue=void 0,t.isExclusionaryOptionsValue=function(e){return"exclude"in e||"locked"in e}},30561:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(55823),t),i(n(91176),t),i(n(40257),t),i(n(50149),t),i(n(29816),t),i(n(35509),t),i(n(74379),t),i(n(93974),t),i(n(67104),t),i(n(41574),t)},87332:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContentTypeUsesKeySystemRootKeyEncryption=void 0;const r=n(82648);t.ContentTypeUsesKeySystemRootKeyEncryption=function(e){return e===r.ContentType.TYPES.KeySystemItemsKey}},21662:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContentTypeUsesRootKeyEncryption=void 0;const r=n(96084);t.ContentTypeUsesRootKeyEncryption=function(e){return(0,r.ContentTypesUsingRootKeyEncryption)().includes(e)}},96084:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContentTypesUsingRootKeyEncryption=void 0;const r=n(82648);t.ContentTypesUsingRootKeyEncryption=function(){return[r.ContentType.TYPES.RootKey,r.ContentType.TYPES.ItemsKey,r.ContentType.TYPES.EncryptedStorage,r.ContentType.TYPES.TrustedContact,r.ContentType.TYPES.KeySystemRootKey]}},47469:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},74958:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isNativeFeature=t.isItemBasedFeature=t.isUIFeatureAnIframeFeature=void 0;const r=n(80215);t.isUIFeatureAnIframeFeature=function(e){return(0,r.isIframeComponentFeatureDescription)(e.featureDescription)},t.isItemBasedFeature=function(e){return"uuid"in e},t.isNativeFeature=function(e){return!("uuid"in e)}},36053:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UIFeature=void 0;const r=n(80215),i=n(74958),o=n(82648),s=n(52659);t.UIFeature=class{constructor(e){this.item=e}get isComponent(){return(0,i.isItemBasedFeature)(this.item)}get isThemeComponent(){return(0,i.isItemBasedFeature)(this.item)&&(0,s.isTheme)(this.item)}get asComponent(){if((0,i.isItemBasedFeature)(this.item))return this.item;throw new Error("Cannot cast item to component")}get asTheme(){if((0,i.isItemBasedFeature)(this.item))return this.item;throw new Error("Cannot cast item to component")}get asFeatureDescription(){if((0,i.isNativeFeature)(this.item))return this.item;throw new Error("Cannot cast item to feature description")}get isNativeFeature(){return void 0!==(0,r.FindNativeFeature)(this.featureIdentifier)}get uniqueIdentifier(){return(0,i.isNativeFeature)(this.item)?r.NativeFeatureIdentifier.create(this.item.identifier).getValue():o.Uuid.create(this.item.uuid).getValue()}get featureIdentifier(){return this.item.identifier}get noteType(){var e;if((0,i.isNativeFeature)(this.item)&&(0,r.isEditorFeatureDescription)(this.item))return null!==(e=this.item.note_type)&&void 0!==e?e:r.NoteType.Unknown;if((0,i.isItemBasedFeature)(this.item))return this.item.noteType;throw new Error("Invalid component or feature description")}get fileType(){var e,t;if((0,i.isNativeFeature)(this.item)&&(0,r.isEditorFeatureDescription)(this.item))return this.item.file_type;if((0,i.isItemBasedFeature)(this.item)&&(0,r.isEditorFeatureDescription)(this.item.package_info))return null!==(t=null===(e=this.item.package_info)||void 0===e?void 0:e.file_type)&&void 0!==t?t:"txt";throw new Error("Invalid component or feature description")}get displayName(){var e;return(0,i.isNativeFeature)(this.item)?null!==(e=this.item.name)&&void 0!==e?e:"":this.item.displayName}get description(){var e,t;return(0,i.isNativeFeature)(this.item)?null!==(e=this.item.description)&&void 0!==e?e:"":null!==(t=this.item.package_info.description)&&void 0!==t?t:""}get deprecationMessage(){return(0,i.isNativeFeature)(this.item)?this.item.deprecation_message:this.item.deprecationMessage}get expirationDate(){return(0,i.isNativeFeature)(this.item)?this.item.expires_at?new Date(this.item.expires_at):void 0:this.item.valid_until}get featureDescription(){return(0,i.isNativeFeature)(this.item)?this.item:this.item.package_info}get acquiredPermissions(){var e;if((0,i.isNativeFeature)(this.item)&&(0,r.isIframeComponentFeatureDescription)(this.item))return null!==(e=this.item.component_permissions)&&void 0!==e?e:[];if((0,i.isItemBasedFeature)(this.item))return this.item.permissions;throw new Error("Invalid component or feature description")}get area(){return"area"in this.item?this.item.area:r.ComponentArea.Editor}get layerable(){var e;return(0,i.isItemBasedFeature)(this.item)&&(0,s.isTheme)(this.item)?this.item.layerableTheme:!!(0,r.isThemeFeatureDescription)(this.asFeatureDescription)&&null!==(e=this.asFeatureDescription.layerable)&&void 0!==e&&e}get dockIcon(){return(0,i.isItemBasedFeature)(this.item)&&(0,s.isTheme)(this.item)?this.asTheme.package_info.dock_icon:(0,r.isThemeFeatureDescription)(this.asFeatureDescription)?this.asFeatureDescription.dock_icon:void 0}}},18284:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},24715:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateHistoryEntryForPayload=void 0;const r=n(82648),i=n(69375),o=n(94068);t.CreateHistoryEntryForPayload=function(e,t){return new(e.content_type===r.ContentType.TYPES.Note?o.NoteHistoryEntry:i.HistoryEntry)(e,t)}},69375:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.HistoryEntry=void 0;const r=n(87901),i=n(73277);t.HistoryEntry=class{constructor(e,t){var n;this.defaultContentKeyToDiffOn="text",this.payload=e.copy(),this.previousEntry=t,this.hasPreviousEntry=!(0,r.isNullOrUndefined)(t);const i=this.payload.content[this.defaultContentKeyToDiffOn];if(i)if(t){const e=(null===(n=t.payload.content[this.defaultContentKeyToDiffOn])||void 0===n?void 0:n.length)||0;this.textCharDiffLength=i.length-e}else this.textCharDiffLength=i.length;else this.textCharDiffLength=0}itemFromPayload(){return(0,i.CreateDecryptedItemFromPayload)(this.payload)}isSameAsEntry(e){if(!e)return!1;const t=this.itemFromPayload(),n=e.itemFromPayload();return!(t.userModifiedDate.getTime()!==n.userModifiedDate.getTime())&&t.isItemContentEqualWith(n)}isDiscardable(){return!1}operationVector(){return void 0!==this.textCharDiffLength?this.hasPreviousEntry&&0!==this.textCharDiffLength?this.textCharDiffLength<0?-1:1:0:1}deltaSize(){return void 0!==this.textCharDiffLength?Math.abs(this.textCharDiffLength):1}}},30545:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},97873:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.historyMapFunctions=void 0,t.historyMapFunctions={getNewestRevision:e=>e[0]}},94068:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoteHistoryEntry=void 0;const r=n(87901),i=n(69375);class o extends i.HistoryEntry{previewTitle(){return this.payload.updated_at.getTime()>0?this.payload.updated_at.toLocaleString():this.payload.created_at.toLocaleString()}previewSubTitle(){return this.hasPreviousEntry?this.textCharDiffLength<0?"".concat(-1*this.textCharDiffLength," characters removed"):this.textCharDiffLength>0?"".concat(this.textCharDiffLength," characters added"):"Title or metadata changed":"".concat(this.textCharDiffLength," characters loaded")}isDiscardable(){return(0,r.isEmpty)(this.payload.content.text)}}t.NoteHistoryEntry=o},78274:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(24715),t),i(n(69375),t),i(n(97873),t),i(n(94068),t),i(n(30545),t)},47479:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateItemDelta=void 0,t.CreateItemDelta=function(e){return{changed:e.changed||[],inserted:e.inserted||[],discarded:e.discarded||[],ignored:e.ignored||[],unerrored:e.unerrored||[]}}},21626:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},8698:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CompoundPredicate=void 0,t.CompoundPredicate=class{constructor(e,t){this.operator=e,this.predicates=t}matchesItem(e){if("and"===this.operator){for(const t of this.predicates)if(!t.matchesItem(e))return!1;return!0}if("or"===this.operator){for(const t of this.predicates)if(t.matchesItem(e))return!0;return!1}return!1}keypathIncludesString(e){for(const t of this.predicates)if(t.keypathIncludesString(e))return!0;return!1}toJson(){return{operator:this.operator,value:this.predicates.map((e=>e.toJson()))}}}},26550:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.predicateFromDSLString=t.predicateFromJson=t.includesPredicateFromArguments=t.notPredicateFromArguments=t.compoundPredicateFromArguments=t.predicateFromArguments=void 0;const r=n(8698),i=n(80389),o=n(21271),s=n(73067),a=n(78688);function l(e,t,n){if(o.AllPredicateCompoundOperators.includes(t))return c(t,n);if("not"===t)return new s.NotPredicate(u(n));if("includes"===t&&e)return function(e){return!!o.SureValueNonObjectTypesAsStrings.includes(typeof e)||!!Array.isArray(e)&&!d(e)}(n)?new a.Predicate(e,t,n):new i.IncludesPredicate(e,u(n));if(e)return new a.Predicate(e,t,n);throw Error("Invalid predicate arguments")}function c(e,t){const n=t.map((e=>u(e)));return new r.CompoundPredicate(e,n)}function u(e){if(Array.isArray(e))throw Error("Invalid predicateFromJson value");return l(e.keypath,e.operator,d(e.value)?h(e.value):e.value)}function d(e){return Array.isArray(e)&&o.AllPredicateOperators.includes(e[1])}function h(e){const t=e[2];let n;if(Array.isArray(t)){const e=t;n=Array.isArray(e[0])?e.map((e=>h(e))):d(t[1])?h(e):t}else n=t;return{keypath:e[0],operator:e[1],value:n}}t.predicateFromArguments=l,t.compoundPredicateFromArguments=c,t.notPredicateFromArguments=function(e){const t=u(e);return new s.NotPredicate(t)},t.includesPredicateFromArguments=function(e,t){const n=u(t);return new i.IncludesPredicate(e,n)},t.predicateFromJson=u,t.predicateFromDSLString=function(e){try{const t=JSON.parse(e.substring(1,e.length));return t.shift(),u(h(t))}catch(e){throw Error("Invalid smart view syntax ".concat(JSON.stringify(e)))}}},80389:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IncludesPredicate=void 0,t.IncludesPredicate=class{constructor(e,t){this.keypath=e,this.predicate=t}matchesItem(e){const t=this.keypath.split(".").reduce(((e,t)=>e&&e[t]),e);return!!Array.isArray(t)&&t.some((e=>this.predicate.matchesItem(e)))}keypathIncludesString(e){return this.keypath.includes(e)}toJson(){return{keypath:this.keypath,operator:"includes",value:this.predicate.toJson()}}}},21271:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SureValueNonObjectTypesAsStrings=t.AllPredicateOperators=t.AllNonCompoundPredicateOperators=t.AllPredicateCompoundOperators=void 0,t.AllPredicateCompoundOperators=["and","or"],t.AllNonCompoundPredicateOperators=["!=","=","<",">","<=",">=","startsWith","in","matches","not","includes"],t.AllPredicateOperators=[...t.AllPredicateCompoundOperators,...t.AllNonCompoundPredicateOperators],t.SureValueNonObjectTypesAsStrings=["number","string","boolean"]},73067:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NotPredicate=void 0,t.NotPredicate=class{constructor(e){this.predicate=e}matchesItem(e){return!this.predicate.matchesItem(e)}keypathIncludesString(e){return this.predicate.keypathIncludesString(e)}toJson(){return{operator:"not",value:this.predicate.toJson()}}}},21014:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.valueMatchesTargetValue=void 0;const r=n(87901),i=n(58506);t.valueMatchesTargetValue=function e(t,n,o){if(null==o)return!1;if("string"==typeof o&&o.includes(".ago")&&(o=(0,i.dateFromDSLDateString)(o)),"string"==typeof o&&(o=o.toLowerCase()),"string"==typeof t&&(t=t.toLowerCase()),t instanceof Date&&"string"==typeof o&&(o=new Date(o)),"not"===n)return!e(t,"=",o);if(null==t){const e=[!1,"",null,void 0,NaN].includes(o);return"!="===n?!e:e}if("="===n)return Array.isArray(t)?JSON.stringify(t)===JSON.stringify(o):t===o;if("!="===n)return Array.isArray(t)?JSON.stringify(t)!==JSON.stringify(o):t!==o;if("<"===n)return t<o;if(">"===n)return t>o;if("<="===n)return t<=o;if(">="===n)return t>=o;if("startsWith"===n)return t.startsWith(o);if("in"===n&&Array.isArray(o))return o.includes(t);if("includes"===n){if((0,r.isString)(t))return t.includes(o);if((0,r.isString)(o)&&((0,r.isString)(t)||Array.isArray(t)))return t.includes(o)}return"matches"===n&&new RegExp(o).test(t)}},78688:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Predicate=void 0;const r=n(21014);t.Predicate=class{constructor(e,t,n){this.keypath=e,this.operator=t,this.targetValue=n,"true"!==this.targetValue&&"false"!==this.targetValue||(this.targetValue=JSON.parse(this.targetValue))}keypathIncludesString(e){return this.keypath.includes(e)}matchesItem(e){const t=this.keypath.split(".").reduce(((e,t)=>e&&e[t]),e);return(0,r.valueMatchesTargetValue)(t,this.operator,this.targetValue)}toJson(){return{keypath:this.keypath,operator:this.operator,value:this.targetValue}}}},58506:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.dateFromDSLDateString=void 0,t.dateFromDSLDateString=function(e){const t=e.split("."),n=t[1],r=new Date,i=parseInt(t[0]);return"days"===n?r.setDate(r.getDate()-i):"hours"===n?r.setHours(r.getHours()-i):"months"===n?r.setMonth(r.getMonth()-i):"years"===n&&r.setFullYear(r.getFullYear()-i),r}},59020:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SNActionsExtension=void 0;const r=n(43740),i=n(43610);class o extends r.DecryptedItem{constructor(e){super(e),this.actions=[],this.name=e.content.name||"",this.description=e.content.description||"",this.url=e.content.hosted_url||e.content.url,this.supported_types=e.content.supported_types,this.package_info=this.payload.content.package_info||{},this.deprecation=e.content.deprecation,this.actions=e.content.actions}get displayName(){return this.name}get thirdPartyPackageInfo(){return this.package_info}get isListedExtension(){return"org.standardnotes.listed"===this.package_info.identifier}actionsWithContextForItem(e){return this.actions.filter((t=>t.context===e.content_type||"Item"===t.context))}strategyWhenConflictingWithItem(e,t){return i.ConflictStrategy.KeepBase}}t.SNActionsExtension=o},27539:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ActionsExtensionMutator=void 0;const r=n(14584);class i extends r.DecryptedItemMutator{set description(e){this.mutableContent.description=e}set supported_types(e){this.mutableContent.supported_types=e}set actions(e){this.mutableContent.actions=e}set deprecation(e){this.mutableContent.deprecation=e}}t.ActionsExtensionMutator=i},82531:(e,t)=>{var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.ActionVerb=t.ActionAccessType=void 0,function(e){e.Encrypted="encrypted",e.Decrypted="decrypted"}(n||(t.ActionAccessType=n={})),function(e){e.Get="get",e.Render="render",e.Show="show",e.Post="post",e.Nested="nested"}(r||(t.ActionVerb=r={}))},40826:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(59020),t),i(n(27539),t),i(n(82531),t)},35922:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentItem=void 0;const r=n(87901),i=n(80215),o=n(68716),s=n(43610),a=n(43740),l=n(78688),c=n(82648);class u extends a.DecryptedItem{constructor(e){var t,n,o;super(e),this.permissions=[],e.content.hosted_url&&(0,r.isValidUrl)(e.content.hosted_url)?this.hosted_url=e.content.hosted_url:e.content.url&&(0,r.isValidUrl)(e.content.url)?this.hosted_url=e.content.url:e.content.legacy_url&&(0,r.isValidUrl)(e.content.legacy_url)&&(this.hosted_url=e.content.legacy_url),this.local_url=e.content.local_url,this.valid_until=new Date(e.content.valid_until||0),this.offlineOnly=null!==(t=e.content.offlineOnly)&&void 0!==t&&t,this.name=e.content.name,this.content_type===c.ContentType.TYPES.Theme?this.area=i.ComponentArea.Themes:this.area=e.content.area,this.package_info=e.content.package_info||{},this.permissions=e.content.permissions||[],this.autoupdateDisabled=null!==(n=e.content.autoupdateDisabled)&&void 0!==n&&n,this.disassociatedItemIds=e.content.disassociatedItemIds||[],this.associatedItemIds=e.content.associatedItemIds||[],this.legacy_url=e.content.hosted_url?void 0:e.content.url,this.legacyComponentData=this.payload.content.componentData||{},this.legacyActive=null!==(o=e.content.active)&&void 0!==o&&o}strategyWhenConflictingWithItem(e,t){return s.ConflictStrategy.KeepBase}get isSingleton(){return!0}get displayName(){var e;return(null===(e=(0,i.FindNativeFeature)(this.identifier))||void 0===e?void 0:e.name)||this.name}singletonPredicate(){return new l.Predicate("identifier","=",this.identifier)}isTheme(){return this.content_type===c.ContentType.TYPES.Theme||this.area===i.ComponentArea.Themes}legacyIsDefaultEditor(){return!0===this.getAppDomainValue(o.AppDataField.DefaultEditor)}hasValidHostedUrl(){return null!=(this.hosted_url||this.legacy_url)}contentKeysToIgnoreWhenCheckingEquality(){return["active","disassociatedItemIds","associatedItemIds",...super.contentKeysToIgnoreWhenCheckingEquality()]}isExplicitlyEnabledForItem(e){return-1!==this.associatedItemIds.indexOf(e)}isExplicitlyDisabledForItem(e){return-1!==this.disassociatedItemIds.indexOf(e)}get isExpired(){return this.valid_until.getTime()>0&&this.valid_until<=new Date}get identifier(){return this.package_info.identifier}get thirdPartyPackageInfo(){return this.package_info}get noteType(){var e;return(0,i.isEditorFeatureDescription)(this.package_info)&&null!==(e=this.package_info.note_type)&&void 0!==e?e:i.NoteType.Unknown}get isDeprecated(){var e;let t=null!==(e=this.package_info.flags)&&void 0!==e?e:[];return t=t.map((e=>e.toLowerCase())),t.includes(i.ComponentFlag.Deprecated)}get deprecationMessage(){return this.package_info.deprecation_message}get layerableTheme(){var e;if(!this.isTheme())return!1;const t=this.package_info;return null!==(e=null==t?void 0:t.layerable)&&void 0!==e&&e}}t.ComponentItem=u},12740:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},80755:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},43246:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentMutator=void 0;const r=n(87901),i=n(14584);class o extends i.DecryptedItemMutator{set package_info(e){this.mutableContent.package_info=e}set local_url(e){this.mutableContent.local_url=e}set hosted_url(e){this.mutableContent.hosted_url=e}set valid_until(e){this.mutableContent.valid_until=e}set permissions(e){this.mutableContent.permissions=e}set name(e){this.mutableContent.name=e}set offlineOnly(e){this.mutableContent.offlineOnly=e}associateWithItem(e){const t=this.mutableContent.associatedItemIds||[];(0,r.addIfUnique)(t,e),this.mutableContent.associatedItemIds=t}disassociateWithItem(e){const t=this.mutableContent.disassociatedItemIds||[];(0,r.addIfUnique)(t,e),this.mutableContent.disassociatedItemIds=t}removeAssociatedItemId(e){(0,r.removeFromArray)(this.mutableContent.associatedItemIds||[],e)}removeDisassociatedItemId(e){(0,r.removeFromArray)(this.mutableContent.disassociatedItemIds||[],e)}}t.ComponentMutator=o},78446:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},54218:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isComponentOrTheme=t.isTheme=t.isComponent=void 0;const r=n(50292),i=n(82648);t.isComponent=function(e){return!!(0,r.isDecryptedItem)(e)&&e.content_type===i.ContentType.TYPES.Component},t.isTheme=function(e){return!!(0,r.isDecryptedItem)(e)&&e.content_type===i.ContentType.TYPES.Theme},t.isComponentOrTheme=function(e){return!!(0,r.isDecryptedItem)(e)&&(e.content_type===i.ContentType.TYPES.Component||e.content_type===i.ContentType.TYPES.Theme)}},52659:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(35922),t),i(n(43246),t),i(n(12740),t),i(n(80755),t),i(n(78446),t),i(n(54218),t)},55159:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SNEditor=void 0;const r=n(43740);class i extends r.DecryptedItem{constructor(e){super(e),this.notes=[],this.data={},this.url=e.content.url,this.name=e.content.name,this.data=e.content.data||{},this.isDefault=e.content.default,this.systemEditor=e.content.systemEditor}}t.SNEditor=i},10123:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(55159),t)},73886:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SNFeatureRepo=void 0;const r=n(87901),i=n(43740);class o extends i.DecryptedItem{get migratedToUserSetting(){return(0,r.useBoolean)(this.payload.content.migratedToUserSetting,!1)}get migratedToOfflineEntitlements(){return(0,r.useBoolean)(this.payload.content.migratedToOfflineEntitlements,!1)}get onlineUrl(){return this.payload.content.url}get offlineFeaturesUrl(){return this.payload.content.offlineFeaturesUrl}get offlineKey(){return this.payload.content.offlineKey}}t.SNFeatureRepo=o},75299:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FeatureRepoMutator=void 0;const r=n(14584);class i extends r.DecryptedItemMutator{set migratedToUserSetting(e){this.mutableContent.migratedToUserSetting=e}set migratedToOfflineEntitlements(e){this.mutableContent.migratedToOfflineEntitlements=e}set offlineFeaturesUrl(e){this.mutableContent.offlineFeaturesUrl=e}set offlineKey(e){this.mutableContent.offlineKey=e}}t.FeatureRepoMutator=i},12310:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(73886),t),i(n(75299),t)},86154:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FileItem=t.isFile=void 0;const r=n(82648),i=n(43740),o=n(50292);t.isFile=e=>e.content_type===r.ContentType.TYPES.File;class s extends i.DecryptedItem{constructor(e){super(e),this.remoteIdentifier=this.content.remoteIdentifier,this.name=this.content.name,this.key=this.content.key,this.content.size&&this.content.chunkSizes?(this.decryptedSize=this.content.size,this.encryptedChunkSizes=this.content.chunkSizes):(this.decryptedSize=this.content.decryptedSize,this.encryptedChunkSizes=this.content.encryptedChunkSizes),this.encryptionHeader=this.content.encryptionHeader,this.mimeType=this.content.mimeType}strategyWhenConflictingWithItem(e){return e.key!==this.key||e.encryptionHeader!==this.encryptionHeader||e.remoteIdentifier!==this.remoteIdentifier||JSON.stringify(e.encryptedChunkSizes)!==JSON.stringify(this.encryptedChunkSizes)?o.ConflictStrategy.KeepBaseDuplicateApply:o.ConflictStrategy.KeepBase}get encryptedSize(){return this.encryptedChunkSizes.reduce(((e,t)=>e+t),0)}get title(){return this.name}}t.FileItem=s},78037:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},82422:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FileMutator=void 0;const r=n(82648),i=n(78961),o=n(14584);class s extends o.DecryptedItemMutator{set name(e){this.mutableContent.name=e}set encryptionHeader(e){this.mutableContent.encryptionHeader=e}addNote(e){const t={reference_type:i.ContentReferenceType.FileToNote,content_type:r.ContentType.TYPES.Note,uuid:e.uuid},n=this.mutableContent.references||[];n.push(t),this.mutableContent.references=n}removeNote(e){const t=this.immutableItem.references.filter((t=>t.uuid!==e.uuid));this.mutableContent.references=t}addFile(e){if(this.immutableItem.isReferencingItem(e))return;const t={uuid:e.uuid,content_type:r.ContentType.TYPES.File,reference_type:i.ContentReferenceType.FileToFile};this.mutableContent.references.push(t)}removeFile(e){this.mutableContent.references=this.mutableContent.references.filter((t=>t.uuid!==e.uuid))}}t.FileMutator=s},33447:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.FileProtocolV1Constants=void 0,function(e){e[e.KeySize=256]="KeySize"}(n||(t.FileProtocolV1Constants=n={}))},25698:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(86154),t),i(n(82422),t),i(n(78037),t),i(n(33447),t)},87500:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},2836:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},52493:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},82412:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},23811:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},19725:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},82818:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.KeySystemRootKey=t.isKeySystemRootKey=void 0;const r=n(50292),i=n(82648);t.isKeySystemRootKey=function(e){return e.content_type===i.ContentType.TYPES.KeySystemRootKey};class o extends r.DecryptedItem{constructor(e){super(e),this.keyParams=e.content.keyParams,this.systemIdentifier=e.content.systemIdentifier,this.key=e.content.key,this.keyVersion=e.content.keyVersion,this.token=e.content.token}strategyWhenConflictingWithItem(e,t){const n=this.keyParams.creationTimestamp;return e.keyParams.creationTimestamp>n?r.ConflictStrategy.KeepApply:r.ConflictStrategy.KeepBase}get itemsKey(){return this.key}get key_system_identifier(){}get shared_vault_uuid(){}isEqual(e){return this.itemsKey===e.itemsKey&&this.token===e.token}}t.KeySystemRootKey=o},95132:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},31750:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},64836:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.KeySystemRootKeyMutator=void 0;const r=n(50292);class i extends r.DecryptedItemMutator{}t.KeySystemRootKeyMutator=i},28819:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.KeySystemRootKeyStorageMode=void 0,function(e){e.Synced="synced",e.Local="local",e.Ephemeral="ephemeral"}(n||(t.KeySystemRootKeyStorageMode=n={}))},2636:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SNNote=t.isNote=void 0;const r=n(68716),i=n(80215),o=n(43740),s=n(82648);t.isNote=e=>e.content_type===s.ContentType.TYPES.Note;class a extends o.DecryptedItem{constructor(e){super(e),this.hidePreview=!1,this.title=String(this.payload.content.title||""),this.text=String(this.payload.content.text||""),this.hidePreview=Boolean(this.payload.content.hidePreview),this.preview_plain=String(this.payload.content.preview_plain||""),this.preview_html=String(this.payload.content.preview_html||""),this.spellcheck=this.payload.content.spellcheck,this.editorWidth=this.payload.content.editorWidth,this.noteType=this.payload.content.noteType,this.editorIdentifier=this.payload.content.editorIdentifier,this.authorizedForListed=this.payload.content.authorizedForListed||!1,this.noteType||this.getAppDomainValueWithDefault(r.AppDataField.LegacyPrefersPlainEditor,!1)&&(this.noteType=i.NoteType.Plain)}}t.SNNote=a},38856:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},39273:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoteMutator=void 0;const r=n(14584),i=n(50292),o=n(82648);class s extends r.DecryptedItemMutator{set title(e){this.mutableContent.title=e}set text(e){this.mutableContent.text=e}set hidePreview(e){this.mutableContent.hidePreview=e}set preview_plain(e){this.mutableContent.preview_plain=e}set preview_html(e){this.mutableContent.preview_html=e}set spellcheck(e){this.mutableContent.spellcheck=e}set editorWidth(e){this.mutableContent.editorWidth=e}set noteType(e){this.mutableContent.noteType=e}set editorIdentifier(e){this.mutableContent.editorIdentifier=e}set authorizedForListed(e){this.mutableContent.authorizedForListed=e}toggleSpellcheck(){null==this.mutableContent.spellcheck?this.mutableContent.spellcheck=!1:this.mutableContent.spellcheck=!this.mutableContent.spellcheck}addNote(e){if(this.immutableItem.isReferencingItem(e))return;const t={uuid:e.uuid,content_type:o.ContentType.TYPES.Note,reference_type:i.ContentReferenceType.NoteToNote};this.mutableContent.references.push(t)}removeNote(e){this.mutableContent.references=this.mutableContent.references.filter((t=>t.uuid!==e.uuid))}}t.NoteMutator=s},42006:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(2636),t),i(n(39273),t),i(n(38856),t)},12775:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SmartView=t.isSmartView=t.isSystemView=t.SMART_TAG_DSL_PREFIX=void 0;const r=n(82648),i=n(43740),o=n(26550),s=n(78748),a=n(47899);function l(e){return Object.values(s.SystemViewId).includes(e.uuid)}t.SMART_TAG_DSL_PREFIX="![",t.isSystemView=l,t.isSmartView=e=>e.content_type===r.ContentType.TYPES.SmartView;class c extends i.DecryptedItem{constructor(e){super(e),this.title=String(this.content.title||""),l(this)?this.iconString=(0,a.systemViewIcon)(this.uuid):this.iconString=this.payload.content.iconString||a.SmartViewDefaultIconName,this.preferences=this.payload.content.preferences;try{this.predicate=this.content.predicate&&(0,o.predicateFromJson)(this.content.predicate)}catch(e){console.error(e)}}}t.SmartView=c},11070:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BuildSmartViews=void 0;const r=n(89262),i=n(12775),o=n(78748),s=n(42405),a=n(78688),l=n(8698),c=n(59180),u=n(82648);function d(e){const t=[new a.Predicate("content_type","=",u.ContentType.TYPES.Note)];return!1===e.includeTrashed&&t.push(new a.Predicate("trashed","=",!1)),!1===e.includeArchived&&t.push(new a.Predicate("archived","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}function h(e){const t=[new a.Predicate("content_type","=",u.ContentType.TYPES.File)];return!1===e.includeTrashed&&t.push(new a.Predicate("trashed","=",!1)),!1===e.includeArchived&&t.push(new a.Predicate("archived","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}function p(e){const t=[new a.Predicate("archived","=",!0),new a.Predicate("content_type","=",u.ContentType.TYPES.Note)];return!1===e.includeTrashed&&t.push(new a.Predicate("trashed","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}function f(e){const t=[new a.Predicate("trashed","=",!0),new a.Predicate("content_type","=",u.ContentType.TYPES.Note)];return!1===e.includeArchived&&t.push(new a.Predicate("archived","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}function g(e){const t=[new a.Predicate("content_type","=",u.ContentType.TYPES.Note),new a.Predicate("tagsCount","=",0)];return!1===e.includeArchived&&t.push(new a.Predicate("archived","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}function m(e){const t=[new a.Predicate("starred","=",!0),new a.Predicate("content_type","=",u.ContentType.TYPES.Note)];return!1===e.includeTrashed&&t.push(new a.Predicate("trashed","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}function y(e){const t=[new a.Predicate("content_type","=",u.ContentType.TYPES.Note)];return!1===e.includeTrashed&&t.push(new a.Predicate("trashed","=",!1)),!1===e.includeArchived&&t.push(new a.Predicate("archived","=",!1)),!1===e.includeProtected&&t.push(new a.Predicate("protected","=",!1)),!1===e.includePinned&&t.push(new a.Predicate("pinned","=",!1)),new l.CompoundPredicate("and",t)}t.BuildSmartViews=function(e){const t=new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.AllNotes,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Notes",predicate:d(e).toJson()})}))),n=new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.Files,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Files",predicate:h(e).toJson()})}))),a=new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.ArchivedNotes,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Archived",predicate:p(e).toJson()})}))),l=new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.TrashedNotes,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Trash",predicate:f(e).toJson()})}))),v=new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.UntaggedNotes,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Untagged",predicate:g(e).toJson()})})));return[t,n,new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.StarredNotes,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Starred",predicate:m(e).toJson()})}))),a,l,v,new i.SmartView(new r.DecryptedPayload(Object.assign(Object.assign({uuid:o.SystemViewId.Conflicts,content_type:u.ContentType.TYPES.SmartView},(0,c.PayloadTimestampDefaults)()),{content:(0,s.FillItemContent)({title:"Conflicts",predicate:y(e).toJson()})})))]}},50986:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},47899:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SmartViewDefaultIconName=t.systemViewIcon=t.SmartViewIcons=void 0;const r=n(78748);t.SmartViewIcons={[r.SystemViewId.AllNotes]:"notes",[r.SystemViewId.Files]:"folder",[r.SystemViewId.ArchivedNotes]:"archive",[r.SystemViewId.TrashedNotes]:"trash",[r.SystemViewId.UntaggedNotes]:"hashtag-off",[r.SystemViewId.StarredNotes]:"star-filled",[r.SystemViewId.Conflicts]:"merge"},t.systemViewIcon=function(e){return t.SmartViewIcons[e]},t.SmartViewDefaultIconName="restore"},54196:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SmartViewMutator=void 0;const r=n(87458);class i extends r.TagMutator{constructor(e,t){super(e,t)}set predicate(e){this.mutableContent.predicate=e}}t.SmartViewMutator=i},78748:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SystemViewId=void 0,function(e){e.AllNotes="all-notes",e.Files="files",e.ArchivedNotes="archived-notes",e.TrashedNotes="trashed-notes",e.UntaggedNotes="untagged-notes",e.StarredNotes="starred-notes",e.Conflicts="conflicts"}(n||(t.SystemViewId=n={}))},41138:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(12775),t),i(n(11070),t),i(n(78748),t),i(n(50986),t),i(n(54196),t),i(n(47899),t)},4862:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SNTag=t.isTag=t.DefaultTagIconName=t.TagFolderDelimitter=void 0;const r=n(43740),i=n(4744),o=n(82648);t.TagFolderDelimitter=".",t.DefaultTagIconName="hashtag",t.isTag=e=>e.content_type===o.ContentType.TYPES.Tag;class s extends r.DecryptedItem{constructor(e){super(e),this.title=this.payload.content.title||"",this.expanded=null==this.payload.content.expanded||this.payload.content.expanded,this.iconString=this.payload.content.iconString||t.DefaultTagIconName,this.preferences=this.payload.content.preferences}get isDailyEntry(){var e;return"daily"===(null===(e=this.preferences)||void 0===e?void 0:e.entryMode)}get noteReferences(){return this.payload.references.filter((e=>e.content_type===o.ContentType.TYPES.Note))}get noteCount(){return this.noteReferences.length}get parentId(){const e=this.references.find(i.isTagToParentTagReference);return null==e?void 0:e.uuid}static arrayToDisplayString(e){return e.sort(((e,t)=>e.title>t.title?1:-1)).map((e=>"#"+e.title)).join(" ")}}t.SNTag=s},33913:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},74332:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TagMutator=void 0;const r=n(4744),i=n(78961),o=n(14584),s=n(82648);class a extends o.DecryptedItemMutator{constructor(e,t){super(e,t),this.mutablePreferences=this.mutableContent.preferences}set title(e){this.mutableContent.title=e}set expanded(e){this.mutableContent.expanded=e}set iconString(e){this.mutableContent.iconString=e}get preferences(){return this.mutablePreferences||(this.mutableContent.preferences={},this.mutablePreferences=this.mutableContent.preferences),this.mutablePreferences}set preferences(e){this.mutablePreferences=e,this.mutableContent.preferences=this.mutablePreferences}makeChildOf(e){const t=this.immutableItem.references.filter((e=>!(0,r.isTagToParentTagReference)(e))),n={reference_type:i.ContentReferenceType.TagToParentTag,content_type:s.ContentType.TYPES.Tag,uuid:e.uuid};t.push(n),this.mutableContent.references=t}unsetParent(){this.mutableContent.references=this.immutableItem.references.filter((e=>!(0,r.isTagToParentTagReference)(e)))}addFile(e){if(this.immutableItem.isReferencingItem(e))return;const t={reference_type:i.ContentReferenceType.TagToFile,content_type:s.ContentType.TYPES.File,uuid:e.uuid};this.mutableContent.references.push(t)}removeFile(e){this.mutableContent.references=this.mutableContent.references.filter((t=>t.uuid!==e.uuid))}addNote(e){this.immutableItem.isReferencingItem(e)||this.mutableContent.references.push({uuid:e.uuid,content_type:e.content_type})}removeNote(e){this.mutableContent.references=this.mutableContent.references.filter((t=>t.uuid!==e.uuid))}}t.TagMutator=a},72680:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},87458:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(4862),t),i(n(74332),t),i(n(33913),t),i(n(72680),t)},82602:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},63195:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TrustedContactMutator=void 0;const r=n(50292),i=n(68092);class o extends r.DecryptedItemMutator{set name(e){this.mutableContent.name=e}addPublicKey(e){const t=new i.ContactPublicKeySet({encryption:e.encryption,signing:e.signing,timestamp:new Date,previousKeySet:this.immutableItem.publicKeySet});this.mutableContent.publicKeySet=t}replacePublicKeySet(e){this.mutableContent.publicKeySet=e}}t.TrustedContactMutator=o},68092:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContactPublicKeySet=void 0;class n{constructor(e){this.encryption=e.encryption,this.signing=e.signing,this.timestamp=e.timestamp,this.previousKeySet=e.previousKeySet}findKeySetWithSigningKey(e){return this.signing===e?this:this.previousKeySet?this.previousKeySet.findKeySetWithSigningKey(e):void 0}findKeySetWithPublicKey(e){return this.encryption===e?this:this.previousKeySet?this.previousKeySet.findKeySetWithPublicKey(e):void 0}asJson(){return{encryption:this.encryption,signing:this.signing,timestamp:this.timestamp,previousKeySet:this.previousKeySet?this.previousKeySet.asJson():void 0}}mutableCopy(){return new n({encryption:this.encryption,signing:this.signing,timestamp:this.timestamp,previousKeySet:this.previousKeySet?n.FromJson(this.previousKeySet.asJson()):void 0})}static FromJson(e){return new n({encryption:e.encryption,signing:e.signing,timestamp:new Date(e.timestamp),previousKeySet:e.previousKeySet?n.FromJson(e.previousKeySet):void 0})}}t.ContactPublicKeySet=n},21436:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},79609:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TrustedContact=void 0;const r=n(50292),i=n(68092),o=n(78688),s=n(19332);class a extends r.DecryptedItem{constructor(e){super(e),this.name=e.content.name,this.contactUuid=e.content.contactUuid,this.publicKeySet=i.ContactPublicKeySet.FromJson(e.content.publicKeySet),this.isMe=e.content.isMe}get isSingleton(){return!0}singletonPredicate(){return a.singletonPredicate}hasCurrentOrPreviousSigningPublicKey(e){return void 0!==this.publicKeySet.findKeySetWithSigningKey(e)}getTrustStatusForPublicKey(e){return this.publicKeySet.encryption===e?s.PublicKeyTrustStatus.Trusted:this.publicKeySet.findKeySetWithPublicKey(e)?s.PublicKeyTrustStatus.Previous:s.PublicKeyTrustStatus.NotTrusted}getTrustStatusForSigningPublicKey(e){return this.publicKeySet.signing===e?s.PublicKeyTrustStatus.Trusted:this.publicKeySet.findKeySetWithSigningKey(e)?s.PublicKeyTrustStatus.Previous:s.PublicKeyTrustStatus.NotTrusted}strategyWhenConflictingWithItem(e,t){return r.ConflictStrategy.KeepBase}}t.TrustedContact=a,a.singletonPredicate=new o.Predicate("isMe","=",!0)},15845:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5478:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},19332:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PublicKeyTrustStatus=void 0,function(e){e.Trusted="Trusted",e.Previous="Previous",e.NotTrusted="NotTrusted"}(n||(t.PublicKeyTrustStatus=n={}))},79319:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},68933:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EditorFontSize=void 0,function(e){e.ExtraSmall="ExtraSmall",e.Small="Small",e.Normal="Normal",e.Medium="Medium",e.Large="Large"}(n||(t.EditorFontSize=n={}))},97876:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EditorLineHeightValues=t.EditorLineHeight=void 0,function(e){e.None="None",e.Tight="Tight",e.Snug="Snug",e.Normal="Normal",e.Relaxed="Relaxed",e.Loose="Loose"}(n||(t.EditorLineHeight=n={})),t.EditorLineHeightValues={None:1,Tight:1.25,Snug:1.375,Normal:1.5,Relaxed:1.625,Loose:2}},20610:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EditorLineWidth=void 0,function(e){e.Narrow="Narrow",e.Wide="Wide",e.Dynamic="Dynamic",e.FullWidth="FullWidth"}(n||(t.EditorLineWidth=n={}))},23688:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.NewNoteTitleFormat=void 0,function(e){e.CurrentDateAndTime="CurrentDateAndTime",e.CurrentNoteCount="CurrentNoteCount",e.CustomFormat="CustomFormat",e.Empty="Empty"}(n||(t.NewNoteTitleFormat=n={}))},68126:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PrefDefaults=void 0;const r=n(80215),i=n(92207),o=n(68933),s=n(97876),a=n(20610),l=n(70659),c=n(23688);t.PrefDefaults={[l.PrefKey.TagsPanelWidth]:220,[l.PrefKey.NotesPanelWidth]:350,[l.PrefKey.EditorWidth]:null,[l.PrefKey.EditorLeft]:null,[l.PrefKey.DEPRECATED_EditorMonospaceEnabled]:!1,[l.PrefKey.EditorSpellcheck]:!0,[l.PrefKey.EditorResizersEnabled]:!1,[l.PrefKey.DEPRECATED_EditorLineHeight]:s.EditorLineHeight.Normal,[l.PrefKey.DEPRECATED_EditorLineWidth]:a.EditorLineWidth.FullWidth,[l.PrefKey.DEPRECATED_EditorFontSize]:o.EditorFontSize.Normal,[l.PrefKey.SortNotesBy]:i.CollectionSort.CreatedAt,[l.PrefKey.SortNotesReverse]:!1,[l.PrefKey.NotesShowArchived]:!1,[l.PrefKey.NotesShowTrashed]:!1,[l.PrefKey.NotesHidePinned]:!1,[l.PrefKey.NotesHideProtected]:!1,[l.PrefKey.NotesHideNotePreview]:!1,[l.PrefKey.NotesHideDate]:!1,[l.PrefKey.NotesHideTags]:!1,[l.PrefKey.NotesHideEditorIcon]:!1,[l.PrefKey.DEPRECATED_UseSystemColorScheme]:!1,[l.PrefKey.DEPRECATED_UseTranslucentUI]:!0,[l.PrefKey.DEPRECATED_AutoLightThemeIdentifier]:"Default",[l.PrefKey.DEPRECATED_AutoDarkThemeIdentifier]:r.NativeFeatureIdentifier.TYPES.DarkTheme,[l.PrefKey.NoteAddToParentFolders]:!0,[l.PrefKey.NewNoteTitleFormat]:c.NewNoteTitleFormat.CurrentDateAndTime,[l.PrefKey.CustomNoteTitleFormat]:"YYYY-MM-DD [at] hh:mm A",[l.PrefKey.UpdateSavingStatusIndicator]:!0,[l.PrefKey.PaneGesturesEnabled]:!0,[l.PrefKey.MomentsDefaultTagUuid]:void 0,[l.PrefKey.ClipperDefaultTagUuid]:void 0,[l.PrefKey.DefaultEditorIdentifier]:r.NativeFeatureIdentifier.TYPES.PlainEditor,[l.PrefKey.SuperNoteExportFormat]:"json",[l.PrefKey.SuperNoteExportEmbedBehavior]:"reference",[l.PrefKey.SuperNoteExportUseMDFrontmatter]:!0,[l.PrefKey.SuperNoteExportPDFPageSize]:"A4",[l.PrefKey.SystemViewPreferences]:{},[l.PrefKey.AuthenticatorNames]:"",[l.PrefKey.ComponentPreferences]:{},[l.PrefKey.DEPRECATED_ActiveThemes]:[],[l.PrefKey.ActiveComponents]:[],[l.PrefKey.AlwaysShowSuperToolbar]:!0,[l.PrefKey.AddImportsToTag]:!0,[l.PrefKey.AlwaysCreateNewTagForImports]:!0,[l.PrefKey.ExistingTagForImports]:void 0}},70659:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PrefKey=void 0,function(e){e.TagsPanelWidth="tagsPanelWidth",e.NotesPanelWidth="notesPanelWidth",e.EditorWidth="editorWidth",e.EditorLeft="editorLeft",e.EditorSpellcheck="spellcheck",e.EditorResizersEnabled="marginResizersEnabled",e.SortNotesBy="sortBy",e.SortNotesReverse="sortReverse",e.NotesShowArchived="showArchived",e.NotesShowTrashed="showTrashed",e.NotesHideProtected="hideProtected",e.NotesHidePinned="hidePinned",e.NotesHideNotePreview="hideNotePreview",e.NotesHideDate="hideDate",e.NotesHideTags="hideTags",e.NotesHideEditorIcon="hideEditorIcon",e.NoteAddToParentFolders="noteAddToParentFolders",e.NewNoteTitleFormat="newNoteTitleFormat",e.CustomNoteTitleFormat="customNoteTitleFormat",e.UpdateSavingStatusIndicator="updateSavingStatusIndicator",e.DefaultEditorIdentifier="defaultEditorIdentifier",e.MomentsDefaultTagUuid="momentsDefaultTagUuid",e.ClipperDefaultTagUuid="clipperDefaultTagUuid",e.SystemViewPreferences="systemViewPreferences",e.SuperNoteExportFormat="superNoteExportFormat",e.SuperNoteExportEmbedBehavior="superNoteExportEmbedBehavior",e.SuperNoteExportUseMDFrontmatter="superNoteExportUseMDFrontmatter",e.SuperNoteExportPDFPageSize="superNoteExportPDFPageSize",e.AuthenticatorNames="authenticatorNames",e.PaneGesturesEnabled="paneGesturesEnabled",e.ComponentPreferences="componentPreferences",e.ActiveComponents="activeComponents",e.AlwaysShowSuperToolbar="alwaysShowSuperToolbar",e.AddImportsToTag="addImportsToTag",e.AlwaysCreateNewTagForImports="alwaysCreateNewTagForImports",e.ExistingTagForImports="existingTagForImports",e.DEPRECATED_ActiveThemes="activeThemes",e.DEPRECATED_UseSystemColorScheme="useSystemColorScheme",e.DEPRECATED_UseTranslucentUI="useTranslucentUI",e.DEPRECATED_AutoLightThemeIdentifier="autoLightThemeIdentifier",e.DEPRECATED_AutoDarkThemeIdentifier="autoDarkThemeIdentifier",e.DEPRECATED_EditorMonospaceEnabled="monospaceFont",e.DEPRECATED_EditorLineHeight="editorLineHeight",e.DEPRECATED_EditorLineWidth="editorLineWidth",e.DEPRECATED_EditorFontSize="editorFontSize"}(n||(t.PrefKey=n={}))},87070:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SNUserPrefs=void 0;const r=n(82648),i=n(43740),o=n(78688);class s extends i.DecryptedItem{get isSingleton(){return!0}singletonPredicate(){return s.singletonPredicate}getPref(e){return this.getAppDomainValue(e)}}t.SNUserPrefs=s,s.singletonPredicate=new o.Predicate("content_type","=",r.ContentType.TYPES.UserPrefs)},34660:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UserPrefsMutator=void 0;const r=n(14584);class i extends r.DecryptedItemMutator{setPref(e,t){this.setAppDataItem(e,t)}}t.UserPrefsMutator=i},53840:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(87070),t),i(n(34660),t),i(n(70659),t),i(n(97876),t),i(n(68933),t),i(n(20610),t),i(n(23688),t),i(n(79319),t),i(n(68126),t)},3396:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VaultListing=t.DefaultVaultIconName=void 0;const r=n(50292);t.DefaultVaultIconName="safe-square";class i extends r.DecryptedItem{constructor(e){super(e),this.systemIdentifier=e.content.systemIdentifier,this.rootKeyParams=e.content.rootKeyParams,this.keyStorageMode=e.content.keyStorageMode,this.name=e.content.name,this.description=e.content.description,this.iconString=e.content.iconString||t.DefaultVaultIconName,this.sharing=e.content.sharing}strategyWhenConflictingWithItem(e,t){const n=this.rootKeyParams.creationTimestamp;return e.rootKeyParams.creationTimestamp>n?r.ConflictStrategy.KeepApply:r.ConflictStrategy.KeepBase}get keyPasswordType(){return this.rootKeyParams.passwordType}isSharedVaultListing(){return null!=this.sharing}get key_system_identifier(){}get shared_vault_uuid(){}}t.VaultListing=i},52897:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},59402:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},82259:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VaultListingMutator=void 0;const r=n(50292);class i extends r.DecryptedItemMutator{set name(e){this.mutableContent.name=e}set description(e){this.mutableContent.description=e}set iconString(e){this.mutableContent.iconString=e}set sharing(e){this.mutableContent.sharing=e}set rootKeyParams(e){this.mutableContent.rootKeyParams=e}set keyStorageMode(e){this.mutableContent.keyStorageMode=e}}t.VaultListingMutator=i},44957:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},53555:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},40249:(e,t)=>{function n(e,t){return e.find((e=>e.uuid===t))}Object.defineProperty(t,"__esModule",{value:!0}),t.SureFindItem=t.FindItem=void 0,t.FindItem=n,t.SureFindItem=function(e,t){return n(e,t)}},33545:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ItemContentsDiffer=void 0;const r=n(41035);t.ItemContentsDiffer=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return!(0,r.ItemContentsEqual)(e.content,t.content,[...e.contentKeysToIgnoreWhenCheckingEquality(),...n],e.appDataContentKeysToIgnoreWhenCheckingEquality())}},41035:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ItemContentsEqual=void 0;const r=n(87901),i=n(71458);t.ItemContentsEqual=function(e,t,n,o){const s=(0,r.sortedCopy)(e);if(s.appData){const e=s.appData[i.DefaultAppDomain];(0,r.omitInPlace)(e,o),e?0===Object.keys(e).length&&delete s.appData:delete s.appData}(0,r.omitInPlace)(s,n);const a=(0,r.sortedCopy)(t);if(a.appData){const e=a.appData[i.DefaultAppDomain];(0,r.omitInPlace)(e,o),e?0===Object.keys(e).length&&delete a.appData:delete a.appData}return(0,r.omitInPlace)(a,n),JSON.stringify(s)===JSON.stringify(a)}},73277:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateItemFromPayload=t.CreateDecryptedItemFromPayload=t.RegisterItemClass=t.CreateDecryptedMutatorForItem=void 0;const r=n(80406),i=n(86154),o=n(73886),s=n(59020),a=n(35922),l=n(55159),c=n(43740),u=n(2636),d=n(12775),h=n(4862),p=n(87070),f=n(82422),g=n(34660),m=n(27539),y=n(43246),v=n(74332),A=n(39273),b=n(14584),w=n(78438),S=n(41138),C=n(79609),E=n(63195),I=n(82818),_=n(64836),x=n(3396),P=n(82259),k=n(59180),B=n(82648),O={[B.ContentType.TYPES.ActionsExtension]:{itemClass:s.SNActionsExtension,mutatorClass:m.ActionsExtensionMutator},[B.ContentType.TYPES.Component]:{itemClass:a.ComponentItem,mutatorClass:y.ComponentMutator},[B.ContentType.TYPES.KeySystemRootKey]:{itemClass:I.KeySystemRootKey,mutatorClass:_.KeySystemRootKeyMutator},[B.ContentType.TYPES.TrustedContact]:{itemClass:C.TrustedContact,mutatorClass:E.TrustedContactMutator},[B.ContentType.TYPES.VaultListing]:{itemClass:x.VaultListing,mutatorClass:P.VaultListingMutator},[B.ContentType.TYPES.Editor]:{itemClass:l.SNEditor},[B.ContentType.TYPES.ExtensionRepo]:{itemClass:o.SNFeatureRepo},[B.ContentType.TYPES.File]:{itemClass:i.FileItem,mutatorClass:f.FileMutator},[B.ContentType.TYPES.Note]:{itemClass:u.SNNote,mutatorClass:A.NoteMutator},[B.ContentType.TYPES.SmartView]:{itemClass:d.SmartView,mutatorClass:S.SmartViewMutator},[B.ContentType.TYPES.Tag]:{itemClass:h.SNTag,mutatorClass:v.TagMutator},[B.ContentType.TYPES.Theme]:{itemClass:a.ComponentItem,mutatorClass:y.ComponentMutator},[B.ContentType.TYPES.UserPrefs]:{itemClass:p.SNUserPrefs,mutatorClass:g.UserPrefsMutator}};function N(e){const t=O[e.content_type];return new(t?t.itemClass:c.DecryptedItem)(e)}t.CreateDecryptedMutatorForItem=function(e,t){var n;const r=null===(n=O[e.content_type])||void 0===n?void 0:n.mutatorClass;return r?new r(e,t):new b.DecryptedItemMutator(e,t)},t.RegisterItemClass=function(e,t,n){const r={itemClass:t,mutatorClass:n};O[e]=r},t.CreateDecryptedItemFromPayload=N,t.CreateItemFromPayload=function(e){if((0,k.isDecryptedPayload)(e))return N(e);if((0,k.isEncryptedPayload)(e))return new r.EncryptedItem(e);if((0,k.isDeletedPayload)(e))return new w.DeletedItem(e);throw Error("Unhandled case in CreateItemFromPayload")}},74527:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CopyPayloadWithContentOverride=void 0;const r=n(88141);t.CopyPayloadWithContentOverride=function(e,t){const n=Object.assign(Object.assign({},e.ejected()),{content:Object.assign(Object.assign({},e.content),t)});return(0,r.CreatePayload)(n,e.source)}},88141:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreatePayload=void 0;const r=n(86731),i=n(452),o=n(89262),s=n(78381);t.CreatePayload=function(e,t){if((0,s.isDecryptedTransferPayload)(e))return new o.DecryptedPayload(e,t);if((0,s.isEncryptedTransferPayload)(e))return new r.EncryptedPayload(e,t);if((0,s.isDeletedTransferPayload)(e))return new i.DeletedPayload(e,t);throw Error("Unhandled case in CreatePayload")}},15658:(e,t)=>{function n(e,t){return e.find((e=>e.uuid===t))}Object.defineProperty(t,"__esModule",{value:!0}),t.SureFindPayload=t.FindPayload=void 0,t.FindPayload=n,t.SureFindPayload=function(e,t){return n(e,t)}},37807:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadContentsEqual=void 0;const r=n(73277);t.PayloadContentsEqual=function(e,t){const n=(0,r.CreateDecryptedItemFromPayload)(e),i=(0,r.CreateDecryptedItemFromPayload)(t);return n.isItemContentEqualWith(i)}},50723:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateNonDecryptedPayloadSplit=t.CreatePayloadSplitWithDiscardables=t.CreatePayloadSplit=void 0;const r=n(13566);t.CreatePayloadSplit=function(e){const t={encrypted:[],decrypted:[],deleted:[]};for(const n of e)if((0,r.isDecryptedPayload)(n))t.decrypted.push(n);else if((0,r.isEncryptedPayload)(n))t.encrypted.push(n);else{if(!(0,r.isDeletedPayload)(n))throw Error("Unhandled case in CreatePayloadSplit");t.deleted.push(n)}return t},t.CreatePayloadSplitWithDiscardables=function(e){const t={encrypted:[],decrypted:[],deleted:[],discardable:[]};for(const n of e)if((0,r.isDecryptedPayload)(n))t.decrypted.push(n);else if((0,r.isEncryptedPayload)(n))t.encrypted.push(n);else{if(!(0,r.isDeletedPayload)(n))throw Error("Unhandled case in CreatePayloadSplitWithDiscardables");n.discardable?t.discardable.push(n):t.deleted.push(n)}return t},t.CreateNonDecryptedPayloadSplit=function(e){const t={encrypted:[],deleted:[]};for(const n of e)if((0,r.isEncryptedPayload)(n))t.encrypted.push(n);else{if(!(0,r.isDeletedPayload)(n))throw Error("Unhandled case in CreateNonDecryptedPayloadSplit");t.deleted.push(n)}return t}},15005:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadsByAlternatingUuid=void 0;const r=n(452),i=n(87901),o=n(13566),s=n(72208),a=n(13743),l=n(82648);t.PayloadsByAlternatingUuid=function(e,t){const n=[],c=e.copyAsSyncResolved({uuid:i.UuidGenerator.GenerateUuid(),dirty:!0,dirtyIndex:(0,a.getIncrementedDirtyIndex)(),lastSyncBegan:void 0,lastSyncEnd:new Date,duplicate_of:e.uuid});n.push(c);const u=(0,s.PayloadsByUpdatingReferencingPayloadReferences)(e,t,[c],[e.uuid]);if((0,i.extendArray)(n,u),e.content_type===l.ContentType.TYPES.ItemsKey){const r=t.all().filter((t=>(0,o.isEncryptedPayload)(t)&&t.items_key_id===e.uuid)).map((e=>e.copyAsSyncResolved({items_key_id:c.uuid,dirty:!0,dirtyIndex:(0,a.getIncrementedDirtyIndex)(),lastSyncEnd:new Date})));r.length>0&&(0,i.extendArray)(n,r)}const d=new r.DeletedPayload({created_at:e.created_at,updated_at:e.updated_at,created_at_timestamp:e.created_at_timestamp,updated_at_timestamp:e.updated_at_timestamp,dirty:!1,content:void 0,uuid:e.uuid,content_type:e.content_type,deleted:!0},e.source);return n.push(d),n}},27446:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadsByDuplicating=void 0;const r=n(87901),i=n(72208),o=n(13566),s=n(13743);t.PayloadsByDuplicating=function(e){const{payload:t,baseCollection:n,isConflict:a,additionalContent:l,source:c}=e,u=[],d={uuid:r.UuidGenerator.GenerateUuid(),dirty:!0,dirtyIndex:(0,s.getIncrementedDirtyIndex)(),lastSyncBegan:void 0,lastSyncEnd:new Date,duplicate_of:t.uuid};let h;if((0,o.isDecryptedPayload)(t)){const e=Object.assign(Object.assign({},t.content),l);a&&(e.conflict_of=t.uuid),h=t.copyAsSyncResolved(Object.assign(Object.assign({},d),{content:e,deleted:!1}))}else h=t.copyAsSyncResolved(Object.assign({},d),c||t.source);if(u.push(h),(0,o.isDecryptedPayload)(t)&&(0,o.isDecryptedPayload)(h)){const e=(0,i.PayloadsByUpdatingReferencingPayloadReferences)(t,n,[h]);(0,r.extendArray)(u,e)}return u}},72208:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PayloadsByUpdatingReferencingPayloadReferences=void 0;const r=n(84213),i=n(59180),o=n(13743);t.PayloadsByUpdatingReferencingPayloadReferences=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const a=t.elementsReferencingElement(e).filter(i.isDecryptedPayload),l=[];for(const t of a){const i=t.content.references.slice(),a=t.getReference(e.uuid);for(const e of n){const t=Object.assign(Object.assign({},a),{uuid:e.uuid,content_type:e.content_type});i.push(t)}for(const e of s)(0,r.remove)(i,{uuid:e});const c=t.copyAsSyncResolved({dirty:!0,dirtyIndex:(0,o.getIncrementedDirtyIndex)(),lastSyncEnd:new Date,content:Object.assign(Object.assign({},t.content),{references:i})});l.push(c)}return l}},64475:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(56974),t),i(n(15866),t),i(n(35376),t),i(n(76317),t),i(n(88076),t),i(n(68763),t),i(n(75895),t),i(n(74601),t),i(n(3668),t),i(n(42405),t),i(n(95698),t),i(n(55930),t),i(n(36186),t),i(n(80537),t),i(n(1482),t),i(n(69087),t),i(n(70359),t),i(n(13214),t),i(n(84034),t),i(n(51600),t),i(n(30429),t),i(n(18592),t),i(n(2116),t),i(n(18973),t),i(n(7563),t),i(n(50292),t),i(n(59180),t),i(n(78381),t),i(n(21907),t),i(n(66675),t),i(n(90656),t),i(n(93715),t),i(n(84457),t),i(n(656),t),i(n(255),t),i(n(62846),t),i(n(29899),t),i(n(22296),t),i(n(52174),t),i(n(80910),t),i(n(87192),t),i(n(71109),t),i(n(32099),t),i(n(55430),t),i(n(33738),t),i(n(64130),t),i(n(18018),t),i(n(14770),t),i(n(45698),t),i(n(63070),t),i(n(32151),t),i(n(92207),t),i(n(36883),t),i(n(17441),t),i(n(51833),t),i(n(19759),t),i(n(22517),t),i(n(13743),t),i(n(30561),t),i(n(40257),t),i(n(93974),t),i(n(96084),t),i(n(87332),t),i(n(21662),t),i(n(47469),t),i(n(74958),t),i(n(36053),t),i(n(18284),t),i(n(78274),t),i(n(47479),t),i(n(21626),t),i(n(8698),t),i(n(26550),t),i(n(80389),t),i(n(21271),t),i(n(21271),t),i(n(73067),t),i(n(21014),t),i(n(78688),t),i(n(58506),t),i(n(40826),t),i(n(52659),t),i(n(10123),t),i(n(12310),t),i(n(25698),t),i(n(87500),t),i(n(2836),t),i(n(52493),t),i(n(82412),t),i(n(23811),t),i(n(19725),t),i(n(82818),t),i(n(95132),t),i(n(31750),t),i(n(64836),t),i(n(28819),t),i(n(42006),t),i(n(41138),t),i(n(87458),t),i(n(82602),t),i(n(63195),t),i(n(68092),t),i(n(21436),t),i(n(79609),t),i(n(15845),t),i(n(5478),t),i(n(19332),t),i(n(53840),t),i(n(3396),t),i(n(52897),t),i(n(59402),t),i(n(82259),t),i(n(44957),t),i(n(53555),t),i(n(40249),t),i(n(33545),t),i(n(41035),t),i(n(73277),t),i(n(74527),t),i(n(88141),t),i(n(15658),t),i(n(37807),t),i(n(15005),t),i(n(27446),t),i(n(50723),t)},22325:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(64475),t)},34789:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},88645:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},29590:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},77345:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},79594:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},81563:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},29547:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},89398:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},41278:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},48126:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},60346:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},39881:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},11706:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},74113:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},68224:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},14116:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},22893:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},94764:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isClientDisplayableError=t.ClientDisplayableError=void 0;const r=n(92961);class i{constructor(e,t,n){this.text=e,this.title=t,this.tag=n,console.error("Client Displayable Error:",e,t||"",n||"")}static FromError(e){return new i(e.message,void 0,e.tag)}static FromString(e){return new i(e)}static FromNetworkError(e){return new i((0,r.getErrorFromErrorResponse)(e).message)}}t.ClientDisplayableError=i,t.isClientDisplayableError=function(e){return e instanceof i}},89408:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},23632:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},37525:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},22039:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},43129:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},27196:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},43630:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},53980:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},46707:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},13838:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},95573:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},42338:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},32176:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DeprecatedStatusCode=void 0,function(e){e[e.LocalValidationError=10]="LocalValidationError",e[e.CanceledMfa=11]="CanceledMfa",e[e.HttpStatusMinSuccess=200]="HttpStatusMinSuccess",e[e.HttpStatusNoContent=204]="HttpStatusNoContent",e[e.HttpStatusMaxSuccess=299]="HttpStatusMaxSuccess",e[e.HttpStatusExpiredAccessToken=498]="HttpStatusExpiredAccessToken",e[e.HttpStatusInvalidSession=401]="HttpStatusInvalidSession",e[e.HttpStatusForbidden=403]="HttpStatusForbidden",e[e.HttpBadRequest=400]="HttpBadRequest"}(n||(t.DeprecatedStatusCode=n={}))},67545:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorTag=void 0,function(e){e.MfaInvalid="mfa-invalid",e.MfaRequired="mfa-required",e.U2FRequired="u2f-required",e.RefreshTokenInvalid="invalid-refresh-token",e.RefreshTokenExpired="expired-refresh-token",e.AccessTokenExpired="expired-access-token",e.ParametersInvalid="invalid-parameters",e.RevokedSession="revoked-session",e.AuthInvalid="invalid-auth",e.ReadOnlyAccess="read-only-access",e.ExpiredItemShare="expired-item-share",e.ClientValidationError="client-validation-error",e.ClientCanceledMfa="client-canceled-mfa"}(n||(t.ErrorTag=n={}))},64404:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},48379:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},11910:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},44323:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},53251:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},23269:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorFromErrorResponse=t.getErrorMessageFromErrorResponseBody=t.getCaptchaHeader=t.isErrorResponse=void 0,t.isErrorResponse=function(e){var t;return null!=(null===(t=e.data)||void 0===t?void 0:t.error)||e.status>=400},t.getCaptchaHeader=function(e){var t;return(null===(t=e.headers)||void 0===t?void 0:t.get("x-captcha-required"))||null},t.getErrorMessageFromErrorResponseBody=function(e,t){let n=t||"Unknown error";return e&&"object"==typeof e&&"error"in e&&e.error&&"object"==typeof e.error&&"message"in e.error&&(n=e.error.message),n},t.getErrorFromErrorResponse=function(e){return e.data.error||{message:"Unknown error"}}},58009:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},95778:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.HttpStatusCode=void 0,function(e){e[e.Success=200]="Success",e[e.NoContent=204]="NoContent",e[e.MultipleChoices=300]="MultipleChoices",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.Forbidden=403]="Forbidden",e[e.Gone=410]="Gone",e[e.ExpiredAccessToken=498]="ExpiredAccessToken",e[e.InternalServerError=500]="InternalServerError"}(n||(t.HttpStatusCode=n={}))},37204:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.HttpVerb=void 0,function(e){e.Get="GET",e.Post="POST",e.Put="PUT",e.Patch="PATCH",e.Delete="DELETE"}(n||(t.HttpVerb=n={}))},92961:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(67545),t),i(n(48379),t),i(n(11910),t),i(n(44323),t),i(n(53251),t),i(n(23269),t),i(n(58009),t),i(n(37204),t),i(n(46707),t),i(n(13838),t),i(n(95573),t),i(n(42338),t),i(n(32176),t),i(n(95778),t),i(n(64404),t)},72646:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ApiEndpointParam=void 0,function(e){e.LastSyncToken="sync_token",e.PaginationToken="cursor_token",e.SyncDlLimit="limit",e.SyncPayloads="items",e.ApiVersion="api",e.SharedVaultUuids="shared_vault_uuids"}(n||(t.ApiEndpointParam=n={}))},21799:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6579:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.conflictParamsHasOnlyUnsavedItem=t.conflictParamsHasOnlyServerItem=t.conflictParamsHasServerItemAndUnsavedItem=void 0,t.conflictParamsHasServerItemAndUnsavedItem=function(e){return void 0!==e.server_item&&void 0!==e.unsaved_item},t.conflictParamsHasOnlyServerItem=function(e){return void 0!==e.server_item},t.conflictParamsHasOnlyUnsavedItem=function(e){return void 0!==e.unsaved_item}},68655:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ConflictType=void 0,function(e){e.ConflictingData="sync_conflict",e.UuidConflict="uuid_conflict",e.ContentTypeError="content_type_error",e.ContentError="content_error",e.ReadOnlyError="readonly_error",e.UuidError="uuid_error",e.InvalidServerItem="invalid_server_item",e.SharedVaultSnjsVersionError="shared_vault_snjs_version_error",e.SharedVaultInsufficientPermissionsError="shared_vault_insufficient_permissions_error",e.SharedVaultNotMemberError="shared_vault_not_member_error",e.SharedVaultInvalidState="shared_vault_invalid_state"}(n||(t.ConflictType=n={}))},95833:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},46911:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},20459:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),n(72646)},74397:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},80653:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},96579:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},42374:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},51658:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},22487:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},20421:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},20780:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},34455:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6976:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},1539:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},81526:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},13177:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},86682:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},2564:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ValetTokenOperation=void 0,function(e){e.Read="read",e.Write="write",e.Delete="delete",e.Move="move"}(n||(t.ValetTokenOperation=n={}))},98819:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},9283:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},39805:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},28022:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},80933:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},22906:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},65802:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},44877:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},13562:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},23324:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},35956:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88645),t),i(n(29590),t),i(n(77345),t),i(n(79594),t),i(n(29547),t),i(n(89398),t),i(n(41278),t),i(n(48126),t),i(n(60346),t),i(n(39881),t),i(n(11706),t),i(n(74113),t),i(n(68224),t),i(n(14116),t),i(n(22893),t),i(n(81563),t),i(n(13177),t),i(n(86682),t),i(n(2564),t),i(n(81526),t),i(n(94764),t),i(n(89408),t),i(n(23632),t),i(n(37525),t),i(n(22039),t),i(n(43129),t),i(n(43630),t),i(n(53980),t),i(n(27196),t),i(n(92961),t),i(n(34455),t),i(n(1539),t),i(n(6976),t),i(n(34789),t),i(n(72646),t),i(n(21799),t),i(n(6579),t),i(n(68655),t),i(n(95833),t),i(n(20459),t),i(n(74397),t),i(n(80653),t),i(n(46911),t),i(n(96579),t),i(n(42374),t),i(n(51658),t),i(n(22487),t),i(n(20421),t),i(n(98819),t),i(n(9283),t),i(n(39805),t),i(n(28022),t),i(n(80933),t),i(n(22906),t),i(n(65802),t),i(n(44877),t),i(n(13562),t),i(n(23324),t),i(n(20780),t),i(n(34455),t),i(n(6976),t),i(n(1539),t)},95658:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(35956),t)},55668:(e,t,n)=>{var r,i;n.d(t,{WLG:()=>re,gQA:()=>fe,qIx:()=>he,mvL:()=>ye,Zq2:()=>ce,EaW:()=>de,iMd:()=>ve,WZ6:()=>ge,BMD:()=>pe,oBV:()=>ue,aWs:()=>ie,Z15:()=>q,oe5:()=>$,VpG:()=>Z,Cj$:()=>W,TwN:()=>ee,gEn:()=>J,lO_:()=>oe,aXB:()=>le,TYJ:()=>ne,jN7:()=>ae,vfv:()=>te,z6z:()=>se,CV:()=>me,wcN:()=>f,nmV:()=>ei,oF7:()=>Br,c9N:()=>o,Sf$:()=>i,mxT:()=>mr,n9K:()=>L,U3K:()=>C,Ugm:()=>y,WXh:()=>x,El:()=>R,F8w:()=>U,D$B:()=>Fr,L$3:()=>r,V1G:()=>Pe,tv4:()=>Ge,gqK:()=>Ze,GnZ:()=>Re,FEo:()=>ze,fD2:()=>Ye,Ps8:()=>Ke,NiJ:()=>Qe,tQn:()=>He,EdL:()=>Ir,tuB:()=>Rr,KH1:()=>Qr,kQg:()=>We,euo:()=>zn,yqc:()=>tt,EFn:()=>Xe,b$E:()=>Zn,KL0:()=>qe,ocI:()=>An,D6l:()=>wn,Nwx:()=>Ut,Yw:()=>Kt,Dk4:()=>st,zEM:()=>Wn,TQm:()=>Vr,Y7C:()=>je,liL:()=>Be,vV3:()=>hn,ZXN:()=>pn,eyx:()=>Lt,suI:()=>Gt,zW4:()=>jt,nGw:()=>Dt,$M4:()=>Tt,EQN:()=>Mt,gzl:()=>zt,qXV:()=>Wt,CYv:()=>v,u4P:()=>A,z8s:()=>at,KLn:()=>Xn,jGD:()=>Jn,Rws:()=>Kr,X2V:()=>mi,WEs:()=>fn,Ydb:()=>_r,R53:()=>we,ZQj:()=>lt,S1n:()=>Ft,i6C:()=>Jt,k6d:()=>$t,C6q:()=>Ot,fa_:()=>It,kov:()=>Ue,iKc:()=>nn,Usi:()=>tn,aax:()=>Y,IpN:()=>ln,exs:()=>z,VD3:()=>ct,iPu:()=>Ht,ug$:()=>xr,s$_:()=>ut,KCz:()=>gn,DZq:()=>mn,cdY:()=>Pr,Vxn:()=>P,Byj:()=>Qt,qk9:()=>Rt,WUT:()=>k,tlz:()=>$n,Tog:()=>er,xOS:()=>St,pqE:()=>B,P9M:()=>O,dDs:()=>Hr,bDv:()=>yi,$qZ:()=>Gr,PDt:()=>vi,r0l:()=>Yr,qjc:()=>ht,cjV:()=>N,tGH:()=>un,$cH:()=>Ae,CVE:()=>Ee,nIe:()=>Ce,Ens:()=>vn,CEH:()=>pr,l4I:()=>gr,Bw1:()=>Ne,ezr:()=>bn,yim:()=>Sn,Ehg:()=>En,WNP:()=>l,KK4:()=>$e,BbS:()=>rt,RAe:()=>ni,Y8x:()=>kr,hEi:()=>Ai,o1e:()=>bi,hjk:()=>wi,uMm:()=>Cn,kNl:()=>ft,oQ4:()=>xn,UEW:()=>xt,Pn4:()=>Bn,mHn:()=>Ve,Z7G:()=>Si,Icj:()=>m,dH$:()=>On,sNv:()=>Dn,cZu:()=>zr,cU9:()=>h,gqp:()=>Tr,JQe:()=>Vn,cVV:()=>nr,_Bl:()=>Ie,WZd:()=>Nn,Klw:()=>D,Hh3:()=>jn,GUt:()=>Fe,vL5:()=>ke,Bq2:()=>u,HSp:()=>rn,rc1:()=>Te,fF_:()=>Zr,$sG:()=>fr,YxU:()=>Ei,xRL:()=>pt,HLD:()=>j,IF$:()=>T,F0Y:()=>ii,afr:()=>oi,s7t:()=>ai,t9U:()=>Ln,wtP:()=>Hn,PqX:()=>qr,TpP:()=>xe,Ld1:()=>ot,uzh:()=>M,u3X:()=>gt,$SL:()=>sr,Iup:()=>ci,Foy:()=>lr,VxG:()=>X,Pxr:()=>Qn,K9E:()=>Le,q62:()=>Or,uLb:()=>cr,cnh:()=>Yn,$_C:()=>Un,Mwm:()=>Me,kNs:()=>In,Bjn:()=>hr,rW4:()=>ur,QtK:()=>d,eIN:()=>Tn,qt7:()=>Mn,OC4:()=>De,LF2:()=>Sr,lKe:()=>yr,XEg:()=>Cr,wMo:()=>E,_Jh:()=>dr,YCg:()=>vr,BUK:()=>Er,Sii:()=>Ar,Lbd:()=>br,OU3:()=>G,I4j:()=>Oe,VnT:()=>Se,fnl:()=>be,RsP:()=>_e,KDu:()=>Dr,Lv2:()=>yt,EGP:()=>pi,dDH:()=>Fn,hZp:()=>hi,Z$T:()=>li,PHC:()=>gi,h21:()=>ui,RDE:()=>$r,ccW:()=>Jr,k7Z:()=>Ii,igb:()=>xi,UR5:()=>Ci,B5f:()=>en,BV4:()=>S,fAX:()=>s,ufS:()=>vt,qr4:()=>Je,dse:()=>Ct,Or9:()=>At,s2G:()=>Et,xLN:()=>g}),function(e){e[e.Info=0]="Info",e[e.Danger=1]="Danger"}(r||(r={}));class o{showErrorAlert(e){return this.alert(e.text,e.title)}}!function(e){e.MetaReceived="MetaReceived",e.SessionRefreshed="SessionRefreshed"}(i||(i={}));var s,a=n(95658);!function(e){e.UserRoleMessageReceived="WebSocketMessageReceived",e.NotificationAddedForUser="NotificationAddedForUser",e.MessageSentToUser="MessageSentToUser",e.UserInvitedToSharedVault="UserInvitedToSharedVault",e.ItemsChangedOnServer="ItemsChangedOnServer"}(s||(s={}));var l,c=n(87901);!function(e){e.ASYNC="ASYNC",e.SEQUENCE="SEQUENCE"}(l||(l={}));var u,d,h,p=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class f{constructor(e){this.internalEventBus=e,this.eventObservers=[],this.loggingEnabled=!1,this.criticalPromises=[],this.eventDisposers=[]}addEventObserver(e){this.eventObservers.push(e);const t=this.eventObservers;return()=>{(0,c.removeFromArray)(t,e)}}notifyEvent(e,t){var n;return p(this,void 0,void 0,(function*(){for(const n of this.eventObservers)yield n(e,t);null===(n=this.internalEventBus)||void 0===n||n.publish({type:e,payload:t})}))}notifyEventSync(e,t){var n;return p(this,void 0,void 0,(function*(){for(const n of this.eventObservers)yield n(e,t);yield null===(n=this.internalEventBus)||void 0===n?void 0:n.publishSync({type:e,payload:t},l.SEQUENCE)}))}getDiagnostics(){return Promise.resolve(void 0)}blockDeinit(){return p(this,void 0,void 0,(function*(){yield Promise.all(this.criticalPromises)}))}deinit(){this.eventObservers.length=0,this.internalEventBus=void 0,this.criticalPromises=void 0;for(const e of this.eventDisposers)e();this.eventDisposers=[]}executeCriticalFunction(e){return p(this,void 0,void 0,(function*(){const t=e();return this.criticalPromises.push(t),t}))}getServiceName(){return this.constructor.name}isApplicationService(){return!0}}function g(e,t){return"".concat(e,"-").concat(t)}!function(e){e.StorageObject="storage",e.DescriptorRecord="descriptors",e.SnjsVersion="snjs_version",e.HomeServerEnabled="home_server_enabled",e.HomeServerDataLocation="home_serve_data_location"}(u||(u={})),function(e){e.RootKeyParams="ROOT_KEY_PARAMS",e.WrappedRootKey="WRAPPED_ROOT_KEY",e.RootKeyWrapperKeyParams="ROOT_KEY_WRAPPER_KEY_PARAMS",e.Session="session",e.User="user",e.ServerHost="server",e.LegacyUuid="uuid",e.LastSyncToken="syncToken",e.PaginationToken="cursorToken",e.BiometricsState="biometrics_state",e.MobilePasscodeTiming="passcode_timing",e.MobileBiometricsTiming="biometrics_timing",e.MobilePasscodeKeyboardType="passcodeKeyboardType",e.MobilePreferences="preferences",e.MobileScreenshotPrivacyEnabled="screenshotPrivacy_enabled",e.ProtectionExpirey="SessionExpiresAtKey",e.ProtectionSessionLength="SessionLengthKey",e.KeyRecoveryUndecryptableItems="key_recovery_undecryptable",e.WebSocketUrl="webSocket_url",e.UserRoles="user_roles",e.OfflineUserRoles="offline_user_roles",e.ExperimentalFeatures="experimental_features",e.DeinitMode="deinit_mode",e.CodeVerifier="code_verifier",e.LaunchPriorityUuids="launch_priority_uuids",e.LastReadChangelogVersion="last_read_changelog_version",e.MomentsEnabled="moments_enabled",e.TextBackupsEnabled="text_backups_enabled",e.TextBackupsLocation="text_backups_location",e.PlaintextBackupsEnabled="plaintext_backups_enabled",e.PlaintextBackupsLocation="plaintext_backups_location",e.FileBackupsEnabled="file_backups_enabled",e.FileBackupsLocation="file_backups_location",e.VaultSelectionOptions="vault_selection_options",e.Subscription="subscription",e.LocalPreferences="local_preferences"}(d||(d={})),function(e){e.MobileFirstRun="first_run"}(h||(h={}));const m={WebPasscodeParamsKey:"offlineParams",MobilePasscodeParamsKey:"pc_params",AllAccountKeyParamsKey:"auth_params",WebEncryptedStorageKey:"encryptedStorage",MobileWrappedRootKeyKey:"encrypted_account_keys",MobileBiometricsPrefs:"biometrics_prefs",AllMigrations:"migrations",MobileThemesCache:"ThemePreferencesKey",MobileLightTheme:"lightTheme",MobileDarkTheme:"darkTheme",MobileLastExportDate:"LastExportDateKey",MobileDoNotWarnUnsupportedEditors:"DoNotShowAgainUnsupportedEditorsKey",MobileOptionsState:"options",MobilePasscodeKeyboardType:"passcodeKeyboardType"};var y,v,A,b=n(82648),w=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class S extends f{constructor(e,t,n,r){super(r),this.storageService=e,this.webSocketUrl=t,this.webSocketApiService=n,this.internalEventBus=r,this.CLOSE_CONNECTION_CODE=3123,this.HEARTBEAT_DELAY=36e4}setWebSocketUrl(e){this.webSocketUrl=e,this.storageService.setValue(d.WebSocketUrl,e)}loadWebSocketUrl(){const e=this.storageService.getValue(d.WebSocketUrl);this.webSocketUrl=e||this.webSocketUrl||window._websocket_url}startWebSocketConnection(){return w(this,void 0,void 0,(function*(){if(!this.webSocketUrl)return b.Result.fail("WebSocket URL is not set");const e=yield this.createWebSocketConnectionToken();if(void 0===e)return b.Result.fail("Failed to create WebSocket connection token");try{return this.webSocket=new WebSocket("".concat(this.webSocketUrl,"?authToken=").concat(e)),this.webSocket.onmessage=this.onWebSocketMessage.bind(this),this.webSocket.onclose=this.onWebSocketClose.bind(this),this.webSocket.onopen=this.beginWebSocketHeartbeat.bind(this),b.Result.ok()}catch(e){return b.Result.fail("Error starting WebSocket connection: ".concat(e.message))}}))}isWebSocketConnectionOpen(){var e;return(null===(e=this.webSocket)||void 0===e?void 0:e.readyState)===WebSocket.OPEN}closeWebSocketConnection(){var e;null===(e=this.webSocket)||void 0===e||e.close(this.CLOSE_CONNECTION_CODE,"Closing application")}beginWebSocketHeartbeat(){this.webSocketHeartbeatInterval=setInterval(this.websocketHeartbeat.bind(this),this.HEARTBEAT_DELAY)}websocketHeartbeat(){var e;(null===(e=this.webSocket)||void 0===e?void 0:e.readyState)===WebSocket.OPEN&&this.webSocket.send("ping")}onWebSocketMessage(e){const t=JSON.parse(e.data);switch(t.type){case"ITEMS_CHANGED_ON_SERVER":this.notifyEvent(s.ItemsChangedOnServer,t);break;case"USER_ROLES_CHANGED":this.notifyEvent(s.UserRoleMessageReceived,t);break;case"NOTIFICATION_ADDED_FOR_USER":this.notifyEvent(s.NotificationAddedForUser,t.payload);break;case"MESSAGE_SENT_TO_USER":this.notifyEvent(s.MessageSentToUser,t.payload);break;case"USER_INVITED_TO_SHARED_VAULT":this.notifyEvent(s.UserInvitedToSharedVault,t.payload)}}onWebSocketClose(e){var t;this.webSocketHeartbeatInterval&&clearInterval(this.webSocketHeartbeatInterval),this.webSocketHeartbeatInterval=void 0,e.code===this.CLOSE_CONNECTION_CODE?this.webSocket=void 0:(null===(t=this.webSocket)||void 0===t?void 0:t.readyState)===WebSocket.CLOSED&&this.startWebSocketConnection()}createWebSocketConnectionToken(){return w(this,void 0,void 0,(function*(){try{const e=yield this.webSocketApiService.createConnectionToken();return(0,a.isErrorResponse)(e)?void console.error(e.data.error):e.data.token}catch(e){return void console.error("Caught error:",e.message)}}))}deinit(){super.deinit(),this.storageService=void 0,this.webSocketApiService=void 0,this.closeWebSocketConnection()}}!function(e){e[e.PreparingForLaunch_0=0]="PreparingForLaunch_0",e[e.ReadyForLaunch_05=.5]="ReadyForLaunch_05",e[e.StorageDecrypted_09=.9]="StorageDecrypted_09",e[e.Launched_10=1]="Launched_10",e[e.LoadingDatabase_11=1.1]="LoadingDatabase_11",e[e.LoadedDatabase_12=1.2]="LoadedDatabase_12",e[e.FullSyncCompleted_13=1.3]="FullSyncCompleted_13",e[e.SignedIn_30=3]="SignedIn_30"}(y||(y={})),function(e){e.Soft="Soft",e.Hard="Hard"}(v||(v={})),function(e){e[e.SignOut=1]="SignOut",e[e.Lock=2]="Lock",e[e.SwitchWorkspace=3]="SwitchWorkspace",e[e.SignOutAll=4]="SignOutAll"}(A||(A={}));const C={loadBatchSize:700,sleepBetweenBatches:10,allowMultipleSelection:!0,allowNoteSelectionStatePersistence:!0};var E,I=n(22325);!function(e){e.SyncCompletedWithAllItemsUploaded="SyncCompletedWithAllItemsUploaded",e.SyncCompletedWithAllItemsUploadedAndDownloaded="SyncCompletedWithAllItemsUploadedAndDownloaded",e.PaginatedSyncRequestCompleted="PaginatedSyncRequestCompleted",e.SyncDidBeginProcessing="sync:did-begin-processing",e.DownloadFirstSyncCompleted="sync:download-first-completed",e.SyncTakingTooLong="sync:taking-too-long",e.SyncError="sync:error",e.InvalidSession="sync:invalid-session",e.MajorDataChange="major-data-change",e.LocalDataIncrementalLoad="local-data-incremental-load",e.LocalDataLoaded="local-data-loaded",e.EnterOutOfSync="enter-out-of-sync",e.ExitOutOfSync="exit-out-of-sync",e.StatusChanged="status-changed",e.DatabaseWriteError="database-write-error",e.DatabaseReadError="database-read-error",e.SyncRequestsIntegrityCheck="sync:requests-integrity-check",e.ReceivedRemoteSharedVaults="received-shared-vaults",e.ReceivedSharedVaultInvites="received-shared-vault-invites",e.ReceivedNotifications="received-user-events",e.ReceivedAsymmetricMessages="received-asymmetric-messages",e.TooManyRequests="too-many-requests"}(E||(E={}));var _=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class x extends f{constructor(e,t,n,r,i,o,s,a,l,c,u,d,h,p,f,g){super(g),this.encryption=e,this.mutator=t,this.sessions=n,this.sync=r,this.messageServer=i,this._createOrEditContact=o,this._findContact=s,this._replaceContactData=a,this._getTrustedPayload=l,this._getVault=c,this._handleRootKeyChangedMessage=u,this._getOutboundMessagesUseCase=d,this._getInboundMessagesUseCase=h,this._getUntrustedPayload=p,this._getKeyPairs=f,this.handledMessages=new Set}deinit(){super.deinit(),this.messageServer=void 0,this.encryption=void 0,this.mutator=void 0,this._createOrEditContact=void 0,this._findContact=void 0,this._replaceContactData=void 0,this._getTrustedPayload=void 0,this._getVault=void 0,this._handleRootKeyChangedMessage=void 0,this._getOutboundMessagesUseCase=void 0,this._getInboundMessagesUseCase=void 0,this._getUntrustedPayload=void 0}handleEvent(e){return _(this,void 0,void 0,(function*(){switch(e.type){case E.ReceivedAsymmetricMessages:this.handleRemoteReceivedAsymmetricMessages(e.payload);break;case s.MessageSentToUser:this.handleRemoteReceivedAsymmetricMessages([e.payload.message])}}))}getOutboundMessages(){return _(this,void 0,void 0,(function*(){return this._getOutboundMessagesUseCase.execute()}))}getInboundMessages(){return _(this,void 0,void 0,(function*(){return this._getInboundMessagesUseCase.execute()}))}downloadAndProcessInboundMessages(){return _(this,void 0,void 0,(function*(){const e=yield this.getInboundMessages();e.isFailed()||(yield this.handleRemoteReceivedAsymmetricMessages(e.getValue()))}))}sortServerMessages(e){const t=[I.AsymmetricMessagePayloadType.SenderKeypairChanged],n=[],r=[],i=e.slice().sort(((e,t)=>e.created_at_timestamp-t.created_at_timestamp)),o={};for(const e of i){const i=this.getServerMessageType(e);i&&(o[e.uuid]=i,t.includes(i)?n.push(e):r.push(e))}return[...n.sort(((e,n)=>{const r=o[e.uuid],i=o[n.uuid];return r!==i?t.indexOf(r)-t.indexOf(i):e.created_at_timestamp-n.created_at_timestamp})),...r.sort(((e,t)=>e.created_at_timestamp-t.created_at_timestamp))]}getServerMessageType(e){const t=this.getUntrustedMessagePayload(e);if(!t.isFailed())return t.getValue().type}handleRemoteReceivedAsymmetricMessages(e){return _(this,void 0,void 0,(function*(){if(0===e.length)return;const t=this.sortServerMessages(e);for(const e of t){const t=this.getTrustedMessagePayload(e);t.isFailed()||(yield this.handleTrustedMessageResult(e,t.getValue()))}this.sync.sync()}))}handleTrustedMessageResult(e,t){return _(this,void 0,void 0,(function*(){if(!this.handledMessages.has(e.uuid)){if(this.handledMessages.add(e.uuid),t.type===I.AsymmetricMessagePayloadType.ContactShare)yield this.handleTrustedContactShareMessage(e,t);else if(t.type===I.AsymmetricMessagePayloadType.SenderKeypairChanged)yield this.handleTrustedSenderKeypairChangedMessage(e,t);else if(t.type===I.AsymmetricMessagePayloadType.SharedVaultRootKeyChanged)yield this.handleTrustedSharedVaultRootKeyChangedMessage(e,t);else if(t.type===I.AsymmetricMessagePayloadType.SharedVaultMetadataChanged)yield this.handleTrustedVaultMetadataChangedMessage(e,t);else if(t.type===I.AsymmetricMessagePayloadType.SharedVaultInvite)throw new Error("Shared vault invites payloads are not handled as part of asymmetric messages");yield this.deleteMessageAfterProcessing(e)}}))}getUntrustedMessagePayload(e){const t=this._getKeyPairs.execute();if(t.isFailed())return b.Result.fail(t.getError());const n=this._getUntrustedPayload.execute({privateKey:t.getValue().encryption.privateKey,payload:e});return n.isFailed()?b.Result.fail(n.getError()):n}getTrustedMessagePayload(e){const t=this._findContact.execute({userUuid:e.sender_uuid});if(t.isFailed())return b.Result.fail(t.getError());const n=this._getKeyPairs.execute();if(n.isFailed())return b.Result.fail(n.getError());const r=this._getTrustedPayload.execute({privateKey:n.getValue().encryption.privateKey,sender:t.getValue(),ownUserUuid:this.sessions.userUuid,payload:e});return r.isFailed()?b.Result.fail(r.getError()):r}deleteMessageAfterProcessing(e){return _(this,void 0,void 0,(function*(){yield this.messageServer.deleteMessage({messageUuid:e.uuid})}))}handleTrustedVaultMetadataChangedMessage(e,t){return _(this,void 0,void 0,(function*(){const e=this._getVault.execute({sharedVaultUuid:t.data.sharedVaultUuid});e.isFailed()||(yield this.mutator.changeItem(e.getValue(),(e=>{e.name=t.data.name,e.description=t.data.description}),I.MutationType.UpdateUserTimestamps,I.PayloadEmitSource.RemoteRetrieved))}))}handleTrustedContactShareMessage(e,t){return _(this,void 0,void 0,(function*(){t.data.trustedContact.isMe||(yield this._replaceContactData.execute(t.data.trustedContact))}))}handleTrustedSenderKeypairChangedMessage(e,t){return _(this,void 0,void 0,(function*(){yield this._createOrEditContact.execute({contactUuid:e.sender_uuid,publicKey:t.data.newEncryptionPublicKey,signingPublicKey:t.data.newSigningPublicKey})}))}handleTrustedSharedVaultRootKeyChangedMessage(e,t){return _(this,void 0,void 0,(function*(){yield this._handleRootKeyChangedMessage.execute(t)}))}}class P{constructor(e){this.messageServer=e}execute(){return e=this,t=void 0,r=function*(){const e=yield this.messageServer.getMessages();return(0,a.isErrorResponse)(e)?b.Result.fail((0,a.getErrorFromErrorResponse)(e).message):b.Result.ok(e.data.messages)},new((n=void 0)||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}));var e,t,n,r}}class k{constructor(e){this.messageServer=e}execute(){return e=this,t=void 0,r=function*(){const e=yield this.messageServer.getOutboundUserMessages();return(0,a.isErrorResponse)(e)?b.Result.fail((0,a.getErrorFromErrorResponse)(e).message):b.Result.ok(e.data.messages)},new((n=void 0)||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}));var e,t,n,r}}class B{constructor(e){this.decryptMessage=e}execute(e){const t=this.decryptMessage.execute({message:e.payload.encrypted_message,sender:e.sender,privateKey:e.privateKey});return t.isFailed()?t:t.getValue().data.recipientUuid!==e.ownUserUuid?b.Result.fail("Message is not for this user"):t}}class O{constructor(e){this.decryptMessage=e}execute(e){return this.decryptMessage.execute({message:e.payload.encrypted_message,sender:void 0,privateKey:e.privateKey})}}class N{constructor(e,t,n,r){this.mutator=e,this.sync=t,this._getVault=n,this._decryptErroredPayloads=r}execute(e){return t=this,n=void 0,i=function*(){const t=e.data.rootKey;yield this.mutator.createItem(b.ContentType.TYPES.KeySystemRootKey,(0,I.FillItemContent)(t),!0);const n=this._getVault.execute({keySystemIdentifier:t.systemIdentifier});n.isFailed()||(yield this.mutator.changeItem(n.getValue(),(e=>{e.rootKeyParams=t.keyParams}))),yield this._decryptErroredPayloads.execute(),this.sync.sync({sourceDescription:"Not awaiting due to this event handler running from sync response"})},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class D{constructor(e,t,n){this.mutator=e,this.sync=t,this._createOrEditContact=n}execute(e,t,n){return r=this,i=void 0,s=function*(){const{rootKey:r,trustedContacts:i,metadata:o}=e.data,s={systemIdentifier:r.systemIdentifier,rootKeyParams:r.keyParams,keyStorageMode:I.KeySystemRootKeyStorageMode.Synced,name:o.name,description:o.description,iconString:o.iconString,sharing:{sharedVaultUuid:t,ownerUserUuid:n,fileBytesUsed:o.fileBytesUsed,designatedSurvivor:o.designatedSurvivor}};yield this.mutator.createItem(b.ContentType.TYPES.KeySystemRootKey,(0,I.FillItemContent)(r),!0),yield this.mutator.createItem(b.ContentType.TYPES.VaultListing,(0,I.FillItemContentSpecialized)(s),!0);for(const e of i)yield this._createOrEditContact.execute({name:e.name,contactUuid:e.contactUuid,publicKey:e.publicKeySet.encryption,signingPublicKey:e.publicKeySet.signing});this.sync.sync({sourceDescription:"Not awaiting due to this event handler running from sync response"})},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(n,a)}l((s=s.apply(r,i||[])).next())}));var r,i,o,s}}class j{constructor(e,t,n,r){this.resendMessage=e,this.decryptOwnMessage=t,this.messageServer=n,this.findContact=r}messagesToExcludeFromResending(){return[I.AsymmetricMessagePayloadType.SenderKeypairChanged]}execute(e){var t,n,r,i,o,s;return r=this,i=void 0,s=function*(){const r=yield this.messageServer.getOutboundUserMessages();if((0,a.isErrorResponse)(r))return b.Result.fail("Failed to get outbound user messages");const i=[];for(const o of r.data.messages){const r=this.findContact.execute({userUuid:o.recipient_uuid});if(r.isFailed()){i.push("Contact not found for invite ".concat(o.recipient_uuid));continue}const s=this.decryptOwnMessage.execute({message:o.encrypted_message,privateKey:null!==(n=null===(t=e.previousKeys)||void 0===t?void 0:t.encryption.privateKey)&&void 0!==n?n:e.keys.encryption.privateKey,recipientPublicKey:r.getValue().publicKeySet.encryption});if(s.isFailed()){i.push("Failed to decrypt message ".concat(o.uuid));continue}const a=s.getValue();this.messagesToExcludeFromResending().includes(a.type)||(yield this.resendMessage.execute({keys:e.keys,previousKeys:e.previousKeys,decryptedMessage:a,rawMessage:o,recipient:r.getValue()}),yield this.messageServer.deleteMessage({messageUuid:o.uuid}))}return i.length>0?b.Result.fail(i.join(", ")):b.Result.ok()},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(n,a)}l((s=s.apply(r,i||[])).next())}))}}class T{constructor(e,t){this.sendMessage=e,this.encryptMessage=t}execute(e){return t=this,n=void 0,i=function*(){const t=this.encryptMessage.execute({message:e.decryptedMessage,keys:e.keys,recipientPublicKey:e.recipient.publicKeySet.encryption});return t.isFailed()?b.Result.fail(t.getError()):yield this.sendMessage.execute({recipientUuid:e.recipient.contactUuid,encryptedMessage:t.getValue(),replaceabilityIdentifier:e.rawMessage.replaceability_identifier||void 0})},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class M{constructor(e){this.messageServer=e}execute(e){return t=this,n=void 0,i=function*(){const t=yield this.messageServer.createMessage({recipientUuid:e.recipientUuid,encryptedMessage:e.encryptedMessage,replaceabilityIdentifier:e.replaceabilityIdentifier});return(0,a.isErrorResponse)(t)?b.Result.fail((0,a.getErrorFromErrorResponse)(t).message):b.Result.ok(t.data.message)},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}var F=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class R extends f{constructor(e,t){super(t),this.authApiService=e,this.internalEventBus=t}generateRecoveryCodes(){return F(this,void 0,void 0,(function*(){try{const e=yield this.authApiService.generateRecoveryCodes();return!(0,a.isErrorResponse)(e)&&e.data.recoveryCodes}catch(e){return!1}}))}recoveryKeyParams(e){return F(this,void 0,void 0,(function*(){try{const t=yield this.authApiService.recoveryKeyParams(e);return!(0,a.isErrorResponse)(t)&&t.data.keyParams}catch(e){return!1}}))}signInWithRecoveryCodes(e){return F(this,void 0,void 0,(function*(){try{const t=yield this.authApiService.signInWithRecoveryCodes(e),n=(0,a.getCaptchaHeader)(t);return n?{success:!1,captchaURL:n}:(0,a.isErrorResponse)(t)?{success:!1,captchaURL:""}:{success:!0,keyParams:t.data.key_params,session:t.data.session,user:t.data.user}}catch(e){return{success:!1,captchaURL:""}}}))}}var L,Q=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class U extends f{constructor(e,t,n){super(n),this.authenticatorApiService=e,this.preferencesService=t,this.internalEventBus=n}list(){return Q(this,void 0,void 0,(function*(){try{const e=yield this.authenticatorApiService.list();if((0,a.isErrorResponse)(e))return[];const t=this.getAuthenticatorNamesFromPreferences();return e.data.authenticators.map((e=>({id:e.id,name:t.has(e.id)?t.get(e.id):"Security Key"})))}catch(e){return[]}}))}delete(e){return Q(this,void 0,void 0,(function*(){try{const t=yield this.authenticatorApiService.delete(e.value);if((0,a.isErrorResponse)(t))return!1;const n=this.getAuthenticatorNamesFromPreferences();return n.delete(e.value),yield this.preferencesService.setValue(I.PrefKey.AuthenticatorNames,JSON.stringify([...n])),!0}catch(e){return!1}}))}generateRegistrationOptions(){return Q(this,void 0,void 0,(function*(){try{const e=yield this.authenticatorApiService.generateRegistrationOptions();return(0,a.isErrorResponse)(e)?null:e.data.options}catch(e){return null}}))}verifyRegistrationResponse(e,t,n){return Q(this,void 0,void 0,(function*(){try{const r=yield this.authenticatorApiService.verifyRegistrationResponse(e.value,t,n);if((0,a.isErrorResponse)(r))return!1;const i=this.getAuthenticatorNamesFromPreferences();return i.set(r.data.id,t),yield this.preferencesService.setValue(I.PrefKey.AuthenticatorNames,JSON.stringify([...i])),!0}catch(e){return!1}}))}generateAuthenticationOptions(e){return Q(this,void 0,void 0,(function*(){try{const t=yield this.authenticatorApiService.generateAuthenticationOptions(e.value);return(0,a.isErrorResponse)(t)?null:t.data.options}catch(e){return null}}))}getAuthenticatorNamesFromPreferences(){let e=new Map;const t=this.preferencesService.getValue(I.PrefKey.AuthenticatorNames);if(void 0!==t)try{e=new Map(JSON.parse(t))}catch(t){e=new Map}return e}}!function(e){e.SignedIn="Application:SignedIn",e.SignedOut="Application:SignedOut",e.CompletedFullSync="Application:CompletedFullSync",e.FailedSync="Application:FailedSync",e.HighLatencySync="Application:HighLatencySync",e.EnteredOutOfSync="Application:EnteredOutOfSync",e.ExitedOutOfSync="Application:ExitedOutOfSync",e.ApplicationStageChanged="Application:ApplicationStageChanged",e.Started="Application:Started",e.Launched="Application:Launched",e.LocalDataLoaded="Application:LocalDataLoaded",e.KeyStatusChanged="Application:KeyStatusChanged",e.MajorDataChange="Application:MajorDataChange",e.CompletedRestart="Application:CompletedRestart",e.LocalDataIncrementalLoad="Application:LocalDataIncrementalLoad",e.SyncStatusChanged="Application:SyncStatusChanged",e.WillSync="Application:WillSync",e.InvalidSyncSession="Application:InvalidSyncSession",e.LocalDatabaseReadError="Application:LocalDatabaseReadError",e.LocalDatabaseWriteError="Application:LocalDatabaseWriteError",e.CompletedIncrementalSync="Application:CompletedIncrementalSync",e.MigrationsLoaded="Application:MigrationsLoaded",e.StorageReady="Application:StorageReady",e.PreferencesChanged="Application:PreferencesChanged",e.LocalPreferencesChanged="Application:LocalPreferencesChanged",e.UnprotectedSessionBegan="Application:UnprotectedSessionBegan",e.UserRolesChanged="Application:UserRolesChanged",e.FeaturesAvailabilityChanged="Application:FeaturesAvailabilityChanged",e.UnprotectedSessionExpired="Application:UnprotectedSessionExpired",e.CompletedInitialSync="Application:CompletedInitialSync",e.DidPurchaseSubscription="Application:DidPurchaseSubscription",e.SyncTooManyRequests="Application:SyncTooManyRequests"}(L||(L={}));var V=n(80215),K=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};const H="Plaintext Backups",G="Text Backups",Y="File Backups";class z extends f{constructor(e,t,n,r,i,o,s,a,l,c,u,d){super(d),this.items=e,this.api=t,this.encryptor=n,this.device=r,this.status=i,this.crypto=o,this.storage=s,this.session=a,this.payloads=l,this.history=c,this.directory=u,this.internalEventBus=d,this.pendingFiles=new Set,this.filesObserverDisposer=e.addObserver(b.ContentType.TYPES.File,(e=>{let{changed:t,inserted:n,source:r}=e;[I.PayloadEmitSource.LocalDatabaseLoaded,I.PayloadEmitSource.RemoteSaved,I.PayloadEmitSource.RemoteRetrieved].includes(r)&&this.handleChangedFiles([...t,...n])}));const h=[I.PayloadEmitSource.RemoteSaved,I.PayloadEmitSource.RemoteRetrieved,I.PayloadEmitSource.OfflineSyncSaved];this.notesObserverDisposer=e.addObserver(b.ContentType.TYPES.Note,(e=>{let{changed:t,inserted:n,source:r}=e;h.includes(r)&&this.handleChangedNotes([...t,...n])})),this.tagsObserverDisposer=e.addObserver(b.ContentType.TYPES.Tag,(e=>{let{changed:t,inserted:n,source:r}=e;h.includes(r)&&this.handleChangedTags([...t,...n])}))}handleEvent(e){return K(this,void 0,void 0,(function*(){e.type===L.ApplicationStageChanged&&e.payload.stage===y.Launched_10&&this.automaticallyEnableTextBackupsIfPreferenceNotSet()}))}setSuperConverter(e){this.markdownConverter=e}importWatchedDirectoryChanges(e){return K(this,void 0,void 0,(function*(){for(const t of e){const e=this.items.findItem(t.itemUuid);if(!e)continue;if(!(0,I.isNote)(e))continue;const n=Object.assign(Object.assign({},e.payload.content),{preview_html:void 0,preview_plain:void 0,text:t.content}),r=e.payload.copy({content:n});yield this.payloads.importPayloads([r],this.history.getHistoryMapCopy())}}))}deinit(){super.deinit(),this.filesObserverDisposer(),this.notesObserverDisposer(),this.tagsObserverDisposer(),this.items=void 0,this.api=void 0,this.encryptor=void 0,this.device=void 0,this.status=void 0,this.crypto=void 0,this.storage=void 0,this.session=void 0}automaticallyEnableTextBackupsIfPreferenceNotSet(){return K(this,void 0,void 0,(function*(){if(null!=this.storage.getValue(d.TextBackupsEnabled))return;this.storage.setValue(d.TextBackupsEnabled,!0);const e=yield this.device.getUserDocumentsDirectory();if(!e)return;const t=yield this.device.joinPaths(e,yield this.prependWorkspacePathForPath(G));this.storage.setValue(d.TextBackupsLocation,t)}))}openAllDirectoriesContainingBackupFiles(){const e=this.getFilesBackupsLocation(),t=this.getPlaintextBackupsLocation(),n=this.getTextBackupsLocation();e&&this.directory.openLocation(e),t&&this.directory.openLocation(t),n&&this.directory.openLocation(n)}isFilesBackupsEnabled(){return this.storage.getValue(d.FileBackupsEnabled,void 0,!1)}getFilesBackupsLocation(){return this.storage.getValue(d.FileBackupsLocation)}isTextBackupsEnabled(){return this.storage.getValue(d.TextBackupsEnabled,void 0,!0)}prependWorkspacePathForPath(e){return K(this,void 0,void 0,(function*(){const t=this.session.getWorkspaceDisplayIdentifier();return this.device.joinPaths(t,e)}))}enableTextBackups(){return K(this,void 0,void 0,(function*(){let e=this.getTextBackupsLocation();(e||(e=yield this.directory.presentDirectoryPickerForLocationChangeAndTransferOld(yield this.prependWorkspacePathForPath(G)),e))&&(this.storage.setValue(d.TextBackupsEnabled,!0),this.storage.setValue(d.TextBackupsLocation,e))}))}disableTextBackups(){this.storage.setValue(d.TextBackupsEnabled,!1)}getTextBackupsLocation(){return this.storage.getValue(d.TextBackupsLocation)}openTextBackupsLocation(){return K(this,void 0,void 0,(function*(){const e=this.getTextBackupsLocation();e&&this.directory.openLocation(e)}))}changeTextBackupsLocation(){return K(this,void 0,void 0,(function*(){const e=this.getTextBackupsLocation(),t=yield this.directory.presentDirectoryPickerForLocationChangeAndTransferOld(yield this.prependWorkspacePathForPath(G),e);if(t)return this.storage.setValue(d.TextBackupsLocation,t),t}))}saveTextBackupData(e){return K(this,void 0,void 0,(function*(){const t=this.getTextBackupsLocation();if(t)return this.device.saveTextBackupData(t,e)}))}isPlaintextBackupsEnabled(){return this.storage.getValue(d.PlaintextBackupsEnabled,void 0,!1)}enablePlaintextBackups(){return K(this,void 0,void 0,(function*(){let e=this.getPlaintextBackupsLocation();(e||(e=yield this.directory.presentDirectoryPickerForLocationChangeAndTransferOld(yield this.prependWorkspacePathForPath(H)),e))&&(this.storage.setValue(d.PlaintextBackupsEnabled,!0),this.storage.setValue(d.PlaintextBackupsLocation,e),this.handleChangedNotes(this.items.getItems(b.ContentType.TYPES.Note)))}))}disablePlaintextBackups(){this.storage.setValue(d.PlaintextBackupsEnabled,!1),this.storage.setValue(d.PlaintextBackupsLocation,void 0)}getPlaintextBackupsLocation(){return this.storage.getValue(d.PlaintextBackupsLocation)}openPlaintextBackupsLocation(){return K(this,void 0,void 0,(function*(){const e=this.getPlaintextBackupsLocation();e&&this.directory.openLocation(e)}))}changePlaintextBackupsLocation(){return K(this,void 0,void 0,(function*(){const e=this.getPlaintextBackupsLocation(),t=yield this.directory.presentDirectoryPickerForLocationChangeAndTransferOld(yield this.prependWorkspacePathForPath(H),e);if(t)return this.storage.setValue(d.PlaintextBackupsLocation,t),t}))}enableFilesBackups(){return K(this,void 0,void 0,(function*(){let e=this.getFilesBackupsLocation();(e||(e=yield this.directory.presentDirectoryPickerForLocationChangeAndTransferOld(yield this.prependWorkspacePathForPath(Y)),e))&&(this.storage.setValue(d.FileBackupsEnabled,!0),this.storage.setValue(d.FileBackupsLocation,e),this.backupAllFiles())}))}backupAllFiles(){const e=this.items.getItems(b.ContentType.TYPES.File);this.handleChangedFiles(e)}disableFilesBackups(){this.storage.setValue(d.FileBackupsEnabled,!1)}changeFilesBackupsLocation(){return K(this,void 0,void 0,(function*(){const e=this.getFilesBackupsLocation(),t=yield this.directory.presentDirectoryPickerForLocationChangeAndTransferOld(yield this.prependWorkspacePathForPath(Y),e);if(t)return this.storage.setValue(d.FileBackupsLocation,t),t}))}openFilesBackupsLocation(){return K(this,void 0,void 0,(function*(){const e=this.getFilesBackupsLocation();e&&this.directory.openLocation(e)}))}getBackupsMappingFromDisk(){return K(this,void 0,void 0,(function*(){const e=this.getFilesBackupsLocation();if(!e)return;const t=(yield this.device.getFilesBackupsMappingFile(e)).files;return this.mappingCache=t,t}))}invalidateMappingCache(){this.mappingCache=void 0}getBackupsMappingFromCache(){var e;return K(this,void 0,void 0,(function*(){return null!==(e=this.mappingCache)&&void 0!==e?e:yield this.getBackupsMappingFromDisk()}))}getFileBackupInfo(e){return K(this,void 0,void 0,(function*(){const t=yield this.getBackupsMappingFromCache();if(t)return t[e.uuid]}))}getFileBackupAbsolutePath(e){const t=this.getFilesBackupsLocation();if(!t)throw new a.ClientDisplayableError("No files backups location set");return this.device.joinPaths(t,e.relativePath)}openFileBackup(e){return K(this,void 0,void 0,(function*(){const t=yield this.getFileBackupAbsolutePath(e);yield this.directory.openLocation(t)}))}handleChangedFiles(e){return K(this,void 0,void 0,(function*(){if(0===e.length||!this.isFilesBackupsEnabled())return;const t=yield this.getBackupsMappingFromDisk();if(!t)throw new a.ClientDisplayableError("No backups mapping found");for(const n of e)this.pendingFiles.has(n.uuid)||null==t[n.uuid]&&(this.pendingFiles.add(n.uuid),yield this.performBackupOperation(n),this.pendingFiles.delete(n.uuid));this.invalidateMappingCache()}))}handleChangedNotes(e){return K(this,void 0,void 0,(function*(){if(0===e.length||!this.isPlaintextBackupsEnabled())return;const t=this.getPlaintextBackupsLocation();if(!t)throw new a.ClientDisplayableError("No plaintext backups location found");if(!this.markdownConverter)throw"Super markdown converter not initialized";for(const n of e){const e=this.items.getSortedTagsForItem(n).map((e=>this.items.getTagLongTitle(e))),r=n.noteType===V.NoteType.Super?yield this.markdownConverter.convertSuperStringToOtherFormat(n.text,"md"):n.text;yield this.device.savePlaintextNoteBackup(t,n.uuid,n.title,e,r)}yield this.device.persistPlaintextBackupsMappingFile(t)}))}handleChangedTags(e){return K(this,void 0,void 0,(function*(){if(0!==e.length&&this.isPlaintextBackupsEnabled())for(const t of e){const e=this.items.referencesForItem(t,b.ContentType.TYPES.Note);yield this.handleChangedNotes(e)}}))}readEncryptedFileFromBackup(e,t){return K(this,void 0,void 0,(function*(){const n=yield this.getFileBackupInfo({uuid:e});if(!n)return"failed";const r=this.getFilesBackupsLocation();if(!r)return"failed";const i=yield this.device.joinPaths(r,n.relativePath,n.binaryFileName),o=yield this.device.getFileBackupReadToken(i);let s=!0,a=0;for(;s;){const{chunk:e,isLast:n,progress:r}=yield this.device.readNextChunk(o);yield t({data:e,index:a,isLast:n,progress:r}),s=!n,a++}return"success"}))}performBackupOperation(e){return K(this,void 0,void 0,(function*(){const t=this.getFilesBackupsLocation();if(!t)return"failed";const n=this.status.addMessage("Backing up file ".concat(e.name,"...")),r=yield this.encryptor.encryptSplitSingle({usesItemsKeyWithKeyLookup:{items:[e.payload]}}),i=this.items.getDisplayableItemsKeys().find((e=>e.uuid===r.items_key_id));if(!i)return this.status.removeMessage(n),"failed";const o=yield this.encryptor.encryptSplitSingle({usesRootKeyWithKeyLookup:{items:[i.payload]}}),s=yield this.api.createUserFileValetToken(e.remoteIdentifier,a.ValetTokenOperation.Read);if(s instanceof a.ClientDisplayableError)return this.status.removeMessage(n),"failed";const l={info:{warning:"Do not edit this file.",information:"The file and key data below is encrypted with your account password.",instructions:"Drag and drop this metadata file into the File Backups preferences pane in the Standard Notes desktop or web application interface."},file:(0,I.CreateEncryptedBackupFileContextPayload)(r.ejected()),itemsKey:(0,I.CreateEncryptedBackupFileContextPayload)(o.ejected()),version:"1.0.0"},c=JSON.stringify(l,null,2),u=e.user_uuid&&e.user_uuid!==this.session.getSureUser().uuid?"shared-vault":"user",d=yield this.device.saveFilesBackupsFile(t,e.uuid,c,{chunkSizes:e.encryptedChunkSizes,url:this.api.getFilesDownloadUrl(u),valetToken:s});if(this.status.removeMessage(n),"failed"===d){const t=this.status.addMessage("Failed to back up ".concat(e.name,"..."));setTimeout((()=>{this.status.removeMessage(t)}),2e3)}return d}))}disabledExperimental_monitorPlaintextBackups(){const e=this.getPlaintextBackupsLocation();e&&this.device.monitorPlaintextBackupsLocationForChanges(e)}}const Z="A server error occurred while trying to sign in. Please try again.",W="A server error occurred while trying to register. Please try again.",q="Something went wrong while changing your credentials. Your credentials were not changed. Please try again.",J="Could not connect to server.",X={DeleteAccountError:"Your account was unable to be deleted due to an error. Please try your request again."},$="Could not check your data integrity with the server.",ee="Could not retrieve item.",te="An existing registration request is already in progress.",ne="An existing sign in request is already in progress.",re="An existing change credentials request is already in progress.",ie="Invalid email or password.",oe="A server error occurred while trying to refresh your session. Please try again.",se="Your account session is being renewed with the server. Please try your request again.",ae="Too many successive server requests. Please wait a few minutes and try again.",le="Please sign in to an account in order to continue with your request.",ce="Failed to get settings.",ue="Failed to update settings.",de="Unable to register for Listed. Please try again later.",he="Failed to create file token.",pe="Failed to get subscription's information.",fe="Failed to access purchase flow.",ge="Failed to get offline features.",me="The extension you are attempting to install comes from an\n  untrusted source. Untrusted extensions may lower the security of your data. Do you want to continue?",ye="Error downloading package details. Please check the\n  extension link and try again.",ve="An unknown issue occurred during offline activation. Please download your activation code again and try once more.",Ae="Invalid extension URL.",be="This version of the application does not support your newer account type. Please upgrade to the latest version of Standard Notes to sign in.",we="The protocol version associated with your account is outdated and no longer supported by this application. Please visit standardnotes.com/help/security for more information.",Se="Your account was created on a platform with higher security capabilities than this browser supports. If we attempted to generate your login keys here, it would take hours. Please use a browser with more up to date security capabilities, like Google Chrome or Firefox, to log in.",Ce="Unable to sign in due to insecure password parameters. Please visit standardnotes.com/help/security for more information.",Ee="Invalid password.",Ie="Sign In",_e="Upgrading your account's encryption version…",xe="Setting passcode…",Pe="Changing passcode…",ke="Removing passcode…",Be="Do not close the application until this process completes.",Oe="Unknown error.";function Ne(e){return"Your password must be at least ".concat(e," characters in length. For your security, please choose a longer password or, ideally, a passphrase, and try again.")}function De(e,t){return"Strict Sign In has refused the server's sign-in parameters. The latest account version is ".concat(t,", but the server is reporting a version of ").concat(e," for your account. If you'd like to proceed with sign in anyway, please disable Strict Sign In and try again.")}const je={PasscodeRequired:"Your passcode is required to process your credentials change.",Failed:"Unable to change your credentials due to a sync error. Please try again."},Te={PasscodeRequired:"Your passcode is required in order to register for an account."},Me={PasscodeRequired:"Your passcode is required in order to sign in to your account.",IncorrectMfa:"Incorrect two-factor authentication code. Please try again.",SignInCanceledMissingMfa:"Your sign in request has been canceled."},Fe={SuccessAccount:"Your encryption version has been successfully upgraded. You may be asked to enter your credentials again on other devices you're signed into.",SuccessPasscodeOnly:"Your encryption version has been successfully upgraded.",Fail:"Unable to upgrade encryption version. Please try again.",UpgradingPasscode:"Upgrading local encryption..."},Re={Generic:"Authentication Required",Migration:"Storage Update"},Le={EnterEmailAndPassword:"Please enter your account email and password.",RecoverSession:e=>e?"Your credentials are needed for ".concat(e," to refresh your session with the server."):"Your credentials are needed to refresh your session with the server.",SessionRestored:"Your session has been successfully restored.",EnterMfa:"Please enter your two-factor authentication code.",InputU2FDevice:"Please authenticate with your hardware security key.",MfaInputPlaceholder:"Two-factor authentication code",EmailInputPlaceholder:"Email",PasswordInputPlaceholder:"Password",KeychainRecoveryErrorTitle:"Invalid Credentials",KeychainRecoveryError:"The email or password you entered is incorrect.\n\nPlease note that this sign-in request is made against the default server. If you are using a custom server, you must uninstall the app then reinstall, and sign back into your account.",RevokeTitle:"Revoke this session?",RevokeConfirmButton:"Revoke",RevokeCancelButton:"Cancel",RevokeText:"The associated app will be signed out and all data removed from the device when it is next launched. You can sign back in on that device at any time.",CurrentSessionRevoked:"Your session has been revoked and all local data has been removed from this device."},Qe={UnlockApplication:"Authentication is required to unlock the application",NoteAccess:"Authentication is required to view this note",FileAccess:"Authentication is required to access this file",ImportFile:"Authentication is required to import a backup file",AddPasscode:"Authentication is required to add a passcode",RemovePasscode:"Authentication is required to remove your passcode",ChangePasscode:"Authentication is required to change your passcode",ChangeAutolockInterval:"Authentication is required to change autolock timer duration",RevokeSession:"Authentication is required to revoke a session",EnterAccountPassword:"Enter your account password",EnterLocalPasscode:"Enter your application passcode",EnterPasscodeForMigration:"Your application passcode is required to perform an upgrade of your local data storage structure.",EnterPasscodeForRootResave:"Enter your application passcode to continue",EnterCredentialsForProtocolUpgrade:"Enter your credentials to perform encryption upgrade",EnterCredentialsForDecryptedBackupDownload:"Enter your credentials to download a decrypted backup",AccountPasswordPlaceholder:"Account Password",LocalPasscodePlaceholder:"Application Passcode",DecryptEncryptedFile:"Enter the account password associated with the import file",ExportBackup:"Authentication is required to export a backup",DisableBiometrics:"Authentication is required to disable biometrics",UnprotectNote:"Authentication is required to unprotect a note",UnprotectFile:"Authentication is required to unprotect a file",SearchProtectedNotesText:"Authentication is required to search protected contents",SelectProtectedNote:"Authentication is required to select a protected note",DisableMfa:"Authentication is required to disable two-factor authentication",DeleteAccount:"Authentication is required to delete your account",ListedAuthorization:"Authentication is required to approve this note for Listed",UnlockVault:e=>"Unlock ".concat(e),DeleteVault:e=>"Delete ".concat(e),EnterVaultPassword:"Enter the password for this vault"},Ue={MissingSessionTitle:"Missing Session",MissingSessionBody:"We were unable to load your server session. This represents an inconsistency with your application state. Please take an opportunity to backup your data, then sign out and sign back in to resolve this issue.",StorageDecryptErrorTitle:"Storage Error",StorageDecryptErrorBody:"We were unable to decrypt your local storage. Please restart the app and try again. If you're unable to resolve this issue, and you have an account, you may try uninstalling the app then reinstalling, then signing back into your account. Otherwise, please contact help@standardnotes.com for support."},Ve={Title:"Restore Keychain",Text:e=>"We've detected that your keychain has been wiped. This can happen when restoring your device from a backup. Please enter your account password for \"".concat(e,'" to restore your account keys.')};var Ke,He;!function(e){e[e.AccessProtectedFile=0]="AccessProtectedFile",e[e.AccessProtectedNote=1]="AccessProtectedNote",e[e.AddPasscode=2]="AddPasscode",e[e.ApplicationUnlock=3]="ApplicationUnlock",e[e.ChangeAutolockInterval=4]="ChangeAutolockInterval",e[e.ChangePasscode=5]="ChangePasscode",e[e.CreateDecryptedBackupWithProtectedItems=6]="CreateDecryptedBackupWithProtectedItems",e[e.Custom=7]="Custom",e[e.DecryptEncryptedFile=8]="DecryptEncryptedFile",e[e.DisableBiometrics=9]="DisableBiometrics",e[e.DisableMfa=10]="DisableMfa",e[e.ExportBackup=11]="ExportBackup",e[e.ImportFile=12]="ImportFile",e[e.Migration=13]="Migration",e[e.ProtocolUpgrade=14]="ProtocolUpgrade",e[e.RemovePasscode=15]="RemovePasscode",e[e.ResaveRootKey=16]="ResaveRootKey",e[e.RevokeSession=17]="RevokeSession",e[e.SearchProtectedNotesText=18]="SearchProtectedNotesText",e[e.SelectProtectedNote=19]="SelectProtectedNote",e[e.UnprotectFile=20]="UnprotectFile",e[e.UnprotectNote=21]="UnprotectNote",e[e.DeleteAccount=22]="DeleteAccount",e[e.AuthorizeNoteForListed=23]="AuthorizeNoteForListed"}(Ke||(Ke={}));class Ge{constructor(e,t,n,r,i){this.prompts=e,this.reason=t,this.cancelable=n,this._heading=r,this._subheading=i,this.id=Math.random()}get modalTitle(){return this.reason===Ke.Migration?Re.Migration:Re.Generic}get heading(){if(this._heading)return this._heading;switch(this.reason){case Ke.ApplicationUnlock:return Qe.UnlockApplication;case Ke.Migration:return Qe.EnterLocalPasscode;case Ke.ResaveRootKey:return Qe.EnterPasscodeForRootResave;case Ke.ProtocolUpgrade:return Qe.EnterCredentialsForProtocolUpgrade;case Ke.AccessProtectedNote:return Qe.NoteAccess;case Ke.AccessProtectedFile:return Qe.FileAccess;case Ke.ImportFile:return Qe.ImportFile;case Ke.AddPasscode:return Qe.AddPasscode;case Ke.RemovePasscode:return Qe.RemovePasscode;case Ke.ChangePasscode:return Qe.ChangePasscode;case Ke.ChangeAutolockInterval:return Qe.ChangeAutolockInterval;case Ke.CreateDecryptedBackupWithProtectedItems:return Qe.EnterCredentialsForDecryptedBackupDownload;case Ke.RevokeSession:return Qe.RevokeSession;case Ke.DecryptEncryptedFile:return Qe.DecryptEncryptedFile;case Ke.ExportBackup:return Qe.ExportBackup;case Ke.DisableBiometrics:return Qe.DisableBiometrics;case Ke.UnprotectNote:return Qe.UnprotectNote;case Ke.UnprotectFile:return Qe.UnprotectFile;case Ke.SearchProtectedNotesText:return Qe.SearchProtectedNotesText;case Ke.SelectProtectedNote:return Qe.SelectProtectedNote;case Ke.DisableMfa:return Qe.DisableMfa;case Ke.DeleteAccount:return Qe.DeleteAccount;case Ke.AuthorizeNoteForListed:return Qe.ListedAuthorization;case Ke.Custom:return"";default:return(0,c.assertUnreachable)(this.reason)}}get subheading(){return this._subheading?this._subheading:this.reason===Ke.Migration?Qe.EnterPasscodeForMigration:void 0}hasPromptForValidationType(e){for(const t of this.prompts)if(t.validation===e)return!0;return!1}}!function(e){e[e.None=0]="None",e[e.LocalPasscode=1]="LocalPasscode",e[e.AccountPassword=2]="AccountPassword",e[e.Biometric=3]="Biometric",e[e.ProtectionSessionDuration=4]="ProtectionSessionDuration",e[e.Authenticator=5]="Authenticator"}(He||(He={}));const Ye={AccountPassword:"Account Password",LocalPasscode:"Application Passcode",Biometrics:"Biometrics",RememberFor:"Remember For",Mfa:"Two-factor Authentication Code",U2F:"Security Key"};class ze{constructor(e,t,n){let r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0;switch(this.validation=e,this.secureTextEntry=r,this.keyboardType=i,this.initialValue=o,this.contextData=s,this.id=Math.random(),this.validation){case He.AccountPassword:this.title=null!=t?t:Ye.AccountPassword,this.placeholder=null!=n?n:Ye.AccountPassword,this.validates=!0;break;case He.LocalPasscode:this.title=null!=t?t:Ye.LocalPasscode,this.placeholder=null!=n?n:Ye.LocalPasscode,this.validates=!0;break;case He.Biometric:this.title=null!=t?t:Ye.Biometrics,this.placeholder=null!=n?n:"",this.validates=!0;break;case He.Authenticator:this.title=null!=t?t:Ye.U2F,this.placeholder=null!=n?n:"",this.validates=!0;break;case He.ProtectionSessionDuration:this.title=null!=t?t:Ye.RememberFor,this.placeholder=null!=n?n:"",this.validates=!0;break;case He.None:this.title=null!=t?t:"",this.placeholder=null!=n?n:"",this.validates=!1;break;default:(0,c.assertUnreachable)(this.validation)}Object.freeze(this)}}var Ze,We;function qe(e,t){return{prompt:e,value:t}}function Je(e){return"readonlyItem"in e}!function(e){e.Alphanumeric="default",e.Numeric="numeric"}(Ze||(Ze={})),function(e){e.OfflineRestricted="OfflineRestricted",e.MissingUrl="MissingUrl"}(We||(We={}));var Xe,$e,et=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class tt extends f{constructor(e,t,n,r,i,o,s,a,l,c,u,d,h,p){super(p),this.sync=e,this.mutator=t,this.session=n,this.crypto=r,this.user=i,this.selfContactManager=o,this.encryption=s,this._deleteContact=a,this._findContact=l,this._getAllContacts=c,this._createOrEditContact=u,this._editContact=d,this._validateItemSigner=h}deinit(){super.deinit(),this.sync=void 0,this.mutator=void 0,this.session=void 0,this.crypto=void 0,this.user=void 0,this.selfContactManager=void 0,this.encryption=void 0,this._findContact=void 0,this._getAllContacts=void 0,this._createOrEditContact=void 0,this._editContact=void 0,this._validateItemSigner=void 0}getSelfContact(){return this.selfContactManager.selfContact}isCollaborationEnabled(){return!this.session.isUserMissingKeyPair()}enableCollaboration(){return et(this,void 0,void 0,(function*(){yield this.user.updateAccountWithFirstTimeKeyPair()}))}getCollaborationID(){const e=this.session.getPublicKey();if(!e)throw new Error("Collaboration not enabled");return this.buildCollaborationId({version:"1",userUuid:this.session.getSureUser().uuid,publicKey:e,signingPublicKey:this.session.getSigningPublicKey()})}buildCollaborationId(e){const t="".concat(e.version,":").concat(e.userUuid,":").concat(e.publicKey,":").concat(e.signingPublicKey);return this.crypto.base64Encode(t)}parseCollaborationID(e){const t=this.crypto.base64Decode(e),[n,r,i,o]=t.split(":");return{version:n,userUuid:r,publicKey:i,signingPublicKey:o}}getCollaborationIDFromInvite(e){const t=this.encryption.getSenderPublicKeySetFromAsymmetricallyEncryptedString(e.encrypted_message);return this.buildCollaborationId({version:"1",userUuid:e.sender_uuid,publicKey:t.encryption,signingPublicKey:t.signing})}addTrustedContactFromCollaborationID(e,t){const{userUuid:n,publicKey:r,signingPublicKey:i}=this.parseCollaborationID(e);if(n===this.user.getUserUuid())throw new a.ClientDisplayableError("You cannot add yourself as a trusted contact");return this.createOrEditTrustedContact({name:null!=t?t:"",contactUuid:n,publicKey:r,signingPublicKey:i})}editTrustedContactFromCollaborationID(e,t){return et(this,void 0,void 0,(function*(){const{publicKey:n,signingPublicKey:r,userUuid:i}=this.parseCollaborationID(t.collaborationID);if(i!==e.contactUuid)throw new Error("Collaboration ID's user uuid does not match contact UUID");const o=yield this.mutator.changeItem(e,(i=>{i.name=t.name,n===e.publicKeySet.encryption&&r===e.publicKeySet.signing||i.addPublicKey({encryption:n,signing:r})}));return yield this.sync.sync(),o}))}updateTrustedContact(e,t){return et(this,void 0,void 0,(function*(){const n=yield this._editContact.execute(e,t);return this.sync.sync(),n}))}createOrEditTrustedContact(e){return et(this,void 0,void 0,(function*(){const t=yield this._createOrEditContact.execute(e);return this.sync.sync(),t}))}deleteContact(e){return et(this,void 0,void 0,(function*(){return this._deleteContact.execute({contact:e,ownUserUuid:this.session.userUuid})}))}getAllContacts(){return this._getAllContacts.execute().getValue()}findContact(e){const t=this._findContact.execute({userUuid:e});if(!t.isFailed())return t.getValue()}findContactForServerUser(e){return this.findContact(e.user_uuid)}findContactForInvite(e){return this.findContact(e.user_uuid)}findSenderContactForInvite(e){return this.findContact(e.sender_uuid)}getCollaborationIDForTrustedContact(e){return this.buildCollaborationId({version:"1",userUuid:e.content.contactUuid,publicKey:e.content.publicKeySet.encryption,signingPublicKey:e.content.publicKeySet.signing})}getItemSignatureStatus(e){return this._validateItemSigner.execute(e)}}let nt;Xe||(Xe={}),function(e){e.Vaults="vaults"}($e||($e={}));class rt{constructor(){this.enabledFeatures=new Set}static get(){return nt||(nt=new rt),nt}isFeatureEnabled(e){return this.enabledFeatures.has(e)}enableFeature(e){console.warn("Enabling internal feature: ".concat(e)),this.enabledFeatures.add(e)}}var it=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class ot{constructor(e,t,n,r){this.session=n,this.singletons=r,this.isReloadingSelfContact=!1,this.eventDisposers=[],this.eventDisposers.push(e.addEventObserver((e=>{e===E.LocalDataIncrementalLoad&&this.loadSelfContactFromDatabase(),e===E.SyncCompletedWithAllItemsUploaded&&this.reloadSelfContactAndCreateIfNecessary()}))),this.eventDisposers.push(t.addObserver(b.ContentType.TYPES.TrustedContact,(()=>{const e=this.singletons.findSingleton(b.ContentType.TYPES.TrustedContact,I.TrustedContact.singletonPredicate);e&&(this.selfContact=e)})))}handleEvent(e){return it(this,void 0,void 0,(function*(){e.type===L.ApplicationStageChanged&&e.payload.stage===y.LoadedDatabase_12&&this.loadSelfContactFromDatabase()}))}loadSelfContactFromDatabase(){this.selfContact||(this.selfContact=this.singletons.findSingleton(b.ContentType.TYPES.TrustedContact,I.TrustedContact.singletonPredicate))}reloadSelfContactAndCreateIfNecessary(){return it(this,void 0,void 0,(function*(){if(!rt.get().isFeatureEnabled($e.Vaults))return;if(this.selfContact)return;if(this.isReloadingSelfContact)return;if(!this.session.isSignedIn())return;if(this.session.isUserMissingKeyPair())return;this.isReloadingSelfContact=!0;const e={name:"Me",isMe:!0,contactUuid:this.session.getSureUser().uuid,publicKeySet:I.ContactPublicKeySet.FromJson({encryption:this.session.getPublicKey(),signing:this.session.getSigningPublicKey(),timestamp:new Date})};this.selfContact=yield this.singletons.findOrCreateSingleton(I.TrustedContact.singletonPredicate,b.ContentType.TYPES.TrustedContact,(0,I.FillItemContent)(e)),this.isReloadingSelfContact=!1}))}deinit(){this.eventDisposers.forEach((e=>e())),this.session=void 0,this.singletons=void 0}}class st{constructor(e,t,n){this.mutator=e,this.findContact=t,this.editContact=n}execute(e){var t,n,r,i,o,s,a;return i=this,o=void 0,a=function*(){const i=this.findContact.execute({userUuid:e.contactUuid});if(!i.isFailed())return yield this.editContact.execute(i.getValue(),Object.assign(Object.assign({},e),{name:null!==(t=e.name)&&void 0!==t?t:i.getValue().name})),i.getValue();const o={name:null!==(n=e.name)&&void 0!==n?n:"Unnamed contact",publicKeySet:I.ContactPublicKeySet.FromJson({encryption:e.publicKey,signing:e.signingPublicKey,timestamp:new Date}),contactUuid:e.contactUuid,isMe:null!==(r=e.isMe)&&void 0!==r&&r};return yield this.mutator.createItem(b.ContentType.TYPES.TrustedContact,(0,I.FillItemContent)(o),!0)},new((s=void 0)||(s=Promise))((function(e,t){function n(e){try{l(a.next(e))}catch(e){t(e)}}function r(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(n,r)}l((a=a.apply(i,o||[])).next())}))}}class at{constructor(e,t,n,r){this.mutator=e,this.sync=t,this.getOwnedVaults=n,this.contactBelongsToVault=r}execute(e){return t=this,n=void 0,i=function*(){if(e.contact.isMe)throw new Error("Cannot delete self");const t=this.getOwnedVaults.execute();if(t.isFailed())return b.Result.fail("Failed to get owned vaults");for(const n of t.getValue()){const t=yield this.contactBelongsToVault.execute({contact:e.contact,vault:n});if(t.isFailed())return b.Result.fail("Failed to check contact membership");if(t.getValue())return b.Result.fail("Cannot delete contact that belongs to an owned vault")}return yield this.mutator.setItemToBeDeleted(e.contact),yield this.sync.sync(),b.Result.ok()},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class lt{constructor(e){this.mutator=e}execute(e,t){return n=this,r=void 0,o=function*(){return yield this.mutator.changeItem(e,(n=>{n.name=t.name,t.publicKey===e.publicKeySet.encryption&&t.signingPublicKey===e.publicKeySet.signing||n.addPublicKey({encryption:t.publicKey,signing:t.signingPublicKey})}))},new((i=void 0)||(i=Promise))((function(e,t){function s(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(n,r||[])).next())}));var n,r,i,o}}class ct{constructor(e){this.items=e}execute(e){if("userUuid"in e&&e.userUuid){const t=this.items.itemsMatchingPredicate(b.ContentType.TYPES.TrustedContact,new I.Predicate("contactUuid","=",e.userUuid));return 0===t.length?b.Result.fail("Contact not found for user ".concat(e.userUuid)):t.length>1?b.Result.fail("Multiple contacts found for user ".concat(e.userUuid)):b.Result.ok(t[0])}if("signingPublicKey"in e&&e.signingPublicKey){const t=this.items.getItems(b.ContentType.TYPES.TrustedContact).find((t=>t.hasCurrentOrPreviousSigningPublicKey(e.signingPublicKey)));return t?b.Result.ok(t):b.Result.fail("Contact not found")}throw new Error("Invalid query")}}class ut{constructor(e){this.items=e}execute(){return b.Result.ok(this.items.getItems(b.ContentType.TYPES.TrustedContact))}}var dt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class ht{constructor(e,t,n,r,i,o,s,a,l){this.selfContactManager=e,this.invitesServer=t,this.messageServer=n,this._reuploadAllInvites=r,this._resendAllMessages=i,this._getAllContacts=o,this._sendOwnContactChangedMessage=s,this._createOrEditContact=a,this.logger=l}execute(e){return dt(this,void 0,void 0,(function*(){yield this.updateSelfContact({encryption:e.newKeys.encryption.publicKey,signing:e.newKeys.signing.publicKey});const t=yield Promise.all([this._reuploadAllInvites.execute({keys:e.newKeys,previousKeys:e.previousKeys}),this._resendAllMessages.execute({keys:e.newKeys,previousKeys:e.previousKeys})]);for(const e of t)e.isFailed()&&this.logger.error(e.getError());yield this.sendOwnContactChangeEventToAllContacts(e);const n=yield Promise.all([this.messageServer.deleteAllInboundMessages(),this.invitesServer.deleteAllInboundInvites()]);for(const e of n)(0,a.isErrorResponse)(e)&&this.logger.error(JSON.stringify(e));return b.Result.ok()}))}updateSelfContact(e){return dt(this,void 0,void 0,(function*(){if(!rt.get().isFeatureEnabled($e.Vaults))return;const t=this.selfContactManager.selfContact;t&&(yield this._createOrEditContact.execute({contactUuid:t.contactUuid,publicKey:e.encryption,signingPublicKey:e.signing}))}))}sendOwnContactChangeEventToAllContacts(e){return dt(this,void 0,void 0,(function*(){if(!e.previousKeys)return;const t=this._getAllContacts.execute();if(!t.isFailed())for(const n of t.getValue())n.isMe||(yield this._sendOwnContactChangedMessage.execute({senderOldKeyPair:e.previousKeys.encryption,senderOldSigningKeyPair:e.previousKeys.signing,senderNewKeyPair:e.newKeys.encryption,senderNewSigningKeyPair:e.newKeys.signing,contact:n}))}))}}class pt{constructor(e,t,n){this.mutator=e,this.sync=t,this.findContact=n}execute(e){return t=this,n=void 0,i=function*(){const t=this.findContact.execute({userUuid:e.contactUuid});if(t.isFailed()){const t=yield this.mutator.createItem(b.ContentType.TYPES.TrustedContact,(0,I.FillItemContent)(e),!0);return yield this.sync.sync(),b.Result.ok(t)}const n=t.getValue();if(n.isMe)return b.Result.fail("Cannot replace data for me contact");const r=yield this.mutator.changeItem(n,(t=>{t.name=e.name,t.replacePublicKeySet(e.publicKeySet)}),I.MutationType.UpdateUserTimestamps,I.PayloadEmitSource.RemoteRetrieved);return yield this.sync.sync(),b.Result.ok(r)},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}var ft;class gt{constructor(e,t){this.encryptMessage=e,this.sendMessage=t}execute(e){return t=this,n=void 0,i=function*(){const t={type:I.AsymmetricMessagePayloadType.SenderKeypairChanged,data:{recipientUuid:e.contact.contactUuid,newEncryptionPublicKey:e.senderNewKeyPair.publicKey,newSigningPublicKey:e.senderNewSigningKeyPair.publicKey}},n=this.encryptMessage.execute({message:t,keys:{encryption:e.senderOldKeyPair,signing:e.senderOldSigningKeyPair},recipientPublicKey:e.contact.publicKeySet.encryption});return n.isFailed()?b.Result.fail(n.getError()):yield this.sendMessage.execute({recipientUuid:e.contact.contactUuid,encryptedMessage:n.getValue(),replaceabilityIdentifier:void 0})},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}!function(e){e.NotApplicable="NotApplicable",e.Trusted="Trusted",e.SignedWithNonCurrentKey="SignedWithNonCurrentKey",e.NotTrusted="NotTrusted"}(ft||(ft={}));var mt=n(73936);class yt{constructor(e){this.findContact=e}execute(e){const t=e.last_edited_by_uuid;return t?this.validateSignatureWithLastEditedByUuid(e,t):this.validateSignatureWithNoLastEditedByUuid(e)}isItemLocallyCreatedAndDoesNotRequireSignature(e){return e.payload.source===I.PayloadSource.Constructor}isItemResutOfRemoteSaveAndDoesNotRequireSignature(e){return e.payload.source===I.PayloadSource.RemoteSaved}validateSignatureWithLastEditedByUuid(e,t){const n=(0,mt.q)(e),r=this.findContact.execute({userUuid:t});if(r.isFailed())return n?ft.NotTrusted:ft.NotApplicable;if(!e.signatureData)return this.isItemLocallyCreatedAndDoesNotRequireSignature(e)||this.isItemResutOfRemoteSaveAndDoesNotRequireSignature(e)?ft.NotApplicable:n?ft.NotTrusted:ft.NotApplicable;const i=e.signatureData;if(!i.result)return i.required?ft.NotTrusted:ft.NotApplicable;const o=i.result;if(!o.passes)return ft.NotTrusted;const s=o.publicKey,a=r.getValue().getTrustStatusForSigningPublicKey(s);return a===I.PublicKeyTrustStatus.Trusted?ft.Trusted:a===I.PublicKeyTrustStatus.Previous?ft.SignedWithNonCurrentKey:ft.NotTrusted}validateSignatureWithNoLastEditedByUuid(e){const t=(0,mt.q)(e);if(!e.signatureData)return this.isItemLocallyCreatedAndDoesNotRequireSignature(e)||this.isItemResutOfRemoteSaveAndDoesNotRequireSignature(e)?ft.NotApplicable:t?ft.NotTrusted:ft.NotApplicable;const n=e.signatureData;if(!n.result)return n.required?ft.NotTrusted:ft.NotApplicable;const r=n.result;if(!r.passes)return ft.NotTrusted;const i=r.publicKey,o=this.findContact.execute({signingPublicKey:i});if(o.isFailed())return ft.NotTrusted;const s=o.getValue().getTrustStatusForSigningPublicKey(i);return s===I.PublicKeyTrustStatus.Trusted?ft.Trusted:s===I.PublicKeyTrustStatus.Previous?ft.SignedWithNonCurrentKey:ft.NotTrusted}}function vt(e){return void 0!==e.entries}function At(e){return void 0!==e.fullEntries}function bt(e,t){return e.sort(((e,n)=>{const r=new Date(n.updated_at).getTime()-new Date(e.updated_at).getTime();let i=0,o=0;return i=t.indexOf(e.content_type),o=t.indexOf(n.content_type),-1===i&&(i=t.length),-1===o&&(o=t.length),i===o?r:i<o?-1:1}))}function wt(e,t){return e.sort(((e,n)=>{const r=new Date(n.updated_at).getTime()-new Date(e.updated_at).getTime();let i=0,o=0;return i=t.indexOf(e.uuid),o=t.indexOf(n.uuid),-1===i&&(i=t.length),-1===o&&(o=t.length),i===o?r:i<o?-1:1}))}function St(e,t){const n=[],r=[],i=[],o=[],s=[];for(let a=0;a<e.length;a++){const l=e[a];l.content_type===b.ContentType.TYPES.KeySystemRootKey?r.push(l):l.content_type===b.ContentType.TYPES.KeySystemItemsKey?i.push(l):l.content_type===b.ContentType.TYPES.ItemsKey?n.push(l):t.contentTypePriority.includes(l.content_type)?o.push(l):s.push(l)}return{itemsKeyPayloads:n,keySystemRootKeyPayloads:r,keySystemItemsKeyPayloads:i,contentTypePriorityPayloads:bt(o,t.contentTypePriority),remainingPayloads:wt(s,t.uuidPriority)}}function Ct(e){return e.environment===I.Environment.Desktop}function Et(e){return e.environment===I.Environment.Mobile}var It,_t,xt,Pt=n(86999),kt=n(20875);!function(e){e.RootKeyStatusChanged="RootKeyStatusChanged"}(It||(It={})),function(e){e.RootKeyManagerKeyStatusChanged="RootKeyManagerKeyStatusChanged"}(_t||(_t={})),function(e){e[e.RootKeyNone=0]="RootKeyNone",e[e.RootKeyOnly=1]="RootKeyOnly",e[e.RootKeyPlusWrapper=2]="RootKeyPlusWrapper",e[e.WrapperOnly=3]="WrapperOnly"}(xt||(xt={}));var Bt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Ot extends f{constructor(e,t,n,r,i,o,s,a,l,u,d,h,p,f,g,m){super(m),this.items=e,this.mutator=t,this.payloads=n,this.operators=r,this.itemsEncryption=i,this.rootKeyManager=o,this.crypto=s,this._createNewItemsKeyWithRollback=a,this._findDefaultItemsKey=l,this._rootKeyEncryptPayloadWithKeyLookup=u,this._rootKeyEncryptPayload=d,this._rootKeyDecryptPayload=h,this._rootKeyDecryptPayloadWithKeyLookup=p,this._createDefaultItemsKey=f,this._getKeyPairs=g,this.internalEventBus=m,m.addEventHandler(this,_t.RootKeyManagerKeyStatusChanged),c.UuidGenerator.SetGenerator(this.crypto.generateUUID)}handleEvent(e){return Bt(this,void 0,void 0,(function*(){e.type===_t.RootKeyManagerKeyStatusChanged&&(this.itemsEncryption.userVersion=this.getUserVersion(),this.notifyEvent(It.RootKeyStatusChanged))}))}deinit(){this.items=void 0,this.payloads=void 0,this.operators=void 0,this.itemsEncryption=void 0,this.rootKeyManager=void 0,this.crypto=void 0,this._createNewItemsKeyWithRollback=void 0,this._findDefaultItemsKey=void 0,this._rootKeyEncryptPayloadWithKeyLookup=void 0,this._rootKeyEncryptPayload=void 0,this._rootKeyDecryptPayload=void 0,this._rootKeyDecryptPayloadWithKeyLookup=void 0,this._createDefaultItemsKey=void 0,super.deinit()}hasSigningKeyPair(){var e;return!!(null===(e=this.getRootKey())||void 0===e?void 0:e.signingKeyPair)}initialize(){return Bt(this,void 0,void 0,(function*(){yield this.rootKeyManager.initialize()}))}getEncryptionDisplayName(){return Bt(this,void 0,void 0,(function*(){const e=yield this.rootKeyManager.getEncryptionSourceVersion();if(e)return this.operators.operatorForVersion(e).getEncryptionDisplayName();throw Error("Attempting to access encryption display name wtihout source")}))}getLatestVersion(){return kt.ProtocolVersionLatest}hasAccount(){return this.rootKeyManager.hasAccount()}hasRootKeyEncryptionSource(){return this.rootKeyManager.hasRootKeyEncryptionSource()}getUserVersion(){return this.rootKeyManager.getUserVersion()}upgradeAvailable(){return Bt(this,void 0,void 0,(function*(){const e=this.accountUpgradeAvailable(),t=yield this.passcodeUpgradeAvailable();return e||t}))}getSureDefaultItemsKey(){return this.itemsEncryption.getDefaultItemsKey()}repersistAllItems(){return Bt(this,void 0,void 0,(function*(){return this.itemsEncryption.repersistAllItems()}))}createNewItemsKeyWithRollback(){return Bt(this,void 0,void 0,(function*(){return this._createNewItemsKeyWithRollback.execute()}))}itemsKeyForEncryptedPayload(e){return this.itemsEncryption.itemsKeyForEncryptedPayload(e)}defaultItemsKeyForItemVersion(e,t){return this.itemsEncryption.defaultItemsKeyForItemVersion(e,t)}encryptSplitSingle(e){return Bt(this,void 0,void 0,(function*(){return(yield this.encryptSplit(e))[0]}))}encryptSplit(e){return Bt(this,void 0,void 0,(function*(){const t=[],{usesRootKey:n,usesItemsKey:r,usesKeySystemRootKey:i,usesRootKeyWithKeyLookup:o,usesItemsKeyWithKeyLookup:s,usesKeySystemRootKeyWithKeyLookup:a}=e,l=this._getKeyPairs.execute(),u=l.isFailed()?void 0:l.getValue().signing;if(n){const e=yield this._rootKeyEncryptPayload.executeMany(n.items,n.key,u);(0,c.extendArray)(t,e)}if(o){const e=yield this._rootKeyEncryptPayloadWithKeyLookup.executeMany(o.items,u);(0,c.extendArray)(t,e)}if(i){const e=yield this._rootKeyEncryptPayload.executeMany(i.items,i.key,u);(0,c.extendArray)(t,e)}if(a){const e=yield this._rootKeyEncryptPayloadWithKeyLookup.executeMany(a.items,u);(0,c.extendArray)(t,e)}if(r){const e=yield this.itemsEncryption.encryptPayloads(r.items,r.key,u);(0,c.extendArray)(t,e)}if(s){const e=yield this.itemsEncryption.encryptPayloadsWithKeyLookup(s.items,u);(0,c.extendArray)(t,e)}return t.map((t=>{const n=(0,Pt.G6)(t.uuid,e);return new I.EncryptedPayload(Object.assign(Object.assign(Object.assign({},n),t),{waitingForKey:!1,errorDecrypting:!1}))}))}))}decryptSplitSingle(e){return Bt(this,void 0,void 0,(function*(){return(yield this.decryptSplit(e))[0]}))}decryptSplit(e){return Bt(this,void 0,void 0,(function*(){const t=[],{usesRootKey:n,usesItemsKey:r,usesKeySystemRootKey:i,usesRootKeyWithKeyLookup:o,usesItemsKeyWithKeyLookup:s,usesKeySystemRootKeyWithKeyLookup:a}=e;if(n){const e=yield this._rootKeyDecryptPayload.executeMany(n.items,n.key);(0,c.extendArray)(t,e)}if(o){const e=yield this._rootKeyDecryptPayloadWithKeyLookup.executeMany(o.items);(0,c.extendArray)(t,e)}if(i){const e=yield this._rootKeyDecryptPayload.executeMany(i.items,i.key);(0,c.extendArray)(t,e)}if(a){const e=yield this._rootKeyDecryptPayloadWithKeyLookup.executeMany(a.items);(0,c.extendArray)(t,e)}if(r){const e=yield this.itemsEncryption.decryptPayloads(r.items,r.key);(0,c.extendArray)(t,e)}if(s){const e=yield this.itemsEncryption.decryptPayloadsWithKeyLookup(s.items);(0,c.extendArray)(t,e)}return t.map((t=>{const n=(0,Pt.sP)(t.uuid,e);return(0,Pt.XL)(t)?new I.EncryptedPayload(Object.assign(Object.assign({},n.ejected()),t)):new I.DecryptedPayload(Object.assign(Object.assign({},n.ejected()),t))}))}))}decryptPayloadWithKeyLookup(e){return Bt(this,void 0,void 0,(function*(){const t=yield this.itemsEncryption.decryptPayloadWithKeyLookup(e);return(0,Pt.XL)(t)?{parameters:t,payload:new I.EncryptedPayload(Object.assign(Object.assign({},e.ejected()),t))}:{parameters:t,payload:new I.DecryptedPayload(Object.assign(Object.assign({},e.ejected()),t))}}))}accountUpgradeAvailable(){const e=this.getUserVersion();return!!e&&e!==kt.ProtocolVersionLatest}passcodeUpgradeAvailable(){return Bt(this,void 0,void 0,(function*(){return this.rootKeyManager.passcodeUpgradeAvailable()}))}platformSupportsKeyDerivation(e){return(0,kt.compareVersions)(e.version,kt.ProtocolVersion.V004)>=0||!!(0,c.isWebCryptoAvailable)()||(0,c.isReactNativeEnvironment)()}supportedVersions(){return[kt.ProtocolVersion.V001,kt.ProtocolVersion.V002,kt.ProtocolVersion.V003,kt.ProtocolVersion.V004]}isVersionNewerThanLibraryVersion(e){const t=kt.ProtocolVersionLatest;return 1===(0,kt.compareVersions)(e,t)}costMinimumForVersion(e){if((0,kt.compareVersions)(e,kt.ProtocolVersion.V003)>=0)throw"Cost minimums only apply to versions <= 002";if(e===kt.ProtocolVersion.V001)return Pt.xo.PbkdfMinCost;if(e===kt.ProtocolVersion.V002)return Pt.$4.PbkdfMinCost;throw"Invalid version for cost minimum: ".concat(e)}computeRootKey(e,t){return Bt(this,void 0,void 0,(function*(){return this.rootKeyManager.computeRootKey(e,t)}))}createRootKey(e,t,n,r){return Bt(this,void 0,void 0,(function*(){return this.rootKeyManager.createRootKey(e,t,n,r)}))}createRandomizedKeySystemRootKey(e){return this.operators.defaultOperator().createRandomizedKeySystemRootKey(e)}createUserInputtedKeySystemRootKey(e){return this.operators.defaultOperator().createUserInputtedKeySystemRootKey(e)}deriveUserInputtedKeySystemRootKey(e){return this.operators.defaultOperator().deriveUserInputtedKeySystemRootKey(e)}createKeySystemItemsKey(e,t,n,r){return this.operators.defaultOperator().createKeySystemItemsKey(e,t,n,r)}asymmetricSignatureVerifyDetached(e){const t=this.operators.defaultOperator().versionForAsymmetricallyEncryptedString(e);return this.operators.operatorForVersion(t).asymmetricSignatureVerifyDetached(e)}getSenderPublicKeySetFromAsymmetricallyEncryptedString(e){const t=this.operators.defaultOperator().versionForAsymmetricallyEncryptedString(e);return this.operators.operatorForVersion(t).getSenderPublicKeySetFromAsymmetricallyEncryptedString(e)}createKeyParams(e){return(0,Pt.jl)(e)}hasPasscode(){return this.rootKeyManager.hasPasscode()}isPasscodeLocked(){return Bt(this,void 0,void 0,(function*(){return(yield this.rootKeyManager.hasRootKeyWrapper())&&null==this.rootKeyManager.getRootKey()}))}getRootKeyParams(){return this.rootKeyManager.getRootKeyParams()}getAccountKeyParams(){return this.rootKeyManager.getMemoizedRootKeyParams()}computeWrappingKey(e){return Bt(this,void 0,void 0,(function*(){const t=this.rootKeyManager.getSureRootKeyWrapperKeyParams();return yield this.computeRootKey(e,t)}))}unwrapRootKey(e){return Bt(this,void 0,void 0,(function*(){return this.rootKeyManager.unwrapRootKey(e)}))}setNewRootKeyWrapper(e){return Bt(this,void 0,void 0,(function*(){return this.rootKeyManager.setNewRootKeyWrapper(e)}))}removePasscode(){return Bt(this,void 0,void 0,(function*(){yield this.rootKeyManager.removeRootKeyWrapper()}))}setRootKey(e,t){return Bt(this,void 0,void 0,(function*(){yield this.rootKeyManager.setRootKey(e,t)}))}getRootKey(){return this.rootKeyManager.getRootKey()}getSureRootKey(){return this.rootKeyManager.getRootKey()}deleteWorkspaceSpecificKeyStateFromDevice(){return Bt(this,void 0,void 0,(function*(){yield this.rootKeyManager.deleteWorkspaceSpecificKeyStateFromDevice()}))}validateAccountPassword(e){return Bt(this,void 0,void 0,(function*(){return this.rootKeyManager.validateAccountPassword(e)}))}validatePasscode(e){return Bt(this,void 0,void 0,(function*(){return this.rootKeyManager.validatePasscode(e)}))}getEmbeddedPayloadAuthenticatedData(e){const t=e.version;if(t)return this.operators.operatorForVersion(t).getPayloadAuthenticatedDataForExternalUse((0,Pt.xi)(e))}getKeyEmbeddedKeyParamsFromItemsKey(e){const t=this.getEmbeddedPayloadAuthenticatedData(e);if(t){if((0,kt.isVersionLessThanOrEqualTo)(e.version,kt.ProtocolVersion.V003)){const e=t;return this.createKeyParams(e)}{const e=t.kp;return this.createKeyParams(e)}}}needsNewRootKeyBasedItemsKey(){if(!this.hasAccount())return!1;const e=this.rootKeyManager.getRootKey();if(!e)return!1;if((0,kt.compareVersions)(e.keyVersion,kt.ProtocolVersionLastNonrootItemsKey)>0)return!1;const t=this._findDefaultItemsKey.execute(this.itemsEncryption.getItemsKeys()).getValue();return!t||t.itemsKey!==e.itemsKey}createNewDefaultItemsKey(){return Bt(this,void 0,void 0,(function*(){return this._createDefaultItemsKey.execute()}))}getPasswordCreatedDate(){const e=this.getRootKey();return e?e.keyParams.createdDate:void 0}onSyncEvent(e){return Bt(this,void 0,void 0,(function*(){e===E.SyncCompletedWithAllItemsUploaded&&(yield this.handleFullSyncCompletion()),e===E.DownloadFirstSyncCompleted&&(yield this.handleDownloadFirstSyncCompletion())}))}handleDownloadFirstSyncCompletion(){return Bt(this,void 0,void 0,(function*(){if(!this.hasAccount())return;const e=this.itemsEncryption.getItemsKeys(),t=e.filter((e=>e.neverSynced)),n=e.filter((e=>!e.neverSynced)).find((e=>e.isDefault));if((0,c.isNullOrUndefined)(n)){const e=this.getRootKeyParams();if(e){const n=t.filter((t=>t.keyVersion!==e.version));n.length>0&&(yield this.mutator.setItemsToBeDeleted(n)),0===this.itemsEncryption.getItemsKeys().length&&(yield this.createNewDefaultItemsKey())}}else yield this.mutator.setItemsToBeDeleted(t);const r=this.getUserVersion(),i=this.itemsEncryption.getItemsKeys().find((e=>e.keyVersion===r));(0,c.isNullOrUndefined)(i)&&(yield this.createNewDefaultItemsKey()),this.syncUnsyncedItemsKeys()}))}handleFullSyncCompletion(){return Bt(this,void 0,void 0,(function*(){if(!this._findDefaultItemsKey.execute(this.itemsEncryption.getItemsKeys()).getValue()&&(yield this.createNewDefaultItemsKey(),this.rootKeyManager.getKeyMode()===xt.WrapperOnly))return this.itemsEncryption.repersistAllItems()}))}syncUnsyncedItemsKeys(){if(!this.hasAccount())return;const e=this.itemsEncryption.getItemsKeys().filter((e=>e.neverSynced&&!e.dirty));e.length>0&&this.mutator.setItemsDirty(e)}}var Nt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};function Dt(e,t,n){return Nt(this,void 0,void 0,(function*(){const r=yield t.decryptSplitSingle({usesRootKeyWithKeyLookup:{items:[e]}});if((0,I.isDecryptedPayload)(r))return r;const i=yield jt(e,t,n);return"aborted"===i||"failed"===i?i:i.decryptedKey}))}function jt(e,t,n,r){return Nt(this,void 0,void 0,(function*(){if(r||(r=t.getKeyEmbeddedKeyParamsFromItemsKey(e)),!r)return"failed";const i=n.createChallenge([new ze(He.None,void 0,void 0,!0)],Ke.Custom,!0,Pt.fD.KeyRecoveryLoginFlowPrompt(r),Pt.fD.KeyRecoveryPasswordRequired),o=yield n.promptForChallengeResponse(i);if(!o)return"aborted";const s=o.values[0].value,a=yield t.computeRootKey(s,r),l=yield t.decryptSplitSingle({usesRootKey:{items:[e],key:a}});return n.completeChallenge(i),(0,I.isDecryptedPayload)(l)?{decryptedKey:l,rootKey:a}:"failed"}))}class Tt{constructor(e){this.operators=e}execute(e){const t=this.operators.defaultOperator().versionForAsymmetricallyEncryptedString(e.message),n=this.operators.operatorForVersion(t).asymmetricDecrypt({stringToDecrypt:e.message,recipientSecretKey:e.privateKey});if(!n)return b.Result.fail("Failed to decrypt message");if(!n.signatureVerified)return b.Result.fail("Failed to verify signature");if(e.sender){if(e.sender.getTrustStatusForPublicKey(n.senderPublicKey)!==I.PublicKeyTrustStatus.Trusted)return b.Result.fail("Sender public key is not trusted");if(e.sender.getTrustStatusForSigningPublicKey(n.signaturePublicKey)!==I.PublicKeyTrustStatus.Trusted)return b.Result.fail("Signature public key is not trusted")}return b.Result.ok(JSON.parse(n.plaintext))}}class Mt{constructor(e){this.operators=e}execute(e){const t=this.operators.defaultOperator().versionForAsymmetricallyEncryptedString(e.message),n=this.operators.operatorForVersion(t).asymmetricDecryptOwnMessage({message:e.message,ownPrivateKey:e.privateKey,recipientPublicKey:e.recipientPublicKey});if(n.isFailed())return b.Result.fail(n.getError());const r=n.getValue();return r.signatureVerified?b.Result.ok(JSON.parse(r.plaintext)):b.Result.fail("Failed to verify signature")}}class Ft{constructor(e){this.operators=e}execute(e){const t=this.operators.defaultOperator().asymmetricEncrypt({stringToEncrypt:JSON.stringify(e.message),senderKeyPair:e.keys.encryption,senderSigningKeyPair:e.keys.signing,recipientPublicKey:e.recipientPublicKey});return b.Result.ok(t)}}class Rt{constructor(e){this.operators=e}execute(e){return this.operators.defaultOperator().asymmetricStringGetAdditionalData({encryptedString:e.message})}}class Lt{constructor(e,t){this.itemsEncryption=e,this._decryptErroredRootPayloads=t}execute(){return e=this,t=void 0,r=function*(){return yield this._decryptErroredRootPayloads.execute(),yield this.itemsEncryption.decryptErroredItemPayloads(),b.Result.ok()},new((n=void 0)||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}));var e,t,n,r}}class Qt{constructor(e){this.rootKeyManager=e}execute(){const e=this.rootKeyManager.getRootKey();return(null==e?void 0:e.encryptionKeyPair)&&(null==e?void 0:e.signingKeyPair)?b.Result.ok({encryption:e.encryptionKeyPair,signing:e.signingKeyPair}):b.Result.fail("Account keypair not found")}}class Ut{constructor(e,t,n,r){this.mutator=e,this.items=t,this.operators=n,this.rootKeyManager=r}execute(){return e=this,t=void 0,r=function*(){const e=this.rootKeyManager.getSureRootKey(),t=e?e.keyVersion:kt.ProtocolVersionLatest;let n;if((0,kt.compareVersions)(t,kt.ProtocolVersionLastNonrootItemsKey)<=0){const r=new I.DecryptedPayload(Object.assign({uuid:c.UuidGenerator.GenerateUuid(),content_type:b.ContentType.TYPES.ItemsKey,content:(0,I.FillItemContentSpecialized)({itemsKey:e.masterKey,dataAuthenticationKey:e.dataAuthenticationKey,version:t})},(0,I.PayloadTimestampDefaults)()));n=(0,I.CreateDecryptedItemFromPayload)(r)}else n=this.operators.operatorForVersion(t).createItemsKey();const r=this.items.getDisplayableItemsKeys().filter((e=>e.isDefault));for(const e of r)yield this.mutator.changeItemsKey(e,(e=>{e.isDefault=!1}));const i=yield this.mutator.insertItem(n);return yield this.mutator.changeItemsKey(i,(e=>{e.isDefault=!0})),i},new((n=void 0)||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}));var e,t,n,r}}var Vt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Kt{constructor(e,t,n,r,i){this.mutator=e,this.items=t,this._createDefaultItemsKey=n,this._discardItemsLocally=r,this._findDefaultItemsKey=i}execute(){return Vt(this,void 0,void 0,(function*(){const e=this._findDefaultItemsKey.execute(this.items.getDisplayableItemsKeys()).getValue(),t=yield this._createDefaultItemsKey.execute();return()=>Vt(this,void 0,void 0,(function*(){yield this._discardItemsLocally.execute([t]),e&&(yield this.mutator.changeItem(e,(e=>{e.isDefault=!0})))}))}))}}class Ht{execute(e){if(1===e.length)return b.Result.ok(e[0]);const t=e.filter((e=>e.isDefault));if(0===t.length)return b.Result.ok(void 0);if(1===t.length)return b.Result.ok(t[0]);const n=t.filter((e=>!e.neverSynced));return n.length>0?b.Result.ok(n[0]):b.Result.ok(void 0)}}class Gt{constructor(e,t){this.payloads=e,this._decryptTypeAPayloadWithKeyLookup=t}execute(){return e=this,t=void 0,r=function*(){const e=this.payloads.invalidPayloads.filter((e=>(0,I.ContentTypeUsesRootKeyEncryption)(e.content_type)||(0,I.ContentTypeUsesKeySystemRootKeyEncryption)(e.content_type)));if(0===e.length)return;const t=(yield this._decryptTypeAPayloadWithKeyLookup.executeMany(e)).map((t=>{const n=(0,I.SureFindPayload)(e,t.uuid);return(0,Pt.XL)(t)?new I.EncryptedPayload(Object.assign(Object.assign({},n.ejected()),t)):new I.DecryptedPayload(Object.assign(Object.assign({},n.ejected()),t))}));yield this.payloads.emitPayloads(t,I.PayloadEmitSource.LocalChanged)},new((n=void 0)||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}));var e,t,n,r}}var Yt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class zt{constructor(e){this.operatorManager=e}executeOne(e,t){return Yt(this,void 0,void 0,(function*(){return(0,Pt.oO)(e,t,this.operatorManager)}))}executeMany(e,t){return Yt(this,void 0,void 0,(function*(){return Promise.all(e.map((e=>this.executeOne(e,t))))}))}}var Zt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Wt{constructor(e,t,n,r){this.operators=e,this.keySystemKeyManager=t,this.rootKeyManager=n,this.logger=r}executeOne(e){return Zt(this,void 0,void 0,(function*(){let t;if((0,I.ContentTypeUsesKeySystemRootKeyEncryption)(e.content_type)){if(!e.key_system_identifier)return this.logger.error("Payload is missing key system identifier",e),{uuid:e.uuid,errorDecrypting:!0};t=this.keySystemKeyManager.getPrimaryKeySystemRootKey(e.key_system_identifier)}else t=this.rootKeyManager.getRootKey();return null==t?{uuid:e.uuid,errorDecrypting:!0,waitingForKey:!0}:new zt(this.operators).executeOne(e,t)}))}executeMany(e){return Zt(this,void 0,void 0,(function*(){return Promise.all(e.map((e=>this.executeOne(e))))}))}}var qt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Jt{constructor(e){this.operators=e}executeOne(e,t,n){return qt(this,void 0,void 0,(function*(){return(0,Pt.Gl)(e,t,this.operators,n)}))}executeMany(e,t,n){return qt(this,void 0,void 0,(function*(){return Promise.all(e.map((e=>this.executeOne(e,t,n))))}))}}var Xt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class $t{constructor(e,t,n){this.operators=e,this.keySystemKeyManager=t,this.rootKeyManager=n}executeOne(e,t){return Xt(this,void 0,void 0,(function*(){let n;if((0,I.ContentTypeUsesKeySystemRootKeyEncryption)(e.content_type)){if(!e.key_system_identifier)throw Error("Key system-encrypted payload ".concat(e.content_type,"is missing a key_system_identifier"));n=this.keySystemKeyManager.getPrimaryKeySystemRootKey(e.key_system_identifier)}else n=this.rootKeyManager.getRootKey();if(null==n)throw Error("Attempting root key encryption with no root key");return new Jt(this.operators).executeOne(e,n,t)}))}executeMany(e,t){return Xt(this,void 0,void 0,(function*(){return Promise.all(e.map((e=>this.executeOne(e,t))))}))}}var en,tn,nn;class rn{constructor(e,t){this.items=e,this.mutator=t}execute(){return e=this,t=void 0,r=function*(){const e=this.items.getItems((0,I.ContentTypesUsingRootKeyEncryption)());return e.length>0&&(yield this.mutator.setItemsDirty(e)),b.Result.ok()},new((n=void 0)||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}));var e,t,n,r}}!function(e){e.NewUpdateAvailable="NewUpdateAvailable",e.EditorDidFocus="EditorDidFocus",e.BeganBackupDownload="BeganBackupDownload",e.EndedBackupDownload="EndedBackupDownload",e.PanelResized="PanelResized",e.WindowDidFocus="WindowDidFocus",e.WindowDidBlur="WindowDidBlur",e.MobileKeyboardDidChangeFrame="MobileKeyboardDidChangeFrame",e.MobileKeyboardWillChangeFrame="MobileKeyboardWillChangeFrame"}(en||(en={})),function(e){e.UserRolesChanged="UserRolesChanged",e.FeaturesAvailabilityChanged="Features:FeaturesAvailabilityChanged",e.DidPurchaseSubscription="DidPurchaseSubscription"}(tn||(tn={})),function(e){e.NoUserSubscription="NoUserSubscription",e.NotInCurrentPlan="NotInCurrentPlan",e.InCurrentPlanButExpired="InCurrentPlanButExpired",e.Entitled="Entitled"}(nn||(nn={}));var on=n(86311),sn=n(70781),an=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class ln extends f{constructor(e,t,n,r,i,o,s,a,l,c,u){super(l),this.api=e,this.mutator=t,this.sync=n,this.encryptor=r,this.challengor=i,this.alertService=s,this.crypto=a,this.internalEventBus=l,this.logger=c,this.backupsService=u,this.encryptedCache=new on.F9(1e8),this.sharedVault=new sn.SharedVaultServer(o)}deinit(){super.deinit(),this.encryptedCache.clear(),this.encryptedCache=void 0,this.api=void 0,this.encryptor=void 0,this.sync=void 0,this.alertService=void 0,this.challengor=void 0,this.crypto=void 0}minimumChunkSize(){return 5e6}createUserValetToken(e,t,n){return an(this,void 0,void 0,(function*(){return this.api.createUserFileValetToken(e,t,n)}))}createSharedVaultValetToken(e){return an(this,void 0,void 0,(function*(){if(e.operation!==a.ValetTokenOperation.Write&&!e.fileUuidRequiredForExistingFiles)throw new Error("File UUID is required for for non-write operations");const t=yield this.sharedVault.createSharedVaultFileValetToken({sharedVaultUuid:e.sharedVaultUuid,sharedVaultOwnerUuid:e.sharedVaultOwnerUuid,fileUuid:e.fileUuidRequiredForExistingFiles,remoteIdentifier:e.remoteIdentifier,operation:e.operation,unencryptedFileSize:e.unencryptedFileSizeForUpload,moveOperationType:e.moveOperationType,sharedVaultToSharedVaultMoveTargetUuid:e.sharedVaultToSharedVaultMoveTargetUuid});return(0,a.isErrorResponse)(t)?new a.ClientDisplayableError("Could not create valet token"):t.data.valetToken}))}moveFileToSharedVault(e,t){return an(this,void 0,void 0,(function*(){const n=yield this.createSharedVaultValetToken({sharedVaultUuid:e.shared_vault_uuid?e.shared_vault_uuid:t.sharing.sharedVaultUuid,sharedVaultOwnerUuid:t.sharing.ownerUserUuid,remoteIdentifier:e.remoteIdentifier,operation:a.ValetTokenOperation.Move,fileUuidRequiredForExistingFiles:e.uuid,moveOperationType:e.shared_vault_uuid?"shared-vault-to-shared-vault":"user-to-shared-vault",sharedVaultToSharedVaultMoveTargetUuid:e.shared_vault_uuid?t.sharing.sharedVaultUuid:void 0});return(0,a.isClientDisplayableError)(n)?n:(yield this.api.moveFile(n))?void 0:new a.ClientDisplayableError("Could not move file")}))}moveFileOutOfSharedVault(e){return an(this,void 0,void 0,(function*(){if(!e.shared_vault_uuid)return new a.ClientDisplayableError("File is not in a shared vault");const t=yield this.createSharedVaultValetToken({sharedVaultUuid:e.shared_vault_uuid,remoteIdentifier:e.remoteIdentifier,operation:a.ValetTokenOperation.Move,fileUuidRequiredForExistingFiles:e.uuid,moveOperationType:"shared-vault-to-user"});return(0,a.isClientDisplayableError)(t)?t:(yield this.api.moveFile(t))?void 0:new a.ClientDisplayableError("Could not move file")}))}beginNewFileUpload(e,t){return an(this,void 0,void 0,(function*(){const n=c.UuidGenerator.GenerateUuid(),r=t&&t.isSharedVaultListing()?yield this.createSharedVaultValetToken({sharedVaultUuid:t.sharing.sharedVaultUuid,sharedVaultOwnerUuid:t.sharing.ownerUserUuid,remoteIdentifier:n,operation:a.ValetTokenOperation.Write,unencryptedFileSizeForUpload:e}):yield this.createUserValetToken(n,a.ValetTokenOperation.Write,e);if(r instanceof a.ClientDisplayableError)return r;const i={key:this.crypto.generateRandomKey(I.FileProtocolV1Constants.KeySize),remoteIdentifier:n,decryptedSize:e},o=new on.y4(i,r,this.crypto,this.api,t),s=yield this.api.startUploadSession(r,t&&t.isSharedVaultListing()?"shared-vault":"user");return(0,a.isErrorResponse)(s)||!s.data.uploadId?new a.ClientDisplayableError("Could not start upload session"):o}))}pushBytesForUpload(e,t,n,r){return an(this,void 0,void 0,(function*(){if(!(yield e.pushBytes(t,n,r)))return new a.ClientDisplayableError("Failed to push file bytes to server")}))}finishUpload(e,t,n){return an(this,void 0,void 0,(function*(){if(!(yield this.api.closeUploadSession(e.getValetToken(),e.vault&&e.vault.isSharedVaultListing()?"shared-vault":"user")))return new a.ClientDisplayableError("Could not close upload session");const r=e.getResult(),i={decryptedSize:r.finalDecryptedSize,encryptedChunkSizes:e.encryptedChunkSizes,encryptionHeader:r.encryptionHeader,key:r.key,mimeType:t.mimeType,name:t.name,remoteIdentifier:r.remoteIdentifier},o=new I.DecryptedPayload(Object.assign(Object.assign({uuid:n,content_type:b.ContentType.TYPES.File,content:(0,I.FillItemContent)((0,I.FillItemContentSpecialized)(i)),dirty:!0},(0,I.PayloadVaultOverrides)(e.vault)),(0,I.PayloadTimestampDefaults)())),s=(0,I.CreateItemFromPayload)(o),l=yield this.mutator.insertItem(s);return yield this.sync.sync(),l}))}decryptCachedEntry(e,t){return an(this,void 0,void 0,(function*(){const n=new on.YT(e,this.crypto);let r=new Uint8Array;const i=new on.WE(e.encryptedChunkSizes,"memcache",(e=>an(this,void 0,void 0,(function*(){const t=n.decryptBytes(e.data);t&&(r=new Uint8Array([...r,...t.decryptedBytes]))}))));return yield i.addBytes(t.encryptedBytes),{decryptedBytes:r}}))}downloadFile(e,t){var n;return an(this,void 0,void 0,(function*(){const r=this.encryptedCache.get(e.uuid);if(r){const n=yield this.decryptCachedEntry(e,r);return void(yield t(n.decryptedBytes,{encryptedFileSize:r.encryptedBytes.length,encryptedBytesDownloaded:r.encryptedBytes.length,encryptedBytesRemaining:0,percentComplete:100,source:"memcache"}))}const i=yield null===(n=this.backupsService)||void 0===n?void 0:n.getFileBackupInfo(e);if(this.backupsService&&i)return this.logger.info("Downloading file from backup",i),yield(0,on.mQ)(e,this.backupsService,this.crypto,(e=>an(this,void 0,void 0,(function*(){return this.logger.info("Got local file chunk",e.progress),t(e.data,e.progress)})))),void this.logger.info("Finished downloading file from backup");{this.logger.info("Downloading file from network");const n=e.encryptedSize<this.encryptedCache.maxSize;let r=new Uint8Array;const i=e.shared_vault_uuid?yield this.createSharedVaultValetToken({sharedVaultUuid:e.shared_vault_uuid,remoteIdentifier:e.remoteIdentifier,operation:a.ValetTokenOperation.Read,fileUuidRequiredForExistingFiles:e.uuid}):yield this.createUserValetToken(e.remoteIdentifier,a.ValetTokenOperation.Read);if(i instanceof a.ClientDisplayableError)return i;const o=new on.BI(e,this.crypto,this.api,i),s=yield o.run((e=>{let{decrypted:i,encrypted:o,progress:s}=e;return an(this,void 0,void 0,(function*(){return n&&(r=new Uint8Array([...r,...o.encryptedBytes])),t(i.decryptedBytes,s)}))}));return n&&r.byteLength>0&&this.encryptedCache.add(e.uuid,{encryptedBytes:r}),s.error}}))}deleteFile(e){return an(this,void 0,void 0,(function*(){this.encryptedCache.remove(e.uuid);const t=e.shared_vault_uuid?yield this.createSharedVaultValetToken({sharedVaultUuid:e.shared_vault_uuid,remoteIdentifier:e.remoteIdentifier,operation:a.ValetTokenOperation.Delete,fileUuidRequiredForExistingFiles:e.uuid}):yield this.createUserValetToken(e.remoteIdentifier,a.ValetTokenOperation.Delete);if(t instanceof a.ClientDisplayableError)return t;const n=yield this.api.deleteFile(t,e.shared_vault_uuid?"shared-vault":"user");if((0,a.isErrorResponse)(n)&&!(yield this.alertService.confirm((0,c.spaceSeparatedStrings)("This file could not be deleted from the server, possibly because you are attempting to delete a file item","that was imported from another account. Would you like to remove this file item from your account anyway?","If you're sure the file is yours and still exists on the server, do not choose this option,","and instead try to delete it again."),"Unable to Delete","Delete Anyway",r.Danger)))return a.ClientDisplayableError.FromNetworkError(n);yield this.mutator.setItemToBeDeleted(e),yield this.sync.sync()}))}isFileNameFileBackupRelated(e){return e===on.yW.MetadataFileName?"metadata":e===on.yW.BinaryFileName&&"binary"}decryptBackupMetadataFile(e){return an(this,void 0,void 0,(function*(){const t=new I.EncryptedPayload(Object.assign(Object.assign({},e.itemsKey),{waitingForKey:!1,errorDecrypting:!1})),n=yield Dt(t,this.encryptor,this.challengor);if("failed"===n||"aborted"===n)return;const r=new I.EncryptedPayload(Object.assign(Object.assign({},e.file),{waitingForKey:!1,errorDecrypting:!1})),i=new Pt.rU(n),o=yield this.encryptor.decryptSplitSingle({usesItemsKey:{items:[r],key:i}});return(0,I.isEncryptedPayload)(o)?void 0:new I.FileItem(o)}))}selectFile(e){return an(this,void 0,void 0,(function*(){return yield e.selectFile()}))}readBackupFileAndSaveDecrypted(e,t,n){return an(this,void 0,void 0,(function*(){const r=yield n.selectDirectory();if("aborted"===r||"failed"===r)return r;const i=yield n.createFile(r,t.name);if("aborted"===i||"failed"===i)return i;const o=yield(0,on.Qf)(e,t,n,this.crypto,(e=>an(this,void 0,void 0,(function*(){yield n.saveBytes(i,e)}))));return yield n.closeFileWriteStream(i),o}))}readBackupFileBytesDecrypted(e,t,n){return an(this,void 0,void 0,(function*(){let r=new Uint8Array;return yield(0,on.Qf)(e,t,n,this.crypto,(e=>an(this,void 0,void 0,(function*(){r=new Uint8Array([...r,...e])})))),r}))}}var cn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class un extends f{constructor(e,t,n){super(n),this.desktopDevice=e,this.platform=t,this.internalEventBus=n,this.HOME_SERVER_DATA_DIRECTORY_NAME=".homeserver"}handleEvent(e){return cn(this,void 0,void 0,(function*(){if(e.type===L.ApplicationStageChanged)switch(e.payload.stage){case y.StorageDecrypted_09:yield this.setHomeServerDataLocationOnDevice();break;case y.Launched_10:yield this.startHomeServerIfItIsEnabled()}}))}deinit(){this.desktopDevice=void 0,super.deinit()}getHomeServerStatus(){return cn(this,void 0,void 0,(function*(){return(yield this.desktopDevice.isHomeServerRunning())?{status:"on",url:yield this.getHomeServerUrl()}:{status:"off",errorMessage:yield this.desktopDevice.getHomeServerLastErrorMessage()}}))}getHomeServerLogs(){return cn(this,void 0,void 0,(function*(){return this.desktopDevice.getHomeServerLogs()}))}getHomeServerUrl(){return cn(this,void 0,void 0,(function*(){return this.desktopDevice.getHomeServerUrl()}))}startHomeServer(){return cn(this,void 0,void 0,(function*(){return this.desktopDevice.startHomeServer()}))}stopHomeServer(){return cn(this,void 0,void 0,(function*(){return this.desktopDevice.stopHomeServer()}))}isHomeServerRunning(){return cn(this,void 0,void 0,(function*(){return this.desktopDevice.isHomeServerRunning()}))}activatePremiumFeatures(e,t){return cn(this,void 0,void 0,(function*(){const n=yield this.desktopDevice.activatePremiumFeatures(e,t);return void 0!==n?b.Result.fail(n):b.Result.ok("Premium features activated")}))}setHomeServerConfiguration(e){return cn(this,void 0,void 0,(function*(){yield this.desktopDevice.setHomeServerConfiguration(JSON.stringify(e))}))}getHomeServerConfiguration(){return cn(this,void 0,void 0,(function*(){const e=yield this.desktopDevice.getHomeServerConfiguration();if(e)return JSON.parse(e)}))}enableHomeServer(){return cn(this,void 0,void 0,(function*(){yield this.desktopDevice.setRawStorageValue(u.HomeServerEnabled,"true"),yield this.startHomeServer()}))}isHomeServerEnabled(){return cn(this,void 0,void 0,(function*(){return"true"===(yield this.desktopDevice.getRawStorageValue(u.HomeServerEnabled))}))}getHomeServerDataLocation(){return cn(this,void 0,void 0,(function*(){return this.desktopDevice.getRawStorageValue(u.HomeServerDataLocation)}))}disableHomeServer(){return cn(this,void 0,void 0,(function*(){yield this.desktopDevice.setRawStorageValue(u.HomeServerEnabled,"false");const e=yield this.stopHomeServer();return void 0!==e?b.Result.fail(e):b.Result.ok("Home server disabled")}))}changeHomeServerDataLocation(){return cn(this,void 0,void 0,(function*(){const e=yield this.getHomeServerDataLocation(),t=yield this.desktopDevice.presentDirectoryPickerForLocationChangeAndTransferOld(this.HOME_SERVER_DATA_DIRECTORY_NAME,e);if(!t){const e=yield this.desktopDevice.getDirectoryManagerLastErrorMessage();return b.Result.fail(null!=e?e:"No location selected")}return yield this.desktopDevice.setRawStorageValue(u.HomeServerDataLocation,t),yield this.desktopDevice.setHomeServerDataLocation(t),b.Result.ok(t)}))}openHomeServerDataLocation(){return cn(this,void 0,void 0,(function*(){const e=yield this.getHomeServerDataLocation();e&&this.desktopDevice.openLocation(e)}))}startHomeServerIfItIsEnabled(){return cn(this,void 0,void 0,(function*(){(yield this.isHomeServerEnabled())&&(yield this.startHomeServer())}))}setHomeServerDataLocationOnDevice(){return cn(this,void 0,void 0,(function*(){let e=yield this.getHomeServerDataLocation();if(!e){const t=yield this.desktopDevice.getUserDocumentsDirectory();if(!t)return;const n=this.platform===I.Platform.WindowsDesktop?"\\":"/";e="".concat(t).concat(n).concat(this.HOME_SERVER_DATA_DIRECTORY_NAME)}yield this.desktopDevice.setRawStorageValue(u.HomeServerDataLocation,e),yield this.desktopDevice.setHomeServerDataLocation(e)}))}}var dn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class hn{constructor(e,t,n,r){this.encryption=e,this.keys=t,this._getBackupFileType=n,this._decryptBackupPayloads=r}execute(e,t){return dn(this,void 0,void 0,(function*(){const n=this.convertToPayloads(e),r=this._getBackupFileType.execute(e,n).getValue();if(r===Pt.qX.Corrupt)return b.Result.fail("Invalid backup file.");const{encrypted:i,decrypted:o}=(0,I.CreatePayloadSplit)(n);if(r===Pt.qX.FullyDecrypted)return b.Result.ok([...o,...i]);if(r===Pt.qX.EncryptedWithNonEncryptedItemsKey){const e=yield this.handleEncryptedWithNonEncryptedItemsKeyFileType(n);return e.isFailed()?b.Result.fail(e.getError()):b.Result.ok([...o,...e.getValue()])}if(!t)throw Error("Attempting to decrypt encrypted file with no password");const s=yield this.handleEncryptedFileType({payloads:i,file:e,password:t});return s.isFailed()?b.Result.fail(s.getError()):b.Result.ok([...o,...s.getValue()])}))}handleEncryptedFileType(e){var t;return dn(this,void 0,void 0,(function*(){const n=(0,Pt.jl)(e.file.keyParams||e.file.auth_params),r=yield this.encryption.computeRootKey(e.password,n),i=[],{rootKeyEncryption:o,itemsKeyEncryption:s,keySystemRootKeyEncryption:a}=(0,Pt.xg)(e.payloads),l=yield this.encryption.decryptSplit({usesRootKey:{items:o||[],key:r}}),u=l.filter((e=>(0,Pt.dS)(e)||(0,I.isKeySystemRootKey)(e))).filter(I.isDecryptedPayload).map((e=>(0,I.CreateDecryptedItemFromPayload)(e)));for(const e of null!=a?a:[]){if(!e.key_system_identifier)throw new Error("Attempting to decrypt key system root key encrypted payload with no key system identifier");const n=l.filter(I.isDecryptedPayload).filter(I.isKeySystemRootKey).map((e=>(0,I.CreateDecryptedItemFromPayload)(e))),r=null!==(t=n.find((t=>t.systemIdentifier===e.key_system_identifier)))&&void 0!==t?t:this.keys.getPrimaryKeySystemRootKey(e.key_system_identifier);if(!r){i.push(e.copy({errorDecrypting:!0}));continue}const o=yield this.encryption.decryptSplitSingle({usesKeySystemRootKey:{items:[e],key:r}});(0,I.isDecryptedPayload)(o)&&(0,Pt.mX)(o)&&u.push((0,I.CreateDecryptedItemFromPayload)(o)),i.push(o)}(0,c.extendArray)(i,l);const d=[...null!=s?s:[]],h=yield this._decryptBackupPayloads.execute({payloads:d,recentlyDecryptedKeys:u,keyParams:n,rootKey:r});return h.isFailed()?b.Result.fail(h.getError()):((0,c.extendArray)(i,h.getValue()),b.Result.ok(i))}))}handleEncryptedWithNonEncryptedItemsKeyFileType(e){return dn(this,void 0,void 0,(function*(){const t=[],n=[];e.forEach((e=>{e.content_type===b.ContentType.TYPES.ItemsKey&&(0,I.isDecryptedPayload)(e)?t.push(e):(0,I.isEncryptedPayload)(e)&&n.push(e)}));const r=t.map((e=>(0,I.CreateDecryptedItemFromPayload)(e)));return this._decryptBackupPayloads.execute({payloads:n,recentlyDecryptedKeys:r,rootKey:void 0})}))}convertToPayloads(e){return e.items.map((e=>{if((0,I.isEncryptedTransferPayload)(e))return new I.EncryptedPayload(e);if((0,I.isDecryptedTransferPayload)(e))return new I.DecryptedPayload(e);throw Error("Unhandled case in DecryptBackupFile")}))}}class pn{constructor(e,t,n){this.encryption=e,this._determineKeyToUse=t,this.logger=n}execute(e){return t=this,n=void 0,i=function*(){const t=[];for(const n of e.payloads)try{const r=this._determineKeyToUse.execute({payload:n,recentlyDecryptedKeys:e.recentlyDecryptedKeys,keyParams:e.keyParams,rootKey:e.rootKey}).getValue();if(!r){t.push(n.copy({errorDecrypting:!0}));continue}if((0,Pt.dS)(r)||(0,Pt.mX)(r)){const e=yield this.encryption.decryptSplitSingle({usesItemsKey:{items:[n],key:r}});t.push(e)}else if((0,I.isKeySystemRootKey)(r)){const e=yield this.encryption.decryptSplitSingle({usesKeySystemRootKey:{items:[n],key:r}});t.push(e)}else{const e=yield this.encryption.decryptSplitSingle({usesRootKey:{items:[n],key:r}});t.push(e)}}catch(e){t.push(n.copy({errorDecrypting:!0})),this.logger.error("Error decrypting payload",n,e)}return b.Result.ok(t)},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class fn{constructor(e,t){this.encryption=e,this.keys=t}execute(e){if((0,I.ContentTypeUsesRootKeyEncryption)(e.payload.content_type)){if(!e.rootKey)throw new Error("Attempting to decrypt root key encrypted payload with no root key");return b.Result.ok(e.rootKey)}if((0,I.ContentTypeUsesKeySystemRootKeyEncryption)(e.payload.content_type)){if(!e.payload.key_system_identifier)throw new Error("Attempting to decrypt key system root key encrypted payload with no key system identifier");try{let t=e.recentlyDecryptedKeys.filter(I.isKeySystemRootKey).find((t=>t.systemIdentifier===e.payload.key_system_identifier));return t||(t=this.keys.getPrimaryKeySystemRootKey(e.payload.key_system_identifier)),b.Result.ok(t)}catch(e){return b.Result.fail(JSON.stringify(e))}}if(e.payload.key_system_identifier){const t=e.recentlyDecryptedKeys.find((t=>t.key_system_identifier===e.payload.key_system_identifier));if(t)return b.Result.ok(t)}let t;if(t=e.recentlyDecryptedKeys.filter(Pt.dS).find((t=>e.payload.items_key_id===t.uuid)),t)return b.Result.ok(t);if(e.payload.items_key_id&&(t=this.encryption.itemsKeyForEncryptedPayload(e.payload),t))return b.Result.ok(t);if(t)return b.Result.ok(t);if(!e.keyParams)return b.Result.ok(void 0);const n=e.payload.version;return(0,kt.leftVersionGreaterThanOrEqualToRight)(e.keyParams.version,kt.ProtocolVersion.V004)?t=this.encryption.defaultItemsKeyForItemVersion(n,e.recentlyDecryptedKeys.filter(Pt.dS)):(0,kt.compareVersions)(n,kt.ProtocolVersion.V003)<=0&&(t=e.rootKey),b.Result.ok(t)}}class gn{execute(e,t){if(e.keyParams||e.auth_params)return b.Result.ok(Pt.qX.Encrypted);const n=t.find(I.isEncryptedPayload),r=t.find((e=>e.content_type===b.ContentType.TYPES.ItemsKey&&(0,I.isDecryptedPayload)(e)));return n&&r?b.Result.ok(Pt.qX.EncryptedWithNonEncryptedItemsKey):n?b.Result.ok(Pt.qX.Corrupt):b.Result.ok(Pt.qX.FullyDecrypted)}}class mn{constructor(e){this.challenges=e}execute(){return e=this,t=void 0,r=function*(){const e=new Ge([new ze(He.None,"File account password",void 0,!0)],Ke.DecryptEncryptedFile,!0),t=yield this.challenges.promptForChallengeResponse(e);return null==t?b.Result.fail("Import aborted due to canceled password prompt"):(this.challenges.completeChallenge(e),b.Result.ok(null==t?void 0:t.values[0].value))},new((n=void 0)||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}));var e,t,n,r}}var yn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class vn{constructor(e,t,n,r,i,o,s,a){this.items=e,this.sync=t,this.protections=n,this.encryption=r,this.payloads=i,this.history=o,this._decryptBackFile=s,this._getFilePassword=a}execute(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return yn(this,void 0,void 0,(function*(){const n=this.validateFileVersion(e);if(n.isFailed())return b.Result.fail(n.getError());const r=yield this.decryptData(e);if(r.isFailed())return b.Result.fail(r.getError());const i=this.getValidPayloadsToImportFromDecryptedResult(r.getValue());if(!(yield this.protections.authorizeFileImport()))return b.Result.fail("Import aborted");const o=yield this.payloads.importPayloads(i,this.history.getHistoryMapCopy()),s=this.sync.sync();t&&(yield s);const a=this.items.findItems(o);return b.Result.ok({affectedItems:a,errorCount:r.getValue().length-i.length})}))}validateFileVersion(e){if(e.version){const t=this.validateVersion(e.version);if(t.isFailed())return b.Result.fail(t.getError())}return b.Result.ok()}decryptData(e){return yn(this,void 0,void 0,(function*(){let t;if(e.auth_params||e.keyParams){const e=yield this._getFilePassword.execute();if(e.isFailed())return b.Result.fail(e.getError());t=e.getValue()}this.cleanImportData(e);const n=yield this._decryptBackFile.execute(e,t);return n.isFailed()?b.Result.fail(n.getError()):b.Result.ok(n.getValue())}))}getValidPayloadsToImportFromDecryptedResult(e){return[...e.filter(I.isDecryptedPayload),...e.filter(I.isEncryptedPayload).filter((e=>void 0!==e.key_system_identifier))]}cleanImportData(e){e.items=e.items.map((e=>(0,I.isEncryptedTransferPayload)(e)?(0,I.CreateEncryptedBackupFileContextPayload)(e):(0,I.CreateDecryptedBackupFileContextPayload)(e)))}validateVersion(e){if(!this.encryption.supportedVersions().includes(e))return b.Result.fail("This backup file was created using a newer version of the application and cannot be imported here. Please update your application and try again.");const t=this.encryption.getUserVersion();return t&&1===(0,kt.compareVersions)(e,t)?b.Result.fail("This backup file was created using a newer encryption version than your account's. Please run the available encryption upgrade and try again."):b.Result.ok()}}class An{constructor(e,t){this.payloads=e,this.protections=t}execute(){return e=this,t=void 0,r=function*(){if(!(yield this.protections.authorizeBackupCreation()))return b.Result.fail("Failed to authorize backup creation");const e=this.payloads.nonDeletedItems.filter((e=>e.content_type!==b.ContentType.TYPES.ItemsKey)),t={version:kt.ProtocolVersionLatest,items:e.map((e=>(0,I.isDecryptedPayload)(e)?(0,I.CreateDecryptedBackupFileContextPayload)(e):(0,I.isEncryptedPayload)(e)?(0,I.CreateEncryptedBackupFileContextPayload)(e):void 0)).filter(c.isNotUndefined)};return b.Result.ok(t)},new((n=void 0)||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}));var e,t,n,r}}var bn;class wn{constructor(e,t,n){this.items=e,this.protections=t,this.encryption=n}execute(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{skipAuthorization:!1};return t=this,n=void 0,i=function*(){if(!e.skipAuthorization&&!(yield this.protections.authorizeBackupCreation()))return b.Result.fail("Failed to authorize backup creation");const t=this.items.items.map((e=>e.payload)),n=(0,Pt.xg)(t),r=(0,Pt.Ak)(n),i=(yield this.encryption.encryptSplit(r)).map((e=>(0,I.CreateEncryptedBackupFileContextPayload)(e))),o={version:kt.ProtocolVersionLatest,items:i},s=this.encryption.getRootKeyParams();return o.keyParams=null==s?void 0:s.getPortableValue(),b.Result.ok(o)},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}!function(e){e.IntegrityCheckCompleted="IntegrityCheckCompleted"}(bn||(bn={}));class Sn extends f{constructor(e,t,n,r,i){super(i),this.integrityApi=e,this.itemApi=t,this.payloadManager=n,this.logger=r,this.internalEventBus=i}handleEvent(e){var t,n,r,i,o,s;return r=this,i=void 0,s=function*(){if(e.type!==E.SyncRequestsIntegrityCheck)return;const r=yield this.integrityApi.checkIntegrity(this.payloadManager.integrityPayloads);if((0,a.isErrorResponse)(r))return void this.logger.error("Could not obtain integrity check: ".concat(null===(t=r.data.error)||void 0===t?void 0:t.message));const i=[];for(const e of r.data.mismatches)i.push(this.itemApi.getSingleItem(e.uuid));const o=yield Promise.all(i),s=[];for(const e of o)null!=e.data&&!(0,a.isErrorResponse)(e)&&"item"in e.data?s.push(e.data.item):this.logger.error("Could not obtain item for integrity adjustments: ".concat((0,a.isErrorResponse)(e)?null===(n=e.data.error)||void 0===n?void 0:n.message:""));yield this.notifyEventSync(bn.IntegrityCheckCompleted,{rawPayloads:s,source:e.payload.source})},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(n,a)}l((s=s.apply(r,i||[])).next())}))}}var Cn;class En{constructor(){this.eventHandlers=new Map}deinit(){this.eventHandlers=void 0}addEventHandler(e,t){let n=this.eventHandlers.get(t);void 0===n&&(n=[]),n.push(e),this.eventHandlers.set(t,n)}publish(e){const t=this.eventHandlers.get(e.type);if(void 0!==t)for(const n of t)n.handleEvent(e)}publishSync(e,t){return n=this,r=void 0,o=function*(){const n=this.eventHandlers.get(e.type);if(void 0!==n){if(t===l.SEQUENCE)for(const t of n)yield t.handleEvent(e);if(t===l.ASYNC){const t=[];for(const r of n)t.push(r.handleEvent(e));yield Promise.all(t)}}},new((i=void 0)||(i=Promise))((function(e,t){function s(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(n,r||[])).next())}));var n,r,i,o}}!function(e){e[e.AReferencesB=0]="AReferencesB",e[e.BReferencesA=1]="BReferencesA",e[e.NoRelationship=2]="NoRelationship"}(Cn||(Cn={}));class In{countNotesAndTags(e){const t={notes:0,archived:0,deleted:0,tags:0};for(const n of e)n.trashed?t.deleted++:n.archived?t.archived++:n.content_type!==b.ContentType.TYPES.Note||n.conflictOf?n.content_type!==b.ContentType.TYPES.Tag||t.tags++:t.notes++;return t}}var _n=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class xn extends f{constructor(e,t,n,r,i,o,s){super(s),this.items=e,this.payloads=t,this.storage=n,this.operators=r,this.keys=i,this._findDefaultItemsKey=o,this.internalEventBus=s,this.removeItemsObserver=this.items.addObserver([b.ContentType.TYPES.ItemsKey],(e=>{let{changed:t,inserted:n}=e;t.concat(n).length>0&&this.decryptErroredItemPayloads()}))}deinit(){this.items=void 0,this.payloads=void 0,this.storage=void 0,this.operators=void 0,this.keys=void 0,this.removeItemsObserver(),this.removeItemsObserver=void 0,super.deinit()}repersistAllItems(){return _n(this,void 0,void 0,(function*(){const e=this.items.items.map((e=>e.payload));return this.storage.savePayloads(e)}))}getItemsKeys(){return this.items.getDisplayableItemsKeys()}itemsKeyForEncryptedPayload(e){return[...this.getItemsKeys(),...this.items.getItems(b.ContentType.TYPES.KeySystemItemsKey)].find((t=>t.uuid===e.items_key_id||t.duplicateOf===e.items_key_id))}getDefaultItemsKey(){return this._findDefaultItemsKey.execute(this.getItemsKeys()).getValue()}keyToUseForItemEncryption(e){if(e.key_system_identifier){return this.keys.getPrimaryKeySystemItemsKey(e.key_system_identifier)||new Pt.KX("Cannot find key system items key to use for encryption")}const t=this.getDefaultItemsKey();let n;return n=this.userVersion&&this.userVersion!==(null==t?void 0:t.keyVersion)?this.getItemsKeys().find((e=>e.keyVersion===this.userVersion)):t,n||new Pt.KX("Cannot find items key to use for encryption")}keyToUseForDecryptionOfPayload(e){return e.items_key_id?this.itemsKeyForEncryptedPayload(e):this.defaultItemsKeyForItemVersion(e.version)}encryptPayloadWithKeyLookup(e,t){return _n(this,void 0,void 0,(function*(){const n=this.keyToUseForItemEncryption(e);if(n instanceof Pt.KX)throw Error(n.message);return this.encryptPayload(e,n,t)}))}encryptPayload(e,t,n){return _n(this,void 0,void 0,(function*(){if((0,I.isEncryptedPayload)(e))throw Error("Attempting to encrypt already encrypted payload.");if(!e.content)throw Error("Attempting to encrypt payload with no content.");if(!e.uuid)throw Error("Attempting to encrypt payload with no UuidGenerator.");return(0,Pt.Gl)(e,t,this.operators,n)}))}encryptPayloads(e,t,n){return _n(this,void 0,void 0,(function*(){return Promise.all(e.map((e=>this.encryptPayload(e,t,n))))}))}encryptPayloadsWithKeyLookup(e,t){return _n(this,void 0,void 0,(function*(){return Promise.all(e.map((e=>this.encryptPayloadWithKeyLookup(e,t))))}))}decryptPayloadWithKeyLookup(e){return _n(this,void 0,void 0,(function*(){const t=this.keyToUseForDecryptionOfPayload(e);return null==t?{uuid:e.uuid,errorDecrypting:!0,waitingForKey:!0}:this.decryptPayload(e,t)}))}decryptPayload(e,t){return _n(this,void 0,void 0,(function*(){return e.content?(0,Pt.oO)(e,t,this.operators):{uuid:e.uuid,errorDecrypting:!0}}))}decryptPayloadsWithKeyLookup(e){return _n(this,void 0,void 0,(function*(){return Promise.all(e.map((e=>this.decryptPayloadWithKeyLookup(e))))}))}decryptPayloads(e,t){return _n(this,void 0,void 0,(function*(){return Promise.all(e.map((e=>this.decryptPayload(e,t))))}))}decryptErroredItemPayloads(){return _n(this,void 0,void 0,(function*(){const e=this.payloads.invalidPayloads.filter((e=>!(0,I.ContentTypeUsesRootKeyEncryption)(e.content_type)&&!(0,I.ContentTypeUsesKeySystemRootKeyEncryption)(e.content_type)));if(0===e.length)return;const t=(yield this.decryptPayloadsWithKeyLookup(e)).map((t=>{const n=(0,I.SureFindPayload)(e,t.uuid);return(0,Pt.XL)(t)?new I.EncryptedPayload(Object.assign(Object.assign({},n.ejected()),t)):new I.DecryptedPayload(Object.assign(Object.assign({},n.ejected()),t))}));yield this.payloads.emitPayloads(t,I.PayloadEmitSource.LocalChanged)}))}defaultItemsKeyForItemVersion(e,t){const n=t||this.getItemsKeys();return n.find((t=>t.isDefault&&t.keyVersion===e))||n.find((t=>t.keyVersion===e))}}var Pn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};const kn="key-system-root-key-";class Bn extends f{constructor(e,t,n,r,i){super(i),this.items=e,this.mutator=t,this.storage=n,this._removeItemsFromMemory=r,this.rootKeyMemoryCache={}}deinit(){this.items=void 0,this.mutator=void 0,this.storage=void 0,this._removeItemsFromMemory=void 0,super.deinit()}handleEvent(e){return Pn(this,void 0,void 0,(function*(){e.type===L.ApplicationStageChanged&&e.payload.stage===y.StorageDecrypted_09&&this.loadRootKeysFromStorage()}))}loadRootKeysFromStorage(){const e=this.storage.getAllKeys().filter((e=>e.startsWith(kn))).map((e=>this.storage.getValue(e))).map((e=>new I.DecryptedPayload(e))).map((e=>new I.KeySystemRootKey(e)));for(const t of e)this.rootKeyMemoryCache[t.systemIdentifier]=t}getRootKeyFromStorageForVault(e){const t=this.storage.getValue(this.storageKeyForRootKey(e));if(!t)return;const n=new I.DecryptedPayload(t);return new I.KeySystemRootKey(n)}getMemCachedRootKey(e){return this.rootKeyMemoryCache[e]}storageKeyForRootKey(e){return"".concat(kn).concat(e)}queueVaultItemsKeysForReencryption(e){return Pn(this,void 0,void 0,(function*(){const t=this.getKeySystemItemsKeys(e);t.length>0&&(yield this.mutator.setItemsDirty(t))}))}cacheKey(e,t){this.rootKeyMemoryCache[e.systemIdentifier]=e,t===I.KeySystemRootKeyStorageMode.Local&&this.storage.setValue(this.storageKeyForRootKey(e.systemIdentifier),e.payload.ejected())}removeKeyFromCache(e){delete this.rootKeyMemoryCache[e],this.storage.removeValue(this.storageKeyForRootKey(e))}getAllSyncedKeySystemRootKeys(){return this.items.getItems(b.ContentType.TYPES.KeySystemRootKey)}wipeVaultKeysFromMemory(e){return Pn(this,void 0,void 0,(function*(){delete this.rootKeyMemoryCache[e.systemIdentifier];const t=this.getKeySystemItemsKeys(e.systemIdentifier);yield this._removeItemsFromMemory.execute(t)}))}getSyncedKeySystemRootKeysForVault(e){return this.items.itemsMatchingPredicate(b.ContentType.TYPES.KeySystemRootKey,new I.Predicate("systemIdentifier","=",e))}getAllKeySystemRootKeysForVault(e){return[...this.getSyncedKeySystemRootKeysForVault(e),...this.rootKeyMemoryCache[e]?[this.rootKeyMemoryCache[e]]:[]]}deleteNonPersistentSystemRootKeysForVault(e){return Pn(this,void 0,void 0,(function*(){delete this.rootKeyMemoryCache[e],yield this.storage.removeValue(this.storageKeyForRootKey(e))}))}deleteAllSyncedKeySystemRootKeys(e){return Pn(this,void 0,void 0,(function*(){const t=this.getSyncedKeySystemRootKeysForVault(e);yield this.mutator.setItemsToBeDeleted(t)}))}getPrimaryKeySystemRootKey(e){return this.getAllKeySystemRootKeysForVault(e).sort(((e,t)=>t.keyParams.creationTimestamp-e.keyParams.creationTimestamp))[0]}getAllKeySystemItemsKeys(){return[...this.items.getItems(b.ContentType.TYPES.KeySystemItemsKey),...this.items.invalidItems.filter((e=>e.content_type===b.ContentType.TYPES.KeySystemItemsKey))]}getKeySystemItemsKeys(e){return this.items.getItems(b.ContentType.TYPES.KeySystemItemsKey).filter((t=>t.key_system_identifier===e))}getPrimaryKeySystemItemsKey(e){const t=this.getPrimaryKeySystemRootKey(e);if(!t)throw new Error("No primary key system root key found");return this.getKeySystemItemsKeys(e).filter((e=>e.rootKeyToken===t.token)).sort(((e,t)=>t.creationTimestamp-e.creationTimestamp))[0]}}var On,Nn,Dn,jn;!function(e){e.ActiveThemes="activeThemes",e.UseSystemColorScheme="useSystemColorScheme",e.UseTranslucentUI="useTranslucentUI",e.AutoLightThemeIdentifier="autoLightThemeIdentifier",e.AutoDarkThemeIdentifier="autoDarkThemeIdentifier",e.EditorMonospaceEnabled="monospaceFont",e.EditorLineHeight="editorLineHeight",e.EditorLineWidth="editorLineWidth",e.EditorFontSize="editorFontSize"}(On||(On={})),function(e){e.LocalPreferencesChanged="LocalPreferencesChanged",e.PreferencesChanged="PreferencesChanged"}(Nn||(Nn={})),function(e){e.Immediately="immediately",e.OnQuit="on-quit"}(Dn||(Dn={})),function(e){e.UnprotectedSessionBegan="Protection:UnprotectedSessionBegan",e.UnprotectedSessionExpired="Protection:UnprotectedSessionExpired",e.BiometricsSoftLockEngaged="Protection:BiometricsSoftLockEngaged",e.BiometricsSoftLockDisengaged="Protection:BiometricsSoftLockDisengaged"}(jn||(jn={}));var Tn,Mn,Fn,Rn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Ln extends f{constructor(e,t){super(t),this.revisionApiService=e,this.internalEventBus=t}listRevisions(e){return Rn(this,void 0,void 0,(function*(){const t=yield this.revisionApiService.listRevisions(e.value);if((0,a.isErrorResponse)(t))throw new Error((0,a.getErrorFromErrorResponse)(t).message);return t.data.revisions}))}deleteRevision(e,t){return Rn(this,void 0,void 0,(function*(){const n=yield this.revisionApiService.deleteRevision(e.value,t.value);if((0,a.isErrorResponse)(n))throw new Error((0,a.getErrorFromErrorResponse)(n).message);return n.data.message}))}getRevision(e,t){return Rn(this,void 0,void 0,(function*(){const n=yield this.revisionApiService.getRevision(e.value,t.value);if((0,a.isErrorResponse)(n))throw new Error((0,a.getErrorFromErrorResponse)(n).message);return n.data.revision}))}}!function(e){e[e.Default=1]="Default",e[e.Ephemeral=2]="Ephemeral"}(Tn||(Tn={})),function(e){e[e.Default=1]="Default",e[e.Nonwrapped=2]="Nonwrapped"}(Mn||(Mn={})),function(e){e.Wrapped="wrapped",e.Unwrapped="unwrapped",e.Nonwrapped="nonwrapped"}(Fn||(Fn={}));var Qn,Un,Vn,Kn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Hn extends f{constructor(e,t,n,r,i,o){super(o),this.device=e,this.storage=t,this.operators=n,this.identifier=r,this._reencryptTypeAItems=i,this.keyMode=xt.RootKeyNone}deinit(){super.deinit(),this.device=void 0,this.storage=void 0,this.operators=void 0,this.identifier=void 0,this._reencryptTypeAItems=void 0,this.rootKey=void 0,this.memoizedRootKeyParams=void 0}initialize(){return Kn(this,void 0,void 0,(function*(){const e=this.getWrappedRootKey(),t=this.recomputeAccountKeyParams(),n=yield this.hasRootKeyWrapper(),r=null!=e||null!=t;if(n&&r)this.keyMode=xt.RootKeyPlusWrapper;else if(n&&!r)this.keyMode=xt.WrapperOnly;else if(!n&&r)this.keyMode=xt.RootKeyOnly;else{if(n||r)throw"Invalid key mode condition";this.keyMode=xt.RootKeyNone}this.keyMode===xt.RootKeyOnly&&(this.setRootKeyInstance(yield this.getRootKeyFromKeychain()),yield this.handleKeyStatusChange())}))}getMemoizedRootKeyParams(){return this.memoizedRootKeyParams}getKeyMode(){return this.keyMode}hasRootKeyWrapper(){return Kn(this,void 0,void 0,(function*(){return null!=this.getRootKeyWrapperKeyParams()}))}getRootKeyWrapperKeyParams(){const e=this.storage.getValue(d.RootKeyWrapperKeyParams,Mn.Nonwrapped);if(e)return(0,Pt.jl)(e)}passcodeUpgradeAvailable(){return Kn(this,void 0,void 0,(function*(){const e=this.getRootKeyWrapperKeyParams();return!!e&&e.version!==kt.ProtocolVersionLatest}))}hasAccount(){switch(this.keyMode){case xt.RootKeyNone:case xt.WrapperOnly:return!1;case xt.RootKeyOnly:case xt.RootKeyPlusWrapper:return!0;default:throw Error("Unhandled keyMode value.")}}getUserVersion(){const e=this.memoizedRootKeyParams;return null==e?void 0:e.version}hasRootKeyEncryptionSource(){return this.hasAccount()||this.hasPasscode()}computeRootKey(e,t){return Kn(this,void 0,void 0,(function*(){const n=t.version;return this.operators.operatorForVersion(n).computeRootKey(e,t)}))}deleteWorkspaceSpecificKeyStateFromDevice(){return Kn(this,void 0,void 0,(function*(){yield this.device.clearNamespacedKeychainValue(this.identifier),yield this.storage.removeValue(d.WrappedRootKey,Mn.Nonwrapped),yield this.storage.removeValue(d.RootKeyWrapperKeyParams,Mn.Nonwrapped),yield this.storage.removeValue(d.RootKeyParams,Mn.Nonwrapped),this.keyMode=xt.RootKeyNone,this.setRootKeyInstance(void 0),yield this.handleKeyStatusChange()}))}createRootKey(e,t,n,r){return Kn(this,void 0,void 0,(function*(){return(r?this.operators.operatorForVersion(r):this.operators.defaultOperator()).createRootKey(e,t,n)}))}validateAccountPassword(e){return Kn(this,void 0,void 0,(function*(){const t=yield this.computeRootKey(e,this.memoizedRootKeyParams),n=this.getSureRootKey().compare(t);return n?{valid:n,artifacts:{rootKey:t}}:{valid:!1}}))}validatePasscode(e){return Kn(this,void 0,void 0,(function*(){const t=this.getSureRootKeyWrapperKeyParams(),n=yield this.computeRootKey(e,t),r=yield this.validateWrappingKey(n);return r?{valid:r,artifacts:{wrappingKey:n}}:{valid:!1}}))}getEncryptionSourceVersion(){return Kn(this,void 0,void 0,(function*(){if(this.hasAccount())return this.getSureUserVersion();if(this.hasPasscode())return this.getSureRootKeyWrapperKeyParams().version;throw Error("Attempting to access encryption source version without source")}))}getSureUserVersion(){return this.memoizedRootKeyParams.version}handleKeyStatusChange(){return Kn(this,void 0,void 0,(function*(){this.recomputeAccountKeyParams(),this.notifyEvent(_t.RootKeyManagerKeyStatusChanged)}))}hasPasscode(){return this.keyMode===xt.WrapperOnly||this.keyMode===xt.RootKeyPlusWrapper}recomputeAccountKeyParams(){const e=this.storage.getValue(d.RootKeyParams,Mn.Nonwrapped);if(e)return this.memoizedRootKeyParams=(0,Pt.jl)(e),this.memoizedRootKeyParams}getSureRootKeyWrapperKeyParams(){return this.getRootKeyWrapperKeyParams()}wrapAndPersistRootKey(e){return Kn(this,void 0,void 0,(function*(){const t=this.getSureRootKey(),n=Object.assign(Object.assign({},t.payload.ejected()),{content:(0,I.FillItemContentSpecialized)(t.persistableValueWhenWrapping())}),r=new I.DecryptedPayload(n),i=new Jt(this.operators),o=yield i.executeOne(r,e),s=new I.EncryptedPayload(Object.assign(Object.assign(Object.assign({},r.ejected()),o),{errorDecrypting:!1,waitingForKey:!1}));this.storage.setValue(d.WrappedRootKey,s.ejected(),Mn.Nonwrapped)}))}unwrapRootKey(e){return Kn(this,void 0,void 0,(function*(){if(this.keyMode===xt.WrapperOnly)return void this.setRootKeyInstance(e);if(this.keyMode!==xt.RootKeyPlusWrapper)throw"Invalid key mode condition for unwrapping.";const t=this.getWrappedRootKey(),n=new I.EncryptedPayload(t),r=new zt(this.operators),i=yield r.executeOne(n,e);if((0,Pt.XL)(i))throw Error("Unable to decrypt root key with provided wrapping key.");{const e=new I.DecryptedPayload(Object.assign(Object.assign({},n.ejected()),i));this.setRootKeyInstance(new Pt.t$(e)),yield this.handleKeyStatusChange()}}))}setNewRootKeyWrapper(e){return Kn(this,void 0,void 0,(function*(){if(this.keyMode===xt.RootKeyNone)this.keyMode=xt.WrapperOnly;else{if(this.keyMode!==xt.RootKeyOnly)throw Error("Attempting to set wrapper on already wrapped key.");this.keyMode=xt.RootKeyPlusWrapper}if(yield this.device.clearNamespacedKeychainValue(this.identifier),this.keyMode!==xt.WrapperOnly&&this.keyMode!==xt.RootKeyPlusWrapper)throw Error("Invalid keyMode on setNewRootKeyWrapper");this.keyMode===xt.WrapperOnly?(this.setRootKeyInstance(e),yield this._reencryptTypeAItems.execute()):yield this.wrapAndPersistRootKey(e),this.storage.setValue(d.RootKeyWrapperKeyParams,e.keyParams.getPortableValue(),Mn.Nonwrapped),yield this.handleKeyStatusChange()}))}removeRootKeyWrapper(){return Kn(this,void 0,void 0,(function*(){if(this.keyMode!==xt.WrapperOnly&&this.keyMode!==xt.RootKeyPlusWrapper)throw Error("Attempting to remove root key wrapper on unwrapped key.");this.keyMode===xt.WrapperOnly?(this.keyMode=xt.RootKeyNone,this.setRootKeyInstance(void 0)):this.keyMode===xt.RootKeyPlusWrapper&&(this.keyMode=xt.RootKeyOnly),yield this.storage.removeValue(d.WrappedRootKey,Mn.Nonwrapped),yield this.storage.removeValue(d.RootKeyWrapperKeyParams,Mn.Nonwrapped),this.keyMode===xt.RootKeyOnly&&(yield this.saveRootKeyToKeychain()),yield this.handleKeyStatusChange()}))}setRootKey(e,t){return Kn(this,void 0,void 0,(function*(){if(!e.keyParams)throw Error("keyParams must be supplied if setting root key.");if(this.getRootKey()===e)throw Error("Attempting to set root key as same current value.");if(this.keyMode===xt.WrapperOnly)this.keyMode=xt.RootKeyPlusWrapper;else if(this.keyMode===xt.RootKeyNone)this.keyMode=xt.RootKeyOnly;else if(this.keyMode!==xt.RootKeyOnly&&this.keyMode!==xt.RootKeyPlusWrapper)throw Error("Unhandled key mode for setNewRootKey");if(this.setRootKeyInstance(e),this.storage.setValue(d.RootKeyParams,e.keyParams.getPortableValue(),Mn.Nonwrapped),this.keyMode===xt.RootKeyOnly)yield this.saveRootKeyToKeychain();else if(this.keyMode===xt.RootKeyPlusWrapper){if(!t)throw Error("wrappingKey must be supplied");yield this.wrapAndPersistRootKey(t)}yield this.handleKeyStatusChange()}))}getRootKeyParams(){if(this.keyMode===xt.WrapperOnly)return this.getRootKeyWrapperKeyParams();if(this.keyMode===xt.RootKeyOnly||this.keyMode===xt.RootKeyPlusWrapper)return this.recomputeAccountKeyParams();if(this.keyMode!==xt.RootKeyNone)throw"Unhandled key mode for getRootKeyParams"}getSureRootKeyParams(){return this.getRootKeyParams()}saveRootKeyToKeychain(){return Kn(this,void 0,void 0,(function*(){if(null==this.getRootKey())throw"Attempting to non-existent root key to the keychain.";if(this.keyMode!==xt.RootKeyOnly)throw"Should not be persisting wrapped key to keychain.";const e=this.getSureRootKey().getKeychainValue();return this.executeCriticalFunction((()=>this.device.setNamespacedKeychainValue(e,this.identifier)))}))}validateWrappingKey(e){return Kn(this,void 0,void 0,(function*(){const t=this.getWrappedRootKey();if(this.keyMode===xt.WrapperOnly)return this.storage.canDecryptWithKey(e);if(this.keyMode===xt.RootKeyOnly||this.keyMode===xt.RootKeyPlusWrapper){const n=new I.EncryptedPayload(t),r=new zt(this.operators),i=yield r.executeOne(n,e);return!(0,Pt.XL)(i)}throw"Unhandled case in validateWrappingKey"}))}getWrappedRootKey(){return this.storage.getValue(d.WrappedRootKey,Mn.Nonwrapped)}setRootKeyInstance(e){this.rootKey=e}getRootKey(){return this.rootKey}getSureRootKey(){return this.rootKey}getRootKeyFromKeychain(){return Kn(this,void 0,void 0,(function*(){const e=yield this.device.getNamespacedKeychainValue(this.identifier);if(null==e)return;const t=this.getSureRootKeyParams();return(0,Pt.C4)(Object.assign(Object.assign({},e),{keyParams:t.getPortableValue()}))}))}}!function(e){e.Restored="SessionEvent:SessionRestored",e.Revoked="SessionEvent:SessionRevoked",e.UserKeyPairChanged="SessionEvent:UserKeyPairChanged"}(Qn||(Qn={})),function(e){e.SharedVaultStatusChanged="SharedVaultStatusChanged",e.SharedVaultFileStorageUsageChanged="SharedVaultFileStorageUsageChanged"}(Un||(Un={})),function(e){e.NotificationReceived="NotificationReceived"}(Vn||(Vn={}));var Gn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Yn extends f{constructor(e,t,n,r,i,o,s,a,l,c,u,d,h,p,f){super(f),this.items=e,this.session=t,this.vaultUsers=n,this._syncLocalVaultsWithRemoteSharedVaults=r,this._getVault=i,this._getOwnedSharedVaults=o,this._createSharedVault=s,this._handleKeyPairChange=a,this._findContact=l,this._deleteThirdPartyVault=c,this._shareContactWithVault=u,this._convertToSharedVault=d,this._deleteSharedVault=h,this._discardItemsLocally=p,this.eventDisposers.push(e.addObserver(b.ContentType.TYPES.TrustedContact,(e=>{let{changed:t,source:n}=e;return Gn(this,void 0,void 0,(function*(){n===I.PayloadEmitSource.LocalChanged&&t.length>0&&this.handleTrustedContactsChange(t)}))})))}deinit(){super.deinit(),this.items=void 0,this.session=void 0,this._syncLocalVaultsWithRemoteSharedVaults=void 0,this._getVault=void 0,this._createSharedVault=void 0,this._handleKeyPairChange=void 0,this._findContact=void 0,this._deleteThirdPartyVault=void 0,this._shareContactWithVault=void 0,this._convertToSharedVault=void 0,this._deleteSharedVault=void 0}handleEvent(e){return Gn(this,void 0,void 0,(function*(){switch(e.type){case Qn.UserKeyPairChanged:{const t=e.payload;this._handleKeyPairChange.execute({newKeys:t.current,previousKeys:t.previous});break}case Vn.NotificationReceived:yield this.handleNotification(e.payload);break;case E.ReceivedRemoteSharedVaults:this.notifyEvent(Un.SharedVaultStatusChanged)}}))}handleNotification(e){return Gn(this,void 0,void 0,(function*(){switch(e.eventPayload.props.type.value){case b.NotificationType.TYPES.SelfRemovedFromSharedVault:{const t=this._getVault.execute({sharedVaultUuid:e.eventPayload.props.primaryIdentifier.value});t.isFailed()||(yield this._deleteThirdPartyVault.execute(t.getValue()));break}case b.NotificationType.TYPES.UserRemovedFromSharedVault:{const t=this._getVault.execute({sharedVaultUuid:e.eventPayload.props.primaryIdentifier.value});if(!t.isFailed()){const n=t.getValue();this.vaultUsers.invalidateVaultUsersCache(e.eventPayload.props.primaryIdentifier.value).catch(console.error),yield this._syncLocalVaultsWithRemoteSharedVaults.execute([n]),this.notifyEvent(Un.SharedVaultStatusChanged)}break}case b.NotificationType.TYPES.SharedVaultItemRemoved:{const t=this.items.findItem(e.eventPayload.props.secondaryIdentifier.value);t&&this._discardItemsLocally.execute([t]);break}case b.NotificationType.TYPES.SharedVaultFileRemoved:case b.NotificationType.TYPES.SharedVaultFileUploaded:case b.NotificationType.TYPES.UserDesignatedAsSurvivor:{const t=this._getVault.execute({sharedVaultUuid:e.eventPayload.props.primaryIdentifier.value});t.isFailed()||(yield this._syncLocalVaultsWithRemoteSharedVaults.execute([t.getValue()]),this.notifyEvent(Un.SharedVaultStatusChanged));break}}}))}createSharedVault(e){var t;return Gn(this,void 0,void 0,(function*(){return this._createSharedVault.execute({vaultName:e.name,vaultDescription:e.description,vaultIcon:e.iconString,userInputtedPassword:e.userInputtedPassword,storagePreference:null!==(t=e.storagePreference)&&void 0!==t?t:I.KeySystemRootKeyStorageMode.Synced})}))}convertVaultToSharedVault(e){return Gn(this,void 0,void 0,(function*(){return this._convertToSharedVault.execute({vault:e})}))}handleTrustedContactsChange(e){return Gn(this,void 0,void 0,(function*(){for(const t of e)t.isMe||(yield this.shareContactWithVaults(t))}))}deleteSharedVault(e){return Gn(this,void 0,void 0,(function*(){return this._deleteSharedVault.execute({sharedVault:e})}))}shareContactWithVaults(e){return Gn(this,void 0,void 0,(function*(){if(e.isMe)throw new Error("Cannot share self contact");const t=this._getOwnedSharedVaults.execute().getValue();for(const n of t)yield this._shareContactWithVault.execute({sharedVault:n,contactToShare:e})}))}getItemLastEditedBy(e){if(!e.last_edited_by_uuid)return;const t=this._findContact.execute({userUuid:e.last_edited_by_uuid});return t.isFailed()?void 0:t.getValue()}getItemSharedBy(e){if(!e.user_uuid||e.user_uuid===this.session.getSureUser().uuid)return;const t=this._findContact.execute({userUuid:e.user_uuid});return t.isFailed()?void 0:t.getValue()}}class zn{constructor(e){this.getVaultUsers=e}execute(e){return t=this,n=void 0,i=function*(){const t=yield this.getVaultUsers.execute({sharedVaultUuid:e.vault.sharing.sharedVaultUuid,readFromCache:!1});return t.isFailed()?b.Result.fail("Failed to get vault users"):b.Result.ok(t.getValue().some((t=>t.user_uuid===e.contact.contactUuid)))},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class Zn{constructor(e,t,n,r){this.mutator=e,this.sharedVaultServer=t,this._moveItemsToVault=n,this._getVaultItems=r}execute(e){return t=this,n=void 0,i=function*(){if(e.vault.isSharedVaultListing())throw new Error("Cannot convert a shared vault to a shared vault");const t=yield this.sharedVaultServer.createSharedVault();if((0,a.isErrorResponse)(t))return a.ClientDisplayableError.FromString("Failed to convert to shared vault ".concat(JSON.stringify(t)));const n=t.data.sharedVault,r=yield this.mutator.changeItem(e.vault,(e=>{e.sharing={sharedVaultUuid:n.uuid,ownerUserUuid:n.user_uuid,fileBytesUsed:n.file_upload_bytes_used,designatedSurvivor:null}})),i=this._getVaultItems.execute(r).getValue();return yield this._moveItemsToVault.execute({vault:r,items:i}),r},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class Wn{constructor(e,t,n,r,i){this.mutator=e,this.sharedVaultServer=t,this._createVault=n,this._moveItemsToVault=r,this._getVaultItems=i}execute(e){var t,n,r,i,o;return n=this,r=void 0,o=function*(){const n=yield this._createVault.execute({vaultName:e.vaultName,vaultDescription:e.vaultDescription,vaultIcon:e.vaultIcon,userInputtedPassword:e.userInputtedPassword,storagePreference:e.storagePreference}),r=yield this.sharedVaultServer.createSharedVault();if((0,a.isErrorResponse)(r))return a.ClientDisplayableError.FromString("Failed to create shared vault: ".concat(null===(t=r.data.error)||void 0===t?void 0:t.message));const i=r.data.sharedVault,o=yield this.mutator.changeItem(n,(e=>{e.sharing={sharedVaultUuid:i.uuid,ownerUserUuid:i.user_uuid,fileBytesUsed:i.file_upload_bytes_used,designatedSurvivor:null}})),s=this._getVaultItems.execute(o).getValue();return yield this._moveItemsToVault.execute({vault:o,items:s}),o},new((i=void 0)||(i=Promise))((function(e,t){function s(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(n,r||[])).next())}))}}var qn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Jn{constructor(e,t,n,r,i){this.items=e,this.mutator=t,this.keys=n,this.sync=r,this._discardItemsLocally=i}execute(e){return qn(this,void 0,void 0,(function*(){yield this.deleteDataSharedByVaultUsers(e),yield this.deleteDataOwnedByThisUser(e),yield this.keys.deleteNonPersistentSystemRootKeysForVault(e.systemIdentifier),this.sync.sync({sourceDescription:"Not awaiting due to this event handler running from sync response"})}))}deleteDataSharedByVaultUsers(e){return qn(this,void 0,void 0,(function*(){const t=this.items.allTrackedItems().filter((t=>t.key_system_identifier===e.systemIdentifier)),n=this.keys.getKeySystemItemsKeys(e.systemIdentifier);yield this._discardItemsLocally.execute([...t,...n])}))}deleteDataOwnedByThisUser(e){return qn(this,void 0,void 0,(function*(){const t=this.keys.getSyncedKeySystemRootKeysForVault(e.systemIdentifier);yield this.mutator.setItemsToBeDeleted(t),yield this.mutator.setItemToBeDeleted(e)}))}}class Xn{constructor(e,t,n){this.sharedVaultServer=e,this.sync=t,this.deleteVault=n}execute(e){return t=this,n=void 0,i=function*(){const t=yield this.sharedVaultServer.deleteSharedVault({sharedVaultUuid:e.sharedVault.sharing.sharedVaultUuid});if((0,a.isErrorResponse)(t))return a.ClientDisplayableError.FromString("Failed to delete vault ".concat(JSON.stringify(t)));yield this.deleteVault.execute(e.sharedVault),yield this.sync.sync()},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class $n{constructor(e,t){this._getSharedVaults=e,this._isVaultOwnwer=t}execute(){const e=this._getSharedVaults.execute().getValue().filter((e=>this._isVaultOwnwer.execute(e).getValue()));return b.Result.ok(e)}}class er{constructor(e){this.getVaults=e}execute(){const e=this.getVaults.execute().getValue().filter((e=>e.isSharedVaultListing()));return b.Result.ok(e)}}var tr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class nr{constructor(e,t,n,r,i,o,s){this._findContact=e,this._sendKeyChangedMessage=t,this._inviteToVault=n,this._inviteServer=r,this._getVaultContacts=i,this._decryptOwnMessage=o,this._getKeyPairs=s}execute(e){return tr(this,void 0,void 0,(function*(){return yield this.reinvitePendingInvites(e),yield this.performSendKeyChangeMessage(e),b.Result.ok()}))}reinvitePendingInvites(e){return tr(this,void 0,void 0,(function*(){const t=yield this.getExistingInvites(e.sharedVault.sharing.sharedVaultUuid);if(t.isFailed())return t;yield this.deleteAllInvites(e.sharedVault.sharing.sharedVaultUuid);const n=yield this._getVaultContacts.execute({sharedVaultUuid:e.sharedVault.sharing.sharedVaultUuid,readFromCache:!1}),r=this._getKeyPairs.execute();if(r.isFailed())return b.Result.fail("Cannot send metadata changed message; keys not found");for(const i of t.getValue()){const t=this._findContact.execute({userUuid:i.user_uuid});if(t.isFailed())continue;const o=this._decryptOwnMessage.execute({message:i.encrypted_message,privateKey:r.getValue().encryption.privateKey,recipientPublicKey:t.getValue().publicKeySet.encryption});if(o.isFailed())return b.Result.fail(o.getError());yield this._inviteToVault.execute({sharedVault:e.sharedVault,sharedVaultContacts:n.isFailed()?[]:n.getValue(),recipient:t.getValue(),permission:i.permission})}return b.Result.ok()}))}performSendKeyChangeMessage(e){return tr(this,void 0,void 0,(function*(){const t=yield this._sendKeyChangedMessage.execute({keySystemIdentifier:e.sharedVault.systemIdentifier,sharedVaultUuid:e.sharedVault.sharing.sharedVaultUuid});return t.isFailed()?t:b.Result.ok()}))}deleteAllInvites(e){return tr(this,void 0,void 0,(function*(){const t=yield this._inviteServer.deleteAllSharedVaultInvites({sharedVaultUuid:e});return(0,a.isErrorResponse)(t)?b.Result.fail("Failed to delete existing invites ".concat(JSON.stringify(t))):b.Result.ok()}))}getExistingInvites(e){return tr(this,void 0,void 0,(function*(){const t=yield this._inviteServer.getOutboundUserInvites();if((0,a.isErrorResponse)(t))return b.Result.fail("Failed to get outbound user invites ".concat(JSON.stringify(t)));const n=t.data.invites;return b.Result.ok(n.filter((t=>t.shared_vault_uuid===e)))}))}}const rr=[I.AsymmetricMessagePayloadType.SharedVaultRootKeyChanged,I.AsymmetricMessagePayloadType.SharedVaultMetadataChanged];function ir(e,t,n){if(rr.includes(e))return[e,t,n].join(":")}var or=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class sr{constructor(e,t,n,r,i,o,s){this.users=e,this._encryptMessage=t,this._findContact=n,this._getVaultUsers=r,this._sendMessage=i,this._isVaultOwner=o,this._getKeyPairs=s}execute(e){return or(this,void 0,void 0,(function*(){if(!this._isVaultOwner.execute(e.vault).getValue())return b.Result.ok();const t=yield this._getVaultUsers.execute({sharedVaultUuid:e.vault.sharing.sharedVaultUuid,readFromCache:!1});if(t.isFailed())return b.Result.fail("Cannot send metadata changed message; users not found");const n=this._getKeyPairs.execute();if(n.isFailed())return b.Result.fail("Cannot send metadata changed message; keys not found");const r=[];for(const i of t.getValue()){if(i.user_uuid===this.users.sureUser.uuid)continue;const t=this._findContact.execute({userUuid:i.user_uuid});if(t.isFailed())continue;const o=yield this.sendToContact({vault:e.vault,keys:n.getValue(),contact:t.getValue()});o.isFailed()&&r.push(o.getError())}return r.length>0?b.Result.fail(r.join(", ")):b.Result.ok()}))}sendToContact(e){return or(this,void 0,void 0,(function*(){const t={type:I.AsymmetricMessagePayloadType.SharedVaultMetadataChanged,data:{recipientUuid:e.contact.contactUuid,sharedVaultUuid:e.vault.sharing.sharedVaultUuid,name:e.vault.name,description:e.vault.description}},n=this._encryptMessage.execute({message:t,keys:e.keys,recipientPublicKey:e.contact.publicKeySet.encryption});if(n.isFailed())return b.Result.fail(n.getError());const r=ir(I.AsymmetricMessagePayloadType.SharedVaultMetadataChanged,e.vault.sharing.sharedVaultUuid,e.vault.systemIdentifier);return yield this._sendMessage.execute({recipientUuid:e.contact.contactUuid,encryptedMessage:n.getValue(),replaceabilityIdentifier:r})}))}}var ar=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class lr{constructor(e,t,n,r,i,o,s){this.users=e,this.keyManager=t,this._encryptMessage=n,this._findContact=r,this._sendMessage=i,this._getVaultUsers=o,this._getKeyPairs=s}execute(e){return ar(this,void 0,void 0,(function*(){const t=yield this._getVaultUsers.execute({sharedVaultUuid:e.sharedVaultUuid,readFromCache:!1});if(t.isFailed())return b.Result.fail("Cannot send root key changed message; users not found");const n=this._getKeyPairs.execute();if(n.isFailed())return b.Result.fail("Cannot send root key changed message; keys not found");const r=[];for(const i of t.getValue()){if(i.user_uuid===this.users.sureUser.uuid)continue;const t=this._findContact.execute({userUuid:i.user_uuid});if(t.isFailed())continue;const o=yield this.sendToContact({keySystemIdentifier:e.keySystemIdentifier,sharedVaultUuid:e.sharedVaultUuid,keys:n.getValue(),contact:t.getValue()});o.isFailed()&&r.push(o.getError())}return r.length>0?b.Result.fail(r.join(", ")):b.Result.ok()}))}sendToContact(e){return ar(this,void 0,void 0,(function*(){const t=this.keyManager.getPrimaryKeySystemRootKey(e.keySystemIdentifier);if(!t)throw new Error("Vault key not found for keySystemIdentifier ".concat(e.keySystemIdentifier));const n={type:I.AsymmetricMessagePayloadType.SharedVaultRootKeyChanged,data:{recipientUuid:e.contact.contactUuid,rootKey:t.content}},r=this._encryptMessage.execute({message:n,keys:e.keys,recipientPublicKey:e.contact.publicKeySet.encryption});if(r.isFailed())return b.Result.fail(r.getError());const i=ir(I.AsymmetricMessagePayloadType.SharedVaultRootKeyChanged,e.sharedVaultUuid,e.keySystemIdentifier);return yield this._sendMessage.execute({recipientUuid:e.contact.contactUuid,encryptedMessage:r.getValue(),replaceabilityIdentifier:i})}))}}class cr{constructor(e,t,n,r,i,o){this.users=e,this._findContact=t,this._encryptMessage=n,this._sendMessage=r,this._getVaultUsers=i,this._getKeyPairs=o}execute(e){return t=this,n=void 0,i=function*(){if(e.sharedVault.sharing.ownerUserUuid!==this.users.sureUser.uuid)return b.Result.fail("Cannot share contact; user is not the owner of the shared vault");const t=yield this._getVaultUsers.execute({sharedVaultUuid:e.sharedVault.sharing.sharedVaultUuid,readFromCache:!1});if(t.isFailed())return b.Result.fail("Cannot share contact; shared vault users not found");if(0===t.getValue().length)return b.Result.ok();const n=this._getKeyPairs.execute();if(n.isFailed())return b.Result.fail("Cannot share contact; keys not found");for(const r of t.getValue()){if(r.user_uuid===this.users.sureUser.uuid)continue;if(r.user_uuid===e.contactToShare.contactUuid)continue;const t=this._findContact.execute({userUuid:r.user_uuid});if(t.isFailed())continue;const i=this._encryptMessage.execute({message:{type:I.AsymmetricMessagePayloadType.ContactShare,data:{recipientUuid:t.getValue().contactUuid,trustedContact:e.contactToShare.content}},keys:n.getValue(),recipientPublicKey:t.getValue().publicKeySet.encryption});i.isFailed()||(yield this._sendMessage.execute({recipientUuid:t.getValue().contactUuid,encryptedMessage:i.getValue(),replaceabilityIdentifier:void 0}))}return b.Result.ok()},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}var ur;class dr{constructor(e,t){this.sharedVaultServer=e,this.mutator=t}execute(e){return t=this,n=void 0,i=function*(){const t=yield this.sharedVaultServer.getSharedVaults();if((0,a.isErrorResponse)(t))return b.Result.fail(t.data.error.message);const n=t.data.sharedVaults,r=t.data.designatedSurvivors||[];for(const t of e){if(!t.isSharedVaultListing())continue;const e=n.find((e=>e.uuid===t.sharing.sharedVaultUuid));if(e){const n=r.find((t=>t.sharedVaultUuid===e.uuid));yield this.mutator.changeItem(t,(t=>{t.sharing={sharedVaultUuid:e.uuid,ownerUserUuid:e.user_uuid,fileBytesUsed:e.file_upload_bytes_used,designatedSurvivor:n?n.userUuid:null}}))}}return b.Result.ok()},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}!function(e){e.MessageChanged="MessageChanged",e.PreferencesBubbleCountChanged="PreferencesBubbleCountChanged"}(ur||(ur={}));class hr extends f{constructor(){super(...arguments),this.preferencesBubbleCounts={general:0,account:0,security:0,"home-server":0,vaults:0,appearance:0,backups:0,listed:0,shortcuts:0,plugins:0,accessibility:0,"get-free-month":0,"help-feedback":0,"whats-new":0},this._message="",this.dynamicMessages=[]}getPreferencesBubbleCount(e){return this.preferencesBubbleCounts[e]}setPreferencesBubbleCount(e,t){this.preferencesBubbleCounts[e]=t;const n=this.totalPreferencesBubbleCount;this.notifyEvent(ur.PreferencesBubbleCountChanged,n>0?n.toString():void 0)}get totalPreferencesBubbleCount(){return Object.values(this.preferencesBubbleCounts).reduce(((e,t)=>e+t),0)}get message(){return this._message}setMessage(e){this.directSetMessage=e,this.recomputeMessage()}addMessage(e){return this.dynamicMessages.push(e),this.recomputeMessage(),e}removeMessage(e){(0,c.removeFromArray)(this.dynamicMessages,e),this.recomputeMessage()}recomputeMessage(){const e=[...this.dynamicMessages];this.directSetMessage&&e.unshift(this.directSetMessage),this._message=this.messageFromArray(e),this.notifyEvent(ur.MessageChanged,this._message)}messageFromArray(e){let t="";return e.forEach(((n,r)=>{const i=r===e.length-1;t+=n,i||(t+=", ")})),t}}class pr{constructor(){this.values=new Map}setValue(e,t){this.values.set(e,t)}getValue(e){return this.values.get(e)}removeValue(e){this.values.delete(e)}}class fr{constructor(e,t,n){this.storage=e,this.items=t,this.payloads=n}execute(e){return t=this,n=void 0,i=function*(){this.items.removeItemsFromMemory(e);const t=(yield this.storage.getRawPayloads((0,c.Uuids)(e))).map((e=>(0,I.CreatePayload)(e,I.PayloadSource.LocalDatabaseLoaded)));return yield this.payloads.emitPayloads(t,I.PayloadEmitSource.LocalDatabaseLoaded),b.Result.ok()},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}const gr={AccountDeleted:"Your account has been successfully deleted.",InvalidNote:"The note you are attempting to save can not be found or has been deleted. Changes you make will not be synced. Please copy this note's text and start a new note."};var mr,yr;!function(e){e.ProPlanYearly="pro_plan_yearly",e.PlusPlanYearly="plus_plan_yearly"}(mr||(mr={})),function(e){e.DidFetchSubscription="Subscription:DidFetchSubscription"}(yr||(yr={}));var vr,Ar,br,wr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Sr extends f{constructor(e,t,n,r,i){super(i),this.subscriptionApiService=e,this.sessions=t,this.storage=n,this.isApplicationUsingThirdPartyHostUseCase=r,this.internalEventBus=i}handleEvent(e){return wr(this,void 0,void 0,(function*(){switch(e.type){case L.Launched:{this.fetchOnlineSubscription();const e=this.isApplicationUsingThirdPartyHostUseCase.execute();if(e.isFailed())break;e.getValue()||this.fetchAvailableSubscriptions();break}case L.UserRolesChanged:case Qn.Restored:case L.SignedIn:this.fetchOnlineSubscription();break;case L.ApplicationStageChanged:e.payload.stage===y.StorageDecrypted_09&&this.loadSubscriptionFromStorage()}}))}loadSubscriptionFromStorage(){this.onlineSubscription=this.storage.getValue(d.Subscription),this.notifyEvent(yr.DidFetchSubscription)}hasOnlineSubscription(){return null!=this.onlineSubscription}getOnlineSubscription(){return this.onlineSubscription}getAvailableSubscriptions(){return this.availableSubscriptions}get userSubscriptionName(){if(!this.onlineSubscription)throw new Error("Attempting to get subscription name without a subscription.");return this.availableSubscriptions&&this.availableSubscriptions[this.onlineSubscription.planName]?this.availableSubscriptions[this.onlineSubscription.planName].name:""}get userSubscriptionExpirationDate(){if(this.onlineSubscription)return new Date((0,c.convertTimestampToMilliseconds)(this.onlineSubscription.endsAt))}get isUserSubscriptionExpired(){if(!this.onlineSubscription)throw new Error("Attempting to check subscription expiration without a subscription.");return!!this.userSubscriptionExpirationDate&&this.userSubscriptionExpirationDate.getTime()<(new Date).getTime()}get isUserSubscriptionCanceled(){if(!this.onlineSubscription)throw new Error("Attempting to check subscription expiration without a subscription.");return this.onlineSubscription.cancelled}acceptInvitation(e){return wr(this,void 0,void 0,(function*(){try{const t=yield this.subscriptionApiService.acceptInvite(e);return(0,a.isErrorResponse)(t)?{success:!1,message:(0,a.getErrorFromErrorResponse)(t).message}:t.data}catch(e){return{success:!1,message:"Could not accept invitation."}}}))}listSubscriptionInvitations(){var e;return wr(this,void 0,void 0,(function*(){try{const t=yield this.subscriptionApiService.listInvites();return(0,a.isErrorResponse)(t)?[]:null!==(e=t.data.invitations)&&void 0!==e?e:[]}catch(e){return[]}}))}inviteToSubscription(e){return wr(this,void 0,void 0,(function*(){try{const t=yield this.subscriptionApiService.invite(e);return!(0,a.isErrorResponse)(t)&&!0===t.data.success}catch(e){return!1}}))}cancelInvitation(e){return wr(this,void 0,void 0,(function*(){try{const t=yield this.subscriptionApiService.cancelInvite(e);return!(0,a.isErrorResponse)(t)&&!0===t.data.success}catch(e){return!1}}))}fetchOnlineSubscription(){return wr(this,void 0,void 0,(function*(){if(this.sessions.isSignedIn())try{const e=yield this.subscriptionApiService.getUserSubscription({userUuid:this.sessions.userUuid});if((0,a.isErrorResponse)(e))return;const t=e.data.subscription;this.handleReceivedOnlineSubscriptionFromServer(t)}catch(e){}}))}handleReceivedOnlineSubscriptionFromServer(e){this.onlineSubscription=e,this.storage.setValue(d.Subscription,e),this.notifyEvent(yr.DidFetchSubscription)}fetchAvailableSubscriptions(){return wr(this,void 0,void 0,(function*(){try{const e=yield this.subscriptionApiService.getAvailableSubscriptions();if((0,a.isErrorResponse)(e))return;this.availableSubscriptions=e.data}catch(e){}}))}confirmAppleIAP(e,t){return wr(this,void 0,void 0,(function*(){try{const n=yield this.subscriptionApiService.confirmAppleIAP(Object.assign(Object.assign({},e),{subscription_token:t}));return(0,a.isErrorResponse)(n)?{success:!1,message:(0,a.getErrorFromErrorResponse)(n).message}:n.data}catch(e){return{success:!1,message:"Could not confirm IAP."}}}))}}class Cr{constructor(){this.backoffPenalties=new Map,this.backoffStartTimestamps=new Map}isItemInBackoff(e){const t=this.backoffStartTimestamps.get(e.uuid);if(!t)return!1;const n=this.backoffPenalties.get(e.uuid);return!!n&&t+n>Date.now()}backoffItem(e){const t=this.backoffPenalties.get(e.uuid)||0,n=0===t?1e3:2*t;this.backoffPenalties.set(e.uuid,n),this.backoffStartTimestamps.set(e.uuid,Date.now())}}!function(e){e.Default="Default",e.DownloadFirst="DownloadFirst",e.LocalOnly="LocalOnly"}(vr||(vr={}));class Er{constructor(e,t){this.completedUpload=0,this.totalUpload=0,this.downloaded=0,this.databaseLoadCurrent=0,this.databaseLoadTotal=0,this.databaseLoadDone=!1,this.syncing=!1,this.interval=e,this.receiver=t}deinit(){this.stopTimingMonitor()}setUploadStatus(e,t){this.completedUpload=e,this.totalUpload=t,this.receiver(E.StatusChanged)}setDownloadStatus(e){this.downloaded+=e,this.receiver(E.StatusChanged)}setDatabaseLoadStatus(e,t,n){this.databaseLoadCurrent=e,this.databaseLoadTotal=t,this.databaseLoadDone=n,n?this.receiver(E.LocalDataLoaded):this.receiver(E.LocalDataIncrementalLoad)}getStats(){return{uploadCompletionCount:this.completedUpload,uploadTotalCount:this.totalUpload,downloadCount:this.downloaded,localDataDone:this.databaseLoadDone,localDataCurrent:this.databaseLoadCurrent,localDataTotal:this.databaseLoadTotal}}setDidBegin(){this.syncing=!0,this.syncStart=new Date}setDidEnd(){this.syncing=!1}get syncInProgress(){return!0===this.syncing}get secondsSinceSyncStart(){return((new Date).getTime()-this.syncStart.getTime())/1e3}startTimingMonitor(){this.timingMonitor&&this.stopTimingMonitor(),this.timingMonitor=this.interval((()=>{this.secondsSinceSyncStart>5&&(this.receiver(E.SyncTakingTooLong),this.stopTimingMonitor())}),500)}stopTimingMonitor(){Object.prototype.hasOwnProperty.call(this.interval,"cancel")?this.interval.cancel(this.timingMonitor):clearInterval(this.timingMonitor),this.timingMonitor=null}hasError(){return!!this.error}setError(e){this.error=e}clearError(){this.error=null}reset(){this.downloaded=0,this.completedUpload=0,this.totalUpload=0,this.syncing=!1,this.error=null,this.stopTimingMonitor(),this.receiver(E.StatusChanged)}}!function(e){e[e.ResolveOnNext=1]="ResolveOnNext",e[e.ForceSpawnNew=2]="ForceSpawnNew"}(Ar||(Ar={})),function(e){e.External="External",e.SpawnQueue="SpawnQueue",e.ResolveQueue="ResolveQueue",e.MoreDirtyItems="MoreDirtyItems",e.DownloadFirst="DownloadFirst",e.AfterDownloadFirst="AfterDownloadFirst",e.IntegrityCheck="IntegrityCheck",e.ResolveOutOfSync="ResolveOutOfSync"}(br||(br={}));class Ir{constructor(e,t,n){this.items=e,this.mutator=t,this.sync=n}execute(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;return o=this,s=void 0,l=function*(){return yield this.mutator.changeItems([e],t,n?I.MutationType.UpdateUserTimestamps:I.MutationType.NoUpdateUserTimestamps,r),yield this.sync.sync(i),b.Result.ok(this.items.findItem(e.uuid))},new((a=void 0)||(a=Promise))((function(e,t){function n(e){try{i(l.next(e))}catch(e){t(e)}}function r(e){try{i(l.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(n,r)}i((l=l.apply(o,s||[])).next())}));var o,s,a,l}}class _r{constructor(e,t){this.items=e,this.storage=t}execute(e){return t=this,n=void 0,i=function*(){this.items.removeItemsFromMemory(e),yield this.storage.deletePayloadsWithUuids((0,c.Uuids)(e))},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class xr{constructor(e){this.crypto=e}execute(){const e=this.crypto.generateUUID();return b.Result.ok(e)}}class Pr{constructor(e){this.legacyApi=e}execute(){return b.Result.ok(this.legacyApi.getHost())}}class kr{constructor(e){this.getHostUseCase=e,this.APPLICATION_DEFAULT_HOSTS=["api.standardnotes.com","sync.standardnotes.org","localhost:3123"],this.FILES_DEFAULT_HOSTS=["files.standardnotes.com"]}execute(){const e=this.getHostUseCase.execute();if(e.isFailed())return b.Result.fail(e.getError());const t=e.getValue();return b.Result.ok(!this.isUrlFirstParty(t))}isUrlFirstParty(e){try{const{host:t}=new URL(e);return this.APPLICATION_DEFAULT_HOSTS.includes(t)||this.FILES_DEFAULT_HOSTS.includes(t)}catch(e){return!1}}}var Br;class Or{constructor(e,t){this.http=e,this.legacyApi=t}execute(e){return t=this,n=void 0,i=function*(){return this.http.setHost(e),yield this.legacyApi.setHost(e),b.Result.ok()},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}!function(e){e.SignedInOrRegistered="SignedInOrRegistered",e.SignedOut="SignedOut"}(Br||(Br={}));var Nr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Dr extends f{constructor(e,t,n,r,i,o,s,a,l,c,u,d){super(d),this.sessions=e,this.sync=t,this.storage=n,this.items=r,this.encryption=i,this.alerts=o,this.challenges=s,this.protections=a,this.userApi=l,this._reencryptTypeAItems=c,this._decryptErroredPayloads=u,this.internalEventBus=d,this.signingIn=!1,this.registering=!1,this.MINIMUM_PASSCODE_LENGTH=1,this.MINIMUM_PASSWORD_LENGTH=8}deinit(){super.deinit(),this.sessions=void 0,this.sync=void 0,this.storage=void 0,this.items=void 0,this.encryption=void 0,this.alerts=void 0,this.challenges=void 0,this.protections=void 0,this.userApi=void 0,this._reencryptTypeAItems=void 0,this._decryptErroredPayloads=void 0}handleEvent(e){return Nr(this,void 0,void 0,(function*(){if(e.type===Br.SignedInOrRegistered){const t=e.payload.payload;this.sync.resetSyncState(),yield this.storage.setPersistencePolicy(t.ephemeral?Tn.Ephemeral:Tn.Default),t.mergeLocal?yield this.sync.markAllItemsAsNeedingSyncAndPersist():(this.items.removeAllItemsFromMemory(),yield this.clearDatabase()),this.unlockSyncing();const n=this.sync.downloadFirstSync(1e3,{checkIntegrity:t.checkIntegrity,awaitAll:t.awaitSync}).then((()=>{t.awaitSync||this._decryptErroredPayloads.execute()}));t.awaitSync&&(yield n,yield this._decryptErroredPayloads.execute())}}))}get user(){return this.sessions.getUser()}get sureUser(){return this.sessions.getSureUser()}getUserUuid(){return this.sessions.userUuid}isSignedIn(){return this.sessions.isSignedIn()}register(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return Nr(this,void 0,void 0,(function*(){if(this.encryption.hasAccount())throw Error("Tried to register when an account already exists.");if(this.registering)throw Error("Already registering.");this.registering=!0;try{this.lockSyncing();const o=yield this.sessions.register(e,t,n,r);return yield this.notifyEventSync(Br.SignedInOrRegistered,{payload:{ephemeral:r,mergeLocal:i,awaitSync:!0,checkIntegrity:!1}}),this.registering=!1,o}catch(e){throw this.unlockSyncing(),this.registering=!1,e}}))}signIn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6?arguments[6]:void 0;return Nr(this,void 0,void 0,(function*(){if(this.encryption.hasAccount())throw Error("Tried to sign in when an account already exists.");if(this.signingIn)throw Error("Already signing in.");this.signingIn=!0;try{this.lockSyncing();const{response:l}=yield this.sessions.signIn(e,t,n,r,void 0,s);if((0,a.isErrorResponse)(l))this.unlockSyncing();else{const e=o?this.notifyEventSync.bind(this):this.notifyEvent.bind(this);yield e(Br.SignedInOrRegistered,{payload:{mergeLocal:i,awaitSync:o,ephemeral:r,checkIntegrity:!0}})}return l}finally{this.signingIn=!1}}))}deleteAccount(){return Nr(this,void 0,void 0,(function*(){if(!(yield this.protections.authorizeAction(Ke.DeleteAccount,{fallBackToAccountPassword:!0,requireAccountPassword:!0,forcePrompt:!1})))return{error:!0,message:Ee};const e=this.sessions.getSureUser().uuid,t=yield this.userApi.deleteAccount(e);return(0,a.isErrorResponse)(t)?{error:!0,message:(0,a.getErrorFromErrorResponse)(t).message}:(yield this.signOut(!0),this.alerts&&this.alerts.alert(gr.AccountDeleted),{error:!1})}))}submitUserRequest(e){return Nr(this,void 0,void 0,(function*(){const t=this.sessions.getSureUser().uuid;try{const n=yield this.userApi.submitUserRequest({userUuid:t,requestType:e});return!(0,a.isErrorResponse)(n)&&n.data.success}catch(e){return!1}}))}correctiveSignIn(e){return Nr(this,void 0,void 0,(function*(){this.lockSyncing();const t=yield this.sessions.bypassChecksAndSignInWithRootKey(e.keyParams.identifier,e,!1);return(0,a.isErrorResponse)(t)||(yield this.notifyEvent(Br.SignedInOrRegistered,{payload:{mergeLocal:!0,awaitSync:!0,ephemeral:!1,checkIntegrity:!0}})),this.unlockSyncing(),t}))}changeCredentials(e){return Nr(this,void 0,void 0,(function*(){const t=yield this.performCredentialsChange(e);return t.error&&this.alerts.alert(t.error.message),t}))}signOut(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:A.SignOut;return Nr(this,void 0,void 0,(function*(){const n=()=>Nr(this,void 0,void 0,(function*(){yield this.sessions.signOut(),yield this.encryption.deleteWorkspaceSpecificKeyStateFromDevice(),yield this.storage.clearAllData(),yield this.notifyEvent(Br.SignedOut,{payload:{source:t}})}));if(e)return void(yield n());const r=this.items.getDirtyItems();if(r.length>0){const e=1===r.length;(yield this.alerts.confirm("There ".concat(e?"is":"are"," ").concat(r.length," ").concat(e?"item":"items"," with unsynced changes. If you sign out, these changes will be lost forever. Are you sure you want to sign out?")))&&(yield n())}else yield n()}))}updateAccountWithFirstTimeKeyPair(){return Nr(this,void 0,void 0,(function*(){if(!this.sessions.isUserMissingKeyPair())throw Error("Cannot update account with first time keypair if user already has a keypair");return yield this.performProtocolUpgrade()}))}performProtocolUpgrade(){return Nr(this,void 0,void 0,(function*(){const e=this.encryption.hasPasscode(),t=this.encryption.hasAccount(),n=[];e&&n.push(new ze(He.LocalPasscode,void 0,Qe.LocalPasscodePlaceholder)),t&&n.push(new ze(He.AccountPassword,void 0,Qe.AccountPasswordPlaceholder));const r=new Ge(n,Ke.ProtocolUpgrade,!0),i=yield this.challenges.promptForChallengeResponse(r);if(!i)return{canceled:!0};const o=yield this.alerts.blockingDialog(Be,_e);try{let n;if(e&&(n=i.getValueForType(He.LocalPasscode).value),t){const e=i.getValueForType(He.AccountPassword).value,t=yield this.changeCredentials({currentPassword:e,newPassword:e,passcode:n,origination:kt.KeyParamsOrigination.ProtocolUpgrade,validateNewPasswordStrength:!1});if(null==t?void 0:t.error)return{error:t.error}}return e&&(yield this.removePasscodeWithoutWarning(),yield this.setPasscodeWithoutWarning(n,kt.KeyParamsOrigination.ProtocolUpgrade)),{success:!0}}catch(e){return{error:e}}finally{o()}}))}addPasscode(e){return Nr(this,void 0,void 0,(function*(){if(e.length<this.MINIMUM_PASSCODE_LENGTH)return!1;if(!(yield this.protections.authorizeAddingPasscode()))return!1;const t=yield this.alerts.blockingDialog(Be,xe);try{return yield this.setPasscodeWithoutWarning(e,kt.KeyParamsOrigination.PasscodeCreate),!0}finally{t()}}))}removePasscode(){return Nr(this,void 0,void 0,(function*(){if(!(yield this.protections.authorizeRemovingPasscode()))return!1;const e=yield this.alerts.blockingDialog(Be,ke);try{return yield this.removePasscodeWithoutWarning(),!0}finally{e()}}))}changePasscode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:kt.KeyParamsOrigination.PasscodeChange;return Nr(this,void 0,void 0,(function*(){if(e.length<this.MINIMUM_PASSCODE_LENGTH)return!1;if(!(yield this.protections.authorizeChangingPasscode()))return!1;const n=yield this.alerts.blockingDialog(Be,t===kt.KeyParamsOrigination.ProtocolUpgrade?Fe.UpgradingPasscode:Pe);try{return yield this.removePasscodeWithoutWarning(),yield this.setPasscodeWithoutWarning(e,t),!0}finally{n()}}))}populateSessionFromDemoShareToken(e){return Nr(this,void 0,void 0,(function*(){yield this.sessions.populateSessionFromDemoShareToken(e),yield this.notifyEvent(Br.SignedInOrRegistered,{payload:{ephemeral:!1,mergeLocal:!1,checkIntegrity:!1,awaitSync:!0}})}))}setPasscodeWithoutWarning(e,t){return Nr(this,void 0,void 0,(function*(){const n=c.UuidGenerator.GenerateUuid(),r=yield this.encryption.createRootKey(n,e,t);yield this.encryption.setNewRootKeyWrapper(r),yield this.rewriteItemsKeys(),yield this.sync.sync()}))}removePasscodeWithoutWarning(){return Nr(this,void 0,void 0,(function*(){yield this.encryption.removePasscode(),yield this.rewriteItemsKeys()}))}rewriteItemsKeys(){return Nr(this,void 0,void 0,(function*(){const e=this.items.getDisplayableItemsKeys().map((e=>e.payloadRepresentation()));yield this.storage.deletePayloads(e),yield this.sync.persistPayloads(e)}))}lockSyncing(){this.sync.lockSyncing()}unlockSyncing(){this.sync.unlockSyncing()}clearDatabase(){return this.storage.clearAllPayloads()}performCredentialsChange(e){var t;return Nr(this,void 0,void 0,(function*(){const{wrappingKey:n,canceled:r}=yield this.challenges.getWrappingKeyIfApplicable(e.passcode);if(r)return{error:Error(je.PasscodeRequired)};if(void 0!==e.newPassword&&e.validateNewPasswordStrength&&e.newPassword.length<this.MINIMUM_PASSWORD_LENGTH)return{error:Error(Ne(this.MINIMUM_PASSWORD_LENGTH))};if(!(yield this.encryption.validateAccountPassword(e.currentPassword)).valid)return{error:Error(Ee)};const i=e.newEmail?e.newEmail.trim().toLowerCase():void 0,o=this.sessions.getUser().email,{currentRootKey:s,newRootKey:l}=yield this.recomputeRootKeysForCredentialChange({currentPassword:e.currentPassword,currentEmail:o,origination:e.origination,newEmail:i,newPassword:e.newPassword});this.lockSyncing();const{response:c}=yield this.sessions.changeCredentials({currentServerPassword:s.serverPassword,newRootKey:l,wrappingKey:n,newEmail:i});if(this.unlockSyncing(),(0,a.isErrorResponse)(c))return{error:Error(null===(t=c.data.error)||void 0===t?void 0:t.message)};const u=yield this.encryption.createNewItemsKeyWithRollback();return yield this._reencryptTypeAItems.execute(),yield this.sync.sync({awaitAll:!0}),this.encryption.getSureDefaultItemsKey().neverSynced?(yield this.sessions.changeCredentials({currentServerPassword:l.serverPassword,newRootKey:s,wrappingKey:n}),yield this._reencryptTypeAItems.execute(),yield u(),yield this.sync.sync({awaitAll:!0}),{error:Error(je.Failed)}):{}}))}recomputeRootKeysForCredentialChange(e){var t,n;return Nr(this,void 0,void 0,(function*(){return{currentRootKey:yield this.encryption.computeRootKey(e.currentPassword,this.encryption.getRootKeyParams()),newRootKey:yield this.encryption.createRootKey(null!==(t=e.newEmail)&&void 0!==t?t:e.currentEmail,null!==(n=e.newPassword)&&void 0!==n?n:e.currentPassword,e.origination)}}))}}var jr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Tr extends f{constructor(e){super(e),this.handledNotifications=new Set}handleEvent(e){return jr(this,void 0,void 0,(function*(){switch(e.type){case E.ReceivedNotifications:return this.handleReceivedNotifications(e.payload);case s.NotificationAddedForUser:return this.handleReceivedNotifications([e.payload.notification])}}))}handleReceivedNotifications(e){return jr(this,void 0,void 0,(function*(){if(0!==e.length)for(const t of e){if(this.handledNotifications.has(t.uuid))continue;this.handledNotifications.add(t.uuid);const e=b.NotificationPayload.createFromString(t.payload);if(e.isFailed())continue;const n={eventPayload:e.getValue()};yield this.notifyEventSync(Vn.NotificationReceived,n)}}))}}var Mr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Fr{constructor(e,t,n,r){this.vaultLocks=e,this.protection=t,this.challenges=n,this._validateVaultPassword=r}execute(e){return Mr(this,void 0,void 0,(function*(){if(!this.vaultLocks.isVaultLockable(e)){const e=yield this.protection.authorizeAction(Ke.Custom,{fallBackToAccountPassword:!0,requireAccountPassword:!1,forcePrompt:!0});return b.Result.ok(e)}const t=new Ge([new ze(He.None,void 0,"Password")],Ke.Custom,!0,Qe.DeleteVault(e.name),Qe.EnterVaultPassword);return new Promise((n=>{this.challenges.addChallengeObserver(t,{onCancel(){n(b.Result.ok(!1))},onNonvalidatedSubmit:r=>Mr(this,void 0,void 0,(function*(){const i=r.getDefaultValue();if(!i)return this.challenges.completeChallenge(t),void n(b.Result.ok(!1));const o=i.value;return this.vaultLocks.isVaultLocked(e)&&(yield this.vaultLocks.unlockNonPersistentVault(e,o))||this._validateVaultPassword.execute(e,o).getValue()?(this.challenges.completeChallenge(t),void n(b.Result.ok(!0))):(this.challenges.setValidationStatusForChallenge(t,i,!1),void n(b.Result.ok(!1)))}))}),this.challenges.promptForChallengeResponse(t)}))}))}}class Rr{constructor(e,t,n){this.sync=e,this._rotateVaultKey=t,this._changeVaultStorageMode=n}execute(e){return t=this,n=void 0,i=function*(){let t=e.newStorageMode,n=e.vault;if(e.newPasswordOptions){if(e.newPasswordOptions.passwordType===I.KeySystemPasswordType.Randomized&&e.newStorageMode&&e.newStorageMode!==I.KeySystemRootKeyStorageMode.Synced)return b.Result.fail("Cannot change storage mode to non-synced for randomized vault");if(e.newPasswordOptions.passwordType===I.KeySystemPasswordType.UserInputted&&!e.newPasswordOptions.userInputtedPassword)return b.Result.fail("User inputted password required");const r=yield this._rotateVaultKey.execute({vault:e.vault,userInputtedPassword:e.newPasswordOptions.passwordType===I.KeySystemPasswordType.UserInputted?e.newPasswordOptions.userInputtedPassword:void 0});if(r.isFailed())return r;n=r.getValue(),e.newPasswordOptions.passwordType===I.KeySystemPasswordType.Randomized&&(t=I.KeySystemRootKeyStorageMode.Synced)}if(t&&t!==n.keyStorageMode){const e=yield this._changeVaultStorageMode.execute({vault:n,newStorageMode:t});if(e.isFailed())return e}return yield this.sync.sync(),b.Result.ok()},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}var Lr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Qr{constructor(e,t,n,r){this.mutator=e,this.sync=t,this.keys=n,this._getVault=r}execute(e){return Lr(this,void 0,void 0,(function*(){const t=this._getVault.execute({keySystemIdentifier:e.vault.systemIdentifier});if(t.isFailed())return b.Result.fail("Vault not found");if(t.getValue().keyPasswordType===I.KeySystemPasswordType.Randomized&&e.newStorageMode!==I.KeySystemRootKeyStorageMode.Synced)return b.Result.fail("Cannot change storage mode to non-synced for randomized vault");const n=t.getValue();if(e.newStorageMode===n.keyStorageMode)return b.Result.fail("Vault already uses this storage preference");if(e.newStorageMode===I.KeySystemRootKeyStorageMode.Local||e.newStorageMode===I.KeySystemRootKeyStorageMode.Ephemeral){const t=yield this.changeStorageModeToLocalOrEphemeral(n,e.newStorageMode);if(t.isFailed())return t}else if(e.newStorageMode===I.KeySystemRootKeyStorageMode.Synced){const e=yield this.changeStorageModeToSynced(n);if(e.isFailed())return e}return b.Result.ok()}))}changeStorageModeToLocalOrEphemeral(e,t){return Lr(this,void 0,void 0,(function*(){const n=this.keys.getPrimaryKeySystemRootKey(e.systemIdentifier);if(!n)return b.Result.fail("No primary key found");t===I.KeySystemRootKeyStorageMode.Ephemeral&&this.keys.removeKeyFromCache(e.systemIdentifier),this.keys.cacheKey(n,t),yield this.keys.deleteAllSyncedKeySystemRootKeys(e.systemIdentifier);const r=yield this.mutator.changeItem(e,(e=>{e.keyStorageMode=t}));return yield this.sync.sync(),b.Result.ok(r)}))}changeStorageModeToSynced(e){return Lr(this,void 0,void 0,(function*(){const t=this.keys.getAllKeySystemRootKeysForVault(e.systemIdentifier),n=this.keys.getSyncedKeySystemRootKeysForVault(e.systemIdentifier);this.keys.removeKeyFromCache(e.systemIdentifier);for(const e of t)n.find((t=>t.token===e.token))||(yield this.mutator.insertItem(e));const r=yield this.mutator.changeItem(e,(e=>{e.keyStorageMode=I.KeySystemRootKeyStorageMode.Synced}));return b.Result.ok(r)}))}}var Ur=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Vr{constructor(e,t,n,r){this.mutator=e,this.encryption=t,this.keys=n,this.sync=r}execute(e){return Ur(this,void 0,void 0,(function*(){const t=c.UuidGenerator.GenerateUuid(),n=yield this.createKeySystemRootKey({keySystemIdentifier:t,vaultName:e.vaultName,vaultDescription:e.vaultDescription,userInputtedPassword:e.userInputtedPassword,storagePreference:e.storagePreference});yield this.createKeySystemItemsKey(t,n.token);const r=yield this.createVaultListing({keySystemIdentifier:t,vaultName:e.vaultName,vaultDescription:e.vaultDescription,vaultIcon:e.vaultIcon,passwordType:e.userInputtedPassword?I.KeySystemPasswordType.UserInputted:I.KeySystemPasswordType.Randomized,rootKeyParams:n.keyParams,storage:e.storagePreference});return yield this.sync.sync(),r}))}createVaultListing(e){return Ur(this,void 0,void 0,(function*(){const t={systemIdentifier:e.keySystemIdentifier,rootKeyParams:e.rootKeyParams,keyStorageMode:e.storage,name:e.vaultName,description:e.vaultDescription,iconString:e.vaultIcon};return this.mutator.createItem(b.ContentType.TYPES.VaultListing,(0,I.FillItemContentSpecialized)(t),!0)}))}createKeySystemItemsKey(e,t){return Ur(this,void 0,void 0,(function*(){const n=this.encryption.createKeySystemItemsKey(c.UuidGenerator.GenerateUuid(),e,void 0,t);yield this.mutator.insertItem(n)}))}createKeySystemRootKey(e){return Ur(this,void 0,void 0,(function*(){let t;return t=e.userInputtedPassword?this.encryption.createUserInputtedKeySystemRootKey({systemIdentifier:e.keySystemIdentifier,userInputtedPassword:e.userInputtedPassword}):this.encryption.createRandomizedKeySystemRootKey({systemIdentifier:e.keySystemIdentifier}),e.storagePreference===I.KeySystemRootKeyStorageMode.Synced?yield this.mutator.insertItem(t,!0):this.keys.cacheKey(t,e.storagePreference),t}))}}class Kr{constructor(e,t,n){this.mutator=e,this.keys=t,this._getVaultItems=n}execute(e){return t=this,n=void 0,i=function*(){if(!e.systemIdentifier)throw new Error("Vault system identifier is missing");yield this.keys.deleteNonPersistentSystemRootKeysForVault(e.systemIdentifier);const t=this.keys.getSyncedKeySystemRootKeysForVault(e.systemIdentifier);yield this.mutator.setItemsToBeDeleted(t);const n=this.keys.getKeySystemItemsKeys(e.systemIdentifier);yield this.mutator.setItemsToBeDeleted(n);const r=this._getVaultItems.execute(e).getValue();yield this.mutator.setItemsToBeDeleted(r),yield this.mutator.setItemToBeDeleted(e)},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class Hr{constructor(e){this.items=e}execute(e){const t=this.items.getItems(b.ContentType.TYPES.VaultListing);if("keySystemIdentifier"in e){const n=t.find((t=>t.systemIdentifier===e.keySystemIdentifier));return n?b.Result.ok(n):b.Result.fail("Vault not found")}{const n=t.find((t=>{var n;return(null===(n=t.sharing)||void 0===n?void 0:n.sharedVaultUuid)===e.sharedVaultUuid}));return n?b.Result.ok(n):b.Result.fail("Shared vault not found")}}}class Gr{constructor(e){this.items=e}execute(e){return b.Result.ok(this.items.items.filter((t=>t.key_system_identifier===e.systemIdentifier)))}}class Yr{constructor(e){this.items=e}execute(){const e=this.items.getItems(b.ContentType.TYPES.VaultListing).sort(((e,t)=>e.name.localeCompare(t.name)));return b.Result.ok(e)}}class zr{constructor(e,t,n){this.mutator=e,this.sync=t,this.files=n}execute(e){return t=this,n=void 0,i=function*(){for(const t of e.items)yield this.mutator.changeItem(t,(t=>{t.key_system_identifier=e.vault.systemIdentifier,t.shared_vault_uuid=e.vault.isSharedVaultListing()?e.vault.sharing.sharedVaultUuid:void 0}));yield this.sync.sync();for(const t of e.items)t.content_type===b.ContentType.TYPES.File&&(e.vault.isSharedVaultListing()?yield this.files.moveFileToSharedVault(t,e.vault):t.shared_vault_uuid&&(yield this.files.moveFileOutOfSharedVault(t)))},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class Zr{constructor(e,t,n){this.mutator=e,this.sync=t,this.files=n}execute(e){return t=this,n=void 0,i=function*(){yield this.mutator.changeItem(e.item,(e=>{e.key_system_identifier=void 0,e.shared_vault_uuid=void 0})),yield this.sync.sync(),e.item.content_type===b.ContentType.TYPES.File&&(yield this.files.moveFileOutOfSharedVault(e.item))},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}var Wr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class qr{constructor(e,t,n,r,i){this.mutator=e,this.encryption=t,this.keys=n,this._notifyVaultUsersOfKeyRotation=r,this._isVaultOwner=i}execute(e){return Wr(this,void 0,void 0,(function*(){const{newRootKey:t,updatedVault:n}=yield this.updateRootKeyparams(e);yield this.createNewKeySystemItemsKey({keySystemIdentifier:n.systemIdentifier,sharedVaultUuid:n.isSharedVaultListing()?n.sharing.sharedVaultUuid:void 0,rootKeyToken:t.token}),yield this.keys.queueVaultItemsKeysForReencryption(n.systemIdentifier);const r=yield this.shareNewKeyWithMembers({vault:n,newRootKey:t});return r.isFailed()?b.Result.fail(r.getError()):b.Result.ok(n)}))}updateRootKeyparams(e){return Wr(this,void 0,void 0,(function*(){if(!this.keys.getPrimaryKeySystemRootKey(e.vault.systemIdentifier))throw new Error("Cannot rotate key system root key; key system root key not found");let t;if(t=e.userInputtedPassword?this.encryption.createUserInputtedKeySystemRootKey({systemIdentifier:e.vault.systemIdentifier,userInputtedPassword:e.userInputtedPassword}):this.encryption.createRandomizedKeySystemRootKey({systemIdentifier:e.vault.systemIdentifier}),!t)throw new Error("Cannot rotate key system root key; new root key not created");e.userInputtedPassword&&e.vault.keyStorageMode!==I.KeySystemRootKeyStorageMode.Synced?this.keys.cacheKey(t,e.vault.keyStorageMode):yield this.mutator.insertItem(t,!0);const n=yield this.mutator.changeItem(e.vault,(e=>{(0,c.assert)(t),e.rootKeyParams=t.keyParams}));return{newRootKey:t,updatedVault:n}}))}createNewKeySystemItemsKey(e){return Wr(this,void 0,void 0,(function*(){const t=c.UuidGenerator.GenerateUuid(),n=this.encryption.createKeySystemItemsKey(t,e.keySystemIdentifier,e.sharedVaultUuid,e.rootKeyToken);yield this.mutator.insertItem(n)}))}shareNewKeyWithMembers(e){return Wr(this,void 0,void 0,(function*(){return e.vault.isSharedVaultListing()&&this._isVaultOwner.execute(e.vault).getValue()?yield this._notifyVaultUsersOfKeyRotation.execute({sharedVault:e.vault}):b.Result.ok()}))}}var Jr,Xr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class $r extends f{constructor(e,t,n,r,i,o,s,a,l,c,u,d,h,p,f,g,m,y){super(y),this.sync=e,this.items=t,this.mutator=n,this.vaultLocks=r,this.alerts=i,this._getVault=o,this._getVaults=s,this._changeVaultKeyOptions=a,this._moveItemsToVault=l,this._createVault=c,this._removeItemFromVault=u,this._deleteVault=d,this._rotateVaultKey=h,this._sendVaultDataChangeMessage=p,this._isVaultOwner=f,this._validateVaultPassword=g,this._authorizeVaultDeletion=m}deinit(){super.deinit(),this.sync=void 0,this.items=void 0,this.mutator=void 0,this.vaultLocks=void 0,this.alerts=void 0,this._getVault=void 0,this._getVaults=void 0,this._changeVaultKeyOptions=void 0,this._moveItemsToVault=void 0,this._createVault=void 0,this._removeItemFromVault=void 0,this._deleteVault=void 0,this._rotateVaultKey=void 0}getVaults(){return this._getVaults.execute().getValue()}getVault(e){return this._getVault.execute(e)}createRandomizedVault(e){return Xr(this,void 0,void 0,(function*(){return this.createVaultWithParameters({name:e.name,description:e.description,iconString:e.iconString,userInputtedPassword:void 0,storagePreference:I.KeySystemRootKeyStorageMode.Synced})}))}createUserInputtedPasswordVault(e){return Xr(this,void 0,void 0,(function*(){return this.createVaultWithParameters(e)}))}createVaultWithParameters(e){return Xr(this,void 0,void 0,(function*(){return yield this._createVault.execute({vaultName:e.name,vaultDescription:e.description,vaultIcon:e.iconString,userInputtedPassword:e.userInputtedPassword,storagePreference:e.storagePreference})}))}moveItemToVault(e,t){return Xr(this,void 0,void 0,(function*(){if(this.vaultLocks.isVaultLocked(e))throw new Error("Attempting to add item to locked vault");if(((0,I.isNote)(t)||(0,I.isFile)(t))&&[...this.items.getItemLinkedFiles(t),...this.items.getItemLinkedNotes(t),...this.items.getUnsortedTagsForItem(t)].some((t=>t.key_system_identifier!==e.systemIdentifier))){const e="This item is linked to other items that are not in the same vault. Please move those items to this vault first.";return this.alerts.alertV2({title:"Cannot move item to vault",text:e}).catch(console.error),b.Result.fail(e)}let n=[];if((0,I.isTag)(t)){const r=this.items.getDeepTagChildren(t);if(r.some((t=>t.key_system_identifier&&t.key_system_identifier!==e.systemIdentifier))){const e="One or more subtags are in other vaults. Please remove those subtags from the vaults or move them to this vault first.";return this.alerts.alertV2({title:"Cannot move item to vault",text:e}).catch(console.error),b.Result.fail(e)}n=r}return yield this._moveItemsToVault.execute({vault:e,items:[t,...n]}),b.Result.ok(this.items.findSureItem(t.uuid))}))}removeItemFromVault(e){return Xr(this,void 0,void 0,(function*(){const t=this.getItemVault(e);if(!t)throw new Error("Cannot find vault to remove item from");if(this.vaultLocks.isVaultLocked(t))throw new Error("Attempting to remove item from locked vault");if((0,I.isTag)(e)){const t=this.items.getDeepTagChildren(e);for(const e of t)yield this._removeItemFromVault.execute({item:e})}return yield this._removeItemFromVault.execute({item:e}),this.items.findSureItem(e.uuid)}))}authorizeVaultDeletion(e){return this._authorizeVaultDeletion.execute(e)}deleteVault(e){return Xr(this,void 0,void 0,(function*(){if(e.isSharedVaultListing())throw new Error("Shared vault must be deleted through SharedVaultService");const t=yield this._deleteVault.execute(e);return!(0,a.isClientDisplayableError)(t)&&(yield this.sync.sync(),!0)}))}changeVaultMetadata(e,t){return Xr(this,void 0,void 0,(function*(){const n=yield this.mutator.changeItem(e,(e=>{e.name=t.name,e.description=t.description,e.iconString=t.iconString}));return yield this.sync.sync(),n.isSharedVaultListing()&&(yield this._sendVaultDataChangeMessage.execute({vault:n})),n}))}rotateVaultRootKey(e,t){return Xr(this,void 0,void 0,(function*(){if(this.vaultLocks.isVaultLocked(e))throw new Error("Cannot rotate root key of locked vault");yield this._rotateVaultKey.execute({vault:e,userInputtedPassword:t}),yield this.sync.sync()}))}isItemInVault(e){return void 0!==e.key_system_identifier}getItemVault(e){const t=this.items.findItem(e.uuid);if(this.items.isTemplateItem(e))return;if(!t)throw new Error("Cannot find latest version of item to get vault for");if(!t.key_system_identifier)return;const n=this.getVault({keySystemIdentifier:t.key_system_identifier});if(n.isFailed())throw new Error("Cannot find vault for item");return n.getValue()}changeVaultKeyOptions(e){return Xr(this,void 0,void 0,(function*(){if(this.vaultLocks.isVaultLocked(e.vault))throw new Error("Attempting to change vault options on a locked vault");if(!this._isVaultOwner.execute(e.vault).getValue())throw new Error("Third party vault options should be changed via changeThirdPartyVaultStorageOptions");return yield this._changeVaultKeyOptions.execute(e)}))}changeThirdPartyVaultStorageOptions(e){return Xr(this,void 0,void 0,(function*(){if(this.vaultLocks.isVaultLocked(e.vault))throw new Error("Attempting to change vault options on a locked vault");if(this._isVaultOwner.execute(e.vault).getValue())throw new Error("First party vault options should be changed via changeVaultKeyOptions");return this._validateVaultPassword.execute(e.vault,e.vaultPassword).getValue()?yield this._changeVaultKeyOptions.execute({vault:e.vault,newStorageMode:e.newStorageMode,newPasswordOptions:void 0}):b.Result.fail("Invalid vault password")}))}}Jr||(Jr={});class ei{constructor(e,t){this.inviteServer=e,this.processInvite=t}execute(e){return t=this,n=void 0,i=function*(){const t=yield this.inviteServer.acceptInvite({sharedVaultUuid:e.invite.shared_vault_uuid,inviteUuid:e.invite.uuid});return(0,a.isErrorResponse)(t)?b.Result.fail("Could not accept vault invitation: ".concat((0,a.getErrorFromErrorResponse)(t).message)):(yield this.processInvite.execute(e.message,e.invite.shared_vault_uuid,e.invite.sender_uuid),b.Result.ok())},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}var ti=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class ni{constructor(e,t,n,r,i){this.keyManager=e,this._encryptMessage=t,this._sendInvite=n,this._shareContact=r,this._getKeyPairs=i}execute(e){return ti(this,void 0,void 0,(function*(){const t=this._getKeyPairs.execute();if(t.isFailed())return b.Result.fail("Cannot invite contact; keys not found");const n=yield this.inviteContact({keys:t.getValue(),sharedVault:e.sharedVault,sharedVaultContacts:e.sharedVaultContacts,recipient:e.recipient,permission:e.permission});return n.isFailed()||(yield this.shareContactWithOtherVaultMembers({contact:e.recipient,keys:t.getValue(),sharedVault:e.sharedVault})),n}))}shareContactWithOtherVaultMembers(e){return ti(this,void 0,void 0,(function*(){return yield this._shareContact.execute({sharedVault:e.sharedVault,contactToShare:e.contact})}))}inviteContact(e){return ti(this,void 0,void 0,(function*(){const t=b.SharedVaultUserPermission.create(e.permission);if(t.isFailed())return b.Result.fail(t.getError());const n=t.getValue(),r=this.keyManager.getPrimaryKeySystemRootKey(e.sharedVault.systemIdentifier);if(!r)return b.Result.fail("Cannot invite contact; key system root key not found");const i=e.sharedVaultContacts.find((e=>e.isMe));if(!i)return b.Result.fail("Cannot invite contact; me contact not found");const o={name:void 0,contactUuid:i.contactUuid,publicKeySet:i.publicKeySet},s=e.sharedVaultContacts.filter((t=>!t.isMe&&t.contactUuid!==e.recipient.contactUuid)).map((e=>({name:e.name,contactUuid:e.contactUuid,publicKeySet:e.publicKeySet}))),a=this._encryptMessage.execute({message:{type:I.AsymmetricMessagePayloadType.SharedVaultInvite,data:{recipientUuid:e.recipient.contactUuid,rootKey:r.content,trustedContacts:[o,...s],metadata:{name:e.sharedVault.name,description:e.sharedVault.description,iconString:e.sharedVault.iconString,fileBytesUsed:e.sharedVault.sharing.fileBytesUsed,designatedSurvivor:e.sharedVault.sharing.designatedSurvivor}}},keys:e.keys,recipientPublicKey:e.recipient.publicKeySet.encryption});return a.isFailed()?b.Result.fail(a.getError()):yield this._sendInvite.execute({sharedVaultUuid:e.sharedVault.sharing.sharedVaultUuid,recipientUuid:e.recipient.contactUuid,encryptedMessage:a.getValue(),permission:n.value})}))}}var ri=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class ii{constructor(e,t,n){this.reuploadInvite=e,this.findContact=t,this.inviteServer=n}execute(e){return ri(this,void 0,void 0,(function*(){const t=yield this.getExistingInvites();if(t.isFailed())return t;const n=yield this.deleteExistingInvites();if(n.isFailed())return n;const r=[];for(const n of t.getValue()){const t=this.findContact.execute({userUuid:n.user_uuid});if(t.isFailed()){r.push("Contact not found for invite ".concat(n.user_uuid));continue}const i=yield this.reuploadInvite.execute({keys:e.keys,previousKeys:e.previousKeys,recipient:t.getValue(),previousInvite:n});i.isFailed()&&r.push(i.getError())}return r.length>0?b.Result.fail(r.join(", ")):b.Result.ok()}))}getExistingInvites(){return ri(this,void 0,void 0,(function*(){const e=yield this.inviteServer.getOutboundUserInvites();if((0,a.isErrorResponse)(e))return b.Result.fail("Failed to get outbound user invites ".concat(JSON.stringify(e)));const t=e.data.invites;return b.Result.ok(t)}))}deleteExistingInvites(){return ri(this,void 0,void 0,(function*(){const e=yield this.inviteServer.deleteAllOutboundInvites();return(0,a.isErrorResponse)(e)?b.Result.fail("Failed to delete existing invites ".concat(JSON.stringify(e))):b.Result.ok()}))}}class oi{constructor(e,t,n){this.decryptOwnMessage=e,this.sendInvite=t,this.encryptMessage=n}execute(e){var t,n,r,i,o,s;return r=this,i=void 0,s=function*(){const r=this.decryptOwnMessage.execute({message:e.previousInvite.encrypted_message,privateKey:null!==(n=null===(t=e.previousKeys)||void 0===t?void 0:t.encryption.privateKey)&&void 0!==n?n:e.keys.encryption.privateKey,recipientPublicKey:e.recipient.publicKeySet.encryption});if(r.isFailed())return b.Result.fail(r.getError());const i=this.encryptMessage.execute({message:r.getValue(),keys:e.keys,recipientPublicKey:e.recipient.publicKeySet.encryption});return i.isFailed()?b.Result.fail(i.getError()):yield this.sendInvite.execute({sharedVaultUuid:e.previousInvite.shared_vault_uuid,recipientUuid:e.recipient.contactUuid,encryptedMessage:i.getValue(),permission:e.previousInvite.permission})},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(n,a)}l((s=s.apply(r,i||[])).next())}))}}var si=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class ai{constructor(e,t,n){this.reuploadInvite=e,this.findContact=t,this.inviteServer=n}execute(e){return si(this,void 0,void 0,(function*(){const t=yield this.getExistingInvites(e.sharedVault.sharing.sharedVaultUuid);if(t.isFailed())return t;const n=yield this.deleteExistingInvites(e.sharedVault.sharing.sharedVaultUuid);if(n.isFailed())return n;const r=[];for(const n of t.getValue()){const t=this.findContact.execute({userUuid:n.user_uuid});if(t.isFailed()){r.push("Contact not found for invite ".concat(n.user_uuid));continue}const i=yield this.reuploadInvite.execute({keys:e.keys,recipient:t.getValue(),previousInvite:n});i.isFailed()&&r.push(i.getError())}return r.length>0?b.Result.fail(r.join(", ")):b.Result.ok()}))}getExistingInvites(e){return si(this,void 0,void 0,(function*(){const t=yield this.inviteServer.getOutboundUserInvites();if((0,a.isErrorResponse)(t))return b.Result.fail("Failed to get outbound user invites ".concat(JSON.stringify(t)));const n=t.data.invites;return b.Result.ok(n.filter((t=>t.shared_vault_uuid===e)))}))}deleteExistingInvites(e){return si(this,void 0,void 0,(function*(){const t=yield this.inviteServer.deleteAllSharedVaultInvites({sharedVaultUuid:e});return(0,a.isErrorResponse)(t)?b.Result.fail("Failed to delete existing invites ".concat(JSON.stringify(t))):b.Result.ok()}))}}var li;class ci{constructor(e){this.vaultInvitesServer=e}execute(e){return t=this,n=void 0,i=function*(){const t=b.SharedVaultUserPermission.create(e.permission);if(t.isFailed())return b.Result.fail(t.getError());const n=t.getValue(),r=yield this.vaultInvitesServer.createInvite({sharedVaultUuid:e.sharedVaultUuid,recipientUuid:e.recipientUuid,encryptedMessage:e.encryptedMessage,permission:n});return(0,a.isErrorResponse)(r)?b.Result.fail((0,a.getErrorFromErrorResponse)(r).message):b.Result.ok(r.data.invite)},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}!function(e){e.InviteSent="VaultInviteServiceEvent.InviteSent",e.InvitesReloaded="VaultInviteServiceEvent.InvitesReloaded"}(li||(li={}));var ui,di=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class hi extends f{constructor(e,t,n,r,i,o,s,a,l,c,u,d,h,p,f,g,m){super(m),this.session=t,this.vaultUsers=n,this.sync=r,this.invitesServer=i,this.status=o,this._getAllContacts=s,this._getVault=a,this._getVaultContacts=l,this._inviteToVault=c,this._getTrustedPayload=u,this._getUntrustedPayload=d,this._findContact=h,this._acceptVaultInvite=p,this._getKeyPairs=f,this._decryptErroredPayloads=g,this.pendingInvites={},this.eventDisposers.push(e.addObserver(b.ContentType.TYPES.TrustedContact,(e=>{let{inserted:t,source:n}=e;return di(this,void 0,void 0,(function*(){n===I.PayloadEmitSource.LocalChanged&&t.length>0&&this.downloadInboundInvites(),yield this.reprocessCachedInvitesTrustStatusAfterTrustedContactsChange()}))})))}deinit(){super.deinit(),this.session=void 0,this.vaultUsers=void 0,this.sync=void 0,this.invitesServer=void 0,this._getAllContacts=void 0,this._getVault=void 0,this._getVaultContacts=void 0,this._inviteToVault=void 0,this._getTrustedPayload=void 0,this._getUntrustedPayload=void 0,this._findContact=void 0,this._acceptVaultInvite=void 0,this._getKeyPairs=void 0,this._decryptErroredPayloads=void 0,this.pendingInvites={}}updatePendingInviteCount(){this.status.setPreferencesBubbleCount("vaults",Object.keys(this.pendingInvites).length)}addPendingInvite(e){this.pendingInvites[e.invite.uuid]=e,this.updatePendingInviteCount()}removePendingInvite(e){delete this.pendingInvites[e],this.updatePendingInviteCount()}handleEvent(e){return di(this,void 0,void 0,(function*(){switch(e.type){case E.ReceivedSharedVaultInvites:yield this.processInboundInvites(e.payload);break;case L.Launched:if(!this.session.isSignedIn())return;this.downloadInboundInvites();break;case Vn.NotificationReceived:yield this.handleNotification(e.payload);break;case s.UserInvitedToSharedVault:yield this.processInboundInvites([e.payload.invite])}}))}handleNotification(e){return di(this,void 0,void 0,(function*(){e.eventPayload.props.type.value===b.NotificationType.TYPES.SharedVaultInviteCanceled&&(this.removePendingInvite(e.eventPayload.props.primaryIdentifier.value),this.notifyEvent(li.InvitesReloaded))}))}getCachedPendingInviteRecords(){return Object.values(this.pendingInvites)}downloadInboundInvites(){return di(this,void 0,void 0,(function*(){const e=yield this.invitesServer.getInboundUserInvites();return(0,a.isErrorResponse)(e)?a.ClientDisplayableError.FromString("Failed to get inbound user invites ".concat(JSON.stringify(e))):(this.pendingInvites={},yield this.processInboundInvites(e.data.invites),e.data.invites)}))}getOutboundInvites(e){return di(this,void 0,void 0,(function*(){const t=yield this.invitesServer.getOutboundUserInvites();return(0,a.isErrorResponse)(t)?a.ClientDisplayableError.FromString("Failed to get outbound user invites ".concat(JSON.stringify(t))):e?t.data.invites.filter((t=>t.shared_vault_uuid===e.sharing.sharedVaultUuid)):t.data.invites}))}acceptInvite(e){return di(this,void 0,void 0,(function*(){if(!e.trusted)return b.Result.fail("Cannot accept untrusted invite");const t=yield this._acceptVaultInvite.execute({invite:e.invite,message:e.message});return t.isFailed()?b.Result.fail(t.getError()):(this.removePendingInvite(e.invite.uuid),this.sync.sync().catch(console.error),this.vaultUsers.invalidateVaultUsersCache(e.invite.shared_vault_uuid).catch(console.error),yield this._decryptErroredPayloads.execute(),yield this.sync.syncSharedVaultsFromScratch([e.invite.shared_vault_uuid]),b.Result.ok())}))}getInvitableContactsForSharedVault(e){return di(this,void 0,void 0,(function*(){const t=yield this.vaultUsers.getSharedVaultUsersFromServer(e);if(!t)return[];const n=this._getAllContacts.execute();if(n.isFailed())return[];const r=yield this.getOutboundInvites(e);return(0,a.isClientDisplayableError)(r)?[]:n.getValue().filter((e=>{const n=t.some((t=>t.user_uuid===e.contactUuid)),i=r.some((t=>t.user_uuid===e.contactUuid));return!n&&!i}))}))}inviteContactToSharedVault(e,t,n){return di(this,void 0,void 0,(function*(){const r=yield this._getVaultContacts.execute({sharedVaultUuid:e.sharing.sharedVaultUuid,readFromCache:!1});if(r.isFailed())return b.Result.fail(r.getError());const i=r.getValue(),o=yield this._inviteToVault.execute({sharedVault:e,recipient:t,sharedVaultContacts:i,permission:n});return o.isFailed()?b.Result.fail(o.getError()):(this.notifyEvent(li.InviteSent),yield this.sync.sync(),o)}))}isVaultUserOwner(e){const t=this._getVault.execute({sharedVaultUuid:e.shared_vault_uuid});if(t.isFailed())return!1;const n=t.getValue();return null!=n&&n.sharing.ownerUserUuid===e.user_uuid}deleteInvite(e){return di(this,void 0,void 0,(function*(){const t=yield this.invitesServer.deleteInvite({sharedVaultUuid:e.shared_vault_uuid,inviteUuid:e.uuid});if((0,a.isErrorResponse)(t))return a.ClientDisplayableError.FromString("Failed to delete invite ".concat(JSON.stringify(t)));this.removePendingInvite(e.uuid)}))}reprocessCachedInvitesTrustStatusAfterTrustedContactsChange(){return di(this,void 0,void 0,(function*(){const e=this.getCachedPendingInviteRecords().map((e=>e.invite));yield this.processInboundInvites(e)}))}processInboundInvites(e){return di(this,void 0,void 0,(function*(){if(0===e.length)return void this.updatePendingInviteCount();const t=this._getKeyPairs.execute();if(!t.isFailed()){for(const n of e){delete this.pendingInvites[n.uuid];const e=this._findContact.execute({userUuid:n.sender_uuid});if(!e.isFailed()){const r=this._getTrustedPayload.execute({payload:n,privateKey:t.getValue().encryption.privateKey,ownUserUuid:this.session.userUuid,sender:e.getValue()});if(!r.isFailed()){this.addPendingInvite({invite:n,message:r.getValue(),trusted:!0});continue}}const r=this._getUntrustedPayload.execute({payload:n,privateKey:t.getValue().encryption.privateKey});r.isFailed()||this.addPendingInvite({invite:n,message:r.getValue(),trusted:!1})}this.notifyEvent(li.InvitesReloaded)}}))}}class pi{constructor(e,t){this.encryption=e,this.keys=t}execute(e,t){if(e.keyPasswordType!==I.KeySystemPasswordType.UserInputted)throw new Error("Vault uses randomized password and cannot be validated with password");const n=this.keys.getPrimaryKeySystemRootKey(e.systemIdentifier);if(!n)return b.Result.ok(!1);const r=this.encryption.deriveUserInputtedKeySystemRootKey({keyParams:e.rootKeyParams,userInputtedPassword:t});return b.Result.ok(n.isEqual(r))}}!function(e){e.VaultUnlocked="VaultUnlocked",e.VaultLocked="VaultLocked"}(ui||(ui={}));var fi=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class gi extends f{constructor(e,t,n,r,i,o,s,a){super(a),this.encryption=t,this.keys=n,this._getVaults=r,this._decryptErroredPayloads=i,this._removeItemsFromMemory=o,this._getVaultItems=s,this.lockMap=new Map,this.recomputeAllVaultsLockingState=()=>fi(this,void 0,void 0,(function*(){const e=this._getVaults.execute().getValue();for(const t of e){const e="locked"===this.computeVaultLockState(t);this.lockMap.get(t.uuid)!==e&&(this.lockMap.set(t.uuid,e),e?this.notifyEvent(ui.VaultLocked,{vault:t}):this.notifyEvent(ui.VaultUnlocked,{vault:t}))}})),e.addObserver([b.ContentType.TYPES.KeySystemItemsKey,b.ContentType.TYPES.KeySystemRootKey,b.ContentType.TYPES.VaultListing],(()=>{this.recomputeAllVaultsLockingState()}))}deinit(){super.deinit(),this.encryption=void 0,this.keys=void 0,this._getVaults=void 0,this._decryptErroredPayloads=void 0,this._removeItemsFromMemory=void 0,this._getVaultItems=void 0,this.lockMap.clear()}getLockedvaults(){return this._getVaults.execute().getValue().filter((e=>this.isVaultLocked(e)))}isVaultLocked(e){return!0===this.lockMap.get(e.uuid)}isVaultLockable(e){return e.keyPasswordType===I.KeySystemPasswordType.UserInputted}lockNonPersistentVault(e){return fi(this,void 0,void 0,(function*(){if(e.keyStorageMode===I.KeySystemRootKeyStorageMode.Synced)throw new Error("Vault uses synced key storage and cannot be locked");if(e.keyPasswordType!==I.KeySystemPasswordType.UserInputted)throw new Error("Vault uses randomized password and cannot be locked");yield this.keys.wipeVaultKeysFromMemory(e);const t=this._getVaultItems.execute(e).getValue();yield this._removeItemsFromMemory.execute(t),this.lockMap.set(e.uuid,!0),this.notifyEventSync(ui.VaultLocked,{vault:e})}))}unlockNonPersistentVault(e,t){return fi(this,void 0,void 0,(function*(){if(e.keyPasswordType!==I.KeySystemPasswordType.UserInputted)throw new Error("Vault uses randomized password and cannot be unlocked with user inputted password");if(e.keyStorageMode===I.KeySystemRootKeyStorageMode.Synced)throw new Error("Vault uses synced root key and cannot be unlocked with user inputted password");const n=this.encryption.deriveUserInputtedKeySystemRootKey({keyParams:e.rootKeyParams,userInputtedPassword:t});return this.keys.cacheKey(n,e.keyStorageMode),yield this._decryptErroredPayloads.execute(),"locked"===this.computeVaultLockState(e)?(this.keys.removeKeyFromCache(e.systemIdentifier),!1):(this.lockMap.set(e.uuid,!1),this.notifyEventSync(ui.VaultUnlocked,{vault:e}),!0)}))}computeVaultLockState(e){return this.keys.getPrimaryKeySystemRootKey(e.systemIdentifier)&&this.keys.getPrimaryKeySystemItemsKey(e.systemIdentifier)?"unlocked":"locked"}}class mi{constructor(e){this.sharedVaultUserServer=e}execute(e){return t=this,n=void 0,i=function*(){const t=b.Uuid.create(e.sharedVaultUuid);if(t.isFailed())return b.Result.fail(t.getError());const n=t.getValue(),r=b.Uuid.create(e.sharedVaultMemberUuid);if(r.isFailed())return b.Result.fail(r.getError());const i=r.getValue();return(yield this.sharedVaultUserServer.designateSurvivor({sharedVaultUuid:n,sharedVaultMemberUuid:i})).status!==a.HttpStatusCode.Success?b.Result.fail("Failed to mark designated survivor on the server"):b.Result.ok()},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class yi{constructor(e,t){this._findContact=e,this._getVaultUsers=t}execute(e){return t=this,n=void 0,i=function*(){const t=yield this._getVaultUsers.execute({sharedVaultUuid:e.sharedVaultUuid,readFromCache:e.readFromCache});if(t.isFailed())return b.Result.fail("Failed to get vault users");const n=t.getValue().map((e=>this._findContact.execute({userUuid:e.user_uuid}))).map((e=>e.isFailed()?void 0:e.getValue())).filter(c.isNotUndefined);return b.Result.ok(n)},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class vi{constructor(e,t){this.vaultUsersServer=e,this.cache=t}execute(e){return t=this,n=void 0,i=function*(){if(e.readFromCache){const t=this.cache.get(e.sharedVaultUuid);if(t)return b.Result.ok(t)}const t=yield this.vaultUsersServer.getSharedVaultUsers({sharedVaultUuid:e.sharedVaultUuid});return(0,a.isErrorResponse)(t)?b.Result.fail((0,a.getErrorFromErrorResponse)(t).message):(this.cache.set(e.sharedVaultUuid,t.data.users),b.Result.ok(t.data.users))},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class Ai{constructor(e,t){this.users=e,this.cache=t}execute(e){var t;if(!e.sharing)return b.Result.ok(!0);if(!e.sharing.ownerUserUuid)throw new Error("Shared vault ".concat(e.sharing.sharedVaultUuid," does not have an owner user uuid"));const n=this.users.sureUser,r=this.cache.get(e.sharing.sharedVaultUuid),i=null===(t=null==r?void 0:r.find((e=>e.user_uuid===n.uuid)))||void 0===t?void 0:t.permission;return b.Result.ok(i===b.SharedVaultUserPermission.PERMISSIONS.Read)}}class bi{constructor(e,t){this.users=e,this.cache=t}execute(e){var t;if(!e.sharing)return b.Result.ok(!0);if(!e.sharing.ownerUserUuid)throw new Error("Shared vault ".concat(e.sharing.sharedVaultUuid," does not have an owner user uuid"));const n=this.users.sureUser,r=this.cache.get(e.sharing.sharedVaultUuid),i=null===(t=null==r?void 0:r.find((e=>e.user_uuid===n.uuid)))||void 0===t?void 0:t.permission;return b.Result.ok(i===b.SharedVaultUserPermission.PERMISSIONS.Admin||e.sharing.ownerUserUuid===n.uuid)}}class wi{constructor(e){this.users=e}execute(e){if(!e.sharing)return b.Result.ok(!0);if(!e.sharing.ownerUserUuid)throw new Error("Shared vault ".concat(e.sharing.sharedVaultUuid," does not have an owner user uuid"));const t=this.users.sureUser;return b.Result.ok(e.sharing.ownerUserUuid===t.uuid)}}class Si{constructor(e,t,n,r){this.users=e,this.vaultUserServer=t,this.items=n,this._deleteThirdPartyVault=r}execute(e){return t=this,n=void 0,i=function*(){const t=this.items.findItem(e.sharedVault.uuid);if(!t)throw new Error("LeaveVaultUseCase: Could not find vault ".concat(e.sharedVault.uuid));const n=yield this.vaultUserServer.deleteSharedVaultUser({sharedVaultUuid:t.sharing.sharedVaultUuid,userUuid:this.users.sureUser.uuid});if((0,a.isErrorResponse)(n))return a.ClientDisplayableError.FromString("Failed to leave vault ".concat(JSON.stringify(n)));yield this._deleteThirdPartyVault.execute(t)},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}var Ci;class Ei{constructor(e){this.vaultUserServer=e}execute(e){return t=this,n=void 0,i=function*(){const t=yield this.vaultUserServer.deleteSharedVaultUser({sharedVaultUuid:e.sharedVaultUuid,userUuid:e.userUuid});return(0,a.isErrorResponse)(t)?b.Result.fail((0,a.getErrorFromErrorResponse)(t).message):b.Result.ok()},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class Ii{constructor(){this.cache=new Map}get(e){return this.cache.get(e)}set(e,t){this.cache.set(e,t)}}!function(e){e.UsersChanged="VaultUserServiceEvent.UsersChanged",e.InvalidatedAllUserCache="VaultUserServiceEvent.InvalidatedUserCache",e.InvalidatedUserCacheForVault="VaultUserServiceEvent.InvalidatedUserCacheForVault"}(Ci||(Ci={}));var _i=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class xi extends f{constructor(e,t,n,r,i,o,s,a,l,c,u){super(u),this.vaults=e,this.vaultLocks=t,this._getVaultUsers=n,this._removeVaultMember=r,this._isVaultOwner=i,this._isVaultAdmin=o,this._isReadonlyVaultMember=s,this._getVault=a,this._leaveVault=l,this.designateSurvivorUseCase=c}deinit(){super.deinit(),this.vaults=void 0,this._getVaultUsers=void 0,this._removeVaultMember=void 0,this._isVaultOwner=void 0,this._getVault=void 0,this._leaveVault=void 0}designateSurvivor(e,t){return _i(this,void 0,void 0,(function*(){const n=yield this.designateSurvivorUseCase.execute({sharedVaultMemberUuid:t,sharedVaultUuid:e.sharing.sharedVaultUuid});return n.isFailed()?b.Result.fail("Could not designate survivor: ".concat(n.getError())):b.Result.ok()}))}invalidateVaultUsersCache(e){return _i(this,void 0,void 0,(function*(){if(e)return yield this._getVaultUsers.execute({sharedVaultUuid:e,readFromCache:!1}),void this.notifyEvent(Ci.InvalidatedUserCacheForVault,e);yield Promise.all(this.vaults.getVaults().map((e=>_i(this,void 0,void 0,(function*(){e.isSharedVaultListing()&&(yield this._getVaultUsers.execute({sharedVaultUuid:e.sharing.sharedVaultUuid,readFromCache:!1}),this.notifyEvent(Ci.InvalidatedUserCacheForVault,e.sharing.sharedVaultUuid))}))))),this.notifyEvent(Ci.InvalidatedAllUserCache)}))}getSharedVaultUsersFromServer(e){return _i(this,void 0,void 0,(function*(){const t=yield this._getVaultUsers.execute({sharedVaultUuid:e.sharing.sharedVaultUuid,readFromCache:!1});if(!t.isFailed())return t.getValue()}))}isCurrentUserSharedVaultOwner(e){return this._isVaultOwner.execute(e).getValue()}isCurrentUserSharedVaultAdmin(e){return this._isVaultAdmin.execute(e).getValue()}isCurrentUserReadonlyVaultMember(e){return!!e.isSharedVaultListing()&&this._isReadonlyVaultMember.execute(e).getValue()}removeUserFromSharedVault(e,t){return _i(this,void 0,void 0,(function*(){if(!this.isCurrentUserSharedVaultOwner(e))throw new Error("Only vault admins can remove users");if(this.vaultLocks.isVaultLocked(e))throw new Error("Cannot remove user from locked vault");const n=yield this._removeVaultMember.execute({sharedVaultUuid:e.sharing.sharedVaultUuid,userUuid:t});return n.isFailed()||(this.notifyEvent(Ci.UsersChanged),yield this.vaults.rotateVaultRootKey(e)),n}))}isVaultUserOwner(e){const t=this._getVault.execute({sharedVaultUuid:e.shared_vault_uuid});if(t.isFailed())return!1;const n=t.getValue();return null!=n&&n.sharing.ownerUserUuid===e.user_uuid}leaveSharedVault(e){return _i(this,void 0,void 0,(function*(){const t=yield this._leaveVault.execute({sharedVault:e});if((0,a.isClientDisplayableError)(t))return t;this.notifyEvent(Ci.UsersChanged)}))}getFormattedMemberPermission(e){switch(e){case"admin":return"Admin";case"write":return"Read / Write";case"read":return"Read-only";default:return"Unknown"}}}},8430:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},91440:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},21404:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},63180:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(8430),t),i(n(91440),t),i(n(21404),t)},45575:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},83372:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(45575),t)},41335:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},90176:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.timingSafeEqual=void 0,t.timingSafeEqual=function(e,t){const n=String(e);let r=String(t);const i=n.length;let o=0;i!==r.length&&(r=n,o=1);for(let e=0;e<i;e++)o|=n.charCodeAt(e)^r.charCodeAt(e);return 0===o}},78492:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(41335),t),i(n(90176),t)},26734:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},68101:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(26734),t)},88602:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},84370:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},1282:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},69422:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},51234:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SodiumConstant=void 0,t.SodiumConstant={CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_STATEBYTES:52,CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES:17,CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES:24,CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES:32,CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX:274877906816,crypto_box_SEEDBYTES:32,crypto_sign_SEEDBYTES:32,crypto_generichash_KEYBYTES:32}},58081:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},42565:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SodiumTag=void 0,function(e){e[e.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PUSH=0]="CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PUSH",e[e.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PULL=1]="CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PULL",e[e.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY=2]="CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY",e[e.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL=3]="CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL"}(n||(t.SodiumTag=n={}))},67918:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},39296:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},91338:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},83395:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},21084:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},30418:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(88602),t),i(n(84370),t),i(n(1282),t),i(n(69422),t),i(n(51234),t),i(n(58081),t),i(n(42565),t),i(n(67918),t),i(n(39296),t),i(n(91338),t),i(n(83395),t),i(n(21084),t)},98418:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(63180),t),i(n(83372),t),i(n(78492),t),i(n(68101),t),i(n(30418),t)},13979:(e,t,n)=>{n.d(t,{v:()=>r});const r={DeviceInterface:Symbol.for("DeviceInterface"),AlertService:Symbol.for("AlertService"),Crypto:Symbol.for("Crypto"),InternalEventBus:Symbol.for("InternalEventBus"),PayloadManager:Symbol.for("PayloadManager"),ItemManager:Symbol.for("ItemManager"),MutatorService:Symbol.for("MutatorService"),DiskStorageService:Symbol.for("DiskStorageService"),NotificationService:Symbol.for("NotificationService"),InMemoryStore:Symbol.for("InMemoryStore"),KeySystemKeyManager:Symbol.for("KeySystemKeyManager"),EncryptionService:Symbol.for("EncryptionService"),ChallengeService:Symbol.for("ChallengeService"),DeprecatedHttpService:Symbol.for("DeprecatedHttpService"),HttpService:Symbol.for("HttpService"),LegacyApiService:Symbol.for("LegacyApiService"),UserServer:Symbol.for("UserServer"),UserRequestServer:Symbol.for("UserRequestServer"),UserApiService:Symbol.for("UserApiService"),SubscriptionServer:Symbol.for("SubscriptionServer"),SubscriptionApiService:Symbol.for("SubscriptionApiService"),WebSocketServer:Symbol.for("WebSocketServer"),WebSocketApiService:Symbol.for("WebSocketApiService"),WebSocketsService:Symbol.for("WebSocketsService"),SessionManager:Symbol.for("SessionManager"),SubscriptionManager:Symbol.for("SubscriptionManager"),HistoryManager:Symbol.for("HistoryManager"),SyncFrequencyGuard:Symbol.for("SyncFrequencyGuard"),SyncBackoffService:Symbol.for("SyncBackoffService"),SyncService:Symbol.for("SyncService"),ProtectionService:Symbol.for("ProtectionService"),UserService:Symbol.for("UserService"),KeyRecoveryService:Symbol.for("KeyRecoveryService"),SingletonManager:Symbol.for("SingletonManager"),PreferencesService:Symbol.for("PreferencesService"),SettingsService:Symbol.for("SettingsService"),FeaturesService:Symbol.for("FeaturesService"),ComponentManager:Symbol.for("ComponentManager"),MfaService:Symbol.for("MfaService"),StatusService:Symbol.for("StatusService"),MigrationService:Symbol.for("MigrationService"),FileService:Symbol.for("FileService"),IntegrityService:Symbol.for("IntegrityService"),ListedService:Symbol.for("ListedService"),ActionsService:Symbol.for("ActionsService"),AuthenticatorApiService:Symbol.for("AuthenticatorApiService"),AuthenticatorManager:Symbol.for("AuthenticatorManager"),AuthApiService:Symbol.for("AuthApiService"),AuthManager:Symbol.for("AuthManager"),RevisionApiService:Symbol.for("RevisionApiService"),RevisionManager:Symbol.for("RevisionManager"),ContactService:Symbol.for("ContactService"),VaultService:Symbol.for("VaultService"),SharedVaultService:Symbol.for("SharedVaultService"),AsymmetricMessageService:Symbol.for("AsymmetricMessageService"),SelfContactManager:Symbol.for("SelfContactManager"),EncryptionOperators:Symbol.for("EncryptionOperators"),RootKeyManager:Symbol.for("RootKeyManager"),ItemsEncryptionService:Symbol.for("ItemsEncryptionService"),VaultUserService:Symbol.for("VaultUserService"),VaultInviteService:Symbol.for("VaultInviteService"),VaultUserCache:Symbol.for("VaultUserCache"),VaultLockService:Symbol.for("VaultLockService"),Logger:Symbol.for("Logger"),RevisionServer:Symbol.for("RevisionServer"),AuthenticatorServer:Symbol.for("AuthenticatorServer"),AuthServer:Symbol.for("AuthServer"),SharedVaultInvitesServer:Symbol.for("SharedVaultInvitesServer"),SharedVaultServer:Symbol.for("SharedVaultServer"),SharedVaultUsersServer:Symbol.for("SharedVaultUsersServer"),AsymmetricMessageServer:Symbol.for("AsymmetricMessageServer"),FilesBackupService:Symbol.for("FilesBackupService"),HomeServerService:Symbol.for("HomeServerService"),SignInWithRecoveryCodes:Symbol.for("SignInWithRecoveryCodes"),GetRecoveryCodes:Symbol.for("GetRecoveryCodes"),AddAuthenticator:Symbol.for("AddAuthenticator"),ListAuthenticators:Symbol.for("ListAuthenticators"),DeleteAuthenticator:Symbol.for("DeleteAuthenticator"),GetAuthenticatorAuthenticationOptions:Symbol.for("GetAuthenticatorAuthenticationOptions"),GetAuthenticatorAuthenticationResponse:Symbol.for("GetAuthenticatorAuthenticationResponse"),ListRevisions:Symbol.for("ListRevisions"),GetRevision:Symbol.for("GetRevision"),DeleteRevision:Symbol.for("DeleteRevision"),ImportData:Symbol.for("ImportData"),DiscardItemsLocally:Symbol.for("DiscardItemsLocally"),FindContact:Symbol.for("FindContact"),GetAllContacts:Symbol.for("GetAllContacts"),CreateOrEditContact:Symbol.for("CreateOrEditContact"),EditContact:Symbol.for("EditContact"),ValidateItemSigner:Symbol.for("ValidateItemSigner"),GetVault:Symbol.for("GetVault"),GetVaults:Symbol.for("GetVaults"),SyncLocalVaultsWithRemoteSharedVaults:Symbol.for("SyncLocalVaultsWithRemoteSharedVaults"),GetSharedVaults:Symbol.for("GetSharedVaults"),GetOwnedSharedVaults:Symbol.for("GetOwnedSharedVaults"),ChangeVaultKeyOptions:Symbol.for("ChangeVaultKeyOptions"),MoveItemsToVault:Symbol.for("MoveItemsToVault"),CreateVault:Symbol.for("CreateVault"),DeleteContact:Symbol.for("DeleteContact"),ContactBelongsToVault:Symbol.for("ContactBelongsToVault"),RemoveItemFromVault:Symbol.for("RemoveItemFromVault"),DeleteVault:Symbol.for("DeleteVault"),RotateVaultKey:Symbol.for("RotateVaultKey"),CreateSharedVault:Symbol.for("CreateSharedVault"),HandleKeyPairChange:Symbol.for("HandleKeyPairChange"),NotifyVaultUsersOfKeyRotation:Symbol.for("NotifyVaultUsersOfKeyRotation"),SendVaultDataChangedMessage:Symbol.for("SendVaultDataChangedMessage"),SendVaultKeyChangedMessage:Symbol.for("SendVaultKeyChangedMessage"),GetTrustedPayload:Symbol.for("GetTrustedPayload"),GetUntrustedPayload:Symbol.for("GetUntrustedPayload"),GetVaultContacts:Symbol.for("GetVaultContacts"),AcceptVaultInvite:Symbol.for("AcceptVaultInvite"),InviteToVault:Symbol.for("InviteToVault"),LeaveVault:Symbol.for("LeaveVault"),DeleteThirdPartyVault:Symbol.for("DeleteThirdPartyVault"),ShareContactWithVault:Symbol.for("ShareContactWithVault"),ConvertToSharedVault:Symbol.for("ConvertToSharedVault"),DeleteSharedVault:Symbol.for("DeleteSharedVault"),RemoveVaultMember:Symbol.for("RemoveVaultMember"),DesignateSurvivor:Symbol.for("DesignateSurvivor"),GetVaultUsers:Symbol.for("GetSharedVaultUsers"),ResendAllMessages:Symbol.for("ResendAllMessages"),ReuploadAllInvites:Symbol.for("ReuploadAllInvites"),ReuploadInvite:Symbol.for("ReuploadInvite"),GetInboundMessages:Symbol.for("GetInboundMessages"),GetOutboundMessages:Symbol.for("GetOutboundMessages"),HandleRootKeyChangedMessage:Symbol.for("HandleRootKeyChangedMessage"),ProcessAcceptedVaultInvite:Symbol.for("ProcessAcceptedVaultInvite"),ResendMessage:Symbol.for("ResendMessage"),SendMessage:Symbol.for("SendMessage"),SendOwnContactChangeMessage:Symbol.for("SendOwnContactChangeMessage"),DecryptMessage:Symbol.for("DecryptMessage"),DecryptOwnMessage:Symbol.for("DecryptOwnMessage"),EncryptMessage:Symbol.for("EncryptMessage"),GetMessageAdditionalData:Symbol.for("GetMessageAdditionalData"),SendVaultInvite:Symbol.for("SendVaultInvite"),ReplaceContactData:Symbol.for("ReplaceContactData"),CreateNewDefaultItemsKey:Symbol.for("CreateNewDefaultItemsKey"),CreateNewItemsKeyWithRollback:Symbol.for("CreateNewItemsKeyWithRollback"),FindDefaultItemsKey:Symbol.for("FindDefaultItemsKey"),DecryptErroredTypeAPayloads:Symbol.for("DecryptErroredTypeAPayloads"),DecryptTypeAPayload:Symbol.for("DecryptTypeAPayload"),DecryptTypeAPayloadWithKeyLookup:Symbol.for("DecryptTypeAPayloadWithKeyLookup"),EncryptTypeAPayload:Symbol.for("EncryptTypeAPayload"),EncryptTypeAPayloadWithKeyLookup:Symbol.for("EncryptTypeAPayloadWithKeyLookup"),DecryptBackupFile:Symbol.for("DecryptBackupFile"),IsVaultOwner:Symbol.for("IsVaultOwner"),IsVaultAdmin:Symbol.for("IsVaultAdmin"),IsReadonlyVaultMember:Symbol.for("IsReadonlyVaultMember"),RemoveItemsFromMemory:Symbol.for("RemoveItemsFromMemory"),ReencryptTypeAItems:Symbol.for("ReencryptTypeAItems"),DecryptErroredPayloads:Symbol.for("DecryptErroredPayloads"),GetKeyPairs:Symbol.for("GetKeyPairs"),ChangeVaultStorageMode:Symbol.for("ChangeVaultStorageMode"),ChangeAndSaveItem:Symbol.for("ChangeAndSaveItem"),GetHost:Symbol.for("GetHost"),IsApplicationUsingThirdPartyHost:Symbol.for("IsApplicationUsingThirdPartyHost"),SetHost:Symbol.for("SetHost"),GenerateUuid:Symbol.for("GenerateUuid"),GetVaultItems:Symbol.for("GetVaultItems"),ValidateVaultPassword:Symbol.for("ValidateVaultPassword"),DecryptBackupPayloads:Symbol.for("DecryptBackupPayloads"),DetermineKeyToUse:Symbol.for("DetermineKeyToUse"),GetBackupFileType:Symbol.for("GetBackupFileType"),GetFilePassword:Symbol.for("GetFilePassword"),AuthorizeVaultDeletion:Symbol.for("AuthorizeVaultDeletion"),CreateDecryptedBackupFile:Symbol.for("CreateDecryptedBackupFile"),CreateEncryptedBackupFile:Symbol.for("CreateEncryptedBackupFile"),SessionStorageMapper:Symbol.for("SessionStorageMapper"),LegacySessionStorageMapper:Symbol.for("LegacySessionStorageMapper")}},2256:(e,t,n)=>{n.d(t,{Ak:()=>a,FB:()=>i,Im:()=>l,_e:()=>o,g:()=>s});var r=n(22325);function i(e){return{"mac-web":r.Platform.MacWeb,"mac-desktop":r.Platform.MacDesktop,"linux-web":r.Platform.LinuxWeb,"linux-desktop":r.Platform.LinuxDesktop,"windows-web":r.Platform.WindowsWeb,"windows-desktop":r.Platform.WindowsDesktop,"ios-web":r.Platform.Ios,"android-web":r.Platform.Android}[e]}function o(e){return{[r.Platform.MacWeb]:"mac-web",[r.Platform.MacDesktop]:"mac-desktop",[r.Platform.LinuxWeb]:"linux-web",[r.Platform.LinuxDesktop]:"linux-desktop",[r.Platform.WindowsWeb]:"windows-web",[r.Platform.WindowsDesktop]:"windows-desktop",[r.Platform.Ios]:"ios",[r.Platform.Android]:"android"}[e]}function s(e){return{[r.Environment.Web]:"web",[r.Environment.Desktop]:"desktop",[r.Environment.Mobile]:"native-mobile-web",[r.Environment.Clipper]:"clipper"}[e]}function a(e){return e===r.Environment.Web||e===r.Environment.Desktop}function l(e){return e===r.Environment.Mobile}},85593:(e,t,n)=>{n.d(t,{J5:()=>X,UC:()=>J,ie:()=>l,g:()=>$.g,Im:()=>$.Im,Ak:()=>$.Ak,FB:()=>$.FB,_e:()=>$._e});var r=n(20875),i=n(55668),o=n(22325),s=n(87901);const a={[i.wMo.SyncCompletedWithAllItemsUploaded]:i.n9K.CompletedFullSync,[i.wMo.PaginatedSyncRequestCompleted]:i.n9K.CompletedIncrementalSync,[i.wMo.SyncError]:i.n9K.FailedSync,[i.wMo.SyncTakingTooLong]:i.n9K.HighLatencySync,[i.wMo.EnterOutOfSync]:i.n9K.EnteredOutOfSync,[i.wMo.ExitOutOfSync]:i.n9K.ExitedOutOfSync,[i.wMo.LocalDataLoaded]:i.n9K.LocalDataLoaded,[i.wMo.MajorDataChange]:i.n9K.MajorDataChange,[i.wMo.LocalDataIncrementalLoad]:i.n9K.LocalDataIncrementalLoad,[i.wMo.StatusChanged]:i.n9K.SyncStatusChanged,[i.wMo.SyncDidBeginProcessing]:i.n9K.WillSync,[i.wMo.InvalidSession]:i.n9K.InvalidSyncSession,[i.wMo.DatabaseReadError]:i.n9K.LocalDatabaseReadError,[i.wMo.DatabaseWriteError]:i.n9K.LocalDatabaseWriteError,[i.wMo.DownloadFirstSyncCompleted]:i.n9K.CompletedInitialSync,[i.wMo.TooManyRequests]:i.n9K.SyncTooManyRequests};function l(e){return a[e]}var c=n(86999),u=n(43361),d=n(19820),h=n(46390),p=n(51383),f=n(9704),g=n(84526),m=n(12473),y=n(58875),v=n(43252),A=n(68704),b=n(79327),w=n(32274),S=n(81679),C=n(8740),E=n(3876),I=n(74987),_=n(6314),x=n(98116),P=n(30693),k=n(15109),B=n(80738),O=n(51271),N=n(37486),D=n(29675),j=n(53218),T=n(54911),M=n(94986),F=n(78734),R=n(40278),L=n(28559),Q=n(28178),U=n(45447),V=n(64892),K=n(82648);class H{toDomain(e){const{jwt:t}=e,n=K.LegacySession.create(t);if(n.isFailed())throw new Error(n.getError());return n.getValue()}toProjection(e){return{jwt:e.accessToken}}}class G{toDomain(e){const t=K.SessionToken.create(e.accessToken,e.accessExpiration);if(t.isFailed())throw new Error(t.getError());const n=t.getValue(),r=K.SessionToken.create(e.refreshToken,e.refreshExpiration);if(r.isFailed())throw new Error(r.getError());const i=r.getValue(),o=K.Session.create(n,i,e.readonlyAccess);if(o.isFailed())throw new Error(o.getError());return o.getValue()}toProjection(e){return{accessToken:e.accessToken.value,refreshToken:e.refreshToken.value,accessExpiration:e.accessToken.expiresAt,refreshExpiration:e.refreshToken.expiresAt,readonlyAccess:e.isReadOnly()}}}var Y=n(70781),z=n(13979);class Z{constructor(e){this.syncCallsThresholdPerMinute=e,this.callsPerMinuteMap=new Map}isSyncCallsThresholdReachedThisMinute(){const e=this.getCallsPerMinuteKey();return(this.callsPerMinuteMap.get(e)||0)>=this.syncCallsThresholdPerMinute}incrementCallsPerMinute(){const e=this.getCallsPerMinuteKey(),t=this.callsPerMinuteMap.get(e);void 0===t?(this.clear(),this.callsPerMinuteMap.set(e,1)):this.callsPerMinuteMap.set(e,t+1)}clear(){this.callsPerMinuteMap.clear()}getCallsPerMinuteKey(){const e=new Date;return"".concat(e.getFullYear(),"-").concat(e.getMonth(),"-").concat(e.getDate(),"T").concat(e.getHours(),":").concat(e.getMinutes())}}class W{constructor(e){this.options=e,this.factory=new Map,this.dependencies=new Map,this.DEFAULT_SYNC_CALLS_THRESHOLD_PER_MINUTE=200,this.dependencies.set(z.v.DeviceInterface,e.deviceInterface),this.dependencies.set(z.v.AlertService,e.alertService),this.dependencies.set(z.v.Crypto,e.crypto),this.registerServiceMakers(),this.registerUseCaseMakers()}deinit(){this.factory.clear();const e=this.getAll();for(const t of e)(0,s.isDeinitable)(t)&&t.deinit();this.dependencies.clear()}getAll(){return Array.from(this.dependencies.values()).filter(s.isNotUndefined)}get(e){const t=this.dependencies.get(e);if(t)return t;const n=this.factory.get(e);if(!n)throw new Error("No dependency maker found for ".concat(e.toString()));const r=n();return r?(this.dependencies.set(e,r),r):void 0}registerUseCaseMakers(){this.factory.set(z.v.DecryptBackupPayloads,(()=>new i.ZXN(this.get(z.v.EncryptionService),this.get(z.v.DetermineKeyToUse),this.get(z.v.Logger)))),this.factory.set(z.v.DetermineKeyToUse,(()=>new i.WEs(this.get(z.v.EncryptionService),this.get(z.v.KeySystemKeyManager)))),this.factory.set(z.v.GetBackupFileType,(()=>new i.KCz)),this.factory.set(z.v.GetFilePassword,(()=>new i.DZq(this.get(z.v.ChallengeService)))),this.factory.set(z.v.ValidateVaultPassword,(()=>new i.EGP(this.get(z.v.EncryptionService),this.get(z.v.KeySystemKeyManager)))),this.factory.set(z.v.AuthorizeVaultDeletion,(()=>new i.D$B(this.get(z.v.VaultLockService),this.get(z.v.ProtectionService),this.get(z.v.ChallengeService),this.get(z.v.ValidateVaultPassword)))),this.factory.set(z.v.GenerateUuid,(()=>new i.ug$(this.get(z.v.Crypto)))),this.factory.set(z.v.GetVaultItems,(()=>new i.$qZ(this.get(z.v.ItemManager)))),this.factory.set(z.v.DecryptErroredPayloads,(()=>new i.eyx(this.get(z.v.ItemsEncryptionService),this.get(z.v.DecryptErroredTypeAPayloads)))),this.factory.set(z.v.GetHost,(()=>new i.cdY(this.get(z.v.LegacyApiService)))),this.factory.set(z.v.IsApplicationUsingThirdPartyHost,(()=>new i.Y8x(this.get(z.v.GetHost)))),this.factory.set(z.v.SetHost,(()=>new i.q62(this.get(z.v.HttpService),this.get(z.v.LegacyApiService)))),this.factory.set(z.v.GetKeyPairs,(()=>new i.Byj(this.get(z.v.RootKeyManager)))),this.factory.set(z.v.ReencryptTypeAItems,(()=>new i.HSp(this.get(z.v.ItemManager),this.get(z.v.MutatorService)))),this.factory.set(z.v.CreateDecryptedBackupFile,(()=>new i.ocI(this.get(z.v.PayloadManager),this.get(z.v.ProtectionService)))),this.factory.set(z.v.CreateEncryptedBackupFile,(()=>new i.D6l(this.get(z.v.ItemManager),this.get(z.v.ProtectionService),this.get(z.v.EncryptionService)))),this.factory.set(z.v.ImportData,(()=>new i.Ens(this.get(z.v.ItemManager),this.get(z.v.SyncService),this.get(z.v.ProtectionService),this.get(z.v.EncryptionService),this.get(z.v.PayloadManager),this.get(z.v.HistoryManager),this.get(z.v.DecryptBackupFile),this.get(z.v.GetFilePassword)))),this.factory.set(z.v.IsVaultOwner,(()=>new i.hjk(this.get(z.v.UserService)))),this.factory.set(z.v.IsVaultAdmin,(()=>new i.o1e(this.get(z.v.UserService),this.get(z.v.VaultUserCache)))),this.factory.set(z.v.IsReadonlyVaultMember,(()=>new i.hEi(this.get(z.v.UserService),this.get(z.v.VaultUserCache)))),this.factory.set(z.v.DecryptBackupFile,(()=>new i.vV3(this.get(z.v.EncryptionService),this.get(z.v.KeySystemKeyManager),this.get(z.v.GetBackupFileType),this.get(z.v.DecryptBackupPayloads)))),this.factory.set(z.v.DiscardItemsLocally,(()=>new i.Ydb(this.get(z.v.ItemManager),this.get(z.v.DiskStorageService)))),this.factory.set(z.v.RemoveItemsFromMemory,(()=>new i.$sG(this.get(z.v.DiskStorageService),this.get(z.v.ItemManager),this.get(z.v.PayloadManager)))),this.factory.set(z.v.FindContact,(()=>new i.VD3(this.get(z.v.ItemManager)))),this.factory.set(z.v.DeleteContact,(()=>new i.z8s(this.get(z.v.MutatorService),this.get(z.v.SyncService),this.get(z.v.GetOwnedSharedVaults),this.get(z.v.ContactBelongsToVault)))),this.factory.set(z.v.EditContact,(()=>new i.ZQj(this.get(z.v.MutatorService)))),this.factory.set(z.v.GetAllContacts,(()=>new i.s$_(this.get(z.v.ItemManager)))),this.factory.set(z.v.ValidateItemSigner,(()=>new i.Lv2(this.get(z.v.FindContact)))),this.factory.set(z.v.CreateOrEditContact,(()=>new i.Dk4(this.get(z.v.MutatorService),this.get(z.v.FindContact),this.get(z.v.EditContact)))),this.factory.set(z.v.GetVault,(()=>new i.dDs(this.get(z.v.ItemManager)))),this.factory.set(z.v.GetVaults,(()=>new i.r0l(this.get(z.v.ItemManager)))),this.factory.set(z.v.SyncLocalVaultsWithRemoteSharedVaults,(()=>new i._Jh(this.get(z.v.SharedVaultServer),this.get(z.v.MutatorService)))),this.factory.set(z.v.ChangeAndSaveItem,(()=>new i.EdL(this.get(z.v.ItemManager),this.get(z.v.MutatorService),this.get(z.v.SyncService)))),this.factory.set(z.v.GetSharedVaults,(()=>new i.Tog(this.get(z.v.GetVaults)))),this.factory.set(z.v.GetOwnedSharedVaults,(()=>new i.tlz(this.get(z.v.GetSharedVaults),this.get(z.v.IsVaultOwner)))),this.factory.set(z.v.ContactBelongsToVault,(()=>new i.euo(this.get(z.v.GetVaultUsers)))),this.factory.set(z.v.ChangeVaultStorageMode,(()=>new i.KH1(this.get(z.v.MutatorService),this.get(z.v.SyncService),this.get(z.v.KeySystemKeyManager),this.get(z.v.GetVault)))),this.factory.set(z.v.ChangeVaultKeyOptions,(()=>new i.tuB(this.get(z.v.SyncService),this.get(z.v.RotateVaultKey),this.get(z.v.ChangeVaultStorageMode)))),this.factory.set(z.v.MoveItemsToVault,(()=>new i.cZu(this.get(z.v.MutatorService),this.get(z.v.SyncService),this.get(z.v.FileService)))),this.factory.set(z.v.CreateVault,(()=>new i.TQm(this.get(z.v.MutatorService),this.get(z.v.EncryptionService),this.get(z.v.KeySystemKeyManager),this.get(z.v.SyncService)))),this.factory.set(z.v.RemoveItemFromVault,(()=>new i.fF_(this.get(z.v.MutatorService),this.get(z.v.SyncService),this.get(z.v.FileService)))),this.factory.set(z.v.DeleteVault,(()=>new i.Rws(this.get(z.v.MutatorService),this.get(z.v.KeySystemKeyManager),this.get(z.v.GetVaultItems)))),this.factory.set(z.v.RotateVaultKey,(()=>new i.PqX(this.get(z.v.MutatorService),this.get(z.v.EncryptionService),this.get(z.v.KeySystemKeyManager),this.get(z.v.NotifyVaultUsersOfKeyRotation),this.get(z.v.IsVaultOwner)))),this.factory.set(z.v.ReuploadInvite,(()=>new i.afr(this.get(z.v.DecryptOwnMessage),this.get(z.v.SendVaultInvite),this.get(z.v.EncryptMessage)))),this.factory.set(z.v.ReuploadAllInvites,(()=>new i.F0Y(this.get(z.v.ReuploadInvite),this.get(z.v.FindContact),this.get(z.v.SharedVaultInvitesServer)))),this.factory.set(z.v.ResendAllMessages,(()=>new i.HLD(this.get(z.v.ResendMessage),this.get(z.v.DecryptOwnMessage),this.get(z.v.AsymmetricMessageServer),this.get(z.v.FindContact)))),this.factory.set(z.v.CreateSharedVault,(()=>new i.zEM(this.get(z.v.MutatorService),this.get(z.v.SharedVaultServer),this.get(z.v.CreateVault),this.get(z.v.MoveItemsToVault),this.get(z.v.GetVaultItems)))),this.factory.set(z.v.HandleKeyPairChange,(()=>new i.qjc(this.get(z.v.SelfContactManager),this.get(z.v.SharedVaultInvitesServer),this.get(z.v.AsymmetricMessageServer),this.get(z.v.ReuploadAllInvites),this.get(z.v.ResendAllMessages),this.get(z.v.GetAllContacts),this.get(z.v.SendOwnContactChangeMessage),this.get(z.v.CreateOrEditContact),this.get(z.v.Logger)))),this.factory.set(z.v.NotifyVaultUsersOfKeyRotation,(()=>new i.cVV(this.get(z.v.FindContact),this.get(z.v.SendVaultKeyChangedMessage),this.get(z.v.InviteToVault),this.get(z.v.SharedVaultInvitesServer),this.get(z.v.GetVaultContacts),this.get(z.v.DecryptOwnMessage),this.get(z.v.GetKeyPairs)))),this.factory.set(z.v.SendVaultKeyChangedMessage,(()=>new i.Foy(this.get(z.v.UserService),this.get(z.v.KeySystemKeyManager),this.get(z.v.EncryptMessage),this.get(z.v.FindContact),this.get(z.v.SendMessage),this.get(z.v.GetVaultUsers),this.get(z.v.GetKeyPairs)))),this.factory.set(z.v.SendVaultDataChangedMessage,(()=>new i.$SL(this.get(z.v.UserService),this.get(z.v.EncryptMessage),this.get(z.v.FindContact),this.get(z.v.GetVaultUsers),this.get(z.v.SendMessage),this.get(z.v.IsVaultOwner),this.get(z.v.GetKeyPairs)))),this.factory.set(z.v.ReplaceContactData,(()=>new i.xRL(this.get(z.v.MutatorService),this.get(z.v.SyncService),this.get(z.v.FindContact)))),this.factory.set(z.v.GetTrustedPayload,(()=>new i.pqE(this.get(z.v.DecryptMessage)))),this.factory.set(z.v.GetUntrustedPayload,(()=>new i.P9M(this.get(z.v.DecryptMessage)))),this.factory.set(z.v.GetVaultContacts,(()=>new i.bDv(this.get(z.v.FindContact),this.get(z.v.GetVaultUsers)))),this.factory.set(z.v.AcceptVaultInvite,(()=>new i.nmV(this.get(z.v.SharedVaultInvitesServer),this.get(z.v.ProcessAcceptedVaultInvite)))),this.factory.set(z.v.InviteToVault,(()=>new i.RAe(this.get(z.v.KeySystemKeyManager),this.get(z.v.EncryptMessage),this.get(z.v.SendVaultInvite),this.get(z.v.ShareContactWithVault),this.get(z.v.GetKeyPairs)))),this.factory.set(z.v.SendVaultInvite,(()=>new i.Iup(this.get(z.v.SharedVaultInvitesServer)))),this.factory.set(z.v.DeleteThirdPartyVault,(()=>new i.jGD(this.get(z.v.ItemManager),this.get(z.v.MutatorService),this.get(z.v.KeySystemKeyManager),this.get(z.v.SyncService),this.get(z.v.DiscardItemsLocally)))),this.factory.set(z.v.LeaveVault,(()=>new i.Z7G(this.get(z.v.UserService),this.get(z.v.SharedVaultUsersServer),this.get(z.v.ItemManager),this.get(z.v.DeleteThirdPartyVault)))),this.factory.set(z.v.ShareContactWithVault,(()=>new i.uLb(this.get(z.v.UserService),this.get(z.v.FindContact),this.get(z.v.EncryptMessage),this.get(z.v.SendMessage),this.get(z.v.GetVaultUsers),this.get(z.v.GetKeyPairs)))),this.factory.set(z.v.ConvertToSharedVault,(()=>new i.b$E(this.get(z.v.MutatorService),this.get(z.v.SharedVaultServer),this.get(z.v.MoveItemsToVault),this.get(z.v.GetVaultItems)))),this.factory.set(z.v.DeleteSharedVault,(()=>new i.KLn(this.get(z.v.SharedVaultServer),this.get(z.v.SyncService),this.get(z.v.DeleteVault)))),this.factory.set(z.v.RemoveVaultMember,(()=>new i.YxU(this.get(z.v.SharedVaultUsersServer)))),this.factory.set(z.v.DesignateSurvivor,(()=>new i.X2V(this.get(z.v.SharedVaultUsersServer)))),this.factory.set(z.v.GetVaultUsers,(()=>new i.PDt(this.get(z.v.SharedVaultUsersServer),this.get(z.v.VaultUserCache)))),this.factory.set(z.v.DecryptOwnMessage,(()=>new i.EQN(this.get(z.v.EncryptionOperators)))),this.factory.set(z.v.EncryptMessage,(()=>new i.S1n(this.get(z.v.EncryptionOperators)))),this.factory.set(z.v.DecryptMessage,(()=>new i.$M4(this.get(z.v.EncryptionOperators)))),this.factory.set(z.v.ResendMessage,(()=>new i.IF$(this.get(z.v.SendMessage),this.get(z.v.EncryptMessage)))),this.factory.set(z.v.SendMessage,(()=>new i.uzh(this.get(z.v.AsymmetricMessageServer)))),this.factory.set(z.v.ProcessAcceptedVaultInvite,(()=>new i.Klw(this.get(z.v.MutatorService),this.get(z.v.SyncService),this.get(z.v.CreateOrEditContact)))),this.factory.set(z.v.HandleRootKeyChangedMessage,(()=>new i.cjV(this.get(z.v.MutatorService),this.get(z.v.SyncService),this.get(z.v.GetVault),this.get(z.v.DecryptErroredPayloads)))),this.factory.set(z.v.SendOwnContactChangeMessage,(()=>new i.u3X(this.get(z.v.EncryptMessage),this.get(z.v.SendMessage)))),this.factory.set(z.v.GetOutboundMessages,(()=>new i.WUT(this.get(z.v.AsymmetricMessageServer)))),this.factory.set(z.v.GetInboundMessages,(()=>new i.Vxn(this.get(z.v.AsymmetricMessageServer)))),this.factory.set(z.v.CreateNewDefaultItemsKey,(()=>new i.Nwx(this.get(z.v.MutatorService),this.get(z.v.ItemManager),this.get(z.v.EncryptionOperators),this.get(z.v.RootKeyManager)))),this.factory.set(z.v.CreateNewItemsKeyWithRollback,(()=>new i.Yw(this.get(z.v.MutatorService),this.get(z.v.ItemManager),this.get(z.v.CreateNewDefaultItemsKey),this.get(z.v.DiscardItemsLocally),this.get(z.v.FindDefaultItemsKey)))),this.factory.set(z.v.FindDefaultItemsKey,(()=>new i.iPu)),this.factory.set(z.v.DecryptErroredTypeAPayloads,(()=>new i.suI(this.get(z.v.PayloadManager),this.get(z.v.DecryptTypeAPayloadWithKeyLookup)))),this.factory.set(z.v.DecryptTypeAPayload,(()=>new i.gzl(this.get(z.v.EncryptionOperators)))),this.factory.set(z.v.DecryptTypeAPayloadWithKeyLookup,(()=>new i.qXV(this.get(z.v.EncryptionOperators),this.get(z.v.KeySystemKeyManager),this.get(z.v.RootKeyManager),this.get(z.v.Logger)))),this.factory.set(z.v.EncryptTypeAPayload,(()=>new i.i6C(this.get(z.v.EncryptionOperators)))),this.factory.set(z.v.EncryptTypeAPayloadWithKeyLookup,(()=>new i.k6d(this.get(z.v.EncryptionOperators),this.get(z.v.KeySystemKeyManager),this.get(z.v.RootKeyManager))))}registerServiceMakers(){this.factory.set(z.v.Logger,(()=>new s.Logger(this.options.identifier))),this.factory.set(z.v.UserServer,(()=>new Y.UserServer(this.get(z.v.HttpService)))),this.factory.set(z.v.RootKeyManager,(()=>new i.wtP(this.get(z.v.DeviceInterface),this.get(z.v.DiskStorageService),this.get(z.v.EncryptionOperators),this.options.identifier,this.get(z.v.ReencryptTypeAItems),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.ItemsEncryptionService,(()=>new i.oQ4(this.get(z.v.ItemManager),this.get(z.v.PayloadManager),this.get(z.v.DiskStorageService),this.get(z.v.EncryptionOperators),this.get(z.v.KeySystemKeyManager),this.get(z.v.FindDefaultItemsKey),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.EncryptionOperators,(()=>new c.$l(this.get(z.v.Crypto)))),this.factory.set(z.v.SharedVaultInvitesServer,(()=>new Y.SharedVaultInvitesServer(this.get(z.v.HttpService)))),this.factory.set(z.v.SharedVaultServer,(()=>new Y.SharedVaultServer(this.get(z.v.HttpService)))),this.factory.set(z.v.AsymmetricMessageServer,(()=>new Y.AsymmetricMessageServer(this.get(z.v.HttpService)))),this.factory.set(z.v.SharedVaultUsersServer,(()=>new Y.SharedVaultUsersServer(this.get(z.v.HttpService)))),this.factory.set(z.v.VaultUserService,(()=>new i.igb(this.get(z.v.VaultService),this.get(z.v.VaultLockService),this.get(z.v.GetVaultUsers),this.get(z.v.RemoveVaultMember),this.get(z.v.IsVaultOwner),this.get(z.v.IsVaultAdmin),this.get(z.v.IsReadonlyVaultMember),this.get(z.v.GetVault),this.get(z.v.LeaveVault),this.get(z.v.DesignateSurvivor),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.VaultUserCache,(()=>new i.k7Z)),this.factory.set(z.v.VaultInviteService,(()=>new i.hZp(this.get(z.v.ItemManager),this.get(z.v.SessionManager),this.get(z.v.VaultUserService),this.get(z.v.SyncService),this.get(z.v.SharedVaultInvitesServer),this.get(z.v.StatusService),this.get(z.v.GetAllContacts),this.get(z.v.GetVault),this.get(z.v.GetVaultContacts),this.get(z.v.InviteToVault),this.get(z.v.GetTrustedPayload),this.get(z.v.GetUntrustedPayload),this.get(z.v.FindContact),this.get(z.v.AcceptVaultInvite),this.get(z.v.GetKeyPairs),this.get(z.v.DecryptErroredPayloads),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.AsymmetricMessageService,(()=>new i.WXh(this.get(z.v.EncryptionService),this.get(z.v.MutatorService),this.get(z.v.SessionManager),this.get(z.v.SyncService),this.get(z.v.AsymmetricMessageServer),this.get(z.v.CreateOrEditContact),this.get(z.v.FindContact),this.get(z.v.ReplaceContactData),this.get(z.v.GetTrustedPayload),this.get(z.v.GetVault),this.get(z.v.HandleRootKeyChangedMessage),this.get(z.v.GetOutboundMessages),this.get(z.v.GetInboundMessages),this.get(z.v.GetUntrustedPayload),this.get(z.v.GetKeyPairs),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.SharedVaultService,(()=>new i.cnh(this.get(z.v.ItemManager),this.get(z.v.SessionManager),this.get(z.v.VaultUserService),this.get(z.v.SyncLocalVaultsWithRemoteSharedVaults),this.get(z.v.GetVault),this.get(z.v.GetOwnedSharedVaults),this.get(z.v.CreateSharedVault),this.get(z.v.HandleKeyPairChange),this.get(z.v.FindContact),this.get(z.v.DeleteThirdPartyVault),this.get(z.v.ShareContactWithVault),this.get(z.v.ConvertToSharedVault),this.get(z.v.DeleteSharedVault),this.get(z.v.DiscardItemsLocally),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.VaultLockService,(()=>new i.PHC(this.get(z.v.ItemManager),this.get(z.v.EncryptionService),this.get(z.v.KeySystemKeyManager),this.get(z.v.GetVaults),this.get(z.v.DecryptErroredPayloads),this.get(z.v.RemoveItemsFromMemory),this.get(z.v.GetVaultItems),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.VaultService,(()=>new i.RDE(this.get(z.v.SyncService),this.get(z.v.ItemManager),this.get(z.v.MutatorService),this.get(z.v.VaultLockService),this.get(z.v.AlertService),this.get(z.v.GetVault),this.get(z.v.GetVaults),this.get(z.v.ChangeVaultKeyOptions),this.get(z.v.MoveItemsToVault),this.get(z.v.CreateVault),this.get(z.v.RemoveItemFromVault),this.get(z.v.DeleteVault),this.get(z.v.RotateVaultKey),this.get(z.v.SendVaultDataChangedMessage),this.get(z.v.IsVaultOwner),this.get(z.v.ValidateVaultPassword),this.get(z.v.AuthorizeVaultDeletion),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.SelfContactManager,(()=>new i.Ld1(this.get(z.v.SyncService),this.get(z.v.ItemManager),this.get(z.v.SessionManager),this.get(z.v.SingletonManager)))),this.factory.set(z.v.ContactService,(()=>new i.yqc(this.get(z.v.SyncService),this.get(z.v.MutatorService),this.get(z.v.SessionManager),this.get(z.v.Crypto),this.get(z.v.UserService),this.get(z.v.SelfContactManager),this.get(z.v.EncryptionService),this.get(z.v.DeleteContact),this.get(z.v.FindContact),this.get(z.v.GetAllContacts),this.get(z.v.CreateOrEditContact),this.get(z.v.EditContact),this.get(z.v.ValidateItemSigner),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.SignInWithRecoveryCodes,(()=>new w.Y(this.get(z.v.AuthManager),this.get(z.v.EncryptionService),this.get(z.v.InMemoryStore),this.get(z.v.Crypto),this.get(z.v.SessionManager),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.GetRecoveryCodes,(()=>new b.u(this.get(z.v.AuthManager),this.get(z.v.SettingsService)))),this.factory.set(z.v.AddAuthenticator,(()=>new A.f(this.get(z.v.AuthenticatorManager),this.options.u2fAuthenticatorRegistrationPromptFunction))),this.factory.set(z.v.ListAuthenticators,(()=>new v.F(this.get(z.v.AuthenticatorManager)))),this.factory.set(z.v.DeleteAuthenticator,(()=>new y.c(this.get(z.v.AuthenticatorManager)))),this.factory.set(z.v.GetAuthenticatorAuthenticationOptions,(()=>new m.V(this.get(z.v.AuthenticatorManager)))),this.factory.set(z.v.GetAuthenticatorAuthenticationResponse,(()=>new g.F(this.get(z.v.GetAuthenticatorAuthenticationOptions),this.options.u2fAuthenticatorVerificationPromptFunction))),this.factory.set(z.v.ListRevisions,(()=>new f.G(this.get(z.v.RevisionManager)))),this.factory.set(z.v.GetRevision,(()=>new p.X(this.get(z.v.RevisionManager),this.get(z.v.EncryptionService)))),this.factory.set(z.v.DeleteRevision,(()=>new h.g(this.get(z.v.RevisionManager)))),this.factory.set(z.v.RevisionServer,(()=>new Y.RevisionServer(this.get(z.v.HttpService)))),this.factory.set(z.v.RevisionApiService,(()=>new Y.RevisionApiService(this.get(z.v.RevisionServer)))),this.factory.set(z.v.RevisionManager,(()=>new i.t9U(this.get(z.v.RevisionApiService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.AuthServer,(()=>new Y.AuthServer(this.get(z.v.HttpService)))),this.factory.set(z.v.AuthApiService,(()=>new Y.AuthApiService(this.get(z.v.AuthServer),this.options.apiVersion))),this.factory.set(z.v.AuthManager,(()=>new i.El(this.get(z.v.AuthApiService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.AuthenticatorServer,(()=>new Y.AuthenticatorServer(this.get(z.v.HttpService)))),this.factory.set(z.v.AuthenticatorApiService,(()=>new Y.AuthenticatorApiService(this.get(z.v.AuthenticatorServer)))),this.factory.set(z.v.AuthenticatorManager,(()=>new i.F8w(this.get(z.v.AuthenticatorApiService),this.get(z.v.PreferencesService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.ActionsService,(()=>new d.b(this.get(z.v.ItemManager),this.get(z.v.AlertService),this.get(z.v.DeviceInterface),this.get(z.v.DeprecatedHttpService),this.get(z.v.EncryptionService),this.get(z.v.ChallengeService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.ListedService,(()=>new S.o(this.get(z.v.LegacyApiService),this.get(z.v.ItemManager),this.get(z.v.SettingsService),this.get(z.v.DeprecatedHttpService),this.get(z.v.ProtectionService),this.get(z.v.MutatorService),this.get(z.v.SyncService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.IntegrityService,(()=>new i.yim(this.get(z.v.LegacyApiService),this.get(z.v.LegacyApiService),this.get(z.v.PayloadManager),this.get(z.v.Logger),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.FileService,(()=>new i.IpN(this.get(z.v.LegacyApiService),this.get(z.v.MutatorService),this.get(z.v.SyncService),this.get(z.v.EncryptionService),this.get(z.v.ChallengeService),this.get(z.v.HttpService),this.get(z.v.AlertService),this.get(z.v.Crypto),this.get(z.v.InternalEventBus),this.get(z.v.Logger),this.get(z.v.FilesBackupService)))),this.factory.set(z.v.MigrationService,(()=>new C.H({encryptionService:this.get(z.v.EncryptionService),deviceInterface:this.get(z.v.DeviceInterface),storageService:this.get(z.v.DiskStorageService),sessionManager:this.get(z.v.SessionManager),challengeService:this.get(z.v.ChallengeService),itemManager:this.get(z.v.ItemManager),mutator:this.get(z.v.MutatorService),singletonManager:this.get(z.v.SingletonManager),featuresService:this.get(z.v.FeaturesService),environment:this.options.environment,platform:this.options.platform,identifier:this.options.identifier,internalEventBus:this.get(z.v.InternalEventBus),legacySessionStorageMapper:this.get(z.v.LegacySessionStorageMapper),backups:this.get(z.v.FilesBackupService),preferences:this.get(z.v.PreferencesService)}))),this.factory.set(z.v.HomeServerService,(()=>{if((0,i.dse)(this.get(z.v.DeviceInterface)))return new i.tGH(this.get(z.v.DeviceInterface),this.options.platform,this.get(z.v.InternalEventBus))})),this.factory.set(z.v.FilesBackupService,(()=>{if((0,i.dse)(this.get(z.v.DeviceInterface)))return new i.exs(this.get(z.v.ItemManager),this.get(z.v.LegacyApiService),this.get(z.v.EncryptionService),this.get(z.v.DeviceInterface),this.get(z.v.StatusService),this.get(z.v.Crypto),this.get(z.v.DiskStorageService),this.get(z.v.SessionManager),this.get(z.v.PayloadManager),this.get(z.v.HistoryManager),this.get(z.v.DeviceInterface),this.get(z.v.InternalEventBus))})),this.factory.set(z.v.StatusService,(()=>new i.Bjn(this.get(z.v.InternalEventBus)))),this.factory.set(z.v.MfaService,(()=>new E.p(this.get(z.v.SettingsService),this.get(z.v.Crypto),this.get(z.v.FeaturesService),this.get(z.v.ProtectionService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.ComponentManager,(()=>new I.y(this.get(z.v.ItemManager),this.get(z.v.MutatorService),this.get(z.v.SyncService),this.get(z.v.FeaturesService),this.get(z.v.PreferencesService),this.get(z.v.AlertService),this.options.environment,this.options.platform,this.get(z.v.DeviceInterface),this.get(z.v.Logger),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.FeaturesService,(()=>new _.k(this.get(z.v.DiskStorageService),this.get(z.v.ItemManager),this.get(z.v.MutatorService),this.get(z.v.SubscriptionManager),this.get(z.v.LegacyApiService),this.get(z.v.WebSocketsService),this.get(z.v.SettingsService),this.get(z.v.UserService),this.get(z.v.SyncService),this.get(z.v.AlertService),this.get(z.v.SessionManager),this.get(z.v.Crypto),this.get(z.v.Logger),this.get(z.v.IsApplicationUsingThirdPartyHost),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.SettingsService,(()=>new x.g(this.get(z.v.SessionManager),this.get(z.v.LegacyApiService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.PreferencesService,(()=>new P.y(this.get(z.v.SingletonManager),this.get(z.v.ItemManager),this.get(z.v.MutatorService),this.get(z.v.SyncService),this.get(z.v.DiskStorageService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.SingletonManager,(()=>new k.W(this.get(z.v.ItemManager),this.get(z.v.MutatorService),this.get(z.v.PayloadManager),this.get(z.v.SyncService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.KeyRecoveryService,(()=>new B.D(this.get(z.v.ItemManager),this.get(z.v.PayloadManager),this.get(z.v.LegacyApiService),this.get(z.v.EncryptionService),this.get(z.v.ChallengeService),this.get(z.v.AlertService),this.get(z.v.DiskStorageService),this.get(z.v.SyncService),this.get(z.v.UserService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.UserService,(()=>new i.KDu(this.get(z.v.SessionManager),this.get(z.v.SyncService),this.get(z.v.DiskStorageService),this.get(z.v.ItemManager),this.get(z.v.EncryptionService),this.get(z.v.AlertService),this.get(z.v.ChallengeService),this.get(z.v.ProtectionService),this.get(z.v.UserApiService),this.get(z.v.ReencryptTypeAItems),this.get(z.v.DecryptErroredPayloads),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.ProtectionService,(()=>new O.n(this.get(z.v.EncryptionService),this.get(z.v.MutatorService),this.get(z.v.ChallengeService),this.get(z.v.DiskStorageService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.WebSocketsService,(()=>new i.BV4(this.get(z.v.DiskStorageService),this.options.webSocketUrl,this.get(z.v.WebSocketApiService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.SyncFrequencyGuard,(()=>{var e;return new Z(null!==(e=this.options.syncCallsThresholdPerMinute)&&void 0!==e?e:this.DEFAULT_SYNC_CALLS_THRESHOLD_PER_MINUTE)})),this.factory.set(z.v.SyncBackoffService,(()=>new i.XEg)),this.factory.set(z.v.SyncService,(()=>new N._(this.get(z.v.ItemManager),this.get(z.v.SessionManager),this.get(z.v.EncryptionService),this.get(z.v.DiskStorageService),this.get(z.v.PayloadManager),this.get(z.v.LegacyApiService),this.get(z.v.HistoryManager),this.get(z.v.DeviceInterface),this.options.identifier,{loadBatchSize:this.options.loadBatchSize,sleepBetweenBatches:this.options.sleepBetweenBatches},this.get(z.v.Logger),this.get(z.v.WebSocketsService),this.get(z.v.SyncFrequencyGuard),this.get(z.v.SyncBackoffService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.HistoryManager,(()=>new D.E(this.get(z.v.ItemManager),this.get(z.v.DiskStorageService),this.get(z.v.DeviceInterface),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.SubscriptionManager,(()=>new i.LF2(this.get(z.v.SubscriptionApiService),this.get(z.v.SessionManager),this.get(z.v.DiskStorageService),this.get(z.v.IsApplicationUsingThirdPartyHost),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.SessionManager,(()=>new j.Sj(this.get(z.v.DiskStorageService),this.get(z.v.LegacyApiService),this.get(z.v.UserApiService),this.get(z.v.AlertService),this.get(z.v.EncryptionService),this.get(z.v.Crypto),this.get(z.v.ChallengeService),this.get(z.v.WebSocketsService),this.get(z.v.HttpService),this.get(z.v.SessionStorageMapper),this.get(z.v.LegacySessionStorageMapper),this.options.identifier,this.get(z.v.GetKeyPairs),this.get(z.v.IsApplicationUsingThirdPartyHost),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.WebSocketApiService,(()=>new Y.WebSocketApiService(this.get(z.v.WebSocketServer)))),this.factory.set(z.v.WebSocketServer,(()=>new Y.WebSocketServer(this.get(z.v.HttpService)))),this.factory.set(z.v.SubscriptionApiService,(()=>new Y.SubscriptionApiService(this.get(z.v.SubscriptionServer),this.options.apiVersion))),this.factory.set(z.v.UserApiService,(()=>new Y.UserApiService(this.get(z.v.UserServer),this.get(z.v.UserRequestServer),this.options.apiVersion))),this.factory.set(z.v.SubscriptionServer,(()=>new Y.SubscriptionServer(this.get(z.v.HttpService)))),this.factory.set(z.v.UserRequestServer,(()=>new Y.UserRequestServer(this.get(z.v.HttpService)))),this.factory.set(z.v.InternalEventBus,(()=>new i.Ehg)),this.factory.set(z.v.PayloadManager,(()=>new V.O(this.get(z.v.Logger),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.ItemManager,(()=>new U.A(this.get(z.v.PayloadManager),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.MutatorService,(()=>new Q.V(this.get(z.v.ItemManager),this.get(z.v.PayloadManager),this.get(z.v.AlertService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.DiskStorageService,(()=>new L.e(this.get(z.v.DeviceInterface),this.options.identifier,this.get(z.v.InternalEventBus)))),this.factory.set(z.v.NotificationService,(()=>new i.gqp(this.get(z.v.InternalEventBus)))),this.factory.set(z.v.InMemoryStore,(()=>new i.CEH)),this.factory.set(z.v.KeySystemKeyManager,(()=>new i.Pn4(this.get(z.v.ItemManager),this.get(z.v.MutatorService),this.get(z.v.DiskStorageService),this.get(z.v.RemoveItemsFromMemory),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.ChallengeService,(()=>new R.P(this.get(z.v.DiskStorageService),this.get(z.v.EncryptionService),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.EncryptionService,(()=>new i.C6q(this.get(z.v.ItemManager),this.get(z.v.MutatorService),this.get(z.v.PayloadManager),this.get(z.v.EncryptionOperators),this.get(z.v.ItemsEncryptionService),this.get(z.v.RootKeyManager),this.get(z.v.Crypto),this.get(z.v.CreateNewItemsKeyWithRollback),this.get(z.v.FindDefaultItemsKey),this.get(z.v.EncryptTypeAPayloadWithKeyLookup),this.get(z.v.EncryptTypeAPayload),this.get(z.v.DecryptTypeAPayload),this.get(z.v.DecryptTypeAPayloadWithKeyLookup),this.get(z.v.CreateNewDefaultItemsKey),this.get(z.v.GetKeyPairs),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.DeprecatedHttpService,(()=>new F.q(this.options.environment,this.options.appVersion,this.get(z.v.InternalEventBus)))),this.factory.set(z.v.HttpService,(()=>new Y.HttpService(this.options.environment,this.options.appVersion,M.in,this.options.apiVersion,this.get(z.v.Logger)))),this.factory.set(z.v.LegacyApiService,(()=>new T.A(this.get(z.v.HttpService),this.get(z.v.DiskStorageService),this.options.defaultHost,this.get(z.v.InMemoryStore),this.get(z.v.Crypto),this.get(z.v.SessionStorageMapper),this.get(z.v.LegacySessionStorageMapper),this.get(z.v.InternalEventBus)))),this.factory.set(z.v.SessionStorageMapper,(()=>new G)),this.factory.set(z.v.LegacySessionStorageMapper,(()=>new H))}}var q=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class J{constructor(e){this.ephemeralIdentifier=(0,s.nonSecureRandomIdentifier)(),this.eventHandlers=[],this.serviceObservers=[],this.managedSubscribers=[],this.createdNewDatabase=!1,this.started=!1,this.launched=!1,this.dealloced=!1,this.revokingSession=!1,this.handledFullSyncStage=!1;const t=Object.assign(Object.assign({},i.U3K),e);if(!u.W.onLog)throw Error("SNLog.onLog must be set.");if(!u.W.onError)throw Error("SNLog.onError must be set.");const n=["deviceInterface","environment","platform","crypto","alertService","identifier","defaultHost","appVersion","apiVersion"];for(const e of n)if(!t[e])throw Error("".concat(e," must be supplied when creating an application."));var r,o;this.environment=e.environment,this.platform=e.platform,this.identifier=e.identifier,this.options=Object.freeze(t),this.dependencies=new W(this.options),this.dependencies.get(z.v.Logger).setLevel("error"),this.registerServiceObservers(),r=this.dependencies,(o=this.events).addEventHandler(r.get(z.v.AsymmetricMessageService),i.wMo.ReceivedAsymmetricMessages),o.addEventHandler(r.get(z.v.AsymmetricMessageService),i.fAX.MessageSentToUser),o.addEventHandler(r.get(z.v.DiskStorageService),i.n9K.ApplicationStageChanged),o.addEventHandler(r.get(z.v.FeaturesService),i.Sf$.MetaReceived),o.addEventHandler(r.get(z.v.FeaturesService),i.n9K.ApplicationStageChanged),o.addEventHandler(r.get(z.v.IntegrityService),i.wMo.SyncRequestsIntegrityCheck),o.addEventHandler(r.get(z.v.KeyRecoveryService),i.n9K.ApplicationStageChanged),o.addEventHandler(r.get(z.v.KeySystemKeyManager),i.n9K.ApplicationStageChanged),o.addEventHandler(r.get(z.v.MigrationService),i.n9K.ApplicationStageChanged),o.addEventHandler(r.get(z.v.NotificationService),i.wMo.ReceivedNotifications),o.addEventHandler(r.get(z.v.NotificationService),i.fAX.NotificationAddedForUser),o.addEventHandler(r.get(z.v.PreferencesService),i.n9K.ApplicationStageChanged),o.addEventHandler(r.get(z.v.ProtectionService),i.n9K.ApplicationStageChanged),o.addEventHandler(r.get(z.v.ProtectionService),i.n9K.Started),o.addEventHandler(r.get(z.v.SelfContactManager),i.n9K.ApplicationStageChanged),o.addEventHandler(r.get(z.v.SessionManager),i.Sf$.SessionRefreshed),o.addEventHandler(r.get(z.v.SessionManager),i.n9K.ApplicationStageChanged),o.addEventHandler(r.get(z.v.SharedVaultService),i.JQe.NotificationReceived),o.addEventHandler(r.get(z.v.VaultInviteService),i.JQe.NotificationReceived),o.addEventHandler(r.get(z.v.SharedVaultService),i.Pxr.UserKeyPairChanged),o.addEventHandler(r.get(z.v.SharedVaultService),i.wMo.ReceivedRemoteSharedVaults),o.addEventHandler(r.get(z.v.SubscriptionManager),i.n9K.ApplicationStageChanged),o.addEventHandler(r.get(z.v.SubscriptionManager),i.n9K.Launched),o.addEventHandler(r.get(z.v.SubscriptionManager),i.n9K.SignedIn),o.addEventHandler(r.get(z.v.SubscriptionManager),i.n9K.UserRolesChanged),o.addEventHandler(r.get(z.v.SubscriptionManager),i.Pxr.Restored),o.addEventHandler(r.get(z.v.SyncService),i.ezr.IntegrityCheckCompleted),o.addEventHandler(r.get(z.v.SyncService),i.fAX.ItemsChangedOnServer),o.addEventHandler(r.get(z.v.UserService),i.oF7.SignedInOrRegistered),o.addEventHandler(r.get(z.v.VaultInviteService),i.n9K.Launched),o.addEventHandler(r.get(z.v.VaultInviteService),i.wMo.ReceivedSharedVaultInvites),o.addEventHandler(r.get(z.v.VaultInviteService),i.fAX.UserInvitedToSharedVault),r.get(z.v.FilesBackupService)&&o.addEventHandler(r.get(z.v.FilesBackupService),i.n9K.ApplicationStageChanged),r.get(z.v.HomeServerService)&&o.addEventHandler(r.get(z.v.HomeServerService),i.n9K.ApplicationStageChanged)}registerServiceObservers(){const e=this.dependencies.get(z.v.EncryptionService);this.serviceObservers.push(e.addEventObserver((e=>q(this,void 0,void 0,(function*(){e===i.fa_.RootKeyStatusChanged&&(yield this.notifyEvent(i.n9K.KeyStatusChanged))}))))),this.dependencies.get(z.v.DiskStorageService).provideEncryptionProvider(e);const t=this.dependencies.get(z.v.LegacyApiService);this.dependencies.get(z.v.HttpService).setCallbacks(t.processMetaObject.bind(t),t.setSession.bind(t)),this.serviceObservers.push(this.dependencies.get(z.v.SessionManager).addEventObserver((t=>q(this,void 0,void 0,(function*(){switch(t){case i.Pxr.Restored:(()=>{q(this,void 0,void 0,(function*(){yield this.sync.sync({sourceDescription:"Session restored pre key creation"}),e.needsNewRootKeyBasedItemsKey()&&e.createNewDefaultItemsKey().then((()=>{this.sync.sync({sourceDescription:"Session restored post key creation"})}))}))})();break;case i.Pxr.Revoked:yield this.handleRevokedSession();break;case i.Pxr.UserKeyPairChanged:break;default:(0,s.assertUnreachable)(t)}})))));const n=this.dependencies.get(z.v.SyncService).addEventObserver(((t,n)=>q(this,void 0,void 0,(function*(){const r=l(t);r&&(yield e.onSyncEvent(t),yield this.notifyEvent(r,n),r===i.n9K.CompletedFullSync&&(this.handledFullSyncStage||(this.handledFullSyncStage=!0,yield this.handleStage(i.Ugm.FullSyncCompleted_13))))}))));this.serviceObservers.push(n);const r=this.dependencies.get(z.v.ProtectionService);this.serviceObservers.push(r.addEventObserver((e=>{e===i.Hh3.UnprotectedSessionBegan?this.notifyEvent(i.n9K.UnprotectedSessionBegan):e===i.Hh3.UnprotectedSessionExpired&&this.notifyEvent(i.n9K.UnprotectedSessionExpired)})));const o=this.dependencies.get(z.v.UserService);this.serviceObservers.push(o.addEventObserver(((e,t)=>q(this,void 0,void 0,(function*(){switch(e){case i.oF7.SignedInOrRegistered:this.notifyEvent(i.n9K.SignedIn);break;case i.oF7.SignedOut:yield this.notifyEvent(i.n9K.SignedOut),yield this.prepareForDeinit(),this.deinit(this.getDeinitMode(),(null==t?void 0:t.payload.source)||i.u4P.SignOut);break;default:(0,s.assertUnreachable)(e)}})))));const a=this.dependencies.get(z.v.PreferencesService);this.serviceObservers.push(a.addEventObserver((e=>{e===i.WZd.PreferencesChanged?this.notifyEvent(i.n9K.PreferencesChanged):e===i.WZd.LocalPreferencesChanged&&this.notifyEvent(i.n9K.LocalPreferencesChanged)})));const c=this.dependencies.get(z.v.FeaturesService);this.serviceObservers.push(c.addEventObserver((e=>{switch(e){case i.Usi.UserRolesChanged:this.notifyEvent(i.n9K.UserRolesChanged);break;case i.Usi.FeaturesAvailabilityChanged:this.notifyEvent(i.n9K.FeaturesAvailabilityChanged);break;case i.Usi.DidPurchaseSubscription:this.notifyEvent(i.n9K.DidPurchaseSubscription);break;default:(0,s.assertUnreachable)(e)}})))}computePrivateUsername(e){return(0,c.lx)(this.options.crypto,e)}prepareForLaunch(e){return q(this,void 0,void 0,(function*(){if(this.launched)throw new Error("Attempting to prelaunch already launched application");yield this.options.crypto.initialize(),this.setLaunchCallback(e);const t=yield this.device.openDatabase(this.identifier).catch((e=>{this.notifyEvent(i.n9K.LocalDatabaseReadError,e)}));this.createdNewDatabase=(0,s.useBoolean)(null==t?void 0:t.isNewDatabase,!1),yield this.migrations.initialize(),yield this.notifyEvent(i.n9K.MigrationsLoaded),yield this.handleStage(i.Ugm.PreparingForLaunch_0),yield this.storage.initializeFromDisk(),yield this.notifyEvent(i.n9K.StorageReady),yield this.encryption.initialize(),yield this.handleStage(i.Ugm.ReadyForLaunch_05),this.started=!0,yield this.notifyEvent(i.n9K.Started)}))}setLaunchCallback(e){this.challenges.sendChallenge=e.receiveChallenge}launch(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return q(this,void 0,void 0,(function*(){if(this.launched)throw new Error("Attempting to launch already launched application");this.launched=!1;const t=this.getLaunchChallenge();if(t){const e=yield this.challenges.promptForChallengeResponse(t);if(!e)throw Error("Launch challenge was cancelled.");yield this.handleLaunchChallengeResponse(e)}if(this.storage.isStorageWrapped())try{yield this.storage.decryptStorage()}catch(e){this.alerts.alert(i.kov.StorageDecryptErrorBody,i.kov.StorageDecryptErrorTitle)}yield this.handleStage(i.Ugm.StorageDecrypted_09);const n=this.legacyApi.loadHost();this.http.setHost(n),this.sockets.loadWebSocketUrl(),this.settings.initializeFromDisk(),this.launched=!0,yield this.notifyEvent(i.n9K.Launched),yield this.handleStage(i.Ugm.Launched_10),yield this.handleStage(i.Ugm.LoadingDatabase_11),this.createdNewDatabase&&(yield this.sync.onNewDatabaseCreated());const r=this.sync.loadDatabasePayloads().then((()=>q(this,void 0,void 0,(function*(){if(this.dealloced)throw"Application has been destroyed.";yield this.handleStage(i.Ugm.LoadedDatabase_12),this.sync.beginAutoSyncTimer(),yield this.sync.sync({mode:i.YCg.DownloadFirst,source:i.Lbd.External,sourceDescription:"Application Launch"}),this.vaultUsers.invalidateVaultUsersCache().catch(console.error)})))).catch((e=>{throw this.notifyEvent(i.n9K.LocalDatabaseReadError,e),e}));e&&(yield r)}))}onStart(){}onLaunch(){}getLaunchChallenge(){return this.protections.createLaunchChallenge()}handleLaunchChallengeResponse(e){var t;return q(this,void 0,void 0,(function*(){if(e.challenge.hasPromptForValidationType(i.tQn.LocalPasscode)){let n=null===(t=e.artifacts)||void 0===t?void 0:t.wrappingKey;if(!n){const t=e.getValueForType(i.tQn.LocalPasscode);n=yield this.encryption.computeWrappingKey(t.value)}yield this.encryption.unwrapRootKey(n)}}))}handleStage(e){return q(this,void 0,void 0,(function*(){yield this.events.publishSync({type:i.n9K.ApplicationStageChanged,payload:{stage:e}},i.WNP.SEQUENCE)}))}addEventObserver(e,t){const n={callback:e,singleEvent:t};return this.eventHandlers.push(n),()=>{(0,s.removeFromArray)(this.eventHandlers,n)}}addSingleEventObserver(e,t){return this.addEventObserver((n=>q(this,void 0,void 0,(function*(){n===e&&t(e)}))),e)}notifyEvent(e,t){return q(this,void 0,void 0,(function*(){e===i.n9K.Started?this.onStart():e===i.n9K.Launched&&this.onLaunch();for(const n of this.eventHandlers.slice())(n.singleEvent&&n.singleEvent===e||!n.singleEvent)&&(yield n.callback(e,t||{}));this.events.publish({type:e,payload:t}),this.migrations.handleApplicationEvent(e)}))}getSessions(){return this.sessions.getSessionsList()}revokeSession(e){return q(this,void 0,void 0,(function*(){if(yield this.protections.authorizeSessionRevoking())return this.sessions.revokeSession(e)}))}revokeAllOtherSessions(){return q(this,void 0,void 0,(function*(){return this.sessions.revokeAllOtherSessions()}))}userCanManageSessions(){const e=this.getUserVersion();return!(0,s.isNullOrUndefined)(e)&&(0,r.compareVersions)(e,r.ProtocolVersion.V004)>=0}setCustomHost(e,t){return q(this,void 0,void 0,(function*(){yield this.setHost.execute(e),this.sockets.setWebSocketUrl(t)}))}getUserPasswordCreationDate(){return this.encryption.getPasswordCreatedDate()}getProtocolEncryptionDisplayName(){return this.encryption.getEncryptionDisplayName()}getUserVersion(){return this.encryption.getUserVersion()}protocolUpgradeAvailable(){return this.encryption.upgradeAvailable()}isEncryptionAvailable(){return this.hasAccount()||this.hasPasscode()}upgradeProtocolVersion(){return q(this,void 0,void 0,(function*(){const e=yield this.user.performProtocolUpgrade();return e.success?this.hasAccount()?this.alerts.alert(i.GUt.SuccessAccount):this.alerts.alert(i.GUt.SuccessPasscodeOnly):e.error&&this.alerts.alert(i.GUt.Fail),e}))}hasAccount(){return this.encryption.hasAccount()}hasProtectionSources(){return this.protections.hasProtectionSources()}getProtectionSessionExpiryDate(){return this.protections.getSessionExpiryDate()}clearProtectionSession(){return this.protections.clearSession()}authorizeProtectedActionForNotes(e,t){return q(this,void 0,void 0,(function*(){return yield this.protections.authorizeProtectedActionForItems(e,t)}))}authorizeNoteAccess(e){return this.protections.authorizeItemAccess(e)}authorizeAutolockIntervalChange(){return this.protections.authorizeAutolockIntervalChange()}isEphemeralSession(){return this.storage.isEphemeralSession()}setValue(e,t,n){return this.storage.setValue(e,t,n)}getValue(e,t){return this.storage.getValue(e,t)}removeValue(e,t){return q(this,void 0,void 0,(function*(){return this.storage.removeValue(e,t)}))}getPreference(e,t){return this.preferences.getValue(e,t)}setPreference(e,t){return q(this,void 0,void 0,(function*(){return this.preferences.setValue(e,t)}))}prepareForDeinit(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return q(this,void 0,void 0,(function*(){const t=this.dependencies.getAll().filter(s.canBlockDeinit),n=Promise.all(t.map((e=>e.blockDeinit())));0===e?yield n:yield Promise.race([n,(0,s.sleep)(e,!1,"Preparing for deinit...")])}))}addChallengeObserver(e,t){return this.challenges.addChallengeObserver(e,t)}submitValuesForChallenge(e,t){return this.challenges.submitValuesForChallenge(e,t)}cancelChallenge(e){this.challenges.cancelChallenge(e)}setOnDeinit(e){this.onDeinit=e}deinit(e,t){var n;this.dealloced=!0;for(const e of this.serviceObservers)e();for(const e of this.managedSubscribers)e();this.options.crypto.deinit(),this.options=void 0,this.createdNewDatabase=!1,this.serviceObservers.length=0,this.managedSubscribers.length=0,this.started=!1,this.dependencies.deinit(),null===(n=this.onDeinit)||void 0===n||n.call(this,this,e,t),this.onDeinit=void 0}register(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return q(this,void 0,void 0,(function*(){return this.user.register(e,t,n,r,i)}))}signIn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6?arguments[6]:void 0;return q(this,void 0,void 0,(function*(){return this.user.signIn(e,t,n,r,i,o,s)}))}getCaptchaUrl(){return q(this,void 0,void 0,(function*(){return this.legacyApi.getCaptchaUrl()}))}changeEmail(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r.KeyParamsOrigination.EmailChange;return q(this,void 0,void 0,(function*(){return this.user.changeCredentials({currentPassword:t,newEmail:e,passcode:n,origination:i,validateNewPasswordStrength:!1})}))}changePassword(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r.KeyParamsOrigination.PasswordChange,o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return q(this,void 0,void 0,(function*(){return this.user.changeCredentials({currentPassword:e,newPassword:t,passcode:n,origination:i,validateNewPasswordStrength:o})}))}importData(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return q(this,void 0,void 0,(function*(){return this.dependencies.get(z.v.ImportData).execute(e,t)}))}handleRevokedSession(){return q(this,void 0,void 0,(function*(){if(this.revokingSession)return;this.revokingSession=!0;const e=this.alerts;yield this.user.signOut(!0),e.alert(i.K9E.CurrentSessionRevoked)}))}validateAccountPassword(e){return q(this,void 0,void 0,(function*(){const{valid:t}=yield this.encryption.validateAccountPassword(e);return t}))}isStarted(){return this.started}isLaunched(){return this.launched}hasPasscode(){return this.encryption.hasPasscode()}lock(){return q(this,void 0,void 0,(function*(){return yield this.prepareForDeinit(500),this.deinit(this.getDeinitMode(),i.u4P.Lock)}))}isNativeMobileWeb(){return this.environment===o.Environment.Mobile}getDeinitMode(){return"hard"===this.getValue(i.QtK.DeinitMode)?i.CYv.Hard:i.CYv.Soft}addPasscode(e){return this.user.addPasscode(e)}removePasscode(){return q(this,void 0,void 0,(function*(){return this.user.removePasscode()}))}changePasscode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.KeyParamsOrigination.PasscodeChange;return q(this,void 0,void 0,(function*(){return this.user.changePasscode(e,t)}))}enableEphemeralPersistencePolicy(){return this.storage.setPersistencePolicy(i.eIN.Ephemeral)}hasPendingMigrations(){return this.migrations.hasPendingMigrations()}presentKeyRecoveryWizard(){return this.dependencies.get(z.v.KeyRecoveryService).presentKeyRecoveryWizard()}canAttemptDecryptionOfItem(e){return this.dependencies.get(z.v.KeyRecoveryService).canAttemptDecryptionOfItem(e)}isUsingHomeServer(){return q(this,void 0,void 0,(function*(){const e=this.dependencies.get(z.v.HomeServerService);return!!e&&this.getHost.execute().getValue()===(yield e.getHomeServerUrl())}))}get device(){return this.dependencies.get(z.v.DeviceInterface)}get subscriptions(){return this.dependencies.get(z.v.SubscriptionManager)}get signInWithRecoveryCodes(){return this.dependencies.get(z.v.SignInWithRecoveryCodes)}get getRecoveryCodes(){return this.dependencies.get(z.v.GetRecoveryCodes)}get addAuthenticator(){return this.dependencies.get(z.v.AddAuthenticator)}get listAuthenticators(){return this.dependencies.get(z.v.ListAuthenticators)}get deleteAuthenticator(){return this.dependencies.get(z.v.DeleteAuthenticator)}get getAuthenticatorAuthenticationOptions(){return this.dependencies.get(z.v.GetAuthenticatorAuthenticationOptions)}get getAuthenticatorAuthenticationResponse(){return this.dependencies.get(z.v.GetAuthenticatorAuthenticationResponse)}get listRevisions(){return this.dependencies.get(z.v.ListRevisions)}get getRevision(){return this.dependencies.get(z.v.GetRevision)}get deleteRevision(){return this.dependencies.get(z.v.DeleteRevision)}get files(){return this.dependencies.get(z.v.FileService)}get features(){return this.dependencies.get(z.v.FeaturesService)}get items(){return this.dependencies.get(z.v.ItemManager)}get payloads(){return this.dependencies.get(z.v.PayloadManager)}get protections(){return this.dependencies.get(z.v.ProtectionService)}get sync(){return this.dependencies.get(z.v.SyncService)}get user(){return this.dependencies.get(z.v.UserService)}get settings(){return this.dependencies.get(z.v.SettingsService)}get mutator(){return this.dependencies.get(z.v.MutatorService)}get sessions(){return this.dependencies.get(z.v.SessionManager)}get status(){return this.dependencies.get(z.v.StatusService)}get fileBackups(){return this.dependencies.get(z.v.FilesBackupService)}get componentManager(){return this.dependencies.get(z.v.ComponentManager)}get listed(){return this.dependencies.get(z.v.ListedService)}get alerts(){return this.dependencies.get(z.v.AlertService)}get storage(){return this.dependencies.get(z.v.DiskStorageService)}get actions(){return this.dependencies.get(z.v.ActionsService)}get challenges(){return this.dependencies.get(z.v.ChallengeService)}get asymmetric(){return this.dependencies.get(z.v.AsymmetricMessageService)}get homeServer(){return this.dependencies.get(z.v.HomeServerService)}get preferences(){return this.dependencies.get(z.v.PreferencesService)}get history(){return this.dependencies.get(z.v.HistoryManager)}get encryption(){return this.dependencies.get(z.v.EncryptionService)}get events(){return this.dependencies.get(z.v.InternalEventBus)}get vaults(){return this.dependencies.get(z.v.VaultService)}get vaultLocks(){return this.dependencies.get(z.v.VaultLockService)}get vaultUsers(){return this.dependencies.get(z.v.VaultUserService)}get vaultInvites(){return this.dependencies.get(z.v.VaultInviteService)}get contacts(){return this.dependencies.get(z.v.ContactService)}get sharedVaults(){return this.dependencies.get(z.v.SharedVaultService)}get changeAndSaveItem(){return this.dependencies.get(z.v.ChangeAndSaveItem)}get getHost(){return this.dependencies.get(z.v.GetHost)}get setHost(){return this.dependencies.get(z.v.SetHost)}get legacyApi(){return this.dependencies.get(z.v.LegacyApiService)}get mfa(){return this.dependencies.get(z.v.MfaService)}get generateUuid(){return this.dependencies.get(z.v.GenerateUuid)}get createDecryptedBackupFile(){return this.dependencies.get(z.v.CreateDecryptedBackupFile)}get createEncryptedBackupFile(){return this.dependencies.get(z.v.CreateEncryptedBackupFile)}get migrations(){return this.dependencies.get(z.v.MigrationService)}get http(){return this.dependencies.get(z.v.HttpService)}get sockets(){return this.dependencies.get(z.v.WebSocketsService)}}class X{constructor(e,t,n){this.item=t.findSureItem(e),n&&n(this.item),this.removeObserver=t.streamItems(this.item.content_type,(t=>{let{changed:r,inserted:i}=t;const o=[...r,...i].find((t=>t.uuid===e));o&&(this.item=o,n&&n(this.item))}))}deinit(){this.removeObserver?(this.removeObserver(),this.removeObserver=void 0):console.error("A LiveItem is attempting to be deinited more than once.")}}var $=n(2256)},58181:(e,t,n)=>{n.d(t,{$:()=>r,R:()=>a});var r,i=n(55668),o=n(87901);!function(e){e.PrimaryApplicationSet="PrimaryApplicationSet",e.DescriptorsDataChanged="DescriptorsDataChanged",e.DeviceWillRestart="DeviceWillRestart"}(r||(r={}));var s=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class a extends i.wcN{constructor(e,t){void 0===t&&(t=new i.Ehg),super(t),this.device=e,this.onApplicationDeinit=(e,t,n)=>{this.primaryApplication===e&&(this.primaryApplication=void 0),(()=>{s(this,void 0,void 0,(function*(){n===i.u4P.SignOut&&this.removeDescriptor(this.descriptorForApplication(e));const o=this.getDescriptors();if(0===o.length||n===i.u4P.SignOutAll){const e=o.map((e=>e.identifier));this.descriptorRecord={};const{killsApplication:t}=yield this.device.clearAllDataFromDevice(e);if(t)return}const s=this.device;this.notifyEvent(r.DeviceWillRestart,{source:n,mode:t}),this.deinit(),t===i.CYv.Hard?s.performHardReset():s.performSoftReset()}))})()}}deinit(){super.deinit(),this.device.deinit(),this.device=void 0,this.callback=void 0,this.primaryApplication=void 0,this.onApplicationDeinit=void 0}initialize(e){return s(this,void 0,void 0,(function*(){if(this.device.isDeviceDestroyed())throw"Attempting to initialize new application while device is destroyed.";this.callback=e,this.descriptorRecord=yield this.device.getJsonParsedRawStorageValue(i.Bq2.DescriptorRecord),this.descriptorRecord||(yield this.createNewDescriptorRecord());let t=this.findPrimaryDescriptor();t||(console.error("No primary application descriptor found. Ensure migrations have been run."),t=this.getDescriptors()[0],this.setDescriptorAsPrimary(t),yield this.persistDescriptors());const n=yield this.buildApplication(t);this.primaryApplication=n,n.addEventObserver((()=>s(this,void 0,void 0,(function*(){this.renameDescriptor(t,n.sessions.getWorkspaceDisplayIdentifier())}))),i.n9K.SignedIn),yield this.notifyEvent(r.PrimaryApplicationSet,{application:n})}))}createNewDescriptorRecord(){return s(this,void 0,void 0,(function*(){const e="standardnotes",t={[e]:{identifier:e,label:"Main Workspace",primary:!0}};this.device.setRawStorageValue(i.Bq2.DescriptorRecord,JSON.stringify(t)),this.descriptorRecord=t,yield this.persistDescriptors()}))}getDescriptors(){return Object.values(this.descriptorRecord)}findPrimaryDescriptor(){for(const e of this.getDescriptors())if(e.primary)return e}signOutAllWorkspaces(){return s(this,void 0,void 0,(function*(){yield this.primaryApplication.user.signOut(!1,i.u4P.SignOutAll)}))}setDescriptorAsPrimary(e){for(const t of this.getDescriptors())t.primary=t===e}persistDescriptors(){return s(this,void 0,void 0,(function*(){yield this.device.setRawStorageValue(i.Bq2.DescriptorRecord,JSON.stringify(this.descriptorRecord)),this.notifyEvent(r.DescriptorsDataChanged,{descriptors:this.descriptorRecord})}))}renameDescriptor(e,t){e.label=t,this.persistDescriptors()}removeDescriptor(e){delete this.descriptorRecord[e.identifier];const t=this.getDescriptors();return e.primary&&t.length>0&&this.setDescriptorAsPrimary(t[0]),this.persistDescriptors()}removeAllDescriptors(){return this.descriptorRecord={},this.persistDescriptors()}descriptorForApplication(e){return this.descriptorRecord[e.identifier]}createNewApplicationDescriptor(e){const t=o.UuidGenerator.GenerateUuid(),n=this.getDescriptors().length+1;return{identifier:t,label:e||"Workspace ".concat(n),primary:!1}}createNewPrimaryDescriptor(e){return s(this,void 0,void 0,(function*(){const t=this.createNewApplicationDescriptor(e);this.descriptorRecord[t.identifier]=t,this.setDescriptorAsPrimary(t),yield this.persistDescriptors()}))}unloadCurrentAndCreateNewDescriptor(e){return s(this,void 0,void 0,(function*(){yield this.createNewPrimaryDescriptor(e),this.primaryApplication&&this.primaryApplication.deinit(this.primaryApplication.getDeinitMode(),i.u4P.SwitchWorkspace)}))}unloadCurrentAndActivateDescriptor(e){return s(this,void 0,void 0,(function*(){this.setDescriptorAsPrimary(e),yield this.persistDescriptors(),this.primaryApplication&&this.primaryApplication.deinit(this.primaryApplication.getDeinitMode(),i.u4P.SwitchWorkspace)}))}buildApplication(e){return s(this,void 0,void 0,(function*(){const t=yield this.callback.applicationCreator(e,this.device);return t.setOnDeinit(this.onApplicationDeinit),t}))}}},29159:(e,t,n)=>{var r;n.d(t,{Z:()=>r}),function(e){e.EnteringBackground="EnteringBackground",e.ResumingFromBackground="ResumingFromBackground",e.GainingFocus="GainingFocus",e.LosingFocus="LosingFocus",e.AndroidBackButtonPressed="AndroidBackButtonPressed",e.ColorSchemeChanged="ColorSchemeChanged",e.KeyboardFrameWillChange="KeyboardFrameWillChange",e.KeyboardFrameDidChange="KeyboardFrameDidChange",e.KeyboardWillShow="KeyboardWillShow",e.KeyboardWillHide="KeyboardWillHide",e.ReceivedFile="ReceivedFile",e.ReceivedLink="ReceivedLink",e.ReceivedText="ReceivedText",e.OpenFilePreview="OpenFilePreview"}(r||(r={}))},68704:(e,t,n)=>{n.d(t,{f:()=>i});var r=n(82648);class i{constructor(e,t){this.authenticatorClient=e,this.authenticatorRegistrationPromptFunction=t}execute(e){return t=this,n=void 0,o=function*(){if(!this.authenticatorRegistrationPromptFunction)return r.Result.fail("Could not generate authenticator registration options: No authenticator registration prompt function provided");const t=r.Uuid.create(e.userUuid);if(t.isFailed())return r.Result.fail("Could not generate authenticator registration options: ".concat(t.getError()));const n=t.getValue(),i=r.Validator.isNotEmpty(e.authenticatorName);if(i.isFailed())return r.Result.fail("Could not generate authenticator registration options: ".concat(i.getError()));const o=yield this.authenticatorClient.generateRegistrationOptions();if(null===o)return r.Result.fail("Could not generate authenticator registration options");let s;try{s=yield this.authenticatorRegistrationPromptFunction(o)}catch(e){return"InvalidStateError"===e.name?r.Result.fail("Authenticator was probably already registered by user"):r.Result.fail("Could not generate authenticator registration options: ".concat(e.message))}return(yield this.authenticatorClient.verifyRegistrationResponse(n,e.authenticatorName,s))?r.Result.ok():r.Result.fail("Could not verify authenticator registration response")},new((i=void 0)||(i=Promise))((function(e,r){function s(e){try{l(o.next(e))}catch(e){r(e)}}function a(e){try{l(o.throw(e))}catch(e){r(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(t,n||[])).next())}));var t,n,i,o}}},58875:(e,t,n)=>{n.d(t,{c:()=>i});var r=n(82648);class i{constructor(e){this.authenticatorClient=e}execute(e){return t=this,n=void 0,o=function*(){const t=r.Uuid.create(e.authenticatorId);if(t.isFailed())return r.Result.fail("Could not delete authenticator: ".concat(t.getError()));const n=t.getValue();return(yield this.authenticatorClient.delete(n))?r.Result.ok():r.Result.fail("Could not delete authenticator")},new((i=void 0)||(i=Promise))((function(e,r){function s(e){try{l(o.next(e))}catch(e){r(e)}}function a(e){try{l(o.throw(e))}catch(e){r(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(t,n||[])).next())}));var t,n,i,o}}},46390:(e,t,n)=>{n.d(t,{g:()=>i});var r=n(82648);class i{constructor(e){this.revisionManager=e}execute(e){return t=this,n=void 0,o=function*(){const t=r.Uuid.create(e.itemUuid);if(t.isFailed())return r.Result.fail("Could not delete revision: ".concat(t.getError()));const n=t.getValue(),i=r.Uuid.create(e.revisionUuid);if(i.isFailed())return r.Result.fail("Could not delete revision: ".concat(i.getError()));const o=i.getValue();try{return yield this.revisionManager.deleteRevision(n,o),r.Result.ok()}catch(e){return r.Result.fail("Could not delete revision: ".concat(e.message))}},new((i=void 0)||(i=Promise))((function(e,r){function s(e){try{l(o.next(e))}catch(e){r(e)}}function a(e){try{l(o.throw(e))}catch(e){r(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(t,n||[])).next())}));var t,n,i,o}}},12473:(e,t,n)=>{n.d(t,{V:()=>i});var r=n(82648);class i{constructor(e){this.authenticatorClient=e}execute(e){return t=this,n=void 0,o=function*(){const t=r.Username.create(e.username);if(t.isFailed())return r.Result.fail("Could not generate authenticator authentication options: ".concat(t.getError()));const n=t.getValue(),i=yield this.authenticatorClient.generateAuthenticationOptions(n);return null===i?r.Result.fail("Could not generate authenticator authentication options"):r.Result.ok(i)},new((i=void 0)||(i=Promise))((function(e,r){function s(e){try{l(o.next(e))}catch(e){r(e)}}function a(e){try{l(o.throw(e))}catch(e){r(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(t,n||[])).next())}));var t,n,i,o}}},84526:(e,t,n)=>{n.d(t,{F:()=>i});var r=n(82648);class i{constructor(e,t){this.getAuthenticatorAuthenticationOptions=e,this.authenticatorVerificationPromptFunction=t}execute(e){return t=this,n=void 0,o=function*(){if(!this.authenticatorVerificationPromptFunction)return r.Result.fail("Could not generate authenticator authentication options: No authenticator verification prompt function provided");const t=yield this.getAuthenticatorAuthenticationOptions.execute({username:e.username});if(t.isFailed())return r.Result.fail(t.getError());const n=t.getValue();let i;try{i=yield this.authenticatorVerificationPromptFunction(n)}catch(e){return r.Result.fail("Could not generate authenticator authentication options: ".concat(e.message))}return r.Result.ok(i)},new((i=void 0)||(i=Promise))((function(e,r){function s(e){try{l(o.next(e))}catch(e){r(e)}}function a(e){try{l(o.throw(e))}catch(e){r(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(t,n||[])).next())}));var t,n,i,o}}},79327:(e,t,n)=>{n.d(t,{u:()=>i});var r=n(82648);class i{constructor(e,t){this.authClient=e,this.settingsClient=t}execute(){return e=this,t=void 0,i=function*(){const e=yield this.settingsClient.getSetting(r.SettingName.create(r.SettingName.NAMES.RecoveryCodes).getValue());if(void 0!==e)return r.Result.ok(e);const t=yield this.authClient.generateRecoveryCodes();return!1===t?r.Result.fail("Could not generate recovery code"):r.Result.ok(t)},new((n=void 0)||(n=Promise))((function(r,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}));var e,t,n,i}}},51383:(e,t,n)=>{n.d(t,{X:()=>o});var r=n(82648),i=n(22325);class o{constructor(e,t){this.revisionManager=e,this.encryptionService=t}execute(e){var t,n,o,s,a,l;return o=this,s=void 0,l=function*(){const o=r.Uuid.create(e.itemUuid);if(o.isFailed())return r.Result.fail("Could not get revision: ".concat(o.getError()));const s=o.getValue(),a=r.Uuid.create(e.revisionUuid);if(a.isFailed())return r.Result.fail("Could not get revision: ".concat(a.getError()));const l=a.getValue();let c;try{c=yield this.revisionManager.getRevision(s,l)}catch(e){return r.Result.fail("Could not get revision: ".concat(e.message))}if(!c)return r.Result.fail("Could not get revision: Revision not found");const u=new i.EncryptedPayload(Object.assign(Object.assign({},(0,i.PayloadTimestampDefaults)()),{uuid:c.uuid,content:c.content,enc_item_key:c.enc_item_key,items_key_id:c.items_key_id,auth_hash:c.auth_hash,content_type:c.content_type,updated_at:new Date(c.updated_at),created_at:new Date(c.created_at),key_system_identifier:null!==(t=c.key_system_identifier)&&void 0!==t?t:void 0,shared_vault_uuid:null!==(n=c.shared_vault_uuid)&&void 0!==n?n:void 0,waitingForKey:!1,errorDecrypting:!1})),d=this.encryptionService.getEmbeddedPayloadAuthenticatedData(u),h=null==d?void 0:d.u,p=u.copy({uuid:h||c.item_uuid});if(void 0!==(0,i.checkRemotePayloadAllowed)(p).disallowed)return r.Result.fail("Remote payload is disallowed: ".concat(JSON.stringify(p)));const f=new i.EncryptedPayload(p),g=yield this.encryptionService.decryptSplitSingle({usesItemsKeyWithKeyLookup:{items:[f]}});return(0,i.isErrorDecryptingPayload)(g)?r.Result.fail("Could not decrypt revision."):r.Result.ok(new i.HistoryEntry(g))},new((a=void 0)||(a=Promise))((function(e,t){function n(e){try{i(l.next(e))}catch(e){t(e)}}function r(e){try{i(l.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(n,r)}i((l=l.apply(o,s||[])).next())}))}}},43252:(e,t,n)=>{n.d(t,{F:()=>i});var r=n(82648);class i{constructor(e){this.authenticatorClient=e}execute(){return e=this,t=void 0,i=function*(){const e=yield this.authenticatorClient.list();return r.Result.ok(e)},new((n=void 0)||(n=Promise))((function(r,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}));var e,t,n,i}}},9704:(e,t,n)=>{n.d(t,{G:()=>i});var r=n(82648);class i{constructor(e){this.revisionManager=e}execute(e){return t=this,n=void 0,o=function*(){const t=r.Uuid.create(e.itemUuid);if(t.isFailed())return r.Result.fail("Could not list item revisions: ".concat(t.getError()));const n=t.getValue();try{const e=yield this.revisionManager.listRevisions(n);return r.Result.ok(e)}catch(e){return r.Result.fail("Could not list item revisions: ".concat(e.message))}},new((i=void 0)||(i=Promise))((function(e,r){function s(e){try{l(o.next(e))}catch(e){r(e)}}function a(e){try{l(o.throw(e))}catch(e){r(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(t,n||[])).next())}));var t,n,i,o}}},32274:(e,t,n)=>{n.d(t,{Y:()=>a});var r=n(82648),i=n(22325),o=n(55668),s=n(86999);class a{constructor(e,t,n,r,i,o){this.authManager=e,this.encryptionService=t,this.inMemoryStore=n,this.crypto=r,this.sessionManager=i,this.internalEventBus=o}execute(e){return t=this,n=void 0,l=function*(){if(this.encryptionService.hasAccount())return r.Result.fail("Tried to sign in when an account already exists.");const t=this.crypto.generateRandomKey(256);this.inMemoryStore.setValue(o.QtK.CodeVerifier,t);const n=this.crypto.base64URLEncode(yield this.crypto.sha256(t)),a=yield this.authManager.recoveryKeyParams(Object.assign({codeChallenge:n},e));if(!1===a)return r.Result.fail("Could not retrieve recovery key params");const l=(0,s.jl)(a);if(!this.encryptionService.supportedVersions().includes(l.version))return this.encryptionService.isVersionNewerThanLibraryVersion(l.version)?r.Result.fail(o.fnl):r.Result.fail(o.R53);if(!this.encryptionService.platformSupportsKeyDerivation(l))return r.Result.fail(o.VnT);const c=yield this.encryptionService.computeRootKey(e.password,l),u=yield this.authManager.signInWithRecoveryCodes({codeVerifier:t,recoveryCodes:e.recoveryCodes,username:e.username,password:c.serverPassword,hvmToken:e.hvmToken});if(!1===u.success)return u.captchaURL?r.Result.fail(JSON.stringify({captchaURL:u.captchaURL})):r.Result.fail("Could not sign in with recovery code");this.inMemoryStore.removeValue(o.QtK.CodeVerifier);const d=new s.t$((0,i.CopyPayloadWithContentOverride)(c.payload,{keyParams:u.keyParams}));return yield this.sessionManager.handleAuthentication({session:u.session,user:u.user,rootKey:d}),yield this.internalEventBus.publishSync({type:o.oF7.SignedInOrRegistered,payload:{payload:{ephemeral:!1,mergeLocal:!1,awaitSync:!0,checkIntegrity:!1}}},o.WNP.SEQUENCE),r.Result.ok()},new((a=void 0)||(a=Promise))((function(e,r){function i(e){try{s(l.next(e))}catch(e){r(e)}}function o(e){try{s(l.throw(e))}catch(e){r(e)}}function s(t){var n;t.done?e(t.value):(n=t.value,n instanceof a?n:new a((function(e){e(n)}))).then(i,o)}s((l=l.apply(t,n||[])).next())}));var t,n,a,l}}},67199:(e,t,n)=>{n.d(t,{FL:()=>u.F,FV:()=>a.F,GU:()=>d.G,VQ:()=>s.V,Xc:()=>c.X,Y_:()=>h.Y,cx:()=>i.c,fC:()=>r.f,gS:()=>o.g,u2:()=>l.u});var r=n(68704),i=n(58875),o=n(46390),s=n(12473),a=n(84526),l=n(79327),c=n(51383),u=n(43252),d=n(9704),h=n(32274)},43361:(e,t,n)=>{n.d(t,{W:()=>r});class r{static log(){this.onLog(...arguments)}static error(e){return this.onError(e),e}}},38529:(e,t,n)=>{n.d(t,{l:()=>s});var r=n(22325),i=n(87901),o=n(82648);class s{static isApplicableToCurrentData(e){const t=e.getItems(o.ContentType.TYPES.Tag);for(const e of t)if(e.title.includes(r.TagFolderDelimitter)&&!e.parentId)return!0;return!1}static run(e,t){return n=this,s=void 0,l=function*(){const n=e.getItems(o.ContentType.TYPES.Tag),s=(0,i.sortByKey)(n,"title");for(const e of s){const n=e.title.split(r.TagFolderDelimitter),o=1===n.length,s=!!e.parentId,a=n.some((e=>0===e.length));if(s||o||a)continue;const l=(0,i.withoutLastElement)(n),c=(0,i.lastElement)(n);if(!c)return;const u=yield t.findOrCreateTagParentChain(l);yield t.changeItem(e,(e=>{e.title=c,u&&e.makeChildOf(u)}))}},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{o(l.next(e))}catch(e){t(e)}}function i(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){var n;t.done?e(t.value):(n=t.value,n instanceof a?n:new a((function(e){e(n)}))).then(r,i)}o((l=l.apply(n,s||[])).next())}));var n,s,a,l}}},58386:(e,t,n)=>{n.d(t,{_:()=>f});var r={};n.r(r),n.d(r,{StorageReader2_0_0:()=>d});var i=n(22325),o=n(94986),s=n(15078),a=n(55668),l=n(87901);class c{constructor(e,t,n){this.deviceInterface=e,this.identifier=t,this.environment=n}static version(){throw Error("Must override")}}var u=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class d extends c{static version(){return o.Oq}getStorage(){return u(this,void 0,void 0,(function*(){const e=(0,a.xLN)(this.identifier,a.Bq2.StorageObject),t=yield this.deviceInterface.getRawStorageValue(e);return t?JSON.parse(t):void 0}))}getNonWrappedValue(e){var t;return u(this,void 0,void 0,(function*(){const n=yield this.getStorage();if(n)return null===(t=n[a.dDH.Nonwrapped])||void 0===t?void 0:t[e]}))}getAccountKeyParams(){return u(this,void 0,void 0,(function*(){return this.getNonWrappedValue(a.QtK.RootKeyParams)}))}hasNonWrappedAccountKeys(){return u(this,void 0,void 0,(function*(){const e=yield this.deviceInterface.getNamespacedKeychainValue(this.identifier);return!(0,l.isNullOrUndefined)(e)}))}hasPasscode(){return u(this,void 0,void 0,(function*(){const e=yield this.getNonWrappedValue(a.QtK.WrappedRootKey);return!(0,l.isNullOrUndefined)(e)}))}usesKeychain(){return!0}}var h=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};const p="last_migration_timestamp";class f extends s.U{constructor(){super(...arguments),this.didPreRun=!1}preRun(){return h(this,void 0,void 0,(function*(){yield this.storeVersionNumber(),this.didPreRun=!0}))}registerStageHandlers(){this.registerStageHandler(a.Ugm.PreparingForLaunch_0,(()=>h(this,void 0,void 0,(function*(){(yield this.needsKeychainRepair())&&(yield this.repairMissingKeychain()),this.markDone()}))))}getStoredVersion(){const e=(0,a.xLN)(this.services.identifier,a.Bq2.SnjsVersion);return this.services.deviceInterface.getRawStorageValue(e)}storeVersionNumber(){return h(this,void 0,void 0,(function*(){const e=(0,a.xLN)(this.services.identifier,a.Bq2.SnjsVersion);if(!(yield this.getStoredVersion())){const t=["migrations","ephemeral","user","cachedThemes","syncToken","encryptedStorage"];let n=!1;for(const e of t)if(yield this.services.deviceInterface.getRawStorageValue(e)){n=!0;break}if(n)yield this.services.deviceInterface.setRawStorageValue(e,o.DU);else{const t=(0,a.xLN)(this.services.identifier,p);null!=(yield this.services.deviceInterface.getRawStorageValue(t))?(yield this.services.deviceInterface.setRawStorageValue(e,o.Oq),yield this.services.deviceInterface.removeRawStorageValue(p)):yield this.services.deviceInterface.setRawStorageValue(e,o.in)}}}))}loadReader(){return h(this,void 0,void 0,(function*(){if(this.reader)return;const e=yield this.getStoredVersion();this.reader=function(e,t,n,i){const s=function(e){const t=Object.values(r).sort(((e,t)=>-1*(0,o.D8)(e.version(),t.version())));for(const n of t){if(n.version()===e)return n;if((0,o.jV)(n.version(),e))return n}throw Error("Cannot find reader for version ".concat(e))}(e);return new s(t,n,i)}(e,this.services.deviceInterface,this.services.identifier,this.services.environment)}))}needsKeychainRepair(){return h(this,void 0,void 0,(function*(){if(null!=this.memoizedNeedsKeychainRepair)return this.memoizedNeedsKeychainRepair;if(!this.didPreRun)throw Error("Attempting to access specialized function before prerun");return this.reader||(yield this.loadReader()),this.reader.usesKeychain?null==(yield this.reader.getAccountKeyParams())||(yield this.reader.hasPasscode())||(yield this.reader.hasNonWrappedAccountKeys())?(this.memoizedNeedsKeychainRepair=!1,this.memoizedNeedsKeychainRepair):(this.memoizedNeedsKeychainRepair=!0,this.memoizedNeedsKeychainRepair):(this.memoizedNeedsKeychainRepair=!1,this.memoizedNeedsKeychainRepair)}))}repairMissingKeychain(){return h(this,void 0,void 0,(function*(){const e=yield this.reader.getAccountKeyParams(),t=(yield this.services.deviceInterface.getAllDatabaseEntries(this.services.identifier)).map((e=>new i.EncryptedPayload(e)));let n=t.find((e=>(0,i.ContentTypeUsesRootKeyEncryption)(e.content_type)));if(n||(n=t[0]),!n)return void(yield this.services.storageService.clearValues());const r=new a.tv4([new a.FEo(a.tQn.None,void 0,a.K9E.PasswordInputPlaceholder,!0)],a.Ps8.Custom,!1,a.mHn.Title,a.mHn.Text(e.identifier));return new Promise((t=>{this.services.challengeService.addChallengeObserver(r,{onNonvalidatedSubmit:o=>h(this,void 0,void 0,(function*(){const s=o.values[0].value,a=this.services.encryptionService.createKeyParams(e),c=yield this.services.encryptionService.computeRootKey(s,a);(0,l.assert)(n);const u=yield this.services.encryptionService.decryptSplitSingle({usesRootKey:{items:[n],key:c}});if((0,i.isErrorDecryptingPayload)(u))this.services.challengeService.setValidationStatusForChallenge(r,o.values[0],!1);else{const e=c.getKeychainValue();yield this.services.deviceInterface.setNamespacedKeychainValue(e,this.services.identifier),t(!0),this.services.challengeService.completeChallenge(r)}}))}),this.services.challengeService.promptForChallengeResponse(r)}))}))}}},15078:(e,t,n)=>{n.d(t,{U:()=>o});var r=n(55668),i=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class o{constructor(e){this.services=e,this.stageHandlers={},this.registerStageHandlers()}static version(){throw"Must override migration version"}registerStageHandler(e,t){this.stageHandlers[e]=t}markDone(){var e;null===(e=this.onDoneHandler)||void 0===e||e.call(this),this.onDoneHandler=void 0}promptForPasscodeUntilCorrect(e){return i(this,void 0,void 0,(function*(){const t=new r.tv4([new r.FEo(r.tQn.None)],r.Ps8.Migration,!1);return new Promise((n=>{this.services.challengeService.addChallengeObserver(t,{onNonvalidatedSubmit:r=>i(this,void 0,void 0,(function*(){const i=r.values[0],o=i.value;(yield e(o))?(this.services.challengeService.completeChallenge(t),n(o)):this.services.challengeService.setValidationStatusForChallenge(t,i,!1)}))}),this.services.challengeService.promptForChallengeResponse(t)}))}))}onDone(e){this.onDoneHandler=e}handleStage(e){return i(this,void 0,void 0,(function*(){const t=this.stageHandlers[e];t&&(yield t())}))}}},42798:(e,t,n)=>{n.d(t,{ly:()=>s,wg:()=>v,aL:()=>b,od:()=>E,Jb:()=>_,Lp:()=>P,kK:()=>h,qW:()=>f,Ni:()=>m,pI:()=>u,R_:()=>k});var r=n(55668),i=n(15078),o=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class s extends i.U{static version(){return"2.0.15"}registerStageHandlers(){this.registerStageHandler(r.Ugm.LoadedDatabase_12,(()=>o(this,void 0,void 0,(function*(){yield this.createNewDefaultItemsKeyIfNecessary(),this.markDone()}))))}createNewDefaultItemsKeyIfNecessary(){return o(this,void 0,void 0,(function*(){this.services.encryptionService.needsNewRootKeyBasedItemsKey()&&(yield this.services.encryptionService.createNewDefaultItemsKey())}))}}var a=n(22325),l=n(82648),c=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class u extends i.U{static version(){return"2.7.0"}registerStageHandlers(){this.registerStageHandler(r.Ugm.FullSyncCompleted_13,(()=>c(this,void 0,void 0,(function*(){yield this.deleteBatchManagerSingleton(),this.markDone()}))))}deleteBatchManagerSingleton(){return c(this,void 0,void 0,(function*(){const e=new a.CompoundPredicate("and",[new a.Predicate("content_type","=",l.ContentType.TYPES.Component),new a.Predicate("identifier","=","org.standardnotes.batch-manager")]),t=this.services.singletonManager.findSingleton(l.ContentType.TYPES.Component,e);t&&(yield this.services.mutator.setItemToBeDeleted(t))}))}}var d=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class h extends i.U{static version(){return"2.20.0"}registerStageHandlers(){this.registerStageHandler(r.Ugm.LoadedDatabase_12,(()=>d(this,void 0,void 0,(function*(){yield this.deleteMfaItems(),this.markDone()}))))}deleteMfaItems(){return d(this,void 0,void 0,(function*(){const e=this.services.itemManager.getItems("SF|MFA");for(const t of e)this.services.itemManager.removeItemFromMemory(t),yield this.services.storageService.deletePayloadWithUuid(t.uuid)}))}}var p=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class f extends i.U{static version(){return"2.36.0"}registerStageHandlers(){this.registerStageHandler(r.Ugm.LoadedDatabase_12,(()=>p(this,void 0,void 0,(function*(){yield this.removeServerExtensionsLocally(),this.markDone()}))))}removeServerExtensionsLocally(){return p(this,void 0,void 0,(function*(){const e=this.services.itemManager.getItems("SF|Extension");for(const t of e)this.services.itemManager.removeItemFromMemory(t),yield this.services.storageService.deletePayloadWithUuid(t.uuid)}))}}var g=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class m extends i.U{static version(){return"2.42.0"}registerStageHandlers(){this.registerStageHandler(r.Ugm.FullSyncCompleted_13,(()=>g(this,void 0,void 0,(function*(){yield this.deleteNoDistraction(),this.markDone()}))))}deleteNoDistraction(){return g(this,void 0,void 0,(function*(){const e=this.services.itemManager.getItems(l.ContentType.TYPES.Theme).filter((e=>"org.standardnotes.theme-no-distraction"===e.identifier));for(const t of e)yield this.services.mutator.setItemToBeDeleted(t)}))}}var y=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class v extends i.U{static version(){return"2.167.6"}registerStageHandlers(){this.registerStageHandler(r.Ugm.Launched_10,(()=>y(this,void 0,void 0,(function*(){yield this.migrateStorageKeysForDesktopBackups(),this.markDone()}))))}migrateStorageKeysForDesktopBackups(){return y(this,void 0,void 0,(function*(){const e=this.services.deviceInterface;if(!(0,r.dse)(e)||!this.services.backups)return;const t=yield e.isLegacyFilesBackupsEnabled();if(this.services.storageService.setValue(r.QtK.FileBackupsEnabled,t),t){const t=yield e.getLegacyFilesBackupsLocation(),n=yield e.joinPaths(t,yield this.services.backups.prependWorkspacePathForPath(r.aax));yield e.migrateLegacyFileBackupsToNewStructure(n),this.services.storageService.setValue(r.QtK.FileBackupsLocation,n)}if(yield e.wasLegacyTextBackupsExplicitlyDisabled())this.services.storageService.setValue(r.QtK.TextBackupsEnabled,!1);else{const t=yield e.joinPaths(yield e.getLegacyTextBackupsLocation(),yield this.services.backups.prependWorkspacePathForPath(r.OU3));this.services.storageService.setValue(r.QtK.TextBackupsLocation,t),this.services.storageService.setValue(r.QtK.TextBackupsEnabled,!0)}}))}}var A=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class b extends i.U{static version(){return"2.168.6"}registerStageHandlers(){this.registerStageHandler(r.Ugm.Launched_10,(()=>A(this,void 0,void 0,(function*(){yield this.migrateErroneousWindowsPathFromPreviousMigration(),this.markDone()}))))}migrateErroneousWindowsPathFromPreviousMigration(){return A(this,void 0,void 0,(function*(){const e=this.services.deviceInterface;if(!(0,r.dse)(e)||!this.services.backups)return;if(this.services.platform!==a.Platform.WindowsDesktop)return;const t=this.services.backups.getTextBackupsLocation();if(t){const n=t.split("/");if(n.length>1){const t=yield e.joinPaths(...n);this.services.storageService.setValue(r.QtK.TextBackupsLocation,t)}}const n=this.services.backups.getFilesBackupsLocation();if(n){const t=n.split("/");if(t.length>1){const n=yield e.joinPaths(...t);this.services.storageService.setValue(r.QtK.FileBackupsLocation,n)}}const i=this.services.backups.getPlaintextBackupsLocation();if(i){const t=i.split("/");if(t.length>1){const n=yield e.joinPaths(...t);this.services.storageService.setValue(r.QtK.PlaintextBackupsLocation,n)}}}))}}var w=n(87901),S=n(80215),C=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class E extends i.U{static version(){return"2.202.1"}registerStageHandlers(){this.registerStageHandler(r.Ugm.FullSyncCompleted_13,(()=>C(this,void 0,void 0,(function*(){yield this.migrateComponentDataToUserPreferences(),yield this.migrateActiveComponentsToUserPreferences(),this.markDone()}))))}migrateComponentDataToUserPreferences(){var e,t;return C(this,void 0,void 0,(function*(){const n=this.services.itemManager.getItems(l.ContentType.TYPES.Component);if(0===n.length)return;const r=(0,w.Copy)(null!==(e=this.services.preferences.getValue(a.PrefKey.ComponentPreferences))&&void 0!==e?e:{});for(const e of n){const n=e.legacyComponentData;if(!n)continue;if(0===Object.keys(n).length)continue;const i=(0,S.FindNativeFeature)(e.identifier)?e.identifier:e.uuid,o=null!==(t=r[i])&&void 0!==t?t:{};for(const e of Object.keys(n))o[e]=n[e];r[i]=o}yield this.services.preferences.setValueDetached(a.PrefKey.ComponentPreferences,r)}))}migrateActiveComponentsToUserPreferences(){return C(this,void 0,void 0,(function*(){const e=[...this.services.itemManager.getItems(l.ContentType.TYPES.Component),...this.services.itemManager.getItems(l.ContentType.TYPES.Theme)].filter((e=>e.legacyActive));if(0===e.length)return;const t=e.filter((e=>e.isTheme())),n=e.filter((e=>!e.isTheme()));yield this.services.preferences.setValueDetached(a.PrefKey.DEPRECATED_ActiveThemes,(0,w.Uuids)(t)),yield this.services.preferences.setValueDetached(a.PrefKey.ActiveComponents,(0,w.Uuids)(n))}))}}var I=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class _ extends i.U{static version(){return"2.208.0"}registerStageHandlers(){this.registerStageHandler(r.Ugm.FullSyncCompleted_13,(()=>I(this,void 0,void 0,(function*(){yield this.migrateSyncedPreferencesToLocal(),this.markDone()}))))}migrateSyncedPreferencesToLocal(){return I(this,void 0,void 0,(function*(){this.services.preferences.setLocalValue(r.dH$.ActiveThemes,this.services.preferences.getValue(a.PrefKey.DEPRECATED_ActiveThemes,a.PrefDefaults[a.PrefKey.DEPRECATED_ActiveThemes])),this.services.preferences.setLocalValue(r.dH$.UseSystemColorScheme,this.services.preferences.getValue(a.PrefKey.DEPRECATED_UseSystemColorScheme,a.PrefDefaults[a.PrefKey.DEPRECATED_UseSystemColorScheme])),this.services.preferences.setLocalValue(r.dH$.AutoLightThemeIdentifier,this.services.preferences.getValue(a.PrefKey.DEPRECATED_AutoLightThemeIdentifier,a.PrefDefaults[a.PrefKey.DEPRECATED_AutoLightThemeIdentifier])),this.services.preferences.setLocalValue(r.dH$.AutoDarkThemeIdentifier,this.services.preferences.getValue(a.PrefKey.DEPRECATED_AutoDarkThemeIdentifier,a.PrefDefaults[a.PrefKey.DEPRECATED_AutoDarkThemeIdentifier])),this.services.preferences.setLocalValue(r.dH$.UseTranslucentUI,this.services.preferences.getValue(a.PrefKey.DEPRECATED_UseTranslucentUI,a.PrefDefaults[a.PrefKey.DEPRECATED_UseTranslucentUI]))}))}}var x=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class P extends i.U{static version(){return"2.209.0"}registerStageHandlers(){this.registerStageHandler(r.Ugm.FullSyncCompleted_13,(()=>x(this,void 0,void 0,(function*(){yield this.migrateSyncedPreferencesToLocal(),this.markDone()}))))}migrateSyncedPreferencesToLocal(){return x(this,void 0,void 0,(function*(){this.services.preferences.setLocalValue(r.dH$.EditorMonospaceEnabled,this.services.preferences.getValue(a.PrefKey.DEPRECATED_EditorMonospaceEnabled,a.PrefDefaults[r.dH$.EditorMonospaceEnabled])),this.services.preferences.setLocalValue(r.dH$.EditorFontSize,this.services.preferences.getValue(a.PrefKey.DEPRECATED_EditorFontSize,a.PrefDefaults[r.dH$.EditorFontSize])),this.services.preferences.setLocalValue(r.dH$.EditorLineWidth,this.services.preferences.getValue(a.PrefKey.DEPRECATED_EditorLineWidth,a.PrefDefaults[r.dH$.EditorLineWidth])),this.services.preferences.setLocalValue(r.dH$.EditorLineHeight,this.services.preferences.getValue(a.PrefKey.DEPRECATED_EditorLineHeight,a.PrefDefaults[r.dH$.EditorLineHeight]))}))}}const k=[s,u,h,f,m,v,b,E,_,P]},90693:(e,t,n)=>{n.d(t,{Jb:()=>i.Jb,Lp:()=>i.Lp,Ni:()=>i.Ni,R_:()=>i.R_,_r:()=>r._,aL:()=>i.aL,kK:()=>i.kK,ly:()=>i.ly,od:()=>i.od,pI:()=>i.pI,qW:()=>i.qW,wg:()=>i.wg});var r=n(58386),i=n(42798)},19820:(e,t,n)=>{n.d(t,{b:()=>l});var r=n(87901),i=n(22325),o=n(55668),s=n(82648),a=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class l extends o.wcN{constructor(e,t,n,r,i,o,s){super(s),this.itemManager=e,this.alertService=t,this.device=n,this.httpService=r,this.encryptionService=i,this.challengeService=o,this.internalEventBus=s,this.previousPasswords=[],this.payloadRequestHandlers=[],this.previousPasswords=[]}deinit(){this.itemManager=void 0,this.alertService=void 0,this.device=void 0,this.httpService=void 0,this.challengeService=void 0,this.encryptionService=void 0,this.payloadRequestHandlers.length=0,this.previousPasswords.length=0,super.deinit()}addPayloadRequestHandler(e){return this.payloadRequestHandlers.push(e),()=>{(0,r.removeFromArray)(this.payloadRequestHandlers,e)}}getExtensions(){return this.itemManager.getItems(s.ContentType.TYPES.ActionsExtension).filter((e=>!e.isListedExtension))}extensionsInContextOfItem(e){return this.getExtensions().filter((t=>t.supported_types.includes(e.content_type)||t.actionsWithContextForItem(e).length>0))}loadExtensionInContextOfItem(e,t){return a(this,void 0,void 0,(function*(){const n={content_type:t.content_type,item_uuid:t.uuid},r=yield this.httpService.getAbsolute(e.url,n).catch((e=>{console.error("Error loading extension",e)}));if(!r)return;const o=r.description||e.description,s=r.supported_types||e.supported_types,a=r.actions||[],l=new i.ActionsExtensionMutator(e,i.MutationType.UpdateUserTimestamps);l.deprecation=r.deprecation,l.description=o,l.supported_types=s,l.actions=a;const c=l.getResult();return(0,i.CreateDecryptedItemFromPayload)(c)}))}runAction(e,t){return a(this,void 0,void 0,(function*(){let n;switch(e.verb){case"render":n=yield this.handleRenderAction(e);break;case"show":n=this.handleShowAction(e);break;case"post":n=yield this.handlePostAction(e,t)}return n}))}handleRenderAction(e){return a(this,void 0,void 0,(function*(){return yield this.httpService.getAbsolute(e.url).then((e=>a(this,void 0,void 0,(function*(){const t=yield this.payloadByDecryptingResponse(e);if(t){const n=(0,i.CreateDecryptedItemFromPayload)(t);return Object.assign(Object.assign({},e),{item:n})}})))).catch((e=>{const t=e&&e.error||{message:"An issue occurred while processing this action. Please try again."};return this.alertService.alert(t.message),{error:t}}))}))}payloadByDecryptingResponse(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return a(this,void 0,void 0,(function*(){if(!e.item||e.item.deleted||null==e.item.content)return;const r=new i.EncryptedPayload(e.item);if(!r.enc_item_key)return void this.alertService.alert("This revision is missing its key and cannot be recovered.");let o=yield this.encryptionService.decryptSplitSingle({usesItemsKeyWithKeyLookup:{items:[r]}});if(!(0,i.isErrorDecryptingPayload)(o))return o;if(t&&(o=yield this.encryptionService.decryptSplitSingle({usesRootKey:{items:[r],key:t}}),!(0,i.isErrorDecryptingPayload)(o)))return o;for(const e of this.itemManager.getDisplayableItemsKeys()){const t=yield this.encryptionService.decryptSplitSingle({usesItemsKey:{items:[r],key:e}});if(!(0,i.isErrorDecryptingPayload)(t))return t}const s=e.keyParams||e.auth_params;if(!s)return void this.alertService.alert("We were unable to decrypt this revision using your current keys, and this revision is missing metadata that would allow us to try different keys to decrypt it. This can likely be fixed with some manual intervention. Please email help@standardnotes.com for assistance.");const a=this.encryptionService.createKeyParams(s);for(const t of this.previousPasswords){if(n.includes(t))continue;n.push(t);const r=yield this.encryptionService.computeRootKey(t,a);if(!r)continue;const i=yield this.payloadByDecryptingResponse(e,r,n);if(i)return i}const l=yield this.promptForLegacyPassword();return l&&!this.previousPasswords.includes(l)?(this.previousPasswords.push(l),this.payloadByDecryptingResponse(e,t)):void 0}))}promptForLegacyPassword(){return a(this,void 0,void 0,(function*(){const e=new o.tv4([new o.FEo(o.tQn.None,"Previous Password",void 0,!0)],o.Ps8.Custom,!0,"Unable to find key for revision. Please enter the account password you may have used at the time of the revision."),t=yield this.challengeService.promptForChallengeResponse(e);return null==t?void 0:t.getDefaultValue().value}))}handlePostAction(e,t){return a(this,void 0,void 0,(function*(){const n=e.access_type===i.ActionAccessType.Decrypted,r={items:[yield this.outgoingPayloadForItem(t,n)]};return this.httpService.postAbsolute(e.url,r).then((e=>e)).catch((e=>(console.error("Action error response:",e),this.alertService.alert("An issue occurred while processing this action. Please try again."),e)))}))}handleShowAction(e){return this.device.openUrl(e.url),{}}outgoingPayloadForItem(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return a(this,void 0,void 0,(function*(){const n=this.getPayloadFromRequestHandlers(e.uuid);if(n)return n;if(t)return e.payload.ejected();const r=yield this.encryptionService.encryptSplitSingle({usesItemsKeyWithKeyLookup:{items:[e.payload]}});return(0,i.CreateEncryptedBackupFileContextPayload)(r)}))}getPayloadFromRequestHandlers(e){for(const t of this.payloadRequestHandlers){const n=t(e);if(n)return n}}}},54911:(e,t,n)=>{n.d(t,{A:()=>u});var r=n(87901),i=n(55668),o=n(95658),s=n(82648),a=n(98361),l=n(52450),c=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class u extends i.wcN{constructor(e,t,n,r,i,o,s,a){super(a),this.httpService=e,this.storageService=t,this.host=n,this.inMemoryStore=r,this.crypto=i,this.sessionStorageMapper=o,this.legacySessionStorageMapper=s,this.internalEventBus=a,this.authenticating=!1,this.changing=!1,this.refreshingSession=!1,this.session=null}deinit(){this.httpService=void 0,this.storageService=void 0,this.invalidSessionObserver=void 0,this.session=null,super.deinit()}setUser(e){this.user=e}setInvalidSessionObserver(e){this.invalidSessionObserver=e}loadHost(){const e=this.storageService.getValue(i.QtK.ServerHost);return this.host=e||this.host,this.host}setHost(e){return c(this,void 0,void 0,(function*(){this.host=e,this.storageService.setValue(i.QtK.ServerHost,e)}))}getHost(){return this.host}getFilesHost(){if(!this.filesHost)throw Error("Attempting to access undefined filesHost");return this.filesHost}setSession(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.session=e,t){let t;t=e instanceof s.Session?this.sessionStorageMapper.toProjection(e):this.legacySessionStorageMapper.toProjection(e),this.storageService.setValue(i.QtK.Session,t)}}getSession(){return this.session}get apiVersion(){return"20240226"}params(e){return Object.assign(Object.assign({},e),{[o.ApiEndpointParam.ApiVersion]:this.apiVersion})}createErrorResponse(e,t,n){return{data:{error:{message:e,tag:n}},status:null!=t?t:o.HttpStatusCode.BadRequest}}errorResponseWithFallbackMessage(e,t){return e.data.error&&!e.data.error.message&&(e.data.error.message=t),e}processMetaObject(e){var t,n;e.auth&&e.auth.userUuid&&e.auth.roles&&this.notifyEvent(i.Sf$.MetaReceived,{userUuid:e.auth.userUuid,userRoles:e.auth.roles}),(null===(t=e.server)||void 0===t?void 0:t.filesServerUrl)&&(this.filesHost=null===(n=e.server)||void 0===n?void 0:n.filesServerUrl)}processSuccessResponseForMetaBody(e){e.meta&&this.processMetaObject(e.meta)}request(e){return c(this,void 0,void 0,(function*(){try{const t=yield this.httpService.runHttp(e);return(0,o.isErrorResponse)(t)?this.errorResponseWithFallbackMessage(t,e.fallbackErrorMessage):(this.processSuccessResponseForMetaBody(t),t)}catch(t){return this.errorResponseWithFallbackMessage(t,e.fallbackErrorMessage)}}))}getAccountKeyParams(e){return c(this,void 0,void 0,(function*(){const t=this.crypto.generateRandomKey(256);this.inMemoryStore.setValue(i.QtK.CodeVerifier,t);const n=this.crypto.base64URLEncode(yield this.crypto.sha256(t)),s=this.params({email:e.email,code_challenge:n});return void 0!==e.mfaCode&&(s.mfa_code=e.mfaCode),e.authenticatorResponse&&(s.authenticator_response=e.authenticatorResponse),this.request({verb:o.HttpVerb.Post,url:(0,r.joinPaths)(this.host,a.n.v2.keyParams),fallbackErrorMessage:i.VpG,params:s,authentication:this.getSessionAccessToken()})}))}signIn(e){return c(this,void 0,void 0,(function*(){if(this.authenticating)return this.createErrorResponse(i.TYJ,o.HttpStatusCode.BadRequest);this.authenticating=!0;const t=(0,r.joinPaths)(this.host,a.n.v2.signIn),n=this.params({email:e.email,password:e.serverPassword,ephemeral:e.ephemeral,code_verifier:this.inMemoryStore.getValue(i.QtK.CodeVerifier),hvm_token:e.hvmToken}),s=yield this.request({verb:o.HttpVerb.Post,url:t,params:n,fallbackErrorMessage:i.VpG});return this.authenticating=!1,this.inMemoryStore.removeValue(i.QtK.CodeVerifier),s}))}signOut(){return this.httpService.post(a.n.v1.signOut,void 0,{authentication:this.getSessionAccessToken()})}changeCredentials(e){return c(this,void 0,void 0,(function*(){if(this.changing)return this.createErrorResponse(i.WLG,o.HttpStatusCode.BadRequest);const t=this.preprocessingError();if(t)return t;this.changing=!0;const n=a.n.v1.changeCredentials(e.userUuid),r=this.params(Object.assign({current_password:e.currentServerPassword,new_password:e.newServerPassword,new_email:e.newEmail},e.newKeyParams.getPortableValue())),s=yield this.httpService.put(n,r,{authentication:this.getSessionAccessToken()});return this.changing=!1,(0,o.isErrorResponse)(s)?this.errorResponseWithFallbackMessage(s,i.Z15):(this.processSuccessResponseForMetaBody(s),s)}))}sync(e,t,n,r,s){return c(this,void 0,void 0,(function*(){const a=this.preprocessingError();if(a)return a;const l=this.getSyncHttpRequest(e,t,n,r,s),c=yield this.httpService.runHttp(l);return(0,o.isErrorResponse)(c)?(this.preprocessAuthenticatedErrorResponse(c),this.errorResponseWithFallbackMessage(c,i.gEn)):(this.processSuccessResponseForMetaBody(c),c)}))}getSyncHttpRequest(e,t,n,i,s){const l=a.n.v1.sync,c=this.params({[o.ApiEndpointParam.SyncPayloads]:e,[o.ApiEndpointParam.LastSyncToken]:t,[o.ApiEndpointParam.PaginationToken]:n,[o.ApiEndpointParam.SyncDlLimit]:i,[o.ApiEndpointParam.SharedVaultUuids]:s});return{url:(0,r.joinPaths)(this.host,l),params:c,verb:o.HttpVerb.Post,authentication:this.getSessionAccessToken()}}deprecatedRefreshSessionOnlyUsedInE2eTests(){return c(this,void 0,void 0,(function*(){const e=this.preprocessingError();if(e)return e;this.refreshingSession=!0;const t=this.session,n=this.params({access_token:t.accessToken.value,refresh_token:t.refreshToken.value}),r=yield this.httpService.post(a.n.v1.refreshSession,n).then((e=>c(this,void 0,void 0,(function*(){if((0,o.isErrorResponse)(e)||!e.data.session)return e;const t=s.SessionToken.create(e.data.session.access_token,e.data.session.access_expiration);if(t.isFailed())return null;const n=t.getValue(),r=s.SessionToken.create(e.data.session.refresh_token,e.data.session.refresh_expiration);if(r.isFailed())return null;const a=r.getValue(),l=s.Session.create(n,a,e.data.session.readonly_access);if(l.isFailed())return null;const c=l.getValue();return this.session=c,this.setSession(c),this.processSuccessResponseForMetaBody(e),yield this.notifyEventSync(i.Sf$.SessionRefreshed,{session:c}),e}))));return this.refreshingSession=!1,null===r?this.createErrorResponse(i.aXB,o.HttpStatusCode.BadRequest):(0,o.isErrorResponse)(r)?(this.preprocessAuthenticatedErrorResponse(r),this.errorResponseWithFallbackMessage(r,i.lO_)):r}))}getSessionsList(){return c(this,void 0,void 0,(function*(){const e=this.preprocessingError();if(e)return e;const t=a.n.v1.sessions,n=yield this.httpService.get(t,{},{authentication:this.getSessionAccessToken()});return(0,o.isErrorResponse)(n)?(this.preprocessAuthenticatedErrorResponse(n),this.errorResponseWithFallbackMessage(n,i.gEn)):(this.processSuccessResponseForMetaBody(n),n)}))}deleteSession(e){return c(this,void 0,void 0,(function*(){const t=this.preprocessingError();if(t)return t;const n=a.n.v1.session(e),r=yield this.httpService.delete(n,{uuid:e},{authentication:this.getSessionAccessToken()});return(0,o.isErrorResponse)(r)?(this.preprocessAuthenticatedErrorResponse(r),this.errorResponseWithFallbackMessage(r,i.gEn)):(this.processSuccessResponseForMetaBody(r),r)}))}tokenRefreshableRequest(e){return c(this,void 0,void 0,(function*(){const t=this.preprocessingError();if(t)return t;const n=yield this.httpService.runHttp(e);return(0,o.isErrorResponse)(n)?(this.preprocessAuthenticatedErrorResponse(n),this.errorResponseWithFallbackMessage(n,e.fallbackErrorMessage)):(this.processSuccessResponseForMetaBody(n),n)}))}listSettings(e){return c(this,void 0,void 0,(function*(){return yield this.tokenRefreshableRequest({verb:o.HttpVerb.Get,url:(0,r.joinPaths)(this.host,a.n.v1.settings(e)),fallbackErrorMessage:i.Zq2,authentication:this.getSessionAccessToken()})}))}updateSetting(e,t,n,s){return c(this,void 0,void 0,(function*(){const l={name:t,value:n,sensitive:s};return this.tokenRefreshableRequest({verb:o.HttpVerb.Put,url:(0,r.joinPaths)(this.host,a.n.v1.settings(e)),authentication:this.getSessionAccessToken(),fallbackErrorMessage:i.oBV,params:l})}))}getSetting(e,t){return c(this,void 0,void 0,(function*(){return yield this.tokenRefreshableRequest({verb:o.HttpVerb.Get,url:(0,r.joinPaths)(this.host,a.n.v1.setting(e,t.toLowerCase())),authentication:this.getSessionAccessToken(),fallbackErrorMessage:i.Zq2})}))}getSubscriptionSetting(e,t){return c(this,void 0,void 0,(function*(){return yield this.tokenRefreshableRequest({verb:o.HttpVerb.Get,url:(0,r.joinPaths)(this.host,a.n.v1.subscriptionSetting(e,t.toLowerCase())),authentication:this.getSessionAccessToken(),fallbackErrorMessage:i.Zq2})}))}updateSubscriptionSetting(e,t,n,s){return c(this,void 0,void 0,(function*(){const l={name:t,value:n,sensitive:s};return this.tokenRefreshableRequest({verb:o.HttpVerb.Put,url:(0,r.joinPaths)(this.host,a.n.v1.subscriptionSettings(e)),authentication:this.getSessionAccessToken(),fallbackErrorMessage:i.oBV,params:l})}))}deleteSetting(e,t){return c(this,void 0,void 0,(function*(){return this.tokenRefreshableRequest({verb:o.HttpVerb.Delete,url:(0,r.joinPaths)(this.host,a.n.v1.setting(e,t)),authentication:this.getSessionAccessToken(),fallbackErrorMessage:i.oBV})}))}downloadFeatureUrl(e){return this.request({verb:o.HttpVerb.Get,url:e,external:!0,fallbackErrorMessage:i.VpG})}getNewSubscriptionToken(){return c(this,void 0,void 0,(function*(){const e=(0,r.joinPaths)(this.host,a.n.v1.subscriptionTokens),t=yield this.request({verb:o.HttpVerb.Post,url:e,authentication:this.getSessionAccessToken(),fallbackErrorMessage:i.gQA});if(!(0,o.isErrorResponse)(t))return t.data.token}))}downloadOfflineFeaturesFromRepo(e){return c(this,void 0,void 0,(function*(){try{const t=e.repo.offlineFeaturesUrl,n=e.repo.offlineKey;if(!t||!n)throw Error("Cannot download offline repo without url and offlineKEy");const r=["api.standardnotes.com","localhost"],{hostname:s}=new URL(t);if(!r.includes(s))return new o.ClientDisplayableError("The offline features host ".concat(s," is not in the trusted allowlist."));const a=yield this.request({verb:o.HttpVerb.Get,url:t,fallbackErrorMessage:i.WZ6,customHeaders:[{key:"x-offline-token",value:n}]});if((0,o.isErrorResponse)(a))return o.ClientDisplayableError.FromNetworkError(a);const l=a.data;return{features:(null==l?void 0:l.features)||[],roles:(null==l?void 0:l.roles)||[]}}catch(e){return new o.ClientDisplayableError(i.iMd)}}))}registerForListedAccount(){return c(this,void 0,void 0,(function*(){if(!this.user)throw Error("Cannot register for Listed without user account.");return this.tokenRefreshableRequest({verb:o.HttpVerb.Post,url:(0,r.joinPaths)(this.host,a.n.v1.listedRegistration(this.user.uuid)),fallbackErrorMessage:i.EaW,authentication:this.getSessionAccessToken()})}))}createUserFileValetToken(e,t,n){var s,l,u,d,h,p;return c(this,void 0,void 0,(function*(){const c=(0,r.joinPaths)(this.host,a.n.v1.createUserFileValetToken),f={operation:t,resources:[{remoteIdentifier:e,unencryptedFileSize:n||0}]},g=yield this.tokenRefreshableRequest({verb:o.HttpVerb.Post,url:c,authentication:this.getSessionAccessToken(),fallbackErrorMessage:i.qIx,params:f});return(0,o.isErrorResponse)(g)?new o.ClientDisplayableError(null===(l=null===(s=g.data)||void 0===s?void 0:s.error)||void 0===l?void 0:l.message):(null===(u=g.data)||void 0===u?void 0:u.success)?null===(p=g.data)||void 0===p?void 0:p.valetToken:new o.ClientDisplayableError(null===(d=g.data)||void 0===d?void 0:d.reason,void 0,null===(h=g.data)||void 0===h?void 0:h.reason)}))}startUploadSession(e,t){return c(this,void 0,void 0,(function*(){const n=(0,r.joinPaths)(this.getFilesHost(),"user"===t?a.n.v1.startUploadSession:a.n.v1.startSharedVaultUploadSession);return this.tokenRefreshableRequest({verb:o.HttpVerb.Post,url:n,customHeaders:[{key:"x-valet-token",value:e}],fallbackErrorMessage:l.e.Network.Files.FailedStartUploadSession})}))}deleteFile(e,t){return c(this,void 0,void 0,(function*(){const n=(0,r.joinPaths)(this.getFilesHost(),"user"===t?a.n.v1.deleteFile:a.n.v1.deleteSharedVaultFile);return this.tokenRefreshableRequest({verb:o.HttpVerb.Delete,url:n,customHeaders:[{key:"x-valet-token",value:e}],fallbackErrorMessage:l.e.Network.Files.FailedDeleteFile})}))}uploadFileBytes(e,t,n,i){return c(this,void 0,void 0,(function*(){if(0===n)throw Error("chunkId must start with 1");const s=(0,r.joinPaths)(this.getFilesHost(),"user"===t?a.n.v1.uploadFileChunk:a.n.v1.uploadSharedVaultFileChunk),c=yield this.tokenRefreshableRequest({verb:o.HttpVerb.Post,url:s,rawBytes:i,customHeaders:[{key:"x-valet-token",value:e},{key:"x-chunk-id",value:n.toString()},{key:"Content-Type",value:"application/octet-stream"}],fallbackErrorMessage:l.e.Network.Files.FailedUploadFileChunk});return!(0,o.isErrorResponse)(c)&&c.data.success}))}closeUploadSession(e,t){return c(this,void 0,void 0,(function*(){const n=(0,r.joinPaths)(this.getFilesHost(),"user"===t?a.n.v1.closeUploadSession:a.n.v1.closeSharedVaultUploadSession),i=yield this.tokenRefreshableRequest({verb:o.HttpVerb.Post,url:n,customHeaders:[{key:"x-valet-token",value:e}],fallbackErrorMessage:l.e.Network.Files.FailedCloseUploadSession});return!(0,o.isErrorResponse)(i)&&i.data.success}))}moveFile(e){return c(this,void 0,void 0,(function*(){const t=(0,r.joinPaths)(this.getFilesHost(),a.n.v1.moveFile),n=yield this.tokenRefreshableRequest({verb:o.HttpVerb.Post,url:t,customHeaders:[{key:"x-valet-token",value:e}],fallbackErrorMessage:l.e.Network.Files.FailedCloseUploadSession});return!(0,o.isErrorResponse)(n)&&n.data.success}))}getFilesDownloadUrl(e){if("user"===e)return(0,r.joinPaths)(this.getFilesHost(),a.n.v1.downloadFileChunk);if("shared-vault"===e)return(0,r.joinPaths)(this.getFilesHost(),a.n.v1.downloadSharedVaultFileChunk);throw Error("Invalid download type")}downloadFile(e){let{file:t,chunkIndex:n,valetToken:r,ownershipType:i,contentRangeStart:s,onBytesReceived:a}=e;var u,d;return c(this,void 0,void 0,(function*(){const e=this.getFilesDownloadUrl(i),c=t.encryptedChunkSizes[n],h={verb:o.HttpVerb.Get,url:e,customHeaders:[{key:"x-valet-token",value:r},{key:"x-chunk-size",value:c.toString()},{key:"range",value:"bytes=".concat(s,"-")}],responseType:"arraybuffer"},p=yield this.tokenRefreshableRequest(Object.assign(Object.assign({},h),{fallbackErrorMessage:l.e.Network.Files.FailedDownloadFileChunk}));if((0,o.isErrorResponse)(p))return new o.ClientDisplayableError(null===(d=null===(u=p.data)||void 0===u?void 0:u.error)||void 0===d?void 0:d.message);const f=p.headers.get("content-range");if(!f)return new o.ClientDisplayableError("Could not obtain content-range header while downloading file chunk");const g=f.match(/(^[a-zA-Z][\w]*)\s+(\d+)\s?-\s?(\d+)?\s?\/?\s?(\d+|\*)?/);if(!g||5!==g.length)return new o.ClientDisplayableError("Malformed content-range header in response when downloading file chunk");const m=+g[2],y=+g[3],v=+g[4],A=new Uint8Array(p.data);return yield a(A),y<v-1?this.downloadFile({file:t,chunkIndex:++n,valetToken:r,ownershipType:i,contentRangeStart:m+c,onBytesReceived:a}):void 0}))}checkIntegrity(e){return c(this,void 0,void 0,(function*(){return this.tokenRefreshableRequest({verb:o.HttpVerb.Post,url:(0,r.joinPaths)(this.host,a.n.v1.checkIntegrity),params:{integrityPayloads:e},fallbackErrorMessage:i.oe5,authentication:this.getSessionAccessToken()})}))}getSingleItem(e){return c(this,void 0,void 0,(function*(){return this.tokenRefreshableRequest({verb:o.HttpVerb.Get,url:(0,r.joinPaths)(this.host,a.n.v1.getSingleItem(e)),fallbackErrorMessage:i.TwN,authentication:this.getSessionAccessToken()})}))}preprocessingError(){return this.refreshingSession?this.createErrorResponse(i.z6z,o.HttpStatusCode.BadRequest):this.session?void 0:this.createErrorResponse(i.aXB,o.HttpStatusCode.BadRequest)}preprocessAuthenticatedErrorResponse(e){var t,n;this.session&&(e.status!==o.HttpStatusCode.Unauthorized&&e.status!==o.HttpStatusCode.ExpiredAccessToken||null===(t=this.invalidSessionObserver)||void 0===t||t.call(this,(null===(n=e.data.error)||void 0===n?void 0:n.tag)===o.ErrorTag.RevokedSession))}getSessionAccessToken(){if(this.session)return this.session instanceof s.Session?this.session.accessToken.value:this.session.accessToken}getCaptchaUrl(){return this.httpService.get(a.n.v1.meta)}}},78734:(e,t,n)=>{n.d(t,{q:()=>c});var r=n(95658),i=n(87901),o=n(94986),s=n(55668),a=n(22325),l=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class c extends s.wcN{constructor(e,t,n){super(n),this.environment=e,this.appVersion=t,this.internalEventBus=n}getAbsolute(e,t,n){return l(this,void 0,void 0,(function*(){return this.runHttp({url:e,params:t,verb:r.HttpVerb.Get,authentication:n})}))}postAbsolute(e,t,n){return l(this,void 0,void 0,(function*(){return this.runHttp({url:e,params:t,verb:r.HttpVerb.Post,authentication:n})}))}putAbsolute(e,t,n){return l(this,void 0,void 0,(function*(){return this.runHttp({url:e,params:t,verb:r.HttpVerb.Put,authentication:n})}))}patchAbsolute(e,t,n){return l(this,void 0,void 0,(function*(){return this.runHttp({url:e,params:t,verb:r.HttpVerb.Patch,authentication:n})}))}deleteAbsolute(e,t,n){return l(this,void 0,void 0,(function*(){return this.runHttp({url:e,params:t,verb:r.HttpVerb.Delete,authentication:n})}))}runHttp(e){return l(this,void 0,void 0,(function*(){const t=this.createXmlRequest(e);return this.runRequest(t,this.createRequestBody(e))}))}createRequestBody(e){return void 0!==e.params&&[r.HttpVerb.Post,r.HttpVerb.Put,r.HttpVerb.Patch,r.HttpVerb.Delete].includes(e.verb)?JSON.stringify(e.params):e.rawBytes}createXmlRequest(e){var t;const n=new XMLHttpRequest;if(e.params&&e.verb===r.HttpVerb.Get&&Object.keys(e.params).length>0&&(e.url=this.urlForUrlAndParams(e.url,e.params)),n.open(e.verb,e.url,!0),n.responseType=null!==(t=e.responseType)&&void 0!==t?t:"",!e.external){n.setRequestHeader("X-SNJS-Version",o.in);const t="".concat(a.Environment[this.environment],"-").concat(this.appVersion);n.setRequestHeader("X-Application-Version",t),e.authentication&&n.setRequestHeader("Authorization","Bearer "+e.authentication)}let i=!1;return e.customHeaders&&e.customHeaders.length>0&&e.customHeaders.forEach((e=>{let{key:t,value:r}=e;n.setRequestHeader(t,r),"Content-Type"===t&&(i=!0)})),i||e.external||n.setRequestHeader("Content-Type","application/json"),n}runRequest(e,t){return l(this,void 0,void 0,(function*(){return new Promise(((n,r)=>{e.onreadystatechange=()=>{this.stateChangeHandlerForRequest(e,n,r)},e.send(t)}))}))}stateChangeHandlerForRequest(e,t,n){var o,a,l;if(4!==e.readyState)return;const c=e.status,u={status:c,headers:new Map},d=null===(o=e.getAllResponseHeaders())||void 0===o?void 0:o.trim().split(/[\r\n]+/);null==d||d.forEach((e=>{const t=e.split(": "),n=t.shift(),r=t.join(": ");u.headers.set(n,r)}));try{if(c!==r.DeprecatedStatusCode.HttpStatusNoContent){let t;const n=(null===(a=u.headers)||void 0===a?void 0:a.get("content-type"))||(null===(l=u.headers)||void 0===l?void 0:l.get("Content-Type"));t=(null==n?void 0:n.includes("application/json"))?JSON.parse(e.responseText):e.response,t.data||(u.data=t),(0,i.isString)(t)||Object.assign(u,t)}}catch(e){console.error(e)}if(c>=r.DeprecatedStatusCode.HttpStatusMinSuccess&&c<=r.DeprecatedStatusCode.HttpStatusMaxSuccess)t(u);else{if(c===r.DeprecatedStatusCode.HttpStatusForbidden)u.error={message:s.jN7,status:c};else if(null==u.error)if(null==u.data||null==u.data.error)try{u.error={message:e.responseText||s.I4j,status:c}}catch(e){u.error={message:s.I4j,status:c}}else u.error=u.data.error;n(u)}}urlForUrlAndParams(e,t){const n=Object.keys(t).map((e=>e+"="+encodeURIComponent(t[e]))).join("&");return e.includes("?")?e+"&"+n:e+"?"+n}}},98361:(e,t,n)=>{n.d(t,{n:()=>r});const r={v1:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},{closeUploadSession:"/v1/files/upload/close-session",createUserFileValetToken:"/v1/files/valet-tokens",deleteFile:"/v1/files",downloadFileChunk:"/v1/files",downloadVaultFileChunk:"/v1/vaults/files",startUploadSession:"/v1/files/upload/create-session",uploadFileChunk:"/v1/files/upload/chunk"}),{closeSharedVaultUploadSession:"/v1/shared-vault/files/upload/close-session",deleteSharedVaultFile:"/v1/shared-vault/files",downloadSharedVaultFileChunk:"/v1/shared-vault/files",startSharedVaultUploadSession:"/v1/shared-vault/files/upload/create-session",uploadSharedVaultFileChunk:"/v1/shared-vault/files/upload/chunk",moveFile:"/v1/shared-vault/files/move"}),{checkIntegrity:"/v1/items/check-integrity",getSingleItem:e=>"/v1/items/".concat(e),itemRevisions:e=>"/v1/items/".concat(e,"/revisions"),itemRevision:(e,t)=>"/v1/items/".concat(e,"/revisions/").concat(t),sync:"/v1/items"}),{listedRegistration:e=>"/v1/users/".concat(e,"/integrations/listed")}),{settings:e=>"/v1/users/".concat(e,"/settings"),setting:(e,t)=>"/v1/users/".concat(e,"/settings/").concat(t),subscriptionSetting:(e,t)=>"/v1/users/".concat(e,"/subscription-settings/").concat(t),subscriptionSettings:e=>"/v1/users/".concat(e,"/subscription-settings")}),{offlineFeatures:"/v1/offline/features",purchase:"/v1/purchase",subscription:e=>"/v1/users/".concat(e,"/subscription"),subscriptionTokens:"/v1/subscription-tokens"}),{changeCredentials:e=>"/v1/users/".concat(e,"/attributes/credentials"),deleteAccount:e=>"/v1/users/".concat(e),keyParams:"/v1/login-params",refreshSession:"/v1/sessions/refresh",register:"/v1/users",session:e=>"/v1/sessions/".concat(e),sessions:"/v1/sessions",signIn:"/v1/login",signOut:"/v1/logout"}),{meta:"/v1/meta"}),v2:Object.assign({},{keyParams:"/v2/login-params",signIn:"/v2/login"})}},68625:(e,t,n)=>{n.d(t,{n:()=>o});var r=n(59472),i=n(87901);class o{constructor(e,t,n,r,i,o){this.challenge=e,this.onValidValue=t,this.onInvalidValue=n,this.onNonvalidatedSubmit=r,this.onComplete=i,this.onCancel=o,this.nonvalidatedValues=[],this.validValues=[],this.invalidValues=[],this.artifacts={}}deinit(){this.challenge=void 0,this.onValidValue=void 0,this.onInvalidValue=void 0,this.onNonvalidatedSubmit=void 0,this.onComplete=void 0,this.onCancel=void 0,this.nonvalidatedValues=void 0,this.validValues=void 0,this.invalidValues=void 0,this.artifacts=void 0}complete(e){var t;e||(e=new r.a(this.challenge,this.validValues,this.artifacts)),null===(t=this.onComplete)||void 0===t||t.call(this,e)}nonvalidatedSubmit(){var e;const t=new r.a(this.challenge,this.nonvalidatedValues.slice(),this.artifacts);null===(e=this.onNonvalidatedSubmit)||void 0===e||e.call(this,t),this.nonvalidatedValues=[]}cancel(){var e;null===(e=this.onCancel)||void 0===e||e.call(this)}isFinished(){return this.validValues.length===this.challenge.prompts.length}nonvalidatedPrompts(){return this.challenge.prompts.filter((e=>!e.validates))}addNonvalidatedValue(e){const t=this.nonvalidatedValues,n=t.find((t=>t.prompt.id===e.prompt.id));n&&(0,i.removeFromArray)(t,n),t.push(e),this.nonvalidatedValues.length===this.nonvalidatedPrompts().length&&this.nonvalidatedSubmit()}setValueStatus(e,t,n){var r,o;const s=t?this.validValues:this.invalidValues,a=s.find((t=>t.prompt.validation===e.prompt.validation));a&&(0,i.removeFromArray)(s,a),s.push(e),Object.assign(this.artifacts,n),this.isFinished()?this.complete():t?null===(r=this.onValidValue)||void 0===r||r.call(this,e):null===(o=this.onInvalidValue)||void 0===o||o.call(this,e)}}},59472:(e,t,n)=>{n.d(t,{a:()=>i});var r=n(87901);class i{constructor(e,t,n){this.challenge=e,this.values=t,this.artifacts=n,Object.freeze(this)}getValueForType(e){const t=this.values.find((t=>t.prompt.validation===e));if((0,r.isNullOrUndefined)(t))throw Error("Could not find value for validation type "+e);return t}getDefaultValue(){if(this.values.length>1)throw Error("Attempting to retrieve default response value when more than one value exists");return this.values[0]}}},40278:(e,t,n)=>{n.d(t,{P:()=>c});var r=n(87901),i=n(17956),o=n(55668),s=n(68625),a=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};const l=e=>{e.onCancel=void 0,e.onComplete=void 0,e.onValidValue=void 0,e.onInvalidValue=void 0,e.onNonvalidatedSubmit=void 0};class c extends o.wcN{constructor(e,t,n){super(n),this.storageService=e,this.encryptionService=t,this.internalEventBus=n,this.challengeOperations={},this.challengeObservers={}}deinit(){this.storageService=void 0,this.encryptionService=void 0,this.sendChallenge=void 0,this.challengeOperations=void 0,this.challengeObservers=void 0,super.deinit()}promptForChallengeResponse(e){return new Promise((t=>{this.createOrGetChallengeOperation(e,t),this.sendChallenge(e)}))}createChallenge(e,t,n,r,i){return new o.tv4(e,t,n,r,i)}validateChallengeValue(e){return a(this,void 0,void 0,(function*(){switch(e.prompt.validation){case o.tQn.LocalPasscode:return this.encryptionService.validatePasscode(e.value);case o.tQn.AccountPassword:return this.encryptionService.validateAccountPassword(e.value);case o.tQn.Biometric:return{valid:!0===e.value};case o.tQn.Authenticator:return{valid:"id"in e.value};case o.tQn.ProtectionSessionDuration:return{valid:(0,i.z)(e.value)};default:throw Error("Unhandled validation mode ".concat(e.prompt.validation))}}))}promptForCorrectPasscode(e){return a(this,void 0,void 0,(function*(){const t=new o.tv4([new o.FEo(o.tQn.LocalPasscode)],e,!0),n=yield this.promptForChallengeResponse(t);if(n)return n.getValueForType(o.tQn.LocalPasscode).value}))}promptForAccountPassword(){var e;return a(this,void 0,void 0,(function*(){if(!this.encryptionService.hasAccount())throw Error("Requiring account password for challenge with no account");const t=yield this.promptForChallengeResponse(new o.tv4([new o.FEo(o.tQn.AccountPassword)],o.Ps8.Custom,!0,o.NiJ.EnterAccountPassword));return null===(e=null==t?void 0:t.getValueForType(o.tQn.AccountPassword))||void 0===e?void 0:e.value}))}getWrappingKeyIfApplicable(e){return a(this,void 0,void 0,(function*(){return this.encryptionService.hasPasscode()?e||(e=yield this.promptForCorrectPasscode(o.Ps8.ResaveRootKey))?{wrappingKey:yield this.encryptionService.computeWrappingKey(e)}:{canceled:!0}:{}}))}addChallengeObserver(e,t){const n=this.challengeObservers[e.id]||[];return n.push(t),this.challengeObservers[e.id]=n,()=>{l(t),(0,r.removeFromArray)(n,t)}}createOrGetChallengeOperation(e,t){let n=this.getChallengeOperation(e);return n||(n=new s.n(e,(t=>{this.onChallengeValidValue(e,t)}),(t=>{this.onChallengeInvalidValue(e,t)}),(n=>{this.onChallengeNonvalidatedSubmit(e,n),t(n)}),(n=>{this.onChallengeComplete(e,n),t(n)}),(()=>{this.onChallengeCancel(e),t(void 0)})),this.challengeOperations[e.id]=n),n}performOnObservers(e,t){const n=this.challengeObservers[e.id]||[];for(const e of n)t(e)}onChallengeValidValue(e,t){this.performOnObservers(e,(e=>{var n;null===(n=e.onValidValue)||void 0===n||n.call(e,t)}))}onChallengeInvalidValue(e,t){this.performOnObservers(e,(e=>{var n;null===(n=e.onInvalidValue)||void 0===n||n.call(e,t)}))}onChallengeNonvalidatedSubmit(e,t){this.performOnObservers(e,(e=>{var n;null===(n=e.onNonvalidatedSubmit)||void 0===n||n.call(e,t)}))}onChallengeComplete(e,t){this.performOnObservers(e,(e=>{var n;null===(n=e.onComplete)||void 0===n||n.call(e,t)}))}onChallengeCancel(e){this.performOnObservers(e,(e=>{var t;null===(t=e.onCancel)||void 0===t||t.call(e)}))}getChallengeOperation(e){return this.challengeOperations[e.id]}deleteChallengeOperation(e){const t=e.challenge;t.customHandler=void 0,e.deinit(),delete this.challengeOperations[t.id]}cancelChallenge(e){const t=this.challengeOperations[e.id];t.cancel(),this.deleteChallengeOperation(t)}completeChallenge(e){const t=this.challengeOperations[e.id];t.complete(),this.deleteChallengeOperation(t)}submitValuesForChallenge(e,t){return a(this,void 0,void 0,(function*(){if(0===t.length)throw Error("Attempting to submit 0 values for challenge");for(const n of t)if(n.prompt.validates){const{valid:t,artifacts:r}=yield this.validateChallengeValue(n);this.setValidationStatusForChallenge(e,n,t,r)}else this.getChallengeOperation(e).addNonvalidatedValue(n)}))}setValidationStatusForChallenge(e,t,n,r){const i=this.getChallengeOperation(e);if(i.setValueStatus(t,n,r),i.isFinished()){this.deleteChallengeOperation(i);const t=this.challengeObservers[e.id]||[];t.forEach(l),t.length=0,delete this.challengeObservers[e.id]}}}},74987:(e,t,n)=>{n.d(t,{y:()=>b});var r=n(82648),i=n(22325),o=n(80215),s=n(87901),a=n(56297),l=n(55668);const c="localhost";class u{constructor(e,t,n){this.desktopManager=e,this.environment=t,this.platform=n}execute(e){if(this.desktopManager)return this.urlForFeatureOnDesktop(e);if(e.isNativeFeature)return this.urlForNativeComponent(e.featureDescription.identifier,e.featureDescription.index_path);if(e.asComponent.offlineOnly)return;const t=e.asComponent.hosted_url||e.asComponent.legacy_url;if(!t)return e.asComponent.package_info.identifier&&e.asComponent.package_info.index_path?this.urlForNativeComponent(e.asComponent.package_info.identifier,e.asComponent.package_info.index_path):void 0;if(this.isMobile){const e=this.platform===i.Platform.Ios?c:"10.0.2.2";return t.replace(c,e).replace("sn.local",e)}return t}urlForFeatureOnDesktop(e){if(!this.desktopManager)throw new Error("Desktop manager is not defined");return e.isNativeFeature?"".concat(this.desktopManager.getExtServerHost(),"/components/").concat(e.featureIdentifier,"/").concat(e.featureDescription.index_path):e.asComponent.local_url?e.asComponent.local_url.replace("sn://",this.desktopManager.getExtServerHost()+"/"):e.asComponent.hosted_url||e.asComponent.legacy_url}urlForNativeComponent(e,t){if(this.isMobile){const n=window.location.href.split("/index.html")[0];return"".concat(n,"/web-src/components/assets/").concat(e,"/").concat(t)}{const n=window.location.origin;return"".concat(n,"/components/assets/").concat(e,"/").concat(t)}}get isMobile(){return this.environment===i.Environment.Mobile}}var d;!function(e){e.ViewerDidFocus="ViewerDidFocus"}(d||(d={}));var h=n(20549);function p(e,t){if(0===e.length)return".";let n=[],i=[];return e.forEach((e=>{switch(e.name){case o.ComponentAction.StreamItems:if(!e.content_types)return;e.content_types.forEach((e=>{const t=r.ContentType.create(e);if(t.isFailed())return;const i=t.getValue(),o=i.getDisplayName();o?n.push("".concat(o,"s")):n.push("items of type ".concat(i.value))}));break;case o.ComponentAction.StreamContextItem:{const e={[o.ComponentArea.EditorStack]:"working note",[o.ComponentArea.Editor]:"working note",[o.ComponentArea.Themes]:"Unknown"};i.push(e[t.area])}}})),n=(0,s.uniqueArray)(n),i=(0,s.uniqueArray)(i),0===n.length&&0===i.length?".":n.concat(i).join(", ")+"."}var f=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class g{constructor(e,t,n,r,i){this.permissionDialogUIHandler=e,this.alerts=t,this.mutator=n,this.sync=r,this.items=i,this.permissionDialogs=[],this.pendingErrorAlerts=new Set}deinit(){this.permissionDialogs=[],this.permissionDialogUIHandler=void 0,this.alerts=void 0,this.mutator=void 0,this.sync=void 0,this.items=void 0}execute(e,t,n){const r=this.findUIFeature(e);if(!r)return void(this.pendingErrorAlerts.has(e)||(this.pendingErrorAlerts.add(e),this.alerts.alert("Unable to find component with ID ".concat(e,". Please restart the app and try again."),"An unexpected error occurred").then((()=>{this.pendingErrorAlerts.delete(e)}))));if(r.isNativeFeature)return void n();if(!this.areRequestedPermissionsValid(r,t))return void console.error("Component is requesting invalid permissions",e,t);const i=r.acquiredPermissions;t=(0,s.Copy)(t);for(const e of t.slice()){const n=i.find((t=>t.name===e.name));if(!n)continue;const r=e.content_types;if(r){for(const e of n.content_types)(0,s.removeFromArray)(r,e);0===r.length&&(0,s.filterFromArray)(t,e)}else(0,s.filterFromArray)(t,e)}t.length>0?this.promptForPermissionsWithDeferredRendering(r.asComponent,t,(e=>f(this,void 0,void 0,(function*(){e&&n()})))):n()}setPermissionDialogUIHandler(e){this.permissionDialogUIHandler=e}areRequestedPermissionsValid(e,t){var n;for(const r of t)if(r.name===o.ComponentAction.StreamItems){if(!h.h6.includes(e.featureIdentifier))return!1;if(null===(n=r.content_types)||void 0===n?void 0:n.some((e=>!h.Jg.includes(e))))return!1}return!0}promptForPermissionsWithDeferredRendering(e,t,n){setTimeout((()=>{this.promptForPermissions(e,t,n)}))}promptForPermissions(e,t,n){const r={component:e,permissions:t,permissionsString:p(t,e),actionBlock:n,callback:n=>f(this,void 0,void 0,(function*(){const i=this.items.findItem(e.uuid);if(i){if(n){const n=(0,s.Copy)(i.permissions);for(const e of t){const t=n.find((t=>t.name===e.name));if(t){const n=t.content_types||[];t.content_types=(0,s.uniqueArray)(n.concat(e.content_types))}else n.push(e)}yield this.mutator.changeItem(e,(e=>{e.permissions=n})),this.sync.sync()}this.permissionDialogs=this.permissionDialogs.filter((i=>{return i===r?(i.actionBlock&&i.actionBlock(n),!1):!!(i.component!==e||i.permissions!==t&&(o=t,i.permissions.some((e=>!o.find((t=>JSON.stringify(t)===JSON.stringify(e)))))))||(n&&i.actionBlock&&i.actionBlock(n),!1);var o})),this.permissionDialogs.length>0&&this.permissionDialogUIHandler(this.permissionDialogs[0])}}))},i=this.permissionDialogs.find((t=>t.component===e));this.permissionDialogs.push(r),i||this.permissionDialogUIHandler(r)}findUIFeature(e){const t=(0,o.FindNativeFeature)(e);if(t)return new i.UIFeature(t);const n=this.items.findItem(e);return n?new i.UIFeature(n):void 0}}class m{constructor(e){this.items=e}execute(e){if(e.noteType===o.NoteType.Plain)return new i.UIFeature((0,o.GetPlainNoteFeature)());if(e.noteType===o.NoteType.Super)return new i.UIFeature((0,o.GetSuperNoteFeature)());if(e.editorIdentifier){const t=this.componentOrNativeFeatureForIdentifier(e.editorIdentifier);if(t)return t}if(e.noteType&&e.noteType!==o.NoteType.Unknown){const t=this.nativeEditorForNoteType(e.noteType);if(t)return new i.UIFeature(t)}const t=this.legacyGetEditorForNote(e);return t?new i.UIFeature(t):new i.UIFeature((0,o.GetPlainNoteFeature)())}componentOrNativeFeatureForIdentifier(e){const t=(0,o.FindNativeFeature)(e);if(t)return new i.UIFeature(t);const n=this.items.getDisplayableComponents().find((t=>t.identifier===e));return n?new i.UIFeature(n):void 0}nativeEditorForNoteType(e){return(0,o.GetIframeAndNativeEditors)().find((t=>t.note_type===e))}legacyGetEditorForNote(e){const t=this.thirdPartyComponentsForArea(o.ComponentArea.Editor);for(const n of t)if(n.isExplicitlyEnabledForItem(e.uuid))return n;const n=this.legacyGetDefaultEditor();return n&&!n.isExplicitlyDisabledForItem(e.uuid)?n:void 0}legacyGetDefaultEditor(){return this.thirdPartyComponentsForArea(o.ComponentArea.Editor).filter((e=>e.legacyIsDefaultEditor()))[0]}thirdPartyComponentsForArea(e){return this.items.getDisplayableComponents().filter((t=>t.area===e))}}class y{constructor(e,t){this.preferences=e,this.items=t}execute(e){var t;if(e){const n=null===(t=null==e?void 0:e.preferences)||void 0===t?void 0:t.editorIdentifier;if(n)return r.Result.ok(n)}const n=this.preferences.getValue(i.PrefKey.DefaultEditorIdentifier);if(n)return r.Result.ok(n);const s=this.thirdPartyComponentsForArea(o.ComponentArea.Editor).filter((e=>e.legacyIsDefaultEditor()))[0];return s?r.Result.ok(s.identifier):r.Result.ok(o.NativeFeatureIdentifier.TYPES.PlainEditor)}thirdPartyComponentsForArea(e){return this.items.getDisplayableComponents().filter((t=>t.area===e))}}class v{execute(e,t){if(!e||!t)return!1;const n=e.fileType,r=t.fileType;return!("md"===n||"md"===r||"html"===n&&"html"===r)}}var A=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class b extends l.wcN{constructor(e,t,n,r,i,o,s,a,c,u,h){super(h),this.items=e,this.mutator=t,this.sync=n,this.features=r,this.preferences=i,this.alerts=o,this.environment=s,this.platform=a,this.device=c,this.logger=u,this.internalEventBus=h,this.viewers=[],this.permissionDialogUIHandler=()=>{throw"Must call setPermissionDialogUIHandler"},this.runWithPermissionsUseCase=new g(this.permissionDialogUIHandler,this.alerts,this.mutator,this.sync,this.items),this.detectFocusChange=()=>{const e=Array.from(document.getElementsByTagName("iframe"));for(const t of e)if(document.activeElement===t)return void setTimeout((()=>{const e=this.findComponentViewer(t.dataset.componentViewerId);this.notifyEvent(d.ViewerDidFocus,{componentViewer:e})}))},this.onWindowMessage=e=>{var t;const n=e.data;n.sessionKey&&(this.logger.info("Component manager received message",n),null===(t=this.componentViewerForSessionKey(n.sessionKey))||void 0===t||t.handleMessage(n))},this.loggingEnabled=!1,this.addSyncedComponentItemObserver(),this.registerMobileNativeComponentUrls(),this.registerDeprecatedEditorUrlsForAndroid(),this.eventDisposers.push(i.addEventObserver((e=>{e===l.WZd.PreferencesChanged&&this.postActiveThemesToAllViewers()}))),window.addEventListener?window.addEventListener("focus",this.detectFocusChange,!0):window.attachEvent("onfocusout",this.detectFocusChange),window.addEventListener?window.addEventListener("blur",this.detectFocusChange,!0):window.attachEvent("onblur",this.detectFocusChange),window.addEventListener("message",this.onWindowMessage,!0)}deinit(){super.deinit();for(const e of this.viewers)e.destroy();this.viewers.length=0,this.runWithPermissionsUseCase.deinit(),this.desktopManager=void 0,this.items=void 0,this.features=void 0,this.sync=void 0,this.alerts=void 0,this.preferences=void 0,this.permissionDialogUIHandler=void 0,window&&(window.removeEventListener("focus",this.detectFocusChange,!0),window.removeEventListener("blur",this.detectFocusChange,!0),window.removeEventListener("message",this.onWindowMessage,!0)),this.detectFocusChange=void 0,this.onWindowMessage=void 0}setPermissionDialogUIHandler(e){this.permissionDialogUIHandler=e,this.runWithPermissionsUseCase.setPermissionDialogUIHandler(e)}thirdPartyComponentsForArea(e){return this.items.getDisplayableComponents().filter((t=>t.area===e))}createComponentViewer(e,t,n){var r;const i=new a.S(e,{items:this.items,mutator:this.mutator,sync:this.sync,alerts:this.alerts,preferences:this.preferences,features:this.features,logger:this.logger},{url:null!==(r=this.urlForFeature(e))&&void 0!==r?r:"",item:t,actionObserver:n},{environment:this.environment,platform:this.platform,componentManagerFunctions:{runWithPermissionsUseCase:this.runWithPermissionsUseCase,urlsForActiveThemes:this.urlsForActiveThemes.bind(this),setComponentPreferences:this.setComponentPreferences.bind(this),getComponentPreferences:this.getComponentPreferences.bind(this)}});return this.viewers.push(i),i}destroyComponentViewer(e){e.destroy(),(0,s.removeFromArray)(this.viewers,e)}setDesktopManager(e){this.desktopManager=e,this.configureForDesktop()}handleChangedComponents(e,t){const n=[i.PayloadEmitSource.LocalChanged,i.PayloadEmitSource.RemoteRetrieved,i.PayloadEmitSource.LocalDatabaseLoaded,i.PayloadEmitSource.LocalInserted];if(0!==e.length&&n.includes(t)){if(this.desktopManager){const t=e.filter((e=>!(0,o.FindNativeFeature)(e.identifier)));t.length>0&&this.desktopManager.syncComponentsInstallation(t)}e.filter((e=>e.isTheme())).length>0&&this.postActiveThemesToAllViewers()}}addSyncedComponentItemObserver(){this.eventDisposers.push(this.items.addObserver([r.ContentType.TYPES.Component,r.ContentType.TYPES.Theme],(e=>{let{changed:t,inserted:n,removed:r,source:i}=e;const o=[...t,...n];this.handleChangedComponents(o,i),this.updateMobileRegisteredComponentUrls(n,r)})))}updateMobileRegisteredComponentUrls(e,t){if((0,l.s2G)(this.device)){for(const t of e){const e=new i.UIFeature(t),n=this.urlForFeature(e);n&&this.device.registerComponentUrl(t.uuid,n)}for(const e of t)this.device.deregisterComponentUrl(e.uuid)}}registerMobileNativeComponentUrls(){if(!(0,l.s2G)(this.device))return;const e=[...(0,o.GetIframeEditors)(),...(0,o.GetNativeThemes)()];for(const t of e){const e=new i.UIFeature(t),n=this.urlForFeature(e);n&&this.device.registerComponentUrl(e.uniqueIdentifier.value,n)}}registerDeprecatedEditorUrlsForAndroid(){if(!(0,l.s2G)(this.device))return;const e=[...(0,o.GetDeprecatedEditors)()];for(const t of e){const e=new i.UIFeature(t),n=this.urlForFeature(e);n&&this.device.registerComponentUrl(e.uniqueIdentifier.value,n)}}configureForDesktop(){if(!this.desktopManager)throw new Error("Desktop manager is not defined");this.desktopManager.registerUpdateObserver((e=>{this.getActiveComponents().find((t=>t.uuid===e.uuid))&&e.isTheme()&&this.postActiveThemesToAllViewers()}))}postActiveThemesToAllViewers(){for(const e of this.viewers)e.postActiveThemes()}urlForFeature(e){return new u(this.desktopManager,this.environment,this.platform).execute(e)}urlsForActiveThemes(){const e=this.getActiveThemes(),t=[];for(const n of e){const e=this.urlForFeature(n);e&&t.push(e)}return t}findComponentViewer(e){return this.viewers.find((t=>t.identifier===e))}findComponentWithPackageIdentifier(e){return this.items.getDisplayableComponents().find((t=>t.identifier===e))}componentViewerForSessionKey(e){return this.viewers.find((t=>t.sessionKey===e))}toggleOtherNonLayerableThemes(e){const t=this.getActiveThemes();for(const n of t)n.featureIdentifier!==e.featureIdentifier&&(n.layerable||this.removeActiveTheme(n))}toggleTheme(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return A(this,void 0,void 0,(function*(){if(this.logger.info("Toggling theme",e.uniqueIdentifier),this.isThemeActive(e))return void this.removeActiveTheme(e);const n=this.features.getFeatureStatus(e.uniqueIdentifier);(t||n===l.iKc.Entitled)&&(this.addActiveTheme(e),e.layerable||(yield(0,s.sleep)(10),this.toggleOtherNonLayerableThemes(e)))}))}getActiveThemes(){const{features:e,uuids:t}=this.getActiveThemesIdentifiers();return[...t.map((e=>{const t=this.items.findItem(e.value);if(t)return new i.UIFeature(t)})).filter(s.isNotUndefined),...e.map((e=>(0,o.FindNativeTheme)(e.value))).filter(s.isNotUndefined).map((e=>new i.UIFeature(e)))].filter((e=>this.features.getFeatureStatus(e.uniqueIdentifier)===l.iKc.Entitled))}getActiveThemesIdentifiers(){const e=[],t=[],n=new Set(this.preferences.getLocalValue(l.dH$.ActiveThemes,[]));for(const i of n){const n=o.NativeFeatureIdentifier.create(i);n.isFailed()||e.push(n.getValue());const s=r.Uuid.create(i);s.isFailed()||t.push(s.getValue())}return{features:e,uuids:t}}toggleComponent(e){return A(this,void 0,void 0,(function*(){this.logger.info("Toggling component",e.uuid),this.isComponentActive(e)?yield this.removeActiveComponent(e):yield this.addActiveComponent(e)}))}editorForNote(e){return new m(this.items).execute(e)}getDefaultEditorIdentifier(e){return new y(this.preferences,this.items).execute(e).getValue()}doesEditorChangeRequireAlert(e,t){return(new v).execute(e,t)}showEditorChangeAlert(){return A(this,void 0,void 0,(function*(){return yield this.alerts.confirm("Doing so might result in minor formatting changes.","Are you sure you want to change this note's type?","Yes, change it")}))}setComponentPreferences(e,t){var n;return A(this,void 0,void 0,(function*(){const r=(0,s.Copy)(null!==(n=this.preferences.getValue(i.PrefKey.ComponentPreferences,void 0))&&void 0!==n?n:{});r[e.uniqueIdentifier.value]=t,yield this.preferences.setValue(i.PrefKey.ComponentPreferences,r)}))}getComponentPreferences(e){const t=this.preferences.getValue(i.PrefKey.ComponentPreferences,void 0);if(t)return t[e.uniqueIdentifier.value]}addActiveTheme(e){const t=this.preferences.getLocalValue(l.dH$.ActiveThemes,[]).slice();t.push(e.uniqueIdentifier.value),this.preferences.setLocalValue(l.dH$.ActiveThemes,t)}replaceActiveTheme(e){this.preferences.setLocalValue(l.dH$.ActiveThemes,[e.uniqueIdentifier.value])}removeActiveTheme(e){const t=this.preferences.getLocalValue(l.dH$.ActiveThemes,[]).filter((t=>t!==e.uniqueIdentifier.value));this.preferences.setLocalValue(l.dH$.ActiveThemes,t)}isThemeActive(e){return this.features.getFeatureStatus(e.uniqueIdentifier)===l.iKc.Entitled&&this.preferences.getLocalValue(l.dH$.ActiveThemes,[]).includes(e.uniqueIdentifier.value)}addActiveComponent(e){return A(this,void 0,void 0,(function*(){const t=this.preferences.getValue(i.PrefKey.ActiveComponents,[]).slice();t.push(e.uuid),yield this.preferences.setValue(i.PrefKey.ActiveComponents,t)}))}removeActiveComponent(e){var t;return A(this,void 0,void 0,(function*(){const n=(null!==(t=this.preferences.getValue(i.PrefKey.ActiveComponents,void 0))&&void 0!==t?t:[]).filter((t=>t!==e.uuid));yield this.preferences.setValue(i.PrefKey.ActiveComponents,n)}))}getActiveComponents(){var e;const t=null!==(e=this.preferences.getValue(i.PrefKey.ActiveComponents,void 0))&&void 0!==e?e:[];return this.items.findItems(t)}isComponentActive(e){var t;return(null!==(t=this.preferences.getValue(i.PrefKey.ActiveComponents,void 0))&&void 0!==t?t:[]).includes(e.uuid)}}},56297:(e,t,n)=>{n.d(t,{S:()=>d});var r=n(55668),i=n(22325),o=n(2256),s=n(20549),a=n(80215),l=n(87901),c=n(82648),u=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class d{constructor(e,t,n,o){this.componentOrFeature=e,this.services=t,this.options=n,this.config=o,this.identifier=(0,l.nonSecureRandomIdentifier)(),this.actionObservers=[],this.eventObservers=[],this.dealloced=!1,this.readonly=!1,this.lockReadonly=!1,(0,r.qr4)(n.item)&&(this.setReadonly(!0),this.lockReadonly=!0),this.removeItemObserver=this.services.items.addObserver(c.ContentType.TYPES.Any,(e=>{let{changed:t,inserted:n,removed:r,source:i,sourceKey:o}=e;if(this.dealloced)return;const s=[...t,...n,...r];this.handleChangesInItems(s,i,o)})),n.actionObserver&&this.actionObservers.push(n.actionObserver),this.removeFeaturesObserver=t.features.addEventObserver((e=>{this.dealloced||e===r.Usi.FeaturesAvailabilityChanged&&(this.postActiveThemes(),this.notifyEventObservers(i.ComponentViewerEvent.FeatureStatusUpdated))})),this.services.logger.info("Constructor",this)}getComponentOrFeatureItem(){return this.componentOrFeature}get url(){return this.options.url}get isDesktop(){return this.config.environment===i.Environment.Desktop}get isMobile(){return this.config.environment===i.Environment.Mobile}destroy(){this.services.logger.info("Destroying",this),this.deinit()}deinit(){this.dealloced=!0,this.componentOrFeature=void 0,this.services=void 0,this.config=void 0,this.options=void 0,this.eventObservers.length=0,this.actionObservers.length=0,this.removeFeaturesObserver(),this.removeFeaturesObserver=void 0,this.removeItemObserver(),this.removeItemObserver=void 0}addEventObserver(e){this.eventObservers.push(e);const t=this.eventObservers;return()=>{(0,l.removeFromArray)(t,e)}}notifyEventObservers(e){for(const t of this.eventObservers)t(e)}addActionObserver(e){this.actionObservers.push(e);const t=this.actionObservers;return()=>{(0,l.removeFromArray)(t,e)}}setReadonly(e){if(this.lockReadonly)throw Error("Attempting to set readonly on lockedReadonly component viewer");this.readonly=e}get componentUniqueIdentifier(){return this.componentOrFeature.uniqueIdentifier}getFeatureStatus(){return this.services.features.getFeatureStatus(this.componentUniqueIdentifier,{inContextOfItem:this.getContextItem()})}getContextItem(){return(0,r.qr4)(this.options.item)?this.options.item.readonlyItem:this.services.items.findItem(this.options.item.uuid)}isOfflineRestricted(){return this.componentOrFeature.isComponent&&this.componentOrFeature.asComponent.offlineOnly&&!this.isDesktop}hasUrlError(){return!(!this.componentOrFeature.isComponent||this.isDesktop&&this.componentOrFeature.asComponent.local_url||this.componentOrFeature.asComponent.hasValidHostedUrl)}shouldRender(){return null==this.getError()}getError(){return this.isOfflineRestricted()?r.kQg.OfflineRestricted:this.hasUrlError()?r.kQg.MissingUrl:void 0}updateOurComponentRefFromChangedItems(e){if(!this.componentOrFeature.isComponent)return;const t=e.find((e=>e.uuid===this.componentUniqueIdentifier.value));if(!t)return;const n=new i.UIFeature(t);this.componentOrFeature=n}handleChangesInItems(e,t,n){const o=e.filter(i.isNotEncryptedItem),s=o.filter(i.isDecryptedItem);if(this.updateOurComponentRefFromChangedItems(s),!n||n!==this.componentUniqueIdentifier.value){if(this.streamItems){const e=o.filter((e=>{var t;return null===(t=this.streamItems)||void 0===t?void 0:t.includes(e.content_type)}));e.length>0&&this.sendManyItemsThroughBridge(e)}if(this.streamContextItemOriginalMessage){const e=this.options.item;if((0,r.qr4)(e))return;const n=s.find((t=>t.uuid===e.uuid));n&&this.sendContextItemThroughBridge(n,t)}}}sendManyItemsThroughBridge(e){var t;const n=[{name:a.ComponentAction.StreamItems,content_types:null===(t=this.streamItems)||void 0===t?void 0:t.sort()}];this.config.componentManagerFunctions.runWithPermissionsUseCase.execute(this.componentUniqueIdentifier.value,n,(()=>{this.sendItemsInReply(e,this.streamItemsOriginalMessage)}))}sendContextItemThroughBridge(e,t){const n=[{name:a.ComponentAction.StreamContextItem}];this.config.componentManagerFunctions.runWithPermissionsUseCase.execute(this.componentUniqueIdentifier.value,n,(()=>{this.services.logger.info("Send context item in reply","component:",this.componentOrFeature,"item: ",e,"originalMessage: ",this.streamContextItemOriginalMessage);const n={item:this.jsonForItem(e,t)};this.replyToMessage(this.streamContextItemOriginalMessage,n)}))}sendItemsInReply(e,t,n){this.services.logger.info("Send items in reply",this.componentOrFeature,e,t);const r={},i=e.map((e=>this.jsonForItem(e,n)));r.items=i,this.replyToMessage(t,r)}jsonForItem(e,t){const n=t===i.PayloadEmitSource.RemoteSaved||t===i.PayloadEmitSource.OfflineSyncSaved||t===i.PayloadEmitSource.PreSyncSave,r={uuid:e.uuid,content_type:e.content_type,created_at:e.created_at,updated_at:e.serverUpdatedAt,isMetadataUpdate:n};return(0,i.isDecryptedItem)(e)?(r.content=this.contentForItem(e),r.clientData=this.getClientData(e)):r.deleted=!0,this.responseItemsByRemovingPrivateProperties([r])[0]}getClientData(e){return(e.getDomainData(i.ComponentDataDomain)||{})[this.componentUniqueIdentifier.value]||{}}contentForItem(e){if((0,i.isNote)(e)){const t=e.content,n=null!=e.spellcheck?e.spellcheck:this.services.preferences.getValue(i.PrefKey.EditorSpellcheck,!0);return Object.assign(Object.assign({},t),{spellcheck:n})}return e.content}replyToMessage(e,t){const n={action:a.ComponentAction.Reply,original:e,data:t};this.sendMessage(n)}sendMessage(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.window||e.action!==a.ComponentAction.Reply?(this.services.logger.info("Send message to component",this.componentOrFeature,"message: ",e),this.window?this.window.postMessage(this.isMobile?JSON.stringify(e):e,"*"):t&&this.services.alerts.alert("Standard Notes is trying to communicate with ".concat(this.componentOrFeature.displayName,", ")+"but an error is occurring. Please restart this extension and try again.")):this.services.logger.info("Component has been deallocated in between message send and reply",this.componentOrFeature,e)}responseItemsByRemovingPrivateProperties(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=["autoupdateDisabled","permissions","active"];return t&&(n=n.concat(["hosted_url","local_url"])),e.map((e=>{const r=n.slice();if(t&&r.push("url"),!e.content||(0,l.isString)(e.content))return e;let i={};for(const[t,n]of Object.entries(e.content))r.includes(t)||(i=Object.assign(Object.assign({},i),{[t]:n}));return Object.assign(Object.assign({},e),{content:i})}))}setWindow(e){var t;if(this.window)throw Error("Attempting to override component viewer window. Create a new component viewer instead.");this.services.logger.info("setWindow","component: ",this.componentOrFeature,"window: ",e),this.window=e,this.sessionKey=l.UuidGenerator.GenerateUuid();const n=null!==(t=this.config.componentManagerFunctions.getComponentPreferences(this.componentOrFeature))&&void 0!==t?t:{};this.sendMessage({action:a.ComponentAction.ComponentRegistered,sessionKey:this.sessionKey,componentData:n,data:{uuid:this.componentUniqueIdentifier.value,environment:(0,o.g)(this.config.environment),platform:(0,o._e)(this.config.platform),activeThemeUrls:this.config.componentManagerFunctions.urlsForActiveThemes()}}),this.services.logger.info("setWindow got new sessionKey",this.sessionKey),this.postActiveThemes()}postActiveThemes(){const e={themes:this.config.componentManagerFunctions.urlsForActiveThemes()},t={action:a.ComponentAction.ActivateThemes,data:e};this.sendMessage(t,!1)}handleMessage(e){if(this.services.logger.info("Handle message",e,this),!this.componentOrFeature)return this.services.logger.info("Component not defined for message, returning",e),void this.services.alerts.alert("A component is trying to communicate with Standard Notes, but there is an error establishing a bridge. Please restart the app and try again.");if(this.readonly&&s.wJ.includes(e.action))return void this.services.alerts.alert("".concat(this.componentOrFeature.displayName," is trying to save, but it is in a locked state and cannot accept changes."));const t={[a.ComponentAction.StreamItems]:this.handleStreamItemsMessage.bind(this),[a.ComponentAction.StreamContextItem]:this.handleStreamContextItemMessage.bind(this),[a.ComponentAction.SetComponentData]:this.handleSetComponentPreferencesMessage.bind(this),[a.ComponentAction.DeleteItems]:this.handleDeleteItemsMessage.bind(this),[a.ComponentAction.CreateItems]:this.handleCreateItemsMessage.bind(this),[a.ComponentAction.CreateItem]:this.handleCreateItemsMessage.bind(this),[a.ComponentAction.SaveItems]:this.handleSaveItemsMessage.bind(this),[a.ComponentAction.SetSize]:this.handleSetSizeEvent.bind(this)}[e.action];null==t||t(e);for(const t of this.actionObservers)t(e.action,e.data)}handleStreamItemsMessage(e){const t=e.data.content_types.filter((e=>s.Jg.includes(e))).sort(),n=[{name:a.ComponentAction.StreamItems,content_types:t}];this.config.componentManagerFunctions.runWithPermissionsUseCase.execute(this.componentUniqueIdentifier.value,n,(()=>{this.streamItems||(this.streamItems=t,this.streamItemsOriginalMessage=e);const n=[];for(const e of t)(0,l.extendArray)(n,this.services.items.getItems(e));this.sendItemsInReply(n,e)}))}handleStreamContextItemMessage(e){const t=[{name:a.ComponentAction.StreamContextItem}];this.config.componentManagerFunctions.runWithPermissionsUseCase.execute(this.componentUniqueIdentifier.value,t,(()=>{this.streamContextItemOriginalMessage||(this.streamContextItemOriginalMessage=e);const t=(0,r.qr4)(this.options.item)?this.options.item.readonlyItem:this.services.items.findItem(this.options.item.uuid);t&&this.sendContextItemThroughBridge(t)}))}handleSaveItemsMessage(e){let t=e.data.items;const n=[],o=t.slice();if(!(0,r.qr4)(this.options.item)){for(const e of t.slice())if(e.uuid===this.options.item.uuid){n.push({name:a.ComponentAction.StreamContextItem}),(0,l.removeFromArray)(o,e);break}if(o.length>0){const e=(0,l.uniqueArray)(o.map((e=>e.content_type))).sort();n.push({name:a.ComponentAction.StreamItems,content_types:e})}this.config.componentManagerFunctions.runWithPermissionsUseCase.execute(this.componentUniqueIdentifier.value,n,(()=>u(this,void 0,void 0,(function*(){t=this.responseItemsByRemovingPrivateProperties(t,!0);const n=(0,l.Uuids)(t),r=this.services.items.findItemsIncludingBlanks(n);let o=0,s=0;for(const e of r)e&&e.locked&&(t=t.filter((t=>t.uuid!==e.uuid)),o++,e.content_type===c.ContentType.TYPES.Note&&s++);if(1===s)return void this.services.alerts.alert("The note you are attempting to save has editing disabled","Note has Editing Disabled");if(o>0){const e=1===o?"item":s===o?"notes":"items",t=1===o?"has":"have";return void this.services.alerts.alert("".concat(o," ").concat(e," you are attempting to save ").concat(t," editing disabled."),"Items have Editing Disabled")}const a=t.map((e=>(0,i.CreateComponentRetrievedContextPayload)(e)));for(const e of a){const t=this.services.items.findItem(e.uuid);if(t){if(e.content_type!==t.content_type)throw Error("Extension is trying to modify content type of item.")}else{const t=new i.DecryptedPayload(Object.assign(Object.assign({},(0,i.PayloadTimestampDefaults)()),e)),n=(0,i.CreateDecryptedItemFromPayload)(t);yield this.services.mutator.insertItem(n)}}yield this.services.mutator.changeItems(r.filter(l.isNotUndefined),(e=>{const n=(0,l.sureSearchArray)(a,{uuid:e.getUuid()});e.setCustomContent(n.content);const r=(0,l.sureSearchArray)(t,{uuid:e.getUuid()});if(r.clientData){const t=(0,l.Copy)(e.getItem().getDomainData(i.ComponentDataDomain)||{});t[this.componentUniqueIdentifier.value]=r.clientData,e.setDomainData(t,i.ComponentDataDomain)}}),i.MutationType.UpdateUserTimestamps,i.PayloadEmitSource.ComponentRetrieved,this.componentUniqueIdentifier.value),this.services.sync.sync({onPresyncSave:()=>{this.replyToMessage(e,{})}}).catch((()=>{this.replyToMessage(e,{error:"save-error"})}))}))))}}handleCreateItemsMessage(e){let t=e.data.item?[e.data.item]:e.data.items;const n=(0,l.uniqueArray)(t.map((e=>e.content_type))),r=[{name:a.ComponentAction.StreamItems,content_types:n}];this.config.componentManagerFunctions.runWithPermissionsUseCase.execute(this.componentUniqueIdentifier.value,r,(()=>u(this,void 0,void 0,(function*(){t=this.responseItemsByRemovingPrivateProperties(t);const n=[];for(const e of t){e.uuid||(e.uuid=l.UuidGenerator.GenerateUuid());const t=(0,i.createComponentCreatedContextPayload)(e),r=new i.DecryptedPayload(Object.assign(Object.assign({},(0,i.PayloadTimestampDefaults)()),t)),o=(0,i.CreateDecryptedItemFromPayload)(r),s=yield this.services.mutator.insertItem(o);yield this.services.mutator.changeItem(s,(t=>{if(e.clientData){const n=(0,l.Copy)(s.getDomainData(i.ComponentDataDomain)||{});n[this.componentUniqueIdentifier.value]=e.clientData,t.setDomainData(n,i.ComponentDataDomain)}}),i.MutationType.UpdateUserTimestamps,i.PayloadEmitSource.ComponentCreated,this.componentUniqueIdentifier.value),n.push(s)}this.services.sync.sync();const r=e.action===a.ComponentAction.CreateItem?{item:this.jsonForItem(n[0])}:{items:n.map((e=>this.jsonForItem(e)))};this.replyToMessage(e,r)}))))}handleDeleteItemsMessage(e){const t=e.data.items.filter((e=>s.Jg.includes(e.content_type))),n=(0,l.uniqueArray)(t.map((e=>e.content_type))).sort(),r=[{name:a.ComponentAction.StreamItems,content_types:n}];this.config.componentManagerFunctions.runWithPermissionsUseCase.execute(this.componentUniqueIdentifier.value,r,(()=>u(this,void 0,void 0,(function*(){const n=t,r=1===n.length?"item":"items";let o=null;if(yield this.services.alerts.confirm("Are you sure you want to delete ".concat(n.length," ").concat(r,"?"))){for(const e of n){const t=this.services.items.findItem(e.uuid);t?yield this.services.mutator.setItemToBeDeleted(t,i.PayloadEmitSource.ComponentRetrieved):this.services.alerts.alert("The item you are trying to delete cannot be found.")}this.services.sync.sync(),o={deleted:!0}}else o={deleted:!1};this.replyToMessage(e,o)}))))}handleSetComponentPreferencesMessage(e){this.config.componentManagerFunctions.runWithPermissionsUseCase.execute(this.componentUniqueIdentifier.value,[],(()=>u(this,void 0,void 0,(function*(){const t=e.data.componentData;t&&(yield this.config.componentManagerFunctions.setComponentPreferences(this.componentOrFeature,t))}))))}handleSetSizeEvent(e){var t;if(this.componentOrFeature.area!==a.ComponentArea.EditorStack)return;const n=null===(t=this.getIframe())||void 0===t?void 0:t.parentElement;if(!n)return;const r=e.data,i=(0,l.isString)(r.width)?r.width:"".concat(r.width,"px"),o=(0,l.isString)(r.height)?r.height:"".concat(r.height,"px");n&&n.setAttribute("style","width:".concat(i,"; height:").concat(o,";"))}getIframe(){return Array.from(document.getElementsByTagName("iframe")).find((e=>e.dataset.componentViewerId===this.identifier))}}},20549:(e,t,n)=>{n.d(t,{Jg:()=>a,h6:()=>s,wJ:()=>o});var r=n(80215),i=n(82648);const o=[r.ComponentAction.SaveItems,r.ComponentAction.CreateItem,r.ComponentAction.CreateItems,r.ComponentAction.DeleteItems,r.ComponentAction.SetComponentData],s=Object.freeze([r.NativeFeatureIdentifier.TYPES.LegacyFileSafeIdentifier,r.NativeFeatureIdentifier.TYPES.DeprecatedFileSafe,r.NativeFeatureIdentifier.TYPES.DeprecatedBoldEditor]),a=Object.freeze([i.ContentType.TYPES.FilesafeCredentials,i.ContentType.TYPES.FilesafeFileMetadata,i.ContentType.TYPES.FilesafeIntegration])},6314:(e,t,n)=>{n.d(t,{k:()=>p});var r=n(82648);class i{constructor(e,t){this.mutator=e,this.settings=t}execute(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return t=this,n=void 0,o=function*(){for(const t of e){if(t.migratedToUserSetting)continue;if(!t.onlineUrl)continue;const e=t.onlineUrl.match(/\w{32,64}/);if(e&&e.length>0){const n=e[0];yield this.settings.updateSetting(r.SettingName.create(r.SettingName.NAMES.ExtensionKey).getValue(),n,!0),yield this.mutator.changeFeatureRepo(t,(e=>{e.migratedToUserSetting=!0}))}}},new((i=void 0)||(i=Promise))((function(e,r){function s(e){try{l(o.next(e))}catch(e){r(e)}}function a(e){try{l(o.throw(e))}catch(e){r(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}l((o=o.apply(t,n||[])).next())}));var t,n,i,o}}var o=n(87901),s=n(95658),a=n(80215),l=n(22325),c=n(55668);class u{constructor(e){this.mutator=e,this.LEGACY_PROD_EXT_ORIGIN="https://extensions.standardnotes.org"}execute(e){return t=this,n=void 0,i=function*(){const t=[];for(const n of e.featureRepos){if(n.migratedToOfflineEntitlements)continue;if(!n.onlineUrl)continue;const r=n.onlineUrl,{origin:i}=new URL(r);if(!i.includes(this.LEGACY_PROD_EXT_ORIGIN))continue;const o=r.match(/\w{32,64}/);if(o&&o.length>0){const r=o[0],i=yield this.mutator.changeFeatureRepo(n,(t=>{t.offlineFeaturesUrl=e.prodOfflineFeaturesUrl,t.offlineKey=r,t.migratedToOfflineEntitlements=!0}));t.push(i)}}return t},new((r=void 0)||(r=Promise))((function(e,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i}}class d{constructor(e){this.items=e}execute(e){if(this.isFreeFeature(e.featureId))return c.iKc.Entitled;const t=this.findNativeFeature(e.featureId);return t?t.deprecated?this.getDeprecatedNativeFeatureStatus({nativeFeature:t,hasPaidAnyPartyOnlineOrOfflineSubscription:e.hasPaidAnyPartyOnlineOrOfflineSubscription}):this.getNativeFeatureFeatureStatus({nativeFeature:t,firstPartyOnlineSubscription:e.firstPartyOnlineSubscription,firstPartyRoles:e.firstPartyRoles,inContextOfItem:e.inContextOfItem}):this.getThirdPartyFeatureStatus(e.featureId)}findNativeFeature(e){return(0,a.FindNativeFeature)(e.value)}getDeprecatedNativeFeatureStatus(e){return e.hasPaidAnyPartyOnlineOrOfflineSubscription?c.iKc.Entitled:c.iKc.NoUserSubscription}getNativeFeatureFeatureStatus(e){if(e.inContextOfItem&&void 0!==e.inContextOfItem.shared_vault_uuid)return c.iKc.Entitled;if(!e.firstPartyOnlineSubscription&&!e.firstPartyRoles)return c.iKc.NoUserSubscription;const t=e.firstPartyRoles?"online"in e.firstPartyRoles?e.firstPartyRoles.online:e.firstPartyRoles.offline:void 0;return e.nativeFeature.availableInRoles&&t&&!t.some((t=>{var n;return null===(n=e.nativeFeature.availableInRoles)||void 0===n?void 0:n.includes(t)}))?c.iKc.NotInCurrentPlan:e.firstPartyOnlineSubscription&&new Date((0,o.convertTimestampToMilliseconds)(e.firstPartyOnlineSubscription.endsAt))<new Date?c.iKc.InCurrentPlanButExpired:c.iKc.Entitled}getThirdPartyFeatureStatus(e){const t=this.items.getDisplayableComponents().find((t=>t.uuid===e.value));return t?t.isExpired?c.iKc.InCurrentPlanButExpired:c.iKc.Entitled:c.iKc.NoUserSubscription}isFreeFeature(e){return[a.NativeFeatureIdentifier.TYPES.DarkTheme,a.NativeFeatureIdentifier.TYPES.PlainEditor,a.NativeFeatureIdentifier.TYPES.ProtonTheme].includes(e.value)}}var h=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class p extends c.wcN{constructor(e,t,n,i,o,s,a,u,p,f,g,m,y,v,A){super(A),this.storage=e,this.items=t,this.mutator=n,this.subscriptions=i,this.api=o,this.settings=a,this.user=u,this.sync=p,this.alerts=f,this.sessions=g,this.crypto=m,this.logger=y,this.isApplicationUsingThirdPartyHostUseCase=v,this.internalEventBus=A,this.onlineRoles=[],this.offlineRoles=[],this.enabledExperimentalFeatures=[],this.getFeatureStatusUseCase=new d(this.items),this.PROD_OFFLINE_FEATURES_URL="https://api.standardnotes.com/v1/offline/features",this.eventDisposers.push(s.addEventObserver(((e,t)=>h(this,void 0,void 0,(function*(){if(e===c.fAX.UserRoleMessageReceived){const e=t.payload.currentRoles;this.updateOnlineRolesWithNewValues(e)}}))))),this.eventDisposers.push(i.addEventObserver((e=>{e===c.lKe.DidFetchSubscription&&this.notifyEvent(c.Usi.FeaturesAvailabilityChanged)}))),this.eventDisposers.push(this.items.addObserver(r.ContentType.TYPES.ExtensionRepo,(e=>{let{changed:t,inserted:n,source:r}=e;return h(this,void 0,void 0,(function*(){if([l.PayloadEmitSource.InitialObserverRegistrationPush,l.PayloadEmitSource.LocalInserted,l.PayloadEmitSource.LocalDatabaseLoaded,l.PayloadEmitSource.RemoteRetrieved,l.PayloadEmitSource.FileImport].includes(r)){const e=[...t,...n];this.sessions.isSignedIntoFirstPartyServer()?this.migrateFeatureRepoToUserSetting(e):this.migrateFeatureRepoToOfflineEntitlements(e)}}))}))),this.eventDisposers.push(this.user.addEventObserver((e=>{if(e===c.oF7.SignedInOrRegistered){const e=this.items.getItems(r.ContentType.TYPES.ExtensionRepo),t=this.isApplicationUsingThirdPartyHostUseCase.execute();if(t.isFailed())return;t.getValue()||this.migrateFeatureRepoToUserSetting(e)}})))}initializeFromDisk(){this.onlineRoles=this.storage.getValue(c.QtK.UserRoles,void 0,[]),this.offlineRoles=this.storage.getValue(c.QtK.OfflineUserRoles,void 0,[]),this.enabledExperimentalFeatures=this.storage.getValue(c.QtK.ExperimentalFeatures,void 0,[])}handleEvent(e){return h(this,void 0,void 0,(function*(){switch(e.type){case c.Sf$.MetaReceived:{if(!this.sync)return void this.logger.warn("Handling events interrupted. Sync service is not yet initialized.",e);const{userRoles:t}=e.payload;this.updateOnlineRolesWithNewValues(t.map((e=>e.name)));break}case c.n9K.ApplicationStageChanged:switch(e.payload.stage){case c.Ugm.StorageDecrypted_09:this.initializeFromDisk();break;case c.Ugm.FullSyncCompleted_13:if(!this.hasFirstPartyOnlineSubscription()){const e=this.getOfflineRepo();e&&this.downloadOfflineRoles(e)}}}}))}enableExperimentalFeature(e){this.enabledExperimentalFeatures.push(e),this.storage.setValue(c.QtK.ExperimentalFeatures,this.enabledExperimentalFeatures),this.notifyEvent(c.Usi.FeaturesAvailabilityChanged)}disableExperimentalFeature(e){(0,o.removeFromArray)(this.enabledExperimentalFeatures,e),this.storage.setValue(c.QtK.ExperimentalFeatures,this.enabledExperimentalFeatures);const t=this.items.getItems([r.ContentType.TYPES.Component,r.ContentType.TYPES.Theme]).find((t=>t.identifier===e));t&&(this.mutator.setItemToBeDeleted(t).then((()=>{this.sync.sync()})),this.notifyEvent(c.Usi.FeaturesAvailabilityChanged))}toggleExperimentalFeature(e){this.isExperimentalFeatureEnabled(e)?this.disableExperimentalFeature(e):this.enableExperimentalFeature(e)}getExperimentalFeatures(){return a.ExperimentalFeatures}isExperimentalFeature(e){return this.getExperimentalFeatures().includes(e)}getEnabledExperimentalFeatures(){return this.enabledExperimentalFeatures}isExperimentalFeatureEnabled(e){return this.enabledExperimentalFeatures.includes(e)}setOfflineFeaturesCode(e){return h(this,void 0,void 0,(function*(){try{const t=this.parseOfflineEntitlementsCode(e);if(t instanceof s.ClientDisplayableError)return t;const n=yield this.mutator.createItem(r.ContentType.TYPES.ExtensionRepo,(0,l.FillItemContent)({offlineFeaturesUrl:t.featuresUrl,offlineKey:t.extensionKey,migratedToOfflineEntitlements:!0}),!0);return this.sync.sync(),this.downloadOfflineRoles(n)}catch(e){return new s.ClientDisplayableError("".concat(c.iMd,", ").concat(JSON.stringify(e)))}}))}getOfflineRepo(){return this.items.getItems(r.ContentType.TYPES.ExtensionRepo).filter((e=>e.migratedToOfflineEntitlements))[0]}hasOfflineRepo(){return null!=this.getOfflineRepo()}deleteOfflineFeatureRepo(){return h(this,void 0,void 0,(function*(){const e=this.getOfflineRepo();e&&(yield this.mutator.setItemToBeDeleted(e),this.sync.sync())}))}parseOfflineEntitlementsCode(e){try{const t=e.replace(/\s/g,""),n=this.crypto.base64Decode(t),{featuresUrl:r,extensionKey:i,subscriptionId:o}=JSON.parse(n);return{featuresUrl:r,extensionKey:i,subscriptionId:o}}catch(e){return new s.ClientDisplayableError(c.iMd)}}downloadOfflineRoles(e){return h(this,void 0,void 0,(function*(){const t=yield this.api.downloadOfflineFeaturesFromRepo({repo:e});if(t instanceof s.ClientDisplayableError)return t;this.setOfflineRoles(t.roles)}))}migrateFeatureRepoToUserSetting(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return h(this,void 0,void 0,(function*(){const t=new i(this.mutator,this.settings);yield t.execute(e)}))}migrateFeatureRepoToOfflineEntitlements(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return h(this,void 0,void 0,(function*(){const t=new u(this.mutator),n=yield t.execute({featureRepos:e,prodOfflineFeaturesUrl:this.PROD_OFFLINE_FEATURES_URL});n.length>0&&(yield this.downloadOfflineRoles(n[0]));for(const t of e)yield this.downloadOfflineRoles(t)}))}hasPaidAnyPartyOnlineOrOfflineSubscription(){return this.onlineRolesIncludePaidSubscription()||this.hasOfflineRepo()||this.hasFirstPartyOnlineSubscription()}hasFirstPartyOnlineSubscription(){return this.sessions.isSignedIntoFirstPartyServer()&&this.subscriptions.hasOnlineSubscription()}hasFirstPartyOfflineSubscription(){const e=this.getOfflineRepo();return!(!e||!e.content.offlineFeaturesUrl||e.content.offlineFeaturesUrl!==this.PROD_OFFLINE_FEATURES_URL&&"localhost"!==new URL(e.content.offlineFeaturesUrl).hostname)}updateOnlineRolesWithNewValues(e){return h(this,void 0,void 0,(function*(){const t=this.onlineRoles;if((e.some((e=>!this.onlineRoles.includes(e)))||this.onlineRoles.some((t=>!e.includes(t))))&&(this.setOnlineRoles(e),0!==t.length)){const n=e.filter((e=>!t.includes(e)));this.rolesIncludePaidSubscription(n)&&(yield this.notifyEvent(c.Usi.DidPurchaseSubscription))}}))}setOnlineRoles(e){const t=!(0,o.arraysEqual)(this.onlineRoles,e);this.onlineRoles=e,t&&this.notifyEvent(c.Usi.UserRolesChanged),this.storage.setValue(c.QtK.UserRoles,this.onlineRoles)}setOfflineRoles(e){const t=!(0,o.arraysEqual)(this.offlineRoles,e);this.offlineRoles=e,t&&this.notifyEvent(c.Usi.UserRolesChanged),this.storage.setValue(c.QtK.OfflineUserRoles,this.offlineRoles)}isThirdPartyFeature(e){return!(0,a.FindNativeFeature)(e)}rolesIncludePaidSubscription(e){const t=[r.RoleName.NAMES.PlusUser,r.RoleName.NAMES.ProUser];return e.some((e=>t.includes(e)))}onlineRolesIncludePaidSubscription(){return this.rolesIncludePaidSubscription(this.onlineRoles)}rolesBySorting(e){return Object.values(r.RoleName.NAMES).filter((t=>e.includes(t)))}hasRole(e){return this.onlineRoles.includes(e.value)||this.offlineRoles.includes(e.value)}hasMinimumRole(e){const t=Object.values(r.RoleName.NAMES),n=this.rolesBySorting(this.hasFirstPartyOnlineSubscription()?this.onlineRoles:this.offlineRoles),i=t.indexOf((0,o.lastElement)(n));return t.indexOf(e)<=i}getFeatureStatus(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.getFeatureStatusUseCase.execute({featureId:e,firstPartyRoles:this.hasFirstPartyOnlineSubscription()?{online:this.onlineRoles}:this.hasFirstPartyOfflineSubscription()?{offline:this.offlineRoles}:void 0,hasPaidAnyPartyOnlineOrOfflineSubscription:this.hasPaidAnyPartyOnlineOrOfflineSubscription(),firstPartyOnlineSubscription:this.hasFirstPartyOnlineSubscription()?this.subscriptions.getOnlineSubscription():void 0,inContextOfItem:t.inContextOfItem})}deinit(){super.deinit(),this.onlineRoles=void 0,this.offlineRoles=void 0,this.storage=void 0,this.items=void 0,this.mutator=void 0,this.api=void 0,this.subscriptions=void 0,this.settings=void 0,this.user=void 0,this.sync=void 0,this.alerts=void 0,this.sessions=void 0,this.crypto=void 0}}},29675:(e,t,n)=>{n.d(t,{E:()=>a});var r=n(87901),i=n(22325),o=n(55668),s=n(82648);class a extends o.wcN{constructor(e,t,n,r){super(r),this.itemManager=e,this.storageService=t,this.deviceInterface=n,this.internalEventBus=r,this.historyStaging={},this.history={},this.itemRevisionThreshold=20,this.removeChangeObserver=this.itemManager.addObserver(s.ContentType.TYPES.Note,(e=>{let{changed:t,inserted:n}=e;this.recordNewHistoryForItems(t.concat(n))}))}deinit(){this.itemManager=void 0,this.storageService=void 0,this.history=void 0,this.removeChangeObserver&&(this.removeChangeObserver(),this.removeChangeObserver=void 0),super.deinit()}recordNewHistoryForItems(e){for(const t of e){const e=this.history[t.uuid]||[],n=i.historyMapFunctions.getNewestRevision(e),r=new i.DecryptedPayload(t.payload),o=i.CreateHistoryEntryForPayload(r,n);if(o.isDiscardable())continue;const s=this.historyStaging[t.uuid];this.historyStaging[t.uuid]=o,s&&(s.isSameAsEntry(o)||n&&s.isSameAsEntry(n)||(e.unshift(s),this.history[t.uuid]=e,this.optimizeHistoryForItem(t.uuid)))}}sessionHistoryForItem(e){return this.history[e.uuid]||[]}getHistoryMapCopy(){const e=Object.assign({},this.history);for(const[t,n]of Object.entries(e))e[t]=n.slice();return Object.freeze(e)}optimizeHistoryForItem(e){const t=this.history[e]||[];if(t.length<=this.itemRevisionThreshold)return;const n=e=>e.deltaSize()>25,i=[],o=(e,o,s)=>{if(s){if(i.unshift(e),n(e)&&-1===e.operationVector()){const e=t[o+1];e&&i.unshift(e)}}else(0,r.removeFromArray)(i,e)};for(let e=t.length-1;e>=0;e--){const r=t[e];o(r,e,0===e||e===t.length-1||n(r))}const s=t.filter((e=>i.includes(e)));this.history[e]=s}}},45447:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(87901),i=n(38529),o=n(22325),s=n(55668),a=n(82648);class l extends s.wcN{constructor(e,t){super(t),this.payloadManager=e,this.internalEventBus=t,this.observers=[],this.streamDisposers=[],this.payloadManager=e,this.systemSmartViews=this.rebuildSystemSmartViews({}),this.createCollection(),this.unsubChangeObserver=this.payloadManager.addObserver(a.ContentType.TYPES.Any,this.setPayloads.bind(this))}rebuildSystemSmartViews(e){return this.systemSmartViews=o.BuildSmartViews(e),this.systemSmartViews}getCollection(){return this.collection}createCollection(){var e;this.collection=new o.ItemCollection,this.navigationDisplayController=new o.ItemDisplayController(this.collection,[a.ContentType.TYPES.Note,a.ContentType.TYPES.File],{sortBy:"created_at",sortDirection:"dsc",hiddenContentTypes:[]}),this.tagDisplayController=new o.ItemDisplayController(this.collection,[a.ContentType.TYPES.Tag],{sortBy:"title",sortDirection:"asc"}),this.itemsKeyDisplayController=new o.ItemDisplayController(this.collection,[a.ContentType.TYPES.ItemsKey],{sortBy:"created_at",sortDirection:"asc"}),this.componentDisplayController=new o.ItemDisplayController(this.collection,[a.ContentType.TYPES.Component],{sortBy:"created_at",sortDirection:"asc"}),this.themeDisplayController=new o.ItemDisplayController(this.collection,[a.ContentType.TYPES.Theme],{sortBy:"title",sortDirection:"asc"}),this.smartViewDisplayController=new o.ItemDisplayController(this.collection,[a.ContentType.TYPES.SmartView],{sortBy:"title",sortDirection:"asc"}),this.fileDisplayController=new o.ItemDisplayController(this.collection,[a.ContentType.TYPES.File],{sortBy:"title",sortDirection:"asc"}),this.itemCounter=new o.ItemCounter(this.collection,null===(e=this.itemCounter)||void 0===e?void 0:e.observers)}get allDisplayControllers(){return[this.navigationDisplayController,this.tagDisplayController,this.itemsKeyDisplayController,this.componentDisplayController,this.themeDisplayController,this.smartViewDisplayController,this.fileDisplayController]}get invalidItems(){return this.collection.invalidElements()}get invalidNonVaultedItems(){return this.invalidItems.filter((e=>!e.key_system_identifier))}createItemFromPayload(e){return o.CreateDecryptedItemFromPayload(e)}createPayloadFromObject(e){return new o.DecryptedPayload(e)}setPrimaryItemDisplayOptions(e){var t,n;const r={},i=[];e.views&&e.views.find((e=>e.uuid===o.SystemViewId.AllNotes))&&(void 0===e.includeArchived&&(r.includeArchived=!1),void 0===e.includeTrashed&&(r.includeTrashed=!1)),e.views&&e.views.find((e=>e.uuid===o.SystemViewId.ArchivedNotes))&&void 0===e.includeTrashed&&(r.includeTrashed=!1),e.views&&e.views.find((e=>e.uuid===o.SystemViewId.TrashedNotes))&&(e.includeArchived||(r.includeArchived=!0)),e.views&&e.views.find((e=>e.uuid===o.SystemViewId.Conflicts))&&i.push((e=>this.collection.conflictsOf(e.uuid).length>0)),this.rebuildSystemSmartViews(Object.assign(Object.assign({},e),r));const s=null===(t=e.tags)||void 0===t?void 0:t.map((e=>this.collection.find(e.uuid))).filter((e=>null!=e)),l=null===(n=e.views)||void 0===n?void 0:n.map((e=>o.isSystemView(e)?this.systemSmartViews.find((t=>t.uuid===e.uuid)):this.collection.find(e.uuid))).filter((e=>null!=e)),c=Object.assign(Object.assign(Object.assign({},e),r),{tags:s,views:l,hiddenContentTypes:[a.ContentType.TYPES.Tag]});c.sortBy===o.CollectionSort.Title&&(c.sortDirection="asc"===c.sortDirection?"dsc":"asc"),this.navigationDisplayController.setDisplayOptions(Object.assign({customFilter:o.computeUnifiedFilterForDisplayOptions(c,this.collection,i)},c)),this.itemCounter.setDisplayOptions(c)}setTagsAndViewsDisplayOptions(e){const t=Object.assign({customFilter:o.computeUnifiedFilterForDisplayOptions(e,this.collection)},e);this.tagDisplayController.setDisplayOptions(t),this.smartViewDisplayController.setDisplayOptions(t)}setVaultDisplayOptions(e){this.navigationDisplayController.setVaultDisplayOptions(e),this.tagDisplayController.setVaultDisplayOptions(e),this.smartViewDisplayController.setVaultDisplayOptions(e),this.fileDisplayController.setVaultDisplayOptions(e),this.itemCounter.setVaultDisplayOptions(e)}getDisplayableNotes(){return(0,r.assert)(2===this.navigationDisplayController.contentTypes.length),this.navigationDisplayController.items().filter(o.isNote)}getDisplayableFiles(){return this.fileDisplayController.items()}getDisplayableNotesAndFiles(){return this.navigationDisplayController.items()}getDisplayableTags(){return this.tagDisplayController.items()}getDisplayableItemsKeys(){return this.itemsKeyDisplayController.items()}getDisplayableComponents(){return[...this.componentDisplayController.items(),...this.themeDisplayController.items()]}deinit(){this.unsubChangeObserver(),this.streamDisposers.length=0,this.unsubChangeObserver=void 0,this.payloadManager=void 0,this.collection=void 0,this.itemCounter=void 0,this.tagDisplayController=void 0,this.navigationDisplayController=void 0,this.itemsKeyDisplayController=void 0,this.componentDisplayController=void 0,this.themeDisplayController=void 0,this.fileDisplayController=void 0,this.smartViewDisplayController=void 0}resetState(){this.createCollection()}findItem(e){return this.collection.findDecrypted(e)||this.findSystemSmartView(e)}findAnyItem(e){return this.collection.find(e)||this.findSystemSmartView(e)}findAnyItems(e){return this.collection.findAll(e)}findSystemSmartView(e){return this.systemSmartViews.find((t=>t.uuid===e))}findSureItem(e){return this.findItem(e)}findItems(e){return this.collection.findAllDecrypted(e)}findItemsIncludingBlanks(e){return this.collection.findAllDecryptedWithBlanks(e)}get items(){return this.collection.nondeletedElements().filter(o.isDecryptedItem)}allTrackedItems(){return this.collection.all()}hasTagsNeedingFoldersMigration(){return i.l.isApplicableToCurrentData(this)}addNoteCountChangeObserver(e){return this.itemCounter.addCountChangeObserver(e)}allCountableNotesCount(){return this.itemCounter.allCountableNotesCount()}allCountableFilesCount(){return this.itemCounter.allCountableFilesCount()}countableNotesForTag(e){if(e instanceof o.SmartView){if(e.uuid===o.SystemViewId.AllNotes)return this.itemCounter.allCountableNotesCount();throw Error("countableItemsForTag is not meant to be used for smart views.")}return this.itemCounter.countableItemsForTag(e)}getNoteCount(){return this.noteCount}addObserver(e,t){Array.isArray(e)||(e=[e]);const n={contentType:e,callback:t};this.observers.push(n);const i=this.observers;return()=>{(0,r.removeFromArray)(i,n)}}itemsReferencingItem(e,t){const n=this.collection.uuidsThatReferenceUuid(e.uuid);let r=this.findItems(n);return t&&(r=r.filter((e=>(null==e?void 0:e.content_type)===t))),r}referencesForItem(e,t){const n=this.findSureItem(e.uuid).references.map((e=>e.uuid));let r=this.findItems(n);return t&&(r=r.filter((e=>(null==e?void 0:e.content_type)===t))),r}setPayloads(e){const{changed:t,inserted:n,discarded:r,ignored:i,unerrored:s,source:a,sourceKey:l}=e,c=e=>o.CreateItemFromPayload(e),u=new Set,d={changed:t.map((e=>(u.add(e.content_type),c(e)))),inserted:n.map((e=>(u.add(e.content_type),c(e)))),discarded:r.map((e=>(u.add(e.content_type),new o.DeletedItem(e)))),ignored:i.map((e=>(u.add(e.content_type),new o.EncryptedItem(e)))),unerrored:s.map((e=>(u.add(e.content_type),o.CreateDecryptedItemFromPayload(e))))};this.collection.onChange(d),this.itemCounter.onChange(d);const h=Array.from(u.values());for(const e of this.allDisplayControllers)e.contentTypes.some((e=>h.includes(e)))&&e.onCollectionChange(d);this.notifyObserversByUiAdjustingDelta(d,a,l)}notifyObserversByUiAdjustingDelta(e,t,n){const r=[],i=[],s=[],a=[],l=[];for(const t of e.changed)o.isDeletedItem(t)?s.push(t):o.isDecryptedItem(t)?r.push(t):l.push(t);for(const t of e.inserted)o.isDeletedItem(t)?a.push(t):o.isDecryptedItem(t)&&i.push(t);const c=[...e.discarded,...s,...a,...l];this.notifyObservers(r,i,c,e.ignored,e.unerrored,t,n)}notifyObservers(e,t,n,r,i,o,s){const l=(e,t)=>e.filter((e=>t.includes(a.ContentType.TYPES.Any)||t.includes(e.content_type))),c=this.observers.slice();for(const a of c){const c=l(e,a.contentType),u=l(t,a.contentType),d=l(n,a.contentType),h=l(r,a.contentType),p=l(i,a.contentType);0===c.length&&0===u.length&&0===d.length&&0===h.length&&0===p.length||a.callback({changed:c,inserted:u,removed:d,ignored:h,unerrored:p,source:o,sourceKey:s})}}getDirtyItems(){return this.collection.dirtyElements().filter(o.isDecryptedOrDeletedItem)}createTemplateItem(e,t,n){const i=new o.DecryptedPayload(Object.assign(Object.assign({uuid:r.UuidGenerator.GenerateUuid(),content_type:e,content:o.FillItemContent(t||{})},o.PayloadTimestampDefaults()),n));return o.CreateDecryptedItemFromPayload(i)}isTemplateItem(e){return!this.findItem(e.uuid)}getItems(e){return this.collection.allDecrypted(e)}getAnyItems(e){return this.collection.all(e)}itemsMatchingPredicate(e,t){return this.itemsMatchingPredicates(e,[t])}itemsMatchingPredicates(e,t){const n=this.getItems(e);return this.subItemsMatchingPredicates(n,t)}subItemsMatchingPredicates(e,t){return e.filter((e=>{for(const n of t)if(!e.satisfiesPredicate(n))return!1;return!0}))}getRootTags(){return this.getDisplayableTags().filter((e=>void 0===e.parentId))}findTagByTitle(e){const t=e.toLowerCase();return this.getDisplayableTags().find((e=>{var n;return(null===(n=e.title)||void 0===n?void 0:n.toLowerCase())===t}))}findTagByTitleAndParent(e,t){const n=e.toLowerCase();return(t?this.getTagChildren(t):this.getRootTags()).find((e=>{var t;return(null===(t=e.title)||void 0===t?void 0:t.toLowerCase())===n}))}searchTags(e,t){return(0,r.naturalSort)(this.getDisplayableTags().filter((n=>{const r=this.getTagLongTitle(n).toLowerCase().includes(e.toLowerCase()),i=!!t&&this.itemsReferencingItem(t).some((e=>(null==e?void 0:e.uuid)===n.uuid));return r&&!i})),"title")}getTagParent(e){const t=this.findItem(e.uuid);if(!t)return;const n=t.parentId;return n?this.findItem(n):void 0}getDisplayableTagParent(e){const t=this.findItem(e.uuid);if(!t)return;const n=t.parentId;return n?this.tagDisplayController.items().find((e=>e.uuid===n)):void 0}getTagPrefixTitle(e){const t=this.getTagParentChain(e);if(0===t.length)return;const n=t.map((e=>e.title)).join("/");return"".concat(n,"/")}getTagLongTitle(e){return[...this.getTagParentChain(e),e].map((e=>e.title)).join("/")}getTagParentChain(e){const t=this.findItem(e.uuid);if(!t)return[];let n=t.parentId;const r=[];for(;n;){const e=this.findItem(n);if(!e)return r;r.unshift(e),n=e.parentId}return r}getTagChildren(e){const t=this.findItem(e.uuid);return t?this.collection.elementsReferencingElement(t,a.ContentType.TYPES.Tag).filter((t=>t.parentId===e.uuid)):[]}getDeepTagChildren(e){const t=[],n=this.getTagChildren(e);for(const e of n)t.push(e),t.push(...this.getDeepTagChildren(e));return t}isTagAncestor(e,t){const n=this.findItem(t.uuid);if(!n)return!1;let r=n.parentId;for(;r;){if(r===e.uuid)return!0;const t=this.findItem(r);if(!t)return!1;r=t.parentId}return!1}isValidTagParent(e,t){return e.uuid!==t.uuid&&!this.isTagAncestor(t,e)}getSortedTagsForItem(e){return(0,r.naturalSort)(this.itemsReferencingItem(e).filter((e=>(null==e?void 0:e.content_type)===a.ContentType.TYPES.Tag)),"title")}getUnsortedTagsForItem(e){return this.itemsReferencingItem(e).filter((e=>(null==e?void 0:e.content_type)===a.ContentType.TYPES.Tag))}isSmartViewTitle(e){return e.startsWith(o.SMART_TAG_DSL_PREFIX)}notesMatchingSmartView(e){const t={views:[e]};return o.notesAndFilesMatchingOptions(t,this.collection.allDecrypted(a.ContentType.TYPES.Note),this.collection)}get allNotesSmartView(){return this.systemSmartViews.find((e=>e.uuid===o.SystemViewId.AllNotes))}get archivedSmartView(){return this.systemSmartViews.find((e=>e.uuid===o.SystemViewId.ArchivedNotes))}get trashSmartView(){return this.systemSmartViews.find((e=>e.uuid===o.SystemViewId.TrashedNotes))}get untaggedNotesSmartView(){return this.systemSmartViews.find((e=>e.uuid===o.SystemViewId.UntaggedNotes))}get trashedItems(){return this.notesMatchingSmartView(this.trashSmartView)}getSmartViews(){const e=this.smartViewDisplayController.items();return this.systemSmartViews.concat(e)}get noteCount(){return this.collection.all(a.ContentType.TYPES.Note).length}removeAllItemsFromMemory(){return e=this,t=void 0,i=function*(){const e=(0,r.Uuids)(this.items),t=[];for(const n of e){const e=new o.DeleteItemMutator(this.findSureItem(n),o.MutationType.NonDirtying);t.push(e.getDeletedResult())}yield this.payloadManager.emitPayloads(t,o.PayloadEmitSource.LocalChanged),this.resetState(),this.payloadManager.resetState()},new((n=void 0)||(n=Promise))((function(r,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}));var e,t,n,i}removeItemFromMemory(e){this.removeItemsFromMemory([e])}removeItemsFromMemory(e){this.collection.discard(e),this.payloadManager.removePayloadLocally(e.map((e=>e.payload)));const t=o.CreateItemDelta({discarded:e}),n=e.map((e=>e.content_type));for(const e of this.allDisplayControllers)e.contentTypes.some((e=>n.includes(e)))&&e.onCollectionChange(t)}relationshipDirectionBetweenItems(e,t){const n=!!e.references.find((e=>e.uuid===t.uuid)),r=!!t.references.find((t=>t.uuid===e.uuid));return n?s.uMm.AReferencesB:r?s.uMm.BReferencesA:s.uMm.NoRelationship}conflictsOf(e){return this.collection.conflictsOf(e)}numberOfNotesWithConflicts(){const e=this.collection.uuidsOfItemsWithConflicts();return(this.navigationDisplayController.hasExclusiveVaultOptions()?this.navigationDisplayController.items().filter((e=>o.isNote(e)&&this.collection.uuidsOfItemsWithConflicts().includes(e.uuid))):this.findItems(e).filter(o.isNote)).length}getItemLinkedFiles(e){return e.content_type===a.ContentType.TYPES.File?this.referencesForItem(e).filter(o.isFile):this.itemsReferencingItem(e).filter(o.isFile)}getItemLinkedNotes(e){return this.referencesForItem(e).filter(o.isNote)}streamItems(e,t){const n=this.addObserver(e,(e=>{let{changed:n,inserted:r,removed:i,source:o}=e;t({changed:n,inserted:r,removed:i,source:o})})),i=this.getItems(e);return t({inserted:i,changed:[],removed:[],source:o.PayloadEmitSource.InitialObserverRegistrationPush}),this.streamDisposers.push(n),()=>{n(),(0,r.removeFromArray)(this.streamDisposers,n)}}}},80738:(e,t,n)=>{n.d(t,{D:()=>g});var r=n(87901),i=n(20875);function o(e,t){return(0,i.leftVersionGreaterThanOrEqualToRight)(e.version,t.version)}var s=n(55668),a=n(82648);class l{constructor(e,t,n,r,i,o){this.queueItem=e,this.itemManager=t,this.encryptionService=n,this.challengeService=r,this.clientParams=i,this.serverParams=o}run(){return e=this,t=void 0,i=function*(){let e=!1;if(this.serverParams&&this.clientParams&&!this.clientParams.compare(this.serverParams)&&this.queueItem.keyParams.compare(this.serverParams)&&o(this.serverParams,this.clientParams)){const t=(0,r.dateSorted)(this.itemManager.getItems(a.ContentType.TYPES.ItemsKey),"created_at",!1)[0];e=!t||this.queueItem.encryptedKey.created_at>t.created_at}const t=yield(0,s.zW4)(this.queueItem.encryptedKey,this.encryptionService,this.challengeService,this.queueItem.keyParams);return"aborted"===t?{aborted:!0}:"failed"===t?{aborted:!1}:{rootKey:t.rootKey,replaceLocalRootKeyWithResult:e,decryptedItemsKey:t.decryptedKey}},new((n=void 0)||(n=Promise))((function(r,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}));var e,t,n,i}}var c,u=n(86999),d=n(22325),h=n(95658);function p(e){return"rootKey"in e}!function(e){e.KeysRecovered="KeysRecovered"}(c||(c={}));var f=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class g extends s.wcN{constructor(e,t,n,r,i,o,s,l,c,u){super(u),this.itemManager=e,this.payloadManager=t,this.apiService=n,this.encryptionService=r,this.challengeService=i,this.alertService=o,this.storageService=s,this.sync=l,this.userService=c,this.internalEventBus=u,this.decryptionQueue=[],this.isProcessingQueue=!1,this.removeItemObserver=this.payloadManager.addObserver([a.ContentType.TYPES.ItemsKey],(e=>{let{changed:t,inserted:n,ignored:r,source:i}=e;if(i===d.PayloadEmitSource.LocalChanged)return;const o=t.concat(n).filter(d.isErrorDecryptingPayload);o.length>0&&this.handleUndecryptableItemsKeys(o),r.length>0&&this.handleIgnoredItemsKeys(r)}))}deinit(){this.itemManager=void 0,this.payloadManager=void 0,this.apiService=void 0,this.encryptionService=void 0,this.challengeService=void 0,this.alertService=void 0,this.storageService=void 0,this.sync=void 0,this.userService=void 0,this.removeItemObserver(),this.removeItemObserver=void 0,super.deinit()}handleEvent(e){return f(this,void 0,void 0,(function*(){e.type===s.n9K.ApplicationStageChanged&&e.payload.stage===s.Ugm.LoadedDatabase_12&&this.processPersistedUndecryptables()}))}handleIgnoredItemsKeys(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return f(this,void 0,void 0,(function*(){t&&this.saveToUndecryptables(e),this.addKeysToQueue(e),yield this.beginKeyRecovery()}))}handleUndecryptableItemsKeys(e){return f(this,void 0,void 0,(function*(){this.addKeysToQueue(e),yield this.beginKeyRecovery()}))}presentKeyRecoveryWizard(){const e=this.itemManager.invalidItems.filter((e=>e.content_type===a.ContentType.TYPES.ItemsKey)).map((e=>e.payload));this.handleIgnoredItemsKeys(e,!1)}canAttemptDecryptionOfItem(e){if((0,d.ContentTypeUsesRootKeyEncryption)(e.content_type))return!0;const t=e.payload.items_key_id;return t?!!this.payloadManager.findOne(t)||new h.ClientDisplayableError("Unable to find key ".concat(t," for this item. You may try signing out and back in; if that doesn't help, check your backup files for a key with this ID and import it.")):new h.ClientDisplayableError("This item cannot be recovered.")}processPersistedUndecryptables(){return f(this,void 0,void 0,(function*(){const e=this.getUndecryptables(),t=Object.values(e);if(0===t.length)return;const n=t.map((e=>new d.EncryptedPayload(e)));return this.handleIgnoredItemsKeys(n,!1)}))}getUndecryptables(){return this.storageService.getValue(s.QtK.KeyRecoveryUndecryptableItems,s.qt7.Default,{})}persistUndecryptables(e){this.storageService.setValue(s.QtK.KeyRecoveryUndecryptableItems,e)}saveToUndecryptables(e){const t=this.getUndecryptables();for(const n of e)t[n.uuid]=n.ejected();this.persistUndecryptables(t)}removeFromUndecryptables(e){const t=this.getUndecryptables();for(const n of e)delete t[n];this.persistUndecryptables(t)}getClientKeyParams(){return this.encryptionService.getAccountKeyParams()}performServerSignIn(){return f(this,void 0,void 0,(function*(){const e=new s.tv4([new s.FEo(s.tQn.None,void 0,void 0,!0)],s.Ps8.Custom,!0,u.fD.KeyRecoveryLoginFlowReason),t=yield this.challengeService.promptForChallengeResponse(e);if(!t)return;this.challengeService.completeChallenge(e);const n=t.values[0].value,r=this.getClientKeyParams(),i=yield this.getLatestKeyParamsFromServer(r.identifier);if(!i||!o(i,r))return;const a=yield this.encryptionService.computeRootKey(n,i),l=yield this.userService.correctiveSignIn(a);return(0,h.isErrorResponse)(l)?(yield this.alertService.alert(u.fD.KeyRecoveryLoginFlowInvalidPassword),this.performServerSignIn()):(this.alertService.alert(u.fD.KeyRecoveryRootKeyReplaced),a)}))}getWrappingKeyIfApplicable(){return f(this,void 0,void 0,(function*(){if(!this.encryptionService.hasPasscode())return;const{wrappingKey:e,canceled:t}=yield this.challengeService.getWrappingKeyIfApplicable();return t?(yield this.alertService.alert(u.fD.KeyRecoveryPasscodeRequiredText,u.fD.KeyRecoveryPasscodeRequiredTitle),this.getWrappingKeyIfApplicable()):e}))}addKeysToQueue(e){for(const t of e){const e=this.encryptionService.getKeyEmbeddedKeyParamsFromItemsKey(t);if(!e)continue;const n={encryptedKey:t,keyParams:e};this.decryptionQueue.push(n)}}readdQueueItem(e){this.decryptionQueue.unshift(e)}getLatestKeyParamsFromServer(e){return f(this,void 0,void 0,(function*(){const t=yield this.apiService.getAccountKeyParams({email:e});return(0,h.isErrorResponse)(t)?void 0:(0,u.LW)(t.data)}))}beginKeyRecovery(){return f(this,void 0,void 0,(function*(){if(this.isProcessingQueue)return;this.isProcessingQueue=!0;const e=this.getClientKeyParams();let t;if(e&&(t=yield this.getLatestKeyParamsFromServer(e.identifier)),null!=this.encryptionService){if(!this.encryptionService.hasAccount()&&!this.encryptionService.hasPasscode()){const e=yield this.performServerSignIn();if(e){const n=!0;yield this.handleDecryptionOfAllKeysMatchingCorrectRootKey(e,n,t)}}yield this.processQueue(t),t&&(yield this.potentiallyPerformFallbackSignInToUpdateOutdatedLocalRootKey(t)),this.sync.isOutOfSync()&&this.sync.sync({checkIntegrity:!0})}}))}potentiallyPerformFallbackSignInToUpdateOutdatedLocalRootKey(e){return f(this,void 0,void 0,(function*(){const t=this.getClientKeyParams();t&&!e.compare(t)&&o(e,t)&&(yield this.performServerSignIn())}))}processQueue(e){return f(this,void 0,void 0,(function*(){let t=this.decryptionQueue[0];for(;t;){const n=yield this.processQueueItem(t,e);if((0,r.removeFromArray)(this.decryptionQueue,t),!p(n)&&n.aborted)return void(this.isProcessingQueue=!1);t=this.decryptionQueue[0]}this.isProcessingQueue=!1}))}processQueueItem(e,t){return f(this,void 0,void 0,(function*(){const n=this.getClientKeyParams(),r=new l(e,this.itemManager,this.encryptionService,this.challengeService,n,t),i=yield r.run();return p(i)?(yield this.handleDecryptionOfAllKeysMatchingCorrectRootKey(i.rootKey,i.replaceLocalRootKeyWithResult,t),i):(i.aborted||(yield this.alertService.alert(u.fD.KeyRecoveryUnableToRecover),this.readdQueueItem(e)),i)}))}handleDecryptionOfAllKeysMatchingCorrectRootKey(e,t,n){return f(this,void 0,void 0,(function*(){if(t){const t=yield this.getWrappingKeyIfApplicable();yield this.encryptionService.setRootKey(e,t)}const i=this.getClientKeyParams(),o=i&&n&&i.compare(n),s=this.removeElementsFromQueueForMatchingKeyParams(e.keyParams).map((e=>o&&!n.compare(e.keyParams)?e.encryptedKey.copy({dirty:!0,dirtyIndex:(0,d.getIncrementedDirtyIndex)()}):e.encryptedKey)),a=(yield this.encryptionService.decryptSplit({usesRootKey:{items:s,key:e}})).filter(d.isDecryptedPayload);this.payloadManager.emitPayloads(a,d.PayloadEmitSource.LocalChanged),yield this.storageService.savePayloads(a),t?this.alertService.alert(u.fD.KeyRecoveryRootKeyReplaced):this.alertService.alert(u.fD.KeyRecoveryKeyRecovered),a.some((e=>e.dirty))&&(yield this.sync.sync()),yield this.notifyEvent(c.KeysRecovered,a),this.removeFromUndecryptables((0,r.Uuids)(a))}))}removeElementsFromQueueForMatchingKeyParams(e){const t=[],n=[];for(const r of this.decryptionQueue)r.keyParams.compare(e)?t.push(r):n.push(r);return this.decryptionQueue=n,t}getDiagnostics(){return Promise.resolve({keyRecovery:{queueLength:this.decryptionQueue.length,isProcessingQueue:this.isProcessingQueue}})}}},81679:(e,t,n)=>{n.d(t,{o:()=>l});var r=n(87901),i=n(95658),o=n(55668),s=n(82648),a=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class l extends o.wcN{constructor(e,t,n,r,i,o,s,a){super(a),this.apiService=e,this.itemManager=t,this.settingsService=n,this.httpSerivce=r,this.protectionService=i,this.mutator=o,this.sync=s,this.internalEventBus=a}deinit(){this.itemManager=void 0,this.settingsService=void 0,this.apiService=void 0,this.httpSerivce=void 0,this.protectionService=void 0,this.mutator=void 0,super.deinit()}canRegisterNewListedAccount(){return null!=this.apiService.user}isNoteAuthorizedForListed(e){return e.authorizedForListed}authorizeNoteForListed(e){return a(this,void 0,void 0,(function*(){return!1!==(yield this.protectionService.authorizeListedPublishing())&&(yield this.mutator.changeItem(e,(e=>{e.authorizedForListed=!0})),this.sync.sync(),!0)}))}requestNewListedAccount(){return a(this,void 0,void 0,(function*(){const e=yield this.getSettingsBasedListedAccounts(),t=yield this.apiService.registerForListedAccount();if(!(0,i.isErrorResponse)(t))for(let t=0;t<4;t++){const t=yield this.getSettingsBasedListedAccounts();if(t.length>e.length)return(0,r.lastElement)(t);yield(0,r.sleep)(3e3,!1)}}))}getListedAccounts(){return a(this,void 0,void 0,(function*(){return[...yield this.getSettingsBasedListedAccounts(),...this.getLegacyListedAccounts()]}))}getListedAccountInfo(e,t){var n;return a(this,void 0,void 0,(function*(){const i=e.hostUrl;let o="".concat(i,"/authors/").concat(e.authorId,"/extension?secret=").concat(e.secret);t&&(o+="&item_uuid=".concat(t));const s=yield this.httpSerivce.getAbsolute(o).catch((e=>{console.error(e)}));if(s&&!(null===(n=s.data)||void 0===n?void 0:n.error)&&s.data&&!(0,r.isString)(s.data))return s}))}getSettingsBasedListedAccounts(){return a(this,void 0,void 0,(function*(){const e=yield this.settingsService.getSetting(s.SettingName.create(s.SettingName.NAMES.ListedAuthorSecrets).getValue());return e?JSON.parse(e):[]}))}getLegacyListedAccounts(){const e=this.itemManager.getItems(s.ContentType.TYPES.ActionsExtension).filter((e=>e.isListedExtension)),t=[];for(const n of e){const e=n.url,r=new URL(e),i=r.pathname.split("/")[2],o=r.search.split("secret=")[1].split("&")[0];t.push({secret:o,authorId:i,hostUrl:r.origin})}return t}}},3876:(e,t,n)=>{n.d(t,{p:()=>s});var r=n(55668),i=n(82648),o=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class s extends r.wcN{constructor(e,t,n,r,i){super(i),this.settingsService=e,this.crypto=t,this.featuresService=n,this.protections=r,this.internalEventBus=i}saveMfaSetting(e){return o(this,void 0,void 0,(function*(){return yield this.settingsService.updateSetting(i.SettingName.create(i.SettingName.NAMES.MfaSecret).getValue(),e,!0)}))}isMfaActivated(){return o(this,void 0,void 0,(function*(){return 0!=(yield this.settingsService.getDoesSensitiveSettingExist(i.SettingName.create(i.SettingName.NAMES.MfaSecret).getValue()))}))}generateMfaSecret(){return o(this,void 0,void 0,(function*(){return this.crypto.generateOtpSecret()}))}getOtpToken(e){return o(this,void 0,void 0,(function*(){return this.crypto.totpToken(e,Date.now(),6,30)}))}enableMfa(e,t){return o(this,void 0,void 0,(function*(){if(null==t||t!==(yield this.getOtpToken(e)))throw new Error(r.Mwm.IncorrectMfa);return this.saveMfaSetting(e)}))}disableMfa(){return o(this,void 0,void 0,(function*(){if(yield this.protections.authorizeMfaDisable())return yield this.settingsService.deleteSetting(i.SettingName.create(i.SettingName.NAMES.MfaSecret).getValue())}))}deinit(){this.settingsService=void 0,this.crypto=void 0,this.featuresService=void 0,super.deinit()}}},8740:(e,t,n)=>{n.d(t,{H:()=>u});var r=n(58386),i=n(94986),o=n(87901),s=n(55668),a=n(43361),l=n(42798),c=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class u extends s.wcN{constructor(e){super(e.internalEventBus),this.services=e}deinit(){this.services=void 0,this.activeMigrations&&(this.activeMigrations.length=0),super.deinit()}initialize(){return c(this,void 0,void 0,(function*(){yield this.runBaseMigrationPreRun();const e=u.getRequiredMigrations(yield this.getStoredSnjsVersion());this.activeMigrations=this.instantiateMigrationClasses(e),this.activeMigrations.length>0?(0,o.lastElement)(this.activeMigrations).onDone((()=>c(this,void 0,void 0,(function*(){yield this.markMigrationsAsDone()})))):yield this.markMigrationsAsDone()}))}markMigrationsAsDone(){return c(this,void 0,void 0,(function*(){yield this.services.deviceInterface.setRawStorageValue((0,s.xLN)(this.services.identifier,s.Bq2.SnjsVersion),i.in)}))}runBaseMigrationPreRun(){return c(this,void 0,void 0,(function*(){this.baseMigration=new r._(this.services),yield this.baseMigration.preRun()}))}handleEvent(e){return c(this,void 0,void 0,(function*(){if(e.type===s.n9K.ApplicationStageChanged){const t=e.payload.stage;yield this.handleStage(t)}}))}handleApplicationEvent(e){return c(this,void 0,void 0,(function*(){e===s.n9K.SignedIn&&(yield this.handleStage(s.Ugm.SignedIn_30))}))}hasPendingMigrations(){return c(this,void 0,void 0,(function*(){return u.getRequiredMigrations(yield this.getStoredSnjsVersion()).length>0||(yield this.baseMigration.needsKeychainRepair())}))}getStoredSnjsVersion(){return c(this,void 0,void 0,(function*(){const e=yield this.services.deviceInterface.getRawStorageValue((0,s.xLN)(this.services.identifier,s.Bq2.SnjsVersion));if(!e)throw a.W.error(Error("Snjs version missing from storage, run base migration."));return e}))}static getRequiredMigrations(e){const t=[],n=l.R_.sort(((e,t)=>(0,i.D8)(e.version(),t.version())));for(const r of n){const n=r.version();n!==e&&(0,i.jV)(e,n)&&t.push(r)}return t}instantiateMigrationClasses(e){return e.map((e=>new e(this.services)))}handleStage(e){return c(this,void 0,void 0,(function*(){if(yield this.baseMigration.handleStage(e),!this.activeMigrations)throw new Error("Invalid active migrations");for(const t of this.activeMigrations)yield t.handleStage(e)}))}getDiagnostics(){return Promise.resolve({migrations:{activeMigrations:this.activeMigrations&&this.activeMigrations.map((e=>typeof e))}})}}},28178:(e,t,n)=>{n.d(t,{V:()=>u});var r=n(55668),i=n(86999),o=n(82648),s=n(38529),a=n(22325),l=n(87901),c=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class u extends r.wcN{constructor(e,t,n,r){super(r),this.itemManager=e,this.payloadManager=t,this.alerts=n,this.internalEventBus=r}deinit(){super.deinit(),this.itemManager=void 0,this.payloadManager=void 0}changeItem(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.MutationType.UpdateUserTimestamps,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.PayloadEmitSource.LocalChanged,i=arguments.length>4?arguments[4]:void 0;return c(this,void 0,void 0,(function*(){return(yield this.changeItems([e],t,n,r,i))[0]}))}changeItems(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.MutationType.UpdateUserTimestamps,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.PayloadEmitSource.LocalChanged,i=arguments.length>4?arguments[4]:void 0;return c(this,void 0,void 0,(function*(){const o=this.itemManager.findItemsIncludingBlanks((0,l.Uuids)(e)),s=[];for(const e of o){if(!e)throw Error("Attempting to change non-existant item");const r=(0,a.CreateDecryptedMutatorForItem)(e,n);t&&t(r);const i=r.getResult();s.push(i)}return yield this.payloadManager.emitPayloads(s,r,i),this.itemManager.findItems(s.map((e=>e.uuid)))}))}runTransactionalMutations(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.PayloadEmitSource.LocalChanged,n=arguments.length>2?arguments[2]:void 0;return c(this,void 0,void 0,(function*(){const r=[];for(const t of e){const e=this.itemManager.findItem(t.itemUuid);if(!e)continue;const n=(0,a.CreateDecryptedMutatorForItem)(e,t.mutationType||a.MutationType.UpdateUserTimestamps);t.mutate(n);const i=n.getResult();r.push(i)}return yield this.payloadManager.emitPayloads(r,t,n),this.itemManager.findItems(r.map((e=>e.uuid)))}))}runTransactionalMutation(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.PayloadEmitSource.LocalChanged,n=arguments.length>2?arguments[2]:void 0;return c(this,void 0,void 0,(function*(){const r=this.itemManager.findSureItem(e.itemUuid),i=(0,a.CreateDecryptedMutatorForItem)(r,e.mutationType||a.MutationType.UpdateUserTimestamps);e.mutate(i);const o=i.getResult();return yield this.payloadManager.emitPayloads([o],t,n),this.itemManager.findItem(o.uuid)}))}changeNote(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.MutationType.UpdateUserTimestamps,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.PayloadEmitSource.LocalChanged,i=arguments.length>4?arguments[4]:void 0;return c(this,void 0,void 0,(function*(){const o=this.itemManager.findItem(e.uuid);if(!o)throw Error("Attempting to change non-existant note");const s=new a.NoteMutator(o,n);return this.applyTransform(s,t,r,i)}))}changeTag(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.MutationType.UpdateUserTimestamps,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.PayloadEmitSource.LocalChanged,i=arguments.length>4?arguments[4]:void 0;return c(this,void 0,void 0,(function*(){const o=this.itemManager.findItem(e.uuid);if(!o)throw Error("Attempting to change non-existant tag");const s=new a.TagMutator(o,n);return yield this.applyTransform(s,t,r,i),this.itemManager.findSureItem(e.uuid)}))}changeComponent(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.MutationType.UpdateUserTimestamps,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.PayloadEmitSource.LocalChanged,i=arguments.length>4?arguments[4]:void 0;return c(this,void 0,void 0,(function*(){const o=this.itemManager.findItem(e.uuid);if(!o)throw Error("Attempting to change non-existant component");const s=new a.ComponentMutator(o,n);return yield this.applyTransform(s,t,r,i),this.itemManager.findSureItem(e.uuid)}))}changeFeatureRepo(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.MutationType.UpdateUserTimestamps,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.PayloadEmitSource.LocalChanged,i=arguments.length>4?arguments[4]:void 0;return c(this,void 0,void 0,(function*(){const o=this.itemManager.findItem(e.uuid);if(!o)throw Error("Attempting to change non-existant repo");const s=new a.FeatureRepoMutator(o,n);return yield this.applyTransform(s,t,r,i),this.itemManager.findSureItem(e.uuid)}))}changeActionsExtension(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.MutationType.UpdateUserTimestamps,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.PayloadEmitSource.LocalChanged,i=arguments.length>4?arguments[4]:void 0;return c(this,void 0,void 0,(function*(){const o=this.itemManager.findItem(e.uuid);if(!o)throw Error("Attempting to change non-existant extension");const s=new a.ActionsExtensionMutator(o,n);return yield this.applyTransform(s,t,r,i),this.itemManager.findSureItem(e.uuid)}))}changeItemsKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.MutationType.UpdateUserTimestamps,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.PayloadEmitSource.LocalChanged,o=arguments.length>4?arguments[4]:void 0;return c(this,void 0,void 0,(function*(){const s=this.itemManager.findItem(e.uuid);if(!s)throw Error("Attempting to change non-existant itemsKey");const a=new i.tn(s,n);return yield this.applyTransform(a,t,r,o),this.itemManager.findSureItem(e.uuid)}))}applyTransform(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.PayloadEmitSource.LocalChanged,r=arguments.length>3?arguments[3]:void 0;return c(this,void 0,void 0,(function*(){t(e);const i=e.getResult();return this.payloadManager.emitPayload(i,n,r)}))}setItemDirty(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return c(this,void 0,void 0,(function*(){return(yield this.setItemsDirty([e],t))[0]}))}setItemsDirty(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return c(this,void 0,void 0,(function*(){return this.changeItems(e,void 0,t?a.MutationType.UpdateUserTimestamps:a.MutationType.NoUpdateUserTimestamps)}))}duplicateItem(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;return c(this,void 0,void 0,(function*(){const r=this.itemManager.findSureItem(e.uuid).payload.copy(),i=(0,a.PayloadsByDuplicating)({payload:r,baseCollection:this.payloadManager.getMasterCollection(),isConflict:t,additionalContent:Object.assign({appData:{[a.DefaultAppDomain]:{[a.AppDataField.UserModifiedDate]:new Date}}},n)});return yield this.payloadManager.emitPayloads(i,a.PayloadEmitSource.LocalChanged),this.itemManager.findSureItem(i[0].uuid)}))}createItem(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;return c(this,void 0,void 0,(function*(){const i=new a.DecryptedPayload(Object.assign(Object.assign({uuid:l.UuidGenerator.GenerateUuid(),content_type:e,content:(0,a.FillItemContent)(t),dirty:n},(0,a.PayloadVaultOverrides)(r)),(0,a.PayloadTimestampDefaults)()));return yield this.payloadManager.emitPayload(i,a.PayloadEmitSource.LocalInserted),this.itemManager.findSureItem(i.uuid)}))}insertItem(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return c(this,void 0,void 0,(function*(){if(this.itemManager.findItem(e.uuid))throw Error("Attempting to insert item that already exists");if(t){const t=(0,a.CreateDecryptedMutatorForItem)(e,a.MutationType.UpdateUserTimestamps).getResult();return yield this.emitItemFromPayload(t,a.PayloadEmitSource.LocalInserted)}return this.emitItemFromPayload(e.payload,a.PayloadEmitSource.LocalChanged)}))}insertItems(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.PayloadEmitSource.LocalInserted;return c(this,void 0,void 0,(function*(){return this.emitItemsFromPayloads(e.map((e=>e.payload)),t)}))}emitItemFromPayload(e,t){return c(this,void 0,void 0,(function*(){yield this.payloadManager.emitPayload(e,t);const n=this.itemManager.findSureItem(e.uuid);if(!n)throw Error("Emitted item can't be found");return n}))}emitItemsFromPayloads(e,t){return c(this,void 0,void 0,(function*(){yield this.payloadManager.emitPayloads(e,t);const n=(0,l.Uuids)(e);return this.itemManager.findItems(n)}))}setItemToBeDeleted(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.PayloadEmitSource.LocalChanged;return c(this,void 0,void 0,(function*(){const n=this.itemManager.getCollection().uuidsThatReferenceUuid(e.uuid),r=this.itemManager.findAnyItem(e.uuid);if(!r)return;const i=new a.DeleteItemMutator(r,a.MutationType.UpdateUserTimestamps).getDeletedResult();yield this.payloadManager.emitPayload(i,t);for(const e of n){const t=this.itemManager.findItem(e);t&&(yield this.changeItem(t,(e=>{e.removeItemAsRelationship(r)})))}}))}setItemsToBeDeleted(e){return c(this,void 0,void 0,(function*(){yield Promise.all(e.map((e=>this.setItemToBeDeleted(e))))}))}findOrCreateTagParentChain(e){return c(this,void 0,void 0,(function*(){let t;for(const n of e)t=yield this.findOrCreateTagByTitle({title:n,parentItemToLookupUuidFor:t});if(!t)throw new Error("Invalid tag hierarchy");return t}))}createTag(e){return c(this,void 0,void 0,(function*(){const t=yield this.createItem(o.ContentType.TYPES.Tag,(0,a.FillItemContent)({title:e.title}),!0,e.createInVault);if(e.parentItemToLookupUuidFor){const n=this.itemManager.findItem(e.parentItemToLookupUuidFor.uuid);if(!n)throw new Error("Invalid parent tag");return this.changeTag(t,(e=>{e.makeChildOf(n)}))}return t}))}createSmartView(e){return c(this,void 0,void 0,(function*(){return this.createItem(o.ContentType.TYPES.SmartView,(0,a.FillItemContent)({title:e.title,predicate:e.predicate.toJson(),iconString:e.iconString||a.SmartViewDefaultIconName}),!0,e.vault)}))}createSmartViewFromDSL(e,t){return c(this,void 0,void 0,(function*(){let n=null;try{n=JSON.parse(e.substring(1,e.length))}catch(e){throw Error("Invalid smart view syntax")}const r=n[0],i=(0,a.predicateFromDSLString)(e);return this.createSmartView({title:r,predicate:i,vault:t})}))}createTagOrSmartView(e,t){return c(this,void 0,void 0,(function*(){return this.itemManager.isSmartViewTitle(e)?this.createSmartViewFromDSL(e,t):this.createTag({title:e,createInVault:t})}))}findOrCreateTagByTitle(e){return c(this,void 0,void 0,(function*(){return this.itemManager.findTagByTitleAndParent(e.title,e.parentItemToLookupUuidFor)||this.createTag(e)}))}renameFile(e,t){return this.changeItem(e,(e=>{e.name=t}))}mergeItem(e,t){return c(this,void 0,void 0,(function*(){return this.emitItemFromPayload(e.payloadRepresentation(),t)}))}setItemNeedsSync(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return c(this,void 0,void 0,(function*(){return this.setItemDirty(e,t)}))}setItemsNeedsSync(e){return c(this,void 0,void 0,(function*(){return this.setItemsDirty(e)}))}deleteItem(e){return c(this,void 0,void 0,(function*(){return this.deleteItems([e])}))}deleteItems(e){return c(this,void 0,void 0,(function*(){yield this.setItemsToBeDeleted(e)}))}emptyTrash(){return c(this,void 0,void 0,(function*(){const e=this.itemManager.trashedItems;yield this.setItemsToBeDeleted(e)}))}migrateTagsToFolders(){return c(this,void 0,void 0,(function*(){yield s.l.run(this.itemManager,this)}))}findOrCreateTag(e,t){return c(this,void 0,void 0,(function*(){return this.findOrCreateTagByTitle({title:e,createInVault:t})}))}setTagParent(e,t){return c(this,void 0,void 0,(function*(){if(e.uuid===t.uuid)throw new Error("Can not set a tag parent of itself");if(this.itemManager.isTagAncestor(t,e))throw new Error("Can not set a tag ancestor of itself");return this.changeTag(t,(t=>{t.makeChildOf(e)}))}))}unsetTagParent(e){return this.itemManager.getTagParent(e)?this.changeTag(e,(e=>{e.unsetParent()})):Promise.resolve(e)}associateFileWithNote(e,t){return c(this,void 0,void 0,(function*(){if(!e.key_system_identifier||!t.key_system_identifier||e.key_system_identifier===t.key_system_identifier)return this.changeItem(e,(e=>{e.addNote(t)}));this.alerts.alert("The items you are trying to link belong to different vaults and cannot be linked")}))}disassociateFileWithNote(e,t){return c(this,void 0,void 0,(function*(){return this.changeItem(e,(e=>{e.removeNote(t)}))}))}addTagToNote(e,t,n){return c(this,void 0,void 0,(function*(){if(t.key_system_identifier!==e.key_system_identifier)return void this.alerts.alert("The items you are trying to link belong to different vaults and cannot be linked");let r=[t];return n&&(r=[...this.itemManager.getTagParentChain(t),t]),Promise.all(r.map((t=>this.changeTag(t,(t=>{t.addNote(e)})))))}))}addTagToFile(e,t,n){return c(this,void 0,void 0,(function*(){if(t.key_system_identifier!==e.key_system_identifier)return void this.alerts.alert("The items you are trying to link belong to different vaults and cannot be linked");let r=[t];return n&&(r=[...this.itemManager.getTagParentChain(t),t]),Promise.all(r.map((t=>this.changeTag(t,(t=>{t.addFile(e)})))))}))}linkNoteToNote(e,t){return c(this,void 0,void 0,(function*(){return this.changeItem(e,(e=>{e.addNote(t)}))}))}linkFileToFile(e,t){return c(this,void 0,void 0,(function*(){return this.changeItem(e,(e=>{e.addFile(t)}))}))}unlinkItems(e,t){return c(this,void 0,void 0,(function*(){const n=this.itemManager.relationshipDirectionBetweenItems(e,t);if(n===r.uMm.NoRelationship)throw new Error("Trying to unlink already unlinked items");const i=n===r.uMm.AReferencesB?e:t,o=i===e?t:e;return this.changeItem(i,(e=>{e.removeItemAsRelationship(o)}))}))}}},64892:(e,t,n)=>{n.d(t,{O:()=>l});var r=n(82648),i=n(87901),o=n(22325),s=n(55668),a=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class l extends s.wcN{constructor(e,t){super(t),this.logger=e,this.internalEventBus=t,this.changeObservers=[],this.emitQueue=[],this.collection=new o.PayloadCollection}getMasterCollection(){return o.ImmutablePayloadCollection.FromCollection(this.collection)}deinit(){super.deinit(),this.changeObservers.length=0,this.resetState()}resetState(){this.collection=new o.PayloadCollection}find(e){return this.collection.findAll(e)}findOne(e){return this.collection.findAll([e])[0]}all(e){return this.collection.all(e)}get integrityPayloads(){return this.collection.integrityPayloads()}get nonDeletedItems(){return this.collection.nondeletedElements()}get invalidPayloads(){return this.collection.invalidElements()}emitDeltaEmit(e,t){var n;return a(this,void 0,void 0,(function*(){return 0===e.emits.length&&0===(null===(n=e.ignored)||void 0===n?void 0:n.length)?[]:new Promise((n=>{const r={emit:e,sourceKey:t,resolve:n};this.emitQueue.push(r),1===this.emitQueue.length&&this.popQueue()}))}))}emitPayload(e,t,n){return a(this,void 0,void 0,(function*(){return this.emitPayloads([e],t,n)}))}emitPayloads(e,t,n){return a(this,void 0,void 0,(function*(){const r={emits:e,source:t};return this.emitDeltaEmit(r,n)}))}popQueue(){const e=this.emitQueue[0],{changed:t,inserted:n,discarded:r,unerrored:o}=this.applyPayloads(e.emit.emits);this.notifyChangeObservers(t,n,r,e.emit.ignored||[],o,e.emit.source,e.sourceKey),(0,i.removeFromArray)(this.emitQueue,e),e.resolve([...t,...n,...r]),this.emitQueue.length>0&&this.popQueue()}applyPayloads(e){const t=[],n=[],r=[],i=[];for(const s of e){if(!s.uuid||!s.content_type){console.error("Payload is corrupt",s);continue}this.logger.debug("applying payload",s.uuid,"globalDirtyIndexAtLastSync",s.globalDirtyIndexAtLastSync,"dirtyIndex",s.dirtyIndex,"dirty",s.dirty);const e=this.collection.find(s.uuid);(0,o.isDeletedPayload)(s)&&s.discardable?(this.collection.discard(s),r.push(s)):(this.collection.set(s),e?(t.push(s),(0,o.isEncryptedPayload)(e)&&(0,o.isDecryptedPayload)(s)&&i.push(s)):n.push(s))}return{changed:t,inserted:n,discarded:r,unerrored:i}}addObserver(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;Array.isArray(e)||(e=[e]);const r={types:e,priority:n,callback:t};this.changeObservers.push(r);const o=this.changeObservers;return()=>{(0,i.removeFromArray)(o,r)}}notifyChangeObservers(e,t,n,i,o,s,a){const l=this.changeObservers.slice().sort(((e,t)=>e.priority<t.priority?-1:1)),c=(e,t)=>t.includes(r.ContentType.TYPES.Any)?e.slice():e.slice().filter((e=>t.includes(e.content_type)));for(const r of l)r.callback({changed:c(e,r.types),inserted:c(t,r.types),discarded:c(n,r.types),ignored:c(i,r.types),unerrored:c(o,r.types),source:s,sourceKey:a})}importPayloads(e,t){return a(this,void 0,void 0,(function*(){const n=e.map((e=>e.copy(void 0,o.PayloadSource.FileImport))),r=new o.DeltaFileImport(this.getMasterCollection(),n,t).result();return yield this.emitDeltaEmit(r),(0,i.Uuids)(e)}))}removePayloadLocally(e){this.collection.discard(e)}erroredPayloadsForContentType(e){return this.collection.invalidElements().filter((t=>t.content_type===e))}deleteErroredPayloads(e){return a(this,void 0,void 0,(function*(){const t=e.map((e=>new o.DeletedPayload(Object.assign(Object.assign({},e.ejected()),{deleted:!0,content:void 0,dirty:!0,dirtyIndex:(0,o.getIncrementedDirtyIndex)()}),e.source)));yield this.emitPayloads(t,o.PayloadEmitSource.LocalChanged)}))}getDiagnostics(){return Promise.resolve({payloads:{integrityPayloads:this.integrityPayloads,nonDeletedItemCount:this.nonDeletedItems.length,invalidPayloadsCount:this.invalidPayloads.length}})}}},30693:(e,t,n)=>{n.d(t,{y:()=>a});var r=n(22325),i=n(55668),o=n(82648),s=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class a extends i.wcN{constructor(e,t,n,r,s,a){super(a),this.singletons=e,this.mutator=n,this.sync=r,this.storage=s,this.internalEventBus=a,this.shouldReload=!0,this.reloading=!1,this.localPreferences={},this.removeItemObserver=t.addObserver(o.ContentType.TYPES.UserPrefs,(()=>{this.shouldReload=!0})),this.removeSyncObserver=r.addEventObserver((e=>{e!==i.wMo.SyncCompletedWithAllItemsUploaded&&e!==i.wMo.LocalDataIncrementalLoad||this.reload()}))}deinit(){var e,t;null===(e=this.removeItemObserver)||void 0===e||e.call(this),null===(t=this.removeSyncObserver)||void 0===t||t.call(this),this.singletons=void 0,this.mutator=void 0,super.deinit()}handleEvent(e){var t;return s(this,void 0,void 0,(function*(){if(e.type===i.n9K.ApplicationStageChanged){const n=e.payload.stage;n===i.Ugm.LoadedDatabase_12?(this.preferences=this.singletons.findSingleton(o.ContentType.TYPES.UserPrefs,r.SNUserPrefs.singletonPredicate),this.preferences&&this.notifyEvent(i.WZd.PreferencesChanged)):n===i.Ugm.StorageDecrypted_09&&(this.localPreferences=null!==(t=this.storage.getValue(i.QtK.LocalPreferences))&&void 0!==t?t:{},this.notifyEvent(i.WZd.LocalPreferencesChanged))}}))}getLocalValue(e,t){var n;return null!==(n=this.localPreferences[e])&&void 0!==n?n:t}getValue(e,t){var n,r;return null!==(r=null===(n=this.preferences)||void 0===n?void 0:n.getPref(e))&&void 0!==r?r:t}setLocalValue(e,t){this.localPreferences[e]=t,this.storage.setValue(i.QtK.LocalPreferences,this.localPreferences),this.notifyEvent(i.WZd.LocalPreferencesChanged)}setValue(e,t){return s(this,void 0,void 0,(function*(){yield this.setValueDetached(e,t),this.notifyEvent(i.WZd.PreferencesChanged),this.sync.sync({sourceDescription:"PreferencesService.setValue"})}))}setValueDetached(e,t){return s(this,void 0,void 0,(function*(){this.preferences&&(this.preferences=yield this.mutator.changeItem(this.preferences,(n=>{n.setPref(e,t)})))}))}reload(){return s(this,void 0,void 0,(function*(){if(this.shouldReload&&!this.reloading){this.reloading=!0;try{const e=this.preferences;this.preferences=yield this.singletons.findOrCreateContentTypeSingleton(o.ContentType.TYPES.UserPrefs,(0,r.FillItemContent)({})),((null==e?void 0:e.uuid)!==this.preferences.uuid||this.preferences.userModifiedDate>e.userModifiedDate)&&this.notifyEvent(i.WZd.PreferencesChanged),this.shouldReload=!1}finally{this.reloading=!1}}}))}}},51271:(e,t,n)=>{n.d(t,{n:()=>d});var r=n(43361),i=n(22325),o=n(87901),s=n(55668),a=n(82648),l=n(17956),c=n(97210),u=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class d extends s.wcN{constructor(e,t,n,r,i){super(i),this.encryption=e,this.mutator=t,this.challenges=n,this.storage=r,this.internalEventBus=i,this.sessionExpiryTimeout=-1,this.mobilePasscodeTiming=s.sNv.OnQuit,this.mobileBiometricsTiming=s.sNv.OnQuit,this.isBiometricsSoftLockEngaged=!1,this.applicationStarted=!1}deinit(){clearTimeout(this.sessionExpiryTimeout),this.encryption=void 0,this.challenges=void 0,this.storage=void 0,super.deinit()}handleEvent(e){return u(this,void 0,void 0,(function*(){e.type===s.n9K.ApplicationStageChanged?e.payload.stage===s.Ugm.LoadedDatabase_12&&(this.updateSessionExpiryTimer(this.getSessionExpiryDate()),this.mobilePasscodeTiming=this.getMobilePasscodeTiming(),this.mobileBiometricsTiming=this.getMobileBiometricsTiming()):e.type===s.n9K.Started&&(this.applicationStarted=!0)}))}isLocked(){return u(this,void 0,void 0,(function*(){return!this.applicationStarted||(yield this.encryption.isPasscodeLocked())||this.isBiometricsSoftLockEngaged}))}softLockBiometrics(){const e=new s.tv4([new s.FEo(s.tQn.Biometric)],s.Ps8.ApplicationUnlock,!1);this.challenges.promptForChallengeResponse(e),this.isBiometricsSoftLockEngaged=!0,this.notifyEvent(s.Hh3.BiometricsSoftLockEngaged),this.challenges.addChallengeObserver(e,{onComplete:()=>{this.isBiometricsSoftLockEngaged=!1,this.notifyEvent(s.Hh3.BiometricsSoftLockDisengaged)}})}hasProtectionSources(){return this.encryption.hasAccount()||this.encryption.hasPasscode()||this.hasBiometricsEnabled()}hasUnprotectedAccessSession(){return!this.hasProtectionSources()||this.getSessionExpiryDate()>new Date}hasBiometricsEnabled(){const e=this.storage.getValue(s.QtK.BiometricsState,s.qt7.Nonwrapped);return Boolean(e)}enableBiometrics(){return this.hasBiometricsEnabled()?(r.W.onError(Error("Tried to enable biometrics when they already are enabled.")),!1):(this.storage.setValue(s.QtK.BiometricsState,!0,s.qt7.Nonwrapped),!0)}disableBiometrics(){return u(this,void 0,void 0,(function*(){return this.hasBiometricsEnabled()?!!(yield this.validateOrRenewSession(s.Ps8.DisableBiometrics))&&(this.storage.setValue(s.QtK.BiometricsState,!1,s.qt7.Nonwrapped),!0):(r.W.onError(Error("Tried to disable biometrics when they already are disabled.")),!1)}))}createLaunchChallenge(){const e=[];return this.hasBiometricsEnabled()&&e.push(new s.FEo(s.tQn.Biometric)),this.encryption.hasPasscode()&&e.push(new s.FEo(s.tQn.LocalPasscode)),e.length>0?new s.tv4(e,s.Ps8.ApplicationUnlock,!1):void 0}authorizeProtectedActionForItems(e,t){return u(this,void 0,void 0,(function*(){let n;const r=[];for(const i of e){const e=i.protected&&!this.hasUnprotectedAccessSession();e&&!n&&(n=this.validateOrRenewSession(t)),e&&!(yield n)||r.push(i)}return r}))}authorizeItemAccess(e){return u(this,void 0,void 0,(function*(){return!e.protected||this.authorizeAction(e.content_type===a.ContentType.TYPES.Note?s.Ps8.AccessProtectedNote:s.Ps8.AccessProtectedFile,{fallBackToAccountPassword:!0,requireAccountPassword:!1,forcePrompt:!1})}))}authorizeAddingPasscode(){return this.authorizeAction(s.Ps8.AddPasscode,{fallBackToAccountPassword:!0,requireAccountPassword:!1,forcePrompt:!1})}authorizeChangingPasscode(){return this.authorizeAction(s.Ps8.ChangePasscode,{fallBackToAccountPassword:!0,requireAccountPassword:!1,forcePrompt:!1})}authorizeRemovingPasscode(){return this.authorizeAction(s.Ps8.RemovePasscode,{fallBackToAccountPassword:!0,requireAccountPassword:!1,forcePrompt:!1})}authorizeSearchingProtectedNotesText(){return this.authorizeAction(s.Ps8.SearchProtectedNotesText,{fallBackToAccountPassword:!0,requireAccountPassword:!1,forcePrompt:!1})}authorizeFileImport(){return this.authorizeAction(s.Ps8.ImportFile,{fallBackToAccountPassword:!0,requireAccountPassword:!1,forcePrompt:!1})}authorizeBackupCreation(){return u(this,void 0,void 0,(function*(){return this.authorizeAction(s.Ps8.ExportBackup,{fallBackToAccountPassword:!0,requireAccountPassword:!1,forcePrompt:!1})}))}authorizeMfaDisable(){return u(this,void 0,void 0,(function*(){return this.authorizeAction(s.Ps8.DisableMfa,{fallBackToAccountPassword:!0,requireAccountPassword:!0,forcePrompt:!1})}))}authorizeAutolockIntervalChange(){return u(this,void 0,void 0,(function*(){return this.authorizeAction(s.Ps8.ChangeAutolockInterval,{fallBackToAccountPassword:!0,requireAccountPassword:!1,forcePrompt:!1})}))}authorizeSessionRevoking(){return u(this,void 0,void 0,(function*(){return this.authorizeAction(s.Ps8.RevokeSession,{fallBackToAccountPassword:!0,requireAccountPassword:!1,forcePrompt:!1})}))}authorizeListedPublishing(){return u(this,void 0,void 0,(function*(){return this.authorizeAction(s.Ps8.AuthorizeNoteForListed,{fallBackToAccountPassword:!0,requireAccountPassword:!1,forcePrompt:!0})}))}authorizeAction(e,t){return u(this,void 0,void 0,(function*(){return this.validateOrRenewSession(e,t)}))}getMobilePasscodeTimingOptions(){return[{title:"Immediately",key:s.sNv.Immediately,selected:this.mobilePasscodeTiming===s.sNv.Immediately},{title:"On Quit",key:s.sNv.OnQuit,selected:this.mobilePasscodeTiming===s.sNv.OnQuit}]}getMobileBiometricsTimingOptions(){return[{title:"Immediately",key:s.sNv.Immediately,selected:this.mobileBiometricsTiming===s.sNv.Immediately},{title:"On Quit",key:s.sNv.OnQuit,selected:this.mobileBiometricsTiming===s.sNv.OnQuit}]}getMobileBiometricsTiming(){return this.storage.getValue(s.QtK.MobileBiometricsTiming,s.qt7.Nonwrapped,s.sNv.OnQuit)}getMobilePasscodeTiming(){return this.storage.getValue(s.QtK.MobilePasscodeTiming,s.qt7.Nonwrapped,s.sNv.OnQuit)}setMobileBiometricsTiming(e){this.storage.setValue(s.QtK.MobileBiometricsTiming,e,s.qt7.Nonwrapped),this.mobileBiometricsTiming=e}setMobilePasscodeTiming(e){this.storage.setValue(s.QtK.MobilePasscodeTiming,e,s.qt7.Nonwrapped),this.mobilePasscodeTiming=e}setMobileScreenshotPrivacyEnabled(e){return this.storage.setValue(s.QtK.MobileScreenshotPrivacyEnabled,e,s.qt7.Default)}getMobileScreenshotPrivacyEnabled(){return this.storage.getValue(s.QtK.MobileScreenshotPrivacyEnabled,s.qt7.Default,!1)}validateOrRenewSession(e){let{fallBackToAccountPassword:t=!0,requireAccountPassword:n=!1,forcePrompt:i=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var a;return u(this,void 0,void 0,(function*(){if(this.getSessionExpiryDate()>new Date&&!i)return!0;const u=[];if(this.hasBiometricsEnabled()&&u.push(new s.FEo(s.tQn.Biometric)),this.encryption.hasPasscode()&&u.push(new s.FEo(s.tQn.LocalPasscode)),n){if(!this.encryption.hasAccount())throw Error("Requiring account password for challenge with no account");u.push(new s.FEo(s.tQn.AccountPassword))}if(0===u.length){if(!t||!this.encryption.hasAccount())return!0;u.push(new s.FEo(s.tQn.AccountPassword))}const d=this.getLastSessionLength(),h=(0,l.z)(d)?d:c.F.OneMinute;u.push(new s.FEo(s.tQn.ProtectionSessionDuration,void 0,void 0,void 0,void 0,h));const p=yield this.challenges.promptForChallengeResponse(new s.tv4(u,e,!0));if(p){const e=null===(a=p.values.find((e=>e.prompt.validation===s.tQn.ProtectionSessionDuration)))||void 0===a?void 0:a.value;return(0,o.isNullOrUndefined)(e)?r.W.error(Error("No valid protection session length found. Got "+e)):this.setSessionLength(e),!0}return!1}))}getSessionExpiryDate(){const e=this.storage.getValue(s.QtK.ProtectionExpirey);return e?new Date(e):new Date}clearSession(){return this.setSessionExpiryDate(new Date),this.notifyEvent(s.Hh3.UnprotectedSessionExpired)}setSessionExpiryDate(e){this.storage.setValue(s.QtK.ProtectionExpirey,e)}getLastSessionLength(){return this.storage.getValue(s.QtK.ProtectionSessionLength)}setSessionLength(e){this.storage.setValue(s.QtK.ProtectionSessionLength,e);const t=new Date;t.setSeconds(t.getSeconds()+e),this.setSessionExpiryDate(t),this.updateSessionExpiryTimer(t),this.notifyEvent(s.Hh3.UnprotectedSessionBegan)}updateSessionExpiryTimer(e){clearTimeout(this.sessionExpiryTimeout),this.sessionExpiryTimeout=setTimeout((()=>{this.clearSession()}),e.getTime()-Date.now())}protectItems(e){return u(this,void 0,void 0,(function*(){return yield this.mutator.changeItems(e,(e=>{e.protected=!0}),i.MutationType.NoUpdateUserTimestamps)}))}unprotectItems(e,t){return u(this,void 0,void 0,(function*(){if(yield this.authorizeAction(t,{fallBackToAccountPassword:!0,requireAccountPassword:!1,forcePrompt:!1}))return yield this.mutator.changeItems(e,(e=>{e.protected=!1}),i.MutationType.NoUpdateUserTimestamps)}))}protectNote(e){return u(this,void 0,void 0,(function*(){return(yield this.protectItems([e]))[0]}))}unprotectNote(e){return u(this,void 0,void 0,(function*(){const t=yield this.unprotectItems([e],s.Ps8.UnprotectNote);return t?t[0]:void 0}))}protectNotes(e){return u(this,void 0,void 0,(function*(){return this.protectItems(e)}))}unprotectNotes(e){return u(this,void 0,void 0,(function*(){return(yield this.unprotectItems(e,s.Ps8.UnprotectNote))||[]}))}protectFile(e){return u(this,void 0,void 0,(function*(){return(yield this.protectItems([e]))[0]}))}unprotectFile(e){return u(this,void 0,void 0,(function*(){const t=yield this.unprotectItems([e],s.Ps8.UnprotectFile);return t?t[0]:void 0}))}}},97210:(e,t,n)=>{var r;n.d(t,{F:()=>r}),function(e){e[e.OneMinute=60]="OneMinute",e[e.FiveMinutes=300]="FiveMinutes",e[e.OneHour=3600]="OneHour",e[e.OneWeek=604800]="OneWeek"}(r||(r={}))},17956:(e,t,n)=>{n.d(t,{z:()=>i});var r=n(97210);function i(e){return"number"==typeof e&&Object.values(r.F).includes(e)}},53218:(e,t,n)=>{n.d(t,{aM:()=>p,Sn:()=>f,Sj:()=>m});var r=n(55668),i=n(95658),o=n(22325),s=n(82648),a=n(86999),l=n(20875),c=n(52450),u=n(70781);const d=e=>e.trim().toLowerCase();var h=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};const p=8,f="missing-params",g=18e5;class m extends r.wcN{constructor(e,t,n,i,o,s,a,l,c,u,d,h,p,f,g){super(g),this.storage=e,this.apiService=t,this.userApiService=n,this.alertService=i,this.encryptionService=o,this.crypto=s,this.challengeService=a,this.webSocketsService=l,this.httpService=c,this.sessionStorageMapper=u,this.legacySessionStorageMapper=d,this.workspaceIdentifier=h,this._getKeyPairs=p,this.isApplicationUsingThirdPartyHostUseCase=f,this.internalEventBus=g,this.isSessionRenewChallengePresented=!1,t.setInvalidSessionObserver((e=>{e?this.notifyEvent(r.Pxr.Revoked):this.reauthenticateInvalidSession()}))}handleEvent(e){return h(this,void 0,void 0,(function*(){switch(e.type){case r.Sf$.SessionRefreshed:this.httpService.setSession(e.payload.session);break;case r.n9K.ApplicationStageChanged:e.payload.stage===r.Ugm.StorageDecrypted_09&&(yield this.initializeFromDisk())}}))}deinit(){this.encryptionService=void 0,this.storage=void 0,this.apiService=void 0,this.alertService=void 0,this.challengeService=void 0,this.webSocketsService=void 0,this.user=void 0,super.deinit()}getWorkspaceDisplayIdentifier(){return this.user?this.user.email:this.workspaceIdentifier}memoizeUser(e){this.user=e,this.apiService.setUser(e)}initializeFromDisk(){return h(this,void 0,void 0,(function*(){if(this.memoizeUser(this.storage.getValue(r.QtK.User)),!this.user){const e=this.storage.getValue(r.QtK.LegacyUuid);e&&this.memoizeUser({uuid:e,email:e})}const e=this.storage.getValue(r.QtK.ServerHost);e&&(this.apiService.setHost(e),this.httpService.setHost(e));const t=this.storage.getValue(r.QtK.Session);if(t)try{const e="jwt"in t?this.legacySessionStorageMapper.toDomain(t):this.sessionStorageMapper.toDomain(t);this.setSession(e,!1)}catch(e){console.error("Could not deserialize session from storage: ".concat(e.message))}}))}setSession(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.session=e,this.httpService.setSession(e),this.apiService.setSession(e,t),this.isSignedIntoFirstPartyServer()&&this.webSocketsService.startWebSocketConnection()}online(){return!this.offline()}offline(){return null==this.apiService.getSession()}getUser(){return this.user}getSureUser(){return this.user}isUserMissingKeyPair(){try{return null==this.getPublicKey()}catch(e){return!0}}getPublicKey(){return this._getKeyPairs.execute().getValue().encryption.publicKey}getSigningPublicKey(){return this._getKeyPairs.execute().getValue().signing.publicKey}get userUuid(){const e=this.getUser();if(!e)throw Error("Attempting to access userUuid when user is undefined");return e.uuid}isCurrentSessionReadOnly(){if(void 0!==this.session)return!(this.session instanceof s.LegacySession)&&this.session.isReadOnly()}getSession(){return this.apiService.getSession()}signOut(){return h(this,void 0,void 0,(function*(){this.memoizeUser(void 0);const e=this.apiService.getSession();e&&e instanceof s.Session&&(yield this.apiService.signOut(),this.webSocketsService.closeWebSocketConnection())}))}isSignedIn(){return null!=this.getUser()}isSignedOut(){return!this.isSignedIn()}isSignedIntoFirstPartyServer(){const e=this.isApplicationUsingThirdPartyHostUseCase.execute();if(e.isFailed())return!1;const t=e.getValue();return this.isSignedIn()&&!t}reauthenticateInvalidSession(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;var n;return h(this,void 0,void 0,(function*(){if(this.isSessionRenewChallengePresented)return;this.isSessionRenewChallengePresented=!0;const o=new r.tv4([new r.FEo(r.tQn.None,void 0,r.K9E.EmailInputPlaceholder,!1),new r.FEo(r.tQn.None,void 0,r.K9E.PasswordInputPlaceholder)],r.Ps8.Custom,e,r.K9E.EnterEmailAndPassword,r.K9E.RecoverSession(null===(n=this.getUser())||void 0===n?void 0:n.email));return new Promise((e=>{this.challengeService.addChallengeObserver(o,{onCancel:()=>{this.isSessionRenewChallengePresented=!1},onComplete:()=>{this.isSessionRenewChallengePresented=!1},onNonvalidatedSubmit:n=>h(this,void 0,void 0,(function*(){const s=n.values[0].value,a=n.values[1].value,l=this.encryptionService.getAccountKeyParams(),{response:c}=yield this.signIn(s,a,!1,this.storage.isEphemeralSession(),null==l?void 0:l.version);(0,i.isErrorResponse)(c)?(this.challengeService.setValidationStatusForChallenge(o,n.values[1],!1),null==t||t(c)):(e(),this.challengeService.completeChallenge(o),this.notifyEvent(r.Pxr.Restored),this.alertService.alert(r.K9E.SessionRestored))}))}),this.challengeService.promptForChallengeResponse(o)}))}))}promptForU2FVerification(e){return h(this,void 0,void 0,(function*(){const t=new r.tv4([new r.FEo(r.tQn.Authenticator,r.fD2.U2F,void 0,!1,void 0,void 0,{username:e})],r.Ps8.Custom,!0,r.K9E.InputU2FDevice),n=yield this.challengeService.promptForChallengeResponse(t);if(n)return n.values[0].value}))}promptForMfaValue(){return h(this,void 0,void 0,(function*(){const e=new r.tv4([new r.FEo(r.tQn.None,r.fD2.Mfa,r.K9E.MfaInputPlaceholder,!1,r.gqK.Numeric)],r.Ps8.Custom,!0,r.K9E.EnterMfa),t=yield this.challengeService.promptForChallengeResponse(e);if(t)return this.challengeService.completeChallenge(e),t.values[0].value}))}register(e,t,n,r){return h(this,void 0,void 0,(function*(){if(t.length<p)throw new u.ApiCallError(u.ErrorMessage.InsufficientPasswordMessage.replace("%LENGTH%",p.toString()));const{wrappingKey:o,canceled:s}=yield this.challengeService.getWrappingKeyIfApplicable();if(s)throw new u.ApiCallError(u.ErrorMessage.PasscodeRequired);e=d(e);const a=yield this.encryptionService.createRootKey(e,t,l.KeyParamsOrigination.Registration),c=a.serverPassword,h=a.keyParams,f=yield this.userApiService.register({email:e,serverPassword:c,hvmToken:n,keyParams:h,ephemeral:r});if((0,i.isErrorResponse)(f))throw new u.ApiCallError((0,i.getErrorFromErrorResponse)(f).message);return yield this.handleAuthentication({rootKey:a,wrappingKey:o,session:f.data.session,user:f.data.user}),f.data}))}retrieveKeyParams(e){return h(this,void 0,void 0,(function*(){const t=yield this.apiService.getAccountKeyParams(e);if((0,i.isErrorResponse)(t)||!t.data){e.mfaCode&&(yield this.alertService.alert(r.Mwm.IncorrectMfa));const n=(0,i.isErrorResponse)(t)?t.data.error:void 0;if(t.data&&[i.ErrorTag.U2FRequired,i.ErrorTag.MfaRequired].includes(null==n?void 0:n.tag)){const t=(null==n?void 0:n.tag)===i.ErrorTag.U2FRequired,o=t?yield this.promptForU2FVerification(e.email):yield this.promptForMfaValue();return o?this.retrieveKeyParams({email:e.email,mfaCode:t?void 0:o,authenticatorResponse:t?o:void 0}):{response:this.apiService.createErrorResponse(r.Mwm.SignInCanceledMissingMfa,void 0,i.ErrorTag.ClientCanceledMfa)}}return{response:t}}const n=(0,a.LW)(t.data,e.email);return n&&n.version?{keyParams:n,response:t,mfaCode:e.mfaCode}:{response:this.apiService.createErrorResponse(r.aWs)}}))}signIn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0;return h(this,void 0,void 0,(function*(){const a=yield this.performSignIn(e,t,n,r,o,s);if((0,i.isErrorResponse)(a.response)&&(0,i.getErrorFromErrorResponse)(a.response).tag!==i.ErrorTag.ClientValidationError&&(0,i.getErrorFromErrorResponse)(a.response).tag!==i.ErrorTag.ClientCanceledMfa){const i=d(e);return i!==e?this.performSignIn(i,t,n,r,o,s):a}return a}))}performSignIn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0;return h(this,void 0,void 0,(function*(){const u=yield this.retrieveKeyParams({email:e});if((0,i.isErrorResponse)(u.response))return{response:u.response};const d=u.keyParams;if(!this.encryptionService.supportedVersions().includes(d.version))return this.encryptionService.isVersionNewerThanLibraryVersion(d.version)?{response:this.apiService.createErrorResponse(r.fnl)}:{response:this.apiService.createErrorResponse(r.R53)};if(l.isProtocolVersionExpired(d.version)){const e=this.encryptionService.costMinimumForVersion(d.version);if(d.content002.pw_cost<e)return{response:this.apiService.createErrorResponse(r.nIe)};const t=c.e.Confirm.ProtocolVersionExpired(d.version);if(!(yield this.alertService.confirm(t.Message,t.Title,t.ConfirmButton)))return{response:this.apiService.createErrorResponse(r.aWs)}}if(!this.encryptionService.platformSupportsKeyDerivation(d))return{response:this.apiService.createErrorResponse(r.VnT)};if(n&&(s=this.encryptionService.getLatestVersion()),null!=s&&!l.leftVersionGreaterThanOrEqualToRight(d.version,s))return{response:this.apiService.createErrorResponse((0,r.OC4)(d.version,s))};const h=yield this.encryptionService.computeRootKey(t,d);return{response:yield this.bypassChecksAndSignInWithRootKey(e,h,o,a)}}))}bypassChecksAndSignInWithRootKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3?arguments[3]:void 0;return h(this,void 0,void 0,(function*(){const{wrappingKey:l,canceled:c}=yield this.challengeService.getWrappingKeyIfApplicable();if(c)return this.apiService.createErrorResponse(r.Mwm.PasscodeRequired,void 0,i.ErrorTag.ClientValidationError);const u=yield this.apiService.signIn({email:e,serverPassword:t.serverPassword,ephemeral:n,hvmToken:s});if(!u.data||(0,i.isErrorResponse)(u))return u;const d=u.data.key_params,h=new a.t$((0,o.CopyPayloadWithContentOverride)(t.payload,{keyParams:d||t.keyParams.getPortableValue()}));return yield this.handleSuccessAuthResponse(u,h,l),u}))}changeCredentials(e){return h(this,void 0,void 0,(function*(){const t=this.getSureUser().uuid,n=yield this.apiService.changeCredentials({userUuid:t,currentServerPassword:e.currentServerPassword,newServerPassword:e.newRootKey.serverPassword,newKeyParams:e.newRootKey.keyParams,newEmail:e.newEmail?d(e.newEmail):void 0}),o=this._getKeyPairs.execute(),s=yield this.processChangeCredentialsResponse(n,e.newRootKey,e.wrappingKey);if(!(0,i.isErrorResponse)(n)&&r.BbS.get().isFeatureEnabled(r.KK4.Vaults)){const t={previous:o.isFailed()?void 0:{encryption:o.getValue().encryption,signing:o.getValue().signing},current:{encryption:e.newRootKey.encryptionKeyPair,signing:e.newRootKey.signingKeyPair}};this.notifyEvent(r.Pxr.UserKeyPairChanged,t)}return s}))}getSessionsList(){return h(this,void 0,void 0,(function*(){const e=yield this.apiService.getSessionsList();return(0,i.isErrorResponse)(e)||(e.data=e.data.sort(((e,t)=>new Date(e.updated_at)<new Date(t.updated_at)?1:-1))),e}))}revokeSession(e){return h(this,void 0,void 0,(function*(){return this.apiService.deleteSession(e)}))}revokeAllOtherSessions(){var e,t;return h(this,void 0,void 0,(function*(){const n=yield this.getSessionsList();if((0,i.isErrorResponse)(n)||!n.data){const o=(0,i.isErrorResponse)(n)?null===(e=n.data)||void 0===e?void 0:e.error:void 0;throw new Error(null!==(t=null==o?void 0:o.message)&&void 0!==t?t:r.gEn)}const o=n.data.filter((e=>!e.current));yield Promise.all(o.map((e=>this.revokeSession(e.uuid))))}))}processChangeCredentialsResponse(e,t,n){var r;return h(this,void 0,void 0,(function*(){return(0,i.isErrorResponse)(e)?{response:e}:(yield this.handleSuccessAuthResponse(e,t,n),{response:e,keyParams:null===(r=e.data)||void 0===r?void 0:r.key_params})}))}decodeDemoShareToken(e){const t=this.crypto.base64Decode(e);return JSON.parse(t)}populateSessionFromDemoShareToken(e){return h(this,void 0,void 0,(function*(){const t=this.decodeDemoShareToken(e);yield this.signIn(t.email,t.password,!1,!0)}))}populateSession(e,t,n,i,o){return h(this,void 0,void 0,(function*(){yield this.encryptionService.setRootKey(e,o),this.memoizeUser(t),this.storage.setValue(r.QtK.User,t),this.apiService.setHost(i),this.httpService.setHost(i),this.setSession(n)}))}handleAuthentication(e){return h(this,void 0,void 0,(function*(){const t=this.createSession(e.session.access_token,e.session.access_expiration,e.session.refresh_token,e.session.refresh_expiration,e.session.readonly_access);t.isFailed()?console.error(t.getError()):yield this.populateSession(e.rootKey,e.user,t.getValue(),this.apiService.getHost(),e.wrappingKey)}))}handleSuccessAuthResponse(e,t,n){return h(this,void 0,void 0,(function*(){const{data:r}=e,i=r.user;if(null!=r.token){const e=s.LegacySession.create(r.token);!e.isFailed()&&i&&(yield this.populateSession(t,i,e.getValue(),this.apiService.getHost(),n))}else if(r.session){const e=this.createSession(r.session.access_token,r.session.access_expiration,r.session.refresh_token,r.session.refresh_expiration,r.session.readonly_access);if(e.isFailed())return void console.error(e.getError());if(!i)return void console.error("No user in response");yield this.populateSession(t,i,e.getValue(),this.apiService.getHost(),n)}}))}createSession(e,t,n,r,i){const o=s.SessionToken.create(e,t);if(o.isFailed())return s.Result.fail("Could not create session: ".concat(o.getError()));const a=o.getValue(),l=s.SessionToken.create(n,r);if(l.isFailed())return s.Result.fail("Could not create session: ".concat(l.getError()));const c=l.getValue(),u=s.Session.create(a,c,i);return u.isFailed()?s.Result.fail("Could not create session: ".concat(u.getError())):s.Result.ok(u.getValue())}refreshSessionIfExpiringSoon(){return h(this,void 0,void 0,(function*(){const e=this.getSession();if(!e)return!1;if(e instanceof s.LegacySession)return!1;const t=new Date(e.accessToken.expiresAt),n=new Date(e.refreshToken.expiresAt),r=t.getTime()-Date.now()<g,o=n.getTime()-Date.now()<g;if(r||o){const e=yield this.httpService.refreshSession();if(e.isFailed())return!1;const t=e.getValue();return(0,i.isErrorResponse)(t)}return!1}))}}},98116:(e,t,n)=>{n.d(t,{g:()=>u});class r{constructor(e){this.map={};for(const t of e)this.map[t.name]=t}getSettingValue(e,t){const n=this.map[e.value];return(null==n?void 0:n.value)||t}}var i=n(55668),o=n(95658),s=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class a{constructor(e,t){this.settingsApi=e,this.userProvider=t}isReadyForModification(){return null!=this.getUser()}getUser(){return this.userProvider.getUser()}get userUuid(){const e=this.getUser();if(null==e||null==e.uuid)throw new Error(i.aXB);return e.uuid}listSettings(){return s(this,void 0,void 0,(function*(){const e=yield this.settingsApi.listSettings(this.userUuid);if((0,o.isErrorResponse)(e))throw new Error((0,o.getErrorFromErrorResponse)(e).message);return null==e.data||null==e.data.settings?new r([]):new r(e.data.settings)}))}getSetting(e){var t,n,r;return s(this,void 0,void 0,(function*(){const i=yield this.settingsApi.getSetting(this.userUuid,e.value);if(i.status!==o.HttpStatusCode.BadRequest){if((0,o.isErrorResponse)(i))throw new Error((0,o.getErrorFromErrorResponse)(i).message);return null!==(r=null===(n=null===(t=null==i?void 0:i.data)||void 0===t?void 0:t.setting)||void 0===n?void 0:n.value)&&void 0!==r?r:void 0}}))}getSubscriptionSetting(e){var t,n,r;return s(this,void 0,void 0,(function*(){if(!e.isASubscriptionSetting())throw new Error("Setting ".concat(e.value," is not a subscription setting"));const i=yield this.settingsApi.getSubscriptionSetting(this.userUuid,e.value);if(i.status!==o.HttpStatusCode.BadRequest){if((0,o.isErrorResponse)(i))throw new Error((0,o.getErrorFromErrorResponse)(i).message);return null!==(r=null===(n=null===(t=null==i?void 0:i.data)||void 0===t?void 0:t.setting)||void 0===n?void 0:n.value)&&void 0!==r?r:void 0}}))}updateSubscriptionSetting(e,t,n){return s(this,void 0,void 0,(function*(){const r=yield this.settingsApi.updateSubscriptionSetting(this.userUuid,e.value,t,n);if((0,o.isErrorResponse)(r))throw new Error((0,o.getErrorFromErrorResponse)(r).message)}))}getDoesSensitiveSettingExist(e){var t,n;return s(this,void 0,void 0,(function*(){if(!e.isSensitive())throw new Error("Setting ".concat(e.value," is not sensitive"));const r=yield this.settingsApi.getSetting(this.userUuid,e.value);if(r.status===o.HttpStatusCode.BadRequest)return!1;if((0,o.isErrorResponse)(r))throw new Error((0,o.getErrorFromErrorResponse)(r).message);return null!==(n=null===(t=r.data)||void 0===t?void 0:t.success)&&void 0!==n&&n}))}updateSetting(e,t,n){return s(this,void 0,void 0,(function*(){const r=yield this.settingsApi.updateSetting(this.userUuid,e.value,t,n);if((0,o.isErrorResponse)(r))throw new Error((0,o.getErrorFromErrorResponse)(r).message)}))}deleteSetting(e){return s(this,void 0,void 0,(function*(){const t=yield this.settingsApi.deleteSetting(this.userUuid,e.value);if((0,o.isErrorResponse)(t))throw new Error((0,o.getErrorFromErrorResponse)(t).message)}))}deinit(){this.settingsApi=void 0,this.userProvider=void 0}}var l=n(73606),c=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class u extends i.wcN{constructor(e,t,n){super(n),this.sessionManager=e,this.apiService=t,this.internalEventBus=n,this.frequencyOptionsLabels={[l.EmailBackupFrequency.Disabled]:"No email backups",[l.EmailBackupFrequency.Daily]:"Daily",[l.EmailBackupFrequency.Weekly]:"Weekly"}}initializeFromDisk(){this.provider=new a(this.apiService,this.sessionManager)}listSettings(){return c(this,void 0,void 0,(function*(){return this.provider.listSettings()}))}getSetting(e){return c(this,void 0,void 0,(function*(){return this.provider.getSetting(e)}))}getSubscriptionSetting(e){return c(this,void 0,void 0,(function*(){return this.provider.getSubscriptionSetting(e)}))}updateSubscriptionSetting(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return c(this,void 0,void 0,(function*(){return this.provider.updateSubscriptionSetting(e,t,n)}))}updateSetting(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return c(this,void 0,void 0,(function*(){return this.provider.updateSetting(e,t,n)}))}getDoesSensitiveSettingExist(e){return c(this,void 0,void 0,(function*(){return this.provider.getDoesSensitiveSettingExist(e)}))}deleteSetting(e){return c(this,void 0,void 0,(function*(){return this.provider.deleteSetting(e)}))}getEmailBackupFrequencyOptionLabel(e){return this.frequencyOptionsLabels[e]}deinit(){var e;null===(e=this.provider)||void 0===e||e.deinit(),this.provider=void 0,this.sessionManager=void 0,this.apiService=void 0}}},15109:(e,t,n)=>{n.d(t,{W:()=>l});var r=n(22325),i=n(87901),o=n(55668),s=n(82648),a=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class l extends o.wcN{constructor(e,t,n,r,i){super(i),this.itemManager=e,this.mutator=t,this.payloadManager=n,this.sync=r,this.internalEventBus=i,this.resolveQueue=[],this.addObservers()}deinit(){this.sync=void 0,this.mutator=void 0,this.itemManager=void 0,this.payloadManager=void 0,this.resolveQueue.length=0,this.removeItemObserver(),this.removeItemObserver=void 0,this.removeSyncObserver(),this.removeSyncObserver=void 0,super.deinit()}popResolveQueue(){const e=this.resolveQueue.slice();return this.resolveQueue=[],e}addObservers(){this.removeItemObserver=this.itemManager.addObserver(s.ContentType.TYPES.Any,(e=>{let{inserted:t,unerrored:n}=e;n.length>0&&(this.resolveQueue=this.resolveQueue.concat(n)),t.length>0&&(this.resolveQueue=this.resolveQueue.concat(t))})),this.removeSyncObserver=this.sync.addEventObserver((e=>a(this,void 0,void 0,(function*(){e!==o.wMo.DownloadFirstSyncCompleted&&e!==o.wMo.SyncCompletedWithAllItemsUploaded||(yield this.resolveSingletonsForItems(this.popResolveQueue(),e))}))))}validItemsMatchingPredicate(e,t){return this.itemManager.itemsMatchingPredicate(e,t)}resolveSingletonsForItems(e,t){var n;return a(this,void 0,void 0,(function*(){if(0===e.length)return;const r=[];for(const t of e){if(r.includes(t)||!t.isSingleton)continue;const e=this.validItemsMatchingPredicate(t.content_type,t.singletonPredicate());(0,i.extendArray)(r,e||[]),!e||e.length<=1||(yield this.handleStrategy(e,t.singletonStrategy))}r.length>0&&t===o.wMo.SyncCompletedWithAllItemsUploaded&&(yield null===(n=this.sync)||void 0===n?void 0:n.sync({sourceDescription:"Resolve singletons for items"}))}))}handleStrategy(e,t){return a(this,void 0,void 0,(function*(){if(t!==r.SingletonStrategy.KeepEarliest)throw"Unhandled singleton strategy";const n=e.sort(((e,t)=>e.created_at<t.created_at?-1:1)),o=(0,i.arrayByRemovingFromIndex)(n,0);yield this.mutator.setItemsToBeDeleted(o)}))}findSingleton(e,t){const n=this.validItemsMatchingPredicate(e,t);if(n.length>0)return n[0]}findOrCreateContentTypeSingleton(e,t){return a(this,void 0,void 0,(function*(){const n=this.itemManager.getItems(e);if(n.length>0)return n[0];if(!this.sync.getLastSyncDate()){let t;const n=this.itemManager.addObserver(e,(n=>{let{inserted:r}=n;if(r.length>0){const n=r.filter((t=>t.content_type===e));n.length>0&&(t=n[0])}}));if(yield this.sync.sync({sourceDescription:"Find or create singleton, before any sync has completed"}),n(),t)return t;const r=this.itemManager.getItems(e);if(r.length>0)return r[0]}const o=this.payloadManager.erroredPayloadsForContentType(e);o.length&&(yield this.payloadManager.deleteErroredPayloads(o));const s=new r.DecryptedPayload(Object.assign({uuid:i.UuidGenerator.GenerateUuid(),content_type:e,content:t,dirty:!0,dirtyIndex:(0,r.getIncrementedDirtyIndex)()},(0,r.PayloadTimestampDefaults)())),a=yield this.mutator.emitItemFromPayload(s,r.PayloadEmitSource.LocalInserted);return this.sync.sync({sourceDescription:"After find or create singleton"}),a}))}findOrCreateSingleton(e,t,n){return a(this,void 0,void 0,(function*(){const o=this.itemManager.itemsMatchingPredicate(t,e);if(o.length>0)return o[0];if(!this.sync.getLastSyncDate()){let n;const r=this.itemManager.addObserver(t,(t=>{let{inserted:r}=t;if(r.length>0){const t=r.filter((t=>t.satisfiesPredicate(e)));t.length>0&&(n=t[0])}}));if(yield this.sync.sync({sourceDescription:"Find or create singleton, before any sync has completed"}),r(),n)return n;const i=this.itemManager.itemsMatchingPredicate(t,e);if(i.length>0)return i[0]}const s=new r.DecryptedPayload(Object.assign({uuid:i.UuidGenerator.GenerateUuid(),content_type:t,content:n,dirty:!0,dirtyIndex:(0,r.getIncrementedDirtyIndex)()},(0,r.PayloadTimestampDefaults)())),a=yield this.mutator.emitItemFromPayload(s,r.PayloadEmitSource.LocalInserted);return this.sync.sync({sourceDescription:"After find or create singleton"}),a}))}}},28559:(e,t,n)=>{n.d(t,{e:()=>u});var r=n(87901),i=n(43361),o=n(86999),s=n(55668),a=n(22325),l=n(82648),c=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class u extends s.wcN{constructor(e,t,n){super(n),this.device=e,this.identifier=t,this.internalEventBus=n,this.storagePersistable=!1,this.needsPersist=!1,this.setPersistencePolicy(s.eIN.Default)}provideEncryptionProvider(e){this.encryptionProvider=e}deinit(){this.device=void 0,this.encryptionProvider=void 0,this.storagePersistable=!1,super.deinit()}handleEvent(e){return c(this,void 0,void 0,(function*(){e.type===s.n9K.ApplicationStageChanged&&e.payload.stage===s.Ugm.Launched_10&&(this.storagePersistable=!0,this.needsPersist&&this.persistValuesToDisk())}))}setPersistencePolicy(e){return c(this,void 0,void 0,(function*(){this.persistencePolicy=e,this.persistencePolicy===s.eIN.Ephemeral&&(yield this.device.clearNamespacedKeychainValue(this.identifier),yield this.device.removeAllDatabaseEntries(this.identifier),yield this.device.removeRawStorageValuesForIdentifier(this.identifier),yield this.clearAllPayloads())}))}isEphemeralSession(){return this.persistencePolicy===s.eIN.Ephemeral}initializeFromDisk(){return c(this,void 0,void 0,(function*(){const e=yield this.device.getRawStorageValue(this.getPersistenceKey()),t=e?JSON.parse(e):void 0;yield this.setInitialValues(t)}))}setInitialValues(e){return c(this,void 0,void 0,(function*(){const t=e||this.defaultValuesObject();t[s.dDH.Unwrapped]||(t[s.dDH.Unwrapped]={}),this.values=t,this.isStorageWrapped()||(this.values[s.dDH.Unwrapped]=Object.assign(Object.assign({},this.values[s.dDH.Wrapped].content),this.values[s.dDH.Unwrapped]))}))}isStorageWrapped(){const e=this.values[s.dDH.Wrapped];return null!=e&&(0,a.isEncryptedLocalStoragePayload)(e)}canDecryptWithKey(e){return c(this,void 0,void 0,(function*(){const t=this.values[s.dDH.Wrapped];if(!(0,a.isEncryptedLocalStoragePayload)(t))throw Error("Attempting to decrypt non decrypted storage value");const n=yield this.decryptWrappedValue(t,e);return!(0,o.XL)(n)}))}decryptWrappedValue(e,t){return c(this,void 0,void 0,(function*(){if(!(null==e?void 0:e.content_type))throw Error("Attempting to decrypt nonexistent wrapped value");const n=new a.EncryptedPayload(Object.assign(Object.assign(Object.assign({},e),(0,a.PayloadTimestampDefaults)()),{content_type:l.ContentType.TYPES.EncryptedStorage})),r=t?{usesRootKey:{items:[n],key:t}}:{usesRootKeyWithKeyLookup:{items:[n]}};return yield this.encryptionProvider.decryptSplitSingle(r)}))}decryptStorage(){return c(this,void 0,void 0,(function*(){const e=this.values[s.dDH.Wrapped];if(!(0,a.isEncryptedLocalStoragePayload)(e))throw Error("Attempting to decrypt already decrypted storage");const t=yield this.decryptWrappedValue(e);if((0,o.XL)(t))throw i.W.error(Error("Unable to decrypt storage."));this.values[s.dDH.Unwrapped]=(0,r.Copy)(t.content)}))}persistValuesToDisk(){return c(this,void 0,void 0,(function*(){if(!this.storagePersistable)return void(this.needsPersist=!0);if(this.persistencePolicy===s.eIN.Ephemeral)return;yield this.currentPersistPromise,this.needsPersist=!1;const e=yield this.immediatelyPersistValuesToDisk();this.values[s.dDH.Wrapped]=e[s.dDH.Wrapped]}))}awaitPersist(){return c(this,void 0,void 0,(function*(){yield this.currentPersistPromise}))}immediatelyPersistValuesToDisk(){return c(this,void 0,void 0,(function*(){return this.currentPersistPromise=this.executeCriticalFunction((()=>c(this,void 0,void 0,(function*(){var e;const t=yield this.generatePersistableValues();return this.persistencePolicy===s.eIN.Ephemeral||(yield null===(e=this.device)||void 0===e?void 0:e.setRawStorageValue(this.getPersistenceKey(),JSON.stringify(t))),t})))),this.currentPersistPromise}))}generatePersistableValues(){return c(this,void 0,void 0,(function*(){const e=(0,r.Copy)(this.values),t=e[s.dDH.Unwrapped];e[s.dDH.Unwrapped]=void 0;const n=new a.DecryptedPayload(Object.assign({uuid:r.UuidGenerator.GenerateUuid(),content:t,content_type:l.ContentType.TYPES.EncryptedStorage},(0,a.PayloadTimestampDefaults)()));if(this.encryptionProvider.hasRootKeyEncryptionSource()){const t={usesRootKeyWithKeyLookup:{items:[n]}},r=yield this.encryptionProvider.encryptSplitSingle(t);e[s.dDH.Wrapped]=(0,a.CreateEncryptedLocalStorageContextPayload)(r)}else e[s.dDH.Wrapped]=(0,a.CreateDecryptedLocalStorageContextPayload)(n);return e}))}setValue(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.qt7.Default;this.setValueWithNoPersist(e,t,n),this.persistValuesToDisk()}setValueAndAwaitPersist(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.qt7.Default;return c(this,void 0,void 0,(function*(){this.setValueWithNoPersist(e,t,n),yield this.persistValuesToDisk()}))}setValueWithNoPersist(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.qt7.Default;if(!this.values)throw Error("Attempting to set storage key ".concat(e," before loading local storage."));const r=this.domainKeyForMode(n);this.values[r][e]=t}getValue(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.qt7.Default,n=arguments.length>2?arguments[2]:void 0;if(!this.values)throw Error("Attempting to get storage key ".concat(e," before loading local storage."));if(!this.values[this.domainKeyForMode(t)])throw Error("Storage domain mode not available ".concat(t," for key ").concat(e));const r=this.values[this.domainKeyForMode(t)][e];return null!=r?r:n}getAllKeys(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s.qt7.Default;if(!this.values)throw Error("Attempting to get all keys before loading local storage.");return Object.keys(this.values[this.domainKeyForMode(e)])}removeValue(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.qt7.Default;return c(this,void 0,void 0,(function*(){if(!this.values)throw Error("Attempting to remove storage key ".concat(e," before loading local storage."));const n=this.values[this.domainKeyForMode(t)];if(null==n?void 0:n[e])return delete n[e],this.persistValuesToDisk()}))}getPersistenceKey(){return(0,s.xLN)(this.identifier,s.Bq2.StorageObject)}defaultValuesObject(e,t,n){return u.DefaultValuesObject(e,t,n)}static DefaultValuesObject(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{[s.dDH.Wrapped]:e,[s.dDH.Unwrapped]:t,[s.dDH.Nonwrapped]:n}}domainKeyForMode(e){if(e===s.qt7.Default)return s.dDH.Unwrapped;if(e===s.qt7.Nonwrapped)return s.dDH.Nonwrapped;throw Error("Invalid mode")}clearValues(){return c(this,void 0,void 0,(function*(){yield this.setInitialValues(),yield this.immediatelyPersistValuesToDisk()}))}getAllRawPayloads(){return c(this,void 0,void 0,(function*(){return this.device.getAllDatabaseEntries(this.identifier)}))}getRawPayloads(e){return c(this,void 0,void 0,(function*(){return this.device.getDatabaseEntries(this.identifier,e)}))}savePayload(e){return c(this,void 0,void 0,(function*(){return this.savePayloads([e])}))}savePayloads(e){return c(this,void 0,void 0,(function*(){if(this.persistencePolicy===s.eIN.Ephemeral)return;const{encrypted:t,decrypted:n,deleted:i,discardable:l}=(0,a.CreatePayloadSplitWithDiscardables)(e),u=this.encryptionProvider.hasRootKeyEncryptionSource(),d=[],h=[],{rootKeyEncryption:p,keySystemRootKeyEncryption:f,itemsKeyEncryption:g}=(0,o.xg)(n);g&&(0,r.extendArray)(d,g),f&&(0,r.extendArray)(d,f),p&&(u?(0,r.extendArray)(d,p):(0,r.extendArray)(h,p)),l.length>0&&(yield this.deletePayloads(l));const m=(0,o.xg)(d),y=(0,o.Ak)(m),v=[...t,...yield this.encryptionProvider.encryptSplit(y)].map(a.CreateEncryptedLocalStorageContextPayload),A=h.map(a.CreateDecryptedLocalStorageContextPayload),b=i.map(a.CreateDeletedLocalStorageContextPayload);return this.executeCriticalFunction((()=>c(this,void 0,void 0,(function*(){var e;return null===(e=this.device)||void 0===e?void 0:e.saveDatabaseEntries([...v,...A,...b],this.identifier)}))))}))}deletePayloads(e){return c(this,void 0,void 0,(function*(){yield this.deletePayloadsWithUuids((0,r.Uuids)(e))}))}deletePayloadsWithUuids(e){return c(this,void 0,void 0,(function*(){yield this.executeCriticalFunction((()=>c(this,void 0,void 0,(function*(){yield Promise.all(e.map((e=>this.device.removeDatabaseEntry(e,this.identifier))))}))))}))}deletePayloadWithUuid(e){return c(this,void 0,void 0,(function*(){return this.executeCriticalFunction((()=>c(this,void 0,void 0,(function*(){yield this.device.removeDatabaseEntry(e,this.identifier)}))))}))}clearAllPayloads(){return c(this,void 0,void 0,(function*(){return this.executeCriticalFunction((()=>c(this,void 0,void 0,(function*(){return this.device.removeAllDatabaseEntries(this.identifier)}))))}))}clearAllData(){return this.executeCriticalFunction((()=>c(this,void 0,void 0,(function*(){yield this.clearValues(),yield this.clearAllPayloads(),yield this.device.removeRawStorageValue((0,s.xLN)(this.identifier,s.Bq2.SnjsVersion)),yield this.device.removeRawStorageValue(this.getPersistenceKey())}))))}}},37185:(e,t,n)=>{n.d(t,{U:()=>a,j:()=>s});var r=n(87901),i=n(87570),o=n(60215);const s=150;class a{constructor(e,t,n,i){this.payloads=e,this.receiver=t,this.apiService=n,this.options=i,this.id=(0,r.nonSecureRandomIdentifier)(),this.responses=[],this.pendingPayloads=e.slice()}get payloadsSavedOrSaving(){return(0,r.arrayByDifference)(this.payloads,this.pendingPayloads)}popPayloads(e){const t=this.pendingPayloads.slice(0,e);return(0,r.subtractFromArray)(this.pendingPayloads,t),t}run(){return e=this,t=void 0,r=function*(){yield this.receiver(o._.StatusChanged,void 0,{completedUploadCount:this.totalUploadCount-this.pendingUploadCount,totalUploadCount:this.totalUploadCount});const e=this.popPayloads(this.upLimit),t=yield this.apiService.sync(e,this.options.syncToken,this.options.paginationToken,this.downLimit,this.options.sharedVaultUuids),n=new i.F(t);this.responses.push(n),this.options.syncToken=n.lastSyncToken,this.options.paginationToken=n.paginationToken;try{yield this.receiver(o._.Response,n)}catch(e){console.error("Sync handle response error",e)}if(!this.done)return this.run()},new((n=void 0)||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}));var e,t,n,r}get done(){return 0===this.pendingPayloads.length&&!this.options.paginationToken}get pendingUploadCount(){return this.pendingPayloads.length}get totalUploadCount(){return this.payloads.length}get upLimit(){return s}get downLimit(){return s}get numberOfItemsInvolved(){let e=0;for(const t of this.responses)e+=t.numberOfItemsInvolved;return e}}},87570:(e,t,n)=>{n.d(t,{F:()=>s});var r=n(95658),i=n(22325),o=n(87901);class s{constructor(e){var t,n,s,a,l,c,u,d;this.rawResponse=e,(0,r.isErrorResponse)(e)||(this.successResponseData=e.data);const h=(null===(t=this.successResponseData)||void 0===t?void 0:t.conflicts)||[],p=(null===(n=this.successResponseData)||void 0===n?void 0:n.unsaved)||[];this.rawConflictObjects=h.concat(p);const f=[],g=(0,i.FilterDisallowedRemotePayloadsAndMap)((null===(s=this.successResponseData)||void 0===s?void 0:s.saved_items)||[]);this.savedPayloads=g.filtered.map((e=>(0,i.CreateServerSyncSavedPayload)(e))),f.push(...g.disallowed);const m=(0,i.FilterDisallowedRemotePayloadsAndMap)((null===(a=this.successResponseData)||void 0===a?void 0:a.retrieved_items)||[]);this.retrievedPayloads=m.filtered,f.push(...m.disallowed),this.conflicts=this.filterConflictsAndDisallowedPayloads(f),this.vaults=(null===(l=this.successResponseData)||void 0===l?void 0:l.shared_vaults)||[],this.vaultInvites=(null===(c=this.successResponseData)||void 0===c?void 0:c.shared_vault_invites)||[],this.asymmetricMessages=(null===(u=this.successResponseData)||void 0===u?void 0:u.messages)||[],this.userEvents=(null===(d=this.successResponseData)||void 0===d?void 0:d.notifications)||[],(0,o.deepFreeze)(this)}filterConflictsAndDisallowedPayloads(e){const t=this.rawConflictObjects,n={};n[r.ConflictType.InvalidServerItem]=[];const o=n[r.ConflictType.InvalidServerItem];for(const t of e)o.push({type:r.ConflictType.InvalidServerItem,server_item:t});for(const e of t){let t,s;if(e.unsaved_item){const t=(0,i.FilterDisallowedRemotePayloadsAndMap)([e.unsaved_item]);1===t.filtered.length&&(s=t.filtered[0]),1===t.disallowed.length&&o.push({type:r.ConflictType.InvalidServerItem,unsaved_item:t.disallowed[0]})}if(e.server_item){const n=(0,i.FilterDisallowedRemotePayloadsAndMap)([e.server_item]);1===n.filtered.length&&(t=n.filtered[0]),1===n.disallowed.length&&o.push({type:r.ConflictType.InvalidServerItem,server_item:n.disallowed[0]})}n[e.type]||(n[e.type]=[]);const a=n[e.type];if(a){const n={type:e.type,server_item:t,unsaved_item:s};a.push(n)}}return n}get error(){return(0,r.isErrorResponse)(this.rawResponse)?(0,r.getErrorFromErrorResponse)(this.rawResponse):void 0}get status(){return this.rawResponse.status}get lastSyncToken(){var e;return null===(e=this.successResponseData)||void 0===e?void 0:e[r.ApiEndpointParam.LastSyncToken]}get paginationToken(){var e;return null===(e=this.successResponseData)||void 0===e?void 0:e[r.ApiEndpointParam.PaginationToken]}get numberOfItemsInvolved(){return[...this.retrievedPayloads,...this.rawConflictObjects].length}get hasError(){return(0,r.isErrorResponse)(this.rawResponse)}}},73822:(e,t,n)=>{n.d(t,{y:()=>o});var r=n(95658),i=n(22325);class o{constructor(e,t,n,r){this.payloadSet=e,this.baseCollection=t,this.payloadsSavedOrSaving=n,this.historyMap=r}result(){const e=[];return e.push(this.processRetrievedPayloads()),e.push(this.processSavedPayloads()),e.push(this.processUuidConflictUnsavedPayloads()),e.push(this.processDataConflictServerPayloads()),e.push(this.processRejectedPayloads()),e}processSavedPayloads(){return new i.DeltaRemoteSaved(this.baseCollection,this.payloadSet.savedPayloads).result()}processRetrievedPayloads(){const e=i.ImmutablePayloadCollection.WithPayloads(this.payloadSet.retrievedPayloads);return new i.DeltaRemoteRetrieved(this.baseCollection,e,this.payloadsSavedOrSaving,this.historyMap).result()}getConflictsForType(e){return this.payloadSet.conflicts[e]||[]}processDataConflictServerPayloads(){return new i.DeltaRemoteDataConflicts(this.baseCollection,this.getConflictsForType(r.ConflictType.ConflictingData),this.historyMap).result()}processUuidConflictUnsavedPayloads(){return new i.DeltaRemoteUuidConflicts(this.baseCollection,this.getConflictsForType(r.ConflictType.UuidConflict)).result()}processRejectedPayloads(){const e=[...this.getConflictsForType(r.ConflictType.ContentTypeError),...this.getConflictsForType(r.ConflictType.ContentError),...this.getConflictsForType(r.ConflictType.ReadOnlyError),...this.getConflictsForType(r.ConflictType.UuidError),...this.getConflictsForType(r.ConflictType.SharedVaultSnjsVersionError),...this.getConflictsForType(r.ConflictType.SharedVaultInsufficientPermissionsError),...this.getConflictsForType(r.ConflictType.SharedVaultNotMemberError),...this.getConflictsForType(r.ConflictType.SharedVaultInvalidState),...this.getConflictsForType(r.ConflictType.InvalidServerItem)];return new i.DeltaRemoteRejected(this.baseCollection,e).result()}}},48671:(e,t,n)=>{n.d(t,{B:()=>s});var r=n(22325),i=n(60215);class o{constructor(e){this.savedPayloads=e}}class s{constructor(e,t){this.payloads=e,this.receiver=t}run(){return e=this,t=void 0,s=function*(){const e=this.payloads.map((e=>(0,r.CreateOfflineSyncSavedPayload)(e))),t=new o(e);yield this.receiver(i._.Response,t)},new((n=void 0)||(n=Promise))((function(r,i){function o(e){try{l(s.next(e))}catch(e){i(e)}}function a(e){try{l(s.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((s=s.apply(e,t||[])).next())}));var e,t,n,s}}},60215:(e,t,n)=>{var r;n.d(t,{_:()=>r}),function(e){e[e.Response=1]="Response",e[e.StatusChanged=2]="StatusChanged"}(r||(r={}))},37486:(e,t,n)=>{n.d(t,{_:()=>m});var r=n(37185),i=n(87901),o=n(48671),s=n(43361),a=n(73822),l=n(60215),c=n(22325),u=n(55668),d=n(86999),h=n(82648);function p(e,t){if(e.deleted)return h.Result.ok(new c.DeletedPayload(Object.assign(Object.assign({},e),{content:void 0,deleted:!0}),t));if(null!=e.content)try{return h.Result.ok(new c.EncryptedPayload(Object.assign(Object.assign({},e),{items_key_id:e.items_key_id,content:e.content,deleted:!1,errorDecrypting:!1,waitingForKey:!1}),t))}catch(e){return h.Result.fail(JSON.stringify(e))}return h.Result.fail("Unhandled case in createPayloadFromRawItem")}var f=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};const g=[h.ContentType.TYPES.ItemsKey,h.ContentType.TYPES.KeySystemRootKey,h.ContentType.TYPES.KeySystemItemsKey,h.ContentType.TYPES.VaultListing,h.ContentType.TYPES.TrustedContact,h.ContentType.TYPES.UserPrefs,h.ContentType.TYPES.Component,h.ContentType.TYPES.Theme];class m extends u.wcN{constructor(e,t,n,r,i,o,s,a,l,c,u,d,h,p,f){super(f),this.itemManager=e,this.sessionManager=t,this.encryptionService=n,this.storageService=r,this.payloadManager=i,this.apiService=o,this.historyService=s,this.device=a,this.identifier=l,this.options=c,this.logger=u,this.sockets=d,this.syncFrequencyGuard=h,this.syncBackoffService=p,this.internalEventBus=f,this.outOfSync=!1,this.resolveQueue=[],this.spawnQueue=[],this.completedOnlineDownloadFirstSync=!1,this.majorChangeThreshold=15,this.clientLocked=!1,this.databaseLoaded=!1,this.syncLock=!1,this.dealloced=!1,this.wasNotifiedOfItemsChangeOnServer=!1,this.opStatus=this.initializeStatus()}onNewDatabaseCreated(){return f(this,void 0,void 0,(function*(){(yield this.getLastSyncToken())&&(yield this.clearSyncPositionTokens())}))}get launchPriorityUuids(){var e;return null!==(e=this.storageService.getValue(u.QtK.LaunchPriorityUuids))&&void 0!==e?e:[]}setLaunchPriorityUuids(e){this.storageService.setValue(u.QtK.LaunchPriorityUuids,e)}deinit(){this.dealloced=!0,this.autoSyncInterval&&clearInterval(this.autoSyncInterval),this.autoSyncInterval=void 0,this.sessionManager=void 0,this.itemManager=void 0,this.encryptionService=void 0,this.payloadManager=void 0,this.storageService=void 0,this.apiService=void 0,this.opStatus.reset(),this.opStatus=void 0,this.resolveQueue.length=0,this.spawnQueue.length=0,super.deinit()}initializeStatus(){return new u.BUK(setInterval,(e=>{this.notifyEvent(e)}))}lockSyncing(){this.clientLocked=!0}unlockSyncing(){this.clientLocked=!1}isOutOfSync(){return this.outOfSync}getLastSyncDate(){return this.lastSyncDate}getSyncStatus(){return this.opStatus}resetSyncState(){this.dirtyIndexAtLastPresyncSave=void 0,this.lastSyncDate=void 0,this.outOfSync=!1}isDatabaseLoaded(){return this.databaseLoaded}processPriorityItemsForDatabaseLoad(e){return f(this,void 0,void 0,(function*(){if(0===e.length)return;const t=e.filter(c.isEncryptedPayload),n=e.filter(c.isDecryptedPayload),r=(0,d.xg)(t),i=(0,d.nJ)(r),o=yield this.encryptionService.decryptSplit(i);yield this.payloadManager.emitPayloads([...n,...o],c.PayloadEmitSource.LocalDatabaseLoaded)}))}loadDatabasePayloads(){return f(this,void 0,void 0,(function*(){if(this.logger.debug("Loading database payloads"),this.databaseLoaded)throw"Attempting to initialize already initialized local database.";const e=yield this.device.getDatabaseLoadChunks({batchSize:this.options.loadBatchSize,contentTypePriority:g,uuidPriority:this.launchPriorityUuids},this.identifier),t=(0,u.Or9)(e)?e.fullEntries.itemsKeys.entries:yield this.device.getDatabaseEntries(this.identifier,e.keys.itemsKeys.keys),n=(0,u.Or9)(e)?e.fullEntries.keySystemRootKeys.entries:yield this.device.getDatabaseEntries(this.identifier,e.keys.keySystemRootKeys.keys),r=(0,u.Or9)(e)?e.fullEntries.keySystemItemsKeys.entries:yield this.device.getDatabaseEntries(this.identifier,e.keys.keySystemItemsKeys.keys),o=e=>{try{return(0,c.CreatePayload)(e,c.PayloadSource.LocalDatabaseLoaded)}catch(e){return void console.error("Creating payload failed",e)}};yield this.processPriorityItemsForDatabaseLoad(t.map(o).filter(i.isNotUndefined)),yield this.processPriorityItemsForDatabaseLoad(n.map(o).filter(i.isNotUndefined)),yield this.processPriorityItemsForDatabaseLoad(r.map(o).filter(i.isNotUndefined));const s=e.remainingChunksItemCount;let a=0;const l=(0,u.Or9)(e)?e.fullEntries.remainingChunks:e.keys.remainingChunks;let d=0;for(const e of l){const t=((0,u.ufS)(e)?e.entries:yield this.device.getDatabaseEntries(this.identifier,e.keys)).map((e=>{try{return(0,c.CreatePayload)(e,c.PayloadSource.LocalDatabaseLoaded)}catch(e){return void console.error("Creating payload failed",e)}})).filter(i.isNotUndefined);yield this.processPayloadBatch(t,a,s),d>0&&(yield(0,i.sleep)(this.options.sleepBetweenBatches,!1,"Sleeping to allow interface to update")),a+=t.length,d++}this.databaseLoaded=!0,this.opStatus.setDatabaseLoadStatus(0,0,!0)}))}beginAutoSyncTimer(){this.autoSyncInterval=setInterval(this.autoSync.bind(this),3e4)}autoSync(){if(!this.sockets.isWebSocketConnectionOpen())return this.logger.debug("WebSocket connection is closed, doing autosync"),void this.sync({sourceDescription:"Auto Sync"});this.wasNotifiedOfItemsChangeOnServer&&(this.logger.debug("Was notified of items changed on server, doing autosync"),this.wasNotifiedOfItemsChangeOnServer=!1,this.sync({sourceDescription:"WebSockets Event - Items Changed On Server"}))}processPayloadBatch(e,t,n){return f(this,void 0,void 0,(function*(){this.logger.debug("Processing batch at index",t,"length",e.length);const r=[],i=[];for(const t of e)(0,c.isEncryptedPayload)(t)?r.push(t):i.push(t);const o=(0,d.xg)(r),s=(0,d.nJ)(o),a=yield this.encryptionService.decryptSplit(s);yield this.payloadManager.emitPayloads([...i,...a],c.PayloadEmitSource.LocalDatabaseLoaded),this.notifyEvent(u.wMo.LocalDataIncrementalLoad),null!=t&&null!=n&&this.opStatus.setDatabaseLoadStatus(t,n,!1)}))}setLastSyncToken(e){return this.syncToken=e,this.storageService.setValue(u.QtK.LastSyncToken,e)}setPaginationToken(e){return f(this,void 0,void 0,(function*(){return this.cursorToken=e,e?this.storageService.setValue(u.QtK.PaginationToken,e):this.storageService.removeValue(u.QtK.PaginationToken)}))}getLastSyncToken(){return f(this,void 0,void 0,(function*(){return this.syncToken||(this.syncToken=yield this.storageService.getValue(u.QtK.LastSyncToken)),this.syncToken}))}getPaginationToken(){return f(this,void 0,void 0,(function*(){return this.cursorToken||(this.cursorToken=yield this.storageService.getValue(u.QtK.PaginationToken)),this.cursorToken}))}clearSyncPositionTokens(){return f(this,void 0,void 0,(function*(){this.syncToken=void 0,this.cursorToken=void 0,yield this.storageService.removeValue(u.QtK.LastSyncToken),yield this.storageService.removeValue(u.QtK.PaginationToken)}))}itemsNeedingSync(){return this.itemManager.getDirtyItems().filter((e=>!this.syncBackoffService.isItemInBackoff(e)))}markAllItemsAsNeedingSyncAndPersist(){return f(this,void 0,void 0,(function*(){this.logger.debug("Marking all items as needing sync");const e=this.itemManager.items.map((e=>new c.DecryptedPayload(Object.assign(Object.assign({},e.payload.ejected()),{dirty:!0,dirtyIndex:(0,c.getIncrementedDirtyIndex)()}))));yield this.payloadManager.emitPayloads(e,c.PayloadEmitSource.LocalChanged),yield this.persistPayloads(e,{throwError:!1})}))}popPayloadsNeedingPreSyncSave(e){const t=this.dirtyIndexAtLastPresyncSave;if(null==t)return e;const n=e.filter((e=>!e.dirtyIndex||e.dirtyIndex>t));return this.dirtyIndexAtLastPresyncSave=(0,c.getCurrentDirtyIndex)(),n}queueStrategyResolveOnNext(){return new Promise(((e,t)=>{this.resolveQueue.push({resolve:e,reject:t})}))}queueStrategyForceSpawnNew(e){return new Promise(((t,n)=>{this.spawnQueue.push({resolve:t,reject:n,options:e})}))}popSpawnQueue(){if(0===this.spawnQueue.length)return null;const e=this.spawnQueue[0];return(0,i.removeFromIndex)(this.spawnQueue,0),this.logger.debug("Syncing again from spawn queue"),this.sync(Object.assign({queueStrategy:u.Sii.ForceSpawnNew,source:u.Lbd.SpawnQueue},e.options)).then((()=>{e.resolve()})).catch((()=>{e.reject()}))}payloadsByPreparingForServer(e){return f(this,void 0,void 0,(function*(){const t=(0,c.CreatePayloadSplit)(e),n=(0,d.xg)(t.decrypted),r=(0,d.Ak)(n);return[...(yield this.encryptionService.encryptSplit(r)).map(c.CreateEncryptedServerSyncPushPayload),...t.deleted.map(c.CreateDeletedServerSyncPushPayload)]}))}downloadFirstSync(e,t){return f(this,void 0,void 0,(function*(){for(let n=0;n<5;n++){if(yield this.sync(Object.assign({mode:u.YCg.DownloadFirst,queueStrategy:u.Sii.ForceSpawnNew,source:u.Lbd.External},t)).catch(console.error),this.completedOnlineDownloadFirstSync)return;yield(0,i.sleep)(e)}console.error("Failed downloadFirstSync after ".concat(5," tries"))}))}awaitCurrentSyncs(){return f(this,void 0,void 0,(function*(){yield this.lastSyncInvokationPromise,yield this.currentSyncRequestPromise}))}sync(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return f(this,void 0,void 0,(function*(){if(this.clientLocked)return void this.logger.debug("Sync locked by client");const t=Object.assign({source:u.Lbd.External},e);return this.lastSyncInvokationPromise=this.performSync(t),this.lastSyncInvokationPromise}))}prepareForSync(e){return f(this,void 0,void 0,(function*(){const t=this.itemsNeedingSync(),n=new Date,r=(0,c.getCurrentDirtyIndex)(),o=t.filter((e=>e.neverSynced&&(0,c.isDeletedItem)(e)));(0,i.subtractFromArray)(t,o);const s=t.map((e=>e.payloadRepresentation())),a=this.popPayloadsNeedingPreSyncSave(s),l=e.mode===u.YCg.DownloadFirst;return yield this.persistPayloads(a,{throwError:!l}),e.onPresyncSave&&e.onPresyncSave(),{items:t,beginDate:n,frozenDirtyIndex:r,neverSyncedDeleted:o}}))}configureSyncLock(e){const t=this.opStatus.syncInProgress,n=this.databaseLoaded,r=!this.syncLock,i=this.syncFrequencyGuard.isSyncCallsThresholdReachedThisMinute(),o=r&&n&&!t&&!i;return o?this.syncLock=!0:this.logger.debug(r?t?"Attempting to sync while existing sync in progress.":"Attempting to sync before local database has loaded.":"Another function call has begun preparing for sync.",e),{shouldExecuteSync:o,releaseLock:()=>{this.syncLock=!1}}}deferSyncRequest(e){const t=(0,i.isNullOrUndefined)(e.queueStrategy)?u.Sii.ResolveOnNext:e.queueStrategy;if(t===u.Sii.ResolveOnNext)return this.queueStrategyResolveOnNext();if(t===u.Sii.ForceSpawnNew)return this.queueStrategyForceSpawnNew(e);throw Error("Unhandled timing strategy")}prepareForSyncExecution(e,t,n,r){return f(this,void 0,void 0,(function*(){return this.opStatus.setDidBegin(),yield this.notifyEvent(u.wMo.SyncDidBeginProcessing),(0,i.subtractFromArray)(this.resolveQueue,t),e.length>0?this.setLastSyncBeganForItems(e,n,r):e}))}setLastSyncBeganForItems(e,t,n){return f(this,void 0,void 0,(function*(){const r=(0,i.Uuids)(e),o=this.itemManager.getCollection().findAll(r).filter(c.isDecryptedOrDeletedItem),s=[];for(const e of o){const r=new c.ItemMutator(e,c.MutationType.NonDirtying);r.setBeginSync(t,n);const i=r.getResult();s.push(i)}return yield this.payloadManager.emitPayloads(s,c.PayloadEmitSource.PreSyncSave),this.itemManager.findAnyItems(r)}))}getPendingRequestsMadeInTimeToPiggyBackOnCurrentRequest(){return this.resolveQueue.slice()}getOfflineSyncParameters(e){return{uploadPayloads:(arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.YCg.Default)===u.YCg.Default?e:[]}}createOfflineSyncOperation(e,t){return this.logger.debug("Syncing offline user","source:",u.Lbd[t.source],"sourceDesc",t.sourceDescription,"mode:",t.mode&&u.YCg[t.mode],"payloads:",e),new o.B(e,((e,t)=>f(this,void 0,void 0,(function*(){this.dealloced||e===l._.Response&&t&&(yield this.handleOfflineResponse(t))}))))}getOnlineSyncParameters(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.YCg.Default;return f(this,void 0,void 0,(function*(){const n=this.completedOnlineDownloadFirstSync?t:u.YCg.DownloadFirst;if(n===u.YCg.Default&&!this.completedOnlineDownloadFirstSync)throw Error("Attempting to default mode sync without having completed initial.");return{uploadPayloads:n===u.YCg.Default?yield this.payloadsByPreparingForServer(e):[],syncMode:n}}))}createServerSyncOperation(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.YCg.Default;return f(this,void 0,void 0,(function*(){const i=t.sharedVaultUuids&&t.sharedVaultUuids.length>0&&t.syncSharedVaultsFromScratch?void 0:yield this.getLastSyncToken(),o=t.sharedVaultUuids&&t.syncSharedVaultsFromScratch?void 0:yield this.getPaginationToken(),s=new r.U(e,((e,t,n)=>f(this,void 0,void 0,(function*(){switch(e){case l._.Response:if(this.dealloced)return;(null==t?void 0:t.hasError)?this.handleErrorServerResponse(t):t&&(yield this.handleSuccessServerResponse(s,t));break;case l._.StatusChanged:n&&this.opStatus.setUploadStatus(n.completedUploadCount,n.totalUploadCount)}}))),this.apiService,{syncToken:i,paginationToken:o,sharedVaultUuids:t.sharedVaultUuids});return this.logger.debug("Syncing online user","source",u.Lbd[t.source],"operation id",s.id,"integrity check",t.checkIntegrity,"mode",u.YCg[n],"syncToken",i,"cursorToken",o,"payloads",e),s}))}createSyncOperation(e,t,n){return f(this,void 0,void 0,(function*(){if(t){const{uploadPayloads:t,syncMode:r}=yield this.getOnlineSyncParameters(e,n.mode);return{operation:yield this.createServerSyncOperation(t,n,r),mode:r}}{const{uploadPayloads:t}=this.getOfflineSyncParameters(e,n.mode);return{operation:this.createOfflineSyncOperation(t,n),mode:n.mode||u.YCg.Default}}}))}performSync(e){return f(this,void 0,void 0,(function*(){const{shouldExecuteSync:t,releaseLock:n}=this.configureSyncLock(e),{items:r,beginDate:i,frozenDirtyIndex:o,neverSyncedDeleted:s}=yield this.prepareForSync(e);if(e.mode===u.YCg.LocalOnly)return this.logger.debug("Syncing local only, skipping remote sync request"),void n();const a=this.getPendingRequestsMadeInTimeToPiggyBackOnCurrentRequest();if(!t)return this.deferSyncRequest(e);if(this.dealloced)return;const l=yield this.prepareForSyncExecution(r,a,i,o),c=this.sessionManager.online(),{operation:d,mode:h}=yield this.createSyncOperation(l.map((e=>e.payloadRepresentation())),c,e),p=d.run();if(this.currentSyncRequestPromise=p,yield p,this.dealloced)return;n();const{hasError:f}=yield this.handleSyncOperationFinish(d,e,s,h);f||(yield this.potentiallySyncAgainAfterSyncCompletion(h,e,a,c))||(e.checkIntegrity&&c&&(yield this.notifyEventSync(u.wMo.SyncRequestsIntegrityCheck,{source:e.source})),yield this.notifyEventSync(u.wMo.SyncCompletedWithAllItemsUploadedAndDownloaded,{source:e.source,options:e}),this.resolvePendingSyncRequestsThatMadeItInTimeOfCurrentRequest(a))}))}getRawSyncRequestForExternalUse(e){return f(this,void 0,void 0,(function*(){if(this.dealloced)return;if(!this.sessionManager.online())return;const t=yield this.payloadsByPreparingForServer(e.map((e=>e.payloadRepresentation()))),n=yield this.getLastSyncToken(),r=yield this.getPaginationToken();return this.apiService.getSyncHttpRequest(t,n,r,150)}))}handleOfflineResponse(e){return f(this,void 0,void 0,(function*(){this.logger.debug("Offline Sync Response",e);const t=this.payloadManager.getMasterCollection(),n=new c.DeltaOfflineSaved(t,e.savedPayloads).result(),r=yield this.payloadManager.emitDeltaEmit(n);yield this.persistPayloads(r),this.opStatus.clearError(),yield this.notifyEvent(u.wMo.PaginatedSyncRequestCompleted,e)}))}handleErrorServerResponse(e){var t;this.logger.debug("Sync Error",e),401===e.status&&this.notifyEvent(u.wMo.InvalidSession),429===e.status&&this.notifyEvent(u.wMo.TooManyRequests),null===(t=this.opStatus)||void 0===t||t.setError(e.error),this.notifyEvent(u.wMo.SyncError,e)}handleSuccessServerResponse(e,t){return f(this,void 0,void 0,(function*(){this._simulate_latency&&(yield(0,i.sleep)(this._simulate_latency.latency)),this.opStatus.clearError(),this.opStatus.setDownloadStatus(t.retrievedPayloads.length);const n=this.payloadManager.getMasterCollection(),r=this.historyService.getHistoryMapCopy();t.userEvents&&t.userEvents.length>0&&(yield this.notifyEventSync(u.wMo.ReceivedNotifications,t.userEvents)),t.asymmetricMessages&&t.asymmetricMessages.length>0&&(yield this.notifyEventSync(u.wMo.ReceivedAsymmetricMessages,t.asymmetricMessages)),t.vaults&&t.vaults.length>0&&(yield this.notifyEventSync(u.wMo.ReceivedRemoteSharedVaults,t.vaults)),t.vaultInvites&&t.vaultInvites.length>0&&(yield this.notifyEventSync(u.wMo.ReceivedSharedVaultInvites,t.vaultInvites));const o=new a.y({retrievedPayloads:yield this.processServerPayloads(t.retrievedPayloads,c.PayloadSource.RemoteRetrieved),savedPayloads:t.savedPayloads,conflicts:yield this.decryptServerConflicts(t.conflicts)},n,e.payloadsSavedOrSaving,r);this.logger.debug("Online Sync Response","Operator ID",e.id,t.rawResponse.data,"Decrypted payloads",o.payloadSet);const s=o.result();for(const e of s){const t=yield this.payloadManager.emitDeltaEmit(e);yield this.persistPayloads(t)}e.options.sharedVaultUuids||(yield Promise.all([this.setLastSyncToken(t.lastSyncToken),this.setPaginationToken(t.paginationToken)])),yield this.notifyEvent(u.wMo.PaginatedSyncRequestCompleted,Object.assign(Object.assign({},t),{uploadedPayloads:e.payloads,options:e.options}))}))}decryptServerConflicts(e){return f(this,void 0,void 0,(function*(){const t={};for(const n of Object.keys(e)){const r=e[n];if(!r)continue;t[n]||(t[n]=[]);const i=t[n];if(!i)throw Error("Decrypted conflicts for type should exist");for(const e of r){const t=e.unsaved_item?yield this.processServerPayload(e.unsaved_item,c.PayloadSource.RemoteRetrieved):void 0,n=e.server_item?yield this.processServerPayload(e.server_item,c.PayloadSource.RemoteRetrieved):void 0,r={type:e.type,unsaved_item:t,server_item:n};i.push(r)}}return t}))}processServerPayload(e,t){return f(this,void 0,void 0,(function*(){return(yield this.processServerPayloads([e],t))[0]}))}processServerPayloads(e,t){return f(this,void 0,void 0,(function*(){const n=e.map((e=>{const n=p(e,t);return n.isFailed()?void 0:n.getValue()})).filter(i.isNotUndefined),{encrypted:r,deleted:o}=(0,c.CreateNonDecryptedPayloadSplit)(n),s=[...o],{rootKeyEncryption:a,itemsKeyEncryption:l,keySystemRootKeyEncryption:u}=(0,d.xg)(r),{results:h,map:f}=yield this.decryptServerItemsKeys(a||[]);(0,i.extendArray)(s,h);const{results:g,map:m}=yield this.decryptServerKeySystemItemsKeys(u||[]);if((0,i.extendArray)(s,g),l){const e=yield this.decryptProcessedServerPayloads(l,Object.assign(Object.assign({},f),m));(0,i.extendArray)(s,e)}return s}))}decryptServerItemsKeys(e){return f(this,void 0,void 0,(function*(){const t={};if(0===e.length)return{results:[],map:t};const n={usesRootKeyWithKeyLookup:{items:e}},r=yield this.encryptionService.decryptSplit(n);return r.forEach((e=>{(0,c.isDecryptedPayload)(e)&&e.content_type===h.ContentType.TYPES.ItemsKey&&(t[e.uuid]=e)})),{results:r,map:t}}))}decryptServerKeySystemItemsKeys(e){return f(this,void 0,void 0,(function*(){const t={};if(0===e.length)return{results:[],map:t};const n={usesKeySystemRootKeyWithKeyLookup:{items:e}},r=yield this.encryptionService.decryptSplit(n);return r.forEach((e=>{(0,c.isDecryptedPayload)(e)&&e.content_type===h.ContentType.TYPES.KeySystemItemsKey&&(t[e.uuid]=e)})),{results:r,map:t}}))}decryptProcessedServerPayloads(e,t){return f(this,void 0,void 0,(function*(){return Promise.all(e.map((e=>f(this,void 0,void 0,(function*(){const n=t[e.items_key_id],r=n?(0,c.CreateDecryptedItemFromPayload)(n):void 0,i={};return r?i.usesItemsKey={items:[e],key:r}:i.usesItemsKeyWithKeyLookup={items:[e]},this.encryptionService.decryptSplitSingle(i)})))))}))}handleSyncOperationFinish(e,t,n,i){return f(this,void 0,void 0,(function*(){return this.opStatus.setDidEnd(),this.opStatus.hasError()?{hasError:!0}:(this.opStatus.reset(),this.lastSyncDate=new Date,this.syncFrequencyGuard.incrementCallsPerMinute(),e instanceof r.U&&e.numberOfItemsInvolved>=this.majorChangeThreshold&&this.notifyEvent(u.wMo.MajorDataChange),n.length>0&&(yield this.handleNeverSyncedDeleted(n)),i!==u.YCg.DownloadFirst&&(yield this.notifyEvent(u.wMo.SyncCompletedWithAllItemsUploaded,{source:t.source})),{hasError:!1})}))}handleDownloadFirstCompletionAndSyncAgain(e,t){return f(this,void 0,void 0,(function*(){e&&(this.completedOnlineDownloadFirstSync=!0),yield this.notifyEvent(u.wMo.DownloadFirstSyncCompleted),yield this.sync({source:u.Lbd.AfterDownloadFirst,checkIntegrity:!0,awaitAll:t.awaitAll})}))}syncAgainByHandlingRequestsWaitingInResolveQueue(e){return f(this,void 0,void 0,(function*(){this.logger.debug("Syncing again from resolve queue");const t=this.sync({source:u.Lbd.ResolveQueue,checkIntegrity:e.checkIntegrity});e.awaitAll&&(yield t)}))}syncAgainByHandlingNewDirtyItems(e){return f(this,void 0,void 0,(function*(){yield this.sync({source:u.Lbd.MoreDirtyItems,checkIntegrity:e.checkIntegrity,awaitAll:e.awaitAll})}))}resolvePendingSyncRequestsThatMadeItInTimeOfCurrentRequest(e){for(const t of e)t.resolve()}potentiallySyncAgainAfterSyncCompletion(e,t,n,r){return f(this,void 0,void 0,(function*(){if(e===u.YCg.DownloadFirst)return yield this.handleDownloadFirstCompletionAndSyncAgain(r,t),this.resolvePendingSyncRequestsThatMadeItInTimeOfCurrentRequest(n),!0;const i=this.popSpawnQueue(),o=this.resolveQueue.length>0;return!i&&o?(yield this.syncAgainByHandlingRequestsWaitingInResolveQueue(t),this.resolvePendingSyncRequestsThatMadeItInTimeOfCurrentRequest(n),!0):this.itemsNeedingSync().length>0&&(yield this.syncAgainByHandlingNewDirtyItems(t),this.resolvePendingSyncRequestsThatMadeItInTimeOfCurrentRequest(n),!0)}))}handleNeverSyncedDeleted(e){return f(this,void 0,void 0,(function*(){const t=e.map((e=>e.payloadRepresentation({dirty:!1})));yield this.payloadManager.emitPayloads(t,c.PayloadEmitSource.LocalChanged),yield this.persistPayloads(t)}))}persistPayloads(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{throwError:!0};return f(this,void 0,void 0,(function*(){if(0!==e.length&&!this.dealloced)return this.storageService.savePayloads(e).catch((e=>{t.throwError&&(this.notifyEvent(u.wMo.DatabaseWriteError,e),s.W.error(e))}))}))}setInSync(e){e!==!this.outOfSync&&(e?(this.outOfSync=!1,this.notifyEvent(u.wMo.ExitOutOfSync)):(this.outOfSync=!0,this.notifyEvent(u.wMo.EnterOutOfSync)))}handleEvent(e){return f(this,void 0,void 0,(function*(){switch(e.type){case u.ezr.IntegrityCheckCompleted:yield this.handleIntegrityCheckEventResponse(e.payload);break;case u.fAX.ItemsChangedOnServer:this.wasNotifiedOfItemsChangeOnServer=!0}}))}handleIntegrityCheckEventResponse(e){return f(this,void 0,void 0,(function*(){const t=e.rawPayloads;if(0===t.length)return void this.setInSync(!0);const n=(0,c.FilterDisallowedRemotePayloadsAndMap)(t).filtered.map((e=>{const t=p(e,c.PayloadSource.RemoteRetrieved);if(!t.isFailed())return t.getValue()})).filter(i.isNotUndefined),r=(0,c.CreateNonDecryptedPayloadSplit)(n),o=(0,d.xg)(r.encrypted),s=(0,d.nJ)(o),a=yield this.encryptionService.decryptSplit(s);this.setInSync(!1),yield this.emitOutOfSyncRemotePayloads([...a,...r.deleted]);const l=e.source!==u.Lbd.ResolveOutOfSync;yield this.sync({checkIntegrity:l,source:u.Lbd.ResolveOutOfSync})}))}emitOutOfSyncRemotePayloads(e){return f(this,void 0,void 0,(function*(){const t=new c.DeltaOutOfSync(this.payloadManager.getMasterCollection(),c.ImmutablePayloadCollection.WithPayloads(e),this.historyService.getHistoryMapCopy()).result();yield this.payloadManager.emitDeltaEmit(t),yield this.persistPayloads(t.emits)}))}syncSharedVaultsFromScratch(e){return f(this,void 0,void 0,(function*(){yield this.sync({sharedVaultUuids:e,syncSharedVaultsFromScratch:!0,queueStrategy:u.Sii.ForceSpawnNew,awaitAll:!0})}))}ut_setDatabaseLoaded(e){this.databaseLoaded=e}ut_clearLastSyncDate(){this.lastSyncDate=void 0}ut_beginLatencySimulator(e){this._simulate_latency={latency:e||1e3,enabled:!0}}ut_endLatencySimulator(){this._simulate_latency=void 0}}},91096:(e,t,n)=>{n.d(t,{U8:()=>M.U,bQ:()=>r.b,Jg:()=>m.Jg,h6:()=>m.h6,IX:()=>u,ne:()=>d.n,ap:()=>h.a,PJ:()=>p.P,yW:()=>f.y,SV:()=>g.S,ql:()=>o.q,e5:()=>j.e,kq:()=>y.k,EO:()=>v.E,A:()=>A.A,D0:()=>b.D,Af:()=>i.A,o8:()=>w.o,aM:()=>a.aM,pY:()=>S.p,HK:()=>C.H,Sn:()=>a.Sn,Vu:()=>E.V,Bi:()=>R.B,nB:()=>s.n,Ot:()=>I.O,KJ:()=>_.y,Ps:()=>P,nT:()=>x.n,jg:()=>B,wJ:()=>m.wJ,Fi:()=>L.F,y0:()=>F.y,Sj:()=>a.Sj,gb:()=>N.g,Wz:()=>D.W,_U:()=>T._,jH:()=>M.j,Fr:()=>k.F,z4:()=>O.z});var r=n(19820),i=n(54911),o=n(78734),s=n(98361),a=n(53218),l=n(55668),c=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class u extends l.wcN{constructor(e,t){super(t),this.application=e,this.internalEventBus=t,this.addAppEventObserverAfterSubclassesFinishConstructing()}deinit(){this.application=void 0,this.unsubApp(),this.unsubApp=void 0,super.deinit()}addAppEventObserverAfterSubclassesFinishConstructing(){setTimeout((()=>{this.addAppEventObserver()}),0)}addAppEventObserver(){this.application.isStarted()&&this.onAppStart(),this.application.isLaunched()&&this.onAppLaunch(),this.unsubApp=this.application.addEventObserver((e=>c(this,void 0,void 0,(function*(){yield this.onAppEvent(e),e===l.n9K.Started?this.onAppStart():e===l.n9K.Launched?this.onAppLaunch():e===l.n9K.CompletedFullSync?this.onAppFullSync():e===l.n9K.CompletedIncrementalSync?this.onAppIncrementalSync():e===l.n9K.KeyStatusChanged&&this.onAppKeyChange()}))))}onAppEvent(e){return c(this,void 0,void 0,(function*(){}))}onAppStart(){return c(this,void 0,void 0,(function*(){}))}onAppLaunch(){return c(this,void 0,void 0,(function*(){}))}onAppKeyChange(){return c(this,void 0,void 0,(function*(){}))}onAppIncrementalSync(){}onAppFullSync(){}}var d=n(68625),h=n(59472),p=n(40278),f=n(74987),g=n(56297),m=n(20549),y=n(6314),v=n(29675),A=n(45447),b=n(80738),w=n(81679),S=n(3876),C=n(8740),E=n(28178),I=n(64892),_=n(30693),x=n(51271);const P=30;var k=n(97210);const B=[{valueInSeconds:k.F.OneMinute,label:"1 Minute"},{valueInSeconds:k.F.FiveMinutes,label:"5 Minutes"},{valueInSeconds:k.F.OneHour,label:"1 Hour"},{valueInSeconds:k.F.OneWeek,label:"1 Week"}];var O=n(17956),N=n(98116),D=n(15109),j=n(28559),T=n(37486),M=n(37185),F=n(73822),R=n(48671),L=n(87570)},52450:(e,t,n)=>{n.d(t,{e:()=>i});var r=n(20875);const i={Network:{Files:{FailedStartUploadSession:"Failed to start an upload session.",FailedCloseUploadSession:"Failed to close an upload session.",FailedUploadFileChunk:"Failed to upload file chunk.",FailedDownloadFileChunk:"Failed to download file chunk.",FailedDeleteFile:"Failed to delete file."}},Confirm:{ProtocolVersionExpired(e){var t;return{Message:"The encryption version for your account is outdated and requires upgrade. You may proceed with login, but are advised to perform a security update using the web or desktop application.\n\n"+"If your account was created after ".concat(null===(t=r.ProtocolExpirationDates[e])||void 0===t?void 0:t.toLocaleString(),", it may not be safe to continue signing in. ")+"In that case, please discontinue your sign in request and contact support.\n\nFor more information, visit standardnotes.com/help/security.",Title:"Update Recommended",ConfirmButton:"Sign In"}}}}},34146:(e,t,n)=>{var r;n.d(t,{M:()=>r}),function(e){e.Api="https://api.standardnotes.com",e.WebSocket="wss://sockets.standardnotes.com"}(r||(r={}))},94986:(e,t,n)=>{n.d(t,{D8:()=>l,DU:()=>o,Oq:()=>s,in:()=>i,jV:()=>a});var r=n(27374);const i="2.209.5",o="1.0.0",s="2.0.0";function a(e,t){return-1===l(e,t)}function l(e,t){return(0,r.eq)(e,t)?0:(0,r.gt)(e,t)?1:-1}},81346:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addYearsToDate=t.addMonthsToDate=t.addDaysToDate=t.addHoursToDate=void 0,t.addHoursToDate=function(e,t){const n=new Date(e);return n.setHours(n.getHours()+t),n},t.addDaysToDate=function(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n},t.addMonthsToDate=function(e,t){const n=new Date(e);return n.setMonth(n.getMonth()+t),n},t.addYearsToDate=function(e,t){const n=new Date(e);return n.setFullYear(n.getFullYear()+t),n}},90622:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Deferred=void 0,t.Deferred=()=>{let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return{resolve:e,reject:t,promise:n}}},75760:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DependencyContainer=void 0;const r=n(37225),i=n(75807);t.DependencyContainer=class{constructor(){this.factory=new Map,this.dependencies=new Map}deinit(){this.factory.clear();const e=this.getAll();for(const t of e)(0,i.isDeinitable)(t)&&t.deinit();this.dependencies.clear()}getAll(){return Array.from(this.dependencies.values()).filter(r.isNotUndefined)}bind(e,t){this.factory.set(e,t)}get(e){const t=this.dependencies.get(e);if(t)return t;const n=this.factory.get(e);if(!n)throw new Error("No dependency maker found for ".concat(e.toString()));const r=n();return r?(this.dependencies.set(e,r),r):void 0}}},75807:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.canBlockDeinit=t.isDeinitable=void 0,t.isDeinitable=function(e){if(!e)throw new Error("Service is undefined");return"function"==typeof e.deinit},t.canBlockDeinit=function(e){if(!e)throw new Error("Service is undefined");return"function"==typeof e.blockDeinit}},12377:(e,t)=>{function n(e){const t=/(?:\.([^.]+))$/.exec(e),n=(null==t?void 0:t[1])||"";return{name:e.includes(".")?e.substring(0,e.lastIndexOf(".")):e,ext:n}}function r(e){return e.trim().replace(/[.\\/:"?*|<>]/g,"_")}function i(e,t){return e.length>t?e.slice(0,t):e}Object.defineProperty(t,"__esModule",{value:!0}),t.parseAndCreateZippableFileName=t.createZippableFileName=t.truncateFileName=t.sanitizeFileName=t.parseFileName=void 0,t.parseFileName=n,t.sanitizeFileName=r,t.truncateFileName=i;function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"txt",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100;return i(r(e),o)+(t+".")+n}t.createZippableFileName=o,t.parseAndCreateZippableFileName=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const{name:r,ext:i}=n(e);return o(r,t,i)}},33638:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},91379:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=void 0;class n{constructor(e){this.appIdentifier=e,this.level="none"}canLog(e){if("none"===this.level)return!1;const t=["debug","info","warn","error"];return t.indexOf(e)>=t.indexOf(this.level)}setLevel(e){this.level=e}debug(e){if(this.canLog("debug")){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.logWithColor(e,...n)}}info(e){if(this.canLog("info")){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.logWithColor(e,...n)}}warn(e){if(this.canLog("warn")){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];console.warn(e,...n)}}error(e){if(this.canLog("error")){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];console.error(e,...n)}}logWithColor(){const e=new Date,t="".concat(e.toLocaleTimeString().replace(" PM","").replace(" AM",""),".").concat(e.getMilliseconds());for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];this.customLog("%c".concat(this.appIdentifier,"%c").concat(t),"color: font-weight: bold; margin-right: 4px","color: gray",...r)}customLog(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Function.prototype.apply.call(console.log,console,arguments)}}t.Logger=n,t.default=n},13777:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},47887:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.classNames=void 0;const r=n(37225);t.classNames=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.map((e=>"string"==typeof e?e:null)).filter(r.isNotUndefined).join(" ")}},92484:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=void 0,t.debounce=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var r,i;let o;const s=null!==(r=n.isImmediate)&&void 0!==r&&r,a=null!==(i=n.callback)&&void 0!==i&&i,l=n.maxWait;let c=Date.now(),u=[];const d=function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];const d=this;return new Promise(((n,i)=>{const h=s&&void 0===o;if(void 0!==o&&clearTimeout(o),o=setTimeout((function(){if(o=void 0,c=Date.now(),!s){const t=e.apply(d,r);a&&a(t),u.forEach((e=>{let{resolve:n}=e;return n(t)})),u=[]}}),function(){if(void 0!==l){const e=Date.now()-c;if(e+t>=l)return l-e}return t}()),h){const t=e.apply(d,r);return a&&a(t),n(t)}u.push({resolve:n,reject:i})}))};return d.cancel=function(e){void 0!==o&&clearTimeout(o),u.forEach((t=>{let{reject:n}=t;return n(e)})),u=[]},d}},37225:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.assertUnreachable=t.sleep=t.truncateHexString=t.hasGetter=t.isValidUrl=t.deepFreeze=t.pickByCopy=t.deepMerge=t.Copy=t.joinPaths=t.omitByCopy=t.omitInPlace=t.withoutLastElement=t.jsonParseEmbeddedKeys=t.topLevelCompare=t.dateSorted=t.omitUndefinedCopy=t.sortByKey=t.sortedCopy=t.objectToValueArray=t.arrayByRemovingFromIndex=t.addAtIndex=t.removeFromIndex=t.compareValues=t.compareArrayReferences=t.arrayByDifference=t.filterFromArray=t.addIfUnique=t.removeFromArray=t.subtractFromArray=t.extendArray=t.lastElement=t.uniqueArrayByKey=t.uniqueArray=t.uniqCombineObjArrays=t.greaterOfTwoDates=t.isString=t.isEmpty=t.isNotUndefined=t.isNullOrUndefined=t.isFunction=t.isObject=t.sureSearchArray=t.searchArray=t.findInArray=t.isReactNativeEnvironment=t.isWebCryptoAvailable=t.isWebEnvironment=t.dictToArray=t.getGlobalScope=void 0,t.pluralize=t.spaceSeparatedStrings=t.useBoolean=t.assert=t.logWithColor=t.log=t.secondHalfOfString=t.firstHalfOfString=t.splitString=t.nonSecureRandomIdentifier=t.dateToLocalizedString=t.sanitizeHtmlString=t.convertTimestampToMilliseconds=t.arraysEqual=t.naturalSort=t.isSameDay=void 0;const i=n(59154),o=n(84213),s="undefined"!=typeof Intl?new Intl.Collator("en",{numeric:!0}):void 0;function a(){return"undefined"!=typeof window?window:void 0!==n.g?n.g:null}function l(){return null!==a()}function c(){return"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function u(e,t){return(0,o.find)(e,t)}function d(e){return null!==e&&("function"==typeof e||"object"==typeof e)}function h(e){return null==e}function p(e,t){const n=e.indexOf(t);-1!==n&&e.splice(n,1)}function f(e,t){e.splice(t,1)}function g(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function m(e){return e instanceof Date?new Date(e):d(e)?JSON.parse(JSON.stringify(e)):e}var y;let v;function A(e,t){const n=new Date,r="".concat(n.toLocaleTimeString().replace(" PM","").replace(" AM",""),".").concat(n.getMilliseconds());for(var i=arguments.length,o=new Array(i>2?i-2:0),s=2;s<i;s++)o[s-2]=arguments[s];!function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Function.prototype.apply.call(console.log,console,arguments)}("%c".concat(e,"%c").concat(r),"color: ".concat(t,"; font-weight: bold; margin-right: 4px"),"color: gray",...o)}t.getGlobalScope=a,t.dictToArray=function(e){return Object.values(e)},t.isWebEnvironment=l,t.isWebCryptoAvailable=function(){return l()&&!c()&&!(document&&document.documentMode)||/Edge/.test(navigator.userAgent)&&window.crypto&&!!window.crypto.subtle},t.isReactNativeEnvironment=c,t.findInArray=function(e,t,n){return e.find((e=>e[t]===n))},t.searchArray=u,t.sureSearchArray=function(e,t){return u(e,t)},t.isObject=d,t.isFunction=function(e){return null!==e&&"function"==typeof e},t.isNullOrUndefined=h,t.isNotUndefined=function(e){return null!=e},t.isEmpty=function(e){return!e||0===e.length},t.isString=function(e){return"string"==typeof e||e instanceof String},t.greaterOfTwoDates=function(e,t){return e>t?e:t},t.uniqCombineObjArrays=function(e,t,n){return(0,o.uniqWith)(e.concat(t),((e,t)=>{for(const r of n)if(e[r]!==t[r])return!1;return!0}))},t.uniqueArray=function(e){return(0,o.uniq)(e)},t.uniqueArrayByKey=function(e,t){return(0,o.uniqWith)(e,((e,n)=>e[t]===n[t]))},t.lastElement=function(e){return e[e.length-1]},t.extendArray=function(e,t){for(const n of t)e.push(n)},t.subtractFromArray=function(e,t){for(const n of t)p(e,n)},t.removeFromArray=p,t.addIfUnique=function(e,t){return!e.includes(t)&&(e.push(t),!0)},t.filterFromArray=function(e,t){(0,o.remove)(e,t)},t.arrayByDifference=function(e,t){return e.filter((e=>!t.includes(e))).concat(t.filter((t=>!e.includes(t))))},t.compareArrayReferences=function(e,t){return e.length===t.length&&e.every(((e,n)=>e===t[n]))},t.compareValues=function(e,t){return!(e&&!t||!e&&t)&&(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():e instanceof String&&t instanceof String?e===t:g(e,t))},t.removeFromIndex=f,t.addAtIndex=function(e,t,n){e.splice(n,0,t)},t.arrayByRemovingFromIndex=function(e,t){const n=e.slice();return f(n,t),n},t.objectToValueArray=function(e){const t=[];for(const n of Object.keys(e))t.push(e[n]);return t},t.sortedCopy=function(e){const t=Object.keys(e).sort(),n={};for(const r of t)n[r]=e[r];return m(n)},t.sortByKey=(e,t)=>{const n=[...e];return n.sort(((e,n)=>{const r=e[t],i=n[t];return r<i?-1:r>i?1:0})),n},t.omitUndefinedCopy=function(e){const t={};for(const n of Object.keys(e))h(e[n])||(t[n]=e[n]);return t},t.dateSorted=function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return e.sort(((e,r)=>{const i=e[t].getTime(),o=r[t].getTime(),s=n?1:-1;return i<o?-1*s:i>o?1*s:0}))},t.topLevelCompare=g,t.jsonParseEmbeddedKeys=function(e){const t={};for(const n of Object.keys(e)){let r;try{r=JSON.parse(e[n])}catch(t){r=e[n]}t[n]=r}return t},t.withoutLastElement=e=>e.slice(0,-1),t.omitInPlace=function(e,t){if(e)for(const n of t)delete e[n]},t.omitByCopy=function(e,t){if(h(e))return;const n=Object.assign({},e);for(const e of t)delete n[e];return n},t.joinPaths=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.map(((e,t)=>0===t?e.trim().replace(/[/]*$/g,""):e.trim().replace(/(^[/]*|[/]*$)/g,""))).filter((e=>e.length)).join("/")},t.Copy=m,t.deepMerge=function(e,t){if(!e||!t)throw"Attempting to deepMerge with null values";return(0,o.mergeWith)(e,t,((e,t)=>{if((0,o.isArray)(e))return t})),e},t.pickByCopy=function(e,t){const n={};for(const r of t)n[r]=e[r];return m(n)},t.deepFreeze=function e(t){const n=Object.getOwnPropertyNames(t);for(const r of n){const n=t[r];n&&"object"==typeof n&&!Object.isFrozen(n)?t[r]=e(n):t[r]=n}return Object.freeze(t)},t.isValidUrl=function(e){try{return new URL(e),!0}catch(e){return!1}},t.hasGetter=function(e,t){const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t);return n&&!h(n.get)},t.truncateHexString=function(e,t){const n=t/4;return e.substring(0,n)},t.sleep=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return r(this,void 0,void 0,(function*(){return t&&console.warn("Sleeping for ".concat(e,"ms ").concat(n)),new Promise((t=>{setTimeout((function(){t()}),e)}))}))},t.assertUnreachable=function(e){throw Error("Unchecked case "+e)},t.isSameDay=function(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()},t.naturalSort=function(e,t){switch(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"asc"){case"asc":return[...e].sort(s?(e,n)=>s.compare(e[t],n[t]):(e,n)=>e[t].localeCompare(n[t],"en",{numeric:!0}));case"desc":return[...e].sort(s?(e,n)=>s.compare(n[t],e[t]):(e,n)=>n[t].localeCompare(e[t],"en",{numeric:!0}))}},t.arraysEqual=function(e,t){return e.length===t.length&&e.every((e=>t.includes(e)))&&t.every((t=>e.includes(t)))},function(e){e[e.Seconds=10]="Seconds",e[e.Milliseconds=13]="Milliseconds",e[e.Microseconds=16]="Microseconds"}(y||(y={})),t.convertTimestampToMilliseconds=function(e){switch(String(e).length){case y.Seconds:return 1e3*e;case y.Milliseconds:return e;case y.Microseconds:return Math.floor(e/1e3);default:throw"Unhandled timestamp precision: ".concat(e)}},t.sanitizeHtmlString=function(e){return(0,i.sanitize)(e)},t.dateToLocalizedString=function(e){if("undefined"!=typeof Intl&&Intl.DateTimeFormat&&"undefined"!=typeof navigator){if(!v){const e=navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.language;v=new Intl.DateTimeFormat(e,{year:"numeric",month:"short",day:"2-digit",weekday:"long",hour:"2-digit",minute:"2-digit"})}return v.format(e)}return e.toDateString()+" "+e.toLocaleTimeString()},t.nonSecureRandomIdentifier=function(){return"".concat(100*Math.random()).replace(".","")},t.splitString=function(e,t){const n=e.length/t,r=[];for(let i=0;i<t;i++){const t=e.slice(n*i,n*(i+1));r.push(t)}return r},t.firstHalfOfString=function(e){return e.substring(0,e.length/2)},t.secondHalfOfString=function(e){return e.substring(e.length/2,e.length)},t.log=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];A(e,"black",...n)},t.logWithColor=A,t.assert=function(e){if(void 0===e)throw new Error("Assertion failed; value must be defined")},t.useBoolean=function(e,t){return null!=e?e:t},t.spaceSeparatedStrings=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.join(" ")},t.pluralize=function(e,t,n){return 1===e?t:n}},49095:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Uuids=void 0,t.Uuids=function(e){return e.map((e=>e.uuid))}},57865:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UuidGenerator=void 0,t.UuidGenerator=class{static SetGenerator(e){this.syncUuidFunc=e}static GenerateUuid(){return this.syncUuidFunc()}}},28569:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UuidMap=void 0;const r=n(37225);class i{constructor(){this.directMap=new Map,this.inverseMap=new Map}get directMapSize(){return this.directMap.size}get inverseMapSize(){return this.inverseMap.size}makeCopy(){const e=new i;return e.directMap=new Map(this.directMap),e.inverseMap=new Map(this.inverseMap),e}existsInDirectMap(e){return this.directMap.has(e)}existsInInverseMap(e){return this.inverseMap.has(e)}getDirectRelationships(e){return this.directMap.get(e)||[]}getAllDirectKeys(){return Array.from(this.directMap.keys())}getInverseRelationships(e){return this.inverseMap.get(e)||[]}establishRelationship(e,t){this.establishDirectRelationship(e,t),this.establishInverseRelationship(e,t)}deestablishRelationship(e,t){this.deestablishDirectRelationship(e,t),this.deestablishInverseRelationship(e,t)}setAllRelationships(e,t){const n=this.directMap.get(e)||[];this.directMap.set(e,t);for(const t of n)this.deestablishInverseRelationship(e,t);for(const n of t)this.establishInverseRelationship(e,n)}removeFromMap(e){const t=this.directMap.get(e)||[];for(const n of t)(0,r.removeFromArray)(this.inverseMap.get(n)||[],e);this.directMap.delete(e);const n=this.inverseMap.get(e)||[];for(const t of n)(0,r.removeFromArray)(this.directMap.get(t)||[],e);this.inverseMap.delete(e)}establishDirectRelationship(e,t){const n=this.directMap.get(e)||[];(0,r.addIfUnique)(n,t),this.directMap.set(e,n)}establishInverseRelationship(e,t){const n=this.inverseMap.get(t)||[];(0,r.addIfUnique)(n,e),this.inverseMap.set(t,n)}deestablishDirectRelationship(e,t){const n=this.directMap.get(e)||[];(0,r.removeFromArray)(n,t),this.directMap.set(e,n)}deestablishInverseRelationship(e,t){const n=this.inverseMap.get(t)||[];(0,r.removeFromArray)(n,e),this.inverseMap.set(t,n)}}t.UuidMap=i},31800:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(81346),t),i(n(90622),t),i(n(75760),t),i(n(75807),t),i(n(91379),t),i(n(13777),t),i(n(33638),t),i(n(47887),t),i(n(92484),t),i(n(37225),t),i(n(49095),t),i(n(57865),t),i(n(28569),t),i(n(12377),t)},87901:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31800),t)}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var r={};return(()=>{n.r(r),n.d(r,{API_MESSAGE_CHANGE_CREDENTIALS_IN_PROGRESS:()=>w.WLG,API_MESSAGE_FAILED_ACCESS_PURCHASE:()=>w.gQA,API_MESSAGE_FAILED_CREATE_FILE_TOKEN:()=>w.qIx,API_MESSAGE_FAILED_DOWNLOADING_EXTENSION:()=>w.mvL,API_MESSAGE_FAILED_GET_SETTINGS:()=>w.Zq2,API_MESSAGE_FAILED_LISTED_REGISTRATION:()=>w.EaW,API_MESSAGE_FAILED_OFFLINE_ACTIVATION:()=>w.iMd,API_MESSAGE_FAILED_OFFLINE_FEATURES:()=>w.WZ6,API_MESSAGE_FAILED_SUBSCRIPTION_INFO:()=>w.BMD,API_MESSAGE_FAILED_UPDATE_SETTINGS:()=>w.oBV,API_MESSAGE_FALLBACK_LOGIN_FAIL:()=>w.aWs,API_MESSAGE_GENERIC_CHANGE_CREDENTIALS_FAIL:()=>w.Z15,API_MESSAGE_GENERIC_INTEGRITY_CHECK_FAIL:()=>w.oe5,API_MESSAGE_GENERIC_INVALID_LOGIN:()=>w.VpG,API_MESSAGE_GENERIC_REGISTRATION_FAIL:()=>w.Cj$,API_MESSAGE_GENERIC_SINGLE_ITEM_SYNC_FAIL:()=>w.TwN,API_MESSAGE_GENERIC_SYNC_FAIL:()=>w.gEn,API_MESSAGE_GENERIC_TOKEN_REFRESH_FAIL:()=>w.lO_,API_MESSAGE_INVALID_SESSION:()=>w.aXB,API_MESSAGE_LOGIN_IN_PROGRESS:()=>w.TYJ,API_MESSAGE_RATE_LIMITED:()=>w.jN7,API_MESSAGE_REGISTRATION_IN_PROGRESS:()=>w.vfv,API_MESSAGE_TOKEN_REFRESH_IN_PROGRESS:()=>w.z6z,API_MESSAGE_UNTRUSTED_EXTENSIONS_WARNING:()=>w.CV,AbstractService:()=>w.wcN,AcceptVaultInvite:()=>w.nmV,AccountEvent:()=>w.oF7,AccountSyncOperation:()=>c.U8,ActionsService:()=>c.bQ,AddAuthenticator:()=>s.fC,AlertService:()=>w.c9N,AllowedBatchContentTypes:()=>c.Jg,AllowedBatchStreaming:()=>c.h6,ApiServiceEvent:()=>w.Sf$,AppleIAPProductId:()=>w.mxT,ApplicationEvent:()=>w.n9K,ApplicationGroupEvent:()=>i.$,ApplicationOptionsDefaults:()=>w.U3K,ApplicationService:()=>c.IX,ApplicationStage:()=>w.Ugm,AsymmetricMessageService:()=>w.WXh,AuthManager:()=>w.El,AuthenticatorManager:()=>w.F8w,AuthorizeVaultDeletion:()=>w.D$B,BackupFileType:()=>m.qX,BaseMigration:()=>l._r,ButtonType:()=>w.L$3,ByteChunker:()=>v.M1,CHANGING_PASSCODE:()=>w.V1G,Challenge:()=>w.tv4,ChallengeKeyboardType:()=>w.gqK,ChallengeModalTitle:()=>w.GnZ,ChallengeOperation:()=>c.ne,ChallengePrompt:()=>w.FEo,ChallengePromptTitle:()=>w.fD2,ChallengeReason:()=>w.Ps8,ChallengeResponse:()=>c.ap,ChallengeService:()=>c.PJ,ChallengeStrings:()=>w.NiJ,ChallengeValidation:()=>w.tQn,ChangeAndSaveItem:()=>w.EdL,ChangeVaultKeyOptions:()=>w.tuB,ChangeVaultStorageMode:()=>w.KH1,ComponentManager:()=>c.yW,ComponentViewer:()=>c.SV,ComponentViewerError:()=>w.kQg,ComputePrivateUsername:()=>m.lx,ContactBelongsToVault:()=>w.euo,ContactService:()=>w.yqc,ContactServiceEvent:()=>w.EFn,ConvertToSharedVault:()=>w.b$E,Create001KeyParams:()=>m.Nv,Create002KeyParams:()=>m.H$,Create003KeyParams:()=>m.mU,Create004KeyParams:()=>m.ao,CreateAnyKeyParams:()=>m.jl,CreateChallengeValue:()=>w.KL0,CreateDecryptedBackupFile:()=>w.ocI,CreateDecryptionSplitWithKeyLookup:()=>m.nJ,CreateEncryptedBackupFile:()=>w.D6l,CreateEncryptionSplitWithKeyLookup:()=>m.Ak,CreateNewDefaultItemsKey:()=>w.Nwx,CreateNewItemsKeyWithRollback:()=>w.Yw,CreateNewRootKey:()=>m.C4,CreateOrEditContact:()=>w.Dk4,CreateSharedVault:()=>w.zEM,CreateVault:()=>w.TQm,CredentialsChangeStrings:()=>w.Y7C,DO_NOT_CLOSE_APPLICATION:()=>w.liL,DecryptBackupFile:()=>w.vV3,DecryptBackupPayloads:()=>w.ZXN,DecryptErroredPayloads:()=>w.eyx,DecryptErroredTypeAPayloads:()=>w.suI,DecryptItemsKeyByPromptingUser:()=>w.zW4,DecryptItemsKeyWithUserFallback:()=>w.nGw,DecryptMessage:()=>w.$M4,DecryptOwnMessage:()=>w.EQN,DecryptTypeAPayload:()=>w.gzl,DecryptTypeAPayloadWithKeyLookup:()=>w.qXV,DefaultHost:()=>u.M,DeinitMode:()=>w.CYv,DeinitSource:()=>w.u4P,DeleteAuthenticator:()=>s.cx,DeleteContact:()=>w.z8s,DeleteRevision:()=>s.gS,DeleteSharedVault:()=>w.KLn,DeleteThirdPartyVault:()=>w.jGD,DeleteVault:()=>w.Rws,DeprecatedHttpService:()=>c.ql,DesignateSurvivor:()=>w.X2V,DetermineKeyToUse:()=>w.WEs,DiscardItemsLocally:()=>w.Ydb,DiskStorageService:()=>c.e5,DownloadAndDecryptFileOperation:()=>v.BI,EXPIRED_PROTOCOL_VERSION:()=>w.R53,EditContact:()=>w.ZQj,EncryptAndUploadFileOperation:()=>v.y4,EncryptMessage:()=>w.S1n,EncryptTypeAPayload:()=>w.i6C,EncryptTypeAPayloadWithKeyLookup:()=>w.k6d,EncryptionOperators:()=>m.$l,EncryptionService:()=>w.C6q,EncryptionServiceEvent:()=>w.fa_,ErrorAlertStrings:()=>w.kov,FeatureStatus:()=>w.iKc,FeaturesEvent:()=>w.Usi,FeaturesService:()=>c.kq,FileBackupsConstantsV1:()=>v.yW,FileBackupsDirectoryName:()=>w.aax,FileDecryptor:()=>v.YT,FileDownloader:()=>v.VA,FileEncryptor:()=>v.IL,FileMemoryCache:()=>v.F9,FileService:()=>w.IpN,FileUploader:()=>v.bA,FilesBackupService:()=>w.exs,FillRootKeyContent:()=>m.FX,FindContact:()=>w.VD3,FindDefaultItemsKey:()=>w.iPu,FindPayloadInDecryptionSplit:()=>m.sP,FindPayloadInEncryptionSplit:()=>m.G6,GenerateUuid:()=>w.ug$,GetAllContacts:()=>w.s$_,GetAuthenticatorAuthenticationOptions:()=>s.VQ,GetAuthenticatorAuthenticationResponse:()=>s.FV,GetBackupFileType:()=>w.KCz,GetFilePassword:()=>w.DZq,GetHost:()=>w.cdY,GetInboundMessages:()=>w.Vxn,GetKeyPairs:()=>w.Byj,GetMessageAdditionalData:()=>w.qk9,GetOutboundMessages:()=>w.WUT,GetOwnedSharedVaults:()=>w.tlz,GetRecoveryCodes:()=>s.u2,GetRevision:()=>s.Xc,GetSharedVaults:()=>w.Tog,GetSortedPayloadsByPriority:()=>w.xOS,GetTrustedPayload:()=>w.pqE,GetUntrustedPayload:()=>w.P9M,GetVault:()=>w.dDs,GetVaultContacts:()=>w.bDv,GetVaultItems:()=>w.$qZ,GetVaultUsers:()=>w.PDt,GetVaults:()=>w.r0l,HandleKeyPairChange:()=>w.qjc,HandleRootKeyChangedMessage:()=>w.cjV,HistoryManager:()=>c.EO,HomeServerService:()=>w.tGH,INVALID_EXTENSION_URL:()=>w.$cH,INVALID_PASSWORD:()=>w.CVE,INVALID_PASSWORD_COST:()=>w.nIe,ImportData:()=>w.Ens,InMemoryStore:()=>w.CEH,InfoStrings:()=>w.l4I,InsufficientPasswordMessage:()=>w.Bw1,IntegrityEvent:()=>w.ezr,IntegrityService:()=>w.yim,InternalEventBus:()=>w.Ehg,InternalEventPublishStrategy:()=>w.WNP,InternalFeature:()=>w.KK4,InternalFeatureService:()=>w.BbS,InviteToVault:()=>w.RAe,IsApplicationUsingThirdPartyHost:()=>w.Y8x,IsReadonlyVaultMember:()=>w.hEi,IsVaultAdmin:()=>w.o1e,IsVaultOwner:()=>w.hjk,ItemManager:()=>c.A,ItemRelationshipDirection:()=>w.uMm,ItemSignatureValidationResult:()=>w.kNl,ItemsEncryptionService:()=>w.oQ4,ItemsKeyMutator:()=>m.tn,KeyMode:()=>w.UEW,KeyParamsFromApiResponse:()=>m.LW,KeyParamsOrigination:()=>h.KeyParamsOrigination,KeyRecoveryService:()=>c.D0,KeyRecoveryStrings:()=>m.fD,KeySystemItemsKey:()=>m.yv,KeySystemItemsKeyMutator:()=>m.NC,KeySystemKeyManager:()=>w.Pn4,KeychainRecoveryStrings:()=>w.mHn,LeaveVault:()=>w.Z7G,LegacyApiService:()=>c.Af,LegacyKeys1_0_0:()=>w.Icj,ListAuthenticators:()=>s.FL,ListRevisions:()=>s.GU,ListedService:()=>c.o8,LiveItem:()=>e.J5,LocalPrefKey:()=>w.dH$,MINIMUM_PASSWORD_LENGTH:()=>c.aM,MfaService:()=>c.pY,Migration2_0_15:()=>l.ly,Migration2_167_6:()=>l.wg,Migration2_168_6:()=>l.aL,Migration2_202_1:()=>l.od,Migration2_208_0:()=>l.Jb,Migration2_209_0:()=>l.Lp,Migration2_20_0:()=>l.kK,Migration2_36_0:()=>l.qW,Migration2_42_0:()=>l.Ni,Migration2_7_0:()=>l.pI,MigrationClasses:()=>l.R_,MigrationService:()=>c.HK,MissingAccountParams:()=>c.Sn,MobileUnlockTiming:()=>w.sNv,MoveItemsToVault:()=>w.cZu,MutatorService:()=>c.Vu,NonwrappedStorageKey:()=>w.cU9,NotificationService:()=>w.gqp,NotificationServiceEvent:()=>w.JQe,NotifyVaultUsersOfKeyRotation:()=>w.cVV,OUTDATED_PROTOCOL_ALERT_IGNORE:()=>w._Bl,OfflineSyncOperation:()=>c.Bi,OrderedByteChunker:()=>v.WE,Paths:()=>c.nB,PayloadManager:()=>c.Ot,PreferencesService:()=>c.KJ,PreferencesServiceEvent:()=>w.WZd,PreviousSnjsVersion1_0_0:()=>d.DU,PreviousSnjsVersion2_0_0:()=>d.Oq,ProcessAcceptedVaultInvite:()=>w.Klw,ProposedSecondsToDeferUILevelSessionExpirationDuringActiveInteraction:()=>c.Ps,ProtectionEvent:()=>w.Hh3,ProtectionService:()=>c.nT,ProtectionSessionDurations:()=>c.jg,ProtocolUpgradeStrings:()=>w.GUt,ProtocolVersionForKeyParams:()=>m.nx,REMOVING_PASSCODE:()=>w.vL5,RawStorageKey:()=>w.Bq2,ReactNativeToWebEvent:()=>o.Z,ReadwriteActions:()=>c.wJ,ReencryptTypeAItems:()=>w.HSp,RegisterStrings:()=>w.rc1,RemoveItemFromVault:()=>w.fF_,RemoveItemsFromMemory:()=>w.$sG,RemoveVaultMember:()=>w.YxU,ReplaceContactData:()=>w.xRL,ResendAllMessages:()=>w.HLD,ResendMessage:()=>w.IF$,ReuploadAllInvites:()=>w.F0Y,ReuploadInvite:()=>w.afr,ReuploadVaultInvites:()=>w.s7t,RevisionManager:()=>w.t9U,RootKeyManager:()=>w.wtP,RotateVaultKey:()=>w.PqX,SETTING_PASSCODE:()=>w.TpP,SNApplication:()=>e.UC,SNApplicationGroup:()=>i.R,SNItemsKey:()=>m.rU,SNLog:()=>a.W,SNProtocolOperator001:()=>m.d1,SNProtocolOperator002:()=>m.QR,SNProtocolOperator003:()=>m.Er,SNProtocolOperator004:()=>m.iN,SNRootKey:()=>m.t$,SNRootKeyParams:()=>m.Gw,SelfContactManager:()=>w.Ld1,SendMessage:()=>w.uzh,SendOwnContactChangeMessage:()=>w.u3X,SendVaultDataChangedMessage:()=>w.$SL,SendVaultInvite:()=>w.Iup,SendVaultKeyChangedMessage:()=>w.Foy,ServerErrorStrings:()=>w.VxG,ServerSyncResponse:()=>c.Fi,ServerSyncResponseResolver:()=>c.y0,SessionEvent:()=>w.Pxr,SessionManager:()=>c.Sj,SessionStrings:()=>w.K9E,SetHost:()=>w.q62,SettingsService:()=>c.gb,ShareContactWithVault:()=>w.uLb,SharedVaultService:()=>w.cnh,SharedVaultServiceEvent:()=>w.$_C,SignInStrings:()=>w.Mwm,SignInWithRecoveryCodes:()=>s.Y_,SingletonManager:()=>c.Wz,SnjsVersion:()=>d.in,SplitPayloadsByEncryptionType:()=>m.xg,StandardException:()=>m.KX,StaticItemCounter:()=>w.kNs,StatusService:()=>w.Bjn,StatusServiceEvent:()=>w.rW4,StorageKey:()=>w.QtK,StoragePersistencePolicies:()=>w.eIN,StorageValueModes:()=>w.qt7,StrictSignInFailed:()=>w.OC4,SubscriptionManager:()=>w.LF2,SubscriptionManagerEvent:()=>w.lKe,SyncBackoffService:()=>w.XEg,SyncEvent:()=>w.wMo,SyncLocalVaultsWithRemoteSharedVaults:()=>w._Jh,SyncMode:()=>w.YCg,SyncOpStatus:()=>w.BUK,SyncQueueStrategy:()=>w.Sii,SyncService:()=>c._U,SyncSource:()=>w.Lbd,SyncUpDownLimit:()=>c.jH,TYPES:()=>t.v,TextBackupsDirectoryName:()=>w.OU3,UNKNOWN_ERROR:()=>w.I4j,UNSUPPORTED_KEY_DERIVATION:()=>w.VnT,UNSUPPORTED_PROTOCOL_VERSION:()=>w.fnl,UPGRADING_ENCRYPTION:()=>w.RsP,UnprotectedAccessSecondsDuration:()=>c.Fr,UserService:()=>w.KDu,V001Algorithm:()=>m.xo,V002Algorithm:()=>m.$4,V003Algorithm:()=>m._0,V004Algorithm:()=>m.eC,ValidKeyParamsKeys:()=>m.Am,ValidateItemSigner:()=>w.Lv2,ValidateVaultPassword:()=>w.EGP,ValueModesKeys:()=>w.dDH,VaultInviteService:()=>w.hZp,VaultInviteServiceEvent:()=>w.Z$T,VaultLockService:()=>w.PHC,VaultLockServiceEvent:()=>w.h21,VaultService:()=>w.RDE,VaultServiceEvent:()=>w.ccW,VaultUserCache:()=>w.k7Z,VaultUserService:()=>w.igb,VaultUserServiceEvent:()=>w.UR5,WebAppEvent:()=>w.B5f,WebSocketsService:()=>w.BV4,WebSocketsServiceEvent:()=>w.fAX,applicationEventForSyncEvent:()=>e.ie,compareSemVersions:()=>d.D8,createOperatorForVersion:()=>m.ZP,deconstructEncryptedPayloadString:()=>m.UH,decryptPayload:()=>m.oO,doesPayloadRequireSigning:()=>m.qw,encryptPayload:()=>m.Gl,encryptedInputParametersFromPayload:()=>m.xi,environmentToString:()=>e.g,fileProgressToHumanReadableString:()=>v.Qc,isChunkFullEntry:()=>w.ufS,isComponentViewerItemReadonlyItem:()=>w.qr4,isDesktopDevice:()=>w.dse,isEnvironmentMobile:()=>e.Im,isEnvironmentWebOrDesktop:()=>e.Ak,isErrorDecryptingParameters:()=>m.XL,isFullEntryLoadChunkResponse:()=>w.Or9,isItemsKey:()=>m.dS,isKeySystemItemsKey:()=>m.mX,isMobileDevice:()=>w.s2G,isRightVersionGreaterThanLeft:()=>d.jV,isValidProtectionSessionLength:()=>c.z4,namespacedKey:()=>w.xLN,platformFromString:()=>e.FB,platformToString:()=>e._e,readAndDecryptBackupFileUsingBackupService:()=>v.mQ,readAndDecryptBackupFileUsingFileSystemAPI:()=>v.Qf});var e=n(85593),t=n(13979),i=n(58181),o=n(29159),s=n(67199),a=n(43361),l=n(90693),c=n(91096),u=n(34146),d=n(94986),h=n(20875),p=n(82648),f={};for(const e in p)["default","KeyParamsOrigination","LiveItem","SNApplication","applicationEventForSyncEvent","environmentToString","isEnvironmentMobile","isEnvironmentWebOrDesktop","platformFromString","platformToString","TYPES","ApplicationGroupEvent","SNApplicationGroup","ReactNativeToWebEvent","AddAuthenticator","DeleteAuthenticator","DeleteRevision","GetAuthenticatorAuthenticationOptions","GetAuthenticatorAuthenticationResponse","GetRecoveryCodes","GetRevision","ListAuthenticators","ListRevisions","SignInWithRecoveryCodes","SNLog","BaseMigration","Migration2_0_15","Migration2_167_6","Migration2_168_6","Migration2_202_1","Migration2_208_0","Migration2_209_0","Migration2_20_0","Migration2_36_0","Migration2_42_0","Migration2_7_0","MigrationClasses","AccountSyncOperation","ActionsService","AllowedBatchContentTypes","AllowedBatchStreaming","ApplicationService","ChallengeOperation","ChallengeResponse","ChallengeService","ComponentManager","ComponentViewer","DeprecatedHttpService","DiskStorageService","FeaturesService","HistoryManager","ItemManager","KeyRecoveryService","LegacyApiService","ListedService","MINIMUM_PASSWORD_LENGTH","MfaService","MigrationService","MissingAccountParams","MutatorService","OfflineSyncOperation","Paths","PayloadManager","PreferencesService","ProposedSecondsToDeferUILevelSessionExpirationDuringActiveInteraction","ProtectionService","ProtectionSessionDurations","ReadwriteActions","ServerSyncResponse","ServerSyncResponseResolver","SessionManager","SettingsService","SingletonManager","SyncService","SyncUpDownLimit","UnprotectedAccessSecondsDuration","isValidProtectionSessionLength","DefaultHost","PreviousSnjsVersion1_0_0","PreviousSnjsVersion2_0_0","SnjsVersion","compareSemVersions","isRightVersionGreaterThanLeft"].indexOf(e)<0&&(f[e]=()=>p[e]);n.d(r,f);var g=n(70781);f={};for(const e in g)["default","KeyParamsOrigination","LiveItem","SNApplication","applicationEventForSyncEvent","environmentToString","isEnvironmentMobile","isEnvironmentWebOrDesktop","platformFromString","platformToString","TYPES","ApplicationGroupEvent","SNApplicationGroup","ReactNativeToWebEvent","AddAuthenticator","DeleteAuthenticator","DeleteRevision","GetAuthenticatorAuthenticationOptions","GetAuthenticatorAuthenticationResponse","GetRecoveryCodes","GetRevision","ListAuthenticators","ListRevisions","SignInWithRecoveryCodes","SNLog","BaseMigration","Migration2_0_15","Migration2_167_6","Migration2_168_6","Migration2_202_1","Migration2_208_0","Migration2_209_0","Migration2_20_0","Migration2_36_0","Migration2_42_0","Migration2_7_0","MigrationClasses","AccountSyncOperation","ActionsService","AllowedBatchContentTypes","AllowedBatchStreaming","ApplicationService","ChallengeOperation","ChallengeResponse","ChallengeService","ComponentManager","ComponentViewer","DeprecatedHttpService","DiskStorageService","FeaturesService","HistoryManager","ItemManager","KeyRecoveryService","LegacyApiService","ListedService","MINIMUM_PASSWORD_LENGTH","MfaService","MigrationService","MissingAccountParams","MutatorService","OfflineSyncOperation","Paths","PayloadManager","PreferencesService","ProposedSecondsToDeferUILevelSessionExpirationDuringActiveInteraction","ProtectionService","ProtectionSessionDurations","ReadwriteActions","ServerSyncResponse","ServerSyncResponseResolver","SessionManager","SettingsService","SingletonManager","SyncService","SyncUpDownLimit","UnprotectedAccessSecondsDuration","isValidProtectionSessionLength","DefaultHost","PreviousSnjsVersion1_0_0","PreviousSnjsVersion2_0_0","SnjsVersion","compareSemVersions","isRightVersionGreaterThanLeft"].indexOf(e)<0&&(f[e]=()=>g[e]);n.d(r,f);var m=n(86999),y=n(80215);f={};for(const e in y)["default","KeyParamsOrigination","LiveItem","SNApplication","applicationEventForSyncEvent","environmentToString","isEnvironmentMobile","isEnvironmentWebOrDesktop","platformFromString","platformToString","TYPES","ApplicationGroupEvent","SNApplicationGroup","ReactNativeToWebEvent","AddAuthenticator","DeleteAuthenticator","DeleteRevision","GetAuthenticatorAuthenticationOptions","GetAuthenticatorAuthenticationResponse","GetRecoveryCodes","GetRevision","ListAuthenticators","ListRevisions","SignInWithRecoveryCodes","SNLog","BaseMigration","Migration2_0_15","Migration2_167_6","Migration2_168_6","Migration2_202_1","Migration2_208_0","Migration2_209_0","Migration2_20_0","Migration2_36_0","Migration2_42_0","Migration2_7_0","MigrationClasses","AccountSyncOperation","ActionsService","AllowedBatchContentTypes","AllowedBatchStreaming","ApplicationService","ChallengeOperation","ChallengeResponse","ChallengeService","ComponentManager","ComponentViewer","DeprecatedHttpService","DiskStorageService","FeaturesService","HistoryManager","ItemManager","KeyRecoveryService","LegacyApiService","ListedService","MINIMUM_PASSWORD_LENGTH","MfaService","MigrationService","MissingAccountParams","MutatorService","OfflineSyncOperation","Paths","PayloadManager","PreferencesService","ProposedSecondsToDeferUILevelSessionExpirationDuringActiveInteraction","ProtectionService","ProtectionSessionDurations","ReadwriteActions","ServerSyncResponse","ServerSyncResponseResolver","SessionManager","SettingsService","SingletonManager","SyncService","SyncUpDownLimit","UnprotectedAccessSecondsDuration","isValidProtectionSessionLength","DefaultHost","PreviousSnjsVersion1_0_0","PreviousSnjsVersion2_0_0","SnjsVersion","compareSemVersions","isRightVersionGreaterThanLeft","BackupFileType","ComputePrivateUsername","Create001KeyParams","Create002KeyParams","Create003KeyParams","Create004KeyParams","CreateAnyKeyParams","CreateDecryptionSplitWithKeyLookup","CreateEncryptionSplitWithKeyLookup","CreateNewRootKey","EncryptionOperators","FillRootKeyContent","FindPayloadInDecryptionSplit","FindPayloadInEncryptionSplit","ItemsKeyMutator","KeyParamsFromApiResponse","KeyRecoveryStrings","KeySystemItemsKey","KeySystemItemsKeyMutator","ProtocolVersionForKeyParams","SNItemsKey","SNProtocolOperator001","SNProtocolOperator002","SNProtocolOperator003","SNProtocolOperator004","SNRootKey","SNRootKeyParams","SplitPayloadsByEncryptionType","StandardException","V001Algorithm","V002Algorithm","V003Algorithm","V004Algorithm","ValidKeyParamsKeys","createOperatorForVersion","deconstructEncryptedPayloadString","decryptPayload","doesPayloadRequireSigning","encryptPayload","encryptedInputParametersFromPayload","isErrorDecryptingParameters","isItemsKey","isKeySystemItemsKey"].indexOf(e)<0&&(f[e]=()=>y[e]);n.d(r,f);var v=n(86311),A=n(22325);f={};for(const e in A)["default","KeyParamsOrigination","LiveItem","SNApplication","applicationEventForSyncEvent","environmentToString","isEnvironmentMobile","isEnvironmentWebOrDesktop","platformFromString","platformToString","TYPES","ApplicationGroupEvent","SNApplicationGroup","ReactNativeToWebEvent","AddAuthenticator","DeleteAuthenticator","DeleteRevision","GetAuthenticatorAuthenticationOptions","GetAuthenticatorAuthenticationResponse","GetRecoveryCodes","GetRevision","ListAuthenticators","ListRevisions","SignInWithRecoveryCodes","SNLog","BaseMigration","Migration2_0_15","Migration2_167_6","Migration2_168_6","Migration2_202_1","Migration2_208_0","Migration2_209_0","Migration2_20_0","Migration2_36_0","Migration2_42_0","Migration2_7_0","MigrationClasses","AccountSyncOperation","ActionsService","AllowedBatchContentTypes","AllowedBatchStreaming","ApplicationService","ChallengeOperation","ChallengeResponse","ChallengeService","ComponentManager","ComponentViewer","DeprecatedHttpService","DiskStorageService","FeaturesService","HistoryManager","ItemManager","KeyRecoveryService","LegacyApiService","ListedService","MINIMUM_PASSWORD_LENGTH","MfaService","MigrationService","MissingAccountParams","MutatorService","OfflineSyncOperation","Paths","PayloadManager","PreferencesService","ProposedSecondsToDeferUILevelSessionExpirationDuringActiveInteraction","ProtectionService","ProtectionSessionDurations","ReadwriteActions","ServerSyncResponse","ServerSyncResponseResolver","SessionManager","SettingsService","SingletonManager","SyncService","SyncUpDownLimit","UnprotectedAccessSecondsDuration","isValidProtectionSessionLength","DefaultHost","PreviousSnjsVersion1_0_0","PreviousSnjsVersion2_0_0","SnjsVersion","compareSemVersions","isRightVersionGreaterThanLeft","BackupFileType","ComputePrivateUsername","Create001KeyParams","Create002KeyParams","Create003KeyParams","Create004KeyParams","CreateAnyKeyParams","CreateDecryptionSplitWithKeyLookup","CreateEncryptionSplitWithKeyLookup","CreateNewRootKey","EncryptionOperators","FillRootKeyContent","FindPayloadInDecryptionSplit","FindPayloadInEncryptionSplit","ItemsKeyMutator","KeyParamsFromApiResponse","KeyRecoveryStrings","KeySystemItemsKey","KeySystemItemsKeyMutator","ProtocolVersionForKeyParams","SNItemsKey","SNProtocolOperator001","SNProtocolOperator002","SNProtocolOperator003","SNProtocolOperator004","SNRootKey","SNRootKeyParams","SplitPayloadsByEncryptionType","StandardException","V001Algorithm","V002Algorithm","V003Algorithm","V004Algorithm","ValidKeyParamsKeys","createOperatorForVersion","deconstructEncryptedPayloadString","decryptPayload","doesPayloadRequireSigning","encryptPayload","encryptedInputParametersFromPayload","isErrorDecryptingParameters","isItemsKey","isKeySystemItemsKey","ByteChunker","DownloadAndDecryptFileOperation","EncryptAndUploadFileOperation","FileBackupsConstantsV1","FileDecryptor","FileDownloader","FileEncryptor","FileMemoryCache","FileUploader","OrderedByteChunker","fileProgressToHumanReadableString","readAndDecryptBackupFileUsingBackupService","readAndDecryptBackupFileUsingFileSystemAPI"].indexOf(e)<0&&(f[e]=()=>A[e]);n.d(r,f);var b=n(95658);f={};for(const e in b)["default","KeyParamsOrigination","LiveItem","SNApplication","applicationEventForSyncEvent","environmentToString","isEnvironmentMobile","isEnvironmentWebOrDesktop","platformFromString","platformToString","TYPES","ApplicationGroupEvent","SNApplicationGroup","ReactNativeToWebEvent","AddAuthenticator","DeleteAuthenticator","DeleteRevision","GetAuthenticatorAuthenticationOptions","GetAuthenticatorAuthenticationResponse","GetRecoveryCodes","GetRevision","ListAuthenticators","ListRevisions","SignInWithRecoveryCodes","SNLog","BaseMigration","Migration2_0_15","Migration2_167_6","Migration2_168_6","Migration2_202_1","Migration2_208_0","Migration2_209_0","Migration2_20_0","Migration2_36_0","Migration2_42_0","Migration2_7_0","MigrationClasses","AccountSyncOperation","ActionsService","AllowedBatchContentTypes","AllowedBatchStreaming","ApplicationService","ChallengeOperation","ChallengeResponse","ChallengeService","ComponentManager","ComponentViewer","DeprecatedHttpService","DiskStorageService","FeaturesService","HistoryManager","ItemManager","KeyRecoveryService","LegacyApiService","ListedService","MINIMUM_PASSWORD_LENGTH","MfaService","MigrationService","MissingAccountParams","MutatorService","OfflineSyncOperation","Paths","PayloadManager","PreferencesService","ProposedSecondsToDeferUILevelSessionExpirationDuringActiveInteraction","ProtectionService","ProtectionSessionDurations","ReadwriteActions","ServerSyncResponse","ServerSyncResponseResolver","SessionManager","SettingsService","SingletonManager","SyncService","SyncUpDownLimit","UnprotectedAccessSecondsDuration","isValidProtectionSessionLength","DefaultHost","PreviousSnjsVersion1_0_0","PreviousSnjsVersion2_0_0","SnjsVersion","compareSemVersions","isRightVersionGreaterThanLeft","BackupFileType","ComputePrivateUsername","Create001KeyParams","Create002KeyParams","Create003KeyParams","Create004KeyParams","CreateAnyKeyParams","CreateDecryptionSplitWithKeyLookup","CreateEncryptionSplitWithKeyLookup","CreateNewRootKey","EncryptionOperators","FillRootKeyContent","FindPayloadInDecryptionSplit","FindPayloadInEncryptionSplit","ItemsKeyMutator","KeyParamsFromApiResponse","KeyRecoveryStrings","KeySystemItemsKey","KeySystemItemsKeyMutator","ProtocolVersionForKeyParams","SNItemsKey","SNProtocolOperator001","SNProtocolOperator002","SNProtocolOperator003","SNProtocolOperator004","SNRootKey","SNRootKeyParams","SplitPayloadsByEncryptionType","StandardException","V001Algorithm","V002Algorithm","V003Algorithm","V004Algorithm","ValidKeyParamsKeys","createOperatorForVersion","deconstructEncryptedPayloadString","decryptPayload","doesPayloadRequireSigning","encryptPayload","encryptedInputParametersFromPayload","isErrorDecryptingParameters","isItemsKey","isKeySystemItemsKey","ByteChunker","DownloadAndDecryptFileOperation","EncryptAndUploadFileOperation","FileBackupsConstantsV1","FileDecryptor","FileDownloader","FileEncryptor","FileMemoryCache","FileUploader","OrderedByteChunker","fileProgressToHumanReadableString","readAndDecryptBackupFileUsingBackupService","readAndDecryptBackupFileUsingFileSystemAPI"].indexOf(e)<0&&(f[e]=()=>b[e]);n.d(r,f);var w=n(55668),S=n(73606);f={};for(const e in S)["default","KeyParamsOrigination","LiveItem","SNApplication","applicationEventForSyncEvent","environmentToString","isEnvironmentMobile","isEnvironmentWebOrDesktop","platformFromString","platformToString","TYPES","ApplicationGroupEvent","SNApplicationGroup","ReactNativeToWebEvent","AddAuthenticator","DeleteAuthenticator","DeleteRevision","GetAuthenticatorAuthenticationOptions","GetAuthenticatorAuthenticationResponse","GetRecoveryCodes","GetRevision","ListAuthenticators","ListRevisions","SignInWithRecoveryCodes","SNLog","BaseMigration","Migration2_0_15","Migration2_167_6","Migration2_168_6","Migration2_202_1","Migration2_208_0","Migration2_209_0","Migration2_20_0","Migration2_36_0","Migration2_42_0","Migration2_7_0","MigrationClasses","AccountSyncOperation","ActionsService","AllowedBatchContentTypes","AllowedBatchStreaming","ApplicationService","ChallengeOperation","ChallengeResponse","ChallengeService","ComponentManager","ComponentViewer","DeprecatedHttpService","DiskStorageService","FeaturesService","HistoryManager","ItemManager","KeyRecoveryService","LegacyApiService","ListedService","MINIMUM_PASSWORD_LENGTH","MfaService","MigrationService","MissingAccountParams","MutatorService","OfflineSyncOperation","Paths","PayloadManager","PreferencesService","ProposedSecondsToDeferUILevelSessionExpirationDuringActiveInteraction","ProtectionService","ProtectionSessionDurations","ReadwriteActions","ServerSyncResponse","ServerSyncResponseResolver","SessionManager","SettingsService","SingletonManager","SyncService","SyncUpDownLimit","UnprotectedAccessSecondsDuration","isValidProtectionSessionLength","DefaultHost","PreviousSnjsVersion1_0_0","PreviousSnjsVersion2_0_0","SnjsVersion","compareSemVersions","isRightVersionGreaterThanLeft","BackupFileType","ComputePrivateUsername","Create001KeyParams","Create002KeyParams","Create003KeyParams","Create004KeyParams","CreateAnyKeyParams","CreateDecryptionSplitWithKeyLookup","CreateEncryptionSplitWithKeyLookup","CreateNewRootKey","EncryptionOperators","FillRootKeyContent","FindPayloadInDecryptionSplit","FindPayloadInEncryptionSplit","ItemsKeyMutator","KeyParamsFromApiResponse","KeyRecoveryStrings","KeySystemItemsKey","KeySystemItemsKeyMutator","ProtocolVersionForKeyParams","SNItemsKey","SNProtocolOperator001","SNProtocolOperator002","SNProtocolOperator003","SNProtocolOperator004","SNRootKey","SNRootKeyParams","SplitPayloadsByEncryptionType","StandardException","V001Algorithm","V002Algorithm","V003Algorithm","V004Algorithm","ValidKeyParamsKeys","createOperatorForVersion","deconstructEncryptedPayloadString","decryptPayload","doesPayloadRequireSigning","encryptPayload","encryptedInputParametersFromPayload","isErrorDecryptingParameters","isItemsKey","isKeySystemItemsKey","ByteChunker","DownloadAndDecryptFileOperation","EncryptAndUploadFileOperation","FileBackupsConstantsV1","FileDecryptor","FileDownloader","FileEncryptor","FileMemoryCache","FileUploader","OrderedByteChunker","fileProgressToHumanReadableString","readAndDecryptBackupFileUsingBackupService","readAndDecryptBackupFileUsingFileSystemAPI","API_MESSAGE_CHANGE_CREDENTIALS_IN_PROGRESS","API_MESSAGE_FAILED_ACCESS_PURCHASE","API_MESSAGE_FAILED_CREATE_FILE_TOKEN","API_MESSAGE_FAILED_DOWNLOADING_EXTENSION","API_MESSAGE_FAILED_GET_SETTINGS","API_MESSAGE_FAILED_LISTED_REGISTRATION","API_MESSAGE_FAILED_OFFLINE_ACTIVATION","API_MESSAGE_FAILED_OFFLINE_FEATURES","API_MESSAGE_FAILED_SUBSCRIPTION_INFO","API_MESSAGE_FAILED_UPDATE_SETTINGS","API_MESSAGE_FALLBACK_LOGIN_FAIL","API_MESSAGE_GENERIC_CHANGE_CREDENTIALS_FAIL","API_MESSAGE_GENERIC_INTEGRITY_CHECK_FAIL","API_MESSAGE_GENERIC_INVALID_LOGIN","API_MESSAGE_GENERIC_REGISTRATION_FAIL","API_MESSAGE_GENERIC_SINGLE_ITEM_SYNC_FAIL","API_MESSAGE_GENERIC_SYNC_FAIL","API_MESSAGE_GENERIC_TOKEN_REFRESH_FAIL","API_MESSAGE_INVALID_SESSION","API_MESSAGE_LOGIN_IN_PROGRESS","API_MESSAGE_RATE_LIMITED","API_MESSAGE_REGISTRATION_IN_PROGRESS","API_MESSAGE_TOKEN_REFRESH_IN_PROGRESS","API_MESSAGE_UNTRUSTED_EXTENSIONS_WARNING","AbstractService","AcceptVaultInvite","AccountEvent","AlertService","ApiServiceEvent","AppleIAPProductId","ApplicationEvent","ApplicationOptionsDefaults","ApplicationStage","AsymmetricMessageService","AuthManager","AuthenticatorManager","AuthorizeVaultDeletion","ButtonType","CHANGING_PASSCODE","Challenge","ChallengeKeyboardType","ChallengeModalTitle","ChallengePrompt","ChallengePromptTitle","ChallengeReason","ChallengeStrings","ChallengeValidation","ChangeAndSaveItem","ChangeVaultKeyOptions","ChangeVaultStorageMode","ComponentViewerError","ContactBelongsToVault","ContactService","ContactServiceEvent","ConvertToSharedVault","CreateChallengeValue","CreateDecryptedBackupFile","CreateEncryptedBackupFile","CreateNewDefaultItemsKey","CreateNewItemsKeyWithRollback","CreateOrEditContact","CreateSharedVault","CreateVault","CredentialsChangeStrings","DO_NOT_CLOSE_APPLICATION","DecryptBackupFile","DecryptBackupPayloads","DecryptErroredPayloads","DecryptErroredTypeAPayloads","DecryptItemsKeyByPromptingUser","DecryptItemsKeyWithUserFallback","DecryptMessage","DecryptOwnMessage","DecryptTypeAPayload","DecryptTypeAPayloadWithKeyLookup","DeinitMode","DeinitSource","DeleteContact","DeleteSharedVault","DeleteThirdPartyVault","DeleteVault","DesignateSurvivor","DetermineKeyToUse","DiscardItemsLocally","EXPIRED_PROTOCOL_VERSION","EditContact","EncryptMessage","EncryptTypeAPayload","EncryptTypeAPayloadWithKeyLookup","EncryptionService","EncryptionServiceEvent","ErrorAlertStrings","FeatureStatus","FeaturesEvent","FileBackupsDirectoryName","FileService","FilesBackupService","FindContact","FindDefaultItemsKey","GenerateUuid","GetAllContacts","GetBackupFileType","GetFilePassword","GetHost","GetInboundMessages","GetKeyPairs","GetMessageAdditionalData","GetOutboundMessages","GetOwnedSharedVaults","GetSharedVaults","GetSortedPayloadsByPriority","GetTrustedPayload","GetUntrustedPayload","GetVault","GetVaultContacts","GetVaultItems","GetVaultUsers","GetVaults","HandleKeyPairChange","HandleRootKeyChangedMessage","HomeServerService","INVALID_EXTENSION_URL","INVALID_PASSWORD","INVALID_PASSWORD_COST","ImportData","InMemoryStore","InfoStrings","InsufficientPasswordMessage","IntegrityEvent","IntegrityService","InternalEventBus","InternalEventPublishStrategy","InternalFeature","InternalFeatureService","InviteToVault","IsApplicationUsingThirdPartyHost","IsReadonlyVaultMember","IsVaultAdmin","IsVaultOwner","ItemRelationshipDirection","ItemSignatureValidationResult","ItemsEncryptionService","KeyMode","KeySystemKeyManager","KeychainRecoveryStrings","LeaveVault","LegacyKeys1_0_0","LocalPrefKey","MobileUnlockTiming","MoveItemsToVault","NonwrappedStorageKey","NotificationService","NotificationServiceEvent","NotifyVaultUsersOfKeyRotation","OUTDATED_PROTOCOL_ALERT_IGNORE","PreferencesServiceEvent","ProcessAcceptedVaultInvite","ProtectionEvent","ProtocolUpgradeStrings","REMOVING_PASSCODE","RawStorageKey","ReencryptTypeAItems","RegisterStrings","RemoveItemFromVault","RemoveItemsFromMemory","RemoveVaultMember","ReplaceContactData","ResendAllMessages","ResendMessage","ReuploadAllInvites","ReuploadInvite","ReuploadVaultInvites","RevisionManager","RootKeyManager","RotateVaultKey","SETTING_PASSCODE","SelfContactManager","SendMessage","SendOwnContactChangeMessage","SendVaultDataChangedMessage","SendVaultInvite","SendVaultKeyChangedMessage","ServerErrorStrings","SessionEvent","SessionStrings","SetHost","ShareContactWithVault","SharedVaultService","SharedVaultServiceEvent","SignInStrings","StaticItemCounter","StatusService","StatusServiceEvent","StorageKey","StoragePersistencePolicies","StorageValueModes","StrictSignInFailed","SubscriptionManager","SubscriptionManagerEvent","SyncBackoffService","SyncEvent","SyncLocalVaultsWithRemoteSharedVaults","SyncMode","SyncOpStatus","SyncQueueStrategy","SyncSource","TextBackupsDirectoryName","UNKNOWN_ERROR","UNSUPPORTED_KEY_DERIVATION","UNSUPPORTED_PROTOCOL_VERSION","UPGRADING_ENCRYPTION","UserService","ValidateItemSigner","ValidateVaultPassword","ValueModesKeys","VaultInviteService","VaultInviteServiceEvent","VaultLockService","VaultLockServiceEvent","VaultService","VaultServiceEvent","VaultUserCache","VaultUserService","VaultUserServiceEvent","WebAppEvent","WebSocketsService","WebSocketsServiceEvent","isChunkFullEntry","isComponentViewerItemReadonlyItem","isDesktopDevice","isFullEntryLoadChunkResponse","isMobileDevice","namespacedKey"].indexOf(e)<0&&(f[e]=()=>S[e]);n.d(r,f);var C=n(87901);f={};for(const e in C)["default","KeyParamsOrigination","LiveItem","SNApplication","applicationEventForSyncEvent","environmentToString","isEnvironmentMobile","isEnvironmentWebOrDesktop","platformFromString","platformToString","TYPES","ApplicationGroupEvent","SNApplicationGroup","ReactNativeToWebEvent","AddAuthenticator","DeleteAuthenticator","DeleteRevision","GetAuthenticatorAuthenticationOptions","GetAuthenticatorAuthenticationResponse","GetRecoveryCodes","GetRevision","ListAuthenticators","ListRevisions","SignInWithRecoveryCodes","SNLog","BaseMigration","Migration2_0_15","Migration2_167_6","Migration2_168_6","Migration2_202_1","Migration2_208_0","Migration2_209_0","Migration2_20_0","Migration2_36_0","Migration2_42_0","Migration2_7_0","MigrationClasses","AccountSyncOperation","ActionsService","AllowedBatchContentTypes","AllowedBatchStreaming","ApplicationService","ChallengeOperation","ChallengeResponse","ChallengeService","ComponentManager","ComponentViewer","DeprecatedHttpService","DiskStorageService","FeaturesService","HistoryManager","ItemManager","KeyRecoveryService","LegacyApiService","ListedService","MINIMUM_PASSWORD_LENGTH","MfaService","MigrationService","MissingAccountParams","MutatorService","OfflineSyncOperation","Paths","PayloadManager","PreferencesService","ProposedSecondsToDeferUILevelSessionExpirationDuringActiveInteraction","ProtectionService","ProtectionSessionDurations","ReadwriteActions","ServerSyncResponse","ServerSyncResponseResolver","SessionManager","SettingsService","SingletonManager","SyncService","SyncUpDownLimit","UnprotectedAccessSecondsDuration","isValidProtectionSessionLength","DefaultHost","PreviousSnjsVersion1_0_0","PreviousSnjsVersion2_0_0","SnjsVersion","compareSemVersions","isRightVersionGreaterThanLeft","BackupFileType","ComputePrivateUsername","Create001KeyParams","Create002KeyParams","Create003KeyParams","Create004KeyParams","CreateAnyKeyParams","CreateDecryptionSplitWithKeyLookup","CreateEncryptionSplitWithKeyLookup","CreateNewRootKey","EncryptionOperators","FillRootKeyContent","FindPayloadInDecryptionSplit","FindPayloadInEncryptionSplit","ItemsKeyMutator","KeyParamsFromApiResponse","KeyRecoveryStrings","KeySystemItemsKey","KeySystemItemsKeyMutator","ProtocolVersionForKeyParams","SNItemsKey","SNProtocolOperator001","SNProtocolOperator002","SNProtocolOperator003","SNProtocolOperator004","SNRootKey","SNRootKeyParams","SplitPayloadsByEncryptionType","StandardException","V001Algorithm","V002Algorithm","V003Algorithm","V004Algorithm","ValidKeyParamsKeys","createOperatorForVersion","deconstructEncryptedPayloadString","decryptPayload","doesPayloadRequireSigning","encryptPayload","encryptedInputParametersFromPayload","isErrorDecryptingParameters","isItemsKey","isKeySystemItemsKey","ByteChunker","DownloadAndDecryptFileOperation","EncryptAndUploadFileOperation","FileBackupsConstantsV1","FileDecryptor","FileDownloader","FileEncryptor","FileMemoryCache","FileUploader","OrderedByteChunker","fileProgressToHumanReadableString","readAndDecryptBackupFileUsingBackupService","readAndDecryptBackupFileUsingFileSystemAPI","API_MESSAGE_CHANGE_CREDENTIALS_IN_PROGRESS","API_MESSAGE_FAILED_ACCESS_PURCHASE","API_MESSAGE_FAILED_CREATE_FILE_TOKEN","API_MESSAGE_FAILED_DOWNLOADING_EXTENSION","API_MESSAGE_FAILED_GET_SETTINGS","API_MESSAGE_FAILED_LISTED_REGISTRATION","API_MESSAGE_FAILED_OFFLINE_ACTIVATION","API_MESSAGE_FAILED_OFFLINE_FEATURES","API_MESSAGE_FAILED_SUBSCRIPTION_INFO","API_MESSAGE_FAILED_UPDATE_SETTINGS","API_MESSAGE_FALLBACK_LOGIN_FAIL","API_MESSAGE_GENERIC_CHANGE_CREDENTIALS_FAIL","API_MESSAGE_GENERIC_INTEGRITY_CHECK_FAIL","API_MESSAGE_GENERIC_INVALID_LOGIN","API_MESSAGE_GENERIC_REGISTRATION_FAIL","API_MESSAGE_GENERIC_SINGLE_ITEM_SYNC_FAIL","API_MESSAGE_GENERIC_SYNC_FAIL","API_MESSAGE_GENERIC_TOKEN_REFRESH_FAIL","API_MESSAGE_INVALID_SESSION","API_MESSAGE_LOGIN_IN_PROGRESS","API_MESSAGE_RATE_LIMITED","API_MESSAGE_REGISTRATION_IN_PROGRESS","API_MESSAGE_TOKEN_REFRESH_IN_PROGRESS","API_MESSAGE_UNTRUSTED_EXTENSIONS_WARNING","AbstractService","AcceptVaultInvite","AccountEvent","AlertService","ApiServiceEvent","AppleIAPProductId","ApplicationEvent","ApplicationOptionsDefaults","ApplicationStage","AsymmetricMessageService","AuthManager","AuthenticatorManager","AuthorizeVaultDeletion","ButtonType","CHANGING_PASSCODE","Challenge","ChallengeKeyboardType","ChallengeModalTitle","ChallengePrompt","ChallengePromptTitle","ChallengeReason","ChallengeStrings","ChallengeValidation","ChangeAndSaveItem","ChangeVaultKeyOptions","ChangeVaultStorageMode","ComponentViewerError","ContactBelongsToVault","ContactService","ContactServiceEvent","ConvertToSharedVault","CreateChallengeValue","CreateDecryptedBackupFile","CreateEncryptedBackupFile","CreateNewDefaultItemsKey","CreateNewItemsKeyWithRollback","CreateOrEditContact","CreateSharedVault","CreateVault","CredentialsChangeStrings","DO_NOT_CLOSE_APPLICATION","DecryptBackupFile","DecryptBackupPayloads","DecryptErroredPayloads","DecryptErroredTypeAPayloads","DecryptItemsKeyByPromptingUser","DecryptItemsKeyWithUserFallback","DecryptMessage","DecryptOwnMessage","DecryptTypeAPayload","DecryptTypeAPayloadWithKeyLookup","DeinitMode","DeinitSource","DeleteContact","DeleteSharedVault","DeleteThirdPartyVault","DeleteVault","DesignateSurvivor","DetermineKeyToUse","DiscardItemsLocally","EXPIRED_PROTOCOL_VERSION","EditContact","EncryptMessage","EncryptTypeAPayload","EncryptTypeAPayloadWithKeyLookup","EncryptionService","EncryptionServiceEvent","ErrorAlertStrings","FeatureStatus","FeaturesEvent","FileBackupsDirectoryName","FileService","FilesBackupService","FindContact","FindDefaultItemsKey","GenerateUuid","GetAllContacts","GetBackupFileType","GetFilePassword","GetHost","GetInboundMessages","GetKeyPairs","GetMessageAdditionalData","GetOutboundMessages","GetOwnedSharedVaults","GetSharedVaults","GetSortedPayloadsByPriority","GetTrustedPayload","GetUntrustedPayload","GetVault","GetVaultContacts","GetVaultItems","GetVaultUsers","GetVaults","HandleKeyPairChange","HandleRootKeyChangedMessage","HomeServerService","INVALID_EXTENSION_URL","INVALID_PASSWORD","INVALID_PASSWORD_COST","ImportData","InMemoryStore","InfoStrings","InsufficientPasswordMessage","IntegrityEvent","IntegrityService","InternalEventBus","InternalEventPublishStrategy","InternalFeature","InternalFeatureService","InviteToVault","IsApplicationUsingThirdPartyHost","IsReadonlyVaultMember","IsVaultAdmin","IsVaultOwner","ItemRelationshipDirection","ItemSignatureValidationResult","ItemsEncryptionService","KeyMode","KeySystemKeyManager","KeychainRecoveryStrings","LeaveVault","LegacyKeys1_0_0","LocalPrefKey","MobileUnlockTiming","MoveItemsToVault","NonwrappedStorageKey","NotificationService","NotificationServiceEvent","NotifyVaultUsersOfKeyRotation","OUTDATED_PROTOCOL_ALERT_IGNORE","PreferencesServiceEvent","ProcessAcceptedVaultInvite","ProtectionEvent","ProtocolUpgradeStrings","REMOVING_PASSCODE","RawStorageKey","ReencryptTypeAItems","RegisterStrings","RemoveItemFromVault","RemoveItemsFromMemory","RemoveVaultMember","ReplaceContactData","ResendAllMessages","ResendMessage","ReuploadAllInvites","ReuploadInvite","ReuploadVaultInvites","RevisionManager","RootKeyManager","RotateVaultKey","SETTING_PASSCODE","SelfContactManager","SendMessage","SendOwnContactChangeMessage","SendVaultDataChangedMessage","SendVaultInvite","SendVaultKeyChangedMessage","ServerErrorStrings","SessionEvent","SessionStrings","SetHost","ShareContactWithVault","SharedVaultService","SharedVaultServiceEvent","SignInStrings","StaticItemCounter","StatusService","StatusServiceEvent","StorageKey","StoragePersistencePolicies","StorageValueModes","StrictSignInFailed","SubscriptionManager","SubscriptionManagerEvent","SyncBackoffService","SyncEvent","SyncLocalVaultsWithRemoteSharedVaults","SyncMode","SyncOpStatus","SyncQueueStrategy","SyncSource","TextBackupsDirectoryName","UNKNOWN_ERROR","UNSUPPORTED_KEY_DERIVATION","UNSUPPORTED_PROTOCOL_VERSION","UPGRADING_ENCRYPTION","UserService","ValidateItemSigner","ValidateVaultPassword","ValueModesKeys","VaultInviteService","VaultInviteServiceEvent","VaultLockService","VaultLockServiceEvent","VaultService","VaultServiceEvent","VaultUserCache","VaultUserService","VaultUserServiceEvent","WebAppEvent","WebSocketsService","WebSocketsServiceEvent","isChunkFullEntry","isComponentViewerItemReadonlyItem","isDesktopDevice","isFullEntryLoadChunkResponse","isMobileDevice","namespacedKey"].indexOf(e)<0&&(f[e]=()=>C[e]);n.d(r,f)})(),r})(),e.exports=t()},54569:(e,t,n)=>{"use strict";n.d(t,{Ix:()=>S,pC:()=>y,fz:()=>m,Xd:()=>g,es:()=>p});var r=n(52322),i=n(2784);let o=[],s=0,a=[];let l=Symbol(),c=Symbol(),u=0,d=(e,t,n)=>(...r)=>((e,t,n,r)=>{let i,o,d=++u,h={...e};h.set=(...n)=>{e[l]=t,e[c]=d,e.set(...n),delete e[l],delete e[c]},e.setKey&&(h.setKey=(...n)=>{e[l]=t,e[c]=d,e.setKey(...n),delete e[l],delete e[c]}),e.action&&([i,o]=e.action(d,t,r));let p=n(h,...r);if(p instanceof Promise){let e=(s+=1,()=>{if(s-=1,0===s){let e=a;a=[];for(let t of e)t()}});return p.catch((e=>{throw i&&i(e),e})).finally((()=>{e(),o&&o()}))}return o&&o(),p})(e,t,n,r);const h=((e,t)=>{let n=[],r={get:()=>(r.lc||r.listen((()=>{}))(),r.value),l:0,lc:0,listen:(e,t)=>(r.lc=n.push(e,t||r.l)/2,()=>{let t=n.indexOf(e);~t&&(n.splice(t,2),r.lc--,r.lc||r.off())}),notify(e){let t=!o.length;for(let t=0;t<n.length;t+=2)o.push(n[t],r.value,e,n[t+1]);if(t){for(let e=0;e<o.length;e+=4){let t=!1;for(let n=e+7;n<o.length;n+=4)if(o[n]<o[e+3]){t=!0;break}t?o.push(o[e],o[e+1],o[e+2],o[e+3]):o[e](o[e+1],o[e+2])}o.length=0}},off(){},set(e){r.value!==e&&(r.value=e,r.notify())},subscribe(e,t){let n=r.listen(e,t);return e(r.value),n},value:[]};return r})(),p=d(h,"updateToast",((e,t,n)=>{const r=e.get();e.set(r.map((e=>e.id===t?{...e,...n}:e)))})),f=d(h,"removeToast",((e,t)=>{const n=e.get();e.set(n.filter((e=>e.id!==t)))})),g=d(h,"dismissToast",((e,t)=>{const n=e.get();e.set(n.map((e=>e.id===t?{...e,dismissed:!0}:e))),setTimeout((()=>{f(t)}),175)})),m=d(h,"addToast",((e,t)=>{var n;const r=e.get(),i=r.findIndex((e=>e.id===t.id))>-1,o=t.id&&!i?t.id:((e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce(((e,t)=>e+((t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_")),""))();i&&console.warn(`Generated new ID for toast instead of overriding toast of ID "${t.id}".\nIf you want to update an existing toast, use the \`updateToast()\` function instead.`);const s={...t,id:o,dismissed:!1,pauseOnWindowBlur:null===(n=t.pauseOnWindowBlur)||void 0===n||n};return e.set([...r,s]),o}));var y,v=n(2577);!function(e){e.Regular="regular",e.Success="success",e.Error="error",e.Loading="loading",e.Progress="progress"}(y||(y={}));const A=e=>{switch(e){case y.Success:return"bg-success text-info-contrast md:text-success";case y.Error:return"bg-danger text-info-contrast md:text-danger";default:return"bg-info text-info-contrast md:text-info"}},b=(0,i.forwardRef)((({toast:e,index:t},n)=>{var o;const s=(e=>{switch(e){case y.Success:return(0,r.jsx)(v.CheckCircleFilledIcon,{className:"text-success h-5 w-5"});case y.Error:return(0,r.jsx)(v.ClearCircleFilledIcon,{className:"text-danger h-5 w-5"});case y.Progress:case y.Loading:return(0,r.jsx)("div",{className:"border-info h-4 w-4 animate-spin rounded-full border border-solid border-r-transparent"});default:return(0,r.jsx)(v.InfoIcon,{className:"fill-text h-5 w-5"})}})(e.type),a=e.actions&&e.actions.length>0,l=e.type===y.Progress&&void 0!==e.progress&&e.progress>-1,c=matchMedia("(prefers-reduced-motion: reduce)").matches,u=c?"fade-in-animation":"slide-in-right-animation",d=c?"fade-out-animation":"slide-out-left-animation",h=e.dismissed?d:u;return(0,i.useEffect)((()=>{if(!n)return;const t=n.current;if(t&&e.dismissed){const{scrollHeight:e,style:n}=t;requestAnimationFrame((()=>{n.minHeight="initial",n.height=e+"px",n.transition="all 200ms",requestAnimationFrame((()=>{n.height="0",n.padding="0",n.margin="0"}))}))}}),[n,e.dismissed]),(0,r.jsxs)("div",{"data-index":t,role:"status",className:`bg-passive-5 animation-fill-forwards relative mt-3 flex min-w-full select-none flex-col rounded opacity-0 md:min-w-max ${h}`,style:{boxShadow:"0px 4px 12px rgba(0, 0, 0, 0.16)",transition:c?void 0:"all 0.2s ease",animationDelay:e.dismissed?void 0:"50ms"},onClick:()=>{e.type!==y.Loading&&e.type!==y.Progress&&g(e.id)},ref:n,children:[(0,r.jsxs)("div",{className:"grid gap-x-2.5 gap-y-1 overflow-hidden grid-cols-[min-content,auto] pl-3 pr-3.5 py-2.5",children:[s?(0,r.jsx)("div",{className:"sn-icon flex items-center justify-center",children:s}):null,e.title&&(0,r.jsx)("div",{className:"text-text text-sm font-semibold col-start-2",children:e.title}),(0,r.jsx)("div",{className:"text-text text-sm [word-wrap:anywhere] col-start-2",children:e.message}),a&&(0,r.jsx)("div",{className:"col-start-2 -mx-1.5 -mb-0.5",children:null===(o=e.actions)||void 0===o?void 0:o.map(((t,n)=>(0,r.jsx)("button",{className:`hover:bg-passive-3 cursor-pointer rounded border-0 px-[0.45rem] py-1 text-sm font-semibold md:bg-transparent ${A(e.type)} ${0!==n?"ml-2":""}`,onClick:n=>{n.preventDefault(),n.stopPropagation(),t.handler(e.id)},children:t.label},n)))})]}),l&&(0,r.jsx)("div",{className:"bg-default w-full overflow-hidden rounded rounded-tl-none rounded-tr-none",children:(0,r.jsx)("div",{className:"bg-info h-2 rounded rounded-tl-none transition-[width] duration-100",role:"progressbar",style:{width:`${e.progress}%`,...100===e.progress?{borderTopRightRadius:0}:{}},"aria-valuenow":e.progress})})]})})),w=({toast:e,index:t})=>{var n,o,s;const a=(0,i.useRef)(null),l=(0,i.useRef)(),c=Boolean(null===(n=e.actions)||void 0===n?void 0:n.length),u=null!==(o=e.autoClose)&&void 0!==o?o:((e,t)=>!e&&![y.Loading,y.Progress].includes(t))(c,e.type),d=null!==(s=e.duration)&&void 0!==s?s:e.type===y.Error?8e3:4e3,h=(0,i.useRef)(d),p=(0,i.useRef)(d),f=(0,i.useCallback)((()=>{u&&g(e.id)}),[u,e.id]),m=(0,i.useCallback)((()=>{l.current&&clearTimeout(l.current)}),[]),v=(0,i.useCallback)((()=>{m(),p.current-=Date.now()-h.current}),[m]),A=(0,i.useCallback)((()=>{h.current=Date.now(),m(),l.current=window.setTimeout(f,p.current)}),[m,f]),w=(0,i.useCallback)((()=>{v()}),[v]),S=(0,i.useCallback)((()=>{A()}),[A]),C=(0,i.useCallback)((()=>{A()}),[A]),E=(0,i.useCallback)((()=>{v()}),[v]);return(0,i.useEffect)((()=>{m(),u&&A();const t=a.current;return t&&(t.addEventListener("mouseenter",w),t.addEventListener("mouseleave",S)),e.pauseOnWindowBlur&&(window.addEventListener("focus",C),window.addEventListener("blur",E)),()=>{m(),t&&(t.removeEventListener("mouseenter",w),t.removeEventListener("mouseleave",S)),e.pauseOnWindowBlur&&(window.removeEventListener("focus",C),window.removeEventListener("blur",E))}}),[m,f,d,w,S,E,C,A,u,e.id]),(0,r.jsx)(b,{toast:e,index:t,ref:a})},S=()=>{const e=function(e,t={}){let n=(0,i.useCallback)((n=>t.keys?function(e,t,n){let r=new Set([...t,void 0]);return e.listen(((e,t)=>{r.has(t)&&n(e,t)}))}(e,t.keys,n):e.listen(n)),[t.keys,e]),r=e.get.bind(e);return(0,i.useSyncExternalStore)(n,r,r)}(h);return e.length?(0,r.jsx)("div",{className:"z-toast fixed bottom-6 right-6 flex w-[calc(100%-3rem)] flex-col items-end md:w-auto",children:e.map(((e,t)=>(0,r.jsx)(w,{toast:e,index:t},e.id)))}):null}},84075:(e,t,n)=>{"use strict";n.d(t,{jB:()=>u,BD:()=>Ae,ZC:()=>k,AX:()=>F,Wu:()=>X,kS:()=>I,PV:()=>L,BQ:()=>f,jd:()=>N,qC:()=>R,os:()=>Ne,$e:()=>Be,q_:()=>ct,P$:()=>Ee,hJ:()=>Pe,WY:()=>ke,Ab:()=>Ie,u8:()=>ee,i8:()=>ne,QE:()=>_,Ek:()=>Q,QD:()=>J,Ib:()=>K,um:()=>x,UK:()=>Le,zo:()=>Ce,YX:()=>te,mc:()=>ue,MZ:()=>de,Yt:()=>le,RL:()=>P,hh:()=>B,Ur:()=>O,Ak:()=>V,yc:()=>Z,fq:()=>W,zI:()=>Y,p6:()=>z,YN:()=>q,Ix:()=>H,Qx:()=>G,Qt:()=>be,gE:()=>D,Xc:()=>M,yX:()=>T,ZL:()=>$,p7:()=>C,Jr:()=>E,Ve:()=>Re,kl:()=>Ue,r9:()=>ht,FJ:()=>ut,GW:()=>l,Ne:()=>s,VG:()=>o,dP:()=>b,Dt:()=>xe,gn:()=>_e,ae:()=>v,an:()=>A,zr:()=>re,Mn:()=>ie,Ld:()=>oe,tO:()=>we});var r=n(87901);class i{constructor({title:e,text:t,buttons:n}){this.title=e,this.text=t,this.buttons=n||[]}buttonsString(){return`\n      <div class='flex items-center justify-end gap-2 w-full'>\n        ${this.buttons.map((function(e,t){return function(e,t){return`\n        <button id='button-${t}' class='font-bold px-4 py-1.5 rounded text-base lg:text-sm ${e.primary?"no-border ":"border-solid border-border border "} ${e.primary?"hover:brightness-125 focus:outline-none focus:brightness-125 ":"focus:bg-contrast focus:outline-none hover:bg-contrast "} ${e.primary?(e=>{switch(e){case"default":return"bg-default text-foreground";case"contrast":return"bg-contrast text-text";case"neutral":return"bg-neutral text-neutral-contrast";case"info":return"bg-info text-info-contrast";case"warning":return"bg-warning text-warning-contrast";case"danger":return"bg-danger text-danger-contrast";case"success":return"bg-success text-success-contrast"}})(e.style):(e=>{switch(e){case"default":return"bg-default text-text";case"contrast":return"bg-default text-contrast";case"neutral":return"bg-default text-neutral";case"info":return"bg-default text-info";case"warning":return"bg-default text-warning";case"danger":return"bg-default text-danger";case"success":return"bg-default text-success"}})(e.style)}'>\n          <div class='sk-label'>${e.text}</div>\n        </button>\n      `}(e,t)})).join("")}\n      </div>\n    `}templateString(){let e,t;return this.buttons?(e=`\n        <div class="sk-panel-row" style='margin-top: 8px;'>\n          ${this.buttonsString()}\n        </div>\n      `,t=""):(e="",t='style="padding-bottom: 8px"'),`\n      <div class="sk-modal">\n        <div class="sk-modal-background"></div>\n        <div class="sk-modal-content">\n          <div class="sn-component">\n            <div class="sk-panel" style='max-width: min(95vw, 500px);'>\n              <div class="sk-panel-content" ${t}>\n                <div class="sk-panel-section">\n                  ${this.title?`<div class='mb-1 font-bold text-lg flex items-center justify-between'>\n          ${this.title}\n          <button id="close-button" class="rounded p-1 font-bold hover:bg-contrast" onClick={closeDialog}>\n            <svg class="w-5 h-5 fill-current" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.2459 5.92925C15.5704 5.60478 15.5704 5.07872 15.2459 4.75425C14.9214 4.42978 14.3954 4.42978 14.0709 4.75425L10.0001 8.82508L5.92925 4.75425C5.60478 4.42978 5.07872 4.42978 4.75425 4.75425C4.42978 5.07872 4.42978 5.60478 4.75425 5.92925L8.82508 10.0001L4.75425 14.0709C4.42978 14.3954 4.42978 14.9214 4.75425 15.2459C5.07872 15.5704 5.60478 15.5704 5.92925 15.2459L10.0001 11.1751L14.0709 15.2459C14.3954 15.5704 14.9214 15.5704 15.2459 15.2459C15.5704 14.9214 15.5704 14.3954 15.2459 14.0709L11.1751 10.0001L15.2459 5.92925Z" /></svg>\n          </button>\n         </div>`:""}\n\n                  <div class="sk-panel-row">\n                    ${this.text?`<p class='sk-p text-base lg:text-sm' style="max-width: 100%; overflow: hidden; text-overflow: ellipsis;">${this.text}</p>`:""}\n                  </div>\n\n                  ${e}\n                </div>\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n    `}dismiss(){this.onElement.removeChild(this.element)}primaryButton(){let e=this.buttons.find((e=>!0===e.primary));return e||(e=this.buttons[this.buttons.length-1]),e}present(e){e||(e=document.body),this.onElement=e,this.element=document.createElement("div"),this.element.className="sn-component",this.element.innerHTML=this.templateString().trim(),e.appendChild(this.element),this.buttons&&this.buttons.length&&this.buttons.forEach(((e,t)=>{const n=this.element.querySelector(`#button-${t}`);n.onclick=()=>{e.action&&e.action(),this.dismiss()},0===t&&n.focus()}));const t=this.element.querySelector("#close-button");t&&(t.onclick=()=>{this.dismiss()})}}function o({text:e,title:t,confirmButtonText:n="Confirm",cancelButtonText:o="Cancel",confirmButtonStyle:s="info"}){return new Promise((a=>{new i({title:t&&(0,r.sanitizeHtmlString)(t),text:(0,r.sanitizeHtmlString)(e),buttons:[{text:o,style:"default",action(){a(!1)}},{text:n,style:s,primary:!0,action(){a(!0)}}]}).present()}))}function s({title:e,text:t,closeButtonText:n="OK"}){return new Promise((o=>{new i({title:e&&(0,r.sanitizeHtmlString)(e),text:(0,r.sanitizeHtmlString)(t),buttons:[{text:n,style:"default",action:o}]}).present()}))}var a=n(32105);class l extends a.c9N{confirmV2(e){return o({text:e.text,title:e.title,confirmButtonText:e.confirmButtonText,cancelButtonText:e.cancelButtonText,confirmButtonStyle:e.confirmButtonType===a.L$3.Danger?"danger":"info"})}alertV2(e){return s({text:e.text,title:e.title,closeButtonText:e.closeButtonText})}alert(e,t,n){return s({text:e,title:t,closeButtonText:n})}confirm(e,t,n,r,i){return o({text:e,title:t,confirmButtonText:n,cancelButtonText:i,confirmButtonStyle:r===a.L$3.Danger?"danger":"info"})}blockingDialog(e,t){const n=new i({title:t&&(0,r.sanitizeHtmlString)(t),text:(0,r.sanitizeHtmlString)(e),buttons:[]});return n.present(),()=>{n.dismiss()}}}var c=n(82648);class u{constructor(e){this.application=e}async getMimeType(e){return(await n.e(612).then(n.bind(n,75612))).getMimeType(e)}async downloadBackup(e){const t=e?await this.application.createEncryptedBackupFile.execute():await this.application.createDecryptedBackupFile.execute();if(t.isFailed())return;const n=t.getValue(),r=new Blob([JSON.stringify(n,null,2)],{type:"text/json"});e?this.downloadData(r,`Standard Notes Encrypted Backup and Import File - ${this.formattedDateForExports()}.txt`):this.downloadZippedDecryptedItems(n).catch(console.error)}formattedDateForExports(){const e=(new Date).toString(),t=e.match(/^(.*?) \(/);return t&&t.length>=2?t[1]:e}async getZippedDecryptedItemsBlob(e){const t=await n.e(612).then(n.bind(n,75612)),i=new t.ZipWriter(new t.BlobWriter("application/zip")),o=e.items,s=new Blob([JSON.stringify(e,null,2)],{type:"text/plain"}),a=(0,r.createZippableFileName)("Standard Notes Backup and Import File");await i.add(a,new t.BlobReader(s));for(let e=0;e<o.length;e++){const n=o[e];let s,a;if(n.content_type===c.ContentType.TYPES.Note){const e=n;s=e.content.title,a=e.content.text}else s=n.content_type,a=JSON.stringify(n.content,null,2);s||(s="");const l=new Blob([a],{type:"text/plain"}),u=`Items/${(0,r.sanitizeFileName)(n.content_type)}/`+(0,r.createZippableFileName)(s,`-${n.uuid.split("-")[0]}`);await i.add(u,new t.BlobReader(l))}return await i.close()}async downloadZippedDecryptedItems(e){const t=await this.getZippedDecryptedItemsBlob(e);this.downloadData(t,`Standard Notes Backup - ${this.formattedDateForExports()}.zip`)}async zipData(e){const t=await n.e(612).then(n.bind(n,75612)),i=new t.ZipWriter(new t.BlobWriter("application/zip")),o={};for(let n=0;n<e.length;n++){const s=e[n],{name:a,ext:l}=(0,r.parseFileName)(s.name);o[s.name]=null==o[s.name]?0:o[s.name]+1;const c=o[s.name];await i.add((0,r.createZippableFileName)(a,c>0?` - ${c}`:"",l),new t.BlobReader(s.content))}return await i.close()}async downloadDataAsZip(e){const t=await this.zipData(e);this.downloadData(t,`Standard Notes Export - ${this.formattedDateForExports()}.zip`)}hrefForData(e){return this.textFile&&window.URL.revokeObjectURL(this.textFile),this.textFile=window.URL.createObjectURL(e),this.textFile}downloadData(e,t){const n=document.createElement("a");n.setAttribute("download",t),n.href="string"==typeof e?e:this.hrefForData(e),document.body.appendChild(n),n.click(),n.remove()}downloadEncryptedItem(e){this.downloadData(new Blob([JSON.stringify(e.payload.ejected())]),`${e.uuid}.txt`)}downloadEncryptedItems(e){const t=JSON.stringify(e.map((e=>e.payload.ejected())));this.downloadData(new Blob([t]),"errored-items.txt")}}var d=n(22325);const h={"3.107.0":"3.101.2","3.106.0":"3.101.1","3.105.0":"3.101.0","3.104.1":"3.100.18","3.104.0":"3.100.17","3.103.2":"3.100.16","3.103.1":"3.100.15","3.103.0":"3.100.14","3.102.0":"3.100.13","3.101.2":"3.100.12","3.101.1":"3.100.11","3.101.0":"3.100.10","3.100.8":"3.100.9","3.100.7":"3.100.8","3.100.6":"3.100.7","3.100.5":"3.100.6","3.100.4":"3.100.5","3.100.3":"3.100.4","3.100.2":"3.100.3","3.100.1":"3.100.2","3.100.0":"3.100.1","3.99.0":"3.100.0","3.98.2":"3.23.301","3.98.1":"3.23.300","3.98.0":"3.23.299","3.97.0":"3.23.298","3.96.1":"3.23.297","3.96.0":"3.23.296","3.95.1":"3.23.295","3.95.0":"3.23.294","3.94.2":"3.23.293","3.94.1":"3.23.292","3.94.0":"3.23.291","3.93.19":"3.23.290","3.93.18":"3.23.289","3.93.17":"3.23.288","3.93.16":"3.23.287","3.93.15":"3.23.286","3.93.14":"3.23.285","3.93.13":"3.23.284","3.93.12":"3.23.283","3.93.11":"3.23.282","3.93.10":"3.23.281","3.93.9":"3.23.280","3.93.8":"3.23.279","3.93.7":"3.23.278","3.93.6":"3.23.277","3.93.5":"3.23.276","3.93.4":"3.23.275","3.93.3":"3.23.274","3.93.2":"3.23.273","3.93.1":"3.23.272","3.93.0":"3.23.271","3.92.0":"3.23.270","3.91.1":"3.23.269","3.91.0":"3.23.268","3.90.11":"3.23.267","3.90.10":"3.23.266","3.90.9":"3.23.265","3.90.8":"3.23.264","3.90.7":"3.23.263","3.90.6":"3.23.262","3.90.5":"3.23.261","3.90.4":"3.23.260","3.90.3":"3.23.259","3.90.2":"3.23.258","3.90.1":"3.23.257","3.90.0":"3.23.256","3.89.0":"3.23.255","3.88.1":"3.23.254","3.88.0":"3.23.253","3.87.2":"3.23.252","3.87.1":"3.23.251","3.87.0":"3.23.250","3.86.0":"3.23.249","3.85.2":"3.23.248","3.85.1":"3.23.247","3.85.0":"3.23.246","3.84.7":"3.23.245","3.84.6":"3.23.244","3.84.5":"3.23.243","3.84.4":"3.23.242","3.84.3":"3.23.241","3.84.2":"3.23.240","3.84.1":"3.23.239","3.84.0":"3.23.238","3.83.0":"3.23.237","3.82.6":"3.23.236","3.82.5":"3.23.235","3.82.4":"3.23.234","3.82.3":"3.23.233","3.82.2":"3.23.232","3.82.1":"3.23.231","3.82.0":"3.23.230","3.81.0":"3.23.229","3.80.1":"3.23.228","3.80.0":"3.23.227","3.79.0":"3.23.226","3.78.1":"3.23.225","3.78.0":"3.23.224","3.77.1":"3.23.223","3.77.0":"3.23.222","3.76.2":"3.23.221","3.76.1":"3.23.220","3.76.0":"3.23.219","3.75.1":"3.23.218","3.75.0":"3.23.217","3.74.0":"3.23.216","3.73.0":"3.23.215","3.72.4":"3.23.214","3.72.3":"3.23.213","3.72.2":"3.23.212","3.72.1":"3.23.211","3.72.0":"3.23.210","3.71.8":"3.23.209","3.71.7":"3.23.208","3.71.6":"3.23.207","3.71.5":"3.23.206","3.71.4":"3.23.205","3.71.3":"3.23.204","3.71.2":"3.23.203","3.71.1":"3.23.202","3.71.0":"3.23.201","3.70.5":"3.23.200","3.70.4":"3.23.199","3.70.3":"3.23.198","3.70.2":"3.23.197","3.70.1":"3.23.196","3.70.0":"3.23.195","3.69.1":"3.23.194","3.69.0":"3.23.193","3.68.6":"3.23.192","3.68.5":"3.23.191","3.68.4":"3.23.190","3.68.3":"3.23.189","3.68.2":"3.23.188","3.68.1":"3.23.187","3.68.0":"3.23.186","3.67.4":"3.23.185","3.67.3":"3.23.184","3.67.2":"3.23.183","3.67.1":"3.23.182","3.67.0":"3.23.181","3.66.0":"3.23.180","3.65.0":"3.23.179","3.64.0":"3.23.178","3.63.3":"3.23.177","3.63.2":"3.23.176","3.63.1":"3.23.175","3.63.0":"3.23.174","3.62.4":"3.23.173","3.62.3":"3.23.172","3.62.2":"3.23.171","3.62.1":"3.23.170","3.62.0":"3.23.169","3.61.0":"3.23.168","3.60.0":"3.23.167","3.59.3":"3.23.166","3.59.2":"3.23.165","3.59.1":"3.23.164","3.59.0":"3.23.163","3.58.1":"3.23.162","3.58.0":"3.23.161","3.57.3":"3.23.160","3.57.2":"3.23.159","3.57.1":"3.23.158","3.57.0":"3.23.157","3.56.0":"3.23.156","3.55.2":"3.23.155","3.55.1":"3.23.154","3.55.0":"3.23.153","3.54.6":"3.23.152","3.54.5":"3.23.151","3.54.4":"3.23.150","3.54.3":"3.23.149","3.54.2":"3.23.148","3.54.1":"3.23.147","3.54.0":"3.23.146","3.53.0":"3.23.145","3.52.1":"3.23.144","3.52.0":"3.23.143","3.51.0":"3.23.142","3.50.6":"3.23.141","3.50.5":"3.23.140","3.50.4":"3.23.139","3.50.3":"3.23.138","3.50.2":"3.23.137","3.50.1":"3.23.136","3.50.0":"3.23.135","3.49.3":"3.23.134","3.49.2":"3.23.133","3.49.1":"3.23.132","3.49.0":"3.23.131","3.48.3":"3.23.130","3.48.2":"3.23.129","3.48.1":"3.23.128","3.48.0":"3.23.127","3.47.3":"3.23.126","3.47.2":"3.23.125","3.47.1":"3.23.124","3.47.0":"3.23.123","3.46.3":"3.23.122","3.46.2":"3.23.121","3.46.1":"3.23.120","3.46.0":"3.23.119","3.45.18":"3.23.118","3.45.17":"3.23.117","3.45.16":"3.23.116","3.45.15":"3.23.115","3.45.14":"3.23.114","3.45.13":"3.23.113","3.45.12":"3.23.112","3.45.11":"3.23.111","3.45.10":"3.23.110","3.45.9":"3.23.109","3.45.8":"3.23.108","3.45.7":"3.23.107","3.45.6":"3.23.106","3.45.5":"3.23.105","3.45.4":"3.23.104","3.45.3":"3.23.103","3.45.2":"3.23.102","3.45.1":"3.23.101","3.45.0":"3.23.100","3.44.7":"3.23.99","3.44.6":"3.23.98","3.44.5":"3.23.97","3.44.4":"3.23.96","3.44.3":"3.23.95","3.44.2":"3.23.94","3.44.1":"3.23.93","3.44.0":"3.23.92","3.43.1":"3.23.91","3.43.0":"3.23.90","3.42.1":"3.23.89","3.42.0":"3.23.88","3.41.3":"3.23.87","3.41.2":"3.23.86","3.41.1":"3.23.85","3.41.0":"3.23.84","3.40.7":"3.23.83","3.40.6":"3.23.82","3.40.5":"3.23.81","3.40.4":"3.23.80","3.40.3":"3.23.79","3.40.2":"3.23.78","3.40.1":"3.23.77","3.40.0":"3.23.76","3.39.1":"3.23.75","3.39.0":"3.23.74","3.38.6":"3.23.73","3.38.5":"3.23.72","3.38.4":"3.23.71","3.38.3":"3.23.70","3.38.2":"3.23.69","3.38.1":"3.23.68","3.38.0":"3.23.67","3.37.7":"3.23.66","3.37.6":"3.23.65","3.37.5":"3.23.64","3.37.4":"3.23.63","3.37.3":"3.23.62","3.37.2":"3.23.61","3.37.1":"3.23.60","3.37.0":"3.23.59","3.36.0":"3.23.58","3.35.2":"3.23.57","3.35.1":"3.23.56","3.35.0":"3.23.55","3.34.0":"3.23.54","3.33.8":"3.23.53","3.33.7":"3.23.52","3.33.6":"3.23.51","3.33.5":"3.23.50","3.33.4":"3.23.49","3.33.3":"3.23.48","3.33.2":"3.23.47","3.33.1":"3.23.46","3.33.0":"3.23.45","3.32.0":"3.23.44","3.31.1":"3.23.43","3.31.0":"3.23.42","3.30.0":"3.23.41","3.29.2":"3.23.40","3.29.1":"3.23.39","3.29.0":"3.23.38","3.28.1":"3.23.37","3.28.0":"3.23.36","3.27.7":"3.23.35","3.27.6":"3.23.34","3.27.5":"3.23.33","3.27.4":"3.23.32","3.27.3":"3.23.31","3.27.2":"3.23.30","3.27.1":"3.23.29","3.27.0":"3.23.28","3.26.4":"3.23.27","3.26.3":"3.23.26","3.26.2":"3.23.25","3.26.1":"3.23.24","3.26.0":"3.23.23","3.25.0":"3.23.22","3.24.6":"3.23.21","3.24.5":"3.23.20","3.24.4":"3.23.19","3.24.3":"3.23.18","3.24.3-alpha.1":"3.23.17","3.24.3-alpha.0":"3.23.16","3.24.2":"3.23.15","3.24.2-alpha.1":"3.23.14","3.24.2-alpha.0":"3.23.13","3.24.1":"3.23.12","3.24.1-alpha.0":"3.23.11","3.24.0":"3.23.10","3.24.0-alpha.7":"3.23.9","3.24.0-alpha.6":"3.23.8","3.24.0-alpha.5":"3.23.7","3.24.0-alpha.4":"3.23.6","3.24.0-alpha.3":"3.23.5","3.24.0-alpha.2":"3.23.4","3.24.0-alpha.1":"3.23.3","3.24.0-alpha.0":"3.23.2","3.23.0":"3.23.1","3.23.0-alpha.1":"3.23.0","3.23.0-alpha.0":"3.22.21","3.22.7-alpha.0":"3.22.20","3.22.6":"3.22.19","3.22.6-alpha.0":"3.22.18","3.22.5":"3.22.17","3.22.4":"3.22.13-alpha.9","3.22.3":"3.22.13-alpha.8","3.22.3-alpha.9":"3.22.16-alpha.1","3.22.3-alpha.8":"3.22.16-alpha.0","3.22.3-alpha.7":"3.22.15","3.22.3-alpha.6":"3.22.15-alpha.3","3.22.3-alpha.5":"3.22.15-alpha.2","3.22.3-alpha.4":"3.22.15-alpha.1","3.22.3-alpha.3":"3.22.15-alpha.0","3.22.3-alpha.2":"3.22.14","3.22.3-alpha.1":"3.22.14-alpha.0","3.22.3-alpha.0":"3.22.13","3.22.2":"3.22.13-alpha.10","3.22.1":"3.22.13-alpha.7","3.22.0":"3.22.13-alpha.6","3.21.0":"3.22.13-alpha.5"},p={"3.107.0":"3.46.31","3.106.0":"3.46.30","3.105.0":"3.46.29","3.104.1":"3.46.28","3.104.0":"3.46.27","3.103.2":"3.46.26","3.103.1":"3.46.25","3.103.0":"3.46.24","3.102.0":"3.46.23","3.101.2":"3.46.22","3.101.1":"3.46.21","3.101.0":"3.46.20","3.100.8":"3.46.19","3.100.7":"3.46.18","3.100.6":"3.46.17","3.100.5":"3.46.16","3.100.4":"3.46.15","3.100.3":"3.46.14","3.100.2":"3.46.13","3.100.1":"3.46.12","3.100.0":"3.46.11","3.99.0":"3.46.10","3.98.2":"3.46.9","3.98.1":"3.46.8","3.98.0":"3.46.7","3.97.0":"3.46.6","3.96.1":"3.46.5","3.96.0":"3.46.4","3.95.1":"3.46.3","3.95.0":"3.46.2","3.94.2":"3.46.1","3.94.1":"3.46.0","3.94.0":"3.45.42","3.93.19":"3.45.41","3.93.18":"3.45.40","3.93.17":"3.45.39","3.93.16":"3.45.38","3.93.15":"3.45.37","3.93.14":"3.45.36","3.93.13":"3.45.35","3.93.12":"3.45.34","3.93.11":"3.45.33","3.93.10":"3.45.32","3.93.9":"3.45.31","3.93.8":"3.45.30","3.93.7":"3.45.29","3.93.6":"3.45.28","3.93.5":"3.45.27","3.93.4":"3.45.26","3.93.3":"3.45.25","3.93.2":"3.45.24","3.93.1":"3.45.23","3.93.0":"3.45.22","3.92.0":"3.45.21","3.91.1":"3.45.20","3.91.0":"3.45.19","3.90.11":"3.45.18","3.90.10":"3.45.17","3.90.9":"3.45.16","3.90.8":"3.45.15","3.90.7":"3.45.14","3.90.6":"3.45.13","3.90.5":"3.45.12","3.90.4":"3.45.11","3.90.3":"3.45.10","3.90.2":"3.45.9","3.90.1":"3.45.8","3.90.0":"3.45.7","3.89.0":"3.45.6","3.88.1":"3.45.5","3.88.0":"3.45.4","3.87.2":"3.45.3","3.87.1":"3.45.2","3.87.0":"3.45.1","3.86.0":"3.45.0","3.85.2":"3.44.5","3.85.1":"3.44.4","3.85.0":"3.44.3","3.84.7":"3.44.2","3.84.6":"3.44.1","3.84.5":"3.44.0","3.84.4":"3.43.33","3.84.3":"3.43.32","3.84.2":"3.43.31","3.84.1":"3.43.30","3.84.0":"3.43.29","3.83.0":"3.43.28","3.82.6":"3.43.27","3.82.5":"3.43.26","3.82.4":"3.43.25","3.82.3":"3.43.24","3.82.2":"3.43.23","3.82.1":"3.43.22","3.82.0":"3.43.21","3.81.0":"3.43.20","3.80.1":"3.43.19","3.80.0":"3.43.18","3.79.0":"3.43.17","3.78.1":"3.43.16","3.78.0":"3.43.15","3.77.1":"3.43.14","3.77.0":"3.43.13","3.76.2":"3.43.12","3.76.1":"3.43.11","3.76.0":"3.43.10","3.75.1":"3.43.9","3.75.0":"3.43.8","3.74.0":"3.43.7","3.73.0":"3.43.6","3.72.4":"3.43.5","3.72.3":"3.43.4","3.72.2":"3.43.3","3.72.1":"3.43.2","3.72.0":"3.43.1","3.71.8":"3.43.0","3.71.7":"3.42.5","3.71.6":"3.42.4","3.71.5":"3.42.3","3.71.4":"3.42.2","3.71.3":"3.42.1","3.71.2":"3.42.0","3.71.1":"3.41.10","3.71.0":"3.41.9","3.70.5":"3.41.8","3.70.4":"3.41.7","3.70.3":"3.41.6","3.70.2":"3.41.5","3.70.1":"3.41.4","3.70.0":"3.41.3","3.69.1":"3.41.2","3.69.0":"3.41.1","3.68.6":"3.41.0","3.68.5":"3.40.2","3.68.4":"3.40.1","3.68.3":"3.40.0","3.68.2":"3.39.12","3.68.1":"3.39.11","3.68.0":"3.39.10","3.67.4":"3.39.9","3.67.3":"3.39.8","3.67.2":"3.39.7","3.67.1":"3.39.6","3.67.0":"3.39.5","3.66.0":"3.39.4","3.65.0":"3.39.3","3.64.0":"3.39.2","3.63.3":"3.39.1","3.63.2":"3.39.0","3.63.1":"3.38.1","3.63.0":"3.38.0","3.62.4":"3.37.14","3.62.3":"3.37.13","3.62.2":"3.37.12","3.62.1":"3.37.11","3.62.0":"3.37.10","3.61.0":"3.37.9","3.60.0":"3.37.8","3.59.3":"3.37.7","3.59.2":"3.37.6","3.59.1":"3.37.5","3.59.0":"3.37.4","3.58.1":"3.37.3","3.58.0":"3.37.2","3.57.3":"3.37.1","3.57.2":"3.37.0","3.57.1":"3.36.18","3.57.0":"3.36.17","3.56.0":"3.36.16","3.55.2":"3.36.15","3.55.1":"3.36.14","3.55.0":"3.36.13","3.54.6":"3.36.12","3.54.5":"3.36.11","3.54.4":"3.36.10","3.54.3":"3.36.9","3.54.2":"3.36.8","3.54.1":"3.36.7","3.54.0":"3.36.6","3.53.0":"3.36.5","3.52.1":"3.36.4","3.52.0":"3.36.3","3.51.0":"3.36.2","3.50.6":"3.36.1","3.50.5":"3.36.0","3.50.4":"3.35.16","3.50.3":"3.35.15","3.50.2":"3.35.14","3.50.1":"3.35.13","3.50.0":"3.35.12","3.49.3":"3.35.11","3.49.2":"3.35.10","3.49.1":"3.35.9","3.49.0":"3.35.8","3.48.3":"3.35.7","3.48.2":"3.35.6","3.48.1":"3.35.5","3.48.0":"3.35.4","3.47.3":"3.35.3","3.47.2":"3.35.2","3.47.1":"3.35.1","3.47.0":"3.35.0","3.46.3":"3.34.3","3.46.2":"3.34.2","3.46.1":"3.34.1","3.46.0":"3.34.0","3.45.18":"3.33.7","3.45.17":"3.33.6","3.45.16":"3.33.5","3.45.15":"3.33.4","3.45.14":"3.33.3","3.45.13":"3.33.2","3.45.12":"3.33.1","3.45.11":"3.33.0","3.45.10":"3.32.5","3.45.9":"3.32.4","3.45.8":"3.32.3","3.45.7":"3.32.2","3.45.6":"3.32.1","3.45.5":"3.32.0","3.45.4":"3.31.29","3.45.3":"3.31.28","3.45.2":"3.31.27","3.45.1":"3.31.26","3.45.0":"3.31.25","3.44.7":"3.31.24","3.44.6":"3.31.23","3.44.5":"3.31.22","3.44.4":"3.31.21","3.44.3":"3.31.20","3.44.2":"3.31.19","3.44.1":"3.31.18","3.44.0":"3.31.17","3.43.1":"3.31.16","3.43.0":"3.31.15","3.42.1":"3.31.14","3.42.0":"3.31.13","3.41.3":"3.31.12","3.41.2":"3.31.11","3.41.1":"3.31.10","3.41.0":"3.31.9","3.40.7":"3.31.8","3.40.6":"3.31.7","3.40.5":"3.31.6","3.40.4":"3.31.5","3.40.3":"3.31.4","3.40.2":"3.31.3","3.40.1":"3.31.2","3.40.0":"3.31.1","3.39.1":"3.31.0","3.39.0":"3.30.38","3.38.6":"3.30.37","3.38.5":"3.30.36","3.38.4":"3.30.35","3.38.3":"3.30.34","3.38.2":"3.30.33","3.38.1":"3.30.32","3.38.0":"3.30.31","3.37.7":"3.30.30","3.37.6":"3.30.29","3.37.5":"3.30.28","3.37.4":"3.30.27","3.37.3":"3.30.26","3.37.2":"3.30.25","3.37.1":"3.30.24","3.37.0":"3.30.23","3.36.0":"3.30.22","3.35.2":"3.30.21","3.35.1":"3.30.20","3.35.0":"3.30.19","3.34.0":"3.30.18","3.33.8":"3.30.17","3.33.7":"3.30.16","3.33.6":"3.30.15","3.33.5":"3.30.14","3.33.4":"3.30.13","3.33.3":"3.30.12","3.33.2":"3.30.11","3.33.1":"3.30.10","3.33.0":"3.30.9","3.32.0":"3.30.8","3.31.1":"3.30.7","3.31.0":"3.30.6","3.30.0":"3.30.5","3.29.2":"3.30.4","3.29.1":"3.30.3","3.29.0":"3.30.2","3.28.1":"3.30.1","3.28.0":"3.30.0","3.27.7":"3.29.0","3.27.6":"3.28.3","3.27.5":"3.28.2","3.27.4":"3.28.1","3.27.3":"3.28.0","3.27.2":"3.27.13","3.27.1":"3.27.12","3.27.0":"3.27.11","3.26.4":"3.27.10","3.26.3":"3.27.9","3.26.2":"3.27.8","3.26.1":"3.27.7","3.26.0":"3.27.6","3.25.0":"3.27.5","3.24.6":"3.27.4","3.24.5":"3.27.3","3.24.4":"3.27.2","3.24.3":"3.27.1","3.24.3-alpha.1":"3.27.0","3.24.3-alpha.0":"3.26.14","3.24.2":"3.26.13","3.24.2-alpha.1":"3.26.12","3.24.2-alpha.0":"3.26.11","3.24.1":"3.26.10","3.24.1-alpha.0":"3.26.9","3.24.0":"3.26.8","3.24.0-alpha.7":"3.26.7","3.24.0-alpha.6":"3.26.6","3.24.0-alpha.5":"3.26.5","3.24.0-alpha.4":"3.26.4","3.24.0-alpha.3":"3.26.3","3.24.0-alpha.2":"3.26.2","3.24.0-alpha.1":"3.26.1","3.24.0-alpha.0":"3.26.0","3.23.0":"3.25.15","3.23.0-alpha.1":"3.25.14","3.23.0-alpha.0":"3.25.13","3.22.7-alpha.0":"3.25.12","3.22.6":"3.25.11","3.22.6-alpha.0":"3.25.10","3.22.5":"3.25.9","3.22.4":"3.24.4","3.22.3":"3.24.3","3.22.3-alpha.9":"3.25.6","3.22.3-alpha.8":"3.25.5","3.22.3-alpha.7":"3.25.4","3.22.3-alpha.6":"3.25.3","3.22.3-alpha.5":"3.25.2","3.22.3-alpha.4":"3.25.1","3.22.3-alpha.3":"3.25.0","3.22.3-alpha.2":"3.24.8","3.22.3-alpha.1":"3.24.7","3.22.3-alpha.0":"3.24.6","3.22.2":"3.24.5","3.22.1":"3.24.2","3.22.0":"3.24.2-alpha.2","3.21.0":"3.24.2-alpha.1"};class f{constructor(e,t){this.environment=e,this.diskService=t,this.lastReadChangeListeners=[]}addLastReadChangeListener(e){return this.lastReadChangeListeners.push(e),()=>{this.lastReadChangeListeners=this.lastReadChangeListeners.filter((t=>t!==e))}}async performDownloadChangelog(){const e=await fetch("https://raw.githubusercontent.com/standardnotes/app/main/packages/web/CHANGELOG.md.json"),t=await e.text();return JSON.parse(t)}async getChangelog(){if(this.changeLog)return this.changeLog;if(this.changeLog=await this.performDownloadChangelog(),this.environment!==d.Environment.Web){const e=this.getLegacyMapping();this.changeLog.versions=this.changeLog.versions.map((t=>{const n=t.version||"";return{...t,version:e[n]||t.version}}))}return this.changeLog}markAsRead(){if(!this.changeLog)return;const e=this.changeLog.versions[0].version;this.diskService.setValue(a.QtK.LastReadChangelogVersion,e),e&&this.lastReadChangeListeners.forEach((t=>t(e)))}getLastReadVersion(){return this.diskService.getValue(a.QtK.LastReadChangelogVersion)}async getVersions(){return(await this.getChangelog()).versions}getLegacyMapping(){return this.environment===d.Environment.Desktop?h:this.environment===d.Environment.Mobile?p:{}}getDesktopDownloadsUrl(e){return"https://github.com/standardnotes/app/releases/tag/%40standardnotes%2Fdesktop%40"+e}getDesktopVersionForWebVersion(e){var t;return null!==(t=h[e])&&void 0!==t?t:e}}var g,m,y=n(29894);function v(e){return e===y.Platform.MacDesktop||e===y.Platform.MacWeb}function A(e){return e===y.Platform.Ios||e===y.Platform.Android}function b(e){return v(e)?g.Meta:g.Ctrl}function w(e,t){var n;const r=function(e){return Object.values(g).filter((t=>(e.ctrlKey||e.key===g.Ctrl)&&t===g.Ctrl||(e.metaKey||e.key===g.Meta)&&t===g.Meta||(e.altKey||e.key===g.Alt)&&t===g.Alt||(e.shiftKey||e.key===g.Shift)&&t===g.Shift))}(e),i=null!==(n=t.modifiers)&&void 0!==n?n:[];if(r.length!==i.length)return!1;for(const e of i)if(!r.includes(e))return!1;return!t.key&&!t.code||(t.key?t.key.toLowerCase()===e.key.toLowerCase():t.code===e.code)}function S(e){return Symbol(e)}!function(e){e.Shift="Shift",e.Ctrl="Control",e.Meta="Meta",e.Alt="Alt"}(g||(g={})),function(e){e.Down="KeyEventDown",e.Up="KeyEventUp"}(m||(m={}));const C=S("TOGGLE_LIST_PANE_KEYBOARD_COMMAND"),E=S("TOGGLE_NAVIGATION_PANE_KEYBOARD_COMMAND"),I=S("CREATE_NEW_NOTE_KEYBOARD_COMMAND"),_=S("NEXT_LIST_ITEM_KEYBOARD_COMMAND"),x=S("PREVIOUS_LIST_ITEM_KEYBOARD_COMMAND"),P=S("SEARCH_KEYBOARD_COMMAND"),k=S("CANCEL_SEARCH_COMMAND"),B=S("SELECT_ALL_ITEMS_KEYBOARD_COMMAND"),O=S("SHOW_HIDDEN_OPTIONS_KEYBOARD_COMMAND"),N=S("DELETE_NOTE_KEYBOARD_COMMAND"),D=S("PLAIN_EDITOR_INSERT_TAB_KEYBOARD_COMMAND"),j=S("ESCAPE_COMMAND"),T=S("TOGGLE_FOCUS_MODE_COMMAND"),M=S("TOGGLE_DARK_MODE_COMMAND"),F=S("CHANGE_EDITOR_COMMAND"),R=S("FOCUS_TAGS_INPUT_COMMAND"),L=S("CREATE_NEW_TAG_COMMAND"),Q=S("OPEN_NOTE_HISTORY_COMMAND"),U=S("CAPTURE_SAVE_COMMAND"),V=S("STAR_NOTE_COMMAND"),K=S("PIN_NOTE_COMMAND"),H=S("SUPER_TOGGLE_SEARCH"),G=S("SUPER_TOGGLE_TOOLBAR"),Y=S("SUPER_SEARCH_TOGGLE_CASE_SENSITIVE"),z=S("SUPER_SEARCH_TOGGLE_REPLACE_MODE"),Z=S("SUPER_SEARCH_NEXT_RESULT"),W=S("SUPER_SEARCH_PREVIOUS_RESULT"),q=S("SUPER_SHOW_MARKDOWN_PREVIEW"),J=(S("SUPER_EXPORT_JSON"),S("SUPER_EXPORT_MARKDOWN"),S("OPEN_PREFERENCES_COMMAND")),X=S("CHANGE_EDITOR_WIDTH_COMMAND"),$=S("TOGGLE_KEYBOARD_SHORTCUTS_MODAL");var ee,te;!function(e){e.Tab="Tab",e.Backspace="Backspace",e.Up="ArrowUp",e.Down="ArrowDown",e.Left="ArrowLeft",e.Right="ArrowRight",e.Enter="Enter",e.Escape="Escape",e.Home="Home",e.End="End",e.Space=" ",e.PageUp="PageUp",e.PageDown="PageDown"}(ee||(ee={}));class ne{constructor(e,t){this.platform=e,this.activeModifiers=new Set,this.commandHandlers=new Set,this.commandMap=new Map,this.keyboardShortcutHelpItems=new Set,this.addActiveModifier=e=>{if(e)switch(e){case g.Meta:this.isMac&&this.activeModifiers.add(e);break;case g.Ctrl:this.isMac||this.activeModifiers.add(e);break;default:this.activeModifiers.add(e)}},this.removeActiveModifier=e=>{e&&this.activeModifiers.delete(e)},this.cancelAllKeyboardModifiers=()=>{this.activeModifiers.clear()},this.handleComponentKeyDown=e=>{this.addActiveModifier(e)},this.handleComponentKeyUp=e=>{this.removeActiveModifier(e)},this.handleKeyDown=e=>{this.updateAllModifiersFromEvent(e),this.handleKeyboardEvent(e,m.Down)},this.handleKeyUp=e=>{this.updateAllModifiersFromEvent(e),this.handleKeyboardEvent(e,m.Up)},this.handleWindowBlur=()=>{for(const e of this.activeModifiers)this.activeModifiers.delete(e)},window.addEventListener("keydown",this.handleKeyDown),window.addEventListener("keyup",this.handleKeyUp),window.addEventListener("blur",this.handleWindowBlur);const n=function(e,t){const n=b(e);return[{command:C,key:"l",modifiers:[n,g.Shift]},{command:E,key:"e",modifiers:[n,g.Shift]},{command:I,code:"KeyN",modifiers:[g.Alt,g.Shift]},{command:_,key:ee.Down},{command:x,key:ee.Up},{command:P,code:"KeyF",modifiers:[g.Alt,g.Shift]},{command:k,key:ee.Escape},{command:B,key:"a",modifiers:[n]},{command:O,modifiers:[g.Alt]},{command:N,key:ee.Backspace,modifiers:[n]},{command:D,key:ee.Tab},{command:j,key:ee.Escape},{command:T,key:"f",modifiers:[n,g.Shift]},{command:M,key:"d",modifiers:[n,g.Shift],preventDefault:!0},{command:F,key:"/",modifiers:[n,g.Shift],preventDefault:!0},{command:R,code:"KeyT",modifiers:[n,g.Alt],preventDefault:!0},{command:L,code:"KeyN",modifiers:[n,g.Alt]},{command:Q,key:"h",modifiers:[n,g.Shift],preventDefault:!0},{command:U,key:"s",modifiers:[n],preventDefault:!0},{command:V,key:"s",modifiers:[n,g.Shift],preventDefault:!0},{command:K,key:"p",modifiers:[n,g.Shift],preventDefault:!0},{command:G,key:"k",modifiers:[n,g.Shift]},{command:H,key:"f",modifiers:[n]},{command:z,key:v(e)?void 0:"h",code:v(e)?"KeyF":void 0,modifiers:v(e)?[g.Alt,n]:[n]},{command:Y,key:"c",modifiers:[g.Alt]},{command:Z,key:"F3"},{command:W,key:"F3",modifiers:[g.Shift]},{command:q,key:"m",modifiers:[n,g.Shift],preventDefault:!0},{command:J,key:",",modifiers:[n],preventDefault:!0},{command:X,key:"j",modifiers:[n,g.Shift],preventDefault:!0},{command:$,key:"/",modifiers:[n]}]}(e);for(const e of n)this.registerShortcut(e)}get isMac(){return this.platform===y.Platform.MacDesktop||this.platform===y.Platform.MacWeb}deinit(){this.commandHandlers.clear(),window.removeEventListener("keydown",this.handleKeyDown),window.removeEventListener("keyup",this.handleKeyUp),window.removeEventListener("blur",this.handleWindowBlur),this.handleKeyDown=void 0,this.handleKeyUp=void 0,this.handleWindowBlur=void 0}updateAllModifiersFromEvent(e){for(const t of Object.values(g))e.getModifierState(t)?this.addActiveModifier(t):this.removeActiveModifier(t)}handleKeyboardEvent(e,t){for(const n of this.commandMap.keys()){const r=this.commandMap.get(n);r&&w(e,r)&&(r.preventDefault&&e.preventDefault(),this.handleCommand(n,e,t))}}handleCommand(e,t,n){const r=t.target;for(const i of Array.from(this.commandHandlers).reverse()){if(i.command!==e)continue;if(i.element&&t.target!==i.element)continue;if(i.elements&&!i.elements.includes(r))continue;if(i.notElement&&i.notElement===t.target)continue;if(i.notElementIds&&i.notElementIds.includes(r.id))continue;if(i.notTags&&i.notTags.includes(r.tagName))continue;const o=n===m.Down?i.onKeyDown:i.onKeyUp;if(o&&o(t))return}}triggerCommand(e,t){for(const n of Array.from(this.commandHandlers).reverse()){if(n.command!==e)continue;const r=n.onKeyDown||n.onKeyUp;if(r&&r(new KeyboardEvent("command-trigger"),t))return}}registerShortcut(e){this.commandMap.set(e.command,e)}addCommandHandler(e){this.commandHandlers.add(e);const t=this.getKeyboardShortcutHelpItemForHandler(e);if(t){const e=Array.from(this.keyboardShortcutHelpItems).find((e=>e.command===t.command));e&&this.keyboardShortcutHelpItems.delete(e),this.keyboardShortcutHelpItems.add(t)}return()=>{e.onKeyDown=void 0,e.onKeyDown=void 0,this.commandHandlers.delete(e),t&&this.keyboardShortcutHelpItems.delete(t)}}addCommandHandlers(e){const t=e.map((e=>this.addCommandHandler(e)));return()=>{for(const e of t)e()}}keyboardShortcutForCommand(e){const t=this.commandMap.get(e);if(t)return{platform:this.platform,...t}}getKeyboardShortcutHelpItemForHandler(e){const t=this.keyboardShortcutForCommand(e.command);if(t&&e.category&&e.description)return{...t,category:e.category,description:e.description}}registerExternalKeyboardShortcutHelpItem(e){return this.keyboardShortcutHelpItems.add(e),()=>{this.keyboardShortcutHelpItems.delete(e)}}registerExternalKeyboardShortcutHelpItems(e){const t=e.map((e=>this.registerExternalKeyboardShortcutHelpItem(e)));return()=>{for(const e of t)e()}}getRegisteredKeyboardShorcutHelpItems(){return Array.from(this.keyboardShortcutHelpItems)}}function re(e){if(e.startsWith("Digit"))return e.replace("Digit","");if(e.startsWith("Key"))return e.replace("Key","");switch(e){case"ArrowDown":return"↓";case"ArrowUp":return"↑";case"ArrowLeft":return"←";case"ArrowRight":return"→";default:return e}}function ie(e,t){const n=function(e){return e===y.Platform.MacDesktop||e===y.Platform.MacWeb}(t);return e===g.Meta?n?"⌘":"⊞":e===g.Ctrl?n?"⌃":"Ctrl":e===g.Alt?n?"⌥":"Alt":e===g.Shift?n?"⇧":"Shift":g[e]}function oe(e){var t;if(!e)return"";const n=(null===(t=e.key)||void 0===t?void 0:t.toUpperCase())||function(e=""){return e.replace("Key","").replace("Digit","")}(e.code);if(!e.modifiers||0===e.modifiers.length)return n;const r=e.modifiers.map((t=>ie(t,e.platform)));return v(e.platform)?`${r.join("")}${n}`:`${r.join("+")}+${n}`}!function(e){e.Purchase="purchase",e.Settings="settings",e.DemoToken="demo-token",e.AcceptSubscriptionInvite="accept-subscription-invite",e.UserRequest="user-request",e.AppViewRoute="route"}(te||(te={}));const se=["u2f","extension"];var ae,le,ce;!function(e){e.Onboarding="/onboard",e.None="/"}(ae||(ae={})),function(e){e.Onboarding="onboarding",e.Settings="settings",e.Purchase="purchase",e.AcceptSubscriptionInvite="accept-subscription-invite",e.UserRequest="user-request",e.Demo="demo",e.AppViewRoute="route",e.None="none"}(le||(le={}));class ue{constructor(e){this.url=new URL(e),this.path=this.url.pathname,this.searchParams=this.url.searchParams,this.parsedType=this.parseTypeFromQueryParameters()}get type(){return this.parsedType}get userRequestParams(){return this.checkForProperRouteType(le.UserRequest),{requestType:this.searchParams.get(te.UserRequest)}}get subscriptionInviteParams(){return this.checkForProperRouteType(le.AcceptSubscriptionInvite),{inviteUuid:this.searchParams.get(te.AcceptSubscriptionInvite)}}get demoParams(){return this.checkForProperRouteType(le.Demo),{token:this.searchParams.get(te.DemoToken)}}get settingsParams(){return this.checkForProperRouteType(le.Settings),{panel:this.searchParams.get(te.Settings)}}get purchaseParams(){return this.checkForProperRouteType(le.Purchase),{plan:this.searchParams.get("plan"),period:this.searchParams.get("period")}}get onboardingParams(){return this.checkForProperRouteType(le.Onboarding),{fromHomepage:!!this.searchParams.get("from_homepage")}}get appViewRouteParam(){this.checkForProperRouteType(le.AppViewRoute);const e=this.searchParams.get(te.AppViewRoute);if(se.includes(e))return this.searchParams.get(te.AppViewRoute)}checkForProperRouteType(e){if(this.parsedType!==e)throw new Error("Accessing invalid params")}parseTypeFromQueryParameters(){if(this.path===ae.Onboarding)return le.Onboarding;const e=["index.html","popup.html"].some((e=>this.path.endsWith(e)));if(this.path!==ae.None&&!e)return le.None;const t=new Map([[te.Purchase,le.Purchase],[te.Settings,le.Settings],[te.DemoToken,le.Demo],[te.AcceptSubscriptionInvite,le.AcceptSubscriptionInvite],[te.UserRequest,le.UserRequest],[te.AppViewRoute,le.AppViewRoute]]);for(const e of t.keys())if(this.searchParams.has(e))return t.get(e);return le.None}}!function(e){e.RouteChanged="route-changed"}(ce||(ce={}));class de extends a.wcN{constructor(e,t){super(t),this.application=e,this.internalEventBus=t,this.addAppEventObserver()}deinit(){super.deinit(),this.application=void 0,this.unsubApp()}getRoute(){return new ue(window.location.href)}get isDotOrg(){return"app.standardnotes.org"===window.location.host}removeQueryParameterFromURL(e){const t=new URLSearchParams(window.location.search);t.delete(e);const n=`${window.location.origin}${window.location.pathname}${t.toString()}`;window.history.replaceState(null,document.title,n)}addAppEventObserver(){this.unsubApp=this.application.addEventObserver((async e=>{e===a.n9K.LocalDataLoaded&&this.notifyRouteChange()}))}notifyRouteChange(){this.notifyEvent(ce.RouteChanged,this.getRoute())}}const he=0,pe=1,fe=6e4,ge=3e5,me=6e5,ye=36e5,ve="AutoLockIntervalKey";class Ae extends a.wcN{constructor(e,t){super(t),this.application=e,this.internalEventBus=t,this.addAppEventObserverAfterSubclassesFinishConstructing()}onAppLaunch(){this.beginPolling()}deinit(){this.cancelAutoLockTimer(),this.pollInterval&&clearInterval(this.pollInterval),this.application=void 0,this.unsubApp(),this.unsubApp=void 0,super.deinit()}addAppEventObserverAfterSubclassesFinishConstructing(){setTimeout((()=>{this.addAppEventObserver()}),0)}addAppEventObserver(){this.application.isLaunched()&&this.onAppLaunch(),this.unsubApp=this.application.addEventObserver((async e=>{e===a.n9K.Launched&&this.onAppLaunch()}))}lockApplication(){if(!this.application.hasPasscode())throw Error("Attempting to lock application with no passcode");this.application.lock().catch(console.error)}async setAutoLockInterval(e){return this.application.setValue(ve,e)}async getAutoLockInterval(){return await this.application.getValue(ve)||he}async deleteAutolockPreference(){await this.application.removeValue(ve),this.cancelAutoLockTimer()}beginPolling(){this.pollInterval=setInterval((async()=>{!await this.application.protections.isLocked()&&this.lockAfterDate&&new Date>this.lockAfterDate&&this.lockApplication();const e=document.hasFocus();e&&"hidden"===this.lastFocusState?this.documentVisibilityChanged(!0).catch(console.error):e||"visible"!==this.lastFocusState||this.documentVisibilityChanged(!1).catch(console.error),this.lastFocusState=e?"visible":"hidden"}),50)}getAutoLockIntervalOptions(){return[{value:he,label:"Off"},{value:pe,label:"Immediately"},{value:fe,label:"1m"},{value:ge,label:"5m"},{value:me,label:"10m"},{value:ye,label:"1h"}]}async documentVisibilityChanged(e){e?this.cancelAutoLockTimer():this.beginAutoLockTimer().catch(console.error)}async beginAutoLockTimer(){const e=await this.getAutoLockInterval();e!==he&&(this.lockAfterDate=(e=>{const t=new Date;return t.setSeconds(t.getSeconds()+e),t})(e/1e3))}cancelAutoLockTimer(){this.lockAfterDate=void 0}}var be;!function(e){e.AnonymousUserId="AnonymousUserId",e.ShowBetaWarning="ShowBetaWarning",e.ShowNoAccountWarning="ShowNoAccountWarning",e.FilesNavigationEnabled="FilesNavigationEnabled",e.MasterStatePersistenceKey="master-persistence-key"}(be||(be={}));const we={get(e){const t=localStorage.getItem(e);return t?JSON.parse(t):null},set(e,t){localStorage.setItem(e,JSON.stringify(t))},remove(e){localStorage.removeItem(e)}};var Se=n(84409);class Ce{constructor(e,t,n,r,i,o){this.items=e,this.mutator=t,this.sync=n,this.api=r,this.alerts=i,this.crypto=o}async performDownloadPlugins(){const e=await fetch("https://raw.githubusercontent.com/standardnotes/plugins/main/cdn/dist/packages.json"),t=await e.text(),n=JSON.parse(t);return Object.values(n)}async getInstallablePlugins(){return this.originalPlugins||(this.originalPlugins=await this.performDownloadPlugins()),this.filterInstallablePlugins(this.originalPlugins)}filterInstallablePlugins(e){return e.filter((e=>{if(!e.showInGallery)return!1;const t=(0,Se.FindNativeFeature)(e.identifier);return!(t&&!t.deprecated)&&!this.items.getDisplayableComponents().find((t=>t.identifier===e.identifier))})).sort(((e,t)=>e.name===t.name?0:e.name.toLowerCase()<t.name.toLowerCase()?-1:1))}async installPlugin(e){var t;if(![c.ContentType.TYPES.Component,c.ContentType.TYPES.Theme,c.ContentType.TYPES.ActionsExtension,c.ContentType.TYPES.ExtensionRepo].includes(e.content_type))return;const n=(0,Se.FindNativeFeature)(e.identifier);if(n&&!n.deprecated)return void this.alerts.alert("Unable to install plugin due to a conflict with a native feature.");if(e.url)for(const t of(0,Se.GetFeatures)())if(e.url.includes(t.identifier)&&!t.deprecated)return void this.alerts.alert("Unable to install plugin due to a conflict with a native feature.");const r=(0,d.FillItemContentSpecialized)({area:e.area,name:null!==(t=e.name)&&void 0!==t?t:"",package_info:e,valid_until:new Date(e.expires_at||0),hosted_url:e.url}),i=this.items.createTemplateItem(e.content_type,r);return await this.mutator.insertItem(i),this.sync.sync(),i}async getPluginDetailsFromUrl(e){var t;let n=e;try{n=this.crypto.base64Decode(e)}catch(e){}const i=await this.api.downloadFeatureUrl(n);if(null===(t=i.data)||void 0===t?void 0:t.error)return void await this.alerts.alert(a.mvL);let o=i.data;if((0,r.isString)(o))try{o=JSON.parse(o)}catch(e){}return o.content_type?o:void 0}async installExternalPlugin(e){if(!(0,Se.FindNativeFeature)(e.identifier)){if(e.url)for(const t of(0,Se.GetFeatures)())if(e.url.includes(t.identifier))return void await this.alerts.alert("Unable to install external plugin due to a conflict with a native feature.");return this.installPlugin(e)}await this.alerts.alert("Unable to install external plugin due to a conflict with a native feature.")}}class Ee{constructor(e){this.preferences=e}execute(){return c.Result.ok(this.preferences.getValue(d.PrefKey.EditorSpellcheck,d.PrefDefaults[d.PrefKey.EditorSpellcheck]))}}class Ie{constructor(e){this.environment=e}execute(){return c.Result.ok(this.environment===d.Environment.Mobile)}}const _e=()=>/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||navigator.userAgent.includes("Mac")&&"ontouchend"in document&&navigator.maxTouchPoints>1||window.platform===d.Platform.Ios,xe=()=>navigator.userAgent.toLowerCase().includes("android");class Pe{constructor(e){this._isNativeMobileWeb=e}execute(){return c.Result.ok(this._isNativeMobileWeb.execute().getValue()||_e()||xe())}}class ke{constructor(e,t){this.environment=e,this.platform=t}execute(){return c.Result.ok(this.environment===d.Environment.Mobile&&this.platform===d.Platform.Ios)}}class Be{constructor(e){this.items=e}execute(e){return c.Result.ok(this.items.itemsReferencingItem(e).filter((e=>e.content_type===c.ContentType.TYPES.Tag)))}}class Oe extends a.wcN{constructor(e,t){super(t),this.application=e,this.internalEventBus=t,this.observers=new Set,this.addAppEventObserverAfterSubclassesFinishConstructing()}async onAppStart(){}async onAppEvent(e){}addAppEventObserverAfterSubclassesFinishConstructing(){setTimeout((()=>{this.addAppEventObserver()}),0)}addAppEventObserver(){this.application.isStarted()&&this.onAppStart(),this.unsubApp=this.application.addEventObserver((async e=>{await this.onAppEvent(e),e===a.n9K.Started&&this.onAppStart()}))}addObserver(e){this.observers.add(e)}deinit(){this.application=void 0,this.observers.forEach((e=>e())),this.unsubApp(),this.unsubApp=void 0,super.deinit()}}class Ne{constructor(e){this.items=e}execute(e){const t=(0,Se.GetNativeThemes)().filter((t=>!e.excludeLayerable||!t.layerable));return{thirdParty:this.items.getDisplayableComponents().filter((e=>e.isTheme()&&void 0===(0,Se.FindNativeTheme)(e.identifier))).filter((t=>!e.excludeLayerable||!t.layerableTheme)).map((e=>new d.UIFeature(e))),native:t.map((e=>new d.UIFeature(e)))}}}class De{constructor(e,t){this.items=e,this.list=[],t&&(this.list=t)}getList(){return this.list.slice()}isEmpty(){return 0===this.list.length}clear(){this.list=[]}has(e){for(const t of this.list)if(t.equals(e))return!0;return!1}add(e){this.has(e)||this.list.push(e)}remove(e){this.list=this.list.filter((t=>!t.equals(e)))}asThemes(){const e=[];for(const t of this.list)if(t instanceof c.Uuid){const n=this.items.findItem(t.value);if(n){const t=new d.UIFeature(n);e.push(t)}}else{const n=(0,Se.FindNativeTheme)(t.value);if(n){const t=new d.UIFeature(n);e.push(t)}}return e}}const je=/-?\b[0-9]{1,3}\b/g;class Te{constructor(e){if(this.r=0,this.g=0,this.b=0,this.a=1,e.startsWith("rgb"))this.setFromRGB(e);else{if(!e.startsWith("#"))throw new Error("Invalid color");this.setFromHex(e)}}setFromHex(e){if(!e.startsWith("#"))throw new Error("Invalid color");const t=e.substring(1);if(3!==t.length&&6!==t.length)throw new Error("Invalid color");const n=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16);this.r=n,this.g=r,this.b=i}setFromRGB(e){if(!e.startsWith("rgb"))throw new Error("Invalid color");const t=e.match(je);if(!t||3!==t.length)throw new Error("Invalid color");const[n,r,i]=t.map((e=>parseInt(e,10)));if(n<0||n>255||r<0||r>255||i<0||i>255)throw new Error("Invalid color");this.r=n,this.g=r,this.b=i}setAlpha(e){if(e<0||e>1)throw new Error("Invalid alpha value");return this.a=e,this}toString(){return`rgba(${this.r}, ${this.g}, ${this.b}, ${this.a})`}isDark(){return(299*this.r+587*this.g+114*this.b)/1e3<=128}}const Me="cachedThemes",Fe="Default";class Re extends Oe{constructor(e,t,n,r){super(e,r),this.preferences=t,this.components=n,this.colorSchemeEventHandler=this.colorSchemeEventHandler.bind(this),this.themesActiveInTheUI=new De(e.items)}deinit(){this.themesActiveInTheUI.clear(),this.themesActiveInTheUI=void 0,this.preferences=void 0,this.components=void 0;const e=window.matchMedia("(prefers-color-scheme: dark)");null!=e.removeEventListener?e.removeEventListener("change",this.colorSchemeEventHandler):e.removeListener(this.colorSchemeEventHandler),super.deinit()}async onAppStart(){const e=this.application.desktopManager;e&&this.eventDisposers.push(e.registerUpdateObserver((e=>{const t=new d.UIFeature(e);t.isThemeComponent&&this.components.isThemeActive(t)&&(this.deactivateThemeInTheUI(t.uniqueIdentifier),setTimeout((()=>{this.activateTheme(t),this.cacheThemeState().catch(console.error)}),10))})))}async onAppEvent(e){var t;switch(e){case a.n9K.SignedOut:this.deactivateAllThemes(),this.themesActiveInTheUI.clear(),null===(t=this.application)||void 0===t||t.removeValue(Me,a.qt7.Nonwrapped).catch(console.error);break;case a.n9K.StorageReady:await this.activateCachedThemes();break;case a.n9K.FeaturesAvailabilityChanged:this.handleFeaturesAvailabilityChanged().catch(console.error);break;case a.n9K.Launched:if(!this.application.isNativeMobileWeb()){const e=window.matchMedia("(prefers-color-scheme: dark)");null!=e.addEventListener?e.addEventListener("change",this.colorSchemeEventHandler):e.addListener(this.colorSchemeEventHandler)}break;case a.n9K.LocalPreferencesChanged:this.handleLocalPreferencesChangeEvent()}}async handleMobileColorSchemeChangeEvent(){if(this.preferences.getLocalValue(a.dH$.UseSystemColorScheme,!1)){const e="dark"===await this.application.mobileDevice.getColorScheme();this.setThemeAsPerColorScheme(e)}}handleThemeStateChange(){let e=!1;const{features:t,uuids:n}=this.components.getActiveThemesIdentifiers(),r=new De(this.application.items,t),i=new De(this.application.items,n);for(const t of this.themesActiveInTheUI.getList())r.has(t)||i.has(t)||(this.deactivateThemeInTheUI(t),e=!0);for(const n of t)if(!this.themesActiveInTheUI.has(n)){const t=(0,Se.FindNativeTheme)(n.value);if(t){const n=new d.UIFeature(t);this.activateTheme(n),e=!0}}for(const t of n)if(!this.themesActiveInTheUI.has(t)){const n=this.application.items.findItem(t.value);if(n){const t=new d.UIFeature(n);this.activateTheme(t),e=!0}}e&&this.cacheThemeState().catch(console.error)}async handleLocalPreferencesChangeEvent(){this.handleThemeStateChange(),this.toggleTranslucentUIColors();const e=this.preferences.getLocalValue(a.dH$.UseSystemColorScheme,!1),t=this.preferences.getLocalValue(a.dH$.AutoLightThemeIdentifier,Fe),n=this.preferences.getLocalValue(a.dH$.AutoDarkThemeIdentifier,Se.NativeFeatureIdentifier.TYPES.DarkTheme),r=e!==this.lastUseDeviceThemeSettings||t!==this.lastAutoLightTheme||n!==this.lastAutoDarkTheme;if(r&&(this.lastUseDeviceThemeSettings=e,this.lastAutoLightTheme=t,this.lastAutoDarkTheme=n),r&&e){let e=window.matchMedia("(prefers-color-scheme: dark)").matches;this.application.isNativeMobileWeb()&&(e="dark"===await this.application.mobileDevice.getColorScheme()),this.setThemeAsPerColorScheme(e)}}async handleFeaturesAvailabilityChanged(){let e=!1;for(const t of this.themesActiveInTheUI.asThemes())this.application.features.getFeatureStatus(t.uniqueIdentifier)!==a.iKc.Entitled&&(this.deactivateThemeInTheUI(t.uniqueIdentifier),e=!0);const t=this.components.getActiveThemes();for(const n of t)this.themesActiveInTheUI.has(n.uniqueIdentifier)||(this.activateTheme(n),e=!0);if(this.preferences.getLocalValue(a.dH$.UseSystemColorScheme,!1)){let t=window.matchMedia("(prefers-color-scheme: dark)").matches;this.application.isNativeMobileWeb()&&(t="dark"===await this.application.mobileDevice.getColorScheme()),e=this.setThemeAsPerColorScheme(t)}e&&this.cacheThemeState()}colorSchemeEventHandler(e){this.preferences.getLocalValue(a.dH$.UseSystemColorScheme,!1)&&this.setThemeAsPerColorScheme(e.matches)}setThemeAsPerColorScheme(e){let t=!1;const n=e?a.dH$.AutoDarkThemeIdentifier:a.dH$.AutoLightThemeIdentifier,r=n===a.dH$.AutoDarkThemeIdentifier?Se.NativeFeatureIdentifier.TYPES.DarkTheme:Fe,i=new Ne(this.application.items),{thirdParty:o,native:s}=i.execute({excludeLayerable:!1}),l=[...o,...s],c=l.find((e=>this.components.isThemeActive(e)&&!e.layerable)),u=this.preferences.getLocalValue(n,r);if(u===Fe)(()=>{c&&(this.components.toggleTheme(c),t=!0)})();else{const e=l.find((e=>e.featureIdentifier===u));e&&(this.components.isThemeActive(e)?this.components.toggleOtherNonLayerableThemes(e):this.components.toggleTheme(e,!0).catch(console.error),t=!0)}return t}async activateCachedThemes(){const e=this.getCachedThemes();for(const t of e)this.activateTheme(t,!0)}deactivateAllThemes(){const e=this.themesActiveInTheUI.getList();for(const t of e)this.deactivateThemeInTheUI(t)}activateTheme(e,t=!1){if(this.themesActiveInTheUI.has(e.uniqueIdentifier))return;if(!t&&this.application.features.getFeatureStatus(e.uniqueIdentifier)!==a.iKc.Entitled)return;const n=this.application.componentManager.urlForFeature(e);if(!n)return;this.themesActiveInTheUI.add(e.uniqueIdentifier);const r=document.createElement("link");r.href=n,r.type="text/css",r.rel="stylesheet",r.media="screen,print",r.id=e.uniqueIdentifier.value,r.onload=()=>{this.syncThemeColorMetadata(),this.application.isNativeMobileWeb()&&setTimeout((()=>{const e=this.getBackgroundColor(),t=new Te(e);this.application.mobileDevice.handleThemeSchemeChange(t.isDark(),e)})),this.toggleTranslucentUIColors()},document.getElementsByTagName("head")[0].appendChild(r)}deactivateThemeInTheUI(e){var t;if(!this.themesActiveInTheUI.has(e))return;const n=document.getElementById(e.value);n&&(n.disabled=!0,null===(t=n.parentNode)||void 0===t||t.removeChild(n)),this.themesActiveInTheUI.remove(e),this.themesActiveInTheUI.isEmpty()&&(this.application.isNativeMobileWeb()&&this.application.mobileDevice.handleThemeSchemeChange(!1,"#ffffff"),this.toggleTranslucentUIColors())}getBackgroundColor(){const e=getComputedStyle(document.documentElement).getPropertyValue("--sn-stylekit-background-color").trim();return e.length?e:"#ffffff"}shouldUseTranslucentUI(){return this.preferences.getLocalValue(a.dH$.UseTranslucentUI,d.PrefDefaults[a.dH$.UseTranslucentUI])}toggleTranslucentUIColors(){if(!this.shouldUseTranslucentUI())return document.documentElement.style.removeProperty("--popover-background-color"),document.documentElement.style.removeProperty("--popover-backdrop-filter"),void document.body.classList.remove("translucent-ui");try{const e=new Te(this.getBackgroundColor()),t=e.isDark()?"blur(12px) saturate(190%) contrast(70%) brightness(80%)":"blur(12px) saturate(190%) contrast(50%) brightness(130%)",n=e.setAlpha(.65).toString();document.documentElement.style.setProperty("--popover-background-color",n),document.documentElement.style.setProperty("--popover-backdrop-filter",t),document.body.classList.add("translucent-ui")}catch(e){console.error(e)}}syncThemeColorMetadata(){const e=document.querySelector('meta[name="theme-color"]');e&&e.setAttribute("content",this.getBackgroundColor())}async cacheThemeState(){const e=this.themesActiveInTheUI.asThemes().map((e=>{if(e.isComponent){const t=e.asComponent.payloadRepresentation();return(0,d.CreateDecryptedLocalStorageContextPayload)(t)}return e.asFeatureDescription}));return this.application.setValue(Me,e,a.qt7.Nonwrapped)}getCachedThemes(){const e=this.application.getValue(Me,a.qt7.Nonwrapped);if(!e)return[];const t=[];for(const n of e)if("uuid"in n){const e=this.application.items.createPayloadFromObject(n),r=this.application.items.createItemFromPayload(e);t.push(new d.UIFeature(r))}else if("identifier"in n){const e=(0,Se.FindNativeTheme)(n.identifier);e&&t.push(new d.UIFeature(e))}return t}}var Le,Qe=n(54569);class Ue{hideToast(e){(0,Qe.Xd)(e)}showToast(e,t){return(0,Qe.fz)({type:e,message:t})}}!function(e){e.ItemListController="selected-items-controller",e.NavigationController="navigation-controller"}(Le||(Le={}));const Ve=["hotp","totp","steam","yandex"];class Ke{constructor(){this.convert=async(e,{insertNote:t,readFileAsText:n})=>{const r=await n(e),i=this.parseEntries(r);if(!i)throw new Error("Could not parse entries");const o=e.lastModified?new Date(e.lastModified):new Date,s=e.lastModified?new Date(e.lastModified):new Date,a=e.name.split(".")[0],l=JSON.stringify(i);return{successful:[await t({createdAt:o,updatedAt:s,title:a,text:l,noteType:Se.NoteType.Authentication,editorIdentifier:Se.NativeFeatureIdentifier.TYPES.TokenVaultEditor,useSuperIfPossible:!1})],errored:[]}}}getImportType(){return"aegis"}getSupportedFileTypes(){return["application/json"]}isContentValid(e){try{const t=JSON.parse(e);return t.db&&t.db.entries&&t.db.entries.every((e=>Ve.includes(e.type)))}catch(e){console.error(e)}return!1}parseEntries(e){try{return JSON.parse(e).db.entries.map((e=>({service:e.issuer,account:e.name,secret:e.info.secret,notes:e.note})))}catch(e){return console.error(e),null}}}var He=n(28879),Ge=n.n(He),Ye=n(89945),ze=n.n(Ye),Ze=n(10264),We=n.n(Ze),qe=n(79174),Je=n.n(qe),Xe=n(8139),$e=n.n(Xe);const et=e=>new Promise(((t,n)=>{const r=new FileReader;r.onload=e=>{var r;(null===(r=e.target)||void 0===r?void 0:r.result)?t(e.target.result):n()},r.readAsText(e)}));Ge().extend(ze()),Ge().extend(We());const tt="YYYYMMDDTHHmmss";class nt{constructor(e){this._generateUuid=e,this.convert=async(e,{insertNote:t,insertTag:n,linkItems:r,canUploadFiles:i,canUseSuper:o,convertHTMLToSuper:s,readFileAsText:a,uploadFile:l,cleanupItems:c})=>{var u,d,h;const p=await a(e),f=this.loadXMLString(p,"xml").getElementsByTagName("note"),g=[];function m(e){return g.filter((function(t){return t.content.title==e}))[0]}const y=[],v=[];for(const[a,p]of Array.from(f).entries()){const f=[];try{const e=p.getElementsByTagName("title")[0].textContent,c=null===(u=p.getElementsByTagName("created")[0])||void 0===u?void 0:u.textContent,d=p.getElementsByTagName("updated"),h=d.length?d[0].textContent:null,v=Array.from(p.getElementsByTagName("resource")).map(this.getResourceFromElement).filter(Boolean),A=p.getElementsByTagName("content")[0];let b=this.getXmlStringFromContentElement(A);if(!b)continue;b=b.replace(/<((en-media)[^<>]+)\/>/g,"<$1></$2>");const w=this.loadXMLString(b,"html").getElementsByTagName("en-note")[0],S=Array.from(w.getElementsByTagName("ul"));o&&(this.convertTopLevelDivsToParagraphs(w),this.convertListsToSuperFormatIfApplicable(S),this.convertLeftPaddingToSuperIndent(w)),this.removeEmptyAndOrphanListElements(w),this.unwrapTopLevelBreaks(w);const C=Array.from(w.getElementsByTagName("font"));for(const e of C)e.childNodes.forEach((e=>{e.textContent+=" "})),e.innerText=e.textContent||"";const E=Array.from(w.getElementsByTagName("en-media")),{uploadedFiles:I}=await this.replaceMediaElementsWithResources(E,v,i,l);f.push(...I);let _=w.innerHTML;o||(_=_.replace(/<\/div>/g,"</div>\n"),_=_.replace(/<li[^>]*>/g,"\n"),_=_.trim());const x=o?s(_,{addLineBreaks:!1}):this.stripHTML(_),P=c?Ge().utc(c,tt).toDate():new Date,k=h?Ge().utc(h,tt).toDate():P,B=await t({createdAt:P,updatedAt:k,title:e||`Imported note ${a+1} from Evernote`,text:x,useSuperIfPossible:o});y.push(B);for(const e of I)await r(B,e),y.push(e);const O=p.getElementsByTagName("tag");for(const e of Array.from(O)){const t=e.childNodes[0].nodeValue;let i=m(t);if(!i){const e=new Date;i=await n({createdAt:e,updatedAt:e,title:t||`Imported tag ${a+1} from Evernote`,references:[]}),g.push(i),y.push(i)}await r(B,i)}}catch(t){console.error(t),v.push({name:(null===(h=null===(d=p.getElementsByTagName("title"))||void 0===d?void 0:d[0])||void 0===h?void 0:h.textContent)||`${e.name} - Note #${a}`,error:t}),c(f).catch(console.error);continue}}return{successful:y,errored:v}},this.getResourceFromElement=e=>{var t,n,r,i;const o=null===(t=e.getElementsByTagName("mime")[0])||void 0===t?void 0:t.textContent;if(!o)return;const s=e.getElementsByTagName("resource-attributes")[0],a=null===(n=s.getElementsByTagName("source-url")[0])||void 0===n?void 0:n.textContent,l=(null===(r=s.getElementsByTagName("file-name")[0])||void 0===r?void 0:r.textContent)||this._generateUuid.execute().getValue(),c=e.getElementsByTagName("data")[0],u=c.getAttribute("encoding"),d=null===(i=c.textContent)||void 0===i?void 0:i.replace(/\n/g,"");if(!d)return;const h="data:"+o+";"+u+","+d;let p="";if(a&&a.startsWith("en-cache")){const e=a.split("+");p=e[e.length-2]}else"base64"===u&&(p=this.getMD5HashFromBase64(d));return p?{hash:p,data:h,fileName:l,mimeType:o}:void 0}}getImportType(){return"evernote"}getFileExtension(){return"enex"}isContentValid(e){return e.includes("<en-export")&&e.includes("</en-export>")}getXmlStringFromContentElement(e){let t;for(const n of Array.from(e.childNodes))if(n instanceof CDATASection){t=n.nodeValue;break}return t}getMD5HashFromBase64(e){const t=$e().parse(e);return Je()(t).toString()}convertTopLevelDivsToParagraphs(e){e.querySelectorAll("div").forEach((t=>{t.parentElement===e&&function(e,t){const n=Array.prototype.slice.call(e.attributes);e.outerHTML=`<p ${n.map((e=>e.name+'="'+e.value+'"')).join(" ")}>${e.innerHTML}</p>`}(t)}))}convertListsToSuperFormatIfApplicable(e){for(const t of e){if("true"!==t.style.getPropertyValue("--en-todo"))continue;t.setAttribute("__lexicallisttype","check");const e=t.getElementsByTagName("li");for(const t of Array.from(e))t.setAttribute("aria-checked",t.style.getPropertyValue("--en-checked"))}}convertLeftPaddingToSuperIndent(e){e.querySelectorAll("p").forEach((e=>{const t=e.style.paddingLeft;if(t){const n=parseInt(t)/2;e.style.textIndent=`${n}px`,e.style.paddingLeft=""}}))}removeEmptyAndOrphanListElements(e){Array.from(e.getElementsByTagName("ul, ol")).forEach((e=>{0===e.children.length&&e.remove()})),Array.from(e.getElementsByTagName("li")).forEach((e=>{const t=null===e.textContent||""===e.textContent.trim(),n=!e.closest("ul, ol");(t||n)&&e.remove()}))}unwrapTopLevelBreaks(e){Array.from(e.querySelectorAll("* > p > br, * > div > br")).forEach((e=>{const t=e.parentElement,n=Array.from(t.children);n.every((e=>"BR"===e.tagName))&&t.replaceWith(n[0])}))}getHTMLElementFromResource(e){let t=document.createElement("object");if(t.setAttribute("type",e.mimeType),t.setAttribute("data",e.data),e.mimeType.startsWith("image/"))t=document.createElement("img"),t.setAttribute("src",e.data),t.setAttribute("data-mime-type",e.mimeType);else if(e.mimeType.startsWith("audio/")){t=document.createElement("audio"),t.setAttribute("controls","controls");const n=document.createElement("source");n.setAttribute("src",e.data),n.setAttribute("type",e.mimeType),t.appendChild(n)}else if(e.mimeType.startsWith("video/")){t=document.createElement("video"),t.setAttribute("controls","controls");const n=document.createElement("source");n.setAttribute("src",e.data),n.setAttribute("type",e.mimeType),t.appendChild(n)}return t.setAttribute("data-filename",e.fileName),t}async getFileFromResource(e){const t=((e,t="")=>{const n=atob(e.split(",")[1]);t||(t=e.split(",")[0].split(":")[1].split(";")[0]);const r=new ArrayBuffer(n.length),i=new Uint8Array(r);for(let e=0;e<n.length;e++)i[e]=n.charCodeAt(e);return new Blob([r],{type:t})})(e.data,e.mimeType);return new File([t],e.fileName,{type:e.mimeType})}async replaceMediaElementsWithResources(e,t,n,r){const i=[],o=new Map;for(const s of e){const e=s.getAttribute("hash"),a=t.find((t=>t&&t.hash===e));if(!a)continue;if(!s.parentNode)continue;const l=o.get(a.hash),c=n?l||await r(await this.getFileFromResource(a)):void 0;if(c){const e=document.createElement("div");e.setAttribute("data-lexical-file-uuid",c.uuid),s.parentNode.replaceChild(e,s),i.push(e),l||o.set(a.hash,c);continue}const u=this.getHTMLElementFromResource(a);s.parentNode.replaceChild(u,s),i.push(u)}return{replacedElements:i,uploadedFiles:Array.from(o.values())}}loadXMLString(e,t){return(new DOMParser).parseFromString(e,`text/${t}`)}stripHTML(e){const t=document.createElement("html");return t.innerHTML=e,t.textContent||t.innerText||""}}class rt{constructor(){this.convert=async(e,{insertNote:t,convertMarkdownToSuper:n,readFileAsText:i})=>{const o=await i(e),{name:s}=(0,r.parseFileName)(e.name),a=e.lastModified?new Date(e.lastModified):new Date,l=e.lastModified?new Date(e.lastModified):new Date;return{successful:[await t({createdAt:a,updatedAt:l,title:s,text:n(o),useSuperIfPossible:!0})],errored:[]}}}getImportType(){return"plaintext"}getSupportedFileTypes(){return["text/plain","text/markdown"]}isContentValid(e){return!0}static isValidPlaintextFile(e){return"text/plain"===e.type||"text/markdown"===e.type}}class it{constructor(){this.convert=async(e,{insertNote:t,canUseSuper:n,convertHTMLToSuper:r,convertMarkdownToSuper:i,readFileAsText:o})=>{const s=await o(e),a=await this.tryParseAsJson(s,t,i)||await this.tryParseAsHtml(s,e,t,r,n);if(a)return{successful:[a],errored:[]};throw new Error("Could not parse Google Keep backup file")}}getImportType(){return"google-keep"}getSupportedFileTypes(){return["text/html","application/json"]}isContentValid(e){try{const t=JSON.parse(e);return it.isValidGoogleKeepJson(t)}catch(e){console.error(e)}return!!(e.length>0&&e.includes('class="content"'))}async tryParseAsHtml(e,t,n,r,i){var o;const s=document.createElement("html");s.innerHTML=e;const a=s.getElementsByClassName("heading")[0],l=new Date((null==a?void 0:a.textContent)||"");null==a||a.remove();const c=s.getElementsByClassName("content")[0];if(!c)throw new Error("Could not parse content. Content element not found.");let u;const d=c.getElementsByTagName("ul");if(Array.from(d).forEach((e=>{e.setAttribute("__lexicallisttype","check");const t=e.getElementsByTagName("li");Array.from(t).forEach((e=>{var t;const n=e.getElementsByClassName("bullet")[0];null==n||n.remove();const r=e.classList.contains("checked");e.setAttribute("aria-checked",r?"true":"false"),i||(e.textContent=`- ${r?"[x]":"[ ]"} ${null===(t=e.textContent)||void 0===t?void 0:t.trim()}\n`)}))})),i?u=r(s.innerHTML,{addLineBreaks:!1}):(c.innerHTML=c.innerHTML.replace(/<br>/g,"\n"),u=c.textContent),!u)throw new Error("Could not parse content");const h=(null===(o=s.getElementsByClassName("title")[0])||void 0===o?void 0:o.textContent)||t.name;return await n({createdAt:l,updatedAt:l,title:h,text:u,useSuperIfPossible:!0})}static isValidGoogleKeepJson(e){return"string"!=typeof e.textContent?!("object"!=typeof e.listContent||!Array.isArray(e.listContent))&&e.listContent.every((e=>"string"==typeof e.text&&"boolean"==typeof e.isChecked)):"string"==typeof e.title&&"number"==typeof e.userEditedTimestampUsec&&"boolean"==typeof e.isArchived&&"boolean"==typeof e.isTrashed&&"boolean"==typeof e.isPinned&&"string"==typeof e.color}async tryParseAsJson(e,t,n){try{const r=JSON.parse(e);if(!it.isValidGoogleKeepJson(r))return null;const i=new Date(r.userEditedTimestampUsec/1e3);let o;return o="textContent"in r?r.textContent:r.listContent.map((e=>e.isChecked?`- [x] ${e.text}`:`- [ ] ${e.text}`)).join("\n"),o=n(o),await t({createdAt:i,updatedAt:i,title:r.title,text:o,archived:Boolean(r.isArchived),trashed:Boolean(r.isTrashed),pinned:Boolean(r.isPinned),useSuperIfPossible:!0})}catch(e){return console.error(e),null}}}const ot=e=>e.id&&null!=e.content&&e.creationDate&&e.lastModified;class st{constructor(){this.convert=async(e,{insertNote:t,readFileAsText:n})=>{const r=await n(e),i=await this.parse(r,t);if(!i)throw new Error("Could not parse notes");return{successful:i,errored:[]}}}getImportType(){return"simplenote"}getSupportedFileTypes(){return["application/json"]}isContentValid(e){try{const t=JSON.parse(e);return t.activeNotes&&t.activeNotes.every(ot)||t.trashedNotes&&t.trashedNotes.every(ot)}catch(e){console.error(e)}return!1}createNoteFromItem(e,t,n){var r,i;const o=new Date(e.creationDate),s=new Date(e.lastModified),a=((e,t)=>{const n=e.indexOf("\r\n");return n>-1?[e.slice(0,n),e.slice(n+2)]:[]})(e.content),l=null!==(r=a[0])&&void 0!==r?r:o.toLocaleString();return n({createdAt:o,updatedAt:s,title:l,text:null!==(i=a[1])&&void 0!==i?i:e.content,trashed:t,useSuperIfPossible:!0})}async parse(e,t){try{const n=JSON.parse(e),r=await Promise.all(n.activeNotes.reverse().map((e=>this.createNoteFromItem(e,!1,t)))),i=await Promise.all(n.trashedNotes.reverse().map((e=>this.createNoteFromItem(e,!0,t))));return[...r,...i]}catch(e){return console.error(e),null}}}class at{constructor(){this.convert=async(e,{insertNote:t,convertHTMLToSuper:n,readFileAsText:i})=>{const o=await i(e),{name:s}=(0,r.parseFileName)(e.name),a=e.lastModified?new Date(e.lastModified):new Date,l=e.lastModified?new Date(e.lastModified):new Date,c=n(o);return{successful:[await t({createdAt:a,updatedAt:l,title:s,text:c,useSuperIfPossible:!0})],errored:[]}}}getImportType(){return"html"}getSupportedFileTypes(){return["text/html"]}isContentValid(e){return!0}}class lt{constructor(e){this.converterService=e,this.convert=async(e,{insertNote:t,readFileAsText:n})=>{const i=await n(e),o={successful:[],errored:[]};if(!this.converterService.isValidSuperString(i))throw new Error("Content is not valid Super JSON");const{name:s}=(0,r.parseFileName)(e.name),a=e.lastModified?new Date(e.lastModified):new Date,l=e.lastModified?new Date(e.lastModified):new Date,c=await t({createdAt:a,updatedAt:l,title:s,text:i,useSuperIfPossible:!0});return o.successful.push(c),o}}getImportType(){return"super"}getSupportedFileTypes(){return["application/json"]}isContentValid(e){return this.converterService.isValidSuperString(e)}}class ct{constructor(e,t,n,i,o,s,l,u){this.features=e,this.mutator=t,this.items=n,this.superConverterService=i,this.filesController=o,this.linkingController=s,this._generateUuid=l,this.files=u,this.converters=new Set,this.detectService=async e=>{const t=await et(e),{ext:n}=(0,r.parseFileName)(e.name);for(const r of this.converters){const i=r.getSupportedFileTypes&&r.getSupportedFileTypes().includes(e.type),o=r.getFileExtension&&r.getFileExtension()===n;if((i||o)&&r.isContentValid(t))return r.getImportType()}return null},this.insertNote=async({createdAt:e,updatedAt:t,title:n,text:r,noteType:i,editorIdentifier:o,trashed:s=!1,archived:l=!1,pinned:u=!1,useSuperIfPossible:d})=>{i!==Se.NoteType.Super||this.canUseSuper()||(i=void 0),o&&this.features.getFeatureStatus(Se.NativeFeatureIdentifier.create(o).getValue())!==a.iKc.Entitled&&(o=void 0);const h=d&&this.canUseSuper();if(new Blob([r]).size>3e6)throw new Error("Note is too large to import");const p=this.items.createTemplateItem(c.ContentType.TYPES.Note,{title:n,text:r,references:[],noteType:h?Se.NoteType.Super:i,trashed:s,archived:l,pinned:u,editorIdentifier:h?Se.NativeFeatureIdentifier.TYPES.SuperEditor:o},{created_at:e,updated_at:t});return await this.mutator.insertItem(p)},this.insertTag=async({createdAt:e,updatedAt:t,title:n,references:r})=>{const i=this.items.createTemplateItem(c.ContentType.TYPES.Tag,{title:n,expanded:!1,iconString:"",references:r},{created_at:e,updated_at:t});return await this.mutator.insertItem(i)},this.canUploadFiles=()=>this.features.getFeatureStatus(Se.NativeFeatureIdentifier.create(Se.NativeFeatureIdentifier.TYPES.Files).getValue())===a.iKc.Entitled,this.uploadFile=async e=>{if(this.canUploadFiles())try{return await this.filesController.uploadNewFile(e,{showToast:!0})}catch(e){return void console.error(e)}},this.linkItems=async(e,t)=>{await this.linkingController.linkItems(e,t,!1)},this.cleanupItems=async e=>{for(const t of e)(0,d.isFile)(t)&&await this.files.deleteFile(t),await this.mutator.deleteItems([t])},this.canUseSuper=()=>this.features.getFeatureStatus(Se.NativeFeatureIdentifier.create(Se.NativeFeatureIdentifier.TYPES.SuperEditor).getValue())===a.iKc.Entitled,this.convertHTMLToSuper=(e,t)=>this.canUseSuper()?this.superConverterService.convertOtherFormatToSuperString(e,"html",{html:t}):e,this.convertMarkdownToSuper=e=>this.canUseSuper()?this.superConverterService.convertOtherFormatToSuperString(e,"md"):e,this.registerNativeConverters()}registerNativeConverters(){this.converters.add(new Ke),this.converters.add(new it),this.converters.add(new st),this.converters.add(new rt),this.converters.add(new nt(this._generateUuid)),this.converters.add(new at),this.converters.add(new lt(this.superConverterService))}async importFromFile(e,t){const n=this.canUseSuper();if("super"===t&&!n)throw new Error("Importing Super notes requires a subscription");const r=[],i=[];for(const o of this.converters){if(o.getImportType()!==t)continue;const s=await et(e);if(!o.isContentValid(s))throw new Error("Content is not valid");const a=await o.convert(e,{insertNote:this.insertNote,insertTag:this.insertTag,canUploadFiles:this.canUploadFiles(),uploadFile:this.uploadFile,canUseSuper:n,convertHTMLToSuper:this.convertHTMLToSuper,convertMarkdownToSuper:this.convertMarkdownToSuper,readFileAsText:et,linkItems:this.linkItems,cleanupItems:this.cleanupItems});r.push(...a.successful),i.push(...a.errored);break}return{successful:r,errored:i}}}var ut;!function(e){e.VaultDisplayOptionsChanged="VaultDisplayOptionsChanged"}(ut||(ut={}));var dt=n(80075);class ht extends Oe{constructor(e,t){super(e,t),this.exclusivelyShownVault=void 0,this.isVaultExplicitlyExcluded=e=>{var t;return null!==(t=this.options.isVaultExplicitlyExcluded(e))&&void 0!==t&&t},this.isVaultExclusivelyShown=e=>this.options.isVaultExclusivelyShown(e),this.hideVault=e=>{const t=this.application.vaultLocks.getLockedvaults(),n=this.options.newOptionsByExcludingVault(e,t);this.setVaultSelectionOptions(n)},this.unhideVault=async e=>{if(this.application.vaultLocks.isVaultLocked(e)&&!await this.unlockVault(e))return;const t=this.application.vaultLocks.getLockedvaults(),n=this.options.newOptionsByUnexcludingVault(e,t);this.setVaultSelectionOptions(n)},this.showOnlyVault=async e=>{if(this.application.vaultLocks.isVaultLocked(e)&&!await this.unlockVault(e))return;const t=new d.VaultDisplayOptions({exclusive:e.systemIdentifier});this.setVaultSelectionOptions(t)},this.setVaultSelectionOptions=e=>{const t=this.options;if(this.options=e,!t.isInExclusiveDisplayMode()&&e.isInExclusiveDisplayMode()&&(this.previousMultipleSelectionOptions=t),this.isInExclusiveDisplayMode()){const e=this.application.vaults.getVault({keySystemIdentifier:this.options.getExclusivelyShownVault()});this.exclusivelyShownVault=e.isFailed()?void 0:e.getValue()}else this.exclusivelyShownVault=void 0;this.application.items.setVaultDisplayOptions(e),this.notifyEvent(ut.VaultDisplayOptionsChanged,e),this.application.isLaunched()&&this.application.setValue(a.QtK.VaultSelectionOptions,e.getPersistableValue())},this.loadVaultSelectionOptionsFromDisk=()=>{const e=this.application.getValue(a.QtK.VaultSelectionOptions);if(!e)return;const t=d.VaultDisplayOptions.FromPersistableValue(e);this.options=t,this.notifyEvent(ut.VaultDisplayOptionsChanged,t)},this.options=new d.VaultDisplayOptions({exclude:[],locked:[]}),(0,dt.rC)(this,{options:dt.LO,isVaultExplicitlyExcluded:dt.LO,isVaultExclusivelyShown:dt.LO,exclusivelyShownVault:dt.LO,hideVault:dt.aD,unhideVault:dt.aD,showOnlyVault:dt.aD}),t.addEventHandler(this,a.h21.VaultLocked),t.addEventHandler(this,a.h21.VaultUnlocked),t.addEventHandler(this,a.n9K.ApplicationStageChanged),this.addObserver(e.items.streamItems(c.ContentType.TYPES.VaultListing,(({removed:e})=>{e.some((e=>{var t;return e.uuid===(null===(t=this.exclusivelyShownVault)||void 0===t?void 0:t.uuid)}))&&this.changeToMultipleVaultDisplayMode()})))}async handleEvent(e){e.type===a.h21.VaultLocked||e.type===a.h21.VaultUnlocked?this.handleVaultLockingStatusChanged():e.type===a.n9K.ApplicationStageChanged&&e.payload.stage===a.Ugm.StorageDecrypted_09&&this.loadVaultSelectionOptionsFromDisk()}handleVaultLockingStatusChanged(){const e=this.application.vaultLocks.getLockedvaults(),t=this.options.newOptionsByIntakingLockedVaults(e);this.setVaultSelectionOptions(t)}getOptions(){return this.options}isVaultDisabledOrLocked(e){return this.options.isVaultDisabledOrLocked(e)}isInExclusiveDisplayMode(){return this.options.isInExclusiveDisplayMode()}getItemVault(e){return this.application.items.isTemplateItem(e)?this.exclusivelyShownVault?this.exclusivelyShownVault:void 0:this.application.vaults.getItemVault(e)}changeToMultipleVaultDisplayMode(){const e=this.application.vaults.getVaults(),t=this.application.vaultLocks.getLockedvaults(),n=this.previousMultipleSelectionOptions?this.previousMultipleSelectionOptions.getOptions().exclude:e.map((e=>e.systemIdentifier)).filter((e=>{var t;return e!==(null===(t=this.exclusivelyShownVault)||void 0===t?void 0:t.systemIdentifier)})),r=new d.VaultDisplayOptions({exclude:n,locked:t.map((e=>e.systemIdentifier))});this.setVaultSelectionOptions(r)}async unlockVault(e){if(!this.application.vaultLocks.isVaultLocked(e))throw new Error("Attempting to unlock a vault that is not locked.");const t=new a.tv4([new a.FEo(a.tQn.None,void 0,"Password")],a.Ps8.Custom,!0,a.NiJ.UnlockVault(e.name),a.NiJ.EnterVaultPassword);return new Promise((n=>{this.application.challenges.addChallengeObserver(t,{onCancel(){n(!1)},onNonvalidatedSubmit:async r=>{const i=r.getDefaultValue();if(!i)return this.application.challenges.completeChallenge(t),void n(!1);const o=i.value;if(!await this.application.vaultLocks.unlockNonPersistentVault(e,o))return this.application.challenges.setValidationStatusForChallenge(t,i,!1),void n(!1);this.application.challenges.completeChallenge(t),n(!0)}}),this.application.challenges.promptForChallengeResponse(t)}))}deinit(){this.options=void 0,super.deinit()}}},81346:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addYearsToDate=t.addMonthsToDate=t.addDaysToDate=t.addHoursToDate=void 0,t.addHoursToDate=function(e,t){const n=new Date(e);return n.setHours(n.getHours()+t),n},t.addDaysToDate=function(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n},t.addMonthsToDate=function(e,t){const n=new Date(e);return n.setMonth(n.getMonth()+t),n},t.addYearsToDate=function(e,t){const n=new Date(e);return n.setFullYear(n.getFullYear()+t),n}},90622:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Deferred=void 0,t.Deferred=()=>{let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return{resolve:e,reject:t,promise:n}}},75760:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DependencyContainer=void 0;const r=n(37225),i=n(75807);t.DependencyContainer=class{constructor(){this.factory=new Map,this.dependencies=new Map}deinit(){this.factory.clear();const e=this.getAll();for(const t of e)(0,i.isDeinitable)(t)&&t.deinit();this.dependencies.clear()}getAll(){return Array.from(this.dependencies.values()).filter(r.isNotUndefined)}bind(e,t){this.factory.set(e,t)}get(e){const t=this.dependencies.get(e);if(t)return t;const n=this.factory.get(e);if(!n)throw new Error(`No dependency maker found for ${e.toString()}`);const r=n();return r?(this.dependencies.set(e,r),r):void 0}}},75807:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canBlockDeinit=t.isDeinitable=void 0,t.isDeinitable=function(e){if(!e)throw new Error("Service is undefined");return"function"==typeof e.deinit},t.canBlockDeinit=function(e){if(!e)throw new Error("Service is undefined");return"function"==typeof e.blockDeinit}},12377:(e,t)=>{"use strict";function n(e){const t=/(?:\.([^.]+))$/.exec(e),n=(null==t?void 0:t[1])||"";return{name:e.includes(".")?e.substring(0,e.lastIndexOf(".")):e,ext:n}}function r(e){return e.trim().replace(/[.\\/:"?*|<>]/g,"_")}function i(e,t){return e.length>t?e.slice(0,t):e}Object.defineProperty(t,"__esModule",{value:!0}),t.parseAndCreateZippableFileName=t.createZippableFileName=t.truncateFileName=t.sanitizeFileName=t.parseFileName=void 0,t.parseFileName=n,t.sanitizeFileName=r,t.truncateFileName=i;function o(e,t="",n="txt",o=100){return i(r(e),o)+(t+".")+n}t.createZippableFileName=o,t.parseAndCreateZippableFileName=function(e,t=""){const{name:r,ext:i}=n(e);return o(r,t,i)}},33638:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},91379:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=void 0;class n{constructor(e){this.appIdentifier=e,this.level="none"}canLog(e){if("none"===this.level)return!1;const t=["debug","info","warn","error"];return t.indexOf(e)>=t.indexOf(this.level)}setLevel(e){this.level=e}debug(e,...t){this.canLog("debug")&&this.logWithColor(e,...t)}info(e,...t){this.canLog("info")&&this.logWithColor(e,...t)}warn(e,...t){this.canLog("warn")&&console.warn(e,...t)}error(e,...t){this.canLog("error")&&console.error(e,...t)}logWithColor(...e){const t=new Date,n=`${t.toLocaleTimeString().replace(" PM","").replace(" AM","")}.${t.getMilliseconds()}`;this.customLog(`%c${this.appIdentifier}%c${n}`,"color: font-weight: bold; margin-right: 4px","color: gray",...e)}customLog(...e){Function.prototype.apply.call(console.log,console,arguments)}}t.Logger=n,t.default=n},13777:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},47887:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.classNames=void 0;const r=n(37225);t.classNames=(...e)=>e.map((e=>"string"==typeof e?e:null)).filter(r.isNotUndefined).join(" ")},92484:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=void 0,t.debounce=function(e,t=50,n={}){var r,i;let o;const s=null!==(r=n.isImmediate)&&void 0!==r&&r,a=null!==(i=n.callback)&&void 0!==i&&i,l=n.maxWait;let c=Date.now(),u=[];const d=function(...n){const r=this;return new Promise(((i,d)=>{const h=s&&void 0===o;if(void 0!==o&&clearTimeout(o),o=setTimeout((function(){if(o=void 0,c=Date.now(),!s){const t=e.apply(r,n);a&&a(t),u.forEach((({resolve:e})=>e(t))),u=[]}}),function(){if(void 0!==l){const e=Date.now()-c;if(e+t>=l)return l-e}return t}()),h){const t=e.apply(r,n);return a&&a(t),i(t)}u.push({resolve:i,reject:d})}))};return d.cancel=function(e){void 0!==o&&clearTimeout(o),u.forEach((({reject:t})=>t(e))),u=[]},d}},37225:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.assertUnreachable=t.sleep=t.truncateHexString=t.hasGetter=t.isValidUrl=t.deepFreeze=t.pickByCopy=t.deepMerge=t.Copy=t.joinPaths=t.omitByCopy=t.omitInPlace=t.withoutLastElement=t.jsonParseEmbeddedKeys=t.topLevelCompare=t.dateSorted=t.omitUndefinedCopy=t.sortByKey=t.sortedCopy=t.objectToValueArray=t.arrayByRemovingFromIndex=t.addAtIndex=t.removeFromIndex=t.compareValues=t.compareArrayReferences=t.arrayByDifference=t.filterFromArray=t.addIfUnique=t.removeFromArray=t.subtractFromArray=t.extendArray=t.lastElement=t.uniqueArrayByKey=t.uniqueArray=t.uniqCombineObjArrays=t.greaterOfTwoDates=t.isString=t.isEmpty=t.isNotUndefined=t.isNullOrUndefined=t.isFunction=t.isObject=t.sureSearchArray=t.searchArray=t.findInArray=t.isReactNativeEnvironment=t.isWebCryptoAvailable=t.isWebEnvironment=t.dictToArray=t.getGlobalScope=void 0,t.pluralize=t.spaceSeparatedStrings=t.useBoolean=t.assert=t.logWithColor=t.log=t.secondHalfOfString=t.firstHalfOfString=t.splitString=t.nonSecureRandomIdentifier=t.dateToLocalizedString=t.sanitizeHtmlString=t.convertTimestampToMilliseconds=t.arraysEqual=t.naturalSort=t.isSameDay=void 0;const i=n(35368),o=n(76635),s="undefined"!=typeof Intl?new Intl.Collator("en",{numeric:!0}):void 0;function a(){return"undefined"!=typeof window?window:void 0!==n.g?n.g:null}function l(){return null!==a()}function c(){return"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function u(e,t){return(0,o.find)(e,t)}function d(e){return null!==e&&("function"==typeof e||"object"==typeof e)}function h(e){return null==e}function p(e,t){const n=e.indexOf(t);-1!==n&&e.splice(n,1)}function f(e,t){e.splice(t,1)}function g(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function m(e){return e instanceof Date?new Date(e):d(e)?JSON.parse(JSON.stringify(e)):e}var y;let v;function A(e,t,...n){const r=new Date;!function(...e){Function.prototype.apply.call(console.log,console,arguments)}(`%c${e}%c${r.toLocaleTimeString().replace(" PM","").replace(" AM","")}.${r.getMilliseconds()}`,`color: ${t}; font-weight: bold; margin-right: 4px`,"color: gray",...n)}t.getGlobalScope=a,t.dictToArray=function(e){return Object.values(e)},t.isWebEnvironment=l,t.isWebCryptoAvailable=function(){return l()&&!c()&&!(document&&document.documentMode)||/Edge/.test(navigator.userAgent)&&window.crypto&&!!window.crypto.subtle},t.isReactNativeEnvironment=c,t.findInArray=function(e,t,n){return e.find((e=>e[t]===n))},t.searchArray=u,t.sureSearchArray=function(e,t){return u(e,t)},t.isObject=d,t.isFunction=function(e){return null!==e&&"function"==typeof e},t.isNullOrUndefined=h,t.isNotUndefined=function(e){return null!=e},t.isEmpty=function(e){return!e||0===e.length},t.isString=function(e){return"string"==typeof e||e instanceof String},t.greaterOfTwoDates=function(e,t){return e>t?e:t},t.uniqCombineObjArrays=function(e,t,n){return(0,o.uniqWith)(e.concat(t),((e,t)=>{for(const r of n)if(e[r]!==t[r])return!1;return!0}))},t.uniqueArray=function(e){return(0,o.uniq)(e)},t.uniqueArrayByKey=function(e,t){return(0,o.uniqWith)(e,((e,n)=>e[t]===n[t]))},t.lastElement=function(e){return e[e.length-1]},t.extendArray=function(e,t){for(const n of t)e.push(n)},t.subtractFromArray=function(e,t){for(const n of t)p(e,n)},t.removeFromArray=p,t.addIfUnique=function(e,t){return!e.includes(t)&&(e.push(t),!0)},t.filterFromArray=function(e,t){(0,o.remove)(e,t)},t.arrayByDifference=function(e,t){return e.filter((e=>!t.includes(e))).concat(t.filter((t=>!e.includes(t))))},t.compareArrayReferences=function(e,t){return e.length===t.length&&e.every(((e,n)=>e===t[n]))},t.compareValues=function(e,t){return!(e&&!t||!e&&t)&&(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():e instanceof String&&t instanceof String?e===t:g(e,t))},t.removeFromIndex=f,t.addAtIndex=function(e,t,n){e.splice(n,0,t)},t.arrayByRemovingFromIndex=function(e,t){const n=e.slice();return f(n,t),n},t.objectToValueArray=function(e){const t=[];for(const n of Object.keys(e))t.push(e[n]);return t},t.sortedCopy=function(e){const t=Object.keys(e).sort(),n={};for(const r of t)n[r]=e[r];return m(n)},t.sortByKey=(e,t)=>{const n=[...e];return n.sort(((e,n)=>{const r=e[t],i=n[t];return r<i?-1:r>i?1:0})),n},t.omitUndefinedCopy=function(e){const t={};for(const n of Object.keys(e))h(e[n])||(t[n]=e[n]);return t},t.dateSorted=function(e,t,n=!0){return e.sort(((e,r)=>{const i=e[t].getTime(),o=r[t].getTime(),s=n?1:-1;return i<o?-1*s:i>o?1*s:0}))},t.topLevelCompare=g,t.jsonParseEmbeddedKeys=function(e){const t={};for(const n of Object.keys(e)){let r;try{r=JSON.parse(e[n])}catch(t){r=e[n]}t[n]=r}return t},t.withoutLastElement=e=>e.slice(0,-1),t.omitInPlace=function(e,t){if(e)for(const n of t)delete e[n]},t.omitByCopy=function(e,t){if(h(e))return;const n=Object.assign({},e);for(const e of t)delete n[e];return n},t.joinPaths=function(...e){return e.map(((e,t)=>0===t?e.trim().replace(/[/]*$/g,""):e.trim().replace(/(^[/]*|[/]*$)/g,""))).filter((e=>e.length)).join("/")},t.Copy=m,t.deepMerge=function(e,t){if(!e||!t)throw"Attempting to deepMerge with null values";return(0,o.mergeWith)(e,t,((e,t)=>{if((0,o.isArray)(e))return t})),e},t.pickByCopy=function(e,t){const n={};for(const r of t)n[r]=e[r];return m(n)},t.deepFreeze=function e(t){const n=Object.getOwnPropertyNames(t);for(const r of n){const n=t[r];n&&"object"==typeof n&&!Object.isFrozen(n)?t[r]=e(n):t[r]=n}return Object.freeze(t)},t.isValidUrl=function(e){try{return new URL(e),!0}catch(e){return!1}},t.hasGetter=function(e,t){const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t);return n&&!h(n.get)},t.truncateHexString=function(e,t){const n=t/4;return e.substring(0,n)},t.sleep=function(e,t=!0,n=""){return r(this,void 0,void 0,(function*(){return t&&console.warn(`Sleeping for ${e}ms ${n}`),new Promise((t=>{setTimeout((function(){t()}),e)}))}))},t.assertUnreachable=function(e){throw Error("Unchecked case "+e)},t.isSameDay=function(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()},t.naturalSort=function(e,t,n="asc"){switch(n){case"asc":return[...e].sort(s?(e,n)=>s.compare(e[t],n[t]):(e,n)=>e[t].localeCompare(n[t],"en",{numeric:!0}));case"desc":return[...e].sort(s?(e,n)=>s.compare(n[t],e[t]):(e,n)=>n[t].localeCompare(e[t],"en",{numeric:!0}))}},t.arraysEqual=function(e,t){return e.length===t.length&&e.every((e=>t.includes(e)))&&t.every((t=>e.includes(t)))},function(e){e[e.Seconds=10]="Seconds",e[e.Milliseconds=13]="Milliseconds",e[e.Microseconds=16]="Microseconds"}(y||(y={})),t.convertTimestampToMilliseconds=function(e){switch(String(e).length){case y.Seconds:return 1e3*e;case y.Milliseconds:return e;case y.Microseconds:return Math.floor(e/1e3);default:throw`Unhandled timestamp precision: ${e}`}},t.sanitizeHtmlString=function(e){return(0,i.sanitize)(e)},t.dateToLocalizedString=function(e){if("undefined"!=typeof Intl&&Intl.DateTimeFormat&&"undefined"!=typeof navigator){if(!v){const e=navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.language;v=new Intl.DateTimeFormat(e,{year:"numeric",month:"short",day:"2-digit",weekday:"long",hour:"2-digit",minute:"2-digit"})}return v.format(e)}return e.toDateString()+" "+e.toLocaleTimeString()},t.nonSecureRandomIdentifier=function(){return(""+100*Math.random()).replace(".","")},t.splitString=function(e,t){const n=e.length/t,r=[];for(let i=0;i<t;i++){const t=e.slice(n*i,n*(i+1));r.push(t)}return r},t.firstHalfOfString=function(e){return e.substring(0,e.length/2)},t.secondHalfOfString=function(e){return e.substring(e.length/2,e.length)},t.log=function(e,...t){A(e,"black",...t)},t.logWithColor=A,t.assert=function(e){if(void 0===e)throw new Error("Assertion failed; value must be defined")},t.useBoolean=function(e,t){return null!=e?e:t},t.spaceSeparatedStrings=function(...e){return e.join(" ")},t.pluralize=function(e,t,n){return 1===e?t:n}},49095:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Uuids=void 0,t.Uuids=function(e){return e.map((e=>e.uuid))}},57865:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UuidGenerator=void 0,t.UuidGenerator=class{static SetGenerator(e){this.syncUuidFunc=e}static GenerateUuid(){return this.syncUuidFunc()}}},28569:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UuidMap=void 0;const r=n(37225);class i{constructor(){this.directMap=new Map,this.inverseMap=new Map}get directMapSize(){return this.directMap.size}get inverseMapSize(){return this.inverseMap.size}makeCopy(){const e=new i;return e.directMap=new Map(this.directMap),e.inverseMap=new Map(this.inverseMap),e}existsInDirectMap(e){return this.directMap.has(e)}existsInInverseMap(e){return this.inverseMap.has(e)}getDirectRelationships(e){return this.directMap.get(e)||[]}getAllDirectKeys(){return Array.from(this.directMap.keys())}getInverseRelationships(e){return this.inverseMap.get(e)||[]}establishRelationship(e,t){this.establishDirectRelationship(e,t),this.establishInverseRelationship(e,t)}deestablishRelationship(e,t){this.deestablishDirectRelationship(e,t),this.deestablishInverseRelationship(e,t)}setAllRelationships(e,t){const n=this.directMap.get(e)||[];this.directMap.set(e,t);for(const t of n)this.deestablishInverseRelationship(e,t);for(const n of t)this.establishInverseRelationship(e,n)}removeFromMap(e){const t=this.directMap.get(e)||[];for(const n of t)(0,r.removeFromArray)(this.inverseMap.get(n)||[],e);this.directMap.delete(e);const n=this.inverseMap.get(e)||[];for(const t of n)(0,r.removeFromArray)(this.directMap.get(t)||[],e);this.inverseMap.delete(e)}establishDirectRelationship(e,t){const n=this.directMap.get(e)||[];(0,r.addIfUnique)(n,t),this.directMap.set(e,n)}establishInverseRelationship(e,t){const n=this.inverseMap.get(t)||[];(0,r.addIfUnique)(n,e),this.inverseMap.set(t,n)}deestablishDirectRelationship(e,t){const n=this.directMap.get(e)||[];(0,r.removeFromArray)(n,t),this.directMap.set(e,n)}deestablishInverseRelationship(e,t){const n=this.inverseMap.get(t)||[];(0,r.removeFromArray)(n,e),this.inverseMap.set(t,n)}}t.UuidMap=i},31800:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(81346),t),i(n(90622),t),i(n(75760),t),i(n(75807),t),i(n(91379),t),i(n(13777),t),i(n(33638),t),i(n(47887),t),i(n(92484),t),i(n(37225),t),i(n(49095),t),i(n(57865),t),i(n(28569),t),i(n(12377),t)},87901:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(31800),t)},38318:(e,t,n)=>{"use strict";var r;n.d(t,{V:()=>r}),function(e){e[e.GeneralMenu=0]="GeneralMenu",e[e.SignIn=1]="SignIn",e[e.Register=2]="Register",e[e.ConfirmPassword=3]="ConfirmPassword"}(r||(r={}))},91819:(e,t,n)=>{"use strict";n.d(t,{Z:()=>L});var r=n(52322),i=n(34309),o=n(2784),s=n(38318),a=n(39537),l=n(756);const c=e=>{let{name:t,checked:n,onChange:i,disabled:o,label:s}=e;return(0,r.jsxs)("label",{htmlFor:t,className:"fit-content mb-2 flex items-center text-sm",children:[(0,r.jsx)("input",{className:"mr-2",type:"checkbox",name:t,id:t,checked:n,onChange:i,disabled:o}),s]})};var u=n(91467),d=n(47931),h=n(99456),p=n(48518),f=n(66724),g=n(29894);const m=(0,i.Pi)((e=>{let{setMenuPane:t,email:n,password:i}=e;const m=(0,p.I)(),{notesAndTagsCount:y}=m.accountMenuController,[v,A]=(0,o.useState)(""),[b,w]=(0,o.useState)(!1),[S,C]=(0,o.useState)(!1),[E,I]=(0,o.useState)(!0),[_,x]=(0,o.useState)(""),[P,k]=(0,o.useState)(""),[B,O]=(0,o.useState)(""),N=(0,o.useCallback)((()=>{w(!0),m.register(n,i,P,S,E).then((()=>{m.accountMenuController.closeAccountMenu(),m.accountMenuController.setCurrentPane(s.V.GeneralMenu)})).catch((e=>{console.error(e),x(e.message)})).finally((()=>{w(!1)}))}),[m,n,P,S,i,E]),D=(0,f.m)(B,(e=>{k(e),O("")}));(0,o.useEffect)((()=>{P&&N()}),[P,N]);const j=(0,o.useRef)(null);(0,o.useEffect)((()=>{var e;null===(e=j.current)||void 0===e||e.focus()}),[]);const T=(0,o.useCallback)((e=>{A(e)}),[]),M=(0,o.useCallback)((()=>{C(!S)}),[S]),F=(0,o.useCallback)((()=>{I(!E)}),[E]),R=(0,o.useCallback)((()=>{m.getCaptchaUrl().then((e=>{if((0,g.isErrorResponse)(e))throw new Error;const{captchaUIUrl:t}=e.data;t?O(t):(O(""),N())})).catch((e=>{console.error(e),O(""),N()}))}),[m,N]),L=(0,o.useCallback)((e=>{var t,n;if(e.preventDefault(),i)return i!==v?(x(a.Zh),A(""),void(null===(n=j.current)||void 0===n||n.focus())):void R();null===(t=j.current)||void 0===t||t.focus()}),[R,v,i]),Q=(0,o.useCallback)((e=>{_.length&&x(""),"Enter"===e.key&&L(e)}),[L,_]),U=(0,o.useCallback)((()=>{t(s.V.Register)}),[t]),V=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-3 px-3 text-sm",children:["Because your notes are encrypted using your password,"," ",(0,r.jsx)("span",{className:"text-danger",children:"Standard Notes does not have a password reset option"}),". If you forget your password, you will permanently lose access to your data."]}),(0,r.jsxs)("form",{onSubmit:L,className:"mb-1 px-3",children:[!b&&(0,r.jsx)(u.Z,{className:{container:"mb-2"},disabled:b,left:[(0,r.jsx)(d.Z,{type:"password",className:"text-neutral"})],onChange:T,onKeyDown:Q,placeholder:"Confirm password",ref:j,value:v}),_?(0,r.jsx)("div",{className:"my-2 text-danger",children:_}):null,(0,r.jsx)(l.Z,{primary:!0,fullWidth:!0,className:"mb-3 mt-1",label:b?"Creating account...":"Create account & sign in",onClick:L,disabled:b}),(0,r.jsx)(c,{name:"is-ephemeral",label:"Stay signed in",checked:!S,onChange:M,disabled:b}),y>0?(0,r.jsx)(c,{name:"should-merge-local",label:"Merge local data (".concat(y," notes and tags)"),checked:E,onChange:F,disabled:b}):null]})]});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-3 mt-1 flex items-center px-3",children:[(0,r.jsx)(h.Z,{icon:"arrow-left",title:"Go back",className:"mr-2 flex p-0 text-neutral",onClick:U,focusable:!0,disabled:b}),(0,r.jsx)("div",{className:"text-base font-bold",children:B?"Human verification":"Confirm password"})]}),B?(0,r.jsx)("div",{className:"p-[10px]",children:D}):V]})}));var y=n(13959),v=n(24118),A=n(88743);const b=e=>{let{className:t}=e;const n=(0,p.I)(),[i,s]=(0,o.useState)("standard"),{server:a,setServer:l}=n.accountMenuController,c=(0,o.useCallback)((async()=>{var e;const t=await(null===(e=n.homeServer)||void 0===e?void 0:e.getHomeServerUrl());t&&a===t?s("home server"):a===g.DefaultHost.Api?s("standard"):s("custom")}),[n.homeServer,a]),u=(0,o.useCallback)(((e,t)=>{l(e),c(),n.setCustomHost(e,t).catch(console.error)}),[n,l,c]);(0,o.useEffect)((()=>{c()}),[n,a,c]);const h=(0,o.useMemo)((()=>[{label:"Default",value:"standard"},{label:"Custom",value:"custom"}].concat((0,v.Z$)()?[{label:"Home Server",value:"home server"}]:[])),[]);return(0,r.jsxs)("div",{className:"flex h-full flex-grow flex-col px-3 pb-1.5 ".concat(t),children:[(0,r.jsx)("div",{className:"mb-2 flex font-bold",children:"Sync Server"}),(0,r.jsx)(A.Z,{value:i,items:h,onChange:async e=>{if(s(e),"standard"===e)u(g.DefaultHost.Api,g.DefaultHost.WebSocket);else if("home server"===e){if(!n.homeServer)return void n.alerts.alert("Home server is not running. Please open the prefences and home server tab to start it.").catch(console.error);const e=await n.homeServer.getHomeServerUrl();if(!e)return void n.alerts.alert("Home server is not running. Please open the prefences and home server tab to start it.").catch(console.error);u(e)}}}),"custom"===i&&(0,r.jsx)(y.Z,{className:{container:"mt-1"},type:"text",left:[(0,r.jsx)(d.Z,{type:"server",className:"text-neutral"})],placeholder:g.DefaultHost.Api,value:a,onChange:u})]})},w=(0,i.Pi)((e=>{let{disabled:t=!1,onPrivateUsernameModeChange:n,onStrictSignInChange:i,onRecoveryCodesChange:s,children:a}=e;const l=(0,p.I)(),{server:u}=l.accountMenuController,[h,f]=(0,o.useState)(u!==g.DefaultHost.Api),[m,v]=(0,o.useState)(!1),[A,w]=(0,o.useState)(""),[S,C]=(0,o.useState)(!1),[E,I]=(0,o.useState)(""),[_,x]=(0,o.useState)(!1);(0,o.useEffect)((()=>{var e;null===(e=l.homeServer)||void 0===e||e.isHomeServerRunning().then((e=>{e&&f(!0)}))}),[l.homeServer]),(0,o.useEffect)((()=>{A&&(async()=>{const e=await l.computePrivateUsername(A);e?null==n||n(!0,e):(null==A?void 0:A.length)>0&&l.alerts.alert("Unable to compute private username.").catch(console.error)})().catch(console.error)}),[A,l,n]),(0,o.useEffect)((()=>{null==n||n(m)}),[m,n]);const P=(0,o.useCallback)((()=>{v(!m)}),[m]),k=(0,o.useCallback)((e=>{w(e)}),[]),B=(0,o.useCallback)((()=>{const e=!S;C(e),null==s||s(e),S||(v(!1),x(!1))}),[S,v,x,s]),O=(0,o.useCallback)((e=>{I(e),e&&(null==s||s(!0,e))}),[s]),N=(0,o.useCallback)((()=>{const e=!_;x(e),null==i||i(e)}),[_,i]),D=(0,o.useCallback)((()=>{f(!h)}),[h]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{className:"flex w-full cursor-pointer items-center border-0 bg-transparent px-3 py-1.5 text-left text-sm font-bold text-text hover:bg-contrast hover:text-foreground focus:bg-info-backdrop focus:shadow-none",onClick:D,children:(0,r.jsxs)("div",{className:"flex items-center",children:["Advanced options",(0,r.jsx)(d.Z,{type:"chevron-down",className:"ml-1 text-passive-1"})]})}),h?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"my-2 px-3",children:[a,(0,r.jsxs)("div",{className:"mb-1 flex items-center justify-between",children:[(0,r.jsx)(c,{name:"private-workspace",label:"Private username mode",checked:m,disabled:t||S,onChange:P}),(0,r.jsx)("a",{href:"https://standardnotes.com/help/80",target:"_blank",rel:"noopener noreferrer",title:"Learn more",children:(0,r.jsx)(d.Z,{type:"info",className:"text-neutral"})})]}),m&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(y.Z,{className:{container:"mb-2"},left:[(0,r.jsx)(d.Z,{type:"account-circle",className:"text-neutral"})],type:"text",placeholder:"Username",value:A,onChange:k,disabled:t||S,spellcheck:!1,autocomplete:!1})}),i&&(0,r.jsxs)("div",{className:"mb-1 flex items-center justify-between",children:[(0,r.jsx)(c,{name:"use-strict-signin",label:"Use strict sign-in",checked:_,disabled:t||S,onChange:N}),(0,r.jsx)("a",{href:"https://standardnotes.com/help/security",target:"_blank",rel:"noopener noreferrer",title:"Learn more",children:(0,r.jsx)(d.Z,{type:"info",className:"text-neutral"})})]}),(0,r.jsx)("div",{className:"mb-1 flex items-center justify-between",children:(0,r.jsx)(c,{name:"recovery-codes",label:"Use recovery code",checked:S,disabled:t,onChange:B})}),S&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(y.Z,{className:{container:"mb-2"},left:[(0,r.jsx)(d.Z,{type:"security",className:"text-neutral"})],type:"text",placeholder:"Recovery code",value:E,onChange:O,disabled:t,spellcheck:!1,autocomplete:!1})})]}),(0,r.jsx)(b,{})]}):null]})}));var S=n(53846);const C=(0,i.Pi)((e=>{let{setMenuPane:t,email:n,setEmail:i,password:a,setPassword:c}=e;const p=(0,o.useRef)(null),f=(0,o.useRef)(null),[g,m]=(0,o.useState)(!1);(0,o.useEffect)((()=>{var e;p.current&&(null===(e=p.current)||void 0===e||e.focus())}),[]);const v=(0,o.useCallback)((e=>{i(e)}),[i]),A=(0,o.useCallback)((e=>{c(e)}),[c]),b=(0,o.useCallback)((e=>{var r,o;e.preventDefault(),n&&0!==n.length?a&&0!==a.length?(i(n),c(a),t(s.V.ConfirmPassword)):null===(o=f.current)||void 0===o||o.focus():null===(r=p.current)||void 0===r||r.focus()}),[n,a,c,t,i]),C=(0,o.useCallback)((e=>{"Enter"===e.key&&b(e)}),[b]),E=(0,o.useCallback)((()=>{t(s.V.GeneralMenu),i(""),c("")}),[i,t,c]),I=(0,o.useCallback)(((e,t)=>{m(e),e&&t&&i(t)}),[i]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-3 mt-1 flex items-center px-3",children:[(0,r.jsx)(h.Z,{icon:"arrow-left",title:"Go back",className:"mr-2 flex p-0 text-neutral",onClick:E,focusable:!0}),(0,r.jsx)("div",{className:"text-base font-bold",children:"Create account"})]}),(0,r.jsxs)("form",{onSubmit:b,className:"mb-1 px-3",children:[(0,r.jsx)(y.Z,{className:{container:"mb-2"},disabled:g,left:[(0,r.jsx)(d.Z,{type:"email",className:"text-neutral"})],onChange:v,onKeyDown:C,placeholder:"Email",ref:p,type:"email",value:n,spellcheck:!1}),(0,r.jsx)(u.Z,{className:{container:"mb-2"},left:[(0,r.jsx)(d.Z,{type:"password",className:"text-neutral"})],onChange:A,onKeyDown:C,placeholder:"Password",ref:f,value:a}),(0,r.jsx)(l.Z,{className:"mt-1",label:"Next",primary:!0,onClick:b,fullWidth:!0})]}),(0,r.jsx)(S.Z,{classes:"my-2"}),(0,r.jsx)(w,{onPrivateUsernameModeChange:I})]})}));var E=n(20896),I=n(37211),_=n(88450),x=n(49258),P=n(27055),k=n(97638);const B=(0,i.Pi)((e=>{let{mainApplicationGroup:t}=e;const n=(0,o.useRef)(null),[i,s]=(0,o.useState)(!1),a=(0,o.useCallback)((()=>{s((e=>!e))}),[]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(I.Z,{tabIndex:_.HF,ref:n,onClick:a,className:"justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(d.Z,{type:"user-switch",className:"mr-2 text-neutral ".concat(k.t)}),"Switch workspace"]}),(0,r.jsx)(d.Z,{type:"chevron-right",className:"text-neutral ".concat(k.t)})]}),(0,r.jsx)(P.Z,{title:"Switch workspace",align:"end",anchorElement:n,className:"pb-2",open:i,side:"right",togglePopover:a,children:(0,r.jsx)(x.Z,{mainApplicationGroup:t})})]})}));var O=n(93632),N=n(41707),D=n(38403),j=n(84075),T=n(68242);const M="text-neutral mr-2 ".concat(k.t),F=(0,i.Pi)((e=>{let{setMenuPane:t,closeMenu:n,mainApplicationGroup:i}=e;const l=(0,p.I)(),[c,u]=(0,o.useState)(!1),[h,f]=(0,o.useState)((0,O.Bt)(l.sync.getLastSyncDate())),m=(0,o.useCallback)((async()=>{u(!0),l.sync.sync({queueStrategy:g.SyncQueueStrategy.ForceSpawnNew,checkIntegrity:!0}).then((e=>{if(e&&e.error)throw new Error;f((0,O.Bt)(l.sync.getLastSyncDate()))})).catch((()=>{l.alerts.alert(a.zR).catch(console.error)})).finally((()=>{u(!1)}))}),[l]),y=(0,o.useMemo)((()=>l.sessions.getUser()),[l]),v=(0,o.useCallback)((()=>{l.accountMenuController.closeAccountMenu(),l.preferencesController.setCurrentPane("account"),l.preferencesController.openPreferences()}),[l]),A=(0,o.useCallback)((()=>{l.accountMenuController.closeAccountMenu(),l.preferencesController.setCurrentPane("help-feedback"),l.preferencesController.openPreferences()}),[l]),b=(0,o.useCallback)((()=>{const e="App Version: ".concat(l.version);l.device.openUrl("mailto:help@standardnotes.com?subject=".concat(encodeURIComponent("Standard Notes Feedback"),"&body=").concat(encodeURIComponent(e)))}),[l.device,l.version]),w=(0,o.useCallback)((()=>{l.accountMenuController.setSigningOut(!0)}),[l]),S=(0,o.useCallback)((()=>{t(s.V.Register)}),[t]),C=(0,o.useCallback)((()=>{t(s.V.SignIn)}),[t]),_=(0,o.useMemo)((()=>l.keyboardService.keyboardShortcutForCommand(j.ZL)),[l.keyboardService]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-1 mt-1 hidden items-center justify-between px-4 md:flex md:px-3",children:[(0,r.jsx)("div",{className:"text-lg font-bold lg:text-base",children:"Account"}),(0,r.jsx)("div",{className:"flex cursor-pointer",onClick:n,children:(0,r.jsx)(d.Z,{type:"close",className:"text-neutral"})})]}),y?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-3 px-4 text-lg text-foreground md:px-3 lg:text-sm",children:[(0,r.jsx)("div",{children:"You're signed in as:"}),(0,r.jsx)("div",{className:"wrap my-0.5 font-bold",children:y.email}),(0,r.jsx)("span",{className:"text-neutral",children:l.getHost.execute().getValue()})]}),(0,r.jsxs)("div",{className:"mb-2 flex items-start justify-between px-4 text-mobile-menu-item md:px-3 md:text-tablet-menu-item lg:text-menu-item",children:[c?(0,r.jsxs)("div",{className:"flex items-center font-semibold text-info",children:[(0,r.jsx)(N.Z,{className:"mr-2 h-5 w-5"}),"Syncing..."]}):(0,r.jsxs)("div",{className:"flex items-start",children:[(0,r.jsx)(d.Z,{type:"check-circle",className:"mr-2 text-success ".concat(k.t)}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"font-semibold text-success",children:"Last synced:"}),(0,r.jsx)("div",{className:"text-text",children:h})]})]}),(0,r.jsx)("div",{className:"flex cursor-pointer text-passive-1",onClick:m,children:(0,r.jsx)(d.Z,{type:"sync",className:"".concat(k.t)})})]})]}):(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"mb-1 px-4 md:px-3",children:[(0,r.jsx)("div",{className:"mb-3 text-base text-foreground lg:text-sm",children:"You’re offline. Sign in to sync your notes and preferences across all your devices and enable end-to-end encryption."}),(0,r.jsxs)("div",{className:"flex items-center text-passive-1",children:[(0,r.jsx)(d.Z,{type:"cloud-off",className:"mr-2 ".concat(k.t)}),(0,r.jsx)("span",{className:"text-lg font-semibold lg:text-sm",children:"Offline"})]})]})}),(0,r.jsxs)(E.Z,{a11yLabel:"General account menu",closeMenu:n,initialFocus:l.hasAccount()?0:1,children:[(0,r.jsx)(D.Z,{className:"md:border-t md:pt-2",children:(0,r.jsx)(B,{mainApplicationGroup:i})}),(0,r.jsxs)(D.Z,{children:[y?(0,r.jsxs)(I.Z,{onClick:v,children:[(0,r.jsx)(d.Z,{type:"user",className:M}),"Account settings"]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(I.Z,{onClick:S,children:[(0,r.jsx)(d.Z,{type:"user",className:M}),"Create free account"]}),(0,r.jsxs)(I.Z,{onClick:C,children:[(0,r.jsx)(d.Z,{type:"signIn",className:M}),"Sign in"]})]}),(0,r.jsxs)(I.Z,{onClick:()=>{l.importModalController.setIsVisible(!0),l.accountMenuController.closeAccountMenu()},children:[(0,r.jsx)(d.Z,{type:"archive",className:M}),"Import"]}),l.isNativeMobileWeb()&&(0,r.jsxs)(I.Z,{onClick:b,children:[(0,r.jsx)(d.Z,{type:"email-filled",className:M}),"Email us"]}),(0,r.jsxs)(I.Z,{className:"justify-between",onClick:A,children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(d.Z,{type:"help",className:M}),"Help & feedback"]}),(0,r.jsxs)("span",{className:"text-neutral",children:["v",l.version]})]}),!(0,j.an)(l.platform)&&(0,r.jsxs)(I.Z,{onClick:()=>{l.keyboardService.triggerCommand(j.ZL)},children:[(0,r.jsx)(d.Z,{type:"keyboard",className:M}),"Keyboard shortcuts",_&&(0,r.jsx)(T.J,{shortcut:_,className:"ml-auto"})]})]}),y?(0,r.jsx)(D.Z,{children:(0,r.jsxs)(I.Z,{onClick:w,children:[(0,r.jsx)(d.Z,{type:"signOut",className:M}),"Sign out workspace"]})}):null]})]})})),R=(0,i.Pi)((e=>{let{setMenuPane:t}=e;const n=(0,p.I)(),{notesAndTagsCount:i}=n.accountMenuController,[a,m]=(0,o.useState)(""),[A,b]=(0,o.useState)(""),[C,E]=(0,o.useState)(""),[I,_]=(0,o.useState)(""),[x,P]=(0,o.useState)(!1),[k,B]=(0,o.useState)(!1),[O,N]=(0,o.useState)(!1),[D,j]=(0,o.useState)(!0),[T,M]=(0,o.useState)(!1),[F,R]=(0,o.useState)(!1),[L,Q]=(0,o.useState)(""),[U,V]=(0,o.useState)(!1),[K,H]=(0,o.useState)(""),G=(0,f.m)(L,(e=>{H(e),V(!1),Q("")})),Y=(0,o.useRef)(null),z=(0,o.useRef)(null);(0,o.useEffect)((()=>{var e;(null==Y?void 0:Y.current)&&(null===(e=Y.current)||void 0===e||e.focus()),v.r8&&window.devAccountEmail&&(m(window.devAccountEmail),b(window.devAccountPassword))}),[]);const Z=(0,o.useCallback)((()=>{I.length&&_("")}),[_,I]),W=(0,o.useCallback)((e=>{m(e)}),[]),q=(0,o.useCallback)((e=>{I.length&&_(""),b(e)}),[b,I]),J=(0,o.useCallback)((()=>{P(!x)}),[x]),X=(0,o.useCallback)((()=>{B(!k)}),[k]),$=(0,o.useCallback)(((e,t)=>{R(e),e&&t&&E(t)}),[E]),ee=(0,o.useCallback)((()=>{j(!D)}),[D]),te=(0,o.useCallback)((()=>{var e,t;N(!0),null===(e=null==Y?void 0:Y.current)||void 0===e||e.blur(),null===(t=null==z?void 0:z.current)||void 0===t||t.blur(),n.signIn(a,A,k,x,D,!1,K).then((e=>{const t=(0,g.getCaptchaHeader)(e);if(t&&Q(t),(0,g.isErrorResponse)(e))throw new Error((0,g.getErrorFromErrorResponse)(e).message);n.accountMenuController.closeAccountMenu()})).catch((e=>{var t,n;console.error(e),_(null!==(t=e.message)&&void 0!==t?t:e.toString()),b(""),H(""),null===(n=null==z?void 0:z.current)||void 0===n||n.blur()})).finally((()=>{N(!1)}))}),[n,a,K,x,k,A,D]),ne=(0,o.useCallback)((()=>{var e,t;N(!0),null===(e=null==Y?void 0:Y.current)||void 0===e||e.blur(),null===(t=null==z?void 0:z.current)||void 0===t||t.blur(),n.signInWithRecoveryCodes.execute({recoveryCodes:C,username:a,password:A,hvmToken:K}).then((e=>{if(e.isFailed()){const t=e.getError();try{const e=JSON.parse(t);if(e.captchaURL)return void Q(e.captchaURL)}catch(e){Q("")}throw new Error(t)}n.accountMenuController.closeAccountMenu()})).catch((e=>{var t,n;console.error(e),_(null!==(t=e.message)&&void 0!==t?t:e.toString()),b(""),H(""),null===(n=null==z?void 0:z.current)||void 0===n||n.blur()})).finally((()=>{N(!1)}))}),[n.accountMenuController,n.signInWithRecoveryCodes,a,K,A,C]),re=(0,o.useCallback)(((e,t)=>{M(e),e&&t&&m(t)}),[m]),ie=(0,o.useCallback)((()=>{var e,t;a&&0!==a.length?A&&0!==A.length?F?ne():te():null===(t=null==z?void 0:z.current)||void 0===t||t.focus():null===(e=null==Y?void 0:Y.current)||void 0===e||e.focus()}),[a,F,A,ne,te]),oe=(0,o.useCallback)((e=>{e.preventDefault(),L?V(!0):ie()}),[L,ie]),se=(0,o.useCallback)((e=>{"Enter"===e.key&&oe(e)}),[oe]);(0,o.useEffect)((()=>{K&&ie()}),[K,ie]);const ae=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-1 px-3",children:[(0,r.jsx)(y.Z,{className:{container:"mb-2 ".concat(I?"border-danger":null)},left:[(0,r.jsx)(d.Z,{type:"email",className:"text-neutral"})],type:"email",placeholder:"Email",value:a,onChange:W,onFocus:Z,onKeyDown:se,disabled:O||T,ref:Y,spellcheck:!1}),(0,r.jsx)(u.Z,{className:{container:"mb-2 ".concat(I?"border-danger":null)},disabled:O,left:[(0,r.jsx)(d.Z,{type:"password",className:"text-neutral"})],onChange:q,onFocus:Z,onKeyDown:se,placeholder:"Password",ref:z,value:A}),I?(0,r.jsx)("div",{className:"my-2 text-danger",children:I}):null,(0,r.jsx)(l.Z,{className:"mb-3 mt-1",label:O?"Signing in...":"Sign in",primary:!0,onClick:oe,disabled:O,fullWidth:!0}),(0,r.jsx)(c,{name:"is-ephemeral",label:"Stay signed in",checked:!x,disabled:O||F,onChange:J}),i>0?(0,r.jsx)(c,{name:"should-merge-local",label:"Merge local data (".concat(i," notes and tags)"),checked:D,disabled:O,onChange:ee}):null]}),(0,r.jsx)(S.Z,{classes:"my-2"}),(0,r.jsx)(w,{disabled:O,onPrivateUsernameModeChange:re,onStrictSignInChange:X,onRecoveryCodesChange:$})]});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-3 mt-1 flex items-center px-3",children:[(0,r.jsx)(h.Z,{icon:"arrow-left",title:"Go back",className:"mr-2 flex p-0 text-neutral",onClick:()=>t(s.V.GeneralMenu),focusable:!0,disabled:O}),(0,r.jsx)("div",{className:"text-base font-bold",children:U?"Human verification":"Sign in"})]}),U?(0,r.jsx)("div",{className:"p-[10px]",children:G}):ae]})})),L=(0,i.Pi)((e=>{let{menuPane:t,setMenuPane:n,closeMenu:i,mainApplicationGroup:a}=e;const[l,c]=(0,o.useState)(""),[u,d]=(0,o.useState)("");switch(t){case s.V.GeneralMenu:return(0,r.jsx)(F,{mainApplicationGroup:a,setMenuPane:n,closeMenu:i});case s.V.SignIn:return(0,r.jsx)(R,{setMenuPane:n});case s.V.Register:return(0,r.jsx)(C,{setMenuPane:n,email:l,setEmail:c,password:u,setPassword:d});case s.V.ConfirmPassword:return(0,r.jsx)(m,{setMenuPane:n,email:l,password:u})}}))},49258:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var r=n(52322),i=n(29894),o=n(34309),s=n(2784),a=n(47931),l=n(20896),c=n(37211),u=n(84075),d=n(77059);const h=e=>{let{descriptor:t,onClick:n,onDelete:i,renameDescriptor:o,hideOptions:l}=e;const[c,h]=(0,s.useState)(!1),[p,f]=(0,s.useState)(t.label),g=(0,s.useRef)(null),m=(0,s.useRef)(null);(0,s.useEffect)((()=>{var e;c&&(null===(e=m.current)||void 0===e||e.focus())}),[c]);const y=(0,s.useCallback)((e=>{f(e.target.value)}),[]),v=(0,s.useCallback)((e=>{var t;e.key!==u.u8.Enter&&e.key!==u.u8.Escape||(e.preventDefault(),e.stopPropagation(),null===(t=g.current)||void 0===t||t.focus())}),[]),A=(0,s.useCallback)((()=>{o(p),h(!1)}),[p,o]);return(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(d.Z,{ref:g,className:"overflow-hidden",onClick:n,checked:t.primary,children:(0,r.jsxs)("div",{className:"ml-2 flex w-full items-center justify-between gap-3 overflow-hidden",children:[!c&&(0,r.jsx)("div",{className:"overflow-hidden text-ellipsis",children:t.label}),t.primary&&!l&&(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("a",{role:"button",className:"flex h-5 w-5 cursor-pointer items-center justify-center border-0 bg-transparent p-0 hover:bg-contrast",onClick:e=>{e.stopPropagation(),h((e=>!e))},children:(0,r.jsx)(a.Z,{type:"pencil",className:"text-neutral",size:"medium"})}),(0,r.jsx)("a",{role:"button",className:"flex h-5 w-5 cursor-pointer items-center justify-center border-0 bg-transparent p-0 hover:bg-contrast",onClick:e=>{e.stopPropagation(),i()},children:(0,r.jsx)(a.Z,{type:"trash",className:"text-danger",size:"medium"})})]})]})}),c&&(0,r.jsx)("input",{ref:m,type:"text",value:p,onChange:y,onKeyDown:v,onBlur:A,onClick:e=>e.stopPropagation(),className:"absolute left-11 top-1/2 -translate-y-1/2 bg-default"})]})};var p=n(48518),f=n(38403);const g=(0,o.Pi)((e=>{let{mainApplicationGroup:t,hideWorkspaceOptions:n=!1}=e;const o=(0,p.I)(),[u,d]=(0,s.useState)(t.getDescriptors());(0,s.useEffect)((()=>{const e=t.getDescriptors();d(e);const n=t.addEventObserver((e=>{if(e===i.ApplicationGroupEvent.DescriptorsDataChanged){const e=t.getDescriptors();d(e)}}));return()=>{n()}}),[t]);const g=(0,s.useCallback)((async()=>{await o.alerts.confirm("Are you sure you want to sign out of all workspaces on this device?",void 0,"Sign out all",i.ButtonType.Danger)&&t.signOutAllWorkspaces().catch(console.error)}),[t,o]),m=(0,s.useCallback)((()=>{o.accountMenuController.setSigningOut(!0)}),[o]),y=(0,s.useCallback)((async e=>{t.unloadCurrentAndActivateDescriptor(e)}),[t]),v=(0,s.useCallback)((async()=>{t.unloadCurrentAndCreateNewDescriptor()}),[t]);return(0,r.jsxs)(l.Z,{a11yLabel:"Workspace switcher menu",className:"focus:shadow-none",children:[(0,r.jsx)(f.Z,{children:u.map((e=>(0,r.jsx)(h,{descriptor:e,hideOptions:n,onDelete:m,onClick:()=>y(e),renameDescriptor:n=>t.renameDescriptor(e,n)},e.identifier)))}),(0,r.jsxs)(f.Z,{children:[(0,r.jsxs)(c.Z,{onClick:v,children:[(0,r.jsx)(a.Z,{type:"user-add",className:"mr-2 text-neutral"}),"Add another workspace"]}),!n&&(0,r.jsxs)(c.Z,{onClick:g,children:[(0,r.jsx)(a.Z,{type:"signOut",className:"mr-2 text-neutral"}),"Sign out all workspaces"]})]})]})}))},48518:(e,t,n)=>{"use strict";n.d(t,{I:()=>a,Z:()=>c});var r=n(52322),i=n(2784),o=n(34309);const s=(0,i.createContext)(void 0),a=()=>{const e=(0,i.useContext)(s);if(!e)throw new Error("Component must be a child of <ApplicationProvider />");return e},l=(0,i.memo)((e=>{let{children:t}=e;return(0,r.jsx)(r.Fragment,{children:t})})),c=(0,o.Pi)((e=>{let{application:t,children:n}=e;return(0,r.jsx)(s.Provider,{value:t,children:(0,r.jsx)(l,{children:n})})}))},87978:(e,t,n)=>{"use strict";var r;n.d(t,{d:()=>r}),function(e){e[e.AttachFileToNote=0]="AttachFileToNote",e[e.DetachFileToNote=1]="DetachFileToNote",e[e.DeleteFile=2]="DeleteFile",e[e.DownloadFile=3]="DownloadFile",e[e.RenameFile=4]="RenameFile",e[e.ToggleFileProtection=5]="ToggleFileProtection",e[e.PreviewFile=6]="PreviewFile"}(r||(r={}))},756:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d,c:()=>c});var r=n(52322),i=n(2784);const o=["primary","label","className","colorStyle","disabled","children","fullWidth","small","rounded"];function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const c=e=>{switch(e){case"default":return"bg-default text-foreground";case"contrast":return"bg-contrast text-text";case"neutral":return"bg-neutral text-neutral-contrast";case"info":return"bg-info text-info-contrast";case"warning":return"bg-warning text-warning-contrast";case"danger":return"bg-danger text-danger-contrast";case"success":return"bg-success text-success-contrast"}},u=(e,t,n,r,i,o)=>{const s=e?"no-border":"border-solid border-border border",a=n?"cursor-not-allowed":"cursor-pointer",l=r?"w-full":"w-fit",u=i?"px-3 py-1.5":"px-4 py-1.5",d=i?"text-sm lg:text-xs":"text-base lg:text-sm",h=o?"rounded":"";let p=e?c(t):(e=>{switch(e){case"default":return"bg-normal-button text-text";case"contrast":return"bg-normal-button text-contrast";case"neutral":return"bg-normal-button text-neutral";case"info":return"bg-normal-button text-info";case"warning":return"bg-normal-button text-warning";case"danger":return"bg-normal-button text-danger";case"success":return"bg-normal-button text-success"}})(t),f=e?"hover:brightness-125 focus:outline-none focus-visible:brightness-125":"focus:bg-contrast focus:outline-none hover:bg-contrast";return n&&(p=e?"bg-passive-2 text-info-contrast":"bg-default text-passive-2",f=e?"focus:brightness-100 focus:outline-none hover:brightness-100":"focus:bg-default focus:outline-none hover:bg-default"),"".concat(h," font-bold select-none ").concat(l," ").concat(u," ").concat(d," ").concat(p," ").concat(s," ").concat(f," ").concat(a)},d=(0,i.forwardRef)(((e,t)=>{let{primary:n=!1,label:i,className:s="",colorStyle:l=(n?"info":"default"),disabled:c=!1,children:d,fullWidth:h,small:p,rounded:f=!0}=e,g=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,o);return(0,r.jsx)("button",a(a({type:"button",className:"".concat(u(n,l,c,h,p,f)," ").concat(s),disabled:c,ref:t},g),{},{children:null!=i?i:d}))}))},99456:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(52322),i=n(47931);const o=e=>{let{onClick:t,className:n="",icon:o,title:s,focusable:a,iconClassName:l="",disabled:c=!1}=e;const u=a?"":"focus:shadow-none";return(0,r.jsx)("button",{type:"button",title:s,className:"no-border flex cursor-pointer flex-row items-center bg-transparent ".concat(u," ").concat(n),onClick:e=>{e.preventDefault(),t(e)},disabled:c,"aria-label":s,children:(0,r.jsx)(i.Z,{type:o,className:l})})}},79021:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var r=n(52322),i=n(2784),o=n(47931),s=n(87901),a=n(75711);const l=["onClick","className","icon","iconClassName","iconProps","id","label"];function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const h=(0,i.forwardRef)(((e,t)=>{let{onClick:n,className:i,icon:c,iconClassName:d,iconProps:h,id:p,label:f}=e,g=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,l);return(0,r.jsx)(a.Z,{label:f,children:(0,r.jsx)("button",u(u({className:(0,s.classNames)("bg-text-padding m-0 flex h-10 min-w-10 cursor-pointer items-center justify-center rounded-full border","border-solid border-border bg-clip-padding text-neutral hover:bg-contrast hover:text-text focus:bg-contrast","focus:text-text focus:outline-none focus:ring-info md:h-8 md:min-w-8",i),onClick:e=>{e.preventDefault(),n(e)},ref:t,id:p,"aria-label":f},g),{},{children:(0,r.jsx)(o.Z,u(u({},h),{},{type:c,className:d}))}))})}))},44783:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c,o:()=>a});var r=n(52322),i=n(2784),o=n(34309);const s=(0,i.createContext)(void 0),a=()=>{const e=(0,i.useContext)(s);if(!e)throw new Error("Component must be a child of <CommandServiceProvider />");return e},l=(0,i.memo)((e=>{let{children:t}=e;return(0,r.jsx)(r.Fragment,{children:t})})),c=(0,o.Pi)((e=>{let{service:t,children:n}=e;return(0,r.jsx)(s.Provider,{value:t,children:(0,r.jsx)(l,{children:n})})}))},37658:(e,t,n)=>{"use strict";n.d(t,{Z:()=>S});var r=n(52322),i=n(47931),o=n(29894),s=n(54425),a=n(9460),l=n(45010),c=n(48104),u=n(70604),d=n(81548),h=(0,l.Bi)((e=>{var t=e,{store:n}=t,r=(0,u.S0)(t,["store"]);const i=(0,a.ht)();n=n||i,(0,d.kG)(n,!1);const o=(0,c.Me)(r.id),s=r.onClick,l=(0,c.zX)((e=>{null==s||s(e),e.defaultPrevented||queueMicrotask((()=>{const e=null==n?void 0:n.getState().selectElement;null==e||e.focus(),null==e||e.click()}))}));return(0,u.EZ)((0,u.ih)({id:o},r),{ref:(0,c.qq)(n.setLabelElement,r.ref),onClick:l,style:(0,u.ih)({cursor:"default"},r.style)})})),p=(0,l.W5)((e=>{const t=h(e);return(0,l.az)("div",t)})),f=n(2363),g=n(25729),m=n(83222),y=n(56278),v=(0,l.Bi)((e=>{var t=e,{store:n,alwaysVisible:r}=t,i=(0,u.S0)(t,["store","alwaysVisible"]);const o=(0,a.ht)();return n=n||o,i=(0,g.m)((0,u.ih)({store:n,alwaysVisible:r},i)),(0,m.S)((0,u.ih)({store:n,alwaysVisible:r},i))})),A=(0,y.L5)((0,l.LM)((e=>{const t=v(e);return(0,l.az)("div",t)})),a.ht),b=n(57996),w=n(84075);const S=e=>{let{label:t,value:n,onChange:a,items:l,disabled:c,fullWidth:u,classNameOverride:d={},popoverPlacement:h,showLabel:g}=e;var m;const y=(0,s.I)({value:n,setValue:a,placement:h||"top"}),v=y.useState("open"),S=l.find((e=>e.value===n));return(0,r.jsxs)("div",{className:d.wrapper,onKeyDown:e=>{e.key===w.u8.Escape&&(e.stopPropagation(),y.toggle())},children:[(0,r.jsx)(p,{className:g?"":"sr-only",store:y,children:t}),(0,r.jsxs)(f.P,{className:(0,o.classNames)("flex w-full min-w-55 items-center justify-between rounded border border-passive-3 bg-default px-3.5 py-1.5 text-sm text-foreground md:translucent-ui:bg-transparent",c&&"opacity-50",d.button,!u&&"md:w-fit"),store:y,disabled:c,children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(null==S?void 0:S.icon)?(0,r.jsx)("div",{className:"mr-2 flex",children:(0,r.jsx)(i.Z,{type:S.icon,className:null!==(m=S.iconClassName)&&void 0!==m?m:"",size:"small"})}):null,(0,r.jsx)("div",{className:"text-base lg:text-sm",children:null==S?void 0:S.label})]}),(0,r.jsx)(i.Z,{type:"chevron-down",size:"normal",className:v?"rotate-180":""})]}),(0,r.jsx)(A,{store:y,className:(0,o.classNames)("z-dropdown-menu max-h-[var(--popover-available-height)] w-[var(--popover-anchor-width)] overflow-y-auto rounded border border-passive-3 bg-default py-1 [backdrop-filter:var(--popover-backdrop-filter)]",d.popover),portal:!1,children:l.map((e=>{var t;return(0,r.jsxs)(b.Q,{className:"group flex cursor-pointer items-center bg-transparent px-3 py-1.5 text-sm text-text hover:bg-contrast hover:text-foreground [&[data-active-item]]:bg-info [&[data-active-item]]:text-info-contrast",value:e.value,disabled:e.disabled,children:[e.icon?(0,r.jsx)("div",{className:"mr-3 flex",children:(0,r.jsx)(i.Z,{type:e.icon,className:null!==(t=e.iconClassName)&&void 0!==t?t:"",size:"small"})}):null,(0,r.jsx)("div",{className:"text-base lg:text-sm",children:e.label})]},e.value)}))})]})}},25281:(e,t,n)=>{"use strict";n.d(t,{Z:()=>E});var r=n(52322),i=n(24118),o=n(29894),s=n(2784),a=n(41707),l=n(2577),c=n(87978),u=n(756);const d=e=>{let{file:t,filesController:n,isFilePreviewable:i,tryAgainCallback:o}=e;return(0,r.jsxs)("div",{className:"flex flex-grow flex-col items-center justify-center",children:[(0,r.jsx)(l.NoPreviewIllustration,{className:"mb-4 h-30 w-30"}),(0,r.jsx)("div",{className:"mb-2 text-base font-bold",children:"This file can't be previewed."}),i?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"mb-4 max-w-[35ch] text-center text-sm text-passive-0",children:"There was an error loading the file. Try again, or download the file and open it using another application."}),(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(u.Z,{primary:!0,className:"mr-3",onClick:()=>{o()},children:"Try again"}),(0,r.jsx)(u.Z,{onClick:()=>{n.handleFileAction({type:c.d.DownloadFile,payload:{file:t}}).catch(console.error)},children:"Download"})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"mb-4 max-w-[35ch] text-center text-sm text-passive-0",children:"To view this file, download it and open it using another application."}),(0,r.jsx)(u.Z,{primary:!0,onClick:()=>{n.handleFileAction({type:c.d.DownloadFile,payload:{file:t}}).catch(console.error)},children:"Download"})]})]})},h=["text/plain","text/csv","application/json"],p=["application/pdf"];var f=n(99456);function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function y(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const v=e=>{let{objectUrl:t,isEmbeddedInSuper:n,imageZoomLevel:i,setImageZoomLevel:a}=e;const[l,c]=(0,s.useState)(0),[u,d]=(0,s.useState)(0),[h,p]=(0,s.useState)(i||100),[g,y]=(0,s.useState)(!1);(0,s.useEffect)((()=>{p(i||100)}),[i]);const v=(0,s.useCallback)((e=>{p(e),null==a||a(e)}),[a]);(0,s.useEffect)((()=>{const e=new Image;e.src=t,e.onload=()=>{c(e.width),d(e.height)}}),[t]);const A=l*(h/100);return(0,r.jsxs)("div",{className:"group relative flex h-full min-h-0 w-full items-center justify-center",children:[(0,r.jsx)("div",{className:"relative flex h-full w-full items-center justify-center overflow-auto",style:{width:n?"".concat(A,"px"):"",aspectRatio:n?"".concat(l," / ").concat(u):""},children:(0,r.jsx)("img",{src:t,style:m({height:n?"100%":"".concat(h,"%")},n?{}:h<=100?{minWidth:"100%",objectFit:"contain"}:{position:"absolute",top:0,left:0,margin:"auto",maxWidth:"none"})})}),(0,r.jsxs)("div",{className:(0,o.classNames)(n?"hidden focus-within:flex group-hover:flex":"","absolute bottom-6 left-1/2 flex -translate-x-1/2 items-center rounded border border-solid border-border bg-default px-3 py-1"),children:[(0,r.jsxs)("span",{className:"mr-1.5",children:[n?"Size":"Zoom",":"]}),(0,r.jsx)(f.Z,{className:"rounded p-1 hover:bg-contrast",icon:"subtract",title:n?"Decrease size":"Zoom Out",focusable:!0,onClick:()=>{const e=h-10;v(e>=10?e:h)}}),g?(0,r.jsxs)("div",{className:"mx-2",children:[(0,r.jsx)("input",{type:"number",className:"w-10 bg-default text-center",defaultValue:h,onKeyDown:e=>{if(e.stopPropagation(),"Enter"===e.key){const t=parseInt(e.currentTarget.value);t>=10&&t<=1e3&&v(t),y(!1)}},onBlur:e=>{y(!1);const t=parseInt(e.currentTarget.value);t>=10&&t<=1e3&&v(t)}}),"%"]}):(0,r.jsxs)("button",{className:"mx-1 rounded px-1.5 py-1 hover:bg-contrast",onClick:()=>y((e=>!e)),children:[h,"%"]}),(0,r.jsx)(f.Z,{className:"rounded p-1 hover:bg-contrast",icon:"add",title:n?"Increase size":"Zoom In",focusable:!0,onClick:()=>{v(h+10)}})]})]})};var A=n(72435);const b=e=>{let{bytes:t}=e;const n=(0,s.useMemo)((()=>(new TextDecoder).decode(t)),[t]);return(0,r.jsx)("textarea",{autoComplete:"off",className:"font-editor h-full w-full flex-grow focus:shadow-none focus:outline-none",dir:"auto",id:A.N.FileTextPreview,defaultValue:n,readOnly:!0})};var w=n(87901);const S=e=>{let{file:t,filesController:n,objectUrl:i,isEmbeddedInSuper:o}=e;const[a,d]=(0,s.useState)(!1),[h,p]=(0,s.useState)(!1);return a?(0,r.jsxs)("div",{className:"flex flex-grow flex-col items-center justify-center",children:[(0,r.jsx)(l.NoPreviewIllustration,{className:"mb-4 h-30 w-30"}),(0,r.jsx)("div",{className:"mb-2 text-base font-bold",children:"This video can't be previewed."}),(0,r.jsx)("div",{className:"mb-4 max-w-[35ch] text-center text-sm text-passive-0",children:"To view this file, download it and open it using another application."}),(0,r.jsx)(u.Z,{primary:!0,onClick:()=>{n.handleFileAction({type:c.d.DownloadFile,payload:{file:t}}).catch(console.error)},children:"Download"})]}):h?(0,r.jsx)("video",{className:"h-full w-full",controls:!0,autoPlay:!0,src:i,onError:()=>{d(!0),p(!1)}}):(0,r.jsx)("video",{className:"h-full w-full",controls:!0,autoPlay:!o,onError:()=>{p(!0)},children:(0,r.jsx)("source",{src:i,type:t.mimeType})})},C=e=>{let{application:t,file:n,bytes:a,isEmbeddedInSuper:l,imageZoomLevel:c,setImageZoomLevel:d}=e;const f=(0,s.useRef)(),g=(0,s.useMemo)((()=>((e,t,n)=>{const r=URL.createObjectURL(new Blob([t],{type:e}));return n.current=r,r})(n.mimeType,a,f)),[a,n.mimeType]);(0,s.useEffect)((()=>{const e=f.current;return()=>{e&&(URL.revokeObjectURL(e),f.current="")}}),[]);const m=t.isNativeMobileWeb(),y=p.includes(n.mimeType),A=(0,s.useCallback)((async()=>{if(!m)throw new Error("Native file preview cannot be used on non-native platform");const e=await(0,i.cN)(new Blob([a],{type:n.mimeType})),{name:r,ext:o}=(0,w.parseFileName)(n.name),s=(0,w.sanitizeFileName)(r),l="".concat(s,".").concat(o);t.mobileDevice.previewFile(e,l)}),[t,a,n.mimeType,n.name,m]);if(m&&y)return(0,r.jsxs)("div",{className:"flex flex-grow flex-col items-center justify-center",children:[(0,r.jsx)("div",{className:"max-w-[30ch] text-center text-base font-bold",children:"This file can only be previewed in an external app"}),(0,r.jsx)(u.Z,{className:"mt-3",primary:!0,onClick:A,children:"Open file preview"})]});if(n.mimeType.startsWith("image/"))return(0,r.jsx)(v,{objectUrl:g,isEmbeddedInSuper:l,imageZoomLevel:c,setImageZoomLevel:d});if(n.mimeType.startsWith("video/"))return(0,r.jsx)(S,{file:n,filesController:t.filesController,objectUrl:g,isEmbeddedInSuper:l});if(n.mimeType.startsWith("audio/"))return(0,r.jsx)("div",{className:"flex h-full w-full items-center justify-center",children:(0,r.jsx)("audio",{src:g,controls:!0})});if(h.includes(n.mimeType))return(0,r.jsx)(b,{bytes:a});const C="application/pdf"===n.mimeType;return(0,r.jsx)("object",{className:(0,o.classNames)("h-full w-full",C&&"min-h-[65vh]"),data:C?g+"#view=FitV":g})},E=e=>{let{file:t,application:n,isEmbeddedInSuper:c=!1,imageZoomLevel:p,setImageZoomLevel:f}=e;const[g,m]=(0,s.useState)(n.isAuthorizedToRenderItem(t)),y=(0,s.useMemo)((()=>(e=>{const t=e.startsWith("image/"),n=e.startsWith("video/"),r=e.startsWith("audio/"),i="application/pdf"===e,o=h.includes(e);return!!(t||n||r||o||i)})(t.mimeType)),[t.mimeType]),[v,A]=(0,s.useState)(!0),[b,w]=(0,s.useState)(),[S,E]=(0,s.useState)();if((0,s.useEffect)((()=>{m(n.isAuthorizedToRenderItem(t))}),[t.protected,n,t]),(0,s.useEffect)((()=>n.addEventObserver((async e=>{e===o.ApplicationEvent.UnprotectedSessionBegan?m(!0):e===o.ApplicationEvent.UnprotectedSessionExpired&&m(n.isAuthorizedToRenderItem(t))}))),[n,t]),(0,s.useEffect)((()=>{if(!y||!g)return A(!1),w(void 0),void E(void 0);(async()=>{if(!S){A(!0);try{const e=[];if(w(void 0),!await n.files.downloadFile(t,(async(t,n)=>{e.push(t),n&&w(n)}))){const t=(0,i.Lf)(e);E(t)}}catch(e){console.error(e)}finally{A(!1)}}})()}),[n.files,S,t,y,g]),!g){const e=n.hasProtectionSources();return(0,r.jsxs)("div",{className:"flex flex-grow flex-col items-center justify-center",children:[(0,r.jsx)(l.ProtectedIllustration,{className:"mb-4 h-30 w-30"}),(0,r.jsx)("div",{className:"mb-2 text-base font-bold",children:"This file is protected."}),(0,r.jsx)("p",{className:"max-w-[35ch] text-center text-sm text-passive-0",children:e?"Authenticate to view this file.":"Add a passcode or create an account to require authentication to view this file."}),(0,r.jsxs)("div",{className:"mt-3 flex gap-3",children:[!e&&(0,r.jsx)(u.Z,{primary:!0,small:!0,onClick:()=>n.showAccountMenu(),children:"Open account menu"}),(0,r.jsx)(u.Z,{primary:!0,onClick:()=>n.protections.authorizeItemAccess(t),children:e?"Authenticate":"View file"})]})]})}return v?(0,r.jsxs)("div",{className:"flex flex-grow flex-col items-center justify-center",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(a.Z,{className:"mr-3 h-5 w-5"}),b&&(0,r.jsxs)("div",{className:"text-base font-semibold",children:[Math.floor(b.percentComplete),"%"]})]}),b?(0,r.jsx)("span",{className:"mt-3",children:(0,o.fileProgressToHumanReadableString)(b,t.name,{showPercent:!1})}):(0,r.jsx)("span",{className:"mt-3",children:"Loading..."})]}):S?(0,r.jsx)(C,{application:n,file:t,bytes:S,isEmbeddedInSuper:c,imageZoomLevel:p,setImageZoomLevel:f}):(0,r.jsx)(d,{file:t,filesController:n.filesController,tryAgainCallback:()=>{E(void 0)},isFilePreviewable:y})}},47931:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m,R:()=>g});var r=n(52322),i=n(62872),o=n(87901),s=n(2577);const a={"lexical-code":s.LexicalCode,"align-center":s.LexicalTextCenter,"align-justify":s.LexicalTextJustify,"align-left":s.LexicalTextLeft,"align-right":s.LexicalTextRight,"horizontal-rule":s.LexicalHorizontalRule,"list-ol":s.LexicalListOL,"list-ul":s.LexicalListUL,check:s.LexicalCheck,quote:s.LexicalQuote,table:s.LexicalTable,tweet:s.LexicalTweet,youtube:s.LexicalYoutube,paragraph:s.LexicalTextParagraph,h1:s.TypeH1,h2:s.TypeH2,h3:s.TypeH3,h4:s.TypeH4,h5:s.TypeH5,h6:s.TypeH6};function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u={small:"w-3.5 h-3.5",medium:"w-4 h-4",normal:"w-5 h-5",large:"w-6 h-6",custom:""},d={small:"w-4 h-4",medium:"w-5 h-5",normal:"w-5 h-5",large:"w-7 h-6",custom:""},h={small:"",medium:"",normal:"-mt-0.5",large:"",custom:""},p={small:"text-xs",medium:"text-sm",normal:"text-base",large:"text-lg",custom:""},f=e=>i.p[e]||a[e],g=e=>null==f(e),m=e=>{let{type:t,className:n="",ariaLabel:i,size:s="normal",emojiSize:a}=e;const g=f(t);return g?(0,r.jsx)(g,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({className:"".concat(u[s]," fill-current ").concat(n),role:"img"},i?{"aria-label":i}:{"aria-hidden":!0})):(0,r.jsx)("label",{className:(0,o.classNames)("fill-current","text-center",p[a||s],d[a||s],h[a||s],n),children:t})}},62872:(e,t,n)=>{"use strict";n.d(t,{p:()=>i});var r=n(2577);const i={"account-circle":r.AccountCircleIcon,"align-center":r.FormatAlignCenterIcon,"align-justify":r.FormatAlignJustifyIcon,"align-left":r.FormatAlignLeftIcon,"align-right":r.FormatAlignRightIcon,"arrow-down":r.ArrowDownIcon,"arrow-left":r.ArrowLeftIcon,"arrow-right":r.ArrowRightIcon,"arrow-up":r.ArrowUpIcon,"arrows-sort-down":r.ArrowsSortDownIcon,"arrows-sort-up":r.ArrowsSortUpIcon,"arrows-vertical":r.ArrowsVerticalIcon,"attachment-file":r.AttachmentFileIcon,"caret-right":r.CaretRightIcon,"check-bold":r.CheckBoldIcon,"check-circle-filled":r.CheckCircleFilledIcon,"check-circle":r.CheckCircleIcon,"chevron-down":r.ChevronDownIcon,"chevron-left":r.ChevronLeftIcon,"chevron-right":r.ChevronRightIcon,"chevron-up":r.ChevronUpIcon,"clear-circle-filled":r.ClearCircleFilledIcon,"cloud-off":r.CloudOffIcon,"code-tags":r.CodeTagsIcon,"details-block":r.DetailsBlockIcon,"diamond-filled":r.DiamondFilledIcon,"email-filled":r.EmailFilledIcon,"eye-off":r.EyeOffIcon,"file-doc":r.FileDocIcon,"file-image":r.FileImageIcon,"file-mov":r.FileMovIcon,"file-music":r.FileMusicIcon,"file-other":r.FileOtherIcon,"file-pdf":r.FilePdfIcon,"file-ppt":r.FilePptIcon,"file-xls":r.FileXlsIcon,"file-zip":r.FileZipIcon,"format-align-center":r.FormatAlignCenterIcon,"format-align-justify":r.FormatAlignJustifyIcon,"format-align-left":r.FormatAlignLeftIcon,"format-align-right":r.FormatAlignRightIcon,"fullscreen-exit":r.FullscreenExitIcon,"hashtag-off":r.HashtagOffIcon,"keyboard-close":r.KeyboardCloseIcon,"line-width":r.LineWidthIcon,"link-off":r.LinkOffIcon,"list-bulleted":r.ListBulleted,"list-numbered":r.ListNumbered,"list-check":r.CheckListIcon,"lock-filled":r.LockFilledIcon,"menu-arrow-down-alt":r.MenuArrowDownAlt,"menu-arrow-down":r.MenuArrowDownIcon,"menu-arrow-right":r.MenuArrowRightIcon,"menu-close":r.MenuCloseIcon,"menu-variant":r.MenuVariantIcon,"notes-filled":r.NotesFilledIcon,"open-in":r.OpenInIcon,"pencil-filled":r.PencilFilledIcon,"pencil-off":r.PencilOffIcon,"pin-filled":r.PinFilledIcon,"plain-text":r.PlainTextIcon,"premium-feature":r.PremiumFeatureIcon,"rich-text":r.RichTextIcon,"safe-square":r.SafeSquareIcon,"select-all":r.SelectAllIcon,"sort-descending":r.SortDescendingIcon,"star-circle-filled":r.StarCircleFilled,"star-filled":r.StarFilledIcon,"star-variant-filled":r.StarVariantFilledIcon,"trash-filled":r.TrashFilledIcon,"trash-sweep":r.TrashSweepIcon,"user-add":r.UserAddIcon,"user-switch":r.UserSwitch,accessibility:r.AccessibilityIcon,add:r.AddIcon,aegis:r.AegisIcon,archive:r.ArchiveIcon,asterisk:r.AsteriskIcon,authenticator:r.AuthenticatorIcon,backspace:r.BackspaceIcon,bold:r.BoldIcon,camera:r.CameraIcon,check:r.CheckIcon,clock:r.ClockIcon,close:r.CloseIcon,code:r.CodeIcon,comment:r.FeedbackIcon,copy:r.CopyIcon,dashboard:r.DashboardIcon,diamond:r.DiamondIcon,download:r.DownloadIcon,drag:r.DragIcon,draw:r.DrawIcon,editor:r.EditorIcon,email:r.EmailIcon,evernote:r.EvernoteIcon,eye:r.EyeIcon,file:r.FileIcon,folder:r.FolderIcon,gkeep:r.GoogleKeepIcon,group:r.GroupIcon,hashtag:r.HashtagIcon,help:r.HelpIcon,history:r.HistoryIcon,image:r.ImageIcon,indent:r.IndentIcon,info:r.InfoIcon,italic:r.ItalicIcon,keyboard:r.KeyboardIcon,link:r.LinkIcon,listed:r.ListedIcon,lock:r.LockIcon,markdown:r.MarkdownIcon,merge:r.MergeIcon,more:r.MoreIcon,notes:r.NotesIcon,outdent:r.OutdentIcon,paragraph:r.TextParagraphLongIcon,password:r.PasswordIcon,pencil:r.PencilIcon,pin:r.PinIcon,redo:r.RedoIcon,restore:r.RestoreIcon,save:r.SaveIcon,search:r.SearchIcon,security:r.SecurityIcon,server:r.ServerIcon,settings:r.SettingsIcon,share:r.ShareIcon,signIn:r.SignInIcon,signOut:r.SignOutIcon,simplenote:r.SimplenoteIcon,spreadsheets:r.SpreadsheetsIcon,star:r.StarIcon,strikethrough:r.StrikethroughIcon,subscript:r.SubscriptIcon,subtract:r.SubtractIcon,superscript:r.SuperscriptIcon,sync:r.SyncIcon,tasks:r.TasksIcon,text:r.TextIcon,themes:r.ThemesIcon,trash:r.TrashIcon,tune:r.TuneIcon,toc:r.TableOfContentsIcon,unarchive:r.UnarchiveIcon,underline:r.UnderlineIcon,undo:r.UndoIcon,unpin:r.UnpinIcon,upload:r.UploadIcon,user:r.UserIcon,view:r.ViewIcon,warning:r.WarningIcon,window:r.WindowIcon}},73703:(e,t,n)=>{"use strict";n.d(t,{K:()=>i,_:()=>r});const r="asterisk",i="text-info group-disabled:text-passive-2"},13959:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(52322),i=n(87901),o=n(2784);const s=(0,o.forwardRef)(((e,t)=>{let{autocomplete:n=!1,spellcheck:s=!0,className:a,disabled:l=!1,id:c,left:u,onBlur:d,onChange:h,onFocus:p,onKeyDown:f,onKeyUp:g,onEnter:m,placeholder:y="",right:v,type:A="text",title:b,value:w,defaultValue:S,roundedFull:C,autofocus:E=!1}=e;const I=((e,t,n)=>({container:"position-relative flex items-stretch overflow-hidden border border-border translucent-ui:border-[--popover-border-color] bg-default translucent-ui:bg-transparent text-sm focus-within:ring-2 focus-within:ring-info bg-clip-padding ".concat(e||t?"":"px-2 py-1.5"," ").concat(n?"rounded-full":"rounded"),input:"focus:ring-none w-full border-0 bg-transparent text-text focus:shadow-none focus:outline-none ".concat(!e&&t?"pl-2":""," ").concat(t?"pr-2":""),disabled:"bg-passive-5 cursor-not-allowed"}))(Boolean(null==u?void 0:u.length),Boolean(null==v?void 0:v.length),C),_=(0,o.useCallback)((e=>{"Enter"===e.key&&(null==m||m()),null==g||g(e)}),[g,m]);return(0,r.jsxs)("div",{className:(0,i.classNames)(I.container,l?I.disabled:"",null==a?void 0:a.container),children:[u&&(0,r.jsx)("div",{className:(0,i.classNames)("flex items-center px-2 py-1.5",null==a?void 0:a.left),children:u.map(((e,t)=>(0,r.jsx)(o.Fragment,{children:e},t)))}),(0,r.jsx)("input",{autoComplete:n?"on":"off",autoFocus:E,className:"".concat(I.input," ").concat(l?I.disabled:""," ").concat(null==a?void 0:a.input),"data-lpignore":"password"!==A,disabled:l,id:c,onBlur:d,onChange:e=>h&&h(e.target.value),onFocus:p,onKeyDown:f,onKeyUp:_,placeholder:y,ref:t,title:b,type:A,value:w,defaultValue:S,spellCheck:s}),v&&(0,r.jsx)("div",{className:(0,i.classNames)("flex items-center px-2 py-1.5",null==a?void 0:a.right),children:v.map(((e,t)=>(0,r.jsx)("div",{className:t>0?"ml-3":"",children:e},t)))})]})}))},91467:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(52322),i=n(2784),o=n(13959),s=n(99456);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u=e=>{let{isToggled:t,setIsToggled:n}=e;return(0,r.jsx)(s.Z,{className:"h-5 w-5 justify-center rounded-full p-0 text-neutral hover:bg-passive-4",icon:t?"eye-off":"eye",iconClassName:"w-3.5 h-3.5",title:"Show/hide password",onClick:()=>n((e=>!e)),focusable:!0})},d=(0,i.forwardRef)(((e,t)=>{const[n,s]=(0,i.useState)(!1),a=e.right?[...e.right]:[];return(0,r.jsx)(o.Z,l(l({},e),{},{ref:t,type:n?"text":"password",right:[...a,(0,r.jsx)(u,{isToggled:n,setIsToggled:s})]}))}))},81959:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var r=n(52322),i=n(11032),o=n(23978),s=n(96332),a=n(32819),l=n(51626),c=n(60750),u=n(29894),d=n(34309),h=n(2784),p=n(48518),f=n(71881);const g=(0,d.Pi)((e=>{let{contentTypes:t,placeholder:n,onSelection:d,comboboxProps:g,className:m={}}=e;const y=(0,p.I)(),v=(0,o.R)(g),A=v.useState("value"),b=v.useState("open");(0,h.useEffect)((()=>{A.length<1&&b&&v.setOpen(!1)}),[v,b,A.length]);const w=(0,h.useDeferredValue)(A),[S,C]=(0,h.useState)([]);return(0,h.useEffect)((()=>{const e=(0,u.naturalSort)(y.items.getItems(t),"title").filter((e=>(0,i.f)(e,w,y)));C(e)}),[w,y,t]),(0,r.jsxs)("div",{children:[(0,r.jsx)(s.T,{children:"Select an item"}),(0,r.jsx)(a.h,{store:v,placeholder:n,className:(0,u.classNames)("h-7 w-70 bg-transparent text-sm text-text focus:border-b-2 focus:border-info focus:shadow-none focus:outline-none lg:text-xs",m.input)}),(0,r.jsx)(l.S,{store:v,className:(0,u.classNames)("z-dropdown-menu max-h-[var(--popover-available-height)] w-[var(--popover-anchor-width)] overflow-y-auto rounded bg-default py-2 shadow-main",m.popover),children:S.length>0?S.map((e=>(0,r.jsx)(c.l,{className:"flex w-full cursor-pointer items-center justify-between gap-4 overflow-hidden px-3 py-2 hover:bg-contrast hover:text-foreground [&[data-active-item]]:bg-info-backdrop",hideOnClick:!0,onClick:()=>{v.setValue(""),d(e)},children:(0,r.jsx)(f.Z,{item:e,searchQuery:w})},e.uuid))):(0,r.jsx)("div",{className:"px-2",children:"No results found"})})]})}))},68242:(e,t,n)=>{"use strict";n.d(t,{J:()=>a});var r=n(52322),i=n(29894),o=n(84075),s=n(2784);const a=e=>{let{shortcut:t,small:n=!0,dimmed:a=!0,className:l}=e;const c=(0,s.useMemo)((()=>{const e=t.modifiers||[],n=t.key?(0,o.zr)(t.key):t.code?(0,o.zr)(t.code):void 0,r=[];return e.forEach((e=>{r.push((0,o.Mn)(e,t.platform))})),n&&r.push(n),r}),[t]);return(0,o.an)(t.platform)?null:(0,r.jsx)("div",{className:(0,i.classNames)("flex items-center gap-1",a&&"opacity-70",l),children:c.map(((e,t)=>(0,r.jsx)("kbd",{className:(0,i.classNames)("rounded border-[0.5px] border-passive-3 bg-default p-1 text-center font-sans capitalize leading-none text-text shadow-[var(--tw-shadow-color)_0px_2px_0px_0px] shadow-passive-3",n?"text-[length:0.65rem]":"text-xs"),children:e},t)))})}},26013:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(52322),i=n(87901),o=n(84075),s=n(34309),a=n(2784),l=n(29894),c=n(47931),u=n(79323),d=n(48518),h=n(43426),p=n(11032);const f=(0,s.Pi)((e=>{let{link:t,activateItem:n,unlinkItem:s,focusPreviousItem:f,focusNextItem:g,focusedId:m,setFocusedId:y,isBidirectional:v,inlineFlex:A,className:b,readonly:w,wrappable:S}=e;const C=(0,a.useRef)(),E=(0,d.I)(),[I,_]=(0,a.useState)(!1),x=(0,a.useRef)(),[P,k]=(0,a.useState)(!1),B=()=>{m!==t.id&&(null==y||y(t.id)),_(!0)},O=()=>{_(!1),k(!1)},N=e=>{if(P&&e.target!==x.current){if(k(!1),w)return;null==n||n(t.item)}else k(!0)},D=e=>{e.stopPropagation(),s(t.item)},j=e=>{switch(e.key){case o.u8.Backspace:null==f||f(),s(t.item);break;case o.u8.Left:null==f||f();break;case o.u8.Right:null==g||g()}},[T,M]=(0,u.b)(t.item,E),F=(0,h.l)(t.item,E);return(0,a.useEffect)((()=>{var e;t.id===m&&(null===(e=C.current)||void 0===e||e.focus())}),[m,t.id]),S?(0,r.jsxs)("a",{ref:e=>C.current=e,tabIndex:0,className:(0,i.classNames)("group cursor-pointer rounded align-middle [&>*]:align-middle","bg-passive-4-opacity-variant outline-1 outline-info hover:bg-contrast focus:bg-contrast focus:outline","whitespace-pre-wrap text-left text-sm text-text hover:no-underline focus:no-underline lg:text-xs","py-1 pl-1 pr-2",b),onFocus:B,onBlur:O,onClick:N,title:F?F.longTitle:t.item.title,onKeyDown:j,children:[(0,r.jsx)(c.Z,{type:T,className:(0,i.classNames)("mr-1 inline",M),size:"small"}),F&&(0,r.jsx)("span",{className:"text-passive-1",children:F.titlePrefix}),"linked-by"===t.type&&t.item.content_type!==l.ContentType.TYPES.Tag&&(0,r.jsx)("span",{className:v?"":"hidden group-focus:inline",children:"Linked By:"}),(0,r.jsx)("span",{children:(0,p.R)(t.item)}),I&&!w&&(0,r.jsx)("button",{ref:e=>x.current=e,role:"button",className:"-mr-1 ml-2 inline-flex cursor-pointer border-0 bg-transparent p-0",onClick:D,children:(0,r.jsx)(c.Z,{type:"close",className:"text-neutral hover:text-info",size:"small"})})]}):(0,r.jsxs)("button",{ref:e=>C.current=e,className:(0,i.classNames)("group h-6 cursor-pointer items-center rounded bg-passive-4-opacity-variant py-2 pl-1 pr-2 align-middle text-sm","text-text hover:bg-contrast focus:bg-contrast lg:text-xs",A?"inline-flex":"flex",b),onFocus:B,onBlur:O,onClick:N,title:F?F.longTitle:t.item.title,onKeyDown:j,children:[(0,r.jsx)(c.Z,{type:T,className:(0,i.classNames)("mr-1 flex-shrink-0",M),size:"small"}),(0,r.jsxs)("span",{className:"flex items-center overflow-hidden overflow-ellipsis whitespace-nowrap",children:[F&&(0,r.jsx)("span",{className:"text-passive-1",children:F.titlePrefix}),(0,r.jsxs)("span",{className:"flex items-center gap-1",children:["linked-by"===t.type&&t.item.content_type!==l.ContentType.TYPES.Tag&&(0,r.jsx)("span",{className:v?"":"hidden group-focus:block",children:"Linked By:"}),(0,p.R)(t.item)]})]}),I&&!w&&(0,r.jsx)("a",{ref:e=>x.current=e,role:"button",className:"-mr-1 ml-2 flex cursor-pointer border-0 bg-transparent p-0",onClick:D,children:(0,r.jsx)(c.Z,{type:"close",className:"text-neutral hover:text-info",size:"small"})})]})}))},66743:(e,t,n)=>{"use strict";n.d(t,{Z:()=>D});var r=n(52322),i=n(34309),o=n(2784),s=n(87901),a=n(72435),l=n(90509),c=n(48518),u=n(29894),d=n(23978),h=n(96332),p=n(32819),f=n(51626),g=n(60750),m=n(71881),y=n(72604),v=n(20038),A=n(47931),b=n(73703),w=n(84075),S=n(7453);const C=(0,o.forwardRef)(((e,t)=>{let{linkingController:n,focusPreviousItem:i,focusedId:C,setFocusedId:E,hoverLabel:I,item:_}=e;const x=(0,c.I)(),{getLinkedTagsForItem:P,linkItems:k,createAndAddNewTag:B,isEntitledToNoteLinking:O}=n,N=P(_)||[],D=(0,d.R)(),j=D.useState("value"),T=(0,o.useDeferredValue)(j),{unlinkedItems:M,shouldShowCreateTag:F}=(0,l.Q)(T,x,_),R=(0,o.useRef)(null);return(0,o.useEffect)((()=>{var e;C===a.N.ItemLinkAutocompleteInput&&(null===(e=R.current)||void 0===e||e.focus())}),[C]),(0,r.jsx)("div",{children:(0,r.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),""!==T&&(await B(T),D.setValue(""))},children:[(0,r.jsxs)("label",{children:[(0,r.jsx)(h.T,{children:"Link tags, notes or files"}),(0,r.jsx)(p.h,{store:D,placeholder:"Link tags, notes, files...",className:(0,s.classNames)("".concat(N.length>0?"w-80":"mr-10 w-70"),"h-7 w-70 bg-transparent text-sm text-text focus:border-b-2 focus:border-info focus:shadow-none focus:outline-none lg:text-xs"),title:I,id:a.N.ItemLinkAutocompleteInput,ref:(0,S.l)([R,t]),onFocus:()=>{C!==a.N.ItemLinkAutocompleteInput&&E(a.N.ItemLinkAutocompleteInput)},onKeyDown:e=>{e.key===w.u8.Left&&0===T.length&&i()}})]}),(0,r.jsxs)(f.S,{store:D,className:(0,s.classNames)("z-dropdown-menu max-h-[var(--popover-available-height)] w-[var(--popover-anchor-width)] overflow-y-auto rounded bg-default py-2 shadow-main",0===M.length&&!F&&"hidden"),children:[M.map((e=>{const t=!O&&e instanceof u.SNNote;return(0,r.jsxs)(g.l,{className:"flex w-full cursor-pointer items-center justify-between gap-4 overflow-hidden px-3 py-2 hover:bg-contrast hover:text-foreground [&[data-active-item]]:bg-info-backdrop",hideOnClick:!0,onClick:()=>{k(_,e).catch(console.error),D.setValue("")},children:[(0,r.jsx)(m.Z,{item:e,searchQuery:T}),t&&(0,r.jsx)(A.Z,{type:b._,className:"ml-auto flex-shrink-0 text-info"})]},e.uuid)})),F&&(0,r.jsx)(g.l,{hideOnClick:!0,render:(0,r.jsx)(v.g7,{}),onClick:()=>{B(T),D.setValue("")},children:(0,r.jsx)(y.d,{searchQuery:T})})]})]})})})),E=(0,i.Pi)(C);var I=n(26013),_=n(74522),x=n(44783),P=n(20153),k=n(79021),B=n(69170),O=n(4160),N=n(16786);const D=(0,i.Pi)((e=>{let{item:t,linkingController:n,hideToggle:i=!1,readonly:l=!1,className:c={},isCollapsedByDefault:d=!0}=e;const{toggleAppPane:h}=(0,_.G)(),p=(0,x.o)(),{unlinkItems:f,activateItem:g}=n,m=(0,o.useCallback)((async e=>{f(t,e)}),[t,f]),{notesLinkedToItem:y,filesLinkedToItem:v,tagsLinkedToItem:A,notesLinkingToItem:b,filesLinkingToItem:S}=(0,P.f)(t),C=(0,o.useMemo)((()=>(new Array).concat(y,v,A)),[v,y,A]);(0,o.useEffect)((()=>p.addCommandHandler({command:w.qC,category:"Current note",description:"Link tags, notes, files",onKeyDown:()=>{const e=document.getElementById(a.N.ItemLinkAutocompleteInput);e&&e.focus()}})),[p]);const D=(0,o.useMemo)((()=>(0,w.Ld)(p.keyboardShortcutForCommand(w.qC))),[p]),[j,T]=(0,o.useState)(),M=C.map((e=>e.id)).concat(b.map((e=>e.id)),S.map((e=>e.id)),[a.N.ItemLinkAutocompleteInput]),F=(0,o.useCallback)((()=>{const e=M.findIndex((e=>e===j))-1;e>-1&&T(M[e])}),[M,j]),R=(0,o.useCallback)((()=>{const e=M.findIndex((e=>e===j))+1;e<M.length&&T(M[e])}),[M,j]),L=(0,o.useCallback)((async e=>{const t=await g(e);t&&h(t)}),[g,h]),Q=e=>{const t=!!C.find((t=>e.item.uuid===t.item.uuid)),n=!!b.find((t=>e.item.uuid===t.item.uuid)),r=!!S.find((t=>e.item.uuid===t.item.uuid));return t&&(e.item.content_type===u.ContentType.TYPES.Note?n:r)},U=C.concat(b).concat(S),[V,K]=(0,o.useState)(!(U.length<5)&&d),H=V?U.slice(0,5):U,G=U.length-H.length,[Y,z]=(0,o.useState)(!0),[Z,W]=(0,o.useState)(null);(0,o.useEffect)((()=>{const e=Z;if(!e)return;const t=new ResizeObserver((()=>{const t=e.firstElementChild;if(!t)return;const n=t.clientHeight+4,r=e.clientHeight>n;z(!!r)}));return t.observe(e),()=>{t.disconnect()}}),[Z]);const q=i||!Y&&!V,{vault:J,lastEditedByContact:X}=(0,N.j)(t);return l&&0===U.length&&!J?null:(0,r.jsxs)("div",{className:(0,s.classNames)("flex w-full flex-wrap justify-between md:flex-nowrap",U.length>0&&!q?"pt-2 "+c.withToggle:void 0,V?"gap-4":"gap-1",c.base),children:[(0,r.jsxs)("div",{className:(0,s.classNames)("note-view-linking-container flex min-w-80 max-w-full items-center gap-2 bg-transparent",C.length||b.length?"mt-1":"mt-0.5",V?"overflow-hidden":"flex-wrap",!q&&"mr-2"),ref:W,children:[!!J&&(0,r.jsx)(B.Z,{vault:J}),!!X&&(0,r.jsx)(O.Z,{contact:X}),H.map((e=>(0,r.jsx)(I.Z,{link:e,activateItem:L,unlinkItem:m,focusPreviousItem:F,focusNextItem:R,focusedId:j,setFocusedId:T,isBidirectional:Q(e),readonly:l},e.id))),V&&G>0&&(0,r.jsxs)("span",{className:"flex-shrink-0",children:["and ",G," more..."]}),!l&&(0,r.jsx)(E,{focusedId:j,linkingController:n,focusPreviousItem:F,setFocusedId:T,hoverLabel:"Focus input to add a link (".concat(D,")"),item:t})]}),U.length>0&&!q&&(0,r.jsx)(k.Z,{id:"toggle-linking-container",label:"Toggle linked items container",onClick:()=>{K((e=>!e))},icon:V?"chevron-down":"chevron-left"})]})}))},71881:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var r=n(52322),i=n(24118),o=n(87901),s=n(43426),a=n(79323),l=n(34309),c=n(48518),u=n(47931),d=n(11032);const h=(0,l.Pi)((e=>{let{item:t,searchQuery:n}=e;const l=(0,c.I)(),[h,p]=(0,a.b)(t,l),f=(0,s.l)(t,l),g=(0,d.R)(t);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.Z,{type:h,className:(0,o.classNames)("flex-shrink-0",p)}),(0,r.jsxs)("div",{className:"min-w-0 flex-grow break-words text-left text-base lg:text-sm",children:[f&&(0,r.jsx)("span",{className:"text-passive-1",children:f.titlePrefix}),n?(0,i.RB)(g,n).map(((e,t)=>(0,r.jsx)("span",{className:"".concat(e.toLowerCase()===n.toLowerCase()?"whitespace-pre-wrap font-bold":"whitespace-pre-wrap "),children:e},t))):g]})]})}))},72604:(e,t,n)=>{"use strict";n.d(t,{d:()=>d});var r=n(52322),i=n(87901),o=n(2784),s=n(47931);const a=["searchQuery","onClickCallback","isFocused"];function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const d=(0,o.forwardRef)(((e,t)=>{let{searchQuery:n,onClickCallback:o,isFocused:l}=e,u=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,a);return(0,r.jsxs)("button",c(c({className:(0,i.classNames)("group flex w-full items-center gap-2 overflow-hidden px-3 py-2 hover:bg-contrast hover:text-foreground","focus:bg-info-backdrop [&[data-active-item]]:bg-info-backdrop"),onClick:()=>{o&&o(n)},ref:t},u),{},{children:[(0,r.jsx)("span",{className:"flex-shrink-0 align-middle text-sm lg:text-xs",children:"Create & add tag"})," ",(0,r.jsxs)("span",{className:(0,i.classNames)("inline-flex min-w-0 items-center gap-1 rounded py-1 pl-1 pr-2 align-middle text-xs ","group-hover:bg-info group-hover:text-info-contrast",l?"bg-info text-info-contrast":"bg-contrast text-text"),children:[(0,r.jsx)(s.Z,{type:"hashtag",className:(0,i.classNames)("flex-shrink-0 group-hover:text-info-contrast",l?"text-info-contrast":"text-info"),size:"small"}),(0,r.jsx)("span",{className:"min-w-0 overflow-hidden text-ellipsis",children:n})]})]}))}))},20896:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(52322),i=n(2784),o=n(84075),s=n(91611),a=n(7453),l=n(3555);const c=["children","className","style","a11yLabel","closeMenu","initialFocus","onKeyDown","shouldAutoFocus"];function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function h(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const p=(0,i.forwardRef)(((e,t)=>{let{children:n,className:u="",style:h,a11yLabel:p,closeMenu:f,initialFocus:g,onKeyDown:m,shouldAutoFocus:y=!0}=e,v=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,c);const[A,b]=(0,i.useState)(null),w=(0,i.useCallback)((e=>{null==m||m(e),e.key!==o.u8.Escape||null==f||f()}),[f,m]),S=(0,l.ac)(l.Jj.sm),{setInitialFocus:C}=(0,s.Z)(A,{initialFocus:g,shouldAutoFocus:!S&&y});return(0,i.useImperativeHandle)(t,(()=>({focus:()=>{C()}}))),(0,r.jsx)("menu",d(d({className:"m-0 list-none px-4 focus:shadow-none md:px-0 ".concat(u),onKeyDown:w,ref:(0,a.l)([b,t]),style:h,"aria-label":p},v),{},{children:n}))}))},37211:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(52322),i=n(2784),o=n(47931),s=n(88450),a=n(87901),l=n(68242),c=n(91849);const u=["children","className","icon","iconClassName","tabIndex","shortcut","disabled"];function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const f=(0,i.forwardRef)(((e,t)=>{let{children:n,className:i="",icon:d,iconClassName:p="w-6 h-6 md:w-5 md:h-5 text-neutral mr-2",tabIndex:f,shortcut:g,disabled:m}=e,y=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,u);return(0,r.jsx)(c.Z,{children:(0,r.jsxs)("button",h(h({ref:t,role:"menuitem",tabIndex:"number"==typeof f?f:s.HF,className:(0,a.classNames)("flex w-full cursor-pointer select-none border-0 bg-transparent px-3 py-2.5 text-left md:py-1.5","text-mobile-menu-item text-text enabled:hover:bg-passive-3 enabled:hover:text-foreground","focus:bg-info-backdrop focus:shadow-none md:text-tablet-menu-item lg:text-menu-item","disabled:cursor-not-allowed disabled:opacity-60",i,i.includes("items-")?"":"items-center"),disabled:m},y),{},{children:[g&&(0,r.jsx)(l.J,{className:"mr-2",shortcut:g}),d?(0,r.jsx)(o.Z,{type:d,className:(0,a.classNames)("flex-shrink-0",p)}):null,n]}))})}))},51694:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(52322);const i=()=>(0,r.jsx)("li",{className:"list-none",role:"none",children:(0,r.jsx)("div",{role:"separator",className:"my-2 h-[1px] bg-[--separator-color]"})})},91849:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(52322);const i=e=>{let{children:t}=e;return(0,r.jsx)("li",{className:"flex-grow list-none",role:"none",children:t})}},77059:(e,t,n)=>{"use strict";n.d(t,{Z:()=>y});var r=n(52322),i=n(88450),o=n(29894),s=n(2784),a=n(47931),l=n(68242),c=n(13500),u=n(91849),d=n(27055);const h=["checked","disabled","tabIndex","children","shortcut","className","info"];function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){g(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function g(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const m=e=>{let{text:t}=e;const[n,i]=(0,s.useState)(!1),l=(0,s.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),i(!n)}),[n]),c=(0,s.useRef)(null);return(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("div",{ref:c,className:(0,o.classNames)("peer z-0 flex h-5 w-5 items-center justify-center rounded-full"),onClick:l,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:(0,r.jsx)(a.Z,{type:"notes",className:"text-border translucent-ui:text-[--popover-border-color]",size:"large"})}),(0,r.jsx)(d.Z,{open:n,title:"Info",anchorElement:c,disableMobileFullscreenTakeover:!0,className:"z-modal bg-default px-3 py-1.5 text-left",containerClassName:"w-60",children:t})]})},y=(0,s.forwardRef)(((e,t)=>{let{checked:n,disabled:s,tabIndex:a,children:d,shortcut:p,className:g,info:y}=e,v=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,h);return(0,r.jsx)(u.Z,{children:(0,r.jsxs)("button",f(f({ref:t,role:"menuitemradio",tabIndex:"number"==typeof a?a:i.HF,className:(0,o.classNames)("flex w-full cursor-pointer gap-2 border-0 bg-transparent px-3 py-2.5 text-left md:py-1.5","text-mobile-menu-item text-text hover:bg-passive-3 hover:text-foreground","focus:bg-info-backdrop focus:shadow-none md:text-tablet-menu-item lg:text-menu-item",g,(null==g?void 0:g.includes("items-"))?"":"items-center"),"aria-checked":n,disabled:s},v),{},{children:[p&&(0,r.jsx)(l.J,{className:"mr-2",shortcut:p}),(0,r.jsx)(c.Z,{disabled:s,checked:n,className:"flex-shrink-0"}),d,y&&(0,r.jsx)(m,{text:y})]}))})}))},38403:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(52322),i=n(29894);const o=e=>{let{title:t,className:n,children:o}=e;return(0,r.jsxs)("div",{className:(0,i.classNames)("my-4 md:my-2 md:border-b md:border-border md:pb-2 md:last:mb-0 md:last:border-b-0 md:last:pb-0 md:first:last:mt-0 md:translucent-ui:border-[--popover-border-color]",n),children:[t&&(0,r.jsx)("div",{className:"px-3 py-1 text-sm font-semibold uppercase text-text lg:text-xs",children:t}),(0,r.jsx)("div",{className:"divide-y divide-passive-3 overflow-hidden rounded-md bg-default md:divide-none md:rounded-none md:bg-transparent",children:o})]})}},61293:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(52322),i=n(88450),o=n(29894),s=n(2784),a=n(68242),l=n(88669),c=n(91849);const u=["checked","onChange","disabled","onBlur","tabIndex","children","shortcut","className","forceDesktopStyle"];function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const f=(0,s.forwardRef)(((e,t)=>{let{checked:n,onChange:s,disabled:d,onBlur:p,tabIndex:f,children:g,shortcut:m,className:y,forceDesktopStyle:v}=e,A=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,u);return(0,r.jsx)(c.Z,{children:(0,r.jsxs)("button",h(h({disabled:d,ref:t,className:(0,o.classNames)("flex w-full cursor-pointer items-center border-0 bg-transparent px-3 py-2 md:py-1.5","text-left text-text focus:bg-info-backdrop focus:shadow-none enabled:hover:bg-passive-3 enabled:hover:text-foreground","text-mobile-menu-item md:text-tablet-menu-item lg:text-menu-item","disabled:cursor-not-allowed disabled:opacity-60",y),onClick:()=>{s(!n)},onBlur:p,tabIndex:"number"==typeof f?f:i.HF,role:"menuitemcheckbox","aria-checked":n},A),{},{children:[(0,r.jsx)("span",{className:"flex flex-grow items-center",children:g}),(0,r.jsxs)("div",{className:"flex items-center",children:[m&&(0,r.jsx)(a.J,{className:"mr-2",shortcut:m}),(0,r.jsx)(l.Z,{disabled:d,className:"pointer-events-none flex px-0",checked:n,onChange:s,tabIndex:i.HF,forceDesktopStyle:v})]})]}))})}))},57137:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(52322),i=n(29894),o=n(2784);const s=["children","action","type","slot","className"];function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u=(0,o.forwardRef)(((e,t)=>{let{children:n,action:o,type:a="primary",slot:c,className:u}=e,d=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,s);return(0,r.jsx)("button",l(l({ref:t,className:(0,i.classNames)("flex select-none whitespace-nowrap px-1 py-1 font-semibold focus:shadow-none focus:outline-none active:shadow-none active:outline-none active:brightness-50 disabled:text-neutral md:hidden","left"===c?"justify-start text-left":"justify-end text-right","cancel"===a||"destructive"===a?"text-danger":"text-info",u),onClick:o},d),{},{children:n}))}))},18329:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(52322),i=n(87901);const o=e=>{let{className:t,children:n}=e;return(0,r.jsx)("div",{className:(0,i.classNames)("grid w-full select-none grid-cols-[0.35fr_1fr_0.35fr] gap-2 text-[1.05rem] leading-6",t),"data-mobile-modal-header":!0,children:n})}},10878:(e,t,n)=>{"use strict";n.d(t,{Yb:()=>s,vU:()=>l,xY:()=>i});var r=n(64503);const i="cubic-bezier(.36,.66,.04,1)",o={vertical:{enter:{keyframes:[{transform:"translateY(100%)"},{transform:"translateY(0)"}],transformOrigin:"bottom"},exit:{keyframes:[{transform:"translateY(100%)"}],transformOrigin:"bottom"}},horizontal:{enter:{keyframes:[{transform:"translateX(100%)"},{transform:"translateX(0)"}],transformOrigin:"right"},exit:{keyframes:[{transform:"translateX(0)"},{transform:"translateX(100%)"}],transformOrigin:"right"}},nonMobile:{enter:{keyframes:[{transform:"scale(0.95)",opacity:0},{transform:"scale(1)",opacity:1}],transformOrigin:"center"},exit:{keyframes:[{transform:"scale(1)",opacity:1},{transform:"scale(0.95)",opacity:0}],transformOrigin:"center"}}},s={easing:i,duration:250,fill:"forwards"},a={duration:75},l=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"vertical",i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return(0,r.r)({open:e,enter:{keyframes:t?o[n].enter.keyframes:o.nonMobile.enter.keyframes,options:t?s:a,initialStyle:{transformOrigin:t?o[n].enter.transformOrigin:o.nonMobile.enter.transformOrigin}},enterCallback:e=>{t&&(e.scrollTop=0)},exit:{keyframes:t?o[n].exit.keyframes:o.nonMobile.exit.keyframes,options:t?s:a,initialStyle:{transformOrigin:t?o[n].exit.transformOrigin:o.nonMobile.exit.transformOrigin}}},i)}},73144:(e,t,n)=>{"use strict";n.d(t,{S:()=>o,n:()=>r});var r,i=n(72435);!function(e){e.Navigation="NavigationColumn",e.Items="ItemsColumn",e.Editor="EditorColumn"}(r||(r={}));const o={[r.Navigation]:i.N.NavigationColumn,[r.Items]:i.N.ItemsColumn,[r.Editor]:i.N.EditorColumn}},74522:(e,t,n)=>{"use strict";n.d(t,{G:()=>d,Z:()=>p});var r=n(52322),i=n(74547),o=n(2784),s=n(73144),a=n(34309),l=n(74455),c=n(38232);const u=(0,o.createContext)(void 0),d=()=>{const e=(0,o.useContext)(u);if(!e)throw new Error("Component must be a child of <ResponsivePaneProvider />");return e},h=(0,o.memo)((e=>{let{children:t}=e;return(0,r.jsx)(r.Fragment,{children:t})})),p=(0,a.Pi)((e=>{let{paneController:t,children:n}=e;const a=t.currentPane,d=(0,c.Y)(a),p=(0,o.useCallback)((e=>{t.presentPane(e)}),[t]),f=(0,i.x)();(0,o.useEffect)((()=>{const e=f((()=>(d.current===s.n.Editor||d.current===s.n.Navigation)&&(t.setPaneLayout(l.h.ItemSelection),!0)));return()=>{e&&e()}}),[f,d,t]);const g=(0,o.useMemo)((()=>({selectedPane:a,toggleAppPane:p,presentPane:t.presentPane,isListPaneCollapsed:t.isListPaneCollapsed,isNavigationPaneCollapsed:t.isNavigationPaneCollapsed,toggleListPane:t.toggleListPane,toggleNavigationPane:t.toggleNavigationPane,panes:t.panes,popToPane:t.popToPane,dismissLastPane:t.dismissLastPane,replacePanes:t.replacePanes,removePane:t.removePane,insertPaneAtIndex:t.insertPaneAtIndex,setPaneLayout:t.setPaneLayout,focusModeEnabled:t.focusModeEnabled})),[a,p,t.panes,t.isListPaneCollapsed,t.isNavigationPaneCollapsed,t.toggleListPane,t.toggleNavigationPane,t.presentPane,t.popToPane,t.dismissLastPane,t.replacePanes,t.removePane,t.insertPaneAtIndex,t.setPaneLayout,t.focusModeEnabled]);return(0,r.jsx)(u.Provider,{value:g,children:(0,r.jsx)(h,{children:n})})}))},32620:(e,t,n)=>{"use strict";n.d(t,{w:()=>p});var r=n(3555),i=n(24118);const o=(e,t,n,r,i)=>{const{width:o,height:s}=e,a=DOMRect.fromRect(e),l=i||0;switch(n){case"top":a.y=t.top-s-l;break;case"bottom":a.y=t.bottom+l;break;case"left":a.x=t.left-o-l;break;case"right":a.x=t.right+l}if("top"===n||"bottom"===n)switch(r){case"start":a.x=t.left;break;case"center":a.x=t.left-o/2+t.width/2;break;case"end":a.x=t.right-o}else switch(r){case"start":a.y=t.top;break;case"center":a.y=t.top-s/2+t.height/2;break;case"end":a.y=t.bottom-s}return a},s={top:"bottom",bottom:"top",left:"right",right:"left"},a=(e,t)=>{const n=t;return{top:e.top<n.top,left:e.left<n.left,bottom:e.bottom>n.bottom,right:e.right>n.right}},l={start:"end",end:"start"};function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const h=(e,t)=>{switch(e){case"top":switch(t){case"start":return"bottom left";case"center":return"bottom center";case"end":return"bottom right"}break;case"bottom":switch(t){case"start":return"top left";case"center":return"top center";case"end":return"top right"}break;case"left":switch(t){case"start":return"top right";case"center":return"top center";case"end":return"bottom right"}break;case"right":switch(t){case"start":return"top left";case"center":return"top center";case"end":return"bottom left"}}},p=e=>{let{align:t,anchorRect:n,documentRect:c,popoverRect:d,side:p,disableMobileFullscreenTakeover:f,disableApplyingMobileWidth:g,disableFlip:m,maxHeightFunction:y,offset:v}=e;if(!d||!n)return null;if(!matchMedia(r.Yd.md).matches&&!f)return null;const A=o(d,n,p,t),b=a(A,c),w=s[p],S=b[p]?w:p,C=(e=>{let{finalSide:t,preferredAlignment:n,collisions:r,popoverRect:i,buttonRect:s,documentRect:c}=e;const u="top"===t||"bottom"===t,d=u?"right":"bottom",h=u?"left":"top",p="start"===n,f="end"===n;if("center"===n){if(r[d])return"end";if(r[h])return"start"}else{const e=a(o(i,s,t,l[n]),c);if(p&&r[d]&&!e[h])return"end";if(f&&r[h]&&!e[d])return"start"}return n})({finalSide:m?p:S,preferredAlignment:t,collisions:b,popoverRect:d,buttonRect:n,documentRect:c}),E=o(d,n,m?p:S,C,v);let I=((e,t,n,i,o)=>{if(!matchMedia(r.Yd.md).matches&&!o)return"none";const s=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--safe-area-inset-top"));let a=0;if(t)switch(n){case"top":a=Math.abs(e.height-t.top),s>0&&(a+=s);break;case"bottom":a=t.bottom;break;case"left":case"right":switch(i){case"start":a=t.top;break;case"end":a=e.height-t.bottom}}return e.height-a-10})(c,n,m?p:S,C,f);return y&&"number"==typeof I&&(I=y(I)),(e=>{const{rect:t,disableMobileFullscreenTakeover:n=!1,disableApplyingMobileWidth:r=!1,maxHeight:o="none"}=e,s="none"!==o&&(!(0,i.Av)()||n),a=(0,i.Av)()&&n&&!r,l=(10,.1*window.innerWidth);return u(u({willChange:"transform","--translate-x":"".concat(a?l/2:Math.floor(t.x),"px"),"--translate-y":"".concat(Math.floor(t.y),"px"),"--offset":"".concat(e.offset,"px"),transform:"translate3d(var(--translate-x), var(--translate-y), 0)","--transform-origin":h(e.side,e.align),visibility:"visible"},s&&{maxHeight:"".concat(o,"px")}),a&&{width:"".concat(window.innerWidth-l,"px")})})({rect:E,side:m?p:S,align:C,disableMobileFullscreenTakeover:f,disableApplyingMobileWidth:g,maxHeight:I,offset:v})}},27055:(e,t,n)=>{"use strict";n.d(t,{Z:()=>j});var r=n(52322),i=n(3555),o=n(74547),s=n(2784),a=n(24118);const l=()=>{const e=(0,s.useRef)(null);(0,s.useEffect)((()=>{const t=(0,a.Av)();if(t&&!e.current){const t=document.createElement("style");t.textContent="body { overflow: hidden; }",document.body.appendChild(t),e.current=t}return()=>{t&&e.current&&e.current.remove()}}),[])};var c=n(29894),u=n(65737),d=n(57137),h=n(10878),p=n(18329),f=n(7453),g=n(88450),m=n(64503);const y=()=>(l(),null),v=e=>{let{open:t,requestClose:n,children:o,title:l,className:v,id:A,forceFullHeightOnMobile:b}=e;const w=(0,i.ac)(i.Jj.sm),[S,C,E]=(0,h.vU)(t,w),[,I]=(0,m.r)({open:t,enter:{keyframes:[{opacity:0},{opacity:.6}],options:h.Yb},exit:{keyframes:[{opacity:.6},{opacity:0}],options:h.Yb}});(0,s.useEffect)((()=>{if(!E)return;let e=null,t=0,r=0,i=Date.now(),o=0,s=!1,l=!1;const c=n=>{r=n.touches[0].clientY,t=E.getBoundingClientRect().y,i=Date.now(),e=(0,a.rP)(n.target),o=(null==e?void 0:e.scrollTop)||0,s=!!e&&o>0,l=!1},u=n=>{const i=n.touches[0].clientY-r,a=(null==e?void 0:e.scrollTop)||0;a!==o&&(l=!0),i<0||e&&a>0||l||s||(E.getBoundingClientRect().y>t&&e&&(e.style.overflowY="hidden"),E.animate({transform:["translate3d(0, ".concat(i,"px, 0)")]},{duration:0,fill:"forwards"}))},d=t=>{const o=E.getBoundingClientRect().y,a=.75*window.innerHeight,l=Date.now(),c=t.changedTouches[0].clientY-r;o<a&&c/(l-i)>2||o>a&&!s?n():E.animate({transform:["translate3d(0, 0, 0)"]},{duration:200,fill:"forwards"}),r=0,e&&(e.style.overflowY="")};return E.addEventListener("touchstart",c,!!g.Mk&&{passive:!0}),E.addEventListener("touchmove",u,!!g.Mk&&{passive:!0}),E.addEventListener("touchend",d,!!g.Mk&&{passive:!0}),()=>{E.removeEventListener("touchstart",c),E.removeEventListener("touchmove",u),E.removeEventListener("touchend",d)}}),[E,n]);const _=(0,s.useCallback)((e=>{e&&(e.close=n)}),[n]);return S?(0,r.jsxs)(u.Z,{children:[(0,r.jsx)(y,{}),(0,r.jsxs)("div",{className:"fixed left-0 top-0 z-modal h-full max-h-[var(--ios-viewport-height,_none)] w-full",children:[(0,r.jsx)("div",{className:"absolute z-0 h-full w-full bg-passive-4 opacity-0",ref:I}),(0,r.jsxs)("div",{ref:(0,f.l)([C,_]),className:(0,c.classNames)("z-1 absolute bottom-0 flex max-h-[calc(100%_-_max(var(--safe-area-inset-top),2rem))] min-h-[40%] w-full flex-col rounded-t-xl bg-passive-5 pb-safe-bottom",b&&"h-full"),style:{boxShadow:"0px -4px 8px rgba(0, 0, 0, 0.075)"},id:"popover/"+A,"data-popover":A,"data-mobile-popover":!0,children:[(0,r.jsx)("div",{className:"w-full rounded-t-xl bg-default",children:(0,r.jsx)("div",{className:"mx-auto mt-2 min-h-[0.3rem] w-12 rounded-full bg-passive-2"})}),(0,r.jsxs)(p.Z,{className:"border-b border-border bg-default px-2 py-1.5 text-lg",children:[(0,r.jsx)("div",{}),(0,r.jsx)("div",{className:"flex items-center justify-center font-semibold",children:l}),(0,r.jsx)(d.Z,{type:"primary",slot:"right",action:n,children:"Done"})]}),(0,r.jsx)("div",{className:(0,c.classNames)("h-full overflow-y-auto overscroll-none bg-passive-5",v),children:o})]})]})]}):null};var A=n(84075);const b=()=>(0,A.gn)()?document.body.getBoundingClientRect():document.documentElement.getBoundingClientRect();var w=n(32810),S=n(87901),C=n(32620),E=n(38167);function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach((function(t){x(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function x(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const P=e=>{let{align:t="end",anchorElement:n,anchorPoint:o,children:a,childPopovers:c,className:d,id:h,overrideZIndex:p,side:g="bottom",togglePopover:m,disableClickOutside:y,disableMobileFullscreenTakeover:v,disableFlip:I,disableApplyingMobileWidth:x,maxHeight:P,portal:k=!0,offset:B,hideOnClickInModal:O=!1,setAnimationElement:N,containerClassName:D,documentElement:j}=e;var T;const[M,F]=(0,s.useState)(null),R=(0,w.l)(M),L=n&&"current"in n?n.current:n,Q=(0,w.l)(L,{updateOnWindowResize:!0}),U=DOMRect.fromRect({x:null==o?void 0:o.x,y:null==o?void 0:o.y}),V=o?U:Q,K=(()=>{const[e,t]=(0,s.useState)(b());return(0,s.useEffect)((()=>{const e=()=>{window.clearTimeout(void 0),window.setTimeout((()=>{t(b())}),100)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),e})(),H=(0,i.ac)(i.Yd.md),G=(0,C.w)({align:t,anchorRect:V,documentRect:null!==(T=null==j?void 0:j.getBoundingClientRect())&&void 0!==T?T:K,popoverRect:null!=R?R:null==M?void 0:M.getBoundingClientRect(),side:g,disableMobileFullscreenTakeover:v,disableFlip:I,disableApplyingMobileWidth:x,maxHeightFunction:P,offset:B});let Y;G||(document.body.style.overflow="hidden"),(0,s.useLayoutEffect)((()=>()=>{document.body.style.overflow=""}),[]),!k&&M&&G&&(Y=(0,E.p)(M,G,j)),(e=>{let{popoverElement:t,anchorElement:n,togglePopover:r,childPopovers:i,disabled:o,hideOnClickInModal:a=!1}=e;(0,s.useEffect)((()=>{const e=e=>{var s;const l=e.target,c=null==t?void 0:t.contains(l),u=!!n&&(n===e.target||n.contains(l)),d=null===(s=l.closest("[data-popover]"))||void 0===s?void 0:s.getAttribute("data-popover"),h=d&&i.has(d),p=!(null==t?void 0:t.closest("[data-dialog], .sk-modal"))&&!!l.closest("[data-dialog], [data-backdrop], .sk-modal"),f=!!l.closest("#desktop-title-bar");c||u||h||f||!(!p||p&&a)||o||null==r||r()};return document.addEventListener("click",e,{capture:!0}),document.addEventListener("contextmenu",e,{capture:!0}),()=>{document.removeEventListener("click",e,{capture:!0}),document.removeEventListener("contextmenu",e,{capture:!0})}}),[n,i,t,r,o,a])})({popoverElement:M,anchorElement:L,togglePopover:m,childPopovers:c,hideOnClickInModal:O,disabled:y}),l();const z=(0,s.useRef)(!0),Z=(0,s.useCallback)((e=>{e&&e.scrollTop>0&&z.current&&(e.scrollTop=0,z.current=!1)}),[]),W=(0,s.useCallback)((e=>{e&&m&&(e.close=m)}),[m]);return(0,r.jsx)(u.Z,{disabled:!k,children:(0,r.jsx)("div",{className:(0,S.classNames)("absolute left-0 top-0 flex w-full min-w-80 cursor-auto flex-col md:h-auto md:max-w-xs",!v&&"h-full",p||"z-dropdown-menu",H||v?"invisible":"",D),style:_(_({},G),Y),ref:(0,f.l)([F,W]),id:"popover/"+h,"data-popover":h,onKeyDown:e=>{e.key===A.u8.Escape&&(e.stopPropagation(),null==m||m(),L&&L.focus())},onBlur:()=>{setTimeout((()=>{document.activeElement&&"IFRAME"===document.activeElement.tagName&&!document.activeElement.getAttribute("data-used-in-modal")&&(null==m||m())}))},children:(0,r.jsx)("div",{className:(0,S.classNames)("overflow-y-auto rounded border border-[--popover-border-color] bg-default shadow-main [backdrop-filter:var(--popover-backdrop-filter)] md:bg-[--popover-background-color]",H||v?"":"pb-safe-bottom pt-safe-top","transition-[transform,opacity] duration-75 [transform-origin:var(--transform-origin)] motion-reduce:transition-opacity",G?"scale-100 opacity-100":"scale-95 opacity-0",d),ref:(0,f.l)([Z,N]),onScroll:()=>{z.current=!1},children:a})})})};function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function B(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function O(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const N=(0,s.createContext)(null),D=e=>{const[t,n]=(0,m.r)({open:e.open,exit:{keyframes:[{opacity:0,transform:"scale(0.95)"}],reducedMotionKeyframes:[{opacity:0}],options:{duration:75}}});return t?(0,r.jsx)(P,B(B({setAnimationElement:n},e),{},{children:e.children})):null},j=e=>{const t=(0,s.useId)(),n=(0,o.x)();(e=>{const t=(0,s.useContext)(N);(0,s.useEffect)((()=>{const n=e;return null==t||t.registerChildPopover(n),()=>{null==t||t.unregisterChildPopover(n)}}),[t,e])})(t);const[a,l]=(0,s.useState)(new Set),c=(0,s.useCallback)((e=>{l((t=>new Set(t.add(e))))}),[]),u=(0,s.useCallback)((e=>{l((t=>(t.delete(e),new Set(t))))}),[]),d=(0,s.useMemo)((()=>({registerChildPopover:c,unregisterChildPopover:u})),[c,u]);return(0,s.useEffect)((()=>{let t;return e.open&&(t=n((()=>{var t;return null===(t=e.togglePopover)||void 0===t||t.call(e),!0}))),()=>{t&&t()}}),[n,e,e.open]),(0,s.useEffect)((()=>{const t=e.anchorElement&&"current"in e.anchorElement?e.anchorElement.current:e.anchorElement;return t&&(t.setAttribute("aria-haspopup","true"),e.open?t.setAttribute("aria-expanded","true"):t.removeAttribute("aria-expanded")),()=>{t&&(t.removeAttribute("aria-haspopup"),t.removeAttribute("aria-expanded"))}}),[e.anchorElement,e.open]),(0,i.ac)(i.Jj.sm)&&!e.disableMobileFullscreenTakeover?(0,r.jsx)(v,{open:e.open,requestClose:()=>{var t;null===(t=e.togglePopover)||void 0===t||t.call(e)},title:e.title,className:e.className,id:t,forceFullHeightOnMobile:e.forceFullHeightOnMobile,children:e.children}):(0,r.jsx)(N.Provider,{value:d,children:(0,r.jsx)(D,B(B({},e),{},{childPopovers:a,id:t}))})}},38167:(e,t,n)=>{"use strict";function r(e){if(!e)return null;const t=e.parentElement;return t?"absolute"===window.getComputedStyle(t).getPropertyValue("position")?t:r(t):null}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{p:()=>a});const a=(e,t,n)=>{const i=n||r(e)||e.parentElement,s=null==t?void 0:t["--translate-x"],a=null==t?void 0:t["--translate-y"],l=s?parseInt(s):0,c=a?parseInt(a):0;if(!i)return t;const u=i.getBoundingClientRect(),d=Math.floor(l-u.left),h=Math.floor(c-u.top);return o(o({},t),{},{"--translate-x":"".concat(d,"px"),"--translate-y":"".concat(h,"px")})}},65737:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(52322),i=n(2784),o=n(28316);const s=e=>{let{children:t,disabled:n=!1}=e;const[s,a]=(0,i.useState)(),l="portal/"+(0,i.useId)();return(0,i.useEffect)((()=>{const e=document.createElement("div");return e.id=l,document.body.append(e),a(e),()=>e.remove()}),[l]),n?(0,r.jsx)(r.Fragment,{children:t}):s?(0,o.createPortal)(t,s):null}},97168:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f,g:()=>p});var r=n(52322),i=n(29894),o=n(82619),s=n(2784),a=n(53846),l=n(88669),c=n(65378),u=n(44993),d=n(5778),h=n(3555);const p="ConfirmBeforeExit",f=e=>{let{application:t}=e;const[n,f]=(0,s.useState)((()=>{var e;return null===(e=t.getValue(p))||void 0===e||e})),g=(0,h.ac)(h.Jj.sm),m=(0,d.Z)(i.PrefKey.EditorSpellcheck),y=(0,d.Z)(i.PrefKey.NoteAddToParentFolders),v=(0,d.Z)(i.PrefKey.AlwaysShowSuperToolbar);return(0,r.jsx)(c.Z,{children:(0,r.jsxs)(u.Z,{children:[(0,r.jsx)(o.Dx,{children:"Defaults"}),t.platform===i.Platform.Android&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex justify-between gap-2 md:items-center",children:[(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)(o.QE,{children:"Always ask before closing app (Android)"}),(0,r.jsx)(o.xv,{children:"Whether a confirmation dialog should be shown before closing the app."})]}),(0,r.jsx)(l.Z,{onChange:()=>{const e=!n;f(e),t.setValue(p,e)},checked:n})]}),(0,r.jsx)(a.Z,{classes:"my-4"})]}),(0,r.jsxs)("div",{className:"flex justify-between gap-2 md:items-center",children:[(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)(o.QE,{children:"Spellcheck"}),(0,r.jsx)(o.xv,{children:"The default spellcheck value for new notes. Spellcheck can be configured per note from the note context menu. Spellcheck may degrade overall typing performance with long notes."})]}),(0,r.jsx)(l.Z,{onChange:()=>{t.toggleGlobalSpellcheck().catch(console.error)},checked:m})]}),(0,r.jsx)(a.Z,{classes:"my-4"}),(0,r.jsxs)("div",{className:"flex justify-between gap-2 md:items-center",children:[(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)(o.QE,{children:"Add all parent tags when adding a nested tag to a note"}),(0,r.jsx)(o.xv,{children:"When enabled, adding a nested tag to a note will automatically add all associated parent tags."})]}),(0,r.jsx)(l.Z,{onChange:()=>{t.setPreference(i.PrefKey.NoteAddToParentFolders,!y).catch(console.error)},checked:y})]}),(0,r.jsx)(a.Z,{classes:"my-4"}),!g&&(0,r.jsxs)("div",{className:"flex justify-between gap-2 md:items-center",children:[(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)(o.QE,{children:"Use always-visible toolbar in Super notes"}),(0,r.jsx)(o.xv,{children:"When enabled, the Super toolbar will always be shown at the top of the note. It can be temporarily toggled using Cmd/Ctrl+Shift+K. When disabled, the Super toolbar will only be shown as a floating toolbar when text is selected."})]}),(0,r.jsx)(l.Z,{onChange:()=>{t.setPreference(i.PrefKey.AlwaysShowSuperToolbar,!v).catch(console.error)},checked:v})]})]})})}},82619:(e,t,n)=>{"use strict";n.d(t,{Cr:()=>l,DR:()=>h,Dx:()=>s,KI:()=>u,QE:()=>a,Qj:()=>d,xv:()=>c});var r=n(52322),i=n(756),o=n(87901);const s=e=>{let{children:t,className:n}=e;return(0,r.jsx)("h2",{className:(0,o.classNames)("m-0 mb-1 text-lg font-bold text-info md:text-base",n),children:t})},a=e=>{let{children:t,className:n}=e;return(0,r.jsx)("h4",{className:(0,o.classNames)("m-0 mb-1 text-base font-medium lg:text-sm",n),children:t})},l=e=>{let{children:t,className:n}=e;return(0,r.jsx)("h4",{className:(0,o.classNames)("m-0 mb-1 text-base font-normal lg:text-sm",n),children:t})},c=e=>{let{children:t,className:n}=e;return(0,r.jsx)("p",{className:(0,o.classNames)("text-base lg:text-xs",n),children:t})},u=e=>{let{children:t,className:n}=e;return(0,r.jsx)("p",{className:(0,o.classNames)("text-sm lg:text-xs",n),children:t})},d=e=>{let{label:t,link:n,className:i,onClick:s}=e;return(0,r.jsx)("a",{target:"_blank",className:(0,o.classNames)("block w-fit rounded border border-solid border-border bg-normal-button px-4 py-1.5 text-base font-bold text-text hover:bg-contrast focus:bg-contrast lg:text-sm",i),href:n,onClick:s,children:t})},h=e=>{let{children:t,className:n,style:s}=e;const a=(0,i.c)(s);return(0,r.jsx)("div",{className:(0,o.classNames)("ml-2 rounded px-2 py-1 text-[10px] font-bold",n,a),children:t})}},65378:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(52322);const i=e=>{let{children:t}=e;return(0,r.jsx)("div",{className:"mb-3 flex max-w-full flex-col rounded border border-solid border-border bg-default p-6",children:t})}},44993:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(52322);const i=e=>{let{children:t,classes:n=""}=e;return(0,r.jsx)("div",{className:"flex flex-col ".concat(n),children:t})}},13500:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(52322);const i=e=>{let{checked:t,className:n,disabled:i}=e;return(0,r.jsx)("div",{className:"relative h-5 w-5 rounded-full border-2 border-solid md:h-4 md:w-4 ".concat(i?"opacity-50":""," ").concat(t?"border-info after:absolute after:left-1/2 after:top-1/2 after:h-3 after:w-3 after:-translate-x-1/2 after:-translate-y-1/2 after:rounded-full after:bg-info md:after:h-2 md:after:w-2":"border-passive-1"," ").concat(n)})}},88743:(e,t,n)=>{"use strict";n.d(t,{Z:()=>P});var r=n(52322),i=n(46462),o=n(6236),s=n(14191),a=n(13277),l=n(81548),c=n(40077);function u(e={}){var t,n=(0,c.S0)(e,[]);const r=null==(t=n.store)?void 0:t.getState(),i=(0,s.t)((0,c.EZ)((0,c.ih)({},n),{focusLoop:(0,l.LS)(n.focusLoop,null==r?void 0:r.focusLoop,!0)})),o=(0,c.EZ)((0,c.ih)({},i.getState()),{value:(0,l.LS)(n.value,null==r?void 0:r.value,n.defaultValue,null)}),u=(0,a.MT)(o,i,n.store);return(0,c.EZ)((0,c.ih)((0,c.ih)({},i),u),{setValue:e=>u.setState("value",e)})}var d=n(9587),h=n(45010),p=(0,h.re)([d.Lq],[d.al]),f=p.useContext,g=(p.useScopedContext,p.useProviderContext),m=(p.ContextProvider,p.ScopedContextProvider),y=n(38346),v=n(48104),A=n(70604),b=(0,h.Bi)((e=>{var t=e,{store:n}=t,i=(0,A.S0)(t,["store"]);const o=g();return n=n||o,(0,l.kG)(n,!1),i=(0,v.OJ)(i,(e=>(0,r.jsx)(m,{value:n,children:e})),[n]),i=(0,A.ih)({role:"radiogroup"},i),(0,y.Q)((0,A.ih)({store:n},i))})),w=(0,h.LM)((e=>{const t=b(e);return(0,h.az)("div",t)})),S=n(96332),C=n(74018),E=n(2784),I=(0,h.Bi)((e=>{var t=e,{store:n,name:r,value:i,checked:s}=t,a=(0,A.S0)(t,["store","name","value","checked"]);const c=f();n=n||c;const u=(0,v.Me)(a.id),d=(0,E.useRef)(null),h=(0,o.Kw)(n,(e=>null!=s?s:function(e,t){if(void 0!==t)return null!=e&&null!=t?t===e:!!t}(i,null==e?void 0:e.value)));(0,E.useEffect)((()=>{u&&h&&((null==n?void 0:n.getState().activeId)===u||null==n||n.setActiveId(u))}),[n,h,u]);const p=a.onChange,g=(w=(0,v.O)(d,a.as||"input"),S=a.type,"input"===w&&(!S||"radio"===S)),m=(0,l.EE)(a),[y,b]=(0,v.NW)();var w,S;(0,E.useEffect)((()=>{const e=d.current;e&&(g||(void 0!==h&&(e.checked=h),void 0!==r&&(e.name=r),void 0!==i&&(e.value=`${i}`)))}),[y,g,h,r,i]);const I=(0,v.zX)((e=>{if(m)return e.preventDefault(),void e.stopPropagation();g||(e.currentTarget.checked=!0,b()),null==p||p(e),e.defaultPrevented||null==n||n.setValue(i)})),_=a.onClick,x=(0,v.zX)((e=>{null==_||_(e),e.defaultPrevented||g||I(e)})),P=a.onFocus,k=(0,v.zX)((e=>{if(null==P||P(e),e.defaultPrevented)return;if(!g)return;if(!n)return;const{moves:t,activeId:r}=n.getState();t&&(u&&r!==u||I(e))}));return a=(0,A.EZ)((0,A.ih)({id:u,role:g?void 0:"radio",type:g?"radio":void 0,"aria-checked":h},a),{ref:(0,v.qq)(d,a.ref),onChange:I,onClick:x,onFocus:k}),a=(0,C.E)((0,A.ih)({store:n,clickOnEnter:!g},a)),(0,A.ih)({name:g?r:void 0,value:g?i:void 0,checked:h},a)})),_=(0,h.W5)((e=>{const t=I(e);return(0,h.az)("input",t)})),x=n(87901);const P=function(e){let{value:t,items:n,onChange:s,className:a}=e;const l=function(e={}){const[t,n]=(0,o.oR)(u,e);return function(e,t,n){return e=(0,i.b)(e,t,n),(0,o.XS)(e,n,"value","setValue"),e}(t,n,e)}({value:t,orientation:"horizontal",setValue(e){s(e)}});return(0,r.jsx)(w,{store:l,className:"flex divide-x divide-border rounded border border-border md:translucent-ui:border-[--popover-border-color] ".concat(null!=a?a:""),children:n.map((e=>{let{label:n,value:i}=e;return(0,r.jsxs)("label",{className:(0,x.classNames)("flex-grow select-none px-3.5 py-1.5 text-center","first:rounded-bl first:rounded-tl last:rounded-br last:rounded-tr",i===t&&"bg-info-backdrop font-medium text-info ring-1 ring-inset ring-info focus-within:ring-2"),children:[(0,r.jsx)(S.T,{children:(0,r.jsx)(_,{value:i})}),n]},i)}))})}},53846:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(52322);const i=e=>{let{classes:t=""}=e;return(0,r.jsx)("hr",{className:"min-h-[1px] w-full border-none bg-[--separator-color] ".concat(t)})}},41707:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(52322);const i=e=>{let{className:t}=e;return(0,r.jsx)("div",{className:"animate-spin rounded-full border border-solid border-info border-r-transparent ".concat(t)})}},75711:(e,t,n)=>{"use strict";n.d(t,{Z:()=>L});var r=n(52322),i=n(29894),o=n(2784),s=n(12216),a=n(6236),l=n(97254),c=n(13277),u=n(81548),d=n(40077);function h(e={}){var t;const n=null==(t=e.store)?void 0:t.getState(),r=(0,l.A)((0,d.EZ)((0,d.ih)({},e),{placement:(0,u.LS)(e.placement,null==n?void 0:n.placement,"top"),hideTimeout:(0,u.LS)(e.hideTimeout,null==n?void 0:n.hideTimeout,0)})),i=(0,d.EZ)((0,d.ih)({},r.getState()),{type:(0,u.LS)(e.type,null==n?void 0:n.type,"description"),skipTimeout:(0,u.LS)(e.skipTimeout,null==n?void 0:n.skipTimeout,300)}),o=(0,c.MT)(i,r,e.store);return(0,d.ih)((0,d.ih)({},r),o)}var p=n(89723),f=n(19922),g=n(45010),m=(0,g.re)([f.$M],[f.WS]),y=(m.useContext,m.useScopedContext,m.useProviderContext),v=(m.ContextProvider,m.ScopedContextProvider),A=n(48104),b=n(70604),w=(0,c.MT)({activeStore:null}),S=(0,g.Bi)((e=>{var t=e,{store:n,showOnHover:r=!0}=t,i=(0,b.S0)(t,["store","showOnHover"]);const s=y();n=n||s,(0,u.kG)(n,!1);const a=(0,o.useRef)(!1);(0,o.useEffect)((()=>(0,c.Z_)(n,["mounted"],(e=>{e.mounted||(a.current=!1)}))),[n]),(0,o.useEffect)((()=>(0,c.Z_)(n,["mounted","skipTimeout"],(e=>{if(!n)return;if(e.mounted){const{activeStore:e}=w.getState();return e!==n&&(null==e||e.hide()),w.setState("activeStore",n)}const t=setTimeout((()=>{const{activeStore:e}=w.getState();e===n&&w.setState("activeStore",null)}),e.skipTimeout);return()=>clearTimeout(t)}))),[n]);const l=i.onMouseEnter,d=(0,A.zX)((e=>{null==l||l(e),a.current=!0})),h=i.onFocusVisible,f=(0,A.zX)((e=>{null==h||h(e),e.defaultPrevented||(null==n||n.setAnchorElement(e.currentTarget),null==n||n.show())})),g=i.onBlur,m=(0,A.zX)((e=>{if(null==g||g(e),e.defaultPrevented)return;const{activeStore:t}=w.getState();t===n&&w.setState("activeStore",null)})),v=n.useState("type"),S=n.useState((e=>{var t;return null==(t=e.contentElement)?void 0:t.id}));return i=(0,b.EZ)((0,b.ih)({"aria-labelledby":"label"===v?S:void 0,"aria-describedby":"description"===v?S:void 0},i),{onMouseEnter:d,onFocusVisible:f,onBlur:m}),(0,p.S)((0,b.ih)({store:n,showOnHover:e=>{if(!a.current)return!1;if((0,u.Bk)(r,e))return!1;const{activeStore:t}=w.getState();return!t||(null==n||n.show(),!1)}},i))})),C=(0,g.LM)((e=>{const t=S(e);return(0,g.az)("div",t)})),E=n(23738),I=n(56278),_=n(10244),x=(0,g.Bi)((e=>{var t=e,{store:n,portal:i=!0,gutter:o=8,preserveTabOrder:s=!1,hideOnHoverOutside:a=!0,hideOnInteractOutside:l=!0}=t,c=(0,b.S0)(t,["store","portal","gutter","preserveTabOrder","hideOnHoverOutside","hideOnInteractOutside"]);const d=y();n=n||d,(0,u.kG)(n,!1),c=(0,A.OJ)(c,(e=>(0,r.jsx)(v,{value:n,children:e})),[n]);const h=n.useState((e=>"description"===e.type?"tooltip":"none"));return c=(0,b.ih)({role:h},c),(0,E.c)((0,b.EZ)((0,b.ih)({},c),{store:n,portal:i,gutter:o,preserveTabOrder:s,hideOnHoverOutside:e=>{if((0,u.Bk)(a,e))return!1;const t=null==n?void 0:n.getState().anchorElement;return!t||!("focusVisible"in t.dataset)},hideOnInteractOutside:e=>{if((0,u.Bk)(l,e))return!1;const t=null==n?void 0:n.getState().anchorElement;return!t||!(0,_.r3)(t,e.target)}}))})),P=(0,I.L5)((0,g.LM)((e=>{const t=x(e);return(0,g.az)("div",t)})),y),k=n(20038),B=n(3555),O=n(32620),N=n(38167),D=n(67955),j=n(24118);const T=["children","className","label","showOnMobile","showOnHover","interactive","type","side","documentElement"];function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function F(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function R(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const L=e=>{let{children:t,className:n,label:l,showOnMobile:c=!1,showOnHover:u=!0,interactive:d=!1,type:p="label",side:f,documentElement:g}=e,m=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,T);const[y,v]=(0,o.useState)(),A=(0,B.ac)(B.Jj.sm),b=function(e={}){const[t,n]=(0,a.oR)(h,e);return function(e,t,n){return e=(0,s.M)(e,t,n),(0,a.XS)(e,n,"type"),(0,a.XS)(e,n,"skipTimeout"),e}(t,n,e)}({timeout:A&&c?100:500,hideTimeout:0,skipTimeout:0,open:y,animated:!0,type:p}),w=(0,o.useRef)(null),{attachEvents:S,cleanupEvents:E}=(0,D.H)(w,(()=>{b.show(),setTimeout((()=>{b.hide()}),2e3)}));(0,o.useEffect)((()=>{if(A&&c)return S(),()=>{E()}}),[S,E,A,c]);const I=A?{}:{onClick:()=>b.hide()};return(0,o.useEffect)((()=>{const e=w.current;if(!e)return;const t=(0,j.rP)(e);if(!t)return;const n=()=>{b.hide()};return t.addEventListener("scroll",n),()=>{t.removeEventListener("scroll",n)}}),[b]),A&&!c?(0,r.jsx)(r.Fragment,{children:t}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(C,F(F({},I),{},{onBlur:()=>v(void 0),store:b,render:(0,r.jsx)(k.g7,{ref:w}),showOnHover:u,children:t})),(0,r.jsx)(P,F(F({tabIndex:void 0,autoFocusOnShow:!u,store:b,className:(0,i.classNames)("z-tooltip max-w-max rounded border border-border bg-contrast px-3 py-1.5 text-sm text-foreground shadow [backdrop-filter:var(--popover-backdrop-filter)] translucent-ui:border-[--popover-border-color] translucent-ui:bg-[--popover-background-color]","opacity-60 transition-opacity duration-75 [&[data-enter]]:opacity-100 [&[data-leave]]:opacity-60","focus-visible:shadow-none focus-visible:outline-none",n),updatePosition:()=>{const{popoverElement:e,anchorElement:t,open:n}=b.getState();!d&&e&&(e.style.pointerEvents="none");const r=g||document.querySelector(".main-ui-view");if(!(e&&t&&r&&n))return;const i=t.getBoundingClientRect(),o=e.getBoundingClientRect(),s=r.getBoundingClientRect(),a=(0,O.w)({align:"center",side:f||"bottom",anchorRect:i,popoverRect:o,documentRect:s,disableMobileFullscreenTakeover:!0,disableApplyingMobileWidth:!0,offset:m.gutter?m.gutter:6});if(a&&(Object.assign(e.style,a),!m.portal)){const t=(0,N.p)(e,a,m.portalElement instanceof HTMLElement?m.portalElement:void 0);e.style.setProperty("--translate-x",t["--translate-x"]),e.style.setProperty("--translate-y",t["--translate-y"])}}},m),{},{children:l}))]})}},32839:(e,t,n)=>{"use strict";n.d(t,{k:()=>Ln});var r=n(52322),i=n(2784),o=n(47166);const s="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?i.useLayoutEffect:i.useEffect;function a(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function l(){return function(e){const[t]=(0,o.g)(),n=(0,i.useMemo)((()=>e(t)),[t,e]),r=(0,i.useRef)(n.initialValueFn()),[a,l]=(0,i.useState)(r.current);return s((()=>{const{initialValueFn:e,subscribe:t}=n,i=e();return r.current!==i&&(r.current=i,l(i)),t((e=>{r.current=e,l(e)}))}),[n,e]),a}(a)}var c=n(31031);function u(e){return()=>function(e){if(!function(e,t=!0){if(e)return!1;let n=(0,c.Gv)().getTextContent();return t&&(n=n.trim()),""===n}(e,!1))return!1;const t=(0,c.Gv)().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e<n;e++){const n=t[e];if((0,c.k$)(n))return!1;if((0,c.F7)(n)){if(!(0,c.Rl)(n))return!1;if(0!==n.__indent)return!1;const t=n.getChildren(),r=t.length;for(let n=0;n<r;n++){const n=t[e];if(!(0,c.Gg)(n))return!1}}}return!0}(e)}var d=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})),h=n(29016),p=n(28316),f=n(9591);const g="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?i.useLayoutEffect:i.useEffect;function m(e){return e.getEditorState().read(u(e.isComposing()))}function y({contentEditable:e,placeholder:t,ErrorBoundary:n}){const[s]=(0,o.g)(),a=function(e,t){const[n,o]=(0,i.useState)((()=>e.getDecorators()));return g((()=>e.registerDecoratorListener((e=>{(0,p.flushSync)((()=>{o(e)}))}))),[e]),(0,i.useEffect)((()=>{o(e.getDecorators())}),[e]),(0,i.useMemo)((()=>{const o=[],s=Object.keys(n);for(let a=0;a<s.length;a++){const l=s[a],c=(0,r.jsx)(t,{onError:t=>e._onError(t),children:(0,r.jsx)(i.Suspense,{fallback:null,children:n[l]})}),u=e.getElementByKey(l);null!==u&&o.push((0,p.createPortal)(c,u,l))}return o}),[t,n,e])}(s,n);return function(e){g((()=>(0,h.qV)((0,f.ML)(e),function(e){const t=window.location.origin,n=n=>{if(n.origin!==t)return;const r=e.getRootElement();if(document.activeElement!==r)return;const i=n.data;if("string"==typeof i){let t;try{t=JSON.parse(i)}catch(e){return}if(t&&"nuanria_messaging"===t.protocol&&"request"===t.type){const r=t.payload;if(r&&"makeChanges"===r.functionId){const t=r.args;if(t){const[r,i,o,s,a,l]=t;e.update((()=>{const e=(0,c.dL)();if((0,c.OP)(e)){const t=e.anchor;let l=t.getNode(),u=0,d=0;if((0,c.Gg)(l)&&r>=0&&i>=0&&(u=r,d=r+i,e.setTextNodeRange(l,u,l,d)),u===d&&""===o||(e.insertRawText(o),l=t.getNode()),(0,c.Gg)(l)){u=s,d=s+a;const t=l.getTextContentSize();u=u>t?t:u,d=d>t?t:d,e.setTextNodeRange(l,u,l,d)}n.stopImmediatePropagation()}}))}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}(e))),[e])}(s),(0,r.jsxs)(r.Fragment,{children:[e,(0,r.jsx)(v,{content:t}),a]})}function v({content:e}){const[t]=(0,o.g)(),n=function(e){const[t,n]=(0,i.useState)((()=>m(e)));return g((()=>{function t(){const t=m(e);n(t)}return t(),(0,h.qV)(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(t),r=l();return n?"function"==typeof e?e(r):e:null}const A="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?i.useLayoutEffect:i.useEffect;function b({ariaActiveDescendant:e,ariaAutoComplete:t,ariaControls:n,ariaDescribedBy:s,ariaExpanded:a,ariaLabel:l,ariaLabelledBy:c,ariaMultiline:u,ariaOwns:d,ariaRequired:h,autoCapitalize:p,className:f,id:g,role:m="textbox",spellCheck:y=!0,style:v,tabIndex:b,"data-testid":w,...S}){const[C]=(0,o.g)(),[E,I]=(0,i.useState)(!1),_=(0,i.useCallback)((e=>{e&&e.ownerDocument&&e.ownerDocument.defaultView&&C.setRootElement(e)}),[C]);return A((()=>(I(C.isEditable()),C.registerEditableListener((e=>{I(e)})))),[C]),(0,r.jsx)("div",{...S,"aria-activedescendant":E?e:void 0,"aria-autocomplete":E?t:"none","aria-controls":E?n:void 0,"aria-describedby":s,"aria-expanded":E&&"combobox"===m?!!a:void 0,"aria-label":l,"aria-labelledby":c,"aria-multiline":u,"aria-owns":E?d:void 0,"aria-readonly":!E||void 0,"aria-required":h,autoCapitalize:p,className:f,contentEditable:E,"data-testid":w,id:g,ref:_,role:m,spellCheck:y,style:v,tabIndex:b})}const w="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?i.useLayoutEffect:i.useEffect;function S({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:t=!1,onChange:n}){const[r]=(0,o.g)();return w((()=>{if(n)return r.registerUpdateListener((({editorState:i,dirtyElements:o,dirtyLeaves:s,prevEditorState:a,tags:l})=>{t&&0===o.size&&0===s.size||e&&l.has("history-merge")||a.isEmpty()||n(i,r,l)}))}),[r,e,t,n]),null}const C="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?i.useLayoutEffect:i.useEffect;function E({onClear:e}){const[t]=(0,o.g)();return C((()=>t.registerCommand(c.BM,(n=>(t.update((()=>{if(null==e){const e=(0,c.Gv)(),t=(0,c.dL)(),n=(0,c.BE)();e.clear(),e.append(n),null!==t&&n.select(),(0,c.OP)(t)&&(t.format=0)}else e()})),!0)),c.VN)),[t,e]),null}var I=n(37146),_=n(27901);const x=[{dependencies:[_.HY],export:e=>(0,_.fs)(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{const i=(0,_.Dq)();r||null!=e.getNextSibling()?e.replace(i):e.insertBefore(i),i.selectNext()},type:"element"},...I.XC];function P({transformers:e=x}){const[t]=(0,o.g)();return(0,i.useEffect)((()=>(0,I.AB)(t,e)),[t,e]),null}var k,B=n(65268),O=(k=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)},k&&k.__esModule&&Object.prototype.hasOwnProperty.call(k,"default")?k.default:k);function N({hasCellMerge:e=!0,hasCellBackgroundColor:t=!0,hasTabHandler:n=!0}){const[r]=(0,o.g)();return(0,i.useEffect)((()=>(r.hasNodes([B.Fh,B.Cr,B.g0])||O(10),(0,h.qV)(r.registerCommand(B.bF,(({columns:e,rows:t,includeHeaders:n})=>{const r=(0,B.uv)(Number(t),Number(e),n);(0,h.z8)(r);const i=r.getFirstDescendant();return(0,c.Gg)(i)&&i.select(),!0}),c.VN),r.registerNodeTransform(B.Fh,(e=>{const[t]=(0,B.CS)(e,null,null),n=t.reduce(((e,t)=>Math.max(e,t.length)),0);for(let e=0;e<t.length;++e){const r=t[e].length;if(r===n)continue;const i=t[e][r-1].cell;for(let e=r;e<n;++e){const e=(0,B.ku)(0);e.append((0,c.BE)()),null!==i?i.insertAfter(e):(0,h.bV)(i,e)}}}))))),[r]),(0,i.useEffect)((()=>{const e=new Map,t=t=>{const i=t.getKey(),o=r.getElementByKey(i);if(o&&!e.has(i)){const s=(0,B.rN)(t,o,r,n);e.set(i,s)}};r.getEditorState().read((()=>{const e=(0,c.K8)(B.Fh);for(const n of e)(0,B.di)(n)&&t(n)}));const i=r.registerMutationListener(B.Fh,(n=>{for(const[i,o]of n)if("created"===o)r.getEditorState().read((()=>{const e=(0,c.gI)(i);(0,B.di)(e)&&t(e)}));else if("destroyed"===o){const t=e.get(i);void 0!==t&&(t.removeListeners(),e.delete(i))}}));return()=>{i();for(const[,t]of e)t.removeListeners()}}),[r,n]),(0,i.useEffect)((()=>{if(!e)return r.registerNodeTransform(B.Cr,(e=>{if(e.getColSpan()>1||e.getRowSpan()>1){const[,,t]=(0,B.$r)(e),[n]=(0,B.kr)(t,e,e),r=n.length,i=n[0].length;let o=t.getFirstChild();(0,B.to)(o)||O(175);const s=[];for(let e=0;e<r;e++){0!==e&&(o=o.getNextSibling(),(0,B.to)(o)||O(175));let t=null;for(let r=0;r<i;r++){const i=n[e][r],a=i.cell;if(i.startRow===e&&i.startColumn===r)t=a,s.push(a);else if(a.getColSpan()>1||a.getRowSpan()>1){(0,B.TF)(a)||O(176);const e=(0,B.ku)(a.__headerState);null!==t?t.insertAfter(e):(0,h.bV)(o,e)}}}for(const e of s)e.setColSpan(1),e.setRowSpan(1)}}))}),[r,e]),(0,i.useEffect)((()=>{if(!t)return r.registerNodeTransform(B.Cr,(e=>{null!==e.getBackgroundColor()&&e.setBackgroundColor(null)}))}),[r,t,e]),null}function D(e,t){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},D(e,t)}var j={error:null},T=function(e){var t,n;function r(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).state=j,t.resetErrorBoundary=function(){for(var e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];null==t.props.onReset||(e=t.props).onReset.apply(e,r),t.reset()},t}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,D(t,n),r.getDerivedStateFromError=function(e){return{error:e}};var o=r.prototype;return o.reset=function(){this.setState(j)},o.componentDidCatch=function(e,t){var n,r;null==(n=(r=this.props).onError)||n.call(r,e,t)},o.componentDidUpdate=function(e,t){var n,r,i,o,s=this.state.error,a=this.props.resetKeys;null!==s&&null!==t.error&&(void 0===(i=e.resetKeys)&&(i=[]),void 0===(o=a)&&(o=[]),i.length!==o.length||i.some((function(e,t){return!Object.is(e,o[t])})))&&(null==(n=(r=this.props).onResetKeysChange)||n.call(r,e.resetKeys,a),this.reset())},o.render=function(){var e=this.state.error,t=this.props,n=t.fallbackRender,r=t.FallbackComponent,o=t.fallback;if(null!==e){var s={error:e,resetErrorBoundary:this.resetErrorBoundary};if(i.isValidElement(o))return o;if("function"==typeof n)return n(s);if(r)return i.createElement(r,s);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},r}(i.Component);function M({children:e,onError:t}){return(0,r.jsx)(T,{fallback:(0,r.jsx)("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:t,children:e})}var F=n(31537);const R=new RegExp(function(){const{alpha:e,alphanumeric:t,hashChars:n}=function(){const e=String.fromCharCode,t="A-Za-zªµºÀ-ÖØ-öø-Ɂɐ-ˁˆ-ˑˠ-ˤˮͺΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϵϷ-ҁҊ-ӎӐ-ӹԀ-ԏԱ-Ֆՙա-ևא-תװ-ײء-غـ-يٮ-ٯٱ-ۓەۥ-ۦۮ-ۯۺ-ۼۿܐܒ-ܯݍ-ݭހ-ޥޱऄ-हऽॐक़-ॡॽঅ-ঌএ-ঐও-নপ-রলশ-হঽৎড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽૐૠ-ૡଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽଡ଼-ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡඅ-ඖක-නඳ-රලව-ෆก-ะา-ำเ-ๆກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆໜ-ໝༀཀ-ཇཉ-ཪྈ-ྋက-အဣ-ဧဩ-ဪၐ-ၕႠ-Ⴥა-ჺჼᄀ-ᅙᅟ-ᆢᆨ-ᇹሀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙶᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦩᧁ-ᧇᨀ-ᨖᴀ-ᶿḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₔℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℱℳ-ℹℼ-ℿⅅ-ⅉⰀ-Ⱞⰰ-ⱞⲀ-ⳤⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〆〱-〵〻-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄬㄱ-ㆎㆠ-ㆷㇰ-ㇿ㐀-䶵一-龻ꀀ-ꒌꠀ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢ가-힣豈-鶴侮-頻並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ̀-ͯ҃-֑҆-ֹֻ-ֽֿׁ-ׂׄ-ׇׅؐ-ًؕ-ٰٞۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ްँ-ः़ा-्॑-॔ॢ-ॣঁ-ঃ়া-ৄে-ৈো-্ৗৢ-ৣਁ-ਃ਼ਾ-ੂੇ-ੈੋ-੍ੰ-ੱઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣଁ-ଃ଼ା-ୃେ-ୈୋ-୍ୖ-ୗஂா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕ-ౖಂ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕ-ೖം-ഃാ-ൃെ-ൈൊ-്ൗං-ඃ්ා-ුූෘ-ෟෲ-ෳัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-༹༙༵༷༾-༿ཱ-྄྆-྇ྐ-ྗྙ-ྼ࿆ာ-ဲံ-္ၖ-ၙ፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳា-៓៝᠋-᠍ᢩᤠ-ᤫᤰ-᤻ᦰ-ᧀᧈ-ᧉᨗ-ᨛ᷀-᷃⃐-⃥⃜⃡-⃫〪-゙〯-゚ꠂ꠆ꠋꠣ-ꠧﬞ︀-️︠-︣À-ÖØ-öø-ÿĀ-ɏɓ-ɔɖ-ɗəɛɣɨɯɲʉʋʻ̀-ͯḀ-ỿЀ-ӿԀ-ԧⷠ-ⷿꙀ-֑ꚟ-ֿׁ-ׂׄ-ׇׅא-תװ-״﬒-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﭏؐ-ؚؠ-ٟٮ-ۓە-ۜ۞-۪ۨ-ۯۺ-ۼۿݐ-ݿࢠࢢ-ࢬࣤ-ࣾﭐ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼ‌-‌ก-ฺเ-๎ᄀ-ᇿ㄰-ㆅꥠ-꥿가-힯ힰ-퟿ᄀ-ᅵァ-ヺー-ヾヲ-゚0-9A-Za-zぁ-ゖ゙-ゞ㐀-䶿一-鿿"+e(173824)+"-"+e(177983)+e(177984)+"-"+e(178207)+e(194560)+"-"+e(195103)+"〃々〻";return{alpha:t,alphanumeric:t+"0-9٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉០-៩᠐-᠙᥆-᥏᧐-᧙0-9_",hashChars:"#\\uFF03"}}(),r="["+t+"]";return"(^|$|[^&/"+t+"])(["+n+"])("+r+"*["+e+"]"+r+"*)"}(),"i");function L(){const[e]=(0,o.g)();(0,i.useEffect)((()=>{if(!e.hasNodes([F.DT]))throw new Error("HashtagPlugin: HashtagNode not registered on editor")}),[e]);const t=(0,i.useCallback)((e=>(0,F.Vu)(e.getTextContent())),[]),n=(0,i.useCallback)((e=>{const t=R.exec(e);if(null===t)return null;const n=t[3].length+1,r=t.index+t[1].length;return{end:r+n,start:r}}),[]);return function(e,t,n){const[r]=(0,o.g)();(0,i.useEffect)((()=>(0,h.qV)(...function(e,t,n,r){const i=e=>e instanceof n,o=e=>{const t=(0,c.MX)(e.getTextContent());t.setFormat(e.getFormat()),e.replace(t)};return[e.registerNodeTransform(c.R2,(e=>{if(!e.isSimpleText())return;let n,s=e.getPreviousSibling(),a=e.getTextContent(),l=e;if((0,c.Gg)(s)){const n=s.getTextContent(),r=t(n+a);if(i(s)){if(null===r||0!==(e=>e.getLatest().__mode)(s))return void o(s);{const t=r.end-n.length;if(t>0){const r=n+a.slice(0,t);if(s.select(),s.setTextContent(r),t===a.length)e.remove();else{const n=a.slice(t);e.setTextContent(n)}return}}}else if(null===r||r.start<n.length)return}let u=0;for(;;){n=t(a);let e,h=null===n?"":a.slice(n.end);if(a=h,""===h){const e=l.getNextSibling();if((0,c.Gg)(e)){h=l.getTextContent()+e.getTextContent();const n=t(h);if(null===n)return void(i(e)?o(e):e.markDirty());if(0!==n.start)return}}if(null===n)return;if(0===n.start&&(0,c.Gg)(s)&&s.isTextEntity()){u+=n.end;continue}0===n.start?[e,l]=l.splitText(n.end):[,e,l]=l.splitText(n.start+u,n.end+u),void 0===e&&d(165,"nodeToReplace");const p=r(e);if(p.setFormat(e.getFormat()),e.replace(p),null==l)return;u=0,s=p}})),e.registerNodeTransform(n,(e=>{const n=e.getTextContent(),r=t(n);if(null===r||0!==r.start)return void o(e);if(n.length>r.end)return void e.splitText(r.end);const s=e.getPreviousSibling();(0,c.Gg)(s)&&s.isTextEntity()&&(o(s),o(e));const a=e.getNextSibling();(0,c.Gg)(a)&&a.isTextEntity()&&(o(a),i(e)&&o(e))}))]}(r,e,t,n))),[n,r,e,t])}(n,F.DT,t),null}const Q=0,U=1,V=2,K=0,H=1,G=2,Y=3,z=4;function Z(e,t,n,r,i){if(null===e||0===n.size&&0===r.size&&!i)return K;const o=t._selection,s=e._selection;if(i)return H;if(!((0,c.OP)(o)&&(0,c.OP)(s)&&s.isCollapsed()&&o.isCollapsed()))return K;const a=function(e,t,n){const r=e._nodeMap,i=[];for(const e of t){const t=r.get(e);void 0!==t&&i.push(t)}for(const[e,t]of n){if(!t)continue;const n=r.get(e);void 0===n||(0,c.wd)(n)||i.push(n)}return i}(t,n,r);if(0===a.length)return K;if(a.length>1){const n=t._nodeMap,r=n.get(o.anchor.key),i=n.get(s.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&(0,c.Gg)(r)&&1===r.__text.length&&1===o.anchor.offset?G:K}const l=a[0],u=e._nodeMap.get(l.__key);if(!(0,c.Gg)(u)||!(0,c.Gg)(l)||u.__mode!==l.__mode)return K;const d=u.__text,h=l.__text;if(d===h)return K;const p=o.anchor,f=s.anchor;if(p.key!==f.key||"text"!==p.type)return K;const g=p.offset,m=f.offset,y=h.length-d.length;return 1===y&&m===g-1?G:-1===y&&m===g+1?Y:-1===y&&m===g?z:K}function W(e,t){let n=Date.now(),r=K;return(i,o,s,a,l,u)=>{const d=Date.now();if(u.has("historic"))return r=K,n=d,V;const h=Z(i,o,a,l,e.isComposing()),p=(()=>{const p=null===s||s.editor===e,f=u.has("history-push");if(!f&&p&&u.has("history-merge"))return Q;if(null===i)return U;const g=o._selection;return a.size>0||l.size>0?!1===f&&h!==K&&h===r&&d<n+t&&p||1===a.size&&function(e,t,n){const r=t._nodeMap.get(e),i=n._nodeMap.get(e),o=t._selection,s=n._selection;let a=!1;return(0,c.OP)(o)&&(0,c.OP)(s)&&(a="element"===o.anchor.type&&"element"===o.focus.type&&"text"===s.anchor.type&&"text"===s.focus.type),!(a||!(0,c.Gg)(r)||!(0,c.Gg)(i))&&r.__type===i.__type&&r.__text===i.__text&&r.__mode===i.__mode&&r.__detail===i.__detail&&r.__style===i.__style&&r.__format===i.__format&&r.__parent===i.__parent}(Array.from(a)[0],i,o)?Q:U:null!==g?Q:V})();return n=d,r=h,p}}function q(e){e.undoStack=[],e.redoStack=[],e.current=null}function J({externalHistoryState:e}){const[t]=(0,o.g)();return function(e,t,n=1e3){const r=(0,i.useMemo)((()=>t||{current:null,redoStack:[],undoStack:[]}),[t]);(0,i.useEffect)((()=>function(e,t,n){const r=W(e,n),i=(0,h.qV)(e.registerCommand(c.$l,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==r.length){const i=t.current,o=r.pop();null!==i&&(n.push(i),e.dispatchCommand(c.r0,!0)),0===r.length&&e.dispatchCommand(c.yn,!1),t.current=o||null,o&&o.editor.setEditorState(o.editorState,{tag:"historic"})}}(e,t),!0)),c.VN),e.registerCommand(c.zq,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==n.length){const i=t.current;null!==i&&(r.push(i),e.dispatchCommand(c.yn,!0));const o=n.pop();0===n.length&&e.dispatchCommand(c.r0,!1),t.current=o||null,o&&o.editor.setEditorState(o.editorState,{tag:"historic"})}}(e,t),!0)),c.VN),e.registerCommand(c.BM,(()=>(q(t),!1)),c.VN),e.registerCommand(c.Nr,(()=>(q(t),e.dispatchCommand(c.r0,!1),e.dispatchCommand(c.yn,!1),!0)),c.VN),e.registerUpdateListener((({editorState:n,prevEditorState:i,dirtyLeaves:o,dirtyElements:s,tags:a})=>{const l=t.current,u=t.redoStack,d=t.undoStack,h=null===l?null:l.editorState;if(null!==l&&n===h)return;const p=r(i,n,l,o,s,a);if(p===U)0!==u.length&&(t.redoStack=[],e.dispatchCommand(c.r0,!1)),null!==l&&(d.push({...l}),e.dispatchCommand(c.yn,!0));else if(p===V)return;t.current={editor:e,editorState:n}})));return i}(e,r,n)),[n,e,r])}(t,e),null}var X=n(93261);function $({validateUrl:e}){const[t]=(0,o.g)();return(0,i.useEffect)((()=>{if(!t.hasNodes([X.GR]))throw new Error("LinkPlugin: LinkNode not registered on editor");return(0,h.qV)(t.registerCommand(X.k0,(t=>{if(null===t)return(0,X.Rf)(t),!0;if("string"==typeof t)return!(void 0!==e&&!e(t)||((0,X.Rf)(t),0));{const{url:e,target:n,rel:r,title:i}=t;return(0,X.Rf)(e,{rel:r,target:n,title:i}),!0}}),c.KB),void 0!==e?t.registerCommand(c.A1,(n=>{const r=(0,c.dL)();if(!(0,c.OP)(r)||r.isCollapsed()||!(0,h.nh)(n,ClipboardEvent))return!1;const i=n;if(null===i.clipboardData)return!1;const o=i.clipboardData.getData("text");return!!e(o)&&!r.getNodes().some((e=>(0,c.F7)(e)))&&(t.dispatchCommand(X.k0,o),n.preventDefault(),!0)}),c.KB):()=>{})}),[t,e]),null}var ee=n(22311);function te(){const[e]=(0,o.g)();return(0,i.useEffect)((()=>{if(!e.hasNodes([ee.EG,ee.NK]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")}),[e]),t=e,(0,i.useEffect)((()=>(0,h.qV)(t.registerCommand(ee.B3,(()=>((0,ee.up)(t,"number"),!0)),c.KB),t.registerCommand(ee.A3,(()=>((0,ee.up)(t,"bullet"),!0)),c.KB),t.registerCommand(ee.GS,(()=>((0,ee.J_)(t),!0)),c.KB),t.registerCommand(c.K0,(()=>!!(0,ee.sp)()),c.KB))),[t]),null;var t}function ne(){const[e]=(0,o.g)();return(0,i.useEffect)((()=>e.registerCommand(_.qL,(e=>{const t=(0,c.dL)();if(!(0,c.OP)(t))return!1;if(null!==t.focus.getNode()){const e=(0,_.Dq)();t.focus.getNode().getTopLevelElementOrThrow().insertBefore(e)}return!0}),c.VN)),[e]),null}var re=n(79014),ie=n(93559),oe=n(26786),se=n(25207),ae=n(2577);function le(e){return e instanceof HTMLElement}class ce{constructor(e,t){this._x=e,this._y=t}get x(){return this._x}get y(){return this._y}equals(e){let{x:t,y:n}=e;return this.x===t&&this.y===n}calcDeltaXTo(e){let{x:t}=e;return this.x-t}calcDeltaYTo(e){let{y:t}=e;return this.y-t}calcHorizontalDistanceTo(e){return Math.abs(this.calcDeltaXTo(e))}calcVerticalDistance(e){return Math.abs(this.calcDeltaYTo(e))}calcDistanceTo(e){return Math.sqrt(Math.pow(this.calcDeltaXTo(e),2)+Math.pow(this.calcDeltaYTo(e),2))}}class ue{constructor(e,t,n,r){const[i,o]=t<=r?[t,r]:[r,t],[s,a]=e<=n?[e,n]:[n,e];this._top=i,this._right=a,this._left=s,this._bottom=o}get top(){return this._top}get right(){return this._right}get bottom(){return this._bottom}get left(){return this._left}get width(){return Math.abs(this._left-this._right)}get height(){return Math.abs(this._bottom-this._top)}equals(e){let{top:t,left:n,bottom:r,right:i}=e;return t===this._top&&r===this._bottom&&n===this._left&&i===this._right}contains(e){if(function(e){return e instanceof ce}(e)){const{x:t,y:n}=e,r=n<this._top,i=n>this._bottom,o=t<this._left,s=t>this._right;return{reason:{isOnBottomSide:i,isOnLeftSide:o,isOnRightSide:s,isOnTopSide:r},result:!(r||i||o||s)}}{const{top:t,left:n,bottom:r,right:i}=e;return t>=this._top&&t<=this._bottom&&r>=this._top&&r<=this._bottom&&n>=this._left&&n<=this._right&&i>=this._left&&i<=this._right}}intersectsWith(e){const{left:t,top:n,width:r,height:i}=e,{left:o,top:s,width:a,height:l}=this;return(t+r>=o+a?t+r:o+a)-(t<=o?t:o)<=r+a&&(n+i>=s+l?n+i:s+l)-(n<=s?n:s)<=i+l}generateNewRect(e){let{left:t=this.left,top:n=this.top,right:r=this.right,bottom:i=this.bottom}=e;return new ue(t,n,r,i)}static fromLTRB(e,t,n,r){return new ue(e,t,n,r)}static fromLWTH(e,t,n,r){return new ue(e,n,e+t,n+r)}static fromPoints(e,t){const{y:n,x:r}=e,{y:i,x:o}=t;return ue.fromLTRB(r,n,o,i)}static fromDOM(e){const{top:t,width:n,left:r,height:i}=e.getBoundingClientRect();return ue.fromLWTH(r,n,t,i)}}const de=-2,he=2,pe="draggable-block-menu",fe="application/x-lexical-drag-block";let ge="";const me=24,ye=1,ve=-1,Ae=0;let be=1/0;function we(e,t,n){const r=e.getBoundingClientRect(),i=ue.fromDOM(t),{marginTop:o,marginBottom:s}=window.getComputedStyle(t),a=i.generateNewRect({bottom:i.bottom+parseFloat(s),left:r.left,right:r.right,top:i.top-parseFloat(o)}),l=Array.from(t.children),c=["UL","OL","LI"];if(c.includes(t.tagName))for(const t of l){if(0===t.children.length)continue;if(!c.includes(t.tagName))continue;const r=we(e,t,n);if(r.contains.result)return r}return{contains:a.contains(n),element:t}}function Se(e,t,n){const r=function(e){return e.getEditorState().read((()=>(0,c.Gv)().getChildrenKeys()))}(t);let i=null;return t.getEditorState().read((()=>{let o=0===(s=r.length)?1/0:be>=0&&be<s?be:Math.floor(s/2);var s;let a=Ae;for(;o>=0&&o<r.length;){const s=r[o],l=t.getElementByKey(s);if(null===l)break;const{contains:c,element:u}=we(e,l,n);if(c.result){i=u,be=o;break}a===Ae&&(a=c.reason.isOnTopSide?ve:c.reason.isOnBottomSide?ye:1/0),o+=a}})),i}function Ce(e,t,n,r){const i=window.getComputedStyle(t),{top:o,height:s}=t.getBoundingClientRect(),{top:a,width:l}=r.getBoundingClientRect();let c=o;n-o>s/2?c+=s+parseFloat(i.marginBottom):c-=parseFloat(i.marginTop);const u=c-a-he,d=me-de;e.style.transform="translate(".concat(d,"px, ").concat(u,"px)"),e.style.width="".concat(l-2*(me-de),"px"),e.style.opacity=".6"}function Ee(e){e&&(e.style.opacity="0")}function Ie(e){let{anchorElem:t=document.body}=e;const[n]=(0,o.g)();return function(e,t,n){const o=t.parentElement,s=(0,i.useRef)(null),a=(0,i.useRef)(null),[l,u]=(0,i.useState)(null),d=(0,i.useRef)(null);(0,i.useEffect)((()=>{function n(n){const r=n.target;if(!le(r))return void u(null);if(r.closest(".".concat(pe)))return;const i=Se(t,e,new ce(n.clientX,n.clientY));u(i)}function r(){u(null)}return null==o||o.addEventListener("mousemove",n),null==o||o.addEventListener("mouseleave",r),()=>{null==o||o.removeEventListener("mousemove",n),null==o||o.removeEventListener("mouseleave",r)}}),[o,t,e]),(0,i.useEffect)((()=>{s.current&&function(e,t,n){if(!e)return void(t.style.opacity="0");const r=e.getBoundingClientRect(),i=window.getComputedStyle(e),o=t.getBoundingClientRect(),s=n.getBoundingClientRect(),a=r.top+(parseInt(i.lineHeight,10)-o.height)/2-s.top,l=de;t.style.opacity="1",t.style.transform="translate(".concat(l,"px, ").concat(a,"px)")}(l,s.current,t)}),[t,l]);const g=(0,i.useCallback)(((e,t,n,r)=>{let i=e;const o=t.getParent(),s=e.getParent();if((0,ee.I3)(s)&&!(0,ee.I3)(o)){const t=(0,ee.FH)(s.getListType());t.append(e),i=t}const{top:a,height:l}=n.getBoundingClientRect();r-a>l/2?t.insertAfter(i):t.insertBefore(i)}),[]);return(0,i.useEffect)((()=>(0,h.qV)(e.registerCommand(c.kE,(n=>function(n){const[r]=(0,f.UW)(n);if(r)return!1;const{pageY:i,target:o}=n;if(!le(o))return!1;if(!ge)return!1;const s=Se(t,e,new ce(n.pageX,i)),l=a.current;return null!==s&&null!==l&&(Ce(l,s,i,t),n.preventDefault(),!0)}(n)),c.KB),e.registerCommand(c.mY,(()=>(Ee(a.current),ge="",!0)),c.KB),e.registerCommand(c.zD,(n=>function(n){const[r]=(0,f.UW)(n);if(r)return!1;const{target:i,dataTransfer:o,pageY:s}=n;if(!le(i))return!1;const a=(null==o?void 0:o.getData(fe))||"",l=(0,c.gI)(a);if(!l)return!1;const d=Se(t,e,new ce(n.pageX,s));if(!d)return!1;const h=(0,c.Xo)(d);return!!h&&(h===l||(g(l,h,d,n.pageY),u(null)),!0)}(n)),c.Eo))),[t,e,g]),(0,p.createPortal)((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"icon draggable-block-menu",ref:s,draggable:!0,onDragStart:function(t){const n=t.dataTransfer;if(!n||!l)return;!function(e,t){const{transform:n}=t.style;t.style.transform="translateZ(0)",e.setDragImage(t,0,0),setTimeout((()=>{t.style.transform=n}))}(n,l);let r="";e.update((()=>{const e=(0,c.Xo)(l);e&&(r=e.getKey())})),n.setData(fe,r),ge=r},onDragEnd:function(){Ee(a.current),ge=""},onTouchStart:function(){l&&e.update((()=>{const e=(0,c.Xo)(l);if(!e)return;const t=e.getKey();d.current=t}))},onTouchMove:function(n){const{pageX:r,pageY:i}=n.targetTouches[0],o=e.getRootElement();if(o){const{top:e,bottom:t}=o.getBoundingClientRect(),n=20;i-e<n?o.scrollTop-=n:t-i<n&&(o.scrollTop+=n)}const s=Se(t,e,new ce(r,i)),l=a.current;null!==s&&null!==l&&Ce(l,s,i,t)},onTouchEnd:function(n){Ee(a.current),e.update((()=>{const{pageX:r,pageY:i}=n.changedTouches[0],o=d.current||"",s=(0,c.gI)(o);if(!s)return;const a=Se(t,e,new ce(r,i));if(!a)return;const l=(0,c.Xo)(a);l&&l!==s&&g(s,l,a,i)})),u(null)},children:(0,r.jsx)("div",{className:n?"icon":"",children:(0,r.jsx)(ae.BlockIcon,{className:"pointer-events-none text-text"})})}),(0,r.jsx)("div",{className:"draggable-block-target-line",ref:a})]}),t)}(n,t,n._editable)}var _e=n(36153);function xe(){const[e]=(0,o.g)();return(0,i.useEffect)((()=>(0,_e.dM)(e)),[e]),null}function Pe(){const[e]=(0,o.g)();return(0,i.useEffect)((()=>e.registerCommand(c.dB,(t=>{const n=(0,c.dL)();return!!(0,c.OP)(n)&&(t.preventDefault(),e.dispatchCommand(t.shiftKey?c.cz:c.PU,void 0))}),c.VN))),null}var ke=n(91031),Be=n(57140),Oe=n(87901),Ne=n(68608),De=n(82931);function je(e,t){if(!e)throw new Error("Internal Lexical error: invariant() is meant to be replaced at compile time. There is no runtime version.")}var Te=n(27055),Me=n(79021),Fe=n(20896),Re=n(37211),Le=n(51694);function Qe(e){const t=e.getShape();return{columns:t.toX-t.fromX+1,rows:t.toY-t.fromY+1}}function Ue(e){if(1!==e.getChildrenSize())return!1;const t=e.getFirstChildOrThrow();return!(!(0,c.Rl)(t)||!t.isEmpty())}function Ve(e){let{onClose:t,tableCellNode:n,cellMerge:s}=e;const[a]=(0,o.g)(),l=(0,i.useRef)(null),[u,d]=(0,i.useState)(n),[h,p]=(0,i.useState)({columns:1,rows:1}),[f,g]=(0,i.useState)(!1),[m,y]=(0,i.useState)(!1);(0,i.useEffect)((()=>a.registerMutationListener(B.Cr,(e=>{"updated"===e.get(u.getKey())&&a.getEditorState().read((()=>{d(u.getLatest())}))}))),[a,u]),(0,i.useEffect)((()=>{a.getEditorState().read((()=>{const e=(0,c.dL)();if((0,B.zO)(e)){const t=Qe(e);p(Qe(e)),g(function(e){const t=e.getNodes(),n=[];let r=null,i=null,o=0;for(let e=0;e<t.length;e++){const s=t[e];if((0,B.TF)(s)){const e=s.getParentOrThrow();if(je((0,B.to)(e)),r!==e){if(null!==i&&o!==i)return!1;null!==r&&(i=o),r=e,o=0}const t=s.__colSpan;for(let e=0;e<t;e++)void 0===n[o+e]&&(n[o+e]=0),n[o+e]+=s.__rowSpan;o+=t}}return(null===i||o===i)&&n.every((e=>e===n[0]))}(e)&&(t.columns>1||t.rows>1))}y(function(){const e=(0,c.dL)();if((0,c.OP)(e)&&!e.isCollapsed()||(0,B.zO)(e)&&!e.anchor.is(e.focus)||!(0,c.OP)(e)&&!(0,B.zO)(e))return!1;const[t]=(0,B.$r)(e.anchor);return t.__colSpan>1||t.__rowSpan>1}())}))}),[a]);const v=(0,i.useCallback)((()=>{a.update((()=>{if(u.isAttached()){const e=(0,B.Yp)(u),t=a.getElementByKey(e.getKey());if(!t)throw new Error("Expected to find tableElement in DOM");const n=(0,B.ng)(t);null!==n&&n.clearHighlight(),e.markDirty(),d(u.getLatest())}(0,c.Gv)().selectStart()}))}),[a,u]),A=(0,i.useCallback)((e=>{a.update((()=>{(0,B.EX)(e),t()}))}),[a,t]),b=(0,i.useCallback)((e=>{a.update((()=>{for(let t=0;t<h.columns;t++)(0,B.rU)(e);t()}))}),[a,t,h.columns]),w=(0,i.useCallback)((()=>{a.update((()=>{(0,B.kS)(),t()}))}),[a,t]),S=(0,i.useCallback)((()=>{a.update((()=>{(0,B.Yp)(u).remove(),v(),t()}))}),[a,u,v,t]),C=(0,i.useCallback)((()=>{a.update((()=>{(0,B.bk)(),t()}))}),[a,t]),E=(0,i.useCallback)((e=>{a.update((()=>{const n=(0,B.Yp)(u),r=(0,B.q1)(u),i=n.getChildren();if(r>=i.length||r<0)throw new Error("Expected table cell to be inside of table row.");const o=i[r];if(!(0,B.to)(o))throw new Error("Expected table row");o.getChildren().forEach((t=>{if(!(0,B.TF)(t))throw new Error("Expected table cell");void 0!==e?t.setHeaderStyles(e):t.toggleHeaderStyle(B.xo.ROW)})),v(),t()}))}),[a,u,v,t]),I=(0,i.useCallback)((e=>{a.update((()=>{const n=(0,B.Yp)(u),r=(0,B.yb)(u),i=n.getChildren();for(let t=0;t<i.length;t++){const n=i[t];if(!(0,B.to)(n))throw new Error("Expected table row");const o=n.getChildren();if(r>=o.length||r<0)throw new Error("Expected table cell to be inside of table row.");const s=o[r];if(!(0,B.TF)(s))throw new Error("Expected table cell");void 0!==e?s.setHeaderStyles(e):s.toggleHeaderStyle(B.xo.COLUMN)}v(),t()}))}),[a,u,v,t]);let _=null;s&&(f?_=(0,r.jsx)(Re.Z,{onClick:()=>{a.update((()=>{const e=(0,c.dL)();if((0,B.zO)(e)){const{columns:n,rows:r}=Qe(e),i=e.getNodes();let o=null;for(let e=0;e<i.length;e++){const t=i[e];if((0,B.TF)(t))if(null===o){let e;t.setColSpan(n).setRowSpan(r),o=t,Ue(t)&&(0,c.Rl)(e=t.getFirstChild())&&e.remove()}else(0,B.TF)(o)&&(Ue(t)||o.append(...t.getChildren()),t.remove())}null!==o&&(0===o.getChildrenSize()&&o.append((0,c.BE)()),function(e){const t=e.getLastDescendant();(0,c.Gg)(t)?t.select():(0,c.F7)(t)?t.selectEnd():null!==t&&t.selectNext()}(o)),t()}}))},children:"Merge cells"}):m&&(_=(0,r.jsx)(Re.Z,{onClick:()=>{a.update((()=>{(0,B.eb)()}))},children:"Unmerge cells"})));const x=(u.__headerState&B.xo.ROW)===B.xo.ROW,P=(u.__headerState&B.xo.COLUMN)===B.xo.COLUMN;return(0,r.jsxs)(Fe.Z,{className:"dropdown !px-0",ref:l,a11yLabel:"Table actions menu",children:[_,!!_&&(0,r.jsx)(Le.Z,{}),(0,r.jsxs)(Re.Z,{onClick:()=>A(!1),children:["Insert ",1===h.rows?"row":"".concat(h.rows," rows")," above"]}),(0,r.jsxs)(Re.Z,{onClick:()=>A(!0),children:["Insert ",1===h.rows?"row":"".concat(h.rows," rows")," below"]}),(0,r.jsx)(Le.Z,{}),(0,r.jsxs)(Re.Z,{onClick:()=>b(!1),children:["Insert ",1===h.columns?"column":"".concat(h.columns," columns")," left"]}),(0,r.jsxs)(Re.Z,{onClick:()=>b(!0),children:["Insert ",1===h.columns?"column":"".concat(h.columns," columns")," right"]}),(0,r.jsx)(Le.Z,{}),(0,r.jsx)(Re.Z,{onClick:C,children:"Delete column"}),(0,r.jsx)(Re.Z,{onClick:w,children:"Delete row"}),(0,r.jsx)(Re.Z,{onClick:S,children:"Delete table"}),(0,r.jsx)(Le.Z,{}),(0,r.jsxs)(Re.Z,{onClick:()=>{E(x?B.xo.NO_STATUS:B.xo.ROW)},children:[x?"Remove":"Add"," row header"]}),(0,r.jsxs)(Re.Z,{onClick:()=>{I(P?B.xo.NO_STATUS:B.xo.COLUMN)},children:[P?"Remove":"Add"," column header"]})]})}function Ke(e){let{anchorElem:t,cellMerge:n}=e;const[s]=(0,o.g)(),a=(0,i.useRef)(null),l=(0,i.useRef)(null),[u,d]=(0,i.useState)(!1),[h,p]=(0,i.useState)(null),f=(0,i.useCallback)((()=>{const e=a.current,t=(0,c.dL)(),n=window.getSelection(),r=document.activeElement;if(null==t||null==e)return void p(null);const i=s.getRootElement();if((0,c.OP)(t)&&null!==i&&null!==n&&i.contains(n.anchorNode)){const e=(0,B.Fk)(t.anchor.getNode());if(null==e)return void p(null);if(null==s.getElementByKey(e.getKey()))return void p(null);p(e)}else r||p(null)}),[s]);(0,i.useEffect)((()=>s.registerUpdateListener((()=>{s.getEditorState().read((()=>{f()}))}))));const g=(0,i.useCallback)((()=>{const e=a.current;if(null!=e&&null!=h){const n=s.getElementByKey(h.getKey());if(null!=n){const r=n.getBoundingClientRect(),i=e.getBoundingClientRect(),o=t.getBoundingClientRect(),s=r.top-o.top+i.height/2-2,a=r.right-i.width-8-o.left;e.style.opacity="1",e.style.transform="translate(".concat(a,"px, ").concat(s,"px)")}else e.style.opacity="0",e.style.transform="translate(-10000px, -10000px)"}}),[a,h,s,t]);(0,i.useEffect)((()=>{g()}),[g]),(0,i.useEffect)((()=>{const e=s.getRootElement(),t=()=>{s.getEditorState().read((()=>{g()})),d(!1)};return window.addEventListener("resize",t),e&&e.addEventListener("scroll",t),()=>{window.removeEventListener("resize",t),e&&e.removeEventListener("scroll",t)}}),[s,t,g]);const m=(0,i.useRef)(h);return(0,i.useEffect)((()=>{m.current!==h&&d(!1),m.current=h}),[m,h]),(0,r.jsx)("div",{className:"absolute left-0 top-0 will-change-transform",ref:a,children:null!=h&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Me.Z,{label:"Open table actions menu",icon:"chevron-down",iconProps:{size:"small"},className:"!h-6 !min-w-6 bg-default md:!h-5 md:!min-w-5",onClick:e=>{e.stopPropagation(),d(!u)},ref:l}),(0,r.jsx)(Te.Z,{open:u,title:"Table actions",className:"py-1",anchorElement:l,disableMobileFullscreenTakeover:!0,children:(0,r.jsx)(Ve,{onClose:()=>d(!1),tableCellNode:h,cellMerge:n})})]})})}function He(e){let{anchorElem:t=document.body,cellMerge:n=!1}=e;const i=l();return(0,p.createPortal)(i?(0,r.jsx)(Ke,{anchorElem:t,cellMerge:n}):null,t)}var Ge=n(47931),Ye=n(75043),ze=n(64739),Ze=n(98572),We=n(9256),qe=n(89139),Je=n(4694),Xe=n(21490),$e=n(94652),et=n(22798),tt=n(66208),nt=n(30626),rt=n(3555),it=n(29894),ot=n(84075),st=n(48518),at=n(46513),lt=n(75711),ct=n(98296),ut=n(16902),dt=n(39661),ht=n(20174),pt=n(88450);function ft(e){return[e.getKey(),e.getTextContent(),e.getTag()]}function gt(e,t,n){if(null===t)return n;const r=ft(t);let i=[];if(null===e){if(n.length>0&&n[0][0]===t.__key)return n;i=[r,...n]}else for(let o=0;o<n.length;o++){const s=n[o][0];if(i.push(n[o]),s===e.getKey()&&s!==t.getKey()){if(o+1<n.length&&n[o+1][0]===t.__key)return n;i.push(r)}}return i}function mt(e,t){const n=[];for(const r of t)r[0]!==e&&n.push(r);return n}function yt(e,t){const n=[];for(const r of t)r[0]===e.getKey()?n.push(ft(e)):n.push(r);return n}function vt(e,t,n){const r=[],i=ft(t);e||r.push(i);for(const o of n)o[0]!==t.getKey()&&(r.push(o),e&&o[0]===e.getKey()&&r.push(i));return r}function At(e){let t=(0,h._G)(e);for(;null!==t&&!(0,f.rc)(t);)t=(0,h._G)(t);return t}function bt({children:e}){const[t,n]=(0,i.useState)([]),[r]=(0,o.g)();return(0,i.useEffect)((()=>{let e=[];r.getEditorState().read((()=>{const t=(0,c.Gv)().getChildren();for(const n of t)(0,f.rc)(n)&&e.push([n.getKey(),n.getTextContent(),n.getTag()]);n(e)}));const t=r.registerUpdateListener((({editorState:t,dirtyElements:r})=>{t.read((()=>{const t=r=>{for(const i of r.getChildren())if((0,f.rc)(i)){const t=At(i);e=vt(t,i,e),n(e)}else(0,c.F7)(i)&&t(i)};(0,c.Gv)().getChildren().forEach((e=>{(0,c.F7)(e)&&r.get(e.__key)&&t(e)}))}))})),i=r.registerMutationListener(f.c2,(t=>{r.getEditorState().read((()=>{for(const[n,r]of t)if("created"===r){const t=(0,c.gI)(n);if(null!==t){const n=At(t);e=gt(n,t,e)}}else if("destroyed"===r)e=mt(n,e);else if("updated"===r){const t=(0,c.gI)(n);if(null!==t){const n=At(t);e=vt(n,t,e)}}n(e)}))})),o=r.registerMutationListener(c.R2,(t=>{r.getEditorState().read((()=>{for(const[r,i]of t)if("updated"===i){const t=(0,c.gI)(r);if(null!==t){const r=t.getParentOrThrow();(0,f.rc)(r)&&(e=yt(r,e),n(e))}}}))}));return()=>{i(),o(),t()}}),[r]),e(t,r)}var wt=n(24118),St=n(32620);function Ct(e,t){const n=e.getRangeAt(0);let r;if(e.anchorNode===t){let e=t;for(;null!=e.firstElementChild;)e=e.firstElementChild;r=e.getBoundingClientRect()}else{const e=n.getClientRects();r=function(e){const t=Math.min(...e.map((e=>e.left))),n=Math.min(...e.map((e=>e.top))),r=Math.max(...e.map((e=>e.right))),i=Math.max(...e.map((e=>e.bottom)));return new DOMRect(t,n,r-t,i-n)}(Array.from(e))}return r}var Et=n(756),It=n(32810),_t=n(72435),xt=n(38167);const Pt=e=>{let{editor:t,setIsEditingLink:n,isMobile:o,linkNode:s,linkTextNode:a}=e;var l;const[u,d]=(0,i.useState)(""),[f,g]=(0,i.useState)("");(0,i.useEffect)((()=>{t.getEditorState().read((()=>{s&&d(s.getURL()),a&&g(a.getTextContent())}))}),[t,s,a]);const m=(0,i.useRef)(null),y=(0,i.useRef)(null),v=(0,i.useRef)(),A=(0,i.useRef)(),b=(0,i.useCallback)((()=>{A.current&&cancelAnimationFrame(A.current),A.current=requestAnimationFrame((()=>{var e,n;if(o)return void(null===(e=m.current)||void 0===e||e.focus());const r=window.getSelection(),i=t.getRootElement();null!==r&&null!==i&&i.contains(r.anchorNode)&&(v.current=Ct(r,i));const s=y.current;if(!s)return void setTimeout(b);if(!i)return;if(!v.current)return;const a=s.getBoundingClientRect(),l=i.getBoundingClientRect(),c=(0,St.w)({align:"center",side:"top",anchorRect:v.current,popoverRect:a,documentRect:l,offset:12,maxHeightFunction:()=>"none"});if(c){const e=(0,xt.p)(s,c);Object.entries(e).forEach((e=>{let[t,n]=e;s.style.setProperty(t,n)})),s.style.display="block",null===(n=m.current)||void 0===n||n.focus()}}))}),[t,o]);(0,It.g)(y.current,b),(0,i.useEffect)((()=>(b(),(0,h.qV)(t.registerUpdateListener((()=>{b()})),t.registerCommand(c.oj,(e=>(b(),!1)),c.KB)))),[t,b]);const w=()=>{""!==u&&t.dispatchCommand(X.k0,(e=>(e=String(e).trim()).match(/^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi)||e.match(/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i)?e:"https://")(u)),null!==a&&""!==f&&t.update((()=>{a.setTextContent(f)}),{discrete:!0}),n(!1)};return(0,i.useEffect)((()=>{const e=y.current;if(!e)return;const t=t=>{e.contains(t.relatedTarget)||n(!1)};return e.addEventListener("focusout",t),()=>{e.removeEventListener("focusout",t)}}),[n]),(0,p.createPortal)((0,r.jsx)("div",{className:(0,it.classNames)("absolute z-dropdown-menu rounded-lg border border-border bg-contrast px-2 py-1 shadow-sm shadow-contrast",o?"bottom-12 left-1/2 w-[calc(100%_-_1rem)] -translate-x-1/2":"left-0 top-0 hidden w-auto translate-x-0 translucent-ui:border-[--popover-border-color] translucent-ui:bg-[--popover-background-color] translucent-ui:[backdrop-filter:var(--popover-backdrop-filter)]"),ref:y,children:(0,r.jsxs)("div",{className:"flex flex-col gap-2 py-1",children:[a&&(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)(Ge.Z,{type:"plain-text",className:"flex-shrink-0"}),(0,r.jsx)("input",{value:f,onChange:e=>{g(e.target.value)},onKeyDown:e=>{e.key===ot.u8.Enter?(e.preventDefault(),w()):e.key===ot.u8.Escape&&(e.preventDefault(),n(!1))},className:"flex-grow rounded-sm border border-border bg-contrast p-1 text-text sm:min-w-[20ch] translucent-ui:md:border-0"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)(Ge.Z,{type:"link",className:"flex-shrink-0"}),(0,r.jsx)("input",{ref:m,value:u,onChange:e=>{d(e.target.value)},onKeyDown:e=>{e.key===ot.u8.Enter?(e.preventDefault(),w()):e.key===ot.u8.Escape&&(e.preventDefault(),n(!1))},className:"flex-grow rounded-sm border border-border bg-contrast p-1 text-text sm:min-w-[40ch] translucent-ui:md:border-0"})]}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-1.5",children:[(0,r.jsx)(lt.Z,{showOnMobile:!0,showOnHover:!0,label:"Cancel editing",children:(0,r.jsx)(Et.Z,{onClick:()=>{n(!1),t.focus()},onMouseDown:e=>e.preventDefault(),children:"Cancel"})}),(0,r.jsx)(lt.Z,{showOnMobile:!0,showOnHover:!0,label:"Save link",children:(0,r.jsx)(Et.Z,{primary:!0,onClick:w,onMouseDown:e=>e.preventDefault(),children:"Apply"})})]})]})}),null!==(l=document.getElementById(_t.N.SuperEditor))&&void 0!==l?l:document.body)};var kt=n(38232),Bt=n(5778),Ot=n(20266);const Nt=e=>{let{isMobile:t,editor:n,linkNode:o,setIsEditingLink:s}=e;var a;const l=(0,i.useRef)(null),[u,d]=(0,i.useMemo)((()=>{let e="",t=!1;return n.getEditorState().read((()=>{e=o.getURL(),t=(0,X.Xp)(o)})),[e,t]}),[n,o]),f=(0,i.useMemo)((()=>n.getElementByKey(o.getKey())),[n,o]),g=(0,i.useRef)(),m=(0,i.useCallback)((()=>{if(t)return;const e=window.getSelection(),r=n.getRootElement();null!==e&&null!==r&&r.contains(e.anchorNode)&&(g.current=Ct(e,r));const i=l.current;if(!i)return void setTimeout(m);if(!r)return;if(!f)return;const o=i.getBoundingClientRect(),s=r.getBoundingClientRect(),a=f.getBoundingClientRect(),c=(0,St.w)({align:"center",side:"top",anchorRect:a,popoverRect:o,documentRect:s,offset:12,maxHeightFunction:()=>"none"});if(c){const e=(0,xt.p)(i,c);Object.entries(e).forEach((e=>{let[t,n]=e;i.style.setProperty(t,n)})),i.style.opacity="1"}}),[n,t,f]);return(0,It.g)(l.current,m),(0,i.useEffect)((()=>(m(),(0,h.qV)(n.registerUpdateListener((()=>{m()})),n.registerCommand(c.oj,(e=>(m(),!1)),c.KB)))),[n,m]),u?(0,p.createPortal)((0,r.jsx)("div",{className:(0,it.classNames)("absolute z-dropdown-menu rounded-lg border border-border bg-contrast px-2 py-1 shadow-sm shadow-contrast",t?"bottom-12 left-1/2 w-[calc(100%_-_1rem)] -translate-x-1/2":"left-0 top-0 w-auto translate-x-0 opacity-0 translucent-ui:border-[--popover-border-color] translucent-ui:bg-[--popover-background-color] translucent-ui:[backdrop-filter:var(--popover-backdrop-filter)]"),ref:l,children:(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsxs)("a",{className:(0,it.classNames)("mr-1 flex flex-grow items-center gap-2 overflow-hidden whitespace-nowrap underline",d&&"py-2.5"),href:u,target:"_blank",rel:"noopener noreferrer",children:[(0,r.jsx)(Ge.Z,{type:"open-in",className:"ml-1 flex-shrink-0"}),(0,r.jsx)("div",{className:"max-w-[35ch] overflow-hidden text-ellipsis",children:u})]}),(0,r.jsx)(lt.Z,{showOnMobile:!0,showOnHover:!0,label:"Copy link",children:(0,r.jsx)("button",{className:"flex select-none items-center justify-center rounded p-2 enabled:hover:bg-default disabled:opacity-50 md:border md:border-transparent enabled:hover:md:translucent-ui:border-[--popover-border-color]",onClick:()=>{navigator.clipboard.writeText(u).catch(console.error)},onMouseDown:e=>e.preventDefault(),children:(0,r.jsx)(Ge.Z,{type:"copy",size:"medium"})})}),!d&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(lt.Z,{showOnMobile:!0,showOnHover:!0,label:"Edit link",children:(0,r.jsx)("button",{className:"flex select-none items-center justify-center rounded p-2 enabled:hover:bg-default disabled:opacity-50 md:border md:border-transparent enabled:hover:md:translucent-ui:border-[--popover-border-color]",onClick:()=>{s(!0)},onMouseDown:e=>e.preventDefault(),children:(0,r.jsx)(Ge.Z,{type:"pencil-filled",size:"medium"})})}),(0,r.jsx)(lt.Z,{showOnMobile:!0,showOnHover:!0,label:"Remove link",children:(0,r.jsx)("button",{className:"flex select-none items-center justify-center rounded p-2 enabled:hover:bg-default disabled:opacity-50 md:border md:border-transparent enabled:hover:md:translucent-ui:border-[--popover-border-color]",onClick:()=>{n.dispatchCommand(X.k0,null)},onMouseDown:e=>e.preventDefault(),children:(0,r.jsx)(Ge.Z,{type:"trash-filled",size:"medium"})})})]})]})}),null!==(a=document.getElementById(_t.N.SuperEditor))&&void 0!==a?a:document.body):null};var Dt=n(65123);const jt=["name","active","iconName","children","onSelect","disabled","className"],Tt=["name","iconName","active","onClick"];function Mt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ft(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mt(Object(n),!0).forEach((function(t){Rt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Rt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lt(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}const Qt=(0,c.fA)("TOGGLE_LINK_AND_EDIT_COMMAND"),Ut={bullet:"Bulleted List",check:"Check List",code:"Code Block",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",number:"Numbered List",paragraph:"Normal",quote:"Quote"},Vt={bullet:"list-bulleted",check:"list-check",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",number:"list-numbered",paragraph:"paragraph",quote:"quote"},Kt=(0,i.forwardRef)(((e,t)=>{let{name:n,active:i,iconName:s,children:a,onSelect:l,disabled:c,className:u}=e,d=Lt(e,jt);var h,p;const[f]=(0,o.g)(),g=(0,rt.ac)(rt.Jj.sm),m=null!==(p=null===(h=f.getRootElement())||void 0===h?void 0:h.parentElement)&&void 0!==p?p:document.body;return(0,r.jsx)(lt.Z,{showOnMobile:!0,showOnHover:!0,label:n,side:"top",portal:!1,portalElement:g?m:void 0,documentElement:m,children:(0,r.jsx)(ct.E,Ft(Ft({className:(0,it.classNames)("flex select-none items-center justify-center rounded p-0.5 focus:shadow-none focus:outline-none enabled:hover:bg-default enabled:focus-visible:bg-default disabled:opacity-50 md:border md:border-transparent enabled:hover:md:translucent-ui:border-[--popover-border-color]",u),onClick:()=>{l()},onMouseDown:e=>{e.preventDefault()},onContextMenu:e=>{f.focus(),e.preventDefault()},disabled:c,ref:t},d),{},{children:(0,r.jsx)("div",{className:(0,it.classNames)("flex items-center justify-center rounded p-2 transition-colors duration-75",i&&"bg-info text-info-contrast"),children:a||(s?(0,r.jsx)(Ge.Z,{type:s,size:"custom",className:"h-4 w-4 !text-current md:h-3.5 md:w-3.5 [&>path]:!text-current"}):null)})}))})})),Ht=e=>{let{name:t,iconName:n,active:i,onClick:o}=e,s=Lt(e,Tt);return(0,r.jsxs)(Re.Z,Ft(Ft({className:(0,it.classNames)("overflow-hidden md:py-2",i?"!bg-info !text-info-contrast":"hover:bg-contrast"),onClick:o,onMouseDown:e=>e.preventDefault()},s),{},{children:[(0,r.jsx)(Ge.Z,{type:n,className:"-mt-px mr-2.5 flex-shrink-0"}),(0,r.jsx)("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:t}),i&&(0,r.jsx)(Ge.Z,{type:"check",className:"ml-auto"})]}))},Gt=()=>{var e,t,n;const s=(0,st.I)(),a=(0,rt.ac)(rt.Jj.sm),[l,u]=(0,Ye.Z)(),[d]=(0,o.g)(),[p,g]=(0,i.useState)(d),[m,y]=(0,i.useState)((()=>d.isEditable())),[v,A]=(0,i.useState)("paragraph"),[b,w]=(0,i.useState)("left"),[S,C]=(0,i.useState)(!1),[E,I]=(0,i.useState)(!1),[_,x]=(0,i.useState)(!1),[P,k]=(0,i.useState)(!1),[B,O]=(0,i.useState)(!1),[N,D]=(0,i.useState)(!1),[j,T]=(0,i.useState)(!1),[M,F]=(0,i.useState)(!1),[R,L]=(0,i.useState)(null),[Q,U]=(0,i.useState)(null),[V,K]=(0,i.useState)(!1),[H,G]=(0,i.useState)(!1),Y=(0,i.useRef)(null),[z,Z]=(0,i.useState)(!1),W=(0,i.useRef)(null),[q,J]=(0,i.useState)(!1),$=(0,i.useRef)(null),[te,ne]=(0,i.useState)(!1),re=(0,i.useRef)(null),[ie,oe]=(0,i.useState)(!1),se=(0,i.useRef)(null),[ae,le]=(0,i.useState)(!1),[ce,ue]=(0,i.useState)(!1),de=(0,i.useRef)(null),he=(0,Bt.Z)(it.PrefKey.AlwaysShowSuperToolbar),[pe,fe]=(0,i.useState)(he),ge=(0,kt.Y)(pe),me=(0,i.useCallback)((()=>{const e=(0,c.dL)();if(!(0,c.OP)(e))return;if(a)return;if(ge.current)return;const t=de.current;if(!t)return;if(""===e.getTextContent())return void t.style.removeProperty("display");const n=window.getSelection(),r=p.getRootElement();if(null!==n&&null!==r&&r.contains(n.anchorNode)){const e=Ct(n,r),i=t.getBoundingClientRect(),o=r.getBoundingClientRect(),s=(0,St.w)({align:"start",side:"top",anchorRect:e,popoverRect:i,documentRect:o,offset:8,maxHeightFunction:()=>"none"});s&&(Object.entries(s).forEach((e=>{let[n,r]=e;"transform"!==n&&t.style.setProperty(n,r)})),t.style.setProperty("display","block"))}}),[p,a,ge]),ye=(0,i.useCallback)((()=>{const e=(0,c.dL)();if(!(0,c.OP)(e))return;const t=e.anchor.getNode(),n=t===e.focus.getNode();let r="root"===t.getKey()?t:(0,h.$s)(t,(e=>{const t=e.getParent();return null!==t&&(0,c._v)(t)}));null===r&&(r=t.getTopLevelElementOrThrow());const i=r.getKey(),o=p.getElementByKey(i);C(e.hasFormat("bold")),I(e.hasFormat("italic")),x(e.hasFormat("underline")),k(e.hasFormat("strikethrough")),O(e.hasFormat("subscript")),D(e.hasFormat("superscript")),T(e.hasFormat("code")),F(e.hasFormat("highlight"));const s=function(e){const t=e.anchor,n=e.focus,r=e.anchor.getNode(),i=e.focus.getNode();return r===i?r:e.isBackward()?(0,ze.P4)(n)?r:i:(0,ze.P4)(t)?i:r}(e),a=s.getParent();if(K(!1),(0,X.Pq)(s)&&n?L(s):(0,X.Pq)(a)&&n?L(a):L(null),((e,t)=>{const n=e.getParent();return(0,X.Pq)(n)&&1===n.getChildrenSize()&&(0,c.Gg)(e)&&n.getFirstChild()===e&&t.anchor.getNode()===t.focus.getNode()})(s,e)?U(s):U(null),null!==o)if((0,ee.I3)(r)){const e=(0,h.yD)(t,ee.EG),n=e?e.getListType():r.getListType();A(n)}else{const e=(0,f.rc)(r)?r.getTag():r.getType();e in Ut&&A(e)}w(((0,c.F7)(s)?s.getFormatType():null==a?void 0:a.getFormatType())||"left"),me()}),[p,me]),ve=(0,i.useCallback)((()=>{const e=de.current;e&&(e.style.removeProperty("--translate-x"),e.style.removeProperty("--translate-y"),e.style.removeProperty("transform"),e.style.removeProperty("transform-origin"),e.style.removeProperty("opacity"))}),[]),Ae=(0,i.useCallback)((()=>{p.update((()=>{const e=(0,c.dL)();if((0,c.OP)(e)){const t=e.anchor,n=e.focus,r=e.getNodes();if(t.key===n.key&&t.offset===n.offset)return;r.forEach(((e,i)=>{if((0,c.Gg)(e)){let o=e;0===i&&0!==t.offset&&(o=o.splitText(t.offset)[1]||o),i===r.length-1&&(o=o.splitText(n.offset)[0]||o),""!==o.__style&&o.setStyle(""),0!==o.__format&&(o.setFormat(0),(0,h.f8)(o).setFormat("")),e=o}else(0,f.rc)(e)||(0,f.O)(e)?e.replace((0,c.BE)(),!0):(0,Ot.F)(e)&&e.setFormat("")}))}}))}),[p]);(0,i.useEffect)((()=>{if(a)return;const e=p.getRootElement(),t=(0,wt.Ds)((()=>{p.getEditorState().read((()=>{me()}))}),50);return window.addEventListener("resize",t),e&&e.addEventListener("scroll",t),()=>{window.removeEventListener("resize",t),e&&e.removeEventListener("scroll",t)}}),[p,a,me]),(0,i.useEffect)((()=>(0,h.qV)(d.registerEditableListener((e=>{y(e)})),d.registerCommand(c.oj,((e,t)=>(ye(),g(t),!1)),c.jw))),[d,ye]),(0,i.useEffect)((()=>(0,h.qV)(p.registerUpdateListener((e=>{let{editorState:t}=e;t.read((()=>{ye()}))})),p.registerCommand(c.yn,(e=>(le(e),!1)),c.jw),p.registerCommand(c.r0,(e=>(ue(e),!1)),c.jw),p.registerCommand(Qt,(e=>null===e?(K(!1),p.dispatchCommand(X.k0,null)):(K(!0),!0)),c.KB))),[ye,p]),(0,i.useEffect)((()=>p.registerCommand(c.yb,(e=>{const t=e,{code:n,ctrlKey:r,metaKey:i,shiftKey:o}=t;return!("KeyK"!==n||!r&&!i||o||(t.preventDefault(),"readText"in navigator.clipboard?navigator.clipboard.readText().then((e=>{if(!pt.Wh.test(e))throw new Error("Not a valid URL");p.dispatchCommand(X.k0,e)})).catch((e=>{console.error(e),p.dispatchCommand(Qt,"")})):p.dispatchCommand(Qt,""),0))}),c.u6)),[p]);const be=(0,i.useRef)(null),[we,Se]=(0,i.useState)(!1),[Ce,Ee]=(0,i.useState)(!1),Ie=we||Ce,_e=a||pe;(0,i.useEffect)((()=>{const e=de.current,t=d.getRootElement();if(!t)return;const n=()=>Ee(!0),r=()=>Ee(!1),i=()=>Se(!0),o=t=>{var n;const r=t.relatedTarget,i=null==e?void 0:e.contains(r),o=null===(n=document.getElementById(_t.N.SuperEditor))||void 0===n?void 0:n.contains(r),s=be.current===r;(!i&&!o||s)&&Se(!1)};return t.addEventListener("focus",i),t.addEventListener("blur",o),e&&(e.addEventListener("focus",n),e.addEventListener("blur",r)),()=>{t.removeEventListener("focus",i),t.removeEventListener("blur",o),null==e||e.removeEventListener("focus",n),null==e||e.removeEventListener("blur",r)}}),[d]);const xe=(0,i.useRef)(null),Pe=(0,ut.r)();(0,i.useEffect)((()=>s.keyboardService.addCommandHandler({command:ot.Qx,category:"Super notes",description:"Toggle Super note toolbar",onKeyDown(e){if(!a&&he){if(e.preventDefault(),!pe)return fe(!0),ve(),void Pe.move(Pe.first());fe(!1),d.focus()}}})),[he,s.keyboardService,ve,d,a,pe,Pe]);const ke=null!==(n=null!==(e=document.getElementById(_t.N.SuperEditor))&&void 0!==e?e:null===(t=d.getRootElement())||void 0===t?void 0:t.parentElement)&&void 0!==n?n:document.body;return(0,r.jsxs)(r.Fragment,{children:[l,(0,r.jsxs)("div",{className:(0,it.classNames)("bg-contrast",m?"":"hidden opacity-0",a&&!Ie?"hidden":"",!a&&"border-b border-border bg-default",a?"":pe?"w-full px-1 py-1":"fixed left-0 top-0 z-tooltip hidden translate-x-[--translate-x] translate-y-[--translate-y] rounded border py-0.5 translucent-ui:border-[--popover-border-color] translucent-ui:bg-[--popover-background-color] translucent-ui:[backdrop-filter:var(--popover-backdrop-filter)]"),id:"super-mobile-toolbar",ref:de,children:[R&&!V&&(0,r.jsx)(Nt,{linkNode:R,isMobile:a,setIsEditingLink:K,editor:p},R.__key),V&&(0,r.jsx)(Pt,{editor:p,setIsEditingLink:K,isMobile:a,linkNode:R,linkTextNode:Q}),(0,r.jsxs)("div",{className:"flex w-full flex-shrink-0 border-t border-border md:border-0",children:[(0,r.jsxs)(dt.o,{className:"super-toolbar flex items-center gap-1 overflow-x-auto px-1 md:flex-wrap",ref:xe,store:Pe,children:[_e&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Kt,{name:"Table of Contents",iconName:"toc",active:H,onSelect:()=>G(!H),ref:Y}),(0,r.jsx)(Kt,{name:"Search",iconName:"search",onSelect:()=>s.keyboardService.triggerCommand(ot.Ix)}),(0,r.jsx)(Kt,{name:"Undo",iconName:"undo",disabled:!ae,onSelect:()=>d.dispatchCommand(c.$l,void 0)}),(0,r.jsx)(Kt,{name:"Redo",iconName:"redo",disabled:!ce,onSelect:()=>d.dispatchCommand(c.zq,void 0)})]}),(0,r.jsxs)(Kt,{name:"Formatting options",onSelect:()=>{J(!q)},ref:$,className:q?"md:bg-default":"",children:[(0,r.jsx)(Ge.Z,{type:Vt[v],size:"custom",className:"h-4 w-4 md:h-3.5 md:w-3.5"}),(0,r.jsx)(Ge.Z,{type:"chevron-down",size:"custom",className:"ml-2 h-4 w-4 md:h-3.5 md:w-3.5"})]}),(0,r.jsx)(Kt,{name:"Bold",iconName:"bold",active:S,onSelect:()=>d.dispatchCommand(c.Ew,"bold")}),(0,r.jsx)(Kt,{name:"Italic",iconName:"italic",active:E,onSelect:()=>d.dispatchCommand(c.Ew,"italic")}),(0,r.jsx)(Kt,{name:"Underline",iconName:"underline",active:_,onSelect:()=>d.dispatchCommand(c.Ew,"underline")}),(0,r.jsx)(Kt,{name:"Link",iconName:"link",active:!!R,onSelect:()=>{d.dispatchCommand(Qt,"")}}),(0,r.jsx)(Kt,{name:"Inline Code",iconName:"code-tags",active:j,onSelect:()=>d.dispatchCommand(c.Ew,"code")}),(0,r.jsxs)(Kt,{name:"Text style",onSelect:()=>{Z(!z)},ref:W,className:z?"md:bg-default":"",children:[(0,r.jsx)(Ge.Z,{type:"text",size:"custom",className:"h-4 w-4 md:h-3.5 md:w-3.5"}),(0,r.jsx)(Ge.Z,{type:"chevron-down",size:"custom",className:"ml-1 h-4 w-4 md:h-3.5 md:w-3.5"})]}),(0,r.jsxs)(Kt,{name:"Alignment",onSelect:()=>{ne(!te)},ref:re,className:te?"md:bg-default":"",children:[(0,r.jsx)(Ge.Z,{type:"align-left",size:"custom",className:"h-4 w-4 md:h-3.5 md:w-3.5"}),(0,r.jsx)(Ge.Z,{type:"chevron-down",size:"custom",className:"ml-2 h-4 w-4 md:h-3.5 md:w-3.5"})]}),(0,r.jsx)(Kt,{name:et.b.name,iconName:et.b.iconName,onSelect:()=>et.b.onSelect(d)}),(0,r.jsx)(Kt,{name:et.Cc.name,iconName:et.Cc.iconName,onSelect:()=>et.Cc.onSelect(d)}),_e&&(0,r.jsxs)(Kt,{name:"Insert",onSelect:()=>{oe(!ie)},ref:se,className:ie?"md:bg-default":"",children:[(0,r.jsx)(Ge.Z,{type:"add",size:"custom",className:"h-4 w-4 md:h-3.5 md:w-3.5"}),(0,r.jsx)(Ge.Z,{type:"chevron-down",size:"custom",className:"ml-2 h-4 w-4 md:h-3.5 md:w-3.5"})]})]}),a&&(0,r.jsx)("button",{className:"flex flex-shrink-0 items-center justify-center rounded border-l border-border px-3 py-3","aria-label":"Dismiss keyboard",ref:be,children:(0,r.jsx)(Ge.Z,{type:"keyboard-close",size:"medium"})})]})]}),(0,r.jsxs)(Te.Z,{title:"Table of contents",anchorElement:Y,open:H,togglePopover:()=>G(!H),side:a?"top":"bottom",align:"start",className:"py-1",disableMobileFullscreenTakeover:!0,disableFlip:!0,disableApplyingMobileWidth:!0,portal:!1,documentElement:ke,children:[(0,r.jsx)("div",{className:"mb-1.5 mt-1 px-3 text-sm font-semibold uppercase text-text",children:"Table of Contents"}),(0,r.jsx)(bt,{children:e=>e.length?(0,r.jsx)(Fe.Z,{a11yLabel:"Table of contents",className:"!px-0",children:e.map((e=>{let[t,n,i]=e;const o=parseInt(i.slice(1))||1;return o>3?null:(0,r.jsxs)(Re.Z,{className:"overflow-hidden md:py-2",onClick:()=>{G(!1),d.update((()=>{const e=(0,c.gI)(t);if(!e)return;e.selectEnd(),d.focus();const n=d.getElementByKey(t);n&&setTimeout((()=>{n.scrollIntoView({behavior:"smooth",block:"start"})}),1)}))},onMouseDown:e=>e.preventDefault(),style:{paddingLeft:"".concat((o-1)*(0,wt.cv)(1)+(0,wt.cv)(.75),"px")},children:[(0,r.jsx)(Ge.Z,{type:i,className:"-mt-px mr-2.5 flex-shrink-0"}),(0,r.jsx)("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:n})]},t)}))}):(0,r.jsx)("div",{className:"py-2 text-center",children:"No headings found"})})]}),(0,r.jsx)(Te.Z,{title:"Text formatting options",anchorElement:W,open:z,togglePopover:()=>Z(!z),side:a?"top":"bottom",align:"start",className:"py-1",disableMobileFullscreenTakeover:!0,disableFlip:!0,containerClassName:"md:!min-w-60 md:!w-auto",portal:!1,documentElement:ke,children:(0,r.jsxs)(Fe.Z,{a11yLabel:"Text formatting options",className:"!px-0",onClick:()=>Z(!1),children:[(0,r.jsx)(Ht,{name:"Highlight",iconName:"draw",active:M,onClick:()=>d.dispatchCommand(c.Ew,"highlight")}),(0,r.jsx)(Ht,{name:"Strikethrough",iconName:"strikethrough",active:P,onClick:()=>d.dispatchCommand(c.Ew,"strikethrough")}),(0,r.jsx)(Ht,{name:"Subscript",iconName:"subscript",active:B,onClick:()=>d.dispatchCommand(c.Ew,"subscript")}),(0,r.jsx)(Ht,{name:"Superscript",iconName:"superscript",active:N,onClick:()=>d.dispatchCommand(c.Ew,"superscript")}),(0,r.jsx)(Ht,{name:"Clear formatting",iconName:"trash",onClick:Ae})]})}),(0,r.jsx)(Te.Z,{title:"Block style",anchorElement:$,open:q,togglePopover:()=>J(!q),side:a?"top":"bottom",align:"start",className:"py-1",disableMobileFullscreenTakeover:!0,disableFlip:!0,containerClassName:"md:!min-w-60 md:!w-auto",portal:!1,documentElement:ke,children:(0,r.jsxs)(Fe.Z,{a11yLabel:"Block style",className:"!px-0",onClick:()=>J(!1),children:[(0,r.jsx)(Ht,{name:"Normal",iconName:"paragraph",active:"paragraph"===v,onClick:()=>tt.O.onSelect(d)}),(0,r.jsx)(Ht,{name:"Heading 1",iconName:"h1",active:"h1"===v,onClick:()=>$e.SH.onSelect(d)}),(0,r.jsx)(Ht,{name:"Heading 2",iconName:"h2",active:"h2"===v,onClick:()=>$e.p2.onSelect(d)}),(0,r.jsx)(Ht,{name:"Heading 3",iconName:"h3",active:"h3"===v,onClick:()=>$e.M8.onSelect(d)}),(0,r.jsx)(Le.Z,{}),(0,r.jsx)(Ht,{name:"Bulleted List",iconName:"list-bulleted",active:"bullet"===v,onClick:()=>We.Vb.onSelect(d)}),(0,r.jsx)(Ht,{name:"Numbered List",iconName:"list-numbered",active:"number"===v,onClick:()=>We.Ee.onSelect(d)}),(0,r.jsx)(Ht,{name:"Check List",iconName:"list-check",active:"check"===v,onClick:()=>We.vE.onSelect(d)}),(0,r.jsx)(Le.Z,{}),(0,r.jsx)(Ht,{name:"Quote",iconName:"quote",active:"quote"===v,onClick:()=>nt.V.onSelect(d)}),(0,r.jsx)(Ht,{name:"Code Block",iconName:"code",active:"code"===v,onClick:()=>qe.d.onSelect(d)})]})}),(0,r.jsx)(Te.Z,{title:"Alignment",anchorElement:re,open:te,togglePopover:()=>ne(!te),side:a?"top":"bottom",align:"start",className:"py-1",disableMobileFullscreenTakeover:!0,disableFlip:!0,containerClassName:"md:!min-w-60 md:!w-auto",portal:!1,documentElement:ke,children:(0,r.jsxs)(Fe.Z,{a11yLabel:"Alignment",className:"!px-0",onClick:()=>ne(!1),children:[(0,r.jsx)(Ht,{name:"Left align",iconName:"align-left",active:"left"===b,onClick:()=>Ze.vn.onSelect(d)}),(0,r.jsx)(Ht,{name:"Center align",iconName:"align-center",active:"center"===b,onClick:()=>Ze.QK.onSelect(d)}),(0,r.jsx)(Ht,{name:"Right align",iconName:"align-right",active:"right"===b,onClick:()=>Ze.zN.onSelect(d)}),(0,r.jsx)(Ht,{name:"Justify",iconName:"align-justify",active:"justify"===b,onClick:()=>Ze.Cj.onSelect(d)})]})}),(0,r.jsx)(Te.Z,{title:"Insert",anchorElement:se,open:ie,togglePopover:()=>oe(!ie),side:a?"top":"bottom",align:"start",className:"py-1",disableMobileFullscreenTakeover:!0,disableFlip:!0,containerClassName:"md:!min-w-60 md:!w-auto",portal:!1,documentElement:ke,children:(0,r.jsxs)(Fe.Z,{a11yLabel:"Insert",className:"!px-0",onClick:()=>oe(!1),children:[(0,r.jsx)(Ht,{name:"Table",iconName:"table",onClick:()=>u("Insert Table",(e=>(0,r.jsx)(De.n,{activeEditor:d,onClose:e})))}),(0,r.jsx)(Ht,{name:"Upload file",iconName:"file",onClick:()=>p.dispatchCommand(Dt.J,void 0)}),(0,r.jsx)(Ht,{name:"Image from URL",iconName:"image",onClick:()=>u("Insert image from URL",(e=>(0,r.jsx)(at.a,{onClose:e})))}),(0,r.jsx)(Ht,{name:Xe.j.name,iconName:Xe.j.iconName,onClick:()=>Xe.j.onSelect(d)}),(0,r.jsx)(Ht,{name:Je.J.name,iconName:Je.J.iconName,onClick:()=>Je.J.onSelect(d)}),(0,r.jsx)(Ht,{name:ht.SC.name,iconName:ht.SC.iconName,onClick:()=>ht.SC.onSelect(d)})]})})]})};var Yt=n(37658);const zt=function(){const e=[];for(const[t,n]of Object.entries(_e.Wq))e.push([t,n]);return e}(),Zt=()=>{const[e]=(0,o.g)(),[t,n]=(0,i.useState)(!1),[s,a]=(0,i.useState)(""),[l,u]=(0,i.useState)(null),d=(0,i.useCallback)((()=>{if(!e.isEditable())return void n(!1);const t=(0,c.dL)();if(!(0,c.OP)(t))return;const r=t.anchor.getNode();let i="root"===r.getKey()?r:(0,h.$s)(r,(e=>{const t=e.getParent();return null!==t&&(0,c._v)(t)}));null===i&&(i=r.getTopLevelElementOrThrow());const o=i.getKey();if(null!==e.getElementByKey(o))if(u(o),(0,_e.Pe)(i)){n(!0);const e=i.getLanguage();a(e?_e.md[e]||e:"")}else n(!1)}),[e]);(0,i.useEffect)((()=>(0,h.qV)(e.registerUpdateListener((e=>{let{editorState:t}=e;t.read((()=>{d()}))})))),[e,d]);const p=(0,i.useCallback)((t=>{e.update((()=>{if(null!==l){const e=(0,c.gI)(l);(0,_e.Pe)(e)&&e.setLanguage(t)}}))}),[e,l]);return t?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:"absolute right-6 top-13 rounded border border-border bg-default p-2",children:(0,r.jsx)(Yt.Z,{label:"Change code block language",items:zt.map((e=>{let[t,n]=e;return{label:n,value:t}})),value:(0,_e.r0)(s),onChange:e=>{p(e)}})})}):null};function Wt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wt(Object(n),!0).forEach((function(t){Jt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Jt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Xt=(0,i.createContext)(void 0),$t=()=>{const e=(0,i.useContext)(Xt);if(!e)throw new Error("useSuperSearchContext must be used within a SuperSearchContextProvider");return e},en={query:"",results:[],currentResultIndex:-1,isCaseSensitive:!1,isSearchActive:!1,isReplaceMode:!1},tn=(e,t)=>{switch(t.type){case"set-query":return qt(qt({},e),{},{query:t.query});case"set-results":return qt(qt({},e),{},{results:t.results,currentResultIndex:t.results.length>0?0:-1});case"clear-results":return qt(qt({},e),{},{results:[],currentResultIndex:-1});case"set-current-result-index":return qt(qt({},e),{},{currentResultIndex:t.index});case"toggle-search":return qt(qt({},en),{},{isSearchActive:!e.isSearchActive});case"toggle-case-sensitive":return qt(qt({},e),{},{isCaseSensitive:!e.isCaseSensitive});case"toggle-replace-mode":{const t=!e.isReplaceMode;return qt(qt({},e),{},{isSearchActive:!(!t||e.isSearchActive)||e.isSearchActive,isReplaceMode:t})}case"go-to-next-result":return qt(qt({},e),{},{currentResultIndex:e.results.length<1?-1:e.currentResultIndex+1<e.results.length?e.currentResultIndex+1:0});case"go-to-previous-result":return qt(qt({},e),{},{currentResultIndex:e.results.length<1?-1:e.currentResultIndex-1>=0?e.currentResultIndex-1:e.results.length-1});case"reset-search":return qt({},en)}},nn=e=>{let{children:t}=e;const[n,o]=(0,i.useReducer)(tn,en),s=(0,i.useRef)(new Set),a=(0,i.useCallback)((e=>(s.current.add(e),()=>{s.current.delete(e)})),[]),l=(0,i.useCallback)((e=>{s.current.forEach((t=>t(e)))}),[]),c=(0,i.useMemo)((()=>qt(qt({},n),{},{dispatch:o,addReplaceEventListener:a,dispatchReplaceEvent:l})),[a,l,n]);return(0,r.jsx)(Xt.Provider,{value:c,children:t})};var rn=n(44783),on=n(13959);const sn={keyframes:[{opacity:0,transform:"translateY(-100%)"},{opacity:1,transform:"translateY(0)"}],options:{easing:"ease-in-out",duration:150,fill:"forwards"},initialStyle:{transformOrigin:"top"}},an={keyframes:[{opacity:1,transform:"translateY(0)"},{opacity:0,transform:"translateY(-100%)"}],options:{easing:"ease-in-out",duration:150,fill:"forwards"},initialStyle:{transformOrigin:"top"}};var ln=n(64503);const cn=e=>{let{open:t,closeDialog:n}=e;const[s]=(0,o.g)(),{query:a,results:l,currentResultIndex:c,isCaseSensitive:u,isReplaceMode:d,dispatch:h,dispatchReplaceEvent:p}=$t(),[f,g]=(0,i.useState)(""),m=(0,i.useCallback)((e=>{e&&e.focus()}),[]),[y,v]=(0,ln.r)({open:t,enter:sn,exit:an}),A=(0,rn.o)(),b=(0,i.useMemo)((()=>(0,ot.Ld)(A.keyboardShortcutForCommand(ot.Ix))),[A]),w=(0,i.useMemo)((()=>(0,ot.Ld)(A.keyboardShortcutForCommand(ot.p6))),[A]),S=(0,i.useMemo)((()=>(0,ot.Ld)(A.keyboardShortcutForCommand(ot.zI))),[A]);return y?(0,r.jsxs)("div",{className:(0,Oe.classNames)("absolute left-2 right-6 top-2 z-10 flex select-none rounded border border-border bg-default md:left-auto",s.isEditable()?"md:top-13":"md:top-3"),ref:v,children:[s.isEditable()&&(0,r.jsx)("button",{className:"focus:ring-none border-r border-border px-1 hover:bg-contrast focus:shadow-inner focus:shadow-info",onClick:()=>{h({type:"toggle-replace-mode"})},title:"Toggle Replace Mode (".concat(w,")"),children:d?(0,r.jsx)(ae.ArrowDownIcon,{className:"h-4 w-4 fill-text"}):(0,r.jsx)(ae.ArrowRightIcon,{className:"h-4 w-4 fill-text"})}),(0,r.jsxs)("div",{className:"flex flex-col gap-2 px-2 py-2",onKeyDown:e=>{e.key===ot.u8.Escape&&n()},children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(on.Z,{placeholder:"Search",className:{container:(0,Oe.classNames)("flex-grow !text-[length:inherit]",!a.length&&"!py-1"),right:"!py-1"},value:a,onChange:e=>{h({type:"set-query",query:e})},onKeyDown:e=>{if("Enter"===e.key&&l.length){if(e.shiftKey)return void h({type:"go-to-previous-result"});h({type:"go-to-next-result"})}},ref:m,right:[(0,r.jsx)("div",{className:"min-w-[7ch] max-w-[7ch] flex-shrink-0 whitespace-nowrap text-right",children:a.length>0&&(0,r.jsxs)(r.Fragment,{children:[c>-1?c+1+" / ":null,l.length]})})]}),(0,r.jsxs)("label",{className:(0,Oe.classNames)("relative flex items-center rounded border px-1.5 py-1 focus-within:ring-2 focus-within:ring-info focus-within:ring-offset-2 focus-within:ring-offset-default",u?"border-info bg-info text-info-contrast":"border-border hover:bg-contrast"),title:"Case sensitive (".concat(S,")"),children:[(0,r.jsx)("input",{type:"checkbox",className:"absolute left-0 top-0 z-[1] m-0 h-full w-full cursor-pointer border border-transparent p-0 opacity-0 shadow-none outline-none",checked:u,onChange:()=>{h({type:"toggle-case-sensitive"})}}),(0,r.jsx)("span",{"aria-hidden":!0,children:"Aa"}),(0,r.jsx)("span",{className:"sr-only",children:"Case sensitive"})]}),(0,r.jsx)("button",{className:"flex items-center rounded border border-border p-1.5 hover:bg-contrast disabled:cursor-not-allowed",onClick:()=>{h({type:"go-to-previous-result"})},disabled:l.length<1,title:"Previous result (Shift + Enter)",children:(0,r.jsx)(ae.ArrowUpIcon,{className:"h-4 w-4 fill-current text-text"})}),(0,r.jsx)("button",{className:"flex items-center rounded border border-border p-1.5 hover:bg-contrast disabled:cursor-not-allowed",onClick:()=>{h({type:"go-to-next-result"})},disabled:l.length<1,title:"Next result (Enter)",children:(0,r.jsx)(ae.ArrowDownIcon,{className:"h-4 w-4 fill-current text-text"})}),(0,r.jsx)("button",{className:"flex items-center rounded border border-border p-1.5 hover:bg-contrast",onClick:()=>{n()},title:"Close (".concat(b,")"),children:(0,r.jsx)(ae.CloseIcon,{className:"h-4 w-4 fill-current text-text"})})]}),d&&(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2 md:flex-nowrap",children:[(0,r.jsx)("input",{type:"text",placeholder:"Replace",onChange:e=>{g(e.target.value)},onKeyDown:e=>{if("Enter"===e.key&&f&&l.length){if(e.ctrlKey&&e.altKey)return p({type:"all",replace:f}),void e.preventDefault();p({type:"next",replace:f}),e.preventDefault()}},className:"rounded border border-border bg-default p-1 px-2",ref:m}),(0,r.jsx)(Et.Z,{small:!0,onClick:()=>{p({type:"next",replace:f})},disabled:l.length<1||f.length<1,title:"Replace (Ctrl + Enter)",children:"Replace"}),(0,r.jsx)(Et.Z,{small:!0,onClick:()=>{p({type:"all",replace:f})},disabled:l.length<1||f.length<1,title:"Replace all (Ctrl + Alt + Enter)",children:"Replace all"})]})]})]}):null},un=()=>{const e=(0,st.I)(),[t]=(0,o.g)(),{query:n,currentResultIndex:s,results:a,isCaseSensitive:l,isSearchActive:u,dispatch:d,addReplaceEventListener:h}=$t(),p=(0,kt.Y)(n),f=(0,kt.Y)(s),g=(0,kt.Y)(l),m=(0,kt.Y)(a);(0,i.useEffect)((()=>e.keyboardService.addCommandHandlers([{command:ot.Ix,category:"Super notes",description:"Search in current note",onKeyDown:e=>{e.preventDefault(),e.stopPropagation(),d({type:"toggle-search"})}},{command:ot.p6,category:"Super notes",description:"Search and replace in current note",onKeyDown:e=>{t.isEditable()&&(e.preventDefault(),e.stopPropagation(),d({type:"toggle-replace-mode"}))}},{command:ot.zI,onKeyDown(){d({type:"toggle-case-sensitive"})}},{command:ot.yc,category:"Super notes",description:"Go to next search result",onKeyDown(e){e.preventDefault(),e.stopPropagation(),d({type:"go-to-next-result"})}},{command:ot.fq,category:"Super notes",description:"Go to previous search result",onKeyDown(e){e.preventDefault(),e.stopPropagation(),d({type:"go-to-previous-result"})}}])),[e.keyboardService,d,t]);const y=(0,i.useCallback)(((e,n)=>{document.querySelectorAll(".search-highlight").forEach((e=>{e.remove()})),e?t.getEditorState().read((()=>{const r=t.getRootElement();if(!r)return;const i=(e=>{const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);let r=n.nextNode();for(;r;)t.push(r),r=n.nextNode();return t})(r),o=[];i.forEach((t=>{const r=t.textContent||"",i=[];let s=-1;const a=n?r:r.toLowerCase(),l=n?e:e.toLowerCase();for(;-1!==(s=a.indexOf(l,s+1));)i.push(s);i.forEach((n=>{const r=n,i=r+e.length;o.push({node:t,startIndex:r,endIndex:i})}))})),d({type:"set-results",results:o})})):d({type:"clear-results"})}),[d,t]),v=(0,i.useMemo)((()=>(0,Oe.debounce)(y,250)),[y]),A=(0,i.useMemo)((()=>(0,Oe.debounce)(y,500)),[y]);(0,i.useEffect)((()=>{if(!n)return d({type:"clear-results"}),void d({type:"set-current-result-index",index:-1});v(n,g.current)}),[d,v,g,n]),(0,i.useEffect)((()=>{y(p.current,l)}),[y,l,p]),(0,i.useLayoutEffect)((()=>t.registerUpdateListener((e=>{let{dirtyElements:t,dirtyLeaves:n,prevEditorState:r,tags:i}=e;0===t.size&&0===n.size||i.has("history-merge")||r.isEmpty()||A(p.current,g.current)}))),[t,A,g,p]),(0,i.useEffect)((()=>h((e=>{const{replace:n,type:r}=e,i=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{node:r,startIndex:i,endIndex:o}=e,s=(0,c.Xo)(r);s&&(s instanceof c.R2&&s.spliceText(i,o-i,n,!0),t&&r.parentElement&&r.parentElement.scrollIntoView({block:"center"}))};t.update((()=>{if("next"===r){const e=m.current[f.current];if(!e)return;i(e,!0)}else"all"===r&&m.current.forEach((e=>i(e)));y(p.current,g.current)}))}))),[h,f,t,y,g,p,m]),(0,i.useEffect)((()=>{if(document.querySelectorAll(".search-highlight").forEach((e=>{e.remove()})),-1===s)return;const e=a[s];t.getEditorState().read((()=>{var n,r;const i=t.getRootElement(),o=null===(n=null==i?void 0:i.parentElement)||void 0===n?void 0:n.getElementsByClassName("search-highlight-container")[0];null===(r=e.node.parentElement)||void 0===r||r.scrollIntoView({block:"center"}),i&&o&&((e,t,n)=>{const r=t.getBoundingClientRect(),i=document.createRange();i.setStart(e.node,e.startIndex),i.setEnd(e.node,e.endIndex);const o=i.getClientRects();Array.from(o).forEach(((i,o)=>{const s="search-".concat(e.startIndex,"-").concat(e.endIndex,"-").concat(o);if(document.getElementById(s))return;const a=document.createElement("div");a.style.position="absolute",a.style.zIndex="1000",a.style.transform="translate(".concat(i.left-r.left,"px, ").concat(i.top-r.top+t.scrollTop,"px)"),a.style.width="".concat(i.width,"px"),a.style.height="".concat(i.height,"px"),a.style.backgroundColor="var(--sn-stylekit-info-color)",a.style.opacity="0.5",a.className="search-highlight",a.id=s,n.appendChild(a)}))})(e,i,o)}))}),[s,t,a]),(0,i.useEffect)((()=>{let e,n;if(t.getEditorState().read((()=>{var r;n=t.getRootElement(),e=null===(r=null==n?void 0:n.parentElement)||void 0===r?void 0:r.querySelector(".search-highlight-container")})),!n||!e)return;const r=new ResizeObserver((()=>{n&&e&&(e.style.height="".concat(n.scrollHeight,"px"),e.style.overflow="visible")}));r.observe(n);const i=()=>{n&&e&&(e.style.top="-".concat(n.scrollTop,"px"))};return n.addEventListener("scroll",i),()=>{r.disconnect(),null==n||n.removeEventListener("scroll",i)}}),[t]);const b=(0,i.useCallback)((()=>{if(0===a.length)return;const e=a[s];e&&t.update((()=>{const t=(0,c.vN)();(0,c.oq)(t);const n=(0,c.Xo)(e.node);(0,c.Gg)(n)&&n.select(e.startIndex,e.endIndex)}))}),[s,t,a]);return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(cn,{open:u,closeDialog:()=>{b(),d({type:"toggle-search"}),d({type:"reset-search"}),t.focus()}})})};var dn=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));function hn(e,t=(e=>e)){return n=>{const r=e.exec(n);return null===r?null:{index:r.index,length:r[0].length,text:r[0],url:t(r[0])}}}function pn(e,t){for(let n=0;n<t.length;n++){const r=t[n](e);if(r)return r}return null}const fn=/[.,;\s]/;function gn(e){return fn.test(e)}function mn(e){return gn(e[e.length-1])}function yn(e){return gn(e[0])}function vn(e){let t=e.getPreviousSibling();return(0,c.F7)(t)&&(t=t.getLastDescendant()),null===t||(0,c.A3)(t)||(0,c.Gg)(t)&&mn(t.getTextContent())}function An(e){let t=e.getNextSibling();return(0,c.F7)(t)&&(t=t.getFirstDescendant()),null===t||(0,c.A3)(t)||(0,c.Gg)(t)&&yn(t.getTextContent())}function bn(e,t,n,r){return!!(e>0?gn(n[e-1]):vn(r[0]))&&(t<n.length?gn(n[t]):An(r[r.length-1]))}function wn(e,t,n){const r=[],i=[],o=[];let s=0,a=0;const l=[...e];for(;l.length>0;){const e=l[0],c=e.getTextContent().length,u=a;a+c<=t?(r.push(e),s+=c):u>=n?o.push(e):i.push(e),a+=c,l.shift()}return[s,r,i,o]}function Sn(e,t,n,r){const i=(0,X.Ol)(r.url,r.attributes);if(1===e.length){let o,s=e[0];0===t?[o,s]=s.splitText(n):[,o,s]=s.splitText(t,n);const a=(0,c.MX)(r.text);return a.setFormat(o.getFormat()),a.setDetail(o.getDetail()),a.setStyle(o.getStyle()),i.append(a),o.replace(i),s}if(e.length>1){const r=e[0];let o,s=r.getTextContent().length;0===t?o=r:[,o]=r.splitText(t);const a=[];let l;for(let t=1;t<e.length;t++){const r=e[t],i=r.getTextContent().length,o=s;if(o<n)if(s+i<=n)a.push(r);else{const[e,t]=r.splitText(n-o);a.push(e),l=t}s+=i}const u=(0,c.dL)(),d=u?u.getNodes().find(c.Gg):void 0,h=(0,c.MX)(o.getTextContent());return h.setFormat(o.getFormat()),h.setDetail(o.getDetail()),h.setStyle(o.getStyle()),i.append(h,...a),d&&d===o&&((0,c.OP)(u)?h.select(u.anchor.offset,u.focus.offset):(0,c.iO)(u)&&h.select(0,h.getTextContent().length)),o.replace(i),l}}function Cn(e,t,n){const r=e.getChildren(),i=r.length;for(let t=0;t<i;t++){const i=r[t];if(!(0,c.Gg)(i)||!i.isSimpleText())return En(e),void n(null,e.getURL())}const o=e.getTextContent(),s=pn(o,t);if(null===s||s.text!==o)return En(e),void n(null,e.getURL());if(!vn(e)||!An(e))return En(e),void n(null,e.getURL());const a=e.getURL();if(a!==s.url&&(e.setURL(s.url),n(s.url,a)),s.attributes){const t=e.getRel();t!==s.attributes.rel&&(e.setRel(s.attributes.rel||null),n(s.attributes.rel||null,t));const r=e.getTarget();r!==s.attributes.target&&(e.setTarget(s.attributes.target||null),n(s.attributes.target||null,r))}}function En(e){const t=e.getChildren();for(let n=t.length-1;n>=0;n--)e.insertAfter(t[n]);return e.remove(),t.map((e=>e.getLatest()))}function In({matchers:e,onChange:t}){const[n]=(0,o.g)();return function(e,t,n){(0,i.useEffect)((()=>{e.hasNodes([X.qp])||dn(77);const r=(e,t)=>{n&&n(e,t)};return(0,h.qV)(e.registerNodeTransform(c.R2,(e=>{const n=e.getParentOrThrow(),i=e.getPreviousSibling();if((0,X.Xp)(n))Cn(n,t,r);else if(!(0,X.Pq)(n)){if(e.isSimpleText()&&(yn(e.getTextContent())||!(0,X.Xp)(i))){const n=function(e){const t=[e];let n=e.getNextSibling();for(;null!==n&&(0,c.Gg)(n)&&n.isSimpleText()&&(t.push(n),!/[\s]/.test(n.getTextContent()));)n=n.getNextSibling();return t}(e);!function(e,t,n){let r=[...e];const i=r.map((e=>e.getTextContent())).join("");let o,s=i,a=0;for(;(o=pn(s,t))&&null!==o;){const e=o.index,t=e+o.length;if(bn(a+e,a+t,i,r)){const[i,,s,l]=wn(r,a+e,a+t),c=Sn(s,a+e-i,a+t-i,o);r=c?[c,...l]:l,n(o.url,null),a=0}else a+=t;s=s.substring(t)}}(n,t,r)}!function(e,t,n){const r=e.getPreviousSibling(),i=e.getNextSibling(),o=e.getTextContent();(0,X.Xp)(r)&&!yn(o)&&(r.append(e),Cn(r,t,n),n(null,r.getURL())),(0,X.Xp)(i)&&!mn(o)&&(En(i),Cn(i,t,n),n(null,i.getURL()))}(e,t,r)}})))}),[e,t,n])}(n,e,t),null}const _n=[hn(pt.Wh,(e=>e.startsWith("http")?e:"https://".concat(e))),hn(pt.CU,(e=>"mailto:".concat(e)))];function xn(){return(0,r.jsx)(In,{matchers:_n})}var Pn=n(66498),kn=n(93632);function Bn(){const[e]=(0,o.g)();return(0,i.useEffect)((()=>(0,h.qV)(e.registerCommand(Pn.gD,(t=>{const n=new Date,r=(0,c.dL)();if(!(0,c.OP)(r))return!1;const i=r.focus.getNode(),o=r.focus.offset,s=(0,c.Rl)(i)&&0===o,a=t.includes("date"),l=t.includes("time"),u=[],d=s?(0,f.V1)("datetime"===t?"h1":"h2"):(0,c.BE)();if(a){const e=(0,c.MX)((0,kn.AF)(n,!1));e.setFormat("italic"),d.append(e)}if(l){const e=(0,c.MX)((0,kn.DZ)(n));e.toggleFormat("italic"),a&&e.toggleFormat("superscript"),d.append(e)}d.append((0,c.MX)(" ")),u.push(d);const h=(0,c.BE)();return s&&u.push(h),r.insertNodes(u),s&&e.dispatchCommand(_.qL,void 0),!0}),c.VN))),[e]),null}const On="abcdefghijklmnopqrstuvwxyz".split(""),Nn=On.map((e=>e.toUpperCase())),Dn="!£$%^&*()@~:;,./?{}=-_".split(""),jn=[...On,...Nn,...Dn],Tn=jn.length;function Mn(e){const t=Dn.some((t=>e.includes(t))),n=Nn.some((t=>e.includes(t)));return On.some((t=>e.includes(t)))&&n&&t}function Fn(){const[e]=(0,o.g)();return(0,i.useEffect)((()=>(0,h.qV)(e.registerCommand(Pn.wN,(e=>{const t=Number(e),n=(0,c.dL)();if(!(0,c.OP)(n))return!1;const r=(0,c.BE)(),i=function(e){const t=new Uint8Array(e);let n="";do{window.crypto.getRandomValues(t),n=[...t].map((e=>jn[e%Tn])).join("")}while(!Mn(n));return n}(t);return r.append((0,c.MX)(i)),n.insertNodes([r]),!0}),c.VN))),[e]),null}function Rn(){const e=(0,st.I)(),[t]=(0,o.g)();return(0,i.useEffect)((()=>{const n=(0,ot.dP)(e.platform);return(0,h.qV)(t.registerCommand(ee.d1,(()=>((0,ee.up)(t,"check"),!0)),c.KB),t.registerRootListener(((e,n)=>{function r(e,n){var r;const i=e.target;if(null===i||!(0,c.Re)(i))return;const o=i.firstChild;if(null!=o&&(0,c.Re)(o)&&("UL"===o.tagName||"OL"===o.tagName))return;const s=i.parentNode;if(!s||"check"!==s.__lexicalListType)return;null===(r=t.getRootElement())||void 0===r||r.focus();const a=i.getBoundingClientRect(),l=getComputedStyle(i),u=parseFloat(l.paddingLeft)||0,d=parseFloat(l.paddingRight)||0,p=parseFloat(l.lineHeight)||0,f=getComputedStyle(i,":before"),g=parseFloat(f.width)||0,m=e.pageX/(0,h.MZ)(i),y="rtl"===i.dir?m<a.right&&m>a.right-d:m>a.left&&m<a.left+(g||u),v=e.clientY>a.top&&e.clientY<a.top+p;y&&v&&n()}function i(e){r(e,(()=>{t.isEditable()&&t.update((()=>{const t=e.target;if(!e.target)return;const n=(0,c.Xo)(t);(0,ee.QG)(n)&&n.toggleChecked()}))}))}function o(e){r(e,(()=>{e.preventDefault()}))}null!==e&&(e.addEventListener("click",i),e.addEventListener("pointerdown",o)),null!==n&&(n.removeEventListener("click",i),n.removeEventListener("pointerdown",o))})),t.registerCommand(c.XN,(()=>{var t;if(!e.keyboardService.activeModifiers.has(n))return!1;const r=(0,c.dL)();if(!(0,c.OP)(r)||!r.isCollapsed())return!1;const i=r.focus.getNode(),o=i.getParent(),s=(0,ee.QG)(o)?o:i;return!(!(0,ee.QG)(s)||"check"!==(null===(t=s.getParent())||void 0===t?void 0:t.getListType())||(s.toggleChecked(),0))}),c.KB),e.keyboardService.registerExternalKeyboardShortcutHelpItem({platform:e.platform,modifiers:[n],key:"Enter",category:"Super notes",description:"Toggle checklist item"}))}),[e.keyboardService,e.platform,t]),null}const Ln=e=>{let{onChange:t,className:n,children:o,previewLength:s,spellcheck:a,ignoreFirstChange:l=!1,readonly:c,onFocus:u,onBlur:d}=e;const[h,p]=(0,i.useState)(!1),f=(0,i.useCallback)(((e,n)=>{!l||h?e.read((()=>{(0,ke.S)(e,s,t)})):p(!0)}),[l,h,s,t]),[g,m]=(0,i.useState)(null),v=(0,rt.ac)(rt.Jj.sm);return(0,r.jsxs)(r.Fragment,{children:[!v&&(0,r.jsx)(Gt,{}),(0,r.jsx)("div",{className:"relative min-h-0 flex-grow",children:(0,r.jsx)(y,{contentEditable:(0,r.jsx)("div",{id:"blocks-editor",className:"editor-scroller h-full min-h-0",children:(0,r.jsxs)("div",{className:"editor z-0 overflow-hidden",ref:e=>{null!==e&&m(e)},children:[(0,r.jsx)(b,{id:Be._,className:(0,Oe.classNames)("ContentEditable__root relative overflow-y-auto p-4 text-[length:--font-size] leading-[--line-height] focus:shadow-none focus:outline-none",n),spellCheck:a,onFocus:u,onBlur:d}),(0,r.jsx)("div",{className:"search-highlight-container pointer-events-none absolute left-0 top-0 h-full w-full"})]})}),placeholder:(0,r.jsxs)("div",{className:"pointer-events-none absolute left-4 top-4 text-[length:--font-size] text-passive-1",children:["Type ",(0,r.jsx)("span",{className:"rounded bg-passive-4-opacity-variant p-0.5",children:"/"})," for commands..."]}),ErrorBoundary:M})}),v&&(0,r.jsx)(Gt,{}),(0,r.jsx)(te,{}),(0,r.jsx)(P,{transformers:Ne.c}),(0,r.jsx)(N,{hasCellMerge:!0}),(0,r.jsx)(S,{onChange:f,ignoreSelectionChange:!0}),(0,r.jsx)(J,{}),(0,r.jsx)(ne,{}),(0,r.jsx)(E,{}),(0,r.jsx)(Rn,{}),(0,r.jsx)(xe,{}),(0,r.jsx)($,{}),(0,r.jsx)(L,{}),(0,r.jsx)(oe.ZP,{}),(0,r.jsx)(re.Z,{}),(0,r.jsx)(ie.Z,{}),(0,r.jsx)(se.ZP,{}),(0,r.jsx)(Pe,{}),(0,r.jsx)(De.V,{}),(0,r.jsx)(at.Z,{}),(0,r.jsx)(Zt,{}),(0,r.jsx)(nn,{children:(0,r.jsx)(un,{})}),(0,r.jsx)(Bn,{}),(0,r.jsx)(Fn,{}),(0,r.jsx)(xn,{}),!c&&g&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ie,{anchorElem:g}),(0,r.jsx)(He,{anchorElem:g,cellMerge:!0})]}),o]})}},59846:(e,t,n)=>{"use strict";n.d(t,{I:()=>p});var r=n(52322),i=n(47166),o=n(31031),s=n(2784);const a="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,l=a?s.useLayoutEffect:s.useEffect,c={tag:"history-merge"};function u({initialConfig:e,children:t}){const n=(0,s.useMemo)((()=>{const{theme:t,namespace:n,editor__DEPRECATED:r,nodes:s,onError:l,editorState:u,html:d}=e,h=(0,i.LI)(null,t);let p=r||null;if(null===p){const r=(0,o.Jh)({editable:e.editable,html:d,namespace:n,nodes:s,onError:e=>l(e,r),theme:t});!function(e,t){if(null!==t)if(void 0===t)e.update((()=>{const t=(0,o.Gv)();if(t.isEmpty()){const n=(0,o.BE)();t.append(n);const r=a?document.activeElement:null;(null!==(0,o.dL)()||null!==r&&r===e.getRootElement())&&n.select()}}),c);else if(null!==t)switch(typeof t){case"string":{const n=e.parseEditorState(t);e.setEditorState(n,c);break}case"object":e.setEditorState(t,c);break;case"function":e.update((()=>{(0,o.Gv)().isEmpty()&&t(e)}),c)}}(r,u),p=r}return[p,h]}),[]);return l((()=>{const t=e.editable,[r]=n;r.setEditable(void 0===t||t)}),[]),(0,r.jsx)(i.YK.Provider,{value:n,children:t})}var d=n(34521),h=n(41421);const p=e=>{let{initialValue:t,children:n,readonly:i,nodes:o=[]}=e;return(0,r.jsx)(u,{initialConfig:{namespace:"BlocksEditor",theme:d.Z,editable:!i,onError:e=>console.error(e),editorState:"string"==typeof t&&0===t.length?void 0:t,nodes:[...o,...h.G]},children:(0,r.jsx)(r.Fragment,{children:n})})}},57140:(e,t,n)=>{"use strict";n.d(t,{_:()=>r});const r="super-editor-content"},75043:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(52322),i=n(2784),o=n(3038);function s(){const[e,t]=(0,i.useState)(null),n=(0,i.useCallback)((()=>{t(null)}),[]),s=(0,i.useMemo)((()=>{if(null===e)return null;const{title:t,content:i,closeOnClickOutside:s}=e;return(0,r.jsx)(o.Z,{onClose:n,title:t,closeOnClickOutside:s,children:i})}),[e,n]),a=(0,i.useCallback)((function(e,r){t({closeOnClickOutside:!(arguments.length>2&&void 0!==arguments[2])||arguments[2],content:r(n),title:e})}),[n]);return[s,a]}},41421:(e,t,n)=>{"use strict";n.d(t,{G:()=>x,a:()=>P});var r=n(36153),i=n(31537),o=n(93261),s=n(22311),a=n(31031),l=n(29016);class c extends a.HX{static getType(){return"mark"}static clone(e){return new c(Array.from(e.__ids),e.__key)}static importDOM(){return null}static importJSON(e){const t=u(e.ids);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),ids:this.getIDs(),type:"mark",version:1}}constructor(e,t){super(t),this.__ids=e||[]}createDOM(e){const t=document.createElement("mark");return(0,l.Yo)(t,e.theme.mark),this.__ids.length>1&&(0,l.Yo)(t,e.theme.markOverlap),t}updateDOM(e,t,n){const r=e.__ids,i=this.__ids,o=r.length,s=i.length,a=n.theme.markOverlap;return o!==s&&(1===o?2===s&&(0,l.Yo)(t,a):1===s&&(0,l.PS)(t,a)),!1}hasID(e){const t=this.getIDs();for(let n=0;n<t.length;n++)if(e===t[n])return!0;return!1}getIDs(){const e=this.getLatest();return d(e)?e.__ids:[]}addID(e){const t=this.getWritable();if(d(t)){const n=t.__ids;t.__ids=n;for(let t=0;t<n.length;t++)if(e===n[t])return;n.push(e)}}deleteID(e){const t=this.getWritable();if(d(t)){const n=t.__ids;t.__ids=n;for(let t=0;t<n.length;t++)if(e===n[t])return void n.splice(t,1)}}insertNewAfter(e,t=!0){const n=u(this.__ids);return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!(0,a.OP)(t)||"html"===n)return!1;const r=t.anchor,i=t.focus,o=r.getNode(),s=i.getNode(),l=t.isBackward()?r.offset-i.offset:i.offset-r.offset;return this.isParentOf(o)&&this.isParentOf(s)&&this.getTextContent().length===l}excludeFromCopy(e){return"clone"!==e}}function u(e){return(0,a.U2)(new c(e))}function d(e){return e instanceof c}class h extends a.HX{static getType(){return"overflow"}static clone(e){return new h(e.__key)}static importJSON(e){return(0,a.U2)(new h)}static importDOM(){return null}constructor(e){super(e),this.__type="overflow"}exportJSON(){return{...super.exportJSON(),type:"overflow"}}createDOM(e){const t=document.createElement("span"),n=e.theme.characterLimit;return"string"==typeof n&&(t.className=n),t}updateDOM(e,t){return!1}insertNewAfter(e,t=!0){return this.getParentOrThrow().insertNewAfter(e,t)}excludeFromCopy(){return!0}}var p=n(27901),f=n(9591),g=n(65268),m=n(43800),y=n(59179),v=n(17594),A=n(57054),b=n(15960),w=n(59786),S=n(7355),C=n(49060),E=n(74205),I=n(78113);const _=[o.qp,r.o0,r.wg,v.hf,A.G2,b.iK,i.DT,f.c2,p.HY,o.GR,s.NK,c,h,f.rT,g.Cr,g.Fh,g.g0,m.je,y.gL,w.h,S.H,C.Mf,E.Ct,s.EG],x=_,P=[..._,I.r]},78113:(e,t,n)=>{"use strict";n.d(t,{A:()=>u,r:()=>c});var r=n(52322),i=n(20266),o=n(87901);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class c extends i.K{static getType(){return"file-export"}constructor(e,t){super(),this.__name=e,this.__mimeType=t}static clone(e){return new c(e.__name,e.__mimeType)}static importJSON(e){return new c(e.name,e.mimeType)}exportJSON(){return a(a({},super.exportJSON()),{},{name:this.__name,mimeType:this.__mimeType,version:1,type:"file-export"})}getZippableFileName(){return(0,o.parseAndCreateZippableFileName)(this.__name)}getTextContent(){return"".concat(this.__mimeType.startsWith("image/")?"!":"","[").concat(this.__name,"](./").concat(this.getZippableFileName(),")")}exportDOM(){const e="./".concat(this.getZippableFileName());if(this.__mimeType.startsWith("image/")){const t=document.createElement("img");return t.setAttribute("src",e),{element:t}}if(this.__mimeType.startsWith("audio")){const t=document.createElement("audio");t.setAttribute("controls","");const n=document.createElement("source");return n.setAttribute("src",e),n.setAttribute("type",this.__mimeType),t.appendChild(n),{element:t}}if(this.__mimeType.startsWith("video")){const t=document.createElement("video");t.setAttribute("controls","");const n=document.createElement("source");return n.setAttribute("src",e),n.setAttribute("type",this.__mimeType),t.appendChild(n),{element:t}}const t=document.createElement("object");return t.setAttribute("data",e),t.setAttribute("type",this.__mimeType),{element:t}}decorate(){return(0,r.jsx)(r.Fragment,{})}}function u(e,t){return new c(e,t)}},43800:(e,t,n)=>{"use strict";n.d(t,{je:()=>p,m2:()=>f});var r=n(52322),i=n(74667),o=n(20266),s=n(2784);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){const t=e.getAttribute("data-lexical-tweet-id");return t?{node:f(t)}:null}let d=!0;function h(e){let{className:t,format:n,loadingComponent:o,nodeKey:a,onError:l,onLoad:c,tweetID:u}=e;const h=(0,s.useRef)(null),p=(0,s.useRef)(""),[f,g]=(0,s.useState)(!1),m=(0,s.useCallback)((async()=>{try{await window.twttr.widgets.createTweet(u,h.current),g(!1),d=!1,c&&c()}catch(e){l&&l(String(e))}}),[l,c,u]);return(0,s.useEffect)((()=>{var e;if(u!==p.current){if(g(!0),d){const t=document.createElement("script");t.src="/dist/twitter-widgets.js",t.async=!0,null===(e=document.body)||void 0===e||e.appendChild(t),t.onload=m,l&&(t.onerror=l)}else m().catch(console.error);p&&(p.current=u)}}),[m,l,u]),(0,r.jsxs)(i.U,{className:t,format:n,nodeKey:a,children:[f?o:null,(0,r.jsx)("div",{style:{display:"inline-block",width:"550px"},ref:h})]})}class p extends o.K{static getType(){return"tweet"}static clone(e){return new p(e.__id,e.__format,e.__key)}static importJSON(e){const t=f(e.id);return t.setFormat(e.format),t}exportJSON(){return l(l({},super.exportJSON()),{},{id:this.getId(),type:"tweet",version:1})}static importDOM(){return{div:e=>e.hasAttribute("data-lexical-tweet-id")?{conversion:u,priority:2}:null}}exportDOM(){const e=document.createElement("div");e.setAttribute("data-lexical-tweet-id",this.__id);const t=document.createTextNode(this.getTextContent());return e.append(t),{element:e}}constructor(e,t,n){super(t,n),this.__id=e}getId(){return this.__id}getTextContent(e,t){return"https://twitter.com/i/web/status/".concat(this.__id)}decorate(e,t){const n=t.theme.embedBlock||{},i={base:n.base||"",focus:n.focus||""};return(0,r.jsx)(h,{className:i,format:this.__format,loadingComponent:"Loading...",nodeKey:this.getKey(),tweetID:this.__id})}isInline(){return!1}}function f(e){return new p(e)}},59179:(e,t,n)=>{"use strict";n.d(t,{gL:()=>d,kU:()=>h});var r=n(52322),i=n(74667),o=n(20266);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){let{className:t,format:n,nodeKey:o,videoID:s}=e;return(0,r.jsx)(i.U,{className:t,format:n,nodeKey:o,children:(0,r.jsx)("iframe",{width:"560",height:"315",src:"https://www.youtube.com/embed/".concat(s),frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,title:"YouTube video"})})}function u(e){const t=e.getAttribute("data-lexical-youtube");return t?{node:h(t)}:null}class d extends o.K{static getType(){return"youtube"}static clone(e){return new d(e.__id,e.__format,e.__key)}static importJSON(e){const t=h(e.videoID);return t.setFormat(e.format),t}exportJSON(){return a(a({},super.exportJSON()),{},{type:"youtube",version:1,videoID:this.__id})}exportDOM(){const e=document.createElement("iframe");return e.setAttribute("data-lexical-youtube",this.__id),e.setAttribute("width","560"),e.setAttribute("height","315"),e.setAttribute("src","https://www.youtube.com/embed/".concat(this.__id)),e.setAttribute("frameborder","0"),e.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"),e.setAttribute("allowfullscreen","true"),e.setAttribute("title","YouTube video"),{element:e}}static importDOM(){return{iframe:e=>e.hasAttribute("data-lexical-youtube")?{conversion:u,priority:1}:null}}constructor(e,t,n){super(t,n),this.__id=e}updateDOM(){return!1}getId(){return this.__id}getTextContent(e,t){return"https://www.youtube.com/watch?v=".concat(this.__id)}decorate(e,t){const n=t.theme.embedBlock||{},i={base:n.base||"",focus:n.focus||""};return(0,r.jsx)(c,{className:i,format:this.__format,nodeKey:this.getKey(),videoID:this.__id})}isInline(){return!1}}function h(e){return new d(e)}},34521:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={blockCursor:"Lexical__blockCursor",characterLimit:"Lexical__characterLimit",code:"Lexical__code",codeHighlight:{atrule:"Lexical__tokenAttr",attr:"Lexical__tokenAttr",boolean:"Lexical__tokenProperty",builtin:"Lexical__tokenSelector",cdata:"Lexical__tokenComment",char:"Lexical__tokenSelector",class:"Lexical__tokenFunction","class-name":"Lexical__tokenFunction",comment:"Lexical__tokenComment",constant:"Lexical__tokenProperty",deleted:"Lexical__tokenProperty",doctype:"Lexical__tokenComment",entity:"Lexical__tokenOperator",function:"Lexical__tokenFunction",important:"Lexical__tokenVariable",inserted:"Lexical__tokenSelector",keyword:"Lexical__tokenAttr",namespace:"Lexical__tokenVariable",number:"Lexical__tokenProperty",operator:"Lexical__tokenOperator",prolog:"Lexical__tokenComment",property:"Lexical__tokenProperty",punctuation:"Lexical__tokenPunctuation",regex:"Lexical__tokenVariable",selector:"Lexical__tokenSelector",string:"Lexical__tokenSelector",symbol:"Lexical__tokenProperty",tag:"Lexical__tokenProperty",url:"Lexical__tokenOperator",variable:"Lexical__tokenVariable"},embedBlock:{base:"Lexical__embedBlock",focus:"Lexical__embedBlockFocus"},hashtag:"Lexical__hashtag",heading:{h1:"Lexical__h1",h2:"Lexical__h2",h3:"Lexical__h3",h4:"Lexical__h4",h5:"Lexical__h5",h6:"Lexical__h6"},image:"editor-image",link:"Lexical__link",list:{listitem:"Lexical__listItem",listitemChecked:"Lexical__listItemChecked",listitemUnchecked:"Lexical__listItemUnchecked",nested:{listitem:"Lexical__nestedListItem"},olDepth:["Lexical__ol1","Lexical__ol2","Lexical__ol3","Lexical__ol4","Lexical__ol5"],ul:"Lexical__ul",checklist:"Lexical__checkList"},ltr:"Lexical__ltr",mark:"Lexical__mark",markOverlap:"Lexical__markOverlap",paragraph:"Lexical__paragraph",quote:"Lexical__quote",rtl:"Lexical__rtl",table:"Lexical__table",tableAddColumns:"Lexical__tableAddColumns",tableAddRows:"Lexical__tableAddRows",tableCell:"Lexical__tableCell",tableCellActionButton:"Lexical__tableCellActionButton",tableCellActionButtonContainer:"Lexical__tableCellActionButtonContainer",tableCellEditing:"Lexical__tableCellEditing",tableCellHeader:"Lexical__tableCellHeader",tableCellPrimarySelected:"Lexical__tableCellPrimarySelected",tableCellResizer:"Lexical__tableCellResizer",tableCellSelected:"Lexical__tableCellSelected",tableCellSortedIndicator:"Lexical__tableCellSortedIndicator",tableResizeRuler:"Lexical__tableCellResizeRuler",tableSelected:"Lexical__tableSelected",tableSelection:"Lexical__tableSelection",text:{bold:"Lexical__textBold",code:"Lexical__textCode",italic:"Lexical__textItalic",strikethrough:"Lexical__textStrikethrough",subscript:"Lexical__textSubscript",superscript:"Lexical__textSuperscript",underline:"Lexical__textUnderline",underlineStrikethrough:"Lexical__textUnderlineStrikethrough"}}},3038:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(52322),i=n(47166),o=n(2784),s=n(28316),a=n(47931),l=n(84075);function c(e){let{onClose:t,children:n,title:i,closeOnClickOutside:s}=e;const c=(0,o.useRef)(null);return(0,o.useEffect)((()=>{null!==c.current&&c.current.focus()}),[]),(0,o.useEffect)((()=>{let e=null;const n=e=>{e.key===l.u8.Escape&&t()},r=e=>{const n=e.target;null!==c.current&&!c.current.contains(n)&&s&&t()};return null!==c.current&&(e=c.current.parentElement,null!==e&&e.addEventListener("click",r)),window.addEventListener("keydown",n),()=>{window.removeEventListener("keydown",n),null!==e&&e.removeEventListener("click",r)}}),[s,t]),(0,r.jsx)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-[rgba(0,0,0,0.65)]",role:"dialog",children:(0,r.jsxs)("div",{className:"relative flex min-w-[min(80vw,_20rem)] flex-col rounded border border-border bg-default",tabIndex:-1,ref:c,children:[(0,r.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-3.5 py-2",children:[(0,r.jsx)("div",{className:"text-sm font-semibold",children:i}),(0,r.jsx)("button",{tabIndex:0,className:"ml-2 rounded p-1 font-bold hover:bg-contrast",onClick:t,children:(0,r.jsx)(a.Z,{type:"close"})})]}),(0,r.jsx)("div",{className:"px-3.5 py-3",children:n})]})})}function u(e){let{onClose:t,children:n,title:a,closeOnClickOutside:l=!0}=e;const[u,d]=(0,o.useState)(),[h]=(0,i.g)();return(0,o.useEffect)((()=>{var e,t;d(null!==(t=null===(e=h.getRootElement())||void 0===e?void 0:e.parentElement)&&void 0!==t?t:document.body)}),[h]),u?(0,s.createPortal)((0,r.jsx)(c,{onClose:t,title:a,closeOnClickOutside:l,children:n}),u):null}},68608:(e,t,n)=>{"use strict";n.d(t,{c:()=>m});var r=n(37146),i=n(65268),o=n(27901),s=n(31031),a=n(49060),l=n(74205);const c={dependencies:[o.HY],export:e=>(0,o.fs)(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{const i=(0,o.Dq)();r||null!=e.getNextSibling()?e.replace(i):e.insertBefore(i),i.selectNext()},type:"element"},u={dependencies:[a.Mf],export:e=>(0,a.Dq)(e)?"![".concat(e.__alt?e.__alt:"image","](").concat(e.__src,")"):null,importRegExp:/!(?:\[([^[]*)\])(?:\(([^(]+)\))/,regExp:/!(?:\[([^[]*)\])(?:\(([^(]+)\))$/,replace:(e,t)=>{const[,n,r]=t,i=(0,a.kx)(r,n);e.replace(i)},trigger:")",type:"text-match"},d={dependencies:[l.Ct],export:e=>(0,l.i0)(e)?e.getTextContent():null,importRegExp:/(?:\[([^[]*)\])(?:\((data:(.*);[^(]+)\))/,regExp:/(?:\[([^[]*)\])(?:\((data:(.*);[^(]+)\))$/,replace:(e,t)=>{const[,n,r,i]=t,o=(0,l.v9)(r,i,n);e.replace(o)},trigger:")",type:"text-match"},h=/^(?:\|)(.+)(?:\|)\s?$/,p=/^(\| ?:?-*:? ?)+\|\s?$/;function f(e){e=e.replace(/\\n/g,"\n");const t=(0,i.ku)(i.xo.NO_STATUS);return(0,r.Os)(e,m,t),t}function g(e){const t=e.match(h);return t&&t[1]?t[1].split("|").map((e=>f(e))):null}const m=[{dependencies:[i.Fh,i.g0,i.Cr],export:e=>{if(!(0,i.di)(e))return null;const t=[];for(const n of e.getChildren()){const e=[];if(!(0,i.to)(n))continue;let o=!1;for(const t of n.getChildren())(0,i.TF)(t)&&(e.push((0,r.JH)(m,t).replace(/\n/g,"\\n")),t.__headerState===i.xo.ROW&&(o=!0));t.push("| ".concat(e.join(" | ")," |")),o&&t.push("| ".concat(e.map((e=>"---")).join(" | ")," |"))}return t.join("\n")},regExp:h,replace:(e,t,n)=>{if(p.test(n[0])){const t=e.getPreviousSibling();if(!t||!(0,i.di)(t))return;const n=t.getChildren(),r=n[n.length-1];if(!r||!(0,i.to)(r))return;return r.getChildren().forEach((e=>{(0,i.TF)(e)&&e.toggleHeaderStyle(i.xo.ROW)})),void e.remove()}const r=g(n[0]);if(null==r)return;const o=[r];let a=e.getPreviousSibling(),l=r.length;for(;a&&(0,s.Rl)(a)&&1===a.getChildrenSize();){const e=a.getFirstChild();if(!(0,s.Gg)(e))break;const t=g(e.getTextContent());if(null==t)break;l=Math.max(l,t.length),o.unshift(t);const n=a.getPreviousSibling();a.remove(),a=n}const c=(0,i.gz)();for(const e of o){const t=(0,i.Xf)();c.append(t);for(let n=0;n<l;n++)t.append(n<e.length?e[n]:f(""))}const u=e.getPreviousSibling();(0,i.di)(u)&&function(e){const t=e.getFirstChild();return(0,i.to)(t)?t.getChildrenSize():0}(u)===l?(u.append(...c.getChildren()),e.remove()):e.replace(c),c.selectEnd()},type:"element"},r.T_,u,d,...r.VH,...r.Pr,...r.lL,c]},26786:(e,t,n)=>{"use strict";n.d(t,{GF:()=>m,ZP:()=>w});var r=n(52322),i=n(8802),o=n(47166),s=n(2784),a=n(28316),l=n(75043),c=n(79014),u=n(93559),d=n(29894),h=n(13959),p=n(756),f=n(24118);const g={contentName:"Youtube Video",exampleUrl:"https://www.youtube.com/watch?v=jNQXAC9IVRw",icon:(0,r.jsx)("i",{className:"icon youtube"}),iconName:"youtube",insertNode:(e,t)=>{e.dispatchCommand(u.A,t.id)},keywords:["youtube","video"],parseUrl:e=>{const t=/^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/.exec(e),n=t&&11===(null==t?void 0:t[2].length)?t[2]:null;return null!=n?{id:n,url:e}:null},type:"youtube-video"},m=[{contentName:"Tweet",exampleUrl:"https://twitter.com/jack/status/20",icon:(0,r.jsx)("i",{className:"icon tweet"}),iconName:"tweet",insertNode:(e,t)=>{e.dispatchCommand(c.H,t.id)},keywords:["tweet","twitter"],parseUrl:e=>{const t=/^https:\/\/twitter\.com\/(#!\/)?(\w+)\/status(es)*\/(\d+)$/.exec(e);return null!=t?{id:t[4],url:t[0]}:null},type:"tweet"},g];function y(e){let{index:t,isSelected:n,onClick:i,onMouseEnter:o,option:s}=e;return(0,r.jsx)("li",{tabIndex:-1,className:(0,d.classNames)("cursor-pointer rounded px-2 py-1",n&&"bg-info-backdrop"),ref:s.setRefElement,role:"option","aria-selected":n,id:"typeahead-item-"+t,onMouseEnter:o,onClick:i,children:(0,r.jsx)("span",{className:"text",children:s.title})},s.key)}function v(e){let{options:t,selectedItemIndex:n,onOptionClick:i,onOptionMouseEnter:o}=e;return(0,r.jsx)("div",{className:"typeahead-popover min-w-max rounded border border-border bg-default p-1",children:(0,r.jsx)("ul",{className:"list-none",children:t.map(((e,t)=>(0,r.jsx)(y,{index:t,isSelected:n===t,onClick:()=>i(e,t),onMouseEnter:()=>o(t),option:e},e.key)))})})}const A=(e,t)=>{let n;return r=>{window.clearTimeout(n),n=window.setTimeout((()=>{e(r)}),t)}};function b(e){let{embedConfig:t,onClose:n}=e;const[a,l]=(0,s.useState)(""),[c]=(0,o.g)(),[u,d]=(0,s.useState)(null),g=(0,s.useMemo)((()=>A((e=>{const n=i.HI.exec(e);null!=t&&null!=e&&null!=n?Promise.resolve(t.parseUrl(e)).then((e=>{d(e)})):null!=u&&d(null)}),200)),[t,u]),m=(0,s.useCallback)((e=>{e&&setTimeout((()=>e.focus()))}),[]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("label",{className:"flex flex-col gap-1.5",children:["URL:",(0,r.jsx)(h.Z,{value:a,onChange:e=>{l(e),g(e)},ref:m})]}),(0,r.jsx)("div",{className:"mt-2.5 flex justify-end",children:(0,r.jsx)(p.Z,{disabled:!u,onClick:()=>{null!=u&&(t.insertNode(c,u),n())},small:(0,f.Av)(),children:"Embed"})})]})}function w(){const[e,t]=(0,l.Z)();return(0,r.jsxs)(r.Fragment,{children:[e,(0,r.jsx)(i.vK,{embedConfigs:m,onOpenEmbedModalForConfig:e=>{t("Embed ".concat(e.contentName),(t=>(0,r.jsx)(b,{embedConfig:e,onClose:t})))},getMenuOptions:(e,t,n)=>[new i.WX("Dismiss",{onSelect:n}),new i.WX("Embed ".concat(e.contentName),{onSelect:t})],menuRenderFn:(e,t)=>{let{selectedIndex:n,options:i,selectOptionAndCleanUp:o,setHighlightedIndex:s}=t;return e.current?a.createPortal((0,r.jsx)("div",{className:"typeahead-popover auto-embed-menu",style:{marginLeft:e.current.style.width},children:(0,r.jsx)(v,{options:i,selectedItemIndex:n,onOptionClick:(e,t)=>{s(t),o(e)},onOptionMouseEnter:e=>{s(e)}})}),e.current):null}})]})}},57823:(e,t,n)=>{"use strict";n.d(t,{y:()=>i});var r=n(17906);class i extends r.n{constructor(e,t){super(e),this.title=e,this.keywords=t.keywords||[],this.iconName=t.iconName,this.keyboardShortcut=t.keyboardShortcut,this.onSelect=t.onSelect.bind(this)}}},98572:(e,t,n)=>{"use strict";n.d(t,{C1:()=>h,Cj:()=>l,F:()=>c,QK:()=>s,R8:()=>u,oe:()=>d,vn:()=>o,zN:()=>a});var r=n(31031),i=n(57823);const o={name:"Align left",iconName:"align-left",keywords:["align","justify","left"],onSelect:e=>e.dispatchCommand(r.RO,"left")},s={name:"Align center",iconName:"align-center",keywords:["align","justify","center"],onSelect:e=>e.dispatchCommand(r.RO,"center")},a={name:"Align right",iconName:"align-right",keywords:["align","justify","right"],onSelect:e=>e.dispatchCommand(r.RO,"right")},l={name:"Align justify",iconName:"align-justify",keywords:["align","justify","justify"],onSelect:e=>e.dispatchCommand(r.RO,"justify")};function c(e){return new i.y(o.name,{iconName:o.iconName,keywords:o.keywords,onSelect:()=>o.onSelect(e)})}function u(e){return new i.y(s.name,{iconName:s.iconName,keywords:s.keywords,onSelect:()=>s.onSelect(e)})}function d(e){return new i.y(a.name,{iconName:a.iconName,keywords:a.keywords,onSelect:()=>a.onSelect(e)})}function h(e){return new i.y(l.name,{iconName:l.iconName,keywords:l.keywords,onSelect:()=>l.onSelect(e)})}},89139:(e,t,n)=>{"use strict";n.d(t,{d:()=>a,i:()=>l});var r=n(64739),i=n(31031),o=n(36153),s=n(57823);const a={name:"Code Block",iconName:"code",keywords:["javascript","python","js","codeblock"],onSelect:e=>e.update((()=>{const e=(0,i.dL)();if((0,i.OP)(e))if(e.isCollapsed())(0,r.Hz)(e,(()=>(0,o.Ol)()));else{const t=e.getTextContent(),n=(0,o.Ol)();e.insertNodes([n]),e.insertRawText(t)}}))};function l(e){return new s.y(a.name,{iconName:a.iconName,keywords:a.keywords,onSelect:()=>a.onSelect(e)})}},4694:(e,t,n)=>{"use strict";n.d(t,{J:()=>o,e:()=>s});var r=n(25207),i=n(57823);const o={name:"Collapsible",iconName:"details-block",keywords:["collapse","collapsible","toggle"],onSelect:e=>e.dispatchCommand(r.sG,void 0)};function s(e){return new i.y(o.name,{iconName:o.iconName,keywords:o.keywords,onSelect:()=>o.onSelect(e)})}},21490:(e,t,n)=>{"use strict";n.d(t,{W:()=>s,j:()=>o});var r=n(27901),i=n(57823);const o={name:"Divider",iconName:"horizontal-rule",keywords:["horizontal rule","divider","hr"],onSelect:e=>e.dispatchCommand(r.qL,void 0)};function s(e){return new i.y(o.name,{iconName:o.iconName,keywords:o.keywords,onSelect:()=>o.onSelect(e)})}},94652:(e,t,n)=>{"use strict";n.d(t,{I:()=>u,M8:()=>d,SH:()=>a,p2:()=>c,sV:()=>h,vZ:()=>l});var r=n(64739),i=n(31031),o=n(9591),s=n(57823);const a={name:"Heading 1",iconName:"h1",keywords:["heading","header","h1"],onSelect:e=>e.update((()=>{const e=(0,i.dL)();(0,i.OP)(e)&&(0,r.Hz)(e,(()=>(0,o.V1)("h1")))}))};function l(e){return new s.y(a.name,{iconName:a.iconName,keywords:a.keywords,onSelect:()=>a.onSelect(e)})}const c={name:"Heading 2",iconName:"h2",keywords:["heading","header","h2"],onSelect:e=>e.update((()=>{const e=(0,i.dL)();(0,i.OP)(e)&&(0,r.Hz)(e,(()=>(0,o.V1)("h2")))}))};function u(e){return new s.y(c.name,{iconName:c.iconName,keywords:c.keywords,onSelect:()=>c.onSelect(e)})}const d={name:"Heading 3",iconName:"h3",keywords:["heading","header","h3"],onSelect:e=>e.update((()=>{const e=(0,i.dL)();(0,i.OP)(e)&&(0,r.Hz)(e,(()=>(0,o.V1)("h3")))}))};function h(e){return new s.y(d.name,{iconName:d.iconName,keywords:d.keywords,onSelect:()=>d.onSelect(e)})}},22798:(e,t,n)=>{"use strict";n.d(t,{$o:()=>l,Cc:()=>s,Gm:()=>a,b:()=>o});var r=n(31031),i=n(57823);const o={name:"Indent",iconName:"indent",keywords:["indent"],onSelect:e=>e.dispatchCommand(r.PU,void 0)},s={name:"Outdent",iconName:"outdent",keywords:["outdent"],onSelect:e=>e.dispatchCommand(r.cz,void 0)};function a(e){return new i.y(o.name,{iconName:o.iconName,keywords:o.keywords,onSelect:()=>o.onSelect(e)})}function l(e){return new i.y(s.name,{iconName:s.iconName,keywords:s.keywords,onSelect:()=>s.onSelect(e)})}},9256:(e,t,n)=>{"use strict";n.d(t,{EQ:()=>u,Ee:()=>a,PG:()=>c,T$:()=>l,Vb:()=>o,vE:()=>s});var r=n(22311),i=n(57823);const o={name:"Bulleted List",iconName:"list-bulleted",keywords:["bulleted list","unordered list","ul"],onSelect:e=>e.dispatchCommand(r.A3,void 0)},s={name:"Check List",iconName:"list-check",keywords:["check list","todo list"],onSelect:e=>e.dispatchCommand(r.d1,void 0)},a={name:"Numbered List",iconName:"list-numbered",keywords:["numbered list","ordered list","ol"],onSelect:e=>e.dispatchCommand(r.B3,void 0)};function l(e){return new i.y(o.name,{iconName:o.iconName,keywords:o.keywords,onSelect:()=>o.onSelect(e)})}function c(e){return new i.y(s.name,{iconName:s.iconName,keywords:s.keywords,onSelect:()=>s.onSelect(e)})}function u(e){return new i.y(a.name,{iconName:a.iconName,keywords:a.keywords,onSelect:()=>a.onSelect(e)})}},66208:(e,t,n)=>{"use strict";n.d(t,{O:()=>s,c:()=>a});var r=n(64739),i=n(31031),o=n(57823);const s={name:"Paragraph",iconName:"paragraph",keywords:["normal","paragraph","p","text"],onSelect:e=>e.update((()=>{const e=(0,i.dL)();(0,i.OP)(e)&&(0,r.Hz)(e,(()=>(0,i.BE)()))}))};function a(e){return new o.y(s.name,{iconName:s.iconName,keywords:s.keywords,onSelect:()=>s.onSelect(e)})}},20174:(e,t,n)=>{"use strict";n.d(t,{Kw:()=>a,SC:()=>s,ft:()=>l});var r=n(57823),i=n(66498);const o=8,s={name:"Generate cryptographically secure password",iconName:"password",keywords:["password","secure"],onSelect:e=>e.dispatchCommand(i.wN,String(16))};function a(e){return new r.y(s.name,{iconName:s.iconName,keywords:s.keywords,onSelect:()=>s.onSelect(e)})}function l(e,t){if(null==t)return[];const n=/^\d+$/.exec(t);if(!n)return[];const s=parseInt(n[0],10);return s<o?[]:[new r.y("Generate ".concat(s,"-character cryptographically secure password"),{iconName:"password",keywords:["password","secure"],onSelect:()=>e.dispatchCommand(i.wN,s.toString())})]}},30626:(e,t,n)=>{"use strict";n.d(t,{V:()=>a,t:()=>l});var r=n(64739),i=n(31031),o=n(9591),s=n(57823);const a={name:"Quote",iconName:"quote",keywords:["block quote"],onSelect:e=>e.update((()=>{const e=(0,i.dL)();(0,i.OP)(e)&&(0,r.Hz)(e,(()=>(0,o.Z1)()))}))};function l(e){return new s.y(a.name,{iconName:a.iconName,keywords:a.keywords,onSelect:()=>a.onSelect(e)})}},17594:(e,t,n)=>{"use strict";n.d(t,{_$:()=>c,hf:()=>l,rY:()=>u});var r=n(31031);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){return{node:c(void 0===e.open||e.open)}}class l extends r.HX{constructor(e,t){super(t),this.__open=null!=e&&e}static getType(){return"collapsible-container"}static clone(e){return new l(e.__open,e.__key)}createDOM(e,t){const n=document.createElement("details");return n.classList.add("Collapsible__container"),n.open=this.__open,n.addEventListener("toggle",(()=>{t.getEditorState().read((()=>this.getOpen()))!==n.open&&t.update((()=>this.toggleOpen()))})),n}updateDOM(e,t){return e.__open!==this.__open&&(t.open=this.__open),!1}static importDOM(){return{details:()=>({conversion:a,priority:1})}}static importJSON(e){return c(e.open)}exportDOM(){const e=document.createElement("details");return this.getLatest().__open&&e.setAttribute("open",""),{element:e}}exportJSON(){return o(o({},super.exportJSON()),{},{type:"collapsible-container",version:1,open:this.__open})}setOpen(e){this.getWritable().__open=e}getOpen(){return this.__open}toggleOpen(){this.setOpen(!this.getOpen())}}function c(e){return new l(e)}function u(e){return e instanceof l}},57054:(e,t,n)=>{"use strict";n.d(t,{G2:()=>l,f9:()=>c,oh:()=>u});var r=n(31031);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(){return{node:c()}}class l extends r.HX{static getType(){return"collapsible-content"}static clone(e){return new l(e.__key)}createDOM(e){const t=document.createElement("div");return t.classList.add("Collapsible__content"),t}updateDOM(e,t){return!1}static importDOM(){return{div:e=>e.hasAttribute("data-lexical-collapsible-content")?{conversion:a,priority:2}:null}}static importJSON(e){return c()}isShadowRoot(){return!0}exportDOM(){const e=document.createElement("div");return e.setAttribute("data-lexical-collapsible-content","true"),{element:e}}exportJSON(){return o(o({},super.exportJSON()),{},{type:"collapsible-content",version:1})}}function c(){return new l}function u(e){return e instanceof l}},15960:(e,t,n)=>{"use strict";n.d(t,{AD:()=>d,iK:()=>u,vW:()=>h});var r=n(31031),i=n(17594),o=n(57054);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(){return{node:d()}}class u extends r.HX{static getType(){return"collapsible-title"}constructor(e){let{formatType:t,key:n}=e;super(n),t&&super.setFormat(t)}static clone(e){return new u({key:e.__key})}createDOM(){const e=document.createElement("summary");e.classList.add("Collapsible__title");const t=this.getFormatType();return e.style.textAlign=t,e}updateDOM(e,t){return!1}static importDOM(){return{summary:()=>({conversion:c,priority:1})}}static importJSON(e){return d(e.format)}exportDOM(){return{element:document.createElement("summary")}}exportJSON(){return a(a({},super.exportJSON()),{},{type:"collapsible-title",version:1})}collapseAtStart(e){return this.getParentOrThrow().insertBefore(this),!0}insertNewAfter(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=this.getParentOrThrow();if(!(0,i.rY)(n))throw new Error("CollapsibleTitleNode expects to be child of CollapsibleContainerNode");if(n.getOpen()){const e=this.getNextSibling();if(!(0,o.oh)(e))throw new Error("CollapsibleTitleNode expects to have CollapsibleContentNode sibling");const t=e.getFirstChild();if((0,r.F7)(t))return t;{const t=(0,r.BE)();return e.append(t),t}}{const e=(0,r.BE)();return n.insertAfter(e,t),e}}}function d(e){return new u({formatType:e})}function h(e){return e instanceof u}},25207:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>h,sG:()=>u});var r=n(47166),i=n(29016),o=n(31031),s=n(2784),a=n(17594),l=n(57054),c=n(15960);const u=(0,o.fA)(),d=(0,o.fA)();function h(){const[e]=(0,r.g)();return(0,s.useEffect)((()=>{if(!e.hasNodes([a.hf,c.iK,l.G2]))throw new Error("CollapsiblePlugin: CollapsibleContainerNode, CollapsibleTitleNode, or CollapsibleContentNode not registered on editor");const t=()=>{var e;const t=(0,o.dL)();if((0,o.OP)(t)&&t.isCollapsed()&&0===t.anchor.offset){const n=(0,i.$s)(t.anchor.getNode(),a.rY);if((0,a.rY)(n)){const r=n.getParent();null!==r&&r.getFirstChild()===n&&t.anchor.key===(null===(e=n.getFirstDescendant())||void 0===e?void 0:e.getKey())&&n.insertBefore((0,o.BE)())}}return!1},n=()=>{const e=(0,o.dL)();if((0,o.OP)(e)&&e.isCollapsed()){const t=(0,i.$s)(e.anchor.getNode(),a.rY);if((0,a.rY)(t)){const n=t.getParent();if(null!==n&&n.getLastChild()===t){const n=t.getFirstDescendant(),r=t.getLastDescendant();(null!==r&&e.anchor.key===r.getKey()&&e.anchor.offset===r.getTextContentSize()||null!==n&&e.anchor.key===n.getKey()&&e.anchor.offset===n.getTextContentSize())&&t.insertAfter((0,o.BE)())}}}return!1};return(0,i.qV)(e.registerNodeTransform(l.G2,(e=>{const t=e.getParent();if(!(0,a.rY)(t)){const t=e.getChildren();for(const n of t)e.insertBefore(n);e.remove()}})),e.registerNodeTransform(c.iK,(e=>{const t=e.getParent();(0,a.rY)(t)||e.replace((0,o.BE)().append(...e.getChildren()))})),e.registerNodeTransform(a.hf,(e=>{const t=e.getChildren();if(2!==t.length||!(0,c.vW)(t[0])||!(0,l.oh)(t[1])){for(const n of t)e.insertBefore(n);e.remove()}})),e.registerCommand(o.Mt,(()=>{const e=(0,o.dL)();if(!(0,o.OP)(e)||!e.isCollapsed()||0!==e.anchor.offset)return!1;const t=e.anchor.getNode().getTopLevelElement();if(null===t)return!1;const n=t.getPreviousSibling();return!(!(0,a.rY)(n)||n.getOpen()||(n.setOpen(!0),0))}),o.KB),e.registerCommand(o.Zb,n,o.KB),e.registerCommand(o.Nm,n,o.KB),e.registerCommand(o._0,t,o.KB),e.registerCommand(o.u$,t,o.KB),e.registerCommand(o.K0,(()=>{var t;const n=null===(t=e._window)||void 0===t?void 0:t.event;if(n&&(n.ctrlKey||n.metaKey)&&"Enter"===n.key){const e=(0,o.DN)();if((0,o.OP)(e)&&e.isCollapsed()){const t=(0,i.$s)(e.anchor.getNode(),(e=>(0,o.F7)(e)&&!e.isInline()));if((0,c.vW)(t)){const n=t.getParent();if((0,a.rY)(n))return n.toggleOpen(),(0,o.oq)(e.clone()),!0}}}return!1}),o.KB),e.registerCommand(u,(()=>(e.update((()=>{const e=(0,c.AD)();(0,i.z8)((0,a._$)(!0).append(e,(0,l.f9)().append((0,o.BE)()))),e.select()})),!0)),o.VN),e.registerCommand(d,(t=>(e.update((()=>{const e=(0,o.gI)(t);(0,a.rY)(e)&&e.toggleOpen()})),!0)),o.VN))}),[e]),null}},66498:(e,t,n)=>{"use strict";n.d(t,{KG:()=>s,NP:()=>c,dq:()=>i,gD:()=>a,jM:()=>o,wN:()=>l});var r=n(31031);const i=(0,r.fA)("INSERT_FILE_COMMAND"),o=(0,r.fA)("UPLOAD_AND_INSERT_FILE_COMMAND"),s=(0,r.fA)("INSERT_BUBBLE_COMMAND"),a=(0,r.fA)("INSERT_DATETIME_COMMAND"),l=(0,r.fA)("INSERT_PASSWORD_COMMAND"),c=(0,r.fA)("INSERT_REMOTE_IMAGE_COMMAND")},65123:(e,t,n)=>{"use strict";n.d(t,{J:()=>v,Z:()=>b});var r=n(52322),i=n(66498),o=n(47166),s=n(2784),a=n(59786),l=n(31031),c=n(46003),u=n(29016),d=n(92249),h=n(47436),p=n(95768),f=n(48518),g=n(3038),m=n(756),y=n(24118);const v=(0,l.fA)("OPEN_FILE_UPLOAD_MODAL_COMMAND");function A(e){let{onClose:t}=e;const[n]=(0,o.g)(),[a,l]=(0,s.useState)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("input",{type:"file",onChange:e=>{const t=e.target.files;t&&1===t.length&&l(t[0])}}),(0,r.jsx)("div",{className:"mt-1.5 flex justify-end",children:(0,r.jsx)(m.Z,{onClick:()=>{a&&(n.dispatchCommand(i.jM,a),t())},disabled:!a,small:(0,y.Av)(),children:"Upload"})})]})}function b(e){let{currentNote:t}=e;const n=(0,f.I)(),[m]=(0,o.g)(),y=(0,d.o)(),b=(0,p.o)(),[w,S]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{if(!m.hasNodes([a.h]))throw new Error("FilePlugin: FileNode not registered on editor");const e=(e,t)=>{m.update((()=>{const n=(0,c.K5)(e);(0,l.od)([n]),(0,l._v)(n.getParentOrThrow())&&(0,u.JB)(n,l.BE).selectEnd();const r=(0,l.BE)();n.getParentOrThrow().insertAfter(r),r.selectEnd(),m.focus(),t&&t(n)}))};return(0,u.qV)(m.registerCommand(i.dq,(t=>(e(t),!0)),l.VN),m.registerCommand(i.jM,(r=>{const i=t;let o;return y.uploadNewFile(r,{showToast:!1,onUploadStart(t){e(t,(e=>o=e))}}).then((e=>{e?(b.linkItems(i,e),n.changeAndSaveItem.execute(e,(e=>{e.protected=i.protected}))):m.update((()=>null==o?void 0:o.remove()))})).catch(console.error),!0}),l.VN),m.registerCommand(v,(()=>(S(!0),!0)),l.u6),m.registerCommand(l.A1,(e=>{var t;const n=e instanceof ClipboardEvent?null===(t=e.clipboardData)||void 0===t?void 0:t.files:null;return!!(null==n?void 0:n.length)&&((e=>{Array.from(e).forEach((async e=>{m.dispatchCommand(i.jM,e)}))})(n),!0)}),l.u6))}),[n,t,m,y,b]),(0,s.useEffect)((()=>y.addEventObserver(((e,t)=>{if(e===h.p.FileUploadedToNote&&t[h.p.FileUploadedToNote]){const e=t[h.p.FileUploadedToNote].uuid;m.dispatchCommand(i.dq,e)}else if(e===h.p.UploadAndInsertFile&&t[h.p.UploadAndInsertFile]){const{fileOrHandle:e}=t[h.p.UploadAndInsertFile];e instanceof FileSystemFileHandle?e.getFile().then((e=>{m.dispatchCommand(i.jM,e)})).catch(console.error):m.dispatchCommand(i.jM,e)}}))),[y,m]),w?(0,r.jsx)(g.Z,{onClose:()=>S(!1),title:"Upload File",children:(0,r.jsx)(A,{onClose:()=>S(!1)})}):null}},59786:(e,t,n)=>{"use strict";n.d(t,{h:()=>b});var r=n(52322),i=n(20266),o=n(46003),s=n(74667),a=n(2784),l=n(31031),c=n(48518),u=n(25281),d=n(47166),h=n(73055),p=n(34309),f=n(41707),g=n(47436);const m=(0,p.Pi)((function(e){let{className:t,format:n,nodeKey:i,fileUuid:o,zoomLevel:p,setZoomLevel:m}=e;const y=(0,c.I)(),[v]=(0,d.g)(),[A,b]=(0,a.useState)((()=>y.items.findItem(o))),w=y.filesController.uploadProgressMap.get(o),[S,C]=(0,a.useState)(!1),E=(0,a.useRef)(null),I=(0,a.useMemo)((()=>new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting&&C(!0)}))}),{threshold:.25})),[]);(0,a.useEffect)((()=>{const e=E.current;if(e)return I.observe(e),()=>{I.unobserve(e)}}),[I]);const _=(0,a.useCallback)((e=>{v.update((()=>{m(e)}))}),[v,m]),[x,P]=(0,h.y)(i);if((0,a.useEffect)((()=>v.registerCommand(l.Kr,(e=>{var t,n;return!!(null===(t=E.current)||void 0===t?void 0:t.contains(e.target))&&(e.preventDefault(),null===(n=(0,l.gI)(i))||void 0===n||n.selectEnd(),setTimeout((()=>{P(!x)})),!0)}),l.KB)),[v,x,i,P]),(0,a.useEffect)((()=>y.filesController.addEventObserver(((e,t)=>{if(e===g.p.FileUploadFinished&&t[g.p.FileUploadFinished]){const{uploadedFile:e}=t[g.p.FileUploadFinished];e.uuid===o&&b(e)}}))),[y.filesController,o]),w&&(w.progress<100||!A)){const e=w.progress;return(0,r.jsx)(s.U,{className:t,format:n,nodeKey:i,children:(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-4 text-center",ref:E,children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(f.Z,{className:"h-4 w-4"}),'Uploading file "',w.file.name,'"... (',e,"%)"]}),(0,r.jsx)("div",{className:"w-full max-w-[50%] overflow-hidden rounded bg-contrast",children:(0,r.jsx)("div",{className:"h-2 rounded rounded-tl-none bg-info transition-[width] duration-100",role:"progressbar",style:{width:"".concat(e,"%")},"aria-valuenow":e})})]})})}return A?(0,r.jsx)(s.U,{className:t,format:n,nodeKey:i,children:(0,r.jsx)("div",{ref:E,children:S&&(0,r.jsx)(u.Z,{isEmbeddedInSuper:!0,file:A,application:y,imageZoomLevel:p,setImageZoomLevel:_})})}):(0,r.jsx)(s.U,{className:t,format:n,nodeKey:i,children:(0,r.jsxs)("div",{children:["Unable to find file ",o]})})}));function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){A(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function A(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class b extends i.K{static getType(){return"snfile"}static clone(e){return new b(e.__id,e.__format,e.__key,e.__zoomLevel)}static importJSON(e){const t=(0,o.K5)(e.fileUuid);return t.setFormat(e.format),t.setZoomLevel(e.zoomLevel),t}exportJSON(){return v(v({},super.exportJSON()),{},{fileUuid:this.getId(),version:1,type:"snfile",zoomLevel:this.__zoomLevel})}static importDOM(){return{div:e=>e.hasAttribute("data-lexical-file-uuid")?{conversion:o.Dv,priority:2}:null}}exportDOM(){const e=document.createElement("span");e.setAttribute("data-lexical-file-uuid",this.__id);const t=document.createTextNode(this.getTextContent());return e.append(t),{element:e}}constructor(e,t,n,r){super(t,n),this.__id=e,this.__zoomLevel=r||100}getId(){return this.__id}getTextContent(e,t){return"[File: ".concat(this.__id,"]")}setZoomLevel(e){this.getWritable().__zoomLevel=e}decorate(e,t){const n=t.theme.embedBlock||{},i={base:n.base||"",focus:n.focus||""};return(0,r.jsx)(m,{className:i,format:this.__format,nodeKey:this.getKey(),fileUuid:this.__id,zoomLevel:this.__zoomLevel,setZoomLevel:this.setZoomLevel.bind(this)})}}},46003:(e,t,n)=>{"use strict";n.d(t,{Dv:()=>i,K5:()=>o});var r=n(59786);function i(e){const t=e.getAttribute("data-lexical-file-uuid");return t?{node:o(t)}:null}function o(e){return new r.h(e)}},74205:(e,t,n)=>{"use strict";n.d(t,{v9:()=>b,i0:()=>A,Ct:()=>v});var r=n(52322),i=n(20266),o=n(74667),s=n(29894),a=n(47166),l=n(48518),c=n(2784),u=n(46003),d=n(84075),h=n(47931),p=n(41707);const f=e=>{let{className:t,src:n,mimeType:i,fileName:f,format:g,node:m,nodeKey:y}=e;const v=(0,l.I)(),[A]=(0,a.g)(),[b,w]=(0,c.useState)(!1),S=(0,c.useCallback)((async()=>{w(!0);try{const e=await fetch(n).then((e=>e.blob())),t=new File([e],f||v.generateUUID(),{type:i}),{filesController:r,linkingController:o}=v,s=await r.uploadNewFile(t,{showToast:!1});if(!s)return;A.update((()=>{const e=(0,u.K5)(s.uuid);m.replace(e)})),o.linkItemToSelectedItem(s)}catch(e){console.error(e)}finally{w(!1)}}),[v,A,f,i,m,n]),C="application/pdf"===i;return(0,r.jsxs)(o.U,{className:t,format:g,nodeKey:y,children:[i.startsWith("image")?(0,r.jsx)("div",{className:"relative flex min-h-[2rem] flex-col items-center gap-2.5",children:(0,r.jsx)("img",{alt:f,src:n})}):i.startsWith("video")?(0,r.jsx)("video",{className:"h-full w-full",controls:!0,autoPlay:!0,children:(0,r.jsx)("source",{src:n,type:i})}):i.startsWith("audio")?(0,r.jsx)("div",{className:"flex h-full w-full items-center justify-center",children:(0,r.jsx)("audio",{controls:!0,children:(0,r.jsx)("source",{src:n,type:i})})}):(0,r.jsx)("object",{className:(0,s.classNames)("h-full w-full",C&&"min-h-[65vh]"),data:C?n+"#view=FitV":n}),(0,r.jsx)("button",{className:(0,s.classNames)("mx-auto mt-2 flex items-center gap-2.5 rounded border border-border bg-default px-2.5 py-1.5",!b&&"hover:bg-info hover:text-info-contrast"),onClick:()=>{(v.platform===s.Platform.Ios||(0,d.gn)())&&document.activeElement&&document.activeElement.blur(),S().catch(console.error)},disabled:b,children:b?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.Z,{className:"h-4 w-4"}),"Saving..."]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Z,{type:"download"}),"Save to Files"]})})]})};function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function y(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class v extends i.K{static getType(){return"inline-file"}constructor(e,t,n){super(),this.__src=e,this.__mimeType=t,this.__fileName=n}static clone(e){return new v(e.__src,e.__mimeType,e.__fileName)}static importJSON(e){return b(e.src,e.mimeType,e.fileName)}exportJSON(){return m(m({},super.exportJSON()),{},{src:this.__src,mimeType:this.__mimeType,fileName:this.__fileName,version:1,type:"inline-file"})}static importDOM(){return{object:e=>"OBJECT"!==e.tagName?null:{conversion:()=>{if(!(e instanceof HTMLObjectElement))return null;const t=e.type||"application/octet-stream",n=e.getAttribute("data-file-name")||void 0;return{node:b(e.data,t,n)}},priority:2},img:e=>"IMG"!==e.tagName?null:{conversion:()=>{if(!(e instanceof HTMLImageElement))return null;const t=e.getAttribute("data-mime-type")||"image/png",n=e.getAttribute("data-file-name")||e.alt;return{node:b(e.currentSrc||e.src,t,n)}},priority:2},source:e=>{if("SOURCE"!==e.tagName)return null;const t=e.parentElement;return!t||"VIDEO"!==t.tagName&&"AUDIO"!==t.tagName?null:{conversion:()=>{if(!(e instanceof HTMLSourceElement))return null;const n=e.type||"VIDEO"===t.tagName?"video/mp4":"audio/mp3";return{node:b(e.src,n,e.getAttribute("data-file-name")||void 0)}},priority:2}}}}exportDOM(){if(this.__mimeType.startsWith("image/")){const e=document.createElement("img");return e.setAttribute("src",this.__src),e.setAttribute("data-mime-type",this.__mimeType),e.setAttribute("data-file-name",this.__fileName||""),{element:e}}if(this.__mimeType.startsWith("audio")){const e=document.createElement("audio");e.setAttribute("controls",""),e.setAttribute("data-file-name",this.__fileName||"");const t=document.createElement("source");return t.setAttribute("src",this.__src),t.setAttribute("type",this.__mimeType),e.appendChild(t),{element:e}}if(this.__mimeType.startsWith("video")){const e=document.createElement("video");e.setAttribute("controls",""),e.setAttribute("data-file-name",this.__fileName||"");const t=document.createElement("source");return t.setAttribute("src",this.__src),t.setAttribute("type",this.__mimeType),e.appendChild(t),{element:e}}const e=document.createElement("object");return e.setAttribute("data",this.__src),e.setAttribute("type",this.__mimeType),e.setAttribute("data-file-name",this.__fileName||""),{element:e}}getTextContent(){return"".concat(this.__mimeType.startsWith("image/")?"!":"","[").concat(this.__fileName,"](").concat(this.__src,")")}decorate(e,t){const n=t.theme.embedBlock||{},i={base:n.base||"",focus:n.focus||""};return(0,r.jsx)(f,{className:i,format:this.__format,node:this,nodeKey:this.getKey(),src:this.__src,mimeType:this.__mimeType,fileName:this.__fileName})}}function A(e){return e instanceof v}function b(e,t,n){return new v(e,t,n)}},7355:(e,t,n)=>{"use strict";n.d(t,{H:()=>f});var r=n(52322),i=n(31031),o=n(97247),s=n(2784),a=n(48518),l=n(26013),c=n(57751),u=n(95768),d=n(74522),h=n(47166);function p(e){let{itemUuid:t,node:n}=e;const i=(0,a.I)(),[o]=(0,h.g)(),p=(0,u.o)(),f=(0,s.useMemo)((()=>i.items.findItem(t)),[i,t]),{toggleAppPane:g}=(0,d.G)(),m=(0,s.useCallback)((async e=>{const t=await p.activateItem(e);t&&g(t)}),[g,p]),y=(0,s.useCallback)((async e=>{p.unlinkItemFromSelectedItem(e).catch(console.error),o.update((()=>{n.remove()}))}),[p,n,o]);if(!f)return(0,r.jsxs)("div",{children:["Unable to find item ",t]});const v=(0,c.X)(f,"linked");return(0,r.jsx)(l.Z,{className:"mx-0.5",link:v,activateItem:m,unlinkItem:y,isBidirectional:!1,inlineFlex:!0,wrappable:!0},v.id)}class f extends i.Ij{static getType(){return"snbubble"}static clone(e){return new f(e.__id,e.__key)}static importJSON(e){return(0,o.fj)(e.itemUuid)}exportJSON(){return{itemUuid:this.getId(),version:1,type:"snbubble"}}static importDOM(){return{div:e=>e.hasAttribute("data-lexical-item-uuid")?{conversion:o.fD,priority:2}:null}}createDOM(){return document.createElement("span")}exportDOM(){const e=document.createElement("span");e.setAttribute("data-lexical-item-uuid",this.__id);const t=document.createTextNode(this.getTextContent());return e.append(t),{element:e}}updateDOM(){return!1}constructor(e,t){super(t),this.__id=e}getId(){return this.__id}getTextContent(e,t){return"[Item: ".concat(this.__id,"]")}decorate(e){return(0,r.jsx)(p,{node:this,itemUuid:this.__id})}}},97247:(e,t,n)=>{"use strict";n.d(t,{fD:()=>i,fj:()=>o});var r=n(7355);function i(e){const t=e.getAttribute("data-lexical-item-uuid");return t?{node:o(t)}:null}function o(e){return new r.H(e)}},49060:(e,t,n)=>{"use strict";n.d(t,{kx:()=>C,Dq:()=>S,Mf:()=>w});var r=n(52322),i=n(20266),o=n(48518),s=n(47931),a=n(41707),l=n(24118),c=n(74667),u=n(47166),d=n(29894),h=n(31031),p=n(2784),f=n(46003),g=n(84075),m=n(73055);const y=e=>{let{className:t,src:n,alt:i,node:y,format:v,nodeKey:A}=e;const b=(0,o.I)(),[w]=(0,u.g)(),[S,C]=(0,p.useState)(!1),[E,I]=(0,p.useState)(!1),_=(0,p.useCallback)((async()=>{I(!0);try{const e=await fetch(n);if(!e.ok)return;const t=await e.blob(),r=new File([t],n,{type:t.type}),{filesController:i,linkingController:o}=b,s=await i.uploadNewFile(r,{showToast:!1});if(!s)return;w.update((()=>{const e=(0,f.K5)(s.uuid);y.replace(e)})),o.linkItemToSelectedItem(s)}catch(e){console.error(e)}finally{I(!1)}}),[b,w,y,n]),x=n.startsWith("data:"),P=b.isNativeMobileWeb()||(0,l.Z$)()||x,k=(0,p.useRef)(null),[B,O]=(0,m.y)(A);return(0,p.useEffect)((()=>w.registerCommand(h.Kr,(e=>{var t,n;return!!(null===(t=k.current)||void 0===t?void 0:t.contains(e.target))&&(e.preventDefault(),null===(n=(0,h.gI)(A))||void 0===n||n.selectEnd(),setTimeout((()=>{O(!B)})),!0)}),h.KB)),[w,B,A,O]),(0,r.jsx)(c.U,{className:t,format:v,nodeKey:A,children:(0,r.jsxs)("div",{ref:k,className:"relative flex min-h-[2rem] flex-col items-center gap-2.5",children:[(0,r.jsx)("img",{alt:i,src:n,onLoad:()=>{C(!0)}}),S&&P&&(0,r.jsx)("button",{className:(0,d.classNames)("flex items-center gap-2.5 rounded border border-border bg-default px-2.5 py-1.5",!E&&"hover:bg-info hover:text-info-contrast"),onClick:()=>{(b.platform===d.Platform.Ios||(0,g.gn)())&&document.activeElement&&document.activeElement.blur(),_().catch(console.error)},disabled:E,children:E?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Z,{className:"h-4 w-4"}),"Saving..."]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.Z,{type:"download"}),"Save image to Files"]})})]})})};function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function b(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class w extends i.K{static getType(){return"unencrypted-image"}constructor(e,t){super(),this.__src=e,this.__alt=t}static clone(e){return new w(e.__src,e.__alt)}static importJSON(e){return C(e.src,e.alt)}exportJSON(){return A(A({},super.exportJSON()),{},{src:this.__src,alt:this.__alt,version:1,type:"unencrypted-image"})}static importDOM(){return{img:e=>"IMG"!==e.tagName?null:{conversion:()=>e instanceof HTMLImageElement?{node:C(e.currentSrc||e.src,e.alt)}:null,priority:2}}}exportDOM(){const e=document.createElement("img");return this.__alt&&e.setAttribute("alt",this.__alt),e.setAttribute("src",this.__src),{element:e}}getTextContent(){return"![".concat(this.__alt||"image","](").concat(this.__src,")")}decorate(e,t){const n=t.theme.embedBlock||{},i={base:n.base||"",focus:n.focus||""};return(0,r.jsx)(y,{className:i,format:this.__format,nodeKey:this.getKey(),node:this,src:this.__src,alt:this.__alt})}}function S(e){return e instanceof w}function C(e,t){return new w(e,t)}},46513:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f,a:()=>p});var r=n(52322),i=n(47166),o=n(31031),s=n(2784),a=n(66498),l=n(49060),c=n(29016),u=n(13959),d=n(756),h=n(24118);function p(e){let{onClose:t}=e;const[n,o]=(0,s.useState)(""),[l]=(0,i.g)(),c=(0,s.useCallback)((e=>{e&&setTimeout((()=>e.focus()))}),[]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("label",{className:"flex flex-col gap-1.5",children:["URL:",(0,r.jsx)(u.Z,{value:n,onChange:o,ref:c})]}),(0,r.jsx)("div",{className:"mt-2.5 flex justify-end",children:(0,r.jsx)(d.Z,{onClick:()=>{n.length<1||(l.dispatchCommand(a.NP,n),t())},disabled:!n,small:(0,h.Av)(),children:"Confirm"})})]})}function f(){const[e]=(0,i.g)();return(0,s.useEffect)((()=>(0,c.qV)(e.registerCommand(a.NP,(e=>{const t=(0,l.kx)(e);(0,o.od)([t]),(0,o._v)(t.getParentOrThrow())&&(0,c.JB)(t,o.BE).selectEnd();const n=(0,o.BE)();return t.getParentOrThrow().insertAfter(n),!0}),o.u6),e.registerNodeTransform(l.Mf,(e=>{const t=e.getParent();t&&1===t.getChildrenSize()&&(t.insertBefore(e),t.remove())})))),[e]),null}},82931:(e,t,n)=>{"use strict";n.d(t,{V:()=>p,n:()=>h});var r=n(52322),i=n(65268),o=n(31031),s=n(2784),a=n(47166),l=n(29016),c=n(13959),u=n(756),d=n(24118);function h(e){let{activeEditor:t,onClose:n}=e;const[o,a]=(0,s.useState)("5"),[l,h]=(0,s.useState)("5"),p=(0,s.useCallback)((e=>{e&&setTimeout((()=>e.focus()))}),[]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("label",{className:"mb-2.5 flex items-center justify-between gap-3",children:["Rows:",(0,r.jsx)(c.Z,{type:"number",value:o,onChange:a,ref:p})]}),(0,r.jsxs)("label",{className:"mb-2.5 flex items-center justify-between gap-3",children:["Columns:",(0,r.jsx)(c.Z,{type:"number",value:l,onChange:h})]}),(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsx)(u.Z,{onClick:()=>{t.dispatchCommand(i.bF,{columns:l,rows:o}),n()},small:(0,d.Av)(),children:"Confirm"})})]})}function p(){const[e]=(0,a.g)();return(0,s.useEffect)((()=>(0,l.qV)(e.registerNodeTransform(i.g0,(e=>{e.getFirstChild()||e.remove()})),e.registerNodeTransform(i.Fh,(e=>{e.getFirstChild()||e.remove();const t=!!e.getNextSibling(),n=!!e.getPreviousSibling();e.getParent()&&(t?n||e.insertBefore((0,o.BE)()):e.insertAfter((0,o.BE)()))})))),[e]),null}},79014:(e,t,n)=>{"use strict";n.d(t,{H:()=>l,Z:()=>c});var r=n(47166),i=n(29016),o=n(31031),s=n(2784),a=n(43800);const l=(0,o.fA)("INSERT_TWEET_COMMAND");function c(){const[e]=(0,r.g)();return(0,s.useEffect)((()=>{if(!e.hasNodes([a.je]))throw new Error("TwitterPlugin: TweetNode not registered on editor");return e.registerCommand(l,(e=>{const t=(0,a.m2)(e);return(0,i.z8)(t),!0}),o.VN)}),[e]),null}},93559:(e,t,n)=>{"use strict";n.d(t,{A:()=>l,Z:()=>c});var r=n(47166),i=n(29016),o=n(31031),s=n(2784),a=n(59179);const l=(0,o.fA)("INSERT_YOUTUBE_COMMAND");function c(){const[e]=(0,r.g)();return(0,s.useEffect)((()=>{if(!e.hasNodes([a.gL]))throw new Error("YouTubePlugin: YouTubeNode not registered on editor");return e.registerCommand(l,(e=>{const t=(0,a.kU)(e);return(0,i.z8)(t),!0}),o.VN)}),[e]),null}},91031:(e,t,n)=>{"use strict";n.d(t,{S:()=>o,a:()=>i});var r=n(31031);function i(e,t){return e.length<=t?e:e.substring(0,t)+"..."}function o(e,t,n){const o=(0,r.Gv)().getAllTextNodes().slice(0,2);let s="";o.forEach(((e,t)=>{s+=e.getTextContent(),t!==o.length-1&&(s+="\n")})),t&&(s=i(s,t));try{const t=JSON.stringify(e.toJSON());null==n||n(t,s)}catch(e){console.error(e),window.alert("An invalid change was made inside the Super editor. Your change was not saved. Please report this error to the team: ".concat(JSON.stringify(e)))}}},88669:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(52322),i=n(96332),o=n(57189),s=n(29894);const a=e=>{let{checked:t,onChange:n,className:a,disabled:l=!1,tabIndex:c,forceDesktopStyle:u,children:d}=e;const h=t&&!l;return(0,r.jsxs)("label",{className:(0,s.classNames)(l?"opacity-50":"",a),children:[(0,r.jsx)(i.T,{children:(0,r.jsx)(o.X,{checked:t,onChange:e=>{n(e.target.checked)},tabIndex:c})}),(0,r.jsx)("div",{className:(0,s.classNames)("relative box-content inline-block flex-shrink-0 cursor-pointer rounded-full border-2 border-solid border-transparent bg-clip-padding transition-colors duration-150 ease-out","ring-2 ring-transparent focus-within:border-default focus-within:shadow-none focus-within:outline-none focus-within:ring-info",h?"bg-info":"bg-neutral",u?"h-4.5 w-8":"h-7 w-12 md:h-4.5 md:w-8"),children:(0,r.jsx)("div",{className:(0,s.classNames)("absolute top-1/2 block -translate-y-1/2 rounded-full bg-default transition-transform duration-150 ease-out",u?"left-[2px] h-3.5 w-3.5":"left-[0.15rem] h-6 w-6 md:left-[2px] md:h-3.5 md:w-3.5",t?u?"translate-x-[calc(2rem-1.125rem)]":"translate-x-[calc(3.25rem-1.5rem-0.5rem)] md:translate-x-[calc(2rem-1.125rem)]":"")})}),d]})}},4160:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(52322),i=n(47931);const o=e=>{let{contact:t}=e;return(0,r.jsxs)("div",{title:"Last edited by",className:"flex select-none items-center rounded bg-info px-1.5 py-1 text-info-contrast",children:[(0,r.jsx)(i.Z,{ariaLabel:"Shared by",type:"pencil",className:"mr-1 text-info-contrast",size:"medium"}),(0,r.jsx)("span",{className:"mr-auto overflow-hidden text-ellipsis text-sm font-semibold lg:text-xs",children:t.name})]})}},69170:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(52322),i=n(47931);const o=e=>{let{vault:t}=e;return(0,r.jsxs)("div",{title:"Vault name",className:"flex select-none items-center rounded border border-passive-2 px-1.5 py-1",children:[(0,r.jsx)(i.Z,{ariaLabel:"Shared in vault",type:t.iconString,className:"mr-1",size:"medium",emojiSize:"small"}),(0,r.jsx)("span",{className:"mr-auto overflow-hidden text-ellipsis text-sm font-semibold lg:text-xs",children:t.name})]})}},88450:(e,t,n)=>{"use strict";n.d(t,{CU:()=>s,Cp:()=>b,G9:()=>y,HF:()=>a,IN:()=>v,KX:()=>p,Mk:()=>A,Uj:()=>f,WB:()=>r,Wh:()=>o,Yx:()=>d,ZL:()=>l,gu:()=>h,jD:()=>u,l9:()=>g,t2:()=>m,xi:()=>i,z6:()=>c});const r="notes",i="navigation",o=/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/,s=/^([a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?)$/,a=-1,l=200,c=1e3,u=864e5,d=7,h=365,p=1e6,f="Tag folders",g="A Plus or Pro plan is required to enable Tag folders.",m="Smart Tags",y=/^(?=.*Chrome).*/i.test(navigator.userAgent),v={icon:"file-doc",subtleIcon:"format-align-left",iconClassName:"text-accessory-tint-1",iconTintNumber:1},A=(()=>{let e=!1;try{const t=Object.defineProperty({},"passive",{get:()=>{e=!0}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}return e})(),b=1.5*p},72435:(e,t,n)=>{"use strict";n.d(t,{N:()=>r});const r={ContentList:"notes-scrollable",EditorColumn:"editor-column",EditorContent:"editor-content",FileTextPreview:"file-text-preview",FileTitleEditor:"file-title-editor",ItemsColumn:"items-column",NavigationColumn:"navigation",NoteTextEditor:"note-text-editor",NoteTitleEditor:"note-title-editor",NoteOptionsButton:"note-options-button",RootId:"app-group-root",NoteStatusTooltip:"note-status-tooltip",ItemLinkAutocompleteInput:"item-link-autocomplete-input",SearchBar:"search-bar",ConflictResolutionButton:"conflict-resolution-button",SuperEditor:"super-editor"}},39537:(e,t,n)=>{"use strict";n.d(t,{$n:()=>a,CN:()=>g,Cp:()=>I,FG:()=>S,I0:()=>B,JT:()=>x,KV:()=>y,L0:()=>u,Lw:()=>s,OW:()=>h,PJ:()=>_,Sq:()=>p,X0:()=>f,X5:()=>P,YQ:()=>c,ZW:()=>O,Zh:()=>b,ac:()=>d,eI:()=>j,eh:()=>N,fv:()=>w,hy:()=>C,ip:()=>E,j0:()=>k,nS:()=>A,ng:()=>v,p7:()=>D,xU:()=>l,xZ:()=>T,zR:()=>o,zu:()=>m});var r=n(29894),i=n(24118);const o="There was an error syncing. Please try again. If all else fails, try signing out and signing back in.",s="A new update is ready to install. Please use the top-level 'Updates' menu to manage installation.",a="Are you sure you want to delete this tag? Deleting a tag will not delete its subtags or its notes.",l="This note is a placeholder and cannot be deleted. To remove from your list, simply navigate to a different note.",c="This note had editing disabled. If you'd like to delete it, enable editing, and try again.",u="This note has editing disabled. If you'd like to edit its options, enable editing, and try again.",d="This note has editing disabled. If you'd like to restore it to a previous revision, enable editing and try again.";function h(e,t){return t?"Are you sure you want to permanently delete ".concat(e,"?"):"Are you sure you want to move ".concat(e," to the trash?")}function p(e){return"Are you sure you want to permanently delete ".concat(e," note(s)?")}const f="This action will remove this workspace and its related data from this device. Your synced data will not be affected.",g="End-to-end encryption is enabled. Your data is encrypted on your device first, then synced to your private cloud.",m="Encryption is enabled. Your data is encrypted using your passcode before it is saved to your device storage.",y="Encryption is not enabled. Sign in, register, or add a passcode lock to enable encryption.",v="Your data has been successfully imported.",A="The two passcodes you entered do not match. Please try again.",b="The two passwords you entered do not match. Please try again.",w="Unable to open file. Ensure it is a proper JSON file and try again.",S="The file you selected is not a valid backup file. Please extract the contents of the zip file, then upload the contained .txt file.";function C(e){return"Import complete. ".concat(e," items were not imported because there was an error decrypting them. Make sure the password is correct and try again.")}const E="This backup file was created using an unsupported version of the application and cannot be imported here. Please update your application and try again.",I="The encryption upgrade is in progress. You may lose data if you quit the app. Are you sure you want to quit?",_="A passcode change is in progress. You may lose data if you quit the app. Are you sure you want to quit?",x="A passcode removal is in progress. You may lose data if you quit the app. Are you sure you want to quit?",P="Encryption upgrade available",k='Encryption version 004 is available. This version strengthens the encryption algorithms your account and local storage use. To learn more about this upgrade, visit our <a href="https://standardnotes.com/help/security" target="_blank">Security Upgrade page.</a>',B="Upgrade",O="This will delete the previously saved offline key.",N="Are you sure you want to permanently delete your account? You will be asked to confirm your account password in the next step. If you have an active paid subscription, cancel the subscription first. Otherwise, if you'd like to keep the subscription, you can re-register with the same email after deletion, and your subscription will be linked back up with your account.",D="There was an error while trying to update your settings. Please try again.",j={protectingNoteWithoutProtectionSources:"Access to this note will not be restricted until you set up a passcode or account.",trashItemsTitle:"Move to Trash",deleteItemsPermanentlyTitle:"Delete Permanently",trashNotesText:"Are you sure you want to move these notes to the trash?",trashFilesText:"Are you sure you want to move these files to the trash?",enterPasscode:"Please enter a passcode.",deleteMultipleFiles:"Are you sure you want to permanently delete these files?"},T={keyStorageInfo(e){if(!(0,i.Z$)())return null;if(!e.hasAccount())return null;const t=(0,i.Xf)(e.device),n=t===r.Platform.WindowsDesktop?"credential manager":t===r.Platform.MacDesktop?"keychain":"password manager";return"Your keys are currently stored in your operating system's ".concat(n,". Adding a passcode prevents even your operating system from reading them.")},deleteNotes(e){let t=arguments.length>2?arguments[2]:void 0;return 1===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1)?e?"Are you sure you want to permanently delete ".concat(t,"?"):"Are you sure you want to move ".concat(t," to the trash?"):e?"Are you sure you want to permanently delete these notes?":"Are you sure you want to move these notes to the trash?"},deleteFile:e=>"Are you sure you want to permanently delete ".concat(e,"?"),archiveLockedNotesAttempt(e){const t=e?"archive":"unarchive";return 1===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1)?"This note has editing disabled. If you'd like to ".concat(t," it, enable editing, and try again."):"One or more of these notes have editing disabled. If you'd like to ".concat(t," them, make sure editing is enabled on all of them, and try again.")},deleteLockedNotesAttempt(){return 1===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1)?"This note has editing disabled. If you'd like to delete it, enable editing, and try again.":"One or more of these notes have editing disabled. If you'd like to delete them, make sure editing is enabled on all of them, and try again."}}},97638:(e,t,n)=>{"use strict";n.d(t,{t:()=>r});const r="w-6 h-6 md:w-5 md:h-5"},91583:(e,t,n)=>{"use strict";n.d(t,{Ab:()=>o,sU:()=>r,zj:()=>i});const r="3.195.12",i=null!=window.electronRemoteBridge,o=null==window.electronRemoteBridge},23995:(e,t,n)=>{"use strict";n.d(t,{L:()=>i});var r=n(29894);class i{constructor(e){this.eventBus=e,this.dealloced=!1,this.disposers=[],this.eventObservers=[]}async publishCrossControllerEventSync(e,t){await this.eventBus.publishSync({type:e,payload:t},r.InternalEventPublishStrategy.SEQUENCE)}deinit(){this.dealloced=!0,this.eventBus=void 0;for(const e of this.disposers)e();this.disposers=void 0,this.eventObservers.length=0}addEventObserver(e){return this.eventObservers.push(e),()=>{(0,r.removeFromArray)(this.eventObservers,e)}}notifyEvent(e,t){this.eventObservers.forEach((n=>n(e,t)))}}},47436:(e,t,n)=>{"use strict";n.d(t,{p:()=>A,y:()=>b});var r=n(87985),i=n(87978),o=n(88450),s=n(84075),a=n(39537),l=n(22826),c=n(54310),u=n(87901),d=n(29894),h=n(54569),p=n(80075),f=n(23995),g=n(55088),m=n(91031);const y=[i.d.ToggleFileProtection],v=[i.d.DownloadFile,i.d.PreviewFile];var A;!function(e){e.FileUploadedToNote="FileUploadedToNote",e.FileUploadFinished="FileUploadFinished",e.UploadAndInsertFile="UploadAndInsertFile"}(A||(A={}));class b extends f.L{deinit(){super.deinit(),this.notesController=void 0,this.filePreviewModalController=void 0}constructor(e,t,r,f,g,A,b,w,S,C,E,I,_,x,P){super(P),this.notesController=e,this.filePreviewModalController=t,this.archiveService=r,this.vaultDisplayService=f,this.vaults=g,this.items=A,this.files=b,this.mutator=w,this.sync=S,this.protections=C,this.alerts=E,this.platform=I,this.mobileDevice=_,this._isNativeMobileWeb=x,this.allFiles=[],this.attachedFiles=[],this.showFileContextMenu=!1,this.showProtectedOverlay=!1,this.fileContextMenuLocation={x:0,y:0},this.shouldUseStreamingAPI=c.A7.available(),this.reader=this.shouldUseStreamingAPI?c.KC:c.Re,this.maxFileSize=this.reader.maximumFileSize(),this.uploadProgressMap=new Map,this.setShowFileContextMenu=e=>{this.showFileContextMenu=e},this.setShowProtectedOverlay=e=>{this.showProtectedOverlay=e},this.setFileContextMenuLocation=e=>{this.fileContextMenuLocation=e},this.reloadAllFiles=()=>{this.allFiles=this.items.getDisplayableFiles()},this.reloadAttachedFiles=()=>{const e=this.notesController.firstSelectedNote;e&&(this.attachedFiles=this.items.itemsReferencingItem(e).filter(d.isFile))},this.deleteFile=async e=>{if(await(0,s.VG)({text:'Are you sure you want to permanently delete "'.concat(e.name,'"?'),confirmButtonStyle:"danger"})){const t=(0,h.fz)({type:h.pC.Loading,message:'Deleting file "'.concat(e.name,'"...')});await this.files.deleteFile(e),(0,h.fz)({type:h.pC.Success,message:'Deleted file "'.concat(e.name,'"')}),(0,h.Xd)(t)}},this.attachFileToSelectedNote=async e=>{const t=this.notesController.firstSelectedNote;t?(await this.mutator.associateFileWithNote(e,t),this.sync.sync()):(0,h.fz)({type:h.pC.Error,message:"Could not attach file because selected note was deleted"})},this.detachFileFromNote=async e=>{const t=this.notesController.firstSelectedNote;t?(await this.mutator.disassociateFileWithNote(e,t),this.sync.sync()):(0,h.fz)({type:h.pC.Error,message:"Could not attach file because selected note was deleted"})},this.toggleFileProtection=async e=>{let t;return t=e.protected?await this.protections.unprotectFile(e):await this.protections.protectFile(e),this.sync.sync(),t?t.protected:e.protected},this.authorizeProtectedActionForFile=async(e,t)=>{const n=await this.protections.authorizeProtectedActionForItems([e],t);return n.length>0&&n.includes(e)},this.renameFile=async(e,t)=>{await this.mutator.renameFile(e,t),this.sync.sync()},this.handleFileAction=async e=>{const t=e.payload.file;let n=!0;if(t.protected&&!y.includes(e.type)&&(n=await this.authorizeProtectedActionForFile(t,d.ChallengeReason.AccessProtectedFile)),!n)return{didHandleAction:!1};switch(e.type){case i.d.AttachFileToNote:await this.attachFileToSelectedNote(t);break;case i.d.DetachFileToNote:await this.detachFileFromNote(t);break;case i.d.DeleteFile:await this.deleteFile(t);break;case i.d.DownloadFile:await this.downloadFile(t,e.payload.directoryHandle);break;case i.d.ToggleFileProtection:{const n=await this.toggleFileProtection(t);e.callback(n);break}case i.d.RenameFile:await this.renameFile(t,e.payload.name);break;case i.d.PreviewFile:this.filePreviewModalController.activate(t,e.payload.otherFiles)}return v.includes(e.type)||this.sync.sync().catch(console.error),{didHandleAction:!0}},this.getFileBlob=async e=>{const t=[];if(await this.files.downloadFile(e,(async e=>{t.push(e)})))return;const n=(0,l.L)(t);return new Blob([n],{type:e.mimeType})},this.alertIfFileExceedsSizeLimit=e=>!!(!this.shouldUseStreamingAPI&&this.maxFileSize&&e.size>=this.maxFileSize)&&(this.alerts.alert("This file exceeds the limits supported in this browser. To upload files greater than ".concat(this.maxFileSize/o.KX,"MB, please use the desktop application or the Chrome browser."),'Cannot upload file "'.concat(e.name,'"')).catch(console.error),!0),this.deleteFilesPermanently=async e=>{const t=a.eI.trashItemsTitle,n=1===e.length?a.xZ.deleteFile(e[0].name):a.eI.deleteMultipleFiles;await(0,s.VG)({title:t,text:n,confirmButtonStyle:"danger"})&&(await Promise.all(e.map((e=>this.files.deleteFile(e)))),this.sync.sync())},this.setProtectionForFiles=async(e,t)=>{e?await this.protections.protectItems(t)&&this.setShowProtectedOverlay(!0):await this.protections.unprotectItems(t,d.ChallengeReason.UnprotectFile)&&this.setShowProtectedOverlay(!1),this.sync.sync()},this.getDirectoryHandleForDownloads=async()=>{if(this.shouldUseStreamingAPI)return await window.showDirectoryPicker({startIn:"downloads"})},this.downloadFiles=async e=>{if(this.platform!==d.Platform.MacDesktop&&this.platform!==d.Platform.MacWeb)await Promise.all(e.map((e=>this.handleFileAction({type:i.d.DownloadFile,payload:{file:e}}))));else{let t;if(e.length>1)try{t=await this.getDirectoryHandleForDownloads()}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return;console.error(e)}for(const n of e)await this.handleFileAction({type:i.d.DownloadFile,payload:{file:n,directoryHandle:t}})}},this.downloadFilesAsZip=async e=>{if(!this.shouldUseStreamingAPI)throw new Error("Device does not support streaming API");const t=e.filter((e=>e.protected));if(t.length>0&&0===(await this.protections.authorizeProtectedActionForItems(t,d.ChallengeReason.AccessProtectedFile)).length)throw new Error("Authorization is required to download protected files");const r=await window.showSaveFilePicker({types:[{description:"ZIP file",accept:{"application/zip":[".zip"]}}]}),i=(0,h.fz)({type:h.pC.Progress,title:"Downloading ".concat(e.length," files as archive"),message:"Preparing archive..."});try{const t=await n.e(612).then(n.bind(n,75612)),o=await r.createWritable(),s=new t.ZipWriter(o,{level:0}),a=[];for(const t of e){const e=new TransformStream;let n=(0,u.parseAndCreateZippableFileName)(t.name);a.includes(n)&&(n="".concat(Date.now()," ").concat(n)),s.add(n,e.readable).catch(console.error),a.push(n);const r=e.writable.getWriter();await this.files.downloadFile(t,(async(e,n)=>{await r.write(e),(0,h.es)(i,{message:'Downloading "'.concat((0,m.a)(t.name,25),'"'),progress:Math.floor(n.percentComplete)})})).catch(console.error),await r.close()}await s.close()}finally{(0,h.Xd)(i)}(0,h.fz)({type:h.pC.Success,message:"Successfully downloaded ".concat(e.length," files as archive")})},(0,p.rC)(this,{allFiles:p.LO,attachedFiles:p.LO,showFileContextMenu:p.LO,fileContextMenuLocation:p.LO,showProtectedOverlay:p.LO,reloadAllFiles:p.aD,reloadAttachedFiles:p.aD,setShowFileContextMenu:p.aD,setShowProtectedOverlay:p.aD,setFileContextMenuLocation:p.aD,uploadProgressMap:p.LO}),this.disposers.push(A.streamItems(d.ContentType.TYPES.File,(()=>{this.reloadAllFiles(),this.reloadAttachedFiles()}))),this.disposers.push((0,p.U5)((()=>e.selectedNotes),(()=>{this.reloadAttachedFiles()})))}async downloadFile(e,t){let n="",i=!1;this.mobileDevice&&this.platform===d.Platform.Android&&(i=await this.mobileDevice.canDisplayNotifications());try{const o=this.shouldUseStreamingAPI?new c.A7(e.name):new c.N4,s=o instanceof c.A7;if(s){const n=t?await t.getFileHandle(e.name,{create:!0}):void 0;await o.selectFileToSaveTo(n)}n=this.mobileDevice&&i?await this.mobileDevice.displayNotification({title:'Downloading file "'.concat(e.name,'"'),android:{progress:{max:100,current:0,indeterminate:!0},onlyAlertOnce:!0}}):(0,h.fz)({type:h.pC.Progress,message:'Downloading file "'.concat(e.name,'" (0%)'),progress:0});const a=[];let u;const p=await this.files.downloadFile(e,(async(t,l)=>{s?await o.pushBytes(t):a.push(t);const c=Math.floor(l.percentComplete);this.mobileDevice&&i?this.mobileDevice.displayNotification({id:n,title:'Downloading file "'.concat(e.name,'"'),android:{progress:{max:100,current:c,indeterminate:!1},onlyAlertOnce:!0}}).catch(console.error):(0,h.es)(n,{message:(0,r.Qc)(l,e.name,{showPercent:!0}),progress:c}),u=l}));if(p instanceof d.ClientDisplayableError)throw new Error(p.text);if(s)await o.finish();else{const t=(0,l.L)(a),n=new Blob([t],{type:e.mimeType});await(0,g.c)({archiveService:this.archiveService,platform:this.platform,mobileDevice:this.mobileDevice,blob:n,filename:e.name,isNativeMobileWeb:this._isNativeMobileWeb.execute().getValue(),showToastOnAndroid:!1})}this.mobileDevice&&i?await this.mobileDevice.displayNotification({title:'Successfully downloaded file "'.concat(e.name,'"')}):(0,h.fz)({type:h.pC.Success,message:"Successfully downloaded file".concat(u&&"local"===u.source?" from local backup":"")})}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return;console.error(e),(0,h.fz)({type:h.pC.Error,message:"There was an error while downloading the file"})}n&&(this.mobileDevice&&i?this.mobileDevice.cancelNotification(n).catch(console.error):(0,h.Xd)(n))}async selectAndUploadNewFiles(e,t){(await this.reader.selectFiles()).forEach((async n=>{if(this.alertIfFileExceedsSizeLimit(n))return;const r=await this.uploadNewFile(n,{note:e});r&&t&&t(r)}))}async uploadNewFile(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{showToast:n=!0,note:r,onUploadStart:o,onUploadFinish:s}=t;let a,l=!1;n&&this.mobileDevice&&this.platform===d.Platform.Android&&(l=await this.mobileDevice.canDisplayNotifications());try{const t=this.files.minimumChunkSize(),c=e instanceof File?e:e instanceof FileSystemFileHandle&&this.shouldUseStreamingAPI?await e.getFile():void 0;if(!c)return;if(this.alertIfFileExceedsSizeLimit(c))return;const p=d.UuidGenerator.GenerateUuid();this.uploadProgressMap.set(p,{file:c,progress:0}),o&&o(p);const f=r?this.vaults.getItemVault(r):void 0,g=await this.files.beginNewFileUpload(c.size,f||this.vaultDisplayService.exclusivelyShownVault);if(g instanceof d.ClientDisplayableError)throw(0,h.fz)({type:h.pC.Error,message:"Unable to start upload session"}),new Error("Unable to start upload session");const m=g.getProgress().percentComplete;this.uploadProgressMap.set(p,{file:c,progress:m}),n&&(a=this.mobileDevice&&l?await this.mobileDevice.displayNotification({title:'Uploading file "'.concat(c.name,'"'),android:{progress:{max:100,current:m,indeterminate:!0},onlyAlertOnce:!0}}):(0,h.fz)({type:h.pC.Progress,message:'Uploading file "'.concat(c.name,'" (').concat(m,"%)"),progress:m}));const y=async e=>{let{data:t,index:n,isLast:r}=e;await this.files.pushBytesForUpload(g,t,n,r);const i=Math.round(g.getProgress().percentComplete);this.uploadProgressMap.set(p,{file:c,progress:i}),a&&(this.mobileDevice&&l?await this.mobileDevice.displayNotification({id:a,title:'Uploading file "'.concat(c.name,'"'),android:{progress:{max:100,current:i,indeterminate:!1},onlyAlertOnce:!0}}):(0,h.es)(a,{message:'Uploading file "'.concat(c.name,'" (').concat(i,"%)"),progress:i}))},v=await this.reader.readFile(c,t,y);if(!v.mimeType){const{ext:e}=(0,u.parseFileName)(c.name);v.mimeType=await this.archiveService.getMimeType(e)}const b=await this.files.finishUpload(g,v,p);if(b instanceof d.ClientDisplayableError)throw(0,h.fz)({type:h.pC.Error,message:b.text}),new Error(b.text);return s&&s(),this.notifyEvent(A.FileUploadFinished,{[A.FileUploadFinished]:{uploadedFile:b}}),a&&(this.mobileDevice&&l&&this.mobileDevice.cancelNotification(a).catch(console.error),(0,h.Xd)(a)),n&&(this.mobileDevice&&l?this.mobileDevice.displayNotification({id:b.uuid,title:'Uploaded file "'.concat(b.name,'"'),android:{actions:[{title:"Open",pressAction:{id:"open-file"}}]}}).catch(console.error):(0,h.fz)({type:h.pC.Success,message:'Uploaded file "'.concat(b.name,'"'),actions:[{label:"Open",handler:e=>{this.handleFileAction({type:i.d.PreviewFile,payload:{file:b}}),(0,h.Xd)(e)}}],autoClose:!0})),b}catch(e){console.error(e),a&&(this.mobileDevice&&l&&this.mobileDevice.cancelNotification(a).catch(console.error),(0,h.Xd)(a)),this.mobileDevice&&l?this.mobileDevice.displayNotification({title:"There was an error while uploading the file"}).catch(console.error):(0,h.fz)({type:h.pC.Error,message:"There was an error while uploading the file"})}}notifyObserversOfUploadedFileLinkingToCurrentNote(e){this.notifyEvent(A.FileUploadedToNote,{[A.FileUploadedToNote]:{uuid:e}})}uploadAndInsertFileToCurrentNote(e){this.notifyEvent(A.UploadAndInsertFile,{[A.UploadAndInsertFile]:{fileOrHandle:e}})}}},92249:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c,o:()=>a});var r=n(52322),i=n(2784),o=n(34309);const s=(0,i.createContext)(void 0),a=()=>{const e=(0,i.useContext)(s);if(!e)throw new Error("Component must be a child of <FilesControllerProvider />");return e},l=(0,i.memo)((e=>{let{children:t}=e;return(0,r.jsx)(r.Fragment,{children:t})})),c=(0,o.Pi)((e=>{let{controller:t,children:n}=e;return(0,r.jsx)(s.Provider,{value:t,children:(0,r.jsx)(l,{children:n})})}))},95768:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c,o:()=>a});var r=n(52322),i=n(2784),o=n(34309);const s=(0,i.createContext)(void 0),a=()=>{const e=(0,i.useContext)(s);if(!e)throw new Error("Component must be a child of <LinkingControllerProvider />");return e},l=(0,i.memo)((e=>{let{children:t}=e;return(0,r.jsx)(r.Fragment,{children:t})})),c=(0,o.Pi)((e=>{let{controller:t,children:n}=e;return(0,r.jsx)(s.Provider,{value:t,children:(0,r.jsx)(l,{children:n})})}))},61659:(e,t,n)=>{"use strict";n.d(t,{I:()=>h});var r=n(22325),i=n(29894),o=n(87901),s=n(88450);const a={Desktop:350,ImmediateChange:100,NativeMobileWeb:700,LargeNote:60*s.z6};var l=n(80075);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class h{constructor(e,t,n,r,i,o,s){this.item=e,this.items=t,this.mutator=n,this.sessions=r,this.sync=i,this.alerts=o,this._isNativeMobileWeb=s,this.savingLocallyPromise=null,this.status=void 0,(0,l.rC)(this,{status:l.LO,setStatus:l.aD})}setStatus(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.statusChangeTimeout&&clearTimeout(this.statusChangeTimeout),t?this.statusChangeTimeout=setTimeout((()=>{(0,l.z)((()=>{this.status=e}))}),400):this.status=e}showSavingStatus(){this.setStatus({type:"saving",message:"Saving…"},!1)}showAllChangesSavedStatus(){this.setStatus({type:"saved",message:"All changes saved"+(this.sessions.isSignedOut()?" offline":"")})}showWaitingToSyncLargeNoteStatus(){this.setStatus({type:"waiting",message:"Note is too large",description:"It will be synced less often. Changes will be saved offline normally."},!1)}showErrorStatus(e){e||(e={type:"error",message:"Sync Unreachable",description:"Changes saved offline"}),this.setStatus(e)}setItem(e){this.item=e}deinit(){this.syncTimeout&&clearTimeout(this.syncTimeout),this.largeNoteSyncTimeout&&clearTimeout(this.largeNoteSyncTimeout),this.statusChangeTimeout&&clearTimeout(this.statusChangeTimeout),this.savingLocallyPromise&&this.savingLocallyPromise.reject(),this.savingLocallyPromise=null,this.largeNoteSyncTimeout=void 0,this.syncTimeout=void 0,this.status=void 0,this.statusChangeTimeout=void 0,this.item=void 0}isLargeNote(e){return new Blob([e]).size>s.Cp}async saveAndAwaitLocalPropagation(e){this.savingLocallyPromise=(0,o.Deferred)(),this.syncTimeout&&clearTimeout(this.syncTimeout);const t=e.bypassDebouncer||this.sessions.isSignedOut()?a.ImmediateChange:this._isNativeMobileWeb.execute().getValue()?a.NativeMobileWeb:a.Desktop;return new Promise((n=>{const r=this.isLargeNote(e.text?e.text:this.item.text);r&&(this.showWaitingToSyncLargeNoteStatus(),this.queueLargeNoteSyncIfNeeded()),this.syncTimeout=setTimeout((()=>{this.undebouncedMutateAndSync(u(u({},e),{},{localOnly:r,onLocalPropagationComplete:()=>{this.savingLocallyPromise&&this.savingLocallyPromise.resolve(),n()}}))}),t)}))}queueLargeNoteSyncIfNeeded(){if(void 0===this.largeNoteSyncTimeout){const e=this.sessions.isSignedIn()?a.LargeNote:a.ImmediateChange;this.largeNoteSyncTimeout=setTimeout((()=>{this.largeNoteSyncTimeout=void 0,this.performSyncOfLargeItem()}),e)}}async performSyncOfLargeItem(){const e=this.items.findItem(this.item.uuid);e&&e.dirty&&this.sync.sync()}async undebouncedMutateAndSync(e){var t;this.items.findItem(this.item.uuid)?(await this.mutator.changeItem(this.item,(t=>{const n=t;if(e.customMutate&&e.customMutate(n),null!=e.title&&(n.title=e.title),null!=e.text&&(n.text=e.text),e.previews)n.preview_plain=e.previews.previewPlain,n.preview_html=e.previews.previewHtml;else if(!e.dontGeneratePreviews&&null!=e.text){const t=e.text||"",r=t.length>160,i=t.substring(0,160)+(r?"...":"");n.preview_plain=i,n.preview_html=void 0}}),e.isUserModified?r.MutationType.UpdateUserTimestamps:r.MutationType.NoUpdateUserTimestamps),this.sync.sync({mode:e.localOnly?i.SyncMode.LocalOnly:void 0}),this.queueLargeNoteSyncIfNeeded(),null===(t=e.onLocalPropagationComplete)||void 0===t||t.call(e)):this.alerts.alert(i.InfoStrings.InvalidNote)}syncOnlyIfLargeNote(){this.isLargeNote(this.item.text)&&this.performSyncOfLargeItem()}}},74455:(e,t,n)=>{"use strict";var r;n.d(t,{h:()=>r}),function(e){e.TagSelection="tag-selection",e.ItemSelection="item-selection",e.TableView="files-view",e.Editing="editing"}(r||(r={}))},7453:(e,t,n)=>{"use strict";function r(e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}n.d(t,{l:()=>r})},66724:(e,t,n)=>{"use strict";n.d(t,{m:()=>o});var r=n(52322),i=n(2784);const o=(e,t)=>((0,i.useEffect)((()=>{function n(n){var r,i;e&&n.origin===new URL(e).origin&&(null===(i=null===(r=null==n?void 0:n.data)||void 0===r?void 0:r.type)||void 0===i?void 0:i.includes("captcha"))&&t(n.data.token)}return window.addEventListener("message",n),()=>{window.removeEventListener("message",n)}}),[t]),e?(0,r.jsx)("iframe",{src:e,height:480}):null)},32810:(e,t,n)=>{"use strict";n.d(t,{g:()=>o,l:()=>i});var r=n(2784);const i=function(e){let{updateOnWindowResize:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{updateOnWindowResize:!1};const[n,i]=(0,r.useState)();return(0,r.useEffect)((()=>{let n;if(e){const r=new ResizeObserver((()=>{i(e.getBoundingClientRect())}));return r.observe(e),t&&(n=()=>{window.clearTimeout(void 0),window.setTimeout((()=>{i(e.getBoundingClientRect())}),100)},window.addEventListener("resize",n)),()=>{r.unobserve(e),n&&window.removeEventListener("resize",n)}}i(void 0)}),[e,t]),n},o=(e,t)=>{(0,r.useEffect)((()=>{let n;if(e){const r=new ResizeObserver((()=>{t()}));return r.observe(e),n=()=>{window.clearTimeout(void 0),window.setTimeout((()=>{t()}),100)},window.addEventListener("resize",n),()=>{r.unobserve(e),window.removeEventListener("resize",n)}}}),[e,t])}},20153:(e,t,n)=>{"use strict";n.d(t,{f:()=>a});var r=n(48518),i=n(95768),o=n(29894),s=n(2784);const a=e=>{const t=(0,r.I)(),n=(0,i.o)(),{getLinkedNotesForItem:a,getNotesLinkingToItem:l,getFilesLinksForItem:c,getLinkedTagsForItem:u}=n,[,d]=(0,s.useState)(Date.now()),h=a(e)||[],p=l(e)||[],{filesLinkedToItem:f,filesLinkingToItem:g}=c(e),m=u(e)||[];return(0,s.useEffect)((()=>t.items.streamItems([o.ContentType.TYPES.Note,o.ContentType.TYPES.File,o.ContentType.TYPES.Tag],(()=>{d(Date.now())}))),[t]),{notesLinkedToItem:h,notesLinkingToItem:p,filesLinkedToItem:f,filesLinkingToItem:g,tagsLinkedToItem:m}}},16786:(e,t,n)=>{"use strict";n.d(t,{j:()=>a});var r=n(48518),i=n(29894),o=n(2784),s=n(38232);const a=e=>{const t=(0,r.I)(),[n,a]=(0,o.useState)(),l=(0,s.Y)(n),[c,u]=(0,o.useState)(),[d,h]=(0,o.useState)(),p=(0,o.useCallback)((()=>{t.featuresController.isVaultsEnabled()&&(a(t.vaultDisplayService.getItemVault(e)),u((n=>t.sharedVaults.getItemLastEditedBy(e)||n)),h(t.sharedVaults.getItemSharedBy(e)))}),[t.featuresController,t.sharedVaults,t.vaultDisplayService,e]);return(0,o.useLayoutEffect)((()=>{p()}),[p]),(0,o.useEffect)((()=>t.items.streamItems(i.ContentType.TYPES.VaultListing,(e=>{let{changed:t,inserted:n}=e;const r=t.concat(n).find((e=>{var t;return e.uuid===(null===(t=l.current)||void 0===t?void 0:t.uuid)}));r&&a(r)}))),[t.items,l]),(0,o.useEffect)((()=>t.items.streamItems(i.ContentType.TYPES.Note,(t=>{let{changed:n}=t;n.find((t=>t.uuid===e.uuid))&&p()}))),[t.items,e.uuid,p]),{vault:n,lastEditedByContact:c,sharedByContact:d}}},64503:(e,t,n)=>{"use strict";n.d(t,{r:()=>l});var r=n(2784),i=n(38232);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const l=function(e){let{open:t,enter:n,enterCallback:o,exit:a,exitCallback:l}=e,c=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const[u,d]=(0,r.useState)(null),[h,p]=(0,r.useState)((()=>t));(0,r.useEffect)((()=>{(c||t)&&p(t)}),[c,t]);const f=(0,i.Y)(n),g=(0,i.Y)(o),m=(0,i.Y)(a),y=(0,i.Y)(l);return(0,r.useEffect)((()=>{if(!u)return;if(c)return void p(t);const e=window.matchMedia("(prefers-reduced-motion: reduce)").matches,n=f.current,r=g.current,i=m.current,o=y.current;if(e&&!(null==n?void 0:n.reducedMotionKeyframes)&&!(null==i?void 0:i.reducedMotionKeyframes))return void p(t);let a;if(t){if(!n)return p(!0),void(null==r||r(u));n.initialStyle&&Object.assign(u.style,n.initialStyle),a=u.animate(e&&n.reducedMotionKeyframes?n.reducedMotionKeyframes:n.keyframes,s(s({},n.options),{},{fill:"forwards"})),a.finished.then((()=>{null==r||r(u)})).catch((e=>{null!==(null==a?void 0:a.currentTime)&&console.error(e)}))}else{if(!i)return p(!1),void(null==o||o(u));i.initialStyle&&Object.assign(u.style,i.initialStyle),a=u.animate(e&&i.reducedMotionKeyframes?i.reducedMotionKeyframes:i.keyframes,s(s({},i.options),{},{fill:"forwards"})),a.finished.then((()=>{p(!1),null==o||o(u)})).catch((e=>{null!==(null==a?void 0:a.currentTime)&&console.error(e)}))}return()=>{null==a||a.cancel()}}),[t,u,f,g,m,y,c]),[h,d,u]}},91611:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(84075),i=n(88450),o=n(2784);const s=(e,t)=>{const{initialFocus:n=0,shouldAutoFocus:s=!1,shouldWrapAround:a=!0,resetLastFocusedOnBlur:l=!1}=t||{},c=(0,o.useRef)([]),u=(0,o.useCallback)((()=>{e&&(c.current=Array.from(e.querySelectorAll('button, div[role="button"]')),c.current[0]&&(c.current[0].tabIndex=0))}),[e]),d=(0,o.useRef)(n),h=(0,o.useCallback)((e=>{var t;d.current=e,null===(t=c.current[e])||void 0===t||t.focus()}),[]),p=(0,o.useCallback)(((e,t)=>{let n=e+1;for(n>t.length-1&&(n=a?0:e);t[n].disabled;)n++,n>t.length-1&&(n=a?0:e);return n}),[a]),f=(0,o.useCallback)(((e,t)=>{let n=e-1;for(n<0&&(n=a?t.length-1:e);t[n].disabled;)n--,n<0&&(n=a?t.length-1:e);return n}),[a]);(0,o.useEffect)((()=>{e&&(e.tabIndex=i.HF,u(),c.current[0]&&(c.current[0].tabIndex=0))}),[e,u]);const g=(0,o.useCallback)((e=>{var t,n;const i="INPUT"===(null===(t=document.activeElement)||void 0===t?void 0:t.tagName),o=!!(null===(n=document.activeElement)||void 0===n?void 0:n.closest('[role="listbox"]'));if(!(i||o||e.key!==r.u8.Up&&e.key!==r.u8.Down)){if(e.preventDefault(),e.key===r.u8.Up){const e=f(d.current,c.current);h(e)}if(e.key===r.u8.Down){const e=p(d.current,c.current);h(e)}}}),[h,p,f]),m=(0,o.useCallback)((()=>{const e=c.current;if(e.length<1)return;const t=Array.from(e).findIndex((e=>e.dataset.selected));let r=t>-1?t:n;r=p(r-1,e),h(r)}),[h,p,n]);(0,o.useEffect)((()=>{s&&setTimeout((()=>{m()}),20)}),[m,s]);const y=(0,o.useCallback)((t=>{(!e||!e.contains(t.relatedTarget))&&l&&(d.current=n)}),[e,n,l]);return(0,o.useEffect)((()=>{if(!e)return;e.addEventListener("keydown",g),e.addEventListener("focusout",y);const t=new MutationObserver((()=>{u()}));return t.observe(e,{childList:!0,subtree:!0}),()=>{e.removeEventListener("keydown",g),e.removeEventListener("focusout",y),t.disconnect()}}),[m,g,y,e,u]),{setInitialFocus:m}}},67955:(e,t,n)=>{"use strict";n.d(t,{H:()=>i});var r=n(2784);const i=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:370;const o=(0,r.useRef)(),s=(0,r.useRef)(),a=(0,r.useCallback)((()=>{o.current&&clearTimeout(o.current)}),[]),l=(0,r.useCallback)((n=>{a(),s.current={x:n.clientX,y:n.clientY},o.current=window.setTimeout((()=>{var r;null===(r=e.current)||void 0===r||r.addEventListener("mousedown",(e=>{e.preventDefault(),e.stopPropagation()}),{once:!0,capture:!0});const i=n.clientX,o=n.clientY;t(i,o)}),i)}),[a,i,e,t]),c=(0,r.useCallback)((e=>{!s.current||e.clientX===s.current.x&&e.clientY===s.current.y||a()}),[a]),u=(0,r.useCallback)((()=>{e.current&&(e.current.addEventListener("pointerdown",l),n&&e.current.addEventListener("pointermove",c),e.current.addEventListener("pointercancel",a),e.current.addEventListener("pointerup",a))}),[a,c,n,l,e]),d=(0,r.useCallback)((()=>{e.current&&(e.current.removeEventListener("pointerdown",l),n&&e.current.removeEventListener("pointermove",c),e.current.removeEventListener("pointercancel",a),e.current.removeEventListener("pointerup",a))}),[a,c,n,l,e]);return(0,r.useMemo)((()=>({attachEvents:u,cleanupEvents:d})),[u,d])}},3555:(e,t,n)=>{"use strict";n.d(t,{Jj:()=>o,Yd:()=>i,ac:()=>s});var r=n(2784);const i={sm:"(max-width: 767px)",md:"(min-width: 768px)",lg:"(min-width: 1024px)",xl:"(min-width: 1280px)","2xl":"(min-width:  1536px)",pointerFine:"(pointer: fine)"},o={sm:"(min-width: 0px) and (max-width: 767px)",md:"(min-width: 768px) and (max-width: 1023px)",lg:"(min-width: 1024px) and (max-width: 1279px)",xl:"(min-width: 1280px) and (max-width: 1536px)","2xl":"(min-width:  1536px)",pointerFine:"(pointer: fine)"},s=e=>{const[t,n]=(0,r.useState)((()=>window.matchMedia(e).matches));return(0,r.useEffect)((()=>{const t=e=>{n(e.matches)},r=window.matchMedia(e);return null!=r.addEventListener?r.addEventListener("change",t):r.addListener(t),()=>{const n=window.matchMedia(e);null!=n.removeEventListener?n.removeEventListener("change",t):n.removeListener(t)}}),[e]),t}},5778:(e,t,n)=>{"use strict";n.d(t,{D:()=>s,Z:()=>a});var r=n(48518),i=n(29894),o=n(2784);function s(e){const t=(0,r.I)(),[n,s]=(0,o.useState)(t.preferences.getLocalValue(e,i.PrefDefaults[e])),a=(0,o.useCallback)((n=>{t.preferences.setLocalValue(e,n)}),[t,e]);return(0,o.useEffect)((()=>t.addEventObserver((async()=>{const n=t.preferences.getLocalValue(e,i.PrefDefaults[e]);s(n)}),i.ApplicationEvent.LocalPreferencesChanged)),[t,e]),[n,a]}function a(e){const t=(0,r.I)(),[n,s]=(0,o.useState)(t.getPreference(e,i.PrefDefaults[e]));return(0,o.useEffect)((()=>t.addEventObserver((async()=>{const n=t.getPreference(e,i.PrefDefaults[e]);s(n)}),i.ApplicationEvent.PreferencesChanged)),[t,e]),n}},38232:(e,t,n)=>{"use strict";n.d(t,{Y:()=>i});var r=n(2784);function i(e){const t=(0,r.useRef)(e);return(0,r.useLayoutEffect)((()=>{t.current=e}),[e]),t}},54502:(e,t,n)=>{"use strict";n.d(t,{t:()=>i});var r=n(24118);const i=async(e,t,n,i)=>{if(!t)throw new Error("Share function being used outside mobile webview");const o=await(0,r.cN)(n);e.shareBase64AsFile(o,i)}},74547:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u,x:()=>l});var r=n(52322),i=n(97168),o=n(34309),s=n(2784);const a=(0,s.createContext)(null),l=()=>{const e=(0,s.useContext)(a);if(!e)throw new Error("Component must be a child of <AndroidBackHandlerProvider />");return e},c=(0,s.memo)((e=>{let{children:t}=e;return(0,r.jsx)(r.Fragment,{children:t})})),u=(0,o.Pi)((e=>{let{application:t,children:n}=e;const o=(0,s.useCallback)((e=>t.addAndroidBackHandlerEventListener(e)),[t]);return(0,s.useEffect)((()=>{t.setAndroidBackHandlerFallbackListener((()=>{var e;const n=null===(e=t.getValue(i.g))||void 0===e||e;return t.mobileDevice.exitApp(n),!0}))}),[t]),(0,r.jsx)(a.Provider,{value:o,children:(0,r.jsx)(c,{children:n})})}))},22826:(e,t,n)=>{"use strict";n.d(t,{L:()=>r});const r=e=>{const t=e.map((e=>e.length)).reduce(((e,t)=>e+t),0),n=new Uint8Array(t);let r=0;return e.forEach((e=>{n.set(e,r),r+=e.length})),n}},93632:(e,t,n)=>{"use strict";n.d(t,{AF:()=>s,An:()=>a,Bn:()=>h,Bt:()=>i,DZ:()=>l,Eu:()=>o,ML:()=>p,fi:()=>u,gx:()=>c,ng:()=>d});var r=n(29894);const i=e=>(0,r.dateToLocalizedString)(e),o=e=>{if(e)return"".concat(e.toDateString()," ").concat(e.toLocaleTimeString())},s=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n="".concat(e.toLocaleDateString(void 0,{weekday:"long",day:"numeric",month:"short",year:"numeric"}));return t?"".concat(n," at ").concat(e.toLocaleTimeString(void 0,{timeStyle:"short"})):n},a=e=>{const t="".concat(e.toLocaleDateString());return"".concat(t," at ").concat(e.toLocaleTimeString(void 0,{timeStyle:"short"}))},l=e=>e.toLocaleTimeString(void 0,{timeStyle:"short"});function c(e,t){return e.toLocaleDateString()===t.toLocaleDateString()}function u(e,t){const n=new Date(e);return n.setMonth(n.getMonth()+t,1),n}function d(e,t){return e.toLocaleString("default",{weekday:t})}function h(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}function p(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=e,i=t,o=!1;e>t&&(r=t,i=e,o=!0);const s=i.getFullYear()-r.getFullYear(),a=i.getMonth()-r.getMonth(),l=i.getDate()-r.getDate();let c=0;return!0===n&&l>0?c=1:!0!==n&&l<0&&(c=-1),(o?-1:1)*(12*s+a+c)}},55088:(e,t,n)=>{"use strict";n.d(t,{c:()=>l});var r=n(24118),i=n(87901),o=n(54569),s=n(54502),a=n(29894);const l=async e=>{var t;e.isNativeMobileWeb?e.mobileDevice&&e.platform===a.Platform.Ios?(0,s.t)(e.mobileDevice,e.isNativeMobileWeb,e.blob,e.filename):e.mobileDevice&&e.platform===a.Platform.Android&&async function(e,t,n){let s,a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];a&&(s=(0,o.fz)({type:o.pC.Loading,message:"Downloading ".concat(n,"..")}));const l=await(0,r.cN)(t),{name:c,ext:u}=(0,i.parseFileName)(n),d=(0,i.sanitizeFileName)(c);n="".concat(d,".").concat(u);const h=await e.downloadBase64AsFile(l,n);s&&(0,o.Xd)(s),a&&(h?(0,o.fz)({type:o.pC.Success,message:"Downloaded ".concat(n)}):(0,o.fz)({type:o.pC.Error,message:"Could not download ".concat(n)}))}(e.mobileDevice,e.blob,e.filename,null===(t=e.showToastOnAndroid)||void 0===t||t):e.archiveService.downloadData(e.blob,e.filename)}},43426:(e,t,n)=>{"use strict";n.d(t,{l:()=>i});var r=n(29894);function i(e,t){if(e instanceof r.SNTag)return{titlePrefix:t.items.getTagPrefixTitle(e),longTitle:t.items.getTagLongTitle(e)}}},81222:(e,t,n)=>{"use strict";n.d(t,{i:()=>o});var r=n(88450),i=n(84409);function o(e,t){switch(e){case void 0:case i.NoteType.Plain:return["plain-text",1];case i.NoteType.RichText:return["rich-text",1];case i.NoteType.Markdown:return["markdown",2];case i.NoteType.Authentication:return["authenticator",6];case i.NoteType.Spreadsheet:return["spreadsheets",5];case i.NoteType.Task:return["tasks",3];case i.NoteType.Code:return["code",4];case i.NoteType.Super:return[t?r.IN.subtleIcon:r.IN.icon,r.IN.iconTintNumber];case i.NoteType.Unknown:default:return["editor",1]}}},30383:(e,t,n)=>{"use strict";function r(e){let t="file-other";return"application/pdf"===e&&(t="file-pdf"),/word/.test(e)&&(t="file-doc"),/powerpoint|presentation/.test(e)&&(t="file-ppt"),/excel|spreadsheet/.test(e)&&(t="file-xls"),/^image\//.test(e)&&(t="file-image"),/^video\//.test(e)&&(t="file-mov"),/^audio\//.test(e)&&(t="file-music"),/(zip)|([tr]ar)|(7z)/.test(e)&&(t="file-zip"),t}n.d(t,{A:()=>r})},79323:(e,t,n)=>{"use strict";n.d(t,{b:()=>s});var r=n(29894),i=n(81222),o=n(30383);function s(e,t){if(e instanceof r.SNNote){const n=t.componentManager.editorForNote(e),[r,o]=(0,i.i)(n.noteType);return[r,"text-accessory-tint-".concat(o)]}if(e instanceof r.FileItem)return[(0,o.A)(e.mimeType),"text-info"];if(e instanceof r.SNTag)return[e.iconString,"text-info"];throw new Error("Unhandled case in getItemIcon")}},57751:(e,t,n)=>{"use strict";function r(e,t){return{id:"".concat(e.uuid,"-").concat(t),item:e,type:t}}n.d(t,{X:()=>r})},11032:(e,t,n)=>{"use strict";n.d(t,{R:()=>i,f:()=>o});var r=n(29894);function i(e){return e.title&&e.title.length>0?e.title:(0,r.isNote)(e)?e.preview_plain:""}function o(e,t,n){const i=function(e,t){var n;if((0,r.isNote)(e)){if(e.title.length>0)return e.title;if(!e.protected)return e.preview_plain}else if((0,r.isTag)(e))return t.items.getTagLongTitle(e);return null!==(n=e.title)&&void 0!==n?n:""}(e,n).toLowerCase(),o=i.includes(t.toLowerCase()),s=e.archived||e.trashed;return o&&!s}},90509:(e,t,n)=>{"use strict";n.d(t,{Q:()=>c});var r=n(29894),i=n(57751),o=n(11032);function s(e,t){let n=!1;const r=t.references.some((t=>t.uuid===e.uuid)),i=e.references.some((e=>e.uuid===(null==t?void 0:t.uuid)));return n=t.content_type===e.content_type?r:i||r,n}function a(e,t){return e.content_type===r.ContentType.TYPES.Tag&&e.title===t}const l=50;function c(e,t,n){let c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{returnEmptyIfQueryEmpty:!0},u=[];const d=[],h=[];let p=!1;const f={linkedResults:h,unlinkedItems:u,linkedItems:d,shouldShowCreateTag:p};if(!n)return f;if(!e.length&&c.returnEmptyIfQueryEmpty)return f;const g=(0,r.naturalSort)(t.items.getItems([r.ContentType.TYPES.Note,r.ContentType.TYPES.File,r.ContentType.TYPES.Tag]),"title"),m=[],y=[],v=[];for(let a=0;a<g.length;a++){const u=g[a];if(n.uuid===u.uuid)continue;if(c.contentType&&u.content_type!==c.contentType)continue;if(e.length&&!(0,o.f)(u,e,t))continue;if(s(u,n)){h.length<l&&h.push((0,i.X)(u,"linked")),d.push(u);continue}const p=null==c.contentType,f=(A=e,Math.max(10,3*A.length));u.content_type!==r.ContentType.TYPES.Tag||p&&!(m.length<f&&u.content_type===r.ContentType.TYPES.Tag)?u.content_type!==r.ContentType.TYPES.Note||p&&!(y.length<f)?u.content_type!==r.ContentType.TYPES.File||p&&!(v.length<f)||v.push(u):y.push(u):m.push(u)}var A;return u=[...m,...y,...v],p=!h.find((t=>a(t.item,e)))&&!u.find((t=>a(t,e))),{linkedResults:h,linkedItems:d,unlinkedItems:u,shouldShowCreateTag:p}}},1754:(e,t,n)=>{"use strict";n.d(t,{A1:()=>p,Av:()=>v,Ds:()=>h,Hs:()=>y,Ju:()=>m,KC:()=>d,Xf:()=>u,Yu:()=>b,Z$:()=>g,cN:()=>w,cv:()=>E,e1:()=>S,h6:()=>f,jb:()=>A,r8:()=>l,rP:()=>C,t2:()=>c});var r=n(29894),i=n(91583),o=n(88450),s=n(3555),a=n(84075);const l=!1;function c(){try{const e=navigator.platform.toLowerCase();let t="";return t=e.includes("iphone")||(0,a.gn)()?"ios":e.includes("android")||(0,a.Dt)()?"android":e.includes("mac")?"mac":e.includes("win")?"windows":(e.includes("linux"),"linux"),t+(g()?"-desktop":"-web")}catch(e){return"unknown-platform"}}function u(e){return"platform"in e?e.platform:(0,r.platformFromString)(c())}function d(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function h(e,t){let n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return()=>{const i=this,o=arguments,s=r&&!n;n&&clearTimeout(n),n=setTimeout((function(){n=null,r||e.apply(i,o)}),t),s&&e.apply(i,o)}}async function p(e,t){const n=window.onbeforeunload;try{window.onbeforeunload=()=>e,await t()}finally{window.onbeforeunload=n}}if(Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(e,t){if(null==this)throw new TypeError('"this" is null or not defined');const n=Object(this),r=n.length>>>0;if(0===r)return!1;const i=0|t;let o=Math.max(i>=0?i:r-Math.abs(i),0);for(;o<r;){if((s=n[o])===(a=e)||"number"==typeof s&&"number"==typeof a&&isNaN(s)&&isNaN(a))return!0;o++}var s,a;return!1}}),!i.Ab&&!i.zj)throw Error("Neither __WEB__ nor __DESKTOP__ is true. Check your configuration files.");function f(e){for(const t of Object.getOwnPropertyNames(e))try{delete e[t]}catch(e){}}function g(){return i.zj}const m=e=>o.CU.test(e),y=()=>{(0,a.gn)()&&(()=>{const e=document.querySelector("meta[name=viewport]");if(null!==e){let t=e.getAttribute("content");if(!t)return;const n=/maximum-scale=[0-9.]+/g;t=n.test(t)?t.replace(n,"maximum-scale=1.0"):[t,"maximum-scale=1.0"].join(", "),e.setAttribute("content",t)}})()},v=()=>window.matchMedia(s.Jj.sm).matches,A=()=>window.matchMedia(s.Jj.md).matches,b=()=>v()||A(),w=e=>new Promise(((t,n)=>{const r=new FileReader;r.onloadend=()=>{r.result&&"string"==typeof r.result?t(r.result):n()},r.readAsDataURL(e)})),S=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:512;const r=atob(e),i=[];for(let e=0;e<r.length;e+=n){const t=r.slice(e,e+n),o=new Array(t.length);for(let e=0;e<t.length;e++)o[e]=t.charCodeAt(e);const s=new Uint8Array(o);i.push(s)}return new Blob(i,{type:t})};function C(e){return e?e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth?e:C(e.parentElement):null}function E(e){return e*parseFloat(getComputedStyle(document.documentElement).fontSize)}},24118:(e,t,n)=>{"use strict";n.d(t,{Lf:()=>r.L,Ds:()=>o.Ds,h6:()=>o.h6,Hs:()=>o.Hs,cN:()=>o.cN,e1:()=>o.e1,Xf:()=>o.Xf,t2:()=>o.t2,rP:()=>o.rP,Z$:()=>o.Z$,r8:()=>o.r8,Ju:()=>o.Ju,Av:()=>o.Av,KC:()=>o.KC,Yu:()=>o.Yu,jb:()=>o.jb,A1:()=>o.A1,cv:()=>o.cv,RB:()=>i});var r=n(22826);const i=(e,t)=>{const n=((e,t)=>{const n=e.toLowerCase(),r=t.toLowerCase();return n.indexOf(r)})(e,t);return n<0?[e]:((e,t,n)=>{const r=t>e.length||t<0,i=n>e.length||n<0;return r||i||t>n?[e]:[e.slice(0,t),e.slice(t,n),e.slice(n)].filter((e=>e.length>0))})(e,n,n+t.length)};var o=n(1754)},86429:(e,t,n)=>{"use strict";const r=n(29894);e.exports=r},95766:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,o=a(e),s=o[0],l=o[1],c=new i(function(e,t,n){return 3*(t+n)/4-n}(0,s,l)),u=0,d=l>0?s-4:s;for(n=0;n<d;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===l&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[u++]=255&t),1===l&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],s=16383,a=0,c=r-i;a<c;a+=s)o.push(l(e,a,a+s>c?c:a+s));return 1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),o.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)n[s]=o[s],r[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,r){for(var i,o,s=[],a=t;a<r;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},48834:(e,t,n)=>{"use strict";const r=n(95766),i=n(62333),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.lW=l,t.h2=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return c(e,t,n)}function c(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|g(e,t);let r=a(n);const i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(W(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(W(e,ArrayBuffer)||e&&W(e.buffer,ArrayBuffer))return p(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(W(e,SharedArrayBuffer)||e&&W(e.buffer,SharedArrayBuffer)))return p(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return l.from(r,t,n);const i=function(e){if(l.isBuffer(e)){const t=0|f(e.length),n=a(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||q(e.length)?a(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return u(e),a(e<0?0:0|f(e))}function h(e){const t=e.length<0?0:0|f(e.length),n=a(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function p(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,l.prototype),r}function f(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function g(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||W(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(i)return r?-1:Y(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,t,n);case"utf8":case"utf-8":return _(this,t,n);case"ascii":return P(this,t,n);case"latin1":case"binary":return k(this,t,n);case"base64":return I(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),q(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:A(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):A(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function A(e,t,n,r,i){let o,s=1,a=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,l/=2,n/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let r=-1;for(o=n;o<a;o++)if(c(e,o)===c(t,-1===r?0:o-r)){if(-1===r&&(r=o),o-r+1===l)return r*s}else-1!==r&&(o-=o-r),r=-1}else for(n+l>a&&(n=a-l),o=n;o>=0;o--){let n=!0;for(let r=0;r<l;r++)if(c(e,o+r)!==c(t,r)){n=!1;break}if(n)return o}return-1}function b(e,t,n,r){n=Number(n)||0;const i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;const o=t.length;let s;for(r>o/2&&(r=o/2),s=0;s<r;++s){const r=parseInt(t.substr(2*s,2),16);if(q(r))return s;e[n+s]=r}return s}function w(e,t,n,r){return Z(Y(t,e.length-n),e,n,r)}function S(e,t,n,r){return Z(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function C(e,t,n,r){return Z(z(t),e,n,r)}function E(e,t,n,r){return Z(function(e,t){let n,r,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)n=e.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function I(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function _(e,t,n){n=Math.min(e.length,n);const r=[];let i=t;for(;i<n;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=n){let n,r,a,l;switch(s){case 1:t<128&&(o=t);break;case 2:n=e[i+1],128==(192&n)&&(l=(31&t)<<6|63&n,l>127&&(o=l));break;case 3:n=e[i+1],r=e[i+2],128==(192&n)&&128==(192&r)&&(l=(15&t)<<12|(63&n)<<6|63&r,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:n=e[i+1],r=e[i+2],a=e[i+3],128==(192&n)&&128==(192&r)&&128==(192&a)&&(l=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&a,l>65535&&l<1114112&&(o=l))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=s}return function(e){const t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=x));return n}(r)}l.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,n){return c(e,t,n)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,n){return function(e,t,n){return u(e),e<=0?a(e):void 0!==t?"string"==typeof n?a(e).fill(t,n):a(e).fill(t):a(e)}(e,t,n)},l.allocUnsafe=function(e){return d(e)},l.allocUnsafeSlow=function(e){return d(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(W(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),W(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const r=l.allocUnsafe(t);let i=0;for(n=0;n<e.length;++n){let t=e[n];if(W(t,Uint8Array))i+t.length>r.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,i)}i+=t.length}return r},l.byteLength=g,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)y(this,t,t+1);return this},l.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},l.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},l.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?_(this,0,e):m.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){let e="";const n=t.h2;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},o&&(l.prototype[o]=l.prototype.inspect),l.prototype.compare=function(e,t,n,r,i){if(W(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;let o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0);const a=Math.min(o,s),c=this.slice(r,i),u=e.slice(t,n);for(let e=0;e<a;++e)if(c[e]!==u[e]){o=c[e],s=u[e];break}return o<s?-1:s<o?1:0},l.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},l.prototype.indexOf=function(e,t,n){return v(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return v(this,e,t,n,!1)},l.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let o=!1;for(;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":case"latin1":case"binary":return S(this,e,t,n);case"base64":return C(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const x=4096;function P(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function k(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function B(e,t,n){const r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i="";for(let r=t;r<n;++r)i+=J[e[r]];return i}function O(e,t,n){const r=e.slice(t,n);let i="";for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+256*r[e+1]);return i}function N(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,n,r,i,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function j(e,t,n,r,i){V(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,n}function T(e,t,n,r,i){V(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n+7]=o,o>>=8,e[n+6]=o,o>>=8,e[n+5]=o,o>>=8,e[n+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=s,s>>=8,e[n+2]=s,s>>=8,e[n+1]=s,s>>=8,e[n]=s,n+8}function M(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function F(e,t,n,r,o){return t=+t,n>>>=0,o||M(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function R(e,t,n,r,o){return t=+t,n>>>=0,o||M(e,0,n,8),i.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const r=this.subarray(e,t);return Object.setPrototypeOf(r,l.prototype),r},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||N(e,t,this.length);let r=this[e],i=1,o=0;for(;++o<t&&(i*=256);)r+=this[e+o]*i;return r},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||N(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=X((function(e){K(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))})),l.prototype.readBigUInt64BE=X((function(e){K(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<<BigInt(32))+BigInt(i)})),l.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||N(e,t,this.length);let r=this[e],i=1,o=0;for(;++o<t&&(i*=256);)r+=this[e+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||N(e,t,this.length);let r=t,i=1,o=this[e+--r];for(;r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||N(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){e>>>=0,t||N(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=X((function(e){K(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),l.prototype.readBigInt64BE=X((function(e){K(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)})),l.prototype.readFloatLE=function(e,t){return e>>>=0,t||N(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||N(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||D(this,e,t,n,Math.pow(2,8*n)-1,0);let i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||D(this,e,t,n,Math.pow(2,8*n)-1,0);let i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigUInt64LE=X((function(e,t=0){return j(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeBigUInt64BE=X((function(e,t=0){return T(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);D(this,e,t,n,r-1,-r)}let i=0,o=1,s=0;for(this[t]=255&e;++i<n&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);D(this,e,t,n,r-1,-r)}let i=n-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigInt64LE=X((function(e,t=0){return j(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeBigInt64BE=X((function(e,t=0){return T(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeFloatLE=function(e,t,n){return F(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return F(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return R(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return R(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);const i=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},l.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){const t=e.charCodeAt(0);("utf8"===r&&t<128||"latin1"===r)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;let i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{const o=l.isBuffer(e)?e:l.from(e,r),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=o[i%s]}return this};const L={};function Q(e,t,n){L[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function U(e){let t="",n=e.length;const r="-"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function V(e,t,n,r,i,o){if(e>n||e<t){const r="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new L.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,n){K(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||H(t,e.length-(n+1))}(r,i,o)}function K(e,t){if("number"!=typeof e)throw new L.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,n){if(Math.floor(e)!==e)throw K(e,n),new L.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new L.ERR_BUFFER_OUT_OF_BOUNDS;throw new L.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}Q("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),Q("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),Q("ERR_OUT_OF_RANGE",(function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=U(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=U(i)),i+="n"),r+=` It must be ${t}. Received ${i}`,r}),RangeError);const G=/[^+/0-9A-Za-z-_]/g;function Y(e,t){let n;t=t||1/0;const r=e.length;let i=null;const o=[];for(let s=0;s<r;++s){if(n=e.charCodeAt(s),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function z(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Z(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function W(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function q(e){return e!=e}const J=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?$:e}function $(){throw new Error("BigInt not supported")}},57359:function(e,t,n){var r;e.exports=(r=r||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==n.g&&n.g.crypto&&(r=n.g.crypto),!r)try{r=n(50633)}catch(e){}var i=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),s={},a=s.lib={},l=a.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=a.WordArray=l.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||d).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o<i;o++){var s=n[o>>>2]>>>24-o%4*8&255;t[r+o>>>2]|=s<<24-(r+o)%4*8}else for(var a=0;a<i;a+=4)t[r+a>>>2]=n[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=l.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(i());return new c.init(t,e)}}),u=s.enc={},d=u.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new c.init(n,t/2)}},h=u.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new c.init(n,t)}},p=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(h.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return h.parse(unescape(encodeURIComponent(e)))}},f=a.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,i=r.words,o=r.sigBytes,s=this.blockSize,a=o/(4*s),l=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,u=e.min(4*l,o);if(l){for(var d=0;d<l;d+=s)this._doProcessBlock(i,d);n=i.splice(0,l),r.sigBytes-=u}return new c.init(n,u)},clone:function(){var e=l.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),g=(a.Hasher=f.extend({cfg:l.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new g.HMAC.init(e,n).finalize(t)}}}),s.algo={});return s}(Math),r)},8139:function(e,t,n){var r,i,o;e.exports=(r=n(57359),o=(i=r).lib.WordArray,i.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var i=[],o=0;o<n;o+=3)for(var s=(t[o>>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a<n;a++)i.push(r.charAt(s>>>6*(3-a)&63));var l=r.charAt(64);if(l)for(;i.length%4;)i.push(l);return i.join("")},parse:function(e){var t=e.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var i=0;i<n.length;i++)r[n.charCodeAt(i)]=i}var s=n.charAt(64);if(s){var a=e.indexOf(s);-1!==a&&(t=a)}return function(e,t,n){for(var r=[],i=0,s=0;s<t;s++)if(s%4){var a=n[e.charCodeAt(s-1)]<<s%4*2|n[e.charCodeAt(s)]>>>6-s%4*2;r[i>>>2]|=a<<24-i%4*8,i++}return o.create(r,i)}(e,t,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64)},79174:function(e,t,n){var r;e.exports=(r=n(57359),function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,s=t.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();var l=s.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,s=e[t+0],l=e[t+1],p=e[t+2],f=e[t+3],g=e[t+4],m=e[t+5],y=e[t+6],v=e[t+7],A=e[t+8],b=e[t+9],w=e[t+10],S=e[t+11],C=e[t+12],E=e[t+13],I=e[t+14],_=e[t+15],x=o[0],P=o[1],k=o[2],B=o[3];x=c(x,P,k,B,s,7,a[0]),B=c(B,x,P,k,l,12,a[1]),k=c(k,B,x,P,p,17,a[2]),P=c(P,k,B,x,f,22,a[3]),x=c(x,P,k,B,g,7,a[4]),B=c(B,x,P,k,m,12,a[5]),k=c(k,B,x,P,y,17,a[6]),P=c(P,k,B,x,v,22,a[7]),x=c(x,P,k,B,A,7,a[8]),B=c(B,x,P,k,b,12,a[9]),k=c(k,B,x,P,w,17,a[10]),P=c(P,k,B,x,S,22,a[11]),x=c(x,P,k,B,C,7,a[12]),B=c(B,x,P,k,E,12,a[13]),k=c(k,B,x,P,I,17,a[14]),x=u(x,P=c(P,k,B,x,_,22,a[15]),k,B,l,5,a[16]),B=u(B,x,P,k,y,9,a[17]),k=u(k,B,x,P,S,14,a[18]),P=u(P,k,B,x,s,20,a[19]),x=u(x,P,k,B,m,5,a[20]),B=u(B,x,P,k,w,9,a[21]),k=u(k,B,x,P,_,14,a[22]),P=u(P,k,B,x,g,20,a[23]),x=u(x,P,k,B,b,5,a[24]),B=u(B,x,P,k,I,9,a[25]),k=u(k,B,x,P,f,14,a[26]),P=u(P,k,B,x,A,20,a[27]),x=u(x,P,k,B,E,5,a[28]),B=u(B,x,P,k,p,9,a[29]),k=u(k,B,x,P,v,14,a[30]),x=d(x,P=u(P,k,B,x,C,20,a[31]),k,B,m,4,a[32]),B=d(B,x,P,k,A,11,a[33]),k=d(k,B,x,P,S,16,a[34]),P=d(P,k,B,x,I,23,a[35]),x=d(x,P,k,B,l,4,a[36]),B=d(B,x,P,k,g,11,a[37]),k=d(k,B,x,P,v,16,a[38]),P=d(P,k,B,x,w,23,a[39]),x=d(x,P,k,B,E,4,a[40]),B=d(B,x,P,k,s,11,a[41]),k=d(k,B,x,P,f,16,a[42]),P=d(P,k,B,x,y,23,a[43]),x=d(x,P,k,B,b,4,a[44]),B=d(B,x,P,k,C,11,a[45]),k=d(k,B,x,P,_,16,a[46]),x=h(x,P=d(P,k,B,x,p,23,a[47]),k,B,s,6,a[48]),B=h(B,x,P,k,v,10,a[49]),k=h(k,B,x,P,I,15,a[50]),P=h(P,k,B,x,m,21,a[51]),x=h(x,P,k,B,C,6,a[52]),B=h(B,x,P,k,f,10,a[53]),k=h(k,B,x,P,w,15,a[54]),P=h(P,k,B,x,l,21,a[55]),x=h(x,P,k,B,A,6,a[56]),B=h(B,x,P,k,_,10,a[57]),k=h(k,B,x,P,y,15,a[58]),P=h(P,k,B,x,E,21,a[59]),x=h(x,P,k,B,g,6,a[60]),B=h(B,x,P,k,S,10,a[61]),k=h(k,B,x,P,p,15,a[62]),P=h(P,k,B,x,b,21,a[63]),o[0]=o[0]+x|0,o[1]=o[1]+P|0,o[2]=o[2]+k|0,o[3]=o[3]+B|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;n[i>>>5]|=128<<24-i%32;var o=e.floor(r/4294967296),s=r;n[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),t.sigBytes=4*(n.length+1),this._process();for(var a=this._hash,l=a.words,c=0;c<4;c++){var u=l[c];l[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return a},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function c(e,t,n,r,i,o,s){var a=e+(t&n|~t&r)+i+s;return(a<<o|a>>>32-o)+t}function u(e,t,n,r,i,o,s){var a=e+(t&r|n&~r)+i+s;return(a<<o|a>>>32-o)+t}function d(e,t,n,r,i,o,s){var a=e+(t^n^r)+i+s;return(a<<o|a>>>32-o)+t}function h(e,t,n,r,i,o,s){var a=e+(n^(t|~r))+i+s;return(a<<o|a>>>32-o)+t}t.MD5=o._createHelper(l),t.HmacMD5=o._createHmacHelper(l)}(Math),r.MD5)},35796:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(39601),i=n.n(r),o=n(82609),s=n.n(o)()(i());s.push([e.id,":root{--sn-stylekit-neutral-color: #72767e;--sn-stylekit-neutral-contrast-color: #ffffff;--sn-stylekit-info-color: #086dd6;--sn-stylekit-info-color-darkened: #065cb5;--sn-stylekit-info-contrast-color: #ffffff;--sn-stylekit-info-backdrop-color: #2b6fcf0f;--sn-stylekit-success-color: #007662;--sn-stylekit-success-contrast-color: #ffffff;--sn-stylekit-warning-color: #ebad00;--sn-stylekit-warning-contrast-color: #ffffff;--sn-stylekit-danger-color: #cc2128;--sn-stylekit-danger-contrast-color: #ffffff;--sn-stylekit-danger-light-color: #f9e4e5;--sn-stylekit-shadow-color: #c8c8c8;--sn-stylekit-background-color: #ffffff;--sn-stylekit-border-color: #dfe1e4;--sn-stylekit-foreground-color: #19191c;--sn-stylekit-contrast-background-color: rgba(244, 245, 247, 1);--sn-stylekit-contrast-foreground-color: #2e2e2e;--sn-stylekit-contrast-border-color: #e3e3e3;--sn-stylekit-secondary-background-color: #eeeff1;--sn-stylekit-secondary-foreground-color: #2e2e2e;--sn-stylekit-secondary-border-color: #e3e3e3;--sn-stylekit-secondary-contrast-background-color: #e3e3e3;--sn-stylekit-secondary-contrast-foreground-color: #2e2e2e;--sn-stylekit-secondary-contrast-border-color: #a2a2a2;--sn-stylekit-editor-background-color: var(--sn-stylekit-background-color);--sn-stylekit-editor-foreground-color: var(--sn-stylekit-foreground-color);--sn-stylekit-paragraph-text-color: #454545;--sn-stylekit-input-placeholder-color: #a8a8a8;--sn-stylekit-input-border-color: #e3e3e3;--sn-stylekit-scrollbar-thumb-color: #dfdfdf;--sn-stylekit-scrollbar-track-border-color: #e7e7e7;--sn-stylekit-theme-type: light;--sn-stylekit-theme-name: sn-light;--sn-stylekit-passive-color-0: #515357;--sn-stylekit-passive-color-1: #72767e;--sn-stylekit-passive-color-2: #bbbec4;--sn-stylekit-passive-color-3: #dfe1e4;--sn-stylekit-passive-color-4: #eeeff1;--sn-stylekit-passive-color-4-opacity-variant: #bbbec43d;--sn-stylekit-passive-color-5: #f4f5f7;--sn-stylekit-passive-color-6: #e5e5e5;--sn-stylekit-passive-color-super-light: #f9f9f9;--sn-stylekit-accessory-tint-color-1: #086dd6;--sn-stylekit-accessory-tint-color-2: #ea6595;--sn-stylekit-accessory-tint-color-3: #ebad00;--sn-stylekit-accessory-tint-color-4: #7049cf;--sn-stylekit-accessory-tint-color-5: #1aa772;--sn-stylekit-accessory-tint-color-6: #f28c52}",""]);const a=s},57610:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(39601),i=n.n(r),o=n(82609),s=n.n(o)()(i());s.push([e.id,':root{--lexical-ordered-list-left-margin: 16px}.monospace-font{--lexical-ordered-list-left-margin: 42px}.Lexical__ol1{padding:0;margin:0;margin-left:var(--lexical-ordered-list-left-margin);list-style-position:outside}.Lexical__ol1.Lexical__rtl{margin-left:0;margin-right:var(--lexical-ordered-list-left-margin)}.Lexical__ol2{padding:0;margin:0;margin-left:var(--lexical-ordered-list-left-margin);list-style-position:outside}.Lexical__ol2.Lexical__rtl{margin-left:0;margin-right:var(--lexical-ordered-list-left-margin)}.Lexical__ol3{padding:0;margin:0;margin-left:var(--lexical-ordered-list-left-margin);list-style-position:outside}.Lexical__ol3.Lexical__rtl{margin-left:0;margin-right:var(--lexical-ordered-list-left-margin)}.Lexical__ol4{padding:0;margin:0;margin-left:var(--lexical-ordered-list-left-margin);list-style-position:outside}.Lexical__ol4.Lexical__rtl{margin-left:0;margin-right:var(--lexical-ordered-list-left-margin)}.Lexical__ol5{padding:0;margin:0;margin-left:var(--lexical-ordered-list-left-margin);list-style-position:outside}.Lexical__ol5.Lexical__rtl{margin-left:0;margin-right:var(--lexical-ordered-list-left-margin)}.Lexical__ol2{list-style-type:upper-alpha}.Lexical__ol3{list-style-type:lower-alpha}.Lexical__ol4{list-style-type:upper-roman}.Lexical__ol5{list-style-type:lower-roman}.Lexical__ul{padding:0;margin:0;margin-left:16px;list-style-position:outside}.Lexical__ul.Lexical__rtl{margin-left:0;margin-right:16px}.Lexical__checkList{margin-left:0}.Lexical__nestedListItem .Lexical__checkList{margin-left:16px}.Lexical__listItem{margin:0 0px}.Lexical__listItemChecked,.Lexical__listItemUnchecked{position:relative;padding-left:calc(var(--font-size) + .5rem);padding-right:calc(var(--font-size) + .5rem);list-style-type:none;outline:none;vertical-align:middle}.Lexical__listItemChecked:focus,.Lexical__listItemChecked:focus-within,.Lexical__listItemUnchecked:focus,.Lexical__listItemUnchecked:focus-within{outline:none;box-shadow:none}.Lexical__listItemChecked{text-decoration:line-through;opacity:.4}.Lexical__listItemUnchecked:before,.Lexical__listItemChecked:before{content:"";--size: 16px;width:var(--size);height:var(--size);left:0;top:calc(var(--line-height, 1)*var(--font-size)/2);transform:translateY(-50%);cursor:pointer;background-size:cover;position:absolute}.Lexical__listItemUnchecked[dir=rtl]:before,.Lexical__listItemChecked[dir=rtl]:before{left:auto;right:0}.Lexical__listItemUnchecked:before{border:1px solid #999;border-radius:2px}.Lexical__listItemChecked:before{border:1px solid var(--sn-stylekit-info-color);border-radius:2px;background-color:var(--sn-stylekit-info-color);background-repeat:no-repeat}.Lexical__listItemChecked:after{content:"";cursor:pointer;border-color:var(--sn-stylekit-info-contrast-color);border-style:solid;position:absolute;display:block;width:5px;height:11px;--top: calc(var(--line-height, 1) * var(--font-size) / 2);top:calc(var(--top) - 1px);left:5px;transform:translateY(-50%) rotate(45deg);border-width:0 2px 2px 0}.Lexical__nestedListItem{list-style-type:none}.Lexical__nestedListItem.Lexical__listItemUnchecked{padding-left:0}.Lexical__nestedListItem:before,.Lexical__nestedListItem:after{display:none}.Lexical__ltr{text-align:left}.Lexical__rtl{text-align:right}.Lexical__code{white-space:pre}.Lexical__paragraph{margin:0;position:relative}.Lexical__quote{margin:0;margin-left:20px;margin-bottom:10px;color:var(--sn-stylekit-passive-color-1);border-left-color:var(--sn-stylekit-passive-color-1);border-left-width:4px;border-left-style:solid;padding-left:16px}.Lexical__quote.Lexical__rtl{margin-left:0;margin-right:20px;border-left-color:rgba(0,0,0,0);border-right-color:var(--sn-stylekit-passive-color-1);border-right-width:4px;border-right-style:solid;padding-right:16px}.Lexical__h1{font-size:26px;color:var(--sn-stylekit-editor-foreground-color);font-weight:700;margin:0}.Lexical__h2{font-size:22px;color:var(--sn-stylekit-editor-foreground-color);font-weight:700;margin:0}.Lexical__h3{font-size:19px;font-weight:700;margin:0}.Lexical__textBold{font-weight:bold}.Lexical__textItalic{font-style:italic}.Lexical__textUnderline{text-decoration:underline}.Lexical__textStrikethrough{text-decoration:line-through}.Lexical__textUnderlineStrikethrough{text-decoration:underline line-through}.Lexical__textSubscript{font-size:.8em;vertical-align:sub !important}.Lexical__textSuperscript{font-size:.8em;vertical-align:super}.Lexical__textCode{background-color:var(--sn-stylekit-secondary-background-color);color:var(--sn-stylekit-info-color);padding:5px;border-radius:5px;font-family:Menlo,Consolas,Monaco,monospace;font-size:85%}.Lexical__hashtag{background-color:rgba(88,144,255,.15);border-bottom:1px solid rgba(88,144,255,.3)}.Lexical__link{color:var(--sn-stylekit-info-color);text-decoration:none}.Lexical__link:hover{text-decoration:underline}.Lexical__code{background-color:var(--sn-stylekit-contrast-background-color);font-family:var(--sn-stylekit-monospace-font),monospace;display:block;padding:1.25rem 1.35rem;margin:.5rem 0;tab-size:2;overflow-x:auto;position:relative;border-radius:.25rem}.Collapsible__container .Lexical__code{background-color:var(--sn-stylekit-background-color);border:1px solid var(--sn-stylekit-contrast-border-color)}.Lexical__table{border-collapse:collapse;border-spacing:0;max-width:100%;overflow-y:scroll;table-layout:fixed;width:calc(100% - 25px);margin:.5rem 0;color:var(--sn-stylekit-contrast-foreground-color)}.Lexical__tableSelection *::selection{background-color:rgba(0,0,0,0) !important}.Lexical__tableSelected{outline:2px solid #3c84f4}.Lexical__tableCell{border:1px solid var(--sn-stylekit-border-color);min-width:75px;vertical-align:top;text-align:start;padding:6px 8px;position:relative;cursor:default;outline:none}.Lexical__tableCellSortedIndicator{display:block;opacity:.5;position:absolute;bottom:0;left:0;width:100%;height:4px;background-color:#999}.Lexical__tableCellResizer{position:absolute;right:-4px;height:100%;width:8px;cursor:ew-resize;z-index:10;top:0}.Lexical__tableCellHeader{background-color:var(--sn-stylekit-contrast-background-color);border-color:var(--sn-stylekit-contrast-border-color);text-align:start}.Lexical__tableCellSelected{background-color:#c9dbf0}.Lexical__tableCellPrimarySelected{border:2px solid #3c84f4;display:block;height:calc(100% - 2px);position:absolute;width:calc(100% - 2px);left:-1px;top:-1px;z-index:2}.Lexical__tableCellEditing{box-shadow:0 0 5px rgba(0,0,0,.4);border-radius:3px}.Lexical__tableCellResizeRuler{display:block;position:absolute;width:1px;background-color:#3c84f4;height:100%;top:0}.Lexical__tableCellActionButtonContainer{display:block;right:5px;top:6px;position:absolute;z-index:4;width:20px;height:20px}.Lexical__tableCellActionButton{background-color:#eee;display:block;border:0;border-radius:20px;width:20px;height:20px;color:#222;cursor:pointer}.Lexical__tableCellActionButton:hover{background-color:#ddd}.Lexical__characterLimit{display:inline;background-color:#fbb !important}.Lexical__tokenComment{color:#708090}.Lexical__tokenPunctuation{color:#999}.Lexical__tokenProperty{color:#905}.Lexical__tokenSelector{color:#690}.Lexical__tokenOperator{color:#9a6e3a}.Lexical__tokenAttr{color:#07a}.Lexical__tokenVariable{color:#e90}.Lexical__tokenFunction{color:#dd4a68}.Lexical__mark{background:rgba(255,212,0,.14);border-bottom:2px solid rgba(255,212,0,.3);padding-bottom:2px}.Lexical__markOverlap{background:rgba(255,212,0,.3);border-bottom:2px solid rgba(255,212,0,.7)}.Lexical__mark.selected{background:rgba(255,212,0,.5);border-bottom:2px solid #ffd400}.Lexical__markOverlap.selected{background:rgba(255,212,0,.7);border-bottom:2px solid rgba(255,212,0,.7)}.Lexical__embedBlock{user-select:none}.Lexical__embedBlockFocus{outline:2px solid var(--sn-stylekit-info-color)}.Lexical__blockCursor{display:block;pointer-events:none;position:absolute}.Lexical__blockCursor:after{content:"";display:block;position:absolute;top:-2px;width:20px;border-top:1px solid var(--sn-stylekit-editor-foreground-color);animation:CursorBlink 1.1s steps(2, start) infinite}@keyframes CursorBlink{to{visibility:hidden}}',""]);const a=s},32204:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(39601),i=n.n(r),o=n(82609),s=n.n(o)()(i());s.push([e.id,".Lexical__listItemUnchecked,.Lexical__listItemChecked{min-height:18px;margin-bottom:4px}.Lexical__table{margin:10px 0}",""]);const a=s},82609:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(r)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(s[l]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);r&&s[u[0]]||(void 0!==o&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=o),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),i&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=i):u[4]="".concat(i)),t.push(u))}},t}},39601:e=>{"use strict";e.exports=function(e){return e[1]}},28879:function(e){e.exports=function(){"use strict";var e=6e4,t=36e5,n="millisecond",r="second",i="minute",o="hour",s="day",a="week",l="month",c="quarter",u="year",d="date",h="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},m=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},y={s:m,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),o=n-i<0,s=t.clone().add(r+(o?-1:1),l);return+(-(r+(n-i)/(o?i-s:s-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:u,w:a,d:s,D:d,h:o,m:i,s:r,ms:n,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},v="en",A={};A[v]=g;var b=function(e){return e instanceof E},w=function e(t,n,r){var i;if(!t)return v;if("string"==typeof t){var o=t.toLowerCase();A[o]&&(i=o),n&&(A[o]=n,i=o);var s=t.split("-");if(!i&&s.length>1)return e(s[0])}else{var a=t.name;A[a]=t,i=a}return!r&&i&&(v=i),i||!r&&v},S=function(e,t){if(b(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new E(n)},C=y;C.l=w,C.i=b,C.w=function(e,t){return S(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=w(e.locale,null,!0),this.parse(e)}var m=g.prototype;return m.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(C.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(p);if(r){var i=r[2]-1||0,o=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},m.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},m.$utils=function(){return C},m.isValid=function(){return!(this.$d.toString()===h)},m.isSame=function(e,t){var n=S(e);return this.startOf(t)<=n&&n<=this.endOf(t)},m.isAfter=function(e,t){return S(e)<this.startOf(t)},m.isBefore=function(e,t){return this.endOf(t)<S(e)},m.$g=function(e,t,n){return C.u(e)?this[t]:this.set(n,e)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(e,t){var n=this,c=!!C.u(t)||t,h=C.p(e),p=function(e,t){var r=C.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return c?r:r.endOf(s)},f=function(e,t){return C.w(n.toDate()[e].apply(n.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},g=this.$W,m=this.$M,y=this.$D,v="set"+(this.$u?"UTC":"");switch(h){case u:return c?p(1,0):p(31,11);case l:return c?p(1,m):p(0,m+1);case a:var A=this.$locale().weekStart||0,b=(g<A?g+7:g)-A;return p(c?y-b:y+(6-b),m);case s:case d:return f(v+"Hours",0);case o:return f(v+"Minutes",1);case i:return f(v+"Seconds",2);case r:return f(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(e){return this.startOf(e,!1)},m.$set=function(e,t){var a,c=C.p(e),h="set"+(this.$u?"UTC":""),p=(a={},a[s]=h+"Date",a[d]=h+"Date",a[l]=h+"Month",a[u]=h+"FullYear",a[o]=h+"Hours",a[i]=h+"Minutes",a[r]=h+"Seconds",a[n]=h+"Milliseconds",a)[c],f=c===s?this.$D+(t-this.$W):t;if(c===l||c===u){var g=this.clone().set(d,1);g.$d[p](f),g.init(),this.$d=g.set(d,Math.min(this.$D,g.daysInMonth())).$d}else p&&this.$d[p](f);return this.init(),this},m.set=function(e,t){return this.clone().$set(e,t)},m.get=function(e){return this[C.p(e)]()},m.add=function(n,c){var d,h=this;n=Number(n);var p=C.p(c),f=function(e){var t=S(h);return C.w(t.date(t.date()+Math.round(e*n)),h)};if(p===l)return this.set(l,this.$M+n);if(p===u)return this.set(u,this.$y+n);if(p===s)return f(1);if(p===a)return f(7);var g=(d={},d[i]=e,d[o]=t,d[r]=1e3,d)[p]||1,m=this.$d.getTime()+n*g;return C.w(m,this)},m.subtract=function(e,t){return this.add(-1*e,t)},m.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||h;var r=e||"YYYY-MM-DDTHH:mm:ssZ",i=C.z(this),o=this.$H,s=this.$m,a=this.$M,l=n.weekdays,c=n.months,u=n.meridiem,d=function(e,n,i,o){return e&&(e[n]||e(t,r))||i[n].slice(0,o)},p=function(e){return C.s(o%12||12,e,"0")},g=u||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(f,(function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return C.s(t.$y,4,"0");case"M":return a+1;case"MM":return C.s(a+1,2,"0");case"MMM":return d(n.monthsShort,a,c,3);case"MMMM":return d(c,a);case"D":return t.$D;case"DD":return C.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(n.weekdaysMin,t.$W,l,2);case"ddd":return d(n.weekdaysShort,t.$W,l,3);case"dddd":return l[t.$W];case"H":return String(o);case"HH":return C.s(o,2,"0");case"h":return p(1);case"hh":return p(2);case"a":return g(o,s,!0);case"A":return g(o,s,!1);case"m":return String(s);case"mm":return C.s(s,2,"0");case"s":return String(t.$s);case"ss":return C.s(t.$s,2,"0");case"SSS":return C.s(t.$ms,3,"0");case"Z":return i}return null}(e)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(n,d,h){var p,f=this,g=C.p(d),m=S(n),y=(m.utcOffset()-this.utcOffset())*e,v=this-m,A=function(){return C.m(f,m)};switch(g){case u:p=A()/12;break;case l:p=A();break;case c:p=A()/3;break;case a:p=(v-y)/6048e5;break;case s:p=(v-y)/864e5;break;case o:p=v/t;break;case i:p=v/e;break;case r:p=v/1e3;break;default:p=v}return h?p:C.a(p)},m.daysInMonth=function(){return this.endOf(l).$D},m.$locale=function(){return A[this.$L]},m.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=w(e,t,!0);return r&&(n.$L=r),n},m.clone=function(){return C.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},g}(),I=E.prototype;return S.prototype=I,[["$ms",n],["$s",r],["$m",i],["$H",o],["$W",s],["$M",l],["$y",u],["$D",d]].forEach((function(e){I[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),S.extend=function(e,t){return e.$i||(e(t,E,S),e.$i=!0),S},S.locale=w,S.isDayjs=b,S.unix=function(e){return S(1e3*e)},S.en=A[v],S.Ls=A,S.p={},S}()},57449:function(e){e.exports=function(){"use strict";return function(e,t){var n=t.prototype,r=n.format;n.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return r.bind(this)(e);var i=this.$utils(),o=(e||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(e){switch(e){case"Q":return Math.ceil((t.$M+1)/3);case"Do":return n.ordinal(t.$D);case"gggg":return t.weekYear();case"GGGG":return t.isoWeekYear();case"wo":return n.ordinal(t.week(),"W");case"w":case"ww":return i.s(t.week(),"w"===e?1:2,"0");case"W":case"WW":return i.s(t.isoWeek(),"W"===e?1:2,"0");case"k":case"kk":return i.s(String(0===t.$H?24:t.$H),"k"===e?1:2,"0");case"X":return Math.floor(t.$d.getTime()/1e3);case"x":return t.$d.getTime();case"z":return"["+t.offsetName()+"]";case"zzz":return"["+t.offsetName("long")+"]";default:return e}}));return r.bind(this)(o)}}}()},89945:function(e){e.exports=function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d\d/,r=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},a=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:"+"===t[0]?-n:n}(e)}],c=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},u=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?"pm":"PM");return n},d={A:[i,function(e){this.afternoon=u(e,!1)}],a:[i,function(e){this.afternoon=u(e,!0)}],S:[/\d/,function(e){this.milliseconds=100*+e}],SS:[n,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[r,a("seconds")],ss:[r,a("seconds")],m:[r,a("minutes")],mm:[r,a("minutes")],H:[r,a("hours")],h:[r,a("hours")],HH:[r,a("hours")],hh:[r,a("hours")],D:[r,a("day")],DD:[n,a("day")],Do:[i,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,"")===e&&(this.day=r)}],M:[r,a("month")],MM:[n,a("month")],MMM:[i,function(e){var t=c("months"),n=(c("monthsShort")||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[i,function(e){var t=c("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,a("year")],YY:[n,function(e){this.year=s(e)}],YYYY:[/\d{4}/,a("year")],Z:l,ZZ:l};function h(n){var r,i;r=n,i=o&&o.formats;for(var s=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var o=r&&r.toUpperCase();return n||i[r]||e[r]||i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),a=s.length,l=0;l<a;l+=1){var c=s[l],u=d[c],h=u&&u[0],p=u&&u[1];s[l]=p?{regex:h,parser:p}:c.replace(/^\[|\]$/g,"")}return function(e){for(var t={},n=0,r=0;n<a;n+=1){var i=s[n];if("string"==typeof i)r+=i.length;else{var o=i.regex,l=i.parser,c=e.slice(r),u=o.exec(c)[0];l.call(t,u),e=e.replace(u,"")}}return function(e){var t=e.afternoon;if(void 0!==t){var n=e.hours;t?n<12&&(e.hours+=12):12===n&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,s=e.args;this.$u=r;var a=s[1];if("string"==typeof a){var l=!0===s[2],c=!0===s[3],u=l||c,d=s[2];c&&(d=s[2]),o=this.$locale(),!l&&d&&(o=n.Ls[d]),this.$d=function(e,t,n){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var r=h(t)(e),i=r.year,o=r.month,s=r.day,a=r.hours,l=r.minutes,c=r.seconds,u=r.milliseconds,d=r.zone,p=new Date,f=s||(i||o?1:p.getDate()),g=i||p.getFullYear(),m=0;i&&!o||(m=o>0?o-1:p.getMonth());var y=a||0,v=l||0,A=c||0,b=u||0;return d?new Date(Date.UTC(g,m,f,y,v,A,b+60*d.offset*1e3)):n?new Date(Date.UTC(g,m,f,y,v,A,b)):new Date(g,m,f,y,v,A,b)}catch(e){return new Date("")}}(t,a,r),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(a)&&(this.$d=new Date("")),o={}}else if(a instanceof Array)for(var p=a.length,f=1;f<=p;f+=1){s[1]=a[f-1];var g=n.apply(this,s);if(g.isValid()){this.$d=g.$d,this.$L=g.$L,this.init();break}f===p&&(this.$d=new Date(""))}else i.call(this,e)}}}()},66653:function(e){e.exports=function(){"use strict";var e="day";return function(t,n,r){var i=function(t){return t.add(4-t.isoWeekday(),e)},o=n.prototype;o.isoWeekYear=function(){return i(this).year()},o.isoWeek=function(t){if(!this.$utils().u(t))return this.add(7*(t-this.isoWeek()),e);var n,o,s,a=i(this),l=(n=this.isoWeekYear(),s=4-(o=(this.$u?r.utc:r)().year(n).startOf("year")).isoWeekday(),o.isoWeekday()>4&&(s+=7),o.add(s,e));return a.diff(l,"week")+1},o.isoWeekday=function(e){return this.$utils().u(e)?this.day()||7:this.day(this.day()%7?e:e-7)};var s=o.startOf;o.startOf=function(e,t){var n=this.$utils(),r=!!n.u(t)||t;return"isoweek"===n.p(e)?r?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):s.bind(this)(e,t)}}}()},77491:function(e){e.exports=function(){"use strict";return function(e,t,n){e=e||{};var r=t.prototype,i={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function o(e,t,n,i){return r.fromToBase(e,t,n,i)}n.en.relativeTime=i,r.fromToBase=function(t,r,o,s,a){for(var l,c,u,d=o.$locale().relativeTime||i,h=e.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],p=h.length,f=0;f<p;f+=1){var g=h[f];g.d&&(l=s?n(t).diff(o,g.d,!0):o.diff(t,g.d,!0));var m=(e.rounding||Math.round)(Math.abs(l));if(u=l>0,m<=g.r||!g.r){m<=1&&f>0&&(g=h[f-1]);var y=d[g.l];a&&(m=a(""+m)),c="string"==typeof y?y.replace("%d",m):y(m,r,g.l,u);break}}if(r)return c;var v=u?d.future:d.past;return"function"==typeof v?v(c):v.replace("%s",c)},r.to=function(e,t){return o(e,t,this,!0)},r.from=function(e,t){return o(e,t,this)};var s=function(e){return e.$u?n.utc():n()};r.toNow=function(e){return this.to(s(this),e)},r.fromNow=function(e){return this.from(s(this),e)}}}()},67338:function(e){e.exports=function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(n,r,i){var o,s=function(e,n,r){void 0===r&&(r={});var i=new Date(e),o=function(e,n){void 0===n&&(n={});var r=n.timeZoneName||"short",i=e+"|"+r,o=t[i];return o||(o=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:r}),t[i]=o),o}(n,r);return o.formatToParts(i)},a=function(t,n){for(var r=s(t,n),o=[],a=0;a<r.length;a+=1){var l=r[a],c=l.type,u=l.value,d=e[c];d>=0&&(o[d]=parseInt(u,10))}var h=o[3],p=24===h?0:h,f=o[0]+"-"+o[1]+"-"+o[2]+" "+p+":"+o[4]+":"+o[5]+":000",g=+t;return(i.utc(f).valueOf()-(g-=g%1e3))/6e4},l=r.prototype;l.tz=function(e,t){void 0===e&&(e=o);var n=this.utcOffset(),r=this.toDate(),s=r.toLocaleString("en-US",{timeZone:e}),a=Math.round((r-new Date(s))/1e3/60),l=i(s).$set("millisecond",this.$ms).utcOffset(15*-Math.round(r.getTimezoneOffset()/15)-a,!0);if(t){var c=l.utcOffset();l=l.add(n-c,"minute")}return l.$x.$timezone=e,l},l.offsetName=function(e){var t=this.$x.$timezone||i.tz.guess(),n=s(this.valueOf(),t,{timeZoneName:e}).find((function(e){return"timezonename"===e.type.toLowerCase()}));return n&&n.value};var c=l.startOf;l.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return c.call(this,e,t);var n=i(this.format("YYYY-MM-DD HH:mm:ss:SSS"));return c.call(n,e,t).tz(this.$x.$timezone,!0)},i.tz=function(e,t,n){var r=n&&t,s=n||t||o,l=a(+i(),s);if("string"!=typeof e)return i(e).tz(s);var c=function(e,t,n){var r=e-60*t*1e3,i=a(r,n);if(t===i)return[r,t];var o=a(r-=60*(i-t)*1e3,n);return i===o?[r,i]:[e-60*Math.min(i,o)*1e3,Math.max(i,o)]}(i.utc(e,r).valueOf(),l,s),u=c[0],d=c[1],h=i(u).utcOffset(d);return h.$x.$timezone=s,h},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(e){o=e}}}()},53193:function(e){e.exports=function(){"use strict";return function(e,t,n){n.updateLocale=function(e,t){var r=n.Ls[e];if(r)return(t?Object.keys(t):[]).forEach((function(e){r[e]=t[e]})),r}}}()},10264:function(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,i,o){var s=i.prototype;o.utc=function(e){return new i({date:e,utc:!0,args:arguments})},s.utc=function(t){var n=o(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},s.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var a=s.parse;s.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),a.call(this,e)};var l=s.init;s.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var c=s.utcOffset;s.utcOffset=function(r,i){var o=this.$utils().u;if(o(r))return this.$u?0:o(this.$offset)?c.call(this):this.$offset;if("string"==typeof r&&(r=function(e){void 0===e&&(e="");var r=e.match(t);if(!r)return null;var i=(""+r[0]).match(n)||["-",0,0],o=i[0],s=60*+i[1]+ +i[2];return 0===s?0:"+"===o?s:-s}(r),null===r))return this;var s=Math.abs(r)<=16?60*r:r,a=this;if(i)return a.$offset=s,a.$u=0===r,a;if(0!==r){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(a=this.local().add(s+l,e)).$offset=s,a.$x.$localOffset=l}else a=this.utc();return a};var u=s.format;s.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return u.call(this,t)},s.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},s.isUTC=function(){return!!this.$u},s.toISOString=function(){return this.toDate().toISOString()},s.toString=function(){return this.toDate().toUTCString()};var d=s.toDate;s.toDate=function(e){return"s"===e&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var h=s.diff;s.diff=function(e,t,n){if(e&&this.$u===e.$u)return h.call(this,e,t,n);var r=this.local(),i=o(e).local();return h.call(r,i,t,n)}}}()},90742:function(e){e.exports=function(){"use strict";var e="week",t="year";return function(n,r,i){var o=r.prototype;o.week=function(n){if(void 0===n&&(n=null),null!==n)return this.add(7*(n-this.week()),"day");var r=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var o=i(this).startOf(t).add(1,t).date(r),s=i(this).endOf(e);if(o.isBefore(s))return 1}var a=i(this).startOf(t).date(r).startOf(e).subtract(1,"millisecond"),l=this.diff(a,e,!0);return l<0?i(this).startOf("week").week():Math.ceil(l)},o.weeks=function(e){return void 0===e&&(e=null),this.week(e)}}}()},42090:function(e){e.exports=function(){"use strict";return function(e,t){t.prototype.weekYear=function(){var e=this.month(),t=this.week(),n=this.year();return 1===t&&11===e?n+1:0===e&&t>=52?n-1:n}}}()},35368:function(e){e.exports=function(){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}function n(e,r,i){return n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,n,r){var i=[null];i.push.apply(i,n);var o=new(Function.bind.apply(e,i));return r&&t(o,r.prototype),o},n.apply(null,arguments)}function r(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var o=Object.hasOwnProperty,s=Object.setPrototypeOf,a=Object.isFrozen,l=Object.getPrototypeOf,c=Object.getOwnPropertyDescriptor,u=Object.freeze,d=Object.seal,h=Object.create,p="undefined"!=typeof Reflect&&Reflect,f=p.apply,g=p.construct;f||(f=function(e,t,n){return e.apply(t,n)}),u||(u=function(e){return e}),d||(d=function(e){return e}),g||(g=function(e,t){return n(e,r(t))});var m,y=P(Array.prototype.forEach),v=P(Array.prototype.pop),A=P(Array.prototype.push),b=P(String.prototype.toLowerCase),w=P(String.prototype.toString),S=P(String.prototype.match),C=P(String.prototype.replace),E=P(String.prototype.indexOf),I=P(String.prototype.trim),_=P(RegExp.prototype.test),x=(m=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g(m,t)});function P(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return f(e,t,r)}}function k(e,t,n){var r;n=null!==(r=n)&&void 0!==r?r:b,s&&s(e,null);for(var i=t.length;i--;){var o=t[i];if("string"==typeof o){var l=n(o);l!==o&&(a(t)||(t[i]=l),o=l)}e[o]=!0}return e}function B(e){var t,n=h(null);for(t in e)!0===f(o,e,[t])&&(n[t]=e[t]);return n}function O(e,t){for(;null!==e;){var n=c(e,t);if(n){if(n.get)return P(n.get);if("function"==typeof n.value)return P(n.value)}e=l(e)}return function(e){return console.warn("fallback value for",e),null}}var N=u(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),D=u(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),j=u(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),T=u(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),M=u(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),F=u(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),R=u(["#text"]),L=u(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),Q=u(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),U=u(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),V=u(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),K=d(/\{\{[\w\W]*|[\w\W]*\}\}/gm),H=d(/<%[\w\W]*|[\w\W]*%>/gm),G=d(/\${[\w\W]*}/gm),Y=d(/^data-[\-\w.\u00B7-\uFFFF]/),z=d(/^aria-[\-\w]+$/),Z=d(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),W=d(/^(?:\w+script|data):/i),q=d(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),J=d(/^html$/i),X=function(){return"undefined"==typeof window?null:window};return function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:X(),i=function(e){return t(e)};if(i.version="2.4.7",i.removed=[],!n||!n.document||9!==n.document.nodeType)return i.isSupported=!1,i;var o=n.document,s=n.document,a=n.DocumentFragment,l=n.HTMLTemplateElement,c=n.Node,d=n.Element,h=n.NodeFilter,p=n.NamedNodeMap,f=void 0===p?n.NamedNodeMap||n.MozNamedAttrMap:p,g=n.HTMLFormElement,m=n.DOMParser,P=n.trustedTypes,$=d.prototype,ee=O($,"cloneNode"),te=O($,"nextSibling"),ne=O($,"childNodes"),re=O($,"parentNode");if("function"==typeof l){var ie=s.createElement("template");ie.content&&ie.content.ownerDocument&&(s=ie.content.ownerDocument)}var oe=function(t,n){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var r=null,i="data-tt-policy-suffix";n.currentScript&&n.currentScript.hasAttribute(i)&&(r=n.currentScript.getAttribute(i));var o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(P,o),se=oe?oe.createHTML(""):"",ae=s,le=ae.implementation,ce=ae.createNodeIterator,ue=ae.createDocumentFragment,de=ae.getElementsByTagName,he=o.importNode,pe={};try{pe=B(s).documentMode?s.documentMode:{}}catch(e){}var fe={};i.isSupported="function"==typeof re&&le&&void 0!==le.createHTMLDocument&&9!==pe;var ge,me,ye=K,ve=H,Ae=G,be=Y,we=z,Se=W,Ce=q,Ee=Z,Ie=null,_e=k({},[].concat(r(N),r(D),r(j),r(M),r(R))),xe=null,Pe=k({},[].concat(r(L),r(Q),r(U),r(V))),ke=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Be=null,Oe=null,Ne=!0,De=!0,je=!1,Te=!0,Me=!1,Fe=!1,Re=!1,Le=!1,Qe=!1,Ue=!1,Ve=!1,Ke=!0,He=!1,Ge=!0,Ye=!1,ze={},Ze=null,We=k({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),qe=null,Je=k({},["audio","video","img","source","image","track"]),Xe=null,$e=k({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml",rt=nt,it=!1,ot=null,st=k({},[et,tt,nt],w),at=["application/xhtml+xml","text/html"],lt=null,ct=s.createElement("form"),ut=function(e){return e instanceof RegExp||e instanceof Function},dt=function(t){lt&&lt===t||(t&&"object"===e(t)||(t={}),t=B(t),ge=ge=-1===at.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,me="application/xhtml+xml"===ge?w:b,Ie="ALLOWED_TAGS"in t?k({},t.ALLOWED_TAGS,me):_e,xe="ALLOWED_ATTR"in t?k({},t.ALLOWED_ATTR,me):Pe,ot="ALLOWED_NAMESPACES"in t?k({},t.ALLOWED_NAMESPACES,w):st,Xe="ADD_URI_SAFE_ATTR"in t?k(B($e),t.ADD_URI_SAFE_ATTR,me):$e,qe="ADD_DATA_URI_TAGS"in t?k(B(Je),t.ADD_DATA_URI_TAGS,me):Je,Ze="FORBID_CONTENTS"in t?k({},t.FORBID_CONTENTS,me):We,Be="FORBID_TAGS"in t?k({},t.FORBID_TAGS,me):{},Oe="FORBID_ATTR"in t?k({},t.FORBID_ATTR,me):{},ze="USE_PROFILES"in t&&t.USE_PROFILES,Ne=!1!==t.ALLOW_ARIA_ATTR,De=!1!==t.ALLOW_DATA_ATTR,je=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Te=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,Me=t.SAFE_FOR_TEMPLATES||!1,Fe=t.WHOLE_DOCUMENT||!1,Qe=t.RETURN_DOM||!1,Ue=t.RETURN_DOM_FRAGMENT||!1,Ve=t.RETURN_TRUSTED_TYPE||!1,Le=t.FORCE_BODY||!1,Ke=!1!==t.SANITIZE_DOM,He=t.SANITIZE_NAMED_PROPS||!1,Ge=!1!==t.KEEP_CONTENT,Ye=t.IN_PLACE||!1,Ee=t.ALLOWED_URI_REGEXP||Ee,rt=t.NAMESPACE||nt,ke=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&ut(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ke.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&ut(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ke.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(ke.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Me&&(De=!1),Ue&&(Qe=!0),ze&&(Ie=k({},r(R)),xe=[],!0===ze.html&&(k(Ie,N),k(xe,L)),!0===ze.svg&&(k(Ie,D),k(xe,Q),k(xe,V)),!0===ze.svgFilters&&(k(Ie,j),k(xe,Q),k(xe,V)),!0===ze.mathMl&&(k(Ie,M),k(xe,U),k(xe,V))),t.ADD_TAGS&&(Ie===_e&&(Ie=B(Ie)),k(Ie,t.ADD_TAGS,me)),t.ADD_ATTR&&(xe===Pe&&(xe=B(xe)),k(xe,t.ADD_ATTR,me)),t.ADD_URI_SAFE_ATTR&&k(Xe,t.ADD_URI_SAFE_ATTR,me),t.FORBID_CONTENTS&&(Ze===We&&(Ze=B(Ze)),k(Ze,t.FORBID_CONTENTS,me)),Ge&&(Ie["#text"]=!0),Fe&&k(Ie,["html","head","body"]),Ie.table&&(k(Ie,["tbody"]),delete Be.tbody),u&&u(t),lt=t)},ht=k({},["mi","mo","mn","ms","mtext"]),pt=k({},["foreignobject","desc","title","annotation-xml"]),ft=k({},["title","style","font","a","script"]),gt=k({},D);k(gt,j),k(gt,T);var mt=k({},M);k(mt,F);var yt=function(e){A(i.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=se}catch(t){e.remove()}}},vt=function(e,t){try{A(i.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){A(i.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!xe[e])if(Qe||Ue)try{yt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},At=function(e){var t,n;if(Le)e="<remove></remove>"+e;else{var r=S(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===ge&&rt===nt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var i=oe?oe.createHTML(e):e;if(rt===nt)try{t=(new m).parseFromString(i,ge)}catch(e){}if(!t||!t.documentElement){t=le.createDocument(rt,"template",null);try{t.documentElement.innerHTML=it?se:i}catch(e){}}var o=t.body||t.documentElement;return e&&n&&o.insertBefore(s.createTextNode(n),o.childNodes[0]||null),rt===nt?de.call(t,Fe?"html":"body")[0]:Fe?t.documentElement:o},bt=function(e){return ce.call(e.ownerDocument||e,e,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT,null,!1)},wt=function(t){return"object"===e(c)?t instanceof c:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},St=function(e,t,n){fe[e]&&y(fe[e],(function(e){e.call(i,t,n,lt)}))},Ct=function(e){var t,n;if(St("beforeSanitizeElements",e,null),(n=e)instanceof g&&("string"!=typeof n.nodeName||"string"!=typeof n.textContent||"function"!=typeof n.removeChild||!(n.attributes instanceof f)||"function"!=typeof n.removeAttribute||"function"!=typeof n.setAttribute||"string"!=typeof n.namespaceURI||"function"!=typeof n.insertBefore||"function"!=typeof n.hasChildNodes))return yt(e),!0;if(_(/[\u0080-\uFFFF]/,e.nodeName))return yt(e),!0;var r=me(e.nodeName);if(St("uponSanitizeElement",e,{tagName:r,allowedTags:Ie}),e.hasChildNodes()&&!wt(e.firstElementChild)&&(!wt(e.content)||!wt(e.content.firstElementChild))&&_(/<[/\w]/g,e.innerHTML)&&_(/<[/\w]/g,e.textContent))return yt(e),!0;if("select"===r&&_(/<template/i,e.innerHTML))return yt(e),!0;if(!Ie[r]||Be[r]){if(!Be[r]&&It(r)){if(ke.tagNameCheck instanceof RegExp&&_(ke.tagNameCheck,r))return!1;if(ke.tagNameCheck instanceof Function&&ke.tagNameCheck(r))return!1}if(Ge&&!Ze[r]){var o=re(e)||e.parentNode,s=ne(e)||e.childNodes;if(s&&o)for(var a=s.length-1;a>=0;--a)o.insertBefore(ee(s[a],!0),te(e))}return yt(e),!0}return e instanceof d&&!function(e){var t=re(e);t&&t.tagName||(t={namespaceURI:rt,tagName:"template"});var n=b(e.tagName),r=b(t.tagName);return!!ot[e.namespaceURI]&&(e.namespaceURI===tt?t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&("annotation-xml"===r||ht[r]):Boolean(gt[n]):e.namespaceURI===et?t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&&pt[r]:Boolean(mt[n]):e.namespaceURI===nt?!(t.namespaceURI===tt&&!pt[r])&&!(t.namespaceURI===et&&!ht[r])&&!mt[n]&&(ft[n]||!gt[n]):!("application/xhtml+xml"!==ge||!ot[e.namespaceURI]))}(e)?(yt(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!_(/<\/no(script|embed|frames)/i,e.innerHTML)?(Me&&3===e.nodeType&&(t=e.textContent,t=C(t,ye," "),t=C(t,ve," "),t=C(t,Ae," "),e.textContent!==t&&(A(i.removed,{element:e.cloneNode()}),e.textContent=t)),St("afterSanitizeElements",e,null),!1):(yt(e),!0)},Et=function(e,t,n){if(Ke&&("id"===t||"name"===t)&&(n in s||n in ct))return!1;if(De&&!Oe[t]&&_(be,t));else if(Ne&&_(we,t));else if(!xe[t]||Oe[t]){if(!(It(e)&&(ke.tagNameCheck instanceof RegExp&&_(ke.tagNameCheck,e)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(e))&&(ke.attributeNameCheck instanceof RegExp&&_(ke.attributeNameCheck,t)||ke.attributeNameCheck instanceof Function&&ke.attributeNameCheck(t))||"is"===t&&ke.allowCustomizedBuiltInElements&&(ke.tagNameCheck instanceof RegExp&&_(ke.tagNameCheck,n)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(n))))return!1}else if(Xe[t]);else if(_(Ee,C(n,Ce,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==E(n,"data:")||!qe[e])if(je&&!_(Se,C(n,Ce,"")));else if(n)return!1;return!0},It=function(e){return e.indexOf("-")>0},_t=function(t){var n,r,o,s;St("beforeSanitizeAttributes",t,null);var a=t.attributes;if(a){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe};for(s=a.length;s--;){var c=n=a[s],u=c.name,d=c.namespaceURI;if(r="value"===u?n.value:I(n.value),o=me(u),l.attrName=o,l.attrValue=r,l.keepAttr=!0,l.forceKeepAttr=void 0,St("uponSanitizeAttribute",t,l),r=l.attrValue,!l.forceKeepAttr&&(vt(u,t),l.keepAttr))if(Te||!_(/\/>/i,r)){Me&&(r=C(r,ye," "),r=C(r,ve," "),r=C(r,Ae," "));var h=me(t.nodeName);if(Et(h,o,r)){if(!He||"id"!==o&&"name"!==o||(vt(u,t),r="user-content-"+r),oe&&"object"===e(P)&&"function"==typeof P.getAttributeType)if(d);else switch(P.getAttributeType(h,o)){case"TrustedHTML":r=oe.createHTML(r);break;case"TrustedScriptURL":r=oe.createScriptURL(r)}try{d?t.setAttributeNS(d,u,r):t.setAttribute(u,r),v(i.removed)}catch(e){}}}else vt(u,t)}St("afterSanitizeAttributes",t,null)}},xt=function e(t){var n,r=bt(t);for(St("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)St("uponSanitizeShadowNode",n,null),Ct(n)||(n.content instanceof a&&e(n.content),_t(n));St("afterSanitizeShadowDOM",t,null)};return i.sanitize=function(t){var r,s,l,u,d,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((it=!t)&&(t="\x3c!--\x3e"),"string"!=typeof t&&!wt(t)){if("function"!=typeof t.toString)throw x("toString is not a function");if("string"!=typeof(t=t.toString()))throw x("dirty is not a string, aborting")}if(!i.isSupported){if("object"===e(n.toStaticHTML)||"function"==typeof n.toStaticHTML){if("string"==typeof t)return n.toStaticHTML(t);if(wt(t))return n.toStaticHTML(t.outerHTML)}return t}if(Re||dt(h),i.removed=[],"string"==typeof t&&(Ye=!1),Ye){if(t.nodeName){var p=me(t.nodeName);if(!Ie[p]||Be[p])throw x("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof c)1===(s=(r=At("\x3c!----\x3e")).ownerDocument.importNode(t,!0)).nodeType&&"BODY"===s.nodeName||"HTML"===s.nodeName?r=s:r.appendChild(s);else{if(!Qe&&!Me&&!Fe&&-1===t.indexOf("<"))return oe&&Ve?oe.createHTML(t):t;if(!(r=At(t)))return Qe?null:Ve?se:""}r&&Le&&yt(r.firstChild);for(var f=bt(Ye?t:r);l=f.nextNode();)3===l.nodeType&&l===u||Ct(l)||(l.content instanceof a&&xt(l.content),_t(l),u=l);if(u=null,Ye)return t;if(Qe){if(Ue)for(d=ue.call(r.ownerDocument);r.firstChild;)d.appendChild(r.firstChild);else d=r;return(xe.shadowroot||xe.shadowrootmod)&&(d=he.call(o,d,!0)),d}var g=Fe?r.outerHTML:r.innerHTML;return Fe&&Ie["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&_(J,r.ownerDocument.doctype.name)&&(g="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+g),Me&&(g=C(g,ye," "),g=C(g,ve," "),g=C(g,Ae," ")),oe&&Ve?oe.createHTML(g):g},i.setConfig=function(e){dt(e),Re=!0},i.clearConfig=function(){lt=null,Re=!1},i.isValidAttribute=function(e,t,n){lt||dt({});var r=me(e),i=me(t);return Et(r,i,n)},i.addHook=function(e,t){"function"==typeof t&&(fe[e]=fe[e]||[],A(fe[e],t))},i.removeHook=function(e){if(fe[e])return v(fe[e])},i.removeHooks=function(e){fe[e]&&(fe[e]=[])},i.removeAllHooks=function(){fe={}},i}()}()},29661:e=>{var t=-1,n=1,r=0;function i(e,g,m,y,v){if(e===g)return e?[[r,e]]:[];if(null!=m){var b=function(e,t,n){var r="number"==typeof n?{index:n,length:0}:n.oldRange,i="number"==typeof n?null:n.newRange,o=e.length,s=t.length;if(0===r.length&&(null===i||0===i.length)){var a=r.index,l=e.slice(0,a),c=e.slice(a),u=i?i.index:null,d=a+s-o;if((null===u||u===d)&&!(d<0||d>s)){var h=t.slice(0,d);if((g=t.slice(d))===c){var p=Math.min(a,d);if((y=l.slice(0,p))===(b=h.slice(0,p)))return A(y,l.slice(p),h.slice(p),c)}}if(null===u||u===a){var f=a,g=(h=t.slice(0,f),t.slice(f));if(h===l){var m=Math.min(o-f,s-f);if((v=c.slice(c.length-m))===(w=g.slice(g.length-m)))return A(l,c.slice(0,c.length-m),g.slice(0,g.length-m),v)}}}if(r.length>0&&i&&0===i.length){var y=e.slice(0,r.index),v=e.slice(r.index+r.length);if(!(s<(p=y.length)+(m=v.length))){var b=t.slice(0,p),w=t.slice(s-m);if(y===b&&v===w)return A(y,e.slice(p,o-m),t.slice(p,s-m),v)}}return null}(e,g,m);if(b)return b}var w=s(e,g),S=e.substring(0,w);w=l(e=e.substring(w),g=g.substring(w));var C=e.substring(e.length-w),E=function(e,a){var c;if(!e)return[[n,a]];if(!a)return[[t,e]];var u=e.length>a.length?e:a,d=e.length>a.length?a:e,h=u.indexOf(d);if(-1!==h)return c=[[n,u.substring(0,h)],[r,d],[n,u.substring(h+d.length)]],e.length>a.length&&(c[0][0]=c[2][0]=t),c;if(1===d.length)return[[t,e],[n,a]];var p=function(e,t){var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||2*r.length<n.length)return null;function i(e,t,n){for(var r,i,o,a,c=e.substring(n,n+Math.floor(e.length/4)),u=-1,d="";-1!==(u=t.indexOf(c,u+1));){var h=s(e.substring(n),t.substring(u)),p=l(e.substring(0,n),t.substring(0,u));d.length<p+h&&(d=t.substring(u-p,u)+t.substring(u,u+h),r=e.substring(0,n-p),i=e.substring(n+h),o=t.substring(0,u-p),a=t.substring(u+h))}return 2*d.length>=e.length?[r,i,o,a,d]:null}var o,a,c,u,d,h=i(n,r,Math.ceil(n.length/4)),p=i(n,r,Math.ceil(n.length/2));return h||p?(o=p?h&&h[4].length>p[4].length?h:p:h,e.length>t.length?(a=o[0],c=o[1],u=o[2],d=o[3]):(u=o[0],d=o[1],a=o[2],c=o[3]),[a,c,u,d,o[4]]):null}(e,a);if(p){var f=p[0],g=p[1],m=p[2],y=p[3],v=p[4],A=i(f,m),b=i(g,y);return A.concat([[r,v]],b)}return function(e,r){for(var i=e.length,s=r.length,a=Math.ceil((i+s)/2),l=a,c=2*a,u=new Array(c),d=new Array(c),h=0;h<c;h++)u[h]=-1,d[h]=-1;u[l+1]=0,d[l+1]=0;for(var p=i-s,f=p%2!=0,g=0,m=0,y=0,v=0,A=0;A<a;A++){for(var b=-A+g;b<=A-m;b+=2){for(var w=l+b,S=(x=b===-A||b!==A&&u[w-1]<u[w+1]?u[w+1]:u[w-1]+1)-b;x<i&&S<s&&e.charAt(x)===r.charAt(S);)x++,S++;if(u[w]=x,x>i)m+=2;else if(S>s)g+=2;else if(f&&(I=l+p-b)>=0&&I<c&&-1!==d[I]&&x>=(E=i-d[I]))return o(e,r,x,S)}for(var C=-A+y;C<=A-v;C+=2){for(var E,I=l+C,_=(E=C===-A||C!==A&&d[I-1]<d[I+1]?d[I+1]:d[I-1]+1)-C;E<i&&_<s&&e.charAt(i-E-1)===r.charAt(s-_-1);)E++,_++;if(d[I]=E,E>i)v+=2;else if(_>s)y+=2;else if(!f){var x;if((w=l+p-C)>=0&&w<c&&-1!==u[w])if(S=l+(x=u[w])-w,x>=(E=i-E))return o(e,r,x,S)}}}return[[t,e],[n,r]]}(e,a)}(e=e.substring(0,e.length-w),g=g.substring(0,g.length-w));return S&&E.unshift([r,S]),C&&E.push([r,C]),f(E,v),y&&function(e){for(var i=!1,o=[],s=0,g=null,m=0,y=0,v=0,A=0,b=0;m<e.length;)e[m][0]==r?(o[s++]=m,y=A,v=b,A=0,b=0,g=e[m][1]):(e[m][0]==n?A+=e[m][1].length:b+=e[m][1].length,g&&g.length<=Math.max(y,v)&&g.length<=Math.max(A,b)&&(e.splice(o[s-1],0,[t,g]),e[o[s-1]+1][0]=n,s--,m=--s>0?o[s-1]:-1,y=0,v=0,A=0,b=0,g=null,i=!0)),m++;for(i&&f(e),function(e){function t(e,t){if(!e||!t)return 6;var n=e.charAt(e.length-1),r=t.charAt(0),i=n.match(c),o=r.match(c),s=i&&n.match(u),a=o&&r.match(u),l=s&&n.match(d),f=a&&r.match(d),g=l&&e.match(h),m=f&&t.match(p);return g||m?5:l||f?4:i&&!s&&a?3:s||a?2:i||o?1:0}for(var n=1;n<e.length-1;){if(e[n-1][0]==r&&e[n+1][0]==r){var i=e[n-1][1],o=e[n][1],s=e[n+1][1],a=l(i,o);if(a){var f=o.substring(o.length-a);i=i.substring(0,i.length-a),o=f+o.substring(0,o.length-a),s=f+s}for(var g=i,m=o,y=s,v=t(i,o)+t(o,s);o.charAt(0)===s.charAt(0);){i+=o.charAt(0),o=o.substring(1)+s.charAt(0),s=s.substring(1);var A=t(i,o)+t(o,s);A>=v&&(v=A,g=i,m=o,y=s)}e[n-1][1]!=g&&(g?e[n-1][1]=g:(e.splice(n-1,1),n--),e[n][1]=m,y?e[n+1][1]=y:(e.splice(n+1,1),n--))}n++}}(e),m=1;m<e.length;){if(e[m-1][0]==t&&e[m][0]==n){var w=e[m-1][1],S=e[m][1],C=a(w,S),E=a(S,w);C>=E?(C>=w.length/2||C>=S.length/2)&&(e.splice(m,0,[r,S.substring(0,C)]),e[m-1][1]=w.substring(0,w.length-C),e[m+1][1]=S.substring(C),m++):(E>=w.length/2||E>=S.length/2)&&(e.splice(m,0,[r,w.substring(0,E)]),e[m-1][0]=n,e[m-1][1]=S.substring(0,S.length-E),e[m+1][0]=t,e[m+1][1]=w.substring(E),m++),m++}m++}}(E),E}function o(e,t,n,r){var o=e.substring(0,n),s=t.substring(0,r),a=e.substring(n),l=t.substring(r),c=i(o,s),u=i(a,l);return c.concat(u)}function s(e,t){if(!e||!t||e.charAt(0)!==t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,o=0;n<i;)e.substring(o,i)==t.substring(o,i)?o=n=i:r=i,i=Math.floor((r-n)/2+n);return g(e.charCodeAt(i-1))&&i--,i}function a(e,t){var n=e.length,r=t.length;if(0==n||0==r)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var i=Math.min(n,r);if(e==t)return i;for(var o=0,s=1;;){var a=e.substring(i-s),l=t.indexOf(a);if(-1==l)return o;s+=l,0!=l&&e.substring(i-s)!=t.substring(0,s)||(o=s,s++)}}function l(e,t){if(!e||!t||e.slice(-1)!==t.slice(-1))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,o=0;n<i;)e.substring(e.length-i,e.length-o)==t.substring(t.length-i,t.length-o)?o=n=i:r=i,i=Math.floor((r-n)/2+n);return m(e.charCodeAt(e.length-i))&&i--,i}var c=/[^a-zA-Z0-9]/,u=/\s/,d=/[\r\n]/,h=/\n\r?\n$/,p=/^\r?\n\r?\n/;function f(e,i){e.push([r,""]);for(var o,a=0,c=0,u=0,d="",h="";a<e.length;)if(a<e.length-1&&!e[a][1])e.splice(a,1);else switch(e[a][0]){case n:u++,h+=e[a][1],a++;break;case t:c++,d+=e[a][1],a++;break;case r:var p=a-u-c-1;if(i){if(p>=0&&v(e[p][1])){var g=e[p][1].slice(-1);if(e[p][1]=e[p][1].slice(0,-1),d=g+d,h=g+h,!e[p][1]){e.splice(p,1),a--;var m=p-1;e[m]&&e[m][0]===n&&(u++,h=e[m][1]+h,m--),e[m]&&e[m][0]===t&&(c++,d=e[m][1]+d,m--),p=m}}y(e[a][1])&&(g=e[a][1].charAt(0),e[a][1]=e[a][1].slice(1),d+=g,h+=g)}if(a<e.length-1&&!e[a][1]){e.splice(a,1);break}if(d.length>0||h.length>0){d.length>0&&h.length>0&&(0!==(o=s(h,d))&&(p>=0?e[p][1]+=h.substring(0,o):(e.splice(0,0,[r,h.substring(0,o)]),a++),h=h.substring(o),d=d.substring(o)),0!==(o=l(h,d))&&(e[a][1]=h.substring(h.length-o)+e[a][1],h=h.substring(0,h.length-o),d=d.substring(0,d.length-o)));var A=u+c;0===d.length&&0===h.length?(e.splice(a-A,A),a-=A):0===d.length?(e.splice(a-A,A,[n,h]),a=a-A+1):0===h.length?(e.splice(a-A,A,[t,d]),a=a-A+1):(e.splice(a-A,A,[t,d],[n,h]),a=a-A+2)}0!==a&&e[a-1][0]===r?(e[a-1][1]+=e[a][1],e.splice(a,1)):a++,u=0,c=0,d="",h=""}""===e[e.length-1][1]&&e.pop();var b=!1;for(a=1;a<e.length-1;)e[a-1][0]===r&&e[a+1][0]===r&&(e[a][1].substring(e[a][1].length-e[a-1][1].length)===e[a-1][1]?(e[a][1]=e[a-1][1]+e[a][1].substring(0,e[a][1].length-e[a-1][1].length),e[a+1][1]=e[a-1][1]+e[a+1][1],e.splice(a-1,1),b=!0):e[a][1].substring(0,e[a+1][1].length)==e[a+1][1]&&(e[a-1][1]+=e[a+1][1],e[a][1]=e[a][1].substring(e[a+1][1].length)+e[a+1][1],e.splice(a+1,1),b=!0)),a++;b&&f(e,i)}function g(e){return e>=55296&&e<=56319}function m(e){return e>=56320&&e<=57343}function y(e){return m(e.charCodeAt(0))}function v(e){return g(e.charCodeAt(e.length-1))}function A(e,i,o,s){return v(e)||y(s)?null:function(e){for(var t=[],n=0;n<e.length;n++)e[n][1].length>0&&t.push(e[n]);return t}([[r,e],[t,i],[n,o],[r,s]])}function b(e,t,n,r){return i(e,t,n,r,!0)}b.INSERT=n,b.DELETE=t,b.EQUAL=r,e.exports=b},62333:(e,t)=>{t.read=function(e,t,n,r,i){var o,s,a=8*i-r-1,l=(1<<a)-1,c=l>>1,u=-7,d=n?i-1:0,h=n?-1:1,p=e[t+d];for(d+=h,o=p&(1<<-u)-1,p>>=-u,u+=a;u>0;o=256*o+e[t+d],d+=h,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=r;u>0;s=256*s+e[t+d],d+=h,u-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),o-=c}return(p?-1:1)*s*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var s,a,l,c=8*o-i-1,u=(1<<c)-1,d=u>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,f=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+d>=1?h/l:h*Math.pow(2,1-d))*l>=2&&(s++,l/=2),s+d>=u?(a=0,s=u):s+d>=1?(a=(t*l-1)*Math.pow(2,i),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[n+p]=255&a,p+=f,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[n+p]=255&s,p+=f,s/=256,c-=8);e[n+p-f]|=128*g}},39925:function(e,t,n){var r,i,o,s,a;a="object"==typeof(s=this).sodium&&"function"==typeof s.sodium.onload?s.sodium.onload:null,i=[t,n(39631)],r=function(e,t){"use strict";var n,r=t.ready.then((function(){function r(){if(0!==n._sodium_init())throw new Error("libsodium was not correctly initialized.");for(var t=["crypto_aead_chacha20poly1305_decrypt","crypto_aead_chacha20poly1305_decrypt_detached","crypto_aead_chacha20poly1305_encrypt","crypto_aead_chacha20poly1305_encrypt_detached","crypto_aead_chacha20poly1305_ietf_decrypt","crypto_aead_chacha20poly1305_ietf_decrypt_detached","crypto_aead_chacha20poly1305_ietf_encrypt","crypto_aead_chacha20poly1305_ietf_encrypt_detached","crypto_aead_chacha20poly1305_ietf_keygen","crypto_aead_chacha20poly1305_keygen","crypto_aead_xchacha20poly1305_ietf_decrypt","crypto_aead_xchacha20poly1305_ietf_decrypt_detached","crypto_aead_xchacha20poly1305_ietf_encrypt","crypto_aead_xchacha20poly1305_ietf_encrypt_detached","crypto_aead_xchacha20poly1305_ietf_keygen","crypto_auth","crypto_auth_hmacsha256","crypto_auth_hmacsha256_final","crypto_auth_hmacsha256_init","crypto_auth_hmacsha256_keygen","crypto_auth_hmacsha256_update","crypto_auth_hmacsha256_verify","crypto_auth_hmacsha512","crypto_auth_hmacsha512_final","crypto_auth_hmacsha512_init","crypto_auth_hmacsha512_keygen","crypto_auth_hmacsha512_update","crypto_auth_hmacsha512_verify","crypto_auth_keygen","crypto_auth_verify","crypto_box_beforenm","crypto_box_curve25519xchacha20poly1305_keypair","crypto_box_curve25519xchacha20poly1305_seal","crypto_box_curve25519xchacha20poly1305_seal_open","crypto_box_detached","crypto_box_easy","crypto_box_easy_afternm","crypto_box_keypair","crypto_box_open_detached","crypto_box_open_easy","crypto_box_open_easy_afternm","crypto_box_seal","crypto_box_seal_open","crypto_box_seed_keypair","crypto_core_ed25519_add","crypto_core_ed25519_from_hash","crypto_core_ed25519_from_uniform","crypto_core_ed25519_is_valid_point","crypto_core_ed25519_random","crypto_core_ed25519_scalar_add","crypto_core_ed25519_scalar_complement","crypto_core_ed25519_scalar_invert","crypto_core_ed25519_scalar_mul","crypto_core_ed25519_scalar_negate","crypto_core_ed25519_scalar_random","crypto_core_ed25519_scalar_reduce","crypto_core_ed25519_scalar_sub","crypto_core_ed25519_sub","crypto_core_hchacha20","crypto_core_hsalsa20","crypto_core_ristretto255_add","crypto_core_ristretto255_from_hash","crypto_core_ristretto255_is_valid_point","crypto_core_ristretto255_random","crypto_core_ristretto255_scalar_add","crypto_core_ristretto255_scalar_complement","crypto_core_ristretto255_scalar_invert","crypto_core_ristretto255_scalar_mul","crypto_core_ristretto255_scalar_negate","crypto_core_ristretto255_scalar_random","crypto_core_ristretto255_scalar_reduce","crypto_core_ristretto255_scalar_sub","crypto_core_ristretto255_sub","crypto_generichash","crypto_generichash_blake2b_salt_personal","crypto_generichash_final","crypto_generichash_init","crypto_generichash_keygen","crypto_generichash_update","crypto_hash","crypto_hash_sha256","crypto_hash_sha256_final","crypto_hash_sha256_init","crypto_hash_sha256_update","crypto_hash_sha512","crypto_hash_sha512_final","crypto_hash_sha512_init","crypto_hash_sha512_update","crypto_kdf_derive_from_key","crypto_kdf_keygen","crypto_kx_client_session_keys","crypto_kx_keypair","crypto_kx_seed_keypair","crypto_kx_server_session_keys","crypto_onetimeauth","crypto_onetimeauth_final","crypto_onetimeauth_init","crypto_onetimeauth_keygen","crypto_onetimeauth_update","crypto_onetimeauth_verify","crypto_pwhash","crypto_pwhash_scryptsalsa208sha256","crypto_pwhash_scryptsalsa208sha256_ll","crypto_pwhash_scryptsalsa208sha256_str","crypto_pwhash_scryptsalsa208sha256_str_verify","crypto_pwhash_str","crypto_pwhash_str_needs_rehash","crypto_pwhash_str_verify","crypto_scalarmult","crypto_scalarmult_base","crypto_scalarmult_ed25519","crypto_scalarmult_ed25519_base","crypto_scalarmult_ed25519_base_noclamp","crypto_scalarmult_ed25519_noclamp","crypto_scalarmult_ristretto255","crypto_scalarmult_ristretto255_base","crypto_secretbox_detached","crypto_secretbox_easy","crypto_secretbox_keygen","crypto_secretbox_open_detached","crypto_secretbox_open_easy","crypto_secretstream_xchacha20poly1305_init_pull","crypto_secretstream_xchacha20poly1305_init_push","crypto_secretstream_xchacha20poly1305_keygen","crypto_secretstream_xchacha20poly1305_pull","crypto_secretstream_xchacha20poly1305_push","crypto_secretstream_xchacha20poly1305_rekey","crypto_shorthash","crypto_shorthash_keygen","crypto_shorthash_siphashx24","crypto_sign","crypto_sign_detached","crypto_sign_ed25519_pk_to_curve25519","crypto_sign_ed25519_sk_to_curve25519","crypto_sign_ed25519_sk_to_pk","crypto_sign_ed25519_sk_to_seed","crypto_sign_final_create","crypto_sign_final_verify","crypto_sign_init","crypto_sign_keypair","crypto_sign_open","crypto_sign_seed_keypair","crypto_sign_update","crypto_sign_verify_detached","crypto_stream_chacha20","crypto_stream_chacha20_ietf_xor","crypto_stream_chacha20_ietf_xor_ic","crypto_stream_chacha20_keygen","crypto_stream_chacha20_xor","crypto_stream_chacha20_xor_ic","crypto_stream_keygen","crypto_stream_xchacha20_keygen","crypto_stream_xchacha20_xor","crypto_stream_xchacha20_xor_ic","randombytes_buf","randombytes_buf_deterministic","randombytes_close","randombytes_random","randombytes_set_implementation","randombytes_stir","randombytes_uniform","sodium_version_string"],r=[w,S,C,E,I,_,x,P,k,B,O,N,D,j,T,M,F,R,L,Q,U,V,K,H,G,Y,z,Z,W,q,J,X,$,ee,te,ne,re,ie,oe,se,ae,le,ce,ue,de,he,pe,fe,ge,me,ye,ve,Ae,be,we,Se,Ce,Ee,Ie,_e,xe,Pe,ke,Be,Oe,Ne,De,je,Te,Me,Fe,Re,Le,Qe,Ue,Ve,Ke,He,Ge,Ye,ze,Ze,We,qe,Je,Xe,$e,et,tt,nt,rt,it,ot,st,at,lt,ct,ut,dt,ht,pt,ft,gt,mt,yt,vt,At,bt,wt,St,Ct,Et,It,_t,xt,Pt,kt,Bt,Ot,Nt,Dt,jt,Tt,Mt,Ft,Rt,Lt,Qt,Ut,Vt,Kt,Ht,Gt,Yt,zt,Zt,Wt,qt,Jt,Xt,$t,en,tn,nn,rn,on,sn,an,ln,cn,un,dn,hn,pn,fn,gn,mn,yn,vn,An,bn,wn],i=0;i<r.length;i++)"function"==typeof n["_"+t[i]]&&(e[t[i]]=r[i]);var o=["SODIUM_LIBRARY_VERSION_MAJOR","SODIUM_LIBRARY_VERSION_MINOR","crypto_aead_chacha20poly1305_ABYTES","crypto_aead_chacha20poly1305_IETF_ABYTES","crypto_aead_chacha20poly1305_IETF_KEYBYTES","crypto_aead_chacha20poly1305_IETF_MESSAGEBYTES_MAX","crypto_aead_chacha20poly1305_IETF_NPUBBYTES","crypto_aead_chacha20poly1305_IETF_NSECBYTES","crypto_aead_chacha20poly1305_KEYBYTES","crypto_aead_chacha20poly1305_MESSAGEBYTES_MAX","crypto_aead_chacha20poly1305_NPUBBYTES","crypto_aead_chacha20poly1305_NSECBYTES","crypto_aead_chacha20poly1305_ietf_ABYTES","crypto_aead_chacha20poly1305_ietf_KEYBYTES","crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX","crypto_aead_chacha20poly1305_ietf_NPUBBYTES","crypto_aead_chacha20poly1305_ietf_NSECBYTES","crypto_aead_xchacha20poly1305_IETF_ABYTES","crypto_aead_xchacha20poly1305_IETF_KEYBYTES","crypto_aead_xchacha20poly1305_IETF_MESSAGEBYTES_MAX","crypto_aead_xchacha20poly1305_IETF_NPUBBYTES","crypto_aead_xchacha20poly1305_IETF_NSECBYTES","crypto_aead_xchacha20poly1305_ietf_ABYTES","crypto_aead_xchacha20poly1305_ietf_KEYBYTES","crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX","crypto_aead_xchacha20poly1305_ietf_NPUBBYTES","crypto_aead_xchacha20poly1305_ietf_NSECBYTES","crypto_auth_BYTES","crypto_auth_KEYBYTES","crypto_auth_hmacsha256_BYTES","crypto_auth_hmacsha256_KEYBYTES","crypto_auth_hmacsha512256_BYTES","crypto_auth_hmacsha512256_KEYBYTES","crypto_auth_hmacsha512_BYTES","crypto_auth_hmacsha512_KEYBYTES","crypto_box_BEFORENMBYTES","crypto_box_MACBYTES","crypto_box_MESSAGEBYTES_MAX","crypto_box_NONCEBYTES","crypto_box_PUBLICKEYBYTES","crypto_box_SEALBYTES","crypto_box_SECRETKEYBYTES","crypto_box_SEEDBYTES","crypto_box_curve25519xchacha20poly1305_BEFORENMBYTES","crypto_box_curve25519xchacha20poly1305_MACBYTES","crypto_box_curve25519xchacha20poly1305_MESSAGEBYTES_MAX","crypto_box_curve25519xchacha20poly1305_NONCEBYTES","crypto_box_curve25519xchacha20poly1305_PUBLICKEYBYTES","crypto_box_curve25519xchacha20poly1305_SEALBYTES","crypto_box_curve25519xchacha20poly1305_SECRETKEYBYTES","crypto_box_curve25519xchacha20poly1305_SEEDBYTES","crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES","crypto_box_curve25519xsalsa20poly1305_MACBYTES","crypto_box_curve25519xsalsa20poly1305_MESSAGEBYTES_MAX","crypto_box_curve25519xsalsa20poly1305_NONCEBYTES","crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES","crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES","crypto_box_curve25519xsalsa20poly1305_SEEDBYTES","crypto_core_ed25519_BYTES","crypto_core_ed25519_HASHBYTES","crypto_core_ed25519_NONREDUCEDSCALARBYTES","crypto_core_ed25519_SCALARBYTES","crypto_core_ed25519_UNIFORMBYTES","crypto_core_hchacha20_CONSTBYTES","crypto_core_hchacha20_INPUTBYTES","crypto_core_hchacha20_KEYBYTES","crypto_core_hchacha20_OUTPUTBYTES","crypto_core_hsalsa20_CONSTBYTES","crypto_core_hsalsa20_INPUTBYTES","crypto_core_hsalsa20_KEYBYTES","crypto_core_hsalsa20_OUTPUTBYTES","crypto_core_ristretto255_BYTES","crypto_core_ristretto255_HASHBYTES","crypto_core_ristretto255_NONREDUCEDSCALARBYTES","crypto_core_ristretto255_SCALARBYTES","crypto_core_salsa2012_CONSTBYTES","crypto_core_salsa2012_INPUTBYTES","crypto_core_salsa2012_KEYBYTES","crypto_core_salsa2012_OUTPUTBYTES","crypto_core_salsa20_CONSTBYTES","crypto_core_salsa20_INPUTBYTES","crypto_core_salsa20_KEYBYTES","crypto_core_salsa20_OUTPUTBYTES","crypto_generichash_BYTES","crypto_generichash_BYTES_MAX","crypto_generichash_BYTES_MIN","crypto_generichash_KEYBYTES","crypto_generichash_KEYBYTES_MAX","crypto_generichash_KEYBYTES_MIN","crypto_generichash_blake2b_BYTES","crypto_generichash_blake2b_BYTES_MAX","crypto_generichash_blake2b_BYTES_MIN","crypto_generichash_blake2b_KEYBYTES","crypto_generichash_blake2b_KEYBYTES_MAX","crypto_generichash_blake2b_KEYBYTES_MIN","crypto_generichash_blake2b_PERSONALBYTES","crypto_generichash_blake2b_SALTBYTES","crypto_hash_BYTES","crypto_hash_sha256_BYTES","crypto_hash_sha512_BYTES","crypto_kdf_BYTES_MAX","crypto_kdf_BYTES_MIN","crypto_kdf_CONTEXTBYTES","crypto_kdf_KEYBYTES","crypto_kdf_blake2b_BYTES_MAX","crypto_kdf_blake2b_BYTES_MIN","crypto_kdf_blake2b_CONTEXTBYTES","crypto_kdf_blake2b_KEYBYTES","crypto_kx_PUBLICKEYBYTES","crypto_kx_SECRETKEYBYTES","crypto_kx_SEEDBYTES","crypto_kx_SESSIONKEYBYTES","crypto_onetimeauth_BYTES","crypto_onetimeauth_KEYBYTES","crypto_onetimeauth_poly1305_BYTES","crypto_onetimeauth_poly1305_KEYBYTES","crypto_pwhash_ALG_ARGON2I13","crypto_pwhash_ALG_ARGON2ID13","crypto_pwhash_ALG_DEFAULT","crypto_pwhash_BYTES_MAX","crypto_pwhash_BYTES_MIN","crypto_pwhash_MEMLIMIT_INTERACTIVE","crypto_pwhash_MEMLIMIT_MAX","crypto_pwhash_MEMLIMIT_MIN","crypto_pwhash_MEMLIMIT_MODERATE","crypto_pwhash_MEMLIMIT_SENSITIVE","crypto_pwhash_OPSLIMIT_INTERACTIVE","crypto_pwhash_OPSLIMIT_MAX","crypto_pwhash_OPSLIMIT_MIN","crypto_pwhash_OPSLIMIT_MODERATE","crypto_pwhash_OPSLIMIT_SENSITIVE","crypto_pwhash_PASSWD_MAX","crypto_pwhash_PASSWD_MIN","crypto_pwhash_SALTBYTES","crypto_pwhash_STRBYTES","crypto_pwhash_argon2i_BYTES_MAX","crypto_pwhash_argon2i_BYTES_MIN","crypto_pwhash_argon2i_SALTBYTES","crypto_pwhash_argon2i_STRBYTES","crypto_pwhash_argon2id_BYTES_MAX","crypto_pwhash_argon2id_BYTES_MIN","crypto_pwhash_argon2id_SALTBYTES","crypto_pwhash_argon2id_STRBYTES","crypto_pwhash_scryptsalsa208sha256_BYTES_MAX","crypto_pwhash_scryptsalsa208sha256_BYTES_MIN","crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE","crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MAX","crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MIN","crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_SENSITIVE","crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE","crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MAX","crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN","crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_SENSITIVE","crypto_pwhash_scryptsalsa208sha256_SALTBYTES","crypto_pwhash_scryptsalsa208sha256_STRBYTES","crypto_scalarmult_BYTES","crypto_scalarmult_SCALARBYTES","crypto_scalarmult_curve25519_BYTES","crypto_scalarmult_curve25519_SCALARBYTES","crypto_scalarmult_ed25519_BYTES","crypto_scalarmult_ed25519_SCALARBYTES","crypto_scalarmult_ristretto255_BYTES","crypto_scalarmult_ristretto255_SCALARBYTES","crypto_secretbox_KEYBYTES","crypto_secretbox_MACBYTES","crypto_secretbox_MESSAGEBYTES_MAX","crypto_secretbox_NONCEBYTES","crypto_secretbox_xchacha20poly1305_KEYBYTES","crypto_secretbox_xchacha20poly1305_MACBYTES","crypto_secretbox_xchacha20poly1305_MESSAGEBYTES_MAX","crypto_secretbox_xchacha20poly1305_NONCEBYTES","crypto_secretbox_xsalsa20poly1305_KEYBYTES","crypto_secretbox_xsalsa20poly1305_MACBYTES","crypto_secretbox_xsalsa20poly1305_MESSAGEBYTES_MAX","crypto_secretbox_xsalsa20poly1305_NONCEBYTES","crypto_secretstream_xchacha20poly1305_ABYTES","crypto_secretstream_xchacha20poly1305_HEADERBYTES","crypto_secretstream_xchacha20poly1305_KEYBYTES","crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX","crypto_secretstream_xchacha20poly1305_TAG_FINAL","crypto_secretstream_xchacha20poly1305_TAG_MESSAGE","crypto_secretstream_xchacha20poly1305_TAG_PUSH","crypto_secretstream_xchacha20poly1305_TAG_REKEY","crypto_shorthash_BYTES","crypto_shorthash_KEYBYTES","crypto_shorthash_siphash24_BYTES","crypto_shorthash_siphash24_KEYBYTES","crypto_shorthash_siphashx24_BYTES","crypto_shorthash_siphashx24_KEYBYTES","crypto_sign_BYTES","crypto_sign_MESSAGEBYTES_MAX","crypto_sign_PUBLICKEYBYTES","crypto_sign_SECRETKEYBYTES","crypto_sign_SEEDBYTES","crypto_sign_ed25519_BYTES","crypto_sign_ed25519_MESSAGEBYTES_MAX","crypto_sign_ed25519_PUBLICKEYBYTES","crypto_sign_ed25519_SECRETKEYBYTES","crypto_sign_ed25519_SEEDBYTES","crypto_stream_KEYBYTES","crypto_stream_MESSAGEBYTES_MAX","crypto_stream_NONCEBYTES","crypto_stream_chacha20_IETF_KEYBYTES","crypto_stream_chacha20_IETF_MESSAGEBYTES_MAX","crypto_stream_chacha20_IETF_NONCEBYTES","crypto_stream_chacha20_KEYBYTES","crypto_stream_chacha20_MESSAGEBYTES_MAX","crypto_stream_chacha20_NONCEBYTES","crypto_stream_chacha20_ietf_KEYBYTES","crypto_stream_chacha20_ietf_MESSAGEBYTES_MAX","crypto_stream_chacha20_ietf_NONCEBYTES","crypto_stream_salsa2012_KEYBYTES","crypto_stream_salsa2012_MESSAGEBYTES_MAX","crypto_stream_salsa2012_NONCEBYTES","crypto_stream_salsa208_KEYBYTES","crypto_stream_salsa208_MESSAGEBYTES_MAX","crypto_stream_salsa208_NONCEBYTES","crypto_stream_salsa20_KEYBYTES","crypto_stream_salsa20_MESSAGEBYTES_MAX","crypto_stream_salsa20_NONCEBYTES","crypto_stream_xchacha20_KEYBYTES","crypto_stream_xchacha20_MESSAGEBYTES_MAX","crypto_stream_xchacha20_NONCEBYTES","crypto_stream_xsalsa20_KEYBYTES","crypto_stream_xsalsa20_MESSAGEBYTES_MAX","crypto_stream_xsalsa20_NONCEBYTES","crypto_verify_16_BYTES","crypto_verify_32_BYTES","crypto_verify_64_BYTES"];for(i=0;i<o.length;i++)"function"==typeof(a=n["_"+o[i].toLowerCase()])&&(e[o[i]]=a());var s=["SODIUM_VERSION_STRING","crypto_pwhash_STRPREFIX","crypto_pwhash_scryptsalsa208sha256_STRPREFIX"];for(i=0;i<s.length;i++){var a;"function"==typeof(a=n["_"+s[i].toLowerCase()])&&(e[s[i]]=n.UTF8ToString(a()))}}n=t;try{r();var i=new Uint8Array([98,97,108,108,115]),o=e.randombytes_buf(e.crypto_secretbox_NONCEBYTES),s=e.randombytes_buf(e.crypto_secretbox_KEYBYTES),a=e.crypto_secretbox_easy(i,o,s),l=e.crypto_secretbox_open_easy(a,o,s);if(e.memcmp(i,l))return}catch(e){if(null==n.useBackupModule)throw new Error("Both wasm and asm failed to load"+e)}n.useBackupModule(),r()}));function i(e){if("function"==typeof TextEncoder)return(new TextEncoder).encode(e);e=unescape(encodeURIComponent(e));for(var t=new Uint8Array(e.length),n=0,r=e.length;n<r;n++)t[n]=e.charCodeAt(n);return t}function o(e){if("function"==typeof TextDecoder)return new TextDecoder("utf-8",{fatal:!0}).decode(e);var t=8192,n=Math.ceil(e.length/t);if(n<=1)try{return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))}catch(e){throw new TypeError("The encoded data was not valid.")}for(var r="",i=0,s=0;s<n;s++){var a=Array.prototype.slice.call(e,s*t+i,(s+1)*t+i);if(0!=a.length){var l,c=a.length,u=0;do{var d=a[--c];d>=240?(u=4,l=!0):d>=224?(u=3,l=!0):d>=192?(u=2,l=!0):d<128&&(u=1,l=!0)}while(!l);for(var h=u-(a.length-c),p=0;p<h;p++)i--,a.pop();r+=o(a)}}return r}function s(e){e=b(null,e,"input");for(var t,n,r,i="",o=0;o<e.length;o++)r=87+(n=15&e[o])+(n-10>>8&-39)<<8|87+(t=e[o]>>>4)+(t-10>>8&-39),i+=String.fromCharCode(255&r)+String.fromCharCode(r>>>8);return i}var a={ORIGINAL:1,ORIGINAL_NO_PADDING:3,URLSAFE:5,URLSAFE_NO_PADDING:7};function l(e){if(null==e)return a.URLSAFE_NO_PADDING;if(e!==a.ORIGINAL&&e!==a.ORIGINAL_NO_PADDING&&e!==a.URLSAFE&&e!=a.URLSAFE_NO_PADDING)throw new Error("unsupported base64 variant");return e}function c(e,t){t=l(t),e=b(i,e,"input");var r,i=[],s=0|Math.floor(e.length/3),a=e.length-3*s,c=4*s+(0!==a?0==(2&t)?4:2+(a>>>1):0),u=new p(c+1),d=f(e);return i.push(d),i.push(u.address),0===n._sodium_bin2base64(u.address,u.length,d,e.length,t)&&y(i,"conversion failed"),u.length=c,r=o(u.to_Uint8Array()),m(i),r}function u(e,t){var n=t||"uint8array";if(!d(n))throw new Error(n+" output format is not available");if(e instanceof p){if("uint8array"===n)return e.to_Uint8Array();if("text"===n)return o(e.to_Uint8Array());if("hex"===n)return s(e.to_Uint8Array());if("base64"===n)return c(e.to_Uint8Array(),a.URLSAFE_NO_PADDING);throw new Error('What is output format "'+n+'"?')}if("object"==typeof e){for(var r=Object.keys(e),i={},l=0;l<r.length;l++)i[r[l]]=u(e[r[l]],n);return i}if("string"==typeof e)return e;throw new TypeError("Cannot format output")}function d(e){for(var t=["uint8array","text","hex","base64"],n=0;n<t.length;n++)if(t[n]===e)return!0;return!1}function h(e){if(e){if("string"!=typeof e)throw new TypeError("When defined, the output format must be a string");if(!d(e))throw new Error(e+" is not a supported output format")}}function p(e){this.length=e,this.address=g(e)}function f(e){var t=g(e.length);return n.HEAPU8.set(e,t),t}function g(e){var t=n._malloc(e);if(0===t)throw{message:"_malloc() failed",length:e};return t}function m(e){if(e)for(var t=0;t<e.length;t++)r=e[t],n._free(r);var r}function y(e,t){throw m(e),new Error(t)}function v(e,t){throw m(e),new TypeError(t)}function A(e,t,n){null==t&&v(e,n+" cannot be null or undefined")}function b(e,t,n){return A(e,t,n),t instanceof Uint8Array?t:"string"==typeof t?i(t):void v(e,"unsupported input type for "+n)}function w(e,t,r,i,o,s){var a=[];h(s);var l=null;null!=e&&(l=f(e=b(a,e,"secret_nonce")),e.length,a.push(l)),t=b(a,t,"ciphertext");var c,d=n._crypto_aead_chacha20poly1305_abytes(),g=t.length;g<d&&v(a,"ciphertext is too short"),c=f(t),a.push(c);var A=null,w=0;null!=r&&(A=f(r=b(a,r,"additional_data")),w=r.length,a.push(A)),i=b(a,i,"public_nonce");var S,C=0|n._crypto_aead_chacha20poly1305_npubbytes();i.length!==C&&v(a,"invalid public_nonce length"),S=f(i),a.push(S),o=b(a,o,"key");var E,I=0|n._crypto_aead_chacha20poly1305_keybytes();o.length!==I&&v(a,"invalid key length"),E=f(o),a.push(E);var _=new p(g-n._crypto_aead_chacha20poly1305_abytes()|0),x=_.address;if(a.push(x),0===n._crypto_aead_chacha20poly1305_decrypt(x,null,l,c,g,0,A,w,0,S,E)){var P=u(_,s);return m(a),P}y(a,"ciphertext cannot be decrypted using that key")}function S(e,t,r,i,o,s,a){var l=[];h(a);var c=null;null!=e&&(c=f(e=b(l,e,"secret_nonce")),e.length,l.push(c));var d=f(t=b(l,t,"ciphertext")),g=t.length;l.push(d),r=b(l,r,"mac");var A,w=0|n._crypto_box_macbytes();r.length!==w&&v(l,"invalid mac length"),A=f(r),l.push(A);var S=null,C=0;null!=i&&(S=f(i=b(l,i,"additional_data")),C=i.length,l.push(S)),o=b(l,o,"public_nonce");var E,I=0|n._crypto_aead_chacha20poly1305_npubbytes();o.length!==I&&v(l,"invalid public_nonce length"),E=f(o),l.push(E),s=b(l,s,"key");var _,x=0|n._crypto_aead_chacha20poly1305_keybytes();s.length!==x&&v(l,"invalid key length"),_=f(s),l.push(_);var P=new p(0|g),k=P.address;if(l.push(k),0===n._crypto_aead_chacha20poly1305_decrypt_detached(k,c,d,g,0,A,S,C,0,E,_)){var B=u(P,a);return m(l),B}y(l,"ciphertext cannot be decrypted using that key")}function C(e,t,r,i,o,s){var a=[];h(s);var l=f(e=b(a,e,"message")),c=e.length;a.push(l);var d=null,g=0;null!=t&&(d=f(t=b(a,t,"additional_data")),g=t.length,a.push(d));var A=null;null!=r&&(A=f(r=b(a,r,"secret_nonce")),r.length,a.push(A)),i=b(a,i,"public_nonce");var w,S=0|n._crypto_aead_chacha20poly1305_npubbytes();i.length!==S&&v(a,"invalid public_nonce length"),w=f(i),a.push(w),o=b(a,o,"key");var C,E=0|n._crypto_aead_chacha20poly1305_keybytes();o.length!==E&&v(a,"invalid key length"),C=f(o),a.push(C);var I=new p(c+n._crypto_aead_chacha20poly1305_abytes()|0),_=I.address;if(a.push(_),0===n._crypto_aead_chacha20poly1305_encrypt(_,null,l,c,0,d,g,0,A,w,C)){var x=u(I,s);return m(a),x}y(a,"invalid usage")}function E(e,t,r,i,o,s){var a=[];h(s);var l=f(e=b(a,e,"message")),c=e.length;a.push(l);var d=null,g=0;null!=t&&(d=f(t=b(a,t,"additional_data")),g=t.length,a.push(d));var A=null;null!=r&&(A=f(r=b(a,r,"secret_nonce")),r.length,a.push(A)),i=b(a,i,"public_nonce");var w,S=0|n._crypto_aead_chacha20poly1305_npubbytes();i.length!==S&&v(a,"invalid public_nonce length"),w=f(i),a.push(w),o=b(a,o,"key");var C,E=0|n._crypto_aead_chacha20poly1305_keybytes();o.length!==E&&v(a,"invalid key length"),C=f(o),a.push(C);var I=new p(0|c),_=I.address;a.push(_);var x=new p(0|n._crypto_aead_chacha20poly1305_abytes()),P=x.address;if(a.push(P),0===n._crypto_aead_chacha20poly1305_encrypt_detached(_,P,null,l,c,0,d,g,0,A,w,C)){var k=u({ciphertext:I,mac:x},s);return m(a),k}y(a,"invalid usage")}function I(e,t,r,i,o,s){var a=[];h(s);var l=null;null!=e&&(l=f(e=b(a,e,"secret_nonce")),e.length,a.push(l)),t=b(a,t,"ciphertext");var c,d=n._crypto_aead_chacha20poly1305_ietf_abytes(),g=t.length;g<d&&v(a,"ciphertext is too short"),c=f(t),a.push(c);var A=null,w=0;null!=r&&(A=f(r=b(a,r,"additional_data")),w=r.length,a.push(A)),i=b(a,i,"public_nonce");var S,C=0|n._crypto_aead_chacha20poly1305_ietf_npubbytes();i.length!==C&&v(a,"invalid public_nonce length"),S=f(i),a.push(S),o=b(a,o,"key");var E,I=0|n._crypto_aead_chacha20poly1305_ietf_keybytes();o.length!==I&&v(a,"invalid key length"),E=f(o),a.push(E);var _=new p(g-n._crypto_aead_chacha20poly1305_ietf_abytes()|0),x=_.address;if(a.push(x),0===n._crypto_aead_chacha20poly1305_ietf_decrypt(x,null,l,c,g,0,A,w,0,S,E)){var P=u(_,s);return m(a),P}y(a,"ciphertext cannot be decrypted using that key")}function _(e,t,r,i,o,s,a){var l=[];h(a);var c=null;null!=e&&(c=f(e=b(l,e,"secret_nonce")),e.length,l.push(c));var d=f(t=b(l,t,"ciphertext")),g=t.length;l.push(d),r=b(l,r,"mac");var A,w=0|n._crypto_box_macbytes();r.length!==w&&v(l,"invalid mac length"),A=f(r),l.push(A);var S=null,C=0;null!=i&&(S=f(i=b(l,i,"additional_data")),C=i.length,l.push(S)),o=b(l,o,"public_nonce");var E,I=0|n._crypto_aead_chacha20poly1305_ietf_npubbytes();o.length!==I&&v(l,"invalid public_nonce length"),E=f(o),l.push(E),s=b(l,s,"key");var _,x=0|n._crypto_aead_chacha20poly1305_ietf_keybytes();s.length!==x&&v(l,"invalid key length"),_=f(s),l.push(_);var P=new p(0|g),k=P.address;if(l.push(k),0===n._crypto_aead_chacha20poly1305_ietf_decrypt_detached(k,c,d,g,0,A,S,C,0,E,_)){var B=u(P,a);return m(l),B}y(l,"ciphertext cannot be decrypted using that key")}function x(e,t,r,i,o,s){var a=[];h(s);var l=f(e=b(a,e,"message")),c=e.length;a.push(l);var d=null,g=0;null!=t&&(d=f(t=b(a,t,"additional_data")),g=t.length,a.push(d));var A=null;null!=r&&(A=f(r=b(a,r,"secret_nonce")),r.length,a.push(A)),i=b(a,i,"public_nonce");var w,S=0|n._crypto_aead_chacha20poly1305_ietf_npubbytes();i.length!==S&&v(a,"invalid public_nonce length"),w=f(i),a.push(w),o=b(a,o,"key");var C,E=0|n._crypto_aead_chacha20poly1305_ietf_keybytes();o.length!==E&&v(a,"invalid key length"),C=f(o),a.push(C);var I=new p(c+n._crypto_aead_chacha20poly1305_ietf_abytes()|0),_=I.address;if(a.push(_),0===n._crypto_aead_chacha20poly1305_ietf_encrypt(_,null,l,c,0,d,g,0,A,w,C)){var x=u(I,s);return m(a),x}y(a,"invalid usage")}function P(e,t,r,i,o,s){var a=[];h(s);var l=f(e=b(a,e,"message")),c=e.length;a.push(l);var d=null,g=0;null!=t&&(d=f(t=b(a,t,"additional_data")),g=t.length,a.push(d));var A=null;null!=r&&(A=f(r=b(a,r,"secret_nonce")),r.length,a.push(A)),i=b(a,i,"public_nonce");var w,S=0|n._crypto_aead_chacha20poly1305_ietf_npubbytes();i.length!==S&&v(a,"invalid public_nonce length"),w=f(i),a.push(w),o=b(a,o,"key");var C,E=0|n._crypto_aead_chacha20poly1305_ietf_keybytes();o.length!==E&&v(a,"invalid key length"),C=f(o),a.push(C);var I=new p(0|c),_=I.address;a.push(_);var x=new p(0|n._crypto_aead_chacha20poly1305_ietf_abytes()),P=x.address;if(a.push(P),0===n._crypto_aead_chacha20poly1305_ietf_encrypt_detached(_,P,null,l,c,0,d,g,0,A,w,C)){var k=u({ciphertext:I,mac:x},s);return m(a),k}y(a,"invalid usage")}function k(e){var t=[];h(e);var r=new p(0|n._crypto_aead_chacha20poly1305_ietf_keybytes()),i=r.address;t.push(i),n._crypto_aead_chacha20poly1305_ietf_keygen(i);var o=u(r,e);return m(t),o}function B(e){var t=[];h(e);var r=new p(0|n._crypto_aead_chacha20poly1305_keybytes()),i=r.address;t.push(i),n._crypto_aead_chacha20poly1305_keygen(i);var o=u(r,e);return m(t),o}function O(e,t,r,i,o,s){var a=[];h(s);var l=null;null!=e&&(l=f(e=b(a,e,"secret_nonce")),e.length,a.push(l)),t=b(a,t,"ciphertext");var c,d=n._crypto_aead_xchacha20poly1305_ietf_abytes(),g=t.length;g<d&&v(a,"ciphertext is too short"),c=f(t),a.push(c);var A=null,w=0;null!=r&&(A=f(r=b(a,r,"additional_data")),w=r.length,a.push(A)),i=b(a,i,"public_nonce");var S,C=0|n._crypto_aead_xchacha20poly1305_ietf_npubbytes();i.length!==C&&v(a,"invalid public_nonce length"),S=f(i),a.push(S),o=b(a,o,"key");var E,I=0|n._crypto_aead_xchacha20poly1305_ietf_keybytes();o.length!==I&&v(a,"invalid key length"),E=f(o),a.push(E);var _=new p(g-n._crypto_aead_xchacha20poly1305_ietf_abytes()|0),x=_.address;if(a.push(x),0===n._crypto_aead_xchacha20poly1305_ietf_decrypt(x,null,l,c,g,0,A,w,0,S,E)){var P=u(_,s);return m(a),P}y(a,"ciphertext cannot be decrypted using that key")}function N(e,t,r,i,o,s,a){var l=[];h(a);var c=null;null!=e&&(c=f(e=b(l,e,"secret_nonce")),e.length,l.push(c));var d=f(t=b(l,t,"ciphertext")),g=t.length;l.push(d),r=b(l,r,"mac");var A,w=0|n._crypto_box_macbytes();r.length!==w&&v(l,"invalid mac length"),A=f(r),l.push(A);var S=null,C=0;null!=i&&(S=f(i=b(l,i,"additional_data")),C=i.length,l.push(S)),o=b(l,o,"public_nonce");var E,I=0|n._crypto_aead_xchacha20poly1305_ietf_npubbytes();o.length!==I&&v(l,"invalid public_nonce length"),E=f(o),l.push(E),s=b(l,s,"key");var _,x=0|n._crypto_aead_xchacha20poly1305_ietf_keybytes();s.length!==x&&v(l,"invalid key length"),_=f(s),l.push(_);var P=new p(0|g),k=P.address;if(l.push(k),0===n._crypto_aead_xchacha20poly1305_ietf_decrypt_detached(k,c,d,g,0,A,S,C,0,E,_)){var B=u(P,a);return m(l),B}y(l,"ciphertext cannot be decrypted using that key")}function D(e,t,r,i,o,s){var a=[];h(s);var l=f(e=b(a,e,"message")),c=e.length;a.push(l);var d=null,g=0;null!=t&&(d=f(t=b(a,t,"additional_data")),g=t.length,a.push(d));var A=null;null!=r&&(A=f(r=b(a,r,"secret_nonce")),r.length,a.push(A)),i=b(a,i,"public_nonce");var w,S=0|n._crypto_aead_xchacha20poly1305_ietf_npubbytes();i.length!==S&&v(a,"invalid public_nonce length"),w=f(i),a.push(w),o=b(a,o,"key");var C,E=0|n._crypto_aead_xchacha20poly1305_ietf_keybytes();o.length!==E&&v(a,"invalid key length"),C=f(o),a.push(C);var I=new p(c+n._crypto_aead_xchacha20poly1305_ietf_abytes()|0),_=I.address;if(a.push(_),0===n._crypto_aead_xchacha20poly1305_ietf_encrypt(_,null,l,c,0,d,g,0,A,w,C)){var x=u(I,s);return m(a),x}y(a,"invalid usage")}function j(e,t,r,i,o,s){var a=[];h(s);var l=f(e=b(a,e,"message")),c=e.length;a.push(l);var d=null,g=0;null!=t&&(d=f(t=b(a,t,"additional_data")),g=t.length,a.push(d));var A=null;null!=r&&(A=f(r=b(a,r,"secret_nonce")),r.length,a.push(A)),i=b(a,i,"public_nonce");var w,S=0|n._crypto_aead_xchacha20poly1305_ietf_npubbytes();i.length!==S&&v(a,"invalid public_nonce length"),w=f(i),a.push(w),o=b(a,o,"key");var C,E=0|n._crypto_aead_xchacha20poly1305_ietf_keybytes();o.length!==E&&v(a,"invalid key length"),C=f(o),a.push(C);var I=new p(0|c),_=I.address;a.push(_);var x=new p(0|n._crypto_aead_xchacha20poly1305_ietf_abytes()),P=x.address;if(a.push(P),0===n._crypto_aead_xchacha20poly1305_ietf_encrypt_detached(_,P,null,l,c,0,d,g,0,A,w,C)){var k=u({ciphertext:I,mac:x},s);return m(a),k}y(a,"invalid usage")}function T(e){var t=[];h(e);var r=new p(0|n._crypto_aead_xchacha20poly1305_ietf_keybytes()),i=r.address;t.push(i),n._crypto_aead_xchacha20poly1305_ietf_keygen(i);var o=u(r,e);return m(t),o}function M(e,t,r){var i=[];h(r);var o=f(e=b(i,e,"message")),s=e.length;i.push(o),t=b(i,t,"key");var a,l=0|n._crypto_auth_keybytes();t.length!==l&&v(i,"invalid key length"),a=f(t),i.push(a);var c=new p(0|n._crypto_auth_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_auth(d,o,s,0,a))){var g=u(c,r);return m(i),g}y(i,"invalid usage")}function F(e,t,r){var i=[];h(r);var o=f(e=b(i,e,"message")),s=e.length;i.push(o),t=b(i,t,"key");var a,l=0|n._crypto_auth_hmacsha256_keybytes();t.length!==l&&v(i,"invalid key length"),a=f(t),i.push(a);var c=new p(0|n._crypto_auth_hmacsha256_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_auth_hmacsha256(d,o,s,0,a))){var g=u(c,r);return m(i),g}y(i,"invalid usage")}function R(e,t){var r=[];h(t),A(r,e,"state_address");var i=new p(0|n._crypto_auth_hmacsha256_bytes()),o=i.address;if(r.push(o),0==(0|n._crypto_auth_hmacsha256_final(e,o))){var s=(n._free(e),u(i,t));return m(r),s}y(r,"invalid usage")}function L(e,t){var r=[];h(t);var i=null,o=0;null!=e&&(i=f(e=b(r,e,"key")),o=e.length,r.push(i));var s=new p(208).address;if(0==(0|n._crypto_auth_hmacsha256_init(s,i,o))){var a=s;return m(r),a}y(r,"invalid usage")}function Q(e){var t=[];h(e);var r=new p(0|n._crypto_auth_hmacsha256_keybytes()),i=r.address;t.push(i),n._crypto_auth_hmacsha256_keygen(i);var o=u(r,e);return m(t),o}function U(e,t,r){var i=[];h(r),A(i,e,"state_address");var o=f(t=b(i,t,"message_chunk")),s=t.length;i.push(o),0!=(0|n._crypto_auth_hmacsha256_update(e,o,s))&&y(i,"invalid usage"),m(i)}function V(e,t,r){var i=[];e=b(i,e,"tag");var o,s=0|n._crypto_auth_hmacsha256_bytes();e.length!==s&&v(i,"invalid tag length"),o=f(e),i.push(o);var a=f(t=b(i,t,"message")),l=t.length;i.push(a),r=b(i,r,"key");var c,u=0|n._crypto_auth_hmacsha256_keybytes();r.length!==u&&v(i,"invalid key length"),c=f(r),i.push(c);var d=0==(0|n._crypto_auth_hmacsha256_verify(o,a,l,0,c));return m(i),d}function K(e,t,r){var i=[];h(r);var o=f(e=b(i,e,"message")),s=e.length;i.push(o),t=b(i,t,"key");var a,l=0|n._crypto_auth_hmacsha512_keybytes();t.length!==l&&v(i,"invalid key length"),a=f(t),i.push(a);var c=new p(0|n._crypto_auth_hmacsha512_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_auth_hmacsha512(d,o,s,0,a))){var g=u(c,r);return m(i),g}y(i,"invalid usage")}function H(e,t){var r=[];h(t),A(r,e,"state_address");var i=new p(0|n._crypto_auth_hmacsha512_bytes()),o=i.address;if(r.push(o),0==(0|n._crypto_auth_hmacsha512_final(e,o))){var s=(n._free(e),u(i,t));return m(r),s}y(r,"invalid usage")}function G(e,t){var r=[];h(t);var i=null,o=0;null!=e&&(i=f(e=b(r,e,"key")),o=e.length,r.push(i));var s=new p(416).address;if(0==(0|n._crypto_auth_hmacsha512_init(s,i,o))){var a=s;return m(r),a}y(r,"invalid usage")}function Y(e){var t=[];h(e);var r=new p(0|n._crypto_auth_hmacsha512_keybytes()),i=r.address;t.push(i),n._crypto_auth_hmacsha512_keygen(i);var o=u(r,e);return m(t),o}function z(e,t,r){var i=[];h(r),A(i,e,"state_address");var o=f(t=b(i,t,"message_chunk")),s=t.length;i.push(o),0!=(0|n._crypto_auth_hmacsha512_update(e,o,s))&&y(i,"invalid usage"),m(i)}function Z(e,t,r){var i=[];e=b(i,e,"tag");var o,s=0|n._crypto_auth_hmacsha512_bytes();e.length!==s&&v(i,"invalid tag length"),o=f(e),i.push(o);var a=f(t=b(i,t,"message")),l=t.length;i.push(a),r=b(i,r,"key");var c,u=0|n._crypto_auth_hmacsha512_keybytes();r.length!==u&&v(i,"invalid key length"),c=f(r),i.push(c);var d=0==(0|n._crypto_auth_hmacsha512_verify(o,a,l,0,c));return m(i),d}function W(e){var t=[];h(e);var r=new p(0|n._crypto_auth_keybytes()),i=r.address;t.push(i),n._crypto_auth_keygen(i);var o=u(r,e);return m(t),o}function q(e,t,r){var i=[];e=b(i,e,"tag");var o,s=0|n._crypto_auth_bytes();e.length!==s&&v(i,"invalid tag length"),o=f(e),i.push(o);var a=f(t=b(i,t,"message")),l=t.length;i.push(a),r=b(i,r,"key");var c,u=0|n._crypto_auth_keybytes();r.length!==u&&v(i,"invalid key length"),c=f(r),i.push(c);var d=0==(0|n._crypto_auth_verify(o,a,l,0,c));return m(i),d}function J(e,t,r){var i=[];h(r),e=b(i,e,"publicKey");var o,s=0|n._crypto_box_publickeybytes();e.length!==s&&v(i,"invalid publicKey length"),o=f(e),i.push(o),t=b(i,t,"privateKey");var a,l=0|n._crypto_box_secretkeybytes();t.length!==l&&v(i,"invalid privateKey length"),a=f(t),i.push(a);var c=new p(0|n._crypto_box_beforenmbytes()),d=c.address;if(i.push(d),0==(0|n._crypto_box_beforenm(d,o,a))){var g=u(c,r);return m(i),g}y(i,"invalid usage")}function X(e){var t=[];h(e);var r=new p(0|n._crypto_box_curve25519xchacha20poly1305_publickeybytes()),i=r.address;t.push(i);var o=new p(0|n._crypto_box_curve25519xchacha20poly1305_secretkeybytes()),s=o.address;t.push(s),n._crypto_box_curve25519xchacha20poly1305_keypair(i,s);var a=u({publicKey:r,privateKey:o,keyType:"curve25519"},e);return m(t),a}function $(e,t,r){var i=[];h(r);var o=f(e=b(i,e,"message")),s=e.length;i.push(o),t=b(i,t,"publicKey");var a,l=0|n._crypto_box_curve25519xchacha20poly1305_publickeybytes();t.length!==l&&v(i,"invalid publicKey length"),a=f(t),i.push(a);var c=new p(s+n._crypto_box_curve25519xchacha20poly1305_sealbytes()|0),d=c.address;i.push(d),n._crypto_box_curve25519xchacha20poly1305_seal(d,o,s,0,a);var g=u(c,r);return m(i),g}function ee(e,t,r,i){var o=[];h(i),e=b(o,e,"ciphertext");var s,a=n._crypto_box_curve25519xchacha20poly1305_sealbytes(),l=e.length;l<a&&v(o,"ciphertext is too short"),s=f(e),o.push(s),t=b(o,t,"publicKey");var c,d=0|n._crypto_box_curve25519xchacha20poly1305_publickeybytes();t.length!==d&&v(o,"invalid publicKey length"),c=f(t),o.push(c),r=b(o,r,"secretKey");var g,y=0|n._crypto_box_curve25519xchacha20poly1305_secretkeybytes();r.length!==y&&v(o,"invalid secretKey length"),g=f(r),o.push(g);var A=new p(l-n._crypto_box_curve25519xchacha20poly1305_sealbytes()|0),w=A.address;o.push(w),n._crypto_box_curve25519xchacha20poly1305_seal_open(w,s,l,0,c,g);var S=u(A,i);return m(o),S}function te(e,t,r,i,o){var s=[];h(o);var a=f(e=b(s,e,"message")),l=e.length;s.push(a),t=b(s,t,"nonce");var c,d=0|n._crypto_box_noncebytes();t.length!==d&&v(s,"invalid nonce length"),c=f(t),s.push(c),r=b(s,r,"publicKey");var g,A=0|n._crypto_box_publickeybytes();r.length!==A&&v(s,"invalid publicKey length"),g=f(r),s.push(g),i=b(s,i,"privateKey");var w,S=0|n._crypto_box_secretkeybytes();i.length!==S&&v(s,"invalid privateKey length"),w=f(i),s.push(w);var C=new p(0|l),E=C.address;s.push(E);var I=new p(0|n._crypto_box_macbytes()),_=I.address;if(s.push(_),0==(0|n._crypto_box_detached(E,_,a,l,0,c,g,w))){var x=u({ciphertext:C,mac:I},o);return m(s),x}y(s,"invalid usage")}function ne(e,t,r,i,o){var s=[];h(o);var a=f(e=b(s,e,"message")),l=e.length;s.push(a),t=b(s,t,"nonce");var c,d=0|n._crypto_box_noncebytes();t.length!==d&&v(s,"invalid nonce length"),c=f(t),s.push(c),r=b(s,r,"publicKey");var g,A=0|n._crypto_box_publickeybytes();r.length!==A&&v(s,"invalid publicKey length"),g=f(r),s.push(g),i=b(s,i,"privateKey");var w,S=0|n._crypto_box_secretkeybytes();i.length!==S&&v(s,"invalid privateKey length"),w=f(i),s.push(w);var C=new p(l+n._crypto_box_macbytes()|0),E=C.address;if(s.push(E),0==(0|n._crypto_box_easy(E,a,l,0,c,g,w))){var I=u(C,o);return m(s),I}y(s,"invalid usage")}function re(e,t,r,i){var o=[];h(i);var s=f(e=b(o,e,"message")),a=e.length;o.push(s),t=b(o,t,"nonce");var l,c=0|n._crypto_box_noncebytes();t.length!==c&&v(o,"invalid nonce length"),l=f(t),o.push(l),r=b(o,r,"sharedKey");var d,g=0|n._crypto_box_beforenmbytes();r.length!==g&&v(o,"invalid sharedKey length"),d=f(r),o.push(d);var A=new p(a+n._crypto_box_macbytes()|0),w=A.address;if(o.push(w),0==(0|n._crypto_box_easy_afternm(w,s,a,0,l,d))){var S=u(A,i);return m(o),S}y(o,"invalid usage")}function ie(e){var t=[];h(e);var r=new p(0|n._crypto_box_publickeybytes()),i=r.address;t.push(i);var o=new p(0|n._crypto_box_secretkeybytes()),s=o.address;if(t.push(s),0==(0|n._crypto_box_keypair(i,s))){var a={publicKey:u(r,e),privateKey:u(o,e),keyType:"x25519"};return m(t),a}y(t,"internal error")}function oe(e,t,r,i,o,s){var a=[];h(s);var l=f(e=b(a,e,"ciphertext")),c=e.length;a.push(l),t=b(a,t,"mac");var d,g=0|n._crypto_box_macbytes();t.length!==g&&v(a,"invalid mac length"),d=f(t),a.push(d),r=b(a,r,"nonce");var A,w=0|n._crypto_box_noncebytes();r.length!==w&&v(a,"invalid nonce length"),A=f(r),a.push(A),i=b(a,i,"publicKey");var S,C=0|n._crypto_box_publickeybytes();i.length!==C&&v(a,"invalid publicKey length"),S=f(i),a.push(S),o=b(a,o,"privateKey");var E,I=0|n._crypto_box_secretkeybytes();o.length!==I&&v(a,"invalid privateKey length"),E=f(o),a.push(E);var _=new p(0|c),x=_.address;if(a.push(x),0==(0|n._crypto_box_open_detached(x,l,d,c,0,A,S,E))){var P=u(_,s);return m(a),P}y(a,"incorrect key pair for the given ciphertext")}function se(e,t,r,i,o){var s=[];h(o),e=b(s,e,"ciphertext");var a,l=n._crypto_box_macbytes(),c=e.length;c<l&&v(s,"ciphertext is too short"),a=f(e),s.push(a),t=b(s,t,"nonce");var d,g=0|n._crypto_box_noncebytes();t.length!==g&&v(s,"invalid nonce length"),d=f(t),s.push(d),r=b(s,r,"publicKey");var A,w=0|n._crypto_box_publickeybytes();r.length!==w&&v(s,"invalid publicKey length"),A=f(r),s.push(A),i=b(s,i,"privateKey");var S,C=0|n._crypto_box_secretkeybytes();i.length!==C&&v(s,"invalid privateKey length"),S=f(i),s.push(S);var E=new p(c-n._crypto_box_macbytes()|0),I=E.address;if(s.push(I),0==(0|n._crypto_box_open_easy(I,a,c,0,d,A,S))){var _=u(E,o);return m(s),_}y(s,"incorrect key pair for the given ciphertext")}function ae(e,t,r,i){var o=[];h(i);var s=f(e=b(o,e,"ciphertext")),a=e.length;o.push(s),t=b(o,t,"nonce");var l,c=0|n._crypto_box_noncebytes();t.length!==c&&v(o,"invalid nonce length"),l=f(t),o.push(l),r=b(o,r,"sharedKey");var d,g=0|n._crypto_box_beforenmbytes();r.length!==g&&v(o,"invalid sharedKey length"),d=f(r),o.push(d);var A=new p(a-n._crypto_box_macbytes()|0),w=A.address;if(o.push(w),0==(0|n._crypto_box_open_easy_afternm(w,s,a,0,l,d))){var S=u(A,i);return m(o),S}y(o,"incorrect secret key for the given ciphertext")}function le(e,t,r){var i=[];h(r);var o=f(e=b(i,e,"message")),s=e.length;i.push(o),t=b(i,t,"publicKey");var a,l=0|n._crypto_box_publickeybytes();t.length!==l&&v(i,"invalid publicKey length"),a=f(t),i.push(a);var c=new p(s+n._crypto_box_sealbytes()|0),d=c.address;if(i.push(d),0==(0|n._crypto_box_seal(d,o,s,0,a))){var g=u(c,r);return m(i),g}y(i,"invalid usage")}function ce(e,t,r,i){var o=[];h(i),e=b(o,e,"ciphertext");var s,a=n._crypto_box_sealbytes(),l=e.length;l<a&&v(o,"ciphertext is too short"),s=f(e),o.push(s),t=b(o,t,"publicKey");var c,d=0|n._crypto_box_publickeybytes();t.length!==d&&v(o,"invalid publicKey length"),c=f(t),o.push(c),r=b(o,r,"privateKey");var g,A=0|n._crypto_box_secretkeybytes();r.length!==A&&v(o,"invalid privateKey length"),g=f(r),o.push(g);var w=new p(l-n._crypto_box_sealbytes()|0),S=w.address;if(o.push(S),0==(0|n._crypto_box_seal_open(S,s,l,0,c,g))){var C=u(w,i);return m(o),C}y(o,"incorrect key pair for the given ciphertext")}function ue(e,t){var r=[];h(t),e=b(r,e,"seed");var i,o=0|n._crypto_box_seedbytes();e.length!==o&&v(r,"invalid seed length"),i=f(e),r.push(i);var s=new p(0|n._crypto_box_publickeybytes()),a=s.address;r.push(a);var l=new p(0|n._crypto_box_secretkeybytes()),c=l.address;if(r.push(c),0==(0|n._crypto_box_seed_keypair(a,c,i))){var d={publicKey:u(s,t),privateKey:u(l,t),keyType:"x25519"};return m(r),d}y(r,"invalid usage")}function de(e,t,r){var i=[];h(r),e=b(i,e,"p");var o,s=0|n._crypto_core_ed25519_bytes();e.length!==s&&v(i,"invalid p length"),o=f(e),i.push(o),t=b(i,t,"q");var a,l=0|n._crypto_core_ed25519_bytes();t.length!==l&&v(i,"invalid q length"),a=f(t),i.push(a);var c=new p(0|n._crypto_core_ed25519_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_core_ed25519_add(d,o,a))){var g=u(c,r);return m(i),g}y(i,"input is an invalid element")}function he(e,t){var r=[];h(t);var i=f(e=b(r,e,"r"));e.length,r.push(i);var o=new p(0|n._crypto_core_ed25519_bytes()),s=o.address;if(r.push(s),0==(0|n._crypto_core_ed25519_from_hash(s,i))){var a=u(o,t);return m(r),a}y(r,"invalid usage")}function pe(e,t){var r=[];h(t);var i=f(e=b(r,e,"r"));e.length,r.push(i);var o=new p(0|n._crypto_core_ed25519_bytes()),s=o.address;if(r.push(s),0==(0|n._crypto_core_ed25519_from_uniform(s,i))){var a=u(o,t);return m(r),a}y(r,"invalid usage")}function fe(e,t){var r=[];h(t),e=b(r,e,"repr");var i,o=0|n._crypto_core_ed25519_bytes();e.length!==o&&v(r,"invalid repr length"),i=f(e),r.push(i);var s=1==(0|n._crypto_core_ed25519_is_valid_point(i));return m(r),s}function ge(e){var t=[];h(e);var r=new p(0|n._crypto_core_ed25519_bytes()),i=r.address;t.push(i),n._crypto_core_ed25519_random(i);var o=u(r,e);return m(t),o}function me(e,t,r){var i=[];h(r),e=b(i,e,"x");var o,s=0|n._crypto_core_ed25519_scalarbytes();e.length!==s&&v(i,"invalid x length"),o=f(e),i.push(o),t=b(i,t,"y");var a,l=0|n._crypto_core_ed25519_scalarbytes();t.length!==l&&v(i,"invalid y length"),a=f(t),i.push(a);var c=new p(0|n._crypto_core_ed25519_scalarbytes()),d=c.address;i.push(d),n._crypto_core_ed25519_scalar_add(d,o,a);var g=u(c,r);return m(i),g}function ye(e,t){var r=[];h(t),e=b(r,e,"s");var i,o=0|n._crypto_core_ed25519_scalarbytes();e.length!==o&&v(r,"invalid s length"),i=f(e),r.push(i);var s=new p(0|n._crypto_core_ed25519_scalarbytes()),a=s.address;r.push(a),n._crypto_core_ed25519_scalar_complement(a,i);var l=u(s,t);return m(r),l}function ve(e,t){var r=[];h(t),e=b(r,e,"s");var i,o=0|n._crypto_core_ed25519_scalarbytes();e.length!==o&&v(r,"invalid s length"),i=f(e),r.push(i);var s=new p(0|n._crypto_core_ed25519_scalarbytes()),a=s.address;if(r.push(a),0==(0|n._crypto_core_ed25519_scalar_invert(a,i))){var l=u(s,t);return m(r),l}y(r,"invalid reciprocate")}function Ae(e,t,r){var i=[];h(r),e=b(i,e,"x");var o,s=0|n._crypto_core_ed25519_scalarbytes();e.length!==s&&v(i,"invalid x length"),o=f(e),i.push(o),t=b(i,t,"y");var a,l=0|n._crypto_core_ed25519_scalarbytes();t.length!==l&&v(i,"invalid y length"),a=f(t),i.push(a);var c=new p(0|n._crypto_core_ed25519_scalarbytes()),d=c.address;i.push(d),n._crypto_core_ed25519_scalar_mul(d,o,a);var g=u(c,r);return m(i),g}function be(e,t){var r=[];h(t),e=b(r,e,"s");var i,o=0|n._crypto_core_ed25519_scalarbytes();e.length!==o&&v(r,"invalid s length"),i=f(e),r.push(i);var s=new p(0|n._crypto_core_ed25519_scalarbytes()),a=s.address;r.push(a),n._crypto_core_ed25519_scalar_negate(a,i);var l=u(s,t);return m(r),l}function we(e){var t=[];h(e);var r=new p(0|n._crypto_core_ed25519_scalarbytes()),i=r.address;t.push(i),n._crypto_core_ed25519_scalar_random(i);var o=u(r,e);return m(t),o}function Se(e,t){var r=[];h(t),e=b(r,e,"sample");var i,o=0|n._crypto_core_ed25519_nonreducedscalarbytes();e.length!==o&&v(r,"invalid sample length"),i=f(e),r.push(i);var s=new p(0|n._crypto_core_ed25519_scalarbytes()),a=s.address;r.push(a),n._crypto_core_ed25519_scalar_reduce(a,i);var l=u(s,t);return m(r),l}function Ce(e,t,r){var i=[];h(r),e=b(i,e,"x");var o,s=0|n._crypto_core_ed25519_scalarbytes();e.length!==s&&v(i,"invalid x length"),o=f(e),i.push(o),t=b(i,t,"y");var a,l=0|n._crypto_core_ed25519_scalarbytes();t.length!==l&&v(i,"invalid y length"),a=f(t),i.push(a);var c=new p(0|n._crypto_core_ed25519_scalarbytes()),d=c.address;i.push(d),n._crypto_core_ed25519_scalar_sub(d,o,a);var g=u(c,r);return m(i),g}function Ee(e,t,r){var i=[];h(r),e=b(i,e,"p");var o,s=0|n._crypto_core_ed25519_bytes();e.length!==s&&v(i,"invalid p length"),o=f(e),i.push(o),t=b(i,t,"q");var a,l=0|n._crypto_core_ed25519_bytes();t.length!==l&&v(i,"invalid q length"),a=f(t),i.push(a);var c=new p(0|n._crypto_core_ed25519_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_core_ed25519_sub(d,o,a))){var g=u(c,r);return m(i),g}y(i,"input is an invalid element")}function Ie(e,t,r,i){var o=[];h(i),e=b(o,e,"input");var s,a=0|n._crypto_core_hchacha20_inputbytes();e.length!==a&&v(o,"invalid input length"),s=f(e),o.push(s),t=b(o,t,"privateKey");var l,c=0|n._crypto_core_hchacha20_keybytes();t.length!==c&&v(o,"invalid privateKey length"),l=f(t),o.push(l);var d=null;null!=r&&(d=f(r=b(o,r,"constant")),r.length,o.push(d));var g=new p(0|n._crypto_core_hchacha20_outputbytes()),A=g.address;if(o.push(A),0==(0|n._crypto_core_hchacha20(A,s,l,d))){var w=u(g,i);return m(o),w}y(o,"invalid usage")}function _e(e,t,r,i){var o=[];h(i),e=b(o,e,"input");var s,a=0|n._crypto_core_hsalsa20_inputbytes();e.length!==a&&v(o,"invalid input length"),s=f(e),o.push(s),t=b(o,t,"privateKey");var l,c=0|n._crypto_core_hsalsa20_keybytes();t.length!==c&&v(o,"invalid privateKey length"),l=f(t),o.push(l);var d=null;null!=r&&(d=f(r=b(o,r,"constant")),r.length,o.push(d));var g=new p(0|n._crypto_core_hsalsa20_outputbytes()),A=g.address;if(o.push(A),0==(0|n._crypto_core_hsalsa20(A,s,l,d))){var w=u(g,i);return m(o),w}y(o,"invalid usage")}function xe(e,t,r){var i=[];h(r),e=b(i,e,"p");var o,s=0|n._crypto_core_ristretto255_bytes();e.length!==s&&v(i,"invalid p length"),o=f(e),i.push(o),t=b(i,t,"q");var a,l=0|n._crypto_core_ristretto255_bytes();t.length!==l&&v(i,"invalid q length"),a=f(t),i.push(a);var c=new p(0|n._crypto_core_ristretto255_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_core_ristretto255_add(d,o,a))){var g=u(c,r);return m(i),g}y(i,"input is an invalid element")}function Pe(e,t){var r=[];h(t);var i=f(e=b(r,e,"r"));e.length,r.push(i);var o=new p(0|n._crypto_core_ristretto255_bytes()),s=o.address;if(r.push(s),0==(0|n._crypto_core_ristretto255_from_hash(s,i))){var a=u(o,t);return m(r),a}y(r,"invalid usage")}function ke(e,t){var r=[];h(t),e=b(r,e,"repr");var i,o=0|n._crypto_core_ristretto255_bytes();e.length!==o&&v(r,"invalid repr length"),i=f(e),r.push(i);var s=1==(0|n._crypto_core_ristretto255_is_valid_point(i));return m(r),s}function Be(e){var t=[];h(e);var r=new p(0|n._crypto_core_ristretto255_bytes()),i=r.address;t.push(i),n._crypto_core_ristretto255_random(i);var o=u(r,e);return m(t),o}function Oe(e,t,r){var i=[];h(r),e=b(i,e,"x");var o,s=0|n._crypto_core_ristretto255_scalarbytes();e.length!==s&&v(i,"invalid x length"),o=f(e),i.push(o),t=b(i,t,"y");var a,l=0|n._crypto_core_ristretto255_scalarbytes();t.length!==l&&v(i,"invalid y length"),a=f(t),i.push(a);var c=new p(0|n._crypto_core_ristretto255_scalarbytes()),d=c.address;i.push(d),n._crypto_core_ristretto255_scalar_add(d,o,a);var g=u(c,r);return m(i),g}function Ne(e,t){var r=[];h(t),e=b(r,e,"s");var i,o=0|n._crypto_core_ristretto255_scalarbytes();e.length!==o&&v(r,"invalid s length"),i=f(e),r.push(i);var s=new p(0|n._crypto_core_ristretto255_scalarbytes()),a=s.address;r.push(a),n._crypto_core_ristretto255_scalar_complement(a,i);var l=u(s,t);return m(r),l}function De(e,t){var r=[];h(t),e=b(r,e,"s");var i,o=0|n._crypto_core_ristretto255_scalarbytes();e.length!==o&&v(r,"invalid s length"),i=f(e),r.push(i);var s=new p(0|n._crypto_core_ristretto255_scalarbytes()),a=s.address;if(r.push(a),0==(0|n._crypto_core_ristretto255_scalar_invert(a,i))){var l=u(s,t);return m(r),l}y(r,"invalid reciprocate")}function je(e,t,r){var i=[];h(r),e=b(i,e,"x");var o,s=0|n._crypto_core_ristretto255_scalarbytes();e.length!==s&&v(i,"invalid x length"),o=f(e),i.push(o),t=b(i,t,"y");var a,l=0|n._crypto_core_ristretto255_scalarbytes();t.length!==l&&v(i,"invalid y length"),a=f(t),i.push(a);var c=new p(0|n._crypto_core_ristretto255_scalarbytes()),d=c.address;i.push(d),n._crypto_core_ristretto255_scalar_mul(d,o,a);var g=u(c,r);return m(i),g}function Te(e,t){var r=[];h(t),e=b(r,e,"s");var i,o=0|n._crypto_core_ristretto255_scalarbytes();e.length!==o&&v(r,"invalid s length"),i=f(e),r.push(i);var s=new p(0|n._crypto_core_ristretto255_scalarbytes()),a=s.address;r.push(a),n._crypto_core_ristretto255_scalar_negate(a,i);var l=u(s,t);return m(r),l}function Me(e){var t=[];h(e);var r=new p(0|n._crypto_core_ristretto255_scalarbytes()),i=r.address;t.push(i),n._crypto_core_ristretto255_scalar_random(i);var o=u(r,e);return m(t),o}function Fe(e,t){var r=[];h(t),e=b(r,e,"sample");var i,o=0|n._crypto_core_ristretto255_nonreducedscalarbytes();e.length!==o&&v(r,"invalid sample length"),i=f(e),r.push(i);var s=new p(0|n._crypto_core_ristretto255_scalarbytes()),a=s.address;r.push(a),n._crypto_core_ristretto255_scalar_reduce(a,i);var l=u(s,t);return m(r),l}function Re(e,t,r){var i=[];h(r),e=b(i,e,"x");var o,s=0|n._crypto_core_ristretto255_scalarbytes();e.length!==s&&v(i,"invalid x length"),o=f(e),i.push(o),t=b(i,t,"y");var a,l=0|n._crypto_core_ristretto255_scalarbytes();t.length!==l&&v(i,"invalid y length"),a=f(t),i.push(a);var c=new p(0|n._crypto_core_ristretto255_scalarbytes()),d=c.address;i.push(d),n._crypto_core_ristretto255_scalar_sub(d,o,a);var g=u(c,r);return m(i),g}function Le(e,t,r){var i=[];h(r),e=b(i,e,"p");var o,s=0|n._crypto_core_ristretto255_bytes();e.length!==s&&v(i,"invalid p length"),o=f(e),i.push(o),t=b(i,t,"q");var a,l=0|n._crypto_core_ristretto255_bytes();t.length!==l&&v(i,"invalid q length"),a=f(t),i.push(a);var c=new p(0|n._crypto_core_ristretto255_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_core_ristretto255_sub(d,o,a))){var g=u(c,r);return m(i),g}y(i,"input is an invalid element")}function Qe(e,t,r,i){var o=[];h(i),A(o,e,"hash_length"),("number"!=typeof e||(0|e)!==e||e<0)&&v(o,"hash_length must be an unsigned integer");var s=f(t=b(o,t,"message")),a=t.length;o.push(s);var l=null,c=0;null!=r&&(l=f(r=b(o,r,"key")),c=r.length,o.push(l));var d=new p(e|=0),g=d.address;if(o.push(g),0==(0|n._crypto_generichash(g,e,s,a,0,l,c))){var w=u(d,i);return m(o),w}y(o,"invalid usage")}function Ue(e,t,r,i,o){var s=[];h(o),A(s,e,"subkey_len"),("number"!=typeof e||(0|e)!==e||e<0)&&v(s,"subkey_len must be an unsigned integer");var a=null,l=0;null!=t&&(a=f(t=b(s,t,"key")),l=t.length,s.push(a)),r=b(s,r,"id");var c,d=0|n._crypto_generichash_blake2b_saltbytes();r.length!==d&&v(s,"invalid id length"),c=f(r),s.push(c),i=b(s,i,"ctx");var g,w=0|n._crypto_generichash_blake2b_personalbytes();i.length!==w&&v(s,"invalid ctx length"),g=f(i),s.push(g);var S=new p(0|e),C=S.address;if(s.push(C),0==(0|n._crypto_generichash_blake2b_salt_personal(C,e,null,0,0,a,l,c,g))){var E=u(S,o);return m(s),E}y(s,"invalid usage")}function Ve(e,t,r){var i=[];h(r),A(i,e,"state_address"),A(i,t,"hash_length"),("number"!=typeof t||(0|t)!==t||t<0)&&v(i,"hash_length must be an unsigned integer");var o=new p(t|=0),s=o.address;if(i.push(s),0==(0|n._crypto_generichash_final(e,s,t))){var a=(n._free(e),u(o,r));return m(i),a}y(i,"invalid usage")}function Ke(e,t,r){var i=[];h(r);var o=null,s=0;null!=e&&(o=f(e=b(i,e,"key")),s=e.length,i.push(o)),A(i,t,"hash_length"),("number"!=typeof t||(0|t)!==t||t<0)&&v(i,"hash_length must be an unsigned integer");var a=new p(357).address;if(0==(0|n._crypto_generichash_init(a,o,s,t))){var l=a;return m(i),l}y(i,"invalid usage")}function He(e){var t=[];h(e);var r=new p(0|n._crypto_generichash_keybytes()),i=r.address;t.push(i),n._crypto_generichash_keygen(i);var o=u(r,e);return m(t),o}function Ge(e,t,r){var i=[];h(r),A(i,e,"state_address");var o=f(t=b(i,t,"message_chunk")),s=t.length;i.push(o),0!=(0|n._crypto_generichash_update(e,o,s))&&y(i,"invalid usage"),m(i)}function Ye(e,t){var r=[];h(t);var i=f(e=b(r,e,"message")),o=e.length;r.push(i);var s=new p(0|n._crypto_hash_bytes()),a=s.address;if(r.push(a),0==(0|n._crypto_hash(a,i,o,0))){var l=u(s,t);return m(r),l}y(r,"invalid usage")}function ze(e,t){var r=[];h(t);var i=f(e=b(r,e,"message")),o=e.length;r.push(i);var s=new p(0|n._crypto_hash_sha256_bytes()),a=s.address;if(r.push(a),0==(0|n._crypto_hash_sha256(a,i,o,0))){var l=u(s,t);return m(r),l}y(r,"invalid usage")}function Ze(e,t){var r=[];h(t),A(r,e,"state_address");var i=new p(0|n._crypto_hash_sha256_bytes()),o=i.address;if(r.push(o),0==(0|n._crypto_hash_sha256_final(e,o))){var s=(n._free(e),u(i,t));return m(r),s}y(r,"invalid usage")}function We(e){var t=[];h(e);var r=new p(104).address;if(0==(0|n._crypto_hash_sha256_init(r))){var i=r;return m(t),i}y(t,"invalid usage")}function qe(e,t,r){var i=[];h(r),A(i,e,"state_address");var o=f(t=b(i,t,"message_chunk")),s=t.length;i.push(o),0!=(0|n._crypto_hash_sha256_update(e,o,s))&&y(i,"invalid usage"),m(i)}function Je(e,t){var r=[];h(t);var i=f(e=b(r,e,"message")),o=e.length;r.push(i);var s=new p(0|n._crypto_hash_sha512_bytes()),a=s.address;if(r.push(a),0==(0|n._crypto_hash_sha512(a,i,o,0))){var l=u(s,t);return m(r),l}y(r,"invalid usage")}function Xe(e,t){var r=[];h(t),A(r,e,"state_address");var i=new p(0|n._crypto_hash_sha512_bytes()),o=i.address;if(r.push(o),0==(0|n._crypto_hash_sha512_final(e,o))){var s=(n._free(e),u(i,t));return m(r),s}y(r,"invalid usage")}function $e(e){var t=[];h(e);var r=new p(208).address;if(0==(0|n._crypto_hash_sha512_init(r))){var i=r;return m(t),i}y(t,"invalid usage")}function et(e,t,r){var i=[];h(r),A(i,e,"state_address");var o=f(t=b(i,t,"message_chunk")),s=t.length;i.push(o),0!=(0|n._crypto_hash_sha512_update(e,o,s))&&y(i,"invalid usage"),m(i)}function tt(e,t,r,o,s){var a=[];h(s),A(a,e,"subkey_len"),("number"!=typeof e||(0|e)!==e||e<0)&&v(a,"subkey_len must be an unsigned integer"),A(a,t,"subkey_id"),("number"!=typeof t||(0|t)!==t||t<0)&&v(a,"subkey_id must be an unsigned integer"),"string"!=typeof r&&v(a,"ctx must be a string"),r=i(r+"\0"),null!=c&&r.length-1!==c&&v(a,"invalid ctx length");var l=f(r),c=r.length-1;a.push(l),o=b(a,o,"key");var d,g=0|n._crypto_kdf_keybytes();o.length!==g&&v(a,"invalid key length"),d=f(o),a.push(d);var y=new p(0|e),w=y.address;a.push(w),n._crypto_kdf_derive_from_key(w,e,t,t>>>24>>>8,l,d);var S=u(y,s);return m(a),S}function nt(e){var t=[];h(e);var r=new p(0|n._crypto_kdf_keybytes()),i=r.address;t.push(i),n._crypto_kdf_keygen(i);var o=u(r,e);return m(t),o}function rt(e,t,r,i){var o=[];h(i),e=b(o,e,"clientPublicKey");var s,a=0|n._crypto_kx_publickeybytes();e.length!==a&&v(o,"invalid clientPublicKey length"),s=f(e),o.push(s),t=b(o,t,"clientSecretKey");var l,c=0|n._crypto_kx_secretkeybytes();t.length!==c&&v(o,"invalid clientSecretKey length"),l=f(t),o.push(l),r=b(o,r,"serverPublicKey");var d,g=0|n._crypto_kx_publickeybytes();r.length!==g&&v(o,"invalid serverPublicKey length"),d=f(r),o.push(d);var A=new p(0|n._crypto_kx_sessionkeybytes()),w=A.address;o.push(w);var S=new p(0|n._crypto_kx_sessionkeybytes()),C=S.address;if(o.push(C),0==(0|n._crypto_kx_client_session_keys(w,C,s,l,d))){var E=u({sharedRx:A,sharedTx:S},i);return m(o),E}y(o,"invalid usage")}function it(e){var t=[];h(e);var r=new p(0|n._crypto_kx_publickeybytes()),i=r.address;t.push(i);var o=new p(0|n._crypto_kx_secretkeybytes()),s=o.address;if(t.push(s),0==(0|n._crypto_kx_keypair(i,s))){var a={publicKey:u(r,e),privateKey:u(o,e),keyType:"x25519"};return m(t),a}y(t,"internal error")}function ot(e,t){var r=[];h(t),e=b(r,e,"seed");var i,o=0|n._crypto_kx_seedbytes();e.length!==o&&v(r,"invalid seed length"),i=f(e),r.push(i);var s=new p(0|n._crypto_kx_publickeybytes()),a=s.address;r.push(a);var l=new p(0|n._crypto_kx_secretkeybytes()),c=l.address;if(r.push(c),0==(0|n._crypto_kx_seed_keypair(a,c,i))){var d={publicKey:u(s,t),privateKey:u(l,t),keyType:"x25519"};return m(r),d}y(r,"internal error")}function st(e,t,r,i){var o=[];h(i),e=b(o,e,"serverPublicKey");var s,a=0|n._crypto_kx_publickeybytes();e.length!==a&&v(o,"invalid serverPublicKey length"),s=f(e),o.push(s),t=b(o,t,"serverSecretKey");var l,c=0|n._crypto_kx_secretkeybytes();t.length!==c&&v(o,"invalid serverSecretKey length"),l=f(t),o.push(l),r=b(o,r,"clientPublicKey");var d,g=0|n._crypto_kx_publickeybytes();r.length!==g&&v(o,"invalid clientPublicKey length"),d=f(r),o.push(d);var A=new p(0|n._crypto_kx_sessionkeybytes()),w=A.address;o.push(w);var S=new p(0|n._crypto_kx_sessionkeybytes()),C=S.address;if(o.push(C),0==(0|n._crypto_kx_server_session_keys(w,C,s,l,d))){var E=u({sharedRx:A,sharedTx:S},i);return m(o),E}y(o,"invalid usage")}function at(e,t,r){var i=[];h(r);var o=f(e=b(i,e,"message")),s=e.length;i.push(o),t=b(i,t,"key");var a,l=0|n._crypto_onetimeauth_keybytes();t.length!==l&&v(i,"invalid key length"),a=f(t),i.push(a);var c=new p(0|n._crypto_onetimeauth_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_onetimeauth(d,o,s,0,a))){var g=u(c,r);return m(i),g}y(i,"invalid usage")}function lt(e,t){var r=[];h(t),A(r,e,"state_address");var i=new p(0|n._crypto_onetimeauth_bytes()),o=i.address;if(r.push(o),0==(0|n._crypto_onetimeauth_final(e,o))){var s=(n._free(e),u(i,t));return m(r),s}y(r,"invalid usage")}function ct(e,t){var r=[];h(t);var i=null;null!=e&&(i=f(e=b(r,e,"key")),e.length,r.push(i));var o=new p(144).address;if(0==(0|n._crypto_onetimeauth_init(o,i))){var s=o;return m(r),s}y(r,"invalid usage")}function ut(e){var t=[];h(e);var r=new p(0|n._crypto_onetimeauth_keybytes()),i=r.address;t.push(i),n._crypto_onetimeauth_keygen(i);var o=u(r,e);return m(t),o}function dt(e,t,r){var i=[];h(r),A(i,e,"state_address");var o=f(t=b(i,t,"message_chunk")),s=t.length;i.push(o),0!=(0|n._crypto_onetimeauth_update(e,o,s))&&y(i,"invalid usage"),m(i)}function ht(e,t,r){var i=[];e=b(i,e,"hash");var o,s=0|n._crypto_onetimeauth_bytes();e.length!==s&&v(i,"invalid hash length"),o=f(e),i.push(o);var a=f(t=b(i,t,"message")),l=t.length;i.push(a),r=b(i,r,"key");var c,u=0|n._crypto_onetimeauth_keybytes();r.length!==u&&v(i,"invalid key length"),c=f(r),i.push(c);var d=0==(0|n._crypto_onetimeauth_verify(o,a,l,0,c));return m(i),d}function pt(e,t,r,i,o,s,a){var l=[];h(a),A(l,e,"keyLength"),("number"!=typeof e||(0|e)!==e||e<0)&&v(l,"keyLength must be an unsigned integer");var c=f(t=b(l,t,"password")),d=t.length;l.push(c),r=b(l,r,"salt");var g,w=0|n._crypto_pwhash_saltbytes();r.length!==w&&v(l,"invalid salt length"),g=f(r),l.push(g),A(l,i,"opsLimit"),("number"!=typeof i||(0|i)!==i||i<0)&&v(l,"opsLimit must be an unsigned integer"),A(l,o,"memLimit"),("number"!=typeof o||(0|o)!==o||o<0)&&v(l,"memLimit must be an unsigned integer"),A(l,s,"algorithm"),("number"!=typeof s||(0|s)!==s||s<0)&&v(l,"algorithm must be an unsigned integer");var S=new p(0|e),C=S.address;if(l.push(C),0==(0|n._crypto_pwhash(C,e,0,c,d,0,g,i,0,o,s))){var E=u(S,a);return m(l),E}y(l,"invalid usage")}function ft(e,t,r,i,o,s){var a=[];h(s),A(a,e,"keyLength"),("number"!=typeof e||(0|e)!==e||e<0)&&v(a,"keyLength must be an unsigned integer");var l=f(t=b(a,t,"password")),c=t.length;a.push(l),r=b(a,r,"salt");var d,g=0|n._crypto_pwhash_scryptsalsa208sha256_saltbytes();r.length!==g&&v(a,"invalid salt length"),d=f(r),a.push(d),A(a,i,"opsLimit"),("number"!=typeof i||(0|i)!==i||i<0)&&v(a,"opsLimit must be an unsigned integer"),A(a,o,"memLimit"),("number"!=typeof o||(0|o)!==o||o<0)&&v(a,"memLimit must be an unsigned integer");var w=new p(0|e),S=w.address;if(a.push(S),0==(0|n._crypto_pwhash_scryptsalsa208sha256(S,e,0,l,c,0,d,i,0,o))){var C=u(w,s);return m(a),C}y(a,"invalid usage")}function gt(e,t,r,i,o,s,a){var l=[];h(a);var c=f(e=b(l,e,"password")),d=e.length;l.push(c);var g=f(t=b(l,t,"salt")),w=t.length;l.push(g),A(l,r,"opsLimit"),("number"!=typeof r||(0|r)!==r||r<0)&&v(l,"opsLimit must be an unsigned integer"),A(l,i,"r"),("number"!=typeof i||(0|i)!==i||i<0)&&v(l,"r must be an unsigned integer"),A(l,o,"p"),("number"!=typeof o||(0|o)!==o||o<0)&&v(l,"p must be an unsigned integer"),A(l,s,"keyLength"),("number"!=typeof s||(0|s)!==s||s<0)&&v(l,"keyLength must be an unsigned integer");var S=new p(0|s),C=S.address;if(l.push(C),0==(0|n._crypto_pwhash_scryptsalsa208sha256_ll(c,d,g,w,r,0,i,o,C,s))){var E=u(S,a);return m(l),E}y(l,"invalid usage")}function mt(e,t,r,i){var o=[];h(i);var s=f(e=b(o,e,"password")),a=e.length;o.push(s),A(o,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&v(o,"opsLimit must be an unsigned integer"),A(o,r,"memLimit"),("number"!=typeof r||(0|r)!==r||r<0)&&v(o,"memLimit must be an unsigned integer");var l=new p(0|n._crypto_pwhash_scryptsalsa208sha256_strbytes()).address;if(o.push(l),0==(0|n._crypto_pwhash_scryptsalsa208sha256_str(l,s,a,0,t,0,r))){var c=n.UTF8ToString(l);return m(o),c}y(o,"invalid usage")}function yt(e,t,r){var o=[];h(r),"string"!=typeof e&&v(o,"hashed_password must be a string"),e=i(e+"\0"),null!=a&&e.length-1!==a&&v(o,"invalid hashed_password length");var s=f(e),a=e.length-1;o.push(s);var l=f(t=b(o,t,"password")),c=t.length;o.push(l);var u=0==(0|n._crypto_pwhash_scryptsalsa208sha256_str_verify(s,l,c,0));return m(o),u}function vt(e,t,r,i){var o=[];h(i);var s=f(e=b(o,e,"password")),a=e.length;o.push(s),A(o,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&v(o,"opsLimit must be an unsigned integer"),A(o,r,"memLimit"),("number"!=typeof r||(0|r)!==r||r<0)&&v(o,"memLimit must be an unsigned integer");var l=new p(0|n._crypto_pwhash_strbytes()).address;if(o.push(l),0==(0|n._crypto_pwhash_str(l,s,a,0,t,0,r))){var c=n.UTF8ToString(l);return m(o),c}y(o,"invalid usage")}function At(e,t,r,o){var s=[];h(o),"string"!=typeof e&&v(s,"hashed_password must be a string"),e=i(e+"\0"),null!=l&&e.length-1!==l&&v(s,"invalid hashed_password length");var a=f(e),l=e.length-1;s.push(a),A(s,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&v(s,"opsLimit must be an unsigned integer"),A(s,r,"memLimit"),("number"!=typeof r||(0|r)!==r||r<0)&&v(s,"memLimit must be an unsigned integer");var c=0!=(0|n._crypto_pwhash_str_needs_rehash(a,t,0,r));return m(s),c}function bt(e,t,r){var o=[];h(r),"string"!=typeof e&&v(o,"hashed_password must be a string"),e=i(e+"\0"),null!=a&&e.length-1!==a&&v(o,"invalid hashed_password length");var s=f(e),a=e.length-1;o.push(s);var l=f(t=b(o,t,"password")),c=t.length;o.push(l);var u=0==(0|n._crypto_pwhash_str_verify(s,l,c,0));return m(o),u}function wt(e,t,r){var i=[];h(r),e=b(i,e,"privateKey");var o,s=0|n._crypto_scalarmult_scalarbytes();e.length!==s&&v(i,"invalid privateKey length"),o=f(e),i.push(o),t=b(i,t,"publicKey");var a,l=0|n._crypto_scalarmult_bytes();t.length!==l&&v(i,"invalid publicKey length"),a=f(t),i.push(a);var c=new p(0|n._crypto_scalarmult_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_scalarmult(d,o,a))){var g=u(c,r);return m(i),g}y(i,"weak public key")}function St(e,t){var r=[];h(t),e=b(r,e,"privateKey");var i,o=0|n._crypto_scalarmult_scalarbytes();e.length!==o&&v(r,"invalid privateKey length"),i=f(e),r.push(i);var s=new p(0|n._crypto_scalarmult_bytes()),a=s.address;if(r.push(a),0==(0|n._crypto_scalarmult_base(a,i))){var l=u(s,t);return m(r),l}y(r,"unknown error")}function Ct(e,t,r){var i=[];h(r),e=b(i,e,"n");var o,s=0|n._crypto_scalarmult_ed25519_scalarbytes();e.length!==s&&v(i,"invalid n length"),o=f(e),i.push(o),t=b(i,t,"p");var a,l=0|n._crypto_scalarmult_ed25519_bytes();t.length!==l&&v(i,"invalid p length"),a=f(t),i.push(a);var c=new p(0|n._crypto_scalarmult_ed25519_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_scalarmult_ed25519(d,o,a))){var g=u(c,r);return m(i),g}y(i,"invalid point or scalar is 0")}function Et(e,t){var r=[];h(t),e=b(r,e,"scalar");var i,o=0|n._crypto_scalarmult_ed25519_scalarbytes();e.length!==o&&v(r,"invalid scalar length"),i=f(e),r.push(i);var s=new p(0|n._crypto_scalarmult_ed25519_bytes()),a=s.address;if(r.push(a),0==(0|n._crypto_scalarmult_ed25519_base(a,i))){var l=u(s,t);return m(r),l}y(r,"scalar is 0")}function It(e,t){var r=[];h(t),e=b(r,e,"scalar");var i,o=0|n._crypto_scalarmult_ed25519_scalarbytes();e.length!==o&&v(r,"invalid scalar length"),i=f(e),r.push(i);var s=new p(0|n._crypto_scalarmult_ed25519_bytes()),a=s.address;if(r.push(a),0==(0|n._crypto_scalarmult_ed25519_base_noclamp(a,i))){var l=u(s,t);return m(r),l}y(r,"scalar is 0")}function _t(e,t,r){var i=[];h(r),e=b(i,e,"n");var o,s=0|n._crypto_scalarmult_ed25519_scalarbytes();e.length!==s&&v(i,"invalid n length"),o=f(e),i.push(o),t=b(i,t,"p");var a,l=0|n._crypto_scalarmult_ed25519_bytes();t.length!==l&&v(i,"invalid p length"),a=f(t),i.push(a);var c=new p(0|n._crypto_scalarmult_ed25519_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_scalarmult_ed25519_noclamp(d,o,a))){var g=u(c,r);return m(i),g}y(i,"invalid point or scalar is 0")}function xt(e,t,r){var i=[];h(r),e=b(i,e,"scalar");var o,s=0|n._crypto_scalarmult_ristretto255_scalarbytes();e.length!==s&&v(i,"invalid scalar length"),o=f(e),i.push(o),t=b(i,t,"element");var a,l=0|n._crypto_scalarmult_ristretto255_bytes();t.length!==l&&v(i,"invalid element length"),a=f(t),i.push(a);var c=new p(0|n._crypto_scalarmult_ristretto255_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_scalarmult_ristretto255(d,o,a))){var g=u(c,r);return m(i),g}y(i,"result is identity element")}function Pt(e,t){var r=[];h(t),e=b(r,e,"scalar");var i,o=0|n._crypto_core_ristretto255_scalarbytes();e.length!==o&&v(r,"invalid scalar length"),i=f(e),r.push(i);var s=new p(0|n._crypto_core_ristretto255_bytes()),a=s.address;if(r.push(a),0==(0|n._crypto_scalarmult_ristretto255_base(a,i))){var l=u(s,t);return m(r),l}y(r,"scalar is 0")}function kt(e,t,r,i){var o=[];h(i);var s=f(e=b(o,e,"message")),a=e.length;o.push(s),t=b(o,t,"nonce");var l,c=0|n._crypto_secretbox_noncebytes();t.length!==c&&v(o,"invalid nonce length"),l=f(t),o.push(l),r=b(o,r,"key");var d,g=0|n._crypto_secretbox_keybytes();r.length!==g&&v(o,"invalid key length"),d=f(r),o.push(d);var A=new p(0|a),w=A.address;o.push(w);var S=new p(0|n._crypto_secretbox_macbytes()),C=S.address;if(o.push(C),0==(0|n._crypto_secretbox_detached(w,C,s,a,0,l,d))){var E=u({mac:S,cipher:A},i);return m(o),E}y(o,"invalid usage")}function Bt(e,t,r,i){var o=[];h(i);var s=f(e=b(o,e,"message")),a=e.length;o.push(s),t=b(o,t,"nonce");var l,c=0|n._crypto_secretbox_noncebytes();t.length!==c&&v(o,"invalid nonce length"),l=f(t),o.push(l),r=b(o,r,"key");var d,g=0|n._crypto_secretbox_keybytes();r.length!==g&&v(o,"invalid key length"),d=f(r),o.push(d);var A=new p(a+n._crypto_secretbox_macbytes()|0),w=A.address;if(o.push(w),0==(0|n._crypto_secretbox_easy(w,s,a,0,l,d))){var S=u(A,i);return m(o),S}y(o,"invalid usage")}function Ot(e){var t=[];h(e);var r=new p(0|n._crypto_secretbox_keybytes()),i=r.address;t.push(i),n._crypto_secretbox_keygen(i);var o=u(r,e);return m(t),o}function Nt(e,t,r,i,o){var s=[];h(o);var a=f(e=b(s,e,"ciphertext")),l=e.length;s.push(a),t=b(s,t,"mac");var c,d=0|n._crypto_secretbox_macbytes();t.length!==d&&v(s,"invalid mac length"),c=f(t),s.push(c),r=b(s,r,"nonce");var g,A=0|n._crypto_secretbox_noncebytes();r.length!==A&&v(s,"invalid nonce length"),g=f(r),s.push(g),i=b(s,i,"key");var w,S=0|n._crypto_secretbox_keybytes();i.length!==S&&v(s,"invalid key length"),w=f(i),s.push(w);var C=new p(0|l),E=C.address;if(s.push(E),0==(0|n._crypto_secretbox_open_detached(E,a,c,l,0,g,w))){var I=u(C,o);return m(s),I}y(s,"wrong secret key for the given ciphertext")}function Dt(e,t,r,i){var o=[];h(i),e=b(o,e,"ciphertext");var s,a=n._crypto_secretbox_macbytes(),l=e.length;l<a&&v(o,"ciphertext is too short"),s=f(e),o.push(s),t=b(o,t,"nonce");var c,d=0|n._crypto_secretbox_noncebytes();t.length!==d&&v(o,"invalid nonce length"),c=f(t),o.push(c),r=b(o,r,"key");var g,A=0|n._crypto_secretbox_keybytes();r.length!==A&&v(o,"invalid key length"),g=f(r),o.push(g);var w=new p(l-n._crypto_secretbox_macbytes()|0),S=w.address;if(o.push(S),0==(0|n._crypto_secretbox_open_easy(S,s,l,0,c,g))){var C=u(w,i);return m(o),C}y(o,"wrong secret key for the given ciphertext")}function jt(e,t,r){var i=[];h(r),e=b(i,e,"header");var o,s=0|n._crypto_secretstream_xchacha20poly1305_headerbytes();e.length!==s&&v(i,"invalid header length"),o=f(e),i.push(o),t=b(i,t,"key");var a,l=0|n._crypto_secretstream_xchacha20poly1305_keybytes();t.length!==l&&v(i,"invalid key length"),a=f(t),i.push(a);var c=new p(52).address;if(0==(0|n._crypto_secretstream_xchacha20poly1305_init_pull(c,o,a))){var u=c;return m(i),u}y(i,"invalid usage")}function Tt(e,t){var r=[];h(t),e=b(r,e,"key");var i,o=0|n._crypto_secretstream_xchacha20poly1305_keybytes();e.length!==o&&v(r,"invalid key length"),i=f(e),r.push(i);var s=new p(52).address,a=new p(0|n._crypto_secretstream_xchacha20poly1305_headerbytes()),l=a.address;if(r.push(l),0==(0|n._crypto_secretstream_xchacha20poly1305_init_push(s,l,i))){var c={state:s,header:u(a,t)};return m(r),c}y(r,"invalid usage")}function Mt(e){var t=[];h(e);var r=new p(0|n._crypto_secretstream_xchacha20poly1305_keybytes()),i=r.address;t.push(i),n._crypto_secretstream_xchacha20poly1305_keygen(i);var o=u(r,e);return m(t),o}function Ft(e,t,r,i){var o=[];h(i),A(o,e,"state_address"),t=b(o,t,"cipher");var s,a=n._crypto_secretstream_xchacha20poly1305_abytes(),l=t.length;l<a&&v(o,"cipher is too short"),s=f(t),o.push(s);var c=null,d=0;null!=r&&(c=f(r=b(o,r,"ad")),d=r.length,o.push(c));var y=new p(l-n._crypto_secretstream_xchacha20poly1305_abytes()|0),w=y.address;o.push(w);var S,C=(S=g(1),o.push(S),(C=0===n._crypto_secretstream_xchacha20poly1305_pull(e,w,0,S,s,l,0,c,d)&&{tag:n.HEAPU8[S],message:y})&&{message:u(C.message,i),tag:C.tag});return m(o),C}function Rt(e,t,r,i,o){var s=[];h(o),A(s,e,"state_address");var a=f(t=b(s,t,"message_chunk")),l=t.length;s.push(a);var c=null,d=0;null!=r&&(c=f(r=b(s,r,"ad")),d=r.length,s.push(c)),A(s,i,"tag"),("number"!=typeof i||(0|i)!==i||i<0)&&v(s,"tag must be an unsigned integer");var g=new p(l+n._crypto_secretstream_xchacha20poly1305_abytes()|0),w=g.address;if(s.push(w),0==(0|n._crypto_secretstream_xchacha20poly1305_push(e,w,0,a,l,0,c,d,0,i))){var S=u(g,o);return m(s),S}y(s,"invalid usage")}function Lt(e,t){var r=[];return h(t),A(r,e,"state_address"),n._crypto_secretstream_xchacha20poly1305_rekey(e),m(r),!0}function Qt(e,t,r){var i=[];h(r);var o=f(e=b(i,e,"message")),s=e.length;i.push(o),t=b(i,t,"key");var a,l=0|n._crypto_shorthash_keybytes();t.length!==l&&v(i,"invalid key length"),a=f(t),i.push(a);var c=new p(0|n._crypto_shorthash_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_shorthash(d,o,s,0,a))){var g=u(c,r);return m(i),g}y(i,"invalid usage")}function Ut(e){var t=[];h(e);var r=new p(0|n._crypto_shorthash_keybytes()),i=r.address;t.push(i),n._crypto_shorthash_keygen(i);var o=u(r,e);return m(t),o}function Vt(e,t,r){var i=[];h(r);var o=f(e=b(i,e,"message")),s=e.length;i.push(o),t=b(i,t,"key");var a,l=0|n._crypto_shorthash_siphashx24_keybytes();t.length!==l&&v(i,"invalid key length"),a=f(t),i.push(a);var c=new p(0|n._crypto_shorthash_siphashx24_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_shorthash_siphashx24(d,o,s,0,a))){var g=u(c,r);return m(i),g}y(i,"invalid usage")}function Kt(e,t,r){var i=[];h(r);var o=f(e=b(i,e,"message")),s=e.length;i.push(o),t=b(i,t,"privateKey");var a,l=0|n._crypto_sign_secretkeybytes();t.length!==l&&v(i,"invalid privateKey length"),a=f(t),i.push(a);var c=new p(e.length+n._crypto_sign_bytes()|0),d=c.address;if(i.push(d),0==(0|n._crypto_sign(d,null,o,s,0,a))){var g=u(c,r);return m(i),g}y(i,"invalid usage")}function Ht(e,t,r){var i=[];h(r);var o=f(e=b(i,e,"message")),s=e.length;i.push(o),t=b(i,t,"privateKey");var a,l=0|n._crypto_sign_secretkeybytes();t.length!==l&&v(i,"invalid privateKey length"),a=f(t),i.push(a);var c=new p(0|n._crypto_sign_bytes()),d=c.address;if(i.push(d),0==(0|n._crypto_sign_detached(d,null,o,s,0,a))){var g=u(c,r);return m(i),g}y(i,"invalid usage")}function Gt(e,t){var r=[];h(t),e=b(r,e,"edPk");var i,o=0|n._crypto_sign_publickeybytes();e.length!==o&&v(r,"invalid edPk length"),i=f(e),r.push(i);var s=new p(0|n._crypto_scalarmult_scalarbytes()),a=s.address;if(r.push(a),0==(0|n._crypto_sign_ed25519_pk_to_curve25519(a,i))){var l=u(s,t);return m(r),l}y(r,"invalid key")}function Yt(e,t){var r=[];h(t),e=b(r,e,"edSk");var i,o=0|n._crypto_sign_secretkeybytes();e.length!==o&&v(r,"invalid edSk length"),i=f(e),r.push(i);var s=new p(0|n._crypto_scalarmult_scalarbytes()),a=s.address;if(r.push(a),0==(0|n._crypto_sign_ed25519_sk_to_curve25519(a,i))){var l=u(s,t);return m(r),l}y(r,"invalid key")}function zt(e,t){var r=[];h(t),e=b(r,e,"privateKey");var i,o=0|n._crypto_sign_secretkeybytes();e.length!==o&&v(r,"invalid privateKey length"),i=f(e),r.push(i);var s=new p(0|n._crypto_sign_publickeybytes()),a=s.address;if(r.push(a),0==(0|n._crypto_sign_ed25519_sk_to_pk(a,i))){var l=u(s,t);return m(r),l}y(r,"invalid key")}function Zt(e,t){var r=[];h(t),e=b(r,e,"privateKey");var i,o=0|n._crypto_sign_secretkeybytes();e.length!==o&&v(r,"invalid privateKey length"),i=f(e),r.push(i);var s=new p(0|n._crypto_sign_seedbytes()),a=s.address;if(r.push(a),0==(0|n._crypto_sign_ed25519_sk_to_seed(a,i))){var l=u(s,t);return m(r),l}y(r,"invalid key")}function Wt(e,t,r){var i=[];h(r),A(i,e,"state_address"),t=b(i,t,"privateKey");var o,s=0|n._crypto_sign_secretkeybytes();t.length!==s&&v(i,"invalid privateKey length"),o=f(t),i.push(o);var a=new p(0|n._crypto_sign_bytes()),l=a.address;if(i.push(l),0==(0|n._crypto_sign_final_create(e,l,null,o))){var c=(n._free(e),u(a,r));return m(i),c}y(i,"invalid usage")}function qt(e,t,r,i){var o=[];h(i),A(o,e,"state_address"),t=b(o,t,"signature");var s,a=0|n._crypto_sign_bytes();t.length!==a&&v(o,"invalid signature length"),s=f(t),o.push(s),r=b(o,r,"publicKey");var l,c=0|n._crypto_sign_publickeybytes();r.length!==c&&v(o,"invalid publicKey length"),l=f(r),o.push(l);var u=0==(0|n._crypto_sign_final_verify(e,s,l));return m(o),u}function Jt(e){var t=[];h(e);var r=new p(208).address;if(0==(0|n._crypto_sign_init(r))){var i=r;return m(t),i}y(t,"internal error")}function Xt(e){var t=[];h(e);var r=new p(0|n._crypto_sign_publickeybytes()),i=r.address;t.push(i);var o=new p(0|n._crypto_sign_secretkeybytes()),s=o.address;if(t.push(s),0==(0|n._crypto_sign_keypair(i,s))){var a={publicKey:u(r,e),privateKey:u(o,e),keyType:"ed25519"};return m(t),a}y(t,"internal error")}function $t(e,t,r){var i=[];h(r),e=b(i,e,"signedMessage");var o,s=n._crypto_sign_bytes(),a=e.length;a<s&&v(i,"signedMessage is too short"),o=f(e),i.push(o),t=b(i,t,"publicKey");var l,c=0|n._crypto_sign_publickeybytes();t.length!==c&&v(i,"invalid publicKey length"),l=f(t),i.push(l);var d=new p(a-n._crypto_sign_bytes()|0),g=d.address;if(i.push(g),0==(0|n._crypto_sign_open(g,null,o,a,0,l))){var A=u(d,r);return m(i),A}y(i,"incorrect signature for the given public key")}function en(e,t){var r=[];h(t),e=b(r,e,"seed");var i,o=0|n._crypto_sign_seedbytes();e.length!==o&&v(r,"invalid seed length"),i=f(e),r.push(i);var s=new p(0|n._crypto_sign_publickeybytes()),a=s.address;r.push(a);var l=new p(0|n._crypto_sign_secretkeybytes()),c=l.address;if(r.push(c),0==(0|n._crypto_sign_seed_keypair(a,c,i))){var d={publicKey:u(s,t),privateKey:u(l,t),keyType:"ed25519"};return m(r),d}y(r,"invalid usage")}function tn(e,t,r){var i=[];h(r),A(i,e,"state_address");var o=f(t=b(i,t,"message_chunk")),s=t.length;i.push(o),0!=(0|n._crypto_sign_update(e,o,s,0))&&y(i,"invalid usage"),m(i)}function nn(e,t,r){var i=[];e=b(i,e,"signature");var o,s=0|n._crypto_sign_bytes();e.length!==s&&v(i,"invalid signature length"),o=f(e),i.push(o);var a=f(t=b(i,t,"message")),l=t.length;i.push(a),r=b(i,r,"publicKey");var c,u=0|n._crypto_sign_publickeybytes();r.length!==u&&v(i,"invalid publicKey length"),c=f(r),i.push(c);var d=0==(0|n._crypto_sign_verify_detached(o,a,l,0,c));return m(i),d}function rn(e,t,r,i){var o=[];h(i),A(o,e,"outLength"),("number"!=typeof e||(0|e)!==e||e<0)&&v(o,"outLength must be an unsigned integer"),t=b(o,t,"key");var s,a=0|n._crypto_stream_chacha20_keybytes();t.length!==a&&v(o,"invalid key length"),s=f(t),o.push(s),r=b(o,r,"nonce");var l,c=0|n._crypto_stream_chacha20_noncebytes();r.length!==c&&v(o,"invalid nonce length"),l=f(r),o.push(l);var d=new p(0|e),g=d.address;o.push(g),n._crypto_stream_chacha20(g,e,0,l,s);var y=u(d,i);return m(o),y}function on(e,t,r,i){var o=[];h(i);var s=f(e=b(o,e,"input_message")),a=e.length;o.push(s),t=b(o,t,"nonce");var l,c=0|n._crypto_stream_chacha20_ietf_noncebytes();t.length!==c&&v(o,"invalid nonce length"),l=f(t),o.push(l),r=b(o,r,"key");var d,g=0|n._crypto_stream_chacha20_ietf_keybytes();r.length!==g&&v(o,"invalid key length"),d=f(r),o.push(d);var A=new p(0|a),w=A.address;if(o.push(w),0===n._crypto_stream_chacha20_ietf_xor(w,s,a,0,l,d)){var S=u(A,i);return m(o),S}y(o,"invalid usage")}function sn(e,t,r,i,o){var s=[];h(o);var a=f(e=b(s,e,"input_message")),l=e.length;s.push(a),t=b(s,t,"nonce");var c,d=0|n._crypto_stream_chacha20_ietf_noncebytes();t.length!==d&&v(s,"invalid nonce length"),c=f(t),s.push(c),A(s,r,"nonce_increment"),("number"!=typeof r||(0|r)!==r||r<0)&&v(s,"nonce_increment must be an unsigned integer"),i=b(s,i,"key");var g,w=0|n._crypto_stream_chacha20_ietf_keybytes();i.length!==w&&v(s,"invalid key length"),g=f(i),s.push(g);var S=new p(0|l),C=S.address;if(s.push(C),0===n._crypto_stream_chacha20_ietf_xor_ic(C,a,l,0,c,r,g)){var E=u(S,o);return m(s),E}y(s,"invalid usage")}function an(e){var t=[];h(e);var r=new p(0|n._crypto_stream_chacha20_keybytes()),i=r.address;t.push(i),n._crypto_stream_chacha20_keygen(i);var o=u(r,e);return m(t),o}function ln(e,t,r,i){var o=[];h(i);var s=f(e=b(o,e,"input_message")),a=e.length;o.push(s),t=b(o,t,"nonce");var l,c=0|n._crypto_stream_chacha20_noncebytes();t.length!==c&&v(o,"invalid nonce length"),l=f(t),o.push(l),r=b(o,r,"key");var d,g=0|n._crypto_stream_chacha20_keybytes();r.length!==g&&v(o,"invalid key length"),d=f(r),o.push(d);var A=new p(0|a),w=A.address;if(o.push(w),0===n._crypto_stream_chacha20_xor(w,s,a,0,l,d)){var S=u(A,i);return m(o),S}y(o,"invalid usage")}function cn(e,t,r,i,o){var s=[];h(o);var a=f(e=b(s,e,"input_message")),l=e.length;s.push(a),t=b(s,t,"nonce");var c,d=0|n._crypto_stream_chacha20_noncebytes();t.length!==d&&v(s,"invalid nonce length"),c=f(t),s.push(c),A(s,r,"nonce_increment"),("number"!=typeof r||(0|r)!==r||r<0)&&v(s,"nonce_increment must be an unsigned integer"),i=b(s,i,"key");var g,w=0|n._crypto_stream_chacha20_keybytes();i.length!==w&&v(s,"invalid key length"),g=f(i),s.push(g);var S=new p(0|l),C=S.address;if(s.push(C),0===n._crypto_stream_chacha20_xor_ic(C,a,l,0,c,r,0,g)){var E=u(S,o);return m(s),E}y(s,"invalid usage")}function un(e){var t=[];h(e);var r=new p(0|n._crypto_stream_keybytes()),i=r.address;t.push(i),n._crypto_stream_keygen(i);var o=u(r,e);return m(t),o}function dn(e){var t=[];h(e);var r=new p(0|n._crypto_stream_xchacha20_keybytes()),i=r.address;t.push(i),n._crypto_stream_xchacha20_keygen(i);var o=u(r,e);return m(t),o}function hn(e,t,r,i){var o=[];h(i);var s=f(e=b(o,e,"input_message")),a=e.length;o.push(s),t=b(o,t,"nonce");var l,c=0|n._crypto_stream_xchacha20_noncebytes();t.length!==c&&v(o,"invalid nonce length"),l=f(t),o.push(l),r=b(o,r,"key");var d,g=0|n._crypto_stream_xchacha20_keybytes();r.length!==g&&v(o,"invalid key length"),d=f(r),o.push(d);var A=new p(0|a),w=A.address;if(o.push(w),0===n._crypto_stream_xchacha20_xor(w,s,a,0,l,d)){var S=u(A,i);return m(o),S}y(o,"invalid usage")}function pn(e,t,r,i,o){var s=[];h(o);var a=f(e=b(s,e,"input_message")),l=e.length;s.push(a),t=b(s,t,"nonce");var c,d=0|n._crypto_stream_xchacha20_noncebytes();t.length!==d&&v(s,"invalid nonce length"),c=f(t),s.push(c),A(s,r,"nonce_increment"),("number"!=typeof r||(0|r)!==r||r<0)&&v(s,"nonce_increment must be an unsigned integer"),i=b(s,i,"key");var g,w=0|n._crypto_stream_xchacha20_keybytes();i.length!==w&&v(s,"invalid key length"),g=f(i),s.push(g);var S=new p(0|l),C=S.address;if(s.push(C),0===n._crypto_stream_xchacha20_xor_ic(C,a,l,0,c,r,0,g)){var E=u(S,o);return m(s),E}y(s,"invalid usage")}function fn(e,t){var r=[];h(t),A(r,e,"length"),("number"!=typeof e||(0|e)!==e||e<0)&&v(r,"length must be an unsigned integer");var i=new p(0|e),o=i.address;r.push(o),n._randombytes_buf(o,e);var s=u(i,t);return m(r),s}function gn(e,t,r){var i=[];h(r),A(i,e,"length"),("number"!=typeof e||(0|e)!==e||e<0)&&v(i,"length must be an unsigned integer"),t=b(i,t,"seed");var o,s=0|n._randombytes_seedbytes();t.length!==s&&v(i,"invalid seed length"),o=f(t),i.push(o);var a=new p(0|e),l=a.address;i.push(l),n._randombytes_buf_deterministic(l,e,o);var c=u(a,r);return m(i),c}function mn(e){h(e),n._randombytes_close()}function yn(e){h(e);var t=n._randombytes_random()>>>0;return m([]),t}function vn(e,t){var r=[];h(t);for(var i=n._malloc(24),o=0;o<6;o++)n.setValue(i+4*o,n.Runtime.addFunction(e[["implementation_name","random","stir","uniform","buf","close"][o]]),"i32");0!=(0|n._randombytes_set_implementation(i))&&y(r,"unsupported implementation"),m(r)}function An(e){h(e),n._randombytes_stir()}function bn(e,t){var r=[];h(t),A(r,e,"upper_bound"),("number"!=typeof e||(0|e)!==e||e<0)&&v(r,"upper_bound must be an unsigned integer");var i=n._randombytes_uniform(e)>>>0;return m(r),i}function wn(){var e=n._sodium_version_string(),t=n.UTF8ToString(e);return m([]),t}return p.prototype.to_Uint8Array=function(){var e=new Uint8Array(this.length);return e.set(n.HEAPU8.subarray(this.address,this.address+this.length)),e},e.add=function(e,t){if(!(e instanceof Uint8Array&&t instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can added");var n=e.length,r=0,i=0;if(t.length!=e.length)throw new TypeError("Arguments must have the same length");for(i=0;i<n;i++)r>>=8,r+=e[i]+t[i],e[i]=255&r},e.base64_variants=a,e.compare=function(e,t){if(!(e instanceof Uint8Array&&t instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be compared");if(e.length!==t.length)throw new TypeError("Only instances of identical length can be compared");for(var n=0,r=1,i=e.length;i-- >0;)n|=t[i]-e[i]>>8&r,r&=(t[i]^e[i])-1>>8;return n+n+r-1},e.from_base64=function(e,t){t=l(t);var r,i=[],o=new p(3*(e=b(i,e,"input")).length/4),s=f(e),a=g(4),c=g(4);return i.push(s),i.push(o.address),i.push(o.result_bin_len_p),i.push(o.b64_end_p),0!==n._sodium_base642bin(o.address,o.length,s,e.length,0,a,c,t)&&y(i,"invalid input"),n.getValue(c,"i32")-s!==e.length&&y(i,"incomplete input"),o.length=n.getValue(a,"i32"),r=o.to_Uint8Array(),m(i),r},e.from_hex=function(e){var t,r=[],i=new p((e=b(r,e,"input")).length/2),o=f(e),s=g(4);return r.push(o),r.push(i.address),r.push(i.hex_end_p),0!==n._sodium_hex2bin(i.address,i.length,o,e.length,0,0,s)&&y(r,"invalid input"),n.getValue(s,"i32")-o!==e.length&&y(r,"incomplete input"),t=i.to_Uint8Array(),m(r),t},e.from_string=i,e.increment=function(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be incremented");for(var t=256,n=0,r=e.length;n<r;n++)t>>=8,t+=e[n],e[n]=255&t},e.is_zero=function(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be checked");for(var t=0,n=0,r=e.length;n<r;n++)t|=e[n];return 0===t},e.libsodium=t,e.memcmp=function(e,t){if(!(e instanceof Uint8Array&&t instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be compared");if(e.length!==t.length)throw new TypeError("Only instances of identical length can be compared");for(var n=0,r=0,i=e.length;r<i;r++)n|=e[r]^t[r];return 0===n},e.memzero=function(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be wiped");for(var t=0,n=e.length;t<n;t++)e[t]=0},e.output_formats=function(){return["uint8array","text","hex","base64"]},e.pad=function(e,t){if(!(e instanceof Uint8Array))throw new TypeError("buffer must be a Uint8Array");if((t|=0)<=0)throw new Error("block size must be > 0");var r,i=[],o=g(4),s=1,a=0,l=0|e.length,c=new p(l+t);i.push(o),i.push(c.address);for(var u=c.address,d=c.address+l+t;u<d;u++)n.HEAPU8[u]=e[a],a+=s=1&~((65535&((l-=s)>>>48|l>>>32|l>>>16|l))-1>>16);return 0!==n._sodium_pad(o,c.address,e.length,t,c.length)&&y(i,"internal error"),c.length=n.getValue(o,"i32"),r=c.to_Uint8Array(),m(i),r},e.unpad=function(e,t){if(!(e instanceof Uint8Array))throw new TypeError("buffer must be a Uint8Array");if((t|=0)<=0)throw new Error("block size must be > 0");var r=[],i=f(e),o=g(4);return r.push(i),r.push(o),0!==n._sodium_unpad(o,i,e.length,t)&&y(r,"unsupported/invalid padding"),e=(e=new Uint8Array(e)).subarray(0,n.getValue(o,"i32")),m(r),e},e.ready=r,e.symbols=function(){return Object.keys(e).sort()},e.to_base64=c,e.to_hex=s,e.to_string=o,e},void 0!==(o=r.apply(t,i))&&(e.exports=o),a&&s.sodium.ready.then((function(){a(s.sodium)}))},39631:function(e,t,n){var r,i;r=function(t){"use strict";var r;void 0===(r=t)&&(r={});var i=r;"object"!=typeof i.sodium&&("object"==typeof n.g?i=n.g:"object"==typeof window&&(i=window)),"object"==typeof i.sodium&&"number"==typeof i.sodium.totalMemory&&(r.TOTAL_MEMORY=i.sodium.totalMemory);var o=r;return r.ready=new Promise((function(t,r){(d=o).onAbort=r,d.print=function(e){},d.printErr=function(e){},d.onRuntimeInitialized=function(){try{d._crypto_secretbox_keybytes(),t()}catch(e){r(e)}},d.useBackupModule=function(){return new Promise((function(t,r){(d={}).onAbort=r,d.onRuntimeInitialized=function(){Object.keys(o).forEach((function(e){"getRandomValue"!==e&&delete o[e]})),Object.keys(d).forEach((function(e){o[e]=d[e]})),t()};var i,s,a,l,c,u,d=void 0!==d?d:{},h=Object.assign({},d),p=[],f="object"==typeof window,g="function"==typeof importScripts,m="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,y="";m?(y=g?n(84371).dirname(y)+"/":"//",u=()=>{c||(l=n(68236),c=n(84371))},i=function(e,t){var n=ne(e);return n?t?n:n.toString():(u(),e=c.normalize(e),l.readFileSync(e,t?void 0:"utf8"))},a=e=>{var t=i(e,!0);return t.buffer||(t=new Uint8Array(t)),t},s=(e,t,n)=>{var r=ne(e);r&&t(r),u(),e=c.normalize(e),l.readFile(e,(function(e,r){e?n(e):t(r.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),p=process.argv.slice(2),e.exports=d,d.inspect=function(){return"[Emscripten Module object]"}):(f||g)&&(g?y=self.location.href:"undefined"!=typeof document&&document.currentScript&&(y=document.currentScript.src),y=0!==y.indexOf("blob:")?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf("/")+1):"",i=e=>{try{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText}catch(t){var n=ne(e);if(n)return function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r>255&&(r&=255),t.push(String.fromCharCode(r))}return t.join("")}(n);throw t}},g&&(a=e=>{try{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}catch(t){var n=ne(e);if(n)return n;throw t}}),s=(e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{if(200==r.status||0==r.status&&r.response)t(r.response);else{var i=ne(e);i?t(i.buffer):n()}},r.onerror=n,r.send(null)}),d.print;var v,A=d.printErr||void 0;Object.assign(d,h),h=null,d.arguments&&(p=d.arguments),d.thisProgram&&d.thisProgram,d.quit&&d.quit,d.wasmBinary&&(v=d.wasmBinary),d.noExitRuntime;var b,w={Memory:function(e){this.buffer=new ArrayBuffer(65536*e.initial)},Module:function(e){},Instance:function(e,t){this.exports=function(e){for(var t,n=new Uint8Array(123),r=25;r>=0;--r)n[48+r]=52+r,n[65+r]=r,n[97+r]=26+r;function i(e,t,r){for(var i,o,s=0,a=t,l=r.length,c=t+(3*l>>2)-("="==r[l-2])-("="==r[l-1]);s<l;s+=4)i=n[r.charCodeAt(s+1)],o=n[r.charCodeAt(s+2)],e[a++]=n[r.charCodeAt(s)]<<2|i>>4,a<c&&(e[a++]=i<<4|o>>2),a<c&&(e[a++]=o<<6|n[r.charCodeAt(s+3)])}return n[43]=62,n[47]=63,function(e){var n=e.a,r=n.buffer;n.grow=function(e){e|=0;var i=0|Tn(),d=i+e|0;if(i<d&&d<65536){var h=new ArrayBuffer(u(d,65536));new Int8Array(h).set(o),o=new Int8Array(h),s=new Int16Array(h),a=new Int32Array(h),l=new Uint8Array(h),new Uint16Array(h),c=new Uint32Array(h),new Float32Array(h),new Float64Array(h),r=h,n.buffer=r,t=l}return i};var o=new Int8Array(r),s=new Int16Array(r),a=new Int32Array(r),l=new Uint8Array(r),c=(new Uint16Array(r),new Uint32Array(r)),u=(new Float32Array(r),new Float64Array(r),Math.imul),d=(Math.fround,Math.abs,Math.clz32),h=(Math.min,Math.max,Math.floor,Math.ceil,Math.trunc,Math.sqrt,e.abort),p=e.b,f=e.c,g=e.d,m=e.e,y=5279280,v=0,A=0,b=0;function w(e,t){var n,r,i,s,c,u=0,d=0,h=0,p=0,f=0,g=0,m=0,v=0,A=0,w=0,S=0,C=0,E=0,I=0,_=0,x=0,P=0,k=0,B=0,O=0,N=0,D=0,j=0,T=0,M=0,F=0,R=0,L=0,Q=0,U=0,V=0,K=0,H=0,G=0,Y=0,z=0,Z=0,W=0,q=0,J=0,X=0,$=0,ee=0,te=0,ne=0,re=0,ie=0,oe=0,se=0,ae=0,le=0,ce=0,ue=0,de=0,he=0,pe=0,fe=0,ge=0,me=0,ye=0,ve=0;for(y=z=y-256|0;W=(K=H<<3)+(z+128|0)|0,te=l[4+(K=t+K|0)|0]|l[K+5|0]<<8|l[K+6|0]<<16|l[K+7|0]<<24,a[W>>2]=l[0|K]|l[K+1|0]<<8|l[K+2|0]<<16|l[K+3|0]<<24,a[W+4>>2]=te,16!=(0|(H=H+1|0)););for(n=pt(z,e,64),K=a[(t=n)>>2],H=a[t+4>>2],d=K,K=(te=a[t+32>>2])+(z=a[t+128>>2])|0,t=(J=a[t+36>>2])+a[t+132>>2]|0,t=K>>>0<z>>>0?t+1|0:t,z=K,t=t+H|0,z=t=(K=d+K|0)>>>0<z>>>0?t+1|0:t,V=we((H=K)^(l[0|(K=e- -64|0)]|l[K+1|0]<<8|l[K+2|0]<<16|l[K+3|0]<<24)^-1377402159,t^(l[K+4|0]|l[K+5|0]<<8|l[K+6|0]<<16|l[K+7|0]<<24)^1359893119,32),K=t=b,t=t+1779033703|0,d=te^(W=V-205731576|0),te=t=W>>>0<4089235720?t+1|0:t,x=we(d,J^t,24),J=t=b,G=K,d=V,t=t+z|0,t=(t=(V=x+H|0)>>>0<H>>>0?t+1|0:t)+(h=r=a[n+140>>2])|0,u=we(d^(O=H=(K=a[n+136>>2])+V|0),(w=O>>>0<V>>>0?t+1|0:t)^G,16),t=te+(f=b)|0,d=we((M=H=W+u|0)^x,(z=M>>>0<W>>>0?t+1|0:t)^J,63),v=b,W=a[n+12>>2],H=(x=a[n+144>>2])+(te=a[n+40>>2])|0,t=(ne=a[n+148>>2])+(J=a[n+44>>2])|0,G=H,t=(t=H>>>0<te>>>0?t+1|0:t)+W|0,t=(H=H+a[n+8>>2]|0)>>>0<G>>>0?t+1|0:t,V=we(H^(l[e+72|0]|l[e+73|0]<<8|l[e+74|0]<<16|l[e+75|0]<<24)^725511199,(l[e+76|0]|l[e+77|0]<<8|l[e+78|0]<<16|l[e+79|0]<<24)^t^-1694144372,32),G=we(S=te^(W=V-2067093701|0),J^(h=(te=b)-((V>>>0<2067093701)+1150833018|0)|0),24),P=a[n+156>>2],S=G,t=t+(J=b)|0,t=(t=(G=H+G|0)>>>0<H>>>0?t+1|0:t)+P|0,Z=we((B=H=G+a[n+152>>2]|0)^V,(I=B>>>0<G>>>0?t+1|0:t)^te,16),t=h+(D=b)|0,fe=H=W+Z|0,V=we(S^H,(W=H>>>0<W>>>0?t+1|0:t)^J,63),h=b,te=a[n+20>>2],H=(k=a[n+160>>2])+(G=a[n+48>>2])|0,t=(oe=a[n+164>>2])+(P=a[n+52>>2])|0,J=H,t=(t=H>>>0<G>>>0?t+1|0:t)+te|0,le=H=H+a[n+16>>2]|0,H=H>>>0<J>>>0?t+1|0:t,_=we(le^(l[e+80|0]|l[e+81|0]<<8|l[e+82|0]<<16|l[e+83|0]<<24)^-79577749,H^(l[e+84|0]|l[e+85|0]<<8|l[e+86|0]<<16|l[e+87|0]<<24)^528734635,32),te=t=b,t=t+1013904242|0,S=G^(J=_-23791573|0),G=t=J>>>0<4271175723?t+1|0:t,t=we(S,P^t,24),g=te,i=a[n+172>>2],p=t,S=_,_=t,le=t+le|0,t=(P=b)+H|0,t=(t=_>>>0>le>>>0?t+1|0:t)+(C=i)|0,Q=we(S^(C=H=(te=a[n+168>>2])+(_=le)|0),(j=_>>>0>C>>>0?t+1|0:t)^g,16),t=G+(E=b)|0,P=we(p^(T=H=J+Q|0),(G=T>>>0<J>>>0?t+1|0:t)^P,63),g=b,_=a[n+28>>2],J=(H=a[n+176>>2])+(le=a[n+56>>2])|0,t=(s=a[n+180>>2])+(N=a[n+60>>2])|0,t=(t=J>>>0<le>>>0?t+1|0:t)+_|0,t=(m=J)>>>0>(F=J=m+a[n+24>>2]|0)>>>0?t+1|0:t,p=we(F^(l[e+88|0]|l[e+89|0]<<8|l[e+90|0]<<16|l[e+91|0]<<24)^327033209,t^(l[e+92|0]|l[e+93|0]<<8|l[e+94|0]<<16|l[e+95|0]<<24)^1541459225,32),_=we(S=le^(A=(_=p)+1595750129|0),N^(le=(J=b)-((_>>>0<2699217167)+1521486533|0)|0),24),m=le,S=J,le=a[n+188>>2],L=_,t=(N=b)+t|0,t=(t=(F=_+F|0)>>>0<_>>>0?t+1|0:t)+le|0,Y=_=(J=a[n+184>>2])+F|0,p=we(_^p,(R=S)^(S=_>>>0<F>>>0?t+1|0:t),16),t=(t=m)+(m=b)|0,F=_=p+A|0,A=N,N=t=_>>>0<p>>>0?t+1|0:t,R=we(L^_,A^t,63),_=b,L=V,t=h+w|0,t=(t=(O=O+V|0)>>>0<V>>>0?t+1|0:t)+(A=q=a[n+196>>2])|0,A=T,O=we((T=V=(ie=a[n+192>>2])+(w=O)|0)^p,(V=w>>>0>T>>>0?t+1|0:t)^m,32),t=(t=G)+(G=b)|0,p=h,h=t=(w=A+(m=O)|0)>>>0<m>>>0?t+1|0:t,t=we(L^w,p^t,24),ce=a[n+204>>2],U=t,L=m,p=T,T=t,p=p+t|0,t=(m=b)+V|0,t=(t=p>>>0<T>>>0?t+1|0:t)+(A=ce)|0,X=V=(O=a[n+200>>2])+p|0,de=we(L^V,(T=p>>>0>V>>>0?t+1|0:t)^G,16),t=h+(p=b)|0,U=we(U^(A=G=w+de|0),(h=m)^(m=w>>>0>A>>>0?t+1|0:t),63),w=b,L=P,t=g+I|0,t=(t=(G=P+B|0)>>>0<P>>>0?t+1|0:t)+(h=ae=a[n+212>>2])|0,B=we((h=u)^(u=G=(V=a[n+208>>2])+(P=G)|0),(P=P>>>0>u>>>0?t+1|0:t)^f,32),t=N+(h=b)|0,G=we(L^(N=G=F+B|0),(t=F>>>0>N>>>0?t+1|0:t)^g,24),f=t,I=h,ee=a[n+220>>2],$=G,L=N,t=(g=b)+P|0,t=(t=(N=u+G|0)>>>0<G>>>0?t+1|0:t)+(F=ee)|0,I=we((N=G=(h=a[n+216>>2])+(P=N)|0)^B,(F=P>>>0>N>>>0?t+1|0:t)^I,16),t=(u=b)+f|0,ue=G=L+I|0,L=we($^G,(P=I>>>0>G>>>0?t+1|0:t)^g,63),g=b,$=R,t=_+j|0,t=(f=C+R|0)>>>0<C>>>0?t+1|0:t,C=f,t=t+(B=c=a[n+228>>2])|0,R=we((j=f=(G=a[n+224>>2])+f|0)^Z,(f=f>>>0<C>>>0?t+1|0:t)^D,32),t=(D=b)+z|0,M=C=R+M|0,z=we($^C,(t=C>>>0<R>>>0?t+1|0:t)^_,24),C=t,Z=a[n+236>>2],$=z,t=(_=b)+f|0,t=(t=(j=j+z|0)>>>0<z>>>0?t+1|0:t)+(B=Z)|0,pe=we((j=z=(re=a[n+232>>2])+(f=j)|0)^R,(B=D)^(D=f>>>0>j>>>0?t+1|0:t),16),t=(t=C)+(C=b)|0,_=we($^(R=z=(f=pe)+M|0),(M=f>>>0>R>>>0?t+1|0:t)^_,63),f=b,$=d,t=v+S|0,t=(t=(B=d+Y|0)>>>0<d>>>0?t+1|0:t)+(ge=a[n+244>>2])|0,t=(d=(z=a[n+240>>2])+(S=B)|0)>>>0<S>>>0?t+1|0:t,S=E,E=t,B=we(d^Q,S^t,32),t=(t=W)+(W=b)|0,Q=S=B+fe|0,Y=we($^S,(t=S>>>0<B>>>0?t+1|0:t)^v,24),v=t,S=W,fe=a[n+252>>2],he=Y,se=Q,Q=B,t=E+($=b)|0,t=(t=(B=d+Y|0)>>>0<d>>>0?t+1|0:t)+fe|0,t=(d=(W=a[n+248>>2])+(E=B)|0)>>>0<E>>>0?t+1|0:t,E=d,B=S,S=t,Y=we(Q^d,B^t,16),t=(B=b)+v|0,Q=we(he^(se=d=se+(Q=Y)|0),(d=d>>>0<Q>>>0?t+1|0:t)^$,63),$=t=b,v=t,he=I,t=T+ge|0,T=I=z+X|0,t=(t=I>>>0<z>>>0?t+1|0:t)+v|0,X=we(he^(v=I=I+Q|0),(I=v>>>0<T>>>0?t+1|0:t)^u,32),t=M+(T=b)|0,R=t=(u=R+X|0)>>>0<R>>>0?t+1|0:t,Q=we(Q^u,$^t,24),$=t=b,M=t,me=Q,t=I+ae|0,I=Q=v+V|0,t=(t=Q>>>0<v>>>0?t+1|0:t)+M|0,Q=X,X=v=me+I|0,he=we(Q^v,(M=T)^(T=v>>>0<I>>>0?t+1|0:t),16),t=R+(M=b)|0,R=t=(v=u+he|0)>>>0<u>>>0?t+1|0:t,Q=we(me^(u=v),t^$,63),I=b,t=w+oe|0,t=(t=(v=k+U|0)>>>0<k>>>0?t+1|0:t)+F|0,k=t=(v=v+N|0)>>>0<N>>>0?t+1|0:t,F=we(v^pe,t^C,32),t=(t=d)+(d=b)|0,t=(C=(N=F)+se|0)>>>0<N>>>0?t+1|0:t,N=w,w=t,U=we(C^U,N^t,24),oe=t=b,N=t,$=F,t=k+q|0,t=(t=(F=v+ie|0)>>>0<v>>>0?t+1|0:t)+N|0,t=(v=(k=F)+U|0)>>>0<k>>>0?t+1|0:t,k=v,N=t,pe=we($^v,t^d,16),t=w+(F=b)|0,$=d=C+pe|0,U=we(d^U,(v=d>>>0<C>>>0?t+1|0:t)^oe,63),d=b,t=g+ce|0,t=(t=(w=O+L|0)>>>0<O>>>0?t+1|0:t)+D|0,B=we((O=w=w+j|0)^Y,(w=w>>>0<j>>>0?t+1|0:t)^B,32),t=m+(D=b)|0,m=g,g=t=(C=A+B|0)>>>0<A>>>0?t+1|0:t,m=we(C^L,m^t,24),A=t=b,L=m,t=w+fe|0,t=(t=(m=O+W|0)>>>0<W>>>0?t+1|0:t)+A|0,ce=w=L+m|0,se=we(w^B,(O=D)^(D=w>>>0<m>>>0?t+1|0:t),16),t=g+(j=b)|0,O=w=C+se|0,B=we(L^w,(g=w>>>0<C>>>0?t+1|0:t)^A,63),w=b,A=_,t=f+Z|0,t=(t=(C=_+re|0)>>>0<_>>>0?t+1|0:t)+S|0,t=(_=C+E|0)>>>0<E>>>0?t+1|0:t,E=_,_=t,m=we(E^de,t^p,32),t=(t=P)+(P=b)|0,S=C=m+ue|0,p=we(A^C,(t=m>>>0>C>>>0?t+1|0:t)^f,24),A=f=b,C=t,t=_+s|0,t=(t=(E=E+H|0)>>>0<H>>>0?t+1|0:t)+f|0,t=(_=E+p|0)>>>0<E>>>0?t+1|0:t,f=S,E=_,S=_^m,m=t,P=f+(_=S=we(S,t^P,16))|0,t=(f=b)+C|0,Y=P,L=we(P^p,(_=P>>>0<_>>>0?t+1|0:t)^A,63),P=b,A=O,p=S,t=T+r|0,S=C=K+X|0,t=(t=C>>>0<K>>>0?t+1|0:t)+d|0,t=(C=C+U|0)>>>0<S>>>0?t+1|0:t,S=f,f=t,O=we(p^C,S^t,32),t=(t=g)+(g=b)|0,T=S=A+O|0,p=we(S^U,(t=S>>>0<O>>>0?t+1|0:t)^d,24),A=d=b,S=t,U=O,t=f+c|0,t=(t=(O=C+G|0)>>>0<C>>>0?t+1|0:t)+d|0,t=(f=(C=O)+p|0)>>>0<C>>>0?t+1|0:t,C=f,O=t,de=we(U^f,t^g,16),t=(t=S)+(S=b)|0,T=d=(g=de)+T|0,oe=we(f=d^p,(p=d>>>0<g>>>0?t+1|0:t)^A,63),g=b,t=w+N|0,t=(d=k+B|0)>>>0<k>>>0?t+1|0:t,k=d,t=t+(f=ue=a[n+132>>2])|0,f=t=(d=(A=a[n+128>>2])+d|0)>>>0<k>>>0?t+1|0:t,N=we(d^he,t^M,32),t=(t=_)+(_=b)|0,M=k=N+Y|0,B=we(k^B,(t=k>>>0<N>>>0?t+1|0:t)^w,24),U=w=b,k=t,Y=N,t=f+ne|0,t=(t=(N=d+x|0)>>>0<d>>>0?t+1|0:t)+w|0,N=d=(f=N)+B|0,d=we(Y^d,(w=_)^(_=d>>>0<f>>>0?t+1|0:t),16),t=(t=k)+(k=b)|0,M=w=d+M|0,Y=we(f=w^B,(B=d>>>0>w>>>0?t+1|0:t)^U,63),w=b,X=L,t=D+ee|0,D=f=h+ce|0,t=(t=f>>>0<h>>>0?t+1|0:t)+P|0,L=we((U=f=f+L|0)^pe,(f=f>>>0<D>>>0?t+1|0:t)^F,32),t=R+(D=b)|0,t=u>>>0>(F=u+L|0)>>>0?t+1|0:t,R=we(X^(u=F),t^P,24),ce=P=b,F=t,he=R,X=u,t=f+le|0,t=(t=(u=U+J|0)>>>0<J>>>0?t+1|0:t)+P|0,t=u>>>0>(f=u+R|0)>>>0?t+1|0:t,u=f,P=D,D=t,pe=we(f^L,P^t,16),t=(P=b)+F|0,F=f=X+(R=pe)|0,ce=we(he^f,(t=f>>>0<R>>>0?t+1|0:t)^ce,63),f=b,R=t,U=d,t=I+i|0,t=(t=(d=Q+te|0)>>>0<te>>>0?t+1|0:t)+m|0,t=(d=d+E|0)>>>0<E>>>0?t+1|0:t,E=d,m=j,j=t,L=we(d^se,m^t,32),t=(d=b)+v|0,X=we((m=L+$|0)^Q,(t=m>>>0<L>>>0?t+1|0:t)^I,24),v=t,I=d,Q=a[n+156>>2],he=m,t=j+($=b)|0,t=(t=(m=E+X|0)>>>0<E>>>0?t+1|0:t)+Q|0,E=t=m>>>0>(j=(d=a[n+152>>2])+m|0)>>>0?t+1|0:t,se=we(j^L,t^I,16),t=(t=v)+(v=b)|0,L=t=(m=se)>>>0>(I=he+m|0)>>>0?t+1|0:t,X=we((m=I)^X,t^$,63),$=t=b,I=t,he=F,t=O+ee|0,t=(t=(F=h+C|0)>>>0<C>>>0?t+1|0:t)+I|0,I=C=F+X|0,U=we(C^U,(O=k)^(k=C>>>0<F>>>0?t+1|0:t),32),t=(C=b)+R|0,O=t=(O=U)>>>0>(F=he+O|0)>>>0?t+1|0:t,X=we(X^F,$^t,24),$=t=b,R=t,he=U,t=k+q|0,t=(t=(U=I+ie|0)>>>0<I>>>0?t+1|0:t)+R|0,t=(I=(k=U)+X|0)>>>0<k>>>0?t+1|0:t,k=I,R=C,C=t,ie=we(he^I,R^t,16),t=O+(R=b)|0,t=(I=F+ie|0)>>>0<F>>>0?t+1|0:t,F=I,O=t,U=we(I^X,t^$,63),I=b,X=oe,t=g+c|0,t=(t=(q=G+oe|0)>>>0<G>>>0?t+1|0:t)+_|0,_=P,P=t=N>>>0>(q=N+q|0)>>>0?t+1|0:t,oe=we(q^pe,_^t,32),t=L+(_=b)|0,t=m>>>0>(N=m+oe|0)>>>0?t+1|0:t,m=g,g=t,L=we(X^N,m^t,24),X=t=b,m=t,$=L,t=P+ue|0,t=(t=(L=A+q|0)>>>0<A>>>0?t+1|0:t)+m|0,q=P=$+(A=L)|0,oe=we(P^oe,(m=P>>>0<A>>>0?t+1|0:t)^_,16),t=g+(A=b)|0,ue=P=N+oe|0,L=we($^P,(_=P>>>0<N>>>0?t+1|0:t)^X,63),P=b,X=Y,t=w+i|0,t=(t=(g=te+Y|0)>>>0<te>>>0?t+1|0:t)+D|0,t=(g=g+u|0)>>>0<u>>>0?t+1|0:t,u=g,N=v,v=t,Y=we(g^se,N^t,32),t=p+(g=b)|0,p=w,w=t=(D=T+Y|0)>>>0<T>>>0?t+1|0:t,T=we(X^D,p^t,24),p=t=b,$=T,t=v+ne|0,t=(t=(T=u+x|0)>>>0<x>>>0?t+1|0:t)+p|0,u=Y,Y=v=$+T|0,X=we(u^v,(N=v>>>0<T>>>0?t+1|0:t)^g,16),t=w+(T=b)|0,pe=v=D+X|0,p=we($^v,(w=v>>>0<D>>>0?t+1|0:t)^p,63),v=b,t=f+fe|0,t=(t=(g=W+ce|0)>>>0<W>>>0?t+1|0:t)+E|0,D=t=(g=g+j|0)>>>0<j>>>0?t+1|0:t,u=we(g^de,t^S,32),t=B+(j=b)|0,S=f,f=t=(E=M+u|0)>>>0<M>>>0?t+1|0:t,M=we(E^ce,S^t,24),B=t=b,S=t,$=u,t=D+Z|0,t=(t=(u=g+re|0)>>>0<g>>>0?t+1|0:t)+S|0,S=g=u+M|0,u=we($^g,(D=j)^(j=g>>>0<u>>>0?t+1|0:t),16),t=f+(D=b)|0,ce=g=E+u|0,M=we(g^M,(f=g>>>0<E>>>0?t+1|0:t)^B,63),g=b,t=C+ae|0,t=(t=(E=k+V|0)>>>0<k>>>0?t+1|0:t)+P|0,E=k=(C=E)+L|0,u=we(k^u,(B=D)^(D=C>>>0>k>>>0?t+1|0:t),32),t=(t=w)+(w=b)|0,C=P,P=t=u>>>0>(k=u+pe|0)>>>0?t+1|0:t,B=we(k^L,C^t,24),L=t=b,C=t,t=D+ge|0,t=(t=(E=E+z|0)>>>0<z>>>0?t+1|0:t)+C|0,de=D=E+B|0,pe=we(D^u,(C=D>>>0<E>>>0?t+1|0:t)^w,16),t=P+(E=b)|0,$=w=k+pe|0,B=we(w^B,(P=w>>>0<k>>>0?t+1|0:t)^L,63),w=b,L=p,t=m+Q|0,t=(t=(D=d+q|0)>>>0<d>>>0?t+1|0:t)+v|0,p=we((m=D=(k=D)+p|0)^ie,(D=m>>>0<k>>>0?t+1|0:t)^R,32),t=(t=f)+(f=b)|0,R=we(L^(u=k=p+ce|0),(t=p>>>0>u>>>0?t+1|0:t)^v,24),L=v=b,k=t,q=R,t=D+s|0,t=(t=(m=m+H|0)>>>0<H>>>0?t+1|0:t)+v|0,t=m>>>0>(D=m+R|0)>>>0?t+1|0:t,v=u,u=(m=D)^p,p=t,u=we(u,t^f,16),t=(R=b)+k|0,f=we(q^(se=v=v+u|0),(v=v>>>0<u>>>0?t+1|0:t)^L,63),D=b,q=M,t=N+le|0,N=k=J+Y|0,t=(t=k>>>0<J>>>0?t+1|0:t)+g|0,L=we((M=k=k+M|0)^oe,(k=k>>>0<N>>>0?t+1|0:t)^A,32),t=O+(N=b)|0,O=A=F+L|0,A=we(q^A,(t=A>>>0<F>>>0?t+1|0:t)^g,24),q=g=b,F=t,Y=O,t=k+r|0,t=(t=(O=M+K|0)>>>0<K>>>0?t+1|0:t)+g|0,t=(k=O+A|0)>>>0<O>>>0?t+1|0:t,O=k,g=N,N=t,he=we(k^L,g^t,16),t=(t=F)+(F=b)|0,L=we((g=Y+(k=he)|0)^A,(t=g>>>0<k>>>0?t+1|0:t)^q,63),k=b,A=g,M=t,t=I+j|0,j=g=S+U|0,t=(t=g>>>0<S>>>0?t+1|0:t)+(q=a[n+204>>2])|0,j=t=(g=(ie=a[n+200>>2])+g|0)>>>0<j>>>0?t+1|0:t,T=we(g^X,t^T,32),t=(t=_)+(_=b)|0,U=we((S=T+ue|0)^U,(t=S>>>0<T>>>0?t+1|0:t)^I,24),I=t,oe=a[n+164>>2],ue=S,t=j+(ce=b)|0,t=(t=(S=g+U|0)>>>0<g>>>0?t+1|0:t)+oe|0,j=g=(Y=a[n+160>>2])+S|0,S=t=g>>>0<S>>>0?t+1|0:t,X=we(g^T,t^_,16),t=(T=b)+I|0,U=we((ue=g=ue+(_=X)|0)^U,(g=g>>>0<_>>>0?t+1|0:t)^ce,63),ce=t=b,_=t,t=C+le|0,t=(t=(I=J+de|0)>>>0<J>>>0?t+1|0:t)+_|0,R=we((_=I=(C=I)+U|0)^u,(I=C>>>0>_>>>0?t+1|0:t)^R,32),t=(C=b)+M|0,M=A=(u=R)+A|0,U=we(U^A,ce^(t=u>>>0>A>>>0?t+1|0:t),24),ce=A=b,u=t,me=U,de=R,t=I+q|0,t=(t=(R=_+ie|0)>>>0<_>>>0?t+1|0:t)+A|0,R=_=(I=R)+U|0,U=we(de^_,(A=C)^(C=I>>>0>_>>>0?t+1|0:t),16),t=(A=b)+u|0,ce=we(me^(de=_=(I=U)+M|0),(_=I>>>0>_>>>0?t+1|0:t)^ce,63),I=b,t=w+Q|0,t=(t=(u=d+B|0)>>>0<d>>>0?t+1|0:t)+p|0,u=we((p=d=u+m|0)^he,(d=d>>>0<m>>>0?t+1|0:t)^F,32),t=(t=g)+(g=b)|0,F=w,w=t=(m=u+ue|0)>>>0<u>>>0?t+1|0:t,M=we(m^B,F^t,24),B=t=b,F=t,t=d+r|0,t=(t=(p=p+K|0)>>>0<K>>>0?t+1|0:t)+F|0,Q=d=p+M|0,ue=we(d^u,(F=d>>>0<p>>>0?t+1|0:t)^g,16),t=w+(p=b)|0,he=d=m+ue|0,u=we(d^M,(g=d>>>0<m>>>0?t+1|0:t)^B,63),d=b,M=f,t=D+Z|0,t=(t=(w=f+re|0)>>>0<f>>>0?t+1|0:t)+N|0,f=t=(w=w+O|0)>>>0<O>>>0?t+1|0:t,m=we(w^X,t^T,32),t=(t=P)+(P=b)|0,O=N=m+$|0,T=we(M^N,(t=m>>>0>N>>>0?t+1|0:t)^D,24),N=t,B=O,M=m,t=f+c|0,f=m=w+G|0,t=(t=m>>>0<w>>>0?t+1|0:t)+(D=b)|0,X=we(M^(m=w=m+T|0),(O=m>>>0<f>>>0?t+1|0:t)^P,16),t=(t=N)+(N=b)|0,f=T,T=P=B+(w=X)|0,M=we(f^P,(w=w>>>0>P>>>0?t+1|0:t)^D,63),P=b,t=k+ee|0,t=(t=(f=h+L|0)>>>0<h>>>0?t+1|0:t)+S|0,E=we((S=f=f+j|0)^pe,(f=f>>>0<j>>>0?t+1|0:t)^E,32),t=(t=v)+(v=b)|0,j=k,k=t=(D=E+se|0)>>>0<E>>>0?t+1|0:t,B=we(D^L,j^t,24),L=t=b,j=t,Z=E,t=f+ge|0,t=(t=(E=S+z|0)>>>0<z>>>0?t+1|0:t)+j|0,j=f=E+B|0,S=we(Z^f,(E=f>>>0<E>>>0?t+1|0:t)^v,16),t=k+(f=b)|0,t=(v=D+S|0)>>>0<D>>>0?t+1|0:t,D=v,k=t,B=we(v^B,t^L,63),v=b,Z=T,L=S,t=C+ne|0,t=(t=(S=x+R|0)>>>0<x>>>0?t+1|0:t)+d|0,t=(C=S+u|0)>>>0<S>>>0?t+1|0:t,S=C,T=f,f=t,T=we(L^C,T^t,32),t=(t=w)+(w=b)|0,R=we((R=u)^(u=C=Z+T|0),(t=u>>>0<T>>>0?t+1|0:t)^d,24),L=d=b,C=t,t=f+s|0,t=(t=(S=S+H|0)>>>0<H>>>0?t+1|0:t)+d|0,t=(f=S+R|0)>>>0<S>>>0?t+1|0:t,S=f,d=f^T,T=t,pe=we(d,t^w,16),t=(t=C)+(C=b)|0,u=d=(w=pe)+u|0,L=we(f=d^R,(R=d>>>0<w>>>0?t+1|0:t)^L,63),f=b,Z=M,t=F+i|0,w=d=Q+te|0,t=(t=d>>>0<te>>>0?t+1|0:t)+P|0,A=we((M=d=d+M|0)^U,(d=d>>>0<w>>>0?t+1|0:t)^A,32),t=k+(w=b)|0,F=we(Z^(k=F=D+A|0),(t=D>>>0>k>>>0?t+1|0:t)^P,24),U=P=b,D=t,Q=F,Z=k,t=d+ae|0,t=(t=(k=M+V|0)>>>0<V>>>0?t+1|0:t)+P|0,F=d=k+F|0,P=we(P=d^A,(A=d>>>0<k>>>0?t+1|0:t)^w,16),t=(k=b)+D|0,$=d=Z+P|0,Z=we(Q^d,(w=d>>>0<P>>>0?t+1|0:t)^U,63),D=b,M=B,t=O+oe|0,t=(d=m+Y|0)>>>0<m>>>0?t+1|0:t,m=d,t=t+v|0,t=(d=d+B|0)>>>0<m>>>0?t+1|0:t,m=d,O=t,B=we(d^ue,t^p,32),t=(d=b)+_|0,U=p=B+de|0,M=we(M^p,(t=p>>>0<B>>>0?t+1|0:t)^v,24),_=t,p=d,re=a[n+132>>2],Q=M,t=O+(v=b)|0,t=(t=(M=m+M|0)>>>0<m>>>0?t+1|0:t)+re|0,O=t=(m=(d=a[n+128>>2])+(O=M)|0)>>>0<O>>>0?t+1|0:t,de=we(m^B,t^p,16),t=(p=b)+_|0,Q=we(Q^(M=(B=de)+U|0),(t=B>>>0>M>>>0?t+1|0:t)^v,63),_=b,B=t,U=P,t=I+fe|0,t=(t=(P=W+ce|0)>>>0<W>>>0?t+1|0:t)+E|0,N=we((v=P=P+j|0)^X,(j=v>>>0<j>>>0?t+1|0:t)^N,32),t=(P=b)+g|0,X=we((E=N+he|0)^ce,(t=E>>>0<N>>>0?t+1|0:t)^I,24),g=t,I=P,ce=a[n+196>>2],he=X,se=E,t=j+(ue=b)|0,t=(t=(E=v+X|0)>>>0<v>>>0?t+1|0:t)+ce|0,j=v=(P=a[n+192>>2])+E|0,E=t=v>>>0<E>>>0?t+1|0:t,X=we(v^N,t^I,16),t=(t=g)+(g=b)|0,N=we(he^(se=v=se+(I=X)|0),(v=v>>>0<I>>>0?t+1|0:t)^ue,63),ue=t=b,I=t,he=M,t=T+q|0,t=(t=(M=S+ie|0)>>>0<S>>>0?t+1|0:t)+I|0,t=(S=(T=M)+N|0)>>>0<T>>>0?t+1|0:t,T=S,I=t,M=we(S^U,t^k,32),t=(k=b)+B|0,B=S=he+M|0,U=we(N^S,ue^(t=S>>>0<M>>>0?t+1|0:t),24),q=N=b,S=t,t=I+re|0,t=(t=(T=d+T|0)>>>0<d>>>0?t+1|0:t)+N|0,ie=I=T+U|0,ue=we(I^M,(N=I>>>0<T>>>0?t+1|0:t)^k,16),t=(t=S)+(S=b)|0,T=I=(k=ue)+B|0,q=we(I^U,(M=I>>>0<k>>>0?t+1|0:t)^q,63),k=b,t=f+i|0,t=(t=(I=L+te|0)>>>0<te>>>0?t+1|0:t)+A|0,F=t=(I=I+F|0)>>>0<F>>>0?t+1|0:t,B=we(I^de,t^p,32),t=(t=v)+(v=b)|0,t=(p=(A=B)+se|0)>>>0<A>>>0?t+1|0:t,A=f,f=t,U=we(p^L,A^t,24),L=t=b,A=t,se=B,t=F+le|0,t=(t=(B=I+J|0)>>>0<I>>>0?t+1|0:t)+A|0,F=I=B+U|0,A=t=I>>>0<B>>>0?t+1|0:t,de=we(se^I,t^v,16),t=f+(B=b)|0,se=v=p+de|0,U=we(v^U,(f=v>>>0<p>>>0?t+1|0:t)^L,63),v=b,t=D+ne|0,t=(t=(I=x+Z|0)>>>0<x>>>0?t+1|0:t)+O|0,p=g,g=t=m>>>0>(I=m+I|0)>>>0?t+1|0:t,L=we(I^X,p^t,32),t=R+(m=b)|0,t=u>>>0>(O=u+L|0)>>>0?t+1|0:t,u=D,D=t,u=we(O^Z,u^t,24),R=t=b,p=t,X=u,t=g+oe|0,t=(t=(u=I+Y|0)>>>0<I>>>0?t+1|0:t)+p|0,I=L,L=g=X+u|0,Z=we(I^g,(p=m)^(m=g>>>0<u>>>0?t+1|0:t),16),t=D+(p=b)|0,O=we(X^(u=g=O+Z|0),(I=u>>>0<O>>>0?t+1|0:t)^R,63),g=b,t=_+ae|0,t=(t=(D=V+Q|0)>>>0<V>>>0?t+1|0:t)+E|0,t=(D=D+j|0)>>>0<j>>>0?t+1|0:t,j=D,D=t,E=we(j^pe,t^C,32),t=(t=w)+(w=b)|0,R=C=E+$|0,Q=we(C^Q,(t=C>>>0<E>>>0?t+1|0:t)^_,24),oe=_=b,C=t,t=D+fe|0,t=(t=(j=j+W|0)>>>0<W>>>0?t+1|0:t)+_|0,j=t=(D=j+Q|0)>>>0<j>>>0?t+1|0:t,_=(w=E=we(D^E,t^w,16))+R|0,t=(t=C)+(C=b)|0,R=Q,Q=_,R=we(R^_,(w=w>>>0>_>>>0?t+1|0:t)^oe,63),_=b,X=u,Y=E,t=N+ge|0,N=E=z+ie|0,t=(t=E>>>0<z>>>0?t+1|0:t)+v|0,t=(E=E+U|0)>>>0<N>>>0?t+1|0:t,N=E,u=C,C=t,u=we(Y^E,u^t,32),t=(t=I)+(I=b)|0,Y=U,U=E=X+u|0,ie=we(Y^E,(t=u>>>0>E>>>0?t+1|0:t)^v,24),oe=v=b,E=t,t=C+r|0,t=(t=(N=N+K|0)>>>0<K>>>0?t+1|0:t)+v|0,Y=C=N+ie|0,X=we(C^u,(v=I)^(I=C>>>0<N>>>0?t+1|0:t),16),t=(C=b)+E|0,E=v=(N=X)+U|0,ie=we(v^ie,(N=v>>>0<N>>>0?t+1|0:t)^oe,63),v=b,U=O,t=A+ee|0,t=(t=(O=h+F|0)>>>0<F>>>0?t+1|0:t)+g|0,u=we((A=F=U+O|0)^ue,(u=S)^(S=O>>>0>A>>>0?t+1|0:t),32),t=(t=w)+(w=b)|0,O=g,g=t=u>>>0>(F=u+Q|0)>>>0?t+1|0:t,U=we(U^F,O^t,24),Q=t=b,O=t,t=S+c|0,t=(t=(A=A+G|0)>>>0<G>>>0?t+1|0:t)+O|0,O=t=(S=A+U|0)>>>0<A>>>0?t+1|0:t,w=we(S^u,t^w,16),t=g+(A=b)|0,t=(u=F+w|0)>>>0<F>>>0?t+1|0:t,F=u,u=t,Q=we(F^U,t^Q,63),g=b,$=R,t=m+s|0,t=(t=(R=L+H|0)>>>0<H>>>0?t+1|0:t)+_|0,L=we((U=m=$+R|0)^de,(m=m>>>0<R>>>0?t+1|0:t)^B,32),t=M+(R=b)|0,M=_,_=t=(B=T+L|0)>>>0<T>>>0?t+1|0:t,B=we($^(T=B),M^t,24),oe=t=b,M=t,$=B,t=m+ce|0,t=(t=(B=P+U|0)>>>0<P>>>0?t+1|0:t)+M|0,M=R,R=t=(m=$+B|0)>>>0<B>>>0?t+1|0:t,de=we(m^L,M^t,16),t=_+(M=b)|0,t=(B=T+de|0)>>>0<T>>>0?t+1|0:t,oe=we($^(T=B),t^oe,63),_=b,B=t,t=k+j|0,t=(t=(L=D+q|0)>>>0<D>>>0?t+1|0:t)+(ue=a[n+156>>2])|0,j=t=(D=(U=a[n+152>>2])+(j=L)|0)>>>0<j>>>0?t+1|0:t,L=we(D^Z,t^p,32),t=(t=f)+(f=b)|0,Z=we((p=L+se|0)^q,(t=p>>>0<L>>>0?t+1|0:t)^k,24),k=t,pe=a[n+236>>2],se=p,$=L,t=j+(q=b)|0,t=(t=(L=D+Z|0)>>>0<D>>>0?t+1|0:t)+pe|0,t=(D=(p=a[n+232>>2])+(j=L)|0)>>>0<j>>>0?t+1|0:t,j=f,f=t,$=we($^D,j^t,16),t=(t=k)+(k=b)|0,L=t=(j=se+(L=$)|0)>>>0<L>>>0?t+1|0:t,q=we(j^Z,t^q,63),Z=t=b,se=T,T=w,t=I+ne|0,t=(t=(w=x+Y|0)>>>0<x>>>0?t+1|0:t)+Z|0,A=we(T^(ne=x=w+q|0),(x=w>>>0>x>>>0?t+1|0:t)^A,32),t=(w=b)+B|0,B=I=se+A|0,Z=we(q^I,Z^(t=I>>>0<A>>>0?t+1|0:t),24),q=I=b,T=t,Y=A,t=x+c|0,t=(t=(A=G+ne|0)>>>0<G>>>0?t+1|0:t)+I|0,Y=we(Y^(I=x=A+Z|0),(A=I>>>0<A>>>0?t+1|0:t)^w,16),t=(t=T)+(T=b)|0,B=x=(w=Y)+B|0,ne=we(ne=x^Z,(Z=w>>>0>x>>>0?t+1|0:t)^q,63),w=b,t=v+s|0,t=(t=(x=H+ie|0)>>>0<H>>>0?t+1|0:t)+O|0,M=we((q=x=x+S|0)^de,(x=x>>>0<S>>>0?t+1|0:t)^M,32),t=L+(S=b)|0,t=(O=j+M|0)>>>0<j>>>0?t+1|0:t,j=O,L=v,v=t,L=we(O^ie,L^t,24),ie=t=b,O=t,se=M,t=x+ae|0,t=(t=(M=V+q|0)>>>0<V>>>0?t+1|0:t)+O|0,q=x=M+L|0,de=we(se^x,(O=S)^(S=x>>>0<M>>>0?t+1|0:t),16),t=v+(O=b)|0,t=(x=j+de|0)>>>0<j>>>0?t+1|0:t,j=x,M=t,L=we(x^L,t^ie,63),v=b,t=g+re|0,t=(t=(x=d+Q|0)>>>0<d>>>0?t+1|0:t)+R|0,t=m>>>0>(x=m+x|0)>>>0?t+1|0:t,m=x,x=t,R=we(m^$,t^k,32),t=N+(d=b)|0,t=E>>>0>(k=E+R|0)>>>0?t+1|0:t,E=g,g=t,N=we(k^Q,E^t,24),re=t=b,E=t,Q=N,t=x+ee|0,t=(t=(N=h+m|0)>>>0<h>>>0?t+1|0:t)+E|0,m=R,R=x=Q+(h=N)|0,ee=we(m^x,(E=h>>>0>x>>>0?t+1|0:t)^d,16),t=g+(N=b)|0,ie=x=k+ee|0,m=we(Q^x,(d=x>>>0<k>>>0?t+1|0:t)^re,63),x=b,t=_+ce|0,t=(t=(h=P+oe|0)>>>0<P>>>0?t+1|0:t)+f|0,t=(h=h+D|0)>>>0<D>>>0?t+1|0:t,D=h,h=t,k=we(D^X,t^C,32),t=u+(P=b)|0,f=_,_=t=(g=F+k|0)>>>0<F>>>0?t+1|0:t,C=we(g^oe,f^t,24),F=t=b,f=t,u=C,t=h+ue|0,t=(t=(D=D+U|0)>>>0<U>>>0?t+1|0:t)+f|0,f=h=D+C|0,C=we(h^k,(D=h>>>0<D>>>0?t+1|0:t)^P,16),t=_+(k=b)|0,re=h=g+C|0,u=we(u^h,(P=h>>>0<g>>>0?t+1|0:t)^F,63),h=b,t=v+A|0,t=(g=I+L|0)>>>0<I>>>0?t+1|0:t,I=g,t=t+(_=a[n+164>>2])|0,k=we((_=C)^(C=g=g+a[n+160>>2]|0),(g=g>>>0<I>>>0?t+1|0:t)^k,32),t=(t=d)+(d=b)|0,F=v,v=t=(I=k)>>>0>(_=I+ie|0)>>>0?t+1|0:t,F=we(_^L,F^t,24),A=t=b,I=t,L=k,t=g+pe|0,t=(t=(k=C+p|0)>>>0<p>>>0?t+1|0:t)+I|0,Q=we(L^(ie=g=k+F|0),(g=g>>>0<k>>>0?t+1|0:t)^d,16),t=v+(I=b)|0,t=(d=_+Q|0)>>>0<_>>>0?t+1|0:t,_=d,k=t,U=we(d^F,t^A,63),d=b,A=m,t=S+le|0,C=v=J+q|0,t=(t=v>>>0<J>>>0?t+1|0:t)+x|0,F=we((S=v=v+m|0)^Y,(v=v>>>0<C>>>0?t+1|0:t)^T,32),t=(t=P)+(P=b)|0,p=x,x=t=(m=F)>>>0>(C=m+re|0)>>>0?t+1|0:t,T=we(A^C,p^t,24),p=t=b,m=t,t=v+i|0,t=(t=(S=S+te|0)>>>0<te>>>0?t+1|0:t)+m|0,v=we((m=v=S+T|0)^F,(S=m>>>0<S>>>0?t+1|0:t)^P,16),t=x+(F=b)|0,t=C>>>0>(P=C+v|0)>>>0?t+1|0:t,P=(C=P)^T,T=t,L=we(P,t^p,63),x=b,Y=u,t=E+fe|0,t=(t=(P=R+W|0)>>>0<W>>>0?t+1|0:t)+h|0,u=we((A=P=(E=P)+u|0)^de,(P=A>>>0<E>>>0?t+1|0:t)^O,32),t=Z+(E=b)|0,p=h,h=t=(O=B+u|0)>>>0<B>>>0?t+1|0:t,R=we(Y^O,p^t,24),B=t=b,p=t,t=P+ge|0,t=(t=(A=A+z|0)>>>0<z>>>0?t+1|0:t)+p|0,Z=we((p=P=A+R|0)^u,(P=E)^(E=p>>>0<A>>>0?t+1|0:t),16),t=h+(A=b)|0,B=we((h=P=O+Z|0)^R,(t=h>>>0<O>>>0?t+1|0:t)^B,63),P=b,O=t,t=w+r|0,t=(t=(u=K+ne|0)>>>0<K>>>0?t+1|0:t)+D|0,f=t=(u=u+f|0)>>>0<f>>>0?t+1|0:t,R=we(u^ee,t^N,32),t=M+(D=b)|0,t=(N=j+R|0)>>>0<j>>>0?t+1|0:t,j=N,M=w,w=t,t=we(N^ne,M^t,24),ne=a[n+204>>2],Y=t,N=t,u=t+u|0,t=(M=b)+f|0,t=(t=u>>>0<N>>>0?t+1|0:t)+ne|0,t=(f=u+a[n+200>>2]|0)>>>0<u>>>0?t+1|0:t,u=D,D=t,ne=we(f^R,u^t,16),t=w+(N=b)|0,w=u=j+ne|0,R=we(Y^u,(j=u>>>0<j>>>0?t+1|0:t)^M,63),u=t=b,X=h,Y=v,t=g+c|0,v=h=G+ie|0,t=(t=h>>>0<G>>>0?t+1|0:t)+u|0,ee=we(Y^(M=h=h+R|0),(h=h>>>0<v>>>0?t+1|0:t)^F,32),t=(v=b)+O|0,F=t=(g=X+(F=ee)|0)>>>0<F>>>0?t+1|0:t,u=we(R^g,u^t,24),re=t=b,O=t,Y=u,t=h+i|0,t=(t=(u=M+te|0)>>>0<te>>>0?t+1|0:t)+O|0,O=h=Y+u|0,ee=we(h^ee,(u=h>>>0<u>>>0?t+1|0:t)^v,16),t=F+(R=b)|0,F=h=g+ee|0,v=we(Y^h,(M=h>>>0<g>>>0?t+1|0:t)^re,63),g=b,Y=U,t=d+r|0,t=(t=(h=K+U|0)>>>0<K>>>0?t+1|0:t)+S|0,A=we((U=h=h+m|0)^Z,(h=h>>>0<m>>>0?t+1|0:t)^A,32),t=j+(m=b)|0,t=w>>>0>(S=w+A|0)>>>0?t+1|0:t,w=S,S=d,d=t,S=we(Y^w,S^t,24),Z=t=b,j=t,Y=S,t=h+fe|0,t=(t=(S=U+W|0)>>>0<W>>>0?t+1|0:t)+j|0,re=h=Y+S|0,q=we(h^A,(j=h>>>0<S>>>0?t+1|0:t)^m,16),t=d+(m=b)|0,t=(h=w+q|0)>>>0<w>>>0?t+1|0:t,w=h,S=t,A=we(Y^h,t^Z,63),d=b,t=x+ge|0,t=(t=(h=L+z|0)>>>0<z>>>0?t+1|0:t)+E|0,t=(h=h+p|0)>>>0<p>>>0?t+1|0:t,p=h,h=t,U=we(p^ne,t^N,32),t=k+(E=b)|0,k=x,x=t=_>>>0>(N=_+U|0)>>>0?t+1|0:t,t=we((_=N)^L,k^t,24),L=a[n+236>>2],Y=t,N=t,p=t+p|0,t=(k=b)+h|0,t=(t=p>>>0<N>>>0?t+1|0:t)+L|0,t=(h=p+a[n+232>>2]|0)>>>0<p>>>0?t+1|0:t,N=h,p=E,E=t,Z=we(h^U,p^t,16),t=x+(p=b)|0,U=we(Y^(L=h=_+Z|0),(h=h>>>0<_>>>0?t+1|0:t)^k,63),x=b,Y=B,t=P+D|0,t=(t=(_=f+B|0)>>>0<f>>>0?t+1|0:t)+(k=a[n+164>>2])|0,B=we((k=_=(f=_)+a[n+160>>2]|0)^Q,(_=f>>>0>_>>>0?t+1|0:t)^I,32),t=T+(f=b)|0,t=C>>>0>(I=C+B|0)>>>0?t+1|0:t,C=P,P=t,C=we(Y^I,C^t,24),T=t=b,D=t,t=_+ae|0,t=(t=(k=k+V|0)>>>0<V>>>0?t+1|0:t)+D|0,k=we((ne=_=k+C|0)^B,(_=_>>>0<k>>>0?t+1|0:t)^f,16),t=P+(f=b)|0,t=(D=I+k|0)>>>0<I>>>0?t+1|0:t,I=D,D=t,B=we(I^C,t^T,63),P=b,T=k,t=d+u|0,t=(k=A+O|0)>>>0<O>>>0?t+1|0:t,O=k,t=t+(C=a[n+132>>2])|0,t=(k=k+a[n+128>>2]|0)>>>0<O>>>0?t+1|0:t,O=k,u=f,f=t,T=we(T^k,u^t,32),t=(t=h)+(h=b)|0,u=d,d=t=(C=T)>>>0>(k=C+L|0)>>>0?t+1|0:t,A=we(k^A,u^t,24),u=t=b,t=f+le|0,t=(t=(O=O+J|0)>>>0<J>>>0?t+1|0:t)+u|0,Q=we((ie=f=O+A|0)^T,(f=f>>>0<O>>>0?t+1|0:t)^h,16),t=d+(C=b)|0,t=(h=k+Q|0)>>>0<k>>>0?t+1|0:t,k=h,O=t,L=we(h^A,t^u,63),h=b,t=j+s|0,j=d=H+re|0,t=(t=d>>>0<H>>>0?t+1|0:t)+x|0,u=we((A=d=d+U|0)^ee,(d=d>>>0<j>>>0?t+1|0:t)^R,32),t=D+(j=b)|0,t=I>>>0>(T=I+u|0)>>>0?t+1|0:t,I=T,T=x,x=t,t=we(I^U,T^t,24),R=a[n+156>>2],U=t,T=t,A=t+A|0,t=(D=b)+d|0,t=(t=A>>>0<T>>>0?t+1|0:t)+R|0,t=(d=A+a[n+152>>2]|0)>>>0<A>>>0?t+1|0:t,T=d,A=j,j=t,ee=we(d^u,A^t,16),t=x+(A=b)|0,t=(d=I+ee|0)>>>0<I>>>0?t+1|0:t,I=d,u=D,D=t,U=we(U^d,u^t,63),d=b,t=P+E|0,E=x=N+B|0,t=(t=x>>>0<N>>>0?t+1|0:t)+(u=a[n+204>>2])|0,E=t=(x=x+a[n+200>>2]|0)>>>0<E>>>0?t+1|0:t,R=we(x^q,t^m,32),t=M+(N=b)|0,u=P,P=t=(m=F+R|0)>>>0<F>>>0?t+1|0:t,u=we(m^B,u^t,24),F=t=b,B=u,t=t+E|0,t=(t=(u=u+x|0)>>>0<x>>>0?t+1|0:t)+(M=a[n+148>>2])|0,t=(x=u+a[n+144>>2]|0)>>>0<u>>>0?t+1|0:t,E=x,u=N,N=t,re=we(x^R,u^t,16),t=P+(u=b)|0,P=F,F=t=m>>>0>(x=m+re|0)>>>0?t+1|0:t,M=we(B^(m=x),P^t,63),P=b,B=v,t=g+_|0,t=(t=(x=v+ne|0)>>>0<v>>>0?t+1|0:t)+(R=a[n+196>>2])|0,R=x=(v=x)+a[n+192>>2]|0,p=we(x^Z,(v=v>>>0>x>>>0?t+1|0:t)^p,32),t=S+(_=b)|0,S=x=w+p|0,x=we(B^x,(t=w>>>0>x>>>0?t+1|0:t)^g,24),w=t,Z=a[n+220>>2],$=x,X=S,Y=p,t=(g=b)+v|0,t=(t=(p=x+R|0)>>>0<x>>>0?t+1|0:t)+(B=Z)|0,ne=we(Y^(p=x=(S=a[n+216>>2])+(v=p)|0),(x=_)^(_=v>>>0>p>>>0?t+1|0:t),16),t=(t=w)+(w=b)|0,R=t=(v=ne)>>>0>(x=X+v|0)>>>0?t+1|0:t,t=we($^x,t^g,63),q=a[n+236>>2],Y=t,g=t,B=t+ie|0,t=(v=b)+f|0,t=(t=g>>>0>B>>>0?t+1|0:t)+q|0,ee=we((B=g=(f=B)+a[n+232>>2]|0)^ee,(g=g>>>0<f>>>0?t+1|0:t)^A,32),t=F+(f=b)|0,F=v,v=t=m>>>0>(A=m+ee|0)>>>0?t+1|0:t,A=t=we(Y^(m=A),F^t,24),B=t+B|0,t=(F=b)+g|0,t=Z+(A>>>0>B>>>0?t+1|0:t)|0,Z=g=S+B|0,ee=we(g^ee,(B=f)^(f=g>>>0<S>>>0?t+1|0:t),16),t=v+(S=b)|0,v=F,F=t=(g=m+ee|0)>>>0<m>>>0?t+1|0:t,v=we(A^(m=g),v^t,63),g=b,t=h+le|0,t=(t=(A=L+J|0)>>>0<J>>>0?t+1|0:t)+j|0,B=A=A+T|0,u=we(A^re,(j=A>>>0<T>>>0?t+1|0:t)^u,32),t=R+(T=b)|0,t=x>>>0>(A=x+u|0)>>>0?t+1|0:t,x=A,R=h,h=t,R=we(A^L,R^t,24),L=t=b,A=t,Y=u,t=j+ge|0,t=(t=(u=B+z|0)>>>0<z>>>0?t+1|0:t)+A|0,q=we(Y^(re=j=u+R|0),(j=u>>>0>j>>>0?t+1|0:t)^T,16),t=h+(T=b)|0,u=t=x>>>0>(A=x+q|0)>>>0?t+1|0:t,R=we(A^R,t^L,63),x=b,t=d+c|0,t=(t=(h=U+G|0)>>>0<G>>>0?t+1|0:t)+N|0,B=we((N=h=h+E|0)^ne,(h=h>>>0<E>>>0?t+1|0:t)^w,32),t=O+(w=b)|0,t=(E=k+B|0)>>>0<k>>>0?t+1|0:t,k=E,E=d,d=t,O=we(k^U,E^t,24),U=t=b,E=t,t=h+r|0,t=(t=(N=N+K|0)>>>0<K>>>0?t+1|0:t)+E|0,E=h=N+O|0,L=we(h^B,(L=w)^(w=h>>>0<N>>>0?t+1|0:t),16),t=d+(N=b)|0,t=(h=k+L|0)>>>0<k>>>0?t+1|0:t,k=h,d=h^O,O=t,B=we(d,t^U,63),h=b,Y=M,t=P+_|0,_=d=p+M|0,t=(t=d>>>0<p>>>0?t+1|0:t)+(U=a[n+156>>2])|0,_=t=(d=d+a[n+152>>2]|0)>>>0<_>>>0?t+1|0:t,M=we(d^Q,t^C,32),t=D+(C=b)|0,t=(p=I+M|0)>>>0<I>>>0?t+1|0:t,I=p,D=P,P=t,p=we(Y^p,D^t,24),D=t=b,Q=p,t=t+_|0,t=(t=(p=d+p|0)>>>0<d>>>0?t+1|0:t)+(U=a[n+204>>2])|0,ne=d=p+a[n+200>>2]|0,p=we(d^M,(_=d>>>0<p>>>0?t+1|0:t)^C,16),t=P+(C=b)|0,P=d=I+p|0,M=we(Q^d,(I=d>>>0<I>>>0?t+1|0:t)^D,63),d=b,U=R,t=f+i|0,t=(t=(D=Z+te|0)>>>0<te>>>0?t+1|0:t)+x|0,D=t=(f=D+R|0)>>>0<D>>>0?t+1|0:t,R=we(f^p,t^C,32),t=O+(C=b)|0,t=(p=k+R|0)>>>0<k>>>0?t+1|0:t,k=p,O=x,x=t,p=we(U^p,O^t,24),O=t=b,Q=p,t=t+D|0,t=(t=(p=f+p|0)>>>0<f>>>0?t+1|0:t)+(U=a[n+132>>2])|0,ie=we((Z=f=p+a[n+128>>2]|0)^R,(f=f>>>0<p>>>0?t+1|0:t)^C,16),t=x+(D=b)|0,t=(C=k+ie|0)>>>0<k>>>0?t+1|0:t,k=C,C=t,U=we(Q^k,t^O,63),x=b,t=j+fe|0,t=(t=(O=W+re|0)>>>0<W>>>0?t+1|0:t)+h|0,R=we((p=j=O+B|0)^ee,(j=O>>>0>p>>>0?t+1|0:t)^S,32),t=I+(S=b)|0,t=P>>>0>(O=P+R|0)>>>0?t+1|0:t,P=O,O=h,h=t,t=we(P^B,O^t,24),B=a[n+164>>2],Q=t,O=t,p=t+p|0,t=(I=b)+j|0,t=(t=p>>>0<O>>>0?t+1|0:t)+B|0,t=p>>>0>(j=p+a[n+160>>2]|0)>>>0?t+1|0:t,p=S,S=t,O=we(j^R,p^t,16),t=h+(p=b)|0,h=I,I=t=P>>>0>(R=P+O|0)>>>0?t+1|0:t,h=we(Q^R,h^t,63),P=b,Q=M,t=d+w|0,t=(t=(M=E+M|0)>>>0<E>>>0?t+1|0:t)+(B=a[n+196>>2])|0,B=we((M=w=(E=M)+a[n+192>>2]|0)^q,(w=w>>>0<E>>>0?t+1|0:t)^T,32),t=F+(E=b)|0,F=d,d=t=m>>>0>(T=m+B|0)>>>0?t+1|0:t,T=we(Q^(m=T),F^t,24),ee=t=b,F=t,Q=T,t=w+s|0,t=(t=(T=M+H|0)>>>0<H>>>0?t+1|0:t)+F|0,q=we((re=w=Q+T|0)^B,(w=w>>>0<T>>>0?t+1|0:t)^E,16),t=d+(E=b)|0,t=m>>>0>(F=m+q|0)>>>0?t+1|0:t,M=we(Q^(m=F),t^ee,63),d=b,F=t,Q=v,t=g+_|0,t=(t=(T=v+ne|0)>>>0<v>>>0?t+1|0:t)+(B=a[n+148>>2])|0,L=we((B=v=(_=T)+a[n+144>>2]|0)^L,(v=v>>>0<_>>>0?t+1|0:t)^N,32),t=u+(_=b)|0,u=g,g=t=A>>>0>(N=A+L|0)>>>0?t+1|0:t,A=we(Q^N,u^t,24),u=t=b,Q=A,t=v+ae|0,t=(t=(A=B+V|0)>>>0<V>>>0?t+1|0:t)+u|0,T=v=Q+A|0,L=we(v^L,(B=_)^(_=v>>>0<A>>>0?t+1|0:t),16),t=g+(A=b)|0,u=we(Q^(g=v=N+L|0),(N=g>>>0<N>>>0?t+1|0:t)^u,63),B=t=b,v=t,Q=m,t=f+s|0,t=(t=(m=H+Z|0)>>>0<H>>>0?t+1|0:t)+v|0,Z=f=m+u|0,p=we(f^O,(v=f>>>0<m>>>0?t+1|0:t)^p,32),t=(f=b)+F|0,F=t=(m=Q+p|0)>>>0<p>>>0?t+1|0:t,u=we(u^m,B^t,24),B=t=b,O=t,Q=p,t=v+fe|0,t=(t=(p=W+Z|0)>>>0<W>>>0?t+1|0:t)+O|0,Z=v=p+u|0,ne=we(Q^v,(O=f)^(f=v>>>0<p>>>0?t+1|0:t),16),t=F+(O=b)|0,F=t=(v=m+ne|0)>>>0<m>>>0?t+1|0:t,B=we((m=v)^u,t^B,63),v=b,t=x+ge|0,t=(t=(p=U+z|0)>>>0<z>>>0?t+1|0:t)+S|0,j=t=(p=p+j|0)>>>0<j>>>0?t+1|0:t,u=we(p^q,t^E,32),t=N+(E=b)|0,t=g>>>0>(S=g+u|0)>>>0?t+1|0:t,g=S,S=x,x=t,t=we(g^U,S^t,24),U=a[n+204>>2],Q=t,S=t,p=t+p|0,t=(N=b)+j|0,t=(t=S>>>0>p>>>0?t+1|0:t)+U|0,q=we((ee=j=p+a[n+200>>2]|0)^u,(j=p>>>0>j>>>0?t+1|0:t)^E,16),t=x+(E=b)|0,u=N,N=t=g>>>0>(S=g+q|0)>>>0?t+1|0:t,u=we(Q^S,u^t,63),x=b,U=h,t=w+P|0,t=(t=(g=h+re|0)>>>0<h>>>0?t+1|0:t)+(p=a[n+220>>2])|0,A=we((p=h=g+a[n+216>>2]|0)^L,(h=h>>>0<g>>>0?t+1|0:t)^A,32),t=C+(g=b)|0,t=(w=k+A|0)>>>0<k>>>0?t+1|0:t,k=P,P=t,t=we(U^w,k^t,24),U=a[n+156>>2],L=t,C=t,p=t+p|0,t=(k=b)+h|0,t=(t=C>>>0>p>>>0?t+1|0:t)+U|0,re=h=p+a[n+152>>2]|0,Q=we(h^A,(C=h>>>0<p>>>0?t+1|0:t)^g,16),t=P+(p=b)|0,t=(h=w+Q|0)>>>0<w>>>0?t+1|0:t,w=h,g=k,k=t,P=we(L^h,g^t,63),g=b,L=M,t=d+_|0,_=h=T+M|0,t=(t=h>>>0<T>>>0?t+1|0:t)+(A=a[n+132>>2])|0,_=t=(h=h+a[n+128>>2]|0)>>>0<_>>>0?t+1|0:t,M=we(h^ie,t^D,32),t=I+(D=b)|0,A=we(L^(I=T=R+M|0),(T=d)^(d=I>>>0<R>>>0?t+1|0:t),24),T=t=b,L=A,t=t+_|0,_=A=h+A|0,t=(t=A>>>0<h>>>0?t+1|0:t)+(R=a[n+196>>2])|0,A=h=A+a[n+192>>2]|0,R=we(h^M,(R=D)^(D=h>>>0<_>>>0?t+1|0:t),16),t=d+(_=b)|0,t=(h=I+R|0)>>>0<I>>>0?t+1|0:t,I=h,d=T,T=t,U=we(L^h,d^t,63),h=b,M=u,t=f+c|0,f=d=G+Z|0,t=(t=d>>>0<G>>>0?t+1|0:t)+x|0,t=(d=d+u|0)>>>0<f>>>0?t+1|0:t,f=_,_=t,R=we(d^R,f^t,32),t=k+(f=b)|0,k=u=w+R|0,u=we(M^u,(t=w>>>0>u>>>0?t+1|0:t)^x,24),w=t,Z=a[n+148>>2],Y=u,L=k,t=_+(x=b)|0,t=(t=(u=d+u|0)>>>0<d>>>0?t+1|0:t)+(M=Z)|0,ie=d=(k=a[n+144>>2])+u|0,oe=we(d^R,(_=f)^(f=d>>>0<u>>>0?t+1|0:t),16),t=(u=b)+w|0,R=d=L+(_=oe)|0,d=we(Y^d,(M=d>>>0<_>>>0?t+1|0:t)^x,63),_=b,L=P,t=g+j|0,t=(x=P+ee|0)>>>0<P>>>0?t+1|0:t,P=x,t=t+(w=a[n+236>>2])|0,O=we((j=x=x+a[n+232>>2]|0)^ne,(x=x>>>0<P>>>0?t+1|0:t)^O,32),t=T+(P=b)|0,t=(w=I+O|0)>>>0<I>>>0?t+1|0:t,I=g,g=t,T=we(L^w,I^t,24),L=t=b,I=t,t=x+le|0,t=(t=(j=j+J|0)>>>0<J>>>0?t+1|0:t)+I|0,ne=x=j+T|0,x=we(x^O,(I=x>>>0<j>>>0?t+1|0:t)^P,16),t=g+(j=b)|0,O=P=w+x|0,L=we(g=P^T,(T=w>>>0>P>>>0?t+1|0:t)^L,63),P=b,Y=U,t=C+r|0,w=g=K+re|0,t=(t=g>>>0<K>>>0?t+1|0:t)+h|0,w=t=(g=g+U|0)>>>0<w>>>0?t+1|0:t,U=we(g^q,t^E,32),t=F+(C=b)|0,t=m>>>0>(E=m+U|0)>>>0?t+1|0:t,F=we(Y^(m=E),t^h,24),E=t,ee=a[n+164>>2],$=F,X=m,t=w+(h=b)|0,t=(t=(F=g+F|0)>>>0<g>>>0?t+1|0:t)+ee|0,F=g=(m=a[n+160>>2])+(w=F)|0,re=we(g^U,(Y=C)^(C=g>>>0<w>>>0?t+1|0:t),16),t=(t=E)+(E=b)|0,t=(g=X+(w=re)|0)>>>0<w>>>0?t+1|0:t,w=g,U=h,h=t,U=we($^g,U^t,63),g=b,Y=B,t=v+ae|0,t=(t=(B=B+V|0)>>>0<V>>>0?t+1|0:t)+D|0,D=t=A>>>0>(B=A+B|0)>>>0?t+1|0:t,q=we(B^Q,t^p,32),t=N+(p=b)|0,N=A=S+q|0,A=we(Y^A,(Q=v)^(v=S>>>0>A>>>0?t+1|0:t),24),Q=t=b,S=t,Y=A,t=D+i|0,t=(t=(A=B+te|0)>>>0<te>>>0?t+1|0:t)+S|0,S=t=(D=Y+A|0)>>>0<A>>>0?t+1|0:t,q=we(D^q,t^p,16),t=v+(p=b)|0,t=(A=N+q|0)>>>0<N>>>0?t+1|0:t,N=A,A=t,B=we(Y^N,t^Q,63),Q=t=b,v=t,Y=x,t=f+ae|0,t=(t=(x=V+ie|0)>>>0<V>>>0?t+1|0:t)+v|0,j=we(Y^(f=V=x+B|0),(x=x>>>0>f>>>0?t+1|0:t)^j,32),t=h+(v=b)|0,ae=V=w+j|0,w=t=w>>>0>V>>>0?t+1|0:t,Q=V=we(B^V,Q^t,24),t=(h=b)+x|0,t=(t=(f=f+V|0)>>>0<V>>>0?t+1|0:t)+Z|0,Z=we((B=V=f+k|0)^j,(f=k>>>0>B>>>0?t+1|0:t)^v,16),t=(k=b)+w|0,ae=V=(x=Z)+ae|0,v=we(Q^V,(x=x>>>0>V>>>0?t+1|0:t)^h,63),w=b,Q=d,t=I+_|0,t=(t=(V=d+ne|0)>>>0<d>>>0?t+1|0:t)+(h=a[n+196>>2])|0,E=we((j=V=(d=V)+a[n+192>>2]|0)^re,(V=d>>>0>j>>>0?t+1|0:t)^E,32),t=A+(h=b)|0,I=_,_=t=(d=N+E|0)>>>0<N>>>0?t+1|0:t,A=t=we(Q^d,I^t,24),N=E,E=j,j=t,E=E+t|0,t=(I=b)+V|0,t=ee+(E>>>0<j>>>0?t+1|0:t)|0,ne=V=m+E|0,ee=we(N^V,(j=m>>>0>V>>>0?t+1|0:t)^h,16),t=_+(E=b)|0,A=we(A^(_=V=d+ee|0),(h=I)^(I=d>>>0>_>>>0?t+1|0:t),63),V=b,t=P+le|0,t=(t=(h=L+J|0)>>>0<J>>>0?t+1|0:t)+C|0,F=we((m=h=h+F|0)^q,(h=h>>>0<F>>>0?t+1|0:t)^p,32),t=M+(d=b)|0,p=P,P=t=(C=R+F|0)>>>0<R>>>0?t+1|0:t,p=we(C^L,p^t,24),R=t=b,N=t,t=h+s|0,t=(t=(m=m+H|0)>>>0<H>>>0?t+1|0:t)+N|0,N=h=m+p|0,L=we(h^F,(m=h>>>0<m>>>0?t+1|0:t)^d,16),t=P+(F=b)|0,d=we((d=p)^(p=h=C+L|0),(h=h>>>0<C>>>0?t+1|0:t)^R,63),P=b,t=g+r|0,t=(t=(C=K+U|0)>>>0<K>>>0?t+1|0:t)+S|0,R=C=C+D|0,u=we(C^oe,(D=C>>>0<D>>>0?t+1|0:t)^u,32),t=T+(C=b)|0,t=(S=O+u|0)>>>0<O>>>0?t+1|0:t,O=g,g=t,T=we(S^U,O^t,24),M=t=b,O=t,U=T,t=D+i|0,t=(t=(T=R+te|0)>>>0<te>>>0?t+1|0:t)+O|0,T=we((R=D=U+T|0)^u,(D=D>>>0<T>>>0?t+1|0:t)^C,16),t=g+(C=b)|0,t=S>>>0>(O=S+T|0)>>>0?t+1|0:t,S=O,O=t,u=we(U^S,t^M,63),g=b,Q=A,U=p,M=T,t=f+fe|0,t=(t=(T=B+W|0)>>>0<W>>>0?t+1|0:t)+V|0,A=we(M^(p=f=T+A|0),(f=p>>>0<T>>>0?t+1|0:t)^C,32),t=(t=h)+(h=b)|0,T=V,V=t=(C=U+A|0)>>>0<A>>>0?t+1|0:t,t=we(Q^C,T^t,24),M=a[n+220>>2],Q=t,U=A,T=p,p=t,A=T+t|0,t=(T=b)+f|0,t=(t=p>>>0>A>>>0?t+1|0:t)+M|0,U=we(U^(B=f=(p=A)+a[n+216>>2]|0),(f=f>>>0<p>>>0?t+1|0:t)^h,16),t=V+(p=b)|0,t=(h=C+U|0)>>>0<C>>>0?t+1|0:t,C=h,A=T,T=t,V=we(Q^h,A^t,63),h=b,Q=d,t=P+j|0,j=A=d+ne|0,t=(t=A>>>0<d>>>0?t+1|0:t)+(M=a[n+204>>2])|0,M=we((A=d=A+a[n+200>>2]|0)^Z,(d=d>>>0<j>>>0?t+1|0:t)^k,32),t=O+(k=b)|0,t=S>>>0>(j=S+M|0)>>>0?t+1|0:t,S=P,P=t,O=we(Q^j,S^t,24),Z=t=b,S=t,Q=O,t=d+ge|0,t=(t=(O=A+z|0)>>>0<z>>>0?t+1|0:t)+S|0,ne=d=Q+O|0,re=we(d^M,(S=k)^(k=d>>>0<O>>>0?t+1|0:t),16),t=P+(S=b)|0,t=(d=j+re|0)>>>0<j>>>0?t+1|0:t,j=d,O=t,d=we(Q^d,t^Z,63),P=b,Q=u,t=g+m|0,m=u=u+N|0,t=(t=u>>>0<N>>>0?t+1|0:t)+(M=Z=a[n+156>>2])|0,M=we((u=N=(A=a[n+152>>2])+u|0)^ee,(N=E)^(E=m>>>0>u>>>0?t+1|0:t),32),t=(t=x)+(x=b)|0,t=(m=M)>>>0>(N=m+ae|0)>>>0?t+1|0:t,m=g,g=t,ae=we(Q^N,m^t,24),ee=t=b,m=t,Q=ae,t=E+c|0,t=(t=(u=u+G|0)>>>0<G>>>0?t+1|0:t)+m|0,q=we((ae=E=u+ae|0)^M,(E=u>>>0>E>>>0?t+1|0:t)^x,16),t=g+(m=b)|0,M=we(Q^(g=x=N+q|0),(N=g>>>0<N>>>0?t+1|0:t)^ee,63),x=b,Q=v,t=w+D|0,D=u=v+R|0,t=(t=u>>>0<v>>>0?t+1|0:t)+(ee=a[n+236>>2])|0,R=we((u=v=u+a[n+232>>2]|0)^L,(D=u>>>0<D>>>0?t+1|0:t)^F,32),t=I+(F=b)|0,I=v=_+R|0,v=we(Q^v,(t=v>>>0<_>>>0?t+1|0:t)^w,24),w=t,L=a[n+132>>2],Y=v,Q=I,t=(_=b)+D|0,t=(t=(u=v+u|0)>>>0<v>>>0?t+1|0:t)+L|0,t=(v=(I=a[n+128>>2])+u|0)>>>0<u>>>0?t+1|0:t,D=v,u=F,F=t,ee=we(v^R,u^t,16),t=(t=w)+(w=b)|0,t=(v=Q+(u=ee)|0)>>>0<u>>>0?t+1|0:t,u=v,v=_,_=t,Q=t=we(Y^u,v^t,63),R=t,B=t+B|0,t=(v=b)+f|0,t=L+(B>>>0<R>>>0?t+1|0:t)|0,B=we((R=f=I+B|0)^re,(f=f>>>0<I>>>0?t+1|0:t)^S,32),t=N+(I=b)|0,t=g>>>0>(S=g+B|0)>>>0?t+1|0:t,g=S,S=v,v=t,S=we(Q^g,S^t,24),L=t=b,N=t,Q=S,t=f+r|0,t=(t=(S=R+K|0)>>>0<K>>>0?t+1|0:t)+N|0,re=we((R=f=Q+S|0)^B,(f=f>>>0<S>>>0?t+1|0:t)^I,16),t=v+(I=b)|0,S=t=g>>>0>(N=g+re|0)>>>0?t+1|0:t,B=we(Q^N,t^L,63),v=b,Q=V,t=h+k|0,t=(t=(g=V+ne|0)>>>0<V>>>0?t+1|0:t)+(L=a[n+148>>2])|0,m=we((L=V=g+a[n+144>>2]|0)^q,(V=g>>>0>V>>>0?t+1|0:t)^m,32),t=_+(g=b)|0,Y=t=we(Q^(_=k=u+m|0),(k=h)^(h=u>>>0>_>>>0?t+1|0:t),24),Q=m,m=t,u=t+L|0,t=(k=b)+V|0,t=Z+(u>>>0<m>>>0?t+1|0:t)|0,L=we(Q^(u=V=u+A|0),(m=A>>>0>u>>>0?t+1|0:t)^g,16),t=h+(A=b)|0,h=k,k=t=_>>>0>(V=_+L|0)>>>0?t+1|0:t,h=we(Y^(_=V),h^t,63),g=b,Q=d,t=P+E|0,t=(t=(V=d+ae|0)>>>0<d>>>0?t+1|0:t)+(Z=a[n+164>>2])|0,Z=we((E=V=(d=V)+a[n+160>>2]|0)^ee,(V=d>>>0>E>>>0?t+1|0:t)^w,32),t=T+(d=b)|0,t=(w=C+Z|0)>>>0<C>>>0?t+1|0:t,C=P,P=t,T=we(Q^w,C^t,24),ae=t=b,C=t,t=V+i|0,t=(t=(E=E+te|0)>>>0<te>>>0?t+1|0:t)+C|0,Q=Z,Z=V=E+T|0,ne=we(Q^V,(C=E>>>0>V>>>0?t+1|0:t)^d,16),t=P+(E=b)|0,t=w>>>0>(V=w+ne|0)>>>0?t+1|0:t,d=(w=V)^T,T=t,d=we(d,t^ae,63),P=b,Q=M,t=x+s|0,t=(t=(V=M+H|0)>>>0<H>>>0?t+1|0:t)+F|0,p=we((M=V=D+V|0)^U,(V=D>>>0>V>>>0?t+1|0:t)^p,32),t=O+(D=b)|0,t=j>>>0>(F=j+p|0)>>>0?t+1|0:t,j=F,F=x,x=t,O=we(Q^j,F^t,24),U=t=b,F=t,Q=O,t=V+le|0,t=(t=(O=M+J|0)>>>0<J>>>0?t+1|0:t)+F|0,p=we((F=V=Q+O|0)^p,(M=D)^(D=O>>>0>F>>>0?t+1|0:t),16),t=x+(O=b)|0,ae=V=j+p|0,M=we(Q^V,(x=j>>>0>V>>>0?t+1|0:t)^U,63),V=b,Q=h,t=g+f|0,f=j=h+R|0,t=(t=j>>>0<h>>>0?t+1|0:t)+(U=a[n+196>>2])|0,O=we((j=p)^(p=h=f+a[n+192>>2]|0),(h=h>>>0<f>>>0?t+1|0:t)^O,32),t=T+(f=b)|0,T=g,g=t=w>>>0>(j=w+O|0)>>>0?t+1|0:t,t=we(Q^(w=j),T^t,24),R=a[n+204>>2],Y=t,Q=O,O=t,T=t+p|0,t=(j=b)+h|0,t=(t=O>>>0>T>>>0?t+1|0:t)+R|0,U=h=(O=T)+a[n+200>>2]|0,ee=we(Q^h,(p=f)^(f=h>>>0<O>>>0?t+1|0:t),16),t=g+(O=b)|0,t=(h=w+ee|0)>>>0<w>>>0?t+1|0:t,w=h,g=j,j=t,h=we(Y^h,g^t,63),g=b,Q=d,t=m+P|0,m=p=d+u|0,t=(t=p>>>0<d>>>0?t+1|0:t)+(R=q=a[n+212>>2])|0,u=we((p=d=(T=a[n+208>>2])+p|0)^re,(d=d>>>0<m>>>0?t+1|0:t)^I,32),t=(t=x)+(x=b)|0,m=P,P=t=u>>>0>(I=u+ae|0)>>>0?t+1|0:t,t=we(Q^I,m^t,24),R=a[n+220>>2],Y=t,Q=u,u=p,p=t,u=u+t|0,t=(m=b)+d|0,t=(t=u>>>0<p>>>0?t+1|0:t)+R|0,ae=d=u+a[n+216>>2]|0,u=we(Q^d,(p=d>>>0<u>>>0?t+1|0:t)^x,16),t=P+(R=b)|0,d=m,m=t=(x=I+u|0)>>>0<I>>>0?t+1|0:t,x=we(Y^(I=x),d^t,63),d=b,Q=M,t=C+c|0,t=(t=(P=G+Z|0)>>>0<G>>>0?t+1|0:t)+V|0,C=t=(C=P)>>>0>(P=C+M|0)>>>0?t+1|0:t,L=we(P^L,t^A,32),t=S+(A=b)|0,S=V,V=t=N>>>0>(M=N+L|0)>>>0?t+1|0:t,M=we(Q^(N=M),S^t,24),S=t=b,Q=M,t=t+C|0,C=M=P+M|0,t=(t=M>>>0<P>>>0?t+1|0:t)+(Z=a[n+236>>2])|0,M=L,L=P=C+a[n+232>>2]|0,Z=we(M^P,(C=C>>>0>P>>>0?t+1|0:t)^A,16),t=V+(A=b)|0,N=t=(P=N+Z|0)>>>0<N>>>0?t+1|0:t,M=we(Q^P,t^S,63),V=b,Q=B,t=v+ge|0,t=(t=(S=B+z|0)>>>0<z>>>0?t+1|0:t)+D|0,t=(S=S+F|0)>>>0<F>>>0?t+1|0:t,F=S,D=t,B=we(S^ne,t^E,32),t=k+(E=b)|0,t=(S=_+B|0)>>>0<_>>>0?t+1|0:t,_=S,S=v,v=t,S=we(Q^_,S^t,24),ne=t=b,k=t,Q=S,t=D+fe|0,t=(t=(S=F+W|0)>>>0<W>>>0?t+1|0:t)+k|0,k=t=S>>>0>(D=Q+S|0)>>>0?t+1|0:t,B=we(D^B,t^E,16),t=v+(E=b)|0,t=(S=_+B|0)>>>0<_>>>0?t+1|0:t,_=S,S=t,F=we(Q^_,t^ne,63),ne=t=b,v=t,Q=u,t=f+ge|0,f=u=U+z|0,t=(t=u>>>0<z>>>0?t+1|0:t)+v|0,R=we(Q^(u=z=u+F|0),(z=f>>>0>u>>>0?t+1|0:t)^R,32),t=N+(v=b)|0,t=(f=P+R|0)>>>0<P>>>0?t+1|0:t,P=f,f=t,U=t=we(F^P,ne^t,24),F=t,u=t+u|0,t=(N=b)+z|0,t=q+(u>>>0<F>>>0?t+1|0:t)|0,R=we((u=z=u+T|0)^R,(F=T>>>0>u>>>0?t+1|0:t)^v,16),t=f+(T=b)|0,P=we(U^(f=z=P+R|0),(v=N)^(N=P>>>0>f>>>0?t+1|0:t),63),v=b,Q=h,t=g+p|0,t=(t=(z=h+ae|0)>>>0<h>>>0?t+1|0:t)+(U=a[n+164>>2])|0,A=we((U=z=(h=z)+a[n+160>>2]|0)^Z,(z=h>>>0>U>>>0?t+1|0:t)^A,32),t=S+(h=b)|0,t=(p=_+A|0)>>>0<_>>>0?t+1|0:t,_=p,S=g,g=t,t=we(Q^p,S^t,24),Z=a[n+196>>2],Y=t,Q=A,p=t,A=t+U|0,t=(S=b)+z|0,t=(t=p>>>0>A>>>0?t+1|0:t)+Z|0,U=we(Q^(A=z=(p=A)+a[n+192>>2]|0),(U=h)^(h=p>>>0>A>>>0?t+1|0:t),16),t=g+(Z=b)|0,S=we(Y^(g=z=_+U|0),(_=_>>>0>g>>>0?t+1|0:t)^S,63),z=b,Q=x,t=d+C|0,C=p=x+L|0,t=(t=p>>>0<x>>>0?t+1|0:t)+(ge=a[n+204>>2])|0,B=we((p=x=p+a[n+200>>2]|0)^B,(x=C>>>0>p>>>0?t+1|0:t)^E,32),t=j+(C=b)|0,t=w>>>0>(E=w+B|0)>>>0?t+1|0:t,w=E,E=d,d=t,E=we(Q^w,E^t,24),L=t=b,j=t,Q=E,t=x+fe|0,t=(t=(E=p+W|0)>>>0<W>>>0?t+1|0:t)+j|0,B=we((p=W=Q+(x=E)|0)^B,(E=C)^(C=x>>>0>p>>>0?t+1|0:t),16),t=d+(j=b)|0,W=we(Q^(d=W=w+B|0),(w=w>>>0>d>>>0?t+1|0:t)^L,63),x=b,Q=M,t=k+V|0,t=(t=(E=D+M|0)>>>0<D>>>0?t+1|0:t)+(L=a[n+236>>2])|0,O=we((M=D=E+a[n+232>>2]|0)^ee,(D=D>>>0<E>>>0?t+1|0:t)^O,32),t=m+(k=b)|0,t=I>>>0>(E=I+O|0)>>>0?t+1|0:t,I=E,E=V,V=t,m=we(Q^I,E^t,24),E=t=b,L=m,t=D+s|0,t=(t=(m=M+H|0)>>>0<H>>>0?t+1|0:t)+E|0,t=m>>>0>(H=L+m|0)>>>0?t+1|0:t,m=k,k=t,O=we((D=H)^O,m^t,16),t=V+(M=b)|0,m=E,E=t=I>>>0>(H=I+O|0)>>>0?t+1|0:t,H=we(L^(I=H),m^t,63),V=b,t=F+r|0,t=(t=(m=u+K|0)>>>0<K>>>0?t+1|0:t)+z|0,t=m>>>0>(K=m+S|0)>>>0?t+1|0:t,F=K,m=G+K|0,K=t,t=c+t|0,G=(u=m)>>>0<G>>>0?t+1|0:t,m=S,S=we(O^F,M^K,32),t=w+(F=b)|0,z=(d=O=we(m^(w=K=d+S|0),(K=d>>>0>w>>>0?t+1|0:t)^z,24))+u|0,t=(u=b)+G|0,t=d>>>0>z>>>0?t+1|0:t,d=z,a[n>>2]=d,a[n+4>>2]=t,z=t,t=we(d^S,t^F,16),m=G=b,a[n+120>>2]=t,a[n+124>>2]=m,G=t,w=t+w|0,t=m+K|0,a[n+80>>2]=w,t=w>>>0<G>>>0?t+1|0:t,a[n+84>>2]=t,ye=n,ve=we(O^w,t^u,63),a[ye+40>>2]=ve,a[n+44>>2]=b,u=W,t=h+x|0,t=(K=A+W|0)>>>0<W>>>0?t+1|0:t,W=K,t=t+(G=a[n+132>>2])|0,W=t=(K=K+a[n+128>>2]|0)>>>0<W>>>0?t+1|0:t,h=we(K^R,t^T,32),t=E+(w=b)|0,t=I>>>0>(G=I+h|0)>>>0?t+1|0:t,I=G,G=t,E=we(u^I,t^x,24),t=W+(m=b)|0,t=(x=E+K|0)>>>0<K>>>0?t+1|0:t,K=(W=a[n+144>>2])+x|0,t=a[n+148>>2]+t|0,t=K>>>0<W>>>0?t+1|0:t,a[n+8>>2]=K,a[n+12>>2]=t,t=we(h^K,t^w,16),x=K=b,a[n+96>>2]=t,a[n+100>>2]=x,K=t,W=t+I|0,t=x+G|0,t=K>>>0>W>>>0?t+1|0:t,K=W,a[n+88>>2]=K,a[n+92>>2]=t,ye=n,ve=we(E^K,t^m,63),a[ye+48>>2]=ve,a[n+52>>2]=b,u=J,t=C+V|0,J=K=p+H|0,t=(t=K>>>0<H>>>0?t+1|0:t)+(W=a[n+220>>2])|0,G=K=K+a[n+216>>2]|0,W=u+K|0,K=t=K>>>0<J>>>0?t+1|0:t,t=t+le|0,W=(x=W)>>>0<G>>>0?t+1|0:t,u=x,G=we(U^G,K^Z,32),t=N+(x=b)|0,V=we((h=K=f+G|0)^H,(K=f>>>0>h>>>0?t+1|0:t)^V,24),t=(w=b)+W|0,t=V>>>0>(H=u+V|0)>>>0?t+1|0:t,a[n+16>>2]=H,a[n+20>>2]=t,t=we(H^G,t^x,16),J=H=b,a[n+104>>2]=t,a[n+108>>2]=H,H=t,W=t+h|0,t=K+J|0,K=W,a[n+64>>2]=K,t=H>>>0>K>>>0?t+1|0:t,a[n+68>>2]=t,ye=n,ve=we(V^K,t^w,63),a[ye+56>>2]=ve,a[n+60>>2]=b,t=v+i|0,t=(t=(K=P+te|0)>>>0<P>>>0?t+1|0:t)+k|0,H=t=D>>>0>(K=D+K|0)>>>0?t+1|0:t,G=we(K^B,t^j,32),t=_+(V=b)|0,te=t=g>>>0>(W=g+G|0)>>>0?t+1|0:t,x=we(W^P,t^v,24),t=H+(h=b)|0,t=K>>>0>(J=K+x|0)>>>0?t+1|0:t,K=(H=a[n+152>>2])+J|0,t=a[n+156>>2]+t|0,t=K>>>0<H>>>0?t+1|0:t,a[n+24>>2]=K,a[n+28>>2]=t,t=we(K^G,t^V,16),a[n+112>>2]=t,H=b,a[n+116>>2]=H,K=t+W|0,t=H+te|0,t=K>>>0<W>>>0?t+1|0:t,a[n+72>>2]=K,a[n+76>>2]=t,ye=n,ve=we(x^K,t^h,63),a[ye+32>>2]=ve,a[n+36>>2]=b,t=a[n+68>>2]^(l[e+4|0]|l[e+5|0]<<8|l[e+6|0]<<16|l[e+7|0]<<24)^z,K=a[n+64>>2]^(l[0|e]|l[e+1|0]<<8|l[e+2|0]<<16|l[e+3|0]<<24)^d,o[0|e]=K,o[e+1|0]=K>>>8,o[e+2|0]=K>>>16,o[e+3|0]=K>>>24,o[e+4|0]=t,o[e+5|0]=t>>>8,o[e+6|0]=t>>>16,o[e+7|0]=t>>>24,H=1;t=(K=H<<3)+e|0,z=a[(K=n+K|0)>>2]^(l[0|t]|l[t+1|0]<<8|l[t+2|0]<<16|l[t+3|0]<<24),te=a[(W=K- -64|0)>>2],K=a[W+4>>2]^a[K+4>>2]^(l[t+4|0]|l[t+5|0]<<8|l[t+6|0]<<16|l[t+7|0]<<24),z^=te,o[0|t]=z,o[t+1|0]=z>>>8,o[t+2|0]=z>>>16,o[t+3|0]=z>>>24,o[t+4|0]=K,o[t+5|0]=K>>>8,o[t+6|0]=K>>>16,o[t+7|0]=K>>>24,8!=(0|(H=H+1|0)););y=n+256|0}function S(e,t,n,r,i,s,c){var u,d,h,p,f,g,m,v,A,w,S,C,I,_,x,P,k,B,O,N,D,j,T,M,F,R,L,Q,U,V,K,H,G,Y,z,W,q,J,X,$,ee,te=0,ne=0,ie=0,oe=0,se=0,ae=0,le=0,ce=0,ue=0,de=0,he=0,pe=0,fe=0,ge=0,me=0,ye=0,ve=0,Ae=0,be=0,we=0,Se=0,Ce=0,Ee=0,Ie=0,_e=0,xe=0,Pe=0,ke=0,Be=0,Oe=0,Ne=0,De=0,Te=0,Me=0,Fe=0,Re=0,Le=0,Qe=0,Ue=0,Ve=0,Ke=0,He=0,Ge=0,Ye=0,Ze=0,We=0,qe=0,Je=0,Xe=0,$e=0,et=0,nt=0,rt=0;return y=R=y-560|0,qt(ue=R+352|0,c),It(L=R+288|0,s,32,0),Z(ue,R+320|0,32,0),Z(ue,n,r,i),je(ue,u=R+224|0),te=l[s+32|0]|l[s+33|0]<<8|l[s+34|0]<<16|l[s+35|0]<<24,oe=l[s+36|0]|l[s+37|0]<<8|l[s+38|0]<<16|l[s+39|0]<<24,le=l[s+40|0]|l[s+41|0]<<8|l[s+42|0]<<16|l[s+43|0]<<24,ne=l[s+44|0]|l[s+45|0]<<8|l[s+46|0]<<16|l[s+47|0]<<24,se=l[s+48|0]|l[s+49|0]<<8|l[s+50|0]<<16|l[s+51|0]<<24,ae=l[s+52|0]|l[s+53|0]<<8|l[s+54|0]<<16|l[s+55|0]<<24,de=l[s+60|0]|l[s+61|0]<<8|l[s+62|0]<<16|l[s+63|0]<<24,s=l[s+56|0]|l[s+57|0]<<8|l[s+58|0]<<16|l[s+59|0]<<24,o[e+56|0]=s,o[e+57|0]=s>>>8,o[e+58|0]=s>>>16,o[e+59|0]=s>>>24,o[e+60|0]=de,o[e+61|0]=de>>>8,o[e+62|0]=de>>>16,o[e+63|0]=de>>>24,s=se,o[e+48|0]=s,o[e+49|0]=s>>>8,o[e+50|0]=s>>>16,o[e+51|0]=s>>>24,s=ae,o[e+52|0]=s,o[e+53|0]=s>>>8,o[e+54|0]=s>>>16,o[e+55|0]=s>>>24,s=le,o[e+40|0]=s,o[e+41|0]=s>>>8,o[e+42|0]=s>>>16,o[e+43|0]=s>>>24,s=ne,o[e+44|0]=s,o[e+45|0]=s>>>8,o[e+46|0]=s>>>16,o[e+47|0]=s>>>24,o[0|(s=e+32|0)]=te,o[s+1|0]=te>>>8,o[s+2|0]=te>>>16,o[s+3|0]=te>>>24,te=oe,o[s+4|0]=te,o[s+5|0]=te>>>8,o[s+6|0]=te>>>16,o[s+7|0]=te>>>24,E(u),re(R,u),tt(e,R),qt(ue,c),Z(ue,e,64,0),Z(ue,n,r,i),je(ue,e=R+160|0),E(e),o[0|L]=248&l[0|L],o[L+31|0]=63&l[L+31|0]|64,Ge=St(e),le=l[e+2|0]|l[e+3|0]<<8|l[e+4|0]<<16|l[e+5|0]<<24,Be=St(e+5|0),se=b,ne=l[e+7|0]|l[e+8|0]<<8|l[e+9|0]<<16|l[e+10|0]<<24,ue=l[e+10|0]|l[e+11|0]<<8|l[e+12|0]<<16|l[e+13|0]<<24,Ve=St(e+13|0),de=b,ce=l[e+15|0]|l[e+16|0]<<8|l[e+17|0]<<16|l[e+18|0]<<24,Oe=St(e+18|0),ge=b,Fe=St(e+21|0),r=l[e+23|0]|l[e+24|0]<<8|l[e+25|0]<<16|l[e+26|0]<<24,ae=St(e+26|0),n=b,i=l[e+28|0]|l[e+29|0]<<8|l[e+30|0]<<16|l[e+31|0]<<24,Ke=St(L),Se=l[(e=L)+2|0]|l[e+3|0]<<8|l[e+4|0]<<16|l[e+5|0]<<24,Re=St(e+5|0),_e=b,fe=l[e+7|0]|l[e+8|0]<<8|l[e+9|0]<<16|l[e+10|0]<<24,he=l[e+10|0]|l[e+11|0]<<8|l[e+12|0]<<16|l[e+13|0]<<24,We=St(e+13|0),Ce=b,ye=l[e+15|0]|l[e+16|0]<<8|l[e+17|0]<<16|l[e+18|0]<<24,Ye=St(e+18|0),be=b,Le=St(e+21|0),c=l[e+23|0]|l[e+24|0]<<8|l[e+25|0]<<16|l[e+26|0]<<24,pe=St(e+26|0),te=b,oe=l[e+28|0]|l[e+29|0]<<8|l[e+30|0]<<16|l[e+31|0]<<24,q=St(u),J=l[(e=u)+2|0]|l[e+3|0]<<8|l[e+4|0]<<16|l[e+5|0]<<24,X=St(e+5|0),$=b,ee=l[e+7|0]|l[e+8|0]<<8|l[e+9|0]<<16|l[e+10|0]<<24,Te=l[e+10|0]|l[e+11|0]<<8|l[e+12|0]<<16|l[e+13|0]<<24,$e=St(e+13|0),xe=b,Ae=l[e+15|0]|l[e+16|0]<<8|l[e+17|0]<<16|l[e+18|0]<<24,et=St(e+18|0),me=b,Qe=St(e+21|0),e=ze(d=oe>>>7|0,0,h=2097151&((3&(e=n))<<30|(n=ae)>>>2),0),n=b,oe=e,i=ze(p=2097151&((3&(e=te))<<30|(te=pe)>>>2),0,f=i>>>7|0,0),n=b+n|0,oe=e=oe+i|0,te=e>>>0<i>>>0?n+1|0:n,e=ze(h,ie,p,ie),i=b,n=(c=ze(g=c>>>5&2097151,0,f,0))+e|0,e=b+i|0,e=n>>>0<c>>>0?e+1|0:e,i=ze(d,0,m=r>>>5&2097151,0),r=b+e|0,r=(n=i+n|0)>>>0<i>>>0?r+1|0:r,i=n,Ne=r,ve=e=r-((n>>>0<4293918720)-1|0)|0,c=(2097151&e)<<11|(ae=n- -1048576|0)>>>21,e=(e>>21)+te|0,e=(r=c+oe|0)>>>0<c>>>0?e+1|0:e,c=r,Pe=e,De=te=e-((r>>>0<4293918720)-1|0)|0,n=te>>21,ke=(e=ze(d,0,f,0))-(Ee=-2097152&(we=e- -1048576|0))|0,e=((pe=b)-((e>>>0<Ee>>>0)+(r=pe-((e>>>0<4293918720)-1|0)|0)|0)|0)+n|0,G=te=ke+((2097151&te)<<11|(oe=c- -1048576|0)>>>21)|0,pe=e=te>>>0<ke>>>0?e+1|0:e,n=ze(te,e,-683901,-1),te=b,Q=(2097151&r)<<11|we>>>21,we=e=r>>21,e=(r=ze(Q,e,136657,0))+n|0,n=b+te|0,ke=e,Ee=e>>>0<r>>>0?n+1|0:n,e=ze(v=2097151&((1&(e=Ce))<<31|We>>>1),0,h,ie),n=b,te=ze(A=he>>>4&2097151,0,f,0),r=b+n|0,r=(e=te+e|0)>>>0<te>>>0?r+1|0:r,te=ze(w=ye>>>6&2097151,0,m,0),n=b+r|0,n=(e=te+e|0)>>>0<te>>>0?n+1|0:n,Ce=e,te=ze(S=2097151&Le,r=0,C=2097151&((7&(e=ge))<<29|Oe>>>3),0),e=b+n|0,n=e=(r=Ce+te|0)>>>0<te>>>0?e+1|0:e,e=(te=ze(I=2097151&((7&(e=be))<<29|Ye>>>3),0,_=2097151&Fe,0))+r|0,r=b+n|0,r=e>>>0<te>>>0?r+1|0:r,te=ze(g,0,x=ce>>>6&2097151,0),n=b+r|0,n=(e=te+e|0)>>>0<te>>>0?n+1|0:n,r=e,te=ze(p,ie,P=2097151&((1&(e=de))<<31|Ve>>>1),0),e=b+n|0,e=(r=r+te|0)>>>0<te>>>0?e+1|0:e,n=(te=ze(d,0,k=ue>>>4&2097151,0))+r|0,r=b+e|0,ge=n,ue=n>>>0<te>>>0?r+1|0:r,e=ze(h,ie,A,0),n=b,r=ze(B=fe>>>7&2097151,0,f,0),n=b+n|0,n=(e=r+e|0)>>>0<r>>>0?n+1|0:n,r=(te=ze(m,0,v,ie))+e|0,e=b+n|0,e=r>>>0<te>>>0?e+1|0:e,n=(te=ze(w,0,_,ie))+r|0,r=b+e|0,r=n>>>0<te>>>0?r+1|0:r,e=(te=ze(S,ie,x,0))+n|0,n=b+r|0,n=e>>>0<te>>>0?n+1|0:n,r=(te=ze(C,ie,I,ie))+e|0,e=b+n|0,e=r>>>0<te>>>0?e+1|0:e,te=ze(g,0,P,ie),n=b+e|0,n=(r=te+r|0)>>>0<te>>>0?n+1|0:n,te=ze(p,ie,k,0),e=b+n|0,e=(r=te+r|0)>>>0<te>>>0?e+1|0:e,n=(te=ze(d,0,O=ne>>>7&2097151,0))+r|0,r=b+e|0,r=n>>>0<te>>>0?r+1|0:r,te=n,de=r,e=r-((n>>>0<4293918720)-1|0)|0,r=n- -1048576|0,ce=e,n=ge,ge=(2097151&e)<<11|r>>>21,e=(e>>21)+ue|0,e=(ne=(n=ne=n+ge|0)>>>0<ge>>>0?e+1|0:e)+Ee|0,e=n>>>0>(ue=n+ke|0)>>>0?e+1|0:e,ne=ne-((n>>>0<4293918720)-1|0)|0,he=ue-(n=-2097152&(fe=n- -1048576|0))|0,ue=e-((n>>>0>ue>>>0)+ne|0)|0,ge=Pe-(((e=-2097152&oe)>>>0>c>>>0)+De|0)|0,U=c-e|0,c=ze(Q,we,-997805,-1),n=b+de|0,n=(e=c+te|0)>>>0<c>>>0?n+1|0:n,c=(te=ze(G,pe,136657,0))+e|0,e=b+n|0,e=c>>>0<te>>>0?e+1|0:e,n=c,c=ze(U,ge,-683901,-1),e=b+e|0,oe=(n=n+c|0)-(r&=-2097152)|0,de=(e=n>>>0<c>>>0?e+1|0:e)-((n>>>0<r>>>0)+ce|0)|0,e=ze(h,ie,B,0),r=b,n=e,c=ze(N=2097151&((3&(e=_e))<<30|Re>>>2),0,f,0),e=b+r|0,e=(n=n+c|0)>>>0<c>>>0?e+1|0:e,c=ze(m,0,A,0),r=b+e|0,r=(n=c+n|0)>>>0<c>>>0?r+1|0:r,e=(c=ze(v,ie,_,ie))+n|0,n=b+r|0,n=e>>>0<c>>>0?n+1|0:n,r=(c=ze(w,0,C,ie))+e|0,e=b+n|0,e=r>>>0<c>>>0?e+1|0:e,c=ze(S,ie,P,ie),n=b+e|0,n=(r=c+r|0)>>>0<c>>>0?n+1|0:n,c=ze(I,ie,x,0),e=b+n|0,e=(r=c+r|0)>>>0<c>>>0?e+1|0:e,n=(c=ze(g,0,k,0))+r|0,r=b+e|0,r=n>>>0<c>>>0?r+1|0:r,e=(c=ze(p,ie,O,0))+n|0,n=b+r|0,n=e>>>0<c>>>0?n+1|0:n,r=e,c=ze(d,0,D=2097151&((3&(e=se))<<30|Be>>>2),0),e=b+n|0,se=r=r+c|0,te=r>>>0<c>>>0?e+1|0:e,e=ze(h,ie,N,0),n=b,r=ze(j=Se>>>5&2097151,0,f,0),n=b+n|0,n=(e=r+e|0)>>>0<r>>>0?n+1|0:n,r=ze(m,0,B,0),n=b+n|0,n=(e=r+e|0)>>>0<r>>>0?n+1|0:n,r=(c=ze(A,0,_,ie))+e|0,e=b+n|0,e=r>>>0<c>>>0?e+1|0:e,n=r,r=ze(v,ie,C,ie),e=b+e|0,e=(n=n+r|0)>>>0<r>>>0?e+1|0:e,c=ze(w,0,x,0),r=b+e|0,r=(n=c+n|0)>>>0<c>>>0?r+1|0:r,e=(c=ze(S,ie,k,0))+n|0,n=b+r|0,n=e>>>0<c>>>0?n+1|0:n,r=ze(I,ie,P,ie),n=b+n|0,n=(e=r+e|0)>>>0<r>>>0?n+1|0:n,r=(c=ze(g,0,O,0))+e|0,e=b+n|0,e=r>>>0<c>>>0?e+1|0:e,n=r,r=ze(p,ie,D,0),e=b+e|0,e=(n=n+r|0)>>>0<r>>>0?e+1|0:e,c=ze(d,0,T=le>>>5&2097151,0),r=b+e|0,r=(n=c+n|0)>>>0<c>>>0?r+1|0:r,c=n,Be=r,Ve=n=r-((n>>>0<4293918720)-1|0)|0,e=(e=n>>21)+te|0,te=n=(r=(2097151&n)<<11|(be=c- -1048576|0)>>>21)+se|0,Oe=e=n>>>0<r>>>0?e+1|0:e,Fe=n=e-((n>>>0<4293918720)-1|0)|0,e=n>>21,n=(r=oe)+(oe=(2097151&n)<<11|(Pe=te- -1048576|0)>>>21)|0,r=e+de|0,r=n>>>0<oe>>>0?r+1|0:r,oe=n,Re=r,We=n=r-((n>>>0<4293918720)-1|0)|0,e=(e=n>>21)+ue|0,le=n=(r=(2097151&n)<<11|(De=oe- -1048576|0)>>>21)+he|0,Ee=e=n>>>0<r>>>0?e+1|0:e,Ye=n=e-((n>>>0<4293918720)-1|0)|0,Se=(2097151&n)<<11|(ce=le- -1048576|0)>>>21,ue=n>>21,e=ze(h,ie,w,0),n=b,se=ze(f,0,v,ie),r=b+n|0,r=(e=se+e|0)>>>0<se>>>0?r+1|0:r,se=ze(S,ie,_,ie),n=b+r|0,n=(e=se+e|0)>>>0<se>>>0?n+1|0:n,r=(se=ze(m,0,I,ie))+e|0,e=b+n|0,e=r>>>0<se>>>0?e+1|0:e,se=ze(g,0,C,ie),n=b+e|0,n=(r=se+r|0)>>>0<se>>>0?n+1|0:n,se=ze(p,ie,x,0),e=b+n|0,e=(r=se+r|0)>>>0<se>>>0?e+1|0:e,n=(se=ze(d,0,P,ie))+r|0,r=b+e|0,r=n>>>0<se>>>0?r+1|0:r,e=n,de=ze(Q,we,-683901,-1),n=b+r|0,n=(se=e+de|0)>>>0<de>>>0?n+1|0:n,de=se,se=r-((e>>>0<4293918720)-1|0)|0,r=de-(e=-2097152&(_e=e- -1048576|0))|0,de=n-((e>>>0>de>>>0)+se|0)|0,n=(e=r)+(r=(2097151&ne)<<11|fe>>>21)|0,e=(ne>>21)+de|0,e=n>>>0<r>>>0?e+1|0:e,r=Se,fe=n-(Se=-2097152&(de=n- -1048576|0))|0,n=(e-((ne=e-((n>>>0<4293918720)-1|0)|0)+(n>>>0<Se>>>0)|0)|0)+ue|0,Y=r=r+fe|0,Se=n=r>>>0<fe>>>0?n+1|0:n,ue=ze(r,n,-683901,-1),fe=b,e=ze(m,0,S,ie),r=b,n=(he=ze(f,0,w,0))+e|0,e=b+r|0,e=n>>>0<he>>>0?e+1|0:e,r=(he=ze(h,ie,I,ie))+n|0,n=b+e|0,n=r>>>0<he>>>0?n+1|0:n,he=ze(g,0,_,ie),e=b+n|0,e=(r=he+r|0)>>>0<he>>>0?e+1|0:e,n=(he=ze(p,ie,C,ie))+r|0,r=b+e|0,r=n>>>0<he>>>0?r+1|0:r,e=(he=ze(d,0,x,0))+n|0,n=b+r|0,n=e>>>0<he>>>0?n+1|0:n,r=e,e=(e=se>>21)+n|0,Ce=r=(e=(n=r=r+(se=(2097151&se)<<11|_e>>>21)|0)>>>0<se>>>0?e+1|0:e)-((n>>>0<4293918720)-1|0)|0,_e=n-(se=-2097152&(ke=n- -1048576|0))|0,r=e-((n>>>0<se>>>0)+r|0)|0,n=(n=(e=ne)>>21)+r|0,z=e=(ne=(2097151&e)<<11|(ne=de)>>>21)+_e|0,_e=n=e>>>0<ne>>>0?n+1|0:n,r=ze(e,n,136657,0),e=b+fe|0,nt=n=r+ue|0,Le=n>>>0<r>>>0?e+1|0:e,e=ze(_,ie,j,0),r=b,n=(ne=ze(M=2097151&Ke,0,m,0))+e|0,e=b+r|0,e=n>>>0<ne>>>0?e+1|0:e,ne=ze(C,ie,N,0),r=b+e|0,r=(n=ne+n|0)>>>0<ne>>>0?r+1|0:r,e=(ne=ze(x,0,B,0))+n|0,n=b+r|0,n=e>>>0<ne>>>0?n+1|0:n,r=(ne=ze(A,0,P,ie))+e|0,e=b+n|0,e=r>>>0<ne>>>0?e+1|0:e,ne=ze(v,ie,k,0),n=b+e|0,n=(r=ne+r|0)>>>0<ne>>>0?n+1|0:n,ne=ze(w,0,O,0),e=b+n|0,e=(r=ne+r|0)>>>0<ne>>>0?e+1|0:e,n=(ne=ze(S,ie,T,0))+r|0,r=b+e|0,r=n>>>0<ne>>>0?r+1|0:r,e=(ne=ze(I,ie,D,0))+n|0,n=b+r|0,n=e>>>0<ne>>>0?n+1|0:n,r=(ne=ze(g,0,F=2097151&Ge,0))+e|0,e=b+n|0,e=r>>>0<ne>>>0?e+1|0:e,ue=r=(ne=(l[u+23|0]|l[u+24|0]<<8|l[u+25|0]<<16|l[u+26|0]<<24)>>>5&2097151)+r|0,se=r>>>0<ne>>>0?e+1|0:e,e=ze(C,ie,j,0),n=b,ne=ze(_,ie,M,0),r=b+n|0,r=(e=ne+e|0)>>>0<ne>>>0?r+1|0:r,ne=ze(x,0,N,0),n=b+r|0,n=(e=ne+e|0)>>>0<ne>>>0?n+1|0:n,r=(ne=ze(P,ie,B,0))+e|0,e=b+n|0,e=r>>>0<ne>>>0?e+1|0:e,n=r,r=ze(A,0,k,0),e=b+e|0,e=(n=n+r|0)>>>0<r>>>0?e+1|0:e,r=(ne=ze(v,ie,O,0))+n|0,n=b+e|0,n=r>>>0<ne>>>0?n+1|0:n,e=(ne=ze(w,0,D,0))+r|0,r=b+n|0,r=e>>>0<ne>>>0?r+1|0:r,ne=ze(F,0,S,ie),n=b+r|0,n=(e=ne+e|0)>>>0<ne>>>0?n+1|0:n,r=(ne=ze(I,ie,T,0))+e|0,e=b+n|0,e=r>>>0<ne>>>0?e+1|0:e,ne=n=(n=r)+(r=2097151&Qe)|0,ye=e=n>>>0<r>>>0?e+1|0:e,Ge=e=e-((n>>>0<4293918720)-1|0)|0,de=n- -1048576|0,n=(r=e>>>21|0)+se|0,se=e=(he=ue)+(ue=(2097151&e)<<11|de>>>21)|0,Ke=e>>>0<ue>>>0?n+1|0:n,fe=i-(e=-2097152&ae)|0,qe=Ne-((e>>>0>i>>>0)+ve|0)|0,e=ze(h,ie,g,0),r=b,n=(i=ze(f,0,S,ie))+e|0,e=b+r|0,e=n>>>0<i>>>0?e+1|0:e,i=ze(p,ie,m,0),r=b+e|0,r=(n=i+n|0)>>>0<i>>>0?r+1|0:r,e=(i=ze(d,0,_,ie))+n|0,n=b+r|0,he=e,ae=e>>>0<i>>>0?n+1|0:n,e=ze(f,0,I,ie),n=b,r=ze(h,ie,S,ie),n=b+n|0,n=(e=r+e|0)>>>0<r>>>0?n+1|0:n,r=(i=ze(g,0,m,0))+e|0,e=b+n|0,e=r>>>0<i>>>0?e+1|0:e,n=r,r=ze(p,ie,_,ie),e=b+e|0,e=(n=n+r|0)>>>0<r>>>0?e+1|0:e,i=ze(d,0,C,ie),r=b+e|0,r=(n=i+n|0)>>>0<i>>>0?r+1|0:r,i=n,Ne=r,ve=n=r-((n>>>0<4293918720)-1|0)|0,e=he,he=(2097151&n)<<11|(ue=i- -1048576|0)>>>21,n=(n>>21)+ae|0,ae=r=e+he|0,Qe=n=r>>>0<he>>>0?n+1|0:n,he=r- -1048576|0,r=(e=(n=n-((r>>>0<4293918720)-1|0)|0)>>21)+qe|0,V=fe=(Xe=(2097151&n)<<11|he>>>21)+fe|0,fe=r=fe>>>0<Xe>>>0?r+1|0:r,e=ze(V,r,470296,0),r=b,he=Qe-((Me=n)+((n=-2097152&he)>>>0>ae>>>0)|0)|0,K=ae-n|0,ae=ze(U,ge,666643,0),n=b+r|0,n=(e=ae+e|0)>>>0<ae>>>0?n+1|0:n,r=(ae=ze(K,he,654183,0))+e|0,e=b+n|0,e=r>>>0<ae>>>0?e+1|0:e,ae=r,r=e,ue=Ne-(((e=-2097152&ue)>>>0>i>>>0)+ve|0)|0,i=n=i-e|0,Ce=(2097151&(n=Ce))<<11|ke>>>21,n=(e=n>>21)+ue|0,W=i=i+Ce|0,Ce=n=i>>>0<Ce>>>0?n+1|0:n,ue=Ke-(((e=se)>>>0<4293918720)-1|0)|0,He=e- -1048576|0,i=ze(i,n,-997805,-1),n=b+r|0,n=(e=i+ae|0)>>>0<i>>>0?n+1|0:n,i=e,r=se+e|0,e=n+Ke|0,e=r>>>0<i>>>0?e+1|0:e,ke=(n=r)-(r=-2097152&He)|0,qe=e-((n>>>0<r>>>0)+ue|0)|0,e=ze(K,he,470296,0),n=b,r=ze(V,fe,666643,0),n=b+n|0,n=(e=r+e|0)>>>0<r>>>0?n+1|0:n,r=(i=ze(W,Ce,654183,0))+e|0,e=b+n|0,n=r+ne|0,r=ye+(r>>>0<i>>>0?e+1|0:e)|0,r=n>>>0<ne>>>0?r+1|0:r,de=(e=n)-(n=-2097152&de)|0,ye=r-((e>>>0<n>>>0)+Ge|0)|0,e=ze(x,0,j,0),r=b,n=(i=ze(C,ie,M,0))+e|0,e=b+r|0,e=n>>>0<i>>>0?e+1|0:e,r=ze(P,ie,N,0),e=b+e|0,e=(n=r+n|0)>>>0<r>>>0?e+1|0:e,i=ze(k,0,B,0),r=b+e|0,r=(n=i+n|0)>>>0<i>>>0?r+1|0:r,e=(i=ze(A,0,O,0))+n|0,n=b+r|0,n=e>>>0<i>>>0?n+1|0:n,r=ze(v,ie,D,0),n=b+n|0,n=(e=r+e|0)>>>0<r>>>0?n+1|0:n,r=(i=ze(w,0,T,0))+e|0,e=b+n|0,e=r>>>0<i>>>0?e+1|0:e,n=r,r=ze(F,0,I,ie),e=b+e|0,e=(n=n+r|0)>>>0<r>>>0?e+1|0:e,r=n,n=e,ae=e=(i=2097151&((7&(e=me))<<29|et>>>3))+r|0,i=e>>>0<i>>>0?n+1|0:n,e=ze(P,ie,j,0),n=b,r=ze(x,0,M,0),n=b+n|0,n=(e=r+e|0)>>>0<r>>>0?n+1|0:n,r=(ne=ze(k,0,N,0))+e|0,e=b+n|0,e=r>>>0<ne>>>0?e+1|0:e,ne=ze(B,0,O,0),n=b+e|0,n=(r=ne+r|0)>>>0<ne>>>0?n+1|0:n,ne=ze(A,0,D,0),e=b+n|0,e=(r=ne+r|0)>>>0<ne>>>0?e+1|0:e,n=(ne=ze(v,ie,T,0))+r|0,r=b+e|0,r=n>>>0<ne>>>0?r+1|0:r,e=(ne=ze(F,0,w,0))+n|0,n=b+r|0,r=e,e=e>>>0<ne>>>0?n+1|0:n,ne=n=(n=r)+(r=Ae>>>6&2097151)|0,me=e=n>>>0<r>>>0?e+1|0:e,Ne=e=e-((n>>>0<4293918720)-1|0)|0,se=n- -1048576|0,n=(r=e>>>21|0)+i|0,i=e=(ve=ae)+(ae=(2097151&e)<<11|se>>>21)|0,ve=n=e>>>0<ae>>>0?n+1|0:n,Ge=e=n-((e>>>0<4293918720)-1|0)|0,n=de,de=(2097151&e)<<11|(ae=i- -1048576|0)>>>21,e=(e>>>21|0)+ye|0,ye=n=n+de|0,Ke=e=n>>>0<de>>>0?e+1|0:e,Qe=e=e-((n>>>0<4293918720)-1|0)|0,Ae=n- -1048576|0,n=(r=e>>21)+qe|0,n=(e=(de=(2097151&e)<<11|Ae>>>21)+ke|0)>>>0<de>>>0?n+1|0:n,r=e,de=e+nt|0,e=n+Le|0,e=r>>>0>de>>>0?e+1|0:e,Le=de,de=n-((r>>>0<4293918720)-1|0)|0,Je=Le-(n=-2097152&(Ze=r- -1048576|0))|0,Ue=e-((n>>>0>Le>>>0)+de|0)|0,n=ze(z,_e,-997805,-1),r=b+Ke|0,Me=e=n+ye|0,Le=e>>>0<n>>>0?r+1|0:r,e=ze(W,Ce,470296,0),r=b,n=(ye=ze(K,he,666643,0))+e|0,e=b+r|0,e=(e=n>>>0<ye>>>0?e+1|0:e)+ve|0,ye=(n=n+i|0)-(r=-2097152&ae)|0,ve=(e=n>>>0<i>>>0?e+1|0:e)-((n>>>0<r>>>0)+Ge|0)|0,r=ze(W,Ce,666643,0),n=b+me|0,me=e=r+ne|0,ae=e>>>0<r>>>0?n+1|0:n,e=ze(k,0,j,0),r=b,n=(i=ze(P,ie,M,0))+e|0,e=b+r|0,e=n>>>0<i>>>0?e+1|0:e,r=ze(O,0,N,0),e=b+e|0,e=(n=r+n|0)>>>0<r>>>0?e+1|0:e,i=ze(B,0,D,0),r=b+e|0,r=(n=i+n|0)>>>0<i>>>0?r+1|0:r,e=(i=ze(A,0,T,0))+n|0,n=b+r|0,n=e>>>0<i>>>0?n+1|0:n,r=ze(F,0,v,ie),n=b+n|0,n=(e=r+e|0)>>>0<r>>>0?n+1|0:n,r=e,i=2097151&((1&(e=xe))<<31|$e>>>1),e=n,xe=r=r+i|0,ne=r>>>0<i>>>0?e+1|0:e,e=ze(O,0,j,0),r=b,n=(i=ze(k,0,M,0))+e|0,e=b+r|0,e=n>>>0<i>>>0?e+1|0:e,r=(i=ze(N,0,D,0))+n|0,n=b+e|0,n=r>>>0<i>>>0?n+1|0:n,e=(i=ze(B,0,T,0))+r|0,r=b+n|0,r=e>>>0<i>>>0?r+1|0:r,i=ze(F,0,A,0),n=b+r|0,r=e=i+e|0,e=e>>>0<i>>>0?n+1|0:n,i=n=(n=r)+(r=Te>>>4&2097151)|0,Ge=e=n>>>0<r>>>0?e+1|0:e,Ke=e=e-((n>>>0<4293918720)-1|0)|0,Te=n- -1048576|0,n=(r=e>>>21|0)+ne|0,ne=e=(ke=xe)+(xe=(2097151&e)<<11|Te>>>21)|0,ke=n=e>>>0<xe>>>0?n+1|0:n,$e=e=n-((e>>>0<4293918720)-1|0)|0,n=me,me=(2097151&e)<<11|(xe=ne- -1048576|0)>>>21,e=(e>>>21|0)+ae|0,et=e=(e=(n=n+me|0)>>>0<me>>>0?e+1|0:e)-(((r=-2097152&se)>>>0>n>>>0)+Ne|0)|0,nt=e=e-(((se=n-r|0)>>>0<4293918720)-1|0)|0,r=(n=e>>21)+ve|0,Ne=e=(ae=(2097151&e)<<11|(me=se- -1048576|0)>>>21)+ye|0,qe=r=e>>>0<ae>>>0?r+1|0:r,Xe=e=r-((e>>>0<4293918720)-1|0)|0,ye=Ee-(((n=-2097152&ce)>>>0>le>>>0)+Ye|0)|0,H=le-n|0,le=(2097151&e)<<11|(ve=Ne- -1048576|0)>>>21,e=(e>>21)+Le|0,e=(r=le+Me|0)>>>0<le>>>0?e+1|0:e,n=(ae=ze(Y,Se,136657,0))+(r-(le=-2097152&Ae)|0)|0,r=b+(e-((r>>>0<le>>>0)+Qe|0)|0)|0,r=n>>>0<ae>>>0?r+1|0:r,le=ze(H,ye,-683901,-1),e=b+r|0,e=(n=le+n|0)>>>0<le>>>0?e+1|0:e,le=n,Ye=e,Le=e=e-((n>>>0<4293918720)-1|0)|0,r=(n=e>>21)+Ue|0,r=(e=(ae=(2097151&e)<<11|(Ae=le- -1048576|0)>>>21)+Je|0)>>>0<ae>>>0?r+1|0:r,ae=e,Qe=r,Je=e=r-((e>>>0<4293918720)-1|0)|0,rt=(2097151&e)<<11|(Ee=ae- -1048576|0)>>>21,Ue=e>>21,e=ze(m,0,j,0),r=b,n=(ce=ze(h,ie,M,0))+e|0,e=b+r|0,e=n>>>0<ce>>>0?e+1|0:e,r=(ce=ze(_,ie,N,0))+n|0,n=b+e|0,n=r>>>0<ce>>>0?n+1|0:n,e=(ce=ze(C,ie,B,0))+r|0,r=b+n|0,r=e>>>0<ce>>>0?r+1|0:r,n=(ce=ze(A,0,x,0))+e|0,e=b+r|0,e=n>>>0<ce>>>0?e+1|0:e,r=(ce=ze(v,ie,P,ie))+n|0,n=b+e|0,n=r>>>0<ce>>>0?n+1|0:n,ce=ze(w,0,k,0),e=b+n|0,e=(r=ce+r|0)>>>0<ce>>>0?e+1|0:e,ce=ze(S,ie,D,0),n=b+e|0,n=(r=ce+r|0)>>>0<ce>>>0?n+1|0:n,e=(ce=ze(I,ie,O,0))+r|0,r=b+n|0,r=e>>>0<ce>>>0?r+1|0:r,n=(ce=ze(g,0,T,0))+e|0,e=b+r|0,e=n>>>0<ce>>>0?e+1|0:e,r=(ce=ze(F,0,p,ie))+n|0,n=b+e|0,n=r>>>0<ce>>>0?n+1|0:n,Me=r,r=St(u+26|0),ce=2097151&((3&(e=b))<<30|r>>>2),e=n,e=(r=Me+ce|0)>>>0<ce>>>0?e+1|0:e,ce=r,Me=e,e=ze(U,ge,470296,0),n=b,r=ze(G,pe,666643,0),n=b+n|0,n=(e=r+e|0)>>>0<r>>>0?n+1|0:n,Ie=ze(V,fe,654183,0),r=b+n|0,r=(e=Ie+e|0)>>>0<Ie>>>0?r+1|0:r,Ie=ze(K,he,-997805,-1),n=b+r|0,n=(e=Ie+e|0)>>>0<Ie>>>0?n+1|0:n,r=(Ie=ze(W,Ce,136657,0))+e|0,e=b+n|0,e=(e=r>>>0<Ie>>>0?e+1|0:e)+Me|0,e=(n=r+ce|0)>>>0<r>>>0?e+1|0:e,r=n,ce=Me-(((n=ce)>>>0<4293918720)-1|0)|0,Me=n- -1048576|0,n=e+(n=ue>>>21|0)|0,n=(r=(ue=(2097151&ue)<<11|He>>>21)+r|0)>>>0<ue>>>0?n+1|0:n,r=(e=r)-(He=-2097152&Me)|0,Ie=ze(z,_e,-683901,-1),e=(n=n-((e>>>0<He>>>0)+ce|0)|0)+b|0,e=(ue=r+Ie|0)>>>0<Ie>>>0?e+1|0:e,Ie=ue,ue=n-((r>>>0<4293918720)-1|0)|0,He=r- -1048576|0,n=e+(n=de>>21)|0,n=(r=(de=(2097151&de)<<11|Ze>>>21)+Ie|0)>>>0<de>>>0?n+1|0:n,r=(e=r)-(Ze=-2097152&He)|0,e=(Ie=Ue)+(Ue=n-((e>>>0<Ze>>>0)+ue|0)|0)|0,e=r>>>0>(de=r+rt|0)>>>0?e+1|0:e,n=de,de=Ue-((r>>>0<4293918720)-1|0)|0,Ze=n-(r=-2097152&(Ue=r- -1048576|0))|0,rt=e-((n>>>0<r>>>0)+de|0)|0,Ie=ae-(e=-2097152&Ee)|0,Qe=Qe-((e>>>0>ae>>>0)+Je|0)|0,Je=le-(e=-2097152&Ae)|0,Ye=Ye-((e>>>0>le>>>0)+Le|0)|0,r=ze(z,_e,654183,0),e=b+qe|0,e=(n=r+Ne|0)>>>0<r>>>0?e+1|0:e,r=(ae=ze(Y,Se,-997805,-1))+(n-(le=-2097152&ve)|0)|0,n=b+(e-((n>>>0<le>>>0)+Xe|0)|0)|0,n=r>>>0<ae>>>0?n+1|0:n,le=ze(H,ye,136657,0),e=b+n|0,Ee=r=le+r|0,Ae=r>>>0<le>>>0?e+1|0:e,ae=oe-(e=-2097152&De)|0,Re=Re-((e>>>0>oe>>>0)+We|0)|0,e=ze(G,pe,-997805,-1),n=b,oe=ze(Q,we,654183,0),r=b+n|0,r=(e=oe+e|0)>>>0<oe>>>0?r+1|0:r,oe=ze(U,ge,136657,0),n=b+r|0,n=(e=oe+e|0)>>>0<oe>>>0?n+1|0:n,r=(oe=ze(V,fe,-683901,-1))+e|0,e=b+n|0,n=(e=r>>>0<oe>>>0?e+1|0:e)+Oe|0,n=(r=r+te|0)>>>0<te>>>0?n+1|0:n,oe=(e=r)-(r=-2097152&Pe)|0,Oe=n-((e>>>0<r>>>0)+Fe|0)|0,e=ze(G,pe,654183,0),n=b,te=ze(Q,we,470296,0),r=b+n|0,r=(e=te+e|0)>>>0<te>>>0?r+1|0:r,n=(te=ze(U,ge,-997805,-1))+e|0,e=b+r|0,r=n+c|0,n=Be+(n>>>0<te>>>0?e+1|0:e)|0,n=r>>>0<c>>>0?n+1|0:n,e=r,r=ze(V,fe,136657,0),n=b+n|0,n=(e=e+r|0)>>>0<r>>>0?n+1|0:n,r=(c=ze(K,he,-683901,-1))+e|0,e=b+n|0,e=r>>>0<c>>>0?e+1|0:e,te=(n=r)-(r=-2097152&be)|0,be=e-((n>>>0<r>>>0)+Ve|0)|0,e=ze(h,ie,j,0),r=b,n=(c=ze(f,0,M,0))+e|0,e=b+r|0,e=n>>>0<c>>>0?e+1|0:e,r=(c=ze(m,0,N,0))+n|0,n=b+e|0,n=r>>>0<c>>>0?n+1|0:n,c=ze(_,ie,B,0),e=b+n|0,e=(r=c+r|0)>>>0<c>>>0?e+1|0:e,c=ze(A,0,C,ie),n=b+e|0,n=(r=c+r|0)>>>0<c>>>0?n+1|0:n,e=(c=ze(v,ie,x,0))+r|0,r=b+n|0,r=e>>>0<c>>>0?r+1|0:r,n=(c=ze(w,0,P,ie))+e|0,e=b+r|0,e=n>>>0<c>>>0?e+1|0:e,r=(c=ze(S,ie,O,0))+n|0,n=b+e|0,n=r>>>0<c>>>0?n+1|0:n,c=ze(I,ie,k,0),e=b+n|0,e=(r=c+r|0)>>>0<c>>>0?e+1|0:e,c=ze(g,0,D,0),n=b+e|0,n=(r=c+r|0)>>>0<c>>>0?n+1|0:n,e=(c=ze(F,0,d,0))+r|0,r=b+n|0,r=e>>>0<c>>>0?r+1|0:r,n=(c=ze(p,ie,T,0))+e|0,e=b+r|0,e=n>>>0<c>>>0?e+1|0:e,e=(ce>>>21|0)+(n=(r=(c=(l[u+28|0]|l[u+29|0]<<8|l[u+30|0]<<16|l[u+31|0]<<24)>>>7|0)+n|0)>>>0<c>>>0?e+1|0:e)|0,e=(r=(c=(2097151&ce)<<11|Me>>>21)+r|0)>>>0<c>>>0?e+1|0:e,c=r,Pe=e,De=e=e-((r>>>0<4293918720)-1|0)|0,n=te,te=(2097151&e)<<11|(le=r- -1048576|0)>>>21,e=(e>>21)+be|0,e=(r=n+te|0)>>>0<te>>>0?e+1|0:e,te=r,Ne=e,ve=e=e-((r>>>0<4293918720)-1|0)|0,n=oe,oe=(2097151&e)<<11|(ie=r- -1048576|0)>>>21,e=(e>>21)+Oe|0,ce=e=(r=n+oe|0)>>>0<oe>>>0?e+1|0:e,be=e=e-((r>>>0<4293918720)-1|0)|0,Be=(2097151&e)<<11|(oe=r- -1048576|0)>>>21,e=(e>>21)+Re|0,Oe=ae=Be+ae|0,ae=e=ae>>>0<Be>>>0?e+1|0:e,e=(n=Ee)+(Ee=ze(Oe,e,-683901,-1))|0,n=b+Ae|0,Be=e,Ae=e>>>0<Ee>>>0?n+1|0:n,ce=ce-(((e=-2097152&oe)>>>0>r>>>0)+be|0)|0,Fe=r-e|0,n=ze(z,_e,470296,0)+se|0,e=et+b|0,e=n>>>0<se>>>0?e+1|0:e,r=(se=ze(Y,Se,654183,0))+(n-(oe=-2097152&me)|0)|0,n=b+(e-((n>>>0<oe>>>0)+nt|0)|0)|0,n=r>>>0<se>>>0?n+1|0:n,e=r,r=ze(H,ye,-997805,-1),n=b+n|0,n=(e=e+r|0)>>>0<r>>>0?n+1|0:n,r=(oe=ze(Oe,ae,136657,0))+e|0,e=b+n|0,e=r>>>0<oe>>>0?e+1|0:e,n=(oe=ze(Fe,ce,-683901,-1))+r|0,r=b+e|0,me=r=n>>>0<oe>>>0?r+1|0:r,Ee=r=r-((n>>>0<4293918720)-1|0)|0,e=(e=r>>21)+Ae|0,e=(r=(oe=(2097151&r)<<11|(se=n- -1048576|0)>>>21)+Be|0)>>>0<oe>>>0?e+1|0:e,oe=r,Ae=e,Be=r=e-((r>>>0<4293918720)-1|0)|0,Re=(2097151&r)<<11|(be=oe- -1048576|0)>>>21,r=(r>>21)+Ye|0,r=Re>>>0>(Ve=Re+Je|0)>>>0?r+1|0:r,Re=Ve,Ve=r,We=oe-(e=-2097152&be)|0,Be=Ae-((e>>>0>oe>>>0)+Be|0)|0,Ae=n-(e=-2097152&se)|0,me=me-((e>>>0>n>>>0)+Ee|0)|0,e=(r=ze(z,_e,666643,0))+(ne-(n=-2097152&xe)|0)|0,n=b+(ke-((n>>>0>ne>>>0)+$e|0)|0)|0,n=e>>>0<r>>>0?n+1|0:n,oe=ze(Y,Se,470296,0),r=b+n|0,r=(e=oe+e|0)>>>0<oe>>>0?r+1|0:r,n=(oe=ze(H,ye,654183,0))+e|0,e=b+r|0,be=n,oe=n>>>0<oe>>>0?e+1|0:e,ne=te-(e=-2097152&ie)|0,te=Ne-((e>>>0>te>>>0)+ve|0)|0,e=ze(G,pe,470296,0),r=b,n=(se=ze(Q,we,666643,0))+e|0,e=b+r|0,e=n>>>0<se>>>0?e+1|0:e,se=ze(U,ge,654183,0),r=b+e|0,r=(n=se+n|0)>>>0<se>>>0?r+1|0:r,se=ze(V,fe,-997805,-1),e=b+r|0,e=(n=se+n|0)>>>0<se>>>0?e+1|0:e,r=(se=ze(K,he,136657,0))+n|0,n=b+e|0,n=r>>>0<se>>>0?n+1|0:n,e=r,r=ze(W,Ce,-683901,-1),n=b+n|0,n=(e=e+r|0)>>>0<r>>>0?n+1|0:n,r=e+c|0,e=n+Pe|0,e=r>>>0<c>>>0?e+1|0:e,c=(n=r)-(r=-2097152&le)|0,r=e-((n>>>0<r>>>0)+De|0)|0,n=(e=c)+(c=(2097151&ue)<<11|He>>>21)|0,e=(ue>>21)+r|0,e=n>>>0<c>>>0?e+1|0:e,c=n,_e=e,fe=n=e-((n>>>0<4293918720)-1|0)|0,le=(2097151&n)<<11|(se=c- -1048576|0)>>>21,n=(n>>21)+te|0,xe=r=le+ne|0,ne=n=r>>>0<le>>>0?n+1|0:n,n=ze(r,n,-683901,-1),r=b+oe|0,r=(e=n+be|0)>>>0<n>>>0?r+1|0:r,n=(te=ze(Oe,ae,-997805,-1))+e|0,e=b+r|0,e=n>>>0<te>>>0?e+1|0:e,r=(te=ze(Fe,ce,136657,0))+n|0,n=b+e|0,De=r,ge=r>>>0<te>>>0?n+1|0:n,e=ze(D,0,j,0),r=b,n=(te=ze(O,0,M,0))+e|0,e=b+r|0,e=n>>>0<te>>>0?e+1|0:e,r=(te=ze(N,0,T,0))+n|0,n=b+e|0,n=r>>>0<te>>>0?n+1|0:n,e=(te=ze(F,0,B,0))+r|0,r=b+n|0,n=e,e=e>>>0<te>>>0?r+1|0:r,ie=n=(r=ee>>>7&2097151)+n|0,oe=n>>>0<r>>>0?e+1|0:e,e=ze(j,0,T,0),n=b,r=ze(D,0,M,0),n=b+n|0,n=(e=r+e|0)>>>0<r>>>0?n+1|0:n,te=ze(F,0,N,0),r=b+n|0,r=(e=te+e|0)>>>0<te>>>0?r+1|0:r,n=e,te=2097151&((3&(e=$))<<30|X>>>2),e=r,e=(n=n+te|0)>>>0<te>>>0?e+1|0:e,te=n,le=e,he=e=e-((n>>>0<4293918720)-1|0)|0,n=e>>>21|0,e=(r=ie)+(ie=(2097151&e)<<11|(ue=te- -1048576|0)>>>21)|0,r=n+oe|0,oe=e,Ce=r=e>>>0<ie>>>0?r+1|0:r,be=e=r-((e>>>0<4293918720)-1|0)|0,r=i+((2097151&e)<<11|(ie=oe- -1048576|0)>>>21)|0,e=Ge+(e>>>21|0)|0,e=r>>>0<i>>>0?e+1|0:e,n=(pe=ze(Y,Se,666643,0))+(r-(i=-2097152&Te)|0)|0,r=b+(e-((r>>>0<i>>>0)+Ke|0)|0)|0,e=(i=ze(H,ye,470296,0))+n|0,n=b+(n>>>0<pe>>>0?r+1|0:r)|0,n=e>>>0<i>>>0?n+1|0:n,r=(i=ze(xe,ne,136657,0))+e|0,e=b+n|0,e=r>>>0<i>>>0?e+1|0:e,n=r,r=ze(Oe,ae,654183,0),e=b+e|0,e=(n=n+r|0)>>>0<r>>>0?e+1|0:e,r=(i=ze(Fe,ce,-997805,-1))+n|0,n=b+e|0,pe=r,Se=n=r>>>0<i>>>0?n+1|0:n,Pe=n=n-((r>>>0<4293918720)-1|0)|0,i=(2097151&n)<<11|(we=r- -1048576|0)>>>21,n=(n>>21)+ge|0,i=n=(r=i+De|0)>>>0<i>>>0?n+1|0:n,De=n=n-((r>>>0<4293918720)-1|0)|0,Te=(2097151&n)<<11|(ge=r- -1048576|0)>>>21,n=(n>>21)+me|0,Ne=Ae=Te+Ae|0,Ae=Ae>>>0<Te>>>0?n+1|0:n,Te=i,n=c-(e=-2097152&se)|0,i=_e-((e>>>0>c>>>0)+fe|0)|0,e=(c=(2097151&de)<<11|Ue>>>21)+n|0,n=(de>>21)+i|0,i=e,_e=n=e>>>0<c>>>0?n+1|0:n,fe=e=n-((e>>>0<4293918720)-1|0)|0,se=n=e>>21,c=r,r=ze(me=(2097151&e)<<11|(de=i- -1048576|0)>>>21,n,-683901,-1),e=b+Te|0,e=(n=c+r|0)>>>0<r>>>0?e+1|0:e,Te=n-(r=-2097152&ge)|0,De=e-((n>>>0<r>>>0)+De|0)|0,r=ze(me,se,136657,0),n=b+Se|0,n=(e=r+pe|0)>>>0<r>>>0?n+1|0:n,ve=e-(r=-2097152&we)|0,Ee=n-((e>>>0<r>>>0)+Pe|0)|0,c=ze(H,ye,666643,0),r=b+(Ce-(((n=-2097152&ie)>>>0>oe>>>0)+be|0)|0)|0,r=(e=c+(oe-n|0)|0)>>>0<c>>>0?r+1|0:r,n=(c=ze(xe,ne,-997805,-1))+e|0,e=b+r|0,e=n>>>0<c>>>0?e+1|0:e,r=(c=ze(Oe,ae,470296,0))+n|0,n=b+e|0,n=r>>>0<c>>>0?n+1|0:n,e=r,r=ze(Fe,ce,654183,0),n=b+n|0,be=e=e+r|0,ie=e>>>0<r>>>0?n+1|0:n,pe=te,we=le,e=ze(F,0,j,0),r=b,n=(c=ze(T,0,M,0))+e|0,e=b+r|0,e=n>>>0<c>>>0?e+1|0:e,r=(n=(c=J>>>5&2097151)+n|0)>>>0<c>>>0?e+1|0:e,te=n,c=2097151&q,n=ze(F,0,M,0)+c|0,e=b,e=n>>>0<c>>>0?e+1|0:e,c=n,ge=e,Se=e=e-((n>>>0<4293918720)-1|0)|0,n=(n=e>>>21|0)+r|0,n=(e=(le=te)+(te=(2097151&e)<<11|(oe=c- -1048576|0)>>>21)|0)>>>0<te>>>0?n+1|0:n,te=e,Ce=n,ye=e=n-((e>>>0<4293918720)-1|0)|0,n=pe,pe=(2097151&e)<<11|(le=te- -1048576|0)>>>21,e=(e>>>21|0)+we|0,e=(r=n+pe|0)>>>0<pe>>>0?e+1|0:e,r=(pe=ze(xe,ne,654183,0))+((n=r)-(ue&=-2097152)|0)|0,n=b+(e-((16383&he)+(n>>>0<ue>>>0)|0)|0)|0,n=r>>>0<pe>>>0?n+1|0:n,e=r,r=ze(Oe,ae,666643,0),n=b+n|0,n=(e=e+r|0)>>>0<r>>>0?n+1|0:n,r=(ae=ze(Fe,ce,470296,0))+e|0,e=b+n|0,e=r>>>0<ae>>>0?e+1|0:e,ae=r,pe=e,we=e=e-((r>>>0<4293918720)-1|0)|0,he=(2097151&e)<<11|(ue=r- -1048576|0)>>>21,e=(e>>21)+ie|0,he=e=(r=he+be|0)>>>0<he>>>0?e+1|0:e,be=e=e-((r>>>0<4293918720)-1|0)|0,n=ve,ve=(2097151&e)<<11|(ie=r- -1048576|0)>>>21,e=(e>>21)+Ee|0,e=ve>>>0>(Pe=n+ve|0)>>>0?e+1|0:e,ve=Pe,Pe=e,e=(n=ze(me,se,-997805,-1))+r|0,r=b+he|0,r=e>>>0<n>>>0?r+1|0:r,ie=e-(n=-2097152&ie)|0,he=r-((e>>>0<n>>>0)+be|0)|0,r=ze(me,se,654183,0),n=b+pe|0,n=(e=r+ae|0)>>>0<r>>>0?n+1|0:n,pe=e-(r=-2097152&ue)|0,we=n-((e>>>0<r>>>0)+we|0)|0,n=(r=ze(xe,ne,470296,0))+(te-(e=-2097152&le)|0)|0,e=b+(Ce-((16383&ye)+(e>>>0>te>>>0)|0)|0)|0,e=n>>>0<r>>>0?e+1|0:e,r=(te=ze(Fe,ce,666643,0))+n|0,n=b+e|0,ae=r,te=r>>>0<te>>>0?n+1|0:n,e=(r=ze(xe,ne,666643,0))+(c-(n=-2097152&oe)|0)|0,n=b+(ge-((4095&Se)+(n>>>0>c>>>0)|0)|0)|0,n=e>>>0<r>>>0?n+1|0:n,r=e,le=n,ne=n=n-((e>>>0<4293918720)-1|0)|0,oe=ae,ae=(2097151&n)<<11|(c=e- -1048576|0)>>>21,n=(n>>21)+te|0,ae=n=(te=oe=oe+ae|0)>>>0<ae>>>0?n+1|0:n,ue=n=n-((te>>>0<4293918720)-1|0)|0,e=pe,pe=(2097151&n)<<11|(oe=te- -1048576|0)>>>21,n=(n>>21)+we|0,n=(ce=e+pe|0)>>>0<pe>>>0?n+1|0:n,pe=ce,ce=n,n=(e=te)+(te=ze(me,se,470296,0))|0,e=b+ae|0,e=n>>>0<te>>>0?e+1|0:e,oe=n-(te=-2097152&oe)|0,te=e-((n>>>0<te>>>0)+ue|0)|0,ae=oe,e=(r-(n=-2097152&c)|0)+(c=ze(me,se,666643,0))|0,n=b+(le-((n>>>0>r>>>0)+ne|0)|0)|0,oe=e,r=e,e=(e=(n=e>>>0<c>>>0?n+1|0:n)>>21)+te|0,e=(n=ae+(r=(2097151&n)<<11|r>>>21)|0)>>>0<r>>>0?e+1|0:e,le=n,r=n,n=(n=e>>21)+ce|0,se=e=(r=(2097151&e)<<11|r>>>21)+pe|0,c=(2097151&(n=e>>>0<r>>>0?n+1|0:n))<<11|(r=e)>>>21,r=(e=n>>21)+he|0,ae=n=c+ie|0,c=(2097151&(r=(e=n)>>>0<c>>>0?r+1|0:r))<<11|e>>>21,e=(n=r>>21)+Pe|0,ue=r=c+ve|0,c=(2097151&(e=(n=r)>>>0<c>>>0?e+1|0:e))<<11|n>>>21,n=(r=e>>21)+De|0,ce=e=c+Te|0,r=e,e=(e=(n=e>>>0<c>>>0?n+1|0:n)>>21)+Ae|0,e=(n=(r=(2097151&n)<<11|r>>>21)+Ne|0)>>>0<r>>>0?e+1|0:e,ie=n,r=n,n=(n=e>>21)+Be|0,pe=e=(r=(2097151&e)<<11|r>>>21)+We|0,c=(2097151&(n=e>>>0<r>>>0?n+1|0:n))<<11|(r=e)>>>21,r=(e=n>>21)+Ve|0,we=n=c+Re|0,c=(2097151&(r=(e=n)>>>0<c>>>0?r+1|0:r))<<11|e>>>21,e=(n=r>>21)+Qe|0,ge=r=c+Ie|0,c=(2097151&(e=(n=r)>>>0<c>>>0?e+1|0:e))<<11|n>>>21,n=(r=e>>21)+rt|0,Se=e=c+Ze|0,r=e,e=(n=e>>>0<c>>>0?n+1|0:n)>>21,r=(2097151&n)<<11|r>>>21,c=i-(n=-2097152&de)|0,n=(_e-((n>>>0>i>>>0)+fe|0)|0)+e|0,de=r=r+c|0,c=r=(n=(e=r)>>>0<c>>>0?n+1|0:n)>>21,e=ze(ne=(2097151&n)<<11|e>>>21,r,666643,0),n=b,te=e=e+(r=2097151&oe)|0,i=n=e>>>0<r>>>0?n+1|0:n,o[0|s]=e,o[s+1|0]=(255&n)<<24|e>>>8,r=2097151&le,n=ze(ne,c,470296,0)+r|0,e=b,oe=(le=(2097151&i)<<11|te>>>21)+n|0,n=(i>>21)+(e=n>>>0<r>>>0?e+1|0:e)|0,n=oe>>>0<le>>>0?n+1|0:n,o[s+4|0]=(2047&n)<<21|oe>>>11,e=n,o[s+3|0]=(7&e)<<29|oe>>>3,le=2097151&se,r=ze(ne,c,654183,0)+le|0,n=b,se=(2097151&e)<<11|oe>>>21,e=(e>>21)+(n=r>>>0<le>>>0?n+1|0:n)|0,n=e=se>>>0>(r=le=se+r|0)>>>0?e+1|0:e,o[s+6|0]=(63&e)<<26|r>>>6,le=0,e=oe&=2097151,o[s+2|0]=31&((65535&i)<<16|te>>>16)|e<<5,te=2097151&ae,i=ze(ne,c,-997805,-1)+te|0,e=b,se=(2097151&n)<<11|r>>>21,n=(n>>21)+(e=i>>>0<te>>>0?e+1|0:e)|0,n=(e=te=se+i|0)>>>0<se>>>0?n+1|0:n,o[s+9|0]=(511&n)<<23|e>>>9,o[s+8|0]=(1&n)<<31|e>>>1,i=0,te=(r=se=2097151&r)<<2,r=le,o[s+5|0]=te|(524287&r)<<13|oe>>>19,oe=2097151&ue,te=ze(ne,c,136657,0)+oe|0,r=b,r=te>>>0<oe>>>0?r+1|0:r,oe=te,te=r,r=n,n=(n>>=21)+te|0,n=(r=(ae=oe)+(oe=(2097151&r)<<11|e>>>21)|0)>>>0<oe>>>0?n+1|0:n,o[s+12|0]=(4095&n)<<20|r>>>12,o[s+11|0]=(15&n)<<28|r>>>4,te=0,oe=(e=le=2097151&e)<<7,e=i,i=se,o[s+7|0]=oe|(16383&e)<<18|i>>>14,i=(e=ze(ne,c,-683901,-1))+(c=2097151&ce)|0,e=b,e=i>>>0<c>>>0?e+1|0:e,c=i,i=e,oe=(2097151&(e=n))<<11|r>>>21,e=(n=e>>21)+i|0,e=(c=oe+c|0)>>>0<oe>>>0?e+1|0:e,o[s+14|0]=(127&e)<<25|c>>>7,oe=0,r=(n=ne=2097151&r)<<4,n=te,o[s+10|0]=r|(131071&n)<<15|le>>>17,n=e,e>>=21,i=r=(te=(2097151&n)<<11|c>>>21)+(2097151&ie)|0,n=r>>>0<te>>>0?e+1|0:e,o[s+17|0]=(1023&n)<<22|r>>>10,o[s+16|0]=(3&n)<<30|r>>>2,te=0,c=(e=le=2097151&c)<<1,e=oe,o[s+13|0]=c|(1048575&e)<<12|ne>>>20,e=n>>21,r=(n=(c=(2097151&n)<<11|r>>>21)+(2097151&pe)|0)>>>0<c>>>0?e+1|0:e,c=n,o[s+20|0]=(8191&r)<<19|n>>>13,o[s+19|0]=(31&r)<<27|n>>>5,n=(e=ne=2097151&i)<<6,e=te,o[s+15|0]=n|(32767&e)<<17|le>>>15,n=r>>21,le=i=(te=(2097151&r)<<11|c>>>21)+(2097151&we)|0,i=i>>>0<te>>>0?n+1|0:n,o[s+21|0]=le,n=(e=c)<<3,e=oe,o[s+18|0]=n|(262143&e)<<14|ne>>>18,e=le,o[s+22|0]=(255&i)<<24|e>>>8,n=i>>21,n=(e=(c=(2097151&i)<<11|e>>>21)+(2097151&ge)|0)>>>0<c>>>0?n+1|0:n,c=e,o[s+25|0]=(2047&n)<<21|e>>>11,o[s+24|0]=(7&n)<<29|e>>>3,e=n>>21,r=(n=(te=(2097151&n)<<11|c>>>21)+(2097151&Se)|0)>>>0<te>>>0?e+1|0:e,te=n,o[s+27|0]=(63&r)<<26|n>>>6,e=c&=2097151,o[s+23|0]=31&((65535&i)<<16|le>>>16)|e<<5,e=r>>21,e=(n=(r=(2097151&r)<<11|n>>>21)+(2097151&de)|0)>>>0<r>>>0?e+1|0:e,o[s+31|0]=(131071&e)<<15|n>>>17,o[s+30|0]=(511&e)<<23|n>>>9,o[s+29|0]=(1&e)<<31|n>>>1,i=0,e=(r=te&=2097151)<<2,r=oe,o[s+26|0]=e|(524287&r)<<13|c>>>19,e=i,o[s+28|0]=(16383&e)<<18|te>>>14|n<<7,bn(L,64),bn(u,64),t&&(a[t>>2]=64,a[t+4>>2]=0),y=R+560|0,0}function C(e,t,n,r){for(var i=0,o=0,s=0,c=0,u=0,d=0,h=0,p=0,f=0,g=0,m=0,y=0,v=0,A=0,w=0,S=0,C=0,E=0,I=0,_=0,x=0,P=0,k=0,B=0,O=0,N=0,D=0,j=0,T=0,M=0,F=0,R=0,L=0,Q=0,U=0,V=0,K=0,H=0,G=0,Y=0;c=(i=h<<3)+n|0,_=l[4+(i=t+i|0)|0]|l[i+5|0]<<8|l[i+6|0]<<16|l[i+7|0]<<24,s=(d=g=l[0|i]|l[i+1|0]<<8|l[i+2|0]<<16|l[i+3|0]<<24)<<24|d<<8&16711680,a[c>>2]=-16777216&((255&_)<<24|d>>>8)|16711680&((16777215&_)<<8|d>>>24)|_>>>8&65280|_>>>24,i=0,a[c+4>>2]=65280&(_<<24|d>>>8)|255&(_<<8|d>>>24)|s|i|i,16!=(0|(h=h+1|0)););for(t=pt(r,e,64);;){if(i=a[(r=_=(x=V<<3)+n|0)>>2],r=a[r+4>>2],c=we(v=a[t+32>>2],p=a[t+36>>2],14),s=b,c=we(v,p,18)^c,s^=b,c=we(v,p,41)^c,r=(b^s)+r|0,r=(i=c+i|0)>>>0<c>>>0?r+1|0:r,o=a[t+48>>2],i=(s=a[(c=x+34144|0)>>2])+i|0,r=a[c+4>>2]+r|0,r=i>>>0<s>>>0?r+1|0:r,c=(s=o^((y=a[t+40>>2])^o)&v)+i|0,i=(((A=a[t+52>>2])^(w=a[t+44>>2]))&p^A)+r|0,i=s>>>0>c>>>0?i+1|0:i,c=(s=a[t+56>>2])+c|0,r=a[t+60>>2]+i|0,r=s>>>0>c>>>0?r+1|0:r,s=c+(h=a[t+24>>2])|0,i=a[t+28>>2]+r|0,d=s,f=i=s>>>0<h>>>0?i+1|0:i,a[t+24>>2]=s,a[t+28>>2]=i,i=we(C=a[t>>2],h=a[t+4>>2],28),g=b,i=we(C,h,34)^i,s=b^g,g=c+(we(C,h,39)^i)|0,i=r+(b^s)|0,i=c>>>0>g>>>0?i+1|0:i,g=(S=C&((c=a[t+16>>2])|(u=a[t+8>>2]))|c&u)+g|0,r=(r=i)+(h&((i=a[t+20>>2])|(s=a[t+12>>2]))|i&s)|0,r=g>>>0<S>>>0?r+1|0:r,S=g,g=r,a[t+56>>2]=S,a[t+60>>2]=r,r=i,i=we(d,f,14),m=b,E=we(d,f,18)^i,m^=b,B=c,c=(i=o)+(o=(y^v)&d^y)|0,i=((p^w)&f^w)+A|0,i=c>>>0<o>>>0?i+1|0:i,o=we(d,f,41)^E,i=(b^m)+i|0,i=(c=o+c|0)>>>0<o>>>0?i+1|0:i,c=(m=a[(A=D=(o=8|x)+n|0)>>2])+c|0,i=a[A+4>>2]+i|0,i=c>>>0<m>>>0?i+1|0:i,c=(A=a[(o=o+34144|0)>>2])+c|0,i=a[o+4>>2]+i|0,i=c>>>0<A>>>0?i+1|0:i,m=c,A=r,r=i,i=A+i|0,i=(c=B+(o=c)|0)>>>0<o>>>0?i+1|0:i,o=c,A=i,a[t+16>>2]=o,a[t+20>>2]=i,i=we(S,g,28),c=b,E=we(S,g,34)^i,I=b^c,c=(i=m)+(m=(u|C)&S|u&C)|0,i=((s|h)&g|s&h)+r|0,i=c>>>0<m>>>0?i+1|0:i,m=we(S,g,39)^E,r=(b^I)+i|0,r=(c=m+c|0)>>>0<m>>>0?r+1|0:r,m=c,c=r,a[t+48>>2]=m,a[t+52>>2]=r,r=we(o,A,14),i=b,E=we(o,A,18)^r,I=b^i,B=u,i=((p^f)&A^p)+w|0,i=(r=(u=(d^v)&o^v)+y|0)>>>0<u>>>0?i+1|0:i,u=we(o,A,41)^E,i=(b^I)+i|0,i=(r=u+r|0)>>>0<u>>>0?i+1|0:i,u=(u=r)+(w=a[(r=j=(y=16|x)+n|0)>>2])|0,r=a[r+4>>2]+i|0,r=u>>>0<w>>>0?r+1|0:r,u=(y=a[(i=y+34144|0)>>2])+u|0,i=a[i+4>>2]+r|0,i=u>>>0<y>>>0?i+1|0:i,w=u,y=u,r=i,i=i+s|0,y=i=(u=B+u|0)>>>0<y>>>0?i+1|0:i,a[t+8>>2]=u,a[t+12>>2]=i,i=we(m,c,28),s=b,E=we(m,c,34)^i,s^=b,r=((h|g)&c|h&g)+r|0,r=(i=(i=w)+(w=(S|C)&m|S&C)|0)>>>0<w>>>0?r+1|0:r,w=we(m,c,39)^E,r=(b^s)+r|0,r=(i=w+i|0)>>>0<w>>>0?r+1|0:r,w=i,s=r,a[t+40>>2]=i,a[t+44>>2]=r,r=we(u,y,14),i=b,E=we(u,y,18)^r,I=b^i,B=C,i=(f^(f^A)&y)+p|0,i=(r=(C=d^(o^d)&u)+v|0)>>>0<C>>>0?i+1|0:i,p=(C=we(u,y,41)^E)+r|0,r=(b^I)+i|0,r=p>>>0<C>>>0?r+1|0:r,p=(v=a[(i=T=(C=24|x)+n|0)>>2])+p|0,i=a[i+4>>2]+r|0,i=p>>>0<v>>>0?i+1|0:i,r=(r=p)+(C=a[(p=C+34144|0)>>2])|0,i=a[p+4>>2]+i|0,v=r,p=B+r|0,r=(i=r>>>0<C>>>0?i+1|0:i)+h|0,C=r=p>>>0<v>>>0?r+1|0:r,a[t>>2]=p,a[t+4>>2]=r,r=we(w,s,28),h=b,E=we(w,s,34)^r,I=b^h,i=((c|g)&s|c&g)+i|0,i=(r=(h=(m|S)&w|m&S)+v|0)>>>0<h>>>0?i+1|0:i,h=(v=we(w,s,39)^E)+r|0,r=(b^I)+i|0,r=h>>>0<v>>>0?r+1|0:r,v=h,h=r,a[t+32>>2]=v,a[t+36>>2]=r,r=we(p,C,14),i=b,E=we(p,C,18)^r,I=b^i,O=S,i=f+(A^(y^A)&C)|0,i=(r=d+(o^(o^u)&p)|0)>>>0<d>>>0?i+1|0:i,d=we(p,C,41)^E,i=(b^I)+i|0,i=(r=d+r|0)>>>0<d>>>0?i+1|0:i,r=(S=a[(f=B=(d=32|x)+n|0)>>2])+r|0,i=a[f+4>>2]+i|0,i=r>>>0<S>>>0?i+1|0:i,r=(f=a[(d=d+34144|0)>>2])+r|0,i=a[d+4>>2]+i|0,i=r>>>0<f>>>0?i+1|0:i,S=r,f=r,d=O+r|0,r=i,i=i+g|0,f=i=d>>>0<f>>>0?i+1|0:i,a[t+56>>2]=d,a[t+60>>2]=i,i=we(v,h,28),g=b,E=we(v,h,34)^i,I=b^g,g=(i=S)+(S=(m|w)&v|m&w)|0,i=((s|c)&h|s&c)+r|0,i=g>>>0<S>>>0?i+1|0:i,S=we(v,h,39)^E,r=(b^I)+i|0,r=(g=S+g|0)>>>0<S>>>0?r+1|0:r,S=g,g=r,a[t+24>>2]=S,a[t+28>>2]=r,r=we(d,f,14),i=b,E=we(d,f,18)^r,I=b^i,O=m,i=A+(y^(y^C)&f)|0,i=(r=o+(u^(u^p)&d)|0)>>>0<o>>>0?i+1|0:i,o=we(d,f,41)^E,i=(b^I)+i|0,i=(r=o+r|0)>>>0<o>>>0?i+1|0:i,o=(o=r)+(m=a[(r=k=(A=40|x)+n|0)>>2])|0,r=a[r+4>>2]+i|0,r=o>>>0<m>>>0?r+1|0:r,o=(A=a[(i=A+34144|0)>>2])+o|0,i=a[i+4>>2]+r|0,m=o,r=i=o>>>0<A>>>0?i+1|0:i,i=i+c|0,A=i=(o=O+o|0)>>>0<m>>>0?i+1|0:i,a[t+48>>2]=o,a[t+52>>2]=i,i=we(S,g,28),c=b,E=we(S,g,34)^i,c^=b,r=((s|h)&g|s&h)+r|0,r=(i=(i=m)+(m=(w|v)&S|w&v)|0)>>>0<m>>>0?r+1|0:r,m=we(S,g,39)^E,r=(b^c)+r|0,r=(i=m+i|0)>>>0<m>>>0?r+1|0:r,m=i,c=r,a[t+16>>2]=i,a[t+20>>2]=r,r=we(o,A,14),i=b,E=we(o,A,18)^r,I=b^i,P=w,i=y+(C^(f^C)&A)|0,i=(r=u+(p^(d^p)&o)|0)>>>0<u>>>0?i+1|0:i,u=(y=we(o,A,41)^E)+r|0,r=(b^I)+i|0,r=u>>>0<y>>>0?r+1|0:r,u=(w=a[(i=O=(y=48|x)+n|0)>>2])+u|0,i=a[i+4>>2]+r|0,i=u>>>0<w>>>0?i+1|0:i,r=(r=u)+(y=a[(u=y+34144|0)>>2])|0,i=a[u+4>>2]+i|0,i=r>>>0<y>>>0?i+1|0:i,w=r,y=r,u=P+r|0,r=i+s|0,y=r=u>>>0<y>>>0?r+1|0:r,a[t+40>>2]=u,a[t+44>>2]=r,r=we(m,c,28),s=b,E=we(m,c,34)^r,I=b^s,i=((h|g)&c|h&g)+i|0,i=(r=(s=(S|v)&m|S&v)+w|0)>>>0<s>>>0?i+1|0:i,s=(w=we(m,c,39)^E)+r|0,r=(b^I)+i|0,r=s>>>0<w>>>0?r+1|0:r,w=s,s=r,a[t+8>>2]=w,a[t+12>>2]=r,r=we(u,y,14),i=b,E=we(u,y,18)^r,I=b^i,P=v,i=C+(f^(f^A)&y)|0,i=(r=p+(d^(o^d)&u)|0)>>>0<p>>>0?i+1|0:i,p=we(u,y,41)^E,i=(b^I)+i|0,i=(r=p+r|0)>>>0<p>>>0?i+1|0:i,r=(v=a[(C=R=(p=56|x)+n|0)>>2])+r|0,i=a[C+4>>2]+i|0,i=r>>>0<v>>>0?i+1|0:i,r=(C=a[(p=p+34144|0)>>2])+r|0,i=a[p+4>>2]+i|0,v=r,p=P+r|0,r=i=r>>>0<C>>>0?i+1|0:i,i=i+h|0,C=i=p>>>0<v>>>0?i+1|0:i,a[t+32>>2]=p,a[t+36>>2]=i,i=we(w,s,28),h=b,E=we(w,s,34)^i,I=b^h,h=(i=v)+(v=(m|S)&w|m&S)|0,i=((c|g)&s|c&g)+r|0,i=h>>>0<v>>>0?i+1|0:i,v=we(w,s,39)^E,r=(b^I)+i|0,r=(h=v+h|0)>>>0<v>>>0?r+1|0:r,v=h,h=r,a[t>>2]=v,a[t+4>>2]=r,r=we(p,C,14),i=b,E=we(p,C,18)^r,I=b^i,P=S,i=f+(A^(y^A)&C)|0,i=(r=d+(o^(o^u)&p)|0)>>>0<d>>>0?i+1|0:i,d=we(p,C,41)^E,i=(b^I)+i|0,i=(r=d+r|0)>>>0<d>>>0?i+1|0:i,d=(d=r)+(S=a[(r=K=(f=64|x)+n|0)>>2])|0,r=a[r+4>>2]+i|0,r=d>>>0<S>>>0?r+1|0:r,d=(f=a[(i=f+34144|0)>>2])+d|0,i=a[i+4>>2]+r|0,i=d>>>0<f>>>0?i+1|0:i,f=d,r=i,i=i+g|0,S=i=(d=P+d|0)>>>0<f>>>0?i+1|0:i,a[t+24>>2]=d,a[t+28>>2]=i,i=we(v,h,28),g=b,E=we(v,h,34)^i,g^=b,r=((s|c)&h|s&c)+r|0,r=(i=(i=f)+(f=(m|w)&v|m&w)|0)>>>0<f>>>0?r+1|0:r,f=we(v,h,39)^E,r=(b^g)+r|0,E=i=f+i|0,g=r=i>>>0<f>>>0?r+1|0:r,a[t+56>>2]=i,a[t+60>>2]=r,r=we(d,S,14),i=b,f=we(d,S,18)^r,I=b^i,i=A+(y^(y^C)&S)|0,i=(r=o+(u^(u^p)&d)|0)>>>0<o>>>0?i+1|0:i,o=(f=we(d,S,41)^f)+r|0,r=(b^I)+i|0,r=o>>>0<f>>>0?r+1|0:r,o=(A=a[(i=P=(f=72|x)+n|0)>>2])+o|0,i=a[i+4>>2]+r|0,i=o>>>0<A>>>0?i+1|0:i,r=(r=o)+(f=a[(o=f+34144|0)>>2])|0,i=a[o+4>>2]+i|0,i=r>>>0<f>>>0?i+1|0:i,f=r,o=r+m|0,r=i+c|0,m=r=o>>>0<f>>>0?r+1|0:r,a[t+16>>2]=o,a[t+20>>2]=r,r=we(E,g,28),c=b,A=we(E,g,34)^r,I=b^c,i=((s|h)&g|s&h)+i|0,i=(r=(c=(w|v)&E|w&v)+f|0)>>>0<c>>>0?i+1|0:i,c=(f=we(E,g,39)^A)+r|0,r=(b^I)+i|0,I=c,c=r=c>>>0<f>>>0?r+1|0:r,a[t+48>>2]=I,a[t+52>>2]=r,r=we(o,m,14),i=b,f=we(o,m,18)^r,A=b^i,i=y+(C^(S^C)&m)|0,i=(r=u+(p^(d^p)&o)|0)>>>0<u>>>0?i+1|0:i,u=we(o,m,41)^f,i=(b^A)+i|0,i=(r=u+r|0)>>>0<u>>>0?i+1|0:i,r=(A=a[(f=N=(u=80|x)+n|0)>>2])+r|0,i=a[f+4>>2]+i|0,i=r>>>0<A>>>0?i+1|0:i,r=(f=a[(u=u+34144|0)>>2])+r|0,i=a[u+4>>2]+i|0,i=r>>>0<f>>>0?i+1|0:i,f=r,u=r+w|0,r=i,i=i+s|0,y=i=u>>>0<f>>>0?i+1|0:i,a[t+8>>2]=u,a[t+12>>2]=i,i=we(I,c,28),s=b,A=we(I,c,34)^i,w=b^s,s=(i=f)+(f=(v|E)&I|v&E)|0,i=((h|g)&c|h&g)+r|0,i=s>>>0<f>>>0?i+1|0:i,f=we(I,c,39)^A,r=(b^w)+i|0,f=r=(s=f+s|0)>>>0<f>>>0?r+1|0:r,a[t+40>>2]=s,a[t+44>>2]=r,r=we(u,y,14),i=b,A=we(u,y,18)^r,w=b^i,i=C+(S^(m^S)&y)|0,i=(r=p+(d^(o^d)&u)|0)>>>0<p>>>0?i+1|0:i,p=we(u,y,41)^A,i=(b^w)+i|0,i=(r=p+r|0)>>>0<p>>>0?i+1|0:i,p=(p=r)+(C=a[(r=F=(A=88|x)+n|0)>>2])|0,r=a[r+4>>2]+i|0,r=p>>>0<C>>>0?r+1|0:r,p=(A=a[(i=A+34144|0)>>2])+p|0,i=a[i+4>>2]+r|0,i=p>>>0<A>>>0?i+1|0:i,A=p,r=i,i=i+h|0,C=i=(p=p+v|0)>>>0<A>>>0?i+1|0:i,a[t>>2]=p,a[t+4>>2]=i,i=we(s,f,28),h=b,w=we(s,f,34)^i,h^=b,r=((c|g)&f|c&g)+r|0,r=(i=(i=A)+(A=(E|I)&s|E&I)|0)>>>0<A>>>0?r+1|0:r,A=we(s,f,39)^w,r=(b^h)+r|0,h=i=A+i|0,A=r=i>>>0<A>>>0?r+1|0:r,a[t+32>>2]=i,a[t+36>>2]=r,r=we(p,C,14),i=b,w=we(p,C,18)^r,v=b^i,i=S+(m^(y^m)&C)|0,i=(r=d+(o^(o^u)&p)|0)>>>0<d>>>0?i+1|0:i,d=(S=we(p,C,41)^w)+r|0,r=(b^v)+i|0,r=d>>>0<S>>>0?r+1|0:r,d=(w=a[(i=H=(S=96|x)+n|0)>>2])+d|0,i=a[i+4>>2]+r|0,i=d>>>0<w>>>0?i+1|0:i,r=(r=d)+(S=a[(d=S+34144|0)>>2])|0,i=a[d+4>>2]+i|0,i=r>>>0<S>>>0?i+1|0:i,S=r,d=r+E|0,r=i+g|0,w=d,d=r=d>>>0<S>>>0?r+1|0:r,a[t+56>>2]=w,a[t+60>>2]=r,r=we(h,A,28),g=b,v=we(h,A,34)^r,E=b^g,i=((c|f)&A|c&f)+i|0,i=(r=(g=(s|I)&h|s&I)+S|0)>>>0<g>>>0?i+1|0:i,g=(S=we(h,A,39)^v)+r|0,r=(b^E)+i|0,r=g>>>0<S>>>0?r+1|0:r,S=g,g=r,a[t+24>>2]=S,a[t+28>>2]=r,r=we(w,d,14),i=b,v=we(w,d,18)^r,E=b^i,i=m+(y^(y^C)&d)|0,i=(r=o+(u^(u^p)&w)|0)>>>0<o>>>0?i+1|0:i,o=we(w,d,41)^v,i=(b^E)+i|0,i=(r=o+r|0)>>>0<o>>>0?i+1|0:i,r=(v=a[(m=G=(o=104|x)+n|0)>>2])+r|0,i=a[m+4>>2]+i|0,i=r>>>0<v>>>0?i+1|0:i,r=(m=a[(o=o+34144|0)>>2])+r|0,i=a[o+4>>2]+i|0,i=r>>>0<m>>>0?i+1|0:i,m=r,o=r+I|0,r=i,i=i+c|0,v=o,o=i=o>>>0<m>>>0?i+1|0:i,a[t+48>>2]=v,a[t+52>>2]=i,i=we(S,g,28),c=b,E=we(S,g,34)^i,I=b^c,c=(i=m)+(m=(s|h)&S|s&h)|0,i=((f|A)&g|f&A)+r|0,i=c>>>0<m>>>0?i+1|0:i,m=we(S,g,39)^E,r=(b^I)+i|0,r=(c=m+c|0)>>>0<m>>>0?r+1|0:r,m=c,c=r,a[t+16>>2]=m,a[t+20>>2]=r,r=we(v,o,14),i=b,E=we(v,o,18)^r,I=b^i,i=y+(C^(d^C)&o)|0,i=(r=u+(p^(p^w)&v)|0)>>>0<u>>>0?i+1|0:i,u=we(v,o,41)^E,i=(b^I)+i|0,i=(r=u+r|0)>>>0<u>>>0?i+1|0:i,u=(u=r)+(I=a[(r=E=(y=112|x)+n|0)>>2])|0,r=a[r+4>>2]+i|0,r=u>>>0<I>>>0?r+1|0:r,u=(y=a[(i=y+34144|0)>>2])+u|0,i=a[i+4>>2]+r|0,i=u>>>0<y>>>0?i+1|0:i,y=u,r=i,i=f+i|0,f=u=s+u|0,s=i=s>>>0>u>>>0?i+1|0:i,a[t+40>>2]=u,a[t+44>>2]=i,i=we(m,c,28),u=b,I=we(m,c,34)^i,u^=b,r=((g|A)&c|g&A)+r|0,r=(i=(i=y)+(y=(h|S)&m|h&S)|0)>>>0<y>>>0?r+1|0:r,y=we(m,c,39)^I,r=(b^u)+r|0,r=(i=y+i|0)>>>0<y>>>0?r+1|0:r,y=i,u=r,a[t+8>>2]=i,a[t+12>>2]=r,r=we(f,s,14),i=b,I=we(f,s,18)^r,M=b^i,i=C+(d^(o^d)&s)|0,i=(r=p+(w^(w^v)&f)|0)>>>0<p>>>0?i+1|0:i,s=(d=we(f,s,41)^I)+r|0,r=(b^M)+i|0,r=s>>>0<d>>>0?r+1|0:r,s=(p=a[(i=d=(o=120|x)+n|0)>>2])+s|0,i=a[i+4>>2]+r|0,i=s>>>0<p>>>0?i+1|0:i,r=(r=s)+(o=a[(s=o+34144|0)>>2])|0,i=a[s+4>>2]+i|0,i=r>>>0<o>>>0?i+1|0:i,o=r,s=h+r|0,r=i+A|0,a[t+32>>2]=s,a[t+36>>2]=s>>>0<h>>>0?r+1|0:r,r=we(y,u,28),s=b,h=we(y,u,34)^r,s^=b,i=((c|g)&u|c&g)+i|0,g=(r=(r=o)+(o=(m|S)&y|m&S)|0)+(c=we(y,u,39)^h)|0,r=(b^s)+(r>>>0<o>>>0?i+1|0:i)|0,a[t>>2]=g,a[t+4>>2]=c>>>0>g>>>0?r+1|0:r,64==(0|V)){for(;n=(r=Y<<3)+e|0,r=(_=a[(i=t+r|0)>>2])+a[n>>2]|0,i=a[n+4>>2]+a[i+4>>2]|0,a[n>>2]=r,a[n+4>>2]=r>>>0<_>>>0?i+1|0:i,8!=(0|(Y=Y+1|0)););break}h=((V=V+16|0)<<3)+n|0,f=r=a[E+4>>2],i=r>>>6|0,r=((63&r)<<26|(M=a[E>>2])>>>6)^we(M,r,19),i^=b,r=(r=we(M,f,61)^r)+(g=L=a[P>>2])|0,i=(v=a[P+4>>2])+(b^i)|0,i=r>>>0<g>>>0?i+1|0:i,r=(g=a[_>>2])+r|0,i=a[_+4>>2]+i|0,o=r,r=r>>>0<g>>>0?i+1|0:i,i=(c=g=a[D+4>>2])>>>7|0,g=((127&c)<<25|(s=a[D>>2])>>>7)^we(s,c,1),i^=b,u=o,o=we(s,c,8)^g,i=(b^i)+r|0,P=g=u+o|0,g=i=o>>>0>g>>>0?i+1|0:i,a[h>>2]=P,a[h+4>>2]=i,r=(r=s)+(s=Q=a[N>>2])|0,i=(E=a[N+4>>2])+c|0,i=r>>>0<s>>>0?i+1|0:i,s=r,r=i,A=c=a[d+4>>2],i=c>>>6|0,c=((63&c)<<26|(N=a[d>>2])>>>6)^we(N,c,19),h=b^i,c=we(N,A,61)^c,r=(b^h)+r|0,d=i=c+s|0,i=i>>>0<c>>>0?r+1|0:r,r=(s=c=a[j+4>>2])>>>7|0,c=((127&s)<<25|(h=a[j>>2])>>>7)^we(h,s,1),o=b^r,c=we(h,s,8)^c,i=(b^o)+i|0,w=r=c+d|0,c=i=r>>>0<c>>>0?i+1|0:i,a[_+136>>2]=r,a[_+140>>2]=i,r=(I=a[F+4>>2])+s|0,s=i=(i=h)+(h=U=a[F>>2])|0,i=i>>>0<h>>>0?r+1|0:r,r=we(P,g,19),h=b,d=we(P,g,61)^((63&g)<<26|P>>>6)^r,i=(b^g>>>6^h)+i|0,o=s=d+s|0,r=s>>>0<d>>>0?i+1|0:i,h=s=a[T+4>>2],i=s>>>7|0,s=((127&s)<<25|(d=a[T>>2])>>>7)^we(d,s,1),i^=b,u=o,o=we(d,h,8)^s,i=(b^i)+r|0,y=s=u+o|0,s=i=s>>>0<o>>>0?i+1|0:i,a[_+144>>2]=y,a[_+148>>2]=i,r=(D=a[H+4>>2])+h|0,h=i=(i=d)+(d=F=a[H>>2])|0,i=i>>>0<d>>>0?r+1|0:r,r=we(w,c,19),d=b,o=we(w,c,61)^((63&c)<<26|w>>>6)^r,i=(b^c>>>6^d)+i|0,r=o>>>0>(u=h=o+h|0)>>>0?i+1|0:i,i=(d=h=a[B+4>>2])>>>7|0,h=((127&d)<<25|(o=a[B>>2])>>>7)^we(o,d,1),i^=b,m=u,u=we(o,d,8)^h,i=(b^i)+r|0,C=h=m+u|0,h=i=h>>>0<u>>>0?i+1|0:i,a[_+152>>2]=C,a[_+156>>2]=i,r=(T=a[G+4>>2])+d|0,d=i=(i=o)+(o=j=a[G>>2])|0,i=i>>>0<o>>>0?r+1|0:r,r=we(y,s,19),o=b,u=we(y,s,61)^((63&s)<<26|y>>>6)^r,r=(b^s>>>6^o)+i|0,p=d=u+d|0,i=d>>>0<u>>>0?r+1|0:r,u=d=a[k+4>>2],r=d>>>7|0,d=((127&d)<<25|(o=a[k>>2])>>>7)^we(o,d,1),S=b^r,d=we(o,u,8)^d,i=(b^S)+i|0,S=r=d+p|0,d=i=r>>>0<d>>>0?i+1|0:i,a[_+160>>2]=r,a[_+164>>2]=i,r=u+f|0,r=(i=o+M|0)>>>0<o>>>0?r+1|0:r,o=i,i=r,r=we(C,h,19),u=b,p=we(C,h,61)^((63&h)<<26|C>>>6)^r,i=(b^h>>>6^u)+i|0,i=(o=p+o|0)>>>0<p>>>0?i+1|0:i,p=o,o=i,i=(u=a[O+4>>2])>>>7|0,m=((127&u)<<25|(r=a[O>>2])>>>7)^we(r,u,1),i^=b,m=we(r,u,8)^m,i=(b^i)+o|0,i=(p=m+p|0)>>>0<m>>>0?i+1|0:i,m=p,o=i,a[_+168>>2]=p,a[_+172>>2]=i,i=r,r=u+A|0,i=i>>>0>(u=p=i+N|0)>>>0?r+1|0:r,r=we(S,d,19),p=b,x=we(S,d,61)^((63&d)<<26|S>>>6)^r,i=(b^d>>>6^p)+i|0,B=u=x+u|0,r=u>>>0<x>>>0?i+1|0:i,x=u=a[R+4>>2],i=u>>>7|0,u=((127&u)<<25|(p=a[R>>2])>>>7)^we(p,u,1),k=b^i,u=we(p,x,8)^u,r=(b^k)+r|0,B=i=u+B|0,u=r=i>>>0<u>>>0?r+1|0:r,a[_+176>>2]=i,a[_+180>>2]=r,r=g+x|0,r=(i=p+P|0)>>>0<p>>>0?r+1|0:r,p=i,i=r,r=we(m,o,19),x=b,k=we(m,o,61)^((63&o)<<26|m>>>6)^r,i=(b^o>>>6^x)+i|0,O=p=k+p|0,p=p>>>0<k>>>0?i+1|0:i,k=x=a[K+4>>2],i=x>>>7|0,x=((127&x)<<25|(r=a[K>>2])>>>7)^we(r,x,1),i^=b,R=O,O=we(r,k,8)^x,i=(b^i)+p|0,p=i=(x=R+O|0)>>>0<O>>>0?i+1|0:i,a[_+184>>2]=x,a[_+188>>2]=i,i=r,r=c+k|0,i=i>>>0>(c=w=i+w|0)>>>0?r+1|0:r,r=we(B,u,19),w=b,k=we(B,u,61)^((63&u)<<26|B>>>6)^r,r=(b^u>>>6^w)+i|0,i=r=(c=k+c|0)>>>0<k>>>0?r+1|0:r,r=we(L,v,1),w=b,k=we(L,v,8)^((127&v)<<25|L>>>7)^r,i=(b^v>>>7^w)+i|0,w=c=k+c|0,c=i=c>>>0<k>>>0?i+1|0:i,a[_+192>>2]=w,a[_+196>>2]=i,r=s+v|0,s=i=y+L|0,i=r=i>>>0<y>>>0?r+1|0:r,r=we(x,p,19),y=b,v=we(x,p,61)^((63&p)<<26|x>>>6)^r,r=(b^p>>>6^y)+i|0,i=r=(s=v+s|0)>>>0<v>>>0?r+1|0:r,r=we(Q,E,1),y=b,v=we(Q,E,8)^((127&E)<<25|Q>>>7)^r,i=(b^E>>>7^y)+i|0,y=s=v+s|0,s=i=s>>>0<v>>>0?i+1|0:i,a[_+200>>2]=y,a[_+204>>2]=i,r=h+E|0,h=i=C+Q|0,i=r=i>>>0<C>>>0?r+1|0:r,r=we(w,c,19),C=b,v=we(w,c,61)^((63&c)<<26|w>>>6)^r,r=(b^c>>>6^C)+i|0,i=r=(h=v+h|0)>>>0<v>>>0?r+1|0:r,r=we(U,I,1),C=b,v=we(U,I,8)^((127&I)<<25|U>>>7)^r,i=(b^I>>>7^C)+i|0,C=h=v+h|0,h=i=h>>>0<v>>>0?i+1|0:i,a[_+208>>2]=C,a[_+212>>2]=i,r=d+I|0,d=i=S+U|0,i=r=i>>>0<S>>>0?r+1|0:r,r=we(y,s,19),S=b,v=d,d=r,r=s>>>6|0,d=we(y,s,61)^d^((63&s)<<26|y>>>6),r=(b^r^S)+i|0,i=r=(s=v+d|0)>>>0<d>>>0?r+1|0:r,r=we(F,D,1),d=b,y=we(F,D,8)^((127&D)<<25|F>>>7)^r,i=(b^D>>>7^d)+i|0,d=s=y+s|0,s=i=s>>>0<y>>>0?i+1|0:i,a[_+216>>2]=d,a[_+220>>2]=i,r=o+D|0,o=i=m+F|0,i=r=i>>>0<m>>>0?r+1|0:r,r=we(C,h,19),y=b,m=o,o=r,r=h>>>6|0,o=we(C,h,61)^o^((63&h)<<26|C>>>6),r=(b^r^y)+i|0,i=r=o>>>0>(h=m+o|0)>>>0?r+1|0:r,r=we(j,T,1),o=b,y=we(j,T,8)^((127&T)<<25|j>>>7)^r,i=(b^T>>>7^o)+i|0,h=i=(o=h=y+h|0)>>>0<y>>>0?i+1|0:i,a[_+224>>2]=o,a[_+228>>2]=i,r=u+T|0,u=i=B+j|0,i=r=i>>>0<j>>>0?r+1|0:r,r=we(d,s,19),y=b,m=r,r=s>>>6|0,d=we(d,s,61)^m^((63&s)<<26|d>>>6),r=(b^r^y)+i|0,i=r=(s=d+u|0)>>>0<d>>>0?r+1|0:r,r=we(M,f,1),d=b,u=we(M,f,8)^((127&f)<<25|M>>>7)^r,i=(b^f>>>7^d)+i|0,d=s=u+s|0,s=i=s>>>0<u>>>0?i+1|0:i,a[_+232>>2]=d,a[_+236>>2]=i,r=p+f|0,u=i=x+M|0,i=r=i>>>0<x>>>0?r+1|0:r,r=we(o,h,19),p=b,f=r,r=h>>>6|0,o=we(o,h,61)^f^((63&h)<<26|o>>>6),r=(b^r^p)+i|0,r=o>>>0>(h=o+u|0)>>>0?r+1|0:r,o=h,i=r,r=we(N,A,1),u=b,o=(p=we(N,A,8)^((127&A)<<25|N>>>7)^r)+o|0,i=(b^A>>>7^u)+i|0,a[(h=_)+240>>2]=o,a[h+244>>2]=o>>>0<p>>>0?i+1|0:i,r=c+A|0,c=i=w+N|0,i=r=i>>>0<w>>>0?r+1|0:r,r=we(d,s,19),h=b,o=r,r=s>>>6|0,s=we(d,s,61)^o^((63&s)<<26|d>>>6),r=(b^r^h)+i|0,i=r=s>>>0>(c=s+c|0)>>>0?r+1|0:r,r=we(P,g,1),s=b,h=r,r=g>>>7|0,g=(o=c)+(c=we(P,g,8)^h^((127&g)<<25|P>>>7))|0,i=(b^r^s)+i|0,a[_+248>>2]=g,a[_+252>>2]=c>>>0>g>>>0?i+1|0:i}}function E(e){var t,n,r,i,s,a,c,u,d,h,p,f,g,m,y,v,A,w=0,S=0,C=0,E=0,I=0,_=0,x=0,P=0,k=0,B=0,O=0,N=0,D=0,j=0,T=0,M=0,F=0,R=0,L=0,Q=0,U=0,V=0,K=0,H=0,G=0,Y=0,z=0,Z=0,W=0,q=0,J=0,X=0,$=0,ee=0,te=0,ne=0,re=0,ie=0,oe=0,se=0;f=St(e),ne=l[e+2|0]|l[e+3|0]<<8|l[e+4|0]<<16|l[e+5|0]<<24,g=St(e+5|0),Z=b,re=l[e+7|0]|l[e+8|0]<<8|l[e+9|0]<<16|l[e+10|0]<<24,X=l[e+10|0]|l[e+11|0]<<8|l[e+12|0]<<16|l[e+13|0]<<24,m=St(e+13|0),J=b,V=l[e+15|0]|l[e+16|0]<<8|l[e+17|0]<<16|l[e+18|0]<<24,W=St(e+18|0),j=b,P=St(e+21|0),_=l[e+23|0]|l[e+24|0]<<8|l[e+25|0]<<16|l[e+26|0]<<24,C=St(e+26|0),w=b,K=l[e+28|0]|l[e+29|0]<<8|l[e+30|0]<<16|l[e+31|0]<<24,$=l[e+31|0]|l[e+32|0]<<8|l[e+33|0]<<16|l[e+34|0]<<24,y=St(e+34|0),z=b,H=l[e+36|0]|l[e+37|0]<<8|l[e+38|0]<<16|l[e+39|0]<<24,q=St(e+39|0),M=b,x=St(e+42|0),E=l[e+44|0]|l[e+45|0]<<8|l[e+46|0]<<16|l[e+47|0]<<24,I=St(e+47|0),C=2097151&((3&w)<<30|C>>>2),w=ze(t=2097151&((3&(S=b))<<30|I>>>2),0,136657,0)+C|0,S=b,S=w>>>0<C>>>0?S+1|0:S,C=(I=ze(n=(l[e+49|0]|l[e+50|0]<<8|l[e+51|0]<<16|l[e+52|0]<<24)>>>7&2097151,0,-997805,-1))+w|0,w=b+S|0,w=C>>>0<I>>>0?w+1|0:w,S=(I=ze(r=(l[e+52|0]|l[e+53|0]<<8|l[e+54|0]<<16|l[e+55|0]<<24)>>>4&2097151,0,654183,0))+C|0,C=b+w|0,C=S>>>0<I>>>0?C+1|0:C,N=S,S=St(e+55|0),I=ze(i=2097151&((1&(w=b))<<31|S>>>1),0,470296,0),w=b+C|0,w=(S=N+I|0)>>>0<I>>>0?w+1|0:w,C=(I=ze(s=(l[e+57|0]|l[e+58|0]<<8|l[e+59|0]<<16|l[e+60|0]<<24)>>>6&2097151,0,666643,0))+S|0,S=b+w|0,S=C>>>0<I>>>0?S+1|0:S,I=C,k=S,C=S,O=E>>>5&2097151,E=2097151&x,S=ze(a=(l[e+60|0]|l[e+61|0]<<8|l[e+62|0]<<16|l[e+63|0]<<24)>>>3|0,0,-683901,-1)+E|0,w=b,w=S>>>0<E>>>0?w+1|0:w,E=S,L=w,G=S=w-((S>>>0<4293918720)-1|0)|0,w=O,O=(2097151&S)<<11|(N=E- -1048576|0)>>>21,S>>=21,u=x=w+O|0,B=S=x>>>0<O>>>0?S+1|0:S,x=ze(x,S,-683901,-1),S=b+C|0,Q=w=x+I|0,O=w>>>0<x>>>0?S+1|0:S,S=ze(t,U,-997805,-1),w=b,w=(S=(C=_>>>5&2097151)+S|0)>>>0<C>>>0?w+1|0:w,_=ze(n,0,654183,0),C=b+w|0,C=(S=_+S|0)>>>0<_>>>0?C+1|0:C,w=(_=ze(r,0,470296,0))+S|0,S=b+C|0,S=w>>>0<_>>>0?S+1|0:S,C=(_=ze(i,T,666643,0))+w|0,w=b+S|0,x=C,C=C>>>0<_>>>0?w+1|0:w,_=2097151&P,w=ze(t,U,654183,0)+_|0,S=b,S=w>>>0<_>>>0?S+1|0:S,_=(P=ze(n,0,470296,0))+w|0,w=b+S|0,w=_>>>0<P>>>0?w+1|0:w,P=ze(r,0,666643,0),S=b+w|0,P=S=(_=P+_|0)>>>0<P>>>0?S+1|0:S,Y=S=S-((_>>>0<4293918720)-1|0)|0,C=(w=S>>>21|0)+C|0,C=(S=(F=x)+(x=(2097151&S)<<11|(D=_- -1048576|0)>>>21)|0)>>>0<x>>>0?C+1|0:C,x=S,F=C,R=S=C-((S>>>0<4293918720)-1|0)|0,k=k-((I>>>0<4293918720)-1|0)|0,h=I- -1048576|0,w=Q,Q=(2097151&S)<<11|(C=x- -1048576|0)>>>21,S=(S>>21)+O|0,S=((w=I=w+Q|0)>>>0<Q>>>0?S+1|0:S)-(((I=-2097152&h)>>>0>w>>>0)+k|0)|0,ie=(w=w-I|0)-(I=-2097152&(p=w- -1048576|0))|0,oe=S-((O=S-((w>>>0<4293918720)-1|0)|0)+(w>>>0<I>>>0)|0)|0,S=ze(u,B,136657,0)+x|0,w=F+b|0,Q=S-(C&=-2097152)|0,R=(w=S>>>0<x>>>0?w+1|0:w)-((S>>>0<C>>>0)+R|0)|0,N=E-(w=-2097152&N)|0,ee=L-((w>>>0>E>>>0)+G|0)|0,C=2097151&((7&(w=M))<<29|q>>>3),w=ze(a,0,136657,0)+C|0,S=b,S=w>>>0<C>>>0?S+1|0:S,C=(I=ze(s,0,-683901,-1))+w|0,w=b+S|0,x=C,E=C>>>0<I>>>0?w+1|0:w,w=ze(i,T,-683901,-1),S=b,S=(w=(C=H>>>6&2097151)+w|0)>>>0<C>>>0?S+1|0:S,I=ze(a,0,-997805,-1),C=b+S|0,C=(w=I+w|0)>>>0<I>>>0?C+1|0:C,S=(I=ze(s,0,136657,0))+w|0,w=b+C|0,w=S>>>0<I>>>0?w+1|0:w,I=S,L=w,G=w=w-((S>>>0<4293918720)-1|0)|0,H=S- -1048576|0,S=(C=w>>21)+E|0,E=w=(M=x)+(x=(2097151&w)<<11|H>>>21)|0,M=S=w>>>0<x>>>0?S+1|0:S,F=w=S-((w>>>0<4293918720)-1|0)|0,S=N,N=(2097151&w)<<11|(x=E- -1048576|0)>>>21,w=(w>>21)+ee|0,d=S=S+N|0,N=w=S>>>0<N>>>0?w+1|0:w,C=ze(S,w,-683901,-1),w=b+R|0,se=S=C+Q|0,R=S>>>0<C>>>0?w+1|0:w,q=_,Q=P,C=2097151&((7&(w=j))<<29|W>>>3),w=ze(t,U,470296,0)+C|0,S=b,S=w>>>0<C>>>0?S+1|0:S,C=ze(n,0,666643,0),S=b+S|0,P=w=C+w|0,C=w>>>0<C>>>0?S+1|0:S,S=ze(t,U,666643,0),w=b,w=(S=(_=V>>>6&2097151)+S|0)>>>0<_>>>0?w+1|0:w,_=S,W=w,ee=w=w-((S>>>0<4293918720)-1|0)|0,S=(S=w>>>21|0)+C|0,C=w=(j=P)+(P=(2097151&w)<<11|(V=_- -1048576|0)>>>21)|0,te=S=w>>>0<P>>>0?S+1|0:S,v=w=S-((w>>>0<4293918720)-1|0)|0,P=M-(((S=-2097152&x)>>>0>E>>>0)+F|0)|0,c=E-S|0,x=(2097151&w)<<11|(j=C- -1048576|0)>>>21,w=(w>>>21|0)+Q|0,w=(E=x+q|0)>>>0<x>>>0?w+1|0:w,E=((S=E)-(x=-2097152&D)|0)+(D=ze(u,B,-997805,-1))|0,S=b+(w-((8191&Y)+(S>>>0<x>>>0)|0)|0)|0,S=E>>>0<D>>>0?S+1|0:S,w=E,E=ze(d,N,136657,0),S=b+S|0,S=(w=w+E|0)>>>0<E>>>0?S+1|0:S,E=(x=ze(c,P,-683901,-1))+w|0,w=b+S|0,Y=w=E>>>0<x>>>0?w+1|0:w,F=S=w-((E>>>0<4293918720)-1|0)|0,M=(2097151&S)<<11|(D=E- -1048576|0)>>>21,S=(S>>21)+R|0,R=S=(x=M+se|0)>>>0<M>>>0?S+1|0:S,w=(w=(S=S-((x>>>0<4293918720)-1|0)|0)>>21)+oe|0,w=(Q=(2097151&S)<<11|(M=x- -1048576|0)>>>21)>>>0>(q=Q+ie|0)>>>0?w+1|0:w,Q=q,q=w,ie=x-(w=-2097152&M)|0,oe=R-((w>>>0>x>>>0)+S|0)|0,se=E-(w=-2097152&D)|0,A=Y-((w>>>0>E>>>0)+F|0)|0,w=(E=ze(u,B,654183,0))+(C-(S=-2097152&j)|0)|0,C=b+(te-((8191&v)+(S>>>0>C>>>0)|0)|0)|0,C=w>>>0<E>>>0?C+1|0:C,S=(E=ze(d,N,-997805,-1))+w|0,w=b+C|0,w=S>>>0<E>>>0?w+1|0:w,C=(E=ze(c,P,136657,0))+S|0,S=b+w|0,Y=C,j=C>>>0<E>>>0?S+1|0:S,x=I-(w=-2097152&H)|0,G=L-((w>>>0>I>>>0)+G|0)|0,I=2097151&((1&(w=z))<<31|y>>>1),S=ze(r,0,-683901,-1)+I|0,w=b,w=S>>>0<I>>>0?w+1|0:w,C=ze(i,T,136657,0),w=b+w|0,w=(S=C+S|0)>>>0<C>>>0?w+1|0:w,C=(I=ze(a,0,654183,0))+S|0,S=b+w|0,S=C>>>0<I>>>0?S+1|0:S,w=C,C=ze(s,0,-997805,-1),S=b+S|0,D=w=w+C|0,E=w>>>0<C>>>0?S+1|0:S,w=ze(n,0,-683901,-1),C=b,C=(w=(S=$>>>4&2097151)+w|0)>>>0<S>>>0?C+1|0:C,S=(I=ze(r,0,136657,0))+w|0,w=b+C|0,w=S>>>0<I>>>0?w+1|0:w,C=(I=ze(i,T,-997805,-1))+S|0,S=b+w|0,S=C>>>0<I>>>0?S+1|0:S,I=ze(a,0,470296,0),w=b+S|0,w=(C=I+C|0)>>>0<I>>>0?w+1|0:w,I=ze(s,0,654183,0),S=b+w|0,S=(C=I+C|0)>>>0<I>>>0?S+1|0:S,I=C,M=S,$=S=S-((C>>>0<4293918720)-1|0)|0,w=(w=S>>21)+E|0,E=S=(C=(2097151&S)<<11|(H=C- -1048576|0)>>>21)+D|0,z=w=S>>>0<C>>>0?w+1|0:w,L=S=w-((S>>>0<4293918720)-1|0)|0,w=x,x=(2097151&S)<<11|(D=E- -1048576|0)>>>21,S=(S>>21)+G|0,F=C=w+x|0,x=S=C>>>0<x>>>0?S+1|0:S,S=ze(C,S,-683901,-1),C=b+j|0,G=w=S+Y|0,j=w>>>0<S>>>0?C+1|0:C,D=z-(((w=-2097152&D)>>>0>E>>>0)+L|0)|0,R=E-w|0,w=(C=ze(u,B,470296,0))+(_-(S=-2097152&V)|0)|0,S=b+(W-((2047&ee)+(S>>>0>_>>>0)|0)|0)|0,S=w>>>0<C>>>0?S+1|0:S,C=ze(d,N,654183,0),S=b+S|0,S=(w=C+w|0)>>>0<C>>>0?S+1|0:S,E=ze(c,P,-997805,-1),C=b+S|0,C=(w=E+w|0)>>>0<E>>>0?C+1|0:C,S=(E=ze(F,x,136657,0))+w|0,w=b+C|0,w=S>>>0<E>>>0?w+1|0:w,C=(E=ze(R,D,-683901,-1))+S|0,S=b+w|0,z=S=C>>>0<E>>>0?S+1|0:S,L=S=S-((C>>>0<4293918720)-1|0)|0,w=(w=S>>21)+j|0,w=(S=(E=(2097151&S)<<11|(_=C- -1048576|0)>>>21)+G|0)>>>0<E>>>0?w+1|0:w,E=S,j=w,G=S=w-((S>>>0<4293918720)-1|0)|0,W=(2097151&S)<<11|(V=E- -1048576|0)>>>21,S=(S>>21)+A|0,S=(Y=W+se|0)>>>0<W>>>0?S+1|0:S,W=Y,Y=S,ee=E-(w=-2097152&V)|0,G=j-((w>>>0>E>>>0)+G|0)|0,te=C-(w=-2097152&_)|0,z=z-((w>>>0>C>>>0)+L|0)|0,E=2097151&((1&(w=J))<<31|m>>>1),S=ze(u,B,666643,0)+E|0,w=b,w=S>>>0<E>>>0?w+1|0:w,C=(E=ze(d,N,470296,0))+S|0,S=b+w|0,S=C>>>0<E>>>0?S+1|0:S,E=ze(c,P,654183,0),w=b+S|0,w=(C=E+C|0)>>>0<E>>>0?w+1|0:w,S=(E=ze(F,x,-997805,-1))+C|0,C=b+w|0,C=S>>>0<E>>>0?C+1|0:C,w=(E=ze(R,D,136657,0))+S|0,S=b+C|0,_=w,E=w>>>0<E>>>0?S+1|0:S,B=I-(w=-2097152&H)|0,j=M-((w>>>0>I>>>0)+$|0)|0,w=ze(t,U,-683901,-1),S=b,S=(w=(C=K>>>7&2097151)+w|0)>>>0<C>>>0?S+1|0:S,I=ze(n,0,136657,0),C=b+S|0,C=(w=I+w|0)>>>0<I>>>0?C+1|0:C,S=(I=ze(r,0,-997805,-1))+w|0,w=b+C|0,w=S>>>0<I>>>0?w+1|0:w,C=(I=ze(i,T,654183,0))+S|0,S=b+w|0,S=C>>>0<I>>>0?S+1|0:S,I=ze(a,0,666643,0),w=b+S|0,w=(C=I+C|0)>>>0<I>>>0?w+1|0:w,I=ze(s,0,470296,0),S=b+w|0,w=S=(C=I+C|0)>>>0<I>>>0?S+1|0:S,S=k>>21,I=(k=(2097151&k)<<11|h>>>21)+C|0,C=w+S|0,H=C=I>>>0<k>>>0?C+1|0:C,V=w=C-((I>>>0<4293918720)-1|0)|0,k=(2097151&w)<<11|(U=I- -1048576|0)>>>21,w=(w>>21)+j|0,J=C=k+B|0,k=w=C>>>0<k>>>0?w+1|0:w,C=ze(C,w,-683901,-1),S=b+E|0,_=w=C+_|0,E=w>>>0<C>>>0?S+1|0:S,w=ze(d,N,666643,0),C=b,C=(w=(S=X>>>4&2097151)+w|0)>>>0<S>>>0?C+1|0:C,S=(T=ze(c,P,470296,0))+w|0,w=b+C|0,w=S>>>0<T>>>0?w+1|0:w,C=(T=ze(F,x,654183,0))+S|0,S=b+w|0,S=C>>>0<T>>>0?S+1|0:S,w=C,C=ze(R,D,-997805,-1),S=b+S|0,S=(w=w+C|0)>>>0<C>>>0?S+1|0:S,C=(T=ze(J,k,136657,0))+w|0,w=b+S|0,N=w=C>>>0<T>>>0?w+1|0:w,j=w=w-((C>>>0<4293918720)-1|0)|0,B=(2097151&w)<<11|(T=C- -1048576|0)>>>21,w=(w>>21)+E|0,_=w=(E=_=B+_|0)>>>0<B>>>0?w+1|0:w,M=w=w-((E>>>0<4293918720)-1|0)|0,K=(2097151&w)<<11|(B=E- -1048576|0)>>>21,w=(w>>21)+z|0,$=X=K+te|0,X=K>>>0>X>>>0?w+1|0:w,S=I-(w=-2097152&U)|0,I=H-((w>>>0>I>>>0)+V|0)|0,w=(w=O>>21)+I|0,I=S=(O=(2097151&O)<<11|p>>>21)+S|0,H=w=S>>>0<O>>>0?w+1|0:w,V=S=w-((S>>>0<4293918720)-1|0)|0,O=w=S>>21,L=E,E=ze(K=(2097151&S)<<11|(U=I- -1048576|0)>>>21,w,-683901,-1),S=b+_|0,S=(w=L+E|0)>>>0<E>>>0?S+1|0:S,z=w-(E=-2097152&B)|0,M=S-((w>>>0<E>>>0)+M|0)|0,S=ze(K,O,136657,0)+C|0,w=N+b|0,w=S>>>0<C>>>0?w+1|0:w,L=S-(C=-2097152&T)|0,te=w-((S>>>0<C>>>0)+j|0)|0,w=ze(c,P,666643,0),S=b,S=(w=(C=re>>>7&2097151)+w|0)>>>0<C>>>0?S+1|0:S,E=ze(F,x,470296,0),C=b+S|0,C=(w=E+w|0)>>>0<E>>>0?C+1|0:C,S=(E=ze(R,D,654183,0))+w|0,w=b+C|0,w=S>>>0<E>>>0?w+1|0:w,C=ze(J,k,-997805,-1),w=b+w|0,B=S=C+S|0,C=S>>>0<C>>>0?w+1|0:w,E=2097151&((3&(w=Z))<<30|g>>>2),w=ze(F,x,666643,0)+E|0,S=b,S=w>>>0<E>>>0?S+1|0:S,E=ze(R,D,470296,0),S=b+S|0,S=(w=E+w|0)>>>0<E>>>0?S+1|0:S,E=(_=ze(J,k,654183,0))+w|0,w=b+S|0,P=w=E>>>0<_>>>0?w+1|0:w,T=w=w-((E>>>0<4293918720)-1|0)|0,S=B,B=(2097151&w)<<11|(_=E- -1048576|0)>>>21,w=(w>>21)+C|0,B=w=(C=x=S+B|0)>>>0<B>>>0?w+1|0:w,N=w=w-((C>>>0<4293918720)-1|0)|0,Z=(2097151&w)<<11|(x=C- -1048576|0)>>>21,w=(w>>21)+te|0,w=(j=Z+L|0)>>>0<Z>>>0?w+1|0:w,Z=j,j=w,w=(S=ze(K,O,-997805,-1))+C|0,C=b+B|0,C=w>>>0<S>>>0?C+1|0:C,re=w-(S=-2097152&x)|0,L=C-((w>>>0<S>>>0)+N|0)|0,w=ze(K,O,654183,0)+E|0,S=P+b|0,N=w-(C=-2097152&_)|0,F=(S=w>>>0<E>>>0?S+1|0:S)-((w>>>0<C>>>0)+T|0)|0,w=ze(R,D,666643,0),C=b,C=(w=(S=ne>>>5&2097151)+w|0)>>>0<S>>>0?C+1|0:C,S=(E=ze(J,k,470296,0))+w|0,w=b+C|0,_=S,C=S>>>0<E>>>0?w+1|0:w,E=2097151&f,S=ze(J,k,666643,0)+E|0,w=b,w=S>>>0<E>>>0?w+1|0:w,E=S,P=w,k=w=w-((S>>>0<4293918720)-1|0)|0,C=(S=w>>21)+C|0,C=(w=(B=_)+(_=(2097151&w)<<11|(x=E- -1048576|0)>>>21)|0)>>>0<_>>>0?C+1|0:C,_=w,T=C,B=w=C-((w>>>0<4293918720)-1|0)|0,D=(2097151&w)<<11|(C=_- -1048576|0)>>>21,w=(w>>21)+F|0,w=(N=D+N|0)>>>0<D>>>0?w+1|0:w,D=N,N=w,w=ze(K,O,470296,0)+_|0,S=T+b|0,S=w>>>0<_>>>0?S+1|0:S,_=w-(C&=-2097152)|0,C=S-((w>>>0<C>>>0)+B|0)|0,B=_,S=(_=ze(K,O,666643,0))+(E-(w=-2097152&x)|0)|0,w=b+(P-((w>>>0>E>>>0)+k|0)|0)|0,w=S>>>0<_>>>0?w+1|0:w,_=S,E=S,S=(S=w>>21)+C|0,x=w=B+(E=(2097151&w)<<11|E>>>21)|0,E=(2097151&(S=w>>>0<E>>>0?S+1|0:S))<<11|(C=w)>>>21,C=(w=S>>21)+N|0,P=S=E+D|0,E=(2097151&(C=(w=S)>>>0<E>>>0?C+1|0:C))<<11|w>>>21,w=(S=C>>21)+L|0,T=C=E+re|0,E=(2097151&(w=(S=C)>>>0<E>>>0?w+1|0:w))<<11|S>>>21,S=(C=w>>21)+j|0,B=w=E+Z|0,C=w,w=(w=(S=w>>>0<E>>>0?S+1|0:S)>>21)+M|0,w=(S=(C=(2097151&S)<<11|C>>>21)+z|0)>>>0<C>>>0?w+1|0:w,N=S,C=S,S=(S=w>>21)+X|0,D=w=(C=(2097151&w)<<11|C>>>21)+$|0,E=(2097151&(S=w>>>0<C>>>0?S+1|0:S))<<11|(C=w)>>>21,C=(w=S>>21)+G|0,j=S=E+ee|0,E=(2097151&(C=(w=S)>>>0<E>>>0?C+1|0:C))<<11|w>>>21,w=(S=C>>21)+Y|0,M=C=E+W|0,E=(2097151&(w=(S=C)>>>0<E>>>0?w+1|0:w))<<11|S>>>21,S=(C=w>>21)+oe|0,ne=w=E+ie|0,C=w,w=(w=(S=w>>>0<E>>>0?S+1|0:S)>>21)+q|0,w=(S=(C=(2097151&S)<<11|C>>>21)+Q|0)>>>0<C>>>0?w+1|0:w,Z=S,C=S,S=w>>21,w=(2097151&w)<<11|C>>>21,E=I-(C=-2097152&U)|0,C=(H-((C>>>0>I>>>0)+V|0)|0)+S|0,U=w=w+E|0,O=(2097151&(C=w>>>0<E>>>0?C+1|0:C))<<11|w>>>21,E=w=C>>21,C=2097151&_,S=ze(O,w,666643,0)+C|0,w=b,_=S,I=w=S>>>0<C>>>0?w+1|0:w,o[0|e]=S,o[e+1|0]=(255&w)<<24|S>>>8,C=2097151&x,w=ze(O,E,470296,0)+C|0,S=b,C=(I>>21)+(S=w>>>0<C>>>0?S+1|0:S)|0,C=(x=(k=(2097151&I)<<11|_>>>21)+w|0)>>>0<k>>>0?C+1|0:C,o[e+4|0]=(2047&C)<<21|x>>>11,o[e+3|0]=(7&C)<<29|x>>>3,P&=2097151,S=ze(O,E,654183,0)+P|0,w=b,w=S>>>0<P>>>0?w+1|0:w,P=S,S=w,S=(w=C>>21)+S|0,S=(C=(k=P)+(P=(2097151&C)<<11|x>>>21)|0)>>>0<P>>>0?S+1|0:S,P=C,w=S,o[e+6|0]=(63&w)<<26|C>>>6,k=0,C=31&((65535&I)<<16|_>>>16),S=_=2097151&x,o[e+2|0]=C|S<<5,I=2097151&T,C=ze(O,E,-997805,-1)+I|0,S=b,S=C>>>0<I>>>0?S+1|0:S,I=C,C=S,C=(S=w>>21)+C|0,S=w=(x=I)+(I=(2097151&w)<<11|P>>>21)|0,C=w>>>0<I>>>0?C+1|0:C,o[e+9|0]=(511&C)<<23|w>>>9,o[e+8|0]=(1&C)<<31|w>>>1,I=0,x=(w=P&=2097151)<<2,w=k,o[e+5|0]=x|(524287&w)<<13|_>>>19,x=2097151&B,_=ze(O,E,136657,0)+x|0,w=b,w=_>>>0<x>>>0?w+1|0:w,x=_,_=w,k=(2097151&(w=C))<<11|S>>>21,w=(C=w>>21)+_|0,w=(C=x=k+x|0)>>>0<k>>>0?w+1|0:w,o[e+12|0]=(4095&w)<<20|C>>>12,o[e+11|0]=(15&w)<<28|C>>>4,_=0,B=(S=x=2097151&S)<<7,S=I,I=P,o[e+7|0]=B|(16383&S)<<18|I>>>14,I=(S=ze(O,E,-683901,-1))+(E=2097151&N)|0,S=b,S=E>>>0>I>>>0?S+1|0:S,E=I,I=S,P=(2097151&(S=w))<<11|C>>>21,S=(w>>=21)+I|0,S=(w=E=P+E|0)>>>0<P>>>0?S+1|0:S,o[e+14|0]=(127&S)<<25|w>>>7,E=(C=P=2097151&C)<<4,C=_,o[e+10|0]=E|(131071&C)<<15|x>>>17,_=(2097151&(C=S))<<11|w>>>21,C=(S>>=21)+(E=0)|0,C=(I=_+(2097151&D)|0)>>>0<_>>>0?C+1|0:C,o[e+17|0]=(1023&C)<<22|I>>>10,o[e+16|0]=(3&C)<<30|I>>>2,_=0,S=(w=k=2097151&w)<<1,w=E,o[e+13|0]=S|(1048575&w)<<12|P>>>20,w=S=C>>21,w=(C=(E=(2097151&C)<<11|I>>>21)+(2097151&j)|0)>>>0<E>>>0?w+1|0:w,E=C,o[e+20|0]=(8191&w)<<19|C>>>13,C=w,o[e+19|0]=(31&w)<<27|E>>>5,x=0,S=(w=O=2097151&I)<<6,w=_,o[e+15|0]=S|(32767&w)<<17|k>>>15,w=C>>21,P=I=(_=(2097151&C)<<11|E>>>21)+(2097151&M)|0,I=I>>>0<_>>>0?w+1|0:w,o[e+21|0]=P,S=(w=E)<<3,w=x,o[e+18|0]=S|(262143&w)<<14|O>>>18,S=P,o[e+22|0]=(255&I)<<24|S>>>8,C=I>>21,C=(S=(E=(2097151&I)<<11|S>>>21)+(2097151&ne)|0)>>>0<E>>>0?C+1|0:C,E=S,o[e+25|0]=(2047&C)<<21|S>>>11,o[e+24|0]=(7&C)<<29|S>>>3,w=S=C>>21,w=(C=(_=(2097151&C)<<11|E>>>21)+(2097151&Z)|0)>>>0<_>>>0?w+1|0:w,o[e+27|0]=(63&w)<<26|C>>>6,_=0,S=E&=2097151,o[e+23|0]=31&((65535&I)<<16|P>>>16)|S<<5,S=w>>21,S=(w=(x=(2097151&w)<<11|C>>>21)+(2097151&U)|0)>>>0<x>>>0?S+1|0:S,o[e+31|0]=(131071&S)<<15|w>>>17,o[e+30|0]=(511&S)<<23|w>>>9,o[e+29|0]=(1&S)<<31|w>>>1,I=0,S=(C=x=2097151&C)<<2,C=_,o[e+26|0]=S|(524287&C)<<13|E>>>19,S=e,e=I,o[S+28|0]=w<<7|(16383&e)<<18|x>>>14}function I(e,t,n,r,i,s,h,p,f,g,m,w){var S,C,E=0,I=0,x=0,P=0,k=0,N=0,j=0,T=0,M=0,F=0,L=0,Q=0,U=0,V=0,K=0,H=0,G=0,Y=0,z=0,Z=0,W=0,q=0,J=0,$=0,ee=0,te=0,ne=0,re=0,ie=0,oe=0,se=0,ae=0,ce=0,ue=0,de=0,he=0,pe=0,fe=0,ge=0,me=0,ye=0,ve=0,Ae=0,be=0,Se=0;if(y=S=y+-64|0,C=_(f)){if(a[S+32>>2]=0,a[S+36>>2]=0,a[S+24>>2]=0,a[S+28>>2]=0,a[S+20>>2]=h,a[S+16>>2]=s,a[S+12>>2]=i,a[S+8>>2]=r,a[S+4>>2]=f,a[S>>2]=C,a[S+56>>2]=0,a[S+52>>2]=n,a[S+48>>2]=n,a[S+44>>2]=t,a[S+40>>2]=e,e=0,y=k=y-48|0,!((t=le(S))||(t=-26,w-3>>>0<4294967294))){if(n=a[S+44>>2],t=a[S+48>>2],a[k>>2]=0,r=a[S+40>>2],a[k+28>>2]=t,a[k+12>>2]=-1,a[k+8>>2]=r,t=((r=n>>>0>(r=t<<3)>>>0?n:r)>>>0)/((n=t<<2)>>>0)|0,a[k+20>>2]=t,a[k+24>>2]=t<<2,a[k+16>>2]=u(t,n),t=a[S+52>>2],a[k+36>>2]=w,a[k+32>>2]=t,y=r=y-80|0,i=-25,!(!k|!S))if(t=_(a[k+20>>2]<<3),a[k+4>>2]=t,t){y=h=y-16|0,i=-22;e:if(!(!k|!(t=a[k+16>>2]))&&1024==(((s=t<<10)>>>0)/(t>>>0)|0)&&(t=_(12),a[k>>2]=t,t)){a[t>>2]=0,a[t+4>>2]=0,s>>>0>4294967168?t=48:(s>>>0>=4294967168?(a[8952]=48,n=0):(n=0,(t=_(76+(U=s>>>0<11?16:s+11&-8)|0))&&(n=t-8|0,63&t?(L=(-8&(j=a[(x=t-4|0)>>2]))-(N=(t=((t=(t+63&-64)-8|0)-n>>>0>15?0:64)+t|0)-n|0)|0,3&j?(a[t+4>>2]=L|1&a[t+4>>2]|2,a[4+(L=t+L|0)>>2]=1|a[L+4>>2],a[x>>2]=N|1&a[x>>2]|2,a[4+(L=n+N|0)>>2]=1|a[L+4>>2],D(n,N)):(n=a[n>>2],a[t+4>>2]=L,a[t>>2]=n+N)):t=n,3&(n=a[t+4>>2])&&((N=-8&n)>>>0<=U+16>>>0||(a[t+4>>2]=U|1&n|2,n=t+U|0,U=N-U|0,a[n+4>>2]=3|U,a[4+(N=t+N|0)>>2]=1|a[N+4>>2],D(n,U))),n=t+8|0)),(t=n)?(a[h+12>>2]=t,t=0):t=48),a[8952]=t;t:{if(t)a[h+12>>2]=0;else if(t=a[h+12>>2])break t;O(a[k>>2]),a[k>>2]=0;break e}a[a[k>>2]>>2]=t,a[a[k>>2]+4>>2]=t,a[a[k>>2]+8>>2]=s,i=0}if(y=h+16|0,i)Re(k,a[S+56>>2]);else{if(s=a[k+36>>2],h=t=y,y=t=t-448&-64,!r|!S||(Je(i=t- -64|0,0,0,64),Ot(n=t+60|0,a[S+48>>2]),on(i,n,4,0),Ot(n,a[S+4>>2]),on(i,n,4,0),Ot(n,a[S+44>>2]),on(i,n,4,0),Ot(n,a[S+40>>2]),on(i,n,4,0),Ot(n,19),on(i,n,4,0),Ot(n,s),on(i,n,4,0),Ot(n,a[S+12>>2]),on(i,n,4,0),(n=a[S+8>>2])&&(on(t- -64|0,n,a[S+12>>2],0),1&o[S+56|0]&&(bn(a[S+8>>2],a[S+12>>2]),a[S+12>>2]=0)),Ot(n=t+60|0,a[S+20>>2]),on(t- -64|0,n,4,0),(n=a[S+16>>2])&&on(t- -64|0,n,a[S+20>>2],0),Ot(n=t+60|0,a[S+28>>2]),on(t- -64|0,n,4,0),(n=a[S+24>>2])&&(on(t- -64|0,n,a[S+28>>2],0),2&l[S+56|0]&&(bn(a[S+24>>2],a[S+28>>2]),a[S+28>>2]=0)),Ot(n=t+60|0,a[S+36>>2]),on(t- -64|0,n,4,0),(n=a[S+32>>2])&&on(t- -64|0,n,a[S+36>>2],0),kt(t- -64|0,r,64)),y=h,bn(r- -64|0,8),i=0,y=t=y-1024|0,a[k+28>>2])for(s=r+68|0,n=r- -64|0;Ot(n,0),Ot(s,i),R(t,1024,r,72),Ke(a[a[k>>2]+4>>2]+(u(a[k+24>>2],i)<<10)|0,t),Ot(n,1),R(t,1024,r,72),Ke(1024+(a[a[k>>2]+4>>2]+(u(a[k+24>>2],i)<<10)|0)|0,t),(i=i+1|0)>>>0<c[k+28>>2];);bn(t,1024),y=t+1024|0,bn(r,72),i=0}}else i=-22;if(y=r+80|0,!(t=i)){if(a[k+8>>2])for(;;){if(r=e,ge=0,y=i=y-32|0,!(!k|!a[k+28>>2]))for(a[i+16>>2]=r,t=1;;){if(o[i+24|0]=ge,me=0,e=0,t)for(;;){a[i+28>>2]=0,e=a[i+28>>2],a[i+8>>2]=a[i+24>>2],a[i+12>>2]=e,a[i+20>>2]=me,e=a[i+20>>2],a[i>>2]=a[i+16>>2],a[i+4>>2]=e,e=0;e:if(k){t:{if(2==a[k+36>>2]){if(ye=a[k+4>>2],ve=1,(h=a[i>>2])|(s=l[i+8|0])>>>0>1)break t}else ye=a[k+4>>2];if(y=t=y-4096|0,An(t+3072|0),An(t+2048|0),!(!k|!i)&&(a[t+2048>>2]=a[i>>2],a[t+2052>>2]=0,a[t+2056>>2]=a[i+4>>2],a[t+2060>>2]=0,a[t+2064>>2]=l[i+8|0],a[t+2068>>2]=0,a[t+2072>>2]=a[k+16>>2],a[t+2076>>2]=0,a[t+2080>>2]=a[k+8>>2],a[t+2084>>2]=0,a[t+2088>>2]=a[k+36>>2],a[t+2092>>2]=0,a[k+20>>2]))for(;(n=127&e)||(h=s=a[t+2100>>2],x=s+1|0,h=(s=a[t+2096>>2]+1|0)?h:x,a[t+2096>>2]=s,a[t+2100>>2]=h,An(t),An(s=t+1024|0),B(h=t+3072|0,t+2048|0,t),B(h,t,s)),s=a[4+(n=(t+1024|0)+(n<<3)|0)>>2],a[(h=(e<<3)+ye|0)>>2]=a[n>>2],a[h+4>>2]=s,(e=e+1|0)>>>0<c[k+20>>2];);y=t+4096|0,s=l[i+8|0],h=a[i>>2],ve=0}if(e=255&s,!((h=h?0:!e<<1)>>>0>=(n=a[k+20>>2])>>>0))for(t=a[k+24>>2],e=(s=(u(t,a[i+4>>2])+h|0)+u(e,n)|0)+((s>>>0)%(t>>>0)|0?-1:t-1|0)|0;;){Ae=1==((s>>>0)%(t>>>0)|0)?s-1|0:e,U=a[k+28>>2],ve?(e=a[k>>2],N=a[e+4>>2]+(Ae<<10)|0):(e=a[k>>2],N=(h<<3)+ye|0),n=a[N>>2],N=a[N+4>>2],a[i+12>>2]=h,U=(N>>>0)%(U>>>0)|0,N=a[i+4>>2],L=l[i+8|0]?U:N,I=a[e+4>>2],P=a[i>>2],M=I+(u(t,e=P?U:L)<<10)|0,e=(0|e)==(0|N);t:if(a[i>>2])t=a[k+24>>2],U=a[k+20>>2],t=e?a[i+12>>2]+(t+(-1^U)|0)|0:(t-U|0)-!a[i+12>>2]|0,x=0,3!=(0|(e=l[i+8|0]))&&(x=u(U,e+1|0));else{if(!(t=l[i+8|0])){t=a[i+12>>2]-1|0,x=0;break t}if(t=u(t,a[k+20>>2]),U=a[i+12>>2],e){t=(t+U|0)-1|0,x=0;break t}t=t-!U|0,x=0}e=x+(L=t-1|0)|0,ze(n,0,n,0),ze(t,0,b,0),N=e-(t=b)|0,U=a[k+24>>2],E=0;t:{n:{r:{i:{o:{s:{a:{l:{c:{u:{if(t=(e>>>0<L>>>0)-(e>>>0<t>>>0)|0){if(!U)break u;break c}v=N-u((N>>>0)/(U>>>0)|0,U)|0,A=0,b=0;break t}if(!N)break l;break a}if(!((e=U-1|0)&U))break s;x=0-(L=(d(U)+33|0)-d(t)|0)|0;break i}v=0,A=t,b=0;break t}if((e=32-d(t)|0)>>>0<31)break o;break r}if(v=e&N,A=0,1==(0|U))break n;e=U?31-d(U-1^U)|0:32,b=(63&e)>>>0>=32?0:t>>>e|0;break t}L=e+1|0,x=63-e|0}if(n=31&(e=63&L),e>>>0>=32?(e=0,j=t>>>n|0):(e=t>>>n|0,j=((1<<n)-1&t)<<32-n|N>>>n),n=e,x=31&(e=63&x),e>>>0>=32?(e=N<<x,N=0):(e=(1<<x)-1&N>>>32-x|t<<x,N<<=x),t=e,L)for(F=-1!=(0|(x=U-1|0))?0:-1;j=(e=j<<1|t>>>31)-(H=U&(V=F-((n=n<<1|j>>>31)+(e>>>0>x>>>0)|0)>>31))|0,n=n-(e>>>0<H>>>0)|0,t=t<<1|N>>>31,N=E|N<<1,E=1&V,L=L-1|0;);v=j,A=n,b=t<<1|N>>>31;break t}v=N,A=t,t=0}b=t}if(b=A,e=(v<<10)+M|0,U=I+(Ae<<10)|0,n=I+(s<<10)|0,P)B(U,e,n);else{for(y=t=y-2048|0,yn(N=t+1024|0,e),et(N,U),yn(t,N),U=0,N=0;x=a[(L=(e=(t+1024|0)+(N<<7)|0)- -64|0)>>2],j=a[e+100>>2],T=x,F=a[L+4>>2],Q=a[e+96>>2],x=a[e+32>>2],I=a[e+36>>2],j=we(Q^(E=it(a[e>>2],a[e+4>>2],x,I)),j^(P=b),32),I=we(T=(F=it(T,F,j,M=b))^x,I^(x=b),24),T=x,ee=we((H=it(E,P,I,x=b))^j,(G=b)^M,16),x=we(I^(ne=it(F,T,ee,te=b)),(ue=b)^x,63),j=b,I=a[e+108>>2],K=a[e+72>>2],Q=a[e+76>>2],T=a[e+104>>2],E=a[e+40>>2],P=a[e+44>>2],I=we(T^(M=it(a[e+8>>2],a[e+12>>2],E,P)),I^(F=b),32),P=we(T=(re=it(K,Q,I,V=b))^E,P^(E=b),24),Q=re,he=we((T=I)^(re=it(M,F,P,I=b)),(de=b)^V,16),I=we(P^(ie=it(Q,E,he,pe=b)),(oe=b)^I,63),E=b,P=a[e+116>>2],K=a[e+80>>2],Q=a[e+84>>2],T=a[e+112>>2],M=a[e+48>>2],F=a[e+52>>2],P=we(T^(V=it(a[e+16>>2],a[e+20>>2],M,F)),P^(W=b),32),F=we(Q=(T=it(K,Q,P,se=b))^M,F^(M=b),24),K=T,Q=M,se=we(P^(W=it(V,W,F,M=b)),se^(T=b),16),P=we(F^(Q=it(K,Q,se,ae=b)),(q=b)^M,63),M=b,F=a[e+124>>2],ce=a[e+88>>2],J=a[e+92>>2],K=a[e+120>>2],V=a[e+56>>2],Y=a[e+60>>2],F=we(K^(z=it(a[e+24>>2],a[e+28>>2],V,Y)),F^(Z=b),32),J=Y=we(K=(fe=it(ce,J,F,$=b))^V,Y^(V=b),24),Z=we((K=F)^(Y=it(z,Z,Y,F=b)),(z=b)^$,16),F=we(J^(fe=it(fe,V,Z,$=b)),(ce=b)^F,63),V=b,J=Q,K=q,Q=we(Z^(H=it(H,G,I,E)),$^(G=b),32),I=we((Z=it(J,K,Q,q=b))^I,(K=E)^(E=b),24),G=it(K=H,G,I,H=b),a[e>>2]=G,$=b,a[e+4>>2]=$,G=we(G^Q,q^$,16),a[e+120>>2]=G,Q=b,a[e+124>>2]=Q,E=it(Z,E,G,Q),a[e+80>>2]=E,G=b,a[e+84>>2]=G,be=e,Se=we(I^E,H^G,63),a[be+40>>2]=Se,a[e+44>>2]=b,G=we(ee^(E=it(re,de,P,M)),te^(H=b),32),I=we(Q=P^(te=it(fe,ce,G,ee=b)),M^(P=b),24),M=it(Q=E,H,I,E=b),a[e+8>>2]=M,H=b,a[e+12>>2]=H,M=we(M^G,H^ee,16),a[e+96>>2]=M,H=b,a[e+100>>2]=H,P=it(te,P,M,H),a[e+88>>2]=P,M=b,a[e+92>>2]=M,be=e,Se=we(I^P,E^M,63),a[be+48>>2]=Se,a[e+52>>2]=b,M=we(he^(E=it(W,T,F,V)),pe^(P=b),32),I=we(T=F^(G=it(ne,ue,M,H=b)),V^(F=b),24),P=it(T=E,P,I,E=b),a[e+16>>2]=P,V=b,a[e+20>>2]=V,P=we(P^M,V^H,16),a[e+104>>2]=P,M=b,a[e+108>>2]=M,P=it(G,F,P,M),a[L>>2]=P,T=L,L=b,a[T+4>>2]=L,be=e,Se=we(I^P,E^L,63),a[be+56>>2]=Se,a[e+60>>2]=b,I=it(Y,z,x,j),F=it(ie,oe,P=we(se^I,ae^(E=b),32),M=b),I=it(I,E,L=we(T=x^F,j^(x=b),24),j=b),a[e+24>>2]=I,E=b,a[e+28>>2]=E,I=we(I^P,E^M,16),a[e+112>>2]=I,E=b,a[e+116>>2]=E,x=it(F,x,I,E),a[e+72>>2]=x,I=b,a[e+76>>2]=I,be=e,Se=we(x^L,I^j,63),a[be+32>>2]=Se,a[e+36>>2]=b,8!=(0|(N=N+1|0)););for(;N=a[512+(e=(t+1024|0)+(U<<4)|0)>>2],L=a[e+772>>2],T=N,Q=a[e+516>>2],E=a[e+768>>2],N=a[e+256>>2],x=a[e+260>>2],L=we(E^(j=it(a[e>>2],a[e+4>>2],N,x)),L^(I=b),32),x=we(T=(P=it(T,Q,L,E=b))^N,x^(N=b),24),T=N,H=we((F=it(j,I,x,N=b))^L,(V=b)^E,16),N=we(x^(ee=it(P,T,H,G=b)),(te=b)^N,63),L=b,x=a[e+780>>2],K=a[e+520>>2],Q=a[e+524>>2],T=a[e+776>>2],j=a[e+264>>2],I=a[e+268>>2],x=we(T^(E=it(a[e+8>>2],a[e+12>>2],j,I)),x^(P=b),32),I=we(T=(ne=it(K,Q,x,M=b))^j,I^(j=b),24),Q=ne,re=we((T=x)^(ne=it(E,P,I,x=b)),(ue=b)^M,16),x=we(I^(he=it(Q,j,re,de=b)),(pe=b)^x,63),j=b,I=a[e+900>>2],K=a[e+640>>2],Q=a[e+644>>2],T=a[e+896>>2],E=a[e+384>>2],P=a[e+388>>2],I=we(T^(M=it(a[e+128>>2],a[e+132>>2],E,P)),I^(ie=b),32),P=we(T=(W=it(K,Q,I,oe=b))^E,P^(E=b),24),Q=W,T=E,oe=we(I^(ie=it(M,ie,P,E=b)),oe^(W=b),16),I=we(P^(T=it(Q,T,oe,se=b)),(ae=b)^E,63),E=b,P=a[e+908>>2],ce=a[e+648>>2],J=a[e+652>>2],K=a[e+904>>2],M=a[e+392>>2],Q=a[e+396>>2],P=we(K^(q=it(a[e+136>>2],a[e+140>>2],M,Q)),P^(Y=b),32),J=Q=we(K=(Z=it(ce,J,P,z=b))^M,Q^(M=b),24),Y=we((K=P)^(Q=it(q,Y,Q,P=b)),(q=b)^z,16),P=we(J^(Z=it(Z,M,Y,z=b)),($=b)^P,63),M=b,J=T,K=ae,T=we(Y^(F=it(F,V,x,j)),z^(V=b),32),x=we((Y=it(J,K,T,ae=b))^x,(K=j)^(j=b),24),V=it(K=F,V,x,F=b),a[e>>2]=V,z=b,a[e+4>>2]=z,V=we(V^T,z^ae,16),a[e+904>>2]=V,T=b,a[e+908>>2]=T,j=it(Y,j,V,T),a[e+640>>2]=j,V=b,a[e+644>>2]=V,be=e,Se=we(x^j,F^V,63),a[be+264>>2]=Se,a[e+268>>2]=b,V=we(H^(j=it(ne,ue,I,E)),G^(F=b),32),x=we(x=I^(G=it(Z,$,V,H=b)),E^(I=b),24),E=it(E=j,F,x,j=b),a[e+8>>2]=E,F=b,a[e+12>>2]=F,E=we(E^V,F^H,16),a[e+768>>2]=E,F=b,a[e+772>>2]=F,I=it(G,I,E,F),a[e+648>>2]=I,E=b,a[e+652>>2]=E,be=e,Se=we(I^x,E^j,63),a[be+384>>2]=Se,a[e+388>>2]=b,j=it(ie,W,P,M),V=it(ee,te,E=we(re^j,de^(I=b),32),F=b),I=it(T=j,I,x=we(x=P^V,M^(P=b),24),j=b),a[e+128>>2]=I,M=b,a[e+132>>2]=M,I=we(I^E,M^F,16),a[e+776>>2]=I,E=b,a[e+780>>2]=E,I=it(V,P,I,E),a[e+512>>2]=I,E=b,a[e+516>>2]=E,be=e,Se=we(I^x,E^j,63),a[be+392>>2]=Se,a[e+396>>2]=b,I=we(oe^(x=it(Q,q,N,L)),se^(j=b),32),N=we((P=it(he,pe,I,E=b))^N,(T=L)^(L=b),24),j=it(T=x,j,N,x=b),a[e+136>>2]=j,M=b,a[e+140>>2]=M,j=we(I^j,E^M,16),a[e+896>>2]=j,I=b,a[e+900>>2]=I,L=it(P,L,j,I),a[e+520>>2]=L,j=b,a[e+524>>2]=j,be=e,Se=we(N^L,x^j,63),a[be+256>>2]=Se,a[e+260>>2]=b,8!=(0|(U=U+1|0)););yn(n,t),et(n,t+1024|0),y=t+2048|0}if((h=h+1|0)>>>0>=c[k+20>>2])break e;s=s+1|0,e=Ae+1|0,t=a[k+24>>2]}}if(!((e=a[k+28>>2])>>>0>(me=me+1|0)>>>0))break}if(t=e,4==(0|(ge=ge+1|0)))break}if(y=i+32|0,!((e=r+1|0)>>>0<c[k+8>>2]))break}if(y=t=y-2048|0,!(!S|!k)){if(yn(t+1024|0,(a[a[k>>2]+4>>2]+(a[k+24>>2]<<10)|0)-1024|0),c[k+28>>2]>=2)for(e=1;n=a[k+24>>2],et(t+1024|0,(a[a[k>>2]+4>>2]+(u(n,e)+n<<10)|0)-1024|0),(e=e+1|0)>>>0<c[k+28>>2];);for(n=t+1024|0,e=0;ot(i=(r=e<<3)+t|0,a[(r=n+r|0)>>2],a[r+4>>2]),128!=(0|(e=e+1|0)););R(a[S>>2],a[S+4>>2],t,1024),bn(n,1024),bn(t,1024),Re(k,a[S+56>>2])}y=t+2048|0,t=0}}y=k+48|0,n=t;e:if(t)bn(C,f);else{if(!(!g|!m)){y=e=y-16|0,t=-31;t:{n:{r:{i:switch(w-1|0){case 1:if(m>>>0<13)break n;t=l[1347]|l[1348]<<8|l[1349]<<16|l[1350]<<24,n=l[1343]|l[1344]<<8|l[1345]<<16|l[1346]<<24,o[0|g]=n,o[g+1|0]=n>>>8,o[g+2|0]=n>>>16,o[g+3|0]=n>>>24,o[g+4|0]=t,o[g+5|0]=t>>>8,o[g+6|0]=t>>>16,o[g+7|0]=t>>>24,t=l[1352]|l[1353]<<8|l[1354]<<16|l[1355]<<24,n=l[1348]|l[1349]<<8|l[1350]<<16|l[1351]<<24,o[g+5|0]=n,o[g+6|0]=n>>>8,o[g+7|0]=n>>>16,o[g+8|0]=n>>>24,o[g+9|0]=t,o[g+10|0]=t>>>8,o[g+11|0]=t>>>16,o[g+12|0]=t>>>24,r=-12,n=12;break r;case 0:break i;default:break t}if(m>>>0<12)break n;t=l[1335]|l[1336]<<8|l[1337]<<16|l[1338]<<24,n=l[1331]|l[1332]<<8|l[1333]<<16|l[1334]<<24,o[0|g]=n,o[g+1|0]=n>>>8,o[g+2|0]=n>>>16,o[g+3|0]=n>>>24,o[g+4|0]=t,o[g+5|0]=t>>>8,o[g+6|0]=t>>>16,o[g+7|0]=t>>>24,t=l[1339]|l[1340]<<8|l[1341]<<16|l[1342]<<24,o[g+8|0]=t,o[g+9|0]=t>>>8,o[g+10|0]=t>>>16,o[g+11|0]=t>>>24,r=-11,n=11}if(t=le(S))break t;if(Le(t=e+5|0,19),!((r=r+m|0)>>>0<=(t=Ne(t))>>>0)&&(n=pt(n+g|0,e+5|0,t+1|0),!((r=r-t|0)>>>0<4)&&(o[0|(t=t+n|0)]=36,o[t+1|0]=109,o[t+2|0]=61,o[t+3|0]=0,Le(n=e+5|0,a[S+44>>2]),!((r=r-3|0)>>>0<=(n=Ne(n))>>>0)&&(t=pt(t+3|0,e+5|0,n+1|0),!((r=r-n|0)>>>0<4)&&(o[0|(t=t+n|0)]=44,o[t+1|0]=116,o[t+2|0]=61,o[t+3|0]=0,Le(n=e+5|0,a[S+40>>2]),!((r=r-3|0)>>>0<=(n=Ne(n))>>>0)&&(t=pt(t+3|0,e+5|0,n+1|0),!((r=r-n|0)>>>0<4)&&(o[0|(t=t+n|0)]=44,o[t+1|0]=112,o[t+2|0]=61,o[t+3|0]=0,Le(n=e+5|0,a[S+48>>2]),!((r=r-3|0)>>>0<=(n=Ne(n))>>>0)&&(t=pt(t+3|0,e+5|0,n+1|0),!((r=r-n|0)>>>0<2)&&(o[0|(t=t+n|0)]=36,o[t+1|0]=0,X(n=t+1|0,r=r-1|0,a[S+16>>2],a[S+20>>2],3)))))))))){if(t=-31,(i=(i=r)-(r=Ne(n))|0)>>>0<2)break t;o[0|(t=n+r|0)]=36,o[t+1|0]=0,t=X(t+1|0,i-1|0,a[S>>2],a[S+4>>2],3)?0:-31;break t}}t=-31}if(y=e+16|0,t){bn(C,f),bn(g,m),n=-31;break e}}p&&pt(p,C,f),bn(C,f),n=0}O(C)}else n=-22;return y=S- -64|0,n}function _(e){var t,n=0,r=0,i=0,o=0,s=0,u=0,d=0,h=0,p=0,f=0,g=0,m=0;y=t=y-16|0;e:{t:{n:{r:{i:{o:{s:{a:{l:{c:{u:{if((e|=0)>>>0<=244){if(3&(n=(o=a[8965])>>>(r=(u=e>>>0<11?16:e+11&-8)>>>3|0)|0)){e=(s=a[35908+(n=(i=r+(1&(-1^n))|0)<<3)>>2])+8|0,(0|(r=a[s+8>>2]))!=(0|(n=n+35900|0))?(a[r+12>>2]=n,a[n+8>>2]=r):(g=35860,m=Et(-2,i)&o,a[g>>2]=m),n=i<<3,a[s+4>>2]=3|n,a[4+(n=n+s|0)>>2]=1|a[n+4>>2];break e}if((f=a[8967])>>>0>=u>>>0)break u;if(n){r=e=(n=(0-(e=(0-(e=2<<r)|e)&n<<r)&e)-1|0)>>>12&16,r|=e=(n=n>>>e|0)>>>5&8,r|=e=(n=n>>>e|0)>>>2&4,p=a[35908+(e=(r=((r|=e=(n=n>>>e|0)>>>1&2)|(e=(n=n>>>e|0)>>>1&1))+(n>>>e|0)|0)<<3)>>2],(0|(n=a[p+8>>2]))!=(0|(e=e+35900|0))?(a[n+12>>2]=e,a[e+8>>2]=n):(o=Et(-2,r)&o,a[8965]=o),e=p+8|0,a[p+4>>2]=3|u,s=(n=r<<3)-u|0,a[4+(i=u+p|0)>>2]=1|s,a[n+p>>2]=s,f&&(r=35900+((n=f>>>3|0)<<3)|0,p=a[8970],(n=1<<n)&o?n=a[r+8>>2]:(a[8965]=n|o,n=r),a[r+8>>2]=p,a[n+12>>2]=p,a[p+12>>2]=r,a[p+8>>2]=n),a[8970]=i,a[8967]=s;break e}if(!(d=a[8966]))break u;for(r=e=(n=(0-d&d)-1|0)>>>12&16,r|=e=(n=n>>>e|0)>>>5&8,r|=e=(n=n>>>e|0)>>>2&4,n=a[36164+(((r|=e=(n=n>>>e|0)>>>1&2)|(e=(n=n>>>e|0)>>>1&1))+(n>>>e|0)<<2)>>2],i=(-8&a[n+4>>2])-u|0,r=n;(e=a[r+16>>2])||(e=a[r+20>>2]);)i=(s=(r=(-8&a[e+4>>2])-u|0)>>>0<i>>>0)?r:i,n=s?e:n,r=e;if(h=a[n+24>>2],(0|(s=a[n+12>>2]))!=(0|n)){e=a[n+8>>2],a[e+12>>2]=s,a[s+8>>2]=e;break t}if(!(e=a[(r=n+20|0)>>2])){if(!(e=a[n+16>>2]))break c;r=n+16|0}for(;p=r,s=e,(e=a[(r=e+20|0)>>2])||(r=s+16|0,e=a[s+16>>2]););a[p>>2]=0;break t}if(u=-1,!(e>>>0>4294967231)&&(u=-8&(e=e+11|0),h=a[8966])){i=0-u|0,o=0,u>>>0<256||(o=31,u>>>0>16777215||(e=e>>>8|0,e<<=p=e+1048320>>>16&8,o=28+((e=((e<<=r=e+520192>>>16&4)<<(n=e+245760>>>16&2)>>>15|0)-(n|r|p)|0)<<1|u>>>e+21&1)|0));d:{h:{if(r=a[36164+(o<<2)>>2])for(e=0,n=u<<(31==(0|o)?0:25-(o>>>1|0)|0);;){if(!((p=(d=-8&a[r+4>>2])-u|0)>>>0>=i>>>0)&&(i=p,s=r,(0|u)==(0|d))){i=0,e=r;break h}if(p=a[r+20>>2],r=a[16+((n>>>29&4)+r|0)>>2],e=p?(0|p)==(0|r)?e:p:e,n<<=1,!r)break}else e=0;if(!(e|s)){if(s=0,!(e=(0-(e=2<<o)|e)&h))break u;r=e=(n=(e&0-e)-1|0)>>>12&16,r|=e=(n=n>>>e|0)>>>5&8,r|=e=(n=n>>>e|0)>>>2&4,e=a[36164+(((r|=e=(n=n>>>e|0)>>>1&2)|(e=(n=n>>>e|0)>>>1&1))+(n>>>e|0)<<2)>>2]}if(!e)break d}for(;i=(r=(n=(-8&a[e+4>>2])-u|0)>>>0<i>>>0)?n:i,s=r?e:s,e=(n=a[e+16>>2])||a[e+20>>2];);}if(!(!s|a[8967]-u>>>0<=i>>>0)){if(o=a[s+24>>2],(0|s)!=(0|(n=a[s+12>>2]))){e=a[s+8>>2],a[e+12>>2]=n,a[n+8>>2]=e;break n}if(!(e=a[(r=s+20|0)>>2])){if(!(e=a[s+16>>2]))break l;r=s+16|0}for(;p=r,n=e,(e=a[(r=e+20|0)>>2])||(r=n+16|0,e=a[n+16>>2]););a[p>>2]=0;break n}}}if((r=a[8967])>>>0>=u>>>0){i=a[8970],(n=r-u|0)>>>0>=16?(a[8967]=n,e=i+u|0,a[8970]=e,a[e+4>>2]=1|n,a[r+i>>2]=n,a[i+4>>2]=3|u):(a[8970]=0,a[8967]=0,a[i+4>>2]=3|r,a[4+(e=r+i|0)>>2]=1|a[e+4>>2]),e=i+8|0;break e}if((h=a[8968])>>>0>u>>>0){n=h-u|0,a[8968]=n,e=(r=a[8971])+u|0,a[8971]=e,a[e+4>>2]=1|n,a[r+4>>2]=3|u,e=r+8|0;break e}if(e=0,d=u+47|0,a[9083]?r=a[9085]:(a[9086]=-1,a[9087]=-1,a[9084]=4096,a[9085]=4096,a[9083]=t+12&-16^1431655768,a[9088]=0,a[9076]=0,r=4096),(r=(p=d+r|0)&(s=0-r|0))>>>0<=u>>>0)break e;if((i=a[9075])&&(o=(n=a[9073])+r|0)>>>0>i>>>0|n>>>0>=o>>>0)break e;if(4&l[36304])break o;u:{d:{if(i=a[8971])for(e=36308;;){if((n=a[e>>2])>>>0<=i>>>0&i>>>0<n+a[e+4>>2]>>>0)break d;if(!(e=a[e+8>>2]))break}if(-1==(0|(n=$e(0))))break s;if(o=r,(e=(i=a[9084])-1|0)&n&&(o=(r-n|0)+(e+n&0-i)|0),o>>>0<=u>>>0|o>>>0>2147483646)break s;if((i=a[9075])&&i>>>0<(s=(e=a[9073])+o|0)>>>0|e>>>0>=s>>>0)break s;if((0|n)!=(0|(e=$e(o))))break u;break i}if((o=s&p-h)>>>0>2147483646)break s;if((0|(n=$e(o)))==(a[e>>2]+a[e+4>>2]|0))break a;e=n}if(!(-1==(0|e)|u+48>>>0<=o>>>0)){if((n=(n=a[9085])+(d-o|0)&0-n)>>>0>2147483646){n=e;break i}if(-1!=(0|$e(n))){o=n+o|0,n=e;break i}$e(0-o|0);break s}if(n=e,-1!=(0|e))break i;break s}s=0;break t}n=0;break n}if(-1!=(0|n))break i}a[9076]=4|a[9076]}if(r>>>0>2147483646)break r;if(-1==(0|(n=$e(r)))|-1==(0|(e=$e(0)))|e>>>0<=n>>>0)break r;if((o=e-n|0)>>>0<=u+40>>>0)break r}e=a[9073]+o|0,a[9073]=e,e>>>0>c[9074]&&(a[9074]=e);i:{o:{s:{if(d=a[8971]){for(e=36308;;){if(((i=a[e>>2])+(r=a[e+4>>2])|0)==(0|n))break s;if(!(e=a[e+8>>2]))break}break o}for((e=a[8969])>>>0<=n>>>0&&e||(a[8969]=n),e=0,a[9078]=o,a[9077]=n,a[8973]=-1,a[8974]=a[9083],a[9080]=0;r=35900+(i=e<<3)|0,a[i+35908>>2]=r,a[i+35912>>2]=r,32!=(0|(e=e+1|0)););r=(i=o-40|0)-(e=n+8&7?-8-n&7:0)|0,a[8968]=r,e=e+n|0,a[8971]=e,a[e+4>>2]=1|r,a[4+(n+i|0)>>2]=40,a[8972]=a[9087];break i}if(!(8&l[e+12|0]|i>>>0>d>>>0|n>>>0<=d>>>0)){a[e+4>>2]=r+o,r=(e=d+8&7?-8-d&7:0)+d|0,a[8971]=r,e=(n=a[8968]+o|0)-e|0,a[8968]=e,a[r+4>>2]=1|e,a[4+(n+d|0)>>2]=40,a[8972]=a[9087];break i}}c[8969]>n>>>0&&(a[8969]=n),r=n+o|0,e=36308;o:{s:{a:{l:{c:{u:{for(;;){if((0|r)!=a[e>>2]){if(e=a[e+8>>2])continue;break u}break}if(!(8&l[e+12|0]))break c}for(e=36308;;){if((r=a[e>>2])>>>0<=d>>>0&&(s=r+a[e+4>>2]|0)>>>0>d>>>0)break l;e=a[e+8>>2]}}if(a[e>>2]=n,a[e+4>>2]=a[e+4>>2]+o,a[4+(p=(n+8&7?-8-n&7:0)+n|0)>>2]=3|u,u=(o=r+(r+8&7?-8-r&7:0)|0)-(h=u+p|0)|0,(0|o)==(0|d)){a[8971]=h,e=a[8968]+u|0,a[8968]=e,a[h+4>>2]=1|e;break s}if(a[8970]==(0|o)){a[8970]=h,e=a[8967]+u|0,a[8967]=e,a[h+4>>2]=1|e,a[e+h>>2]=e;break s}if(1==(3&(e=a[o+4>>2]))){s=-8&e;c:if(e>>>0<=255){if(r=a[o+8>>2],e=e>>>3|0,(0|(n=a[o+12>>2]))==(0|r)){g=35860,m=a[8965]&Et(-2,e),a[g>>2]=m;break c}a[r+12>>2]=n,a[n+8>>2]=r}else{if(d=a[o+24>>2],(0|o)==(0|(n=a[o+12>>2])))if((i=a[(e=o+20|0)>>2])||(i=a[(e=o+16|0)>>2])){for(;r=e,(i=a[(e=(n=i)+20|0)>>2])||(e=n+16|0,i=a[n+16>>2]););a[r>>2]=0}else n=0;else e=a[o+8>>2],a[e+12>>2]=n,a[n+8>>2]=e;if(d){r=a[o+28>>2];u:{if(a[(e=36164+(r<<2)|0)>>2]==(0|o)){if(a[e>>2]=n,n)break u;g=35864,m=a[8966]&Et(-2,r),a[g>>2]=m;break c}if(a[d+(a[d+16>>2]==(0|o)?16:20)>>2]=n,!n)break c}a[n+24>>2]=d,(e=a[o+16>>2])&&(a[n+16>>2]=e,a[e+24>>2]=n),(e=a[o+20>>2])&&(a[n+20>>2]=e,a[e+24>>2]=n)}}u=s+u|0,o=o+s|0}if(a[o+4>>2]=-2&a[o+4>>2],a[h+4>>2]=1|u,a[u+h>>2]=u,u>>>0<=255){n=35900+((e=u>>>3|0)<<3)|0,(r=a[8965])&(e=1<<e)?e=a[n+8>>2]:(a[8965]=e|r,e=n),a[n+8>>2]=h,a[e+12>>2]=h,a[h+12>>2]=n,a[h+8>>2]=e;break s}if(e=31,u>>>0<=16777215&&(e=u>>>8|0,e<<=i=e+1048320>>>16&8,e=28+((e=((e<<=r=e+520192>>>16&4)<<(n=e+245760>>>16&2)>>>15|0)-(n|r|i)|0)<<1|u>>>e+21&1)|0),a[h+28>>2]=e,a[h+16>>2]=0,a[h+20>>2]=0,i=36164+(e<<2)|0,(r=a[8966])&(n=1<<e)){for(e=u<<(31==(0|e)?0:25-(e>>>1|0)|0),n=a[i>>2];;){if(r=n,(-8&a[n+4>>2])==(0|u))break a;if(n=e>>>29|0,e<<=1,!(n=a[16+(i=r+(4&n)|0)>>2]))break}a[i+16>>2]=h,a[h+24>>2]=r}else a[8966]=n|r,a[i>>2]=h,a[h+24>>2]=i;a[h+12>>2]=h,a[h+8>>2]=h;break s}for(r=(i=o-40|0)-(e=n+8&7?-8-n&7:0)|0,a[8968]=r,e=e+n|0,a[8971]=e,a[e+4>>2]=1|r,a[4+(n+i|0)>>2]=40,a[8972]=a[9087],a[(r=(e=(s+(s-39&7?39-s&7:0)|0)-47|0)>>>0<d+16>>>0?d:e)+4>>2]=27,e=a[9080],a[r+16>>2]=a[9079],a[r+20>>2]=e,e=a[9078],a[r+8>>2]=a[9077],a[r+12>>2]=e,a[9079]=r+8,a[9078]=o,a[9077]=n,a[9080]=0,e=r+24|0;a[e+4>>2]=7,n=e+8|0,e=e+4|0,n>>>0<s>>>0;);if((0|r)==(0|d))break i;if(a[r+4>>2]=-2&a[r+4>>2],s=r-d|0,a[d+4>>2]=1|s,a[r>>2]=s,s>>>0<=255){n=35900+((e=s>>>3|0)<<3)|0,(r=a[8965])&(e=1<<e)?e=a[n+8>>2]:(a[8965]=e|r,e=n),a[n+8>>2]=d,a[e+12>>2]=d,a[d+12>>2]=n,a[d+8>>2]=e;break i}if(e=31,a[d+16>>2]=0,a[d+20>>2]=0,s>>>0<=16777215&&(e=s>>>8|0,e<<=i=e+1048320>>>16&8,e=28+((e=((e<<=r=e+520192>>>16&4)<<(n=e+245760>>>16&2)>>>15|0)-(n|r|i)|0)<<1|s>>>e+21&1)|0),a[d+28>>2]=e,i=36164+(e<<2)|0,(r=a[8966])&(n=1<<e)){for(e=s<<(31==(0|e)?0:25-(e>>>1|0)|0),n=a[i>>2];;){if(r=n,(0|s)==(-8&a[n+4>>2]))break o;if(n=e>>>29|0,e<<=1,!(n=a[16+(i=r+(4&n)|0)>>2]))break}a[i+16>>2]=d,a[d+24>>2]=r}else a[8966]=n|r,a[i>>2]=d,a[d+24>>2]=i;a[d+12>>2]=d,a[d+8>>2]=d;break i}e=a[r+8>>2],a[e+12>>2]=h,a[r+8>>2]=h,a[h+24>>2]=0,a[h+12>>2]=r,a[h+8>>2]=e}e=p+8|0;break e}e=a[r+8>>2],a[e+12>>2]=d,a[r+8>>2]=d,a[d+24>>2]=0,a[d+12>>2]=r,a[d+8>>2]=e}if(!((e=a[8968])>>>0<=u>>>0)){n=e-u|0,a[8968]=n,e=(r=a[8971])+u|0,a[8971]=e,a[e+4>>2]=1|n,a[r+4>>2]=3|u,e=r+8|0;break e}}a[8952]=48,e=0;break e}n:if(o){r=a[s+28>>2];r:{if(a[(e=36164+(r<<2)|0)>>2]==(0|s)){if(a[e>>2]=n,n)break r;h=Et(-2,r)&h,a[8966]=h;break n}if(a[o+(a[o+16>>2]==(0|s)?16:20)>>2]=n,!n)break n}a[n+24>>2]=o,(e=a[s+16>>2])&&(a[n+16>>2]=e,a[e+24>>2]=n),(e=a[s+20>>2])&&(a[n+20>>2]=e,a[e+24>>2]=n)}n:if(i>>>0<=15)e=i+u|0,a[s+4>>2]=3|e,a[4+(e=e+s|0)>>2]=1|a[e+4>>2];else if(a[s+4>>2]=3|u,a[4+(o=s+u|0)>>2]=1|i,a[o+i>>2]=i,i>>>0<=255)n=35900+((e=i>>>3|0)<<3)|0,(r=a[8965])&(e=1<<e)?e=a[n+8>>2]:(a[8965]=e|r,e=n),a[n+8>>2]=o,a[e+12>>2]=o,a[o+12>>2]=n,a[o+8>>2]=e;else{e=31,i>>>0<=16777215&&(e=i>>>8|0,e<<=p=e+1048320>>>16&8,e=28+((e=((e<<=r=e+520192>>>16&4)<<(n=e+245760>>>16&2)>>>15|0)-(n|r|p)|0)<<1|i>>>e+21&1)|0),a[o+28>>2]=e,a[o+16>>2]=0,a[o+20>>2]=0,n=36164+(e<<2)|0;r:{if((r=1<<e)&h){for(e=i<<(31==(0|e)?0:25-(e>>>1|0)|0),r=a[n>>2];;){if((-8&a[(n=r)+4>>2])==(0|i))break r;if(r=e>>>29|0,e<<=1,!(r=a[16+(p=(4&r)+n|0)>>2]))break}a[p+16>>2]=o}else a[8966]=r|h,a[n>>2]=o;a[o+24>>2]=n,a[o+12>>2]=o,a[o+8>>2]=o;break n}e=a[n+8>>2],a[e+12>>2]=o,a[n+8>>2]=o,a[o+24>>2]=0,a[o+12>>2]=n,a[o+8>>2]=e}e=s+8|0;break e}t:if(h){r=a[n+28>>2];n:{if(a[(e=36164+(r<<2)|0)>>2]==(0|n)){if(a[e>>2]=s,s)break n;g=35864,m=Et(-2,r)&d,a[g>>2]=m;break t}if(a[h+(a[h+16>>2]==(0|n)?16:20)>>2]=s,!s)break t}a[s+24>>2]=h,(e=a[n+16>>2])&&(a[s+16>>2]=e,a[e+24>>2]=s),(e=a[n+20>>2])&&(a[s+20>>2]=e,a[e+24>>2]=s)}i>>>0<=15?(e=i+u|0,a[n+4>>2]=3|e,a[4+(e=e+n|0)>>2]=1|a[e+4>>2]):(a[n+4>>2]=3|u,a[4+(s=n+u|0)>>2]=1|i,a[i+s>>2]=i,f&&(r=35900+((e=f>>>3|0)<<3)|0,p=a[8970],(e=1<<e)&o?e=a[r+8>>2]:(a[8965]=e|o,e=r),a[r+8>>2]=p,a[e+12>>2]=p,a[p+12>>2]=r,a[p+8>>2]=e),a[8970]=s,a[8967]=i),e=n+8|0}return y=t+16|0,0|e}function x(e,t,n){var r,i,o,s,l,c,d,h,p,f,g,m,y,v,A,w,S,C,E,I,_,x,P,k,B,O,N,D,j,T,M,F,R,L,Q,U,V,K,H,G,Y,z,Z,W,q,J,X,$,ee,te,ne,re,ie=0,oe=0,se=0,ae=0,le=0,ce=0,ue=0,de=0,he=0,pe=0,fe=0,ge=0,me=0,ye=0,ve=0,Ae=0,be=0,we=0,Se=0,Ce=0,Ee=0,Ie=0,_e=0,xe=0,Pe=0,ke=0;r=ie=Pe=a[n+4>>2],p=ie>>31,L=ie=(Ce=a[t+20>>2])<<1,ie=ze(r,p,ie,_=ie>>31),se=b,oe=ie,i=ie=a[n>>2],o=ie>>31,f=ie=a[t+24>>2],ge=ze(i,o,ie,s=ie>>31),ie=b+se|0,ie=(oe=oe+ge|0)>>>0<ge>>>0?ie+1|0:ie,se=oe,Q=oe=ae=a[n+8>>2],w=oe>>31,g=oe=a[t+16>>2],oe=se+(ge=ze(ae,w,oe,l=oe>>31))|0,se=b+ie|0,se=oe>>>0<ge>>>0?se+1|0:se,U=ie=le=a[n+12>>2],S=ie>>31,V=ie=(ge=a[t+12>>2])<<1,ie=(me=ze(le,S,ie,x=ie>>31))+oe|0,oe=b+se|0,oe=ie>>>0<me>>>0?oe+1|0:oe,se=ie,q=ie=Ae=a[n+16>>2],E=ie>>31,m=ie=a[t+8>>2],me=ze(Ae,E,ie,c=ie>>31),ie=b+oe|0,ie=(se=se+me|0)>>>0<me>>>0?ie+1|0:ie,Ee=se,J=oe=de=a[n+20>>2],P=oe>>31,K=oe=(me=a[t+4>>2])<<1,se=ze(de,P,oe,k=oe>>31),ie=b+ie|0,ie=(oe=Ee+se|0)>>>0<se>>>0?ie+1|0:ie,se=oe,X=oe=he=a[n+24>>2],H=oe>>31,y=oe=a[t>>2],Se=ze(he,H,oe,d=oe>>31),oe=b+ie|0,oe=(se=se+Se|0)>>>0<Se>>>0?oe+1|0:oe,B=a[n+28>>2],ye=ie=u(B,19),C=ie>>31,G=ie=(Se=a[t+36>>2])<<1,ie=(ve=ze(ye,C,ie,O=ie>>31))+se|0,se=b+oe|0,se=ie>>>0<ve>>>0?se+1|0:se,oe=ie,Y=a[n+32>>2],pe=ie=u(Y,19),ce=ie>>31,v=ie=a[t+32>>2],ve=ze(pe,ce,ie,h=ie>>31),ie=b+se|0,ie=(oe=oe+ve|0)>>>0<ve>>>0?ie+1|0:ie,$=a[n+36>>2],fe=n=u($,19),A=n>>31,z=t=(ve=a[t+28>>2])<<1,n=ze(n,A,t,N=t>>31),ie=b+ie|0,xe=t=n+oe|0,t=t>>>0<n>>>0?ie+1|0:ie,n=ze(g,l,r,p),ie=b,oe=ze(i,o,Ce,D=Ce>>31),se=b+ie|0,se=(n=oe+n|0)>>>0<oe>>>0?se+1|0:se,ie=ze(ae,w,ge,j=ge>>31),oe=b+se|0,oe=(n=ie+n|0)>>>0<ie>>>0?oe+1|0:oe,se=ze(m,c,le,S),ie=b+oe|0,ie=(n=se+n|0)>>>0<se>>>0?ie+1|0:ie,oe=ze(Ae,E,me,T=me>>31),ie=b+ie|0,ie=(n=oe+n|0)>>>0<oe>>>0?ie+1|0:ie,oe=ze(y,d,de,P),ie=b+ie|0,ie=(n=oe+n|0)>>>0<oe>>>0?ie+1|0:ie,se=n,Ie=n=u(he,19),n=se+(oe=ze(n,I=n>>31,Se,M=Se>>31))|0,se=b+ie|0,se=n>>>0<oe>>>0?se+1|0:se,ie=ze(v,h,ye,C),oe=b+se|0,oe=(n=ie+n|0)>>>0<ie>>>0?oe+1|0:oe,se=ze(pe,ce,ve,F=ve>>31),ie=b+oe|0,ie=(n=se+n|0)>>>0<se>>>0?ie+1|0:ie,oe=ze(fe,A,f,s),ie=b+ie|0,Ee=n=oe+n|0,n=n>>>0<oe>>>0?ie+1|0:ie,ie=ze(r,p,V,x),se=b,oe=(he=ze(i,o,g,l))+ie|0,ie=b+se|0,ie=oe>>>0<he>>>0?ie+1|0:ie,he=ze(m,c,ae,w),se=b+ie|0,se=(oe=he+oe|0)>>>0<he>>>0?se+1|0:se,ie=(he=ze(le,S,K,k))+oe|0,oe=b+se|0,oe=ie>>>0<he>>>0?oe+1|0:oe,se=(he=ze(y,d,Ae,E))+ie|0,ie=b+oe|0,ie=se>>>0<he>>>0?ie+1|0:ie,be=se,Z=oe=u(de,19),se=ze(oe,R=oe>>31,G,O),ie=b+ie|0,ie=(oe=be+se|0)>>>0<se>>>0?ie+1|0:ie,se=ze(v,h,Ie,I),ie=b+ie|0,ie=(oe=se+oe|0)>>>0<se>>>0?ie+1|0:ie,de=ze(ye,C,z,N),se=b+ie|0,se=(oe=de+oe|0)>>>0<de>>>0?se+1|0:se,ie=(de=ze(pe,ce,f,s))+oe|0,oe=b+se|0,oe=ie>>>0<de>>>0?oe+1|0:oe,se=(de=ze(fe,A,L,_))+ie|0,ie=b+oe|0,ie=se>>>0<de>>>0?ie+1|0:ie,de=se,te=ie,he=oe=se+33554432|0,ne=ie=oe>>>0<33554432?ie+1|0:ie,se=Ee,Ee=(67108863&ie)<<6|oe>>>26,ie=(ie>>26)+n|0,ie=(se=se+Ee|0)>>>0<Ee>>>0?ie+1|0:ie,re=n=(Ee=se)+16777216|0,ie=t+(oe=(se=n>>>0<16777216?ie+1|0:ie)>>25)|0,ie=(n=(se=(33554431&se)<<7|n>>>25)+xe|0)>>>0<se>>>0?ie+1|0:ie,_e=t=n+33554432|0,t=ie=t>>>0<33554432?ie+1|0:ie,ie=-67108864&_e,a[e+24>>2]=n-ie,n=ze(r,p,K,k),ie=b,oe=ze(i,o,m,c),se=b+ie|0,se=(n=oe+n|0)>>>0<oe>>>0?se+1|0:se,oe=ze(y,d,ae,w),ie=b+se|0,ie=(n=oe+n|0)>>>0<oe>>>0?ie+1|0:ie,se=n,le=n=u(le,19),oe=ze(n,xe=n>>31,G,O),ie=b+ie|0,ie=(n=se+oe|0)>>>0<oe>>>0?ie+1|0:ie,oe=n,ee=n=u(Ae,19),n=oe+(se=ze(v,h,n,W=n>>31))|0,oe=b+ie|0,oe=n>>>0<se>>>0?oe+1|0:oe,se=ze(z,N,Z,R),ie=b+oe|0,ie=(n=se+n|0)>>>0<se>>>0?ie+1|0:ie,oe=ze(f,s,Ie,I),se=b+ie|0,se=(n=oe+n|0)>>>0<oe>>>0?se+1|0:se,oe=ze(ye,C,L,_),ie=b+se|0,ie=(n=oe+n|0)>>>0<oe>>>0?ie+1|0:ie,oe=ze(pe,ce,g,l),ie=b+ie|0,ie=(n=oe+n|0)>>>0<oe>>>0?ie+1|0:ie,se=ze(fe,A,V,x),oe=b+ie|0,be=n=se+n|0,n=n>>>0<se>>>0?oe+1|0:oe,ie=ze(y,d,r,p),se=b,oe=(Ae=ze(i,o,me,T))+ie|0,ie=b+se|0,ie=oe>>>0<Ae>>>0?ie+1|0:ie,se=oe,Ae=oe=u(ae,19),oe=se+(ae=ze(oe,ue=oe>>31,Se,M))|0,se=b+ie|0,se=oe>>>0<ae>>>0?se+1|0:se,ae=ze(v,h,le,xe),ie=b+se|0,ie=(oe=ae+oe|0)>>>0<ae>>>0?ie+1|0:ie,se=ze(ee,W,ve,F),ie=b+ie|0,ie=(oe=se+oe|0)>>>0<se>>>0?ie+1|0:ie,se=(ae=ze(f,s,Z,R))+oe|0,oe=b+ie|0,oe=se>>>0<ae>>>0?oe+1|0:oe,ae=ze(Ie,I,Ce,D),ie=b+oe|0,ie=(se=ae+se|0)>>>0<ae>>>0?ie+1|0:ie,oe=(ae=ze(g,l,ye,C))+se|0,se=b+ie|0,se=oe>>>0<ae>>>0?se+1|0:se,ae=ze(pe,ce,ge,j),ie=b+se|0,ie=(oe=ae+oe|0)>>>0<ae>>>0?ie+1|0:ie,se=ze(fe,A,m,c),ie=b+ie|0,ke=oe=se+oe|0,ae=oe>>>0<se>>>0?ie+1|0:ie,ie=ze(ie=u(r,19),ie>>31,G,O),oe=b,se=ze(i,o,y,d),oe=b+oe|0,oe=(ie=se+ie|0)>>>0<se>>>0?oe+1|0:oe,se=(Pe=ze(v,h,Ae,ue))+ie|0,ie=b+oe|0,oe=(le=ze(le,xe,z,N))+se|0,se=b+(se>>>0<Pe>>>0?ie+1|0:ie)|0,se=oe>>>0<le>>>0?se+1|0:se,le=ze(f,s,ee,W),ie=b+se|0,ie=(oe=le+oe|0)>>>0<le>>>0?ie+1|0:ie,se=ze(L,_,Z,R),ie=b+ie|0,ie=(oe=se+oe|0)>>>0<se>>>0?ie+1|0:ie,se=(le=ze(g,l,Ie,I))+oe|0,oe=b+ie|0,oe=se>>>0<le>>>0?oe+1|0:oe,le=ze(ye,C,V,x),ie=b+oe|0,ie=(se=le+se|0)>>>0<le>>>0?ie+1|0:ie,oe=(le=ze(pe,ce,m,c))+se|0,se=b+ie|0,se=oe>>>0<le>>>0?se+1|0:se,le=ze(fe,A,K,k),ie=b+se|0,ie=(oe=le+oe|0)>>>0<le>>>0?ie+1|0:ie,le=oe,Pe=ie,xe=oe=oe+33554432|0,Ae=ie=oe>>>0<33554432?ie+1|0:ie,ue=(67108863&ie)<<6|oe>>>26,oe=(se=ie>>26)+ae|0,ae=ie=ue+ke|0,ie=ie>>>0<ue>>>0?oe+1|0:oe,ke=oe=ae+16777216|0,se=be,be=(33554431&(ie=oe>>>0<16777216?ie+1|0:ie))<<7|oe>>>25,ie=(ie>>25)+n|0,ie=(oe=se+be|0)>>>0<be>>>0?ie+1|0:ie,be=n=oe+33554432|0,n=ie=n>>>0<33554432?ie+1|0:ie,ie=-67108864&be,a[e+8>>2]=oe-ie,ie=ze(f,s,r,p),se=b,oe=(ue=ze(i,o,ve,F))+ie|0,ie=b+se|0,ie=oe>>>0<ue>>>0?ie+1|0:ie,se=ze(Q,w,Ce,D),ie=b+ie|0,ie=(oe=se+oe|0)>>>0<se>>>0?ie+1|0:ie,se=ze(g,l,U,S),ie=b+ie|0,ie=(oe=se+oe|0)>>>0<se>>>0?ie+1|0:ie,ue=ze(q,E,ge,j),se=b+ie|0,se=(oe=ue+oe|0)>>>0<ue>>>0?se+1|0:se,ie=(ue=ze(m,c,J,P))+oe|0,oe=b+se|0,oe=ie>>>0<ue>>>0?oe+1|0:oe,se=(ue=ze(me,T,X,H))+ie|0,ie=b+oe|0,ie=se>>>0<ue>>>0?ie+1|0:ie,oe=se,se=ze(y,d,B,ue=B>>31),ie=b+ie|0,ie=(oe=oe+se|0)>>>0<se>>>0?ie+1|0:ie,se=ze(pe,ce,Se,M),ie=b+ie|0,ie=(oe=se+oe|0)>>>0<se>>>0?ie+1|0:ie,we=ze(fe,A,v,h),se=b+ie|0,ie=t>>26,t=(_e=(67108863&t)<<6|_e>>>26)+(oe=we+oe|0)|0,oe=ie+(se=oe>>>0<we>>>0?se+1|0:se)|0,ie=oe=t>>>0<_e>>>0?oe+1|0:oe,_e=t=(se=t)+16777216|0,t=ie=t>>>0<16777216?ie+1|0:ie,ie=-33554432&_e,a[e+28>>2]=se-ie,ie=ze(m,c,r,p),oe=b,we=ze(i,o,ge,j),se=b+oe|0,se=(ie=we+ie|0)>>>0<we>>>0?se+1|0:se,we=ze(Q,w,me,T),oe=b+se|0,oe=(ie=we+ie|0)>>>0<we>>>0?oe+1|0:oe,se=(we=ze(y,d,U,S))+ie|0,ie=b+oe|0,ie=se>>>0<we>>>0?ie+1|0:ie,oe=se,se=ze(ee,W,Se,M),ie=b+ie|0,ie=(oe=oe+se|0)>>>0<se>>>0?ie+1|0:ie,se=ze(v,h,Z,R),ie=b+ie|0,ie=(oe=se+oe|0)>>>0<se>>>0?ie+1|0:ie,oe=(Ie=ze(Ie,I,ve,F))+oe|0,se=b+ie|0,ie=(ye=ze(f,s,ye,C))+oe|0,oe=b+(oe>>>0<Ie>>>0?se+1|0:se)|0,se=(pe=ze(pe,ce,Ce,D))+ie|0,ie=b+(ie>>>0<ye>>>0?oe+1|0:oe)|0,ie=se>>>0<pe>>>0?ie+1|0:ie,oe=se,se=ze(fe,A,g,l),ie=b+ie|0,pe=oe=oe+se|0,ie=(ie=oe>>>0<se>>>0?ie+1|0:ie)+(oe=n>>26)|0,ie=(n=pe+(se=(67108863&n)<<6|be>>>26)|0)>>>0<se>>>0?ie+1|0:ie,pe=n=(oe=n)+16777216|0,n=se=n>>>0<16777216?ie+1|0:ie,ie=-33554432&pe,a[e+12>>2]=oe-ie,ie=ze(r,p,z,N),se=b,oe=(ce=ze(i,o,v,h))+ie|0,ie=b+se|0,ie=oe>>>0<ce>>>0?ie+1|0:ie,se=ze(f,s,Q,w),ie=b+ie|0,ie=(oe=se+oe|0)>>>0<se>>>0?ie+1|0:ie,ce=ze(U,S,L,_),se=b+ie|0,se=(oe=ce+oe|0)>>>0<ce>>>0?se+1|0:se,ie=(ce=ze(g,l,q,E))+oe|0,oe=b+se|0,oe=ie>>>0<ce>>>0?oe+1|0:oe,se=(ce=ze(V,x,J,P))+ie|0,ie=b+oe|0,ie=se>>>0<ce>>>0?ie+1|0:ie,oe=se,se=ze(m,c,X,H),ie=b+ie|0,ie=(oe=oe+se|0)>>>0<se>>>0?ie+1|0:ie,se=ze(B,ue,K,k),ie=b+ie|0,ie=(oe=se+oe|0)>>>0<se>>>0?ie+1|0:ie,oe=(ye=ze(y,d,Y,ce=Y>>31))+oe|0,se=b+ie|0,ie=(fe=ze(fe,A,G,O))+oe|0,oe=b+(oe>>>0<ye>>>0?se+1|0:se)|0,oe=ie>>>0<fe>>>0?oe+1|0:oe,be=ie,ie=(ie=t>>25)+oe|0,ie=(t=be+(se=(33554431&t)<<7|_e>>>25)|0)>>>0<se>>>0?ie+1|0:ie,fe=t=(oe=t)+33554432|0,t=ie=t>>>0<33554432?ie+1|0:ie,ie=-67108864&fe,a[e+32>>2]=oe-ie,se=oe=de-(ie=-67108864&he)|0,ie=(ie=te-((ie>>>0>de>>>0)+ne|0)|0)+(oe=n>>25)|0,ie=(n=se+(de=(33554431&n)<<7|pe>>>25)|0)>>>0<de>>>0?ie+1|0:ie,ie=(Ee-(-33554432&re)|0)+((67108863&(ie=(oe=n+33554432|0)>>>0<33554432?ie+1|0:ie))<<6|oe>>>26)|0,a[e+20>>2]=ie,ie=-67108864&oe,a[e+16>>2]=n-ie,n=ze(v,h,r,p),ie=b,oe=ze(i,o,Se,M),ie=b+ie|0,ie=(n=oe+n|0)>>>0<oe>>>0?ie+1|0:ie,se=ze(Q,w,ve,F),oe=b+ie|0,oe=(n=se+n|0)>>>0<se>>>0?oe+1|0:oe,ie=ze(f,s,U,S),se=b+oe|0,se=(n=ie+n|0)>>>0<ie>>>0?se+1|0:se,oe=ze(q,E,Ce,D),ie=b+se|0,ie=(n=oe+n|0)>>>0<oe>>>0?ie+1|0:ie,oe=ze(g,l,J,P),ie=b+ie|0,ie=(n=oe+n|0)>>>0<oe>>>0?ie+1|0:ie,oe=ze(ge,j,X,H),ie=b+ie|0,ie=(n=oe+n|0)>>>0<oe>>>0?ie+1|0:ie,se=ze(m,c,B,ue),oe=b+ie|0,oe=(n=se+n|0)>>>0<se>>>0?oe+1|0:oe,ie=ze(Y,ce,me,T),se=b+oe|0,se=(n=ie+n|0)>>>0<ie>>>0?se+1|0:se,oe=ze(y,d,$,$>>31),ie=b+se|0,ie=(ie=(n=oe+n|0)>>>0<oe>>>0?ie+1|0:ie)+(oe=t>>26)|0,ie=(t=(se=n)+(n=(67108863&t)<<6|fe>>>26)|0)>>>0<n>>>0?ie+1|0:ie,ie=(n=t+16777216|0)>>>0<16777216?ie+1|0:ie,oe=-33554432&n,a[e+36>>2]=t-oe,se=ae-(-33554432&ke)|0,oe=le-(t=-67108864&xe)|0,Ce=Pe-((t>>>0>le>>>0)+Ae|0)|0,t=(n=ze((33554431&(t=ie))<<7|n>>>25,ie>>=25,19,0))+oe|0,oe=b+Ce|0,ie=oe=t>>>0<n>>>0?oe+1|0:oe,n=((67108863&(ie=(n=t+33554432|0)>>>0<33554432?ie+1|0:ie))<<6|(oe=n)>>>26)+se|0,a[e+4>>2]=n,n=e,e=-67108864&oe,a[n>>2]=t-e}function P(e,t){var n,r,i,o,s,l,c,d,h,p,f,g,m,v,A,w,S,C,E,I,_,x,P,B,O,N,D,j,T,M,F,R,L,Q,U,V,K,H,G,Y,z,Z=0,W=0,q=0,J=0,X=0,$=0,ee=0,te=0,ne=0,re=0,ie=0,oe=0,se=0,ae=0,le=0,ce=0,ue=0,de=0,he=0,pe=0,fe=0;y=x=y-48|0,k(e,t),k(C=e+80|0,F=t+40|0),n=e+120|0,c=Z=(ue=a[t+92>>2])<<1,d=Z>>31,h=Z=(ie=a[t+84>>2])<<1,Z=ze(c,d,Z,r=Z>>31),X=b,W=Z,N=Z=$=a[t+88>>2],q=ze(Z,ee=Z>>31,Z,ee),Z=b+X|0,Z=(W=W+q|0)>>>0<q>>>0?Z+1|0:Z,q=W,i=W=a[t+96>>2],p=W>>31,f=W=(se=a[t+80>>2])<<1,X=ze(i,p,W,o=W>>31),Z=b+Z|0,Z=(W=q+X|0)>>>0<X>>>0?Z+1|0:Z,J=W,X=a[t+108>>2],P=W=u(X,38),R=X,q=ze(W,E=W>>31,X,D=X>>31),Z=b+Z|0,Z=(W=J+q|0)>>>0<q>>>0?Z+1|0:Z,q=W,A=a[t+112>>2],de=ze(g=W=u(A,19),m=W>>31,W=(ne=a[t+104>>2])<<1,W>>31),W=b+Z|0,W=(q=q+de|0)>>>0<de>>>0?W+1|0:W,J=q,de=a[t+116>>2],s=Z=u(de,38),l=Z>>31,I=Z=(q=a[t+100>>2])<<1,ce=ze(s,l,Z,w=Z>>31),W=b+W|0,W=(Z=J+ce|0)>>>0<ce>>>0?W+1|0:W,ce=Z,K=Z=W<<1|Z>>>31,L=W=33554432+(ce<<=1)|0,H=Z=W>>>0<33554432?Z+1|0:Z,W=Z>>26,Z=(67108863&Z)<<6|L>>>26,he=W,W=ze(h,r,i,p),te=b,J=Z,_=Z=$<<1,ue=ze(Z,S=Z>>31,$=ue,j=$>>31),Z=b+te|0,Z=(W=ue+W|0)>>>0<ue>>>0?Z+1|0:Z,ue=q,te=(re=ze(q,B=q>>31,f,o))+W|0,W=b+Z|0,W=te>>>0<re>>>0?W+1|0:W,oe=te,Q=Z=X<<1,te=ze(g,m,Z,T=Z>>31),Z=b+W|0,Z=(X=oe+te|0)>>>0<te>>>0?Z+1|0:Z,W=X,X=ze(s,l,ne,v=ne>>31),Z=b+Z|0,Z=(W=W+X|0)>>>0<X>>>0?Z+1|0:Z,X=W,W=(W=Z<<1|W>>>31)+he|0,he=Z=J+(X<<=1)|0,Z=Z>>>0<X>>>0?W+1|0:W,G=W=he+16777216|0,X=W,W=(Z=W>>>0<16777216?Z+1|0:Z)>>25,Z=(33554431&Z)<<7|X>>>25,X=W,W=ze(c,d,$,j),te=b,J=Z,re=ze(i,p,_,S),Z=b+te|0,Z=(W=re+W|0)>>>0<re>>>0?Z+1|0:Z,te=ze(h,r,I,w),Z=b+Z|0,Z=(W=te+W|0)>>>0<te>>>0?Z+1|0:Z,te=(re=ze(f,o,ne,v))+W|0,W=b+Z|0,W=te>>>0<re>>>0?W+1|0:W,re=ze(g,m,A,O=A>>31),Z=b+W|0,Z=(te=re+te|0)>>>0<re>>>0?Z+1|0:Z,re=ze(s,l,Q,T),W=b+Z|0,W=(te=re+te|0)>>>0<re>>>0?W+1|0:W,re=(Z=te)<<1,Z=(W<<1|Z>>>31)+X|0,Z=(te=J+re|0)>>>0<re>>>0?Z+1|0:Z,fe=X=(W=te)+33554432|0,X=Z=X>>>0<33554432?Z+1|0:Z,Z=-67108864&fe,a[n+24>>2]=W-Z,Z=ze(Z=u(q,38),Z>>31,q,B),W=b,J=Z,q=ze(se,Z=se>>31,se,Z),W=b+W|0,W=(Z=J+q|0)>>>0<q>>>0?W+1|0:W,q=Z,oe=Z=u(ne,19),le=Z>>31,U=Z=i<<1,se=ze(oe,le,Z,M=Z>>31),Z=b+W|0,Z=(q=q+se|0)>>>0<se>>>0?Z+1|0:Z,W=q,q=ze(c,d,P,E),Z=b+Z|0,Z=(W=W+q|0)>>>0<q>>>0?Z+1|0:Z,q=(se=ze(g,m,_,S))+W|0,W=b+Z|0,W=q>>>0<se>>>0?W+1|0:W,se=ze(h,r,s,l),Z=b+W|0,Z=(q=se+q|0)>>>0<se>>>0?Z+1|0:Z,se=(W=q)<<1,z=Z=Z<<1|W>>>31,W=Z,te=Z=se+33554432|0,re=W=Z>>>0<33554432?W+1|0:W,Z=W>>26,W=(67108863&W)<<6|te>>>26,q=Z,Z=ze(oe,le,I,w),ae=b,pe=W,W=(ie=ze(f,o,J=ie,V=J>>31))+Z|0,Z=b+ae|0,Z=W>>>0<ie>>>0?Z+1|0:Z,ie=(ae=ze(i,p,P,E))+W|0,W=b+Z|0,W=ie>>>0<ae>>>0?W+1|0:W,ae=ze(c,d,g,m),Z=b+W|0,Z=(ie=ae+ie|0)>>>0<ae>>>0?Z+1|0:Z,ae=ze(s,l,N,ee),W=b+Z|0,W=(ie=ae+ie|0)>>>0<ae>>>0?W+1|0:W,ae=(Z=ie)<<1,Z=(W<<1|Z>>>31)+q|0,Z=(ie=pe+ae|0)>>>0<ae>>>0?Z+1|0:Z,ae=W=ie+16777216|0,q=W,W=(Z=W>>>0<16777216?Z+1|0:Z)>>25,Z=(33554431&Z)<<7|q>>>25,q=W,W=ze(f,o,N,ee),Y=b,pe=Z,J=ze(J,V,h,r),Z=b+Y|0,Z=(W=J+W|0)>>>0<J>>>0?Z+1|0:Z,J=(oe=ze(oe,le,ne,v))+W|0,W=b+Z|0,W=J>>>0<oe>>>0?W+1|0:W,oe=ze(I,w,P,E),Z=b+W|0,Z=(J=oe+J|0)>>>0<oe>>>0?Z+1|0:Z,W=J,J=ze(g,m,U,M),Z=b+Z|0,Z=(W=W+J|0)>>>0<J>>>0?Z+1|0:Z,J=(oe=ze(s,l,c,d))+W|0,W=b+Z|0,Z=(Z=(W=J>>>0<oe>>>0?W+1|0:W)<<1|J>>>31)+q|0,Z=(W=pe+(J<<=1)|0)>>>0<J>>>0?Z+1|0:Z,q=W,J=W,W=Z,oe=Z=q+33554432|0,q=W=Z>>>0<33554432?W+1|0:W,Z&=-67108864,a[n+8>>2]=J-Z,Z=ze(_,S,ue,B),W=b,J=ze(c,d,i,p),W=b+W|0,W=(Z=J+Z|0)>>>0<J>>>0?W+1|0:W,J=(le=ze(h,r,ne,v))+Z|0,Z=b+W|0,Z=J>>>0<le>>>0?Z+1|0:Z,le=ze(f,o,R,D),W=b+Z|0,W=(J=le+J|0)>>>0<le>>>0?W+1|0:W,le=ze(s,l,A,O),Z=b+W|0,pe=(W=J=le+J|0)<<1,Z=(Z=(W>>>0<le>>>0?Z+1|0:Z)<<1|W>>>31)+(W=X>>26)|0,Z=(X=pe+(J=(67108863&X)<<6|fe>>>26)|0)>>>0<J>>>0?Z+1|0:Z,J=X,W=Z,fe=Z=X+16777216|0,X=W=Z>>>0<16777216?W+1|0:W,Z&=-33554432,a[n+28>>2]=J-Z,Z=ze(f,o,$,j),$=b,W=(ee=ze(h,r,N,ee))+Z|0,Z=b+$|0,Z=W>>>0<ee>>>0?Z+1|0:Z,ee=ze(ne,v,P,E),Z=b+Z|0,Z=(W=ee+W|0)>>>0<ee>>>0?Z+1|0:Z,ee=($=ze(g,m,I,w))+W|0,W=b+Z|0,W=$>>>0>ee>>>0?W+1|0:W,Z=ee,ee=ze(s,l,i,p),W=b+W|0,W=(Z=Z+ee|0)>>>0<ee>>>0?W+1|0:W,ee=Z,Z=(Z=W<<1|Z>>>31)+(W=q>>26)|0,Z=(q=(J=ee<<1)+(ee=(67108863&q)<<6|oe>>>26)|0)>>>0<ee>>>0?Z+1|0:Z,ee=q=(W=q)+16777216|0,q=Z=q>>>0<16777216?Z+1|0:Z,Z=-33554432&ee,a[n+12>>2]=W-Z,Z=ze(ne,v,_,S),$=b,W=(J=ze(i,p,i,p))+Z|0,Z=b+$|0,Z=W>>>0<J>>>0?Z+1|0:Z,$=ze(c,d,I,w),Z=b+Z|0,Z=(W=$+W|0)>>>0<$>>>0?Z+1|0:Z,$=ze(h,r,Q,T),Z=b+Z|0,Z=(W=$+W|0)>>>0<$>>>0?Z+1|0:Z,$=(J=ze(f,o,A,O))+W|0,W=b+Z|0,W=J>>>0>$>>>0?W+1|0:W,Z=$,$=ze(s,l,de,J=de>>31),W=b+W|0,W=(Z=Z+$|0)>>>0<$>>>0?W+1|0:W,$=Z,Z=(Z=W<<1|Z>>>31)+(W=X>>25)|0,Z=(X=(oe=$<<1)+($=(33554431&X)<<7|fe>>>25)|0)>>>0<$>>>0?Z+1|0:Z,$=X=(W=X)+33554432|0,X=Z=X>>>0<33554432?Z+1|0:Z,Z=-67108864&$,a[n+32>>2]=W-Z,W=ce-(Z=-67108864&L)|0,ce=K-((Z>>>0>ce>>>0)+H|0)|0,Z=q>>25,q=(ee=(33554431&q)<<7|ee>>>25)+W|0,W=Z+ce|0,Z=W=q>>>0<ee>>>0?W+1|0:W,Z=((67108863&(Z=(W=q+33554432|0)>>>0<33554432?Z+1|0:Z))<<6|W>>>26)+(he=he-(-33554432&G)|0)|0,a[n+20>>2]=Z,Z=-67108864&W,a[n+16>>2]=q-Z,Z=ze(c,d,ne,v),W=b,q=ze(ue,B,U,M),W=b+W|0,W=(Z=q+Z|0)>>>0<q>>>0?W+1|0:W,q=(ne=ze(_,S,R,D))+Z|0,Z=b+W|0,Z=q>>>0<ne>>>0?Z+1|0:Z,ne=ze(h,r,A,O),W=b+Z|0,W=(q=ne+q|0)>>>0<ne>>>0?W+1|0:W,ne=ze(f,o,de,J),Z=b+W|0,J=(W=q=ne+q|0)<<1,Z=(Z=(W>>>0<ne>>>0?Z+1|0:Z)<<1|W>>>31)+(W=X>>26)|0,W=Z=(q=(67108863&X)<<6|$>>>26)>>>0>(X=J+q|0)>>>0?Z+1|0:Z,W=(Z=X+16777216|0)>>>0<16777216?W+1|0:W,q=-33554432&Z,a[n+36>>2]=X-q,ne=ze((33554431&W)<<7|Z>>>25,W>>25,19,0),W=b+(z-(((q=-67108864&te)>>>0>se>>>0)+re|0)|0)|0,W=(Z=ne+(se-q|0)|0)>>>0<ne>>>0?W+1|0:W,W=(ie-(-33554432&ae)|0)+((67108863&(W=(X=Z+33554432|0)>>>0<33554432?W+1|0:W))<<6|X>>>26)|0,a[n+4>>2]=W,W=-67108864&X,a[n>>2]=Z-W,me(Z=e+40|0,t,F),k(x,Z),me(Z,C,e),ge(C,C,e),ge(e,x,Z),ge(n,n,C),y=x+48|0}function k(e,t){var n,r,i,o,s,l,c,d,h,p,f,g,m,y,v,A,w,S,C,E,I,_,x,P,k,B,O,N,D,j,T,M,F,R,L,Q=0,U=0,V=0,K=0,H=0,G=0,Y=0,z=0,Z=0,W=0,q=0,J=0,X=0,$=0,ee=0,te=0,ne=0,re=0,ie=0;p=U=(Q=a[t+12>>2])<<1,Z=Q,Q=ze(U,s=U>>31,Q,k=Q>>31),K=b,U=Q,l=(Q=n=a[t+16>>2])>>31,w=Q=(Y=a[t+8>>2])<<1,V=ze(n,l,Q,m=Q>>31),Q=b+K|0,Q=(U=U+V|0)>>>0<V>>>0?Q+1|0:Q,K=U,y=U=(V=a[t+20>>2])<<1,v=U>>31,c=U=(G=a[t+4>>2])<<1,q=ze(y,v,U,r=U>>31),U=b+Q|0,U=(K=K+q|0)>>>0<q>>>0?U+1|0:U,E=Q=H=a[t+24>>2],f=Q>>31,d=Q=(X=a[t>>2])<<1,q=ze(H,f,Q,i=Q>>31),Q=b+U|0,Q=(K=q+K|0)>>>0<q>>>0?Q+1|0:Q,W=K,q=a[t+32>>2],A=U=u(q,19),K=ze(U,g=U>>31,q,I=q>>31),Q=b+Q|0,Q=(U=W+K|0)>>>0<K>>>0?Q+1|0:Q,W=U,_=a[t+36>>2],h=U=u(_,38),o=U>>31,j=t=(K=a[t+28>>2])<<1,ne=ze(U,o,t,B=t>>31),t=b+Q|0,W=U=W+ne|0,J=U>>>0<ne>>>0?t+1|0:t,t=ze(c,r,n,l),Q=b,U=ze(w,m,Z,k),Q=b+Q|0,Q=(t=U+t|0)>>>0<U>>>0?Q+1|0:Q,ne=V,z=ze(V,x=V>>31,d,i),U=b+Q|0,U=(t=z+t|0)>>>0<z>>>0?U+1|0:U,z=ze(A,g,j,B),Q=b+U|0,Q=(t=z+t|0)>>>0<z>>>0?Q+1|0:Q,U=ze(h,o,H,f),Q=b+Q|0,$=t=U+t|0,re=t>>>0<U>>>0?Q+1|0:Q,t=ze(c,r,p,s),U=b,Q=(z=ze(Y,S=Y>>31,Y,S))+t|0,t=b+U|0,t=Q>>>0<z>>>0?t+1|0:t,U=(z=ze(d,i,n,l))+Q|0,Q=b+t|0,Q=U>>>0<z>>>0?Q+1|0:Q,P=t=u(K,38),z=K,t=(K=ze(t,C=t>>31,K,O=K>>31))+U|0,U=b+Q|0,U=t>>>0<K>>>0?U+1|0:U,t=(Q=t)+(K=ze(A,g,t=H<<1,t>>31))|0,Q=b+U|0,Q=t>>>0<K>>>0?Q+1|0:Q,U=ze(h,o,y,v),Q=b+Q|0,N=t=U+t|0,F=Q=t>>>0<U>>>0?Q+1|0:Q,t=Q,T=Q=N+33554432|0,R=t=Q>>>0<33554432?t+1|0:t,Q=(Q=t>>26)+re|0,re=t=(U=(67108863&t)<<6|T>>>26)+$|0,U=t>>>0<U>>>0?Q+1|0:Q,L=t=t+16777216|0,Q=(Q=(U=t>>>0<16777216?U+1|0:U)>>25)+J|0,Q=(t=(U=(33554431&U)<<7|t>>>25)+W|0)>>>0<U>>>0?Q+1|0:Q,U=t,t=Q,ee=Q=U+33554432|0,K=t=Q>>>0<33554432?t+1|0:t,t=-67108864&Q,a[e+24>>2]=U-t,t=ze(d,i,Y,S),Q=b,W=ze(c,r,G,J=G>>31),U=b+Q|0,U=(t=W+t|0)>>>0<W>>>0?U+1|0:U,Q=t,W=t=u(H,19),t=Q+(H=ze(t,$=t>>31,H,f))|0,Q=b+U|0,Q=t>>>0<H>>>0?Q+1|0:Q,U=(H=ze(y,v,P,C))+t|0,t=b+Q|0,t=U>>>0<H>>>0?t+1|0:t,M=Q=n<<1,H=ze(A,g,Q,D=Q>>31),Q=b+t|0,Q=(U=H+U|0)>>>0<H>>>0?Q+1|0:Q,t=U,U=ze(h,o,p,s),Q=b+Q|0,ie=t=t+U|0,H=t>>>0<U>>>0?Q+1|0:Q,t=ze(y,v,W,$),Q=b,G=ze(d,i,G,J),U=b+Q|0,U=(t=G+t|0)>>>0<G>>>0?U+1|0:U,G=ze(n,l,P,C),Q=b+U|0,Q=(t=G+t|0)>>>0<G>>>0?Q+1|0:Q,U=(G=ze(A,g,p,s))+t|0,t=b+Q|0,t=U>>>0<G>>>0?t+1|0:t,G=ze(h,o,Y,S),Q=b+t|0,te=U=G+U|0,J=U>>>0<G>>>0?Q+1|0:Q,t=ze(t=u(V,38),t>>31,V,x),Q=b,V=t,U=ze(X,t=X>>31,X,t),Q=b+Q|0,Q=(t=V+U|0)>>>0<U>>>0?Q+1|0:Q,V=ze(W,$,M,D),U=b+Q|0,U=(t=V+t|0)>>>0<V>>>0?U+1|0:U,V=ze(p,s,P,C),Q=b+U|0,Q=(t=V+t|0)>>>0<V>>>0?Q+1|0:Q,U=(V=ze(A,g,w,m))+t|0,t=b+Q|0,t=U>>>0<V>>>0?t+1|0:t,V=ze(c,r,h,o),Q=b+t|0,G=U=V+U|0,W=Q=U>>>0<V>>>0?Q+1|0:Q,X=t=U+33554432|0,$=Q=t>>>0<33554432?Q+1|0:Q,U=(t=Q>>26)+J|0,J=Q=(V=(67108863&Q)<<6|X>>>26)+te|0,te=ie,Q=Q>>>0<V>>>0?U+1|0:U,ie=t=J+16777216|0,V=(33554431&(Q=t>>>0<16777216?Q+1|0:Q))<<7|t>>>25,Q=(Q>>25)+H|0,Q=(U=te+V|0)>>>0<V>>>0?Q+1|0:Q,H=U=(t=U)+33554432|0,V=Q=U>>>0<33554432?Q+1|0:Q,Q=-67108864&U,a[e+8>>2]=t-Q,t=ze(w,m,ne,x),Q=b,U=ze(n,l,p,s),Q=b+Q|0,Q=(t=U+t|0)>>>0<U>>>0?Q+1|0:Q,U=ze(c,r,E,f),Q=b+Q|0,Q=(t=U+t|0)>>>0<U>>>0?Q+1|0:Q,U=ze(d,i,z,O),Q=b+Q|0,Q=(t=U+t|0)>>>0<U>>>0?Q+1|0:Q,U=(te=ze(h,o,q,I))+t|0,t=b+Q|0,Q=K>>26,K=(ee=(67108863&K)<<6|ee>>>26)+U|0,U=(t=U>>>0<te>>>0?t+1|0:t)+Q|0,Q=(t=K)>>>0<ee>>>0?U+1|0:U,ee=U=t+16777216|0,K=Q=U>>>0<16777216?Q+1|0:Q,Q=-33554432&U,a[e+28>>2]=t-Q,t=ze(d,i,Z,k),U=b,Q=(Y=ze(c,r,Y,S))+t|0,t=b+U|0,t=Q>>>0<Y>>>0?t+1|0:t,Y=ze(E,f,P,C),U=b+t|0,U=(Q=Y+Q|0)>>>0<Y>>>0?U+1|0:U,t=(Y=ze(A,g,y,v))+Q|0,Q=b+U|0,Q=t>>>0<Y>>>0?Q+1|0:Q,U=ze(h,o,n,l),Q=b+Q|0,Q=(Q=(t=U+t|0)>>>0<U>>>0?Q+1|0:Q)+(U=V>>26)|0,U=t=(V=(67108863&V)<<6|H>>>26)+t|0,t=t>>>0<V>>>0?Q+1|0:Q,Y=Q=U+16777216|0,V=t=Q>>>0<16777216?t+1|0:t,t=-33554432&Q,a[e+12>>2]=U-t,t=ze(E,f,w,m),Q=b,U=ze(n,l,n,l),Q=b+Q|0,Q=(t=U+t|0)>>>0<U>>>0?Q+1|0:Q,U=ze(p,s,y,v),Q=b+Q|0,Q=(t=U+t|0)>>>0<U>>>0?Q+1|0:Q,U=(Z=ze(c,r,j,B))+t|0,t=b+Q|0,t=U>>>0<Z>>>0?t+1|0:t,Q=(Z=ze(d,i,q,I))+U|0,U=b+t|0,U=Q>>>0<Z>>>0?U+1|0:U,t=(Z=ze(h,o,_,H=_>>31))+Q|0,Q=b+U|0,Q=t>>>0<Z>>>0?Q+1|0:Q,U=t,Q=(t=K>>25)+Q|0,Q=(U=U+(K=(33554431&K)<<7|ee>>>25)|0)>>>0<K>>>0?Q+1|0:Q,Z=U=(t=U)+33554432|0,K=Q=U>>>0<33554432?Q+1|0:Q,Q=-67108864&U,a[e+32>>2]=t-Q,Q=V>>25,U=(V=(33554431&V)<<7|Y>>>25)+(N-(t=-67108864&T)|0)|0,t=Q+(F-((t>>>0>N>>>0)+R|0)|0)|0,Q=t=U>>>0<V>>>0?t+1|0:t,V=t=U+33554432|0,t=((67108863&(Q=t>>>0<33554432?Q+1|0:Q))<<6|t>>>26)+(re=re-(-33554432&L)|0)|0,a[e+20>>2]=t,t=-67108864&V,a[e+16>>2]=U-t,t=ze(p,s,E,f),U=b,Q=(V=ze(ne,x,M,D))+t|0,t=b+U|0,t=Q>>>0<V>>>0?t+1|0:t,U=(V=ze(w,m,z,O))+Q|0,Q=b+t|0,Q=U>>>0<V>>>0?Q+1|0:Q,t=(V=ze(c,r,q,I))+U|0,U=b+Q|0,U=t>>>0<V>>>0?U+1|0:U,V=ze(d,i,_,H),Q=b+U|0,U=t=V+t|0,Q=(t=t>>>0<V>>>0?Q+1|0:Q)+(Q=K>>26)|0,t=Q=(U=(K=(67108863&K)<<6|Z>>>26)+U|0)>>>0<K>>>0?Q+1|0:Q,t=(Q=U+16777216|0)>>>0<16777216?t+1|0:t,K=-33554432&Q,a[e+36>>2]=U-K,V=ze((33554431&t)<<7|Q>>>25,t>>25,19,0),Q=b+(W-(((U=-67108864&X)>>>0>G>>>0)+$|0)|0)|0,U=t=V+(G-U|0)|0,t=t>>>0<V>>>0?Q+1|0:Q,t=(J-(-33554432&ie)|0)+((67108863&(t=(Q=U+33554432|0)>>>0<33554432?t+1|0:t))<<6|Q>>>26)|0,a[e+4>>2]=t,t=e,e=-67108864&Q,a[t>>2]=U-e}function B(e,t,n){var r,i=0,o=0,s=0,l=0,c=0,u=0,d=0,h=0,p=0,f=0,g=0,m=0,v=0,A=0,w=0,S=0,C=0,E=0,I=0,_=0,x=0,P=0,k=0,B=0,O=0,N=0,D=0,j=0,T=0,M=0,F=0,R=0,L=0,Q=0,U=0,V=0,K=0,H=0;for(y=r=y-2048|0,yn(v=r+1024|0,t),et(v,e),yn(r,v),et(r,n),t=0,v=0;u=a[(f=(e=(r+1024|0)+(v<<7)|0)- -64|0)>>2],o=a[e+100>>2],c=u,h=a[f+4>>2],d=a[e+96>>2],u=a[e+32>>2],s=a[e+36>>2],l=we(d^(i=it(a[e>>2],a[e+4>>2],u,s)),(l=o)^(o=b),32),s=we(h=(c=it(c,h,l,d=b))^u,s^(u=b),24),h=u,k=we((w=it(i,o,s,u=b))^l,(A=b)^d,16),u=we(s^(O=it(c,h,k,B=b)),(R=b)^u,63),o=b,s=a[e+108>>2],h=a[e+72>>2],m=a[e+76>>2],g=a[e+104>>2],i=a[e+40>>2],l=a[e+44>>2],c=we(g^(d=it(a[e+8>>2],a[e+12>>2],i,l)),(c=s)^(s=b),32),l=we(h=(N=it(h,m,c,p=b))^i,l^(i=b),24),h=N,Q=we((N=it(d,m=s,l,s=b))^c,(L=b)^p,16),s=we(l^(D=it(h,i,Q,U=b)),(j=b)^s,63),i=b,l=a[e+116>>2],g=a[e+80>>2],S=a[e+84>>2],m=a[e+112>>2],d=a[e+48>>2],c=a[e+52>>2],m=we(m^(p=it(a[e+16>>2],a[e+20>>2],d,c)),(h=l)^(l=b),32),c=we(h=(g=it(g,S,m,T=b))^d,c^(d=b),24),h=g,g=we((g=m)^(m=it(p,m=l,c,l=b)),(p=T)^(T=b),16),l=we(c^(h=it(h,d,g,M=b)),(_=b)^l,63),d=b,c=a[e+124>>2],x=a[e+88>>2],F=a[e+92>>2],C=a[e+120>>2],p=a[e+56>>2],S=a[e+60>>2],C=we(C^(E=it(a[e+24>>2],a[e+28>>2],p,S)),(I=c)^(c=b),32),I=S=we(I=(F=it(x,F,C,P=b))^p,S^(p=b),24),C=we((S=it(E,x=c,S,c=b))^C,(E=b)^P,16),c=we(I^(F=it(F,p,C,P=b)),(V=b)^c,63),p=b,I=h,x=_,h=we(C^(w=it(w,A,s,i)),P^(A=b),32),s=we((C=it(I,x,h,_=b))^s,(P=b)^i,24),i=it(i=w,A,s,w=b),a[e>>2]=i,A=b,a[e+4>>2]=A,i=we(i^h,A^_,16),a[e+120>>2]=i,A=b,a[e+124>>2]=A,i=it(C,P,i,A),a[e+80>>2]=i,A=b,a[e+84>>2]=A,K=e,H=we(i^s,A^w,63),a[K+40>>2]=H,a[e+44>>2]=b,s=l,w=we(k^(i=it(N,L,l,d)),B^(l=b),32),s=we(s^(k=it(F,V,w,A=b)),(h=d)^(d=b),24),i=it(i,h=l,s,l=b),a[e+8>>2]=i,B=b,a[e+12>>2]=B,i=we(i^w,A^B,16),a[e+96>>2]=i,w=b,a[e+100>>2]=w,i=it(k,d,i,w),a[e+88>>2]=i,d=b,a[e+92>>2]=d,K=e,H=we(i^s,l^d,63),a[K+48>>2]=H,a[e+52>>2]=b,s=c,d=we(Q^(i=it(m,T,c,p)),U^(l=b),32),s=we(s^(w=it(O,R,d,c=b)),(h=p)^(p=b),24),i=it(i,h=l,s,l=b),a[e+16>>2]=i,A=b,a[e+20>>2]=A,i=we(i^d,c^A,16),a[e+104>>2]=i,d=b,a[e+108>>2]=d,i=it(w,p,i,d),a[f>>2]=i,c=f,f=b,a[c+4>>2]=f,K=e,H=we(i^s,l^f,63),a[K+56>>2]=H,a[e+60>>2]=b,c=u,i=we(g^(u=it(S,E,u,o)),M^(s=b),32),f=we(c^(d=it(D,j,i,l=b)),(f=o)^(o=b),24),u=it(u,c=s,f,s=b),a[e+24>>2]=u,c=b,a[e+28>>2]=c,u=we(i^u,l^c,16),a[e+112>>2]=u,i=b,a[e+116>>2]=i,u=it(d,o,u,i),a[e+72>>2]=u,o=b,a[e+76>>2]=o,K=e,H=we(u^f,s^o,63),a[K+32>>2]=H,a[e+36>>2]=b,8!=(0|(v=v+1|0)););for(;f=a[(v=512+(e=(r+1024|0)+(t<<4)|0)|0)>>2],u=a[e+772>>2],l=f,c=a[v+4>>2],d=a[e+768>>2],v=a[e+256>>2],f=a[e+260>>2],s=we(d^(o=it(a[e>>2],a[e+4>>2],v,f)),(s=u)^(u=b),32),f=we(c=(l=it(l,c,s,i=b))^v,f^(v=b),24),d=v,w=we((c=it(o,u,f,v=b))^s,(p=b)^i,16),v=we(f^(k=it(l,d,w,A=b)),(B=b)^v,63),f=b,u=a[e+780>>2],h=a[e+520>>2],m=a[e+524>>2],d=a[e+776>>2],o=a[e+264>>2],s=a[e+268>>2],l=we(d^(i=it(a[e+8>>2],a[e+12>>2],o,s)),(l=u)^(u=b),32),s=we(h=(O=it(h,m,l,d=b))^o,s^(o=b),24),h=O,N=we((O=it(i,m=u,s,u=b))^l,(R=b)^d,16),u=we(s^(Q=it(h,o,N,L=b)),(U=b)^u,63),o=b,s=a[e+900>>2],m=a[e+640>>2],g=a[e+644>>2],S=a[e+896>>2],i=a[e+384>>2],l=a[e+388>>2],D=we(S^(d=it(a[e+128>>2],a[e+132>>2],i,l)),(h=s)^(s=b),32),l=we(h=(m=it(m,g,D,j=b))^i,l^(i=b),24),h=m,m=we((m=D)^(D=it(d,g=s,l,s=b)),(d=j)^(j=b),16),s=we(l^(g=it(h,i,m,T=b)),(M=b)^s,63),i=b,l=a[e+908>>2],I=a[e+648>>2],x=a[e+652>>2],E=a[e+904>>2],d=a[e+392>>2],h=a[e+396>>2],S=we(E^(_=it(a[e+136>>2],a[e+140>>2],d,h)),(S=l)^(l=b),32),I=h=we(I=(C=it(I,x,S,E=b))^d,h^(d=b),24),S=we((h=it(_,x=l,h,l=b))^S,(_=b)^E,16),l=we(I^(C=it(C,d,S,E=b)),(P=b)^l,63),d=b,I=g,x=M,g=we(S^(c=it(c,p,u,o)),E^(p=b),32),u=we((S=it(I,x,g,M=b))^u,(E=b)^o,24),o=it(o=c,p,u,c=b),a[e>>2]=o,p=b,a[e+4>>2]=p,o=we(o^g,p^M,16),a[e+904>>2]=o,p=b,a[e+908>>2]=p,o=it(S,E,o,p),a[e+640>>2]=o,p=b,a[e+644>>2]=p,K=e,H=we(o^u,c^p,63),a[K+264>>2]=H,a[e+268>>2]=b,u=s,c=we(w^(o=it(O,R,s,i)),A^(s=b),32),u=we(u^(w=it(C,P,c,p=b)),(g=i)^(i=b),24),o=it(o,g=s,u,s=b),a[e+8>>2]=o,A=b,a[e+12>>2]=A,o=we(o^c,p^A,16),a[e+768>>2]=o,c=b,a[e+772>>2]=c,o=it(w,i,o,c),a[e+648>>2]=o,i=b,a[e+652>>2]=i,K=e,H=we(o^u,i^s,63),a[K+384>>2]=H,a[e+388>>2]=b,u=l,i=we(N^(o=it(D,j,l,d)),L^(s=b),32),u=we(u^(c=it(k,B,i,l=b)),(g=d)^(d=b),24),o=it(o,g=s,u,s=b),a[e+128>>2]=o,p=b,a[e+132>>2]=p,o=we(i^o,l^p,16),a[e+776>>2]=o,i=b,a[e+780>>2]=i,o=it(c,d,o,i),a[e+512>>2]=o,i=b,a[e+516>>2]=i,K=e,H=we(o^u,i^s,63),a[K+392>>2]=H,a[e+396>>2]=b,u=it(h,_,v,f),l=it(Q,U,s=we(m^u,T^(o=b),32),i=b),f=it(c=u,o,v=we(l^v,(d=b)^f,24),u=b),a[e+136>>2]=f,o=b,a[e+140>>2]=o,f=we(s^f,i^o,16),a[e+896>>2]=f,o=b,a[e+900>>2]=o,f=it(l,d,f,o),a[e+520>>2]=f,o=b,a[e+524>>2]=o,K=e,H=we(f^v,o^u,63),a[K+256>>2]=H,a[e+260>>2]=b,8!=(0|(t=t+1|0)););yn(n,r),et(n,r+1024|0),y=r+2048|0}function O(e){var t=0,n=0,r=0,i=0,o=0,s=0,l=0,u=0,d=0;e:if(e|=0){o=(r=e-8|0)+(e=-8&(t=a[e-4>>2]))|0;t:if(!(1&t)){if(!(3&t))break e;if((r=r-(t=a[r>>2])|0)>>>0<c[8969])break e;if(e=e+t|0,a[8970]==(0|r)){if(3==(3&(t=a[o+4>>2])))return a[8967]=e,a[o+4>>2]=-2&t,a[r+4>>2]=1|e,void(a[e+r>>2]=e)}else{if(t>>>0<=255){if(i=a[r+8>>2],t=t>>>3|0,(0|(n=a[r+12>>2]))==(0|i)){u=35860,d=a[8965]&Et(-2,t),a[u>>2]=d;break t}a[i+12>>2]=n,a[n+8>>2]=i;break t}if(l=a[r+24>>2],(0|r)==(0|(t=a[r+12>>2])))if((n=a[(i=r+20|0)>>2])||(n=a[(i=r+16|0)>>2])){for(;s=i,(n=a[(i=(t=n)+20|0)>>2])||(i=t+16|0,n=a[t+16>>2]););a[s>>2]=0}else t=0;else n=a[r+8>>2],a[n+12>>2]=t,a[t+8>>2]=n;if(!l)break t;i=a[r+28>>2];n:{if(a[(n=36164+(i<<2)|0)>>2]==(0|r)){if(a[n>>2]=t,t)break n;u=35864,d=a[8966]&Et(-2,i),a[u>>2]=d;break t}if(a[l+(a[l+16>>2]==(0|r)?16:20)>>2]=t,!t)break t}if(a[t+24>>2]=l,(n=a[r+16>>2])&&(a[t+16>>2]=n,a[n+24>>2]=t),!(n=a[r+20>>2]))break t;a[t+20>>2]=n,a[n+24>>2]=t}}if(!(r>>>0>=o>>>0)&&1&(t=a[o+4>>2])){t:{if(!(2&t)){if(a[8971]==(0|o)){if(a[8971]=r,e=a[8968]+e|0,a[8968]=e,a[r+4>>2]=1|e,a[8970]!=(0|r))break e;return a[8967]=0,void(a[8970]=0)}if(a[8970]==(0|o))return a[8970]=r,e=a[8967]+e|0,a[8967]=e,a[r+4>>2]=1|e,void(a[e+r>>2]=e);e=(-8&t)+e|0;n:if(t>>>0<=255){if(i=a[o+8>>2],t=t>>>3|0,(0|(n=a[o+12>>2]))==(0|i)){u=35860,d=a[8965]&Et(-2,t),a[u>>2]=d;break n}a[i+12>>2]=n,a[n+8>>2]=i}else{if(l=a[o+24>>2],(0|o)==(0|(t=a[o+12>>2])))if((n=a[(i=o+20|0)>>2])||(n=a[(i=o+16|0)>>2])){for(;s=i,(n=a[(i=(t=n)+20|0)>>2])||(i=t+16|0,n=a[t+16>>2]););a[s>>2]=0}else t=0;else n=a[o+8>>2],a[n+12>>2]=t,a[t+8>>2]=n;if(l){i=a[o+28>>2];r:{if(a[(n=36164+(i<<2)|0)>>2]==(0|o)){if(a[n>>2]=t,t)break r;u=35864,d=a[8966]&Et(-2,i),a[u>>2]=d;break n}if(a[l+(a[l+16>>2]==(0|o)?16:20)>>2]=t,!t)break n}a[t+24>>2]=l,(n=a[o+16>>2])&&(a[t+16>>2]=n,a[n+24>>2]=t),(n=a[o+20>>2])&&(a[t+20>>2]=n,a[n+24>>2]=t)}}if(a[r+4>>2]=1|e,a[e+r>>2]=e,a[8970]!=(0|r))break t;return void(a[8967]=e)}a[o+4>>2]=-2&t,a[r+4>>2]=1|e,a[e+r>>2]=e}if(e>>>0<=255)return t=35900+((e=e>>>3|0)<<3)|0,(n=a[8965])&(e=1<<e)?e=a[t+8>>2]:(a[8965]=e|n,e=t),a[t+8>>2]=r,a[e+12>>2]=r,a[r+12>>2]=t,void(a[r+8>>2]=e);i=31,a[r+16>>2]=0,a[r+20>>2]=0,e>>>0<=16777215&&(t=e>>>8|0,t<<=s=t+1048320>>>16&8,i=28+((t=((t<<=i=t+520192>>>16&4)<<(n=t+245760>>>16&2)>>>15|0)-(n|i|s)|0)<<1|e>>>t+21&1)|0),a[r+28>>2]=i,s=36164+(i<<2)|0;t:{n:{if((n=a[8966])&(t=1<<i)){for(i=e<<(31==(0|i)?0:25-(i>>>1|0)|0),t=a[s>>2];;){if(n=t,(-8&a[t+4>>2])==(0|e))break n;if(t=i>>>29|0,i<<=1,!(t=a[16+(s=n+(4&t)|0)>>2]))break}a[s+16>>2]=r,a[r+24>>2]=n}else a[8966]=t|n,a[s>>2]=r,a[r+24>>2]=s;a[r+12>>2]=r,a[r+8>>2]=r;break t}e=a[n+8>>2],a[e+12>>2]=r,a[n+8>>2]=r,a[r+24>>2]=0,a[r+12>>2]=n,a[r+8>>2]=e}e=a[8973]-1|0,a[8973]=e||-1}}}function N(e,t,n,r,i){var s,c,u,d,h,p,f,g,m,v,A,b,w,S,C,E=0,I=0,_=0,x=0,P=0,k=0,B=0,O=0,N=0,D=0,j=0,T=0,M=0,F=0,R=0,L=0,Q=0,U=0,V=0,K=0,H=0,G=0,Y=0,z=0,Z=0,W=0,q=0,J=0,X=0,$=0,ee=0,te=0,ne=0,re=0;for(y=s=y+-64|0,c=a[e+60>>2],u=a[e+56>>2],V=a[e+52>>2],Q=a[e+48>>2],d=a[e+44>>2],h=a[e+40>>2],p=a[e+36>>2],f=a[e+32>>2],g=a[e+28>>2],m=a[e+24>>2],v=a[e+20>>2],A=a[e+16>>2],b=a[e+12>>2],w=a[e+8>>2],S=a[e+4>>2],C=a[e>>2];;){if(!i&r>>>0>63|i)I=n;else{if(x=0,I=vt(s,0,64),r|i)for(;o[I+x|0]=l[t+x|0],!i&(x=x+1|0)>>>0<r>>>0|i;);t=I,G=n}for(K=20,O=C,N=S,D=w,j=b,x=A,P=v,n=m,T=g,k=f,B=p,M=h,F=c,L=u,E=V,_=Q,U=d;R=x,O=mn((x=x+O|0)^_,16),_=mn(R^(k=O+k|0),12),R=k,k=mn((k=O)^(O=x+_|0),8),x=mn(_^(R=R+k|0),7),_=P,N=mn((P=P+N|0)^E,16),E=mn(_^(B=N+B|0),12),_=B,B=mn((B=N)^(N=P+E|0),8),P=mn(E^(H=_+B|0),7),E=n,D=mn((n=n+D|0)^L,16),E=L=mn(E^(M=D+M|0),12),L=mn((_=D)^(D=n+L|0),8),n=mn(E^(M=L+M|0),7),E=T,j=mn((T=T+j|0)^F,16),_=E=mn(E^(F=j+U|0),12),U=F,F=mn((F=j)^(j=T+E|0),8),T=mn(_^(E=U+F|0),7),_=M,M=mn((O=P+O|0)^F,16),P=mn((_=_+M|0)^P,12),F=mn(M^(O=P+O|0),8),P=mn(P^(M=_+F|0),7),k=mn((N=n+N|0)^k,16),n=mn((E=k+E|0)^n,12),_=mn(k^(N=n+N|0),8),n=mn(n^(U=E+_|0),7),k=mn((D=T+D|0)^B,16),T=mn((B=k+R|0)^T,12),E=mn(k^(D=T+D|0),8),T=mn(T^(k=B+E|0),7),B=mn((j=x+j|0)^L,16),x=mn((R=B+H|0)^x,12),L=mn(B^(j=x+j|0),8),x=mn(x^(B=R+L|0),7),K=K-2|0;);if(K=l[t+4|0]|l[t+5|0]<<8|l[t+6|0]<<16|l[t+7|0]<<24,R=l[t+8|0]|l[t+9|0]<<8|l[t+10|0]<<16|l[t+11|0]<<24,H=l[t+12|0]|l[t+13|0]<<8|l[t+14|0]<<16|l[t+15|0]<<24,Y=l[t+16|0]|l[t+17|0]<<8|l[t+18|0]<<16|l[t+19|0]<<24,z=l[t+20|0]|l[t+21|0]<<8|l[t+22|0]<<16|l[t+23|0]<<24,Z=l[t+24|0]|l[t+25|0]<<8|l[t+26|0]<<16|l[t+27|0]<<24,W=l[t+28|0]|l[t+29|0]<<8|l[t+30|0]<<16|l[t+31|0]<<24,q=l[t+32|0]|l[t+33|0]<<8|l[t+34|0]<<16|l[t+35|0]<<24,J=l[t+36|0]|l[t+37|0]<<8|l[t+38|0]<<16|l[t+39|0]<<24,X=l[t+40|0]|l[t+41|0]<<8|l[t+42|0]<<16|l[t+43|0]<<24,$=l[t+44|0]|l[t+45|0]<<8|l[t+46|0]<<16|l[t+47|0]<<24,ee=l[t+48|0]|l[t+49|0]<<8|l[t+50|0]<<16|l[t+51|0]<<24,te=l[t+52|0]|l[t+53|0]<<8|l[t+54|0]<<16|l[t+55|0]<<24,ne=l[t+56|0]|l[t+57|0]<<8|l[t+58|0]<<16|l[t+59|0]<<24,re=l[t+60|0]|l[t+61|0]<<8|l[t+62|0]<<16|l[t+63|0]<<24,Ot(I,O+C^(l[0|t]|l[t+1|0]<<8|l[t+2|0]<<16|l[t+3|0]<<24)),Ot(I+4|0,N+S^K),Ot(I+8|0,D+w^R),Ot(I+12|0,j+b^H),Ot(I+16|0,x+A^Y),Ot(I+20|0,P+v^z),Ot(I+24|0,n+m^Z),Ot(I+28|0,T+g^W),Ot(I+32|0,k+f^q),Ot(I+36|0,B+p^J),Ot(I+40|0,X^M+h),Ot(I+44|0,$^U+d),Ot(I+48|0,ee^_+Q),Ot(I+52|0,te^E+V),Ot(I+56|0,ne^L+u),Ot(I+60|0,re^F+c),V=((Q=(n=Q)+1|0)>>>0<n>>>0)+V|0,!i&r>>>0<=64){if(!(!r|!i&r>>>0>63|0!=(0|i)))for(P=0;o[P+G|0]=l[I+P|0],(0|r)!=(0|(P=P+1|0)););a[e+52>>2]=V,a[e+48>>2]=Q,y=s- -64|0;break}t=t- -64|0,n=I- -64|0,i=i-1|0,i=(r=r+-64|0)>>>0<4294967232?i+1|0:i}}function D(e,t){var n,r=0,i=0,o=0,s=0,l=0,c=0,u=0;n=e+t|0;e:{t:if(!(1&(r=a[e+4>>2]))){if(!(3&r))break e;t=(r=a[e>>2])+t|0;n:{if((0|(e=e-r|0))!=a[8970]){if(r>>>0<=255){if(o=a[e+8>>2],r=r>>>3|0,(0|(i=a[e+12>>2]))!=(0|o))break n;c=35860,u=a[8965]&Et(-2,r),a[c>>2]=u;break t}if(l=a[e+24>>2],(0|(r=a[e+12>>2]))==(0|e))if((i=a[(o=e+20|0)>>2])||(i=a[(o=e+16|0)>>2])){for(;s=o,(i=a[(o=(r=i)+20|0)>>2])||(o=r+16|0,i=a[r+16>>2]););a[s>>2]=0}else r=0;else i=a[e+8>>2],a[i+12>>2]=r,a[r+8>>2]=i;if(!l)break t;o=a[e+28>>2];r:{if(a[(i=36164+(o<<2)|0)>>2]==(0|e)){if(a[i>>2]=r,r)break r;c=35864,u=a[8966]&Et(-2,o),a[c>>2]=u;break t}if(a[l+(a[l+16>>2]==(0|e)?16:20)>>2]=r,!r)break t}if(a[r+24>>2]=l,(i=a[e+16>>2])&&(a[r+16>>2]=i,a[i+24>>2]=r),!(i=a[e+20>>2]))break t;a[r+20>>2]=i,a[i+24>>2]=r;break t}if(3!=(3&(r=a[n+4>>2])))break t;return a[8967]=t,a[n+4>>2]=-2&r,a[e+4>>2]=1|t,void(a[n>>2]=t)}a[o+12>>2]=i,a[i+8>>2]=o}t:{if(!(2&(r=a[n+4>>2]))){if(a[8971]==(0|n)){if(a[8971]=e,t=a[8968]+t|0,a[8968]=t,a[e+4>>2]=1|t,a[8970]!=(0|e))break e;return a[8967]=0,void(a[8970]=0)}if(a[8970]==(0|n))return a[8970]=e,t=a[8967]+t|0,a[8967]=t,a[e+4>>2]=1|t,void(a[e+t>>2]=t);t=(-8&r)+t|0;n:if(r>>>0<=255){if(o=a[n+8>>2],r=r>>>3|0,(0|(i=a[n+12>>2]))==(0|o)){c=35860,u=a[8965]&Et(-2,r),a[c>>2]=u;break n}a[o+12>>2]=i,a[i+8>>2]=o}else{if(l=a[n+24>>2],(0|n)==(0|(r=a[n+12>>2])))if((o=a[(i=n+20|0)>>2])||(o=a[(i=n+16|0)>>2])){for(;s=i,(o=a[(i=(r=o)+20|0)>>2])||(i=r+16|0,o=a[r+16>>2]););a[s>>2]=0}else r=0;else i=a[n+8>>2],a[i+12>>2]=r,a[r+8>>2]=i;if(l){o=a[n+28>>2];r:{if(a[(i=36164+(o<<2)|0)>>2]==(0|n)){if(a[i>>2]=r,r)break r;c=35864,u=a[8966]&Et(-2,o),a[c>>2]=u;break n}if(a[l+(a[l+16>>2]==(0|n)?16:20)>>2]=r,!r)break n}a[r+24>>2]=l,(i=a[n+16>>2])&&(a[r+16>>2]=i,a[i+24>>2]=r),(i=a[n+20>>2])&&(a[r+20>>2]=i,a[i+24>>2]=r)}}if(a[e+4>>2]=1|t,a[e+t>>2]=t,a[8970]!=(0|e))break t;return void(a[8967]=t)}a[n+4>>2]=-2&r,a[e+4>>2]=1|t,a[e+t>>2]=t}if(t>>>0<=255)return r=35900+((t=t>>>3|0)<<3)|0,(i=a[8965])&(t=1<<t)?t=a[r+8>>2]:(a[8965]=t|i,t=r),a[r+8>>2]=e,a[t+12>>2]=e,a[e+12>>2]=r,void(a[e+8>>2]=t);o=31,a[e+16>>2]=0,a[e+20>>2]=0,t>>>0<=16777215&&(r=t>>>8|0,r<<=s=r+1048320>>>16&8,o=28+((r=((r<<=o=r+520192>>>16&4)<<(i=r+245760>>>16&2)>>>15|0)-(i|o|s)|0)<<1|t>>>r+21&1)|0),a[e+28>>2]=o,s=36164+(o<<2)|0;t:{if((i=a[8966])&(r=1<<o)){for(o=t<<(31==(0|o)?0:25-(o>>>1|0)|0),r=a[s>>2];;){if(i=r,(-8&a[r+4>>2])==(0|t))break t;if(r=o>>>29|0,o<<=1,!(r=a[16+(s=i+(4&r)|0)>>2]))break}a[s+16>>2]=e,a[e+24>>2]=i}else a[8966]=r|i,a[s>>2]=e,a[e+24>>2]=s;return a[e+12>>2]=e,void(a[e+8>>2]=e)}t=a[i+8>>2],a[t+12>>2]=e,a[i+8>>2]=e,a[e+24>>2]=0,a[e+12>>2]=i,a[e+8>>2]=t}}function j(e,t,n,r){var i=0,o=0,s=0,c=0,d=0,h=0,p=0,f=0,g=0,m=0,y=0,v=0,A=0,w=0,S=0,C=0,E=0,I=0,_=0,x=0,P=0,k=0,B=0,O=0,N=0;if(g=a[e+36>>2],c=a[e+32>>2],s=a[e+28>>2],o=a[e+24>>2],d=a[e+20>>2],!r&n>>>0>=16|r)for(P=!l[e+80|0]<<24,y=a[e+4>>2],k=u(y,5),w=a[e+8>>2],x=u(w,5),I=a[e+12>>2],_=u(I,5),i=a[e+16>>2],S=u(i,5),B=i,v=a[e>>2];i=ze(h=((l[t+3|0]|l[t+4|0]<<8|l[t+5|0]<<16|l[t+6|0]<<24)>>>2&67108863)+o|0,0,I,0),p=b,o=(m=ze(d=(67108863&(l[0|t]|l[t+1|0]<<8|l[t+2|0]<<16|l[t+3|0]<<24))+d|0,0,B,0))+i|0,i=b+p|0,i=o>>>0<m>>>0?i+1|0:i,f=o,o=ze(p=((l[t+6|0]|l[t+7|0]<<8|l[t+8|0]<<16|l[t+9|0]<<24)>>>4&67108863)+s|0,0,w,0),i=b+i|0,i=o>>>0>(s=f+o|0)>>>0?i+1|0:i,o=s,s=ze(m=((l[t+9|0]|l[t+10|0]<<8|l[t+11|0]<<16|l[t+12|0]<<24)>>>6|0)+c|0,0,y,0),i=b+i|0,i=s>>>0>(c=o+s|0)>>>0?i+1|0:i,o=c,c=ze(A=g+P+((l[t+12|0]|l[t+13|0]<<8|l[t+14|0]<<16|l[t+15|0]<<24)>>>8)|0,0,v,0),i=b+i|0,O=g=o+c|0,g=c>>>0>g>>>0?i+1|0:i,i=ze(h,0,w,0),s=b,c=(o=ze(d,0,I,0))+i|0,i=b+s|0,i=o>>>0>c>>>0?i+1|0:i,s=ze(p,0,y,0),i=b+i|0,i=s>>>0>(c=s+c|0)>>>0?i+1|0:i,s=ze(m,0,v,0),i=b+i|0,i=s>>>0>(c=s+c|0)>>>0?i+1|0:i,s=ze(A,0,S,0),i=b+i|0,N=c=s+c|0,c=s>>>0>c>>>0?i+1|0:i,i=ze(h,0,y,0),o=b,s=(C=ze(d,0,w,0))+i|0,i=b+o|0,i=s>>>0<C>>>0?i+1|0:i,o=ze(p,0,v,0),i=b+i|0,i=o>>>0>(s=o+s|0)>>>0?i+1|0:i,o=ze(m,0,S,0),i=b+i|0,i=o>>>0>(s=o+s|0)>>>0?i+1|0:i,o=ze(A,0,_,0),i=b+i|0,C=s=o+s|0,s=o>>>0>s>>>0?i+1|0:i,i=ze(h,0,v,0),f=b,o=(E=ze(d,0,y,0))+i|0,i=b+f|0,i=o>>>0<E>>>0?i+1|0:i,f=ze(p,0,S,0),i=b+i|0,i=(o=f+o|0)>>>0<f>>>0?i+1|0:i,f=ze(m,0,_,0),i=b+i|0,i=(o=f+o|0)>>>0<f>>>0?i+1|0:i,f=ze(A,0,x,0),i=b+i|0,i=(o=f+o|0)>>>0<f>>>0?i+1|0:i,f=o,o=i,i=ze(h,0,S,0),E=b,h=(d=ze(d,0,v,0))+i|0,i=b+E|0,i=h>>>0<d>>>0?i+1|0:i,d=ze(p,0,_,0),i=b+i|0,i=(h=d+h|0)>>>0<d>>>0?i+1|0:i,d=ze(m,0,x,0),i=b+i|0,i=(h=d+h|0)>>>0<d>>>0?i+1|0:i,d=ze(A,0,k,0),i=b+i|0,i=(h=d+h|0)>>>0<d>>>0?i+1|0:i,d=h,p=(67108863&i)<<6|h>>>26,i=o,p=(67108863&(i=(h=p+f|0)>>>0<p>>>0?i+1|0:i))<<6|(o=h)>>>26,i=s,i=(o=p+C|0)>>>0<p>>>0?i+1|0:i,p=o,o=(67108863&i)<<6|o>>>26,i=c,m=s=o+N|0,s=(67108863&(i=o>>>0>s>>>0?i+1|0:i))<<6|s>>>26,i=g,g=c=s+O|0,o=(67108863&h)+((i=u((67108863&(s>>>0>c>>>0?i+1|0:i))<<6|c>>>26,5)+(67108863&d)|0)>>>26|0)|0,s=67108863&p,c=67108863&m,g&=67108863,d=67108863&i,t=t+16|0,!(r=r-(n>>>0<16)|0)&(n=n-16|0)>>>0>15|r;);a[e+20>>2]=d,a[e+36>>2]=g,a[e+32>>2]=c,a[e+28>>2]=s,a[e+24>>2]=o}function T(e,t,n){var r,i,s,a,c=0,u=0,d=0,h=0,p=0;return y=s=y-160|0,It(t,n,32,0),o[0|t]=248&l[0|t],o[t+31|0]=63&l[t+31|0]|64,re(s,t),tt(e,s),u=l[(i=n)+8|0]|l[i+9|0]<<8|l[i+10|0]<<16|l[i+11|0]<<24,c=l[i+12|0]|l[i+13|0]<<8|l[i+14|0]<<16|l[i+15|0]<<24,d=l[i+16|0]|l[i+17|0]<<8|l[i+18|0]<<16|l[i+19|0]<<24,h=l[i+20|0]|l[i+21|0]<<8|l[i+22|0]<<16|l[i+23|0]<<24,p=l[0|i]|l[i+1|0]<<8|l[i+2|0]<<16|l[i+3|0]<<24,n=l[i+4|0]|l[i+5|0]<<8|l[i+6|0]<<16|l[i+7|0]<<24,a=l[i+28|0]|l[i+29|0]<<8|l[i+30|0]<<16|l[i+31|0]<<24,r=t,t=l[i+24|0]|l[i+25|0]<<8|l[i+26|0]<<16|l[i+27|0]<<24,o[r+24|0]=t,o[r+25|0]=t>>>8,o[r+26|0]=t>>>16,o[r+27|0]=t>>>24,o[r+28|0]=a,o[r+29|0]=a>>>8,o[r+30|0]=a>>>16,o[r+31|0]=a>>>24,o[r+16|0]=d,o[r+17|0]=d>>>8,o[r+18|0]=d>>>16,o[r+19|0]=d>>>24,o[r+20|0]=h,o[r+21|0]=h>>>8,o[r+22|0]=h>>>16,o[r+23|0]=h>>>24,o[r+8|0]=u,o[r+9|0]=u>>>8,o[r+10|0]=u>>>16,o[r+11|0]=u>>>24,o[r+12|0]=c,o[r+13|0]=c>>>8,o[r+14|0]=c>>>16,o[r+15|0]=c>>>24,o[0|r]=p,o[r+1|0]=p>>>8,o[r+2|0]=p>>>16,o[r+3|0]=p>>>24,o[r+4|0]=n,o[r+5|0]=n>>>8,o[r+6|0]=n>>>16,o[r+7|0]=n>>>24,d=l[(c=e)+8|0]|l[c+9|0]<<8|l[c+10|0]<<16|l[c+11|0]<<24,h=l[c+12|0]|l[c+13|0]<<8|l[c+14|0]<<16|l[c+15|0]<<24,p=l[c+16|0]|l[c+17|0]<<8|l[c+18|0]<<16|l[c+19|0]<<24,n=l[c+20|0]|l[c+21|0]<<8|l[c+22|0]<<16|l[c+23|0]<<24,t=l[0|c]|l[c+1|0]<<8|l[c+2|0]<<16|l[c+3|0]<<24,e=l[c+4|0]|l[c+5|0]<<8|l[c+6|0]<<16|l[c+7|0]<<24,u=l[c+28|0]|l[c+29|0]<<8|l[c+30|0]<<16|l[c+31|0]<<24,c=l[c+24|0]|l[c+25|0]<<8|l[c+26|0]<<16|l[c+27|0]<<24,o[r+56|0]=c,o[r+57|0]=c>>>8,o[r+58|0]=c>>>16,o[r+59|0]=c>>>24,o[r+60|0]=u,o[r+61|0]=u>>>8,o[r+62|0]=u>>>16,o[r+63|0]=u>>>24,o[r+48|0]=p,o[r+49|0]=p>>>8,o[r+50|0]=p>>>16,o[r+51|0]=p>>>24,o[r+52|0]=n,o[r+53|0]=n>>>8,o[r+54|0]=n>>>16,o[r+55|0]=n>>>24,o[r+40|0]=d,o[r+41|0]=d>>>8,o[r+42|0]=d>>>16,o[r+43|0]=d>>>24,o[r+44|0]=h,o[r+45|0]=h>>>8,o[r+46|0]=h>>>16,o[r+47|0]=h>>>24,o[r+32|0]=t,o[r+33|0]=t>>>8,o[r+34|0]=t>>>16,o[r+35|0]=t>>>24,o[r+36|0]=e,o[r+37|0]=e>>>8,o[r+38|0]=e>>>16,o[r+39|0]=e>>>24,y=s+160|0,0}function M(e,t,n){var r,i=0,s=0;y=r=y+-64|0;e:{if((n-65&255)>>>0>191){if(i=-1,!(l[e+80|0]|l[e+81|0]<<8|l[e+82|0]<<16|l[e+83|0]<<24|l[e+84|0]|l[e+85|0]<<8|l[e+86|0]<<16|l[e+87|0]<<24)){if((i=l[e+352|0]|l[e+353|0]<<8|l[e+354|0]<<16|l[e+355|0]<<24)>>>0>=129){if(ie(e,128),w(e,s=e+96|0),i=(l[e+352|0]|l[e+353|0]<<8|l[e+354|0]<<16|l[e+355|0]<<24)-128|0,o[e+352|0]=i,o[e+353|0]=i>>>8,o[e+354|0]=i>>>16,o[e+355|0]=i>>>24,i>>>0>=129)break e;pt(s,e+224|0,i),i=l[e+352|0]|l[e+353|0]<<8|l[e+354|0]<<16|l[e+355|0]<<24}ie(e,i),l[e+356|0]&&(o[e+88|0]=255,o[e+89|0]=255,o[e+90|0]=255,o[e+91|0]=255,o[e+92|0]=255,o[e+93|0]=255,o[e+94|0]=255,o[e+95|0]=255),o[e+80|0]=255,o[e+81|0]=255,o[e+82|0]=255,o[e+83|0]=255,o[e+84|0]=255,o[e+85|0]=255,o[e+86|0]=255,o[e+87|0]=255,vt((i=e+96|0)+(s=l[e+352|0]|l[e+353|0]<<8|l[e+354|0]<<16|l[e+355|0]<<24)|0,0,256-s|0),w(e,i),ot(r,l[0|e]|l[e+1|0]<<8|l[e+2|0]<<16|l[e+3|0]<<24,l[e+4|0]|l[e+5|0]<<8|l[e+6|0]<<16|l[e+7|0]<<24),ot(8|r,l[e+8|0]|l[e+9|0]<<8|l[e+10|0]<<16|l[e+11|0]<<24,l[e+12|0]|l[e+13|0]<<8|l[e+14|0]<<16|l[e+15|0]<<24),ot(r+16|0,l[e+16|0]|l[e+17|0]<<8|l[e+18|0]<<16|l[e+19|0]<<24,l[e+20|0]|l[e+21|0]<<8|l[e+22|0]<<16|l[e+23|0]<<24),ot(r+24|0,l[e+24|0]|l[e+25|0]<<8|l[e+26|0]<<16|l[e+27|0]<<24,l[e+28|0]|l[e+29|0]<<8|l[e+30|0]<<16|l[e+31|0]<<24),ot(r+32|0,l[e+32|0]|l[e+33|0]<<8|l[e+34|0]<<16|l[e+35|0]<<24,l[e+36|0]|l[e+37|0]<<8|l[e+38|0]<<16|l[e+39|0]<<24),ot(r+40|0,l[e+40|0]|l[e+41|0]<<8|l[e+42|0]<<16|l[e+43|0]<<24,l[e+44|0]|l[e+45|0]<<8|l[e+46|0]<<16|l[e+47|0]<<24),ot(r+48|0,l[e+48|0]|l[e+49|0]<<8|l[e+50|0]<<16|l[e+51|0]<<24,l[e+52|0]|l[e+53|0]<<8|l[e+54|0]<<16|l[e+55|0]<<24),ot(r+56|0,l[e+56|0]|l[e+57|0]<<8|l[e+58|0]<<16|l[e+59|0]<<24,l[e+60|0]|l[e+61|0]<<8|l[e+62|0]<<16|l[e+63|0]<<24),pt(t,r,n),bn(e,64),bn(i,256),i=0}return y=r- -64|0,i}Ut(),h()}p(1299,1161,306,1086),h()}function F(e,t){var n,r,i,o,s,c,u,d,h,p=0,f=0,g=0,m=0,y=0,v=0,A=0,w=0,S=0,C=0;n=l[0|t]|l[t+1|0]<<8|l[t+2|0]<<16|l[t+3|0]<<24,S=St(t+4|0),p=b,v=St(t+7|0),m=b,w=St(t+10|0),f=b,r=St(t+13|0),y=b,g=l[t+16|0]|l[t+17|0]<<8|l[t+18|0]<<16|l[t+19|0]<<24,i=St(t+20|0),o=b,s=St(t+23|0),c=b,u=St(t+26|0),d=b,h=St(t+29|0),t=f<<3|w>>>29,C=f=w<<3,w=f=f+16777216|0,f=t=f>>>0<16777216?t+1|0:t,A=v<<5,m=t=m<<5|v>>>27,p=t=p<<6|(v=S)>>>26,S=t=16777216+(v<<=6)|0,t=(t=(p=t>>>0<16777216?p+1|0:p)>>25)+m|0,t=(p=A+(A=(33554431&p)<<7|S>>>25)|0)>>>0<A>>>0?t+1|0:t,t=(C-(-33554432&w)|0)+((67108863&(t=(m=p+33554432|0)>>>0<33554432?t+1|0:t))<<6|m>>>26)|0,a[e+12>>2]=t,t=-67108864&m,a[e+8>>2]=p-t,t=0,m=g=(p=g)+16777216|0,g=t=g>>>0<16777216?1:t,C=p-(-33554432&m)|0,t=y<<2|(p=r)>>>30,y=p<<2,p=t,t=(t=f>>25)+p|0,p=t=(f=(A=y)+(y=(33554431&f)<<7|w>>>25)|0)>>>0<y>>>0?t+1|0:t,y=t=f+33554432|0,t=((67108863&(p=t>>>0<33554432?p+1|0:p))<<6|t>>>26)+C|0,a[e+20>>2]=t,t=-67108864&y,a[e+16>>2]=f-t,f=(p=i)<<7,t=(t=o<<7|p>>>25)+(p=g>>25)|0,t=(f=f+(g=(33554431&g)<<7|m>>>25)|0)>>>0<g>>>0?t+1|0:t,f=p=f,g=p=p+33554432|0,p=t=p>>>0<33554432?t+1|0:t,t=-67108864&g,a[e+24>>2]=f-t,t=c<<5|(f=s)>>>27,y=f<<=5,m=f=f+16777216|0,f=t=f>>>0<16777216?t+1|0:t,t=(y-(-33554432&m)|0)+((67108863&p)<<6|g>>>26)|0,a[e+28>>2]=t,g=(p=u)<<4,p=t=d<<4|p>>>28,t=(t=f>>25)+p|0,t=(f=(y=g)+(g=(33554431&f)<<7|m>>>25)|0)>>>0<g>>>0?t+1|0:t,f=p=f,g=p=p+33554432|0,p=t=p>>>0<33554432?t+1|0:t,t=-67108864&g,a[e+32>>2]=f-t,t=0,m=f=(f=h)<<2&33554428,t=(f=f+16777216|0)>>>0<16777216?t+1|0:t,p=(m-(33554432&f)|0)+((67108863&p)<<6|g>>>26)|0,a[e+36>>2]=p,f=ze((33554431&t)<<7|f>>>25,t>>>25|0,19,0),t=b,t=(p=f+n|0)>>>0<f>>>0?t+1|0:t,t=(v-(-33554432&S)|0)+((67108863&(t=(f=p+33554432|0)>>>0<33554432?t+1|0:t))<<6|f>>>26)|0,a[e+4>>2]=t,t=e,e=-67108864&f,a[t>>2]=p-e}function R(e,t,n,r){var i,s=0;i=s=y,y=s=s-576&-64,a[s+188>>2]=0,Ot(s+188|0,t);e:if(t>>>0<=64){if((0|Je(s+192|0,0,0,t))<0)break e;if((0|on(s+192|0,s+188|0,4,0))<0)break e;if((0|on(s+192|0,n,r,0))<0)break e;kt(s+192|0,e,t)}else if(!((0|Je(s+192|0,0,0,64))<0||(0|on(s+192|0,s+188|0,4,0))<0||(0|on(s+192|0,n,r,0))<0||(0|kt(s+192|0,s+112|0,64))<0)){if(n=a[s+116>>2],r=a[s+112>>2],o[0|e]=r,o[e+1|0]=r>>>8,o[e+2|0]=r>>>16,o[e+3|0]=r>>>24,o[e+4|0]=n,o[e+5|0]=n>>>8,o[e+6|0]=n>>>16,o[e+7|0]=n>>>24,n=a[s+124>>2],r=a[s+120>>2],o[e+8|0]=r,o[e+9|0]=r>>>8,o[e+10|0]=r>>>16,o[e+11|0]=r>>>24,o[e+12|0]=n,o[e+13|0]=n>>>8,o[e+14|0]=n>>>16,o[e+15|0]=n>>>24,n=a[s+140>>2],r=a[s+136>>2],o[e+24|0]=r,o[e+25|0]=r>>>8,o[e+26|0]=r>>>16,o[e+27|0]=r>>>24,o[e+28|0]=n,o[e+29|0]=n>>>8,o[e+30|0]=n>>>16,o[e+31|0]=n>>>24,n=a[s+132>>2],r=a[s+128>>2],o[e+16|0]=r,o[e+17|0]=r>>>8,o[e+18|0]=r>>>16,o[e+19|0]=r>>>24,o[e+20|0]=n,o[e+21|0]=n>>>8,o[e+22|0]=n>>>16,o[e+23|0]=n>>>24,e=e+32|0,(t=t-32|0)>>>0>=65)for(;;){if(pt(n=s+48|0,r=s+112|0,64),(0|De(r,64,n,64,0,0,0))<0)break e;if(n=a[s+116>>2],r=a[s+112>>2],o[0|e]=r,o[e+1|0]=r>>>8,o[e+2|0]=r>>>16,o[e+3|0]=r>>>24,o[e+4|0]=n,o[e+5|0]=n>>>8,o[e+6|0]=n>>>16,o[e+7|0]=n>>>24,n=a[s+124>>2],r=a[s+120>>2],o[e+8|0]=r,o[e+9|0]=r>>>8,o[e+10|0]=r>>>16,o[e+11|0]=r>>>24,o[e+12|0]=n,o[e+13|0]=n>>>8,o[e+14|0]=n>>>16,o[e+15|0]=n>>>24,n=a[s+140>>2],r=a[s+136>>2],o[e+24|0]=r,o[e+25|0]=r>>>8,o[e+26|0]=r>>>16,o[e+27|0]=r>>>24,o[e+28|0]=n,o[e+29|0]=n>>>8,o[e+30|0]=n>>>16,o[e+31|0]=n>>>24,n=a[s+132>>2],r=a[s+128>>2],o[e+16|0]=r,o[e+17|0]=r>>>8,o[e+18|0]=r>>>16,o[e+19|0]=r>>>24,o[e+20|0]=n,o[e+21|0]=n>>>8,o[e+22|0]=n>>>16,o[e+23|0]=n>>>24,e=e+32|0,!((t=t-32|0)>>>0>64))break}pt(n=s+48|0,r=s+112|0,64),(0|De(r,t,n,64,0,0,0))<0||pt(e,s+112|0,t)}bn(s+192|0,384),y=i}function L(e,t,n){var r,i,o,s,a,c,u,d,h,p,f,g,m=0,y=0,v=0,A=0,b=0,w=0,S=0,C=0,E=0,I=0,_=0,x=0,P=0,k=0,B=0,O=0,N=0,D=0,j=0,T=0,M=0;for(r=l[n+4|0]|l[n+5|0]<<8|l[n+6|0]<<16|l[n+7|0]<<24,i=l[n+8|0]|l[n+9|0]<<8|l[n+10|0]<<16|l[n+11|0]<<24,o=l[n+12|0]|l[n+13|0]<<8|l[n+14|0]<<16|l[n+15|0]<<24,s=l[n+16|0]|l[n+17|0]<<8|l[n+18|0]<<16|l[n+19|0]<<24,a=l[n+20|0]|l[n+21|0]<<8|l[n+22|0]<<16|l[n+23|0]<<24,c=l[n+24|0]|l[n+25|0]<<8|l[n+26|0]<<16|l[n+27|0]<<24,u=l[n+28|0]|l[n+29|0]<<8|l[n+30|0]<<16|l[n+31|0]<<24,_=1634760805,n=d=l[0|n]|l[n+1|0]<<8|l[n+2|0]<<16|l[n+3|0]<<24,v=r,B=i,A=o,x=857760878,b=h=l[0|t]|l[t+1|0]<<8|l[t+2|0]<<16|l[t+3|0]<<24,w=p=l[t+4|0]|l[t+5|0]<<8|l[t+6|0]<<16|l[t+7|0]<<24,S=f=l[t+8|0]|l[t+9|0]<<8|l[t+10|0]<<16|l[t+11|0]<<24,I=g=l[t+12|0]|l[t+13|0]<<8|l[t+14|0]<<16|l[t+15|0]<<24,P=2036477234,t=s,C=1797285236,E=u,m=c,y=a;A=mn(y+_|0,7)^A,S=mn(A+_|0,9)^S,O=mn(S+A|0,13)^y,j=mn(S+O|0,18),y=mn(n+x|0,7)^I,k=mn(y+x|0,9)^m,n=mn(y+k|0,13)^n,I=mn(k+n|0,18),E=mn(b+P|0,7)^E,v=mn(E+P|0,9)^v,b=mn(E+v|0,13)^b,T=mn(v+b|0,18),m=mn(t+C|0,7)^B,w=mn(m+C|0,9)^w,N=mn(m+w|0,13)^t,M=mn(w+N|0,18),n=mn((t=_^j)+m|0,7)^n,v=mn(n+t|0,9)^v,B=mn(n+v|0,13)^m,_=mn(v+B|0,18)^t,b=mn((t=x^I)+A|0,7)^b,w=mn(b+t|0,9)^w,A=mn(w+b|0,13)^A,x=mn(w+A|0,18)^t,t=mn((m=P^T)+y|0,7)^N,S=mn(t+m|0,9)^S,I=mn(t+S|0,13)^y,P=mn(S+I|0,18)^m,y=mn((C^=M)+E|0,7)^O,m=mn(y+C|0,9)^k,E=mn(m+y|0,13)^E,C=mn(m+E|0,18)^C,k=D>>>0<18,D=D+2|0,k;);Ot(e,_+1634760805|0),Ot(e+4|0,n+d|0),Ot(e+8|0,v+r|0),Ot(e+12|0,B+i|0),Ot(e+16|0,A+o|0),Ot(e+20|0,x+857760878|0),Ot(e+24|0,b+h|0),Ot(e+28|0,w+p|0),Ot(e+32|0,S+f|0),Ot(e+36|0,I+g|0),Ot(e+40|0,P+2036477234|0),Ot(e+44|0,t+s|0),Ot(e+48|0,y+a|0),Ot(e+52|0,m+c|0),Ot(e+56|0,E+u|0),Ot(e+60|0,C+1797285236|0)}function Q(e,t,n,r,i,s){var a,c=0,d=0,h=0,p=0,f=0,g=0,m=0,v=0,A=0;for(y=a=y-592|0,p=-1,f=e+32|0,c=32,d=1;h=(g=l[f+(c=c-1|0)|0])-(m=l[c+2752|0])>>8&d|255&h,d&=65535+(g^m)>>>8,c;);if(h&&!ye(e)){for(c=127&(-1^l[i+31|0]),h=30;c=-1^l[i+h|0]|c,h=h-1|0;);if(((255&c)-1&236-l[0|i])<<23>>31!=-1&&!ye(i)&&!Y(a+128|0,i)){qt(c=a+384|0,s),Z(c,e,32,0),Z(c,i,32,0),Z(c,t,n,r),je(c,t=a+320|0),E(t),y=r=y-2272|0,de(r+2016|0,t),de(r+1760|0,f),At(n=r+480|0,i=a+128|0),ft(t=r+320|0,i),ht(r,t),Ue(t,r,n),ht(n=r+160|0,t),At(i=r+640|0,n),Ue(t,r,i),ht(n,t),At(i=r+800|0,n),Ue(t,r,i),ht(n,t),At(i=r+960|0,n),Ue(t,r,i),ht(n,t),At(i=r+1120|0,n),Ue(t,r,i),ht(n,t),At(i=r+1280|0,n),Ue(t,r,i),ht(n,t),At(i=r+1440|0,n),Ue(t,r,i),ht(n,t),At(r+1600|0,n),wn(s=a+8|0),cn(s+40|0),cn(s+80|0),i=255;e:{for(;;){if(!(l[(t=i)+(r+2016|0)|0]|l[(r+1760|0)+t|0])){if(i=t-1|0,t)continue;break e}break}if(!((0|t)<0))for(;P(r+320|0,s),n=t,(0|(t=o[(r+2016|0)+t|0]))>0?(ht(i=r+160|0,c=r+320|0),Ue(c,i,(r+480|0)+u((254&t)>>>1|0,160)|0)):(0|t)>=0||(ht(i=r+160|0,c=r+320|0),Qe(c,i,(r+480|0)+u((0-t&254)>>>1|0,160)|0)),(0|(d=o[n+(r+1760|0)|0]))>0?(ht(t=r+160|0,i=r+320|0),Ge(i,t,u((254&d)>>>1|0,120)+1568|0)):(0|d)>=0||(ht(i=r+160|0,t=r+320|0),y=h=y-48|0,me(t,p=i+40|0,i),ge(c=t+40|0,p,i),x(p=t+80|0,t,40+(f=u((0-d&254)>>>1|0,120)+1568|0)|0),x(c,c,f),x(d=t+120|0,f+80|0,i+120|0),me(h,i=i+80|0,i),ge(t,p,c),me(c,p,c),ge(p,h,d),me(d,h,d),y=h+48|0),bt(s,r+320|0),t=n-1|0,(0|n)>0;);}y=r+2272|0,tt(t=a+288|0,s),v=-1,A=fn(t,e),p=((0|e)==(0|t)?v:A)|Ze(e,t,32)}}return y=a+592|0,p}function U(e,t,n){var r=0,i=0,o=0,s=0,a=0,c=0,u=0,d=0,h=0,p=0,f=0,g=0,m=0,y=0,v=0,A=0,b=0,w=0,S=0;for(o=2036477234,h=857760878,p=1634760805,s=1797285236,d=l[0|n]|l[n+1|0]<<8|l[n+2|0]<<16|l[n+3|0]<<24,r=l[n+4|0]|l[n+5|0]<<8|l[n+6|0]<<16|l[n+7|0]<<24,i=l[n+8|0]|l[n+9|0]<<8|l[n+10|0]<<16|l[n+11|0]<<24,c=l[n+12|0]|l[n+13|0]<<8|l[n+14|0]<<16|l[n+15|0]<<24,g=l[n+16|0]|l[n+17|0]<<8|l[n+18|0]<<16|l[n+19|0]<<24,m=l[n+20|0]|l[n+21|0]<<8|l[n+22|0]<<16|l[n+23|0]<<24,v=l[n+24|0]|l[n+25|0]<<8|l[n+26|0]<<16|l[n+27|0]<<24,A=l[n+28|0]|l[n+29|0]<<8|l[n+30|0]<<16|l[n+31|0]<<24,n=l[0|t]|l[t+1|0]<<8|l[t+2|0]<<16|l[t+3|0]<<24,f=l[t+4|0]|l[t+5|0]<<8|l[t+6|0]<<16|l[t+7|0]<<24,a=l[t+8|0]|l[t+9|0]<<8|l[t+10|0]<<16|l[t+11|0]<<24,t=l[t+12|0]|l[t+13|0]<<8|l[t+14|0]<<16|l[t+15|0]<<24;u=d,p=mn((y=n)^(n=d+p|0),16),u=g=mn(u^(d=p+g|0),12),g=mn((y=p)^(p=n+g|0),8),d=mn(u^(b=g+d|0),7),u=r,h=mn((n=r+h|0)^f,16),u=f=mn(u^(r=h+m|0),12),f=mn((y=h)^(h=n+f|0),8),n=mn(u^(m=f+r|0),7),u=i,r=mn((o=o+i|0)^a,16),u=a=mn(u^(i=r+v|0),12),y=mn(r^(a=o+a|0),8),o=mn(u^(r=y+i|0),7),s=mn((i=t)^(t=s+c|0),16),c=mn((i=s+A|0)^c,12),t=mn(s^(w=t+c|0),8),s=mn(c^(i=t+i|0),7),u=r,r=mn((r=t)^(t=n+p|0),16),n=mn((c=u+r|0)^n,12),t=mn(r^(p=t+n|0),8),r=mn(n^(v=c+t|0),7),u=i,i=mn((n=o+h|0)^g,16),o=mn((c=u+i|0)^o,12),n=mn(i^(h=n+o|0),8),i=mn(o^(A=c+n|0),7),c=mn((o=s+a|0)^f,16),s=mn((a=c+b|0)^s,12),f=mn(c^(o=o+s|0),8),c=mn(s^(g=a+f|0),7),a=mn((s=d+w|0)^y,16),d=mn((m=a+m|0)^d,12),a=mn(a^(s=s+d|0),8),d=mn(d^(m=m+a|0),7),10!=(0|(S=S+1|0)););Ot(e,p),Ot(e+4|0,h),Ot(e+8|0,o),Ot(e+12|0,s),Ot(e+16|0,n),Ot(e+20|0,f),Ot(e+24|0,a),Ot(e+28|0,t)}function V(e,t,n,r,i,s,l,c){e|=0,t|=0,n|=0,r|=0,i|=0,s|=0,l|=0;var u,d=0,h=0,p=0,f=0,g=0,m=0,v=0,A=0,b=0;y=u=y-16|0,un(c|=0);e:{t:if(r){A=4&c;n:for(;;){for(h=f;;){d=o[n+h|0];r:{if(A?(p=d+4&(d+65488>>>8^-1)&(57-d>>>8^-1)&255|((p=d-65|0)>>>8^-1)&p&(90-d>>>8^-1)&255|d+185&(d+65439>>>8^-1)&(122-d>>>8^-1)&255|63&(1+(16288^d)>>>8^-1)|62&(1+(16338^d)>>>8^-1),p|=(0-p>>>8^-1)&1+(65470^d)>>>8&255):(p=d+4&(d+65488>>>8^-1)&(57-d>>>8^-1)&255|((p=d-65|0)>>>8^-1)&p&(90-d>>>8^-1)&255|d+185&(d+65439>>>8^-1)&(122-d>>>8^-1)&255|63&(1+(16336^d)>>>8^-1)|62&(1+(16340^d)>>>8^-1),p|=(0-p>>>8^-1)&1+(65470^d)>>>8&255),255==(0|p)){if(!i)break t;if(Ae(i,d))break r;f=h;break t}if(v=p+(v<<6)|0,(f=g+6|0)>>>0<8)g=f;else{if(g=g-2|0,t>>>0<=m>>>0){a[u+12>>2]=h,a[8952]=68,b=1;break e}o[e+m|0]=v>>>g,m=m+1|0}if((f=h+1|0)>>>0<r>>>0)continue n;break t}if(!((h=h+1|0)>>>0<r>>>0))break}break}f=(e=f+1|0)>>>0<r>>>0?r:e}a[u+12>>2]=f}e:if(g>>>0>4)t=0,e=-1;else if(e=-1,t=0,!((-1<<g^-1)&v|b)){if(!(2&c)){t:{n:{if(c=g>>>1|0)for(e=a[u+12>>2];;){if(e>>>0>=r>>>0){h=68;break n}if(61!=(0|(f=o[e+n|0]))){if(h=28,!i)break n;if(!Ae(i,f))break n}else c=c-1|0;if(e=e+1|0,a[u+12>>2]=e,!c)break}e=0;break t}a[8952]=h,e=-1}if(e)break e}if(e=0,i){t:if(!((h=a[u+12>>2])>>>0>=r>>>0)){for(;;){if(!Ae(i,o[n+h|0]))break t;if((0|(h=h+1|0))==(0|r))break}h=r}a[u+12>>2]=h}t=m}return i=a[u+12>>2],l?a[l>>2]=n+i:(0|r)!=(0|i)&&(a[8952]=28,e=-1),s&&(a[s>>2]=t),y=u+16|0,0|e}function K(e,t,n){var r=0,i=0,o=0,s=0,a=0,c=0,u=0,d=0,h=0,p=0,f=0,g=0,m=0,y=0,v=0,A=0,b=0,w=0,S=0,C=0,E=0;for(i=2036477234,o=857760878,s=1634760805,a=1797285236,v=20,d=l[0|n]|l[n+1|0]<<8|l[n+2|0]<<16|l[n+3|0]<<24,y=l[n+4|0]|l[n+5|0]<<8|l[n+6|0]<<16|l[n+7|0]<<24,A=l[n+8|0]|l[n+9|0]<<8|l[n+10|0]<<16|l[n+11|0]<<24,g=l[n+12|0]|l[n+13|0]<<8|l[n+14|0]<<16|l[n+15|0]<<24,h=l[n+16|0]|l[n+17|0]<<8|l[n+18|0]<<16|l[n+19|0]<<24,c=l[n+20|0]|l[n+21|0]<<8|l[n+22|0]<<16|l[n+23|0]<<24,p=l[n+24|0]|l[n+25|0]<<8|l[n+26|0]<<16|l[n+27|0]<<24,f=l[n+28|0]|l[n+29|0]<<8|l[n+30|0]<<16|l[n+31|0]<<24,n=l[0|t]|l[t+1|0]<<8|l[t+2|0]<<16|l[t+3|0]<<24,u=l[t+4|0]|l[t+5|0]<<8|l[t+6|0]<<16|l[t+7|0]<<24,r=l[t+8|0]|l[t+9|0]<<8|l[t+10|0]<<16|l[t+11|0]<<24,t=l[t+12|0]|l[t+13|0]<<8|l[t+14|0]<<16|l[t+15|0]<<24;b=r,r=mn(s+c|0,7)^g,m=b^mn(r+s|0,9),w=mn(r+m|0,13)^c,g=mn(m+w|0,18),t=mn(o+d|0,7)^t,p=mn(t+o|0,9)^p,d=mn(t+p|0,13)^d,C=mn(p+d|0,18),f=mn(n+i|0,7)^f,c=mn(f+i|0,9)^y,S=mn(c+f|0,13)^n,E=mn(c+S|0,18),n=mn(a+h|0,7)^A,u=mn(n+a|0,9)^u,h=mn(n+u|0,13)^h,b=mn(u+h|0,18),d=mn((s^=g)+n|0,7)^d,y=mn(d+s|0,9)^c,A=mn(d+y|0,13)^n,s=mn(y+A|0,18)^s,n=mn((o^=C)+r|0,7)^S,u=mn(n+o|0,9)^u,g=mn(n+u|0,13)^r,o=mn(u+g|0,18)^o,h=mn((i^=E)+t|0,7)^h,r=mn(h+i|0,9)^m,t=mn(r+h|0,13)^t,i=mn(t+r|0,18)^i,c=mn((a^=b)+f|0,7)^w,p=mn(c+a|0,9)^p,f=mn(c+p|0,13)^f,a=mn(p+f|0,18)^a,m=v>>>0>2,v=v-2|0,m;);return Ot(e,s),Ot(e+4|0,o),Ot(e+8|0,i),Ot(e+12|0,a),Ot(e+16|0,n),Ot(e+20|0,u),Ot(e+24|0,r),Ot(e+28|0,t),0}function H(e){var t,n=0,r=0;y=t=y-48|0,n=l[28+(e|=0)|0]|l[e+29|0]<<8|l[e+30|0]<<16|l[e+31|0]<<24,a[t+24>>2]=l[e+24|0]|l[e+25|0]<<8|l[e+26|0]<<16|l[e+27|0]<<24,a[t+28>>2]=n,n=l[e+20|0]|l[e+21|0]<<8|l[e+22|0]<<16|l[e+23|0]<<24,a[t+16>>2]=l[e+16|0]|l[e+17|0]<<8|l[e+18|0]<<16|l[e+19|0]<<24,a[t+20>>2]=n,n=l[e+4|0]|l[e+5|0]<<8|l[e+6|0]<<16|l[e+7|0]<<24,a[t>>2]=l[0|e]|l[e+1|0]<<8|l[e+2|0]<<16|l[e+3|0]<<24,a[t+4>>2]=n,n=l[e+12|0]|l[e+13|0]<<8|l[e+14|0]<<16|l[e+15|0]<<24,a[t+8>>2]=l[e+8|0]|l[e+9|0]<<8|l[e+10|0]<<16|l[e+11|0]<<24,a[t+12>>2]=n,n=l[e+40|0]|l[e+41|0]<<8|l[e+42|0]<<16|l[e+43|0]<<24,a[t+32>>2]=l[e+36|0]|l[e+37|0]<<8|l[e+38|0]<<16|l[e+39|0]<<24,a[t+36>>2]=n,jn[a[8752]](t,t,40,0,e+32|0,0,e),n=a[t+28>>2],r=a[t+24>>2],o[e+24|0]=r,o[e+25|0]=r>>>8,o[e+26|0]=r>>>16,o[e+27|0]=r>>>24,o[e+28|0]=n,o[e+29|0]=n>>>8,o[e+30|0]=n>>>16,o[e+31|0]=n>>>24,n=a[t+20>>2],r=a[t+16>>2],o[e+16|0]=r,o[e+17|0]=r>>>8,o[e+18|0]=r>>>16,o[e+19|0]=r>>>24,o[e+20|0]=n,o[e+21|0]=n>>>8,o[e+22|0]=n>>>16,o[e+23|0]=n>>>24,n=a[t+12>>2],r=a[t+8>>2],o[e+8|0]=r,o[e+9|0]=r>>>8,o[e+10|0]=r>>>16,o[e+11|0]=r>>>24,o[e+12|0]=n,o[e+13|0]=n>>>8,o[e+14|0]=n>>>16,o[e+15|0]=n>>>24,n=a[t+4>>2],r=a[t>>2],o[0|e]=r,o[e+1|0]=r>>>8,o[e+2|0]=r>>>16,o[e+3|0]=r>>>24,o[e+4|0]=n,o[e+5|0]=n>>>8,o[e+6|0]=n>>>16,o[e+7|0]=n>>>24,n=a[t+36>>2],r=a[t+32>>2],o[e+36|0]=r,o[e+37|0]=r>>>8,o[e+38|0]=r>>>16,o[e+39|0]=r>>>24,o[e+40|0]=n,o[e+41|0]=n>>>8,o[e+42|0]=n>>>16,o[e+43|0]=n>>>24,Mt(e),y=t+48|0}function G(e,t){var n,r,i,s,l,c,d,h,p=0,f=0;y=n=y-48|0,r=a[t+28>>2],i=a[t+24>>2],s=a[t+20>>2],l=a[t+16>>2],c=a[t+12>>2],d=a[t+8>>2],h=a[t+4>>2],p=a[t>>2],f=a[t+36>>2],t=a[t+32>>2],p=u(((r+(i+(s+(l+(c+(d+(h+(p+(u(f,19)+16777216>>>25|0)>>26)>>25)>>26)>>25)>>26)>>25)>>26)>>25)+t>>26)+f>>25,19)+p|0,a[n>>2]=67108863&p,p=h+(p>>26)|0,a[n+4>>2]=33554431&p,p=d+(p>>25)|0,a[n+8>>2]=67108863&p,p=c+(p>>26)|0,a[n+12>>2]=33554431&p,p=l+(p>>25)|0,a[n+16>>2]=67108863&p,p=s+(p>>26)|0,a[n+20>>2]=33554431&p,p=i+(p>>25)|0,a[n+24>>2]=67108863&p,p=r+(p>>26)|0,a[n+28>>2]=33554431&p,t=t+(p>>25)|0,a[n+32>>2]=67108863&t,a[n+36>>2]=f+(t>>26)&33554431,t=a[n>>2],o[0|e]=t,o[e+2|0]=t>>>16,o[e+1|0]=t>>>8,f=a[n+4>>2],o[e+5|0]=f>>>14,o[e+4|0]=f>>>6,o[e+3|0]=f<<2|t>>>24,t=a[n+8>>2],o[e+8|0]=t>>>13,o[e+7|0]=t>>>5,o[e+6|0]=t<<3|f>>>22,f=a[n+12>>2],o[e+11|0]=f>>>11,o[e+10|0]=f>>>3,o[e+9|0]=f<<5|t>>>21,t=a[n+16>>2],o[e+15|0]=t>>>18,o[e+14|0]=t>>>10,o[e+13|0]=t>>>2,o[e+12|0]=t<<6|f>>>19,t=a[n+20>>2],o[e+16|0]=t,o[e+18|0]=t>>>16,o[e+17|0]=t>>>8,f=a[n+24>>2],o[e+21|0]=f>>>15,o[e+20|0]=f>>>7,o[e+19|0]=f<<1|t>>>24,t=a[n+28>>2],o[e+24|0]=t>>>13,o[e+23|0]=t>>>5,o[e+22|0]=t<<3|f>>>23,f=a[n+32>>2],o[e+27|0]=f>>>12,o[e+26|0]=f>>>4,o[e+25|0]=f<<4|t>>>21,t=a[n+36>>2],o[e+31|0]=t>>>18,o[e+30|0]=t>>>10,o[e+29|0]=t>>>2,o[e+28|0]=t<<6|f>>>20,y=n+48|0}function Y(e,t){var n,r,i,o,s,a=0,c=0,u=0;for(y=n=y-288|0,F(s=e+40|0,t),cn(c=e+80|0),k(r=n+240|0,s),x(i=n+192|0,r,1424),ge(r,r,c),me(i,i,c),k(o=n+144|0,i),x(o,o,i),k(e,o),x(e,e,i),x(e,e,r),y=c=y-144|0,k(a=c+96|0,e),k(u=c+48|0,a),k(u,u),x(u,e,u),x(a,a,u),k(a,a),x(a,u,a),k(u,a),a=1;k(u=c+48|0,u),5!=(0|(a=a+1|0)););for(x(a=c+96|0,u=c+48|0,a),k(u,a),a=1;k(u=c+48|0,u),10!=(0|(a=a+1|0)););for(x(a=c+48|0,a,c+96|0),k(c,a),a=1;k(c,c),20!=(0|(a=a+1|0)););for(x(a=c+48|0,c,a),a=1;k(u=c+48|0,u),11!=(0|(a=a+1|0)););for(x(a=c+96|0,u=c+48|0,a),k(u,a),a=1;k(u=c+48|0,u),50!=(0|(a=a+1|0)););for(x(a=c+48|0,a,c+96|0),k(c,a),a=1;k(c,c),100!=(0|(a=a+1|0)););for(x(a=c+48|0,c,a),a=1;k(u=c+48|0,u),51!=(0|(a=a+1|0)););x(a=c+96|0,c+48|0,a),k(a,a),k(a,a),x(e,a,e),y=c+144|0,x(e,e,o),x(e,e,r),k(c=n+96|0,e),x(c,c,i),ge(a=n+48|0,c,r);e:{if(!Nt(a)){if(me(n,n+96|0,n+240|0),c=-1,!Nt(n))break e;x(e,e,1472)}(0|Dt(e))==(l[t+31|0]>>>7|0)&&_e(e,e),x(e+120|0,e,s),c=0}return y=n+288|0,c}function z(e,t,n,r,i){var s,c,u=0,d=0,h=0;for(y=s=(y=c=y-416|0)-192|0,Pt(c),vt(s- -64|0,54,128),o[s+64|0]=54^l[0|i],u=1;o[0|(d=(s- -64|0)+u|0)]=l[0|d]^l[i+u|0],32!=(0|(u=u+1|0)););for(Z(c,u=s- -64|0,128,0),Pt(d=c+208|0),vt(u,92,128),o[s+64|0]=92^l[0|i],u=1;o[0|(h=(s- -64|0)+u|0)]=l[0|h]^l[i+u|0],32!=(0|(u=u+1|0)););return Z(d,i=s- -64|0,128,0),bn(i,128),bn(s,64),y=s+192|0,Z(c,t,n,r),y=n=(y=t=y+-64|0)-64|0,je(c,n),Z(r=c+208|0,n,64,0),je(r,t),bn(n,64),y=n- -64|0,n=a[t+28>>2],r=a[t+24>>2],o[e+24|0]=r,o[e+25|0]=r>>>8,o[e+26|0]=r>>>16,o[e+27|0]=r>>>24,o[e+28|0]=n,o[e+29|0]=n>>>8,o[e+30|0]=n>>>16,o[e+31|0]=n>>>24,n=a[t+20>>2],r=a[t+16>>2],o[e+16|0]=r,o[e+17|0]=r>>>8,o[e+18|0]=r>>>16,o[e+19|0]=r>>>24,o[e+20|0]=n,o[e+21|0]=n>>>8,o[e+22|0]=n>>>16,o[e+23|0]=n>>>24,n=a[t+12>>2],r=a[t+8>>2],o[e+8|0]=r,o[e+9|0]=r>>>8,o[e+10|0]=r>>>16,o[e+11|0]=r>>>24,o[e+12|0]=n,o[e+13|0]=n>>>8,o[e+14|0]=n>>>16,o[e+15|0]=n>>>24,n=a[t+4>>2],r=a[t>>2],o[0|e]=r,o[e+1|0]=r>>>8,o[e+2|0]=r>>>16,o[e+3|0]=r>>>24,o[e+4|0]=n,o[e+5|0]=n>>>8,o[e+6|0]=n>>>16,o[e+7|0]=n>>>24,y=t- -64|0,y=c+416|0,0}function Z(e,t,n,r){var i,s=0,c=0,u=0,d=0,h=0,p=0;y=i=y-704|0;e:if(n|r){if(u=r<<3|(s=n)>>>29,c=(h=a[e+72>>2])+(p=s<<3)|0,s=u+(d=a[e+76>>2])|0,a[e+72>>2]=c,s=c>>>0<p>>>0?s+1|0:s,a[e+76>>2]=s,u=(p=(0|s)==(0|d)&c>>>0<h>>>0|s>>>0<d>>>0)+a[(c=e- -64|0)>>2]|0,s=a[c+4>>2],s=u>>>0<p>>>0?s+1|0:s,u=(p=r>>>29|0)+u|0,a[c>>2]=u,a[c+4>>2]=u>>>0<p>>>0?s+1|0:s,c=0,s=0,(0|(u=0-((d=127&((7&d)<<29|h>>>3))>>>0>128)|0))==(0|r)&n>>>0<(h=128-d|0)>>>0|r>>>0<u>>>0)for(;;)if(o[80+(e+(h=c+d|0)|0)|0]=l[t+c|0],!((0|n)!=(0|(c=c+1|0))|(0|r)!=(0|(s=c?s:s+1|0))))break e;for(;o[80+(e+(p=c+d|0)|0)|0]=l[t+c|0],(0|h)!=(0|(c=c+1|0))|(0|(s=c?s:s+1|0))!=(0|u););if(C(e,e+80|0,i,s=i+640|0),t=t+h|0,!(r=r-((n>>>0<h>>>0)+u|0)|0)&(n=n-h|0)>>>0>127|r)for(;C(e,t,i,s),t=t+128|0,!(r=r-(n>>>0<128)|0)&(n=n-128|0)>>>0>127|r;);if(n|r)for(c=0,s=0;o[80+(e+c|0)|0]=l[t+c|0],(0|n)!=(0|(c=d=c+1|0))|(0|r)!=(0|(s=d?s:s+1|0)););bn(i,704)}return y=i+704|0,0}function W(e,t,n){var r,i,o,s=0;y=r=y-16|0,i=a[e+20>>2],a[e+20>>2]=0,o=a[e+4>>2],a[e+4>>2]=0,s=-26;e:{t:{n:switch(n-1|0){case 1:if(s=-32,Ve(t,1109,9))break e;t=t+9|0;break t;case 0:break n;default:break e}if(s=-32,Ve(t,1100,8))break e;t=t+8|0}if(!Ve(t,1352,3)&&(t=Ie(t+3|0,r+12|0))){if(s=-26,19!=a[r+12>>2])break e;if(!Ve(t,1364,3)&&(t=Ie(t+3|0,r+12|0))&&(a[e+44>>2]=a[r+12>>2],!Ve(t,1356,3)&&(t=Ie(t+3|0,r+12|0))&&(a[e+40>>2]=a[r+12>>2],!Ve(t,1360,3)&&(t=Ie(t+3|0,r+12|0))&&(n=a[r+12>>2],a[e+48>>2]=n,a[e+52>>2]=n,36==(0|(n=l[0|t]))&&(a[r+12>>2]=i,t=t+(36==(0|n))|0,!V(a[e+16>>2],i,t,Ne(t),0,r+12|0,r+8|0,3)&&(a[e+20>>2]=a[r+12>>2],t=a[r+8>>2],36==(0|(n=l[0|t]))&&(a[r+12>>2]=o,t=t+(36==(0|n))|0,!V(a[e>>2],o,t,Ne(t),0,r+12|0,r+8|0,3)))))))){if(a[e+4>>2]=a[r+12>>2],t=a[r+8>>2],s=le(e))break e;s=l[0|t]?-32:0;break e}}s=-32}return y=r+16|0,s}function q(e,t){var n,r,i,s,l,c,d,h,p,f,g,m=0,y=0,v=0,A=0,b=0,w=0;(y=a[e+56>>2])|(m=a[e+60>>2])&&(o[(A=e+y|0)- -64|0]=1,!(m=(v=y+1|0)?m:m+1|0)&v>>>0<=15&&vt(A+65|0,0,15-y|0),o[e+80|0]=1,j(e,e- -64|0,16,0)),p=a[e+52>>2],f=a[e+48>>2],g=a[e+44>>2],b=a[e+24>>2],v=a[e+28>>2]+(b>>>26|0)|0,y=a[e+32>>2]+(v>>>26|0)|0,i=a[e+36>>2]+(y>>>26|0)|0,c=67108863&y,v=(y=(67108863&b)+((m=a[e+20>>2]+u(i>>>26|0,5)|0)>>>26|0)|0)&(n=(s=(-67108864|i)+((d=c+((b=(w=67108863&v)+((m=y+((l=5+(A=67108863&m)|0)>>>26|0)|0)>>>26|0)|0)>>>26|0)|0)>>>26|0)|0)>>31)|(r=67108863&(h=(s>>>31|0)-1|0))&m,m=0,m=(y=v<<26|r&l|A&n)>>>0>(A=y+a[e+40>>2]|0)>>>0?1:m,Ot(t,A),y=0,y=(v=(w=w&n|b&r)<<20|v>>>6)>>>0>(b=v+g|0)>>>0?1:y,v=m,b=m+b|0,m=y,m=v>>>0>b>>>0?m+1|0:m,Ot(t+4|0,b),y=0,y=(v=(A=n&c|r&d)<<14|w>>>12)>>>0>(w=v+f|0)>>>0?1:y,v=m,w=m+w|0,m=y,m=v>>>0>w>>>0?m+1|0:m,Ot(t+8|0,w),Ot(y=t+12|0,m=m+(A=(t=(s&h|n&i)<<8|A>>>18)+p|0)|0),bn(e,88)}function J(e,t){var n,r,i=0;for(y=n=y-192|0,k(r=n+144|0,t),k(i=n+96|0,r),k(i,i),x(i,t,i),x(r,r,i),k(t=n+48|0,r),x(i,i,t),k(t,i),t=1;k(i=n+48|0,i),5!=(0|(t=t+1|0)););for(x(t=n+96|0,i=n+48|0,t),k(i,t),t=1;k(i=n+48|0,i),10!=(0|(t=t+1|0)););for(x(t=n+48|0,t,n+96|0),k(n,t),t=1;k(n,n),20!=(0|(t=t+1|0)););for(x(t=n+48|0,n,t),t=1;k(i=n+48|0,i),11!=(0|(t=t+1|0)););for(x(t=n+96|0,i=n+48|0,t),k(i,t),t=1;k(i=n+48|0,i),50!=(0|(t=t+1|0)););for(x(t=n+48|0,t,n+96|0),k(n,t),t=1;k(n,n),100!=(0|(t=t+1|0)););for(x(t=n+48|0,n,t),t=1;k(i=n+48|0,i),51!=(0|(t=t+1|0)););for(x(t=n+96|0,n+48|0,t),t=1;k(i=n+96|0,i),6!=(0|(t=t+1|0)););x(e,n+96|0,n+144|0),y=n+192|0}function X(e,t,n,r,i){e|=0,t|=0,n|=0,r|=0;var s=0,a=0,c=0,d=0,f=0,g=0,m=0,y=0;un(i|=0),a=(s=(r>>>0)/3|0)<<2,(s=u(s,-3)+r|0)&&(a=2&i?(2|a)+(s>>>1|0)|0:a+4|0);e:{t:{n:{if(t>>>0>a>>>0){if(!(4&i)){if(i=0,!r)break e;s=0;break n}if(i=0,!r)break e;for(s=0;;){for(f=(d=l[n+c|0])|f<<8,s=s+8|0;g=s,m=e+i|0,y=sn(f>>>(s=s-6|0)&63),o[0|m]=y,i=i+1|0,s>>>0>5;);if((0|(c=c+1|0))==(0|r))break}if(!s)break e;n=sn(d<<12-g&63);break t}Ut(),h()}for(;;){for(f=(d=l[n+c|0])|f<<8,s=s+8|0;g=s,m=e+i|0,y=an(f>>>(s=s-6|0)&63),o[0|m]=y,i=i+1|0,s>>>0>5;);if((0|(c=c+1|0))==(0|r))break}if(!s)break e;n=an(d<<12-g&63)}o[e+i|0]=n,i=i+1|0}e:{t:{if(i>>>0<=a>>>0){if(i>>>0<a>>>0)break t;a=i;break e}p(1048,1145,230,1375),h()}vt(e+i|0,61,a-i|0)}return vt(e+a|0,0,(t>>>0>(n=a+1|0)>>>0?t:n)-a|0),0|e}function $(e,t,n,r){var i=0,s=0,c=0,u=0,d=0,h=0;e:{if((u=a[e+56>>2])|(d=a[e+60>>2])){if(h=i=(c=(0|(i=0-((u>>>0>16)+d|0)|0))==(0|r)&n>>>0>(s=16-u|0)>>>0|r>>>0>i>>>0)?i:r,i|(s=c?s:n))for(c=0,i=0;o[(e+(d=c+u|0)|0)- -64|0]=l[t+c|0],u=a[e+56>>2],d=a[e+60>>2],(0|s)!=(0|(c=c+1|0))|(0|(i=c?i:i+1|0))!=(0|h););if(i=d+h|0,i=(u=s+u|0)>>>0<s>>>0?i+1|0:i,a[e+56>>2]=u,a[e+60>>2]=i,!i&u>>>0<16)break e;j(e,e- -64|0,16,0),a[e+56>>2]=0,a[e+60>>2]=0,n=(i=n)-s|0,r=r-((i>>>0<s>>>0)+h|0)|0,t=t+s|0}if(!r&n>>>0>=16|r&&(j(e,t,i=-16&n,r),n&=15,r=0,t=t+i|0),n|r){for(c=0,i=0;s=c+a[e+56>>2]|0,o[(e+s|0)- -64|0]=l[t+c|0],c=s=c+1|0,(0|n)!=(0|s)|(0|r)!=(0|(i=s?i:i+1|0)););t=r+a[e+60>>2]|0,t=(i=n+a[e+56>>2]|0)>>>0<n>>>0?t+1|0:t,a[e+56>>2]=i,a[e+60>>2]=t}}}function ee(e,t,n){var r,i,o,s,l,c,u,d,h,p,f,g,m=0,y=0,v=0,A=0,b=0,w=0,S=0,C=0,E=0;r=a[t+4>>2],i=a[e+4>>2],o=a[t+8>>2],y=a[e+8>>2],s=a[t+12>>2],v=a[e+12>>2],l=a[t+16>>2],A=a[e+16>>2],c=a[t+20>>2],b=a[e+20>>2],u=a[t+24>>2],w=a[e+24>>2],d=a[t+28>>2],S=a[e+28>>2],h=a[t+32>>2],C=a[e+32>>2],p=a[t+36>>2],E=a[e+36>>2],g=(n=0-n|0)&((f=a[t>>2])^(m=a[e>>2])),a[e>>2]=g^m,m=E,E=n&(E^p),a[e+36>>2]=m^E,m=C,C=n&(C^h),a[e+32>>2]=m^C,m=S,S=n&(S^d),a[e+28>>2]=m^S,m=w,w=n&(w^u),a[e+24>>2]=m^w,m=b,b=n&(b^c),a[e+20>>2]=m^b,m=A,A=n&(A^l),a[e+16>>2]=m^A,m=v,v=n&(v^s),a[e+12>>2]=m^v,m=y,y=n&(y^o),a[e+8>>2]=m^y,m=e,e=n&(r^i),a[m+4>>2]=e^i,a[t+36>>2]=E^p,a[t+32>>2]=C^h,a[t+28>>2]=S^d,a[t+24>>2]=w^u,a[t+20>>2]=b^c,a[t+16>>2]=A^l,a[t+12>>2]=v^s,a[t+8>>2]=y^o,a[t+4>>2]=e^r,a[t>>2]=f^g}function te(e,t){var n;a[e>>2]=67108863&(l[0|t]|l[t+1|0]<<8|l[t+2|0]<<16|l[t+3|0]<<24),a[e+4>>2]=(l[t+3|0]|l[t+4|0]<<8|l[t+5|0]<<16|l[t+6|0]<<24)>>>2&67108611,a[e+8>>2]=(l[t+6|0]|l[t+7|0]<<8|l[t+8|0]<<16|l[t+9|0]<<24)>>>4&67092735,a[e+12>>2]=(l[t+9|0]|l[t+10|0]<<8|l[t+11|0]<<16|l[t+12|0]<<24)>>>6&66076671,n=l[t+12|0]|l[t+13|0]<<8|l[t+14|0]<<16|l[t+15|0]<<24,a[e+20>>2]=0,a[e+24>>2]=0,a[e+28>>2]=0,a[e+32>>2]=0,a[e+36>>2]=0,a[e+16>>2]=n>>>8&1048575,a[e+40>>2]=l[t+16|0]|l[t+17|0]<<8|l[t+18|0]<<16|l[t+19|0]<<24,a[e+44>>2]=l[t+20|0]|l[t+21|0]<<8|l[t+22|0]<<16|l[t+23|0]<<24,a[e+48>>2]=l[t+24|0]|l[t+25|0]<<8|l[t+26|0]<<16|l[t+27|0]<<24,t=l[t+28|0]|l[t+29|0]<<8|l[t+30|0]<<16|l[t+31|0]<<24,o[e+80|0]=0,a[e+56>>2]=0,a[e+60>>2]=0,a[e+52>>2]=t}function ne(e,t,n,r){var i=0,s=0,a=0,c=0,u=0,d=0;if(n|r){if(!r&(s=256-(i=l[e+352|0]|l[e+353|0]<<8|l[e+354|0]<<16|l[e+355|0]<<24)|0)>>>0<n>>>0|r)for(d=e+224|0,c=e+96|0;pt(96+(e+i|0)|0,t,s),a=(l[e+352|0]|l[e+353|0]<<8|l[e+354|0]<<16|l[e+355|0]<<24)+s|0,o[e+352|0]=a,o[e+353|0]=a>>>8,o[e+354|0]=a>>>16,o[e+355|0]=a>>>24,ie(e,128),w(e,c),pt(c,d,128),i=(u=l[e+352|0]|l[e+353|0]<<8|l[e+354|0]<<16|l[e+355|0]<<24)-128|0,o[e+352|0]=i,o[e+353|0]=i>>>8,o[e+354|0]=i>>>16,o[e+355|0]=i>>>24,t=t+s|0,a=n,n=n-s|0,!(r=r-(s>>>0>a>>>0)|0)&(s=384-u|0)>>>0<n>>>0|r;);pt(96+(e+i|0)|0,t,n),t=n+(l[e+352|0]|l[e+353|0]<<8|l[e+354|0]<<16|l[e+355|0]<<24)|0,o[e+352|0]=t,o[e+353|0]=t>>>8,o[e+354|0]=t>>>16,o[e+355|0]=t>>>24}return 0}function re(e,t){var n,r=0,i=0,s=0,a=0;for(y=n=y-464|0;i=(n+400|0)+(r<<1)|0,a=l[t+r|0],o[i+1|0]=a>>>4,o[0|i]=15&a,32!=(0|(r=r+1|0)););for(r=0;t=((i=(t=r)+l[0|(r=(n+400|0)+s|0)]|0)<<24)- -134217728|0,o[0|r]=i-(t>>24&240),r=t>>28,63!=(0|(s=s+1|0)););for(o[n+463|0]=l[n+463|0]+r,Vt(e),r=1;Ce(n,r>>>1|0,o[(n+400|0)+r|0]),Ge(t=n+240|0,e,n),ht(e,t),t=r>>>0<62,r=r+2|0,t;);for(ft(t=n+240|0,e),bt(r=n+120|0,t),P(t,r),bt(r,t),P(t,r),bt(r,t),P(t,r),ht(e,t),r=0;Ce(n,r>>>1|0,o[(n+400|0)+r|0]),Ge(t=n+240|0,e,n),ht(e,t),t=r>>>0<62,r=r+2|0,t;);y=n+464|0}function ie(e,t){var n,r,i,s=0,a=0;i=1+(a=n=l[4+(s=e- -64|0)|0]|l[s+5|0]<<8|l[s+6|0]<<16|l[s+7|0]<<24)|0,a=(t=t+(a=r=l[0|s]|l[s+1|0]<<8|l[s+2|0]<<16|l[s+3|0]<<24)|0)>>>0<a>>>0?i:n,o[0|s]=t,o[s+1|0]=t>>>8,o[s+2|0]=t>>>16,o[s+3|0]=t>>>24,o[s+4|0]=a,o[s+5|0]=a>>>8,o[s+6|0]=a>>>16,o[s+7|0]=a>>>24,t=(s=(0|a)==(0|n)&t>>>0<r>>>0|a>>>0<n>>>0)+(l[e+72|0]|l[e+73|0]<<8|l[e+74|0]<<16|l[e+75|0]<<24)|0,a=l[e+76|0]|l[e+77|0]<<8|l[e+78|0]<<16|l[e+79|0]<<24,s=t>>>0<s>>>0?a+1|0:a,o[e+72|0]=t,o[e+73|0]=t>>>8,o[e+74|0]=t>>>16,o[e+75|0]=t>>>24,o[e+76|0]=s,o[e+77|0]=s>>>8,o[e+78|0]=s>>>16,o[e+79|0]=s>>>24}function oe(e,t){a[e>>2]=1634760805,a[e+4>>2]=857760878,a[e+8>>2]=2036477234,a[e+12>>2]=1797285236,a[e+16>>2]=l[0|t]|l[t+1|0]<<8|l[t+2|0]<<16|l[t+3|0]<<24,a[e+20>>2]=l[t+4|0]|l[t+5|0]<<8|l[t+6|0]<<16|l[t+7|0]<<24,a[e+24>>2]=l[t+8|0]|l[t+9|0]<<8|l[t+10|0]<<16|l[t+11|0]<<24,a[e+28>>2]=l[t+12|0]|l[t+13|0]<<8|l[t+14|0]<<16|l[t+15|0]<<24,a[e+32>>2]=l[t+16|0]|l[t+17|0]<<8|l[t+18|0]<<16|l[t+19|0]<<24,a[e+36>>2]=l[t+20|0]|l[t+21|0]<<8|l[t+22|0]<<16|l[t+23|0]<<24,a[e+40>>2]=l[t+24|0]|l[t+25|0]<<8|l[t+26|0]<<16|l[t+27|0]<<24,a[e+44>>2]=l[t+28|0]|l[t+29|0]<<8|l[t+30|0]<<16|l[t+31|0]<<24}function se(e,t,n,r,i,o,s){var l,c,u,d,h,p=0;return y=l=y-352|0,K(l,o,s),!((!i&r>>>0>e-n>>>0|0!=(0|i))&e>>>0>n>>>0)&(!i&r>>>0<=n-e>>>0|e>>>0>=n>>>0)||(n=nt(e,n,r)),a[l+56>>2]=0,a[l+60>>2]=0,a[l+48>>2]=0,a[l+52>>2]=0,a[l+40>>2]=0,a[l+44>>2]=0,a[l+32>>2]=0,a[l+36>>2]=0,(u=!((s=(p=!i&r>>>0<32)?r:32)|(p=p?i:0)))||pt(l- -64|0,n,s),d=o+16|0,Ht(c=l+32|0,c,h=s+32|0,o=h>>>0<32?p+1|0:p,d,l),hn(l+96|0,c),u||pt(e,l- -64|0,s),bn(l+32|0,64),!i&r>>>0>=33|i&&Kt(e+s|0,n+s|0,r-s|0,i-(p+(r>>>0<s>>>0)|0)|0,d,l),bn(l,32),nn(n=l+96|0,e,r,i),pn(n,t),bn(n,256),y=l+352|0,0}function ae(e,t,n,r,i,o,s){var l,c,u=0,d=0,h=0;y=l=y-96|0,K(l,o,s),s=l+32|0,c=o+16|0,jn[a[8760]](s,32,0,c,l),o=-1;e:{if(!(0|jn[a[8754]](n,t,r,i,s))){if(o=0,!e)break e;!((!i&r>>>0>t-e>>>0|0!=(0|i))&e>>>0<t>>>0)&(!i&r>>>0<=e-t>>>0|e>>>0<=t>>>0)||(t=nt(e,t,r)),n=(o=!i&r>>>0<32)?r:32,s=o=o?i:0,n|o?(d=pt(l- -64|0,t,n),u=o=l+32|0,o=s,Ht(u,u,h=n+32|0,o=h>>>0<32?o+1|0:o,c,l),pt(e,d,n)):(u=o=l+32|0,o=s,Ht(u,u,d=n+32|0,o=d>>>0<32?o+1|0:o,c,l)),o=0,!i&r>>>0<33||Kt(e+n|0,t+n|0,r-n|0,i-(s+(n>>>0>r>>>0)|0)|0,c,l)}bn(l,32)}return y=l+96|0,o}function le(e){var t=0,n=0,r=0;if(!e)return-25;if(!a[e>>2])return-1;if(t=-2,!(c[e+4>>2]<16)&&(a[e+8>>2]||(t=-18,!a[e+12>>2]))){if(n=a[e+20>>2],!a[e+16>>2])return n?-19:-6;if(t=-6,!(n>>>0<8)&&(a[e+24>>2]||(t=-20,!a[e+28>>2]))&&(a[e+32>>2]||(t=-21,!a[e+36>>2]))){if(!(n=a[e+48>>2]))return-16;if(t=-17,!(n>>>0>16777215||(t=-14,(r=a[e+44>>2])>>>0<8||(t=-15,r>>>0>2097152||(t=-14,n<<3>>>0>r>>>0))))){if(!a[e+40>>2])return-12;if(!(e=a[e+52>>2]))return-28;t=e>>>0>16777215?-29:0}}}return t}function ce(e,t,n){var r,i,o,s,l,c,u,d,h,p,f,g,m,y,v,A,b,w,S,C;f=a[t+4>>2],r=a[e+4>>2],g=a[t+8>>2],i=a[e+8>>2],m=a[t+12>>2],o=a[e+12>>2],y=a[t+16>>2],s=a[e+16>>2],v=a[t+20>>2],l=a[e+20>>2],A=a[t+24>>2],c=a[e+24>>2],b=a[t+28>>2],u=a[e+28>>2],w=a[t+32>>2],d=a[e+32>>2],S=a[t+36>>2],h=a[e+36>>2],p=a[e>>2],C=a[t>>2]^p,t=0-n|0,a[e>>2]=p^C&t,a[e+36>>2]=t&(h^S)^h,a[e+32>>2]=t&(d^w)^d,a[e+28>>2]=t&(u^b)^u,a[e+24>>2]=t&(c^A)^c,a[e+20>>2]=t&(l^v)^l,a[e+16>>2]=t&(s^y)^s,a[e+12>>2]=t&(o^m)^o,a[e+8>>2]=t&(i^g)^i,a[e+4>>2]=t&(r^f)^r}function ue(e,t,n,r,i,o,s,c,u,d){var h,p,f,g;return y=h=y-48|0,a[h+4>>2]=0,U(p=h+16|0,u,d),d=l[u+20|0]|l[u+21|0]<<8|l[u+22|0]<<16|l[u+23|0]<<24,a[h+8>>2]=l[u+16|0]|l[u+17|0]<<8|l[u+18|0]<<16|l[u+19|0]<<24,a[h+12>>2]=d,y=d=y-352|0,$t(f=d+32|0,64,g=h+4|0,p),hn(u=d+96|0,f),bn(f,64),nn(u,o,s,c),nn(u,34960,0-s&15,0),nn(u,t,n,r),nn(u,34960,0-n&15,0),ot(o=d+24|0,s,c),nn(u,o,8,0),ot(o,n,r),nn(u,o,8,0),pn(u,d),bn(u,256),i=dn(d,i),bn(d,16),e&&(i?(vt(e,0,n),i=-1):(_t(e,t,n,r,g,1,p),i=0)),y=d+352|0,bn(p,32),y=h+48|0,i}function de(e,t){for(var n=0,r=0,i=0,s=0,a=0,c=0,u=0,d=0;o[e+n|0]=l[(n>>>3|0)+t|0]>>>(7&n)&1,256!=(0|(n=n+1|0)););for(;;){c=(t=c)+1|0;e:if(l[0|(a=e+t|0)]&&(n=c,i=1,!(t>>>0>254)))for(;;){t:if(s=o[0|(r=e+n|0)])if((0|(d=(u=o[0|a])+(s<<=i)|0))<=15)o[0|a]=d,o[0|r]=0;else{if((0|(r=u-s|0))<-15)break e;for(o[0|a]=r;;){if(!l[0|(r=e+n|0)]){o[0|r]=1;break t}if(o[0|r]=0,r=n>>>0<255,n=n+1|0,!r)break}}if(i>>>0>5)break e;if(!((n=t+(i=i+1|0)|0)>>>0<256))break}if(256==(0|c))break}}function he(e,t,n,r){var i,o,s,l,c=0;y=i=y+-64|0,vt(i+8|0,0,52),c=Ne(e),a[i+20>>2]=c,a[i+36>>2]=c,a[i+4>>2]=c,o=_(c),a[i+32>>2]=o,s=_(c),a[i+16>>2]=s,l=_(c),a[i>>2]=l;e:if(!l|!o|!s||!(c=_(c)))O(o),O(s),O(l),e=-22;else{if(e=W(i,e,r)){O(a[i+32>>2]),O(a[i+16>>2]),O(a[i>>2]),O(c);break e}e=0,t=I(a[i+40>>2],a[i+44>>2],a[i+52>>2],t,n,a[i+16>>2],a[i+20>>2],c,a[i+4>>2],0,0,r),O(a[i+32>>2]),O(a[i+16>>2]),(t||Ze(c,a[i>>2],a[i+4>>2]))&&(e=-35),O(c),O(a[i>>2])}return y=i- -64|0,e}function pe(e,t,n,r,i){var o,s=0,c=0;y=o=y+-64|0;e:{t:{if(!n&(c=Ne(e))>>>0<128){if(a[o+56>>2]=0,a[o+48>>2]=0,a[o+52>>2]=0,a[o+40>>2]=0,a[o+44>>2]=0,n=0,c&&(n=c),!(s=_(n))|!(3&l[s-4|0])||vt(s,0,n),s)break t}else a[8952]=28;e=-1;break e}a[o+32>>2]=0,a[o+36>>2]=0,a[o+8>>2]=s,a[o+16>>2]=s,a[o+20>>2]=c,a[o>>2]=s,a[o+12>>2]=c,a[o+24>>2]=0,a[o+28>>2]=0,a[o+4>>2]=c,W(o,e,i)?(a[8952]=28,e=-1):e=(0|t)!=a[o+40>>2]|a[o+44>>2]!=(r>>>10|0),O(s)}return y=o- -64|0,e}function fe(e,t,n,r,i,o,s,c,u,d,h){var p,f,g,m;return y=p=y-48|0,a[p+4>>2]=0,U(f=p+16|0,d,h),h=l[d+20|0]|l[d+21|0]<<8|l[d+22|0]<<16|l[d+23|0]<<24,a[p+8>>2]=l[d+16|0]|l[d+17|0]<<8|l[d+18|0]<<16|l[d+19|0]<<24,a[p+12>>2]=h,y=h=y-336|0,$t(g=h+16|0,64,m=p+4|0,f),hn(d=h+80|0,g),bn(g,64),nn(d,s,c,u),nn(d,34960,0-c&15,0),_t(e,r,i,o,m,1,f),nn(d,e,i,o),nn(d,34960,0-i&15,0),ot(e=h+8|0,c,u),nn(d,e,8,0),ot(e,i,o),nn(d,e,8,0),pn(d,t),bn(d,256),n&&(a[n>>2]=16,a[n+4>>2]=0),y=h+336|0,bn(f,32),y=p+48|0,0}function ge(e,t,n){var r,i,o,s,l,c,u,d,h,p,f,g,m,y,v,A,b,w;r=a[n+4>>2],i=a[t+4>>2],o=a[n+8>>2],s=a[t+8>>2],l=a[n+12>>2],c=a[t+12>>2],u=a[n+16>>2],d=a[t+16>>2],h=a[n+20>>2],p=a[t+20>>2],f=a[n+24>>2],g=a[t+24>>2],m=a[n+28>>2],y=a[t+28>>2],v=a[n+32>>2],A=a[t+32>>2],b=a[n+36>>2],w=a[t+36>>2],a[e>>2]=a[t>>2]-a[n>>2],a[e+36>>2]=w-b,a[e+32>>2]=A-v,a[e+28>>2]=y-m,a[e+24>>2]=g-f,a[e+20>>2]=p-h,a[e+16>>2]=d-u,a[e+12>>2]=c-l,a[e+8>>2]=s-o,a[e+4>>2]=i-r}function me(e,t,n){var r,i,o,s,l,c,u,d,h,p,f,g,m,y,v,A,b,w;r=a[n+4>>2],i=a[t+4>>2],o=a[n+8>>2],s=a[t+8>>2],l=a[n+12>>2],c=a[t+12>>2],u=a[n+16>>2],d=a[t+16>>2],h=a[n+20>>2],p=a[t+20>>2],f=a[n+24>>2],g=a[t+24>>2],m=a[n+28>>2],y=a[t+28>>2],v=a[n+32>>2],A=a[t+32>>2],b=a[n+36>>2],w=a[t+36>>2],a[e>>2]=a[n>>2]+a[t>>2],a[e+36>>2]=b+w,a[e+32>>2]=v+A,a[e+28>>2]=m+y,a[e+24>>2]=f+g,a[e+20>>2]=h+p,a[e+16>>2]=u+d,a[e+12>>2]=l+c,a[e+8>>2]=o+s,a[e+4>>2]=r+i}function ye(e){var t,n=0,r=0,i=0,s=0;for(o[11+(t=y-16|0)|0]=0,o[t+12|0]=0,o[t+13|0]=0,o[t+14|0]=0,a[t+8>>2]=0;;){for(i=l[e+r|0],n=0;o[0|(s=(t+8|0)+n|0)]=l[0|s]|i^l[(2528+(n<<5)|0)+r|0],7!=(0|(n=n+1|0)););if(31==(0|(r=r+1|0)))break}for(r=127&l[e+31|0],e=0,n=0;o[0|(i=(t+8|0)+n|0)]=l[0|i]|r^l[2559+(n<<5)|0],7!=(0|(n=n+1|0)););for(n=0;n=l[(t+8|0)+e|0]-1|n,7!=(0|(e=e+1|0)););return n>>>8&1}function ve(e,t){var n=0,r=0,i=0,s=0;for(vt(pt(e,33984,64)- -64|0,0,293);r=(n=s<<3)+e|0,i=l[0|(n=t+n|0)]|l[n+1|0]<<8|l[n+2|0]<<16|l[n+3|0]<<24,n=(l[n+4|0]|l[n+5|0]<<8|l[n+6|0]<<16|l[n+7|0]<<24)^(l[r+4|0]|l[r+5|0]<<8|l[r+6|0]<<16|l[r+7|0]<<24),i^=l[0|r]|l[r+1|0]<<8|l[r+2|0]<<16|l[r+3|0]<<24,o[0|r]=i,o[r+1|0]=i>>>8,o[r+2|0]=i>>>16,o[r+3|0]=i>>>24,o[r+4|0]=n,o[r+5|0]=n>>>8,o[r+6|0]=n>>>16,o[r+7|0]=n>>>24,8!=(0|(s=s+1|0)););}function Ae(e,t){var n=0,r=0;e:if(r=255&t){if(3&e)for(;;){if(!(n=l[0|e])|(0|n)==(255&t))break e;if(!(3&(e=e+1|0)))break}t:if(!((-1^(n=a[e>>2]))&n-16843009&-2139062144))for(r=u(r,16843009);;){if((-1^(n^=r))&n-16843009&-2139062144)break t;if(n=a[e+4>>2],e=e+4|0,n-16843009&(-1^n)&-2139062144)break}for(;n=e,(r=l[0|e])&&(e=n+1|0,(0|r)!=(255&t)););e=n}else e=Ne(e)+e|0;return l[0|e]==(255&t)?e:0}function be(e,t,n){var r=0,i=0,s=0,l=0,c=0,u=0;if(n>>>0>=8)for(l=n>>>3|0,n=0;s=(r=n<<3)+e|0,c=(r=a[4+(i=t+r|0)>>2])<<24|(i=a[i>>2])>>>8,u=r<<8|i>>>24,r=-16777216&((255&r)<<24|i>>>8)|16711680&((16777215&r)<<8|i>>>24)|r>>>8&65280|r>>>24,o[0|s]=r,o[s+1|0]=r>>>8,o[s+2|0]=r>>>16,o[s+3|0]=r>>>24,r=i<<8&16711680|i<<24|65280&c|255&u,o[s+4|0]=r,o[s+5|0]=r>>>8,o[s+6|0]=r>>>16,o[s+7|0]=r>>>24,(0|l)!=(0|(n=n+1|0)););}function we(e,t,n){var r,i,o=0,s=0,a=0;return r=e,e=31&(o=a=63&n),o>>>0>=32?(e=-1<<e,o=0):e=(o=-1<<e)|(1<<e)-1&-1>>>32-e,i=o&r,s=e&t,o=31&a,a>>>0>=32?(e=0,a=s>>>o|0):(e=s>>>o|0,a=((1<<o)-1&s)<<32-o|i>>>o),o=e,n=31&(s=0-n&63),s>>>0>=32?(e=0,n=-1>>>n|0):n=(e=-1>>>n|0)|(1<<n)-1<<32-n,n&=r,t&=e,e=31&s,s>>>0>=32?(t=n<<e,e=0):(t=(1<<e)-1&n>>>32-e|t<<e,e=n<<e),b=t|o,e|a}function Se(e,t,n){var r=0,i=0,o=0,s=0;return s=e,e=0,i=31&(r=o=63&n),r=r>>>0>=32?-1>>>i|0:(e=-1>>>i|0)|(1<<i)-1<<32-i,r&=s,e&=t,i=31&o,o>>>0>=32?(e=r<<i,r=0):(e=(1<<i)-1&r>>>32-i|e<<i,r<<=i),i=e,e=31&(n=0-n&63),n>>>0>=32?(e=-1<<e,o=0):e=(o=-1<<e)|(1<<e)-1&-1>>>32-e,s&=o,t&=e,e=31&n,n>>>0>=32?(n=0,e=t>>>e|0):(n=t>>>e|0,e=((1<<e)-1&t)<<32-e|s>>>e),b=n|i,e|r}function Ce(e,t,n){var r,i,o,s;y=r=y-128|0,cn(e),cn(i=e+40|0),wn(o=e+80|0),jt(e,t=u(t,960)+2784|0,en(n=n-((0-(s=(128&n)>>>7|0)&n)<<1)<<24>>24,1)),jt(e,t+120|0,en(n,2)),jt(e,t+240|0,en(n,3)),jt(e,t+360|0,en(n,4)),jt(e,t+480|0,en(n,5)),jt(e,t+600|0,en(n,6)),jt(e,t+720|0,en(n,7)),jt(e,t+840|0,en(n,8)),ke(t=r+8|0,i),ke(r+48|0,e),_e(r+88|0,o),jt(e,t,s),y=r+128|0}function Ee(e,t,n,r,i,o,s,a,l,c){var u,d,h;return y=d=y-352|0,gn(h=d+32|0,64,l,c),hn(u=d+96|0,h),bn(h,64),nn(u,o,s,a),nn(u,34064,0-s&15,0),nn(u,t,n,r),nn(u,34064,0-n&15,0),ot(o=d+24|0,s,a),nn(u,o,8,0),ot(o,n,r),nn(u,o,8,0),pn(u,d),bn(u,256),i=dn(d,i),bn(d,16),e&&(i?(vt(e,0,n),i=-1):(qe(e,t,n,r,l,1,c),i=0)),y=d+352|0,i}function Ie(e,t){var n,r=0,i=0,o=0,s=0,c=0;e:if(!(((n=l[0|e])-58&255)>>>0<246)){for(i=n,r=e;;){if(s=r,o>>>0>429496729)break e;if((i=(255&i)-48|0)>>>0>(-1^(r=u(o,10)))>>>0)break e;if(o=r+i|0,!(((i=l[0|(r=s+1|0)])-58&255)>>>0>245))break}48==(0|n)&(0|e)!=(0|s)|(0|e)==(0|r)||(a[t>>2]=o,c=r)}return c}function _e(e,t){var n,r,i,o,s,l,c,u,d;n=a[t+4>>2],r=a[t+8>>2],i=a[t+12>>2],o=a[t+16>>2],s=a[t+20>>2],l=a[t+24>>2],c=a[t+28>>2],u=a[t+32>>2],d=a[t+36>>2],a[e>>2]=0-a[t>>2],a[e+36>>2]=0-d,a[e+32>>2]=0-u,a[e+28>>2]=0-c,a[e+24>>2]=0-l,a[e+20>>2]=0-s,a[e+16>>2]=0-o,a[e+12>>2]=0-i,a[e+8>>2]=0-r,a[e+4>>2]=0-n}function xe(e,t,n,r,i,o,s,l,c,u,d){var h,p,f;return y=p=y-336|0,gn(f=p+16|0,64,u,d),hn(h=p+80|0,f),bn(f,64),nn(h,s,l,c),nn(h,34064,0-l&15,0),qe(e,r,i,o,u,1,d),nn(h,e,i,o),nn(h,34064,0-i&15,0),ot(e=p+8|0,l,c),nn(h,e,8,0),ot(e,i,o),nn(h,e,8,0),pn(h,t),bn(h,256),n&&(a[n>>2]=16,a[n+4>>2]=0),y=p+336|0,0}function Pe(e,t,n,r,i,o,s,a,l,c){var u,d,h;return y=u=y-352|0,tn(h=u+32|0,l,c),hn(d=u+96|0,h),bn(h,64),nn(d,o,s,a),ot(o=u+24|0,s,a),nn(d,o,8,0),nn(d,t,n,r),ot(o,n,r),nn(d,o,8,0),pn(d,u),bn(d,256),i=dn(u,i),bn(u,16),e&&(i?(vt(e,0,n),i=-1):(xt(e,t,n,r,l,c),i=0)),y=u+352|0,i}function ke(e,t){var n,r,i,o,s,l,c,u,d;n=a[t+8>>2],r=a[t+12>>2],i=a[t+16>>2],o=a[t+20>>2],s=a[t+24>>2],l=a[t+28>>2],c=a[t>>2],u=a[t+4>>2],d=a[t+36>>2],a[e+32>>2]=a[t+32>>2],a[e+36>>2]=d,a[e+24>>2]=s,a[e+28>>2]=l,a[e+16>>2]=i,a[e+20>>2]=o,a[e+8>>2]=n,a[e+12>>2]=r,a[e>>2]=c,a[e+4>>2]=u}function Be(e,t,n){n?(a[e+48>>2]=l[0|n]|l[n+1|0]<<8|l[n+2|0]<<16|l[n+3|0]<<24,n=l[n+4|0]|l[n+5|0]<<8|l[n+6|0]<<16|l[n+7|0]<<24):(a[e+48>>2]=0,n=0),a[e+52>>2]=n,a[e+56>>2]=l[0|t]|l[t+1|0]<<8|l[t+2|0]<<16|l[t+3|0]<<24,a[e+60>>2]=l[t+4|0]|l[t+5|0]<<8|l[t+6|0]<<16|l[t+7|0]<<24}function Oe(e,t,n,r){var i;if(y=i=y-192|0,!(!n|(t-65&255)>>>0<=191|(r-65&255)>>>0<=191))return s[i+130>>1]=257,o[i+129|0]=r,o[i+128|0]=t,Rt(4|(t=i+128|0)),ot(8|t,0,0),vt(i+144|0,0,48),ve(e,t),vt(r+i|0,0,r<<24>>24<0?0:128-r|0),ne(t=e,e=pt(i,n,r),128,0),bn(e,128),y=e+192|0,0;Ut(),h()}function Ne(e){var t=0,n=0,r=0;e:{if(3&(t=e))for(;;){if(!l[0|t])break e;if(!(3&(t=t+1|0)))break}for(;n=t,t=t+4|0,!((-1^(r=a[n>>2]))&r-16843009&-2139062144););if(!(255&r))return n-e|0;for(;r=l[n+1|0],n=t=n+1|0,r;);}return t-e|0}function De(e,t,n,r,i,o,s){var a=0,l=0;return t-65>>>0<4294967232|s>>>0>64?e=-1:(l=a=y,y=a=a-384&-64,!(!(r|i)||n)|!e|((t&=255)-65&255)>>>0<=191|!(!(s&=255)||o)|s>>>0>=65?(Ut(),h()):(s?Oe(a,t,o,s):We(a,t),ne(a,n,r,i),M(a,e,t),y=l),e=0),e}function je(e,t){var n,r,i=0;y=n=y-704|0,(r=a[e+72>>2]>>>3&127)>>>0<=111?pt(80+(e+r|0)|0,34784,112-r|0):(pt((i=e+80|0)+r|0,34784,128-r|0),C(e,i,n,n+640|0),vt(i,0,112)),be(e+192|0,e- -64|0,16),C(e,e+80|0,n,n+640|0),be(t,e,64),bn(n,704),bn(e,208),y=n+704|0}function Te(e,t,n,r,i,o,s,l,c,u,d){var h,p,f;return y=p=y-336|0,tn(f=p+16|0,u,d),hn(h=p+80|0,f),bn(f,64),nn(h,s,l,c),ot(s=p+8|0,l,c),nn(h,s,8,0),xt(e,r,i,o,u,d),nn(h,e,i,o),ot(s,i,o),nn(h,s,8,0),pn(h,t),bn(h,256),n&&(a[n>>2]=16,a[n+4>>2]=0),y=p+336|0,0}function Me(e,t,n){a[e+48>>2]=n?l[0|n]|l[n+1|0]<<8|l[n+2|0]<<16|l[n+3|0]<<24:0,a[e+52>>2]=l[0|t]|l[t+1|0]<<8|l[t+2|0]<<16|l[t+3|0]<<24,a[e+56>>2]=l[t+4|0]|l[t+5|0]<<8|l[t+6|0]<<16|l[t+7|0]<<24,a[e+60>>2]=l[t+8|0]|l[t+9|0]<<8|l[t+10|0]<<16|l[t+11|0]<<24}function Fe(e,t,n,r,i,o,s){var l;return y=l=y-16|0,e=vt(e,0,128),!(r|o)&s>>>0<2147483649?!!(i|o)&s>>>0>8191?(st(l,16),e=I(i,s>>>10|0,1,t,n,l,16,0,32,e,128,2)?-1:0):(a[8952]=28,e=-1):(a[8952]=22,e=-1),y=l+16|0,e}function Re(e,t){var n=0;4&t&&((t=a[e>>2])&&bn(a[t+4>>2],a[e+16>>2]<<10),(t=a[e+4>>2])&&bn(t,a[e+20>>2]<<3)),O(a[e+4>>2]),a[e+4>>2]=0,(t=a[e>>2])&&(n=a[t>>2])&&O(n),O(t),a[e>>2]=0}function Le(e,t){var n,r,i=0,s=0,a=0,l=0;for(y=n=y-16|0,i=10;l=i,a=(t>>>0)/10|0,o[0|(s=(i=i-1|0)+(n+6|0)|0)]=t-u(a,10)|48,!(t>>>0<10)&&(t=a,i););r=pt(t=e,s,e=11-l|0)+e|0,o[0|r]=0,y=n+16|0}function Qe(e,t,n){var r,i,o,s=0;y=i=y-48|0,me(e,s=t+40|0,t),ge(r=e+40|0,s,t),x(s=e+80|0,e,n+40|0),x(r,r,n),x(o=e+120|0,n+120|0,t+120|0),x(e,t+80|0,n+80|0),me(i,e,e),ge(e,s,r),me(r,s,r),ge(s,i,o),me(o,i,o),y=i+48|0}function Ue(e,t,n){var r,i,o,s=0;y=i=y-48|0,me(e,s=t+40|0,t),ge(r=e+40|0,s,t),x(s=e+80|0,e,n),x(r,r,n+40|0),x(o=e+120|0,n+120|0,t+120|0),x(e,t+80|0,n+80|0),me(i,e,e),ge(e,s,r),me(r,s,r),me(s,i,o),ge(o,i,o),y=i+48|0}function Ve(e,t,n){var r=0,i=0,o=0;if(!n)return 0;e:if(r=l[0|e]){for(;;){if((i=l[0|t])&&!(!(n=n-1|0)|(0|r)!=(0|i))){if(t=t+1|0,r=l[e+1|0],e=e+1|0,r)continue;break e}break}o=r}return(255&o)-l[0|t]|0}function Ke(e,t){for(var n=0,r=0,i=0,o=0;i=(n=r<<3)+e|0,o=l[0|(n=t+n|0)]|l[n+1|0]<<8|l[n+2|0]<<16|l[n+3|0]<<24,n=l[n+4|0]|l[n+5|0]<<8|l[n+6|0]<<16|l[n+7|0]<<24,a[i>>2]=o,a[i+4>>2]=n,128!=(0|(r=r+1|0)););}function He(e,t,n){var r;if(a[12+(r=y-16|0)>>2]=e,a[r+8>>2]=t,t=0,a[r+4>>2]=0,(0|n)>0)for(;a[r+4>>2]=a[r+4>>2]|l[a[r+8>>2]+t|0]^l[a[r+12>>2]+t|0],(0|n)!=(0|(t=t+1|0)););return(a[r+4>>2]-1>>>8&1)-1|0}function Ge(e,t,n){var r,i,o,s=0;y=i=y-48|0,me(e,s=t+40|0,t),ge(r=e+40|0,s,t),x(s=e+80|0,e,n),x(r,r,n+40|0),x(o=e+120|0,n+80|0,t+120|0),me(i,t=t+80|0,t),ge(e,s,r),me(r,s,r),me(s,i,o),ge(o,i,o),y=i+48|0}function Ye(e,t,n){var r,i=0,s=0;if(y=r=y-16|0,o[r+15|0]=0,s=-1,!(0|jn[a[8758]](e,t,n))){for(;o[r+15|0]=l[e+i|0]|l[r+15|0],32!=(0|(i=i+1|0)););s=(l[r+15|0]<<23)-8388608>>31}return y=r+16|0,s}function ze(e,t,n,r){var i,o,s,a,l=0,c=0;return a=u(l=n>>>16|0,c=e>>>16|0),l=(65535&(c=((s=u(i=65535&n,o=65535&e))>>>16|0)+u(c,i)|0))+u(l,o)|0,b=(u(t,n)+a|0)+u(e,r)+(c>>>16)+(l>>>16)|0,65535&s|l<<16}function Ze(e,t,n){var r;if(a[12+(r=y-16|0)>>2]=e,a[r+8>>2]=t,t=0,o[r+7|0]=0,n)for(;o[r+7|0]=l[r+7|0]|l[a[r+8>>2]+t|0]^l[a[r+12>>2]+t|0],(0|n)!=(0|(t=t+1|0)););return(l[r+7|0]-1>>>8&1)-1|0}function We(e,t){var n;return y=n=y+-64|0,(t-65&255)>>>0<=191&&(Ut(),h()),o[n+3|0]=1,o[n+1|0]=0,o[n+2|0]=1,o[0|n]=t,Rt(4|n),ot(8|n,0,0),vt(n+16|0,0,48),ve(e,n),y=n- -64|0,0}function qe(e,t,n,r,i,o,s){var a=0,l=0;a=r,1==(((a=(l=n+63|0)>>>0<63?a+1|0:a)>>>6|0)+(0!=(0|(a=(63&a)<<26|l>>>6)))|0)&o>>>0>(l=0-a|0)>>>0&&(Ut(),h()),_t(e,t,n,r,i,o,s)}function Je(e,t,n,r){var i=0;i=-1;e:if(!(r-65>>>0<4294967232|n>>>0>64)){t:{if(!n||!t){if(!We(e,255&r))break t;break e}if(Oe(e,255&r,t,255&n))break e}i=0}return i}function Xe(e,t,n,r){return(r=(1+(e^r)>>>8^-1)&n|(1+(16321^e)>>>8^-1)&t|(t=e+65510>>>8&255)&e+65)|(n=e+65484>>>8|0)&e+71&(255^t)|e+252&e+65474>>>8&(-1^n)&255}function $e(e){var t,n;return(e=(t=a[8748])+(n=e+3&-4)|0)>>>0<=t>>>0&&n||e>>>0>Tn()<<16>>>0&&!(0|g(0|e))?(a[8952]=48,-1):(a[8748]=e,t)}function et(e,t){for(var n=0,r=0,i=0,o=0;r=(n=i<<3)+e|0,o=a[(n=t+n|0)>>2],n=a[r+4>>2]^a[n+4>>2],a[r>>2]=a[r>>2]^o,a[r+4>>2]=n,128!=(0|(i=i+1|0)););}function tt(e,t){var n,r,i,s,a;y=n=y-144|0,J(r=n+96|0,t+80|0),x(i=n+48|0,t,r),x(n,t+40|0,r),G(e,n),s=e,a=Dt(i)<<7^l[e+31|0],o[s+31|0]=a,y=n+144|0}function nt(e,t,n){var r=0;if(e>>>0<t>>>0)return pt(e,t,n);if(n)for(r=e+n|0,t=t+n|0;t=t-1|0,o[0|(r=r-1|0)]=l[0|t],n=n-1|0;);return e}function rt(e,t){var n,r=0;if(o[15+(n=y-16|0)|0]=0,t)for(;o[n+15|0]=l[e+r|0]|l[n+15|0],(0|(r=r+1|0))!=(0|t););return l[n+15|0]-1>>>8&1}function it(e,t,n,r){var i;return r=t+r|0,r=(i=e+n|0)>>>0<n>>>0?r+1|0:r,n=ze(e<<1&-2,1&(t=t<<1|e>>>31),n,0),e=b+r|0,b=e=(t=n+i|0)>>>0<n>>>0?e+1|0:e,t}function ot(e,t,n){o[0|e]=t,o[e+1|0]=t>>>8,o[e+2|0]=t>>>16,o[e+3|0]=t>>>24,o[e+4|0]=n,o[e+5|0]=n>>>8,o[e+6|0]=n>>>16,o[e+7|0]=n>>>24}function st(e,t){e|=0;var n=0,r=0,i=0;if(t|=0)for(;r=e+n|0,i=Ct(),o[0|r]=i,(0|(n=n+1|0))!=(0|t););}function at(e,t,n,r,i){var o,s;return e|=0,t|=0,n|=0,r|=0,y=o=(s=y)-128&-64,te(o,i|=0),$(o,t,n,r),q(o,e),y=s,0}function lt(e){var t=0,n=0,r=0;for(t=1;t=l[0|(r=e+n|0)]+t|0,o[0|r]=t,t=t>>>8|0,4!=(0|(n=n+1|0)););}function ct(e,t,n,r,i,o,s,a){var l,c=0;return y=l=y-32|0,c=-1,dt(l,s,a)||(c=Zt(e,t,n,r,i,o,l),bn(l,32)),y=l+32|0,c}function ut(e,t,n,r,i,o,s,a){var l,c=0;return y=l=y-32|0,c=-1,dt(l,s,a)||(c=Wt(e,t,n,r,i,o,l),bn(l,32)),y=l+32|0,c}function dt(e,t,n){e|=0;var r,i=0;return y=r=y-32|0,i=-1,Ye(r,n|=0,t|=0)||(i=K(e,34976,r)),y=r+32|0,0|i}function ht(e,t){var n,r,i;x(e,t,n=t+120|0),x(e+40|0,r=t+40|0,i=t+80|0),x(e+80|0,i,n),x(e+120|0,t,r)}function pt(e,t,n){var r=0;if(n)for(r=e;o[0|r]=l[0|t],r=r+1|0,t=t+1|0,n=n-1|0;);return e}function ft(e,t){var n,r;y=r=y-128|0,ke(n=r+8|0,t),ke(n+40|0,t+40|0),ke(n+80|0,t+80|0),P(e,n),y=r+128|0}function gt(e,t,n,r,i,o,s){return!r&n>>>0>=16|r?ut(e,t+16|0,t,n-16|0,r-(n>>>0<16)|0,i,o,s):-1}function mt(e,t){for(var n=0,r=0;o[0|(r=e+n|0)]=l[0|r]^l[t+n|0],8!=(0|(n=n+1|0)););}function yt(e,t,n){var r,i;y=r=(i=y)-384&-64,Tt(r,0,0,24),ln(r,t,32,0),ln(r,n,32,0),Lt(r,e,24),y=i}function vt(e,t,n){var r=0;if(n)for(r=e;o[0|r]=t,r=r+1|0,n=n-1|0;);return e}function At(e,t){var n;me(e,n=t+40|0,t),ge(e+40|0,n,t),ke(e+80|0,t+80|0),x(e+120|0,t+120|0,1520)}function bt(e,t){var n;x(e,t,n=t+120|0),x(e+40|0,t+40|0,t=t+80|0),x(e+80|0,t,n)}function wt(e,t,n,r,i,o,s){return!r&n>>>0>=4294967280|r&&(Ut(),h()),ct(e+16|0,e,t,n,r,i,o,s)}function St(e){var t;return t=l[0|e]|l[e+1|0]<<8,e=l[e+2|0],b=e>>>16|0,t|e<<16}function Ct(){var e,t;return y=e=y-16|0,o[e+15|0]=0,t=0|f(35048,e+15|0,0),y=e+16|0,0|t}function Et(e,t){var n=0;return(-1>>>(n=31&t)&e)<<n|((n=e)&-1<<(e=0-t&31))>>>e}function It(e,t,n,r){var i;return y=i=y-208|0,Pt(i),Z(i,t,n,r),je(i,e),y=i+208|0,0}function _t(e,t,n,r,i,o,s){1==(0|r)|r>>>0>1&&(Ut(),h()),jn[a[8752]](e,t,n,r,i,o,s)}function xt(e,t,n,r,i,o){1==(0|r)|r>>>0>1&&(Ut(),h()),jn[a[8751]](e,t,n,r,i,1,0,o)}function Pt(e){a[e+64>>2]=0,a[e+68>>2]=0,a[e+72>>2]=0,a[e+76>>2]=0,pt(e,34080,64)}function kt(e,t,n){return n>>>0>=256&&(p(1279,1206,107,1067),h()),M(e,t,255&n)}function Bt(){var e;y=e=y-16|0,o[e+15|0]=0,f(35084,e+15|0,0),y=e+16|0}function Ot(e,t){o[0|e]=t,o[e+1|0]=t>>>8,o[e+2|0]=t>>>16,o[e+3|0]=t>>>24}function Nt(e){var t;return y=t=y-32|0,G(t,e),e=rt(t,32),y=t+32|0,e}function Dt(e){var t;return y=t=y-32|0,G(t,e),y=t+32|0,1&o[0|t]}function jt(e,t,n){ce(e,t,n),ce(e+40|0,t+40|0,n),ce(e+80|0,t+80|0,n)}function Tt(e,t,n,r){return 0|Je(e|=0,t|=0,n|=0,r|=0)}function Mt(e){o[e+32|0]=1,o[e+33|0]=0,o[e+34|0]=0,o[e+35|0]=0}function Ft(e){a[e>>2]=0,a[e+4>>2]=0,a[e+8>>2]=0,a[e+12>>2]=0}function Rt(e){o[0|e]=0,o[e+1|0]=0,o[e+2|0]=0,o[e+3|0]=0}function Lt(e,t,n){return 0|kt(e|=0,t|=0,n|=0)}function Qt(e,t,n){return 0|Ye(e|=0,t|=0,n|=0)}function Ut(){var e;(e=a[9098])&&jn[0|e](),m(),h()}function Vt(e){wn(e),cn(e+40|0),cn(e+80|0),wn(e+120|0)}function Kt(e,t,n,r,i,o){jn[a[8761]](e,t,n,r,i,1,0,o)}function Ht(e,t,n,r,i,o){jn[a[8761]](e,t,n,r,i,0,0,o)}function Gt(e,t){return e|=0,st(t|=0,32),0|rn(e,t)}function Yt(e,t,n,r,i,o){return S(e,t,n,r,i,o,0),0}function zt(e,t,n,r,i,o,s){return De(e,t,n,r,i,o,s)}function Zt(e,t,n,r,i,o,s){return se(e,t,n,r,i,o,s)}function Wt(e,t,n,r,i,o,s){return ae(e,t,n,r,i,o,s)}function qt(e,t){Pt(e),t&&Z(e,34912,34,0)}function Jt(e,t,n,r,i){return Q(e,t,n,r,i,0)}function Xt(e,t){return 0|rn(e|=0,t|=0)}function $t(e,t,n,r){jn[a[8750]](e,t,0,n,r)}function en(e,t){return(255&(e^t))-1>>>31|0}function tn(e,t,n){jn[a[8749]](e,64,0,t,n)}function nn(e,t,n,r){jn[a[8756]](e,t,n,r)}function rn(e,t){return 0|jn[a[8759]](e,t)}function on(e,t,n,r){return ne(e,t,n,r)}function sn(e){return Xe(e,45,95,32704)}function an(e){return Xe(e,43,47,16320)}function ln(e,t,n,r){return on(e,t,n,r)}function cn(e){a[e>>2]=1,vt(e+4|0,0,36)}function un(e){1!=(-7&e)&&(Ut(),h())}function dn(e,t){return He(e,t,16)}function hn(e,t){jn[a[8755]](e,t)}function pn(e,t){jn[a[8757]](e,t)}function fn(e,t){return He(e,t,32)}function gn(e,t,n,r){$t(e,t,n,r)}function mn(e,t){return Et(e,t)}function yn(e,t){pt(e,t,1024)}function vn(e){st(e|=0,32)}function An(e){vt(e,0,1024)}function bn(e,t){vt(e,0,t)}function wn(e){vt(e,0,40)}function Sn(){return 32}function Cn(){return 24}function En(){return-17}function In(){return 64}function _n(){return 16}function xn(){return 1}function Pn(){return 2}function kn(){return 8}function Bn(){return 3}function On(){return 0}function Nn(){return-1}i(t=l,1024,"TGlic29kaXVtRFJHcmFuZG9tYnl0ZXMAYjY0X3BvcyA8PSBiNjRfbGVuAGNyeXB0b19nZW5lcmljaGFzaF9ibGFrZTJiX2ZpbmFsACRhcmdvbjJpACRhcmdvbjJpZAByYW5kb21ieXRlcy9yYW5kb21ieXRlcy5jAHNvZGl1bS9jb2RlY3MuYwBjcnlwdG9fZ2VuZXJpY2hhc2gvYmxha2UyYi9yZWYvYmxha2UyYi1yZWYuYwBjcnlwdG9fZ2VuZXJpY2hhc2gvYmxha2UyYi9yZWYvZ2VuZXJpY2hhc2hfYmxha2UyYi5jAGJ1Zl9sZW4gPD0gU0laRV9NQVgAb3V0bGVuIDw9IFVJTlQ4X01BWABTLT5idWZsZW4gPD0gQkxBS0UyQl9CTE9DS0JZVEVTACRhcmdvbjJpJHY9ACRhcmdvbjJpZCR2PQAsdD0ALHA9ACRtPQAxLjAuMTgAc29kaXVtX2JpbjJiYXNlNjQAJGFyZ29uMmkkACRhcmdvbjJpZCQ="),i(t,1424,"tnhZ/4Vy0wC9bhX/DwpqACnAAQCY6Hn/vDyg/5lxzv8At+L+tA1I/wAAAAAAAAAAsKAO/tPJhv+eGI8Af2k1AGAMvQCn1/v/n0yA/mpl4f8e/AQAkgyu"),i(t,1520,"WfGy/grlpv973Sr+HhTUAFKAAwAw0fMAd3lA/zLjnP8AbsUBZxuQ"),i(t,1568,"hTuMAb3xJP/4JcMBYNw3ALdMPv/DQj0AMkykAeGkTP9MPaP/dT4fAFGRQP92QQ4AonPW/waKLgB85vT/CoqPADQawgC49EwAgY8pAb70E/97qnr/YoFEAHnVkwBWZR7/oWebAIxZQ//v5b4BQwu1AMbwif7uRbz/Q5fuABMqbP/lVXEBMkSH/xFqCQAyZwH/UAGoASOYHv8QqLkBOFno/2XS/AAp+kcAzKpP/w4u7/9QTe8AvdZL/xGN+QAmUEz/vlV1AFbkqgCc2NABw8+k/5ZCTP+v4RD/jVBiAUzb8gDGonIALtqYAJsr8f6boGj/M7ulAAIRrwBCVKAB9zoeACNBNf5F7L8ALYb1AaN73QAgbhT/NBelALrWRwDpsGAA8u82ATlZigBTAFT/iKBkAFyOeP5ofL4AtbE+//opVQCYgioBYPz2AJeXP/7vhT4AIDicAC2nvf+OhbMBg1bTALuzlv76qg7/0qNOACU0lwBjTRoA7pzV/9XA0QFJLlQAFEEpATbOTwDJg5L+qm8Y/7EhMv6rJsv/Tvd0ANHdmQCFgLIBOiwZAMknOwG9E/wAMeXSAXW7dQC1s7gBAHLbADBekwD1KTgAfQ3M/vStdwAs3SD+VOoUAPmgxgHsfur/L2Oo/qrimf9ms9gA4o16/3pCmf629YYA4+QZAdY56//YrTj/tefSAHeAnf+BX4j/bn4zAAKpt/8HgmL+RbBe/3QE4wHZ8pH/yq0fAWkBJ/8ur0UA5C86/9fgRf7POEX/EP6L/xfP1P/KFH7/X9Vg/wmwIQDIBc//8SqA/iMhwP/45cQBgRF4APtnl/8HNHD/jDhC/yji9f/ZRiX+rNYJ/0hDhgGSwNb/LCZwAES4S//OWvsAleuNALWqOgB09O8AXJ0CAGatYgDpiWABfzHLAAWblAAXlAn/03oMACKGGv/bzIgAhggp/+BTK/5VGfcAbX8A/qmIMADud9v/563VAM4S/v4Iugf/fgkHAW8qSABvNOz+YD+NAJO/f/7NTsD/DmrtAbvbTACv87v+aVmtAFUZWQGi85QAAnbR/iGeCQCLoy7/XUYoAGwqjv5v/I7/m9+QADPlp/9J/Jv/XnQM/5ig2v+c7iX/s+rP/8UAs/+apI0A4cRoAAojGf7R1PL/Yf3e/rhl5QDeEn8BpIiH/x7PjP6SYfMAgcAa/slUIf9vCk7/k1Gy/wQEGACh7tf/Bo0hADXXDv8ptdD/54udALPL3f//uXEAveKs/3FC1v/KPi3/ZkAI/06uEP6FdUT/"),i(t,2560,"AQ=="),i(t,2592,"JuiVj8KyJ7BFw/SJ8u+Y8NXfrAXTxjM5sTgCiG1T/AXHF2pwPU3YT7o8C3YNEGcPKiBT+iw5zMZOx/13kqwDeuz///////////////////////////////////////9/7f///////////////////////////////////////3/u////////////////////////////////////////f+3T9VwaYxJY1pz3ot753hQ="),i(t,2783,"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"),i(t,33756,"AQ=="),i(t,33792,"AQ=="),i(t,33824,"4Ot6fDtBuK4WVuP68Z/EatoJjeucMrH9hmIFFl9JuABfnJW8o1CMJLHQsVWcg+9bBERcxFgcjobYIk7d0J8RV+z///////////////////////////////////////9/7f///////////////////////////////////////3/u////////////////////////////////////////fwjJvPNn5glqO6fKhIWuZ7sr+JT+cvNuPPE2HV869U+l0YLmrX9SDlEfbD4rjGgFm2u9Qfur2YMfeSF+ExnN4Fs="),i(t,34080,"CMm882fmCWo7p8qEha5nuyv4lP5y82488TYdXzr1T6XRguatf1IOUR9sPiuMaAWba71B+6vZgx95IX4TGc3gWyKuKNeYL4pCzWXvI5FEN3EvO03sz/vAtbzbiYGl27XpOLVI81vCVjkZ0AW28RHxWZtPGa+kgj+SGIFt2tVeHKtCAgOjmKoH2L5vcEUBW4MSjLLkTr6FMSTitP/Vw30MVW+Je/J0Xb5ysZYWO/6x3oA1Esclpwbcm5Qmac908ZvB0krxnsFpm+TjJU84hke+77XVjIvGncEPZZysd8yhDCR1AitZbyzpLYPkpm6qhHRK1PtBvdypsFy1UxGD2oj5dqvfZu5SUT6YEDK0LW3GMag/IfuYyCcDsOQO777Hf1m/wo+oPfML4MYlpwqTR5Gn1W+CA+BRY8oGcG4OCmcpKRT8L9JGhQq3JybJJlw4IRsu7SrEWvxtLE3fs5WdEw04U95jr4tUcwplqLJ3PLsKanbmru1HLsnCgTs1ghSFLHKSZAPxTKHov6IBMEK8S2YaqJGX+NBwi0vCML5UBqNRbMcYUu/WGeiS0RCpZVUkBpnWKiBxV4U1DvS40bsycKBqEMjQ0rgWwaQZU6tBUQhsNx6Z647fTHdIJ6hIm+G1vLA0Y1rJxbMMHDnLikHjSqrYTnPjY3dPypxbo7iy1vNvLmj8su9d7oKPdGAvF0NvY6V4cqvwoRR4yITsOWQaCALHjCgeYyP6/76Q6b2C3utsUKQVecay96P5vitTcuPyeHHGnGEm6s4+J8oHwsAhx7iG0R7r4M3WfdrqeNFu7n9PffW6bxdyqmfwBqaYyKLFfWMKrg35vgSYPxEbRxwTNQtxG4R9BCP1d9sokyTHQHuryjK8vskVCr6ePEwNEJzEZx1DtkI+y77UxUwqfmX8nCl/Wez61jqrb8tfF1hHSowZRGyA"),i(t,34912,"U2lnRWQyNTUxOSBubyBFZDI1NTE5IGNvbGxpc2lvbnMB"),i(t,34992,"MI5QAAEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0=");var Dn,jn=(Dn=[null,function(e,t,n,r,i){var o;return e|=0,r|=0,y=o=y+-64|0,(t|=0)|(n|=0)&&(oe(o,i|=0),Be(o,r,0),N(o,e=vt(e,0,t),e,t,n),bn(o,64)),y=o- -64|0,0},function(e,t,n,r,i){var o;return e|=0,r|=0,y=o=y+-64|0,(t|=0)|(n|=0)&&(oe(o,i|=0),Me(o,r,0),N(o,e=vt(e,0,t),e,t,n),bn(o,64)),y=o- -64|0,0},function(e,t,n,r,i,o,s,a){e|=0,t|=0,i|=0,o|=0,s|=0,a|=0;var l,c=0;return y=l=y-80|0,(n|=0)|(r|=0)&&(Ot(c=l+8|0,o),Ot(l+12|0,s),oe(o=l+16|0,a),Be(o,i,c),N(o,t,e,n,r),bn(o,64)),y=l+80|0,0},function(e,t,n,r,i,o,s){e|=0,t|=0,i|=0,o|=0,s|=0;var a,l=0;return y=a=y-80|0,(n|=0)|(r|=0)&&(Ot(l=a+12|0,o),oe(o=a+16|0,s),Me(o,i,l),N(o,t,e,n,r),bn(o,64)),y=a+80|0,0},at,function(e,t,n,r,i){var o;return e|=0,y=o=y-16|0,at(o,t|=0,n|=0,r|=0,i|=0),e=dn(e,o),y=o+16|0,0|e},function(e,t){return te(e|=0,t|=0),0},function(e,t,n,r){return $(e|=0,t|=0,n|=0,r|=0),0},function(e,t){return q(e|=0,t|=0),0},function(e,t,n){e|=0,t|=0,n|=0;var r,i=0,s=0,c=0,u=0,d=0,h=0,p=0,f=0,g=0,m=0,v=0,A=0,w=0,S=0,C=0,E=0,I=0,_=0,P=0,B=0,O=0,N=0,D=0,j=0,T=0,M=0,R=0,L=0,Q=0;for(u=-1,o[11+(s=(y=r=y-336|0)-16|0)|0]=0,o[s+12|0]=0,o[s+13|0]=0,o[s+14|0]=0,a[s+8>>2]=0;;){for(p=l[n+c|0],i=0;o[0|(d=(s+8|0)+i|0)]=l[0|d]|p^l[(33760+(i<<5)|0)+c|0],7!=(0|(i=i+1|0)););if(31==(0|(c=c+1|0)))break}for(p=127&l[n+31|0],c=0,i=0;o[0|(d=(s+8|0)+i|0)]=l[0|d]|p^l[33791+(i<<5)|0],7!=(0|(i=i+1|0)););for(i=0;i=l[(s+8|0)+c|0]-1|i,7!=(0|(c=c+1|0)););if(!(i>>>8&1)){for(u=0;o[e+u|0]=l[t+u|0],32!=(0|(u=u+1|0)););for(o[0|e]=248&l[0|e],o[e+31|0]=63&l[e+31|0]|64,F(t=r+288|0,n),cn(r+240|0),wn(r+192|0),ke(r+144|0,t),cn(r+96|0),n=254,t=0;i=t,ee(s=r+240|0,m=r+144|0,i^=t=l[(n>>>3|0)+e|0]>>>(7&n)&1),ee(h=r+192|0,u=r+96|0,i),N=n,n=n-1|0,ge(f=r+48|0,m,u),ge(r,s,h),me(s,s,h),me(h,m,u),x(u,f,s),x(h,h,r),k(f,r),k(r,s),me(m,u,h),ge(h,u,h),x(s,r,f),ge(r,r,f),k(h,h),S=i=a[r+4>>2],C=i>>31,E=i=a[r+8>>2],D=i>>31,A=i=a[r+12>>2],w=i>>31,I=i=a[r+16>>2],j=i>>31,g=i=a[r+20>>2],v=i>>31,_=i=a[r+24>>2],T=i>>31,M=i=a[r>>2],R=i>>31,s=ze(i=a[r+36>>2],i>>31,121666,0),i=b,L=c=s+16777216|0,p=i=c>>>0<16777216?i+1|0:i,P=s-(-33554432&c)|0,i=ze(i=a[r+32>>2],i>>31,121666,0),c=b,d=ze(s=a[r+28>>2],s>>31,121666,0),s=b,Q=i,B=i=d+16777216|0,c=(i=(s=i>>>0<16777216?s+1|0:s)>>25)+c|0,i=c=(s=Q+(O=(33554431&s)<<7|B>>>25)|0)>>>0<O>>>0?c+1|0:c,i=((67108863&(i=(c=s+33554432|0)>>>0<33554432?i+1|0:i))<<6|c>>>26)+P|0,a[u+36>>2]=i,i=-67108864&c,a[u+32>>2]=s-i,P=d-(-33554432&B)|0,s=ze(_,T,121666,0),_=b,c=ze(g,v,121666,0),i=b,d=s,g=s=c+16777216|0,v=(33554431&(i=s>>>0<16777216?i+1|0:i))<<7|s>>>25,i=(i>>25)+_|0,s=i=(d=d+v|0)>>>0<v>>>0?i+1|0:i,v=i=d+33554432|0,i=((67108863&(s=i>>>0<33554432?s+1|0:s))<<6|i>>>26)+P|0,a[u+28>>2]=i,i=-67108864&v,a[u+24>>2]=d-i,g=c-(-33554432&g)|0,i=ze(I,j,121666,0),I=b,d=ze(A,w,121666,0),s=b,c=i,A=i=d+16777216|0,w=(33554431&(s=i>>>0<16777216?s+1|0:s))<<7|i>>>25,s=(s>>25)+I|0,c=i=c+w|0,i=i>>>0<w>>>0?s+1|0:s,i=((67108863&(i=(s=c+33554432|0)>>>0<33554432?i+1|0:i))<<6|s>>>26)+g|0,a[u+20>>2]=i,i=-67108864&s,a[u+16>>2]=c-i,A=d-(-33554432&A)|0,i=ze(E,D,121666,0),E=b,d=ze(S,C,121666,0),c=b,g=i,S=i=d+16777216|0,s=i,i=(i=(c=i>>>0<16777216?c+1|0:c)>>25)+E|0,i=(s=g+(c=(33554431&c)<<7|s>>>25)|0)>>>0<c>>>0?i+1|0:i,c=s,s=i,C=i=c+33554432|0,i=((67108863&(s=i>>>0<33554432?s+1|0:s))<<6|i>>>26)+A|0,a[u+12>>2]=i,i=-67108864&C,a[u+8>>2]=c-i,i=ze((33554431&p)<<7|L>>>25,p>>25,19,0),c=b,s=(p=ze(M,R,121666,0))+i|0,i=b+c|0,c=s,s=s>>>0<p>>>0?i+1|0:i,p=i=c+33554432|0,i=(d-(-33554432&S)|0)+((67108863&(s=i>>>0<33554432?s+1|0:s))<<6|i>>>26)|0,a[u+4>>2]=i,i=-67108864&p,a[u>>2]=c-i,k(m,m),me(f,f,u),x(u,r+288|0,h),x(h,r,f),N;);ee(n=r+240|0,r+144|0,t),ee(i=r+192|0,r+96|0,t),J(i,i),x(n,n,i),G(e,n),u=0}return y=r+336|0,0|u},function(e,t){e|=0,t|=0;var n,r,i,s=0;for(y=n=y-208|0;o[e+s|0]=l[t+s|0],32!=(0|(s=s+1|0)););return o[0|e]=248&l[0|e],o[e+31|0]=63&l[e+31|0]|64,re(n+48|0,e),y=t=y-96|0,me(s=t+48|0,r=n+128|0,i=n+88|0),ge(t,r,i),J(t,t),x(n,s,t),y=t+96|0,G(e,n),y=n+208|0,0},function(e,t,n,r,i){e|=0,r|=0,i|=0;var s,c=0;if(y=s=y-112|0,(t|=0)|(n|=0)){c=l[i+28|0]|l[i+29|0]<<8|l[i+30|0]<<16|l[i+31|0]<<24,a[s+24>>2]=l[i+24|0]|l[i+25|0]<<8|l[i+26|0]<<16|l[i+27|0]<<24,a[s+28>>2]=c,c=l[i+20|0]|l[i+21|0]<<8|l[i+22|0]<<16|l[i+23|0]<<24,a[s+16>>2]=l[i+16|0]|l[i+17|0]<<8|l[i+18|0]<<16|l[i+19|0]<<24,a[s+20>>2]=c,c=l[i+4|0]|l[i+5|0]<<8|l[i+6|0]<<16|l[i+7|0]<<24,a[s>>2]=l[0|i]|l[i+1|0]<<8|l[i+2|0]<<16|l[i+3|0]<<24,a[s+4>>2]=c,c=l[i+12|0]|l[i+13|0]<<8|l[i+14|0]<<16|l[i+15|0]<<24,a[s+8>>2]=l[i+8|0]|l[i+9|0]<<8|l[i+10|0]<<16|l[i+11|0]<<24,a[s+12>>2]=c,i=l[0|r]|l[r+1|0]<<8|l[r+2|0]<<16|l[r+3|0]<<24,r=l[r+4|0]|l[r+5|0]<<8|l[r+6|0]<<16|l[r+7|0]<<24,a[s+104>>2]=0,a[s+108>>2]=0,a[s+96>>2]=i,a[s+100>>2]=r;e:{if(!n&t>>>0>=64|n){for(;;){for(L(e,s+96|0,s),i=8,r=1;r=l[0|(c=(s+96|0)+i|0)]+r|0,o[0|c]=r,r=r>>>8|0,16!=(0|(i=i+1|0)););if(e=e- -64|0,n=n-1|0,!(!(n=(t=t+-64|0)>>>0<4294967232?n+1|0:n)&t>>>0>63|n))break}if(!(t|n))break e}for(i=0,L(s+32|0,s+96|0,s);o[e+i|0]=l[(s+32|0)+i|0],(0|t)!=(0|(i=i+1|0)););}bn(s+32|0,64),bn(s,32)}return y=s+112|0,0},function(e,t,n,r,i,s,c,u){e|=0,t|=0,i|=0,s|=0,c|=0,u|=0;var d,h=0,p=0;if(y=d=y-112|0,(n|=0)|(r|=0)){for(h=l[u+28|0]|l[u+29|0]<<8|l[u+30|0]<<16|l[u+31|0]<<24,a[d+24>>2]=l[u+24|0]|l[u+25|0]<<8|l[u+26|0]<<16|l[u+27|0]<<24,a[d+28>>2]=h,h=l[u+20|0]|l[u+21|0]<<8|l[u+22|0]<<16|l[u+23|0]<<24,a[d+16>>2]=l[u+16|0]|l[u+17|0]<<8|l[u+18|0]<<16|l[u+19|0]<<24,a[d+20>>2]=h,h=l[u+4|0]|l[u+5|0]<<8|l[u+6|0]<<16|l[u+7|0]<<24,a[d>>2]=l[0|u]|l[u+1|0]<<8|l[u+2|0]<<16|l[u+3|0]<<24,a[d+4>>2]=h,h=8,p=l[u+12|0]|l[u+13|0]<<8|l[u+14|0]<<16|l[u+15|0]<<24,a[d+8>>2]=l[u+8|0]|l[u+9|0]<<8|l[u+10|0]<<16|l[u+11|0]<<24,a[d+12>>2]=p,u=l[i+4|0]|l[i+5|0]<<8|l[i+6|0]<<16|l[i+7|0]<<24,a[d+96>>2]=l[0|i]|l[i+1|0]<<8|l[i+2|0]<<16|l[i+3|0]<<24,a[d+100>>2]=u;o[(d+96|0)+h|0]=s,s=(255&c)<<24|s>>>8,c=c>>>8|0,16!=(0|(h=h+1|0)););if(!r&n>>>0>63|r)for(;;){for(h=0,L(d+32|0,d+96|0,d);o[e+h|0]=l[(d+32|0)+h|0]^l[t+h|0],u=1,64!=(0|(h=h+1|0)););for(h=8;i=l[0|(s=(d+96|0)+h|0)]+u|0,o[0|s]=i,u=i>>>8|0,16!=(0|(h=h+1|0)););if(t=t- -64|0,e=e- -64|0,r=r-1|0,!(!(r=(n=n+-64|0)>>>0<4294967232?r+1|0:r)&n>>>0>63|r))break}if(n|r)for(h=0,L(d+32|0,d+96|0,d);o[e+h|0]=l[(d+32|0)+h|0]^l[t+h|0],(0|n)!=(0|(h=h+1|0)););bn(d+32|0,64),bn(d,32)}return y=d+112|0,0}],Dn.grow=function(e){var t=this.length;return this.length=this.length+e,t},Dn.set=function(e,t){this[e]=t},Dn.get=function(e){return this[e]},Dn);function Tn(){return r.byteLength/65536|0}return{f:function(){},g:function(e,t,n,r,i,o,s,a,l,c,u,d){return 0|Te(e|=0,t|=0,n|=0,r|=0,(e=0)|(i|=0),o|=0,s|=0,e|(a|=0),l|=0,u|=0,d|=0)},h:function(e,t,n,r,i,o,s,l,c,u,d){return e|=0,t|=0,c|=0,c=r|=0,!(r=i|=0)&(i=0|c)>>>0<4294967280?(Te(e,e+i|0,0,n|=0,i,r,o|=0,s|=0,l|=0,u|=0,d|=0),t&&(r=(e=i+16|0)>>>0<16?r+1|0:r,a[t>>2]=e,a[t+4>>2]=r)):(Ut(),h()),0},i:function(e,t,n,r,i,o,s,a,l,c,u,d){return 0|xe(e|=0,t|=0,n|=0,r|=0,(e=0)|(i|=0),o|=0,s|=0,e|(a|=0),l|=0,u|=0,d|=0)},j:function(e,t,n,r,i,o,s,l,c,u,d){return e|=0,t|=0,c|=0,c=r|=0,!(r=i|=0)&(i=0|c)>>>0<4294967280?(xe(e,e+i|0,0,n|=0,i,r,o|=0,s|=0,l|=0,u|=0,d|=0),t&&(r=(e=i+16|0)>>>0<16?r+1|0:r,a[t>>2]=e,a[t+4>>2]=r)):(Ut(),h()),0},k:function(e,t,n,r,i,o,s,a,l,c,u){return 0|Pe(e|=0,n|=0,(e=0)|(r|=0),i|=0,o|=0,s|=0,e|(a|=0),l|=0,c|=0,u|=0)},l:function(e,t,n,r,i,o,s,l,c,u,d){return t|=0,n|=0,r|=0,i|=0,l|=0,l|=0,n=-1,!(o|=0)&(i|=0)>>>0>=16|o&&(n=Pe(e|=0,r,i-16|0,o-(i>>>0<16)|0,(r+i|0)-16|0,s|=0,l,c|=0,u|=0,d|=0)),t&&(a[t>>2]=n?0:i-16|0,a[t+4>>2]=n?0:o-(i>>>0<16)|0),0|n},m:function(e,t,n,r,i,o,s,a,l,c,u){return 0|Ee(e|=0,n|=0,(e=0)|(r|=0),i|=0,o|=0,s|=0,e|(a|=0),l|=0,c|=0,u|=0)},n:function(e,t,n,r,i,o,s,l,c,u,d){return t|=0,n|=0,r|=0,i|=0,l|=0,l|=0,n=-1,!(o|=0)&(i|=0)>>>0>=16|o&&(n=Ee(e|=0,r,i-16|0,o-(i>>>0<16)|0,(r+i|0)-16|0,s|=0,l,c|=0,u|=0,d|=0)),t&&(a[t>>2]=n?0:i-16|0,a[t+4>>2]=n?0:o-(i>>>0<16)|0),0|n},o:Sn,p:function(){return 12},q:On,r:_n,s:En,t:vn,u:Sn,v:kn,w:On,x:_n,y:En,z:vn,A:function(e,t,n,r,i,o,s,a,l,c,u,d){return 0|fe(e|=0,t|=0,n|=0,r|=0,(e=0)|(i|=0),o|=0,s|=0,e|(a|=0),l|=0,u|=0,d|=0)},B:function(e,t,n,r,i,o,s,l,c,u,d){return e|=0,t|=0,c|=0,c=r|=0,!(r=i|=0)&(i=0|c)>>>0<4294967280?(fe(e,e+i|0,0,n|=0,i,r,o|=0,s|=0,l|=0,u|=0,d|=0),t&&(r=(e=i+16|0)>>>0<16?r+1|0:r,a[t>>2]=e,a[t+4>>2]=r)):(Ut(),h()),0},C:function(e,t,n,r,i,o,s,a,l,c,u){return 0|ue(e|=0,n|=0,(e=0)|(r|=0),i|=0,o|=0,s|=0,e|(a|=0),l|=0,c|=0,u|=0)},D:function(e,t,n,r,i,o,s,l,c,u,d){return t|=0,n|=0,r|=0,i|=0,l|=0,l|=0,n=-1,!(o|=0)&(i|=0)>>>0>=16|o&&(n=ue(e|=0,r,i-16|0,o-(i>>>0<16)|0,(r+i|0)-16|0,s|=0,l,c|=0,u|=0,d|=0)),t&&(a[t>>2]=n?0:i-16|0,a[t+4>>2]=n?0:o-(i>>>0<16)|0),0|n},E:Sn,F:Cn,G:On,H:_n,I:En,J:vn,K:Sn,L:Sn,M:function(e,t,n,r,i){return 0|z(e|=0,t|=0,n|=0,r|=0,i|=0)},N:function(e,t,n,r,i){var o;return e|=0,y=o=y-32|0,z(o,t|=0,n|=0,r|=0,i|=0),t=fn(e,o),n=Ze(o,e,32),y=o+32|0,n|((0|e)==(0|o)?-1:t)},O:vn,P:Sn,Q:Sn,R:Sn,S:Sn,T:Cn,U:_n,V:En,W:function(e,t,n){e|=0,t|=0;var r,i=0;return y=r=y+-64|0,It(r,n|=0,32,0),n=a[r+28>>2],i=a[r+24>>2],o[t+24|0]=i,o[t+25|0]=i>>>8,o[t+26|0]=i>>>16,o[t+27|0]=i>>>24,o[t+28|0]=n,o[t+29|0]=n>>>8,o[t+30|0]=n>>>16,o[t+31|0]=n>>>24,n=a[r+20>>2],i=a[r+16>>2],o[t+16|0]=i,o[t+17|0]=i>>>8,o[t+18|0]=i>>>16,o[t+19|0]=i>>>24,o[t+20|0]=n,o[t+21|0]=n>>>8,o[t+22|0]=n>>>16,o[t+23|0]=n>>>24,n=a[r+12>>2],i=a[r+8>>2],o[t+8|0]=i,o[t+9|0]=i>>>8,o[t+10|0]=i>>>16,o[t+11|0]=i>>>24,o[t+12|0]=n,o[t+13|0]=n>>>8,o[t+14|0]=n>>>16,o[t+15|0]=n>>>24,n=a[r+4>>2],i=a[r>>2],o[0|t]=i,o[t+1|0]=i>>>8,o[t+2|0]=i>>>16,o[t+3|0]=i>>>24,o[t+4|0]=n,o[t+5|0]=n>>>8,o[t+6|0]=n>>>16,o[t+7|0]=n>>>24,bn(r,64),e=rn(e,t),y=r- -64|0,0|e},X:Gt,Y:dt,Z:function(e,t,n,r,i,o,s){return 0|Zt(e|=0,t|=0,n|=0,r|=0,i|=0,o|=0,s|=0)},_:function(e,t,n,r,i,o,s,a){return 0|ct(e|=0,t|=0,n|=0,r|=0,i|=0,o|=0,s|=0,a|=0)},$:function(e,t,n,r,i,o){return e|=0,t|=0,i|=0,o|=0,!(r|=0)&(n|=0)>>>0>=4294967280|r&&(Ut(),h()),0|Zt(e+16|0,e,t,n,r,i,o)},aa:function(e,t,n,r,i,o,s){return 0|wt(e|=0,t|=0,n|=0,r|=0,i|=0,o|=0,s|=0)},ba:function(e,t,n,r,i,o,s){return 0|Wt(e|=0,t|=0,n|=0,r|=0,i|=0,o|=0,s|=0)},ca:function(e,t,n,r,i,o,s,a){return 0|ut(e|=0,t|=0,n|=0,r|=0,i|=0,o|=0,s|=0,a|=0)},da:function(e,t,n,r,i,o){return t|=0,0|(!(r|=0)&(n|=0)>>>0>=16|r?Wt(e|=0,t+16|0,t,n-16|0,r-(n>>>0<16)|0,i|=0,o|=0):-1)},ea:function(e,t,n,r,i,o,s){return 0|gt(e|=0,t|=0,n|=0,r|=0,i|=0,o|=0,s|=0)},fa:function(e,t,n,r,i){e|=0,t|=0,i|=0;var s,l,c=0,u=0;return l=n|=0,n=r|=0,y=s=y-96|0,r=-1,Gt(s+32|0,s)||(yt(c=s- -64|0,u=s+32|0,i),r=wt(e+32|0,t,l,n,c,i,s),t=a[s+60>>2],n=a[s+56>>2],o[e+24|0]=n,o[e+25|0]=n>>>8,o[e+26|0]=n>>>16,o[e+27|0]=n>>>24,o[e+28|0]=t,o[e+29|0]=t>>>8,o[e+30|0]=t>>>16,o[e+31|0]=t>>>24,t=a[s+52>>2],n=a[s+48>>2],o[e+16|0]=n,o[e+17|0]=n>>>8,o[e+18|0]=n>>>16,o[e+19|0]=n>>>24,o[e+20|0]=t,o[e+21|0]=t>>>8,o[e+22|0]=t>>>16,o[e+23|0]=t>>>24,t=a[s+44>>2],n=a[s+40>>2],o[e+8|0]=n,o[e+9|0]=n>>>8,o[e+10|0]=n>>>16,o[e+11|0]=n>>>24,o[e+12|0]=t,o[e+13|0]=t>>>8,o[e+14|0]=t>>>16,o[e+15|0]=t>>>24,t=a[s+36>>2],n=a[s+32>>2],o[0|e]=n,o[e+1|0]=n>>>8,o[e+2|0]=n>>>16,o[e+3|0]=n>>>24,o[e+4|0]=t,o[e+5|0]=t>>>8,o[e+6|0]=t>>>16,o[e+7|0]=t>>>24,bn(s,32),bn(u,32),bn(c,24)),y=s+96|0,0|r},ga:function(e,t,n,r,i,o){e|=0,t|=0,o|=0;var s,a=0;return y=s=y-32|0,a=-1,!(r|=0)&(n|=0)>>>0>=48|r&&(yt(s,t,i|=0),a=gt(e,t+32|0,n-32|0,r-(n>>>0<32)|0,s,t,o)),y=s+32|0,0|a},ha:function(){return 48},ia:_n,ja:In,ka:Sn,la:_n,ma:In,na:Sn,oa:function(){return 384},pa:function(e,t,n,r,i,o,s){return 0|zt(e|=0,t|=0,n|=0,r|=0,i|=0,o|=0,s|=0)},qa:Tt,ra:function(e,t,n,r){return 0|ln(e|=0,t|=0,n|=0,r|=0)},sa:Lt,ta:vn,ua:In,va:function(e,t,n,r){return 0|It(e|=0,t|=0,n|=0,r|=0)},wa:_n,xa:In,ya:kn,za:Sn,Aa:function(e,t,n,r,i,c){e|=0,t|=0,n|=0,r|=0,c|=0;var u,d=0,p=0,f=0,g=0;return y=u=y-32|0,f=l[0|(i|=0)]|l[i+1|0]<<8|l[i+2|0]<<16|l[i+3|0]<<24,i=l[i+4|0]|l[i+5|0]<<8|l[i+6|0]<<16|l[i+7|0]<<24,a[u+24>>2]=0,a[u+28>>2]=0,a[u+16>>2]=f,a[u+20>>2]=i,ot(u,n,r),a[u+8>>2]=0,a[u+12>>2]=0,t-65>>>0<=4294967246?(a[8952]=28,e=-1):(n=u+16|0,t-65>>>0<4294967232?e=-1:(y=g=(r=y)-384&-64,!c|!e|((i=255&t)-65&255)>>>0<=191?(Ut(),h()):(y=p=y-192|0,!c|(i-65&255)>>>0<=191?(Ut(),h()):(s[p+130>>1]=257,o[p+129|0]=32,o[p+128|0]=i,Rt(4|(t=p+128|0)),ot(8|t,0,0),a[p+152>>2]=0,a[p+156>>2]=0,a[p+144>>2]=0,a[p+148>>2]=0,u?(f=l[u+4|0]|l[u+5|0]<<8|l[u+6|0]<<16|l[u+7|0]<<24,d=p+128|0,t=l[0|u]|l[u+1|0]<<8|l[u+2|0]<<16|l[u+3|0]<<24,o[d+32|0]=t,o[d+33|0]=t>>>8,o[d+34|0]=t>>>16,o[d+35|0]=t>>>24,o[d+36|0]=f,o[d+37|0]=f>>>8,o[d+38|0]=f>>>16,o[d+39|0]=f>>>24,f=l[u+12|0]|l[u+13|0]<<8|l[u+14|0]<<16|l[u+15|0]<<24,t=l[u+8|0]|l[u+9|0]<<8|l[u+10|0]<<16|l[u+11|0]<<24,o[d+40|0]=t,o[d+41|0]=t>>>8,o[d+42|0]=t>>>16,o[d+43|0]=t>>>24,o[d+44|0]=f,o[d+45|0]=f>>>8,o[d+46|0]=f>>>16,o[d+47|0]=f>>>24):(a[p+168>>2]=0,a[p+172>>2]=0,a[p+160>>2]=0,a[p+164>>2]=0),n?(f=l[n+4|0]|l[n+5|0]<<8|l[n+6|0]<<16|l[n+7|0]<<24,d=p+128|0,t=l[0|n]|l[n+1|0]<<8|l[n+2|0]<<16|l[n+3|0]<<24,o[d+48|0]=t,o[d+49|0]=t>>>8,o[d+50|0]=t>>>16,o[d+51|0]=t>>>24,o[d+52|0]=f,o[d+53|0]=f>>>8,o[d+54|0]=f>>>16,o[d+55|0]=f>>>24,f=l[n+12|0]|l[n+13|0]<<8|l[n+14|0]<<16|l[n+15|0]<<24,t=l[n+8|0]|l[n+9|0]<<8|l[n+10|0]<<16|l[n+11|0]<<24,o[d+56|0]=t,o[d+57|0]=t>>>8,o[d+58|0]=t>>>16,o[d+59|0]=t>>>24,o[d+60|0]=f,o[d+61|0]=f>>>8,o[d+62|0]=f>>>16,o[d+63|0]=f>>>24):(a[p+184>>2]=0,a[p+188>>2]=0,a[p+176>>2]=0,a[p+180>>2]=0),ve(g,p+128|0),vt(p+32|0,0,96),ne(g,t=pt(p,c,32),128,0),bn(t,128),y=t+192|0),ne(g,0,0,0),M(g,e,i),y=r),e=0)),y=u+32|0,0|e},Ba:vn,Ca:function(e,t,n){return e|=0,zt(t|=0,32,n|=0,32,0,0,0),0|Xt(e,t)},Da:function(e,t){return e|=0,st(t|=0,32),0|Xt(e,t)},Ea:function(e,t,n,r,i){t|=0,n|=0,r|=0,i|=0;var s,a,c=0,u=0;if(a=c=y,y=c=c-512&-64,s=(e|=0)||t){if(u=-1,!Qt(c+96|0,r,i)){for(r=t||e,e=0,Tt(t=c+128|0,0,0,64),ln(t,u=c+96|0,32,0),bn(u,32),ln(t,n,32,0),ln(t,i,32,0),Lt(t,c+32|0,64),bn(t,384);t=(c+32|0)+e|0,o[e+s|0]=l[0|t],o[e+r|0]=l[t+32|0],32!=(0|(e=e+1|0)););bn(c+32|0,64),u=0}return y=a,0|u}Ut(),h()},Fa:function(e,t,n,r,i){t|=0,n|=0,r|=0,i|=0;var s,a,c=0,u=0;if(a=c=y,y=c=c-512&-64,s=(e|=0)||t){if(u=-1,!Qt(c+96|0,r,i)){for(r=t||e,e=0,Tt(t=c+128|0,0,0,64),ln(t,u=c+96|0,32,0),bn(u,32),ln(t,i,32,0),ln(t,n,32,0),Lt(t,c+32|0,64),bn(t,384);t=(c+32|0)+e|0,o[e+r|0]=l[0|t],o[e+s|0]=l[t+32|0],32!=(0|(e=e+1|0)););bn(c+32|0,64),u=0}return y=a,0|u}Ut(),h()},Ga:Sn,Ha:Sn,Ia:Sn,Ja:Sn,Ka:xn,La:Pn,Ma:Pn,Na:_n,Oa:Nn,Pa:On,Qa:Nn,Ra:_n,Sa:function(){return 128},Ta:function(){return 1403},Ua:xn,Va:Nn,Wa:function(){return 8192},Xa:function(){return-2147483648},Ya:Pn,Za:function(){return 67108864},_a:Bn,$a:function(){return 268435456},ab:function(){return 4},bb:function(){return 1073741824},cb:function(e,t,n,r,i,o,s,l,c,u,d){var h;e|=0,t|=0,n|=0,r|=0,o|=0,s|=0,c|=0,u|=0,t|=0,h=0|(i|=0),i=0|(l|=0);e:{switch((d|=0)-1|0){case 0:e=vt(e,0,t);t:{if(1==(0|n)|n>>>0>1)a[8952]=22;else if(!n&t>>>0<=15)a[8952]=28;else if(!(o|c)&u>>>0<2147483649)if((!c&i>>>0>=3|0!=(0|c))&u>>>0>8191){if((0|e)!=(0|r)){e=I(i,u>>>10|0,1,r,h,s,16,e,t,0,0,1)?-1:0;break t}a[8952]=28}else a[8952]=28;else a[8952]=22;e=-1}break e;case 1:e=vt(e,0,t);t:{if(1==(0|n)|n>>>0>1)a[8952]=22;else if(!n&t>>>0<=15)a[8952]=28;else if(!(o|c)&u>>>0<2147483649)if(!!(i|c)&u>>>0>8191){if((0|e)!=(0|r)){e=I(i,u>>>10|0,1,r,h,s,16,e,t,0,0,2)?-1:0;break t}a[8952]=28}else a[8952]=28;else a[8952]=22;e=-1}break e}a[8952]=28,e=-1}return 0|e},db:function(e,t,n,r,i,o,s){return 0|Fe(e|=0,t|=0,(e=0)|(n|=0),r|=0,e|(i|=0),o|=0,s|=0)},eb:function(e,t,n,r,i,o,s,l){e|=0,t|=0,r|=0,o|=0,s|=0;var c=0;c=n|=0,c|=n=0,n|=i|=0;e:{switch((l|=0)-1|0){case 1:e=Fe(e,t,c,r,n,o,s);break e;default:Ut(),h();case 0:}y=i=y-16|0,e=vt(e,0,128),!(r|o)&s>>>0<2147483649?(!o&n>>>0>=3|0!=(0|o))&s>>>0>8191?(st(i,16),e=I(n,s>>>10|0,1,t,c,i,16,0,32,e,128,1)?-1:0):(a[8952]=28,e=-1):(a[8952]=22,e=-1),y=i+16|0}return 0|e},fb:function(e,t,n,r){t|=0,n|=0,r|=0;e:if(Ve(e|=0,1403,10))if(Ve(e,1393,9))a[8952]=28,e=-1;else{if(1==(0|r)|r>>>0>1)a[8952]=22;else{if(!(e=he(e,t,n,1)))break e;-35==(0|e)&&(a[8952]=28)}e=-1}else{if(1==(0|r)|r>>>0>1)a[8952]=22;else{if(!(e=he(e,t,n,2)))break e;-35==(0|e)&&(a[8952]=28)}e=-1}return 0|e},gb:function(e,t,n,r){return t|=0,n|=0,r|=0,Ve(e|=0,1403,10)?Ve(e,1393,9)?(a[8952]=28,e=-1):e=pe(e,t,n,r,1):e=pe(e,t,n,r,2),0|e},hb:Xt,ib:Qt,jb:Sn,kb:Sn,lb:Sn,mb:Cn,nb:_n,ob:En,pb:vn,qb:Zt,rb:function(e,t,n,r,i,o){return e|=0,t|=0,i|=0,o|=0,!(r|=0)&(n|=0)>>>0>=4294967280|r&&(Ut(),h()),se(e+16|0,e,t,n,r,i,o),0},sb:Wt,tb:function(e,t,n,r,i,o){return t|=0,0|(!(r|=0)&(n|=0)>>>0>=16|r?ae(e|=0,t+16|0,t,n-16|0,r-(n>>>0<16)|0,i|=0,o|=0):-1)},ub:vn,vb:function(e,t,n){return e|=0,n|=0,st(t|=0,24),U(e,t,n),Mt(e),n=l[t+16|0]|l[t+17|0]<<8|l[t+18|0]<<16|l[t+19|0]<<24,t=l[t+20|0]|l[t+21|0]<<8|l[t+22|0]<<16|l[t+23|0]<<24,o[e+44|0]=0,o[e+45|0]=0,o[e+46|0]=0,o[e+47|0]=0,o[e+48|0]=0,o[e+49|0]=0,o[e+50|0]=0,o[e+51|0]=0,o[e+36|0]=n,o[e+37|0]=n>>>8,o[e+38|0]=n>>>16,o[e+39|0]=n>>>24,o[e+40|0]=t,o[e+41|0]=t>>>8,o[e+42|0]=t>>>16,o[e+43|0]=t>>>24,0},wb:function(e,t,n){return U(e|=0,t|=0,n|=0),Mt(e),n=l[t+16|0]|l[t+17|0]<<8|l[t+18|0]<<16|l[t+19|0]<<24,t=l[t+20|0]|l[t+21|0]<<8|l[t+22|0]<<16|l[t+23|0]<<24,o[e+44|0]=0,o[e+45|0]=0,o[e+46|0]=0,o[e+47|0]=0,o[e+48|0]=0,o[e+49|0]=0,o[e+50|0]=0,o[e+51|0]=0,o[e+36|0]=n,o[e+37|0]=n>>>8,o[e+38|0]=n>>>16,o[e+39|0]=n>>>24,o[e+40|0]=t,o[e+41|0]=t>>>8,o[e+42|0]=t>>>16,o[e+43|0]=t>>>24,0},xb:H,yb:function(e,t,n,r,i,s,c,u,d,p){e|=0,t|=0,r|=0,c|=0,u|=0,d|=0,p|=0;var f=0,g=0,m=0,v=0;return g=i|=0,i=s|=0,s=0|g,u|=f,y=g=y-336|0,(n|=0)&&(a[n>>2]=0,a[n+4>>2]=0),!i&s>>>0<4294967279?(gn(m=g+16|0,64,v=e+32|0,e),hn(f=g+80|0,m),bn(m,64),nn(f,c,u,d),nn(f,34048,0-u&15,0),vt(m,0,64),o[g+16|0]=p,qe(m,m,64,0,v,1,e),nn(f,m,64,0),o[0|t]=l[g+16|0],qe(c=t+1|0,r,s,i,v,2,e),nn(f,c,s,i),nn(f,34048,15&s,0),ot(t=g+8|0,u,d),nn(f,t,8,0),ot(t,s- -64|0,i-((s>>>0<4294967232)-1|0)|0),nn(f,t,8,0),pn(f,t=s+c|0),bn(f,256),mt(e+36|0,t),lt(v),(2&p||rt(v,4))&&H(e),n&&(i=(e=s+17|0)>>>0<17?i+1|0:i,a[n>>2]=e,a[n+4>>2]=i),y=g+336|0):(Ut(),h()),0},zb:function(e,t,n,r,i,s,c,u,d,p){e|=0,t|=0,r|=0,i|=0,s|=0,c|=0,u|=0,p|=0;var f,g=0,m=0,v=0,A=0,b=0,w=0;s|=0,f=(d|=0)|g,y=g=y-352|0,(n|=0)&&(a[n>>2]=0,a[n+4>>2]=0),r&&(o[0|r]=255),w=-1;e:{t:{if(!(!c&s>>>0<17)){if(!(d=c-(s>>>0<17)|0)&(A=s-17|0)>>>0>=4294967279|d)break t;gn(m=g+32|0,64,b=e+32|0,e),hn(v=g+96|0,m),bn(m,64),nn(v,u,f,p),nn(v,34048,0-f&15,0),vt(m,0,64),o[g+32|0]=l[0|i],qe(m,m,64,0,b,1,e),u=l[g+32|0],o[g+32|0]=l[0|i],nn(v,m,64,0),nn(v,m=i+1|0,A,d),nn(v,34048,s-1&15,0),ot(i=g+24|0,f,p),nn(v,i,8,0),ot(i,s=s+47|0,c=s>>>0<47?c+1|0:c),nn(v,i,8,0),pn(v,g),bn(v,256),Ze(g,m+A|0,16)?bn(g,16):(qe(t,m,A,d,b,2,e),mt(e+36|0,g),lt(b),(2&u||rt(b,4))&&H(e),n&&(a[n>>2]=A,a[n+4>>2]=d),w=0,r&&(o[0|r]=u))}y=g+352|0;break e}Ut(),h()}return 0|w},Ab:function(){return 52},Bb:function(){return 17},Cb:Cn,Db:Sn,Eb:function(){return-18},Fb:On,Gb:xn,Hb:Pn,Ib:Bn,Jb:kn,Kb:_n,Lb:function(e,t,n,r,i){e|=0,t|=0,n|=0,r|=0;var o=0,s=0,a=0,c=0,u=0,d=0,h=0,p=0,f=0,g=0,m=0,y=0,v=0,A=0,w=0,S=0;if(s=i|=0,i=l[i+4|0]|l[i+5|0]<<8|l[i+6|0]<<16|l[i+7|0]<<24,d=1886610805^(o=l[0|s]|l[s+1|0]<<8|l[s+2|0]<<16|l[s+3|0]<<24),u=1936682341^i,o^=1852142177,h=1819895653^i,i=1852075885^(a=l[s+8|0]|l[s+9|0]<<8|l[s+10|0]<<16|l[s+11|0]<<24),c=1685025377^(s=l[s+12|0]|l[s+13|0]<<8|l[s+14|0]<<16|l[s+15|0]<<24),p=2037671283^a,f=1952801890^s,s=n,(0|(a=(t+n|0)-(g=7&n)|0))!=(0|t)){for(;m=l[0|t]|l[t+1|0]<<8|l[t+2|0]<<16|l[t+3|0]<<24,S=l[t+4|0]|l[t+5|0]<<8|l[t+6|0]<<16|l[t+7|0]<<24,v=Se(i,c,13),r=b,n=c+u|0,c=n=(d=i+d|0)>>>0<i>>>0?n+1|0:n,d=Se(u=d,n,32),A=b,p=Se(i=p^m,n=f^S,16),n=n+h|0,n=(i=i+o|0)>>>0<o>>>0?n+1|0:n,o=i,p=Se(i^=p,h=n^(f=b),21),f=b,v=Se(u^=v,r=c^=r,17),w=b,n=n+r|0,o=Se(c=o+u|0,n=c>>>0<o>>>0?n+1|0:n,32),r=b,v=Se(u=c^v,n^=w,13),w=b,c=n,y=u,n=h+A|0,h=u=i+d|0,i=n=u>>>0<i>>>0?n+1|0:n,n=n+c|0,d=u=y+u|0,c=n=u>>>0<h>>>0?n+1|0:n,n=Se(u,n,32),A=b,u=i^=f,i=Se(h^=p,i,16),p=b,f=n,y=i,n=r+u|0,o=n=(i=o+h|0)>>>0<o>>>0?n+1|0:n,n=(p^=n)+A|0,r=u=f+(h=y^i)|0,p=Se(h,p,21)^r,f=(u=r>>>0<h>>>0?n+1|0:n)^b,n=c^w,d=Se(c=d^v,n,17),n=n+o|0,n=(c=i+c|0)>>>0<i>>>0?n+1|0:n,i=(o=c)^d,c=n^(h=b),d=r^m,u^=S,o=Se(o,n,32),h=b,(0|a)!=(0|(t=t+8|0)););t=a}switch(n=s<<24,s=0,r=n,g-1|0){case 6:r|=l[t+6|0]<<16;case 5:r|=l[t+5|0]<<8;case 4:r|=l[t+4|0];case 3:s|=(a=l[t+3|0])<<24,r|=n=a>>>8|0;case 2:s|=(a=l[t+2|0])<<16,r|=n=a>>>16|0;case 1:s|=(a=l[t+1|0])<<8,r|=n=a>>>24|0;case 0:s=l[0|t]|s}return g=Se(i,c,13),m=b,n=c+u|0,a=t=i+d|0,i=n=t>>>0<i>>>0?n+1|0:n,c=Se(t,n,32),u=b,f=t=Se(d=s^p,n=t=r^f,16),n=n+h|0,n=(t=o+d|0)>>>0<o>>>0?n+1|0:n,o=t,h=Se(t^=f,d=n^(p=b),21),p=b,g=Se(a^=g,i^=m,17),m=b,n=n+i|0,n=(i=o+a|0)>>>0<o>>>0?n+1|0:n,o=i,i=Se(i,n,32),f=b,g=Se(a=o^g,n^=m,13),m=b,o=n,y=a,n=u+d|0,c=a=t+c|0,t=n=a>>>0<t>>>0?n+1|0:n,n=n+o|0,o=n=(a=y+a|0)>>>0<c>>>0?n+1|0:n,u=Se(a,n,32),d=b,p=t=Se(c^=h,n=t^=p,16),n=n+f|0,n=(t=i+c|0)>>>0<i>>>0?n+1|0:n,i=t,h=Se(t^=p,c=n^(h=b),21),p=b,g=Se(a^=g,o^=m,17),m=b,n=n+o|0,n=(o=i+a|0)>>>0<i>>>0?n+1|0:n,a=Se(i=o,n,32),f=b,g=Se(o=i^g,n^=m,13),m=b,i=n,y=o,n=c+d|0,n=(o=t+u|0)>>>0<t>>>0?n+1|0:n,t=s,s=o,c=t^o,t=n,n=(n^r)+i|0,r=n=(o=y+c|0)>>>0<c>>>0?n+1|0:n,c=Se(o,n,32),u=b,n=t^p,i=Se(t=s^h,n,16),s=b,d=i,n=n+f|0,n=(i=t+(255^a)|0)>>>0<t>>>0?n+1|0:n,a=Se(t=d^i,s^=n,21),d=b,p=Se(o^=g,r^=m,17),f=b,n=n+r|0,n=(r=i+o|0)>>>0<i>>>0?n+1|0:n,r=Se(i=r,n,32),h=b,p=Se(o=i^p,n^=f,13),f=b,i=n,y=o,n=s+u|0,s=o=t+c|0,t=n=o>>>0<t>>>0?n+1|0:n,n=n+i|0,i=n=(o=y+o|0)>>>0<s>>>0?n+1|0:n,c=Se(o,n,32),u=b,d=t=Se(s^=a,n=t^=d,16),n=n+h|0,n=(t=r+s|0)>>>0<r>>>0?n+1|0:n,r=t,a=Se(t^=d,s=n^(a=b),21),d=b,p=Se(o^=p,i^=f,17),f=b,n=n+i|0,r=Se(i=r+o|0,n=i>>>0<r>>>0?n+1|0:n,32),h=b,p=Se(o=i^p,n^=f,13),f=b,i=n,y=o,n=s+u|0,c=o=t+c|0,s=o,t=n=o>>>0<t>>>0?n+1|0:n,n=n+i|0,n=(o=y+o|0)>>>0<s>>>0?n+1|0:n,s=o,i=n,u=Se(o,n,32),g=b,c=t=Se(o=a^c,n=t^=d,16),n=n+h|0,n=(t=r+o|0)>>>0<r>>>0?n+1|0:n,r=t,t^=c,c=o=n^(a=b),a=Se(t,o,21),o=b,h=Se(s^=p,i^=f,17),p=b,n=n+i|0,r=Se(i=r+s|0,n=i>>>0<r>>>0?n+1|0:n,32),d=b,p=n^=p,h=Se(i^=h,n,13),s=b,f=a,n=c+g|0,c=a=t+u|0,t=n=a>>>0<t>>>0?n+1|0:n,f=o=Se(a^=f,n^=o,16),n=n+d|0,n=(o=r+a|0)>>>0<r>>>0?n+1|0:n,r=o,o=n,n=Se(f^r,n^(u=b),21),u=b,d=n,n=t+p|0,n=o+(s^=n=(a=i+c|0)>>>0<i>>>0?n+1|0:n)|0,n=(t=r+(i=a^h)|0)>>>0<r>>>0?n+1|0:n,r=d^t^Se(i,s,17),i=b^n^u,ot(e,Se(t,n,32)^r,b^i),0},Mb:function(e){st(e|=0,16)},Nb:function(){return 208},Ob:In,Pb:Sn,Qb:Sn,Rb:In,Sb:function(){return-65},Tb:function(e,t,n){return 0|T(e|=0,t|=0,n|=0)},Ub:function(e,t){var n;return e|=0,t|=0,y=n=y-32|0,st(n,32),T(e,t,n),bn(n,32),y=n+32|0,0},Vb:function(e,t,n,r,i,o){var s;return t|=0,i|=0,o|=0,y=s=y-16|0,Yt(e|=0,s+8|0,nt(e- -64|0,n|=0,n=r|=0),n,i,o),64!=a[s+8>>2]|a[s+12>>2]?(t&&(a[t>>2]=0,a[t+4>>2]=0),vt(e,0,n- -64|0),e=-1):(e=0,t&&(a[t>>2]=n- -64,a[t+4>>2]=i-((n>>>0<4294967232)-1|0))),y=s+16|0,0|e},Wb:function(e,t,n,r,i,o){e|=0,t|=0,n|=0;var s=0;e:{t:{if(s=r|=0,!(!(i|=0)&r>>>0<64||(r=i-1|0,s=i=s+-64|0,!(r=i>>>0<4294967232?r+1|0:r)&i>>>0>4294967231|r))){if(!Jt(n,i=n- -64|0,s,r,o|=0))break t;e&&vt(e,0,s)}if(n=-1,!t)break e;a[t>>2]=0,a[t+4>>2]=0;break e}t&&(a[t>>2]=s,a[t+4>>2]=r),n=0,e&&nt(e,i,s)}return 0|n},Xb:function(e,t,n,r,i,o){return 0|Yt(e|=0,t|=0,n|=0,r|=0,i|=0,o|=0)},Yb:function(e,t,n,r,i){return 0|Jt(e|=0,t|=0,n|=0,r|=0,i|=0)},Zb:function(e){return Pt(e|=0),0},_b:function(e,t,n,r){return 0|Z(e|=0,t|=0,n|=0,r|=0)},$b:function(e,t,n,r){var i;return t|=0,n|=0,r|=0,y=i=y+-64|0,je(e|=0,i),e=S(t,n,i,64,0,r,1),y=i- -64|0,0|e},ac:function(e,t,n){var r;return t|=0,n|=0,y=r=y+-64|0,je(e|=0,r),e=Q(t,r,64,0,n,1),y=r- -64|0,0|e},bc:function(e,t){e|=0;var n,r=0,i=0,s=0,a=0,l=0,c=0;if(y=n=y-256|0,c=-1,!ye(t|=0)&&!Y(n+96|0,t)){for(y=r=(y=a=y-160|0)-1760|0,At(s=r+480|0,i=n+96|0),ft(t=r+320|0,i),ht(r,t),Ue(t,r,s),ht(s=r+160|0,t),At(i=r+640|0,s),Ue(t,r,i),ht(s,t),At(i=r+800|0,s),Ue(t,r,i),ht(s,t),At(i=r+960|0,s),Ue(t,r,i),ht(s,t),At(i=r+1120|0,s),Ue(t,r,i),ht(s,t),At(i=r+1280|0,s),Ue(t,r,i),ht(s,t),At(i=r+1440|0,s),Ue(t,r,i),ht(s,t),At(r+1600|0,s),Vt(a),t=252;ft(r+320|0,a),s=t,(0|(t=o[t+33504|0]))>0?(ht(i=r+160|0,l=r+320|0),Ue(l,i,(r+480|0)+u((254&t)>>>1|0,160)|0)):(0|t)>=0||(ht(i=r+160|0,l=r+320|0),Qe(l,i,(r+480|0)+u((0-t&254)>>>1|0,160)|0)),ht(a,r+320|0),t=s-1|0,s;);y=r+1760|0,t=Nt(a),y=a+160|0,t&&(cn(n),ge(n,n,s=n+136|0),cn(t=n+48|0),me(t,t,s),J(n,n),x(t,t,n),G(e,t),c=0)}return y=n+256|0,0|c},cc:function(e,t){e|=0;var n,r=0;return y=n=y+-64|0,It(n,t|=0,32,0),o[0|n]=248&l[0|n],o[n+31|0]=63&l[n+31|0]|64,t=a[n+20>>2],r=a[n+16>>2],o[e+16|0]=r,o[e+17|0]=r>>>8,o[e+18|0]=r>>>16,o[e+19|0]=r>>>24,o[e+20|0]=t,o[e+21|0]=t>>>8,o[e+22|0]=t>>>16,o[e+23|0]=t>>>24,t=a[n+12>>2],r=a[n+8>>2],o[e+8|0]=r,o[e+9|0]=r>>>8,o[e+10|0]=r>>>16,o[e+11|0]=r>>>24,o[e+12|0]=t,o[e+13|0]=t>>>8,o[e+14|0]=t>>>16,o[e+15|0]=t>>>24,t=a[n+4>>2],r=a[n>>2],o[0|e]=r,o[e+1|0]=r>>>8,o[e+2|0]=r>>>16,o[e+3|0]=r>>>24,o[e+4|0]=t,o[e+5|0]=t>>>8,o[e+6|0]=t>>>16,o[e+7|0]=t>>>24,t=a[n+28>>2],r=a[n+24>>2],o[e+24|0]=r,o[e+25|0]=r>>>8,o[e+26|0]=r>>>16,o[e+27|0]=r>>>24,o[e+28|0]=t,o[e+29|0]=t>>>8,o[e+30|0]=t>>>16,o[e+31|0]=t>>>24,bn(n,64),y=n- -64|0,0},dc:Ct,ec:Bt,fc:function(e){var t=0,n=0;if((e|=0)>>>0>=2){for(n=(0-e>>>0)%(e>>>0)|0;(t=Ct())>>>0<n>>>0;);e=(t>>>0)%(e>>>0)|0}else e=0;return 0|e},gc:st,hc:function(e,t,n){gn(e|=0,t|=0,1024,n|=0)},ic:Sn,jc:function(){var e=0,t=0;return(e=a[9096])&&(e=a[e+20>>2])&&(t=0|jn[0|e]()),0|t},kc:function(e,t,n){e|=0,t|=0,1==(0|(n|=0))|n>>>0>1&&(p(1259,1119,197,1036),h()),st(e,t)},lc:function(e,t,n,r){e|=0,n|=0;var i=0,s=0,a=0;if(!((r|=0)>>>0>2147483646|r<<1>>>0>=(t|=0)>>>0)){if(t=0,r){for(;i=(t<<1)+e|0,s=15&(a=l[t+n|0]),o[i+1|0]=22272+((s<<8)+(s+65526&55552)|0)>>>8,s=i,i=a>>>4|0,o[0|s]=87+((i+65526>>>8&217)+i|0),(0|r)!=(0|(t=t+1|0)););t=r<<1}else t=0;return o[t+e|0]=0,0|e}Ut(),h()},mc:function(e,t,n,r,i,s,c){e|=0,t|=0,n|=0,i|=0,s|=0,c|=0;var u=0,d=0,h=0,p=0,f=0,g=0,m=0,y=0,v=0,A=0,b=0;e:if(r|=0){t:{n:{r:for(;;){for(d=u;;){i:{if(!(255&((v=(65526+(m=(223&(g=l[n+d|0]))-55&255)^m+65520)>>>8|0)|(h=65526+(A=48^g)>>>8|0)))){if(h=1,!i|255&f)break n;if(Ae(i,g))break i;u=d;break e}if(t>>>0<=p>>>0){a[8952]=68,h=0;break n}if(u=m&v|h&A,255&f?(o[e+p|0]=u|b,p=p+1|0):b=u<<4,f^=-1,h=1,(u=d+1|0)>>>0<r>>>0)continue r;break t}if(f=0,!((d=d+1|0)>>>0<r>>>0))break}break}u=(e=u+1|0)>>>0<r>>>0?r:e;break e}u=d}255&f?(a[8952]=28,y=-1,u=u-1|0,p=0):h||(p=0,y=-1)}return c?a[c>>2]=n+u:(0|r)!=(0|u)&&(a[8952]=28,y=-1),s&&(a[s>>2]=p),0|y},nc:function(e,t){var n;return e|=0,un(t|=0),e=u(n=(e>>>0)/3|0,-3)+e|0,1+(u(1&(e>>>1|e),2&t?e+1|0:4)+(n<<2)|0)|0},oc:X,pc:V,qc:function(){var e=0;return a[9097]?e=1:(a[8954]=0,y=e=y-16|0,Ft(e),a[e>>2]&&(Ft(e),vt(35820,0,40)),y=e+16|0,a[8953]=1,Bt(),st(36368,16),a[9097]=1,e=0),0|e},rc:function(e,t,n,r,i){e|=0,t|=0,n|=0,i|=0;var s,c=0,u=0,d=0;y=s=y-16|0;e:{if(r|=0){if(d=-1,(c=(c=r-1|0)-(u=c&r?(n>>>0)%(r>>>0)|0:n&c)|0)>>>0>=(-1^n)>>>0)break e;if(!((n=n+c|0)>>>0>=i>>>0))for(e&&(a[e>>2]=n+1),e=t+n|0,d=0,o[s+15|0]=0,n=0;i=t=e-n|0,u=l[0|t]&l[s+15|0],t=(n^c)-1>>>24|0,o[0|i]=u|128&t,o[s+15|0]=t|l[s+15|0],(0|r)!=(0|(n=n+1|0)););}else d=-1;return y=s+16|0,0|d}Ut(),h()},sc:function(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var i,o=0,s=0,c=0,u=0,d=0;if(a[12+(i=y-16|0)>>2]=0,r-1>>>0<n>>>0){for(d=(o=n-1|0)+t|0,n=0,t=0;u=((128^(s=l[d-n|0]))-1&a[i+12>>2]-1&c-1)>>>8&1,a[i+12>>2]=a[i+12>>2]|0-u&n,t|=u,c|=s,(0|r)!=(0|(n=n+1|0)););a[e>>2]=o-a[i+12>>2],e=t-1|0}else e=-1;return 0|e},tc:function(){return 1368},uc:function(){return 10},vc:Bn,wc:xn,xc:_,yc:O,zc:jn}}(e)}(ie)},instantiate:function(e,t){return{then:function(t){var n=new w.Module(e);t({instance:new w.Instance(n)})}}},RuntimeError:Error};v=[],"object"!=typeof w&&U("no native wasm support detected");var S,C,E,I,_,x,P,k=!1,B="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function O(e,t){return e?function(e,t,n){for(var r=t+n,i=t;e[i]&&!(i>=r);)++i;if(i-t>16&&e.subarray&&B)return B.decode(e.subarray(t,i));for(var o="";t<i;){var s=e[t++];if(128&s){var a=63&e[t++];if(192!=(224&s)){var l=63&e[t++];if((s=224==(240&s)?(15&s)<<12|a<<6|l:(7&s)<<18|a<<12|l<<6|63&e[t++])<65536)o+=String.fromCharCode(s);else{var c=s-65536;o+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else o+=String.fromCharCode((31&s)<<6|a)}else o+=String.fromCharCode(s)}return o}(E,e,t):""}function N(e){S=e,d.HEAP8=C=new Int8Array(e),d.HEAP16=I=new Int16Array(e),d.HEAP32=_=new Int32Array(e),d.HEAPU8=E=new Uint8Array(e),d.HEAPU16=new Uint16Array(e),d.HEAPU32=new Uint32Array(e),d.HEAPF32=x=new Float32Array(e),d.HEAPF64=P=new Float64Array(e)}var D,j=d.INITIAL_MEMORY||16777216;(b=d.wasmMemory?d.wasmMemory:new w.Memory({initial:j/65536,maximum:32768}))&&(S=b.buffer),j=S.byteLength,N(S);var T=[],M=[],F=[],R=0,L=null,Q=null;function U(e){throw d.onAbort&&d.onAbort(e),A(e="Aborted("+e+")"),k=!0,e+=". Build with -s ASSERTIONS=1 for more info.",new w.RuntimeError(e)}d.preloadedImages={},d.preloadedAudios={};var V,K,H,G,Y="data:application/octet-stream;base64,";function z(e){return e.startsWith(Y)}function Z(e){return e.startsWith("file://")}function W(e){try{if(e==V&&v)return new Uint8Array(v);var t=ne(e);if(t)return t;if(a)return a(e);throw"both async and sync fetching of the wasm failed"}catch(e){U(e)}}z(V="<<< WASM_BINARY_FILE >>>")||(K=V,V=d.locateFile?d.locateFile(K,y):y+K);var q={35048:function(){return d.getRandomValue()},35084:function(){if(void 0===d.getRandomValue)try{var e="object"==typeof window?window:self,t=void 0!==e.crypto?e.crypto:e.msCrypto,r=function(){var e=new Uint32Array(1);return t.getRandomValues(e),e[0]>>>0};r(),d.getRandomValue=r}catch(e){try{var i=n(22901),o=function(){var e=i.randomBytes(4);return(e[0]<<24|e[1]<<16|e[2]<<8|e[3])>>>0};o(),d.getRandomValue=o}catch(e){throw"No secure random number generator found"}}}};function J(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?X(n)():X(n)(t.arg):n(void 0===t.arg?null:t.arg)}else t(d)}}function X(e){return D.get(e)}var $=[];function ee(e){try{return b.grow(e-S.byteLength+65535>>>16),N(b.buffer),1}catch(e){}}var te="function"==typeof atob?atob:function(e){var t,n,r,i,o,s,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l="",c=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{t=a.indexOf(e.charAt(c++))<<2|(i=a.indexOf(e.charAt(c++)))>>4,n=(15&i)<<4|(o=a.indexOf(e.charAt(c++)))>>2,r=(3&o)<<6|(s=a.indexOf(e.charAt(c++))),l+=String.fromCharCode(t),64!==o&&(l+=String.fromCharCode(n)),64!==s&&(l+=String.fromCharCode(r))}while(c<e.length);return l};function ne(e){if(z(e))return function(e){if("boolean"==typeof m&&m){var t=Buffer.from(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}try{for(var n=te(e),r=new Uint8Array(n.length),i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}catch(e){throw new Error("Converting base64 string to bytes failed.")}}(e.slice(Y.length))}var re,ie={b:function(e,t,n,r){U("Assertion failed: "+O(e)+", at: "+[t?O(t):"unknown filename",n,r?O(r):"unknown function"])},e:function(){U("")},c:function(e,t,n){var r=function(e,t){var n;for($.length=0,t>>=2;n=E[e++];){var r=n<105;r&&1&t&&t++,$.push(r?P[t++>>1]:_[t]),++t}return $}(t,n);return q[e].apply(null,r)},d:function(e){var t,n=E.length,r=2147483648;if((e>>>=0)>r)return!1;for(var i=1;i<=4;i*=2){var o=n*(1+.2/i);if(o=Math.min(o,e+100663296),ee(Math.min(r,(t=Math.max(e,o))+(65536-t%65536)%65536)))return!0}return!1},a:b};function oe(e){function t(){re||(re=!0,d.calledRun=!0,k||(J(M),d.onRuntimeInitialized&&d.onRuntimeInitialized(),function(){if(d.postRun)for("function"==typeof d.postRun&&(d.postRun=[d.postRun]);d.postRun.length;)e=d.postRun.shift(),F.unshift(e);var e;J(F)}()))}e=e||p,R>0||(function(){if(d.preRun)for("function"==typeof d.preRun&&(d.preRun=[d.preRun]);d.preRun.length;)e=d.preRun.shift(),T.unshift(e);var e;J(T)}(),R>0||(d.setStatus?(d.setStatus("Running..."),setTimeout((function(){setTimeout((function(){d.setStatus("")}),1),t()}),1)):t()))}if(function(){var e={a:ie};function t(e,t){var n,r=e.exports;d.asm=r,D=d.asm.zc,n=d.asm.f,M.unshift(n),function(e){if(R--,d.monitorRunDependencies&&d.monitorRunDependencies(R),0==R&&(null!==L&&(clearInterval(L),L=null),Q)){var t=Q;Q=null,t()}}()}function n(e){t(e.instance)}function r(t){return function(){if(!v&&(f||g)){if("function"==typeof fetch&&!Z(V))return fetch(V,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+V+"'";return e.arrayBuffer()})).catch((function(){return W(V)}));if(s)return new Promise((function(e,t){s(V,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return W(V)}))}().then((function(t){return w.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){A("failed to asynchronously prepare wasm: "+e),U(e)}))}if(R++,d.monitorRunDependencies&&d.monitorRunDependencies(R),d.instantiateWasm)try{return d.instantiateWasm(e,t)}catch(e){return A("Module.instantiateWasm callback failed with error: "+e),!1}v||"function"!=typeof w.instantiateStreaming||z(V)||Z(V)||"function"!=typeof fetch?r(n):fetch(V,{credentials:"same-origin"}).then((function(t){return w.instantiateStreaming(t,e).then(n,(function(e){return A("wasm streaming compile failed: "+e),A("falling back to ArrayBuffer instantiation"),r(n)}))}))}(),d.___wasm_call_ctors=function(){return(d.___wasm_call_ctors=d.asm.f).apply(null,arguments)},d._crypto_aead_chacha20poly1305_encrypt_detached=function(){return(d._crypto_aead_chacha20poly1305_encrypt_detached=d.asm.g).apply(null,arguments)},d._crypto_aead_chacha20poly1305_encrypt=function(){return(d._crypto_aead_chacha20poly1305_encrypt=d.asm.h).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_encrypt_detached=function(){return(d._crypto_aead_chacha20poly1305_ietf_encrypt_detached=d.asm.i).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_encrypt=function(){return(d._crypto_aead_chacha20poly1305_ietf_encrypt=d.asm.j).apply(null,arguments)},d._crypto_aead_chacha20poly1305_decrypt_detached=function(){return(d._crypto_aead_chacha20poly1305_decrypt_detached=d.asm.k).apply(null,arguments)},d._crypto_aead_chacha20poly1305_decrypt=function(){return(d._crypto_aead_chacha20poly1305_decrypt=d.asm.l).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_decrypt_detached=function(){return(d._crypto_aead_chacha20poly1305_ietf_decrypt_detached=d.asm.m).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_decrypt=function(){return(d._crypto_aead_chacha20poly1305_ietf_decrypt=d.asm.n).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_keybytes=function(){return(d._crypto_aead_chacha20poly1305_ietf_keybytes=d.asm.o).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_npubbytes=function(){return(d._crypto_aead_chacha20poly1305_ietf_npubbytes=d.asm.p).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_nsecbytes=function(){return(d._crypto_aead_chacha20poly1305_ietf_nsecbytes=d.asm.q).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_abytes=function(){return(d._crypto_aead_chacha20poly1305_ietf_abytes=d.asm.r).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_messagebytes_max=function(){return(d._crypto_aead_chacha20poly1305_ietf_messagebytes_max=d.asm.s).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_keygen=function(){return(d._crypto_aead_chacha20poly1305_ietf_keygen=d.asm.t).apply(null,arguments)},d._crypto_aead_chacha20poly1305_keybytes=function(){return(d._crypto_aead_chacha20poly1305_keybytes=d.asm.u).apply(null,arguments)},d._crypto_aead_chacha20poly1305_npubbytes=function(){return(d._crypto_aead_chacha20poly1305_npubbytes=d.asm.v).apply(null,arguments)},d._crypto_aead_chacha20poly1305_nsecbytes=function(){return(d._crypto_aead_chacha20poly1305_nsecbytes=d.asm.w).apply(null,arguments)},d._crypto_aead_chacha20poly1305_abytes=function(){return(d._crypto_aead_chacha20poly1305_abytes=d.asm.x).apply(null,arguments)},d._crypto_aead_chacha20poly1305_messagebytes_max=function(){return(d._crypto_aead_chacha20poly1305_messagebytes_max=d.asm.y).apply(null,arguments)},d._crypto_aead_chacha20poly1305_keygen=function(){return(d._crypto_aead_chacha20poly1305_keygen=d.asm.z).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_encrypt_detached=function(){return(d._crypto_aead_xchacha20poly1305_ietf_encrypt_detached=d.asm.A).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_encrypt=function(){return(d._crypto_aead_xchacha20poly1305_ietf_encrypt=d.asm.B).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_decrypt_detached=function(){return(d._crypto_aead_xchacha20poly1305_ietf_decrypt_detached=d.asm.C).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_decrypt=function(){return(d._crypto_aead_xchacha20poly1305_ietf_decrypt=d.asm.D).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_keybytes=function(){return(d._crypto_aead_xchacha20poly1305_ietf_keybytes=d.asm.E).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_npubbytes=function(){return(d._crypto_aead_xchacha20poly1305_ietf_npubbytes=d.asm.F).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_nsecbytes=function(){return(d._crypto_aead_xchacha20poly1305_ietf_nsecbytes=d.asm.G).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_abytes=function(){return(d._crypto_aead_xchacha20poly1305_ietf_abytes=d.asm.H).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_messagebytes_max=function(){return(d._crypto_aead_xchacha20poly1305_ietf_messagebytes_max=d.asm.I).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_keygen=function(){return(d._crypto_aead_xchacha20poly1305_ietf_keygen=d.asm.J).apply(null,arguments)},d._crypto_auth_bytes=function(){return(d._crypto_auth_bytes=d.asm.K).apply(null,arguments)},d._crypto_auth_keybytes=function(){return(d._crypto_auth_keybytes=d.asm.L).apply(null,arguments)},d._crypto_auth=function(){return(d._crypto_auth=d.asm.M).apply(null,arguments)},d._crypto_auth_verify=function(){return(d._crypto_auth_verify=d.asm.N).apply(null,arguments)},d._crypto_auth_keygen=function(){return(d._crypto_auth_keygen=d.asm.O).apply(null,arguments)},d._crypto_box_seedbytes=function(){return(d._crypto_box_seedbytes=d.asm.P).apply(null,arguments)},d._crypto_box_publickeybytes=function(){return(d._crypto_box_publickeybytes=d.asm.Q).apply(null,arguments)},d._crypto_box_secretkeybytes=function(){return(d._crypto_box_secretkeybytes=d.asm.R).apply(null,arguments)},d._crypto_box_beforenmbytes=function(){return(d._crypto_box_beforenmbytes=d.asm.S).apply(null,arguments)},d._crypto_box_noncebytes=function(){return(d._crypto_box_noncebytes=d.asm.T).apply(null,arguments)},d._crypto_box_macbytes=function(){return(d._crypto_box_macbytes=d.asm.U).apply(null,arguments)},d._crypto_box_messagebytes_max=function(){return(d._crypto_box_messagebytes_max=d.asm.V).apply(null,arguments)},d._crypto_box_seed_keypair=function(){return(d._crypto_box_seed_keypair=d.asm.W).apply(null,arguments)},d._crypto_box_keypair=function(){return(d._crypto_box_keypair=d.asm.X).apply(null,arguments)},d._crypto_box_beforenm=function(){return(d._crypto_box_beforenm=d.asm.Y).apply(null,arguments)},d._crypto_box_detached_afternm=function(){return(d._crypto_box_detached_afternm=d.asm.Z).apply(null,arguments)},d._crypto_box_detached=function(){return(d._crypto_box_detached=d.asm._).apply(null,arguments)},d._crypto_box_easy_afternm=function(){return(d._crypto_box_easy_afternm=d.asm.$).apply(null,arguments)},d._crypto_box_easy=function(){return(d._crypto_box_easy=d.asm.aa).apply(null,arguments)},d._crypto_box_open_detached_afternm=function(){return(d._crypto_box_open_detached_afternm=d.asm.ba).apply(null,arguments)},d._crypto_box_open_detached=function(){return(d._crypto_box_open_detached=d.asm.ca).apply(null,arguments)},d._crypto_box_open_easy_afternm=function(){return(d._crypto_box_open_easy_afternm=d.asm.da).apply(null,arguments)},d._crypto_box_open_easy=function(){return(d._crypto_box_open_easy=d.asm.ea).apply(null,arguments)},d._crypto_box_seal=function(){return(d._crypto_box_seal=d.asm.fa).apply(null,arguments)},d._crypto_box_seal_open=function(){return(d._crypto_box_seal_open=d.asm.ga).apply(null,arguments)},d._crypto_box_sealbytes=function(){return(d._crypto_box_sealbytes=d.asm.ha).apply(null,arguments)},d._crypto_generichash_bytes_min=function(){return(d._crypto_generichash_bytes_min=d.asm.ia).apply(null,arguments)},d._crypto_generichash_bytes_max=function(){return(d._crypto_generichash_bytes_max=d.asm.ja).apply(null,arguments)},d._crypto_generichash_bytes=function(){return(d._crypto_generichash_bytes=d.asm.ka).apply(null,arguments)},d._crypto_generichash_keybytes_min=function(){return(d._crypto_generichash_keybytes_min=d.asm.la).apply(null,arguments)},d._crypto_generichash_keybytes_max=function(){return(d._crypto_generichash_keybytes_max=d.asm.ma).apply(null,arguments)},d._crypto_generichash_keybytes=function(){return(d._crypto_generichash_keybytes=d.asm.na).apply(null,arguments)},d._crypto_generichash_statebytes=function(){return(d._crypto_generichash_statebytes=d.asm.oa).apply(null,arguments)},d._crypto_generichash=function(){return(d._crypto_generichash=d.asm.pa).apply(null,arguments)},d._crypto_generichash_init=function(){return(d._crypto_generichash_init=d.asm.qa).apply(null,arguments)},d._crypto_generichash_update=function(){return(d._crypto_generichash_update=d.asm.ra).apply(null,arguments)},d._crypto_generichash_final=function(){return(d._crypto_generichash_final=d.asm.sa).apply(null,arguments)},d._crypto_generichash_keygen=function(){return(d._crypto_generichash_keygen=d.asm.ta).apply(null,arguments)},d._crypto_hash_bytes=function(){return(d._crypto_hash_bytes=d.asm.ua).apply(null,arguments)},d._crypto_hash=function(){return(d._crypto_hash=d.asm.va).apply(null,arguments)},d._crypto_kdf_bytes_min=function(){return(d._crypto_kdf_bytes_min=d.asm.wa).apply(null,arguments)},d._crypto_kdf_bytes_max=function(){return(d._crypto_kdf_bytes_max=d.asm.xa).apply(null,arguments)},d._crypto_kdf_contextbytes=function(){return(d._crypto_kdf_contextbytes=d.asm.ya).apply(null,arguments)},d._crypto_kdf_keybytes=function(){return(d._crypto_kdf_keybytes=d.asm.za).apply(null,arguments)},d._crypto_kdf_derive_from_key=function(){return(d._crypto_kdf_derive_from_key=d.asm.Aa).apply(null,arguments)},d._crypto_kdf_keygen=function(){return(d._crypto_kdf_keygen=d.asm.Ba).apply(null,arguments)},d._crypto_kx_seed_keypair=function(){return(d._crypto_kx_seed_keypair=d.asm.Ca).apply(null,arguments)},d._crypto_kx_keypair=function(){return(d._crypto_kx_keypair=d.asm.Da).apply(null,arguments)},d._crypto_kx_client_session_keys=function(){return(d._crypto_kx_client_session_keys=d.asm.Ea).apply(null,arguments)},d._crypto_kx_server_session_keys=function(){return(d._crypto_kx_server_session_keys=d.asm.Fa).apply(null,arguments)},d._crypto_kx_publickeybytes=function(){return(d._crypto_kx_publickeybytes=d.asm.Ga).apply(null,arguments)},d._crypto_kx_secretkeybytes=function(){return(d._crypto_kx_secretkeybytes=d.asm.Ha).apply(null,arguments)},d._crypto_kx_seedbytes=function(){return(d._crypto_kx_seedbytes=d.asm.Ia).apply(null,arguments)},d._crypto_kx_sessionkeybytes=function(){return(d._crypto_kx_sessionkeybytes=d.asm.Ja).apply(null,arguments)},d._crypto_pwhash_alg_argon2i13=function(){return(d._crypto_pwhash_alg_argon2i13=d.asm.Ka).apply(null,arguments)},d._crypto_pwhash_alg_argon2id13=function(){return(d._crypto_pwhash_alg_argon2id13=d.asm.La).apply(null,arguments)},d._crypto_pwhash_alg_default=function(){return(d._crypto_pwhash_alg_default=d.asm.Ma).apply(null,arguments)},d._crypto_pwhash_bytes_min=function(){return(d._crypto_pwhash_bytes_min=d.asm.Na).apply(null,arguments)},d._crypto_pwhash_bytes_max=function(){return(d._crypto_pwhash_bytes_max=d.asm.Oa).apply(null,arguments)},d._crypto_pwhash_passwd_min=function(){return(d._crypto_pwhash_passwd_min=d.asm.Pa).apply(null,arguments)},d._crypto_pwhash_passwd_max=function(){return(d._crypto_pwhash_passwd_max=d.asm.Qa).apply(null,arguments)},d._crypto_pwhash_saltbytes=function(){return(d._crypto_pwhash_saltbytes=d.asm.Ra).apply(null,arguments)},d._crypto_pwhash_strbytes=function(){return(d._crypto_pwhash_strbytes=d.asm.Sa).apply(null,arguments)},d._crypto_pwhash_strprefix=function(){return(d._crypto_pwhash_strprefix=d.asm.Ta).apply(null,arguments)},d._crypto_pwhash_opslimit_min=function(){return(d._crypto_pwhash_opslimit_min=d.asm.Ua).apply(null,arguments)},d._crypto_pwhash_opslimit_max=function(){return(d._crypto_pwhash_opslimit_max=d.asm.Va).apply(null,arguments)},d._crypto_pwhash_memlimit_min=function(){return(d._crypto_pwhash_memlimit_min=d.asm.Wa).apply(null,arguments)},d._crypto_pwhash_memlimit_max=function(){return(d._crypto_pwhash_memlimit_max=d.asm.Xa).apply(null,arguments)},d._crypto_pwhash_opslimit_interactive=function(){return(d._crypto_pwhash_opslimit_interactive=d.asm.Ya).apply(null,arguments)},d._crypto_pwhash_memlimit_interactive=function(){return(d._crypto_pwhash_memlimit_interactive=d.asm.Za).apply(null,arguments)},d._crypto_pwhash_opslimit_moderate=function(){return(d._crypto_pwhash_opslimit_moderate=d.asm._a).apply(null,arguments)},d._crypto_pwhash_memlimit_moderate=function(){return(d._crypto_pwhash_memlimit_moderate=d.asm.$a).apply(null,arguments)},d._crypto_pwhash_opslimit_sensitive=function(){return(d._crypto_pwhash_opslimit_sensitive=d.asm.ab).apply(null,arguments)},d._crypto_pwhash_memlimit_sensitive=function(){return(d._crypto_pwhash_memlimit_sensitive=d.asm.bb).apply(null,arguments)},d._crypto_pwhash=function(){return(d._crypto_pwhash=d.asm.cb).apply(null,arguments)},d._crypto_pwhash_str=function(){return(d._crypto_pwhash_str=d.asm.db).apply(null,arguments)},d._crypto_pwhash_str_alg=function(){return(d._crypto_pwhash_str_alg=d.asm.eb).apply(null,arguments)},d._crypto_pwhash_str_verify=function(){return(d._crypto_pwhash_str_verify=d.asm.fb).apply(null,arguments)},d._crypto_pwhash_str_needs_rehash=function(){return(d._crypto_pwhash_str_needs_rehash=d.asm.gb).apply(null,arguments)},d._crypto_scalarmult_base=function(){return(d._crypto_scalarmult_base=d.asm.hb).apply(null,arguments)},d._crypto_scalarmult=function(){return(d._crypto_scalarmult=d.asm.ib).apply(null,arguments)},d._crypto_scalarmult_bytes=function(){return(d._crypto_scalarmult_bytes=d.asm.jb).apply(null,arguments)},d._crypto_scalarmult_scalarbytes=function(){return(d._crypto_scalarmult_scalarbytes=d.asm.kb).apply(null,arguments)},d._crypto_secretbox_keybytes=function(){return(d._crypto_secretbox_keybytes=d.asm.lb).apply(null,arguments)},d._crypto_secretbox_noncebytes=function(){return(d._crypto_secretbox_noncebytes=d.asm.mb).apply(null,arguments)},d._crypto_secretbox_macbytes=function(){return(d._crypto_secretbox_macbytes=d.asm.nb).apply(null,arguments)},d._crypto_secretbox_messagebytes_max=function(){return(d._crypto_secretbox_messagebytes_max=d.asm.ob).apply(null,arguments)},d._crypto_secretbox_keygen=function(){return(d._crypto_secretbox_keygen=d.asm.pb).apply(null,arguments)},d._crypto_secretbox_detached=function(){return(d._crypto_secretbox_detached=d.asm.qb).apply(null,arguments)},d._crypto_secretbox_easy=function(){return(d._crypto_secretbox_easy=d.asm.rb).apply(null,arguments)},d._crypto_secretbox_open_detached=function(){return(d._crypto_secretbox_open_detached=d.asm.sb).apply(null,arguments)},d._crypto_secretbox_open_easy=function(){return(d._crypto_secretbox_open_easy=d.asm.tb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_keygen=function(){return(d._crypto_secretstream_xchacha20poly1305_keygen=d.asm.ub).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_init_push=function(){return(d._crypto_secretstream_xchacha20poly1305_init_push=d.asm.vb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_init_pull=function(){return(d._crypto_secretstream_xchacha20poly1305_init_pull=d.asm.wb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_rekey=function(){return(d._crypto_secretstream_xchacha20poly1305_rekey=d.asm.xb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_push=function(){return(d._crypto_secretstream_xchacha20poly1305_push=d.asm.yb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_pull=function(){return(d._crypto_secretstream_xchacha20poly1305_pull=d.asm.zb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_statebytes=function(){return(d._crypto_secretstream_xchacha20poly1305_statebytes=d.asm.Ab).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_abytes=function(){return(d._crypto_secretstream_xchacha20poly1305_abytes=d.asm.Bb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_headerbytes=function(){return(d._crypto_secretstream_xchacha20poly1305_headerbytes=d.asm.Cb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_keybytes=function(){return(d._crypto_secretstream_xchacha20poly1305_keybytes=d.asm.Db).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_messagebytes_max=function(){return(d._crypto_secretstream_xchacha20poly1305_messagebytes_max=d.asm.Eb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_tag_message=function(){return(d._crypto_secretstream_xchacha20poly1305_tag_message=d.asm.Fb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_tag_push=function(){return(d._crypto_secretstream_xchacha20poly1305_tag_push=d.asm.Gb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_tag_rekey=function(){return(d._crypto_secretstream_xchacha20poly1305_tag_rekey=d.asm.Hb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_tag_final=function(){return(d._crypto_secretstream_xchacha20poly1305_tag_final=d.asm.Ib).apply(null,arguments)},d._crypto_shorthash_bytes=function(){return(d._crypto_shorthash_bytes=d.asm.Jb).apply(null,arguments)},d._crypto_shorthash_keybytes=function(){return(d._crypto_shorthash_keybytes=d.asm.Kb).apply(null,arguments)},d._crypto_shorthash=function(){return(d._crypto_shorthash=d.asm.Lb).apply(null,arguments)},d._crypto_shorthash_keygen=function(){return(d._crypto_shorthash_keygen=d.asm.Mb).apply(null,arguments)},d._crypto_sign_statebytes=function(){return(d._crypto_sign_statebytes=d.asm.Nb).apply(null,arguments)},d._crypto_sign_bytes=function(){return(d._crypto_sign_bytes=d.asm.Ob).apply(null,arguments)},d._crypto_sign_seedbytes=function(){return(d._crypto_sign_seedbytes=d.asm.Pb).apply(null,arguments)},d._crypto_sign_publickeybytes=function(){return(d._crypto_sign_publickeybytes=d.asm.Qb).apply(null,arguments)},d._crypto_sign_secretkeybytes=function(){return(d._crypto_sign_secretkeybytes=d.asm.Rb).apply(null,arguments)},d._crypto_sign_messagebytes_max=function(){return(d._crypto_sign_messagebytes_max=d.asm.Sb).apply(null,arguments)},d._crypto_sign_seed_keypair=function(){return(d._crypto_sign_seed_keypair=d.asm.Tb).apply(null,arguments)},d._crypto_sign_keypair=function(){return(d._crypto_sign_keypair=d.asm.Ub).apply(null,arguments)},d._crypto_sign=function(){return(d._crypto_sign=d.asm.Vb).apply(null,arguments)},d._crypto_sign_open=function(){return(d._crypto_sign_open=d.asm.Wb).apply(null,arguments)},d._crypto_sign_detached=function(){return(d._crypto_sign_detached=d.asm.Xb).apply(null,arguments)},d._crypto_sign_verify_detached=function(){return(d._crypto_sign_verify_detached=d.asm.Yb).apply(null,arguments)},d._crypto_sign_init=function(){return(d._crypto_sign_init=d.asm.Zb).apply(null,arguments)},d._crypto_sign_update=function(){return(d._crypto_sign_update=d.asm._b).apply(null,arguments)},d._crypto_sign_final_create=function(){return(d._crypto_sign_final_create=d.asm.$b).apply(null,arguments)},d._crypto_sign_final_verify=function(){return(d._crypto_sign_final_verify=d.asm.ac).apply(null,arguments)},d._crypto_sign_ed25519_pk_to_curve25519=function(){return(d._crypto_sign_ed25519_pk_to_curve25519=d.asm.bc).apply(null,arguments)},d._crypto_sign_ed25519_sk_to_curve25519=function(){return(d._crypto_sign_ed25519_sk_to_curve25519=d.asm.cc).apply(null,arguments)},d._randombytes_random=function(){return(d._randombytes_random=d.asm.dc).apply(null,arguments)},d._randombytes_stir=function(){return(d._randombytes_stir=d.asm.ec).apply(null,arguments)},d._randombytes_uniform=function(){return(d._randombytes_uniform=d.asm.fc).apply(null,arguments)},d._randombytes_buf=function(){return(d._randombytes_buf=d.asm.gc).apply(null,arguments)},d._randombytes_buf_deterministic=function(){return(d._randombytes_buf_deterministic=d.asm.hc).apply(null,arguments)},d._randombytes_seedbytes=function(){return(d._randombytes_seedbytes=d.asm.ic).apply(null,arguments)},d._randombytes_close=function(){return(d._randombytes_close=d.asm.jc).apply(null,arguments)},d._randombytes=function(){return(d._randombytes=d.asm.kc).apply(null,arguments)},d._sodium_bin2hex=function(){return(d._sodium_bin2hex=d.asm.lc).apply(null,arguments)},d._sodium_hex2bin=function(){return(d._sodium_hex2bin=d.asm.mc).apply(null,arguments)},d._sodium_base64_encoded_len=function(){return(d._sodium_base64_encoded_len=d.asm.nc).apply(null,arguments)},d._sodium_bin2base64=function(){return(d._sodium_bin2base64=d.asm.oc).apply(null,arguments)},d._sodium_base642bin=function(){return(d._sodium_base642bin=d.asm.pc).apply(null,arguments)},d._sodium_init=function(){return(d._sodium_init=d.asm.qc).apply(null,arguments)},d._sodium_pad=function(){return(d._sodium_pad=d.asm.rc).apply(null,arguments)},d._sodium_unpad=function(){return(d._sodium_unpad=d.asm.sc).apply(null,arguments)},d._sodium_version_string=function(){return(d._sodium_version_string=d.asm.tc).apply(null,arguments)},d._sodium_library_version_major=function(){return(d._sodium_library_version_major=d.asm.uc).apply(null,arguments)},d._sodium_library_version_minor=function(){return(d._sodium_library_version_minor=d.asm.vc).apply(null,arguments)},d._sodium_library_minimal=function(){return(d._sodium_library_minimal=d.asm.wc).apply(null,arguments)},d._malloc=function(){return(d._malloc=d.asm.xc).apply(null,arguments)},d._free=function(){return(d._free=d.asm.yc).apply(null,arguments)},d.setValue=function(e,t,n="i8",r){switch("*"===n.charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":C[e>>0]=t;break;case"i16":I[e>>1]=t;break;case"i32":_[e>>2]=t;break;case"i64":G=[t>>>0,(H=t,+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],_[e>>2]=G[0],_[e+4>>2]=G[1];break;case"float":x[e>>2]=t;break;case"double":P[e>>3]=t;break;default:U("invalid type for setValue: "+n)}},d.getValue=function(e,t="i8",n){switch("*"===t.charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return C[e>>0];case"i16":return I[e>>1];case"i32":case"i64":return _[e>>2];case"float":return x[e>>2];case"double":return Number(P[e>>3]);default:U("invalid type for getValue: "+t)}return null},d.UTF8ToString=O,Q=function e(){re||oe(),re||(Q=e)},d.run=oe,d.preInit)for("function"==typeof d.preInit&&(d.preInit=[d.preInit]);d.preInit.length>0;)d.preInit.pop()();oe()}))};var i,s,a,l,c,u,d=void 0!==d?d:{},h=Object.assign({},d),p=[],f="object"==typeof window,g="function"==typeof importScripts,m="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,y="";m?(y=g?n(84371).dirname(y)+"/":"//",u=()=>{c||(l=n(68236),c=n(84371))},i=function(e,t){var n=ee(e);return n?t?n:n.toString():(u(),e=c.normalize(e),l.readFileSync(e,t?void 0:"utf8"))},a=e=>{var t=i(e,!0);return t.buffer||(t=new Uint8Array(t)),t},s=(e,t,n)=>{var r=ee(e);r&&t(r),u(),e=c.normalize(e),l.readFile(e,(function(e,r){e?n(e):t(r.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),p=process.argv.slice(2),e.exports=d,d.inspect=function(){return"[Emscripten Module object]"}):(f||g)&&(g?y=self.location.href:"undefined"!=typeof document&&document.currentScript&&(y=document.currentScript.src),y=0!==y.indexOf("blob:")?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf("/")+1):"",i=e=>{try{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText}catch(t){var n=ee(e);if(n)return function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r>255&&(r&=255),t.push(String.fromCharCode(r))}return t.join("")}(n);throw t}},g&&(a=e=>{try{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}catch(t){var n=ee(e);if(n)return n;throw t}}),s=(e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{if(200==r.status||0==r.status&&r.response)t(r.response);else{var i=ee(e);i?t(i.buffer):n()}},r.onerror=n,r.send(null)}),d.print;var v,A,b=d.printErr||void 0;Object.assign(d,h),h=null,d.arguments&&(p=d.arguments),d.thisProgram&&d.thisProgram,d.quit&&d.quit,d.wasmBinary&&(v=d.wasmBinary),d.noExitRuntime,"object"!=typeof WebAssembly&&L("no native wasm support detected");var w,S,C,E,I,_,x,P=!1,k="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function B(e,t){return e?function(e,t,n){for(var r=t+n,i=t;e[i]&&!(i>=r);)++i;if(i-t>16&&e.subarray&&k)return k.decode(e.subarray(t,i));for(var o="";t<i;){var s=e[t++];if(128&s){var a=63&e[t++];if(192!=(224&s)){var l=63&e[t++];if((s=224==(240&s)?(15&s)<<12|a<<6|l:(7&s)<<18|a<<12|l<<6|63&e[t++])<65536)o+=String.fromCharCode(s);else{var c=s-65536;o+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else o+=String.fromCharCode((31&s)<<6|a)}else o+=String.fromCharCode(s)}return o}(C,e,t):""}function O(e){w=e,d.HEAP8=S=new Int8Array(e),d.HEAP16=E=new Int16Array(e),d.HEAP32=I=new Int32Array(e),d.HEAPU8=C=new Uint8Array(e),d.HEAPU16=new Uint16Array(e),d.HEAPU32=new Uint32Array(e),d.HEAPF32=_=new Float32Array(e),d.HEAPF64=x=new Float64Array(e)}d.INITIAL_MEMORY;var N,D=[],j=[],T=[],M=0,F=null,R=null;function L(e){throw d.onAbort&&d.onAbort(e),b(e="Aborted("+e+")"),P=!0,e+=". Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(e)}d.preloadedImages={},d.preloadedAudios={};var Q,U,V,K,H="data:application/octet-stream;base64,";function G(e){return e.startsWith(H)}function Y(e){return e.startsWith("file://")}function z(e){try{if(e==Q&&v)return new Uint8Array(v);var t=ee(e);if(t)return t;if(a)return a(e);throw"both async and sync fetching of the wasm failed"}catch(e){L(e)}}G(Q="data:application/octet-stream;base64,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ASgCPDYCPCABQUBrIQEgAkFAayICIAVNDQALCyACIARPDQEDQCACIAEoAgA2AgAgAUEEaiEBIAJBBGoiAiAESQ0ACwwBCyADQQRJBEAgACECDAELIAAgA0EEayIESwRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAiABLQABOgABIAIgAS0AAjoAAiACIAEtAAM6AAMgAUEEaiEBIAJBBGoiAiAETQ0ACwsgAiADSQRAA0AgAiABLQAAOgAAIAFBAWohASACQQFqIgIgA0cNAAsLIAAL7AEBEn8gAigCBCEDIAEoAgQhBCACKAIIIQUgASgCCCEGIAIoAgwhByABKAIMIQggAigCECEJIAEoAhAhCiACKAIUIQsgASgCFCEMIAIoAhghDSABKAIYIQ4gAigCHCEPIAEoAhwhECACKAIgIREgASgCICESIAIoAiQhEyABKAIkIRQgACACKAIAIAEoAgBqNgIAIAAgEyAUajYCJCAAIBEgEmo2AiAgACAPIBBqNgIcIAAgDSAOajYCGCAAIAsgDGo2AhQgACAJIApqNgIQIAAgByAIajYCDCAAIAUgBmo2AgggACADIARqNgIEC0ABA38gACABIAFB+ABqIgIQCiAAQShqIAFBKGoiAyABQdAAaiIEEAogAEHQAGogBCACEAogAEH4AGogASADEAoLGAEBf0GonAIoAgAiAARAIAARDwALEAMAC+wBARJ/IAIoAgQhAyABKAIEIQQgAigCCCEFIAEoAgghBiACKAIMIQcgASgCDCEIIAIoAhAhCSABKAIQIQogAigCFCELIAEoAhQhDCACKAIYIQ0gASgCGCEOIAIoAhwhDyABKAIcIRAgAigCICERIAEoAiAhEiACKAIkIRMgASgCJCEUIAAgASgCACACKAIAazYCACAAIBQgE2s2AiQgACASIBFrNgIgIAAgECAPazYCHCAAIA4gDWs2AhggACAMIAtrNgIUIAAgCiAJazYCECAAIAggB2s2AgwgACAGIAVrNgIIIAAgBCADazYCBAsEAEEgCwoAIAAgASACEDgLzAwBB38CQCAARQ0AIABBCGsiAyAAQQRrKAIAIgFBeHEiAGohBQJAIAFBAXENACABQQNxRQ0BIAMgAygCACIBayIDQaSYAigCAEkNASAAIAFqIQAgA0GomAIoAgBHBEAgAUH/AU0EQCAD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IAAhAQJAIABBA3EEQANAIAEtAABFDQIgAUEBaiIBQQNxDQALCwNAIAEiAkEEaiEBIAIoAgAiA0F/cyADQYGChAhrcUGAgYKEeHFFDQALIANB/wFxRQRAIAIgAGsPCwNAIAItAAEhAyACQQFqIgEhAiADDQALCyABIABrCygAIAAgASACEFUgAEEoaiABQShqIAIQVSAAQdAAaiABQdAAaiACEFULEQAgACABQdSRAigCABEDABoLEQAgACABQcyRAigCABEDABoLCgAgACABIAIQFwsRACAAIAFzQf8BcUEBa0EfdguwAQEDfyMAQcAFayICJAACQCAAKAJIQQN2Qf8AcSIDQe8ATQRAIAAgA2pB0ABqQeCPAkHwACADaxARGgwBCyAAQdAAaiIEIANqQeCPAkGAASADaxARGiAAIAQgAiACQYAFahBHIARBAEHwABAPGgsgAEHAAWogAEFAa0EQEKUBIAAgAEHQAGogAiACQYAFahBHIAEgAEHAABClASACQcAFEAggAEHQARAIIAJBwAVqJAALCAAgAEEgEB0LRgEEfiABKQIIIQIgASkCECEDIAEpAhghBCABKQIAIQUgACABKQIgNwIgIAAgBDcCGCAAIAM3AhAgACACNwIIIAAgBTcCAAtSAQJ/QbCRAigCACIBIABBA2pBfHEiAmohAAJAIAJBACAAIAFNGw0AIAA/AEEQdEsEQCAAEAJFDQELQbCRAiAANgIAIAEPC0HglwJBMDYCAEF/CwwAIAAgAUGACBARGgv6BQEKfyMAQTBrIgIkACACIAEoAiAiAyABKAIcIgQgASgCGCIFIAEoAhQiBiABKAIQIgcgASgCDCIIIAEoAggiCSABKAIEIgogASgCACILIAEoAiQiAUETbEGAgIAIakEZdmpBGnVqQRl1akEadWpBGXVqQRp1akEZdWpBGnVqQRl1akEadSABakEZdUETbCALaiILQf///x9xNgIAIAIgCiALQRp1aiIKQf///w9xNgIEIAIgCSAKQRl1aiIJQf///x9xNgIIIAIgCCAJQRp1aiIIQf///w9xNgIMIAIgByAIQRl1aiIHQf///x9xNgIQIAIgBiAHQRp1aiIGQf///w9xNgIUIAIgBSAGQRl1aiIFQf///x9xNgIYIAIgBCAFQRp1aiIEQf///w9xNgIcIAIgAyAEQRl1aiID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IABBPGoiASAcKAIUEAkgAEFAayABQgQQFxogHCgCECIBBEAgAEFAayABIBw1AhQQFxoLIABBPGoiASAcKAIcEAkgAEFAayABQgQQFxoCQCAcKAIYIgFFDQAgAEFAayABIBw1AhwQFxogHC0AOEECcUUNACAcKAIYIBwoAhwQCCAcQQA2AhwLIABBPGoiASAcKAIkEAkgAEFAayABQgQQFxogHCgCICIBBEAgAEFAayABIBw1AiQQFxoLIABBQGsgBEHAABBMGgsgBiQAIARBQGtBCBAIQQAhAyMAQYAIayIAJAAgAigCHARAIARBxABqIQUgBEFAayEBA0AgAUEAEAkgBSADEAkgAEGACCAEQcgAEFogAigCACgCBCACKAIYIANsQQp0aiAAEIgBIAFBARAJIABBgAggBEHIABBaIAIoAgAoAgQgAigCGCADbEEKdGpBgAhqIAAQiAEgA0EBaiIDIAIoAhxJDQALCyAAQYAIEAggAEGACGokACAEQcgAEAhBACEDCyAEQdAAaiQAIAMiAA0AIAIoAggEQANAQQAhICMAQSBrIgMkAAJAIAJFDQAgAigCHEUNACADICU2AhBBASEBA0AgAyAgOgAYQQAhHkEAIQAgAQRAA0AgA0EANgIcIAMgAykDGDcDCCADIB42AhQgAyADKQMQNwMAQQAhAQJAIAJFDQACfwJAIAIoAiRBAkcEQCACKAIEIR8MAQsgAigCBCEfQQEgAygCACIFIAMtAAgiBEEBS3INARoLIwBBgCBrIgAkACAAQYAYahA+IABBgBBqED4CQCACRSADRXINACAAIAM1AgA3A4AQIAAgAzUCBDcDiBAgACADMQAINwOQECAAIAI1AhA3A5gQIAAgAjUCCDcDoBAgACACNQIkNwOoECACKAIURQ0AA0AgAUH/AHEiBEUEQCAAIAApA7AQQgF8NwOwECAAED4gAEGACGoiBRA+IABBgBhqIgYgAEGAEGogABBZIAYgACAFEFkLIB8gAUEDdGogAEGACGogBEEDdGopAwA3AwAgAUEBaiIBIAIoAhRJDQALCyAAQYAgaiQAIAMtAAghBCADKAIAIQVBAAshJkEAIARB/wFxIgFFQQF0IAUbIgUgAigCFCIETw0AQX8gAigCGCIAQQFrIAUgACADKAIEbGogASAEbGoiBCAAcBsgBGohAQNAIARB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AWsgHCgCACAcKAIEQQMQaBshAQwBC0FhIQELIABBEGokACABRQ0AICIgCBAIIAkgChAIQWEhAgwBCyAHBEAgByAiIAgQERoLICIgCBAIQQAhAgsgIhAYCyAcQUBrJAAgAgsrAQF/IwBB0AFrIgMkACADEDYgAyABIAIQGxogAyAAECcgA0HQAWokAEEACxwAIABCADcDQCAAQgA3A0ggAEGgigJBwAAQERoLBABBbwvBAQIFfwF+IAJQRQRAIAJBgAIgACgA4AIiBGsiA60iCFYEQCAAQeABaiEGIABB4ABqIQUDQCAAIARqQeAAaiABIAMQERogACAAKADgAiADajYA4AIgAEKAARBxIAAgBRB0IAUgBkGAARARGiAAIAAoAOACIgdBgAFrIgQ2AOACIAEgA2ohASACIAh9IgJBgAMgB2siA60iCFYNAAsLIAAgBGpB4ABqIAEgAqciARARGiAAIAAoAOACIAFqNgDgAgtBAAupAwEVfyABKAIEIQsgACgCBCEMIAEoAgghDSAAKAIIIQ4gASgCDCEPIAAoAgwhAyABKAIQIRAgACgCECEEIAEoAhQhESAAKAIUIQUgASgCGCESIAAoAhghBiABKAIcIRMgACgCHCEHIAEoAiAhFCAAKAIgIQggASgCJCEVIAAoAiQhCSAAQQAgAmsiAiABKAIAIhYgACgCACIKc3EiFyAKczYCACAAIAkgCSAVcyACcSIKczYCJCAAIAggCCAUcyACcSIJczYCICAAIAcgByATcyACcSIIczYCHCAAIAYgBiAScyACcSIHczYCGCAAIAUgBSARcyACcSIGczYCFCAAIAQgBCAQcyACcSIFczYCECAAIAMgAyAPcyACcSIEczYCDCAAIA4gDSAOcyACcSIDczYCCCAAIAwgCyAMcyACcSIAczYCBCABIAogFXM2AiQgASAJIBRzNgIgIAEgCCATczYCHCABIAcgEnM2AhggASAGIBFzNgIUIAEgBSAQczYCECABIAQgD3M2AgwgASADIA1zNgIIIAEgACALczYCBCABIBYgF3M2AgALQQECfyMAQYABayIDJAAgA0EIaiICIAEQKSACQShqIAFBKGoQKSACQdAAaiABQdAAahApIAAgAhAxIANBgAFqJAALMgEBfyAAIAEgAUH4AGoiAhAKIABBKGogAUEoaiABQdAAaiIB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KAIcIQkgASgCICETIAAoAiAhCiABKAIkIRQgACgCJCELIABBACACayICIAAoAgAiFSABKAIAc3EgFXM2AgAgACALIAsgFHMgAnFzNgIkIAAgCiAKIBNzIAJxczYCICAAIAkgCSAScyACcXM2AhwgACAIIAggEXMgAnFzNgIYIAAgByAHIBBzIAJxczYCFCAAIAYgBiAPcyACcXM2AhAgACAFIAUgDnMgAnFzNgIMIAAgBCAEIA1zIAJxczYCCCAAIAMgAyAMcyACcXM2AgQLJAEBfyMAQSBrIgEkACABIAAQLCABQSAQdSEAIAFBIGokACAAC6YEAg5+Cn8gACgCJCESIAAoAiAhEyAAKAIcIRQgACgCGCEVIAAoAhQhESACQhBaBEAgAC0AUEVBGHQhFiAAKAIEIhdBBWytIQ8gACgCCCIYQQVsrSENIAAoAgwiGUEFbK0hCyAAKAIQIhpBBWytIQkgGq0hECAZrSEOIBitIQwgF60hCiAANQIAIQgDQCABKAADQQJ2Qf///x9xIBVqrSIDIA5+IAEoAABB////H3EgEWqtIgQgEH58IAEoAAZBBHZB////H3EgFGqtIgUgDH58IAEoAAlBBnYgE2qtIgYgCn58IBIgFmogASgADEEIdmqtIgcgCH58IAMgDH4gBCAOfnwgBSAKfnwgBiAIfnwgByAJfnwgAyAKfiAEIAx+fCAFIAh+fCAGIAl+fCAHIAt+fCADIAh+IAQgCn58IAUgCX58IAYgC358IAcgDX58IAMgCX4gBCAIfnwgBSALfnwgBiANfnwgByAPfnwiA0IaiEL/////D4N8IgRCGohC/////w+DfCIFQhqIQv////8Pg3wiBkIaiEL/////D4N8IgdCGoinQQVsIAOnQf///x9xaiIRQRp2IASnQf///x9xaiEVIAWnQf///x9xIRQgBqdB////H3EhEyAHp0H///8fcSESIBFB////H3EhESABQRBqIQEgAkIQfSICQg9WDQALCyAAIBE2AhQgACASNgIkIAAgEzYCICAAIBQ2AhwgACAVNgIYC+8BAQJ/IABFBEBBZw8LIAAoAgBFBEBBfw8LAn9BfiAAKAIEQRBJDQAaIAAoAghFBEBBbiAAKAIMDQEaCyAAKAIUIQEgACgCEEUEQEFtQXogARsPC0F6IAFBCEkNABogACgCGEUEQEFs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IAEgFiAZhUEQEAUiFjcDcCABIBYgF3wiFjcDSCABIBMgFoVBPxAFNwMgIAAgASkDQCAeIAApAACFhTcAAEEBISEDQCAAICFBA3QiIGoiIiABICBqIiApAwAgIikAAIUgIEFAaykDAIU3AAAgIUEBaiIhQQhHDQALIAFBgAJqJAALRQECfyMAQRBrIgNBADoADyABBEADQCADIAAgAmotAAAgAy0AD3I6AA8gAkEBaiICIAFHDQALCyADLQAPQQFrQQh2QQFxCxkAIAAgASACIANCACAEQeSRAigCABESABoLEAAgACABQdyRAigCABEDAAsDAAEL9wEBBH8jAEGAAWsiAyQAIAAQHCAAQShqIgQQHCAAQdAAaiIFEDAgACABQcAHbEHgFWoiASACQQAgAkGAAXFBB3YiBmsgAnFBAXRrQRh0QRh1IgJBARAmECIgACABQfgAaiACQQIQJhAiIAAgAUHwAWogAkEDECYQIiAAIAFB6AJqIAJBBBAmECIgACABQeADaiACQQUQJhAiIAAgAUHYBGogAkEGECYQIiAAIAFB0AVqIAJBBxAmECIgACABQcgGaiACQQgQJhAiIANBCGoiASAEECkgA0EwaiAAECkgA0HYAGogBRCAASAAIAEgBhAiIANBgAFqJAALHQAgABAwIABBKGoQHCAAQdAAahAcIABB+ABqEDALgAIBCH8DQCAAIAJqIAEgAkEDdmotAAAgAkEHcXZBAXE6AAAgAkEBaiICQYACRw0ACwNAIAQiAUEBaiEEAkAgACABaiIGLQAARQ0AIAQhAkEBIQUgAUH+AUsNAANAAkAgACACaiIDLAAAIgdFDQAgByAFdCIHIAYsAAAiCGoiCUEPTARAIAYgCToAACADQQA6AAAMAQsgCCAHayIDQXFIDQIgBiADOgAAA0AgACACaiIDLQAARQRAIANBAToAAAwCCyADQQA6AAAgAkH/AUkhAyACQQFqIQIgAw0ACwsgBUEFSw0BIAVBAWoiBSABaiICQYACSQ0ACwsgBEGAAkcNAAsLlQEBBH8jAEEwayIFJAAgACABQShqIgMgARASIABBKGoiBCADIAEQFSAAQdAAaiIDIAAgAkEoahAKIAQgBCACEAogAEH4AGoiBiACQfgAaiABQfgAahAKIAAgAUHQAGogAkHQAGoQCiAFIAAgABASIAAgAyAE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AAAgA0IBfCIDIAJSDQALIAAgACkDOCACfDcDOAsLsgEBAX8gACABKAAAQf///x9xNgIAIAAgASgAA0ECdkGD/v8fcTYCBCAAIAEoAAZBBHZB/4H/H3E2AgggACABKAAJQQZ2Qf//wB9xNgIMIAEoAAwhAiAAQgA3AhQgAEIANwIcIABBADYCJCAAIAJBCHZB//8/cTYCECAAIAEoABA2AiggACABKAAUNgIsIAAgASgAGDYCMCABKAAcIQEgAEEAOgBQIABCADcDOCAAIAE2AjQLMAECfyMAIgVBgAFrQUBxIgQkACAEIAMQhAEgBCABIAIQgwEgBCAAEIIBIAUkAEEACwsAIAAgAUEgEIcBC2wBAX8jAEEQayIDIAA2AgwgAyABNgIIQQAhASADQQA2AgQgAkEASgRAA0AgAyADKAIEIAMoAgggAWotAAAgAygCDCABai0AAHNyNgIEIAFBAWoiASACRw0ACwsgAygCBEEBa0EIdkEBcUEBawspAQJ/A0AgACACQQN0IgNqIAEgA2opAAA3AwAgAkEBaiICQYABRw0ACwtyAQF/AkAgAUEEcUUNACAAKAIAIgEEQCABKAIEIAAoAhBBCnQQCAsgACgCBCIBRQ0AIAEgACgCFEEDdBAICyAAKAIEEBggAEEANgIEAkAgACgCACIBRQ0AIAEoAgAiAkUNACACEBgLIAEQGCAAQQA2AgALEAAgAEIANwIAIABCADcCCAspAQF/IwBBEGsiACQAIABBADoAD0GMkgIgAEEPakEAEAEaIABBEGokAAsoACACQoCAgIAQWgRAEBQACyAAIAEgAiADQgEgBEG8kQIoAgAREgAaCxYAIABCwAAgASACQbSRAigCABENABoLPQECfyMAIgRBgANrQUBxIgMkACADQQBBAEEYEEIaIAMgAUIgECUaIAMgAkIgECUaIAMgAEEYEEEaIAQkAAsqAQF/QX8hBiACQhBaBH8gACABQRBqIAEgAkIQfSADIAQgBRCQAQUgBgsLPAECfyMAQSBrIgckAEF/IQggByAFIAYQZEUEQCAAIAEgAiADIAQgBxBgIQggB0EgEAgLIAdBIGokACAICyUAIAJC8P///w9aBEAQFAALIABBEGogACABIAIgAyAEIAUQkgELPAECfyMAQSBrIgckAEF/IQggByAFIAYQZEUEQCAAIAEgAiAD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AUEgaiAIQiB9IAYgASAFEI8BIQcLIAZBIGokACAHC5kBAgJ/AX4gAq0gA61CIIaEIQcjAEHgAGsiAiQAQX8hAyACQSBqIAIQkwFFBEAgAkFAayIFIAJBIGoiBiAEEI4BIABBIGogASAHIAUgBCACEJEBIQMgACACKQM4NwAYIAAgAikDMDcAECAAIAIpAyg3AAggACACKQMgNwAAIAJBIBAIIAZBIBAIIAVBGBAICyACQeAAaiQAIAMLGQAgACABIAKtIAOtQiCGhCAEIAUgBhCPAQstAQF+IAKtIAOtQiCGhCIGQhBaBH8gACABQRBqIAEgBkIQfSAEIAUQYAVBfwsLGwAgACABIAIgA60gBK1CIIaEIAUgBiAHEJABCxgAIAAgASACIAOtIAStQiCGhCAFIAYQYAsZACAAIAEgAq0gA61CIIaEIAQgBSAGEJEBCy4BAX4gAq0gA61CIIaEIgZC8P///w9aBEAQFAALIABBEGogACABIAYgBCAFEGELGwAgACABIAIgA60gBK1CIIaEIAUgBiAHEJIBCxgAIAAgASACIAOtIAStQiCGhCAFIAYQYQtIAQF/IwBBIGsiBSQAIAUgASACrSADrUIghoQgBBCUARogACAFEIYBIQEgBSAAQSAQTyECIAVBIGokACACQX8gASAAIAVGG3ILFQAgACABIAKtIAOtQiCGhCAEEJQBC1sBAn4gB60gCK1CIIaEIQxBfyECIAStIAWtQiCGhCILQhBaBEAgACADIAtCEH0gAyALp2pBEGsgBiAMIAkgChCaASECCyABBEAgAUIAIAtCEH0gAhs3AwALIAILJQAgACACIAOtIAStQiCGhCAFIAYgB60gCK1CIIaEIAkgChCaAQtZAQJ+An8gBq0gB61CIIaEIQwgA60gBK1CIIaEIgtC8P///w9UBEAgACAAIAunakEAIAIgCyAFIAwgCSAKEJsBGiABBEAgASALQhB8NwMAC0EADAELEBQACwsnACAAIAEgAiADIAStIAWtQiCGhCAGIAetIAitQiCGhCAKIAsQmwELWwECfiAHrSAIrUIghoQhDEF/IQIgBK0gBa1CIIaEIgtCEFoEQCAAIAMgC0IQfSADIAunakEQayAGIAwgCSAKEKYBIQILIAEEQCABQgAgC0IQfSACGzcDAAsgAgslACAAIAIgA60gBK1CIIaEIAUgBiAHrSAIrUIghoQgCSAKEKYBC1sBAn4gB60gCK1CIIaEIQxBfyECIAStIAWtQiCGhCILQhBaBEAgACADIAtCEH0gAyALp2pBEGsgBiAMIAkgChCnASECCyABBEAgAUIAIAtCEH0gAhs3AwALIAILJQAgACACIAOtIAStQiCGhCAFIAYgB60gCK1CIIaEIAkgChCnAQtZAQJ+An8gBq0gB61CIIaEIQwgA60gBK1CIIaEIgtC8P///w9UBEAgACAAIAunakEAIAIgCyAFIAwgCSAKEKgBGiABBEAgASALQhB8NwMAC0EADAELEBQACwsnACAAIAEgAiADIAStIAWtQiCGhCAGIAetIAitQiCGhCAKIAsQqAELWQECfgJ/IAatIAetQiCGhCEMIAOtIAStQiCGhCILQvD///8PVARAIAAgACALp2pBACACIAsgBSAMIAkgChCpARogAQRAIAEgC0IQfDcDAAtBAAwBCxAUAAsLJwAgACABIAIgAyAErSAFrUIghoQgBiAHrSAIrUIghoQgCiALEKkBC08BAn8jAEHQAGsiBiQAIAJQRQRAIAZBDGoiByAEEAkgBkEQaiIEIAUQRSAEIAMgBxCVASAEIAEgACACEEMgBEHAABAICyAGQdAAaiQAQQAL2gEBBH8jACIFIQcgBUGABGtBQHEiBSQAIAAgASAAGyIIBEBBfyEGIAVB4ABqIAMgBBBeRQRAIAEgACABGyEBQQAhACAFQYABaiIDQQBBAEHAABBCGiADIAVB4ABqIgZCIBAlGiAGQSAQCCADIARCIBAlGiADIAJCIBAlGiADIAVBIGpBwAAQQRogA0GAAxAIA0AgACABaiAFQSBqIABqIgItAAA6AAAgACAIaiACLQAgOgAAIABBAWoiAEEgRw0ACyAFQSBqQcAAEAhBACEGCyAHJAAgBg8LEBQAC9oBAQR/IwAiBSEHIAVBgARrQUBxIgUkACAAIAEgABsiCARAQX8hBiAFQeAAaiADIAQQXkUEQCABIAAgARshAUEAIQAgBUGAAWoiA0EAQQBBwAAQQhogAyAFQeAAaiIGQiAQJRogBkEgEAggAyACQiAQJRogAyAEQiAQJRogAyAFQSBqQcAAEEEaIANBgAMQCANAIAAgCGogBUEgaiAAaiICLQAAOgAAIAAgAWogAi0AIDoAACAAQQFqIgBBIEcNAAsgBUEgakHAABAIQQAhBgsgByQAIAYPCxAUAAsOACABQSAQHSAAIAEQXwsYACABQSAgAkIgQQBBABCcARogACABEF8LBABBCgsFAEHYCgsIACAAQRAQHQsEAEEwC10BA38jAEHQAGsiBiQAIAJQRQRAIAZBCGoiCCAEpxAJIAZBDGogBEIgiKcQCSAGQRBqIgcgBRBFIAcgAyAIEJ8BIAcgASAAIAIQQyAHQcAAEAgLIAZB0ABqJABBAAtWAQF/IwBBQGoiAyQAIAMgAkIgEDUaIAEgAykDGDcAGCABIAMpAxA3ABAgASADKQMINwAIIAEgAykDADcAACADQcAAEAggACABEHchACADQUBrJAAgAAsIAEGAgICABAsEAEEECwgAQYCAgIABCwcAQYCAgCALCABBgICAgHgLBgBBgMAACwUAQfsKCwUAQYABC0YBAX8jAEFAaiIEJAAgAVBFBEAgBCADEEUgBCACQQAQlQEgBCAAQQAgAacQDyIAIAAgARBDIARBwAAQCAsgBEFAayQAQQALBQBBgAMLNwEBfyABEGkgAEEDbiICQX1sIABqIgBBAXYgAHJBAXEgAEEBakEEIAFBAnEbbCACQQJ0akEBagv0AgELfwJAIANFDQACQAJAA0AgByEIA0ACQCACIAhqLQAAIg1B3wFxQTdrQf8BcSIOQfb/A2ogDkHw/wNqc0EIdiIPIA1BMHMiEEH2/wNqQQh2IgpyQf8BcUUEQEEBIQogBEUgC0H/AXFyDQQgBCANEEQNASAIIQcMBgsgASAJTQRAQeCXAkHEADYCAEEAIQoMBAsgDiAPcSAKIBBxciEHAkAgC0H/AXFFBEAgB0EEdCERDAELIAAgCWogByARcjoAACAJQQFqIQkLIAtBf3MhC0EBIQogCEEBaiIHIANJDQIMBAtBACELIAhBAWoiCCADSQ0ACwsgAyAHQQFqIgAgACADSRshBwwCCyAIIQcLIAtB/wFxBEBB4JcCQRw2AgBBfyEMIAdBAWshB0EAIQkMAQsgCg0AQQAhCUF/IQwLAkAgBgRAIAYgAiAHajYCAAwBCyADIAdGDQBB4JcCQRw2AgBBfyEMCyAFBEAgBSAJNgIACyAMC5sBAQN/IANB/v///wdLIANBAXQgAU9yRQRAQQAhASADBH8DQCAAIAFBAXRqIgQgASACai0AACIFQQ9xIgZBCHQgBkH2/wNqQYCyA3FqQYCuAWpBCHY6AAEgBCAFQQR2IgQgBEH2/wNqQQh2QdkBcWpB1wBqOgAAIAFBAWoiASADRw0ACyADQQF0BSABCyAAakEAOgAAIAAPCxAUAAssAQF/IwBBQGoiAyQAIAAgAxAnIAEgA0LAACACQQEQoQEhACADQUBrJAAgAAsuAQF/IwBBQGoiBCQAIAAgBBAnIAEgAiAEQsAAIANBARCjASEAIARBQGskACAACwgAIAAQNkEACywBAX8jAEEgayICJAAgAkEgEB0gACABIAIQpAEaIAJBIBAIIAJBIGokAEEACwsAIAAgASACEKQBCwUAQb9/CwUAQdABC20BAX8jAEFAaiICJAAgAiABQiAQNRogAiACLQAAQfgBcToAACACIAItAB9BP3FBwAByOgAfIAAgAikDEDcAECAAIAIpAwg3AAggACACKQMANwAAIAAgAikDGDcAGCACQcAAEAggAkFAayQAQQALnwQBB38jAEGAAmsiBSQAQX8hCAJAIAEQUQ0AIAVB4ABqIAEQfg0AIwBBoAFrIgYkACMAQeANayICJAAgAkHgA2oiAyAFQeAAaiIEEBkgAkHAAmoiASAEEDogAiABEBMgASACIAMQGiACQaABaiIDIAEQEyACQYAFaiIEIAMQGSABIAIgBBAaIAMgARATIAJBoAZqIgQgAxAZIAEgAiAEEBogAyABEBMgAkHAB2oiBCADEBkgASACIAQQGiADIAEQEyACQeAIaiIEIAMQGSABIAIgBBAaIAMgARATIAJBgApqIgQgAxAZIAEgAiAEEBogAyABEBMgAkGgC2oiBCADEBkgASACIAQQGiADIAEQEyACQcAMaiADEBkgBhB6QfwBIQEDQCACQcACaiAGEDoCQCABIgNB4IUCaiwAACIBQQBKBEAgAkGgAWoiBCACQcACaiIHEBMgByAEIAJB4ANqIAFB/gFxQQF2QaABbGoQGgwBCyABQQBODQAgAkGgAWoiBCACQcACaiIHEBMgByAEIAJB4ANqQQAgAWtB/gFxQQF2QaABbGoQfAsgBiACQcACahATIANBAWshASADDQALIAJB4A1qJAAgBhBWIQEgBkGgAWokACABRQ0AIAUQHCAFIAUgBUGIAWoiAxAVIAVBMGoiARAcIAEgASADEBIgBSAFEDwgASAB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xAGBEXgA+2eX/wc0cP+MOEL/KOL1/9lGJf6s1gn/SEOGAZLA1v8sJnAARLhL/85a+wCV640Atao6AHT07wBcnQIAZq1iAOmJYAF/McsABZuUABeUCf/TegwAIoYa/9vMiACGCCn/4FMr/lUZ9wBtfwD+qYgwAO532//nrdUAzhL+/gi6B/9+CQcBbypIAG807P5gP40Ak79//s1OwP8Oau0Bu9tMAK/zu/5pWa0AVRlZAaLzlAACdtH+IZ4JAIujLv9dRigAbCqO/m/8jv+b35AAM+Wn/0n8m/9edAz/mKDa/5zuJf+z6s//xQCz/5qkjQDhxGgACiMZ/tHU8v9h/d7+uGXlAN4SfwGkiIf/Hs+M/pJh8wCBwBr+yVQh/28KTv+TUbL/BAQYAKHu1/8GjSEANdcO/ym10P/ni50As8vd//+5cQC94qz/cULW/8o+Lf9mQAj/Tq4Q/oV1RP8AQYAUCwEBAEGgFAuwASbolY/CsiewRcP0ifLvmPDV36wF08YzObE4AohtU/wFxxdqcD1N2E+6PAt2DRBnDyogU/osOczGTsf9d5KsA3rs////////////////////////////////////////f+3///////////////////////////////////////9/7v///////////////////////////////////////3/t0/VcGmMSWNac96Le+d4UAEHfFQv88AEQhTuMAb3xJP/4JcMBYNw3ALdMPv/DQj0AMkykAeGkTP9MPaP/dT4fAFGRQP92QQ4AonPW/waKLgB85vT/CoqPADQawgC49EwAgY8pAb70E/97qnr/YoFEAHnVkwBWZR7/oWebAIxZQ//v5b4BQwu1AMbwif7uRbz/6nE8/yX/Of9Fsrb+gNCzAHYaff4DB9b/8TJN/1XLxf/Th/r/GTBk/7vVtP4RWGkAU9GeAQVzYgAErjz+qzdu/9m1Ef8UvKoAkpxm/lfWrv9yepsB6SyqAH8I7wHW7OoArwXbADFqPf8GQtD/Ampu/1HqE//Xa8D/Q5fuABMqbP/lVXEBMkSH/xFqCQAyZwH/UAGoASOYHv8QqLkBOFno/2XS/AAp+kcAzKpP/w4u7/9QTe8AvdZL/xGN+QAmUEz/vlV1AFbkqgCc2NABw8+k/5ZCTP+v4RD/jVBiAUzb8gDGonIALtqYAJsr8f6boGj/sgn8/mRu1AAOBacA6e+j/xyXnQFlkgr//p5G/kf55ABYHjIARDqg/78YaAGBQoH/wDJV/wiziv8m+skAc1CgAIPmcQB9WJMAWkTHAP1MngAc/3YAcfr+AEJLLgDm2isA5Xi6AZREKwCIfO4Bu2vF/1Q19v8zdP7/M7ulAAIRrwBCVKAB9zoeACNBNf5F7L8ALYb1AaN73QAgbhT/NBelALrWRwDpsGAA8u82ATlZigBTAFT/iKBkAFyOeP5ofL4AtbE+//opVQCYgioBYPz2AJeXP/7vhT4AIDicAC2nvf+OhbMBg1bTALuzlv76qg7/RHEV/966O/9CB/EBRQZIAFacbP43p1kAbTTb/g2wF//ELGr/75VH/6SMff+frQEAMynnAJE+IQCKb10BuVNFAJBzLgBhlxD/GOQaADHZ4gBxS+r+wZkM/7YwYP8ODRoAgMP5/kXBOwCEJVH+fWo8ANbwqQGk40IA0qNOACU0lwBjTRoA7pzV/9XA0QFJLlQAFEEpATbOTwDJg5L+qm8Y/7EhMv6rJsv/Tvd0ANHdmQCFgLIBOiwZAMknOwG9E/wAMeXSAXW7dQC1s7gBAHLbADBekwD1KTgAfQ3M/vStdwAs3SD+VOoUAPmgxgHsfur/jz7dAIFZ1v83iwX+RBS//w7MsgEjw9kALzPOASb2pQDOGwb+nlckANk0kv99e9f/VTwf/6sNBwDa9Vj+/CM8ADfWoP+FZTgA4CAT/pNA6gAakaIBcnZ9APj8+gBlXsT/xo3i/jMqtgCHDAn+bazS/8XswgHxQZoAMJwv/5lDN//apSL+SrSzANpCRwFYemMA1LXb/1wq5//vAJoA9U23/15RqgES1dgAq11HADRe+AASl6H+xdFC/670D/6iMLcAMT3w/rZdwwDH5AYByAUR/4kt7f9slAQAWk/t/yc/Tf81Us8BjhZ2/2XoEgFcGkMABchY/yGoiv+V4UgAAtEb/yz1qAHc7RH/HtNp/o3u3QCAUPX+b/4OAN5fvgHfCfEAkkzU/2zNaP8/dZkAkEUwACPkbwDAIcH/cNa+/nOYlwAXZlgAM0r4AOLHj/7MomX/0GG9AfVoEgDm9h7/F5RFAG5YNP7itVn/0C9a/nKhUP8hdPgAs5hX/0WQsQFY7hr/OiBxAQFNRQA7eTT/mO5TADQIwQDnJ+n/xyKKAN5ErQBbOfL+3NJ//8AH9v6XI7sAw+ylAG9dzgDU94UBmoXR/5vnCgBATiYAevlkAR4TYf8+W/kB+IVNAMU/qP50ClIAuOxx/tTLwv89ZPz+JAXK/3dbmf+BTx0AZ2er/u3Xb//YNUUA7/AXAMKV3f8m4d4A6P+0/nZShf850bEBi+iFAJ6wLv7Ccy4AWPflARxnvwDd3q/+lessAJfkGf7aaWcAjlXSAJWBvv/VQV7+dYbg/1LGdQCd3dwAo2UkAMVyJQBorKb+C7YAAFFIvP9hvBD/RQYKAMeTkf8ICXMBQdav/9mt0QBQf6YA9+UE/qe3fP9aHMz+rzvw/wsp+AFsKDP/kLHD/pb6fgCKW0EBeDze//XB7wAd1r3/gAIZAFCaogBN3GsB6s1K/zamZ/90SAkA5F4v/x7IGf8j1ln/PbCM/1Pio/9LgqwAgCYRAF+JmP/XfJ8BT10AAJRSnf7Dgvv/KMpM//t+4ACdYz7+zwfh/2BEwwCMup3/gxPn/yqA/gA02z3+ZstIAI0HC/+6pNUAH3p3AIXykQDQ/Oj/W9W2/48E+v7510oApR5vAasJ3wDleyIBXIIa/02bLQHDixz/O+BOAIgR9wBseSAAT/q9/2Dj/P4m8T4APq59/5tvXf8K5s4BYcUo/wAxOf5B+g0AEvuW/9xt0v8Frqb+LIG9AOsjk/8l943/SI0E/2dr/wD3WgQANSwqAAIe8AAEOz8AWE4kAHGntAC+R8H/x56k/zoIrABNIQwAQT8DAJlNIf+s/mYB5N0E/1ce/gGSKVb/iszv/myNEf+78ocA0tB/AEQtDv5JYD4AUTwY/6oGJP8D+RoAI9VtABaBNv8VI+H/6j04/zrZBgCPfFgA7H5CANEmt/8i7gb/rpFmAF8W0wDED5n+LlTo/3UikgHn+kr/G4ZkAVy7w/+qxnAAeBwqANFGQwAdUR8AHahkAamtoABrI3UAPmA7/1EMRQGH777/3PwSAKPcOv+Jibz/U2ZtAGAGTADq3tL/ua7NATye1f8N8dYArIGMAF1o8gDAnPsAK3UeAOFRngB/6NoA4hzLAOkbl/91KwX/8g4v/yEUBgCJ+yz+Gx/1/7fWff4oeZUAup7V/1kI4wBFWAD+y4fhAMmuywCTR7gAEnkp/l4FTgDg1vD+JAW0APuH5wGjitQA0vl0/liBuwATCDH+Pg6Q/59M0wDWM1IAbXXk/mffy/9L/A8Bmkfc/xcNWwGNqGD/tbaFAPozNwDq6tT+rz+eACfwNAGevST/1ShVASC09/8TZhoBVBhh/0UV3gCUi3r/3NXrAejL/wB5OZMA4weaADUWkwFIAeEAUoYw/lM8nf+RSKkAImfvAMbpLwB0EwT/uGoJ/7eBUwAksOYBImdIANuihgD1Kp4AIJVg/qUskADK70j+15YFACpCJAGE168AVq5W/xrFnP8x6If+Z7ZSAP2AsAGZsnoA9foKAOwYsgCJaoQAKB0pADIemP98aSYA5r9LAI8rqgAsgxT/LA0X/+3/mwGfbWT/cLUY/2jcbAA304MAYwzV/5iXkf/uBZ8AYZsIACFsUQABA2cAPm0i//qbtAAgR8P/JkaRAZ9f9QBF5WUBiBzwAE/gGQBObnn/+Kh8ALuA9wACk+v+TwuEAEY6DAG1CKP/T4mF/yWqC/+N81X/sOfX/8yWpP/v1yf/Llec/gijWP+sIugAQixm/xs2Kf7sY1f/KXupATRyKwB1higAm4YaAOfPW/4jhCb/E2Z9/iTjhf92A3H/HQ18AJhgSgFYks7/p7/c/qISWP+2ZBcAH3U0AFEuagEMAgcARVDJAdH2rAAMMI0B4NNYAHTinwB6YoIAQezqAeHiCf/P4nsBWdY7AHCHWAFa9Mv/MQsmAYFsugBZcA8BZS7M/3/MLf5P/93/M0kS/38qZf/xFcoAoOMHAGky7ABPNMX/aMrQAbQPEABlxU7/Yk3LACm58QEjwXwAI5sX/881wAALfaMB+Z65/wSDMAAVXW//PXnnAUXIJP+5MLn/b+4V/ycyGf9j16P/V9Qe/6STBf+ABiMBbN9u/8JMsgBKZbQA8y8wAK4ZK/9Srf0BNnLA/yg3WwDXbLD/CzgHAODpTADRYsr+8hl9ACzBXf7LCLEAh7ATAHBH1f/OO7ABBEMaAA6P1f4qN9D/PEN4AMEVowBjpHMAChR2AJzU3v6gB9n/cvVMAXU7ewCwwlb+1Q+wAE7Oz/7VgTsA6fsWAWA3mP/s/w//xVlU/12VhQCuoHEA6mOp/5h0WACQpFP/Xx3G/yIvD/9jeIb/BezBAPn3fv+Tux4AMuZ1/2zZ2/+jUab/SBmp/pt5T/8cm1n+B34RAJNBIQEv6v0AGjMSAGlTx/+jxOYAcfikAOL+2gC90cv/pPfe/v8jpQAEvPMBf7NHACXt/v9kuvAABTlH/mdISf/0ElH+5dKE/+4GtP8L5a7/493AARExHACj18T+CXYE/zPwRwBxgW3/TPDnALyxfwB9RywBGq/zAF6pGf4b5h0AD4t3Aaiquv+sxUz//Eu8AIl8xABIFmD/LZf5AdyRZABAwJ//eO/iAIGykgAAwH0A64rqALedkgBTx8D/uKxI/0nhgABNBvr/ukFDAGj2zwC8IIr/2hjyAEOKUf7tgXn/FM+WASnHEP8GFIAAn3YFALUQj//cJg8AF0CT/kkaDQBX5DkBzHyAACsY3wDbY8cAFksU/xMbfgCdPtcAbh3mALOn/wE2/L4A3cy2/rOeQf9RnQMAwtqfAKrfAADgCyD/JsViAKikJQAXWAcBpLpuAGAkhgDq8uUA+nkTAPL+cP8DL14BCe8G/1GGmf7W/aj/Q3zgAPVfSgAcHiz+AW3c/7JZWQD8JEwAGMYu/0xNbwCG6oj/J14dALlI6v9GRIf/52YH/k3njACnLzoBlGF2/xAb4QGmzo//brLW/7SDogCPjeEBDdpO/3KZIQFiaMwAr3J1AafOSwDKxFMBOkBDAIovbwHE94D/ieDg/p5wzwCaZP8BhiVrAMaAT/9/0Zv/o/65/jwO8wAf23D+HdlBAMgNdP57PMT/4Du4/vJZxAB7EEv+lRDOAEX+MAHndN//0aBBAchQYgAlwrj+lD8iAIvwQf/ZkIT/OCYt/sd40gBssab/oN4EANx+d/6la6D/Utz4AfGviACQjRf/qYpUAKCJTv/idlD/NBuE/z9gi/+Y+icAvJsPAOgzlv4oD+j/8OUJ/4mvG/9LSWEB2tQLAIcFogFrudUAAvlr/yjyRgDbyBkAGZ0NAENSUP/E+Rf/kRSVADJIkgBeTJQBGPtBAB/AFwC41Mn/e+miAfetSACiV9v+foZZAJ8LDP6maR0ASRvkAXF4t/9Co20B1I8L/5/nqAH/gFoAOQ46/lk0Cv/9CKMBAJHS/wqBVQEutRsAZ4ig/n680f8iI28A19sY/9QL1v5lBXYA6MWF/9+nbf/tUFb/RoteAJ7BvwGbDzP/D75zAE6Hz//5ChsBtX3pAF+sDf6q1aH/J+yK/19dV/++gF8AfQ/OAKaWnwDjD57/zp54/yqNgABlsngBnG2DANoOLP73qM7/1HAcAHAR5P9aECUBxd5sAP7PU/8JWvP/8/SsABpYc//NdHoAv+bBALRkCwHZJWD/mk6cAOvqH//OsrL/lcD7ALb6hwD2FmkAfMFt/wLSlf+pEaoAAGBu/3UJCAEyeyj/wb1jACLjoAAwUEb+0zPsAC169f4srggArSXp/55BqwB6Rdf/WlAC/4NqYP7jcocAzTF3/rA+QP9SMxH/8RTz/4INCP6A2fP/ohsB/lp28QD2xvb/NxB2/8ifnQCjEQEAjGt5AFWhdv8mAJUAnC/uAAmmpgFLYrX/MkoZAEIPLwCL4Z8ATAOO/w7uuAALzzX/t8C6Aasgrv+/TN0B96rbABmsMv7ZCekAy35E/7dcMAB/p7cBQTH+ABA/fwH+Far/O+B//hYwP/8bToL+KMMdAPqEcP4jy5AAaKmoAM/9Hv9oKCb+XuRYAM4QgP/UN3r/3xbqAN/FfwD9tbUBkWZ2AOyZJP/U2Uj/FCYY/oo+PgCYjAQA5txj/wEV1P+UyecA9HsJ/gCr0gAzOiX/Af8O//S3kf4A8qYAFkqEAHnYKQBfw3L+hRiX/5zi5//3BU3/9pRz/uFcUf/eUPb+qntZ/0rHjQAdFAj/iohG/11LXADdkzH+NH7iAOV8FwAuCbUAzUA0AYP+HACXntQAg0BOAM4ZqwAA5osAv/1u/mf3pwBAKCgBKqXx/ztL5P58873/xFyy/4KMVv+NWTgBk8YF/8v4nv6Qoo0AC6ziAIIqFf8Bp4//kCQk/zBYpP6oqtwAYkfWAFvQTwCfTMkBpirW/0X/AP8GgH3/vgGMAJJT2v/X7kgBen81AL10pf9UCEL/1gPQ/9VuhQDDqCwBnudFAKJAyP5bOmgAtjq7/vnkiADLhkz+Y93pAEv+1v5QRZoAQJj4/uyIyv+daZn+la8UABYjE/98eekAuvrG/oTliwCJUK7/pX1EAJDKlP7r7/gAh7h2AGVeEf96SEb+RYKSAH/e+AFFf3b/HlLX/rxKE//lp8L+dRlC/0HqOP7VFpwAlztd/i0cG/+6fqT/IAbvAH9yYwHbNAL/Y2Cm/j6+fv9s3qgBS+KuAObixwA8ddr//PgUAda8zAAfwob+e0XA/6mtJP43YlsA3ypm/okBZgCdWhkA73pA//wG6QAHNhT/UnSuAIclNv8Pun0A43Cv/2S04f8q7fT/9K3i/vgSIQCrY5b/Susy/3VSIP5qqO0Az23QAeQJugCHPKn+s1yPAPSqaP/rLXz/RmO6AHWJtwDgH9cAKAlkABoQXwFE2VcACJcU/xpkOv+wpcsBNHZGAAcg/v70/vX/p5DC/31xF/+webUAiFTRAIoGHv9ZMBwAIZsO/xnwmgCNzW0BRnM+/xQoa/6Kmsf/Xt/i/52rJgCjsRn+LXYD/w7eFwHRvlH/dnvoAQ3VZf97N3v+G/alADJjTP+M1iD/YUFD/xgMHACuVk4BQPdgAKCHQwBCN/P/k8xg/xoGIf9iM1MBmdXQ/wK4Nv8Z2gsAMUP2/hKVSP8NGUgAKk/WACoEJgEbi5D/lbsXABKkhAD1VLj+eMZo/37aYAA4der/DR3W/kQvCv+nmoT+mCbGAEKyWf/ILqv/DWNT/9K7/f+qLSoBitF8ANaijQAM5pwAZiRw/gOTQwA013v/6as2/2KJPgD32if/59rsAPe/fwDDklQApbBc/xPUXv8RSuMAWCiZAcaTAf/OQ/X+8APa/z2N1f9ht2oAw+jr/l9WmgDRMM3+dtHx//B43wHVHZ8Ao3+T/w3aXQBVGET+RhRQ/70FjAFSYf7/Y2O//4RUhf9r2nT/cHouAGkRIADCoD//RN4nAdj9XACxac3/lcnDACrhC/8oonMACQdRAKXa2wC0FgD+HZL8/5LP4QG0h2AAH6NwALEL2/+FDMH+K04yAEFxeQE72Qb/bl4YAXCsbwAHD2AAJFV7AEeWFf/QSbwAwAunAdX1IgAJ5lwAoo4n/9daGwBiYVkAXk/TAFqd8ABf3H4BZrDiACQe4P4jH38A5+hzAVVTggDSSfX/L49y/0RBxQA7SD7/t4Wt/l15dv87sVH/6kWt/82AsQDc9DMAGvTRAUneTf+jCGD+lpXTAJ7+ywE2f4sAoeA7AARtFv/eKi3/0JJm/+yOuwAyzfX/CkpZ/jBPjgDeTIL/HqY/AOwMDf8xuPQAu3FmANpl/QCZObb+IJYqABnGkgHt8TgAjEQFAFukrP9Okbr+QzTNANvPgQFtcxEANo86ARX4eP+z/x4AwexC/wH/B//9wDD/E0XZAQPWAP9AZZIB330j/+tJs//5p+IA4a8KAWGiOgBqcKsBVKwF/4WMsv+G9Y4AYVp9/7rLuf/fTRf/wFxqAA/Gc//ZmPgAq7J4/+SGNQCwNsEB+vs1ANUKZAEix2oAlx/0/qzgV/8O7Rf//VUa/38ndP+saGQA+w5G/9TQiv/90/oAsDGlAA9Me/8l2qD/XIcQAQp+cv9GBeD/9/mNAEQUPAHx0r3/w9m7AZcDcQCXXK4A5z6y/9u34QAXFyH/zbVQADm4+P9DtAH/Wntd/ycAov9g+DT/VEKMACJ/5P/CigcBpm68ABURmwGavsb/1lA7/xIHjwBIHeIBx9n5AOihRwGVvskA2a9f/nGTQ/+Kj8f/f8wBAB22UwHO5pv/usw8AAp9Vf/oYBn//1n3/9X+rwHowVEAHCuc/gxFCACTGPgAEsYxAIY8IwB29hL/MVj+/uQVuv+2QXAB2xYB/xZ+NP+9NTH/cBmPACZ/N//iZaP+0IU9/4lFrgG+dpH/PGLb/9kN9f/6iAoAVP7iAMkffQHwM/v/H4OC/wKKMv/X17EB3wzu//yVOP98W0T/SH6q/nf/ZACCh+j/Dk+yAPqDxQCKxtAAediL/ncSJP8dwXoAECot/9Xw6wHmvqn/xiPk/m6tSADW3fH/OJSHAMB1Tv6NXc//j0GVABUSYv9fLPQBar9NAP5VCP7WbrD/Sa0T/qDEx//tWpAAwaxx/8ibiP7kWt0AiTFKAaTd1//RvQX/aew3/yofgQHB/+wALtk8AIpYu//iUuz/UUWX/46+EAENhggAf3ow/1FAnACr84sA7SP2AHqPwf7UepIAXyn/AVeETQAE1B8AER9OACctrf4Yjtn/XwkG/+NTBgBiO4L+Ph4hAAhz0wGiYYD/B7gX/nQcqP/4ipf/YvTwALp2ggBy+Ov/aa3IAaB8R/9eJKQBr0GS/+7xqv7KxsUA5EeK/i32bf/CNJ4AhbuwAFP8mv5Zvd3/qkn8AJQ6fQAkRDP+KkWx/6hMVv8mZMz/JjUjAK8TYQDh7v3/UVGHANIb//7rSWsACM9zAFJ/iABUYxX+zxOIAGSkZQBQ0E3/hM/t/w8DD/8hpm4AnF9V/yW5bwGWaiP/ppdMAHJXh/+fwkAADHof/+gHZf6td2IAmkfc/r85Nf+o6KD/4CBj/9qcpQCXmaMA2Q2UAcVxWQCVHKH+zxceAGmE4/825l7/ha3M/1y3nf9YkPz+ZiFaAJ9hAwC12pv/8HJ3AGrWNf+lvnMBmFvh/1hqLP/QPXEAlzR8AL8bnP9uNuwBDh6m/yd/zwHlxxwAvOS8/mSd6wD22rcBaxbB/86gXwBM75MAz6F1ADOmAv80dQr+STjj/5jB4QCEXoj/Zb/RACBr5f/GK7QBZNJ2AHJDmf8XWBr/WZpcAdx4jP+Qcs///HP6/yLOSACKhX//CLJ8AVdLYQAP5Vz+8EOD/3Z74/6SeGj/kdX/AYG7Rv/bdzYAAROtAC2WlAH4U0gAy+mpAY5rOAD3+SYBLfJQ/x7pZwBgUkYAF8lvAFEnHv+ht07/wuoh/0TjjP7YznQARhvr/2iQTwCk5l3+1oecAJq78v68FIP/JG2uAJ9w8QAFbpUBJKXaAKYdEwGyLkkAXSsg/vi97QBmm40AyV3D//GL/f8Pb2L/bEGj/ptPvv9JrsH+9igw/2tYC/7KYVX//cwS/3HyQgBuoML+0BK6AFEVPAC8aKf/fKZh/tKFjgA48on+KW+CAG+XOgFv1Y3/t6zx/yYGxP+5B3v/Lgv2APVpdwEPAqH/CM4t/xLKSv9TfHMB1I2dAFMI0f6LD+j/rDat/jL3hADWvdUAkLhpAN/++AD/k/D/F7xIAAczNgC8GbT+3LQA/1OgFACjvfP/OtHC/1dJPABqGDEA9fncABatpwB2C8P/E37tAG6fJf87Ui8AtLtWALyU0AFkJYX/B3DBAIG8nP9UaoH/heHKAA7sb/8oFGUArKwx/jM2Sv/7ubj/XZvg/7T54AHmspIASDk2/rI+uAB3zUgAue/9/z0P2gDEQzj/6iCrAS7b5ADQbOr/FD/o/6U1xwGF5AX/NM1rAErujP+WnNv+76yy//u93/4gjtP/2g+KAfHEUAAcJGL+FurHAD3t3P/2OSUAjhGO/50+GgAr7l/+A9kG/9UZ8AEn3K7/ms0w/hMNwP/0Ijb+jBCbAPC1Bf6bwTwApoAE/ySROP+W8NsAeDORAFKZKgGM7JIAa1z4Ab0KAwA/iPIA0ycYABPKoQGtG7r/0szv/inRov+2/p//rHQ0AMNn3v7NRTsANRYpAdowwgBQ0vIA0rzPALuhof7YEQEAiOFxAPq4PwDfHmL+TaiiADs1rwATyQr/i+DCAJPBmv/UvQz+Aciu/zKFcQFes1oArbaHAF6xcQArWdf/iPxq/3uGU/4F9UL/UjEnAdwC4ABhgbEATTtZAD0dmwHLq9z/XE6LAJEhtf+pGI0BN5azAIs8UP/aJ2EAApNr/zz4SACt5i8BBlO2/xBpov6J1FH/tLiGASfepP/dafsB73B9AD8HYQA/aOP/lDoMAFo84P9U1PwAT9eoAPjdxwFzeQEAJKx4ACCiu/85azH/kyoVAGrGKwE5SlcAfstR/4GHwwCMH7EA3YvCAAPe1wCDROcAsVay/nyXtAC4fCYBRqMRAPn7tQEqN+MA4qEsABfsbgAzlY4BXQXsANq3av5DGE0AKPXR/955mQClOR4AU308AEYmUgHlBrwAbd6d/zd2P//Nl7oA4yGV//6w9gHjseMAImqj/rArTwBqX04BufF6/7kOPQAkAcoADbKi//cLhACh5lwBQQG5/9QypQGNkkD/nvLaABWkfQDVi3oBQ0dXAMuesgGXXCsAmG8F/ycD7//Z//r/sD9H/0r1TQH6rhL/IjHj//Yu+/+aIzABfZ09/2okTv9h7JkAiLt4/3GGq/8T1dn+2F7R//wFPQBeA8oAAxq3/0C/K/8eFxUAgY1N/2Z4BwHCTIwAvK80/xFRlADoVjcB4TCsAIYqKv/uMi8AqRL+ABSTV/8Ow+//RfcXAO7lgP+xMXAAqGL7/3lH+ADzCJH+9uOZ/9upsf77i6X/DKO5/6Qoq/+Znxv+821b/94YcAES1ucAa521/sOTAP/CY2j/WYy+/7FCfv5quUIAMdofAPyungC8T+YB7ingANTqCAGIC7UApnVT/0TDXgAuhMkA8JhYAKQ5Rf6g4Cr/O9dD/3fDjf8ktHn+zy8I/67S3wBlxUT//1KNAfqJ6QBhVoUBEFBFAISDnwB0XWQALY2LAJisnf9aK1sAR5kuACcQcP/ZiGH/3MYZ/rE1MQDeWIb/gA88AM/Aqf/AdNH/ak7TAcjVt/8HDHr+3ss8/yFux/77anUA5OEEAXg6B//dwVT+cIUbAL3Iyf+Lh5YA6jew/z0yQQCYbKn/3FUB/3CH4wCiGroAz2C5/vSIawBdmTIBxmGXAG4LVv+Pda7/c9TIAAXKtwDtpAr+ue8+AOx4Ev5ie2P/qMnC/i7q1gC/hTH/Y6l3AL67IwFzFS3/+YNIAHAGe//WMbX+pukiAFzFZv795M3/AzvJASpiLgDbJSP/qcMmAF58wQGcK98AX0iF/njOvwB6xe//sbtP//4uAgH6p74AVIETAMtxpv/5H73+SJ3K/9BHSf/PGEgAChASAdJRTP9Y0MD/fvNr/+6NeP/Heer/iQw7/yTce/+Uszz+8AwdAEIAYQEkHib/cwFd/2Bn5//FnjsBwKTwAMrKOf8YrjAAWU2bASpM1wD0l+kAFzBRAO9/NP7jgiX/+HRdAXyEdgCt/sABButT/26v5wH7HLYAgfld/lS4gABMtT4Ar4C6AGQ1iP5tHeIA3ek6ARRjSgAAFqAAhg0VAAk0N/8RWYwAryI7AFSld//g4ur/B0im/3tz/wES1vYA+gdHAdncuQDUI0z/Jn2vAL1h0gBy7iz/Kbyp/i26mgBRXBYAhKDBAHnQYv8NUSz/y5xSAEc6Ff/Qcr/+MiaTAJrYwwBlGRIAPPrX/+mE6/9nr44BEA5cAI0fbv7u8S3/mdnvAWGoL//5VRABHK8+/zn+NgDe534Api11/hK9YP/kTDIAyPReAMaYeAFEIkX/DEGg/mUTWgCnxXj/RDa5/ynavABxqDAAWGm9ARpSIP+5XaQB5PDt/0K2NQCrxVz/awnpAcd4kP9OMQr/bapp/1oEH/8c9HH/SjoLAD7c9v95msj+kNKy/345gQEr+g7/ZW8cAS9W8f89Rpb/NUkF/x4angDRGlYAiu1KAKRfvACOPB3+onT4/7uvoACXEhAA0W9B/suGJ/9YbDH/gxpH/90b1/5oaV3/H+wf/ocA0/+Pf24B1EnlAOlDp/7DAdD/hBHd/zPZWgBD6zL/39KPALM1ggHpasYA2a3c/3DlGP+vml3+R8v2/zBChf8DiOb/F91x/utv1QCqeF/++90CAC2Cnv5pXtn/8jS0/tVELf9oJhwA9J5MAKHIYP/PNQ3/u0OUAKo2+AB3orL/UxQLACoqwAGSn6P/t+hvAE3lFf9HNY8AG0wiAPaIL//bJ7b/XODJAROODv9FtvH/o3b1AAltagGqtff/Ti/u/1TSsP/Va4sAJyYLAEgVlgBIgkUAzU2b/o6FFQBHb6z+4io7/7MA1wEhgPEA6vwNAbhPCABuHkn/9o29AKrP2gFKmkX/ivYx/5sgZAB9Smn/WlU9/yPlsf8+fcH/mVa8AUl41ADRe/b+h9Em/5c6LAFcRdb/DgxY//yZpv/9z3D/PE5T/+N8bgC0YPz/NXUh/qTcUv8pARv/JqSm/6Rjqf49kEb/wKYSAGv6QgDFQTIAAbMS//9oAf8rmSP/UG+oAG6vqAApaS3/2w7N/6TpjP4rAXYA6UPDALJSn/+KV3r/1O5a/5AjfP4ZjKQA+9cs/oVGa/9l41D+XKk3ANcqMQBytFX/IegbAazVGQA+sHv+IIUY/+G/PgBdRpkAtSpoARa/4P/IyIz/+eolAJU5jQDDOND//oJG/yCt8P8d3McAbmRz/4Tl+QDk6d//JdjR/rKx0f+3LaX+4GFyAIlhqP/h3qwApQ0xAdLrzP/8BBz+RqCXAOi+NP5T+F3/PtdNAa+vs/+gMkIAeTDQAD+p0f8A0sgA4LssAUmiUgAJsI//E0zB/x07pwEYK5oAHL6+AI28gQDo68v/6gBt/zZBnwA8WOj/ef2W/vzpg//GbikBU01H/8gWO/5q/fL/FQzP/+1CvQBaxsoB4ax/ADUWygA45oQAAVa3AG2+KgDzRK4BbeSaAMixegEjoLf/sTBV/1raqf/4mE4Ayv5uAAY0KwCOYkH/P5EWAEZqXQDoimsBbrM9/9OB2gHy0VwAI1rZAbaPav90Zdn/cvrd/63MBgA8lqMASaws/+9uUP/tTJn+oYz5AJXo5QCFHyj/rqR3AHEz1gCB5AL+QCLzAGvj9P+uasj/VJlGATIjEAD6Stj+7L1C/5n5DQDmsgT/3SnuAHbjef9eV4z+/ndcAEnv9v51V4AAE9OR/7Eu/ADlW/YBRYD3/8pNNgEICwn/mWCmANnWrf+GwAIBAM8AAL2uawGMhmQAnsHzAbZmqwDrmjMAjgV7/zyoWQHZDlz/E9YFAdOn/gAsBsr+eBLs/w9xuP+434sAKLF3/rZ7Wv+wpbAA903CABvqeADnANb/OyceAH1jkf+WREQBjd74AJl70v9uf5j/5SHWAYfdxQCJYQIADI/M/1EpvABzT4L/XgOEAJivu/98jQr/fsCz/wtnxgCVBi0A21W7AeYSsv9ItpgAA8a4/4Bw4AFhoeYA/mMm/zqfxQCXQtsAO0WP/7lw+QB3iC//e4KEAKhHX/9xsCgB6LmtAM9ddQFEnWz/ZgWT/jFhIQBZQW/+9x6j/3zZ3QFm+tgAxq5L/jk3EgDjBewB5dWtAMlt2gEx6e8AHjeeARmyagCbb7wBXn6MANcf7gFN8BAA1fIZASZHqADNul3+MdOM/9sAtP+GdqUAoJOG/266I//G8yoA85J3AIbrowEE8Yf/wS7B/me0T//hBLj+8naCAJKHsAHqbx4ARULV/ilgewB5Xir/sr/D/y6CKgB1VAj/6THW/u56bQAGR1kB7NN7APQNMP53lA4AchxW/0vtGf+R5RD+gWQ1/4aWeP6onTIAF0ho/+AxDgD/exb/l7mX/6pQuAGGthQAKWRlAZkhEABMmm8BVs7q/8CgpP6le13/Adik/kMRr/+pCzv/nik9/0m8Dv/DBon/FpMd/xRnA//2guP/eiiAAOIvGP4jJCAAmLq3/0XKFADDhcMA3jP3AKmrXgG3AKD/QM0SAZxTD//FOvn++1lu/zIKWP4zK9gAYvLGAfWXcQCr7MIBxR/H/+VRJgEpOxQA/WjmAJhdDv/28pL+1qnw//BmbP6gp+wAmtq8AJbpyv8bE/oBAkeF/68MPwGRt8YAaHhz/4L79wAR1Kf/PnuE//dkvQCb35gAj8UhAJs7LP+WXfABfwNX/19HzwGnVQH/vJh0/woXFwCJw10BNmJhAPAAqP+UvH8AhmuXAEz9qwBahMAAkhY2AOBCNv7muuX/J7bEAJT7gv9Bg2z+gAGgAKkxp/7H/pT/+waDALv+gf9VUj4Ashc6//6EBQCk1ScAhvyS/iU1Uf+bhlIAzafu/14ttP+EKKEA/m9wATZL2QCz5t0B616//xfzMAHKkcv/J3Yq/3WN/QD+AN4AK/syADap6gFQRNAAlMvz/pEHhwAG/gAA/Ll/AGIIgf8mI0j/0yTcASgaWQCoQMX+A97v/wJT1/60n2kAOnPCALp0av/l99v/gXbBAMqutwGmoUgAyWuT/u2ISgDp5moBaW+oAEDgHgEB5QMAZpev/8Lu5P/++tQAu+15AEP7YAHFHgsAt1/MAM1ZigBA3SUB/98e/7Iw0//xyFr/p9Fg/zmC3QAucsj/PbhCADe2GP5utiEAq77o/3JeHwAS3QgAL+f+AP9wUwB2D9f/rRko/sDBH//uFZL/q8F2/2XqNf6D1HAAWcBrAQjQGwC12Q//55XoAIzsfgCQCcf/DE+1/pO2yv8Tbbb/MdThAEqjywCv6ZQAGnAzAMHBCf8Ph/kAluOCAMwA2wEY8s0A7tB1/xb0cAAa5SIAJVC8/yYtzv7wWuH/HQMv/yrgTAC686cAIIQP/wUzfQCLhxgABvHbAKzlhf/21jIA5wvP/79+UwG0o6r/9TgYAbKk0/8DEMoBYjl2/42DWf4hMxgA85Vb//00DgAjqUP+MR5Y/7MbJP+ljLcAOr2XAFgfAABLqUIAQmXH/xjYxwF5xBr/Dk/L/vDiUf9eHAr/U8Hw/8zBg/9eD1YA2iidADPB0QAA8rEAZrn3AJ5tdAAmh1sA36+VANxCAf9WPOgAGWAl/+F6ogHXu6j/np0uADirogDo8GUBehYJADMJFf81Ge7/2R7o/n2plAAN6GYAlAklAKVhjQHkgykA3g/z//4SEQAGPO0BagNxADuEvQBccB4AadDVADBUs/+7eef+G9ht/6Lda/5J78P/+h85/5WHWf+5F3MBA6Od/xJw+gAZObv/oWCkAC8Q8wAMjfv+Q+q4/ykSoQCvBmD/oKw0/hiwt//GwVUBfHmJ/5cycv/cyzz/z+8FAQAma/837l7+RpheANXcTQF4EUX/VaS+/8vqUQAmMSX+PZB8AIlOMf6o9zAAX6T8AGmphwD95IYAQKZLAFFJFP/P0goA6mqW/14iWv/+nzn+3IVjAIuTtP4YF7kAKTke/71hTABBu9//4Kwl/yI+XwHnkPAATWp+/kCYWwAdYpsA4vs1/+rTBf+Qy97/pLDd/gXnGACzes0AJAGG/31Gl/5h5PwArIEX/jBa0f+W4FIBVIYeAPHELgBncer/LmV5/ih8+v+HLfL+Cfmo/4xsg/+Po6sAMq3H/1jejv/IX54AjsCj/wd1hwBvfBYA7AxB/kQmQf/jrv4A9PUmAPAy0P+hP/oAPNHvAHojEwAOIeb+Ap9xAGoUf//kzWAAidKu/rTUkP9ZYpoBIliLAKeicAFBbsUA8SWpAEI4g/8KyVP+hf27/7FwLf7E+wAAxPqX/+7o1v+W0c0AHPB2AEdMUwHsY1sAKvqDAWASQP923iMAcdbL/3p3uP9CEyQAzED5AJJZiwCGPocBaOllALxUGgAx+YEA0NZL/8+CTf9zr+sAqwKJ/6+RugE39Yf/mla1AWQ69v9txzz/UsyG/9cx5gGM5cD/3sH7/1GID/+zlaL/Fycd/wdfS/6/Ud4A8VFa/2sxyf/0050A3oyV/0HbOP699lr/sjudATDbNABiItcAHBG7/6+pGABcT6H/7MjCAZOP6gDl4QcBxagOAOszNQH9eK4AxQao/8p1qwCjFc4AclVa/w8pCv/CE2MAQTfY/qKSdAAyztT/QJId/56egwFkpYL/rBeB/301Cf8PwRIBGjEL/7WuyQGHyQ7/ZBOVANtiTwAqY4/+YAAw/8X5U/5olU//626I/lKALP9BKST+WNMKALt5uwBihscAq7yz/tIL7v9Ce4L+NOo9ADBxF/4GVnj/d7L1AFeByQDyjdEAynJVAJQWoQBnwzAAGTGr/4pDggC2SXr+lBiCANPlmgAgm54AVGk9ALHCCf+mWVYBNlO7APkodf9tA9f/NZIsAT8vswDC2AP+DlSIAIixDf9I87r/dRF9/9M60/9dT98AWlj1/4vRb/9G3i8ACvZP/8bZsgDj4QsBTn6z/z4rfgBnlCMAgQil/vXwlAA9M44AUdCGAA+Jc//Td+z/n/X4/wKGiP/mizoBoKT+AHJVjf8xprb/kEZUAVW2BwAuNV0ACaah/zeisv8tuLwAkhws/qlaMQB4svEBDnt//wfxxwG9QjL/xo9l/r3zh/+NGBj+S2FXAHb7mgHtNpwAq5LP/4PE9v+IQHEBl+g5APDacwAxPRv/QIFJAfypG/8ohAoBWsnB//x58AG6zikAK8ZhAJFktwDM2FD+rJZBAPnlxP5oe0n/TWhg/oK0CABoezkA3Mrl/2b50wBWDuj/tk7RAO/hpABqDSD/eEkR/4ZD6QBT/rUAt+xwATBAg//x2PP/QcHiAM7xZP5khqb/7crFADcNUQAgfGb/KOSxAHa1HwHnoIb/d7vKAACOPP+AJr3/psmWAM94GgE2uKwADPLM/oVC5gAiJh8BuHBQACAzpf6/8zcAOkmS/punzf9kaJj/xf7P/60T9wDuCsoA75fyAF47J//wHWb/Clya/+VU2/+hgVAA0FrMAfDbrv+eZpEBNbJM/zRsqAFT3msA0yRtAHY6OAAIHRYA7aDHAKrRnQCJRy8Aj1YgAMbyAgDUMIgBXKy6AOaXaQFgv+UAilC//vDYgv9iKwb+qMQxAP0SWwGQSXkAPZInAT9oGP+4pXD+futiAFDVYv97PFf/Uoz1Ad94rf8PxoYBzjzvAOfqXP8h7hP/pXGOAbB3JgCgK6b+71tpAGs9wgEZBEQAD4szAKSEav8idC7+qF/FAInUFwBInDoAiXBF/pZpmv/syZ0AF9Sa/4hS4/7iO93/X5XAAFF2NP8hK9cBDpNL/1mcef4OEk8Ak9CLAZfaPv+cWAgB0rhi/xSve/9mU+UA3EF0AZb6BP9cjtz/IvdC/8zhs/6XUZcARyjs/4o/PgAGT/D/t7m1AHYyGwA/48AAe2M6ATLgm/8R4d/+3OBN/w4sewGNgK8A+NTIAJY7t/+TYR0Alsy1AP0lRwCRVXcAmsi6AAKA+f9TGHwADlePAKgz9QF8l+f/0PDFAXy+uQAwOvYAFOnoAH0SYv8N/h//9bGC/2yOIwCrffL+jAwi/6WhogDOzWUA9xkiAWSROQAnRjkAdszL//IAogCl9B4AxnTiAIBvmf+MNrYBPHoP/5s6OQE2MsYAq9Md/2uKp/+ta8f/baHBAFlI8v/Oc1n/+v6O/rHKXv9RWTIAB2lC/xn+//7LQBf/T95s/yf5SwDxfDIA75iFAN3xaQCTl2IA1aF5/vIxiQDpJfn+KrcbALh35v/ZIKP/0PvkAYk+g/9PQAn+XjBxABGKMv7B/xYA9xLFAUM3aAAQzV//MCVCADecPwFAUkr/yDVH/u9DfQAa4N4A34ld/x7gyv8J3IQAxibrAWaNVgA8K1EBiBwaAOkkCP7P8pQApKI/ADMu4P9yME//Ca/iAN4Dwf8voOj//11p/g4q5gAailIB0Cv0ABsnJv9i0H//QJW2/wX60QC7PBz+MRna/6l0zf93EngAnHST/4Q1bf8NCsoAblOnAJ3bif8GA4L/Mqce/zyfL/+BgJ3+XgO9AAOmRABT39cAllrCAQ+oQQDjUzP/zatC/za7PAGYZi3/d5rhAPD3iABkxbL/i0ff/8xSEAEpzir/nMDd/9h79P/a2rn/u7rv//ysoP/DNBYAkK61/rtkc//TTrD/GwfBAJPVaP9ayQr/UHtCARYhugABB2P+Hs4KAOXqBQA1HtIAigjc/kc3pwBI4VYBdr68AP7BZQGr+az/Xp63/l0CbP+wXUz/SWNP/0pAgf72LkEAY/F//vaXZv8sNdD+O2bqAJqvpP9Y8iAAbyYBAP+2vv9zsA/+qTyBAHrt8QBaTD8APkp4/3rDbgB3BLIA3vLSAIIhLv6cKCkAp5JwATGjb/95sOsATM8O/wMZxgEp69UAVSTWATFcbf/IGB7+qOzDAJEnfAHsw5UAWiS4/0NVqv8mIxr+g3xE/++bI/82yaQAxBZ1/zEPzQAY4B0BfnGQAHUVtgDLn40A34dNALDmsP++5df/YyW1/zMViv8ZvVn/MTCl/pgt9wCqbN4AUMoFABtFZ/7MFoH/tPw+/tIBW/+Sbv7/26IcAN/81QE7CCEAzhD0AIHTMABroNAAcDvRAG1N2P4iFbn/9mM4/7OLE/+5HTL/VFkTAEr6Yv/hKsj/wNnN/9IQpwBjhF8BK+Y5AP4Ly/9jvD//d8H7/lBpNgDotb0Bt0Vw/9Crpf8vbbT/e1OlAJKiNP+aCwT/l+Na/5KJYf496Sn/Xio3/2yk7ACYRP4ACoyD/wpqT/7znokAQ7JC/rF7xv8PPiIAxVgq/5Vfsf+YAMb/lf5x/+Fao/992fcAEhHgAIBCeP7AGQn/Mt3NADHURgDp/6QAAtEJAN002/6s4PT/XjjOAfKzAv8fW6QB5i6K/73m3AA5Lz3/bwudALFbmAAc5mIAYVd+AMZZkf+nT2sA+U2gAR3p5v+WFVb+PAvBAJclJP65lvP/5NRTAayXtADJqZsA9DzqAI7rBAFD2jwAwHFLAXTzz/9BrJsAUR6c/1BIIf4S523/jmsV/n0ahP+wEDv/lsk6AM6pyQDQeeIAKKwO/5Y9Xv84OZz/jTyR/y1slf/ukZv/0VUf/sAM0gBjYl3+mBCXAOG53ACN6yz/oKwV/kcaH/8NQF3+HDjGALE++AG2CPEApmWU/05Rhf+B3tcBvKmB/+gHYQAxcDz/2eX7AHdsigAnE3v+gzHrAIRUkQCC5pT/GUq7AAX1Nv+52/EBEsLk//HKZgBpccoAm+tPABUJsv+cAe8AyJQ9AHP30v8x3YcAOr0IASMuCQBRQQX/NJ65/310Lv9KjA3/0lys/pMXRwDZ4P3+c2y0/5E6MP7bsRj/nP88AZqT8gD9hlcANUvlADDD3v8frzL/nNJ4/9Aj3v8S+LMBAgpl/53C+P+ezGX/aP7F/08+BACyrGUBYJL7/0EKnAACiaX/dATnAPLXAQATIx3/K6FPADuV9gH7QrAAyCED/1Bujv/DoREB5DhC/3svkf6EBKQAQ66sABn9cgBXYVcB+txUAGBbyP8lfTsAE0F2AKE08f/trAb/sL///wFBgv7fvuYAZf3n/5IjbQD6HU0BMQATAHtamwEWViD/2tVBAG9dfwA8Xan/CH+2ABG6Dv79ifb/1Rkw/kzuAP/4XEb/Y+CLALgJ/wEHpNAAzYPGAVfWxwCC1l8A3ZXeABcmq/7FbtUAK3OM/texdgBgNEIBdZ7tAA5Atv8uP67/nl++/+HNsf8rBY7/rGPU//S7kwAdM5n/5HQY/h5lzwAT9pb/hucFAH2G4gFNQWIA7IIh/wVuPgBFbH//B3EWAJEUU/7Coef/g7U8ANnRsf/llNT+A4O4AHWxuwEcDh//sGZQADJUl/99Hzb/FZ2F/xOziwHg6BoAInWq/6f8q/9Jjc7+gfojAEhP7AHc5RT/Kcqt/2NM7v/GFuD/bMbD/ySNYAHsnjv/amRXAG7iAgDj6t4Aml13/0pwpP9DWwL/FZEh/2bWif+v5mf+o/amAF33dP6n4Bz/3AI5AavOVAB75BH/G3h3AHcLkwG0L+H/aMi5/qUCcgBNTtQALZqx/xjEef5SnbYAWhC+AQyTxQBf75j/C+tHAFaSd/+shtYAPIPEAKHhgQAfgnj+X8gzAGnn0v86CZT/K6jd/3ztjgDG0zL+LvVnAKT4VACYRtD/tHWxAEZPuQDzSiAAlZzPAMXEoQH1Ne8AD132/ovwMf/EWCT/oiZ7AIDInQGuTGf/raki/tgBq/9yMxEAiOTCAG6WOP5q9p8AE7hP/5ZN8P+bUKIAADWp/x2XVgBEXhAAXAdu/mJ1lf/5Teb//QqMANZ8XP4jdusAWTA5ARY1pgC4kD3/s//CANb4Pf47bvYAeRVR/qYD5ABqQBr/ReiG//LcNf4u3FUAcZX3/2GzZ/++fwsAh9G2AF80gQGqkM7/esjM/6hkkgA8kJX+RjwoAHo0sf/202X/ru0IAAczeAATH60Afu+c/4+9ywDEgFj/6YXi/x59rf/JbDIAe2Q7//6jAwHdlLX/1og5/t60if/PWDb/HCH7/0PWNAHS0GQAUapeAJEoNQDgb+f+Ixz0/+LHw/7uEeYA2dmk/qmd3QDaLqIBx8+j/2xzogEOYLv/djxMALifmADR50f+KqS6/7qZM/7dq7b/oo6tAOsvwQAHixABX6RA/xDdpgDbxRAAhB0s/2RFdf8861j+KFGtAEe+Pf+7WJ0A5wsXAO11pADhqN//mnJ0/6OY8gEYIKoAfWJx/qgTTAARndz+mzQFABNvof9HWvz/rW7wAArGef/9//D/QnvSAN3C1/55oxH/4QdjAL4xtgBzCYUB6BqK/9VEhAAsd3r/s2IzAJVaagBHMub/Cpl2/7FGGQClV80AN4rqAO4eYQBxm88AYpl/ACJr2/51cqz/TLT//vI5s//dIqz+OKIx/1MD//9x3b3/vBnk/hBYWf9HHMb+FhGV//N5/v9rymP/Cc4OAdwvmQBriScBYTHC/5Uzxf66Ogv/ayvoAcgGDv+1hUH+3eSr/3s+5wHj6rP/Ir3U/vS7+QC+DVABglkBAN+FrQAJ3sb/Qn9KAKfYXf+bqMYBQpEAAERmLgGsWpoA2IBL/6AoMwCeERsBfPAxAOzKsP+XfMD/JsG+AF+2PQCjk3z//6Uz/xwoEf7XYE4AVpHa/h8kyv9WCQUAbynI/+1sYQA5PiwAdbgPAS3xdACYAdz/naW8APoPgwE8LH3/Qdz7/0syuAA1WoD/51DC/4iBfwEVErv/LTqh/0eTIgCu+Qv+I40dAO9Esf9zbjoA7r6xAVf1pv++Mff/klO4/60OJ/+S12gAjt94AJXIm//Uz5EBELXZAK0gV///I7UAd9+hAcjfXv9GBrr/wENV/zKpmACQGnv/OPOz/hREiAAnjLz+/dAF/8hzhwErrOX/nGi7AJf7pwA0hxcAl5lIAJPFa/6UngX/7o/OAH6Zif9YmMX+B0SnAPyfpf/vTjb/GD83/ybeXgDttwz/zszSABMn9v4eSucAh2wdAbNzAAB1dnQBhAb8/5GBoQFpQ40AUiXi/+7i5P/M1oH+ontk/7l56gAtbOcAQgg4/4SIgACs4EL+r528AObf4v7y20UAuA53AVKiOAByexQAomdV/zHvY/6ch9cAb/+n/ifE1gCQJk8B+ah9AJthnP8XNNv/lhaQACyVpf8of7cAxE3p/3aB0v+qh+b/1nfGAOnwIwD9NAf/dWYw/xXMmv+ziLH/FwIDAZWCWf/8EZ8BRjwaAJBrEQC0vjz/OLY7/25HNv/GEoH/leBX/98VmP+KFrb/+pzNAOwt0P9PlPIBZUbRAGdOrgBlkKz/mIjtAb/CiABxUH0BmASNAJuWNf/EdPUA73JJ/hNSEf98fer/KDS/ACrSnv+bhKUAsgUqAUBcKP8kVU3/suR2AIlCYP5z4kIAbvBF/pdvUACnruz/42xr/7zyQf+3Uf8AOc61/y8itf/V8J4BR0tfAJwoGP9m0lEAq8fk/5oiKQDjr0sAFe/DAIrlXwFMwDEAdXtXAePhggB9Pj//AsarAP4kDf6Rus4AlP/0/yMApgAeltsBXOTUAFzGPP4+hcj/ySk7AH3ubf+0o+4BjHpSAAkWWP/FnS//mV45AFgetgBUoVUAspJ8AKamB/8V0N8AnLbyAJt5uQBTnK7+mhB2/7pT6AHfOnn/HRdYACN9f/+qBZX+pAyC/5vEHQChYIgAByMdAaIl+wADLvL/ANm8ADmu4gHO6QIAObuI/nu9Cf/JdX//uiTMAOcZ2ABQTmkAE4aB/5TLRACNUX3++KXI/9aQhwCXN6b/JutbABUumgDf/pb/I5m0/32wHQErYh7/2Hrm/+mgDAA5uQz+8HEH/wUJEP4aW2wAbcbLAAiTKACBhuT/fLoo/3JihP6mhBcAY0UsAAny7v+4NTsAhIFm/zQg8/6T38j/e1Oz/oeQyf+NJTgBlzzj/1pJnAHLrLsAUJcv/16J5/8kvzv/4dG1/0rX1f4GdrP/mTbBATIA5wBonUgBjOOa/7biEP5g4Vz/cxSq/gb6TgD4S63/NVkG/wC0dgBIrQEAQAjOAa6F3wC5PoX/1gtiAMUf0ACrp/T/Fue1AZbauQD3qWEBpYv3/y94lQFn+DMAPEUc/hmzxAB8B9r+OmtRALjpnP/8SiQAdrxDAI1fNf/eXqX+Lj01AM47c/8v7Pr/SgUgAYGa7v9qIOIAebs9/wOm8f5Dqqz/Hdiy/xfJ/AD9bvMAyH05AG3AYP80c+4AJnnz/8k4IQDCdoIAS2AZ/6oe5v4nP/0AJC36//sB7wCg1FwBLdHtAPMhV/7tVMn/1BKd/tRjf//ZYhD+i6zvAKjJgv+Pwan/7pfBAddoKQDvPaX+AgPyABbLsf6xzBYAlYHV/h8LKf8An3n+oBly/6JQyACdlwsAmoZOAdg2/AAwZ4UAadzFAP2oTf41sxcAGHnwAf8uYP9rPIf+Ys35/z/5d/94O9P/crQ3/ltV7QCV1E0BOEkxAFbGlgBd0aAARc22//RaKwAUJLAAenTdADOnJwHnAT//DcWGAAPRIv+HO8oAp2ROAC/fTAC5PD4AsqZ7AYQMof89risAw0WQAH8vvwEiLE4AOeo0Af8WKP/2XpIAU+SAADxO4P8AYNL/ma/sAJ8VSQC0c8T+g+FqAP+nhgCfCHD/eETC/7DExv92MKj/XakBAHDIZgFKGP4AE40E/o4+PwCDs7v/TZyb/3dWpACq0JL/0IWa/5SbOv+ieOj+/NWbAPENKgBeMoMAs6pwAIxTl/83d1QBjCPv/5ktQwHsrycANpdn/54qQf/E74f+VjXLAJVhL/7YIxH/RgNGAWckWv8oGq0AuDANAKPb2f9RBgH/3aps/unQXQBkyfn+ViQj/9GaHgHjyfv/Ar2n/mQ5AwANgCkAxWRLAJbM6/+RrjsAePiV/1U34QBy0jX+x8x3AA73SgE/+4EAQ2iXAYeCUABPWTf/dead/xlgjwDVkQUARfF4AZXzX/9yKhQAg0gCAJo1FP9JPm0AxGaYACkMzP96JgsB+gqRAM99lAD29N7/KSBVAXDVfgCi+VYBR8Z//1EJFQFiJwT/zEctAUtviQDqO+cAIDBf/8wfcgEdxLX/M/Gn/l1tjgBokC0A6wy1/zRwpABM/sr/rg6iAD3rk/8rQLn+6X3ZAPNYp/5KMQgAnMxCAHzWewAm3XYBknDsAHJisQCXWccAV8VwALmVoQAsYKUA+LMU/7zb2P4oPg0A846NAOXjzv+syiP/dbDh/1JuJgEq9Q7/FFNhADGrCgDyd3gAGeg9ANTwk/8Eczj/kRHv/soR+//5EvX/Y3XvALgEs//27TP/Je+J/6Zwpv9RvCH/ufqO/za7rQDQcMkA9ivkAWi4WP/UNMT/M3Vs//51mwAuWw//Vw6Q/1fjzABTGlMBn0zjAJ8b1QEYl2wAdZCz/onRUgAmnwoAc4XJAN+2nAFuxF3/OTzpAAWnaf+axaQAYCK6/5OFJQHcY74AAadU/xSRqwDCxfv+X06F//z48//hXYP/u4bE/9iZqgAUdp7+jAF2AFaeDwEt0yn/kwFk/nF0TP/Tf2wBZw8wAMEQZgFFM1//a4CdAImr6QBafJABaqG2AK9M7AHIjaz/ozpoAOm0NP/w/Q7/onH+/ybviv40LqYA8WUh/oO6nABv0D7/fF6g/x+s/gBwrjj/vGMb/0OK+wB9OoABnJiu/7IM9//8VJ4AUsUO/qzIU/8lJy4Bas+nABi9IgCDspAAztUEAKHi0gBIM2n/YS27/0643/+wHfsAT6BW/3QlsgBSTdUBUlSN/+Jl1AGvWMf/9V73Aax2bf+mub4Ag7V4AFf+Xf+G8En/IPWP/4uiZ/+zYhL+2cxwAJPfeP81CvMApoyWAH1QyP8Obdv/W9oB//z8L/5tnHT/czF/AcxX0/+Uytn/GlX5/w71hgFMWan/8i3mADtirP9ySYT+Tpsx/55+VAAxryv/ELZU/51nIwBowW3/Q92aAMmsAf4IolgApQEd/32b5f8emtwBZ+9cANwBbf/KxgEAXgKOASQ2LADr4p7/qvvW/7lNCQBhSvIA26OV//Ajdv/fclj+wMcDAGolGP/JoXb/YVljAeA6Z/9lx5P+3jxjAOoZOwE0hxsAZgNb/qjY6wDl6IgAaDyBAC6o7gAnv0MAS6MvAI9hYv842KgBqOn8/yNvFv9cVCsAGshXAVv9mADKOEYAjghNAFAKrwH8x0wAFm5S/4EBwgALgD0BVw6R//3evgEPSK4AVaNW/jpjLP8tGLz+Gs0PABPl0v74Q8MAY0e4AJrHJf+X83n/JjNL/8lVgv4sQfoAOZPz/pIrO/9ZHDUAIVQY/7MzEv69RlMAC5yzAWKGdwCeb28Ad5pJ/8g/jP4tDQ3/msAC/lFIKgAuoLn+LHAGAJLXlQEasGgARBxXAewymf+zgPr+zsG//6Zcif41KO8A0gHM/qitIwCN8y0BJDJt/w/ywv/jn3r/sK/K/kY5SAAo3zgA0KI6/7diXQAPbwwAHghM/4R/9v8t8mcARbUP/wrRHgADs3kA8ejaAXvHWP8C0soBvIJR/15l0AFnJC0ATMEYAV8a8f+lorsAJHKMAMpCBf8lOJMAmAvzAX9V6P/6h9QBubFxAFrcS/9F+JIAMm8yAFwWUAD0JHP+o2RS/xnBBgF/PSQA/UMe/kHsqv+hEdf+P6+MADd/BABPcOkAbaAoAI9TB/9BGu7/2amM/05evf8Ak77/k0e6/mpNf//pnekBh1ft/9AN7AGbbST/tGTaALSjEgC+bgkBET97/7OItP+le3v/kLxR/kfwbP8ZcAv/49oz/6cy6v9yT2z/HxNz/7fwYwDjV4//SNn4/2apXwGBlZUA7oUMAePMIwDQcxoBZgjqAHBYjwGQ+Q4A8J6s/mRwdwDCjZn+KDhT/3mwLgAqNUz/nr+aAFvRXACtDRABBUji/8z+lQBQuM8AZAl6/nZlq//8ywD+oM82ADhI+QE4jA3/CkBr/ltlNP/htfgBi/+EAOaREQDpOBcAdwHx/9Wpl/9jYwn+uQ+//61nbQGuDfv/slgH/hs7RP8KIQL/+GE7ABoekgGwkwoAX3nPAbxYGAC5Xv7+czfJABgyRgB4NQYAjkKSAOTi+f9owN4BrUTbAKK4JP+PZon/nQsXAH0tYgDrXeH+OHCg/0Z08wGZ+Tf/gScRAfFQ9ABXRRUBXuRJ/05CQf/C4+cAPZJX/62bF/9wdNv+2CYL/4O6hQBe1LsAZC9bAMz+r//eEtf+rURs/+PkT/8m3dUAo+OW/h++EgCgswsBClpe/9yuWACj0+X/x4g0AIJf3f+MvOf+i3GA/3Wr7P4x3BT/OxSr/+RtvAAU4SD+wxCuAOP+iAGHJ2kAlk3O/9Lu4gA31IT+7zl8AKrCXf/5EPf/GJc+/wqXCgBPi7L/ePLKABrb1QA+fSP/kAJs/+YhU/9RLdgB4D4RANbZfQBimZn/s7Bq/oNdiv9tPiT/snkg/3j8RgDc+CUAzFhnAYDc+//s4wcBajHG/zw4awBjcu4A3MxeAUm7AQBZmiIATtml/w7D+f8J5v3/zYf1ABr8B/9UzRsBhgJwACWeIADnW+3/v6rM/5gH3gBtwDEAwaaS/+gTtf9pjjT/ZxAbAf3IpQDD2QT/NL2Q/3uboP5Xgjb/Tng9/w44KQAZKX3/V6j1ANalRgDUqQb/29PC/khdpP/FIWf/K46NAIPhrAD0aRwAREThAIhUDf+COSj+i004AFSWNQA2X50AkA2x/l9zugB1F3b/9Kbx/wu6hwCyasv/YdpdACv9LQCkmAQAi3bvAGABGP7rmdP/qG4U/zLvsAByKegAwfo1AP6gb/6Iein/YWxDANeYF/+M0dQAKr2jAMoqMv9qar3/vkTZ/+k6dQDl3PMBxQMEACV4Nv4EnIb/JD2r/qWIZP/U6A4AWq4KANjGQf8MA0AAdHFz//hnCADnfRL/oBzFAB64IwHfSfn/exQu/oc4Jf+tDeUBd6Ei//U9SQDNfXAAiWiGANn2Hv/tjo8AQZ9m/2ykvgDbda3/IiV4/shFUAAffNr+Shug/7qax/9Hx/wAaFGfARHIJwDTPcABGu5bAJTZDAA7W9X/C1G3/4Hmev9yy5EBd7RC/0iKtADglWoAd1Jo/9CMKwBiCbb/zWWG/xJlJgBfxab/y/GTAD7Qkf+F9vsAAqkOAA33uACOB/4AJMgX/1jN3wBbgTT/FboeAI/k0gH36vj/5kUf/rC6h//uzTQBi08rABGw2f4g80MA8m/pACwjCf/jclEBBEcM/yZpvwAHdTL/UU8QAD9EQf+dJG7/TfED/+It+wGOGc4AeHvRARz+7v8FgH7/W97X/6IPvwBW8EkAh7lR/izxowDU29L/cKKbAM9ldgCoSDj/xAU0AEis8v9+Fp3/kmA7/6J5mP6MEF8Aw/7I/lKWogB3K5H+zKxO/6bgnwBoE+3/9X7Q/+I71QB12cUAmEjtANwfF/4OWuf/vNRAATxl9v9VGFYAAbFtAJJTIAFLtsAAd/HgALntG/+4ZVIB6yVN//2GEwDo9noAPGqzAMMLDABtQusBfXE7AD0opACvaPAAAi+7/zIMjQDCi7X/h/poAGFc3v/Zlcn/y/F2/0+XQwB6jtr/lfXvAIoqyP5QJWH/fHCn/ySKV/+CHZP/8VdO/8xhEwGx0Rb/9+N//mN3U//UGcYBELOzAJFNrP5ZmQ7/2r2nAGvpO/8jIfP+LHBw/6F/TwHMrwoAKBWK/mh05ADHX4n/hb6o/5Kl6gG3YycAt9w2/v/ehQCi23n+P+8GAOFmNv/7EvYABCKBAYckgwDOMjsBD2G3AKvYh/9lmCv/lvtbACaRXwAizCb+soxT/xmB8/9MkCUAaiQa/naQrP9EuuX/a6HV/y6jRP+Vqv0AuxEPANqgpf+rI/YBYA0TAKXLdQDWa8D/9HuxAWQDaACy8mH/+0yC/9NNKgH6T0b/P/RQAWll9gA9iDoB7lvVAA47Yv+nVE0AEYQu/jmvxf+5PrgATEDPAKyv0P6vSiUAihvT/pR9wgAKWVEAqMtl/yvV0QHr9TYAHiPi/wl+RgDifV7+nHUU/zn4cAHmMED/pFymAeDW5v8keI8ANwgr//sB9QFqYqUASmtq/jUENv9aspYBA3h7//QFWQFy+j3//plSAU0PEQA57loBX9/mAOw0L/5nlKT/ec8kARIQuf9LFEoAuwtlAC4wgf8W79L/TeyB/29NzP89SGH/x9n7/yrXzACFkcn/OeaSAetkxgCSSSP+bMYU/7ZP0v9SZ4gA9mywACIRPP8TSnL+qKpO/53vFP+VKagAOnkcAE+zhv/neYf/rtFi//N6vgCrps0A1HQwAB1sQv+i3rYBDncVANUn+f/+3+T/t6XGAIW+MAB80G3/d69V/wnReQEwq73/w0eGAYjbM/+2W43+MZ9IACN29f9wuuP/O4kfAIksowByZzz+CNWWAKIKcf/CaEgA3IN0/7JPXADL+tX+XcG9/4L/Iv7UvJcAiBEU/xRlU//UzqYA5e5J/5dKA/+oV9cAm7yF/6aBSQDwT4X/stNR/8tIo/7BqKUADqTH/h7/zABBSFsBpkpm/8gqAP/CceP/QhfQAOXYZP8Y7xoACuk+/3sKsgEaJK7/d9vHAS2jvgAQqCoApjnG/xwaGgB+pecA+2xk/z3lef86dooATM8RAA0icP5ZEKgAJdBp/yPJ1/8oamX+Bu9yAChn4v72f27/P6c6AITwjgAFnlj/gUme/15ZkgDmNpIACC2tAE+pAQBzuvcAVECDAEPg/f/PvUAAmhxRAS24Nv9X1OD/AGBJ/4Eh6wE0QlD/+66b/wSzJQDqpF3+Xa/9AMZFV//gai4AYx3SAD68cv8s6ggAqa/3/xdtif/lticAwKVe/vVl2QC/WGAAxF5j/2ruC/41fvMAXgFl/y6TAgDJfHz/jQzaAA2mnQEw++3/m/p8/2qUkv+2DcoAHD2nANmYCP7cgi3/yOb/ATdBV/9dv2H+cvsOACBpXAEaz40AGM8N/hUyMP+6lHT/0yvhACUiov6k0ir/RBdg/7bWCP/1dYn/QsMyAEsMU/5QjKQACaUkAeRu4wDxEVoBGTTUAAbfDP+L8zkADHFLAfa3v//Vv0X/5g+OAAHDxP+Kqy//QD9qARCp1v/PrjgBWEmF/7aFjACxDhn/k7g1/wrjof942PT/SU3pAJ3uiwE7QekARvvYASm4mf8gy3AAkpP9AFdlbQEsUoX/9JY1/16Y6P87XSf/WJPc/05RDQEgL/z/oBNy/11rJ/92ENMBuXfR/+Pbf/5Yaez/om4X/ySmbv9b7N3/Qup0AG8T9P4K6RoAILcG/gK/8gDanDX+KTxG/6jsbwB5uX7/7o7P/zd+NADcgdD+UMyk/0MXkP7aKGz/f8qkAMshA/8CngAAJWC8/8AxSgBtBAAAb6cK/lvah//LQq3/lsLiAMn9Bv+uZnkAzb9uADXCBABRKC3+I2aP/wxsxv8QG+j//Ee6AbBucgCOA3UBcU2OABOcxQFcL/wANegWATYS6wAuI73/7NSBAAJg0P7I7sf/O6+k/5Ir5wDC2TT/A98MAIo2sv5V688A6M8iADE0Mv+mcVn/Ci3Y/z6tHABvpfYAdnNb/4BUPACnkMsAVw3zABYe5AGxcZL/garm/vyZgf+R4SsARucF/3ppfv5W9pT/biWa/tEDWwBEkT4A5BCl/zfd+f6y0lsAU5Li/kWSugBd0mj+EBmtAOe6JgC9eoz/+w1w/2luXQD7SKoAwBff/xgDygHhXeQAmZPH/m2qFgD4Zfb/snwM/7L+Zv43BEEAfda0ALdgkwAtdRf+hL/5AI+wy/6Itzb/kuqxAJJlVv8se48BIdGYAMBaKf5TD33/1axSANepkAAQDSIAINFk/1QS+QHFEez/2brmADGgsP9vdmH/7WjrAE87XP5F+Qv/I6xKARN2RADefKX/tEIj/1au9gArSm//fpBW/+TqWwDy1Rj+RSzr/9y0IwAI+Af/Zi9c//DNZv9x5qsBH7nJ/8L2Rv96EbsAhkbH/5UDlv91P2cAQWh7/9Q2EwEGjVgAU4bz/4g1ZwCpG7QAsTEYAG82pwDDPdf/HwFsATwqRgC5A6L/wpUo//Z/Jv6+dyb/PXcIAWCh2/8qy90BsfKk//WfCgB0xAAABV3N/oB/swB97fb/laLZ/1clFP6M7sAACQnBAGEB4gAdJgoAAIg//+VI0v4mhlz/TtrQAWgkVP8MBcH/8q89/7+pLgGzk5P/cb6L/n2sHwADS/z+1yQPAMEbGAH/RZX/boF2AMtd+QCKiUD+JkYGAJl03gChSnsAwWNP/3Y7Xv89DCsBkrGdAC6TvwAQ/yYACzMfATw6Yv9vwk0Bmlv0AIwokAGtCvsAy9Ey/myCTgDktFoArgf6AB+uPAApqx4AdGNS/3bBi/+7rcb+2m84ALl72AD5njQANLRd/8kJW/84Lab+hJvL/zrobgA001n//QCiAQlXtwCRiCwBXnr1AFW8qwGTXMYAAAhoAB5frgDd5jQB9/fr/4muNf8jFcz/R+PWAehSwgALMOP/qkm4/8b7/P4scCIAg2WD/0iouwCEh33/imhh/+64qP/zaFT/h9ji/4uQ7QC8iZYBUDiM/1app//CThn/3BG0/xENwQB1idT/jeCXADH0rwDBY6//E2OaAf9BPv+c0jf/8vQD//oOlQCeWNn/nc+G/vvoHAAunPv/qzi4/+8z6gCOioP/Gf7zAQrJwgA/YUsA0u+iAMDIHwF11vMAGEfe/jYo6P9Mt2/+kA5X/9ZPiP/YxNQAhBuM/oMF/QB8bBP/HNdLAEzeN/7ptj8ARKu//jRv3v8KaU3/UKrrAI8YWP8t53kAlIHgAT32VAD9Ltv/70whADGUEv7mJUUAQ4YW/o6bXgAfndP+1Soe/wTk9/78sA3/JwAf/vH0//+qLQr+/d75AN5yhAD/Lwb/tKOzAVRel/9Z0VL+5TSp/9XsAAHWOOT/h3eX/3DJwQBToDX+BpdCABKiEQDpYVsAgwVOAbV4Nf91Xz//7XW5AL9+iP+Qd+kAtzlhAS/Ju/+npXcBLWR+ABViBv6Rll//eDaYANFiaACPbx7+uJT5AOvYLgD4ypT/OV8WAPLhowDp9+j/R6sT/2f0Mf9UZ13/RHn0AVLgDQApTyv/+c6n/9c0Ff7AIBb/9288AGVKJv8WW1T+HRwN/8bn1/70msgA34ntANOEDgBfQM7/ET73/+mDeQFdF00Azcw0/lG9iAC024oBjxJeAMwrjP68r9sAb2KP/5c/ov/TMkf+E5I1AJItU/6yUu7/EIVU/+LGXf/JYRT/eHYj/3Iy5/+i5Zz/0xoMAHInc//O1IYAxdmg/3SBXv7H19v/S9/5Af10tf/o12j/5IL2/7l1VgAOBQgA7x09Ae1Xhf99kon+zKjfAC6o9QCaaRYA3NSh/2tFGP+J2rX/8VTG/4J60/+NCJn/vrF2AGBZsgD/EDD+emBp/3U26P8ifmn/zEOmAOg0iv/TkwwAGTYHACwP1/4z7C0AvkSBAWqT4QAcXS3+7I0P/xE9oQDcc8AA7JEY/m+oqQDgOj//f6S8AFLqSwHgnoYA0URuAdmm2QBG4aYBu8GP/xAHWP8KzYwAdcCcARE4JgAbfGwBq9c3/1/91ACbh6j/9rKZ/ppESgDoPWD+aYQ7ACFMxwG9sIL/CWgZ/kvGZv/pAXAAbNwU/3LmRgCMwoX/OZ6k/pIGUP+pxGEBVbeCAEae3gE77er/YBka/+ivYf8Lefj+WCPCANu0/P5KCOMAw+NJAbhuof8x6aQBgDUvAFIOef/BvjoAMK51/4QXIAAoCoYBFjMZ//ALsP9uOZIAdY/vAZ1ldv82VEwAzbgS/y8ESP9OcFX/wTJCAV0QNP8IaYYADG1I/zqc+wCQI8wALKB1/jJrwgABRKX/b26iAJ5TKP5M1uoAOtjN/6tgk/8o43IBsOPxAEb5twGIVIv/PHr3/o8Jdf+xron+SfePAOy5fv8+Gff/LUA4/6H0BgAiOTgBacpTAICT0AAGZwr/SopB/2FQZP/WriH/MoZK/26Xgv5vVKwAVMdL/vg7cP8I2LIBCbdfAO4bCP6qzdwAw+WHAGJM7f/iWxoBUtsn/+G+xwHZyHn/UbMI/4xBzgCyz1f++vwu/2hZbgH9vZ7/kNae/6D1Nv81t1wBFcjC/5IhcQHRAf8A62or/6c06ACd5d0AMx4ZAPrdGwFBk1f/T3vEAEHE3/9MLBEBVfFEAMq3+f9B1NT/CSGaAUc7UACvwjv/jUgJAGSg9ADm0DgAOxlL/lDCwgASA8j+oJ9zAISP9wFvXTn/Ou0LAYbeh/96o2wBeyu+//u9zv5Qtkj/0PbgARE8CQChzyYAjW1bANgP0/+ITm4AYqNo/xVQef+tsrcBf48EAGg8Uv7WEA3/YO4hAZ6U5v9/gT7/M//S/z6N7P6dN+D/cif0AMC8+v/kTDUAYlRR/63LPf6TMjf/zOu/ADTF9ABYK9P+G793ALznmgBCUaEAXMGgAfrjeAB7N+IAuBFIAIWoCv4Wh5z/KRln/zDKOgC6lVH/vIbvAOu1vf7Zi7z/SjBSAC7a5QC9/fsAMuUM/9ONvwGA9Bn/qed6/lYvvf+Etxf/JbKW/zOJ/QDITh8AFmkyAII8AACEo1v+F+e7AMBP7wCdZqT/wFIUARi1Z//wCeoAAXuk/4XpAP/K8vIAPLr1APEQx//gdJ7+v31b/+BWzwB5Jef/4wnG/w+Z7/956Nn+S3BSAF8MOf4z1mn/lNxhAcdiJACc0Qz+CtQ0ANm0N/7Uquj/2BRU/536hwCdY3/+Ac4pAJUkRgE2xMn/V3QA/uurlgAbo+oAyoe0ANBfAP57nF0Atz5LAInrtgDM4f//1ovS/wJzCP8dDG8ANJwBAP0V+/8lpR/+DILTAGoSNf4qY5oADtk9/tgLXP/IxXD+kybHACT8eP5rqU0AAXuf/89LZgCjr8QALAHwAHi6sP4NYkz/7Xzx/+iSvP/IYOAAzB8pANDIDQAV4WD/r5zEAPfQfgA+uPT+AqtRAFVzngA2QC3/E4pyAIdHzQDjL5MB2udCAP3RHAD0D63/Bg92/hCW0P+5FjL/VnDP/0tx1wE/kiv/BOET/uMXPv8O/9b+LQjN/1fFl/7SUtf/9fj3/4D4RgDh91cAWnhGANX1XAANheIAL7UFAVyjaf8GHoX+6LI9/+aVGP8SMZ4A5GQ9/nTz+/9NS1wBUduT/0yj/v6N1fYA6CWY/mEsZADJJTIB1PQ5AK6rt//5SnAAppweAN7dYf/zXUn++2Vk/9jZXf/+irv/jr40/zvLsf/IXjQAc3Ke/6WYaAF+Y+L/dp30AWvIEADBWuUAeQZYAJwgXf598dP/Du2d/6WaFf+44Bb/+hiY/3FNHwD3qxf/7bHM/zSJkf/CtnIA4OqVAApvZwHJgQQA7o5OADQGKP9u1aX+PM/9AD7XRQBgYQD/MS3KAHh5Fv/rizABxi0i/7YyGwGD0lv/LjaAAK97af/GjU7+Q/Tv//U2Z/5OJvL/Alz5/vuuV/+LP5AAGGwb/yJmEgEiFpgAQuV2/jKPYwCQqZUBdh6YALIIeQEInxIAWmXm/4EddwBEJAsB6Lc3ABf/YP+hKcH/P4veAA+z8wD/ZA//UjWHAIk5lQFj8Kr/Fubk/jG0Uv89UisAbvXZAMd9PQAu/TQAjcXbANOfwQA3eWn+txSBAKl3qv/Lsov/hyi2/6wNyv9BspQACM8rAHo1fwFKoTAA49aA/lYL8/9kVgcB9USG/z0rFQGYVF7/vjz6/u926P/WiCUBcUxr/11oZAGQzhf/bpaaAeRnuQDaMTL+h02L/7kBTgAAoZT/YR3p/8+Ulf+gqAAAW4Cr/wYcE/4Lb/cAJ7uW/4rolQB1PkT/P9i8/+vqIP4dOaD/GQzxAak8vwAgg43/7Z97/17FXv50/gP/XLNh/nlhXP+qcA4AFZX4APjjAwBQYG0AS8BKAQxa4v+hakQB0HJ//3Iq//5KGkr/97OW/nmMPACTRsj/1iih/6G8yf+NQYf/8nP8AD4vygC0lf/+gjftAKURuv8KqcIAnG3a/3CMe/9ogN/+sY5s/3kl2/+ATRL/b2wXAVvASwCu9Rb/BOw+/ytAmQHjrf4A7XqEAX9Zuv+OUoD+/FSuAFqzsQHz1lf/Zzyi/9CCDv8LgosAzoHb/17Znf/v5ub/dHOf/qRrXwAz2gIB2H3G/4zKgP4LX0T/Nwld/q6ZBv/MrGAARaBuANUmMf4bUNUAdn1yAEZGQ/8Pjkn/g3q5//MUMv6C7SgA0p+MAcWXQf9UmUIAw35aABDu7AF2u2b/AxiF/7tF5gA4xVwB1UVe/1CK5QHOB+YA3m/mAVvpd/8JWQcBAmIBAJRKhf8z9rT/5LFwATq9bP/Cy+3+FdHDAJMKIwFWneIAH6OL/jgHS/8+WnQAtTypAIqi1P5Rpx8AzVpw/yFw4wBTl3UBseBJ/66Q2f/mzE//Fk3o/3JO6gDgOX7+CTGNAPKTpQFotoz/p4QMAXtEfwDhVycB+2wIAMbBjwF5h8//rBZGADJEdP9lryj/+GnpAKbLBwBuxdoA1/4a/qji/QAfj2AAC2cpALeBy/5k90r/1X6EANKTLADH6hsBlC+1AJtbngE2aa//Ak6R/maaXwCAz3/+NHzs/4JURwDd89MAmKrPAN5qxwC3VF7+XMg4/4q2cwGOYJIAhYjkAGESlgA3+0IAjGYEAMpnlwAeE/j/M7jPAMrGWQA3xeH+qV/5/0JBRP+86n4Apt9kAXDv9ACQF8IAOie2APQsGP6vRLP/mHaaAbCiggDZcsz+rX5O/yHeHv8kAlv/Ao/zAAnr1wADq5cBGNf1/6gvpP7xks8ARYG0AETzcQCQNUj++y0OABduqABERE//bkZf/q5bkP8hzl//iSkH/xO7mf4j/3D/CZG5/jKdJQALcDEBZgi+/+rzqQE8VRcASie9AHQx7wCt1dIALqFs/5+WJQDEeLn/ImIG/5nDPv9h5kf/Zj1MABrU7P+kYRAAxjuSAKMXxAA4GD0AtWLBAPuT5f9ivRj/LjbO/+pS9gC3ZyYBbT7MAArw4ACSFnX/jpp4AEXUIwDQY3YBef8D/0gGwgB1EcX/fQ8XAJpPmQDWXsX/uTeT/z7+Tv5/UpkAbmY//2xSof9pu9QBUIonADz/Xf9IDLoA0vsfAb6nkP/kLBP+gEPoANb5a/6IkVb/hC6wAL274//QFowA2dN0ADJRuv6L+h8AHkDGAYebZACgzhf+u6LT/xC8PwD+0DEAVVS/APHA8v+ZfpEB6qKi/+Zh2AFAh34AvpTfATQAK/8cJ70BQIjuAK/EuQBi4tX/f5/0AeKvPACg6Y4BtPPP/0WYWQEfZRUAkBmk/ou/0QBbGXkAIJMFACe6e/8/c+b/XafG/4/V3P+znBP/GUJ6ANag2f8CLT7/ak+S/jOJY/9XZOf/r5Ho/2W4Af+uCX0AUiWhASRyjf8w3o7/9bqaAAWu3f4/cpv/hzegAVAfhwB++rMB7NotABQckQEQk0kA+b2EARG9wP/fjsb/SBQP//o17f4PCxIAG9Nx/tVrOP+uk5L/YH4wABfBbQElol4Ax535/hiAu//NMbL+XaQq/yt36wFYt+3/2tIB/2v+KgDmCmP/ogDiANvtWwCBsssA0DJf/s7QX//3v1n+bupP/6U98wAUenD/9va5/mcEewDpY+YB21v8/8feFv+z9en/0/HqAG/6wP9VVIgAZToy/4OtnP53LTP/dukQ/vJa1gBen9sBAwPq/2JMXP5QNuYABeTn/jUY3/9xOHYBFIQB/6vS7AA48Z7/unMT/wjlrgAwLAABcnKm/wZJ4v/NWfQAieNLAfitOABKePb+dwML/1F4xv+IemL/kvHdAW3CTv/f8UYB1sip/2G+L/8vZ67/Y1xI/nbptP/BI+n+GuUg/978xgDMK0f/x1SsAIZmvgBv7mH+5ijmAOPNQP7IDOEAphneAHFFM/+PnxgAp7hKAB3gdP6e0OkAwXR+/9QLhf8WOowBzCQz/+geKwDrRrX/QDiS/qkSVP/iAQ3/yDKw/zTV9f6o0WEAv0c3ACJOnADokDoBuUq9ALqOlf5ARX//ocuT/7CXvwCI58v+o7aJAKF++/7pIEIARM9CAB4cJQBdcmAB/lz3/yyrRQDKdwv/vHYyAf9TiP9HUhoARuMCACDreQG1KZoAR4bl/sr/JAApmAUAmj9J/yK2fAB53Zb/GszVASmsVwBanZL/bYIUAEdryP/zZr0AAcOR/i5YdQAIzuMAv279/22AFP6GVTP/ibFwAdgiFv+DEND/eZWqAHITFwGmUB//cfB6AOiz+gBEbrT+0qp3AN9spP/PT+n/G+Xi/tFiUf9PRAcAg7lkAKodov8Romv/ORULAWTItf9/QaYBpYbMAGinqAABpE8Akoc7AUYygP9mdw3+4waHAKKOs/+gZN4AG+DbAZ5dw//qjYkAEBh9/+7OL/9hEWL/dG4M/2BzTQBb4+j/+P5P/1zlBv5YxosAzkuBAPpNzv+N9HsBikXcACCXBgGDpxb/7USn/se9lgCjq4r/M7wG/18dif6U4rMAtWvQ/4YfUv+XZS3/gcrhAOBIkwAwipf/w0DO/u3angBqHYn+/b3p/2cPEf/CYf8Asi2p/sbhmwAnMHX/h2pzAGEmtQCWL0H/U4Ll/vYmgQBc75r+W2N/AKFvIf/u2fL/g7nD/9W/nv8pltoAhKmDAFlU/AGrRoD/o/jL/gEytP98TFUB+29QAGNC7/+a7bb/3X6F/krMY/9Bk3f/Yzin/0/4lf90m+T/7SsO/kWJC/8W+vEBW3qP/8358wDUGjz/MLawATAXv//LeZj+LUrV/z5aEv71o+b/uWp0/1MjnwAMIQL/UCI+ABBXrv+tZVUAyiRR/qBFzP9A4bsAOs5eAFaQLwDlVvUAP5G+ASUFJwBt+xoAiZPqAKJ5kf+QdM7/xei5/7e+jP9JDP7/ixTy/6pa7/9hQrv/9bWH/t6INAD1BTP+yy9OAJhl2ABJF30A/mAhAevSSf8r0VgBB4FtAHpo5P6q8ssA8syH/8oc6f9BBn8An5BHAGSMXwBOlg0A+2t2AbY6ff8BJmz/jb3R/wibfQFxo1v/eU++/4bvbP9ML/gAo+TvABFvCgBYlUv/1+vvAKefGP8vl2z/a9G8AOnnY/4cypT/riOK/24YRP8CRbUAa2ZSAGbtBwBcJO3/3aJTATfKBv+H6of/GPreAEFeqP71+NL/p2zJ/v+hbwDNCP4AiA10AGSwhP8r137/sYWC/55PlABD4CUBDM4V/z4ibgHtaK//UIRv/46uSABU5bT+abOMAED4D//pihAA9UN7/tp51P8/X9oB1YWJ/4+2Uv8wHAsA9HKNAdGvTP+dtZb/uuUD/6SdbwHnvYsAd8q+/9pqQP9E6z/+YBqs/7svCwHXEvv/UVRZAEQ6gABecQUBXIHQ/2EPU/4JHLwA7wmkADzNmADAo2L/uBI8ANm2iwBtO3j/BMD7AKnS8P8lrFz+lNP1/7NBNAD9DXMAua7OAXK8lf/tWq0AK8fA/1hscQA0I0wAQhmU/90EB/+X8XL/vtHoAGIyxwCXltX/EkokATUoBwATh0H/GqxFAK7tVQBjXykAAzgQACegsf/Iatr+uURU/1u6Pf5Dj43/DfSm/2NyxgDHbqP/wRK6AHzv9gFuRBYAAusuAdQ8awBpKmkBDuaYAAcFgwCNaJr/1QMGAIPkov+zZBwB53tV/84O3wH9YOYAJpiVAWKJegDWzQP/4piz/waFiQCeRYz/caKa/7TzrP8bvXP/jy7c/9WG4f9+HUUAvCuJAfJGCQBazP//56qTABc4E/44fZ3/MLPa/0+2/f8m1L8BKet8AGCXHACHlL4Azfkn/jRgiP/ULIj/Q9GD//yCF//bgBT/xoF2AGxlCwCyBZIBPgdk/7XsXv4cGqQATBZw/3hmTwDKwOUByLDXAClA9P/OuE4Apy0/AaAjAP87DI7/zAmQ/9te5QF6G3AAvWlt/0DQSv/7fzcBAuLGACxM0QCXmE3/0hcuAcmrRf8s0+cAviXg//XEPv+ptd7/ItMRAHfxxf/lI5gBFUUo/7LioQCUs8EA28L+ASjOM//nXPoBQ5mqABWU8QCqRVL/eRLn/1xyAwC4PuYA4clX/5Jgov+18twArbvdAeI+qv84ftkBdQ3j/7Ms7wCdjZv/kN1TAOvR0AAqEaUB+1GFAHz1yf5h0xj/U9amAJokCf/4L38AWtuM/6HZJv7Ukz//QlSUAc8DAQDmhlkBf056/+CbAf9SiEoAspzQ/7oZMf/eA9IB5Za+/1WiNP8pVI3/SXtU/l0RlgB3ExwBIBbX/xwXzP+O8TT/5DR9AB1MzwDXp/r+r6TmADfPaQFtu/X/oSzcASllgP+nEF4AXdZr/3ZIAP5QPer/ea99AIup+wBhJ5P++sQx/6Wzbv7fRrv/Fo59AZqziv92sCoBCq6ZAJxcZgCoDaH/jxAgAPrFtP/LoywBVyAkAKGZFP97/A8AGeNQADxYjgARFskBms1N/yc/LwAIeo0AgBe2/swnE/8EcB3/FySM/9LqdP41Mj//eato/6DbXgBXUg7+5yoFAKWLf/5WTiYAgjxC/sseLf8uxHoB+TWi/4iPZ/7X0nIA5weg/qmYKv9vLfYAjoOH/4NHzP8k4gsAABzy/+GK1f/3Ltj+9QO3AGz8SgHOGjD/zTb2/9PGJP95IzIANNjK/yaLgf7ySZQAQ+eN/yovzABOdBkBBOG//waT5AA6WLEAeqXl//xTyf/gp2ABsbie//JpswH4xvAAhULLAf4kLwAtGHP/dz7+AMThuv57jawAGlUp/+JvtwDV55cABDsH/+6KlABCkyH/H/aN/9GNdP9ocB8AWKGsAFPX5v4vb5cALSY0AYQtzACKgG3+6XWG//O+rf7x7PAAUn/s/ijfof9utuH/e67vAIfykQEz0ZoAlgNz/tmk/P83nEUBVF7//+hJLQEUE9T/YMU7/mD7IQAmx0kBQKz3/3V0OP/kERIAPopnAfblpP/0dsn+ViCf/20iiQFV07oACsHB/nrCsQB67mb/otqrAGzZoQGeqiIAsC+bAbXkC/8InAAAEEtdAM5i/wE6miMADPO4/kN1Qv/m5XsAySpuAIbksv66bHb/OhOa/1KpPv9yj3MB78Qy/60wwf+TAlT/loaT/l/oSQBt4zT+v4kKACjMHv5MNGH/pOt+AP58vABKthUBeR0j//EeB/5V2tb/B1SW/lEbdf+gn5j+Qhjd/+MKPAGNh2YA0L2WAXWzXACEFoj/eMccABWBT/62CUEA2qOpAPaTxv9rJpABTq/N/9YF+v4vWB3/pC/M/ys3Bv+Dhs/+dGTWAGCMSwFq3JAAwyAcAaxRBf/HszT/JVTLAKpwrgALBFsARfQbAXWDXAAhmK//jJlr//uHK/5XigT/xuqT/nmYVP/NZZsBnQkZAEhqEf5smQD/veW6AMEIsP+uldEA7oIdAOnWfgE94mYAOaMEAcZvM/8tT04Bc9IK/9oJGf+ei8b/01K7/lCFUwCdgeYB84WG/yiIEABNa0//t1VcAbHMygCjR5P/mEW+AKwzvAH60qz/0/JxAVlZGv9AQm/+dJgqAKEnG/82UP4AatFzAWd8YQDd5mL/H+cGALLAeP4P2cv/fJ5PAHCR9wBc+jABo7XB/yUvjv6QvaX/LpLwAAZLgAApncj+V3nVAAFx7AAFLfoAkAxSAB9s5wDh73f/pwe9/7vkhP9uvSIAXizMAaI0xQBOvPH+ORSNAPSSLwHOZDMAfWuU/hvDTQCY/VoBB4+Q/zMlHwAidyb/B8V2AJm80wCXFHT+9UE0/7T9bgEvsdEAoWMR/3beygB9s/wBezZ+/5E5vwA3unkACvOKAM3T5f99nPH+lJy5/+MTvP98KSD/HyLO/hE5UwDMFiX/KmBiAHdmuAEDvhwAblLa/8jMwP/JkXYAdcySAIQgYgHAwnkAaqH4Ae1YfAAX1BoAzata//gw2AGNJeb/fMsA/p6oHv/W+BUAcLsH/0uF7/9K4/P/+pNGANZ4ogCnCbP/Fp4SANpN0QFhbVH/9CGz/zk0Of9BrNL/+UfR/46p7gCevZn/rv5n/mIhDgCNTOb/cYs0/w861ACo18n/+MzXAd9EoP85mrf+L+d5AGqmiQBRiIoApSszAOeLPQA5Xzv+dmIZ/5c/7AFevvr/qblyAQX6Ov9LaWEB19+GAHFjowGAPnAAY2qTAKPDCgAhzbYA1g6u/4Em5/81tt8AYiqf//cNKAC80rEBBhUA//89lP6JLYH/WRp0/n4mcgD7MvL+eYaA/8z5p/6l69cAyrHzAIWNPgDwgr4Bbq//AAAUkgEl0nn/ByeCAI76VP+NyM8ACV9o/wv0rgCG6H4ApwF7/hDBlf/o6e8B1UZw//x0oP7y3tz/zVXjAAe5OgB29z8BdE2x/z71yP4/EiX/azXo/jLd0wCi2wf+Al4rALY+tv6gTsj/h4yqAOu45ACvNYr+UDpN/5jJAgE/xCIABR64AKuwmgB5O84AJmMnAKxQTf4AhpcAuiHx/l793/8scvwAbH45/8koDf8n5Rv/J+8XAZd5M/+ZlvgACuqu/3b2BP7I9SYARaHyARCylgBxOIIAqx9pABpYbP8xKmoA+6lCAEVdlQAUOf4ApBlvAFq8Wv/MBMUAKNUyAdRghP9YirT+5JJ8/7j29wBBdVb//WbS/v55JACJcwP/PBjYAIYSHQA74mEAsI5HAAfRoQC9VDP+m/pIANVU6/8t3uAA7pSP/6oqNf9Op3UAugAo/32xZ/9F4UIA4wdYAUusBgCpLeMBECRG/zICCf+LwRYAj7fn/tpFMgDsOKEB1YMqAIqRLP6I5Sj/MT8j/z2R9f9lwAL+6KdxAJhoJgF5udoAeYvT/nfwIwBBvdn+u7Oi/6C75gA++A7/PE5hAP/3o//hO1v/a0c6//EvIQEydewA27E//vRaswAjwtf/vUMy/xeHgQBovSX/uTnCACM+5//c+GwADOeyAI9QWwGDXWX/kCcCAf/6sgAFEez+iyAuAMy8Jv71czT/v3FJ/r9sRf8WRfUBF8uyAKpjqgBB+G8AJWyZ/0AlRQAAWD7+WZSQ/79E4AHxJzUAKcvt/5F+wv/dKv3/GWOXAGH93wFKczH/Bq9I/zuwywB8t/kB5ORjAIEMz/6owMP/zLAQ/pjqqwBNJVX/IXiH/47C4wEf1joA1bt9/+guPP++dCr+l7IT/zM+7f7M7MEAwug8AKwinf+9ELj+ZwNf/43pJP4pGQv/FcOmAHb1LQBD1ZX/nwwS/7uk4wGgGQUADE7DASvF4QAwjin+xJs8/9/HEgGRiJwA/HWp/pHi7gDvF2sAbbW8/+ZwMf5Jqu3/57fj/1DcFADCa38Bf81lAC40xQHSqyT/WANa/ziXjQBgu///Kk7IAP5GRgH0fagAzESKAXzXRgBmQsj+ETTkAHXcj/7L+HsAOBKu/7qXpP8z6NABoOQr//kdGQFEvj8ADQAAAAD/AAAAAPUAAAAAAAD7AAAAAAAA/QAAAADzAAAAAAcAAAAAAAMAAAAA8wAAAAAFAAAAAAAAAAALAAAAAAALAAAAAPMAAAAAAAD9AAAAAAD/AAAAAAMAAAAA9QAAAAAAAAAPAAAAAAD/AAAAAP8AAAAABwAAAAAFAEHchwILAQEAQYCIAgsBAQBBoIgCC+AB4Ot6fDtBuK4WVuP68Z/EatoJjeucMrH9hmIFFl9JuABfnJW8o1CMJLHQsVWcg+9bBERcxFgcjobYIk7d0J8RV+z///////////////////////////////////////9/7f///////////////////////////////////////3/u////////////////////////////////////////fwjJvPNn5glqO6fKhIWuZ7sr+JT+cvNuPPE2HV869U+l0YLmrX9SDlEfbD4rjGgFm2u9Qfur2YMfeSF+ExnN4FsAQaCKAgvBBQjJvPNn5glqO6fKhIWuZ7sr+JT+cvNuPPE2HV869U+l0YLmrX9SDlEfbD4rjGgFm2u9Qfur2YMfeSF+ExnN4FsirijXmC+KQs1l7yORRDdxLztN7M/7wLW824mBpdu16Ti1SPNbwlY5GdAFtvER8VmbTxmvpII/khiBbdrVXhyrQgIDo5iqB9i+b3BFAVuDEoyy5E6+hTEk4rT/1cN9DFVviXvydF2+crGWFjv+sd6ANRLHJacG3JuUJmnPdPGbwdJK8Z7BaZvk4yVPOIZHvu+11YyLxp3BD2WcrHfMoQwkdQIrWW8s6S2D5KZuqoR0StT7Qb3cqbBctVMRg9qI+Xar32buUlE+mBAytC1txjGoPyH7mMgnA7DkDu++x39Zv8KPqD3zC+DGJacKk0eRp9VvggPgUWPKBnBuDgpnKSkU/C/SRoUKtycmySZcOCEbLu0qxFr8bSxN37OVnRMNOFPeY6+LVHMKZaiydzy7Cmp25q7tRy7JwoE7NYIUhSxykmQD8Uyh6L+iATBCvEtmGqiRl/jQcItLwjC+VAajUWzHGFLv1hnoktEQqWVVJAaZ1iogcVeFNQ70uNG7MnCgahDI0NK4FsGkGVOrQVEIbDcemeuO30x3SCeoSJvhtbywNGNaycWzDBw5y4pB40qq2E5z42N3T8qcW6O4stbzby5o/LLvXe6Cj3RgLxdDb2OleHKr8KEUeMiE7DlkGggCx4woHmMj+v++kOm9gt7rbFCkFXnGsvej+b4rU3Lj8nhxxpxhJurOPifKB8LAIce4htEe6+DN1n3a6njRbu5/T331um8Xcqpn8AammMiixX1jCq4N+b4EmD8RG0ccEzULcRuEfQQj9XfbKJMkx0B7q8oyvL7JFQq+njxMDRCcxGcdQ7ZCPsu+1MVMKn5l/Jwpf1ns+tY6q2/LXxdYR0qMGURsgABB4JACCyFTaWdFZDI1NTE5IG5vIEVkMjU1MTkgY29sbGlzaW9ucwEAQbCRAgs1MI5QAAEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0=")||(U=Q,Q=d.locateFile?d.locateFile(U,y):y+U);var Z={35048:function(){return d.getRandomValue()},35084:function(){if(void 0===d.getRandomValue)try{var e="object"==typeof window?window:self,t=void 0!==e.crypto?e.crypto:e.msCrypto,r=function(){var e=new Uint32Array(1);return t.getRandomValues(e),e[0]>>>0};r(),d.getRandomValue=r}catch(e){try{var i=n(22901),o=function(){var e=i.randomBytes(4);return(e[0]<<24|e[1]<<16|e[2]<<8|e[3])>>>0};o(),d.getRandomValue=o}catch(e){throw"No secure random number generator found"}}}};function W(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?q(n)():q(n)(t.arg):n(void 0===t.arg?null:t.arg)}else t(d)}}function q(e){return N.get(e)}var J=[];function X(e){try{return A.grow(e-w.byteLength+65535>>>16),O(A.buffer),1}catch(e){}}var $="function"==typeof atob?atob:function(e){var t,n,r,i,o,s,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l="",c=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{t=a.indexOf(e.charAt(c++))<<2|(i=a.indexOf(e.charAt(c++)))>>4,n=(15&i)<<4|(o=a.indexOf(e.charAt(c++)))>>2,r=(3&o)<<6|(s=a.indexOf(e.charAt(c++))),l+=String.fromCharCode(t),64!==o&&(l+=String.fromCharCode(n)),64!==s&&(l+=String.fromCharCode(r))}while(c<e.length);return l};function ee(e){if(G(e))return function(e){if("boolean"==typeof m&&m){var t=Buffer.from(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}try{for(var n=$(e),r=new Uint8Array(n.length),i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}catch(e){throw new Error("Converting base64 string to bytes failed.")}}(e.slice(H.length))}var te,ne={a:function(e,t,n,r){L("Assertion failed: "+B(e)+", at: "+[t?B(t):"unknown filename",n,r?B(r):"unknown function"])},d:function(){L("")},b:function(e,t,n){var r=function(e,t){var n;for(J.length=0,t>>=2;n=C[e++];){var r=n<105;r&&1&t&&t++,J.push(r?x[t++>>1]:I[t]),++t}return J}(t,n);return Z[e].apply(null,r)},e:function(e,t,n){C.copyWithin(e,t,t+n)},c:function(e){var t,n=C.length,r=2147483648;if((e>>>=0)>r)return!1;for(var i=1;i<=4;i*=2){var o=n*(1+.2/i);if(o=Math.min(o,e+100663296),X(Math.min(r,(t=Math.max(e,o))+(65536-t%65536)%65536)))return!0}return!1}};function re(e){function t(){te||(te=!0,d.calledRun=!0,P||(W(j),d.onRuntimeInitialized&&d.onRuntimeInitialized(),function(){if(d.postRun)for("function"==typeof d.postRun&&(d.postRun=[d.postRun]);d.postRun.length;)e=d.postRun.shift(),T.unshift(e);var e;W(T)}()))}e=e||p,M>0||(function(){if(d.preRun)for("function"==typeof d.preRun&&(d.preRun=[d.preRun]);d.preRun.length;)e=d.preRun.shift(),D.unshift(e);var e;W(D)}(),M>0||(d.setStatus?(d.setStatus("Running..."),setTimeout((function(){setTimeout((function(){d.setStatus("")}),1),t()}),1)):t()))}if(function(){var e={a:ne};function t(e,t){var n,r=e.exports;d.asm=r,O((A=d.asm.f).buffer),N=d.asm.Ac,n=d.asm.g,j.unshift(n),function(e){if(M--,d.monitorRunDependencies&&d.monitorRunDependencies(M),0==M&&(null!==F&&(clearInterval(F),F=null),R)){var t=R;R=null,t()}}()}function n(e){t(e.instance)}function r(t){return function(){if(!v&&(f||g)){if("function"==typeof fetch&&!Y(Q))return fetch(Q,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+Q+"'";return e.arrayBuffer()})).catch((function(){return z(Q)}));if(s)return new Promise((function(e,t){s(Q,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return z(Q)}))}().then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){b("failed to asynchronously prepare wasm: "+e),L(e)}))}if(M++,d.monitorRunDependencies&&d.monitorRunDependencies(M),d.instantiateWasm)try{return d.instantiateWasm(e,t)}catch(e){return b("Module.instantiateWasm callback failed with error: "+e),!1}v||"function"!=typeof WebAssembly.instantiateStreaming||G(Q)||Y(Q)||"function"!=typeof fetch?r(n):fetch(Q,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(n,(function(e){return b("wasm streaming compile failed: "+e),b("falling back to ArrayBuffer instantiation"),r(n)}))}))}(),d.___wasm_call_ctors=function(){return(d.___wasm_call_ctors=d.asm.g).apply(null,arguments)},d._crypto_aead_chacha20poly1305_encrypt_detached=function(){return(d._crypto_aead_chacha20poly1305_encrypt_detached=d.asm.h).apply(null,arguments)},d._crypto_aead_chacha20poly1305_encrypt=function(){return(d._crypto_aead_chacha20poly1305_encrypt=d.asm.i).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_encrypt_detached=function(){return(d._crypto_aead_chacha20poly1305_ietf_encrypt_detached=d.asm.j).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_encrypt=function(){return(d._crypto_aead_chacha20poly1305_ietf_encrypt=d.asm.k).apply(null,arguments)},d._crypto_aead_chacha20poly1305_decrypt_detached=function(){return(d._crypto_aead_chacha20poly1305_decrypt_detached=d.asm.l).apply(null,arguments)},d._crypto_aead_chacha20poly1305_decrypt=function(){return(d._crypto_aead_chacha20poly1305_decrypt=d.asm.m).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_decrypt_detached=function(){return(d._crypto_aead_chacha20poly1305_ietf_decrypt_detached=d.asm.n).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_decrypt=function(){return(d._crypto_aead_chacha20poly1305_ietf_decrypt=d.asm.o).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_keybytes=function(){return(d._crypto_aead_chacha20poly1305_ietf_keybytes=d.asm.p).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_npubbytes=function(){return(d._crypto_aead_chacha20poly1305_ietf_npubbytes=d.asm.q).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_nsecbytes=function(){return(d._crypto_aead_chacha20poly1305_ietf_nsecbytes=d.asm.r).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_abytes=function(){return(d._crypto_aead_chacha20poly1305_ietf_abytes=d.asm.s).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_messagebytes_max=function(){return(d._crypto_aead_chacha20poly1305_ietf_messagebytes_max=d.asm.t).apply(null,arguments)},d._crypto_aead_chacha20poly1305_ietf_keygen=function(){return(d._crypto_aead_chacha20poly1305_ietf_keygen=d.asm.u).apply(null,arguments)},d._crypto_aead_chacha20poly1305_keybytes=function(){return(d._crypto_aead_chacha20poly1305_keybytes=d.asm.v).apply(null,arguments)},d._crypto_aead_chacha20poly1305_npubbytes=function(){return(d._crypto_aead_chacha20poly1305_npubbytes=d.asm.w).apply(null,arguments)},d._crypto_aead_chacha20poly1305_nsecbytes=function(){return(d._crypto_aead_chacha20poly1305_nsecbytes=d.asm.x).apply(null,arguments)},d._crypto_aead_chacha20poly1305_abytes=function(){return(d._crypto_aead_chacha20poly1305_abytes=d.asm.y).apply(null,arguments)},d._crypto_aead_chacha20poly1305_messagebytes_max=function(){return(d._crypto_aead_chacha20poly1305_messagebytes_max=d.asm.z).apply(null,arguments)},d._crypto_aead_chacha20poly1305_keygen=function(){return(d._crypto_aead_chacha20poly1305_keygen=d.asm.A).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_encrypt_detached=function(){return(d._crypto_aead_xchacha20poly1305_ietf_encrypt_detached=d.asm.B).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_encrypt=function(){return(d._crypto_aead_xchacha20poly1305_ietf_encrypt=d.asm.C).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_decrypt_detached=function(){return(d._crypto_aead_xchacha20poly1305_ietf_decrypt_detached=d.asm.D).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_decrypt=function(){return(d._crypto_aead_xchacha20poly1305_ietf_decrypt=d.asm.E).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_keybytes=function(){return(d._crypto_aead_xchacha20poly1305_ietf_keybytes=d.asm.F).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_npubbytes=function(){return(d._crypto_aead_xchacha20poly1305_ietf_npubbytes=d.asm.G).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_nsecbytes=function(){return(d._crypto_aead_xchacha20poly1305_ietf_nsecbytes=d.asm.H).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_abytes=function(){return(d._crypto_aead_xchacha20poly1305_ietf_abytes=d.asm.I).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_messagebytes_max=function(){return(d._crypto_aead_xchacha20poly1305_ietf_messagebytes_max=d.asm.J).apply(null,arguments)},d._crypto_aead_xchacha20poly1305_ietf_keygen=function(){return(d._crypto_aead_xchacha20poly1305_ietf_keygen=d.asm.K).apply(null,arguments)},d._crypto_auth_bytes=function(){return(d._crypto_auth_bytes=d.asm.L).apply(null,arguments)},d._crypto_auth_keybytes=function(){return(d._crypto_auth_keybytes=d.asm.M).apply(null,arguments)},d._crypto_auth=function(){return(d._crypto_auth=d.asm.N).apply(null,arguments)},d._crypto_auth_verify=function(){return(d._crypto_auth_verify=d.asm.O).apply(null,arguments)},d._crypto_auth_keygen=function(){return(d._crypto_auth_keygen=d.asm.P).apply(null,arguments)},d._crypto_box_seedbytes=function(){return(d._crypto_box_seedbytes=d.asm.Q).apply(null,arguments)},d._crypto_box_publickeybytes=function(){return(d._crypto_box_publickeybytes=d.asm.R).apply(null,arguments)},d._crypto_box_secretkeybytes=function(){return(d._crypto_box_secretkeybytes=d.asm.S).apply(null,arguments)},d._crypto_box_beforenmbytes=function(){return(d._crypto_box_beforenmbytes=d.asm.T).apply(null,arguments)},d._crypto_box_noncebytes=function(){return(d._crypto_box_noncebytes=d.asm.U).apply(null,arguments)},d._crypto_box_macbytes=function(){return(d._crypto_box_macbytes=d.asm.V).apply(null,arguments)},d._crypto_box_messagebytes_max=function(){return(d._crypto_box_messagebytes_max=d.asm.W).apply(null,arguments)},d._crypto_box_seed_keypair=function(){return(d._crypto_box_seed_keypair=d.asm.X).apply(null,arguments)},d._crypto_box_keypair=function(){return(d._crypto_box_keypair=d.asm.Y).apply(null,arguments)},d._crypto_box_beforenm=function(){return(d._crypto_box_beforenm=d.asm.Z).apply(null,arguments)},d._crypto_box_detached_afternm=function(){return(d._crypto_box_detached_afternm=d.asm._).apply(null,arguments)},d._crypto_box_detached=function(){return(d._crypto_box_detached=d.asm.$).apply(null,arguments)},d._crypto_box_easy_afternm=function(){return(d._crypto_box_easy_afternm=d.asm.aa).apply(null,arguments)},d._crypto_box_easy=function(){return(d._crypto_box_easy=d.asm.ba).apply(null,arguments)},d._crypto_box_open_detached_afternm=function(){return(d._crypto_box_open_detached_afternm=d.asm.ca).apply(null,arguments)},d._crypto_box_open_detached=function(){return(d._crypto_box_open_detached=d.asm.da).apply(null,arguments)},d._crypto_box_open_easy_afternm=function(){return(d._crypto_box_open_easy_afternm=d.asm.ea).apply(null,arguments)},d._crypto_box_open_easy=function(){return(d._crypto_box_open_easy=d.asm.fa).apply(null,arguments)},d._crypto_box_seal=function(){return(d._crypto_box_seal=d.asm.ga).apply(null,arguments)},d._crypto_box_seal_open=function(){return(d._crypto_box_seal_open=d.asm.ha).apply(null,arguments)},d._crypto_box_sealbytes=function(){return(d._crypto_box_sealbytes=d.asm.ia).apply(null,arguments)},d._crypto_generichash_bytes_min=function(){return(d._crypto_generichash_bytes_min=d.asm.ja).apply(null,arguments)},d._crypto_generichash_bytes_max=function(){return(d._crypto_generichash_bytes_max=d.asm.ka).apply(null,arguments)},d._crypto_generichash_bytes=function(){return(d._crypto_generichash_bytes=d.asm.la).apply(null,arguments)},d._crypto_generichash_keybytes_min=function(){return(d._crypto_generichash_keybytes_min=d.asm.ma).apply(null,arguments)},d._crypto_generichash_keybytes_max=function(){return(d._crypto_generichash_keybytes_max=d.asm.na).apply(null,arguments)},d._crypto_generichash_keybytes=function(){return(d._crypto_generichash_keybytes=d.asm.oa).apply(null,arguments)},d._crypto_generichash_statebytes=function(){return(d._crypto_generichash_statebytes=d.asm.pa).apply(null,arguments)},d._crypto_generichash=function(){return(d._crypto_generichash=d.asm.qa).apply(null,arguments)},d._crypto_generichash_init=function(){return(d._crypto_generichash_init=d.asm.ra).apply(null,arguments)},d._crypto_generichash_update=function(){return(d._crypto_generichash_update=d.asm.sa).apply(null,arguments)},d._crypto_generichash_final=function(){return(d._crypto_generichash_final=d.asm.ta).apply(null,arguments)},d._crypto_generichash_keygen=function(){return(d._crypto_generichash_keygen=d.asm.ua).apply(null,arguments)},d._crypto_hash_bytes=function(){return(d._crypto_hash_bytes=d.asm.va).apply(null,arguments)},d._crypto_hash=function(){return(d._crypto_hash=d.asm.wa).apply(null,arguments)},d._crypto_kdf_bytes_min=function(){return(d._crypto_kdf_bytes_min=d.asm.xa).apply(null,arguments)},d._crypto_kdf_bytes_max=function(){return(d._crypto_kdf_bytes_max=d.asm.ya).apply(null,arguments)},d._crypto_kdf_contextbytes=function(){return(d._crypto_kdf_contextbytes=d.asm.za).apply(null,arguments)},d._crypto_kdf_keybytes=function(){return(d._crypto_kdf_keybytes=d.asm.Aa).apply(null,arguments)},d._crypto_kdf_derive_from_key=function(){return(d._crypto_kdf_derive_from_key=d.asm.Ba).apply(null,arguments)},d._crypto_kdf_keygen=function(){return(d._crypto_kdf_keygen=d.asm.Ca).apply(null,arguments)},d._crypto_kx_seed_keypair=function(){return(d._crypto_kx_seed_keypair=d.asm.Da).apply(null,arguments)},d._crypto_kx_keypair=function(){return(d._crypto_kx_keypair=d.asm.Ea).apply(null,arguments)},d._crypto_kx_client_session_keys=function(){return(d._crypto_kx_client_session_keys=d.asm.Fa).apply(null,arguments)},d._crypto_kx_server_session_keys=function(){return(d._crypto_kx_server_session_keys=d.asm.Ga).apply(null,arguments)},d._crypto_kx_publickeybytes=function(){return(d._crypto_kx_publickeybytes=d.asm.Ha).apply(null,arguments)},d._crypto_kx_secretkeybytes=function(){return(d._crypto_kx_secretkeybytes=d.asm.Ia).apply(null,arguments)},d._crypto_kx_seedbytes=function(){return(d._crypto_kx_seedbytes=d.asm.Ja).apply(null,arguments)},d._crypto_kx_sessionkeybytes=function(){return(d._crypto_kx_sessionkeybytes=d.asm.Ka).apply(null,arguments)},d._crypto_pwhash_alg_argon2i13=function(){return(d._crypto_pwhash_alg_argon2i13=d.asm.La).apply(null,arguments)},d._crypto_pwhash_alg_argon2id13=function(){return(d._crypto_pwhash_alg_argon2id13=d.asm.Ma).apply(null,arguments)},d._crypto_pwhash_alg_default=function(){return(d._crypto_pwhash_alg_default=d.asm.Na).apply(null,arguments)},d._crypto_pwhash_bytes_min=function(){return(d._crypto_pwhash_bytes_min=d.asm.Oa).apply(null,arguments)},d._crypto_pwhash_bytes_max=function(){return(d._crypto_pwhash_bytes_max=d.asm.Pa).apply(null,arguments)},d._crypto_pwhash_passwd_min=function(){return(d._crypto_pwhash_passwd_min=d.asm.Qa).apply(null,arguments)},d._crypto_pwhash_passwd_max=function(){return(d._crypto_pwhash_passwd_max=d.asm.Ra).apply(null,arguments)},d._crypto_pwhash_saltbytes=function(){return(d._crypto_pwhash_saltbytes=d.asm.Sa).apply(null,arguments)},d._crypto_pwhash_strbytes=function(){return(d._crypto_pwhash_strbytes=d.asm.Ta).apply(null,arguments)},d._crypto_pwhash_strprefix=function(){return(d._crypto_pwhash_strprefix=d.asm.Ua).apply(null,arguments)},d._crypto_pwhash_opslimit_min=function(){return(d._crypto_pwhash_opslimit_min=d.asm.Va).apply(null,arguments)},d._crypto_pwhash_opslimit_max=function(){return(d._crypto_pwhash_opslimit_max=d.asm.Wa).apply(null,arguments)},d._crypto_pwhash_memlimit_min=function(){return(d._crypto_pwhash_memlimit_min=d.asm.Xa).apply(null,arguments)},d._crypto_pwhash_memlimit_max=function(){return(d._crypto_pwhash_memlimit_max=d.asm.Ya).apply(null,arguments)},d._crypto_pwhash_opslimit_interactive=function(){return(d._crypto_pwhash_opslimit_interactive=d.asm.Za).apply(null,arguments)},d._crypto_pwhash_memlimit_interactive=function(){return(d._crypto_pwhash_memlimit_interactive=d.asm._a).apply(null,arguments)},d._crypto_pwhash_opslimit_moderate=function(){return(d._crypto_pwhash_opslimit_moderate=d.asm.$a).apply(null,arguments)},d._crypto_pwhash_memlimit_moderate=function(){return(d._crypto_pwhash_memlimit_moderate=d.asm.ab).apply(null,arguments)},d._crypto_pwhash_opslimit_sensitive=function(){return(d._crypto_pwhash_opslimit_sensitive=d.asm.bb).apply(null,arguments)},d._crypto_pwhash_memlimit_sensitive=function(){return(d._crypto_pwhash_memlimit_sensitive=d.asm.cb).apply(null,arguments)},d._crypto_pwhash=function(){return(d._crypto_pwhash=d.asm.db).apply(null,arguments)},d._crypto_pwhash_str=function(){return(d._crypto_pwhash_str=d.asm.eb).apply(null,arguments)},d._crypto_pwhash_str_alg=function(){return(d._crypto_pwhash_str_alg=d.asm.fb).apply(null,arguments)},d._crypto_pwhash_str_verify=function(){return(d._crypto_pwhash_str_verify=d.asm.gb).apply(null,arguments)},d._crypto_pwhash_str_needs_rehash=function(){return(d._crypto_pwhash_str_needs_rehash=d.asm.hb).apply(null,arguments)},d._crypto_scalarmult_base=function(){return(d._crypto_scalarmult_base=d.asm.ib).apply(null,arguments)},d._crypto_scalarmult=function(){return(d._crypto_scalarmult=d.asm.jb).apply(null,arguments)},d._crypto_scalarmult_bytes=function(){return(d._crypto_scalarmult_bytes=d.asm.kb).apply(null,arguments)},d._crypto_scalarmult_scalarbytes=function(){return(d._crypto_scalarmult_scalarbytes=d.asm.lb).apply(null,arguments)},d._crypto_secretbox_keybytes=function(){return(d._crypto_secretbox_keybytes=d.asm.mb).apply(null,arguments)},d._crypto_secretbox_noncebytes=function(){return(d._crypto_secretbox_noncebytes=d.asm.nb).apply(null,arguments)},d._crypto_secretbox_macbytes=function(){return(d._crypto_secretbox_macbytes=d.asm.ob).apply(null,arguments)},d._crypto_secretbox_messagebytes_max=function(){return(d._crypto_secretbox_messagebytes_max=d.asm.pb).apply(null,arguments)},d._crypto_secretbox_keygen=function(){return(d._crypto_secretbox_keygen=d.asm.qb).apply(null,arguments)},d._crypto_secretbox_detached=function(){return(d._crypto_secretbox_detached=d.asm.rb).apply(null,arguments)},d._crypto_secretbox_easy=function(){return(d._crypto_secretbox_easy=d.asm.sb).apply(null,arguments)},d._crypto_secretbox_open_detached=function(){return(d._crypto_secretbox_open_detached=d.asm.tb).apply(null,arguments)},d._crypto_secretbox_open_easy=function(){return(d._crypto_secretbox_open_easy=d.asm.ub).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_keygen=function(){return(d._crypto_secretstream_xchacha20poly1305_keygen=d.asm.vb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_init_push=function(){return(d._crypto_secretstream_xchacha20poly1305_init_push=d.asm.wb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_init_pull=function(){return(d._crypto_secretstream_xchacha20poly1305_init_pull=d.asm.xb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_rekey=function(){return(d._crypto_secretstream_xchacha20poly1305_rekey=d.asm.yb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_push=function(){return(d._crypto_secretstream_xchacha20poly1305_push=d.asm.zb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_pull=function(){return(d._crypto_secretstream_xchacha20poly1305_pull=d.asm.Ab).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_statebytes=function(){return(d._crypto_secretstream_xchacha20poly1305_statebytes=d.asm.Bb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_abytes=function(){return(d._crypto_secretstream_xchacha20poly1305_abytes=d.asm.Cb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_headerbytes=function(){return(d._crypto_secretstream_xchacha20poly1305_headerbytes=d.asm.Db).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_keybytes=function(){return(d._crypto_secretstream_xchacha20poly1305_keybytes=d.asm.Eb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_messagebytes_max=function(){return(d._crypto_secretstream_xchacha20poly1305_messagebytes_max=d.asm.Fb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_tag_message=function(){return(d._crypto_secretstream_xchacha20poly1305_tag_message=d.asm.Gb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_tag_push=function(){return(d._crypto_secretstream_xchacha20poly1305_tag_push=d.asm.Hb).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_tag_rekey=function(){return(d._crypto_secretstream_xchacha20poly1305_tag_rekey=d.asm.Ib).apply(null,arguments)},d._crypto_secretstream_xchacha20poly1305_tag_final=function(){return(d._crypto_secretstream_xchacha20poly1305_tag_final=d.asm.Jb).apply(null,arguments)},d._crypto_shorthash_bytes=function(){return(d._crypto_shorthash_bytes=d.asm.Kb).apply(null,arguments)},d._crypto_shorthash_keybytes=function(){return(d._crypto_shorthash_keybytes=d.asm.Lb).apply(null,arguments)},d._crypto_shorthash=function(){return(d._crypto_shorthash=d.asm.Mb).apply(null,arguments)},d._crypto_shorthash_keygen=function(){return(d._crypto_shorthash_keygen=d.asm.Nb).apply(null,arguments)},d._crypto_sign_statebytes=function(){return(d._crypto_sign_statebytes=d.asm.Ob).apply(null,arguments)},d._crypto_sign_bytes=function(){return(d._crypto_sign_bytes=d.asm.Pb).apply(null,arguments)},d._crypto_sign_seedbytes=function(){return(d._crypto_sign_seedbytes=d.asm.Qb).apply(null,arguments)},d._crypto_sign_publickeybytes=function(){return(d._crypto_sign_publickeybytes=d.asm.Rb).apply(null,arguments)},d._crypto_sign_secretkeybytes=function(){return(d._crypto_sign_secretkeybytes=d.asm.Sb).apply(null,arguments)},d._crypto_sign_messagebytes_max=function(){return(d._crypto_sign_messagebytes_max=d.asm.Tb).apply(null,arguments)},d._crypto_sign_seed_keypair=function(){return(d._crypto_sign_seed_keypair=d.asm.Ub).apply(null,arguments)},d._crypto_sign_keypair=function(){return(d._crypto_sign_keypair=d.asm.Vb).apply(null,arguments)},d._crypto_sign=function(){return(d._crypto_sign=d.asm.Wb).apply(null,arguments)},d._crypto_sign_open=function(){return(d._crypto_sign_open=d.asm.Xb).apply(null,arguments)},d._crypto_sign_detached=function(){return(d._crypto_sign_detached=d.asm.Yb).apply(null,arguments)},d._crypto_sign_verify_detached=function(){return(d._crypto_sign_verify_detached=d.asm.Zb).apply(null,arguments)},d._crypto_sign_init=function(){return(d._crypto_sign_init=d.asm._b).apply(null,arguments)},d._crypto_sign_update=function(){return(d._crypto_sign_update=d.asm.$b).apply(null,arguments)},d._crypto_sign_final_create=function(){return(d._crypto_sign_final_create=d.asm.ac).apply(null,arguments)},d._crypto_sign_final_verify=function(){return(d._crypto_sign_final_verify=d.asm.bc).apply(null,arguments)},d._crypto_sign_ed25519_pk_to_curve25519=function(){return(d._crypto_sign_ed25519_pk_to_curve25519=d.asm.cc).apply(null,arguments)},d._crypto_sign_ed25519_sk_to_curve25519=function(){return(d._crypto_sign_ed25519_sk_to_curve25519=d.asm.dc).apply(null,arguments)},d._randombytes_random=function(){return(d._randombytes_random=d.asm.ec).apply(null,arguments)},d._randombytes_stir=function(){return(d._randombytes_stir=d.asm.fc).apply(null,arguments)},d._randombytes_uniform=function(){return(d._randombytes_uniform=d.asm.gc).apply(null,arguments)},d._randombytes_buf=function(){return(d._randombytes_buf=d.asm.hc).apply(null,arguments)},d._randombytes_buf_deterministic=function(){return(d._randombytes_buf_deterministic=d.asm.ic).apply(null,arguments)},d._randombytes_seedbytes=function(){return(d._randombytes_seedbytes=d.asm.jc).apply(null,arguments)},d._randombytes_close=function(){return(d._randombytes_close=d.asm.kc).apply(null,arguments)},d._randombytes=function(){return(d._randombytes=d.asm.lc).apply(null,arguments)},d._sodium_bin2hex=function(){return(d._sodium_bin2hex=d.asm.mc).apply(null,arguments)},d._sodium_hex2bin=function(){return(d._sodium_hex2bin=d.asm.nc).apply(null,arguments)},d._sodium_base64_encoded_len=function(){return(d._sodium_base64_encoded_len=d.asm.oc).apply(null,arguments)},d._sodium_bin2base64=function(){return(d._sodium_bin2base64=d.asm.pc).apply(null,arguments)},d._sodium_base642bin=function(){return(d._sodium_base642bin=d.asm.qc).apply(null,arguments)},d._sodium_init=function(){return(d._sodium_init=d.asm.rc).apply(null,arguments)},d._sodium_pad=function(){return(d._sodium_pad=d.asm.sc).apply(null,arguments)},d._sodium_unpad=function(){return(d._sodium_unpad=d.asm.tc).apply(null,arguments)},d._sodium_version_string=function(){return(d._sodium_version_string=d.asm.uc).apply(null,arguments)},d._sodium_library_version_major=function(){return(d._sodium_library_version_major=d.asm.vc).apply(null,arguments)},d._sodium_library_version_minor=function(){return(d._sodium_library_version_minor=d.asm.wc).apply(null,arguments)},d._sodium_library_minimal=function(){return(d._sodium_library_minimal=d.asm.xc).apply(null,arguments)},d._malloc=function(){return(d._malloc=d.asm.yc).apply(null,arguments)},d._free=function(){return(d._free=d.asm.zc).apply(null,arguments)},d.setValue=function(e,t,n="i8",r){switch("*"===n.charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":S[e>>0]=t;break;case"i16":E[e>>1]=t;break;case"i32":I[e>>2]=t;break;case"i64":K=[t>>>0,(V=t,+Math.abs(V)>=1?V>0?(0|Math.min(+Math.floor(V/4294967296),4294967295))>>>0:~~+Math.ceil((V-+(~~V>>>0))/4294967296)>>>0:0)],I[e>>2]=K[0],I[e+4>>2]=K[1];break;case"float":_[e>>2]=t;break;case"double":x[e>>3]=t;break;default:L("invalid type for setValue: "+n)}},d.getValue=function(e,t="i8",n){switch("*"===t.charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return S[e>>0];case"i16":return E[e>>1];case"i32":case"i64":return I[e>>2];case"float":return _[e>>2];case"double":return Number(x[e>>3]);default:L("invalid type for getValue: "+t)}return null},d.UTF8ToString=B,R=function e(){te||re(),te||(R=e)},d.run=re,d.preInit)for("function"==typeof d.preInit&&(d.preInit=[d.preInit]);d.preInit.length>0;)d.preInit.pop()();re()})).catch((function(){return o.useBackupModule()})),r},void 0===(i=r.apply(t,[t]))||(e.exports=i)},76635:function(e,t,n){var r;e=n.nmd(e),function(){var i,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",l=32,c=128,u=1/0,d=9007199254740991,h=NaN,p=4294967295,f=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",l],["partialRight",64],["rearg",256]],g="[object Arguments]",m="[object Array]",y="[object Boolean]",v="[object Date]",A="[object Error]",b="[object Function]",w="[object GeneratorFunction]",S="[object Map]",C="[object Number]",E="[object Object]",I="[object Promise]",_="[object RegExp]",x="[object Set]",P="[object String]",k="[object Symbol]",B="[object WeakMap]",O="[object ArrayBuffer]",N="[object DataView]",D="[object Float32Array]",j="[object Float64Array]",T="[object Int8Array]",M="[object Int16Array]",F="[object Int32Array]",R="[object Uint8Array]",L="[object Uint8ClampedArray]",Q="[object Uint16Array]",U="[object Uint32Array]",V=/\b__p \+= '';/g,K=/\b(__p \+=) '' \+/g,H=/(__e\(.*?\)|\b__t\)) \+\n'';/g,G=/&(?:amp|lt|gt|quot|#39);/g,Y=/[&<>"']/g,z=RegExp(G.source),Z=RegExp(Y.source),W=/<%-([\s\S]+?)%>/g,q=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(te.source),re=/^\s+/,ie=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,se=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,le=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,ue=/\\(\\)?/g,de=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,he=/\w*$/,pe=/^[-+]0x[0-9a-f]+$/i,fe=/^0b[01]+$/i,ge=/^\[object .+?Constructor\]$/,me=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,ve=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ae=/($^)/,be=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",Se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ce="\\u2700-\\u27bf",Ee="a-z\\xdf-\\xf6\\xf8-\\xff",Ie="A-Z\\xc0-\\xd6\\xd8-\\xde",_e="\\ufe0e\\ufe0f",xe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Pe="["+we+"]",ke="["+xe+"]",Be="["+Se+"]",Oe="\\d+",Ne="["+Ce+"]",De="["+Ee+"]",je="[^"+we+xe+Oe+Ce+Ee+Ie+"]",Te="\\ud83c[\\udffb-\\udfff]",Me="[^"+we+"]",Fe="(?:\\ud83c[\\udde6-\\uddff]){2}",Re="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+Ie+"]",Qe="\\u200d",Ue="(?:"+De+"|"+je+")",Ve="(?:"+Le+"|"+je+")",Ke="(?:['’](?:d|ll|m|re|s|t|ve))?",He="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ge="(?:"+Be+"|"+Te+")?",Ye="["+_e+"]?",ze=Ye+Ge+"(?:"+Qe+"(?:"+[Me,Fe,Re].join("|")+")"+Ye+Ge+")*",Ze="(?:"+[Ne,Fe,Re].join("|")+")"+ze,We="(?:"+[Me+Be+"?",Be,Fe,Re,Pe].join("|")+")",qe=RegExp("['’]","g"),Je=RegExp(Be,"g"),Xe=RegExp(Te+"(?="+Te+")|"+We+ze,"g"),$e=RegExp([Le+"?"+De+"+"+Ke+"(?="+[ke,Le,"$"].join("|")+")",Ve+"+"+He+"(?="+[ke,Le+Ue,"$"].join("|")+")",Le+"?"+Ue+"+"+Ke,Le+"+"+He,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Oe,Ze].join("|"),"g"),et=RegExp("["+Qe+we+Se+_e+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rt=-1,it={};it[D]=it[j]=it[T]=it[M]=it[F]=it[R]=it[L]=it[Q]=it[U]=!0,it[g]=it[m]=it[O]=it[y]=it[N]=it[v]=it[A]=it[b]=it[S]=it[C]=it[E]=it[_]=it[x]=it[P]=it[B]=!1;var ot={};ot[g]=ot[m]=ot[O]=ot[N]=ot[y]=ot[v]=ot[D]=ot[j]=ot[T]=ot[M]=ot[F]=ot[S]=ot[C]=ot[E]=ot[_]=ot[x]=ot[P]=ot[k]=ot[R]=ot[L]=ot[Q]=ot[U]=!0,ot[A]=ot[b]=ot[B]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},at=parseFloat,lt=parseInt,ct="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ut="object"==typeof self&&self&&self.Object===Object&&self,dt=ct||ut||Function("return this")(),ht=t&&!t.nodeType&&t,pt=ht&&e&&!e.nodeType&&e,ft=pt&&pt.exports===ht,gt=ft&&ct.process,mt=function(){try{return pt&&pt.require&&pt.require("util").types||gt&&gt.binding&&gt.binding("util")}catch(e){}}(),yt=mt&&mt.isArrayBuffer,vt=mt&&mt.isDate,At=mt&&mt.isMap,bt=mt&&mt.isRegExp,wt=mt&&mt.isSet,St=mt&&mt.isTypedArray;function Ct(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Et(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(r,s,n(s),e)}return r}function It(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function _t(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function xt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Pt(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function kt(e,t){return!(null==e||!e.length)&&Lt(e,t,0)>-1}function Bt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Ot(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Nt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Dt(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function jt(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Tt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Mt=Kt("length");function Ft(e,t,n){var r;return n(e,(function(e,n,i){if(t(e,n,i))return r=n,!1})),r}function Rt(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Lt(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):Rt(e,Ut,n)}function Qt(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function Ut(e){return e!=e}function Vt(e,t){var n=null==e?0:e.length;return n?Yt(e,t)/n:h}function Kt(e){return function(t){return null==t?i:t[e]}}function Ht(e){return function(t){return null==e?i:e[t]}}function Gt(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}function Yt(e,t){for(var n,r=-1,o=e.length;++r<o;){var s=t(e[r]);s!==i&&(n=n===i?s:n+s)}return n}function zt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Zt(e){return e?e.slice(0,hn(e)+1).replace(re,""):e}function Wt(e){return function(t){return e(t)}}function qt(e,t){return Ot(t,(function(t){return e[t]}))}function Jt(e,t){return e.has(t)}function Xt(e,t){for(var n=-1,r=e.length;++n<r&&Lt(t,e[n],0)>-1;);return n}function $t(e,t){for(var n=e.length;n--&&Lt(t,e[n],0)>-1;);return n}var en=Ht({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tn=Ht({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function nn(e){return"\\"+st[e]}function rn(e){return et.test(e)}function on(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function sn(e,t){return function(n){return e(t(n))}}function an(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n];s!==t&&s!==a||(e[n]=a,o[i++]=n)}return o}function ln(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function cn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function un(e){return rn(e)?function(e){for(var t=Xe.lastIndex=0;Xe.test(e);)++t;return t}(e):Mt(e)}function dn(e){return rn(e)?function(e){return e.match(Xe)||[]}(e):function(e){return e.split("")}(e)}function hn(e){for(var t=e.length;t--&&ie.test(e.charAt(t)););return t}var pn=Ht({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),fn=function e(t){var n,r=(t=null==t?dt:fn.defaults(dt.Object(),t,fn.pick(dt,nt))).Array,ie=t.Date,we=t.Error,Se=t.Function,Ce=t.Math,Ee=t.Object,Ie=t.RegExp,_e=t.String,xe=t.TypeError,Pe=r.prototype,ke=Se.prototype,Be=Ee.prototype,Oe=t["__core-js_shared__"],Ne=ke.toString,De=Be.hasOwnProperty,je=0,Te=(n=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Me=Be.toString,Fe=Ne.call(Ee),Re=dt._,Le=Ie("^"+Ne.call(De).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Qe=ft?t.Buffer:i,Ue=t.Symbol,Ve=t.Uint8Array,Ke=Qe?Qe.allocUnsafe:i,He=sn(Ee.getPrototypeOf,Ee),Ge=Ee.create,Ye=Be.propertyIsEnumerable,ze=Pe.splice,Ze=Ue?Ue.isConcatSpreadable:i,We=Ue?Ue.iterator:i,Xe=Ue?Ue.toStringTag:i,et=function(){try{var e=lo(Ee,"defineProperty");return e({},"",{}),e}catch(e){}}(),st=t.clearTimeout!==dt.clearTimeout&&t.clearTimeout,ct=ie&&ie.now!==dt.Date.now&&ie.now,ut=t.setTimeout!==dt.setTimeout&&t.setTimeout,ht=Ce.ceil,pt=Ce.floor,gt=Ee.getOwnPropertySymbols,mt=Qe?Qe.isBuffer:i,Mt=t.isFinite,Ht=Pe.join,gn=sn(Ee.keys,Ee),mn=Ce.max,yn=Ce.min,vn=ie.now,An=t.parseInt,bn=Ce.random,wn=Pe.reverse,Sn=lo(t,"DataView"),Cn=lo(t,"Map"),En=lo(t,"Promise"),In=lo(t,"Set"),_n=lo(t,"WeakMap"),xn=lo(Ee,"create"),Pn=_n&&new _n,kn={},Bn=Fo(Sn),On=Fo(Cn),Nn=Fo(En),Dn=Fo(In),jn=Fo(_n),Tn=Ue?Ue.prototype:i,Mn=Tn?Tn.valueOf:i,Fn=Tn?Tn.toString:i;function Rn(e){if(ea(e)&&!Ks(e)&&!(e instanceof Vn)){if(e instanceof Un)return e;if(De.call(e,"__wrapped__"))return Ro(e)}return new Un(e)}var Ln=function(){function e(){}return function(t){if(!$s(t))return{};if(Ge)return Ge(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Qn(){}function Un(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Vn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=p,this.__views__=[]}function Kn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Hn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Gn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Yn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Gn;++t<n;)this.add(e[t])}function zn(e){var t=this.__data__=new Hn(e);this.size=t.size}function Zn(e,t){var n=Ks(e),r=!n&&Vs(e),i=!n&&!r&&zs(e),o=!n&&!r&&!i&&la(e),s=n||r||i||o,a=s?zt(e.length,_e):[],l=a.length;for(var c in e)!t&&!De.call(e,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||mo(c,l))||a.push(c);return a}function Wn(e){var t=e.length;return t?e[Gr(0,t-1)]:i}function qn(e,t){return No(_i(e),or(t,0,e.length))}function Jn(e){return No(_i(e))}function Xn(e,t,n){(n!==i&&!Ls(e[t],n)||n===i&&!(t in e))&&rr(e,t,n)}function $n(e,t,n){var r=e[t];De.call(e,t)&&Ls(r,n)&&(n!==i||t in e)||rr(e,t,n)}function er(e,t){for(var n=e.length;n--;)if(Ls(e[n][0],t))return n;return-1}function tr(e,t,n,r){return ur(e,(function(e,i,o){t(r,e,n(e),o)})),r}function nr(e,t){return e&&xi(t,Ba(t),e)}function rr(e,t,n){"__proto__"==t&&et?et(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ir(e,t){for(var n=-1,o=t.length,s=r(o),a=null==e;++n<o;)s[n]=a?i:Ia(e,t[n]);return s}function or(e,t,n){return e==e&&(n!==i&&(e=e<=n?e:n),t!==i&&(e=e>=t?e:t)),e}function sr(e,t,n,r,o,s){var a,l=1&t,c=2&t,u=4&t;if(n&&(a=o?n(e,r,o,s):n(e)),a!==i)return a;if(!$s(e))return e;var d=Ks(e);if(d){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&De.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!l)return _i(e,a)}else{var h=ho(e),p=h==b||h==w;if(zs(e))return bi(e,l);if(h==E||h==g||p&&!o){if(a=c||p?{}:fo(e),!l)return c?function(e,t){return xi(e,uo(e),t)}(e,function(e,t){return e&&xi(t,Oa(t),e)}(a,e)):function(e,t){return xi(e,co(e),t)}(e,nr(a,e))}else{if(!ot[h])return o?e:{};a=function(e,t,n){var r,i=e.constructor;switch(t){case O:return wi(e);case y:case v:return new i(+e);case N:return function(e,t){var n=t?wi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case D:case j:case T:case M:case F:case R:case L:case Q:case U:return Si(e,n);case S:return new i;case C:case P:return new i(e);case _:return function(e){var t=new e.constructor(e.source,he.exec(e));return t.lastIndex=e.lastIndex,t}(e);case x:return new i;case k:return r=e,Mn?Ee(Mn.call(r)):{}}}(e,h,l)}}s||(s=new zn);var f=s.get(e);if(f)return f;s.set(e,a),oa(e)?e.forEach((function(r){a.add(sr(r,t,n,r,e,s))})):ta(e)&&e.forEach((function(r,i){a.set(i,sr(r,t,n,i,e,s))}));var m=d?i:(u?c?to:eo:c?Oa:Ba)(e);return It(m||e,(function(r,i){m&&(r=e[i=r]),$n(a,i,sr(r,t,n,i,e,s))})),a}function ar(e,t,n){var r=n.length;if(null==e)return!r;for(e=Ee(e);r--;){var o=n[r],s=t[o],a=e[o];if(a===i&&!(o in e)||!s(a))return!1}return!0}function lr(e,t,n){if("function"!=typeof e)throw new xe(o);return Po((function(){e.apply(i,n)}),t)}function cr(e,t,n,r){var i=-1,o=kt,s=!0,a=e.length,l=[],c=t.length;if(!a)return l;n&&(t=Ot(t,Wt(n))),r?(o=Bt,s=!1):t.length>=200&&(o=Jt,s=!1,t=new Yn(t));e:for(;++i<a;){var u=e[i],d=null==n?u:n(u);if(u=r||0!==u?u:0,s&&d==d){for(var h=c;h--;)if(t[h]===d)continue e;l.push(u)}else o(t,d,r)||l.push(u)}return l}Rn.templateSettings={escape:W,evaluate:q,interpolate:J,variable:"",imports:{_:Rn}},Rn.prototype=Qn.prototype,Rn.prototype.constructor=Rn,Un.prototype=Ln(Qn.prototype),Un.prototype.constructor=Un,Vn.prototype=Ln(Qn.prototype),Vn.prototype.constructor=Vn,Kn.prototype.clear=function(){this.__data__=xn?xn(null):{},this.size=0},Kn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Kn.prototype.get=function(e){var t=this.__data__;if(xn){var n=t[e];return n===s?i:n}return De.call(t,e)?t[e]:i},Kn.prototype.has=function(e){var t=this.__data__;return xn?t[e]!==i:De.call(t,e)},Kn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=xn&&t===i?s:t,this},Hn.prototype.clear=function(){this.__data__=[],this.size=0},Hn.prototype.delete=function(e){var t=this.__data__,n=er(t,e);return!(n<0||(n==t.length-1?t.pop():ze.call(t,n,1),--this.size,0))},Hn.prototype.get=function(e){var t=this.__data__,n=er(t,e);return n<0?i:t[n][1]},Hn.prototype.has=function(e){return er(this.__data__,e)>-1},Hn.prototype.set=function(e,t){var n=this.__data__,r=er(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Gn.prototype.clear=function(){this.size=0,this.__data__={hash:new Kn,map:new(Cn||Hn),string:new Kn}},Gn.prototype.delete=function(e){var t=so(this,e).delete(e);return this.size-=t?1:0,t},Gn.prototype.get=function(e){return so(this,e).get(e)},Gn.prototype.has=function(e){return so(this,e).has(e)},Gn.prototype.set=function(e,t){var n=so(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Yn.prototype.add=Yn.prototype.push=function(e){return this.__data__.set(e,s),this},Yn.prototype.has=function(e){return this.__data__.has(e)},zn.prototype.clear=function(){this.__data__=new Hn,this.size=0},zn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},zn.prototype.get=function(e){return this.__data__.get(e)},zn.prototype.has=function(e){return this.__data__.has(e)},zn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Hn){var r=n.__data__;if(!Cn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Gn(r)}return n.set(e,t),this.size=n.size,this};var ur=Bi(vr),dr=Bi(Ar,!0);function hr(e,t){var n=!0;return ur(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function pr(e,t,n){for(var r=-1,o=e.length;++r<o;){var s=e[r],a=t(s);if(null!=a&&(l===i?a==a&&!aa(a):n(a,l)))var l=a,c=s}return c}function fr(e,t){var n=[];return ur(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}function gr(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=go),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?gr(a,t-1,n,r,i):Nt(i,a):r||(i[i.length]=a)}return i}var mr=Oi(),yr=Oi(!0);function vr(e,t){return e&&mr(e,t,Ba)}function Ar(e,t){return e&&yr(e,t,Ba)}function br(e,t){return Pt(t,(function(t){return qs(e[t])}))}function wr(e,t){for(var n=0,r=(t=mi(t,e)).length;null!=e&&n<r;)e=e[Mo(t[n++])];return n&&n==r?e:i}function Sr(e,t,n){var r=t(e);return Ks(e)?r:Nt(r,n(e))}function Cr(e){return null==e?e===i?"[object Undefined]":"[object Null]":Xe&&Xe in Ee(e)?function(e){var t=De.call(e,Xe),n=e[Xe];try{e[Xe]=i;var r=!0}catch(e){}var o=Me.call(e);return r&&(t?e[Xe]=n:delete e[Xe]),o}(e):function(e){return Me.call(e)}(e)}function Er(e,t){return e>t}function Ir(e,t){return null!=e&&De.call(e,t)}function _r(e,t){return null!=e&&t in Ee(e)}function xr(e,t,n){for(var o=n?Bt:kt,s=e[0].length,a=e.length,l=a,c=r(a),u=1/0,d=[];l--;){var h=e[l];l&&t&&(h=Ot(h,Wt(t))),u=yn(h.length,u),c[l]=!n&&(t||s>=120&&h.length>=120)?new Yn(l&&h):i}h=e[0];var p=-1,f=c[0];e:for(;++p<s&&d.length<u;){var g=h[p],m=t?t(g):g;if(g=n||0!==g?g:0,!(f?Jt(f,m):o(d,m,n))){for(l=a;--l;){var y=c[l];if(!(y?Jt(y,m):o(e[l],m,n)))continue e}f&&f.push(m),d.push(g)}}return d}function Pr(e,t,n){var r=null==(e=Io(e,t=mi(t,e)))?e:e[Mo(Wo(t))];return null==r?i:Ct(r,e,n)}function kr(e){return ea(e)&&Cr(e)==g}function Br(e,t,n,r,o){return e===t||(null==e||null==t||!ea(e)&&!ea(t)?e!=e&&t!=t:function(e,t,n,r,o,s){var a=Ks(e),l=Ks(t),c=a?m:ho(e),u=l?m:ho(t),d=(c=c==g?E:c)==E,h=(u=u==g?E:u)==E,p=c==u;if(p&&zs(e)){if(!zs(t))return!1;a=!0,d=!1}if(p&&!d)return s||(s=new zn),a||la(e)?Xi(e,t,n,r,o,s):function(e,t,n,r,i,o,s){switch(n){case N:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case O:return!(e.byteLength!=t.byteLength||!o(new Ve(e),new Ve(t)));case y:case v:case C:return Ls(+e,+t);case A:return e.name==t.name&&e.message==t.message;case _:case P:return e==t+"";case S:var a=on;case x:var l=1&r;if(a||(a=ln),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=2,s.set(e,t);var u=Xi(a(e),a(t),r,i,o,s);return s.delete(e),u;case k:if(Mn)return Mn.call(e)==Mn.call(t)}return!1}(e,t,c,n,r,o,s);if(!(1&n)){var f=d&&De.call(e,"__wrapped__"),b=h&&De.call(t,"__wrapped__");if(f||b){var w=f?e.value():e,I=b?t.value():t;return s||(s=new zn),o(w,I,n,r,s)}}return!!p&&(s||(s=new zn),function(e,t,n,r,o,s){var a=1&n,l=eo(e),c=l.length;if(c!=eo(t).length&&!a)return!1;for(var u=c;u--;){var d=l[u];if(!(a?d in t:De.call(t,d)))return!1}var h=s.get(e),p=s.get(t);if(h&&p)return h==t&&p==e;var f=!0;s.set(e,t),s.set(t,e);for(var g=a;++u<c;){var m=e[d=l[u]],y=t[d];if(r)var v=a?r(y,m,d,t,e,s):r(m,y,d,e,t,s);if(!(v===i?m===y||o(m,y,n,r,s):v)){f=!1;break}g||(g="constructor"==d)}if(f&&!g){var A=e.constructor,b=t.constructor;A==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof A&&A instanceof A&&"function"==typeof b&&b instanceof b||(f=!1)}return s.delete(e),s.delete(t),f}(e,t,n,r,o,s))}(e,t,n,r,Br,o))}function Or(e,t,n,r){var o=n.length,s=o,a=!r;if(null==e)return!s;for(e=Ee(e);o--;){var l=n[o];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<s;){var c=(l=n[o])[0],u=e[c],d=l[1];if(a&&l[2]){if(u===i&&!(c in e))return!1}else{var h=new zn;if(r)var p=r(u,d,c,e,t,h);if(!(p===i?Br(d,u,3,r,h):p))return!1}}return!0}function Nr(e){return!(!$s(e)||(t=e,Te&&Te in t))&&(qs(e)?Le:ge).test(Fo(e));var t}function Dr(e){return"function"==typeof e?e:null==e?nl:"object"==typeof e?Ks(e)?Rr(e[0],e[1]):Fr(e):dl(e)}function jr(e){if(!wo(e))return gn(e);var t=[];for(var n in Ee(e))De.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Tr(e,t){return e<t}function Mr(e,t){var n=-1,i=Gs(e)?r(e.length):[];return ur(e,(function(e,r,o){i[++n]=t(e,r,o)})),i}function Fr(e){var t=ao(e);return 1==t.length&&t[0][2]?Co(t[0][0],t[0][1]):function(n){return n===e||Or(n,e,t)}}function Rr(e,t){return vo(e)&&So(t)?Co(Mo(e),t):function(n){var r=Ia(n,e);return r===i&&r===t?_a(n,e):Br(t,r,3)}}function Lr(e,t,n,r,o){e!==t&&mr(t,(function(s,a){if(o||(o=new zn),$s(s))!function(e,t,n,r,o,s,a){var l=_o(e,n),c=_o(t,n),u=a.get(c);if(u)Xn(e,n,u);else{var d=s?s(l,c,n+"",e,t,a):i,h=d===i;if(h){var p=Ks(c),f=!p&&zs(c),g=!p&&!f&&la(c);d=c,p||f||g?Ks(l)?d=l:Ys(l)?d=_i(l):f?(h=!1,d=bi(c,!0)):g?(h=!1,d=Si(c,!0)):d=[]:ra(c)||Vs(c)?(d=l,Vs(l)?d=ma(l):$s(l)&&!qs(l)||(d=fo(c))):h=!1}h&&(a.set(c,d),o(d,c,r,s,a),a.delete(c)),Xn(e,n,d)}}(e,t,a,n,Lr,r,o);else{var l=r?r(_o(e,a),s,a+"",e,t,o):i;l===i&&(l=s),Xn(e,a,l)}}),Oa)}function Qr(e,t){var n=e.length;if(n)return mo(t+=t<0?n:0,n)?e[t]:i}function Ur(e,t,n){t=t.length?Ot(t,(function(e){return Ks(e)?function(t){return wr(t,1===e.length?e[0]:e)}:e})):[nl];var r=-1;t=Ot(t,Wt(oo()));var i=Mr(e,(function(e,n,i){var o=Ot(t,(function(t){return t(e)}));return{criteria:o,index:++r,value:e}}));return function(e,t){var r=e.length;for(e.sort((function(e,t){return function(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,s=i.length,a=n.length;++r<s;){var l=Ci(i[r],o[r]);if(l)return r>=a?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}));r--;)e[r]=e[r].value;return e}(i)}function Vr(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var s=t[r],a=wr(e,s);n(a,s)&&qr(o,mi(s,e),a)}return o}function Kr(e,t,n,r){var i=r?Qt:Lt,o=-1,s=t.length,a=e;for(e===t&&(t=_i(t)),n&&(a=Ot(e,Wt(n)));++o<s;)for(var l=0,c=t[o],u=n?n(c):c;(l=i(a,u,l,r))>-1;)a!==e&&ze.call(a,l,1),ze.call(e,l,1);return e}function Hr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;mo(i)?ze.call(e,i,1):li(e,i)}}return e}function Gr(e,t){return e+pt(bn()*(t-e+1))}function Yr(e,t){var n="";if(!e||t<1||t>d)return n;do{t%2&&(n+=e),(t=pt(t/2))&&(e+=e)}while(t);return n}function zr(e,t){return ko(Eo(e,t,nl),e+"")}function Zr(e){return Wn(La(e))}function Wr(e,t){var n=La(e);return No(n,or(t,0,n.length))}function qr(e,t,n,r){if(!$s(e))return e;for(var o=-1,s=(t=mi(t,e)).length,a=s-1,l=e;null!=l&&++o<s;){var c=Mo(t[o]),u=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var d=l[c];(u=r?r(d,c,l):i)===i&&(u=$s(d)?d:mo(t[o+1])?[]:{})}$n(l,c,u),l=l[c]}return e}var Jr=Pn?function(e,t){return Pn.set(e,t),e}:nl,Xr=et?function(e,t){return et(e,"toString",{configurable:!0,enumerable:!1,value:$a(t),writable:!0})}:nl;function $r(e){return No(La(e))}function ei(e,t,n){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var s=r(o);++i<o;)s[i]=e[i+t];return s}function ti(e,t){var n;return ur(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n}function ni(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var o=r+i>>>1,s=e[o];null!==s&&!aa(s)&&(n?s<=t:s<t)?r=o+1:i=o}return i}return ri(e,t,nl,n)}function ri(e,t,n,r){var o=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(t=n(t))!=t,l=null===t,c=aa(t),u=t===i;o<s;){var d=pt((o+s)/2),h=n(e[d]),p=h!==i,f=null===h,g=h==h,m=aa(h);if(a)var y=r||g;else y=u?g&&(r||p):l?g&&p&&(r||!f):c?g&&p&&!f&&(r||!m):!f&&!m&&(r?h<=t:h<t);y?o=d+1:s=d}return yn(s,4294967294)}function ii(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n],a=t?t(s):s;if(!n||!Ls(a,l)){var l=a;o[i++]=0===s?0:s}}return o}function oi(e){return"number"==typeof e?e:aa(e)?h:+e}function si(e){if("string"==typeof e)return e;if(Ks(e))return Ot(e,si)+"";if(aa(e))return Fn?Fn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ai(e,t,n){var r=-1,i=kt,o=e.length,s=!0,a=[],l=a;if(n)s=!1,i=Bt;else if(o>=200){var c=t?null:Yi(e);if(c)return ln(c);s=!1,i=Jt,l=new Yn}else l=t?[]:a;e:for(;++r<o;){var u=e[r],d=t?t(u):u;if(u=n||0!==u?u:0,s&&d==d){for(var h=l.length;h--;)if(l[h]===d)continue e;t&&l.push(d),a.push(u)}else i(l,d,n)||(l!==a&&l.push(d),a.push(u))}return a}function li(e,t){return null==(e=Io(e,t=mi(t,e)))||delete e[Mo(Wo(t))]}function ci(e,t,n,r){return qr(e,t,n(wr(e,t)),r)}function ui(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?ei(e,r?0:o,r?o+1:i):ei(e,r?o+1:0,r?i:o)}function di(e,t){var n=e;return n instanceof Vn&&(n=n.value()),Dt(t,(function(e,t){return t.func.apply(t.thisArg,Nt([e],t.args))}),n)}function hi(e,t,n){var i=e.length;if(i<2)return i?ai(e[0]):[];for(var o=-1,s=r(i);++o<i;)for(var a=e[o],l=-1;++l<i;)l!=o&&(s[o]=cr(s[o]||a,e[l],t,n));return ai(gr(s,1),t,n)}function pi(e,t,n){for(var r=-1,o=e.length,s=t.length,a={};++r<o;){var l=r<s?t[r]:i;n(a,e[r],l)}return a}function fi(e){return Ys(e)?e:[]}function gi(e){return"function"==typeof e?e:nl}function mi(e,t){return Ks(e)?e:vo(e,t)?[e]:To(ya(e))}var yi=zr;function vi(e,t,n){var r=e.length;return n=n===i?r:n,!t&&n>=r?e:ei(e,t,n)}var Ai=st||function(e){return dt.clearTimeout(e)};function bi(e,t){if(t)return e.slice();var n=e.length,r=Ke?Ke(n):new e.constructor(n);return e.copy(r),r}function wi(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function Si(e,t){var n=t?wi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ci(e,t){if(e!==t){var n=e!==i,r=null===e,o=e==e,s=aa(e),a=t!==i,l=null===t,c=t==t,u=aa(t);if(!l&&!u&&!s&&e>t||s&&a&&c&&!l&&!u||r&&a&&c||!n&&c||!o)return 1;if(!r&&!s&&!u&&e<t||u&&n&&o&&!r&&!s||l&&n&&o||!a&&o||!c)return-1}return 0}function Ei(e,t,n,i){for(var o=-1,s=e.length,a=n.length,l=-1,c=t.length,u=mn(s-a,0),d=r(c+u),h=!i;++l<c;)d[l]=t[l];for(;++o<a;)(h||o<s)&&(d[n[o]]=e[o]);for(;u--;)d[l++]=e[o++];return d}function Ii(e,t,n,i){for(var o=-1,s=e.length,a=-1,l=n.length,c=-1,u=t.length,d=mn(s-l,0),h=r(d+u),p=!i;++o<d;)h[o]=e[o];for(var f=o;++c<u;)h[f+c]=t[c];for(;++a<l;)(p||o<s)&&(h[f+n[a]]=e[o++]);return h}function _i(e,t){var n=-1,i=e.length;for(t||(t=r(i));++n<i;)t[n]=e[n];return t}function xi(e,t,n,r){var o=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var l=t[s],c=r?r(n[l],e[l],l,n,e):i;c===i&&(c=e[l]),o?rr(n,l,c):$n(n,l,c)}return n}function Pi(e,t){return function(n,r){var i=Ks(n)?Et:tr,o=t?t():{};return i(n,e,oo(r,2),o)}}function ki(e){return zr((function(t,n){var r=-1,o=n.length,s=o>1?n[o-1]:i,a=o>2?n[2]:i;for(s=e.length>3&&"function"==typeof s?(o--,s):i,a&&yo(n[0],n[1],a)&&(s=o<3?i:s,o=1),t=Ee(t);++r<o;){var l=n[r];l&&e(t,l,r,s)}return t}))}function Bi(e,t){return function(n,r){if(null==n)return n;if(!Gs(n))return e(n,r);for(var i=n.length,o=t?i:-1,s=Ee(n);(t?o--:++o<i)&&!1!==r(s[o],o,s););return n}}function Oi(e){return function(t,n,r){for(var i=-1,o=Ee(t),s=r(t),a=s.length;a--;){var l=s[e?a:++i];if(!1===n(o[l],l,o))break}return t}}function Ni(e){return function(t){var n=rn(t=ya(t))?dn(t):i,r=n?n[0]:t.charAt(0),o=n?vi(n,1).join(""):t.slice(1);return r[e]()+o}}function Di(e){return function(t){return Dt(qa(Va(t).replace(qe,"")),e,"")}}function ji(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Ln(e.prototype),r=e.apply(n,t);return $s(r)?r:n}}function Ti(e){return function(t,n,r){var o=Ee(t);if(!Gs(t)){var s=oo(n,3);t=Ba(t),n=function(e){return s(o[e],e,o)}}var a=e(t,n,r);return a>-1?o[s?t[a]:a]:i}}function Mi(e){return $i((function(t){var n=t.length,r=n,s=Un.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new xe(o);if(s&&!l&&"wrapper"==ro(a))var l=new Un([],!0)}for(r=l?r:n;++r<n;){var c=ro(a=t[r]),u="wrapper"==c?no(a):i;l=u&&Ao(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[ro(u[0])].apply(l,u[3]):1==a.length&&Ao(a)?l[c]():l.thru(a)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&Ks(r))return l.plant(r).value();for(var i=0,o=n?t[i].apply(this,e):r;++i<n;)o=t[i].call(this,o);return o}}))}function Fi(e,t,n,o,s,a,l,u,d,h){var p=t&c,f=1&t,g=2&t,m=24&t,y=512&t,v=g?i:ji(e);return function c(){for(var A=arguments.length,b=r(A),w=A;w--;)b[w]=arguments[w];if(m)var S=io(c),C=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(b,S);if(o&&(b=Ei(b,o,s,m)),a&&(b=Ii(b,a,l,m)),A-=C,m&&A<h){var E=an(b,S);return Hi(e,t,Fi,c.placeholder,n,b,E,u,d,h-A)}var I=f?n:this,_=g?I[e]:e;return A=b.length,u?b=function(e,t){for(var n=e.length,r=yn(t.length,n),o=_i(e);r--;){var s=t[r];e[r]=mo(s,n)?o[s]:i}return e}(b,u):y&&A>1&&b.reverse(),p&&d<A&&(b.length=d),this&&this!==dt&&this instanceof c&&(_=v||ji(_)),_.apply(I,b)}}function Ri(e,t){return function(n,r){return function(e,t,n,r){return vr(e,(function(e,i,o){t(r,n(e),i,o)})),r}(n,e,t(r),{})}}function Li(e,t){return function(n,r){var o;if(n===i&&r===i)return t;if(n!==i&&(o=n),r!==i){if(o===i)return r;"string"==typeof n||"string"==typeof r?(n=si(n),r=si(r)):(n=oi(n),r=oi(r)),o=e(n,r)}return o}}function Qi(e){return $i((function(t){return t=Ot(t,Wt(oo())),zr((function(n){var r=this;return e(t,(function(e){return Ct(e,r,n)}))}))}))}function Ui(e,t){var n=(t=t===i?" ":si(t)).length;if(n<2)return n?Yr(t,e):t;var r=Yr(t,ht(e/un(t)));return rn(t)?vi(dn(r),0,e).join(""):r.slice(0,e)}function Vi(e){return function(t,n,o){return o&&"number"!=typeof o&&yo(t,n,o)&&(n=o=i),t=ha(t),n===i?(n=t,t=0):n=ha(n),function(e,t,n,i){for(var o=-1,s=mn(ht((t-e)/(n||1)),0),a=r(s);s--;)a[i?s:++o]=e,e+=n;return a}(t,n,o=o===i?t<n?1:-1:ha(o),e)}}function Ki(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ga(t),n=ga(n)),e(t,n)}}function Hi(e,t,n,r,o,s,a,c,u,d){var h=8&t;t|=h?l:64,4&(t&=~(h?64:l))||(t&=-4);var p=[e,t,o,h?s:i,h?a:i,h?i:s,h?i:a,c,u,d],f=n.apply(i,p);return Ao(e)&&xo(f,p),f.placeholder=r,Bo(f,e,t)}function Gi(e){var t=Ce[e];return function(e,n){if(e=ga(e),(n=null==n?0:yn(pa(n),292))&&Mt(e)){var r=(ya(e)+"e").split("e");return+((r=(ya(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Yi=In&&1/ln(new In([,-0]))[1]==u?function(e){return new In(e)}:al;function zi(e){return function(t){var n=ho(t);return n==S?on(t):n==x?cn(t):function(e,t){return Ot(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Zi(e,t,n,s,u,d,h,p){var f=2&t;if(!f&&"function"!=typeof e)throw new xe(o);var g=s?s.length:0;if(g||(t&=-97,s=u=i),h=h===i?h:mn(pa(h),0),p=p===i?p:pa(p),g-=u?u.length:0,64&t){var m=s,y=u;s=u=i}var v=f?i:no(e),A=[e,t,n,s,u,m,y,d,h,p];if(v&&function(e,t){var n=e[1],r=t[1],i=n|r,o=i<131,s=r==c&&8==n||r==c&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!o&&!s)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var l=t[3];if(l){var u=e[3];e[3]=u?Ei(u,l,t[4]):l,e[4]=u?an(e[3],a):t[4]}(l=t[5])&&(u=e[5],e[5]=u?Ii(u,l,t[6]):l,e[6]=u?an(e[5],a):t[6]),(l=t[7])&&(e[7]=l),r&c&&(e[8]=null==e[8]?t[8]:yn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(A,v),e=A[0],t=A[1],n=A[2],s=A[3],u=A[4],!(p=A[9]=A[9]===i?f?0:e.length:mn(A[9]-g,0))&&24&t&&(t&=-25),t&&1!=t)b=8==t||16==t?function(e,t,n){var o=ji(e);return function s(){for(var a=arguments.length,l=r(a),c=a,u=io(s);c--;)l[c]=arguments[c];var d=a<3&&l[0]!==u&&l[a-1]!==u?[]:an(l,u);return(a-=d.length)<n?Hi(e,t,Fi,s.placeholder,i,l,d,i,i,n-a):Ct(this&&this!==dt&&this instanceof s?o:e,this,l)}}(e,t,p):t!=l&&33!=t||u.length?Fi.apply(i,A):function(e,t,n,i){var o=1&t,s=ji(e);return function t(){for(var a=-1,l=arguments.length,c=-1,u=i.length,d=r(u+l),h=this&&this!==dt&&this instanceof t?s:e;++c<u;)d[c]=i[c];for(;l--;)d[c++]=arguments[++a];return Ct(h,o?n:this,d)}}(e,t,n,s);else var b=function(e,t,n){var r=1&t,i=ji(e);return function t(){return(this&&this!==dt&&this instanceof t?i:e).apply(r?n:this,arguments)}}(e,t,n);return Bo((v?Jr:xo)(b,A),e,t)}function Wi(e,t,n,r){return e===i||Ls(e,Be[n])&&!De.call(r,n)?t:e}function qi(e,t,n,r,o,s){return $s(e)&&$s(t)&&(s.set(t,e),Lr(e,t,i,qi,s),s.delete(t)),e}function Ji(e){return ra(e)?i:e}function Xi(e,t,n,r,o,s){var a=1&n,l=e.length,c=t.length;if(l!=c&&!(a&&c>l))return!1;var u=s.get(e),d=s.get(t);if(u&&d)return u==t&&d==e;var h=-1,p=!0,f=2&n?new Yn:i;for(s.set(e,t),s.set(t,e);++h<l;){var g=e[h],m=t[h];if(r)var y=a?r(m,g,h,t,e,s):r(g,m,h,e,t,s);if(y!==i){if(y)continue;p=!1;break}if(f){if(!Tt(t,(function(e,t){if(!Jt(f,t)&&(g===e||o(g,e,n,r,s)))return f.push(t)}))){p=!1;break}}else if(g!==m&&!o(g,m,n,r,s)){p=!1;break}}return s.delete(e),s.delete(t),p}function $i(e){return ko(Eo(e,i,Ho),e+"")}function eo(e){return Sr(e,Ba,co)}function to(e){return Sr(e,Oa,uo)}var no=Pn?function(e){return Pn.get(e)}:al;function ro(e){for(var t=e.name+"",n=kn[t],r=De.call(kn,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function io(e){return(De.call(Rn,"placeholder")?Rn:e).placeholder}function oo(){var e=Rn.iteratee||rl;return e=e===rl?Dr:e,arguments.length?e(arguments[0],arguments[1]):e}function so(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function ao(e){for(var t=Ba(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,So(i)]}return t}function lo(e,t){var n=function(e,t){return null==e?i:e[t]}(e,t);return Nr(n)?n:i}var co=gt?function(e){return null==e?[]:(e=Ee(e),Pt(gt(e),(function(t){return Ye.call(e,t)})))}:fl,uo=gt?function(e){for(var t=[];e;)Nt(t,co(e)),e=He(e);return t}:fl,ho=Cr;function po(e,t,n){for(var r=-1,i=(t=mi(t,e)).length,o=!1;++r<i;){var s=Mo(t[r]);if(!(o=null!=e&&n(e,s)))break;e=e[s]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Xs(i)&&mo(s,i)&&(Ks(e)||Vs(e))}function fo(e){return"function"!=typeof e.constructor||wo(e)?{}:Ln(He(e))}function go(e){return Ks(e)||Vs(e)||!!(Ze&&e&&e[Ze])}function mo(e,t){var n=typeof e;return!!(t=null==t?d:t)&&("number"==n||"symbol"!=n&&ye.test(e))&&e>-1&&e%1==0&&e<t}function yo(e,t,n){if(!$s(n))return!1;var r=typeof t;return!!("number"==r?Gs(n)&&mo(t,n.length):"string"==r&&t in n)&&Ls(n[t],e)}function vo(e,t){if(Ks(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!aa(e))||$.test(e)||!X.test(e)||null!=t&&e in Ee(t)}function Ao(e){var t=ro(e),n=Rn[t];if("function"!=typeof n||!(t in Vn.prototype))return!1;if(e===n)return!0;var r=no(n);return!!r&&e===r[0]}(Sn&&ho(new Sn(new ArrayBuffer(1)))!=N||Cn&&ho(new Cn)!=S||En&&ho(En.resolve())!=I||In&&ho(new In)!=x||_n&&ho(new _n)!=B)&&(ho=function(e){var t=Cr(e),n=t==E?e.constructor:i,r=n?Fo(n):"";if(r)switch(r){case Bn:return N;case On:return S;case Nn:return I;case Dn:return x;case jn:return B}return t});var bo=Oe?qs:gl;function wo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Be)}function So(e){return e==e&&!$s(e)}function Co(e,t){return function(n){return null!=n&&n[e]===t&&(t!==i||e in Ee(n))}}function Eo(e,t,n){return t=mn(t===i?e.length-1:t,0),function(){for(var i=arguments,o=-1,s=mn(i.length-t,0),a=r(s);++o<s;)a[o]=i[t+o];o=-1;for(var l=r(t+1);++o<t;)l[o]=i[o];return l[t]=n(a),Ct(e,this,l)}}function Io(e,t){return t.length<2?e:wr(e,ei(t,0,-1))}function _o(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var xo=Oo(Jr),Po=ut||function(e,t){return dt.setTimeout(e,t)},ko=Oo(Xr);function Bo(e,t,n){var r=t+"";return ko(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return It(f,(function(n){var r="_."+n[0];t&n[1]&&!kt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(se);return t?t[1].split(ae):[]}(r),n)))}function Oo(e){var t=0,n=0;return function(){var r=vn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function No(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n<t;){var s=Gr(n,o),a=e[s];e[s]=e[n],e[n]=a}return e.length=t,e}var Do,jo,To=(Do=Ds((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ee,(function(e,n,r,i){t.push(r?i.replace(ue,"$1"):n||e)})),t}),(function(e){return 500===jo.size&&jo.clear(),e})),jo=Do.cache,Do);function Mo(e){if("string"==typeof e||aa(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Fo(e){if(null!=e){try{return Ne.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ro(e){if(e instanceof Vn)return e.clone();var t=new Un(e.__wrapped__,e.__chain__);return t.__actions__=_i(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Lo=zr((function(e,t){return Ys(e)?cr(e,gr(t,1,Ys,!0)):[]})),Qo=zr((function(e,t){var n=Wo(t);return Ys(n)&&(n=i),Ys(e)?cr(e,gr(t,1,Ys,!0),oo(n,2)):[]})),Uo=zr((function(e,t){var n=Wo(t);return Ys(n)&&(n=i),Ys(e)?cr(e,gr(t,1,Ys,!0),i,n):[]}));function Vo(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:pa(n);return i<0&&(i=mn(r+i,0)),Rt(e,oo(t,3),i)}function Ko(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r-1;return n!==i&&(o=pa(n),o=n<0?mn(r+o,0):yn(o,r-1)),Rt(e,oo(t,3),o,!0)}function Ho(e){return null!=e&&e.length?gr(e,1):[]}function Go(e){return e&&e.length?e[0]:i}var Yo=zr((function(e){var t=Ot(e,fi);return t.length&&t[0]===e[0]?xr(t):[]})),zo=zr((function(e){var t=Wo(e),n=Ot(e,fi);return t===Wo(n)?t=i:n.pop(),n.length&&n[0]===e[0]?xr(n,oo(t,2)):[]})),Zo=zr((function(e){var t=Wo(e),n=Ot(e,fi);return(t="function"==typeof t?t:i)&&n.pop(),n.length&&n[0]===e[0]?xr(n,i,t):[]}));function Wo(e){var t=null==e?0:e.length;return t?e[t-1]:i}var qo=zr(Jo);function Jo(e,t){return e&&e.length&&t&&t.length?Kr(e,t):e}var Xo=$i((function(e,t){var n=null==e?0:e.length,r=ir(e,t);return Hr(e,Ot(t,(function(e){return mo(e,n)?+e:e})).sort(Ci)),r}));function $o(e){return null==e?e:wn.call(e)}var es=zr((function(e){return ai(gr(e,1,Ys,!0))})),ts=zr((function(e){var t=Wo(e);return Ys(t)&&(t=i),ai(gr(e,1,Ys,!0),oo(t,2))})),ns=zr((function(e){var t=Wo(e);return t="function"==typeof t?t:i,ai(gr(e,1,Ys,!0),i,t)}));function rs(e){if(!e||!e.length)return[];var t=0;return e=Pt(e,(function(e){if(Ys(e))return t=mn(e.length,t),!0})),zt(t,(function(t){return Ot(e,Kt(t))}))}function is(e,t){if(!e||!e.length)return[];var n=rs(e);return null==t?n:Ot(n,(function(e){return Ct(t,i,e)}))}var os=zr((function(e,t){return Ys(e)?cr(e,t):[]})),ss=zr((function(e){return hi(Pt(e,Ys))})),as=zr((function(e){var t=Wo(e);return Ys(t)&&(t=i),hi(Pt(e,Ys),oo(t,2))})),ls=zr((function(e){var t=Wo(e);return t="function"==typeof t?t:i,hi(Pt(e,Ys),i,t)})),cs=zr(rs),us=zr((function(e){var t=e.length,n=t>1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,is(e,n)}));function ds(e){var t=Rn(e);return t.__chain__=!0,t}function hs(e,t){return t(e)}var ps=$i((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return ir(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Vn&&mo(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:hs,args:[o],thisArg:i}),new Un(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)})),fs=Pi((function(e,t,n){De.call(e,n)?++e[n]:rr(e,n,1)})),gs=Ti(Vo),ms=Ti(Ko);function ys(e,t){return(Ks(e)?It:ur)(e,oo(t,3))}function vs(e,t){return(Ks(e)?_t:dr)(e,oo(t,3))}var As=Pi((function(e,t,n){De.call(e,n)?e[n].push(t):rr(e,n,[t])})),bs=zr((function(e,t,n){var i=-1,o="function"==typeof t,s=Gs(e)?r(e.length):[];return ur(e,(function(e){s[++i]=o?Ct(t,e,n):Pr(e,t,n)})),s})),ws=Pi((function(e,t,n){rr(e,n,t)}));function Ss(e,t){return(Ks(e)?Ot:Mr)(e,oo(t,3))}var Cs=Pi((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]})),Es=zr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&yo(e,t[0],t[1])?t=[]:n>2&&yo(t[0],t[1],t[2])&&(t=[t[0]]),Ur(e,gr(t,1),[])})),Is=ct||function(){return dt.Date.now()};function _s(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Zi(e,c,i,i,i,i,t)}function xs(e,t){var n;if("function"!=typeof t)throw new xe(o);return e=pa(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var Ps=zr((function(e,t,n){var r=1;if(n.length){var i=an(n,io(Ps));r|=l}return Zi(e,r,t,n,i)})),ks=zr((function(e,t,n){var r=3;if(n.length){var i=an(n,io(ks));r|=l}return Zi(t,r,e,n,i)}));function Bs(e,t,n){var r,s,a,l,c,u,d=0,h=!1,p=!1,f=!0;if("function"!=typeof e)throw new xe(o);function g(t){var n=r,o=s;return r=s=i,d=t,l=e.apply(o,n)}function m(e){var n=e-u;return u===i||n>=t||n<0||p&&e-d>=a}function y(){var e=Is();if(m(e))return v(e);c=Po(y,function(e){var n=t-(e-u);return p?yn(n,a-(e-d)):n}(e))}function v(e){return c=i,f&&r?g(e):(r=s=i,l)}function A(){var e=Is(),n=m(e);if(r=arguments,s=this,u=e,n){if(c===i)return function(e){return d=e,c=Po(y,t),h?g(e):l}(u);if(p)return Ai(c),c=Po(y,t),g(u)}return c===i&&(c=Po(y,t)),l}return t=ga(t)||0,$s(n)&&(h=!!n.leading,a=(p="maxWait"in n)?mn(ga(n.maxWait)||0,t):a,f="trailing"in n?!!n.trailing:f),A.cancel=function(){c!==i&&Ai(c),d=0,r=u=s=c=i},A.flush=function(){return c===i?l:v(Is())},A}var Os=zr((function(e,t){return lr(e,1,t)})),Ns=zr((function(e,t,n){return lr(e,ga(t)||0,n)}));function Ds(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new xe(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Ds.Cache||Gn),n}function js(e){if("function"!=typeof e)throw new xe(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ds.Cache=Gn;var Ts=yi((function(e,t){var n=(t=1==t.length&&Ks(t[0])?Ot(t[0],Wt(oo())):Ot(gr(t,1),Wt(oo()))).length;return zr((function(r){for(var i=-1,o=yn(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return Ct(e,this,r)}))})),Ms=zr((function(e,t){var n=an(t,io(Ms));return Zi(e,l,i,t,n)})),Fs=zr((function(e,t){var n=an(t,io(Fs));return Zi(e,64,i,t,n)})),Rs=$i((function(e,t){return Zi(e,256,i,i,i,t)}));function Ls(e,t){return e===t||e!=e&&t!=t}var Qs=Ki(Er),Us=Ki((function(e,t){return e>=t})),Vs=kr(function(){return arguments}())?kr:function(e){return ea(e)&&De.call(e,"callee")&&!Ye.call(e,"callee")},Ks=r.isArray,Hs=yt?Wt(yt):function(e){return ea(e)&&Cr(e)==O};function Gs(e){return null!=e&&Xs(e.length)&&!qs(e)}function Ys(e){return ea(e)&&Gs(e)}var zs=mt||gl,Zs=vt?Wt(vt):function(e){return ea(e)&&Cr(e)==v};function Ws(e){if(!ea(e))return!1;var t=Cr(e);return t==A||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ra(e)}function qs(e){if(!$s(e))return!1;var t=Cr(e);return t==b||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Js(e){return"number"==typeof e&&e==pa(e)}function Xs(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=d}function $s(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ea(e){return null!=e&&"object"==typeof e}var ta=At?Wt(At):function(e){return ea(e)&&ho(e)==S};function na(e){return"number"==typeof e||ea(e)&&Cr(e)==C}function ra(e){if(!ea(e)||Cr(e)!=E)return!1;var t=He(e);if(null===t)return!0;var n=De.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ne.call(n)==Fe}var ia=bt?Wt(bt):function(e){return ea(e)&&Cr(e)==_},oa=wt?Wt(wt):function(e){return ea(e)&&ho(e)==x};function sa(e){return"string"==typeof e||!Ks(e)&&ea(e)&&Cr(e)==P}function aa(e){return"symbol"==typeof e||ea(e)&&Cr(e)==k}var la=St?Wt(St):function(e){return ea(e)&&Xs(e.length)&&!!it[Cr(e)]},ca=Ki(Tr),ua=Ki((function(e,t){return e<=t}));function da(e){if(!e)return[];if(Gs(e))return sa(e)?dn(e):_i(e);if(We&&e[We])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[We]());var t=ho(e);return(t==S?on:t==x?ln:La)(e)}function ha(e){return e?(e=ga(e))===u||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function pa(e){var t=ha(e),n=t%1;return t==t?n?t-n:t:0}function fa(e){return e?or(pa(e),0,p):0}function ga(e){if("number"==typeof e)return e;if(aa(e))return h;if($s(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=$s(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Zt(e);var n=fe.test(e);return n||me.test(e)?lt(e.slice(2),n?2:8):pe.test(e)?h:+e}function ma(e){return xi(e,Oa(e))}function ya(e){return null==e?"":si(e)}var va=ki((function(e,t){if(wo(t)||Gs(t))xi(t,Ba(t),e);else for(var n in t)De.call(t,n)&&$n(e,n,t[n])})),Aa=ki((function(e,t){xi(t,Oa(t),e)})),ba=ki((function(e,t,n,r){xi(t,Oa(t),e,r)})),wa=ki((function(e,t,n,r){xi(t,Ba(t),e,r)})),Sa=$i(ir),Ca=zr((function(e,t){e=Ee(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&yo(t[0],t[1],o)&&(r=1);++n<r;)for(var s=t[n],a=Oa(s),l=-1,c=a.length;++l<c;){var u=a[l],d=e[u];(d===i||Ls(d,Be[u])&&!De.call(e,u))&&(e[u]=s[u])}return e})),Ea=zr((function(e){return e.push(i,qi),Ct(Da,i,e)}));function Ia(e,t,n){var r=null==e?i:wr(e,t);return r===i?n:r}function _a(e,t){return null!=e&&po(e,t,_r)}var xa=Ri((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Me.call(t)),e[t]=n}),$a(nl)),Pa=Ri((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Me.call(t)),De.call(e,t)?e[t].push(n):e[t]=[n]}),oo),ka=zr(Pr);function Ba(e){return Gs(e)?Zn(e):jr(e)}function Oa(e){return Gs(e)?Zn(e,!0):function(e){if(!$s(e))return function(e){var t=[];if(null!=e)for(var n in Ee(e))t.push(n);return t}(e);var t=wo(e),n=[];for(var r in e)("constructor"!=r||!t&&De.call(e,r))&&n.push(r);return n}(e)}var Na=ki((function(e,t,n){Lr(e,t,n)})),Da=ki((function(e,t,n,r){Lr(e,t,n,r)})),ja=$i((function(e,t){var n={};if(null==e)return n;var r=!1;t=Ot(t,(function(t){return t=mi(t,e),r||(r=t.length>1),t})),xi(e,to(e),n),r&&(n=sr(n,7,Ji));for(var i=t.length;i--;)li(n,t[i]);return n})),Ta=$i((function(e,t){return null==e?{}:function(e,t){return Vr(e,t,(function(t,n){return _a(e,n)}))}(e,t)}));function Ma(e,t){if(null==e)return{};var n=Ot(to(e),(function(e){return[e]}));return t=oo(t),Vr(e,n,(function(e,n){return t(e,n[0])}))}var Fa=zi(Ba),Ra=zi(Oa);function La(e){return null==e?[]:qt(e,Ba(e))}var Qa=Di((function(e,t,n){return t=t.toLowerCase(),e+(n?Ua(t):t)}));function Ua(e){return Wa(ya(e).toLowerCase())}function Va(e){return(e=ya(e))&&e.replace(ve,en).replace(Je,"")}var Ka=Di((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Ha=Di((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Ga=Ni("toLowerCase"),Ya=Di((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()})),za=Di((function(e,t,n){return e+(n?" ":"")+Wa(t)})),Za=Di((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Wa=Ni("toUpperCase");function qa(e,t,n){return e=ya(e),(t=n?i:t)===i?function(e){return tt.test(e)}(e)?function(e){return e.match($e)||[]}(e):function(e){return e.match(le)||[]}(e):e.match(t)||[]}var Ja=zr((function(e,t){try{return Ct(e,i,t)}catch(e){return Ws(e)?e:new we(e)}})),Xa=$i((function(e,t){return It(t,(function(t){t=Mo(t),rr(e,t,Ps(e[t],e))})),e}));function $a(e){return function(){return e}}var el=Mi(),tl=Mi(!0);function nl(e){return e}function rl(e){return Dr("function"==typeof e?e:sr(e,1))}var il=zr((function(e,t){return function(n){return Pr(n,e,t)}})),ol=zr((function(e,t){return function(n){return Pr(e,n,t)}}));function sl(e,t,n){var r=Ba(t),i=br(t,r);null!=n||$s(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=br(t,Ba(t)));var o=!($s(n)&&"chain"in n&&!n.chain),s=qs(e);return It(i,(function(n){var r=t[n];e[n]=r,s&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=_i(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Nt([this.value()],arguments))})})),e}function al(){}var ll=Qi(Ot),cl=Qi(xt),ul=Qi(Tt);function dl(e){return vo(e)?Kt(Mo(e)):function(e){return function(t){return wr(t,e)}}(e)}var hl=Vi(),pl=Vi(!0);function fl(){return[]}function gl(){return!1}var ml,yl=Li((function(e,t){return e+t}),0),vl=Gi("ceil"),Al=Li((function(e,t){return e/t}),1),bl=Gi("floor"),wl=Li((function(e,t){return e*t}),1),Sl=Gi("round"),Cl=Li((function(e,t){return e-t}),0);return Rn.after=function(e,t){if("function"!=typeof t)throw new xe(o);return e=pa(e),function(){if(--e<1)return t.apply(this,arguments)}},Rn.ary=_s,Rn.assign=va,Rn.assignIn=Aa,Rn.assignInWith=ba,Rn.assignWith=wa,Rn.at=Sa,Rn.before=xs,Rn.bind=Ps,Rn.bindAll=Xa,Rn.bindKey=ks,Rn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ks(e)?e:[e]},Rn.chain=ds,Rn.chunk=function(e,t,n){t=(n?yo(e,t,n):t===i)?1:mn(pa(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var s=0,a=0,l=r(ht(o/t));s<o;)l[a++]=ei(e,s,s+=t);return l},Rn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},Rn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],i=e;i--;)t[i-1]=arguments[i];return Nt(Ks(n)?_i(n):[n],gr(t,1))},Rn.cond=function(e){var t=null==e?0:e.length,n=oo();return e=t?Ot(e,(function(e){if("function"!=typeof e[1])throw new xe(o);return[n(e[0]),e[1]]})):[],zr((function(n){for(var r=-1;++r<t;){var i=e[r];if(Ct(i[0],this,n))return Ct(i[1],this,n)}}))},Rn.conforms=function(e){return function(e){var t=Ba(e);return function(n){return ar(n,e,t)}}(sr(e,1))},Rn.constant=$a,Rn.countBy=fs,Rn.create=function(e,t){var n=Ln(e);return null==t?n:nr(n,t)},Rn.curry=function e(t,n,r){var o=Zi(t,8,i,i,i,i,i,n=r?i:n);return o.placeholder=e.placeholder,o},Rn.curryRight=function e(t,n,r){var o=Zi(t,16,i,i,i,i,i,n=r?i:n);return o.placeholder=e.placeholder,o},Rn.debounce=Bs,Rn.defaults=Ca,Rn.defaultsDeep=Ea,Rn.defer=Os,Rn.delay=Ns,Rn.difference=Lo,Rn.differenceBy=Qo,Rn.differenceWith=Uo,Rn.drop=function(e,t,n){var r=null==e?0:e.length;return r?ei(e,(t=n||t===i?1:pa(t))<0?0:t,r):[]},Rn.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?ei(e,0,(t=r-(t=n||t===i?1:pa(t)))<0?0:t):[]},Rn.dropRightWhile=function(e,t){return e&&e.length?ui(e,oo(t,3),!0,!0):[]},Rn.dropWhile=function(e,t){return e&&e.length?ui(e,oo(t,3),!0):[]},Rn.fill=function(e,t,n,r){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&yo(e,t,n)&&(n=0,r=o),function(e,t,n,r){var o=e.length;for((n=pa(n))<0&&(n=-n>o?0:o+n),(r=r===i||r>o?o:pa(r))<0&&(r+=o),r=n>r?0:fa(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Rn.filter=function(e,t){return(Ks(e)?Pt:fr)(e,oo(t,3))},Rn.flatMap=function(e,t){return gr(Ss(e,t),1)},Rn.flatMapDeep=function(e,t){return gr(Ss(e,t),u)},Rn.flatMapDepth=function(e,t,n){return n=n===i?1:pa(n),gr(Ss(e,t),n)},Rn.flatten=Ho,Rn.flattenDeep=function(e){return null!=e&&e.length?gr(e,u):[]},Rn.flattenDepth=function(e,t){return null!=e&&e.length?gr(e,t=t===i?1:pa(t)):[]},Rn.flip=function(e){return Zi(e,512)},Rn.flow=el,Rn.flowRight=tl,Rn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},Rn.functions=function(e){return null==e?[]:br(e,Ba(e))},Rn.functionsIn=function(e){return null==e?[]:br(e,Oa(e))},Rn.groupBy=As,Rn.initial=function(e){return null!=e&&e.length?ei(e,0,-1):[]},Rn.intersection=Yo,Rn.intersectionBy=zo,Rn.intersectionWith=Zo,Rn.invert=xa,Rn.invertBy=Pa,Rn.invokeMap=bs,Rn.iteratee=rl,Rn.keyBy=ws,Rn.keys=Ba,Rn.keysIn=Oa,Rn.map=Ss,Rn.mapKeys=function(e,t){var n={};return t=oo(t,3),vr(e,(function(e,r,i){rr(n,t(e,r,i),e)})),n},Rn.mapValues=function(e,t){var n={};return t=oo(t,3),vr(e,(function(e,r,i){rr(n,r,t(e,r,i))})),n},Rn.matches=function(e){return Fr(sr(e,1))},Rn.matchesProperty=function(e,t){return Rr(e,sr(t,1))},Rn.memoize=Ds,Rn.merge=Na,Rn.mergeWith=Da,Rn.method=il,Rn.methodOf=ol,Rn.mixin=sl,Rn.negate=js,Rn.nthArg=function(e){return e=pa(e),zr((function(t){return Qr(t,e)}))},Rn.omit=ja,Rn.omitBy=function(e,t){return Ma(e,js(oo(t)))},Rn.once=function(e){return xs(2,e)},Rn.orderBy=function(e,t,n,r){return null==e?[]:(Ks(t)||(t=null==t?[]:[t]),Ks(n=r?i:n)||(n=null==n?[]:[n]),Ur(e,t,n))},Rn.over=ll,Rn.overArgs=Ts,Rn.overEvery=cl,Rn.overSome=ul,Rn.partial=Ms,Rn.partialRight=Fs,Rn.partition=Cs,Rn.pick=Ta,Rn.pickBy=Ma,Rn.property=dl,Rn.propertyOf=function(e){return function(t){return null==e?i:wr(e,t)}},Rn.pull=qo,Rn.pullAll=Jo,Rn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Kr(e,t,oo(n,2)):e},Rn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Kr(e,t,i,n):e},Rn.pullAt=Xo,Rn.range=hl,Rn.rangeRight=pl,Rn.rearg=Rs,Rn.reject=function(e,t){return(Ks(e)?Pt:fr)(e,js(oo(t,3)))},Rn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=oo(t,3);++r<o;){var s=e[r];t(s,r,e)&&(n.push(s),i.push(r))}return Hr(e,i),n},Rn.rest=function(e,t){if("function"!=typeof e)throw new xe(o);return zr(e,t=t===i?t:pa(t))},Rn.reverse=$o,Rn.sampleSize=function(e,t,n){return t=(n?yo(e,t,n):t===i)?1:pa(t),(Ks(e)?qn:Wr)(e,t)},Rn.set=function(e,t,n){return null==e?e:qr(e,t,n)},Rn.setWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:qr(e,t,n,r)},Rn.shuffle=function(e){return(Ks(e)?Jn:$r)(e)},Rn.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&yo(e,t,n)?(t=0,n=r):(t=null==t?0:pa(t),n=n===i?r:pa(n)),ei(e,t,n)):[]},Rn.sortBy=Es,Rn.sortedUniq=function(e){return e&&e.length?ii(e):[]},Rn.sortedUniqBy=function(e,t){return e&&e.length?ii(e,oo(t,2)):[]},Rn.split=function(e,t,n){return n&&"number"!=typeof n&&yo(e,t,n)&&(t=n=i),(n=n===i?p:n>>>0)?(e=ya(e))&&("string"==typeof t||null!=t&&!ia(t))&&!(t=si(t))&&rn(e)?vi(dn(e),0,n):e.split(t,n):[]},Rn.spread=function(e,t){if("function"!=typeof e)throw new xe(o);return t=null==t?0:mn(pa(t),0),zr((function(n){var r=n[t],i=vi(n,0,t);return r&&Nt(i,r),Ct(e,this,i)}))},Rn.tail=function(e){var t=null==e?0:e.length;return t?ei(e,1,t):[]},Rn.take=function(e,t,n){return e&&e.length?ei(e,0,(t=n||t===i?1:pa(t))<0?0:t):[]},Rn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?ei(e,(t=r-(t=n||t===i?1:pa(t)))<0?0:t,r):[]},Rn.takeRightWhile=function(e,t){return e&&e.length?ui(e,oo(t,3),!1,!0):[]},Rn.takeWhile=function(e,t){return e&&e.length?ui(e,oo(t,3)):[]},Rn.tap=function(e,t){return t(e),e},Rn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new xe(o);return $s(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Bs(e,t,{leading:r,maxWait:t,trailing:i})},Rn.thru=hs,Rn.toArray=da,Rn.toPairs=Fa,Rn.toPairsIn=Ra,Rn.toPath=function(e){return Ks(e)?Ot(e,Mo):aa(e)?[e]:_i(To(ya(e)))},Rn.toPlainObject=ma,Rn.transform=function(e,t,n){var r=Ks(e),i=r||zs(e)||la(e);if(t=oo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:$s(e)&&qs(o)?Ln(He(e)):{}}return(i?It:vr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Rn.unary=function(e){return _s(e,1)},Rn.union=es,Rn.unionBy=ts,Rn.unionWith=ns,Rn.uniq=function(e){return e&&e.length?ai(e):[]},Rn.uniqBy=function(e,t){return e&&e.length?ai(e,oo(t,2)):[]},Rn.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?ai(e,i,t):[]},Rn.unset=function(e,t){return null==e||li(e,t)},Rn.unzip=rs,Rn.unzipWith=is,Rn.update=function(e,t,n){return null==e?e:ci(e,t,gi(n))},Rn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:ci(e,t,gi(n),r)},Rn.values=La,Rn.valuesIn=function(e){return null==e?[]:qt(e,Oa(e))},Rn.without=os,Rn.words=qa,Rn.wrap=function(e,t){return Ms(gi(t),e)},Rn.xor=ss,Rn.xorBy=as,Rn.xorWith=ls,Rn.zip=cs,Rn.zipObject=function(e,t){return pi(e||[],t||[],$n)},Rn.zipObjectDeep=function(e,t){return pi(e||[],t||[],qr)},Rn.zipWith=us,Rn.entries=Fa,Rn.entriesIn=Ra,Rn.extend=Aa,Rn.extendWith=ba,sl(Rn,Rn),Rn.add=yl,Rn.attempt=Ja,Rn.camelCase=Qa,Rn.capitalize=Ua,Rn.ceil=vl,Rn.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=ga(n))==n?n:0),t!==i&&(t=(t=ga(t))==t?t:0),or(ga(e),t,n)},Rn.clone=function(e){return sr(e,4)},Rn.cloneDeep=function(e){return sr(e,5)},Rn.cloneDeepWith=function(e,t){return sr(e,5,t="function"==typeof t?t:i)},Rn.cloneWith=function(e,t){return sr(e,4,t="function"==typeof t?t:i)},Rn.conformsTo=function(e,t){return null==t||ar(e,t,Ba(t))},Rn.deburr=Va,Rn.defaultTo=function(e,t){return null==e||e!=e?t:e},Rn.divide=Al,Rn.endsWith=function(e,t,n){e=ya(e),t=si(t);var r=e.length,o=n=n===i?r:or(pa(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Rn.eq=Ls,Rn.escape=function(e){return(e=ya(e))&&Z.test(e)?e.replace(Y,tn):e},Rn.escapeRegExp=function(e){return(e=ya(e))&&ne.test(e)?e.replace(te,"\\$&"):e},Rn.every=function(e,t,n){var r=Ks(e)?xt:hr;return n&&yo(e,t,n)&&(t=i),r(e,oo(t,3))},Rn.find=gs,Rn.findIndex=Vo,Rn.findKey=function(e,t){return Ft(e,oo(t,3),vr)},Rn.findLast=ms,Rn.findLastIndex=Ko,Rn.findLastKey=function(e,t){return Ft(e,oo(t,3),Ar)},Rn.floor=bl,Rn.forEach=ys,Rn.forEachRight=vs,Rn.forIn=function(e,t){return null==e?e:mr(e,oo(t,3),Oa)},Rn.forInRight=function(e,t){return null==e?e:yr(e,oo(t,3),Oa)},Rn.forOwn=function(e,t){return e&&vr(e,oo(t,3))},Rn.forOwnRight=function(e,t){return e&&Ar(e,oo(t,3))},Rn.get=Ia,Rn.gt=Qs,Rn.gte=Us,Rn.has=function(e,t){return null!=e&&po(e,t,Ir)},Rn.hasIn=_a,Rn.head=Go,Rn.identity=nl,Rn.includes=function(e,t,n,r){e=Gs(e)?e:La(e),n=n&&!r?pa(n):0;var i=e.length;return n<0&&(n=mn(i+n,0)),sa(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Lt(e,t,n)>-1},Rn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:pa(n);return i<0&&(i=mn(r+i,0)),Lt(e,t,i)},Rn.inRange=function(e,t,n){return t=ha(t),n===i?(n=t,t=0):n=ha(n),function(e,t,n){return e>=yn(t,n)&&e<mn(t,n)}(e=ga(e),t,n)},Rn.invoke=ka,Rn.isArguments=Vs,Rn.isArray=Ks,Rn.isArrayBuffer=Hs,Rn.isArrayLike=Gs,Rn.isArrayLikeObject=Ys,Rn.isBoolean=function(e){return!0===e||!1===e||ea(e)&&Cr(e)==y},Rn.isBuffer=zs,Rn.isDate=Zs,Rn.isElement=function(e){return ea(e)&&1===e.nodeType&&!ra(e)},Rn.isEmpty=function(e){if(null==e)return!0;if(Gs(e)&&(Ks(e)||"string"==typeof e||"function"==typeof e.splice||zs(e)||la(e)||Vs(e)))return!e.length;var t=ho(e);if(t==S||t==x)return!e.size;if(wo(e))return!jr(e).length;for(var n in e)if(De.call(e,n))return!1;return!0},Rn.isEqual=function(e,t){return Br(e,t)},Rn.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:i)?n(e,t):i;return r===i?Br(e,t,i,n):!!r},Rn.isError=Ws,Rn.isFinite=function(e){return"number"==typeof e&&Mt(e)},Rn.isFunction=qs,Rn.isInteger=Js,Rn.isLength=Xs,Rn.isMap=ta,Rn.isMatch=function(e,t){return e===t||Or(e,t,ao(t))},Rn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:i,Or(e,t,ao(t),n)},Rn.isNaN=function(e){return na(e)&&e!=+e},Rn.isNative=function(e){if(bo(e))throw new we("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Nr(e)},Rn.isNil=function(e){return null==e},Rn.isNull=function(e){return null===e},Rn.isNumber=na,Rn.isObject=$s,Rn.isObjectLike=ea,Rn.isPlainObject=ra,Rn.isRegExp=ia,Rn.isSafeInteger=function(e){return Js(e)&&e>=-9007199254740991&&e<=d},Rn.isSet=oa,Rn.isString=sa,Rn.isSymbol=aa,Rn.isTypedArray=la,Rn.isUndefined=function(e){return e===i},Rn.isWeakMap=function(e){return ea(e)&&ho(e)==B},Rn.isWeakSet=function(e){return ea(e)&&"[object WeakSet]"==Cr(e)},Rn.join=function(e,t){return null==e?"":Ht.call(e,t)},Rn.kebabCase=Ka,Rn.last=Wo,Rn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=pa(n))<0?mn(r+o,0):yn(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Rt(e,Ut,o,!0)},Rn.lowerCase=Ha,Rn.lowerFirst=Ga,Rn.lt=ca,Rn.lte=ua,Rn.max=function(e){return e&&e.length?pr(e,nl,Er):i},Rn.maxBy=function(e,t){return e&&e.length?pr(e,oo(t,2),Er):i},Rn.mean=function(e){return Vt(e,nl)},Rn.meanBy=function(e,t){return Vt(e,oo(t,2))},Rn.min=function(e){return e&&e.length?pr(e,nl,Tr):i},Rn.minBy=function(e,t){return e&&e.length?pr(e,oo(t,2),Tr):i},Rn.stubArray=fl,Rn.stubFalse=gl,Rn.stubObject=function(){return{}},Rn.stubString=function(){return""},Rn.stubTrue=function(){return!0},Rn.multiply=wl,Rn.nth=function(e,t){return e&&e.length?Qr(e,pa(t)):i},Rn.noConflict=function(){return dt._===this&&(dt._=Re),this},Rn.noop=al,Rn.now=Is,Rn.pad=function(e,t,n){e=ya(e);var r=(t=pa(t))?un(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Ui(pt(i),n)+e+Ui(ht(i),n)},Rn.padEnd=function(e,t,n){e=ya(e);var r=(t=pa(t))?un(e):0;return t&&r<t?e+Ui(t-r,n):e},Rn.padStart=function(e,t,n){e=ya(e);var r=(t=pa(t))?un(e):0;return t&&r<t?Ui(t-r,n)+e:e},Rn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),An(ya(e).replace(re,""),t||0)},Rn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&yo(e,t,n)&&(t=n=i),n===i&&("boolean"==typeof t?(n=t,t=i):"boolean"==typeof e&&(n=e,e=i)),e===i&&t===i?(e=0,t=1):(e=ha(e),t===i?(t=e,e=0):t=ha(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var o=bn();return yn(e+o*(t-e+at("1e-"+((o+"").length-1))),t)}return Gr(e,t)},Rn.reduce=function(e,t,n){var r=Ks(e)?Dt:Gt,i=arguments.length<3;return r(e,oo(t,4),n,i,ur)},Rn.reduceRight=function(e,t,n){var r=Ks(e)?jt:Gt,i=arguments.length<3;return r(e,oo(t,4),n,i,dr)},Rn.repeat=function(e,t,n){return t=(n?yo(e,t,n):t===i)?1:pa(t),Yr(ya(e),t)},Rn.replace=function(){var e=arguments,t=ya(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Rn.result=function(e,t,n){var r=-1,o=(t=mi(t,e)).length;for(o||(o=1,e=i);++r<o;){var s=null==e?i:e[Mo(t[r])];s===i&&(r=o,s=n),e=qs(s)?s.call(e):s}return e},Rn.round=Sl,Rn.runInContext=e,Rn.sample=function(e){return(Ks(e)?Wn:Zr)(e)},Rn.size=function(e){if(null==e)return 0;if(Gs(e))return sa(e)?un(e):e.length;var t=ho(e);return t==S||t==x?e.size:jr(e).length},Rn.snakeCase=Ya,Rn.some=function(e,t,n){var r=Ks(e)?Tt:ti;return n&&yo(e,t,n)&&(t=i),r(e,oo(t,3))},Rn.sortedIndex=function(e,t){return ni(e,t)},Rn.sortedIndexBy=function(e,t,n){return ri(e,t,oo(n,2))},Rn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=ni(e,t);if(r<n&&Ls(e[r],t))return r}return-1},Rn.sortedLastIndex=function(e,t){return ni(e,t,!0)},Rn.sortedLastIndexBy=function(e,t,n){return ri(e,t,oo(n,2),!0)},Rn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=ni(e,t,!0)-1;if(Ls(e[n],t))return n}return-1},Rn.startCase=za,Rn.startsWith=function(e,t,n){return e=ya(e),n=null==n?0:or(pa(n),0,e.length),t=si(t),e.slice(n,n+t.length)==t},Rn.subtract=Cl,Rn.sum=function(e){return e&&e.length?Yt(e,nl):0},Rn.sumBy=function(e,t){return e&&e.length?Yt(e,oo(t,2)):0},Rn.template=function(e,t,n){var r=Rn.templateSettings;n&&yo(e,t,n)&&(t=i),e=ya(e),t=ba({},t,r,Wi);var o,s,a=ba({},t.imports,r.imports,Wi),l=Ba(a),c=qt(a,l),u=0,d=t.interpolate||Ae,h="__p += '",p=Ie((t.escape||Ae).source+"|"+d.source+"|"+(d===J?de:Ae).source+"|"+(t.evaluate||Ae).source+"|$","g"),f="//# sourceURL="+(De.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++rt+"]")+"\n";e.replace(p,(function(t,n,r,i,a,l){return r||(r=i),h+=e.slice(u,l).replace(be,nn),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),a&&(s=!0,h+="';\n"+a+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=l+t.length,t})),h+="';\n";var g=De.call(t,"variable")&&t.variable;if(g){if(ce.test(g))throw new we("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(s?h.replace(V,""):h).replace(K,"$1").replace(H,"$1;"),h="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var m=Ja((function(){return Se(l,f+"return "+h).apply(i,c)}));if(m.source=h,Ws(m))throw m;return m},Rn.times=function(e,t){if((e=pa(e))<1||e>d)return[];var n=p,r=yn(e,p);t=oo(t),e-=p;for(var i=zt(r,t);++n<e;)t(n);return i},Rn.toFinite=ha,Rn.toInteger=pa,Rn.toLength=fa,Rn.toLower=function(e){return ya(e).toLowerCase()},Rn.toNumber=ga,Rn.toSafeInteger=function(e){return e?or(pa(e),-9007199254740991,d):0===e?e:0},Rn.toString=ya,Rn.toUpper=function(e){return ya(e).toUpperCase()},Rn.trim=function(e,t,n){if((e=ya(e))&&(n||t===i))return Zt(e);if(!e||!(t=si(t)))return e;var r=dn(e),o=dn(t);return vi(r,Xt(r,o),$t(r,o)+1).join("")},Rn.trimEnd=function(e,t,n){if((e=ya(e))&&(n||t===i))return e.slice(0,hn(e)+1);if(!e||!(t=si(t)))return e;var r=dn(e);return vi(r,0,$t(r,dn(t))+1).join("")},Rn.trimStart=function(e,t,n){if((e=ya(e))&&(n||t===i))return e.replace(re,"");if(!e||!(t=si(t)))return e;var r=dn(e);return vi(r,Xt(r,dn(t))).join("")},Rn.truncate=function(e,t){var n=30,r="...";if($s(t)){var o="separator"in t?t.separator:o;n="length"in t?pa(t.length):n,r="omission"in t?si(t.omission):r}var s=(e=ya(e)).length;if(rn(e)){var a=dn(e);s=a.length}if(n>=s)return e;var l=n-un(r);if(l<1)return r;var c=a?vi(a,0,l).join(""):e.slice(0,l);if(o===i)return c+r;if(a&&(l+=c.length-l),ia(o)){if(e.slice(l).search(o)){var u,d=c;for(o.global||(o=Ie(o.source,ya(he.exec(o))+"g")),o.lastIndex=0;u=o.exec(d);)var h=u.index;c=c.slice(0,h===i?l:h)}}else if(e.indexOf(si(o),l)!=l){var p=c.lastIndexOf(o);p>-1&&(c=c.slice(0,p))}return c+r},Rn.unescape=function(e){return(e=ya(e))&&z.test(e)?e.replace(G,pn):e},Rn.uniqueId=function(e){var t=++je;return ya(e)+t},Rn.upperCase=Za,Rn.upperFirst=Wa,Rn.each=ys,Rn.eachRight=vs,Rn.first=Go,sl(Rn,(ml={},vr(Rn,(function(e,t){De.call(Rn.prototype,t)||(ml[t]=e)})),ml),{chain:!1}),Rn.VERSION="4.17.21",It(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Rn[e].placeholder=Rn})),It(["drop","take"],(function(e,t){Vn.prototype[e]=function(n){n=n===i?1:mn(pa(n),0);var r=this.__filtered__&&!t?new Vn(this):this.clone();return r.__filtered__?r.__takeCount__=yn(n,r.__takeCount__):r.__views__.push({size:yn(n,p),type:e+(r.__dir__<0?"Right":"")}),r},Vn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),It(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Vn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:oo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),It(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Vn.prototype[e]=function(){return this[n](1).value()[0]}})),It(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Vn.prototype[e]=function(){return this.__filtered__?new Vn(this):this[n](1)}})),Vn.prototype.compact=function(){return this.filter(nl)},Vn.prototype.find=function(e){return this.filter(e).head()},Vn.prototype.findLast=function(e){return this.reverse().find(e)},Vn.prototype.invokeMap=zr((function(e,t){return"function"==typeof e?new Vn(this):this.map((function(n){return Pr(n,e,t)}))})),Vn.prototype.reject=function(e){return this.filter(js(oo(e)))},Vn.prototype.slice=function(e,t){e=pa(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Vn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=pa(t))<0?n.dropRight(-t):n.take(t-e)),n)},Vn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Vn.prototype.toArray=function(){return this.take(p)},vr(Vn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Rn[r?"take"+("last"==t?"Right":""):t],s=r||/^find/.test(t);o&&(Rn.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,l=t instanceof Vn,c=a[0],u=l||Ks(t),d=function(e){var t=o.apply(Rn,Nt([e],a));return r&&h?t[0]:t};u&&n&&"function"==typeof c&&1!=c.length&&(l=u=!1);var h=this.__chain__,p=!!this.__actions__.length,f=s&&!h,g=l&&!p;if(!s&&u){t=g?t:new Vn(this);var m=e.apply(t,a);return m.__actions__.push({func:hs,args:[d],thisArg:i}),new Un(m,h)}return f&&g?e.apply(this,a):(m=this.thru(d),f?r?m.value()[0]:m.value():m)})})),It(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Pe[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Rn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ks(i)?i:[],e)}return this[n]((function(n){return t.apply(Ks(n)?n:[],e)}))}})),vr(Vn.prototype,(function(e,t){var n=Rn[t];if(n){var r=n.name+"";De.call(kn,r)||(kn[r]=[]),kn[r].push({name:t,func:n})}})),kn[Fi(i,2).name]=[{name:"wrapper",func:i}],Vn.prototype.clone=function(){var e=new Vn(this.__wrapped__);return e.__actions__=_i(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=_i(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=_i(this.__views__),e},Vn.prototype.reverse=function(){if(this.__filtered__){var e=new Vn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Vn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ks(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=yn(t,e+s);break;case"takeRight":e=mn(e,t-s)}}return{start:e,end:t}}(0,i,this.__views__),s=o.start,a=o.end,l=a-s,c=r?a:s-1,u=this.__iteratees__,d=u.length,h=0,p=yn(l,this.__takeCount__);if(!n||!r&&i==l&&p==l)return di(e,this.__actions__);var f=[];e:for(;l--&&h<p;){for(var g=-1,m=e[c+=t];++g<d;){var y=u[g],v=y.iteratee,A=y.type,b=v(m);if(2==A)m=b;else if(!b){if(1==A)continue e;break e}}f[h++]=m}return f},Rn.prototype.at=ps,Rn.prototype.chain=function(){return ds(this)},Rn.prototype.commit=function(){return new Un(this.value(),this.__chain__)},Rn.prototype.next=function(){this.__values__===i&&(this.__values__=da(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Rn.prototype.plant=function(e){for(var t,n=this;n instanceof Qn;){var r=Ro(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Rn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Vn){var t=e;return this.__actions__.length&&(t=new Vn(this)),(t=t.reverse()).__actions__.push({func:hs,args:[$o],thisArg:i}),new Un(t,this.__chain__)}return this.thru($o)},Rn.prototype.toJSON=Rn.prototype.valueOf=Rn.prototype.value=function(){return di(this.__wrapped__,this.__actions__)},Rn.prototype.first=Rn.prototype.head,We&&(Rn.prototype[We]=function(){return this}),Rn}();dt._=fn,(r=function(){return fn}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},34309:(e,t,n)=>{"use strict";n.d(t,{Pi:()=>v});var r=n(80075),i=n(2784);if(!i.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!r.rC)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var o=n(28316);function s(e){return(0,r.Gf)(e)}var a=function(){function e(e){var t=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(e){void 0===e&&(e=1e4),clearTimeout(t.sweepTimeout),t.sweepTimeout=void 0;var n=Date.now();t.registrations.forEach((function(r,i){n-r.registeredAt>=e&&(t.finalize(r.value),t.registrations.delete(i))})),t.registrations.size>0&&t.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){t.sweep(0)}})}return Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){this.registrations.set(n,{value:t,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.registrations.delete(e)}}),Object.defineProperty(e.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){void 0===this.sweepTimeout&&(this.sweepTimeout=setTimeout(this.sweep,1e4))}}),e}(),l=new("undefined"!=typeof FinalizationRegistry?FinalizationRegistry:a)((function(e){var t;null===(t=e.reaction)||void 0===t||t.dispose(),e.reaction=null})),c=!1;function u(){return c}var d=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s};function h(e){return"observer".concat(e)}var p=function(){};function f(){return new p}var g="function"==typeof Symbol&&Symbol.for,m=g?Symbol.for("react.forward_ref"):"function"==typeof i.forwardRef&&(0,i.forwardRef)((function(e){return null})).$$typeof,y=g?Symbol.for("react.memo"):"function"==typeof i.memo&&(0,i.memo)((function(e){return null})).$$typeof;function v(e,t){var n;if(y&&e.$$typeof===y)throw new Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");if(u())return e;var o=null!==(n=null==t?void 0:t.forwardRef)&&void 0!==n&&n,a=e,c=e.displayName||e.name;if(m&&e.$$typeof===m&&(o=!0,"function"!=typeof(a=e.render)))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var p,g,v=function(e,t){return function(e,t){if(void 0===t&&(t="observed"),u())return e();var n=d(i.useState(f),1)[0],o=d(i.useState(),2)[1],a=function(){return o([])},c=i.useRef(null);c.current||(c.current={reaction:null,mounted:!1,changedBeforeMount:!1});var p,g,m=c.current;if(m.reaction||(m.reaction=new r.le(h(t),(function(){m.mounted?a():m.changedBeforeMount=!0})),l.register(n,m,m)),i.useDebugValue(m.reaction,s),i.useEffect((function(){return l.unregister(m),m.mounted=!0,m.reaction?m.changedBeforeMount&&(m.changedBeforeMount=!1,a()):(m.reaction=new r.le(h(t),(function(){a()})),a()),function(){m.reaction.dispose(),m.reaction=null,m.mounted=!1,m.changedBeforeMount=!1}}),[]),m.reaction.track((function(){try{p=e()}catch(e){g=e}})),g)throw g;return p}((function(){return a(e,t)}),c)};return""!==c&&(v.displayName=c),e.contextTypes&&(v.contextTypes=e.contextTypes),o&&(v=(0,i.forwardRef)(v)),v=(0,i.memo)(v),p=e,g=v,Object.keys(p).forEach((function(e){b[e]||Object.defineProperty(g,e,Object.getOwnPropertyDescriptor(p,e))})),v}var A,b={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};(A=o.unstable_batchedUpdates)||(A=function(e){e()}),(0,r.jQ)({reactionScheduler:A}),l.finalizeAllImmediately},80075:(e,t,n)=>{"use strict";function r(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw new Error("number"==typeof e?"[MobX] minified error nr: "+e+(n.length?" "+n.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+e)}n.d(t,{EH:()=>Dt,Fl:()=>Oe,Gf:()=>Yt,LO:()=>xe,U5:()=>Mt,aD:()=>kt,gx:()=>rn,jQ:()=>Ht,ky:()=>mn,le:()=>mt,rC:()=>fn,z:()=>Ot});var i={};function o(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:i}var s=Object.assign,a=Object.getOwnPropertyDescriptor,l=Object.defineProperty,c=Object.prototype,u=[];Object.freeze(u);var d={};Object.freeze(d);var h="undefined"!=typeof Proxy,p=Object.toString();function f(){h||r("Proxy not available")}function g(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var m=function(){};function y(e){return"function"==typeof e}function v(e){switch(typeof e){case"string":case"symbol":case"number":return!0}return!1}function A(e){return null!==e&&"object"==typeof e}function b(e){if(!A(e))return!1;var t=Object.getPrototypeOf(e);if(null==t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n.toString()===p}function w(e){var t=null==e?void 0:e.constructor;return!!t&&("GeneratorFunction"===t.name||"GeneratorFunction"===t.displayName)}function S(e,t,n){l(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function C(e,t,n){l(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function E(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(e){return A(e)&&!0===e[n]}}function I(e){return e instanceof Map}function _(e){return e instanceof Set}var x=void 0!==Object.getOwnPropertySymbols,P="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:x?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function k(e){return null===e?null:"object"==typeof e?""+e:e}function B(e,t){return c.hasOwnProperty.call(e,t)}var O=Object.getOwnPropertyDescriptors||function(e){var t={};return P(e).forEach((function(n){t[n]=a(e,n)})),t};function N(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,"symbol"==typeof(i=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key))?i:String(i)),r)}var i}function D(e,t,n){return t&&N(e.prototype,t),n&&N(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function j(){return j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},j.apply(this,arguments)}function T(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,M(e,t)}function M(e,t){return M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},M(e,t)}function F(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function L(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return R(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?R(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var Q=Symbol("mobx-stored-annotations");function U(e){return Object.assign((function(t,n){V(t,n,e)}),e)}function V(e,t,n){B(e,Q)||S(e,Q,j({},e[Q])),function(e){return e.annotationType_===q}(n)||(e[Q][t]=n)}var K=Symbol("mobx administration"),H=function(){function e(e){void 0===e&&(e="Atom"),this.name_=void 0,this.isPendingUnobservation_=!1,this.isBeingObserved_=!1,this.observers_=new Set,this.diffValue_=0,this.lastAccessedBy_=0,this.lowestObserverState_=He.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=e}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach((function(e){return e()}))},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach((function(e){return e()}))},t.reportObserved=function(){return ft(this)},t.reportChanged=function(){ht(),gt(this),lt.stateVersion=lt.stateVersion<Number.MAX_SAFE_INTEGER?lt.stateVersion+1:Number.MIN_SAFE_INTEGER,pt()},t.toString=function(){return this.name_},e}(),G=E("Atom",H);function Y(e,t,n){void 0===t&&(t=m),void 0===n&&(n=m);var r=new H(e);return t!==m&&Qt(Ft,r,t,undefined),n!==m&&Lt(r,n),r}var z={identity:function(e,t){return e===t},structural:function(e,t){return cr(e,t)},default:function(e,t){return Object.is?Object.is(e,t):e===t?0!==e||1/e==1/t:e!=e&&t!=t},shallow:function(e,t){return cr(e,t,1)}};function Z(e,t,n){return tn(e)?e:Array.isArray(e)?xe.array(e,{name:n}):b(e)?xe.object(e,void 0,{name:n}):I(e)?xe.map(e,{name:n}):_(e)?xe.set(e,{name:n}):"function"!=typeof e||Nt(e)||en(e)?e:w(e)?Xt(e):Bt(n,e)}function W(e){return e}var q="override";function J(e,t){return{annotationType_:e,options_:t,make_:X,extend_:$}}function X(e,t,n,r){var i;if(null!=(i=this.options_)&&i.bound)return null===this.extend_(e,t,n,!1)?0:1;if(r===e.target_)return null===this.extend_(e,t,n,!1)?0:2;if(Nt(n.value))return 1;var o=ee(e,this,t,n,!1);return l(r,t,o),2}function $(e,t,n,r){var i=ee(e,this,t,n);return e.defineProperty_(t,i,r)}function ee(e,t,n,r,i){var o,s,a,l,c,u,d,h;void 0===i&&(i=lt.safeDescriptors),h=r,t.annotationType_,h.value;var p,f=r.value;return null!=(o=t.options_)&&o.bound&&(f=f.bind(null!=(p=e.proxy_)?p:e.target_)),{value:Fe(null!=(s=null==(a=t.options_)?void 0:a.name)?s:n.toString(),f,null!=(l=null==(c=t.options_)?void 0:c.autoAction)&&l,null!=(u=t.options_)&&u.bound?null!=(d=e.proxy_)?d:e.target_:void 0),configurable:!i||e.isPlainObject_,enumerable:!1,writable:!i}}function te(e,t){return{annotationType_:e,options_:t,make_:ne,extend_:re}}function ne(e,t,n,r){var i;if(r===e.target_)return null===this.extend_(e,t,n,!1)?0:2;if(null!=(i=this.options_)&&i.bound&&(!B(e.target_,t)||!en(e.target_[t]))&&null===this.extend_(e,t,n,!1))return 0;if(en(n.value))return 1;var o=ie(e,this,0,n,!1,!1);return l(r,t,o),2}function re(e,t,n,r){var i,o=ie(e,this,0,n,null==(i=this.options_)?void 0:i.bound);return e.defineProperty_(t,o,r)}function ie(e,t,n,r,i,o){var s;void 0===o&&(o=lt.safeDescriptors),s=r,t.annotationType_,s.value;var a,l=r.value;return en(l)||(l=Xt(l)),i&&((l=l.bind(null!=(a=e.proxy_)?a:e.target_)).isMobXFlow=!0),{value:l,configurable:!o||e.isPlainObject_,enumerable:!1,writable:!o}}function oe(e,t){return{annotationType_:e,options_:t,make_:se,extend_:ae}}function se(e,t,n){return null===this.extend_(e,t,n,!1)?0:1}function ae(e,t,n,r){return i=n,this.annotationType_,i.get,e.defineComputedProperty_(t,j({},this.options_,{get:n.get,set:n.set}),r);var i}function le(e,t){return{annotationType_:e,options_:t,make_:ce,extend_:ue}}function ce(e,t,n){return null===this.extend_(e,t,n,!1)?0:1}function ue(e,t,n,r){var i,o;return this.annotationType_,e.defineObservableProperty_(t,n.value,null!=(i=null==(o=this.options_)?void 0:o.enhancer)?i:Z,r)}var de="true",he=pe();function pe(e){return{annotationType_:de,options_:e,make_:fe,extend_:ge}}function fe(e,t,n,r){var i,o,s,a;if(n.get)return Oe.make_(e,t,n,r);if(n.set){var c=Fe(t.toString(),n.set);return r===e.target_?null===e.defineProperty_(t,{configurable:!lt.safeDescriptors||e.isPlainObject_,set:c})?0:2:(l(r,t,{configurable:!0,set:c}),2)}if(r!==e.target_&&"function"==typeof n.value)return w(n.value)?(null!=(a=this.options_)&&a.autoBind?Xt.bound:Xt).make_(e,t,n,r):(null!=(s=this.options_)&&s.autoBind?Bt.bound:Bt).make_(e,t,n,r);var u,d=!1===(null==(i=this.options_)?void 0:i.deep)?xe.ref:xe;return"function"==typeof n.value&&null!=(o=this.options_)&&o.autoBind&&(n.value=n.value.bind(null!=(u=e.proxy_)?u:e.target_)),d.make_(e,t,n,r)}function ge(e,t,n,r){var i,o,s;return n.get?Oe.extend_(e,t,n,r):n.set?e.defineProperty_(t,{configurable:!lt.safeDescriptors||e.isPlainObject_,set:Fe(t.toString(),n.set)},r):("function"==typeof n.value&&null!=(i=this.options_)&&i.autoBind&&(n.value=n.value.bind(null!=(s=e.proxy_)?s:e.target_)),(!1===(null==(o=this.options_)?void 0:o.deep)?xe.ref:xe).extend_(e,t,n,r))}var me={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};function ye(e){return e||me}Object.freeze(me);var ve=le("observable"),Ae=le("observable.ref",{enhancer:W}),be=le("observable.shallow",{enhancer:function(e,t,n){return null==e||zn(e)||Bn(e)||Fn(e)||Qn(e)?e:Array.isArray(e)?xe.array(e,{name:n,deep:!1}):b(e)?xe.object(e,void 0,{name:n,deep:!1}):I(e)?xe.map(e,{name:n,deep:!1}):_(e)?xe.set(e,{name:n,deep:!1}):void 0}}),we=le("observable.struct",{enhancer:function(e,t){return cr(e,t)?t:e}}),Se=U(ve);function Ce(e){return!0===e.deep?Z:!1===e.deep?W:(t=e.defaultDecorator)&&null!=(n=null==(r=t.options_)?void 0:r.enhancer)?n:Z;var t,n,r}function Ee(e,t,n){if(!v(t))return tn(e)?e:b(e)?xe.object(e,t,n):Array.isArray(e)?xe.array(e,t):I(e)?xe.map(e,t):_(e)?xe.set(e,t):"object"==typeof e&&null!==e?e:xe.box(e,t);V(e,t,ve)}s(Ee,Se);var Ie,_e,xe=s(Ee,{box:function(e,t){var n=ye(t);return new Ke(e,Ce(n),n.name,!0,n.equals)},array:function(e,t){var n=ye(t);return(!1===lt.useProxies||!1===n.proxy?ir:wn)(e,Ce(n),n.name)},map:function(e,t){var n=ye(t);return new Mn(e,Ce(n),n.name)},set:function(e,t){var n=ye(t);return new Ln(e,Ce(n),n.name)},object:function(e,t,n){return Gt(!1===lt.useProxies||!1===(null==n?void 0:n.proxy)?Hn({},n):function(e,t){var n,r;return f(),null!=(r=(n=(e=Hn(e,t))[K]).proxy_)?r:n.proxy_=new Proxy(e,an)}({},n),e,t)},ref:U(Ae),shallow:U(be),deep:Se,struct:U(we)}),Pe="computed",ke=oe(Pe),Be=oe("computed.struct",{equals:z.structural}),Oe=function(e,t){if(v(t))return V(e,t,ke);if(b(e))return U(oe(Pe,e));var n=b(t)?t:{};return n.get=e,n.name||(n.name=e.name||""),new Ye(n)};Object.assign(Oe,ke),Oe.struct=U(Be);var Ne,De=0,je=1,Te=null!=(Ie=null==(_e=a((function(){}),"name"))?void 0:_e.configurable)&&Ie,Me={value:"action",configurable:!0,writable:!1,enumerable:!1};function Fe(e,t,n,r){function i(){return Re(0,n,t,r||this,arguments)}return void 0===n&&(n=!1),i.isMobxAction=!0,Te&&(Me.value=e,l(i,"name",Me)),i}function Re(e,t,n,i,o){var s=function(e,t,n,r){var i=lt.trackingDerivation,o=!t||!i;ht();var s=lt.allowStateChanges;o&&(et(),s=Qe(!0));var a={runAsAction_:o,prevDerivation_:i,prevAllowStateChanges_:s,prevAllowStateReads_:nt(!0),notifySpy_:!1,startTime_:0,actionId_:je++,parentActionId_:De};return De=a.actionId_,a}(0,t);try{return n.apply(i,o)}catch(e){throw s.error_=e,e}finally{!function(e){De!==e.actionId_&&r(30),De=e.parentActionId_,void 0!==e.error_&&(lt.suppressReactionErrors=!0),Ue(e.prevAllowStateChanges_),rt(e.prevAllowStateReads_),pt(),e.runAsAction_&&tt(e.prevDerivation_),lt.suppressReactionErrors=!1}(s)}}function Le(e,t){var n=Qe(e);try{return t()}finally{Ue(n)}}function Qe(e){var t=lt.allowStateChanges;return lt.allowStateChanges=e,t}function Ue(e){lt.allowStateChanges=e}Ne=Symbol.toPrimitive;var Ve,Ke=function(e){function t(t,n,r,i,o){var s;return void 0===r&&(r="ObservableValue"),void 0===i&&(i=!0),void 0===o&&(o=z.default),(s=e.call(this,r)||this).enhancer=void 0,s.name_=void 0,s.equals=void 0,s.hasUnreportedChange_=!1,s.interceptors_=void 0,s.changeListeners_=void 0,s.value_=void 0,s.dehancer=void 0,s.enhancer=n,s.name_=r,s.equals=o,s.value_=n(t,void 0,r),s}T(t,e);var n=t.prototype;return n.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},n.set=function(e){this.value_,(e=this.prepareNewValue_(e))!==lt.UNCHANGED&&this.setNewValue_(e)},n.prepareNewValue_=function(e){if(ln(this)){var t=un(this,{object:this,type:vn,newValue:e});if(!t)return lt.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value_,this.name_),this.equals(this.value_,e)?lt.UNCHANGED:e},n.setNewValue_=function(e){var t=this.value_;this.value_=e,this.reportChanged(),dn(this)&&pn(this,{type:vn,object:this,newValue:e,oldValue:t})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(e){return cn(this,e)},n.observe_=function(e,t){return t&&e({observableKind:"value",debugObjectName:this.name_,object:this,type:vn,newValue:this.value_,oldValue:void 0}),hn(this,e)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+"["+this.value_+"]"},n.valueOf=function(){return k(this.get())},n[Ne]=function(){return this.valueOf()},t}(H);Ve=Symbol.toPrimitive;var He,Ge,Ye=function(){function e(e){this.dependenciesState_=He.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.isBeingObserved_=!1,this.isPendingUnobservation_=!1,this.observers_=new Set,this.diffValue_=0,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=He.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new Ze(null),this.name_=void 0,this.triggeredBy_=void 0,this.isComputing_=!1,this.isRunningSetter_=!1,this.derivation=void 0,this.setter_=void 0,this.isTracing_=Ge.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,e.get||r(31),this.derivation=e.get,this.name_=e.name||"ComputedValue",e.set&&(this.setter_=Fe("ComputedValue-setter",e.set)),this.equals_=e.equals||(e.compareStructural||e.struct?z.structural:z.default),this.scope_=e.context,this.requiresReaction_=e.requiresReaction,this.keepAlive_=!!e.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){!function(e){e.lowestObserverState_===He.UP_TO_DATE_&&(e.lowestObserverState_=He.POSSIBLY_STALE_,e.observers_.forEach((function(e){e.dependenciesState_===He.UP_TO_DATE_&&(e.dependenciesState_=He.POSSIBLY_STALE_,e.onBecomeStale_())})))}(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach((function(e){return e()}))},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach((function(e){return e()}))},t.get=function(){if(this.isComputing_&&r(32,this.name_,this.derivation),0!==lt.inBatch||0!==this.observers_.size||this.keepAlive_){if(ft(this),qe(this)){var e=lt.trackingContext;this.keepAlive_&&!e&&(lt.trackingContext=this),this.trackAndCompute()&&function(e){e.lowestObserverState_!==He.STALE_&&(e.lowestObserverState_=He.STALE_,e.observers_.forEach((function(t){t.dependenciesState_===He.POSSIBLY_STALE_?t.dependenciesState_=He.STALE_:t.dependenciesState_===He.UP_TO_DATE_&&(e.lowestObserverState_=He.UP_TO_DATE_)})))}(this),lt.trackingContext=e}}else qe(this)&&(this.warnAboutUntrackedRead_(),ht(),this.value_=this.computeValue_(!1),pt());var t=this.value_;if(We(t))throw t.cause;return t},t.set=function(e){if(this.setter_){this.isRunningSetter_&&r(33,this.name_),this.isRunningSetter_=!0;try{this.setter_.call(this.scope_,e)}finally{this.isRunningSetter_=!1}}else r(34,this.name_)},t.trackAndCompute=function(){var e=this.value_,t=this.dependenciesState_===He.NOT_TRACKING_,n=this.computeValue_(!0),r=t||We(e)||We(n)||!this.equals_(e,n);return r&&(this.value_=n),r},t.computeValue_=function(e){this.isComputing_=!0;var t,n=Qe(!1);if(e)t=Je(this,this.derivation,this.scope_);else if(!0===lt.disableErrorBoundaries)t=this.derivation.call(this.scope_);else try{t=this.derivation.call(this.scope_)}catch(e){t=new Ze(e)}return Ue(n),this.isComputing_=!1,t},t.suspend_=function(){this.keepAlive_||(Xe(this),this.value_=void 0)},t.observe_=function(e,t){var n=this,r=!0,i=void 0;return Dt((function(){var o=n.get();if(!r||t){var s=et();e({observableKind:"computed",debugObjectName:n.name_,type:vn,object:n,newValue:o,oldValue:i}),tt(s)}r=!1,i=o}))},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return k(this.get())},t[Ve]=function(){return this.valueOf()},e}(),ze=E("ComputedValue",Ye);!function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"}(He||(He={})),function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(Ge||(Ge={}));var Ze=function(e){this.cause=void 0,this.cause=e};function We(e){return e instanceof Ze}function qe(e){switch(e.dependenciesState_){case He.UP_TO_DATE_:return!1;case He.NOT_TRACKING_:case He.STALE_:return!0;case He.POSSIBLY_STALE_:for(var t=nt(!0),n=et(),r=e.observing_,i=r.length,o=0;o<i;o++){var s=r[o];if(ze(s)){if(lt.disableErrorBoundaries)s.get();else try{s.get()}catch(e){return tt(n),rt(t),!0}if(e.dependenciesState_===He.STALE_)return tt(n),rt(t),!0}}return it(e),tt(n),rt(t),!1}}function Je(e,t,n){var r=nt(!0);it(e),e.newObserving_=new Array(e.observing_.length+100),e.unboundDepsCount_=0,e.runId_=++lt.runId;var i,o=lt.trackingDerivation;if(lt.trackingDerivation=e,lt.inBatch++,!0===lt.disableErrorBoundaries)i=t.call(n);else try{i=t.call(n)}catch(e){i=new Ze(e)}return lt.inBatch--,lt.trackingDerivation=o,function(e){for(var t=e.observing_,n=e.observing_=e.newObserving_,r=He.UP_TO_DATE_,i=0,o=e.unboundDepsCount_,s=0;s<o;s++){var a=n[s];0===a.diffValue_&&(a.diffValue_=1,i!==s&&(n[i]=a),i++),a.dependenciesState_>r&&(r=a.dependenciesState_)}for(n.length=i,e.newObserving_=null,o=t.length;o--;){var l=t[o];0===l.diffValue_&&ut(l,e),l.diffValue_=0}for(;i--;){var c=n[i];1===c.diffValue_&&(c.diffValue_=0,ct(c,e))}r!==He.UP_TO_DATE_&&(e.dependenciesState_=r,e.onBecomeStale_())}(e),rt(r),i}function Xe(e){var t=e.observing_;e.observing_=[];for(var n=t.length;n--;)ut(t[n],e);e.dependenciesState_=He.NOT_TRACKING_}function $e(e){var t=et();try{return e()}finally{tt(t)}}function et(){var e=lt.trackingDerivation;return lt.trackingDerivation=null,e}function tt(e){lt.trackingDerivation=e}function nt(e){var t=lt.allowStateReads;return lt.allowStateReads=e,t}function rt(e){lt.allowStateReads=e}function it(e){if(e.dependenciesState_!==He.UP_TO_DATE_){e.dependenciesState_=He.UP_TO_DATE_;for(var t=e.observing_,n=t.length;n--;)t[n].lowestObserverState_=He.UP_TO_DATE_}}var ot=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0,this.stateVersion=Number.MIN_SAFE_INTEGER},st=!0,at=!1,lt=function(){var e=o();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(st=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new ot).version&&(st=!1),st?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new ot):(setTimeout((function(){at||r(35)}),1),new ot)}();function ct(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function ut(e,t){e.observers_.delete(t),0===e.observers_.size&&dt(e)}function dt(e){!1===e.isPendingUnobservation_&&(e.isPendingUnobservation_=!0,lt.pendingUnobservations.push(e))}function ht(){lt.inBatch++}function pt(){if(0==--lt.inBatch){At();for(var e=lt.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation_=!1,0===n.observers_.size&&(n.isBeingObserved_&&(n.isBeingObserved_=!1,n.onBUO()),n instanceof Ye&&n.suspend_())}lt.pendingUnobservations=[]}}function ft(e){var t=lt.trackingDerivation;return null!==t?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved_&&lt.trackingContext&&(e.isBeingObserved_=!0,e.onBO())),e.isBeingObserved_):(0===e.observers_.size&&lt.inBatch>0&&dt(e),!1)}function gt(e){e.lowestObserverState_!==He.STALE_&&(e.lowestObserverState_=He.STALE_,e.observers_.forEach((function(e){e.dependenciesState_===He.UP_TO_DATE_&&e.onBecomeStale_(),e.dependenciesState_=He.STALE_})))}var mt=function(){function e(e,t,n,r){void 0===e&&(e="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=He.NOT_TRACKING_,this.diffValue_=0,this.runId_=0,this.unboundDepsCount_=0,this.isDisposed_=!1,this.isScheduled_=!1,this.isTrackPending_=!1,this.isRunning_=!1,this.isTracing_=Ge.NONE,this.name_=e,this.onInvalidate_=t,this.errorHandler_=n,this.requiresObservable_=r}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled_||(this.isScheduled_=!0,lt.pendingReactions.push(this),At())},t.isScheduled=function(){return this.isScheduled_},t.runReaction_=function(){if(!this.isDisposed_){ht(),this.isScheduled_=!1;var e=lt.trackingContext;if(lt.trackingContext=this,qe(this)){this.isTrackPending_=!0;try{this.onInvalidate_()}catch(e){this.reportExceptionInDerivation_(e)}}lt.trackingContext=e,pt()}},t.track=function(e){if(!this.isDisposed_){ht(),this.isRunning_=!0;var t=lt.trackingContext;lt.trackingContext=this;var n=Je(this,e,void 0);lt.trackingContext=t,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&Xe(this),We(n)&&this.reportExceptionInDerivation_(n.cause),pt()}},t.reportExceptionInDerivation_=function(e){var t=this;if(this.errorHandler_)this.errorHandler_(e,this);else{if(lt.disableErrorBoundaries)throw e;var n="[mobx] uncaught error in '"+this+"'";lt.suppressReactionErrors||console.error(n,e),lt.globalReactionErrorHandlers.forEach((function(n){return n(e,t)}))}},t.dispose=function(){this.isDisposed_||(this.isDisposed_=!0,this.isRunning_||(ht(),Xe(this),pt()))},t.getDisposer_=function(e){var t=this,n=function n(){t.dispose(),null==e||null==e.removeEventListener||e.removeEventListener("abort",n)};return null==e||null==e.addEventListener||e.addEventListener("abort",n),n[K]=this,n},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(e){void 0===e&&(e=!1)},e}(),yt=100,vt=function(e){return e()};function At(){lt.inBatch>0||lt.isRunningReactions||vt(bt)}function bt(){lt.isRunningReactions=!0;for(var e=lt.pendingReactions,t=0;e.length>0;){++t===yt&&(console.error("[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var n=e.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction_()}lt.isRunningReactions=!1}var wt=E("Reaction",mt),St="action",Ct="autoAction",Et=J(St),It=J("action.bound",{bound:!0}),_t=J(Ct,{autoAction:!0}),xt=J("autoAction.bound",{autoAction:!0,bound:!0});function Pt(e){return function(t,n){return y(t)?Fe(t.name||"<unnamed action>",t,e):y(n)?Fe(t,n,e):v(n)?V(t,n,e?_t:Et):v(t)?U(J(e?Ct:St,{name:t,autoAction:e})):void 0}}var kt=Pt(!1);Object.assign(kt,Et);var Bt=Pt(!0);function Ot(e){return Re(e.name,!1,e,this,void 0)}function Nt(e){return y(e)&&!0===e.isMobxAction}function Dt(e,t){var n,r,i,o,s;void 0===t&&(t=d);var a,l=null!=(n=null==(r=t)?void 0:r.name)?n:"Autorun";if(t.scheduler||t.delay){var c=Tt(t),u=!1;a=new mt(l,(function(){u||(u=!0,c((function(){u=!1,a.isDisposed_||a.track(h)})))}),t.onError,t.requiresObservable)}else a=new mt(l,(function(){this.track(h)}),t.onError,t.requiresObservable);function h(){e(a)}return null!=(i=t)&&null!=(o=i.signal)&&o.aborted||a.schedule_(),a.getDisposer_(null==(s=t)?void 0:s.signal)}Object.assign(Bt,_t),kt.bound=U(It),Bt.bound=U(xt);var jt=function(e){return e()};function Tt(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:jt}function Mt(e,t,n){var r,i,o,s;void 0===n&&(n=d);var a,l,c,u,h=null!=(r=n.name)?r:"Reaction",p=kt(h,n.onError?(a=n.onError,l=t,function(){try{return l.apply(this,arguments)}catch(e){a.call(this,e)}}):t),f=!n.scheduler&&!n.delay,g=Tt(n),m=!0,y=!1,v=n.compareStructural?z.structural:n.equals||z.default,A=new mt(h,(function(){m||f?b():y||(y=!0,g(b))}),n.onError,n.requiresObservable);function b(){if(y=!1,!A.isDisposed_){var t=!1;A.track((function(){var n=Le(!1,(function(){return e(A)}));t=m||!v(c,n),u=c,c=n})),(m&&n.fireImmediately||!m&&t)&&p(c,u,A),m=!1}}return null!=(i=n)&&null!=(o=i.signal)&&o.aborted||A.schedule_(),A.getDisposer_(null==(s=n)?void 0:s.signal)}var Ft="onBO",Rt="onBUO";function Lt(e,t,n){return Qt(Rt,e,t,n)}function Qt(e,t,n,r){var i="function"==typeof r?or(t,n):or(t),o=y(r)?r:n,s=e+"L";return i[s]?i[s].add(o):i[s]=new Set([o]),function(){var e=i[s];e&&(e.delete(o),0===e.size&&delete i[s])}}var Ut="never",Vt="always",Kt="observed";function Ht(e){!0===e.isolateGlobalState&&function(){if((lt.pendingReactions.length||lt.inBatch||lt.isRunningReactions)&&r(36),at=!0,st){var e=o();0==--e.__mobxInstanceCount&&(e.__mobxGlobals=void 0),lt=new ot}}();var t,n,i=e.useProxies,s=e.enforceActions;if(void 0!==i&&(lt.useProxies=i===Vt||i!==Ut&&"undefined"!=typeof Proxy),"ifavailable"===i&&(lt.verifyProxies=!0),void 0!==s){var a=s===Vt?Vt:s===Kt;lt.enforceActions=a,lt.allowStateChanges=!0!==a&&a!==Vt}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach((function(t){t in e&&(lt[t]=!!e[t])})),lt.allowStateReads=!lt.observableRequiresReaction,e.reactionScheduler&&(t=e.reactionScheduler,n=vt,vt=function(e){return t((function(){return n(e)}))})}function Gt(e,t,n,r){var i=O(t),o=Hn(e,r)[K];ht();try{P(i).forEach((function(e){o.extend_(e,i[e],!n||!(e in n)||n[e])}))}finally{pt()}return e}function Yt(e,t){return zt(or(e,t))}function zt(e){var t,n={name:e.name_};return e.observing_&&e.observing_.length>0&&(n.dependencies=(t=e.observing_,Array.from(new Set(t))).map(zt)),n}var Zt=0;function Wt(){this.message="FLOW_CANCELLED"}Wt.prototype=Object.create(Error.prototype);var qt=te("flow"),Jt=te("flow.bound",{bound:!0}),Xt=Object.assign((function(e,t){if(v(t))return V(e,t,qt);var n=e,r=n.name||"<unnamed flow>",i=function(){var e,t=arguments,i=++Zt,o=kt(r+" - runid: "+i+" - init",n).apply(this,t),s=void 0,a=new Promise((function(t,n){var a=0;function l(e){var t;s=void 0;try{t=kt(r+" - runid: "+i+" - yield "+a++,o.next).call(o,e)}catch(e){return n(e)}u(t)}function c(e){var t;s=void 0;try{t=kt(r+" - runid: "+i+" - yield "+a++,o.throw).call(o,e)}catch(e){return n(e)}u(t)}function u(e){if(!y(null==e?void 0:e.then))return e.done?t(e.value):(s=Promise.resolve(e.value)).then(l,c);e.then(u,n)}e=n,l(void 0)}));return a.cancel=kt(r+" - runid: "+i+" - cancel",(function(){try{s&&$t(s);var t=o.return(void 0),n=Promise.resolve(t.value);n.then(m,m),$t(n),e(new Wt)}catch(t){e(t)}})),a};return i.isMobXFlow=!0,i}),qt);function $t(e){y(e.cancel)&&e.cancel()}function en(e){return!0===(null==e?void 0:e.isMobXFlow)}function tn(e){return function(e,t){return!!e&&(void 0!==t?!!zn(e)&&e[K].values_.has(t):zn(e)||!!e[K]||G(e)||wt(e)||ze(e))}(e)}function nn(e,t){void 0===t&&(t=void 0),ht();try{return e.apply(t)}finally{pt()}}function rn(e,t,n){return 1===arguments.length||t&&"object"==typeof t?function(e,t){var n,r,i;if(null!=t&&null!=(n=t.signal)&&n.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var o=new Promise((function(n,o){var s,a=on(e,n,j({},t,{onError:o}));r=function(){a(),o(new Error("WHEN_CANCELLED"))},i=function(){a(),o(new Error("WHEN_ABORTED"))},null==t||null==(s=t.signal)||null==s.addEventListener||s.addEventListener("abort",i)})).finally((function(){var e;return null==t||null==(e=t.signal)||null==e.removeEventListener?void 0:e.removeEventListener("abort",i)}));return o.cancel=r,o}(e,t):on(e,t,n||{})}function on(e,t,n){var r;if("number"==typeof n.timeout){var i=new Error("WHEN_TIMEOUT");r=setTimeout((function(){if(!s[K].isDisposed_){if(s(),!n.onError)throw i;n.onError(i)}}),n.timeout)}n.name="When";var o=Fe("When-effect",t),s=Dt((function(t){Le(!1,e)&&(t.dispose(),r&&clearTimeout(r),o())}),n);return s}function sn(e){return e[K]}Xt.bound=U(Jt);var an={has:function(e,t){return sn(e).has_(t)},get:function(e,t){return sn(e).get_(t)},set:function(e,t,n){var r;return!!v(t)&&(null==(r=sn(e).set_(t,n,!0))||r)},deleteProperty:function(e,t){var n;return!!v(t)&&(null==(n=sn(e).delete_(t,!0))||n)},defineProperty:function(e,t,n){var r;return null==(r=sn(e).defineProperty_(t,n))||r},ownKeys:function(e){return sn(e).ownKeys_()},preventExtensions:function(e){r(13)}};function ln(e){return void 0!==e.interceptors_&&e.interceptors_.length>0}function cn(e,t){var n=e.interceptors_||(e.interceptors_=[]);return n.push(t),g((function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}))}function un(e,t){var n=et();try{for(var i=[].concat(e.interceptors_||[]),o=0,s=i.length;o<s&&((t=i[o](t))&&!t.type&&r(14),t);o++);return t}finally{tt(n)}}function dn(e){return void 0!==e.changeListeners_&&e.changeListeners_.length>0}function hn(e,t){var n=e.changeListeners_||(e.changeListeners_=[]);return n.push(t),g((function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}))}function pn(e,t){var n=et(),r=e.changeListeners_;if(r){for(var i=0,o=(r=r.slice()).length;i<o;i++)r[i](t);tt(n)}}function fn(e,t,n){var r=Hn(e,n)[K];ht();try{null!=t||(t=function(e){return B(e,Q)||S(e,Q,j({},e[Q])),e[Q]}(e)),P(t).forEach((function(e){return r.make_(e,t[e])}))}finally{pt()}return e}var gn=Symbol("mobx-keys");function mn(e,t,n){if(b(e))return Gt(e,e,t,n);var r=Hn(e,n)[K];if(!e[gn]){var i=Object.getPrototypeOf(e),o=new Set([].concat(P(e),P(i)));o.delete("constructor"),o.delete(K),S(i,gn,o)}ht();try{e[gn].forEach((function(e){return r.make_(e,!t||!(e in t)||t[e])}))}finally{pt()}return e}var yn="splice",vn="update",An={get:function(e,t){var n=e[K];return t===K?n:"length"===t?n.getArrayLength_():"string"!=typeof t||isNaN(t)?B(Sn,t)?Sn[t]:e[t]:n.get_(parseInt(t))},set:function(e,t,n){var r=e[K];return"length"===t&&r.setArrayLength_(n),"symbol"==typeof t||isNaN(t)?e[t]=n:r.set_(parseInt(t),n),!0},preventExtensions:function(){r(15)}},bn=function(){function e(e,t,n,r){void 0===e&&(e="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=n,this.legacyMode_=r,this.atom_=new H(e),this.enhancer_=function(e,n){return t(e,n,"ObservableArray[..]")}}var t=e.prototype;return t.dehanceValue_=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.dehanceValues_=function(e){return void 0!==this.dehancer&&e.length>0?e.map(this.dehancer):e},t.intercept_=function(e){return cn(this,e)},t.observe_=function(e,t){return void 0===t&&(t=!1),t&&e({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),hn(this,e)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(e){("number"!=typeof e||isNaN(e)||e<0)&&r("Out of range: "+e);var t=this.values_.length;if(e!==t)if(e>t){for(var n=new Array(e-t),i=0;i<e-t;i++)n[i]=void 0;this.spliceWithArray_(t,0,n)}else this.spliceWithArray_(e,t-e)},t.updateArrayLength_=function(e,t){e!==this.lastKnownLength_&&r(16),this.lastKnownLength_+=t,this.legacyMode_&&t>0&&rr(e+t+1)},t.spliceWithArray_=function(e,t,n){var r=this;this.atom_;var i=this.values_.length;if(void 0===e?e=0:e>i?e=i:e<0&&(e=Math.max(0,i+e)),t=1===arguments.length?i-e:null==t?0:Math.max(0,Math.min(t,i-e)),void 0===n&&(n=u),ln(this)){var o=un(this,{object:this.proxy_,type:yn,index:e,removedCount:t,added:n});if(!o)return u;t=o.removedCount,n=o.added}if(n=0===n.length?n:n.map((function(e){return r.enhancer_(e,void 0)})),this.legacyMode_){var s=n.length-t;this.updateArrayLength_(i,s)}var a=this.spliceItemsIntoValues_(e,t,n);return 0===t&&0===n.length||this.notifyArraySplice_(e,n,a),this.dehanceValues_(a)},t.spliceItemsIntoValues_=function(e,t,n){var r;if(n.length<1e4)return(r=this.values_).splice.apply(r,[e,t].concat(n));var i=this.values_.slice(e,e+t),o=this.values_.slice(e+t);this.values_.length+=n.length-t;for(var s=0;s<n.length;s++)this.values_[e+s]=n[s];for(var a=0;a<o.length;a++)this.values_[e+n.length+a]=o[a];return i},t.notifyArrayChildUpdate_=function(e,t,n){var r=!this.owned_&&!1,i=dn(this),o=i||r?{observableKind:"array",object:this.proxy_,type:vn,debugObjectName:this.atom_.name_,index:e,newValue:t,oldValue:n}:null;this.atom_.reportChanged(),i&&pn(this,o)},t.notifyArraySplice_=function(e,t,n){var r=!this.owned_&&!1,i=dn(this),o=i||r?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:yn,index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;this.atom_.reportChanged(),i&&pn(this,o)},t.get_=function(e){if(!(this.legacyMode_&&e>=this.values_.length))return this.atom_.reportObserved(),this.dehanceValue_(this.values_[e]);console.warn("[mobx] Out of bounds read: "+e)},t.set_=function(e,t){var n=this.values_;if(this.legacyMode_&&e>n.length&&r(17,e,n.length),e<n.length){this.atom_;var i=n[e];if(ln(this)){var o=un(this,{type:vn,object:this.proxy_,index:e,newValue:t});if(!o)return;t=o.newValue}(t=this.enhancer_(t,i))!==i&&(n[e]=t,this.notifyArrayChildUpdate_(e,t,i))}else{for(var s=new Array(e+1-n.length),a=0;a<s.length-1;a++)s[a]=void 0;s[s.length-1]=t,this.spliceWithArray_(n.length,0,s)}},e}();function wn(e,t,n,r){void 0===n&&(n="ObservableArray"),void 0===r&&(r=!1),f();var i=new bn(n,t,r,!1);C(i.values_,K,i);var o=new Proxy(i.values_,An);if(i.proxy_=o,e&&e.length){var s=Qe(!0);i.spliceWithArray_(0,0,e),Ue(s)}return o}var Sn={clear:function(){return this.splice(0)},replace:function(e){var t=this[K];return t.spliceWithArray_(0,t.values_.length,e)},toJSON:function(){return this.slice()},splice:function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var o=this[K];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(e);case 2:return o.spliceWithArray_(e,t)}return o.spliceWithArray_(e,t,r)},spliceWithArray:function(e,t,n){return this[K].spliceWithArray_(e,t,n)},push:function(){for(var e=this[K],t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.spliceWithArray_(e.values_.length,0,n),e.values_.length},pop:function(){return this.splice(Math.max(this[K].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var e=this[K],t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.spliceWithArray_(0,0,n),e.values_.length},reverse:function(){return lt.trackingDerivation&&r(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){lt.trackingDerivation&&r(37,"sort");var e=this.slice();return e.sort.apply(e,arguments),this.replace(e),this},remove:function(e){var t=this[K],n=t.dehanceValues_(t.values_).indexOf(e);return n>-1&&(this.splice(n,1),!0)}};function Cn(e,t){"function"==typeof Array.prototype[e]&&(Sn[e]=t(e))}function En(e){return function(){var t=this[K];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_);return n[e].apply(n,arguments)}}function In(e){return function(t,n){var r=this,i=this[K];return i.atom_.reportObserved(),i.dehanceValues_(i.values_)[e]((function(e,i){return t.call(n,e,i,r)}))}}function _n(e){return function(){var t=this,n=this[K];n.atom_.reportObserved();var r=n.dehanceValues_(n.values_),i=arguments[0];return arguments[0]=function(e,n,r){return i(e,n,r,t)},r[e].apply(r,arguments)}}Cn("concat",En),Cn("flat",En),Cn("includes",En),Cn("indexOf",En),Cn("join",En),Cn("lastIndexOf",En),Cn("slice",En),Cn("toString",En),Cn("toLocaleString",En),Cn("every",In),Cn("filter",In),Cn("find",In),Cn("findIndex",In),Cn("flatMap",In),Cn("forEach",In),Cn("map",In),Cn("some",In),Cn("reduce",_n),Cn("reduceRight",_n);var xn,Pn,kn=E("ObservableArrayAdministration",bn);function Bn(e){return A(e)&&kn(e[K])}var On={},Nn="add",Dn="delete";xn=Symbol.iterator,Pn=Symbol.toStringTag;var jn,Tn,Mn=function(){function e(e,t,n){var i=this;void 0===t&&(t=Z),void 0===n&&(n="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[K]=On,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=t,this.name_=n,y(Map)||r(18),this.keysAtom_=Y("ObservableMap.keys()"),this.data_=new Map,this.hasMap_=new Map,Le(!0,(function(){i.merge(e)}))}var t=e.prototype;return t.has_=function(e){return this.data_.has(e)},t.has=function(e){var t=this;if(!lt.trackingDerivation)return this.has_(e);var n=this.hasMap_.get(e);if(!n){var r=n=new Ke(this.has_(e),W,"ObservableMap.key?",!1);this.hasMap_.set(e,r),Lt(r,(function(){return t.hasMap_.delete(e)}))}return n.get()},t.set=function(e,t){var n=this.has_(e);if(ln(this)){var r=un(this,{type:n?vn:Nn,object:this,newValue:t,name:e});if(!r)return this;t=r.newValue}return n?this.updateValue_(e,t):this.addValue_(e,t),this},t.delete=function(e){var t=this;if(this.keysAtom_,ln(this)&&!un(this,{type:Dn,object:this,name:e}))return!1;if(this.has_(e)){var n=dn(this),r=n?{observableKind:"map",debugObjectName:this.name_,type:Dn,object:this,oldValue:this.data_.get(e).value_,name:e}:null;return nn((function(){var n;t.keysAtom_.reportChanged(),null==(n=t.hasMap_.get(e))||n.setNewValue_(!1),t.data_.get(e).setNewValue_(void 0),t.data_.delete(e)})),n&&pn(this,r),!0}return!1},t.updateValue_=function(e,t){var n=this.data_.get(e);if((t=n.prepareNewValue_(t))!==lt.UNCHANGED){var r=dn(this),i=r?{observableKind:"map",debugObjectName:this.name_,type:vn,object:this,oldValue:n.value_,name:e,newValue:t}:null;n.setNewValue_(t),r&&pn(this,i)}},t.addValue_=function(e,t){var n=this;this.keysAtom_,nn((function(){var r,i=new Ke(t,n.enhancer_,"ObservableMap.key",!1);n.data_.set(e,i),t=i.value_,null==(r=n.hasMap_.get(e))||r.setNewValue_(!0),n.keysAtom_.reportChanged()}));var r=dn(this),i=r?{observableKind:"map",debugObjectName:this.name_,type:Nn,object:this,name:e,newValue:t}:null;r&&pn(this,i)},t.get=function(e){return this.has(e)?this.dehanceValue_(this.data_.get(e).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var e=this,t=this.keys();return hr({next:function(){var n=t.next(),r=n.done,i=n.value;return{done:r,value:r?void 0:e.get(i)}}})},t.entries=function(){var e=this,t=this.keys();return hr({next:function(){var n=t.next(),r=n.done,i=n.value;return{done:r,value:r?void 0:[i,e.get(i)]}}})},t[xn]=function(){return this.entries()},t.forEach=function(e,t){for(var n,r=L(this);!(n=r()).done;){var i=n.value,o=i[0],s=i[1];e.call(t,s,o,this)}},t.merge=function(e){var t=this;return Fn(e)&&(e=new Map(e)),nn((function(){b(e)?function(e){var t=Object.keys(e);if(!x)return t;var n=Object.getOwnPropertySymbols(e);return n.length?[].concat(t,n.filter((function(t){return c.propertyIsEnumerable.call(e,t)}))):t}(e).forEach((function(n){return t.set(n,e[n])})):Array.isArray(e)?e.forEach((function(e){var n=e[0],r=e[1];return t.set(n,r)})):I(e)?(e.constructor!==Map&&r(19,e),e.forEach((function(e,n){return t.set(n,e)}))):null!=e&&r(20,e)})),this},t.clear=function(){var e=this;nn((function(){$e((function(){for(var t,n=L(e.keys());!(t=n()).done;){var r=t.value;e.delete(r)}}))}))},t.replace=function(e){var t=this;return nn((function(){for(var n,i=function(e){if(I(e)||Fn(e))return e;if(Array.isArray(e))return new Map(e);if(b(e)){var t=new Map;for(var n in e)t.set(n,e[n]);return t}return r(21,e)}(e),o=new Map,s=!1,a=L(t.data_.keys());!(n=a()).done;){var l=n.value;if(!i.has(l))if(t.delete(l))s=!0;else{var c=t.data_.get(l);o.set(l,c)}}for(var u,d=L(i.entries());!(u=d()).done;){var h=u.value,p=h[0],f=h[1],g=t.data_.has(p);if(t.set(p,f),t.data_.has(p)){var m=t.data_.get(p);o.set(p,m),g||(s=!0)}}if(!s)if(t.data_.size!==o.size)t.keysAtom_.reportChanged();else for(var y=t.data_.keys(),v=o.keys(),A=y.next(),w=v.next();!A.done;){if(A.value!==w.value){t.keysAtom_.reportChanged();break}A=y.next(),w=v.next()}t.data_=o})),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(e,t){return hn(this,e)},t.intercept_=function(e){return cn(this,e)},D(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Pn,get:function(){return"Map"}}]),e}(),Fn=E("ObservableMap",Mn),Rn={};jn=Symbol.iterator,Tn=Symbol.toStringTag;var Ln=function(){function e(e,t,n){void 0===t&&(t=Z),void 0===n&&(n="ObservableSet"),this.name_=void 0,this[K]=Rn,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=n,y(Set)||r(22),this.atom_=Y(this.name_),this.enhancer_=function(e,r){return t(e,r,n)},e&&this.replace(e)}var t=e.prototype;return t.dehanceValue_=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.clear=function(){var e=this;nn((function(){$e((function(){for(var t,n=L(e.data_.values());!(t=n()).done;){var r=t.value;e.delete(r)}}))}))},t.forEach=function(e,t){for(var n,r=L(this);!(n=r()).done;){var i=n.value;e.call(t,i,i,this)}},t.add=function(e){var t=this;if(this.atom_,ln(this)&&!un(this,{type:Nn,object:this,newValue:e}))return this;if(!this.has(e)){nn((function(){t.data_.add(t.enhancer_(e,void 0)),t.atom_.reportChanged()}));var n=dn(this),r=n?{observableKind:"set",debugObjectName:this.name_,type:Nn,object:this,newValue:e}:null;n&&pn(this,r)}return this},t.delete=function(e){var t=this;if(ln(this)&&!un(this,{type:Dn,object:this,oldValue:e}))return!1;if(this.has(e)){var n=dn(this),r=n?{observableKind:"set",debugObjectName:this.name_,type:Dn,object:this,oldValue:e}:null;return nn((function(){t.atom_.reportChanged(),t.data_.delete(e)})),n&&pn(this,r),!0}return!1},t.has=function(e){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(e))},t.entries=function(){var e=0,t=Array.from(this.keys()),n=Array.from(this.values());return hr({next:function(){var r=e;return e+=1,r<n.length?{value:[t[r],n[r]],done:!1}:{done:!0}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var e=this,t=0,n=Array.from(this.data_.values());return hr({next:function(){return t<n.length?{value:e.dehanceValue_(n[t++]),done:!1}:{done:!0}}})},t.replace=function(e){var t=this;return Qn(e)&&(e=new Set(e)),nn((function(){Array.isArray(e)||_(e)?(t.clear(),e.forEach((function(e){return t.add(e)}))):null!=e&&r("Cannot initialize set from "+e)})),this},t.observe_=function(e,t){return hn(this,e)},t.intercept_=function(e){return cn(this,e)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[jn]=function(){return this.values()},D(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Tn,get:function(){return"Set"}}]),e}(),Qn=E("ObservableSet",Ln),Un=Object.create(null),Vn="remove",Kn=function(){function e(e,t,n,r){void 0===t&&(t=new Map),void 0===r&&(r=he),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=e,this.values_=t,this.name_=n,this.defaultAnnotation_=r,this.keysAtom_=new H("ObservableObject.keys"),this.isPlainObject_=b(this.target_)}var t=e.prototype;return t.getObservablePropValue_=function(e){return this.values_.get(e).get()},t.setObservablePropValue_=function(e,t){var n=this.values_.get(e);if(n instanceof Ye)return n.set(t),!0;if(ln(this)){var r=un(this,{type:vn,object:this.proxy_||this.target_,name:e,newValue:t});if(!r)return null;t=r.newValue}if((t=n.prepareNewValue_(t))!==lt.UNCHANGED){var i=dn(this),o=i?{type:vn,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:n.value_,name:e,newValue:t}:null;n.setNewValue_(t),i&&pn(this,o)}return!0},t.get_=function(e){return lt.trackingDerivation&&!B(this.target_,e)&&this.has_(e),this.target_[e]},t.set_=function(e,t,n){return void 0===n&&(n=!1),B(this.target_,e)?this.values_.has(e)?this.setObservablePropValue_(e,t):n?Reflect.set(this.target_,e,t):(this.target_[e]=t,!0):this.extend_(e,{value:t,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,n)},t.has_=function(e){if(!lt.trackingDerivation)return e in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var t=this.pendingKeys_.get(e);return t||(t=new Ke(e in this.target_,W,"ObservableObject.key?",!1),this.pendingKeys_.set(e,t)),t.get()},t.make_=function(e,t){if(!0===t&&(t=this.defaultAnnotation_),!1!==t){if(!(e in this.target_)){var n;if(null!=(n=this.target_[Q])&&n[e])return;r(1,t.annotationType_,this.name_+"."+e.toString())}for(var i=this.target_;i&&i!==c;){var o=a(i,e);if(o){var s=t.make_(this,e,o,i);if(0===s)return;if(1===s)break}i=Object.getPrototypeOf(i)}Zn(this,0,e)}},t.extend_=function(e,t,n,r){if(void 0===r&&(r=!1),!0===n&&(n=this.defaultAnnotation_),!1===n)return this.defineProperty_(e,t,r);var i=n.extend_(this,e,t,r);return i&&Zn(this,0,e),i},t.defineProperty_=function(e,t,n){void 0===n&&(n=!1);try{ht();var r=this.delete_(e);if(!r)return r;if(ln(this)){var i=un(this,{object:this.proxy_||this.target_,name:e,type:Nn,newValue:t.value});if(!i)return null;var o=i.newValue;t.value!==o&&(t=j({},t,{value:o}))}if(n){if(!Reflect.defineProperty(this.target_,e,t))return!1}else l(this.target_,e,t);this.notifyPropertyAddition_(e,t.value)}finally{pt()}return!0},t.defineObservableProperty_=function(e,t,n,r){void 0===r&&(r=!1);try{ht();var i=this.delete_(e);if(!i)return i;if(ln(this)){var o=un(this,{object:this.proxy_||this.target_,name:e,type:Nn,newValue:t});if(!o)return null;t=o.newValue}var s=Yn(e),a={configurable:!lt.safeDescriptors||this.isPlainObject_,enumerable:!0,get:s.get,set:s.set};if(r){if(!Reflect.defineProperty(this.target_,e,a))return!1}else l(this.target_,e,a);var c=new Ke(t,n,"ObservableObject.key",!1);this.values_.set(e,c),this.notifyPropertyAddition_(e,c.value_)}finally{pt()}return!0},t.defineComputedProperty_=function(e,t,n){void 0===n&&(n=!1);try{ht();var r=this.delete_(e);if(!r)return r;if(ln(this)&&!un(this,{object:this.proxy_||this.target_,name:e,type:Nn,newValue:void 0}))return null;t.name||(t.name="ObservableObject.key"),t.context=this.proxy_||this.target_;var i=Yn(e),o={configurable:!lt.safeDescriptors||this.isPlainObject_,enumerable:!1,get:i.get,set:i.set};if(n){if(!Reflect.defineProperty(this.target_,e,o))return!1}else l(this.target_,e,o);this.values_.set(e,new Ye(t)),this.notifyPropertyAddition_(e,void 0)}finally{pt()}return!0},t.delete_=function(e,t){if(void 0===t&&(t=!1),!B(this.target_,e))return!0;if(ln(this)&&!un(this,{object:this.proxy_||this.target_,name:e,type:Vn}))return null;try{var n,r;ht();var i,o=dn(this),s=this.values_.get(e),l=void 0;if(!s&&o&&(l=null==(i=a(this.target_,e))?void 0:i.value),t){if(!Reflect.deleteProperty(this.target_,e))return!1}else delete this.target_[e];if(s&&(this.values_.delete(e),s instanceof Ke&&(l=s.value_),gt(s)),this.keysAtom_.reportChanged(),null==(n=this.pendingKeys_)||null==(r=n.get(e))||r.set(e in this.target_),o){var c={type:Vn,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:l,name:e};o&&pn(this,c)}}finally{pt()}return!0},t.observe_=function(e,t){return hn(this,e)},t.intercept_=function(e){return cn(this,e)},t.notifyPropertyAddition_=function(e,t){var n,r,i=dn(this);if(i){var o=i?{type:Nn,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:e,newValue:t}:null;i&&pn(this,o)}null==(n=this.pendingKeys_)||null==(r=n.get(e))||r.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),P(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function Hn(e,t){var n;if(B(e,K))return e;var r=null!=(n=null==t?void 0:t.name)?n:"ObservableObject",i=new Kn(e,new Map,String(r),function(e){var t;return e?null!=(t=e.defaultDecorator)?t:pe(e):void 0}(t));return S(e,K,i),e}var Gn=E("ObservableObjectAdministration",Kn);function Yn(e){return Un[e]||(Un[e]={get:function(){return this[K].getObservablePropValue_(e)},set:function(t){return this[K].setObservablePropValue_(e,t)}})}function zn(e){return!!A(e)&&Gn(e[K])}function Zn(e,t,n){var r;null==(r=e.target_[Q])||delete r[n]}var Wn,qn,Jn=tr(0),Xn=0,$n=function(){};Wn=$n,qn=Array.prototype,Object.setPrototypeOf?Object.setPrototypeOf(Wn.prototype,qn):void 0!==Wn.prototype.__proto__?Wn.prototype.__proto__=qn:Wn.prototype=qn;var er=function(e,t,n){function r(t,n,r,i){var o;void 0===r&&(r="ObservableArray"),void 0===i&&(i=!1),o=e.call(this)||this;var s=new bn(r,n,i,!0);if(s.proxy_=F(o),C(F(o),K,s),t&&t.length){var a=Qe(!0);o.spliceWithArray(0,0,t),Ue(a)}return Object.defineProperty(F(o),"0",Jn),o}T(r,e);var i=r.prototype;return i.concat=function(){this[K].atom_.reportObserved();for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Array.prototype.concat.apply(this.slice(),t.map((function(e){return Bn(e)?e.slice():e})))},i[n]=function(){var e=this,t=0;return hr({next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0,value:void 0}}})},D(r,[{key:"length",get:function(){return this[K].getArrayLength_()},set:function(e){this[K].setArrayLength_(e)}},{key:t,get:function(){return"Array"}}]),r}($n,Symbol.toStringTag,Symbol.iterator);function tr(e){return{enumerable:!1,configurable:!0,get:function(){return this[K].get_(e)},set:function(t){this[K].set_(e,t)}}}function nr(e){l(er.prototype,""+e,tr(e))}function rr(e){if(e>Xn){for(var t=Xn;t<e+100;t++)nr(t);Xn=e}}function ir(e,t,n){return new er(e,t,n)}function or(e,t){if("object"==typeof e&&null!==e){if(Bn(e))return void 0!==t&&r(23),e[K].atom_;if(Qn(e))return e.atom_;if(Fn(e)){if(void 0===t)return e.keysAtom_;var n=e.data_.get(t)||e.hasMap_.get(t);return n||r(25,t,ar(e)),n}if(zn(e)){if(!t)return r(26);var i=e[K].values_.get(t);return i||r(27,t,ar(e)),i}if(G(e)||ze(e)||wt(e))return e}else if(y(e)&&wt(e[K]))return e[K];r(28)}function sr(e,t){return e||r(29),void 0!==t?sr(or(e,t)):G(e)||ze(e)||wt(e)||Fn(e)||Qn(e)?e:e[K]?e[K]:void r(24,e)}function ar(e,t){var n;if(void 0!==t)n=or(e,t);else{if(Nt(e))return e.name;n=zn(e)||Fn(e)||Qn(e)?sr(e):or(e)}return n.name_}Object.entries(Sn).forEach((function(e){var t=e[0],n=e[1];"concat"!==t&&S(er.prototype,t,n)})),rr(1e3);var lr=c.toString;function cr(e,t,n){return void 0===n&&(n=-1),ur(e,t,n)}function ur(e,t,n,r,i){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!=e)return t!=t;var o=typeof e;if("function"!==o&&"object"!==o&&"object"!=typeof t)return!1;var s=lr.call(e);if(s!==lr.call(t))return!1;switch(s){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":n>=0&&n++}e=dr(e),t=dr(t);var a="[object Array]"===s;if(!a){if("object"!=typeof e||"object"!=typeof t)return!1;var l=e.constructor,c=t.constructor;if(l!==c&&!(y(l)&&l instanceof l&&y(c)&&c instanceof c)&&"constructor"in e&&"constructor"in t)return!1}if(0===n)return!1;n<0&&(n=-1),i=i||[];for(var u=(r=r||[]).length;u--;)if(r[u]===e)return i[u]===t;if(r.push(e),i.push(t),a){if((u=e.length)!==t.length)return!1;for(;u--;)if(!ur(e[u],t[u],n-1,r,i))return!1}else{var d,h=Object.keys(e);if(u=h.length,Object.keys(t).length!==u)return!1;for(;u--;)if(!B(t,d=h[u])||!ur(e[d],t[d],n-1,r,i))return!1}return r.pop(),i.pop(),!0}function dr(e){return Bn(e)?e.slice():I(e)||Fn(e)||_(e)||Qn(e)?Array.from(e.entries()):e}function hr(e){return e[Symbol.iterator]=pr,e}function pr(){return this}["Symbol","Map","Set"].forEach((function(e){void 0===o()[e]&&r("MobX requires global '"+e+"' to be available or polyfilled")})),"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:function(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}},extras:{getDebugName:ar},$mobx:K})},84371:(e,t,n)=>{"use strict";var r="win32"===process.platform,i=n(43335);function o(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r];i&&"."!==i&&(".."===i?n.length&&".."!==n[n.length-1]?n.pop():t&&n.push(".."):n.push(i))}return n}function s(e){for(var t=e.length-1,n=0;n<=t&&!e[n];n++);for(var r=t;r>=0&&!e[r];r--);return 0===n&&r===t?e:n>r?[]:e.slice(n,r+1)}var a=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,l=/^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/,c={};function u(e){var t=a.exec(e),n=(t[1]||"")+(t[2]||""),r=t[3]||"",i=l.exec(r);return[n,i[1],i[2],i[3]]}function d(e){var t=a.exec(e),n=t[1]||"",r=!!n&&":"!==n[1];return{device:n,isUnc:r,isAbsolute:r||!!t[2],tail:t[3]}}function h(e){return"\\\\"+e.replace(/^[\\\/]+/,"").replace(/[\\\/]+/g,"\\")}c.resolve=function(){for(var e="",t="",n=!1,r=arguments.length-1;r>=-1;r--){var s;if(r>=0?s=arguments[r]:e?(s=process.env["="+e])&&s.substr(0,3).toLowerCase()===e.toLowerCase()+"\\"||(s=e+"\\"):s=process.cwd(),!i.isString(s))throw new TypeError("Arguments to path.resolve must be strings");if(s){var a=d(s),l=a.device,c=a.isUnc,u=a.isAbsolute,p=a.tail;if((!l||!e||l.toLowerCase()===e.toLowerCase())&&(e||(e=l),n||(t=p+"\\"+t,n=u),e&&n))break}}return c&&(e=h(e)),e+(n?"\\":"")+(t=o(t.split(/[\\\/]+/),!n).join("\\"))||"."},c.normalize=function(e){var t=d(e),n=t.device,r=t.isUnc,i=t.isAbsolute,s=t.tail,a=/[\\\/]$/.test(s);return(s=o(s.split(/[\\\/]+/),!i).join("\\"))||i||(s="."),s&&a&&(s+="\\"),r&&(n=h(n)),n+(i?"\\":"")+s},c.isAbsolute=function(e){return d(e).isAbsolute},c.join=function(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(!i.isString(n))throw new TypeError("Arguments to path.join must be strings");n&&e.push(n)}var r=e.join("\\");return/^[\\\/]{2}[^\\\/]/.test(e[0])||(r=r.replace(/^[\\\/]{2,}/,"\\")),c.normalize(r)},c.relative=function(e,t){e=c.resolve(e),t=c.resolve(t);for(var n=e.toLowerCase(),r=t.toLowerCase(),i=s(t.split("\\")),o=s(n.split("\\")),a=s(r.split("\\")),l=Math.min(o.length,a.length),u=l,d=0;d<l;d++)if(o[d]!==a[d]){u=d;break}if(0==u)return t;var h=[];for(d=u;d<o.length;d++)h.push("..");return(h=h.concat(i.slice(u))).join("\\")},c._makeLong=function(e){if(!i.isString(e))return e;if(!e)return"";var t=c.resolve(e);return/^[a-zA-Z]\:\\/.test(t)?"\\\\?\\"+t:/^\\\\[^?.]/.test(t)?"\\\\?\\UNC\\"+t.substring(2):e},c.dirname=function(e){var t=u(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},c.basename=function(e,t){var n=u(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},c.extname=function(e){return u(e)[3]},c.format=function(e){if(!i.isObject(e))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof e);var t=e.root||"";if(!i.isString(t))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof e.root);var n=e.dir,r=e.base||"";return n?n[n.length-1]===c.sep?n+r:n+c.sep+r:r},c.parse=function(e){if(!i.isString(e))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var t=u(e);if(!t||4!==t.length)throw new TypeError("Invalid path '"+e+"'");return{root:t[0],dir:t[0]+t[1].slice(0,-1),base:t[2],ext:t[3],name:t[2].slice(0,t[2].length-t[3].length)}},c.sep="\\",c.delimiter=";";var p=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,f={};function g(e){return p.exec(e).slice(1)}f.resolve=function(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?arguments[n]:process.cwd();if(!i.isString(r))throw new TypeError("Arguments to path.resolve must be strings");r&&(e=r+"/"+e,t="/"===r[0])}return(t?"/":"")+(e=o(e.split("/"),!t).join("/"))||"."},f.normalize=function(e){var t=f.isAbsolute(e),n=e&&"/"===e[e.length-1];return(e=o(e.split("/"),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e},f.isAbsolute=function(e){return"/"===e.charAt(0)},f.join=function(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];if(!i.isString(n))throw new TypeError("Arguments to path.join must be strings");n&&(e+=e?"/"+n:n)}return f.normalize(e)},f.relative=function(e,t){e=f.resolve(e).substr(1),t=f.resolve(t).substr(1);for(var n=s(e.split("/")),r=s(t.split("/")),i=Math.min(n.length,r.length),o=i,a=0;a<i;a++)if(n[a]!==r[a]){o=a;break}var l=[];for(a=o;a<n.length;a++)l.push("..");return(l=l.concat(r.slice(o))).join("/")},f._makeLong=function(e){return e},f.dirname=function(e){var t=g(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},f.basename=function(e,t){var n=g(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},f.extname=function(e){return g(e)[3]},f.format=function(e){if(!i.isObject(e))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof e);var t=e.root||"";if(!i.isString(t))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof e.root);return(e.dir?e.dir+f.sep:"")+(e.base||"")},f.parse=function(e){if(!i.isString(e))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var t=g(e);if(!t||4!==t.length)throw new TypeError("Invalid path '"+e+"'");return t[1]=t[1]||"",t[2]=t[2]||"",t[3]=t[3]||"",{root:t[0],dir:t[0]+t[1].slice(0,-1),base:t[2],ext:t[3],name:t[2].slice(0,t[2].length-t[3].length)}},f.sep="/",f.delimiter=":",e.exports=r?c:f,e.exports.posix=f,e.exports.win32=c},54089:()=>{Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean},18267:()=>{Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}},6869:()=>{!function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(Prism)},89651:()=>{!function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Prism)},83701:()=>{!function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism)},64883:()=>{Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript},25031:()=>{!function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(/<inner>/g,(function(){return t})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+o+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+o+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike","code-snippet"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n<r;n++){var i=t[n];if("code"===i.type){var o=i.content[1],s=i.content[3];if(o&&s&&"code-language"===o.type&&"code-block"===s.type&&"string"==typeof o.content){var a=o.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),l="language-"+(a=(/[a-z][\w-]*/i.exec(a)||[""])[0].toLowerCase());s.alias?"string"==typeof s.alias?s.alias=[s.alias,l]:s.alias.push(l):s.alias=[l]}}else e(i.content)}}(e.tokens)})),e.hooks.add("wrap",(function(t){if("code-block"===t.type){for(var n="",r=0,i=t.classes.length;r<i;r++){var o=t.classes[r],c=/language-(.+)/.exec(o);if(c){n=c[1];break}}var u=e.languages[n];if(u)t.content=e.highlight(t.content.replace(s,"").replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,(function(e,t){var n;return"#"===(t=t.toLowerCase())[0]?(n="x"===t[1]?parseInt(t.slice(2),16):Number(t.slice(1)),l(n)):a[t]||e})),u,n);else if(n&&"none"!==n&&e.plugins.autoloader){var d="md-"+(new Date).valueOf()+"-"+Math.floor(1e16*Math.random());t.attributes.id=d,e.plugins.autoloader.loadLanguages(n,(function(){var t=document.getElementById(d);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))}))}}}));var s=RegExp(e.languages.markup.tag.pattern.source,"gi"),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(Prism)},55744:()=>{Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&amp;/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml},81412:()=>{Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec["class-name"],Prism.languages.objc=Prism.languages.objectivec},93133:()=>{!function(e){var t=e.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};t.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:t},boolean:t.boolean,variable:t.variable}}(Prism)},93980:()=>{Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python},80037:()=>{!function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,(function(){return t}));t=t.replace(/<self>/g,(function(){return/[^\s\S]/.source})),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(Prism)},98513:()=>{Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}},54422:()=>{Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ \t]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift["string-literal"].forEach((function(e){e.inside.interpolation.inside=Prism.languages.swift}))},63083:()=>{!function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(Prism)},18476:(e,t,n)=>{var r=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof o?new o(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function e(t,n){var r,o;switch(n=n||{},i.util.type(t)){case"Object":if(o=i.util.objId(t),n[o])return n[o];for(var s in r={},n[o]=r,t)t.hasOwnProperty(s)&&(r[s]=e(t[s],n));return r;case"Array":return o=i.util.objId(t),n[o]?n[o]:(r=[],n[o]=r,t.forEach((function(t,i){r[i]=e(t,n)})),r);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return"none"},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,"gi"),""),e.classList.add("language-"+n)},currentScript:function(){if("undefined"==typeof document)return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName("script");for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r="no-"+t;e;){var i=e.classList;if(i.contains(t))return!0;if(i.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,t){var n=i.util.clone(i.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){var o=(r=r||i.languages)[e],s={};for(var a in o)if(o.hasOwnProperty(a)){if(a==t)for(var l in n)n.hasOwnProperty(l)&&(s[l]=n[l]);n.hasOwnProperty(a)||(s[a]=o[a])}var c=r[e];return r[e]=s,i.languages.DFS(i.languages,(function(t,n){n===c&&t!=e&&(this[t]=s)})),s},DFS:function e(t,n,r,o){o=o||{};var s=i.util.objId;for(var a in t)if(t.hasOwnProperty(a)){n.call(t,a,t[a],r||a);var l=t[a],c=i.util.type(l);"Object"!==c||o[s(l)]?"Array"!==c||o[s(l)]||(o[s(l)]=!0,e(l,n,a,o)):(o[s(l)]=!0,e(l,n,null,o))}}},plugins:{},highlightAll:function(e,t){i.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};i.hooks.run("before-highlightall",r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),i.hooks.run("before-all-elements-highlight",r);for(var o,s=0;o=r.elements[s++];)i.highlightElement(o,!0===t,r.callback)},highlightElement:function(t,n,r){var o=i.util.getLanguage(t),s=i.languages[o];i.util.setLanguage(t,o);var a=t.parentElement;a&&"pre"===a.nodeName.toLowerCase()&&i.util.setLanguage(a,o);var l={element:t,language:o,grammar:s,code:t.textContent};function c(e){l.highlightedCode=e,i.hooks.run("before-insert",l),l.element.innerHTML=l.highlightedCode,i.hooks.run("after-highlight",l),i.hooks.run("complete",l),r&&r.call(l.element)}if(i.hooks.run("before-sanity-check",l),(a=l.element.parentElement)&&"pre"===a.nodeName.toLowerCase()&&!a.hasAttribute("tabindex")&&a.setAttribute("tabindex","0"),!l.code)return i.hooks.run("complete",l),void(r&&r.call(l.element));if(i.hooks.run("before-highlight",l),l.grammar)if(n&&e.Worker){var u=new Worker(i.filename);u.onmessage=function(e){c(e.data)},u.postMessage(JSON.stringify({language:l.language,code:l.code,immediateClose:!0}))}else c(i.highlight(l.code,l.grammar,l.language));else c(i.util.encode(l.code))},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(i.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=i.tokenize(r.code,r.grammar),i.hooks.run("after-tokenize",r),o.stringify(i.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new l;return c(i,i.head,e),a(e,i,t,i.head,0),function(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}(i)},hooks:{all:{},add:function(e,t){var n=i.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=i.hooks.all[e];if(n&&n.length)for(var r,o=0;r=n[o++];)r(t)}},Token:o};function o(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function s(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var o=i[1].length;i.index+=o,i[0]=i[0].slice(o)}return i}function a(e,t,n,r,l,d){for(var h in n)if(n.hasOwnProperty(h)&&n[h]){var p=n[h];p=Array.isArray(p)?p:[p];for(var f=0;f<p.length;++f){if(d&&d.cause==h+","+f)return;var g=p[f],m=g.inside,y=!!g.lookbehind,v=!!g.greedy,A=g.alias;if(v&&!g.pattern.global){var b=g.pattern.toString().match(/[imsuy]*$/)[0];g.pattern=RegExp(g.pattern.source,b+"g")}for(var w=g.pattern||g,S=r.next,C=l;S!==t.tail&&!(d&&C>=d.reach);C+=S.value.length,S=S.next){var E=S.value;if(t.length>e.length)return;if(!(E instanceof o)){var I,_=1;if(v){if(!(I=s(w,C,e,y))||I.index>=e.length)break;var x=I.index,P=I.index+I[0].length,k=C;for(k+=S.value.length;x>=k;)k+=(S=S.next).value.length;if(C=k-=S.value.length,S.value instanceof o)continue;for(var B=S;B!==t.tail&&(k<P||"string"==typeof B.value);B=B.next)_++,k+=B.value.length;_--,E=e.slice(C,k),I.index-=C}else if(!(I=s(w,0,E,y)))continue;x=I.index;var O=I[0],N=E.slice(0,x),D=E.slice(x+O.length),j=C+E.length;d&&j>d.reach&&(d.reach=j);var T=S.prev;if(N&&(T=c(t,T,N),C+=N.length),u(t,T,_),S=c(t,T,new o(h,m?i.tokenize(O,m):O,A,O)),D&&c(t,S,D),_>1){var M={cause:h+","+f,reach:j};a(e,t,n,S.prev,C,M),d&&M.reach>d.reach&&(d.reach=M.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function c(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function u(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}if(e.Prism=i,o.stringify=function e(t,n){if("string"==typeof t)return t;if(Array.isArray(t)){var r="";return t.forEach((function(t){r+=e(t,n)})),r}var o={type:t.type,content:e(t.content,n),tag:"span",classes:["token",t.type],attributes:{},language:n},s=t.alias;s&&(Array.isArray(s)?Array.prototype.push.apply(o.classes,s):o.classes.push(s)),i.hooks.run("wrap",o);var a="";for(var l in o.attributes)a+=" "+l+'="'+(o.attributes[l]||"").replace(/"/g,"&quot;")+'"';return"<"+o.tag+' class="'+o.classes.join(" ")+'"'+a+">"+o.content+"</"+o.tag+">"},!e.document)return e.addEventListener?(i.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),r=n.language,o=n.code,s=n.immediateClose;e.postMessage(i.highlight(o,i.languages[r],r)),s&&e.close()}),!1),i):i;var d=i.util.currentScript();function h(){i.manual||i.highlightAll()}if(d&&(i.filename=d.src,d.hasAttribute("data-manual")&&(i.manual=!0)),!i.manual){var p=document.readyState;"loading"===p||"interactive"===p&&d&&d.defer?document.addEventListener("DOMContentLoaded",h):window.requestAnimationFrame?window.requestAnimationFrame(h):window.setTimeout(h,16)}return i}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=r),void 0!==n.g&&(n.g.Prism=r),r.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},r.languages.markup.tag.inside["attr-value"].inside.entity=r.languages.markup.entity,r.languages.markup.doctype.inside["internal-subset"].inside=r.languages.markup,r.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&amp;/,"&"))})),Object.defineProperty(r.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:r.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};i["language-"+t]={pattern:/[\s\S]+/,inside:r.languages[t]};var o={};o[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:i},r.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(r.languages.markup.tag,"addAttribute",{value:function(e,t){r.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:r.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),r.languages.html=r.languages.markup,r.languages.mathml=r.languages.markup,r.languages.svg=r.languages.markup,r.languages.xml=r.languages.extend("markup",{}),r.languages.ssml=r.languages.xml,r.languages.atom=r.languages.xml,r.languages.rss=r.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(r),r.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},r.languages.javascript=r.languages.extend("clike",{"class-name":[r.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),r.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,r.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:r.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:r.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:r.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:r.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:r.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),r.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:r.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),r.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),r.languages.markup&&(r.languages.markup.tag.addInlined("script","javascript"),r.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),r.languages.js=r.languages.javascript,function(){if(void 0!==r&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},t="data-src-status",n="loading",i="loaded",o="pre[data-src]:not(["+t+'="'+i+'"]):not(['+t+'="'+n+'"])';r.hooks.add("before-highlightall",(function(e){e.selector+=", "+o})),r.hooks.add("before-sanity-check",(function(s){var a=s.element;if(a.matches(o)){s.code="",a.setAttribute(t,n);var l=a.appendChild(document.createElement("CODE"));l.textContent="Loading…";var c=a.getAttribute("data-src"),u=s.language;if("none"===u){var d=(/\.(\w+)$/.exec(c)||[,"none"])[1];u=e[d]||d}r.util.setLanguage(l,u),r.util.setLanguage(a,u);var h=r.plugins.autoloader;h&&h.loadLanguages(u),function(e,n,o){var s=new XMLHttpRequest;s.open("GET",e,!0),s.onreadystatechange=function(){4==s.readyState&&(s.status<400&&s.responseText?function(e){a.setAttribute(t,i);var n=function(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||"");if(t){var n=Number(t[1]),r=t[2],i=t[3];return r?i?[n,Number(i)]:[n,void 0]:[n,n]}}(a.getAttribute("data-range"));if(n){var o=e.split(/\r\n?|\n/g),s=n[0],c=null==n[1]?o.length:n[1];s<0&&(s+=o.length),s=Math.max(0,Math.min(s-1,o.length)),c<0&&(c+=o.length),c=Math.max(0,Math.min(c,o.length)),e=o.slice(s,c).join("\n"),a.hasAttribute("data-start")||a.setAttribute("data-start",String(s+1))}l.textContent=e,r.highlightElement(l)}(s.responseText):s.status>=400?o("✖ Error "+s.status+" while fetching file: "+s.statusText):o("✖ Error: File does not exist or is empty"))},s.send(null)}(c,0,(function(e){a.setAttribute(t,"failed"),l.textContent=e}))}})),r.plugins.fileHighlight={highlight:function(e){for(var t,n=(e||document).querySelectorAll(o),i=0;t=n[i++];)r.highlightElement(t)}};var s=!1;r.fileHighlight=function(){s||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),s=!0),r.plugins.fileHighlight.highlight.apply(this,arguments)}}}()},52967:(e,t,n)=>{"use strict";var r=n(2784),i=n(22941);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,a={};function l(e,t){c(e,t),c(e+"Capture",t)}function c(e,t){for(a[e]=t,e=0;e<t.length;e++)s.add(t[e])}var u=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),d=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},f={};function g(e,t,n,r,i,o,s){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var m={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){m[e]=new g(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];m[t]=new g(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){m[e]=new g(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){m[e]=new g(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){m[e]=new g(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){m[e]=new g(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){m[e]=new g(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){m[e]=new g(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){m[e]=new g(e,5,!1,e.toLowerCase(),null,!1,!1)}));var y=/[\-:]([a-z])/g;function v(e){return e[1].toUpperCase()}function A(e,t,n,r){var i=m.hasOwnProperty(t)?m[t]:null;(null!==i?0!==i.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!d.call(f,e)||!d.call(p,e)&&(h.test(e)?f[e]=!0:(p[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(y,v);m[t]=new g(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(y,v);m[t]=new g(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(y,v);m[t]=new g(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){m[e]=new g(e,1,!1,e.toLowerCase(),null,!1,!1)})),m.xlinkHref=new g("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){m[e]=new g(e,1,!1,e.toLowerCase(),null,!0,!0)}));var b=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for("react.element"),S=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),_=Symbol.for("react.provider"),x=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),N=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var D=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var j=Symbol.iterator;function T(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=j&&e[j]||e["@@iterator"])?e:null}var M,F=Object.assign;function R(e){if(void 0===M)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);M=t&&t[1]||""}return"\n"+M+e}var L=!1;function Q(e,t){if(!e||L)return"";L=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&"string"==typeof t.stack){for(var i=t.stack.split("\n"),o=r.stack.split("\n"),s=i.length-1,a=o.length-1;1<=s&&0<=a&&i[s]!==o[a];)a--;for(;1<=s&&0<=a;s--,a--)if(i[s]!==o[a]){if(1!==s||1!==a)do{if(s--,0>--a||i[s]!==o[a]){var l="\n"+i[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=s&&0<=a);break}}}finally{L=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?R(e):""}function U(e){switch(e.tag){case 5:return R(e.type);case 16:return R("Lazy");case 13:return R("Suspense");case 19:return R("SuspenseList");case 0:case 2:case 15:return Q(e.type,!1);case 11:return Q(e.type.render,!1);case 1:return Q(e.type,!0);default:return""}}function V(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case C:return"Fragment";case S:return"Portal";case I:return"Profiler";case E:return"StrictMode";case k:return"Suspense";case B:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case x:return(e.displayName||"Context")+".Consumer";case _:return(e._context.displayName||"Context")+".Provider";case P:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case O:return null!==(t=e.displayName||null)?t:V(e.type)||"Memo";case N:t=e._payload,e=e._init;try{return V(e(t))}catch(e){}}return null}function K(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return V(t);case 8:return t===E?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function H(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function G(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function Y(e){e._valueTracker||(e._valueTracker=function(e){var t=G(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function z(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=G(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function Z(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function W(e,t){var n=t.checked;return F({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function q(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=H(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function J(e,t){null!=(t=t.checked)&&A(e,"checked",t,!1)}function X(e,t){J(e,t);var n=H(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ee(e,t.type,n):t.hasOwnProperty("defaultValue")&&ee(e,t.type,H(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function $(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ee(e,t,n){"number"===t&&Z(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var te=Array.isArray;function ne(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+H(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function re(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(o(91));return F({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ie(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(o(92));if(te(n)){if(1<n.length)throw Error(o(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:H(n)}}function oe(e,t){var n=H(t.value),r=H(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function se(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function ae(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function le(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?ae(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ce,ue,de=(ue=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ce=ce||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return ue(e,t)}))}:ue);function he(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var pe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},fe=["Webkit","ms","Moz","O"];function ge(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||pe.hasOwnProperty(e)&&pe[e]?(""+t).trim():t+"px"}function me(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=ge(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(pe).forEach((function(e){fe.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),pe[t]=pe[e]}))}));var ye=F({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ve(e,t){if(t){if(ye[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(o(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(o(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(o(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(o(62))}}function Ae(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var be=null;function we(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Se=null,Ce=null,Ee=null;function Ie(e){if(e=mi(e)){if("function"!=typeof Se)throw Error(o(280));var t=e.stateNode;t&&(t=vi(t),Se(e.stateNode,e.type,t))}}function _e(e){Ce?Ee?Ee.push(e):Ee=[e]:Ce=e}function xe(){if(Ce){var e=Ce,t=Ee;if(Ee=Ce=null,Ie(e),t)for(e=0;e<t.length;e++)Ie(t[e])}}function Pe(e,t){return e(t)}function ke(){}var Be=!1;function Oe(e,t,n){if(Be)return e(t,n);Be=!0;try{return Pe(e,t,n)}finally{Be=!1,(null!==Ce||null!==Ee)&&(ke(),xe())}}function Ne(e,t){var n=e.stateNode;if(null===n)return null;var r=vi(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(o(231,t,typeof n));return n}var De=!1;if(u)try{var je={};Object.defineProperty(je,"passive",{get:function(){De=!0}}),window.addEventListener("test",je,je),window.removeEventListener("test",je,je)}catch(ue){De=!1}function Te(e,t,n,r,i,o,s,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(e){this.onError(e)}}var Me=!1,Fe=null,Re=!1,Le=null,Qe={onError:function(e){Me=!0,Fe=e}};function Ue(e,t,n,r,i,o,s,a,l){Me=!1,Fe=null,Te.apply(Qe,arguments)}function Ve(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Ke(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&null!==(e=e.alternate)&&(t=e.memoizedState),null!==t)return t.dehydrated}return null}function He(e){if(Ve(e)!==e)throw Error(o(188))}function Ge(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=Ve(e)))throw Error(o(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var s=i.alternate;if(null===s){if(null!==(r=i.return)){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return He(i),e;if(s===r)return He(i),t;s=s.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=s;else{for(var a=!1,l=i.child;l;){if(l===n){a=!0,n=i,r=s;break}if(l===r){a=!0,r=i,n=s;break}l=l.sibling}if(!a){for(l=s.child;l;){if(l===n){a=!0,n=s,r=i;break}if(l===r){a=!0,r=s,n=i;break}l=l.sibling}if(!a)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(3!==n.tag)throw Error(o(188));return n.stateNode.current===n?e:t}(e))?Ye(e):null}function Ye(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=Ye(e);if(null!==t)return t;e=e.sibling}return null}var ze=i.unstable_scheduleCallback,Ze=i.unstable_cancelCallback,We=i.unstable_shouldYield,qe=i.unstable_requestPaint,Je=i.unstable_now,Xe=i.unstable_getCurrentPriorityLevel,$e=i.unstable_ImmediatePriority,et=i.unstable_UserBlockingPriority,tt=i.unstable_NormalPriority,nt=i.unstable_LowPriority,rt=i.unstable_IdlePriority,it=null,ot=null,st=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(at(e)/lt|0)|0},at=Math.log,lt=Math.LN2,ct=64,ut=4194304;function dt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ht(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=268435455&n;if(0!==s){var a=s&~i;0!==a?r=dt(a):0!=(o&=s)&&(r=dt(o))}else 0!=(s=n&~i)?r=dt(s):0!==o&&(r=dt(o));if(0===r)return 0;if(0!==t&&t!==r&&0==(t&i)&&((i=r&-r)>=(o=t&-t)||16===i&&0!=(4194240&o)))return t;if(0!=(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-st(t)),r|=e[n],t&=~i;return r}function pt(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function ft(e){return 0!=(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function gt(){var e=ct;return 0==(4194240&(ct<<=1))&&(ct=64),e}function mt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function yt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-st(t)]=n}function vt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-st(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var At=0;function bt(e){return 1<(e&=-e)?4<e?0!=(268435455&e)?16:536870912:4:1}var wt,St,Ct,Et,It,_t=!1,xt=[],Pt=null,kt=null,Bt=null,Ot=new Map,Nt=new Map,Dt=[],jt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Tt(e,t){switch(e){case"focusin":case"focusout":Pt=null;break;case"dragenter":case"dragleave":kt=null;break;case"mouseover":case"mouseout":Bt=null;break;case"pointerover":case"pointerout":Ot.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Nt.delete(t.pointerId)}}function Mt(e,t,n,r,i,o){return null===e||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},null!==t&&null!==(t=mi(t))&&St(t),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function Ft(e){var t=gi(e.target);if(null!==t){var n=Ve(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Ke(n)))return e.blockedOn=t,void It(e.priority,(function(){Ct(n)}))}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Rt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Wt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=mi(n))&&St(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);be=r,n.target.dispatchEvent(r),be=null,t.shift()}return!0}function Lt(e,t,n){Rt(e)&&n.delete(t)}function Qt(){_t=!1,null!==Pt&&Rt(Pt)&&(Pt=null),null!==kt&&Rt(kt)&&(kt=null),null!==Bt&&Rt(Bt)&&(Bt=null),Ot.forEach(Lt),Nt.forEach(Lt)}function Ut(e,t){e.blockedOn===t&&(e.blockedOn=null,_t||(_t=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Qt)))}function Vt(e){function t(t){return Ut(t,e)}if(0<xt.length){Ut(xt[0],e);for(var n=1;n<xt.length;n++){var r=xt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==Pt&&Ut(Pt,e),null!==kt&&Ut(kt,e),null!==Bt&&Ut(Bt,e),Ot.forEach(t),Nt.forEach(t),n=0;n<Dt.length;n++)(r=Dt[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Dt.length&&null===(n=Dt[0]).blockedOn;)Ft(n),null===n.blockedOn&&Dt.shift()}var Kt=b.ReactCurrentBatchConfig,Ht=!0;function Gt(e,t,n,r){var i=At,o=Kt.transition;Kt.transition=null;try{At=1,zt(e,t,n,r)}finally{At=i,Kt.transition=o}}function Yt(e,t,n,r){var i=At,o=Kt.transition;Kt.transition=null;try{At=4,zt(e,t,n,r)}finally{At=i,Kt.transition=o}}function zt(e,t,n,r){if(Ht){var i=Wt(e,t,n,r);if(null===i)Ur(e,t,r,Zt,n),Tt(e,r);else if(function(e,t,n,r,i){switch(t){case"focusin":return Pt=Mt(Pt,e,t,n,r,i),!0;case"dragenter":return kt=Mt(kt,e,t,n,r,i),!0;case"mouseover":return Bt=Mt(Bt,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return Ot.set(o,Mt(Ot.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,Nt.set(o,Mt(Nt.get(o)||null,e,t,n,r,i)),!0}return!1}(i,e,t,n,r))r.stopPropagation();else if(Tt(e,r),4&t&&-1<jt.indexOf(e)){for(;null!==i;){var o=mi(i);if(null!==o&&wt(o),null===(o=Wt(e,t,n,r))&&Ur(e,t,r,Zt,n),o===i)break;i=o}null!==i&&r.stopPropagation()}else Ur(e,t,r,null,n)}}var Zt=null;function Wt(e,t,n,r){if(Zt=null,null!==(e=gi(e=we(r))))if(null===(t=Ve(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=Ke(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Zt=e,null}function qt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Xe()){case $e:return 1;case et:return 4;case tt:case nt:return 16;case rt:return 536870912;default:return 16}default:return 16}}var Jt=null,Xt=null,$t=null;function en(){if($t)return $t;var e,t,n=Xt,r=n.length,i="value"in Jt?Jt.value:Jt.textContent,o=i.length;for(e=0;e<r&&n[e]===i[e];e++);var s=r-e;for(t=1;t<=s&&n[r-t]===i[o-t];t++);return $t=i.slice(e,1<t?1-t:void 0)}function tn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function nn(){return!0}function rn(){return!1}function on(e){function t(t,n,r,i,o){for(var s in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(s)&&(t=e[s],this[s]=t?t(i):i[s]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?nn:rn,this.isPropagationStopped=rn,this}return F(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=nn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=nn)},persist:function(){},isPersistent:nn}),t}var sn,an,ln,cn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},un=on(cn),dn=F({},cn,{view:0,detail:0}),hn=on(dn),pn=F({},dn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:En,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ln&&(ln&&"mousemove"===e.type?(sn=e.screenX-ln.screenX,an=e.screenY-ln.screenY):an=sn=0,ln=e),sn)},movementY:function(e){return"movementY"in e?e.movementY:an}}),fn=on(pn),gn=on(F({},pn,{dataTransfer:0})),mn=on(F({},dn,{relatedTarget:0})),yn=on(F({},cn,{animationName:0,elapsedTime:0,pseudoElement:0})),vn=on(F({},cn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),An=on(F({},cn,{data:0})),bn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Sn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Cn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Sn[e])&&!!t[e]}function En(){return Cn}var In=on(F({},dn,{key:function(e){if(e.key){var t=bn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=tn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?wn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:En,charCode:function(e){return"keypress"===e.type?tn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?tn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),_n=on(F({},pn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),xn=on(F({},dn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:En})),Pn=on(F({},cn,{propertyName:0,elapsedTime:0,pseudoElement:0})),kn=on(F({},pn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Bn=[9,13,27,32],On=u&&"CompositionEvent"in window,Nn=null;u&&"documentMode"in document&&(Nn=document.documentMode);var Dn=u&&"TextEvent"in window&&!Nn,jn=u&&(!On||Nn&&8<Nn&&11>=Nn),Tn=String.fromCharCode(32),Mn=!1;function Fn(e,t){switch(e){case"keyup":return-1!==Bn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Ln=!1,Qn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Un(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Qn[e.type]:"textarea"===t}function Vn(e,t,n,r){_e(r),0<(t=Kr(t,"onChange")).length&&(n=new un("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Kn=null,Hn=null;function Gn(e){Tr(e,0)}function Yn(e){if(z(yi(e)))return e}function zn(e,t){if("change"===e)return t}var Zn=!1;if(u){var Wn;if(u){var qn="oninput"in document;if(!qn){var Jn=document.createElement("div");Jn.setAttribute("oninput","return;"),qn="function"==typeof Jn.oninput}Wn=qn}else Wn=!1;Zn=Wn&&(!document.documentMode||9<document.documentMode)}function Xn(){Kn&&(Kn.detachEvent("onpropertychange",$n),Hn=Kn=null)}function $n(e){if("value"===e.propertyName&&Yn(Hn)){var t=[];Vn(t,Hn,e,we(e)),Oe(Gn,t)}}function er(e,t,n){"focusin"===e?(Xn(),Hn=n,(Kn=t).attachEvent("onpropertychange",$n)):"focusout"===e&&Xn()}function tr(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Yn(Hn)}function nr(e,t){if("click"===e)return Yn(t)}function rr(e,t){if("input"===e||"change"===e)return Yn(t)}var ir="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function or(e,t){if(ir(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!d.call(t,i)||!ir(e[i],t[i]))return!1}return!0}function sr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ar(e,t){var n,r=sr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=sr(r)}}function lr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?lr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function cr(){for(var e=window,t=Z();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=Z((e=t.contentWindow).document)}return t}function ur(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function dr(e){var t=cr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&lr(n.ownerDocument.documentElement,n)){if(null!==r&&ur(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=void 0===r.end?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=ar(n,o);var s=ar(n,r);i&&s&&(1!==e.rangeCount||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&((t=t.createRange()).setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var hr=u&&"documentMode"in document&&11>=document.documentMode,pr=null,fr=null,gr=null,mr=!1;function yr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;mr||null==pr||pr!==Z(r)||(r="selectionStart"in(r=pr)&&ur(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},gr&&or(gr,r)||(gr=r,0<(r=Kr(fr,"onSelect")).length&&(t=new un("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=pr)))}function vr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ar={animationend:vr("Animation","AnimationEnd"),animationiteration:vr("Animation","AnimationIteration"),animationstart:vr("Animation","AnimationStart"),transitionend:vr("Transition","TransitionEnd")},br={},wr={};function Sr(e){if(br[e])return br[e];if(!Ar[e])return e;var t,n=Ar[e];for(t in n)if(n.hasOwnProperty(t)&&t in wr)return br[e]=n[t];return e}u&&(wr=document.createElement("div").style,"AnimationEvent"in window||(delete Ar.animationend.animation,delete Ar.animationiteration.animation,delete Ar.animationstart.animation),"TransitionEvent"in window||delete Ar.transitionend.transition);var Cr=Sr("animationend"),Er=Sr("animationiteration"),Ir=Sr("animationstart"),_r=Sr("transitionend"),xr=new Map,Pr="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function kr(e,t){xr.set(e,t),l(t,[e])}for(var Br=0;Br<Pr.length;Br++){var Or=Pr[Br];kr(Or.toLowerCase(),"on"+(Or[0].toUpperCase()+Or.slice(1)))}kr(Cr,"onAnimationEnd"),kr(Er,"onAnimationIteration"),kr(Ir,"onAnimationStart"),kr("dblclick","onDoubleClick"),kr("focusin","onFocus"),kr("focusout","onBlur"),kr(_r,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Dr=new Set("cancel close invalid load scroll toggle".split(" ").concat(Nr));function jr(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,i,s,a,l,c){if(Ue.apply(this,arguments),Me){if(!Me)throw Error(o(198));var u=Fe;Me=!1,Fe=null,Re||(Re=!0,Le=u)}}(r,t,void 0,e),e.currentTarget=null}function Tr(e,t){t=0!=(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==o&&i.isPropagationStopped())break e;jr(i,a,c),o=l}else for(s=0;s<r.length;s++){if(l=(a=r[s]).instance,c=a.currentTarget,a=a.listener,l!==o&&i.isPropagationStopped())break e;jr(i,a,c),o=l}}}if(Re)throw e=Le,Re=!1,Le=null,e}function Mr(e,t){var n=t[hi];void 0===n&&(n=t[hi]=new Set);var r=e+"__bubble";n.has(r)||(Qr(t,e,2,!1),n.add(r))}function Fr(e,t,n){var r=0;t&&(r|=4),Qr(n,e,r,t)}var Rr="_reactListening"+Math.random().toString(36).slice(2);function Lr(e){if(!e[Rr]){e[Rr]=!0,s.forEach((function(t){"selectionchange"!==t&&(Dr.has(t)||Fr(t,!1,e),Fr(t,!0,e))}));var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Rr]||(t[Rr]=!0,Fr("selectionchange",!1,t))}}function Qr(e,t,n,r){switch(qt(t)){case 1:var i=Gt;break;case 4:i=Yt;break;default:i=zt}n=i.bind(null,t,n,e),i=void 0,!De||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Ur(e,t,n,r,i){var o=r;if(0==(1&t)&&0==(2&t)&&null!==r)e:for(;;){if(null===r)return;var s=r.tag;if(3===s||4===s){var a=r.stateNode.containerInfo;if(a===i||8===a.nodeType&&a.parentNode===i)break;if(4===s)for(s=r.return;null!==s;){var l=s.tag;if((3===l||4===l)&&((l=s.stateNode.containerInfo)===i||8===l.nodeType&&l.parentNode===i))return;s=s.return}for(;null!==a;){if(null===(s=gi(a)))return;if(5===(l=s.tag)||6===l){r=o=s;continue e}a=a.parentNode}}r=r.return}Oe((function(){var r=o,i=we(n),s=[];e:{var a=xr.get(e);if(void 0!==a){var l=un,c=e;switch(e){case"keypress":if(0===tn(n))break e;case"keydown":case"keyup":l=In;break;case"focusin":c="focus",l=mn;break;case"focusout":c="blur",l=mn;break;case"beforeblur":case"afterblur":l=mn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=fn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=gn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=xn;break;case Cr:case Er:case Ir:l=yn;break;case _r:l=Pn;break;case"scroll":l=hn;break;case"wheel":l=kn;break;case"copy":case"cut":case"paste":l=vn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=_n}var u=0!=(4&t),d=!u&&"scroll"===e,h=u?null!==a?a+"Capture":null:a;u=[];for(var p,f=r;null!==f;){var g=(p=f).stateNode;if(5===p.tag&&null!==g&&(p=g,null!==h&&null!=(g=Ne(f,h))&&u.push(Vr(f,g,p))),d)break;f=f.return}0<u.length&&(a=new l(a,c,null,n,i),s.push({event:a,listeners:u}))}}if(0==(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(a="mouseover"===e||"pointerover"===e)||n===be||!(c=n.relatedTarget||n.fromElement)||!gi(c)&&!c[di])&&(l||a)&&(a=i.window===i?i:(a=i.ownerDocument)?a.defaultView||a.parentWindow:window,l?(l=r,null!==(c=(c=n.relatedTarget||n.toElement)?gi(c):null)&&(c!==(d=Ve(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(l=null,c=r),l!==c)){if(u=fn,g="onMouseLeave",h="onMouseEnter",f="mouse","pointerout"!==e&&"pointerover"!==e||(u=_n,g="onPointerLeave",h="onPointerEnter",f="pointer"),d=null==l?a:yi(l),p=null==c?a:yi(c),(a=new u(g,f+"leave",l,n,i)).target=d,a.relatedTarget=p,g=null,gi(i)===r&&((u=new u(h,f+"enter",c,n,i)).target=p,u.relatedTarget=d,g=u),d=g,l&&c)e:{for(h=c,f=0,p=u=l;p;p=Hr(p))f++;for(p=0,g=h;g;g=Hr(g))p++;for(;0<f-p;)u=Hr(u),f--;for(;0<p-f;)h=Hr(h),p--;for(;f--;){if(u===h||null!==h&&u===h.alternate)break e;u=Hr(u),h=Hr(h)}u=null}else u=null;null!==l&&Gr(s,a,l,u,!1),null!==c&&null!==d&&Gr(s,d,c,u,!0)}if("select"===(l=(a=r?yi(r):window).nodeName&&a.nodeName.toLowerCase())||"input"===l&&"file"===a.type)var m=zn;else if(Un(a))if(Zn)m=rr;else{m=tr;var y=er}else(l=a.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===a.type||"radio"===a.type)&&(m=nr);switch(m&&(m=m(e,r))?Vn(s,m,n,i):(y&&y(e,a,r),"focusout"===e&&(y=a._wrapperState)&&y.controlled&&"number"===a.type&&ee(a,"number",a.value)),y=r?yi(r):window,e){case"focusin":(Un(y)||"true"===y.contentEditable)&&(pr=y,fr=r,gr=null);break;case"focusout":gr=fr=pr=null;break;case"mousedown":mr=!0;break;case"contextmenu":case"mouseup":case"dragend":mr=!1,yr(s,n,i);break;case"selectionchange":if(hr)break;case"keydown":case"keyup":yr(s,n,i)}var v;if(On)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else Ln?Fn(e,n)&&(A="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(A="onCompositionStart");A&&(jn&&"ko"!==n.locale&&(Ln||"onCompositionStart"!==A?"onCompositionEnd"===A&&Ln&&(v=en()):(Xt="value"in(Jt=i)?Jt.value:Jt.textContent,Ln=!0)),0<(y=Kr(r,A)).length&&(A=new An(A,e,null,n,i),s.push({event:A,listeners:y}),(v||null!==(v=Rn(n)))&&(A.data=v))),(v=Dn?function(e,t){switch(e){case"compositionend":return Rn(t);case"keypress":return 32!==t.which?null:(Mn=!0,Tn);case"textInput":return(e=t.data)===Tn&&Mn?null:e;default:return null}}(e,n):function(e,t){if(Ln)return"compositionend"===e||!On&&Fn(e,t)?(e=en(),$t=Xt=Jt=null,Ln=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return jn&&"ko"!==t.locale?null:t.data}}(e,n))&&0<(r=Kr(r,"onBeforeInput")).length&&(i=new An("onBeforeInput","beforeinput",null,n,i),s.push({event:i,listeners:r}),i.data=v)}Tr(s,t)}))}function Vr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Kr(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,o=i.stateNode;5===i.tag&&null!==o&&(i=o,null!=(o=Ne(e,n))&&r.unshift(Vr(e,o,i)),null!=(o=Ne(e,t))&&r.push(Vr(e,o,i))),e=e.return}return r}function Hr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Gr(e,t,n,r,i){for(var o=t._reactName,s=[];null!==n&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(null!==l&&l===r)break;5===a.tag&&null!==c&&(a=c,i?null!=(l=Ne(n,o))&&s.unshift(Vr(n,l,a)):i||null!=(l=Ne(n,o))&&s.push(Vr(n,l,a))),n=n.return}0!==s.length&&e.push({event:t,listeners:s})}var Yr=/\r\n?/g,zr=/\u0000|\uFFFD/g;function Zr(e){return("string"==typeof e?e:""+e).replace(Yr,"\n").replace(zr,"")}function Wr(e,t,n){if(t=Zr(t),Zr(e)!==t&&n)throw Error(o(425))}function qr(){}var Jr=null,Xr=null;function $r(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ei="function"==typeof setTimeout?setTimeout:void 0,ti="function"==typeof clearTimeout?clearTimeout:void 0,ni="function"==typeof Promise?Promise:void 0,ri="function"==typeof queueMicrotask?queueMicrotask:void 0!==ni?function(e){return ni.resolve(null).then(e).catch(ii)}:ei;function ii(e){setTimeout((function(){throw e}))}function oi(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&8===i.nodeType)if("/$"===(n=i.data)){if(0===r)return e.removeChild(i),void Vt(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=i}while(n);Vt(t)}function si(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function ai(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var li=Math.random().toString(36).slice(2),ci="__reactFiber$"+li,ui="__reactProps$"+li,di="__reactContainer$"+li,hi="__reactEvents$"+li,pi="__reactListeners$"+li,fi="__reactHandles$"+li;function gi(e){var t=e[ci];if(t)return t;for(var n=e.parentNode;n;){if(t=n[di]||n[ci]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=ai(e);null!==e;){if(n=e[ci])return n;e=ai(e)}return t}n=(e=n).parentNode}return null}function mi(e){return!(e=e[ci]||e[di])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function yi(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(o(33))}function vi(e){return e[ui]||null}var Ai=[],bi=-1;function wi(e){return{current:e}}function Si(e){0>bi||(e.current=Ai[bi],Ai[bi]=null,bi--)}function Ci(e,t){bi++,Ai[bi]=e.current,e.current=t}var Ei={},Ii=wi(Ei),_i=wi(!1),xi=Ei;function Pi(e,t){var n=e.type.contextTypes;if(!n)return Ei;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function ki(e){return null!=e.childContextTypes}function Bi(){Si(_i),Si(Ii)}function Oi(e,t,n){if(Ii.current!==Ei)throw Error(o(168));Ci(Ii,t),Ci(_i,n)}function Ni(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in t))throw Error(o(108,K(e)||"Unknown",i));return F({},n,r)}function Di(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ei,xi=Ii.current,Ci(Ii,e),Ci(_i,_i.current),!0}function ji(e,t,n){var r=e.stateNode;if(!r)throw Error(o(169));n?(e=Ni(e,t,xi),r.__reactInternalMemoizedMergedChildContext=e,Si(_i),Si(Ii),Ci(Ii,e)):Si(_i),Ci(_i,n)}var Ti=null,Mi=!1,Fi=!1;function Ri(e){null===Ti?Ti=[e]:Ti.push(e)}function Li(){if(!Fi&&null!==Ti){Fi=!0;var e=0,t=At;try{var n=Ti;for(At=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}Ti=null,Mi=!1}catch(t){throw null!==Ti&&(Ti=Ti.slice(e+1)),ze($e,Li),t}finally{At=t,Fi=!1}}return null}var Qi=[],Ui=0,Vi=null,Ki=0,Hi=[],Gi=0,Yi=null,zi=1,Zi="";function Wi(e,t){Qi[Ui++]=Ki,Qi[Ui++]=Vi,Vi=e,Ki=t}function qi(e,t,n){Hi[Gi++]=zi,Hi[Gi++]=Zi,Hi[Gi++]=Yi,Yi=e;var r=zi;e=Zi;var i=32-st(r)-1;r&=~(1<<i),n+=1;var o=32-st(t)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,zi=1<<32-st(t)+i|n<<i|r,Zi=o+e}else zi=1<<o|n<<i|r,Zi=e}function Ji(e){null!==e.return&&(Wi(e,1),qi(e,1,0))}function Xi(e){for(;e===Vi;)Vi=Qi[--Ui],Qi[Ui]=null,Ki=Qi[--Ui],Qi[Ui]=null;for(;e===Yi;)Yi=Hi[--Gi],Hi[Gi]=null,Zi=Hi[--Gi],Hi[Gi]=null,zi=Hi[--Gi],Hi[Gi]=null}var $i=null,eo=null,to=!1,no=null;function ro(e,t){var n=kc(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function io(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,$i=e,eo=si(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,$i=e,eo=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==Yi?{id:zi,overflow:Zi}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=kc(18,null,null,0)).stateNode=t,n.return=e,e.child=n,$i=e,eo=null,!0);default:return!1}}function oo(e){return 0!=(1&e.mode)&&0==(128&e.flags)}function so(e){if(to){var t=eo;if(t){var n=t;if(!io(e,t)){if(oo(e))throw Error(o(418));t=si(n.nextSibling);var r=$i;t&&io(e,t)?ro(r,n):(e.flags=-4097&e.flags|2,to=!1,$i=e)}}else{if(oo(e))throw Error(o(418));e.flags=-4097&e.flags|2,to=!1,$i=e}}}function ao(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;$i=e}function lo(e){if(e!==$i)return!1;if(!to)return ao(e),to=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!$r(e.type,e.memoizedProps)),t&&(t=eo)){if(oo(e))throw co(),Error(o(418));for(;t;)ro(e,t),t=si(t.nextSibling)}if(ao(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(o(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){eo=si(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}eo=null}}else eo=$i?si(e.stateNode.nextSibling):null;return!0}function co(){for(var e=eo;e;)e=si(e.nextSibling)}function uo(){eo=$i=null,to=!1}function ho(e){null===no?no=[e]:no.push(e)}var po=b.ReactCurrentBatchConfig;function fo(e,t){if(e&&e.defaultProps){for(var n in t=F({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var go=wi(null),mo=null,yo=null,vo=null;function Ao(){vo=yo=mo=null}function bo(e){var t=go.current;Si(go),e._currentValue=t}function wo(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function So(e,t){mo=e,vo=yo=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(ya=!0),e.firstContext=null)}function Co(e){var t=e._currentValue;if(vo!==e)if(e={context:e,memoizedValue:t,next:null},null===yo){if(null===mo)throw Error(o(308));yo=e,mo.dependencies={lanes:0,firstContext:e}}else yo=yo.next=e;return t}var Eo=null;function Io(e){null===Eo?Eo=[e]:Eo.push(e)}function _o(e,t,n,r){var i=t.interleaved;return null===i?(n.next=n,Io(t)):(n.next=i.next,i.next=n),t.interleaved=n,xo(e,r)}function xo(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Po=!1;function ko(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Bo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Oo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function No(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,0!=(2&_l)){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,xo(e,n)}return null===(i=r.interleaved)?(t.next=t,Io(r)):(t.next=i.next,i.next=t),r.interleaved=t,xo(e,n)}function Do(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!=(4194240&n))){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,vt(e,n)}}function jo(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===o?i=o=s:o=o.next=s,n=n.next}while(null!==n);null===o?i=o=t:o=o.next=t}else i=o=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function To(e,t,n,r){var i=e.updateQueue;Po=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(null!==a){i.shared.pending=null;var l=a,c=l.next;l.next=null,null===s?o=c:s.next=c,s=l;var u=e.alternate;null!==u&&(a=(u=u.updateQueue).lastBaseUpdate)!==s&&(null===a?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l)}if(null!==o){var d=i.baseState;for(s=0,u=c=l=null,a=o;;){var h=a.lane,p=a.eventTime;if((r&h)===h){null!==u&&(u=u.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var f=e,g=a;switch(h=t,p=n,g.tag){case 1:if("function"==typeof(f=g.payload)){d=f.call(p,d,h);break e}d=f;break e;case 3:f.flags=-65537&f.flags|128;case 0:if(null==(h="function"==typeof(f=g.payload)?f.call(p,d,h):f))break e;d=F({},d,h);break e;case 2:Po=!0}}null!==a.callback&&0!==a.lane&&(e.flags|=64,null===(h=i.effects)?i.effects=[a]:h.push(a))}else p={eventTime:p,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===u?(c=u=p,l=d):u=u.next=p,s|=h;if(null===(a=a.next)){if(null===(a=i.shared.pending))break;a=(h=a).next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}if(null===u&&(l=d),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,null!==(t=i.shared.interleaved)){i=t;do{s|=i.lane,i=i.next}while(i!==t)}else null===o&&(i.shared.lanes=0);jl|=s,e.lanes=s,e.memoizedState=d}}function Mo(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(null!==i){if(r.callback=null,r=n,"function"!=typeof i)throw Error(o(191,i));i.call(r)}}}var Fo=(new r.Component).refs;function Ro(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:F({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var Lo={isMounted:function(e){return!!(e=e._reactInternals)&&Ve(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Xl(),i=$l(e),o=Oo(r,i);o.payload=t,null!=n&&(o.callback=n),null!==(t=No(e,o,i))&&(ec(t,e,i,r),Do(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Xl(),i=$l(e),o=Oo(r,i);o.tag=1,o.payload=t,null!=n&&(o.callback=n),null!==(t=No(e,o,i))&&(ec(t,e,i,r),Do(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Xl(),r=$l(e),i=Oo(n,r);i.tag=2,null!=t&&(i.callback=t),null!==(t=No(e,i,r))&&(ec(t,e,r,n),Do(t,e,r))}};function Qo(e,t,n,r,i,o,s){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,o,s):!(t.prototype&&t.prototype.isPureReactComponent&&or(n,r)&&or(i,o))}function Uo(e,t,n){var r=!1,i=Ei,o=t.contextType;return"object"==typeof o&&null!==o?o=Co(o):(i=ki(t)?xi:Ii.current,o=(r=null!=(r=t.contextTypes))?Pi(e,i):Ei),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=Lo,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function Vo(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Lo.enqueueReplaceState(t,t.state,null)}function Ko(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=Fo,ko(e);var o=t.contextType;"object"==typeof o&&null!==o?i.context=Co(o):(o=ki(t)?xi:Ii.current,i.context=Pi(e,o)),i.state=e.memoizedState,"function"==typeof(o=t.getDerivedStateFromProps)&&(Ro(e,t,o,n),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&Lo.enqueueReplaceState(i,i.state,null),To(e,n,i,r),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4194308)}function Ho(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(o(309));var r=n.stateNode}if(!r)throw Error(o(147,e));var i=r,s=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===s?t.ref:(t=function(e){var t=i.refs;t===Fo&&(t=i.refs={}),null===e?delete t[s]:t[s]=e},t._stringRef=s,t)}if("string"!=typeof e)throw Error(o(284));if(!n._owner)throw Error(o(290,e))}return e}function Go(e,t){throw e=Object.prototype.toString.call(t),Error(o(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Yo(e){return(0,e._init)(e._payload)}function zo(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=Oc(e,t)).index=0,e.sibling=null,e}function s(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function a(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Tc(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function c(e,t,n,r){var o=n.type;return o===C?d(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===o||"object"==typeof o&&null!==o&&o.$$typeof===N&&Yo(o)===t.type)?((r=i(t,n.props)).ref=Ho(e,t,n),r.return=e,r):((r=Nc(n.type,n.key,n.props,null,e.mode,r)).ref=Ho(e,t,n),r.return=e,r)}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Mc(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function d(e,t,n,r,o){return null===t||7!==t.tag?((t=Dc(n,e.mode,r,o)).return=e,t):((t=i(t,n)).return=e,t)}function h(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=Tc(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case w:return(n=Nc(t.type,t.key,t.props,null,e.mode,n)).ref=Ho(e,null,t),n.return=e,n;case S:return(t=Mc(t,e.mode,n)).return=e,t;case N:return h(e,(0,t._init)(t._payload),n)}if(te(t)||T(t))return(t=Dc(t,e.mode,n,null)).return=e,t;Go(e,t)}return null}function p(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==i?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case w:return n.key===i?c(e,t,n,r):null;case S:return n.key===i?u(e,t,n,r):null;case N:return p(e,t,(i=n._init)(n._payload),r)}if(te(n)||T(n))return null!==i?null:d(e,t,n,r,null);Go(e,n)}return null}function f(e,t,n,r,i){if("string"==typeof r&&""!==r||"number"==typeof r)return l(t,e=e.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case w:return c(t,e=e.get(null===r.key?n:r.key)||null,r,i);case S:return u(t,e=e.get(null===r.key?n:r.key)||null,r,i);case N:return f(e,t,n,(0,r._init)(r._payload),i)}if(te(r)||T(r))return d(t,e=e.get(n)||null,r,i,null);Go(t,r)}return null}function g(i,o,a,l){for(var c=null,u=null,d=o,g=o=0,m=null;null!==d&&g<a.length;g++){d.index>g?(m=d,d=null):m=d.sibling;var y=p(i,d,a[g],l);if(null===y){null===d&&(d=m);break}e&&d&&null===y.alternate&&t(i,d),o=s(y,o,g),null===u?c=y:u.sibling=y,u=y,d=m}if(g===a.length)return n(i,d),to&&Wi(i,g),c;if(null===d){for(;g<a.length;g++)null!==(d=h(i,a[g],l))&&(o=s(d,o,g),null===u?c=d:u.sibling=d,u=d);return to&&Wi(i,g),c}for(d=r(i,d);g<a.length;g++)null!==(m=f(d,i,g,a[g],l))&&(e&&null!==m.alternate&&d.delete(null===m.key?g:m.key),o=s(m,o,g),null===u?c=m:u.sibling=m,u=m);return e&&d.forEach((function(e){return t(i,e)})),to&&Wi(i,g),c}function m(i,a,l,c){var u=T(l);if("function"!=typeof u)throw Error(o(150));if(null==(l=u.call(l)))throw Error(o(151));for(var d=u=null,g=a,m=a=0,y=null,v=l.next();null!==g&&!v.done;m++,v=l.next()){g.index>m?(y=g,g=null):y=g.sibling;var A=p(i,g,v.value,c);if(null===A){null===g&&(g=y);break}e&&g&&null===A.alternate&&t(i,g),a=s(A,a,m),null===d?u=A:d.sibling=A,d=A,g=y}if(v.done)return n(i,g),to&&Wi(i,m),u;if(null===g){for(;!v.done;m++,v=l.next())null!==(v=h(i,v.value,c))&&(a=s(v,a,m),null===d?u=v:d.sibling=v,d=v);return to&&Wi(i,m),u}for(g=r(i,g);!v.done;m++,v=l.next())null!==(v=f(g,i,m,v.value,c))&&(e&&null!==v.alternate&&g.delete(null===v.key?m:v.key),a=s(v,a,m),null===d?u=v:d.sibling=v,d=v);return e&&g.forEach((function(e){return t(i,e)})),to&&Wi(i,m),u}return function e(r,o,s,l){if("object"==typeof s&&null!==s&&s.type===C&&null===s.key&&(s=s.props.children),"object"==typeof s&&null!==s){switch(s.$$typeof){case w:e:{for(var c=s.key,u=o;null!==u;){if(u.key===c){if((c=s.type)===C){if(7===u.tag){n(r,u.sibling),(o=i(u,s.props.children)).return=r,r=o;break e}}else if(u.elementType===c||"object"==typeof c&&null!==c&&c.$$typeof===N&&Yo(c)===u.type){n(r,u.sibling),(o=i(u,s.props)).ref=Ho(r,u,s),o.return=r,r=o;break e}n(r,u);break}t(r,u),u=u.sibling}s.type===C?((o=Dc(s.props.children,r.mode,l,s.key)).return=r,r=o):((l=Nc(s.type,s.key,s.props,null,r.mode,l)).ref=Ho(r,o,s),l.return=r,r=l)}return a(r);case S:e:{for(u=s.key;null!==o;){if(o.key===u){if(4===o.tag&&o.stateNode.containerInfo===s.containerInfo&&o.stateNode.implementation===s.implementation){n(r,o.sibling),(o=i(o,s.children||[])).return=r,r=o;break e}n(r,o);break}t(r,o),o=o.sibling}(o=Mc(s,r.mode,l)).return=r,r=o}return a(r);case N:return e(r,o,(u=s._init)(s._payload),l)}if(te(s))return g(r,o,s,l);if(T(s))return m(r,o,s,l);Go(r,s)}return"string"==typeof s&&""!==s||"number"==typeof s?(s=""+s,null!==o&&6===o.tag?(n(r,o.sibling),(o=i(o,s)).return=r,r=o):(n(r,o),(o=Tc(s,r.mode,l)).return=r,r=o),a(r)):n(r,o)}}var Zo=zo(!0),Wo=zo(!1),qo={},Jo=wi(qo),Xo=wi(qo),$o=wi(qo);function es(e){if(e===qo)throw Error(o(174));return e}function ts(e,t){switch(Ci($o,t),Ci(Xo,e),Ci(Jo,qo),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:le(null,"");break;default:t=le(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Si(Jo),Ci(Jo,t)}function ns(){Si(Jo),Si(Xo),Si($o)}function rs(e){es($o.current);var t=es(Jo.current),n=le(t,e.type);t!==n&&(Ci(Xo,e),Ci(Jo,n))}function is(e){Xo.current===e&&(Si(Jo),Si(Xo))}var os=wi(0);function ss(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var as=[];function ls(){for(var e=0;e<as.length;e++)as[e]._workInProgressVersionPrimary=null;as.length=0}var cs=b.ReactCurrentDispatcher,us=b.ReactCurrentBatchConfig,ds=0,hs=null,ps=null,fs=null,gs=!1,ms=!1,ys=0,vs=0;function As(){throw Error(o(321))}function bs(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ir(e[n],t[n]))return!1;return!0}function ws(e,t,n,r,i,s){if(ds=s,hs=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,cs.current=null===e||null===e.memoizedState?ia:oa,e=n(r,i),ms){s=0;do{if(ms=!1,ys=0,25<=s)throw Error(o(301));s+=1,fs=ps=null,t.updateQueue=null,cs.current=sa,e=n(r,i)}while(ms)}if(cs.current=ra,t=null!==ps&&null!==ps.next,ds=0,fs=ps=hs=null,gs=!1,t)throw Error(o(300));return e}function Ss(){var e=0!==ys;return ys=0,e}function Cs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===fs?hs.memoizedState=fs=e:fs=fs.next=e,fs}function Es(){if(null===ps){var e=hs.alternate;e=null!==e?e.memoizedState:null}else e=ps.next;var t=null===fs?hs.memoizedState:fs.next;if(null!==t)fs=t,ps=e;else{if(null===e)throw Error(o(310));e={memoizedState:(ps=e).memoizedState,baseState:ps.baseState,baseQueue:ps.baseQueue,queue:ps.queue,next:null},null===fs?hs.memoizedState=fs=e:fs=fs.next=e}return fs}function Is(e,t){return"function"==typeof t?t(e):t}function _s(e){var t=Es(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=ps,i=r.baseQueue,s=n.pending;if(null!==s){if(null!==i){var a=i.next;i.next=s.next,s.next=a}r.baseQueue=i=s,n.pending=null}if(null!==i){s=i.next,r=r.baseState;var l=a=null,c=null,u=s;do{var d=u.lane;if((ds&d)===d)null!==c&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var h={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};null===c?(l=c=h,a=r):c=c.next=h,hs.lanes|=d,jl|=d}u=u.next}while(null!==u&&u!==s);null===c?a=r:c.next=l,ir(r,t.memoizedState)||(ya=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=c,n.lastRenderedState=r}if(null!==(e=n.interleaved)){i=e;do{s=i.lane,hs.lanes|=s,jl|=s,i=i.next}while(i!==e)}else null===i&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function xs(e){var t=Es(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(null!==i){n.pending=null;var a=i=i.next;do{s=e(s,a.action),a=a.next}while(a!==i);ir(s,t.memoizedState)||(ya=!0),t.memoizedState=s,null===t.baseQueue&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function Ps(){}function ks(e,t){var n=hs,r=Es(),i=t(),s=!ir(r.memoizedState,i);if(s&&(r.memoizedState=i,ya=!0),r=r.queue,Us(Ns.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||null!==fs&&1&fs.memoizedState.tag){if(n.flags|=2048,Ms(9,Os.bind(null,n,r,i,t),void 0,null),null===xl)throw Error(o(349));0!=(30&ds)||Bs(n,t,i)}return i}function Bs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=hs.updateQueue)?(t={lastEffect:null,stores:null},hs.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Os(e,t,n,r){t.value=n,t.getSnapshot=r,Ds(t)&&js(e)}function Ns(e,t,n){return n((function(){Ds(t)&&js(e)}))}function Ds(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ir(e,n)}catch(e){return!0}}function js(e){var t=xo(e,1);null!==t&&ec(t,e,1,-1)}function Ts(e){var t=Cs();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Is,lastRenderedState:e},t.queue=e,e=e.dispatch=$s.bind(null,hs,e),[t.memoizedState,e]}function Ms(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=hs.updateQueue)?(t={lastEffect:null,stores:null},hs.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Fs(){return Es().memoizedState}function Rs(e,t,n,r){var i=Cs();hs.flags|=e,i.memoizedState=Ms(1|t,n,void 0,void 0===r?null:r)}function Ls(e,t,n,r){var i=Es();r=void 0===r?null:r;var o=void 0;if(null!==ps){var s=ps.memoizedState;if(o=s.destroy,null!==r&&bs(r,s.deps))return void(i.memoizedState=Ms(t,n,o,r))}hs.flags|=e,i.memoizedState=Ms(1|t,n,o,r)}function Qs(e,t){return Rs(8390656,8,e,t)}function Us(e,t){return Ls(2048,8,e,t)}function Vs(e,t){return Ls(4,2,e,t)}function Ks(e,t){return Ls(4,4,e,t)}function Hs(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Gs(e,t,n){return n=null!=n?n.concat([e]):null,Ls(4,4,Hs.bind(null,t,e),n)}function Ys(){}function zs(e,t){var n=Es();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&bs(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Zs(e,t){var n=Es();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&bs(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ws(e,t,n){return 0==(21&ds)?(e.baseState&&(e.baseState=!1,ya=!0),e.memoizedState=n):(ir(n,t)||(n=gt(),hs.lanes|=n,jl|=n,e.baseState=!0),t)}function qs(e,t){var n=At;At=0!==n&&4>n?n:4,e(!0);var r=us.transition;us.transition={};try{e(!1),t()}finally{At=n,us.transition=r}}function Js(){return Es().memoizedState}function Xs(e,t,n){var r=$l(e);n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ea(e)?ta(t,n):null!==(n=_o(e,t,n,r))&&(ec(n,e,r,Xl()),na(n,t,r))}function $s(e,t,n){var r=$l(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ea(e))ta(t,i);else{var o=e.alternate;if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var s=t.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,ir(a,s)){var l=t.interleaved;return null===l?(i.next=i,Io(t)):(i.next=l.next,l.next=i),void(t.interleaved=i)}}catch(e){}null!==(n=_o(e,t,i,r))&&(ec(n,e,r,i=Xl()),na(n,t,r))}}function ea(e){var t=e.alternate;return e===hs||null!==t&&t===hs}function ta(e,t){ms=gs=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function na(e,t,n){if(0!=(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,vt(e,n)}}var ra={readContext:Co,useCallback:As,useContext:As,useEffect:As,useImperativeHandle:As,useInsertionEffect:As,useLayoutEffect:As,useMemo:As,useReducer:As,useRef:As,useState:As,useDebugValue:As,useDeferredValue:As,useTransition:As,useMutableSource:As,useSyncExternalStore:As,useId:As,unstable_isNewReconciler:!1},ia={readContext:Co,useCallback:function(e,t){return Cs().memoizedState=[e,void 0===t?null:t],e},useContext:Co,useEffect:Qs,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Rs(4194308,4,Hs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Rs(4194308,4,e,t)},useInsertionEffect:function(e,t){return Rs(4,2,e,t)},useMemo:function(e,t){var n=Cs();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Cs();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Xs.bind(null,hs,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Cs().memoizedState=e},useState:Ts,useDebugValue:Ys,useDeferredValue:function(e){return Cs().memoizedState=e},useTransition:function(){var e=Ts(!1),t=e[0];return e=qs.bind(null,e[1]),Cs().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=hs,i=Cs();if(to){if(void 0===n)throw Error(o(407));n=n()}else{if(n=t(),null===xl)throw Error(o(349));0!=(30&ds)||Bs(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,Qs(Ns.bind(null,r,s,e),[e]),r.flags|=2048,Ms(9,Os.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Cs(),t=xl.identifierPrefix;if(to){var n=Zi;t=":"+t+"R"+(n=(zi&~(1<<32-st(zi)-1)).toString(32)+n),0<(n=ys++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=vs++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},oa={readContext:Co,useCallback:zs,useContext:Co,useEffect:Us,useImperativeHandle:Gs,useInsertionEffect:Vs,useLayoutEffect:Ks,useMemo:Zs,useReducer:_s,useRef:Fs,useState:function(){return _s(Is)},useDebugValue:Ys,useDeferredValue:function(e){return Ws(Es(),ps.memoizedState,e)},useTransition:function(){return[_s(Is)[0],Es().memoizedState]},useMutableSource:Ps,useSyncExternalStore:ks,useId:Js,unstable_isNewReconciler:!1},sa={readContext:Co,useCallback:zs,useContext:Co,useEffect:Us,useImperativeHandle:Gs,useInsertionEffect:Vs,useLayoutEffect:Ks,useMemo:Zs,useReducer:xs,useRef:Fs,useState:function(){return xs(Is)},useDebugValue:Ys,useDeferredValue:function(e){var t=Es();return null===ps?t.memoizedState=e:Ws(t,ps.memoizedState,e)},useTransition:function(){return[xs(Is)[0],Es().memoizedState]},useMutableSource:Ps,useSyncExternalStore:ks,useId:Js,unstable_isNewReconciler:!1};function aa(e,t){try{var n="",r=t;do{n+=U(r),r=r.return}while(r);var i=n}catch(e){i="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:i,digest:null}}function la(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function ca(e,t){try{console.error(t.value)}catch(e){setTimeout((function(){throw e}))}}var ua="function"==typeof WeakMap?WeakMap:Map;function da(e,t,n){(n=Oo(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Vl||(Vl=!0,Kl=r),ca(0,t)},n}function ha(e,t,n){(n=Oo(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){ca(0,t)}}var o=e.stateNode;return null!==o&&"function"==typeof o.componentDidCatch&&(n.callback=function(){ca(0,t),"function"!=typeof r&&(null===Hl?Hl=new Set([this]):Hl.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function pa(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new ua;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Cc.bind(null,e,t,n),t.then(e,e))}function fa(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function ga(e,t,n,r,i){return 0==(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Oo(-1,1)).tag=2,No(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=i,e)}var ma=b.ReactCurrentOwner,ya=!1;function va(e,t,n,r){t.child=null===e?Wo(t,null,n,r):Zo(t,e.child,n,r)}function Aa(e,t,n,r,i){n=n.render;var o=t.ref;return So(t,i),r=ws(e,t,n,r,o,i),n=Ss(),null===e||ya?(to&&n&&Ji(t),t.flags|=1,va(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Va(e,t,i))}function ba(e,t,n,r,i){if(null===e){var o=n.type;return"function"!=typeof o||Bc(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Nc(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,wa(e,t,o,r,i))}if(o=e.child,0==(e.lanes&i)){var s=o.memoizedProps;if((n=null!==(n=n.compare)?n:or)(s,r)&&e.ref===t.ref)return Va(e,t,i)}return t.flags|=1,(e=Oc(o,r)).ref=t.ref,e.return=t,t.child=e}function wa(e,t,n,r,i){if(null!==e){var o=e.memoizedProps;if(or(o,r)&&e.ref===t.ref){if(ya=!1,t.pendingProps=r=o,0==(e.lanes&i))return t.lanes=e.lanes,Va(e,t,i);0!=(131072&e.flags)&&(ya=!0)}}return Ea(e,t,n,r,i)}function Sa(e,t,n){var r=t.pendingProps,i=r.children,o=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0==(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ci(Ol,Bl),Bl|=n;else{if(0==(1073741824&n))return e=null!==o?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ci(Ol,Bl),Bl|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==o?o.baseLanes:n,Ci(Ol,Bl),Bl|=r}else null!==o?(r=o.baseLanes|n,t.memoizedState=null):r=n,Ci(Ol,Bl),Bl|=r;return va(e,t,i,n),t.child}function Ca(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ea(e,t,n,r,i){var o=ki(n)?xi:Ii.current;return o=Pi(t,o),So(t,i),n=ws(e,t,n,r,o,i),r=Ss(),null===e||ya?(to&&r&&Ji(t),t.flags|=1,va(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Va(e,t,i))}function Ia(e,t,n,r,i){if(ki(n)){var o=!0;Di(t)}else o=!1;if(So(t,i),null===t.stateNode)Ua(e,t),Uo(t,n,r),Ko(t,n,r,i),r=!0;else if(null===e){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,c=n.contextType;c="object"==typeof c&&null!==c?Co(c):Pi(t,c=ki(n)?xi:Ii.current);var u=n.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof s.getSnapshotBeforeUpdate;d||"function"!=typeof s.UNSAFE_componentWillReceiveProps&&"function"!=typeof s.componentWillReceiveProps||(a!==r||l!==c)&&Vo(t,s,r,c),Po=!1;var h=t.memoizedState;s.state=h,To(t,r,s,i),l=t.memoizedState,a!==r||h!==l||_i.current||Po?("function"==typeof u&&(Ro(t,n,u,r),l=t.memoizedState),(a=Po||Qo(t,n,a,r,h,l,c))?(d||"function"!=typeof s.UNSAFE_componentWillMount&&"function"!=typeof s.componentWillMount||("function"==typeof s.componentWillMount&&s.componentWillMount(),"function"==typeof s.UNSAFE_componentWillMount&&s.UNSAFE_componentWillMount()),"function"==typeof s.componentDidMount&&(t.flags|=4194308)):("function"==typeof s.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=c,r=a):("function"==typeof s.componentDidMount&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,Bo(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:fo(t.type,a),s.props=c,d=t.pendingProps,h=s.context,l="object"==typeof(l=n.contextType)&&null!==l?Co(l):Pi(t,l=ki(n)?xi:Ii.current);var p=n.getDerivedStateFromProps;(u="function"==typeof p||"function"==typeof s.getSnapshotBeforeUpdate)||"function"!=typeof s.UNSAFE_componentWillReceiveProps&&"function"!=typeof s.componentWillReceiveProps||(a!==d||h!==l)&&Vo(t,s,r,l),Po=!1,h=t.memoizedState,s.state=h,To(t,r,s,i);var f=t.memoizedState;a!==d||h!==f||_i.current||Po?("function"==typeof p&&(Ro(t,n,p,r),f=t.memoizedState),(c=Po||Qo(t,n,c,r,h,f,l)||!1)?(u||"function"!=typeof s.UNSAFE_componentWillUpdate&&"function"!=typeof s.componentWillUpdate||("function"==typeof s.componentWillUpdate&&s.componentWillUpdate(r,f,l),"function"==typeof s.UNSAFE_componentWillUpdate&&s.UNSAFE_componentWillUpdate(r,f,l)),"function"==typeof s.componentDidUpdate&&(t.flags|=4),"function"==typeof s.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof s.componentDidUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof s.getSnapshotBeforeUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=f),s.props=r,s.state=f,s.context=l,r=c):("function"!=typeof s.componentDidUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof s.getSnapshotBeforeUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return _a(e,t,n,r,o,i)}function _a(e,t,n,r,i,o){Ca(e,t);var s=0!=(128&t.flags);if(!r&&!s)return i&&ji(t,n,!1),Va(e,t,o);r=t.stateNode,ma.current=t;var a=s&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&s?(t.child=Zo(t,e.child,null,o),t.child=Zo(t,null,a,o)):va(e,t,a,o),t.memoizedState=r.state,i&&ji(t,n,!0),t.child}function xa(e){var t=e.stateNode;t.pendingContext?Oi(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Oi(0,t.context,!1),ts(e,t.containerInfo)}function Pa(e,t,n,r,i){return uo(),ho(i),t.flags|=256,va(e,t,n,r),t.child}var ka,Ba,Oa,Na,Da={dehydrated:null,treeContext:null,retryLane:0};function ja(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ta(e,t,n){var r,i=t.pendingProps,s=os.current,a=!1,l=0!=(128&t.flags);if((r=l)||(r=(null===e||null!==e.memoizedState)&&0!=(2&s)),r?(a=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(s|=1),Ci(os,1&s),null===e)return so(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0==(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(l=i.children,e=i.fallback,a?(i=t.mode,a=t.child,l={mode:"hidden",children:l},0==(1&i)&&null!==a?(a.childLanes=0,a.pendingProps=l):a=jc(l,i,0,null),e=Dc(e,i,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=ja(n),t.memoizedState=Da,e):Ma(t,l));if(null!==(s=e.memoizedState)&&null!==(r=s.dehydrated))return function(e,t,n,r,i,s,a){if(n)return 256&t.flags?(t.flags&=-257,Fa(e,t,a,r=la(Error(o(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=jc({mode:"visible",children:r.children},i,0,null),(s=Dc(s,i,a,null)).flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,0!=(1&t.mode)&&Zo(t,e.child,null,a),t.child.memoizedState=ja(a),t.memoizedState=Da,s);if(0==(1&t.mode))return Fa(e,t,a,null);if("$!"===i.data){if(r=i.nextSibling&&i.nextSibling.dataset)var l=r.dgst;return r=l,Fa(e,t,a,r=la(s=Error(o(419)),r,void 0))}if(l=0!=(a&e.childLanes),ya||l){if(null!==(r=xl)){switch(a&-a){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}0!==(i=0!=(i&(r.suspendedLanes|a))?0:i)&&i!==s.retryLane&&(s.retryLane=i,xo(e,i),ec(r,e,i,-1))}return pc(),Fa(e,t,a,r=la(Error(o(421))))}return"$?"===i.data?(t.flags|=128,t.child=e.child,t=Ic.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,eo=si(i.nextSibling),$i=t,to=!0,no=null,null!==e&&(Hi[Gi++]=zi,Hi[Gi++]=Zi,Hi[Gi++]=Yi,zi=e.id,Zi=e.overflow,Yi=t),(t=Ma(t,r.children)).flags|=4096,t)}(e,t,l,i,r,s,n);if(a){a=i.fallback,l=t.mode,r=(s=e.child).sibling;var c={mode:"hidden",children:i.children};return 0==(1&l)&&t.child!==s?((i=t.child).childLanes=0,i.pendingProps=c,t.deletions=null):(i=Oc(s,c)).subtreeFlags=14680064&s.subtreeFlags,null!==r?a=Oc(r,a):(a=Dc(a,l,n,null)).flags|=2,a.return=t,i.return=t,i.sibling=a,t.child=i,i=a,a=t.child,l=null===(l=e.child.memoizedState)?ja(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},a.memoizedState=l,a.childLanes=e.childLanes&~n,t.memoizedState=Da,i}return e=(a=e.child).sibling,i=Oc(a,{mode:"visible",children:i.children}),0==(1&t.mode)&&(i.lanes=n),i.return=t,i.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=i,t.memoizedState=null,i}function Ma(e,t){return(t=jc({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Fa(e,t,n,r){return null!==r&&ho(r),Zo(t,e.child,null,n),(e=Ma(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Ra(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),wo(e.return,t,n)}function La(e,t,n,r,i){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function Qa(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(va(e,t,r.children,n),0!=(2&(r=os.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!=(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Ra(e,n,t);else if(19===e.tag)Ra(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ci(os,r),0==(1&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===ss(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),La(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===ss(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}La(t,!0,n,null,o);break;case"together":La(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ua(e,t){0==(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Va(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),jl|=t.lanes,0==(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(o(153));if(null!==t.child){for(n=Oc(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Oc(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Ka(e,t){if(!to)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ha(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=14680064&i.subtreeFlags,r|=14680064&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Ga(e,t,n){var r=t.pendingProps;switch(Xi(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ha(t),null;case 1:case 17:return ki(t.type)&&Bi(),Ha(t),null;case 3:return r=t.stateNode,ns(),Si(_i),Si(Ii),ls(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(lo(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0==(256&t.flags)||(t.flags|=1024,null!==no&&(ic(no),no=null))),Ba(e,t),Ha(t),null;case 5:is(t);var i=es($o.current);if(n=t.type,null!==e&&null!=t.stateNode)Oa(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(o(166));return Ha(t),null}if(e=es(Jo.current),lo(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[ci]=t,r[ui]=s,e=0!=(1&t.mode),n){case"dialog":Mr("cancel",r),Mr("close",r);break;case"iframe":case"object":case"embed":Mr("load",r);break;case"video":case"audio":for(i=0;i<Nr.length;i++)Mr(Nr[i],r);break;case"source":Mr("error",r);break;case"img":case"image":case"link":Mr("error",r),Mr("load",r);break;case"details":Mr("toggle",r);break;case"input":q(r,s),Mr("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Mr("invalid",r);break;case"textarea":ie(r,s),Mr("invalid",r)}for(var l in ve(n,s),i=null,s)if(s.hasOwnProperty(l)){var c=s[l];"children"===l?"string"==typeof c?r.textContent!==c&&(!0!==s.suppressHydrationWarning&&Wr(r.textContent,c,e),i=["children",c]):"number"==typeof c&&r.textContent!==""+c&&(!0!==s.suppressHydrationWarning&&Wr(r.textContent,c,e),i=["children",""+c]):a.hasOwnProperty(l)&&null!=c&&"onScroll"===l&&Mr("scroll",r)}switch(n){case"input":Y(r),$(r,s,!0);break;case"textarea":Y(r),se(r);break;case"select":case"option":break;default:"function"==typeof s.onClick&&(r.onclick=qr)}r=i,t.updateQueue=r,null!==r&&(t.flags|=4)}else{l=9===i.nodeType?i:i.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=ae(n)),"http://www.w3.org/1999/xhtml"===e?"script"===n?((e=l.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),"select"===n&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[ci]=t,e[ui]=r,ka(e,t,!1,!1),t.stateNode=e;e:{switch(l=Ae(n,r),n){case"dialog":Mr("cancel",e),Mr("close",e),i=r;break;case"iframe":case"object":case"embed":Mr("load",e),i=r;break;case"video":case"audio":for(i=0;i<Nr.length;i++)Mr(Nr[i],e);i=r;break;case"source":Mr("error",e),i=r;break;case"img":case"image":case"link":Mr("error",e),Mr("load",e),i=r;break;case"details":Mr("toggle",e),i=r;break;case"input":q(e,r),i=W(e,r),Mr("invalid",e);break;case"option":default:i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=F({},r,{value:void 0}),Mr("invalid",e);break;case"textarea":ie(e,r),i=re(e,r),Mr("invalid",e)}for(s in ve(n,i),c=i)if(c.hasOwnProperty(s)){var u=c[s];"style"===s?me(e,u):"dangerouslySetInnerHTML"===s?null!=(u=u?u.__html:void 0)&&de(e,u):"children"===s?"string"==typeof u?("textarea"!==n||""!==u)&&he(e,u):"number"==typeof u&&he(e,""+u):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(a.hasOwnProperty(s)?null!=u&&"onScroll"===s&&Mr("scroll",e):null!=u&&A(e,s,u,l))}switch(n){case"input":Y(e),$(e,r,!1);break;case"textarea":Y(e),se(e);break;case"option":null!=r.value&&e.setAttribute("value",""+H(r.value));break;case"select":e.multiple=!!r.multiple,null!=(s=r.value)?ne(e,!!r.multiple,s,!1):null!=r.defaultValue&&ne(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof i.onClick&&(e.onclick=qr)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return Ha(t),null;case 6:if(e&&null!=t.stateNode)Na(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(o(166));if(n=es($o.current),es(Jo.current),lo(t)){if(r=t.stateNode,n=t.memoizedProps,r[ci]=t,(s=r.nodeValue!==n)&&null!==(e=$i))switch(e.tag){case 3:Wr(r.nodeValue,n,0!=(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Wr(r.nodeValue,n,0!=(1&e.mode))}s&&(t.flags|=4)}else(r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[ci]=t,t.stateNode=r}return Ha(t),null;case 13:if(Si(os),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(to&&null!==eo&&0!=(1&t.mode)&&0==(128&t.flags))co(),uo(),t.flags|=98560,s=!1;else if(s=lo(t),null!==r&&null!==r.dehydrated){if(null===e){if(!s)throw Error(o(318));if(!(s=null!==(s=t.memoizedState)?s.dehydrated:null))throw Error(o(317));s[ci]=t}else uo(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Ha(t),s=!1}else null!==no&&(ic(no),no=null),s=!0;if(!s)return 65536&t.flags?t:null}return 0!=(128&t.flags)?(t.lanes=n,t):((r=null!==r)!=(null!==e&&null!==e.memoizedState)&&r&&(t.child.flags|=8192,0!=(1&t.mode)&&(null===e||0!=(1&os.current)?0===Nl&&(Nl=3):pc())),null!==t.updateQueue&&(t.flags|=4),Ha(t),null);case 4:return ns(),Ba(e,t),null===e&&Lr(t.stateNode.containerInfo),Ha(t),null;case 10:return bo(t.type._context),Ha(t),null;case 19:if(Si(os),null===(s=t.memoizedState))return Ha(t),null;if(r=0!=(128&t.flags),null===(l=s.rendering))if(r)Ka(s,!1);else{if(0!==Nl||null!==e&&0!=(128&e.flags))for(e=t.child;null!==e;){if(null!==(l=ss(e))){for(t.flags|=128,Ka(s,!1),null!==(r=l.updateQueue)&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;null!==n;)e=r,(s=n).flags&=14680066,null===(l=s.alternate)?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=l.childLanes,s.lanes=l.lanes,s.child=l.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=l.memoizedProps,s.memoizedState=l.memoizedState,s.updateQueue=l.updateQueue,s.type=l.type,e=l.dependencies,s.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ci(os,1&os.current|2),t.child}e=e.sibling}null!==s.tail&&Je()>Ql&&(t.flags|=128,r=!0,Ka(s,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=ss(l))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),Ka(s,!0),null===s.tail&&"hidden"===s.tailMode&&!l.alternate&&!to)return Ha(t),null}else 2*Je()-s.renderingStartTime>Ql&&1073741824!==n&&(t.flags|=128,r=!0,Ka(s,!1),t.lanes=4194304);s.isBackwards?(l.sibling=t.child,t.child=l):(null!==(n=s.last)?n.sibling=l:t.child=l,s.last=l)}return null!==s.tail?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Je(),t.sibling=null,n=os.current,Ci(os,r?1&n|2:1&n),t):(Ha(t),null);case 22:case 23:return cc(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&0!=(1&t.mode)?0!=(1073741824&Bl)&&(Ha(t),6&t.subtreeFlags&&(t.flags|=8192)):Ha(t),null;case 24:case 25:return null}throw Error(o(156,t.tag))}function Ya(e,t){switch(Xi(t),t.tag){case 1:return ki(t.type)&&Bi(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return ns(),Si(_i),Si(Ii),ls(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 5:return is(t),null;case 13:if(Si(os),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(o(340));uo()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Si(os),null;case 4:return ns(),null;case 10:return bo(t.type._context),null;case 22:case 23:return cc(),null;default:return null}}ka=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ba=function(){},Oa=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,es(Jo.current);var o,s=null;switch(n){case"input":i=W(e,i),r=W(e,r),s=[];break;case"select":i=F({},i,{value:void 0}),r=F({},r,{value:void 0}),s=[];break;case"textarea":i=re(e,i),r=re(e,r),s=[];break;default:"function"!=typeof i.onClick&&"function"==typeof r.onClick&&(e.onclick=qr)}for(u in ve(n,r),n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&null!=i[u])if("style"===u){var l=i[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else"dangerouslySetInnerHTML"!==u&&"children"!==u&&"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(a.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var c=r[u];if(l=null!=i?i[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(null!=c||null!=l))if("style"===u)if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(s||(s=[]),s.push(u,n)),n=c;else"dangerouslySetInnerHTML"===u?(c=c?c.__html:void 0,l=l?l.__html:void 0,null!=c&&l!==c&&(s=s||[]).push(u,c)):"children"===u?"string"!=typeof c&&"number"!=typeof c||(s=s||[]).push(u,""+c):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&(a.hasOwnProperty(u)?(null!=c&&"onScroll"===u&&Mr("scroll",e),s||l===c||(s=[])):(s=s||[]).push(u,c))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}},Na=function(e,t,n,r){n!==r&&(t.flags|=4)};var za=!1,Za=!1,Wa="function"==typeof WeakSet?WeakSet:Set,qa=null;function Ja(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(n){Sc(e,t,n)}else n.current=null}function Xa(e,t,n){try{n()}catch(n){Sc(e,t,n)}}var $a=!1;function el(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,void 0!==o&&Xa(t,n,o)}i=i.next}while(i!==r)}}function tl(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function nl(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"==typeof t?t(e):t.current=e}}function rl(e){var t=e.alternate;null!==t&&(e.alternate=null,rl(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&null!==(t=e.stateNode)&&(delete t[ci],delete t[ui],delete t[hi],delete t[pi],delete t[fi]),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function il(e){return 5===e.tag||3===e.tag||4===e.tag}function ol(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||il(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function sl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=qr));else if(4!==r&&null!==(e=e.child))for(sl(e,t,n),e=e.sibling;null!==e;)sl(e,t,n),e=e.sibling}function al(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(al(e,t,n),e=e.sibling;null!==e;)al(e,t,n),e=e.sibling}var ll=null,cl=!1;function ul(e,t,n){for(n=n.child;null!==n;)dl(e,t,n),n=n.sibling}function dl(e,t,n){if(ot&&"function"==typeof ot.onCommitFiberUnmount)try{ot.onCommitFiberUnmount(it,n)}catch(e){}switch(n.tag){case 5:Za||Ja(n,t);case 6:var r=ll,i=cl;ll=null,ul(e,t,n),cl=i,null!==(ll=r)&&(cl?(e=ll,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):ll.removeChild(n.stateNode));break;case 18:null!==ll&&(cl?(e=ll,n=n.stateNode,8===e.nodeType?oi(e.parentNode,n):1===e.nodeType&&oi(e,n),Vt(e)):oi(ll,n.stateNode));break;case 4:r=ll,i=cl,ll=n.stateNode.containerInfo,cl=!0,ul(e,t,n),ll=r,cl=i;break;case 0:case 11:case 14:case 15:if(!Za&&null!==(r=n.updateQueue)&&null!==(r=r.lastEffect)){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,void 0!==s&&(0!=(2&o)||0!=(4&o))&&Xa(n,t,s),i=i.next}while(i!==r)}ul(e,t,n);break;case 1:if(!Za&&(Ja(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Sc(n,t,e)}ul(e,t,n);break;case 21:ul(e,t,n);break;case 22:1&n.mode?(Za=(r=Za)||null!==n.memoizedState,ul(e,t,n),Za=r):ul(e,t,n);break;default:ul(e,t,n)}}function hl(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Wa),t.forEach((function(t){var r=_c.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function pl(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,a=t,l=a;e:for(;null!==l;){switch(l.tag){case 5:ll=l.stateNode,cl=!1;break e;case 3:case 4:ll=l.stateNode.containerInfo,cl=!0;break e}l=l.return}if(null===ll)throw Error(o(160));dl(s,a,i),ll=null,cl=!1;var c=i.alternate;null!==c&&(c.return=null),i.return=null}catch(e){Sc(i,t,e)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)fl(t,e),t=t.sibling}function fl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(pl(t,e),gl(e),4&r){try{el(3,e,e.return),tl(3,e)}catch(t){Sc(e,e.return,t)}try{el(5,e,e.return)}catch(t){Sc(e,e.return,t)}}break;case 1:pl(t,e),gl(e),512&r&&null!==n&&Ja(n,n.return);break;case 5:if(pl(t,e),gl(e),512&r&&null!==n&&Ja(n,n.return),32&e.flags){var i=e.stateNode;try{he(i,"")}catch(t){Sc(e,e.return,t)}}if(4&r&&null!=(i=e.stateNode)){var s=e.memoizedProps,a=null!==n?n.memoizedProps:s,l=e.type,c=e.updateQueue;if(e.updateQueue=null,null!==c)try{"input"===l&&"radio"===s.type&&null!=s.name&&J(i,s),Ae(l,a);var u=Ae(l,s);for(a=0;a<c.length;a+=2){var d=c[a],h=c[a+1];"style"===d?me(i,h):"dangerouslySetInnerHTML"===d?de(i,h):"children"===d?he(i,h):A(i,d,h,u)}switch(l){case"input":X(i,s);break;case"textarea":oe(i,s);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var f=s.value;null!=f?ne(i,!!s.multiple,f,!1):p!==!!s.multiple&&(null!=s.defaultValue?ne(i,!!s.multiple,s.defaultValue,!0):ne(i,!!s.multiple,s.multiple?[]:"",!1))}i[ui]=s}catch(t){Sc(e,e.return,t)}}break;case 6:if(pl(t,e),gl(e),4&r){if(null===e.stateNode)throw Error(o(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(t){Sc(e,e.return,t)}}break;case 3:if(pl(t,e),gl(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{Vt(t.containerInfo)}catch(t){Sc(e,e.return,t)}break;case 4:default:pl(t,e),gl(e);break;case 13:pl(t,e),gl(e),8192&(i=e.child).flags&&(s=null!==i.memoizedState,i.stateNode.isHidden=s,!s||null!==i.alternate&&null!==i.alternate.memoizedState||(Ll=Je())),4&r&&hl(e);break;case 22:if(d=null!==n&&null!==n.memoizedState,1&e.mode?(Za=(u=Za)||d,pl(t,e),Za=u):pl(t,e),gl(e),8192&r){if(u=null!==e.memoizedState,(e.stateNode.isHidden=u)&&!d&&0!=(1&e.mode))for(qa=e,d=e.child;null!==d;){for(h=qa=d;null!==qa;){switch(f=(p=qa).child,p.tag){case 0:case 11:case 14:case 15:el(4,p,p.return);break;case 1:Ja(p,p.return);var g=p.stateNode;if("function"==typeof g.componentWillUnmount){r=p,n=p.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(e){Sc(r,n,e)}}break;case 5:Ja(p,p.return);break;case 22:if(null!==p.memoizedState){Al(h);continue}}null!==f?(f.return=p,qa=f):Al(h)}d=d.sibling}e:for(d=null,h=e;;){if(5===h.tag){if(null===d){d=h;try{i=h.stateNode,u?"function"==typeof(s=i.style).setProperty?s.setProperty("display","none","important"):s.display="none":(l=h.stateNode,a=null!=(c=h.memoizedProps.style)&&c.hasOwnProperty("display")?c.display:null,l.style.display=ge("display",a))}catch(t){Sc(e,e.return,t)}}}else if(6===h.tag){if(null===d)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(t){Sc(e,e.return,t)}}else if((22!==h.tag&&23!==h.tag||null===h.memoizedState||h===e)&&null!==h.child){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;null===h.sibling;){if(null===h.return||h.return===e)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:pl(t,e),gl(e),4&r&&hl(e);case 21:}}function gl(e){var t=e.flags;if(2&t){try{e:{for(var n=e.return;null!==n;){if(il(n)){var r=n;break e}n=n.return}throw Error(o(160))}switch(r.tag){case 5:var i=r.stateNode;32&r.flags&&(he(i,""),r.flags&=-33),al(e,ol(e),i);break;case 3:case 4:var s=r.stateNode.containerInfo;sl(e,ol(e),s);break;default:throw Error(o(161))}}catch(t){Sc(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function ml(e,t,n){qa=e,yl(e,t,n)}function yl(e,t,n){for(var r=0!=(1&e.mode);null!==qa;){var i=qa,o=i.child;if(22===i.tag&&r){var s=null!==i.memoizedState||za;if(!s){var a=i.alternate,l=null!==a&&null!==a.memoizedState||Za;a=za;var c=Za;if(za=s,(Za=l)&&!c)for(qa=i;null!==qa;)l=(s=qa).child,22===s.tag&&null!==s.memoizedState?bl(i):null!==l?(l.return=s,qa=l):bl(i);for(;null!==o;)qa=o,yl(o,t,n),o=o.sibling;qa=i,za=a,Za=c}vl(e)}else 0!=(8772&i.subtreeFlags)&&null!==o?(o.return=i,qa=o):vl(e)}}function vl(e){for(;null!==qa;){var t=qa;if(0!=(8772&t.flags)){var n=t.alternate;try{if(0!=(8772&t.flags))switch(t.tag){case 0:case 11:case 15:Za||tl(5,t);break;case 1:var r=t.stateNode;if(4&t.flags&&!Za)if(null===n)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:fo(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;null!==s&&Mo(t,s,r);break;case 3:var a=t.updateQueue;if(null!==a){if(n=null,null!==t.child)switch(t.child.tag){case 5:case 1:n=t.child.stateNode}Mo(t,a,n)}break;case 5:var l=t.stateNode;if(null===n&&4&t.flags){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var u=t.alternate;if(null!==u){var d=u.memoizedState;if(null!==d){var h=d.dehydrated;null!==h&&Vt(h)}}}break;default:throw Error(o(163))}Za||512&t.flags&&nl(t)}catch(e){Sc(t,t.return,e)}}if(t===e){qa=null;break}if(null!==(n=t.sibling)){n.return=t.return,qa=n;break}qa=t.return}}function Al(e){for(;null!==qa;){var t=qa;if(t===e){qa=null;break}var n=t.sibling;if(null!==n){n.return=t.return,qa=n;break}qa=t.return}}function bl(e){for(;null!==qa;){var t=qa;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{tl(4,t)}catch(e){Sc(t,n,e)}break;case 1:var r=t.stateNode;if("function"==typeof r.componentDidMount){var i=t.return;try{r.componentDidMount()}catch(e){Sc(t,i,e)}}var o=t.return;try{nl(t)}catch(e){Sc(t,o,e)}break;case 5:var s=t.return;try{nl(t)}catch(e){Sc(t,s,e)}}}catch(e){Sc(t,t.return,e)}if(t===e){qa=null;break}var a=t.sibling;if(null!==a){a.return=t.return,qa=a;break}qa=t.return}}var wl,Sl=Math.ceil,Cl=b.ReactCurrentDispatcher,El=b.ReactCurrentOwner,Il=b.ReactCurrentBatchConfig,_l=0,xl=null,Pl=null,kl=0,Bl=0,Ol=wi(0),Nl=0,Dl=null,jl=0,Tl=0,Ml=0,Fl=null,Rl=null,Ll=0,Ql=1/0,Ul=null,Vl=!1,Kl=null,Hl=null,Gl=!1,Yl=null,zl=0,Zl=0,Wl=null,ql=-1,Jl=0;function Xl(){return 0!=(6&_l)?Je():-1!==ql?ql:ql=Je()}function $l(e){return 0==(1&e.mode)?1:0!=(2&_l)&&0!==kl?kl&-kl:null!==po.transition?(0===Jl&&(Jl=gt()),Jl):0!==(e=At)?e:e=void 0===(e=window.event)?16:qt(e.type)}function ec(e,t,n,r){if(50<Zl)throw Zl=0,Wl=null,Error(o(185));yt(e,n,r),0!=(2&_l)&&e===xl||(e===xl&&(0==(2&_l)&&(Tl|=n),4===Nl&&oc(e,kl)),tc(e,r),1===n&&0===_l&&0==(1&t.mode)&&(Ql=Je()+500,Mi&&Li()))}function tc(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var s=31-st(o),a=1<<s,l=i[s];-1===l?0!=(a&n)&&0==(a&r)||(i[s]=pt(a,t)):l<=t&&(e.expiredLanes|=a),o&=~a}}(e,t);var r=ht(e,e===xl?kl:0);if(0===r)null!==n&&Ze(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&Ze(n),1===t)0===e.tag?function(e){Mi=!0,Ri(e)}(sc.bind(null,e)):Ri(sc.bind(null,e)),ri((function(){0==(6&_l)&&Li()})),n=null;else{switch(bt(r)){case 1:n=$e;break;case 4:n=et;break;case 16:default:n=tt;break;case 536870912:n=rt}n=xc(n,nc.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function nc(e,t){if(ql=-1,Jl=0,0!=(6&_l))throw Error(o(327));var n=e.callbackNode;if(bc()&&e.callbackNode!==n)return null;var r=ht(e,e===xl?kl:0);if(0===r)return null;if(0!=(30&r)||0!=(r&e.expiredLanes)||t)t=fc(e,r);else{t=r;var i=_l;_l|=2;var s=hc();for(xl===e&&kl===t||(Ul=null,Ql=Je()+500,uc(e,t));;)try{mc();break}catch(t){dc(e,t)}Ao(),Cl.current=s,_l=i,null!==Pl?t=0:(xl=null,kl=0,t=Nl)}if(0!==t){if(2===t&&0!==(i=ft(e))&&(r=i,t=rc(e,i)),1===t)throw n=Dl,uc(e,0),oc(e,r),tc(e,Je()),n;if(6===t)oc(e,r);else{if(i=e.current.alternate,0==(30&r)&&!function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!ir(o(),i))return!1}catch(e){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(i)&&(2===(t=fc(e,r))&&0!==(s=ft(e))&&(r=s,t=rc(e,s)),1===t))throw n=Dl,uc(e,0),oc(e,r),tc(e,Je()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(o(345));case 2:case 5:Ac(e,Rl,Ul);break;case 3:if(oc(e,r),(130023424&r)===r&&10<(t=Ll+500-Je())){if(0!==ht(e,0))break;if(((i=e.suspendedLanes)&r)!==r){Xl(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=ei(Ac.bind(null,e,Rl,Ul),t);break}Ac(e,Rl,Ul);break;case 4:if(oc(e,r),(4194240&r)===r)break;for(t=e.eventTimes,i=-1;0<r;){var a=31-st(r);s=1<<a,(a=t[a])>i&&(i=a),r&=~s}if(r=i,10<(r=(120>(r=Je()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Sl(r/1960))-r)){e.timeoutHandle=ei(Ac.bind(null,e,Rl,Ul),r);break}Ac(e,Rl,Ul);break;default:throw Error(o(329))}}}return tc(e,Je()),e.callbackNode===n?nc.bind(null,e):null}function rc(e,t){var n=Fl;return e.current.memoizedState.isDehydrated&&(uc(e,t).flags|=256),2!==(e=fc(e,t))&&(t=Rl,Rl=n,null!==t&&ic(t)),e}function ic(e){null===Rl?Rl=e:Rl.push.apply(Rl,e)}function oc(e,t){for(t&=~Ml,t&=~Tl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-st(t),r=1<<n;e[n]=-1,t&=~r}}function sc(e){if(0!=(6&_l))throw Error(o(327));bc();var t=ht(e,0);if(0==(1&t))return tc(e,Je()),null;var n=fc(e,t);if(0!==e.tag&&2===n){var r=ft(e);0!==r&&(t=r,n=rc(e,r))}if(1===n)throw n=Dl,uc(e,0),oc(e,t),tc(e,Je()),n;if(6===n)throw Error(o(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ac(e,Rl,Ul),tc(e,Je()),null}function ac(e,t){var n=_l;_l|=1;try{return e(t)}finally{0===(_l=n)&&(Ql=Je()+500,Mi&&Li())}}function lc(e){null!==Yl&&0===Yl.tag&&0==(6&_l)&&bc();var t=_l;_l|=1;var n=Il.transition,r=At;try{if(Il.transition=null,At=1,e)return e()}finally{At=r,Il.transition=n,0==(6&(_l=t))&&Li()}}function cc(){Bl=Ol.current,Si(Ol)}function uc(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,ti(n)),null!==Pl)for(n=Pl.return;null!==n;){var r=n;switch(Xi(r),r.tag){case 1:null!=(r=r.type.childContextTypes)&&Bi();break;case 3:ns(),Si(_i),Si(Ii),ls();break;case 5:is(r);break;case 4:ns();break;case 13:case 19:Si(os);break;case 10:bo(r.type._context);break;case 22:case 23:cc()}n=n.return}if(xl=e,Pl=e=Oc(e.current,null),kl=Bl=t,Nl=0,Dl=null,Ml=Tl=jl=0,Rl=Fl=null,null!==Eo){for(t=0;t<Eo.length;t++)if(null!==(r=(n=Eo[t]).interleaved)){n.interleaved=null;var i=r.next,o=n.pending;if(null!==o){var s=o.next;o.next=i,r.next=s}n.pending=r}Eo=null}return e}function dc(e,t){for(;;){var n=Pl;try{if(Ao(),cs.current=ra,gs){for(var r=hs.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}gs=!1}if(ds=0,fs=ps=hs=null,ms=!1,ys=0,El.current=null,null===n||null===n.return){Nl=1,Dl=t,Pl=null;break}e:{var s=e,a=n.return,l=n,c=t;if(t=kl,l.flags|=32768,null!==c&&"object"==typeof c&&"function"==typeof c.then){var u=c,d=l,h=d.tag;if(0==(1&d.mode)&&(0===h||11===h||15===h)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var f=fa(a);if(null!==f){f.flags&=-257,ga(f,a,l,0,t),1&f.mode&&pa(s,u,t),c=u;var g=(t=f).updateQueue;if(null===g){var m=new Set;m.add(c),t.updateQueue=m}else g.add(c);break e}if(0==(1&t)){pa(s,u,t),pc();break e}c=Error(o(426))}else if(to&&1&l.mode){var y=fa(a);if(null!==y){0==(65536&y.flags)&&(y.flags|=256),ga(y,a,l,0,t),ho(aa(c,l));break e}}s=c=aa(c,l),4!==Nl&&(Nl=2),null===Fl?Fl=[s]:Fl.push(s),s=a;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t,jo(s,da(0,c,t));break e;case 1:l=c;var v=s.type,A=s.stateNode;if(0==(128&s.flags)&&("function"==typeof v.getDerivedStateFromError||null!==A&&"function"==typeof A.componentDidCatch&&(null===Hl||!Hl.has(A)))){s.flags|=65536,t&=-t,s.lanes|=t,jo(s,ha(s,l,t));break e}}s=s.return}while(null!==s)}vc(n)}catch(e){t=e,Pl===n&&null!==n&&(Pl=n=n.return);continue}break}}function hc(){var e=Cl.current;return Cl.current=ra,null===e?ra:e}function pc(){0!==Nl&&3!==Nl&&2!==Nl||(Nl=4),null===xl||0==(268435455&jl)&&0==(268435455&Tl)||oc(xl,kl)}function fc(e,t){var n=_l;_l|=2;var r=hc();for(xl===e&&kl===t||(Ul=null,uc(e,t));;)try{gc();break}catch(t){dc(e,t)}if(Ao(),_l=n,Cl.current=r,null!==Pl)throw Error(o(261));return xl=null,kl=0,Nl}function gc(){for(;null!==Pl;)yc(Pl)}function mc(){for(;null!==Pl&&!We();)yc(Pl)}function yc(e){var t=wl(e.alternate,e,Bl);e.memoizedProps=e.pendingProps,null===t?vc(e):Pl=t,El.current=null}function vc(e){var t=e;do{var n=t.alternate;if(e=t.return,0==(32768&t.flags)){if(null!==(n=Ga(n,t,Bl)))return void(Pl=n)}else{if(null!==(n=Ya(n,t)))return n.flags&=32767,void(Pl=n);if(null===e)return Nl=6,void(Pl=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}if(null!==(t=t.sibling))return void(Pl=t);Pl=t=e}while(null!==t);0===Nl&&(Nl=5)}function Ac(e,t,n){var r=At,i=Il.transition;try{Il.transition=null,At=1,function(e,t,n,r){do{bc()}while(null!==Yl);if(0!=(6&_l))throw Error(o(327));n=e.finishedWork;var i=e.finishedLanes;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(o(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-st(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}(e,s),e===xl&&(Pl=xl=null,kl=0),0==(2064&n.subtreeFlags)&&0==(2064&n.flags)||Gl||(Gl=!0,xc(tt,(function(){return bc(),null}))),s=0!=(15990&n.flags),0!=(15990&n.subtreeFlags)||s){s=Il.transition,Il.transition=null;var a=At;At=1;var l=_l;_l|=4,El.current=null,function(e,t){if(Jr=Ht,ur(e=cr())){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch(e){n=null;break e}var a=0,l=-1,c=-1,u=0,d=0,h=e,p=null;t:for(;;){for(var f;h!==n||0!==i&&3!==h.nodeType||(l=a+i),h!==s||0!==r&&3!==h.nodeType||(c=a+r),3===h.nodeType&&(a+=h.nodeValue.length),null!==(f=h.firstChild);)p=h,h=f;for(;;){if(h===e)break t;if(p===n&&++u===i&&(l=a),p===s&&++d===r&&(c=a),null!==(f=h.nextSibling))break;p=(h=p).parentNode}h=f}n=-1===l||-1===c?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Xr={focusedElem:e,selectionRange:n},Ht=!1,qa=t;null!==qa;)if(e=(t=qa).child,0!=(1028&t.subtreeFlags)&&null!==e)e.return=t,qa=e;else for(;null!==qa;){t=qa;try{var g=t.alternate;if(0!=(1024&t.flags))switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==g){var m=g.memoizedProps,y=g.memoizedState,v=t.stateNode,A=v.getSnapshotBeforeUpdate(t.elementType===t.type?m:fo(t.type,m),y);v.__reactInternalSnapshotBeforeUpdate=A}break;case 3:var b=t.stateNode.containerInfo;1===b.nodeType?b.textContent="":9===b.nodeType&&b.documentElement&&b.removeChild(b.documentElement);break;default:throw Error(o(163))}}catch(e){Sc(t,t.return,e)}if(null!==(e=t.sibling)){e.return=t.return,qa=e;break}qa=t.return}g=$a,$a=!1}(e,n),fl(n,e),dr(Xr),Ht=!!Jr,Xr=Jr=null,e.current=n,ml(n,e,i),qe(),_l=l,At=a,Il.transition=s}else e.current=n;if(Gl&&(Gl=!1,Yl=e,zl=i),0===(s=e.pendingLanes)&&(Hl=null),function(e){if(ot&&"function"==typeof ot.onCommitFiberRoot)try{ot.onCommitFiberRoot(it,e,void 0,128==(128&e.current.flags))}catch(e){}}(n.stateNode),tc(e,Je()),null!==t)for(r=e.onRecoverableError,n=0;n<t.length;n++)r((i=t[n]).value,{componentStack:i.stack,digest:i.digest});if(Vl)throw Vl=!1,e=Kl,Kl=null,e;0!=(1&zl)&&0!==e.tag&&bc(),0!=(1&(s=e.pendingLanes))?e===Wl?Zl++:(Zl=0,Wl=e):Zl=0,Li()}(e,t,n,r)}finally{Il.transition=i,At=r}return null}function bc(){if(null!==Yl){var e=bt(zl),t=Il.transition,n=At;try{if(Il.transition=null,At=16>e?16:e,null===Yl)var r=!1;else{if(e=Yl,Yl=null,zl=0,0!=(6&_l))throw Error(o(331));var i=_l;for(_l|=4,qa=e.current;null!==qa;){var s=qa,a=s.child;if(0!=(16&qa.flags)){var l=s.deletions;if(null!==l){for(var c=0;c<l.length;c++){var u=l[c];for(qa=u;null!==qa;){var d=qa;switch(d.tag){case 0:case 11:case 15:el(8,d,s)}var h=d.child;if(null!==h)h.return=d,qa=h;else for(;null!==qa;){var p=(d=qa).sibling,f=d.return;if(rl(d),d===u){qa=null;break}if(null!==p){p.return=f,qa=p;break}qa=f}}}var g=s.alternate;if(null!==g){var m=g.child;if(null!==m){g.child=null;do{var y=m.sibling;m.sibling=null,m=y}while(null!==m)}}qa=s}}if(0!=(2064&s.subtreeFlags)&&null!==a)a.return=s,qa=a;else e:for(;null!==qa;){if(0!=(2048&(s=qa).flags))switch(s.tag){case 0:case 11:case 15:el(9,s,s.return)}var v=s.sibling;if(null!==v){v.return=s.return,qa=v;break e}qa=s.return}}var A=e.current;for(qa=A;null!==qa;){var b=(a=qa).child;if(0!=(2064&a.subtreeFlags)&&null!==b)b.return=a,qa=b;else e:for(a=A;null!==qa;){if(0!=(2048&(l=qa).flags))try{switch(l.tag){case 0:case 11:case 15:tl(9,l)}}catch(e){Sc(l,l.return,e)}if(l===a){qa=null;break e}var w=l.sibling;if(null!==w){w.return=l.return,qa=w;break e}qa=l.return}}if(_l=i,Li(),ot&&"function"==typeof ot.onPostCommitFiberRoot)try{ot.onPostCommitFiberRoot(it,e)}catch(e){}r=!0}return r}finally{At=n,Il.transition=t}}return!1}function wc(e,t,n){e=No(e,t=da(0,t=aa(n,t),1),1),t=Xl(),null!==e&&(yt(e,1,t),tc(e,t))}function Sc(e,t,n){if(3===e.tag)wc(e,e,n);else for(;null!==t;){if(3===t.tag){wc(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Hl||!Hl.has(r))){t=No(t,e=ha(t,e=aa(n,e),1),1),e=Xl(),null!==t&&(yt(t,1,e),tc(t,e));break}}t=t.return}}function Cc(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=Xl(),e.pingedLanes|=e.suspendedLanes&n,xl===e&&(kl&n)===n&&(4===Nl||3===Nl&&(130023424&kl)===kl&&500>Je()-Ll?uc(e,0):Ml|=n),tc(e,t)}function Ec(e,t){0===t&&(0==(1&e.mode)?t=1:(t=ut,0==(130023424&(ut<<=1))&&(ut=4194304)));var n=Xl();null!==(e=xo(e,t))&&(yt(e,t,n),tc(e,n))}function Ic(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Ec(e,n)}function _c(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(o(314))}null!==r&&r.delete(t),Ec(e,n)}function xc(e,t){return ze(e,t)}function Pc(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kc(e,t,n,r){return new Pc(e,t,n,r)}function Bc(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Oc(e,t){var n=e.alternate;return null===n?((n=kc(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Nc(e,t,n,r,i,s){var a=2;if(r=e,"function"==typeof e)Bc(e)&&(a=1);else if("string"==typeof e)a=5;else e:switch(e){case C:return Dc(n.children,i,s,t);case E:a=8,i|=8;break;case I:return(e=kc(12,n,t,2|i)).elementType=I,e.lanes=s,e;case k:return(e=kc(13,n,t,i)).elementType=k,e.lanes=s,e;case B:return(e=kc(19,n,t,i)).elementType=B,e.lanes=s,e;case D:return jc(n,i,s,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case _:a=10;break e;case x:a=9;break e;case P:a=11;break e;case O:a=14;break e;case N:a=16,r=null;break e}throw Error(o(130,null==e?e:typeof e,""))}return(t=kc(a,n,t,i)).elementType=e,t.type=r,t.lanes=s,t}function Dc(e,t,n,r){return(e=kc(7,e,r,t)).lanes=n,e}function jc(e,t,n,r){return(e=kc(22,e,r,t)).elementType=D,e.lanes=n,e.stateNode={isHidden:!1},e}function Tc(e,t,n){return(e=kc(6,e,null,t)).lanes=n,e}function Mc(e,t,n){return(t=kc(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Fc(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=mt(0),this.expirationTimes=mt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Rc(e,t,n,r,i,o,s,a,l){return e=new Fc(e,t,n,a,l),1===t?(t=1,!0===o&&(t|=8)):t=0,o=kc(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ko(o),e}function Lc(e){if(!e)return Ei;e:{if(Ve(e=e._reactInternals)!==e||1!==e.tag)throw Error(o(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ki(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(o(171))}if(1===e.tag){var n=e.type;if(ki(n))return Ni(e,n,t)}return t}function Qc(e,t,n,r,i,o,s,a,l){return(e=Rc(n,r,!0,e,0,o,0,a,l)).context=Lc(null),n=e.current,(o=Oo(r=Xl(),i=$l(n))).callback=null!=t?t:null,No(n,o,i),e.current.lanes=i,yt(e,i,r),tc(e,r),e}function Uc(e,t,n,r){var i=t.current,o=Xl(),s=$l(i);return n=Lc(n),null===t.context?t.context=n:t.pendingContext=n,(t=Oo(o,s)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=No(i,t,s))&&(ec(e,i,s,o),Do(e,i,s)),s}function Vc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Kc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Hc(e,t){Kc(e,t),(e=e.alternate)&&Kc(e,t)}wl=function(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps||_i.current)ya=!0;else{if(0==(e.lanes&n)&&0==(128&t.flags))return ya=!1,function(e,t,n){switch(t.tag){case 3:xa(t),uo();break;case 5:rs(t);break;case 1:ki(t.type)&&Di(t);break;case 4:ts(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Ci(go,r._currentValue),r._currentValue=i;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(Ci(os,1&os.current),t.flags|=128,null):0!=(n&t.child.childLanes)?Ta(e,t,n):(Ci(os,1&os.current),null!==(e=Va(e,t,n))?e.sibling:null);Ci(os,1&os.current);break;case 19:if(r=0!=(n&t.childLanes),0!=(128&e.flags)){if(r)return Qa(e,t,n);t.flags|=128}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ci(os,os.current),r)break;return null;case 22:case 23:return t.lanes=0,Sa(e,t,n)}return Va(e,t,n)}(e,t,n);ya=0!=(131072&e.flags)}else ya=!1,to&&0!=(1048576&t.flags)&&qi(t,Ki,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ua(e,t),e=t.pendingProps;var i=Pi(t,Ii.current);So(t,n),i=ws(null,t,r,e,i,n);var s=Ss();return t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ki(r)?(s=!0,Di(t)):s=!1,t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,ko(t),i.updater=Lo,t.stateNode=i,i._reactInternals=t,Ko(t,r,e,n),t=_a(null,t,r,!0,s,n)):(t.tag=0,to&&s&&Ji(t),va(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ua(e,t),e=t.pendingProps,r=(i=r._init)(r._payload),t.type=r,i=t.tag=function(e){if("function"==typeof e)return Bc(e)?1:0;if(null!=e){if((e=e.$$typeof)===P)return 11;if(e===O)return 14}return 2}(r),e=fo(r,e),i){case 0:t=Ea(null,t,r,e,n);break e;case 1:t=Ia(null,t,r,e,n);break e;case 11:t=Aa(null,t,r,e,n);break e;case 14:t=ba(null,t,r,fo(r.type,e),n);break e}throw Error(o(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,Ea(e,t,r,i=t.elementType===r?i:fo(r,i),n);case 1:return r=t.type,i=t.pendingProps,Ia(e,t,r,i=t.elementType===r?i:fo(r,i),n);case 3:e:{if(xa(t),null===e)throw Error(o(387));r=t.pendingProps,i=(s=t.memoizedState).element,Bo(e,t),To(t,r,null,n);var a=t.memoizedState;if(r=a.element,s.isDehydrated){if(s={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=s,t.memoizedState=s,256&t.flags){t=Pa(e,t,r,n,i=aa(Error(o(423)),t));break e}if(r!==i){t=Pa(e,t,r,n,i=aa(Error(o(424)),t));break e}for(eo=si(t.stateNode.containerInfo.firstChild),$i=t,to=!0,no=null,n=Wo(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(uo(),r===i){t=Va(e,t,n);break e}va(e,t,r,n)}t=t.child}return t;case 5:return rs(t),null===e&&so(t),r=t.type,i=t.pendingProps,s=null!==e?e.memoizedProps:null,a=i.children,$r(r,i)?a=null:null!==s&&$r(r,s)&&(t.flags|=32),Ca(e,t),va(e,t,a,n),t.child;case 6:return null===e&&so(t),null;case 13:return Ta(e,t,n);case 4:return ts(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Zo(t,null,r,n):va(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,Aa(e,t,r,i=t.elementType===r?i:fo(r,i),n);case 7:return va(e,t,t.pendingProps,n),t.child;case 8:case 12:return va(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,a=i.value,Ci(go,r._currentValue),r._currentValue=a,null!==s)if(ir(s.value,a)){if(s.children===i.children&&!_i.current){t=Va(e,t,n);break e}}else for(null!==(s=t.child)&&(s.return=t);null!==s;){var l=s.dependencies;if(null!==l){a=s.child;for(var c=l.firstContext;null!==c;){if(c.context===r){if(1===s.tag){(c=Oo(-1,n&-n)).tag=2;var u=s.updateQueue;if(null!==u){var d=(u=u.shared).pending;null===d?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}s.lanes|=n,null!==(c=s.alternate)&&(c.lanes|=n),wo(s.return,n,t),l.lanes|=n;break}c=c.next}}else if(10===s.tag)a=s.type===t.type?null:s.child;else if(18===s.tag){if(null===(a=s.return))throw Error(o(341));a.lanes|=n,null!==(l=a.alternate)&&(l.lanes|=n),wo(a,n,t),a=s.sibling}else a=s.child;if(null!==a)a.return=s;else for(a=s;null!==a;){if(a===t){a=null;break}if(null!==(s=a.sibling)){s.return=a.return,a=s;break}a=a.return}s=a}va(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,So(t,n),r=r(i=Co(i)),t.flags|=1,va(e,t,r,n),t.child;case 14:return i=fo(r=t.type,t.pendingProps),ba(e,t,r,i=fo(r.type,i),n);case 15:return wa(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:fo(r,i),Ua(e,t),t.tag=1,ki(r)?(e=!0,Di(t)):e=!1,So(t,n),Uo(t,r,i),Ko(t,r,i,n),_a(null,t,r,!0,e,n);case 19:return Qa(e,t,n);case 22:return Sa(e,t,n)}throw Error(o(156,t.tag))};var Gc="function"==typeof reportError?reportError:function(e){console.error(e)};function Yc(e){this._internalRoot=e}function zc(e){this._internalRoot=e}function Zc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Wc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function qc(){}function Jc(e,t,n,r,i){var o=n._reactRootContainer;if(o){var s=o;if("function"==typeof i){var a=i;i=function(){var e=Vc(s);a.call(e)}}Uc(t,s,e,i)}else s=function(e,t,n,r,i){if(i){if("function"==typeof r){var o=r;r=function(){var e=Vc(s);o.call(e)}}var s=Qc(t,r,e,0,null,!1,0,"",qc);return e._reactRootContainer=s,e[di]=s.current,Lr(8===e.nodeType?e.parentNode:e),lc(),s}for(;i=e.lastChild;)e.removeChild(i);if("function"==typeof r){var a=r;r=function(){var e=Vc(l);a.call(e)}}var l=Rc(e,0,!1,null,0,!1,0,"",qc);return e._reactRootContainer=l,e[di]=l.current,Lr(8===e.nodeType?e.parentNode:e),lc((function(){Uc(t,l,n,r)})),l}(n,t,e,i,r);return Vc(s)}zc.prototype.render=Yc.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(o(409));Uc(e,t,null,null)},zc.prototype.unmount=Yc.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;lc((function(){Uc(null,e,null,null)})),t[di]=null}},zc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Et();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Dt.length&&0!==t&&t<Dt[n].priority;n++);Dt.splice(n,0,e),0===n&&Ft(e)}},wt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=dt(t.pendingLanes);0!==n&&(vt(t,1|n),tc(t,Je()),0==(6&_l)&&(Ql=Je()+500,Li()))}break;case 13:lc((function(){var t=xo(e,1);if(null!==t){var n=Xl();ec(t,e,1,n)}})),Hc(e,1)}},St=function(e){if(13===e.tag){var t=xo(e,134217728);null!==t&&ec(t,e,134217728,Xl()),Hc(e,134217728)}},Ct=function(e){if(13===e.tag){var t=$l(e),n=xo(e,t);null!==n&&ec(n,e,t,Xl()),Hc(e,t)}},Et=function(){return At},It=function(e,t){var n=At;try{return At=e,t()}finally{At=n}},Se=function(e,t,n){switch(t){case"input":if(X(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=vi(r);if(!i)throw Error(o(90));z(r),X(r,i)}}}break;case"textarea":oe(e,n);break;case"select":null!=(t=n.value)&&ne(e,!!n.multiple,t,!1)}},Pe=ac,ke=lc;var Xc={usingClientEntryPoint:!1,Events:[mi,yi,vi,_e,xe,ac]},$c={findFiberByHostInstance:gi,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},eu={bundleType:$c.bundleType,version:$c.version,rendererPackageName:$c.rendererPackageName,rendererConfig:$c.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:b.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Ge(e))?null:e.stateNode},findFiberByHostInstance:$c.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var tu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tu.isDisabled&&tu.supportsFiber)try{it=tu.inject(eu),ot=tu}catch(ue){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Xc,t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Zc(t))throw Error(o(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:S,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.createRoot=function(e,t){if(!Zc(e))throw Error(o(299));var n=!1,r="",i=Gc;return null!=t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onRecoverableError&&(i=t.onRecoverableError)),t=Rc(e,1,!1,null,0,n,0,r,i),e[di]=t.current,Lr(8===e.nodeType?e.parentNode:e),new Yc(t)},t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(o(188));throw e=Object.keys(e).join(","),Error(o(268,e))}return null===(e=Ge(t))?null:e.stateNode},t.flushSync=function(e){return lc(e)},t.hydrate=function(e,t,n){if(!Wc(t))throw Error(o(200));return Jc(null,e,t,!0,n)},t.hydrateRoot=function(e,t,n){if(!Zc(e))throw Error(o(405));var r=null!=n&&n.hydratedSources||null,i=!1,s="",a=Gc;if(null!=n&&(!0===n.unstable_strictMode&&(i=!0),void 0!==n.identifierPrefix&&(s=n.identifierPrefix),void 0!==n.onRecoverableError&&(a=n.onRecoverableError)),t=Qc(t,null,e,1,null!=n?n:null,i,0,s,a),e[di]=t.current,Lr(e),r)for(e=0;e<r.length;e++)i=(i=(n=r[e])._getVersion)(n._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new zc(t)},t.render=function(e,t,n){if(!Wc(t))throw Error(o(200));return Jc(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!Wc(e))throw Error(o(40));return!!e._reactRootContainer&&(lc((function(){Jc(null,null,e,!1,(function(){e._reactRootContainer=null,e[di]=null}))})),!0)},t.unstable_batchedUpdates=ac,t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Wc(n))throw Error(o(200));if(null==e||void 0===e._reactInternals)throw Error(o(38));return Jc(e,t,n,!1,r)},t.version="18.2.0-next-9e3b772b8-20220608"},17029:(e,t,n)=>{"use strict";var r=n(28316);t.s=r.createRoot,r.hydrateRoot},28316:(e,t,n)=>{"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(52967)},9670:(e,t)=>{"use strict";function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,i=e[r];if(!(0<o(i,t)))break e;e[r]=t,e[n]=i,n=r}}function r(e){return 0===e.length?null:e[0]}function i(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length,s=i>>>1;r<s;){var a=2*(r+1)-1,l=e[a],c=a+1,u=e[c];if(0>o(l,n))c<i&&0>o(u,l)?(e[r]=u,e[c]=n,r=c):(e[r]=l,e[a]=n,r=a);else{if(!(c<i&&0>o(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,h=null,p=3,f=!1,g=!1,m=!1,y="function"==typeof setTimeout?setTimeout:null,v="function"==typeof clearTimeout?clearTimeout:null,A="undefined"!=typeof setImmediate?setImmediate:null;function b(e){for(var t=r(u);null!==t;){if(null===t.callback)i(u);else{if(!(t.startTime<=e))break;i(u),t.sortIndex=t.expirationTime,n(c,t)}t=r(u)}}function w(e){if(m=!1,b(e),!g)if(null!==r(c))g=!0,D(S);else{var t=r(u);null!==t&&j(w,t.startTime-e)}}function S(e,n){g=!1,m&&(m=!1,v(_),_=-1),f=!0;var o=p;try{for(b(n),h=r(c);null!==h&&(!(h.expirationTime>n)||e&&!k());){var s=h.callback;if("function"==typeof s){h.callback=null,p=h.priorityLevel;var a=s(h.expirationTime<=n);n=t.unstable_now(),"function"==typeof a?h.callback=a:h===r(c)&&i(c),b(n)}else i(c);h=r(c)}if(null!==h)var l=!0;else{var d=r(u);null!==d&&j(w,d.startTime-n),l=!1}return l}finally{h=null,p=o,f=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var C,E=!1,I=null,_=-1,x=5,P=-1;function k(){return!(t.unstable_now()-P<x)}function B(){if(null!==I){var e=t.unstable_now();P=e;var n=!0;try{n=I(!0,e)}finally{n?C():(E=!1,I=null)}}else E=!1}if("function"==typeof A)C=function(){A(B)};else if("undefined"!=typeof MessageChannel){var O=new MessageChannel,N=O.port2;O.port1.onmessage=B,C=function(){N.postMessage(null)}}else C=function(){y(B,0)};function D(e){I=e,E||(E=!0,C())}function j(e,n){_=y((function(){e(t.unstable_now())}),n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){g||f||(g=!0,D(S))},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):x=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return r(c)},t.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var n=p;p=t;try{return e()}finally{p=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=p;p=e;try{return t()}finally{p=n}},t.unstable_scheduleCallback=function(e,i,o){var s=t.unstable_now();switch(o="object"==typeof o&&null!==o&&"number"==typeof(o=o.delay)&&0<o?s+o:s,e){case 1:var a=-1;break;case 2:a=250;break;case 5:a=1073741823;break;case 4:a=1e4;break;default:a=5e3}return e={id:d++,callback:i,priorityLevel:e,startTime:o,expirationTime:a=o+a,sortIndex:-1},o>s?(e.sortIndex=o,n(u,e),null===r(c)&&e===r(u)&&(m?(v(_),_=-1):m=!0,j(w,o-s))):(e.sortIndex=a,n(c,e),g||f||(g=!0,D(S))),e},t.unstable_shouldYield=k,t.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}},22941:(e,t,n)=>{"use strict";e.exports=n(9670)},11837:(e,t,n)=>{"use strict";var r=n(2784),i=Symbol.for("react.element"),o=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,o={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)s.call(t,r)&&!l.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:i,type:e,key:c,ref:u,props:o,_owner:a.current}}t.Fragment=o,t.jsx=c,t.jsxs=c},83426:(e,t)=>{"use strict";var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator,f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,m={};function y(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||f}function v(){}function A(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||f}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},v.prototype=y.prototype;var b=A.prototype=new v;b.constructor=A,g(b,y.prototype),b.isPureReactComponent=!0;var w=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},E={key:!0,ref:!0,__self:!0,__source:!0};function I(e,t,r){var i,o={},s=null,a=null;if(null!=t)for(i in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(s=""+t.key),t)S.call(t,i)&&!E.hasOwnProperty(i)&&(o[i]=t[i]);var l=arguments.length-2;if(1===l)o.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];o.children=c}if(e&&e.defaultProps)for(i in l=e.defaultProps)void 0===o[i]&&(o[i]=l[i]);return{$$typeof:n,type:e,key:s,ref:a,props:o,_owner:C.current}}function _(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var x=/\/+/g;function P(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function k(e,t,i,o,s){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var l=!1;if(null===e)l=!0;else switch(a){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case n:case r:l=!0}}if(l)return s=s(l=e),e=""===o?"."+P(l,0):o,w(s)?(i="",null!=e&&(i=e.replace(x,"$&/")+"/"),k(s,t,i,"",(function(e){return e}))):null!=s&&(_(s)&&(s=function(e,t){return{$$typeof:n,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(s,i+(!s.key||l&&l.key===s.key?"":(""+s.key).replace(x,"$&/")+"/")+e)),t.push(s)),1;if(l=0,o=""===o?".":o+":",w(e))for(var c=0;c<e.length;c++){var u=o+P(a=e[c],c);l+=k(a,t,i,u,s)}else if(u=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=p&&e[p]||e["@@iterator"])?e:null}(e),"function"==typeof u)for(e=u.call(e),c=0;!(a=e.next()).done;)l+=k(a=a.value,t,i,u=o+P(a,c++),s);else if("object"===a)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function B(e,t,n){if(null==e)return e;var r=[],i=0;return k(e,r,"","",(function(e){return t.call(n,e,i++)})),r}function O(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var N={current:null},D={transition:null},j={ReactCurrentDispatcher:N,ReactCurrentBatchConfig:D,ReactCurrentOwner:C};t.Children={map:B,forEach:function(e,t,n){B(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return B(e,(function(){t++})),t},toArray:function(e){return B(e,(function(e){return e}))||[]},only:function(e){if(!_(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=y,t.Fragment=i,t.Profiler=s,t.PureComponent=A,t.StrictMode=o,t.Suspense=u,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=j,t.cloneElement=function(e,t,r){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=g({},e.props),o=e.key,s=e.ref,a=e._owner;if(null!=t){if(void 0!==t.ref&&(s=t.ref,a=C.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)S.call(t,c)&&!E.hasOwnProperty(c)&&(i[c]=void 0===t[c]&&void 0!==l?l[c]:t[c])}var c=arguments.length-2;if(1===c)i.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];i.children=l}return{$$typeof:n,type:e.type,key:o,ref:s,props:i,_owner:a}},t.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:a,_context:e},e.Consumer=e},t.createElement=I,t.createFactory=function(e){var t=I.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=_,t.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:O}},t.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=D.transition;D.transition={};try{e()}finally{D.transition=t}},t.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},t.useCallback=function(e,t){return N.current.useCallback(e,t)},t.useContext=function(e){return N.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return N.current.useDeferredValue(e)},t.useEffect=function(e,t){return N.current.useEffect(e,t)},t.useId=function(){return N.current.useId()},t.useImperativeHandle=function(e,t,n){return N.current.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return N.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return N.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return N.current.useMemo(e,t)},t.useReducer=function(e,t,n){return N.current.useReducer(e,t,n)},t.useRef=function(e){return N.current.useRef(e)},t.useState=function(e){return N.current.useState(e)},t.useSyncExternalStore=function(e,t,n){return N.current.useSyncExternalStore(e,t,n)},t.useTransition=function(){return N.current.useTransition()},t.version="18.2.0"},2784:(e,t,n)=>{"use strict";e.exports=n(83426)},52322:(e,t,n)=>{"use strict";e.exports=n(11837)},20452:(e,t,n)=>{"use strict";var r=n(2784),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=r.useState,s=r.useEffect,a=r.useLayoutEffect,l=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=o({inst:{value:n,getSnapshot:t}}),i=r[0].inst,u=r[1];return a((function(){i.value=n,i.getSnapshot=t,c(i)&&u({inst:i})}),[e,n,t]),s((function(){return c(i)&&u({inst:i}),e((function(){c(i)&&u({inst:i})}))}),[e]),l(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},43100:(e,t,n)=>{"use strict";e.exports=n(20452)},44330:e=>{"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},10082:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},43335:(e,t,n)=>{var r=/%[sdj%]/g;t.format=function(e){if(!m(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(s(arguments[n]));return t.join(" ")}n=1;for(var i=arguments,o=i.length,a=String(e).replace(r,(function(e){if("%%"===e)return"%";if(n>=o)return e;switch(e){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch(e){return"[Circular]"}default:return e}})),l=i[n];n<o;l=i[++n])f(l)||!A(l)?a+=" "+l:a+=" "+s(l);return a},t.deprecate=function(e,r){if(y(n.g.process))return function(){return t.deprecate(e,r).apply(this,arguments)};if(!0===process.noDeprecation)return e;var i=!1;return function(){if(!i){if(process.throwDeprecation)throw new Error(r);process.traceDeprecation?console.trace(r):console.error(r),i=!0}return e.apply(this,arguments)}};var i,o={};function s(e,n){var r={seen:[],stylize:l};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),p(n)?r.showHidden=n:n&&t._extend(r,n),y(r.showHidden)&&(r.showHidden=!1),y(r.depth)&&(r.depth=2),y(r.colors)&&(r.colors=!1),y(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=a),c(r,e,r.depth)}function a(e,t){var n=s.styles[t];return n?"["+s.colors[n][0]+"m"+e+"["+s.colors[n][1]+"m":e}function l(e,t){return e}function c(e,n,r){if(e.customInspect&&n&&S(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return m(i)||(i=c(e,i,r)),i}var o=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(m(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return g(t)?e.stylize(""+t,"number"):p(t)?e.stylize(""+t,"boolean"):f(t)?e.stylize("null","null"):void 0}(e,n);if(o)return o;var s=Object.keys(n),a=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(n)),w(n)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return u(n);if(0===s.length){if(S(n)){var l=n.name?": "+n.name:"";return e.stylize("[Function"+l+"]","special")}if(v(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(b(n))return e.stylize(Date.prototype.toString.call(n),"date");if(w(n))return u(n)}var A,C="",E=!1,I=["{","}"];return h(n)&&(E=!0,I=["[","]"]),S(n)&&(C=" [Function"+(n.name?": "+n.name:"")+"]"),v(n)&&(C=" "+RegExp.prototype.toString.call(n)),b(n)&&(C=" "+Date.prototype.toUTCString.call(n)),w(n)&&(C=" "+u(n)),0!==s.length||E&&0!=n.length?r<0?v(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),A=E?function(e,t,n,r,i){for(var o=[],s=0,a=t.length;s<a;++s)_(t,String(s))?o.push(d(e,t,n,r,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(d(e,t,n,r,i,!0))})),o}(e,n,r,a,s):s.map((function(t){return d(e,n,r,a,t,E)})),e.seen.pop(),function(e,t,n){return e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n  ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}(A,C,I)):I[0]+C+I[1]}function u(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,n,r,i,o){var s,a,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(a=e.stylize("[Setter]","special")),_(r,i)||(s="["+i+"]"),a||(e.seen.indexOf(l.value)<0?(a=f(n)?c(e,l.value,null):c(e,l.value,n-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(e){return"  "+e})).join("\n").substr(2):"\n"+a.split("\n").map((function(e){return"   "+e})).join("\n")):a=e.stylize("[Circular]","special")),y(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function h(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function f(e){return null===e}function g(e){return"number"==typeof e}function m(e){return"string"==typeof e}function y(e){return void 0===e}function v(e){return A(e)&&"[object RegExp]"===C(e)}function A(e){return"object"==typeof e&&null!==e}function b(e){return A(e)&&"[object Date]"===C(e)}function w(e){return A(e)&&("[object Error]"===C(e)||e instanceof Error)}function S(e){return"function"==typeof e}function C(e){return Object.prototype.toString.call(e)}function E(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(y(i)&&(i=process.env.NODE_DEBUG||""),e=e.toUpperCase(),!o[e])if(new RegExp("\\b"+e+"\\b","i").test(i)){var n=process.pid;o[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,n,r)}}else o[e]=function(){};return o[e]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=h,t.isBoolean=p,t.isNull=f,t.isNullOrUndefined=function(e){return null==e},t.isNumber=g,t.isString=m,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=y,t.isRegExp=v,t.isObject=A,t.isDate=b,t.isError=w,t.isFunction=S,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(10082);var I=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function _(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,n;console.log("%s - %s",(e=new Date,n=[E(e.getHours()),E(e.getMinutes()),E(e.getSeconds())].join(":"),[e.getDate(),I[e.getMonth()],n].join(" ")),t.format.apply(t,arguments))},t.inherits=n(44330),t._extend=function(e,t){if(!t||!A(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}},60130:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NIL",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"v1",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"v3",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"v4",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"v5",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return l.default}});var r=h(n(27343)),i=h(n(46076)),o=h(n(85854)),s=h(n(13940)),a=h(n(15384)),l=h(n(25791)),c=h(n(77888)),u=h(n(49926)),d=h(n(9964));function h(e){return e&&e.__esModule?e:{default:e}}},2763:(e,t)=>{"use strict";function n(e){return 14+(e+64>>>9<<4)+1}function r(e,t){const n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function i(e,t,n,i,o,s){return r((a=r(r(t,e),r(i,s)))<<(l=o)|a>>>32-l,n);var a,l}function o(e,t,n,r,o,s,a){return i(t&n|~t&r,e,t,o,s,a)}function s(e,t,n,r,o,s,a){return i(t&r|n&~r,e,t,o,s,a)}function a(e,t,n,r,o,s,a){return i(t^n^r,e,t,o,s,a)}function l(e,t,n,r,o,s,a){return i(n^(t|~r),e,t,o,s,a)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return function(e){const t=[],n=32*e.length,r="0123456789abcdef";for(let i=0;i<n;i+=8){const n=e[i>>5]>>>i%32&255,o=parseInt(r.charAt(n>>>4&15)+r.charAt(15&n),16);t.push(o)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[n(t)-1]=t;let i=1732584193,c=-271733879,u=-1732584194,d=271733878;for(let t=0;t<e.length;t+=16){const n=i,h=c,p=u,f=d;i=o(i,c,u,d,e[t],7,-680876936),d=o(d,i,c,u,e[t+1],12,-389564586),u=o(u,d,i,c,e[t+2],17,606105819),c=o(c,u,d,i,e[t+3],22,-1044525330),i=o(i,c,u,d,e[t+4],7,-176418897),d=o(d,i,c,u,e[t+5],12,1200080426),u=o(u,d,i,c,e[t+6],17,-1473231341),c=o(c,u,d,i,e[t+7],22,-45705983),i=o(i,c,u,d,e[t+8],7,1770035416),d=o(d,i,c,u,e[t+9],12,-1958414417),u=o(u,d,i,c,e[t+10],17,-42063),c=o(c,u,d,i,e[t+11],22,-1990404162),i=o(i,c,u,d,e[t+12],7,1804603682),d=o(d,i,c,u,e[t+13],12,-40341101),u=o(u,d,i,c,e[t+14],17,-1502002290),c=o(c,u,d,i,e[t+15],22,1236535329),i=s(i,c,u,d,e[t+1],5,-165796510),d=s(d,i,c,u,e[t+6],9,-1069501632),u=s(u,d,i,c,e[t+11],14,643717713),c=s(c,u,d,i,e[t],20,-373897302),i=s(i,c,u,d,e[t+5],5,-701558691),d=s(d,i,c,u,e[t+10],9,38016083),u=s(u,d,i,c,e[t+15],14,-660478335),c=s(c,u,d,i,e[t+4],20,-405537848),i=s(i,c,u,d,e[t+9],5,568446438),d=s(d,i,c,u,e[t+14],9,-1019803690),u=s(u,d,i,c,e[t+3],14,-187363961),c=s(c,u,d,i,e[t+8],20,1163531501),i=s(i,c,u,d,e[t+13],5,-1444681467),d=s(d,i,c,u,e[t+2],9,-51403784),u=s(u,d,i,c,e[t+7],14,1735328473),c=s(c,u,d,i,e[t+12],20,-1926607734),i=a(i,c,u,d,e[t+5],4,-378558),d=a(d,i,c,u,e[t+8],11,-2022574463),u=a(u,d,i,c,e[t+11],16,1839030562),c=a(c,u,d,i,e[t+14],23,-35309556),i=a(i,c,u,d,e[t+1],4,-1530992060),d=a(d,i,c,u,e[t+4],11,1272893353),u=a(u,d,i,c,e[t+7],16,-155497632),c=a(c,u,d,i,e[t+10],23,-1094730640),i=a(i,c,u,d,e[t+13],4,681279174),d=a(d,i,c,u,e[t],11,-358537222),u=a(u,d,i,c,e[t+3],16,-722521979),c=a(c,u,d,i,e[t+6],23,76029189),i=a(i,c,u,d,e[t+9],4,-640364487),d=a(d,i,c,u,e[t+12],11,-421815835),u=a(u,d,i,c,e[t+15],16,530742520),c=a(c,u,d,i,e[t+2],23,-995338651),i=l(i,c,u,d,e[t],6,-198630844),d=l(d,i,c,u,e[t+7],10,1126891415),u=l(u,d,i,c,e[t+14],15,-1416354905),c=l(c,u,d,i,e[t+5],21,-57434055),i=l(i,c,u,d,e[t+12],6,1700485571),d=l(d,i,c,u,e[t+3],10,-1894986606),u=l(u,d,i,c,e[t+10],15,-1051523),c=l(c,u,d,i,e[t+1],21,-2054922799),i=l(i,c,u,d,e[t+8],6,1873313359),d=l(d,i,c,u,e[t+15],10,-30611744),u=l(u,d,i,c,e[t+6],15,-1560198380),c=l(c,u,d,i,e[t+13],21,1309151649),i=l(i,c,u,d,e[t+4],6,-145523070),d=l(d,i,c,u,e[t+11],10,-1120210379),u=l(u,d,i,c,e[t+2],15,718787259),c=l(c,u,d,i,e[t+9],21,-343485551),i=r(i,n),c=r(c,h),u=r(u,p),d=r(d,f)}return[i,c,u,d]}(function(e){if(0===e.length)return[];const t=8*e.length,r=new Uint32Array(n(t));for(let n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))}},74267:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};t.default=n},15384:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default="00000000-0000-0000-0000-000000000000"},9964:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(77888))&&r.__esModule?r:{default:r};t.default=function(e){if(!(0,i.default)(e))throw TypeError("Invalid UUID");let t;const n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n}},76678:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},41874:(e,t)=>{"use strict";let n;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(r)};const r=new Uint8Array(16)},13254:(e,t)=>{"use strict";function n(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:case 3:return t^n^r;case 2:return t&n^t&r^n&r}}function r(e,t){return e<<t|e>>>32-t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e){const t=[1518500249,1859775393,2400959708,3395469782],i=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const o=e.length/4+2,s=Math.ceil(o/16),a=new Array(s);for(let t=0;t<s;++t){const n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=e[64*t+4*r]<<24|e[64*t+4*r+1]<<16|e[64*t+4*r+2]<<8|e[64*t+4*r+3];a[t]=n}a[s-1][14]=8*(e.length-1)/Math.pow(2,32),a[s-1][14]=Math.floor(a[s-1][14]),a[s-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<s;++e){const o=new Uint32Array(80);for(let t=0;t<16;++t)o[t]=a[e][t];for(let e=16;e<80;++e)o[e]=r(o[e-3]^o[e-8]^o[e-14]^o[e-16],1);let s=i[0],l=i[1],c=i[2],u=i[3],d=i[4];for(let e=0;e<80;++e){const i=Math.floor(e/20),a=r(s,5)+n(i,l,c,u)+d+t[i]+o[e]>>>0;d=u,u=c,c=r(l,30)>>>0,l=s,s=a}i[0]=i[0]+s>>>0,i[1]=i[1]+l>>>0,i[2]=i[2]+c>>>0,i[3]=i[3]+u>>>0,i[4]=i[4]+d>>>0}return[i[0]>>24&255,i[0]>>16&255,i[0]>>8&255,255&i[0],i[1]>>24&255,i[1]>>16&255,i[1]>>8&255,255&i[1],i[2]>>24&255,i[2]>>16&255,i[2]>>8&255,255&i[2],i[3]>>24&255,i[3]>>16&255,i[3]>>8&255,255&i[3],i[4]>>24&255,i[4]>>16&255,i[4]>>8&255,255&i[4]]}},49926:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.unsafeStringify=s;var r,i=(r=n(77888))&&r.__esModule?r:{default:r};const o=[];for(let e=0;e<256;++e)o.push((e+256).toString(16).slice(1));function s(e,t=0){return(o[e[t+0]]+o[e[t+1]]+o[e[t+2]]+o[e[t+3]]+"-"+o[e[t+4]]+o[e[t+5]]+"-"+o[e[t+6]]+o[e[t+7]]+"-"+o[e[t+8]]+o[e[t+9]]+"-"+o[e[t+10]]+o[e[t+11]]+o[e[t+12]]+o[e[t+13]]+o[e[t+14]]+o[e[t+15]]).toLowerCase()}t.default=function(e,t=0){const n=s(e,t);if(!(0,i.default)(n))throw TypeError("Stringified UUID is invalid");return n}},27343:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(41874))&&r.__esModule?r:{default:r},o=n(49926);let s,a,l=0,c=0;t.default=function(e,t,n){let r=t&&n||0;const u=t||new Array(16);let d=(e=e||{}).node||s,h=void 0!==e.clockseq?e.clockseq:a;if(null==d||null==h){const t=e.random||(e.rng||i.default)();null==d&&(d=s=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==h&&(h=a=16383&(t[6]<<8|t[7]))}let p=void 0!==e.msecs?e.msecs:Date.now(),f=void 0!==e.nsecs?e.nsecs:c+1;const g=p-l+(f-c)/1e4;if(g<0&&void 0===e.clockseq&&(h=h+1&16383),(g<0||p>l)&&void 0===e.nsecs&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");l=p,c=f,a=h,p+=122192928e5;const m=(1e4*(268435455&p)+f)%4294967296;u[r++]=m>>>24&255,u[r++]=m>>>16&255,u[r++]=m>>>8&255,u[r++]=255&m;const y=p/4294967296*1e4&268435455;u[r++]=y>>>8&255,u[r++]=255&y,u[r++]=y>>>24&15|16,u[r++]=y>>>16&255,u[r++]=h>>>8|128,u[r++]=255&h;for(let e=0;e<6;++e)u[r+e]=d[e];return t||(0,o.unsafeStringify)(u)}},46076:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(18679)),i=o(n(2763));function o(e){return e&&e.__esModule?e:{default:e}}var s=(0,r.default)("v3",48,i.default);t.default=s},18679:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0,t.default=function(e,t,n){function r(e,r,s,a){var l;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=(0,o.default)(r)),16!==(null===(l=r)||void 0===l?void 0:l.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+e.length);if(c.set(r),c.set(e,r.length),c=n(c),c[6]=15&c[6]|t,c[8]=63&c[8]|128,s){a=a||0;for(let e=0;e<16;++e)s[a+e]=c[e];return s}return(0,i.unsafeStringify)(c)}try{r.name=e}catch(e){}return r.DNS=s,r.URL=a,r};var r,i=n(49926),o=(r=n(9964))&&r.__esModule?r:{default:r};const s="6ba7b810-9dad-11d1-80b4-00c04fd430c8";t.DNS=s;const a="6ba7b811-9dad-11d1-80b4-00c04fd430c8";t.URL=a},85854:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n(74267)),i=s(n(41874)),o=n(49926);function s(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t,n){if(r.default.randomUUID&&!t&&!e)return r.default.randomUUID();const s=(e=e||{}).random||(e.rng||i.default)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=s[e];return t}return(0,o.unsafeStringify)(s)}},13940:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(18679)),i=o(n(13254));function o(e){return e&&e.__esModule?e:{default:e}}var s=(0,r.default)("v5",80,i.default);t.default=s},77888:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(76678))&&r.__esModule?r:{default:r};t.default=function(e){return"string"==typeof e&&i.default.test(e)}},25791:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(77888))&&r.__esModule?r:{default:r};t.default=function(e){if(!(0,i.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}},50633:()=>{},22901:()=>{},68236:()=>{},40077:(e,t,n)=>{"use strict";n.d(t,{EZ:()=>d,S0:()=>h,ih:()=>u});var r=Object.defineProperty,i=Object.defineProperties,o=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,c=(e,t,n)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,u=(e,t)=>{for(var n in t||(t={}))a.call(t,n)&&c(e,n,t[n]);if(s)for(var n of s(t))l.call(t,n)&&c(e,n,t[n]);return e},d=(e,t)=>i(e,o(t)),h=(e,t)=>{var n={};for(var r in e)a.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&s)for(var r of s(e))t.indexOf(r)<0&&l.call(e,r)&&(n[r]=e[r]);return n}},23478:(e,t,n)=>{"use strict";function r(e){return Array.isArray(e)?e:void 0!==e?[e]:[]}function i(e){const t=[];for(const n of e)t.push(...n);return t}function o(e){return e.slice().reverse()}n.d(t,{GP:()=>o,JH:()=>i,qo:()=>r})},13277:(e,t,n)=>{"use strict";n.d(t,{CE:()=>h,Ld:()=>c,MT:()=>s,Ny:()=>f,S1:()=>l,Z_:()=>u,cY:()=>a,dC:()=>d,yt:()=>p});var r=n(81548),i=n(40077);function o(e,t){const n=e.__unstableInternals;return(0,r.kG)(n,"Invalid store"),n[t]}function s(e,...t){let n=e,o=n,a=Symbol(),c=r.ZT;const d=new Set,h=new Set,p=new Set,f=new Set,g=new Set,m=new WeakMap,y=new WeakMap,v=(e,t,n=f)=>(n.add(t),y.set(t,e),()=>{var e;null==(e=m.get(t))||e(),m.delete(t),y.delete(t),n.delete(t)}),A=(e,s,l=!1)=>{if(!(0,r.nr)(n,e))return;const c=(0,r.Ei)(s,n[e]);if(c===n[e])return;l||t.forEach((t=>{var n;null==(n=null==t?void 0:t.setState)||n.call(t,e,c)}));const u=n;n=(0,i.EZ)((0,i.ih)({},n),{[e]:c});const d=Symbol();a=d,h.add(e);const p=(t,r,i)=>{var o;const s=y.get(t);s&&!s.some((t=>i?i.has(t):t===e))||(null==(o=m.get(t))||o(),m.set(t,t(n,r)))};f.forEach((e=>{p(e,u)})),queueMicrotask((()=>{if(a!==d)return;const e=n;g.forEach((e=>{p(e,o,h)})),o=e,h.clear()}))},b={getState:()=>n,setState:A,__unstableInternals:{setup:e=>(p.add(e),()=>p.delete(e)),init:()=>{if(!t.length)return r.ZT;const e=d.size,i=Symbol();d.add(i);const o=()=>{d.delete(i),d.size||c()};if(e)return o;const s=(0,r.RR)(n).map((e=>(0,r.tS)(...t.map((t=>{var n;const i=null==(n=null==t?void 0:t.getState)?void 0:n.call(t);if(i&&(0,r.nr)(i,e))return u(t,[e],(t=>{A(e,t[e],!0)}))}))))),a=[];p.forEach((e=>a.push(e())));const h=t.map(l);return c=(0,r.tS)(...s,...a,...h),o},subscribe:(e,t)=>v(e,t),sync:(e,t)=>(m.set(t,t(n,n)),v(e,t)),batch:(e,t)=>(m.set(t,t(n,o)),v(e,t,g)),pick:e=>s((0,r.ei)(n,e),b),omit:e=>s((0,r.CE)(n,e),b)}};return b}function a(e,...t){if(e)return o(e,"setup")(...t)}function l(e,...t){if(e)return o(e,"init")(...t)}function c(e,...t){if(e)return o(e,"subscribe")(...t)}function u(e,...t){if(e)return o(e,"sync")(...t)}function d(e,...t){if(e)return o(e,"batch")(...t)}function h(e,...t){if(e)return o(e,"omit")(...t)}function p(...e){return s(e.reduce(((e,t)=>{var n;const r=null==(n=null==t?void 0:t.getState)?void 0:n.call(t);return r?(0,i.ih)((0,i.ih)({},e),r):e}),{}),...e)}function f(e,t){}},14191:(e,t,n)=>{"use strict";n.d(t,{t:()=>m});var r=n(13277),i=n(81548),o=n(10244),s=n(40077);function a(e={}){var t;(0,r.Ny)(e,e.store);const n=null==(t=e.store)?void 0:t.getState(),a=(0,i.LS)(e.items,null==n?void 0:n.items,e.defaultItems,[]),l=new Map(a.map((e=>[e.id,e]))),c={items:a,renderedItems:(0,i.LS)(null==n?void 0:n.renderedItems,[])},u=null==(d=e.store)?void 0:d.__unstablePrivateStore;var d;const h=(0,r.MT)({renderedItems:c.renderedItems},u),p=(0,r.MT)(c,e.store),f=()=>{const e=function(e){const t=e.map(((e,t)=>[t,e]));let n=!1;return t.sort((([e,t],[r,i])=>{const o=t.element,s=i.element;return o===s?0:o&&s?function(e,t){return Boolean(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}(o,s)?(e>r&&(n=!0),-1):(e<r&&(n=!0),1):0})),n?t.map((([e,t])=>t)):e}(h.getState().renderedItems);h.setState("renderedItems",e),p.setState("renderedItems",e)};(0,r.cY)(p,(()=>(0,r.S1)(h))),(0,r.cY)(h,(()=>(0,r.dC)(h,["renderedItems"],(e=>{let t=!0,n=requestAnimationFrame(f);if("function"!=typeof IntersectionObserver)return;const r=function(e){var t;const n=e.find((e=>!!e.element)),r=[...e].reverse().find((e=>!!e.element));let i=null==(t=null==n?void 0:n.element)?void 0:t.parentElement;for(;i&&(null==r?void 0:r.element);){if(r&&i.contains(r.element))return i;i=i.parentElement}return(0,o.Me)(i).body}(e.renderedItems),i=new IntersectionObserver((()=>{t?t=!1:(cancelAnimationFrame(n),n=requestAnimationFrame(f))}),{root:r});return e.renderedItems.forEach((e=>{e.element&&i.observe(e.element)})),()=>{cancelAnimationFrame(n),i.disconnect()}}))));const g=(e,t,n=!1)=>{let r;return t((t=>{const n=t.findIndex((({id:t})=>t===e.id)),i=t.slice();if(-1!==n){r=t[n];const o=(0,s.ih)((0,s.ih)({},r),e);i[n]=o,l.set(e.id,o)}else i.push(e),l.set(e.id,e);return i})),()=>{t((t=>{if(!r)return n&&l.delete(e.id),t.filter((({id:t})=>t!==e.id));const i=t.findIndex((({id:t})=>t===e.id));if(-1===i)return t;const o=t.slice();return o[i]=r,l.set(e.id,r),o}))}},m=e=>g(e,(e=>p.setState("items",e)),!0);return(0,s.EZ)((0,s.ih)({},p),{registerItem:m,renderItem:e=>(0,i.tS)(m(e),g(e,(e=>h.setState("renderedItems",e)))),item:e=>{if(!e)return null;let t=l.get(e);if(!t){const{items:n}=p.getState();t=n.find((t=>t.id===e)),t&&l.set(e,t)}return t||null},__unstablePrivateStore:h})}var l=n(23478),c={id:null};function u(e,t){return e.find((e=>t?!e.disabled&&e.id!==t:!e.disabled))}function d(e,t){return e.filter((e=>e.rowId===t))}function h(e){const t=[];for(const n of e){const e=t.find((e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===n.rowId}));e?e.push(n):t.push([n])}return t}function p(e){let t=0;for(const{length:n}of e)n>t&&(t=n);return t}function f(e,t,n){const r=p(e);for(const i of e)for(let e=0;e<r;e+=1){const r=i[e];if(!r||n&&r.disabled){const r=0===e&&n?u(i):i[e-1];i[e]=r&&t!==r.id&&n?r:{id:"__EMPTY_ITEM__",disabled:!0,rowId:null==r?void 0:r.rowId}}}return e}function g(e){const t=h(e),n=p(t),r=[];for(let e=0;e<n;e+=1)for(const n of t){const t=n[e];t&&r.push((0,s.EZ)((0,s.ih)({},t),{rowId:t.rowId?`${e}`:void 0}))}return r}function m(e={}){var t;const n=null==(t=e.store)?void 0:t.getState(),o=a(e),p=(0,i.LS)(e.activeId,null==n?void 0:n.activeId,e.defaultActiveId),m=(0,s.EZ)((0,s.ih)({},o.getState()),{activeId:p,baseElement:(0,i.LS)(null==n?void 0:n.baseElement,null),includesBaseElement:(0,i.LS)(e.includesBaseElement,null==n?void 0:n.includesBaseElement,null===p),moves:(0,i.LS)(null==n?void 0:n.moves,0),orientation:(0,i.LS)(e.orientation,null==n?void 0:n.orientation,"both"),rtl:(0,i.LS)(e.rtl,null==n?void 0:n.rtl,!1),virtualFocus:(0,i.LS)(e.virtualFocus,null==n?void 0:n.virtualFocus,!1),focusLoop:(0,i.LS)(e.focusLoop,null==n?void 0:n.focusLoop,!1),focusWrap:(0,i.LS)(e.focusWrap,null==n?void 0:n.focusWrap,!1),focusShift:(0,i.LS)(e.focusShift,null==n?void 0:n.focusShift,!1)}),y=(0,r.MT)(m,o,e.store);(0,r.cY)(y,(()=>(0,r.Z_)(y,["renderedItems","activeId"],(e=>{y.setState("activeId",(t=>{var n;return void 0!==t?t:null==(n=u(e.renderedItems))?void 0:n.id}))}))));const v=(e,t,n,r)=>{var i,o;const{activeId:s,rtl:a,focusLoop:h,focusWrap:p,includesBaseElement:f}=y.getState(),g=a&&"vertical"!==t?(0,l.GP)(e):e;if(null==s)return null==(i=u(g))?void 0:i.id;const m=g.find((e=>e.id===s));if(!m)return null==(o=u(g))?void 0:o.id;const v=!!m.rowId,A=g.indexOf(m),b=g.slice(A+1),w=d(b,m.rowId);if(void 0!==r){const e=function(e,t){return e.filter((e=>t?!e.disabled&&e.id!==t:!e.disabled))}(w,s),t=e.slice(r)[0]||e[e.length-1];return null==t?void 0:t.id}const S=function(e){return"vertical"===e?"horizontal":"horizontal"===e?"vertical":void 0}(v?t||"horizontal":t),C=h&&h!==S,E=v&&p&&p!==S;if(n=n||!v&&C&&f,C){const e=function(e,t,n=!1){const r=e.findIndex((e=>e.id===t));return[...e.slice(r+1),...n?[c]:[],...e.slice(0,r)]}(E&&!n?g:d(g,m.rowId),s,n),t=u(e,s);return null==t?void 0:t.id}if(E){const e=u(n?w:b,s);return n?(null==e?void 0:e.id)||null:null==e?void 0:e.id}const I=u(w,s);return!I&&n?null:null==I?void 0:I.id};return(0,s.EZ)((0,s.ih)((0,s.ih)({},o),y),{setBaseElement:e=>y.setState("baseElement",e),setActiveId:e=>y.setState("activeId",e),move:e=>{void 0!==e&&(y.setState("activeId",e),y.setState("moves",(e=>e+1)))},first:()=>{var e;return null==(e=u(y.getState().renderedItems))?void 0:e.id},last:()=>{var e;return null==(e=u((0,l.GP)(y.getState().renderedItems)))?void 0:e.id},next:e=>{const{renderedItems:t,orientation:n}=y.getState();return v(t,n,!1,e)},previous:e=>{var t;const{renderedItems:n,orientation:r,includesBaseElement:i}=y.getState(),o=!(null==(t=u(n))?void 0:t.rowId)&&i;return v((0,l.GP)(n),r,o,e)},down:e=>{const{activeId:t,renderedItems:n,focusShift:r,focusLoop:i,includesBaseElement:o}=y.getState(),s=r&&!e,a=g((0,l.JH)(f(h(n),t,s)));return v(a,"vertical",i&&"horizontal"!==i&&o,e)},up:e=>{const{activeId:t,renderedItems:n,focusShift:r,includesBaseElement:i}=y.getState(),o=r&&!e,s=g((0,l.GP)((0,l.JH)(f(h(n),t,o))));return v(s,"vertical",i,e)}})}},10244:(e,t,n)=>{"use strict";n.d(t,{AU:()=>A,Av:()=>c,Jj:()=>s,Me:()=>o,Nq:()=>i,SK:()=>m,eS:()=>g,iK:()=>u,lQ:()=>y,oq:()=>f,pn:()=>p,r3:()=>l,vY:()=>a,wB:()=>h,wy:()=>v});var r,i="undefined"!=typeof window&&!!(null==(r=window.document)?void 0:r.createElement);function o(e){return e?e.ownerDocument||e:document}function s(e){return o(e).defaultView||window}function a(e,t=!1){const{activeElement:n}=o(e);if(!(null==n?void 0:n.nodeName))return null;if(c(n)&&n.contentDocument)return a(n.contentDocument.body,t);if(t){const e=n.getAttribute("aria-activedescendant");if(e){const t=o(n).getElementById(e);if(t)return t}}return n}function l(e,t){return e===t||e.contains(t)}function c(e){return"IFRAME"===e.tagName}function u(e){const t=e.tagName.toLowerCase();return"button"===t||!("input"!==t||!e.type)&&-1!==d.indexOf(e.type)}var d=["button","color","file","image","reset","submit"];function h(e,t){return"matches"in e?e.matches(t):"msMatchesSelector"in e?e.msMatchesSelector(t):e.webkitMatchesSelector(t)}function p(e){const t=e;return t.offsetWidth>0||t.offsetHeight>0||e.getClientRects().length>0}function f(e,t){if("closest"in e)return e.closest(t);do{if(h(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}function g(e){try{const t=e instanceof HTMLInputElement&&null!==e.selectionStart,n="TEXTAREA"===e.tagName;return t||n||!1}catch(e){return!1}}function m(e,t){const n=null==e?void 0:e.getAttribute("role");return n&&-1!==["dialog","menu","listbox","tree","grid"].indexOf(n)?n:t}function y(e,t){var n;const r=m(e);return r&&null!=(n={menu:"menuitem",listbox:"option",tree:"treeitem",grid:"gridcell"}[r])?n:t}function v(e){if(!e)return null;if(e.clientHeight&&e.scrollHeight>e.clientHeight){const{overflowY:t}=getComputedStyle(e);if("visible"!==t&&"hidden"!==t)return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){const{overflowX:t}=getComputedStyle(e);if("visible"!==t&&"hidden"!==t)return e}return v(e.parentElement)||document.scrollingElement||document.body}function A(e,...t){/text|search|password|tel|url/i.test(e.type)&&e.setSelectionRange(...t)}},81548:(e,t,n)=>{"use strict";n.d(t,{Bk:()=>f,CE:()=>c,EE:()=>g,Ei:()=>o,LS:()=>m,RR:()=>p,Ue:()=>l,ZT:()=>i,ei:()=>u,kG:()=>h,nr:()=>s,tS:()=>a,yR:()=>d});var r=n(40077);function i(...e){}function o(e,t){return function(e){return"function"==typeof e}(e)?e("function"==typeof t?t():t):e}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function a(...e){return(...t)=>{for(const n of e)"function"==typeof n&&n(...t)}}function l(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function c(e,t){const n=(0,r.ih)({},e);for(const e of t)s(n,e)&&delete n[e];return n}function u(e,t){const n={};for(const r of t)s(e,r)&&(n[r]=e[r]);return n}function d(e){return e}function h(e,t){if(!e){if("string"!=typeof t)throw new Error("Invariant failed");throw new Error(t)}}function p(e){return Object.keys(e)}function f(e,...t){const n="function"==typeof e?e(...t):e;return null!=n&&!n}function g(e){return e.disabled||!0===e["aria-disabled"]||"true"===e["aria-disabled"]}function m(...e){for(const t of e)if(void 0!==t)return t}},41410:(e,t,n)=>{"use strict";n.d(t,{e:()=>a});var r=n(30925),i=n(13277),o=n(81548),s=n(40077);function a(e={}){var t=e,{popover:n}=t,a=(0,s.S0)(t,["popover"]);const l=(0,i.yt)(a.store,(0,i.CE)(n,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"]));(0,i.Ny)(a,l);const c=null==l?void 0:l.getState(),u=(0,r.n)((0,s.EZ)((0,s.ih)({},a),{store:l})),d=(0,o.LS)(a.placement,null==c?void 0:c.placement,"bottom"),h=(0,s.EZ)((0,s.ih)({},u.getState()),{placement:d,currentPlacement:d,anchorElement:(0,o.LS)(null==c?void 0:c.anchorElement,null),popoverElement:(0,o.LS)(null==c?void 0:c.popoverElement,null),arrowElement:(0,o.LS)(null==c?void 0:c.arrowElement,null),rendered:Symbol("rendered")}),p=(0,i.MT)(h,u,l);return(0,s.EZ)((0,s.ih)((0,s.ih)({},u),p),{setAnchorElement:e=>p.setState("anchorElement",e),setPopoverElement:e=>p.setState("popoverElement",e),setArrowElement:e=>p.setState("arrowElement",e),render:()=>p.setState("rendered",Symbol("rendered"))})}},30925:(e,t,n)=>{"use strict";n.d(t,{n:()=>i});var r=n(17122);function i(e={}){return(0,r.X)(e)}},29052:(e,t,n)=>{"use strict";n.d(t,{G6:()=>s,V5:()=>l,b1:()=>i,mL:()=>o,vU:()=>a});var r=n(10244);function i(){return r.Nq&&!!navigator.maxTouchPoints}function o(){return!!r.Nq&&/mac|iphone|ipad|ipod/i.test(navigator.platform)}function s(){return r.Nq&&o()&&/apple/i.test(navigator.vendor)}function a(){return r.Nq&&/firefox\//i.test(navigator.userAgent)}function l(){return r.Nq&&navigator.platform.startsWith("Mac")&&!i()}},17122:(e,t,n)=>{"use strict";n.d(t,{X:()=>s});var r=n(13277),i=n(81548),o=n(40077);function s(e={}){const t=(0,r.yt)(e.store,(0,r.CE)(e.disclosure,["contentElement","disclosureElement"]));(0,r.Ny)(e,t);const n=null==t?void 0:t.getState(),s=(0,i.LS)(e.open,null==n?void 0:n.open,e.defaultOpen,!1),a=(0,i.LS)(e.animated,null==n?void 0:n.animated,!1),l={open:s,animated:a,animating:!!a&&s,mounted:s,contentElement:(0,i.LS)(null==n?void 0:n.contentElement,null),disclosureElement:(0,i.LS)(null==n?void 0:n.disclosureElement,null)},c=(0,r.MT)(l,t);return(0,r.cY)(c,(()=>(0,r.Z_)(c,["animated","animating"],(e=>{e.animated||c.setState("animating",!1)})))),(0,r.cY)(c,(()=>(0,r.Ld)(c,["open"],(()=>{c.getState().animated&&c.setState("animating",!0)})))),(0,r.cY)(c,(()=>(0,r.Z_)(c,["open","animating"],(e=>{c.setState("mounted",e.open||e.animating)})))),(0,o.EZ)((0,o.ih)({},c),{setOpen:e=>c.setState("open",e),show:()=>c.setState("open",!0),hide:()=>c.setState("open",!1),toggle:()=>c.setState("open",(e=>!e)),stopAnimation:()=>c.setState("animating",!1),setContentElement:e=>c.setState("contentElement",e),setDisclosureElement:e=>c.setState("disclosureElement",e)})}},97254:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(41410),i=n(13277),o=n(81548),s=n(40077);function a(e={}){var t;const n=null==(t=e.store)?void 0:t.getState(),a=(0,r.e)((0,s.EZ)((0,s.ih)({},e),{placement:(0,o.LS)(e.placement,null==n?void 0:n.placement,"bottom")})),l=(0,o.LS)(e.timeout,null==n?void 0:n.timeout,500),c=(0,s.EZ)((0,s.ih)({},a.getState()),{timeout:l,showTimeout:(0,o.LS)(e.showTimeout,null==n?void 0:n.showTimeout),hideTimeout:(0,o.LS)(e.hideTimeout,null==n?void 0:n.hideTimeout),autoFocusOnShow:(0,o.LS)(null==n?void 0:n.autoFocusOnShow,!1)}),u=(0,i.MT)(c,a,e.store);return(0,s.EZ)((0,s.ih)((0,s.ih)({},a),u),{setAutoFocusOnShow:e=>u.setState("autoFocusOnShow",e)})}},99224:(e,t,n)=>{"use strict";n.d(t,{Ke:()=>s,N:()=>f,Ud:()=>a,Vr:()=>d,XN:()=>c,iN:()=>m,lO:()=>p,nm:()=>h,qx:()=>g,sE:()=>u,wC:()=>l});var r=n(29052),i=n(10244),o=n(40077);function s(e){return Boolean(e.currentTarget&&!(0,i.r3)(e.currentTarget,e.target))}function a(e){return e.target===e.currentTarget}function l(e){const t=e.currentTarget;if(!t)return!1;const n=(0,r.mL)();if(n&&!e.metaKey)return!1;if(!n&&!e.ctrlKey)return!1;const i=t.tagName.toLowerCase();return"a"===i||"button"===i&&"submit"===t.type||"input"===i&&"submit"===t.type}function c(e){const t=e.currentTarget;if(!t)return!1;const n=t.tagName.toLowerCase();return!!e.altKey&&("a"===n||"button"===n&&"submit"===t.type||"input"===n&&"submit"===t.type)}function u(e,t){const n=new FocusEvent("blur",t),r=e.dispatchEvent(n),i=(0,o.EZ)((0,o.ih)({},t),{bubbles:!0});return e.dispatchEvent(new FocusEvent("focusout",i)),r}function d(e,t){const n=new FocusEvent("focus",t),r=e.dispatchEvent(n),i=(0,o.EZ)((0,o.ih)({},t),{bubbles:!0});return e.dispatchEvent(new FocusEvent("focusin",i)),r}function h(e,t,n){const r=new KeyboardEvent(t,n);return e.dispatchEvent(r)}function p(e,t){const n=new MouseEvent("click",t);return e.dispatchEvent(n)}function f(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!(0,i.r3)(n,r)}function g(e,t,n){const r=requestAnimationFrame((()=>{e.removeEventListener(t,i,!0),n()})),i=()=>{cancelAnimationFrame(r),n()};return e.addEventListener(t,i,{once:!0,capture:!0}),r}function m(e,t,n,r=window){const i=[];try{r.document.addEventListener(e,t,n);for(const o of Array.from(r.frames))i.push(m(e,t,n,o))}catch(e){}return()=>{try{r.document.removeEventListener(e,t,n)}catch(e){}i.forEach((e=>e()))}}},15212:(e,t,n)=>{"use strict";n.d(t,{B_:()=>f,EB:()=>s,H1:()=>p,MN:()=>y,PY:()=>A,Qw:()=>g,SI:()=>c,YC:()=>u,e8:()=>h,k0:()=>d,ss:()=>v});var r=n(10244),i=n(40077),o="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function s(e){return!!(0,r.wB)(e,o)&&!!(0,r.pn)(e)&&!(0,r.oq)(e,"[inert]")}function a(e){if(!s(e))return!1;if(function(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}(e))return!1;if(!("form"in e))return!0;if(!e.form)return!0;if(e.checked)return!0;if("radio"!==e.type)return!0;const t=e.form.elements.namedItem(e.name);if(!t)return!0;if(!("length"in t))return!0;const n=(0,r.vY)(e);return!n||n===e||!("form"in n)||n.form!==e.form||n.name!==e.name}function l(e,t){const n=Array.from(e.querySelectorAll(o));t&&n.unshift(e);const i=n.filter(s);return i.forEach(((e,t)=>{if((0,r.Av)(e)&&e.contentDocument){const n=e.contentDocument.body;i.splice(t,1,...l(n))}})),i}function c(e,t,n){const i=Array.from(e.querySelectorAll(o)),s=i.filter(a);return t&&a(e)&&s.unshift(e),s.forEach(((e,t)=>{if((0,r.Av)(e)&&e.contentDocument){const r=c(e.contentDocument.body,!1,n);s.splice(t,1,...r)}})),!s.length&&n?i:s}function u(e,t,n){const[r]=c(e,t,n);return r||null}function d(e,t){return function(e,t,n,i){const o=(0,r.vY)(e),s=l(e,!1),c=s.indexOf(o),u=s.slice(c+1);return u.find(a)||(n?s.find(a):null)||(i?u[0]:null)||null}(document.body,0,e,t)}function h(e,t){return function(e,t,n,i){const o=(0,r.vY)(e),s=l(e,!1).reverse(),c=s.indexOf(o),u=s.slice(c+1);return u.find(a)||(n?s.find(a):null)||(i?u[0]:null)||null}(document.body,0,e,t)}function p(e){const t=(0,r.vY)(e);if(!t)return!1;if(t===e)return!0;const n=t.getAttribute("aria-activedescendant");return!!n&&n===e.id}function f(e){const t=(0,r.vY)(e);if(!t)return!1;if((0,r.r3)(e,t))return!0;const n=t.getAttribute("aria-activedescendant");return!!n&&"id"in e&&(n===e.id||!!e.querySelector(`#${CSS.escape(n)}`))}function g(e){!f(e)&&s(e)&&e.focus()}function m(e){var t;const n=null!=(t=e.getAttribute("tabindex"))?t:"";e.setAttribute("data-tabindex",n),e.setAttribute("tabindex","-1")}function y(e,t){c(e,t).forEach(m)}function v(e){const t=e.querySelectorAll("[data-tabindex]"),n=e=>{const t=e.getAttribute("data-tabindex");e.removeAttribute("data-tabindex"),t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")};e.hasAttribute("data-tabindex")&&n(e),t.forEach(n)}function A(e,t){"scrollIntoView"in e?(e.focus({preventScroll:!0}),e.scrollIntoView((0,i.ih)({block:"nearest",inline:"nearest"},t))):e.focus()}},98296:(e,t,n)=>{"use strict";n.d(t,{E:()=>l});var r=n(74018),i=n(20656),o=n(45010),s=n(70604),a=(0,o.Bi)((e=>{var t=e,{store:n}=t,o=(0,s.S0)(t,["store"]);const a=(0,i.h9)();return n=n||a,(0,r.E)((0,s.ih)({store:n},o))})),l=(0,o.W5)((e=>{const t=a(e);return(0,o.az)("button",t)}))},83222:(e,t,n)=>{"use strict";n.d(t,{S:()=>ve});var r=n(56278),i=n(59412),o=n(45010),s=n(48104),a=n(70604),l=n(2784),c=n(81548);function u(e){return e.split("-")[1]}function d(e){return"y"===e?"height":"width"}function h(e){return e.split("-")[0]}function p(e){return["top","bottom"].includes(h(e))?"x":"y"}function f(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,s=r.y+r.height/2-i.height/2,a=p(t),l=d(a),c=r[l]/2-i[l]/2,f="x"===a;let g;switch(h(t)){case"top":g={x:o,y:r.y-i.height};break;case"bottom":g={x:o,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:s};break;case"left":g={x:r.x-i.width,y:s};break;default:g={x:r.x,y:r.y}}switch(u(t)){case"start":g[a]-=c*(n&&f?-1:1);break;case"end":g[a]+=c*(n&&f?-1:1)}return g}const g=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=f(c,r,l),h=r,p={},g=0;for(let n=0;n<a.length;n++){const{name:o,fn:m}=a[n],{x:y,y:v,data:A,reset:b}=await m({x:u,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=y?y:u,d=null!=v?v:d,p={...p,[o]:{...p[o],...A}},b&&g<=50&&(g++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:e,floating:t,strategy:i}):b.rects),({x:u,y:d}=f(c,h,l))),n=-1)}return{x:u,y:d,placement:h,strategy:i,middlewareData:p}};function m(e,t){return"function"==typeof e?e(t):e}function y(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function v(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function A(e,t){var n;void 0===t&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=m(t,e),f=y(p),g=a[h?"floating"===d?"reference":"floating":d],A=v(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(g)))||n?g:g.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),b="floating"===d?{...s.floating,x:r,y:i}:s.reference,w=await(null==o.getOffsetParent?void 0:o.getOffsetParent(a.floating)),S=await(null==o.isElement?void 0:o.isElement(w))&&await(null==o.getScale?void 0:o.getScale(w))||{x:1,y:1},C=v(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:b,offsetParent:w,strategy:l}):b);return{top:(A.top-C.top+f.top)/S.y,bottom:(C.bottom-A.bottom+f.bottom)/S.y,left:(A.left-C.left+f.left)/S.x,right:(C.right-A.right+f.right)/S.x}}const b=Math.min,w=Math.max;function S(e,t,n){return w(e,b(t,n))}const C=(["top","right","bottom","left"].reduce(((e,t)=>e.concat(t,t+"-start",t+"-end")),[]),{left:"right",right:"left",bottom:"top",top:"bottom"});function E(e){return e.replace(/left|right|bottom|top/g,(e=>C[e]))}function I(e,t,n){void 0===n&&(n=!1);const r=u(e),i=p(e),o=d(i);let s="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=E(s)),{main:s,cross:E(s)}}const _={start:"end",end:"start"};function x(e){return e.replace(/start|end/g,(e=>_[e]))}function P(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function k(e){return P(e).getComputedStyle(e)}function B(e){return e instanceof P(e).Node}function O(e){return B(e)?(e.nodeName||"").toLowerCase():"#document"}function N(e){return e instanceof HTMLElement||e instanceof P(e).HTMLElement}function D(e){return"undefined"!=typeof ShadowRoot&&(e instanceof P(e).ShadowRoot||e instanceof ShadowRoot)}function j(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=k(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function T(e){return["table","td","th"].includes(O(e))}function M(e){const t=F(),n=k(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function F(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function R(e){return["html","body","#document"].includes(O(e))}const L=Math.min,Q=Math.max,U=Math.round,V=Math.floor,K=e=>({x:e,y:e});function H(e){const t=k(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=N(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=U(n)!==o||U(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function G(e){return e instanceof Element||e instanceof P(e).Element}function Y(e){return G(e)?e:e.contextElement}function z(e){const t=Y(e);if(!N(t))return K(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=H(t);let s=(o?U(n.width):n.width)/r,a=(o?U(n.height):n.height)/i;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const Z=K(0);function W(e){const t=P(e);return F()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Z}function q(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const i=e.getBoundingClientRect(),o=Y(e);let s=K(1);t&&(r?G(r)&&(s=z(r)):s=z(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==P(e))&&t}(o,n,r)?W(o):K(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,d=i.height/s.y;if(o){const e=P(o),t=r&&G(r)?P(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=z(n),t=n.getBoundingClientRect(),r=getComputedStyle(n),i=t.left+(n.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(n.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=o,n=P(n).frameElement}}return v({width:u,height:d,x:l,y:c})}function J(e){return G(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function X(e){var t;return null==(t=(B(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function $(e){return q(X(e)).left+J(e).scrollLeft}function ee(e){if("html"===O(e))return e;const t=e.assignedSlot||e.parentNode||D(e)&&e.host||X(e);return D(t)?t.host:t}function te(e){const t=ee(e);return R(t)?e.ownerDocument?e.ownerDocument.body:e.body:N(t)&&j(t)?t:te(t)}function ne(e,t){var n;void 0===t&&(t=[]);const r=te(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=P(r);return i?t.concat(o,o.visualViewport||[],j(r)?r:[]):t.concat(r,ne(r))}function re(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=P(e),r=X(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const e=F();(!e||e&&"fixed"===t)&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=X(e),n=J(e),r=e.ownerDocument.body,i=Q(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Q(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+$(e);const a=-n.scrollTop;return"rtl"===k(r).direction&&(s+=Q(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}(X(e));else if(G(t))r=function(e,t){const n=q(e,!0,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=N(e)?z(e):K(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:i*o.x,y:r*o.y}}(t,n);else{const n=W(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return v(r)}function ie(e,t){const n=ee(e);return!(n===t||!G(n)||R(n))&&("fixed"===k(n).position||ie(n,t))}function oe(e,t,n){const r=N(t),i=X(t),o="fixed"===n,s=q(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=K(0);if(r||!r&&!o)if(("body"!==O(t)||j(i))&&(a=J(t)),N(t)){const e=q(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else i&&(l.x=$(i));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function se(e,t){return N(e)&&"fixed"!==k(e).position?t?t(e):e.offsetParent:null}function ae(e,t){const n=P(e);if(!N(e))return n;let r=se(e,t);for(;r&&T(r)&&"static"===k(r).position;)r=se(r,t);return r&&("html"===O(r)||"body"===O(r)&&"static"===k(r).position&&!M(r))?n:r||function(e){let t=ee(e);for(;N(t)&&!R(t);){if(M(t))return t;t=ee(t)}return null}(e)||n}const le={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=N(n),o=X(n);if(n===o)return t;let s={scrollLeft:0,scrollTop:0},a=K(1);const l=K(0);if((i||!i&&"fixed"!==r)&&(("body"!==O(n)||j(o))&&(s=J(n)),N(n))){const e=q(n);a=z(n),l.x=e.x+n.clientLeft,l.y=e.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+l.x,y:t.y*a.y-s.scrollTop*a.y+l.y}},getDocumentElement:X,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[..."clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=ne(e).filter((e=>G(e)&&"body"!==O(e))),i=null;const o="fixed"===k(e).position;let s=o?ee(e):e;for(;G(s)&&!R(s);){const t=k(s),n=M(s);n||"fixed"!==t.position||(i=null),(o?!n&&!i:!n&&"static"===t.position&&i&&["absolute","fixed"].includes(i.position)||j(s)&&!n&&ie(e,s))?r=r.filter((e=>e!==s)):i=t,s=ee(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=o[0],a=o.reduce(((e,n)=>{const r=re(t,n,i);return e.top=Q(r.top,e.top),e.right=L(r.right,e.right),e.bottom=L(r.bottom,e.bottom),e.left=Q(r.left,e.left),e}),re(t,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:ae,getElementRects:async function(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||ae,o=this.getDimensions;return{reference:oe(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){return H(e)},getScale:z,isElement:G,isRTL:function(e){return"rtl"===getComputedStyle(e).direction}};var ce=n(52322);function ue(e=0,t=0,n=0,r=0){if("function"==typeof DOMRect)return new DOMRect(e,t,n,r);const i={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return(0,a.EZ)((0,a.ih)({},i),{toJSON:()=>i})}function de(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}function he(e){const t=window.devicePixelRatio||1;return Math.round(e*t)/t}function pe(e,t){return function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await async function(e,t){const{placement:n,platform:r,elements:i}=e,o=await(null==r.isRTL?void 0:r.isRTL(i.floating)),s=h(n),a=u(n),l="x"===p(n),c=["left","top"].includes(s)?-1:1,d=o&&l?-1:1,f=m(t,e);let{mainAxis:g,crossAxis:y,alignmentAxis:v}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&"number"==typeof v&&(y="end"===a?-1*v:v),l?{x:y*d,y:g*c}:{x:g*c,y:y*d}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}}((({placement:n})=>{var r;const i=((null==e?void 0:e.clientHeight)||0)/2,o="number"==typeof t.gutter?t.gutter+i:null!=(r=t.gutter)?r:i;return{crossAxis:n.split("-")[1]?void 0:t.shift,mainAxis:o,alignmentAxis:t.shift}}))}function fe(e){if(!1===e.flip)return;const t="string"==typeof e.flip?e.flip.split(" "):void 0;return(0,c.kG)(!t||t.every(de),!1),function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:s,platform:a,elements:l}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...v}=m(e,t),b=h(r),w=h(s)===s,S=await(null==a.isRTL?void 0:a.isRTL(l.floating)),C=p||(w||!y?[E(s)]:function(e){const t=E(e);return[x(e),t,x(t)]}(s));p||"none"===g||C.push(...function(e,t,n,r){const i=u(e);let o=function(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:s;default:return[]}}(h(e),"start"===n,r);return i&&(o=o.map((e=>e+"-"+i)),t&&(o=o.concat(o.map(x)))),o}(s,y,g,S));const _=[s,...C],P=await A(t,v),k=[];let B=(null==(n=i.flip)?void 0:n.overflows)||[];if(c&&k.push(P[b]),d){const{main:e,cross:t}=I(r,o,S);k.push(P[e],P[t])}if(B=[...B,{placement:r,overflows:k}],!k.every((e=>e<=0))){var O,N;const e=((null==(O=i.flip)?void 0:O.index)||0)+1,t=_[e];if(t)return{data:{index:e,overflows:B},reset:{placement:t}};let n=null==(N=B.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:N.placement;if(!n)switch(f){case"bestFit":{var D;const e=null==(D=B.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:D[0];e&&(n=e);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}}({padding:e.overflowPadding,fallbackPlacements:t})}function ge(e){if(e.slide||e.overlap)return function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=m(e,t),c={x:n,y:r},u=await A(t,l),d=p(h(i)),f=function(e){return"x"===e?"y":"x"}(d);let g=c[d],y=c[f];if(o){const e="y"===d?"bottom":"right";g=S(g+u["y"===d?"top":"left"],g,g-u[e])}if(s){const e="y"===f?"bottom":"right";y=S(y+u["y"===f?"top":"left"],y,y-u[e])}const v=a.fn({...t,[d]:g,[f]:y});return{...v,data:{x:v.x-n,y:v.y-r}}}}}({mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding})}function me(e){return function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:o}=t,{apply:s=(()=>{}),...a}=m(e,t),l=await A(t,a),c=h(n),d=u(n),f="x"===p(n),{width:g,height:y}=r.floating;let v,S;"top"===c||"bottom"===c?(v=c,S=d===(await(null==i.isRTL?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(S=c,v="end"===d?"top":"bottom");const C=y-l[v],E=g-l[S],I=!t.middlewareData.shift;let _=C,x=E;if(f){const e=g-l.left-l.right;x=d||I?b(E,e):e}else{const e=y-l.top-l.bottom;_=d||I?b(C,e):e}if(I&&!d){const e=w(l.left,0),t=w(l.right,0),n=w(l.top,0),r=w(l.bottom,0);f?x=g-2*(0!==e||0!==t?e+t:w(l.left,l.right)):_=y-2*(0!==n||0!==r?n+r:w(l.top,l.bottom))}await s({...t,availableWidth:x,availableHeight:_});const P=await i.getDimensions(o.floating);return g!==P.width||y!==P.height?{reset:{rects:!0}}:{}}}}({padding:e.overflowPadding,apply({elements:t,availableWidth:n,availableHeight:r,rects:i}){const o=t.floating,s=Math.round(i.reference.width);n=Math.floor(n),r=Math.floor(r),o.style.setProperty("--popover-anchor-width",`${s}px`),o.style.setProperty("--popover-available-width",`${n}px`),o.style.setProperty("--popover-available-height",`${r}px`),e.sameWidth&&(o.style.width=`${s}px`),e.fitViewport&&(o.style.maxWidth=`${n}px`,o.style.maxHeight=`${r}px`)}})}function ye(e,t){if(e)return(e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a}=t,{element:l,padding:c=0}=m(e,t)||{};if(null==l)return{};const h=y(c),f={x:n,y:r},g=p(i),v=d(g),A=await s.getDimensions(l),w="y"===g,C=w?"top":"left",E=w?"bottom":"right",I=w?"clientHeight":"clientWidth",_=o.reference[v]+o.reference[g]-f[g]-o.floating[v],x=f[g]-o.reference[g],P=await(null==s.getOffsetParent?void 0:s.getOffsetParent(l));let k=P?P[I]:0;k&&await(null==s.isElement?void 0:s.isElement(P))||(k=a.floating[I]||o.floating[v]);const B=_/2-x/2,O=k/2-A[v]/2-1,N=b(h[C],O),D=b(h[E],O),j=N,T=k-A[v]-D,M=k/2-A[v]/2+B,F=S(j,M,T),R=null!=u(i)&&M!=F&&o.reference[v]/2-(M<j?N:D)-A[v]/2<0?M<j?j-M:T-M:0;return{[g]:f[g]-R,data:{[g]:F,centerOffset:M-F+R}}}}))({element:e,padding:t.arrowPadding})}var ve=(0,o.Bi)((e=>{var t=e,{store:n,modal:o=!1,portal:u=!!o,preserveTabOrder:d=!0,autoFocusOnShow:h=!0,wrapperProps:p,fixed:f=!1,flip:m=!0,shift:y=0,slide:v=!0,overlap:A=!1,sameWidth:b=!1,fitViewport:w=!1,gutter:S,arrowPadding:C=4,overflowPadding:E=8,getAnchorRect:I,updatePosition:_}=t,x=(0,a.S0)(t,["store","modal","portal","preserveTabOrder","autoFocusOnShow","wrapperProps","fixed","flip","shift","slide","overlap","sameWidth","fitViewport","gutter","arrowPadding","overflowPadding","getAnchorRect","updatePosition"]);const P=(0,i.yL)();n=n||P,(0,c.kG)(n,!1);const k=n.useState("arrowElement"),B=n.useState("anchorElement"),O=n.useState("disclosureElement"),N=n.useState("popoverElement"),D=n.useState("contentElement"),j=n.useState("placement"),T=n.useState("mounted"),M=n.useState("rendered"),[F,R]=(0,l.useState)(!1),{portalRef:U,domReady:K}=(0,s.Hw)(u,x.portalRef),H=(0,s.zX)(I),G=(0,s.zX)(_),z=!!_;(0,s.Gw)((()=>{if(!(null==N?void 0:N.isConnected))return;N.style.setProperty("--popover-overflow-padding",`${E}px`);const e=function(e,t){return{contextElement:e||void 0,getBoundingClientRect:()=>{const n=e,r=null==t?void 0:t(n);return r||!n?function(e){if(!e)return ue();const{x:t,y:n,width:r,height:i}=e;return ue(t,n,r,i)}(r):n.getBoundingClientRect()}}}(B,H),t=async()=>{if(!T)return;const t=[pe(k,{gutter:S,shift:y}),fe({flip:m,overflowPadding:E}),ge({slide:v,overlap:A,overflowPadding:E}),ye(k,{arrowPadding:C}),me({sameWidth:b,fitViewport:w,overflowPadding:E})],r=await((e,t,n)=>{const r=new Map,i={platform:le,...n},o={...i.platform,_c:r};return g(e,t,{...i,platform:o})})(e,N,{placement:j,strategy:f?"fixed":"absolute",middleware:t});null==n||n.setState("currentPlacement",r.placement),R(!0);const i=he(r.x),o=he(r.y);if(Object.assign(N.style,{top:"0",left:"0",transform:`translate3d(${i}px,${o}px,0)`}),k&&r.middlewareData.arrow){const{x:e,y:t}=r.middlewareData.arrow,n=r.placement.split("-")[0];Object.assign(k.style,{left:null!=e?`${e}px`:"",top:null!=t?`${t}px`:"",[n]:"100%"})}},r=function(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=Y(e),u=i||o?[...c?ne(c):[],...ne(t)]:[];u.forEach((e=>{i&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const i=X(e);function o(){clearTimeout(n),r&&r.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),o();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const p={rootMargin:-V(u)+"px "+-V(i.clientWidth-(c+d))+"px "+-V(i.clientHeight-(u+h))+"px "+-V(c)+"px",threshold:Q(0,L(1,l))||1};let f=!0;function g(e){const t=e[0].intersectionRatio;if(t!==l){if(!f)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),100)}f=!1}try{r=new IntersectionObserver(g,{...p,root:i.ownerDocument})}catch(e){r=new IntersectionObserver(g,p)}r.observe(e)}(!0),o}(c,n):null;let h,p=-1,f=null;s&&(f=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{f&&f.observe(t)}))),n()})),c&&!l&&f.observe(c),f.observe(t));let g=l?q(e):null;return l&&function t(){const r=q(e);!g||r.x===g.x&&r.y===g.y&&r.width===g.width&&r.height===g.height||n(),g=r,h=requestAnimationFrame(t)}(),n(),()=>{u.forEach((e=>{i&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)})),d&&d(),f&&f.disconnect(),f=null,l&&cancelAnimationFrame(h)}}(e,N,(async()=>{z?(await G({updatePosition:t}),R(!0)):await t()}),{elementResize:"function"==typeof ResizeObserver});return()=>{R(!1),r()}}),[n,M,N,k,B,N,j,T,K,f,m,y,v,A,b,w,S,C,E,H,z,G]),(0,s.Gw)((()=>{if(!T)return;if(!K)return;if(!(null==N?void 0:N.isConnected))return;if(!(null==D?void 0:D.isConnected))return;const e=()=>{N.style.zIndex=getComputedStyle(D).zIndex};e();let t=requestAnimationFrame((()=>{t=requestAnimationFrame(e)}));return()=>cancelAnimationFrame(t)}),[T,K,N,D]);const Z=f?"fixed":"absolute";return x=(0,s.OJ)(x,(e=>(0,ce.jsx)("div",(0,a.EZ)((0,a.ih)({role:"presentation"},p),{style:(0,a.ih)({position:Z,top:0,left:0,width:"max-content"},null==p?void 0:p.style),ref:null==n?void 0:n.setPopoverElement,children:e}))),[n,Z,p]),x=(0,s.OJ)(x,(e=>(0,ce.jsx)(i.ZQ,{value:n,children:e})),[n]),x=(0,a.EZ)((0,a.ih)({"data-placing":F?void 0:""},x),{style:(0,a.ih)({position:"relative"},x.style)}),(0,r.Rh)((0,a.EZ)((0,a.ih)({store:n,modal:o,portal:u,preserveTabOrder:d,preserveTabOrderAnchor:O||B,autoFocusOnShow:F&&h},x),{portalRef:U}))}));(0,r.L5)((0,o.LM)((e=>{const t=ve(e);return(0,o.az)("div",t)})),i.yL)},45010:(e,t,n)=>{"use strict";n.d(t,{Bi:()=>h,LM:()=>c,W5:()=>u,az:()=>d,re:()=>p});var r=n(48104),i=n(43198),o=n(70604),s=n(2784),a=n(81548),l=n(52322);function c(e){return s.forwardRef(((t,n)=>e((0,o.ih)({ref:n},t))))}function u(e){const t=c(e);return s.memo(t)}function d(e,t){const n=t,{as:a,wrapElement:c,render:u}=n,d=(0,o.S0)(n,["as","wrapElement","render"]);let h;const p=(0,r.qq)(t.ref,(0,i.Yx)(u));if(a&&"string"!=typeof a)h=(0,l.jsx)(a,(0,o.EZ)((0,o.ih)({},d),{render:u}));else if(s.isValidElement(u)){const e=(0,o.EZ)((0,o.ih)({},u.props),{ref:p});h=s.cloneElement(u,(0,i.dG)(d,e))}else if(u)h=u(d);else if("function"==typeof t.children){const e=d,{children:n}=e,r=(0,o.S0)(e,["children"]);h=t.children(r)}else h=a?(0,l.jsx)(a,(0,o.ih)({},d)):(0,l.jsx)(e,(0,o.ih)({},d));return c?c(h):h}function h(e){return(t={})=>{const n=e(t),r={};for(const e in n)(0,a.nr)(n,e)&&void 0!==n[e]&&(r[e]=n[e]);return r}}function p(e=[],t=[]){const n=s.createContext(void 0),r=s.createContext(void 0),i=()=>s.useContext(n),a=t=>e.reduceRight(((e,n)=>(0,l.jsx)(n,(0,o.EZ)((0,o.ih)({},t),{children:e}))),(0,l.jsx)(n.Provider,(0,o.ih)({},t)));return{context:n,scopedContext:r,useContext:i,useScopedContext:(e=!1)=>{const t=s.useContext(r),n=i();return e?t:t||n},useProviderContext:()=>{const e=s.useContext(r),t=i();if(!e||e!==t)return t},ContextProvider:a,ScopedContextProvider:e=>(0,l.jsx)(a,(0,o.EZ)((0,o.ih)({},e),{children:t.reduceRight(((t,n)=>(0,l.jsx)(n,(0,o.EZ)((0,o.ih)({},e),{children:t}))),(0,l.jsx)(r.Provider,(0,o.ih)({},e)))}))}}},6236:(e,t,n)=>{"use strict";n.d(t,{Kw:()=>d,XS:()=>h,oR:()=>p});var r=n(48104),i=n(70604),o=n(2784),s=n(81548),a=n(13277),l=n(43100),{useSyncExternalStore:c}=l,u=()=>()=>{};function d(e,t=s.yR){const n=o.useCallback((t=>e?(0,a.Ld)(e,null,t):u()),[e]),r=()=>{const n="string"==typeof t?t:null,r="function"==typeof t?t:null,i=null==e?void 0:e.getState();return r?r(i):i&&n&&(0,s.nr)(i,n)?i[n]:void 0};return c(n,r,r)}function h(e,t,n,i){const l=(0,s.nr)(t,n)?t[n]:void 0,c=i?t[i]:void 0,u=(0,r.cP)({value:l,setValue:c}),d=o.useRef(!0);(0,r.Gw)((()=>(0,a.Z_)(e,[n],((e,t)=>{const{value:r,setValue:i}=u.current;i&&e[n]!==t[n]&&e[n]!==r&&(d.current=!1,i(e[n]))}))),[e,n]),(0,r.Gw)((()=>{if(void 0!==l)return d.current=!0,e.setState(n,l),(0,a.dC)(e,[n],(()=>{void 0!==l&&d.current&&e.setState(n,l)}))}))}function p(e,t){const[n,s]=o.useState((()=>e(t)));(0,r.Gw)((()=>(0,a.S1)(n)),[n]);const l=o.useCallback((e=>d(n,e)),[n]);return[o.useMemo((()=>(0,i.EZ)((0,i.ih)({},n),{useState:l})),[n,l]),(0,r.zX)((()=>{s((n=>e((0,i.ih)((0,i.ih)({},t),n.getState()))))}))]}},70604:(e,t,n)=>{"use strict";n.d(t,{EZ:()=>d,S0:()=>h,ih:()=>u});var r=Object.defineProperty,i=Object.defineProperties,o=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,c=(e,t,n)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,u=(e,t)=>{for(var n in t||(t={}))a.call(t,n)&&c(e,n,t[n]);if(s)for(var n of s(t))l.call(t,n)&&c(e,n,t[n]);return e},d=(e,t)=>i(e,o(t)),h=(e,t)=>{var n={};for(var r in e)a.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&s)for(var r of s(e))t.indexOf(r)<0&&l.call(e,r)&&(n[r]=e[r]);return n}},75235:(e,t,n)=>{"use strict";n.d(t,{L3:()=>o,MI:()=>s,dI:()=>i});var r=(0,n(45010).re)(),i=r.useContext,o=(r.useScopedContext,r.useProviderContext,r.ContextProvider),s=r.ScopedContextProvider},9460:(e,t,n)=>{"use strict";n.d(t,{EB:()=>c,TG:()=>l,bq:()=>h,ht:()=>u,jC:()=>d});var r=n(9587),i=n(59412),o=n(45010),s=n(2784),a=(0,o.re)([i.qo,r.Lq],[i.ZQ,r.al]),l=a.useContext,c=a.useScopedContext,u=a.useProviderContext,d=(a.ContextProvider,a.ScopedContextProvider),h=(0,s.createContext)(!1)},57189:(e,t,n)=>{"use strict";n.d(t,{X:()=>y});var r=n(45010),i=(0,r.re)(),o=i.useContext,s=(i.useScopedContext,i.useProviderContext,i.ContextProvider,i.ScopedContextProvider,n(2784)),a=(0,s.createContext)(!1),l=n(13271),c=n(6236),u=n(48104),d=n(70604),h=n(81548),p=n(52322);function f(e,t){t?e.indeterminate=!0:e.indeterminate&&(e.indeterminate=!1)}function g(e){return Array.isArray(e)?e.toString():e}var m=(0,r.Bi)((e=>{var t=e,{store:n,name:r,value:i,checked:m,defaultChecked:y}=t,v=(0,d.S0)(t,["store","name","value","checked","defaultChecked"]);const A=o();n=n||A;const[b,w]=(0,s.useState)(null!=y&&y),S=(0,c.Kw)(n,(e=>{if(void 0!==m)return m;if(void 0===(null==e?void 0:e.value))return b;if(null!=i){if(Array.isArray(e.value)){const t=g(i);return e.value.includes(t)}return e.value===i}return!Array.isArray(e.value)&&"boolean"==typeof e.value&&e.value})),C=(0,s.useRef)(null),E=(B=(0,u.O)(C,v.as||"input"),O=v.type,"input"===B&&(!O||"checkbox"===O)),I=S?"mixed"===S:void 0,_="mixed"!==S&&S,x=(0,h.EE)(v),[P,k]=(0,u.NW)();var B,O;(0,s.useEffect)((()=>{const e=C.current;e&&(f(e,I),E||(e.checked=_,void 0!==r&&(e.name=r),void 0!==i&&(e.value=`${i}`)))}),[P,I,E,_,r,i]);const N=v.onChange,D=(0,u.zX)((e=>{if(x)return e.stopPropagation(),void e.preventDefault();if(f(e.currentTarget,I),E||(e.currentTarget.checked=!e.currentTarget.checked,k()),null==N||N(e),e.defaultPrevented)return;const t=e.currentTarget.checked;w(t),null==n||n.setValue((e=>{if(null==i)return t;const n=g(i);return Array.isArray(e)?t?e.includes(n)?e:[...e,n]:e.filter((e=>e!==n)):e!==n&&n}))})),j=v.onClick,T=(0,u.zX)((e=>{null==j||j(e),e.defaultPrevented||E||D(e)}));return v=(0,u.OJ)(v,(e=>(0,p.jsx)(a.Provider,{value:_,children:e})),[_]),v=(0,d.EZ)((0,d.ih)({role:E?void 0:"checkbox",type:E?"checkbox":void 0,"aria-checked":S},v),{ref:(0,u.qq)(C,v.ref),onChange:D,onClick:T}),v=(0,l.Y)((0,d.ih)({clickOnEnter:!E},v)),(0,d.ih)({name:E?r:void 0,value:E?i:void 0,checked:_},v)})),y=(0,r.LM)((e=>{const t=m(e);return(0,r.az)("input",t)}))},48104:(e,t,n)=>{"use strict";var r;n.d(t,{Gw:()=>h,Hw:()=>E,Me:()=>m,NW:()=>w,O:()=>y,OJ:()=>C,XJ:()=>I,cP:()=>p,is:()=>b,m1:()=>_,qq:()=>g,rf:()=>A,vv:()=>v,yl:()=>S,zX:()=>f});var i=n(43198),o=n(70604),s=n(2784),a=n(10244),l=n(99224),c=(0,o.ih)({},r||(r=n.t(s,2))),u=c.useId,d=(c.useDeferredValue,c.useInsertionEffect),h=a.Nq?s.useLayoutEffect:s.useEffect;function p(e){const t=(0,s.useRef)(e);return h((()=>{t.current=e})),t}function f(e){const t=(0,s.useRef)((()=>{throw new Error("Cannot call an event handler while rendering.")}));return d?d((()=>{t.current=e})):t.current=e,(0,s.useCallback)(((...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)}),[])}function g(...e){return(0,s.useMemo)((()=>{if(e.some(Boolean))return t=>{e.forEach((e=>(0,i.k$)(e,t)))}}),e)}function m(e){if(u){const t=u();return e||t}const[t,n]=(0,s.useState)(e);return h((()=>{if(e||t)return;const r=Math.random().toString(36).substr(2,6);n(`id-${r}`)}),[e,t]),e||t}function y(e,t){const n=e=>{if("string"==typeof e)return e},[r,i]=(0,s.useState)((()=>n(t)));return h((()=>{const r=e&&"current"in e?e.current:e;i((null==r?void 0:r.tagName.toLowerCase())||n(t))}),[e,t]),r}function v(e,t,n){const[r,i]=(0,s.useState)(n);return h((()=>{const n=e&&"current"in e?e.current:e,r=null==n?void 0:n.getAttribute(t);null!=r&&i(r)}),[e,t]),r}function A(e,t){const n=(0,s.useRef)(!1);(0,s.useEffect)((()=>{if(n.current)return e();n.current=!0}),t),(0,s.useEffect)((()=>()=>{n.current=!1}),[])}function b(e,t){const n=(0,s.useRef)(!1);h((()=>{if(n.current)return e();n.current=!0}),t),h((()=>()=>{n.current=!1}),[])}function w(){return(0,s.useReducer)((()=>[]),[])}function S(e){return f("function"==typeof e?e:()=>e)}function C(e,t,n=[]){const r=(0,s.useCallback)((n=>(e.wrapElement&&(n=e.wrapElement(n)),t(n))),[...n,e.wrapElement]);return(0,o.EZ)((0,o.ih)({},e),{wrapElement:r})}function E(e=!1,t){const[n,r]=(0,s.useState)(null);return{portalRef:g(r,t),portalNode:n,domReady:!e||n}}function I(e,t,n){const r=e.onLoadedMetadataCapture,i=(0,s.useMemo)((()=>Object.assign((()=>{}),(0,o.EZ)((0,o.ih)({},r),{[t]:n}))),[r,t,n]);return[null==r?void 0:r[t],{onLoadedMetadataCapture:i}]}function _(){return(0,s.useEffect)((()=>{(0,l.iN)("mousemove",B,!0),(0,l.iN)("mousedown",O,!0),(0,l.iN)("mouseup",O,!0),(0,l.iN)("keydown",O,!0),(0,l.iN)("scroll",O,!0)}),[]),f((()=>x))}Symbol("setNextState");var x=!1,P=0,k=0;function B(e){(function(e){const t=e.movementX||e.screenX-P,n=e.movementY||e.screenY-k;return P=e.screenX,k=e.screenY,t||n||!1})(e)&&(x=!0)}function O(){x=!1}},79225:(e,t,n)=>{"use strict";n.d(t,{$3:()=>i,D2:()=>s,Gh:()=>d,JW:()=>u,al:()=>a,tt:()=>c,zS:()=>o});var r={id:null};function i(e,t,n=!1){const i=e.findIndex((e=>e.id===t));return[...e.slice(i+1),...n?[r]:[],...e.slice(0,i)]}function o(e,t){return e.find((e=>t?!e.disabled&&e.id!==t:!e.disabled))}function s(e,t){return t&&e.item(t)||null}function a(e){const t=[];for(const n of e){const e=t.find((e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===n.rowId}));e?e.push(n):t.push([n])}return t}var l=Symbol("FOCUS_SILENTLY");function c(e){e[l]=!0,e.focus()}function u(e){const t=e[l];return delete e[l],t}function d(e,t,n){if(!t)return!1;if(t===n)return!1;const r=e.item(t.id);return!(!r||n&&r.element===n)}},72455:(e,t,n)=>{"use strict";n.d(t,{I:()=>a,l:()=>s});var r=n(22457),i=n(6236),o=n(30925);function s(e,t,n){return(0,r.n)(e,t,n)}function a(e={}){const[t,n]=(0,i.oR)(o.n,e);return s(t,n,e)}},59412:(e,t,n)=>{"use strict";n.d(t,{ZQ:()=>l,lp:()=>o,qo:()=>a,yL:()=>s});var r=n(58915),i=(0,n(45010).re)([r.re],[r.Q9]),o=i.useContext,s=(i.useScopedContext,i.useProviderContext),a=i.ContextProvider,l=i.ScopedContextProvider},89723:(e,t,n)=>{"use strict";n.d(t,{S:()=>d,w:()=>h});var r=n(19922),i=n(43670),o=n(45010),s=n(48104),a=n(70604),l=n(2784),c=n(99224),u=n(81548),d=(0,o.Bi)((e=>{var t=e,{store:n,showOnHover:o=!0}=t,d=(0,a.S0)(t,["store","showOnHover"]);const h=(0,r.P9)();n=n||h,(0,u.kG)(n,!1);const p=(0,u.EE)(d),f=(0,l.useRef)(0);(0,l.useEffect)((()=>()=>window.clearTimeout(f.current)),[]),(0,l.useEffect)((()=>(0,c.iN)("mouseleave",(e=>{if(!n)return;const{anchorElement:t}=n.getState();t&&e.target===t&&(window.clearTimeout(f.current),f.current=0)}),!0)),[n]);const g=d.onMouseMove,m=(0,s.yl)(o),y=(0,s.m1)(),v=(0,s.zX)((e=>{if(null==g||g(e),p)return;if(!n)return;if(e.defaultPrevented)return;if(f.current)return;if(!y())return;if(!m(e))return;const t=e.currentTarget;n.setAnchorElement(t),n.setDisclosureElement(t);const{showTimeout:r,timeout:i}=n.getState(),o=()=>{f.current=0,y()&&(null==n||n.setAnchorElement(t),null==n||n.show(),queueMicrotask((()=>{null==n||n.setDisclosureElement(t)})))},s=null!=r?r:i;0===s?o():f.current=window.setTimeout(o,s)})),A=(0,l.useCallback)((e=>{if(!n)return;const{anchorElement:t}=n.getState();(null==t?void 0:t.isConnected)||n.setAnchorElement(e)}),[n]);return d=(0,a.EZ)((0,a.ih)({},d),{ref:(0,s.qq)(A,d.ref),onMouseMove:v}),(0,i.k)(d)})),h=(0,o.LM)((e=>{const t=d(e);return(0,o.az)("a",t)}))},12216:(e,t,n)=>{"use strict";n.d(t,{M:()=>s,z:()=>a});var r=n(93892),i=n(6236),o=n(97254);function s(e,t,n){return e=(0,r.k)(e,t,n),(0,i.XS)(e,n,"timeout"),(0,i.XS)(e,n,"showTimeout"),(0,i.XS)(e,n,"hideTimeout"),e}function a(e={}){const[t,n]=(0,i.oR)(o.A,e);return s(t,n,e)}},46462:(e,t,n)=>{"use strict";n.d(t,{b:()=>o});var r=n(6236),i=n(48104);function o(e,t,n){return e=function(e,t,n){return(0,i.rf)(t,[n.store]),(0,r.XS)(e,n,"items","setItems"),e}(e,t,n),(0,r.XS)(e,n,"activeId","setActiveId"),(0,r.XS)(e,n,"includesBaseElement"),(0,r.XS)(e,n,"virtualFocus"),(0,r.XS)(e,n,"orientation"),(0,r.XS)(e,n,"rtl"),(0,r.XS)(e,n,"focusLoop"),(0,r.XS)(e,n,"focusWrap"),(0,r.XS)(e,n,"focusShift"),e}},96332:(e,t,n)=>{"use strict";n.d(t,{S:()=>o,T:()=>s});var r=n(45010),i=n(70604),o=(0,r.Bi)((e=>(0,i.EZ)((0,i.ih)({},e),{style:(0,i.ih)({border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},e.style)}))),s=(0,r.LM)((e=>{const t=o(e);return(0,r.az)("span",t)}))},89776:(e,t,n)=>{"use strict";n.d(t,{p:()=>f,q:()=>p});var r=n(13271),i=n(45010),o=n(48104),s=n(70604),a=n(2784),l=n(10244),c=(0,i.Bi)((e=>{const t=(0,a.useRef)(null),n=(0,o.O)(t,e.as||"button"),[i,c]=(0,a.useState)((()=>!!n&&(0,l.iK)({tagName:n,type:e.type})));return(0,a.useEffect)((()=>{t.current&&c((0,l.iK)(t.current))}),[]),e=(0,s.EZ)((0,s.ih)({role:i||"a"===n?void 0:"button"},e),{ref:(0,o.qq)(t,e.ref)}),e=(0,r.Y)(e)}));(0,i.LM)((e=>{const t=c(e);return(0,i.az)("button",t)}));var u=n(75126),d=n(81548),h=Symbol("disclosure"),p=(0,i.Bi)((e=>{var t=e,{store:n,toggleOnClick:r=!0}=t,i=(0,s.S0)(t,["store","toggleOnClick"]);const l=(0,u.eR)();n=n||l,(0,d.kG)(n,!1);const p=(0,a.useRef)(null),[f,g]=(0,a.useState)(!1),m=n.useState("disclosureElement"),y=n.useState("open");(0,a.useEffect)((()=>{let e=m===p.current;(null==m?void 0:m.isConnected)||(null==n||n.setDisclosureElement(p.current),e=!0),g(y&&e)}),[m,n,y]);const v=i.onClick,A=(0,o.yl)(r),[b,w]=(0,o.XJ)(i,h,!0),S=(0,o.zX)((e=>{null==v||v(e),e.defaultPrevented||b||A(e)&&(null==n||n.setDisclosureElement(e.currentTarget),null==n||n.toggle())})),C=n.useState("contentElement");return i=(0,s.EZ)((0,s.ih)((0,s.ih)({"aria-expanded":f,"aria-controls":null==C?void 0:C.id},w),i),{ref:(0,o.qq)(p,i.ref),onClick:S}),c(i)})),f=(0,i.LM)((e=>{const t=p(e);return(0,i.az)("button",t)}))},54425:(e,t,n)=>{"use strict";n.d(t,{I:()=>m});var r=n(73026),i=n(46462),o=n(93892),s=n(6236),a=n(48104),l=n(70604),c=n(41410),u=n(14191),d=n(13277),h=n(81548),p=n(23478),f=n(40077);function g(e={}){var t=e,{combobox:n}=t,r=(0,f.S0)(t,["combobox"]);const i=(0,d.yt)(r.store,(0,d.CE)(n,["value","items","renderedItems","baseElement","arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"]));(0,d.Ny)(r,i);const o=i.getState(),s=(0,u.t)((0,f.EZ)((0,f.ih)({},r),{store:i,virtualFocus:(0,h.LS)(r.virtualFocus,o.virtualFocus,!0),includesBaseElement:(0,h.LS)(r.includesBaseElement,o.includesBaseElement,!1),activeId:(0,h.LS)(r.activeId,o.activeId,r.defaultActiveId,null),orientation:(0,h.LS)(r.orientation,o.orientation,"vertical")})),a=(0,c.e)((0,f.EZ)((0,f.ih)({},r),{store:i,placement:(0,h.LS)(r.placement,o.placement,"bottom-start")})),l=new String(""),g=(0,f.EZ)((0,f.ih)((0,f.ih)({},s.getState()),a.getState()),{value:(0,h.LS)(r.value,o.value,r.defaultValue,l),setValueOnMove:(0,h.LS)(r.setValueOnMove,o.setValueOnMove,!1),selectElement:(0,h.LS)(o.selectElement,null),labelElement:(0,h.LS)(o.labelElement,null)}),m=(0,d.MT)(g,s,a,i);return(0,d.cY)(m,(()=>(0,d.Z_)(m,["value","items"],(e=>{if(e.value!==l)return;if(!e.items.length)return;const t=e.items.find((e=>!e.disabled&&null!=e.value));null!=(null==t?void 0:t.value)&&m.setState("value",t.value)})))),(0,d.cY)(m,(()=>(0,d.Z_)(m,["mounted","items","value"],(e=>{if(n)return;if(e.mounted)return;const t=(0,p.qo)(e.value),r=t[t.length-1];if(null==r)return;const i=e.items.find((e=>!e.disabled&&e.value===r));i&&m.setState("activeId",i.id)})))),(0,d.cY)(m,(()=>(0,d.dC)(m,["setValueOnMove","moves"],(e=>{const{mounted:t,value:n,activeId:r}=m.getState();if(!e.setValueOnMove&&t)return;if(Array.isArray(n))return;if(!e.moves)return;if(!r)return;const i=s.item(r);i&&!i.disabled&&null!=i.value&&m.setState("value",i.value)})))),(0,f.EZ)((0,f.ih)((0,f.ih)((0,f.ih)({},s),a),m),{combobox:n,setValue:e=>m.setState("value",e),setSelectElement:e=>m.setState("selectElement",e),setLabelElement:e=>m.setState("labelElement",e)})}function m(e={}){const t=(0,r.Vo)();e=(0,l.EZ)((0,l.ih)({},e),{combobox:void 0!==e.combobox?e.combobox:t});const[n,c]=(0,s.oR)(g,e);return function(e,t,n){return(0,a.rf)(t,[n.combobox]),e=(0,i.b)(e,t,n),e=(0,o.k)(e,t,n),(0,s.XS)(e,n,"value","setValue"),(0,s.XS)(e,n,"setValueOnMove"),Object.assign(e,{combobox:n.combobox})}(n,c,e)}},93892:(e,t,n)=>{"use strict";n.d(t,{k:()=>s});var r=n(72455),i=n(6236),o=n(48104);function s(e,t,n){return(0,o.rf)(t,[n.popover]),e=(0,r.l)(e,t,n),(0,i.XS)(e,n,"placement"),e}},23978:(e,t,n)=>{"use strict";n.d(t,{R:()=>f});var r=n(46462),i=n(93892),o=n(6236),s=n(41410),a=n(14191),l=n(13277),c=n(81548),u=n(29052),d=n(40077),h=(0,u.G6)()&&(0,u.b1)();function p(e={}){var t;(0,l.Ny)(e,e.store);const n=null==(t=e.store)?void 0:t.getState(),r=(0,c.LS)(e.activeId,null==n?void 0:n.activeId,e.defaultActiveId,null),i=(0,a.t)((0,d.EZ)((0,d.ih)({},e),{activeId:r,includesBaseElement:(0,c.LS)(e.includesBaseElement,null==n?void 0:n.includesBaseElement,!0),orientation:(0,c.LS)(e.orientation,null==n?void 0:n.orientation,"vertical"),focusLoop:(0,c.LS)(e.focusLoop,null==n?void 0:n.focusLoop,!0),focusWrap:(0,c.LS)(e.focusWrap,null==n?void 0:n.focusWrap,!0),virtualFocus:(0,c.LS)(e.virtualFocus,null==n?void 0:n.virtualFocus,!h)})),o=(0,s.e)((0,d.EZ)((0,d.ih)({},e),{placement:(0,c.LS)(e.placement,null==n?void 0:n.placement,"bottom-start")})),u=(0,c.LS)(e.value,null==n?void 0:n.value,e.defaultValue,""),p=(0,c.LS)(e.selectedValue,null==n?void 0:n.selectedValue,e.defaultSelectedValue,""),f=Array.isArray(p),g=(0,d.EZ)((0,d.ih)((0,d.ih)({},i.getState()),o.getState()),{value:u,selectedValue:p,resetValueOnSelect:(0,c.LS)(e.resetValueOnSelect,null==n?void 0:n.resetValueOnSelect,f),resetValueOnHide:(0,c.LS)(e.resetValueOnHide,null==n?void 0:n.resetValueOnHide,f),activeValue:null==n?void 0:n.activeValue}),m=(0,l.MT)(g,i,o,e.store);return(0,l.cY)(m,(()=>(0,l.Z_)(m,["resetValueOnHide","mounted"],(e=>{e.resetValueOnHide&&(e.mounted||m.setState("value",u))})))),(0,l.cY)(m,(()=>(0,l.Z_)(m,["resetValueOnSelect","selectedValue"],(e=>{e.resetValueOnSelect&&m.setState("value",u)})))),(0,l.cY)(m,(()=>(0,l.dC)(m,["mounted"],(e=>{e.mounted||(m.setState("activeId",r),m.setState("moves",0))})))),(0,l.cY)(m,(()=>(0,l.Z_)(m,["moves","activeId"],((e,t)=>{e.moves===t.moves&&m.setState("activeValue",void 0)})))),(0,l.cY)(m,(()=>(0,l.dC)(m,["moves","renderedItems"],((e,t)=>{if(e.moves===t.moves)return;const{activeId:n}=m.getState(),r=i.item(n);m.setState("activeValue",null==r?void 0:r.value)})))),(0,d.EZ)((0,d.ih)((0,d.ih)((0,d.ih)({},o),i),m),{setValue:e=>m.setState("value",e),setSelectedValue:e=>m.setState("selectedValue",e)})}function f(e={}){const[t,n]=(0,o.oR)(p,e);return function(e,t,n){return e=(0,i.k)(e,t,n),e=(0,r.b)(e,t,n),(0,o.XS)(e,n,"value","setValue"),(0,o.XS)(e,n,"selectedValue","setSelectedValue"),(0,o.XS)(e,n,"resetValueOnHide"),(0,o.XS)(e,n,"resetValueOnSelect"),e}(t,n,e)}},38346:(e,t,n)=>{"use strict";n.d(t,{Q:()=>v});var r=n(79225),i=n(9587),o=n(43670),s=n(45010),a=n(48104),l=n(70604),c=n(2784),u=n(23478),d=n(10244),h=n(99224),p=n(15212),f=n(81548),g=n(52322);function m(e){return e.some((e=>!!e.rowId))}function y(e,t,n){return(0,a.zX)((i=>{var o;if(null==t||t(i),i.defaultPrevented)return;const s=e.getState(),a=null==(o=(0,r.D2)(e,s.activeId))?void 0:o.element;if(!a)return;if(!function(e,t){if(!(0,h.Ud)(e))return!1;if(function(e){return"Shift"===e.key||"Control"===e.key||"Alt"===e.key||"Meta"===e.key}(e))return!1;const n=e.target;if(!n)return!0;if((0,d.eS)(n)){if(function(e){return 1===e.key.length&&!e.ctrlKey&&!e.metaKey}(e))return!1;const n=m(t.renderedItems),r=null===t.activeId,i=n&&!r,o="Home"===e.key||"End"===e.key;if(!i&&o)return!1}return!e.isPropagationStopped()}(i,s))return;const c=i,{view:u}=c,p=(0,l.S0)(c,["view"]);a!==(null==n?void 0:n.current)&&a.focus(),(0,h.nm)(a,i.type,p)||i.preventDefault(),i.currentTarget.contains(a)&&i.stopPropagation()}))}var v=(0,s.Bi)((e=>{var t=e,{store:n,composite:s=!0,focusOnMove:v=s,moveOnKeyPress:A=!0}=t,b=(0,l.S0)(t,["store","composite","focusOnMove","moveOnKeyPress"]);const w=(0,i.po)();n=n||w,(0,f.kG)(n,!1);const S=(0,c.useRef)(null),C=function(e){const[t,n]=(0,c.useState)(!1),i=(0,c.useCallback)((()=>n(!0)),[]),o=e.useState((t=>(0,r.D2)(e,t.activeId)));return(0,c.useEffect)((()=>{const e=null==o?void 0:o.element;t&&e&&(n(!1),e.focus({preventScroll:!0}))}),[o,t]),i}(n),E=n.useState("moves");(0,c.useEffect)((()=>{var e;if(!n)return;if(!E)return;if(!s)return;if(!v)return;const{activeId:t}=n.getState(),i=null==(e=(0,r.D2)(n,t))?void 0:e.element;i&&(0,p.PY)(i)}),[n,E,s,v]),(0,a.Gw)((()=>{if(!n)return;if(!E)return;if(!s)return;const{baseElement:e,activeId:t}=n.getState();if(null!==t)return;if(!e)return;const r=S.current;S.current=null,r&&(0,h.sE)(r,{relatedTarget:e}),(0,p.H1)(e)?(0,h.Vr)(e,{relatedTarget:r}):e.focus()}),[n,E,s]);const I=n.useState("activeId"),_=n.useState("virtualFocus");(0,a.Gw)((()=>{var e;if(!n)return;if(!s)return;if(!_)return;const t=S.current;if(S.current=null,!t)return;const i=(null==(e=(0,r.D2)(n,I))?void 0:e.element)||(0,d.vY)(t);(0,h.sE)(t,{relatedTarget:i})}),[n,I,_,s]);const x=y(n,b.onKeyDownCapture,S),P=y(n,b.onKeyUpCapture,S),k=b.onFocusCapture,B=(0,a.zX)((e=>{if(null==k||k(e),e.defaultPrevented)return;if(!n)return;const{virtualFocus:t}=n.getState();if(!t)return;const i=e.relatedTarget,o=(0,r.JW)(e.currentTarget);(0,h.Ud)(e)&&o&&(e.stopPropagation(),S.current=i)})),O=b.onFocus,N=(0,a.zX)((e=>{if(null==O||O(e),e.defaultPrevented)return;if(!s)return;if(!n)return;const{relatedTarget:t}=e,{virtualFocus:i}=n.getState();i?(0,h.Ud)(e)&&!(0,r.Gh)(n,t)&&queueMicrotask(C):(0,h.Ud)(e)&&n.setActiveId(null)})),D=b.onBlurCapture,j=(0,a.zX)((e=>{var t;if(null==D||D(e),e.defaultPrevented)return;if(!n)return;const{virtualFocus:i,activeId:o}=n.getState();if(!i)return;const s=null==(t=(0,r.D2)(n,o))?void 0:t.element,a=e.relatedTarget,l=(0,r.Gh)(n,a),c=S.current;S.current=null,(0,h.Ud)(e)&&l?(a===s?c&&c!==a&&(0,h.sE)(c,e):s&&(0,h.sE)(s,e),e.stopPropagation()):!(0,r.Gh)(n,e.target)&&s&&(0,h.sE)(s,e)})),T=b.onKeyDown,M=(0,a.yl)(A),F=(0,a.zX)((e=>{var t;if(null==T||T(e),e.defaultPrevented)return;if(!n)return;if(!(0,h.Ud)(e))return;const{orientation:i,items:o,renderedItems:s,activeId:a}=n.getState(),l=(0,r.D2)(n,a);if(null==(t=null==l?void 0:l.element)?void 0:t.isConnected)return;const c="horizontal"!==i,d="vertical"!==i,p=m(s),f={ArrowUp:(p||c)&&(()=>{if(p){const e=o&&function(e){return(0,r.zS)((0,u.JH)((0,u.GP)((0,r.al)(e))))}(o);return null==e?void 0:e.id}return null==n?void 0:n.last()}),ArrowRight:(p||d)&&n.first,ArrowDown:(p||c)&&n.first,ArrowLeft:(p||d)&&n.last,Home:n.first,End:n.last,PageUp:n.first,PageDown:n.last},g=f[e.key];if(g){const t=g();if(void 0!==t){if(!M(e))return;e.preventDefault(),n.move(t)}}}));b=(0,a.OJ)(b,(e=>(0,g.jsx)(i.Lq,{value:n,children:e})),[n]);const R=n.useState((e=>{var t;if(n&&s&&e.virtualFocus)return null==(t=(0,r.D2)(n,e.activeId))?void 0:t.id}));b=(0,l.EZ)((0,l.ih)({"aria-activedescendant":R},b),{ref:(0,a.qq)(s?n.setBaseElement:null,b.ref),onKeyDownCapture:x,onKeyUpCapture:P,onFocusCapture:B,onFocus:N,onBlurCapture:j,onKeyDown:F});const L=n.useState((e=>s&&(e.virtualFocus||null===e.activeId)));return(0,o.k)((0,l.ih)({focusable:L},b))}));(0,s.LM)((e=>{const t=v(e);return(0,s.az)("div",t)}))},58915:(e,t,n)=>{"use strict";n.d(t,{Q9:()=>c,iw:()=>d,oE:()=>u,pQ:()=>a,re:()=>l});var r=n(75126),i=n(45010),o=n(2784),s=(0,i.re)([r.fg],[r.iG]),a=(s.useContext,s.useScopedContext,s.useProviderContext),l=s.ContextProvider,c=s.ScopedContextProvider,u=(0,o.createContext)(void 0),d=(0,o.createContext)(void 0)},51329:(e,t,n)=>{"use strict";n.d(t,{B:()=>p});var r=n(9587),i=n(45010),o=n(48104),s=n(70604),a=n(2784),l=n(10244),c=n(15212),u=n(81548);function d(e){const t=e.relatedTarget;return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null}var h=Symbol("composite-hover"),p=(0,i.Bi)((e=>{var t=e,{store:n,focusOnHover:i=!0,blurOnHoverEnd:p=!!i}=t,f=(0,s.S0)(t,["store","focusOnHover","blurOnHoverEnd"]);const g=(0,r.$)();n=n||g,(0,u.kG)(n,!1);const m=(0,o.m1)(),y=f.onMouseMove,v=(0,o.yl)(i),A=(0,o.zX)((e=>{if(null==y||y(e),!e.defaultPrevented&&m()&&v(e)){if(!(0,c.B_)(e.currentTarget)){const e=null==n?void 0:n.getState().baseElement;e&&!(0,c.H1)(e)&&e.focus()}null==n||n.setActiveId(e.currentTarget.id)}})),b=f.onMouseLeave,w=(0,o.yl)(p),S=(0,o.zX)((e=>{var t;null==b||b(e),e.defaultPrevented||m()&&(function(e){const t=d(e);return!!t&&(0,l.r3)(e.currentTarget,t)}(e)||function(e){let t=d(e);if(!t)return!1;do{if((0,u.nr)(t,h)&&t[h])return!0;t=t.parentElement}while(t);return!1}(e)||v(e)&&w(e)&&(null==n||n.setActiveId(null),null==(t=null==n?void 0:n.getState().baseElement)||t.focus()))})),C=(0,a.useCallback)((e=>{e&&(e[h]=!0)}),[]);return(0,s.EZ)((0,s.ih)({},f),{ref:(0,o.qq)(C,f.ref),onMouseMove:A,onMouseLeave:S})}));(0,i.W5)((e=>{const t=p(e);return(0,i.az)("div",t)}))},75248:(e,t,n)=>{"use strict";n.d(t,{p:()=>g});var r=n(79225),i=n(9587),o=n(45010),s=n(48104),a=n(70604),l=n(2784),c=n(10244),u=n(99224),d=n(81548),h="";function p(){h=""}function f(e,t){var n;const r=(null==(n=e.element)?void 0:n.textContent)||e.children;return!!r&&(0,d.Ue)(r).trim().toLowerCase().startsWith(t.toLowerCase())}var g=(0,o.Bi)((e=>{var t=e,{store:n,typeahead:o=!0}=t,g=(0,a.S0)(t,["store","typeahead"]);const m=(0,i.$)();n=n||m,(0,d.kG)(n,!1);const y=g.onKeyDownCapture,v=(0,l.useRef)(0),A=(0,s.zX)((e=>{if(null==y||y(e),e.defaultPrevented)return;if(!o)return;if(!n)return;const{items:t,activeId:i}=n.getState();if(!function(e){const t=e.target;return(!t||!(0,c.eS)(t))&&(!(" "!==e.key||!h.length)||1===e.key.length&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&/^[\p{Letter}\p{Number}]$/u.test(e.key))}(e))return p();let s=function(e){return e.filter((e=>!e.disabled))}(t);if(!function(e,t){if((0,u.Ud)(e))return!0;const n=e.target;return!!n&&t.some((e=>e.element===n))}(e,s))return p();e.preventDefault(),window.clearTimeout(v.current),v.current=window.setTimeout((()=>{h=""}),500);const a=e.key.toLowerCase();h+=a,s=function(e,t,n){if(!n)return e;const i=e.find((e=>e.id===n));return i&&f(i,t)?h!==t&&f(i,h)?e:(h=t,(0,r.$3)(e.filter((e=>f(e,h))),n).filter((e=>e.id!==n))):e}(s,a,i);const l=s.find((e=>f(e,h)));l?n.move(l.id):p()}));return(0,a.EZ)((0,a.ih)({},g),{onKeyDownCapture:A})}));(0,o.LM)((e=>{const t=g(e);return(0,o.az)("div",t)}))},23738:(e,t,n)=>{"use strict";function r(e){return[e.clientX,e.clientY]}function i(e,t){const[n,r]=e;let i=!1;for(let e=t.length,o=0,s=e-1;o<e;s=o++){const[a,l]=t[o],[c,u]=t[s],[,d]=t[0===s?e-1:s-1]||[0,0],h=(l-u)*(n-a)-(a-c)*(r-l);if(u<l){if(r>=u&&r<l){if(0===h)return!0;h>0&&(r===u?r>d&&(i=!i):i=!i)}}else if(l<u){if(r>l&&r<=u){if(0===h)return!0;h<0&&(r===u?r<d&&(i=!i):i=!i)}}else if(r==l&&(n>=c&&n<=a||n>=a&&n<=c))return!0}return i}function o(e,t){const n=e.getBoundingClientRect(),{top:r,right:i,bottom:o,left:s}=n,[a,l]=function(e,t){const{top:n,right:r,bottom:i,left:o}=t,[s,a]=e;return[s<o?"left":s>r?"right":null,a<n?"top":a>i?"bottom":null]}(t,n),c=[t];return a?("top"!==l&&c.push(["left"===a?s:i,r]),c.push(["left"===a?i:s,r]),c.push(["left"===a?i:s,o]),"bottom"!==l&&c.push(["left"===a?s:i,o])):"top"===l?(c.push([s,r]),c.push([s,o]),c.push([i,o]),c.push([i,r])):(c.push([s,o]),c.push([s,r]),c.push([i,r]),c.push([i,o])),c}n.d(t,{u:()=>S,c:()=>w});var s=n(83222),a=n(56278),l=n(19922),c=n(45010),u=n(48104),d=n(70604),h=n(2784),p=n(10244),f=n(99224),g=n(15212),m=n(81548),y=n(13277),v=n(52322);function A(e,t,n,r){return!!((0,g.B_)(t)||e&&((0,p.r3)(t,e)||n&&(0,p.r3)(n,e)||(null==r?void 0:r.some((t=>A(e,t,n))))))}var b=(0,h.createContext)(null),w=(0,c.Bi)((e=>{var t=e,{store:n,modal:a=!1,portal:c=!!a,hideOnEscape:g=!0,hideOnHoverOutside:w=!0,disablePointerEventsOnApproach:S=!!w}=t,C=(0,d.S0)(t,["store","modal","portal","hideOnEscape","hideOnHoverOutside","disablePointerEventsOnApproach"]);const E=(0,l.P9)();n=n||E,(0,m.kG)(n,!1);const I=(0,h.useRef)(null),[_,x]=(0,h.useState)([]),P=(0,h.useRef)(0),k=(0,h.useRef)(null),{portalRef:B,domReady:O}=(0,u.Hw)(c,C.portalRef),N=!!w,D=(0,u.yl)(w),j=!!S,T=(0,u.yl)(S),M=n.useState("open"),F=n.useState("mounted");(0,h.useEffect)((()=>{if(!O)return;if(!F)return;if(!N&&!j)return;const e=I.current;return e?(0,m.tS)((0,f.iN)("mousemove",(t=>{if(!n)return;const{anchorElement:s,hideTimeout:a,timeout:l}=n.getState(),c=k.current,u=t.target,d=s;if(A(u,e,d,_))return k.current=u&&d&&(0,p.r3)(d,u)?r(t):null,window.clearTimeout(P.current),void(P.current=0);if(!P.current){if(c){const n=r(t);if(i(n,o(e,c))){if(k.current=n,!T(t))return;return t.preventDefault(),void t.stopPropagation()}}D(t)&&(P.current=window.setTimeout((()=>{P.current=0,null==n||n.hide()}),null!=a?a:l))}}),!0),(()=>clearTimeout(P.current))):void 0}),[n,O,F,N,j,_,T,D]),(0,h.useEffect)((()=>{if(!O)return;if(!F)return;if(!j)return;const e=e=>{const t=I.current;if(!t)return;const n=k.current;if(!n)return;const s=o(t,n);if(i(r(e),s)){if(!T(e))return;e.preventDefault(),e.stopPropagation()}};return(0,m.tS)((0,f.iN)("mouseenter",e,!0),(0,f.iN)("mouseover",e,!0),(0,f.iN)("mouseout",e,!0),(0,f.iN)("mouseleave",e,!0))}),[O,F,j,T]),(0,h.useEffect)((()=>{O&&(M||null==n||n.setAutoFocusOnShow(!1))}),[n,O,M]);const R=(0,u.cP)(M);(0,h.useEffect)((()=>{if(O)return()=>{R.current||null==n||n.setAutoFocusOnShow(!1)}}),[n,O]);const L=(0,h.useContext)(b);(0,u.Gw)((()=>{if(a)return;if(!c)return;if(!F)return;if(!O)return;const e=I.current;return e?null==L?void 0:L(e):void 0}),[a,c,F,O]);const Q=(0,h.useCallback)((e=>{x((t=>[...t,e]));const t=null==L?void 0:L(e);return()=>{x((t=>t.filter((t=>t!==e)))),null==t||t()}}),[L]);C=(0,u.OJ)(C,(e=>(0,v.jsx)(l.WS,{value:n,children:(0,v.jsx)(b.Provider,{value:Q,children:e})})),[n,Q]),C=(0,d.EZ)((0,d.ih)({},C),{ref:(0,u.qq)(I,C.ref)}),C=function(e){var t=e,{store:n}=t,r=(0,d.S0)(t,["store"]);const[i,o]=(0,h.useState)(!1),s=n.useState("mounted");(0,h.useEffect)((()=>{s||o(!1)}),[s]);const a=r.onFocus,l=(0,u.zX)((e=>{null==a||a(e),e.defaultPrevented||o(!0)})),c=(0,h.useRef)(null);return(0,h.useEffect)((()=>(0,y.Z_)(n,["anchorElement"],(e=>{c.current=e.anchorElement}))),[]),(0,d.EZ)((0,d.ih)({autoFocusOnHide:i,finalFocus:c},r),{onFocus:l})}((0,d.ih)({store:n},C));const U=n.useState((e=>a||e.autoFocusOnShow));return(0,s.S)((0,d.EZ)((0,d.ih)({store:n,modal:a,portal:c,autoFocusOnShow:U},C),{portalRef:B,hideOnEscape:e=>!(0,m.Bk)(g,e)&&(requestAnimationFrame((()=>{requestAnimationFrame((()=>{null==n||n.hide()}))})),!0)}))})),S=(0,a.L5)((0,c.LM)((e=>{const t=w(e);return(0,c.az)("div",t)})),l.P9)},9587:(e,t,n)=>{"use strict";n.d(t,{$:()=>a,Ft:()=>h,Lq:()=>c,al:()=>u,po:()=>l,xt:()=>d});var r=n(75235),i=n(45010),o=n(2784),s=(0,i.re)([r.L3],[r.MI]),a=s.useContext,l=(s.useScopedContext,s.useProviderContext),c=s.ContextProvider,u=s.ScopedContextProvider,d=(0,o.createContext)(void 0),h=(0,o.createContext)(void 0)},43965:(e,t,n)=>{"use strict";n.d(t,{Q:()=>a});var r=n(59412),i=n(45010),o=n(48104),s=n(70604),a=(0,i.Bi)((e=>{var t=e,{store:n}=t,i=(0,s.S0)(t,["store"]);const a=(0,r.yL)();return n=n||a,(0,s.EZ)((0,s.ih)({},i),{ref:(0,o.qq)(null==n?void 0:n.setAnchorElement,i.ref)})}));(0,i.LM)((e=>{const t=a(e);return(0,i.az)("div",t)}))},43670:(e,t,n)=>{"use strict";n.d(t,{k:()=>b});var r=n(27177),i=n(45010),o=n(48104),s=n(70604),a=n(2784),l=n(10244),c=n(99224),u=n(15212),d=n(81548),h=(0,n(29052).G6)(),p=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"];function f(e){return!("input"!==e.tagName.toLowerCase()||!e.type||"radio"!==e.type&&"checkbox"!==e.type)}function g(e,t,n,r,i){return e?t?n&&!r?-1:void 0:n?i:i||0:i}function m(e,t){return(0,o.zX)((n=>{null==e||e(n),n.defaultPrevented||t&&(n.stopPropagation(),n.preventDefault())}))}var y=!0;function v(e){const t=e.target;t&&"hasAttribute"in t&&(t.hasAttribute("data-focus-visible")||(y=!1))}function A(e){e.metaKey||e.ctrlKey||e.altKey||(y=!0)}var b=(0,i.Bi)((e=>{var t=e,{focusable:n=!0,accessibleWhenDisabled:i,autoFocus:b,onFocusVisible:w}=t,S=(0,s.S0)(t,["focusable","accessibleWhenDisabled","autoFocus","onFocusVisible"]);const C=(0,a.useRef)(null);(0,a.useEffect)((()=>{n&&((0,c.iN)("mousedown",v,!0),(0,c.iN)("keydown",A,!0))}),[n]),h&&(0,a.useEffect)((()=>{if(!n)return;const e=C.current;if(!e)return;if(!f(e))return;const t=function(e){return"labels"in e?e.labels:null}(e);if(!t)return;const r=()=>queueMicrotask((()=>e.focus()));return t.forEach((e=>e.addEventListener("mouseup",r))),()=>{t.forEach((e=>e.removeEventListener("mouseup",r)))}}),[n]);const E=n&&(0,d.EE)(S),I=!!E&&!i,[_,x]=(0,a.useState)(!1);(0,a.useEffect)((()=>{n&&I&&_&&x(!1)}),[n,I,_]),(0,a.useEffect)((()=>{if(!n)return;if(!_)return;const e=C.current;if(!e)return;if("undefined"==typeof IntersectionObserver)return;const t=new IntersectionObserver((()=>{(0,u.EB)(e)||x(!1)}));return t.observe(e),()=>t.disconnect()}),[n,_]);const P=m(S.onKeyPressCapture,E),k=m(S.onMouseDownCapture,E),B=m(S.onClickCapture,E),O=S.onMouseDown,N=(0,o.zX)((e=>{if(null==O||O(e),e.defaultPrevented)return;if(!n)return;const t=e.currentTarget;if(!h)return;if((0,c.Ke)(e))return;if(!(0,l.iK)(t)&&!f(t))return;let r=!1;const i=()=>{r=!0};t.addEventListener("focusin",i,{capture:!0,once:!0}),(0,c.qx)(t,"mouseup",(()=>{t.removeEventListener("focusin",i,!0),r||(0,u.Qw)(t)}))})),D=(e,t)=>{if(t&&(e.currentTarget=t),!n)return;const r=e.currentTarget;r&&(0,u.H1)(r)&&(null==w||w(e),e.defaultPrevented||x(!0))},j=S.onKeyDownCapture,T=(0,o.zX)((e=>{if(null==j||j(e),e.defaultPrevented)return;if(!n)return;if(_)return;if(e.metaKey)return;if(e.altKey)return;if(e.ctrlKey)return;if(!(0,c.Ud)(e))return;const t=e.currentTarget;queueMicrotask((()=>D(e,t)))})),M=S.onFocusCapture,F=(0,o.zX)((e=>{if(null==M||M(e),e.defaultPrevented)return;if(!n)return;if(!(0,c.Ud)(e))return void x(!1);const t=e.currentTarget,r=()=>D(e,t);y||function(e){const{tagName:t,readOnly:n,type:r}=e;return"TEXTAREA"===t&&!n||"SELECT"===t&&!n||("INPUT"!==t||n?!!e.isContentEditable:p.includes(r))}(e.target)?queueMicrotask(r):function(e){return"combobox"===e.getAttribute("role")&&!!e.dataset.name}(e.target)?(0,c.qx)(e.target,"focusout",r):x(!1)})),R=S.onBlur,L=(0,o.zX)((e=>{null==R||R(e),n&&(0,c.N)(e)&&x(!1)})),Q=(0,a.useContext)(r.R),U=(0,o.zX)((e=>{n&&b&&e&&Q&&queueMicrotask((()=>{(0,u.H1)(e)||(0,u.EB)(e)&&e.focus()}))})),V=(0,o.O)(C,S.as),K=n&&function(e){return!e||"button"===e||"input"===e||"select"===e||"textarea"===e||"a"===e}(V),H=n&&function(e){return!e||"button"===e||"input"===e||"select"===e||"textarea"===e}(V),G=I?(0,s.ih)({pointerEvents:"none"},S.style):S.style;return(0,s.EZ)((0,s.ih)({"data-focus-visible":n&&_?"":void 0,"data-autofocus":!!b||void 0,"aria-disabled":!!E||void 0},S),{ref:(0,o.qq)(C,U,S.ref),style:G,tabIndex:g(n,I,K,H,S.tabIndex),disabled:!(!H||!I)||void 0,contentEditable:E?void 0:S.contentEditable,onKeyPressCapture:P,onClickCapture:B,onMouseDownCapture:k,onMouseDown:N,onKeyDownCapture:T,onFocusCapture:F,onBlur:L})}));(0,i.LM)((e=>(e=b(e),(0,i.az)("div",e))))},10114:(e,t,n)=>{"use strict";n.d(t,{fM:()=>g,k_:()=>y,xj:()=>f});var r=n(58915),i=n(75126),o=n(45010),s=n(6236),a=n(48104),l=n(70604),c=n(2784),u=n(81548),d=n(52322);function h(e,t){const n=setTimeout(t,e);return()=>clearTimeout(n)}function p(...e){return e.join(", ").split(", ").reduce(((e,t)=>{const n=1e3*parseFloat(t||"0s");return n>e?n:e}),0)}function f(e,t,n){return!(n||!1===t||e&&!t)}var g=(0,o.Bi)((e=>{var t=e,{store:n,alwaysVisible:o}=t,s=(0,l.S0)(t,["store","alwaysVisible"]);const g=(0,i.eR)();n=n||g,(0,u.kG)(n,!1);const m=(0,a.Me)(s.id),[y,v]=(0,c.useState)(null),A=n.useState("open"),b=n.useState("mounted"),w=n.useState("animated"),S=n.useState("contentElement");(0,a.Gw)((()=>{if(w){if(null==S?void 0:S.isConnected)return function(e){let t=requestAnimationFrame((()=>{t=requestAnimationFrame(e)}));return()=>cancelAnimationFrame(t)}((()=>{v(A?"enter":"leave")}));v(null)}}),[w,S,A]),(0,a.Gw)((()=>{if(!n)return;if(!w)return;if(!S)return;if(!y)return;if("enter"===y&&!A)return;if("leave"===y&&A)return;if("number"==typeof w)return h(w,n.stopAnimation);const{transitionDuration:e,animationDuration:t,transitionDelay:r,animationDelay:i}=getComputedStyle(S),o=p(r,i)+p(e,t);return o?h(o,n.stopAnimation):void 0}),[n,w,S,A,y]);const C=f(b,(s=(0,a.OJ)(s,(e=>(0,d.jsx)(r.Q9,{value:n,children:e})),[n])).hidden,o),E=C?(0,l.EZ)((0,l.ih)({},s.style),{display:"none"}):s.style;return(0,l.EZ)((0,l.ih)({id:m,"data-enter":"enter"===y?"":void 0,"data-leave":"leave"===y?"":void 0,hidden:C},s),{ref:(0,a.qq)(m?n.setContentElement:null,s.ref),style:E})})),m=(0,o.LM)((e=>{const t=g(e);return(0,o.az)("div",t)})),y=(0,o.LM)((e=>{var t=e,{unmountOnHide:n}=t,r=(0,l.S0)(t,["unmountOnHide"]);const o=(0,i.eR)(),a=r.store||o;return!1===(0,s.Kw)(a,(e=>!n||(null==e?void 0:e.mounted)))?null:(0,d.jsx)(m,(0,l.ih)({},r))}))},15945:(e,t,n)=>{"use strict";n.d(t,{n:()=>p});var r=n(59412),i=n(45010),o=n(70604),s=n(2784),a=n(81548),l=n(52322),c={top:"4,10 8,6 12,10",right:"6,4 10,8 6,12",bottom:"4,6 8,10 12,6",left:"10,4 6,8 10,12"},u=(0,i.Bi)((e=>{var t=e,{store:n,placement:i}=t,u=(0,o.S0)(t,["store","placement"]);const d=(0,r.lp)();n=n||d,(0,a.kG)(n,!1);const h=n.useState((e=>i||e.placement)).split("-")[0],p=c[h],f=(0,s.useMemo)((()=>(0,l.jsx)("svg",{display:"block",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5pt",viewBox:"0 0 16 16",height:"1em",width:"1em",children:(0,l.jsx)("polyline",{points:p})})),[p]);return(0,o.EZ)((0,o.ih)({children:f,"aria-hidden":!0},u),{style:(0,o.ih)({width:"1em",height:"1em",pointerEvents:"none"},u.style)})}));(0,i.LM)((e=>{const t=u(e);return(0,i.az)("span",t)}));var d=n(9460),h=(0,i.Bi)((e=>{var t=e,{store:n}=t,r=(0,o.S0)(t,["store"]);const i=(0,d.TG)();return n=n||i,u((0,o.ih)({store:n},r))})),p=(0,i.LM)((e=>{const t=h(e);return(0,i.az)("span",t)}))},13271:(e,t,n)=>{"use strict";n.d(t,{Y:()=>f});var r=n(43670),i=n(45010),o=n(48104),s=n(70604),a=n(2784),l=n(10244),c=n(99224),u=n(81548),d=n(29052);function h(e){if(!e.isTrusted)return!1;const t=e.currentTarget;return"Enter"===e.key?(0,l.iK)(t)||"SUMMARY"===t.tagName||"A"===t.tagName:" "===e.key&&((0,l.iK)(t)||"SUMMARY"===t.tagName||"INPUT"===t.tagName||"SELECT"===t.tagName)}var p=Symbol("command"),f=(0,i.Bi)((e=>{var t=e,{clickOnEnter:n=!0,clickOnSpace:i=!0}=t,f=(0,s.S0)(t,["clickOnEnter","clickOnSpace"]);const g=(0,a.useRef)(null),m=(0,o.O)(g,f.as),y=f.type,[v,A]=(0,a.useState)((()=>!!m&&(0,l.iK)({tagName:m,type:y})));(0,a.useEffect)((()=>{g.current&&A((0,l.iK)(g.current))}),[]);const[b,w]=(0,a.useState)(!1),S=(0,a.useRef)(!1),C=(0,u.EE)(f),[E,I]=(0,o.XJ)(f,p,!0),_=f.onKeyDown,x=(0,o.zX)((e=>{null==_||_(e);const t=e.currentTarget;if(e.defaultPrevented)return;if(E)return;if(C)return;if(!(0,c.Ud)(e))return;if((0,l.eS)(t))return;if(t.isContentEditable)return;const r=n&&"Enter"===e.key,o=i&&" "===e.key,a="Enter"===e.key&&!n,u=" "===e.key&&!i;if(a||u)e.preventDefault();else if(r||o){const n=h(e);if(r){if(!n){e.preventDefault();const n=e,{view:r}=n,i=(0,s.S0)(n,["view"]),o=()=>(0,c.lO)(t,i);(0,d.vU)()?(0,c.qx)(t,"keyup",o):queueMicrotask(o)}}else o&&(S.current=!0,n||(e.preventDefault(),w(!0)))}})),P=f.onKeyUp,k=(0,o.zX)((e=>{if(null==P||P(e),e.defaultPrevented)return;if(E)return;if(C)return;if(e.metaKey)return;const t=i&&" "===e.key;if(S.current&&t&&(S.current=!1,!h(e))){e.preventDefault(),w(!1);const t=e.currentTarget,n=e,{view:r}=n,i=(0,s.S0)(n,["view"]);queueMicrotask((()=>(0,c.lO)(t,i)))}}));return f=(0,s.EZ)((0,s.ih)((0,s.ih)({"data-active":b?"":void 0,type:v?"button":void 0},I),f),{ref:(0,o.qq)(g,f.ref),onKeyDown:x,onKeyUp:k}),(0,r.k)(f)}));(0,i.LM)((e=>(e=f(e),(0,i.az)("button",e))))},75126:(e,t,n)=>{"use strict";n.d(t,{eR:()=>i,fg:()=>o,iG:()=>s});var r=(0,n(45010).re)(),i=(r.useContext,r.useScopedContext,r.useProviderContext),o=r.ContextProvider,s=r.ScopedContextProvider},56278:(e,t,n)=>{"use strict";function r(e,...t){if(!e)return!1;const n=e.getAttribute("data-backdrop");return null!=n&&(""===n||"true"===n||!t.length||t.some((e=>n===e)))}n.d(t,{Vq:()=>ne,L5:()=>te,Rh:()=>ee});var i=new WeakMap;function o(e,t,n){i.has(e)||i.set(e,new Map);const r=i.get(e),o=r.get(t);if(!o)return r.set(t,n()),()=>{var e;null==(e=r.get(t))||e(),r.delete(t)};const s=n(),a=()=>{s(),o(),r.delete(t)};return r.set(t,a),()=>{r.get(t)===a&&(s(),r.set(t,o))}}function s(e,t,n){return o(e,t,(()=>{const r=e.getAttribute(t);return e.setAttribute(t,n),()=>{null==r?e.removeAttribute(t):e.setAttribute(t,r)}}))}function a(e,t,n){return o(e,t,(()=>{const r=t in e,i=e[t];return e[t]=n,()=>{r?e[t]=i:delete e[t]}}))}function l(e,t){return e?o(e,"style",(()=>{const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}})):()=>{}}var c=n(10244),u=n(81548),d=["SCRIPT","STYLE"];function h(e){return`__ariakit-dialog-snapshot-${e}`}function p(e,t,n){return!d.includes(t.tagName)&&!!function(e,t){const n=(0,c.Me)(t),r=h(e);if(!n.body[r])return!0;for(;;){if(t===n.body)return!1;if(t[r])return!0;if(!t.parentElement)return!1;t=t.parentElement}}(e,t)&&!n.some((e=>e&&(0,c.r3)(t,e)))}function f(e,t,n,r){for(let i of t){if(!(null==i?void 0:i.isConnected))continue;const o=t.some((e=>!!e&&e!==i&&e.contains(i))),s=(0,c.Me)(i),a=i;for(;i.parentElement&&i!==s.body;){if(null==r||r(i.parentElement,a),!o)for(const r of i.parentElement.children)p(e,r,t)&&n(r,a);i=i.parentElement}}}function g(e="",t=!1){return`__ariakit-dialog-${t?"ancestor":"outside"}${e?`-${e}`:""}`}function m(e,t=""){return(0,u.tS)(a(e,g("",!0),!0),a(e,g(t,!0),!0))}function y(e,t){if(e[g(t,!0)])return!0;const n=g(t);for(;;){if(e[n])return!0;if(!e.parentElement)return!1;e=e.parentElement}}function v(e,t){const n=[],i=t.map((e=>null==e?void 0:e.id));return f(e,t,(t=>{r(t,...i)||n.unshift(function(e,t=""){return(0,u.tS)(a(e,g(),!0),a(e,g(t),!0))}(t,e))}),((t,r)=>{r.hasAttribute("data-dialog")&&r.id!==e||n.unshift(m(t,e))})),()=>{n.forEach((e=>e()))}}var A=n(45010),b=((0,A.Bi)((e=>e)),(0,A.LM)((e=>(0,A.az)("div",e))));Object.assign(b,["a","button","details","dialog","div","form","h1","h2","h3","h4","h5","h6","header","img","input","label","li","nav","ol","p","section","select","span","textarea","ul","svg"].reduce(((e,t)=>(e[t]=(0,A.LM)((e=>(0,A.az)(t,e))),e)),{}));var w=n(10114),S=n(22457),C=n(48104),E=n(70604),I=n(2784),_=n(52322);function x({store:e,backdrop:t,backdropProps:n,alwaysVisible:r,hidden:i}){const o=(0,I.useRef)(null),s=(0,S.M)({disclosure:e}),a=e.useState("contentElement");(0,C.Gw)((()=>{const e=o.current,t=a;e&&t&&(e.style.zIndex=getComputedStyle(t).zIndex)}),[a]),(0,C.Gw)((()=>{const e=null==a?void 0:a.id;if(!e)return;const t=o.current;return t?m(t,e):void 0}),[a]),null!=i&&(n=(0,E.EZ)((0,E.ih)({},n),{hidden:i}));const l=(0,w.fM)((0,E.EZ)((0,E.ih)({store:s,role:"presentation","data-backdrop":(null==a?void 0:a.id)||"",alwaysVisible:r},n),{ref:(0,C.qq)(null==n?void 0:n.ref,o),style:(0,E.ih)({position:"fixed",top:0,right:0,bottom:0,left:0},null==n?void 0:n.style)}));if(!t)return null;if((0,I.isValidElement)(t))return(0,_.jsx)(b,(0,E.EZ)((0,E.ih)({},l),{render:t}));const c="boolean"!=typeof t?t:"div";return(0,_.jsx)(b,(0,E.EZ)((0,E.ih)({},l),{render:(0,_.jsx)(c,{})}))}var P=n(15212);function k(e,t){if(!("style"in e))return u.ZT;if("inert"in HTMLElement.prototype)return a(e,"inert",!0);const n=(0,P.SI)(e,!0).map((e=>(null==t?void 0:t.some((t=>t&&(0,c.r3)(t,e))))?u.ZT:s(e,"tabindex","-1")));return(0,u.tS)(...n,function(e){return s(e,"aria-hidden","true")}(e),l(e,{pointerEvents:"none",userSelect:"none",cursor:"default"}))}var B=n(28316),O=n(29052);var N=n(13277),D=(0,I.createContext)({}),j=n(99224);function T({store:e,type:t,listener:n,capture:r,domReady:i}){const o=(0,C.zX)(n),s=e.useState("open"),a=(0,I.useRef)(!1);(0,C.Gw)((()=>{if(!s)return;if(!i)return;const{contentElement:t}=e.getState();if(!t)return;const n=()=>{a.current=!0};return t.addEventListener("focusin",n,!0),()=>t.removeEventListener("focusin",n,!0)}),[e,s,i]),(0,I.useEffect)((()=>{if(s)return(0,j.iN)(t,(t=>{const{contentElement:n,disclosureElement:r}=e.getState(),i=t.target;n&&i&&function(e){return"HTML"===e.tagName||(0,c.r3)((0,c.Me)(e).body,e)}(i)&&((0,c.r3)(n,i)||function(e,t){if(!e)return!1;if((0,c.r3)(e,t))return!0;const n=t.getAttribute("aria-activedescendant");if(n){const t=(0,c.Me)(e).getElementById(n);if(t)return(0,c.r3)(e,t)}return!1}(r,i)||i.hasAttribute("data-focus-trap")||function(e,t){if(!("clientY"in e))return!1;const n=t.getBoundingClientRect();return 0!==n.width&&0!==n.height&&n.top<=e.clientY&&e.clientY<=n.top+n.height&&n.left<=e.clientX&&e.clientX<=n.left+n.width}(t,n)||a.current&&!y(i,n.id)||o(t))}),r)}),[s,r])}function M(e,t){return"function"==typeof e?e(t):!!e}var F=n(27177),R=(0,A.Bi)((e=>{var t=e,{autoFocusOnShow:n=!0}=t,r=(0,E.S0)(t,["autoFocusOnShow"]);return(0,C.OJ)(r,(e=>(0,_.jsx)(F.R.Provider,{value:n,children:e})),[n])}));(0,A.LM)((e=>{const t=R(e);return(0,A.az)("div",t)}));var L=(0,I.createContext)(0);function Q({level:e,children:t}){const n=(0,I.useContext)(L),r=Math.max(Math.min(e||n+1,6),1);return(0,_.jsx)(L.Provider,{value:r,children:t})}var U=n(96332),V=(0,A.Bi)((e=>(e=(0,E.EZ)((0,E.ih)({"data-focus-trap":"",tabIndex:0,"aria-hidden":!0},e),{style:(0,E.ih)({position:"fixed",top:0,left:0},e.style)}),(0,U.S)(e)))),K=(0,A.LM)((e=>{const t=V(e);return(0,A.az)("span",t)})),H=(0,I.createContext)(null),G=n(43198);function Y(e){queueMicrotask((()=>{null==e||e.focus()}))}var z=(0,A.Bi)((e=>{var t=e,{preserveTabOrder:n,preserveTabOrderAnchor:r,portalElement:i,portalRef:o,portal:s=!0}=t,a=(0,E.S0)(t,["preserveTabOrder","preserveTabOrderAnchor","portalElement","portalRef","portal"]);const l=(0,I.useRef)(null),u=(0,C.qq)(l,a.ref),d=(0,I.useContext)(H),[h,p]=(0,I.useState)(null),[f,g]=(0,I.useState)(null),m=(0,I.useRef)(null),y=(0,I.useRef)(null),v=(0,I.useRef)(null),A=(0,I.useRef)(null);return(0,C.Gw)((()=>{const e=l.current;if(!e||!s)return void p(null);const t=function(e,t){return t?"function"==typeof t?t(e):t:(0,c.Me)(e).createElement("div")}(e,i);if(!t)return void p(null);const n=t.isConnected;if(!n){const n=d||function(e){return(0,c.Me)(e).body}(e);n.appendChild(t)}return t.id||(t.id=e.id?`portal/${e.id}`:function(e="id"){return`${e?`${e}-`:""}${Math.random().toString(36).substr(2,6)}`}()),p(t),(0,G.k$)(o,t),n?void 0:()=>{t.remove(),(0,G.k$)(o,null)}}),[s,i,d,o]),(0,C.Gw)((()=>{if(!n)return;if(!r)return;const e=(0,c.Me)(r).createElement("span");return e.style.position="fixed",r.insertAdjacentElement("afterend",e),g(e),()=>{e.remove(),g(null)}}),[n,r]),(0,I.useEffect)((()=>{if(!h)return;if(!n)return;let e=0;const t=t=>{if((0,j.N)(t))return"focusin"===t.type?(0,P.ss)(h):(cancelAnimationFrame(e),void(e=requestAnimationFrame((()=>{(0,P.MN)(h,!0)}))))};return h.addEventListener("focusin",t,!0),h.addEventListener("focusout",t,!0),()=>{h.removeEventListener("focusin",t,!0),h.removeEventListener("focusout",t,!0)}}),[h,n]),a=(0,C.OJ)(a,(e=>{if(e=(0,_.jsx)(H.Provider,{value:h||d,children:e}),!s)return e;if(!h)return(0,_.jsx)("span",{ref:u,id:a.id,style:{position:"fixed"},hidden:!0});e=(0,_.jsxs)(_.Fragment,{children:[n&&h&&(0,_.jsx)(K,{ref:y,className:"__focus-trap-inner-before",onFocus:e=>{(0,j.N)(e,h)?Y((0,P.k0)()):Y(m.current)}}),e,n&&h&&(0,_.jsx)(K,{ref:v,className:"__focus-trap-inner-after",onFocus:e=>{(0,j.N)(e,h)?Y((0,P.e8)()):Y(A.current)}})]}),h&&(e=(0,B.createPortal)(e,h));let t=(0,_.jsxs)(_.Fragment,{children:[n&&h&&(0,_.jsx)(K,{ref:m,className:"__focus-trap-outer-before",onFocus:e=>{e.relatedTarget!==A.current&&(0,j.N)(e,h)?Y(y.current):Y((0,P.e8)())}}),n&&(0,_.jsx)("span",{"aria-owns":null==h?void 0:h.id,style:{position:"fixed"}}),n&&h&&(0,_.jsx)(K,{ref:A,className:"__focus-trap-outer-after",onFocus:e=>{if((0,j.N)(e,h))Y(v.current);else{const e=(0,P.k0)();if(e===y.current)return void requestAnimationFrame((()=>{var e;return null==(e=(0,P.k0)())?void 0:e.focus()}));Y(e)}}})]});return f&&n&&(t=(0,B.createPortal)(t,f)),(0,_.jsxs)(_.Fragment,{children:[t,e]})}),[h,d,s,a.id,n,f]),a=(0,E.EZ)((0,E.ih)({},a),{ref:u})}));(0,A.LM)((e=>{const t=z(e);return(0,A.az)("div",t)}));var Z=n(58915),W=n(43670),q=n(72455),J=n(6236),X=(0,O.G6)();function $(e,t=!1){if(!e)return null;const n="current"in e?e.current:e;return n?t?(0,P.EB)(n)?n:null:n:null}var ee=(0,A.Bi)((e=>{var t=e,{store:n,open:i,onClose:s,focusable:d=!0,modal:p=!0,portal:g=!!p,backdrop:m=!!p,backdropProps:A,hideOnEscape:b=!0,hideOnInteractOutside:S=!0,getPersistentElements:F,preventBodyScroll:L=!!p,autoFocusOnShow:U=!0,autoFocusOnHide:V=!0,initialFocus:K,finalFocus:H,unmountOnHide:G}=t,Y=(0,E.S0)(t,["store","open","onClose","focusable","modal","portal","backdrop","backdropProps","hideOnEscape","hideOnInteractOutside","getPersistentElements","preventBodyScroll","autoFocusOnShow","autoFocusOnHide","initialFocus","finalFocus","unmountOnHide"]);const J=(0,Z.pQ)(),ee=(0,I.useRef)(null),te=(0,q.I)({store:n||J,open:i,setOpen(e){if(e)return;const t=ee.current;if(!t)return;const n=new Event("close",{bubbles:!1,cancelable:!0});s&&t.addEventListener("close",s,{once:!0}),t.dispatchEvent(n),n.defaultPrevented&&te.setOpen(!0)}}),{portalRef:ne,domReady:re}=(0,C.Hw)(g,Y.portalRef),ie=Y.preserveTabOrder,oe=te.useState((e=>ie&&!p&&e.mounted)),se=(0,C.Me)(Y.id),ae=te.useState("open"),le=te.useState("mounted"),ce=te.useState("contentElement"),ue=(0,w.xj)(le,Y.hidden,Y.alwaysVisible);(function(e,t,n){const r=function({attribute:e,contentId:t,contentElement:n,enabled:r}){const[i,o]=(0,C.NW)(),s=(0,I.useCallback)((()=>{if(!r)return!1;if(!n)return!1;const{body:i}=(0,c.Me)(n),o=i.getAttribute(e);return!o||o===t}),[i,r,n,e,t]);return(0,I.useEffect)((()=>{if(!r)return;if(!t)return;if(!n)return;const{body:i}=(0,c.Me)(n);if(s())return i.setAttribute(e,t),()=>i.removeAttribute(e);const a=new MutationObserver((()=>(0,B.flushSync)(o)));return a.observe(i,{attributeFilter:[e]}),()=>a.disconnect()}),[i,r,t,n,s,e]),s}({attribute:"data-dialog-prevent-body-scroll",contentElement:e,contentId:t,enabled:n});(0,I.useEffect)((()=>{if(!r())return;if(!e)return;const t=(0,c.Me)(e),n=(0,c.Jj)(e),{documentElement:i,body:s}=t,a=i.style.getPropertyValue("--scrollbar-width"),d=a?parseInt(a):n.innerWidth-i.clientWidth,h=function(e){const t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}(i),p=(0,O.mL)()&&!(0,O.V5)();return(0,u.tS)((g="--scrollbar-width",m=`${d}px`,(f=i)?o(f,g,(()=>{const e=f.style.getPropertyValue(g);return f.style.setProperty(g,m),()=>{e?f.style.setProperty(g,e):f.style.removeProperty(g)}})):()=>{}),p?(()=>{var e,t;const{scrollX:r,scrollY:i,visualViewport:o}=n,a=null!=(e=null==o?void 0:o.offsetLeft)?e:0,c=null!=(t=null==o?void 0:o.offsetTop)?t:0,u=l(s,{position:"fixed",overflow:"hidden",top:-(i-Math.floor(c))+"px",left:-(r-Math.floor(a))+"px",right:"0",[h]:`${d}px`});return()=>{u(),n.scrollTo(r,i)}})():l(s,{overflow:"hidden",[h]:`${d}px`}));var f,g,m}),[r,e])})(ce,se,L&&!ue),function(e,t,n){const r=function(e){const t=(0,I.useRef)();return(0,I.useEffect)((()=>{if(e)return(0,j.iN)("mousedown",(e=>{t.current=e.target}),!0);t.current=null}),[e]),t}(e.useState("open")),i={store:e,domReady:n,capture:!0};T((0,E.EZ)((0,E.ih)({},i),{type:"click",listener:n=>{const{contentElement:i}=e.getState(),o=r.current;o&&(0,c.pn)(o)&&y(o,null==i?void 0:i.id)&&M(t,n)&&e.hide()}})),T((0,E.EZ)((0,E.ih)({},i),{type:"focusin",listener:n=>{const{contentElement:r}=e.getState();r&&n.target!==(0,c.Me)(r)&&M(t,n)&&e.hide()}})),T((0,E.EZ)((0,E.ih)({},i),{type:"contextmenu",listener:n=>{M(t,n)&&e.hide()}}))}(te,S,re);const{wrapElement:de,nestedDialogs:he}=function(e){const t=(0,I.useContext)(D),[n,r]=(0,I.useState)([]),i=(0,I.useCallback)((e=>{var n;return r((t=>[...t,e])),(0,u.tS)(null==(n=t.add)?void 0:n.call(t,e),(()=>{r((t=>t.filter((t=>t!==e))))}))}),[t]);(0,C.Gw)((()=>(0,N.Z_)(e,["open","contentElement"],(n=>{var r;if(n.open&&n.contentElement)return null==(r=t.add)?void 0:r.call(t,e)}))),[e,t]);const o=(0,I.useMemo)((()=>({store:e,add:i})),[e,i]);return{wrapElement:(0,I.useCallback)((e=>(0,_.jsx)(D.Provider,{value:o,children:e})),[o]),nestedDialogs:n}}(te);Y=(0,C.OJ)(Y,de,[de]),(0,C.Gw)((()=>{if(!ae)return;const e=ee.current,t=(0,c.vY)(e,!0);t&&"BODY"!==t.tagName&&(e&&(0,c.r3)(e,t)||te.setDisclosureElement(t))}),[te,ae]),X&&(0,I.useEffect)((()=>{if(!le)return;const{disclosureElement:e}=te.getState();if(!e)return;if(!(0,c.iK)(e))return;const t=()=>{let t=!1;const n=()=>{t=!0};e.addEventListener("focusin",n,{capture:!0,once:!0}),(0,j.qx)(e,"mouseup",(()=>{e.removeEventListener("focusin",n,!0),t||(0,P.Qw)(e)}))};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}}),[te,le]),(0,I.useEffect)((()=>{if(!p)return;if(!le)return;if(!re)return;const e=ee.current;return e?e.querySelector("[data-dialog-dismiss]")?void 0:function(e,t){const n=(0,c.Me)(e).createElement("button");return n.type="button",n.tabIndex=-1,n.textContent="Dismiss popup",Object.assign(n.style,{border:"0px",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute",whiteSpace:"nowrap",width:"1px"}),n.addEventListener("click",t),e.prepend(n),()=>{n.removeEventListener("click",t),n.remove()}}(e,te.hide):void 0}),[te,p,le,re]),(0,C.Gw)((()=>{if(ae)return;if(!le)return;if(!re)return;const e=ee.current;return e?k(e):void 0}),[ae,le,re]);const pe=ae&&re;(0,C.Gw)((()=>{if(!se)return;if(!pe)return;const e=ee.current;return function(e,t){const{body:n}=(0,c.Me)(t[0]),r=[];return f(e,t,(t=>{r.push(a(t,h(e),!0))})),(0,u.tS)(a(n,h(e),!0),(()=>r.forEach((e=>e()))))}(se,[e])}),[se,pe]);const fe=(0,C.zX)(F);(0,C.Gw)((()=>{if(!se)return;if(!pe)return;const{disclosureElement:e}=te.getState(),t=[ee.current,...fe()||[],...he.map((e=>e.getState().contentElement))];return p?(0,u.tS)(v(se,t),function(e,t){const n=[],i=t.map((e=>null==e?void 0:e.id));return f(e,t,(e=>{r(e,...i)||n.unshift(k(e,t))})),()=>{n.forEach((e=>e()))}}(se,t)):v(se,[e,...t])}),[se,te,pe,fe,he,p]);const ge=!!U,me=(0,C.yl)(U),[ye,ve]=(0,I.useState)(!1);(0,I.useEffect)((()=>{if(!ae)return;if(!ge)return;if(!re)return;if(!(null==ce?void 0:ce.isConnected))return;const e=$(K,!0)||ce.querySelector("[data-autofocus=true],[autofocus]")||(0,P.YC)(ce,!0,g&&oe)||ce,t=(0,P.EB)(e);me(t?e:null)&&(ve(!0),queueMicrotask((()=>{e.focus(),X&&e.scrollIntoView({block:"nearest",inline:"nearest"})})))}),[ae,ge,re,ce,K,g,oe,me]);const Ae=!!V,be=(0,C.yl)(V),[we,Se]=(0,I.useState)(!1);(0,I.useEffect)((()=>{if(ae)return Se(!0),()=>Se(!1)}),[ae]);const Ce=(0,I.useCallback)(((e,t=!0)=>{const{disclosureElement:n}=te.getState();if(function(e){const t=(0,c.vY)();return!(!t||e&&(0,c.r3)(e,t)||!(0,P.EB)(t))}(e))return;let r=$(H)||n;if(null==r?void 0:r.id){const e=(0,c.Me)(r),t=`[aria-activedescendant="${r.id}"]`,n=e.querySelector(t);n&&(r=n)}if(r&&!(0,P.EB)(r)){const e=(0,c.oq)(r,"[data-dialog]");if(e&&e.id){const t=(0,c.Me)(e),n=`[aria-controls~="${e.id}"]`,i=t.querySelector(n);i&&(r=i)}}const i=r&&(0,P.EB)(r);i||!t?be(i?r:null)&&i&&(null==r||r.focus()):requestAnimationFrame((()=>Ce(e,!1)))}),[te,H,be]);(0,C.Gw)((()=>{if(ae)return;if(!we)return;if(!Ae)return;const e=ee.current;Ce(e)}),[ae,we,re,Ae,Ce]),(0,I.useEffect)((()=>{if(!we)return;if(!Ae)return;const e=ee.current;return()=>Ce(e)}),[we,Ae,Ce]);const Ee=(0,C.yl)(b);(0,I.useEffect)((()=>{if(re&&le)return(0,j.iN)("keydown",(e=>{if("Escape"!==e.key)return;if(e.defaultPrevented)return;const t=ee.current;if(!t)return;if(y(t))return;const n=e.target;if(!n)return;const{disclosureElement:r}=te.getState();("BODY"===n.tagName||(0,c.r3)(t,n)||!r||(0,c.r3)(r,n))&&Ee(e)&&te.hide()}),!0)}),[te,re,le,Ee]);const Ie=(Y=(0,C.OJ)(Y,(e=>(0,_.jsx)(Q,{level:p?1:void 0,children:e})),[p])).hidden,_e=Y.alwaysVisible;Y=(0,C.OJ)(Y,(e=>m?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(x,{store:te,backdrop:m,backdropProps:A,hidden:Ie,alwaysVisible:_e}),e]}):e),[te,m,A,Ie,_e]);const[xe,Pe]=(0,I.useState)(),[ke,Be]=(0,I.useState)();return Y=(0,C.OJ)(Y,(e=>(0,_.jsx)(Z.Q9,{value:te,children:(0,_.jsx)(Z.oE.Provider,{value:Pe,children:(0,_.jsx)(Z.iw.Provider,{value:Be,children:e})})})),[te]),Y=(0,E.EZ)((0,E.ih)({id:se,"data-dialog":"",role:"dialog",tabIndex:d?-1:void 0,"aria-labelledby":xe,"aria-describedby":ke},Y),{ref:(0,C.qq)(ee,Y.ref)}),Y=R((0,E.EZ)((0,E.ih)({},Y),{autoFocusOnShow:ye})),Y=(0,w.fM)((0,E.ih)({store:te},Y)),Y=(0,W.k)((0,E.EZ)((0,E.ih)({},Y),{focusable:d})),z((0,E.EZ)((0,E.ih)({portal:g},Y),{portalRef:ne,preserveTabOrder:oe}))}));function te(e,t=Z.pQ){return(0,A.LM)((n=>{const r=t(),i=n.store||r;return(0,J.Kw)(i,(e=>!n.unmountOnHide||(null==e?void 0:e.mounted)||!!n.open))?(0,_.jsx)(e,(0,E.ih)({},n)):null}))}var ne=te((0,A.LM)((e=>{const t=ee(e);return(0,A.az)("div",t)})),Z.pQ)},16902:(e,t,n)=>{"use strict";n.d(t,{r:()=>c});var r=n(46462),i=n(6236),o=n(14191),s=n(81548),a=n(40077);function l(e={}){var t;const n=null==(t=e.store)?void 0:t.getState();return(0,o.t)((0,a.EZ)((0,a.ih)({},e),{orientation:(0,s.LS)(e.orientation,null==n?void 0:n.orientation,"horizontal"),focusLoop:(0,s.LS)(e.focusLoop,null==n?void 0:n.focusLoop,!0)}))}function c(e={}){const[t,n]=(0,i.oR)(l,e);return function(e,t,n){return(0,r.b)(e,t,n)}(t,n,e)}},27177:(e,t,n)=>{"use strict";n.d(t,{R:()=>r});var r=(0,n(2784).createContext)(!0)},22457:(e,t,n)=>{"use strict";n.d(t,{M:()=>a,n:()=>s});var r=n(6236),i=n(48104),o=n(17122);function s(e,t,n){return(0,i.rf)(t,[n.store,n.disclosure]),(0,r.XS)(e,n,"open","setOpen"),(0,r.XS)(e,n,"mounted","setMounted"),(0,r.XS)(e,n,"animated"),e}function a(e={}){const[t,n]=(0,r.oR)(o.X,e);return s(t,n,e)}},20656:(e,t,n)=>{"use strict";n.d(t,{VZ:()=>a,h9:()=>o,zI:()=>s});var r=n(9587),i=(0,n(45010).re)([r.Lq],[r.al]),o=i.useContext,s=(i.useScopedContext,i.useProviderContext),a=(i.ContextProvider,i.ScopedContextProvider)},19922:(e,t,n)=>{"use strict";n.d(t,{$M:()=>s,P9:()=>o,WS:()=>a});var r=n(59412),i=(0,n(45010).re)([r.qo],[r.ZQ]),o=(i.useContext,i.useScopedContext,i.useProviderContext),s=i.ContextProvider,a=i.ScopedContextProvider},25729:(e,t,n)=>{"use strict";n.d(t,{E:()=>g,m:()=>f});var r=n(75248),i=n(9460),o=n(38346),s=n(10114),a=n(45010),l=n(48104),c=n(70604),u=n(2784),d=n(99224),h=n(81548),p=n(52322),f=(0,a.Bi)((e=>{var t=e,{store:n,resetOnEscape:a=!0,hideOnEnter:f=!0,focusOnMove:g=!0,composite:m,alwaysVisible:y}=t,v=(0,c.S0)(t,["store","resetOnEscape","hideOnEnter","focusOnMove","composite","alwaysVisible"]);const A=(0,i.ht)();n=n||A,(0,h.kG)(n,!1);const b=(0,u.useRef)(null),w=(0,l.Me)(v.id),S=n.useState("value"),C=Array.isArray(S),[E,I]=(0,u.useState)(S),_=n.useState("mounted");(0,u.useEffect)((()=>{_||I(S)}),[_,S]),a=a&&!C;const x=v.onKeyDown,P=(0,l.yl)(a),k=(0,l.yl)(f),B=(0,l.zX)((e=>{null==x||x(e),e.defaultPrevented||("Escape"===e.key&&P(e)&&(null==n||n.setValue(E))," "!==e.key&&"Enter"!==e.key||(0,d.Ud)(e)&&k(e)&&(e.preventDefault(),null==n||n.hide()))}));v=(0,l.OJ)(v,(e=>(0,p.jsx)(i.jC,{value:n,children:e})),[n]);const O=n.useState((e=>{var t;return null==(t=e.labelElement)?void 0:t.id})),N=!!n.combobox;(m=null!=m?m:!N)&&(v=(0,c.ih)({role:"listbox"},v));const D=(0,l.vv)(b,"role",v.role),j=(m||"listbox"===D||"menu"===D||"tree"===D||"grid"===D)&&C||void 0,T=(0,s.xj)(_,v.hidden,y),M=T?(0,c.EZ)((0,c.ih)({},v.style),{display:"none"}):v.style;return v=(0,c.EZ)((0,c.ih)({id:w,"aria-labelledby":O,"aria-multiselectable":j,hidden:T},v),{ref:(0,l.qq)(w?n.setContentElement:null,b,v.ref),style:M,onKeyDown:B}),v=(0,o.Q)((0,c.EZ)((0,c.ih)({store:n},v),{composite:m})),(0,r.p)((0,c.ih)({store:n,typeahead:!N},v))})),g=(0,a.LM)((e=>{const t=f(e);return(0,a.az)("div",t)}))},73026:(e,t,n)=>{"use strict";n.d(t,{M$:()=>l,Vo:()=>c,XT:()=>h,du:()=>d,lK:()=>u});var r=n(9587),i=n(59412),o=n(45010),s=n(2784),a=(0,o.re)([i.qo,r.Lq],[i.ZQ,r.al]),l=(a.useContext,a.useScopedContext),c=a.useProviderContext,u=(a.ContextProvider,a.ScopedContextProvider),d=(0,s.createContext)(void 0),h=(0,s.createContext)(!1)},43198:(e,t,n)=>{"use strict";n.d(t,{Yx:()=>a,dG:()=>l,k$:()=>s});var r=n(70604),i=n(2784),o=n(81548);function s(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function a(e){return function(e){return!!e&&!!(0,i.isValidElement)(e)&&"ref"in e}(e)?e.ref:null}function l(e,t){const n=(0,r.ih)({},e);for(const i in t){if(!(0,o.nr)(t,i))continue;if("className"===i){const r="className";n[r]=e[r]?`${e[r]} ${t[r]}`:t[r];continue}if("style"===i){const i="style";n[i]=e[i]?(0,r.ih)((0,r.ih)({},e[i]),t[i]):t[i];continue}const s=t[i];if("function"==typeof s&&i.startsWith("on")){const t=e[i];if("function"==typeof t){n[i]=(...e)=>{s(...e),t(...e)};continue}}n[i]=s}return n}},74018:(e,t,n)=>{"use strict";n.d(t,{E:()=>A});var r=n(13271),i=n(75235),o=n(45010),s=n(48104),a=n(70604),l=n(2784),c=n(81548),u=(0,o.Bi)((e=>{var t=e,{store:n,shouldRegisterItem:r=!0,getItem:o=c.yR,element:u}=t,d=(0,a.S0)(t,["store","shouldRegisterItem","getItem","element"]);const h=(0,i.dI)();n=n||h;const p=(0,s.Me)(d.id),f=(0,l.useRef)(u);return(0,l.useEffect)((()=>{const e=f.current;if(!p)return;if(!e)return;if(!r)return;const t=o({id:p,element:e});return null==n?void 0:n.renderItem(t)}),[p,r,o,n]),(0,a.EZ)((0,a.ih)({},d),{ref:(0,s.qq)(f,d.ref)})}));(0,o.LM)((e=>{const t=u(e);return(0,o.az)("div",t)}));var d=n(79225),h=n(9587),p=n(6236),f=n(10244),g=n(99224),m=n(52322);function y(e,t=!1){const{top:n}=e.getBoundingClientRect();return t?n+e.clientHeight:n}function v(e,t,n,r=!1){var i;if(!t)return;if(!n)return;const{renderedItems:o}=t.getState(),s=(0,f.wy)(e);if(!s)return;const a=function(e,t=!1){const n=e.clientHeight,{top:r}=e.getBoundingClientRect(),i=1.5*Math.max(.875*n,n-40),o=t?n-i+r:i+r;return"HTML"===e.tagName?o+e.scrollTop:o}(s,r);let l,c;for(let e=0;e<o.length;e+=1){const o=l;if(l=n(e),!l)break;if(l===o)continue;const s=null==(i=(0,d.D2)(t,l))?void 0:i.element;if(!s)continue;const u=y(s,r)-a,h=Math.abs(u);if(r&&u<=0||!r&&u>=0){void 0!==c&&c<h&&(l=o);break}c=h}return l}var A=(0,o.Bi)((e=>{var t=e,{store:n,rowId:i,preventScrollOnKeyDown:o=!1,moveOnKeyPress:y=!0,tabbable:A=!1,getItem:b,"aria-setsize":w,"aria-posinset":S}=t,C=(0,a.S0)(t,["store","rowId","preventScrollOnKeyDown","moveOnKeyPress","tabbable","getItem","aria-setsize","aria-posinset"]);const E=(0,h.$)();n=n||E;const I=(0,s.Me)(C.id),_=(0,l.useRef)(null),x=(0,l.useContext)(h.Ft),P=(0,p.Kw)(n,(e=>i||(e&&(null==x?void 0:x.baseElement)&&x.baseElement===e.baseElement?x.id:void 0))),k=(0,c.EE)(C)&&!C.accessibleWhenDisabled,B=(0,l.useCallback)((e=>{const t=(0,a.EZ)((0,a.ih)({},e),{id:I||e.id,rowId:P,disabled:!!k});return b?b(t):t}),[I,P,k,b]),O=C.onFocus,N=(0,l.useRef)(!1),D=(0,s.zX)((e=>{if(null==O||O(e),e.defaultPrevented)return;if((0,g.Ke)(e))return;if(!I)return;if(!n)return;const{activeId:t,virtualFocus:r,baseElement:i}=n.getState();var o;(function(e,t){return!(0,g.Ud)(e)&&(0,d.Gh)(t,e.target)})(e,n)||(t!==I&&n.setActiveId(I),r&&(0,g.Ud)(e)&&((o=e.currentTarget).isContentEditable||(0,f.eS)(o)||"INPUT"===o.tagName&&!(0,f.iK)(o)||i&&(N.current=!0,e.relatedTarget===i||(0,d.Gh)(n,e.relatedTarget)?(0,d.tt)(i):i.focus())))})),j=C.onBlurCapture,T=(0,s.zX)((e=>{if(null==j||j(e),e.defaultPrevented)return;const t=null==n?void 0:n.getState();(null==t?void 0:t.virtualFocus)&&N.current&&(N.current=!1,e.preventDefault(),e.stopPropagation())})),M=C.onKeyDown,F=(0,s.yl)(o),R=(0,s.yl)(y),L=(0,s.zX)((e=>{if(null==M||M(e),e.defaultPrevented)return;if(!(0,g.Ud)(e))return;if(!n)return;const{currentTarget:t}=e,r=n.getState(),i=n.item(I),o=!!(null==i?void 0:i.rowId),s="horizontal"!==r.orientation,a="vertical"!==r.orientation,l={ArrowUp:(o||s)&&n.up,ArrowRight:(o||a)&&n.next,ArrowDown:(o||s)&&n.down,ArrowLeft:(o||a)&&n.previous,Home:()=>!o||e.ctrlKey?null==n?void 0:n.first():null==n?void 0:n.previous(-1),End:()=>!o||e.ctrlKey?null==n?void 0:n.last():null==n?void 0:n.next(-1),PageUp:()=>v(t,n,null==n?void 0:n.up,!0),PageDown:()=>v(t,n,null==n?void 0:n.down)}[e.key];if(l){const t=l();if(F(e)||void 0!==t){if(!R(e))return;e.preventDefault(),n.move(t)}}})),Q=(0,p.Kw)(n,(e=>(null==e?void 0:e.baseElement)||void 0)),U=(0,l.useMemo)((()=>({id:I,baseElement:Q})),[I,Q]);C=(0,s.OJ)(C,(e=>(0,m.jsx)(h.xt.Provider,{value:U,children:e})),[U]);const V=(0,p.Kw)(n,(e=>!!e&&e.activeId===I)),K=(0,p.Kw)(n,"virtualFocus"),H=function(e,t){const n=t.role,[r,i]=(0,l.useState)(n);return(0,s.Gw)((()=>{const t=e.current;t&&i(t.getAttribute("role")||n)}),[n]),r}(_,C);let G;V&&(function(e){return"option"===e||"treeitem"===e}(H)||K&&function(e){return"option"===e||"tab"===e||"treeitem"===e||"gridcell"===e||"row"===e||"columnheader"===e||"rowheader"===e}(H))&&(G=!0);const Y=(0,p.Kw)(n,(e=>null!=w?w:e&&(null==x?void 0:x.ariaSetSize)&&x.baseElement===e.baseElement?x.ariaSetSize:void 0)),z=(0,p.Kw)(n,(e=>{if(null!=S)return S;if(!e)return;if(!(null==x?void 0:x.ariaPosInSet))return;if(x.baseElement!==e.baseElement)return;const t=e.renderedItems.filter((e=>e.rowId===P));return x.ariaPosInSet+t.findIndex((e=>e.id===I))})),Z=(0,p.Kw)(n,(e=>!(null==e?void 0:e.renderedItems.length)||!e.virtualFocus&&(!!A||e.activeId===I)));return C=(0,a.EZ)((0,a.ih)({id:I,"aria-selected":G,"data-active-item":V?"":void 0},C),{ref:(0,s.qq)(_,C.ref),tabIndex:Z?C.tabIndex:-1,onFocus:D,onBlurCapture:T,onKeyDown:L}),C=(0,r.Y)(C),C=u((0,a.EZ)((0,a.ih)({store:n},C),{getItem:B,shouldRegisterItem:!!I&&C.shouldRegisterItem})),(0,a.EZ)((0,a.ih)({},C),{"aria-setsize":Y,"aria-posinset":z})}));(0,o.W5)((e=>{const t=A(e);return(0,o.az)("button",t)}))},60750:(e,t,n)=>{"use strict";n.d(t,{l:()=>m});var r=n(51329),i=n(73026),o=n(74018),s=n(45010),a=n(48104),l=n(70604),c=n(2784),u=n(10244),d=n(99224),h=n(15212),p=n(81548),f=n(52322),g=(0,s.Bi)((e=>{var t=e,{store:n,value:s,hideOnClick:g,selectValueOnClick:m=!0,setValueOnClick:y,focusOnHover:v=!1,moveOnKeyPress:A=!0,getItem:b}=t,w=(0,l.S0)(t,["store","value","hideOnClick","selectValueOnClick","setValueOnClick","focusOnHover","moveOnKeyPress","getItem"]);const S=(0,i.M$)();n=n||S,(0,p.kG)(n,!1);const C=(0,c.useCallback)((e=>{const t=(0,l.EZ)((0,l.ih)({},e),{value:s});return b?b(t):t}),[s,b]),E=n.useState((e=>Array.isArray(e.selectedValue)));y=null!=y?y:!E,g=null!=g?g:null!=s&&!E;const I=w.onClick,_=(0,a.yl)(y),x=(0,a.yl)(m),P=(0,a.yl)(g),k=(0,a.zX)((e=>{null==I||I(e),e.defaultPrevented||(0,d.XN)(e)||(0,d.wC)(e)||(null!=s&&(x(e)&&(null==n||n.setSelectedValue((e=>Array.isArray(e)?e.includes(s)?e.filter((e=>e!==s)):[...e,s]:s))),_(e)&&(null==n||n.setValue(s))),P(e)&&(null==n||n.move(null),null==n||n.hide()))})),B=w.onKeyDown,O=(0,a.zX)((e=>{if(null==B||B(e),e.defaultPrevented)return;const t=null==n?void 0:n.getState().baseElement;t&&((0,h.H1)(t)||(1===e.key.length||"Backspace"===e.key||"Delete"===e.key)&&(queueMicrotask((()=>t.focus())),(0,u.eS)(t)&&(null==n||n.setValue(t.value))))})),N=n.useState((e=>function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)}(e.selectedValue,s)));E&&null!=N&&(w["aria-selected"]=N),w=(0,a.OJ)(w,(e=>(0,f.jsx)(i.du.Provider,{value:s,children:(0,f.jsx)(i.XT.Provider,{value:null!=N&&N,children:e})})),[s,N]);const D=n.useState("contentElement");w=(0,l.EZ)((0,l.ih)({role:(0,u.lQ)(D),children:s},w),{onClick:k,onKeyDown:O});const j=(0,a.yl)(A);return w=(0,o.E)((0,l.EZ)((0,l.ih)({store:n},w),{getItem:C,moveOnKeyPress:e=>{if(!j(e))return!1;const t=new Event("combobox-item-move"),r=null==n?void 0:n.getState().baseElement;return null==r||r.dispatchEvent(t),!0}})),(0,r.B)((0,l.ih)({store:n,focusOnHover:v},w))})),m=(0,s.W5)((e=>{const t=g(e);return(0,s.az)("div",t)}))},51626:(e,t,n)=>{"use strict";n.d(t,{S:()=>v});var r=n(73026),i=n(10114),o=n(43670),s=n(45010),a=n(48104),l=n(70604),c=n(2784),u=n(99224),d=n(81548),h=n(52322),p=(0,s.Bi)((e=>{var t=e,{store:n,focusable:s=!0,alwaysVisible:p}=t,f=(0,l.S0)(t,["store","focusable","alwaysVisible"]);const g=(0,r.Vo)();n=n||g,(0,d.kG)(n,!1);const m=(0,c.useRef)(null),y=(0,a.Me)(f.id),v=f.onKeyDown,A=(0,a.zX)((e=>{null==v||v(e),e.defaultPrevented||"Escape"===e.key&&(null==n||n.move(null))})),b=(0,c.useRef)(!1),w=f.onFocusVisible,S=(0,a.zX)((e=>{if(null==w||w(e),e.defaultPrevented)return;if("focus"!==e.type)return;if(!n)return;const{virtualFocus:t}=n.getState();if(!t)return;const{relatedTarget:r,currentTarget:i}=e;r&&i.contains(r)||(b.current=!0,n.setState("virtualFocus",!1))})),C=f.onBlur,E=(0,a.zX)((e=>{null==C||C(e),e.defaultPrevented||b.current&&(0,u.N)(e)&&(b.current=!1,null==n||n.setState("virtualFocus",!0))}));f=(0,a.OJ)(f,(e=>(0,h.jsx)(r.lK,{value:n,children:e})),[n]);const I=n.useState("mounted"),_=(0,i.xj)(I,f.hidden,p),x=_?(0,l.EZ)((0,l.ih)({},f.style),{display:"none"}):f.style,P=n.useState((e=>Array.isArray(e.selectedValue))),k=(0,a.vv)(m,"role",f.role),B=("listbox"===k||"tree"===k||"grid"===k)&&P||void 0;return f=(0,l.EZ)((0,l.ih)({id:y,hidden:_,role:"listbox",tabIndex:s?-1:void 0,"aria-multiselectable":B},f),{ref:(0,a.qq)(y?n.setContentElement:null,m,f.ref),style:x,onKeyDown:A,onFocusVisible:S,onBlur:E}),(0,o.k)((0,l.ih)({focusable:s},f))}));(0,s.LM)((e=>{const t=p(e);return(0,s.az)("div",t)}));var f=n(83222),g=n(56278),m=n(10244),y=(0,s.Bi)((e=>{var t=e,{store:n,tabIndex:i,alwaysVisible:o,hideOnInteractOutside:s=!0}=t,a=(0,l.S0)(t,["store","tabIndex","alwaysVisible","hideOnInteractOutside"]);const c=(0,r.Vo)();n=n||c,(0,d.kG)(n,!1);const u=n.useState("baseElement");return a=p((0,l.ih)({store:n,alwaysVisible:o},a)),(0,f.S)((0,l.EZ)((0,l.ih)({store:n,alwaysVisible:o,autoFocusOnShow:!1,autoFocusOnHide:!1,finalFocus:u,preserveTabOrderAnchor:null},a),{modal:!1,hideOnInteractOutside:e=>{var t,r;const i=null==n?void 0:n.getState(),o=null==(t=null==i?void 0:i.contentElement)?void 0:t.id,a=null==(r=null==i?void 0:i.baseElement)?void 0:r.id;return!function(e,...t){if(!e)return!1;if("id"in e){const n=t.filter(Boolean).map((e=>`[aria-controls="${e}"]`)).join(", ");return!!n&&(0,m.wB)(e,n)}return!1}(e.target,o,a)&&("function"==typeof s?s(e):s)}}))})),v=(0,g.L5)((0,s.LM)((e=>{const t=y(e);return(0,s.az)("div",t)})),r.Vo)},32819:(e,t,n)=>{"use strict";n.d(t,{h:()=>v});var r=n(43965),i=n(73026),o=n(38346),s=n(45010),a=n(48104),l=n(70604),c=n(2784),u=n(10244),d=n(99224),h=n(15212),p=n(81548),f=n(28316);function g(e,t,n){if(!n)return!1;const r=e.find((e=>!e.disabled&&e.value));return(null==r?void 0:r.value)===t}function m(e,t){return!!t&&null!=e&&(e=(0,p.Ue)(e),t.length>e.length&&0===t.toLowerCase().indexOf(e.toLowerCase()))}var y=(0,s.Bi)((e=>{var t=e,{store:n,focusable:s=!0,autoSelect:y=!1,showOnChange:v=!0,setValueOnChange:A=!0,showOnMouseDown:b=!0,setValueOnClick:w=!0,showOnKeyDown:S=!0,moveOnKeyPress:C=!0,autoComplete:E="list"}=t,I=(0,l.S0)(t,["store","focusable","autoSelect","showOnChange","setValueOnChange","showOnMouseDown","setValueOnClick","showOnKeyDown","moveOnKeyPress","autoComplete"]);const _=(0,i.Vo)();n=n||_,(0,p.kG)(n,!1);const x=(0,c.useRef)(null),[P,k]=(0,a.NW)(),B=(0,c.useRef)(!1),O=(0,c.useRef)(!1),N=n.useState((e=>!!y&&e.virtualFocus)),D="inline"===E||"both"===E,[j,T]=(0,c.useState)(D);(0,a.is)((()=>{D&&T(!0)}),[D]);const M=n.useState("value"),F=n.useState((e=>D&&j?e.activeValue:void 0)),R=n.useState("renderedItems"),L=n.useState("open"),Q=n.useState("contentElement"),U=(0,c.useMemo)((()=>{if(!D)return M;if(!j)return M;if(g(R,F,N)){if(m(M,F)){const e=(null==F?void 0:F.slice(M.length))||"";return M+e}return M}return F||M}),[D,j,R,F,N,M]);(0,c.useEffect)((()=>{const e=x.current;if(!e)return;const t=()=>T(!0);return e.addEventListener("combobox-item-move",t),()=>{e.removeEventListener("combobox-item-move",t)}}),[]),(0,c.useEffect)((()=>{D&&j&&F&&g(R,F,N)&&m(M,F)&&queueMicrotask((()=>{const e=x.current;e&&(0,u.AU)(e,M.length,F.length)}))}),[P,D,j,F,R,N,M]);const V=(0,c.useRef)(null);(0,c.useEffect)((()=>{if(!L)return;if(!Q)return;const e=(0,u.wy)(Q);if(!e)return;V.current=e;const t=()=>{B.current=!1},r=()=>{if(!n)return;const{activeId:e}=n.getState();null!==e&&e!==n.first()&&(B.current=!1)},i={passive:!0,capture:!0};return e.addEventListener("wheel",t,i),e.addEventListener("scroll",r,i),()=>{e.removeEventListener("wheel",t,!0),e.removeEventListener("scroll",r,!0)}}),[L,Q,n]),(0,a.Gw)((()=>{M&&(O.current||(B.current=!0))}),[M]),(0,a.Gw)((()=>{L||(B.current=!1)}),[L]);const K=n.useState("resetValueOnSelect");(0,a.rf)((()=>{var e,t;if(!n)return;if(!N&&!K)return;if(!B.current)return;const{baseElement:r,contentElement:i,activeId:o}=n.getState();if(!r||(0,h.H1)(r)){if(null==i?void 0:i.hasAttribute("data-placing")){const e=new MutationObserver(k);return e.observe(i,{attributeFilter:["data-placing"]}),()=>e.disconnect()}if(N)n.move(null!=(e=n.first())?e:null);else{const e=null==(t=n.item(o))?void 0:t.element;e&&"scrollIntoView"in e&&e.scrollIntoView({block:"nearest",inline:"nearest"})}}}),[n,P,M,N,K,R]),(0,c.useEffect)((()=>{if(!D)return;const e=x.current;if(!e)return;const t=[e,Q].filter((e=>!!e)),r=e=>{t.every((t=>(0,d.N)(e,t)))&&(null==n||n.setValue(U))};return t.forEach((e=>e.addEventListener("focusout",r))),()=>{t.forEach((e=>e.removeEventListener("focusout",r)))}}),[D,Q,n,U]);const H=I.onChange,G=(0,a.yl)(v),Y=(0,a.yl)(A),z=(0,a.zX)((e=>{if(null==H||H(e),e.defaultPrevented)return;if(!n)return;const{value:t,selectionStart:r,selectionEnd:i}=e.target,o=e.nativeEvent;if(B.current=!0,function(e){return"input"===e.type}(o)&&(o.isComposing&&(B.current=!1,O.current=!0),D)){const e="insertText"===o.inputType||"insertCompositionText"===o.inputType,n=r===t.length;T(e&&n)}if(Y(e)){const o=t===n.getState().value;(0,f.flushSync)((()=>null==n?void 0:n.setValue(t))),(0,u.AU)(e.currentTarget,r,i),D&&N&&o&&k()}G(e)&&n.show(),N&&B.current||n.setActiveId(null)})),Z=I.onCompositionEnd,W=(0,a.zX)((e=>{B.current=!0,O.current=!1,null==Z||Z(e),e.defaultPrevented||N&&k()})),q=I.onMouseDown,J=(0,a.yl)(w),X=(0,a.yl)(b),$=(0,a.zX)((e=>{null==q||q(e),e.defaultPrevented||e.button||e.ctrlKey||n&&(n.setActiveId(null),J(e)&&n.setValue(U),X(e)&&(0,d.qx)(e.currentTarget,"mouseup",n.show))})),ee=I.onKeyDown,te=(0,a.yl)(S),ne=(0,a.zX)((e=>{if(null==ee||ee(e),e.defaultPrevented)return;if(e.ctrlKey)return;if(e.altKey)return;if(e.shiftKey)return;if(e.metaKey)return;if(!n)return;const{open:t,activeId:r}=n.getState();t||null===r&&("ArrowUp"!==e.key&&"ArrowDown"!==e.key||te(e)&&(e.preventDefault(),n.show()))})),re=I.onBlur,ie=(0,a.zX)((e=>{B.current=!1,null==re||re(e),e.defaultPrevented})),oe=(0,a.Me)(I.id),se=function(e){return"inline"===e||"list"===e||"both"===e||"none"===e}(E)?E:void 0;return I=(0,l.EZ)((0,l.ih)({id:oe,role:"combobox","aria-autocomplete":se,"aria-haspopup":(0,u.SK)(Q,"listbox"),"aria-expanded":L,"aria-controls":null==Q?void 0:Q.id,value:U},I),{ref:(0,a.qq)(x,I.ref),onChange:z,onCompositionEnd:W,onMouseDown:$,onKeyDown:ne,onBlur:ie}),I=(0,o.Q)((0,l.EZ)((0,l.ih)({store:n,focusable:s},I),{moveOnKeyPress:e=>!(0,p.Bk)(C,e)&&(D&&T(!0),!0)})),I=(0,r.Q)((0,l.ih)({store:n},I)),(0,l.ih)({autoComplete:"off"},I)})),v=(0,s.LM)((e=>{const t=y(e);return(0,s.az)("input",t)}))},57996:(e,t,n)=>{"use strict";n.d(t,{Q:()=>g});var r=n(51329),i=n(9460),o=n(74018),s=n(45010),a=n(48104),l=n(70604),c=n(2784),u=n(10244),d=n(99224),h=n(81548),p=n(52322),f=(0,s.Bi)((e=>{var t,n=e,{store:s,value:f,getItem:g,hideOnClick:m,setValueOnClick:y=null!=f,preventScrollOnKeyDown:v=!0,focusOnHover:A=!0}=n,b=(0,l.S0)(n,["store","value","getItem","hideOnClick","setValueOnClick","preventScrollOnKeyDown","focusOnHover"]);const w=(0,i.EB)();s=s||w,(0,h.kG)(s,!1);const S=(0,a.Me)(b.id),C=(0,h.EE)(b),E=(0,c.useCallback)((e=>{const t=(0,l.EZ)((0,l.ih)({},e),{value:C?void 0:f,children:f});return g?g(t):t}),[C,f,g]),I=s.useState((e=>Array.isArray(e.value)));m=null!=m?m:null!=f&&!I;const _=b.onClick,x=(0,a.yl)(y),P=(0,a.yl)(m),k=(0,a.zX)((e=>{null==_||_(e),e.defaultPrevented||(0,d.XN)(e)||(0,d.wC)(e)||(x(e)&&null!=f&&(null==s||s.setValue((e=>Array.isArray(e)?e.includes(f)?e.filter((e=>e!==f)):[...e,f]:f))),P(e)&&(null==s||s.hide()))})),B=s.useState((e=>function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)}(e.value,f)));b=(0,a.OJ)(b,(e=>(0,p.jsx)(i.bq.Provider,{value:null!=B&&B,children:e})),[B]);const O=s.useState("contentElement"),N=s.useState((e=>(e.activeId===S||!(null==s?void 0:s.item(e.activeId)))&&null!=e.value&&null!=f&&(Array.isArray(e.value)?e.value[e.value.length-1]===f:e.value===f)));b=(0,l.EZ)((0,l.ih)({id:S,role:(0,u.lQ)(O),"aria-selected":B,children:f},b),{autoFocus:null!=(t=b.autoFocus)?t:N,onClick:k}),b=(0,o.E)((0,l.ih)({store:s,getItem:E,preventScrollOnKeyDown:v},b));const D=(0,a.yl)(A);return(0,r.B)((0,l.EZ)((0,l.ih)({store:s},b),{focusOnHover:e=>{if(!D(e))return!1;const t=null==s?void 0:s.getState();return!!(null==t?void 0:t.open)}}))})),g=(0,s.W5)((e=>{const t=f(e);return(0,s.az)("div",t)}))},2363:(e,t,n)=>{"use strict";n.d(t,{P:()=>C});var r=n(89776),i=n(58915),o=n(45010),s=n(70604),a=n(10244),l=n(81548),c=(0,o.Bi)((e=>{var t=e,{store:n}=t,o=(0,s.S0)(t,["store"]);const c=(0,i.pQ)();n=n||c,(0,l.kG)(n,!1);const u=n.useState("contentElement");return o=(0,s.ih)({"aria-haspopup":(0,a.SK)(u,"dialog")},o),(0,r.q)((0,s.ih)({store:n},o))}));(0,o.LM)((e=>{const t=c(e);return(0,o.az)("button",t)}));var u=n(43965),d=n(59412),h=n(48104),p=n(52322),f=(0,o.Bi)((e=>{var t=e,{store:n}=t,r=(0,s.S0)(t,["store"]);const i=(0,d.yL)();n=n||i,(0,l.kG)(n,!1);const o=r.onClick,a=(0,h.zX)((e=>{null==n||n.setAnchorElement(e.currentTarget),null==o||o(e)}));return r=(0,h.OJ)(r,(e=>(0,p.jsx)(d.ZQ,{value:n,children:e})),[n]),r=(0,s.EZ)((0,s.ih)({},r),{onClick:a}),r=(0,u.Q)((0,s.ih)({store:n},r)),c((0,s.ih)({store:n},r))}));(0,o.LM)((e=>{const t=f(e);return(0,o.az)("button",t)}));var g=n(15945),m=n(75248),y=n(9460),v=n(2784),A=n(23478),b=n(99224);function w(e,t){return()=>{const n=t();if(!n)return;let r=0,i=e.item(n);const o=i;for(;i&&null==i.value;){const n=t(++r);if(!n)return;if(i=e.item(n),i===o)break}return null==i?void 0:i.id}}var S=(0,o.Bi)((e=>{var t=e,{store:n,name:r,form:i,required:o,showOnKeyDown:c=!0,moveOnKeyDown:u=!0,toggleOnClick:d=!1,toggleOnPress:S=!d}=t,C=(0,s.S0)(t,["store","name","form","required","showOnKeyDown","moveOnKeyDown","toggleOnClick","toggleOnPress"]);const E=(0,y.ht)();n=n||E,(0,l.kG)(n,!1),S=!d&&S;const I=C.onKeyDown,_=(0,h.yl)(c),x=(0,h.yl)(u),P=(0,h.yl)(S),k=n.useState("placement").split("-")[0],B=n.useState("value"),O=Array.isArray(B),N=(0,h.zX)((e=>{var t;if(null==I||I(e),e.defaultPrevented)return;if(!n)return;const{orientation:r,items:i,activeId:o}=n.getState();" "!==e.key&&"Enter"!==e.key||P(e)&&(e.preventDefault(),n.toggle());const s="horizontal"!==r,a="vertical"!==r,l=!!(null==(t=i.find((e=>!e.disabled&&null!=e.value)))?void 0:t.rowId),c={ArrowUp:(l||s)&&w(n,n.up),ArrowRight:(l||a)&&w(n,n.next),ArrowDown:(l||s)&&w(n,n.down),ArrowLeft:(l||a)&&w(n,n.previous)}[e.key];c&&x(e)&&(e.preventDefault(),n.move(c()));const u="top"===k||"bottom"===k;({ArrowDown:u,ArrowUp:u,ArrowLeft:"left"===k,ArrowRight:"right"===k})[e.key]&&_(e)&&(e.preventDefault(),n.show(),n.move(o))})),D=C.onMouseDown,j=(0,h.zX)((e=>{if(null==D||D(e),e.defaultPrevented)return;if(e.button)return;if(e.ctrlKey)return;if(!P(e))return;const t=e.currentTarget;(0,b.qx)(t,"focusin",(()=>{null==n||n.setDisclosureElement(t),null==n||n.toggle()}))}));C=(0,h.OJ)(C,(e=>(0,p.jsx)(y.jC,{value:n,children:e})),[n]);const[T,M]=(0,v.useState)(!1),F=(0,v.useRef)(!1);(0,v.useEffect)((()=>{const e=F.current;F.current=!1,e||M(!1)}),[B]);const R=n.useState((e=>{var t;return null==(t=e.labelElement)?void 0:t.id})),L=C["aria-label"],Q=C["aria-labelledby"]||R,U=n.useState("items"),V=(0,v.useMemo)((()=>[...new Set(U.map((e=>e.value)).filter((e=>null!=e)))]),[U]);C=(0,h.OJ)(C,(e=>r?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("select",{style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},tabIndex:-1,"aria-hidden":!0,"aria-label":L,"aria-labelledby":Q,name:r,form:i,required:o,value:B,multiple:O,onFocus:()=>{var e;return null==(e=null==n?void 0:n.getState().selectElement)?void 0:e.focus()},onChange:e=>{var t;F.current=!0,M(!0),null==n||n.setValue(O?(t=e.target,Array.from(t.selectedOptions).map((e=>e.value))):e.target.value)},children:[(0,A.qo)(B).map((e=>null==e||V.includes(e)?null:(0,p.jsx)("option",{value:e,children:e},e))),V.map((e=>(0,p.jsx)("option",{value:e,children:e},e)))]}),e]}):e),[n,L,Q,r,i,o,B,O,V]);const K=(0,p.jsxs)(p.Fragment,{children:[B,(0,p.jsx)(g.n,{})]}),H=n.useState("contentElement");return C=(0,s.EZ)((0,s.ih)({role:"combobox","aria-autocomplete":"none","aria-labelledby":R,"aria-haspopup":(0,a.SK)(H,"listbox"),"data-autofill":T?"":void 0,"data-name":r,children:K},C),{ref:(0,h.qq)(n.setSelectElement,C.ref),onKeyDown:N,onMouseDown:j}),C=f((0,s.ih)({store:n,toggleOnClick:d},C)),(0,m.p)((0,s.ih)({store:n},C))})),C=(0,o.LM)((e=>{const t=S(e);return(0,o.az)("button",t)}))},39661:(e,t,n)=>{"use strict";n.d(t,{o:()=>d});var r=n(38346),i=n(16902),o=n(20656),s=n(45010),a=n(48104),l=n(70604),c=n(52322),u=(0,s.Bi)((e=>{var t=e,{store:n,orientation:s,virtualFocus:u,focusLoop:d,rtl:h}=t,p=(0,l.S0)(t,["store","orientation","virtualFocus","focusLoop","rtl"]);const f=(0,o.zI)();n=n||f;const g=(0,i.r)({store:n,orientation:s,virtualFocus:u,focusLoop:d,rtl:h}),m=g.useState((e=>"both"===e.orientation?void 0:e.orientation));return p=(0,a.OJ)(p,(e=>(0,c.jsx)(o.VZ,{value:g,children:e})),[g]),p=(0,l.ih)({role:"toolbar","aria-orientation":m},p),(0,r.Q)((0,l.ih)({store:g},p))})),d=(0,s.LM)((e=>{const t=u(e);return(0,s.az)("div",t)}))},36153:(e,t,n)=>{"use strict";n.d(t,{Ol:()=>d,Pe:()=>h,Wq:()=>A,dM:()=>Q,md:()=>b,o0:()=>S,r0:()=>w,wg:()=>u}),n(18476),n(18267),n(64883),n(55744),n(25031),n(54089),n(89651),n(81412),n(98513),n(93133),n(93980),n(80037),n(54422),n(63083),n(83701),n(6869);var r=n(31031),i=n(29016);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var o,s=(o=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o;const a=e=>null!=e&&window.Prism.languages.hasOwnProperty(e)?e:void 0;function l(e,t){for(const n of e.childNodes){if((0,r.Re)(n)&&n.tagName===t)return!0;l(n,t)}return!1}const c="data-highlight-language";class u extends r.HX{static getType(){return"code"}static clone(e){return new u(e.__language,e.__key)}constructor(e,t){super(t),this.__language=a(e)}createDOM(e){const t=document.createElement("code");(0,i.Yo)(t,e.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();return n&&t.setAttribute(c,n),t}updateDOM(e,t,n){const r=this.__language,i=e.__language;return r?r!==i&&t.setAttribute(c,r):i&&t.removeAttribute(c),!1}exportDOM(e){const t=document.createElement("pre");(0,i.Yo)(t,e._config.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();return n&&t.setAttribute(c,n),{element:t}}static importDOM(){return{code:e=>null!=e.textContent&&(/\r?\n/.test(e.textContent)||l(e,"BR"))?{conversion:p,priority:1}:null,div:()=>({conversion:f,priority:1}),pre:()=>({conversion:p,priority:0}),table:e=>v(e)?{conversion:g,priority:3}:null,td:e=>{const t=e,n=t.closest("table");return t.classList.contains("js-file-line")||n&&v(n)?{conversion:m,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&v(t)?{conversion:m,priority:3}:null}}}static importJSON(e){const t=d(e.language);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),type:"code",version:1}}insertNewAfter(e,t=!0){const n=this.getChildren(),i=n.length;if(i>=2&&"\n"===n[i-1].getTextContent()&&"\n"===n[i-2].getTextContent()&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===i){n[i-1].remove(),n[i-2].remove();const e=(0,r.BE)();return this.insertAfter(e,t),e}const{anchor:o,focus:s}=e,a=(o.isBefore(s)?o:s).getNode();if((0,r.Gg)(a)){let e=_(a);const t=[];for(;;)if((0,r.rc)(e))t.push((0,r.S3)()),e=e.getNextSibling();else{if(!I(e))break;{let n=0;const r=e.getTextContent(),i=e.getTextContentSize();for(;n<i&&" "===r[n];)n++;if(0!==n&&t.push(E(" ".repeat(n))),n!==i)break;e=e.getNextSibling()}}const n=a.splitText(o.offset)[0],i=0===o.offset?0:1,s=n.getIndexWithinParent()+i,l=a.getParentOrThrow(),c=[(0,r.T)(),...t];l.splice(s,0,c);const u=t[t.length-1];u?u.select():0===o.offset?n.selectPrevious():n.getNextSibling().selectNext(0,0)}if(h(a)){const{offset:t}=e.anchor;a.splice(t,0,[(0,r.T)()]),a.select(t+1,t+1)}return null}canIndent(){return!1}collapseAtStart(){const e=(0,r.BE)();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}setLanguage(e){this.getWritable().__language=a(e)}getLanguage(){return this.getLatest().__language}}function d(e){return(0,r.U2)(new u(e))}function h(e){return e instanceof u}function p(e){return{node:d(e.getAttribute(c))}}function f(e){const t=e,n=y(t);return n||function(e){let t=e.parentElement;for(;null!==t;){if(y(t))return!0;t=t.parentElement}return!1}(t)?{node:n?d():null}:{node:null}}function g(){return{node:d()}}function m(){return{node:null}}function y(e){return null!==e.style.fontFamily.match("monospace")}function v(e){return e.classList.contains("js-file-line-container")}const A={c:"C",clike:"C-like",cpp:"C++",css:"CSS",html:"HTML",java:"Java",js:"JavaScript",markdown:"Markdown",objc:"Objective-C",plain:"Plain Text",powershell:"PowerShell",py:"Python",rust:"Rust",sql:"SQL",swift:"Swift",typescript:"TypeScript",xml:"XML"},b={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function w(e){return b[e]||e}class S extends r.R2{constructor(e,t,n){super(e,n),this.__highlightType=t}static getType(){return"code-highlight"}static clone(e){return new S(e.__text,e.__highlightType||void 0,e.__key)}getHighlightType(){return this.getLatest().__highlightType}canHaveFormat(){return!1}createDOM(e){const t=super.createDOM(e),n=C(e.theme,this.__highlightType);return(0,i.Yo)(t,n),t}updateDOM(e,t,n){const r=super.updateDOM(e,t,n),o=C(n.theme,e.__highlightType),s=C(n.theme,this.__highlightType);return o!==s&&(o&&(0,i.PS)(t,o),s&&(0,i.Yo)(t,s)),r}static importJSON(e){const t=E(e.text,e.highlightType);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType(),type:"code-highlight",version:1}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return d()}}function C(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function E(e,t){return(0,r.U2)(new S(e,t))}function I(e){return e instanceof S}function _(e){let t=e,n=e;for(;I(n)||(0,r.rc)(n);)t=n,n=n.getPreviousSibling();return t}function x(e){let t=e,n=e;for(;I(n)||(0,r.rc)(n);)t=n,n=n.getNextSibling();return t}const P={defaultLanguage:"javascript",tokenize(e,t){return window.Prism.tokenize(e,window.Prism.languages[t||""]||window.Prism.languages[this.defaultLanguage])}};function k(e,t,n){const i=e.getParent();h(i)?N(i,t,n):I(e)&&e.replace((0,r.MX)(e.__text))}function B(e,t){const n=t.getElementByKey(e.getKey());if(null===n)return;const i=e.getChildren(),o=i.length;if(o===n.__cachedChildrenLength)return;n.__cachedChildrenLength=o;let s="1",a=1;for(let e=0;e<o;e++)(0,r.A3)(i[e])&&(s+="\n"+ ++a);n.setAttribute("data-gutter",s)}const O=new Set;function N(e,t,n){const i=e.getKey();O.has(i)||(O.add(i),void 0===e.getLanguage()&&e.setLanguage(n.defaultLanguage),t.update((()=>{!function(e,t){const n=(0,r.gI)(e);if(!h(n)||!n.isAttached())return;const i=(0,r.dL)();if(!(0,r.OP)(i))return void t();const o=i.anchor,s=o.offset,a="element"===o.type&&(0,r.A3)(n.getChildAtIndex(o.offset-1));let l=0;if(!a){const e=o.getNode();l=s+e.getPreviousSiblings().reduce(((e,t)=>e+t.getTextContentSize()),0)}t()&&(a?o.getNode().select(s,s):n.getChildren().some((e=>{const t=(0,r.Gg)(e);if(t||(0,r.A3)(e)){const n=e.getTextContentSize();if(t&&n>=l)return e.select(l,l),!0;l-=n}return!1})))}(i,(()=>{const t=(0,r.gI)(i);if(!h(t)||!t.isAttached())return!1;const o=t.getTextContent(),s=D(n.tokenize(o,t.getLanguage()||n.defaultLanguage)),a=function(e,t){let n=0;for(;n<e.length&&j(e[n],t[n]);)n++;const r=e.length,i=t.length,o=Math.min(r,i)-n;let s=0;for(;s<o;)if(s++,!j(e[r-s],t[i-s])){s--;break}const a=r-s;return{from:n,nodesForReplacement:t.slice(n,i-s),to:a}}(t.getChildren(),s),{from:l,to:c,nodesForReplacement:u}=a;return!(l===c&&!u.length||(e.splice(l,c-l,u),0))}))}),{onUpdate:()=>{O.delete(i)},skipTransforms:!0}))}function D(e,t){const n=[];for(const i of e)if("string"==typeof i){const e=i.split(/(\n|\t)/),o=e.length;for(let i=0;i<o;i++){const o=e[i];"\n"===o||"\r\n"===o?n.push((0,r.T)()):"\t"===o?n.push((0,r.S3)()):o.length>0&&n.push(E(o,t))}}else{const{content:e}=i;"string"==typeof e?n.push(...D([e],i.type)):Array.isArray(e)&&n.push(...D(e,i.type))}return n}function j(e,t){return I(e)&&I(t)&&e.__text===t.__text&&e.__highlightType===t.__highlightType||(0,r.rc)(e)&&(0,r.rc)(t)||(0,r.A3)(e)&&(0,r.A3)(t)}function T(e){if(!(0,r.OP)(e))return!1;const t=e.anchor.getNode(),n=e.focus.getNode();if(t.is(n)&&h(t))return!0;const i=t.getParent();return h(i)&&i.is(n.getParent())}function M(e){const t=e.getNodes(),n=[[]];if(1===t.length&&h(t[0]))return n;let i=n[0];for(let e=0;e<t.length;e++){const o=t[e];I(o)||(0,r.rc)(o)||(0,r.A3)(o)||s(169),(0,r.A3)(o)?0!==e&&i.length>0&&(i=[],n.push(i)):i.push(o)}return n}function F(e){const t=(0,r.dL)();if(!(0,r.OP)(t)||!T(t))return!1;const n=M(t),i=n.length;if(n.length>1){for(let t=0;t<i;t++){const i=n[t];if(i.length>0){let n=i[0];0===t&&(n=_(n)),null!==n&&(e===r.PU?n.insertBefore((0,r.S3)()):(0,r.rc)(n)&&n.remove())}}return!0}const o=t.getNodes()[0];if(h(o)||I(o)||(0,r.rc)(o)||(0,r.A3)(o)||s(171),h(o))return e===r.PU&&t.insertNodes([(0,r.S3)()]),!0;const a=_(o);return null===a&&s(172),e===r.PU?(0,r.A3)(a)?a.insertAfter((0,r.S3)()):a.insertBefore((0,r.S3)()):(0,r.rc)(a)&&a.remove(),!0}function R(e,t){const n=(0,r.dL)();if(!(0,r.OP)(n))return!1;const{anchor:i,focus:o}=n,s=i.offset,a=o.offset,l=i.getNode(),c=o.getNode(),u=e===r._0;if(!T(n)||!I(l)&&!(0,r.rc)(l)||!I(c)&&!(0,r.rc)(c))return!1;if(!t.altKey){if(n.isCollapsed()){const e=l.getParentOrThrow();if(u&&0===s&&null===l.getPreviousSibling()){if(null===e.getPreviousSibling())return e.selectPrevious(),t.preventDefault(),!0}else if(!u&&s===l.getTextContentSize()&&null===l.getNextSibling()&&null===e.getNextSibling())return e.selectNext(),t.preventDefault(),!0}return!1}let d,h;if(l.isBefore(c)?(d=_(l),h=x(c)):(d=_(c),h=x(l)),null==d||null==h)return!1;const p=d.getNodesBetween(h);for(let e=0;e<p.length;e++){const t=p[e];if(!I(t)&&!(0,r.rc)(t)&&!(0,r.A3)(t))return!1}t.preventDefault(),t.stopPropagation();const f=u?d.getPreviousSibling():h.getNextSibling();if(!(0,r.A3)(f))return!0;const g=u?f.getPreviousSibling():f.getNextSibling();if(null==g)return!0;const m=I(g)||(0,r.rc)(g)||(0,r.A3)(g)?u?_(g):x(g):null;let y=null!=m?m:g;return f.remove(),p.forEach((e=>e.remove())),e===r._0?(p.forEach((e=>y.insertBefore(e))),y.insertBefore(f)):(y.insertAfter(f),y=f,p.forEach((e=>{y.insertAfter(e),y=e}))),n.setTextNodeRange(l,s,c,a),!0}function L(e,t){const n=(0,r.dL)();if(!(0,r.OP)(n))return!1;const{anchor:i,focus:o}=n,a=i.getNode(),l=o.getNode(),c=e===r.OJ;if(!I(a)&&!(0,r.rc)(a)||!I(l)&&!(0,r.rc)(l))return!1;if(c){const e=function(e,t){let n=null,i=null,o=e,a=t,l=e.getTextContent();for(;;){if(0===a){if(o=o.getPreviousSibling(),null===o)break;if(I(o)||(0,r.rc)(o)||(0,r.A3)(o)||s(167),(0,r.A3)(o)){n={node:o,offset:1};break}a=Math.max(0,o.getTextContentSize()-1),l=o.getTextContent()}else a--;const e=l[a];I(o)&&" "!==e&&(i={node:o,offset:a})}if(null!==i)return i;let c=null;if(t<e.getTextContentSize())I(e)&&(c=e.getTextContent()[t]);else{const t=e.getNextSibling();I(t)&&(c=t.getTextContent()[0])}if(null!==c&&" "!==c)return n;{const i=function(e,t){let n=e,i=t,o=e.getTextContent(),s=e.getTextContentSize();for(;;){if(!I(n)||i===s){if(n=n.getNextSibling(),null===n||(0,r.A3)(n))return null;I(n)&&(i=0,o=n.getTextContent(),s=n.getTextContentSize())}if(I(n)){if(" "!==o[i])return{node:n,offset:i};i++}}}(e,t);return null!==i?i:n}}(l,o.offset);if(null!==e){const{node:t,offset:i}=e;(0,r.A3)(t)?t.selectNext(0,0):n.setTextNodeRange(t,i,t,i)}else l.getParentOrThrow().selectStart()}else(function(e){const t=x(e);return(0,r.A3)(t)&&s(168),t})(l).select();return t.preventDefault(),t.stopPropagation(),!0}function Q(e,t){if(!e.hasNodes([u,S]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return null==t&&(t=P),(0,i.qV)(e.registerMutationListener(u,(t=>{e.update((()=>{for(const[n,i]of t)if("destroyed"!==i){const t=(0,r.gI)(n);null!==t&&B(t,e)}}))})),e.registerNodeTransform(u,(n=>N(n,e,t))),e.registerNodeTransform(r.R2,(n=>k(n,e,t))),e.registerNodeTransform(S,(n=>k(n,e,t))),e.registerCommand(r.dB,(t=>{const n=function(e){const t=(0,r.dL)();if(!(0,r.OP)(t)||!T(t))return null;const n=e?r.cz:r.PU,i=e?r.cz:r.cA;if(M(t).length>1)return n;const o=t.getNodes()[0];if(h(o)||I(o)||(0,r.rc)(o)||(0,r.A3)(o)||s(170),h(o))return n;const a=_(o),l=x(o),c=t.anchor,u=t.focus;let d,p;return u.isBefore(c)?(d=u,p=c):(d=c,p=u),null!==a&&null!==l&&d.key===a.getKey()&&0===d.offset&&p.key===l.getKey()&&p.offset===l.getTextContentSize()?n:i}(t.shiftKey);return null!==n&&(t.preventDefault(),e.dispatchCommand(n,void 0),!0)}),r.KB),e.registerCommand(r.cA,(()=>!!T((0,r.dL)())&&((0,r.od)([(0,r.S3)()]),!0)),r.KB),e.registerCommand(r.PU,(e=>F(r.PU)),r.KB),e.registerCommand(r.cz,(e=>F(r.cz)),r.KB),e.registerCommand(r._0,(e=>R(r._0,e)),r.KB),e.registerCommand(r.Zb,(e=>R(r.Zb,e)),r.KB),e.registerCommand(r.g8,(e=>L(r.g8,e)),r.KB),e.registerCommand(r.OJ,(e=>L(r.OJ,e)),r.KB))}},31537:(e,t,n)=>{"use strict";n.d(t,{DT:()=>o,Vu:()=>s});var r=n(29016),i=n(31031);class o extends i.R2{static getType(){return"hashtag"}static clone(e){return new o(e.__text,e.__key)}constructor(e,t){super(e,t)}createDOM(e){const t=super.createDOM(e);return(0,r.Yo)(t,e.theme.hashtag),t}static importJSON(e){const t=s(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"hashtag"}}canInsertTextBefore(){return!1}isTextEntity(){return!0}}function s(e=""){return(0,i.U2)(new o(e))}},67743:(e,t,n)=>{"use strict";n.d(t,{D:()=>i});var r=n(31031);function i(e){const t=(0,r.Jh)(e);return t._headless=!0,["registerDecoratorListener","registerRootListener","registerMutationListener","getRootElement","setRootElement","getElementByKey","focus","blur"].forEach((e=>{t[e]=()=>{throw new Error(`${e} is not supported in headless mode`)}})),t}},94900:(e,t,n)=>{"use strict";n.d(t,{S:()=>s,s:()=>o});var r=n(64739),i=n(31031);function o(e,t){const n=t.body?t.body.childNodes:[];let r=[];const o=[];for(let t=0;t<n.length;t++){const i=n[t];if(!l.has(i.nodeName)){const t=c(i,e,o,!1);null!==t&&(r=r.concat(t))}}return function(e){for(const t of e)t.getNextSibling()instanceof i.RG&&t.insertAfter((0,i.T)());for(const t of e){const e=t.getChildren();for(const n of e)t.insertBefore(n);t.remove()}}(o),r}function s(e,t){if("undefined"==typeof document||"undefined"==typeof window&&void 0===global.window)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const n=document.createElement("div"),r=(0,i.Gv)().getChildren();for(let i=0;i<r.length;i++)a(e,r[i],n,t);return n.innerHTML}function a(e,t,n,o=null){let s=null===o||t.isSelected(o);const l=(0,i.F7)(t)&&t.excludeFromCopy("html");let c=t;if(null!==o){let e=(0,r.B3)(t);e=(0,i.Gg)(e)&&null!==o?(0,r.bA)(o,e):e,c=e}const u=(0,i.F7)(c)?c.getChildren():[],d=e._nodes.get(c.getType());let h;h=d&&void 0!==d.exportDOM?d.exportDOM(e,c):c.exportDOM(e);const{element:p,after:f}=h;if(!p)return!1;const g=document.createDocumentFragment();for(let n=0;n<u.length;n++){const r=u[n],l=a(e,r,g,o);!s&&(0,i.F7)(t)&&l&&t.extractWithChild(r,o,"html")&&(s=!0)}if(s&&!l){if((0,i.Re)(p)&&p.append(g),n.append(p),f){const e=f.call(c,p);e&&p.replaceWith(e)}}else n.append(g);return s}const l=new Set(["STYLE","SCRIPT"]);function c(e,t,n,r,o=new Map,s){let a=[];if(l.has(e.nodeName))return a;let u=null;const d=function(e,t){const{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase());let i=null;if(void 0!==r)for(const t of r){const n=t(e);null!==n&&(null===i||(i.priority||0)<(n.priority||0))&&(i=n)}return null!==i?i.conversion:null}(e,t),h=d?d(e):null;let p=null;if(null!==h){p=h.after;const t=h.node;if(u=Array.isArray(t)?t[t.length-1]:t,null!==u){for(const[,e]of o)if(u=e(u,s),!u)break;u&&a.push(...Array.isArray(t)?t:[u])}null!=h.forChild&&o.set(e.nodeName,h.forChild)}const f=e.childNodes;let g=[];const m=(null==u||!(0,i._v)(u))&&(null!=u&&(0,i.ek)(u)||r);for(let e=0;e<f.length;e++)g.push(...c(f[e],t,n,m,new Map(o),u));return null!=p&&(g=p(g)),(0,i.lv)(e)&&(g=function(e,t,n){const r=e.style.textAlign,o=[];let s=[];for(let e=0;e<t.length;e++){const a=t[e];if((0,i.ek)(a))a.setFormat(r),o.push(a);else if(s.push(a),e===t.length-1||e<t.length-1&&(0,i.ek)(t[e+1])){const e=n();e.setFormat(r),e.append(...s),o.push(e),s=[]}}return o}(e,g,m?()=>{const e=new i.RG;return n.push(e),e}:i.BE)),null==u?a=a.concat(g):(0,i.F7)(u)&&u.append(...g),a}},93261:(e,t,n)=>{"use strict";n.d(t,{GR:()=>s,Ol:()=>d,Pq:()=>c,Rf:()=>f,Xp:()=>h,k0:()=>p,qp:()=>u,zV:()=>l});var r=n(29016),i=n(31031);const o=new Set(["http:","https:","mailto:","sms:","tel:"]);class s extends i.HX{static getType(){return"link"}static clone(e){return new s(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e,t={},n){super(n);const{target:r=null,rel:i=null,title:o=null}=t;this.__url=e,this.__target=r,this.__rel=i,this.__title=o}createDOM(e){const t=document.createElement("a");return t.href=this.sanitizeUrl(this.__url),null!==this.__target&&(t.target=this.__target),null!==this.__rel&&(t.rel=this.__rel),null!==this.__title&&(t.title=this.__title),(0,r.Yo)(t,e.theme.link),t}updateDOM(e,t,n){const r=this.__url,i=this.__target,o=this.__rel,s=this.__title;return r!==e.__url&&(t.href=r),i!==e.__target&&(i?t.target=i:t.removeAttribute("target")),o!==e.__rel&&(o?t.rel=o:t.removeAttribute("rel")),s!==e.__title&&(s?t.title=s:t.removeAttribute("title")),!1}static importDOM(){return{a:e=>({conversion:a,priority:1})}}static importJSON(e){const t=l(e.url,{rel:e.rel,target:e.target,title:e.title});return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}sanitizeUrl(e){try{const t=new URL(e);if(!o.has(t.protocol))return"about:blank"}catch(t){return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(e){this.getWritable().__url=e}getTarget(){return this.getLatest().__target}setTarget(e){this.getWritable().__target=e}getRel(){return this.getLatest().__rel}setRel(e){this.getWritable().__rel=e}getTitle(){return this.getLatest().__title}setTitle(e){this.getWritable().__title=e}insertNewAfter(e,t=!0){const n=l(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!(0,i.OP)(t))return!1;const r=t.anchor.getNode(),o=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(o)&&t.getTextContent().length>0}}function a(e){let t=null;if((0,i.bg)(e)){const n=e.textContent;(null!==n&&""!==n||e.children.length>0)&&(t=l(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function l(e,t){return(0,i.U2)(new s(e,t))}function c(e){return e instanceof s}class u extends s{static getType(){return"autolink"}static clone(e){return new u(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}static importJSON(e){const t=d(e.url,{rel:e.rel,target:e.target,title:e.title});return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(e,t=!0){const n=this.getParentOrThrow().insertNewAfter(e,t);if((0,i.F7)(n)){const e=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return n.append(e),e}return null}}function d(e,t){return(0,i.U2)(new u(e,t))}function h(e){return e instanceof u}const p=(0,i.fA)("TOGGLE_LINK_COMMAND");function f(e,t={}){const{target:n,title:r}=t,o=void 0===t.rel?"noreferrer":t.rel,s=(0,i.dL)();if(!(0,i.OP)(s))return;const a=s.extract();if(null===e)a.forEach((e=>{const t=e.getParent();if(c(t)){const e=t.getChildren();for(let n=0;n<e.length;n++)t.insertBefore(e[n]);t.remove()}}));else{if(1===a.length){const t=function(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}(a[0],c);if(null!==t)return t.setURL(e),void 0!==n&&t.setTarget(n),null!==o&&t.setRel(o),void(void 0!==r&&t.setTitle(r))}let t=null,s=null;a.forEach((a=>{const u=a.getParent();if(u!==s&&null!==u&&(!(0,i.F7)(a)||a.isInline())){if(c(u))return s=u,u.setURL(e),void 0!==n&&u.setTarget(n),null!==o&&s.setRel(o),void(void 0!==r&&s.setTitle(r));if(u.is(t)||(t=u,s=l(e,{rel:o,target:n,title:r}),c(u)?null===a.getPreviousSibling()?u.insertBefore(s):u.insertAfter(s):a.insertBefore(s)),c(a)){if(a.is(s))return;if(null!==s){const e=a.getChildren();for(let t=0;t<e.length;t++)s.append(e[t])}a.remove()}else null!==s&&s.append(a)}}))}}},22311:(e,t,n)=>{"use strict";n.d(t,{A3:()=>j,B3:()=>T,EG:()=>x,FH:()=>N,GS:()=>F,I3:()=>D,J_:()=>g,NK:()=>b,QG:()=>_,d1:()=>M,oU:()=>I,sp:()=>v,up:()=>d});var r=n(31031),i=n(29016),o=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)};function s(e){let t=e.getParent();D(t)||o(40);let n=t;for(;null!==n;)n=n.getParent(),D(n)&&(t=n);return t}function a(e){let t=[];const n=e.getChildren().filter(_);for(let e=0;e<n.length;e++){const r=n[e],i=r.getFirstChild();D(i)?t=t.concat(a(i)):t.push(r)}return t}function l(e){return _(e)&&D(e.getFirstChild())}function c(e){return I().append(e)}function u(e,t){return _(e)&&(0===t.length||1===t.length&&e.is(t[0])&&0===e.getChildrenSize())}function d(e,t){e.update((()=>{const e=(0,r.dL)();if(null!==e){const n=e.getNodes();if((0,r.OP)(e)){const i=e.getStartEndPoints();null===i&&o(143);const[s]=i,a=s.getNode(),l=a.getParent();if(u(a,n)){const e=N(t);if((0,r._v)(l)){a.replace(e);const t=I();(0,r.F7)(a)&&(t.setFormat(a.getFormatType()),t.setIndent(a.getIndent())),e.append(t)}else if(_(a)){const t=a.getParentOrThrow();h(e,t.getChildren()),t.replace(e)}return}}const i=new Set;for(let e=0;e<n.length;e++){const o=n[e];if(!(0,r.F7)(o)||!o.isEmpty()||_(o)||i.has(o.getKey())){if((0,r.H2)(o)){let e=o.getParent();for(;null!=e;){const n=e.getKey();if(D(e)){if(!i.has(n)){const r=N(t);h(r,e.getChildren()),e.replace(r),i.add(n)}break}{const o=e.getParent();if((0,r._v)(o)&&!i.has(n)){i.add(n),p(e,t);break}e=o}}}}else p(o,t)}}}))}function h(e,t){e.splice(e.getChildrenSize(),0,t)}function p(e,t){if(D(e))return e;const n=e.getPreviousSibling(),r=e.getNextSibling(),i=I();if(i.setFormat(e.getFormatType()),i.setIndent(e.getIndent()),h(i,e.getChildren()),D(n)&&t===n.getListType())return n.append(i),e.remove(),D(r)&&t===r.getListType()&&(h(n,r.getChildren()),r.remove()),n;if(D(r)&&t===r.getListType())return r.getFirstChildOrThrow().insertBefore(i),e.remove(),r;{const n=N(t);return n.append(i),e.replace(n),n}}function f(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&l(n)&&l(r)&&(f(n.getFirstChild(),r.getFirstChild()),r.remove());const i=t.getChildren();i.length>0&&e.append(...i),t.remove()}function g(e){e.update((()=>{const e=(0,r.dL)();if((0,r.OP)(e)){const t=new Set,n=e.getNodes(),o=e.anchor.getNode();if(u(o,n))t.add(s(o));else for(let e=0;e<n.length;e++){const o=n[e];if((0,r.H2)(o)){const e=(0,i.yD)(o,b);null!=e&&t.add(s(e))}}for(const n of t){let t=n;const i=a(n);for(const n of i){const i=(0,r.BE)();h(i,n.getChildren()),t.insertAfter(i),t=i,n.__key===e.anchor.key&&e.anchor.set(i.getKey(),0,"element"),n.__key===e.focus.key&&e.focus.set(i.getKey(),0,"element"),n.remove()}n.remove()}}}))}function m(e){const t=new Set;if(l(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(l(r)&&l(i)){const n=i.getFirstChild();if(D(n)){n.append(e);const i=r.getFirstChild();D(i)&&(h(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(l(r)){const t=r.getFirstChild();if(D(t)){const n=t.getFirstChild();null!==n&&n.insertBefore(e)}}else if(l(i)){const t=i.getFirstChild();D(t)&&t.append(e)}else if(D(n)){const t=I(),o=N(n.getListType());t.append(o),o.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function y(e){if(l(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(D(n?n.getParent():void 0)&&_(n)&&D(t)){const r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{const r=t.getListType(),i=I(),o=N(r);i.append(o),e.getPreviousSiblings().forEach((e=>o.append(e)));const s=I(),a=N(r);s.append(a),h(a,e.getNextSiblings()),n.insertBefore(i),n.insertAfter(s),n.replace(e)}}}function v(){const e=(0,r.dL)();if(!(0,r.OP)(e)||!e.isCollapsed())return!1;const t=e.anchor.getNode();if(!_(t)||0!==t.getChildrenSize())return!1;const n=s(t),i=t.getParent();D(i)||o(40);const a=i.getParent();let l;if((0,r._v)(a))l=(0,r.BE)(),n.insertAfter(l);else{if(!_(a))return!1;l=I(),a.insertAfter(l)}l.select();const c=t.getNextSiblings();if(c.length>0){const e=N(i.getListType());if((0,r.Rl)(l))l.insertAfter(e);else{const t=I();t.append(e),l.insertAfter(t)}c.forEach((t=>{t.remove(),e.append(t)}))}return function(e){let t=e;for(;null==t.getNextSibling()&&null==t.getPreviousSibling();){const e=t.getParent();if(null==e||!_(t)&&!D(t))break;t=e}t.remove()}(t),!0}function A(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}class b extends r.HX{static getType(){return"listitem"}static clone(e){return new b(e.__value,e.__checked,e.__key)}constructor(e,t,n){super(n),this.__value=void 0===e?1:e,this.__checked=t}createDOM(e){const t=document.createElement("li"),n=this.getParent();return D(n)&&"check"===n.getListType()&&S(t,this,null),t.value=this.__value,w(t,e.theme,this),t}updateDOM(e,t,n){const r=this.getParent();return D(r)&&"check"===r.getListType()&&S(t,this,e),t.value=this.__value,w(t,n.theme,this),!1}static transform(){return e=>{if(_(e)||o(144),null==e.__checked)return;const t=e.getParent();D(t)&&"check"!==t.getListType()&&null!=e.getChecked()&&e.setChecked(void 0)}}static importDOM(){return{li:()=>({conversion:C,priority:0})}}static importJSON(e){const t=I();return t.setChecked(e.checked),t.setValue(e.value),t.setFormat(e.format),t.setDirection(e.direction),t}exportDOM(e){const t=this.createDOM(e._config);return t.style.textAlign=this.getFormatType(),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if((0,r.F7)(n)&&this.canMergeWith(n)){const e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(_(e))return super.replace(e);this.setIndent(0);const n=this.getParentOrThrow();if(!D(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{const t=N(n.getListType());let r=this.getNextSibling();for(;r;){const e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}return t&&((0,r.F7)(e)||o(139),this.getChildren().forEach((t=>{e.append(t)}))),this.remove(),0===n.getChildrenSize()&&n.remove(),e}insertAfter(e,t=!0){const n=this.getParentOrThrow();if(D(n)||o(39),_(e))return super.insertAfter(e,t);const r=this.getNextSiblings();if(n.insertAfter(e,t),0!==r.length){const i=N(n.getListType());r.forEach((e=>i.append(e))),e.insertAfter(i,t)}return e}remove(e){const t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&l(t)&&l(n)&&(f(t.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(e,t=!0){const n=I(null==this.__checked&&void 0);return this.insertAfter(n,t),n}collapseAtStart(e){const t=(0,r.BE)();this.getChildren().forEach((e=>t.append(e)));const n=this.getParentOrThrow(),i=n.getParentOrThrow(),o=_(i);if(1===n.getChildrenSize())if(o)n.remove(),i.select();else{n.insertBefore(t),n.remove();const r=e.anchor,i=e.focus,o=t.getKey();"element"===r.type&&r.getNode().is(this)&&r.set(o,r.offset,"element"),"element"===i.type&&i.getNode().is(this)&&i.set(o,i.offset,"element")}else n.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){this.getWritable().__value=e}getChecked(){const e=this.getLatest();let t;const n=this.getParent();return D(n)&&(t=n.getListType()),"check"===t?Boolean(e.__checked):void 0}setChecked(e){this.getWritable().__checked=e}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){const e=this.getParent();if(null===e)return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;_(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){"number"==typeof e&&e>-1||o(117);let t=this.getIndent();for(;t!==e;)t<e?(m(this),t++):(y(this),t--);return this}canInsertAfter(e){return _(e)}canReplaceWith(e){return _(e)}canMergeWith(e){return(0,r.Rl)(e)||_(e)}extractWithChild(e,t){if(!(0,r.OP)(t))return!1;const n=t.anchor.getNode(),i=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(i)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return N("bullet")}}function w(e,t,n){const r=[],o=[],s=t.list,a=s?s.listitem:void 0;let l;if(s&&s.nested&&(l=s.nested.listitem),void 0!==a&&r.push(...A(a)),s){const e=n.getParent(),t=D(e)&&"check"===e.getListType(),i=n.getChecked();t&&!i||o.push(s.listitemUnchecked),t&&i||o.push(s.listitemChecked),t&&r.push(i?s.listitemChecked:s.listitemUnchecked)}if(void 0!==l){const e=A(l);n.getChildren().some((e=>D(e)))?r.push(...e):o.push(...e)}o.length>0&&(0,i.PS)(e,...o),r.length>0&&(0,i.Yo)(e,...r)}function S(e,t,n,r){D(t.getFirstChild())?(e.removeAttribute("role"),e.removeAttribute("tabIndex"),e.removeAttribute("aria-checked")):(e.setAttribute("role","checkbox"),e.setAttribute("tabIndex","-1"),n&&t.__checked===n.__checked||e.setAttribute("aria-checked",t.getChecked()?"true":"false"))}function C(e){if(e.classList.contains("task-list-item"))for(const t of e.children)if("INPUT"===t.tagName)return E(t);const t=e.getAttribute("aria-checked");return{node:I("true"===t||"false"!==t&&void 0)}}function E(e){return"checkbox"!==e.getAttribute("type")?{node:null}:{node:I(e.hasAttribute("checked"))}}function I(e){return(0,r.U2)(new b(void 0,e))}function _(e){return e instanceof b}class x extends r.HX{static getType(){return"list"}static clone(e){const t=e.__listType||O[e.__tag];return new x(t,e.__start,e.__key)}constructor(e,t,n){super(n);const r=O[e]||e;this.__listType=r,this.__tag="number"===r?"ol":"ul",this.__start=t}getTag(){return this.__tag}setListType(e){const t=this.getWritable();t.__listType=e,t.__tag="number"===e?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(e,t){const n=this.__tag,r=document.createElement(n);return 1!==this.__start&&r.setAttribute("start",String(this.__start)),r.__lexicalListType=this.__listType,P(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||(P(t,n.theme,this),!1)}static transform(){return e=>{D(e)||o(163),function(e){const t=e.getNextSibling();D(t)&&e.getListType()===t.getListType()&&f(e,t)}(e),function(e){const t="check"!==e.getListType();let n=e.getStart();for(const r of e.getChildren())_(r)&&(r.getValue()!==n&&r.setValue(n),t&&null!=r.getChecked()&&r.setChecked(void 0),D(r.getFirstChild())||n++)}(e)}}static importDOM(){return{ol:()=>({conversion:B,priority:0}),ul:()=>({conversion:B,priority:0})}}static importJSON(e){const t=N(e.listType,e.start);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportDOM(e){const{element:t}=super.exportDOM(e);return t&&(0,r.Re)(t)&&(1!==this.__start&&t.setAttribute("start",String(this.__start)),"check"===this.__listType&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if(_(n))super.append(n);else{const e=I();if(D(n))e.append(n);else if((0,r.F7)(n)){const t=(0,r.MX)(n.getTextContent());e.append(t)}else e.append(n);super.append(e)}}return this}extractWithChild(e){return _(e)}}function P(e,t,n){const r=[],s=[],a=t.list;if(void 0!==a){const e=a[`${n.__tag}Depth`]||[],t=function(e){let t=1,n=e.getParent();for(;null!=n;){if(_(n)){const e=n.getParent();if(D(e)){t++,n=e.getParent();continue}o(40)}return t}return t}(n)-1,i=t%e.length,l=e[i],c=a[n.__tag];let u;const d=a.nested,h=a.checklist;if(void 0!==d&&d.list&&(u=d.list),void 0!==c&&r.push(c),void 0!==h&&"check"===n.__listType&&r.push(h),void 0!==l){r.push(...A(l));for(let t=0;t<e.length;t++)t!==i&&s.push(n.__tag+t)}if(void 0!==u){const e=A(u);t>1?r.push(...e):s.push(...e)}}s.length>0&&(0,i.PS)(e,...s),r.length>0&&(0,i.Yo)(e,...r)}function k(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(_(r)){t.push(r);const e=r.getChildren();e.length>1&&e.forEach((e=>{D(e)&&t.push(c(e))}))}else t.push(c(r))}return t}function B(e){const t=e.nodeName.toLowerCase();let n=null;return"ol"===t?n=N("number",e.start):"ul"===t&&(n=function(e){if("check"===e.getAttribute("__lexicallisttype")||e.classList.contains("contains-task-list"))return!0;for(const t of e.childNodes)if((0,r.Re)(t)&&t.hasAttribute("aria-checked"))return!0;return!1}(e)?N("check"):N("bullet")),{after:k,node:n}}const O={ol:"number",ul:"bullet"};function N(e,t=1){return(0,r.U2)(new x(e,t))}function D(e){return e instanceof x}const j=(0,r.fA)("INSERT_UNORDERED_LIST_COMMAND"),T=(0,r.fA)("INSERT_ORDERED_LIST_COMMAND"),M=(0,r.fA)("INSERT_CHECK_LIST_COMMAND"),F=(0,r.fA)("REMOVE_LIST_COMMAND")},37146:(e,t,n)=>{"use strict";n.d(t,{AB:()=>j,JH:()=>q,Os:()=>W,Pr:()=>Y,T_:()=>V,VH:()=>G,XC:()=>Z,lL:()=>z});var r=n(31031),i=n(36153),o=n(22311),s=n(9591),a=n(29016),l=n(93261);function c(e,t){const n={};for(const r of e){const e=t(r);n[e]?n[e].push(r):n[e]=[r]}return n}function u(e){const t=c(e,(e=>e.type));return{element:t.element||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}const d=/[!-/:-@[-`{-~\s]/,h=/^\s{0,3}$/;function p(e){if(!(0,r.Rl)(e))return!1;const t=e.getFirstChild();return null==t||1===e.getChildrenSize()&&(0,r.Gg)(t)&&h.test(t.getTextContent())}function f(e,t,n,i){for(const r of t){const t=r.export(e,(e=>g(e,n,i)));if(null!=t)return t}return(0,r.F7)(e)?g(e,n,i):(0,r.k$)(e)?e.getTextContent():null}function g(e,t,n){const i=[],o=e.getChildren();e:for(const e of o){for(const r of n){const o=r.export(e,(e=>g(e,t,n)),((e,n)=>m(e,n,t)));if(null!=o){i.push(o);continue e}}(0,r.A3)(e)?i.push("\n"):(0,r.Gg)(e)?i.push(m(e,e.getTextContent(),t)):(0,r.F7)(e)?i.push(g(e,t,n)):(0,r.k$)(e)&&i.push(e.getTextContent())}return i.join("")}function m(e,t,n){const r=t.trim();let i=r;const o=new Set;for(const t of n){const n=t.format[0],r=t.tag;v(e,n)&&!o.has(n)&&(o.add(n),v(y(e,!0),n)||(i=r+i),v(y(e,!1),n)||(i+=r))}return t.replace(r,(()=>i))}function y(e,t){let n=t?e.getPreviousSibling():e.getNextSibling();if(!n){const r=e.getParentOrThrow();r.isInline()&&(n=t?r.getPreviousSibling():r.getNextSibling())}for(;n;){if((0,r.F7)(n)){if(!n.isInline())break;const e=t?n.getLastDescendant():n.getFirstDescendant();if((0,r.Gg)(e))return e;n=t?n.getPreviousSibling():n.getNextSibling()}if((0,r.Gg)(n))return n;if(!(0,r.F7)(n))return null}return null}function v(e,t){return(0,r.Gg)(e)&&e.hasFormat(t)}const A="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,b=A&&"documentMode"in document?document.documentMode:null;A&&"InputEvent"in window&&!b&&new window.InputEvent("input");const w=A&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),S=A&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,C=A&&/^(?=.*Chrome).*/i.test(navigator.userAgent),E=A&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!C,I=/^[ \t]*```(\w{1,10})?\s?$/;function _(e,t,n,i,l){const c=e.trim(),u=(0,r.MX)(c),d=(0,r.BE)();d.append(u),t.append(d);for(const{regExp:t,replace:r}of n){const n=e.match(t);if(n){u.setTextContent(e.slice(n[0].length)),r(d,[u],n,!0);break}}if(P(u,i,l),d.isAttached()&&c.length>0){const e=d.getPreviousSibling();if((0,r.Rl)(e)||(0,s.O)(e)||(0,o.I3)(e)){let t=e;if((0,o.I3)(e)){const n=e.getLastDescendant();t=null==n?null:(0,a.$s)(n,o.QG)}null!=t&&t.getTextContentSize()>0&&(t.splice(t.getChildrenSize(),0,[(0,r.T)(),...d.getChildren()]),d.remove())}}}function x(e,t,n){const o=e[t].match(I);if(o){let s=t;const a=e.length;for(;++s<a;)if(e[s].match(I)){const a=(0,i.Ol)(o[1]),l=(0,r.MX)(e.slice(t+1,s).join("\n"));return a.append(l),n.append(a),[a,s]}}return[null,t]}function P(e,t,n){const r=e.getTextContent(),i=function(e,t){const n=e.match(t.openTagsRegExp);if(null==n)return null;for(const r of n){const n=r.replace(/^\s/,""),i=t.fullMatchRegExpByTag[n];if(null==i)continue;const o=e.match(i),s=t.transformersByTag[n];if(null!=o&&null!=s){if(!1!==s.intraword)return o;const{index:t=0}=o,n=e[t-1],r=e[t+o[0].length];if((!n||d.test(n))&&(!r||d.test(r)))return o}}return null}(r,t);if(!i)return void k(e,n);let o,s,a;if(i[0]===r)o=e;else{const t=i.index||0,n=t+i[0].length;0===t?[o,s]=e.splitText(n):[a,o,s]=e.splitText(t,n)}o.setTextContent(i[2]);const l=t.transformersByTag[i[1]];if(l)for(const e of l.format)o.hasFormat(e)||o.toggleFormat(e);o.hasFormat("code")||P(o,t,n),a&&P(a,t,n),s&&P(s,t,n)}function k(e,t){let n=e;e:for(;n;){for(const e of t){const r=n.getTextContent().match(e.importRegExp);if(!r)continue;const i=r.index||0,o=i+r[0].length;let s,a;0===i?[s,n]=n.splitText(o):[,s,a]=n.splitText(i,o),a&&k(a,t),e.replace(s,r);continue e}break}}var B,O=(B=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})&&B.__esModule&&Object.prototype.hasOwnProperty.call(B,"default")?B.default:B;function N(e,t,n){const r=n.length;for(let i=t;i>=r;i--){const t=i-r;if(D(e,t,n,0,r)&&" "!==e[t+r])return t}return-1}function D(e,t,n,r,i){for(let o=0;o<i;o++)if(e[t+o]!==n[r+o])return!1;return!0}function j(e,t=Z){const n=u(t),o=c(n.textFormat,(({tag:e})=>e[e.length-1])),s=c(n.textMatch,(({trigger:e})=>e));for(const n of t){const t=n.type;if("element"===t||"text-match"===t){const t=n.dependencies;for(const n of t)e.hasNode(n)||O(173,n.getType())}}const a=(e,t,i)=>{(function(e,t,n,i){const o=e.getParent();if(!(0,r._v)(o)||e.getFirstChild()!==t)return!1;const s=t.getTextContent();if(" "!==s[n-1])return!1;for(const{regExp:r,replace:o}of i){const i=s.match(r);if(i&&i[0].length===n){const r=t.getNextSiblings(),[s,a]=t.splitText(n);return s.remove(),o(e,a?[a,...r]:r,i,!1),!0}}return!1})(e,t,i,n.element)||function(e,t,n){let r=e.getTextContent();const i=n[r[t-1]];if(null==i)return!1;t<r.length&&(r=r.slice(0,t));for(const t of i){const n=r.match(t.regExp);if(null===n)continue;const i=n.index||0,o=i+n[0].length;let s;return 0===i?[s]=e.splitText(o):[,s]=e.splitText(i,o),s.selectNext(0,0),t.replace(s,n),!0}return!1}(t,i,s)||function(e,t,n){const i=e.getTextContent(),o=t-1,s=i[o],a=n[s];if(!a)return!1;for(const t of a){const{tag:n}=t,a=n.length,l=o-a+1;if(a>1&&!D(i,l,n,0,a))continue;if(" "===i[l-1])continue;const c=i[o+1];if(!1===t.intraword&&c&&!d.test(c))continue;const u=e;let h=u,p=N(i,l,n),f=h;for(;p<0&&(f=f.getPreviousSibling())&&!(0,r.A3)(f);)if((0,r.Gg)(f)){const e=f.getTextContent();h=f,p=N(e,e.length,n)}if(p<0)continue;if(h===u&&p+a===l)continue;const g=h.getTextContent();if(p>0&&g[p-1]===s)continue;const m=g[p-1];if(!1===t.intraword&&m&&!d.test(m))continue;const y=u.getTextContent(),v=y.slice(0,l)+y.slice(o+1);u.setTextContent(v);const A=h===u?v:g;h.setTextContent(A.slice(0,p)+A.slice(p+a));const b=(0,r.dL)(),w=(0,r.vN)();(0,r.oq)(w);const S=o-a*(h===u?2:1)+1;w.anchor.set(h.__key,p,"text"),w.focus.set(u.__key,S,"text");for(const e of t.format)w.hasFormat(e)||w.formatText(e);w.anchor.set(w.focus.key,w.focus.offset,w.focus.type);for(const e of t.format)w.hasFormat(e)&&w.toggleFormat(e);return(0,r.OP)(b)&&(w.format=b.format),!0}}(t,i,o)};return e.registerUpdateListener((({tags:t,dirtyLeaves:n,editorState:o,prevEditorState:s})=>{if(t.has("collaboration")||t.has("historic"))return;if(e.isComposing())return;const l=o.read(r.dL),c=s.read(r.dL);if(!(0,r.OP)(c)||!(0,r.OP)(l)||!l.isCollapsed())return;const u=l.anchor.key,d=l.anchor.offset,h=o._nodeMap.get(u);!(0,r.Gg)(h)||!n.has(u)||1!==d&&d>c.anchor.offset+1||e.update((()=>{if(h.hasFormat("code"))return;const e=h.getParent();null===e||(0,i.Pe)(e)||a(e,h,l.anchor.offset)}))}))}const T=e=>(t,n,r)=>{const i=e(r);i.append(...n),t.replace(i),i.select(0,0)},M=e=>(t,n,r)=>{const i=t.getPreviousSibling(),s=t.getNextSibling(),a=(0,o.oU)("check"===e?"x"===r[3]:void 0);if((0,o.I3)(s)&&s.getListType()===e){const e=s.getFirstChild();null!==e?e.insertBefore(a):s.append(a),t.remove()}else if((0,o.I3)(i)&&i.getListType()===e)i.append(a),t.remove();else{const n=(0,o.FH)(e,"number"===e?Number(r[2]):void 0);n.append(a),t.replace(n)}a.append(...n),a.select(0,0);const l=function(e){const t=e.match(/\t/g),n=e.match(/ /g);let r=0;return t&&(r+=t.length),n&&(r+=Math.floor(n.length/4)),r}(r[1]);l&&a.setIndent(l)},F=(e,t,n)=>{const r=[],i=e.getChildren();let s=0;for(const a of i)if((0,o.QG)(a)){if(1===a.getChildrenSize()){const e=a.getFirstChild();if((0,o.I3)(e)){r.push(F(e,t,n+1));continue}}const i=" ".repeat(4*n),l=e.getListType(),c="number"===l?`${e.getStart()+s}. `:"check"===l?`- [${a.getChecked()?"x":" "}] `:"- ";r.push(i+c+t(a)),s++}return r.join("\n")},R={dependencies:[s.c2],export:(e,t)=>{if(!(0,s.rc)(e))return null;const n=Number(e.getTag().slice(1));return"#".repeat(n)+" "+t(e)},regExp:/^(#{1,6})\s/,replace:T((e=>{const t="h"+e[1].length;return(0,s.V1)(t)})),type:"element"},L={dependencies:[s.rT],export:(e,t)=>{if(!(0,s.O)(e))return null;const n=t(e).split("\n"),r=[];for(const e of n)r.push("> "+e);return r.join("\n")},regExp:/^>\s/,replace:(e,t,n,i)=>{if(i){const n=e.getPreviousSibling();if((0,s.O)(n))return n.splice(n.getChildrenSize(),0,[(0,r.T)(),...t]),n.select(0,0),void e.remove()}const o=(0,s.Z1)();o.append(...t),e.replace(o),o.select(0,0)},type:"element"},Q={dependencies:[i.wg],export:e=>{if(!(0,i.Pe)(e))return null;const t=e.getTextContent();return"```"+(e.getLanguage()||"")+(t?"\n"+t:"")+"\n```"},regExp:/^[ \t]*```(\w{1,10})?\s/,replace:T((e=>(0,i.Ol)(e?e[1]:void 0))),type:"element"},U={dependencies:[o.EG,o.NK],export:(e,t)=>(0,o.I3)(e)?F(e,t,0):null,regExp:/^(\s*)[-*+]\s/,replace:M("bullet"),type:"element"},V={dependencies:[o.EG,o.NK],export:(e,t)=>(0,o.I3)(e)?F(e,t,0):null,regExp:/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,replace:M("check"),type:"element"},K={dependencies:[o.EG,o.NK],export:(e,t)=>(0,o.I3)(e)?F(e,t,0):null,regExp:/^(\s*)(\d{1,})\.\s/,replace:M("number"),type:"element"},H={dependencies:[l.GR],export:(e,t,n)=>{if(!(0,l.Pq)(e))return null;const i=e.getTitle(),o=i?`[${e.getTextContent()}](${e.getURL()} "${i}")`:`[${e.getTextContent()}](${e.getURL()})`,s=e.getFirstChild();return 1===e.getChildrenSize()&&(0,r.Gg)(s)?n(s,o):o},importRegExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{const[,n,i,o]=t,s=(0,l.zV)(i,{title:o}),a=(0,r.MX)(n);a.setFormat(e.getFormat()),s.append(a),e.replace(s)},trigger:")",type:"text-match"},G=[R,L,Q,U,K],Y=[{format:["code"],tag:"`",type:"text-format"},{format:["bold","italic"],tag:"***",type:"text-format"},{format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},{format:["bold"],tag:"**",type:"text-format"},{format:["bold"],intraword:!1,tag:"__",type:"text-format"},{format:["highlight"],tag:"==",type:"text-format"},{format:["italic"],tag:"*",type:"text-format"},{format:["italic"],intraword:!1,tag:"_",type:"text-format"},{format:["strikethrough"],tag:"~~",type:"text-format"}],z=[H],Z=[...G,...Y,...z];function W(e,t=Z,n,i=!1){return function(e,t=!1){const n=u(e),i=function(e){const t={},n={},r=[];for(const i of e){const{tag:e}=i;t[e]=i;const o=e.replace(/(\*|\^|\+)/g,"\\$1");r.push(o),n[e]=w||S||E?new RegExp(`(${o})(?![${o}\\s])(.*?[^${o}\\s])${o}(?!${o})`):new RegExp(`(?<![\\\\${o}])(${o})((\\\\${o})?.*?[^${o}\\s](\\\\${o})?)((?<!\\\\)|(?<=\\\\\\\\))(${o})(?![\\\\${o}])`)}return{fullMatchRegExpByTag:n,openTagsRegExp:new RegExp((w||S||E?"":"(?<![\\\\])")+"("+r.join("|")+")","g"),transformersByTag:t}}(n.textFormat);return(e,o)=>{const s=e.split("\n"),a=s.length,l=o||(0,r.Gv)();l.clear();for(let e=0;e<a;e++){const t=s[e],[r,o]=x(s,e,l);null==r?_(t,l,n.element,i,n.textMatch):e=o}const c=l.getChildren();for(const e of c)!t&&p(e)&&l.getChildrenSize()>1&&e.remove();null!==(0,r.dL)()&&l.selectEnd()}}(t,i)(e,n)}function q(e=Z,t,n=!1){const i=function(e,t=!1){const n=u(e),i=!t,o=n.textFormat.filter((e=>1===e.format.length));return e=>{const t=[],s=(e||(0,r.Gv)()).getChildren();for(let e=0;e<s.length;e++){const r=s[e],a=f(r,n.element,o,n.textMatch);null!=a&&t.push(i&&e>0&&!p(r)&&!p(s[e-1])?"\n".concat(a):a)}return t.join("\n")}}(e,n);return i(t)}},8802:(e,t,n)=>{"use strict";n.d(t,{WX:()=>A,v3:()=>v,vK:()=>b,HI:()=>y});var r=n(93261),i=n(47166),o=n(31031),s=n(2784),a=n(29016),l=n(52322);const c="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?s.useLayoutEffect:s.useEffect;class u{constructor(e){this.key=e,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}setRefElement(e){this.ref={current:e}}}const d=e=>{const t=document.getElementById("typeahead-menu");if(!t)return;const n=t.getBoundingClientRect();n.top+n.height>window.innerHeight&&t.scrollIntoView({block:"center"}),n.top<0&&t.scrollIntoView({block:"center"}),e.scrollIntoView({block:"nearest"})};function h(e,t){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top>r.top&&n.top<r.bottom}function p(e,t,n,r){const[o]=(0,i.g)();(0,s.useEffect)((()=>{if(null!=t&&null!=e){const e=o.getRootElement(),i=null!=e?function(e,t){let n=getComputedStyle(e);const r="absolute"===n.position,i=/(auto|scroll)/;if("fixed"===n.position)return document.body;for(let t=e;t=t.parentElement;)if(n=getComputedStyle(t),(!r||"static"!==n.position)&&i.test(n.overflow+n.overflowY+n.overflowX))return t;return document.body}(e):document.body;let s=!1,a=h(t,i);const l=function(){s||(window.requestAnimationFrame((function(){n(),s=!1})),s=!0);const e=h(t,i);e!==a&&(a=e,null!=r&&r(e))},c=new ResizeObserver(n);return window.addEventListener("resize",n),document.addEventListener("scroll",l,{capture:!0,passive:!0}),c.observe(t),()=>{c.unobserve(t),window.removeEventListener("resize",n),document.removeEventListener("scroll",l,!0)}}}),[t,o,r,n,e])}const f=(0,o.fA)("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");function g({close:e,editor:t,anchorElementRef:n,resolution:r,options:i,menuRenderFn:l,onSelectOption:u,shouldSplitNodeWithQuery:h=!1,commandPriority:p=o.KB}){const[g,m]=(0,s.useState)(null),y=r.match&&r.match.matchingString;(0,s.useEffect)((()=>{m(0)}),[y]);const v=(0,s.useCallback)((n=>{t.update((()=>{const t=null!=r.match&&h?function(e){const t=(0,o.dL)();if(!(0,o.OP)(t)||!t.isCollapsed())return null;const n=t.anchor;if("text"!==n.type)return null;const r=n.getNode();if(!r.isSimpleText())return null;const i=n.offset,s=r.getTextContent().slice(0,i),a=e.replaceableString.length,l=i-function(e,t,n){let r=n;for(let n=r;n<=t.length;n++)e.substr(-n)===t.substr(0,n)&&(r=n);return r}(s,e.matchingString,a);if(l<0)return null;let c;return 0===l?[c]=r.splitText(i):[,c]=r.splitText(l,i),c}(r.match):null;u(n,t,e,r.match?r.match.matchingString:"")}))}),[t,h,r.match,u,e]),A=(0,s.useCallback)((e=>{const n=t.getRootElement();null!==n&&(n.setAttribute("aria-activedescendant","typeahead-item-"+e),m(e))}),[t]);return(0,s.useEffect)((()=>()=>{const e=t.getRootElement();null!==e&&e.removeAttribute("aria-activedescendant")}),[t]),c((()=>{null===i?m(null):null===g&&A(0)}),[i,g,A]),(0,s.useEffect)((()=>(0,a.qV)(t.registerCommand(f,(({option:e})=>!(!e.ref||null==e.ref.current||(d(e.ref.current),0))),p))),[t,A,p]),(0,s.useEffect)((()=>(0,a.qV)(t.registerCommand(o.Zb,(e=>{const n=e;if(null!==i&&i.length&&null!==g){const e=g!==i.length-1?g+1:0;A(e);const r=i[e];null!=r.ref&&r.ref.current&&t.dispatchCommand(f,{index:e,option:r}),n.preventDefault(),n.stopImmediatePropagation()}return!0}),p),t.registerCommand(o._0,(e=>{const t=e;if(null!==i&&i.length&&null!==g){const e=0!==g?g-1:i.length-1;A(e);const n=i[e];null!=n.ref&&n.ref.current&&d(n.ref.current),t.preventDefault(),t.stopImmediatePropagation()}return!0}),p),t.registerCommand(o.Zq,(t=>{const n=t;return n.preventDefault(),n.stopImmediatePropagation(),e(),!0}),p),t.registerCommand(o.dB,(e=>{const t=e;return null!==i&&null!==g&&null!=i[g]&&(t.preventDefault(),t.stopImmediatePropagation(),v(i[g]),!0)}),p),t.registerCommand(o.XN,(e=>null!==i&&null!==g&&null!=i[g]&&(null!==e&&(e.preventDefault(),e.stopImmediatePropagation()),v(i[g]),!0)),p))),[v,e,t,i,g,A,p]),l(n,(0,s.useMemo)((()=>({options:i,selectOptionAndCleanUp:v,selectedIndex:g,setHighlightedIndex:m})),[v,g,i]),r.match?r.match.matchingString:"")}function m({options:e,nodeKey:t,onClose:n,onOpen:r,onSelectOption:a,menuRenderFn:c,anchorClassName:u,commandPriority:d=o.KB,parent:h}){const[f]=(0,i.g)(),[m,y]=(0,s.useState)(null),v=function(e,t,n,r=document.body){const[o]=(0,i.g)(),a=(0,s.useRef)(document.createElement("div")),l=(0,s.useCallback)((()=>{a.current.style.top=a.current.style.bottom;const t=o.getRootElement(),i=a.current,s=i.firstChild;if(null!==t&&null!==e){const{left:o,top:l,width:c,height:u}=e.getRect(),d=a.current.offsetHeight;if(i.style.top=`${l+window.pageYOffset+d+3}px`,i.style.left=`${o+window.pageXOffset}px`,i.style.height=`${u}px`,i.style.width=`${c}px`,null!==s){s.style.top=`${l}`;const e=s.getBoundingClientRect(),n=e.height,r=e.width,a=t.getBoundingClientRect();o+r>a.right&&(i.style.left=`${a.right-r+window.pageXOffset}px`),(l+n>window.innerHeight||l+n>a.bottom)&&l-a.top>n+u&&(i.style.top=l-n+window.pageYOffset-u+"px")}i.isConnected||(null!=n&&(i.className=n),i.setAttribute("aria-label","Typeahead menu"),i.setAttribute("id","typeahead-menu"),i.setAttribute("role","listbox"),i.style.display="block",i.style.position="absolute",r.append(i)),a.current=i,t.setAttribute("aria-controls","typeahead-menu")}}),[o,e,n,r]);(0,s.useEffect)((()=>{const t=o.getRootElement();if(null!==e)return l(),()=>{null!==t&&t.removeAttribute("aria-controls");const e=a.current;null!==e&&e.isConnected&&e.remove()}}),[o,l,e]);const c=(0,s.useCallback)((n=>{null!==e&&(n||t(null))}),[e,t]);return p(e,a.current,l,c),a}(m,y,u,h),A=(0,s.useCallback)((()=>{y(null),null!=n&&null!==m&&n()}),[n,m]),b=(0,s.useCallback)((e=>{y(e),null!=r&&null===m&&r(e)}),[r,m]),w=(0,s.useCallback)((()=>{t?f.update((()=>{const e=(0,o.gI)(t),n=f.getElementByKey(t);var r;null!=e&&null!=n&&null==m&&(r=()=>b({getRect:()=>n.getBoundingClientRect()}),s.startTransition?s.startTransition(r):r())})):null==t&&null!=m&&A()}),[A,f,t,b,m]);return(0,s.useEffect)((()=>{w()}),[w,t]),(0,s.useEffect)((()=>{if(null!=t)return f.registerUpdateListener((({dirtyElements:e})=>{e.get(t)&&w()}))}),[f,w,t]),null===m||null===f?null:(0,l.jsx)(g,{close:A,resolution:m,editor:f,anchorElementRef:v,options:e,menuRenderFn:c,onSelectOption:a,commandPriority:d})}const y=/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/,v=(0,o.fA)("INSERT_EMBED_COMMAND");class A extends u{constructor(e,t){super(e),this.title=e,this.onSelect=t.onSelect.bind(this)}}function b({embedConfigs:e,onOpenEmbedModalForConfig:t,getMenuOptions:n,menuRenderFn:c,menuCommandPriority:u=o.KB}){const[d]=(0,i.g)(),[h,p]=(0,s.useState)(null),[f,g]=(0,s.useState)(null),y=(0,s.useCallback)((()=>{p(null),g(null)}),[]),A=(0,s.useCallback)((t=>{d.getEditorState().read((async function(){const n=(0,o.gI)(t);if((0,r.Pq)(n))for(let t=0;t<e.length;t++){const r=e[t];null!=await Promise.resolve(r.parseUrl(n.__url))&&(g(r),p(n.getKey()))}}))}),[d,e]);(0,s.useEffect)((()=>(0,a.qV)(...[r.GR,r.qp].map((e=>d.registerMutationListener(e,((...e)=>((e,{updateTags:t,dirtyLeaves:n})=>{for(const[r,i]of e)"created"===i&&t.has("paste")&&n.size<=3?A(r):r===h&&y()})(...e))))))),[A,d,e,h,y]),(0,s.useEffect)((()=>d.registerCommand(v,(n=>{const r=e.find((({type:e})=>e===n));return!!r&&(t(r),!0)}),o.VN)),[d,e,t]);const b=(0,s.useCallback)((async function(){if(null!=f&&null!=h){const e=d.getEditorState().read((()=>{const e=(0,o.gI)(h);return(0,r.Pq)(e)?e:null}));if((0,r.Pq)(e)){const t=await Promise.resolve(f.parseUrl(e.__url));null!=t&&d.update((()=>{(0,o.dL)()||e.selectEnd(),f.insertNode(d,t),e.isAttached()&&e.remove()}))}}}),[f,d,h]),w=(0,s.useMemo)((()=>null!=f&&null!=h?n(f,b,y):[]),[f,b,n,h,y]),S=(0,s.useCallback)(((e,t,n)=>{d.update((()=>{e.onSelect(t),n()}))}),[d]);return null!=h?(0,l.jsx)(m,{nodeKey:h,onClose:y,onSelectOption:S,options:w,menuRenderFn:c,commandPriority:u}):null}},74667:(e,t,n)=>{"use strict";n.d(t,{U:()=>u});var r=n(47166),i=n(20266),o=n(73055),s=n(29016),a=n(31031),l=n(2784),c=n(52322);function u({children:e,format:t,nodeKey:n,className:u}){const[d]=(0,r.g)(),[h,p,f]=(0,o.y)(n),g=(0,l.useRef)(null),m=(0,l.useCallback)((e=>{if(h&&(0,a.iO)((0,a.dL)())){e.preventDefault();const t=(0,a.gI)(n);if((0,a.k$)(t))return t.remove(),!0}return!1}),[h,n]);return(0,l.useEffect)((()=>(0,s.qV)(d.registerCommand(a.RO,(e=>{if(h){const t=(0,a.dL)();if((0,a.iO)(t)){const t=(0,a.gI)(n);(0,i.F)(t)&&t.setFormat(e)}else if((0,a.OP)(t)){const n=t.getNodes();for(const t of n)(0,i.F)(t)?t.setFormat(e):(0,s.f8)(t).setFormat(e)}return!0}return!1}),a.KB),d.registerCommand(a.Kr,(e=>e.target===g.current&&(e.preventDefault(),e.shiftKey||f(),p(!h),!0)),a.KB),d.registerCommand(a.MK,m,a.KB),d.registerCommand(a.aR,m,a.KB))),[f,d,h,n,m,p]),(0,c.jsx)("div",{className:[u.base,h?u.focus:null].filter(Boolean).join(" "),ref:g,style:{textAlign:t||void 0},children:e})}},47166:(e,t,n)=>{"use strict";n.d(t,{LI:()=>a,YK:()=>s,g:()=>l});var r,i=n(2784),o=(r=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;const s=(0,i.createContext)(null);function a(e,t){let n=null;return null!=e&&(n=e[1]),{getTheme:function(){return null!=t?t:null!=n?n.getTheme():null}}}function l(){const e=(0,i.useContext)(s);return null==e&&o(8),e}},20266:(e,t,n)=>{"use strict";n.d(t,{F:()=>o,K:()=>i});var r=n(31031);class i extends r.Ij{constructor(e,t){super(t),this.__format=e||""}exportJSON(){return{format:this.__format||"",type:"decorator-block",version:1}}canIndent(){return!1}createDOM(){return document.createElement("div")}updateDOM(){return!1}setFormat(e){this.getWritable().__format=e}isInline(){return!1}}function o(e){return e instanceof i}},27901:(e,t,n)=>{"use strict";n.d(t,{Dq:()=>p,HY:()=>d,fs:()=>f,qL:()=>c});var r=n(47166),i=n(73055),o=n(29016),s=n(31031),a=n(2784),l=n(52322);const c=(0,s.fA)("INSERT_HORIZONTAL_RULE_COMMAND");function u({nodeKey:e}){const[t]=(0,r.g)(),[n,l,c]=(0,i.y)(e),u=(0,a.useCallback)((t=>{if(n&&(0,s.iO)((0,s.dL)())){t.preventDefault();const n=(0,s.gI)(e);if(f(n))return n.remove(),!0}return!1}),[n,e]);return(0,a.useEffect)((()=>(0,o.qV)(t.registerCommand(s.Kr,(r=>{const i=t.getElementByKey(e);return r.target===i&&(r.shiftKey||c(),l(!n),!0)}),s.KB),t.registerCommand(s.MK,u,s.KB),t.registerCommand(s.aR,u,s.KB))),[c,t,n,e,u,l]),(0,a.useEffect)((()=>{const r=t.getElementByKey(e),i="selected";null!==r&&(n?(0,o.Yo)(r,i):(0,o.PS)(r,i))}),[t,n,e]),null}class d extends s.Ij{static getType(){return"horizontalrule"}static clone(e){return new d(e.__key)}static importJSON(e){return p()}static importDOM(){return{hr:()=>({conversion:h,priority:0})}}exportJSON(){return{type:"horizontalrule",version:1}}exportDOM(){return{element:document.createElement("hr")}}createDOM(e){const t=document.createElement("hr");return(0,o.Yo)(t,e.theme.hr),t}getTextContent(){return"\n"}isInline(){return!1}updateDOM(){return!1}decorate(){return(0,l.jsx)(u,{nodeKey:this.__key})}}function h(){return{node:p()}}function p(){return(0,s.U2)(new d)}function f(e){return e instanceof d}},17906:(e,t,n)=>{"use strict";n.d(t,{HQ:()=>y,n:()=>c,wd:()=>m});var r=n(47166),i=n(31031),o=n(2784),s=n(29016),a=n(52322);const l="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect;class c{constructor(e){this.key=e,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}setRefElement(e){this.ref={current:e}}}const u=e=>{const t=document.getElementById("typeahead-menu");if(!t)return;const n=t.getBoundingClientRect();n.top+n.height>window.innerHeight&&t.scrollIntoView({block:"center"}),n.top<0&&t.scrollIntoView({block:"center"}),e.scrollIntoView({block:"nearest"})};function d(e,t){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top>r.top&&n.top<r.bottom}function h(e,t,n,i){const[s]=(0,r.g)();(0,o.useEffect)((()=>{if(null!=t&&null!=e){const e=s.getRootElement(),r=null!=e?function(e,t){let n=getComputedStyle(e);const r="absolute"===n.position,i=/(auto|scroll)/;if("fixed"===n.position)return document.body;for(let t=e;t=t.parentElement;)if(n=getComputedStyle(t),(!r||"static"!==n.position)&&i.test(n.overflow+n.overflowY+n.overflowX))return t;return document.body}(e):document.body;let o=!1,a=d(t,r);const l=function(){o||(window.requestAnimationFrame((function(){n(),o=!1})),o=!0);const e=d(t,r);e!==a&&(a=e,null!=i&&i(e))},c=new ResizeObserver(n);return window.addEventListener("resize",n),document.addEventListener("scroll",l,{capture:!0,passive:!0}),c.observe(t),()=>{c.unobserve(t),window.removeEventListener("resize",n),document.removeEventListener("scroll",l,!0)}}}),[t,s,i,n,e])}const p=(0,i.fA)("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");function f({close:e,editor:t,anchorElementRef:n,resolution:r,options:a,menuRenderFn:c,onSelectOption:d,shouldSplitNodeWithQuery:h=!1,commandPriority:f=i.KB}){const[g,m]=(0,o.useState)(null),y=r.match&&r.match.matchingString;(0,o.useEffect)((()=>{m(0)}),[y]);const v=(0,o.useCallback)((n=>{t.update((()=>{const t=null!=r.match&&h?function(e){const t=(0,i.dL)();if(!(0,i.OP)(t)||!t.isCollapsed())return null;const n=t.anchor;if("text"!==n.type)return null;const r=n.getNode();if(!r.isSimpleText())return null;const o=n.offset,s=r.getTextContent().slice(0,o),a=e.replaceableString.length,l=o-function(e,t,n){let r=n;for(let n=r;n<=t.length;n++)e.substr(-n)===t.substr(0,n)&&(r=n);return r}(s,e.matchingString,a);if(l<0)return null;let c;return 0===l?[c]=r.splitText(o):[,c]=r.splitText(l,o),c}(r.match):null;d(n,t,e,r.match?r.match.matchingString:"")}))}),[t,h,r.match,d,e]),A=(0,o.useCallback)((e=>{const n=t.getRootElement();null!==n&&(n.setAttribute("aria-activedescendant","typeahead-item-"+e),m(e))}),[t]);return(0,o.useEffect)((()=>()=>{const e=t.getRootElement();null!==e&&e.removeAttribute("aria-activedescendant")}),[t]),l((()=>{null===a?m(null):null===g&&A(0)}),[a,g,A]),(0,o.useEffect)((()=>(0,s.qV)(t.registerCommand(p,(({option:e})=>!(!e.ref||null==e.ref.current||(u(e.ref.current),0))),f))),[t,A,f]),(0,o.useEffect)((()=>(0,s.qV)(t.registerCommand(i.Zb,(e=>{const n=e;if(null!==a&&a.length&&null!==g){const e=g!==a.length-1?g+1:0;A(e);const r=a[e];null!=r.ref&&r.ref.current&&t.dispatchCommand(p,{index:e,option:r}),n.preventDefault(),n.stopImmediatePropagation()}return!0}),f),t.registerCommand(i._0,(e=>{const t=e;if(null!==a&&a.length&&null!==g){const e=0!==g?g-1:a.length-1;A(e);const n=a[e];null!=n.ref&&n.ref.current&&u(n.ref.current),t.preventDefault(),t.stopImmediatePropagation()}return!0}),f),t.registerCommand(i.Zq,(t=>{const n=t;return n.preventDefault(),n.stopImmediatePropagation(),e(),!0}),f),t.registerCommand(i.dB,(e=>{const t=e;return null!==a&&null!==g&&null!=a[g]&&(t.preventDefault(),t.stopImmediatePropagation(),v(a[g]),!0)}),f),t.registerCommand(i.XN,(e=>null!==a&&null!==g&&null!=a[g]&&(null!==e&&(e.preventDefault(),e.stopImmediatePropagation()),v(a[g]),!0)),f))),[v,e,t,a,g,A,f]),c(n,(0,o.useMemo)((()=>({options:a,selectOptionAndCleanUp:v,selectedIndex:g,setHighlightedIndex:m})),[v,g,a]),r.match?r.match.matchingString:"")}const g="\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%'\"~=<>_:;";function m(e,{minLength:t=1,maxLength:n=75}){return(0,o.useCallback)((r=>{const i=new RegExp("(^|\\s|\\()(["+e+"]((?:[^"+e+g+"\\s]){0,"+n+"}))$").exec(r);if(null!==i){const e=i[1],n=i[3];if(n.length>=t)return{leadOffset:i.index+e.length,matchingString:n,replaceableString:i[2]}}return null}),[n,t,e])}function y({options:e,onQueryChange:t,onSelectOption:n,onOpen:s,onClose:l,menuRenderFn:c,triggerFn:u,anchorClassName:d,commandPriority:p=i.KB,parent:g}){const[m]=(0,r.g)(),[y,v]=(0,o.useState)(null),A=function(e,t,n,i=document.body){const[s]=(0,r.g)(),a=(0,o.useRef)(document.createElement("div")),l=(0,o.useCallback)((()=>{a.current.style.top=a.current.style.bottom;const t=s.getRootElement(),r=a.current,o=r.firstChild;if(null!==t&&null!==e){const{left:s,top:l,width:c,height:u}=e.getRect(),d=a.current.offsetHeight;if(r.style.top=`${l+window.pageYOffset+d+3}px`,r.style.left=`${s+window.pageXOffset}px`,r.style.height=`${u}px`,r.style.width=`${c}px`,null!==o){o.style.top=`${l}`;const e=o.getBoundingClientRect(),n=e.height,i=e.width,a=t.getBoundingClientRect();s+i>a.right&&(r.style.left=`${a.right-i+window.pageXOffset}px`),(l+n>window.innerHeight||l+n>a.bottom)&&l-a.top>n+u&&(r.style.top=l-n+window.pageYOffset-u+"px")}r.isConnected||(null!=n&&(r.className=n),r.setAttribute("aria-label","Typeahead menu"),r.setAttribute("id","typeahead-menu"),r.setAttribute("role","listbox"),r.style.display="block",r.style.position="absolute",i.append(r)),a.current=r,t.setAttribute("aria-controls","typeahead-menu")}}),[s,e,n,i]);(0,o.useEffect)((()=>{const t=s.getRootElement();if(null!==e)return l(),()=>{null!==t&&t.removeAttribute("aria-controls");const e=a.current;null!==e&&e.isConnected&&e.remove()}}),[s,l,e]);const c=(0,o.useCallback)((n=>{null!==e&&(n||t(null))}),[e,t]);return h(e,a.current,l,c),a}(y,v,d,g),b=(0,o.useCallback)((()=>{v(null),null!=l&&null!==y&&l()}),[l,y]),w=(0,o.useCallback)((e=>{v(e),null!=s&&null===y&&s(e)}),[s,y]);return(0,o.useEffect)((()=>{const e=m.registerUpdateListener((()=>{m.getEditorState().read((()=>{const e=m._window||window,n=e.document.createRange(),r=(0,i.dL)(),s=function(e){let t=null;return e.getEditorState().read((()=>{const e=(0,i.dL)();(0,i.OP)(e)&&(t=function(e){const t=e.anchor;if("text"!==t.type)return null;const n=t.getNode();if(!n.isSimpleText())return null;const r=t.offset;return n.getTextContent().slice(0,r)}(e))})),t}(m);if(!(0,i.OP)(r)||!r.isCollapsed()||null===s||null===n)return void b();const a=u(s,m);if(t(a?a.matchingString:null),null!==a&&!function(e,t){return 0===t&&e.getEditorState().read((()=>{const e=(0,i.dL)();if((0,i.OP)(e)){const t=e.anchor.getNode().getPreviousSibling();return(0,i.Gg)(t)&&t.isTextEntity()}return!1}))}(m,a.leadOffset)){const t=function(e,t,n){const r=n.getSelection();if(null===r||!r.isCollapsed)return!1;const i=r.anchorNode,o=e,s=r.anchorOffset;if(null==i||null==s)return!1;try{t.setStart(i,o),t.setEnd(i,s)}catch(e){return!1}return!0}(a.leadOffset,n,e);if(null!==t)return l=()=>w({getRect:()=>n.getBoundingClientRect(),match:a}),void(o.startTransition?o.startTransition(l):l())}var l;b()}))}));return()=>{e()}}),[m,u,t,y,b,w]),null===y||null===m?null:(0,a.jsx)(f,{close:b,resolution:y,editor:m,anchorElementRef:A,options:e,menuRenderFn:c,shouldSplitNodeWithQuery:!0,onSelectOption:n,commandPriority:p})}(0,i.fA)("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND")},73055:(e,t,n)=>{"use strict";n.d(t,{y:()=>a});var r=n(47166),i=n(31031),o=n(2784);function s(e,t){return e.getEditorState().read((()=>{const e=(0,i.gI)(t);return null!==e&&e.isSelected()}))}function a(e){const[t]=(0,r.g)(),[n,a]=(0,o.useState)((()=>s(t,e)));return(0,o.useEffect)((()=>{let n=!0;const r=t.registerUpdateListener((()=>{n&&a(s(t,e))}));return()=>{n=!1,r()}}),[t,e]),[n,(0,o.useCallback)((n=>{t.update((()=>{let t=(0,i.dL)();(0,i.iO)(t)||(t=(0,i.h5)(),(0,i.oq)(t)),(0,i.iO)(t)&&(n?t.add(e):t.delete(e))}))}),[t,e]),(0,o.useCallback)((()=>{t.update((()=>{const e=(0,i.dL)();(0,i.iO)(e)&&e.clear()}))}),[t])]}},9591:(e,t,n)=>{"use strict";n.d(t,{V1:()=>N,Z1:()=>_,rc:()=>D,O:()=>x,c2:()=>P,rT:()=>I,UW:()=>j,ML:()=>F});var r=n(94900),i=n(64739),o=n(29016),s=n(31031),a=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)};const l="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,c=e=>l?(e||window).getSelection():null;function u(e,t,n,o){const a=e.getData("application/x-lexical-editor");if(a)try{const e=JSON.parse(a);if(e.namespace===n._config.namespace&&Array.isArray(e.nodes))return d(n,function(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n],o=(0,s.oC)(r);(0,s.Gg)(o)&&(0,i.vV)(o),t.push(o)}return t}(e.nodes),t)}catch(e){}if(!o||"insertReplacementText"!==o.inputType||!e.types.includes("text/plain")){const i=e.getData("text/html");if(i)try{const e=(new DOMParser).parseFromString(i,"text/html");return d(n,(0,r.s)(n,e),t)}catch(e){}}const l=e.getData("text/plain")||e.getData("text/uri-list");if(null!=l)if((0,s.OP)(t)){const e=l.split(/(\r?\n|\t)/);""===e[e.length-1]&&e.pop();for(let t=0;t<e.length;t++){const n=(0,s.dL)();if((0,s.OP)(n)){const r=e[t];"\n"===r||"\r\n"===r?n.insertParagraph():"\t"===r?n.insertNodes([(0,s.S3)()]):n.insertText(r)}}}else t.insertRawText(l)}function d(e,t,n){e.dispatchCommand(s.zr,{nodes:t,selection:n})||n.insertNodes(t)}function h(e,t,n,r=[]){let o=null===t||n.isSelected(t);const l=(0,s.F7)(n)&&n.excludeFromCopy("html");let c=n;if(null!==t){let e=(0,i.B3)(n);e=(0,s.Gg)(e)&&null!==t?(0,i.bA)(t,e):e,c=e}const u=(0,s.F7)(c)?c.getChildren():[],d=function(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&a(58,n.name),(0,s.F7)(e)){const e=t.children;Array.isArray(e)||a(59,n.name)}return t}(c);if((0,s.Gg)(c)){const e=c.__text;e.length>0?d.text=e:o=!1}for(let r=0;r<u.length;r++){const i=u[r],a=h(e,t,i,d.children);!o&&(0,s.F7)(n)&&a&&n.extractWithChild(i,t,"clone")&&(o=!0)}if(o&&!l)r.push(d);else if(Array.isArray(d.children))for(let e=0;e<d.children.length;e++){const t=d.children[e];r.push(t)}return o}let p=null;async function f(e,t){if(null!==p)return!1;if(null!==t)return new Promise(((n,r)=>{e.update((()=>{n(g(e,t))}))}));const n=e.getRootElement(),r=null==e._window?window.document:e._window.document,i=c(e._window);if(null===n||null===i)return!1;const a=r.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(r.createTextNode("#")),n.append(a);const l=new Range;return l.setStart(a,0),l.setEnd(a,1),i.removeAllRanges(),i.addRange(l),new Promise(((t,n)=>{const i=e.registerCommand(s.LV,(n=>((0,o.nh)(n,ClipboardEvent)&&(i(),null!==p&&(window.clearTimeout(p),p=null),t(g(e,n))),!0)),s.jw);p=window.setTimeout((()=>{i(),p=null,t(!1)}),50),r.execCommand("copy"),a.remove()}))}function g(e,t){const n=c(e._window);if(!n)return!1;const i=n.anchorNode,o=n.focusNode;if(null!==i&&null!==o&&!(0,s.af)(e,i,o))return!1;t.preventDefault();const l=t.clipboardData,u=(0,s.dL)();if(null===l||null===u)return!1;const d=function(e){const t=(0,s.dL)();return null==t&&a(166),(0,s.OP)(t)&&t.isCollapsed()||0===t.getNodes().length?"":(0,r.S)(e,t)}(e),p=function(e){const t=(0,s.dL)();return null==t&&a(166),(0,s.OP)(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(function(e,t){const n=[],r=(0,s.Gv)().getChildren();for(let i=0;i<r.length;i++)h(e,t,r[i],n);return{namespace:e._config.namespace,nodes:n}}(e,t))}(e);let f="";return null!==u&&(f=u.getTextContent()),null!==d&&l.setData("text/html",d),null!==p&&l.setData("application/x-lexical-editor",p),l.setData("text/plain",f),!0}function m(e,t){if(void 0!==document.caretRangeFromPoint){const n=document.caretRangeFromPoint(e,t);return null===n?null:{node:n.startContainer,offset:n.startOffset}}if("undefined"!==document.caretPositionFromPoint){const n=document.caretPositionFromPoint(e,t);return null===n?null:{node:n.offsetNode,offset:n.offset}}return null}const y="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,v=y&&"documentMode"in document?document.documentMode:null;y&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),y&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);const A=!(!y||!("InputEvent"in window)||v)&&"getTargetRanges"in new window.InputEvent("input"),b=y&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),w=y&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,S=(y&&/Android/.test(navigator.userAgent),y&&/^(?=.*Chrome).*/i.test(navigator.userAgent)),C=y&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!S,E=(0,s.fA)("DRAG_DROP_PASTE_FILE");class I extends s.HX{static getType(){return"quote"}static clone(e){return new I(e.__key)}constructor(e){super(e)}createDOM(e){const t=document.createElement("blockquote");return(0,o.Yo)(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:O,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&(0,s.Re)(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){const t=_();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(e,t){const n=(0,s.BE)(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,t),n}collapseAtStart(){const e=(0,s.BE)();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}}function _(){return(0,s.U2)(new I)}function x(e){return e instanceof I}class P extends s.HX{static getType(){return"heading"}static clone(e){return new P(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}createDOM(e){const t=this.__tag,n=document.createElement(t),r=e.theme.heading;if(void 0!==r){const e=r[t];(0,o.Yo)(n,e)}return n}updateDOM(e,t){return!1}static importDOM(){return{h1:e=>({conversion:B,priority:0}),h2:e=>({conversion:B,priority:0}),h3:e=>({conversion:B,priority:0}),h4:e=>({conversion:B,priority:0}),h5:e=>({conversion:B,priority:0}),h6:e=>({conversion:B,priority:0}),p:e=>{const t=e.firstChild;return null!==t&&k(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>k(e)?{conversion:e=>({node:N("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&(0,s.Re)(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){const t=N(e.tag);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(e,t=!0){const n=e?e.anchor.offset:0,r=n!==this.getTextContentSize()&&e?N(this.getTag()):(0,s.BE)(),i=this.getDirection();if(r.setDirection(i),this.insertAfter(r,t),0===n&&!this.isEmpty()&&e){const e=(0,s.BE)();e.select(),this.replace(e,!0)}return r}collapseAtStart(){const e=this.isEmpty()?(0,s.BE)():N(this.getTag());return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}extractWithChild(){return!0}}function k(e){return"span"===e.nodeName.toLowerCase()&&"26pt"===e.style.fontSize}function B(e){const t=e.nodeName.toLowerCase();let n=null;return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t||(n=N(t),null!==e.style&&n.setFormat(e.style.textAlign)),{node:n}}function O(e){const t=_();return null!==e.style&&t.setFormat(e.style.textAlign),{node:t}}function N(e){return(0,s.U2)(new P(e))}function D(e){return e instanceof P}function j(e){let t=null;if((0,o.nh)(e,DragEvent)?t=e.dataTransfer:(0,o.nh)(e,ClipboardEvent)&&(t=e.clipboardData),null===t)return[!1,[],!1];const n=t.types,r=n.includes("Files"),i=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(t.files),i]}function T(e){const t=(0,s.dL)();if(!(0,s.OP)(t))return!1;const n=new Set,r=t.getNodes();for(let t=0;t<r.length;t++){const i=r[t],a=i.getKey();if(n.has(a))continue;const l=(0,o.$s)(i,(e=>(0,s.F7)(e)&&!e.isInline()));if(null===l)continue;const c=l.getKey();l.canIndent()&&!n.has(c)&&(n.add(c),e(l))}return n.size>0}function M(e){const t=(0,s.Xo)(e);return(0,s.k$)(t)}function F(e){return(0,o.qV)(e.registerCommand(s.Kr,(e=>{const t=(0,s.dL)();return!!(0,s.iO)(t)&&(t.clear(),!0)}),0),e.registerCommand(s.Mt,(e=>{const t=(0,s.dL)();return!!(0,s.OP)(t)&&(t.deleteCharacter(e),!0)}),s.VN),e.registerCommand(s.cj,(e=>{const t=(0,s.dL)();return!!(0,s.OP)(t)&&(t.deleteWord(e),!0)}),s.VN),e.registerCommand(s.n2,(e=>{const t=(0,s.dL)();return!!(0,s.OP)(t)&&(t.deleteLine(e),!0)}),s.VN),e.registerCommand(s.yF,(t=>{const n=(0,s.dL)();if("string"==typeof t)null!==n&&n.insertText(t);else{if(null===n)return!1;const r=t.dataTransfer;if(null!=r)u(r,n,e,t);else if((0,s.OP)(n)){const e=t.data;return e&&n.insertText(e),!0}}return!0}),s.VN),e.registerCommand(s.RJ,(()=>{const e=(0,s.dL)();return!!(0,s.OP)(e)&&(e.removeText(),!0)}),s.VN),e.registerCommand(s.Ew,(e=>{const t=(0,s.dL)();return!!(0,s.OP)(t)&&(t.formatText(e),!0)}),s.VN),e.registerCommand(s.RO,(e=>{const t=(0,s.dL)();if(!(0,s.OP)(t)&&!(0,s.iO)(t))return!1;const n=t.getNodes();for(const t of n){const n=(0,o.$s)(t,(e=>(0,s.F7)(e)&&!e.isInline()));null!==n&&n.setFormat(e)}return!0}),s.VN),e.registerCommand(s.WH,(e=>{const t=(0,s.dL)();return!!(0,s.OP)(t)&&(t.insertLineBreak(e),!0)}),s.VN),e.registerCommand(s.K0,(()=>{const e=(0,s.dL)();return!!(0,s.OP)(e)&&(e.insertParagraph(),!0)}),s.VN),e.registerCommand(s.cA,(()=>((0,s.od)([(0,s.S3)()]),!0)),s.VN),e.registerCommand(s.PU,(()=>T((e=>{const t=e.getIndent();e.setIndent(t+1)}))),s.VN),e.registerCommand(s.cz,(()=>T((e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}))),s.VN),e.registerCommand(s._0,(e=>{const t=(0,s.dL)();if((0,s.iO)(t)&&!M(e.target)){const e=t.getNodes();if(e.length>0)return e[0].selectPrevious(),!0}else if((0,s.OP)(t)){const n=(0,s.fL)(t.focus,!0);if(!e.shiftKey&&(0,s.k$)(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),e.preventDefault(),!0}return!1}),s.VN),e.registerCommand(s.Zb,(e=>{const t=(0,s.dL)();if((0,s.iO)(t)){const e=t.getNodes();if(e.length>0)return e[0].selectNext(0,0),!0}else if((0,s.OP)(t)){if(function(e){const t=e.focus;return"root"===t.key&&t.offset===(0,s.Gv)().getChildrenSize()}(t))return e.preventDefault(),!0;const n=(0,s.fL)(t.focus,!1);if(!e.shiftKey&&(0,s.k$)(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),e.preventDefault(),!0}return!1}),s.VN),e.registerCommand(s.u$,(e=>{const t=(0,s.dL)();if((0,s.iO)(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectPrevious(),!0}if(!(0,s.OP)(t))return!1;if((0,i.pi)(t,!0)){const n=e.shiftKey;return e.preventDefault(),(0,i.i0)(t,n,!0),!0}return!1}),s.VN),e.registerCommand(s.Nm,(e=>{const t=(0,s.dL)();if((0,s.iO)(t)&&!M(e.target)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectNext(0,0),!0}if(!(0,s.OP)(t))return!1;const n=e.shiftKey;return!!(0,i.pi)(t,!1)&&(e.preventDefault(),(0,i.i0)(t,n,!1),!0)}),s.VN),e.registerCommand(s.aR,(t=>{if(M(t.target))return!1;const n=(0,s.dL)();if(!(0,s.OP)(n))return!1;t.preventDefault();const{anchor:r}=n,i=r.getNode();return n.isCollapsed()&&0===r.offset&&!(0,s.wd)(i)&&(0,o.f8)(i).getIndent()>0?e.dispatchCommand(s.cz,void 0):e.dispatchCommand(s.Mt,!0)}),s.VN),e.registerCommand(s.MK,(t=>{if(M(t.target))return!1;const n=(0,s.dL)();return!!(0,s.OP)(n)&&(t.preventDefault(),e.dispatchCommand(s.Mt,!1))}),s.VN),e.registerCommand(s.XN,(t=>{const n=(0,s.dL)();if(!(0,s.OP)(n))return!1;if(null!==t){if((w||b||C)&&A)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(s.WH,!1)}return e.dispatchCommand(s.K0,void 0)}),s.VN),e.registerCommand(s.Zq,(()=>{const t=(0,s.dL)();return!!(0,s.OP)(t)&&(e.blur(),!0)}),s.VN),e.registerCommand(s.zD,(t=>{const[,n]=j(t);if(n.length>0){const r=m(t.clientX,t.clientY);if(null!==r){const{offset:t,node:i}=r,o=(0,s.Xo)(i);if(null!==o){const e=(0,s.vN)();if((0,s.Gg)(o))e.anchor.set(o.getKey(),t,"text"),e.focus.set(o.getKey(),t,"text");else{const t=o.getParentOrThrow().getKey(),n=o.getIndexWithinParent()+1;e.anchor.set(t,n,"element"),e.focus.set(t,n,"element")}const n=(0,s.S9)(e);(0,s.oq)(n)}e.dispatchCommand(E,n)}return t.preventDefault(),!0}const r=(0,s.dL)();return!!(0,s.OP)(r)}),s.VN),e.registerCommand(s.XI,(e=>{const[t]=j(e),n=(0,s.dL)();return!(t&&!(0,s.OP)(n))}),s.VN),e.registerCommand(s.kE,(e=>{const[t]=j(e),n=(0,s.dL)();if(t&&!(0,s.OP)(n))return!1;const r=m(e.clientX,e.clientY);if(null!==r){const t=(0,s.Xo)(r.node);(0,s.k$)(t)&&e.preventDefault()}return!0}),s.VN),e.registerCommand(s.Hr,(()=>((0,s.UL)(),!0)),s.VN),e.registerCommand(s.LV,(t=>(f(e,(0,o.nh)(t,ClipboardEvent)?t:null),!0)),s.VN),e.registerCommand(s.dR,(t=>(async function(e,t){await f(t,(0,o.nh)(e,ClipboardEvent)?e:null),t.update((()=>{const e=(0,s.dL)();(0,s.OP)(e)?e.removeText():(0,s.iO)(e)&&e.getNodes().forEach((e=>e.remove()))}))}(t,e),!0)),s.VN),e.registerCommand(s.A1,(t=>{const[,n,r]=j(t);return n.length>0&&!r?(e.dispatchCommand(E,n),!0):!(0,s.GA)(t.target)&&null!==(0,s.dL)()&&(function(e,t){e.preventDefault(),t.update((()=>{const n=(0,s.dL)(),r=(0,o.nh)(e,InputEvent)||(0,o.nh)(e,KeyboardEvent)?null:e.clipboardData;null!=r&&null!==n&&u(r,n,t)}),{tag:"paste"})}(t,e),!0)}),s.VN))}},64739:(e,t,n)=>{"use strict";n.d(t,{B3:()=>a,Hz:()=>d,P4:()=>c,bA:()=>l,i0:()=>p,pi:()=>h,vV:()=>u});var r,i=n(31031),o=(r=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;const s=new Map;function a(e){const t=e.constructor.clone(e);return t.__parent=e.__parent,t.__next=e.__next,t.__prev=e.__prev,(0,i.F7)(e)&&(0,i.F7)(t)?(r=e,(n=t).__first=r.__first,n.__last=r.__last,n.__size=r.__size,n.__format=r.__format,n.__indent=r.__indent,n.__dir=r.__dir,n):(0,i.Gg)(e)&&(0,i.Gg)(t)?function(e,t){return e.__format=t.__format,e.__style=t.__style,e.__mode=t.__mode,e.__detail=t.__detail,e}(t,e):(0,i.Rl)(e)&&(0,i.Rl)(t)?function(e,t){return e.__textFormat=t.__textFormat,e}(t,e):t;var n,r}function l(e,t){const n=e.getStartEndPoints();if(t.isSelected(e)&&!t.isSegmented()&&!t.isToken()&&null!==n){const[r,o]=n,s=e.isBackward(),a=r.getNode(),l=o.getNode(),c=t.is(a),u=t.is(l);if(c||u){const[n,r]=(0,i.cs)(e),o=a.is(l),c=t.is(s?l:a),u=t.is(s?a:l);let d,h=0;return o?(h=n>r?r:n,d=n>r?n:r):c?(h=s?r:n,d=void 0):u&&(h=0,d=s?n:r),t.__text=t.__text.slice(h,d),t}}return t}function c(e){if("text"===e.type)return e.offset===e.getNode().getTextContentSize();const t=e.getNode();return(0,i.F7)(t)||o(177),e.offset===t.getChildrenSize()}function u(e){const t=e.getStyle(),n=function(e){const t={},n=e.split(";");for(const e of n)if(""!==e){const[n,r]=e.split(/:([^]+)/);n&&r&&(t[n.trim()]=r.trim())}return t}(t);s.set(t,n)}function d(e,t){if(null===e)return;const n=e.getStartEndPoints(),r=n?n[0]:null;if(null!==r&&"root"===r.key){const e=t(),n=(0,i.Gv)(),r=n.getFirstChild();return void(r?r.replace(e,!0):n.append(e))}const s=e.getNodes(),a=null!==r&&function(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}(r.getNode(),f);a&&-1===s.indexOf(a)&&s.push(a);for(let e=0;e<s.length;e++){const n=s[e];if(!f(n))continue;(0,i.F7)(n)||o(178);const r=t();r.setFormat(n.getFormatType()),r.setIndent(n.getIndent()),n.replace(r,!0)}}function h(e,t){const n=(0,i.fL)(e.focus,t);return(0,i.k$)(n)&&!n.isIsolated()||(0,i.F7)(n)&&!n.isInline()&&!n.canBeEmpty()}function p(e,t,n){const r=function(e){const t=e.anchor.getNode();return"rtl"===((0,i.wd)(t)?t:t.getParentOrThrow()).getDirection()}(e);!function(e,t,n,r){e.modify(t?"extend":"move",n,"character")}(e,t,n?!r:r)}function f(e){if((0,i.k$)(e))return!1;if(!(0,i.F7)(e)||(0,i._v)(e))return!1;const t=e.getFirstChild(),n=null===t||(0,i.A3)(t)||(0,i.Gg)(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}},65268:(e,t,n)=>{"use strict";n.d(t,{$r:()=>T,CS:()=>j,Cr:()=>a,EX:()=>_,Fh:()=>ue,Fk:()=>b,TF:()=>u,Xf:()=>f,Yp:()=>S,bF:()=>d,bk:()=>k,di:()=>pe,eb:()=>N,g0:()=>h,gz:()=>he,kS:()=>P,kr:()=>D,ku:()=>c,ng:()=>G,q1:()=>C,rN:()=>H,rU:()=>x,to:()=>g,uv:()=>A,xo:()=>s,yb:()=>E,zO:()=>R});var r=n(29016),i=n(31031);const o=/^(\d+(?:\.\d+)?)px$/,s={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class a extends i.HX{static getType(){return"tablecell"}static clone(e){const t=new a(e.__headerState,e.__colSpan,e.__width,e.__key);return t.__rowSpan=e.__rowSpan,t.__backgroundColor=e.__backgroundColor,t}static importDOM(){return{td:e=>({conversion:l,priority:0}),th:e=>({conversion:l,priority:0})}}static importJSON(e){const t=e.colSpan||1,n=e.rowSpan||1,r=c(e.headerState,t,e.width||void 0);return r.__rowSpan=n,r.__backgroundColor=e.backgroundColor||null,r}constructor(e=s.NO_STATUS,t=1,n,r){super(r),this.__colSpan=t,this.__rowSpan=1,this.__headerState=e,this.__width=n,this.__backgroundColor=null}createDOM(e){const t=document.createElement(this.getTag());return this.__width&&(t.style.width=`${this.__width}px`),this.__colSpan>1&&(t.colSpan=this.__colSpan),this.__rowSpan>1&&(t.rowSpan=this.__rowSpan),null!==this.__backgroundColor&&(t.style.backgroundColor=this.__backgroundColor),(0,r.Yo)(t,e.theme.tableCell,this.hasHeader()&&e.theme.tableCellHeader),t}exportDOM(e){const{element:t}=super.exportDOM(e);if(t){const e=t;e.style.border="1px solid black",this.__colSpan>1&&(e.colSpan=this.__colSpan),this.__rowSpan>1&&(e.rowSpan=this.__rowSpan),e.style.width=`${this.getWidth()||75}px`,e.style.verticalAlign="top",e.style.textAlign="start";const n=this.getBackgroundColor();null!==n?e.style.backgroundColor=n:this.hasHeader()&&(e.style.backgroundColor="#f2f3f5")}return{element:t}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,type:"tablecell",width:this.getWidth()}}getColSpan(){return this.__colSpan}setColSpan(e){return this.getWritable().__colSpan=e,this}getRowSpan(){return this.__rowSpan}setRowSpan(e){return this.getWritable().__rowSpan=e,this}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(e){return this.getWritable().__headerState=e,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(e){return this.getWritable().__width=e,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(e){this.getWritable().__backgroundColor=e}toggleHeaderStyle(e){const t=this.getWritable();return(t.__headerState&e)===e?t.__headerState-=e:t.__headerState+=e,t}hasHeaderState(e){return(this.getHeaderStyles()&e)===e}hasHeader(){return this.getLatest().__headerState!==s.NO_STATUS}updateDOM(e){return e.__headerState!==this.__headerState||e.__width!==this.__width||e.__colSpan!==this.__colSpan||e.__rowSpan!==this.__rowSpan||e.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function l(e){const t=e,n=e.nodeName.toLowerCase();let r;o.test(t.style.width)&&(r=parseFloat(t.style.width));const a=c("th"===n?s.ROW:s.NO_STATUS,t.colSpan,r);a.__rowSpan=t.rowSpan;const l=t.style.backgroundColor;""!==l&&(a.__backgroundColor=l);const d=t.style,h=d.textDecoration.split(" "),p="700"===d.fontWeight||"bold"===d.fontWeight,f=h.includes("line-through"),g="italic"===d.fontStyle,m=h.includes("underline");return{after:e=>(0===e.length&&e.push((0,i.BE)()),e),forChild:(e,t)=>{if(u(t)&&!(0,i.F7)(e)){const t=(0,i.BE)();return(0,i.A3)(e)&&"\n"===e.getTextContent()?null:((0,i.Gg)(e)&&(p&&e.toggleFormat("bold"),f&&e.toggleFormat("strikethrough"),g&&e.toggleFormat("italic"),m&&e.toggleFormat("underline")),t.append(e),t)}return e},node:a}}function c(e,t=1,n){return(0,i.U2)(new a(e,t,n))}function u(e){return e instanceof a}const d=(0,i.fA)("INSERT_TABLE_COMMAND");class h extends i.HX{static getType(){return"tablerow"}static clone(e){return new h(e.__height,e.__key)}static importDOM(){return{tr:e=>({conversion:p,priority:0})}}static importJSON(e){return f(e.height)}constructor(e,t){super(t),this.__height=e}exportJSON(){return{...super.exportJSON(),...this.getHeight()&&{height:this.getHeight()},type:"tablerow",version:1}}createDOM(e){const t=document.createElement("tr");return this.__height&&(t.style.height=`${this.__height}px`),(0,r.Yo)(t,e.theme.tableRow),t}isShadowRoot(){return!0}setHeight(e){return this.getWritable().__height=e,this.__height}getHeight(){return this.getLatest().__height}updateDOM(e){return e.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function p(e){const t=e;let n;return o.test(t.style.height)&&(n=parseFloat(t.style.height)),{node:f(n)}}function f(e){return(0,i.U2)(new h(e))}function g(e){return e instanceof h}var m,y=(m=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})&&m.__esModule&&Object.prototype.hasOwnProperty.call(m,"default")?m.default:m;const v="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function A(e,t,n=!0){const r=he();for(let o=0;o<e;o++){const e=f();for(let r=0;r<t;r++){let t=s.NO_STATUS;"object"==typeof n?(0===o&&n.rows&&(t|=s.ROW),0===r&&n.columns&&(t|=s.COLUMN)):n&&(0===o&&(t|=s.ROW),0===r&&(t|=s.COLUMN));const a=c(t),l=(0,i.BE)();l.append((0,i.MX)()),a.append(l),e.append(a)}r.append(e)}return r}function b(e){const t=(0,r.$s)(e,(e=>u(e)));return u(t)?t:null}function w(e){const t=(0,r.$s)(e,(e=>g(e)));if(g(t))return t;throw new Error("Expected table cell to be inside of table row.")}function S(e){const t=(0,r.$s)(e,(e=>pe(e)));if(pe(t))return t;throw new Error("Expected table cell to be inside of table.")}function C(e){const t=w(e);return S(t).getChildren().findIndex((e=>e.is(t)))}function E(e){return w(e).getChildren().findIndex((t=>t.is(e)))}const I=(e,t)=>e===s.BOTH||e===t?t:s.NO_STATUS;function _(e=!0){const t=(0,i.dL)();(0,i.OP)(t)||R(t)||y(118);const n=t.focus.getNode(),[r,,o]=T(n),[a,l]=D(o,r,r),u=a[0].length,{startRow:d}=l;if(e){const e=d+r.__rowSpan-1,t=a[e],n=f();for(let r=0;r<u;r++){const{cell:o,startRow:a}=t[r];if(a+o.__rowSpan-1<=e){const e=t[r].cell.__headerState,o=I(e,s.COLUMN);n.append(c(o).append((0,i.BE)()))}else o.setRowSpan(o.__rowSpan+1)}const l=o.getChildAtIndex(e);g(l)||y(145),l.insertAfter(n)}else{const e=a[d],t=f();for(let n=0;n<u;n++){const{cell:r,startRow:o}=e[n];if(o===d){const r=e[n].cell.__headerState,o=I(r,s.COLUMN);t.append(c(o).append((0,i.BE)()))}else r.setRowSpan(r.__rowSpan+1)}const n=o.getChildAtIndex(d);g(n)||y(145),n.insertBefore(t)}}function x(e=!0){const t=(0,i.dL)();(0,i.OP)(t)||R(t)||y(118);const n=t.anchor.getNode(),r=t.focus.getNode(),[o]=T(n),[a,,l]=T(r),[u,d,h]=D(l,a,o),p=u.length,f=e?Math.max(d.startColumn,h.startColumn):Math.min(d.startColumn,h.startColumn),m=e?f+a.__colSpan-1:f-1,v=l.getFirstChild();g(v)||y(120);let A=null;function b(e=s.NO_STATUS){const t=c(e).append((0,i.BE)());return null===A&&(A=t),t}let w=v;e:for(let e=0;e<p;e++){if(0!==e){const e=w.getNextSibling();g(e)||y(121),w=e}const t=u[e],n=t[m<0?0:m].cell.__headerState,r=I(n,s.ROW);if(m<0){O(w,b(r));continue}const{cell:i,startColumn:o,startRow:a}=t[m];if(o+i.__colSpan-1<=m){let n=i,o=a,s=m;for(;o!==e&&n.__rowSpan>1;){if(s-=i.__colSpan,!(s>=0)){w.append(b(r));continue e}{const{cell:e,startRow:r}=t[s];n=e,o=r}}n.insertAfter(b(r))}else i.setColSpan(i.__colSpan+1)}null!==A&&B(A)}function P(){const e=(0,i.dL)();(0,i.OP)(e)||R(e)||y(118);const t=e.anchor.getNode(),n=e.focus.getNode(),[r,,o]=T(t),[s]=T(n),[a,l,c]=D(o,r,s),{startRow:u}=l,{startRow:d}=c,h=d+s.__rowSpan-1;if(a.length===h-u+1)return void o.remove();const p=a[0].length,f=a[h+1],m=o.getChildAtIndex(h+1);for(let e=h;e>=u;e--){for(let t=p-1;t>=0;t--){const{cell:n,startRow:r,startColumn:i}=a[e][t];if(i===t&&(e===u&&r<u&&n.setRowSpan(n.__rowSpan-(r-u)),r>=u&&r+n.__rowSpan-1>h))if(n.setRowSpan(n.__rowSpan-(h-r+1)),null===m&&y(122),0===t)O(m,n);else{const{cell:e}=f[t-1];e.insertAfter(n)}}const t=o.getChildAtIndex(e);g(t)||y(123,String(e)),t.remove()}if(void 0!==f){const{cell:e}=f[0];B(e)}else{const e=a[u-1],{cell:t}=e[0];B(t)}}function k(){const e=(0,i.dL)();(0,i.OP)(e)||R(e)||y(118);const t=e.anchor.getNode(),n=e.focus.getNode(),[r,,o]=T(t),[s]=T(n),[a,l,c]=D(o,r,s),{startColumn:u}=l,{startRow:d,startColumn:h}=c,p=Math.min(u,h),f=Math.max(u+r.__colSpan-1,h+s.__colSpan-1),g=f-p+1;if(a[0].length===f-p+1)return o.selectPrevious(),void o.remove();const m=a.length;for(let e=0;e<m;e++)for(let t=p;t<=f;t++){const{cell:n,startColumn:r}=a[e][t];if(r<p){if(t===p){const e=p-r;n.setColSpan(n.__colSpan-Math.min(g,n.__colSpan-e))}}else if(r+n.__colSpan-1>f){if(t===f){const e=f-r+1;n.setColSpan(n.__colSpan-e)}}else n.remove()}const v=a[d],A=v[h+s.__colSpan];if(void 0!==A){const{cell:e}=A;B(e)}else{const e=v[h-1],{cell:t}=e;B(t)}}function B(e){const t=e.getFirstDescendant();null==t?e.selectStart():t.getParentOrThrow().selectStart()}function O(e,t){const n=e.getFirstChild();null!==n?n.insertBefore(t):e.append(t)}function N(){const e=(0,i.dL)();(0,i.OP)(e)||R(e)||y(118);const t=e.anchor.getNode(),[n,r,o]=T(t),a=n.__colSpan,l=n.__rowSpan;if(a>1){for(let e=1;e<a;e++)n.insertAfter(c(s.NO_STATUS));n.setColSpan(1)}if(l>1){const[e,t]=D(o,n,n),{startColumn:i,startRow:u}=t;let d;for(let t=1;t<l;t++){const n=u+t,o=e[n];d=(d||r).getNextSibling(),g(d)||y(125);let l=null;for(let e=0;e<i;e++){const t=o[e],r=t.cell;t.startRow===n&&(l=r),r.__colSpan>1&&(e+=r.__colSpan-1)}if(null===l)for(let e=0;e<a;e++)O(d,c(s.NO_STATUS));else for(let e=0;e<a;e++)l.insertAfter(c(s.NO_STATUS))}n.setRowSpan(1)}}function D(e,t,n){const[r,i,o]=j(e,t,n);return null===i&&y(110),null===o&&y(111),[r,i,o]}function j(e,t,n){const r=[];let i=null,o=null;function s(e,s,a){const l={cell:a,startColumn:s,startRow:e},c=a.__rowSpan,u=a.__colSpan;for(let t=0;t<c;t++){void 0===r[e+t]&&(r[e+t]=[]);for(let n=0;n<u;n++)r[e+t][s+n]=l}null!==t&&t.is(a)&&(i=l),null!==n&&n.is(a)&&(o=l)}function a(e,t){return void 0===r[e]||void 0===r[e][t]}const l=e.getChildren();for(let e=0;e<l.length;e++){const t=l[e];g(t)||y(146);const n=t.getChildren();let r=0;for(const t of n){for(u(t)||y(147);!a(e,r);)r++;s(e,r,t),r+=t.__colSpan}}return[r,i,o]}function T(e){let t;if(e instanceof a)t=e;else if("__type"in e){const n=(0,r.$s)(e,u);u(n)||y(148),t=n}else{const n=(0,r.$s)(e.getNode(),u);u(n)||y(148),t=n}const n=t.getParent();g(n)||y(149);const i=n.getParent();return pe(i)||y(150),[t,n,i]}function M(e){const[t,,n]=T(e),r=n.getChildren(),i=r.length,o=r[0].getChildren().length,s=new Array(i);for(let e=0;e<i;e++)s[e]=new Array(o);for(let e=0;e<i;e++){const n=r[e].getChildren();let i=0;for(let r=0;r<n.length;r++){for(;s[e][i];)i++;const o=n[r],a=o.__rowSpan||1,l=o.__colSpan||1;for(let t=0;t<a;t++)for(let n=0;n<l;n++)s[e+t][i+n]=o;if(t===o)return{colSpan:l,columnIndex:i,rowIndex:e,rowSpan:a};i+=l}}return null}class F{constructor(e,t,n){this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=e}getStartEndPoints(){return[this.anchor,this.focus]}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!R(e)&&this.tableKey===e.tableKey&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)}set(e,t,n){this.dirty=!0,this.tableKey=e,this.anchor.key=t,this.focus.key=n,this._cachedNodes=null}clone(){return new F(this.tableKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.focus.getNode();(0,i.F7)(t)||y(151),(0,i.S9)(t.select(0,t.getChildrenSize())).insertNodes(e)}getShape(){const e=(0,i.gI)(this.anchor.key);u(e)||y(152);const t=M(e);null===t&&y(153);const n=(0,i.gI)(this.focus.key);u(n)||y(154);const r=M(n);null===r&&y(155);const o=Math.min(t.columnIndex,r.columnIndex),s=Math.max(t.columnIndex,r.columnIndex),a=Math.min(t.rowIndex,r.rowIndex),l=Math.max(t.rowIndex,r.rowIndex);return{fromX:Math.min(o,s),fromY:Math.min(a,l),toX:Math.max(o,s),toY:Math.max(a,l)}}getNodes(){const e=this._cachedNodes;if(null!==e)return e;const t=this.anchor.getNode(),n=this.focus.getNode(),o=(0,r.$s)(t,u),s=(0,r.$s)(n,u);u(o)||y(152),u(s)||y(154);const a=o.getParent();g(a)||y(156);const l=a.getParent();pe(l)||y(157);const c=s.getParents()[1];if(c!==l){if(l.isParentOf(s)){const e=c.getParent();null==e&&y(159),this.set(this.tableKey,s.getKey(),e.getKey())}else{const e=l.getParent();null==e&&y(158),this.set(this.tableKey,e.getKey(),s.getKey())}return this.getNodes()}const[d,h,p]=D(l,o,s);let f=Math.min(h.startColumn,p.startColumn),m=Math.min(h.startRow,p.startRow),v=Math.max(h.startColumn+h.cell.__colSpan-1,p.startColumn+p.cell.__colSpan-1),A=Math.max(h.startRow+h.cell.__rowSpan-1,p.startRow+p.cell.__rowSpan-1),b=f,w=m,S=f,C=m;function E(e){const{cell:t,startColumn:n,startRow:r}=e;f=Math.min(f,n),m=Math.min(m,r),v=Math.max(v,n+t.__colSpan-1),A=Math.max(A,r+t.__rowSpan-1)}for(;f<b||m<w||v>S||A>C;){if(f<b){const e=C-w,t=b-1;for(let n=0;n<=e;n++)E(d[w+n][t]);b=t}if(m<w){const e=S-b,t=w-1;for(let n=0;n<=e;n++)E(d[t][b+n]);w=t}if(v>S){const e=C-w,t=S+1;for(let n=0;n<=e;n++)E(d[w+n][t]);S=t}if(A>C){const e=S-b,t=C+1;for(let n=0;n<=e;n++)E(d[t][b+n]);C=t}}const I=[l];let _=null;for(let e=m;e<=A;e++)for(let t=f;t<=v;t++){const{cell:n}=d[e][t],r=n.getParent();g(r)||y(160),r!==_&&I.push(r),I.push(n,...Q(n)),_=r}return(0,i._$)()||(this._cachedNodes=I),I}getTextContent(){const e=this.getNodes();let t="";for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}}function R(e){return e instanceof F}function L(){const e=(0,i.Qd)("root",0,"element"),t=(0,i.Qd)("root",0,"element");return new F("root",e,t)}function Q(e){const t=[],n=[e];for(;n.length>0;){const r=n.pop();void 0===r&&y(112),(0,i.F7)(r)&&n.unshift(...r.getChildren()),r!==e&&t.push(r)}return t}class U{constructor(e,t){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=t,this.editor=e,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.trackTable(),this.isSelecting=!1}getTable(){return this.table}removeListeners(){Array.from(this.listenersToRemove).forEach((e=>e()))}trackTable(){const e=new MutationObserver((e=>{this.editor.update((()=>{let t=!1;for(let n=0;n<e.length;n++){const r=e[n].target.nodeName;if("TABLE"===r||"TBODY"===r||"THEAD"===r||"TR"===r){t=!0;break}}if(!t)return;const n=this.editor.getElementByKey(this.tableNodeKey);if(!n)throw new Error("Expected to find TableElement in DOM");this.table=z(n)}))}));this.editor.update((()=>{const t=this.editor.getElementByKey(this.tableNodeKey);if(!t)throw new Error("Expected to find TableElement in DOM");this.table=z(t),e.observe(t,{childList:!0,subtree:!0})}))}clearHighlight(){const e=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),e.update((()=>{if(!pe((0,i.gI)(this.tableNodeKey)))throw new Error("Expected TableNode.");const t=e.getElementByKey(this.tableNodeKey);if(!t)throw new Error("Expected to find TableElement in DOM");const n=z(t);Z(e,n,null),(0,i.oq)(null),e.dispatchCommand(i.oj,void 0)}))}enableHighlightStyle(){const e=this.editor;e.update((()=>{const t=e.getElementByKey(this.tableNodeKey);if(!t)throw new Error("Expected to find TableElement in DOM");(0,r.PS)(t,e._config.theme.tableSelection),t.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1}))}disableHighlightStyle(){const e=this.editor;e.update((()=>{const t=e.getElementByKey(this.tableNodeKey);if(!t)throw new Error("Expected to find TableElement in DOM");(0,r.Yo)(t,e._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0}))}updateTableTableSelection(e){if(null!==e&&e.tableKey===this.tableNodeKey){const t=this.editor;this.tableSelection=e,this.isHighlightingCells=!0,this.disableHighlightStyle(),Z(t,this.table,this.tableSelection)}else null==e?this.clearHighlight():(this.tableNodeKey=e.tableKey,this.updateTableTableSelection(e))}setFocusCellForSelection(e,t=!1){const n=this.editor;n.update((()=>{const r=(0,i.gI)(this.tableNodeKey);if(!pe(r))throw new Error("Expected TableNode.");if(!n.getElementByKey(this.tableNodeKey))throw new Error("Expected to find TableElement in DOM");const o=e.x,s=e.y;if(this.focusCell=e,null!==this.anchorCell){const e=K(n._window);e&&e.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(this.isHighlightingCells||this.anchorX===o&&this.anchorY===s&&!t){if(o===this.focusX&&s===this.focusY)return}else this.isHighlightingCells=!0,this.disableHighlightStyle();if(this.focusX=o,this.focusY=s,this.isHighlightingCells){const t=(0,i.Xo)(e.elem);if(null!=this.tableSelection&&null!=this.anchorCellNodeKey&&u(t)&&r.is(oe(t))){const e=t.getKey();this.tableSelection=this.tableSelection.clone()||L(),this.focusCellNodeKey=e,this.tableSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),(0,i.oq)(this.tableSelection),n.dispatchCommand(i.oj,void 0),Z(n,this.table,this.tableSelection)}}}))}setAnchorCellForSelection(e){this.isHighlightingCells=!1,this.anchorCell=e,this.anchorX=e.x,this.anchorY=e.y,this.editor.update((()=>{const t=(0,i.Xo)(e.elem);if(u(t)){const e=t.getKey();this.tableSelection=null!=this.tableSelection?this.tableSelection.clone():L(),this.anchorCellNodeKey=e}}))}formatCells(e){this.editor.update((()=>{const t=(0,i.dL)();R(t)||y(11);const n=(0,i.vN)(),r=n.anchor,o=n.focus;t.getNodes().forEach((t=>{u(t)&&0!==t.getTextContentSize()&&(r.set(t.getKey(),0,"element"),o.set(t.getKey(),t.getChildrenSize(),"element"),n.formatText(e))})),(0,i.oq)(t),this.editor.dispatchCommand(i.oj,void 0)}))}clearText(){const e=this.editor;e.update((()=>{const t=(0,i.gI)(this.tableNodeKey);if(!pe(t))throw new Error("Expected TableNode.");const n=(0,i.dL)();R(n)||y(11);const r=n.getNodes().filter(u);r.length!==this.table.columns*this.table.rows?(r.forEach((e=>{if((0,i.F7)(e)){const t=(0,i.BE)(),n=(0,i.MX)();t.append(n),e.append(t),e.getChildren().forEach((e=>{e!==t&&e.remove()}))}})),Z(e,this.table,null),(0,i.oq)(null),e.dispatchCommand(i.oj,void 0)):(t.selectPrevious(),t.remove(),(0,i.Gv)().selectStart())}))}}const V="__lexicalTableSelection",K=e=>v?(e||window).getSelection():null;function H(e,t,n,o){const s=n.getRootElement();if(null===s)throw new Error("No root element.");const a=new U(n,e.getKey()),l=n._window||window;!function(e,t){e[V]=t}(t,a);const c=()=>{const e=()=>{a.isSelecting=!1,l.removeEventListener("mouseup",e),l.removeEventListener("mousemove",t)},t=n=>{setTimeout((()=>{if(1&~n.buttons&&a.isSelecting)return a.isSelecting=!1,l.removeEventListener("mouseup",e),void l.removeEventListener("mousemove",t);const r=Y(n.target);null===r||a.anchorX===r.x&&a.anchorY===r.y||(n.preventDefault(),a.setFocusCellForSelection(r))}),0)};return{onMouseMove:t,onMouseUp:e}};t.addEventListener("mousedown",(e=>{setTimeout((()=>{if(0!==e.button)return;if(!l)return;const t=Y(e.target);null!==t&&(ae(e),a.setAnchorCellForSelection(t));const{onMouseUp:n,onMouseMove:r}=c();a.isSelecting=!0,l.addEventListener("mouseup",n),l.addEventListener("mousemove",r)}),0)}));const d=e=>{0===e.button&&n.update((()=>{const t=(0,i.dL)(),n=e.target;R(t)&&t.tableKey===a.tableNodeKey&&s.contains(n)&&a.clearHighlight()}))};l.addEventListener("mousedown",d),a.listenersToRemove.add((()=>l.removeEventListener("mousedown",d))),a.listenersToRemove.add(n.registerCommand(i.Zb,(t=>se(n,t,"down",e,a)),i.Eo)),a.listenersToRemove.add(n.registerCommand(i._0,(t=>se(n,t,"up",e,a)),i.Eo)),a.listenersToRemove.add(n.registerCommand(i.u$,(t=>se(n,t,"backward",e,a)),i.Eo)),a.listenersToRemove.add(n.registerCommand(i.Nm,(t=>se(n,t,"forward",e,a)),i.Eo)),a.listenersToRemove.add(n.registerCommand(i.Zq,(e=>{const t=(0,i.dL)();if(R(t)){const n=(0,r.$s)(t.focus.getNode(),u);if(u(n))return ae(e),n.selectEnd(),!0}return!1}),i.Eo)),[i.cj,i.n2,i.Mt].forEach((t=>{a.listenersToRemove.add(n.registerCommand(t,(t=>()=>{const n=(0,i.dL)();if(!$(n,e))return!1;if(R(n))return a.clearText(),!0;if((0,i.OP)(n)){const o=(0,r.$s)(n.anchor.getNode(),(e=>u(e)));if(!u(o))return!1;const s=n.anchor.getNode(),l=n.focus.getNode(),c=e.isParentOf(s),d=e.isParentOf(l);if(c&&!d||d&&!c)return a.clearText(),!0;const h=(0,r.$s)(n.anchor.getNode(),(e=>(0,i.F7)(e))),p=h&&(0,r.$s)(h,(e=>(0,i.F7)(e)&&u(e.getParent())));if(!(0,i.F7)(p)||!(0,i.F7)(h))return!1;if(t===i.n2&&null===p.getPreviousSibling())return!0}return!1})(t),i.jw))}));const h=t=>{const n=(0,i.dL)();if(!$(n,e))return!1;if(R(n))return t.preventDefault(),t.stopPropagation(),a.clearText(),!0;if((0,i.OP)(n)){const e=(0,r.$s)(n.anchor.getNode(),(e=>u(e)));if(!u(e))return!1}return!1};function p(t){const n=e.getCordsFromCellNode(t,a.table);return e.getDOMCellFromCordsOrThrow(n.x,n.y,a.table)}return a.listenersToRemove.add(n.registerCommand(i.aR,h,i.jw)),a.listenersToRemove.add(n.registerCommand(i.MK,h,i.jw)),a.listenersToRemove.add(n.registerCommand(i.Ew,(t=>{const n=(0,i.dL)();if(!$(n,e))return!1;if(R(n))return a.formatCells(t),!0;if((0,i.OP)(n)){const e=(0,r.$s)(n.anchor.getNode(),(e=>u(e)));if(!u(e))return!1}return!1}),i.jw)),a.listenersToRemove.add(n.registerCommand(i.RO,(t=>{const n=(0,i.dL)();if(!R(n)||!$(n,e))return!1;const r=n.anchor.getNode(),o=n.focus.getNode();if(!u(r)||!u(o))return!1;const[s,a,l]=D(e,r,o),c=Math.max(a.startRow,l.startRow),d=Math.max(a.startColumn,l.startColumn),h=Math.min(a.startRow,l.startRow),p=Math.min(a.startColumn,l.startColumn);for(let e=h;e<=c;e++)for(let n=p;n<=d;n++){const r=s[e][n].cell;r.setFormat(t);const o=r.getChildren();for(let e=0;e<o.length;e++){const n=o[e];(0,i.F7)(n)&&!n.isInline()&&n.setFormat(t)}}return!0}),i.jw)),a.listenersToRemove.add(n.registerCommand(i.yF,(t=>{const o=(0,i.dL)();if(!$(o,e))return!1;if(R(o))return a.clearHighlight(),!1;if((0,i.OP)(o)){const s=(0,r.$s)(o.anchor.getNode(),(e=>u(e)));if(!u(s))return!1;if("string"==typeof t){const r=ce(n,o,e);if(r)return le(r,e,[(0,i.MX)(t)]),!0}}return!1}),i.jw)),o&&a.listenersToRemove.add(n.registerCommand(i.dB,(t=>{const n=(0,i.dL)();if(!(0,i.OP)(n)||!n.isCollapsed()||!$(n,e))return!1;const r=ie(n.anchor.getNode());if(null===r)return!1;ae(t);const o=e.getCordsFromCellNode(r,a.table);return J(a,e,o.x,o.y,t.shiftKey?"backward":"forward"),!0}),i.jw)),a.listenersToRemove.add(n.registerCommand(i.m$,(t=>e.isSelected()),i.Eo)),a.listenersToRemove.add(n.registerCommand(i.zr,(e=>{const{nodes:t,selection:n}=e,o=n.getStartEndPoints(),s=R(n),a=(0,i.OP)(n)&&null!==(0,r.$s)(n.anchor.getNode(),(e=>u(e)))&&null!==(0,r.$s)(n.focus.getNode(),(e=>u(e)))||s;if(1!==t.length||!pe(t[0])||!a||null===o)return!1;const[l]=o,c=t[0],d=c.getChildren(),h=c.getFirstChildOrThrow().getChildrenSize(),p=c.getChildrenSize(),f=(0,r.$s)(l.getNode(),(e=>u(e))),m=f&&(0,r.$s)(f,(e=>g(e))),y=m&&(0,r.$s)(m,(e=>pe(e)));if(!u(f)||!g(m)||!pe(y))return!1;const v=m.getIndexWithinParent(),A=Math.min(y.getChildrenSize()-1,v+p-1),b=f.getIndexWithinParent(),w=Math.min(m.getChildrenSize()-1,b+h-1),S=Math.min(b,w),C=Math.min(v,A),E=Math.max(b,w),I=Math.max(v,A),_=y.getChildren();let x,P,k=0;for(let e=C;e<=I;e++){const t=_[e];if(!g(t))return!1;const n=d[k];if(!g(n))return!1;const r=t.getChildren(),o=n.getChildren();let s=0;for(let t=S;t<=E;t++){const n=r[t];if(!u(n))return!1;const a=o[s];if(!u(a))return!1;e===C&&t===S?x=n.getKey():e===I&&t===E&&(P=n.getKey());const l=n.getChildren();a.getChildren().forEach((e=>{(0,i.Gg)(e)?((0,i.BE)().append(e),n.append(e)):n.append(e)})),l.forEach((e=>e.remove())),s++}k++}if(x&&P){const e=L();e.set(t[0].getKey(),x,P),(0,i.oq)(e)}return!0}),i.jw)),a.listenersToRemove.add(n.registerCommand(i.oj,(()=>{const t=(0,i.dL)(),r=(0,i.DN)();if((0,i.OP)(t)){const{anchor:r,focus:o}=t,s=r.getNode(),u=o.getNode(),d=ie(s),h=ie(u),f=!(!d||!e.is(oe(d))),g=!(!h||!e.is(oe(h))),m=f!==g,y=f&&g,v=t.isBackward();if(m){const r=t.clone();g?r.focus.set(e.getParentOrThrow().getKey(),e.getIndexWithinParent(),"element"):r.anchor.set(e.getParentOrThrow().getKey(),v?e.getIndexWithinParent()+1:e.getIndexWithinParent(),"element"),(0,i.oq)(r),q(n,a)}else y&&(d.is(h)||(a.setAnchorCellForSelection(p(d)),a.setFocusCellForSelection(p(h),!0),a.isSelecting||setTimeout((()=>{const{onMouseUp:e,onMouseMove:t}=c();a.isSelecting=!0,l.addEventListener("mouseup",e),l.addEventListener("mousemove",t)}),0)))}else if(t&&R(t)&&t.is(r)&&t.tableKey===e.getKey()){const r=K(n._window);if(r&&r.anchorNode&&r.focusNode){const o=(0,i.Xo)(r.focusNode),s=o&&!e.is(oe(o)),a=(0,i.Xo)(r.anchorNode),l=a&&e.is(oe(a));if(s&&l&&r.rangeCount>0){const o=(0,i.Ug)(r,n);o&&(o.anchor.set(e.getKey(),t.isBackward()?e.getChildrenSize():0,"element"),r.removeAllRanges(),(0,i.oq)(o))}}}return t&&!t.is(r)&&(R(t)||R(r))&&a.tableSelection&&!a.tableSelection.is(r)?(R(t)&&t.tableKey===a.tableNodeKey?a.updateTableTableSelection(t):!R(t)&&R(r)&&r.tableKey===a.tableNodeKey&&a.updateTableTableSelection(null),!1):(a.hasHijackedSelectionStyles&&!e.isSelected()?function(e,t){t.enableHighlightStyle(),W(t.table,(e=>{const t=e.elem;e.highlighted=!1,re(0,e),t.getAttribute("style")||t.removeAttribute("style")}))}(0,a):!a.hasHijackedSelectionStyles&&e.isSelected()&&q(n,a),!1)}),i.jw)),a.listenersToRemove.add(n.registerCommand(i.K0,(()=>{const t=(0,i.dL)();if(!(0,i.OP)(t)||!t.isCollapsed()||!$(t,e))return!1;const r=ce(n,t,e);return!!r&&(le(r,e),!0)}),i.jw)),a}function G(e){return e[V]}function Y(e){let t=e;for(;null!=t;){const e=t.nodeName;if("TD"===e||"TH"===e){const e=t._cell;return void 0===e?null:e}t=t.parentNode}return null}function z(e){const t=[],n={columns:0,domRows:t,rows:0};let r=e.firstChild,i=0,o=0;for(t.length=0;null!=r;){const e=r.nodeName;if("TD"===e||"TH"===e){const e={elem:r,hasBackgroundColor:""!==r.style.backgroundColor,highlighted:!1,x:i,y:o};r._cell=e;let n=t[o];void 0===n&&(n=t[o]=[]),n[i]=e}else{const e=r.firstChild;if(null!=e){r=e;continue}}const n=r.nextSibling;if(null!=n){i++,r=n;continue}const s=r.parentNode;if(null!=s){const e=s.nextSibling;if(null==e)break;o++,i=0,r=e}}return n.columns=i+1,n.rows=o+1,n}function Z(e,t,n){const r=new Set(n?n.getNodes():[]);W(t,((e,t)=>{const n=e.elem;r.has(t)?(e.highlighted=!0,ne(0,e)):(e.highlighted=!1,re(0,e),n.getAttribute("style")||n.removeAttribute("style"))}))}function W(e,t){const{domRows:n}=e;for(let e=0;e<n.length;e++){const r=n[e];if(r)for(let n=0;n<r.length;n++){const o=r[n];if(!o)continue;const s=(0,i.Xo)(o.elem);null!==s&&t(o,s,{x:n,y:e})}}}function q(e,t){t.disableHighlightStyle(),W(t.table,(e=>{e.highlighted=!0,ne(0,e)}))}const J=(e,t,n,r,i)=>{const o="forward"===i;switch(i){case"backward":case"forward":return n!==(o?e.table.columns-1:0)?ee(t.getCellNodeFromCordsOrThrow(n+(o?1:-1),r,e.table),o):r!==(o?e.table.rows-1:0)?ee(t.getCellNodeFromCordsOrThrow(o?0:e.table.columns-1,r+(o?1:-1),e.table),o):o?t.selectNext():t.selectPrevious(),!0;case"up":return 0!==r?ee(t.getCellNodeFromCordsOrThrow(n,r-1,e.table),!1):t.selectPrevious(),!0;case"down":return r!==e.table.rows-1?ee(t.getCellNodeFromCordsOrThrow(n,r+1,e.table),!0):t.selectNext(),!0;default:return!1}},X=(e,t,n,r,i)=>{const o="forward"===i;switch(i){case"backward":case"forward":return n!==(o?e.table.columns-1:0)&&e.setFocusCellForSelection(t.getDOMCellFromCordsOrThrow(n+(o?1:-1),r,e.table)),!0;case"up":return 0!==r&&(e.setFocusCellForSelection(t.getDOMCellFromCordsOrThrow(n,r-1,e.table)),!0);case"down":return r!==e.table.rows-1&&(e.setFocusCellForSelection(t.getDOMCellFromCordsOrThrow(n,r+1,e.table)),!0);default:return!1}};function $(e,t){if((0,i.OP)(e)||R(e)){const n=t.isParentOf(e.anchor.getNode()),r=t.isParentOf(e.focus.getNode());return n&&r}return!1}function ee(e,t){t?e.selectStart():e.selectEnd()}const te="172,206,247";function ne(e,t){const n=t.elem,r=(0,i.Xo)(n);u(r)||y(131),null===r.getBackgroundColor()?n.style.setProperty("background-color",`rgb(${te})`):n.style.setProperty("background-image",`linear-gradient(to right, rgba(${te},0.85), rgba(${te},0.85))`),n.style.setProperty("caret-color","transparent")}function re(e,t){const n=t.elem,r=(0,i.Xo)(n);u(r)||y(131),null===r.getBackgroundColor()&&n.style.removeProperty("background-color"),n.style.removeProperty("background-image"),n.style.removeProperty("caret-color")}function ie(e){const t=(0,r.$s)(e,u);return u(t)?t:null}function oe(e){const t=(0,r.$s)(e,pe);return pe(t)?t:null}function se(e,t,n,o,s){if(("up"===n||"down"===n)&&function(e){const t=e.getRootElement();return!!t&&t.hasAttribute("aria-controls")&&"typeahead-menu"===t.getAttribute("aria-controls")}(e))return!1;const a=(0,i.dL)();if(!$(a,o)){if("backward"===n&&(0,i.OP)(a)&&a.isCollapsed()){const e=a.anchor.type,n=a.anchor.offset;if("element"!==e&&("text"!==e||0!==n))return!1;const o=a.anchor.getNode();if(!o)return!1;const s=(0,r.$s)(o,(e=>(0,i.F7)(e)&&!e.isInline()));if(!s)return!1;const l=s.getPreviousSibling();return!(!l||!pe(l)||(ae(t),l.selectEnd(),0))}return!1}if((0,i.OP)(a)&&a.isCollapsed()){const{anchor:l,focus:c}=a,d=(0,r.$s)(l.getNode(),u),h=(0,r.$s)(c.getNode(),u);if(!u(d)||!d.is(h))return!1;const p=oe(d);if(p!==o&&null!=p){const r=e.getElementByKey(p.getKey());if(null!=r)return s.table=z(r),se(e,t,n,p,s)}if("backward"===n||"forward"===n){const e=l.type,s=l.offset,c=l.getNode();if(!c)return!1;const d=a.getNodes();return(1!==d.length||!(0,i.k$)(d[0]))&&!!function(e,t,n,o){return function(e,t,n){return"element"===e&&("backward"===n?null===t.getPreviousSibling():null===t.getNextSibling())}(e,n,o)||function(e,t,n,o){const s=(0,r.$s)(n,(e=>(0,i.F7)(e)&&!e.isInline()));if(!s)return!1;const a="backward"===o?0===t:t===n.getTextContentSize();return"text"===e&&a&&("backward"===o?null===s.getPreviousSibling():null===s.getNextSibling())}(e,t,n,o)}(e,s,c,n)&&function(e,t,n,o){const s=(0,r.$s)(t,u);if(!u(s))return!1;const[a,l]=D(n,s,s);if(!function(e,t,n){const r=e[0][0],i=e[e.length-1][e[0].length-1],{startColumn:o,startRow:s}=t;return"backward"===n?o===r.startColumn&&s===r.startRow:o===i.startColumn&&s===i.startRow}(a,l,o))return!1;const c=function(e,t,n){const o=(0,r.$s)(e,(e=>(0,i.F7)(e)&&!e.isInline()));if(!o)return;const s="backward"===t?o.getPreviousSibling():o.getNextSibling();return s&&pe(s)?s:"backward"===t?n.getPreviousSibling():n.getNextSibling()}(t,o,n);return!(!c||pe(c)||(ae(e),"backward"===o?c.selectEnd():c.selectStart(),0))}(t,c,o,n)}const f=e.getElementByKey(d.__key),g=e.getElementByKey(l.key);if(null==g||null==f)return!1;let m;if("element"===l.type)m=g.getBoundingClientRect();else{const e=window.getSelection();if(null===e||0===e.rangeCount)return!1;m=e.getRangeAt(0).getBoundingClientRect()}const y="up"===n?d.getFirstChild():d.getLastChild();if(null==y)return!1;const v=e.getElementByKey(y.__key);if(null==v)return!1;const A=v.getBoundingClientRect();if("up"===n?A.top>m.top-m.height:m.bottom+m.height>A.bottom){ae(t);const e=o.getCordsFromCellNode(d,s.table);if(!t.shiftKey)return J(s,o,e.x,e.y,n);{const t=o.getDOMCellFromCordsOrThrow(e.x,e.y,s.table);s.setAnchorCellForSelection(t),s.setFocusCellForSelection(t,!0)}return!0}}else if(R(a)){const{anchor:i,focus:l}=a,c=(0,r.$s)(i.getNode(),u),d=(0,r.$s)(l.getNode(),u),[h]=a.getNodes(),p=e.getElementByKey(h.getKey());if(!u(c)||!u(d)||!pe(h)||null==p)return!1;s.updateTableTableSelection(a);const f=z(p),g=o.getCordsFromCellNode(c,f),m=o.getDOMCellFromCordsOrThrow(g.x,g.y,f);if(s.setAnchorCellForSelection(m),ae(t),t.shiftKey){const e=o.getCordsFromCellNode(d,f);return X(s,h,e.x,e.y,n)}return d.selectEnd(),!0}return!1}function ae(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}function le(e,t,n){const r=(0,i.BE)();"first"===e?t.insertBefore(r):t.insertAfter(r),r.append(...n||[]),r.selectEnd()}function ce(e,t,n){const i=n.getParent();if(!i)return;const o=e.getElementByKey(i.getKey());if(!o)return;const s=window.getSelection();if(!s||s.anchorNode!==o)return;const a=(0,r.$s)(t.anchor.getNode(),(e=>u(e)));if(!a)return;const l=(0,r.$s)(a,(e=>pe(e)));if(!pe(l)||!l.is(n))return;const[c,d]=D(n,a,a),h=c[0][0],p=c[c.length-1][c[0].length-1],{startRow:f,startColumn:g}=d,m=f===h.startRow&&g===h.startColumn,y=f===p.startRow&&g===p.startColumn;return m?"first":y?"last":void 0}class ue extends i.HX{static getType(){return"table"}static clone(e){return new ue(e.__key)}static importDOM(){return{table:e=>({conversion:de,priority:1})}}static importJSON(e){return he()}constructor(e){super(e)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(e,t){const n=document.createElement("table");return(0,r.Yo)(n,e.theme.table),n}updateDOM(){return!1}exportDOM(e){return{...super.exportDOM(e),after:e=>{if(e){const t=e.cloneNode(),n=document.createElement("colgroup"),r=document.createElement("tbody");(0,i.Re)(e)&&r.append(...e.children);const o=this.getFirstChildOrThrow();if(!g(o))throw new Error("Expected to find row node.");const s=o.getChildrenSize();for(let e=0;e<s;e++){const e=document.createElement("col");n.append(e)}return t.replaceChildren(n,r),t}}}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(e,t){const{rows:n,domRows:r}=t;for(let t=0;t<n;t++){const n=r[t];if(null==n)continue;const o=n.findIndex((t=>{if(!t)return;const{elem:n}=t;return(0,i.Xo)(n)===e}));if(-1!==o)return{x:o,y:t}}throw new Error("Cell not found in table.")}getDOMCellFromCords(e,t,n){const{domRows:r}=n,i=r[t];if(null==i)return null;const o=i[e];return null==o?null:o}getDOMCellFromCordsOrThrow(e,t,n){const r=this.getDOMCellFromCords(e,t,n);if(!r)throw new Error("Cell not found at cords.");return r}getCellNodeFromCords(e,t,n){const r=this.getDOMCellFromCords(e,t,n);if(null==r)return null;const o=(0,i.Xo)(r.elem);return u(o)?o:null}getCellNodeFromCordsOrThrow(e,t,n){const r=this.getCellNodeFromCords(e,t,n);if(!r)throw new Error("Node at cords not TableCellNode.");return r}canSelectBefore(){return!0}canIndent(){return!1}}function de(e){return{node:he()}}function he(){return(0,i.U2)(new ue)}function pe(e){return e instanceof ue}},29016:(e,t,n)=>{"use strict";n.d(t,{$s:()=>y,JB:()=>A,MZ:()=>S,PS:()=>p,Yo:()=>h,_G:()=>f,bV:()=>w,f8:()=>m,nh:()=>b,qV:()=>u,yD:()=>g,z8:()=>v});var r,i=n(31031),o=(r=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;const s="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,a=s&&"documentMode"in document?document.documentMode:null,l=(s&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),s&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent));!(!s||!("InputEvent"in window)||a)&&new window.InputEvent("input"),s&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),s&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window.MSStream,s&&/Android/.test(navigator.userAgent),s&&/^(?=.*Chrome).*/i.test(navigator.userAgent);function c(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}function u(...e){return()=>{e.forEach((e=>e()))}}s&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent);const d=l;function h(e,...t){const n=c(...t);n.length>0&&e.classList.add(...n)}function p(e,...t){const n=c(...t);n.length>0&&e.classList.remove(...n)}function f(e){let t=e;if((0,i.F7)(t)&&t.getChildrenSize()>0)t=t.getLastChild();else{let e=null;for(;null===e&&null!==t;)e=t.getPreviousSibling(),t=null===e?t.getParent():e}return t}function g(e,t){let n=e;for(;null!=n;){if(n instanceof t)return n;n=n.getParent()}return null}function m(e){const t=y(e,(e=>(0,i.F7)(e)&&!e.isInline()));return(0,i.F7)(t)||o(4,e.__key),t}const y=(e,t)=>{let n=e;for(;n!==(0,i.Gv)()&&null!=n;){if(t(n))return n;n=n.getParent()}return null};function v(e){const t=(0,i.dL)()||(0,i.DN)();if((0,i.OP)(t)){const{focus:n}=t,r=n.getNode(),o=n.offset;if((0,i._v)(r)){const t=r.getChildAtIndex(o);null==t?r.append(e):t.insertBefore(e),e.selectNext()}else{let t,n;(0,i.Gg)(r)?(t=r.getParentOrThrow(),n=r.getIndexWithinParent(),o>0&&(n+=1,r.splitText(o))):(t=r,n=o);const[,s]=(0,i.z9)(t,n);s.insertBefore(e),s.selectStart()}}else{if(null!=t){const n=t.getNodes();n[n.length-1].getTopLevelElementOrThrow().insertAfter(e)}else(0,i.Gv)().append(e);const n=(0,i.BE)();e.insertAfter(n),n.select()}return e.getLatest()}function A(e,t){const n=t();return e.replace(n),n.append(e),n}function b(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name}function w(e,t){const n=e.getFirstChild();null!==n?n.insertBefore(t):e.append(t)}function S(e){if(d)return 1;let t=1;for(;e;)t*=Number(window.getComputedStyle(e).getPropertyValue("zoom")),e=e.parentElement;return t}},20038:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}n.d(t,{g7:()=>s});var i=n(2784);function o(...e){return t=>e.forEach((e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t)))}const s=(0,i.forwardRef)(((e,t)=>{const{children:n,...o}=e,s=i.Children.toArray(n),l=s.find(c);if(l){const e=l.props.children,n=s.map((t=>t===l?i.Children.count(e)>1?i.Children.only(null):(0,i.isValidElement)(e)?e.props.children:null:t));return(0,i.createElement)(a,r({},o,{ref:t}),(0,i.isValidElement)(e)?(0,i.cloneElement)(e,void 0,n):null)}return(0,i.createElement)(a,r({},o,{ref:t}),n)}));s.displayName="Slot";const a=(0,i.forwardRef)(((e,t)=>{const{children:n,...r}=e;return(0,i.isValidElement)(n)?(0,i.cloneElement)(n,{...u(r,n.props),ref:t?o(t,n.ref):n.ref}):i.Children.count(n)>1?i.Children.only(null):null}));a.displayName="SlotClone";const l=({children:e})=>(0,i.createElement)(i.Fragment,null,e);function c(e){return(0,i.isValidElement)(e)&&e.type===l}function u(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...e)=>{o(...e),i(...e)}:i&&(n[r]=i):"style"===r?n[r]={...i,...o}:"className"===r&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}},31031:(e,t,n)=>{"use strict";function r(e){return{}}n.d(t,{$l:()=>m,A1:()=>d,A3:()=>fr,BE:()=>Wi,BM:()=>V,CK:()=>zi,DN:()=>si,Eo:()=>eo,Ew:()=>g,F7:()=>Fi,GA:()=>Xe,Gg:()=>Nr,Gv:()=>mt,H2:()=>ot,HX:()=>Mi,Hr:()=>U,Ij:()=>Li,Jh:()=>ro,K0:()=>c,K8:()=>Ft,KB:()=>Xi,Kr:()=>s,LV:()=>L,MK:()=>k,MX:()=>Or,Mt:()=>a,Nm:()=>A,Nr:()=>K,OJ:()=>S,OP:()=>Kr,PU:()=>N,Qd:()=>Rr,R2:()=>Sr,RG:()=>Yi,RJ:()=>h,RO:()=>T,Re:()=>tn,Rl:()=>qi,S3:()=>Tr,S9:()=>Ze,T:()=>pr,U2:()=>Zt,UL:()=>jt,Ug:()=>ri,VN:()=>Ji,WH:()=>l,XI:()=>M,XN:()=>I,Xo:()=>pt,Zb:()=>E,Zq:()=>P,_$:()=>bi,_0:()=>C,_v:()=>zt,aR:()=>x,af:()=>$e,bg:()=>en,cA:()=>O,cj:()=>p,cs:()=>zr,cz:()=>D,dB:()=>B,dL:()=>oi,dR:()=>Q,ek:()=>$r,fA:()=>r,fL:()=>Lt,g8:()=>b,gI:()=>dt,h5:()=>ni,iO:()=>Gr,jw:()=>to,k$:()=>Qi,kE:()=>F,lv:()=>rn,m$:()=>Y,mY:()=>R,n2:()=>f,oC:()=>xi,od:()=>di,oj:()=>i,oq:()=>vt,r0:()=>H,rc:()=>Mr,u$:()=>w,u6:()=>$i,vN:()=>ti,wd:()=>Vi,yF:()=>u,yb:()=>Z,yn:()=>G,z9:()=>$t,zD:()=>j,zq:()=>y,zr:()=>o});const i={},o={},s={},a={},l={},c={},u={},d={},h={},p={},f={},g={},m={},y={},v={},A={},b={},w={},S={},C={},E={},I={},_={},x={},P={},k={},B={},O={},N={},D={},j={},T={},M={},F={},R={},L={},Q={},U={},V={},K={},H={},G={},Y={},z={},Z={};var W=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const q="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,J=q&&"documentMode"in document?document.documentMode:null,X=q&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),$=q&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),ee=!(!q||!("InputEvent"in window)||J)&&"getTargetRanges"in new window.InputEvent("input"),te=q&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),ne=q&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,re=q&&/Android/.test(navigator.userAgent),ie=q&&/^(?=.*Chrome).*/i.test(navigator.userAgent),oe=q&&re&&ie,se=q&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!ie,ae=1,le=3,ce=0,ue=1,de=2,he=4,pe=8,fe=3|he|pe|240,ge=1,me=2,ye=3,ve=4,Ae=5,be=6,we=te||ne||se?" ":"​",Se="\n\n",Ce=$?" ":we,Ee="֑-߿יִ-﷽ﹰ-ﻼ",Ie="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",_e=new RegExp("^[^"+Ie+"]*["+Ee+"]"),xe=new RegExp("^[^"+Ee+"]*["+Ie+"]"),Pe={bold:1,code:16,highlight:128,italic:2,strikethrough:he,subscript:32,superscript:64,underline:pe},ke={directionless:1,unmergeable:2},Be={center:me,end:be,justify:ve,left:ge,right:ye,start:Ae},Oe={[me]:"center",[be]:"end",[ve]:"justify",[ge]:"left",[ye]:"right",[Ae]:"start"},Ne={normal:0,segmented:2,token:1},De={0:"normal",2:"segmented",1:"token"};function je(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}const Te=100;let Me=!1,Fe=0;function Re(e){Fe=e.timeStamp}function Le(e,t,n){return t.__lexicalLineBreak===e||void 0!==e[`__lexicalKey_${n._key}`]}function Qe(e,t,n){const r=Xt(n._window);let i=null,o=null;null!==r&&r.anchorNode===e&&(i=r.anchorOffset,o=r.focusOffset);const s=e.nodeValue;null!==s&&_t(t,s,i,o,!1)}function Ue(e,t,n){if(Kr(e)){const t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return t.nodeType===le&&n.isAttached()}function Ve(e,t,n){Me=!0;const r=performance.now()-Fe>Te;try{Ti(e,(()=>{const i=oi()||function(e){return e.getEditorState().read((()=>{const e=oi();return null!==e?e.clone():null}))}(e),o=new Map,s=e.getRootElement(),a=e._editorState,l=e._blockCursorElement;let c=!1,u="";for(let n=0;n<t.length;n++){const d=t[n],h=d.type,p=d.target;let f=pt(p,a);if(!(null===f&&p!==s||Qi(f)))if("characterData"===h)r&&Nr(f)&&Ue(i,p,f)&&Qe(p,f,e);else if("childList"===h){c=!0;const t=d.addedNodes;for(let n=0;n<t.length;n++){const r=t[n],i=ht(r),o=r.parentNode;if(null!=o&&r!==l&&null===i&&("BR"!==r.nodeName||!Le(r,o,e))){if($){const e=r.innerText||r.nodeValue;e&&(u+=e)}o.removeChild(r)}}const n=d.removedNodes,r=n.length;if(r>0){let t=0;for(let i=0;i<r;i++){const r=n[i];("BR"===r.nodeName&&Le(r,p,e)||l===r)&&(p.appendChild(r),t++)}r!==t&&(p===s&&(f=yt(a)),o.set(p,f))}}}if(o.size>0)for(const[t,n]of o)if(Fi(n)){const r=n.getChildrenKeys();let i=t.firstChild;for(let n=0;n<r.length;n++){const o=r[n],s=e.getElementByKey(o);null!==s&&(null==i?(t.appendChild(s),i=s):i!==s&&t.replaceChild(s,i),i=i.nextSibling)}}else Nr(n)&&n.markDirty();const d=n.takeRecords();if(d.length>0){for(let t=0;t<d.length;t++){const n=d[t],r=n.addedNodes,i=n.target;for(let t=0;t<r.length;t++){const n=r[t],o=n.parentNode;null==o||"BR"!==n.nodeName||Le(n,i,e)||o.removeChild(n)}}n.takeRecords()}null!==i&&(c&&(i.dirty=!0,vt(i)),$&&Qt(e)&&i.insertRawText(u))}))}finally{Me=!1}}function Ke(e){const t=e._observer;null!==t&&Ve(e,t.takeRecords(),t)}function He(e){!function(e){0===Fe&&Yt(e).addEventListener("textInput",Re,!0)}(e),e._observer=new MutationObserver(((t,n)=>{Ve(e,t,n)}))}function Ge(e,t){const n=e.__mode,r=e.__format,i=e.__style,o=t.__mode,s=t.__format,a=t.__style;return!(null!==n&&n!==o||null!==r&&r!==s||null!==i&&i!==a)}function Ye(e,t){const n=e.mergeWithSibling(t),r=Ei()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function ze(e){let t,n,r=e;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(t=r.getPreviousSibling())&&Nr(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){if(Ge(t,r)){r=Ye(t,r);break}break}t.remove()}for(;null!==(n=r.getNextSibling())&&Nr(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(Ge(r,n)){r=Ye(r,n);break}break}n.remove()}}else r.remove()}function Ze(e){return We(e.anchor),We(e.focus),e}function We(e){for(;"element"===e.type;){const t=e.getNode(),n=e.offset;let r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),Nr(r)){e.set(r.__key,i?r.getTextContentSize():0,"text");break}if(!Fi(r))break;e.set(r.__key,i?r.getChildrenSize():0,"element")}}let qe=1;const Je="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function Xe(e){const t=document.activeElement;if(null===t)return!1;const n=t.nodeName;return Qi(pt(e))&&("INPUT"===n||"TEXTAREA"===n||"true"===t.contentEditable&&null==t.__lexicalEditor)}function $e(e,t,n){const r=e.getRootElement();try{return null!==r&&r.contains(t)&&r.contains(n)&&null!==t&&!Xe(t)&&et(t)===e}catch(e){return!1}}function et(e){let t=e;for(;null!=t;){const e=t.__lexicalEditor;if(null!=e)return e;t=Ht(t)}return null}function tt(e){return e.isToken()||e.isSegmented()}function nt(e){return e.nodeType===le}function rt(e){let t=e;for(;null!=t;){if(nt(t))return t;t=t.firstChild}return null}function it(e,t,n){const r=Pe[t];if(null!==n&&(e&r)==(n&r))return e;let i=e^r;return"subscript"===t?i&=~Pe.superscript:"superscript"===t&&(i&=~Pe.subscript),i}function ot(e){return Nr(e)||fr(e)||Qi(e)}function st(e,t){if(null!=t)return void(e.__key=t);wi(),Si();const n=Ei(),r=Ci(),i=""+qe++;r._nodeMap.set(i,e),Fi(e)?n._dirtyElements.set(i,!0):n._dirtyLeaves.add(i),n._cloneNotNeeded.add(i),n._dirtyType=ue,e.__key=i}function at(e){const t=e.getParent();if(null!==t){const n=e.getWritable(),r=t.getWritable(),i=e.getPreviousSibling(),o=e.getNextSibling();if(null===i)if(null!==o){const e=o.getWritable();r.__first=o.__key,e.__prev=null}else r.__first=null;else{const e=i.getWritable();if(null!==o){const t=o.getWritable();t.__prev=e.__key,e.__next=t.__key}else e.__next=null;n.__prev=null}if(null===o)if(null!==i){const e=i.getWritable();r.__last=i.__key,e.__next=null}else r.__last=null;else{const e=o.getWritable();if(null!==i){const t=i.getWritable();t.__next=e.__key,e.__prev=t.__key}else e.__prev=null;n.__next=null}r.__size--,n.__parent=null}}function lt(e){Si();const t=e.getLatest(),n=t.__parent,r=Ci(),i=Ei(),o=r._nodeMap,s=i._dirtyElements;null!==n&&function(e,t,n){let r=e;for(;null!==r;){if(n.has(r))return;const e=t.get(r);if(void 0===e)break;n.set(r,!1),r=e.__parent}}(n,o,s);const a=t.__key;i._dirtyType=ue,Fi(e)?s.set(a,!0):i._dirtyLeaves.add(a)}function ct(e){wi();const t=Ei(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){const e=dt(n);null!==e&&e.getWritable()}if(null!==e){const t=dt(e);null!==t&&t.getWritable()}}}function ut(){return bi()?null:Ei()._compositionKey}function dt(e,t){const n=(t||Ci())._nodeMap.get(e);return void 0===n?null:n}function ht(e,t){const n=e[`__lexicalKey_${Ei()._key}`];return void 0!==n?dt(n,t):null}function pt(e,t){let n=e;for(;null!=n;){const e=ht(n,t);if(null!==e)return e;n=Ht(n)}return null}function ft(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function gt(e){return e.read((()=>mt().getTextContent()))}function mt(){return yt(Ci())}function yt(e){return e._nodeMap.get("root")}function vt(e){wi();const t=Ci();null!==e&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function At(e){const t=Ei(),n=function(e,t){let n=e;for(;null!=n;){const e=n[`__lexicalKey_${t._key}`];if(void 0!==e)return e;n=Ht(n)}return null}(e,t);return null===n?e===t.getRootElement()?dt("root"):null:dt(n)}function bt(e,t){return t?e.getTextContentSize():0}function wt(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function St(e){const t=[];let n=e;for(;null!==n;)t.push(n),n=n._parentEditor;return t}function Ct(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function Et(e){return e.nodeType===le?e.nodeValue:null}function It(e,t,n){const r=Xt(t._window);if(null===r)return;const i=r.anchorNode;let{anchorOffset:o,focusOffset:s}=r;if(null!==i){let t=Et(i);const r=pt(i);if(null!==t&&Nr(r)){if(t===we&&n){const e=n.length;t=n,o=e,s=e}null!==t&&_t(r,t,o,s,e)}}}function _t(e,t,n,r,i){let o=e;if(o.isAttached()&&(i||!o.isDirty())){const s=o.isComposing();let a=t;(s||i)&&t[t.length-1]===we&&(a=t.slice(0,-1));const l=o.getTextContent();if(i||a!==l){if(""===a){if(ct(null),te||ne||se)o.remove();else{const e=Ei();setTimeout((()=>{e.update((()=>{o.isAttached()&&o.remove()}))}),20)}return}const t=o.getParent(),i=si(),l=o.getTextContentSize(),c=ut(),u=o.getKey();if(o.isToken()||null!==c&&u===c&&!s||Kr(i)&&(null!==t&&!t.canInsertTextBefore()&&0===i.anchor.offset||i.anchor.key===e.__key&&0===i.anchor.offset&&!o.canInsertTextBefore()&&!s||i.focus.key===e.__key&&i.focus.offset===l&&!o.canInsertTextAfter()&&!s))return void o.markDirty();const d=oi();if(!Kr(d)||null===n||null===r)return void o.setTextContent(a);if(d.setTextNodeRange(o,n,o,r),o.isSegmented()){const e=Or(o.getTextContent());o.replace(e),o=e}o.setTextContent(a)}}}function xt(e){return"ArrowLeft"===e}function Pt(e){return"ArrowRight"===e}function kt(e,t){return X?e:t}function Bt(e){return"Enter"===e}function Ot(e){return"Backspace"===e}function Nt(e){return"Delete"===e}function Dt(e,t,n){return"a"===e.toLowerCase()&&kt(t,n)}function jt(){const e=mt();vt(Ze(e.select(0,e.getChildrenSize())))}function Tt(e,t){void 0===e.__lexicalClassNameCache&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,r=n[t];if(void 0!==r)return r;const i=e[t];if("string"==typeof i){const e=je(i);return n[t]=e,e}return i}function Mt(e,t,n,r,i){if(0===n.size)return;const o=r.__type,s=r.__key,a=t.get(o);void 0===a&&W(33,o);const l=a.klass;let c=e.get(l);void 0===c&&(c=new Map,e.set(l,c));const u=c.get(s),d="destroyed"===u&&"created"===i;(void 0===u||d)&&c.set(s,d?"updated":i)}function Ft(e){const t=Ci(),n=t._readOnly,r=e.getType(),i=t._nodeMap,o=[];for(const[,t]of i)t instanceof e&&t.__type===r&&(n||t.isAttached())&&o.push(t);return o}function Rt(e,t,n){const r=e.getParent();let i=n,o=e;return null!==r&&(t&&0===n?(i=o.getIndexWithinParent(),o=r):t||n!==o.getChildrenSize()||(i=o.getIndexWithinParent()+1,o=r)),o.getChildAtIndex(t?i-1:i)}function Lt(e,t){const n=e.offset;if("element"===e.type)return Rt(e.getNode(),t,n);{const r=e.getNode();if(t&&0===n||!t&&n===r.getTextContentSize()){const e=t?r.getPreviousSibling():r.getNextSibling();return null===e?Rt(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):e}}return null}function Qt(e){const t=Yt(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function Ut(e,t,n){return Ni(e,t,n)}function Vt(e){return!Vi(e)&&!e.isLastChild()&&!e.isInline()}function Kt(e,t){const n=e._keyToDOMMap.get(t);return void 0===n&&W(75,t),n}function Ht(e){const t=e.assignedSlot||e.parentElement;return null!==t&&11===t.nodeType?t.host:t}function Gt(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function Yt(e){const t=e._window;return null===t&&W(78),t}function zt(e){return Vi(e)||Fi(e)&&e.isShadowRoot()}function Zt(e){const t=Ei(),n=e.constructor.getType(),r=t._nodes.get(n);void 0===r&&W(97);const i=r.replace;if(null!==i){const t=i(e);return t instanceof e.constructor||W(98),t}return e}function Wt(e,t){!Vi(e.getParent())||Fi(t)||Qi(t)||W(99)}function qt(e){return(Qi(e)||Fi(e)&&!e.canBeEmpty())&&!e.isInline()}function Jt(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;null!==r&&r.removeChild(e)}function Xt(e){return q?(e||window).getSelection():null}function $t(e,t){let n=e.getChildAtIndex(t);null==n&&(n=e),zt(e)&&W(102);const r=e=>{const t=e.getParentOrThrow(),i=zt(t),o=e!==n||i?function(e){const t=e.constructor.clone(e);return st(t,null),t}(e):e;if(i)return Fi(e)&&Fi(o)||W(133),e.insertAfter(o),[e,o,o];{const[n,i,s]=r(t),a=e.getNextSiblings();return s.append(o,...a),[n,i,o]}},[i,o]=r(n);return[i,o]}function en(e){return tn(e)&&"A"===e.tagName}function tn(e){return 1===e.nodeType}function nn(e){const t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return null!==e.nodeName.match(t)}function rn(e){const t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return null!==e.nodeName.match(t)}function on(e){if(Vi(e)||Qi(e)&&!e.isInline())return!0;if(!Fi(e)||zt(e))return!1;const t=e.getFirstChild(),n=null===t||fr(t)||Nr(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function sn(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}function an(e,t,n,r,i,o){let s=e.getFirstChild();for(;null!==s;){const e=s.__key;s.__parent===t&&(Fi(s)&&an(s,e,n,r,i,o),n.has(e)||o.delete(e),i.push(e)),s=s.getNextSibling()}}let ln,cn,un,dn,hn,pn,fn,gn,mn,yn,vn="",An="",bn=null,wn="",Sn=!1,Cn=!1,En=null;function In(e,t){const n=fn.get(e);if(null!==t){const n=Qn(e);n.parentNode===t&&t.removeChild(n)}if(gn.has(e)||cn._keyToDOMMap.delete(e),Fi(n)){const e=Mn(n,fn);_n(e,0,e.length-1,null)}void 0!==n&&Mt(yn,un,dn,n,"destroyed")}function _n(e,t,n,r){let i=t;for(;i<=n;++i){const t=e[i];void 0!==t&&In(t,r)}}function xn(e,t){e.setProperty("text-align",t)}const Pn="40px";function kn(e,t){const n=ln.theme.indent;if("string"==typeof n){const r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}const r=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||Pn;e.style.setProperty("padding-inline-start",0===t?"":`calc(${t} * ${r})`)}function Bn(e,t){const n=e.style;0===t?xn(n,""):t===ge?xn(n,"left"):t===me?xn(n,"center"):t===ye?xn(n,"right"):t===ve?xn(n,"justify"):t===Ae?xn(n,"start"):t===be&&xn(n,"end")}function On(e,t,n){const r=gn.get(e);void 0===r&&W(60);const i=r.createDOM(ln,cn);if(function(e,t,n){const r=n._keyToDOMMap;t["__lexicalKey_"+n._key]=e,r.set(e,t)}(e,i,cn),Nr(r)?i.setAttribute("data-lexical-text","true"):Qi(r)&&i.setAttribute("data-lexical-decorator","true"),Fi(r)){const e=r.__indent,t=r.__size;if(0!==e&&kn(i,e),0!==t){const e=t-1;!function(e,t,n,r){const i=An;An="",Nn(e,n,0,t,r,null),Tn(n,r),An=i}(Mn(r,gn),e,r,i)}const n=r.__format;0!==n&&Bn(i,n),r.isInline()||jn(null,r,i),Vt(r)&&(vn+=Se,wn+=Se)}else{const t=r.getTextContent();if(Qi(r)){const t=r.decorate(cn,ln);null!==t&&Rn(e,t),i.contentEditable="false"}else Nr(r)&&(r.isDirectionless()||(An+=t));vn+=t,wn+=t}if(null!==t)if(null!=n)t.insertBefore(i,n);else{const e=t.__lexicalLineBreak;null!=e?t.insertBefore(i,e):t.appendChild(i)}return Mt(yn,un,dn,r,"created"),i}function Nn(e,t,n,r,i,o){const s=vn;vn="";let a=n;for(;a<=r;++a){On(e[a],i,o);const t=gn.get(e[a]);null!==t&&null===bn&&Nr(t)&&(bn=t.getFormat())}Vt(t)&&(vn+=Se),i.__lexicalTextContent=vn,vn=s+vn}function Dn(e,t){const n=t.get(e);return fr(n)||Qi(n)&&n.isInline()}function jn(e,t,n){const r=null!==e&&(0===e.__size||Dn(e.__last,fn)),i=0===t.__size||Dn(t.__last,gn);if(r){if(!i){const e=n.__lexicalLineBreak;null!=e&&n.removeChild(e),n.__lexicalLineBreak=null}}else if(i){const e=document.createElement("br");n.__lexicalLineBreak=e,n.appendChild(e)}}function Tn(e,t){const n=t.__lexicalDirTextContent,r=t.__lexicalDir;if(n!==An||r!==En){const n=""===An,o=n?En:(i=An,_e.test(i)?"rtl":xe.test(i)?"ltr":null);if(o!==r){const i=t.classList,s=ln.theme;let a=null!==r?s[r]:void 0,l=null!==o?s[o]:void 0;if(void 0!==a){if("string"==typeof a){const e=je(a);a=s[r]=e}i.remove(...a)}if(null===o||n&&"ltr"===o)t.removeAttribute("dir");else{if(void 0!==l){if("string"==typeof l){const e=je(l);l=s[o]=e}void 0!==l&&i.add(...l)}t.dir=o}Cn||(e.getWritable().__dir=o)}En=o,t.__lexicalDirTextContent=An,t.__lexicalDir=o}var i}function Mn(e,t){const n=[];let r=e.__first;for(;null!==r;){const e=t.get(r);void 0===e&&W(101),n.push(r),r=e.__next}return n}function Fn(e,t){const n=fn.get(e);let r=gn.get(e);void 0!==n&&void 0!==r||W(61);const i=Sn||pn.has(e)||hn.has(e),o=Kt(cn,e);if(n===r&&!i){if(Fi(n)){const e=o.__lexicalTextContent;void 0!==e&&(vn+=e,wn+=e);const t=o.__lexicalDirTextContent;void 0!==t&&(An+=t)}else{const e=n.getTextContent();Nr(n)&&!n.isDirectionless()&&(An+=e),wn+=e,vn+=e}return o}if(n!==r&&i&&Mt(yn,un,dn,r,"updated"),r.updateDOM(n,o,ln)){const n=On(e,null,null);return null===t&&W(62),t.replaceChild(n,o),In(e,null),n}if(Fi(n)&&Fi(r)){const e=r.__indent;e!==n.__indent&&kn(o,e);const t=r.__format;t!==n.__format&&Bn(o,t),i&&(function(e,t,n){const r=An;var i;An="",bn=null,function(e,t,n){const r=vn,i=e.__size,o=t.__size;if(vn="",1===i&&1===o){const r=e.__first,i=t.__first;if(r===i)Fn(r,n);else{const e=Qn(r),t=On(i,null,null);n.replaceChild(t,e),In(r,null)}const o=gn.get(i);null===bn&&Nr(o)&&(bn=o.getFormat())}else{const r=Mn(e,fn),s=Mn(t,gn);if(0===i)0!==o&&Nn(s,t,0,o-1,n,null);else if(0===o){if(0!==i){const e=null==n.__lexicalLineBreak;_n(r,0,i-1,e?null:n),e&&(n.textContent="")}}else!function(e,t,n,r,i,o){const s=r-1,a=i-1;let l,c,u=o.firstChild,d=0,h=0;for(;d<=s&&h<=a;){const e=t[d],r=n[h];if(e===r)u=Ln(Fn(r,o)),d++,h++;else{void 0===l&&(l=new Set(t)),void 0===c&&(c=new Set(n));const i=c.has(e),s=l.has(r);if(i)if(s){const e=Kt(cn,r);e===u?u=Ln(Fn(r,o)):(null!=u?o.insertBefore(e,u):o.appendChild(e),Fn(r,o)),d++,h++}else On(r,o,u),h++;else u=Ln(Qn(e)),In(e,o),d++}const i=gn.get(r);null!==i&&null===bn&&Nr(i)&&(bn=i.getFormat())}const p=d>s,f=h>a;if(p&&!f){const t=n[a+1];Nn(n,e,h,a,o,void 0===t?null:cn.getElementByKey(t))}else f&&!p&&_n(t,d,s,o)}(t,r,s,i,o,n)}Vt(t)&&(vn+=Se),n.__lexicalTextContent=vn,vn=r+vn}(e,t,n),Tn(t,n),qi(i=t)&&null!=bn&&bn!==i.__textFormat&&i.setTextFormat(bn),An=r,bn=null}(n,r,o),Vi(r)||r.isInline()||jn(n,r,o)),Vt(r)&&(vn+=Se,wn+=Se)}else{const t=r.getTextContent();if(Qi(r)){const t=r.decorate(cn,ln);null!==t&&Rn(e,t)}else Nr(r)&&!r.isDirectionless()&&(An+=t);vn+=t,wn+=t}if(!Cn&&Vi(r)&&r.__cachedText!==wn){const e=r.getWritable();e.__cachedText=wn,r=e}return o}function Rn(e,t){let n=cn._pendingDecorators;const r=cn._decorators;if(null===n){if(r[e]===t)return;n=ft(cn)}n[e]=t}function Ln(e){let t=e.nextSibling;return null!==t&&t===cn._blockCursorElement&&(t=t.nextSibling),t}function Qn(e){const t=mn.get(e);return void 0===t&&W(75,e),t}const Un=Object.freeze({}),Vn=[["keydown",function(e,t){if(Kn=e.timeStamp,Hn=e.key,t.isComposing())return;const{key:n,shiftKey:r,ctrlKey:i,metaKey:o,altKey:s}=e;Ut(t,v,e)||null!=n&&(function(e,t,n,r){return Pt(e)&&!t&&!r&&!n}(n,i,s,o)?Ut(t,A,e):function(e,t,n,r,i){return Pt(e)&&!r&&!n&&(t||i)}(n,i,r,s,o)?Ut(t,b,e):function(e,t,n,r){return xt(e)&&!t&&!r&&!n}(n,i,s,o)?Ut(t,w,e):function(e,t,n,r,i){return xt(e)&&!r&&!n&&(t||i)}(n,i,r,s,o)?Ut(t,S,e):function(e,t,n){return function(e){return"ArrowUp"===e}(e)&&!t&&!n}(n,i,o)?Ut(t,C,e):function(e,t,n){return function(e){return"ArrowDown"===e}(e)&&!t&&!n}(n,i,o)?Ut(t,E,e):function(e,t){return Bt(e)&&t}(n,r)?(qn=!0,Ut(t,I,e)):function(e){return" "===e}(n)?Ut(t,_,e):function(e,t){return X&&t&&"o"===e.toLowerCase()}(n,i)?(e.preventDefault(),qn=!0,Ut(t,l,!0)):function(e,t){return Bt(e)&&!t}(n,r)?(qn=!1,Ut(t,I,e)):function(e,t,n,r){return X?!t&&!n&&(Ot(e)||"h"===e.toLowerCase()&&r):!(r||t||n)&&Ot(e)}(n,s,o,i)?Ot(n)?Ut(t,x,e):(e.preventDefault(),Ut(t,a,!0)):function(e){return"Escape"===e}(n)?Ut(t,P,e):function(e,t,n,r,i){return X?!(n||r||i)&&(Nt(e)||"d"===e.toLowerCase()&&t):!(t||r||i)&&Nt(e)}(n,i,r,s,o)?Nt(n)?Ut(t,k,e):(e.preventDefault(),Ut(t,a,!1)):function(e,t,n){return Ot(e)&&(X?t:n)}(n,s,i)?(e.preventDefault(),Ut(t,p,!0)):function(e,t,n){return Nt(e)&&(X?t:n)}(n,s,i)?(e.preventDefault(),Ut(t,p,!1)):function(e,t){return X&&t&&Ot(e)}(n,o)?(e.preventDefault(),Ut(t,f,!0)):function(e,t){return X&&t&&Nt(e)}(n,o)?(e.preventDefault(),Ut(t,f,!1)):function(e,t,n,r){return"b"===e.toLowerCase()&&!t&&kt(n,r)}(n,s,o,i)?(e.preventDefault(),Ut(t,g,"bold")):function(e,t,n,r){return"u"===e.toLowerCase()&&!t&&kt(n,r)}(n,s,o,i)?(e.preventDefault(),Ut(t,g,"underline")):function(e,t,n,r){return"i"===e.toLowerCase()&&!t&&kt(n,r)}(n,s,o,i)?(e.preventDefault(),Ut(t,g,"italic")):function(e,t,n,r){return"Tab"===e&&!t&&!n&&!r}(n,s,i,o)?Ut(t,B,e):function(e,t,n,r){return"z"===e.toLowerCase()&&!t&&kt(n,r)}(n,r,o,i)?(e.preventDefault(),Ut(t,m,void 0)):function(e,t,n,r){return X?"z"===e.toLowerCase()&&n&&t:"y"===e.toLowerCase()&&r||"z"===e.toLowerCase()&&r&&t}(n,r,o,i)?(e.preventDefault(),Ut(t,y,void 0)):Gr(t._editorState._selection)?function(e,t,n,r){return!t&&"c"===e.toLowerCase()&&(X?n:r)}(n,r,o,i)?(e.preventDefault(),Ut(t,L,e)):function(e,t,n,r){return!t&&"x"===e.toLowerCase()&&(X?n:r)}(n,r,o,i)?(e.preventDefault(),Ut(t,Q,e)):Dt(n,o,i)&&(e.preventDefault(),Ut(t,U,e)):!$&&Dt(n,o,i)&&(e.preventDefault(),Ut(t,U,e)),function(e,t,n,r){return e||t||n||r}(i,r,s,o)&&Ut(t,Z,e))}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;n instanceof Node&&"touch"!==r&&Ti(t,(()=>{Qi(pt(n))||(Wn=!0)}))}],["compositionstart",function(e,t){Ti(t,(()=>{const n=oi();if(Kr(n)&&!t.isComposing()){const r=n.anchor,i=n.anchor.getNode();ct(r.key),(e.timeStamp<Kn+30||"element"===r.type||!n.isCollapsed()||i.getFormat()!==n.format||Nr(i)&&i.getStyle()!==n.style)&&Ut(t,u,Ce)}}))}],["compositionend",function(e,t){$?Jn=!0:Ti(t,(()=>{rr(t,e.data)}))}],["input",function(e,t){e.stopPropagation(),Ti(t,(()=>{const n=oi(),r=e.data,i=nr(e);if(null!=r&&Kr(n)&&$n(n,i,r,e.timeStamp,!1)){Jn&&(rr(t,r),Jn=!1);const i=n.anchor.getNode(),o=Xt(t._window);if(null===o)return;const s=n.isBackward(),a=s?n.anchor.offset:n.focus.offset,l=s?n.focus.offset:n.anchor.offset;ee&&!n.isCollapsed()&&Nr(i)&&null!==o.anchorNode&&i.getTextContent().slice(0,a)+r+i.getTextContent().slice(a+l)===Et(o.anchorNode)||Ut(t,u,r);const c=r.length;$&&c>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(n.anchor.offset-=c),te||ne||se||!t.isComposing()||(Kn=0,ct(null))}else It(!1,t,null!==r?r:void 0),Jn&&(rr(t,r||void 0),Jn=!1);wi(),Ke(Ei())})),Yn=null}],["click",function(e,t){Ti(t,(()=>{const n=oi(),r=Xt(t._window),i=si();if(r)if(Kr(n)){const t=n.anchor,o=t.getNode();"element"===t.type&&0===t.offset&&n.isCollapsed()&&!Vi(o)&&1===mt().getChildrenSize()&&o.getTopLevelElementOrThrow().isEmpty()&&null!==i&&n.is(i)?(r.removeAllRanges(),n.dirty=!0):3!==e.detail||n.isCollapsed()||o!==n.focus.getNode()&&(Fi(o)?o.select(0):o.getParentOrThrow().select(0))}else if("touch"===e.pointerType){const n=r.anchorNode;if(null!==n){const o=n.nodeType;o!==ae&&o!==le||vt(ii(i,r,t,e))}}Ut(t,s,e)}))}],["cut",Un],["copy",Un],["dragstart",Un],["dragover",Un],["dragend",Un],["paste",Un],["focus",Un],["blur",Un],["drop",Un]];ee&&Vn.push(["beforeinput",(e,t)=>function(e,t){const n=e.inputType,r=nr(e);"deleteCompositionText"===n||$&&Qt(t)||"insertCompositionText"!==n&&Ti(t,(()=>{const i=oi();if("deleteContentBackward"===n){if(null===i){const e=si();if(!Kr(e))return;vt(e.clone())}if(Kr(i)){const n=i.anchor.key===i.focus.key;if(o=e.timeStamp,"MediaLast"===Hn&&o<Kn+30&&t.isComposing()&&n){if(ct(null),Kn=0,setTimeout((()=>{Ti(t,(()=>{ct(null)}))}),30),Kr(i)){const e=i.anchor.getNode();e.markDirty(),i.format=e.getFormat(),Nr(e)||W(142),i.style=e.getStyle()}}else{ct(null),e.preventDefault();const r=i.anchor.getNode().getTextContent(),o=0===i.anchor.offset&&i.focus.offset===r.length;oe&&n&&!o||Ut(t,a,!0)}return}}var o;if(!Kr(i))return;const s=e.data;null!==Yn&&It(!1,t,Yn),i.dirty&&null===Yn||!i.isCollapsed()||Vi(i.anchor.getNode())||null===r||i.applyDOMRange(r),Yn=null;const v=i.anchor,A=i.focus,b=v.getNode(),w=A.getNode();if("insertText"!==n&&"insertTranspose"!==n)switch(e.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":Ut(t,u,e);break;case"insertFromComposition":ct(null),Ut(t,u,e);break;case"insertLineBreak":ct(null),Ut(t,l,!1);break;case"insertParagraph":ct(null),qn&&!ne?(qn=!1,Ut(t,l,!1)):Ut(t,c,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":Ut(t,d,e);break;case"deleteByComposition":(function(e,t){return e!==t||Fi(e)||Fi(t)||!e.isToken()||!t.isToken()})(b,w)&&Ut(t,h,e);break;case"deleteByDrag":case"deleteByCut":Ut(t,h,e);break;case"deleteContent":Ut(t,a,!1);break;case"deleteWordBackward":Ut(t,p,!0);break;case"deleteWordForward":Ut(t,p,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":Ut(t,f,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":Ut(t,f,!1);break;case"formatStrikeThrough":Ut(t,g,"strikethrough");break;case"formatBold":Ut(t,g,"bold");break;case"formatItalic":Ut(t,g,"italic");break;case"formatUnderline":Ut(t,g,"underline");break;case"historyUndo":Ut(t,m,void 0);break;case"historyRedo":Ut(t,y,void 0)}else{if("\n"===s)e.preventDefault(),Ut(t,l,!1);else if(s===Se)e.preventDefault(),Ut(t,c,void 0);else if(null==s&&e.dataTransfer){const t=e.dataTransfer.getData("text/plain");e.preventDefault(),i.insertRawText(t)}else null!=s&&$n(i,r,s,e.timeStamp,!0)?(e.preventDefault(),Ut(t,u,s)):Yn=s;Gn=e.timeStamp}}))}(e,t)]);let Kn=0,Hn=null,Gn=0,Yn=null;const zn=new WeakMap;let Zn=!1,Wn=!1,qn=!1,Jn=!1,Xn=[0,"",0,"root",0];function $n(e,t,n,r,i){const o=e.anchor,s=e.focus,a=o.getNode(),l=Ei(),c=Xt(l._window),u=null!==c?c.anchorNode:null,d=o.key,h=l.getElementByKey(d),p=n.length;return d!==s.key||!Nr(a)||(!i&&(!ee||Gn<r+50)||a.isDirty()&&p<2||wt(n))&&o.offset!==s.offset&&!a.isComposing()||tt(a)||a.isDirty()&&p>1||(i||!ee)&&null!==h&&!a.isComposing()&&u!==rt(h)||null!==c&&null!==t&&(!t.collapsed||t.startContainer!==c.anchorNode||t.startOffset!==c.anchorOffset)||a.getFormat()!==e.format||a.getStyle()!==e.style||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;const n=e.anchor.offset,r=t.getParentOrThrow(),i=t.isToken();return 0===n?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){const t=e.getPreviousSibling();return(Nr(t)||Fi(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,a)}function er(e,t){return null!==e&&null!==e.nodeValue&&e.nodeType===le&&0!==t&&t!==e.nodeValue.length}function tr(e,t,n){const{anchorNode:r,anchorOffset:o,focusNode:s,focusOffset:a}=e;Zn&&(Zn=!1,er(r,o)&&er(s,a))||Ti(t,(()=>{if(!n)return void vt(null);if(!$e(t,r,s))return;const l=oi();if(Kr(l)){const n=l.anchor,r=n.getNode();if(l.isCollapsed()){"Range"===e.type&&e.anchorNode===e.focusNode&&(l.dirty=!0);const i=Yt(t).event,o=i?i.timeStamp:performance.now(),[s,a,c,u,d]=Xn,h=mt(),p=!1===t.isComposing()&&""===h.getTextContent();if(o<d+200&&n.offset===c&&n.key===u)l.format=s,l.style=a;else if("text"===n.type)Nr(r)||W(141),l.format=r.getFormat(),l.style=r.getStyle();else if("element"===n.type&&!p){const e=n.getNode();e instanceof zi&&0===e.getChildrenSize()?l.format=e.getTextFormat():l.format=0,l.style=""}}else{const e=n.key,t=l.focus.key,r=l.getNodes(),i=r.length,s=l.isBackward(),c=s?a:o,u=s?o:a,d=s?t:e,h=s?e:t;let p=fe,f=!1;for(let e=0;e<i;e++){const t=r[e],n=t.getTextContentSize();if(Nr(t)&&0!==n&&!(0===e&&t.__key===d&&c===n||e===i-1&&t.__key===h&&0===u)&&(f=!0,p&=t.getFormat(),0===p))break}l.format=f?p:0}}Ut(t,i,void 0)}))}function nr(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return 0===t.length?null:t[0]}function rr(e,t){const n=e._compositionKey;if(ct(null),null!==n&&null!=t){if(""===t){const t=dt(n),r=rt(e.getElementByKey(n));return void(null!==r&&null!==r.nodeValue&&Nr(t)&&_t(t,r.nodeValue,null,null,!0))}if("\n"===t[t.length-1]){const t=oi();if(Kr(t)){const n=t.focus;return t.anchor.set(n.key,n.offset,n.type),void Ut(e,I,null)}}}It(!0,e,t)}function ir(e){let t=e.__lexicalEventHandles;return void 0===t&&(t=[],e.__lexicalEventHandles=t),t}const or=new Map;function sr(e){const t=e.target,n=Xt(null==t?null:9===t.nodeType?t.defaultView:t.ownerDocument.defaultView);if(null===n)return;const r=et(n.anchorNode);if(null===r)return;Wn&&(Wn=!1,Ti(r,(()=>{const t=si(),i=n.anchorNode;if(null===i)return;const o=i.nodeType;o!==ae&&o!==le||vt(ii(t,n,r,e))})));const i=St(r),o=i[i.length-1],s=o._key,a=or.get(s),l=a||o;l!==r&&tr(n,l,!1),tr(n,r,!0),r!==o?or.set(s,r):a&&or.delete(s)}function ar(e){e._lexicalHandled=!0}function lr(e){return!0===e._lexicalHandled}function cr(e,t,n){wi();const r=e.__key,i=e.getParent();if(null===i)return;const o=function(e){const t=oi();if(!Kr(t)||!Fi(e))return t;const{anchor:n,focus:r}=t,i=n.getNode(),o=r.getNode();return Gt(i,e)&&n.set(e.__key,0,"element"),Gt(o,e)&&r.set(e.__key,0,"element"),t}(e);let s=!1;if(Kr(o)&&t){const t=o.anchor,n=o.focus;t.key===r&&(ci(t,e,i,e.getPreviousSibling(),e.getNextSibling()),s=!0),n.key===r&&(ci(n,e,i,e.getPreviousSibling(),e.getNextSibling()),s=!0)}else Gr(o)&&t&&e.isSelected()&&e.selectPrevious();if(Kr(o)&&t&&!s){const t=e.getIndexWithinParent();at(e),ai(o,i,t,-1)}else at(e);n||zt(i)||i.canBeEmpty()||!i.isEmpty()||cr(i,t),t&&Vi(i)&&i.isEmpty()&&i.selectEnd()}class ur{static getType(){W(64,this.name)}static clone(e){W(65,this.name)}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,st(this,e)}getType(){return this.__type}isInline(){W(137,this.constructor.name)}isAttached(){let e=this.__key;for(;null!==e;){if("root"===e)return!0;const t=dt(e);if(null===t)break;e=t.__parent}return!1}isSelected(e){const t=e||oi();if(null==t)return!1;const n=t.getNodes().some((e=>e.__key===this.__key));return(Nr(this)||!Kr(t)||"element"!==t.anchor.type||"element"!==t.focus.type||t.anchor.key!==t.focus.key||t.anchor.offset!==t.focus.offset)&&n}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(null===e)return-1;let t=e.getFirstChild(),n=0;for(;null!==t;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return null===e?null:dt(e)}getParentOrThrow(){const e=this.getParent();return null===e&&W(66,this.__key),e}getTopLevelElement(){let e=this;for(;null!==e;){const t=e.getParent();if(zt(t))return Fi(e)||W(138),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return null===e&&W(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return null===e?null:dt(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(null===t)return e;let n=t.getFirstChild();for(;null!==n&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return null===e?null:dt(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=this.getParents(),n=e.getParents();Fi(this)&&t.unshift(this),Fi(e)&&n.unshift(e);const r=t.length,i=n.length;if(0===r||0===i||t[r-1]!==n[i-1])return null;const o=new Set(n);for(let e=0;e<r;e++){const n=t[e];if(o.has(n))return n}return null}is(e){return null!=e&&this.__key===e.__key}isBefore(e){if(this===e)return!1;if(e.isParentOf(this))return!0;if(this.isParentOf(e))return!1;const t=this.getCommonAncestor(e);let n=0,r=0,i=this;for(;;){const e=i.getParentOrThrow();if(e===t){n=i.getIndexWithinParent();break}i=e}for(i=e;;){const e=i.getParentOrThrow();if(e===t){r=i.getIndexWithinParent();break}i=e}return n<r}isParentOf(e){const t=this.__key;if(t===e.__key)return!1;let n=e;for(;null!==n;){if(n.__key===t)return!0;n=n.getParent()}return!1}getNodesBetween(e){const t=this.isBefore(e),n=[],r=new Set;let i=this;for(;null!==i;){const o=i.__key;if(r.has(o)||(r.add(o),n.push(i)),i===e)break;const s=Fi(i)?t?i.getFirstChild():i.getLastChild():null;if(null!==s){i=s;continue}const a=t?i.getNextSibling():i.getPreviousSibling();if(null!==a){i=a;continue}const l=i.getParentOrThrow();if(r.has(l.__key)||n.push(l),l===e)break;let c=null,u=l;do{if(null===u&&W(68),c=t?u.getNextSibling():u.getPreviousSibling(),u=u.getParent(),null===u)break;null!==c||r.has(u.__key)||n.push(u)}while(null===c);i=c}return t||n.reverse(),n}isDirty(){const e=Ei()._dirtyLeaves;return null!==e&&e.has(this.__key)}getLatest(){const e=dt(this.__key);return null===e&&W(113),e}getWritable(){wi();const e=Ci(),t=Ei(),n=e._nodeMap,r=this.__key,i=this.getLatest(),o=i.__parent,s=t._cloneNotNeeded,a=oi();if(null!==a&&a.setCachedNodes(null),s.has(r))return lt(i),i;const l=i.constructor.clone(i);return l.__parent=o,l.__next=i.__next,l.__prev=i.__prev,Fi(i)&&Fi(l)?(qi(i)&&qi(l)&&(l.__textFormat=i.__textFormat),l.__first=i.__first,l.__last=i.__last,l.__size=i.__size,l.__indent=i.__indent,l.__format=i.__format,l.__dir=i.__dir):Nr(i)&&Nr(l)&&(l.__format=i.__format,l.__style=i.__style,l.__mode=i.__mode,l.__detail=i.__detail),s.add(r),l.__key=r,lt(l),n.set(r,l),l}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){W(70)}updateDOM(e,t,n){W(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){W(72)}static importJSON(e){W(18,this.name)}static transform(){return null}remove(e){cr(this,!0,e)}replace(e,t){wi();let n=oi();null!==n&&(n=n.clone()),Wt(this,e);const r=this.getLatest(),i=this.__key,o=e.__key,s=e.getWritable(),a=this.getParentOrThrow().getWritable(),l=a.__size;at(s);const c=r.getPreviousSibling(),u=r.getNextSibling(),d=r.__prev,h=r.__next,p=r.__parent;if(cr(r,!1,!0),null===c?a.__first=o:c.getWritable().__next=o,s.__prev=d,null===u?a.__last=o:u.getWritable().__prev=o,s.__next=h,s.__parent=p,a.__size=l,t&&(Fi(this)&&Fi(s)||W(139),this.getChildren().forEach((e=>{s.append(e)}))),Kr(n)){vt(n);const e=n.anchor,t=n.focus;e.key===i&&Qr(e,s),t.key===i&&Qr(t,s)}return ut()===i&&ct(o),s}insertAfter(e,t=!0){wi(),Wt(this,e);const n=this.getWritable(),r=e.getWritable(),i=r.getParent(),o=oi();let s=!1,a=!1;if(null!==i){const t=e.getIndexWithinParent();if(at(r),Kr(o)){const e=i.__key,n=o.anchor,r=o.focus;s="element"===n.type&&n.key===e&&n.offset===t+1,a="element"===r.type&&r.key===e&&r.offset===t+1}}const l=this.getNextSibling(),c=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(null===l?c.__last=u:l.getWritable().__prev=u,c.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&Kr(o)){const e=this.getIndexWithinParent();ai(o,c,e+1);const t=c.__key;s&&o.anchor.set(t,e+2,"element"),a&&o.focus.set(t,e+2,"element")}return e}insertBefore(e,t=!0){wi(),Wt(this,e);const n=this.getWritable(),r=e.getWritable(),i=r.__key;at(r);const o=this.getPreviousSibling(),s=this.getParentOrThrow().getWritable(),a=n.__prev,l=this.getIndexWithinParent();null===o?s.__first=i:o.getWritable().__next=i,s.__size++,n.__prev=i,r.__prev=a,r.__next=n.__key,r.__parent=n.__parent;const c=oi();return t&&Kr(c)&&ai(c,this.getParentOrThrow(),l),e}isParentRequired(){return!1}createParentElementNode(){return Wi()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){wi();const n=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===n)return r.select(0,0);if(Fi(n))return n.select();if(!Nr(n)){const e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){wi();const n=this.getNextSibling(),r=this.getParentOrThrow();if(null===n)return r.select();if(Fi(n))return n.select(0,0);if(!Nr(n)){const e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}}class dr extends ur{static getType(){return"linebreak"}static clone(e){return new dr(e.__key)}constructor(e){super(e)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(e){const t=e.parentElement;if(null!==t){const n=t.firstChild;if(n===e||n.nextSibling===e&&gr(n)){const n=t.lastChild;if(n===e||n.previousSibling===e&&gr(n))return!0}}return!1}(e)?null:{conversion:hr,priority:0}}}static importJSON(e){return pr()}exportJSON(){return{type:"linebreak",version:1}}}function hr(e){return{node:pr()}}function pr(){return Zt(new dr)}function fr(e){return e instanceof dr}function gr(e){return e.nodeType===le&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function mr(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function yr(e,t){return 1&t?"strong":2&t?"em":"span"}function vr(e,t,n,r,i){const o=r.classList;let s=Tt(i,"base");void 0!==s&&o.add(...s),s=Tt(i,"underlineStrikethrough");let a=!1;const l=t&pe&&t&he;void 0!==s&&(n&pe&&n&he?(a=!0,l||o.add(...s)):l&&o.remove(...s));for(const e in Pe){const r=Pe[e];if(s=Tt(i,e),void 0!==s)if(n&r){if(a&&("underline"===e||"strikethrough"===e)){t&r&&o.remove(...s);continue}t&r&&(!l||"underline"!==e)&&"strikethrough"!==e||o.add(...s)}else t&r&&o.remove(...s)}}function Ar(e,t,n){const r=t.firstChild,i=n.isComposing(),o=e+(i?we:"");if(null==r)t.textContent=o;else{const e=r.nodeValue;if(e!==o)if(i||$){const[t,n,i]=function(e,t){const n=e.length,r=t.length;let i=0,o=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;o+i<n&&o+i<r&&e[n-o-1]===t[r-o-1];)o++;return[i,n-i-o,t.slice(i,r-o)]}(e,o);0!==n&&r.deleteData(t,n),r.insertData(t,i)}else r.nodeValue=o}}function br(e,t,n,r,i,o){Ar(i,e,t);const s=o.theme.text;void 0!==s&&vr(0,0,r,e,s)}function wr(e,t){const n=document.createElement(t);return n.appendChild(e),n}class Sr extends ur{static getType(){return"text"}static clone(e){return new Sr(e.__text,e.__key)}constructor(e,t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return De[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===ut()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=Pe[e];return!!(this.getFormat()&t)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return it(this.getLatest().__format,e,t)}canHaveFormat(){return!0}createDOM(e,t){const n=this.__format,r=mr(0,n),i=yr(0,n),o=null===r?i:r,s=document.createElement(o);let a=s;this.hasFormat("code")&&s.setAttribute("spellcheck","false"),null!==r&&(a=document.createElement(i),s.appendChild(a)),br(a,this,0,n,this.__text,e);const l=this.__style;return""!==l&&(s.style.cssText=l),s}updateDOM(e,t,n){const r=this.__text,i=e.__format,o=this.__format,s=mr(0,i),a=mr(0,o),l=yr(0,i),c=yr(0,o);if((null===s?l:s)!==(null===a?c:a))return!0;if(s===a&&l!==c){const e=t.firstChild;null==e&&W(48);const i=document.createElement(c);return br(i,this,0,o,r,n),t.replaceChild(i,e),!1}let u=t;null!==a&&null!==s&&(u=t.firstChild,null==u&&W(49)),Ar(r,u,this);const d=n.theme.text;void 0!==d&&i!==o&&vr(0,i,o,u,d);const h=e.__style,p=this.__style;return h!==p&&(t.style.cssText=p),!1}static importDOM(){return{"#text":()=>({conversion:xr,priority:0}),b:()=>({conversion:Er,priority:0}),code:()=>({conversion:Br,priority:0}),em:()=>({conversion:Br,priority:0}),i:()=>({conversion:Br,priority:0}),s:()=>({conversion:Br,priority:0}),span:()=>({conversion:Cr,priority:0}),strong:()=>({conversion:Br,priority:0}),sub:()=>({conversion:Br,priority:0}),sup:()=>({conversion:Br,priority:0}),u:()=>({conversion:Br,priority:0})}}static importJSON(e){const t=Or(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){let{element:t}=super.exportDOM(e);return null!==t&&tn(t)||W(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=wr(t,"b")),this.hasFormat("italic")&&(t=wr(t,"i")),this.hasFormat("strikethrough")&&(t=wr(t,"s")),this.hasFormat("underline")&&(t=wr(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format="string"==typeof e?Pe[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail="string"==typeof e?ke[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=it(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=Ne[e];if(this.__mode===t)return this;const n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){wi();let n=e,r=t;const i=oi(),o=this.getTextContent(),s=this.__key;if("string"==typeof o){const e=o.length;void 0===n&&(n=e),void 0===r&&(r=e)}else n=0,r=0;if(!Kr(i))return ei(s,n,s,r,"text","text");{const e=ut();e!==i.anchor.key&&e!==i.focus.key||ct(s),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){const i=this.getWritable(),o=i.__text,s=n.length;let a=e;a<0&&(a=s+a,a<0&&(a=0));const l=oi();if(r&&Kr(l)){const t=e+s;l.setTextNodeRange(i,t,i,t)}const c=o.slice(0,a)+n+o.slice(a+t);return i.__text=c,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){wi();const t=this.getLatest(),n=t.getTextContent(),r=t.__key,i=ut(),o=new Set(e),s=[],a=n.length;let l="";for(let e=0;e<a;e++)""!==l&&o.has(e)&&(s.push(l),l=""),l+=n[e];""!==l&&s.push(l);const c=s.length;if(0===c)return[];if(s[0]===n)return[t];const u=s[0],d=t.getParentOrThrow();let h;const p=t.getFormat(),f=t.getStyle(),g=t.__detail;let m=!1;t.isSegmented()?(h=Or(u),h.__format=p,h.__style=f,h.__detail=g,m=!0):(h=t.getWritable(),h.__text=u);const y=oi(),v=[h];let A=u.length;for(let e=1;e<c;e++){const t=s[e],n=t.length,o=Or(t).getWritable();o.__format=p,o.__style=f,o.__detail=g;const a=o.__key,l=A+n;if(Kr(y)){const e=y.anchor,t=y.focus;e.key===r&&"text"===e.type&&e.offset>A&&e.offset<=l&&(e.key=a,e.offset-=A,y.dirty=!0),t.key===r&&"text"===t.type&&t.offset>A&&t.offset<=l&&(t.key=a,t.offset-=A,y.dirty=!0)}i===r&&ct(a),A=l,v.push(o)}!function(e){const t=e.getPreviousSibling(),n=e.getNextSibling();null!==t&&lt(t),null!==n&&lt(n)}(this);const b=d.getWritable(),w=this.getIndexWithinParent();return m?(b.splice(w,0,v),this.remove()):b.splice(w,1,v),Kr(y)&&ai(y,d,w,c-1),v}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||W(50);const n=this.__key,r=e.__key,i=this.__text,o=i.length;ut()===r&&ct(n);const s=oi();if(Kr(s)){const i=s.anchor,a=s.focus;null!==i&&i.key===r&&(ui(i,t,n,e,o),s.dirty=!0),null!==a&&a.key===r&&(ui(a,t,n,e,o),s.dirty=!0)}const a=e.__text,l=t?a+i:i+a;this.setTextContent(l);const c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}}function Cr(e){return{forChild:Dr(e.style),node:null}}function Er(e){const t=e,n="normal"===t.style.fontWeight;return{forChild:Dr(t.style,n?void 0:"bold"),node:null}}const Ir=new WeakMap;function _r(e){return"PRE"===e.nodeName||e.nodeType===ae&&void 0!==e.style&&void 0!==e.style.whiteSpace&&e.style.whiteSpace.startsWith("pre")}function xr(e){const t=e;null===e.parentElement&&W(129);let n=t.textContent||"";if(null!==function(e){let t,n=e.parentNode;const r=[e];for(;null!==n&&void 0===(t=Ir.get(n))&&!_r(n);)r.push(n),n=n.parentNode;const i=void 0===t?n:t;for(let e=0;e<r.length;e++)Ir.set(r[e],i);return i}(t)){const e=n.split(/(\r?\n|\t)/),t=[],r=e.length;for(let n=0;n<r;n++){const r=e[n];"\n"===r||"\r\n"===r?t.push(pr()):"\t"===r?t.push(Tr()):""!==r&&t.push(Or(r))}return{node:t}}if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),""===n)return{node:null};if(" "===n[0]){let e=t,r=!0;for(;null!==e&&null!==(e=Pr(e,!1));){const t=e.textContent||"";if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(" "===n[n.length-1]){let e=t,r=!0;for(;null!==e&&null!==(e=Pr(e,!0));)if((e.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return""===n?{node:null}:{node:Or(n)}}function Pr(e,t){let n=e;for(;;){let e;for(;null===(e=t?n.nextSibling:n.previousSibling);){const e=n.parentElement;if(null===e)return null;n=e}if(n=e,n.nodeType===ae){const e=n.style.display;if(""===e&&!nn(n)||""!==e&&!e.startsWith("inline"))return null}let r=n;for(;null!==(r=t?n.firstChild:n.lastChild);)n=r;if(n.nodeType===le)return n;if("BR"===n.nodeName)return null}}const kr={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Br(e){const t=kr[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:Dr(e.style,t),node:null}}function Or(e=""){return Zt(new Sr(e))}function Nr(e){return e instanceof Sr}function Dr(e,t){const n=e.fontWeight,r=e.textDecoration.split(" "),i="700"===n||"bold"===n,o=r.includes("line-through"),s="italic"===e.fontStyle,a=r.includes("underline"),l=e.verticalAlign;return e=>Nr(e)?(i&&!e.hasFormat("bold")&&e.toggleFormat("bold"),o&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),s&&!e.hasFormat("italic")&&e.toggleFormat("italic"),a&&!e.hasFormat("underline")&&e.toggleFormat("underline"),"sub"!==l||e.hasFormat("subscript")||e.toggleFormat("subscript"),"super"!==l||e.hasFormat("superscript")||e.toggleFormat("superscript"),t&&!e.hasFormat(t)&&e.toggleFormat(t),e):e}class jr extends Sr{static getType(){return"tab"}static clone(e){const t=new jr(e.__key);return t.__text=e.__text,t.__format=e.__format,t.__style=e.__style,t}constructor(e){super("\t",e),this.__detail=2}static importDOM(){return null}static importJSON(e){const t=Tr();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){W(126)}setDetail(e){W(127)}setMode(e){W(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Tr(){return Zt(new jr)}function Mr(e){return e instanceof jr}class Fr{constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),n=e.getNode();const r=this.offset,i=e.offset;if(Fi(t)){const e=t.getDescendantByIndex(r);t=null!=e?e:t}if(Fi(n)){const e=n.getDescendantByIndex(i);n=null!=e?e:n}return t===n?r<i:t.isBefore(n)}getNode(){const e=dt(this.key);return null===e&&W(20),e}set(e,t,n){const r=this._selection,i=this.key;this.key=e,this.offset=t,this.type=n,bi()||(ut()===i&&ct(e),null!==r&&(r.setCachedNodes(null),r.dirty=!0))}}function Rr(e,t,n){return new Fr(e,t,n)}function Lr(e,t){let n=t.__key,r=e.offset,i="element";if(Nr(t)){i="text";const e=t.getTextContentSize();r>e&&(r=e)}else if(!Fi(t)){const e=t.getNextSibling();if(Nr(e))n=e.__key,r=0,i="text";else{const e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function Qr(e,t){if(Fi(t)){const n=t.getLastDescendant();Fi(n)||Nr(n)?Lr(e,n):Lr(e,t)}else Lr(e,t)}function Ur(e,t,n,r){e.key=t,e.offset=n,e.type=r}class Vr{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Gr(e))return!1;const t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every((e=>n.has(e)))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new Vr(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),n=t.length,r=t[n-1];let i;if(Nr(r))i=r.select();else{const e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let e=0;e<n;e++)t[e].remove()}getNodes(){const e=this._cachedNodes;if(null!==e)return e;const t=this._nodes,n=[];for(const e of t){const t=dt(e);null!==t&&n.push(t)}return bi()||(this._cachedNodes=n),n}getTextContent(){const e=this.getNodes();let t="";for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}}function Kr(e){return e instanceof Hr}class Hr{constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!Kr(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(null!==e)return e;const t=this.anchor,n=this.focus,r=t.isBefore(n),i=r?t:n,o=r?n:t;let s=i.getNode(),a=o.getNode();const l=i.offset,c=o.offset;if(Fi(s)){const e=s.getDescendantByIndex(l);s=null!=e?e:s}if(Fi(a)){let e=a.getDescendantByIndex(c);null!==e&&e!==s&&a.getChildAtIndex(c)===e&&(e=e.getPreviousSibling()),a=null!=e?e:a}let u;return u=s.is(a)?Fi(s)&&s.getChildrenSize()>0?[]:[s]:s.getNodesBetween(a),bi()||(this._cachedNodes=u),u}setTextNodeRange(e,t,n,r){Ur(this.anchor,e.__key,t,"text"),Ur(this.focus,n.__key,r,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const e=this.getNodes();if(0===e.length)return"";const t=e[0],n=e[e.length-1],r=this.anchor,i=this.focus,o=r.isBefore(i),[s,a]=zr(this);let l="",c=!0;for(let u=0;u<e.length;u++){const d=e[u];if(Fi(d)&&!d.isInline())c||(l+="\n"),c=!d.isEmpty();else if(c=!1,Nr(d)){let e=d.getTextContent();d===t?d===n?"element"===r.type&&"element"===i.type&&i.offset!==r.offset||(e=s<a?e.slice(s,a):e.slice(a,s)):e=o?e.slice(s):e.slice(a):d===n&&(e=o?e.slice(0,a):e.slice(0,s)),l+=e}else!Qi(d)&&!fr(d)||d===n&&this.isCollapsed()||(l+=d.getTextContent())}return l}applyDOMRange(e){const t=Ei(),n=t.getEditorState()._selection,r=Xr(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(null===r)return;const[i,o]=r;Ur(this.anchor,i.key,i.offset,i.type),Ur(this.focus,o.key,o.offset,o.type),this._cachedNodes=null}clone(){const e=this.anchor,t=this.focus;return new Hr(Rr(e.key,e.offset,e.type),Rr(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=it(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=Pe[e];return!!(this.format&t)}insertRawText(e){const t=e.split(/(\r?\n|\t)/),n=[],r=t.length;for(let e=0;e<r;e++){const r=t[e];"\n"===r||"\r\n"===r?n.push(pr()):"\t"===r?n.push(Tr()):n.push(Or(r))}this.insertNodes(n)}insertText(e){const t=this.anchor,n=this.focus,r=this.format,i=this.style;let o=t,s=n;!this.isCollapsed()&&n.isBefore(t)&&(o=n,s=t),"element"===o.type&&function(e,t,n,r){const i=e.getNode(),o=i.getChildAtIndex(e.offset),s=Or(),a=Vi(i)?Wi().append(s):s;s.setFormat(n),s.setStyle(r),null===o?i.append(a):o.insertBefore(a),e.is(t)&&t.set(s.__key,0,"text"),e.set(s.__key,0,"text")}(o,s,r,i);const a=o.offset;let l=s.offset;const c=this.getNodes(),u=c.length;let d=c[0];Nr(d)||W(26);const h=d.getTextContent().length,p=d.getParentOrThrow();let f=c[u-1];if(1===u&&"element"===s.type&&(l=h,s.set(o.key,l,"text")),this.isCollapsed()&&a===h&&(d.isSegmented()||d.isToken()||!d.canInsertTextAfter()||!p.canInsertTextAfter()&&null===d.getNextSibling())){let t=d.getNextSibling();if(Nr(t)&&t.canInsertTextBefore()&&!tt(t)||(t=Or(),t.setFormat(r),p.canInsertTextAfter()?d.insertAfter(t):p.insertAfter(t)),t.select(0,0),d=t,""!==e)return void this.insertText(e)}else if(this.isCollapsed()&&0===a&&(d.isSegmented()||d.isToken()||!d.canInsertTextBefore()||!p.canInsertTextBefore()&&null===d.getPreviousSibling())){let t=d.getPreviousSibling();if(Nr(t)&&!tt(t)||(t=Or(),t.setFormat(r),p.canInsertTextBefore()?d.insertBefore(t):p.insertBefore(t)),t.select(),d=t,""!==e)return void this.insertText(e)}else if(d.isSegmented()&&a!==h){const e=Or(d.getTextContent());e.setFormat(r),d.replace(e),d=e}else if(!this.isCollapsed()&&""!==e){const t=f.getParent();if(!p.canInsertTextBefore()||!p.canInsertTextAfter()||Fi(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(""),Jr(this.anchor,this.focus,null),void this.insertText(e)}if(1===u){if(d.isToken()){const t=Or(e);return t.select(),void d.replace(t)}const t=d.getFormat(),n=d.getStyle();if(a!==l||t===r&&n===i){if(Mr(d)){const t=Or(e);return t.setFormat(r),t.setStyle(i),t.select(),void d.replace(t)}}else{if(""!==d.getTextContent()){const t=Or(e);if(t.setFormat(r),t.setStyle(i),t.select(),0===a)d.insertBefore(t,!1);else{const[e]=d.splitText(a);e.insertAfter(t,!1)}return void(t.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length))}d.setFormat(r),d.setStyle(i)}const o=l-a;d=d.spliceText(a,o,e,!0),""===d.getTextContent()?d.remove():"text"===this.anchor.type&&(d.isComposing()?this.anchor.offset-=e.length:(this.format=t,this.style=n))}else{const t=new Set([...d.getParentKeys(),...f.getParentKeys()]),n=Fi(d)?d:d.getParentOrThrow();let r=Fi(f)?f:f.getParentOrThrow(),i=f;if(!n.is(r)&&r.isInline())do{i=r,r=r.getParentOrThrow()}while(r.isInline());if("text"===s.type&&(0!==l||""===f.getTextContent())||"element"===s.type&&f.getIndexWithinParent()<l)if(Nr(f)&&!f.isToken()&&l!==f.getTextContentSize()){if(f.isSegmented()){const e=Or(f.getTextContent());f.replace(e),f=e}Vi(s.getNode())||"text"!==s.type||(f=f.spliceText(0,l,"")),t.add(f.__key)}else{const e=f.getParentOrThrow();e.canBeEmpty()||1!==e.getChildrenSize()?f.remove():e.remove()}else t.add(f.__key);const o=r.getChildren(),p=new Set(c),g=n.is(r),m=n.isInline()&&null===d.getNextSibling()?n:d;for(let e=o.length-1;e>=0;e--){const t=o[e];if(t.is(d)||Fi(t)&&t.isParentOf(d))break;t.isAttached()&&(!p.has(t)||t.is(i)?g||m.insertAfter(t,!1):t.remove())}if(!g){let e=r,n=null;for(;null!==e;){const r=e.getChildren(),i=r.length;(0===i||r[i-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(d.isToken())if(a===h)d.select();else{const t=Or(e);t.select(),d.replace(t)}else d=d.spliceText(a,h-a,e,!0),""===d.getTextContent()?d.remove():d.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length);for(let e=1;e<u;e++){const n=c[e],r=n.__key;t.has(r)||n.remove()}}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed())return this.toggleFormat(e),void ct(null);const t=this.getNodes(),n=[];for(const e of t)Nr(e)&&n.push(e);const r=n.length;if(0===r)return this.toggleFormat(e),void ct(null);const i=this.anchor,o=this.focus,s=this.isBackward(),a=s?o:i,l=s?i:o;let c=0,u=n[0],d="element"===a.type?0:a.offset;if("text"===a.type&&d===u.getTextContentSize()&&(c=1,u=n[1],d=0),null==u)return;const h=u.getFormatFlags(e,null),p=r-1;let f=n[p];const g="text"===l.type?l.offset:f.getTextContentSize();if(u.is(f)){if(d===g)return;if(tt(u)||0===d&&g===u.getTextContentSize())u.setFormat(h);else{const e=u.splitText(d,g),t=0===d?e[0]:e[1];t.setFormat(h),"text"===a.type&&a.set(t.__key,0,"text"),"text"===l.type&&l.set(t.__key,g-d,"text")}return void(this.format=h)}0===d||tt(u)||([,u]=u.splitText(d),d=0),u.setFormat(h);const m=f.getFormatFlags(e,h);g>0&&(g===f.getTextContentSize()||tt(f)||([f]=f.splitText(g)),f.setFormat(m));for(let t=c+1;t<p;t++){const r=n[t],i=r.getFormatFlags(e,m);r.setFormat(i)}"text"===a.type&&a.set(u.__key,d,"text"),"text"===l.type&&l.set(f.__key,g,"text"),this.format=h|m}insertNodes(e){if(0===e.length)return;if("root"===this.anchor.key){this.insertParagraph();const t=oi();return Kr(t)||W(134),t.insertNodes(e)}const t=sn((this.isBackward()?this.focus:this.anchor).getNode(),on),n=e[e.length-1];if("__language"in t&&Fi(t)){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const r=hi(this);t.splice(r,0,e),n.selectEnd()}return}if(!e.some((e=>(Fi(e)||Qi(e))&&!e.isInline()))){Fi(t)||W(135);const r=hi(this);return t.splice(r,0,e),void n.selectEnd()}const r=function(e){const t=Wi();let n=null;for(let r=0;r<e.length;r++){const i=e[r],o=fr(i);if(o||Qi(i)&&i.isInline()||Fi(i)&&i.isInline()||Nr(i)||i.isParentRequired()){if(null===n&&(n=i.createParentElementNode(),t.append(n),o))continue;null!==n&&n.append(i)}else t.append(i),n=null}return t}(e),i=r.getLastDescendant(),o=r.getChildren(),s=e=>"__value"in e&&"__checked"in e,a=Fi(t)&&t.isEmpty()?null:this.insertParagraph(),l=o[o.length-1];let c=o[0];var u;Fi(u=c)&&on(u)&&!u.isEmpty()&&Fi(t)&&(!t.isEmpty()||s(t))&&(Fi(t)||W(135),t.append(...c.getChildren()),c=o[1]),c&&function(e,t,n){const r=t.getParentOrThrow().getLastChild();let i=t;const o=[t];for(;i!==r;)i.getNextSibling()||W(140),i=i.getNextSibling(),o.push(i);let s=e;for(const e of o)s=s.insertAfter(e)}(t,c);const d=sn(i,on);a&&Fi(d)&&(s(a)||on(l))&&(d.append(...a.getChildren()),a.remove()),Fi(t)&&t.isEmpty()&&t.remove(),i.selectEnd();const h=Fi(t)?t.getLastChild():null;fr(h)&&d!==t&&h.remove()}insertParagraph(){if("root"===this.anchor.key){const e=Wi();return mt().splice(this.anchor.offset,0,[e]),e.select(),e}const e=hi(this),t=sn(this.anchor.getNode(),on);Fi(t)||W(136);const n=t.getChildAtIndex(e),r=n?[n,...n.getNextSiblings()]:[],i=t.insertNewAfter(this,!1);return i?(i.append(...r),i.selectStart(),i):null}insertLineBreak(e){const t=pr();if(this.insertNodes([t]),e){const e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){const e=this.getNodes(),t=e.length,n=t-1,r=this.anchor,i=this.focus;let o=e[0],s=e[n];const[a,l]=zr(this);if(0===t)return[];if(1===t){if(Nr(o)&&!this.isCollapsed()){const e=a>l?l:a,t=a>l?a:l,n=o.splitText(e,t),r=0===e?n[0]:n[1];return null!=r?[r]:[]}return[o]}const c=r.isBefore(i);if(Nr(o)){const t=c?a:l;t===o.getTextContentSize()?e.shift():0!==t&&([,o]=o.splitText(t),e[0]=o)}if(Nr(s)){const t=s.getTextContent().length,r=c?l:a;0===r?e.pop():r!==t&&([s]=s.splitText(r),e[n]=s)}return e}modify(e,t,n){const r=this.focus,i=this.anchor,o="move"===e,s=Lt(r,t);if(Qi(s)&&!s.isIsolated()){if(o&&s.isKeyboardSelectable()){const e=ni();return e.add(s.__key),void vt(e)}const e=t?s.getPreviousSibling():s.getNextSibling();if(Nr(e)){const n=e.__key,s=t?e.getTextContent().length:0;return r.set(n,s,"text"),void(o&&i.set(n,s,"text"))}{const n=s.getParentOrThrow();let a,l;return Fi(e)?(l=e.__key,a=t?e.getChildrenSize():0):(a=s.getIndexWithinParent(),l=n.__key,t||a++),r.set(l,a,"element"),void(o&&i.set(l,a,"element"))}}const a=Ei(),l=Xt(a._window);if(!l)return;const c=a._blockCursorElement,u=a._rootElement;if(null===u||null===c||!Fi(s)||s.isInline()||s.canBeEmpty()||Jt(c,a,u),function(e,t,n,r){e.modify(t,n,r)}(l,e,t?"backward":"forward",n),l.rangeCount>0){const e=l.getRangeAt(0),n=this.anchor.getNode(),r=Vi(n)?n:function(e){let t=e.getParentOrThrow();for(;null!==t;){if(zt(t))return t;t=t.getParentOrThrow()}return t}(n);if(this.applyDOMRange(e),this.dirty=!0,!o){const n=this.getNodes(),i=[];let o=!1;for(let e=0;e<n.length;e++){const t=n[e];Gt(t,r)?i.push(t):o=!0}if(o&&i.length>0)if(t){const e=i[0];Fi(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{const e=i[i.length-1];Fi(e)?e.selectEnd():e.getParentOrThrow().selectEnd()}l.anchorNode===e.startContainer&&l.anchorOffset===e.startOffset||function(e){const t=e.focus,n=e.anchor,r=n.key,i=n.offset,o=n.type;Ur(n,t.key,t.offset,t.type),Ur(t,r,i,o),e._cachedNodes=null}(this)}}}forwardDeletion(e,t,n){if(!n&&("element"===e.type&&Fi(t)&&e.offset===t.getChildrenSize()||"text"===e.type&&e.offset===t.getTextContentSize())){const e=t.getParent(),n=t.getNextSibling()||(null===e?null:e.getNextSibling());if(Fi(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const t=this.anchor;let n=t.getNode();if(this.forwardDeletion(t,n,e))return;const r=this.focus,o=Lt(r,e);if(Qi(o)&&!o.isIsolated()){if(o.isKeyboardSelectable()&&Fi(n)&&0===n.getChildrenSize()){n.remove();const e=ni();e.add(o.__key),vt(e)}else o.remove(),Ei().dispatchCommand(i,void 0);return}if(!e&&Fi(o)&&Fi(n)&&n.isEmpty())return n.remove(),void o.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&0===t.offset&&("element"===t.type?t.getNode():t.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const i="text"===r.type?r.getNode():null;if(n="text"===t.type?t.getNode():null,null!==i&&i.isSegmented()){const t=r.offset,o=i.getTextContentSize();if(i.is(n)||e&&t!==o||!e&&0!==t)return void Zr(i,e,t)}else if(null!==n&&n.isSegmented()){const r=t.offset,o=n.getTextContentSize();if(n.is(i)||e&&0!==r||!e&&r!==o)return void Zr(n,e,r)}!function(e,t){const n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&"text"===n.type&&"text"===r.type){const e=n.offset,o=r.offset,s=e<o,a=s?e:o,l=s?o:e,c=l-1;a!==c&&(wt(i.getTextContent().slice(a,l))||(t?r.offset=c:n.offset=c))}}(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&"element"===this.anchor.type&&0===this.anchor.offset){const e=this.anchor.getNode();e.isEmpty()&&Vi(e.getParent())&&0===e.getIndexWithinParent()&&e.collapseAtStart(this)}}deleteLine(e){if(this.isCollapsed()){const t="element"===this.anchor.type;if(t&&this.insertText(" "),this.modify("extend",e,"lineboundary"),0===(e?this.focus:this.anchor).offset&&this.modify("extend",e,"character"),t){const t=e?this.anchor:this.focus;t.set(t.key,t.offset+1,t.type)}}this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function Gr(e){return e instanceof Vr}function Yr(e){const t=e.offset;if("text"===e.type)return t;const n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function zr(e){const t=e.getStartEndPoints();if(null===t)return[0,0];const[n,r]=t;return"element"===n.type&&"element"===r.type&&n.key===r.key&&n.offset===r.offset?[0,0]:[Yr(n),Yr(r)]}function Zr(e,t,n){const r=e,i=r.getTextContent().split(/(?=\s)/g),o=i.length;let s=0,a=0;for(let e=0;e<o;e++){const r=e===o-1;if(a=s,s+=i[e].length,t&&s===n||s>n||r){i.splice(e,1),r&&(a=void 0);break}}const l=i.join("").trim();""===l?r.remove():(r.setTextContent(l),r.select(a,a))}function Wr(e,t,n,r){let i,o=t;if(e.nodeType===ae){let s=!1;const a=e.childNodes,l=a.length,c=r._blockCursorElement;o===l&&(s=!0,o=l-1);let u=a[o],d=!1;if(u===c)u=a[o+1],d=!0;else if(null!==c){const n=c.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,c)&&o--}if(i=At(u),Nr(i))o=bt(i,s);else{let r=At(e);if(null===r)return null;if(Fi(r)){o=Math.min(r.getChildrenSize(),o);let e=r.getChildAtIndex(o);if(Fi(e)&&function(e,t,n){const r=e.getParent();return null===n||null===r||!r.canBeEmpty()||r!==n.getNode()}(e,0,n)){const t=s?e.getLastDescendant():e.getFirstDescendant();null===t?r=e:(e=t,r=Fi(e)?e:e.getParentOrThrow()),o=0}Nr(e)?(i=e,r=null,o=bt(e,s)):e!==r&&s&&!d&&o++}else{const n=r.getIndexWithinParent();o=0===t&&Qi(r)&&At(e)===r?n:n+1,r=r.getParentOrThrow()}if(Fi(r))return Rr(r.__key,o,"element")}}else i=At(e);return Nr(i)?Rr(i.__key,o,"text"):null}function qr(e,t,n){const r=e.offset,i=e.getNode();if(0===r){const r=i.getPreviousSibling(),o=i.getParent();if(t){if((n||!t)&&null===r&&Fi(o)&&o.isInline()){const t=o.getPreviousSibling();Nr(t)&&(e.key=t.__key,e.offset=t.getTextContent().length)}}else Fi(r)&&!n&&r.isInline()?(e.key=r.__key,e.offset=r.getChildrenSize(),e.type="element"):Nr(r)&&(e.key=r.__key,e.offset=r.getTextContent().length)}else if(r===i.getTextContent().length){const r=i.getNextSibling(),o=i.getParent();if(t&&Fi(r)&&r.isInline())e.key=r.__key,e.offset=0,e.type="element";else if((n||t)&&null===r&&Fi(o)&&o.isInline()&&!o.canInsertTextAfter()){const t=o.getNextSibling();Nr(t)&&(e.key=t.__key,e.offset=0)}}}function Jr(e,t,n){if("text"===e.type&&"text"===t.type){const r=e.isBefore(t),i=e.is(t);qr(e,r,i),qr(t,!r,i),i&&(t.key=e.key,t.offset=e.offset,t.type=e.type);const o=Ei();if(o.isComposing()&&o._compositionKey!==e.key&&Kr(n)){const r=n.anchor,i=n.focus;Ur(e,r.key,r.offset,r.type),Ur(t,i.key,i.offset,i.type)}}}function Xr(e,t,n,r,i,o){if(null===e||null===n||!$e(i,e,n))return null;const s=Wr(e,t,Kr(o)?o.anchor:null,i);if(null===s)return null;const a=Wr(n,r,Kr(o)?o.focus:null,i);if(null===a)return null;if("element"===s.type&&"element"===a.type){const t=At(e),r=At(n);if(Qi(t)&&Qi(r))return null}return Jr(s,a,o),[s,a]}function $r(e){return Fi(e)&&!e.isInline()}function ei(e,t,n,r,i,o){const s=Ci(),a=new Hr(Rr(e,t,i),Rr(n,r,o),0,"");return a.dirty=!0,s._selection=a,a}function ti(){const e=Rr("root",0,"element"),t=Rr("root",0,"element");return new Hr(e,t,0,"")}function ni(){return new Vr(new Set)}function ri(e,t){return ii(null,e,t,null)}function ii(e,t,n,r){const i=n._window;if(null===i)return null;const o=r||i.event,s=o?o.type:void 0,a="selectionchange"===s,l=!Me&&(a||"beforeinput"===s||"compositionstart"===s||"compositionend"===s||"click"===s&&o&&3===o.detail||"drop"===s||void 0===s);let c,u,d,h;if(Kr(e)&&!l)return e.clone();if(null===t)return null;if(c=t.anchorNode,u=t.focusNode,d=t.anchorOffset,h=t.focusOffset,a&&Kr(e)&&!$e(n,c,u))return e.clone();const p=Xr(c,d,u,h,n,e);if(null===p)return null;const[f,g]=p;return new Hr(f,g,Kr(e)?e.format:0,Kr(e)?e.style:"")}function oi(){return Ci()._selection}function si(){return Ei()._editorState._selection}function ai(e,t,n,r=1){const i=e.anchor,o=e.focus,s=i.getNode(),a=o.getNode();if(!t.is(s)&&!t.is(a))return;const l=t.__key;if(e.isCollapsed()){const t=i.offset;if(n<=t&&r>0||n<t&&r<0){const n=Math.max(0,t+r);i.set(l,n,"element"),o.set(l,n,"element"),li(e)}}else{const s=e.isBackward(),a=s?o:i,c=a.getNode(),u=s?i:o,d=u.getNode();if(t.is(c)){const e=a.offset;(n<=e&&r>0||n<e&&r<0)&&a.set(l,Math.max(0,e+r),"element")}if(t.is(d)){const e=u.offset;(n<=e&&r>0||n<e&&r<0)&&u.set(l,Math.max(0,e+r),"element")}}li(e)}function li(e){const t=e.anchor,n=t.offset,r=e.focus,i=r.offset,o=t.getNode(),s=r.getNode();if(e.isCollapsed()){if(!Fi(o))return;const e=o.getChildrenSize(),i=n>=e,s=i?o.getChildAtIndex(e-1):o.getChildAtIndex(n);if(Nr(s)){let e=0;i&&(e=s.getTextContentSize()),t.set(s.__key,e,"text"),r.set(s.__key,e,"text")}}else{if(Fi(o)){const e=o.getChildrenSize(),r=n>=e,i=r?o.getChildAtIndex(e-1):o.getChildAtIndex(n);if(Nr(i)){let e=0;r&&(e=i.getTextContentSize()),t.set(i.__key,e,"text")}}if(Fi(s)){const e=s.getChildrenSize(),t=i>=e,n=t?s.getChildAtIndex(e-1):s.getChildAtIndex(i);if(Nr(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,"text")}}}}function ci(e,t,n,r,i){let o=null,s=0,a=null;null!==r?(o=r.__key,Nr(r)?(s=r.getTextContentSize(),a="text"):Fi(r)&&(s=r.getChildrenSize(),a="element")):null!==i&&(o=i.__key,Nr(i)?a="text":Fi(i)&&(a="element")),null!==o&&null!==a?e.set(o,s,a):(s=t.getIndexWithinParent(),-1===s&&(s=n.getChildrenSize()),e.set(n.__key,s,"element"))}function ui(e,t,n,r,i){"text"===e.type?(e.key=n,t||(e.offset+=i)):e.offset>r.getIndexWithinParent()&&(e.offset-=1)}function di(e){let t=oi()||si();null===t&&(t=mt().selectEnd()),t.insertNodes(e)}function hi(e){let t=e;e.isCollapsed()||t.removeText();const n=oi();Kr(n)&&(t=n),Kr(t)||W(161);const r=t.anchor;let i=r.getNode(),o=r.offset;for(;!on(i);)[i,o]=pi(i,o);return o}function pi(e,t){const n=e.getParent();if(!n){const e=Wi();return mt().append(e),e.select(),[mt(),0]}if(Nr(e)){const r=e.splitText(t);if(0===r.length)return[n,e.getIndexWithinParent()];const i=0===t?0:1;return[n,r[0].getIndexWithinParent()+i]}if(!Fi(e)||0===t)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const n=new Hr(Rr(e.__key,t,"element"),Rr(e.__key,t,"element"),0,""),i=e.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}let fi=null,gi=null,mi=!1,yi=!1,vi=0;const Ai={characterData:!0,childList:!0,subtree:!0};function bi(){return mi||null!==fi&&fi._readOnly}function wi(){mi&&W(13)}function Si(){vi>99&&W(14)}function Ci(){return null===fi&&W(15),fi}function Ei(){return null===gi&&W(16),gi}function Ii(e,t,n){const r=t.__type,i=function(e,t){const n=e._nodes.get(t);return void 0===n&&W(30,t),n}(e,r);let o=n.get(r);void 0===o&&(o=Array.from(i.transforms),n.set(r,o));const s=o.length;for(let e=0;e<s&&(o[e](t),t.isAttached());e++);}function _i(e,t){return void 0!==e&&e.__key!==t&&e.isAttached()}function xi(e){return Pi(e,Ei()._nodes)}function Pi(e,t){const n=e.type,r=t.get(n);void 0===r&&W(17,n);const i=r.klass;e.type!==i.getType()&&W(18,i.name);const o=i.importJSON(e),s=e.children;if(Fi(o)&&Array.isArray(s))for(let e=0;e<s.length;e++){const n=Pi(s[e],t);o.append(n)}return o}function ki(e,t){const n=fi,r=mi,i=gi;fi=e,mi=!0,gi=null;try{return t()}finally{fi=n,mi=r,gi=i}}function Bi(e,t){const n=e._pendingEditorState,r=e._rootElement,o=e._headless||null===r;if(null===n)return;const s=e._editorState,a=s._selection,l=n._selection,c=e._dirtyType!==ce,u=fi,d=mi,h=gi,p=e._updating,f=e._observer;let g=null;if(e._pendingEditorState=null,e._editorState=n,!o&&c&&null!==f){gi=e,fi=n,mi=!1,e._updating=!0;try{const t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;f.disconnect(),g=function(e,t,n,r,i,o){vn="",wn="",An="",Sn=r===de,En=null,cn=n,ln=n._config,un=n._nodes,dn=cn._listeners.mutation,hn=i,pn=o,fn=e._nodeMap,gn=t._nodeMap,Cn=t._readOnly,mn=new Map(n._keyToDOMMap);const s=new Map;return yn=s,Fn("root",null),cn=void 0,un=void 0,hn=void 0,pn=void 0,fn=void 0,gn=void 0,ln=void 0,mn=void 0,yn=void 0,s}(s,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),yi)throw t;return no(e,null,r,n),He(e),e._dirtyType=de,yi=!0,Bi(e,s),void(yi=!1)}finally{f.observe(r,Ai),e._updating=p,fi=u,mi=d,gi=h}}n._readOnly||(n._readOnly=!0);const m=e._dirtyLeaves,y=e._dirtyElements,v=e._normalizedNodes,A=e._updateTags,b=e._deferred;c&&(e._dirtyType=ce,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),function(e,t){const n=e._decorators;let r=e._pendingDecorators||n;const i=t._nodeMap;let o;for(o in r)i.has(o)||(r===n&&(r=ft(e)),delete r[o])}(e,n);const w=o?null:Xt(e._window);if(e._editable&&null!==w&&(c||null===l||l.dirty)){gi=e,fi=n;try{if(null!==f&&f.disconnect(),c||null===l||l.dirty){const t=e._blockCursorElement;null!==t&&Jt(t,e,r),function(e,t,n,r,i,o,s){const a=r.anchorNode,l=r.focusNode,c=r.anchorOffset,u=r.focusOffset,d=document.activeElement;if(i.has("collaboration")&&d!==o||null!==d&&Xe(d))return;if(!Kr(t))return void(null!==e&&$e(n,a,l)&&r.removeAllRanges());const h=t.anchor,p=t.focus,f=h.key,g=p.key,m=Kt(n,f),y=Kt(n,g),v=h.offset,A=p.offset,b=t.format,w=t.style,S=t.isCollapsed();let C=m,E=y,I=!1;if("text"===h.type){C=rt(m);const e=h.getNode();I=e.getFormat()!==b||e.getStyle()!==w}else Kr(e)&&"text"===e.anchor.type&&(I=!0);var _,x,P,k,B;if("text"===p.type&&(E=rt(y)),null!==C&&null!==E&&(S&&(null===e||I||Kr(e)&&(e.format!==b||e.style!==w))&&(_=b,x=w,P=v,k=f,B=performance.now(),Xn=[_,x,P,k,B]),c!==v||u!==A||a!==C||l!==E||"Range"===r.type&&S||(null!==d&&o.contains(d)||o.focus({preventScroll:!0}),"element"===h.type))){try{r.setBaseAndExtent(C,v,E,A)}catch(e){}if(!i.has("skip-scroll-into-view")&&t.isCollapsed()&&null!==o&&o===document.activeElement){const e=t instanceof Hr&&"element"===t.anchor.type?C.childNodes[v]||null:r.rangeCount>0?r.getRangeAt(0):null;if(null!==e){let t;if(e instanceof Text){const n=document.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();!function(e,t,n){const r=n.ownerDocument,i=r.defaultView;if(null===i)return;let{top:o,bottom:s}=t,a=0,l=0,c=n;for(;null!==c;){const t=c===r.body;if(t)a=0,l=Yt(e).innerHeight;else{const e=c.getBoundingClientRect();a=e.top,l=e.bottom}let n=0;if(o<a?n=-(a-o):s>l&&(n=s-l),0!==n)if(t)i.scrollBy(0,n);else{const e=c.scrollTop;c.scrollTop+=n;const t=c.scrollTop-e;o-=t,s-=t}if(t)break;c=Ht(c)}}(n,t,o)}}Zn=!0}}(a,l,e,w,A,r)}(function(e,t,n){let r=e._blockCursorElement;if(Kr(n)&&n.isCollapsed()&&"element"===n.anchor.type&&t.contains(document.activeElement)){const i=n.anchor,o=i.getNode(),s=i.offset;let a=!1,l=null;if(s===o.getChildrenSize())qt(o.getChildAtIndex(s-1))&&(a=!0);else{const t=o.getChildAtIndex(s);if(qt(t)){const n=t.getPreviousSibling();(null===n||qt(n))&&(a=!0,l=e.getElementByKey(t.__key))}}if(a){const n=e.getElementByKey(o.__key);return null===r&&(e._blockCursorElement=r=function(e){const t=e.theme,n=document.createElement("div");n.contentEditable="false",n.setAttribute("data-lexical-cursor","true");let r=t.blockCursor;if(void 0!==r){if("string"==typeof r){const e=je(r);r=t.blockCursor=e}void 0!==r&&n.classList.add(...r)}return n}(e._config)),t.style.caretColor="transparent",void(null===l?n.appendChild(r):n.insertBefore(r,l))}}null!==r&&Jt(r,e,t)})(e,r,l),null!==f&&f.observe(r,Ai)}finally{gi=h,fi=u}}null!==g&&function(e,t,n,r,i){const o=Array.from(e._listeners.mutation),s=o.length;for(let e=0;e<s;e++){const[s,a]=o[e],l=t.get(a);void 0!==l&&s(l,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}(e,g,A,m,s),Kr(l)||null===l||null!==a&&a.is(l)||e.dispatchCommand(i,void 0);const S=e._pendingDecorators;null!==S&&(e._decorators=S,e._pendingDecorators=null,Oi("decorator",e,!0,S)),function(e,t,n){const r=gt(t),i=gt(n);r!==i&&Oi("textcontent",e,!0,i)}(e,t||s,n),Oi("update",e,!0,{dirtyElements:y,dirtyLeaves:m,editorState:n,normalizedNodes:v,prevEditorState:t||s,tags:A}),function(e,t){if(e._deferred=[],0!==t.length){const n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}(e,b),function(e){const t=e._updates;if(0!==t.length){const n=t.shift();if(n){const[t,r]=n;ji(e,t,r)}}}(e)}function Oi(e,t,n,...r){const i=t._updating;t._updating=n;try{const n=Array.from(t._listeners[e]);for(let e=0;e<n.length;e++)n[e].apply(null,r)}finally{t._updating=i}}function Ni(e,t,n){if(!1===e._updating||gi!==e){let r=!1;return e.update((()=>{r=Ni(e,t,n)})),r}const r=St(e);for(let i=4;i>=0;i--)for(let o=0;o<r.length;o++){const s=r[o]._commands.get(t);if(void 0!==s){const t=s[i];if(void 0!==t){const r=Array.from(t),i=r.length;for(let t=0;t<i;t++)if(!0===r[t](n,e))return!0}}}return!1}function Di(e,t){const n=e._updates;let r=t||!1;for(;0!==n.length;){const t=n.shift();if(t){const[n,i]=t;let o,s;void 0!==i&&(o=i.onUpdate,s=i.tag,i.skipTransforms&&(r=!0),o&&e._deferred.push(o),s&&e._updateTags.add(s)),n()}}return r}function ji(e,t,n){const r=e._updateTags;let i,o,s=!1,a=!1;void 0!==n&&(i=n.onUpdate,o=n.tag,null!=o&&r.add(o),s=n.skipTransforms||!1,a=n.discrete||!1),i&&e._deferred.push(i);const l=e._editorState;let c=e._pendingEditorState,u=!1;(null===c||c._readOnly)&&(c=e._pendingEditorState=new Gi(new Map((c||l)._nodeMap)),u=!0),c._flushSync=a;const d=fi,h=mi,p=gi,f=e._updating;fi=c,mi=!1,e._updating=!0,gi=e;try{u&&(e._headless?null!==l._selection&&(c._selection=l._selection.clone()):c._selection=function(e){const t=e.getEditorState()._selection,n=Xt(e._window);return Kr(t)||null==t?ii(t,n,e,null):t.clone()}(e));const n=e._compositionKey;t(),s=Di(e,s),function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(Kr(r)){const e=r.anchor,t=r.focus;let i;if("text"===e.type&&(i=e.getNode(),i.selectionTransform(n,r)),"text"===t.type){const e=t.getNode();i!==e&&e.selectionTransform(n,r)}}}(c,e),e._dirtyType!==ce&&(s?function(e,t){const n=t._dirtyLeaves,r=e._nodeMap;for(const e of n){const t=r.get(e);Nr(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&ze(t)}}(c,e):function(e,t){const n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,o=ut(),s=new Map;let a=n,l=a.size,c=r,u=c.size;for(;l>0||u>0;){if(l>0){t._dirtyLeaves=new Set;for(const e of a){const r=i.get(e);Nr(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&ze(r),void 0!==r&&_i(r,o)&&Ii(t,r,s),n.add(e)}if(a=t._dirtyLeaves,l=a.size,l>0){vi++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map;for(const e of c){const n=e[0],a=e[1];if("root"!==n&&!a)continue;const l=i.get(n);void 0!==l&&_i(l,o)&&Ii(t,l,s),r.set(n,a)}a=t._dirtyLeaves,l=a.size,c=t._dirtyElements,u=c.size,vi++}t._dirtyLeaves=n,t._dirtyElements=r}(c,e),Di(e),function(e,t,n,r){const i=e._nodeMap,o=t._nodeMap,s=[];for(const[e]of r){const t=o.get(e);void 0!==t&&(t.isAttached()||(Fi(t)&&an(t,e,i,o,s,r),i.has(e)||r.delete(e),s.push(e)))}for(const e of s)o.delete(e);for(const e of n){const t=o.get(e);void 0===t||t.isAttached()||(i.has(e)||n.delete(e),o.delete(e))}}(l,c,e._dirtyLeaves,e._dirtyElements)),n!==e._compositionKey&&(c._flushSync=!0);const r=c._selection;if(Kr(r)){const e=c._nodeMap,t=r.anchor.key,n=r.focus.key;void 0!==e.get(t)&&void 0!==e.get(n)||W(19)}else Gr(r)&&0===r._nodes.size&&(c._selection=null)}catch(t){return t instanceof Error&&e._onError(t),e._pendingEditorState=l,e._dirtyType=de,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void Bi(e)}finally{fi=d,mi=h,gi=p,e._updating=f,vi=0}const g=e._dirtyType!==ce||function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(null!==r){if(r.dirty||!r.is(n))return!0}else if(null!==n)return!0;return!1}(c,e);g?c._flushSync?(c._flushSync=!1,Bi(e)):u&&Je((()=>{Bi(e)})):(c._flushSync=!1,u&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function Ti(e,t,n){e._updating?e._updates.push([t,n]):ji(e,t,n)}class Mi extends ur{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__indent=0,this.__dir=null}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return Oe[e]||""}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()}isDirty(){const e=Ei()._dirtyElements;return null!==e&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return null!==t&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;null!==t;){if(Nr(t)&&e.push(t),Fi(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;Fi(e);){const t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;Fi(e);){const t=e.getLastChild();if(null===t)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),n=t.length;if(e>=n){const e=t[n-1];return Fi(e)&&e.getLastDescendant()||e||null}const r=t[e];return Fi(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const e=this.getLatest().__first;return null===e?null:dt(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return null===e&&W(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return null===e?null:dt(e)}getLastChildOrThrow(){const e=this.getLastChild();return null===e&&W(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;null!==n&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;null!==n&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e="";const t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){const i=t[r];e+=i.getTextContent(),Fi(i)&&r!==n-1&&!i.isInline()&&(e+=Se)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){const i=t[r];e+=i.getTextContentSize(),Fi(i)&&r!==n-1&&!i.isInline()&&(e+=Se.length)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(""!==e){const t=Be[e];return!!(this.getFormat()&t)}return!1}select(e,t){wi();const n=oi();let r=e,i=t;const o=this.getChildrenSize();if(!this.canBeEmpty())if(0===e&&0===t){const e=this.getFirstChild();if(Nr(e)||Fi(e))return e.select(0,0)}else if(!(void 0!==e&&e!==o||void 0!==t&&t!==o)){const e=this.getLastChild();if(Nr(e)||Fi(e))return e.select()}void 0===r&&(r=o),void 0===i&&(i=o);const s=this.__key;return Kr(n)?(n.anchor.set(s,r,"element"),n.focus.set(s,i,"element"),n.dirty=!0,n):ei(s,r,s,i,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach((e=>e.remove())),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=""!==e?Be[e]:0,this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){const r=n.length,i=this.getChildrenSize(),o=this.getWritable(),s=o.__key,a=[],l=[],c=this.getChildAtIndex(e+t);let u=null,d=i-t+r;if(0!==e)if(e===i)u=this.getLastChild();else{const t=this.getChildAtIndex(e);null!==t&&(u=t.getPreviousSibling())}if(t>0){let e=null===u?this.getFirstChild():u.getNextSibling();for(let n=0;n<t;n++){null===e&&W(100);const t=e.getNextSibling(),n=e.__key;at(e.getWritable()),l.push(n),e=t}}let h=u;for(let e=0;e<r;e++){const t=n[e];null!==h&&t.is(h)&&(u=h=h.getPreviousSibling());const r=t.getWritable();r.__parent===s&&d--,at(r);const i=t.__key;if(null===h)o.__first=i,r.__prev=null;else{const e=h.getWritable();e.__next=i,r.__prev=e.__key}t.__key===s&&W(76),r.__parent=s,a.push(i),h=t}if(e+t===i)null!==h&&(h.getWritable().__next=null,o.__last=h.__key);else if(null!==c){const e=c.getWritable();if(null!==h){const t=h.getWritable();e.__prev=h.__key,t.__next=c.__key}else e.__prev=null}if(o.__size=d,l.length){const e=oi();if(Kr(e)){const t=new Set(l),n=new Set(a),{anchor:r,focus:i}=e;Ri(r,t,n)&&ci(r,r.getNode(),this,u,c),Ri(i,t,n)&&ci(i,i.getNode(),this,u,c),0!==d||this.canBeEmpty()||zt(this)||this.remove()}}return o}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}}function Fi(e){return e instanceof Mi}function Ri(e,t,n){let r=e.getNode();for(;r;){const e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}class Li extends ur{constructor(e){super(e)}decorate(e,t){W(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Qi(e){return e instanceof Li}class Ui extends Mi{static getType(){return"root"}static clone(){return new Ui}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){W(51)}getTextContent(){const e=this.__cachedText;return!bi()&&Ei()._dirtyType!==ce||null===e?super.getTextContent():e}remove(){W(52)}replace(e){W(53)}insertBefore(e){W(54)}insertAfter(e){W(55)}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const n=e[t];Fi(n)||Qi(n)||W(56)}return super.append(...e)}static importJSON(e){const t=mt();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function Vi(e){return e instanceof Ui}function Ki(){return new Gi(new Map([["root",new Ui]]))}function Hi(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&W(130,n.name),Fi(e)){const r=t.children;Array.isArray(r)||W(59,n.name);const i=e.getChildren();for(let e=0;e<i.length;e++){const t=Hi(i[e]);r.push(t)}}return t}class Gi{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return 1===this._nodeMap.size&&null===this._selection}read(e){return ki(this,e)}clone(e){const t=new Gi(this._nodeMap,void 0===e?this._selection:e);return t._readOnly=!0,t}toJSON(){return ki(this,(()=>({root:Hi(mt())})))}}class Yi extends Mi{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class zi extends Mi{constructor(e){super(e),this.__textFormat=0}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=Pe[e];return!!(this.getTextFormat()&t)}static clone(e){return new zi(e.__key)}createDOM(e){const t=document.createElement("p"),n=Tt(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:Zi,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&tn(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n);const r=this.getIndent();r>0&&(t.style.textIndent=20*r+"px")}return{element:t}}static importJSON(e){const t=Wi();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),type:"paragraph",version:1}}insertNewAfter(e,t){const n=Wi();n.setTextFormat(e.format);const r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),this.insertAfter(n,t),n}collapseAtStart(){const e=this.getChildren();if(0===e.length||Nr(e[0])&&""===e[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function Zi(e){const t=Wi();if(e.style){t.setFormat(e.style.textAlign);const n=parseInt(e.style.textIndent,10)/20;n>0&&t.setIndent(n)}return{node:t}}function Wi(){return Zt(new zi)}function qi(e){return e instanceof zi}const Ji=0,Xi=1,$i=2,eo=3,to=4;function no(e,t,n,r){const i=e._keyToDOMMap;i.clear(),e._editorState=Ki(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=ce,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;const o=e._observer;null!==o&&(o.disconnect(),e._observer=null),null!==t&&(t.textContent=""),null!==n&&(n.textContent="",i.set("root",n))}function ro(e){const t=e||{},n=gi,r=t.theme||{},i=void 0===e?n:t.parentEditor||null,o=t.disableEvents||!1,s=Ki(),a=t.namespace||(null!==i?i._config.namespace:Ct()),l=t.editorState,c=[Ui,Sr,dr,jr,zi,Yi,...t.nodes||[]],{onError:u,html:d}=t,h=void 0===t.editable||t.editable;let p;if(void 0===e&&null!==n)p=n._nodes;else{p=new Map;for(let e=0;e<c.length;e++){let t=c[e],n=null,r=null;if("function"!=typeof t){const e=t;t=e.replace,n=e.with,r=e.withKlass||null}const i=t.getType(),o=t.transform(),s=new Set;null!==o&&s.add(o),p.set(i,{exportDOM:d&&d.export?d.export.get(t):void 0,klass:t,replace:n,replaceWithKlass:r,transforms:s})}}const f=new io(s,i,p,{disableEvents:o,namespace:a,theme:r},u||console.error,function(e,t){const n=new Map,r=new Set,i=e=>{Object.keys(e).forEach((t=>{let r=n.get(t);void 0===r&&(r=[],n.set(t,r)),r.push(e[t])}))};return e.forEach((e=>{const t=e.klass.importDOM;if(null==t||r.has(t))return;r.add(t);const n=t.call(e.klass);null!==n&&i(n)})),t&&i(t),n}(p,d?d.import:void 0),h);return void 0!==l&&(f._pendingEditorState=l,f._dirtyType=de),f}class io{constructor(e,t,n,r,i,o,s){this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=ce,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Ct(),this._onError=i,this._htmlConversions=o,this._editable=s,this._headless=null!==t&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,n){void 0===n&&W(35);const r=this._commands;r.has(e)||r.set(e,[new Set,new Set,new Set,new Set,new Set]);const i=r.get(e);void 0===i&&W(36,String(e));const o=i[n];return o.add(t),()=>{o.delete(t),i.every((e=>0===e.size))&&r.delete(e)}}registerMutationListener(e,t){let n=this._nodes.get(e.getType());void 0===n&&W(37,e.name);let r=e,i=null;for(;i=n.replaceWithKlass;)r=i,n=this._nodes.get(i.getType()),void 0===n&&W(37,i.name);const o=this._listeners.mutation;return o.set(t,r),()=>{o.delete(t)}}registerNodeTransformToKlass(e,t){const n=e.getType(),r=this._nodes.get(n);return void 0===r&&W(37,e.name),r.transforms.add(t),r}registerNodeTransform(e,t){const n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(null!=i){const e=this.registerNodeTransformToKlass(i,t);r.push(e)}var o;return o=e.getType(),Ti(this,(()=>{const e=Ci();if(e.isEmpty())return;if("root"===o)return void mt().markDirty();const t=e._nodeMap;for(const[,e]of t)e.markDirty()}),null===this._pendingEditorState?{tag:"history-merge"}:void 0),()=>{r.forEach((e=>e.transforms.delete(t)))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return Ut(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const n=Tt(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,no(this,t,e,r),null!==t&&(this._config.disableEvents||function(e){const t=e.ownerDocument,n=zn.get(t);void 0===n&&W(162);const r=n-1;r>=0||W(164),zn.set(t,r),0===r&&t.removeEventListener("selectionchange",sr);const i=e.__lexicalEditor;null!=i&&(function(e){if(null!==e._parentEditor){const t=St(e),n=t[t.length-1]._key;or.get(n)===e&&or.delete(n)}else or.delete(e._key)}(i),e.__lexicalEditor=null);const o=ir(e);for(let e=0;e<o.length;e++)o[e]();e.__lexicalEventHandles=[]}(t),null!=n&&t.classList.remove(...n)),null!==e){const t=function(e){const t=e.ownerDocument;return t&&t.defaultView||null}(e),r=e.style;r.userSelect="text",r.whiteSpace="pre-wrap",r.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=t,this._dirtyType=de,He(this),this._updateTags.add("history-merge"),Bi(this),this._config.disableEvents||function(e,t){const n=e.ownerDocument,r=zn.get(n);(void 0===r||r<1)&&n.addEventListener("selectionchange",sr),zn.set(n,(r||0)+1),e.__lexicalEditor=t;const i=ir(e);for(let n=0;n<Vn.length;n++){const[r,o]=Vn[n],s="function"==typeof o?e=>{lr(e)||(ar(e),(t.isEditable()||"click"===r)&&o(e,t))}:e=>{if(lr(e))return;ar(e);const n=t.isEditable();switch(r){case"cut":return n&&Ut(t,Q,e);case"copy":return Ut(t,L,e);case"paste":return n&&Ut(t,d,e);case"dragstart":return n&&Ut(t,M,e);case"dragover":return n&&Ut(t,F,e);case"dragend":return n&&Ut(t,R,e);case"focus":return n&&Ut(t,Y,e);case"blur":return n&&Ut(t,z,e);case"drop":return n&&Ut(t,j,e)}};e.addEventListener(r,s),i.push((()=>{e.removeEventListener(r,s)}))}}(e,this),null!=n&&e.classList.add(...n)}else this._editorState=r,this._pendingEditorState=null,this._window=null;Oi("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&W(38),Ke(this);const n=this._pendingEditorState,r=this._updateTags,i=void 0!==t?t.tag:null;null===n||n.isEmpty()||(null!=i&&r.add(i),Bi(this)),this._pendingEditorState=e,this._dirtyType=de,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=i&&r.add(i),Bi(this)}parseEditorState(e,t){return function(e,t,n){const r=Ki(),i=fi,o=mi,s=gi,a=t._dirtyElements,l=t._dirtyLeaves,c=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,fi=r,mi=!1,gi=t;try{const i=t._nodes;Pi(e.root,i),n&&n(),r._readOnly=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=a,t._dirtyLeaves=l,t._cloneNotNeeded=c,t._dirtyType=u,fi=i,mi=o,gi=s}return r}("string"==typeof e?JSON.parse(e):e,this,t)}update(e,t){Ti(this,e,t)}focus(e,t={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),Ti(this,(()=>{const e=oi(),n=mt();null!==e?e.dirty=!0:0!==n.getChildrenSize()&&("rootStart"===t.defaultSelection?n.selectStart():n.selectEnd())}),{onUpdate:()=>{n.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;null!==e&&e.blur();const t=Xt(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Oi("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}}},o={};function s(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={id:e,loaded:!1,exports:{}};return i[e].call(n.exports,n,n.exports,s),n.loaded=!0,n.exports}s.m=i,s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,s.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var i=Object.create(null);s.r(i);var o={};e=e||[null,t({}),t([]),t(t)];for(var a=2&r&&n;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((e=>o[e]=()=>n[e]));return o.default=()=>n,s.d(i,o),i},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,n)=>(s.f[n](e,t),t)),[])),s.u=e=>"./"+e+".app.js",s.miniCssF=e=>{},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},r="@standardnotes/web:",s.l=(e,t,i,o)=>{if(n[e])n[e].push(t);else{var a,l;if(void 0!==i)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var d=c[u];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==r+i){a=d;break}}a||(l=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,s.nc&&a.setAttribute("nonce",s.nc),a.setAttribute("data-webpack",r+i),a.src=e),n[e]=[t];var h=(t,r)=>{a.onerror=a.onload=null,clearTimeout(p);var i=n[e];if(delete n[e],a.parentNode&&a.parentNode.removeChild(a),i&&i.forEach((e=>e(r))),t)return t(r)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),l&&document.head.appendChild(a)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;s.g.importScripts&&(e=s.g.location+"");var t=s.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&!e;)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e})(),(()=>{s.b=document.baseURI||self.location.href;var e={179:0};s.f.j=(t,n)=>{var r=s.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var i=new Promise(((n,i)=>r=e[t]=[n,i]));n.push(r[2]=i);var o=s.p+s.u(t),a=new Error;s.l(o,(n=>{if(s.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var i=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+i+": "+o+")",a.name="ChunkLoadError",a.type=i,a.request=o,r[1](a)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,i,[o,a,l]=n,c=0;if(o.some((t=>0!==e[t]))){for(r in a)s.o(a,r)&&(s.m[r]=a[r]);l&&l(s)}for(t&&t(n);c<o.length;c++)i=o[c],s.o(e,i)&&e[i]&&e[i][0](),e[i]=0},n=self.webpackChunk_standardnotes_web=self.webpackChunk_standardnotes_web||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),(()=>{"use strict";var e=s(52322),t=s(24118),n=s(91583),r=s(29894),i=s(98418),o=s(39925),a=s(48834);const l={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let c;const u=new Uint8Array(16);function d(){if(!c&&(c="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!c))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return c(u)}const h=[];for(let e=0;e<256;++e)h.push((e+256).toString(16).slice(1));const p=function(e,t,n){if(l.randomUUID&&!t&&!e)return l.randomUUID();const r=(e=e||{}).random||(e.rng||d)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(h[e[t+0]]+h[e[t+1]]+h[e[t+2]]+h[e[t+3]]+"-"+h[e[t+4]]+h[e[t+5]]+"-"+h[e[t+6]]+h[e[t+7]]+"-"+h[e[t+8]]+h[e[t+9]]+"-"+h[e[t+10]]+h[e[t+11]]+h[e[t+12]]+h[e[t+13]]+h[e[t+14]]+h[e[t+15]]).toLowerCase()}(r)},f=o.base64_variants.ORIGINAL;function g(){return window}function m(){if(!g().crypto)throw Error("Could not obtain SubtleCrypto instance");return g().crypto.subtle}function y(e){return(0,o.from_string)(e)}function v(e){return(0,o.to_hex)(a.lW.from(e))}function A(e){return(0,o.from_hex)(e)}function b(e){return(0,o.from_base64)(e,f)}function w(e){return(0,o.to_base64)(a.lW.from(e),f)}const S="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var C,E;!function(e){e.AesCbc="AES-CBC",e.Sha512="SHA-512",e.Sha256="SHA-256",e.Pbkdf2="PBKDF2",e.Sha1="SHA-1",e.Hmac="HMAC"}(C||(C={})),function(e){e.DeriveBits="deriveBits",e.Encrypt="encrypt",e.Decrypt="decrypt",e.Sign="sign"}(E||(E={}));const I=new class{constructor(){this.ready=o.ready}async initialize(){await this.ready}deinit(){this.ready=null}generateUUID(){return p()}timingSafeEqual(e,t){return(0,i.timingSafeEqual)(e,t)}base64Encode(e){return function(e){return(0,o.to_base64)(e,f)}(e)}base64URLEncode(e){return function(e){return(0,o.to_base64)(e,o.base64_variants.URLSAFE_NO_PADDING)}(e)}base64Decode(e){return function(e){return(0,o.to_string)((0,o.from_base64)(e,f))}(e)}async pbkdf2(e,t,n,r){const i=y(e),o=await this.webCryptoImportKey(i,C.Pbkdf2,[E.DeriveBits]);return o?this.webCryptoDeriveBits(o,t,n,r):(console.error("Key is null, unable to continue"),null)}generateRandomKey(e){const t=e/8;return v(g().crypto.getRandomValues(new Uint8Array(t)))}async aes256CbcEncrypt(e,t,n){const r=A(n),i=A(t),o={name:C.AesCbc,iv:i},s=await this.webCryptoImportKey(r,o.name,[E.Encrypt]),a=y(e);return w(await crypto.subtle.encrypt(o,s,a))}async aes256CbcDecrypt(e,t,n){const r=A(n),i=A(t),s={name:C.AesCbc,iv:i},a=await this.webCryptoImportKey(r,s.name,[E.Decrypt]),l=b(e);try{return c=await crypto.subtle.decrypt(s,a,l),(0,o.to_string)(c)}catch{return null}var c}async hmac256(e,t){const n=A(t),r=await this.webCryptoImportKey(n,C.Hmac,[E.Sign],{name:C.Sha256}),i=y(e),o={name:C.Hmac};try{return v(await crypto.subtle.sign(o,r,i))}catch(e){return console.error("Error computing HMAC:",e),null}}async sha256(e){const t=y(e);return v(await crypto.subtle.digest(C.Sha256,t))}async hmac1(e,t){const n=A(t),r=await this.webCryptoImportKey(n,C.Hmac,[E.Sign],{name:C.Sha1}),i=y(e),o={name:C.Hmac};try{return v(await crypto.subtle.sign(o,r,i))}catch(e){return console.error("Error computing HMAC:",e),null}}async unsafeSha1(e){const t=y(e);return v(await crypto.subtle.digest(C.Sha1,t))}async webCryptoImportKey(e,t,n,r){return m().importKey("raw",e,{name:t,hash:r},!1,n)}async webCryptoDeriveBits(e,t,n,r){const i={name:C.Pbkdf2,salt:y(t),iterations:n,hash:{name:C.Sha512}};return m().deriveBits(i,e,r).then((e=>v(new Uint8Array(e))))}argon2(e,t,n,r,i){return o.crypto_pwhash(i,y(e),A(t),n,r,o.crypto_pwhash_ALG_DEFAULT,"hex")}xchacha20Encrypt(e,t,n,r){if(48!==t.length)throw Error("Nonce must be 24 bytes");return w(o.crypto_aead_xchacha20poly1305_ietf_encrypt(e,r||null,null,A(t),A(n)))}xchacha20Decrypt(e,t,n,r){if(48!==t.length)throw Error("Nonce must be 24 bytes");try{return o.crypto_aead_xchacha20poly1305_ietf_decrypt(null,b(e),r||null,A(t),A(n),"text")}catch{return null}}xchacha20StreamInitEncryptor(e){const t=o.crypto_secretstream_xchacha20poly1305_init_push(A(e));return{state:t.state,header:w(t.header)}}xchacha20StreamEncryptorPush(e,t,n,r=i.SodiumTag.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PUSH){return o.crypto_secretstream_xchacha20poly1305_push(e.state,t,n&&n.length>0?y(n):null,r)}xchacha20StreamInitDecryptor(e,t){const n=b(e);if(n.length!==i.SodiumConstant.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES)throw new Error(`Header must be ${i.SodiumConstant.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES} bytes long`);return{state:o.crypto_secretstream_xchacha20poly1305_init_pull(n,A(t))}}xchacha20StreamDecryptorPush(e,t,n){if(t.length<i.SodiumConstant.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES)throw new Error("Invalid ciphertext size");const r=o.crypto_secretstream_xchacha20poly1305_pull(e.state,t,n&&n.length>0?y(n):null);return!1!==r&&r}sodiumCryptoBoxEasyEncrypt(e,t,n,r){return w(o.crypto_box_easy(e,A(t),A(n),A(r)))}sodiumCryptoBoxEasyDecrypt(e,t,n,r){return o.crypto_box_open_easy(b(e),A(t),A(n),A(r),"text")}sodiumCryptoBoxSeedKeypair(e){const t=o.crypto_box_seed_keypair(A(e));return{publicKey:v(t.publicKey),privateKey:v(t.privateKey)}}sodiumCryptoSignSeedKeypair(e){const t=o.crypto_sign_seed_keypair(A(e));return{publicKey:v(t.publicKey),privateKey:v(t.privateKey)}}sodiumCryptoSign(e,t){return w(o.crypto_sign_detached(e,A(t)))}sodiumCryptoSignVerify(e,t,n){return o.crypto_sign_verify_detached(b(t),e,A(n))}sodiumCryptoKdfDeriveFromKey(e,t,n,r){if(8!==r.length)throw new Error("Context must be 8 bytes");return v(o.crypto_kdf_derive_from_key(n,t,r,A(e)))}sodiumCryptoGenericHash(e,t){return v(o.crypto_generichash(o.crypto_generichash_BYTES,e,t?A(t):null))}async generateOtpSecret(){const e=function(e){const t=e.byteLength,n=new Uint8Array(e);let r=0,i=0,o="";for(let e=0;e<t;e++)for(i=i<<8|n[e],r+=8;r>=5;)o+=S[i>>>r-5&31],r-=5;for(r>0&&(o+=S[i<<5-r&31]);o.length%8>0;)o+="=";return o}(g().crypto.getRandomValues(new Uint8Array(20)));return e}async hotpToken(e,t,n=6){const r=new Uint8Array(function(e){const t=e.toUpperCase().replace(/=+$/,"");for(let e=0;e<t.length;e++)if(!S.includes(t[e]))throw new Error(`Invalid RFC4648 char ${t[e]} at index ${e}`);const n=new Uint8Array(5*t.length/8|0);let r=0,i=0,o=0;for(let e=0;e<t.length;e++)o=o<<5|S.indexOf(t[e]),i+=5,i>=8&&(n[r++]=o>>>i-8&255,i-=8);return n.buffer}(e)),i=await this.webCryptoImportKey(r,C.Hmac,[E.Sign],{name:C.Sha1}),o=function(e){const t=new ArrayBuffer(8),n=new DataView(t),r=("0".repeat(64)+e.toString(2)).slice(-64);for(let e=0;e<64;e+=8){const t=parseInt(r.slice(e,e+8),2);n.setUint8(e/8,t)}return t}(t),s=function(e){const t=new Uint8Array(e),n=15&t[19],r=((127&t[n])<<24|t[n+1]<<16|t[n+2]<<8|t[n+3]).toString(2);return parseInt(r,2)}(await m().sign("HMAC",i,o));return("0".repeat(n)+s%10**n).slice(-n)}async totpToken(e,t,n=6,r=30){const i=Math.floor(t/r/1e3);return await this.hotpToken(e,i,n)}};var _=s(80075);function x(e){const t=new Uint8Array(e);let n="";for(const e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function P(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=(4-t.length%4)%4,r=t.padEnd(t.length+n,"="),i=atob(r),o=new ArrayBuffer(i.length),s=new Uint8Array(o);for(let e=0;e<i.length;e++)s[e]=i.charCodeAt(e);return o}function k(){return void 0!==window?.PublicKeyCredential&&"function"==typeof window.PublicKeyCredential}function B(e){const{id:t}=e;return{...e,id:P(t),transports:e.transports}}function O(e){return"localhost"===e||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}class N extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),this.name=r??n.name,this.code=t}}const D=new class{createNewAbortSignal(){if(this.controller){const e=new Error("Cancelling existing WebAuthn API call for new one");e.name="AbortError",this.controller.abort(e)}const e=new AbortController;return this.controller=e,e.signal}},j=["cross-platform","platform"];function T(e){if(e&&!(j.indexOf(e)<0))return e}async function M(e){if(!k())throw new Error("WebAuthn is not supported in this browser");var t;const n={publicKey:{...e,challenge:P(e.challenge),user:{...e.user,id:(t=e.user.id,(new TextEncoder).encode(t))},excludeCredentials:e.excludeCredentials?.map(B)}};let r;n.signal=D.createNewAbortSignal();try{r=await navigator.credentials.create(n)}catch(e){throw function({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new N({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if("ConstraintError"===e.name){if(!0===n.authenticatorSelection?.requireResidentKey)return new N({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if("required"===n.authenticatorSelection?.userVerification)return new N({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if("InvalidStateError"===e.name)return new N({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if("NotAllowedError"===e.name)return new N({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if("NotSupportedError"===e.name)return 0===n.pubKeyCredParams.filter((e=>"public-key"===e.type)).length?new N({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new N({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if("SecurityError"===e.name){const t=window.location.hostname;if(!O(t))return new N({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(n.rp.id!==t)return new N({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if("TypeError"===e.name){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new N({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if("UnknownError"===e.name)return new N({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return e}({error:e,options:n})}if(!r)throw new Error("Registration was not completed");const{id:i,rawId:o,response:s,type:a}=r;let l,c,u,d;if("function"==typeof s.getTransports&&(l=s.getTransports()),"function"==typeof s.getPublicKeyAlgorithm&&(c=s.getPublicKeyAlgorithm()),"function"==typeof s.getPublicKey){const e=s.getPublicKey();null!==e&&(u=x(e))}return"function"==typeof s.getAuthenticatorData&&(d=x(s.getAuthenticatorData())),{id:i,rawId:x(o),response:{attestationObject:x(s.attestationObject),clientDataJSON:x(s.clientDataJSON),transports:l,publicKeyAlgorithm:c,publicKey:u,authenticatorData:d},type:a,clientExtensionResults:r.getClientExtensionResults(),authenticatorAttachment:T(r.authenticatorAttachment)}}async function F(e,t=!1){if(!k())throw new Error("WebAuthn is not supported in this browser");let n;0!==e.allowCredentials?.length&&(n=e.allowCredentials?.map(B));const r={...e,challenge:P(e.challenge),allowCredentials:n},i={};if(t){if(!await function(){const e=window.PublicKeyCredential;return void 0===e.isConditionalMediationAvailable?new Promise((e=>e(!1))):e.isConditionalMediationAvailable()}())throw Error("Browser does not support WebAuthn autofill");if(document.querySelectorAll("input[autocomplete*='webauthn']").length<1)throw Error('No <input> with `"webauthn"` in its `autocomplete` attribute was detected');i.mediation="conditional",r.allowCredentials=[]}let o;i.publicKey=r,i.signal=D.createNewAbortSignal();try{o=await navigator.credentials.get(i)}catch(e){throw function({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new N({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if("NotAllowedError"===e.name)return new N({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if("SecurityError"===e.name){const t=window.location.hostname;if(!O(t))return new N({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(n.rpId!==t)return new N({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if("UnknownError"===e.name)return new N({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return e}({error:e,options:i})}if(!o)throw new Error("Authentication was not completed");const{id:s,rawId:a,response:l,type:c}=o;let u;var d;return l.userHandle&&(d=l.userHandle,u=new TextDecoder("utf-8").decode(d)),{id:s,rawId:x(a),response:{authenticatorData:x(l.authenticatorData),clientDataJSON:x(l.clientDataJSON),signature:x(l.signature),userHandle:u},type:c,clientExtensionResults:o.getClientExtensionResults(),authenticatorAttachment:T(o.authenticatorAttachment)}}var R,L=s(84075),Q=s(87901);!function(e){e[e.DailyNotes=0]="DailyNotes",e[e.NoteView=1]="NoteView",e[e.ItemsList=2]="ItemsList",e[e.NavigationList=3]="NavigationList",e[e.Viewport=4]="Viewport",e[e.Selection=5]="Selection",e[e.BlockEditor=6]="BlockEditor",e[e.Purchasing=7]="Purchasing",e[e.Panes=8]="Panes",e[e.U2F=9]="U2F"}(R||(R={}));const U={[R.DailyNotes]:!1,[R.NoteView]:!1,[R.ItemsList]:!1,[R.NavigationList]:!1,[R.Viewport]:!1,[R.Selection]:!1,[R.BlockEditor]:!1,[R.Purchasing]:!1,[R.Panes]:!1,[R.U2F]:!1};function V(e){if(t.r8&&U[e]){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(0,Q.log)(R[e],...r)}}const K=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r="".concat(e).concat(t);V(R.Viewport,"setCustomViewportHeight: ".concat(r)),document.documentElement.style.setProperty("--ios-viewport-height",r),document.body.style.height="var(--ios-viewport-height)",n&&window.dispatchEvent(new Event("resize"))};class H{constructor(e){this.onEvent=e,this.onVisibilityChange=()=>{const e="visible"===document.visibilityState?r.WebAppEvent.WindowDidFocus:r.WebAppEvent.WindowDidBlur;this.notifyEvent(e)},this.onFocusEvent=()=>{this.notifyEvent(r.WebAppEvent.WindowDidFocus)},this.onBlurEvent=()=>{this.notifyEvent(r.WebAppEvent.WindowDidBlur)},document.addEventListener("visibilitychange",this.onVisibilityChange),window.addEventListener("focus",this.onFocusEvent,!1),window.addEventListener("blur",this.onBlurEvent,!1)}notifyEvent(e){this.raceTimeout&&clearTimeout(this.raceTimeout),this.raceTimeout=setTimeout((()=>{this.onEvent(e)}),250)}deinit(){document.removeEventListener("visibilitychange",this.onVisibilityChange),window.removeEventListener("focus",this.onFocusEvent),window.removeEventListener("blur",this.onBlurEvent),this.onEvent=void 0}}class G{constructor(e){this.application=e,r.InternalFeatureService.get().enableFeature(r.InternalFeature.Vaults)}async purchaseMockSubscription(){var e;const t=null===(e=this.application.sessions.getUser())||void 0===e?void 0:e.email,n=await fetch("http://localhost:3124/events",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({eventType:"SUBSCRIPTION_PURCHASED",eventPayload:{userEmail:t,subscriptionId:2002,subscriptionName:"PRO_PLAN",subscriptionExpiresAt:1e3*((new Date).getTime()+36e5),timestamp:Date.now(),offline:!1,discountCode:null,limitedDiscountPurchased:!1,newSubscriber:!0,totalActiveSubscriptionsCount:1,userRegisteredAt:1,billingFrequency:12,payAmount:59}})});n.ok||console.error("Failed to publish mocked event: ".concat(n.status," ").concat(n.statusText))}}var Y=s(54569);const z={AndroidBackHandler:Symbol.for("AndroidBackHandler"),ArchiveManager:Symbol.for("ArchiveManager"),AutolockService:Symbol.for("AutolockService"),ChangelogService:Symbol.for("ChangelogService"),DesktopManager:Symbol.for("DesktopManager"),SuperConverter:Symbol.for("SuperConverter"),Importer:Symbol.for("Importer"),ItemGroupController:Symbol.for("ItemGroupController"),KeyboardService:Symbol.for("KeyboardService"),MobileWebReceiver:Symbol.for("MobileWebReceiver"),MomentsService:Symbol.for("MomentsService"),PersistenceService:Symbol.for("PersistenceService"),RouteService:Symbol.for("RouteService"),ThemeManager:Symbol.for("ThemeManager"),VaultDisplayService:Symbol.for("VaultDisplayService"),PluginsService:Symbol.for("PluginsService"),AccountMenuController:Symbol.for("AccountMenuController"),ActionsMenuController:Symbol.for("ActionsMenuController"),ApplicationEventObserver:Symbol.for("ApplicationEventObserver"),FeaturesController:Symbol.for("FeaturesController"),FilePreviewModalController:Symbol.for("FilePreviewModalController"),FilesController:Symbol.for("FilesController"),HistoryModalController:Symbol.for("HistoryModalController"),ImportModalController:Symbol.for("ImportModalController"),ItemListController:Symbol.for("ItemListController"),LinkingController:Symbol.for("LinkingController"),NavigationController:Symbol.for("NavigationController"),NoAccountWarningController:Symbol.for("NoAccountWarningController"),NotesController:Symbol.for("NotesController"),PaneController:Symbol.for("PaneController"),PreferencesController:Symbol.for("PreferencesController"),PurchaseFlowController:Symbol.for("PurchaseFlowController"),QuickSettingsController:Symbol.for("QuickSettingsController"),SearchOptionsController:Symbol.for("SearchOptionsController"),SubscriptionController:Symbol.for("SubscriptionController"),SyncStatusController:Symbol.for("SyncStatusController"),ToastService:Symbol.for("ToastService"),VaultSelectionMenuController:Symbol.for("VaultSelectionMenuController"),GetItemTags:Symbol.for("GetItemTags"),GetPurchaseFlowUrl:Symbol.for("GetPurchaseFlowUrl"),IsGlobalSpellcheckEnabled:Symbol.for("IsGlobalSpellcheckEnabled"),IsMobileDevice:Symbol.for("IsMobileDevice"),IsNativeIOS:Symbol.for("IsNativeIOS"),IsNativeMobileWeb:Symbol.for("IsNativeMobileWeb"),IsTabletOrMobileScreen:Symbol.for("IsTabletOrMobileScreen"),LoadPurchaseFlowUrl:Symbol.for("LoadPurchaseFlowUrl"),OpenSubscriptionDashboard:Symbol.for("OpenSubscriptionDashboard"),PanesForLayout:Symbol.for("PanesForLayout"),GetHost:Symbol.for("GetHost"),IsApplicationUsingThirdPartyHost:Symbol.for("IsApplicationUsingThirdPartyHost")};var Z=s(67743),W=s(31031),q=s(34521),J=s(41421),X=s(68608),$=s(94900),ee=s(59786),te=s(78113),ne=s(74205),re=s(36153),ie=s(22311),oe=s(9591),se=s(29016);const ae="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,le=ae&&"documentMode"in document?document.documentMode:null,ce=(ae&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ae&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),!(!ae||!("InputEvent"in window)||le)&&new window.InputEvent("input"),ae&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)),ue=ae&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,de=ae&&/^(?=.*Chrome).*/i.test(navigator.userAgent),he=ae&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!de;var pe=s(37146);function fe(e){const t=function(e,t){const n={};for(const t of e){const e=t.type;n[e]?n[e].push(t):n[e]=[t]}return n}(e);return{element:t.element||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}const ge=[...pe.VH,...pe.Pr,...pe.lL],me=/[!-/:-@[-`{-~\s]/,ye=/^\s{0,3}$/,ve=/^```(\w{1,10})?\s?$/;function Ae(e){if(!(0,W.Rl)(e))return!1;const t=e.getFirstChild();return null==t||1===e.getChildrenSize()&&(0,W.Gg)(t)&&ye.test(t.getTextContent())}function be(e,t,n,r,i){const o=e.trim(),s=(0,W.MX)(o),a=(0,W.BE)();a.append(s),t.append(a);for(const{regExp:t,replace:r}of n){const n=e.match(t);if(n){s.setTextContent(e.slice(n[0].length)),r(a,[s],n,!0);break}}if(Se(s,r,i),a.isAttached()&&o.length>0){const e=a.getPreviousSibling();if((0,W.Rl)(e)||(0,oe.O)(e)||(0,ie.I3)(e)){let t=e;if((0,ie.I3)(e)){const n=e.getLastDescendant();t=null==n?null:(0,se.$s)(n,ie.QG)}null!=t&&t.getTextContentSize()>0&&(t.splice(t.getChildrenSize(),0,[(0,W.T)(),...a.getChildren()]),a.remove())}}}function we(e,t,n){const r=e[t].match(ve);if(r){let i=t;const o=e.length;for(;++i<o;)if(e[i].match(ve)){const o=(0,re.Ol)(r[1]),s=(0,W.MX)(e.slice(t+1,i).join("\n"));return o.append(s),n.append(o),[o,i]}}return[null,t]}function Se(e,t,n){const r=e.getTextContent(),i=function(e,t){const n=e.match(t.openTagsRegExp);if(null==n)return null;for(const r of n){const n=r.replace(/^\s/,""),i=t.fullMatchRegExpByTag[n];if(null==i)continue;const o=e.match(i),s=t.transformersByTag[n];if(null!=o&&null!=s){if(!1!==s.intraword)return o;const{index:t=0}=o,n=e[t-1],r=e[t+o[0].length];if((!n||me.test(n))&&(!r||me.test(r)))return o}}return null}(r,t);if(!i)return void Ce(e,n);let o,s,a;if(i[0]===r)o=e;else{const t=i.index||0,n=t+i[0].length;0===t?[o,s]=e.splitText(n):[a,o,s]=e.splitText(t,n)}o.setTextContent(i[2]);const l=t.transformersByTag[i[1]];if(l)for(const e of l.format)o.hasFormat(e)||o.toggleFormat(e);o.hasFormat("code")||Se(o,t,n),a&&Se(a,t,n),s&&Se(s,t,n)}function Ce(e,t){let n=e;e:for(;n;){for(const e of t){const r=n.getTextContent().match(e.importRegExp);if(!r)continue;const i=r.index||0,o=i+r[0].length;let s,a;0===i?[s,n]=n.splitText(o):[,s,a]=n.splitText(i,o),a&&Ce(a,t),e.replace(s,r);continue e}break}}function Ee(e){let t=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return function(e){const t=fe(e),n=function(e){const t={},n={},r=[];for(const i of e){const{tag:e}=i;t[e]=i;const o=e.replace(/(\*|\^|\+)/g,"\\$1");r.push(o),n[e]=ce||ue||he?new RegExp("(".concat(o,")(?![").concat(o,"\\s])(.*?[^").concat(o,"\\s])").concat(o,"(?!").concat(o,")")):new RegExp("(?<![\\\\".concat(o,"])(").concat(o,")((\\\\").concat(o,")?.*?[^").concat(o,"\\s](\\\\").concat(o,")?)((?<!\\\\)|(?<=\\\\\\\\))(").concat(o,")(?![\\\\").concat(o,"])"))}return{fullMatchRegExpByTag:n,openTagsRegExp:new RegExp((ce||ue||he?"":"".concat("(?<![\\\\])"))+"("+r.join("|")+")","g"),transformersByTag:t}}(t.textFormat);return function(e,r){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=e.split("\n"),s=o.length,a=r||(0,W.Gv)();a.clear();for(let e=0;e<s;e++){const r=o[e],[i,s]=we(o,e,a);null==i?be(r,a,t.element,n,t.textMatch):e=s}if(!i){const e=a.getChildren();for(const t of e)Ae(t)&&t.remove()}null!==(0,W.dL)()&&a.selectEnd()}}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:ge)(e,t,n)}function Ie(e,t,n,r){for(const i of t){const o=i.export(e,(e=>_e(e,t,n,r)));if(null!=o)return o}return(0,W.F7)(e)?_e(e,t,n,r):(0,W.k$)(e)?e.getTextContent():null}function _e(e,t,n,r){const i=[],o=e.getChildren();e:for(const e of o){if((0,W.F7)(e))for(const s of t){const a=s.export(e,(e=>_e(e,t,n,r)));if(null!=a){i.push(a),o.indexOf(e)!==o.length-1&&i.push("\n");continue e}}for(const o of r){const s=o.export(e,(e=>_e(e,t,n,r)),((e,t)=>xe(e,t,n)));if(null!=s){i.push(s);continue e}}(0,W.A3)(e)?i.push("\n"):(0,W.Gg)(e)?i.push(xe(e,e.getTextContent(),n)):(0,W.F7)(e)?i.push(_e(e,t,n,r),"\n"):(0,W.k$)(e)&&i.push(e.getTextContent())}return i.join("")}function xe(e,t,n){const r=t.trim();let i=r;const o=new Set;for(const t of n){const n=t.format[0],r=t.tag;ke(e,n)&&!o.has(n)&&(o.add(n),ke(Pe(e,!0),n)||(i=r+i),ke(Pe(e,!1),n)||(i+=r))}return t.replace(r,i)}function Pe(e,t){let n=t?e.getPreviousSibling():e.getNextSibling();if(!n){const r=e.getParentOrThrow();r.isInline()&&(n=t?r.getPreviousSibling():r.getNextSibling())}for(;n;){if((0,W.F7)(n)){if(!n.isInline())break;const e=t?n.getLastDescendant():n.getFirstDescendant();if((0,W.Gg)(e))return e;n=t?n.getPreviousSibling():n.getNextSibling()}if((0,W.Gg)(n))return n;if(!(0,W.F7)(n))return null}return null}function ke(e,t){return(0,W.Gg)(e)&&e.hasFormat(t)}class Be{constructor(){this.convertOtherFormatToSuperString=(e,t,n)=>{if(0===e.length)return e;if("json"===t&&this.isValidSuperString(e))return e;this.importEditor.update((()=>{(0,W.Gv)().clear()}),{discrete:!0});let r=!1;if("html"===t){const t=(null==n?void 0:n.html)||{addLineBreaks:!0};this.importEditor.update((()=>{try{const n=(new DOMParser).parseFromString(e,"text/html"),r=(0,$.s)(this.importEditor,n),i=[];r.forEach((e=>{const n=e.getType();if("text"===n||"link"===n||"linebreak"===n||"unencrypted-image"===n||"inline-file"===n||"snfile"===n){const t=(0,W.BE)();return t.append(e),void i.push(t)}i.push(e),t.addLineBreaks&&i.push((0,W.BE)())})),(0,W.Gv)().selectEnd(),(0,W.od)(i.concat((0,W.BE)()))}catch(e){console.error(e),r=!0}}),{discrete:!0})}else this.importEditor.update((()=>{try{Ee(e,X.c,void 0,!0)}catch(e){console.error(e),r=!0}}),{discrete:!0});if(r)throw new Error("Could not import note. Check error console for details.");return JSON.stringify(this.importEditor.getEditorState())},this.importEditor=(0,Z.D)({namespace:"BlocksEditor",theme:q.Z,editable:!1,onError:e=>console.error(e),nodes:J.G}),this.exportEditor=(0,Z.D)({namespace:"BlocksEditor",theme:q.Z,editable:!1,onError:e=>console.error(e),nodes:J.a})}isValidSuperString(e){try{return this.importEditor.parseEditorState(e),!0}catch(e){return!1}}async convertSuperStringToOtherFormat(e,t,n){if(0===e.length)return e;const{embedBehavior:r,getFileItem:i,getFileBase64:o}=null!=n?n:{embedBehavior:"reference"};if("separate"===r&&!i)throw new Error('getFileItem must be provided when embedBehavior is "separate"');if("inline"===r&&!i&&!o)throw new Error('getFileItem and getFileBase64 must be provided when embedBehavior is "inline"');let a;if(this.exportEditor.setEditorState(this.exportEditor.parseEditorState(e)),await new Promise((e=>{this.exportEditor.update((()=>{if("reference"===r)return void e();if(!i)return void e();const n=(0,W.K8)(ee.h),s={};Promise.all(n.map((async e=>{const n=i(e.getId());if(!n)return;const a="pdf"!==t||n.mimeType.startsWith("image/");if("inline"===r&&o&&a){const t=await o(e.getId());if(!t)return;this.exportEditor.update((()=>{const r=(0,ne.v9)(t,n.mimeType,n.name);e.replace(r)}),{discrete:!0})}else this.exportEditor.update((()=>{s[n.name]=null==s[n.name]?0:s[n.name]+1;let t=n.name;if(s[t]>0){const{name:e,ext:r}=(0,Q.parseFileName)(t);t="".concat(e,"-").concat(n.uuid,".").concat(r)}const r=(0,te.A)(t,n.mimeType);e.replace(r)}),{discrete:!0})}))).then((()=>e())).catch(console.error)}),{discrete:!0})})),await new Promise((r=>{this.exportEditor.update((()=>{switch(t){case"txt":case"md":{const e=(0,W.K8)(W.CK);for(const t of e)t.isEmpty()&&t.remove();a=function(){let e=arguments.length>1?arguments[1]:void 0;const t=function(e){const t=fe(e),n=t.textFormat.filter((e=>1===e.format.length));return e=>{const r=[],i=(e||(0,W.Gv)()).getChildren();for(const e of i){const i=Ie(e,t.element,n,t.textMatch);null!=i&&r.push(i)}return r.join("\n\n")}}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:ge);return t(e)}(X.c),r();break}case"html":a=(0,$.S)(this.exportEditor),r();break;case"pdf":Promise.all([s.e(283),s.e(298),s.e(405)]).then(s.bind(s,63962)).then((e=>{let{$generatePDFFromNodes:t}=e;var i;t(this.exportEditor,(null===(i=null==n?void 0:n.pdf)||void 0===i?void 0:i.pageSize)||"A4").then((e=>{a=e,r()}))}));break;default:a=e,r()}}),{discrete:!0})})),"string"!=typeof a)throw new Error("Could not export note");return a}getEmbeddedFileIDsFromSuperString(e){if(0===e.length)return[];this.exportEditor.setEditorState(this.exportEditor.parseEditorState(e));const t=[];return this.exportEditor.getEditorState().read((()=>{(0,W.K8)(ee.h).forEach((e=>{const n=e.getId();t.includes(n)||t.push(n)}))})),t}}class Oe extends r.ApplicationService{constructor(e,t,n){super(e,new r.InternalEventBus),this.device=t,this.backups=n,this.updateObservers=[],this.dataLoaded=!1,this.needsInitialTextBackup=!1;const i=new Be;n.setSuperConverter(i)}async handleWatchedDirectoriesChanges(e){this.backups.importWatchedDirectoryChanges(e)}async handleHomeServerStarted(e){}beginTextBackupsTimer(){this.textBackupsInterval&&clearInterval(this.textBackupsInterval),this.needsInitialTextBackup=!0,this.textBackupsInterval=setInterval(this.saveDesktopBackup,432e5)}get webApplication(){return this.application}deinit(){this.updateObservers.length=0,super.deinit()}async onAppEvent(e){super.onAppEvent(e).catch(console.error),e===r.ApplicationEvent.LocalDataLoaded?(this.dataLoaded=!0,this.backups.isTextBackupsEnabled()&&this.beginTextBackupsTimer()):e===r.ApplicationEvent.MajorDataChange&&this.saveDesktopBackup()}async saveDesktopBackup(){var e;this.webApplication.notifyWebEvent(r.WebAppEvent.BeganBackupDownload);const t=await this.getBackupFile();t&&(await(null===(e=this.webApplication.fileBackups)||void 0===e?void 0:e.saveTextBackupData(t)),this.webApplication.notifyWebEvent(r.WebAppEvent.EndedBackupDownload,{success:!0}))}async getBackupFile(){const e=this.application.hasProtectionSources()?await this.application.createEncryptedBackupFile.execute({skipAuthorization:!0}):await this.application.createDecryptedBackupFile.execute();if(!e.isFailed())return JSON.stringify(e.getValue(),null,2)}getExtServerHost(){return(0,r.assert)(this.device.extensionsServerHost),this.device.extensionsServerHost}convertComponentForTransmission(e){return e.payloadRepresentation().ejected()}syncComponentsInstallation(e){Promise.all(e.map((e=>this.convertComponentForTransmission(e)))).then((e=>{this.device.syncComponents(e)})).catch(console.error)}registerUpdateObserver(e){const t={callback:e};return this.updateObservers.push(t),()=>{(0,r.removeFromArray)(this.updateObservers,t)}}searchText(e){this.lastSearchedText=e,this.device.onSearch(e)}redoSearch(){this.lastSearchedText&&this.searchText(this.lastSearchedText)}updateAvailable(){this.webApplication.notifyWebEvent(r.WebAppEvent.NewUpdateAvailable)}windowGainedFocus(){this.webApplication.notifyWebEvent(r.WebAppEvent.WindowDidFocus)}windowLostFocus(){this.webApplication.notifyWebEvent(r.WebAppEvent.WindowDidBlur),this.needsInitialTextBackup&&(this.needsInitialTextBackup=!1,this.saveDesktopBackup())}consoleLog(e){console.log(e)}async onComponentInstallationComplete(e){const t=this.application.items.findItem(e.uuid);if(!t)return;const n=(await this.application.changeAndSaveItem.execute(t,(t=>{const n=t;n.local_url=e.content.local_url,n.package_info=e.content.package_info,n.setAppDataItem(r.AppDataField.ComponentInstallError,void 0)}),void 0,r.PayloadEmitSource.DesktopComponentSync)).getValue();for(const e of this.updateObservers)e.callback(n)}}var Ne=s(32105),De=s(23995),je=s(93632);class Te{constructor(){}static async isSupported(){return!!navigator.mediaDevices&&(await navigator.mediaDevices.enumerateDevices()).some((e=>"videoinput"===e.kind))}async setDevice(e){var t;this.selectedDevice=null!==(t=this.devices.find((t=>t.deviceId===e)))&&void 0!==t?t:this.devices[0],this.stream=await navigator.mediaDevices.getUserMedia({video:{deviceId:this.selectedDevice.deviceId},audio:!1}),this.video.srcObject=this.stream,await this.video.play(),await this.awaitVideoReady(this.video)}async initialize(){var e,t;if(this.devices=(await navigator.mediaDevices.enumerateDevices()).filter((e=>"videoinput"===e.kind)),0===this.devices.length)return;this.selectedDevice=this.devices[0],this.stream=await navigator.mediaDevices.getUserMedia({video:{deviceId:this.selectedDevice.deviceId},audio:!1}),this.video=document.createElement("video"),this.video.playsInline=!0,this.video.style.position="absolute",this.video.style.display="none",this.video.oncontextmenu=e=>e.preventDefault(),this.canvas=document.createElement("canvas"),document.body.append(this.video),this.video.srcObject=this.stream,await this.video.play(),await this.awaitVideoReady(this.video);const n=this.stream.getVideoTracks()[0].getSettings();this.width=null!==(e=n.width)&&void 0!==e?e:1280,this.height=null!==(t=n.height)&&void 0!==t?t:720,this.canvas.width=this.width,this.canvas.height=this.height}async takePhoto(e){if(!this.canvas)return;const t=this.canvas.getContext("2d");null==t||t.drawImage(this.video,0,0,this.width,this.height);const n=this.canvas.toDataURL("image/png");if(n.length<1e5)return;const r=await fetch(n),i=await r.blob();return new File([i],e,{type:"image/png"})}finish(){var e,t,n;this.canvas&&this.video&&(this.video.pause(),null===(e=this.video.parentElement)||void 0===e||e.removeChild(this.video),null===(t=this.canvas.parentElement)||void 0===t||t.removeChild(this.canvas),this.video.remove(),this.canvas.remove(),null===(n=this.stream)||void 0===n||n.getTracks().forEach((e=>{e.stop()})))}async awaitVideoReady(e){return new Promise((t=>{e.addEventListener("canplaythrough",(()=>{t(null)}))}))}}const Me=t.r8&&!1;class Fe extends De.L{constructor(e,t,n,i,o,s,a,l,c){super(c),this.filesController=e,this.linkingController=t,this.storage=n,this.preferences=i,this.items=o,this.protections=s,this.desktopDevice=a,this._isMobileDevice=l,this.isEnabled=!1,this.enableMoments=()=>{this.storage.setValue(Ne.QtK.MomentsEnabled,!0),this.isEnabled=!0,this.beginTakingPhotos()},this.disableMoments=()=>{this.storage.setValue(Ne.QtK.MomentsEnabled,!1),this.isEnabled=!1,clearInterval(this.intervalReference)},this.takePhoto=async()=>{if(await this.protections.isLocked())return;const e="visible"===document.visibilityState;let t;if(e&&(t=(0,Y.fz)({type:Y.pC.Regular,message:"Capturing Moment...",pauseOnWindowBlur:!1})),this.desktopDevice&&!await this.desktopDevice.askForMediaAccess("camera"))return t&&(0,Y.Xd)(t),void(0,Y.fz)({type:Y.pC.Error,message:"Please enable Camera permissions for Standard Notes to enable Moments.",duration:3e3});const n="Moment ".concat((0,je.An)(new Date),".png"),i=new Te;await i.initialize(),this._isMobileDevice.execute().getValue()&&await(0,r.sleep)(2e3);let o=await i.takePhoto(n);if(!o&&(await(0,r.sleep)(1e3),o=await i.takePhoto(n),!o))return;t&&(0,Y.Xd)(t);const s=await this.filesController.uploadNewFile(o);if(s){e&&this.linkingController.linkItemToSelectedItem(s);const t=this.getDefaultTag();t&&this.linkingController.linkItems(s,t)}return i.finish(),s},(0,_.rC)(this,{isEnabled:_.LO,enableMoments:_.aD,disableMoments:_.aD}),c.addEventHandler(this,Ne.n9K.LocalDataLoaded),c.addEventHandler(this,Ne.Hh3.BiometricsSoftLockEngaged),c.addEventHandler(this,Ne.Hh3.BiometricsSoftLockDisengaged)}async handleEvent(e){var t;switch(e.type){case Ne.n9K.LocalDataLoaded:this.isEnabled=null!==(t=this.storage.getValue(Ne.QtK.MomentsEnabled))&&void 0!==t&&t,this.isEnabled&&this.beginTakingPhotos();break;case Ne.Hh3.BiometricsSoftLockEngaged:this.pauseMoments();break;case Ne.Hh3.BiometricsSoftLockDisengaged:this.resumeMoments()}}deinit(){super.deinit(),this.filesController=void 0}pauseMoments(){clearInterval(this.intervalReference)}resumeMoments(){this.isEnabled&&this.beginTakingPhotos()}beginTakingPhotos(){this.intervalReference&&clearInterval(this.intervalReference),this.takePhoto(),this.intervalReference=setInterval((()=>{this.takePhoto()}),Me?1e4:36e5)}getDefaultTag(){const e=this.preferences.getValue(r.PrefKey.MomentsDefaultTagUuid);if(e)return this.items.findItem(e)}}var Re=s(13500);const Le=["className"];function Qe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ue(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qe(Object(n),!0).forEach((function(t){Ve(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ve(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ke=t=>{let{className:n}=t,r=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,Le);return(0,e.jsxs)("div",{className:(0,Q.classNames)("flex",n),children:[(0,e.jsx)("input",Ue({type:"radio",className:"h-0 w-0 opacity-0"},r)),(0,e.jsx)(Re.Z,{checked:!!r.checked})]})};var He=s(2784),Ge=s(82619),Ye=s(65378),ze=s(44993);const Ze="ShouldPersistNoteState",We=t=>{let{application:n}=t;const[r,i]=(0,He.useState)(n.getValue(Ze)),o=e=>{n.setValue(Ze,e),i(e),e?n.persistence.persistCurrentState():n.persistence.clearPersistedValues()};return(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{className:"mb-2",children:"When opening the app, show..."}),(0,e.jsxs)("label",{className:"mb-2 flex items-center gap-2 text-base font-medium md:text-sm",children:[(0,e.jsx)(Ke,{name:"state-persistence",checked:!r,onChange:e=>{o(!e.target.checked)}}),"The first note in the list"]}),(0,e.jsxs)("label",{className:"flex items-center gap-2 text-base font-medium md:text-sm",children:[(0,e.jsx)(Ke,{name:"state-persistence",checked:!!r,onChange:e=>{o(e.target.checked)}}),"The last viewed note"]})]})})};var qe;!function(e){e.TagChanged="CrossControllerEvent:TagChanged",e.ActiveEditorChanged="CrossControllerEvent:ActiveEditorChanged",e.HydrateFromPersistedValues="CrossControllerEvent:HydrateFromPersistedValues",e.RequestValuePersistence="CrossControllerEvent:RequestValuePersistence",e.DisplayPremiumModal="CrossControllerEvent:DisplayPremiumModal",e.UnselectAllNotes="CrossControllerEvent:UnselectAllNotes"}(qe||(qe={}));class Je{constructor(e,t,n,i,o,s){this.itemListController=e,this.navigationController=t,this.storage=n,this.items=i,this.sync=o,this.eventBus=s,this.didHydrateOnce=!1,this.hydratePersistedValues=()=>{this.eventBus.publish({type:qe.HydrateFromPersistedValues,payload:this.persistenceEnabled?this.getPersistedValues():void 0})},s.addEventHandler(this,r.ApplicationEvent.LocalDataLoaded),s.addEventHandler(this,r.ApplicationEvent.LocalDataIncrementalLoad),s.addEventHandler(this,qe.HydrateFromPersistedValues),s.addEventHandler(this,qe.RequestValuePersistence)}async handleEvent(e){switch(e.type){case r.ApplicationEvent.LocalDataLoaded:this.didHydrateOnce||(this.hydratePersistedValues(),this.didHydrateOnce=!0);break;case r.ApplicationEvent.LocalDataIncrementalLoad:if(!(this.items.getItems([r.ContentType.TYPES.Note,r.ContentType.TYPES.Tag]).length>0))return;this.hydratePersistedValues(),this.didHydrateOnce=!0;break;case qe.HydrateFromPersistedValues:this.hydrateFromPersistedValues(e.payload);break;case qe.RequestValuePersistence:this.persistCurrentState()}}get persistenceEnabled(){var e;return null===(e=this.storage.getValue(Ze))||void 0===e||e}persistCurrentState(){const e={[L.UK.ItemListController]:this.itemListController.getPersistableValue(),[L.UK.NavigationController]:this.navigationController.getPersistableValue()};this.persistValues(e);const t=e["selected-items-controller"],n=e["navigation-controller"],r=[];t.selectedUuids.length&&r.push(...t.selectedUuids),n.selectedTagUuid&&r.push(n.selectedTagUuid),this.sync.setLaunchPriorityUuids(r)}hydrateFromPersistedValues(e){const t=null==e?void 0:e[L.UK.NavigationController];this.navigationController.hydrateFromPersistedValue(t);const n=null==e?void 0:e[L.UK.ItemListController];this.itemListController.hydrateFromPersistedValue(n)}persistValues(e){this.sync.isDatabaseLoaded()&&this.persistenceEnabled&&this.storage.setValue(L.Qt.MasterStatePersistenceKey,e)}clearPersistedValues(){this.sync.isDatabaseLoaded()&&this.storage.removeValue(L.Qt.MasterStatePersistenceKey)}getPersistedValues(){return this.storage.getValue(L.Qt.MasterStatePersistenceKey)}}class Xe{constructor(e){this.isOpen=!1,this.currentFile=void 0,this.otherFiles=[],this.eventObservers=[],this.deinit=()=>{this.eventObservers.forEach((e=>e())),this.currentFile=void 0,this.otherFiles=void 0},this.setCurrentFile=e=>{this.currentFile=e},this.activate=(e,t)=>{this.currentFile=e,t&&(this.otherFiles=t),this.isOpen=!0},this.dismiss=()=>{this.isOpen=!1},(0,_.rC)(this,{isOpen:_.LO,currentFile:_.LO,otherFiles:_.LO,activate:_.aD,dismiss:_.aD,setCurrentFile:_.aD}),this.eventObservers.push(e.streamItems(r.ContentType.TYPES.File,(e=>{let{changed:t,removed:n}=e;if(!this.currentFile)return;const r=t.find((e=>{var t;return e.uuid===(null===(t=this.currentFile)||void 0===t?void 0:t.uuid)}));if(r&&this.setCurrentFile(r),n.find((e=>{var t;return e.uuid===(null===(t=this.currentFile)||void 0===t?void 0:t.uuid)}))){if(!this.otherFiles.length)return this.dismiss(),void(this.currentFile=void 0);const e=this.otherFiles.findIndex((e=>{var t;return e.uuid===(null===(t=this.currentFile)||void 0===t?void 0:t.uuid)})),t=e+1<this.otherFiles.length?e+1:0;this.setCurrentFile(this.otherFiles[t]),this.otherFiles=this.otherFiles.filter((e=>{var t;return e.uuid!==(null===(t=this.currentFile)||void 0===t?void 0:t.uuid)}))}})))}}var $e=s(73144),et=s(3555);const tt=r.PrefDefaults[r.PrefKey.TagsPanelWidth],nt=r.PrefDefaults[r.PrefKey.NotesPanelWidth],rt="focus-mode",it="disable-focus-mode";class ot extends De.L{constructor(e,n,i,o,s){super(s),this.preferences=e,this.keyboardService=n,this._isTabletOrMobileScreen=i,this._panesForLayout=o,this.isInMobileView=(0,t.Av)(),this.disposers=[],this.panes=[],this.currentNavPanelWidth=0,this.currentItemsPanelWidth=0,this.focusModeEnabled=!1,this.listPaneExplicitelyCollapsed=!1,this.navigationPaneExplicitelyCollapsed=!1,this.mediumScreenMQHandler=e=>{e.matches?this.setIsInMobileView(!1):this.setIsInMobileView(!0)},this.setIsInMobileView=e=>{this.isInMobileView=e},this.setPaneLayout=e=>{V(R.Panes,"Set pane layout",e);const t=this._panesForLayout.execute(e).getValue();t.includes($e.n.Items)&&this.listPaneExplicitelyCollapsed&&(0,r.removeFromArray)(t,$e.n.Items),t.includes($e.n.Navigation)&&this.navigationPaneExplicitelyCollapsed&&(0,r.removeFromArray)(t,$e.n.Navigation),this.replacePanes(t)},this.replacePanes=e=>{V(R.Panes,"Replacing panes",e),this.panes=e},this.presentPane=e=>{V(R.Panes,"Presenting pane",e),e!==this.currentPane&&(e!==$e.n.Items||this.currentPane!==$e.n.Editor?this.currentPane!==e&&this.panes.push(e):this.dismissLastPane())},this.insertPaneAtIndex=(e,t)=>{V(R.Panes,"Inserting pane",e,"at index",t),this.panes.splice(t,0,e)},this.dismissLastPane=()=>(V(R.Panes,"Dismissing last pane"),this.panes.pop()),this.removePane=e=>{V(R.Panes,"Removing pane",e),(0,r.removeFromArray)(this.panes,e)},this.popToPane=e=>{V(R.Panes,"Popping to pane",e);let t=this.panes.length-1;for(;t>=0&&this.panes[t]!==e;)this.dismissLastPane(),t--},this.toggleListPane=()=>{this.panes.includes($e.n.Items)?(this.removePane($e.n.Items),this.listPaneExplicitelyCollapsed=!0):(this.panes.includes($e.n.Navigation)?this.insertPaneAtIndex($e.n.Items,1):this.insertPaneAtIndex($e.n.Items,0),this.listPaneExplicitelyCollapsed=!1)},this.toggleNavigationPane=()=>{this.panes.includes($e.n.Navigation)?(this.removePane($e.n.Navigation),this.navigationPaneExplicitelyCollapsed=!0):(this.insertPaneAtIndex($e.n.Navigation,0),this.navigationPaneExplicitelyCollapsed=!1)},this.setFocusModeEnabled=e=>{this.focusModeEnabled=e,e?document.body.classList.add(rt):document.body.classList.contains(rt)&&(document.body.classList.add(it),document.body.classList.remove(rt),setTimeout((()=>{document.body.classList.remove(it)}),1255))},(0,_.rC)(this,{panes:_.LO,isInMobileView:_.LO,currentNavPanelWidth:_.LO,currentItemsPanelWidth:_.LO,focusModeEnabled:_.LO,currentPane:_.Fl,previousPane:_.Fl,isListPaneCollapsed:_.Fl,isNavigationPaneCollapsed:_.Fl,setIsInMobileView:_.aD,toggleListPane:_.aD,toggleNavigationPane:_.aD,setCurrentItemsPanelWidth:_.aD,setCurrentNavPanelWidth:_.aD,presentPane:_.aD,dismissLastPane:_.aD,replacePanes:_.aD,popToPane:_.aD,removePane:_.aD,insertPaneAtIndex:_.aD,setPaneLayout:_.aD,setFocusModeEnabled:_.aD}),this.setCurrentNavPanelWidth(e.getValue(r.PrefKey.TagsPanelWidth,tt)),this.setCurrentItemsPanelWidth(e.getValue(r.PrefKey.NotesPanelWidth,nt));const a=this._isTabletOrMobileScreen.execute().getValue();this.panes=a.isTabletOrMobile?[$e.n.Navigation,$e.n.Items]:[$e.n.Navigation,$e.n.Items,$e.n.Editor];const l=window.matchMedia(et.Yd.md);null!=(null==l?void 0:l.addEventListener)?l.addEventListener("change",this.mediumScreenMQHandler):l.addListener(this.mediumScreenMQHandler),s.addEventHandler(this,r.ApplicationEvent.PreferencesChanged),this.disposers.push(n.addCommandHandler({command:L.yX,category:"General",description:"Toggle focus mode",onKeyDown:e=>(e.preventDefault(),this.setFocusModeEnabled(!this.focusModeEnabled),!0)}),n.addCommandHandler({command:L.p7,category:"General",description:"Toggle notes panel",onKeyDown:e=>{e.preventDefault(),this.toggleListPane()}}),n.addCommandHandler({command:L.Jr,category:"General",description:"Toggle tags panel",onKeyDown:e=>{e.preventDefault(),this.toggleNavigationPane()}}))}async handleEvent(e){e.type===r.ApplicationEvent.PreferencesChanged&&(this.setCurrentNavPanelWidth(this.preferences.getValue(r.PrefKey.TagsPanelWidth,tt)),this.setCurrentItemsPanelWidth(this.preferences.getValue(r.PrefKey.NotesPanelWidth,nt)))}setCurrentNavPanelWidth(e){this.currentNavPanelWidth=e}setCurrentItemsPanelWidth(e){this.currentItemsPanelWidth=e}deinit(){super.deinit();const e=window.matchMedia(et.Yd.md);null!=(null==e?void 0:e.removeEventListener)?e.removeEventListener("change",this.mediumScreenMQHandler):e.removeListener(this.mediumScreenMQHandler)}get currentPane(){return this.panes[this.panes.length-1]||this.panes[0]}get previousPane(){return this.panes[this.panes.length-2]||this.panes[0]}get isListPaneCollapsed(){return!this.panes.includes($e.n.Items)}get isNavigationPaneCollapsed(){return!this.panes.includes($e.n.Navigation)}}const st="account";class at extends De.L{constructor(e,t){super(t),this.routeService=e,this._open=!1,this.currentPane=st,this.setCurrentPane=e=>{this.currentPane=e},this.openPreferences=e=>{e&&(this.currentPane=e),this._open=!0},this.closePreferences=()=>{this._open=!1,this.currentPane=st,this.routeService.removeQueryParameterFromURL(L.YX.Settings)},(0,_.rC)(this,{_open:_.LO,currentPane:_.LO,openPreferences:_.aD,closePreferences:_.aD,setCurrentPane:_.aD,isOpen:_.Fl})}get isOpen(){return this._open}}var lt,ct;function ut(){return r.InternalFeatureService.get().isFeatureEnabled(r.InternalFeature.Vaults)}!function(e){e[e.UpgradePrompt=0]="UpgradePrompt",e[e.UpgradeSuccess=1]="UpgradeSuccess",e[e.SuperDemo=2]="SuperDemo"}(lt||(lt={})),ct||(ct={});class dt extends De.L{deinit(){super.deinit(),this.showPremiumAlert=void 0,this.closePremiumAlert=void 0,this.hasFolders=void 0,this.hasSmartViews=void 0,this.entitledToFiles=void 0,this.premiumAlertFeatureName=void 0,this.premiumAlertType=void 0,(0,t.h6)(this)}constructor(e,t){super(t),this.features=e,this.premiumAlertType=void 0,this.showPurchaseSuccessAlert=()=>{this.premiumAlertType=lt.UpgradeSuccess},this.showSuperDemoModal=()=>{this.premiumAlertType=lt.SuperDemo},this.hasFolders=this.isEntitledToFolders(),this.hasSmartViews=this.isEntitledToSmartViews(),this.entitledToFiles=this.isEntitledToFiles(),this.premiumAlertFeatureName=void 0,(0,_.rC)(this,{hasFolders:_.LO,hasSmartViews:_.LO,entitledToFiles:_.LO,premiumAlertType:_.LO,premiumAlertFeatureName:_.LO,showPremiumAlert:_.aD,closePremiumAlert:_.aD,showPurchaseSuccessAlert:_.aD}),t.addEventHandler(this,qe.DisplayPremiumModal),t.addEventHandler(this,r.ApplicationEvent.DidPurchaseSubscription),t.addEventHandler(this,r.ApplicationEvent.FeaturesAvailabilityChanged),t.addEventHandler(this,r.ApplicationEvent.Launched),t.addEventHandler(this,r.ApplicationEvent.LocalDataLoaded),t.addEventHandler(this,r.ApplicationEvent.UserRolesChanged),this.showPremiumAlert=this.showPremiumAlert.bind(this),this.closePremiumAlert=this.closePremiumAlert.bind(this)}async handleEvent(e){switch(e.type){case r.ApplicationEvent.DidPurchaseSubscription:this.showPurchaseSuccessAlert();break;case r.ApplicationEvent.FeaturesAvailabilityChanged:case r.ApplicationEvent.Launched:case r.ApplicationEvent.LocalDataLoaded:case r.ApplicationEvent.UserRolesChanged:(0,_.z)((()=>{this.hasFolders=this.isEntitledToFolders(),this.hasSmartViews=this.isEntitledToSmartViews(),this.entitledToFiles=this.isEntitledToFiles()}));break;case qe.DisplayPremiumModal:{const t=e.payload;this.showPremiumAlert(t.featureName)}}}async showPremiumAlert(e){return this.premiumAlertFeatureName=e,this.premiumAlertType=lt.UpgradePrompt,(0,_.gx)((()=>void 0===this.premiumAlertType))}closePremiumAlert(){this.premiumAlertType=void 0}isEntitledToFiles(){return this.features.getFeatureStatus(r.NativeFeatureIdentifier.create(r.NativeFeatureIdentifier.TYPES.Files).getValue())===r.FeatureStatus.Entitled}isEntitledToFolders(){return this.features.getFeatureStatus(r.NativeFeatureIdentifier.create(r.NativeFeatureIdentifier.TYPES.TagNesting).getValue())===r.FeatureStatus.Entitled}isEntitledToSmartViews(){return this.features.getFeatureStatus(r.NativeFeatureIdentifier.create(r.NativeFeatureIdentifier.TYPES.SmartFilters).getValue())===r.FeatureStatus.Entitled}isVaultsEnabled(){const e=this.features.isExperimentalFeatureEnabled(r.NativeFeatureIdentifier.TYPES.Vaults);return ut()||e||this.features.hasRole(r.RoleName.create(r.RoleName.NAMES.InternalTeamUser).getValue())}isEntitledToSharedVaults(){const e=this.features.getFeatureStatus(r.NativeFeatureIdentifier.create(r.NativeFeatureIdentifier.TYPES.SharedVaults).getValue())===r.FeatureStatus.Entitled;return ut()||e}}var ht=s(39537),pt=s(88450);const ft=e=>e.getDisplayableTags().filter((t=>!e.getTagParent(t))),gt=(e,t,n)=>!t.find((e=>e.title===n.title))||(null==e||e.alert("A tag with the name ".concat(n.title," already exists at this destination. Please rename this tag before moving and try again.")).catch(console.error),!1);var mt=s(74455);class yt{constructor(e){this.items=e,this.counts={},(0,_.ky)(this,{counts:_.LO.ref,update:_.aD})}update(e){const t=Object.assign({},this.counts);e.forEach((e=>{t[e.uuid]=this.items.countableNotesForTag(e)})),this.counts=t}}function vt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function At(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vt(Object(n),!0).forEach((function(t){bt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class wt extends De.L{constructor(e,n,i,o,s,a,l,c,u,d,h){super(h),this.featuresController=e,this.vaultDisplayService=n,this.keyboardService=i,this.paneController=o,this.sync=s,this.mutator=a,this.items=l,this.preferences=c,this.alerts=u,this._changeAndSaveItem=d,this.tags=[],this.smartViews=[],this.starredTags=[],this.allNotesCount_=0,this.allFilesCount_=0,this.selectedUuid=void 0,this.selected_=void 0,this.selectedLocation=void 0,this.previouslySelected_=void 0,this.editing_=void 0,this.addingSubtagTo=void 0,this.contextMenuOpen=!1,this.contextMenuClickLocation={x:0,y:0},this.contextMenuTag=void 0,this.contextMenuTagSection=void 0,this.searchQuery="",this.findAndSetTag=e=>{const t=[...this.tags,...this.smartViews].find((t=>t.uuid===e));t&&this.setSelectedTag(t,(0,r.isTag)(t)?t.starred?"favorites":"all":"views")},this.selectHydratedTagOrDefault=()=>{this.selectedUuid&&!this.selected_&&this.findAndSetTag(this.selectedUuid),this.selectedUuid||this.selectHomeNavigationView()},this.getPersistableValue=()=>({selectedTagUuid:this.selectedUuid?this.selectedUuid:r.SystemViewId.AllNotes}),this.hydrateFromPersistedValue=e=>{const t=[r.SystemViewId.Files];e&&!t.includes(e.selectedTagUuid)?e.selectedTagUuid&&(this.selectedUuid=e.selectedTagUuid,this.selectHydratedTagOrDefault()):this.selectHomeNavigationView()},this.setDisplayOptionsAndReloadTags=()=>{this.items.setTagsAndViewsDisplayOptions({searchQuery:{query:this.searchQuery,includeProtectedNoteText:!1}}),this.reloadTags()},this.setSearchQuery=e=>{this.searchQuery=e,this.setDisplayOptionsAndReloadTags()},h.addEventHandler(this,L.FJ.VaultDisplayOptionsChanged),this.tagsCountsState=new yt(l),this.smartViews=l.getSmartViews(),(0,_.rC)(this,{tags:_.LO,starredTags:_.LO,smartViews:_.LO.ref,allNotesCount_:_.LO,allFilesCount_:_.LO,allNotesCount:_.Fl,allFilesCount:_.Fl,setAllNotesCount:_.aD,setAllFilesCount:_.aD,selected_:_.LO,selectedLocation:_.LO,previouslySelected_:_.LO.ref,previouslySelected:_.Fl,editing_:_.LO.ref,selected:_.Fl,selectedUuid:_.LO,editingTag:_.Fl,addingSubtagTo:_.LO,setAddingSubtagTo:_.aD,assignParent:_.aD,rootTags:_.Fl,tagsCount:_.Fl,createNewTemplate:_.aD,undoCreateNewTag:_.aD,save:_.aD,remove:_.aD,contextMenuOpen:_.LO,contextMenuClickLocation:_.LO,setContextMenuOpen:_.aD,setContextMenuClickLocation:_.aD,contextMenuTag:_.LO,setContextMenuTag:_.aD,isInFilesView:_.Fl,hydrateFromPersistedValue:_.aD,searchQuery:_.LO,setSearchQuery:_.aD}),this.disposers.push(this.items.streamItems([r.ContentType.TYPES.Tag,r.ContentType.TYPES.SmartView],(e=>{let{changed:t,removed:n}=e;this.reloadTags(),this.contextMenuTag&&(0,r.FindItem)(n,this.contextMenuTag.uuid)&&this.setContextMenuTag(void 0),(0,_.z)((()=>{const e=this.selected_;if(!e)return;const i=(0,r.FindItem)(t,e.uuid)||(0,r.FindItem)(this.smartViews,e.uuid);i&&this.setSelectedTagInstance(i),(0,r.isSystemView)(e)||(0,r.FindItem)(n,e.uuid)&&this.setSelectedTagInstance(this.smartViews[0])}))}))),this.disposers.push(this.items.addNoteCountChangeObserver((e=>{if(e){const t=this.items.findItem(e);t&&this.tagsCountsState.update([t])}else this.setAllNotesCount(this.items.allCountableNotesCount()),this.setAllFilesCount(this.items.allCountableFilesCount())}))),this.disposers.push((0,_.U5)((()=>this.selectedUuid),(()=>{h.publish({type:qe.RequestValuePersistence,payload:void 0})}))),this.disposers.push(this.keyboardService.addCommandHandler({command:L.PV,category:"General",description:"Create new tag",onKeyDown:()=>{this.createNewTemplate()}})),this.setDisplayOptionsAndReloadTags=(0,t.Ds)(this.setDisplayOptionsAndReloadTags,50)}reloadTags(){(0,_.z)((()=>{this.tags=this.items.getDisplayableTags(),this.starredTags=this.tags.filter((e=>e.starred)),this.smartViews=this.items.getSmartViews().filter((e=>!this.isSearching||!(0,r.isSystemView)(e)))}))}async handleEvent(e){e.type===L.FJ.VaultDisplayOptionsChanged&&(this.reloadTags(),this.selectedUuid?this.findAndSetTag(this.selectedUuid):this.selectHomeNavigationView().catch(console.error))}deinit(){super.deinit(),this.featuresController=void 0,this.tags=void 0,this.smartViews=void 0,this.selected_=void 0,this.previouslySelected_=void 0,this.editing_=void 0,this.addingSubtagTo=void 0,this.featuresController=void 0,(0,t.h6)(this)}async createSubtagAndAssignParent(e,t){if(0===t.length)return void this.setAddingSubtagTo(void 0);const n=await this.mutator.createTagOrSmartView(t,this.vaultDisplayService.exclusivelyShownVault),r=this.items.getTagChildren(e);if(!gt(this.alerts,r,n))return this.setAddingSubtagTo(void 0),void this.remove(n,!1).catch(console.error);this.assignParent(n.uuid,e.uuid).catch(console.error),this.sync.sync().catch(console.error),(0,_.z)((()=>{this.setSelectedTag(n,"all")})),this.setAddingSubtagTo(void 0)}isInSmartView(){return this.selected instanceof r.SmartView}isInHomeView(){return this.selected instanceof r.SmartView&&this.selected.uuid===r.SystemViewId.AllNotes}get isInFilesView(){return this.selectedUuid===r.SystemViewId.Files}isTagFilesView(e){return e.uuid===r.SystemViewId.Files}tagUsesTableView(e){var t;const n=e instanceof r.SmartView&&Object.values(r.SystemViewId).includes(e.uuid)?null===(t=this.preferences.getValue(r.PrefKey.SystemViewPreferences))||void 0===t?void 0:t[e.uuid]:null==e?void 0:e.preferences;return Boolean(n)}isInAnySystemView(){return this.selected instanceof r.SmartView&&Object.values(r.SystemViewId).includes(this.selected.uuid)}isInSystemView(e){return this.selected instanceof r.SmartView&&this.selected.uuid===e}get selectedAsTag(){if(this.selected&&(0,r.isTag)(this.selected))return this.selected}setAddingSubtagTo(e){this.addingSubtagTo=e}setContextMenuOpen(e){this.contextMenuOpen=e}setContextMenuClickLocation(e){this.contextMenuClickLocation=e}setContextMenuTag(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";this.contextMenuTag=e,this.contextMenuTagSection=t}get allLocalRootTags(){return this.editing_ instanceof r.SNTag&&this.items.isTemplateItem(this.editing_)?[this.editing_,...this.rootTags]:this.rootTags}getNotesCount(e){return this.tagsCountsState.counts[e.uuid]||0}getChildren(e){if(this.items.isTemplateItem(e))return[];const t=this.items.getTagChildren(e),n=t.map((e=>e.uuid)),r=this.isSearching?t:this.tags.filter((e=>n.includes(e.uuid)));return r}isValidTagParent(e,t){return this.items.isValidTagParent(e,t)}hasParent(e){const t=this.items.findItem(e);return!!t&&!!t.parentId}async assignParent(e,t){const n=this.items.findItem(e),r=this.items.getTagParent(n);if((null==r?void 0:r.uuid)===t)return;const i=t&&this.items.findItem(t);if(i){const e=this.items.getTagChildren(i);if(!gt(this.alerts,e,n))return;await this.mutator.setTagParent(i,n)}else{const e=ft(this.items);if(!gt(this.alerts,e,n))return;await this.mutator.unsetTagParent(n)}await this.sync.sync()}get rootTags(){return this.tags.filter((e=>!this.items.getDisplayableTagParent(e)))}get tagsCount(){return this.tags.length}setAllNotesCount(e){this.allNotesCount_=e}setAllFilesCount(e){this.allFilesCount_=e}get allFilesCount(){return this.allFilesCount_}get allNotesCount(){return this.allNotesCount_}get previouslySelected(){return this.previouslySelected_}get selected(){return this.selected_}async setPanelWidthForTag(e,t){await this._changeAndSaveItem.execute(e,(e=>{e.preferences=At(At({},e.preferences),{},{panelWidth:t})}))}async setSelectedTag(e,t){let{userTriggered:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{userTriggered:!1};e&&e.conflictOf&&this._changeAndSaveItem.execute(e,(e=>{e.conflictOf=void 0})).catch(console.error),e&&(this.isTagFilesView(e)||this.tagUsesTableView(e))?this.paneController.setPaneLayout(mt.h.TableView):n&&this.paneController.setPaneLayout(mt.h.ItemSelection),this.previouslySelected_=this.selected_,await(0,_.z)((async()=>{this.setSelectedTagInstance(e),this.selectedLocation=t,e&&this.items.isTemplateItem(e)||await this.eventBus.publishSync({type:qe.TagChanged,payload:{tag:e,previousTag:this.previouslySelected_,userTriggered:n}},r.InternalEventPublishStrategy.SEQUENCE)}))}async selectHomeNavigationView(){await this.setSelectedTag(this.homeNavigationView,"views")}async selectFilesView(){await this.setSelectedTag(this.filesNavigationView,"views")}get homeNavigationView(){return this.smartViews[0]}get filesNavigationView(){return this.smartViews.find(this.isTagFilesView)}setSelectedTagInstance(e){(0,_.z)((()=>{this.selected_=e,this.selectedUuid=e?e.uuid:void 0}))}setExpanded(e,t){e.expanded!==t&&this._changeAndSaveItem.execute(e,(e=>{e.expanded=t})).catch(console.error)}async setFavorite(e,t){return this._changeAndSaveItem.execute(e,(e=>{e.starred=t})).catch(console.error)}setIcon(e,t){this._changeAndSaveItem.execute(e,(e=>{e.iconString=t})).catch(console.error)}get editingTag(){return this.editing_}setEditingTag(e){(0,_.z)((()=>{this.editing_=e,this.selected!==e&&this.setSelectedTag(e,this.selectedLocation||"all")}))}createNewTemplate(){if(this.editing_&&this.items.isTemplateItem(this.editing_))return;const e=this.items.createTemplateItem(r.ContentType.TYPES.Tag);(0,_.z)((()=>{this.selectedLocation="all",this.editing_=e}))}undoCreateNewTag(){this.editing_=void 0;const e=this.previouslySelected_||this.smartViews[0];this.setSelectedTag(e,this.selectedLocation||"views")}async remove(e,t){let n=!t;t&&(n=await(0,L.VG)({title:'Delete tag "'.concat(e.title,'"?'),text:ht.$n,confirmButtonStyle:"danger"})),n&&(this.mutator.deleteItem(e).then((()=>this.sync.sync())).catch(console.error),await this.setSelectedTag(this.smartViews[0],"views"))}async save(e,t){const n=this.items.isTemplateItem(e),i=n?e:this.items.findSureItem(e.uuid),o=0===t.length,s=t===i.title,a=i instanceof r.SNTag?((e,t)=>{const n=e=>e.filter((e=>e.uuid!==t.uuid)),r=!e.isTemplateItem(t)&&e.getTagParent(t);return n(r?e.getTagChildren(r):ft(e))})(this.items,i):[],l=a.some((e=>e.title.toLowerCase()===t.toLowerCase()));if((0,_.z)((()=>{this.editing_=void 0})),o||s)n&&this.undoCreateNewTag();else{if(l)return n&&this.undoCreateNewTag(),void this.alerts.alert("A tag with this name already exists.").catch(console.error);if(n){if(this.items.isSmartViewTitle(t)&&!this.featuresController.hasSmartViews)return void await this.featuresController.showPremiumAlert(pt.t2);const e=await this.mutator.createTagOrSmartView(t,this.vaultDisplayService.exclusivelyShownVault);this.sync.sync().catch(console.error),(0,_.z)((()=>{this.setSelectedTag(e,this.selectedLocation||"views")}))}else await this._changeAndSaveItem.execute(i,(e=>{e.title=t}))}}get isSearching(){return this.searchQuery.length>0}}class St extends De.L{constructor(e,t,n,i,o,s,a,l,c,u,d,h,p){super(p),this.itemListController=e,this.navigationController=t,this.itemControllerGroup=n,this.keyboardService=i,this.preferences=o,this.items=s,this.mutator=a,this.sync=l,this.protections=c,this.alerts=u,this._isGlobalSpellcheckEnabled=d,this._getItemTags=h,this.contextMenuOpen=!1,this.contextMenuClickLocation={x:0,y:0},this.contextMenuMaxHeight="auto",this.showProtectedWarning=!1,this.setContextMenuOpen=e=>{this.contextMenuOpen=e},(0,_.rC)(this,{contextMenuOpen:_.LO,showProtectedWarning:_.LO,selectedNotes:_.Fl,firstSelectedNote:_.Fl,selectedNotesCount:_.Fl,trashedNotesCount:_.Fl,setContextMenuOpen:_.aD,setContextMenuClickLocation:_.aD,setShowProtectedWarning:_.aD,unselectNotes:_.aD}),this.shouldLinkToParentFolders=o.getValue(r.PrefKey.NoteAddToParentFolders,r.PrefDefaults[r.PrefKey.NoteAddToParentFolders]),p.addEventHandler(this,r.ApplicationEvent.PreferencesChanged),p.addEventHandler(this,qe.UnselectAllNotes),this.disposers.push(this.keyboardService.addCommandHandler({command:L.Ib,category:"Current note",description:"Pin current note",onKeyDown:()=>{this.togglePinSelectedNotes()}}),this.keyboardService.addCommandHandler({command:L.Ak,category:"Current note",description:"Star current note",onKeyDown:()=>{this.toggleStarSelectedNotes()}})),this.disposers.push(this.itemControllerGroup.addActiveControllerChangeObserver((()=>{const e=this.itemControllerGroup.itemControllers.map((e=>e.item.uuid)),t=this.getSelectedNotesList().map((e=>e.uuid));for(const n of t)e.includes(n)||this.itemListController.deselectItem({uuid:n})})))}async handleEvent(e){e.type===r.ApplicationEvent.PreferencesChanged?this.shouldLinkToParentFolders=this.preferences.getValue(r.PrefKey.NoteAddToParentFolders,r.PrefDefaults[r.PrefKey.NoteAddToParentFolders]):e.type===qe.UnselectAllNotes&&this.unselectNotes()}deinit(){super.deinit(),this.lastSelectedNote=void 0,this.itemListController=void 0,this.navigationController=void 0,(0,t.h6)(this)}get selectedNotes(){return this.itemListController.getFilteredSelectedItems(r.ContentType.TYPES.Note)}get firstSelectedNote(){return Object.values(this.selectedNotes)[0]}get selectedNotesCount(){return this.dealloced?0:Object.keys(this.selectedNotes).length}get trashedNotesCount(){return this.items.trashedItems.length}setContextMenuClickLocation(e){this.contextMenuClickLocation=e}async changeSelectedNotes(e){await this.mutator.changeItems(this.getSelectedNotesList(),e,r.MutationType.NoUpdateUserTimestamps),this.sync.sync().catch(console.error)}setHideSelectedNotePreviews(e){this.changeSelectedNotes((t=>{t.hidePreview=e})).catch(console.error)}setLockSelectedNotes(e){this.changeSelectedNotes((t=>{t.locked=e})).catch(console.error)}async setTrashSelectedNotes(e){e?await this.deleteNotes(!1)&&(0,_.z)((()=>{this.contextMenuOpen=!1})):(await this.changeSelectedNotes((t=>{t.trashed=e})),(0,_.z)((()=>{this.contextMenuOpen=!1})))}async deleteNotesPermanently(){await this.deleteNotes(!0)}async deleteNotes(e){if(this.getSelectedNotesList().some((e=>e.locked))){const e=ht.xZ.deleteLockedNotesAttempt(this.selectedNotesCount);return this.alerts.alert(e).catch(console.error),!1}const t=e?ht.eI.deleteItemsPermanentlyTitle:ht.eI.trashItemsTitle;let n;if(1===this.selectedNotesCount){const e=this.getSelectedNotesList()[0];n=e.title.length?"'".concat(e.title,"'"):"this note"}const r=ht.xZ.deleteNotes(e,this.selectedNotesCount,n);return!!await(0,L.VG)({title:t,text:r,confirmButtonStyle:"danger"})&&(this.itemListController.selectNextItem(),e?(await this.mutator.deleteItems(this.getSelectedNotesList()),this.sync.sync()):await this.changeSelectedNotes((e=>{e.trashed=!0})),!0)}togglePinSelectedNotes(){this.selectedNotes.some((e=>e.pinned))?this.setPinSelectedNotes(!1):this.setPinSelectedNotes(!0)}toggleStarSelectedNotes(){this.selectedNotes.some((e=>e.starred))?this.setStarSelectedNotes(!1):this.setStarSelectedNotes(!0)}setPinSelectedNotes(e){this.changeSelectedNotes((t=>{t.pinned=e})).catch(console.error)}setStarSelectedNotes(e){this.changeSelectedNotes((t=>{t.starred=e})).catch(console.error)}async setArchiveSelectedNotes(e){this.getSelectedNotesList().some((e=>e.locked))?this.alerts.alert(ht.xZ.archiveLockedNotesAttempt(e,this.selectedNotesCount)).catch(console.error):(await this.changeSelectedNotes((t=>{t.archived=e})),(0,_.z)((()=>{this.itemListController.deselectAll(),this.contextMenuOpen=!1})))}async toggleArchiveSelectedNotes(){this.selectedNotes.some((e=>e.archived))?await this.setArchiveSelectedNotes(!1):await this.setArchiveSelectedNotes(!0)}async setProtectSelectedNotes(e){const t=this.getSelectedNotesList();e?(await this.protections.protectNotes(t),this.setShowProtectedWarning(!0)):(await this.protections.unprotectNotes(t),this.setShowProtectedWarning(!1)),this.sync.sync()}unselectNotes(){this.itemListController.deselectAll()}getSpellcheckStateForNote(e){return null!=e.spellcheck?e.spellcheck:this._isGlobalSpellcheckEnabled.execute().getValue()}async toggleGlobalSpellcheckForNote(e){await this.mutator.changeItem(e,(e=>{e.toggleSpellcheck()}),r.MutationType.NoUpdateUserTimestamps),this.sync.sync().catch(console.error)}getEditorWidthForNote(e){var t;return null!==(t=e.editorWidth)&&void 0!==t?t:this.preferences.getLocalValue(r.LocalPrefKey.EditorLineWidth,r.PrefDefaults[r.LocalPrefKey.EditorLineWidth])}async setNoteEditorWidth(e,t){await this.mutator.changeItem(e,(e=>{e.editorWidth=t}),r.MutationType.NoUpdateUserTimestamps),this.sync.sync().catch(console.error)}async addTagToSelectedNotes(e){const t=this.getSelectedNotesList();await Promise.all(t.map((async t=>{await this.mutator.addTagToNote(t,e,this.shouldLinkToParentFolders)}))),this.sync.sync().catch(console.error)}async removeTagFromSelectedNotes(e){const t=this.getSelectedNotesList();await this.mutator.changeItem(e,(e=>{for(const n of t)e.removeItemAsRelationship(n)})),this.sync.sync().catch(console.error)}isTagInSelectedNotes(e){return this.getSelectedNotesList().every((t=>this._getItemTags.execute(t).getValue().find((t=>t.uuid===e.uuid))))}setShowProtectedWarning(e){this.showProtectedWarning=e}async emptyTrash(){await(0,L.VG)({text:(0,ht.Sq)(this.trashedNotesCount),confirmButtonStyle:"danger"})&&(await this.mutator.emptyTrash(),this.sync.sync().catch(console.error))}getSelectedNotesList(){return Object.values(this.selectedNotes)}}var Ct,Et=s(84409),It=s(22325),_t=s(82648),xt=s(61659);function Pt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function kt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Bt{constructor(e,t,n,r,i,o,s,a,l,c){this.items=t,this.mutator=n,this.sync=r,this.sessions=i,this.preferences=o,this.components=s,this.alerts=a,this._isNativeMobileWeb=l,this.templateNoteOptions=c,this.dealloced=!1,this.isTemplateNote=!1,this.runtimeId="".concat(Math.random()),this.needsInit=!0,this.innerValueChangeObservers=[],this.disposers=[],e&&(this.item=e),c&&(this.defaultTagUuid=c.tag),this.defaultTagUuid&&(this.defaultTag=this.items.findItem(this.defaultTagUuid)),this.syncController=new xt.I(this.item,this.items,this.mutator,this.sessions,this.sync,this.alerts,this._isNativeMobileWeb)}deinit(){this.syncController.savingLocallyPromise?this.syncController.savingLocallyPromise.promise.then((()=>{this.performDeinitSafely()})):this.performDeinitSafely()}performDeinitSafely(){this.dealloced=!0;for(const e of this.disposers)e();this.disposers.length=0,this.innerValueChangeObservers.length=0}async initialize(){var e,t,n;if(!this.needsInit)throw Error("NoteViewController already initialized");V(R.NoteView,"Initializing NoteViewController"),this.needsInit=!1;const r=this.preferences.getValue(It.PrefKey.NoteAddToParentFolders,!0);if(!this.item){V(R.NoteView,"Initializing as template note");const i=this.components.getDefaultEditorIdentifier(this.defaultTag),o=(0,Et.noteTypeForEditorIdentifier)(i),s=this.items.createTemplateItem(_t.ContentType.TYPES.Note,{text:"",title:(null===(e=this.templateNoteOptions)||void 0===e?void 0:e.title)||"",noteType:o,editorIdentifier:i,references:[]},function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pt(Object(n),!0).forEach((function(t){kt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({created_at:(null===(t=this.templateNoteOptions)||void 0===t?void 0:t.createdAt)||new Date},(0,It.PayloadVaultOverrides)(null===(n=this.templateNoteOptions)||void 0===n?void 0:n.vault)));if(this.isTemplateNote=!0,this.item=s,this.syncController.setItem(this.item),this.defaultTagUuid){const e=this.items.findItem(this.defaultTagUuid);await this.mutator.addTagToNote(s,e,r)}this.notifyObservers(this.item,It.PayloadEmitSource.InitialObserverRegistrationPush)}this.streamItems()}notifyObservers(e,t){for(const n of this.innerValueChangeObservers)n(e,t)}streamItems(){this.dealloced||this.disposers.push(this.items.streamItems(_t.ContentType.TYPES.Note,(e=>{let{changed:t,inserted:n,source:r}=e;if(this.dealloced)return;const i=t.concat(n).find((e=>e.uuid===this.item.uuid));i&&(this.isTemplateNote=!1,this.item=i,this.notifyObservers(i,r))})))}insertTemplatedNote(){return V(R.NoteView,"Inserting template note"),this.isTemplateNote=!1,this.mutator.insertItem(this.item)}addNoteInnerValueChangeObserver(e){this.innerValueChangeObservers.push(e),this.item&&e(this.item,It.PayloadEmitSource.InitialObserverRegistrationPush);const t=this.innerValueChangeObservers;return()=>{(0,Q.removeFromArray)(t,e)}}async saveAndAwaitLocalPropagation(e){if(this.needsInit)throw Error("NoteViewController not initialized");V(R.NoteView,"Saving note",e),this.isTemplateNote&&await this.insertTemplatedNote(),await this.syncController.saveAndAwaitLocalPropagation(e)}get syncStatus(){return this.syncController.status}showSavingStatus(){this.syncController.showSavingStatus()}showAllChangesSavedStatus(){this.syncController.showAllChangesSavedStatus()}showErrorSyncStatus(e){this.syncController.showErrorStatus(e)}syncNow(){this.sync.sync().catch(console.error)}syncOnlyIfLargeNote(){this.syncController.syncOnlyIfLargeNote()}}!function(e){e[e.ItemStream=0]="ItemStream",e[e.SyncEvent=1]="SyncEvent",e[e.DisplayOptionsChange=2]="DisplayOptionsChange",e[e.Pagination=3]="Pagination",e[e.TagChange=4]="TagChange",e[e.UserTriggeredTagChange=5]="UserTriggeredTagChange",e[e.FilterTextChange=6]="FilterTextChange"}(Ct||(Ct={}));var Ot=s(28879),Nt=s.n(Ot),Dt=s(57449),jt=s.n(Dt),Tt=s(66653),Mt=s.n(Tt),Ft=s(10264),Rt=s.n(Ft),Lt=s(67338),Qt=s.n(Lt),Ut=s(42090),Vt=s.n(Ut),Kt=s(90742),Ht=s.n(Kt);function Gt(e,t){return Nt()(e).format(t)}Nt().extend(jt()),Nt().extend(Mt()),Nt().extend(Rt()),Nt().extend(Qt()),Nt().extend(Vt()),Nt().extend(Ht());const Yt=()=>{document.querySelectorAll('[role="dialog"], [data-popover]').forEach((e=>{"close"in e&&"function"==typeof e.close&&e.close()}))};class zt extends De.L{deinit(){super.deinit(),this.noteFilterText=void 0,this.notes=void 0,this.renderedItems=void 0,this.navigationController=void 0,this.searchOptionsController=void 0,window.onresize=void 0,(0,t.h6)(this)}constructor(e,n,i,o,s,a,l,c,u,d,h,p,f,g){var m;super(g),m=this,this.keyboardService=e,this.paneController=n,this.navigationController=i,this.searchOptionsController=o,this.itemManager=s,this.preferences=a,this.itemControllerGroup=l,this.vaultDisplayService=c,this.desktopManager=u,this.protections=d,this.options=h,this._isNativeMobileWeb=p,this._changeAndSaveItem=f,this.completedFullSync=!1,this.noteFilterText="",this.notes=[],this.items=[],this.notesToDisplay=0,this.pageSize=0,this.panelTitle="Notes",this.renderedItems=[],this.searchSubmitted=!1,this.showDisplayOptionsMenu=!1,this.displayOptions={sortBy:r.CollectionSort.CreatedAt,sortDirection:"dsc",includePinned:!0,includeArchived:!1,includeTrashed:!1,includeProtected:!0},this.webDisplayOptions={hideTags:!0,hideDate:!1,hideNotePreview:!1,hideEditorIcon:!1},this.isTableViewEnabled=!1,this.selectedUuids=(0,_.LO)(new Set),this.selectedItems={},this.isMultipleSelectionMode=!1,this.getPersistableValue=()=>({selectedUuids:Array.from(this.selectedUuids)}),this.hydrateFromPersistedValue=e=>{if(e&&!this.selectedUuids.size&&e.selectedUuids.length>0)if(this.options.allowNoteSelectionStatePersistence)this.selectUuids(e.selectedUuids);else{const t=this.itemManager.findItems(e.selectedUuids).filter((e=>!(0,r.isNote)(e)));this.selectUuids((0,r.Uuids)(t))}},this.setCompletedFullSync=e=>{this.completedFullSync=e},this.setShowDisplayOptionsMenu=e=>{this.showDisplayOptionsMenu=e},this.reloadPanelTitle=()=>{let e=this.panelTitle;if(this.isFiltering){const t=this.items.length;e="".concat(t," search results")}else this.navigationController.selected&&(e="".concat(this.navigationController.selected.title));this.panelTitle=e},this.reloadItems=async e=>{this.reloadItemsPromise&&await this.reloadItemsPromise,this.reloadItemsPromise=this.performReloadItems(e),await this.reloadItemsPromise},this.shouldLeaveSelectionUnchanged=e=>e instanceof Bt&&e.isTemplateNote,this.shouldCloseActiveItem=(e,t)=>{if(t===Ct.UserTriggeredTagChange)return V(R.Selection,"shouldCloseActiveItem true due to ItemsReloadSource.UserTriggeredTagChange"),!0;const n=this.items.find((t=>t.uuid===(null==e?void 0:e.uuid)));if(e&&(0,r.isFile)(e)&&!n)return V(R.Selection,"shouldCloseActiveItem closeBecauseActiveItemIsFileAndDoesntExistInUpdatedResults"),!0;const i=this.getFirstNonProtectedItem();if(i&&(0,r.isFile)(i)&&!n)return V(R.Selection,"shouldCloseActiveItem closePreviousItemWhenSwitchingToFilesBasedView"),!0;const o=this.noteFilterText.length>0;return n||o||!this.navigationController.isInAnySystemView()?(V(R.Selection,"shouldCloseActiveItem false"),!1):(V(R.Selection,"shouldCloseActiveItem closePreviousItemWhenSwitchingToFilesBasedView"),!0)},this.shouldSelectNextItemOrCreateNewNote=e=>{const t=this.navigationController.selected,n=null==e?void 0:e.trashed,i=null==e?void 0:e.archived;if(n){const e=t instanceof r.SmartView&&t.predicate.keypathIncludesString("trashed");return!(this.navigationController.isInSystemView(r.SystemViewId.TrashedNotes)||this.searchOptionsController.includeTrashed||e||this.displayOptions.includeTrashed)}if(i){const e=t instanceof r.SmartView&&t.predicate.keypathIncludesString("archived");return!(this.navigationController.isInSystemView(r.SystemViewId.ArchivedNotes)||this.searchOptionsController.includeArchived||e||this.displayOptions.includeArchived)}return!1},this.shouldSelectActiveItem=e=>!this.isItemSelected(e),this.shouldSelectFirstItem=e=>{if(this._isNativeMobileWeb.execute().getValue())return!1;const t=this.getFirstNonProtectedItem();if(t&&(0,r.isFile)(t))return!1;const n=this.navigationController.selected;if(n&&(0,r.isTag)(n)&&n.isDailyEntry)return!1;const i=e===Ct.UserTriggeredTagChange,o=!this.selectedUuids.size;return i||o},this.reloadNotesDisplayOptions=()=>{var e,t;const n=this.navigationController.selected,i=this.noteFilterText.toLowerCase();let o,s;i.length?(o=this.searchOptionsController.includeArchived,s=this.searchOptionsController.includeTrashed):(o=null!==(e=this.displayOptions.includeArchived)&&void 0!==e&&e,s=null!==(t=this.displayOptions.includeTrashed)&&void 0!==t&&t);const a={sortBy:this.displayOptions.sortBy,sortDirection:this.displayOptions.sortDirection,tags:n instanceof r.SNTag?[n]:[],views:n instanceof r.SmartView?[n]:[],includeArchived:o,includeTrashed:s,includePinned:this.displayOptions.includePinned,includeProtected:this.displayOptions.includeProtected,searchQuery:{query:i,includeProtectedNoteText:this.searchOptionsController.includeProtectedContents}};this.itemManager.setPrimaryItemDisplayOptions(a)},this.reloadDisplayPreferences=async e=>{let{userTriggered:t}=e;var n;const i={},o={},s=this.navigationController.selected,a=s&&(0,r.isSmartView)(s)&&(0,r.isSystemView)(s)?null===(n=this.preferences.getValue(r.PrefKey.SystemViewPreferences))||void 0===n?void 0:n[s.uuid]:null==s?void 0:s.preferences;this.isTableViewEnabled=Boolean(null==a?void 0:a.useTableView);const l=this.displayOptions.sortBy;let c=(null==a?void 0:a.sortBy)||this.preferences.getValue(r.PrefKey.SortNotesBy,r.PrefDefaults[r.PrefKey.SortNotesBy]);c!==r.CollectionSort.UpdatedAt&&"client_updated_at"!==c||(c=r.CollectionSort.UpdatedAt),i.sortBy=c;const u=this.displayOptions.sortDirection;i.sortDirection=!1===(0,r.useBoolean)(null==a?void 0:a.sortReverse,this.preferences.getValue(r.PrefKey.SortNotesReverse,r.PrefDefaults[r.PrefKey.SortNotesReverse]))?"dsc":"asc",i.includeArchived=(0,r.useBoolean)(null==a?void 0:a.showArchived,this.preferences.getValue(r.PrefKey.NotesShowArchived,r.PrefDefaults[r.PrefKey.NotesShowArchived])),i.includeTrashed=(0,r.useBoolean)(null==a?void 0:a.showTrashed,this.preferences.getValue(r.PrefKey.NotesShowTrashed,r.PrefDefaults[r.PrefKey.NotesShowTrashed])),i.includePinned=!(0,r.useBoolean)(null==a?void 0:a.hidePinned,this.preferences.getValue(r.PrefKey.NotesHidePinned,r.PrefDefaults[r.PrefKey.NotesHidePinned])),i.includeProtected=!(0,r.useBoolean)(null==a?void 0:a.hideProtected,this.preferences.getValue(r.PrefKey.NotesHideProtected,r.PrefDefaults[r.PrefKey.NotesHideProtected])),o.hideNotePreview=(0,r.useBoolean)(null==a?void 0:a.hideNotePreview,this.preferences.getValue(r.PrefKey.NotesHideNotePreview,r.PrefDefaults[r.PrefKey.NotesHideNotePreview])),o.hideDate=(0,r.useBoolean)(null==a?void 0:a.hideDate,this.preferences.getValue(r.PrefKey.NotesHideDate,r.PrefDefaults[r.PrefKey.NotesHideDate])),o.hideTags=(0,r.useBoolean)(null==a?void 0:a.hideTags,this.preferences.getValue(r.PrefKey.NotesHideTags,r.PrefDefaults[r.PrefKey.NotesHideTags])),o.hideEditorIcon=(0,r.useBoolean)(null==a?void 0:a.hideEditorIcon,this.preferences.getValue(r.PrefKey.NotesHideEditorIcon,r.PrefDefaults[r.PrefKey.NotesHideEditorIcon]));const d=i.sortBy!==this.displayOptions.sortBy||i.sortDirection!==this.displayOptions.sortDirection||i.includePinned!==this.displayOptions.includePinned||i.includeArchived!==this.displayOptions.includeArchived||i.includeTrashed!==this.displayOptions.includeTrashed||i.includeProtected!==this.displayOptions.includeProtected||o.hideNotePreview!==this.webDisplayOptions.hideNotePreview||o.hideDate!==this.webDisplayOptions.hideDate||o.hideEditorIcon!==this.webDisplayOptions.hideEditorIcon||o.hideTags!==this.webDisplayOptions.hideTags;if(this.displayOptions=i,this.webDisplayOptions=o,!d)return{didReloadItems:!1};this.reloadNotesDisplayOptions(),await this.reloadItems(t?Ct.UserTriggeredTagChange:Ct.DisplayOptionsChange);const h=l!==this.displayOptions.sortBy,p=u!==this.displayOptions.sortDirection;return(h||p)&&this.shouldSelectFirstItem(Ct.DisplayOptionsChange)&&await this.selectFirstItem(),{didReloadItems:!0}},this.titleForNewNote=e=>{var t,n,i;if(this.isFiltering)return this.noteFilterText;const o=this.navigationController.selected,s=o&&(0,r.isSmartView)(o)&&(0,r.isSystemView)(o)?null===(t=this.preferences.getValue(r.PrefKey.SystemViewPreferences))||void 0===t?void 0:t[o.uuid]:null==o?void 0:o.preferences,a=(null==s?void 0:s.newNoteTitleFormat)||this.preferences.getValue(r.PrefKey.NewNoteTitleFormat,r.PrefDefaults[r.PrefKey.NewNoteTitleFormat]);if(a===r.NewNoteTitleFormat.CurrentNoteCount)return"Note ".concat(this.notes.length+1);if(a===r.NewNoteTitleFormat.CustomFormat){const t=(null===(i=null===(n=this.navigationController.selected)||void 0===n?void 0:n.preferences)||void 0===i?void 0:i.customNoteTitleFormat)||this.preferences.getValue(r.PrefKey.CustomNoteTitleFormat,r.PrefDefaults[r.PrefKey.CustomNoteTitleFormat]);try{return Gt(e,t)}catch(t){return console.error(t),(0,je.AF)(e||new Date)}}return a===r.NewNoteTitleFormat.Empty?"":(0,je.AF)(e||new Date)},this.createNewNote=async(e,t,n)=>{this.publishCrossControllerEventSync(qe.UnselectAllNotes),this.navigationController.isInSmartView()&&!this.navigationController.isInHomeView()&&await this.navigationController.selectHomeNavigationView();const r=e||this.titleForNewNote(t),i=await this.createNewNoteController(r,t,n);this.scrollToItem(i.item)},this.createPlaceholderNote=()=>{if(!this.navigationController.isInSmartView()||this.navigationController.isInHomeView())return this.createNewNote()},this.paginate=()=>{var e;this.notesToDisplay+=this.pageSize,this.reloadItems(Ct.Pagination),this.searchSubmitted&&(null===(e=this.desktopManager)||void 0===e||e.searchText(this.noteFilterText))},this.resetPagination=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=document.documentElement.clientHeight;m.pageSize=Math.ceil(t/51),0===m.pageSize&&(m.pageSize=20),e&&m.notesToDisplay>m.pageSize||(m.notesToDisplay=m.pageSize)},this.getFirstNonProtectedItem=()=>this.items.find((e=>!e.protected)),this.selectFirstItem=async()=>{const e=this.getFirstNonProtectedItem();this.isTableViewEnabled&&!(0,t.Av)()||e&&(V(R.Selection,"Selecting first item",e.uuid),await this.selectItemWithScrollHandling(e,{userTriggered:!1,scrollIntoView:!1}),this.resetScrollPosition())},this.selectNextItemOrCreateNewNote=async()=>{const e=this.getFirstNonProtectedItem();e?(V(R.Selection,"selectNextItemOrCreateNewNote"),await this.selectItemWithScrollHandling(e,{userTriggered:!1,scrollIntoView:!1}).catch(console.error)):await this.createNewNote()},this.setNoteFilterText=e=>{e!==this.noteFilterText&&(this.noteFilterText=e,this.handleFilterTextChanged())},this.handleEditorChange=async()=>{var e,t;const n=null===(e=this.itemControllerGroup.activeItemViewController)||void 0===e?void 0:e.item;n&&n.conflictOf&&this._changeAndSaveItem.execute(n,(e=>{e.conflictOf=void 0})),this.isFiltering&&(null===(t=this.desktopManager)||void 0===t||t.searchText(this.noteFilterText))},this.resetScrollPosition=()=>{this.notesListScrollContainer&&(this.notesListScrollContainer.scrollTop=0,this.notesListScrollContainer.scrollLeft=0)},this.handleTagChange=async e=>{var t;const n=this.getActiveItemController();n instanceof Bt&&n.isTemplateNote&&this.closeItemController(n),this.resetScrollPosition(),this.setShowDisplayOptionsMenu(!1),this.setNoteFilterText(""),null===(t=this.desktopManager)||void 0===t||t.searchText(),this.resetPagination();const{didReloadItems:r}=await this.reloadDisplayPreferences({userTriggered:e});r||(this.reloadNotesDisplayOptions(),this.reloadItems(e?Ct.UserTriggeredTagChange:Ct.TagChange))},this.onFilterEnter=()=>{var e;this.searchSubmitted=!0,null===(e=this.desktopManager)||void 0===e||e.searchText(this.noteFilterText)},this.handleFilterTextChanged=()=>{this.searchSubmitted&&(this.searchSubmitted=!1),this.reloadNotesDisplayOptions(),this.reloadItems(Ct.FilterTextChange)},this.clearFilterText=()=>{this.setNoteFilterText(""),this.onFilterEnter(),this.handleFilterTextChanged(),this.resetPagination()},this.getSelectedItems=()=>Array.from(this.selectedUuids).map((e=>this.itemManager.findSureItem(e))).filter((e=>!!e)),this.getFilteredSelectedItems=e=>Object.values(this.selectedItems).filter((t=>!e||t.content_type===e)),this.setSelectedItems=()=>{this.selectedItems=Object.fromEntries(this.getSelectedItems().map((e=>[e.uuid,e])))},this.setSelectedUuids=e=>{V(R.Selection,"Setting selected uuids",e),this.selectedUuids=new Set(e),this.setSelectedItems()},this.removeSelectedItem=e=>{this.selectedUuids.delete(e),this.setSelectedUuids(this.selectedUuids),delete this.selectedItems[e]},this.deselectItem=e=>{var t;V(R.Selection,"Deselecting item",e.uuid),this.removeSelectedItem(e.uuid),e.uuid===(null===(t=this.lastSelectedItem)||void 0===t?void 0:t.uuid)&&(this.lastSelectedItem=void 0)},this.isItemSelected=e=>this.selectedUuids.has(e.uuid),this.selectItemsRange=async e=>{let{selectedItem:t,startingIndex:n,endingIndex:i}=e;const o=this.renderedItems,s=null!=n?n:o.findIndex((e=>{var t;return e.uuid==(null===(t=this.lastSelectedItem)||void 0===t?void 0:t.uuid)})),a=null!=i?i:o.findIndex((e=>e.uuid==(null==t?void 0:t.uuid)));let l=[];l=a>s?o.slice(s,a+1):o.slice(a,s+1);const c=await this.protections.authorizeProtectedActionForItems(l,r.ChallengeReason.SelectProtectedNote);for(const e of c)(0,_.z)((()=>{this.setSelectedUuids(this.selectedUuids.add(e.uuid)),this.lastSelectedItem=e,this.selectedItemsCount>1&&!this.isMultipleSelectionMode&&this.enableMultipleSelectionMode()}))},this.cancelMultipleSelection=()=>{this.keyboardService.cancelAllKeyboardModifiers(),this.isMultipleSelectionMode=!1;const e=this.firstSelectedItem;e?this.replaceSelection(e):this.deselectAll()},this.replaceSelection=e=>{this.deselectAll(),(0,_.z)((()=>this.setSelectedUuids(this.selectedUuids.add(e.uuid)))),this.lastSelectedItem=e},this.selectAll=()=>{const e=this.items.filter((e=>!e.protected)),t=e[e.length-1];this.setSelectedUuids(new Set((0,r.Uuids)(e))),this.lastSelectedItem=t,this.enableMultipleSelectionMode()},this.deselectAll=()=>{this.selectedUuids.clear(),this.setSelectedUuids(this.selectedUuids),this.lastSelectedItem=void 0},this.openSingleSelectedItem=async function(){let{userTriggered:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{userTriggered:!0};if(1===m.selectedItemsCount){const t=m.firstSelectedItem;t.content_type===r.ContentType.TYPES.Note?await m.openNote(t.uuid):t.content_type===r.ContentType.TYPES.File&&await m.openFile(t.uuid),m.paneController.isInMobileView&&!e||m.paneController.setPaneLayout(mt.h.Editing),m.paneController.isInMobileView&&e&&Yt()}},this.enableMultipleSelectionMode=()=>{this.isMultipleSelectionMode=!0},this.selectItem=async(e,n)=>{const i=this.itemManager.findItem(e);if(!i)return{didSelect:!1};V(R.Selection,"Select item",i.uuid);const o=this.keyboardService.activeModifiers.has(r.KeyboardModifier.Shift),s=this.selectedItemsCount>1,a=await this.protections.authorizeItemAccess(i);return n&&o&&!(0,t.Av)()?await this.selectItemsRange({selectedItem:i}):n&&this.isMultipleSelectionMode?this.selectedUuids.has(e)&&s?this.removeSelectedItem(e):a&&(this.selectedUuids.add(e),this.setSelectedUuids(this.selectedUuids),this.lastSelectedItem=i):(s||!this.selectedUuids.has(e))&&a&&(this.replaceSelection(i),await this.openSingleSelectedItem({userTriggered:null!=n&&n})),{didSelect:this.selectedUuids.has(e)}},this.selectItemWithScrollHandling=async(e,n)=>{let{userTriggered:r=!1,scrollIntoView:i=!0,animated:o=!0}=n;const{didSelect:s}=await this.selectItem(e.uuid,r),a=(0,t.Av)();s&&i&&!a&&this.scrollToItem(e,o)},this.scrollToItem=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=document.getElementById(e.uuid);null==n||n.scrollIntoView({behavior:t?"smooth":"auto"})},this.selectUuids=async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=m.itemManager.findItems(e).filter((e=>!(0,r.isFile)(e)));n.length<1||!t&&n.some((e=>e.protected&&(0,r.isFile)(e)))||(m.setSelectedUuids(new Set((0,r.Uuids)(n))),1===n.length&&m.openSingleSelectedItem({userTriggered:t}))},this.selectNextItem=function(){let{userTriggered:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{userTriggered:!0};const t=m.items;let n=t.findIndex((e=>{var t;return e.uuid===(null===(t=m.lastSelectedItem)||void 0===t?void 0:t.uuid)}))+1;for(;n<t.length;){const r=t[n];if(n++,r.protected)continue;m.selectItemWithScrollHandling(r,{userTriggered:e}).catch(console.error);const i=document.getElementById(r.uuid);return void(null==i||i.focus())}},this.selectPreviousItem=()=>{const e=this.items;if(!this.lastSelectedItem)return;let t=e.indexOf(this.lastSelectedItem)-1;for(;t>=0;){const n=e[t];if(t--,n.protected)continue;this.selectItemWithScrollHandling(n,{userTriggered:!0}).catch(console.error);const r=document.getElementById(n.uuid);return void(null==r||r.focus())}},(0,_.rC)(this,{completedFullSync:_.LO,displayOptions:_.LO.struct,webDisplayOptions:_.LO.struct,noteFilterText:_.LO,notes:_.LO,notesToDisplay:_.LO,panelTitle:_.LO,items:_.LO,renderedItems:_.LO,showDisplayOptionsMenu:_.LO,reloadItems:_.aD,reloadPanelTitle:_.aD,reloadDisplayPreferences:_.aD,resetPagination:_.aD,setCompletedFullSync:_.aD,setNoteFilterText:_.aD,setShowDisplayOptionsMenu:_.aD,onFilterEnter:_.aD,handleFilterTextChanged:_.aD,optionsSubtitle:_.Fl,activeControllerItem:_.Fl,selectedUuids:_.LO,selectedItems:_.LO,selectedItemsCount:_.Fl,selectedFiles:_.Fl,selectedFilesCount:_.Fl,firstSelectedItem:_.Fl,selectItem:_.aD,setSelectedUuids:_.aD,setSelectedItems:_.aD,hydrateFromPersistedValue:_.aD,isMultipleSelectionMode:_.LO,enableMultipleSelectionMode:_.aD,cancelMultipleSelection:_.aD}),g.addEventHandler(this,qe.TagChanged),g.addEventHandler(this,qe.ActiveEditorChanged),g.addEventHandler(this,L.FJ.VaultDisplayOptionsChanged),this.resetPagination(),this.disposers.push(s.streamItems([r.ContentType.TYPES.Note,r.ContentType.TYPES.File],(()=>{this.reloadItems(Ct.ItemStream)}))),this.disposers.push(s.streamItems([r.ContentType.TYPES.Tag,r.ContentType.TYPES.SmartView],(async e=>{let{changed:t,inserted:n}=e;const i=[...t,...n],{didReloadItems:o}=await this.reloadDisplayPreferences({userTriggered:!1});o||(this.reloadNotesDisplayOptions(),this.reloadItems(Ct.ItemStream)),this.navigationController.selected&&(0,r.findInArray)(i,"uuid",this.navigationController.selected.uuid)&&this.reloadPanelTitle()}))),g.addEventHandler(this,r.ApplicationEvent.PreferencesChanged),g.addEventHandler(this,r.ApplicationEvent.SignedIn),g.addEventHandler(this,r.ApplicationEvent.CompletedFullSync),g.addEventHandler(this,r.WebAppEvent.EditorDidFocus),this.disposers.push((0,_.U5)((()=>[this.searchOptionsController.includeProtectedContents,this.searchOptionsController.includeArchived,this.searchOptionsController.includeTrashed]),(()=>{this.reloadNotesDisplayOptions(),this.reloadItems(Ct.DisplayOptionsChange)}))),this.disposers.push((0,_.U5)((()=>this.selectedUuids),(()=>{g.publish({type:qe.RequestValuePersistence,payload:void 0})}))),this.disposers.push(this.itemManager.streamItems([r.ContentType.TYPES.Note,r.ContentType.TYPES.File],(e=>{let{changed:t,inserted:n,removed:r}=e;(0,_.z)((()=>{for(const e of r)this.removeSelectedItem(e.uuid);for(const e of[...t,...n])this.selectedItems[e.uuid]&&(this.selectedItems[e.uuid]=e)}))}))),this.disposers.push((0,_.U5)((()=>this.selectedItemsCount),((e,t)=>{(0===e||t>e&&1===e)&&this.cancelMultipleSelection()}))),window.onresize=(0,t.Ds)((()=>{this.resetPagination(!0)}),100)}async handleEvent(e){switch(e.type){case qe.TagChanged:{const t=e.payload;await this.handleTagChange(t.userTriggered);break}case qe.ActiveEditorChanged:await this.handleEditorChange();break;case L.FJ.VaultDisplayOptionsChanged:this.reloadItems(Ct.DisplayOptionsChange);break;case r.ApplicationEvent.PreferencesChanged:this.reloadDisplayPreferences({userTriggered:!1});break;case r.WebAppEvent.EditorDidFocus:this.setShowDisplayOptionsMenu(!1);break;case r.ApplicationEvent.SignedIn:this.itemControllerGroup.closeAllItemControllers(),this.selectFirstItem(),this.setCompletedFullSync(!1);break;case r.ApplicationEvent.CompletedFullSync:if(!this.completedFullSync){this.reloadItems(Ct.SyncEvent).then((()=>{var e;0===this.notes.length&&this.navigationController.selected instanceof r.SmartView&&this.navigationController.selected.uuid===r.SystemViewId.AllNotes&&""===this.noteFilterText&&!this.getActiveItemController()&&(null===(e=this.createPlaceholderNote())||void 0===e||e.catch(console.error))})),this.setCompletedFullSync(!0);break}}}get listLength(){return this.renderedItems.length}getActiveItemController(){return this.itemControllerGroup.activeItemViewController}get activeControllerItem(){var e;return null===(e=this.getActiveItemController())||void 0===e?void 0:e.item}async openNote(e){var t;if((null===(t=this.activeControllerItem)||void 0===t?void 0:t.uuid)===e)return;const n=this.itemManager.findItem(e);n?(await this.itemControllerGroup.createItemController({note:n}),await this.publishCrossControllerEventSync(qe.ActiveEditorChanged)):console.warn("Tried accessing a non-existant note of UUID "+e)}async openFile(e){var t;if((null===(t=this.getActiveItemController())||void 0===t?void 0:t.item.uuid)===e)return;const n=this.itemManager.findItem(e);n?await this.itemControllerGroup.createItemController({file:n}):console.warn("Tried accessing a non-existant file of UUID "+e)}get isFiltering(){return!!this.noteFilterText&&this.noteFilterText.length>0}async performReloadItems(e){if(!this.navigationController.selected)return;const t=this.itemManager.getDisplayableNotes(),n=this.itemManager.getDisplayableNotesAndFiles(),r=n.slice(0,this.notesToDisplay);(0,_.z)((()=>{this.notes=t,this.items=n,this.renderedItems=r})),await this.recomputeSelectionAfterItemsReload(e),this.reloadPanelTitle()}async recomputeSelectionAfterItemsReload(e){const n=this.getActiveItemController();if(this.shouldLeaveSelectionUnchanged(n))return void V(R.Selection,"Leaving selection unchanged");const r=null==n?void 0:n.item;if(n&&r&&this.shouldCloseActiveItem(r,e)){if(this.closeItemController(n),this.deselectItem(r),this.shouldSelectFirstItem(e)){if(this.isTableViewEnabled&&!(0,t.Av)())return;V(R.Selection,"Selecting next item after closing active one"),this.selectNextItem({userTriggered:!1})}}else r&&this.shouldSelectActiveItem(r)?(V(R.Selection,"Selecting active item"),await this.selectItem(r.uuid).catch(console.error)):this.shouldSelectFirstItem(e)?await this.selectFirstItem():this.shouldSelectNextItemOrCreateNewNote(r)?await this.selectNextItemOrCreateNewNote():V(R.Selection,"No selection change")}async createNewNoteController(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"editor";const i=this.navigationController.selected,o=i instanceof r.SNTag?i.uuid:void 0;return this.itemControllerGroup.createItemController({templateOptions:{title:e,tag:o,createdAt:t,autofocusBehavior:n,vault:this.vaultDisplayService.exclusivelyShownVault}})}get optionsSubtitle(){return this.displayOptions.includePinned||this.displayOptions.includeProtected?this.displayOptions.includePinned?this.displayOptions.includeProtected?void 0:"Excluding protected":"Excluding pinned":"Excluding pinned and protected"}get notesListScrollContainer(){return document.getElementById("notes-scrollable")}closeItemController(e){V(R.Selection,"Closing item controller",e.runtimeId),this.itemControllerGroup.closeItemController(e)}get isCurrentNoteTemplate(){const e=this.getActiveItemController();return!!e&&e instanceof Bt&&e.isTemplateNote}async insertCurrentIfTemplate(){const e=this.getActiveItemController();e&&e instanceof Bt&&e.isTemplateNote&&await e.insertTemplatedNote()}get selectedItemsCount(){return Object.keys(this.selectedItems).length}get selectedFiles(){return this.getFilteredSelectedItems(r.ContentType.TYPES.File)}get selectedFilesCount(){return this.selectedFiles.length}get firstSelectedItem(){return Object.values(this.selectedItems)[0]}}class Zt extends De.L{constructor(e,t){var n;super(t),this.sessions=e,this.hide=()=>{this.show=!1,L.tO.set(L.Qt.ShowNoAccountWarning,!1)},this.reset=()=>{L.tO.remove(L.Qt.ShowNoAccountWarning)},this.show=!e.isSignedIn()&&(null===(n=L.tO.get(L.Qt.ShowNoAccountWarning))||void 0===n||n),t.addEventHandler(this,r.ApplicationEvent.SignedIn),t.addEventHandler(this,r.ApplicationEvent.Started),(0,_.rC)(this,{show:_.LO,hide:_.aD})}async handleEvent(e){switch(e.type){case r.ApplicationEvent.SignedIn:(0,_.z)((()=>{this.show=!1}));break;case r.ApplicationEvent.Started:this.sessions.isSignedIn()&&(0,_.z)((()=>{this.show=!1}))}}}var Wt,qt=s(38318);class Jt extends De.L{deinit(){super.deinit(),this.notesAndTags=void 0,(0,t.h6)(this)}constructor(e,t,n){super(n),this.items=e,this._getHost=t,this.show=!1,this.signingOut=!1,this.otherSessionsSignOut=!1,this.server=void 0,this.notesAndTags=[],this.isEncryptionEnabled=!1,this.encryptionStatusString="",this.isBackupEncrypted=!1,this.showSignIn=!1,this.deletingAccount=!1,this.showRegister=!1,this.currentPane=qt.V.GeneralMenu,this.setShow=e=>{this.show=e,e&&this.setCurrentPane(qt.V.GeneralMenu)},this.closeAccountMenu=()=>{this.setShow(!1)},this.setSigningOut=e=>{this.signingOut=e},this.setServer=e=>{this.server=e},this.setIsEncryptionEnabled=e=>{this.isEncryptionEnabled=e},this.setEncryptionStatusString=e=>{this.encryptionStatusString=e},this.setIsBackupEncrypted=e=>{this.isBackupEncrypted=e},this.setShowSignIn=e=>{this.showSignIn=e},this.setShowRegister=e=>{this.showRegister=e},this.toggleShow=()=>{this.show?this.closeAccountMenu():this.setShow(!0)},this.setOtherSessionsSignOut=e=>{this.otherSessionsSignOut=e},this.setCurrentPane=e=>{this.currentPane=e},this.setDeletingAccount=e=>{this.deletingAccount=e},(0,_.rC)(this,{show:_.LO,signingOut:_.LO,otherSessionsSignOut:_.LO,server:_.LO,notesAndTags:_.LO,isEncryptionEnabled:_.LO,encryptionStatusString:_.LO,isBackupEncrypted:_.LO,showSignIn:_.LO,deletingAccount:_.LO,showRegister:_.LO,currentPane:_.LO,setShow:_.aD,toggleShow:_.aD,setSigningOut:_.aD,setIsEncryptionEnabled:_.aD,setEncryptionStatusString:_.aD,setIsBackupEncrypted:_.aD,setOtherSessionsSignOut:_.aD,setCurrentPane:_.aD,setServer:_.aD,setDeletingAccount:_.aD,notesAndTagsCount:_.Fl}),n.addEventHandler(this,r.ApplicationEvent.Launched),this.disposers.push(this.items.streamItems([r.ContentType.TYPES.Note,r.ContentType.TYPES.Tag],(()=>{(0,_.z)((()=>{this.notesAndTags=this.items.getItems([r.ContentType.TYPES.Note,r.ContentType.TYPES.Tag])}))})))}async handleEvent(e){e.type===r.ApplicationEvent.Launched&&(0,_.z)((()=>{this.setServer(this._getHost.execute().getValue())}))}get notesAndTagsCount(){return this.notesAndTags.length}}class Xt extends De.L{constructor(e,t,n,i){super(i),this.subscriptions=e,this.sessions=t,this.features=n,this.ALLOWED_SUBSCRIPTION_INVITATIONS=5,this.subscriptionInvitations=void 0,this.onlineSubscription=void 0,this.hasAccount=t.isSignedIn(),(0,_.rC)(this,{subscriptionInvitations:_.LO,hasAccount:_.LO,onlineSubscription:_.LO,usedInvitationsCount:_.Fl,allowedInvitationsCount:_.Fl,allInvitationsUsed:_.Fl}),i.addEventHandler(this,r.ApplicationEvent.Launched),i.addEventHandler(this,r.ApplicationEvent.SignedIn),i.addEventHandler(this,r.ApplicationEvent.UserRolesChanged),i.addEventHandler(this,r.SubscriptionManagerEvent.DidFetchSubscription)}deinit(){super.deinit(),this.subscriptionInvitations=void 0,(0,t.h6)(this)}async handleEvent(e){switch(e.type){case r.ApplicationEvent.Launched:this.sessions.isSignedIn()&&this.reloadSubscriptionInvitations().catch(console.error),(0,_.z)((()=>{this.hasAccount=this.sessions.isSignedIn()}));break;case r.ApplicationEvent.SignedIn:this.reloadSubscriptionInvitations().catch(console.error),(0,_.z)((()=>{this.hasAccount=this.sessions.isSignedIn()}));break;case r.SubscriptionManagerEvent.DidFetchSubscription:(0,_.z)((()=>{this.onlineSubscription=this.subscriptions.getOnlineSubscription()}));break;case r.ApplicationEvent.UserRolesChanged:this.reloadSubscriptionInvitations().catch(console.error)}}hasFirstPartyOnlineOrOfflineSubscription(){const e=this.features.hasFirstPartyOfflineSubscription();return this.sessions.isSignedIn()&&this.sessions.isSignedIntoFirstPartyServer()&&!!this.subscriptions.getOnlineSubscription()||e}get usedInvitationsCount(){var e,t;return null!==(t=null===(e=this.subscriptionInvitations)||void 0===e?void 0:e.filter((e=>[r.InvitationStatus.Accepted,r.InvitationStatus.Sent].includes(e.status))).length)&&void 0!==t?t:0}get allowedInvitationsCount(){return this.ALLOWED_SUBSCRIPTION_INVITATIONS}get allInvitationsUsed(){return this.usedInvitationsCount===this.ALLOWED_SUBSCRIPTION_INVITATIONS}async sendSubscriptionInvitation(e){const t=await this.subscriptions.inviteToSubscription(e);return t&&await this.reloadSubscriptionInvitations(),t}async cancelSubscriptionInvitation(e){const t=await this.subscriptions.cancelInvitation(e);return t&&await this.reloadSubscriptionInvitations(),t}async reloadSubscriptionInvitations(){this.subscriptionInvitations=await this.subscriptions.listSubscriptionInvitations()}}!function(e){e[e.SignIn=0]="SignIn",e[e.CreateAccount=1]="CreateAccount"}(Wt||(Wt={}));class $t extends De.L{constructor(e,t,n,i,o,s,a,l){var c;super(l),c=this,this.sessions=e,this.subscriptions=t,this.legacyApi=n,this.alerts=i,this.mobileDevice=o,this._loadPurchaseFlowUrl=s,this._isNativeIOS=a,this.isOpen=!1,this.currentPane=Wt.CreateAccount,this.setCurrentPane=e=>{this.currentPane=e},this.openPurchaseFlow=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.AppleIAPProductId.ProPlanYearly;c.sessions.getUser()?c._isNativeIOS.execute().getValue()?await c.beginIosIapPurchaseFlow(e):await c._loadPurchaseFlowUrl.execute():c.isOpen=!0},this.openPurchaseWebpage=async()=>{const e=await this._loadPurchaseFlowUrl.execute();e.isFailed()&&(console.error(e.getError()),this.alerts.alert(e.getError()))},this.beginIosIapPurchaseFlow=async e=>{var t;const n=await(null===(t=this.mobileDevice)||void 0===t?void 0:t.purchaseSubscriptionIAP(e));if(V(R.Purchasing,"BeginIosIapPurchaseFlow result",n),!n)return void this.alerts.alert("Your purchase was canceled or failed. Please try again.");const r=()=>{this.alerts.alert("There was an error confirming your purchase. Please contact support at help@standardnotes.com.")};V(R.Purchasing,"Confirming result with our server");const i=await this.legacyApi.getNewSubscriptionToken();if(!i)return V(R.Purchasing,"Unable to generate subscription token"),void r();const o=await this.subscriptions.confirmAppleIAP(n,i);V(R.Purchasing,"Server confirm result",o),o?this.alerts.alert("Please allow a few minutes for your subscription benefits to activate. You will see a confirmation alert in the app when your subscription is ready.","Your purchase was successful!"):r()},this.closePurchaseFlow=()=>{this.isOpen=!1},(0,_.rC)(this,{isOpen:_.LO,currentPane:_.LO,setCurrentPane:_.aD,openPurchaseFlow:_.aD,closePurchaseFlow:_.aD})}}var en=s(47436);class tn extends De.L{deinit(){super.deinit(),this.note=void 0}constructor(e,t,n){super(n),this.note=void 0,this.setNote=e=>{this.note=e},this.openModal=e=>{this.setNote(e)},this.dismissModal=()=>{this.setNote(void 0)},(0,_.rC)(this,{note:_.LO,setNote:_.aD}),this.disposers.push(t.addCommandHandler({command:L.Ek,category:"Current note",description:"Open note history",onKeyDown:()=>(this.openModal(e.firstSelectedNote),!0)}))}}function nn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nn(Object(n),!0).forEach((function(t){on(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function on(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class sn extends De.L{constructor(e,t,n,i,o,s,a){super(a),this.importer=e,this.navigationController=t,this.items=n,this.mutator=i,this.linkingController=o,this.preferences=s,this.isVisible=!1,this.addImportsToTag=!1,this.shouldCreateTag=!0,this.existingTagForImports=void 0,this.files=[],this.importTag=void 0,this.setIsVisible=e=>{this.isVisible=e},this.setAddImportsToTag=e=>{this.preferences.setValue(It.PrefKey.AddImportsToTag,e).catch(console.error)},this.setShouldCreateTag=e=>{this.preferences.setValue(It.PrefKey.AlwaysCreateNewTagForImports,e).catch(console.error)},this.setExistingTagForImports=e=>{this.preferences.setValue(It.PrefKey.ExistingTagForImports,null==e?void 0:e.uuid).catch(console.error)},this.getImportFromFile=(e,t)=>({id:r.UuidGenerator.GenerateUuid(),file:e,service:t,status:"pending"}),this.setFiles=(e,t)=>{this.files=e.map((e=>this.getImportFromFile(e,t)))},this.addFiles=(e,t)=>{this.files=[...this.files,...e.map((e=>this.getImportFromFile(e,t)))]},this.updateFile=e=>{this.files=this.files.map((t=>t.id===e.id?e:t))},this.removeFile=e=>{this.files=this.files.filter((t=>t.id!==e))},this.setImportTag=e=>{this.importTag=e},this.close=()=>{this.setIsVisible(!1),this.importTag&&this.navigationController.setSelectedTag(this.importTag,"all",{userTriggered:!0}).catch(console.error),this.setFiles([]),this.setImportTag(void 0)},this.parseAndImport=async()=>{if(0===this.files.length)return;const e=[];for(const t of this.files){if(!t.service)return;this.updateFile(rn(rn({},t),{},{status:"parsing"}));try{const{successful:n,errored:r}=await this.importer.importFromFile(t.file,t.service);e.push(...n),this.updateFile(rn(rn({},t),{},{status:"finished",successful:n,errored:r}))}catch(e){this.updateFile(rn(rn({},t),{},{status:"error",error:e instanceof Error?e:new Error("Could not import file")})),console.error(e)}}if(e.length&&this.addImportsToTag){const t=new Date;let n;if(this.shouldCreateTag){const i=this.items.createTemplateItem(r.ContentType.TYPES.Tag,{title:"Imported on ".concat(t.toLocaleString()),expanded:!1,iconString:"",references:e.filter((e=>e.content_type===r.ContentType.TYPES.Note)).map((e=>({content_type:r.ContentType.TYPES.Note,uuid:e.uuid})))});n=await this.mutator.insertItem(i)}else if(this.existingTagForImports)try{const t=this.items.findSureItem(this.existingTagForImports.uuid);await Promise.all(e.filter((e=>e.content_type===r.ContentType.TYPES.Note)).map((async e=>{const n=this.items.findSureItem(e.uuid);await this.linkingController.addTagToItem(t,n,!1)}))),n=this.items.findSureItem(this.existingTagForImports.uuid)}catch(e){console.error(e)}n&&this.setImportTag(n)}},(0,_.rC)(this,{isVisible:_.LO,setIsVisible:_.aD,addImportsToTag:_.LO,setAddImportsToTag:_.aD,shouldCreateTag:_.LO,setShouldCreateTag:_.aD,existingTagForImports:_.LO,setExistingTagForImports:_.aD,files:_.LO,setFiles:_.aD,addFiles:_.aD,updateFile:_.aD,removeFile:_.aD,importTag:_.LO,setImportTag:_.aD}),this.disposers.push(s.addEventObserver((e=>{e===r.PreferencesServiceEvent.PreferencesChanged&&(0,_.z)((()=>{this.addImportsToTag=s.getValue(It.PrefKey.AddImportsToTag,It.PrefDefaults[It.PrefKey.AddImportsToTag]),this.shouldCreateTag=s.getValue(It.PrefKey.AlwaysCreateNewTagForImports,It.PrefDefaults[It.PrefKey.AlwaysCreateNewTagForImports]);const e=s.getValue(It.PrefKey.ExistingTagForImports);this.existingTagForImports=e?this.items.findItem(e):void 0}))})))}}class an{constructor(e,t,n,r,i,o,s,a,l,c,u){this.application=e,this.routeService=t,this.purchaseFlowController=n,this.accountMenuController=r,this.preferencesController=i,this.syncStatusController=o,this.syncClient=s,this.sessionManager=a,this.subscriptionManager=l,this.toastService=c,this.userService=u}async handle(e){switch(e){case r.ApplicationEvent.Launched:{const e=this.routeService.getRoute();switch(e.type){case L.Yt.Purchase:this.purchaseFlowController.openPurchaseFlow();break;case L.Yt.Settings:if(void 0===this.sessionManager.getUser()){this.promptUserSignIn();break}this.preferencesController.openPreferences(),this.preferencesController.setCurrentPane(e.settingsParams.panel);break;case L.Yt.AcceptSubscriptionInvite:if(void 0===this.sessionManager.getUser()){this.promptUserSignIn();break}await this.acceptSubscriptionInvitation(e);break;case L.Yt.UserRequest:if(void 0===this.sessionManager.getUser()){this.promptUserSignIn();break}await this.sendUserRequest(e)}}break;case r.ApplicationEvent.SignedIn:{const e=this.routeService.getRoute();switch(e.type){case L.Yt.Settings:this.preferencesController.openPreferences(),this.preferencesController.setCurrentPane(e.settingsParams.panel);break;case L.Yt.AcceptSubscriptionInvite:await this.acceptSubscriptionInvitation(e);break;case L.Yt.UserRequest:await this.sendUserRequest(e)}}break;case r.ApplicationEvent.SyncStatusChanged:this.syncStatusController.update(this.syncClient.getSyncStatus());break;case r.ApplicationEvent.LocalDataLoaded:this.application.isNativeMobileWeb()&&this.application.handleInitialMobileScreenshotPrivacy()}}promptUserSignIn(){this.accountMenuController.setShow(!0),this.accountMenuController.setCurrentPane(qt.V.SignIn)}async acceptSubscriptionInvitation(e){const t=this.toastService.showToast(Y.pC.Loading,"Accepting invitation..."),n=await this.subscriptionManager.acceptInvitation(e.subscriptionInviteParams.inviteUuid);this.toastService.hideToast(t);const r=n.success?Y.pC.Success:Y.pC.Error,i=n.success?"Successfully joined a shared subscription.":n.message;this.toastService.showToast(r,i),this.routeService.removeQueryParameterFromURL(L.YX.AcceptSubscriptionInvite)}async sendUserRequest(e){const t=this.toastService.showToast(Y.pC.Loading,"Processing your request..."),n=await this.userService.submitUserRequest(e.userRequestParams.requestType);this.toastService.hideToast(t);const r=n?Y.pC.Success:Y.pC.Error,i=n?"We have received your request. Please check your email for further instructions.":"We could not process your request. Please try again or contact support if the issue persists.";this.toastService.showToast(r,i),this.routeService.removeQueryParameterFromURL(L.YX.UserRequest)}}class ln extends De.L{constructor(e,t){super(t),this.protections=e,this.includeProtectedContents=!1,this.includeArchived=!1,this.includeTrashed=!1,this.toggleIncludeArchived=()=>{this.includeArchived=!this.includeArchived},this.toggleIncludeTrashed=()=>{this.includeTrashed=!this.includeTrashed},this.refreshIncludeProtectedContents=()=>{this.includeProtectedContents=this.protections.hasUnprotectedAccessSession()},this.toggleIncludeProtectedContents=async()=>{this.includeProtectedContents?this.includeProtectedContents=!1:(await this.protections.authorizeSearchingProtectedNotesText(),(0,_.z)((()=>{this.refreshIncludeProtectedContents()})))},(0,_.rC)(this,{includeProtectedContents:_.LO,includeTrashed:_.LO,includeArchived:_.LO,toggleIncludeArchived:_.aD,toggleIncludeTrashed:_.aD,toggleIncludeProtectedContents:_.aD,refreshIncludeProtectedContents:_.aD}),t.addEventHandler(this,r.ApplicationEvent.UnprotectedSessionBegan),t.addEventHandler(this,r.ApplicationEvent.UnprotectedSessionExpired)}async handleEvent(e){(e.type===r.ApplicationEvent.UnprotectedSessionBegan||e.type===r.ApplicationEvent.UnprotectedSessionExpired)&&this.refreshIncludeProtectedContents()}}var cn=s(87978),un=s(57751);class dn extends De.L{constructor(e,t,n,i,o,s,a,l,c,u,d,h,p){var f;super(p),f=this,this.itemListController=e,this.filesController=t,this.subscriptionController=n,this.navigationController=i,this.featuresController=o,this.itemControllerGroup=s,this.vaultDisplayService=a,this.preferences=l,this.items=c,this.mutator=u,this.sync=d,this.vaults=h,this.isLinkingPanelOpen=!1,this.setIsLinkingPanelOpen=e=>{this.isLinkingPanelOpen=e},this.getFilesLinksForItem=e=>{if(!e||this.items.isTemplateItem(e))return{filesLinkedToItem:[],filesLinkingToItem:[]};const t=(0,r.naturalSort)(this.items.referencesForItem(e).filter(r.isFile),"title"),n=(0,r.naturalSort)(this.items.itemsReferencingItem(e).filter(r.isFile),"title");return e.content_type===r.ContentType.TYPES.File?{filesLinkedToItem:t.map((e=>(0,un.X)(e,"linked"))),filesLinkingToItem:n.map((e=>(0,un.X)(e,"linked-by")))}:{filesLinkedToItem:n.map((e=>(0,un.X)(e,"linked"))),filesLinkingToItem:t.map((e=>(0,un.X)(e,"linked-by")))}},this.getLinkedTagsForItem=e=>{if(e)return this.items.getSortedTagsForItem(e).map((e=>(0,un.X)(e,"linked")))},this.getLinkedNotesForItem=e=>!e||this.items.isTemplateItem(e)?[]:(0,r.naturalSort)(this.items.referencesForItem(e).filter(r.isNote),"title").map((e=>(0,un.X)(e,"linked"))),this.getNotesLinkingToItem=e=>e?(0,r.naturalSort)(this.items.itemsReferencingItem(e).filter(r.isNote),"title").map((e=>(0,un.X)(e,"linked-by"))):[],this.activateItem=async e=>{if(this.setIsLinkingPanelOpen(!1),e instanceof r.SNTag)return await this.navigationController.setSelectedTag(e,"all"),$e.n.Items;if(e instanceof r.SNNote){await this.navigationController.selectHomeNavigationView();const{didSelect:t}=await this.itemListController.selectItem(e.uuid,!0);if(t)return $e.n.Editor}else e instanceof r.FileItem&&await this.filesController.handleFileAction({type:cn.d.PreviewFile,payload:{file:e,otherFiles:[]}})},this.unlinkItems=async(e,t)=>{try{await this.mutator.unlinkItems(e,t)}catch(e){console.error(e)}this.sync.sync()},this.unlinkItemFromSelectedItem=async e=>{const t=this.itemListController.firstSelectedItem;t&&this.unlinkItems(t,e)},this.ensureActiveItemIsInserted=async()=>{const e=this.itemListController.getActiveItemController();e instanceof Bt&&e.isTemplateNote&&await e.insertTemplatedNote()},this.linkItems=async function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];var i;const o=async(e,t)=>{const n=await f.mutator.associateFileWithNote(t,e);if(f.featuresController.isVaultsEnabled()&&n){const r=f.vaults.getItemVault(e),i=f.vaults.getItemVault(n);if(r&&!i){const e=await f.vaults.moveItemToVault(r,t);e.isFailed()&&console.error(e.getError())}}};if((0,r.isNote)(e)){if((0,r.isNote)(t)&&!f.isEntitledToNoteLinking)return void f.publishCrossControllerEventSync(qe.DisplayPremiumModal,{featureName:"Note linking"});if(e.uuid===(null===(i=f.activeItem)||void 0===i?void 0:i.uuid)&&await f.ensureActiveItemIsInserted(),(0,r.isFile)(t))await o(e,t);else if((0,r.isNote)(t))await(async(e,t)=>{await f.mutator.linkNoteToNote(e,t)})(e,t);else{if(!(0,r.isTag)(t))throw Error("Invalid item type");await(async(e,t)=>{await f.addTagToItem(e,t,n)})(t,e)}}else{if(!(0,r.isFile)(e))throw new Error("First item must be a note or file");if((0,r.isNote)(t))await o(t,e);else if((0,r.isFile)(t))await(async(e,t)=>{await f.mutator.linkFileToFile(e,t)})(e,t);else{if(!(0,r.isTag)(t))throw Error("Invalid item to link");await(async(e,t)=>{await f.addTagToItem(e,t,n)})(t,e)}}n&&f.sync.sync()},this.linkItemToSelectedItem=async e=>{if(!this.isEntitledToNoteLinking&&e instanceof r.SNNote)return this.publishCrossControllerEventSync(qe.DisplayPremiumModal,{featureName:"Note linking"}),!1;await this.ensureActiveItemIsInserted();const t=this.activeItem;return!!t&&(await this.linkItems(t,e),!0)},this.createAndAddNewTag=async e=>{await this.ensureActiveItemIsInserted();const t=this.vaultDisplayService.exclusivelyShownVault,n=await this.mutator.findOrCreateTag(e,t),r=this.activeItem;if(r){const e=this.vaults.getItemVault(r);if(e){const t=await this.vaults.moveItemToVault(e,n);if(t.isFailed())throw new Error("Failed to move tag to item vault: ".concat(t.getError()));const i=t.getValue();await this.addTagToItem(i,r)}else await this.addTagToItem(n,r)}return n},this.addTagToItem=async function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];t instanceof r.SNNote?await f.mutator.addTagToNote(t,e,f.shouldLinkToParentFolders):t instanceof r.FileItem&&await f.mutator.addTagToFile(t,e,f.shouldLinkToParentFolders),n&&f.sync.sync().catch(console.error)},(0,_.rC)(this,{isLinkingPanelOpen:_.LO,isEntitledToNoteLinking:_.Fl,setIsLinkingPanelOpen:_.aD}),this.shouldLinkToParentFolders=l.getValue(r.PrefKey.NoteAddToParentFolders,r.PrefDefaults[r.PrefKey.NoteAddToParentFolders]),p.addEventHandler(this,r.ApplicationEvent.PreferencesChanged)}handleEvent(e){return e.type===r.ApplicationEvent.PreferencesChanged&&(this.shouldLinkToParentFolders=this.preferences.getValue(r.PrefKey.NoteAddToParentFolders,r.PrefDefaults[r.PrefKey.NoteAddToParentFolders])),Promise.resolve()}get isEntitledToNoteLinking(){return this.subscriptionController.hasFirstPartyOnlineOrOfflineSubscription()}get activeItem(){var e;return null===(e=this.itemControllerGroup.activeItemViewController)||void 0===e?void 0:e.item}}class hn{constructor(){this.inProgress=!1,this.errorMessage=void 0,this.humanReadablePercentage=void 0,this.update=e=>{var t;this.errorMessage=null===(t=e.error)||void 0===t?void 0:t.message,this.inProgress=e.syncInProgress;const n=e.getStats(),r=0===n.uploadCompletionCount?0:n.uploadCompletionCount/n.uploadTotalCount;this.humanReadablePercentage=0===r?void 0:r.toLocaleString(void 0,{style:"percent"})},(0,_.rC)(this,{inProgress:_.LO,errorMessage:_.LO,humanReadablePercentage:_.LO,update:_.aD})}}class pn{constructor(){this.hiddenSections={},this.toggleSectionVisibility=e=>{this.hiddenSections[e]=!this.hiddenSections[e]},this.reset=()=>{this.hiddenSections={}},(0,_.rC)(this,{hiddenSections:_.LO,toggleSectionVisibility:_.aD,reset:_.aD})}}class fn{constructor(e,t){this.item=e,this.items=t,this.dealloced=!1,this.runtimeId="".concat(Math.random())}deinit(){var e;this.dealloced=!0,null===(e=this.removeStreamObserver)||void 0===e||e.call(this),this.removeStreamObserver=void 0,this.item=void 0}async initialize(){this.streamItems()}streamItems(){this.removeStreamObserver=this.items.streamItems(_t.ContentType.TYPES.File,(e=>{let{changed:t,inserted:n}=e;if(this.dealloced)return;const r=t.concat(n).find((e=>e.uuid===this.item.uuid));r&&(this.item=r)}))}}class gn{constructor(e,t,n,r,i,o,s,a){this.items=e,this.mutator=t,this.sync=n,this.sessions=r,this.preferences=i,this.components=o,this.alerts=s,this._isNativeMobileWeb=a,this.itemControllers=[],this.changeObservers=[],this.eventObservers=[]}deinit(){this.items=void 0,this.eventObservers.forEach((e=>{e()})),this.changeObservers.length=0;for(const e of this.itemControllers)this.closeItemController(e,{notify:!1});this.itemControllers.length=0}async createItemController(e){let t;if(this.activeItemViewController&&this.closeItemController(this.activeItemViewController,{notify:!1}),e.file)t=new fn(e.file,this.items);else if(e.note)t=new Bt(e.note,this.items,this.mutator,this.sync,this.sessions,this.preferences,this.components,this.alerts,this._isNativeMobileWeb);else{if(!e.templateOptions)throw Error("Invalid input to createItemController");t=new Bt(void 0,this.items,this.mutator,this.sync,this.sessions,this.preferences,this.components,this.alerts,this._isNativeMobileWeb,e.templateOptions)}return this.itemControllers.push(t),await t.initialize(),this.notifyObservers(),t}closeItemController(e){let{notify:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{notify:!0};e instanceof Bt&&e.syncOnlyIfLargeNote(),e.deinit(),(0,Q.removeFromArray)(this.itemControllers,e),t&&this.notifyObservers()}closeActiveItemController(){const e=this.activeItemViewController;e&&this.closeItemController(e,{notify:!0})}closeAllItemControllers(){for(const e of this.itemControllers)this.closeItemController(e,{notify:!1});this.notifyObservers()}get activeItemViewController(){return this.itemControllers[0]}addActiveControllerChangeObserver(e){this.changeObservers.push(e),this.activeItemViewController&&e(this.activeItemViewController);const t=this.changeObservers;return()=>{(0,Q.removeFromArray)(t,e)}}notifyObservers(){for(const e of this.changeObservers)e(this.activeItemViewController)}}class mn{constructor(e){this.application=e,this.listeners=new Set,this.handleNativeMobileWindowMessage=e=>{if(""!==e.origin&&null!=e.origin)return;const t=e.data;try{const e=JSON.parse(t),{messageType:n,reactNativeEvent:r,messageData:i}=e;if("event"===n&&r){const e=r;this.handleNativeEvent(e,i)}}catch(e){console.log("[MobileWebReceiver] Error parsing message from React Native",e)}},this.addReactListener=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)}),this.listenForNativeMobileEvents()}deinit(){this.application=void 0,window.removeEventListener("message",this.handleNativeMobileWindowMessage),document.removeEventListener("message",this.handleNativeMobileWindowMessage)}listenForNativeMobileEvents(){const e=window,t=document;e.addEventListener("message",this.handleNativeMobileWindowMessage),t.addEventListener("message",this.handleNativeMobileWindowMessage)}handleNativeEvent(e,t){switch(e){case r.ReactNativeToWebEvent.EnteringBackground:this.application.handleMobileEnteringBackgroundEvent();break;case r.ReactNativeToWebEvent.GainingFocus:this.application.handleMobileGainingFocusEvent();break;case r.ReactNativeToWebEvent.LosingFocus:this.application.handleMobileLosingFocusEvent();break;case r.ReactNativeToWebEvent.ResumingFromBackground:this.application.handleMobileResumingFromBackgroundEvent();break;case r.ReactNativeToWebEvent.AndroidBackButtonPressed:this.application.handleAndroidBackButtonPressed();break;case r.ReactNativeToWebEvent.ColorSchemeChanged:this.application.handleMobileColorSchemeChangeEvent();break;case r.ReactNativeToWebEvent.KeyboardFrameWillChange:this.application.handleMobileKeyboardWillChangeFrameEvent(t);break;case r.ReactNativeToWebEvent.KeyboardFrameDidChange:this.application.handleMobileKeyboardDidChangeFrameEvent(t);break;case r.ReactNativeToWebEvent.ReceivedFile:this.application.handleReceivedFileEvent(t);break;case r.ReactNativeToWebEvent.ReceivedText:this.application.handleReceivedTextEvent(t);break;case r.ReactNativeToWebEvent.ReceivedLink:this.application.handleReceivedLinkEvent(t);break;case r.ReactNativeToWebEvent.OpenFilePreview:this.application.handleOpenFilePreviewEvent(t)}this.listeners.forEach((t=>t(e)))}}class yn{constructor(){this.listeners=new Set}setFallbackListener(e){this.fallbackListener=e}addEventListener(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notifyEvent(){let e=!1;for(const t of Array.from(this.listeners).reverse()){if(t())return void(e=!0);e=!1}!e&&this.fallbackListener&&this.fallbackListener()}}class vn{constructor(e){this.environment=e,this._isNativeMobileWeb=new L.Ab(this.environment)}execute(){const e=this._isNativeMobileWeb.execute().getValue(),n=(0,t.Yu)()||e,i=(0,t.jb)()||e&&!(0,t.Av)(),o=(0,t.Av)()||e&&!i;if(i&&o)throw Error("isTablet and isMobile cannot both be true");return r.Result.ok({isTabletOrMobile:n,isTablet:i,isMobile:o})}}class An{constructor(e){this._isTabletOrMobileScreen=e}execute(e){const t=this._isTabletOrMobileScreen.execute().getValue();if(t.isTablet){if(e===mt.h.TagSelection||e===mt.h.TableView)return r.Result.ok([$e.n.Navigation,$e.n.Items]);if(e===mt.h.ItemSelection||e===mt.h.Editing)return r.Result.ok([$e.n.Items,$e.n.Editor])}else{if(!t.isMobile)return e===mt.h.TableView?r.Result.ok([$e.n.Navigation,$e.n.Items]):r.Result.ok([$e.n.Navigation,$e.n.Items,$e.n.Editor]);if(e===mt.h.TagSelection)return r.Result.ok([$e.n.Navigation]);if(e===mt.h.ItemSelection||e===mt.h.TableView)return r.Result.ok([$e.n.Navigation,$e.n.Items]);if(e===mt.h.Editing)return r.Result.ok([$e.n.Navigation,$e.n.Items,$e.n.Editor])}throw Error("Unhandled pane layout")}}class bn{constructor(e,t){this.application=e,this._getPurchaseFlowUrl=t}async execute(){var e;const t=await this._getPurchaseFlowUrl.execute();if(t.isFailed())return t;const n=t.getValue(),i=this.application.routeService.getRoute(),o=i.type===L.Yt.Purchase?i.purchaseParams:{period:null,plan:null},s=o.period?"&period=".concat(o.period):"",a=o.plan?"&plan=".concat(o.plan):"";if(n){const t="".concat(n).concat(s).concat(a);return this.application.isNativeMobileWeb()?this.application.mobileDevice.openUrl(t):this.application.environment===r.Environment.Desktop?null===(e=this.application.desktopDevice)||void 0===e||e.openUrl(t):window.open("","_blank").location=t,r.Result.ok()}return r.Result.fail("Could not load purchase flow URL.")}}class wn{constructor(e,t,n){this.application=e,this.legacyApi=t,this.isApplicationUsingThirdPartyHostUseCase=n}async execute(){const e=window.location.origin,n=(0,t.Z$)()?"standardnotes://":e,i=this.isApplicationUsingThirdPartyHostUseCase.execute();if(i.isFailed())return r.Result.fail(i.getError());const o=i.getValue();if(this.application.sessions.isSignedOut()||o)return r.Result.ok("".concat(window.purchaseUrl,"/offline?&success_url=").concat(n));const s=await this.legacyApi.getNewSubscriptionToken();return s?r.Result.ok("".concat(window.purchaseUrl,"?subscription_token=").concat(s,"&success_url=").concat(n)):r.Result.fail("Could not get purchase flow URL.")}}class Sn{constructor(e,t){this.application=e,this.legacyApi=t}async execute(){const e=await this.legacyApi.getNewSubscriptionToken();if(!e)return r.Result.fail("Could not get subscription token.");const t="".concat(window.dashboardUrl,"?subscription_token=").concat(e);return this.application.device.environment===r.Environment.Mobile?(this.application.device.openUrl(t),r.Result.ok()):this.application.device.environment===r.Environment.Desktop?(window.open(t,"_blank"),r.Result.ok()):(window.open("","_blank").location=t,r.Result.ok())}}class Cn extends Q.DependencyContainer{constructor(e){super(),this.application=e,this.bind(z.SuperConverter,(()=>new Be)),this.bind(z.Importer,(()=>new L.q_(e.features,e.mutator,e.items,this.get(z.SuperConverter),this.get(z.FilesController),this.get(z.LinkingController),e.generateUuid,e.files))),this.bind(z.IsNativeIOS,(()=>new L.WY(e.environment,e.platform))),this.bind(z.OpenSubscriptionDashboard,(()=>new Sn(e,e.legacyApi))),this.bind(z.IsNativeMobileWeb,(()=>new L.Ab(e.environment))),this.bind(z.IsGlobalSpellcheckEnabled,(()=>new L.P$(e.preferences))),this.bind(z.MobileWebReceiver,(()=>{if(e.isNativeMobileWeb())return new mn(e)})),this.bind(z.AndroidBackHandler,(()=>{if(e.isNativeMobileWeb())return new yn})),this.bind(z.ItemGroupController,(()=>new gn(e.items,e.mutator,e.sync,e.sessions,e.preferences,e.componentManager,e.alerts,this.get(z.IsNativeMobileWeb)))),this.bind(z.RouteService,(()=>new L.MZ(this.application,this.application.events))),this.bind(z.KeyboardService,(()=>new L.i8(e.platform,e.environment))),this.bind(z.ArchiveManager,(()=>new L.jB(e))),this.bind(z.ThemeManager,(()=>new L.Ve(e,e.preferences,e.componentManager,e.events))),this.bind(z.AutolockService,(()=>e.isNativeMobileWeb()?void 0:new L.BD(e,e.events))),this.bind(z.DesktopManager,(()=>(0,r.isDesktopDevice)(e.device)?new Oe(e,e.device,e.fileBackups):void 0)),this.bind(z.ChangelogService,(()=>new L.BQ(e.environment,e.storage))),this.bind(z.PluginsService,(()=>new L.zo(e.items,e.mutator,e.sync,e.legacyApi,e.alerts,e.options.crypto))),this.bind(z.IsMobileDevice,(()=>new L.hJ(this.get(z.IsNativeMobileWeb)))),this.bind(z.MomentsService,(()=>new Fe(this.get(z.FilesController),this.get(z.LinkingController),e.storage,e.preferences,e.items,e.protections,e.desktopDevice,this.get(z.IsMobileDevice),e.events))),this.bind(z.VaultDisplayService,(()=>new L.r9(e,e.events))),this.bind(z.PersistenceService,(()=>new Je(this.get(z.ItemListController),this.get(z.NavigationController),e.storage,e.items,e.sync,e.events))),this.bind(z.FilePreviewModalController,(()=>new Xe(e.items))),this.bind(z.PaneController,(()=>new ot(e.preferences,this.get(z.KeyboardService),this.get(z.IsTabletOrMobileScreen),this.get(z.PanesForLayout),e.events))),this.bind(z.PanesForLayout,(()=>new An(this.get(z.IsTabletOrMobileScreen)))),this.bind(z.GetHost,(()=>new r.GetHost(e.legacyApi))),this.bind(z.IsApplicationUsingThirdPartyHost,(()=>new r.IsApplicationUsingThirdPartyHost(this.get(z.GetHost)))),this.bind(z.IsTabletOrMobileScreen,(()=>new vn(e.environment))),this.bind(z.PreferencesController,(()=>new at(this.get(z.RouteService),e.events))),this.bind(z.FeaturesController,(()=>new dt(e.features,e.events))),this.bind(z.NavigationController,(()=>new wt(this.get(z.FeaturesController),this.get(z.VaultDisplayService),this.get(z.KeyboardService),this.get(z.PaneController),e.sync,e.mutator,e.items,e.preferences,e.alerts,e.changeAndSaveItem,e.events))),this.bind(z.NotesController,(()=>new St(this.get(z.ItemListController),this.get(z.NavigationController),this.get(z.ItemGroupController),this.get(z.KeyboardService),e.preferences,e.items,e.mutator,e.sync,e.protections,e.alerts,this.get(z.IsGlobalSpellcheckEnabled),this.get(z.GetItemTags),e.events))),this.bind(z.GetItemTags,(()=>new L.$e(e.items))),this.bind(z.SearchOptionsController,(()=>new ln(e.protections,e.events))),this.bind(z.LinkingController,(()=>new dn(this.get(z.ItemListController),this.get(z.FilesController),this.get(z.SubscriptionController),this.get(z.NavigationController),this.get(z.FeaturesController),this.get(z.ItemGroupController),this.get(z.VaultDisplayService),e.preferences,e.items,e.mutator,e.sync,e.vaults,e.events))),this.bind(z.ItemListController,(()=>new zt(this.get(z.KeyboardService),this.get(z.PaneController),this.get(z.NavigationController),this.get(z.SearchOptionsController),e.items,e.preferences,this.get(z.ItemGroupController),this.get(z.VaultDisplayService),this.get(z.DesktopManager),e.protections,e.options,this.get(z.IsNativeMobileWeb),e.changeAndSaveItem,e.events))),this.bind(z.NoAccountWarningController,(()=>new Zt(e.sessions,e.events))),this.bind(z.AccountMenuController,(()=>new Jt(e.items,e.getHost,e.events))),this.bind(z.SubscriptionController,(()=>new Xt(e.subscriptions,e.sessions,e.features,e.events))),this.bind(z.PurchaseFlowController,(()=>new $t(e.sessions,e.subscriptions,e.legacyApi,e.alerts,e.mobileDevice,this.get(z.LoadPurchaseFlowUrl),this.get(z.IsNativeIOS),e.events))),this.bind(z.LoadPurchaseFlowUrl,(()=>new bn(e,this.get(z.GetPurchaseFlowUrl)))),this.bind(z.GetPurchaseFlowUrl,(()=>new wn(e,e.legacyApi,this.get(z.IsApplicationUsingThirdPartyHost)))),this.bind(z.SyncStatusController,(()=>new hn)),this.bind(z.ActionsMenuController,(()=>new pn)),this.bind(z.FilesController,(()=>new en.y(this.get(z.NotesController),this.get(z.FilePreviewModalController),this.get(z.ArchiveManager),this.get(z.VaultDisplayService),e.vaults,e.items,e.files,e.mutator,e.sync,e.protections,e.alerts,e.platform,e.mobileDevice,this.get(z.IsNativeMobileWeb),e.events))),this.bind(z.HistoryModalController,(()=>new tn(this.get(z.NotesController),this.get(z.KeyboardService),e.events))),this.bind(z.ImportModalController,(()=>new sn(this.get(z.Importer),this.get(z.NavigationController),e.items,e.mutator,this.get(z.LinkingController),e.preferences,e.events))),this.bind(z.ToastService,(()=>new L.kl)),this.bind(z.ApplicationEventObserver,(()=>new an(e,e.routeService,this.get(z.PurchaseFlowController),this.get(z.AccountMenuController),this.get(z.PreferencesController),this.get(z.SyncStatusController),e.sync,e.sessions,e.subscriptions,this.get(z.ToastService),e.user)))}}class En extends r.SNApplication{constructor(e,t,n,i,o){super({environment:e.environment,platform:t,deviceInterface:e,crypto:I,alertService:new L.GW,identifier:n,defaultHost:i,appVersion:e.appVersion,webSocketUrl:o,apiVersion:t===r.Platform.Ios||t===r.Platform.Android?r.ApiVersion.v0:r.ApiVersion.v1,loadBatchSize:e.environment===r.Environment.Mobile?250:r.ApplicationOptionsDefaults.loadBatchSize,sleepBetweenBatches:e.environment===r.Environment.Mobile?250:r.ApplicationOptionsDefaults.sleepBetweenBatches,allowMultipleSelection:e.environment!==r.Environment.Mobile,allowNoteSelectionStatePersistence:e.environment!==r.Environment.Mobile,u2fAuthenticatorRegistrationPromptFunction:M,u2fAuthenticatorVerificationPromptFunction:F}),this.enableUnfinishedFeatures=null===window||void 0===window?void 0:window.enabledUnfinishedFeatures,this.deps=new Cn(this),this.webEventObservers=[],this.disposers=[],this.isSessionsModalVisible=!1,this.openSessionsModal=()=>{this.isSessionsModalVisible=!0},this.closeSessionsModal=()=>{this.isSessionsModalVisible=!1},this.addNativeMobileEventListener=e=>{if(this.mobileWebReceiver)return this.mobileWebReceiver.addReactListener(e)},(0,_.rC)(this,{dealloced:_.LO,preferencesController:_.Fl,isSessionsModalVisible:_.LO,openSessionsModal:_.aD,closeSessionsModal:_.aD}),this.createBackgroundServices()}createBackgroundServices(){var e=this;this.mobileWebReceiver,this.autolockService,this.persistence,this.environment!==r.Environment.Clipper&&this.themeManager,this.momentsService,this.routeService,t.r8&&(this.devMode=new G(this)),this.isNativeMobileWeb()||this.webOrDesktopDevice.setApplication(this);const n=this.deps.get(z.ApplicationEventObserver);this.disposers.push(this.addEventObserver(n.handle.bind(n))),this.isNativeMobileWeb()&&(this.disposers.push(this.addEventObserver((async e=>{this.mobileDevice.notifyApplicationEvent(e)}))),console.log=function(){e.mobileDevice.consoleLog(...arguments)}),(0,t.Z$)()||(this.visibilityObserver=new H((e=>{this.notifyWebEvent(e)})))}deinit(e,t){this.isNativeMobileWeb()||this.webOrDesktopDevice.removeApplication(this),super.deinit(e,t);for(const e of this.disposers)e();this.disposers.length=0,this.deps.deinit();try{this.webEventObservers.length=0,this.visibilityObserver&&(this.visibilityObserver.deinit(),this.visibilityObserver=void 0)}catch(e){console.error("Error while deiniting application",e)}}addWebEventObserver(e){return this.webEventObservers.push(e),()=>{(0,Q.removeFromArray)(this.webEventObservers,e)}}notifyWebEvent(e,t){for(const n of this.webEventObservers)n(e,t);this.events.publish({type:e,payload:t})}publishPanelDidResizeEvent(e,t,n){const i={panel:e,collapsed:n,width:t};this.notifyWebEvent(r.WebAppEvent.PanelResized,i)}get desktopDevice(){if((0,r.isDesktopDevice)(this.device))return this.device}getInternalFeatureService(){return r.InternalFeatureService.get()}isNativeIOS(){return this.deps.get(z.IsNativeIOS).execute().getValue()}get isMobileDevice(){return this.deps.get(z.IsMobileDevice).execute().getValue()}get hideOutboundSubscriptionLinks(){return this.isNativeIOS()}get mobileDevice(){return this.device}get webOrDesktopDevice(){return this.device}async checkForSecurityUpdate(){return this.protocolUpgradeAvailable()}performDesktopTextBackup(){var e;return null===(e=this.desktopManager)||void 0===e?void 0:e.saveDesktopBackup()}isGlobalSpellcheckEnabled(){return this.deps.get(z.IsGlobalSpellcheckEnabled).execute().getValue()}getItemTags(e){return this.items.itemsReferencingItem(e).filter((e=>e.content_type===r.ContentType.TYPES.Tag))}get version(){return this.device.appVersion}async toggleGlobalSpellcheck(){const e=this.isGlobalSpellcheckEnabled();return this.setPreference(r.PrefKey.EditorSpellcheck,!e)}async handleMobileEnteringBackgroundEvent(){await this.lockApplicationAfterMobileEventIfApplicable()}async handleMobileGainingFocusEvent(){}handleInitialMobileScreenshotPrivacy(){this.platform===r.Platform.Android&&(this.protections.getMobileScreenshotPrivacyEnabled()?this.mobileDevice.setAndroidScreenshotPrivacy(!0):this.mobileDevice.setAndroidScreenshotPrivacy(!1))}async handleMobileLosingFocusEvent(){this.protections.getMobileScreenshotPrivacyEnabled()&&this.mobileDevice.stopHidingMobileInterfaceFromScreenshots(),await this.lockApplicationAfterMobileEventIfApplicable()}async handleMobileResumingFromBackgroundEvent(){this.protections.getMobileScreenshotPrivacyEnabled()&&this.mobileDevice.hideMobileInterfaceFromScreenshots()}handleMobileColorSchemeChangeEvent(){this.themeManager.handleMobileColorSchemeChangeEvent()}handleMobileKeyboardWillChangeFrameEvent(e){e.contentHeight>0&&K(e.contentHeight,"px",!0),e.isFloatingKeyboard&&K(100,"vh",!0),this.notifyWebEvent(r.WebAppEvent.MobileKeyboardWillChangeFrame,e)}handleMobileKeyboardDidChangeFrameEvent(e){this.notifyWebEvent(r.WebAppEvent.MobileKeyboardDidChangeFrame,e)}handleOpenFilePreviewEvent(e){let{id:t}=e;const n=this.items.findItem(t);n&&this.filesController.handleFileAction({type:cn.d.PreviewFile,payload:{file:n}}).catch(console.error)}handleReceivedFileEvent(e){const n=this.filesController,r=(0,t.e1)(e.data,e.mimeType),i=new File([r],e.name,{type:e.mimeType});n.uploadNewFile(i).catch(console.error)}async handleReceivedTextEvent(e){let{text:t,title:n}=e;const i=n||this.itemListController.titleForNewNote(),o=this.items.createTemplateItem(r.ContentType.TYPES.Note,{title:i,text:t,references:[]}),s=await this.mutator.insertItem(o);this.itemListController.selectItem(s.uuid,!0).catch(console.error),(0,Y.fz)({type:Y.pC.Success,message:"Successfully created note from shared text"})}async handleReceivedLinkEvent(e){let{link:t,title:n}=e;const r=new URL(t).pathname.split("/"),i=r[r.length-1];if(i&&/\.(png|svg|webp|jpe?g)/.test(i)){const e=(0,Y.fz)({type:Y.pC.Loading,message:"Fetching image from link..."});try{const e=await fetch(t);if(!e.ok)throw new Error("".concat(e.status,": Could not fetch image"));const n=await e.blob(),r=new File([n],i,{type:n.type});this.filesController.uploadNewFile(r).catch(console.error)}catch(e){console.error(e)}finally{(0,Y.Xd)(e)}}else this.handleReceivedTextEvent({title:n,text:t}).catch(console.error)}async lockApplicationAfterMobileEventIfApplicable(){if(await this.protections.isLocked())return;const e=this.protections.hasBiometricsEnabled(),t=this.hasPasscode(),n=this.protections.getMobilePasscodeTiming(),i=this.protections.getMobileBiometricsTiming(),o=t&&n===r.MobileUnlockTiming.Immediately,s=e&&i===r.MobileUnlockTiming.Immediately;o?await this.lock():s&&this.protections.softLockBiometrics()}handleAndroidBackButtonPressed(){void 0!==this.androidBackHandler&&this.androidBackHandler.notifyEvent()}addAndroidBackHandlerEventListener(e){if(void 0!==this.androidBackHandler)return this.androidBackHandler.addEventListener(e)}setAndroidBackHandlerFallbackListener(e){void 0!==this.androidBackHandler&&this.androidBackHandler.setFallbackListener(e)}isAuthorizedToRenderItem(e){return!e.protected||!this.hasProtectionSources()||this.protections.hasUnprotectedAccessSession()}entitledToPerTagPreferences(){return this.hasValidFirstPartySubscription()}get entitledToFiles(){return this.featuresController.entitledToFiles}showPremiumModal(e){this.featuresController.showPremiumAlert(e)}hasValidFirstPartySubscription(){return this.subscriptionController.hasFirstPartyOnlineOrOfflineSubscription()}async openPurchaseFlow(){await this.purchaseFlowController.openPurchaseFlow()}showAccountMenu(){this.accountMenuController.setShow(!0)}hideAccountMenu(){this.accountMenuController.setShow(!1)}get isFullU2FClient(){return this.environment===r.Environment.Web}openPreferences(e){this.preferencesController.openPreferences(),e&&this.preferencesController.setCurrentPane(e)}generateUUID(){return this.options.crypto.generateUUID()}get routeService(){return this.deps.get(z.RouteService)}get androidBackHandler(){return this.deps.get(z.AndroidBackHandler)}get vaultDisplayService(){return this.deps.get(z.VaultDisplayService)}get desktopManager(){return this.deps.get(z.DesktopManager)}get autolockService(){return this.deps.get(z.AutolockService)}get archiveService(){return this.deps.get(z.ArchiveManager)}get paneController(){return this.deps.get(z.PaneController)}get linkingController(){return this.deps.get(z.LinkingController)}get changelogService(){return this.deps.get(z.ChangelogService)}get pluginsService(){return this.deps.get(z.PluginsService)}get momentsService(){return this.deps.get(z.MomentsService)}get themeManager(){return this.deps.get(z.ThemeManager)}get keyboardService(){return this.deps.get(z.KeyboardService)}get featuresController(){return this.deps.get(z.FeaturesController)}get filesController(){return this.deps.get(z.FilesController)}get filePreviewModalController(){return this.deps.get(z.FilePreviewModalController)}get notesController(){return this.deps.get(z.NotesController)}get importModalController(){return this.deps.get(z.ImportModalController)}get navigationController(){return this.deps.get(z.NavigationController)}get historyModalController(){return this.deps.get(z.HistoryModalController)}get syncStatusController(){return this.deps.get(z.SyncStatusController)}get itemListController(){return this.deps.get(z.ItemListController)}get importer(){return this.deps.get(z.Importer)}get subscriptionController(){return this.deps.get(z.SubscriptionController)}get purchaseFlowController(){return this.deps.get(z.PurchaseFlowController)}get persistence(){return this.deps.get(z.PersistenceService)}get itemControllerGroup(){return this.deps.get(z.ItemGroupController)}get noAccountWarningController(){return this.deps.get(z.NoAccountWarningController)}get searchOptionsController(){return this.deps.get(z.SearchOptionsController)}get openSubscriptionDashboard(){return this.deps.get(z.OpenSubscriptionDashboard)}get mobileWebReceiver(){return this.deps.get(z.MobileWebReceiver)}get accountMenuController(){return this.deps.get(z.AccountMenuController)}get preferencesController(){return this.deps.get(z.PreferencesController)}get isNativeMobileWebUseCase(){return this.deps.get(z.IsNativeMobileWeb)}}class In extends r.SNApplicationGroup{constructor(e,t,n){super(t),this.defaultSyncServerHost=e,this.webSocketUrl=n}async initialize(){const e=this.defaultSyncServerHost,n=this.webSocketUrl;await super.initialize({applicationCreator:async(r,i)=>((e,n,r,i,o)=>{const s=(0,t.Xf)(i);return new En(n,s,e.identifier,r,o)})(r,i,e,i,n)}),(0,t.Z$)()&&(window.webClient=this.primaryApplication.desktopManager)}deinit(){super.deinit(),(0,t.Z$)()&&delete window.webClient}}class _n extends He.Component{constructor(e,t){super(e),this.application=t,this.reactionDisposers=[]}componentDidMount(){this.addAppEventObserver()}deinit(){var e;null===(e=this.unsubApp)||void 0===e||e.call(this);for(const e of this.reactionDisposers)e();this.reactionDisposers.length=0,this.unsubApp=void 0,this.application=void 0,this.props=void 0,this.state=void 0}componentWillUnmount(){this.deinit()}autorun(e){this.reactionDisposers.push((0,_.EH)(e))}addAppEventObserver(){this.application.isStarted()&&this.onAppStart().catch(console.error),this.application.isLaunched()&&this.onAppLaunch().catch(console.error),this.unsubApp=this.application.addEventObserver((async(e,t)=>{this.application&&(this.onAppEvent(e,t),e===r.ApplicationEvent.Started?await this.onAppStart():e===r.ApplicationEvent.Launched?await this.onAppLaunch():e===r.ApplicationEvent.CompletedIncrementalSync?this.onAppIncrementalSync():e===r.ApplicationEvent.CompletedFullSync?this.onAppFullSync():e===r.ApplicationEvent.KeyStatusChanged?this.onAppKeyChange().catch(console.error):e===r.ApplicationEvent.LocalDataLoaded&&this.onLocalDataLoaded())}))}onAppEvent(e,t){}async onAppStart(){}onLocalDataLoaded(){}async onAppLaunch(){}async onAppKeyChange(){}onAppIncrementalSync(){}onAppFullSync(){}}var xn=s(47931);const Pn=class extends _n{constructor(e){super(e,e.application),this.close=()=>{this.props.close()}}render(){return(0,e.jsx)("div",{className:"sn-component",children:(0,e.jsxs)("div",{id:"sync-resolution-menu",className:"absolute bottom-[40px] left-[inherit] right-0 z-footer-bar-item-panel mt-4 flex max-h-[85vh] min-w-[300px] flex-col border border-solid border-border bg-default shadow-main",children:[(0,e.jsxs)("div",{className:"flex flex-shrink-0 items-center justify-between border-b border-solid border-border bg-contrast px-6 py-3 text-text",children:[(0,e.jsx)("div",{className:"text-base font-medium",children:"Out of Sync"}),(0,e.jsx)("a",{onClick:this.close,className:"text-sm font-bold text-info",children:"Close"})]}),(0,e.jsx)("div",{className:"h-full flex-grow overflow-scroll overflow-x-auto overflow-y-auto p-6 text-sm leading-tight",children:(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)("div",{className:"mb-3.5",children:"We've detected that the data in the current application session may not match the data on the server. An attempt was made to auto-resolve the issue, but it was unable to reconcile the differences."}),(0,e.jsx)("div",{className:"sk-p sk-panel-row mb-3.5",children:(0,e.jsxs)("div",{className:"sk-panel-column",children:[(0,e.jsx)("div",{className:"mb-2 font-bold",children:"Option 1 — Restart Application:"}),(0,e.jsx)("div",{children:"Quit the application and re-open it. Sometimes, this may resolve the issue."})]})}),(0,e.jsx)("div",{className:"sk-p sk-panel-row",children:(0,e.jsxs)("div",{className:"sk-panel-column",children:[(0,e.jsx)("div",{className:"mb-2 font-bold",children:"Option 2 — Sign Out and Back In:"}),(0,e.jsx)("div",{children:"Sign out of your account, then sign back in. This will ensure your data is consistent with the server. Be sure to download a backup of your data before doing so."})]})})]})})]})})}};var kn;!function(e){e[e.UserInteraction=0]="UserInteraction",e[e.Script=1]="Script"}(kn||(kn={}));var Bn=s(44783),On=s(27055),Nn=s(34309),Dn=s(61293);const jn=n=>{let{application:r,onToggle:i,onClose:o,isEnabled:s}=n;const a=(0,He.useCallback)((()=>{i(!s),o()}),[i,s,o]),l=(0,He.useMemo)((()=>r.keyboardService.keyboardShortcutForCommand(L.yX)),[r]);return r.isNativeMobileWeb()||(0,t.Av)()?null:(0,e.jsx)(Dn.Z,{onChange:a,shortcut:l,checked:s,children:"Focus Mode"})},Tn=t=>{let{ctaRef:n,onClose:r}=t;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"flex justify-end p-1",children:(0,e.jsx)("button",{className:"flex cursor-pointer border-0 bg-transparent p-0",onClick:r,"aria-label":"Close modal",children:(0,e.jsx)(xn.Z,{className:"text-neutral",type:"close"})})}),(0,e.jsx)("div",{className:"mx-auto mb-5 flex h-24 w-24 items-center justify-center rounded-[50%] bg-contrast","aria-hidden":!0,children:(0,e.jsx)(xn.Z,{className:"h-24 w-24 px-7 py-2 text-[50px]",size:"custom",type:"🎉"})}),(0,e.jsx)("div",{className:"mb-1 text-center text-lg font-bold",children:"Your purchase was successful!"})]}),(0,e.jsx)("div",{className:"mb-2 px-4.5 text-center text-sm text-passive-1",children:"Enjoy your new powered up experience."}),(0,e.jsx)("div",{className:"p-4",children:(0,e.jsx)("button",{onClick:r,className:"no-border w-full cursor-pointer rounded bg-info py-2 font-bold text-info-contrast hover:brightness-125 focus:brightness-125",ref:n,children:"Continue"})})]})};var Mn=s(73703);const Fn=t=>{let{featureName:n,ctaRef:i,application:o,hasSubscription:s,onClose:a,onClick:l,inline:c,preferHorizontalLayout:u=!1}=t;const d=(0,He.useCallback)((()=>{l&&l(),Yt(),s&&!o.isNativeIOS()?o.openSubscriptionDashboard.execute():o.openPurchaseFlow(),a&&a()}),[o,s,a,l]);return(0,e.jsxs)("div",{className:u?"flex flex-wrap items-center gap-4 md:flex-nowrap":"",children:[!c&&(0,e.jsx)("div",{className:"flex justify-end p-1",children:(0,e.jsx)("button",{className:"flex cursor-pointer border-0 bg-transparent p-0",onClick:a,"aria-label":"Close modal",children:(0,e.jsx)(xn.Z,{className:"text-neutral",type:"close"})})}),(0,e.jsx)("div",{className:(0,r.classNames)("flex items-center justify-center rounded-[50%] bg-contrast",u?"h-12 w-12 flex-shrink-0":"mx-auto mb-5 h-24 w-24"),"aria-hidden":!0,children:(0,e.jsx)(xn.Z,{className:(0,r.classNames)(u?"h-8 w-8":"h-12 w-12",Mn.K),size:"custom",type:Mn._})}),(0,e.jsxs)("div",{className:u?"":"mb-2",children:[(0,e.jsx)("div",{className:(0,r.classNames)("mb-1 text-lg font-bold",u?"text-left":"text-center"),children:"Enable Advanced Features"}),(0,e.jsxs)("div",{className:(0,r.classNames)("text-sm text-passive-1",u?"text-left":"px-4.5 text-center"),children:[n&&(0,e.jsxs)("span",{children:["To take advantage of ",(0,e.jsx)("span",{className:"font-semibold",children:n})," and other advanced features, upgrade your current plan."]}),!n&&(0,e.jsx)("span",{children:"To take advantage of all the advanced features Standard Notes has to offer, upgrade your current plan."}),o.isNativeIOS()&&(0,e.jsxs)("div",{className:"mt-2",children:[(0,e.jsx)("div",{className:"mb-2 font-bold",children:"The Professional Plan costs $119.99/year and includes benefits like"}),(0,e.jsxs)("ul",{className:"list-inside list-[circle]",children:[(0,e.jsx)("li",{children:"100GB encrypted file storage"}),(0,e.jsx)("li",{children:"Access to all note types, including Super, markdown, rich text, authenticator, tasks, and spreadsheets"}),(0,e.jsx)("li",{children:"Access to Daily Notebooks and Moments journals"}),(0,e.jsx)("li",{children:"Note history going back indefinitely"}),(0,e.jsx)("li",{children:"Nested folders for your tags"}),(0,e.jsx)("li",{children:"Premium support"})]})]})]})]}),(0,e.jsx)("button",{onClick:d,className:(0,r.classNames)("no-border cursor-pointer rounded bg-info py-2 font-bold text-info-contrast hover:brightness-125 focus:brightness-125",u?"w-full px-4 md:ml-auto md:w-auto":"my-2 w-full"),ref:i,children:"Upgrade"})]})},Rn=()=>{const e=getComputedStyle(document.documentElement);return{hasTopInset:!!parseInt(e.getPropertyValue("--safe-area-inset-top")),hasRightInset:!!parseInt(e.getPropertyValue("--safe-area-inset-right")),hasBottomInset:!!parseInt(e.getPropertyValue("--safe-area-inset-bottom")),hasLeftInset:!!parseInt(e.getPropertyValue("--safe-area-inset-left"))}};var Ln=s(756),Qn=s(57137),Un=s(18329),Vn=s(38232),Kn=s(74547);const Hn=e=>{let{close:t}=e;const n=(0,Kn.x)(),r=(0,Vn.Y)(t);return(0,He.useEffect)((()=>{const e=n((()=>(r.current(),!0)));return()=>{e&&e()}}),[n,r]),null},Gn=t=>{let{title:n,close:i,actions:o=[],className:s,customHeader:a,disableCustomHeader:l=!1,customFooter:c,children:u}=t;const d=(0,He.useMemo)((()=>o.sort(((e,t)=>"cancel"===e.type?-1:"cancel"===t.type?1:"destructive"===e.type?-1:"destructive"===t.type?1:"secondary"===e.type?-1:"secondary"===t.type?1:0)).filter((e=>!e.hidden))),[o]);if(d.filter((e=>"primary"===e.type)).length>1)throw new Error("Modal can only have 1 primary action");if(d.filter((e=>"cancel"===e.type)).length>1)throw new Error("Modal can only have 1 cancel action");const h=(0,et.ac)(et.Jj.sm),p=d.find((e=>"left"===e.mobileSlot)),f=d.find((e=>"right"===e.mobileSlot)),g=d.findIndex((e=>"primary"===e.type)),m=d.filter((e=>"primary"!==e.type&&"cancel"!==e.type)),[y,v]=(0,He.useState)(!1),A=(0,He.useRef)(null),{hasTopInset:b,hasBottomInset:w}=Rn();return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Hn,{close:i}),a&&!l?a:(0,e.jsx)("div",{className:(0,r.classNames)("flex w-full flex-shrink-0 select-none items-center justify-between rounded-t border-b border-solid border-border bg-default px-2 text-text md:px-4.5 md:py-3 md:translucent-ui:bg-transparent",b?"pb-1.5 pt-safe-top":"py-1.5"),children:(0,e.jsxs)(Un.Z,{className:"flex-row items-center justify-between md:flex md:gap-0",children:[p?(0,e.jsx)(Qn.Z,{type:p.type,action:p.onClick,disabled:p.disabled,slot:"left",children:p.label}):(0,e.jsx)("div",{className:"md:hidden"}),(0,e.jsxs)("div",{className:"flex items-center justify-center gap-2 overflow-hidden text-center font-semibold text-text md:flex-grow md:text-left md:text-lg",children:[m.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Qn.Z,{type:"secondary",action:()=>v((e=>!e)),slot:"left",ref:A,children:(0,e.jsx)("div",{className:"rounded-full border border-border p-0.5",children:(0,e.jsx)(xn.Z,{type:"more"})})}),(0,e.jsx)(On.Z,{title:"Advanced",open:y,anchorElement:A,disableMobileFullscreenTakeover:!0,togglePopover:()=>v((e=>!e)),align:"start",portal:!1,className:"!fixed divide-y divide-border border border-border",children:m.filter((e=>"cancel"!==e.type)).map(((t,n)=>(0,e.jsx)("button",{className:(0,r.classNames)("p-2 text-base font-semibold hover:bg-contrast focus:bg-info-backdrop focus:shadow-none focus:outline-none","destructive"===t.type&&"text-danger"),onClick:()=>{t.onClick(),v(!1)},disabled:t.disabled,children:t.label},n)))})]}),(0,e.jsx)("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap ",children:n})]}),(0,e.jsx)("div",{className:"hidden items-center gap-2 md:flex",children:(0,e.jsx)("button",{tabIndex:0,className:"ml-2 rounded p-1 font-bold hover:bg-contrast",onClick:i,children:(0,e.jsx)(xn.Z,{type:"close"})})}),f?(0,e.jsx)(Qn.Z,{type:f.type,action:f.onClick,disabled:f.disabled,slot:"right",children:f.label}):null]})}),(0,e.jsx)("div",{className:(0,r.classNames)("flex-grow overflow-y-auto",s),children:u}),c||d.length>0&&(0,e.jsx)("div",{className:(0,r.classNames)("hidden items-center justify-start gap-3 border-t border-border px-2.5 py-2 md:flex md:px-4 md:py-4",w&&"pb-safe-bottom"),children:d.map(((t,n)=>(0,e.jsx)(Ln.Z,{primary:"primary"===t.type,colorStyle:"destructive"===t.type?"danger":void 0,onClick:t.onClick,className:(0,r.classNames)(t.mobileSlot?"hidden md:block":"",n===g&&"ml-auto"),"data-type":t.type,disabled:t.disabled,small:h,children:t.label},n)))})]})};var Yn=s(32839),zn=s(59846),Zn=s(47166),Wn=s(17906),qn=s(75043),Jn=s(82931);(0,Q.classNames)("z-dropdown-menu w-full","cursor-auto flex-col overflow-y-auto rounded bg-default h-auto");const Xn=(0,Q.classNames)("flex w-full items-center text-base overflow-hidden hover:bg-contrast hover:text-foreground","cursor-pointer m-0 focus:bg-info focus:text-info-contrast");function $n(t){let{index:n,isSelected:i,onClick:o,onMouseEnter:s,option:a}=t;return(0,e.jsxs)("li",{tabIndex:-1,className:(0,r.classNames)("gap-3 border-b-[0.5px] border-border px-3 py-2",i&&"bg-info-backdrop",Xn),ref:a.setRefElement,role:"option","aria-selected":i,id:"typeahead-item-"+n,onMouseEnter:s,onClick:o,children:[(0,e.jsx)(xn.Z,{type:a.iconName,className:"h-5 w-5 flex-shrink-0"}),(0,e.jsx)("div",{className:"text-editor",children:a.title})]},a.key)}var er=s(20174),tr=s(57823),nr=s(65268);function rr(e,t){const n=[];if(null==t)return n;const r=new RegExp(/^([1-9]|10)x([1-9]|10)$/),i=new RegExp(/^([1-9]|10)x?$/),o=r.exec(t),s=i.exec(t);if(o){const[t,r]=o[0].split("x").map((e=>parseInt(e,10)));n.push(new tr.y("".concat(t,"x").concat(r," Table"),{iconName:"table",keywords:["table"],onSelect:()=>e.dispatchCommand(nr.bF,{columns:String(r),rows:String(t)})}))}else if(s){const t=parseInt(s[0],10);n.push(...Array.from({length:5},((e,t)=>t+1)).map((n=>new tr.y("".concat(t,"x").concat(n," Table"),{iconName:"table",keywords:["table"],onSelect:()=>e.dispatchCommand(nr.bF,{columns:String(n),rows:String(t)})}))))}return n}var ir=s(66498);function or(e){return function(e){return[{name:"Current date and time",iconName:"authenticator",keywords:["date","current"],onSelect:()=>e.dispatchCommand(ir.gD,"datetime")},{name:"Current time",iconName:"authenticator",keywords:["time","current"],onSelect:()=>e.dispatchCommand(ir.gD,"time")},{name:"Current date",iconName:"authenticator",keywords:["date","current"],onSelect:()=>e.dispatchCommand(ir.gD,"date")}]}(e).map((e=>new tr.y(e.name,{iconName:e.iconName,keywords:e.keywords,onSelect:e.onSelect})))}var sr=s(48518);function ar(e){return new tr.y("Image from URL",{iconName:"image",keywords:["image","url"],onSelect:e})}var lr=s(46513),cr=s(66208),ur=s(94652),dr=s(22798),hr=s(98572),pr=s(9256),fr=s(89139),gr=s(30626),mr=s(21490),yr=s(4694),vr=s(8802),Ar=s(26786);function br(e){return function(e){return Ar.GF.map((t=>({name:"Embed ".concat(t.contentName),iconName:t.iconName,keywords:[...t.keywords,"embed"],onSelect:()=>e.dispatchCommand(vr.v3,t.type)})))}(e).map((e=>new tr.y(e.name,{iconName:e.iconName,keywords:e.keywords,onSelect:e.onSelect})))}var wr=s(65123);function Sr(e){return new tr.y("Upload file",{iconName:"file",keywords:["image","upload","file"],onSelect:()=>e.dispatchCommand(wr.J,void 0)})}function Cr(n){let{popoverZIndex:r}=n;const[i]=(0,Zn.g)(),o=(0,sr.I)(),[s,a]=(0,qn.Z)(),[l,c]=(0,He.useState)(null),u=(0,Wn.wd)("/",{minLength:0}),d=(0,He.useMemo)((()=>{const t=o.isNativeMobileWeb()?[(0,dr.Gm)(i),(0,dr.$o)(i)]:[],n=[(0,cr.c)(i),(0,ur.vZ)(i),(0,ur.I)(i),(0,ur.sV)(i),...t,(r=()=>a("Insert Table",(t=>(0,e.jsx)(Jn.n,{activeEditor:i,onClose:t}))),new tr.y("Table",{iconName:"table",keywords:["table","grid","spreadsheet","rows","columns"],onSelect:r})),ar((()=>{a("Insert image from URL",(t=>(0,e.jsx)(lr.a,{onClose:t})))})),Sr(i),(0,pr.EQ)(i),(0,pr.T$)(i),(0,pr.PG)(i),(0,gr.t)(i),(0,fr.i)(i),(0,mr.W)(i),...or(i),(0,hr.F)(i),(0,hr.R8)(i),(0,hr.oe)(i),(0,hr.C1)(i),(0,er.Kw)(i),(0,yr.e)(i),...br(i)];var r;const s=[...rr(i,l||""),...(0,er.ft)(i,l||"")];return l?[...s,...n.filter((e=>!(!new RegExp(l,"gi").exec(e.title)&&null==e.keywords)&&e.keywords.some((e=>new RegExp(l,"gi").exec(e)))))]:n}),[i,l,a,o]),h=(0,He.useCallback)(((e,t,n,r)=>{i.update((()=>{t&&t.remove(),e.onSelect(r),n()}))}),[i]);return(0,e.jsxs)(e.Fragment,{children:[s,(0,e.jsx)(Wn.HQ,{onQueryChange:c,onSelectOption:h,triggerFn:u,options:d,menuRenderFn:(n,i)=>{let{selectedIndex:o,selectOptionAndCleanUp:s,setHighlightedIndex:a}=i;return n.current&&d.length?(0,e.jsx)(On.Z,{title:"Block picker",align:"start",anchorElement:n.current,open:!0,disableMobileFullscreenTakeover:!0,side:(0,t.Av)()?"top":"bottom",maxHeight:e=>e/2,overrideZIndex:r,children:(0,e.jsx)("ul",{children:d.map(((t,n)=>(0,e.jsx)($n,{index:n,isSelected:o===n,onClick:()=>{a(n),s(t)},onMouseEnter:()=>{a(n)},option:t},t.key)))})}):null}})]})}var Er=s(5778);const Ir=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n={ExtraSmall:t?"text-xs":"0.75rem",Small:t?"text-sm":"0.875rem",Normal:t?"text-editor":"var(--sn-stylekit-font-size-editor)",Medium:t?"text-lg":"1.125rem",Large:t?"text-xl":"1.25rem"},r={ExtraSmall:t?"text-sm":"0.875rem",Small:t?"text-editor":"var(--sn-stylekit-font-size-editor)",Normal:t?"text-lg":"1.125rem",Medium:t?"text-xl":"1.25rem",Large:t?"text-2xl":"1.5rem"},i={ExtraSmall:t?"text-sm":"0.875rem",Small:t?"text-editor":"var(--sn-stylekit-font-size-editor)",Normal:t?"text-base":"1rem",Medium:t?"text-xl":"1.25rem",Large:t?"text-2xl":"1.5rem"},o=(0,et.ac)(et.Jj.md),s=(0,et.ac)(et.Jj.sm);return o?i[e]:s?r[e]:n[e]};var _r=s(32810);const xr=t=>{let{hasSubscription:n,onClose:i}=t;const o=(0,sr.I)(),[s]=(0,Er.D)(r.LocalPrefKey.EditorLineHeight),[a]=(0,Er.D)(r.LocalPrefKey.EditorFontSize),l=Ir(a,!1),c=(0,He.useRef)(null),[u,d]=(0,He.useState)(null),h=(0,_r.l)(u,{updateOnWindowResize:!0});return(0,e.jsxs)("div",{className:"flex h-full flex-col",ref:d,children:[(0,e.jsx)("div",{className:(0,r.classNames)("flex-shrink-0 border-b border-border p-4",h&&h.height<500?"hidden md:block":""),children:(0,e.jsx)(Fn,{featureName:"Super notes",ctaRef:c,application:o,hasSubscription:n,inline:!0,preferHorizontalLayout:!0,onClick:i})}),(0,e.jsx)("div",{className:"relative flex h-full min-h-0 flex-col",style:{"--line-height":r.EditorLineHeightValues[s],"--font-size":l},children:(0,e.jsx)(zn.I,{initialValue:(new Be).convertOtherFormatToSuperString('<div>\n\t<h1>This is a demo of Super notes</h1>\n\t<p><br></p>\n\t<p>Super notes are our new <b>rich text</b> experience. With Super notes, you can create <b>rich</b>, <i>dynamic</i> text with powerful options.</p>\n  <p><br></p>\n\t<h2><span>Lists</span></h2>\n  <p><br></p>\n  <ul>\n    <li value="1"><span>Type </span><code spellcheck="false"><span>-</span></code><span> followed by a space in begin a\n        list</span></li>\n    <li value="2"><span>Type </span><code spellcheck="false"><span>1.</span></code><span> followed by a space in begin a numbered\n        list</span></li>\n    <li value="3"><span>Type </span><code spellcheck="false"><span>[]</span></code><span> followed by a space\n        to begin a checklist </span></li>\n  </ul>\n\t<p><br></p>\n\t<ul>\n    <li value="1"><span>A list</span></li>\n    <li value="2">\n      <ul>\n        <li value="1"><span>Indent the list</span></li>\n        <li value="2">\n          <ul>\n            <li value="1"><span>And even more</span></li>\n          </ul>\n        </li>\n      </ul>\n    </li>\n  </ul>\n  <p><br></p>\n\t<ol>\n\t\t<li value="1"><span>A numbered list</span></li>\n\t\t<li value="2"><span>With multiple levels</span></li>\n\t\t<li value="3"><span>And even more</span></li>\n\t</ol>\n  <p><br></p>\n  <ul __lexicallisttype="check">\n    <li role="checkbox" tabindex="-1" aria-checked="false" value="1">\n      <span>Create</span>\n    </li>\n    <li role="checkbox" tabindex="-1" aria-checked="true" value="2">\n      <span>a</span>\n    </li>\n    <li role="checkbox" tabindex="-1" aria-checked="true" value="3">\n      <span>checklist</span>\n    </li>\n  </ul>\n\t<p><br></p>\n\t<h2><span>Images</span></h2>\n  <p><br></p>\n  <p>You can add images to your note by selecting the "Image from URL" option from the <code spellcheck="false"><span>/</span></code> menu or Insert menu in the toolbar.</p>\n  <p><br></p>\n  <p><img src="https://standardnotes.com/static/292c6ba50c69a3ae4f8b1883e7f505f6/1f7f6/vault-wide.jpg" /></p>\n  <p><br></p>\n\t<h2><span>Collapsible sections</span></h2>\n\t<p><br></p>\n\t<details open="">\n    <summary><span>Collapsible section</span></summary>\n    <div data-lexical-collapsible-content="true">\n      <p><span>Collapsible sections can include all\n          other types of content like</span></p>\n      <p><br></p>\n      <h2><span>Heading</span></h2>\n      <p><br></p>\n      <ul>\n        <li value="1"><span>a list</span></li>\n      </ul>\n      <ol>\n        <li value="1"><span>numbered</span></li>\n      </ol>\n      <ul __lexicallisttype="check">\n        <li role="checkbox" tabindex="-1" aria-checked="false" value="1"><span>check\n            list</span>\n        </li>\n      </ul>\n      <p><br></p>\n      <pre spellcheck="false" data-highlight-language="javascript"><span>A</span><span> code block</span></pre>\n      <p><br></p>\n      <p><span>You can even nest collapsible\n          sections.</span></p>\n      <p><br></p>\n      <details open="">\n        <summary><span>Nested collapsible section</span></summary>\n        <div data-lexical-collapsible-content="true">\n          <blockquote><span>Quote</span></blockquote>\n        </div>\n      </details>\n    </div>\n  </details>\n\t<p><br></p>\n\t<h2><span>Code blocks</span></h2>\n  <p><br></p>\n  <p><span>Type </span><code spellcheck="false"><span >```</span></code><span> followed by a space to create a code\n      block. You can choose the language when your\n      cursor is within the code block.</span></p>\n  <p><br></p>\n  <pre spellcheck="false"\n    data-highlight-language="js"><span >function</span><span> </span><span >main</span><span >(</span><span >)</span><span> </span><span >{</span><br><span>\t</span><span >const</span><span> variable </span><span >=</span><span> </span><span >"string"</span><span >;</span><br><span>\t</span><span >return</span><span> </span><span >TEST</span><span >;</span><br><span >}</span></pre>\n\t<p><br></p>\n  <h2><span>Tables</span></h2>\n  <table>\n    <colgroup>\n      <col>\n      <col>\n      <col>\n    </colgroup>\n    <tbody>\n      <tr>\n        <th>\n          <p><span>Header</span></p>\n        </th>\n        <th>\n          <p><span>Column 1</span></p>\n        </th>\n        <th>\n          <p><span>Column 2</span></p>\n        </th>\n      </tr>\n      <tr>\n        <th>\n          <p><span>Row 1</span></p>\n        </th>\n        <td>\n          <p><span>Row 1 x Column 1</span></p>\n        </td>\n        <td>\n          <p><span>Row 1 x Column 2</span></p>\n        </td>\n      </tr>\n      <tr>\n        <th>\n          <p><span>Row 2</span></p>\n        </th>\n        <td>\n          <p><span>Row 2 x Column 1</span></p>\n        </td>\n        <td>\n          <p><span>Row 2 x Column 2</span></p>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n\t<p><br></p>\n\t<h2><span>Passwords</span></h2>\n  <p><span>You can generate a secure password using\n\tthe "Generate password" command using the </span><code spellcheck="false"><span >/</span></code><span>\n\tmenu.</span></p>\n\t<p><br></p>\n  <ul>\n    <li value="1"><span>}:hcMrIFgaijpkyz</span></li>\n    <li value="2"><span>*raF/qi$m?y?iiBS</span></li>\n    <li value="3"><span>YuVmWf(gOD&amp;=vjbB</span></li>\n  </ul>\n</div>',"html",{html:{addLineBreaks:!1}}),children:(0,e.jsx)(Yn.k,{className:"blocks-editor h-full bg-default",children:(0,e.jsx)(Cr,{popoverZIndex:"z-modal"})})})})]})},Pr=t=>{let{application:n,featureName:r,hasSubscription:i,onClose:o,type:s=lt.UpgradePrompt}=t;const a=(0,He.useRef)(null),l=s===lt.SuperDemo,c=(0,et.ac)(et.Jj.sm);return(0,e.jsxs)(Gn,{close:o,title:l?"Try out Super":"Upgrade",className:l?"":"px-6 py-5",customHeader:l?void 0:(0,e.jsx)(e.Fragment,{}),actions:l?[{label:"Done",type:"primary",onClick:o,hidden:!c,mobileSlot:"right"}]:void 0,children:[s===lt.UpgradePrompt&&(0,e.jsx)(Fn,{featureName:r,ctaRef:a,application:n,hasSubscription:i,onClose:o}),s===lt.UpgradeSuccess&&(0,e.jsx)(Tn,{ctaRef:a,onClose:o}),s===lt.SuperDemo&&(0,e.jsx)(xr,{hasSubscription:i,onClose:o})]})};var kr=s(7453),Br=s(72455),Or=s(56278),Nr=s(10878);const Dr=["isOpen","children","animationVariant","close","className","backdropClassName","animate"];function jr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Tr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jr(Object(n),!0).forEach((function(t){Mr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Mr(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Fr=(0,He.forwardRef)(((t,n)=>{let{isOpen:i,children:o,animationVariant:s,close:a,className:l,backdropClassName:c,animate:u}=t,d=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,Dr);const h=(0,et.ac)(et.Jj.sm),[p,f]=(0,Nr.vU)(i,h,s,"mobile"===u&&!h||"desktop"===u&&h),g=(0,Br.I)({open:p,setOpen:e=>{e||a()},animated:!h}),m=(0,He.useId)(),y=(0,He.useCallback)((()=>{const e="portal/"+m,t=document.getElementById(e);t&&t.remove();const n=document.createElement("div");return n.id=e,n.className="fixed flex items-center justify-center left-0 top-0 z-modal h-full w-full pointer-events-none",n.setAttribute("data-dialog-portal",""),document.body.appendChild(n),n}),[m]),v=(0,He.useCallback)((e=>{e&&(e.close=a)}),[a]);return p?(0,e.jsx)(Or.Vq,Tr(Tr({tabIndex:0,className:(0,r.classNames)("pointer-events-auto z-[1] m-0 flex h-full w-full flex-col border-[--popover-border-color] bg-default p-0 md:h-auto md:max-h-[85vh] md:w-160 md:rounded md:border md:bg-[--popover-background-color] md:shadow-main md:[backdrop-filter:var(--popover-backdrop-filter)]","focus-visible:shadow-none focus-visible:outline-none",l),backdrop:(0,e.jsx)("div",{className:(0,r.classNames)("pointer-events-auto absolute z-0 h-full w-full bg-passive-5 opacity-0","md:opacity-50 md:transition-opacity md:duration-75 [&[data-enter]]:md:opacity-75",c),onClick:a}),ref:(0,kr.l)([f,v,n]),store:g,modal:!1,portal:!0,portalElement:y,preventBodyScroll:!0,hideOnInteractOutside:!1},d),{},{children:o})):null})),Rr=(0,He.createContext)(null),Lr=Rr.Provider,Qr=()=>{const e=(0,He.useContext)(Rr);if(!e)throw new Error("invalid PremiumModal context");return e},Ur=(0,Nn.Pi)((t=>{let{application:n,children:i}=t;const o=n.featuresController.premiumAlertFeatureName||"",s=n.hasValidFirstPartySubscription(),a=(0,He.useCallback)((e=>{n.featuresController.showPremiumAlert(e).catch(console.error)}),[n.featuresController]),l=(0,He.useCallback)((()=>{n.featuresController.closePremiumAlert()}),[n.featuresController]),c=(0,He.useCallback)((()=>{n.featuresController.showSuperDemoModal()}),[n.featuresController]),u=(0,He.useMemo)((()=>({activate:a,showSuperDemo:c})),[a,c]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Fr,{isOpen:null!=n.featuresController.premiumAlertType,close:l,className:(0,r.classNames)("w-full",n.featuresController.premiumAlertType===lt.SuperDemo?"md:!h-full md:w-full md:max-w-[70vw]":"!h-auto max-w-[90vw] md:max-w-89"),backdropClassName:"!opacity-50",children:(0,e.jsx)(Pr,{application:n,featureName:o,hasSubscription:s,onClose:l,type:n.featuresController.premiumAlertType})}),(0,e.jsx)(Lr,{value:u,children:i})]})}));Ur.displayName="PremiumModalProvider";const Vr=(0,Nn.Pi)((t=>{let{application:n,children:r}=t;return(0,e.jsx)(Ur,{application:n,children:r})}));var Kr=s(77059),Hr=s(68242);const Gr=n=>{let{uiFeature:i}=n;const o=(0,sr.I)(),s=(0,Bn.o)(),a=Qr(),l=(0,He.useMemo)((()=>o.features.isThirdPartyFeature(i.featureIdentifier)),[o,i.featureIdentifier]),c=(0,He.useMemo)((()=>o.features.getFeatureStatus(i.uniqueIdentifier)===r.FeatureStatus.Entitled),[o,i.uniqueIdentifier]),u=(0,He.useMemo)((()=>c||l),[c,l]),d=(0,He.useCallback)((()=>{u?(i.layerable||!o.componentManager.isThemeActive(i))&&o.componentManager.toggleTheme(i):a.activate("".concat(i.displayName," theme"))}),[o,u,i,a]),h=(0,He.useCallback)((e=>{e.preventDefault(),d()}),[d]),p=o.isNativeMobileWeb()||(0,t.Av)(),f=i.featureIdentifier===r.NativeFeatureIdentifier.TYPES.DynamicTheme&&p,g=(0,He.useMemo)((()=>{if(i.featureIdentifier===r.NativeFeatureIdentifier.TYPES.DarkTheme)return s.keyboardShortcutForCommand(L.Xc)}),[s,i.featureIdentifier]);if(f)return null;const m=!!i&&o.componentManager.isThemeActive(i),y=i.dockIcon;return i.layerable?(0,e.jsxs)(Dn.Z,{checked:m,onChange:()=>d(),children:[!u&&(0,e.jsx)(xn.Z,{type:Mn._,className:(0,Q.classNames)(Mn.K,"mr-2")}),i.displayName]}):(0,e.jsxs)(Kr.Z,{checked:m,onClick:h,children:[(0,e.jsx)("span",{className:(0,Q.classNames)("mr-auto",m?"font-semibold":void 0),children:i.displayName}),g&&(0,e.jsx)(Hr.J,{className:"mr-2",shortcut:g}),i&&u?(0,e.jsx)("div",{className:"h-5 w-5 rounded-full",style:{backgroundColor:null==y?void 0:y.background_color}}):(0,e.jsx)(xn.Z,{type:Mn._,className:(0,Q.classNames)(Mn.K,"ml-auto")})]})},Yr=e=>e.featureIdentifier===r.NativeFeatureIdentifier.TYPES.DarkTheme,zr=(e,t)=>{const n=e.layerable,r=t.layerable;return n&&!r?1:!n&&r?-1:!Yr(e)&&Yr(t)?1:e.displayName.toLowerCase()<t.displayName.toLowerCase()?-1:1};var Zr=s(74522);const Wr=(0,Nn.Pi)((()=>{const{isListPaneCollapsed:t,isNavigationPaneCollapsed:n,toggleListPane:r,toggleNavigationPane:i}=(0,Zr.G)(),o=(0,Bn.o)(),s=(0,He.useMemo)((()=>o.keyboardShortcutForCommand(L.Jr)),[o]),a=(0,He.useMemo)((()=>o.keyboardShortcutForCommand(L.p7)),[o]);return(0,e.jsxs)("div",{className:"hidden md:block pointer-coarse:md-only:hidden pointer-coarse:lg-only:hidden",children:[(0,e.jsx)(Dn.Z,{className:"items-center",checked:!n,onChange:i,shortcut:s,children:"Show Tags Panel"}),(0,e.jsx)(Dn.Z,{className:"items-center",checked:!t,onChange:r,shortcut:a,children:"Show Notes Panel"})]})}));var qr=s(20896),Jr=s(38403);const Xr=(0,Nn.Pi)((t=>{let{closeMenu:n}=t;const i=(0,sr.I)(),{focusModeEnabled:o,setFocusModeEnabled:s}=i.paneController,[a,l]=(0,He.useState)([]),[c,u]=(0,He.useState)([]),d=!i.componentManager.getActiveThemes().find((e=>!e.layerable)),h=(0,He.useRef)(null),p=(0,He.useRef)(null),f=(0,He.useCallback)((()=>{const e=new L.os(i.items),{thirdParty:t,native:n}=e.execute({excludeLayerable:!1});l([...t,...n].sort(zr))}),[i]),g=(0,He.useCallback)((()=>{const e=i.items.getDisplayableComponents().filter((e=>!e.isTheme()&&[r.ComponentArea.EditorStack].includes(e.area)&&e.identifier!==r.NativeFeatureIdentifier.TYPES.DeprecatedFoldersComponent));u(e)}),[i]);(0,He.useEffect)((()=>{a.length||f()}),[f,a.length]),(0,He.useEffect)((()=>{const e=i.items.streamItems(r.ContentType.TYPES.Theme,(()=>{f()}));return()=>{e()}}),[i,f]),(0,He.useEffect)((()=>i.preferences.addEventObserver((e=>{e===r.PreferencesServiceEvent.LocalPreferencesChanged&&f()}))),[i,f]),(0,He.useEffect)((()=>{const e=i.items.streamItems(r.ContentType.TYPES.Component,(()=>{g()}));return()=>{e()}}),[i,g]),(0,He.useEffect)((()=>{var e;null===(e=h.current)||void 0===e||e.focus()}),[]);const m=(0,He.useCallback)((e=>{i.componentManager.toggleComponent(e)}),[i]),y=(0,He.useCallback)((()=>{const e=i.componentManager.getActiveThemes().find((e=>!e.layerable));e&&i.componentManager.toggleTheme(e)}),[i]),v=(0,He.useCallback)((()=>{y()}),[y]);return(0,e.jsxs)(qr.Z,{a11yLabel:"Quick settings menu",children:[c.length>0&&(0,e.jsx)(Jr.Z,{title:"Tools",children:c.map((t=>(0,e.jsxs)(Dn.Z,{onChange:()=>{m(t)},checked:i.componentManager.isComponentActive(t),children:[(0,e.jsx)(xn.Z,{type:"window",className:"mr-2 text-neutral"}),t.displayName]},t.uuid)))}),(0,e.jsxs)(Jr.Z,{title:"Appearance",children:[(0,e.jsx)(Kr.Z,{checked:d,onClick:v,ref:p,children:"Default"}),a.map((t=>(0,e.jsx)(Gr,{uiFeature:t},t.uniqueIdentifier.value)))]}),(0,e.jsx)(jn,{application:i,onToggle:s,onClose:n,isEnabled:o}),(0,e.jsx)(Wr,{})]})}));var $r=s(75711),ei=s(79021);const ti=t=>{let{application:n,isMobileNavigation:i=!1}=t;const o=(0,He.useRef)(null),s=(0,Bn.o)(),[a,l]=(0,He.useState)(!1),c=()=>l(!a);return(0,He.useEffect)((()=>{const e=new r.UIFeature((0,r.GetDarkThemeFeature)());return s.addCommandHandler({command:L.Xc,category:"General",description:"Toggle dark mode",onKeyDown:()=>(n.componentManager.toggleTheme(e),!0)})}),[n,s]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)($r.Z,{label:"Open quick settings menu",children:i?(0,e.jsx)(ei.Z,{className:"ml-2.5 bg-default",onClick:c,label:"Go to vaults menu",icon:"themes"}):(0,e.jsx)("button",{onClick:c,className:"flex h-full w-8 cursor-pointer items-center justify-center",ref:o,children:(0,e.jsx)("div",{className:"h-5",children:(0,e.jsx)(xn.Z,{type:"themes",className:(0,Q.classNames)(a&&"text-info","rounded hover:text-info")})})})}),(0,e.jsx)(On.Z,{title:"Quick settings",togglePopover:c,anchorElement:o,open:a,side:"top",align:"start",className:"md:py-2",children:(0,e.jsx)(Xr,{closeMenu:c})})]})};var ni=s(91819);const ri=(0,Nn.Pi)((t=>{let{mainApplicationGroup:n}=t;const r=(0,sr.I)(),{currentPane:i}=r.accountMenuController,o=(0,He.useCallback)((()=>{r.accountMenuController.closeAccountMenu()}),[r]),s=(0,He.useCallback)((e=>{r.accountMenuController.setCurrentPane(e)}),[r]),a=(0,He.useCallback)((e=>{e.key===L.u8.Escape&&(i===qt.V.GeneralMenu?o():i===qt.V.ConfirmPassword?s(qt.V.Register):s(qt.V.GeneralMenu))}),[o,i,s]);return(0,e.jsx)("div",{id:"account-menu",className:"sn-component",onKeyDown:a,children:(0,e.jsx)(ni.Z,{mainApplicationGroup:n,menuPane:i,setMenuPane:s,closeMenu:o})})})),ii=(0,Nn.Pi)((t=>{let{hasError:n,controller:r,mainApplicationGroup:i,onClickOutside:o,toggleMenu:s,user:a}=t;const l=(0,He.useRef)(null),{show:c}=r;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)($r.Z,{label:"Open account menu",children:(0,e.jsx)("button",{ref:l,onClick:s,className:(0,Q.classNames)(c?"bg-border":"","flex h-full w-8 cursor-pointer items-center justify-center rounded-full"),children:(0,e.jsx)("div",{className:n?"text-danger":a?"text-info":"text-neutral",children:(0,e.jsx)(xn.Z,{type:"account-circle",className:"h-5 w-5 hover:text-info"})})})}),(0,e.jsx)(On.Z,{title:"Account",anchorElement:l,open:c,togglePopover:s,side:"top",align:"start",className:"py-2",children:(0,e.jsx)(ri,{onClickOutside:o,mainApplicationGroup:i})})]})})),oi=(0,Nn.Pi)((t=>{let{application:n,featuresController:r,subscriptionContoller:i}=t;const o=!r.hasFolders,s=i.hasAccount,a=i.hasFirstPartyOnlineOrOfflineSubscription(),l=(0,He.useCallback)((()=>{s&&n.isNativeIOS()?n.showPremiumModal():n.openPurchaseFlow()}),[n,s]);return!o||a?null:(0,e.jsx)("div",{className:"flex h-full items-center px-2",children:(0,e.jsx)("button",{className:"rounded bg-info px-1.5 py-0.5 text-sm font-bold uppercase text-info-contrast hover:brightness-125 lg:text-xs",onClick:l,children:s?"Unlock features":"Sign up to sync"})})})),si=t=>{let{count:n,position:i,className:o}=t;return n?(0,e.jsx)("div",{className:(0,r.classNames)("flex aspect-square h-5 w-5 items-center justify-center rounded-full border border-info-contrast bg-info text-[0.75rem] font-bold text-info-contrast md:text-[0.65rem]","absolute bottom-full translate-y-3 md:translate-y-2","left"===i?"right-full md:translate-x-2":"left-full -translate-x-3 md:-translate-x-2.5",o),children:n}):null},ai=t=>{let{openPreferences:n}=t;const i=(0,sr.I)(),o=(0,Bn.o)(),s=(0,He.useMemo)((()=>(0,L.Ld)(o.keyboardShortcutForCommand(L.QD))),[o]),[a,l]=(0,He.useState)((()=>i.changelogService.getLastReadVersion())),c=(0,He.useMemo)((()=>!(!a||i.isNativeMobileWeb())&&(0,r.compareSemVersions)(i.version,a)>0),[i,a]);(0,He.useEffect)((()=>i.changelogService.addLastReadChangeListener(l)),[i.changelogService]);const u=(0,He.useCallback)((()=>{n(c)}),[c,n]),[d,h]=(0,He.useState)();return(0,He.useEffect)((()=>i.status.addEventObserver(((e,t)=>{e===r.StatusServiceEvent.PreferencesBubbleCountChanged&&h(t)}))),[i.status]),(0,et.ac)(et.Jj.sm)?(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)(ei.Z,{className:"ml-2.5 bg-default",onClick:u,label:"Go to preferences",icon:"tune"}),(0,e.jsx)(si,{position:"right",count:d})]}):(0,e.jsx)($r.Z,{label:"Open preferences (".concat(s,")"),children:(0,e.jsxs)("button",{onClick:u,className:"group relative flex h-full w-8 cursor-pointer items-center justify-center",children:[(0,e.jsxs)("div",{className:"relative h-5",children:[(0,e.jsx)(xn.Z,{type:"tune",className:"rounded group-hover:text-info"}),(0,e.jsx)(si,{position:"right",count:d})]}),c&&(0,e.jsx)("div",{className:"absolute right-0.5 top-0.5 h-2 w-2 rounded-full bg-info"})]})})};var li=s(88743),ci=s(37211),ui=s(13959),di=s(41707);const hi=t=>{let{vault:n,members:r,closeModal:i}=t;const o=(0,sr.I)(),[s,a]=(0,He.useState)(null),[l,c]=(0,He.useState)(!1),u=(0,He.useCallback)((async()=>{if(s&&n.isSharedVaultListing())try{c(!0);const e=await o.vaultUsers.designateSurvivor(n,s.user_uuid);if(e.isFailed())throw new Error(e.getError());await o.sync.sync(),i()}catch(e){console.error(e)}finally{c(!1)}}),[o.sync,o.vaultUsers,i,s,n]),d=(0,He.useMemo)((()=>[{label:l?(0,e.jsx)(di.Z,{className:"h-5 w-5 border-info-contrast"}):"Designate survivor",onClick:u,type:"primary",mobileSlot:"right",disabled:!s||l,hidden:0===r.length},{label:"Cancel",onClick:i,type:"cancel",mobileSlot:"left"}]),[i,u,l,r.length,s]);return(0,e.jsx)(Gn,{title:"Designate survivor",close:i,actions:d,className:"px-4.5 py-4",children:(0,e.jsx)("div",{className:"flex flex-col gap-3",children:r.map((t=>{const n=(null==s?void 0:s.uuid)===t.uuid,r=o.contacts.findContactForServerUser(t);return r?o.vaultUsers.isVaultUserOwner(t)?null:(0,e.jsxs)("label",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[(0,e.jsx)("input",{className:"h-4 w-4 self-center accent-info",type:"radio",name:"survivor",checked:n,onClick:()=>a(t)}),(0,e.jsx)("div",{className:"col-start-2 text-sm font-semibold",children:r.name}),(0,e.jsx)("div",{className:"col-start-2 opacity-90",children:r.contactUuid})]},t.uuid):null}))})})},pi=t=>{let{members:n,isCurrentUserAdmin:r,vault:i,onChange:o}=t;const s=(0,sr.I)(),a=(0,He.useCallback)((async e=>{i.isSharedVaultListing()&&(await s.vaultUsers.removeUserFromSharedVault(i,e.user_uuid),o())}),[s.vaultUsers,i,o]),l=i.isSharedVaultListing()&&!i.sharing.designatedSurvivor,[c,u]=(0,He.useState)(!1),d=()=>u(!1);return(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mb-3 text-lg",children:"Vault Members"}),l&&n.length>1&&r&&(0,e.jsxs)("div",{className:"bg-danger-faded mb-3 grid grid-cols-[auto,1fr] gap-x-[0.65rem] gap-y-0.5 overflow-hidden rounded p-2.5 text-danger",children:[(0,e.jsx)(xn.Z,{type:"warning",className:"place-self-center"}),(0,e.jsx)("div",{className:"text-base font-semibold",children:"No designated survivor"}),(0,e.jsx)("div",{className:"col-start-2",children:"Vaults that have no designated survivor will be deleted when the owner account is deleted. In order to ensure that no data is lost, please designate a survivor who will be transferred ownership of the vault."}),(0,e.jsx)(Ln.Z,{small:!0,className:"col-start-2 mt-1.5",onClick:()=>u(!0),children:"Designate survivor"}),(0,e.jsx)(Fr,{isOpen:c,close:d,children:(0,e.jsx)(hi,{vault:i,members:n,closeModal:d})})]}),(0,e.jsx)("div",{className:"space-y-3.5",children:n.map((t=>{const n=s.vaultUsers.isVaultUserOwner(t),i=s.contacts.findContactForServerUser(t),o=s.vaultUsers.getFormattedMemberPermission(t.permission);return(0,e.jsxs)("div",{className:"grid grid-cols-[auto,1fr] gap-x-[0.65rem] gap-y-0.5 text-base font-medium md:text-sm",children:[(0,e.jsx)(xn.Z,{type:"user",className:"col-start-1 col-end-2 place-self-center"}),(0,e.jsxs)("div",{className:"flex items-center gap-2 overflow-hidden text-ellipsis text-base font-bold",children:[(0,e.jsx)("span",{children:(null==i?void 0:i.name)||t.user_uuid}),i?(0,e.jsxs)("div",{className:"flex items-center gap-1 rounded bg-success px-1 py-0.5 text-xs text-success-contrast",children:[(0,e.jsx)(xn.Z,{type:"check-circle",size:"small"}),"Trusted"]}):(0,e.jsxs)("div",{className:"flex items-center gap-1 rounded bg-danger px-1 py-0.5 pr-1.5 text-xs text-danger-contrast",children:[(0,e.jsx)(xn.Z,{type:"clear-circle-filled",size:"small"}),"Untrusted"]}),t.is_designated_survivor&&(0,e.jsxs)("div",{className:"flex items-center gap-1 rounded bg-info px-1 py-0.5 text-xs text-success-contrast",children:[(0,e.jsx)(xn.Z,{type:"security",size:"small"}),"Designated survivor"]})]}),(0,e.jsx)("div",{className:"col-start-2 row-start-2",children:o}),r&&!n&&(0,e.jsx)(Ln.Z,{className:"col-start-2 row-start-3 mt-1",label:"Remove From Vault",onClick:()=>a(t),small:!0})]},(null==i?void 0:i.uuid)||t.user_uuid)}))})]})},fi=t=>{let{invites:n,onChange:r,isAdmin:i}=t;const o=(0,sr.I)(),s=(0,He.useCallback)((async e=>{await o.vaultInvites.deleteInvite(e),r()}),[o.vaultInvites,r]);return(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mb-3 text-lg",children:"Pending Invites"}),(0,e.jsx)("div",{className:"space-y-3.5",children:n.map((t=>{const n=o.contacts.findContactForInvite(t),r=o.vaultUsers.getFormattedMemberPermission(t.permission);return(0,e.jsxs)("div",{className:"grid grid-cols-[auto,1fr] gap-x-[0.65rem] gap-y-0.5 text-base font-medium md:text-sm",children:[(0,e.jsx)(xn.Z,{type:"user",className:"col-start-1 col-end-2 place-self-center"}),(0,e.jsxs)("div",{className:"flex items-center gap-2 overflow-hidden text-ellipsis text-base font-bold",children:[(0,e.jsx)("span",{children:(null==n?void 0:n.name)||t.user_uuid}),n?(0,e.jsxs)("div",{className:"flex items-center gap-1 rounded bg-success px-1 py-0.5 text-xs text-success-contrast",children:[(0,e.jsx)(xn.Z,{type:"check-circle",size:"small"}),"Trusted"]}):(0,e.jsxs)("div",{className:"flex items-center gap-1 rounded bg-danger px-1 py-0.5 pr-1.5 text-xs text-danger-contrast",children:[(0,e.jsx)(xn.Z,{type:"clear-circle-filled",size:"small"}),"Untrusted"]})]}),(0,e.jsx)("div",{className:"col-start-2 row-start-2",children:r}),i&&(0,e.jsx)(Ln.Z,{label:"Cancel Invite",className:"col-start-2 row-start-3 mt-1",onClick:()=>s(t),small:!0})]},t.uuid)}))})]})};var gi=s(91467);const mi=[{value:r.KeySystemPasswordType.Randomized,label:"Randomized (Recommended)",description:"Your vault key will be randomly generated and synced to your account."},{value:r.KeySystemPasswordType.UserInputted,label:"Custom (Advanced)",description:"Choose your own key for your vault. This is an advanced option and is not recommended for most users."}],yi=t=>{let{value:n,onChange:i,onCustomKeyChange:o}=t;const[s,a]=(0,He.useState)("");return(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mb-3 text-lg",children:"Vault Key Type"}),(0,e.jsx)("div",{className:"mb-1 space-y-3",children:mi.map((t=>{const o=n===t.value;return(0,e.jsxs)("label",{className:"grid grid-cols-[auto,1fr] gap-x-[0.65rem] gap-y-1 text-base font-medium md:text-sm",children:[(0,e.jsx)(Ke,{className:"col-start-1 col-end-2 place-self-center",name:"option",checked:o,onChange:()=>{i(t.value)}}),(0,e.jsx)("div",{className:(0,r.classNames)("select-none",o?"font-semibold":""),children:t.label}),(0,e.jsx)("div",{className:"col-start-2 row-start-2 text-sm opacity-80",children:t.description})]},t.value)}))}),n===r.KeySystemPasswordType.UserInputted&&(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(gi.Z,{placeholder:"Choose a password",id:"key-input",value:s,onChange:e=>{a(e),o(e)},type:"password"})})]})},vi=[{value:r.KeySystemRootKeyStorageMode.Synced,label:"Synced (Recommended)",description:"Your vault key will be encrypted and synced to your account and automatically available on your other devices."},{value:r.KeySystemRootKeyStorageMode.Local,label:"Local",description:"Your vault key will be encrypted and saved locally on this device. You will need to manually enter your vault key on your other devices."},{value:r.KeySystemRootKeyStorageMode.Ephemeral,label:"Ephemeral",description:"Your vault key will only be stored in memory and will be forgotten when you close the app. You will need to manually enter your vault key on your other devices."}],Ai=t=>{let{value:n,onChange:i}=t;return(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mb-3 text-lg",children:"Vault Key Storage Mode"}),(0,e.jsx)("div",{className:"space-y-3",children:vi.map((t=>{const o=n===t.value;return(0,e.jsxs)("label",{className:"grid grid-cols-[auto,1fr] gap-x-[0.65rem] gap-y-1 text-base font-medium md:text-sm",children:[(0,e.jsx)(Ke,{className:"col-start-1 col-end-2 place-self-center",name:"option",checked:o,onChange:()=>{i(t.value)}}),(0,e.jsx)("div",{className:(0,r.classNames)("select-none",o?"font-semibold":""),children:t.label}),(0,e.jsx)("div",{className:"col-start-2 row-start-2 text-sm opacity-80",children:t.description})]},t.value)}))})]})},bi=e=>{const t=(0,sr.I)(),[n,i]=(0,He.useState)();if((0,He.useEffect)((()=>{if(!e)return;const n=new r.LiveItem(e,t.items,(e=>{i(e)}));return()=>n.deinit()}),[e,t]),e)return n};var wi=s(37658),Si=s(62872);const Ci=(0,He.forwardRef)(((t,n)=>{let{type:r,label:i,currentType:o,selectTab:s}=t;const a=o===r;return(0,e.jsx)("button",{className:"relative mr-2 cursor-pointer border-0 pb-1.5 text-mobile-menu-item focus:shadow-none md:text-tablet-menu-item lg:text-menu-item ".concat(a?"font-medium text-info":"text-text"),onClick:()=>{s(r)},ref:n,children:i})})),Ei=t=>{let{selectedValue:n,onIconChange:i,platform:o,className:s,useIconGrid:a,iconGridClassName:l,autoFocus:c}=t;const u=(0,He.useMemo)((()=>Object.keys(Si.p)),[]),d=(0,He.useMemo)((()=>u.map((e=>({label:e,value:e,icon:e})))),[u]),h=(0,xn.R)(n),p=o===r.Platform.MacWeb||o===r.Platform.MacDesktop,f=o===r.Platform.WindowsWeb||o===r.Platform.WindowsDesktop,g=(0,He.useRef)(null),[m,y]=(0,He.useState)(!0),[v,A]=(0,He.useState)(h?"emoji":"icon"),[b,w]=(0,He.useState)(h?n:"");(0,He.useEffect)((()=>{w(h?n:"")}),[h,n]);const S=e=>{"reset"===e?(i(void 0),w("")):A(e)},C=e=>{i(e)},E=(0,He.useCallback)((e=>{e&&setTimeout((()=>{e.focus()}))}),[]);return(0,e.jsxs)("div",{className:"flex h-full flex-grow flex-col ".concat(s),children:[(0,e.jsxs)("div",{className:"flex",children:[(0,e.jsx)(Ci,{label:"Icon",type:"icon",currentType:v,selectTab:S}),(0,e.jsx)(Ci,{label:"Emoji",type:"emoji",currentType:v,selectTab:S}),(0,e.jsx)(Ci,{label:"Reset",type:"reset",currentType:v,selectTab:S})]}),(0,e.jsxs)("div",{className:(0,Q.classNames)("mt-1 h-full min-h-0","icon"===v&&"overflow-auto"),children:["icon"===v&&(a?(0,e.jsx)("div",{className:(0,Q.classNames)("flex w-full flex-wrap items-center gap-6 p-1 md:max-h-24 md:gap-4 md:p-0",l),children:u.map(((t,n)=>(0,e.jsx)("button",{onClick:()=>{C(t)},ref:0===n?E:void 0,children:(0,e.jsx)(xn.Z,{type:t})},t)))}):(0,e.jsx)(wi.Z,{fullWidth:!0,label:"Change the icon for a tag",items:d,value:n,onChange:C})),"emoji"===v&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ui.Z,{ref:g,autocomplete:!1,autofocus:null!=c?c:m,type:"text",value:b,onChange:e=>(e=>{var t;w(e),1===function(e){try{return[...(new Intl.Segmenter).segment(e)].length}catch(t){return[...e].length}}(e)?(i(e),null===(t=g.current)||void 0===t||t.blur(),y(!1)):y(!0)})(e)}),(0,e.jsx)("div",{className:"mt-2 text-sm text-passive-0 lg:text-xs",children:"Use your keyboard to enter or paste in an emoji character."}),p&&(0,e.jsx)("div",{className:"mt-2 text-sm text-passive-0 lg:text-xs",children:"On macOS: ⌘ + ⌃ + Space bar to bring up emoji picker."}),f&&(0,e.jsx)("div",{className:"mt-2 text-sm text-passive-0 lg:text-xs",children:"On Windows: Windows key + . to bring up emoji picker."})]})]})]})};var Ii=s(22457),_i=s(89776),xi=s(10114);const Pi=t=>{let{onCloseDialog:n,existingVaultUuid:i,creatingSharedVault:o}=t;const s=(0,sr.I)(),a=bi(i),[l,c]=(0,He.useState)(""),[u,d]=(0,He.useState)(""),[h,p]=(0,He.useState)("safe-square"),[f,g]=(0,He.useState)([]),[m,y]=(0,He.useState)([]),[v,A]=(0,He.useState)(!1),[b,w]=(0,He.useState)(!0),[S,C]=(0,He.useState)(r.KeySystemPasswordType.Randomized),[E,I]=(0,He.useState)(r.KeySystemRootKeyStorageMode.Synced),[_,x]=(0,He.useState)(void 0),[P,k]=(0,He.useState)(!1),B=(0,He.useRef)(null);(0,He.useEffect)((()=>{var e,t;a&&(c(null!==(e=a.name)&&void 0!==e?e:""),d(null!==(t=a.description)&&void 0!==t?t:""),p(a.iconString),C(a.rootKeyParams.passwordType),I(a.keyStorageMode))}),[s.vaults,a]);const O=(0,He.useCallback)((async()=>{if(a&&a.isSharedVaultListing()){w(a.isSharedVaultListing()&&s.vaultUsers.isCurrentUserSharedVaultAdmin(a)),A(!0);const e=await s.vaultUsers.getSharedVaultUsersFromServer(a);e&&g(e);const t=await s.vaultInvites.getOutboundInvites(a);(0,r.isClientDisplayableError)(t)||y(t),A(!1)}}),[s,a]);(0,He.useEffect)((()=>{O()}),[s.vaults,O]);const N=(0,He.useCallback)((()=>{n()}),[n]),D=(0,He.useCallback)((async e=>{var t;if(!l)return void(null===(t=B.current)||void 0===t||t.focus());e.name===l&&e.description===u&&e.iconString===h||await s.vaults.changeVaultMetadata(e,{name:l,description:u,iconString:h});const n=e.keyPasswordType!==S,i=e.keyStorageMode!==E;(n||i)&&await s.vaults.changeVaultKeyOptions({vault:e,newPasswordOptions:n?(()=>{if(!n)throw new Error("Password type is not changing");if(S===r.KeySystemPasswordType.UserInputted){if(!_)throw new Error("Custom password is not set");return{passwordType:S,userInputtedPassword:_}}return{passwordType:S}})():void 0,newStorageMode:i?E:void 0}),N()}),[s.vaults,_,u,N,h,E,l,S]),j=(0,He.useCallback)((async()=>{var e;if(l){if(S===r.KeySystemPasswordType.UserInputted){if(!_)throw new Error("Custom key is not set");o?await s.sharedVaults.createSharedVault({name:l,description:u,iconString:h,storagePreference:E,userInputtedPassword:_}):await s.vaults.createUserInputtedPasswordVault({name:l,description:u,iconString:h,storagePreference:E,userInputtedPassword:_})}else o?await s.sharedVaults.createSharedVault({name:l,description:u,iconString:h,storagePreference:E,userInputtedPassword:void 0}):await s.vaults.createRandomizedVault({name:l,description:u,iconString:h});N()}else null===(e=B.current)||void 0===e||e.focus()}),[s.sharedVaults,s.vaults,o,_,u,N,h,E,l,S]),T=(0,He.useCallback)((async()=>{P||(k(!0),a?await D(a):await j(),k(!1))}),[P,a,D,j]),M=(0,He.useMemo)((()=>[{label:a?"Save Vault":o?"Create Shared Vault":"Create Vault",onClick:T,type:"primary",mobileSlot:"right",disabled:P},{label:"Cancel",onClick:N,type:"cancel",mobileSlot:"left"}]),[o,a,N,T,P]),[F,R]=(0,He.useState)(!1),L=(0,He.useRef)(null),Q=(0,He.useCallback)((()=>{R((e=>!e))}),[]),U=(0,Ii.M)(),V=U.useState("open");return a&&s.vaultLocks.isVaultLocked(a)?(0,e.jsx)("div",{children:"Vault is locked."}):(0,e.jsx)(Gn,{title:a?"Edit Vault":"Create New Vault",close:N,actions:M,children:(0,e.jsxs)("div",{className:"flex w-full flex-col space-y-3.5 px-4.5 py-4",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-lg",children:"Vault Info"}),(0,e.jsx)("div",{className:"mt-1",children:"The vault name and description are end-to-end encrypted."}),(0,e.jsxs)("div",{className:"mt-3.5 flex items-center gap-3",children:[(0,e.jsx)($r.Z,{className:"!z-modal",label:"Choose icon",children:(0,e.jsx)(Ln.Z,{className:"!px-1.5",ref:L,onClick:Q,children:(0,e.jsx)(xn.Z,{type:h})})}),(0,e.jsx)(On.Z,{title:"Choose icon",open:F,anchorElement:L,togglePopover:Q,align:"start",overrideZIndex:"z-modal",hideOnClickInModal:!0,children:(0,e.jsx)("div",{className:"p-2",children:(0,e.jsx)(Ei,{selectedValue:h||"safe-square",onIconChange:e=>{p(null!=e?e:"safe-square"),Q()},platform:s.platform,useIconGrid:!0})})}),(0,e.jsx)(ui.Z,{className:{container:"flex-grow"},ref:B,value:l,placeholder:"Vault Name",onChange:e=>{c(e)}})]}),(0,e.jsx)(ui.Z,{className:{container:"mt-3"},value:u,placeholder:"Vault description",onChange:e=>{d(e)}})]}),a?v?(0,e.jsxs)("div",{className:"flex items-center gap-3 py-2 text-base",children:[(0,e.jsx)(di.Z,{className:"h-5 w-5"}),"Loading collaboration info..."]}):(0,e.jsxs)(e.Fragment,{children:[f.length>0&&(0,e.jsx)(pi,{vault:a,members:f,onChange:O,isCurrentUserAdmin:b}),m.length>0&&(0,e.jsx)(fi,{invites:m,onChange:O,isAdmin:b})]}):null,(0,e.jsxs)(_i.p,{store:U,className:"flex items-center justify-between focus:shadow-none focus:outline-none",children:[(0,e.jsx)("div",{className:"text-lg",children:"Advanced options"}),(0,e.jsx)(xn.Z,{type:V?"chevron-up":"chevron-down"})]}),(0,e.jsxs)(xi.k_,{className:"space-y-3.5 pb-3",store:U,children:[(0,e.jsx)(yi,{value:S,onChange:C,onCustomKeyChange:x}),(0,e.jsx)(Ai,{value:E,onChange:I})]})]})})},ki=t=>{let{isVaultModalOpen:n,closeVaultModal:r,vault:i,creatingSharedVault:o}=t;return(0,e.jsx)(Fr,{className:"md:max-h-[70vh]",isOpen:n,close:r,children:(0,e.jsx)(Pi,{creatingSharedVault:o,existingVaultUuid:null==i?void 0:i.uuid,onCloseDialog:r})})},Bi=e=>{const t=(0,sr.I)(),n=e.keyPasswordType===r.KeySystemPasswordType.UserInputted&&e.keyStorageMode===r.KeySystemRootKeyStorageMode.Ephemeral,[i,o]=(0,He.useState)((()=>t.vaultLocks.isVaultLocked(e)));(0,He.useEffect)((()=>t.vaultLocks.addEventObserver((n=>{n!==r.VaultLockServiceEvent.VaultLocked&&n!==r.VaultLockServiceEvent.VaultUnlocked||o(t.vaultLocks.isVaultLocked(e))}))),[t.vaultLocks,e]);const s=(0,He.useCallback)((async()=>{n&&(i?t.vaultDisplayService.unlockVault(e).catch(console.error):t.vaultLocks.lockNonPersistentVault(e).catch(console.error))}),[t.vaultDisplayService,t.vaultLocks,n,i,e]),a=!e.isSharedVaultListing()||t.vaultUsers.isCurrentUserSharedVaultAdmin(e),l=!e.isSharedVaultListing()||t.vaultUsers.isCurrentUserSharedVaultOwner(e),c=(0,He.useCallback)((async()=>!t.vaultLocks.isVaultLocked(e)||await t.vaultDisplayService.unlockVault(e)),[t,e]);return{canShowLockOption:n,isLocked:i,toggleLock:s,ensureVaultIsUnlocked:c,isCurrentUserAdmin:a,isCurrentUserOwner:l}},Oi=t=>{let{vault:n}=t;const{canShowLockOption:r,isLocked:i,toggleLock:o,ensureVaultIsUnlocked:s}=Bi(n),[a,l]=(0,He.useState)(!1),c=(0,He.useCallback)((async()=>{await s()&&l(!0)}),[s]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(qr.Z,{a11yLabel:"Vault options menu",children:[(0,e.jsxs)(ci.Z,{onClick:c,children:[(0,e.jsx)(xn.Z,{type:"pencil-filled",className:"mr-2"}),"Edit vault"]}),r&&(0,e.jsxs)(ci.Z,{onClick:o,children:[(0,e.jsx)(xn.Z,{type:"lock",className:"mr-2"}),i?"Unlock":"Lock"," vault"]})]}),(0,e.jsx)(ki,{vault:n,isVaultModalOpen:a,closeVaultModal:()=>l(!1)})]})},Ni=t=>{let{vault:n,children:i}=t;const[o,s]=(0,He.useState)(!1),a=(0,He.useRef)(null),l=()=>{s((e=>!e))};return(0,e.jsxs)("div",{className:"group flex items-center gap-3 px-3 focus-within:bg-info-backdrop",children:[i,(0,e.jsx)("button",{className:(0,r.classNames)("flex-shrink-0 rounded-full border border-border p-1 hover:bg-default focus:bg-default group-focus-within:bg-default",o&&"bg-default"),onClick:l,ref:a,children:(0,e.jsx)(xn.Z,{type:"more",size:"small"})}),(0,e.jsx)(On.Z,{title:"Vault options",open:o,anchorElement:a,side:"top",align:"start",className:"py-1",togglePopover:l,children:(0,e.jsx)(Oi,{vault:n})})]})},Di=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),[n,i]=(0,He.useState)((()=>t.vaults.getVaults()));(0,He.useEffect)((()=>t.items.streamItems(r.ContentType.TYPES.VaultListing,(()=>{i(t.vaults.getVaults())}))),[t.items,t.vaults]);const o=(0,He.useCallback)((e=>!t.vaultDisplayService.isVaultDisabledOrLocked(e)),[t]),s=(0,He.useCallback)((e=>{o(e)?t.vaultDisplayService.hideVault(e):t.vaultDisplayService.unhideVault(e)}),[o,t]);return(0,e.jsxs)(qr.Z,{a11yLabel:"Vault selection menu",children:[!n.length&&(0,e.jsx)("div",{className:"py-1 text-center",children:"No vaults found"}),n.map((n=>(0,e.jsx)(Ni,{vault:n,children:(0,e.jsxs)(Dn.Z,{className:"flex-grow !px-0 focus:!bg-transparent",onChange:()=>{s(n)},checked:o(n),children:[(0,e.jsx)(xn.Z,{type:n.iconString,className:"mr-2 text-neutral"}),(0,e.jsxs)("div",{className:"flex w-full items-center gap-1",children:[n.name,t.vaultLocks.isVaultLocked(n)&&(0,e.jsx)(xn.Z,{className:"ml-1",type:"lock",size:"small"})]})]})},n.uuid)))]})})),ji=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),[n,i]=(0,He.useState)((()=>t.vaults.getVaults()));(0,He.useEffect)((()=>t.items.streamItems(r.ContentType.TYPES.VaultListing,(()=>{i(t.vaults.getVaults())}))),[t.items,t.vaults]);const o=(0,He.useCallback)((e=>t.vaultDisplayService.isVaultExclusivelyShown(e)),[t]),s=(0,He.useCallback)((e=>{t.vaultDisplayService.showOnlyVault(e)}),[t]);return(0,e.jsxs)(qr.Z,{a11yLabel:"Vault selection menu",children:[!n.length&&(0,e.jsx)("div",{className:"py-1 text-center",children:"No vaults found"}),n.map((n=>(0,e.jsx)(Ni,{vault:n,children:(0,e.jsxs)(Kr.Z,{className:"!px-0 focus:!bg-transparent md:!py-[0.455rem]",checked:o(n),onClick:()=>s(n),children:[n.name,t.vaultLocks.isVaultLocked(n)&&(0,e.jsx)(xn.Z,{className:"ml-1",type:"lock",size:"small"})]},n.uuid)},n.uuid)))]})}));var Ti=s(51694);const Mi=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),[n,r]=(0,He.useState)(t.vaultDisplayService.isInExclusiveDisplayMode()?"single":"many");return(0,e.jsxs)(qr.Z,{a11yLabel:"Vault selection menu",children:[(0,e.jsx)(li.Z,{items:[{label:"Multiple",value:"many"},{label:"One",value:"single"}],value:n,onChange:e=>(e=>{r(e),"many"===e&&t.vaultDisplayService.exclusivelyShownVault&&t.vaultDisplayService.changeToMultipleVaultDisplayMode()})(e),className:"m-3 mt-1"}),"many"===n&&(0,e.jsx)(Di,{}),"single"===n&&(0,e.jsx)(ji,{}),(0,e.jsx)(Ti.Z,{}),(0,e.jsx)(ci.Z,{icon:"settings",onClick:()=>{t.preferencesController.openPreferences("vaults")},children:"Open vault settings"})]})})),Fi=(0,Nn.Pi)((t=>{let{isMobileNavigation:n=!1}=t;const r=(0,sr.I)(),i=(0,He.useRef)(null),o=r.vaultDisplayService.exclusivelyShownVault,[s,a]=(0,He.useState)(!1),l=()=>a(!s);return r.featuresController.isVaultsEnabled()?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)($r.Z,{label:"Open vault selection menu",children:n?(0,e.jsx)(ei.Z,{className:"ml-2.5 bg-default",onClick:l,label:"Go to vaults menu",icon:"safe-square"}):(0,e.jsx)("button",{onClick:l,className:"flex h-full cursor-pointer items-center justify-center",ref:i,children:(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)(xn.Z,{type:"safe-square",className:(0,Q.classNames)(s?"text-info":o?"text-success":"","rounded hover:text-info")}),o&&(0,e.jsx)("div",{className:(0,Q.classNames)("ml-1 text-xs font-bold",s&&"text-info"),children:o.name})]})})}),(0,e.jsx)(On.Z,{title:"Vault options",togglePopover:l,anchorElement:i,open:s,side:"top",align:"start",className:"py-2",children:(0,e.jsx)(Mi,{})})]}):null})),Ri=class extends _n{constructor(e){super(e,e.application),this.didCheckForOffline=!1,this.completedInitialSync=!1,this.showingDownloadStatus=!1,this.securityUpdateClickHandler=async()=>{await(0,L.VG)({title:ht.X5,text:ht.j0,confirmButtonText:ht.I0})&&(0,t.A1)(ht.Cp,(async()=>{await this.application.upgradeProtocolVersion()})).catch(console.error)},this.accountMenuClickHandler=()=>{this.application.accountMenuController.toggleShow()},this.syncResolutionClickHandler=()=>{this.setState({showSyncResolution:!this.state.showSyncResolution})},this.closeAccountMenu=()=>{this.application.accountMenuController.setShow(!1),this.application.accountMenuController.setCurrentPane(qt.V.GeneralMenu)},this.lockClickHandler=()=>{this.application.lock().catch(console.error)},this.onNewUpdateAvailable=()=>{this.setState({newUpdateAvailable:!0})},this.newUpdateClickHandler=()=>{this.setState({newUpdateAvailable:!1}),this.application.alerts.alert(ht.Lw).catch(console.error)},this.betaMessageClickHandler=()=>{(0,L.Ne)({title:"You are using a beta version of the app",text:"If you wish to go back to a stable version, make sure to sign out of this beta app first."}).catch(console.error)},this.clickOutsideAccountMenu=()=>{this.application.accountMenuController.closeAccountMenu()},this.openPreferences=e=>{e&&this.application.preferencesController.setCurrentPane("whats-new"),this.application.preferencesController.openPreferences()},this.state={hasError:!1,offline:!0,outOfSync:!1,dataUpgradeAvailable:!1,hasPasscode:!1,descriptors:e.applicationGroup.getDescriptors(),showBetaWarning:!1,showSyncResolution:!1,newUpdateAvailable:!1},this.webEventListenerDestroyer=e.application.addWebEventObserver(((e,t)=>{const n=this.application.status;switch(e){case r.WebAppEvent.NewUpdateAvailable:this.onNewUpdateAvailable();break;case r.WebAppEvent.EditorDidFocus:t.eventSource===kn.UserInteraction&&this.closeAccountMenu();break;case r.WebAppEvent.BeganBackupDownload:n.setMessage("Saving local backup…");break;case r.WebAppEvent.EndedBackupDownload:{const e="Successfully saved backup.",r="Unable to save local backup.";n.setMessage(t.success?e:r),setTimeout((()=>{n.message!==e&&n.message!==r||n.setMessage("")}),2e3);break}}}))}deinit(){this.removeStatusObserver(),this.removeStatusObserver=void 0,this.webEventListenerDestroyer(),this.webEventListenerDestroyer=void 0,super.deinit(),(0,t.h6)(this)}componentDidMount(){super.componentDidMount(),this.removeStatusObserver=this.application.status.addEventObserver(((e,t)=>{e===r.StatusServiceEvent.MessageChanged&&this.setState({arbitraryStatusMessage:t})}))}reloadUpgradeStatus(){this.application.checkForSecurityUpdate().then((e=>{this.setState({dataUpgradeAvailable:e})})).catch(console.error)}async onAppLaunch(){super.onAppLaunch().catch(console.error),this.reloadPasscodeStatus().catch(console.error),this.reloadUser(),this.reloadUpgradeStatus(),this.updateOfflineStatus(),this.findErrors()}reloadUser(){this.user=this.application.sessions.getUser()}async reloadPasscodeStatus(){const e=this.application.hasPasscode();this.setState({hasPasscode:e})}async onAppKeyChange(){super.onAppKeyChange().catch(console.error),this.reloadPasscodeStatus().catch(console.error)}onAppEvent(e,t){switch(e){case r.ApplicationEvent.KeyStatusChanged:this.reloadUpgradeStatus();break;case r.ApplicationEvent.EnteredOutOfSync:this.setState({outOfSync:!0});break;case r.ApplicationEvent.ExitedOutOfSync:this.setState({outOfSync:!1});break;case r.ApplicationEvent.CompletedFullSync:this.completedInitialSync||(this.application.status.setMessage(""),this.completedInitialSync=!0),this.didCheckForOffline||(this.didCheckForOffline=!0,this.state.offline&&0===this.application.items.getNoteCount()&&this.application.accountMenuController.setShow(!0)),this.findErrors(),this.updateOfflineStatus(),this.setState({failedSyncError:void 0});break;case r.ApplicationEvent.SyncStatusChanged:this.updateSyncStatus();break;case r.ApplicationEvent.FailedSync:this.updateSyncStatus(),this.findErrors(),this.updateOfflineStatus(),this.setState({failedSyncError:(0,r.getErrorMessageFromErrorResponseBody)(t,"Sync error. Please try again later.")});break;case r.ApplicationEvent.LocalDataIncrementalLoad:case r.ApplicationEvent.LocalDataLoaded:this.updateLocalDataStatus();break;case r.ApplicationEvent.SignedIn:case r.ApplicationEvent.SignedOut:this.reloadUser();break;case r.ApplicationEvent.WillSync:this.completedInitialSync||this.application.status.setMessage("Syncing…")}}updateSyncStatus(){const e=this.application.status,t=this.application.sync.getSyncStatus(),n=t.getStats();if(t.hasError())e.setMessage("Unable to Sync");else if(n.downloadCount>20){const t="Downloading ".concat(n.downloadCount," items. Keep app open.");e.setMessage(t),this.showingDownloadStatus=!0}else if(this.showingDownloadStatus)this.showingDownloadStatus=!1,e.setMessage("Download Complete."),setTimeout((()=>{e.setMessage("")}),2e3);else if(n.uploadTotalCount>20){const t=(0===n.uploadCompletionCount?0:n.uploadCompletionCount/n.uploadTotalCount).toLocaleString(void 0,{style:"percent"});e.setMessage("Syncing ".concat(n.uploadTotalCount," items (").concat(t," complete)"))}else e.setMessage("")}updateLocalDataStatus(){const e=this.application.status,t=this.application.sync.getSyncStatus().getStats(),n=this.application.isEncryptionAvailable();if(t.localDataDone)return void e.setMessage("");const r="".concat(t.localDataCurrent,"/").concat(t.localDataTotal," items..."),i=n?"Decrypting ".concat(r):"Loading ".concat(r);e.setMessage(i)}updateOfflineStatus(){this.setState({offline:this.application.sessions.isSignedOut()})}findErrors(){this.setState({hasError:this.application.sync.getSyncStatus().hasError()})}render(){return(0,e.jsx)("div",{className:"sn-component",children:(0,e.jsxs)("footer",{id:"footer-bar",className:"z-footer-bar hidden h-8 w-full select-none items-center justify-between border-t border-border bg-contrast px-3 text-text md:flex",children:[(0,e.jsxs)("div",{className:"left flex h-full flex-shrink-0",children:[(0,e.jsx)("div",{className:"sk-app-bar-item relative z-footer-bar-item ml-0 select-none",children:(0,e.jsx)(ii,{hasError:this.state.hasError,controller:this.application.accountMenuController,mainApplicationGroup:this.props.applicationGroup,onClickOutside:this.clickOutsideAccountMenu,toggleMenu:this.accountMenuClickHandler,user:this.user})}),(0,e.jsx)("div",{className:"relative z-footer-bar-item select-none",children:(0,e.jsx)(ai,{openPreferences:this.openPreferences})}),(0,e.jsx)("div",{className:"relative z-footer-bar-item select-none",children:(0,e.jsx)(ti,{application:this.application})}),(0,e.jsx)("div",{className:"relative z-footer-bar-item  ml-1.5 select-none",children:(0,e.jsx)(Fi,{})}),(0,e.jsx)(oi,{application:this.application,featuresController:this.application.featuresController,subscriptionContoller:this.application.subscriptionController}),this.state.showBetaWarning&&(0,e.jsx)(He.Fragment,{children:(0,e.jsx)("div",{className:"relative z-footer-bar-item ml-3 flex select-none items-center border-l border-solid border-border pl-3",children:(0,e.jsx)("a",{onClick:this.betaMessageClickHandler,className:"no-decoration title text-xs font-bold",children:"You are using a beta version of the app"})})})]}),(0,e.jsx)("div",{className:"center max-h-full overflow-hidden px-4",children:this.state.arbitraryStatusMessage&&(0,e.jsx)("div",{className:"relative z-footer-bar-item max-h-full select-none items-center overflow-hidden text-ellipsis whitespace-nowrap text-xs font-bold text-neutral",children:this.state.arbitraryStatusMessage})}),(0,e.jsxs)("div",{className:"right flex h-full flex-shrink-0",children:[this.state.failedSyncError&&(0,e.jsxs)("div",{className:"relative z-footer-bar-item flex select-none items-center text-xs font-bold text-neutral",children:["Sync error: ",this.state.failedSyncError]}),this.state.dataUpgradeAvailable&&(0,e.jsx)("div",{onClick:this.securityUpdateClickHandler,className:"relative z-footer-bar-item flex select-none items-center text-xs font-bold text-success",children:"Encryption upgrade available."}),this.state.newUpdateAvailable&&(0,e.jsx)("div",{onClick:this.newUpdateClickHandler,className:"relative z-footer-bar-item ml-3 flex select-none items-center text-xs font-bold text-info",children:"New update available."}),(this.state.outOfSync||this.state.showSyncResolution)&&(0,e.jsxs)("div",{className:"relative z-footer-bar-item ml-3 flex flex-shrink-0 select-none items-center",children:[this.state.outOfSync&&(0,e.jsx)("div",{onClick:this.syncResolutionClickHandler,className:"text-xs font-bold text-warning",children:"Potentially Out of Sync"}),this.state.showSyncResolution&&(0,e.jsx)(Pn,{close:this.syncResolutionClickHandler,application:this.application})]}),this.state.offline&&(0,e.jsx)("div",{className:"relative z-footer-bar-item ml-3 flex flex-shrink-0 select-none items-center text-xs font-bold",children:"Offline"}),this.state.hasPasscode&&(0,e.jsx)($r.Z,{label:"Lock application",children:(0,e.jsx)("div",{id:"lock-item",onClick:this.lockClickHandler,title:"Locks application and wipes unencrypted data from memory.",className:"relative z-footer-bar-item ml-3 flex cursor-pointer select-none items-center border-l border-solid border-border pl-2 hover:text-info",children:(0,e.jsx)(xn.Z,{type:"lock-filled",size:"custom",className:"h-4.5 w-4.5"})})})]})]})})}},Li=["children","closeDialog","className"];function Qi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ui(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Vi=t=>{let{children:n,closeDialog:i,className:o}=t,s=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,Li);const a=(0,Br.I)(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qi(Object(n),!0).forEach((function(t){Ui(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({open:!0},s)),l=(0,He.useCallback)((e=>{e&&(e.close=i)}),[i]);return(0,e.jsxs)(Or.Vq,{store:a,role:"alertdialog",className:"pointer-events-auto fixed left-0 top-0 z-modal flex h-full w-full items-center justify-center",modal:!1,portal:!0,preventBodyScroll:!0,ref:l,children:[(0,e.jsx)("div",{className:"absolute z-0 h-full w-full bg-passive-5 opacity-25 md:opacity-75",role:"presentation",onClick:i}),(0,e.jsx)("div",{className:(0,r.classNames)("z-[1] w-[95vw] rounded border border-[--popover-border-color] bg-[--popover-background-color] px-6 py-5 shadow-xl [backdrop-filter:var(--popover-backdrop-filter)] md:w-auto",!(null==o?void 0:o.includes("max-w-"))&&"max-w-[600px]",o),children:n})]})};function Ki(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Hi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ki(Object(n),!0).forEach((function(t){Gi(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ki(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Gi(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Yi=t=>{let{application:n}=t;const[i,o,s,a,l]=function(e){const[t,n]=(0,He.useState)([]),[i,o]=(0,He.useState)(Date.now()),[s,a]=(0,He.useState)(!0),[l,c]=(0,He.useState)("");return(0,He.useEffect)((()=>{(async()=>{var t,i,o;a(!0);const s=await e.getSessions();if((0,r.isErrorResponse)(s))(null===(i=null===(t=s.data)||void 0===t?void 0:t.error)||void 0===i?void 0:i.message)?c(null===(o=s.data)||void 0===o?void 0:o.error.message):c("An unknown error occured while loading sessions.");else{const e=s.data;n(e),c("")}a(!1)})().catch(console.error)}),[e,i]),[t,function(){o(Date.now())},s,async function(i){const o=t,s=e.revokeSession(i),a=t.slice(),l=t.findIndex((e=>e.uuid===i));a[l]=Hi(Hi({},a[l]),{},{revoking:!0}),n(a);const u=await s;u?(0,r.isErrorResponse)(u)?(c((0,r.getErrorFromErrorResponse)(u).message||"An unknown error occured while revoking the session."),n(o)):n(t.filter((e=>e.uuid!==i))):n(o)},l]}(n),[c,u]=(0,He.useState)(""),d=()=>u(""),h=(0,He.useRef)(null),p=(0,He.useMemo)((()=>new Intl.DateTimeFormat(void 0,{year:"numeric",month:"long",day:"numeric",weekday:"long",hour:"numeric",minute:"numeric"})),[]),f=()=>{u("")},g=(0,He.useMemo)((()=>[{label:"Close",onClick:n.closeSessionsModal,type:"cancel",mobileSlot:"left"},{label:"Refresh",onClick:o,type:"primary",mobileSlot:"right"}]),[o,n.closeSessionsModal]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Gn,{title:"Active Sessions",close:n.closeSessionsModal,actions:g,children:(0,e.jsx)("div",{className:"px-4 py-4",children:s?(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(di.Z,{className:"h-3 w-3"}),(0,e.jsx)("h2",{className:"sk-p sessions-modal-refreshing",children:"Loading sessions"})]}):(0,e.jsxs)(e.Fragment,{children:[l&&(0,e.jsx)("div",{role:"alert",className:"sk-p bold",children:l}),i.length>0&&(0,e.jsx)("ul",{children:i.map((t=>(0,e.jsxs)("li",{children:[(0,e.jsx)("h2",{className:"text-base font-bold",children:t.device_info}),t.current?(0,e.jsx)("span",{className:"font-bold text-info",children:"Current session"}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("p",{children:["Signed in on ",p.format(new Date(t.created_at))]}),(0,e.jsx)(Ln.Z,{primary:!0,small:!0,colorStyle:"danger",disabled:t.revoking,onClick:()=>u(t.uuid),children:(0,e.jsx)("span",{children:"Revoke"})})]})]},t.uuid)))})]})})}),c&&(0,e.jsxs)(Vi,{closeDialog:f,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between text-lg font-bold",children:[r.SessionStrings.RevokeTitle,(0,e.jsx)("button",{className:"rounded p-1 font-bold hover:bg-contrast",onClick:f,children:(0,e.jsx)(xn.Z,{type:"close"})})]}),(0,e.jsx)("div",{className:"sk-panel-row",children:(0,e.jsx)("p",{className:"text-base text-foreground lg:text-sm",children:r.SessionStrings.RevokeText})}),(0,e.jsxs)("div",{className:"mt-4 flex justify-end gap-2",children:[(0,e.jsx)(Ln.Z,{ref:h,onClick:d,children:(0,e.jsx)("span",{children:r.SessionStrings.RevokeCancelButton})}),(0,e.jsx)(Ln.Z,{primary:!0,colorStyle:"danger",onClick:()=>{d(),a(c).catch(console.error)},children:(0,e.jsx)("span",{children:r.SessionStrings.RevokeConfirmButton})})]})]})]})},zi=(0,Nn.Pi)((t=>{let{application:n}=t;return(0,e.jsx)(Fr,{isOpen:n.isSessionsModalVisible,close:n.closeSessionsModal,className:"sessions-modal",children:(0,e.jsx)(Yi,{application:n})})}));class Zi{static async load(){const e=new Map;return(0,r.GetFeatures)().forEach((t=>{e.set(t.identifier,"Latest")})),new Zi(e)}constructor(e){this.latestVersionsMap=e,(0,_.ky)(this,{latestVersionsMap:_.LO.ref})}getVersion(e){return this.latestVersionsMap.get(e.package_info.identifier)}}const Wi=[{id:"whats-new",label:"What's New",icon:"asterisk",order:0},{id:"account",label:"Account",icon:"user",order:1},{id:"general",label:"General",icon:"settings",order:3},{id:"security",label:"Security",icon:"security",order:4},{id:"backups",label:"Backups",icon:"restore",order:5},{id:"appearance",label:"Appearance",icon:"themes",order:6},{id:"listed",label:"Listed",icon:"listed",order:7},{id:"shortcuts",label:"Shortcuts",icon:"keyboard",order:8},{id:"plugins",label:"Plugins",icon:"dashboard",order:8},{id:"accessibility",label:"Accessibility",icon:"accessibility",order:9},{id:"get-free-month",label:"Get a free month",icon:"star",order:10},{id:"help-feedback",label:"Help & feedback",icon:"help",order:11}],qi=[{id:"whats-new",label:"What's New",icon:"asterisk",order:0},{id:"account",label:"Account",icon:"user",order:1},{id:"general",label:"General",icon:"settings",order:3},{id:"security",label:"Security",icon:"security",order:4},{id:"backups",label:"Backups",icon:"restore",order:5},{id:"appearance",label:"Appearance",icon:"themes",order:6},{id:"listed",label:"Listed",icon:"listed",order:7},{id:"plugins",label:"Plugins",icon:"dashboard",order:8},{id:"help-feedback",label:"Help & feedback",icon:"help",order:11}];function Ji(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ji(Object(n),!0).forEach((function(t){$i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ji(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function $i(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class eo{constructor(e,n){this.application=e,this._enableUnfinishedFeatures=n,this._selectedPane="account",this._extensionLatestVersions=new Zi(new Map),this.selectPane=e=>{this._selectedPane=e};const r=this._enableUnfinishedFeatures?Wi.slice():qi.slice();e.featuresController.isVaultsEnabled()&&r.push({id:"vaults",label:"Vaults",icon:"safe-square",order:5}),(0,t.Z$)()&&r.push({id:"home-server",label:"Home Server",icon:"server",order:5}),this._menu=r.sort(((e,t)=>e.order-t.order)),this.loadLatestVersions(),(0,_.ky)(this,{_twoFactorAuth:_.LO,_selectedPane:_.LO,_extensionPanes:_.LO.ref,_extensionLatestVersions:_.LO.ref,loadLatestVersions:_.aD,updateMenuBubbleCounts:_.aD}),this.application.status.addEventObserver((e=>{e===Ne.rW4.PreferencesBubbleCountChanged&&this.updateMenuBubbleCounts()}))}updateMenuBubbleCounts(){this._menu=this._menu.map((e=>Xi(Xi({},e),{},{bubbleCount:this.application.status.getPreferencesBubbleCount(e.id)})))}loadLatestVersions(){Zi.load().then((e=>{e&&(this._extensionLatestVersions=e)})).catch(console.error)}get extensionsLatestVersions(){return this._extensionLatestVersions}get menuItems(){return this._menu.map((e=>Xi(Xi({},e),{},{selected:e.id===this._selectedPane,bubbleCount:this.application.status.getPreferencesBubbleCount(e.id),hasErrorIndicator:this.sectionHasBubble(e.id)})))}get selectedMenuItem(){return this._menu.find((e=>e.id===this._selectedPane))}get selectedPaneId(){return null!=this.selectedMenuItem?this.selectedMenuItem.id:"account"}sectionHasBubble(e){return"security"===e&&this.application.items.invalidNonVaultedItems.length>0}}const to=()=>(0,e.jsx)("button",{className:"peer flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-full bg-danger text-danger-contrast",children:(0,e.jsx)(xn.Z,{type:"warning",size:"small"})}),no=t=>{let{iconType:n,label:i,selected:o,onClick:s,bubbleCount:a,hasErrorIndicator:l}=t;return(0,e.jsxs)("div",{className:"preferences-menu-item box-border flex h-auto w-auto min-w-42 cursor-pointer select-none flex-row items-center justify-start rounded border border-solid px-4 py-2 text-sm hover:border-border hover:bg-default ".concat(o?"selected border-info font-bold text-info":"border-transparent"),onClick:e=>{e.preventDefault(),s()},children:[(0,e.jsxs)("div",{className:"relative mr-1",children:[(0,e.jsx)(xn.Z,{className:(0,r.classNames)("text-base",o?"text-info":"text-neutral"),type:n}),(0,e.jsx)(si,{position:"left",count:a})]}),(0,e.jsx)("div",{className:"min-w-1"}),i,l&&(0,e.jsx)("span",{className:"ml-2",children:(0,e.jsx)(to,{})})]})},ro=(0,Nn.Pi)((t=>{let{menu:n}=t;const{selectedPaneId:r,selectPane:i,menuItems:o}=n,s=(0,He.useMemo)((()=>o.map((e=>({icon:e.icon,label:e.label,value:e.id})))),[o]);return(0,e.jsxs)("div",{className:"border-b border-border bg-default px-5 py-2 md:border-0 md:bg-[--preferences-background-color] md:px-0 md:py-0",children:[(0,e.jsx)("div",{className:"hidden min-w-55 flex-col overflow-y-auto px-3 py-6 md:flex",children:o.map((t=>(0,e.jsx)(no,{iconType:t.icon,label:t.label,selected:t.selected,bubbleCount:t.bubbleCount,hasErrorIndicator:t.hasErrorIndicator,onClick:()=>{i(t.id)}},t.id)))}),(0,e.jsx)("div",{className:"md:hidden",children:(0,e.jsx)(wi.Z,{items:s,label:"Preferences Menu",value:r,onChange:e=>{i(e)},classNameOverride:{wrapper:"relative",button:"focus:outline-none focus:shadow-none focus:ring-none"},popoverPlacement:"bottom"})})]})})),io=t=>{let{children:n}=t;return(0,e.jsxs)("div",{className:"flex min-h-0 flex-grow flex-col overflow-y-auto text-foreground md:flex-row",children:[(0,e.jsx)("div",{className:"flex flex-grow flex-col items-center px-3 py-6 md:px-0",children:(0,e.jsx)("div",{className:"flex max-w-full flex-col md:w-125 md:max-w-125",children:null!=n&&Array.isArray(n)?n.filter((e=>null!=e)):n})}),(0,e.jsx)("div",{className:"hidden flex-shrink basis-[13.75rem] md:block"})]})};var oo=s(53846),so=s(55088);const ao=(0,Nn.Pi)((t=>{let{application:n}=t;const r=(0,He.useRef)(null),[i,o]=(0,He.useState)(!1),{isBackupEncrypted:s,isEncryptionEnabled:a,setIsBackupEncrypted:l,setIsEncryptionEnabled:c,setEncryptionStatusString:u}=n.accountMenuController,d=(0,He.useCallback)((()=>{const e=n.hasAccount(),t=n.hasPasscode(),r=e||t,i=e?ht.CN:t?ht.zu:ht.KV;u(i),c(r),l(r)}),[n,u,l,c]);(0,He.useEffect)((()=>{d()}),[d]);const h=async e=>{o(!0);const t=await n.importData(e);o(!1);let r=ht.ng;t.isFailed()?r=t.getError():t.getValue().errorCount&&(r=(0,ht.hy)(t.getValue().errorCount)),(0,L.Ne)({text:r})};return(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)(Ye.Z,{children:[(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Data backups"}),(0,e.jsx)(Ge.QE,{children:"Download a backup of all your text-based data"}),a&&(0,e.jsx)("form",{className:"sk-panel-form sk-panel-row",children:(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsxs)("label",{className:"flex items-center gap-2",children:[(0,e.jsx)("input",{type:"radio",onChange:()=>l(!0),checked:s}),(0,e.jsx)("span",{className:"text-base font-medium md:text-sm",children:"Encrypted"})]}),(0,e.jsxs)("label",{className:"flex items-center gap-2",children:[(0,e.jsx)("input",{type:"radio",onChange:()=>l(!1),checked:!s}),(0,e.jsx)("span",{className:"text-base font-medium md:text-sm",children:"Decrypted"})]})]})}),(0,e.jsx)(Ln.Z,{onClick:async()=>{const e=s?await n.createEncryptedBackupFile.execute():await n.createDecryptedBackupFile.execute();if(e.isFailed())return;const t=e.getValue(),r=new Blob([JSON.stringify(t,null,2)],{type:"text/json"});if(s){const e="Standard Notes Encrypted Backup and Import File - ".concat(n.archiveService.formattedDateForExports()),t=(0,Q.sanitizeFileName)(e)+".txt";(0,so.c)({archiveService:n.archiveService,platform:n.platform,mobileDevice:n.mobileDevice,blob:r,filename:t,isNativeMobileWeb:n.isNativeMobileWeb(),showToastOnAndroid:void 0})}else{const e=await n.archiveService.getZippedDecryptedItemsBlob(t),r="Standard Notes Backup - ".concat(n.archiveService.formattedDateForExports()),i=(0,Q.sanitizeFileName)(r)+".zip";(0,so.c)({archiveService:n.archiveService,platform:n.platform,mobileDevice:n.mobileDevice,blob:e,filename:i,isNativeMobileWeb:n.isNativeMobileWeb(),showToastOnAndroid:void 0})}},label:"Download backup",className:"mt-2"})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{children:"Import a previously saved backup file"}),(0,e.jsxs)("div",{className:"mt-3 flex flex-row items-center",children:[(0,e.jsx)(Ln.Z,{label:"Import backup",onClick:e=>{if(e instanceof KeyboardEvent){const{code:t}=e;if("Enter"!==t&&"Space"!==t)return;e.preventDefault()}r.current.click()}}),(0,e.jsx)("input",{type:"file",ref:r,onChange:async e=>{var t,r;const{files:i}=e.target;if(!i)return;const s=i[0],a=await(async e=>{if("application/zip"!==e.type)return new Promise((t=>{const r=new FileReader;r.onload=e=>{var r;try{const n=JSON.parse(null===(r=e.target)||void 0===r?void 0:r.result);t(n)}catch(e){n.alerts.alert(ht.fv).catch(console.error)}},r.readAsText(e)}));n.alerts.alert(ht.FG).catch(console.error)})(s);if(!a)return;const l=a.version||(null===(t=a.keyParams)||void 0===t?void 0:t.version)||(null===(r=a.auth_params)||void 0===r?void 0:r.version);l?n.encryption.supportedVersions().includes(l)?await h(a):(o(!1),(0,L.Ne)({text:ht.ip})):await h(a)},className:"hidden"}),i&&(0,e.jsx)(di.Z,{className:"ml-4"})]})]})]})})})),lo=(0,Nn.Pi)((n=>{let{application:i}=n;const[o,s]=(0,He.useState)(!1),[a,l]=(0,He.useState)(r.EmailBackupFrequency.Disabled),[c,u]=(0,He.useState)([]),d=i.hasAccount(),h=(0,He.useCallback)((async()=>{if(i.sessions.getUser()){s(!0);try{const e=await i.settings.listSettings();l(e.getSettingValue(r.SettingName.create(r.SettingName.NAMES.EmailBackupFrequency).getValue(),r.EmailBackupFrequency.Disabled))}catch(e){console.error(e)}finally{s(!1)}}}),[i]);(0,He.useEffect)((()=>{const e=[];for(const t in r.EmailBackupFrequency){const n=r.EmailBackupFrequency[t];e.push({value:n,label:i.settings.getEmailBackupFrequencyOptionLabel(n)})}u(e),h().catch(console.error)}),[i,h]);return(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Email backups"}),!(0,t.Z$)()&&(0,e.jsx)(Ge.xv,{className:"mb-3",children:"Receive daily encrypted email backups of all your notes directly in your email inbox."}),(0,e.jsxs)("div",{className:"".concat(d?"":"pointer-events-none cursor-default opacity-50"),children:[(0,e.jsx)(Ge.QE,{children:"Frequency"}),(0,e.jsx)(Ge.xv,{children:"How often to receive backups."}),(0,e.jsx)("div",{className:"mt-2",children:o?(0,e.jsx)(di.Z,{className:"h-5 w-5 flex-shrink-0"}):(0,e.jsx)(wi.Z,{label:"Select email frequency",items:c,value:a,onChange:e=>{(async e=>{const t=a;l(e),await(async(e,t)=>{try{return await i.settings.updateSetting(e,t,!1),!0}catch(e){return i.alerts.alert(ht.p7).catch(console.error),!1}})(r.SettingName.create(r.SettingName.NAMES.EmailBackupFrequency).getValue(),e)||l(t)})(e).catch(console.error)}})})]})]})})}));var co=s(54310);const uo=t=>{let{icon:n,status:r,checkmark:i=!0}=t;return(0,e.jsxs)("div",{className:"text-input no-border my-1 flex min-h-8 w-full flex-row items-center rounded bg-contrast px-3 py-1.5 focus-within:ring-info",children:[n,(0,e.jsx)("div",{className:"min-h-1 min-w-3"}),(0,e.jsx)("div",{className:"flex-grow text-sm text-text",children:r}),(0,e.jsx)("div",{className:"min-h-1 min-w-3"}),i&&(0,e.jsx)(xn.Z,{className:"min-h-4 min-w-4 text-success",type:"check-bold"})]})},ho=t=>{let{application:n}=t;const[i,o]=(0,He.useState)(void 0),[s,a]=(0,He.useState)(void 0),[l,c]=(0,He.useState)(void 0),[u,d]=(0,He.useState)(!1),h=(0,He.useMemo)((()=>new co.XQ),[]);(0,He.useEffect)((()=>{i?n.files.decryptBackupMetadataFile(i).then(a):a(void 0)}),[i,n]);const p=(0,He.useCallback)((async()=>{const e=await n.files.selectFile(h);"aborted"!==e&&"failed"!==e&&c(e)}),[n,h]),f=(0,He.useCallback)((async()=>{if(!s||!l)return;d(!0);const e=await n.files.readBackupFileAndSaveDecrypted(l,s,h);"success"===e?(n.alerts.alert("<strong>".concat(s.name,"</strong> has been successfully decrypted and saved to your chosen directory.")),c(void 0),a(void 0),o(void 0)):"failed"===e&&n.alerts.alert("Unable to save file to local directory. This may be caused by failure to decrypt, or failure to save the file locally."),d(!1)}),[s,n,l,h]),g=(0,He.useCallback)((async e=>{const t=await e.text(),r=n.files.isFileNameFileBackupRelated(e.name);if(!1!==r)if("binary"!==r)try{const e=JSON.parse(t);o(e)}catch(e){console.error(e)}else n.alerts.alert("Please drag the metadata file instead of the encrypted data file.")}),[n.alerts,n.files]),m=(0,He.useCallback)((e=>{e.stopPropagation()}),[]),y=(0,He.useCallback)((e=>{e.stopPropagation()}),[]),v=(0,He.useCallback)((e=>{e.stopPropagation()}),[]),A=(0,He.useCallback)((async e=>{var t;e.preventDefault(),e.stopPropagation();const n=null===(t=e.dataTransfer)||void 0===t?void 0:t.items;if(!n||0===n.length)return;const r=n[0].getAsFile();r&&(await g(r).catch(console.error),e.dataTransfer.clearData())}),[g]);return(0,He.useEffect)((()=>(window.addEventListener("dragenter",y),window.addEventListener("dragleave",v),window.addEventListener("dragover",m),window.addEventListener("drop",A),()=>{window.removeEventListener("dragenter",y),window.removeEventListener("dragleave",v),window.removeEventListener("dragover",m),window.removeEventListener("drop",A)})),[y,A,m,v]),i?(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)(ze.Z,{children:[!s&&(0,e.jsx)(Ge.xv,{children:"Attempting to decrypt metadata file..."}),s&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.Dx,{children:"Backup Decryption"}),(0,e.jsx)(uo,{status:s.name,icon:(0,e.jsx)(xn.Z,{type:"attachment-file",className:"min-h-5 min-w-5"}),checkmark:!0}),(0,e.jsx)(oo.Z,{classes:"mt-3 mb-3"}),(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)(Ge.QE,{children:"1. Choose related data file"}),(0,e.jsxs)(Ge.xv,{className:"em mr-3 text-xs ".concat(l?"success font-bold":""),children:[i.file.uuid,"/",r.FileBackupsConstantsV1.BinaryFileName]})]}),(0,e.jsx)("div",{children:(0,e.jsx)(Ln.Z,{label:"Choose",className:"min-w-40 px-1 text-xs",onClick:p,disabled:!!l})})]}),(0,e.jsx)(oo.Z,{classes:"mt-3 mb-3"}),(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)(Ge.QE,{children:"2. Decrypt and save file to your computer"}),(0,e.jsx)("div",{children:(0,e.jsx)(Ln.Z,{label:u?void 0:"Save",className:"min-w-40 px-1 text-xs",onClick:f,disabled:u||!l,children:u&&(0,e.jsx)("div",{className:"flex w-full justify-center",children:(0,e.jsx)(di.Z,{className:"h-5 w-5"})})})})]})]})]})}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(Ge.xv,{className:"mb-2",children:["To decrypt a backup file, drag and drop the file's respective ",(0,e.jsx)("i",{children:"metadata.sn.json"})," file here or select it below."]}),(0,e.jsx)(Ln.Z,{onClick:()=>{co.Re.selectFiles().then((async e=>{if(0===e.length)return;const t=e[0];g(t).catch(console.error)})).catch(console.error)},children:"Select file"})]})};var po=s(88669);const fo=(0,Nn.Pi)((t=>{let{backupsService:n}=t;const r=(0,sr.I)(),[i,o]=(0,He.useState)(n.isFilesBackupsEnabled()),[s,a]=(0,He.useState)(n.getFilesBackupsLocation()),l=(0,He.useCallback)((async()=>{const e=await n.changeFilesBackupsLocation();a(e)}),[n]),c=(0,He.useCallback)((async()=>{await n.openFilesBackupsLocation()}),[n]),u=(0,He.useCallback)((async()=>{i?n.disableFilesBackups():await n.enableFilesBackups(),o(n.isFilesBackupsEnabled()),a(n.getFilesBackupsLocation())}),[n,i]);return(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)(Ye.Z,{children:[(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Automatic file backups"}),(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)("div",{className:"mr-10 flex flex-col",children:(0,e.jsx)(Ge.QE,{children:"Automatically save encrypted backups of your uploaded files to this computer."})}),(0,e.jsx)(po.Z,{onChange:u,checked:i})]}),!i&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(oo.Z,{classes:"mt-2.5 mb-4"}),(0,e.jsx)(Ge.xv,{children:"File backups are not enabled. Enable to choose where your files are backed up."})]})]}),i&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsx)(ze.Z,{children:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.xv,{className:"mb-3",children:"Files backups are enabled. When you upload a new file on any device and open this application, files will be backed up in encrypted form to:"}),(0,e.jsx)(uo,{status:s||"Not Set",icon:(0,e.jsx)(xn.Z,{type:"attachment-file",className:"min-h-5 min-w-5"}),checkmark:!1}),(0,e.jsxs)("div",{className:"mt-2.5 flex flex-row",children:[(0,e.jsx)(Ln.Z,{label:"Open Location",className:"mr-3 text-xs",onClick:c}),(0,e.jsx)(Ln.Z,{label:"Change Location",className:"mr-3 text-xs",onClick:l})]})]})})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsx)(ze.Z,{children:(0,e.jsx)(ho,{application:r})})]})})})),go=t=>{let{application:n}=t;const r=(0,He.useMemo)((()=>n.fileBackups),[n]);return r?(0,e.jsx)(fo,{backupsService:r}):(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)(Ye.Z,{children:[(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Automatic file backups"}),(0,e.jsx)(Ge.QE,{children:"Automatically save encrypted backups of your files."}),(0,e.jsx)(Ge.xv,{className:"mt-3",children:"To enable file backups, use the Standard Notes desktop application."})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsx)(ze.Z,{children:(0,e.jsx)(ho,{application:n})})]})})},mo=(0,Nn.Pi)((t=>{let{backupsService:n}=t;const r=(0,sr.I)(),[i,o]=(0,He.useState)(n.isTextBackupsEnabled()),[s,a]=(0,He.useState)(n.getTextBackupsLocation()),l=(0,He.useCallback)((async()=>{const e=await n.changeTextBackupsLocation();a(e)}),[n]),c=(0,He.useCallback)((async()=>{await n.openTextBackupsLocation()}),[n]),u=(0,He.useCallback)((async()=>{i?n.disableTextBackups():await n.enableTextBackups(),o(n.isTextBackupsEnabled()),a(n.getTextBackupsLocation())}),[i,n]),d=(0,He.useCallback)((async()=>{var e;null===(e=r.desktopManager)||void 0===e||e.saveDesktopBackup()}),[r]);return(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)(Ye.Z,{children:[(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Automatic Encrypted Text Backups"}),(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)("div",{className:"mr-10 flex flex-col",children:(0,e.jsx)(Ge.QE,{children:"Automatically save encrypted text backups of all your note and tag data to this computer."})}),(0,e.jsx)(po.Z,{onChange:u,checked:i})]}),!i&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(oo.Z,{classes:"mt-2.5 mb-4"}),(0,e.jsx)(Ge.xv,{children:"Text backups are not enabled. Enable to choose where your data is backed up."})]})]}),i&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.xv,{className:"mb-3",children:"Text backups are enabled and saved to:"}),(0,e.jsx)(uo,{status:s||"Not Set",icon:(0,e.jsx)(xn.Z,{type:"attachment-file",className:"min-h-5 min-w-5"}),checkmark:!1}),(0,e.jsxs)("div",{className:"mt-2.5 flex flex-row",children:[(0,e.jsx)(Ln.Z,{label:"Open Location",className:"mr-3 text-xs",onClick:c}),(0,e.jsx)(Ln.Z,{label:"Change Location",className:"mr-3 text-xs",onClick:l})]})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsx)(Ge.xv,{className:"mb-3",children:"Backups are saved automatically throughout the day. You can perform a one-time backup now below."}),(0,e.jsx)("div",{className:"flex flex-row",children:(0,e.jsx)(Ln.Z,{label:"Perform Backup",className:"mr-3 text-xs",onClick:d})})]})]})]})})})),yo=t=>{let{application:n}=t;const r=(0,He.useMemo)((()=>n.fileBackups),[n]);return r?(0,e.jsx)(mo,{backupsService:r}):(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Automatic text backups"}),(0,e.jsx)(Ge.QE,{children:"Automatically save encrypted and decrypted backups of your note and tag data."}),(0,e.jsx)(Ge.xv,{className:"mt-3",children:"To enable text backups, use the Standard Notes desktop application."})]})})})},vo=(0,Nn.Pi)((t=>{let{backupsService:n}=t;const[r,i]=(0,He.useState)(n.isPlaintextBackupsEnabled()),[o,s]=(0,He.useState)(n.getPlaintextBackupsLocation()),a=(0,He.useCallback)((async()=>{const e=await n.changePlaintextBackupsLocation();s(e)}),[n]),l=(0,He.useCallback)((async()=>{await n.openPlaintextBackupsLocation()}),[n]),c=(0,He.useCallback)((async()=>{r?n.disablePlaintextBackups():await n.enablePlaintextBackups(),i(n.isPlaintextBackupsEnabled()),s(n.getPlaintextBackupsLocation())}),[r,n]);return(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)(Ye.Z,{children:[(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Automatic plaintext backups"}),(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)("div",{className:"mr-10 flex flex-col",children:(0,e.jsx)(Ge.QE,{children:"Automatically save backups of all your notes to this computer into plaintext, non-encrypted folders."})}),(0,e.jsx)(po.Z,{onChange:c,checked:r})]}),!r&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(oo.Z,{classes:"mt-2.5 mb-4"}),(0,e.jsx)(Ge.xv,{children:"Plaintext backups are not enabled. Enable to choose where your data is backed up."})]})]}),r&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsx)(ze.Z,{children:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.xv,{className:"mb-3",children:"Plaintext backups are enabled and saved to:"}),(0,e.jsx)(uo,{status:o||"Not Set",icon:(0,e.jsx)(xn.Z,{type:"attachment-file",className:"min-h-5 min-w-5"}),checkmark:!1}),(0,e.jsxs)("div",{className:"mt-2.5 flex flex-row",children:[(0,e.jsx)(Ln.Z,{label:"Open Location",className:"mr-3 text-xs",onClick:l}),(0,e.jsx)(Ln.Z,{label:"Change Location",className:"mr-3 text-xs",onClick:a})]})]})})]})]})})})),Ao=()=>{const t=(0,sr.I)(),n=(0,He.useMemo)((()=>t.fileBackups),[t]);return n?(0,e.jsx)(vo,{backupsService:n}):(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Automatic plaintext backups"}),(0,e.jsx)(Ge.QE,{children:"Automatically save backups of all your notes into plaintext, non-encrypted folders."}),(0,e.jsx)(Ge.xv,{className:"mt-3",children:"To enable plaintext backups, use the Standard Notes desktop application."})]})})})},bo=(0,Nn.Pi)((t=>{let{application:n}=t;const r=!n.sessions.isSignedIntoFirstPartyServer();return(0,e.jsxs)(io,{children:[(0,e.jsx)(ao,{application:n}),(0,e.jsx)(yo,{application:n}),(0,e.jsx)(Ao,{}),(0,e.jsx)(go,{application:n}),!r&&(0,e.jsx)(lo,{application:n})]})})),wo=t=>{let{application:n}=t;const[i,o]=(0,Er.D)(r.LocalPrefKey.EditorLineHeight),s=(0,He.useMemo)((()=>Object.values(r.EditorLineHeight).map((e=>({label:e,value:e})))),[]),[a,l]=(0,Er.D)(r.LocalPrefKey.EditorMonospaceEnabled),[c,u]=(0,Er.D)(r.LocalPrefKey.EditorFontSize),d=(0,He.useMemo)((()=>Object.values(r.EditorFontSize).map((e=>({label:e,value:e})))),[]),[h]=(0,Er.D)(r.LocalPrefKey.EditorLineWidth),p=(0,He.useCallback)((()=>{n.keyboardService.triggerCommand(L.Wu,!0)}),[n.keyboardService]);return(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Editor"}),(0,e.jsxs)("div",{className:"mt-2",children:[(0,e.jsxs)("div",{className:"flex justify-between gap-2 md:items-center",children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)(Ge.QE,{children:"Monospace Font"}),(0,e.jsx)(Ge.xv,{children:"Toggles the font style in plaintext and Super notes"})]}),(0,e.jsx)(po.Z,{onChange:()=>{l(!a)},checked:a})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)("div",{children:[(0,e.jsx)(Ge.QE,{children:"Font size"}),(0,e.jsx)(Ge.xv,{children:"Sets the font size in plaintext and Super notes"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(wi.Z,{label:"Select the font size for plaintext notes",items:d,value:c,onChange:e=>{u(e)}})})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)("div",{children:[(0,e.jsx)(Ge.QE,{children:"Line height"}),(0,e.jsx)(Ge.xv,{children:"Sets the line height (leading) in plaintext and Super notes"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(wi.Z,{label:"Select the line height for plaintext notes",items:s,value:i,onChange:e=>{o(e)}})})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)("div",{children:[(0,e.jsx)(Ge.QE,{children:"Editor width"}),(0,e.jsx)(Ge.xv,{children:"Sets the max editor width for all notes"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsxs)("button",{className:"flex w-full min-w-55 items-center justify-between rounded border border-border bg-default px-3.5 py-1.5 text-left text-base text-foreground md:w-fit lg:text-sm",onClick:p,children:[h===r.EditorLineWidth.FullWidth?"Full width":h,(0,e.jsx)(xn.Z,{type:"chevron-down",size:"normal"})]})})]})]})]})})},So=(0,Nn.Pi)((t=>{let{application:n}=t;const i=Qr(),[o,s]=(0,He.useState)([]),[a,l]=(0,Er.D)(r.LocalPrefKey.AutoLightThemeIdentifier),[c,u]=(0,Er.D)(r.LocalPrefKey.AutoDarkThemeIdentifier),[d,h]=(0,Er.D)(r.LocalPrefKey.UseSystemColorScheme),[p,f]=(0,Er.D)(r.LocalPrefKey.UseTranslucentUI);return(0,He.useEffect)((()=>{const e=new L.os(n.items),{thirdParty:t,native:i}=e.execute({excludeLayerable:!0}),o=[];o.push({label:"Default",value:"Default"}),o.push(...i.map((e=>({label:e.displayName,value:e.featureIdentifier,icon:n.features.getFeatureStatus(e.uniqueIdentifier)!==r.FeatureStatus.Entitled?Mn._:void 0})))),o.push(...t.map((e=>({label:e.displayName,value:e.featureIdentifier})))),s((0,r.naturalSort)(o,"label"))}),[n]),(0,e.jsxs)(io,{children:[(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Themes"}),(0,e.jsxs)("div",{className:"mt-2",children:[(0,e.jsxs)("div",{className:"flex justify-between gap-2 md:items-center",children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)(Ge.QE,{children:"Disable translucent UI"}),(0,e.jsx)(Ge.xv,{children:"Use opaque style for UI elements instead of translucency"})]}),(0,e.jsx)(po.Z,{onChange:()=>{f(!p)},checked:!p})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)("div",{className:"flex justify-between gap-2 md:items-center",children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)(Ge.QE,{children:"Use system color scheme"}),(0,e.jsx)(Ge.xv,{children:"Automatically change active theme based on your system settings."})]}),(0,e.jsx)(po.Z,{onChange:()=>{h(!d),n.preferences.getLocalValue(r.LocalPrefKey.AutoLightThemeIdentifier)||l(a),n.preferences.getLocalValue(r.LocalPrefKey.AutoDarkThemeIdentifier)||u(c),h(!d)},checked:d})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)("div",{children:[(0,e.jsx)(Ge.QE,{children:"Automatic Light Theme"}),(0,e.jsx)(Ge.xv,{children:"Theme to be used for system light mode:"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(wi.Z,{label:"Select the automatic light theme",items:o,value:a,onChange:e=>{const t=o.find((t=>t.value===e));t&&t.icon===Mn._?i.activate("".concat(t.label," theme")):l(e)},disabled:!d})})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)("div",{children:[(0,e.jsx)(Ge.QE,{children:"Automatic Dark Theme"}),(0,e.jsx)(Ge.xv,{children:"Theme to be used for system dark mode:"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(wi.Z,{label:"Select the automatic dark theme",items:o,value:c,onChange:e=>{const t=o.find((t=>t.value===e));t&&t.icon===Mn._?i.activate("".concat(t.label," theme")):u(e)},disabled:!d})})]})]})]})}),(0,e.jsx)(wo,{application:n})]})})),Co=(0,Nn.Pi)((t=>{let{application:n}=t;const[i,o]=(0,He.useState)((()=>n.getPreference(r.PrefKey.UpdateSavingStatusIndicator,r.PrefDefaults[r.PrefKey.UpdateSavingStatusIndicator])));return(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Tools"}),(0,e.jsx)("div",{children:(0,e.jsxs)("div",{className:"flex justify-between gap-2 md:items-center",children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)(Ge.QE,{children:"Show note saving status while editing"}),(0,e.jsx)(Ge.xv,{children:"Control whether the animated saving status is shown while editing. Error statuses are always shown regardless of preference."})]}),(0,e.jsx)(po.Z,{onChange:()=>{o(!i),n.setPreference(r.PrefKey.UpdateSavingStatusIndicator,!i).catch(console.error)},checked:i})]})})]})})}));var Eo=s(97168);const Io=t=>{let{name:n,description:r,toggleFeature:i,isEnabled:o}=t;return(0,e.jsxs)("div",{className:"flex justify-between gap-2 md:items-center",children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)(Ge.QE,{children:n}),(0,e.jsx)(Ge.xv,{children:r})]}),(0,e.jsx)(po.Z,{onChange:i,checked:o})]})},_o=t=>{let{application:n}=t;const[i,o]=(0,He.useState)([]),[s,a]=(0,He.useState)((()=>n.getPreference(r.PrefKey.PaneGesturesEnabled,r.PrefDefaults[r.PrefKey.PaneGesturesEnabled])));(0,He.useEffect)((()=>n.addSingleEventObserver(r.ApplicationEvent.PreferencesChanged,(async()=>{a(n.getPreference(r.PrefKey.PaneGesturesEnabled,r.PrefDefaults[r.PrefKey.PaneGesturesEnabled]))}))),[n]);const l=(0,He.useCallback)((()=>{const e=n.features.getExperimentalFeatures().map((e=>{var t,i;const o=(0,r.FindNativeFeature)(e);return{identifier:e,name:null!==(t=null==o?void 0:o.name)&&void 0!==t?t:e,description:null!==(i=null==o?void 0:o.description)&&void 0!==i?i:"",isEnabled:n.features.isExperimentalFeatureEnabled(e),isEntitled:n.features.getFeatureStatus(r.NativeFeatureIdentifier.create(e).getValue())===r.FeatureStatus.Entitled}})).filter((e=>e.identifier!==r.NativeFeatureIdentifier.TYPES.Vaults||ut()));o(e)}),[n]);(0,He.useEffect)((()=>{l()}),[l]);const c=Qr(),u=(0,et.ac)(et.Jj.sm)&&"boolean"==typeof s;return(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Labs"}),(0,e.jsxs)("div",{children:[u&&(0,e.jsx)(Io,{name:"Pane switch gestures",description:"Allows using gestures to navigate",isEnabled:s,toggleFeature:()=>{n.setPreference(r.PrefKey.PaneGesturesEnabled,!s)}}),i.map(((t,r)=>{let{identifier:o,name:s,description:a,isEnabled:u,isEntitled:d}=t;const h=i.length>1&&r!==i.length-1;return(0,e.jsxs)(He.Fragment,{children:[(0,e.jsx)(Io,{name:s,description:a,toggleFeature:()=>{d?(n.features.toggleExperimentalFeature(o),l()):c.activate(s)},isEnabled:u}),h&&(0,e.jsx)(oo.Z,{classes:"mt-2.5 mb-3"})]},o)})),0===i.length&&!u&&(0,e.jsx)("div",{className:"flex items-center justify-between",children:(0,e.jsx)("div",{className:"flex flex-col",children:(0,e.jsx)(Ge.xv,{children:"No experimental features available."})})})]})]})})},xo=(0,Nn.Pi)((t=>{let{application:n,onSuccess:i}=t;const[o,s]=(0,He.useState)(""),[a,l]=(0,He.useState)(!1),[c,u]=(0,He.useState)(!1),[d,h]=(0,He.useState)(!1);(0,He.useEffect)((()=>{n.features.hasOfflineRepo()&&h(!0)}),[n]);const p=async e=>{e.preventDefault();const t=n.homeServer,s=t&&await t.isHomeServerEnabled(),a=s&&await t.isHomeServerRunning();if(s){if(!a)return void await n.alerts.alert("Please start your home server before activating offline features.");const e=n.sessions.getUser();if(!e)return;const i=n.features.parseOfflineEntitlementsCode(o);if(i instanceof r.ClientDisplayableError)return void await n.alerts.alert(i.text);const s=await t.activatePremiumFeatures(e.email,i.subscriptionId);if(s.isFailed())return void await n.alerts.alert(s.getError())}const c=await n.features.setOfflineFeaturesCode(o);c instanceof r.ClientDisplayableError?await n.alerts.alert(c.text):(l(!0),h(!0),u(!1),i&&i())};return n.hasAccount()&&n.sessions.isSignedIntoFirstPartyServer()&&!d?null:(0,e.jsx)(e.Fragment,{children:(0,e.jsx)("div",{className:"flex items-center justify-between",children:(0,e.jsxs)("div",{className:"mt-3 flex w-full flex-col",children:[(0,e.jsxs)("div",{className:"flex flex-row items-center justify-between",children:[(0,e.jsxs)(Ge.QE,{children:[!d&&"Activate"," Offline Subscription"]}),(0,e.jsx)("a",{href:"https://standardnotes.com/help/59/can-i-use-standard-notes-totally-offline",target:"_blank",rel:"noreferrer",className:"text-info",children:"Learn more"})]}),(0,e.jsxs)("form",{onSubmit:p,children:[(0,e.jsx)("div",{className:"mt-2",children:!d&&(0,e.jsx)(ui.Z,{onChange:e=>s(e),placeholder:"Offline Subscription Code",value:o,disabled:a,className:{container:"mb-3"}})}),(a||c)&&(0,e.jsxs)("div",{className:"info mb-3 mt-3",children:["Your offline subscription code has been successfully ",a?"activated":"removed","."]}),d&&(0,e.jsx)(Ln.Z,{colorStyle:"danger",label:"Remove offline key",onClick:()=>{(async()=>{n.alerts.confirm(ht.ZW,"Remove offline key?","Remove Offline Key",r.ButtonType.Danger,"Cancel").then((async e=>{e&&await(async()=>{await n.features.deleteOfflineFeatureRepo(),l(!1),h(!1),s(""),u(!0)})()})).catch((e=>{n.alerts.alert(e).catch(console.error)}))})().catch(console.error)}}),!d&&!a&&(0,e.jsx)(Ln.Z,{hidden:0===o.length,label:"Submit",primary:!0,disabled:""===o,onClick:e=>p(e)})]})]})})})}));var Po=s(2577);const ko=t=>{let{title:n,className:i="",children:o,onClick:s}=t;const a=(0,He.useRef)(null),[l,c]=(0,He.useState)(!1);return(0,e.jsxs)("div",{className:i,children:[(0,e.jsxs)("div",{className:"relative flex cursor-pointer items-center justify-between hover:underline",onClick:()=>{c(!l),s&&s(!l)},children:[(0,e.jsx)(Ge.Dx,{children:n}),(0,e.jsx)(Po.ArrowDownCheckmarkIcon,{className:(0,r.classNames)("h-5 w-5 text-info",l&&"rotate-180")})]}),(0,e.jsx)("div",{className:"accordion-contents-container cursor-auto","data-is-expanded":l,ref:a,children:o})]})},Bo=(0,Nn.Pi)((()=>{const t=(0,sr.I)();return t.hasAccount()&&t.sessions.isSignedIntoFirstPartyServer()&&!t.features.hasOfflineRepo()?null:(0,e.jsx)(Ye.Z,{children:(0,e.jsx)(ze.Z,{children:(0,e.jsx)(ko,{title:"Offline activation",children:(0,e.jsx)("div",{className:"flex flex-row items-center",children:(0,e.jsx)("div",{className:"flex max-w-full flex-grow flex-col",children:t.platform!==r.Platform.Ios&&(0,e.jsx)(xo,{application:t})})})})})})})),Oo={title:"Title","title.length":"Title Length",text:"Text","text.length":"Text Length",noteType:"Note Type",authorizedForListed:"Authorized For Listed",editorIdentifier:"Editor Identifier",userModifiedDate:"User Modified Date",serverUpdatedAt:"Server Updated At",created_at:"Created At",conflict_of:"Conflict Of",protected:"Protected",trashed:"Trashed",pinned:"Pinned",archived:"Archived",locked:"Locked",starred:"Starred",hidePreview:"Hide Preview",spellcheck:"Spellcheck"},No={title:"string","title.length":"number",text:"string","text.length":"number",noteType:"noteType",authorizedForListed:"boolean",editorIdentifier:"editorIdentifier",userModifiedDate:"date",serverUpdatedAt:"date",created_at:"date",conflict_of:"string",protected:"boolean",trashed:"boolean",pinned:"boolean",archived:"boolean",locked:"boolean",starred:"boolean",hidePreview:"boolean",spellcheck:"boolean"};var Do=s(81222);function jo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function To(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jo(Object(n),!0).forEach((function(t){Mo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Mo(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fo(e){const t=[];return t.push(...(0,Et.GetIframeAndNativeEditors)().map((e=>{const[t,n]=(0,Do.i)(e.note_type);return To(To({label:e.name,value:e.identifier,id:Et.NativeFeatureIdentifier.create(e.identifier).getValue()},t?{icon:t}:null),n?{iconClassName:(0,r.classNames)("text-accessory-tint-".concat(n),e.note_type===Et.NoteType.Plain&&"group-hover:text-info-contrast")}:null)}))),t.push(...e.componentManager.thirdPartyComponentsForArea(Et.ComponentArea.Editor).filter((e=>{const t=(0,Et.FindNativeFeature)(e.identifier);return!t||t.deprecated})).map((e=>{const[t,n]=(0,Do.i)(e.noteType);return To(To({label:e.displayName,value:e.identifier},t?{icon:t}:null),n?{iconClassName:"text-accessory-tint-".concat(n)}:null)}))),t.sort(((e,t)=>e.label.toLowerCase()<t.label.toLowerCase()?-1:1)),t}const Ro=t=>{let{keypath:n,value:i,setValue:o}=t;const s=(0,sr.I)(),a=No[n],l=Fo(s);return"noteType"===a?(0,e.jsx)("select",{className:"flex-grow rounded border border-border bg-default px-2 py-1.5 focus:outline focus:outline-1 focus:outline-info",value:i,onChange:e=>{o(e.target.value)},children:Object.entries(r.NoteType).map((t=>{let[n,r]=t;return(0,e.jsx)("option",{value:r,children:n},n)}))}):"editorIdentifier"===a?(0,e.jsx)("select",{className:"flex-grow rounded border border-border bg-default px-2 py-1.5 focus:outline focus:outline-1 focus:outline-info",value:i,onChange:e=>{o(e.target.value)},children:l.map((t=>(0,e.jsx)("option",{value:t.value,children:t.label},t.value)))}):"string"===a||"date"===a?(0,e.jsx)("input",{className:"flex-grow rounded border border-border bg-default px-2 py-1.5",value:i,onChange:e=>{o(e.target.value)}}):"boolean"===a?(0,e.jsxs)("select",{className:"flex-grow rounded border border-border bg-default px-2 py-1.5 focus:outline focus:outline-1 focus:outline-info",value:i,onChange:e=>{o(e.target.value)},children:[(0,e.jsx)("option",{value:"true",children:"True"}),(0,e.jsx)("option",{value:"false",children:"False"})]}):"number"===a?(0,e.jsx)("input",{type:"number",className:"flex-grow rounded border border-border bg-default px-2 py-1.5",value:i,onChange:e=>{o(e.target.value)}}):null},Lo=(0,Nn.Pi)((t=>{let{controller:n}=t;const{operator:i,setOperator:o,predicates:s,setPredicate:a,changePredicateKeypath:l,addPredicate:c,removePredicate:u}=n;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsxs)("label",{className:"flex items-center gap-2",children:[(0,e.jsx)("input",{type:"radio",name:"predicate",value:"and",checked:"and"===i,onChange:e=>{o(e.target.value)}}),"Should match ALL conditions"]}),(0,e.jsxs)("label",{className:"flex items-center gap-2",children:[(0,e.jsx)("input",{type:"radio",name:"predicate",value:"or",checked:"or"===i,onChange:e=>{o(e.target.value)}}),"Should match ANY conditions"]})]}),s.map(((t,n)=>(0,e.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,e.jsxs)("div",{className:"flex w-full flex-col gap-2 md:flex-row md:items-center",children:[0!==n&&(0,e.jsx)("div",{className:"mr-2 text-sm font-semibold",children:"and"===i?"AND":"OR"}),(0,e.jsx)("select",{className:"flex-grow rounded border border-border bg-default px-2 py-1.5 focus:outline focus:outline-1 focus:outline-info",value:t.keypath,onChange:e=>{l(n,e.target.value)},children:Object.entries(Oo).map((t=>{let[n,r]=t;return(0,e.jsx)("option",{value:n,children:r},n)}))}),(0,e.jsx)("select",{className:"rounded border border-border bg-default px-2 py-1.5 focus:outline focus:outline-1 focus:outline-info",value:t.operator,onChange:e=>{a(n,{operator:e.target.value})},children:r.AllNonCompoundPredicateOperators.map((t=>(0,e.jsx)("option",{value:t,children:t},t)))}),t.keypath&&(0,e.jsx)(Ro,{keypath:t.keypath,value:"string"!=typeof t.value?JSON.stringify(t.value):t.value,setValue:e=>{a(n,{value:e})}}),0!==n&&(0,e.jsx)("button",{className:"rounded border border-border p-1 text-danger","aria-label":"Remove condition",onClick:()=>{u(n)},children:(0,e.jsx)(xn.Z,{type:"trash"})})]}),n===s.length-1&&(0,e.jsx)(Ln.Z,{className:"flex items-center gap-2",onClick:()=>{c()},children:"Add another condition"})]},n))),s.some((e=>"date"===No[e.keypath]))&&(0,e.jsxs)("div",{className:"flex flex-col gap-2 rounded-md border-2 border-info-backdrop bg-info-backdrop px-4 py-3 [&_code]:rounded [&_code]:bg-default [&_code]:px-1.5 [&_code]:py-1",children:[(0,e.jsx)("div",{className:"text-sm font-semibold",children:"Date Examples:"}),(0,e.jsxs)("ul",{className:"space-y-2 pl-4",children:[(0,e.jsxs)("li",{children:["To get all the items modified within the last 7 days, you can use ",(0,e.jsx)("code",{children:"User Modified Date"})," ",(0,e.jsx)("code",{children:">"})," ",(0,e.jsx)("code",{children:"7.days.ago"})]}),(0,e.jsxs)("li",{children:["To get all the items created before June 2022, you can use ",(0,e.jsx)("code",{children:"Created At"})," ",(0,e.jsx)("code",{children:"<"})," ",(0,e.jsx)("code",{children:"06/01/2022"})]})]})]})]})})),Qo=["state","id","children"];function Uo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Uo(Object(n),!0).forEach((function(t){Ko(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ko(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ho=t=>{let{state:n,id:r,children:i}=t,o=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,Qo);const{activeTab:s}=n;return s===r?(0,e.jsx)("div",Vo(Vo({role:"tabpanel",id:"tab-panel-".concat(r),"aria-labelledby":"tab-control-".concat(r)},o),{},{children:i})):null},Go=(0,He.createContext)(void 0),Yo=["id","className","children"];function zo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zo(Object(n),!0).forEach((function(t){Wo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Wo(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const qo=t=>{let{id:n,className:r,children:i}=t,o=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,Yo);const{state:s}=(()=>{const e=(0,He.useContext)(Go);if(void 0===e)throw new Error("useTabStateContext must be used within a <TabList/>");if(void 0===e.state)throw new Error("Tab state must be provided to the parent <TabList/>");return e})(),{activeTab:a,setActiveTab:l}=s,c=a===n;return(0,e.jsx)("button",Zo(Zo({role:"tab",id:"tab-control-".concat(n),onClick:()=>{l(n)},"aria-selected":c,"aria-controls":"tab-panel-".concat(n),className:(0,Q.classNames)("relative cursor-pointer border-0 bg-default px-3 py-2.5 text-sm focus:shadow-inner md:translucent-ui:bg-transparent",c?"font-medium text-info":"text-text",c&&"after:absolute after:bottom-0 after:left-0 after:h-[2px] after:w-full after:bg-info",r)},o),{},{children:i}))},Jo=["state","children"];function Xo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xo(Object(n),!0).forEach((function(t){es(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function es(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ts=t=>{let{state:n,children:r}=t,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,Jo);const o=(0,He.useMemo)((()=>({state:n})),[n]);return(0,e.jsx)(Go.Provider,{value:o,children:(0,e.jsx)("div",$o($o({role:"tablist"},i),{},{children:r}))})},ns=t=>{let{tabs:n,state:i,className:o,children:s}=t;return(0,e.jsxs)("div",{className:(0,r.classNames)("overflow-hidden rounded-md border border-border",o),children:[(0,e.jsx)(ts,{state:i,className:"border-b border-border",children:n.map((t=>{let{id:n,title:r}=t;return(0,e.jsx)(qo,{id:n,className:"first:rounded-tl-md",children:r},n)}))}),s]})},rs=t=>{let{code:n}=t;const r=(0,He.useRef)(null),[i,o]=(0,He.useState)(!1),[s,a]=(0,He.useState)(!1);return(0,e.jsxs)("div",{className:"group relative",onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[(0,e.jsx)("pre",{className:"overflow-auto rounded-md bg-default px-2.5 py-1.5",children:n}),(0,e.jsxs)("div",{className:"absolute right-1.5 top-1.5",children:[(0,e.jsx)("button",{ref:r,className:(0,Q.classNames)("peer rounded border border-border bg-default p-2 text-text hover:bg-contrast",!s&&"hidden"),onClick:()=>{navigator.clipboard.writeText(n).then((()=>{o(!0),setTimeout((()=>{var e;o(!1),null===(e=r.current)||void 0===e||e.blur()}),1e3)}),(()=>{(0,Y.fz)({type:Y.pC.Error,message:"Failed to copy to clipboard"}),o(!1)}))},children:(0,e.jsx)(xn.Z,{type:"copy",size:"small"})}),(0,e.jsx)("div",{className:(0,Q.classNames)(i&&s?"":"hidden","absolute right-0 top-full min-w-max translate-x-2 translate-y-1 select-none rounded border border-border bg-default px-3 py-1.5 text-left md:peer-hover:block"),children:i?"Copied!":"Copy example to clipboard"})]})]})},is=(0,Nn.Pi)((t=>{let{controller:n,platform:i}=t;const{isSaving:o,title:s,setTitle:a,icon:l,setIcon:c,closeModal:u,saveCurrentSmartView:d,predicateController:h,customPredicateJson:p,setCustomPredicateJson:f,isCustomJsonValidPredicate:g,setIsCustomJsonValidPredicate:m,validateAndPrettifyCustomPredicate:y}=n,v=(0,He.useRef)(null),A=(0,He.useRef)(null),[b,w]=(0,He.useState)(!1),S=(0,He.useRef)(null),C=(0,Ii.M)(),E=C.useState("open"),I=()=>{w((e=>!e))},_=(e=>{let{defaultTab:t}={defaultTab:"builder"};const[n,r]=(0,He.useState)(t);return{activeTab:n,setActiveTab:r}})(),x=(0,He.useCallback)((()=>{var e;s.length?"custom"!==_.activeTab||g?d():y():null===(e=v.current)||void 0===e||e.focus()}),[g,d,_.activeTab,s.length,y]),P="builder"===_.activeTab||g;(0,He.useEffect)((()=>{A.current&&"custom"===_.activeTab&&!1===g&&A.current.focus()}),[g,_.activeTab]);const k=(0,He.useMemo)((()=>[{label:"Cancel",onClick:u,disabled:o,type:"cancel",mobileSlot:"left"},{label:o?(0,e.jsx)(di.Z,{className:"h-4.5 w-4.5"}):P?"Save":"Validate",onClick:x,disabled:o,mobileSlot:"right",type:"primary"}]),[P,u,o,x]);return(0,e.jsx)(Gn,{title:"Add Smart View",close:u,actions:k,children:(0,e.jsx)("div",{className:"px-4 py-4",children:(0,e.jsxs)("div",{className:"flex h-full flex-col gap-4",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,e.jsx)("div",{className:"text-sm font-semibold",children:"Title:"}),(0,e.jsx)("input",{className:"rounded border border-border bg-default px-2 py-1 md:translucent-ui:bg-transparent",value:s,onChange:e=>{a(e.target.value)},ref:v})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,e.jsx)("div",{className:"text-sm font-semibold",children:"Icon:"}),(0,e.jsx)("button",{className:"rounded border border-border p-2","aria-label":"Change icon",onClick:I,ref:S,children:(0,e.jsx)(xn.Z,{type:l||r.SmartViewDefaultIconName})}),(0,e.jsx)(On.Z,{title:"Choose icon",open:b,anchorElement:S,togglePopover:I,align:"start",overrideZIndex:"z-modal",children:(0,e.jsx)("div",{className:"p-2",children:(0,e.jsx)(Ei,{selectedValue:l||r.SmartViewDefaultIconName,onIconChange:e=>{c(null!=e?e:r.SmartViewDefaultIconName),I()},platform:i,useIconGrid:!0})})})]}),(0,e.jsxs)("div",{className:"flex flex-grow flex-col gap-2.5",children:[(0,e.jsx)("div",{className:"text-sm font-semibold",children:"Predicate:"}),(0,e.jsxs)(ns,{className:"flex flex-grow flex-col",tabs:[{id:"builder",title:"Builder"},{id:"custom",title:"Custom (JSON)"}],state:_,children:[(0,e.jsx)(Ho,{state:_,id:"builder",className:"flex flex-col gap-2.5 p-4",children:(0,e.jsx)(Lo,{controller:h})}),(0,e.jsxs)(Ho,{state:_,id:"custom",className:"flex flex-grow flex-col",children:[(0,e.jsx)("textarea",{className:"h-full min-h-[10rem] w-full flex-grow resize-none bg-default px-2.5 py-1.5 font-mono text-sm",value:p,onChange:e=>{f(e.target.value),m(void 0)},spellCheck:!1,ref:A}),p&&!1===g&&(0,e.jsx)("div",{className:"border-t border-border px-2.5 py-1.5 text-sm text-danger",children:"Invalid JSON. Double check your entry and try again."})]})]}),"custom"===_.activeTab&&(0,e.jsxs)("div",{className:"flex flex-col gap-1.5 rounded-md border-2 border-info-backdrop bg-info-backdrop px-4 py-3",children:[(0,e.jsxs)(_i.p,{store:C,className:"flex items-center justify-between focus:shadow-none focus:outline-none",children:[(0,e.jsx)("div",{className:"text-sm font-semibold",children:"Examples"}),(0,e.jsx)(xn.Z,{type:E?"chevron-up":"chevron-down"})]}),(0,e.jsxs)(xi.k_,{store:C,className:(0,Q.classNames)(E&&"flex","flex-col gap-2.5"),children:[(0,e.jsx)("div",{className:"text-sm font-medium",children:"1. List notes that are conflicted copies of another note:"}),(0,e.jsx)(rs,{code:'{\n  "keypath": "content.conflict_of.length",\n  "operator": ">",\n  "value": 0\n}'}),(0,e.jsx)("div",{className:"text-sm font-medium",children:"2. List notes that have the tag `todo` but not the tag `completed`:"}),(0,e.jsx)(rs,{code:'{\n  "operator": "and",\n  "value": [\n    {\n      "operator": "not",\n      "value": {\n        "keypath": "tags",\n        "operator": "includes",\n        "value": {\n          "keypath": "title",\n          "operator": "=",\n          "value": "completed"\n        }\n      }\n    },\n    {\n      "keypath": "tags",\n      "operator": "includes",\n      "value": {\n        "keypath": "title",\n        "operator": "=",\n        "value": "todo"\n      }\n    }\n  ]\n}\n'})]})]})]})]})})})}));function os(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ss(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?os(Object(n),!0).forEach((function(t){as(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):os(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function as(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class ls{constructor(){this.operator="and",this.predicates=[{keypath:"title",operator:"!=",value:""}],this.setOperator=e=>{this.operator=e},this.setPredicate=(e,t)=>{const n=this.predicates[e];this.predicates[e]=ss(ss({},n),t)},this.changePredicateKeypath=(e,t)=>{const n=this.predicates[e].keypath,i=No[t];if(No[n]!==i)switch(i){case"string":this.setPredicate(e,{value:""});break;case"boolean":this.setPredicate(e,{value:!0});break;case"number":this.setPredicate(e,{value:0});break;case"noteType":this.setPredicate(e,{value:Object.values(r.NoteType)[0]});break;case"editorIdentifier":this.setPredicate(e,{value:Et.NativeFeatureIdentifier.TYPES.PlainEditor});break;case"date":this.setPredicate(e,{value:"1.days.ago"})}this.setPredicate(e,{keypath:t})},this.addPredicate=()=>{this.predicates.push({keypath:"title",operator:"!=",value:""})},this.removePredicate=e=>{this.predicates.splice(e,1)},(0,_.rC)(this,{operator:_.LO,setOperator:_.aD,predicates:_.LO,setPredicate:_.aD,addPredicate:_.aD,removePredicate:_.aD})}toJson(){return{operator:this.operator,value:this.predicates}}resetState(){this.operator="and",this.predicates=[{keypath:"title",operator:"!=",value:""}]}}class cs{constructor(e){this.application=e,this.isAddingSmartView=!1,this.isSaving=!1,this.title="",this.icon=r.SmartViewDefaultIconName,this.predicateController=new ls,this.customPredicateJson=void 0,this.isCustomJsonValidPredicate=void 0,this.setIsAddingSmartView=e=>{this.isAddingSmartView=e},this.setIsSaving=e=>{this.isSaving=e},this.setTitle=e=>{this.title=e},this.setIcon=e=>{this.icon=e},this.setCustomPredicateJson=e=>{this.customPredicateJson=e},this.setIsCustomJsonValidPredicate=e=>{this.isCustomJsonValidPredicate=e},this.closeModal=()=>{this.setIsAddingSmartView(!1),this.setTitle(""),this.setIcon(""),this.setIsSaving(!1),this.predicateController.resetState(),this.setCustomPredicateJson(""),this.setIsCustomJsonValidPredicate(void 0)},this.saveCurrentSmartView=async()=>{if(this.setIsSaving(!0),!this.title)return void this.setIsSaving(!1);const e=this.customPredicateJson&&this.isCustomJsonValidPredicate?JSON.parse(this.customPredicateJson):this.predicateController.toJson(),t=(0,r.predicateFromJson)(e);await this.application.mutator.createSmartView({title:this.title,predicate:t,iconString:this.icon,vault:this.application.vaultDisplayService.exclusivelyShownVault}),this.setIsSaving(!1),this.closeModal()},this.validateAndPrettifyCustomPredicate=()=>{if(this.customPredicateJson)try{const e=JSON.parse(this.customPredicateJson);(0,r.predicateFromJson)(e)?(this.setCustomPredicateJson(JSON.stringify(e,null,2)),this.setIsCustomJsonValidPredicate(!0)):this.setIsCustomJsonValidPredicate(!1)}catch(e){return void this.setIsCustomJsonValidPredicate(!1)}else this.setIsCustomJsonValidPredicate(!1)},(0,_.rC)(this,{isAddingSmartView:_.LO,setIsAddingSmartView:_.aD,isSaving:_.LO,setIsSaving:_.aD,title:_.LO,setTitle:_.aD,icon:_.LO,setIcon:_.aD,customPredicateJson:_.LO,isCustomJsonValidPredicate:_.LO,setCustomPredicateJson:_.aD,setIsCustomJsonValidPredicate:_.aD})}}const us=(0,Nn.Pi)((t=>{let{controller:n,platform:i}=t;const{view:o,title:s,setTitle:a,predicateJson:l,setPredicateJson:c,isPredicateJsonValid:u,setIsPredicateJsonValid:d,icon:h,setIcon:p,save:f,isSaving:g,closeDialog:m,deleteView:y}=n,v=(0,He.useRef)(null),A=(0,He.useRef)(null),[b,w]=(0,He.useState)(!1),S=(0,He.useRef)(null),C=(0,He.useCallback)((()=>{w((e=>!e))}),[]),E=(0,He.useCallback)((async()=>{var e;s.length?f():null===(e=v.current)||void 0===e||e.focus()}),[f,s.length]);(0,He.useEffect)((()=>{A.current&&!1===u&&A.current.focus()}),[u]);const I=(0,He.useMemo)((()=>[{label:"Delete",onClick:y,disabled:g,type:"destructive"},{label:"Cancel",onClick:m,disabled:g,type:"cancel",mobileSlot:"left"},{label:g?(0,e.jsx)(di.Z,{className:"h-4.5 w-4.5"}):"Save",onClick:E,disabled:g,type:"primary",mobileSlot:"right"}]),[m,y,g,E]);return o?(0,e.jsx)(Gn,{title:'Edit Smart View "'.concat(o.title,'"'),close:m,actions:I,children:(0,e.jsx)("div",{className:"px-4 py-4",children:(0,e.jsxs)("div",{className:"flex h-full flex-col gap-4",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,e.jsx)("div",{className:"text-sm font-semibold",children:"Title:"}),(0,e.jsx)("input",{className:"rounded border border-border bg-default px-2 py-1 md:translucent-ui:bg-transparent",value:s,onChange:e=>{a(e.target.value)},ref:v})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,e.jsx)("div",{className:"text-sm font-semibold",children:"Icon:"}),(0,e.jsx)("button",{className:"rounded border border-border p-2","aria-label":"Change icon",onClick:C,ref:S,children:(0,e.jsx)(xn.Z,{type:h||r.SmartViewDefaultIconName})}),(0,e.jsx)(On.Z,{title:"Choose icon",open:b,anchorElement:S,togglePopover:C,align:"start",overrideZIndex:"z-modal",children:(0,e.jsx)("div",{className:"p-2",children:(0,e.jsx)(Ei,{selectedValue:h||r.SmartViewDefaultIconName,onIconChange:e=>{p(e||r.SmartViewDefaultIconName),C()},platform:i,useIconGrid:!0})})})]}),(0,e.jsxs)("div",{className:"flex flex-grow flex-col gap-2.5",children:[(0,e.jsx)("div",{className:"text-sm font-semibold",children:"Predicate:"}),(0,e.jsxs)("div",{className:"flex flex-grow flex-col overflow-hidden rounded-md border border-border",children:[(0,e.jsx)("textarea",{className:"h-full min-h-[10rem] w-full flex-grow resize-none bg-default px-2.5 py-1.5 font-mono text-sm md:translucent-ui:bg-transparent",value:l,onChange:e=>{c(e.target.value),d(!0)},spellCheck:!1,ref:A}),!u&&(0,e.jsx)("div",{className:"border-t border-border px-2.5 py-1.5 text-sm text-danger",children:"Invalid JSON. Double check your entry and try again."})]})]})]})})}):null})),ds=t=>{let{view:n,onEdit:r,onDelete:i}=t;const o=(0,He.useCallback)((()=>i(n)),[i,n]);return(0,e.jsxs)("div",{className:"flex items-center gap-2 py-1.5",children:[(0,e.jsx)(xn.Z,{type:n.iconString,size:"custom",className:"h-5.5 w-5.5 flex-shrink-0"}),(0,e.jsx)("span",{className:"mr-auto overflow-hidden text-ellipsis text-sm",children:n.title}),(0,e.jsx)(Ln.Z,{small:!0,onClick:r,children:"Edit"}),(0,e.jsx)(Ln.Z,{small:!0,onClick:o,children:"Delete"})]})},hs=t=>{let{application:n,title:r,message:i,className:o}=t;return(0,e.jsxs)("div",{className:(0,Q.classNames)("grid grid-cols-1 rounded-md border border-border p-4",o),children:[(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)(xn.Z,{className:(0,Q.classNames)("-ml-1 mr-1 h-5 w-5",Mn.K),type:Mn._}),(0,e.jsx)("h1",{className:"sk-h3 m-0 text-sm font-semibold",children:r})]}),(0,e.jsx)("p",{className:"col-start-1 col-end-3 m-0 mt-1 text-sm",children:i}),(0,e.jsx)(Ln.Z,{primary:!0,small:!0,className:"col-start-1 col-end-3 mt-3 justify-self-start uppercase",onClick:()=>{n.isNativeIOS()?n.showPremiumModal():n.openPurchaseFlow()},children:"Upgrade Features"})]})};class ps{constructor(e){this.application=e,this.title="",this.icon=r.SmartViewDefaultIconName,this.predicateJson="",this.isPredicateJsonValid=!1,this.isSaving=!1,this.view=void 0,this.setTitle=e=>{this.title=e},this.setIcon=e=>{this.icon=e},this.setPredicateJson=e=>{this.predicateJson=e},this.setIsPredicateJsonValid=e=>{this.isPredicateJsonValid=e},this.setView=e=>{this.view=e,e&&(this.setTitle(e.title),this.setIcon(e.iconString),this.setPredicateJson(JSON.stringify(e.predicate.toJson(),null,2)),this.setIsPredicateJsonValid(!0))},this.setIsSaving=e=>{this.isSaving=e},this.closeDialog=()=>{this.setView(void 0),this.setTitle(""),this.setIcon(r.SmartViewDefaultIconName),this.setPredicateJson("")},this.save=async()=>{this.view&&(this.validateAndPrettifyCustomPredicate(),this.isPredicateJsonValid&&(this.setIsSaving(!0),await this.application.changeAndSaveItem.execute(this.view,(e=>{e.title=this.title,e.iconString=this.icon||r.SmartViewDefaultIconName,e.predicate=JSON.parse(this.predicateJson)})),this.setIsSaving(!1),this.closeDialog()))},this.deleteView=async()=>{if(!this.view)return;const e=this.view;this.closeDialog(),await(0,L.VG)({text:ht.$n,confirmButtonStyle:"danger"})&&this.application.mutator.deleteItem(e).then((()=>this.application.sync.sync())).catch(console.error)},this.validateAndPrettifyCustomPredicate=()=>{try{const e=JSON.parse(this.predicateJson);(0,r.predicateFromJson)(e)?(this.setPredicateJson(JSON.stringify(e,null,2)),this.setIsPredicateJsonValid(!0)):this.setIsPredicateJsonValid(!1)}catch(e){return void this.setIsPredicateJsonValid(!1)}},(0,_.rC)(this,{title:_.LO,icon:_.LO,predicateJson:_.LO,isPredicateJsonValid:_.LO,isSaving:_.LO,view:_.LO,setTitle:_.aD,setIcon:_.aD,setPredicateJson:_.aD,setIsPredicateJsonValid:_.aD,setIsSaving:_.aD,setView:_.aD})}}const fs=(0,Nn.Pi)((t=>{let{application:n,featuresController:i}=t;const o=(0,He.useMemo)((()=>new cs(n)),[n]),s=(0,He.useMemo)((()=>new ps(n)),[n]),[a,l]=(0,He.useState)((()=>n.items.getSmartViews().filter((e=>!(0,r.isSystemView)(e)))));(0,He.useEffect)((()=>n.items.streamItems([r.ContentType.TYPES.SmartView],(()=>{l(n.items.getSmartViews().filter((e=>!(0,r.isSystemView)(e))))}))),[n]);const c=(0,He.useCallback)((async e=>{await(0,L.VG)({text:ht.$n,confirmButtonStyle:"danger"})&&n.mutator.deleteItem(e).then((()=>n.sync.sync())).catch(console.error)}),[n.mutator,n.sync]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Smart Views"}),!i.hasSmartViews&&(0,e.jsx)(hs,{className:"mt-2",application:n,title:"Upgrade for smart views",message:"Create smart views to organize your notes according to conditions you define."}),i.hasSmartViews&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"my-2 flex flex-col",children:a.map((t=>(0,e.jsx)(ds,{view:t,onEdit:()=>s.setView(t),onDelete:c},t.uuid)))}),(0,e.jsx)(Ln.Z,{onClick:()=>{o.setIsAddingSmartView(!0)},children:"Create Smart View"})]})]})}),(0,e.jsx)(Fr,{isOpen:!!s.view,close:s.closeDialog,children:(0,e.jsx)(us,{controller:s,platform:n.platform})}),(0,e.jsx)(Fr,{isOpen:o.isAddingSmartView,close:o.closeModal,children:(0,e.jsx)(is,{controller:o,platform:n.platform})})]})}));var gs=s(81959),ms=s(26013);const ys=(0,Nn.Pi)((t=>{let{application:n}=t;const i=n.momentsService.isEnabled,o=Qr(),s=(0,Er.Z)(r.PrefKey.MomentsDefaultTagUuid),[a,l]=(0,He.useState)();(0,He.useEffect)((()=>{if(!s)return void l(void 0);const e=n.items.findItem(s);l(e)}),[s,n]);const c=(0,He.useCallback)((()=>{n.featuresController.entitledToFiles?n.momentsService.enableMoments():o.activate("Moments")}),[n,o]),u=(0,He.useCallback)((()=>{n.momentsService.disableMoments()}),[n]),d=(0,He.useCallback)((()=>{i?u():c()}),[i,c,u]),h=(0,He.useCallback)((()=>{n.featuresController.entitledToFiles?n.momentsService.takePhoto():o.activate("Moments")}),[n,o]),p=(0,He.useCallback)((e=>{n.setPreference(r.PrefKey.MomentsDefaultTagUuid,e.uuid)}),[n]),f=(0,He.useCallback)((async()=>{n.setPreference(r.PrefKey.MomentsDefaultTagUuid,void 0)}),[n]);return(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex items-start",children:[(0,e.jsx)(Ge.Dx,{children:"Moments"}),(0,e.jsx)(Ge.DR,{style:"success",children:"Labs"}),(0,e.jsx)(Ge.DR,{style:"info",children:"Professional"})]}),(0,e.jsx)(po.Z,{onChange:d,checked:i})]}),(0,e.jsx)(Ge.QE,{children:"Your personal photo journal"}),i&&(0,e.jsxs)("div",{className:"mb-2 flex items-center",children:[a&&(0,e.jsx)("div",{children:(0,e.jsx)(ms.Z,{className:"m-1 mr-2",link:(0,un.X)(a,"linked"),unlinkItem:f,isBidirectional:!1,inlineFlex:!0})}),(0,e.jsx)(gs.Z,{onSelection:p,placeholder:"Select tag to save Moments to...",contentTypes:[r.ContentType.TYPES.Tag]})]}),(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)("div",{className:"flex flex-col"}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.xv,{children:"Moments lets you capture photos of yourself throughout the day, creating a visual record of your life, one photo at a time. Using your webcam or mobile selfie-cam, Moments takes a photo of you every half hour. All photos are end-to-end encrypted and stored in your files. Enable Moments on a per-device basis to get started."}),(0,e.jsx)("div",{className:"mt-5 flex flex-row flex-wrap gap-3",children:(0,e.jsx)(Ln.Z,{colorStyle:"info",onClick:h,children:"Capture Present Moment"})})]})]})]})})})),vs=[{label:"Current date and time",value:r.NewNoteTitleFormat.CurrentDateAndTime},{label:"Current note count",value:r.NewNoteTitleFormat.CurrentNoteCount},{label:"Custom format",value:r.NewNoteTitleFormat.CustomFormat},{label:"Empty",value:r.NewNoteTitleFormat.Empty}];class As extends He.Component{constructor(e){super(e),this.state={}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(e,t)}render(){return this.state.error?(0,e.jsxs)("div",{className:"text-danger",children:[(0,e.jsx)("span",{children:"Something went wrong rendering this component: "}),(0,e.jsx)("span",{className:"font-bold",children:this.state.error.message})]}):this.props.children}}const bs="https://day.js.org/docs/en/display/format#list-of-all-available-formats",ws=()=>{const t=(0,sr.I)(),n=Qr(),[i,o]=(0,He.useState)([]);(0,He.useEffect)((()=>{o(Fo(t))}),[t]);const[s,a]=(0,He.useState)(r.NativeFeatureIdentifier.TYPES.PlainEditor),[l,c]=(0,He.useState)(r.NewNoteTitleFormat.CurrentDateAndTime),[u,d]=(0,He.useState)(""),h=(0,He.useCallback)((()=>{const e=t.componentManager.getDefaultEditorIdentifier();a(e),c(t.getPreference(r.PrefKey.NewNoteTitleFormat,r.PrefDefaults[r.PrefKey.NewNoteTitleFormat])),d(t.getPreference(r.PrefKey.CustomNoteTitleFormat,r.PrefDefaults[r.PrefKey.CustomNoteTitleFormat]))}),[t]);(0,He.useEffect)((()=>{h()}),[h]);const p=(0,He.useCallback)((e=>{let o;const s=r.NativeFeatureIdentifier.create(e);if(s.isFailed()){const n=t.componentManager.findComponentWithPackageIdentifier(e);n&&(o=r.Uuid.create(n.uuid).getValue())}else o=s.getValue();if(o)if(t.features.getFeatureStatus(o)===r.FeatureStatus.Entitled)a(e),t.setPreference(r.PrefKey.DefaultEditorIdentifier,e);else{if(s.getValue().value===r.NativeFeatureIdentifier.TYPES.SuperEditor)return void n.showSuperDemo();const t=i.find((t=>t.value===e));t&&n.activate(t.label)}}),[t,i,n]),f=(0,He.useCallback)((e=>{c(e),t.setPreference(r.PrefKey.NewNoteTitleFormat,e)}),[t]),g=(0,He.useRef)();return(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"New Note Defaults"}),(0,e.jsxs)("div",{className:"mt-2",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)(Ge.QE,{children:"Note Type"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(wi.Z,{label:"Select the default note type",items:i,value:s,onChange:e=>p(e)})})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)("div",{children:[(0,e.jsx)(Ge.QE,{children:"Title Format"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(wi.Z,{label:"Select the format for the note title",items:vs,value:l,onChange:f})}),l===r.NewNoteTitleFormat.CustomFormat&&(0,e.jsxs)("div",{className:"mt-2",children:[(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)("input",{className:(0,r.classNames)("w-full min-w-55 rounded border border-solid border-passive-3 bg-default px-2 py-1.5 text-base md:w-auto md:translucent-ui:bg-transparent lg:text-sm","focus-within:ring-2 focus-within:ring-info"),placeholder:"e.g. YYYY-MM-DD",value:u,onChange:e=>{const n=e.currentTarget.value;d(n),g.current&&clearTimeout(g.current),g.current=window.setTimeout((async()=>{t.setPreference(r.PrefKey.CustomNoteTitleFormat,n)}),25)},spellCheck:!1})}),(0,e.jsxs)("div",{className:"mt-3 text-neutral",children:[(0,e.jsx)("span",{className:"font-bold",children:"Preview: "}),(0,e.jsx)(As,{children:(0,e.jsx)("em",{children:Gt(void 0,u)})})]}),(0,e.jsxs)("div",{className:"mt-2 text-neutral",children:[(0,e.jsx)("a",{className:"underline",href:bs,rel:"noreferrer",target:"_blank",onClick:e=>{t.isNativeMobileWeb()&&(e.preventDefault(),t.mobileDevice.openUrl(bs))},children:"Options"}),". Use ",(0,e.jsx)("code",{children:"[]"})," to escape formatting."]})]})]})]})]})})},Ss=(0,Nn.Pi)((()=>{const t=(0,sr.I)();return(0,e.jsxs)(io,{children:[(0,e.jsx)(We,{application:t}),(0,e.jsx)(Eo.Z,{application:t}),(0,e.jsx)(ws,{}),(0,e.jsx)(Co,{application:t}),(0,e.jsx)(fs,{application:t,featuresController:t.featuresController}),(0,e.jsx)(ys,{application:t}),(0,e.jsx)(_o,{application:t}),(0,e.jsx)(Bo,{})]})})),Cs=(0,Nn.Pi)((t=>{let{application:n}=t;return(0,e.jsx)(Ye.Z,{children:(0,e.jsx)(ze.Z,{children:(0,e.jsxs)("div",{className:"flex flex-col items-center px-4 md:px-12",children:[(0,e.jsx)(Po.AccountIllustration,{className:"mb-3"}),(0,e.jsx)(Ge.Dx,{children:"You're not signed in"}),(0,e.jsx)("div",{className:"mb-3 text-center text-base lg:text-sm",children:"Sign in to sync your notes and preferences across all your devices and enable end-to-end encryption."}),(0,e.jsx)(Ln.Z,{primary:!0,label:"Create free account",onClick:()=>{n.preferencesController.closePreferences(),n.accountMenuController.setCurrentPane(qt.V.Register),n.accountMenuController.setShow(!0)},className:"mb-3"}),(0,e.jsxs)("div",{className:"text-base lg:text-sm",children:["Already have an account?"," ",(0,e.jsx)("button",{className:"cursor-pointer border-0 bg-default p-0 text-info underline",onClick:()=>{n.preferencesController.closePreferences(),n.accountMenuController.setCurrentPane(qt.V.SignIn),n.accountMenuController.setShow(!0)},children:"Sign in"})]})]})})})})),Es="block mb-1",Is=t=>{let{setNewEmail:n,setCurrentPassword:r}=t;return(0,e.jsxs)("div",{className:"flex w-full flex-col",children:[(0,e.jsxs)("div",{className:"mb-3",children:[(0,e.jsx)("label",{className:Es,htmlFor:"change-email-email-input",children:"New Email"}),(0,e.jsx)(ui.Z,{type:"email",id:"change-email-email-input",onChange:e=>{n(e)}})]}),(0,e.jsxs)("div",{className:"mb-2",children:[(0,e.jsx)("label",{className:Es,htmlFor:"change-email-password-input",children:"Current Password"}),(0,e.jsx)(gi.Z,{id:"change-email-password-input",type:"password",onChange:e=>{r(e)}})]})]})},_s=()=>(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mb-2 font-bold text-info",children:"Your email has been successfully changed."}),(0,e.jsx)("p",{children:"Please ensure you are running the latest version of Standard Notes on all platforms to ensure maximum compatibility."})]});var xs,Ps;!function(e){e.Default="Continue",e.GeneratingKeys="Generating Keys...",e.Finish="Finish"}(xs||(xs={})),function(e){e[e.InitialStep=0]="InitialStep",e[e.FinishStep=1]="FinishStep"}(Ps||(Ps={}));const ks=t=>{let{onCloseDialog:n,application:r}=t;const[i,o]=(0,He.useState)(""),[s,a]=(0,He.useState)(""),[l,c]=(0,He.useState)(!1),[u,d]=(0,He.useState)(!1),[h,p]=(0,He.useState)(xs.Default),[f,g]=(0,He.useState)(Ps.InitialStep);(0,He.useEffect)((()=>(window.onbeforeunload=()=>!0,()=>{window.onbeforeunload=null})),[]);const m=r.alerts,y=(0,He.useCallback)((async()=>{if(!i||0===i.length)return m.alert("Please enter your current password.").catch(console.error),!1;return await r.validateAccountPassword(i)||(m.alert("The current password you entered is not correct. Please try again.").catch(console.error),!1)}),[r,m,i]),v=()=>{p(xs.Default),c(!1)},A=(0,He.useCallback)((async()=>{await r.performDesktopTextBackup(),d(!0);const e=!(await r.changeEmail(s,i)).error;return d(!1),e}),[r,i,s]),b=(0,He.useCallback)((()=>{u?m.alert("Cannot close window until pending tasks are complete.").catch(console.error):n()}),[m,u,n]),w=(0,He.useCallback)((async()=>{u||l||(f!==Ps.FinishStep?(c(!0),p(xs.GeneratingKeys),await y()&&await A()?(c(!1),p(xs.Finish),g(Ps.FinishStep)):v()):b())}),[f,b,l,u,A,y]),S=(0,He.useCallback)((()=>{u?m.alert("Cannot close window until pending tasks are complete.").catch(console.error):n()}),[m,u,n]),C=(0,He.useMemo)((()=>[{label:"Cancel",onClick:S,type:"cancel",mobileSlot:"left"},{label:h,onClick:w,type:"primary",mobileSlot:"right"}]),[S,w,h]);return(0,e.jsx)(Gn,{title:"Change Email",close:S,actions:C,children:(0,e.jsxs)("div",{className:"px-4.5 py-4",children:[f===Ps.InitialStep&&(0,e.jsx)(Is,{setNewEmail:a,setCurrentPassword:o}),f===Ps.FinishStep&&(0,e.jsx)(_s,{})]})})},Bs=t=>{let{onCurrentPasswordChange:n,onNewPasswordChange:r,onNewPasswordConfirmationChange:i}=t;const[o,s]=(0,He.useState)(""),[a,l]=(0,He.useState)(""),[c,u]=(0,He.useState)("");return(0,e.jsx)("div",{className:"flex flex-col pb-1.5",children:(0,e.jsxs)("form",{children:[(0,e.jsx)("label",{htmlFor:"password-wiz-current-password",className:"mb-1 block",children:"Current Password"}),(0,e.jsx)(gi.Z,{autofocus:!0,id:"password-wiz-current-password",value:o,onChange:e=>{s(e),n(e)},type:"password"}),(0,e.jsx)("div",{className:"min-h-2"}),(0,e.jsx)("label",{htmlFor:"password-wiz-new-password",className:"mb-1 block",children:"New Password"}),(0,e.jsx)(gi.Z,{id:"password-wiz-new-password",value:a,onChange:e=>{l(e),r(e)},type:"password"}),(0,e.jsx)("div",{className:"min-h-2"}),(0,e.jsx)("label",{htmlFor:"password-wiz-confirm-new-password",className:"mb-1 block",children:"Confirm New Password"}),(0,e.jsx)(gi.Z,{id:"password-wiz-confirm-new-password",value:c,onChange:e=>{u(e),i(e)},type:"password"})]})})},Os=t=>{let{className:n}=t;return(0,e.jsx)("div",{role:"presentation",className:(0,r.classNames)("peer flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-full bg-success text-success-contrast",n),children:(0,e.jsx)(xn.Z,{type:"check",size:"small"})})},Ns=()=>(0,e.jsx)("div",{className:"flex flex-col gap-1",children:(0,e.jsxs)("div",{className:"flex flex-row items-start gap-3",children:[(0,e.jsx)("div",{className:"pt-1",children:(0,e.jsx)(Os,{})}),(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)("div",{className:"text-base font-bold",children:"Your password has been successfully changed."}),(0,e.jsx)("p",{children:"Ensure you are running the latest version of Standard Notes on all platforms for maximum compatibility."})]})]})}),Ds=t=>{let{onContinue:n,setContinueEnabled:r}=t;const i=(0,sr.I)(),[o,s]=(0,He.useState)(!0),[a,l]=(0,He.useState)(!0),[c,u]=(0,He.useState)(!0),[d,h]=(0,He.useState)(),p=(0,He.useCallback)((()=>{a||c||o?r(!1):"yes"!==d?n():r(!0)}),[c,a,o,d,n,r]);return(0,He.useEffect)((()=>{p()}),[c,a,o,p]),(0,He.useEffect)((()=>{(async()=>{await i.sync.sync(),s(!1)})()}),[i.sync]),(0,He.useEffect)((()=>{(async()=>{await i.asymmetric.downloadAndProcessInboundMessages(),l(!1)})()}),[i.asymmetric]),(0,He.useEffect)((()=>{(async()=>{await i.vaultInvites.downloadInboundInvites();const e=i.vaultInvites.getCachedPendingInviteRecords().length>0;h(e?"yes":"no"),u(!1)})()}),[i]),o||a||c?(0,e.jsxs)("div",{className:"flex flex-row items-center gap-3",children:[(0,e.jsx)(di.Z,{className:"h-3 w-3"}),(0,e.jsx)("p",{className:"",children:"Checking for data conflicts..."})]}):"no"===d?null:(0,e.jsx)("div",{className:"flex flex-col",children:(0,e.jsx)("p",{children:"You have pending vault invites. Changing your password will delete these invites. It is recommended you accept or decline these invites before changing your password. If you choose to continue, these invites will be deleted."})})};function js(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ts(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?js(Object(n),!0).forEach((function(t){Ms(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):js(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ms(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Fs="Continue",Rs="Generating Keys...";var Ls;!function(e){e.PreprocessingStep="preprocessing-step",e.PasswordStep="password-step",e.FinishStep="finish-step"}(Ls||(Ls={}));const Qs=class extends _n{constructor(e){super(e,e.application),this.nextStep=async()=>{this.state.lockContinue||this.state.isContinuing||(this.state.step!==Ls.FinishStep?this.state.step!==Ls.PreprocessingStep?(this.setState({isContinuing:!0,showSpinner:!0,continueTitle:Rs}),await this.validateCurrentPassword()&&await this.processPasswordChange()?this.setState({isContinuing:!1,showSpinner:!1,continueTitle:"Finish",step:Ls.FinishStep}):this.resetContinueState()):this.setState({step:Ls.PasswordStep}):this.dismiss())},this.dismiss=()=>{this.state.processing?this.application.alerts.alert("Cannot close window until pending tasks are complete.").catch(console.error):this.props.dismissModal()},this.handleCurrentPasswordInputChange=e=>{this.setFormDataState({currentPassword:e}).catch(console.error)},this.handleNewPasswordInputChange=e=>{this.setFormDataState({newPassword:e}).catch(console.error)},this.handleNewPasswordConfirmationInputChange=e=>{this.setFormDataState({newPasswordConfirmation:e}).catch(console.error)},this.setContinueEnabled=e=>{this.setState({lockContinue:!e})},this.nextStepFromPreprocessing=()=>{this.state.lockContinue?this.setState({lockContinue:!1},(()=>{this.nextStep()})):this.nextStep()},this.registerWindowUnloadStopper();const t={formData:{},continueTitle:Fs};e.application.featuresController.isVaultsEnabled()?this.state=Ts(Ts({},t),{},{lockContinue:!0,step:Ls.PreprocessingStep}):this.state=Ts(Ts({},t),{},{lockContinue:!1,step:Ls.PasswordStep})}componentDidMount(){super.componentDidMount()}componentWillUnmount(){super.componentWillUnmount(),window.onbeforeunload=null}registerWindowUnloadStopper(){window.onbeforeunload=()=>!0}resetContinueState(){this.setState({showSpinner:!1,continueTitle:Fs,isContinuing:!1})}async validateCurrentPassword(){var e;const t=this.state.formData.currentPassword,n=this.state.formData.newPassword;if(!t||0===t.length)return this.application.alerts.alert("Please enter your current password.").catch(console.error),!1;if(!n||0===n.length)return this.application.alerts.alert("Please enter a new password.").catch(console.error),!1;if(n!==this.state.formData.newPasswordConfirmation)return this.application.alerts.alert("Your new password does not match its confirmation.").catch(console.error),this.setFormDataState({status:void 0}).catch(console.error),!1;if(!(null===(e=this.application.sessions.getUser())||void 0===e?void 0:e.email))return this.application.alerts.alert("We don't have your email stored. Please sign out then log back in to fix this issue.").catch(console.error),this.setFormDataState({status:void 0}).catch(console.error),!1;const r=await this.application.validateAccountPassword(this.state.formData.currentPassword);return r||this.application.alerts.alert("The current password you entered is not correct. Please try again.").catch(console.error),r}async processPasswordChange(){await this.application.performDesktopTextBackup(),this.setState({lockContinue:!0,processing:!0}),await this.setFormDataState({status:"Processing encryption keys…"});const e=this.state.formData.newPassword,t=!(await this.application.changePassword(this.state.formData.currentPassword,e)).error;return this.setState({processing:!1,lockContinue:!1}),t?this.setState({formData:Ts(Ts({},this.state.formData),{},{status:"Successfully changed password."})}):this.setFormDataState({status:"Unable to process your password. Please try again."}).catch(console.error),t}async setFormDataState(e){return this.setState({formData:Ts(Ts({},this.state.formData),e)})}render(){return(0,e.jsx)("div",{className:"sn-component h-full w-full md:h-auto md:w-auto",id:"password-wizard",children:(0,e.jsx)(Gn,{title:"Change Password",close:this.dismiss,actions:[{label:"Cancel",onClick:this.dismiss,type:"cancel",mobileSlot:"left"},{label:this.state.continueTitle===Rs&&(0,t.Av)()?(0,e.jsx)(di.Z,{className:"h-4 w-4"}):this.state.continueTitle,onClick:this.nextStep,type:"primary",mobileSlot:"right",disabled:this.state.lockContinue}],children:(0,e.jsxs)("div",{className:"px-4.5 py-4",children:[this.state.step===Ls.PreprocessingStep&&(0,e.jsx)(Ds,{onContinue:this.nextStepFromPreprocessing,setContinueEnabled:this.setContinueEnabled}),this.state.step===Ls.PasswordStep&&(0,e.jsx)(Bs,{onCurrentPasswordChange:this.handleCurrentPasswordInputChange,onNewPasswordChange:this.handleNewPasswordInputChange,onNewPasswordConfirmationChange:this.handleNewPasswordConfirmationInputChange}),this.state.step===Ls.FinishStep&&(0,e.jsx)(Ns,{})]})})})}},Us=(0,Nn.Pi)((t=>{let{application:n}=t;const[i,o]=(0,He.useState)(!1),[s,a]=(0,He.useState)(!1),l=n.sessions.getUser(),c=n.getUserPasswordCreationDate(),u=(0,r.dateToLocalizedString)(c),d=(0,He.useCallback)((()=>{a(!0)}),[]),h=(0,He.useCallback)((()=>{a(!1)}),[]),p=()=>o(!1);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Credentials"}),(0,e.jsx)(Ge.QE,{children:"Email"}),(0,e.jsxs)(Ge.xv,{children:["You're signed in as ",(0,e.jsx)("span",{className:"wrap font-bold",children:null==l?void 0:l.email})]}),(0,e.jsx)(Ln.Z,{className:"mt-3 min-w-20",label:"Change email",onClick:()=>{o(!0)}}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsx)(Ge.QE,{children:"Password"}),(0,e.jsxs)(Ge.xv,{children:["Current password was set on ",(0,e.jsx)("span",{className:"font-bold",children:u})]}),(0,e.jsx)(Ln.Z,{className:"mt-3 min-w-20",label:"Change password",onClick:d}),(0,e.jsx)(Fr,{isOpen:i,close:p,children:(0,e.jsx)(ks,{onCloseDialog:p,application:n})})]})}),(0,e.jsx)(Fr,{isOpen:s,close:h,children:(0,e.jsx)(Qs,{application:n,dismissModal:h})})]})})),Vs=(0,Nn.Pi)((t=>{let{application:n}=t;const[i,o]=(0,He.useState)(!1),[s,a]=(0,He.useState)((0,je.Bt)(n.sync.getLastSyncDate()));return(0,e.jsx)(Ye.Z,{children:(0,e.jsx)(ze.Z,{children:(0,e.jsx)("div",{className:"flex flex-row items-center",children:(0,e.jsxs)("div",{className:"flex flex-grow flex-col",children:[(0,e.jsx)(Ge.Dx,{children:"Sync"}),(0,e.jsxs)(Ge.xv,{children:["Last synced ",(0,e.jsxs)("span",{className:"font-bold",children:["on ",s]})]}),(0,e.jsx)(Ln.Z,{className:"mt-3 min-w-20",label:"Sync now",disabled:i,onClick:async()=>{o(!0);const e=await n.sync.sync({queueStrategy:r.SyncQueueStrategy.ForceSpawnNew,checkIntegrity:!0});o(!1),e&&e.error?n.alerts.alert(ht.zR).catch(console.error):a((0,je.Bt)(n.sync.getLastSyncDate()))}})]})})})})})),Ks=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),{userSubscriptionName:n,userSubscriptionExpirationDate:r,isUserSubscriptionExpired:i,isUserSubscriptionCanceled:o}=t.subscriptions,s=null==r?void 0:r.toLocaleString();return o?(0,e.jsxs)(Ge.xv,{className:"mt-1",children:["Your"," ",(0,e.jsxs)("span",{className:"font-bold",children:["Standard Notes",n?" ":"",n]})," ","subscription has been canceled"," ",i?(0,e.jsxs)("span",{className:"font-bold",children:["and expired on ",s]}):(0,e.jsxs)("span",{className:"font-bold",children:["but will remain valid until ",s]}),". You may resubscribe below if you wish."]}):i?(0,e.jsxs)(Ge.xv,{className:"mt-1",children:["Your"," ",(0,e.jsxs)("span",{className:"font-bold",children:["Standard Notes",n?" ":"",n]})," ","subscription ",(0,e.jsxs)("span",{className:"font-bold",children:["expired on ",s]}),". You may resubscribe below if you wish."]}):(0,e.jsxs)(Ge.xv,{className:"mt-1",children:["Your"," ",(0,e.jsxs)("span",{className:"font-bold",children:["Standard Notes",n?" ":"",n]})," ","subscription will be ",(0,e.jsxs)("span",{className:"font-bold",children:["renewed on ",s]}),"."]})})),Hs=(0,Nn.Pi)((()=>{const t=(0,sr.I)();return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ks,{}),(0,e.jsx)(Ln.Z,{className:"mr-3 mt-3 min-w-20",label:"Manage subscription",onClick:async()=>{t.openSubscriptionDashboard.execute()}})]})})),Gs=t=>{let{application:n}=t;const[r,i]=(0,He.useState)(!1),[o,s]=(0,He.useState)(void 0);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.xv,{children:"You don't have a Standard Notes subscription yet."}),r&&(0,e.jsx)(Ge.xv,{children:"Redirecting you to the subscription page..."}),o&&(0,e.jsx)(Ge.xv,{className:"text-danger",children:o}),(0,e.jsxs)("div",{className:"flex",children:[!n.hideOutboundSubscriptionLinks&&(0,e.jsx)(Ge.Qj,{className:"mr-3 mt-3 min-w-20",label:"Learn More",link:window.plansUrl}),n.hasAccount()&&(0,e.jsx)(Ln.Z,{className:"mt-3 min-w-20",primary:!0,label:"Subscribe",onClick:async()=>{i(!0);try{n.isNativeIOS()?n.showPremiumModal():n.openPurchaseFlow()}catch(e){s("There was an error when attempting to redirect you to the subscription page.")}finally{i(!1)}}})]})]})},Ys=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),[n,i]=(0,He.useState)(t.subscriptionController.onlineSubscription);return(0,He.useEffect)((()=>t.subscriptions.addEventObserver((e=>{e===r.SubscriptionManagerEvent.DidFetchSubscription&&i(t.subscriptionController.onlineSubscription)}))),[t.subscriptions,t.subscriptionController]),(0,He.useEffect)((()=>{t.subscriptions.fetchOnlineSubscription()}),[t.subscriptions]),(0,e.jsx)(Ye.Z,{children:(0,e.jsx)(ze.Z,{children:(0,e.jsx)("div",{className:"flex flex-row items-center",children:(0,e.jsxs)("div",{className:"flex flex-grow flex-col",children:[(0,e.jsx)(Ge.Dx,{children:"Subscription"}),n?(0,e.jsx)(Hs,{}):(0,e.jsx)(Gs,{application:t})]})})})})}));function zs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zs(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ws=(0,Nn.Pi)((t=>{let{application:n}=t;const r=(0,He.useRef)(null),i=(0,He.useCallback)((()=>{n.accountMenuController.setOtherSessionsSignOut(!1)}),[n]),o=(0,He.useCallback)((()=>{n.revokeAllOtherSessions().catch(console.error),i(),n.alerts.alert("You have successfully revoked your sessions from other devices.",void 0,"Finish").catch(console.error)}),[n,i]);return(0,e.jsxs)(Vi,{closeDialog:i,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between text-lg font-bold capitalize",children:["End all other sessions?",(0,e.jsx)("button",{className:"rounded p-1 font-bold hover:bg-contrast",onClick:i,children:(0,e.jsx)(xn.Z,{type:"close"})})]}),(0,e.jsx)("div",{className:"sk-panel-row",children:(0,e.jsx)("p",{className:"text-base text-foreground lg:text-sm",children:"This action will sign out all other devices signed into your account, and remove your data from those devices when they next regain connection to the internet. You may sign back in on those devices at any time."})}),(0,e.jsxs)("div",{className:"mt-4 flex justify-end gap-2",children:[(0,e.jsx)(Ln.Z,{ref:r,onClick:i,children:"Cancel"}),(0,e.jsx)(Ln.Z,{primary:!0,colorStyle:"danger",onClick:o,children:"End Sessions"})]})]})}));Ws.displayName="ConfirmOtherSessionsSignOut";const qs=(0,Nn.Pi)((t=>t.application.accountMenuController.otherSessionsSignOut?(0,e.jsx)(Ws,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zs(Object(n),!0).forEach((function(t){Zs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},t)):null)),Js=(0,Nn.Pi)((()=>{const t=(0,sr.I)();return(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Clear workspace"}),(0,e.jsx)(Ge.xv,{className:"mb-3",children:"Remove all data related to the current workspace from the application."}),(0,e.jsx)(Ln.Z,{colorStyle:"danger",label:"Clear workspace",onClick:()=>{t.accountMenuController.setSigningOut(!0)}})]})})})),Xs=(0,Nn.Pi)((t=>{let{application:n}=t;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(Ye.Z,{children:[(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Sign out"}),(0,e.jsx)(Ge.QE,{children:"Other devices"}),(0,e.jsx)(Ge.xv,{children:"Want to sign out on all devices except this one?"}),(0,e.jsxs)("div",{className:"mt-3 flex flex-row flex-wrap gap-3",children:[(0,e.jsx)(Ln.Z,{label:"Sign out other sessions",onClick:()=>{n.accountMenuController.setOtherSessionsSignOut(!0)}}),(0,e.jsx)(Ln.Z,{label:"Manage sessions",onClick:()=>n.openSessionsModal()})]})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{children:"This workspace"}),(0,e.jsx)(Ge.xv,{children:"Remove all data related to the current workspace from the application."}),(0,e.jsx)(Ln.Z,{className:"mt-3",colorStyle:"danger",label:"Sign out workspace",onClick:()=>{n.accountMenuController.setSigningOut(!0)}})]})]}),(0,e.jsx)(qs,{application:n})]})}));Xs.displayName="SignOutView";const $s=(0,Nn.Pi)((t=>{let{application:n}=t;return n.hasAccount()?(0,e.jsx)(Xs,{application:n}):(0,e.jsx)(Js,{})})),ea=t=>{let{application:n}=t;const[i,o]=(0,He.useState)(!0),[s,a]=(0,He.useState)(0),[l,c]=(0,He.useState)(0);return(0,He.useEffect)((()=>{(async()=>{const e=await n.settings.getSubscriptionSetting(r.SettingName.create(r.SettingName.NAMES.FileUploadBytesUsed).getValue());if(e&&a(parseFloat(e)),n.sessions.isSignedIntoFirstPartyServer()){const e=await n.settings.getSubscriptionSetting(r.SettingName.create(r.SettingName.NAMES.FileUploadBytesLimit).getValue());e&&c(parseFloat(e))}o(!1)})().catch(console.error)}),[n]),(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Files"}),(0,e.jsx)(Ge.QE,{children:"Storage Quota"}),i?(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(di.Z,{className:"h-3 w-3"})}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"mb-1 mt-1",children:[(0,e.jsx)("span",{className:"font-semibold",children:(0,co.vU)(s)})," of"," ",(0,e.jsx)("span",{children:n.sessions.isSignedIntoFirstPartyServer()?(0,co.vU)(l):"∞"})," ","used"]}),(0,e.jsx)("progress",{className:"progress-bar w-full","aria-label":"Files storage used",value:s,max:l})]})]})})},ta=t=>{let{application:n,text:r}=t;const[i,o]=(0,He.useState)(!1),[s,a]=(0,He.useState)(void 0);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.xv,{children:r}),i&&(0,e.jsx)(Ge.xv,{children:"Redirecting you to the subscription page..."}),s&&(0,e.jsx)(Ge.xv,{className:"text-danger",children:s}),(0,e.jsxs)("div",{className:"flex",children:[!n.hideOutboundSubscriptionLinks&&(0,e.jsx)(Ge.Qj,{className:"mr-3 mt-3 min-w-20",label:"Learn More",link:window.plansUrl}),n.hasAccount()&&(0,e.jsx)(Ln.Z,{className:"mt-3 min-w-20",primary:!0,label:"Upgrade",onClick:async()=>{o(!0);try{n.isNativeIOS()?n.showPremiumModal():n.openPurchaseFlow()}catch(e){a("There was an error when attempting to redirect you to the subscription page.")}finally{o(!1)}}})]})]})},na=(0,Nn.Pi)((t=>{let{subscriptionState:n,application:i}=t;const[o,s]=(0,He.useState)(!1),{usedInvitationsCount:a,subscriptionInvitations:l}=n,c=null==l?void 0:l.filter((e=>[r.InvitationStatus.Sent,r.InvitationStatus.Accepted].includes(e.status)));return 0===a?(0,e.jsx)(Ge.xv,{className:"mb-3 mt-1",children:"Make your first subscription invite below."}):(0,e.jsxs)("div",{children:[(0,e.jsx)(Ge.Cr,{className:"mb-2 text-info",children:"Active Invites"}),null==c?void 0:c.map((t=>(0,e.jsxs)("div",{className:"mb-4 mt-1",children:[(0,e.jsxs)(Ge.xv,{children:[t.inviteeIdentifier," ",(0,e.jsxs)("span",{className:"text-info",children:["(",t.status,")"]})]}),t.status!==r.InvitationStatus.Canceled&&(0,e.jsx)(Ln.Z,{className:"mt-2 min-w-20",label:"Cancel",onClick:()=>(async e=>{if(o)return void i.alerts.alert("Cancelation already in progress.").catch(console.error);if(!await i.alerts.confirm("All uploaded files of this user will be removed. This action cannot be undone.","Are you sure you want to cancel this invitation?","Cancel Invitation",r.ButtonType.Danger))return;s(!0);const t=await n.cancelSubscriptionInvitation(e);s(!1),t||i.alerts.alert("Could not cancel invitation. Please try again or contact support if the issue persists.").catch(console.error)})(t.uuid)})]},t.uuid))),!n.allInvitationsUsed&&(0,e.jsx)(oo.Z,{classes:"my-4"})]})})),ra=t=>{let{setInviteeEmail:n}=t;return(0,e.jsx)("div",{className:"flex w-full flex-col",children:(0,e.jsxs)("div",{className:"mb-3",children:[(0,e.jsx)("label",{className:"mb-1 block font-bold",htmlFor:"invite-email-input",children:"Invitee Email"}),(0,e.jsx)(ui.Z,{type:"email",className:{container:"mt-4"},id:"invite-email-input",onChange:e=>{n(e)}}),(0,e.jsxs)("p",{className:"mt-4",children:[(0,e.jsx)("span",{className:"font-bold",children:"Note: "}),"The invitee must have an existing account with Standard Notes. If they do not have an account yet, instruct them to make an account first."]})]})})},ia=()=>(0,e.jsxs)("div",{children:[(0,e.jsx)(Ge.Dx,{className:"mb-2",children:"Invite processed successfully."}),(0,e.jsx)("div",{className:"mt-2",children:"If an account is found with that email, they will receive an email with your invitation."})]});var oa,sa;!function(e){e.Default="Invite",e.Sending="Sending...",e.Finish="Finish"}(oa||(oa={})),function(e){e[e.InitialStep=0]="InitialStep",e[e.FinishStep=1]="FinishStep"}(sa||(sa={}));const aa=n=>{let{onCloseDialog:r,application:i,subscriptionState:o}=n;const[s,a]=(0,He.useState)(oa.Default),[l,c]=(0,He.useState)(""),[u,d]=(0,He.useState)(!1),[h,p]=(0,He.useState)(!1),[f,g]=(0,He.useState)(sa.InitialStep),m=(0,He.useCallback)((async()=>!!(0,t.Ju)(l)||(i.alerts.alert("The email you entered has an invalid format. Please review your input and try again.").catch(console.error),!1)),[i.alerts,l]),y=(0,He.useCallback)((()=>{h?i.alerts.alert("Cannot close window until pending tasks are complete.").catch(console.error):r()}),[i.alerts,h,r]),v=()=>{a(oa.Default),d(!1)},A=(0,He.useCallback)((async()=>{p(!0);const e=await o.sendSubscriptionInvitation(l);return p(!1),e}),[l,o]),b=(0,He.useCallback)((async()=>{if(!h&&!u)if(f!==sa.FinishStep){if(d(!0),a(oa.Sending),await m())return await A()?(d(!1),a(oa.Finish),void g(sa.FinishStep)):(i.alerts.alert("An error occurred while sending the invite. Please try again or contact support if the issue persists.").catch(console.error),void v());v()}else y()}),[i.alerts,f,y,u,h,A,m]),w=(0,He.useMemo)((()=>[{label:s,onClick:b,type:"primary",mobileSlot:"right",disabled:h},{label:"Cancel",onClick:y,type:"cancel",mobileSlot:"left",hidden:f===sa.FinishStep}]),[f,y,b,h,s]);return(0,e.jsx)(Gn,{title:"Share Your Subscription",close:y,actions:w,children:(0,e.jsxs)("div",{className:"px-4.5 py-4",children:[f===sa.InitialStep&&(0,e.jsx)(ra,{setInviteeEmail:c}),f===sa.FinishStep&&(0,e.jsx)(ia,{})]})})},la=(0,Nn.Pi)((t=>{let{subscriptionState:n}=t;const{usedInvitationsCount:r,allowedInvitationsCount:i}=n;return(0,e.jsxs)(Ge.xv,{className:"mt-1",children:["You've used ",(0,e.jsx)("span",{className:"font-bold",children:r})," out of ",i," ","subscription invites."]})})),ca=(0,Nn.Pi)((t=>{let{application:n}=t;const[i,o]=(0,He.useState)(!1),s=n.subscriptionController,a=n.sessions.isCurrentSessionReadOnly(),l=n.features.getFeatureStatus(r.NativeFeatureIdentifier.create(r.NativeFeatureIdentifier.TYPES.SubscriptionSharing).getValue())===r.FeatureStatus.Entitled&&!a,c=()=>o(!1);return(0,e.jsx)(Ye.Z,{children:(0,e.jsx)(ze.Z,{children:(0,e.jsx)("div",{className:"flex flex-row items-center",children:(0,e.jsxs)("div",{className:"flex flex-grow flex-col",children:[(0,e.jsx)(Ge.Dx,{className:"mb-2",children:"Subscription sharing"}),l?(0,e.jsxs)("div",{children:[(0,e.jsx)(la,{subscriptionState:s}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsx)(na,{subscriptionState:s,application:n}),!s.allInvitationsUsed&&(0,e.jsx)(Ln.Z,{className:"min-w-20",label:"Invite",onClick:()=>o(!0)}),(0,e.jsx)(Fr,{isOpen:i,close:c,children:(0,e.jsx)(aa,{onCloseDialog:c,application:n,subscriptionState:s})})]}):(0,e.jsx)(ta,{application:n,text:(0,e.jsxs)("span",{children:["Subscription sharing is available only on the ",(0,e.jsx)("span",{className:"font-bold",children:"Professional"})," plan. Please upgrade in order to share your subscription."]})})]})})})})})),ua=(0,Nn.Pi)((t=>{let{application:n}=t;const[i,o]=(0,He.useState)(r.MuteSignInEmailsOption.NotMuted),[s,a]=(0,He.useState)(r.MuteMarketingEmailsOption.NotMuted),[l,c]=(0,He.useState)(!0),u=n.features.getFeatureStatus(r.NativeFeatureIdentifier.create(r.NativeFeatureIdentifier.TYPES.SignInAlerts).getValue())===r.FeatureStatus.Entitled,d=(0,He.useCallback)((async()=>{if(n.sessions.getUser()){c(!0);try{const e=await n.settings.listSettings();o(e.getSettingValue(r.SettingName.create(r.SettingName.NAMES.MuteSignInEmails).getValue(),r.MuteSignInEmailsOption.NotMuted)),a(e.getSettingValue(r.SettingName.create(r.SettingName.NAMES.MuteMarketingEmails).getValue(),r.MuteMarketingEmailsOption.NotMuted))}catch(e){console.error(e)}finally{c(!1)}}}),[n]);return(0,He.useEffect)((()=>{d().catch(console.error)}),[d]),(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Email"}),(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex items-start justify-between gap-2 md:items-center",children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)(Ge.QE,{children:"Mute sign-in notification emails"}),u?(0,e.jsx)(Ge.xv,{children:"Disables email notifications when a new sign-in occurs on your account. (Email notifications are available only to paid subscribers)."}):(0,e.jsx)(ta,{application:n,text:(0,e.jsxs)("span",{children:["Sign-in notification emails are available only on a"," ",(0,e.jsx)("span",{className:"font-bold",children:"subscription"})," plan. Please upgrade in order to enable sign-in notifications."]})})]}),l?(0,e.jsx)(di.Z,{className:"h-5 w-5 flex-shrink-0"}):u&&(0,e.jsx)(po.Z,{onChange:async()=>{const e=i,t=e===r.MuteSignInEmailsOption.Muted?r.MuteSignInEmailsOption.NotMuted:r.MuteSignInEmailsOption.Muted;o(t),await(async(e,t)=>{try{return await n.settings.updateSubscriptionSetting(e,t,!1),!0}catch(e){return n.alerts.alert(ht.p7).catch(console.error),!1}})(r.SettingName.create(r.SettingName.NAMES.MuteSignInEmails).getValue(),t)||o(e)},checked:i===r.MuteSignInEmailsOption.Muted})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)("div",{className:"flex items-start justify-between gap-2 md:items-center",children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)(Ge.QE,{children:"Mute marketing notification emails"}),(0,e.jsx)(Ge.xv,{children:"Disables email notifications with special deals and promotions."})]}),l?(0,e.jsx)(di.Z,{className:"h-5 w-5 flex-shrink-0"}):(0,e.jsx)(po.Z,{onChange:async()=>{const e=s,t=e===r.MuteMarketingEmailsOption.Muted?r.MuteMarketingEmailsOption.NotMuted:r.MuteMarketingEmailsOption.Muted;a(t),await(async(e,t)=>{try{return await n.settings.updateSetting(e,t,!1),!0}catch(e){return n.alerts.alert(ht.p7).catch(console.error),!1}})(r.SettingName.create(r.SettingName.NAMES.MuteMarketingEmails).getValue(),t)||a(e)},checked:s===r.MuteMarketingEmailsOption.Muted})]})]})]})})})),da=(0,Nn.Pi)((t=>{let{application:n}=t;return n.hasAccount()?(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Delete account"}),(0,e.jsx)(Ge.xv,{children:"This action is irreversible. After deletion completes, you will be signed out on all devices."}),(0,e.jsx)("div",{className:"mt-3 flex flex-row flex-wrap gap-3",children:(0,e.jsx)(Ln.Z,{colorStyle:"danger",label:"Delete my account",onClick:()=>{n.accountMenuController.setDeletingAccount(!0)}})})]})}):null})),ha=(0,Nn.Pi)((t=>{let{application:n}=t;const r=!n.sessions.isSignedIntoFirstPartyServer();return(0,e.jsxs)(io,{children:[n.hasAccount()?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Us,{application:n}),(0,e.jsx)(Vs,{application:n})]}):(0,e.jsx)(Cs,{application:n}),(0,e.jsx)(Ys,{}),(0,e.jsx)(ca,{application:n}),n.hasAccount()&&n.featuresController.entitledToFiles&&(0,e.jsx)(ea,{application:n}),n.hasAccount()&&!r&&(0,e.jsx)(ua,{application:n}),(0,e.jsx)($s,{application:n}),(0,e.jsx)(da,{application:n})]})})),pa=(e,t)=>"".concat(e," ").concat(t),fa=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),n=(new r.StaticItemCounter).countNotesAndTags(t.items.getItems([r.ContentType.TYPES.Note,r.ContentType.TYPES.Tag])),i=t.items.getItems([r.ContentType.TYPES.File]),o=pa(n.notes,"notes"),s=pa(n.tags,"tags"),a=pa(n.archived,"archived notes"),l=pa(n.deleted,"trashed notes"),c=pa(i.length,"files"),u=(0,e.jsx)(xn.Z,{type:"rich-text",className:"min-h-5 min-w-5"}),d=(0,e.jsx)(xn.Z,{type:"hashtag",className:"min-h-5 min-w-5"}),h=(0,e.jsx)(xn.Z,{type:"archive",className:"min-h-5 min-w-5"}),p=(0,e.jsx)(xn.Z,{type:"trash",className:"min-h-5 min-w-5"}),f=(0,e.jsx)(xn.Z,{type:"folder",className:"min-h-5 min-w-5"});return(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)("div",{className:"flex flex-row flex-wrap items-start pt-1.5 md:pb-1",children:[(0,e.jsx)(uo,{status:o,icon:u}),(0,e.jsx)("div",{className:"min-w-3"}),(0,e.jsx)(uo,{status:c,icon:f}),(0,e.jsx)("div",{className:"min-w-3"}),(0,e.jsx)(uo,{status:s,icon:d}),(0,e.jsx)("div",{className:"min-w-3"}),(0,e.jsx)(uo,{status:a,icon:h}),(0,e.jsx)("div",{className:"min-w-3"}),(0,e.jsx)(uo,{status:l,icon:p})]})})})),ga=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),n=t.hasAccount(),r=t.hasPasscode(),i=t.isEncryptionAvailable(),o=n?ht.CN:r?ht.zu:ht.KV;return(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Encryption"}),(0,e.jsx)(Ge.xv,{children:o}),i&&(0,e.jsx)(fa,{})]})})})),ma=(0,Nn.Pi)((n=>{let{application:i}=n;const o=i.isNativeMobileWeb(),s=ht.xZ.keyStorageInfo(i),{setIsEncryptionEnabled:a,setIsBackupEncrypted:l,setEncryptionStatusString:c}=i.accountMenuController,u=(0,He.useRef)(null),[d,h]=(0,He.useState)(),[p,f]=(0,He.useState)(),[g,m]=(0,He.useState)(null),[y,v]=(0,He.useState)(!1),[A,b]=(0,He.useState)(!1),[w,S]=(0,He.useState)(!i.isEphemeralSession()),[C,E]=(0,He.useState)(i.hasPasscode()),[I,_]=(0,He.useState)((()=>i.protections.getMobilePasscodeTimingOptions())),x=()=>{b(!0),v(!0)},P=(0,He.useCallback)((async()=>{var e;const t=await(null===(e=i.autolockService)||void 0===e?void 0:e.getAutoLockInterval());m(t)}),[i]),k=(0,He.useCallback)((()=>{const e=i.hasAccount(),t=i.hasPasscode();E(t);const n=e||t,r=e?ht.CN:t?ht.zu:ht.KV;c(r),a(n),l(n)}),[i,c,l,a]),B=async e=>{if(e.preventDefault(),d&&0!==d.length||await(0,L.Ne)({text:ht.eI.enterPasscode}),d!==p)return await(0,L.Ne)({text:ht.nS}),void v(!0);await(0,t.A1)(ht.PJ,(async()=>{(i.hasPasscode()?await i.changePasscode(d):await i.addPasscode(d))||v(!0)})),h(void 0),f(void 0),b(!1),k()};(0,He.useEffect)((()=>{k()}),[k]),(0,He.useEffect)((()=>{o||P().catch(console.error)}),[P,o]),(0,He.useEffect)((()=>{var e;y&&(null===(e=u.current)||void 0===e||e.focus(),v(!1))}),[y]),(0,He.useEffect)((()=>{const e=i.addEventObserver((async()=>{S(!i.isEphemeralSession()),E(i.hasPasscode()),b(!1)}),r.ApplicationEvent.KeyStatusChanged);return()=>{e()}}),[i]);const O=i.autolockService;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Passcode lock"}),!C&&w&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.xv,{className:"mb-3",children:"Add a passcode to lock the application and encrypt on-device key storage."}),s&&(0,e.jsx)(Ge.xv,{className:"mb-3",children:s}),!A&&(0,e.jsx)(Ln.Z,{label:"Add passcode",onClick:x,primary:!0})]}),!C&&!w&&(0,e.jsx)(Ge.xv,{children:'Adding a passcode is not supported in temporary sessions. Please sign out, then sign back in with the "Stay signed in" option checked.'}),A&&(0,e.jsxs)("form",{className:"sk-panel-form",onSubmit:B,children:[(0,e.jsx)(gi.Z,{type:"password",ref:u,value:d||"",onChange:e=>{h(e)},placeholder:"Passcode"}),(0,e.jsx)(gi.Z,{className:{container:"mt-2"},type:"password",value:p||"",onChange:e=>{f(e)},placeholder:"Confirm Passcode"}),(0,e.jsx)(Ln.Z,{primary:!0,onClick:B,label:"Set Passcode",className:"mr-3 mt-3"}),(0,e.jsx)(Ln.Z,{onClick:()=>{b(!1),h(void 0),f(void 0)},label:"Cancel"})]}),C&&!A&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.xv,{children:"Passcode lock is enabled."}),(0,e.jsxs)("div",{className:"mt-3 flex flex-row",children:[(0,e.jsx)(Ln.Z,{label:"Change Passcode",onClick:()=>{x()},className:"mr-3"}),(0,e.jsx)(Ln.Z,{colorStyle:"danger",label:"Remove Passcode",onClick:async()=>{await(0,t.A1)(ht.JT,(async()=>{var e;await i.removePasscode()&&(o||(await(null===(e=i.autolockService)||void 0===e?void 0:e.deleteAutolockPreference()),await P()),k())}))}})]})]})]})}),C&&O&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"min-h-3"}),(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Autolock"}),(0,e.jsx)(Ge.xv,{className:"mb-3",children:"The autolock timer begins when the window or tab loses focus."}),(0,e.jsx)("div",{className:"flex flex-row items-center",children:O.getAutoLockIntervalOptions().map((t=>(0,e.jsx)("a",{className:(0,Q.classNames)("mr-3 cursor-pointer rounded",t.value===g?"bg-info px-1.5 py-0.5 text-info-contrast":"text-info"),onClick:()=>(async e=>{var t;await i.authorizeAutolockIntervalChange()&&(await(null===(t=i.autolockService)||void 0===t?void 0:t.setAutoLockInterval(e)),P().catch(console.error))})(t.value),children:t.label},t.value)))})]})})]}),C&&o&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"min-h-3"}),(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Passcode Autolock"}),(0,e.jsx)("div",{className:"flex flex-row items-center",children:(0,e.jsxs)("div",{className:"mt-2 flex flex-row items-center",children:[(0,e.jsx)("div",{className:"mr-3",children:"Require Passcode"}),I.map((t=>(0,e.jsx)("a",{className:(0,Q.classNames)("mr-3 cursor-pointer rounded px-1.5 py-0.5",t.selected?"bg-info text-info-contrast":"text-info"),onClick:()=>{var e;e=t.key,i.protections.setMobilePasscodeTiming(e),_(i.protections.getMobilePasscodeTimingOptions())},children:t.title},t.key)))]})})]})})]})]})})),ya=(0,Nn.Pi)((t=>{let{application:n}=t;const[i,o]=(0,He.useState)(r.LogSessionUserAgentOption.Enabled),[s,a]=(0,He.useState)(!0),l=(0,He.useCallback)((async()=>{if(n.sessions.getUser()){a(!0);try{const e=await n.settings.listSettings();o(e.getSettingValue(r.SettingName.create(r.SettingName.NAMES.LogSessionUserAgent).getValue(),r.LogSessionUserAgentOption.Enabled))}catch(e){console.error(e)}finally{a(!1)}}}),[n]);return(0,He.useEffect)((()=>{l().catch(console.error)}),[l]),(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Privacy"}),(0,e.jsx)("div",{children:(0,e.jsxs)("div",{className:"flex justify-between gap-2 md:items-center",children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)(Ge.QE,{children:"Session user agent logging"}),(0,e.jsx)(Ge.xv,{children:"User agent logging allows you to identify the devices or browsers signed into your account. For increased privacy, you can disable this feature, which will remove all saved user agent values from our server, and disable future logging of this value."})]}),s?(0,e.jsx)(di.Z,{className:"h-5 w-5 flex-shrink-0"}):(0,e.jsx)(po.Z,{onChange:async()=>{const e=i,t=e===r.LogSessionUserAgentOption.Enabled?r.LogSessionUserAgentOption.Disabled:r.LogSessionUserAgentOption.Enabled;o(t),await(async(e,t)=>{try{return await n.settings.updateSetting(e,t,!1),!0}catch(e){return n.alerts.alert(ht.p7).catch(console.error),!1}})(r.SettingName.create(r.SettingName.NAMES.LogSessionUserAgent).getValue(),t)||o(e)},checked:i===r.LogSessionUserAgentOption.Enabled})]})})]})})})),va=n=>{let{application:i}=n;const[o,s]=(0,He.useState)((()=>i.hasProtectionSources())),a=(0,He.useCallback)((()=>{const e=i.getProtectionSessionExpiryDate(),n=new Date;if(e>n){let r;return r=(0,t.KC)(e,n)?new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"numeric"}):new Intl.DateTimeFormat(void 0,{weekday:"long",day:"numeric",month:"short",hour:"numeric",minute:"numeric"}),r.format(e)}return null}),[i]),[l,c]=(0,He.useState)(a());return(0,He.useEffect)((()=>{const e=i.addEventObserver((async()=>{c(a())}),r.ApplicationEvent.UnprotectedSessionBegan),t=i.addEventObserver((async()=>{c(a())}),r.ApplicationEvent.UnprotectedSessionExpired),n=i.addEventObserver((async()=>{s(i.hasProtectionSources())}),r.ApplicationEvent.KeyStatusChanged);return()=>{e(),t(),n()}}),[i,a]),o?(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Protections"}),l?(0,e.jsxs)(Ge.xv,{className:"text-info",children:["Unprotected access expires at ",l,"."]}):(0,e.jsx)(Ge.xv,{className:"text-info",children:"Protections are enabled."}),(0,e.jsx)(Ge.xv,{className:"mt-2",children:"Actions like viewing or searching protected notes, exporting decrypted backups, or revoking an active session require additional authentication such as entering your account password or application passcode."}),l&&(0,e.jsx)(Ln.Z,{className:"mt-3",primary:!0,label:"End Unprotected Access",onClick:()=>{i.clearProtectionSession().catch(console.error)}})]})}):null},Aa=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),[n,i]=(0,He.useState)(t.items.invalidNonVaultedItems);(0,He.useEffect)((()=>t.items.streamItems(r.ContentType.TYPES.Any,(()=>{i(t.items.invalidNonVaultedItems)}))),[t]);const o=e=>{const t=r.ContentType.create(e.content_type);let n=null;return t.isFailed()||(n=t.getValue().getDisplayName()),n?"".concat(n[0].toUpperCase()).concat(n.slice(1)):"Item of type ".concat(e.content_type)},s=async e=>{await t.alerts.confirm("Are you sure you want to permanently delete ".concat(e.length," item(s)?"),void 0,"Delete",r.ButtonType.Danger)&&(t.mutator.deleteItems(e).then((()=>{t.sync.sync()})),i(t.items.invalidItems))};return 0===n.length?null:(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsxs)(Ge.Dx,{className:"flex flex-row items-center gap-2",children:[(0,e.jsx)(to,{}),"Error decrypting items"]}),(0,e.jsx)(Ge.xv,{children:"".concat(n.length," items are errored and could not be decrypted.")}),(0,e.jsxs)("div",{className:"flex",children:[(0,e.jsx)(Ln.Z,{className:"mr-2 mt-3 min-w-20",label:"Export all",onClick:()=>{t.archiveService.downloadEncryptedItems(n)}}),(0,e.jsx)(Ln.Z,{className:"mr-2 mt-3 min-w-20",colorStyle:"danger",label:"Delete all",onClick:()=>{s(n)}})]}),(0,e.jsx)(oo.Z,{classes:"mt-2.5 mb-3"}),n.map(((i,a)=>(0,e.jsxs)(He.Fragment,{children:[(0,e.jsx)("div",{className:"flex items-center justify-between",children:(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)(Ge.QE,{children:"".concat(o(i)," created on ").concat(i.createdAtString)}),(0,e.jsxs)(Ge.xv,{children:["Item ID: ",i.uuid]}),(0,e.jsxs)(Ge.xv,{children:["Last Modified: ",i.updatedAtString]}),(0,e.jsxs)("div",{className:"flex",children:[(0,e.jsx)(Ln.Z,{className:"mr-2 mt-3 min-w-20",label:"Attempt decryption",onClick:()=>{(e=>{const n=t.canAttemptDecryptionOfItem(e);n instanceof r.ClientDisplayableError?t.alerts.showErrorAlert(n):t.presentKeyRecoveryWizard()})(i)}}),(0,e.jsx)(Ln.Z,{className:"mr-2 mt-3 min-w-20",label:"Export",onClick:()=>{t.archiveService.downloadEncryptedItem(i)}}),(0,e.jsx)(Ln.Z,{className:"mr-2 mt-3 min-w-20",colorStyle:"danger",label:"Delete",onClick:()=>{(async e=>{s([e])})(i)}})]})]})}),a<n.length-1&&(0,e.jsx)(oo.Z,{classes:"mt-2.5 mb-3"})]},i.uuid)))]})})})),ba=(0,Nn.Pi)((t=>{let{application:n}=t;const[i,o]=(0,He.useState)(!1),[s,a]=(0,He.useState)(!1),[l,c]=(0,He.useState)((()=>n.protections.getMobileBiometricsTimingOptions()));(0,He.useEffect)((()=>{const e=n.protections.hasBiometricsEnabled();o(e),(async()=>{var e,t;const r=await(null===(t=(e=n.device).getDeviceBiometricsAvailability)||void 0===t?void 0:t.call(e));a(r)})()}),[n]);const u=async e=>{n.protections.setMobileBiometricsTiming(e),c((()=>n.protections.getMobileBiometricsTimingOptions()))},d=(0,He.useCallback)((async()=>{await n.protections.disableBiometrics()&&o(!1)}),[n]),h=i?"Disable Biometrics Lock":"Enable Biometrics Lock";return s?(0,e.jsx)("div",{children:(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Biometrics Lock"}),(0,e.jsx)(Ln.Z,{className:"mt-1",label:h,onClick:async()=>{i?await d():(o(!0),n.protections.enableBiometrics(),await u(r.MobileUnlockTiming.OnQuit))},primary:!0}),i&&(0,e.jsxs)("div",{className:"mt-2 flex flex-row items-center",children:[(0,e.jsx)("div",{className:"mr-3",children:"Require Biometrics"}),l.map((t=>(0,e.jsx)("a",{className:(0,Q.classNames)("mr-3 cursor-pointer rounded px-1.5 py-0.5",t.selected?"bg-info text-info-contrast":"text-info"),onClick:()=>{u(t.key)},children:t.title},t.key)))]})]})})}):null})),wa=(0,Nn.Pi)((t=>{let{application:n}=t;const[r,i]=(0,He.useState)(!1);(0,He.useEffect)((()=>{const e=n.protections.getMobileScreenshotPrivacyEnabled();i(e)}),[n]);const o=(0,L.gn)()?"Multitasking Privacy":"Multitasking/Screenshot Privacy",s=r?"Disable ".concat(o):"Enable ".concat(o);return(0,e.jsx)("div",{children:(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:o}),(0,e.jsx)(Ln.Z,{className:"mt-1",label:s,onClick:async()=>{const e=!r;i(e),n.protections.setMobileScreenshotPrivacyEnabled(e),n.device.setAndroidScreenshotPrivacy(e)},primary:!0})]})})})}));class Sa{constructor(e,t,n,r,i){this.mfa=e,this.email=t,this._secretKey=n,this._cancelActivation=r,this._enabled2FA=i,this.type="two-factor-activation",this._2FAVerification="none",this.inputSecretKey="",this.inputOtpToken="",this._activationStep="scan-qr-code",(0,_.ky)(this,{_secretKey:_.LO,_authCode:_.LO,_step:_.LO,_enable2FAVerification:_.LO,inputOtpToken:_.LO,inputSecretKey:_.LO},{autoBind:!0})}get secretKey(){return this._secretKey}get activationStep(){return this._activationStep}get verificationStatus(){return this._2FAVerification}get qrCode(){return"otpauth://totp/2FA?secret=".concat(this._secretKey,"&issuer=Standard%20Notes&label=").concat(this.email)}cancelActivation(){this._cancelActivation()}openScanQRCode(){"save-secret-key"===this._activationStep&&(this._activationStep="scan-qr-code")}openSaveSecretKey(){["scan-qr-code","verification"].includes(this._activationStep)&&(this._activationStep="save-secret-key")}openVerification(){this.inputOtpToken="",this.inputSecretKey="","save-secret-key"===this._activationStep&&(this._activationStep="verification",this._2FAVerification="none")}openSuccess(){"verification"===this._activationStep&&(this._activationStep="success")}setInputSecretKey(e){this.inputSecretKey=e}setInputOtpToken(e){this.inputOtpToken=e}enable2FA(){this.inputSecretKey===this._secretKey?this.mfa.enableMfa(this.inputSecretKey,this.inputOtpToken).then((0,_.aD)((()=>{this._2FAVerification="valid",this.openSuccess()}))).catch((0,_.aD)((()=>{this._2FAVerification="invalid-auth-code"}))):this._2FAVerification="invalid-secret"}finishActivation(){"success"===this._activationStep&&this._enabled2FA()}}const Ca=e=>"two-factor-activation"===(null==e?void 0:e.type),Ea=e=>"two-factor-enabled"===e;class Ia{constructor(e,t,n){this.sessions=e,this.mfa=t,this.callback=n,this._status="fetching",this._errorMessage=null,(0,_.ky)(this,{_status:_.LO,_errorMessage:_.LO,deactivateMfa:_.aD,startActivation:_.aD},{autoBind:!0})}startActivation(){const e=(0,_.aD)((()=>this._status="two-factor-disabled")),t=(0,_.aD)((()=>{this._status="two-factor-enabled",this.fetchStatus()}));this.mfa.generateMfaSecret().then((0,_.aD)((n=>{var r;this._status=new Sa(this.mfa,null===(r=this.sessions.getUser())||void 0===r?void 0:r.email,n,e,t)}))).catch((0,_.aD)((e=>{this.setError(e.message)})))}deactivate2FA(){this.mfa.disableMfa().then((0,_.aD)((()=>{this.fetchStatus()}))).catch((0,_.aD)((e=>{this.setError(e.message)})))}isLoggedIn(){return null!=this.sessions.getUser()}fetchStatus(){this.isLoggedIn()&&this.mfa.isMfaActivated().then((0,_.aD)((e=>{this._status=e?"two-factor-enabled":"two-factor-disabled",this.setError(null),this.callback&&this.callback(this._status)}))).catch((0,_.aD)((e=>{this._status="two-factor-disabled",this.setError(e.message)})))}setError(e){this._errorMessage=e}toggle2FA(){if(this.isLoggedIn())return"two-factor-disabled"===this._status?this.startActivation():"two-factor-enabled"===this._status?this.deactivate2FA():void 0}get errorMessage(){return this._errorMessage}get status(){return this._status}}const _a=(0,Nn.Pi)((()=>void 0===(0,sr.I)().sessions.getUser()?(0,e.jsx)(Ge.Dx,{children:"Hardware security key authentication not available"}):(0,e.jsx)(Ge.Dx,{children:"Hardware security key authentication"}))),xa=(0,Nn.Pi)((t=>{let{is2FAEnabled:n}=t;const r=(0,sr.I)();return void 0===r.sessions.getUser()?(0,e.jsx)(Ge.xv,{children:"Sign in or register for an account to configure hardware security keys."}):(0,e.jsxs)("div",{children:[(0,e.jsx)(Ge.xv,{children:"Authenticate with a hardware security key such as YubiKey."}),!r.isFullU2FClient&&(0,e.jsx)(Ge.xv,{className:"italic",children:"Please visit the web app in order to add a hardware security key."}),!n&&(0,e.jsx)(Ge.xv,{className:"italic",children:"You must enable two-factor authentication before adding a hardware security key."})]})})),Pa=(0,Nn.Pi)((t=>{let{addAuthenticator:n,onDeviceAddingModalToggle:r,onDeviceAdded:i}=t;const o=(0,sr.I)(),[s,a]=(0,He.useState)(""),[l,c]=(0,He.useState)(""),u=(0,He.useCallback)((e=>{a(e)}),[]),d=(0,He.useCallback)((async()=>{if(!s)return void c("Device name is required");const e=o.sessions.getUser();if(void 0===e)return void c("User not found");const t=await n.execute({userUuid:e.uuid,authenticatorName:s});t.isFailed()?c(t.getError()):(r(!1),await i())}),[s,c,o,n,r,i]),h=()=>{r(!1)},p=(0,et.ac)(et.Jj.sm);return(0,e.jsx)(Gn,{title:"Add Security Key",close:h,actions:[{label:"Cancel",type:"cancel",onClick:h,mobileSlot:"left",hidden:!p},{label:(0,e.jsxs)(e.Fragment,{children:["Add ",(0,e.jsx)("span",{className:"hidden md:inline",children:"Device"})]}),type:"primary",onClick:d,mobileSlot:"right"}],children:(0,e.jsx)("div",{className:"flex px-4 py-4",children:(0,e.jsxs)("div",{className:"ml-4 flex flex-grow flex-col gap-1",children:[(0,e.jsx)("label",{htmlFor:"u2f-device-name",className:"mb-2 text-sm font-semibold",children:"Device Name"}),(0,e.jsx)(ui.Z,{autofocus:!0,id:"u2f-device-name",className:{container:"w-92"},value:s,onChange:u,onEnter:d}),l&&(0,e.jsx)("div",{className:"mt-1.5 text-danger",children:l})]})})})})),ka=(0,Nn.Pi)((t=>{let{application:n,devices:r,onError:i,onDeviceDeleted:o}=t;const s=(0,He.useCallback)((async e=>{const t=await n.deleteAuthenticator.execute({authenticatorId:e});t.isFailed()?i(t.getError()):await o()}),[n,o,i]);return(0,e.jsx)("div",{children:r.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.QE,{children:"Devices"}),(0,e.jsx)("div",{className:"flex flex-grow flex-col divide-y divide-border",children:r.map((t=>(0,e.jsxs)("div",{className:"flex items-center py-2",children:[(0,e.jsx)(xn.Z,{type:"security"}),(0,e.jsx)("div",{className:"ml-2 mr-auto text-sm",children:t.name}),(0,e.jsx)(Ln.Z,{small:!0,label:"Delete",onClick:async()=>s(t.id)},t.id)]},"device-".concat(t.id))))})]})})})),Ba=t=>{let{application:n}=t;const[r,i]=(0,He.useState)(),[o,s]=(0,He.useState)();return(0,e.jsxs)("div",{className:"grid grid-cols-1 rounded-md border border-border p-4",children:[(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)(xn.Z,{className:"-ml-1 mr-1 h-5 w-5 text-info group-disabled:text-passive-2",type:"asterisk"}),(0,e.jsx)("h1",{className:"sk-h3 m-0 text-sm font-semibold",children:"Save your recovery code"})]}),(0,e.jsx)("p",{className:"col-start-1 col-end-3 m-0 mt-1 text-sm",children:"Your recovery code allows you access to your account in the event you lose your 2FA authenticating device or app. Save your recovery code in a safe place outside your account."}),o&&(0,e.jsx)("div",{children:o}),!r&&(0,e.jsx)(Ln.Z,{primary:!0,small:!0,className:"col-start-1 col-end-3 mt-3 justify-self-start uppercase",onClick:async()=>{if(!await n.challenges.promptForAccountPassword())return;const e=await n.getRecoveryCodes.execute();e.isFailed()?s(e.getError()):i(e.getValue())},children:"Show Recovery Code"}),r&&(0,e.jsxs)("div",{className:"group relative mt-2 rounded border border-border px-3 py-2 text-sm font-semibold",children:[(0,e.jsx)($r.Z,{label:"Copy to clipboard",className:"!z-modal",children:(0,e.jsx)("button",{className:"absolute right-2 top-2 flex rounded border border-border bg-default p-1 opacity-0 hover:bg-contrast focus:opacity-100 group-hover:opacity-100",onClick:()=>{navigator.clipboard.writeText(r)},children:(0,e.jsx)(xn.Z,{type:"copy",size:"small"})})}),r]})]})},Oa=(0,Nn.Pi)((t=>{let{application:n,is2FAEnabled:r,loadAuthenticatorsCallback:i}=t;const[o,s]=(0,He.useState)(!1),[a,l]=(0,He.useState)([]),[c,u]=(0,He.useState)(""),d=(0,He.useCallback)((()=>{s(!0)}),[]),h=(0,He.useCallback)((async()=>{const e=await n.listAuthenticators.execute();if(e.isFailed())return void u(e.getError());const t=e.getValue();l(t),i(t)}),[u,l,n,i]);return(0,He.useEffect)((()=>{h().catch(console.error)}),[h]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(Ye.Z,{children:[(0,e.jsx)(ze.Z,{children:(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)(_a,{}),(0,e.jsx)(xa,{is2FAEnabled:r})]})}),(0,e.jsxs)(ze.Z,{classes:"mt-2",children:[c&&(0,e.jsx)("div",{className:"text-danger",children:c}),(0,e.jsx)(ka,{application:n,devices:a,onError:u,onDeviceDeleted:h}),(0,e.jsx)(Ln.Z,{className:"mt-1",disabled:!n.isFullU2FClient||!r,label:"Add Device",primary:!0,onClick:d})]}),a.length>0&&(0,e.jsx)(ze.Z,{children:(0,e.jsx)("div",{className:"mt-3",children:(0,e.jsx)(Ba,{application:n})})})]}),(0,e.jsx)(Fr,{isOpen:o,close:()=>s(!1),children:(0,e.jsx)(Pa,{onDeviceAddingModalToggle:s,onDeviceAdded:h,addAuthenticator:n.addAuthenticator})})]})}));var Na=s(99456);const Da=t=>{let{copyValue:n}=t;const[r,i]=(0,He.useState)(!1);return(0,e.jsx)(Na.Z,{focusable:!1,title:"Copy to clipboard",icon:r?"check":"copy",className:"".concat(r?"success":void 0," p-0"),onClick:()=>{var e;null===(e=null===navigator||void 0===navigator?void 0:navigator.clipboard)||void 0===e||e.writeText(n).catch(console.error),i((()=>!0))}})},ja=t=>{let{className:n=""}=t;return(0,e.jsx)("div",{className:"inline-block min-h-1 min-w-1 rounded-full bg-text ".concat(n," mr-2")})},Ta=(0,Nn.Pi)((t=>{let{activation:n}=t;return(0,e.jsx)("div",{className:"h-33 flex flex-row items-center px-4 py-4",children:(0,e.jsxs)("div",{className:"flex flex-grow flex-col",children:[(0,e.jsxs)("div",{className:"flex flex-row flex-wrap items-center gap-1",children:[(0,e.jsx)(ja,{}),(0,e.jsxs)("div",{className:"text-sm",children:[(0,e.jsx)("b",{children:"Save your secret key"})," ",(0,e.jsx)("a",{target:"_blank",href:"https://standardnotes.com/help/21/where-should-i-store-my-two-factor-authentication-secret-key",children:"somewhere safe"}),":"]}),(0,e.jsx)(ui.Z,{disabled:!0,right:[(0,e.jsx)(Da,{copyValue:n.secretKey}),(0,e.jsx)(Na.Z,{focusable:!1,title:"Download",icon:"download",className:"p-0",onClick:()=>{!function(e){const t=document.createElement("a"),n=new Blob([e],{type:"text/plain;charset=utf-8"});t.href=window.URL.createObjectURL(n),t.setAttribute("download","standardnotes_2fa_key.txt"),document.body.appendChild(t),t.click(),t.remove(),window.URL.revokeObjectURL(t.href)}(n.secretKey)}})],value:n.secretKey,className:{container:"ml-2"}})]}),(0,e.jsx)("div",{className:"h-2"}),(0,e.jsxs)("div",{className:"flex flex-row items-center",children:[(0,e.jsx)(ja,{}),(0,e.jsx)("div",{className:"min-w-1"}),(0,e.jsxs)("div",{className:"text-sm",children:["You can use this key to generate codes if you lose access to your authenticator app.",(0,e.jsx)("br",{}),(0,e.jsxs)("a",{target:"_blank",rel:"noreferrer noopener",className:"underline hover:no-underline",href:"https://standardnotes.com/help/22/what-happens-if-i-lose-my-2fa-device-and-my-secret-key",children:["Learn more",(0,e.jsx)(xn.Z,{className:"ml-1 inline",type:"open-in",size:"small"})]})]})]})]})})}));var Ma,Fa=Object.defineProperty,Ra=Object.getOwnPropertySymbols,La=Object.prototype.hasOwnProperty,Qa=Object.prototype.propertyIsEnumerable,Ua=(e,t,n)=>t in e?Fa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Va=(e,t)=>{for(var n in t||(t={}))La.call(t,n)&&Ua(e,n,t[n]);if(Ra)for(var n of Ra(t))Qa.call(t,n)&&Ua(e,n,t[n]);return e},Ka=(e,t)=>{var n={};for(var r in e)La.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Ra)for(var r of Ra(e))t.indexOf(r)<0&&Qa.call(e,r)&&(n[r]=e[r]);return n};(e=>{const t=class{constructor(e,n,r,i){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version value out of range");if(i<-1||i>7)throw new RangeError("Mask value out of range");this.size=4*e+17;let s=[];for(let e=0;e<this.size;e++)s.push(!1);for(let e=0;e<this.size;e++)this.modules.push(s.slice()),this.isFunction.push(s.slice());this.drawFunctionPatterns();const a=this.addEccAndInterleave(r);if(this.drawCodewords(a),-1==i){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const n=this.getPenaltyScore();n<e&&(i=t,e=n),this.applyMask(t)}}o(0<=i&&i<=7),this.mask=i,this.applyMask(i),this.drawFormatBits(i),this.isFunction=[]}static encodeText(n,r){const i=e.QrSegment.makeSegments(n);return t.encodeSegments(i,r)}static encodeBinary(n,r){const i=e.QrSegment.makeBytes(n);return t.encodeSegments([i],r)}static encodeSegments(e,n,i=1,s=40,l=-1,c=!0){if(!(t.MIN_VERSION<=i&&i<=s&&s<=t.MAX_VERSION)||l<-1||l>7)throw new RangeError("Invalid value");let u,d;for(u=i;;u++){const r=8*t.getNumDataCodewords(u,n),i=a.getTotalBits(e,u);if(i<=r){d=i;break}if(u>=s)throw new RangeError("Data too long")}for(const e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])c&&d<=8*t.getNumDataCodewords(u,e)&&(n=e);let h=[];for(const t of e){r(t.mode.modeBits,4,h),r(t.numChars,t.mode.numCharCountBits(u),h);for(const e of t.getData())h.push(e)}o(h.length==d);const p=8*t.getNumDataCodewords(u,n);o(h.length<=p),r(0,Math.min(4,p-h.length),h),r(0,(8-h.length%8)%8,h),o(h.length%8==0);for(let e=236;h.length<p;e^=253)r(e,8,h);let f=[];for(;8*f.length<h.length;)f.push(0);return h.forEach(((e,t)=>f[t>>>3]|=e<<7-(7&t))),new t(u,n,f,l)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)0==n&&0==r||0==n&&r==t-1||n==t-1&&0==r||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const t=this.errorCorrectionLevel.formatBits<<3|e;let n=t;for(let e=0;e<10;e++)n=n<<1^1335*(n>>>9);const r=21522^(t<<10|n);o(r>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,i(r,e));this.setFunctionModule(8,7,i(r,6)),this.setFunctionModule(8,8,i(r,7)),this.setFunctionModule(7,8,i(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,i(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,i(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,i(r,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^7973*(e>>>11);const t=this.version<<12|e;o(t>>>18==0);for(let e=0;e<18;e++){const n=i(t,e),r=this.size-11+e%3,o=Math.floor(e/3);this.setFunctionModule(r,o,n),this.setFunctionModule(o,r,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){const i=Math.max(Math.abs(r),Math.abs(n)),o=e+r,s=t+n;0<=o&&o<this.size&&0<=s&&s<this.size&&this.setFunctionModule(o,s,2!=i&&4!=i)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,1!=Math.max(Math.abs(r),Math.abs(n)))}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){const n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw new RangeError("Invalid argument");const i=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],s=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],a=Math.floor(t.getNumRawDataModules(n)/8),l=i-a%i,c=Math.floor(a/i);let u=[];const d=t.reedSolomonComputeDivisor(s);for(let n=0,r=0;n<i;n++){let i=e.slice(r,r+c-s+(n<l?0:1));r+=i.length;const o=t.reedSolomonComputeRemainder(i,d);n<l&&i.push(0),u.push(i.concat(o))}let h=[];for(let e=0;e<u[0].length;e++)u.forEach(((t,n)=>{(e!=c-s||n>=l)&&h.push(t[e])}));return o(h.length==a),h}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let r=0;r<this.size;r++)for(let o=0;o<2;o++){const s=t-o,a=0==(t+1&2)?this.size-1-r:r;!this.isFunction[a][s]&&n<8*e.length&&(this.modules[a][s]=i(e[n>>>3],7-(7&n)),n++)}}o(n==8*e.length)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,i=0,o=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[n][s]==r?(i++,5==i?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,o),r||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),r=this.modules[n][s],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,o)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,i=0,o=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[s][n]==r?(i++,5==i?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,o),r||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),r=this.modules[s][n],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,o)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){const i=this.modules[n][r];i==this.modules[n][r+1]&&i==this.modules[n+1][r]&&i==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(const e of this.modules)n=e.reduce(((e,t)=>e+(t?1:0)),n);const r=this.size*this.size,i=Math.ceil(Math.abs(20*n-10*r)/r)-1;return o(0<=i&&i<=9),e+=i*t.PENALTY_N4,o(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{const e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2));let n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version number out of range");let n=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return o(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let i=0;i<e;i++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map((e=>0));for(const i of e){const e=i^r.shift();r.push(0),n.forEach(((n,i)=>r[i]^=t.reedSolomonMultiply(n,e)))}return r}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");let n=0;for(let r=7;r>=0;r--)n=n<<1^285*(n>>>7),n^=(t>>>r&1)*e;return o(n>>>8==0),n}finderPenaltyCountPatterns(e){const t=e[1];o(t<=3*this.size);const n=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(n&&e[0]>=4*t&&e[6]>=t?1:0)+(n&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};let n=t;function r(e,t,n){if(t<0||t>31||e>>>t!=0)throw new RangeError("Value out of range");for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function i(e,t){return 0!=(e>>>t&1)}function o(e){if(!e)throw new Error("Assertion error")}n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],n.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=n;const s=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}static makeBytes(e){let t=[];for(const n of e)r(n,8,t);return new s(s.Mode.BYTE,e.length,t)}static makeNumeric(e){if(!s.isNumeric(e))throw new RangeError("String contains non-numeric characters");let t=[];for(let n=0;n<e.length;){const i=Math.min(e.length-n,3);r(parseInt(e.substr(n,i),10),3*i+1,t),n+=i}return new s(s.Mode.NUMERIC,e.length,t)}static makeAlphanumeric(e){if(!s.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");let t,n=[];for(t=0;t+2<=e.length;t+=2){let i=45*s.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t));i+=s.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t+1)),r(i,11,n)}return t<e.length&&r(s.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)),6,n),new s(s.Mode.ALPHANUMERIC,e.length,n)}static makeSegments(e){return""==e?[]:s.isNumeric(e)?[s.makeNumeric(e)]:s.isAlphanumeric(e)?[s.makeAlphanumeric(e)]:[s.makeBytes(s.toUtf8ByteArray(e))]}static makeEci(e){let t=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)r(e,8,t);else if(e<16384)r(2,2,t),r(e,14,t);else{if(!(e<1e6))throw new RangeError("ECI assignment value out of range");r(6,3,t),r(e,21,t)}return new s(s.Mode.ECI,0,t)}static isNumeric(e){return s.NUMERIC_REGEX.test(e)}static isAlphanumeric(e){return s.ALPHANUMERIC_REGEX.test(e)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(const r of e){const e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)"%"!=e.charAt(n)?t.push(e.charCodeAt(n)):(t.push(parseInt(e.substr(n+1,2),16)),n+=2);return t}};let a=s;a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=a})(Ma||(Ma={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};let n=t;n.LOW=new t(0,1),n.MEDIUM=new t(1,0),n.QUARTILE=new t(2,3),n.HIGH=new t(3,2),e.Ecc=n})(t=e.QrCode||(e.QrCode={}))})(Ma||(Ma={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};let n=t;n.NUMERIC=new t(1,[10,12,14]),n.ALPHANUMERIC=new t(2,[9,11,13]),n.BYTE=new t(4,[8,16,16]),n.KANJI=new t(8,[8,10,12]),n.ECI=new t(7,[0,0,0]),e.Mode=n})(t=e.QrSegment||(e.QrSegment={}))})(Ma||(Ma={}));var Ha=Ma,Ga={L:Ha.QrCode.Ecc.LOW,M:Ha.QrCode.Ecc.MEDIUM,Q:Ha.QrCode.Ecc.QUARTILE,H:Ha.QrCode.Ecc.HIGH},Ya=128,za="L",Za="#FFFFFF",Wa="#000000",qa=!1,Ja=4,Xa=.1;function $a(e,t=0){const n=[];return e.forEach((function(e,r){let i=null;e.forEach((function(o,s){if(!o&&null!==i)return n.push(`M${i+t} ${r+t}h${s-i}v1H${i+t}z`),void(i=null);if(s!==e.length-1)o&&null===i&&(i=s);else{if(!o)return;null===i?n.push(`M${s+t},${r+t} h1v1H${s+t}z`):n.push(`M${i+t},${r+t} h${s+1-i}v1H${i+t}z`)}}))})),n.join("")}function el(e,t){return e.slice().map(((e,n)=>n<t.y||n>=t.y+t.h?e:e.map(((e,n)=>(n<t.x||n>=t.x+t.w)&&e))))}function tl(e,t,n,r){if(null==r)return null;const i=n?Ja:0,o=e.length+2*i,s=Math.floor(t*Xa),a=o/t,l=(r.width||s)*a,c=(r.height||s)*a,u=null==r.x?e.length/2-l/2:r.x*a,d=null==r.y?e.length/2-c/2:r.y*a;let h=null;if(r.excavate){let e=Math.floor(u),t=Math.floor(d);h={x:e,y:t,w:Math.ceil(l+u-e),h:Math.ceil(c+d-t)}}return{x:u,y:d,h:c,w:l,excavation:h}}var nl=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}();function rl(e){const t=e,{value:n,size:r=Ya,level:i=za,bgColor:o=Za,fgColor:s=Wa,includeMargin:a=qa,style:l,imageSettings:c}=t,u=Ka(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),d=null==c?void 0:c.src,h=(0,He.useRef)(null),p=(0,He.useRef)(null),[f,g]=(0,He.useState)(!1);(0,He.useEffect)((()=>{if(null!=h.current){const e=h.current,t=e.getContext("2d");if(!t)return;let l=Ha.QrCode.encodeText(n,Ga[i]).getModules();const u=a?Ja:0,d=l.length+2*u,f=tl(l,r,a,c),g=p.current,m=null!=f&&null!==g&&g.complete&&0!==g.naturalHeight&&0!==g.naturalWidth;m&&null!=f.excavation&&(l=el(l,f.excavation));const y=window.devicePixelRatio||1;e.height=e.width=r*y;const v=r/d*y;t.scale(v,v),t.fillStyle=o,t.fillRect(0,0,d,d),t.fillStyle=s,nl?t.fill(new Path2D($a(l,u))):l.forEach((function(e,n){e.forEach((function(e,r){e&&t.fillRect(r+u,n+u,1,1)}))})),m&&t.drawImage(g,f.x+u,f.y+u,f.w,f.h)}})),(0,He.useEffect)((()=>{g(!1)}),[d]);const m=Va({height:r,width:r},l);let y=null;return null!=d&&(y=He.createElement("img",{src:d,key:d,style:{display:"none"},onLoad:()=>{g(!0)},ref:p})),He.createElement(He.Fragment,null,He.createElement("canvas",Va({style:m,height:r,width:r,ref:h},u)),y)}function il(e){const t=e,{value:n,size:r=Ya,level:i=za,bgColor:o=Za,fgColor:s=Wa,includeMargin:a=qa,imageSettings:l}=t,c=Ka(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let u=Ha.QrCode.encodeText(n,Ga[i]).getModules();const d=a?Ja:0,h=u.length+2*d,p=tl(u,r,a,l);let f=null;null!=l&&null!=p&&(null!=p.excavation&&(u=el(u,p.excavation)),f=He.createElement("image",{xlinkHref:l.src,height:p.h,width:p.w,x:p.x+d,y:p.y+d,preserveAspectRatio:"none"}));const g=$a(u,d);return He.createElement("svg",Va({height:r,width:r,viewBox:`0 0 ${h} ${h}`},c),He.createElement("path",{fill:o,d:`M0,0 h${h}v${h}H0z`,shapeRendering:"crispEdges"}),He.createElement("path",{fill:s,d:g,shapeRendering:"crispEdges"}),f)}var ol=e=>{const t=e,{renderAs:n}=t,r=Ka(t,["renderAs"]);return"svg"===n?He.createElement(il,Va({},r)):He.createElement(rl,Va({},r))},sl=s(12216),al=s(89723),ll=s(23738);const cl=()=>{const t=(0,sl.z)({showTimeout:100});return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(al.w,{store:t,children:(0,e.jsx)(xn.Z,{type:"info"})}),(0,e.jsx)(ll.u,{store:t,className:" max-w-76 rounded border border-border bg-default px-3 py-2 text-sm",children:"Some apps, like Google Authenticator, do not back up and restore your secret keys if you lose your device or get a new one."})]})},ul=(0,Nn.Pi)((t=>{let{activation:n}=t;const r=(0,et.ac)(et.Jj.sm);return(0,e.jsxs)("div",{className:"h-33 flex flex-col items-center gap-5 px-4 py-4 md:flex-row",children:[(0,e.jsx)("div",{className:"flex items-center justify-center bg-info",children:(0,e.jsx)(ol,{className:"border-2 border-solid border-neutral-contrast",value:n.qrCode,size:r?200:150})}),(0,e.jsxs)("div",{className:"flex flex-grow flex-col gap-2",children:[(0,e.jsxs)("div",{className:"flex flex-row items-center",children:[(0,e.jsx)(ja,{}),(0,e.jsx)("div",{className:"min-w-1"}),(0,e.jsxs)("div",{className:"text-sm",children:["Open your ",(0,e.jsx)("b",{children:"authenticator app"}),"."]}),(0,e.jsx)("div",{className:"min-w-2"}),(0,e.jsx)(cl,{})]}),(0,e.jsxs)("div",{className:"flex flex-row items-center",children:[(0,e.jsx)(ja,{className:"mt-2 self-start"}),(0,e.jsx)("div",{className:"min-w-1"}),(0,e.jsxs)("div",{className:"flex-grow text-sm",children:[(0,e.jsx)("b",{children:"Scan this QR code"})," or ",(0,e.jsx)("b",{children:"add this secret key"}),":"]})]}),(0,e.jsx)(ui.Z,{className:{container:"w-92 ml-4"},disabled:!0,value:n.secretKey,right:[(0,e.jsx)(Da,{copyValue:n.secretKey})]})]})]})})),dl=(0,Nn.Pi)((t=>{let{activation:n}=t;const r="invalid-secret"===n.verificationStatus?"border-danger":"",i="invalid-auth-code"===n.verificationStatus?"border-danger":"";return(0,e.jsx)("div",{className:"h-33 flex flex-row items-center px-4 py-4",children:(0,e.jsxs)("div",{className:"flex flex-grow flex-col gap-4",children:[(0,e.jsxs)("div",{className:"flex flex-row flex-wrap items-center gap-1",children:[(0,e.jsxs)("div",{className:"text-sm",children:[(0,e.jsx)(ja,{className:"align-middle"}),(0,e.jsxs)("span",{className:"align-middle",children:["Enter your ",(0,e.jsx)("b",{children:"secret key"}),":"]})]}),(0,e.jsx)(ui.Z,{className:{container:"ml-2 w-full md:w-96 ".concat(r)},onChange:n.setInputSecretKey})]}),(0,e.jsxs)("div",{className:"flex flex-row flex-wrap items-center gap-1",children:[(0,e.jsxs)("div",{className:"text-sm",children:[(0,e.jsx)(ja,{className:"align-middle"}),(0,e.jsxs)("span",{className:"align-middle",children:["Verify the ",(0,e.jsx)("b",{children:"authentication code"})," generated by your authenticator app:"]})]}),(0,e.jsx)(ui.Z,{className:{container:"ml-2 w-full md:w-30 ".concat(i)},onChange:n.setInputOtpToken})]}),"invalid-auth-code"===n.verificationStatus&&(0,e.jsx)("div",{className:"flex-grow text-sm text-danger",children:"Incorrect authentication code, please try again."}),"invalid-secret"===n.verificationStatus&&(0,e.jsx)("div",{className:"flex-grow text-sm text-danger",children:"Incorrect secret key, please try again."})]})})})),hl=(0,Nn.Pi)((()=>(0,e.jsx)("div",{className:"flex flex-row items-center px-4 py-4",children:(0,e.jsx)("div",{className:"flex flex-row items-center justify-center pt-2",children:(0,e.jsx)(Ge.QE,{children:"Two-factor authentication has been successfully enabled for your account."})})}))),pl=(0,Nn.Pi)((t=>{let{activation:n}=t;switch(n.activationStep){case"scan-qr-code":return(0,e.jsx)(ul,{activation:n});case"save-secret-key":return(0,e.jsx)(Ta,{activation:n});case"verification":return(0,e.jsx)(dl,{activation:n});case"success":return(0,e.jsx)(hl,{activation:n})}})),fl=(0,Nn.Pi)((t=>{let{auth:n}=t;return n.isLoggedIn()?(0,e.jsx)(Ge.Dx,{children:"Two-factor authentication"}):(0,e.jsx)(Ge.Dx,{children:"Two-factor authentication not available"})})),gl=(0,Nn.Pi)((t=>{let{auth:n}=t;return n.isLoggedIn()?(0,e.jsx)(Ge.xv,{children:"An extra layer of security when logging in to your account."}):(0,e.jsx)(Ge.xv,{children:"Sign in or register for an account to configure 2FA."})})),ml=(0,Nn.Pi)((t=>{let{auth:n,canDisable2FA:r}=t;if(!n.isLoggedIn())return null;if("fetching"===n.status)return(0,e.jsx)(di.Z,{className:"h-4 w-4"});const i="two-factor-enabled"===n.status&&!r;return(0,e.jsx)(po.Z,{checked:(o=n.status,!("two-factor-disabled"===o)),onChange:n.toggle2FA,disabled:i});var o})),yl=(0,Nn.Pi)((t=>{let{auth:n,application:r,canDisable2FA:i}=t;const o="fetching"!==n.status&&Ca(n.status),s=o?"scan-qr-code"===n.status.activationStep?"Step 1 of 3 - Scan QR code":"save-secret-key"===n.status.activationStep?"Step 2 of 3 - Save secret key":"verification"===n.status.activationStep?"Step 3 of 3 - Verification":"success"===n.status.activationStep?"Successfully Enabled":"":"",a=()=>{"fetching"!==n.status&&Ca(n.status)&&("success"===n.status.activationStep&&n.status.finishActivation(),n.status.cancelActivation())},l=o?[{label:"Cancel",onClick:n.status.cancelActivation,type:"cancel",mobileSlot:"left",hidden:"scan-qr-code"!==n.status.activationStep},{label:"Back",onClick:"save-secret-key"===n.status.activationStep?n.status.openScanQRCode:n.status.openSaveSecretKey,type:"cancel",mobileSlot:"left",hidden:"save-secret-key"!==n.status.activationStep&&"verification"!==n.status.activationStep},{label:"Next",onClick:"scan-qr-code"===n.status.activationStep?n.status.openSaveSecretKey:"save-secret-key"===n.status.activationStep?n.status.openVerification:n.status.enable2FA,type:"primary",mobileSlot:"right",hidden:"success"===n.status.activationStep},{label:"Finish",onClick:n.status.finishActivation,type:"primary",mobileSlot:"right",hidden:"success"!==n.status.activationStep}]:[];return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(Ye.Z,{children:[(0,e.jsx)(ze.Z,{children:(0,e.jsxs)("div",{className:"flex flex-row gap-2 md:items-center",children:[(0,e.jsxs)("div",{className:"flex flex-grow flex-col",children:[(0,e.jsx)(fl,{auth:n}),(0,e.jsx)(gl,{auth:n})]}),(0,e.jsx)(ml,{auth:n,canDisable2FA:i})]})}),null!=n.errorMessage&&(0,e.jsx)(ze.Z,{children:(0,e.jsx)(Ge.xv,{className:"text-danger",children:n.errorMessage})}),"fetching"!==n.status&&Ea(n.status)&&(0,e.jsx)(ze.Z,{children:(0,e.jsx)("div",{className:"mt-3",children:(0,e.jsx)(Ba,{application:r})})})]}),(0,e.jsx)(Fr,{isOpen:o,close:a,children:(0,e.jsx)(Gn,{title:s,close:a,actions:l,children:o&&(0,e.jsx)(pl,{activation:n.status})})})]})})),vl=t=>{const n=t.application.isNativeMobileWeb(),[i,o]=(0,He.useState)(!1),[s,a]=(0,He.useState)(!0),[l]=(0,He.useState)((()=>new Ia(t.application.sessions,t.application.mfa,(e=>o(Ea(e))))));(0,He.useEffect)((()=>{l.fetchStatus()}),[l]);const c=t.application.features.getFeatureStatus(r.NativeFeatureIdentifier.create(r.NativeFeatureIdentifier.TYPES.UniversalSecondFactor).getValue())===r.FeatureStatus.Entitled&&void 0!==t.application.sessions.getUser();return(0,e.jsxs)(io,{children:[(0,e.jsx)(ga,{}),t.application.items.invalidNonVaultedItems.length>0&&(0,e.jsx)(Aa,{}),(0,e.jsx)(va,{application:t.application}),(0,e.jsx)(yl,{auth:l,application:t.application,canDisable2FA:s}),c&&(0,e.jsx)(Oa,{application:t.application,is2FAEnabled:i,loadAuthenticatorsCallback:e=>{a(0===e.length)}}),n&&(0,e.jsx)(wa,{application:t.application}),(0,e.jsx)(ma,{application:t.application}),n&&(0,e.jsx)(ba,{application:t.application}),t.application.sessions.getUser()&&(0,e.jsx)(ya,{application:t.application})]})},Al=t=>{let{account:n,showSeparator:r,application:i}=t;const[o,s]=(0,He.useState)(!1),[a,l]=(0,He.useState)();return(0,He.useEffect)((()=>{(async()=>{s(!0);const e=await i.listed.getListedAccountInfo(n);l(e),s(!1)})().catch(console.error)}),[n,i]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.QE,{className:"em",children:null==a?void 0:a.display_name}),(0,e.jsx)("div",{className:"mb-2"}),(0,e.jsxs)("div",{className:"flex",children:[o?(0,e.jsx)(di.Z,{className:"h-4 w-4"}):null,a&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.Qj,{className:"mr-2",label:"Open Blog",link:a.author_url}),(0,e.jsx)(Ge.Qj,{className:"mr-2",label:"Settings",link:a.settings_url})]})]}),r&&(0,e.jsx)(oo.Z,{classes:"mt-2.5 mb-3"})]})},bl=(0,Nn.Pi)((t=>{let{application:n}=t;const[i,o]=(0,He.useState)([]),[s,a]=(0,He.useState)(),l=(0,He.useCallback)((async()=>{n.hasAccount()&&o(await n.listed.getListedAccounts())}),[n]);(0,He.useEffect)((()=>{l().catch(console.error)}),[l]);const c=(0,He.useCallback)((()=>{a(!0),(async()=>{const e=await n.listed.requestNewListedAccount();if(e){const t=await n.alerts.confirm("Your new Listed blog has been successfully created! You can publish a new post to your blog from Standard Notes via the <i>Actions</i> menu in the editor pane. Open your blog settings to begin setting it up.",void 0,"Open Settings",r.ButtonType.Info,"Later");if(l().catch(console.error),t){const t=await n.listed.getListedAccountInfo(e);t&&n.device.openUrl(null==t?void 0:t.settings_url)}}a(!1)})().catch(console.error)}),[n,l]);return(0,e.jsxs)(io,{children:[i.length>0&&(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsxs)(Ge.Dx,{children:["Your ",1===i.length?"blog":"blogs"," on Listed"]}),(0,e.jsx)("div",{className:"h-2 w-full"}),i.map(((t,r,i)=>(0,e.jsx)(Al,{account:t,showSeparator:r!==i.length-1,application:n},t.authorId)))]})}),(0,e.jsxs)(Ye.Z,{children:[(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"About Listed"}),(0,e.jsx)("div",{className:"h-2 w-full"}),(0,e.jsx)(Ge.QE,{children:"What is Listed?"}),(0,e.jsxs)(Ge.xv,{children:["Listed is a free blogging platform that allows you to create a public journal published directly from your notes."," ",!n.sessions.getUser()&&"To get started, sign in or register for a Standard Notes account."]}),(0,e.jsx)("a",{className:"mt-2 text-info",target:"_blank",href:"https://listed.to",rel:"noreferrer noopener",children:"Learn more"})]}),n.sessions.getUser()&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{children:"Get Started"}),(0,e.jsx)(Ge.xv,{children:"Create a free Listed author account to get started."}),(0,e.jsx)(Ln.Z,{className:"mt-3",disabled:s,label:s?"Creating account...":"Create new author",onClick:c})]})]})]})]})})),wl=t=>{let{application:n}=t;const r=e=>{var t;n.isNativeMobileWeb()&&(e.preventDefault(),t=e.currentTarget.href,n.isNativeMobileWeb()&&n.mobileDevice.openUrl(t))};return(0,e.jsxs)(io,{children:[(0,e.jsxs)(Ye.Z,{children:[(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Frequently asked questions"}),(0,e.jsx)("div",{className:"h-2 w-full"}),(0,e.jsx)(Ge.QE,{children:"Who can read my private notes?"}),(0,e.jsxs)(Ge.xv,{children:["Quite simply: no one but you. Not us, not your ISP, not a hacker, and not a government agency. As long as you keep your password safe, and your password is reasonably strong, then you are the only person in the world with the ability to decrypt your notes. For more on how we handle your privacy and security, check out our easy to read"," ",(0,e.jsx)("a",{target:"_blank",className:"underline hover:no-underline",href:"https://standardnotes.com/privacy",onClick:r,children:"Privacy Manifesto."})]}),n.isNativeIOS()&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.Qj,{className:"mt-3",label:"Privacy Policy",link:"https://standardnotes.com/privacy",onClick:r}),(0,e.jsx)(Ge.Qj,{className:"mt-3",label:"Terms of Use",link:"https://www.apple.com/legal/internet-services/itunes/dev/stdeula/",onClick:r})]})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{children:"Can I collaborate with others on a note?"}),(0,e.jsx)(Ge.xv,{children:"Because of our encrypted architecture, Standard Notes does not currently provide a real-time collaboration solution. Multiple users can share the same account however, but editing at the same time may result in sync conflicts, which may result in the duplication of notes."})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{children:"Can I use Standard Notes totally offline?"}),(0,e.jsxs)(Ge.xv,{children:["Standard Notes can be used totally offline without an account, and without an internet connection. You can find"," ",(0,e.jsx)("a",{target:"_blank",className:"underline hover:no-underline",href:"https://standardnotes.com/help/59/can-i-use-standard-notes-totally-offline",onClick:r,children:"more details here."})]})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{children:"Can’t find your question here?"}),(0,e.jsx)(Ge.Qj,{className:"mt-3",label:"Open FAQ",link:"https://standardnotes.com/help",onClick:r})]})]}),(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Community forum"}),(0,e.jsx)(Ge.xv,{children:"If you have an issue, found a bug or want to suggest a feature, you can browse or post to the forum. It’s recommended for non-account related issues."}),(0,e.jsx)(Ge.Qj,{className:"mt-3",label:"Go to the forum",link:"https://standardnotes.com/forum",onClick:r})]})}),(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Community groups"}),(0,e.jsx)(Ge.xv,{children:"Want to meet other passionate note-takers and privacy enthusiasts? Want to share your feedback with us? Join the Standard Notes Discord for discussions on security, themes, editors and more."}),(0,e.jsx)(Ge.Qj,{className:"mt-3",link:"https://standardnotes.com/discord",label:"Join our Discord",onClick:r})]})}),(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Account related issue?"}),(0,e.jsx)(Ge.xv,{children:"Send an email to help@standardnotes.com and we’ll sort it out."}),(0,e.jsx)(Ge.Qj,{className:"mt-3",link:"mailto: help@standardnotes.com",label:"Email us",onClick:r})]})})]})},Sl=["mobile:","dev:"];function Cl(e){let t=function(e){return e.charAt(0).toUpperCase()+e.slice(1)}(e);return t=function(e){return e.replace(/\(.*\)/g,"")}(t),t}function El(e,t){const n=e.parsed[t];if(!n)return;const r=n.map(Cl).filter((e=>{return t=e,!(Sl.some((e=>t.toLowerCase().includes(e.toLowerCase())))||function(e){return 1===e.trim().split(" ").length}(e));var t}));return 0!==r.length?r:void 0}const Il=t=>{let{items:n,sectionName:r}=t;return n?(0,e.jsxs)("div",{children:[(0,e.jsx)(Ge.QE,{children:r}),(0,e.jsx)("ul",{className:"list-inside",children:n.map(((t,n)=>(0,e.jsx)("li",{children:t},n)))})]}):null},_l=n=>{let{application:i}=n;const[o,s]=(0,He.useState)(null),a=i.version,l=(0,He.useMemo)((()=>i.changelogService.getLastReadVersion()),[i]);if((0,He.useEffect)((()=>{i.changelogService.getChangelog().then(s).catch(console.error)}),[i]),(0,He.useEffect)((()=>{o&&i.changelogService.markAsRead()}),[o,i]),!o)return(0,e.jsx)("div",{className:"flex h-full w-full items-center text-center",children:(0,e.jsx)("span",{className:"w-full font-bold",children:"Loading..."})});const c=o.versions.findIndex((e=>e.version&&(El(e,"Bug Fixes")||El(e,"Features"))));return(0,e.jsx)(io,{children:o.versions.map(((n,o)=>{const s=El(n,"Bug Fixes"),u=El(n,"Features");if(!s&&!u)return null;if(!n.version)return null;const d=l&&(0,r.compareSemVersions)(n.version,l)>0,h=o===c,p=(0,t.Z$)()&&h;return(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex justify-between",children:[(0,e.jsxs)("div",{className:"flex items-start",children:[(0,e.jsx)(Ge.Dx,{className:"mb-3 flex",children:n.version}),n.version===a&&(0,e.jsx)("div",{className:"ml-2 select-none rounded bg-info px-2 py-1 text-[10px] font-bold text-info-contrast",children:"Your Version"}),h&&(0,e.jsx)("div",{className:"ml-2 select-none rounded bg-success px-2 py-1 text-[10px] font-bold text-success-contrast",children:"Latest Version"}),d&&(0,e.jsx)("div",{className:"ml-2 select-none rounded bg-success px-2 py-1 text-[10px] font-bold text-success-contrast",children:"New"})]}),p&&(0,e.jsx)(Ge.Qj,{label:"Open Downloads",link:i.changelogService.getDesktopDownloadsUrl(n.version),className:"mb-3"})]}),(0,e.jsx)(Il,{sectionName:"Features",items:u}),u&&s&&(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsx)(Il,{sectionName:"Bug Fixes",items:s})]},n.version)},n.version)}))})},xl=t=>{let{setHomeServerConfigurationChangedCallback:n,homeServerConfiguration:r}=t;const[i,o]=(0,He.useState)(r.authJwtSecret),[s,a]=(0,He.useState)(r.jwtSecret),[l,c]=(0,He.useState)(r.pseudoKeyParamsKey),[u,d]=(0,He.useState)(r.valetTokenSecret),[h,p]=(0,He.useState)(r.port),[f,g]=(0,He.useState)(!1),[m,y]=(0,He.useState)(r.logLevel);(0,He.useEffect)((()=>{const e=r.authJwtSecret!==i||r.jwtSecret!==s||r.pseudoKeyParamsKey!==l||r.valetTokenSecret!==u||r.port!==h||r.logLevel!==m;g(e)}),[r,m,i,s,l,u,h,g]);const v=(0,He.useCallback)((async()=>{r.authJwtSecret=i,r.jwtSecret=s,r.pseudoKeyParamsKey=l,r.valetTokenSecret=u,r.port=h,r.logLevel=null!=m?m:r.logLevel,n(r),g(!1)}),[n,r,m,i,s,l,u,h]);return(0,e.jsx)(Ye.Z,{children:(0,e.jsx)(ze.Z,{children:(0,e.jsxs)(ko,{title:"Advanced settings",children:[(0,e.jsx)("div",{className:"flex flex-row items-center",children:(0,e.jsxs)("div",{className:"flex max-w-full flex-grow flex-col",children:[(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{className:"mt-2",children:"Auth JWT Secret"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(ui.Z,{placeholder:"Auth JWT Secret",defaultValue:null==r?void 0:r.authJwtSecret,onChange:o})})]}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{className:"mt-2",children:"JWT Secret"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(ui.Z,{placeholder:"JWT Secret",defaultValue:null==r?void 0:r.jwtSecret,onChange:a})})]}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{className:"mt-2",children:"Encryption Server Key"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(ui.Z,{placeholder:"Encryption Server Key",defaultValue:null==r?void 0:r.encryptionServerKey,disabled:!0})})]}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{className:"mt-2",children:"Pseudo Params Key"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(ui.Z,{placeholder:"Pseudo Params Key",defaultValue:null==r?void 0:r.pseudoKeyParamsKey,onChange:c})})]}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{className:"mt-2",children:"Valet Token Secret"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(ui.Z,{placeholder:"Valet Token Secret",defaultValue:null==r?void 0:r.valetTokenSecret,onChange:d})})]}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{className:"mt-2",children:"Port"}),(0,e.jsx)("div",{className:"text-xs",children:"Changing the port will require you to sign out of all existing sessions."}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(ui.Z,{placeholder:"Port",defaultValue:null==r?void 0:r.port.toString(),onChange:e=>p(Number(e))})})]}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{className:"mt-2",children:"Log Level"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(wi.Z,{label:"Log level",items:[{label:"Error",value:"error"},{label:"Warning",value:"warn"},{label:"Info",value:"info"},{label:"Debug",value:"debug"}],value:m,onChange:y})})]})]})}),f&&(0,e.jsx)(Ln.Z,{className:"mt-3 min-w-20",primary:!0,label:"Apply & Restart",onClick:v})]})})})},Pl=t=>{let{setHomeServerConfigurationChangedCallback:n,homeServerConfiguration:r}=t;var i,o,s,a,l,c,u,d,h,p,f;const[g,m]=(0,He.useState)(!1),[y,v]=(0,He.useState)(r.databaseEngine),[A,b]=(0,He.useState)("mysql"===r.databaseEngine),[w,S]=(0,He.useState)((null===(i=r.mysqlConfiguration)||void 0===i?void 0:i.database)||""),[C,E]=(0,He.useState)((null===(o=r.mysqlConfiguration)||void 0===o?void 0:o.host)||""),[I,_]=(0,He.useState)((null===(s=r.mysqlConfiguration)||void 0===s?void 0:s.password)||""),[x,P]=(0,He.useState)((null===(a=r.mysqlConfiguration)||void 0===a?void 0:a.port)||3306),[k,B]=(0,He.useState)((null===(l=r.mysqlConfiguration)||void 0===l?void 0:l.username)||"");(0,He.useEffect)((()=>{var e,t,n,i,o;const s=r.databaseEngine!==y;b("mysql"===y);let a=!1;if("mysql"===y)return a=!!(w&&C&&I&&x&&k)&&((null===(e=r.mysqlConfiguration)||void 0===e?void 0:e.username)!==k||(null===(t=r.mysqlConfiguration)||void 0===t?void 0:t.password)!==I||(null===(n=r.mysqlConfiguration)||void 0===n?void 0:n.host)!==C||(null===(i=r.mysqlConfiguration)||void 0===i?void 0:i.port)!==x||(null===(o=r.mysqlConfiguration)||void 0===o?void 0:o.database)!==w),void m(a||s);m(s)}),[r,y,w,C,I,x,k]);const O=(0,He.useCallback)((async()=>{r.databaseEngine=y,"mysql"===y&&(r.mysqlConfiguration={username:k,password:I,host:C,port:x,database:w}),n(r),m(!1)}),[r,y,n,k,I,C,x,w]);return(0,e.jsx)(Ye.Z,{children:(0,e.jsx)(ze.Z,{children:(0,e.jsxs)(ko,{title:"Database",children:[(0,e.jsx)("div",{className:"flex flex-row items-center",children:(0,e.jsxs)("div",{className:"flex max-w-full flex-grow flex-col",children:[(0,e.jsx)(li.Z,{items:[{label:"SQLite",value:"sqlite"},{label:"MySQL",value:"mysql"}],value:y,onChange:v}),A&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"mt-2",children:["In order to connect to a MySQL database, ensure that your system has MySQL installed. For detailed instructions, visit the"," ",(0,e.jsx)("a",{className:"text-info",href:"https://dev.mysql.com/doc/mysql-installation-excerpt/8.0/en/",children:"MySQL website."})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{className:"mt-2",children:"Database Username"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(ui.Z,{placeholder:"username",defaultValue:null===(c=null==r?void 0:r.mysqlConfiguration)||void 0===c?void 0:c.username,onChange:B})})]}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{className:"mt-2",children:"Database Password"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(ui.Z,{placeholder:"password",defaultValue:null===(u=null==r?void 0:r.mysqlConfiguration)||void 0===u?void 0:u.password,onChange:_,type:"password"})})]}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{className:"mt-2",children:"Database Host"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(ui.Z,{placeholder:"host",defaultValue:null===(d=null==r?void 0:r.mysqlConfiguration)||void 0===d?void 0:d.host,onChange:E})})]}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{className:"mt-2",children:"Database Port"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(ui.Z,{placeholder:"port",defaultValue:(null===(h=null==r?void 0:r.mysqlConfiguration)||void 0===h?void 0:h.port)?null===(p=null==r?void 0:r.mysqlConfiguration)||void 0===p?void 0:p.port.toString():"",onChange:e=>P(Number(e))})})]}),(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.QE,{className:"mt-2",children:"Database Name"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(ui.Z,{placeholder:"name",defaultValue:null===(f=null==r?void 0:r.mysqlConfiguration)||void 0===f?void 0:f.database,onChange:S})})]})]})]})}),g&&(0,e.jsx)(Ln.Z,{className:"mt-3 min-w-20",primary:!0,label:"Apply & Restart",onClick:O})]})})})};var kl=s(72435);const Bl=t=>{let{status:n,className:r,homeServerService:i}=t;const o=(0,sr.I)(),[s,a]=(0,He.useState)(""),[l,c]=(0,He.useState)(""),[u,d]=(0,He.useState)("");let h,p;switch(null==n?void 0:n.state){case"online":h="bg-success text-success-contrast",p="check";break;case"error":h="bg-danger text-danger-contrast",p="warning";break;default:h="bg-contrast",p="sync"}return(0,He.useEffect)((()=>{!async function(){const e=o.sessions.getUser();e?await o.isUsingHomeServer()?(a("You are currently signed into your home server under ".concat(e.email)),d("bg-success text-success-contrast"),c("check")):(a("You are not currently signed into your home server. To use your home server, sign out of ".concat(e.email,", then sign in or register using ").concat(await i.getHomeServerUrl(),".")),d("bg-warning text-warning-contrast"),c("warning")):(a("You are not currently signed into your home server. To use your home server, sign in or register using ".concat(await i.getHomeServerUrl())),d("bg-warning text-warning-contrast"),c("warning"))}()}),[o,i,a]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"mt-2.5 flex flex-row items-center",children:[(0,e.jsx)("div",{className:"note-status-tooltip-container relative",children:(0,e.jsx)("div",{className:(0,Q.classNames)("peer flex h-5 w-5 items-center justify-center rounded-full",h,r),"aria-describedby":kl.N.NoteStatusTooltip,children:(0,e.jsx)(xn.Z,{className:"restarting"===(null==n?void 0:n.state)?"animate-spin":"",type:p,size:"small"})})}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mr-3 font-bold",children:null==n?void 0:n.message}),(0,e.jsx)("div",{className:"mr-3",children:null==n?void 0:n.description})]})]}),"restarting"!==(null==n?void 0:n.state)&&(0,e.jsxs)("div",{className:"mt-2.5 flex flex-row items-center",children:[(0,e.jsx)("div",{className:"note-status-tooltip-container relative",children:(0,e.jsx)("div",{className:(0,Q.classNames)("peer flex h-5 w-5 items-center justify-center rounded-full",u,r),"aria-describedby":kl.N.NoteStatusTooltip,children:(0,e.jsx)(xn.Z,{type:l,size:"small"})})}),(0,e.jsx)("div",{children:(0,e.jsx)("div",{className:"mr-3",children:s})})]})]})},Ol=()=>{const t=1500,n=(0,sr.I)(),i=n.homeServer,o=n.features,s=n.sessions,a=(0,He.useRef)(null),[l,c]=(0,He.useState)(!0),[u,d]=(0,He.useState)(!1),[h,p]=(0,He.useState)([]),[f,g]=(0,He.useState)(),[m,y]=(0,He.useState)(""),[v,A]=(0,He.useState)(!1),[b,w]=(0,He.useState)(!1),[S,C]=(0,He.useState)(!1),[E,I]=(0,He.useState)(null),[_,x]=(0,He.useState)(null),[P,k]=(0,He.useState)(!1),B=(0,He.useCallback)((async()=>{var t;const n=await i.getHomeServerStatus();g({state:"on"===n.status?"online":n.errorMessage?"error":"offline",message:"on"===n.status?"Online":n.errorMessage?"Offline":"Starting...",description:"on"===n.status?(0,e.jsxs)(e.Fragment,{children:["Accessible on local network at"," ",(0,e.jsx)("a",{href:n.url,className:"font-bold text-info",target:"_blank",children:n.url})]}):null!==(t=n.errorMessage)&&void 0!==t?t:"Your home server is offline."})}),[i,g]),O=(0,He.useCallback)((async()=>{if(!_){const e=await i.getHomeServerConfiguration();e&&x(e)}}),[_,i]),N=(0,He.useCallback)((async()=>{if("restarting"!==(null==f?void 0:f.state))if(P){g({state:"restarting",message:"Shutting down..."});const e=await i.disableHomeServer();if(await(0,r.sleep)(t),e.isFailed()&&await i.isHomeServerRunning())return void g({state:"error",message:e.getError()});k(await i.isHomeServerEnabled()),await B()}else g({state:"restarting",message:"Starting..."}),await i.enableHomeServer(),k(await i.isHomeServerEnabled()),await(0,r.sleep)(t),await B(),O()}),[P,i,f,B,O]),D=(0,He.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null!==E&&clearInterval(E),e&&d(!1),p([])}),[p,E]),j=(0,He.useCallback)((async()=>{D(),p(await i.getHomeServerLogs());const e=setInterval((async()=>{p(await i.getHomeServerLogs())}),5e3);I(e)}),[i,D]);(0,He.useEffect)((()=>{!async function(){const e=await i.getHomeServerDataLocation();e&&y(e)}(),async function(){k(await i.isHomeServerEnabled())}(),A(o.hasOfflineRepo()),w(s.isSignedIn()),O(),B()}),[o,s,i,B,O]);const T=(0,He.useCallback)((async e=>{try{g({state:"restarting",message:"Applying changes and restarting..."}),x(e),await i.stopHomeServer(),await(0,r.sleep)(t),await i.setHomeServerConfiguration(e),D(!0);const n=await i.startHomeServer();void 0!==n&&g({state:"error",message:n}),B()}catch(e){g({state:"error",message:e.message})}}),[i,g,x,B,D]),M=(0,He.useCallback)((async e=>{try{if(await i.stopHomeServer(),void 0===e){const t=await i.getHomeServerDataLocation(),n=await i.changeHomeServerDataLocation();if(n.isFailed())return g({state:"error",message:"".concat(n.getError(),". Restoring to initial location in a moment...")}),await(0,r.sleep)(3e3),void await M(t);e=n.getValue()}g({state:"restarting",message:"Applying changes and restarting..."}),await(0,r.sleep)(t),y(e),D(!0);const n=await i.startHomeServer();void 0!==n&&g({state:"error",message:n}),B()}catch(e){g({state:"error",message:e.message})}}),[i,g,y,B,D]),F=(0,He.useCallback)((async()=>{try{await i.openHomeServerDataLocation()}catch(e){g({state:"error",message:e.message})}}),[i]);function R(e){const{scrollHeight:t,scrollTop:n,clientHeight:r}=e;return n+r>=t}return(0,He.useLayoutEffect)((()=>{a.current&&c(R(a.current))}),[h]),(0,He.useEffect)((()=>{const e=()=>{a.current&&c(R(a.current))},t=a.current;return t&&t.addEventListener("scroll",e),()=>{t&&t.removeEventListener("scroll",e),null!==E&&clearInterval(E)}}),[E]),(0,He.useEffect)((()=>{a.current&&l&&(a.current.scrollTop=a.current.scrollHeight)}),[h,l]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"flex items-center justify-between",children:(0,e.jsxs)("div",{className:"flex items-start",children:[(0,e.jsx)(Ge.Dx,{children:"Home Server"}),(0,e.jsx)(Ge.DR,{style:"success",children:"Labs"})]})}),(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)("div",{className:"mr-10 flex flex-col",children:(0,e.jsx)(Ge.QE,{children:"Sync your data on a private cloud running on your home computer."})}),(0,e.jsx)(po.Z,{disabled:"restarting"===(null==f?void 0:f.state),onChange:N,checked:P})]}),P&&(0,e.jsxs)("div",{children:[(0,e.jsx)(Bl,{className:"mr-3",status:f,homeServerService:i}),"restarting"!==(null==f?void 0:f.state)&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.xv,{className:"mb-3",children:"Home server is enabled. All data is stored at:"}),(0,e.jsx)(uo,{status:m||"Not Set",icon:(0,e.jsx)(xn.Z,{type:"attachment-file",className:"min-h-5 min-w-5"}),checkmark:!1}),(0,e.jsxs)("div",{className:"mt-2.5 flex flex-row",children:[(0,e.jsx)(Ln.Z,{label:"Open Location",className:"mr-3 text-xs",onClick:F}),(0,e.jsx)(Ln.Z,{label:"Change Location",className:"mr-3 text-xs",onClick:()=>M()})]})]}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsx)(Ye.Z,{children:(0,e.jsx)(ze.Z,{children:(0,e.jsx)(ko,{title:"Logs",onClick:()=>{const e=!u;e?j():E&&(clearInterval(E),I(null)),d(e)},children:(0,e.jsx)("div",{className:"flex flex-row items-center",children:(0,e.jsx)("div",{className:"flex max-w-full flex-grow flex-col",children:(0,e.jsx)("textarea",{ref:a,disabled:!0,className:"h-[500px] overflow-y-auto whitespace-pre-wrap bg-contrast p-2",value:h.join("\n")})})})})})}),_&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsx)(Pl,{homeServerConfiguration:_,setHomeServerConfigurationChangedCallback:T}),(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsx)(xl,{homeServerConfiguration:_,setHomeServerConfigurationChangedCallback:T})]}),b&&!v&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(oo.Z,{classes:"my-4"}),(0,e.jsxs)("div",{className:"mt-2 grid grid-cols-1 rounded-md border border-border p-4",children:[(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)(xn.Z,{className:(0,r.classNames)("-ml-1 mr-1 h-5 w-5",Mn.K),type:Mn._}),(0,e.jsx)("h1",{className:"sk-h3 m-0 text-sm font-semibold",children:"Activate Premium Features"})]}),(0,e.jsx)("p",{className:"col-start-1 col-end-3 m-0 mt-1 text-sm",children:"Enter your purchased offline subscription code to activate all the features offered by your home server, likes files support and Super notes."}),(0,e.jsx)(Ln.Z,{primary:!0,small:!0,className:"col-start-1 col-end-3 mt-3 justify-self-start uppercase",onClick:()=>{C(!S)},children:S?"Close":"Activate Premium Features"}),S&&(0,e.jsx)(xo,{application:n,onSuccess:()=>{A(!0),C(!1)}})]})]})]})]})]})},Nl=()=>(0,e.jsxs)(io,{children:[(0,e.jsx)(Ye.Z,{children:(0,e.jsx)(ze.Z,{children:(0,e.jsx)(Ol,{})})}),(0,e.jsxs)(Ye.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Remote access"}),(0,e.jsx)(Ge.QE,{children:"Accessing your home server while on the go is easy and secure with Tailscale."}),(0,e.jsxs)("ol",{className:"ml-3 mt-3 list-outside list-decimal",children:[(0,e.jsxs)("li",{children:["Register on"," ",(0,e.jsx)("a",{className:"text-info",href:"https://tailscale.com/",children:"Tailscale.com"})," ","for free."]}),(0,e.jsx)("li",{className:"mt-2",children:"Download Tailscale on this computer and complete the Tailscale setup wizard until you are presented with the IP address of your computer. It should start with something like 100.xxx..."}),(0,e.jsx)("li",{className:"mt-2",children:"Download Tailscale on your mobile device and sign into your Tailscale account."}),(0,e.jsx)("li",{className:"mt-2",children:"Activate the Tailscale VPN on your mobile device."}),(0,e.jsx)("li",{className:"mt-2",children:"Open Standard Notes on your mobile device and sign into your home server by specifying the sync server URL during sign in. The URL will be the Tailscale-based IP address of this computer, followed by the port number of your home server. For example, if your computer Tailscale IP address is 100.112.45.106 and your home server is running on port 3127, your sync server URL will be http://100.112.45.106:3127."})]})]}),(0,e.jsxs)(Ye.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Backing up your data"}),(0,e.jsx)(Ge.QE,{children:"For automatic backups, you can place your server's data inside of a synced cloud folder, like Dropbox, Tresorit, or iCloud Drive."}),(0,e.jsxs)("ol",{className:"ml-3 mt-3 list-outside list-decimal",children:[(0,e.jsx)("li",{children:'Change your server\'s data location by selecting "Change Location" in the Home Server section above.'}),(0,e.jsx)("li",{className:"mt-2",children:"Select a cloud drive to store your server's data in."}),(0,e.jsx)("li",{className:"mt-2",children:"Restart your home server."})]}),(0,e.jsx)(Ge.xv,{className:"mt-3",children:"Your Standard Notes data is always end-to-end encrypted on disk, so your cloud provider will not be able to read your notes or files."})]})]}),Dl=t=>{let{onCloseDialog:n,fromInvite:i,onAddContact:o,editContactUuid:s}=t;const a=(0,sr.I)(),[l,c]=(0,He.useState)(""),[u,d]=(0,He.useState)(""),[h,p]=(0,He.useState)(void 0),f=(0,He.useCallback)((()=>{n()}),[n]);(0,He.useEffect)((()=>{i&&d(a.contacts.getCollaborationIDFromInvite(i.invite))}),[a.contacts,i]),(0,He.useEffect)((()=>{if(s){const e=a.contacts.findContact(s);if(!e)throw new Error("Contact with uuid ".concat(s," not found"));p(e),c(e.name),d(a.contacts.getCollaborationIDForTrustedContact(e))}}),[a.contacts,a.vaults,s]);const g=(0,He.useCallback)((async()=>{if(h)a.contacts.editTrustedContactFromCollaborationID(h,{name:l,collaborationID:u}),f();else try{const e=await a.contacts.addTrustedContactFromCollaborationID(u,l);e?(null==o||o(e),f()):a.alerts.alert("Unable to create contact. Please try again.")}catch(e){e instanceof r.ClientDisplayableError&&a.alerts.showErrorAlert(e).catch(console.error),console.error(e)}}),[h,a.contacts,a.alerts,l,u,f,o]),m=(0,He.useMemo)((()=>[{label:s?"Save Contact":"Add Contact",onClick:g,type:"primary",mobileSlot:"right"},{label:"Cancel",onClick:f,type:"cancel",mobileSlot:"left"}]),[s,f,g]),y=(0,He.useCallback)((e=>{e&&setTimeout((()=>{e.focus()}))}),[]);return(0,e.jsx)(Gn,{title:s?"Edit Contact":"Add New Contact",close:f,actions:m,children:(0,e.jsxs)("div",{className:"mb-3 flex w-full flex-col gap-4 px-4.5 pb-1.5 pt-4",children:[(0,e.jsxs)("label",{children:[(0,e.jsx)("div",{className:"mb-1",children:"Contact Name"}),(0,e.jsx)(ui.Z,{id:"invite-name-input",value:l,onChange:e=>{c(e)},ref:y,onEnter:g})]}),!(null==h?void 0:h.isMe)&&(0,e.jsxs)("label",{children:[(0,e.jsx)("div",{className:"mb-1",children:"CollaborationID"}),(0,e.jsx)(ui.Z,{id:"invite-email-input",value:u,onChange:e=>{d(e)},onEnter:g})]}),!s&&(0,e.jsx)("p",{children:"Ask your contact for their Standard Notes CollaborationID via secure email or chat. Then, enter it here to add them as a contact."})]})})};var jl=s(96332);const Tl=t=>{let{contact:n}=t;const i=(0,sr.I)(),[o,s]=(0,He.useState)(!1),a=()=>s(!1),l=i.contacts.getCollaborationIDForTrustedContact(n),c=(0,He.useCallback)((async()=>{if(await i.alerts.confirm("Are you sure you want to delete this contact?")){const e=await i.contacts.deleteContact(n);e.isFailed()&&i.alerts.alertV2({text:e.getError()}).catch(console.error)}}),[i.alerts,i.contacts,n]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Fr,{isOpen:o,close:a,children:(0,e.jsx)(Dl,{editContactUuid:n.contactUuid,onCloseDialog:a})}),(0,e.jsxs)("div",{className:"flex items-start gap-3.5 rounded-lg border border-border px-3.5 py-2.5 shadow-sm",children:[(0,e.jsxs)("div",{className:"grid grid-cols-[1fr,auto] grid-rows-2 place-items-center gap-x-3.5 gap-y-1 overflow-hidden",children:[(0,e.jsx)(xn.Z,{type:"user",size:"custom",className:"h-5 w-5 flex-shrink-0"}),(0,e.jsx)("span",{className:(0,r.classNames)("w-full overflow-hidden text-ellipsis text-base font-bold",n.isMe?"text-info":""),children:n.name}),(0,e.jsx)("span",{className:"col-start-2 w-full overflow-hidden text-ellipsis text-sm brightness-75",children:l})]}),(0,e.jsxs)("div",{className:"flex gap-3",children:[(0,e.jsx)($r.Z,{label:"Edit contact",children:(0,e.jsxs)(Ln.Z,{className:"!px-2 py-2",onClick:()=>s(!0),children:[(0,e.jsx)(jl.T,{children:"Edit"}),(0,e.jsx)(xn.Z,{type:"pencil-filled",size:"medium"})]})}),!n.isMe&&(0,e.jsx)($r.Z,{label:"Delete contact",children:(0,e.jsxs)(Ln.Z,{className:"!px-2 py-2",onClick:c,children:[(0,e.jsx)(jl.T,{children:"Delete"}),(0,e.jsx)(xn.Z,{type:"trash-filled",className:"text-danger",size:"medium"})]})})]})]})]})};function Ml(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ml(Object(n),!0).forEach((function(t){Rl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ml(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Rl(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ll=t=>{let{vault:n,onCloseDialog:i}=t;const o=(0,sr.I)(),[s,a]=(0,He.useState)([]),[l,c]=(0,He.useState)(!1),[u,d]=(0,He.useState)([]),[h,p]=(0,He.useState)(!1);(0,He.useEffect)((()=>{(async()=>{c(!0);const e=await o.vaultInvites.getInvitableContactsForSharedVault(n);d(e),c(!1)})()}),[o.vaultInvites,n]);const f=(0,He.useCallback)((()=>{i()}),[i]),g=(0,He.useCallback)((async()=>{p(!0);for(const e of s){const t=u.find((t=>t.uuid===e.uuid));t&&await o.vaultInvites.inviteContactToSharedVault(n,t,r.SharedVaultUserPermission.PERMISSIONS[e.permission])}p(!1),f()}),[f,s,u,o.vaultInvites,n]),m=(0,He.useCallback)((e=>{const t={uuid:e.uuid,permission:"Read"};a((n=>n.find((t=>t.uuid===e.uuid))?n.filter((t=>t.uuid!==e.uuid)):[...n,t]))}),[a]),y=(0,He.useMemo)((()=>[{label:h?(0,e.jsx)(di.Z,{className:"h-5 w-5 border-info-contrast"}):"Invite Selected Contacts",onClick:g,type:"primary",mobileSlot:"right",disabled:h,hidden:0===u.length},{label:"Cancel",onClick:f,type:"cancel",mobileSlot:"left"}]),[u.length,f,g,h]);return(0,e.jsx)(Gn,{title:"Add New Contact",close:f,actions:y,children:(0,e.jsx)("div",{className:(0,r.classNames)("flex w-full flex-col gap-3 px-4.5 py-4",l&&"items-center"),children:l?(0,e.jsx)(di.Z,{className:"h-5 w-5"}):u.length>0?u.map((t=>{const n=s.find((e=>e.uuid===t.uuid)),i=!!n;return(0,e.jsxs)("div",{className:(0,r.classNames)("grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",i&&"py-0.5"),children:[(0,e.jsx)("input",{id:t.uuid,className:"h-4 w-4 self-center accent-info",type:"checkbox",checked:i,onChange:()=>m(t)}),(0,e.jsxs)("label",{htmlFor:t.uuid,className:"col-start-2",children:[(0,e.jsx)("div",{className:"text-sm font-semibold",children:t.name}),(0,e.jsx)("div",{className:"opacity-90",children:t.contactUuid})]}),i&&(0,e.jsx)(wi.Z,{showLabel:!0,label:"Permission:",classNameOverride:{wrapper:"col-start-2"},items:Object.keys(r.SharedVaultUserPermission.PERMISSIONS).map((e=>({label:o.vaultUsers.getFormattedMemberPermission(e.toLowerCase()),value:e}))),value:n.permission,onChange:e=>{a((n=>n.map((n=>n.uuid===t.uuid?Fl(Fl({},n),{},{permission:e}):n))))}})]},t.uuid)})):(0,e.jsx)("div",{className:"text-sm",children:"No contacts available to invite."})})})},Ql=t=>{let{vault:n}=t;var i,o,s;const a=(0,sr.I)(),l=a.hasAccount()&&a.featuresController.isEntitledToSharedVaults(),[c,u]=(0,He.useState)(!1),d=()=>u(!1),[h,p]=(0,He.useState)(!1),{isCurrentUserAdmin:f,isCurrentUserOwner:g,isLocked:m,canShowLockOption:y,toggleLock:v,ensureVaultIsUnlocked:A}=Bi(n),b=(0,He.useCallback)((async()=>{if(await a.alerts.confirm("Deleting a vault will permanently delete all its items and files.","Are you sure you want to delete this vault?",void 0,r.ButtonType.Danger)&&(await a.vaults.authorizeVaultDeletion(n)).getValue())if(n.isSharedVaultListing()){const e=await a.sharedVaults.deleteSharedVault(n);(0,r.isClientDisplayableError)(e)&&a.alerts.showErrorAlert(e)}else await a.vaults.deleteVault(n)||a.alerts.alert("Unable to delete vault. Please try again.")}),[a.alerts,a.sharedVaults,a.vaults,n]),w=(0,He.useCallback)((async()=>{if(!n.isSharedVaultListing())return;if(!await a.alerts.confirm("All items and files in this vault will be removed from your account.","Are you sure you want to leave this vault?",void 0,r.ButtonType.Danger))return;const e=await a.vaultUsers.leaveSharedVault(n);(0,r.isClientDisplayableError)(e)&&(a.alerts.alert("Unable to leave vault. Please try again."),console.error(e))}),[a,n]),S=(0,He.useCallback)((async()=>{await a.sharedVaults.convertVaultToSharedVault(n)}),[a.sharedVaults,n]),C=(0,He.useCallback)((async()=>{await A()&&p(!0)}),[A]),E=(0,He.useCallback)((async()=>{await A()&&u(!0)}),[A]);return(0,e.jsxs)(e.Fragment,{children:[n.isSharedVaultListing()&&(0,e.jsx)(Fr,{isOpen:c,close:d,children:(0,e.jsx)(Ll,{vault:n,onCloseDialog:d})}),(0,e.jsx)(ki,{vault:n,isVaultModalOpen:h,closeVaultModal:()=>p(!1)}),(0,e.jsxs)("div",{className:"flex flex-row gap-3.5 rounded-lg border border-border px-3.5 py-2.5 shadow-sm",children:[(0,e.jsx)(xn.Z,{type:n.iconString,size:"custom",className:"mt-2.5 h-5.5 w-5.5 flex-shrink-0"}),(0,e.jsxs)("div",{className:"flex flex-col gap-1.5 py-1.5",children:[(0,e.jsx)("span",{className:"overflow-hidden text-ellipsis text-base font-bold",children:n.name}),n.description&&(0,e.jsx)("span",{className:"overflow-hidden text-ellipsis text-sm",children:n.description}),(0,e.jsxs)("span",{className:"overflow-hidden text-ellipsis text-sm",children:["Vault ID: ",n.systemIdentifier]}),!!(null===(i=n.sharing)||void 0===i?void 0:i.fileBytesUsed)&&(0,e.jsxs)("span",{className:"overflow-hidden text-ellipsis text-sm",children:["File storage used: ",(0,co.vU)(null!==(s=null===(o=n.sharing)||void 0===o?void 0:o.fileBytesUsed)&&void 0!==s?s:0)]}),(0,e.jsxs)("div",{className:"mt-2 flex w-full flex-wrap gap-3",children:[(0,e.jsx)(Ln.Z,{label:"Edit",onClick:C}),y&&(0,e.jsx)(Ln.Z,{label:m?"Unlock":"Lock",onClick:v}),g&&(0,e.jsx)(Ln.Z,{colorStyle:"danger",label:"Delete",onClick:b}),!g&&n.isSharedVaultListing()&&(0,e.jsx)(Ln.Z,{label:"Leave Vault",onClick:w}),f?n.isSharedVaultListing()?(0,e.jsx)(Ln.Z,{colorStyle:"info",label:"Invite Contacts",onClick:E}):l?(0,e.jsx)(Ln.Z,{colorStyle:"info",label:"Enable Collaboration",onClick:S}):null:null]})]})]})]})},Ul=t=>{let{inviteRecord:n}=t;const r=(0,sr.I)(),[i,o]=(0,He.useState)(!1),s=n.trusted,a=n.message.data,l=(0,He.useCallback)((()=>{o(!0)}),[]),c=(0,He.useCallback)((async()=>{const e=await r.vaultInvites.acceptInvite(n);e.isFailed()&&await r.alerts.alert(e.getError())}),[r,n]),u=()=>o(!1),d=r.contacts.getCollaborationIDFromInvite(n.invite),h=r.contacts.findSenderContactForInvite(n.invite),p=r.vaultUsers.getFormattedMemberPermission(n.invite.permission);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Fr,{isOpen:i,close:u,children:(0,e.jsx)(Dl,{fromInvite:n,onCloseDialog:u})}),(0,e.jsxs)("div",{className:"flex gap-3.5 rounded-lg border border-border px-3.5 py-2.5 shadow",children:[(0,e.jsx)(xn.Z,{type:"archive",size:"custom",className:"mt-1.5 h-5.5 w-5.5 flex-shrink-0"}),(0,e.jsxs)("div",{className:"flex flex-col gap-2 overflow-hidden py-1.5",children:[(0,e.jsxs)("div",{className:"overflow-hidden text-ellipsis text-sm",children:["Vault Name: ",a.metadata.name]}),a.metadata.description&&(0,e.jsxs)("div",{className:"overflow-hidden text-ellipsis text-sm",children:["Vault Description: ",a.metadata.description]}),h?(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsxs)("span",{className:"overflow-hidden text-ellipsis text-sm",children:["Trusted Sender: ",h.name]}),(0,e.jsx)(Os,{className:"!h-4 !w-4"})]}):(0,e.jsxs)("div",{className:"w-full overflow-hidden whitespace-pre-wrap break-words text-sm",children:["Sender CollaborationID: ",(0,e.jsx)("span",{className:"font-mono text-xs",children:d})]}),(0,e.jsxs)("div",{className:"overflow-hidden text-ellipsis text-sm",children:["Permission: ",p]}),(0,e.jsx)("div",{className:"",children:s?(0,e.jsx)(Ln.Z,{label:"Accept Invite",className:"text-xs",onClick:c}):(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{children:"The sender of this invite is not trusted. To accept this invite, first add the sender as a trusted contact."}),(0,e.jsx)(Ln.Z,{label:"Add Trusted Contact",className:"mr-3 mt-2 text-xs",onClick:l})]})})]})]})]})},Vl=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),n=t.hasAccount(),i=t.featuresController.isEntitledToSharedVaults(),[o,s]=(0,He.useState)([]),[a,l]=(0,He.useState)(!0),[c,u]=(0,He.useState)([]),[d,h]=(0,He.useState)([]),[p,f]=(0,He.useState)(!1),g=()=>f(!1),[m,y]=(0,He.useState)(!1),[v,A]=(0,He.useState)(!1),b=t.vaults,w=t.contacts,S=t.features,C=(0,He.useCallback)((async()=>{const e=b.getVaults(),n=e.filter((e=>!e.isSharedVaultListing()||t.vaultUsers.isCurrentUserSharedVaultOwner(e)));S.hasMinimumRole(r.RoleName.NAMES.ProUser)?l(!0):S.hasMinimumRole(r.RoleName.NAMES.PlusUser)?l(n.length<3):l(n.length<1),s(e)}),[b,S,t.vaultUsers]),E=(0,He.useCallback)((async()=>{u(t.vaultInvites.getCachedPendingInviteRecords())}),[t.vaultInvites]);(0,He.useEffect)((()=>t.vaultInvites.addEventObserver((e=>{e===r.VaultInviteServiceEvent.InvitesReloaded&&E()}))),[t.vaultInvites,E]);const I=(0,He.useCallback)((async()=>{h(w.getAllContacts())}),[w]),_=(0,He.useCallback)((async()=>{await Promise.all([C(),E(),I()])}),[I,E,C]);(0,He.useEffect)((()=>t.sharedVaults.addEventObserver((e=>{e===r.SharedVaultServiceEvent.SharedVaultStatusChanged&&_()}))),[t.sharedVaults,_]),(0,He.useEffect)((()=>t.sharedVaults.addEventObserver((e=>{e===r.SharedVaultServiceEvent.SharedVaultFileStorageUsageChanged&&_()}))),[t.sharedVaults,_]),(0,He.useEffect)((()=>t.vaultUsers.addEventObserver((e=>{e===r.VaultUserServiceEvent.UsersChanged&&_()}))),[t.vaultUsers,_]),(0,He.useEffect)((()=>t.vaultInvites.addEventObserver((()=>{_()}))),[t.vaultInvites,_]),(0,He.useEffect)((()=>t.items.streamItems([r.ContentType.TYPES.VaultListing,r.ContentType.TYPES.TrustedContact],(()=>{_()}))),[t,_]),(0,He.useEffect)((()=>{t.vaultInvites.downloadInboundInvites(),_()}),[_,t.vaultInvites]);const x=(0,He.useCallback)((async()=>{A(!0)}),[]),P=(0,He.useCallback)((async()=>{y(!0),A(!0)}),[]),k=(0,He.useCallback)((()=>{f(!0)}),[]);return(0,e.jsxs)(io,{children:[(0,e.jsx)(Fr,{isOpen:p,close:g,children:(0,e.jsx)(Dl,{onCloseDialog:g})}),(0,e.jsx)(ki,{isVaultModalOpen:v,creatingSharedVault:m,closeVaultModal:()=>{A(!1),y(!1)}}),c.length>0&&(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Incoming Invites"}),(0,e.jsx)("div",{className:"my-2 flex flex-col gap-3.5",children:c.map((t=>(0,e.jsx)(Ul,{inviteRecord:t},t.invite.uuid)))})]})}),n&&i&&(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Contacts"}),d.length>0&&(0,e.jsx)("div",{className:"my-2 flex flex-col gap-3.5",children:d.map((t=>(0,e.jsx)(Tl,{contact:t},t.uuid)))}),(0,e.jsx)("div",{className:"mt-2.5 flex flex-row",children:(0,e.jsx)(Ln.Z,{label:"Add New Contact",className:"mr-3",onClick:k})})]})}),n&&i&&(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"CollaborationID"}),(0,e.jsx)(Ge.QE,{children:"Share your CollaborationID with collaborators to join their vaults."}),w.isCollaborationEnabled()?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("code",{className:"mt-2.5 overflow-hidden whitespace-pre-wrap break-words rounded border border-border bg-contrast p-3",children:w.getCollaborationID()}),(0,e.jsx)(Ln.Z,{label:"Copy ID",className:"mt-2",onClick:async()=>{try{await navigator.clipboard.writeText(w.getCollaborationID()),(0,Y.fz)({type:Y.pC.Success,message:"Copied to clipboard"})}catch(e){(0,Y.fz)({type:Y.pC.Error,message:"Failed to copy to clipboard"}),console.error(e)}}})]}):(0,e.jsx)("div",{className:"mt-2.5 flex flex-row",children:(0,e.jsx)(Ln.Z,{label:"Enable Vault Sharing",className:"mr-3 text-xs",onClick:()=>w.enableCollaboration()})})]})}),(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Vaults"}),o.length>0&&(0,e.jsx)("div",{className:"my-2 flex flex-col gap-3.5",children:o.map((t=>(0,e.jsx)(Ql,{vault:t},t.uuid)))}),a?(0,e.jsxs)("div",{className:"mt-2.5 flex gap-3",children:[(0,e.jsx)(Ln.Z,{label:"Create Vault",onClick:x}),n&&i&&(0,e.jsx)(Ln.Z,{label:"Create Shared Vault",onClick:P})]}):(0,e.jsx)("div",{className:"mt-3.5",children:(0,e.jsx)(ta,{application:t,text:(0,e.jsx)("span",{children:"Please upgrade in order to increase your vault limit."})})})]})})]})})),Kl=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),n=t.hasAccount(),i=t.getUserVersion(),o=i&&(0,r.compareVersions)(i,r.ProtocolVersion.V004)<0;return n&&o?(0,e.jsx)(io,{children:(0,e.jsxs)(Ye.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Account update required"}),(0,e.jsx)(Ge.QE,{children:"In order to use Vaults, you must update your account to use the latest data encryption version."}),(0,e.jsx)(Ln.Z,{primary:!0,className:"mt-3",onClick:()=>t.upgradeProtocolVersion().catch(console.error),children:"Update Account"})]})}):(0,e.jsx)(Vl,{})})),Hl=t=>{let{plugin:n,callback:i}=t,o=null;const s=r.ContentType.create(n.content_type);s.isFailed()||(o=s.getValue().getDisplayName());const a=[{label:"Name",value:n.name},{label:"Description",value:n.description},{label:"Version",value:n.version},{label:"Hosted URL",value:n.url},{label:"Download URL",value:n.download_url},{label:"Extension Type",value:o}];return(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Confirm Extension"}),a.map((t=>{if(t.value)return(0,e.jsxs)(He.Fragment,{children:[(0,e.jsx)(Ge.QE,{children:t.label}),(0,e.jsx)(Ge.xv,{className:"wrap mb-2",children:t.value})]},t.value)})),(0,e.jsxs)("div",{className:"mt-3 flex flex-row",children:[(0,e.jsx)(Ln.Z,{className:"min-w-20",label:"Cancel",onClick:()=>i(!1)}),(0,e.jsx)("div",{className:"min-w-3"}),(0,e.jsx)(Ln.Z,{className:"min-w-20",label:"Install",onClick:()=>i(!0)})]})]})},Gl=(0,Nn.Pi)((t=>{let{className:n=""}=t;const r=(0,sr.I)(),[i,o]=(0,He.useState)(""),[s,a]=(0,He.useState)(void 0),l=(0,He.useRef)(null);return(0,He.useEffect)((()=>{var e;s&&(null===(e=l.current)||void 0===e||e.scrollIntoView({behavior:"smooth"}))}),[s,l]),(0,e.jsx)("div",{className:n,children:(0,e.jsxs)("div",{children:[!s&&(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)("div",{children:(0,e.jsx)(ui.Z,{placeholder:"Enter Plugin URL",value:i,onChange:e=>{o(e)}})}),(0,e.jsx)(Ln.Z,{hidden:0===i.length,disabled:0===i.length,className:"mt-4 min-w-20",primary:!0,label:"Install",onClick:()=>(async e=>{const t=await r.pluginsService.getPluginDetailsFromUrl(e);t&&a(t)})(i)})]}),s&&(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Hl,{plugin:s,callback:async e=>{e&&s&&await r.pluginsService.installExternalPlugin(s),a(void 0),o("")}}),(0,e.jsx)("div",{ref:l})]})]})})})),Yl=t=>{let{plugin:n}=t;const i=(0,sr.I)(),o=(0,He.useCallback)((async()=>{const e=await i.pluginsService.installPlugin(n);e?i.alerts.alertV2({text:"".concat(e.name," has been successfully installed.")}):i.alerts.alertV2({text:"Failed to install plugin"})}),[i,n]),s=n.content_type===r.ContentType.TYPES.Theme?"theme":"note type",a=i.hasValidFirstPartySubscription();return(0,e.jsxs)("div",{className:"align-center my-2.5 flex items-center justify-between md:items-center",children:[(0,e.jsxs)("div",{className:"mr-5",children:[(0,e.jsx)(Ge.QE,{className:"mb-0 text-info",children:n.name}),(0,e.jsxs)(Ge.KI,{className:"mb-1",children:["A ",(0,e.jsx)("strong",{children:s})," by ",n.publisher]}),n.description&&(0,e.jsx)(Ge.KI,{className:"text-neutral",children:n.description})]}),(0,e.jsx)(Ln.Z,{disabled:!a,small:!0,className:"cursor-pointer",onClick:o,children:"Install"})]})},zl=()=>{const t=(0,He.useRef)(null),n=(0,sr.I)(),r=n.hasValidFirstPartySubscription();return(0,e.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 top-0 flex flex-col items-center justify-center",children:[(0,e.jsx)("div",{className:"absolute h-full w-full bg-default opacity-[86%]"}),(0,e.jsx)("div",{className:"border-1 z-10 rounded border border-border bg-default p-5",children:(0,e.jsx)(Fn,{featureName:"Plugin Gallery",ctaRef:t,application:n,hasSubscription:r,inline:!0,onClick:()=>{n.preferencesController.closePreferences()}})})]})},Zl=((0,Nn.Pi)(zl),(0,Nn.Pi)((()=>{const t=(0,sr.I)(),[n,i]=(0,He.useState)(null),o=(0,He.useCallback)((()=>{t.pluginsService.getInstallablePlugins().then(i).catch(console.error)}),[t]);(0,He.useEffect)((()=>{o()}),[o]),(0,He.useEffect)((()=>{t.items.streamItems([r.ContentType.TYPES.Component,r.ContentType.TYPES.Theme],o)}),[t,o]);const s=t.hasValidFirstPartySubscription();return(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Browse Plugins"}),(0,e.jsxs)(Ge.xv,{className:"text-neutral",children:["Plugins run in a secure sandbox and can only access data you allow it. Note types allow specialized editing experiences, but in most cases, the ",(0,e.jsx)("strong",{children:"built-in Super note type"})," can encapsulate any functionality found in plugins."]}),!n&&(0,e.jsx)("div",{className:"mb-3 mt-5 flex h-full w-full items-center",children:(0,e.jsx)("span",{className:"w-full font-bold",children:"Loading..."})}),(0,e.jsx)("div",{className:"mt-2",children:null==n?void 0:n.map(((t,r)=>(0,e.jsxs)("div",{children:[(0,e.jsx)(Yl,{plugin:t}),r<n.length-1&&(0,e.jsx)(oo.Z,{})]},t.name)))})]}),(0,e.jsx)(oo.Z,{}),(0,e.jsx)(Ge.xv,{className:"mt-4 text-danger",children:"Plugins may not be actively maintained. Standard Notes cannot attest to the quality or user experience of these plugins, and is not responsible for any data loss that may arise from their use."}),!s&&(0,e.jsx)(zl,{})]})}))),Wl=t=>{let{plugin:n}=t;const i=(0,sr.I)(),o="identifier"in n&&i.features.isThirdPartyFeature(n.identifier),[s,a]=(0,He.useState)(!1),[l,c]=(0,He.useState)(n.name),u=o,d=(0,He.useRef)(null);(0,He.useEffect)((()=>{var e;s&&(null===(e=d.current)||void 0===e||e.focus())}),[d,s]);const[h,p]=(0,He.useState)(n.displayName);return(0,e.jsxs)("div",{className:"align-center my-2.5 flex items-center justify-between md:items-center",children:[(0,e.jsx)("input",{ref:d,disabled:!s||!u,autoComplete:"off",className:"no-border mr-2 flex-grow rounded-sm bg-default px-0 py-1 text-sm font-bold text-text",type:"text",value:l,onChange:e=>{let{target:t}=e;return c(null==t?void 0:t.value)}}),s&&(0,e.jsxs)("div",{className:"flex gap-1",children:[(0,e.jsx)(Ln.Z,{small:!0,className:"cursor-pointer",onClick:()=>{var e;l&&(p(e=l),i.changeAndSaveItem.execute(n,(t=>{t.name=e})).then((e=>{const t=e.getValue();p(t.name)})).catch(console.error),a(!1))},children:"Confirm"}),(0,e.jsx)(Ln.Z,{small:!0,className:"cursor-pointer",onClick:()=>{c(n.name),a(!1)},children:"Cancel"})]}),!s&&(0,e.jsxs)("div",{className:"flex flex-row flex-wrap justify-end gap-2",children:[u&&!s&&(0,e.jsx)(Ln.Z,{small:!0,className:"cursor-pointer",onClick:()=>{c(n.name),a(!0)},children:"Rename"}),(0,e.jsx)(Ln.Z,{small:!0,className:"min-w-20",label:"Uninstall",onClick:async()=>{i.alerts.confirm("Are you sure you want to uninstall this plugin?","Uninstall Plugin?","Uninstall",r.ButtonType.Danger,"Cancel").then((async e=>{e&&(await i.mutator.deleteItem(n),i.sync.sync())})).catch((e=>{i.alerts.alert(e).catch(console.error)}))}})]})]})},ql=t=>{let{plugin:n}=t;return(0,e.jsx)(ze.Z,{children:(0,e.jsx)(Wl,{plugin:n})})},Jl=(0,Nn.Pi)((t=>{let{pluginsLatestVersions:n,className:i=""}=t;const o=(0,sr.I)(),[s,a]=(0,He.useState)((e=>e.items.getItems([r.ContentType.TYPES.ActionsExtension,r.ContentType.TYPES.Component,r.ContentType.TYPES.Theme]))(o)),l=(0,He.useCallback)((()=>{const e=o.items.getItems([r.ContentType.TYPES.ActionsExtension,r.ContentType.TYPES.Component,r.ContentType.TYPES.Theme]);a(e)}),[o.items]);(0,He.useEffect)((()=>{o.items.streamItems([r.ContentType.TYPES.Component,r.ContentType.TYPES.Theme,r.ContentType.TYPES.ActionsExtension],l)}),[o,l]);const c=s.filter((e=>!(null==e.package_info)));return(0,e.jsxs)("div",{className:i,children:[0===c.length&&(0,e.jsx)("div",{className:"text-neutral",children:"No plugins installed."}),c.length>0&&(0,e.jsx)("div",{className:"divide-y divide-border",children:c.sort(((e,t)=>{var n,r;return null===(n=e.displayName)||void 0===n?void 0:n.toLowerCase().localeCompare(null===(r=t.displayName)||void 0===r?void 0:r.toLowerCase())})).map((t=>(0,e.jsx)(ql,{plugin:t,latestVersion:n.getVersion(t)},t.uuid)))})]})})),Xl=(0,Nn.Pi)((t=>{let{pluginsLatestVersions:n}=t;return(0,e.jsxs)(io,{children:[(0,e.jsx)(Ye.Z,{children:(0,e.jsx)(ze.Z,{children:(0,e.jsx)(Zl,{})})}),(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Manage Plugins"}),(0,e.jsx)(Jl,{className:"mt-3",pluginsLatestVersions:n})]})}),(0,e.jsx)(Ye.Z,{children:(0,e.jsxs)(ze.Z,{children:[(0,e.jsx)(Ge.Dx,{children:"Install Custom Plugin"}),(0,e.jsx)(Gl,{className:"mt-3"})]})})]})})),$l=(0,Nn.Pi)((t=>{let{menu:n,application:r}=t;switch(n.selectedPaneId){case"general":default:return(0,e.jsx)(Ss,{});case"account":return(0,e.jsx)(ha,{application:r});case"appearance":return(0,e.jsx)(So,{application:r});case"home-server":return(0,e.jsx)(Nl,{});case"security":return(0,e.jsx)(vl,{application:r});case"vaults":return(0,e.jsx)(Kl,{});case"backups":return(0,e.jsx)(bo,{application:r});case"listed":return(0,e.jsx)(bl,{application:r});case"shortcuts":case"accessibility":case"get-free-month":return null;case"plugins":return(0,e.jsx)(Xl,{pluginsLatestVersions:n.extensionsLatestVersions});case"help-feedback":return(0,e.jsx)(wl,{application:r});case"whats-new":return(0,e.jsx)(_l,{application:r})}}));function ec(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ec(Object(n),!0).forEach((function(t){nc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ec(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function nc(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const rc=(0,Nn.Pi)((t=>(0,e.jsxs)("div",{className:"flex min-h-0 flex-grow flex-col md:flex-row md:justify-between",children:[(0,e.jsx)(ro,{menu:t.menu}),(0,e.jsx)("div",{className:"min-h-0 flex-grow overflow-auto bg-[--preferences-background-color]",tabIndex:pt.HF,children:(0,e.jsx)($l,tc({},t))})]}))),ic=(0,Nn.Pi)((t=>{let{application:n,closePreferences:i}=t;const o=(0,He.useMemo)((()=>new eo(n,n.enableUnfinishedFeatures)),[n]);(0,He.useEffect)((()=>{o.selectPane(n.preferencesController.currentPane)}),[o,n.preferencesController.currentPane]);const s=(0,et.ac)(et.Jj.sm),a=(0,Kn.x)();(0,He.useEffect)((()=>{const e=a((()=>(i(),!0)));return()=>{e&&e()}}),[a,i]);const{hasTopInset:l}=Rn(),c=(0,He.useMemo)((()=>[{label:(0,e.jsxs)("span",{className:"flex items-center",children:[(0,e.jsx)(xn.Z,{type:"chevron-left",size:"large"}),"Back"]}),type:"primary",mobileSlot:"left",onClick:i}]),[i]);return(0,e.jsx)(Gn,{close:i,title:"Preferences",className:"flex flex-col",customHeader:(0,e.jsxs)("div",{className:(0,r.classNames)("flex w-full flex-row items-center justify-between border-b border-solid border-border bg-default px-3 pb-2 md:p-3",l?"pt-safe-top":"pt-2"),"data-preferences-header":!0,children:[(0,e.jsx)("div",{className:"hidden h-8 w-8 md:block"}),(0,e.jsx)("h1",{className:"text-base font-bold md:text-lg",children:"Your preferences for Standard Notes"}),(0,e.jsx)(ei.Z,{onClick:()=>{i()},icon:"close",label:"Close preferences"})]}),disableCustomHeader:s,actions:c,customFooter:(0,e.jsx)(e.Fragment,{}),children:(0,e.jsx)(rc,{menu:o,application:n,closePreferences:i})})})),oc=(e,n,i)=>{const{gesture:o="pan",requiresStartFromEdge:s=!0}=i||{},a=(0,sr.I)(),l=(0,He.useRef)(null),[c,u]=(0,He.useState)(null),d=(0,Vn.Y)(n),h=(0,et.ac)(et.Jj.sm),p=(0,et.ac)("(prefers-reduced-motion: reduce)"),f="pan"===o&&p?"swipe":o,[g,m]=(0,He.useState)((()=>a.getPreference(r.PrefKey.PaneGesturesEnabled,r.PrefDefaults[r.PrefKey.PaneGesturesEnabled])));return(0,He.useEffect)((()=>a.addSingleEventObserver(r.ApplicationEvent.PreferencesChanged,(async()=>{m(a.getPreference(r.PrefKey.PaneGesturesEnabled,r.PrefDefaults[r.PrefKey.PaneGesturesEnabled]))}))),[a]),(0,He.useEffect)((()=>{var n;if(!c)return;if(!h)return;if(!g)return;l.current=(null===(n=c.parentElement)||void 0===n?void 0:n.querySelector('[data-pane-underlay="'.concat(c.id,'"]')))||null;let r,i=0,o=Date.now(),a=0,u=o,p=null,m=null,y=!1;const v=s?25:45,A="right"===e?25:window.innerWidth-25,b=window.innerWidth/2.5,w=e=>{y=!0,setTimeout((()=>{"hidden"===e.target.style.overflowY&&(y=!1)}),5)},S=n=>{i=0,a=0,o=Date.now(),u=o,p=null,m=null,y=!1;const l=n.touches[0];i=l.clientX,a=l.clientX,("right"===e&&i>A||"left"===e&&i<A)&&s?y=!0:(r=(0,t.rP)(n.target),r&&(m=r.style.overflowY,r.addEventListener("scroll",w,!!pt.Mk&&{passive:!0}),r.scrollWidth>r.clientWidth&&(p="x")),c.style.willChange="transform")},C=t=>{if(!l.current){const t=document.createElement("div");t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.width="100%",t.style.height="100%","pan"===f?t.style.backgroundColor="#000":(t.style.background="right"===e?"linear-gradient(to right, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0))":"linear-gradient(to left, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0))",t.style.pointerEvents="none"),t.style.opacity="0",t.style.willChange="opacity",t.setAttribute("role","presentation"),t.ariaHidden="true",t.setAttribute("data-pane-underlay",c.id),"pan"===f?c.before(t):c.after(t),l.current=t}"pan"===f&&c.animate([{transform:"translate3d(".concat(t,"px, 0, 0)")}],{duration:0,fill:"forwards"});const n="pan"===f?Math.min(window.innerWidth/Math.abs(t)/10,.65):Math.min(Math.abs(t)/100,.65);l.current.animate([{opacity:n}],{duration:0,fill:"forwards"})},E=t=>{if("x"===p)return;if(y)return;const n=t.touches[0];a=n.clientX,u=Date.now();const l=a-i;if(l<v)return;const c=s||u-o>150&&a>A;if(r&&"hidden"!==r.style.overflowY&&c&&(r.style.overflowY="hidden"),document.activeElement&&document.activeElement.blur(),"pan"===f){const t="right"===e?Math.max(l-v,0):Math.min(l+v,0);C(t)}else{const t="right"===e?Math.max(l,0):Math.min(l,0);C(t)}},I=()=>{l.current&&l.current.animate([{opacity:0}],{easing:"cubic-bezier(.36,.66,.04,1)",duration:500,fill:"forwards"}).finished.then((()=>{l.current&&(l.current.remove(),l.current=null)})).catch(console.error)},_=()=>{if(r&&(r.removeEventListener("scroll",w),"hidden"===r.style.overflowY&&(r.style.overflowY=m||"")),y)return C(0),void I();const t=a-i;c.style.willChange="","right"===e&&t>b||"left"===e&&t<-b?d.current(c):C(0),I()};return c.addEventListener("touchstart",S,!!pt.Mk&&{passive:!0}),c.addEventListener("touchmove",E,!!pt.Mk&&{passive:!0}),c.addEventListener("touchend",_,!!pt.Mk&&{passive:!0}),()=>{c.removeEventListener("touchstart",S),c.removeEventListener("touchmove",E),c.removeEventListener("touchend",_),I()}}),[e,c,h,d,g,f,s]),[u]};function sc(e){(/Safari/.test(navigator.userAgent)||/AppleWebKit/.test(navigator.userAgent))&&(e.style.opacity="0.999",setTimeout((()=>{e.style.opacity="1.0"}),0))}const ac=(0,Nn.Pi)((t=>{let{application:n}=t;const r=(0,Bn.o)();(0,He.useEffect)((()=>r.addCommandHandler({command:L.QD,category:"General",description:"Open preferences",onKeyDown:()=>n.preferencesController.openPreferences()})),[r,n]);const[i]=oc("right",(async e=>{const t=e.animate([{transform:"translateX(100%)",opacity:0}],{easing:Nr.xY,duration:250,fill:"both"});await t.finished,sc(e),t.finish(),n.preferencesController.closePreferences()}));return(0,e.jsx)(Fr,{isOpen:n.preferencesController.isOpen,ref:i,animate:"mobile",animationVariant:"horizontal",close:n.preferencesController.closePreferences,className:"md:h-full md:!max-h-full md:!w-full md:!border-0",children:(0,e.jsx)(ic,{closePreferences:n.preferencesController.closePreferences,application:n})})})),lc=t=>{let{application:n,onValueChange:r,prompt:i,buttonRef:o}=t;const[s,a]=(0,He.useState)(!1);return(0,e.jsx)("div",{className:"min-w-76",children:(0,e.jsx)(Ln.Z,{primary:!0,fullWidth:!0,colorStyle:s?"success":"info",onClick:async()=>{const e=await n.mobileDevice.authenticateWithBiometrics();a(e),r(e,i)},ref:o,children:s?(0,e.jsxs)("span",{className:"flex items-center justify-center gap-3",children:[(0,e.jsx)(xn.Z,{type:"check-circle"}),"Biometrics successful"]}):"Tap to use biometrics"})})},cc=t.r8?"http://localhost:3001/?route=u2f":"https://app.standardnotes.com/?route=u2f",uc=t=>{let{contextData:n,onResponse:r,apiHost:i}=t;const o=(0,He.useRef)(null);return(0,He.useEffect)((()=>{const e=e=>{var t;V(R.U2F,"Native client received message",e),e.origin!==new URL(cc).origin?V(R.U2F,"Not sending data to U2F iframe; origin does not match",e.origin,new URL(cc).origin):e.data.mountedAuthView?(null===(t=o.current)||void 0===t?void 0:t.contentWindow)&&(V(R.U2F,"Sending contextData to U2F iframe",n),o.current.contentWindow.postMessage({username:n.username,apiHost:i},cc)):e.data.assertionResponse&&(V(R.U2F,"Received assertion response from U2F iframe",e.data.assertionResponse),r(e.data.assertionResponse))};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}}),[n,r,i]),(0,e.jsx)("iframe",{ref:o,src:cc,className:"h-40 w-full",title:"U2F",allow:"publickey-credentials-get",id:"u2f"})},dc=t=>{let{application:n,onValueChange:i,prompt:o,buttonRef:s,contextData:a}=t;const[l,c]=(0,He.useState)(null),[u,d]=(0,He.useState)("");return n.isFullU2FClient||(0,L.Dt)()?(0,e.jsxs)("div",{className:"min-w-76",children:[u&&(0,e.jsx)("div",{className:"text-red-500",children:u}),(0,e.jsx)(Ln.Z,{primary:!0,fullWidth:!0,colorStyle:l?"success":"info",onClick:async()=>{const e=r.Username.create(a.username);if(e.isFailed())return void d(e.getError());const t=e.getValue();let s=null;if((0,L.Dt)()){const e=await n.getAuthenticatorAuthenticationOptions.execute({username:t.value});if(e.isFailed())return void d(e.getError());const r=e.getValue();s=await n.mobileDevice.authenticateWithU2F(JSON.stringify(r))}else{const e=await n.getAuthenticatorAuthenticationResponse.execute({username:t.value});if(e.isFailed())return void d(e.getError());s=e.getValue()}null!==s?(c(s),i(s,o)):d("Failed to obtain device response")},ref:s,children:l?(0,e.jsxs)("span",{className:"flex items-center justify-center gap-3",children:[(0,e.jsx)(xn.Z,{type:"check-circle"}),"Obtained Device Response"]}):"Authenticate Device"})]}):(0,e.jsx)(uc,{contextData:a,apiHost:n.getHost.execute().getValue()||window.defaultSyncServer,onResponse:e=>{i(e,o)}})},hc=t=>{let{application:n,prompt:i,values:o,index:s,onValueChange:a,isInvalid:l,contextData:c}=t;const u=(0,He.useRef)(null),d=(0,He.useRef)(null),h=(0,He.useRef)(null),p=(0,He.useCallback)((async()=>{var e,t,s;if(i.validation===r.ChallengeValidation.Biometric){if(n.isNativeMobileWeb()&&"active"!==await n.mobileDevice.getAppState())return;if("boolean"==typeof o[i.id].value)return;return void(null===(e=d.current)||void 0===e||e.click())}const a=null===(t=u.current)||void 0===t?void 0:t.closest("form");(null==a?void 0:a.contains(document.activeElement))||null===(s=u.current)||void 0===s||s.focus()}),[n,i.id,i.validation,o]);return(0,He.useEffect)((()=>{if(!n.isNativeMobileWeb())return;const e=n.addNativeMobileEventListener((e=>{e===r.ReactNativeToWebEvent.GainingFocus&&p()}));return()=>{e&&e()}}),[p,n]),(0,He.useEffect)((()=>{0!==s||p()}),[p,s]),(0,He.useEffect)((()=>{var e;l&&(null===(e=u.current)||void 0===e||e.focus())}),[l]),(0,e.jsxs)("div",{className:"mb-3 w-full",children:[i.validation===r.ChallengeValidation.ProtectionSessionDuration?(0,e.jsxs)("div",{className:"min-w-76",children:[(0,e.jsx)("div",{className:"mb-2 text-sm font-medium",children:"Allow protected access for"}),(0,e.jsx)("div",{className:"flex items-center justify-between rounded bg-passive-4 p-1",children:r.ProtectionSessionDurations.map((t=>{const n=t.valueInSeconds===o[i.id].value;return(0,e.jsxs)("label",{className:"relative flex cursor-pointer items-center justify-center rounded px-2 py-1.5 text-center focus-within:ring-2 focus-within:ring-info ".concat(n?"bg-default font-semibold text-foreground":"text-passive-0 hover:bg-passive-3"),children:[(0,e.jsx)("input",{type:"radio",name:"session-duration-".concat(i.id),className:"absolute left-0 top-0 m-0 h-px w-px appearance-none focus:shadow-none focus:outline-none",style:{marginRight:0},checked:n,onChange:e=>{e.preventDefault(),a(t.valueInSeconds,i)}}),t.label]},t.label)}))})]}):i.validation===r.ChallengeValidation.Biometric?(0,e.jsx)(lc,{application:n,onValueChange:a,prompt:i,buttonRef:d}):i.validation===r.ChallengeValidation.Authenticator?(0,e.jsx)(dc,{application:n,onValueChange:a,prompt:i,buttonRef:h,contextData:c}):i.secureTextEntry?(0,e.jsx)(gi.Z,{ref:u,placeholder:i.placeholder,className:{container:"w-full max-w-76 ".concat(l?"border-danger":"")},onChange:e=>a(e,i)}):(0,e.jsx)(ui.Z,{ref:u,placeholder:i.placeholder,className:{container:"w-full max-w-76 ".concat(l?"border-danger":"")},onChange:e=>a(e,i)}),l&&(0,e.jsx)("div",{className:"mt-2 text-sm text-danger",children:"Invalid authentication, please try again."})]},i.id)};var pc=s(49258);const fc=t=>{let{mainApplicationGroup:n}=t;const r=(0,He.useRef)(null),i=(0,He.useRef)(null),[o,s]=(0,He.useState)(!1),a=(0,He.useCallback)((()=>{s((e=>!e))}),[]);return(0,e.jsxs)("div",{ref:i,children:[(0,e.jsxs)(Ln.Z,{ref:r,onClick:a,className:"mt-2 flex min-w-76 items-center justify-center",children:[(0,e.jsx)(xn.Z,{type:"user-switch",className:"mr-2 text-neutral"}),"Switch workspace"]}),(0,e.jsx)(On.Z,{title:"Switch workspace",align:"center",anchorElement:r,open:o,overrideZIndex:"z-modal",side:"right",togglePopover:a,children:(0,e.jsx)(pc.Z,{mainApplicationGroup:n,hideWorkspaceOptions:!0})})]})};function gc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function mc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gc(Object(n),!0).forEach((function(t){yc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function yc(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const vc=t=>{let{application:n,mainApplicationGroup:i,challenge:o,onDismiss:s}=t;const a=(0,He.useRef)(null),[l,c]=(0,He.useState)((()=>{var e;const t={};for(const n of o.prompts)t[n.id]={prompt:n,value:null!==(e=n.initialValue)&&void 0!==e?e:"",invalid:!1};return t})),[u,d]=(0,He.useState)(!1),[h,p]=(0,He.useState)(!1),[,f]=(0,He.useState)([]),g=[r.ChallengeReason.ApplicationUnlock,r.ChallengeReason.Migration].includes(o.reason),m=o.reason===r.ChallengeReason.ApplicationUnlock,y=(0,He.useCallback)((()=>{const e=((e,t)=>{let n=!1;const r=mc({},e);for(const e of t){const t=r[e.id];"string"==typeof t.value&&0===t.value.length&&(r[e.id].invalid=!0,n=!0)}if(!n)return r})(l,o.prompts);if(!e)return;if(u||h)return;d(!0),p(!0);const t=[];for(const n of Object.values(e)){const e=n.value,r={prompt:n.prompt,value:e};t.push(r)}const r=t.map((e=>e.prompt));p(r.length>0),f(r),setTimeout((()=>{t.length>0?o.customHandler?o.customHandler(o,t):n.submitValuesForChallenge(o,t).catch(console.error):p(!1),d(!1)}),50)}),[n,o,h,u,l]),v=(0,He.useCallback)(((e,t)=>{const n=mc({},l);n[t.id].invalid=!1,n[t.id].value=e,c(n)}),[l]),A=(0,He.useCallback)((()=>{o.cancelable&&(n.cancelChallenge(o),null==s||s(o))}),[n,o,s]);(0,He.useEffect)((()=>{const e=n.addChallengeObserver(o,{onValidValue:e=>{c((t=>{const n=mc({},t);return n[e.prompt.id].invalid=!1,n})),f((t=>{const n=t.slice();return(0,r.removeFromArray)(n,e.prompt),p(n.length>0),n}))},onInvalidValue:e=>{c((t=>{const n=mc({},t);return n[e.prompt.id].invalid=!0,n})),e.prompt.validates?f((t=>{const n=t.slice();return(0,r.removeFromArray)(n,e.prompt),p(n.length>0),n})):(f([]),p(!1))},onComplete:()=>{null==s||s(o)},onCancel:()=>{null==s||s(o)}});return()=>{e()}}),[n,o,s]);const b=o.prompts.find((e=>e.validation===r.ChallengeValidation.Biometric)),w=o.prompts.find((e=>e.validation===r.ChallengeValidation.Authenticator)),S=1===o.prompts.length&&!!b,C=1===o.prompts.length&&!!w,E=!!b&&!!l[b.id].value,I=!!w&&!!l[w.id].value,_=o.prompts.some((e=>e.secureTextEntry)),x=!(S||C);(0,He.useEffect)((()=>{var e;const t=_&&E;if(S&&E||C&&I)y();else if(t){const t=null===(e=a.current)||void 0===e?void 0:e.querySelector('input[type="password"]');null==t||t.focus()}}),[E,S,y,_,C,I]),(0,He.useEffect)((()=>{const e=n.addAndroidBackHandlerEventListener((()=>(o.cancelable&&A(),!0)));return()=>{e&&e()}}),[n,A,o.cancelable]);const P=(0,et.ac)(et.Jj.sm),k=o.reason===r.ChallengeReason.ApplicationUnlock,[B,O]=(0,He.useState)(null),N=(0,_r.l)(B,{updateOnWindowResize:!0});return(0,e.jsx)(Fr,{isOpen:!0,ref:O,close:A,hideOnInteractOutside:!1,backdropClassName:k?"bg-passive-5":"",className:(0,Q.classNames)("sn-component challenge-modal relative m-0 flex h-full w-full flex-col items-center rounded border-solid border-border bg-default p-0 md:h-auto md:!w-max",!P&&"shadow-overlay-light"),children:(0,e.jsxs)(Gn,{title:"Authenticate",close:A,customHeader:(0,e.jsx)(e.Fragment,{}),customFooter:(0,e.jsx)(e.Fragment,{}),disableCustomHeader:P,actions:[{label:"Cancel",onClick:A,type:"primary",hidden:!o.cancelable,mobileSlot:"right"}],children:[o.cancelable&&(0,e.jsx)("button",{onClick:A,"aria-label":"Close modal",className:"absolute right-4 top-4 hidden cursor-pointer border-0 bg-transparent p-1 md:flex",children:(0,e.jsx)(xn.Z,{type:"close",className:"text-neutral"})}),(0,e.jsxs)("div",{className:"flex min-h-0 w-full flex-grow flex-col items-center overflow-auto p-8",children:[(0,e.jsx)(Po.ProtectedIllustration,{className:(0,Q.classNames)("mb-4 h-30 w-30 flex-shrink-0",N&&N.height<500?"hidden md:block":"")}),(0,e.jsx)("div",{className:"mb-3 max-w-76 text-center text-lg font-bold",children:o.heading}),o.subheading&&(0,e.jsx)("div",{className:"break-word mb-4 max-w-76 text-center text-sm",children:o.subheading}),(0,e.jsx)("form",{className:"flex w-full max-w-76 flex-col items-center md:min-w-76",onSubmit:e=>{e.preventDefault(),y()},ref:a,children:o.prompts.map(((t,r)=>(0,e.jsx)(hc,{application:n,prompt:t,values:l,index:r,onValueChange:v,isInvalid:l[t.id].invalid,contextData:t.contextData},t.id)))}),x&&(0,e.jsx)(Ln.Z,{primary:!0,disabled:h,className:"mb-3.5 mt-1 min-w-76",onClick:y,children:h?"Generating Keys...":"Submit"}),g&&(0,e.jsxs)(Ln.Z,{className:"flex min-w-76 items-center justify-center",onClick:()=>{n.alerts.confirm("If you forgot your local passcode, your only option is to clear your local data from this device and sign back in to your account.","Forgot passcode?","Delete local data",r.ButtonType.Danger).then((e=>{e&&n.user.signOut().catch(console.error)})).catch(console.error)},children:[(0,e.jsx)(xn.Z,{type:"help",className:"mr-2 text-neutral"}),"Forgot passcode?"]}),m&&(0,e.jsx)(fc,{mainApplicationGroup:i})]})]})},o.id)},Ac=e=>{const t={[r.NoteType.Plain]:[],[r.NoteType.Super]:[],[r.NoteType.RichText]:[],[r.NoteType.Markdown]:[],[r.NoteType.Task]:[],[r.NoteType.Code]:[],[r.NoteType.Spreadsheet]:[],[r.NoteType.Authentication]:[],[r.NoteType.Unknown]:[]};return((e,t)=>{for(const n of(0,r.GetIframeAndNativeEditors)())t.features.isExperimentalFeature(n.identifier)||n.deprecated||e[n.note_type].push({isEntitled:t.features.getFeatureStatus(r.NativeFeatureIdentifier.create(n.identifier).getValue())===r.FeatureStatus.Entitled,uiFeature:new r.UIFeature(n)})})(t,e),((e,t)=>{const n=t.componentManager.thirdPartyComponentsForArea(r.ComponentArea.Editor).sort(((e,t)=>e.displayName.toLowerCase()<t.displayName.toLowerCase()?-1:1));for(const i of n){const n=(0,r.FindNativeFeature)(i.identifier);if(n){e[n.note_type].push({isEntitled:t.features.getFeatureStatus(r.NativeFeatureIdentifier.create(n.identifier).getValue())===r.FeatureStatus.Entitled,uiFeature:new r.UIFeature(n)});continue}const o=i.noteType,s={uiFeature:new r.UIFeature(i),isEntitled:t.features.getFeatureStatus(r.Uuid.create(i.uuid).getValue())===r.FeatureStatus.Entitled};e[o].push(s)}})(t,e),(e=>{const t=(0,r.GetSuperNoteFeature)();return[{icon:pt.IN.icon,iconClassName:pt.IN.iconClassName,title:t.name,items:e[r.NoteType.Super],featured:!0},{icon:"rich-text",iconClassName:"text-accessory-tint-1",title:"Rich text",items:e[r.NoteType.RichText]},{icon:"markdown",iconClassName:"text-accessory-tint-2",title:"Markdown text",items:e[r.NoteType.Markdown]},{icon:"tasks",iconClassName:"text-accessory-tint-3",title:"Todo",items:e[r.NoteType.Task]},{icon:"code",iconClassName:"text-accessory-tint-4",title:"Code",items:e[r.NoteType.Code]},{icon:"spreadsheets",iconClassName:"text-accessory-tint-5",title:"Spreadsheet",items:e[r.NoteType.Spreadsheet]},{icon:"authenticator",iconClassName:"text-accessory-tint-6",title:"Authentication",items:e[r.NoteType.Authentication]},{icon:"plain-text",iconClassName:"text-accessory-tint-1",title:"Plain text",items:e[r.NoteType.Plain]},{icon:"editor",iconClassName:"text-neutral",title:"Others",items:e[r.NoteType.Unknown]}]})(t)},bc=e=>{const t=document.querySelector(":root"),n="--sn-stylekit-editor-font-family";e?t.style.setProperty(n,"var(--sn-stylekit-monospace-font)"):t.style.setProperty(n,"var(--sn-stylekit-sans-serif-font)"),document.documentElement.classList.toggle("monospace-font",e)};var wc=s(91031),Sc=s(71881),Cc=s(72604);function Ec(t){let{index:n,isSelected:i,onClick:o,onMouseEnter:s,option:a,searchQuery:l}=t;return(0,e.jsxs)("li",{tabIndex:-1,className:(0,r.classNames)("gap-4",Xn,i&&"bg-info-backdrop",a.item&&"px-3 py-2"),ref:a.setRefElement,role:"option","aria-selected":i,id:"typeahead-item-"+n,onMouseEnter:s,onClick:o,children:[a.item&&(0,e.jsx)(Sc.Z,{item:a.item,searchQuery:l}),!a.item&&(0,e.jsx)(Cc.d,{searchQuery:l,onClickCallback:o,isFocused:i})]},a.key)}class Ic extends Wn.n{constructor(e,t,n){super(t||""),this.item=e,this.label=t,this.options=n,this.key=(null==e?void 0:e.uuid)||t}}var _c=s(90509),xc=s(95768);const Pc=n=>{let{currentNote:i}=n;const o=(0,sr.I)(),[s]=(0,Zn.g)(),a=(0,xc.o)(),[l,c]=(0,He.useState)(""),u=function(e,t){let{minLength:n=1,maxLength:r=75}={minLength:0};return(0,He.useCallback)((e=>{const t=new RegExp("(^|\\s|\\()([@](\\S(?:[^@]){0,"+r+"}))$").exec(e);if(null!==t){const e=t[1],r=t[3];if(r.length>=n)return{leadOffset:t.index+e.length,matchingString:r,replaceableString:t[2]}}return null}),[r,n,"@"])}(),d=(0,He.useCallback)(((e,t,n,r)=>{s.update((()=>{t&&t.remove(),e.options.onSelect(r),n()}))}),[s]),h=(0,He.useMemo)((()=>{const{linkedItems:e,unlinkedItems:t,shouldShowCreateTag:n}=(0,_c.Q)(l||"",o,i,{returnEmptyIfQueryEmpty:!1}),c=[...e,...t].map((e=>new Ic(e,e.title||"",{onSelect:t=>{a.linkItems(i,e),e.content_type===r.ContentType.TYPES.File?s.dispatchCommand(ir.dq,e.uuid):s.dispatchCommand(ir.KG,e.uuid)}})));return n&&c.push(new Ic(void 0,"",{onSelect:async e=>{const t=await a.createAndAddNewTag(e||"");s.dispatchCommand(ir.KG,t.uuid)}})),c}),[o,s,i,l,a]);return(0,e.jsx)(Wn.HQ,{onQueryChange:c,onSelectOption:d,triggerFn:u,options:h,menuRenderFn:(n,r)=>{let{selectedIndex:i,selectOptionAndCleanUp:o,setHighlightedIndex:s}=r;return n.current&&h.length?(0,e.jsx)(On.Z,{title:"Select item",align:"start",anchorElement:n,open:!0,disableMobileFullscreenTakeover:!0,side:(0,t.Av)()?"top":"bottom",maxHeight:e=>e/2,children:(0,e.jsx)("ul",{children:h.map(((t,n)=>(0,e.jsx)(Ec,{searchQuery:l||"",index:n,isSelected:i===n,onClick:()=>{s(n),o(t)},onMouseEnter:()=>{s(n)},option:t},t.key)))})}):null}})};var kc=s(7355),Bc=s(97247);function Oc(){const[e]=(0,Zn.g)();return(0,He.useEffect)((()=>{if(!e.hasNodes([kc.H]))throw new Error("ItemBubblePlugin: BubbleNode not registered on editor");return e.registerCommand(ir.KG,(e=>{const t=(0,Bc.fj)(e);return(0,W.od)([t]),(0,W._v)(t.getParentOrThrow())&&(0,se.JB)(t,W.BE).selectEnd(),!0}),W.VN)}),[e]),null}function Nc(e){let{nodeType:t,onRemove:n}=e;const[r]=(0,Zn.g)(),i=(0,He.useRef)(new Map);return(0,He.useEffect)((()=>{const e=r.registerMutationListener(t,(e=>{r.getEditorState().read((()=>{for(const[t,r]of e)if("updated"===r||"created"===r){const e=(0,W.gI)(t);if(e){const n=e.getId();i.current.set(t,n)}}else if("destroyed"===r){const e=i.current.get(t);e&&n(e)}}))}));return()=>{e()}})),null}var Dc=s(92249);function jc(e){let{providerCallback:t}=e;const[n]=(0,Zn.g)();return(0,He.useEffect)((()=>{t((e=>{n.update((()=>{const t=n.parseEditorState(e);n.setEditorState(t)}))}))}),[n,t]),null}function Tc(e){let{onMarkdown:t}=e;const[n]=(0,Zn.g)();return(0,He.useEffect)((()=>{n.update((()=>{const e=(0,W.Gv)(),n=(0,W.K8)(W.CK);for(const e of n)e.isEmpty()&&e.remove();const r=(0,pe.JH)(X.c);e.clear().append((0,re.Ol)("markdown").append((0,W.MX)(r))),e.selectEnd(),t(r)}))}),[n,t]),null}const Mc=t=>{let{note:n,closeDialog:r}=t;const[i,o]=(0,He.useState)(""),[s,a]=(0,He.useState)(!1),l=(0,He.useCallback)((()=>{var e;e=i,navigator.clipboard?navigator.clipboard.writeText(e):function(e){const t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}catch(e){console.error("Unable to copy",e)}document.body.removeChild(t)}(e),a(!0),setTimeout((()=>{a(!1)}),1500)}),[i]),c=(0,He.useCallback)((e=>{o(e)}),[]),u=(0,et.ac)(et.Jj.sm),d=(0,He.useMemo)((()=>[{label:s?"Copied":"Copy",type:"primary",onClick:l,mobileSlot:"left"},{label:"Done",type:"cancel",onClick:r,mobileSlot:"right",hidden:!u}]),[r,l,s,u]);return(0,e.jsx)(Gn,{title:"Markdown Preview",close:r,actions:d,children:(0,e.jsx)("div",{className:"relative w-full px-4 py-4",children:(0,e.jsx)(As,{children:(0,e.jsx)(zn.I,{readonly:!0,initialValue:n.text,children:(0,e.jsx)(Yn.k,{readonly:!0,className:"relative resize-none text-base focus:shadow-none focus:outline-none",spellcheck:n.spellcheck,children:(0,e.jsx)(Tc,{onMarkdown:c})})})})})})},Fc=(0,He.forwardRef)(((e,t)=>{const[n]=(0,Zn.g)();(0,He.useImperativeHandle)(t,(()=>({getMarkdown:()=>r()})));const r=(0,He.useCallback)((()=>n.getEditorState().read((()=>(0,pe.JH)(X.c)))),[n]);return null})),Rc=Fc,Lc=e=>{let{note:t}=e;const n=(0,sr.I)(),[i]=(0,Zn.g)(),[o,s]=(0,He.useState)(t.locked);return(0,He.useEffect)((()=>n.items.streamItems(r.ContentType.TYPES.Note,(e=>{let{changed:n}=e;const r=n.find((e=>e.uuid===t.uuid));r&&s(r.locked)}))),[n,t.uuid]),(0,He.useEffect)((()=>{i.update((()=>{i.setEditable(!o)}))}),[i,o]),null},Qc=()=>(0,e.jsx)("button",{className:"peer flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-full bg-warning text-warning-contrast",children:(0,e.jsx)(xn.Z,{type:"warning",size:"small"})}),Uc=(e,t,n)=>{switch(e){case r.FeatureStatus.InCurrentPlanButExpired:return t?"Your subscription expired on ".concat((0,r.dateToLocalizedString)(t)):"Your subscription expired.";case r.FeatureStatus.NoUserSubscription:return"You do not have an active subscription";case r.FeatureStatus.NotInCurrentPlan:return"Please upgrade your plan to access ".concat(n);default:return"".concat(n," is valid and you should not be seeing this message")}},Vc=t=>{let{featureStatus:n,feature:r}=t;const i=(0,sr.I)(),o=i.subscriptions.userSubscriptionExpirationDate,s=(0,He.useCallback)((()=>{i.openSubscriptionDashboard.execute()}),[i]);return(0,e.jsx)("div",{className:"sn-component",children:(0,e.jsxs)("div",{className:"flex min-h-[1.625rem] w-full select-none items-center justify-between border-b border-border bg-contrast px-2 py-2.5 text-text",children:[(0,e.jsx)("div",{className:"left",children:(0,e.jsxs)("div",{className:"flex items-start",children:[(0,e.jsx)("div",{className:"mt-1",children:(0,e.jsx)(Qc,{})}),(0,e.jsxs)("div",{className:"ml-2",children:[(0,e.jsx)("strong",{children:Uc(n,o,r.name)}),(0,e.jsxs)("div",{className:"sk-p",children:[r.name," is in a read-only state."]})]})]})}),(0,e.jsx)("div",{className:"right",children:(0,e.jsx)(Ln.Z,{onClick:s,primary:!0,colorStyle:"success",small:!0,children:"Manage subscription"})})]})})};function Kc(e){let{isEnabled:t}=e;const n=(0,sr.I)(),[i]=(0,Zn.g)(),[o,s]=(0,He.useState)(!1);return(0,He.useEffect)((()=>{if(t){if(n.platform===r.Platform.Ios)return i.registerUpdateListener((()=>{if(o)return;const e=i.getRootElement();e&&(e.focus(),s(!0))}));i.focus()}}),[n.platform,o,i,t]),null}function Hc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Gc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hc(Object(n),!0).forEach((function(t){Yc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Yc(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const zc=t=>{let{application:n,linkingController:i,filesController:o,spellcheck:s,controller:a,readonly:l,onFocus:c,onBlur:u}=t;const d=(0,He.useRef)(a.item),h=(0,He.useRef)(),p=(0,He.useRef)(!1),[f,g]=(0,He.useState)(!1),m=(0,He.useRef)(null),[y,v]=(0,He.useState)(r.FeatureStatus.Entitled);(0,He.useEffect)((()=>{v(n.features.getFeatureStatus(r.NativeFeatureIdentifier.create(r.NativeFeatureIdentifier.TYPES.SuperEditor).getValue(),{inContextOfItem:d.current}))}),[n.features]);const A=(0,Bn.o)();(0,He.useEffect)((()=>A.addCommandHandler({command:L.YN,category:"Super notes",description:"Show markdown preview for current note",onKeyDown:()=>g(!0)})),[A]),(0,He.useEffect)((()=>{const e=n.platform,t=(0,L.dP)(n.platform);return A.registerExternalKeyboardShortcutHelpItems([{key:"b",modifiers:[t],description:"Bold",category:"Formatting",platform:e},{key:"i",modifiers:[t],description:"Italic",category:"Formatting",platform:e},{key:"u",modifiers:[t],description:"Underline",category:"Formatting",platform:e},{key:"k",modifiers:[t],description:"Link",category:"Formatting",platform:e}])}),[n.platform,A]);const b=(0,He.useCallback)((()=>{g(!1)}),[]);(0,He.useEffect)((()=>n.actions.addPayloadRequestHandler((e=>{var t,n;if(e===d.current.uuid){const e=d.current.payload.ejected();return Gc(Gc({},e),{},{content:Gc(Gc({},e.content),{},{text:null!==(n=null===(t=m.current)||void 0===t?void 0:t.getMarkdown())&&void 0!==n?n:e.content.text})})}}))),[n]);const w=(0,He.useCallback)((async(e,t)=>{!0!==p.current?a.saveAndAwaitLocalPropagation({text:e,isUserModified:!0,previews:{previewPlain:t,previewHtml:void 0}}):p.current=!1}),[a]),S=(0,He.useCallback)((e=>{const t=n.items.findItem(e);t&&i.unlinkItemFromSelectedItem(t).catch(console.error)}),[i,n]);(0,He.useEffect)((()=>a.addNoteInnerValueChangeObserver(((e,t)=>{var n;if(e.uuid!==d.current.uuid)throw Error("Editor received changes for non-current note");(0,r.isPayloadSourceRetrieved)(t)&&(p.current=!0,null===(n=h.current)||void 0===n||n.call(h,e.text)),d.current=e}))),[a,a.item.uuid]);const[C]=(0,Er.D)(r.LocalPrefKey.EditorLineHeight),[E]=(0,Er.D)(r.LocalPrefKey.EditorFontSize),I=Ir(E,!1),_=(0,He.useRef)(null);(0,He.useEffect)((()=>{const e=e=>{var t;"A"===e.target.tagName&&((null===(t=e.target.getAttribute("href"))||void 0===t?void 0:t.startsWith("http"))||e.preventDefault())},t=_.current;return t&&t.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e)}}),[]);const x=(0,He.useCallback)((e=>{n.notifyWebEvent(r.WebAppEvent.EditorDidFocus,{eventSource:kn.UserInteraction}),null==c||c(e)}),[n,c]);return(0,e.jsxs)("div",{id:kl.N.SuperEditor,className:"font-editor relative flex h-full w-full flex-col",style:{"--line-height":r.EditorLineHeightValues[C],"--font-size":I},ref:_,children:[y!==r.FeatureStatus.Entitled&&(0,e.jsx)(Vc,{featureStatus:y,feature:(0,r.GetSuperNoteFeature)()}),(0,e.jsxs)(As,{children:[(0,e.jsx)(xc.Z,{controller:i,children:(0,e.jsx)(Dc.Z,{controller:o,children:(0,e.jsx)(zn.I,{readonly:d.current.locked||l,initialValue:d.current.text,children:(0,e.jsxs)(Yn.k,{onChange:w,className:"blocks-editor h-full resize-none",previewLength:160,spellcheck:s,readonly:d.current.locked||l,onFocus:x,onBlur:u,children:[(0,e.jsx)(Pc,{currentNote:d.current}),(0,e.jsx)(wr.Z,{currentNote:d.current}),(0,e.jsx)(Oc,{}),(0,e.jsx)(Rc,{ref:m}),(0,e.jsx)(jc,{providerCallback:e=>h.current=e}),(0,e.jsx)(Nc,{nodeType:kc.H,onRemove:S}),(0,e.jsx)(Nc,{nodeType:ee.h,onRemove:S}),void 0===l&&(0,e.jsx)(Lc,{note:d.current}),(0,e.jsx)(Kc,{isEnabled:a.isTemplateNote}),(0,e.jsx)(Cr,{})]})})})}),(0,e.jsx)(Fr,{isOpen:f,close:b,children:(0,e.jsx)(Mc,{note:d.current,closeDialog:b})})]})]})};function Zc(e){let{text:t,format:n,onChange:r,customImportFunction:i}=e;const[o]=(0,Zn.g)();return(0,He.useEffect)((()=>{0===t.trim().length||(i?i(o,t):o.update((()=>{if("md"===n)Ee(t,X.c,void 0,!0);else{const e=(new DOMParser).parseFromString(t,"text/html"),n=(0,$.s)(o,e),r=(0,W.vN)(),i=(0,W.BE)();r.insertNodes([i,...n])}})))}),[o,t,n,i]),(0,He.useEffect)((()=>o.registerUpdateListener((e=>{let{editorState:t}=e;t.read((()=>{(0,wc.S)(t,160,r)}))}))),[o,r]),null}const Wc=t=>{let{note:n,application:i,closeDialog:o,onComplete:s}=t;const a=0===n.text.length,l=function(e){try{JSON.parse(e)}catch(e){return!1}return!0}(n.text),[c,u]=(0,He.useState)({text:"",previewPlain:""}),d=!n.noteType||[r.NoteType.Plain,r.NoteType.Markdown,r.NoteType.Code,r.NoteType.Task].includes(n.noteType)?"md":"html",h=(0,He.useCallback)(((e,t)=>{u({text:e,previewPlain:t})}),[]),p=(0,He.useCallback)((async(e,t)=>{const r=new Bt(n,i.items,i.mutator,i.sync,i.sessions,i.preferences,i.componentManager,i.alerts,i.isNativeMobileWebUseCase);await r.initialize(),await r.saveAndAwaitLocalPropagation({text:e,previews:{previewPlain:t,previewHtml:void 0},isUserModified:!0,bypassDebouncer:!0})}),[i,n]),f=(0,He.useCallback)((async()=>{o(),await p(c.text,c.previewPlain),s()}),[o,p,s,c]);(0,He.useEffect)((()=>{a&&f()}),[a,f]);const g=(0,He.useCallback)((async()=>{await i.alerts.confirm((0,Q.spaceSeparatedStrings)("This option is useful if you switched this note's type from Super to another plaintext-based format, and want to return to Super.","To use this option, the preview in the convert window should display a language format known as JSON.","If this is not the case, cancel this prompt."),"Are you sure?")&&(o(),await p(n.text,n.preview_plain),s())}),[o,i,n,s,p]),m=(0,He.useMemo)((()=>[{label:"Cancel",onClick:o,type:"cancel",mobileSlot:"left"},{label:"Convert",onClick:f,mobileSlot:"right",type:"primary"},{label:"Convert As-Is",onClick:g,type:"secondary",hidden:!l}]),[l,o,f,g]),[y]=(0,Er.D)(r.LocalPrefKey.EditorLineHeight),[v]=(0,Er.D)(r.LocalPrefKey.EditorFontSize),A=Ir(v,!1);return a?null:(0,e.jsxs)(Gn,{title:"Convert to Super note",close:o,actions:m,children:[(0,e.jsx)("div",{className:"border-b border-border px-4 py-4 text-sm font-normal text-neutral md:py-3",children:"The following is a preview of how your note will look when converted to Super. Super notes use a custom format under the hood. Converting your note will transition it from plaintext to the custom Super format."}),(0,e.jsx)("div",{className:"relative w-full px-4 py-4",style:{"--line-height":r.EditorLineHeightValues[y],"--font-size":A},children:(0,e.jsx)(As,{children:(0,e.jsx)(zn.I,{readonly:!0,initialValue:void 0,children:(0,e.jsx)(Yn.k,{readonly:!0,onChange:h,ignoreFirstChange:!1,className:"relative resize-none text-base focus:shadow-none focus:outline-none",previewLength:160,spellcheck:n.spellcheck,children:(0,e.jsx)(Zc,{text:n.text,format:d,onChange:h})})})})})]})},qc=()=>(0,e.jsx)("div",{className:"sn-component",children:(0,e.jsx)("div",{className:"sk-panel static",children:(0,e.jsx)("div",{className:"sk-panel-content",children:(0,e.jsxs)("div",{className:"sk-panel-section stretch",children:[(0,e.jsx)("div",{className:"sk-panel-column"}),(0,e.jsx)("div",{className:"text-base font-bold",children:"You have restricted this component to not use a hosted version."}),(0,e.jsx)("div",{className:"sk-subtitle",children:"Locally-installed components are not available in the web application."}),(0,e.jsx)("div",{className:"sk-panel-row"}),(0,e.jsx)("div",{className:"sk-panel-row",children:(0,e.jsxs)("div",{className:"sk-panel-column",children:[(0,e.jsx)("div",{className:"sk-p",children:"To continue, choose from the following options:"}),(0,e.jsxs)("ul",{className:"mt-3 list-disc pl-8",children:[(0,e.jsxs)("li",{className:"sk-p mb-1",children:["Enable the Hosted option for this component by opening the Preferences ",">"," General ",">"," Advanced Settings menu and toggling 'Use hosted when local is unavailable' under this component's options. Then press Reload."]}),(0,e.jsx)("li",{className:"sk-p",children:"Use the desktop application."})]})]})})]})})})}),Jc=t=>{let{componentName:n}=t;return(0,e.jsx)("div",{className:"sn-component",children:(0,e.jsx)("div",{className:"sk-panel static",children:(0,e.jsx)("div",{className:"sk-panel-content",children:(0,e.jsxs)("div",{className:"sk-panel-section stretch",children:[(0,e.jsx)("div",{className:"sk-panel-section-title",children:"This extension is missing its URL property."}),(0,e.jsxs)("p",{children:["In order to access your note immediately, please switch from ",n," to the Plain Editor."]}),(0,e.jsx)("br",{}),(0,e.jsx)("p",{children:"Please contact help@standardnotes.com to remedy this issue."})]})})})})},Xc=t=>{let{deprecationMessage:n,dismissDeprecationMessage:r}=t;return(0,e.jsx)("div",{className:"sn-component",children:(0,e.jsxs)("div",{className:"flex min-h-[1.625rem] w-full select-none items-center justify-between border-b border-border bg-contrast px-2 py-2.5 text-text",children:[(0,e.jsx)("div",{className:"left",children:(0,e.jsx)("div",{className:"sk-app-bar-item",children:(0,e.jsx)("div",{className:"text-xs font-bold text-warning",children:n||"This extension is deprecated."})})}),(0,e.jsx)("div",{className:"right",children:(0,e.jsx)(Ln.Z,{primary:!0,onClick:r,small:!0,children:"Dismiss"})})]})})},$c=t=>{let{componentName:n,reloadIframe:r}=t;return(0,e.jsx)("div",{className:"sn-component",children:(0,e.jsxs)("div",{className:"flex min-h-[1.625rem] w-full select-none items-center justify-between border-b border-border bg-contrast px-2 py-2.5 text-text",children:[(0,e.jsx)("div",{className:"left",children:(0,e.jsx)("div",{className:"sk-app-bar-item",children:(0,e.jsxs)("div",{className:"sk-label.warning",children:["There was an issue loading ",n,"."]})})}),(0,e.jsx)("div",{className:"right",children:(0,e.jsx)(Ln.Z,{primary:!0,onClick:r,small:!0,children:"Reload"})})]})})};function eu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eu(Object(n),!0).forEach((function(t){nu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function nu(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ru=(0,Nn.Pi)((t=>{let{onLoad:n,componentViewer:i,requestReload:o,readonly:s=!1,usedInModal:a=!1}=t;const l=(0,sr.I)(),c=(0,He.useRef)(null),[u,d]=(0,He.useState)(void 0),[h,p]=(0,He.useState)(!1),[f,g]=(0,He.useState)(!0),[m,y]=(0,He.useState)(i.getFeatureStatus()),[v,A]=(0,He.useState)(!0),[b,w]=(0,He.useState)(void 0),[S,C]=(0,He.useState)(void 0),[E,I]=(0,He.useState)(!1),[_,x]=(0,He.useState)(!1),P=i.getComponentOrFeatureItem(),k=(0,He.useCallback)((()=>{y(i.getFeatureStatus()),i.lockReadonly||i.setReadonly(m!==r.FeatureStatus.Entitled||s),A(i.shouldRender()),f&&!v&&g(!1),w(i.getError()),C(P.deprecationMessage)}),[i,f,v,P.deprecationMessage,m,s]);(0,He.useEffect)((()=>{k()}),[k]),(0,He.useEffect)((()=>l.subscriptions.addEventObserver((e=>{e===r.SubscriptionManagerEvent.DidFetchSubscription&&k()}))),[l.subscriptions,k]);const B=(0,He.useCallback)((()=>{"hidden"!==document.visibilityState&&h&&(null==o||o(i))}),[h,i,o]);(0,He.useEffect)((()=>{const e=setTimeout((()=>{g(!1),p(!0),_?document.addEventListener("visibilitychange",B):(x(!0),null==o||o(i))}),4e3);return d(e),()=>{e&&clearTimeout(e)}}),[i]);const O=(0,He.useCallback)((()=>{const e=c.current.contentWindow;u&&clearTimeout(u);try{i.setWindow(e)}catch(e){console.error(e)}setTimeout((()=>{g(!1),p(!1),null==n||n()}),35)}),[i,n,u]);(0,He.useEffect)((()=>{const e=i.addEventObserver((e=>{e===r.ComponentViewerEvent.FeatureStatusUpdated&&y(i.getFeatureStatus())}));return()=>{e()}}),[i]),(0,He.useEffect)((()=>{const e=i.addActionObserver(((e,t)=>{switch(e){case r.ComponentAction.KeyDown:l.keyboardService.handleComponentKeyDown(t.keyboardModifier);break;case r.ComponentAction.KeyUp:l.keyboardService.handleComponentKeyUp(t.keyboardModifier);break;case r.ComponentAction.Click:l.notesController.setContextMenuOpen(!1);break;default:return}}));return()=>{e()}}),[i,l]),(0,He.useEffect)((()=>{var e;const t=null===(e=l.desktopManager)||void 0===e?void 0:e.registerUpdateObserver((e=>{e.uuid===P.uniqueIdentifier.value&&(null==o||o(i))}));return()=>{null==t||t()}}),[l,o,i,P]);const N=(0,He.useMemo)((()=>{const e=["allow-scripts","allow-top-navigation-by-user-activation","allow-popups","allow-modals","allow-forms","allow-downloads"];return P.isNativeFeature&&e.push("allow-popups-to-escape-sandbox"),l.isNativeMobileWeb()&&P.isNativeFeature&&e.push("allow-same-origin"),e}),[l,P]);return(0,e.jsxs)(e.Fragment,{children:[h&&(0,e.jsx)($c,{componentName:P.displayName,reloadIframe:()=>{k(),null==o||o(i,!0)}}),m!==r.FeatureStatus.Entitled&&(0,e.jsx)(Vc,{featureStatus:m,feature:P.featureDescription}),S&&!E&&(0,e.jsx)(Xc,{deprecationMessage:S,dismissDeprecationMessage:()=>{I(!0)}}),b===r.ComponentViewerError.OfflineRestricted&&(0,e.jsx)(qc,{}),b===r.ComponentViewerError.MissingUrl&&(0,e.jsx)(Jc,{componentName:P.displayName}),P.uniqueIdentifier&&v&&(0,e.jsx)("iframe",tu(tu({className:"h-full w-full flex-grow bg-transparent",ref:c,onLoad:O,"data-component-viewer-id":i.identifier,frameBorder:0,src:i.url||"",sandbox:N.join(" ")},a&&{"data-used-in-modal":!0}),{},{children:"Loading"})),f&&(0,e.jsx)("div",{className:"loading-overlay"})]})})),iu=t=>{let{note:n,convertTo:i,closeDialog:o,onComplete:s}=t;const a=(0,sr.I)(),{uiFeature:l}=i,c=(0,He.useMemo)((()=>{if(l){const e=l.fileType;if(e)return e}return l.noteType===r.NoteType.Markdown?"md":l.noteType===r.NoteType.RichText?"html":l.noteType===r.NoteType.Plain?"txt":"json"}),[l]),[u,d]=(0,He.useState)("");(0,He.useEffect)((()=>{(async()=>{if(0===n.text.length)return n.text;try{return(new Be).convertSuperStringToOtherFormat(n.text,c)}catch(e){console.error(e)}return n.text})().then(d).catch(console.error)}),[c,n]);const h=(0,He.useMemo)((()=>{if(!l||!(0,r.isUIFeatureAnIframeFeature)(l))return;const e=a.items.createTemplateItem(r.ContentType.TYPES.Note,{title:n.title,text:u,references:n.references});return a.componentManager.createComponentViewer(l,{readonlyItem:e})}),[a.componentManager,a.items,l,u,n.references,n.title]);(0,He.useEffect)((()=>()=>{h&&a.componentManager.destroyComponentViewer(h)}),[a.componentManager,h]);const p=(0,He.useCallback)((async e=>{const t=new Bt(n,a.items,a.mutator,a.sync,a.sessions,a.preferences,a.componentManager,a.alerts,a.isNativeMobileWebUseCase);await t.initialize(),await t.saveAndAwaitLocalPropagation({text:e,isUserModified:!0,bypassDebouncer:!0})}),[a,n]),f=(0,He.useCallback)((async()=>{await p(u),s(),o()}),[o,u,s,p]),g=0===n.text.length;(0,He.useEffect)((()=>{g&&f()}),[g,f]);const m=(0,He.useCallback)((async()=>{await a.alerts.confirm((0,r.spaceSeparatedStrings)("This option is useful if you want to edit the note's content which is in Super's JSON format directly.",'This format is not human-readable. If you want to convert the note to a human-readable format, please use the "Convert" option instead.'),"Are you sure?")&&(o(),await p(n.text),s())}),[o,a,n,s,p]),y=(0,He.useMemo)((()=>[{label:"Cancel",onClick:o,type:"cancel",mobileSlot:"left"},{label:"Convert",onClick:f,mobileSlot:"right",type:"primary"},{label:"Convert As-Is",onClick:m,type:"secondary"}]),[o,f,m]);return(0,e.jsxs)(Gn,{title:"Convert to ".concat(l.displayName),close:o,actions:y,className:"flex flex-col !overflow-hidden",children:["txt"===c||"md"===c?(0,e.jsxs)("div",{className:"flex items-start border-b border-border p-4 text-sm",children:[(0,e.jsx)(xn.Z,{type:"warning",className:"mr-2 flex-shrink-0"}),"Conversion from Super's format to Markdown/Plaintext can be lossy. Please review the converted note before saving."]}):null,h?(0,e.jsx)("div",{className:"component-view min-h-0",children:(0,e.jsx)(ru,{usedInModal:!0,readonly:!0,componentViewer:h},h.identifier)}):(0,e.jsx)("div",{className:"h-full min-h-0 overflow-hidden",children:(0,e.jsx)("textarea",{readOnly:!0,className:"font-editor h-full w-full resize-none border-0 bg-default p-4 text-editor text-text",value:u})})]})},ou=t=>{let{application:n,closeMenu:i,note:o,onSelect:s,setDisableClickOutside:a}=t;const[l,c]=(0,He.useState)([]),[u,d]=(0,He.useState)(!1),h=(0,He.useCallback)((()=>{const e=Ac(n);if(c(e),o&&o.editorIdentifier){let t=!1;for(const n of e)for(const e of n.items)if(e.uiFeature.featureIdentifier===o.editorIdentifier){t=!0;break}d(!t)}}),[n,o]);(0,He.useEffect)((()=>{n.items.streamItems([r.ContentType.TYPES.Component],h)}),[n,h]),(0,He.useEffect)((()=>{h()}),[h]);const[p,f]=(0,He.useState)(),[g,m]=(0,He.useState)(null),y=!!g&&(null==o?void 0:o.noteType)!==r.NoteType.Super&&!!(null==o?void 0:o.text.length)&&g.uiFeature.noteType===r.NoteType.Super,v=!!g&&(null==o?void 0:o.noteType)===r.NoteType.Super&&g.uiFeature.noteType!==r.NoteType.Super;(0,He.useEffect)((()=>{o&&f(n.componentManager.editorForNote(o))}),[n,o]);const A=Qr(),b=(0,He.useCallback)((e=>{if(p)return e.uiFeature.featureIdentifier===p.featureIdentifier;const t=e.uiFeature.noteType===(null==o?void 0:o.noteType),n=!(null==o?void 0:o.noteType)&&e.uiFeature.noteType===r.NoteType.Plain,i=(null==o?void 0:o.noteType)===r.NoteType.Unknown&&e.uiFeature.noteType===r.NoteType.Plain;return t||n||i}),[p,o]),w=(0,He.useCallback)((async(e,t)=>{e.isComponent&&e.asComponent.conflictOf&&n.changeAndSaveItem.execute(e.asComponent,(e=>{e.conflictOf=void 0})),await n.itemListController.insertCurrentIfTemplate(),await n.changeAndSaveItem.execute(t,(t=>{const n=t;n.noteType=e.noteType,n.editorIdentifier=e.featureIdentifier})),f(n.componentManager.editorForNote(t)),e.featureIdentifier===r.NativeFeatureIdentifier.TYPES.PlainEditor&&bc(n.preferences.getLocalValue(r.LocalPrefKey.EditorMonospaceEnabled))}),[n]),S=(0,He.useCallback)((e=>{const t=e||g;t&&o&&(w(t.uiFeature,o).catch(console.error),i())}),[g,o,i,w]),C=(0,He.useCallback)((async e=>{if(!e.isEntitled)return e.uiFeature.featureIdentifier===r.NativeFeatureIdentifier.TYPES.SuperEditor?void A.showSuperDemo():void A.activate(e.uiFeature.displayName);if(!o)return;if(o.locked)return void n.alerts.alert(ht.L0).catch(console.error);if(e.uiFeature.noteType===r.NoteType.Super){if(0===o.text.length)return void S(e);if(o.noteType===r.NoteType.Super)return;return m(e),void(null==a||a(!0))}if(o.noteType===r.NoteType.Super&&o.text.length>0)return m(e),void(null==a||a(!0));let t=!0;e.uiFeature&&n.componentManager.doesEditorChangeRequireAlert(p,e.uiFeature)&&(t=await n.componentManager.showEditorChangeAlert()),t&&w(e.uiFeature,o).catch(console.error),i(),s&&s(e.uiFeature)}),[o,i,s,A,n.alerts,n.componentManager,a,S,p,w]),E=!o||o.noteType&&[r.NoteType.Plain,r.NoteType.Markdown,r.NoteType.RichText,r.NoteType.Task,r.NoteType.Code,r.NoteType.Unknown].includes(o.noteType),I=()=>{m(null),null==a||a(!1)},_=()=>{m(null),null==a||a(!1)},x=(0,He.useCallback)((()=>{n.openPreferences("plugins")}),[n]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(qr.Z,{className:"pb-1 pt-0.5",a11yLabel:"Change note type menu",children:[(0,e.jsx)(Jr.Z,{children:(0,e.jsxs)("div",{className:"flex items-center justify-between py-3 pr-4 md:pb-1 md:pt-0",children:[(0,e.jsxs)("div",{className:"px-3",children:[(0,e.jsx)("h2",{className:"text-base font-bold",children:"Choose a note type"}),u&&(0,e.jsx)("p",{className:"mr-2 pt-1 text-xs text-warning",children:"Unable to find system editor for this note. Select Manage Plugins to reinstall this editor."})]}),(0,e.jsx)("button",{className:"cursor-pointer whitespace-nowrap text-right text-xs text-info",onClick:x,children:"Manage Plugins"})]})}),l.filter((e=>e.items&&e.items.length)).map((t=>{const n=(e=>e.title.toLowerCase().replace(/\s/,"-"))(t);return(0,e.jsx)(Jr.Z,{children:t.items.map((n=>(0,e.jsx)(Kr.Z,{onClick:()=>{C(n).catch(console.error)},className:"flex-row-reversed py-2",checked:b(n),info:n.uiFeature.description,children:(0,e.jsxs)("div",{className:"flex flex-grow items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex items-center ".concat(t.featured?"font-bold":""),children:[t.icon&&(0,e.jsx)(xn.Z,{type:t.icon,className:"mr-2 ".concat(t.iconClassName)}),n.uiFeature.displayName,n.isLabs&&(0,e.jsx)(Ge.DR,{className:"px-1.5 py-0.5",style:"success",children:"Labs"}),n.uiFeature.featureIdentifier===r.NativeFeatureIdentifier.TYPES.SuperEditor&&!b(n)&&E&&(0,e.jsx)(Ge.DR,{className:"px-1.5 py-0.5 text-[9px]",style:"info",children:"Recommended"})]}),!n.isEntitled&&(0,e.jsx)(xn.Z,{type:Mn._,className:Mn.K})]})},n.uiFeature.uniqueIdentifier.value)))},n)}))]}),(0,e.jsx)(Fr,{isOpen:y,close:I,children:o&&(0,e.jsx)(Wc,{note:o,application:n,onComplete:S,closeDialog:I})}),(0,e.jsx)(Fr,{isOpen:v,close:_,className:"md:h-full md:max-h-[90%]",children:o&&g&&(0,e.jsx)(iu,{note:o,convertTo:g,closeDialog:_,onComplete:S})})]})},su=t=>{let{application:n,note:r,iconClassName:i,disabled:o}=t;const[s,a]=(0,He.useState)(!1),l=(0,He.useRef)(null),c=(0,He.useRef)(null),u=(0,He.useCallback)((async()=>{a((e=>!e))}),[]),d=(0,He.useMemo)((()=>n.keyboardService.keyboardShortcutForCommand(L.AX)),[n]);return(0,e.jsxs)("div",{ref:l,children:[(0,e.jsxs)(ci.Z,{className:"justify-between",onClick:u,onKeyDown:e=>{e.key===L.u8.Escape&&a(!1)},disabled:o,ref:c,children:[(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)(xn.Z,{type:"dashboard",className:"".concat(i," mr-2 text-neutral")}),"Change note type"]}),(0,e.jsxs)("div",{className:"flex",children:[d&&(0,e.jsx)(Hr.J,{className:"mr-2",shortcut:d}),(0,e.jsx)(xn.Z,{type:"chevron-right",className:"text-neutral"})]})]}),(0,e.jsx)(On.Z,{title:"Change note type",align:"start",anchorElement:c,className:"md:pb-1",open:s,side:"right",togglePopover:u,children:(0,e.jsx)(ou,{application:n,note:r,closeMenu:()=>{a(!1)}})})]})},au=t=>{let{action:n,note:r,application:i,group:o,reloadMenuGroup:s}=t;const[a,l]=(0,He.useState)(!1),c=(0,He.useCallback)((async()=>{a||(l(!0),await i.actions.runAction(n,r),l(!1),s(o).catch(console.error))}),[i,n,o,a,r,s]);return(0,e.jsx)("button",{onClick:c,className:"flex w-full cursor-pointer items-center border-0 bg-transparent px-3 py-2 text-left text-sm text-text hover:bg-contrast hover:text-foreground focus:bg-info-backdrop focus:shadow-none",children:(0,e.jsxs)("div",{className:"flex w-full flex-row items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)("div",{className:"font-semibold",children:n.label}),n.access_type&&(0,e.jsxs)("div",{className:"mt-0.5 text-xs text-passive-0",children:["Uses ",(0,e.jsx)("strong",{children:n.access_type})," access to this note."]})]}),a&&(0,e.jsx)(di.Z,{className:"h-3 w-3"})]})},n.url)},lu=t=>{let{application:n,note:r}=t;const[i,o]=(0,He.useState)([]),[s,a]=(0,He.useState)(!0),[l,c]=(0,He.useState)(!1);(0,He.useEffect)((()=>{(async()=>{n.listed.isNoteAuthorizedForListed(r)||await n.listed.authorizeNoteForListed(r),c(n.listed.isNoteAuthorizedForListed(r))})()}),[n,r]);const u=(0,He.useCallback)((async e=>{if(!l)return;const t=await n.listed.getListedAccountInfo(e.account,r.uuid);if(!t)return;const s={name:t.display_name,account:e.account,actions:t.actions},a=i.map((e=>s.account.authorId===e.account.authorId?s:e));o(a)}),[n,i,r,l]);return(0,He.useEffect)((()=>{(async()=>{if(n.hasAccount()){if(l)try{const e=await n.listed.getListedAccounts();if(!e.length)throw new Error("No Listed accounts found");const t=[];await Promise.all(e.map((async e=>{const i=await n.listed.getListedAccountInfo(e,r.uuid);i?t.push({name:i.display_name,account:e,actions:i.actions}):t.push({name:e.authorId,account:e,actions:[]})}))),o(t.sort(((e,t)=>e.name.toString().toLowerCase()<t.name.toString().toLowerCase()?-1:1)))}catch(e){console.error(e)}finally{a(!1)}}else a(!1)})()}),[n,r.uuid,l]),l?(0,e.jsxs)(e.Fragment,{children:[s&&(0,e.jsx)("div",{className:"flex w-full items-center justify-center p-4",children:(0,e.jsx)(di.Z,{className:"h-5 w-5"})}),!s&&i.length?(0,e.jsx)(e.Fragment,{children:i.map((t=>(0,e.jsx)(Jr.Z,{title:(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)(xn.Z,{type:"notes",className:"mr-2 text-info"})," ",t.name]}),children:t.actions.length?t.actions.map((i=>(0,e.jsx)(au,{action:i,note:r,group:t,application:n,reloadMenuGroup:u},i.url))):(0,e.jsx)("div",{className:"select-none px-3 py-2 text-sm text-passive-0",children:"No actions available"})},t.account.authorId)))}):null,s||i.length?null:(0,e.jsx)("div",{className:"flex w-full items-center justify-center px-4 py-6",children:(0,e.jsx)("div",{className:"select-none text-sm text-passive-0",children:"No Listed accounts found"})})]}):null},cu=t=>{let{application:n,note:r,iconClassName:i}=t;const o=(0,He.useRef)(null),s=(0,He.useRef)(null),[a,l]=(0,He.useState)(!1),c=(0,He.useCallback)((async()=>{n.listed.isNoteAuthorizedForListed(r)||await n.listed.authorizeNoteForListed(r),n.listed.isNoteAuthorizedForListed(r)&&l((e=>!e))}),[n,r]);return(0,e.jsxs)("div",{ref:o,children:[(0,e.jsxs)(ci.Z,{className:"justify-between",onClick:c,onKeyDown:e=>{e.key===L.u8.Escape&&l(!1)},ref:s,children:[(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)(xn.Z,{type:"listed",className:"mr-2 text-neutral ".concat(i)}),"Listed actions"]}),(0,e.jsx)(xn.Z,{type:"chevron-right",className:"text-neutral"})]}),(0,e.jsx)(On.Z,{title:"Listed",togglePopover:c,anchorElement:s,open:a,side:"right",align:"end",className:"px-4 md:px-0 md:pt-0",children:(0,e.jsx)(lu,{application:n,note:r})})]})};var uu=s(43426);const du=(0,Nn.Pi)((t=>{let{navigationController:n,linkingController:i,selectedItems:o,iconClassName:s,disabled:a}=t;const l=(0,sr.I)(),c=(0,He.useRef)(null),u=(0,He.useRef)(null),[d,h]=(0,He.useState)(!1),p=(0,He.useCallback)((()=>{h((e=>!e))}),[]),f=e=>o.every((t=>l.getItemTags(t).find((t=>t.uuid===e.uuid))));return(0,e.jsxs)("div",{ref:c,children:[(0,e.jsxs)(ci.Z,{className:"justify-between",onClick:p,onKeyDown:e=>{e.key===L.u8.Escape&&h(!1)},ref:u,disabled:a,children:[(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)(xn.Z,{type:"hashtag",className:s}),"Add tag"]}),(0,e.jsx)(xn.Z,{type:"chevron-right",className:"text-neutral"})]}),(0,e.jsx)(On.Z,{title:"Add tag",togglePopover:p,anchorElement:u,open:d,side:"right",align:"start",className:"py-2",overrideZIndex:"z-modal",children:(0,e.jsx)(qr.Z,{a11yLabel:"Tag selection menu",className:"!px-0",children:n.tags.map((t=>{var n;return(0,e.jsxs)(ci.Z,{onClick:()=>{f(t)?(e=>{o.forEach((t=>i.unlinkItems(t,e)))})(t):(e=>{o.forEach((t=>i.linkItems(t,e)))})(t)},children:[t.iconString&&(0,e.jsx)(xn.Z,{type:t.iconString,size:"custom",className:"ml-0.5 mr-1.5 h-7 w-7 text-2xl text-neutral lg:h-6 lg:w-6 lg:text-lg"}),(0,e.jsx)("span",{className:(0,r.classNames)("overflow-hidden overflow-ellipsis whitespace-nowrap",f(t)?"font-bold":""),children:null===(n=(0,uu.l)(t,l))||void 0===n?void 0:n.longTitle})]},t.uuid)}))})})]})}));var hu=s(57610),pu=s(35796),fu=s(32204),gu=s(1754);const mu=(e,t)=>t.noteType===r.NoteType.Super?e.getPreference(r.PrefKey.SuperNoteExportFormat,r.PrefDefaults[r.PrefKey.SuperNoteExportFormat]):e.componentManager.editorForNote(t).fileType,yu=(e,t)=>{const n=mu(e,t);return"".concat(t.title,".").concat(n)},vu=new Be,Au=async(e,t,n)=>{const i=mu(e,t);let o;switch(i){case"html":o="text/html";break;case"json":o="application/json";break;case"md":o="text/markdown";break;case"pdf":o="application/pdf";break;default:o="text/plain"}if(t.noteType===r.NoteType.Super){const s=await vu.convertSuperStringToOtherFormat(t.text,i,{embedBehavior:n,getFileItem:t=>e.items.findItem(t),getFileBase64:async t=>{const n=e.items.findItem(t);if(!n)return;const r=await e.filesController.getFileBlob(n);return r?await(0,gu.cN)(r):void 0},pdf:{pageSize:e.getPreference(r.PrefKey.SuperNoteExportPDFPageSize,r.PrefDefaults[r.PrefKey.SuperNoteExportPDFPageSize])}}),a="md"===i&&e.getPreference(r.PrefKey.SuperNoteExportUseMDFrontmatter,r.PrefDefaults[r.PrefKey.SuperNoteExportUseMDFrontmatter]),l="html"===i?((e,t)=>'<!DOCTYPE html>\n<html>\n  <head>\n    <meta charset="utf-8" />\n    <title>'.concat(e.title,"</title>\n    <style>\n").concat(pu.Z.toString(),"\n").concat(hu.Z.toString(),"\n").concat(fu.Z.toString(),'\n    </style>\n  </head>\n  <body style="--font-size: 1rem; --line-height: 1.5; font-size: var(--font-size); line-height: var(--line-height);">\n    ').concat(t,"\n  </body>\n</html>\n"))(t,s):a?((e,t)=>"---\ntitle: ".concat(e.title,"\ncreated_at: ").concat(e.created_at.toISOString(),"\nupdated_at: ").concat(e.serverUpdatedAt.toISOString(),"\nuuid: ").concat(e.uuid,"\n---\n\n").concat(t,"\n"))(t,s):s;return"pdf"===i?await fetch(l).then((e=>e.blob())):new Blob([l],{type:o})}return new Blob([t.text],{type:o})},bu=e=>e.text.includes('"type":"snfile"'),wu=(e,t,n)=>!!(e=>e.noteType===r.NoteType.Super)(e)&&"json"!==t&&"pdf"!==t&&"separate"===n&&bu(e),Su=async(e,t,n)=>{try{const r={},i=vu.getEmbeddedFileIDsFromSuperString(t.text);for(const t of i){const i=e.items.findItem(t);if(!i)continue;const o=await e.filesController.getFileBlob(i);if(!o)continue;r[i.title]=null==r[i.title]?0:r[i.title]+1;let s=i.title;if(r[i.title]>0){const{name:e,ext:t}=(0,Q.parseFileName)(i.title);s="".concat(e,"-").concat(i.uuid,".").concat(t)}n.addBlob((0,Q.parseAndCreateZippableFileName)(s),o)}}catch(e){console.error(e)}},Cu=async(e,t)=>{if(0===t.length)return;const n=e.getPreference(r.PrefKey.SuperNoteExportFormat,r.PrefDefaults[r.PrefKey.SuperNoteExportFormat]),i="pdf"===n?"inline":e.getPreference(r.PrefKey.SuperNoteExportEmbedBehavior,r.PrefDefaults[r.PrefKey.SuperNoteExportEmbedBehavior]);if(1===t.length&&!wu(t[0],n,i))return{blob:await Au(e,t[0],i),fileName:yu(e,t[0])};const o=new((await s.e(612).then(s.bind(s,75612))).fs.FS),{root:a}=o;if(1===t.length&&wu(t[0],n,i)){const n=await Au(e,t[0],i),r=(0,Q.parseAndCreateZippableFileName)(yu(e,t[0]));return a.addBlob(r,n),await Su(e,t[0],a),{blob:await o.exportBlob(),fileName:r+".zip"}}const l={};for(const r of t){const t=await Au(e,r,i),o=(0,Q.parseAndCreateZippableFileName)(yu(e,r));l[o]=null==l[o]?0:l[o]+1;const s=l[o],c=(0,Q.parseAndCreateZippableFileName)(o,s>0?" - ".concat(s):"");if(!wu(r,n,i)){a.addBlob(c,t);continue}const{name:u}=(0,Q.parseFileName)(c),d=a.addDirectory(u);d.addBlob(c,t),await Su(e,r,d)}return{blob:await o.exportBlob(),fileName:"Standard Notes Export - ".concat(e.archiveService.formattedDateForExports(),".zip")}},Eu=()=>(0,e.jsx)("div",{className:"text-center",children:"This item is protected. Please authorize first."});var Iu=s(97638);const _u=(e,t)=>{const{words:n,characters:r,paragraphs:i}=(0,He.useMemo)((()=>(e=>{try{return JSON.parse(e),{characters:"N/A",words:"N/A",paragraphs:"N/A"}}catch(t){const n=e.length,r=(e=>0===e.trim().length?0:e.split(/\s+/).length)(e),i=(e=>0===e.trim().length?0:e.replace(/\n$/gm,"").split(/\n/).length)(e);return{characters:n,words:r,paragraphs:i}}})(t.text)),[t.text]),o=(0,He.useMemo)((()=>"number"==typeof n?(e=>{const t=Math.round(e/200);return 0===t?"< 1 minute":"".concat(t," ").concat(t>1?"minutes":"minute")})(n):"N/A"),[n]),s=(0,He.useMemo)((()=>(0,je.Eu)(t.userModifiedDate)),[t.userModifiedDate]),a=(0,He.useMemo)((()=>(0,je.Eu)(t.serverUpdatedAt)),[t.serverUpdatedAt]),l=(0,He.useMemo)((()=>(0,je.Eu)(t.created_at)),[t.created_at]),c=(0,He.useMemo)((()=>new Blob([t.text]).size),[t.text]),u=e.componentManager.editorForNote(t).fileType;return{size:c,words:n,characters:r,paragraphs:i,readTime:o,userModifiedDate:s,serverUpdatedAt:a,dateCreated:l,format:u}},xu=t=>{let{application:n,note:i,className:o}=t;const{size:s,words:a,characters:l,paragraphs:c,readTime:u,userModifiedDate:d,dateCreated:h,format:p}=_u(n,i),f="number"==typeof a&&("txt"===p||"md"===p);return(0,e.jsxs)("div",{className:(0,r.classNames)("select-text px-3 py-1.5 text-sm font-medium text-neutral lg:text-xs",o),children:[f?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"mb-1",children:[a," words · ",l," characters · ",c," paragraphs"]}),(0,e.jsxs)("div",{className:"mb-1",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Read time:"})," ",u]})]}):null,(0,e.jsxs)("div",{className:"mb-1",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Last modified:"})," ",d]}),(0,e.jsxs)("div",{className:"mb-1",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Created:"})," ",h]}),(0,e.jsxs)("div",{className:"mb-1",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Note ID:"})," ",i.uuid]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("span",{className:"font-semibold",children:"Size:"})," ",(0,co.vU)(s)]})]})},Pu="text-neutral mr-2 ".concat(Iu.t),ku=t=>{let{editorForNote:n,notesController:r,note:i,disabled:o}=t;const s=n.featureDescription.spellcheckControl,a=!s||(i?r.getSpellcheckStateForNote(i):void 0);return(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsxs)(Dn.Z,{checked:Boolean(a),onChange:()=>{r.toggleGlobalSpellcheckForNote(i).catch(console.error)},disabled:o||!s,children:[(0,e.jsx)(xn.Z,{type:"notes",className:Pu}),"Spellcheck"]}),!s&&(0,e.jsx)("p",{className:"px-3 py-1.5 text-xs",children:"Spellcheck cannot be controlled for this editor."})]})},Bu=t=>{let{note:n}=t;return new Blob([n.text]).size>pt.Cp?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(oo.Z,{classes:"mt-2"}),(0,e.jsxs)("div",{className:"bg-warning-faded relative flex items-center px-3 py-3.5",children:[(0,e.jsx)(xn.Z,{type:"warning",className:"mr-3 flex-shrink-0 text-accessory-tint-3"}),(0,e.jsx)("div",{className:"leading-140% max-w-80% select-none text-warning",children:"This note may have trouble syncing to the mobile application due to its size."})]})]}):null},Ou=t=>{let{closeMenu:n}=t;const r=(0,Bn.o)(),i=(0,He.useMemo)((()=>r.keyboardShortcutForCommand(L.YN)),[r]),o=(0,He.useMemo)((()=>r.keyboardShortcutForCommand(L.Ix)),[r]),s=(0,He.useCallback)((()=>{r.triggerCommand(L.YN)}),[r]),a=(0,He.useCallback)((()=>{r.triggerCommand(L.Ix),n()}),[n,r]);return(0,e.jsxs)(Jr.Z,{children:[(0,e.jsxs)(ci.Z,{onClick:a,children:[(0,e.jsx)(xn.Z,{type:"search",className:Pu}),"Find in note",o&&(0,e.jsx)(Hr.J,{className:"ml-auto",shortcut:o})]}),(0,e.jsxs)(ci.Z,{onClick:s,children:[(0,e.jsx)(xn.Z,{type:"markdown",className:Pu}),"Show Markdown",i&&(0,e.jsx)(Hr.J,{className:"ml-auto",shortcut:i})]})]})},Nu=t=>{let{notes:n,exportNotes:i,close:o}=t;const s=(0,sr.I)(),a=(0,Er.Z)(r.PrefKey.SuperNoteExportFormat),l=(0,Er.Z)(r.PrefKey.SuperNoteExportEmbedBehavior),c=(0,Er.Z)(r.PrefKey.SuperNoteExportUseMDFrontmatter),u=(0,Er.Z)(r.PrefKey.SuperNoteExportPDFPageSize);(0,He.useEffect)((()=>{"json"===a&&"separate"===l&&s.setPreference(r.PrefKey.SuperNoteExportEmbedBehavior,"reference"),"md"===a&&"reference"===l&&s.setPreference(r.PrefKey.SuperNoteExportEmbedBehavior,"separate"),"pdf"===a&&"inline"!==l&&s.setPreference(r.PrefKey.SuperNoteExportEmbedBehavior,"inline")}),[s,l,a]);const d=n.some(bu),h=!["json","pdf"].includes(a);return(0,e.jsxs)(Gn,{title:"Export notes",className:"p-4",close:o,actions:[{label:"Cancel",type:"cancel",onClick:o,mobileSlot:"left"},{label:"Export",type:"primary",onClick:()=>{o(),i()},mobileSlot:"right"}],children:[(0,e.jsxs)("div",{className:"mb-2",children:[(0,e.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[(0,e.jsxs)("div",{className:"text-base",children:["Choose export format ",n.length>1?"for Super notes":""]}),(0,e.jsx)(wi.Z,{label:"Export format",items:[{label:"Super (.json)",value:"json"},{label:"Markdown (.md)",value:"md"},{label:"HTML",value:"html"},{label:"PDF",value:"pdf"}],value:a,onChange:e=>{s.setPreference(r.PrefKey.SuperNoteExportFormat,e)},classNameOverride:{wrapper:"w-full md:w-fit"}})]}),"md"===a&&(0,e.jsx)("div",{className:"mt-2 text-xs text-passive-0",children:"Note that conversion to Markdown is not lossless. Some features like collapsible blocks and formatting like superscript/subscript may not be correctly converted."})]}),"pdf"===a&&(0,e.jsxs)("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-2",children:[(0,e.jsx)("div",{className:"text-base",children:"Page size"}),(0,e.jsx)(wi.Z,{label:"Page size",items:[{label:"A3",value:"A3"},{label:"A4",value:"A4"},{label:"Letter",value:"LETTER"},{label:"Legal",value:"LEGAL"},{label:"Tabloid",value:"TABLOID"}],value:u,onChange:e=>{s.setPreference(r.PrefKey.SuperNoteExportPDFPageSize,e)},classNameOverride:{wrapper:"w-full md:w-fit"}})]}),"md"===a&&(0,e.jsx)("div",{className:"mt-4",children:(0,e.jsx)(po.Z,{checked:c,onChange:e=>{s.setPreference(r.PrefKey.SuperNoteExportUseMDFrontmatter,e)},className:"!flex items-center",children:(0,e.jsx)("span",{className:"ml-2",children:"Export with frontmatter"})})}),h&&d&&(0,e.jsxs)("div",{className:"mb-2 mt-4 flex flex-wrap items-center justify-between gap-2",children:[(0,e.jsx)("div",{className:"text-base",children:"Embedded files"}),(0,e.jsx)(wi.Z,{label:"Embedded files",items:[{label:"Inline",value:"inline"},{label:"Export separately",value:"separate"}].concat("md"!==a?[{label:"Keep as reference",value:"reference"}]:[]),value:l,onChange:e=>{s.setPreference(r.PrefKey.SuperNoteExportEmbedBehavior,e)}})]})]})},Du=(0,Nn.Pi)((t=>{let{items:n}=t;const i=(0,sr.I)(),o=i.vaults.getVaults(),s=(0,He.useCallback)((async e=>{if(!i.vaultLocks.isVaultLocked(e)||await i.vaultDisplayService.unlockVault(e))for(const t of n){const n=await i.vaults.moveItemToVault(e,t);n.isFailed()&&console.error(n.getError())}}),[i,n]),a=(0,He.useCallback)((async()=>{for(const e of n){const t=i.vaults.getItemVault(e);if(t){if(i.vaultLocks.isVaultLocked(t)&&!await i.vaultDisplayService.unlockVault(t))return;await i.vaults.removeItemFromVault(e)}}}),[i,n]),l=e=>n.every((t=>t.key_system_identifier===e.systemIdentifier)),c=n.some((e=>i.vaults.isItemInVault(e))),u=1===n.length?i.vaults.getItemVault(n[0]):void 0;return(0,e.jsxs)(qr.Z,{a11yLabel:"Vault selection menu",children:[c&&(0,e.jsxs)(ci.Z,{onClick:()=>{a()},children:[(0,e.jsx)(xn.Z,{type:"close",className:"mr-2 text-neutral"}),"Move out of ",u?u.name:"vaults"]}),!o.length&&(0,e.jsx)("div",{className:"flex flex-col items-center justify-center py-1",children:"No vaults found"}),o.map((t=>u?null:(0,e.jsxs)(ci.Z,{onClick:()=>{l(t)?a():s(t)},className:l(t)?"font-bold":"",disabled:t.isSharedVaultListing()&&i.vaultUsers.isCurrentUserReadonlyVaultMember(t),children:[(0,e.jsx)(xn.Z,{type:t.iconString,size:"custom",className:(0,r.classNames)("mr-2 h-6 w-6 text-neutral md:h-5 md:w-5",l(t)?"text-info":"")}),(0,e.jsxs)("div",{className:"flex w-full items-center",children:[t.name,i.vaultLocks.isVaultLocked(t)&&(0,e.jsx)(xn.Z,{className:"ml-1",type:"lock",size:"small"})]})]},t.uuid)))]})})),ju=(0,Nn.Pi)((t=>{let{iconClassName:n,items:r,disabled:i}=t;const o=(0,sr.I)(),s=(0,He.useRef)(null),[a,l]=(0,He.useState)(!1),c=(0,He.useCallback)((()=>{l((e=>!e))}),[]);return o.featuresController.isVaultsEnabled()?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(ci.Z,{className:"justify-between",onClick:c,onKeyDown:e=>{e.key===L.u8.Escape&&l(!1)},ref:s,disabled:i,children:[(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)(xn.Z,{type:"safe-square",className:n}),"Move to vault"]}),(0,e.jsx)(xn.Z,{type:"chevron-right",className:"text-neutral"})]}),(0,e.jsx)(On.Z,{title:"Move to vault",togglePopover:c,anchorElement:s,open:a,side:"right",align:"start",className:"py-2",overrideZIndex:"z-modal",children:(0,e.jsx)(Du,{items:r})})]}):null}));var Tu=s(54502);const Mu=Iu.t,Fu="text-danger mr-2 ".concat(Mu),Ru="text-warning mr-2 ".concat(Mu),Lu="text-success mr-2 ".concat(Mu),Qu=(0,Nn.Pi)((t=>{let{notes:n,closeMenu:i}=t;const o=(0,sr.I)(),[s,a]=(0,He.useState)(!1),{toggleAppPane:l}=(0,Zr.G)(),c=e=>{const t=n.filter(e),r=n.filter((t=>!e(t)));return t.length>r.length},u=c((e=>e.hidePreview)),d=c((e=>e.locked)),h=c((e=>e.protected)),p=n.some((e=>e.archived)),f=n.some((e=>!e.archived)),g=n.some((e=>e.trashed)),m=n.some((e=>!e.trashed)),y=n.some((e=>e.pinned)),v=n.some((e=>!e.pinned)),A=n.some((e=>e.starred)),b=(0,He.useMemo)((()=>n[0]?o.componentManager.editorForNote(n[0]):void 0),[o.componentManager,n]);(0,He.useEffect)((()=>{const e=o.keyboardService.addCommandHandler({command:L.Ur,onKeyDown:()=>{a(!0)},onKeyUp:()=>{a(!1)}});return()=>{e()}}),[o]);const[w,S]=(0,He.useState)(!1),C=(0,He.useCallback)((()=>{S(!1)}),[]),E=(0,He.useCallback)((async()=>{if(0===n.length)return;const e=(0,Y.fz)({type:Y.pC.Progress,message:"Exporting ".concat(n.length," ").concat((0,r.pluralize)(n.length,"note","notes"),"...")});try{const t=await Cu(o,n);if(!t)return;const{blob:r,fileName:i}=t;(0,so.c)({archiveService:o.archiveService,platform:o.platform,mobileDevice:o.mobileDevice,blob:r,filename:i,isNativeMobileWeb:o.isNativeMobileWeb()}),(0,Y.Xd)(e)}catch(t){console.error(t),(0,Y.fz)({type:Y.pC.Error,message:"Could not export notes"}),(0,Y.Xd)(e)}}),[o,n]),I=(0,He.useCallback)((()=>{n.some((e=>e.noteType===r.NoteType.Super))?S(!0):E().catch(console.error)}),[E,n]),_=(0,He.useCallback)((()=>{Cu(o,n).then((e=>{if(!e)return;const{blob:t,fileName:n}=e;(0,Tu.t)(o.mobileDevice,o.isNativeMobileWeb(),t,n).catch(console.error)})).catch(console.error)}),[o,n]),x=(0,He.useCallback)((()=>{matchMedia(et.Jj.sm).matches&&l($e.n.Items),i()}),[i,l]),P=(0,He.useCallback)((async()=>{await Promise.all(n.map((e=>o.mutator.duplicateItem(e).then((e=>(0,Y.fz)({type:Y.pC.Regular,message:'Duplicated note "'.concat(e.title,'"'),actions:[{label:"Open",handler:t=>{o.itemListController.selectUuids([e.uuid],!0).catch(console.error),(0,Y.Xd)(t)}}],autoClose:!0}))).catch(console.error)))),o.sync.sync(),x()}),[o.mutator,o.itemListController,o.sync,x,n]),k=(0,He.useCallback)((()=>{o.historyModalController.openModal(o.notesController.firstSelectedNote)}),[o.historyModalController,o.notesController.firstSelectedNote]),B=(0,He.useMemo)((()=>o.keyboardService.keyboardShortcutForCommand(L.Ek)),[o]),O=(0,He.useMemo)((()=>o.keyboardService.keyboardShortcutForCommand(L.Ib)),[o]),N=(0,He.useMemo)((()=>o.keyboardService.keyboardShortcutForCommand(L.Ak)),[o]),D=(0,He.useCallback)((()=>{o.keyboardService.triggerCommand(L.Wu)}),[o.keyboardService]),j=(0,He.useMemo)((()=>o.keyboardService.keyboardShortcutForCommand(L.Wu)),[o]);if(n.some((e=>!o.isAuthorizedToRenderItem(e))))return(0,e.jsx)(Eu,{});const T=n.some((e=>{var t;return null===(t=o.vaults.getItemVault(e))||void 0===t?void 0:t.isSharedVaultListing()})),M=n.some((e=>{const t=o.vaults.getItemVault(e);return(null==t?void 0:t.isSharedVaultListing())&&o.vaultUsers.isCurrentUserReadonlyVaultMember(t)})),F=n.every((e=>{const t=o.vaults.getItemVault(e);return!(null==t?void 0:t.isSharedVaultListing())||o.vaultUsers.isCurrentUserSharedVaultAdmin(t)}));return 0===n.length?null:(0,e.jsxs)(e.Fragment,{children:[1===n.length&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Jr.Z,{children:(0,e.jsxs)(ci.Z,{onClick:k,children:[(0,e.jsx)(xn.Z,{type:"history",className:Pu}),"Note history",B&&(0,e.jsx)(Hr.J,{className:"ml-auto",shortcut:B})]})}),(0,e.jsx)(Jr.Z,{children:(0,e.jsxs)(ci.Z,{onClick:D,disabled:M,children:[(0,e.jsx)(xn.Z,{type:"line-width",className:Pu}),"Editor width",j&&(0,e.jsx)(Hr.J,{className:"ml-auto",shortcut:j})]})})]}),(0,e.jsxs)(Jr.Z,{children:[(0,e.jsxs)(Dn.Z,{checked:d,onChange:e=>{o.notesController.setLockSelectedNotes(e)},disabled:M,children:[(0,e.jsx)(xn.Z,{type:"pencil-off",className:Pu}),"Prevent editing"]}),(0,e.jsxs)(Dn.Z,{checked:!u,onChange:e=>{o.notesController.setHideSelectedNotePreviews(!e)},disabled:M,children:[(0,e.jsx)(xn.Z,{type:"rich-text",className:Pu}),"Show preview"]}),(0,e.jsxs)(Dn.Z,{checked:h,onChange:e=>{o.notesController.setProtectSelectedNotes(e).catch(console.error)},disabled:M,children:[(0,e.jsx)(xn.Z,{type:"lock",className:Pu}),"Password protect"]})]}),1===n.length&&(0,e.jsx)(Jr.Z,{children:(0,e.jsx)(su,{iconClassName:Pu,application:o,note:n[0],disabled:M})}),(0,e.jsxs)(Jr.Z,{className:n.length>1?"md:!mb-2":"",children:[o.featuresController.isVaultsEnabled()&&(0,e.jsx)(ju,{iconClassName:Pu,items:n,disabled:!F}),o.navigationController.tagsCount>0&&(0,e.jsx)(du,{iconClassName:Pu,navigationController:o.navigationController,selectedItems:n,linkingController:o.linkingController,disabled:M}),(0,e.jsxs)(ci.Z,{onClick:()=>{o.notesController.setStarSelectedNotes(!A)},disabled:M,children:[(0,e.jsx)(xn.Z,{type:"star",className:Pu}),A?"Unstar":"Star",N&&(0,e.jsx)(Hr.J,{className:"ml-auto",shortcut:N})]}),v&&(0,e.jsxs)(ci.Z,{onClick:()=>{o.notesController.setPinSelectedNotes(!0)},disabled:M,children:[(0,e.jsx)(xn.Z,{type:"pin",className:Pu}),"Pin to top",O&&(0,e.jsx)(Hr.J,{className:"ml-auto",shortcut:O})]}),y&&(0,e.jsxs)(ci.Z,{onClick:()=>{o.notesController.setPinSelectedNotes(!1)},disabled:M,children:[(0,e.jsx)(xn.Z,{type:"unpin",className:Pu}),"Unpin",O&&(0,e.jsx)(Hr.J,{className:"ml-auto",shortcut:O})]}),(0,e.jsxs)(ci.Z,{onClick:I,children:[(0,e.jsx)(xn.Z,{type:"download",className:Pu}),"Export"]}),o.platform===r.Platform.Android&&(0,e.jsxs)(ci.Z,{onClick:_,children:[(0,e.jsx)(xn.Z,{type:"share",className:Pu}),"Share"]}),(0,e.jsxs)(ci.Z,{onClick:P,disabled:M,children:[(0,e.jsx)(xn.Z,{type:"copy",className:Pu}),"Duplicate"]}),f&&(0,e.jsxs)(ci.Z,{onClick:async()=>{await o.notesController.setArchiveSelectedNotes(!0).catch(console.error),x()},disabled:M,children:[(0,e.jsx)(xn.Z,{type:"archive",className:Ru}),(0,e.jsx)("span",{className:"text-warning",children:"Archive"})]}),p&&(0,e.jsxs)(ci.Z,{onClick:async()=>{await o.notesController.setArchiveSelectedNotes(!1).catch(console.error),x()},disabled:M,children:[(0,e.jsx)(xn.Z,{type:"unarchive",className:Ru}),(0,e.jsx)("span",{className:"text-warning",children:"Unarchive"})]}),m&&(s?(0,e.jsxs)(ci.Z,{disabled:M,onClick:async()=>{await o.notesController.deleteNotesPermanently(),x()},children:[(0,e.jsx)(xn.Z,{type:"close",className:"mr-2 text-danger"}),(0,e.jsx)("span",{className:"text-danger",children:"Delete permanently"})]}):(0,e.jsxs)(ci.Z,{onClick:async()=>{await o.notesController.setTrashSelectedNotes(!0),x()},disabled:M,children:[(0,e.jsx)(xn.Z,{type:"trash",className:Fu}),(0,e.jsx)("span",{className:"text-danger",children:"Move to trash"})]})),g&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(ci.Z,{onClick:async()=>{await o.notesController.setTrashSelectedNotes(!1),x()},disabled:M,children:[(0,e.jsx)(xn.Z,{type:"restore",className:Lu}),(0,e.jsx)("span",{className:"text-success",children:"Restore"})]}),(0,e.jsxs)(ci.Z,{disabled:M,onClick:async()=>{await o.notesController.deleteNotesPermanently(),x()},children:[(0,e.jsx)(xn.Z,{type:"close",className:"mr-2 text-danger"}),(0,e.jsx)("span",{className:"text-danger",children:"Delete permanently"})]}),(0,e.jsx)(ci.Z,{onClick:async()=>{await o.notesController.emptyTrash(),x()},disabled:M,children:(0,e.jsxs)("div",{className:"flex items-start",children:[(0,e.jsx)(xn.Z,{type:"trash-sweep",className:"mr-2 text-danger"}),(0,e.jsxs)("div",{className:"flex-row",children:[(0,e.jsx)("div",{className:"text-danger",children:"Empty Trash"}),(0,e.jsxs)("div",{className:"text-xs",children:[o.notesController.trashedNotesCount," notes in Trash"]})]})]})})]})]}),1===n.length&&(0,e.jsxs)(e.Fragment,{children:[n[0].noteType===r.NoteType.Super&&(0,e.jsx)(Ou,{closeMenu:i}),!T&&(0,e.jsx)(Jr.Z,{children:(0,e.jsx)(cu,{iconClassName:Pu,application:o,note:n[0]})}),b&&(0,e.jsx)(Jr.Z,{children:(0,e.jsx)(ku,{editorForNote:b,notesController:o.notesController,note:n[0],disabled:M})}),(0,e.jsx)(xu,{className:"mb-2",application:o,note:n[0]}),(0,e.jsx)(Bu,{note:n[0]})]}),(0,e.jsx)(Fr,{isOpen:w,close:C,className:"md:max-w-[25vw]",children:(0,e.jsx)(Nu,{notes:n,exportNotes:E,close:C})})]})})),Uu=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),{contextMenuOpen:n,contextMenuClickLocation:r,setContextMenuOpen:i}=t.notesController,o=()=>i(!n),[s,a]=(0,He.useState)(!1),l=(0,He.useCallback)((e=>{a(e)}),[]);return(0,e.jsx)(On.Z,{title:"Note options",align:"start",anchorPoint:{x:r.x,y:r.y},disableClickOutside:s,open:n,togglePopover:o,children:(0,e.jsx)(qr.Z,{className:"select-none",a11yLabel:"Note context menu",children:(0,e.jsx)(Qu,{notes:t.notesController.selectedNotes,requestDisableClickOutside:l,closeMenu:o})})})})),Vu=(0,He.forwardRef)(((t,n)=>{let{id:r,type:i,label:o,disabled:s,value:a,isInvalid:l,onChange:c,className:u="",labelClassName:d="",inputClassName:h=""}=t;const[p,f]=(0,He.useState)(!1),g="absolute ".concat(p?"text-info":"text-neutral"," ").concat(p||a?"flex top-0 left-2 pt-1.5 px-1":"hidden"," ").concat(l?"text-danger":""," ").concat(d),m="w-full h-full ".concat(p||a?"pt-6 pb-2":"py-2.5"," px-3 text-sm border border-solid border-border rounded placeholder:font-medium focus:ring-info ").concat(l?"border-danger placeholder:text-danger":""," ").concat(h);return(0,e.jsxs)("div",{className:"".concat("relative bg-default"," ").concat(u),children:[(0,e.jsx)("label",{htmlFor:r,className:g,children:o}),(0,e.jsx)("input",{id:r,className:m,placeholder:p?"":o,type:i,value:a,onChange:c,onFocus:()=>f(!0),onBlur:()=>f(!1),ref:n,disabled:s})]})})),Ku=Vu;var Hu=s(66724);const Gu=(0,Nn.Pi)((n=>{let{application:i}=n;const{setCurrentPane:o}=i.purchaseFlowController,[s,a]=(0,He.useState)(""),[l,c]=(0,He.useState)(""),[u,d]=(0,He.useState)(""),[h,p]=(0,He.useState)(!1),[f,g]=(0,He.useState)(!1),[m,y]=(0,He.useState)(!1),[v,A]=(0,He.useState)(""),[b,w]=(0,He.useState)(""),S=(0,He.useCallback)((()=>{p(!0),i.register(s,l,v).then((()=>{i.accountMenuController.closeAccountMenu(),i.accountMenuController.setCurrentPane(qt.V.GeneralMenu)})).catch((e=>{console.error(e),i.alerts.alert(e).catch(console.error)})).finally((()=>{p(!1)}))}),[i,s,v,l]),C=(0,Hu.m)(b,(e=>{A(e),w("")}));(0,He.useEffect)((()=>{v&&S()}),[v,S]);const E=(0,He.useCallback)((()=>{i.getCaptchaUrl().then((e=>{if((0,r.isErrorResponse)(e))throw new Error;const{captchaUIUrl:t}=e.data;t?w(t):(w(""),S())})).catch((e=>{console.error(e),w(""),S()}))}),[i,S]),I=(0,He.useRef)(null),_=(0,He.useRef)(null),x=(0,He.useRef)(null);(0,He.useEffect)((()=>{var e;I.current&&(null===(e=I.current)||void 0===e||e.focus())}),[]);const P=async()=>{var e,n,r,i,o;if(s){if(!(0,t.Ju)(s))return g(!0),void(null===(n=null==I?void 0:I.current)||void 0===n||n.focus());if(l){if(u)return l!==u?(d(""),y(!0),void(null===(o=null==x?void 0:x.current)||void 0===o||o.focus())):void E();null===(i=null==x?void 0:x.current)||void 0===i||i.focus()}else null===(r=null==_?void 0:_.current)||void 0===r||r.focus()}else null===(e=null==I?void 0:I.current)||void 0===e||e.focus()},k=(0,e.jsx)("form",{onSubmit:P,children:(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)(Ku,{className:"min-w-auto md:min-w-90 ".concat(f?"mb-2":"mb-4"),id:"purchase-sign-in-email",type:"email",label:"Email",value:s,onChange:e=>{a(e.target.value),g(!1)},ref:I,disabled:h,isInvalid:f}),f?(0,e.jsx)("div",{className:"mb-4 text-danger",children:"Please provide a valid email."}):null,(0,e.jsx)(Ku,{className:"min-w-auto mb-4 md:min-w-90",id:"purchase-create-account-password",type:"password",label:"Password",value:l,onChange:e=>{c(e.target.value)},ref:_,disabled:h}),(0,e.jsx)(Ku,{className:"min-w-auto md:min-w-90 ".concat(m?"mb-2":"mb-4"),id:"create-account-confirm",type:"password",label:"Repeat password",value:u,onChange:e=>{d(e.target.value),y(!1)},ref:x,disabled:h,isInvalid:m}),m?(0,e.jsx)("div",{className:"mb-4 text-danger",children:"Passwords don't match. Please try again."}):null]})});return(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)(Po.CircleIcon,{className:"absolute -left-28 top-[40%] h-8 w-8"}),(0,e.jsx)(Po.BlueDotIcon,{className:"absolute -left-10 top-[35%] h-4 w-4"}),(0,e.jsx)(Po.DiamondIcon,{className:"absolute -bottom-5 left-0 -z-[1] h-26 w-26 -translate-x-1/2"}),(0,e.jsx)(Po.CircleIcon,{className:"absolute -right-20 bottom-[35%] h-8 w-8"}),(0,e.jsx)(Po.BlueDotIcon,{className:"absolute -right-10 bottom-[25%] h-4 w-4"}),(0,e.jsx)(Po.DiamondIcon,{className:"absolute -right-2 top-0 -z-[1] h-18 w-18 translate-x-1/2"}),(0,e.jsxs)("div",{className:"mr-0 lg:mr-12",children:[(0,e.jsx)("h1",{className:"mb-2 mt-0 text-2xl font-bold",children:"Create your free account"}),(0,e.jsx)("div",{className:"mb-4 text-sm font-medium",children:"to continue to Standard Notes."}),b?C:k,(0,e.jsxs)("div",{className:"flex flex-col-reverse items-start justify-between md:flex-row md:items-center",children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)("button",{onClick:()=>{o(Wt.SignIn)},disabled:h,className:"mb-2 flex cursor-pointer items-start border-0 bg-default p-0 font-medium text-info hover:underline",children:"Sign in instead"}),!i.isNativeIOS()&&(0,e.jsx)("button",{onClick:()=>{i.purchaseFlowController.openPurchaseWebpage()},disabled:h,className:"flex cursor-pointer items-start border-0 bg-default p-0 font-medium text-info hover:underline",children:"Subscribe without account"})]}),(0,e.jsx)(Ln.Z,{className:"mb-4 py-2.5 md:mb-0",primary:!0,label:h?"Creating account...":"Create account",onClick:P,disabled:h})]})]}),(0,e.jsx)(Po.CreateAccountIllustration,{className:"hidden lg:block"})]})})),Yu=(0,Nn.Pi)((n=>{let{application:i}=n;const{setCurrentPane:o}=i.purchaseFlowController,[s,a]=(0,He.useState)(""),[l,c]=(0,He.useState)(""),[u,d]=(0,He.useState)(!1),[h,p]=(0,He.useState)(!1),[f,g]=(0,He.useState)(!1),[m,y]=(0,He.useState)(""),[v,A]=(0,He.useState)(""),[b,w]=(0,He.useState)(!1),[S,C]=(0,He.useState)(""),E=(0,Hu.m)(v,(e=>{C(e),w(!1),A("")})),I=(0,He.useRef)(null),_=(0,He.useRef)(null);(0,He.useEffect)((()=>{var e;I.current&&(null===(e=I.current)||void 0===e||e.focus())}),[]);const x=async()=>{var e,n,o,a;if(s){if(!(0,t.Ju)(s))return p(!0),void(null===(n=null==I?void 0:I.current)||void 0===n||n.focus());if(l)if(v)w(!0);else{d(!0);try{const e=await i.signIn(s,l,void 0,void 0,void 0,void 0,S),t=(0,r.getCaptchaHeader)(e);if(t)return void A(t);if(A(""),(0,r.isErrorResponse)(e))throw new Error(null===(a=e.data.error)||void 0===a?void 0:a.message);i.purchaseFlowController.closePurchaseFlow(),i.purchaseFlowController.openPurchaseFlow()}catch(e){console.error(e),e.toString().includes("Invalid email or password")?(p(!0),g(!0),y("Invalid email or password."),c("")):i.alerts.alert(e).catch(console.error)}finally{d(!1)}}else null===(o=null==_?void 0:_.current)||void 0===o||o.focus()}else null===(e=null==I?void 0:I.current)||void 0===e||e.focus()},P=(0,e.jsxs)("form",{onSubmit:x,children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)(Ku,{className:"min-w-auto sm:min-w-90 ".concat(h&&!m?"mb-2":"mb-4"),id:"purchase-sign-in-email",type:"email",label:"Email",value:s,onChange:e=>{a(e.target.value),p(!1)},ref:I,disabled:u,isInvalid:h}),h&&!m?(0,e.jsx)("div",{className:"mb-4 text-danger",children:"Please provide a valid email."}):null,(0,e.jsx)(Ku,{className:"min-w-auto sm:min-w-90 ".concat(m?"mb-2":"mb-4"),id:"purchase-sign-in-password",type:"password",label:"Password",value:l,onChange:e=>{c(e.target.value),g(!1),y("")},ref:_,disabled:u,isInvalid:f}),m?(0,e.jsx)("div",{className:"mb-4 text-danger",children:m}):null]}),(0,e.jsx)(Ln.Z,{className:"".concat(u?"min-w-30":"min-w-24"," mb-5 py-2.5"),primary:!0,label:u?"Signing in...":"Sign in",onClick:x,disabled:u})]});return(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)(Po.CircleIcon,{className:"absolute -left-56 top-[35%] h-8 w-8"}),(0,e.jsx)(Po.BlueDotIcon,{className:"absolute -left-40 top-[30%] h-4 w-4"}),(0,e.jsx)(Po.DiamondIcon,{className:"absolute -bottom-5 left-0 -z-[1] h-26 w-26 -translate-x-1/2"}),(0,e.jsx)(Po.CircleIcon,{className:"absolute -right-56 bottom-[30%] h-8 w-8"}),(0,e.jsx)(Po.BlueDotIcon,{className:"absolute -right-44 bottom-[20%] h-4 w-4"}),(0,e.jsx)(Po.DiamondIcon,{className:"absolute -right-2 top-0 -z-[1] h-18 w-18 translate-x-1/2"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h1",{className:"mb-2 mt-0 text-2xl font-bold",children:"Sign in"}),(0,e.jsx)("div",{className:"mb-4 text-sm font-medium",children:"to continue to Standard Notes."}),b?E:P,(0,e.jsxs)("div",{className:"text-sm font-medium text-passive-1",children:["Don’t have an account yet?"," ",(0,e.jsx)("a",{className:"text-info ".concat(u?"cursor-not-allowed":"cursor-pointer "),onClick:()=>{u||o(Wt.CreateAccount)},children:"Create account"})]})]})]})})),zu=t=>{let{currentPane:n,application:r}=t;switch(n){case Wt.CreateAccount:return(0,e.jsx)(Gu,{application:r});case Wt.SignIn:return(0,e.jsx)(Yu,{application:r})}},Zu=(0,Nn.Pi)((t=>{let{application:n}=t;const{currentPane:r}=n.purchaseFlowController;return(0,e.jsx)("div",{className:"absolute left-0 top-0 z-purchase-flow flex h-full w-full items-center justify-center overflow-hidden bg-passive-super-light",children:(0,e.jsxs)("div",{className:"relative w-fit",children:[(0,e.jsxs)("div",{className:"rounded-0 relative mb-4 w-full border border-solid border-border bg-default px-8 py-8 md:rounded md:p-12",children:[(0,e.jsx)("button",{className:"absolute right-4 top-4 rounded-full p-1 hover:bg-info-backdrop",onClick:()=>{n.purchaseFlowController.closePurchaseFlow()},children:(0,e.jsx)(xn.Z,{type:"close",className:"text-neutral"})}),(0,e.jsx)(Po.SNLogoFull,{className:"mb-5 h-7"}),(0,e.jsx)(zu,{currentPane:r,application:n})]}),(0,e.jsxs)("div",{className:"flex justify-end px-4 md:px-0",children:[(0,e.jsx)("a",{className:"mr-3 font-medium text-passive-1",href:"https://standardnotes.com/privacy",target:"_blank",rel:"noopener noreferrer",children:"Privacy"}),(0,e.jsx)("a",{className:"font-medium text-passive-1",href:"https://standardnotes.com/help",target:"_blank",rel:"noopener noreferrer",children:"Help"})]})]})})})),Wu=(0,Nn.Pi)((t=>{let{application:n}=t;return n.purchaseFlowController.isOpen?(0,e.jsx)(Zu,{application:n}):null}));var qu=s(91611);const Ju=t=>{let{children:n,isSelected:r,onClick:i}=t;return(0,e.jsxs)("button",{tabIndex:pt.HF,className:"flex w-full cursor-pointer items-center border-0 bg-transparent px-3 py-2.5 text-left text-sm text-text hover:bg-contrast hover:text-foreground focus:bg-info-backdrop focus:shadow-none ".concat(r?"bg-info-backdrop":""),onClick:i,"data-selected":r,children:[(0,e.jsx)(Re.Z,{checked:r,className:"mr-2"}),n]})},Xu=t=>{let{legacyHistory:n,noteHistoryController:r,onSelectRevision:i}=t;const{selectLegacyRevision:o,selectedEntry:s}=r,[a,l]=(0,He.useState)(null);return(0,qu.Z)(a),(0,e.jsxs)("div",{className:"flex h-full w-full flex-col focus:shadow-none ".concat((null==n?void 0:n.length)?"":"items-center justify-center"),ref:l,children:[null==n?void 0:n.map((t=>{var n,r;const a=null===(n=null==s?void 0:s.subactions)||void 0===n?void 0:n[0].url,l=null===(r=t.subactions)||void 0===r?void 0:r[0].url;return(0,e.jsx)(Ju,{isSelected:a===l,onClick:()=>{o(t),i()},children:t.label},l)})),!(null==n?void 0:n.length)&&(0,e.jsx)("div",{className:"select-none text-sm text-passive-0",children:"No legacy history found"})]})},$u=e=>e.toLocaleDateString(void 0,{month:"long",year:"numeric"}),ed="Today",td="This Week",nd="More Than A Year Ago",rd=e=>{const t=[{title:ed,entries:[]},{title:td,entries:[]},{title:nd,entries:[]}];return null==e||e.forEach((e=>{var n,r,i;const o=((e,t)=>{var n;const r=new Date,i=new Date(null!==(n=e.created_at)&&void 0!==n?n:e.payload.updated_at),o=((e,t)=>{const n=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),r=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate());return Math.round((n-r)/pt.jD)})(r,i);if(0===o)return t.findIndex((e=>e.title===ed));if(o>0&&o<pt.Yx)return t.findIndex((e=>e.title===td));if(o>pt.gu)return t.findIndex((e=>e.title===nd));const s=$u(i);return t.findIndex((e=>e.title===s))})(e,t);var s;o>-1?null===(r=null===(n=t[o])||void 0===n?void 0:n.entries)||void 0===r||r.push(e):(s={title:$u(new Date(null!==(i=e.created_at)&&void 0!==i?i:e.payload.updated_at)),entries:[e]},t.splice(t.length-1,0,s))})),t},id=(0,Nn.Pi)((t=>{let{features:n,noteHistoryController:r,onSelectRevision:i}=t;const{remoteHistory:o,isFetchingRemoteHistory:s,selectRemoteRevision:a,selectedEntry:l}=r,[c,u]=(0,He.useState)(null);(0,qu.Z)(c);const d=(0,He.useMemo)((()=>null==o?void 0:o.map((e=>e.entries)).flat().length),[o]);return(0,e.jsxs)("div",{className:"flex h-full w-full flex-col focus:shadow-none ".concat(s||!d?"items-center justify-center":""),ref:u,children:[s&&(0,e.jsx)(di.Z,{className:"h-5 w-5"}),null==o?void 0:o.map((t=>t.entries&&t.entries.length?(0,e.jsxs)(He.Fragment,{children:[(0,e.jsx)("div",{className:"mb-1 mt-2.5 select-none px-3 text-sm font-semibold uppercase text-passive-0",children:t.title}),t.entries.map((t=>{return(0,e.jsx)(Ju,{isSelected:(null==l?void 0:l.uuid)===t.uuid,onClick:()=>{a(t),i()},children:(0,e.jsxs)("div",{className:"flex flex-grow items-center justify-between",children:[(0,e.jsx)("div",{children:(r=t,new Date(r.created_at).toLocaleString())}),!n.hasMinimumRole(t.required_role)&&(0,e.jsx)(xn.Z,{type:Mn._,className:Mn.K})]})},t.uuid);var r}))]},t.title):null)),!d&&!s&&(0,e.jsx)("div",{className:"select-none text-sm text-passive-0",children:"No remote history found"})]})}));var od;!function(e){e.Session="Session",e.Remote="Remote",e.Legacy="Legacy"}(od||(od={}));const sd=(0,Nn.Pi)((t=>{let{noteHistoryController:n,onSelectRevision:r}=t;const{sessionHistory:i,selectedRevision:o,selectSessionRevision:s}=n,[a,l]=(0,He.useState)(null);(0,qu.Z)(a);const c=(0,He.useMemo)((()=>null==i?void 0:i.map((e=>e.entries)).flat().length),[i]);return(0,e.jsxs)("div",{className:"flex h-full w-full flex-col focus:shadow-none ".concat(c?"":"items-center justify-center"),ref:l,children:[null==i?void 0:i.map((t=>t.entries&&t.entries.length?(0,e.jsxs)(He.Fragment,{children:[(0,e.jsx)("div",{className:"mb-1 mt-2.5 select-none px-3 text-sm font-semibold uppercase text-passive-0",children:t.title}),t.entries.map(((t,n)=>(0,e.jsx)(Ju,{isSelected:(null==o?void 0:o.payload.updated_at)===t.payload.updated_at,onClick:()=>{s(t),r()},children:t.previewTitle()},n)))]},t.title):null)),!c&&(0,e.jsx)("div",{className:"select-none text-sm text-passive-0",children:"No session history found"})]})})),ad=(0,Nn.Pi)((t=>{let{features:n,noteHistoryController:r,selectMobileModalTab:i}=t;const{legacyHistory:o,currentTab:s,selectTab:a}=r,l=t=>{let{type:n}=t;const r=s===n;return(0,e.jsx)("button",{className:"relative cursor-pointer border-0 bg-default px-3 py-2.5 text-sm focus:shadow-inner ".concat(r?"font-medium text-info shadow-bottom":"text-text"),onClick:()=>{a(n)},children:n})},c=(0,He.useCallback)((()=>{i("Content")}),[i]);return(0,e.jsxs)("div",{className:"flex h-full flex-grow flex-col overflow-auto border-r border-solid border-border",children:[(0,e.jsxs)("div",{className:"flex border-b border-solid border-border",children:[(0,e.jsx)(l,{type:od.Remote}),(0,e.jsx)(l,{type:od.Session}),o&&o.length>0&&(0,e.jsx)(l,{type:od.Legacy})]}),(0,e.jsx)("div",{className:"h-full min-h-0 overflow-auto py-1.5",children:(0,e.jsx)((()=>{switch(s){case od.Remote:return(0,e.jsx)(id,{onSelectRevision:c,features:n,noteHistoryController:r});case od.Session:return(0,e.jsx)(sd,{onSelectRevision:c,noteHistoryController:r});case od.Legacy:return(0,e.jsx)(Xu,{onSelectRevision:c,legacyHistory:o,noteHistoryController:r})}}),{})})]})})),ld=(0,Nn.Pi)((t=>{let{dismissModal:n,noteHistoryController:r,readonly:i=!1}=t;const{selectedRevision:o,restoreRevision:s,restoreRevisionAsCopy:a,selectedEntry:l,deleteRemoteRevision:c}=r,[u,d]=(0,He.useState)(!1),h=(0,He.useCallback)((()=>{o&&(s(o),n())}),[n,s,o]),p=(0,He.useCallback)((async()=>{o&&(a(o),n())}),[n,a,o]),f=(0,He.useCallback)((async()=>{l&&(d(!0),await c(l),d(!1))}),[c,l]);return(0,e.jsxs)("div",{className:"flex min-h-6 flex-shrink-0 flex-wrap items-center gap-2.5 border-t border-solid border-border px-2.5 py-2 md:justify-between",children:[(0,e.jsx)(Ln.Z,{className:"py-1.35",label:"Close",onClick:n}),o&&l&&!i&&(0,e.jsxs)(e.Fragment,{children:[l.uuid&&(0,e.jsx)(Ln.Z,{className:"md:ml-auto",onClick:f,children:u?(0,e.jsx)(di.Z,{className:"my-1 h-3 w-3"}):"Delete this revision"}),(0,e.jsx)(Ln.Z,{className:l.uuid?"":"md:ml-auto",label:"Restore as a copy",onClick:p}),(0,e.jsx)(Ln.Z,{className:"",label:"Restore version",onClick:h,primary:!0})]})]})})),cd=e=>"Version history is limited to ".concat((e=>{switch(e){case"Core":return"30 days";case"Plus":return"365 days";default:return"the current session's changes"}})(e)," in the ").concat(e," plan"),ud=(0,Nn.Pi)((()=>{const t=(0,sr.I)();let n="free";return t.subscriptions.hasOnlineSubscription()&&(t.subscriptions.isUserSubscriptionCanceled||t.subscriptions.isUserSubscriptionExpired||(n=t.subscriptions.userSubscriptionName)),(0,e.jsx)("div",{className:"flex h-full w-full items-center justify-center",children:(0,e.jsxs)("div",{className:"max-w-40% flex flex-col items-center px-8 text-center",children:[(0,e.jsx)(Po.HistoryLockedIllustration,{}),(0,e.jsx)("div",{className:"mb-1 mt-2 text-lg font-bold",children:"Can't access this version"}),(0,e.jsxs)("div",{className:"leading-140% mb-4 text-passive-0",children:[cd(n),". Learn more about our other plans to upgrade your history capacity."]}),(0,e.jsx)(Ln.Z,{primary:!0,label:"Discover plans",onClick:()=>{window.plansUrl&&window.location.assign(window.plansUrl)}})]})})}));var dd;!function(e){e[e.Idle=0]="Idle",e[e.Loading=1]="Loading",e[e.Loaded=2]="Loaded",e[e.NotEntitled=3]="NotEntitled"}(dd||(dd={}));var hd=s(66743);const pd=n=>{let{note:i,content:o,showLinkedItems:s=!0,scrollPos:a,shouldSyncScroll:l,onScroll:c}=n;const u=(0,sr.I)(),d=(0,xc.o)(),h=(0,et.ac)(et.Jj.sm),p=(0,He.useMemo)((()=>{const e=u.componentManager.editorForNote(i);if(!(0,r.isUIFeatureAnIframeFeature)(e))return;const t=u.items.createTemplateItem(r.ContentType.TYPES.Note,o);return u.componentManager.createComponentViewer(e,{readonlyItem:t})}),[u.componentManager,u.items,o,i]);(0,He.useEffect)((()=>()=>{p&&u.componentManager.destroyComponentViewer(p)}),[u,p]);const f=(0,He.useRef)(null),g=(0,He.useRef)(),m=(0,He.useCallback)((()=>{var e;if(!g.current&&(g.current=null===(e=f.current)||void 0===e?void 0:e.querySelector("textarea, .ContentEditable__root"),g.current&&!(g.current.scrollHeight>g.current.clientHeight))){const e=(0,t.rP)(g.current);e&&(g.current=e)}}),[]);(0,He.useEffect)((()=>{var e;l&&f.current&&(g.current||m(),null===(e=g.current)||void 0===e||e.scrollTo({top:a}))}),[a,m,l]),(0,He.useEffect)((function(){if(i.noteType!==r.NoteType.Super)return;m();const e=g.current;if(!e)return;const t=e=>{null==c||c(e)};return e.addEventListener("scroll",t),()=>{e.removeEventListener("scroll",t)}}),[i.noteType,c,m]);const[y]=(0,Er.D)(r.LocalPrefKey.EditorLineHeight),[v]=(0,Er.D)(r.LocalPrefKey.EditorFontSize),A=Ir(v,!1);return(0,e.jsxs)("div",{className:"flex h-full flex-grow flex-col overflow-hidden",ref:f,children:[(0,e.jsx)("div",{className:(0,r.classNames)("w-full px-4 pt-4 text-base font-bold",p&&"pb-4"),children:(0,e.jsx)("div",{className:"title",children:o.title})}),s&&(0,e.jsx)(hd.Z,{item:i,linkingController:d,readonly:!0,className:{base:"mt-2 px-4",withToggle:"!mt-1 !pt-0"},isCollapsedByDefault:h}),p?(0,e.jsx)("div",{className:"component-view",children:(0,e.jsx)(ru,{componentViewer:p},p.identifier)}):o.noteType===r.NoteType.Super?(0,e.jsx)(As,{children:(0,e.jsx)("div",{className:"w-full flex-grow overflow-hidden overflow-y-auto",style:{"--line-height":r.EditorLineHeightValues[y],"--font-size":A},children:(0,e.jsx)(zn.I,{readonly:!0,initialValue:o.text,children:(0,e.jsx)(Yn.k,{readonly:!0,className:"blocks-editor relative h-full resize-none p-4 text-base focus:shadow-none focus:outline-none",spellcheck:o.spellcheck})},o.text)})}):(0,e.jsx)("div",{className:"relative mt-3 min-h-0 flex-grow overflow-hidden",children:o.text.length?(0,e.jsx)("textarea",{readOnly:!0,className:"font-editor h-full w-full resize-none border-0 bg-default p-4 pt-0 text-editor text-text",value:o.text,onScroll:c}):(0,e.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-passive-0",children:"Empty note."})})]})},fd=(0,Nn.Pi)((t=>{let{noteHistoryController:n,note:r}=t;const{selectedRevision:i,contentState:o}=n;switch(o){case dd.Idle:return(0,e.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 select-none text-sm text-passive-0",children:"No revision selected"});case dd.Loading:return(0,e.jsx)(di.Z,{className:"absolute left-1/2 top-1/2 h-5 w-5 -translate-x-1/2 -translate-y-1/2"});case dd.Loaded:return i?(0,e.jsx)(pd,{note:r,content:i.payload.content,showLinkedItems:!1}):null;case dd.NotEntitled:return(0,e.jsx)(ud,{});default:return null}}));function gd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function md(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gd(Object(n),!0).forEach((function(t){yd(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function yd(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class vd{constructor(e,t,n,i,o,s,a,l,c,u,d,h,p){this.note=e,this.itemListController=t,this.features=n,this.items=i,this.mutator=o,this.sync=s,this.actions=a,this.history=l,this.alerts=c,this._getRevision=u,this._listRevisions=d,this._deleteRevision=h,this._changeAndSaveItem=p,this.remoteHistory=[],this.isFetchingRemoteHistory=!1,this.sessionHistory=[],this.legacyHistory=[],this.selectedRevision=void 0,this.selectedEntry=void 0,this.contentState=dd.Idle,this.currentTab=od.Remote,this.setSelectedRevision=e=>{this.selectedRevision=e},this.setSelectedEntry=e=>{this.selectedEntry=e},this.clearSelection=()=>{this.setSelectedEntry(void 0),this.setSelectedRevision(void 0)},this.selectTab=e=>{this.currentTab=e,this.clearSelection(),this.setContentState(dd.Idle),this.selectFirstRevision()},this.setIsFetchingRemoteHistory=e=>{this.isFetchingRemoteHistory=e},this.setContentState=e=>{this.contentState=e},this.selectRemoteRevision=async e=>{if(this.note){if(!this.features.hasMinimumRole(e.required_role))return this.setContentState(dd.NotEntitled),void this.setSelectedRevision(void 0);this.setContentState(dd.Loading),this.clearSelection();try{this.setSelectedEntry(e);const t=await this._getRevision.execute({itemUuid:this.note.uuid,revisionUuid:e.uuid});if(t.isFailed())throw new Error(t.getError());const n=t.getValue();this.setSelectedRevision(n)}catch(e){this.clearSelection(),console.error(e)}finally{this.setContentState(dd.Loaded)}}},this.selectLegacyRevision=async e=>{var t;if(this.clearSelection(),this.setContentState(dd.Loading),this.note)try{if(!(null===(t=e.subactions)||void 0===t?void 0:t[0]))throw new Error("Could not find revision action url");this.setSelectedEntry(e);const n=await this.actions.runAction(e.subactions[0],this.note);if(!n)throw new Error("Could not fetch revision");this.setSelectedRevision(n.item)}catch(e){console.error(e),this.setSelectedRevision(void 0)}finally{this.setContentState(dd.Loaded)}},this.selectSessionRevision=e=>{this.clearSelection(),this.setSelectedEntry(e),this.setSelectedRevision(e),this.setContentState(dd.Loaded)},this.selectFirstRevision=()=>{switch(this.currentTab){case od.Remote:{const e=this.flattenedRemoteHistory[0];e&&this.selectRemoteRevision(e);break}case od.Session:{const e=this.flattenedSessionHistory[0];e&&this.selectSessionRevision(e);break}case od.Legacy:{const e=this.legacyHistory[0];e&&this.selectLegacyRevision(e);break}}},this.selectPrevOrNextRemoteRevision=e=>{const t=this.flattenedRemoteHistory.findIndex((t=>(null==t?void 0:t.uuid)===e.uuid)),n=this.flattenedRemoteHistory[t-1],r=this.flattenedRemoteHistory[t+1];n?this.selectRemoteRevision(n):r&&this.selectRemoteRevision(r)},this.setRemoteHistory=e=>{this.remoteHistory=e},this.fetchRemoteHistory=async()=>{if(this.setRemoteHistory([]),this.note){this.setIsFetchingRemoteHistory(!0);try{const e=await this._listRevisions.execute({itemUuid:this.note.uuid});if(e.isFailed())throw new Error(e.getError());const t=e.getValue();this.setRemoteHistory(rd(t))}catch(e){console.error(e)}finally{this.setIsFetchingRemoteHistory(!1)}}},this.setLegacyHistory=e=>{this.legacyHistory=e},this.fetchLegacyHistory=async()=>{this.actions.getExtensions().forEach((async e=>{if(!this.note)return;const t=await this.actions.loadExtensionInContextOfItem(e,this.note);t&&(null==t?void 0:t.actions.some((e=>e.verb===r.ActionVerb.Nested)))&&this.setLegacyHistory(t.actions.filter((e=>{var t;return null===(t=e.subactions)||void 0===t?void 0:t[0]})))}))},this.setSessionHistory=e=>{this.sessionHistory=e},this.fetchAllHistory=async()=>{this.resetHistoryState(),this.note&&(this.setSessionHistory(rd(this.history.sessionHistoryForItem(this.note))),await this.fetchRemoteHistory(),await this.fetchLegacyHistory(),this.selectFirstRevision())},this.resetHistoryState=()=>{this.remoteHistory=[],this.sessionHistory=[],this.legacyHistory=[]},this.restoreRevision=async e=>{const t=this.items.findItem(e.payload.uuid);if(null==t?void 0:t.locked)return void this.alerts.alert(ht.ac).catch(console.error);const n=await(0,L.VG)({text:"Are you sure you want to replace the current note's contents with what you see in this preview?",confirmButtonStyle:"danger"});if(!t)throw new Error("Original note not found.");n&&this._changeAndSaveItem.execute(t,(t=>{t.setCustomContent(e.payload.content)}),!0,r.PayloadEmitSource.RemoteRetrieved)},this.restoreRevisionAsCopy=async e=>{const t=this.items.findSureItem(e.payload.uuid),n=await this.mutator.duplicateItem(t,!1,md(md({},e.payload.content),{},{title:e.payload.content.title?e.payload.content.title+" (copy)":void 0}));this.sync.sync(),this.itemListController.selectItem(n.uuid).catch(console.error)},this.deleteRemoteRevision=async e=>{if(!await this.alerts.confirm("Are you sure you want to delete this revision?","Delete revision?","Delete revision",r.ButtonType.Danger,"Cancel")||!this.note)return;const t=await this._deleteRevision.execute({itemUuid:this.note.uuid,revisionUuid:e.uuid});if(t.isFailed())throw new Error(t.getError());this.clearSelection(),this.selectPrevOrNextRemoteRevision(e),await this.fetchRemoteHistory()},(0,_.rC)(this,{selectedRevision:_.LO,setSelectedRevision:_.aD,selectedEntry:_.LO,setSelectedEntry:_.aD,remoteHistory:_.LO,setRemoteHistory:_.aD,isFetchingRemoteHistory:_.LO,setIsFetchingRemoteHistory:_.aD,sessionHistory:_.LO,setSessionHistory:_.aD,legacyHistory:_.LO,setLegacyHistory:_.aD,resetHistoryState:_.aD,currentTab:_.LO,selectTab:_.aD,contentState:_.LO,setContentState:_.aD}),this.fetchAllHistory()}get flattenedRemoteHistory(){return this.remoteHistory.map((e=>e.entries)).flat()}get flattenedSessionHistory(){return this.sessionHistory.map((e=>e.entries)).flat()}}var Ad=s(16786);const bd=(0,Nn.Pi)((t=>{let{dismissModal:n,note:r}=t;const i=(0,sr.I)(),[o]=(0,He.useState)((()=>new vd(r,i.itemListController,i.features,i.items,i.mutator,i.sync,i.actions,i.history,i.alerts,i.getRevision,i.listRevisions,i.deleteRevision,i.changeAndSaveItem))),[s,a]=(0,He.useState)("List"),l=(0,He.useRef)(null),[c,u]=(0,He.useState)(!1),d=()=>u((e=>!e)),{vault:h}=(0,Ad.j)(r),p=!!h&&i.vaultUsers.isCurrentUserReadonlyVaultMember(h);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(Un.Z,{className:"items-center border-b border-border px-2 py-1 md:hidden",children:[(0,e.jsx)(Qn.Z,{type:"secondary",action:d,slot:"left",ref:l,children:(0,e.jsx)("div",{className:"rounded-full border border-border p-0.5",children:(0,e.jsx)(xn.Z,{type:"more"})})}),(0,e.jsxs)(On.Z,{title:"Advanced",open:c,anchorElement:l,disableMobileFullscreenTakeover:!0,togglePopover:d,align:"start",portal:!1,className:"w-1/2 !min-w-0 divide-y divide-border border border-border",children:[(0,e.jsx)("button",{onClick:()=>{a("List"),d()},className:"p-1.5 text-base font-semibold hover:bg-contrast focus:bg-info-backdrop focus:shadow-none focus:outline-none",children:"List"}),(0,e.jsx)("button",{onClick:()=>{a("Content"),d()},className:"p-1.5 text-base font-semibold hover:bg-contrast focus:bg-info-backdrop focus:shadow-none focus:outline-none",children:"Content"})]}),(0,e.jsx)("div",{className:"text-center text-base font-semibold",children:"History"}),(0,e.jsx)(Qn.Z,{type:"primary",slot:"right",action:n,children:"Done"})]}),(0,e.jsxs)("div",{className:"flex min-h-0 flex-grow",children:[(0,e.jsx)("div",{className:(0,Q.classNames)("w-full md:flex md:w-auto md:min-w-60","List"===s?"flex":"hidden"),children:(0,e.jsx)(ad,{features:i.features,noteHistoryController:o,selectMobileModalTab:a})}),(0,e.jsx)("div",{className:(0,Q.classNames)("relative flex-grow flex-col md:flex","Content"===s?"flex":"hidden"),children:(0,e.jsx)(fd,{noteHistoryController:o,note:r})})]}),(0,e.jsx)(ld,{dismissModal:n,noteHistoryController:o,readonly:p})]})})),wd=(0,He.forwardRef)(((n,r)=>{let{children:i,onDismiss:o}=n;const s=(0,Br.I)({open:!0}),a=(0,He.useCallback)((e=>{e&&(e.close=o)}),[o]);return(0,e.jsxs)(Or.Vq,{store:s,"aria-label":"Note revision history",ref:(0,kr.l)([a,r]),className:"fixed left-0 top-0 z-modal h-full w-full",children:[(0,e.jsx)("div",{className:"absolute z-0 h-full w-full bg-passive-5 opacity-0 md:opacity-75",role:"presentation",onClick:o}),(0,e.jsx)("div",{className:(0,Q.classNames)("absolute z-[1] my-0 flex h-full w-full flex-col rounded-md bg-[--modal-background-color]","p-0 pb-safe-bottom pt-safe-top shadow-lg md:max-h-[90%] md:w-[90%] md:max-w-[90%]","md:left-1/2 md:top-1/2 md:-translate-x-1/2 md:-translate-y-1/2 md:transform",(0,t.t2)()),children:i})]})})),Sd=(0,Nn.Pi)((t=>{let{application:n}=t;const r=(0,Kn.x)(),i=Boolean(n.historyModalController.note&&n.isAuthorizedToRenderItem(n.historyModalController.note));(0,He.useEffect)((()=>{let e;return i&&(e=r((()=>(n.historyModalController.dismissModal(),!0)))),()=>{e&&e()}}),[r,n,i]);const o=(0,et.ac)(et.Jj.sm),[s,a]=(0,Nr.vU)(i,o);return s?(0,e.jsx)(wd,{onDismiss:n.historyModalController.dismissModal,ref:a,children:!!n.historyModalController.note&&(0,e.jsx)(bd,{application:n,dismissModal:n.historyModalController.dismissModal,note:n.historyModalController.note})}):null}));function Cd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ed(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Id=n=>{let{application:r,applicationGroup:i}=n;var o,s,a;const l=(null===(o=r.fileBackups)||void 0===o?void 0:o.isFilesBackupsEnabled())||(null===(s=r.fileBackups)||void 0===s?void 0:s.isPlaintextBackupsEnabled())||(null===(a=r.fileBackups)||void 0===a?void 0:a.isTextBackupsEnabled()),c=(0,He.useRef)(null),u=(0,He.useCallback)((()=>{r.accountMenuController.setSigningOut(!1)}),[r.accountMenuController]),d=i.getDescriptors().length>1&&(0,t.Z$)(),h=(0,He.useCallback)((()=>{r.user.signOut().catch(console.error),u()}),[r,u]);return(0,e.jsxs)(Vi,{closeDialog:u,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between text-lg font-bold",children:["Sign out workspace?",(0,e.jsx)("button",{className:"rounded p-1 font-bold hover:bg-contrast",onClick:u,children:(0,e.jsx)(xn.Z,{type:"close"})})]}),(0,e.jsx)("div",{className:"sk-panel-row",children:(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-base text-foreground lg:text-sm",children:ht.X0}),d&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("br",{}),(0,e.jsxs)("p",{className:"text-base text-foreground lg:text-sm",children:[(0,e.jsx)("strong",{children:"Note: "}),"Because you have other workspaces signed in, this sign out may leave logs and other metadata of your session on this device. For a more robust sign out that performs a hard clear of all app-related data, use the ",(0,e.jsx)("i",{children:"Sign out all workspaces"})," option under ",(0,e.jsx)("i",{children:"Switch workspace"}),"."]})]})]})}),l&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(oo.Z,{classes:"my-2"}),(0,e.jsxs)("div",{className:"flex",children:[(0,e.jsx)("div",{className:"sk-panel-row"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-base text-foreground lg:text-sm",children:"Local backups are enabled for this workspace. Review your backup files manually to decide what to keep."}),(0,e.jsx)("button",{className:"sk-a mt-2 cursor-pointer rounded p-0 capitalize lg:text-sm",onClick:()=>{var e;null===(e=r.fileBackups)||void 0===e||e.openAllDirectoriesContainingBackupFiles()},children:"View backup files"})]})]})]}),(0,e.jsxs)("div",{className:"mt-4 flex justify-end gap-2",children:[(0,e.jsx)(Ln.Z,{ref:c,onClick:u,children:"Cancel"}),(0,e.jsx)(Ln.Z,{primary:!0,colorStyle:"danger",onClick:h,children:r.hasAccount()?"Sign Out":"Delete Workspace"})]})]})};Id.displayName="ConfirmSignoutModal";const _d=(0,Nn.Pi)((t=>t.application.accountMenuController.signingOut?(0,e.jsx)(Id,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cd(Object(n),!0).forEach((function(t){Ed(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},t)):null)),xd=(t,n)=>{const r=Si.p[t];return(0,e.jsx)(r,{className:n})},Pd=t=>{let{file:n}=t;return(0,e.jsxs)("div",{className:"flex min-w-70 flex-col p-4",children:[(0,e.jsxs)("div",{className:"mb-4 flex items-center",children:[(0,e.jsx)(xn.Z,{type:"info",className:"mr-2"}),(0,e.jsx)("div",{className:"font-semibold",children:"File information"})]}),(0,e.jsxs)("div",{className:"mb-3",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Type:"})," ",n.mimeType]}),(0,e.jsxs)("div",{className:"mb-3",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Decrypted Size:"})," ",(0,co.vU)(n.decryptedSize)]}),(0,e.jsxs)("div",{className:"mb-3",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Encrypted Size:"})," ",(0,co.vU)(n.encryptedSize)]}),(0,e.jsxs)("div",{className:"mb-3",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Created:"})," ",n.created_at.toLocaleString()]}),(0,e.jsxs)("div",{className:"mb-3",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Last Modified:"})," ",n.userModifiedDate.toLocaleString()]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("span",{className:"font-semibold",children:"File ID:"})," ",n.uuid]})]})};var kd=s(25281),Bd=s(30383);const Od=t=>{let{file:n}=t;const r=(0,sr.I)(),[i,o]=(0,He.useState)(void 0),[s,a]=(0,He.useState)(void 0);(0,He.useEffect)((()=>{var e;null===(e=r.fileBackups)||void 0===e||e.getFileBackupInfo(n).then(o)}),[r,n]),(0,He.useEffect)((()=>{var e;i&&(null===(e=r.fileBackups)||void 0===e||e.getFileBackupAbsolutePath(i).then(a))}),[i,r]);const l=(0,He.useCallback)((()=>{var e;i&&(null===(e=r.fileBackups)||void 0===e||e.openFileBackup(i))}),[i,r]),c=(0,He.useCallback)((()=>{r.openPreferences("backups")}),[r]);return r.fileBackups?(0,e.jsxs)(Jr.Z,{children:[i&&(0,e.jsx)(ci.Z,{icon:"check-circle",iconClassName:"text-success mt-1 ".concat(Iu.t),className:"items-start",onClick:l,children:(0,e.jsxs)("div",{className:"ml-2",children:[(0,e.jsxs)("div",{className:"font-semibold text-success",children:["Backed up on ",(0,je.An)(i.backedUpOn)]}),(0,e.jsx)("div",{className:"text-xs text-neutral",children:s})]})}),!i&&r.fileBackups&&(0,e.jsx)(ci.Z,{icon:"safe-square",className:"items-start",iconClassName:"text-neutral mt-1 ".concat(Iu.t),onClick:c,children:(0,e.jsxs)("div",{className:"ml-2",children:[(0,e.jsx)("div",{children:"Configure file backups"}),(0,e.jsx)("div",{className:"text-xs text-neutral",children:"File not backed up locally"})]})})]}):null},Nd=(0,Nn.Pi)((t=>{let{closeMenu:n,isFileAttachedToNote:r,renameToggleCallback:i,shouldShowRenameOption:o,shouldShowAttachOption:s,selectedFiles:a}=t;const l=(0,sr.I)(),{shouldUseStreamingAPI:c,handleFileAction:u}=l.filesController,{toggleAppPane:d}=(0,Zr.G)(),h=(0,He.useMemo)((()=>a.some((e=>e.protected))),[a]),p=(0,He.useMemo)((()=>a.length>1),[a.length]),f=c&&p,g=(0,He.useMemo)((()=>a.map((e=>e.decryptedSize)).reduce(((e,t)=>e+t),0)),[a]),m=(0,He.useCallback)((()=>{const e=a[0];u({type:cn.d.DetachFileToNote,payload:{file:e}}),n()}),[n,u,a]),y=(0,He.useCallback)((()=>{const e=a[0];u({type:cn.d.AttachFileToNote,payload:{file:e}}),n()}),[n,u,a]),v=(0,He.useCallback)((()=>{d($e.n.Items),n()}),[n,d]),A=a.some((e=>{const t=l.vaults.getItemVault(e);return(null==t?void 0:t.isSharedVaultListing())&&l.vaultUsers.isCurrentUserReadonlyVaultMember(t)})),b=a.every((e=>{const t=l.vaults.getItemVault(e);return!(null==t?void 0:t.isSharedVaultListing())||l.vaultUsers.isCurrentUserSharedVaultAdmin(t)}));return 0===a.length?(0,e.jsx)("div",{className:"text-center",children:"No files selected"}):(0,e.jsxs)(e.Fragment,{children:[1===a.length&&(r||s)&&(0,e.jsx)(Jr.Z,{children:r?(0,e.jsxs)(ci.Z,{onClick:m,children:[(0,e.jsx)(xn.Z,{type:"link-off",className:"mr-2 text-neutral"}),"Detach from note"]}):s?(0,e.jsxs)(ci.Z,{onClick:y,children:[(0,e.jsx)(xn.Z,{type:"link",className:"mr-2 text-neutral"}),"Attach to note"]}):null}),(0,e.jsxs)(Jr.Z,{children:[l.featuresController.isVaultsEnabled()&&(0,e.jsx)(ju,{iconClassName:Pu,items:a,disabled:!b}),(0,e.jsx)(du,{navigationController:l.navigationController,linkingController:l.linkingController,selectedItems:a,iconClassName:"text-neutral mr-2 ".concat(Iu.t),disabled:A}),(0,e.jsxs)(Dn.Z,{checked:h,onChange:e=>{l.filesController.setProtectionForFiles(e,a)},disabled:A,children:[(0,e.jsx)(xn.Z,{type:"lock",className:"mr-2 text-neutral ".concat(Iu.t)}),"Password protect"]})]}),(0,e.jsxs)(Jr.Z,{children:[(0,e.jsxs)(ci.Z,{onClick:()=>{l.filesController.downloadFiles(a),n()},children:[(0,e.jsx)(xn.Z,{type:"download",className:"mr-2 text-neutral ".concat(Iu.t)}),"Download ",f?"separately":""]}),f&&(0,e.jsxs)(ci.Z,{onClick:()=>{l.filesController.downloadFilesAsZip(a).catch((e=>{e instanceof DOMException&&"AbortError"===e.name||(console.error(e),(0,Y.fz)({type:Y.pC.Error,message:e.message||"Failed to download files as archive"}))})),n()},children:[(0,e.jsx)(xn.Z,{type:"download",className:"mr-2 text-neutral ".concat(Iu.t)}),"Download as archive"]}),o&&(0,e.jsxs)(ci.Z,{onClick:()=>{null==i||i(!0)},disabled:A,children:[(0,e.jsx)(xn.Z,{type:"pencil",className:"mr-2 text-neutral ".concat(Iu.t)}),"Rename"]}),(0,e.jsxs)(ci.Z,{onClick:()=>{v(),l.filesController.deleteFilesPermanently(a)},disabled:A,children:[(0,e.jsx)(xn.Z,{type:"trash",className:"mr-2 text-danger ".concat(Iu.t)}),(0,e.jsx)("span",{className:"text-danger",children:"Delete permanently"})]})]}),(0,e.jsx)(Od,{file:a[0]}),(0,e.jsxs)("div",{className:"px-3 pb-0.5 pt-1 text-xs font-medium text-neutral",children:[!p&&(0,e.jsxs)("div",{className:"mb-1",children:[(0,e.jsx)("span",{className:"font-semibold",children:"File ID:"})," ",a[0].uuid]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("span",{className:"font-semibold",children:p?"Total Size:":"Size:"})," ",(0,co.vU)(g)]})]})]})})),Dd=(0,Nn.Pi)((t=>{let{application:n}=t;const{currentFile:i,setCurrentFile:o,otherFiles:s,dismiss:a}=n.filePreviewModalController,[l,c]=(0,He.useState)(!1),u=(0,He.useRef)(null),[d,h]=(0,He.useState)(!1),[p,f]=(0,He.useState)(!1),[g,m]=(0,He.useState)(!1),y=(0,He.useRef)(null),v=(0,He.useRef)(null),A=(0,He.useCallback)((e=>{if(!i)return null;if(![L.u8.Left,L.u8.Right,L.u8.Escape].includes(e.key)||e.target===u.current)return;e.preventDefault();const t=s.findIndex((e=>e.uuid===i.uuid));switch(e.key){case L.u8.Left:{const e=t-1>=0?t-1:s.length-1,n=s[e];n&&o(n);break}case L.u8.Right:{const e=t+1<s.length?t+1:0,n=s[e];n&&o(n);break}case L.u8.Escape:a()}}),[i,a,s,o]),b=(0,He.useMemo)((()=>i?xd((0,Bd.A)(i.mimeType),"w-6 h-6 flex-shrink-0"):null),[i]),w=(0,He.useCallback)((e=>{e&&e.focus()}),[]),S=(0,He.useCallback)((async()=>{if(!i)return null;if(u.current){const e=u.current.value;if(e&&e!==i.name)return await n.mutator.renameFile(i,e),c(!1),void o(n.items.findSureItem(i.uuid));c(!1)}}),[n.items,n.mutator,i,o]),C=(0,et.ac)(et.Jj.sm),E=()=>f((e=>!e)),I=()=>f(!1),_=()=>m((e=>!e)),x=()=>h((e=>!e));if(!i)return null;const P=n.vaults.getItemVault(i),k=(null==P?void 0:P.isSharedVaultListing())&&n.vaultUsers.isCurrentUserReadonlyVaultMember(P);return(0,e.jsx)(Gn,{title:i.name,close:a,actions:[{label:"Done",type:"primary",onClick:a,hidden:!C,mobileSlot:"right"},{label:"Show file options",type:"secondary",onClick:E,hidden:!C},{label:"".concat(g?"Hide":"Show"," file info"),type:"secondary",onClick:_,hidden:!C},{label:"".concat(d?"Hide":"Show"," links section"),type:"secondary",onClick:x,hidden:!C}],customHeader:(0,e.jsx)(e.Fragment,{}),disableCustomHeader:C,children:(0,e.jsxs)("div",{className:"flex h-full w-full flex-col focus:shadow-none focus:outline-none",tabIndex:pt.HF,onKeyDown:A,ref:w,children:[(0,e.jsxs)("div",{className:"hidden min-h-6 flex-shrink-0 flex-wrap items-center justify-between gap-2 border-0 border-b border-solid border-border px-4 py-3 focus:shadow-none md:flex",children:[(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)("div",{className:"h-6 w-6",children:b}),l?(0,e.jsx)(ui.Z,{defaultValue:i.name,className:{container:"ml-3",input:"p-1",right:"items-stretch !p-0"},onKeyDown:e=>{e.key===L.u8.Enter&&S()},right:[(0,e.jsx)("button",{className:"flex h-full items-center justify-center border-l border-border px-2 py-1.5 text-neutral hover:bg-passive-4",title:"Submit",onClick:S,children:(0,e.jsx)(xn.Z,{type:"check",size:"small"})})],ref:(0,kr.l)([u,w])}):(0,e.jsx)("span",{className:"ml-3 font-medium",children:i.name})]}),(0,e.jsxs)("div",{className:"flex items-center",children:[!k&&(0,e.jsx)($r.Z,{label:"Rename file",className:"!z-modal",children:(0,e.jsx)("button",{className:"mr-4 flex cursor-pointer rounded border border-solid border-border bg-transparent p-1.5 hover:bg-contrast",onClick:()=>c((e=>!e)),"aria-label":"Rename file",children:(0,e.jsx)(xn.Z,{type:"pencil-filled",className:"text-neutral"})})}),(0,e.jsx)($r.Z,{label:"Show linked items",className:"!z-modal",children:(0,e.jsx)("button",{className:"mr-4 flex cursor-pointer rounded border border-solid border-border bg-transparent p-1.5 hover:bg-contrast",onClick:x,"aria-label":"Show linked items",children:(0,e.jsx)(xn.Z,{type:"link",className:"text-neutral"})})}),(0,e.jsx)($r.Z,{label:"Show file options",className:"!z-modal",children:(0,e.jsx)("button",{className:"mr-4 flex cursor-pointer rounded border border-solid border-border bg-transparent p-1.5 hover:bg-contrast",onClick:E,ref:y,"aria-label":"Show file options",children:(0,e.jsx)(xn.Z,{type:"more",className:"text-neutral"})})}),(0,e.jsx)(On.Z,{title:"File options",open:p,anchorElement:y,togglePopover:I,side:"bottom",align:"start",className:"md:pb-2",overrideZIndex:"z-modal",children:(0,e.jsx)(qr.Z,{a11yLabel:"File context menu",children:(0,e.jsx)(Nd,{selectedFiles:[i],closeMenu:I,shouldShowRenameOption:!1,shouldShowAttachOption:!1})})}),(0,e.jsx)($r.Z,{label:"Show file info",className:"!z-modal",children:(0,e.jsx)("button",{className:"mr-4 flex cursor-pointer rounded border border-solid border-border bg-transparent p-1.5 hover:bg-contrast",onClick:_,"aria-label":"Show file info",children:(0,e.jsx)(xn.Z,{type:"info",className:"text-neutral"})})}),(0,e.jsx)("button",{ref:v,onClick:a,"aria-label":"Close modal",className:"flex cursor-pointer rounded border-0 bg-transparent p-1 hover:bg-contrast",children:(0,e.jsx)(xn.Z,{type:"close",className:"text-neutral"})})]})]}),d&&(0,e.jsx)("div",{className:"-mt-1 min-h-0 flex-shrink-0 border-b border-border px-3.5 py-1.5",children:(0,e.jsx)(hd.Z,{linkingController:n.linkingController,item:i,readonly:k})}),(0,e.jsxs)("div",{className:"flex min-h-0 flex-grow flex-col-reverse md:flex-row",children:[(0,e.jsx)("div",{className:(0,r.classNames)("relative flex max-w-full flex-grow items-center justify-center",g&&"border-t border-border md:border-b-0 md:border-r"),children:(0,e.jsx)(kd.Z,{file:i,application:n},i.uuid)}),g&&(0,e.jsx)(Pd,{file:i})]})]})})}));Dd.displayName="FilePreviewModal";const jd=(0,Nn.Pi)((t=>{let{application:n}=t;return(0,e.jsx)(Fr,{"aria-label":"File preview modal",isOpen:n.filePreviewModalController.isOpen,close:n.filePreviewModalController.dismiss,className:"md:!h-full md:max-h-[90%] md:!w-full md:max-w-[90%]",autoFocusOnShow:!1,children:(0,e.jsx)(Dd,{application:n})})})),Td=(0,Nn.Pi)((t=>{let{filesController:n,itemListController:r}=t;const{showFileContextMenu:i,setShowFileContextMenu:o,fileContextMenuLocation:s}=n,{selectedFiles:a}=r;return(0,e.jsx)(On.Z,{title:"File options",open:i,anchorPoint:s,togglePopover:()=>o(!i),align:"start",className:"md:pb-2",children:(0,e.jsx)(qr.Z,{a11yLabel:"File context menu",children:(0,e.jsx)(Nd,{selectedFiles:a,closeMenu:()=>o(!1),shouldShowRenameOption:!1,shouldShowAttachOption:!1})})})}));Td.displayName="FileContextMenu";const Md=(0,Nn.Pi)((t=>{let{filesController:n,itemListController:r}=t;const{showFileContextMenu:i}=n,{selectedFiles:o}=r,s=o[0];return i&&s?(0,e.jsx)(Td,{filesController:n,itemListController:r}):null})),Fd=t=>{let{children:n,className:r}=t;const{hasBottomInset:i}=Rn();return(0,e.jsx)("div",{className:(0,Q.classNames)("flex items-center justify-end gap-3 border-t border-border px-4 py-4",i&&"pb-safe-bottom",r),children:n})},Rd=t=>{let{callback:n,component:r,dismiss:i,permissionsString:o}=t;const s=(0,He.useCallback)((()=>{n(!0),i()}),[n,i]),a=(0,He.useCallback)((()=>{n(!1),i()}),[n,i]);return(0,e.jsx)(Gn,{title:"Activate Plugin",close:a,actions:[{label:"Cancel",onClick:a,type:"cancel",mobileSlot:"left"},{label:"Continue",onClick:s,type:"primary",mobileSlot:"right"}],customFooter:(0,e.jsx)(Fd,{className:"hidden md:flex",children:(0,e.jsx)(Ln.Z,{primary:!0,fullWidth:!0,onClick:s,className:"block",children:"Continue"})}),children:(0,e.jsxs)("div",{className:"px-4 py-4",children:[(0,e.jsxs)("div",{className:"text-base",children:[(0,e.jsx)("strong",{children:r.displayName})," would like to interact with your ",o]}),(0,e.jsx)("div",{className:"sk-panel-row [word-break:break-word]",children:(0,e.jsx)("p",{className:"sk-p",children:"Plugins use an offline messaging system to communicate and can only access the current note."})})]})})},Ld=t=>{let{application:n}=t;const[i,o]=(0,He.useState)(),s=(0,He.useCallback)((e=>{o(e)}),[]),a=(0,He.useCallback)((()=>{o(void 0)}),[]),l=(0,He.useCallback)((()=>{n.componentManager.setPermissionDialogUIHandler(s)}),[n,s]);return(0,He.useEffect)((()=>{n.isStarted()&&l();const e=n.addEventObserver((async e=>{e===r.ApplicationEvent.Started&&l()}));return()=>{e()}}),[n,l]),(0,e.jsx)(Fr,{isOpen:!!i,close:a,className:"md:!w-[350px]",children:i&&(0,e.jsx)(Rd,{callback:i.callback,dismiss:a,component:i.component,permissionsString:i.permissionsString})})},Qd=(0,Nn.Pi)((t=>{let{navigationController:n,isEntitledToFolders:i,selectedTag:o}=t;const s=(0,sr.I)(),a=Qr(),{contextMenuOpen:l,contextMenuClickLocation:c}=n,u=(0,He.useCallback)((()=>{i?(n.setContextMenuOpen(!1),n.setAddingSubtagTo(o)):a.activate("Folders")}),[i,n,o,a]),d=(0,He.useCallback)((()=>{n.remove(o,!0).catch(console.error)}),[n,o]),h=(0,He.useMemo)((()=>(0,je.Eu)(o.userModifiedDate)),[o.userModifiedDate]),p=(0,He.useCallback)((()=>{n.setFavorite(o,!o.starred).catch(console.error),n.setContextMenuOpen(!1)}),[n,o]),f=(0,He.useMemo)((()=>(0,je.Eu)(o.created_at)),[o.created_at]),g=(0,He.useRef)(null);(0,He.useEffect)((()=>{l&&setTimeout((()=>{var e;null===(e=g.current)||void 0===e||e.focus()}))}),[l]);const m=(0,He.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!g.current)return;const t=g.current.value.trim();n.save(o,t).catch(console.error).finally((()=>{e&&n.setContextMenuOpen(!1)}))}),[n,o]);return(0,e.jsxs)(On.Z,{title:"Tag options",open:l,anchorPoint:c,togglePopover:()=>n.setContextMenuOpen(!l),className:"py-2",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1 px-4 py-0.5 text-mobile-menu-item md:px-3 md:text-tablet-menu-item lg:text-menu-item",children:[(0,e.jsx)("div",{className:"font-semibold",children:"Name"}),(0,e.jsxs)("div",{className:"flex gap-2.5",children:[(0,e.jsx)(ui.Z,{ref:g,className:{container:"flex-grow",input:"text-mobile-menu-item md:text-tablet-menu-item lg:text-menu-item"},defaultValue:o.title,onBlur:()=>m(),onKeyDown:e=>{e.key===L.u8.Enter&&m(!0)}},o.uuid),(0,e.jsx)("button",{"aria-label":"Save tag name",className:"rounded border border-border bg-transparent px-1.5 active:bg-default translucent-ui:border-[--popover-border-color] md:hidden",onClick:()=>m(!0),children:(0,e.jsx)(xn.Z,{type:"check"})})]})]}),(0,e.jsx)(oo.Z,{classes:"my-2"}),(0,e.jsxs)(qr.Z,{a11yLabel:"Tag context menu",children:[(0,e.jsx)(Ei,{onIconChange:e=>{n.setIcon(o,e||r.DefaultTagIconName)},selectedValue:o.iconString,platform:s.platform,className:"py-1.5 md:px-3",useIconGrid:!0,iconGridClassName:"max-h-30",autoFocus:!1},o.uuid),(0,e.jsxs)(Jr.Z,{children:[s.featuresController.isVaultsEnabled()&&(0,e.jsx)(ju,{iconClassName:"mr-2 text-neutral",items:[o]}),(0,e.jsx)(ci.Z,{className:"justify-between py-1.5",onClick:p,children:(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)(xn.Z,{type:"star",className:"mr-2 text-neutral"}),o.starred?"Unfavorite":"Favorite"]})}),(0,e.jsxs)(ci.Z,{className:"justify-between py-1.5",onClick:u,children:[(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)(xn.Z,{type:"add",className:"mr-2 text-neutral"}),"Add subtag"]}),!i&&(0,e.jsx)(xn.Z,{type:Mn._,className:Mn.K})]}),(0,e.jsxs)(ci.Z,{className:"py-1.5",onClick:d,children:[(0,e.jsx)(xn.Z,{type:"trash",className:"mr-2 text-danger"}),(0,e.jsx)("span",{className:"text-danger",children:"Delete"})]})]})]}),(0,e.jsx)(oo.Z,{classes:"my-2"}),(0,e.jsxs)("div",{className:"px-4 pb-1.5 pt-1 text-sm font-medium text-neutral md:px-3 lg:text-xs",children:[(0,e.jsxs)("div",{className:"mb-1",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Last modified:"})," ",h]}),(0,e.jsxs)("div",{className:"mb-1",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Created:"})," ",f]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("span",{className:"font-semibold",children:"Tag ID:"})," ",o.uuid]})]})]})})),Ud=(0,Nn.Pi)((t=>{let{navigationController:n,featuresController:i}=t;const o=n.contextMenuTag;return o&&o instanceof r.SNTag?(0,e.jsx)(Qd,{navigationController:n,isEntitledToFolders:i.hasFolders,selectedTag:o}):null})),Vd=(e,t)=>{var n;const r=null===(n=e.dataTransfer)||void 0===n?void 0:n.items;return!!r&&Array.from(r).some((e=>"file"===e.kind&&!((e,t)=>{var n;const r=(null===(n=e.getAsFile())||void 0===n?void 0:n.name)||"";return!1!==t.files.isFileNameFileBackupRelated(r)})(e,t)))};var Kd=s(65737);const Hd=(0,He.createContext)(null),Gd=()=>{const e=(0,He.useContext)(Hd);if(!e)throw new Error("Current component must be a child of <FileDragNDropProvider />");return e},Yd=(0,He.memo)((t=>{let{children:n}=t;return(0,e.jsx)(e.Fragment,{children:n})})),zd=t=>{let{application:n,children:r}=t;const i=Qr(),[o,s]=(0,He.useState)(!1),[a,l]=(0,He.useState)(""),c=(0,He.useRef)(null),u=(0,He.useCallback)((e=>{if(c.current){const t=e.getBoundingClientRect();c.current.style.width="".concat(t.width,"px"),c.current.style.height="".concat(t.height,"px"),c.current.style.transform="translate(".concat(t.x,"px, ").concat(t.y,"px)")}}),[]),d=(0,He.useCallback)((()=>{c.current&&(c.current.style.width="",c.current.style.height="",c.current.style.transform="")}),[]),h=(0,He.useRef)(new Map),p=(0,He.useCallback)(((e,t)=>{e.setAttribute("data-file-drag-target",""),h.current.set(e,t)}),[]),f=(0,He.useCallback)((e=>{e.removeAttribute("data-file-drag-target"),h.current.delete(e)}),[]),g=(0,He.useRef)(0),m=(0,He.useCallback)((()=>{s(!1),l(""),d()}),[d]),y=(0,He.useCallback)((e=>{Vd(e,n)&&(e.preventDefault(),e.stopPropagation())}),[n]),v=(0,He.useCallback)((e=>{Vd(e,n)&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer&&e.dataTransfer.clearData())}),[n]),A=(0,He.useCallback)((e=>{var t,r;if(!Vd(e,n))return;e.preventDefault(),e.stopPropagation(),d();let i=null;if(e.target instanceof HTMLElement&&(i=e.target.closest("[data-file-drag-target]")),g.current=g.current+1,null===(t=e.dataTransfer)||void 0===t?void 0:t.items.length)if(s(!0),i){u(i);const e=null===(r=h.current.get(i))||void 0===r?void 0:r.tooltipText;e&&l(e)}else l(""),d()}),[u,n,d]),b=(0,He.useCallback)((e=>{Vd(e,n)&&(e.preventDefault(),e.stopPropagation(),g.current=g.current-1,g.current>0||m())}),[n,m]),w=(0,He.useCallback)((e=>{var t;if(!Vd(e,n))return void m();e.preventDefault(),e.stopPropagation();let r=null;e.target instanceof HTMLElement&&(r=e.target.closest("[data-file-drag-target]")),m(),n.featuresController.entitledToFiles?(null===(t=e.dataTransfer)||void 0===t?void 0:t.items.length)&&(Array.from(e.dataTransfer.items).forEach((async e=>{const t=co.KC.available()?await e.getAsFileSystemHandle():e.getAsFile();if(!t)return;const i=r?h.current.get(r):void 0;if(null==i?void 0:i.handleFileUpload)return void i.handleFileUpload(t);const o=await n.filesController.uploadNewFile(t,{note:null==i?void 0:i.note});o&&(null==i?void 0:i.callback)&&i.callback(o)})),g.current=0):i.activate("Files")}),[n,i,m]);(0,He.useEffect)((()=>{const e=document.getElementById(kl.N.RootId);if(e)return e.addEventListener("dragstart",v),e.addEventListener("dragenter",A),e.addEventListener("dragleave",b),e.addEventListener("dragover",y),e.addEventListener("drop",w),()=>{e.removeEventListener("dragstart",v),e.removeEventListener("dragenter",A),e.removeEventListener("dragleave",b),e.removeEventListener("dragover",y),e.removeEventListener("drop",w)}}),[A,w,y,b,v]);const S=(0,He.useMemo)((()=>({isDraggingFiles:o,addDragTarget:p,removeDragTarget:f})),[p,o,f]);return(0,e.jsxs)(Hd.Provider,{value:S,children:[(0,e.jsx)(Yd,{children:r}),o?(0,e.jsx)(e.Fragment,{children:(0,e.jsx)("div",{className:"pointer-events-none absolute bottom-8 left-1/2 z-dropdown-menu -translate-x-1/2 rounded border-2 border-info bg-default px-5 py-3 shadow-main",children:a.length?a:"Drop your files to upload them"})}):null,(0,e.jsx)(Kd.Z,{children:(0,e.jsx)("div",{className:(0,Q.classNames)("overlay pointer-events-none absolute top-0 left-0 z-footer-bar h-full w-full border-2 border-info before:block before:h-full before:w-full before:bg-info before:opacity-20",o?"visible":"invisible"),ref:c})})]})};function Zd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Wd(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const qd=t=>{let{application:n}=t;const r=(0,He.useCallback)((()=>{n.accountMenuController.setDeletingAccount(!1)}),[n.accountMenuController]),i=(0,He.useRef)(null),o=(0,He.useCallback)((()=>{n.user.deleteAccount().catch(console.error),r()}),[n.user,r]);return(0,e.jsxs)(Vi,{closeDialog:r,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between text-lg font-bold",children:["Delete account?",(0,e.jsx)("button",{className:"rounded p-1 font-bold hover:bg-contrast",onClick:r,children:(0,e.jsx)(xn.Z,{type:"close"})})]}),(0,e.jsx)("div",{className:"sk-panel-row",children:(0,e.jsx)("div",{children:(0,e.jsx)("p",{className:"text-base text-foreground lg:text-sm",children:ht.eh})})}),(0,e.jsxs)("div",{className:"mt-4 flex justify-end gap-2",children:[(0,e.jsx)(Ln.Z,{ref:i,onClick:r,children:"Cancel"}),(0,e.jsx)(Ln.Z,{primary:!0,colorStyle:"danger",onClick:o,children:"Delete my account for good"})]})]})};qd.displayName="ConfirmDeleteAccountModal";const Jd=(0,Nn.Pi)((t=>t.application.accountMenuController.deletingAccount?(0,e.jsx)(qd,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zd(Object(n),!0).forEach((function(t){Wd(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},t)):null));function Xd(){const[e,n]=(0,He.useState)(0),r=(0,sr.I)(),i=(0,He.useMemo)((()=>new vn(r.environment)),[r]);return(0,He.useEffect)((()=>{const e=(0,t.Ds)((()=>{n(window.innerWidth)}),100);return window.addEventListener("resize",e),e(),()=>{window.removeEventListener("resize",e)}}),[]),i.execute().getValue()}const $d=e=>{const t=(0,He.useRef)();return(0,He.useEffect)((()=>{t.current=e})),t.current},eh=t=>{let{item:n}=t;return n.conflictOf?(0,e.jsx)("div",{className:"mt-0.5 flex flex-wrap items-center",children:(0,e.jsx)("div",{className:"mr-1 mt-2 rounded bg-danger px-1.5 py-1 text-danger-contrast",children:(0,e.jsx)("div",{className:"text-center text-xs font-bold",children:"Conflicted Copy"})})}):null},th=t=>{let{hideTags:n,tags:r}=t;return n||!r.length?null:(0,e.jsx)("div",{className:"mt-1.5 flex flex-wrap gap-2 overflow-hidden text-sm lg:text-xs",children:r.map((t=>(0,e.jsxs)("span",{className:"inline-flex items-center rounded bg-passive-4-opacity-variant px-1.5 py-1 text-foreground",children:[(0,e.jsx)(xn.Z,{type:t.iconString,className:"mr-1 text-passive-1",size:"small"}),(0,e.jsx)("span",{children:t.title})]},t.uuid)))})},nh=t=>{let{item:n,hideDate:i,sortBy:o}=t;const s=o===r.CollectionSort.UpdatedAt;return i&&!n.protected?null:(0,e.jsxs)("div",{className:"leading-1.4 mt-1 text-sm opacity-50 lg:text-xs",children:[n.protected&&(0,e.jsxs)("span",{children:["Protected ",i?"":" • "]}),!i&&s&&(0,e.jsxs)("span",{children:["Modified ",n.updatedAtString||"Now"]}),!i&&!s&&(0,e.jsx)("span",{children:n.createdAtString||"Now"})]})};var rh=s(67955);const ih=(e,t)=>{const{attachEvents:n,cleanupEvents:r}=(0,rh.H)(e,t,!0),i=(0,He.useCallback)((e=>{e.preventDefault(),t(e.clientX,e.clientY)}),[t]);(0,He.useEffect)((()=>{const t=e.current;if(!t)return;const o=(0,L.gn)();return t.addEventListener("contextmenu",i),o&&n(),()=>{t.removeEventListener("contextmenu",i),o&&r()}}),[n,r,e,i,t])},oh=t=>{let{item:n,hasFiles:i=!1,hasBorder:o=!0,isFileBackedUp:s=!1,className:a}=t;return(0,e.jsxs)("div",{className:(0,r.classNames)("flex items-start pl-0",o&&"border-b border-solid border-border",a),children:[n.locked&&(0,e.jsx)("span",{className:"flex items-center",title:"Editing Disabled",children:(0,e.jsx)(xn.Z,{ariaLabel:"Editing Disabled",type:"pencil-off",className:"text-info",size:"medium"})}),n.trashed&&(0,e.jsx)("span",{className:"ml-1.5 flex items-center",title:"Trashed",children:(0,e.jsx)(xn.Z,{ariaLabel:"Trashed",type:"trash-filled",className:"text-danger",size:"medium"})}),n.archived&&(0,e.jsx)("span",{className:"ml-1.5 flex items-center",title:"Archived",children:(0,e.jsx)(xn.Z,{ariaLabel:"Archived",type:"archive",className:"text-accessory-tint-3",size:"medium"})}),i&&(0,e.jsx)("span",{className:"ml-1.5 flex items-center",title:"Files",children:(0,e.jsx)(xn.Z,{ariaLabel:"Files",type:"attachment-file",className:"text-info",size:"medium"})}),n.starred&&(0,e.jsx)("span",{className:"ml-1.5 flex items-center",title:"Starred",children:(0,e.jsx)(xn.Z,{ariaLabel:"Starred",type:"star-filled",className:"text-warning",size:"medium"})}),s&&(0,e.jsx)("span",{className:"ml-1.5 flex items-center",title:"File is backed up locally",children:(0,e.jsx)(xn.Z,{ariaLabel:"File is backed up locally",type:"check-circle",className:"text-info",size:"medium"})})]})};var sh=s(69170);const ah=t=>{let{contact:n}=t;return(0,e.jsxs)("div",{title:"Shared by contact",className:"flex items-center rounded bg-info px-1.5 py-1 text-neutral-contrast",children:[(0,e.jsx)(xn.Z,{ariaLabel:"Shared by contact",type:"archive",className:"mr-1 text-info-contrast",size:"medium"}),(0,e.jsx)("div",{className:"text-center text-sm font-semibold lg:text-xs",children:n.name})]})},lh=t=>{let{item:n,className:i}=t;const{vault:o,sharedByContact:s}=(0,Ad.j)(n);return o?(0,e.jsxs)("div",{className:(0,r.classNames)("flex flex-wrap items-center gap-2",i),children:[(0,e.jsx)(sh.Z,{vault:o}),s&&(0,e.jsx)(ah,{contact:s})]}):null},ch=(0,Nn.Pi)((t=>{let{filesController:n,hideDate:r,hideIcon:i,hideTags:o,item:s,onSelect:a,selected:l,sortBy:c,tags:u}=t;const{setPaneLayout:d}=(0,Zr.G)(),h=(0,sr.I)(),[p,f]=(0,He.useState)(void 0);(0,He.useEffect)((()=>{var e;null===(e=h.fileBackups)||void 0===e||e.getFileBackupInfo(s).then(f)}),[h,s]);const g=(0,He.useRef)(null),m=(0,He.useCallback)(((e,t)=>{n.setShowFileContextMenu(!1),n.setFileContextMenuLocation({x:e,y:t}),n.setShowFileContextMenu(!0)}),[n]),y=(0,He.useCallback)((async(e,t)=>{let n=l;if(!l){const{didSelect:e}=await a(s);e&&(n=!0)}n&&m(e,t)}),[l,a,s,m]),v=(0,He.useCallback)((async()=>{const{didSelect:e}=await a(s,!0);e&&d(mt.h.Editing)}),[s,a,d]);return ih(g,y),(0,e.jsxs)("div",{ref:g,role:"button",className:(0,Q.classNames)("content-list-item flex w-full cursor-pointer items-stretch text-text",l&&"selected border-l-2px border-solid border-info"),id:s.uuid,onClick:v,children:[i?(0,e.jsx)("div",{className:"pr-4"}):(0,e.jsx)("div",{className:"mr-0 flex flex-col items-center justify-between p-4.5 pr-3",children:(0,e.jsx)((()=>xd((0,Bd.A)(s.mimeType),"w-5 h-5 flex-shrink-0")),{})}),(0,e.jsxs)("div",{className:"min-w-0 flex-grow border-b border-solid border-border px-0 py-4",children:[(0,e.jsx)("div",{className:"flex items-start justify-between overflow-hidden text-base font-semibold leading-[1.3]",children:(0,e.jsx)("div",{className:"break-word mr-2",children:s.title})}),(0,e.jsx)(nh,{item:s,hideDate:r,sortBy:c}),(0,e.jsx)(th,{hideTags:o,tags:u}),(0,e.jsx)(eh,{item:s}),(0,e.jsx)(lh,{item:s,className:"mt-1.5"})]}),(0,e.jsx)(oh,{className:"p-4",item:s,isFileBackedUp:!!p})]})})),uh=t=>{let{item:n,hidePreview:i,lineLimit:o=1}=t;return n.hidePreview||n.protected||i?null:(0,e.jsxs)("div",{className:(0,r.classNames)("overflow-hidden overflow-ellipsis text-base lg:text-sm",n.archived?"opacity-60":""),children:[n.preview_html&&(0,e.jsx)("div",{className:"my-1",dangerouslySetInnerHTML:{__html:(0,r.sanitizeHtmlString)(n.preview_html)}}),!n.preview_html&&n.preview_plain&&(0,e.jsx)("div",{className:"leading-1.3 line-clamp-".concat(o," mt-1 overflow-hidden"),children:n.preview_plain})]})},dh=t=>{let{item:n}=t;return(0,e.jsxs)("div",{className:(0,r.classNames)("break-word mr-2 overflow-hidden text-lg font-semibold leading-[1.3] lg:text-base lg:leading-[1.3]",n.archived?"opacity-60":""),children:[n.pinned&&(0,e.jsx)("span",{className:"mr-1.5 inline-flex rounded-full bg-info p-0.5 text-info-contrast",children:(0,e.jsx)(xn.Z,{type:"pin-filled",size:"custom",className:"h-3 w-3"})}),n.title]})},hh="application/x-sn-drag-tag",ph="application/x-sn-drag-note",fh=["checked","className"];function gh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function mh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gh(Object(n),!0).forEach((function(t){yh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function yh(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const vh=t=>{let{checked:n,className:r}=t,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,fh);return(0,e.jsx)("div",mh(mh({className:(0,Q.classNames)("relative h-5 w-5 rounded border-2 md:h-4 md:w-4",n?"border-info bg-info":"border-passive-1",r),role:"presentation"},i),{},{children:n&&(0,e.jsx)(xn.Z,{type:"check",className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-info-contrast",size:"small"})}))},Ah=(0,Nn.Pi)((t=>{let{application:n,notesController:i,onSelect:o,hideDate:s,hideIcon:a,hideTags:l,hidePreview:c,item:u,selected:d,sortBy:h,tags:p,isPreviousItemTiled:f,isNextItemTiled:g}=t;const m=(0,He.useRef)(null),y=bi(u.uuid),v=y?n.componentManager.editorForNote(y):void 0,A=(null==y?void 0:y.noteType)?y.noteType:v?v.noteType:void 0,[b,w]=(0,Do.i)(A),S=n.items.itemsReferencingItem(u).filter(r.isFile).length>0,C=(0,et.ac)(et.Jj.sm),E=(0,He.useCallback)((e=>{!C&&(e.ctrlKey||e.metaKey)&&!n.itemListController.isMultipleSelectionMode&&n.itemListController.enableMultipleSelectionMode(),!d||n.itemListController.isMultipleSelectionMode?o(u,!0).catch(console.error):n.itemListController.openSingleSelectedItem({userTriggered:!0}).catch(console.error)}),[n.itemListController,C,u,o,d]);ih(m,(async(e,t)=>{if(C)return n.itemListController.isMultipleSelectionMode||n.itemListController.replaceSelection(u),void n.itemListController.enableMultipleSelectionMode();let r=d;if(!d){const{didSelect:e}=await o(u);e&&(r=!0)}r&&((e,t)=>{i.setContextMenuClickLocation({x:e,y:t}),i.setContextMenuOpen(!0)})(e,t)})),V(R.ItemsList,"Rendering note list item",u.title);const I=!g,_=(0,He.useRef)();return(0,e.jsxs)("div",{ref:m,role:"button",className:(0,Q.classNames)("content-list-item flex w-full cursor-pointer items-stretch border-l-2 text-text",d?"selected ".concat(n.itemListController.isMultipleSelectionMode?"border-info":"border-accessory-tint-".concat(w)):"border-transparent",f&&"mt-3 border-t border-t-border",g&&"mb-3 border-b border-b-border"),id:u.uuid,onClick:E,draggable:!C&&!n.itemListController.isMultipleSelectionMode,onDragStart:e=>{if(!m.current)return;const{dataTransfer:t}=e,n=(()=>{if(!m.current)throw new Error("List item ref is not set");const e=m.current.cloneNode(!0);return Array.from(e.childNodes[1].childNodes).forEach(((e,t)=>{0!==t&&e.remove()})),e.childNodes[2].remove(),e instanceof HTMLDivElement&&(e.style.width="".concat(m.current.clientWidth,"px"),e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.zIndex="-100000",document.body.appendChild(e),_.current=e),e})();t.setDragImage(n,0,0),t.setData(ph,u.uuid)},onDragLeave:()=>{_.current&&_.current.remove()},children:[n.itemListController.isMultipleSelectionMode?(0,e.jsx)("div",{className:"mr-0 flex flex-col items-center justify-between gap-2 p-4 pr-4",children:(0,e.jsx)(vh,{className:"md:!h-5 md:!w-5",checked:d})}):a?(0,e.jsx)("div",{className:"pr-4"}):(0,e.jsx)("div",{className:"mr-0 flex flex-col items-center justify-between gap-2 p-4 pr-4",children:(0,e.jsx)(xn.Z,{type:b,className:"text-accessory-tint-".concat(w)})}),(0,e.jsxs)("div",{className:"min-w-0 flex-grow ".concat(I&&"border-b border-solid border-border"," px-0 py-4"),children:[(0,e.jsx)(dh,{item:u}),(0,e.jsx)(uh,{item:u,hidePreview:c}),(0,e.jsx)(nh,{item:u,hideDate:s,sortBy:h}),(0,e.jsx)(th,{hideTags:l,tags:p}),(0,e.jsx)(eh,{item:u}),(0,e.jsx)(lh,{item:u,className:"mt-1.5"})]}),(0,e.jsx)(oh,{className:"p-4",item:u,hasFiles:S,hasBorder:I})]})}));function bh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bh(Object(n),!0).forEach((function(t){Sh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Sh(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ch=He.memo((t=>{switch(t.item.content_type){case r.ContentType.TYPES.Note:return(0,e.jsx)(Ah,wh(wh({},t),{},{item:t.item}));case r.ContentType.TYPES.File:return(0,e.jsx)(ch,wh(wh({},t),{},{item:t.item}));default:return null}}),((e,t)=>!function(e,t){const n=["onSelect","hideDate","hideIcon","hideTags","hidePreview","selected","sortBy","isPreviousItemTiled","isNextItemTiled"];for(const r of n)if(e[r]!==t[r])return!0;return!(e.item===t.item||!function(e,t){if(e.uuid!==t.uuid)return!0;const n=["title","protected","updatedAtString","createdAtString","hidePreview","preview_html","preview_plain","archived","starred","pinned"];for(const r of n)if(e[r]!==t[r])return!0;return!1}(e.item,t.item))||function(e,t){return!(e===t||e.length===t.length&&(0===e.length&&0===t.length||(0,r.Uuids)(e).sort().join()===(0,r.Uuids)(t).sort().join()&&e.map((e=>e.title)).sort().join()===t.map((e=>e.title)).sort().join()))}(e.tags,t.tags)}(e,t))),Eh=(0,Nn.Pi)((t=>{let{application:n,items:i,selectedUuids:o,paginate:s}=t;const{filesController:a,itemListController:l,navigationController:c,notesController:u}=n,{selectPreviousItem:d,selectNextItem:h}=l,{hideTags:p,hideDate:f,hideNotePreview:g,hideEditorIcon:m}=l.webDisplayOptions,{sortBy:y}=l.displayOptions,v=c.selected,A=(0,He.useCallback)((e=>{const t=pt.ZL,n=e.target;n.scrollTop+n.offsetHeight>=n.scrollHeight-t&&s()}),[s]),b=(0,He.useCallback)((e=>{e.key===L.u8.Up?(e.preventDefault(),d()):e.key===L.u8.Down&&(e.preventDefault(),h())}),[h,d]),w=(0,He.useCallback)(((e,t)=>l.selectItem(e.uuid,t)),[l]),S=(0,He.useCallback)((e=>{if(p)return[];if(!v)return[];const t=n.getItemTags(e);return v instanceof r.SNTag&&1===t.length?[]:t}),[p,v,n]);return(0,e.jsx)("div",{className:(0,Q.classNames)("infinite-scroll overflow-y-auto overflow-x-hidden focus:shadow-none focus:outline-none","md:max-h-full pointer-coarse:md:overflow-y-auto","flex-grow pb-2"),id:kl.N.ContentList,onScroll:A,onKeyDown:b,tabIndex:pt.HF,children:i.map((t=>(0,e.jsx)(Ch,{application:n,item:t,selected:o.has(t.uuid),hideDate:f,hidePreview:g,hideTags:p,hideIcon:m,sortBy:y,filesController:a,onSelect:w,tags:S(t),notesController:u},t.uuid)))})})),Ih=(0,Nn.Pi)((t=>{let{accountMenuController:n,noAccountWarningController:r}=t;const i=(0,He.useCallback)((e=>{e.stopPropagation(),n.setShow(!0)}),[n]),o=(0,He.useCallback)((()=>{r.hide()}),[r]);return(0,e.jsxs)("div",{className:"mt-4 grid grid-cols-1 rounded-md border border-border p-4",children:[(0,e.jsx)("h1",{className:"sk-h3 m-0 text-base font-semibold lg:text-sm",children:"Data not backed up"}),(0,e.jsx)("p",{className:"col-start-1 col-end-3 m-0 mt-1 text-base lg:text-sm",children:"Sign in or register to sync your notes to your other devices with end-to-end encryption."}),(0,e.jsx)(Ln.Z,{primary:!0,small:!0,className:"col-start-1 col-end-3 mt-3 justify-self-start uppercase",onClick:i,children:"Open Account menu"}),(0,e.jsx)("button",{onClick:o,title:"Ignore warning","aria-label":"Ignore warning",style:{height:"20px"},className:"col-start-2 row-start-1 m-0 cursor-pointer rounded-md border-0 bg-transparent p-0 text-neutral hover:text-info",children:(0,e.jsx)(xn.Z,{type:"close",className:"block"})})]})})),_h=(0,Nn.Pi)((t=>{let{accountMenuController:n,noAccountWarningController:r}=t;return r.show?(0,e.jsx)(Ih,{accountMenuController:n,noAccountWarningController:r}):null})),xh="https://day.js.org/docs/en/display/format#list-of-all-available-formats";function Ph(t){let{format:n}=t;return(0,e.jsx)("em",{children:Gt(void 0,n)})}const kh=(0,Nn.Pi)((t=>{let{application:n,selectedTag:i,mode:o,changePreferencesCallback:s,disabled:a}=t;var l;const c=Qr(),u=(0,r.isSmartView)(i)&&(0,r.isSystemView)(i)?null===(l=n.getPreference(r.PrefKey.SystemViewPreferences))||void 0===l?void 0:l[i.uuid]:i.preferences,[d,h]=(0,He.useState)([]),[p,f]=(0,He.useState)(r.NativeFeatureIdentifier.TYPES.PlainEditor),[g,m]=(0,He.useState)(r.NewNoteTitleFormat.CurrentDateAndTime),[y,v]=(0,He.useState)(""),A=(0,He.useCallback)((()=>n.componentManager.getDefaultEditorIdentifier()),[n]),b=(0,He.useCallback)((()=>{if("tag"===o&&(null==u?void 0:u.editorIdentifier))f(null==u?void 0:u.editorIdentifier);else{const e=A();f(e)}"tag"===o&&(null==u?void 0:u.newNoteTitleFormat)?m(null==u?void 0:u.newNoteTitleFormat):m(n.getPreference(r.PrefKey.NewNoteTitleFormat,r.PrefDefaults[r.PrefKey.NewNoteTitleFormat]))}),[o,null==u?void 0:u.editorIdentifier,null==u?void 0:u.newNoteTitleFormat,A,n]);(0,He.useEffect)((()=>{"tag"===o&&(null==u?void 0:u.customNoteTitleFormat)?v(null==u?void 0:u.customNoteTitleFormat):v(n.getPreference(r.PrefKey.CustomNoteTitleFormat,r.PrefDefaults[r.PrefKey.CustomNoteTitleFormat]))}),[n,o,i,null==u?void 0:u.customNoteTitleFormat]),(0,He.useEffect)((()=>{b()}),[b]),(0,He.useEffect)((()=>{h(Fo(n))}),[n]);const w=(0,He.useCallback)((e=>{let t;const i=r.NativeFeatureIdentifier.create(e);if(i.isFailed()){const i=n.componentManager.findComponentWithPackageIdentifier(e);i&&(t=r.Uuid.create(i.uuid).getValue())}else t=i.getValue();if(t)if(n.features.getFeatureStatus(t)===r.FeatureStatus.Entitled)f(e),"global"===o?n.setPreference(r.PrefKey.DefaultEditorIdentifier,e):s({editorIdentifier:e});else{const t=d.find((t=>t.value===e));t&&c.activate(t.label)}}),[n,o,d,c,s]),S=(0,He.useRef)();return(0,e.jsxs)("div",{className:"px-3 py-3",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-mobile-menu-item md:text-menu-item",children:"Note Type"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(wi.Z,{disabled:a,fullWidth:!0,label:"Select the default note type",items:d,value:p,onChange:e=>w(e)})})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mt-3 text-mobile-menu-item md:text-menu-item",children:"Title Format"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(wi.Z,{disabled:a,fullWidth:!0,label:"Select the format for the note title",items:vs,value:g,onChange:e=>{m(e),"global"===o?n.setPreference(r.PrefKey.NewNoteTitleFormat,e):s({newNoteTitleFormat:e})}})})]}),g===r.NewNoteTitleFormat.CustomFormat&&(0,e.jsxs)("div",{className:"mt-2",children:[(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)("input",{disabled:a,className:(0,Q.classNames)("w-full min-w-55 rounded border border-solid border-passive-3 bg-default px-2 py-1.5 text-sm md:translucent-ui:bg-transparent","focus-within:ring-2 focus-within:ring-info"),placeholder:"e.g. YYYY-MM-DD",value:y,onChange:e=>{const t=e.currentTarget.value;v(t),S.current&&clearTimeout(S.current),S.current=window.setTimeout((async()=>{"tag"===o?s({customNoteTitleFormat:t}):n.setPreference(r.PrefKey.CustomNoteTitleFormat,t)}),25)},spellCheck:!1})}),(0,e.jsxs)("div",{className:"mt-3 text-neutral",children:[(0,e.jsx)("span",{className:"font-bold",children:"Preview: "}),(0,e.jsx)(As,{children:(0,e.jsx)(Ph,{format:y})})]}),(0,e.jsxs)("div",{className:"mt-2 text-neutral",children:[(0,e.jsx)("a",{className:"underline",href:xh,rel:"noreferrer",target:"_blank",onClick:e=>{n.isNativeMobileWeb()&&(e.preventDefault(),n.mobileDevice.openUrl(xh))},children:"Options"}),". Use ",(0,e.jsx)("code",{children:"[]"})," to escape formatting."]})]})]})}));function Bh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Oh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bh(Object(n),!0).forEach((function(t){Nh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Nh(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Dh=t=>{let{enabled:n,reverse:r}=t;return n?(0,e.jsx)(xn.Z,{type:r?"arrows-sort-up":"arrows-sort-down",className:"h-6 w-6 text-neutral md:h-5 md:w-6",size:"custom"}):null},jh=t=>{let{mode:n,label:r,icon:i,currentMode:o,setCurrentMode:s}=t;const a=o===n;return(0,e.jsx)("button",{className:(0,Q.classNames)("relative cursor-pointer rounded-full border-2 border-solid border-transparent px-2 py-1 text-mobile-menu-item focus:shadow-none md:py-0 lg:text-sm",a?"bg-info text-info-contrast":"bg-transparent text-text hover:bg-info-backdrop focus:bg-info-backdrop"),onClick:()=>{s(n)},children:(0,e.jsxs)("div",{className:"flex items-center justify-center",children:[i&&(0,e.jsx)(xn.Z,{size:"custom",type:i,className:(0,Q.classNames)("mr-1 h-4.5 w-4.5 cursor-pointer md:h-3.5 md:w-3.5",a?"text-info-contrast":"text-neutral")}),(0,e.jsx)("div",{children:r})]})})},Th=(0,Nn.Pi)((t=>{let{application:n,isFilesSmartView:i,selectedTag:o,paneController:s}=t;var a;const l=(0,r.isTag)(o),c=(0,r.isSmartView)(o)&&(0,r.isSystemView)(o),u=c?null===(a=n.getPreference(r.PrefKey.SystemViewPreferences))||void 0===a?void 0:a[o.uuid]:o.preferences,d=n.subscriptionController.hasFirstPartyOnlineOrOfflineSubscription(),[h,p]=(0,He.useState)(d&&l||u?"tag":"global"),[f,g]=(0,He.useState)({}),m="tag"===h&&!d,y="daily"===(null==u?void 0:u.entryMode),v=(0,He.useCallback)((()=>{const e={sortBy:n.getPreference(r.PrefKey.SortNotesBy,r.PrefDefaults[r.PrefKey.SortNotesBy]),sortReverse:n.getPreference(r.PrefKey.SortNotesReverse,r.PrefDefaults[r.PrefKey.SortNotesReverse]),showArchived:n.getPreference(r.PrefKey.NotesShowArchived,r.PrefDefaults[r.PrefKey.NotesShowArchived]),showTrashed:n.getPreference(r.PrefKey.NotesShowTrashed,r.PrefDefaults[r.PrefKey.NotesShowTrashed]),hideProtected:n.getPreference(r.PrefKey.NotesHideProtected,r.PrefDefaults[r.PrefKey.NotesHideProtected]),hidePinned:n.getPreference(r.PrefKey.NotesHidePinned,r.PrefDefaults[r.PrefKey.NotesHidePinned]),hideNotePreview:n.getPreference(r.PrefKey.NotesHideNotePreview,r.PrefDefaults[r.PrefKey.NotesHideNotePreview]),hideDate:n.getPreference(r.PrefKey.NotesHideDate,r.PrefDefaults[r.PrefKey.NotesHideDate]),hideTags:n.getPreference(r.PrefKey.NotesHideTags,r.PrefDefaults[r.PrefKey.NotesHideTags]),hideEditorIcon:n.getPreference(r.PrefKey.NotesHideEditorIcon,r.PrefDefaults[r.PrefKey.NotesHideEditorIcon]),newNoteTitleFormat:n.getPreference(r.PrefKey.NewNoteTitleFormat,r.PrefDefaults[r.PrefKey.NewNoteTitleFormat]),customNoteTitleFormat:n.getPreference(r.PrefKey.CustomNoteTitleFormat,r.PrefDefaults[r.PrefKey.CustomNoteTitleFormat])};g("global"===h?e:Oh(Oh({},e),u))}),[n,h,u]);(0,He.useEffect)((()=>{v()}),[v]);const A=(0,He.useCallback)((async e=>{for(const t of Object.keys(e)){const r=e[t];await n.setPreference(t,r).catch(console.error),v()}}),[n,v]),b=(0,He.useCallback)((async e=>{if(!o)return;if(!c)return;const t=n.getPreference(r.PrefKey.SystemViewPreferences)||{},i=t[o.uuid]||{};await n.setPreference(r.PrefKey.SystemViewPreferences,Oh(Oh({},t),{},{[o.uuid]:Oh(Oh({},i),e)})),v()}),[n,c,v,o]),w=(0,He.useCallback)((async e=>{"global"===h?await A(e):c?await b(e):await n.changeAndSaveItem.execute(o,(t=>{t.preferences=Oh(Oh({},t.preferences),e)}))}),[h,c,A,b,n,o]),S=(0,He.useCallback)((async()=>{if(c)return await n.setPreference(r.PrefKey.SystemViewPreferences,Oh(Oh({},n.getPreference(r.PrefKey.SystemViewPreferences)),{},{[o.uuid]:void 0})),void v();n.changeAndSaveItem.execute(o,(e=>{e.preferences=void 0}))}),[n,c,v,o]),C=(0,He.useCallback)((()=>{w({sortReverse:!f.sortReverse})}),[f,w]),E=(0,He.useCallback)((e=>{f.sortBy===e?C():w({sortBy:e})}),[f.sortBy,C,w]),I=(0,He.useCallback)((()=>{E(r.CollectionSort.UpdatedAt)}),[E]),_=(0,He.useCallback)((()=>{E(r.CollectionSort.CreatedAt)}),[E]),x=(0,He.useCallback)((()=>{E(r.CollectionSort.Title)}),[E]),P=(0,He.useCallback)((()=>{w({hideNotePreview:!f.hideNotePreview})}),[f,w]),k=(0,He.useCallback)((()=>{w({hideDate:!f.hideDate})}),[f,w]),B=(0,He.useCallback)((()=>{w({hideTags:!f.hideTags})}),[f,w]),O=(0,He.useCallback)((()=>{w({hidePinned:!f.hidePinned})}),[f,w]),N=(0,He.useCallback)((()=>{w({showArchived:!f.showArchived})}),[f,w]),D=(0,He.useCallback)((()=>{w({showTrashed:!f.showTrashed})}),[f,w]),j=(0,He.useCallback)((()=>{w({hideProtected:!f.hideProtected})}),[f,w]),T=(0,He.useCallback)((()=>{w({hideEditorIcon:!f.hideEditorIcon})}),[f,w]),M=(0,He.useCallback)((()=>{w({entryMode:y?"normal":"daily"})}),[y,w]),F=(0,He.useCallback)((()=>{const e=!f.useTableView;w({useTableView:e}),e&&s.setPaneLayout(mt.h.TableView)}),[f.useTableView,w,s]),R=(0,et.ac)(et.Jj.sm),L=Boolean(i||f.useTableView),U=L&&!R;return(0,e.jsxs)(qr.Z,{className:"text-sm",a11yLabel:"Notes list options menu",children:[(0,e.jsx)("div",{className:"my-1 px-3 text-base font-semibold uppercase text-text lg:text-xs",children:"Preferences for"}),(0,e.jsxs)("div",{className:(0,Q.classNames)("mt-1.5 flex w-full justify-between px-3",!m&&"mb-3"),children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)(jh,{label:"Global",mode:"global",currentMode:h,setCurrentMode:p}),(0,e.jsx)(jh,{label:o.title,icon:o.iconString,mode:"tag",currentMode:h,setCurrentMode:p})]}),"tag"===h&&(0,e.jsx)("button",{className:"text-base lg:text-sm",onClick:S,children:"Reset"})]}),m&&(0,e.jsx)(hs,{className:"m-2 mb-3 mt-2",application:n,title:"Upgrade for per-tag preferences",message:"Create powerful workflows and organizational layouts with per-tag display preferences and the all-new Daily Notebook calendar layout."}),(0,e.jsxs)(Jr.Z,{title:"Sort by",children:[(0,e.jsx)(Kr.Z,{disabled:m||y,className:"py-2",onClick:I,checked:f.sortBy===r.CollectionSort.UpdatedAt,children:(0,e.jsxs)("div",{className:"ml-1 flex flex-grow items-center justify-between md:ml-2",children:[(0,e.jsx)("span",{children:"Date modified"}),(0,e.jsx)(Dh,{enabled:f.sortBy===r.CollectionSort.UpdatedAt,reverse:f.sortReverse})]})}),(0,e.jsx)(Kr.Z,{disabled:m||y,className:"py-2",onClick:_,checked:f.sortBy===r.CollectionSort.CreatedAt,children:(0,e.jsxs)("div",{className:"ml-1 flex flex-grow items-center justify-between md:ml-2",children:[(0,e.jsx)("span",{children:"Creation date"}),(0,e.jsx)(Dh,{enabled:f.sortBy===r.CollectionSort.CreatedAt,reverse:f.sortReverse})]})}),(0,e.jsx)(Kr.Z,{disabled:m||y,className:"py-2",onClick:x,checked:f.sortBy===r.CollectionSort.Title,children:(0,e.jsxs)("div",{className:"ml-1 flex flex-grow items-center justify-between md:ml-2",children:[(0,e.jsx)("span",{children:"Title"}),(0,e.jsx)(Dh,{enabled:f.sortBy===r.CollectionSort.Title,reverse:f.sortReverse})]})})]}),(0,e.jsxs)(Jr.Z,{title:"View",children:[!U&&!i&&(0,e.jsx)(Dn.Z,{disabled:m,className:"py-1 hover:bg-contrast focus:bg-info-backdrop",checked:!f.hideNotePreview,onChange:P,children:(0,e.jsx)("div",{className:"max-w-3/4 flex flex-col",children:"Show note preview"})}),(0,e.jsx)(Dn.Z,{disabled:m,className:"py-1 hover:bg-contrast focus:bg-info-backdrop",checked:!f.hideDate,onChange:k,children:"Show date"}),(0,e.jsx)(Dn.Z,{disabled:m,className:"py-1 hover:bg-contrast focus:bg-info-backdrop",checked:!f.hideTags,onChange:B,children:"Show tags"}),(0,e.jsx)(Dn.Z,{disabled:m,className:"py-1 hover:bg-contrast focus:bg-info-backdrop",checked:!f.hideEditorIcon,onChange:T,children:"Show icon"})]}),!U&&(0,e.jsxs)(Jr.Z,{title:"Other",children:[(0,e.jsx)(Dn.Z,{disabled:m,className:"py-1 hover:bg-contrast focus:bg-info-backdrop",checked:!f.hidePinned,onChange:O,children:"Show pinned"}),(0,e.jsx)(Dn.Z,{disabled:m,className:"py-1 hover:bg-contrast focus:bg-info-backdrop",checked:!f.hideProtected,onChange:j,children:"Show protected"}),(0,e.jsx)(Dn.Z,{disabled:m,className:"py-1 hover:bg-contrast focus:bg-info-backdrop",checked:Boolean(f.showArchived),onChange:N,children:"Show archived"}),(0,e.jsx)(Dn.Z,{disabled:m,className:"py-1 hover:bg-contrast focus:bg-info-backdrop",checked:Boolean(f.showTrashed),onChange:D,children:"Show trashed"})]}),"tag"===h&&!c&&!L&&(0,e.jsx)(Jr.Z,{children:(0,e.jsx)(Dn.Z,{disabled:m,className:"py-1 hover:bg-contrast focus:bg-info-backdrop",checked:y,onChange:M,children:(0,e.jsxs)("div",{className:"flex flex-col pr-5",children:[(0,e.jsxs)("div",{className:"flex flex-row items-center",children:[(0,e.jsx)("div",{className:"text-base font-semibold uppercase text-text lg:text-xs",children:"Daily Notebook"}),(0,e.jsx)(Ge.DR,{className:"!py-0.5 px-1.5",style:"success",children:"Labs"})]}),(0,e.jsx)("div",{className:"mt-1",children:"Capture new notes daily with a calendar-based layout"})]})})}),"tag"===h&&!c&&!y&&(0,e.jsx)(Jr.Z,{children:(0,e.jsx)(Dn.Z,{disabled:m,className:"py-1 hover:bg-contrast focus:bg-info-backdrop",checked:L,onChange:F,children:(0,e.jsxs)("div",{className:"flex flex-col pr-5",children:[(0,e.jsxs)("div",{className:"flex flex-row items-center",children:[(0,e.jsx)("div",{className:"text-base font-semibold uppercase text-text lg:text-xs",children:"Table view"}),(0,e.jsx)(Ge.DR,{className:"!py-0.5 px-1.5",style:"success",children:"Labs"})]}),(0,e.jsx)("div",{className:"mt-1",children:"Display the notes and files in the current tag in a table layout"})]})})}),!U&&(!c||"global"===h)&&(0,e.jsx)(Jr.Z,{title:"New note defaults",children:(0,e.jsx)(kh,{disabled:m,application:n,selectedTag:o,mode:h,changePreferencesCallback:w})})]})})),Mh=()=>{const t=(0,sr.I)(),{setPaneLayout:n}=(0,Zr.G)(),{isTabletOrMobile:i,isMobile:o}=Xd(),[s,a]=(0,He.useState)((()=>t.status.totalPreferencesBubbleCount?t.status.totalPreferencesBubbleCount.toString():void 0));return(0,He.useEffect)((()=>t.status.addEventObserver(((e,t)=>{e===r.StatusServiceEvent.PreferencesBubbleCountChanged&&a(t)}))),[t.status]),(0,e.jsxs)("div",{className:(0,r.classNames)(i?"flex":"hidden","relative h-10 w-10","mr-3"),children:[(0,e.jsx)(ei.Z,{onClick:()=>{n(mt.h.TagSelection)},label:"Open navigation menu",icon:"menu-variant"}),o&&s&&(0,e.jsx)(si,{position:"right",count:s})]})},Fh=(0,Nn.Pi)((t=>{let{filesController:n,close:i}=t;const[o,s]=(0,He.useState)((0,je.AF)(new Date)),[a,l]=(0,He.useState)((()=>new Te)),[c,u]=(0,He.useState)(!1),[d,h]=(0,He.useState)(),p=(0,He.useRef)(null),f=(0,He.useRef)(null);(0,He.useEffect)((()=>{if(a)return u(!1),(async()=>{await a.initialize(),f.current&&(a.video.style.position="",a.video.style.display="",a.video.style.height="100%",f.current.append(a.video)),u(!0)})(),()=>{a.video&&a.finish()}}),[a]);const g=(0,He.useCallback)((async()=>{if(!a)return;const e=await a.takePhoto(o);h(e),l(void 0)}),[o,a]),m=(0,He.useMemo)((()=>(null==a?void 0:a.devices)?a.devices.map((e=>({label:e.label||"Camera (".concat(e.deviceId.slice(0,10),")"),value:e.deviceId}))):[]),[null==a?void 0:a.devices]),y=(0,He.useCallback)((()=>{var e;o?d&&(n.uploadNewFile(d),i()):null===(e=p.current)||void 0===e||e.focus()}),[d,i,o,n]);return(0,e.jsx)(Gn,{title:"Take a photo",close:i,actions:[{label:"Capture",onClick:g,type:"primary",mobileSlot:"right",hidden:!!d},{label:"Upload",onClick:y,type:"primary",mobileSlot:"right",hidden:!d},{label:"Cancel",onClick:i,type:"cancel",mobileSlot:"left"},{label:"Retry",onClick:()=>{h(void 0),l(new Te)},type:"secondary"}],children:(0,e.jsxs)("div",{className:"px-4 py-4",children:[(0,e.jsx)("div",{className:"mb-4 flex flex-col",children:(0,e.jsxs)("label",{className:"text-sm font-medium text-neutral",children:["File name:",(0,e.jsx)(ui.Z,{className:{container:"mt-1"},value:o,onChange:e=>s(e),ref:p})]})}),(0,e.jsxs)("div",{className:"mt-2",children:[(0,e.jsx)("div",{className:"text-sm font-medium text-neutral",children:"Preview:"}),!c&&(0,e.jsx)("div",{className:"mt-1 w-full",children:(0,e.jsxs)("div",{className:"flex h-64 w-full items-center justify-center gap-2 rounded-md bg-contrast text-base",children:[(0,e.jsx)(xn.Z,{type:"camera",className:"text-neutral-300"}),"Initializing..."]})}),(0,e.jsx)("div",{className:(0,r.classNames)("mt-1 w-full",d&&"hidden"),ref:f}),d&&(0,e.jsx)("div",{className:"mt-1 w-full",children:(0,e.jsx)("img",{src:URL.createObjectURL(d),alt:"Captured photo"})})]}),a&&m.length>1&&!d&&(0,e.jsx)("div",{className:"mt-4",children:(0,e.jsxs)("label",{className:"text-sm font-medium text-neutral",children:["Device:",(0,e.jsx)(wi.Z,{label:"Photo Capture Device",items:m,value:a.selectedDevice.deviceId,onChange:e=>{a.setDevice(e)},classNameOverride:{wrapper:"mt-1"}})]})})]})})}));class Rh{constructor(e){this.fileName=e,this.dataReadyPromise=(0,r.Deferred)(),this.onData=async e=>{const t=new Blob([e.data],{type:"video/mp4"}),n=URL.createObjectURL(t),r=await fetch(n),i=await r.blob(),o=new File([i],this.fileName,{type:"video/mp4"});this.dataReadyPromise.resolve(o)}}static async isSupported(){return(await navigator.mediaDevices.enumerateDevices()).some((e=>"videoinput"===e.kind))}async initialize(){var e,t;this.stream=await navigator.mediaDevices.getUserMedia({video:!0,audio:!0}),this.recorder=new MediaRecorder(this.stream),this.video=document.createElement("video"),this.video.playsInline=!0,this.video.style.position="absolute",this.video.style.display="none",this.video.volume=0,this.canvas=document.createElement("canvas"),document.body.append(this.video),this.video.srcObject=this.stream,await this.video.play(),await this.awaitVideoReady(this.video);const n=this.stream.getVideoTracks()[0].getSettings();this.width=null!==(e=n.width)&&void 0!==e?e:1280,this.height=null!==(t=n.height)&&void 0!==t?t:720,this.canvas.width=this.width,this.canvas.height=this.height}async startRecording(){this.recorder.start(),this.recorder.ondataavailable=this.onData}async stop(){var e,t;return this.video.pause(),"inactive"!==this.recorder.state&&this.recorder.stop(),null===(e=this.video.parentElement)||void 0===e||e.removeChild(this.video),null===(t=this.canvas.parentElement)||void 0===t||t.removeChild(this.canvas),this.video.remove(),this.canvas.remove(),this.stream.getTracks().forEach((e=>{e.stop()})),this.dataReadyPromise.promise}async awaitVideoReady(e){return new Promise((t=>{e.addEventListener("canplaythrough",(()=>{t(null)}))}))}}const Lh=(0,Nn.Pi)((t=>{let{filesController:n,close:i}=t;const[o,s]=(0,He.useState)((0,je.AF)(new Date)),[a,l]=(0,He.useState)((()=>new Rh(o))),[c,u]=(0,He.useState)(!1),[d,h]=(0,He.useState)(!1),[p,f]=(0,He.useState)(),g=(0,He.useRef)(null),m=(0,He.useRef)(null);(0,He.useEffect)((()=>((async()=>{await a.initialize(),m.current&&(a.video.style.position="",a.video.style.display="",a.video.style.height="100%",m.current.append(a.video)),u(!0)})(),()=>{a.video&&a.stop()})),[a]);const y=(0,He.useCallback)((async()=>{await a.startRecording(),h(!0)}),[a]),v=(0,He.useCallback)((()=>{var e;if(!o)return void(null===(e=g.current)||void 0===e||e.focus());if(!p)return;const t=new File([p],o,{type:p.type});n.uploadNewFile(t),i()}),[p,i,o,n]),A=(0,He.useMemo)((()=>{if(p)return URL.createObjectURL(p)}),[p]);return(0,e.jsx)(Gn,{title:"Record a video",close:i,actions:[{label:"Cancel",onClick:i,type:"cancel",mobileSlot:"left"},{label:"Record",onClick:y,type:"primary",mobileSlot:"right",hidden:!!p||d},{label:"Stop",onClick:async()=>{const e=await a.stop();h(!1),f(e)},type:"primary",mobileSlot:"right",hidden:!!p||!d},{label:"Retry",onClick:()=>{f(void 0),l(new Rh(o)),u(!1)},type:"secondary",hidden:!p},{label:"Upload",onClick:v,type:"primary",mobileSlot:"right",hidden:!p}],children:(0,e.jsxs)("div",{className:"px-4 py-4",children:[(0,e.jsx)("div",{className:"mb-4 flex flex-col",children:(0,e.jsxs)("label",{className:"text-sm font-medium text-neutral",children:["File name:",(0,e.jsx)(ui.Z,{className:{container:"mt-1"},value:o,onChange:e=>s(e),ref:g})]})}),(0,e.jsxs)("div",{className:"mt-2",children:[(0,e.jsx)("div",{className:"text-sm font-medium text-neutral",children:"Preview:"}),!c&&(0,e.jsx)("div",{className:"mt-1 w-full",children:(0,e.jsxs)("div",{className:"flex h-64 w-full items-center justify-center gap-2 rounded-md bg-contrast text-base",children:[(0,e.jsx)(xn.Z,{type:"camera",className:"text-neutral-300"}),"Initializing..."]})}),(0,e.jsx)("div",{className:(0,r.classNames)("mt-1 w-full",p&&"hidden"),ref:m}),p&&(0,e.jsx)("div",{className:"mt-1 w-full",children:(0,e.jsx)("video",{src:A,controls:!0})})]})]})})})),Qh=t=>{let{filesController:n,isDailyEntry:i,addButtonLabel:o,isInFilesSmartView:s,addNewItem:a}=t;const l=(0,He.useRef)(null),[c,u]=(0,He.useState)(!1),[d,h]=(0,He.useState)(!1),[p,f]=(0,He.useState)();(0,He.useEffect)((()=>{(async()=>{h(await Te.isSupported())})()}),[]);const g=s&&d,m=()=>{f(void 0)};return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)($r.Z,{label:o,children:(0,e.jsx)("button",{className:(0,r.classNames)("z-editor-title-bar hidden h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-solid border-transparent hover:brightness-125 md:flex",i?"bg-danger text-danger-contrast":"bg-info text-info-contrast"),"aria-label":o,onClick:()=>{g?u((e=>!e)):a()},ref:l,children:(0,e.jsx)(xn.Z,{type:"add",size:"custom",className:"h-5 w-5"})})}),g&&(0,e.jsx)(On.Z,{title:"Add item",open:c,anchorElement:l,togglePopover:()=>{u((e=>!e))},side:"bottom",align:"center",className:"py-2",children:(0,e.jsxs)(qr.Z,{a11yLabel:"test",children:[(0,e.jsxs)(ci.Z,{onClick:()=>{a(),u(!1)},children:[(0,e.jsx)(xn.Z,{type:"add",className:"mr-2"}),o]}),(0,e.jsxs)(ci.Z,{onClick:async()=>{f("photo"),u(!1)},children:[(0,e.jsx)(xn.Z,{type:"camera",className:"mr-2"}),"Take photo"]}),(0,e.jsxs)(ci.Z,{onClick:async()=>{f("video"),u(!1)},children:[(0,e.jsx)(xn.Z,{type:"camera",className:"mr-2"}),"Record video"]})]})}),(0,e.jsx)(Fr,{isOpen:"photo"===p,close:m,children:(0,e.jsx)(Fh,{filesController:n,close:m})}),(0,e.jsx)(Fr,{isOpen:"video"===p,close:m,children:(0,e.jsx)(Lh,{filesController:n,close:m})})]})},Uh=["className"];function Vh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Kh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vh(Object(n),!0).forEach((function(t){Hh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Hh(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Gh=t=>{let{className:n}=t,r=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,Uh);return(0,e.jsx)("button",Kh(Kh({className:(0,Q.classNames)("flex cursor-pointer border-0 bg-transparent p-0",n)},r),{},{children:(0,e.jsx)(xn.Z,{type:"clear-circle-filled",className:"text-neutral"})}))},Yh=(0,Nn.Pi)((t=>{let{itemListController:n}=t;const i=(0,He.useRef)(null),{noteFilterText:o,setNoteFilterText:s,clearFilterText:a}=n,[l,c]=(0,He.useState)(!1);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ui.Z,{autocomplete:!1,id:kl.N.SearchBar,className:{container:(0,r.classNames)(l?"scale-x-1 opacity-100":"scale-x-0 opacity-0","origin-right px-1 transition-all duration-200 ease-in-out"),input:"text-base placeholder:text-passive-0 lg:text-sm"},placeholder:"Search...",value:o,ref:e=>{e&&document.activeElement!==e&&e.focus()},onChange:e=>s(e),left:[(0,e.jsx)(xn.Z,{type:"search",className:"mr-1 h-4.5 w-4.5 flex-shrink-0 text-passive-1"})],right:[o&&(0,e.jsx)(Gh,{onClick:a})],roundedFull:!0}),(0,e.jsx)(ei.Z,{ref:i,className:l?"rotate-90 transition-transform duration-200 ease-in-out":"",onClick:()=>{c(!l)},icon:l?"close":"search",label:"Search"})]})})),zh=(0,He.memo)((t=>{let{application:n,panelTitle:i,icon:o,addButtonLabel:s,addNewItem:a,isFilesSmartView:l,isTableViewEnabled:c,optionsSubtitle:u,selectedTag:d,filesController:h,itemListController:p,paneController:f}=t;const g=(0,He.useRef)(null),m=(0,He.useRef)(null),y=(0,r.isTag)(d)&&d.isDailyEntry,v=(0,et.ac)(et.Jj.sm),A=(0,et.ac)(et.Yd.md),b=!(0,et.ac)(et.Yd.pointerFine),w=A&&b,[S,C]=(0,He.useState)(""),[E,I]=(0,He.useState)(!1),_=v&&(!!S||E);(0,He.useEffect)((()=>n.addEventObserver((async e=>{if(e===r.ApplicationEvent.CompletedInitialSync)return void C("");if(e===r.ApplicationEvent.EnteredOutOfSync)return void I(!0);if(e===r.ApplicationEvent.ExitedOutOfSync)return void I(!1);const t=n.sync.getSyncStatus(),{localDataDone:i,localDataCurrent:o,localDataTotal:s}=t.getStats();if(e!==r.ApplicationEvent.SyncStatusChanged)return e===r.ApplicationEvent.LocalDataIncrementalLoad||e===r.ApplicationEvent.LocalDataLoaded?i?void C(""):void C("Loading ".concat(o,"/").concat(s," items...")):void 0;C(t.syncInProgress&&!n.sync.completedOnlineDownloadFirstSync?"Syncing...":"")}))),[n]);const[x,P]=(0,He.useState)(!1),k=(0,He.useCallback)((()=>{P((e=>!e))}),[]),B=(0,He.useMemo)((()=>(0,e.jsx)("div",{className:"flex",children:(0,e.jsxs)("div",{className:"relative",ref:g,children:[(0,e.jsx)(ei.Z,{className:(0,Q.classNames)(x?"bg-contrast":void 0),onClick:k,ref:m,icon:"sort-descending",label:"Display options menu"}),(0,e.jsx)(On.Z,{open:x,anchorElement:m,togglePopover:k,align:"start",className:"py-2",title:"Display options",children:(0,e.jsx)(Th,{application:n,isFilesSmartView:l,selectedTag:d,paneController:f})})]})})),[x,k,n,l,d,f]),O=(0,He.useMemo)((()=>(0,e.jsx)(Qh,{isInFilesSmartView:l,isDailyEntry:y,addButtonLabel:s,addNewItem:a,filesController:h})),[s,a,h,y,l]),N=(0,He.useMemo)((()=>!c||v?null:(0,e.jsx)(Yh,{itemListController:p})),[c,v,p]),D=(0,He.useMemo)((()=>(0,e.jsx)("div",{className:"flex min-w-0 flex-grow flex-col break-words pt-1 lg:pt-0",children:(0,e.jsxs)("div",{className:(0,Q.classNames)("flex min-w-0 flex-grow",u||_?"":"items-center"),children:[o&&(0,e.jsx)(xn.Z,{type:o,size:"custom",className:(0,Q.classNames)("ml-0.5 mr-2 h-7 w-7 flex-shrink-0 text-2xl text-neutral lg:h-6 lg:w-6 lg:text-lg",u&&"md:mt-0.5")}),(0,e.jsxs)("div",{className:"mr-2 flex min-w-0 flex-col break-words",children:[(0,e.jsx)("div",{className:"text-2xl font-semibold text-text md:text-lg",children:i}),_&&(0,e.jsx)("div",{className:(0,Q.classNames)("-mt-1 text-xs md:mt-0",E?"text-warning":"text-passive-0"),children:E?"Potentially Out of Sync":S}),u&&(0,e.jsx)("div",{className:"text-xs text-passive-0",children:u}),(0,e.jsx)(lh,{className:"mt-1",item:d})]})]})})),[u,_,o,i,E,S,d]),j=(0,He.useMemo)((()=>(0,e.jsxs)("div",{className:"flex w-full justify-between md:flex",children:[(0,e.jsx)(Mh,{}),D,(0,e.jsxs)("div",{className:"flex items-start gap-3 md:items-center",children:[N,B,O]})]})),[D,N,B,O]),T=(0,He.useMemo)((()=>(0,e.jsxs)("div",{className:"w-full flex-col",children:[(0,e.jsxs)("div",{className:"mb-2 flex justify-between",children:[(0,e.jsx)(Mh,{}),(0,e.jsxs)("div",{className:"flex",children:[B,O]})]}),D]})),[B,O,D]);return(0,e.jsxs)("div",{className:"section-title-bar-header items-start gap-1",children:[!w&&j,w&&T]})})),Zh=t=>{let{label:n,selected:i,onSelect:o}=t;return(0,e.jsx)("button",{role:"checkbox","aria-checked":i,className:(0,r.classNames)("active:border-info active:bg-info active:text-neutral-contrast flex-grow cursor-pointer rounded-full border border-solid px-2 py-1 text-center transition text-sm",i?"text-neutral-contrast border-info bg-info":"text-neutral border-secondary-border bg-default"),onClick:o,children:n})},Wh=(0,Nn.Pi)((t=>{let{searchOptions:n}=t;const{includeProtectedContents:r,includeArchived:i,includeTrashed:o}=n,s=(0,He.useCallback)((async()=>{await n.toggleIncludeProtectedContents()}),[n]);return(0,e.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",onMouseDown:e=>e.preventDefault(),children:[(0,e.jsx)(Zh,{label:"Protected Contents",selected:r,onSelect:s}),(0,e.jsx)(Zh,{label:"Archived",selected:i,onSelect:n.toggleIncludeArchived}),(0,e.jsx)(Zh,{label:"Trashed",selected:o,onSelect:n.toggleIncludeTrashed})]})})),qh=(0,Nn.Pi)((t=>{let{itemListController:n,searchOptionsController:r,hideOptions:i=!1}=t;const o=(0,He.useRef)(null),{noteFilterText:s,setNoteFilterText:a,clearFilterText:l,onFilterEnter:c}=n,[u,d]=(0,He.useState)(!1),h=(0,He.useCallback)((e=>{a(e)}),[a]),p=(0,He.useCallback)((e=>{e.key===L.u8.Enter&&c()}),[c]),f=(0,He.useCallback)((()=>d(!0)),[]),g=(0,He.useCallback)((()=>d(!1)),[]),m=(0,He.useCallback)((()=>{var e;l(),null===(e=o.current)||void 0===e||e.focus()}),[l]);return(0,e.jsxs)("div",{className:"pb-0.5 pt-3",role:"search",children:[(0,e.jsx)(ui.Z,{autocomplete:!1,id:kl.N.SearchBar,className:{container:"px-1",input:"text-base placeholder:text-passive-0 lg:text-sm"},placeholder:"Search...",value:s,ref:o,onBlur:g,onChange:h,onFocus:f,onKeyUp:p,left:[(0,e.jsx)(xn.Z,{type:"search",className:"mr-1 h-4.5 w-4.5 flex-shrink-0 text-passive-1"})],right:[s&&(0,e.jsx)(Gh,{onClick:m})],roundedFull:!0}),(u||s)&&!i&&(0,e.jsx)("div",{className:"animate-fade-from-top",children:(0,e.jsx)(Wh,{searchOptions:r})})]})}));function Jh(e){return e.toLocaleDateString()}const Xh=e=>{const t=Jh(e);return{dateKey:t,date:e,day:e.getDate(),isToday:t===Jh(new Date),id:t,weekday:(0,je.ng)(e,"short")}};function $h(e,t,n){let r,i;if(e.length>0)r=e[0].date,i=e[e.length-1].date;else{const e=new Date;r=e,i=e}for(let o=1;o<=n;o++)if("front"===t){const t=(0,Q.addDaysToDate)(r,o),n=Xh(t);e.unshift(n)}else{const t=(0,Q.addDaysToDate)(i,-o),n=Xh(t);e.push(n)}return e}function ep(e,t){const n=Math.random()*(t-e)+e;return Math.floor(n)}const tp=t=>{let{rows:n}=t;const[r,i]=(0,He.useState)([]),[o,s]=(0,He.useState)(null),a=(0,He.useCallback)((()=>{const e=[];for(let t=0;t<n;t++){const t=ep(70,100);e.push(t)}i(e)}),[i,n]);(0,He.useEffect)((()=>{a()}),[n,a]);const l=(0,He.useCallback)((()=>{a();const e=setInterval((()=>{a()}),750);s(e)}),[s,a]),c=(0,He.useCallback)((()=>{o&&(clearInterval(o),s(null))}),[o,s]);return(0,e.jsx)("div",{onMouseEnter:l,onMouseLeave:c,className:"w-full",children:r.map(((t,n)=>(0,e.jsx)("div",{style:{width:"".concat(t,"%")},className:"transition-slowest ease my-4 h-7 bg-passive-4-opacity-variant pb-3 transition-width duration-1000"},n)))})},np=t=>{let{day:n,hasActivity:r,weekday:i}=t;return(0,e.jsx)("div",{className:"mr-5",children:(0,e.jsxs)("div",{className:"".concat(r?"bg-danger text-danger-contrast":"bg-neutral text-neutral-contrast"," h-19 w-18 rounded p-2 text-center"),children:[(0,e.jsx)("div",{className:"text-sm font-bold",children:i}),(0,e.jsx)("div",{className:"text-4xl font-bold",children:n})]})})},rp=(0,He.forwardRef)(((t,n)=>{let{item:i,tags:o=[],section:s,onClick:a,selected:l,hideDate:c=!1,hidePreview:u=!1,hideTags:d=!1}=t;return(0,e.jsxs)("div",{ref:n,onClick:a,className:"content-list-item flex w-full cursor-pointer items-stretch text-text ".concat(l&&"selected border-l-2 border-solid border-danger"),id:s.id,children:[(0,e.jsx)("div",{className:"min-w-0 flex-grow border-b border-solid border-border px-4 py-4",children:(0,e.jsxs)("div",{className:"flex items-start overflow-hidden text-base",children:[(0,e.jsx)(np,{weekday:s.weekday,hasActivity:null!=i,day:s.day}),(0,e.jsxs)("div",{className:"w-full leading-[1.3]",children:[i&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(dh,{item:i}),(0,r.isNote)(i)&&(0,e.jsx)(uh,{hidePreview:u,item:i,lineLimit:5}),(0,e.jsx)(nh,{item:i,hideDate:c,sortBy:"created_at"}),(0,e.jsx)(th,{hideTags:d,tags:o})]}),!i&&(0,e.jsxs)("div",{className:"w-full",children:[(0,e.jsx)("div",{className:"break-word mr-2 font-semibold",children:(0,je.AF)(s.date,!1)}),(0,e.jsx)(tp,{rows:1})]})]})]})}),i&&(0,e.jsx)(oh,{item:i,hasFiles:!1})]})})),ip=t=>{let{day:n,type:r,isToday:i,onClick:o,isLastMonth:s}=t,a="";return a+=i?"bg-danger text-danger-contrast font-bold":s?"text-passive-3":"empty"===r?"bg-transparent hover:bg-contrast":"item"===r?"bg-danger-light text-danger font-bold":"bg-contrast",(0,e.jsx)("div",{className:"h-7 w-[14.2%] p-0.5",children:(0,e.jsx)("div",{className:"".concat(a," flex h-full w-full cursor-pointer items-center justify-center rounded"),onClick:o,children:n},n)})},op=[31,28,31,30,31,30,31,31,30,31,30,31],sp=[31,29,31,30,31,30,31,31,30,31,30,31],ap=["Mo","Tu","We","Th","Fr","Sa","Su"],lp=["January","February","March","April","May","June","July","August","September","October","November","December"];function cp(e){return e.toLocaleDateString()}function up(e){const t=new Date(e.getFullYear(),e.getMonth(),1).getDay();return 0===t?7:t}function dp(e,t,n){const r=e[0].date,i=e[e.length-1].date;for(let o=1;o<=n;o++)if("front"===t){const t=(0,je.fi)(r,-o);e.unshift({date:t})}else{const t=(0,je.fi)(i,o);e.push({date:t})}return e}const hp=t=>{let{activities:n,startDate:r,onDateSelect:i,selectedDay:o,className:s}=t;const a=(0,He.useMemo)((()=>function(e){const t={};for(const n of e){const e=cp(n.date);t[e]||(t[e]=[]),t[e].push(n)}return t}(n)),[n]),[l,c]=(0,He.useState)(r||new Date),[u,d]=(0,He.useState)(l.getMonth()),[h,p]=(0,He.useState)(l.getFullYear()),[f,g]=(0,He.useState)(up(l));(0,He.useEffect)((()=>{c(r),d(r.getMonth()),p(r.getFullYear()),g(up(r))}),[r]);const m=new Date,y=function(e){return e%4==0&&e%100!=0||e%400==0}(h)?sp:op,v=Array(y[u]+(f-1)).fill(null);return(0,e.jsx)("div",{className:"w-300 ".concat(s," min-h-[210px]"),children:(0,e.jsxs)("div",{className:"ml-auto mr-auto w-70",children:[(0,e.jsx)("div",{className:"flex w-full flex-wrap",children:ap.map((t=>(0,e.jsx)("div",{className:"flex h-8 w-[14.2%] items-center justify-center",children:t},t)))}),(0,e.jsx)("div",{className:"flex w-full flex-wrap",children:v.map(((t,n)=>{const r=n-(f-2),s=new Date(h,u,r),l=s.getDate(),c=a[cp(s)]||[],d=o&&(0,je.gx)(o,s),p=c.length>0?"item":d?"template":"empty";return(0,e.jsx)(ip,{isLastMonth:r<=0,day:l,isToday:(0,je.gx)(s,m),onClick:()=>i(s),type:p},n)}))})]})})},pp=(0,He.forwardRef)(((t,n)=>{let{children:r,paginateFront:i,paginateEnd:o,direction:s="vertical",onElementVisibility:a,className:l,isMobileScreen:c}=t;const u=(0,He.useRef)(null),d=(0,He.useRef)(null),[h,p]=(0,He.useState)(!0),[f,g]=(0,He.useState)(!1),m=(0,He.useRef)(null),[y,v]=(0,He.useState)(0),[A,b]=(0,He.useState)(!1);(0,He.useImperativeHandle)(n,(()=>({scrollToElementId(e){S(e)}})));const w=(0,He.useMemo)((()=>new IntersectionObserver((e=>{const t=e.find((e=>e.isIntersecting));t&&(null==a||a(t.target.id))}),{threshold:1})),[a]);(0,He.useEffect)((()=>{const e=Array.from(m.current.children);for(const t of e)w.observe(t);return()=>{for(const t of e)w.unobserve(t)}}),[w,r]);const S=(0,He.useCallback)((e=>{const t=document.getElementById(e);t?(V(R.DailyNotes,"Scrolling to element",e),t.scrollIntoView({behavior:"auto",block:"center",inline:"center"})):V(R.DailyNotes,"Element not found",e)}),[]);(0,He.useLayoutEffect)((()=>{m.current&&A&&("vertical"===s?(m.current.scrollTop+=m.current.scrollHeight-y,c&&g(!0)):m.current.scrollLeft+=m.current.scrollWidth-y,b(!1))}),[A,y,s,c]),(0,He.useLayoutEffect)((()=>{f&&setTimeout((()=>{m.current&&(V(R.DailyNotes,"[InfiniteScroller] Applying mobile pagination fix"),m.current.scrollTop+=m.current.scrollHeight-y,g(!1))}),50)}),[f,y]);const C=(0,He.useCallback)((()=>{v("vertical"===s?m.current.scrollHeight:m.current.scrollWidth),b(!0),i()}),[i,s]),E=(0,He.useCallback)((()=>{o()}),[o]),I=(0,He.useMemo)((()=>new IntersectionObserver((e=>{if(e[0].isIntersecting){if(h)return V(R.DailyNotes,"[InfiniteScroller] Ignoring first front sentinel event"),void p(!1);C()}}),{threshold:.5})),[C,h]);(0,He.useEffect)((()=>{u.current&&I.observe(u.current)}),[I,u]);const _=(0,He.useMemo)((()=>new IntersectionObserver((e=>{e[0].isIntersecting&&E()}),{threshold:.5})),[E]);return(0,He.useEffect)((()=>{d.current&&_.observe(d.current)}),[_,d]),(0,e.jsxs)("div",{ref:m,className:l,style:{overflowY:"scroll",flexDirection:"vertical"===s?"column":"row"},children:[(0,e.jsx)("div",{style:{width:1,height:1,backgroundColor:"transparent"},ref:u}),r,(0,e.jsx)("div",{style:{width:1,height:1,backgroundColor:"transparent"},ref:d})]})})),fp=(0,He.forwardRef)(((n,r)=>{let{activities:i,onDateSelect:o,selectedDay:s,className:a,children:l}=n;const[c,u]=(0,He.useState)(!(0,t.Av)()),[d,h]=(0,He.useState)(!1),p=(0,He.useRef)(null),f=$d(s),[g,m]=(0,He.useState)(new Date),y=new Date,[v,A]=(0,He.useState)((()=>{const e=[{date:y}];return dp(e,"front",2),dp(e,"end",2),e})),b=(0,He.useCallback)((e=>{for(const t of v)if((0,je.Bn)(t.date,e))return!0;return!1}),[v]),w=(0,He.useCallback)((e=>{A(function(e,t){const n=e[0].date,r=e[e.length-1].date,i=t.getTime()<n.getTime();return dp(e,i?"front":"end",Math.abs(i?(0,je.ML)(n,t):(0,je.ML)(r,t)))}(v,e))}),[v]),S=(0,He.useCallback)((e=>{var t;const n=k(e);null===(t=p.current)||void 0===t||t.scrollToElementId(n)}),[p]),C=(0,He.useCallback)((e=>{b(e)||w(e),V(R.DailyNotes,"[Calendar] Scrolling to month",e,"from goToMonth"),m(e),S(e)}),[b,w,S]);(0,He.useImperativeHandle)(r,(()=>({goToMonth(e){C(e)}})),[C]);const E=(0,He.useCallback)((e=>{const t=[{date:e}];dp(t,"front",1),dp(t,"end",1),A(t)}),[A]);(0,He.useEffect)((()=>{if(s){if(f&&(0,je.gx)(f,s))return void V(R.DailyNotes,"[Calendar] selectedDay has changed, but is same as previous",s);V(R.DailyNotes,"[Calendar] selectedDay has changed, going to month:",s),C(s)}}),[s,C,f]),(0,He.useEffect)((()=>{d&&c&&(V(R.DailyNotes,"[Calendar] Scrolling to month",g,"from restoreScrollAfterExpand useEffect"),S(g),h(!1))}),[c,S,g,d,h]);const I=(0,He.useCallback)((()=>{V(R.DailyNotes,"[Calendar] paginateLeft"),A((e=>{const t=e.slice();return dp(t,"front",2),t}))}),[A]),_=(0,He.useCallback)((()=>{V(R.DailyNotes,"[Calendar] paginateRight"),A((e=>{const t=e.slice();return dp(t,"end",2),t}))}),[A]),x=(0,He.useCallback)((e=>{const t=v.findIndex((t=>k(t.date)===e));if(t>=0){const e=v[t];V(R.DailyNotes,"[Calendar] Month element did become visible, setting activeDate",e),m(e.date)}}),[v]),P=(0,He.useCallback)((()=>{h(!0),u(!c)}),[c,u,h]),k=e=>"month-".concat(e.getFullYear(),"-").concat(e.getMonth()),B=(0,He.useCallback)((e=>{E(e),o(e)}),[o,E]);return(0,e.jsxs)("div",{className:"border-b border-solid border-border",children:[(0,e.jsxs)("div",{onClick:P,className:(0,Q.classNames)("text-md flex cursor-pointer items-center justify-center px-4 py-2","text-center font-bold hover:bg-contrast"),children:[lp[g.getMonth()]," ",g.getFullYear()]}),c&&(0,e.jsx)(pp,{paginateFront:I,paginateEnd:_,direction:"horizontal",onElementVisibility:x,ref:p,className:a,isMobileScreen:(0,t.Av)(),children:v.map((t=>{const n=k(t.date);return(0,e.jsx)("div",{id:n,children:(0,e.jsx)(hp,{className:"mx-2",activities:i,onDateSelect:B,startDate:t.date,selectedDay:s},n)},n)}))}),c&&l]})})),gp=n=>{let{items:i,itemListController:o,onSelect:s,selectedUuids:a,selectedTag:l}=n;var c;const{toggleAppPane:u}=(0,Zr.G)(),[d,h]=(0,He.useState)(!1),[p,f]=(0,He.useState)(),[g,m]=(0,He.useState)(),y=(0,He.useRef)(null),[v,A]=(0,He.useState)(),b=(0,He.useRef)(null),[w,S]=(0,He.useState)((()=>function(e){const t=[Xh(new Date)];return $h(t,"front",4),$h(t,"end",5)}())),{hideTags:C,hideDate:E,hideNotePreview:I}=o.webDisplayOptions,_=(0,He.useMemo)((()=>(e=>{const t={};for(const n of e){const e=Jh(n.created_at);t[e]||(t[e]=[]),t[e].push(n)}return t})(i)),[i]),x=(0,He.useMemo)((()=>function(e,t){var n;if(!e)return 0;const r=e.date;let i=-1,o=!0,s=0;for(;o;){const e=t[Jh((0,Q.addDaysToDate)(r,i))];if(!e||0===(null==e?void 0:e.length)){o=!1;break}s++,i--}return s+((null===(n=t[Jh(e.date)])||void 0===n?void 0:n.length)>0?1:0)}(p,_)),[p,_]);(0,He.useEffect)((()=>{f(w.find((e=>e.isToday)))}),[w]),(0,He.useLayoutEffect)((()=>{var e;p&&b.current&&(null===(e=b.current)||void 0===e||e.scrollToElementId(p.id))}),[p,b]);const P=(0,He.useMemo)((()=>i.map((e=>({date:e.created_at,item:e})))),[i]),k=(0,He.useCallback)((()=>{V(R.DailyNotes,"[ContentList] paginateBottom"),S((e=>{const t=e.slice();return $h(t,"end",10),t}))}),[S]),B=(0,He.useCallback)((()=>{V(R.DailyNotes,"[ContentList] paginateTop"),S((e=>{const t=e.slice();return $h(t,"front",10),t}))}),[S]),O=(0,He.useCallback)((e=>{var t;const n=w.find((t=>t.id===e));n&&n!==v?(A(n),V(R.DailyNotes,"[ContentList] Item did become visible for date",n.date),null===(t=null==y?void 0:y.current)||void 0===t||t.goToMonth(n.date)):V(R.DailyNotes,"[ContentList] Ignoring duplicate day visibility")}),[w,v]),N=(0,He.useCallback)((async(e,t,n)=>{await s(t,n),u($e.n.Editor),m(e.date)}),[s,u]),D=(0,He.useCallback)((e=>{m(e),o.createNewNote(void 0,e,"editor"),u($e.n.Editor)}),[m,o,u]),j=(0,He.useCallback)((e=>w.find((t=>Jh(e)===t.dateKey))),[w]);(0,He.useEffect)((()=>{if(d){if(h(!1),!p)return;const e=_[p.id];if((null==e?void 0:e.length)>0){const t=e[0],n=j(t.created_at);n&&N(n,e[0],!1)}else{D(p.date);const e=document.getElementById(p.id);null==e||e.scrollIntoView({behavior:"auto"})}}}),[d,N,D,p,j,_]),(0,He.useEffect)((()=>{h(!0)}),[l.uuid]);const T=(0,He.useCallback)((e=>{const t=Xh(e),n=_[t.id];(null==n?void 0:n.length)>0?N(t,n[0],!1):t&&D(t.date)}),[N,D,_]),M=g&&(null===(c=_[Jh(g)])||void 0===c?void 0:c.length)>0;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(fp,{activities:P,activityType:"created",onDateSelect:T,selectedDay:g,selectedDayType:g?M?"item":"template":void 0,ref:y,className:"flex-column flex",children:x>0&&(0,e.jsxs)("div",{className:"flex w-full items-center justify-center border-t border-solid border-border bg-secondary-background p-2",children:[(0,e.jsx)("span",{className:"opacity-50",children:"Current Streak"}),(0,e.jsxs)("span",{className:"ml-1.5 font-bold",children:[x," ",(0,r.pluralize)(x,"Day","Days")]})]})}),(0,e.jsx)(pp,{paginateFront:B,paginateEnd:k,direction:"vertical",onElementVisibility:O,className:"flex-1",ref:b,isMobileScreen:(0,t.Av)(),children:w.map((t=>{const n=_[t.id];return n?n.map((n=>(0,e.jsx)(rp,{selected:a.has(n.uuid),section:t,id:t.id,item:n,hideDate:E,hidePreview:I,hideTags:C,onClick:()=>N(t,n,!0)},n.uuid))):(0,e.jsx)(rp,{selected:g&&t.id===Jh(g),section:t,id:t.id,onClick:()=>D(t.date)},t.dateKey)}))})]})};var mp;!function(e){e.Files="Encrypted File Storage",e.Super="Super notes"}(mp||(mp={}));const yp={transform:"translate3d(0, 0, 0)"},vp=t=>{let{label:n,style:i,onClick:o}=t;const s=(0,Ln.c)(i);return(0,e.jsx)("button",{className:(0,r.classNames)("fixed bottom-6 right-6 z-editor-title-bar ml-3 flex h-15 w-15 cursor-pointer items-center","justify-center rounded-full border border-solid border-transparent ".concat(s),"hover:brightness-125"),title:n,"aria-label":n,onClick:o,style:yp,children:(0,e.jsx)(xn.Z,{type:"add",size:"custom",className:"h-8 w-8"})})};function Ap(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ap(Object(n),!0).forEach((function(t){wp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ap(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wp(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sp(t){let{row:n,index:i,canSelectRows:o,handleRowClick:s,handleRowContextMenu:a,handleActivateRow:l}=t;const[c,u]=(0,He.useState)(!1),[d,h]=(0,He.useState)(!1),p=c||d,f=n.cells.filter((e=>!e.hidden));return(0,e.jsx)("div",bp(bp({role:"row",id:n.id,"aria-rowindex":i+2},o?{"aria-selected":n.isSelected}:{}),{},{className:"group relative contents",onMouseEnter:()=>{u(!0)},onMouseLeave:()=>{u(!1)},onClick:e=>s(e,n.id),onDoubleClick:()=>l(n.id),onContextMenu:a(n.id),onFocus:()=>{h(!0)},onBlur:e=>{var t;(null===(t=e.relatedTarget)||void 0===t?void 0:t.closest('[id="'.concat(n.id,'"]')))||h(!1)},children:f.map(((t,s,a)=>(0,e.jsxs)("div",{role:"gridcell","aria-rowindex":i+2,"aria-colindex":t.colIndex+1,className:(0,r.classNames)("relative flex items-center overflow-hidden border-b border-border px-3 py-4 focus:border-info",n.isSelected&&"bg-info-backdrop",o&&"cursor-pointer",o&&p&&"bg-contrast"),tabIndex:-1,children:[t.render,n.rowActions&&s===a.length-1&&(0,e.jsxs)("div",{className:(0,r.classNames)("absolute right-0 top-0 flex h-full items-center p-2",n.isSelected||p?"":"invisible",d&&"visible"),children:[(0,e.jsx)("div",{className:"z-[1]",children:n.rowActions}),(0,e.jsx)("div",{className:(0,r.classNames)("absolute right-0 top-0 z-0 h-full w-full backdrop-blur-[2px]",n.isSelected||p?"":"invisible")})]})]},s)))}))}const Cp=Math.ceil(document.documentElement.clientHeight/50)||20,Ep=function(t){let{table:n}=t;const i=(0,sr.I)(),[o,s]=(0,He.useState)(Cp),a=(0,He.useCallback)((()=>{s((e=>e+Cp))}),[]),l=(0,He.useCallback)((e=>{const t=e.target;t.scrollTop+t.offsetHeight>=t.scrollHeight-200&&a()}),[a]),{id:c,headers:u,rows:d,colCount:h,rowCount:p,selectRow:f,multiSelectRow:g,rangeSelectUpToRow:m,handleRowContextMenu:y,handleActivateRow:v,selectedRows:A,selectionActions:b,canSelectRows:w,canSelectMultipleRows:S,showSelectionActions:C}=n,E=(0,He.useRef)(0),I=(0,He.useRef)(0),_=(0,He.useCallback)((e=>{const t=e.target,n=t.closest('[role="row"]'),r=t.closest('[role="gridcell"],[role="columnheader"]');n&&(E.current=parseInt(n.getAttribute("aria-rowindex")||"0")),r&&(I.current=parseInt(r.getAttribute("aria-colindex")||"0"))}),[]),x=(0,He.useCallback)((e=>{document.activeElement.closest('[role="grid"]')!==e.target&&(E.current=0,I.current=0)}),[]),P=(0,He.useCallback)((e=>{const t=e.currentTarget,n=t.querySelectorAll('[role="row"]'),r=Array.from(n).find((e=>e.getAttribute("aria-rowindex")===E.current.toString())),o=Array.from(r?r.querySelectorAll("[tabindex]"):[]),s=u.length,a=(e,n)=>{const r=t.querySelector('[role="row"][aria-rowindex="'.concat(e,'"]'));if(!r)return;const i=r.querySelector('[aria-colindex="'.concat(n,'"]'));i&&i.focus()};switch(e.key){case L.u8.Up:e.preventDefault(),E.current>1&&a(E.current-1,I.current);break;case L.u8.Down:e.preventDefault(),E.current<=p&&a(E.current+1,I.current);break;case L.u8.Left:{if(e.preventDefault(),!o)return;const t=o.findIndex((e=>parseInt(e.getAttribute("aria-colindex")||"0")===I.current));if(0===t)return;const n=o[t-1];if(!n)return;n.focus();break}case L.u8.Right:{if(e.preventDefault(),!o)return;const t=o.findIndex((e=>parseInt(e.getAttribute("aria-colindex")||"0")===I.current));if(t===o.length-1)return;const n=o[t+1];if(!n)return;n.focus();break}case L.u8.Home:if(e.preventDefault(),e.ctrlKey)a(1,1);else{if(!o)return;const e=o[0];if(!e)return;const t=parseInt(e.getAttribute("aria-colindex")||"0");t>0&&a(E.current,t)}break;case L.u8.End:{if(e.preventDefault(),e.ctrlKey)return void a(n.length,s||h);if(!o)return;const t=o[o.length-1];if(!t)return;const r=parseInt(t.getAttribute("aria-colindex")||"0");r>0&&a(E.current,r);break}case L.u8.PageUp:{e.preventDefault();const t=E.current-5;a(t>0?t:1,I.current);break}case L.u8.PageDown:{e.preventDefault();const t=E.current+5;t<=n.length?a(t,I.current):a(n.length,I.current);break}case L.u8.Enter:{const t=e.target.closest('[role="columnheader"]');if(t&&t.getAttribute("data-can-sort"))return e.preventDefault(),void t.click();const n=null==r?void 0:r.id;n&&(e.preventDefault(),v(n));break}case L.u8.Space:{const t=e.target,n=null==r?void 0:r.id;if(!n)return;if("gridcell"!==t.getAttribute("role"))return;e.preventDefault(),(i.keyboardService.isMac?e.metaKey:e.ctrlKey)&&S?g(n):e.shiftKey&&S?m(n):f(n);break}}}),[i.keyboardService.isMac,S,h,v,u.length,g,m,p,f]),k=(0,He.useCallback)(((e,t)=>{w&&((i.keyboardService.isMac?e.metaKey:e.ctrlKey)&&S?g(t):e.shiftKey&&S?m(t):f(t))}),[i.keyboardService.isMac,S,w,g,m,f]);return(0,e.jsxs)("div",{className:"block min-h-0 overflow-auto",onScroll:l,children:[C&&A.length>=2&&(0,e.jsxs)("div",{className:"sticky top-0 z-[2] flex items-center justify-between border-b border-border bg-default px-3 py-2",children:[(0,e.jsxs)("span",{className:"text-info-0 text-sm font-medium",children:[A.length," selected"]}),A.length>0&&b]}),(0,e.jsxs)("div",{className:"relative grid w-full overflow-x-hidden px-3",role:"grid","aria-colcount":h,"aria-rowcount":p,"aria-multiselectable":S,onFocus:_,onBlur:x,onKeyDown:P,id:"table-".concat(c),children:[(0,e.jsx)("div",{role:"row","aria-rowindex":1,className:"contents",children:u.filter((e=>!e.hidden)).map(((t,n)=>(0,e.jsx)("div",bp(bp({role:"columnheader","aria-rowindex":1,"aria-colindex":t.colIndex+1,"aria-sort":t.isSorting?t.sortReversed?"descending":"ascending":"none",className:(0,r.classNames)("border-b border-border px-3 pb-2 pt-3 text-left text-sm font-medium text-passive-0",t.sortBy&&"cursor-pointer hover:bg-info-backdrop hover:underline focus:border-info focus:bg-info-backdrop"),style:{gridColumn:n+1},onClick:t.onSortChange,"data-can-sort":!!t.sortBy||void 0},t.sortBy&&{tabIndex:0===n?0:-1}),{},{children:(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[t.name,t.isSorting&&(0,e.jsx)(xn.Z,{type:t.sortReversed?"arrow-up":"arrow-down",size:"custom",className:"h-4.5 w-4.5 text-passive-1"})]})}),n.toString())))}),(0,e.jsx)("div",{className:"contents whitespace-nowrap",children:d.slice(0,o).map(((t,n)=>(0,e.jsx)(Sp,{row:t,index:n,canSelectRows:w,handleRowClick:k,handleRowContextMenu:y,handleActivateRow:v},t.id)))})]})]})},Ip=(0,Nn.Pi)((t=>{let{createAndAddNewTag:n,linkItems:i,results:o,searchQuery:s,shouldShowCreateTag:a,onClickCallback:l,isEntitledToNoteLinking:c,item:u}=t;const d=(0,He.useCallback)((e=>{n(e),null==l||l()}),[n,l]);return(0,e.jsxs)("div",{className:"my-1",children:[o.map((t=>{const n=!c&&t instanceof r.SNNote;return(0,e.jsxs)("button",{className:"flex w-full items-center justify-between gap-4 overflow-hidden px-3 py-2 hover:bg-contrast hover:text-foreground focus:bg-info-backdrop",onClick:()=>{i(u,t),null==l||l()},children:[(0,e.jsx)(Sc.Z,{item:t,searchQuery:s}),n&&(0,e.jsx)(xn.Z,{type:Mn._,className:"ml-auto flex-shrink-0 text-info"})]},t.uuid)})),a&&(0,e.jsx)(Cc.d,{searchQuery:s,onClickCallback:d})]})}));var _p=s(79323);const xp=t=>{let{file:n,closeMenu:r,handleFileAction:i,setIsRenamingFile:o}=t;const[s,a]=(0,He.useState)(n.protected);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(ci.Z,{onClick:()=>{i({type:cn.d.PreviewFile,payload:{file:n,otherFiles:[]}}),r()},children:[(0,e.jsx)(xn.Z,{type:"file",className:"mr-2 text-neutral"}),"Preview file"]}),(0,e.jsx)(oo.Z,{classes:"my-1"}),(0,e.jsxs)(Dn.Z,{className:"justify-between",checked:s,onChange:()=>{i({type:cn.d.ToggleFileProtection,payload:{file:n},callback:e=>{a(e)}}).catch(console.error)},children:[(0,e.jsx)(xn.Z,{type:"lock",className:"mr-2 text-neutral"}),"Password protect"]}),(0,e.jsx)(oo.Z,{classes:"my-1"}),(0,e.jsxs)(ci.Z,{onClick:()=>{i({type:cn.d.DownloadFile,payload:{file:n}}).catch(console.error),r()},children:[(0,e.jsx)(xn.Z,{type:"download",className:"mr-2 text-neutral"}),"Download"]}),(0,e.jsxs)(ci.Z,{onClick:()=>{o(!0),r()},children:[(0,e.jsx)(xn.Z,{type:"pencil",className:"mr-2 text-neutral"}),"Rename"]}),(0,e.jsxs)(ci.Z,{onClick:()=>{i({type:cn.d.DeleteFile,payload:{file:n}}).catch(console.error),r()},children:[(0,e.jsx)(xn.Z,{type:"trash",className:"mr-2 text-danger"}),(0,e.jsx)("span",{className:"text-danger",children:"Delete permanently"})]}),(0,e.jsx)(Od,{file:n})]})},Pp=t=>{let{activateItem:n,item:i,searchQuery:o,unlinkItem:s,handleFileAction:a}=t;var l;const c=(0,He.useRef)(null),u=(0,sr.I)(),[d,h]=(0,He.useState)(!1),p=()=>h((e=>!e)),[f,g]=(0,He.useState)(!1),[m,y]=(0,_p.b)(i,u),v=null!==(l=i.title)&&void 0!==l?l:"";return(0,e.jsxs)("div",{className:"relative flex items-center justify-between",children:[f&&i instanceof r.FileItem?(0,e.jsxs)("div",{className:"flex flex-grow items-center gap-4 py-2 pl-3 pr-12",children:[(0,e.jsx)(xn.Z,{type:m,className:(0,Q.classNames)("flex-shrink-0",y)}),(0,e.jsx)("input",{className:"min-w-0 flex-grow bg-default text-sm",defaultValue:v,onKeyDown:e=>{e.key===L.u8.Escape?g(!1):e.key===L.u8.Enter&&(async e=>{i instanceof r.FileItem&&(await a({type:cn.d.RenameFile,payload:{file:i,name:e}}),g(!1))})(e.currentTarget.value)},ref:e=>{e&&e.focus()}})]}):(0,e.jsx)("button",{className:"flex max-w-full flex-grow items-center justify-between gap-4 py-2 pl-3 pr-12 text-sm hover:bg-info-backdrop focus:bg-info-backdrop",onClick:()=>n(i),onContextMenu:e=>{e.preventDefault(),p()},children:(0,e.jsx)(Sc.Z,{item:i,searchQuery:o})}),(0,e.jsx)("button",{className:"absolute right-3 top-1/2 h-7 w-7 -translate-y-1/2 cursor-pointer rounded-full border-0 bg-transparent p-1 hover:bg-contrast",onClick:p,ref:c,children:(0,e.jsx)(xn.Z,{type:"more",className:"text-neutral"})}),(0,e.jsxs)(On.Z,{title:"Options",open:d,togglePopover:p,anchorElement:c,side:"bottom",align:"center",className:"py-2",children:[(0,e.jsxs)(ci.Z,{onClick:()=>{s(),p()},children:[(0,e.jsx)(xn.Z,{type:"link-off",className:"mr-2 text-danger"}),"Unlink"]}),i instanceof r.FileItem&&(0,e.jsx)(xp,{file:i,closeMenu:p,handleFileAction:a,setIsRenamingFile:g}),(0,e.jsx)(oo.Z,{classes:"my-2"}),(0,e.jsxs)("div",{className:"mt-1 px-3 py-1 text-xs font-medium text-neutral",children:[(0,e.jsxs)("div",{className:"mb-1",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Created at:"})," ",(0,je.Eu)(i.created_at)]}),(0,e.jsxs)("div",{className:"mb-1",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Modified at:"})," ",(0,je.Eu)(i.userModifiedDate)]}),(0,e.jsxs)("div",{className:"mb-1",children:[(0,e.jsx)("span",{className:"font-semibold",children:"ID:"})," ",i.uuid]}),i instanceof r.FileItem&&(0,e.jsxs)("div",{children:[(0,e.jsx)("span",{className:"font-semibold",children:"Size:"})," ",(0,co.vU)(i.decryptedSize)]})]})]})]})};var kp=s(20153);const Bp=(0,Nn.Pi)((t=>{let{item:n}=t;const i=(0,sr.I)(),{linkItems:o,unlinkItems:s,activateItem:a,createAndAddNewTag:l,isEntitledToNoteLinking:c}=i.linkingController,{notesLinkedToItem:u,notesLinkingToItem:d,filesLinkedToItem:h,filesLinkingToItem:p,tagsLinkedToItem:f}=(0,kp.f)(n),{entitledToFiles:g}=i.featuresController,m=(0,He.useRef)(null),[y,v]=(0,He.useState)(""),A=!!y.length,{linkedResults:b,unlinkedItems:w,shouldShowCreateTag:S}=(0,_c.Q)(y,i,n),C=(0,He.useCallback)((e=>{e&&e.focus()}),[]);return(0,e.jsxs)("div",{children:[(0,e.jsx)("form",{className:(0,Q.classNames)("sticky top-0 z-10 bg-default px-2.5 pt-2.5 md:translucent-ui:bg-transparent",b.length||w.length||d.length?"border-b border-border pb-2.5":"pb-1"),children:(0,e.jsx)(ui.Z,{type:"text",className:{container:(0,Q.classNames)(A?"py-0":"px-0.5 py-1.5","md:translucent-ui:bg-default"),input:"placeholder:text-passive-0"},placeholder:"Search items to link...",value:y,onChange:v,ref:(0,kr.l)([C,m]),right:[A&&(0,e.jsx)(Gh,{onClick:()=>{var e;v(""),null===(e=m.current)||void 0===e||e.focus()}})]})}),(0,e.jsx)("div",{className:"divide-y divide-border",children:A?(0,e.jsxs)(e.Fragment,{children:[(!!w.length||S)&&(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mb-1 mt-3 px-3 text-menu-item font-semibold uppercase text-passive-0",children:"Unlinked"}),(0,e.jsx)(Ip,{createAndAddNewTag:l,linkItems:o,results:w,searchQuery:y,shouldShowCreateTag:S,isEntitledToNoteLinking:c,onClickCallback:()=>{var e;v(""),null===(e=m.current)||void 0===e||e.focus()},item:n})]}),!!b.length&&(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mb-1 mt-3 px-3 text-menu-item font-semibold uppercase text-passive-0",children:"Linked"}),(0,e.jsx)("div",{className:"my-1",children:b.map((t=>(0,e.jsx)(Pp,{item:t.item,searchQuery:y,unlinkItem:()=>s(n,t.item),activateItem:a,handleFileAction:i.filesController.handleFileAction},t.id)))})]})]}):(0,e.jsxs)(e.Fragment,{children:[!!f.length&&(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mb-1 mt-3 px-3 text-menu-item font-semibold uppercase text-passive-0",children:"Linked Tags"}),(0,e.jsx)("div",{className:"my-1",children:f.map((t=>(0,e.jsx)(Pp,{item:t.item,searchQuery:y,unlinkItem:()=>s(n,t.item),activateItem:a,handleFileAction:i.filesController.handleFileAction},t.id)))})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mb-1 mt-3 px-3 text-menu-item font-semibold uppercase text-passive-0",children:"Linked Files"}),(0,e.jsxs)("div",{className:"my-1",children:[(0,e.jsxs)("button",{className:"flex w-full cursor-pointer items-center gap-3 bg-transparent px-3 py-2 text-left text-base text-text hover:bg-info-backdrop hover:text-foreground focus:bg-info-backdrop focus:shadow-none md:text-sm",onClick:async()=>{g?i.filesController.selectAndUploadNewFiles(n instanceof r.SNNote?n:void 0,(e=>{o(n,e)})):i.featuresController.showPremiumAlert(mp.Files)},children:[(0,e.jsx)(xn.Z,{type:"add"}),"Upload and link file(s)"]}),h.map((t=>(0,e.jsx)(Pp,{item:t.item,searchQuery:y,unlinkItem:()=>s(n,t.item),activateItem:a,handleFileAction:i.filesController.handleFileAction},t.id)))]})]}),!!p.length&&(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mb-1 mt-3 px-3 text-menu-item font-semibold uppercase text-passive-0",children:"Files Linking To Current File"}),(0,e.jsx)("div",{className:"my-1",children:p.map((t=>(0,e.jsx)(Pp,{item:t.item,searchQuery:y,unlinkItem:()=>s(n,t.item),activateItem:a,handleFileAction:i.filesController.handleFileAction},t.id)))})]}),!!u.length&&(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mb-1 mt-3 px-3 text-menu-item font-semibold uppercase text-passive-0",children:"Linked Notes"}),(0,e.jsx)("div",{className:"my-1",children:u.map((t=>(0,e.jsx)(Pp,{item:t.item,searchQuery:y,unlinkItem:()=>s(n,t.item),activateItem:a,handleFileAction:i.filesController.handleFileAction},t.id)))})]}),!!d.length&&(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mb-1 mt-3 px-3 text-menu-item font-semibold uppercase text-passive-0",children:"Notes Linking To This Note"}),(0,e.jsx)("div",{className:"my-1",children:d.map((t=>(0,e.jsx)(Pp,{item:t.item,searchQuery:y,unlinkItem:()=>s(n,t.item),activateItem:a,handleFileAction:i.filesController.handleFileAction},t.id)))})]})]})})]})}));function Op(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Np(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Op(Object(n),!0).forEach((function(t){Dp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Op(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Dp(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const jp=t=>{let{items:n}=t;const[i,o]=(0,He.useState)(!1),s=(0,He.useRef)(null),a=(0,He.useMemo)((()=>n.every((e=>e instanceof r.SNNote))),[n]),l=(0,He.useMemo)((()=>n.every((e=>e instanceof r.FileItem))),[n]);return a||l?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("button",{className:"rounded-full border border-border bg-default p-1",ref:s,onClick:e=>{e.preventDefault(),e.stopPropagation(),o((e=>!e))},children:(0,e.jsx)(xn.Z,{type:"more"})}),(0,e.jsx)(On.Z,{title:"File options",open:i,anchorElement:s,togglePopover:()=>{o(!1)},side:"bottom",align:"start",className:"py-2",children:(0,e.jsxs)(qr.Z,{a11yLabel:"File context menu",children:[l&&(0,e.jsx)(Nd,{closeMenu:()=>{o(!1)},shouldShowRenameOption:!1,shouldShowAttachOption:!1,selectedFiles:n}),a&&(0,e.jsx)(Qu,{notes:n,closeMenu:()=>{o(!1)}})]})})]}):null},Tp=t=>{let{item:n}=t;const[r,i]=(0,He.useState)(!1),o=(0,He.useRef)(null);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("button",{className:"rounded-full border border-border bg-default p-1",ref:o,onClick:e=>{e.preventDefault(),e.stopPropagation(),i((e=>!e))},children:(0,e.jsx)(xn.Z,{type:"link"})}),(0,e.jsx)(On.Z,{title:"Linked items",open:r,anchorElement:o,togglePopover:()=>{i(!1)},side:"bottom",align:"start",className:"py-2",children:(0,e.jsx)(Bp,{item:n})})]})},Mp=t=>{let{item:n,hideIcon:i}=t;const o=(0,sr.I)(),[s,a]=(0,He.useState)(void 0),l=n instanceof r.FileItem,c=(0,r.isNote)(n)?o.componentManager.editorForNote(n):void 0,u=(0,r.isNote)(n)?n.noteType:c?c.noteType:void 0,[d,h]=(0,Do.i)(u);return(0,He.useEffect)((()=>{var e;l&&(null===(e=o.fileBackups)||void 0===e||e.getFileBackupInfo(n).then(a))}),[o,l,n]),(0,e.jsxs)("div",{className:"flex items-center gap-3 whitespace-normal",children:[(0,e.jsxs)("span",{className:"relative",children:[i?null:l?xd((0,Bd.A)(n.mimeType),"w-6 h-6 flex-shrink-0"):(0,e.jsx)(xn.Z,{type:d,className:"text-accessory-tint-".concat(h)}),s&&(0,e.jsx)("div",{className:"absolute bottom-1 right-1 translate-x-1/2 translate-y-1/2 rounded-full bg-default text-success",title:"File is backed up locally",children:(0,e.jsx)(xn.Z,{size:"small",type:"check-circle-filled"})})]}),(0,e.jsx)("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap text-sm font-medium",children:n.title}),(0,e.jsx)(lh,{item:n}),n.protected&&(0,e.jsx)("span",{className:"flex items-center",title:"File is protected",children:(0,e.jsx)(xn.Z,{ariaLabel:"File is protected",type:"lock-filled",className:"h-3.5 w-3.5 text-passive-1",size:"custom"})})]})},Fp=t=>{let{item:n}=t;const{notesLinkedToItem:r,notesLinkingToItem:i,filesLinkedToItem:o,filesLinkingToItem:s,tagsLinkedToItem:a}=(0,kp.f)(n),l=(0,sr.I)(),c=r.concat(i,o,s,a);return c.length?(0,e.jsxs)("div",{className:"flex items-center gap-2 overflow-hidden",children:[(0,e.jsx)(ms.Z,{className:"overflow-hidden border border-transparent hover:border-border focus:border-info focus:shadow-none",link:c[0],unlinkItem:async e=>{l.mutator.unlinkItems(n,e)},isBidirectional:!1},c[0].id),c.length-1>=1&&(0,e.jsxs)("span",{children:["and ",c.length-1," more..."]})]}):null},Rp=t=>{let{application:n,items:i}=t;const o=i.some((e=>e instanceof r.FileItem)),{sortBy:s,sortDirection:a}=n.itemListController.displayOptions,l="asc"===a,{hideDate:c,hideEditorIcon:u,hideTags:d}=n.itemListController.webDisplayOptions,h=(0,He.useCallback)((async(e,t)=>{const i=n.navigationController.selected;if(i)if(i.uuid!==r.SystemViewId.Files)(0,r.isSmartView)(i)&&(0,r.isSystemView)(i)||await n.changeAndSaveItem.execute(i,(n=>{n.preferences=Np(Np({},n.preferences),{},{sortBy:e,sortReverse:t})}));else{const i=n.getPreference(r.PrefKey.SystemViewPreferences)||{},o=i[r.SystemViewId.Files]||{};await n.setPreference(r.PrefKey.SystemViewPreferences,Np(Np({},i),{},{[r.SystemViewId.Files]:Np(Np({},o),{},{sortBy:e,sortReverse:t})}))}}),[n]),[p,f]=(0,He.useState)(void 0),[g,m]=(0,He.useState)(void 0),y=(0,et.ac)(et.Jj.sm),v=(0,et.ac)(et.Jj.md),A=(0,et.ac)(et.Jj.lg),b=(0,He.useMemo)((()=>[{name:"Name",sortBy:"title",cell:t=>(0,e.jsx)(Mp,{item:t,hideIcon:u})},{name:"Upload date",sortBy:"created_at",cell:e=>(0,je.Eu)(e.created_at),hidden:y||c},{name:"Size",sortBy:"decryptedSize",cell:e=>e instanceof r.FileItem?(0,co.vU)(e.decryptedSize):null,hidden:y||!o},{name:"Attached to",hidden:y||v||A||d,cell:t=>(0,e.jsx)(Fp,{item:t})}]),[c,u,d,A,v,y,o]),w=(0,He.useCallback)((e=>e.uuid),[]),S=function(e){let{data:t,columns:n,sortBy:i,sortReversed:o,onSortChange:s,getRowId:a,enableRowSelection:l,enableMultipleRowSelection:c,selectedRowIds:u,onRowSelectionChange:d,onRowActivate:h,onRowContextMenu:p,rowActions:f,selectionActions:g,showSelectionActions:m}=e;const[y,v]=(0,He.useState)(u||[]),A=(0,He.useRef)(r.UuidGenerator.GenerateUuid());(0,He.useEffect)((()=>{u&&v(u)}),[u]),(0,He.useEffect)((()=>{d&&d(y)}),[y,d]);const b=(0,He.useMemo)((()=>n.map(((e,t)=>({name:e.name,isSorting:i&&i===e.sortBy,sortBy:e.sortBy,sortReversed:o,onSortChange:()=>{s&&e.sortBy&&s(e.sortBy,i===e.sortBy&&!o)},hidden:e.hidden||!1,colIndex:t})))),[n,s,i,o]),w=(0,He.useMemo)((()=>t.map(((e,t)=>{const r=n.map(((t,n)=>({render:t.cell(e),hidden:t.hidden||!1,colIndex:n}))),i=a?a(e):t.toString();return{id:i,isSelected:!!l&&y.includes(i),cells:r,rowData:e,rowActions:f?f(e):void 0}}))),[n,t,l,a,f,y]),S=(0,He.useCallback)((e=>{l&&v([e])}),[l]),C=(0,He.useCallback)((e=>{l&&c&&v((t=>t.includes(e)?t.filter((t=>t!==e)):[...t,e]))}),[c,l]),E=(0,He.useCallback)((e=>{if(!l||!c)return;const t=w.findIndex((e=>e.id===y[y.length-1])),n=w.findIndex((t=>t.id===e)),r=Math.min(t,n),i=Math.max(t,n),o=w.slice(r,i+1).map((e=>e.id));v(o)}),[c,l,w,y]),I=(0,He.useCallback)((e=>{var t;if(!h)return;const n=null===(t=w.find((t=>t.id===e)))||void 0===t?void 0:t.rowData;n&&h(n)}),[h,w]),_=(0,He.useCallback)((e=>t=>{var n;if(!p)return;t.preventDefault();const r=null===(n=w.find((t=>t.id===e)))||void 0===n?void 0:n.rowData;r&&(v([e]),p(t.clientX,t.clientY,r))}),[p,w]),x=(0,He.useMemo)((()=>n.length),[n]),P=(0,He.useMemo)((()=>t.length),[t.length]);return(0,He.useMemo)((()=>({id:A.current,headers:b,rows:w,colCount:x,rowCount:P,selectRow:S,multiSelectRow:C,rangeSelectUpToRow:E,handleActivateRow:I,handleRowContextMenu:_,selectedRows:y,canSelectRows:l||!1,canSelectMultipleRows:c||!1,selectionActions:g?g(y):void 0,showSelectionActions:m||!1})),[b,w,x,P,S,C,E,I,_,y,l,c,g,m])}({data:i,sortBy:s,sortReversed:l,onSortChange:h,getRowId:w,columns:b,enableRowSelection:!0,enableMultipleRowSelection:!0,onRowActivate(e){e instanceof r.FileItem&&n.filesController.handleFileAction({type:cn.d.PreviewFile,payload:{file:e,otherFiles:i.filter((e=>e instanceof r.FileItem))}})},onRowContextMenu(e,t,n){m({x:e,y:t}),f(n)},rowActions:t=>{const r=n.vaults.getItemVault(t),i=(null==r?void 0:r.isSharedVaultListing())&&n.vaultUsers.isCurrentUserReadonlyVaultMember(r);return(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[!i&&(0,e.jsx)(Tp,{item:t}),(0,e.jsx)(jp,{items:[t]})]})},selectionActions:t=>(0,e.jsx)(jp,{items:i.filter((e=>t.includes(e.uuid)))}),showSelectionActions:!0}),C=()=>{m(void 0),f(void 0)};return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ep,{table:S}),g&&p&&(0,e.jsxs)(On.Z,{title:"Options",open:!0,anchorPoint:g,togglePopover:()=>{m(void 0),f(void 0)},side:"bottom",align:"start",className:"py-2",children:[p instanceof r.FileItem&&(0,e.jsx)(qr.Z,{a11yLabel:"File context menu",children:(0,e.jsx)(Nd,{closeMenu:C,shouldShowRenameOption:!1,shouldShowAttachOption:!1,selectedFiles:[p]})}),p instanceof r.SNNote&&(0,e.jsx)(qr.Z,{className:"select-none",a11yLabel:"Note context menu",children:(0,e.jsx)(Qu,{notes:[p],closeMenu:C})})]})]})},Lp=t=>{let{addNewItem:n}=t;return(0,e.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-center",children:[(0,e.jsx)(Po.FilesIllustration,{className:"h-32 w-32"}),(0,e.jsx)("div",{className:"mb-2 mt-4 text-lg font-bold",children:"You don't have any files yet"}),(0,e.jsx)("div",{className:"mb-4 max-w-[35ch] text-center text-sm text-passive-0",children:"Files attached to your notes appear here. You can also upload files directly from this page."}),(0,e.jsx)(Ln.Z,{primary:!0,onClick:n,children:"Upload files"})]})},Qp=(0,Nn.Pi)((t=>{let{notesController:n,navigationController:i}=t;const{selectedNotes:o}=n,{selected:s}=i,a=o.some((e=>e.archived));return(0,e.jsxs)("div",{className:"flex w-full bg-contrast pb-safe-bottom",children:[(0,e.jsx)("button",{className:"flex-grow px-2 py-3 active:bg-passive-3",onClick:()=>n.togglePinSelectedNotes(),children:(0,e.jsx)(xn.Z,{type:"pin",className:"mx-auto text-info",size:"large"})}),(0,e.jsx)("button",{className:"flex-grow px-2 py-3 active:bg-passive-3",onClick:()=>n.toggleArchiveSelectedNotes().catch(console.error),children:(0,e.jsx)(xn.Z,{type:a?"unarchive":"archive",className:"mx-auto text-info",size:"large"})}),(0,e.jsx)("button",{className:"flex-grow px-2 py-3 active:bg-passive-3",onClick:()=>{const e=s&&(0,r.isSmartView)(s)&&s.uuid===r.SystemViewId.TrashedNotes,t=o.every((e=>e.trashed));e||t?n.deleteNotesPermanently().catch(console.error):n.setTrashSelectedNotes(!0).catch(console.error)},children:(0,e.jsx)(xn.Z,{type:"trash",className:"mx-auto text-info",size:"large"})}),(0,e.jsx)("button",{className:"flex-grow px-2 py-3 active:bg-passive-3",onClick:()=>n.setContextMenuOpen(!0),children:(0,e.jsx)(xn.Z,{type:"more",className:"mx-auto text-info",size:"large"})})]})})),Up=(0,He.forwardRef)(((t,n)=>{let{application:i,className:o,id:s,children:a,onPanelWidthLoad:l}=t;const{paneController:c,accountMenuController:u,filesController:d,itemListController:h,navigationController:p,noAccountWarningController:f,searchOptionsController:g,linkingController:m,notesController:y}=i,{setPaneLayout:v,panes:A}=(0,Zr.G)(),{selected:b,selectedAsTag:w}=p,{completedFullSync:S,createNewNote:C,optionsSubtitle:E,paginate:I,panelTitle:_,renderedItems:x,items:P,isCurrentNoteTemplate:k,isTableViewEnabled:B,selectedUuids:O,selectNextItem:N,selectPreviousItem:D}=h,j=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,He.useRef)(t);return(0,He.useEffect)((()=>{e&&("function"==typeof e?e(n.current):e.current=n.current)}),[e]),n}(n),{addDragTarget:T,removeDragTarget:M}=Gd();(0,He.useEffect)((()=>i.addWebEventObserver(((e,t)=>{if(e===r.WebAppEvent.PanelResized){const{panel:e,width:n}=t;e===pt.WB&&(w?p.setPanelWidthForTag(w,n):i.setPreference(r.PrefKey.NotesPanelWidth,n).catch(console.error))}}))),[i,p,w]),(0,He.useEffect)((()=>{var e;const t=(null===(e=null==b?void 0:b.preferences)||void 0===e?void 0:e.panelWidth)||i.getPreference(r.PrefKey.NotesPanelWidth);t&&l(t)}),[b,i,l]);const F=(0,He.useCallback)((async e=>{const t=p.selected;t&&(p.isInAnySystemView()||p.isInSmartView()?console.error("Trying to link uploaded files to smart view"):await m.linkItems(e,t))}),[p,m]);(0,He.useEffect)((()=>{const e=j.current,t=p.selected,n=!p.isInAnySystemView()&&!p.isInSmartView();return e&&n&&t&&T(e,{tooltipText:'Drop your files to upload and link them to tag "'.concat(t.title,'"'),callback:F}),()=>{e&&M(e)}}),[T,F,p,p.selected,M,j]);const R=null==b?void 0:b.iconString,U=(0,He.useMemo)((()=>p.isInFilesView),[p.isInFilesView]),V=(0,He.useCallback)((async()=>{if(U){if(!i.entitledToFiles)return void i.showPremiumModal(mp.Files);d.selectAndUploadNewFiles()}else await C(),v(mt.h.Editing)}),[U,i,d,C,v]),K=(0,et.ac)(et.Jj.sm),H=(U||B)&&!K;(0,He.useEffect)((()=>{const e=document.getElementById(kl.N.SearchBar);return i.keyboardService.addCommandHandlers([{command:L.kS,category:"General",description:"Create new note",onKeyDown:e=>{e.preventDefault(),V()}},{command:L.QE,category:"Notes list",description:"Go to next item",elements:[document.body,...e?[e]:[]],onKeyDown:()=>{e===document.activeElement&&(null==e||e.blur()),H||N()}},{command:L.um,category:"Notes list",description:"Go to previous item",element:document.body,onKeyDown:()=>{H||D()}},{command:L.RL,category:"General",description:"Toggle global search",onKeyDown:t=>{e&&(t.preventDefault(),e.focus())}},{command:L.ZC,onKeyDown:()=>{e&&e.blur()}},{command:L.hh,category:"General",description:"Select all items",onKeyDown:e=>{e.target.closest("#".concat(kl.N.ContentList))&&(e.preventDefault(),h.selectAll())}}])}),[V,i.keyboardService,C,h,N,D,H]);const G=(0,He.useMemo)((()=>i.keyboardService.keyboardShortcutForCommand(L.kS)),[i]),Y=(0,He.useMemo)((()=>U?"Upload file":"Create a new note in the selected tag (".concat(G&&(0,L.Ld)(G),")")),[U,G]),z=null==w?void 0:w.isDailyEntry,Z=(0,He.useCallback)((async(e,t)=>{await h.selectItemWithScrollHandling(e,{userTriggered:!0,scrollIntoView:!1===t,animated:!1})}),[h]);(0,He.useEffect)((()=>{var e;A.includes($e.n.Editor)||null===(e=j.current)||void 0===e||e.style.removeProperty("width")}),[O,j,k,x,A]);const[W]=oc("right",(()=>v(mt.h.TagSelection)),{requiresStartFromEdge:i.platform!==r.Platform.Android});return(0,e.jsxs)("div",{id:s,className:(0,Q.classNames)(o,"sn-component section h-full overflow-hidden pt-safe-top"),"aria-label":"Notes & Files",ref:(0,kr.l)([j,W]),children:[K&&!h.isMultipleSelectionMode&&(0,e.jsx)(vp,{onClick:V,label:Y,style:z?"danger":"info"}),(0,e.jsx)("div",{id:"items-title-bar",className:"section-title-bar border-b border-solid border-border",children:(0,e.jsxs)("div",{id:"items-title-bar-container",children:[b&&(0,e.jsx)(zh,{application:i,panelTitle:_,icon:R,addButtonLabel:Y,addNewItem:V,isFilesSmartView:U,isTableViewEnabled:B||U,optionsSubtitle:E,selectedTag:b,filesController:d,itemListController:h,paneController:c}),(!H||K)&&(0,e.jsx)(qh,{itemListController:h,searchOptionsController:g,hideOptions:H}),(0,e.jsx)(_h,{accountMenuController:u,noAccountWarningController:f})]})}),h.isMultipleSelectionMode&&(0,e.jsxs)("div",{className:"flex items-center border-b border-l-2 border-border border-l-transparent py-2.5 pr-4",children:[(0,e.jsx)("div",{className:"px-4",children:(0,e.jsx)($r.Z,{label:"Select all items",showOnHover:!0,showOnMobile:!0,children:(0,e.jsx)("button",{className:"ml-auto rounded border border-border p-1 hover:bg-contrast",onClick:()=>{h.selectAll()},children:(0,e.jsx)(xn.Z,{type:"select-all",size:"medium"})})})}),(0,e.jsxs)("div",{className:"text-base font-semibold md:text-sm",children:[h.selectedItemsCount," selected"]}),(0,e.jsx)($r.Z,{label:"Cancel multiple selection",showOnHover:!0,showOnMobile:!0,children:(0,e.jsx)("button",{className:"ml-auto rounded border border-border p-1 hover:bg-contrast",onClick:()=>{h.cancelMultipleSelection()},children:(0,e.jsx)(xn.Z,{type:"close",size:"medium"})})})]}),w&&z&&(0,e.jsx)(gp,{items:P,selectedTag:w,selectedUuids:O,itemListController:h,onSelect:Z}),z||!S||x.length?null:U?(0,e.jsx)(Lp,{addNewItem:V}):(0,e.jsx)("p",{className:"empty-items-list opacity-50",children:"No items."}),z||S||x.length?null:(0,e.jsx)("p",{className:"empty-items-list opacity-50",children:"Loading..."}),!z&&x.length?H?(0,e.jsx)(Rp,{items:P,application:i}):(0,e.jsx)(Eh,{items:x,selectedUuids:O,application:i,paginate:I}):null,K&&h.isMultipleSelectionMode&&(0,e.jsx)(Qp,{notesController:y,navigationController:p}),(0,e.jsx)("div",{className:"absolute bottom-0 h-safe-bottom w-full"}),a]})})),Vp=(0,Nn.Pi)(Up);var Kp,Hp;!function(e){e.Right="right",e.Left="left"}(Kp||(Kp={})),function(e){e.WidthOnly="WidthOnly",e.OffsetAndWidth="OffsetAndWidth"}(Hp||(Hp={}));class Gp extends He.Component{constructor(e){var n;super(e),n=this,this.resizerElementRef=(0,He.createRef)(),this.isAtMaxWidth=()=>Math.abs(Math.round(this.lastWidth+this.lastLeft)-Math.round(this.getParentRect().width))<5,this.finishSettingWidth=()=>{this.props.collapsable&&this.setState({collapsed:this.isCollapsed()})},this.setWidth=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];0===e&&(e=n.computeMaxWidth()),e<n.minWidth&&(e=n.minWidth);const r=n.getParentRect();e>r.width&&(e=r.width);const i=n.appFrame.width-n.props.panel.getBoundingClientRect().x;e>i&&(e=i);const o=Math.round(e+n.lastLeft)===Math.round(r.width);return n.props.modifyElementWidth&&(o?n.props.type===Hp.WidthOnly?n.props.panel.style.removeProperty("width"):n.props.panel.style.width="calc(100% - ".concat(n.lastLeft,"px)"):n.props.panel.style.width=e+"px"),n.lastWidth=e,t&&(n.finishSettingWidth(),n.props.resizeFinishCallback&&n.props.resizeFinishCallback(n.lastWidth,n.lastLeft,n.isAtMaxWidth(),n.isCollapsed())),n.props.widthEventCallback&&n.props.widthEventCallback(e),e},this.setLeft=e=>{this.props.panel.style.left=e+"px",this.lastLeft=e},this.onDblClick=()=>{var e,t;this.isCollapsed()?this.setWidth(this.widthBeforeLastDblClick||this.props.defaultWidth||0):(this.widthBeforeLastDblClick=this.lastWidth,this.setWidth(this.minWidth)),this.finishSettingWidth(),null===(t=(e=this.props).resizeFinishCallback)||void 0===t||t.call(e,this.lastWidth,this.lastLeft,this.isAtMaxWidth(),this.isCollapsed())},this.handleResize=()=>{const e=this.isAtMaxWidth()?this.computeMaxWidth():this.props.panel.scrollWidth;this.startWidth=e,this.lastWidth=e,this.handleWidthEvent(),this.finishSettingWidth()},this.onMouseDown=e=>{this.addInvisibleOverlay(),this.lastDownX=e.clientX,this.startWidth=this.props.panel.scrollWidth,this.startLeft=this.props.panel.offsetLeft,this.setState({pressed:!0})},this.onMouseUp=()=>{if(this.removeInvisibleOverlay(),!this.state.pressed)return;this.setState({pressed:!1});const e=this.isAtMaxWidth();this.props.resizeFinishCallback&&this.props.resizeFinishCallback(this.lastWidth,this.lastLeft,e,this.isCollapsed()),this.finishSettingWidth()},this.onMouseMove=e=>{this.state.pressed&&(e.preventDefault(),this.props.side===Kp.Left?this.handleLeftEvent(e):this.handleWidthEvent(e))},this.addInvisibleOverlay=()=>{if(this.overlay)return;const e=document.createElement("div");e.id="resizer-overlay",this.overlay=e,document.body.prepend(this.overlay)},this.removeInvisibleOverlay=()=>{this.overlay&&(this.overlay.remove(),this.overlay=void 0)},this.state={collapsed:!1,pressed:!1},this.minWidth=e.minWidth||5,this.startLeft=e.panel.offsetLeft,this.startWidth=e.panel.scrollWidth,this.lastDownX=0,this.lastLeft=e.panel.offsetLeft,this.lastWidth=e.panel.scrollWidth,this.widthBeforeLastDblClick=0,this.setWidth(this.props.width),this.setLeft(this.props.left),document.addEventListener("mouseup",this.onMouseUp),document.addEventListener("mousemove",this.onMouseMove),this.debouncedResizeHandler=(0,t.Ds)(this.handleResize,250),this.props.type===Hp.OffsetAndWidth&&window.addEventListener("resize",this.debouncedResizeHandler)}componentDidMount(){var e;null===(e=this.resizerElementRef.current)||void 0===e||e.addEventListener("dblclick",this.onDblClick)}componentDidUpdate(e){this.lastWidth=this.props.panel.scrollWidth,this.props.width!=e.width&&this.setWidth(this.props.width),this.props.left!==e.left&&(this.setLeft(this.props.left),this.setWidth(this.props.width));const t=this.isCollapsed();t!==this.state.collapsed&&this.setState({collapsed:t})}componentWillUnmount(){var e;null===(e=this.resizerElementRef.current)||void 0===e||e.removeEventListener("dblclick",this.onDblClick),document.removeEventListener("mouseup",this.onMouseUp),document.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("resize",this.debouncedResizeHandler)}get appFrame(){var e;return null===(e=document.getElementById("app"))||void 0===e?void 0:e.getBoundingClientRect()}getParentRect(){return this.props.panel.parentNode?this.props.panel.parentNode.getBoundingClientRect():new DOMRect}isCollapsed(){return this.lastWidth<=this.minWidth}handleWidthEvent(e){let t;e?t=e.clientX:(t=0,this.lastDownX=0);const n=t-this.lastDownX,r=this.startWidth+n,i=this.setWidth(r,!1);this.props.widthEventCallback&&this.props.widthEventCallback(i)}handleLeftEvent(e){const t=this.props.panel.getBoundingClientRect();let n=(e.clientX||t.x)-this.lastDownX,r=this.startLeft+n;r<0&&(r=0,n=-this.startLeft);const i=this.getParentRect();let o=this.startWidth-n;o<this.minWidth&&(o=this.minWidth),o>i.width&&(o=i.width),r+o>i.width&&(r=i.width-o),this.setLeft(r),this.setWidth(o,!1)}computeMaxWidth(){let e=this.getParentRect().width-this.props.left;return e<this.minWidth&&(e=this.minWidth),e}render(){return(0,e.jsx)("div",{className:(0,Q.classNames)("panel-resizer","absolute right-0 top-0 z-panel-resizer","hidden h-full w-[4px] cursor-col-resize border-y-0 bg-[color:var(--panel-resizer-background-color)] md:block",this.props.alwaysVisible||this.state.collapsed||this.state.pressed?" opacity-100":"opacity-0",this.props.hoverable&&"hover:opacity-100",this.props.side===Kp.Left&&"left-0 right-auto"),onMouseDown:this.onMouseDown,ref:this.resizerElementRef})}}const Yp=Gp,zp=(0,Nn.Pi)((t=>{let{view:n,tagsState:i,setEditingSmartView:o}=t;const s=(0,sr.I)(),[a,l]=(0,He.useState)(n.title||""),c=(0,He.useRef)(null),u=i.selected===n,d=i.editingTag===n;(0,He.useEffect)((()=>{l(n.title||"")}),[l,n]);const h=(0,He.useCallback)((async()=>{await i.setSelectedTag(n,"views",{userTriggered:!0})}),[i,n]),p=(0,He.useCallback)((()=>{i.save(n,a).catch(console.error),l(n.title)}),[i,n,a,l]),f=(0,He.useCallback)((e=>{const t=e.target.value;l(t)}),[l]),g=(0,He.useCallback)((e=>{var t;"Enter"===e.code&&(null===(t=c.current)||void 0===t||t.blur(),e.preventDefault())}),[c]);(0,He.useEffect)((()=>{var e;d&&(null===(e=c.current)||void 0===e||e.focus())}),[c,d]);const m=(0,He.useCallback)((()=>{o(n)}),[o,n]),y=(0,He.useCallback)((()=>{i.remove(n,!0).catch(console.error)}),[i,n]),v=((e,t)=>({[r.SystemViewId.StarredNotes]:"text-warning"}[e.uuid]||(t?"text-info":"text-neutral")))(n,u),[A,b]=(0,He.useState)(0);return(0,He.useEffect)((()=>{if(n.uuid===r.SystemViewId.Conflicts)return s.items.streamItems(r.ContentType.TYPES.Note,(()=>{b(s.items.numberOfNotesWithConflicts())}))}),[s,n]),n.uuid!==r.SystemViewId.Conflicts||A?(0,e.jsxs)("button",{tabIndex:pt.HF,className:(0,Q.classNames)("tag group px-3.5 py-0.5 focus-visible:!shadow-inner md:py-0",u&&"selected",!1),onClick:h,onContextMenu:e=>{e.preventDefault(),e.stopPropagation(),(0,r.isSystemView)(n)||m()},style:{paddingLeft:"".concat(14,"px")},children:[(0,e.jsxs)("div",{className:"tag-info",children:[(0,e.jsx)("div",{className:"tag-icon mr-2",children:(0,e.jsx)(xn.Z,{type:n.iconString,className:(0,Q.classNames)(v,"group-hover:text-text")})}),d?(0,e.jsx)("input",{className:"title editing text-mobile-navigation-list-item lg:text-navigation-list-item",id:"react-tag-".concat(n.uuid),onBlur:p,onInput:f,value:a,onKeyUp:g,spellCheck:!1,ref:c}):(0,e.jsx)("div",{className:"title overflow-hidden text-left text-mobile-navigation-list-item lg:text-navigation-list-item",id:"react-tag-".concat(n.uuid),children:a}),(0,e.jsxs)("div",{className:"count text-base lg:text-sm",children:[n.uuid===r.SystemViewId.AllNotes&&i.allNotesCount,n.uuid===r.SystemViewId.Files&&i.allFilesCount,n.uuid===r.SystemViewId.Conflicts&&A]})]}),!(0,r.isSystemView)(n)&&(0,e.jsxs)("div",{className:"meta",children:[n.conflictOf&&(0,e.jsx)("div",{className:"-mt-1 text-[0.625rem] font-bold text-danger",children:"Conflicted Copy"}),u&&(0,e.jsxs)("div",{className:"menu",children:[(0,e.jsx)("a",{className:"item",onClick:m,children:"Edit"}),(0,e.jsx)("a",{className:"item",onClick:y,children:"Delete"})]})]})]}):null})),Zp=(0,Nn.Pi)((t=>{let{navigationController:n,featuresController:r,setEditingSmartView:i}=t;const o=n.smartViews,[s,a]=(0,He.useState)(null);return(0,qu.Z)(s,{initialFocus:0,shouldAutoFocus:!1,shouldWrapAround:!1,resetLastFocusedOnBlur:!0}),0===o.length&&n.isSearching?(0,e.jsx)("div",{className:"px-4 py-1 text-base opacity-60 lg:text-sm",children:"No smart views found. Try a different search."}):(0,e.jsx)("div",{ref:a,children:o.map((t=>(0,e.jsx)(zp,{view:t,tagsState:n,features:r,setEditingSmartView:i},t.uuid)))})})),Wp=(0,Nn.Pi)((t=>{let{application:n,navigationController:r,featuresController:i}=t;const o=Qr(),s=(0,He.useMemo)((()=>new cs(n)),[n]),a=(0,He.useMemo)((()=>new ps(n)),[n]),l=(0,He.useCallback)((()=>{i.hasSmartViews?s.setIsAddingSmartView(!0):o.activate(pt.t2)}),[s,o,i.hasSmartViews]);return(0,e.jsxs)("section",{children:[(0,e.jsx)("div",{className:"section-title-bar",children:(0,e.jsxs)("div",{className:"section-title-bar-header",children:[(0,e.jsx)("div",{className:"title text-base md:text-sm",children:(0,e.jsx)("span",{className:"font-bold",children:"Views"})}),!r.isSearching&&(0,e.jsx)(Na.Z,{focusable:!0,icon:"add",title:"Create a new smart view",className:"p-0 text-neutral",onClick:l})]})}),(0,e.jsx)(Zp,{navigationController:r,featuresController:i,setEditingSmartView:a.setView}),(0,e.jsx)(Fr,{isOpen:!!a.view,close:a.closeDialog,children:(0,e.jsx)(us,{controller:a,platform:n.platform})}),(0,e.jsx)(Fr,{isOpen:s.isAddingSmartView,close:s.closeModal,children:(0,e.jsx)(is,{controller:s,platform:n.platform})})]})})),qp=(0,Nn.Pi)((t=>{let{tagsState:n}=t;const[r,i]=(0,He.useState)(!1),o=(0,He.useCallback)((()=>{i(!1)}),[]),s=(0,He.useCallback)((e=>{e.dataTransfer.types.includes(hh)&&(e.preventDefault(),i(!0))}),[]),a=(0,He.useCallback)((e=>{i(!1);const t=e.dataTransfer.getData(hh);t&&t&&n.assignParent(t,void 0)}),[n]);return(0,e.jsxs)("div",{className:(0,Q.classNames)("root-drop",r&&"active is-drag-over"),onDragExit:o,onDragOver:s,onDragLeave:o,onDrop:a,children:[(0,e.jsx)(xn.Z,{className:"text-neutral",type:"link-off"}),(0,e.jsxs)("p",{className:"content",children:["Move the tag here to ",(0,e.jsx)("br",{}),"remove it from its folder."]})]})})),Jp=(0,Nn.Pi)((t=>{let{tag:n,type:i,features:o,navigationController:s,level:a,onContextMenu:l,linkingController:c}=t;const u=(0,sr.I)(),[d,h]=(0,He.useState)(n.title||""),[p,f]=(0,He.useState)(""),g=(0,He.useRef)(null),m=(0,He.useRef)(null),y=(0,He.useRef)(null),v=s.contextMenuTag===n&&s.contextMenuOpen&&s.contextMenuTagSection===i,A=s.selected===n&&s.selectedLocation===i,b=s.editingTag===n&&s.selectedLocation===i,w=s.addingSubtagTo===n&&(s.contextMenuTag===n?s.contextMenuTagSection===i:s.selectedLocation===i),S=(0,_.Fl)((()=>s.getNotesCount(n))),C=(0,_.Fl)((()=>s.getChildren(n))).get(),E=C.length>0,I=o.hasFolders,x=Qr(),[P,k]=(0,He.useState)(n.expanded),[B,O]=(0,He.useState)(E),[N,D]=(0,He.useState)(!1);(0,He.useEffect)((()=>{!B&&E&&k(!0),O(E)}),[B,E]),(0,He.useEffect)((()=>{h(n.title||"")}),[h,n]);const j=(0,He.useCallback)((e=>{E&&(k(e),s.isSearching||s.setExpanded(n,e))}),[E,s,n]),T=(0,He.useCallback)((e=>{null==e||e.stopPropagation(),j(!P)}),[P,j]);(0,He.useEffect)((()=>{s.isSearching||k(n.expanded)}),[s.isSearching,n]);const M=(0,He.useCallback)((async()=>{await s.setSelectedTag(n,i,{userTriggered:!0})}),[s,n,i]),F=(0,He.useCallback)((()=>{s.save(n,d).catch(console.error),h(n.title)}),[s,n,d,h]),U=(0,He.useCallback)((e=>{const t=e.target.value;h(t)}),[h]),K=(0,He.useCallback)((e=>{var t;e.key===L.u8.Enter&&(null===(t=g.current)||void 0===t||t.blur(),e.preventDefault())}),[g]);(0,He.useEffect)((()=>{var e;b&&(null===(e=g.current)||void 0===e||e.focus())}),[g,b]);const H=(0,He.useCallback)((e=>{const t=e.target.value;f(t)}),[]),G=(0,He.useCallback)((()=>{s.createSubtagAndAssignParent(n,p).catch(console.error),f("")}),[p,n,s]),Y=(0,He.useCallback)((e=>{var t;e.key===L.u8.Enter&&(e.preventDefault(),null===(t=m.current)||void 0===t||t.blur())}),[m]);(0,He.useEffect)((()=>{var e;w&&(null===(e=m.current)||void 0===e||e.focus())}),[m,w]);const z=(0,He.useCallback)((e=>{var t;if(e.preventDefault(),e.stopPropagation(),!y.current)return;const r=s.contextMenuOpen,o=null===(t=y.current)||void 0===t?void 0:t.getBoundingClientRect();r?s.setContextMenuOpen(!1):l(n,i,o.right,o.top)}),[s,l,n,i]),Z=(0,He.useRef)(null),{addDragTarget:W,removeDragTarget:q}=Gd();(0,He.useEffect)((()=>{const e=Z.current;return e&&W(e,{tooltipText:'Drop your files to upload and link them to tag "'.concat(n.title,'"'),async callback(e){await c.linkItems(e,n)}}),()=>{e&&q(e)}}),[W,c,q,n]),V(R.NavigationList,"Rendering TagsListItem");const J=(0,He.useCallback)((e=>{e.dataTransfer.setData(hh,n.uuid)}),[n.uuid]),X=(0,He.useCallback)((e=>{(e.dataTransfer.types.includes(hh)||e.dataTransfer.types.includes(ph))&&(e.preventDefault(),D(!0))}),[]),$=(0,He.useCallback)((()=>{D(!1)}),[]),ee=(0,He.useCallback)((e=>{(e.dataTransfer.types.includes(hh)||e.dataTransfer.types.includes(ph))&&e.preventDefault()}),[]),te=(0,He.useCallback)((async e=>{D(!1);const t=e.dataTransfer.getData(hh),i=e.dataTransfer.getData(ph);if(t){if(!s.isValidTagParent(n,{uuid:t}))return;return I?void s.assignParent(t,n.uuid):void x.activate(pt.Uj)}if(i){const e=s.selected,t=e instanceof r.SNTag&&e.uuid!==n.uuid,o=u.items.findSureItem(i);return await c.linkItems(o,n),void(t&&await c.unlinkItems(o,e))}}),[u.items,I,c,s,x,n]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{role:"button",tabIndex:pt.HF,className:(0,Q.classNames)("tag group px-3.5 py-0.5 focus-visible:!shadow-inner md:py-0",(A||v)&&"selected",N&&"is-drag-over"),onClick:M,onKeyDown:e=>{e.key===L.u8.Enter||e.key===L.u8.Space?M().catch(console.error):e.key===L.u8.Left?j(!1):e.key===L.u8.Right&&j(!0)},ref:Z,style:{paddingLeft:"".concat(21*a+14,"px")},onContextMenu:e=>{e.preventDefault(),l(n,i,e.clientX,e.clientY)},draggable:!s.isSearching,onDragStart:J,onDragEnter:X,onDragExit:$,onDragOver:ee,onDragLeave:$,onDrop:te,children:[(0,e.jsxs)("div",{className:"tag-info",title:d,children:[(0,e.jsx)("div",{onClick:M,className:"tag-icon draggable mr-2",children:(0,e.jsx)(xn.Z,{type:n.iconString,className:(0,Q.classNames)("cursor-pointer group-hover:text-text",A?"text-info":"text-neutral")})}),b&&(0,e.jsx)("input",{className:"title editing overflow-hidden text-mobile-navigation-list-item focus:shadow-none focus:outline-none lg:text-navigation-list-item",id:"react-tag-".concat(n.uuid,"-").concat(i),onBlur:F,onInput:U,value:d,onKeyDown:K,spellCheck:!1,ref:g}),!b&&(0,e.jsx)(e.Fragment,{children:(0,e.jsx)("div",{className:"title overflow-hidden text-left text-mobile-navigation-list-item focus:shadow-none focus:outline-none lg:text-navigation-list-item",id:"react-tag-".concat(n.uuid,"-").concat(i),children:d})}),(0,e.jsxs)("div",{className:"flex items-center",children:[A&&(0,e.jsx)("a",{role:"button",className:"mr-2 cursor-pointer border-0 bg-transparent hover:bg-contrast focus:shadow-inner",onClick:z,onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},ref:y,children:(0,e.jsx)(xn.Z,{type:"more",className:"text-neutral"})}),E&&(0,e.jsx)("a",{role:"button",className:"focus:shadow-inner ".concat(P?"cursor-n-resize":"cursor-s-resize"," ").concat(P?"opened":"closed"," "),onClick:T,children:(0,e.jsx)(xn.Z,{className:"text-neutral",size:"large",type:P?"menu-arrow-down-alt":"menu-arrow-right"})}),(0,e.jsx)("div",{onClick:E?T:void 0,className:"count text-base lg:text-sm ".concat(E?P?"cursor-n-resize":"cursor-s-resize":""),children:S.get()})]})]}),n.conflictOf&&(0,e.jsx)("div",{className:"-mt-1 text-[0.625rem] font-bold text-danger",children:"Conflicted Copy"})]}),w&&(0,e.jsx)("div",{className:"tag overflow-hidden",style:{paddingLeft:"".concat(21*(a+1)+14,"px")},children:(0,e.jsxs)("div",{className:"tag-info",children:[(0,e.jsx)("div",{className:"flex h-full min-w-[22px] items-center border-0 bg-transparent p-0"}),(0,e.jsx)("div",{className:"tag-icon mr-1",children:(0,e.jsx)(xn.Z,{type:"hashtag",className:"mr-1 text-neutral"})}),(0,e.jsx)("input",{className:"title w-full text-mobile-navigation-list-item focus:shadow-none focus:outline-none lg:text-navigation-list-item",type:"text",ref:m,onBlur:G,onKeyDown:Y,value:p,onInput:H})]})}),P&&(0,e.jsx)(e.Fragment,{children:C.map((t=>(0,e.jsx)(Jp,{level:a+1,tag:t,type:i,navigationController:s,features:o,linkingController:c,onContextMenu:l},t.uuid)))})]})}));Jp.displayName="TagsListItem";const Xp=(0,Nn.Pi)((t=>{let{type:n}=t;const r=(0,sr.I)(),i="all"===n?r.navigationController.allLocalRootTags:r.navigationController.starredTags,o=(0,He.useCallback)(((e,t)=>{r.navigationController.setContextMenuClickLocation({x:e,y:t}),r.navigationController.setContextMenuOpen(!0)}),[r]),s=(0,He.useCallback)(((e,t,n,i)=>{r.navigationController.setContextMenuTag(e,t),o(n,i)}),[r,o]),[a,l]=(0,He.useState)(null);return(0,qu.Z)(a,{initialFocus:0,shouldAutoFocus:!1,shouldWrapAround:!1,resetLastFocusedOnBlur:!0}),0===i.length?(0,e.jsx)("div",{className:"px-4 text-base opacity-50 lg:text-sm",children:r.navigationController.isSearching?"No tags found. Try a different search.":"No tags or folders. Create one using the add button above."}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{ref:l,children:i.map((t=>(0,e.jsx)(Jp,{level:0,tag:t,type:n,navigationController:r.navigationController,features:r.featuresController,linkingController:r.linkingController,onContextMenu:s},t.uuid)))}),"all"===n&&(0,e.jsx)(qp,{tagsState:r.navigationController})]})}));var $p=s(86429);const ef=(0,Nn.Pi)((t=>{let{tags:n}=t;const r=(0,Bn.o)(),i=(0,He.useMemo)((()=>(0,L.Ld)(r.keyboardShortcutForCommand(L.PV))),[r]);return(0,e.jsx)(Na.Z,{focusable:!0,icon:"add",title:"Create a new tag (".concat(i,")"),className:"p-0 text-neutral",onClick:()=>n.createNewTemplate()})})),tf=(0,Nn.Pi)((t=>{let{features:n,hasMigration:r,onClickMigration:i}=t;const o=n.hasFolders,s=Qr(),a=(0,He.useCallback)((()=>{s.activate(pt.Uj)}),[s]);return o?(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)("div",{className:"title text-base md:text-sm",children:[(0,e.jsx)("span",{className:"font-bold",children:"Folders"}),r&&(0,e.jsx)("label",{className:"ml-1 cursor-pointer font-bold text-info",onClick:i,children:"Migration Available"})]})}):(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)("div",{className:"title text-base md:text-sm",children:[(0,e.jsx)("span",{className:"font-bold",children:"Tags"}),(0,e.jsx)($r.Z,{label:pt.l9,children:(0,e.jsx)("label",{className:"ml-1 cursor-pointer font-bold text-passive-2",onClick:a,children:"Folders"})})]})})})),nf=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),[n,r]=(0,He.useState)(!1),i=(0,He.useCallback)((()=>{r(t.items.hasTagsNeedingFoldersMigration())}),[t]);(0,He.useEffect)((()=>{const e=t.addEventObserver((async e=>{[$p.ApplicationEvent.CompletedInitialSync,$p.ApplicationEvent.SignedIn].includes(e)&&i()}));return()=>{e()}}),[t,i]);const o=(0,He.useCallback)((async()=>{await t.alerts.confirm('<i>Introducing native, built-in nested tags without requiring the legacy Folders extension.</i><br/></br>  To get started, we\'ll need to migrate any tags containing a dot character to the new system.<br/></br>  This migration will convert any tags with dots appearing in their name into a natural hierarchy that is compatible with the new nested tags feature. Running this migration will remove any "." characters appearing in tag names.',"New: Folders to Nested Tags","Run Migration")&&t.mutator.migrateTagsToFolders().then((()=>{t.sync.sync(),i()})).catch(console.error)}),[t,i]);return(0,e.jsxs)(e.Fragment,{children:[t.navigationController.starredTags.length>0&&(0,e.jsxs)("section",{children:[(0,e.jsx)("div",{className:"section-title-bar",children:(0,e.jsx)("div",{className:"section-title-bar-header",children:(0,e.jsx)("div",{className:"title text-base md:text-sm",children:(0,e.jsx)("span",{className:"font-bold",children:"Favorites"})})})}),(0,e.jsx)(Xp,{type:"favorites"})]}),(0,e.jsxs)("section",{children:[(0,e.jsx)("div",{className:"section-title-bar",children:(0,e.jsxs)("div",{className:"section-title-bar-header",children:[(0,e.jsx)(tf,{features:t.featuresController,hasMigration:n,onClickMigration:o}),!t.navigationController.isSearching&&(0,e.jsx)(ef,{tags:t.navigationController,features:t.featuresController})]})}),(0,e.jsx)(Xp,{type:"all"})]})]})})),rf=(0,Nn.Pi)((t=>{let{navigationController:n}=t;const{searchQuery:i,setSearchQuery:o}=n,s=(0,He.useRef)(null),a=(0,He.useCallback)((()=>{var e;o(""),null===(e=s.current)||void 0===e||e.focus()}),[o]),[l,c]=(0,He.useState)(!1),u=(0,He.useRef)(null);return(0,He.useEffect)((()=>{const e=u.current;if(!e)return;const t=e.parentElement;if(!t)return;const n=()=>{const{scrollTop:e}=t;c(e>0)};return t.addEventListener("scroll",n),()=>{t.removeEventListener("scroll",n)}}),[]),(0,e.jsx)("div",{className:(0,r.classNames)("sticky top-0 bg-[inherit] px-4 pt-4",l&&"after:absolute after:left-0 after:top-full after:-z-[1] after:block after:h-4 after:w-full after:border-b after:border-border after:bg-[inherit]"),role:"search",ref:u,children:(0,e.jsx)(ui.Z,{ref:s,autocomplete:!1,className:{container:"!bg-default px-1",input:"text-base placeholder:text-passive-0 lg:text-sm"},placeholder:"Search tags...",value:i,onChange:o,left:[(0,e.jsx)(xn.Z,{type:"search",className:"mr-1 h-4.5 w-4.5 flex-shrink-0 text-passive-1"})],right:[i&&(0,e.jsx)(Gh,{onClick:a})],roundedFull:!0})})})),of=(0,He.forwardRef)(((t,n)=>{let{application:i,className:o,children:s,id:a}=t;const{setPaneLayout:l}=(0,Zr.G)(),[c,u]=(0,He.useState)((()=>i.hasPasscode()));(0,He.useEffect)((()=>i.addEventObserver((async()=>{u(i.hasPasscode())}),r.ApplicationEvent.KeyStatusChanged)),[i]),(0,He.useEffect)((()=>i.addWebEventObserver(((e,t)=>{if(e===r.WebAppEvent.PanelResized){const{panel:e,width:n}=t;e===pt.xi&&i.setPreference(r.PrefKey.TagsPanelWidth,n).catch(console.error)}}))),[i]);const[d]=oc("left",(e=>{l(mt.h.ItemSelection),e.style.left="0"}),{gesture:"swipe"}),{hasBottomInset:h}=Rn();return(0,e.jsxs)("div",{id:a,className:(0,Q.classNames)(o,"sn-component section pb-[50px] md:pb-0","h-full max-h-full overflow-hidden pt-safe-top md:h-full md:max-h-full md:min-h-0"),ref:(0,kr.l)([n,d]),children:[(0,e.jsxs)("div",{id:"navigation-content",className:"flex-grow overflow-y-auto overflow-x-hidden",children:[(0,e.jsx)(rf,{navigationController:i.navigationController}),(0,e.jsx)(Wp,{application:i,featuresController:i.featuresController,navigationController:i.navigationController}),(0,e.jsx)(nf,{})]}),(0,e.jsxs)("div",{className:(0,Q.classNames)("fixed bottom-0 flex min-h-[50px] w-full items-center border-t border-border bg-contrast","px-3.5 pt-2.5 md:hidden",h?"pb-safe-bottom":"pb-2.5"),children:[(0,e.jsx)(ei.Z,{className:"mr-auto bg-default",onClick:()=>{l(mt.h.ItemSelection)},label:"Go to items list",icon:"chevron-left"}),(0,e.jsx)(oi,{application:i,subscriptionContoller:i.subscriptionController,featuresController:i.featuresController}),(0,e.jsx)(ei.Z,{className:"ml-2.5 bg-default",onClick:()=>{i.accountMenuController.toggleShow()},label:"Go to account menu",icon:"account-circle"}),c&&(0,e.jsx)(ei.Z,{id:"lock-item",onClick:()=>i.lock(),label:"Locks application and wipes unencrypted data from memory.",className:"ml-2.5 bg-default",icon:"lock-filled"}),(0,e.jsx)(ai,{openPreferences:()=>i.preferencesController.openPreferences()}),(0,e.jsx)(ti,{application:i,isMobileNavigation:!0}),i.featuresController.isVaultsEnabled()&&(0,e.jsx)(Fi,{isMobileNavigation:!0})]}),s]})})),sf=(0,Nn.Pi)(of),af=(0,Nn.Pi)((t=>{let{notesController:n,onClick:r,onClickPreprocessing:i,onButtonBlur:o}=t;const[s,a]=(0,He.useState)(!1),l=(0,He.useRef)(null),c=(0,He.useCallback)((async()=>{const e=!s;e&&i&&await i(),a(e),r&&r()}),[s,i,r]),[u,d]=(0,He.useState)(!1),h=(0,He.useCallback)((e=>{d(e)}),[]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ei.Z,{id:kl.N.NoteOptionsButton,label:"Note options menu",onClick:c,onBlur:o,ref:l,icon:"more"}),(0,e.jsx)(On.Z,{title:"Note options",disableClickOutside:u,togglePopover:c,anchorElement:l,open:s,className:"select-none",children:(0,e.jsx)(qr.Z,{a11yLabel:"Note options menu",children:(0,e.jsx)(Qu,{notes:n.selectedNotes,requestDisableClickOutside:h,closeMenu:c})})})]})})),lf=(0,Nn.Pi)((t=>{let{className:n="",notesController:r,onClickPreprocessing:i}=t;const o=r.selectedNotes.some((e=>e.pinned)),s=(0,He.useCallback)((async()=>{i&&await i(),r.togglePinSelectedNotes()}),[i,r]),a=(0,Bn.o)(),l=(0,He.useMemo)((()=>(0,L.Ld)(a.keyboardShortcutForCommand(L.Ib))),[a]),c=o?"Unpin note (".concat(l,")"):"Pin note (".concat(l,")");return(0,e.jsxs)("button",{className:(0,Q.classNames)("sn-icon-button flex h-10 min-w-10 cursor-pointer items-center justify-center","focus:bg-contras rounded-full border border-solid border-border text-neutral hover:bg-contrast","md:h-8 md:min-w-8 ".concat(o?"toggled":""),n),onClick:s,title:c,"aria-label":c,children:[(0,e.jsx)(jl.T,{children:"Pin selected notes"}),(0,e.jsx)(xn.Z,{type:"pin",className:"block"})]})})),cf=t=>{let{application:n,notes:i,setDisableClickOutside:o}=t;const s=Qr(),[a,l]=(0,He.useState)(),[c,u]=(0,He.useState)([]),d=(0,He.useMemo)((()=>i.some((e=>e.locked))),[i]),h=(0,He.useMemo)((()=>Ac(n)),[n]),p=(0,He.useCallback)((async(e,t)=>{e.isComponent&&e.asComponent.conflictOf&&n.changeAndSaveItem.execute(e.asComponent,(e=>{e.conflictOf=void 0})),await n.changeAndSaveItem.execute(t,(t=>{const n=t;n.noteType=e.noteType,n.editorIdentifier=e.featureIdentifier}))}),[n]),f=(0,He.useCallback)((async e=>{if(!e.isEntitled)return e.uiFeature.featureIdentifier===r.NativeFeatureIdentifier.TYPES.SuperEditor?void s.showSuperDemo():void s.activate(e.uiFeature.displayName);if(d)n.alerts.alert(ht.L0);else{if(e.uiFeature.noteType===r.NoteType.Super)return o(!0),l(e),void u(i);if(!i.some((t=>{const r=n.componentManager.editorForNote(t);return n.componentManager.doesEditorChangeRequireAlert(r,e.uiFeature)}))||await n.componentManager.showEditorChangeAlert())for(const t of i)p(e.uiFeature,t)}}),[n.alerts,n.componentManager,d,i,s,p,o]),g=h.filter((e=>e.items&&e.items.length)),m=(null==a?void 0:a.uiFeature.noteType)===r.NoteType.Super&&c.length>0,y=(0,He.useCallback)((()=>{const e=c.slice(1);if(0===e.length)return l(void 0),u([]),void o(!1);u(e)}),[c,o]),v=(0,He.useCallback)((()=>{a&&(p(a.uiFeature,c[0]),y())}),[y,c,a,p]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(qr.Z,{a11yLabel:"Change note type",children:g.map((t=>(0,e.jsx)(Jr.Z,{children:t.items.map((n=>(0,e.jsx)(ci.Z,{onClick:()=>{f(n).catch(console.error)},className:"flex-row-reversed py-2",children:(0,e.jsxs)("div",{className:"flex flex-grow items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex items-center",children:[t.icon&&(0,e.jsx)(xn.Z,{type:t.icon,className:"mr-2 ".concat(t.iconClassName)}),n.uiFeature.displayName,n.isLabs&&(0,e.jsx)(Ge.DR,{className:"px-1.5 py-0.5",style:"success",children:"Labs"})]}),!n.isEntitled&&(0,e.jsx)(xn.Z,{type:Mn._,className:Mn.K})]})},n.uiFeature.uniqueIdentifier.value)))},(e=>e.title.toLowerCase().replace(/\s/,"-"))(t))))}),(0,e.jsx)(Fr,{isOpen:m,close:y,children:c[0]&&(0,e.jsx)(Wc,{note:c[0],application:n,onComplete:v,closeDialog:y})})]})},uf=t=>{let{application:n,notesController:r}=t;const i=(0,He.useRef)(null),[o,s]=(0,He.useState)(!1),a=()=>s((e=>!e)),[l,c]=(0,He.useState)(!1);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ei.Z,{label:"Change note type",onClick:a,ref:i,icon:"plain-text"}),(0,e.jsx)(On.Z,{title:"Change note type",togglePopover:a,disableClickOutside:l,anchorElement:i,open:o,className:"md:pb-1",children:(0,e.jsx)(cf,{application:n,notes:r.selectedNotes,setDisableClickOutside:c})})]})},df=(0,Nn.Pi)((t=>{let{application:n}=t;const{notesController:r,itemListController:i}=n,o=r.selectedNotesCount,s=(0,He.useCallback)((()=>{i.cancelMultipleSelection()}),[i]);return(0,e.jsxs)("div",{className:"flex h-full flex-col items-center",children:[(0,e.jsxs)("div",{className:"flex w-full items-center justify-between p-4",children:[(0,e.jsxs)("h1",{className:"m-0 text-lg font-bold",children:[o," selected notes"]}),(0,e.jsxs)("div",{className:"flex",children:[(0,e.jsx)("div",{className:"mr-3",children:(0,e.jsx)(uf,{application:n,notesController:r})}),(0,e.jsx)("div",{className:"mr-3",children:(0,e.jsx)(lf,{notesController:r})}),(0,e.jsx)(af,{notesController:r})]})]}),(0,e.jsxs)("div",{className:"flex min-h-full w-full max-w-md flex-grow flex-col items-center justify-center md:min-h-0",children:[(0,e.jsx)(Po.IlNotesIcon,{className:"block"}),(0,e.jsxs)("h2",{className:"m-0 mt-4 text-center text-lg font-bold",children:[o," selected notes"]}),(0,e.jsx)("p",{className:"mt-2 max-w-60 text-center text-sm",children:"Actions will be performed on all selected notes."}),(0,e.jsx)(Ln.Z,{className:"mt-2.5",onClick:s,children:"Cancel multiple selection"})]})]})})),hf=(0,Nn.Pi)((t=>{let{itemListController:n}=t;const[r,i]=(0,He.useState)(!1),o=(0,He.useRef)(null),s=(0,He.useCallback)((()=>i((e=>!e))),[]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ei.Z,{label:"File options menu",onClick:s,ref:o,icon:"more"}),(0,e.jsx)(On.Z,{title:"File options",togglePopover:s,anchorElement:o,open:r,className:"md:pb-2",children:(0,e.jsx)(qr.Z,{a11yLabel:"File options panel",children:(0,e.jsx)(Nd,{selectedFiles:n.selectedFiles,closeMenu:()=>{i(!1)},shouldShowAttachOption:!1,shouldShowRenameOption:!1})})})]})})),pf=(0,Nn.Pi)((t=>{let{itemListController:n}=t;const r=n.selectedFilesCount,i=(0,He.useCallback)((()=>{n.cancelMultipleSelection()}),[n]);return(0,e.jsxs)("div",{className:"flex h-full flex-col items-center",children:[(0,e.jsxs)("div",{className:"flex w-full items-center justify-between p-4",children:[(0,e.jsxs)("h1",{className:"m-0 text-lg font-bold",children:[r," selected files"]}),(0,e.jsx)("div",{children:(0,e.jsx)(hf,{itemListController:n})})]}),(0,e.jsxs)("div",{className:"flex min-h-full w-full max-w-md flex-grow flex-col items-center justify-center",children:[(0,e.jsx)(Po.IlNotesIcon,{className:"block"}),(0,e.jsxs)("h2",{className:"m-0 mt-4 text-center text-lg font-bold",children:[r," selected files"]}),(0,e.jsx)("p",{className:"mt-2 max-w-60 text-center text-sm",children:"Actions will be performed on all selected files."}),(0,e.jsx)(Ln.Z,{className:"mt-2.5",onClick:i,children:"Cancel multiple selection"})]})]})})),ff=()=>{const{panes:t,replacePanes:n,setPaneLayout:i}=(0,Zr.G)(),{isTablet:o,isTabletOrMobile:s,isMobile:a}=Xd(),l=t.includes($e.n.Items),c=o&&!l?"chevron-right":"chevron-left",u=o?l?"Hide items list":"Show items list":"Go to items list";return(0,e.jsx)(ei.Z,{className:(0,r.classNames)(s?"flex":"hidden","mr-3"),onClick:()=>{a?i(mt.h.ItemSelection):l?n([$e.n.Editor]):i(mt.h.ItemSelection)},label:u,icon:c,iconClassName:"h-6 w-6"})},gf=t=>{let{showAccountMenu:n,onViewItem:r,hasProtectionSources:i,itemType:o}=t;const s=i?"Authenticate to view this ".concat(o,"."):"Add a passcode or create an account to require authentication to view this ".concat(o,".");return(0,e.jsx)("div",{"aria-label":"Protected overlay",className:"section editor sn-component p-5",children:(0,e.jsxs)("div",{className:"flex h-full flex-grow flex-col justify-center md:flex-row md:items-center",children:[(0,e.jsx)("div",{className:"mb-auto p-4 md:hidden",children:(0,e.jsx)(ff,{})}),(0,e.jsxs)("div",{className:"mb-auto flex max-w-md flex-col items-center justify-center text-center md:mb-0",children:[(0,e.jsxs)("h1",{className:"m-0 w-full text-2xl font-bold",children:["This ",o," is protected"]}),(0,e.jsx)("p",{className:"mt-2 w-full text-lg",children:s}),(0,e.jsxs)("div",{className:"mt-4 flex gap-3",children:[!i&&(0,e.jsx)(Ln.Z,{primary:!0,small:!0,onClick:()=>{n()},children:"Open account menu"}),(0,e.jsx)(Ln.Z,{small:!0,onClick:r,children:i?"Authenticate":"View ".concat(o)})]})]})]})})},mf=(0,Nn.Pi)((t=>{let{linkingController:n,onClick:r,onClickPreprocessing:i}=t;const{activeItem:o,isLinkingPanelOpen:s,setIsLinkingPanelOpen:a}=n,l=(0,He.useRef)(null),c=(0,He.useCallback)((async()=>{const e=!s;e&&i&&await i(),a(e),r&&r()}),[s,r,i,a]);return o?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ei.Z,{label:"Linked items panel",onClick:c,ref:l,icon:"link"}),(0,e.jsx)(On.Z,{title:"Linked items",togglePopover:c,anchorElement:l,open:s,className:"pb-2",forceFullHeightOnMobile:!0,children:(0,e.jsx)(Bp,{item:o})})]}):null})),yf=(0,Nn.Pi)((t=>{let{application:n,file:i}=t;const{vault:o}=(0,Ad.j)(i),[s,a]=(0,He.useState)(!1);(0,He.useEffect)((()=>{o&&a(n.vaultUsers.isCurrentUserReadonlyVaultMember(o))}),[n.vaultUsers,o]),(0,He.useEffect)((()=>n.vaultUsers.addEventObserver(((e,t)=>{var i;if(e===r.VaultUserServiceEvent.InvalidatedUserCacheForVault){if(t!==(null===(i=null==o?void 0:o.sharing)||void 0===i?void 0:i.sharedVaultUuid))return;a(!!o&&n.vaultUsers.isCurrentUserReadonlyVaultMember(o))}}))),[n.vaultUsers,o]);const l=(0,He.useRef)(),c=(0,He.useRef)(null),[u,d]=(0,He.useState)(!1),h=()=>{d((e=>!e))},p=(0,He.useCallback)((async e=>{l.current&&clearTimeout(l.current);const t=n.sessions.isSignedOut()?100:350;l.current=window.setTimeout((async()=>{await n.mutator.renameFile(i,e.target.value),n.sync.sync()}),t)}),[n,i]),f=(0,He.useRef)(null),{addDragTarget:g,removeDragTarget:m}=Gd();return(0,He.useEffect)((()=>{const e=f.current;return e&&g(e,{tooltipText:"Drop your files to upload and link them to the current file",async callback(e){await n.linkingController.linkItems(e,i)}}),()=>{e&&m(e)}}),[g,i,m,n.linkingController]),(0,e.jsxs)("div",{className:"sn-component section editor","aria-label":"File",ref:f,children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[s&&(0,e.jsxs)("div",{className:"bg-warning-faded relative flex items-center px-3.5 py-2 text-sm text-accessory-tint-3",children:[(0,e.jsx)(xn.Z,{type:"pencil-off",className:"mr-3"}),"This file is readonly"]}),(0,e.jsxs)("div",{className:"content-title-bar section-title-bar section-title-bar z-editor-title-bar w-full",id:"file-title-bar",children:[(0,e.jsxs)("div",{className:"flex h-8 items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex flex-grow items-center",children:[(0,e.jsx)(ff,{}),(0,e.jsx)("div",{className:"title flex-grow overflow-auto",children:(0,e.jsx)("input",{className:"input text-lg",id:kl.N.FileTitleEditor,onChange:p,onFocus:e=>{e.target.select()},spellCheck:!1,defaultValue:i.name,autoComplete:"off",disabled:s})})]}),(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[!s&&(0,e.jsx)(mf,{linkingController:n.linkingController}),(0,e.jsx)(ei.Z,{label:"File information panel",onClick:h,ref:c,icon:"info"}),(0,e.jsx)(On.Z,{title:"Details",open:u,togglePopover:h,anchorElement:c,side:"bottom",align:"center",children:(0,e.jsx)(Pd,{file:i})}),(0,e.jsx)(hf,{itemListController:n.itemListController})]})]}),(0,e.jsx)("div",{className:"hidden md:flex",children:(0,e.jsx)(hd.Z,{item:i,linkingController:n.linkingController,readonly:s})})]})]}),(0,e.jsx)("div",{className:"flex min-h-0 flex-grow flex-col",children:(0,e.jsx)(kd.Z,{file:i,application:n},i.uuid)})]})})),vf=(0,Nn.Pi)((t=>{let{application:n,file:i}=t;const[o,s]=(0,He.useState)(!1);(0,He.useEffect)((()=>{n.filesController.setShowProtectedOverlay(!n.isAuthorizedToRenderItem(i))}),[n,i,n.filesController]),(0,He.useEffect)((()=>{s(n.filesController.showProtectedOverlay)}),[n.filesController.showProtectedOverlay]);const a=(0,He.useCallback)((async()=>{let e=!0;n.hasProtectionSources()&&(e=await n.protections.authorizeItemAccess(i)),e&&s(!1)}),[n,i]);return(0,He.useEffect)((()=>n.addEventObserver((async e=>{e===r.ApplicationEvent.UnprotectedSessionBegan?s(!1):e===r.ApplicationEvent.UnprotectedSessionExpired&&s(!n.isAuthorizedToRenderItem(i))}))),[n,i]),o?(0,e.jsx)(gf,{showAccountMenu:n.showAccountMenu,hasProtectionSources:n.hasProtectionSources(),onViewItem:a,itemType:"file"}):(0,e.jsx)(yf,{application:n,file:i})})),Af=(0,Nn.Pi)((t=>{let{noteViewController:n,onClick:i,onClickPreprocessing:o}=t;var s;const a=(0,sr.I)(),l=a.notesController.firstSelectedNote,[c,u]=(0,He.useState)(!1),d=(0,He.useRef)(null),h=(0,He.useRef)(null),[p,f]=(0,He.useState)((()=>l?a.componentManager.editorForNote(l):void 0)),g=(null==n?void 0:n.isTemplateNote)?(0,r.noteTypeForEditorIdentifier)(a.componentManager.getDefaultEditorIdentifier((null===(s=n.templateNoteOptions)||void 0===s?void 0:s.tag)?a.items.findItem(n.templateNoteOptions.tag):void 0)):l&&l.noteType!=r.NoteType.Unknown?l.noteType:p?p.noteType:r.NoteType.Unknown,[m,y]=(0,Do.i)(g,!0),[v,A]=(0,He.useState)(!1),b=(0,He.useCallback)((async()=>{const e=!c;e&&o&&await o(),u(e),i&&i()}),[c,o,i]);(0,He.useEffect)((()=>a.keyboardService.addCommandHandler({command:L.AX,category:"Current note",description:"Change note type",onKeyDown:()=>{b()}})),[a,b]);const w=(0,He.useMemo)((()=>a.keyboardService.keyboardShortcutForCommand(L.AX)),[a]);return(0,e.jsxs)("div",{ref:h,children:[(0,e.jsx)(ei.Z,{label:"Change note type (".concat(w&&(0,L.Ld)(w),")"),onClick:b,ref:d,icon:m,iconClassName:"text-accessory-tint-".concat(y)}),(0,e.jsx)(On.Z,{title:"Change note type",togglePopover:b,disableClickOutside:v,anchorElement:d,open:c,className:"md:pb-1",children:(0,e.jsx)(ou,{application:a,note:l,setDisableClickOutside:A,closeMenu:()=>{u(!1)},onSelect:e=>{f(e)}})})]})})),bf="border border-solid w-3 h-3 p-0 rounded-full flex-shrink-0",wf=t=>{let{style:n}=t;switch(n){case"neutral":return(0,e.jsx)("div",{className:"".concat(bf," border-neutral bg-neutral")});case"info":return(0,e.jsx)("div",{className:"".concat(bf," border-info bg-info")});case"danger":return(0,e.jsx)("div",{className:"".concat(bf," border-danger bg-danger")})}},Sf=t=>{let{onClick:n,noteLocked:r}=t;const[i,o]=(0,He.useState)((()=>r)),s=i?"bg-warning-faded":"bg-info-faded",a=i?"text-accessory-tint-3":"text-accessory-tint-1",l=i?"text-warning":"text-accessory-tint-1",c=i?"Note editing disabled.":"Enable editing";return(0,e.jsxs)("div",{className:"relative flex items-center ".concat(s," cursor-pointer px-3.5 py-2 text-sm"),onMouseLeave:()=>{o(!0)},onMouseOver:()=>{o(!1)},onClick:n,children:[i?(0,e.jsx)(xn.Z,{type:"pencil-off",className:"".concat(a," mr-3 flex fill-current")}):(0,e.jsx)(xn.Z,{type:"pencil",className:"".concat(a," mr-3 flex fill-current")}),(0,e.jsx)("span",{className:l,children:c})]})},Cf=t=>{let{note:n,linkingController:i,noteViewElement:o,filesController:s}=t;const a=(0,sr.I)(),{isDraggingFiles:l,addDragTarget:c,removeDragTarget:u}=Gd();return(0,He.useEffect)((()=>{const e=o;if(e){const t="Drop your files to upload and link them to the current note";n.noteType===r.NoteType.Super?c(e,{tooltipText:t,handleFileUpload:e=>{s.uploadAndInsertFileToCurrentNote(e)},note:n}):c(e,{tooltipText:t,callback:async e=>{await i.linkItems(n,e),a.changeAndSaveItem.execute(e,(e=>{e.protected=n.protected})),s.notifyObserversOfUploadedFileLinkingToCurrentNote(e.uuid)},note:n})}return()=>{e&&u(e)}}),[c,i,n,o,u,s,a]),l?(0,e.jsx)("div",{id:"file-drag-iframe-overlay",className:"absolute left-0 top-0 z-dropdown-menu h-full w-full"}):null};var Ef=s(57140);const If=(0,He.forwardRef)(((t,n)=>{let{application:i,spellcheck:o,controller:s,locked:a,onFocus:l,onBlur:c}=t;const[u,d]=(0,He.useState)(),[h,p]=(0,He.useState)(!1),[f,g]=(0,He.useState)(),[m,y]=(0,He.useState)(),v=Ir(m||r.EditorFontSize.Normal),A=$d(o),b=(0,He.useRef)(),w=(0,He.useRef)(!1),S=(0,He.useRef)(!1),C=(0,He.useRef)(s.item),[E,I]=(0,He.useState)(!1),_=(0,He.useRef)(),x=(0,He.useRef)(null);(0,He.useImperativeHandle)(n,(()=>({focus(){O()}}))),(0,He.useEffect)((()=>()=>{var e,t;null===(e=x.current)||void 0===e||e.disconnect(),null===(t=_.current)||void 0===t||t.call(_),_.current=void 0,x.current=null}),[]),(0,He.useEffect)((()=>s.addNoteInnerValueChangeObserver(((e,t)=>{if(e.uuid!==C.current.uuid)throw Error("Editor received changes for non-current note");E||((0,r.isPayloadSourceRetrieved)(t)||null==u||e.editorIdentifier!==C.current.editorIdentifier||e.noteType!==C.current.noteType)&&d(e.text),C.current=e}))),[s,u,s.item.uuid,s.item.editorIdentifier,s.item.noteType,E]);const P=(0,He.useCallback)((()=>{S.current||(w.current=!0),i.notifyWebEvent(r.WebAppEvent.EditorDidFocus,{eventSource:b.current}),b.current=void 0,l()}),[i,S,b,l]),k=(0,He.useCallback)((e=>{b.current=void 0,c(e)}),[b,c]),B=(0,He.useCallback)((()=>{var e,t;w.current&&(w.current=!1,S.current=!0,null===(e=document.getElementById("note-text-editor"))||void 0===e||e.blur(),null===(t=document.getElementById("note-text-editor"))||void 0===t||t.focus(),S.current=!1)}),[w]);(0,He.useEffect)((()=>i.addWebEventObserver((e=>{e===r.WebAppEvent.MobileKeyboardWillChangeFrame&&B()}))),[i,B]);const O=(0,He.useCallback)((()=>{const e=document.getElementById(kl.N.NoteTextEditor);e&&(b.current=kn.Script,e.focus())}),[]);(0,He.useEffect)((()=>{var e;s.isTemplateNote&&"editor"===(null===(e=s.templateNoteOptions)||void 0===e?void 0:e.autofocusBehavior)&&O()}),[s,O]);const N=(0,He.useCallback)((()=>{const e=i.preferences.getLocalValue(r.LocalPrefKey.EditorLineHeight,r.PrefDefaults[r.LocalPrefKey.EditorLineHeight]),t=i.preferences.getLocalValue(r.LocalPrefKey.EditorFontSize,r.PrefDefaults[r.LocalPrefKey.EditorFontSize]);g(e),y(t)}),[i]);(0,He.useEffect)((()=>(N(),i.addSingleEventObserver(r.ApplicationEvent.PreferencesChanged,(async()=>{N()})))),[N,i]),(0,He.useEffect)((()=>{void 0!==A&&o!==A&&(p(!0),setTimeout((()=>{p(!1)}),0))}),[o,A]);const D=(0,He.useCallback)((e=>{if(_.current||!e)return;V(R.NoteView,"On system editor ref");const t=document.getElementById(kl.N.NoteTextEditor);if(!t)return void console.error("Editor is not yet mounted; unable to add tab observer.");_.current=i.keyboardService.addCommandHandler({element:t,command:L.gE,onKeyDown:e=>{if(!(document.hidden||C.current.locked||e.shiftKey)){if(e.preventDefault(),!document.execCommand("insertText",!1,"\t")){const e=t.selectionStart||0,n=t.selectionEnd||0,r="    ";t.value=t.value.substring(0,e)+r+t.value.substring(n),t.selectionStart=t.selectionEnd=e+4}d(t.value),s.saveAndAwaitLocalPropagation({text:t.value,bypassDebouncer:!0,isUserModified:!0})}}});const n=new MutationObserver((e=>{for(const r of e)r.removedNodes.forEach((e=>{var r;e.isEqualNode(t)&&(null===(r=_.current)||void 0===r||r.call(_),_.current=void 0,n.disconnect())}))}));n.observe(t.parentElement,{childList:!0}),x.current=n}),[i.keyboardService,s]);return h?null:(0,e.jsx)("textarea",{autoComplete:"off",dir:"auto",id:kl.N.NoteTextEditor,onChange:e=>{let{currentTarget:t}=e;const n=t.value;d(n),I(!0),s.saveAndAwaitLocalPropagation({text:n,isUserModified:!0}).then((()=>{I(!1)}))},onFocus:P,onBlur:k,readOnly:a,ref:D,spellCheck:o,value:u,className:(0,Q.classNames)("editable font-editor flex-grow",f&&"leading-".concat(f.toLowerCase()),v,(0,L.gn)()&&"!pb-12")})})),_f={[r.EditorLineWidth.Narrow]:"512px",[r.EditorLineWidth.Wide]:"720px",[r.EditorLineWidth.Dynamic]:"80%",[r.EditorLineWidth.FullWidth]:"100%"},xf={[r.EditorLineWidth.Narrow]:"auto",[r.EditorLineWidth.Wide]:"auto",[r.EditorLineWidth.Dynamic]:"10%",[r.EditorLineWidth.FullWidth]:"0"};var Pf=s(77491),kf=s.n(Pf),Bf=s(53193),Of=s.n(Bf);Nt().extend(Of()),Nt().extend(kf()),Nt().updateLocale("en",{relativeTime:{future:"in %s",past:"%s ago",s:"%ds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}});const Nf=t=>{let{className:n,onClick:r,icon:i,isTooltipVisible:o,setIsTooltipVisible:s,children:a,animateIcon:l=!1}=t;const c=(0,He.useRef)(null);return(0,e.jsxs)("div",{className:"note-status-tooltip-container",children:[(0,e.jsxs)("button",{className:(0,Q.classNames)("peer flex h-5 w-5 cursor-pointer items-center justify-center rounded-full",n),onClick:r,ref:c,children:[(0,e.jsx)(xn.Z,{className:l?"animate-spin":"",type:i,size:"small"}),(0,e.jsx)(jl.T,{children:"Note sync status"})]}),(0,e.jsx)(On.Z,{title:"Note sync status",open:o,togglePopover:()=>s((e=>!e)),className:"px-3 py-2",containerClassName:"!min-w-0 !w-auto max-w-[90vw]",anchorElement:c,side:"bottom",align:"center",offset:6,disableMobileFullscreenTakeover:!0,disableApplyingMobileWidth:!0,children:a})]})},Df=(0,Nn.Pi)((t=>{let{note:n,status:i,syncTakingTooLong:o,updateSavingIndicator:s=r.PrefDefaults[r.PrefKey.UpdateSavingStatusIndicator]}=t;const a=(0,sr.I)(),[l,c]=(0,He.useState)(!1),u=(0,He.useCallback)((()=>{c((e=>!e))}),[]),d=(0,He.useCallback)((()=>{a.setPreference(r.PrefKey.UpdateSavingStatusIndicator,!s)}),[a,s]);return s&&!i?null:i&&"error"===i.type?(0,e.jsxs)(Nf,{className:"bg-danger text-danger-contrast",onClick:u,icon:"warning",isTooltipVisible:l,setIsTooltipVisible:c,children:[(0,e.jsx)("div",{className:"text-sm font-bold text-danger",children:i.message}),i.description&&(0,e.jsx)("div",{className:"mt-0.5",children:i.description})]}):o?(0,e.jsx)(Nf,{className:"bg-warning text-warning-contrast",onClick:u,icon:i&&"saving"===i.type?"sync":"warning",isTooltipVisible:l,setIsTooltipVisible:c,children:i?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"text-sm font-bold text-warning",children:i.message}),i.description&&(0,e.jsx)("div",{className:"mt-0.5",children:i.description})]}):(0,e.jsx)("div",{className:"text-sm font-bold text-warning",children:"Sync taking too long"})}):s&&i?(0,e.jsxs)(Nf,{className:(0,Q.classNames)("saving"===i.type&&"bg-contrast","saved"===i.type&&"bg-success text-success-contrast","waiting"===i.type&&"bg-warning text-warning-contrast"),onClick:u,icon:"saving"===i.type?"sync":"waiting"===i.type?"clock":"check",animateIcon:"saving"===i.type,isTooltipVisible:l,setIsTooltipVisible:c,children:[(0,e.jsx)("div",{className:"text-sm font-bold",children:i.message}),i.description&&(0,e.jsx)("div",{className:"mt-0.5",children:i.description}),"waiting"===i.type&&n.lastSyncEnd&&(0,e.jsxs)("div",{className:"mt-0.5",children:["Last synced ",(h=n.lastSyncEnd,Nt()(h).fromNow())]}),"waiting"===i.type?(0,e.jsx)(Ln.Z,{small:!0,className:"mt-1",onClick:()=>{a.sync.sync().catch(console.error),u()},children:"Sync now"}):(0,e.jsx)(Ln.Z,{small:!0,className:"mt-1",onClick:d,children:"Disable status updates"})]}):(0,e.jsxs)(Nf,{className:"bg-contrast text-passive-1",onClick:u,icon:"info",isTooltipVisible:l,setIsTooltipVisible:c,children:[(0,e.jsx)("div",{className:"text-sm font-bold",children:"Note status updates are disabled"}),(0,e.jsx)(Ln.Z,{small:!0,className:"mt-1",onClick:d,children:"Enable status updates"})]});var h}));var jf=s(4160);const Tf=t=>{let{item:n}=t;const{vault:r,lastEditedByContact:i}=(0,Ad.j)(n);return r?(0,e.jsxs)("div",{className:"flex flex-wrap items-start gap-2",children:[(0,e.jsx)(sh.Z,{vault:r}),i&&(0,e.jsx)(jf.Z,{contact:i})]}):null};var Mf=s(54425),Ff=s(16902),Rf=s(39661),Lf=s(98296),Qf=s(2363),Uf=s(15945),Vf=s(25729),Kf=s(57996),Hf=s(57189),Gf=s(29661),Yf=s.n(Gf);const zf=t=>{let{state:n,text:i}=t;return(0,e.jsx)("span",{"data-diff":n!==Yf().EQUAL?n:void 0,className:(0,r.classNames)("whitespace-pre-wrap",n===Yf().INSERT&&"bg-success text-success-contrast",n===Yf().DELETE&&"bg-danger text-danger-contrast"),children:i})},Zf=t=>{let{selectedNotes:n,convertSuperToMarkdown:i}=t;const[o,s]=(0,He.useState)([]),[a,l]=(0,He.useState)([]);(0,He.useEffect)((()=>{(async()=>{const e=n[0],t=e.title,o=e.noteType===r.NoteType.Super&&i?await(new Be).convertSuperStringToOtherFormat(e.text,"md"):e.text,a=n[1],c=a.title,u=a.noteType===r.NoteType.Super&&i?await(new Be).convertSuperStringToOtherFormat(a.text,"md"):a.text,d=Yf()(t,c,void 0,!0),h=Yf()(o,u,void 0,!0);s(d),l(h)})().catch(console.error)}),[i,n]);const[c,u]=(0,He.useState)(null),[d,h]=(0,He.useState)(null),[p,f]=(0,He.useState)(!1);return(0,He.useEffect)((()=>{c&&f(c.scrollHeight>c.clientHeight)}),[c,a]),(0,He.useEffect)((()=>{if(!c||!d)return;if(!p)return;if(!a.length)return;d.innerHTML="";const e=c.getBoundingClientRect(),t=d.getBoundingClientRect();c.querySelectorAll("[data-diff]").forEach((n=>{const r=n.getAttribute("data-diff");if(!r)return;const i=parseInt(r),o=n.getBoundingClientRect(),s=(o.top-e.top)/c.scrollHeight,a=t.height*s,l=o.height/c.scrollHeight,u=t.height*l,h=document.createElement("div");h.className="absolute top-0 left-0 w-full bg-".concat(i===Yf().INSERT?"success":"danger"," opacity-50"),h.style.height="".concat(u,"px"),h.style.top="".concat(a,"px"),d.appendChild(h)}))}),[c,p,a,d]),(0,e.jsxs)("div",{className:"force-custom-scrollbar relative flex flex-grow flex-col overflow-hidden",children:[(0,e.jsx)("div",{className:"w-full px-4 py-4 text-base font-bold",children:o.map(((t,n)=>{let[r,i]=t;return(0,e.jsx)(zf,{state:r,text:i},n)}))}),(0,e.jsx)("pre",{className:"font-editor min-h-0 w-full flex-grow overflow-y-auto whitespace-pre-wrap p-4 pt-0 text-editor [&::-webkit-scrollbar]:bg-transparent",ref:u,children:a.map(((t,n)=>{let[r,i]=t;return(0,e.jsx)(zf,{state:r,text:i},n)}))}),p&&(0,e.jsx)("div",{className:"absolute right-0 top-0 z-[-1] h-full w-[19px] border-l border-border",ref:h})]})},Wf=t=>{let{isSelected:n,onClick:i,title:o,note:s,disabled:a}=t;const l=(0,sr.I)(),{words:c,characters:u,paragraphs:d,serverUpdatedAt:h,dateCreated:p,format:f}=_u(l,s);return(0,e.jsxs)("button",{tabIndex:pt.HF,className:(0,r.classNames)("flex w-full select-none flex-col overflow-hidden border-l-2 bg-transparent px-3 py-2.5 pl-4 text-left text-sm text-text",n?"border-info bg-info-backdrop":"border-transparent",a?"cursor-not-allowed opacity-75":"cursor-pointer hover:bg-contrast hover:text-foreground focus:bg-info-backdrop focus:shadow-none"),onClick:i,"data-selected":n,disabled:a,children:[(0,e.jsxs)("div",{className:"mb-1.5 flex items-center gap-2",children:[(0,e.jsx)(vh,{checked:n}),(0,e.jsx)("div",{className:"font-semibold",children:o})]}),(0,e.jsxs)("div",{className:"w-full text-sm text-neutral lg:text-xs",children:[(0,e.jsxs)("div",{className:"mb-1.5 flex items-center gap-2",children:[(0,e.jsx)($r.Z,{gutter:8,label:"Last modified",className:"!z-modal",children:(0,e.jsx)("div",{className:"flex-shrink-0",children:(0,e.jsx)(xn.Z,{type:"restore",size:"medium"})})}),(0,e.jsx)(jl.T,{children:"Last modified"})," ",h]}),(0,e.jsxs)("div",{className:"mb-1.5 flex items-center gap-2",children:[(0,e.jsx)($r.Z,{gutter:8,label:"Created",className:"!z-modal",children:(0,e.jsx)("div",{className:"flex-shrink-0",children:(0,e.jsx)(xn.Z,{type:"pencil-filled",size:"medium"})})}),(0,e.jsx)(jl.T,{children:"Created"})," ",p]}),(0,e.jsxs)("div",{className:"mb-1.5 flex items-center gap-2 overflow-hidden",children:[(0,e.jsx)($r.Z,{gutter:8,label:"Note ID",className:"!z-modal",children:(0,e.jsx)("div",{className:"flex-shrink-0",children:(0,e.jsx)(xn.Z,{type:"info",size:"medium"})})}),(0,e.jsx)(jl.T,{children:"Note ID"}),(0,e.jsx)("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:s.uuid})]}),"number"!=typeof c||"txt"!==f&&"md"!==f?null:(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)($r.Z,{gutter:8,label:"".concat(c," words"),className:"!z-modal",children:(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(xn.Z,{type:"line-width",size:"medium"}),c]})}),(0,e.jsx)($r.Z,{gutter:8,label:"".concat(u," characters"),className:"!z-modal",children:(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(xn.Z,{type:"bold",size:"small"}),(0,e.jsx)("span",{children:u})]})}),(0,e.jsx)($r.Z,{gutter:8,label:"".concat(d," paragraphs"),className:"!z-modal",children:(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(xn.Z,{type:"paragraph",size:"medium"}),(0,e.jsx)("span",{children:d})]})})]})]})]})},qf=t=>{let{currentNote:n,conflictedNotes:i,close:o}=t;const s=(0,He.useMemo)((()=>[n].concat(i)),[i,n]),a=(0,sr.I)(),[l,c]=(0,He.useState)([n.uuid]),u=(0,He.useMemo)((()=>s.filter((e=>l.includes(e.uuid)))),[s,l]),d=(0,He.useCallback)((async e=>{await a.mutator.changeItem(e,(e=>{e.trashed=!0,e.conflictOf=void 0})).catch(console.error),c([s[0].uuid])}),[s,a.mutator]),h=(0,He.useCallback)((async e=>{await a.mutator.deleteItem(e).then((()=>a.sync.sync())).catch(console.error).then((()=>{c([s[0].uuid])}))}),[s,a.mutator,a.sync]),[p,f]=(0,He.useState)("move-to-trash"),g=(0,Mf.I)({value:p,setValue:e=>f(e)}),[m,y]=(0,He.useState)(!1),v=(0,He.useCallback)((async()=>{const e="delete-permanently"===p,t="This will keep only the selected versions and ".concat(e?"delete the other versions permanently.":"move the other versions to the trash."," Are you sure?");if(await(0,L.VG)({title:"Keep only selected versions?",text:t,confirmButtonStyle:"danger"})){const t=s.filter((e=>!l.includes(e.uuid)));g.hide(),y(!0),await Promise.all(t.map((t=>e?h(t):d(t)))),await a.mutator.changeItems(u,(e=>{e.conflictOf=void 0})),y(!1),a.itemListController.selectItem(u[0].uuid,!0),a.sync.sync(),o()}}),[s,a,o,h,g,p,u,l,d]),A=(0,et.ac)(et.Jj.sm),b=(0,He.useMemo)((()=>[{label:"Cancel",onClick:o,type:"cancel",mobileSlot:"left"}]),[o]),[w,S]=(0,He.useState)(null);(0,qu.Z)(w);const[C,E]=(0,He.useState)("list"),I=(0,Ff.r)(),_=g.useState("open"),[x,P]=(0,He.useState)(null),[k,B]=(0,He.useState)(A?"diff":"preview"),O="preview"===k;(0,He.useEffect)((()=>{2!==u.length&&B("preview"),A&&2===u.length&&B("diff")}),[A,u.length]);const N=u.some((e=>e.noteType===r.NoteType.Super))&&!O,[D,j]=(0,He.useState)(!0),[T,M]=(0,He.useState)(0),[F,R]=(0,He.useState)(!0),Q=(0,He.useCallback)((e=>{let{target:t}=e;M(t.scrollTop)}),[]);return(0,e.jsxs)(Gn,{title:"Resolve conflicts",className:"flex flex-col overflow-x-hidden md:flex-row",actions:b,close:o,customFooter:(0,e.jsxs)(Fd,{className:u.length>1?"hidden md:flex":"",children:[(0,e.jsx)(Ln.Z,{className:"mr-auto hidden md:inline-block",onClick:o,disabled:m,children:"Cancel"}),(0,e.jsxs)(Rf.o,{className:"flex w-full items-stretch text-info-contrast md:w-auto",store:I,children:[(0,e.jsx)(Lf.E,{onClick:v,className:"flex-grow rounded rounded-r-none bg-info px-3 py-1.5 text-base font-bold ring-info ring-offset-2 ring-offset-default hover:brightness-110 focus:ring-0 focus-visible:ring-2 focus-visible:brightness-110 lg:text-sm",disabled:m,children:m?(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(di.Z,{className:"h-4 w-4 border-info-contrast"})}):(0,e.jsxs)(e.Fragment,{children:["Keep selected, ","move-to-trash"===p?"trash others":"delete others"]})}),(0,e.jsx)(Qf.P,{ref:P,render:(0,e.jsxs)(Lf.E,{className:"relative rounded rounded-l-none bg-info px-3 py-1.5 ring-info hover:brightness-110 focus:ring-0 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-default focus-visible:brightness-110",disabled:m,children:[(0,e.jsx)(Uf.n,{className:"block rotate-180"}),(0,e.jsx)("div",{className:"absolute left-0 top-0 h-full w-[2px] bg-info brightness-[.85]"})]}),store:g}),(0,e.jsx)(On.Z,{title:"Conflict options",open:_,togglePopover:g.toggle,anchorElement:x,overrideZIndex:"z-modal",side:"top",align:"end",offset:4,hideOnClickInModal:!0,children:(0,e.jsxs)(Vf.E,{className:"cursor-pointer divide-y divide-border [&>[data-active-item]]:bg-passive-5",store:g,children:[(0,e.jsxs)(Kf.Q,{className:"px-2.5 py-2 hover:bg-passive-5",value:"move-to-trash",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1 text-sm font-bold text-text",children:["move-to-trash"===p?(0,e.jsx)(xn.Z,{type:"check-bold",size:"small"}):(0,e.jsx)("div",{className:"h-3.5 w-3.5"}),"Move others to trash"]}),(0,e.jsx)("div",{className:"ml-4.5 text-neutral",children:"Only the selected version will be kept; others will be moved to trash."})]}),(0,e.jsxs)(Kf.Q,{className:"px-2.5 py-2 hover:bg-passive-5",value:"delete-permanently",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1 text-sm font-bold text-text",children:["delete-permanently"===p?(0,e.jsx)(xn.Z,{type:"check-bold",size:"small"}):(0,e.jsx)("div",{className:"h-3.5 w-3.5"}),"Delete others permanently"]}),(0,e.jsx)("div",{className:"ml-4.5 text-neutral",children:"Only the selected version will be kept; others will be deleted permanently."})]})]})})]})]}),children:[(0,e.jsxs)("div",{className:"flex border-b border-border md:hidden",children:[(0,e.jsx)("button",{className:(0,r.classNames)("relative cursor-pointer border-0 bg-default px-3 py-2.5 text-sm focus:shadow-inner","list"===C?"font-medium text-info shadow-bottom":"text-text"),onClick:()=>{E("list")},children:"List"}),(0,e.jsx)("button",{className:(0,r.classNames)("relative cursor-pointer border-0 bg-default px-3 py-2.5 text-sm focus:shadow-inner","preview"===C?"font-medium text-info shadow-bottom":"text-text"),onClick:()=>{E("preview")},children:"Preview"})]}),(0,e.jsx)("div",{className:(0,r.classNames)("w-full overflow-y-auto border-r border-border py-1.5 md:flex md:w-auto md:min-w-60 md:flex-col","list"!==C&&"hidden md:flex"),ref:S,children:s.map(((t,n)=>(0,e.jsx)(Wf,{disabled:m,isSelected:l.includes(t.uuid),onClick:()=>{c((e=>e.includes(t.uuid)?e.length>1?e.filter((e=>e!==t.uuid)):e:e.length>1?e.slice(1).concat(t.uuid):e.concat(t.uuid))),E("preview")},title:0===n?"Current version":"Version ".concat(n+1),note:t},t.uuid)))}),(0,e.jsxs)("div",{className:(0,r.classNames)("flex w-full flex-grow flex-col overflow-hidden","preview"!==C&&"hidden md:flex"),children:[O&&(0,e.jsx)("div",{className:(0,r.classNames)("min-h-0 w-full flex-grow divide-x divide-border pb-0.5",A?"flex":"grid grid-rows-1"),style:A?void 0:{gridTemplateColumns:"repeat(".concat(u.length,", 1fr)")},children:u.map((t=>(0,e.jsx)(pd,{note:t,content:t.content,scrollPos:T,shouldSyncScroll:F,onScroll:Q},t.uuid)))}),!O&&2===u.length&&(0,e.jsx)(Zf,{selectedNotes:u,convertSuperToMarkdown:D}),2===u.length&&(0,e.jsxs)("div",{className:"flex min-h-11 items-center justify-center gap-2 border-t border-border px-4 py-1.5",children:[O&&(0,e.jsx)($r.Z,{className:"!z-modal !max-w-[50ch]",label:F?"Scrolling is synced":"Scrolling is not synced. Click to sync.",showOnMobile:!0,children:(0,e.jsxs)("div",{className:"relative rounded-full p-1 hover:bg-contrast",children:[(0,e.jsx)(xn.Z,{type:F?"link":"link-off",className:"text-neutral"}),(0,e.jsx)(Hf.X,{className:"absolute bottom-0 left-0 right-0 top-0 cursor-pointer opacity-0",checked:F,onChange:()=>R((e=>!e))})]})}),!A&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:N?"ml-9":"",children:"Preview Mode"}),(0,e.jsx)(po.Z,{checked:!O,onChange:function(e){B(e?"diff":"preview")}})]}),(0,e.jsx)("div",{className:O?"mr-9":"",children:"Diff Mode"}),N&&(0,e.jsx)($r.Z,{interactive:!0,className:"!z-modal !max-w-[50ch]",label:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"mb-2",children:"Super notes use JSON under the hood to create rich and flexible documents. While neatly organized, it's not ideal to read or compare manually. Instead, this diff compares a Markdown rendition of the notes."}),(0,e.jsxs)("label",{className:"mb-1 flex select-none items-center gap-2",children:[(0,e.jsx)(po.Z,{checked:!D,onChange:e=>j(!e)}),"Compare JSON instead"]})]}),showOnMobile:!0,showOnHover:!1,children:(0,e.jsx)("button",{className:"rounded-full p-1 hover:bg-contrast",children:(0,e.jsx)(xn.Z,{type:"info",className:"text-neutral"})})})]})]})]})},Jf=class extends _n{constructor(e){super(e,e.application),this.protectionTimeoutId=null,this.setPlainEditorRef=e=>{this.plainEditorRef=e||void 0},this.authorizeAndDismissProtectedWarning=async()=>{let e=!0;this.application.hasProtectionSources()&&(e=await this.application.authorizeNoteAccess(this.note)),e&&(this.setShowProtectedOverlay(!1),this.focusTitle())},this.editorComponentViewerRequestsReload=async(e,t)=>{if(this.state.editorComponentViewerDidAlreadyReload&&!t)return;const n=e.getComponentOrFeatureItem();this.application.componentManager.destroyComponentViewer(e),this.setState({editorComponentViewer:void 0,editorComponentViewerDidAlreadyReload:!0},(()=>{this.setState({editorComponentViewer:this.createComponentViewer(n),editorStateDidLoad:!0})}))},this.onTitleEnter=e=>{let{key:t,currentTarget:n}=e;var r;t===L.u8.Enter&&(n.blur(),null===(r=this.plainEditorRef)||void 0===r||r.focus())},this.onTitleChange=e=>{let{currentTarget:t}=e;V(R.NoteView,"Performing save after title change");const n=t.value;this.setState({editorTitle:n}),this.controller.saveAndAwaitLocalPropagation({title:n,isUserModified:!0,dontGeneratePreviews:!0}).catch(console.error)},this.onPanelResizeFinish=async(e,t,n)=>{n?await this.application.setPreference(r.PrefKey.EditorWidth,null):null!=e&&await this.application.setPreference(r.PrefKey.EditorWidth,e),null!=t&&await this.application.setPreference(r.PrefKey.EditorLeft,t),this.application.sync.sync().catch(console.error)},this.stackComponentExpanded=e=>!!this.state.stackComponentViewers.find((t=>t.componentUniqueIdentifier.value===e.uuid)),this.toggleStackComponent=async e=>{e.isExplicitlyEnabledForItem(this.note.uuid)?await this.application.mutator.runTransactionalMutation(((e,t)=>({itemUuid:e.uuid,mutate:e=>{const n=e;n.removeAssociatedItemId(t.uuid),n.disassociateWithItem(t.uuid)}}))(e,this.note)):await this.application.mutator.runTransactionalMutation(((e,t)=>({itemUuid:e.uuid,mutate:e=>{const n=e;n.removeDisassociatedItemId(t.uuid),n.associateWithItem(t.uuid)}}))(e,this.note)),this.application.sync.sync().catch(console.error)},this.ensureNoteIsInsertedBeforeUIAction=async()=>{this.controller.isTemplateNote&&await this.controller.insertTemplatedNote()},this.onEditorFocus=()=>{this.setState({editorFocused:!0})},this.onEditorBlur=e=>{var t;(null===(t=e.relatedTarget)||void 0===t?void 0:t.id)!==kl.N.NoteOptionsButton&&this.setState({editorFocused:!1})},this.toggleConflictResolutionModal=()=>{this.setState((e=>({showConflictResolutionModal:!e.showConflictResolutionModal})))},this.triggerSyncOnAction=()=>{this.controller.syncNow()},this.controller=e.controller,this.onEditorComponentLoad=()=>{var e;this.controller&&!this.controller.dealloced&&(null===(e=this.application.desktopManager)||void 0===e||e.redoSearch())},this.debounceReloadEditorComponent=(0,t.Ds)(this.debounceReloadEditorComponent.bind(this),25);const n=this.application.vaults.getItemVault(this.controller.item);this.state={availableStackComponents:[],editorStateDidLoad:!1,editorTitle:"",editorLineWidth:r.PrefDefaults[r.LocalPrefKey.EditorLineWidth],isDesktop:(0,t.Z$)(),noteStatus:void 0,noteLocked:this.controller.item.locked,readonly:n?this.application.vaultUsers.isCurrentUserReadonlyVaultMember(n):void 0,showProtectedWarning:!1,spellcheck:!0,stackComponentViewers:[],syncTakingTooLong:!1,editorFeatureIdentifier:this.controller.item.editorIdentifier,noteType:this.controller.item.noteType,conflictedNotes:[],showConflictResolutionModal:!1},this.noteViewElementRef=(0,He.createRef)(),this.editorContentRef=(0,He.createRef)()}deinit(){var e,t,n,r,i;super.deinit(),this.controller=void 0,null===(e=this.removeNoteStreamObserver)||void 0===e||e.call(this),this.removeNoteStreamObserver=void 0,null===(t=this.removeInnerNoteObserver)||void 0===t||t.call(this),this.removeInnerNoteObserver=void 0,null===(n=this.removeComponentManagerObserver)||void 0===n||n.call(this),this.removeComponentManagerObserver=void 0,null===(r=this.removeTrashKeyObserver)||void 0===r||r.call(this),this.removeTrashKeyObserver=void 0,null===(i=this.removeVaultUsersEventHandler)||void 0===i||i.call(this),this.removeVaultUsersEventHandler=void 0,this.clearNoteProtectionInactivityTimer(),this.ensureNoteIsInsertedBeforeUIAction=void 0,this.onEditorComponentLoad=void 0,this.onPanelResizeFinish=void 0,this.authorizeAndDismissProtectedWarning=void 0,this.editorComponentViewerRequestsReload=void 0,this.onTitleEnter=void 0,this.onTitleChange=void 0,this.onPanelResizeFinish=void 0,this.stackComponentExpanded=void 0,this.toggleStackComponent=void 0,this.debounceReloadEditorComponent=void 0,this.editorContentRef=void 0,this.plainEditorRef=void 0}getState(){return this.state}get note(){return this.controller.item}shouldComponentUpdate(e,t){for(const e of Object.keys(t)){const n=this.state[e],r=t[e];if(Array.isArray(n)&&Array.isArray(r)){if(!(0,Q.compareArrayReferences)(n,r))return V(R.NoteView,"Rendering due to array state change",e,n,r),!0}else if(n!==r)return V(R.NoteView,"Rendering due to state change",e,n,r),!0}return!1}componentDidMount(){super.componentDidMount(),this.removeVaultUsersEventHandler=this.application.vaultUsers.addEventObserver(((e,t)=>{var n;if(e===r.VaultUserServiceEvent.InvalidatedUserCacheForVault){const e=this.application.vaults.getItemVault(this.note);if(t!==(null===(n=null==e?void 0:e.sharing)||void 0===n?void 0:n.sharedVaultUuid))return;this.setState({readonly:e?this.application.vaultUsers.isCurrentUserReadonlyVaultMember(e):void 0})}})),this.registerKeyboardShortcuts(),this.removeInnerNoteObserver=this.controller.addNoteInnerValueChangeObserver(((e,t)=>{this.onNoteInnerChange(e,t)})),this.autorun((()=>{const e=this.controller.syncStatus,t=this.application.paneController.focusModeEnabled,n=this.state.focusModeEnabled!==t;this.setState({showProtectedWarning:this.application.notesController.showProtectedWarning,noteStatus:e,saveError:"error"===(null==e?void 0:e.type),syncTakingTooLong:!1,focusModeEnabled:t}),!t&&n&&this.controller.syncOnlyIfLargeNote()})),this.reloadEditorComponent().catch(console.error),this.reloadStackComponents().catch(console.error);const e=this.note.protected&&(!this.application.hasProtectionSources()||!this.application.protections.hasUnprotectedAccessSession());this.setShowProtectedOverlay(e),this.reloadPreferences().catch(console.error),this.controller.isTemplateNote&&setTimeout((()=>{var e;"title"===(null===(e=this.controller.templateNoteOptions)||void 0===e?void 0:e.autofocusBehavior)&&this.focusTitle()}))}componentDidUpdate(e,t){null!=this.state.showProtectedWarning&&t.showProtectedWarning!==this.state.showProtectedWarning&&this.reloadEditorComponent().catch(console.error)}onNoteInnerChange(e,t){if(V(R.NoteView,"On inner note change",r.PayloadEmitSource[t]),e.uuid!==this.note.uuid)throw Error("Editor received changes for non-current note");let n=this.state.editorTitle;if((0,r.isPayloadSourceRetrieved)(t)&&(n=e.title),this.state.editorTitle||(n=e.title),n!==this.state.editorTitle&&this.setState({editorTitle:n}),e.last_edited_by_uuid!==this.state.noteLastEditedByUuid&&this.setState({noteLastEditedByUuid:e.last_edited_by_uuid}),e.locked!==this.state.noteLocked&&this.setState({noteLocked:e.locked}),e.editorIdentifier===this.state.editorFeatureIdentifier&&e.noteType===this.state.noteType||(this.setState({editorFeatureIdentifier:e.editorIdentifier,noteType:e.noteType,editorTitle:e.title}),this.reloadEditorComponent()),this.reloadSpellcheck().catch(console.error),this.reloadLineWidth(),(t!==r.PayloadEmitSource.LocalInserted||!e.dirty)&&(e.lastSyncBegan||e.dirty)){const t=this.controller.syncStatus,n="waiting"===(null==t?void 0:t.type);if(e.lastSyncEnd){const t=e.lastSyncBegan&&e.lastSyncBegan.getTime()>e.lastSyncEnd.getTime(),r=e.lastSyncBegan&&e.lastSyncEnd.getTime()>e.lastSyncBegan.getTime();t?this.controller.showSavingStatus():this.state.noteStatus&&r&&!n&&this.controller.showAllChangesSavedStatus()}else e.lastSyncBegan&&this.controller.showSavingStatus()}}componentWillUnmount(){var e;this.state.editorComponentViewer&&(null===(e=this.application.componentManager)||void 0===e||e.destroyComponentViewer(this.state.editorComponentViewer)),super.componentWillUnmount()}async onAppLaunch(){await super.onAppLaunch(),this.streamItems()}async onAppEvent(e){var t;if(!(null===(t=this.controller)||void 0===t?void 0:t.dealloced))switch(e){case r.ApplicationEvent.LocalPreferencesChanged:case r.ApplicationEvent.PreferencesChanged:this.reloadPreferences(),this.reloadStackComponents();break;case r.ApplicationEvent.HighLatencySync:this.setState({syncTakingTooLong:!0});break;case r.ApplicationEvent.CompletedFullSync:{this.setState({syncTakingTooLong:!1});const e=this.state.saveError;!this.note.dirty&&e&&this.controller.showAllChangesSavedStatus();break}case r.ApplicationEvent.FailedSync:this.note.dirty&&this.controller.showErrorSyncStatus();break;case r.ApplicationEvent.LocalDatabaseWriteError:this.controller.showErrorSyncStatus({type:"error",message:"Offline Saving Issue",description:"Changes not saved"});break;case r.ApplicationEvent.UnprotectedSessionBegan:this.setShowProtectedOverlay(!1);break;case r.ApplicationEvent.UnprotectedSessionExpired:this.note.protected&&this.hideProtectedNoteIfInactive()}}getSecondsElapsedSinceLastEdit(){return(Date.now()-this.note.userModifiedDate.getTime())/1e3}hideProtectedNoteIfInactive(){const e=this.getSecondsElapsedSinceLastEdit();if(e>=r.ProposedSecondsToDeferUILevelSessionExpirationDuringActiveInteraction)this.setShowProtectedOverlay(!0);else{const t=r.ProposedSecondsToDeferUILevelSessionExpirationDuringActiveInteraction-e;this.startNoteProtectionInactivityTimer(t)}}startNoteProtectionInactivityTimer(e){this.clearNoteProtectionInactivityTimer(),this.protectionTimeoutId=setTimeout((()=>{this.hideProtectedNoteIfInactive()}),1e3*e)}clearNoteProtectionInactivityTimer(){this.protectionTimeoutId&&clearTimeout(this.protectionTimeoutId)}streamItems(){this.removeNoteStreamObserver=this.application.items.streamItems(r.ContentType.TYPES.Note,(async()=>{this.note&&this.setState({conflictedNotes:this.application.items.conflictsOf(this.note.uuid)})}))}createComponentViewer(e){if(!e)throw Error("Cannot create component viewer for undefined component");return this.application.componentManager.createComponentViewer(e,{uuid:this.note.uuid})}debounceReloadEditorComponent(){this.reloadEditorComponent().catch(console.error)}destroyCurrentEditorComponent(){const e=this.state.editorComponentViewer;e&&(this.application.componentManager.destroyComponentViewer(e),this.setState({editorComponentViewer:void 0}))}async reloadEditorComponent(){if(V(R.NoteView,"Reload editor component"),this.state.showProtectedWarning)return void this.destroyCurrentEditorComponent();const e=this.application.componentManager.editorForNote(this.note);(0,r.isUIFeatureAnIframeFeature)(e)&&this.controller.isTemplateNote&&await this.controller.insertTemplatedNote();const t=this.state.editorComponentViewer;t&&t.componentUniqueIdentifier!==e.uniqueIdentifier&&this.destroyCurrentEditorComponent(),(0,r.isUIFeatureAnIframeFeature)(e)?this.setState({editorComponentViewer:this.createComponentViewer(e),editorStateDidLoad:!0}):(bc(this.state.monospaceFont),this.setState({editorStateDidLoad:!0}))}hasAvailableExtensions(){return this.application.actions.extensionsInContextOfItem(this.note).length>0}focusTitle(){var e;null===(e=document.getElementById(kl.N.NoteTitleEditor))||void 0===e||e.focus()}setShowProtectedOverlay(e){this.application.notesController.setShowProtectedWarning(e)}async deleteNote(e){if(this.controller.isTemplateNote)return void this.application.alerts.alert(ht.xU).catch(console.error);if(this.note.locked)return void this.application.alerts.alert(ht.YQ).catch(console.error);const t=this.note.title.length?"'".concat(this.note.title,"'"):"this note",n=(0,ht.OW)(t,e);await(0,L.VG)({text:n,confirmButtonStyle:"danger"})&&(e?this.performNoteDeletion(this.note):this.controller.saveAndAwaitLocalPropagation({title:this.state.editorTitle,bypassDebouncer:!0,dontGeneratePreviews:!0,isUserModified:!0,customMutate:e=>{e.trashed=!0}}).catch(console.error))}performNoteDeletion(e){this.application.mutator.deleteItem(e).then((()=>this.application.sync.sync())).catch(console.error)}async reloadSpellcheck(){const e=this.application.notesController.getSpellcheckStateForNote(this.note);e!==this.state.spellcheck&&(bc(this.state.monospaceFont),this.setState({spellcheck:e}))}reloadLineWidth(){const e=this.application.notesController.getEditorWidthForNote(this.note);this.setState({editorLineWidth:e})}async reloadPreferences(){V(R.NoteView,"Reload preferences");const e=this.application.preferences.getLocalValue(r.LocalPrefKey.EditorMonospaceEnabled,r.PrefDefaults[r.LocalPrefKey.EditorMonospaceEnabled]),t=this.application.getPreference(r.PrefKey.UpdateSavingStatusIndicator,r.PrefDefaults[r.PrefKey.UpdateSavingStatusIndicator]),n=this.application.getPreference(r.PrefKey.PaneGesturesEnabled,r.PrefDefaults[r.PrefKey.PaneGesturesEnabled]);await this.reloadSpellcheck(),this.reloadLineWidth(),this.setState({monospaceFont:e,updateSavingIndicator:t,paneGestureEnabled:n}),bc(e)}async reloadStackComponents(){V(R.NoteView,"Reload stack components");const e=this.application.componentManager.thirdPartyComponentsForArea(r.ComponentArea.EditorStack).filter((e=>this.application.componentManager.isComponentActive(e))).sort(((e,t)=>e.name.toLowerCase()<t.name.toLowerCase()?-1:1)),t=e.filter((e=>!this.state.stackComponentViewers.find((t=>t.componentUniqueIdentifier.value===e.uuid)))),n=this.state.stackComponentViewers.filter((t=>!e.find((e=>e.uuid===t.componentUniqueIdentifier.value)))),i=[];for(const e of t)i.push(this.application.componentManager.createComponentViewer(new r.UIFeature(e),{uuid:this.note.uuid}));for(const e of n)this.application.componentManager.destroyComponentViewer(e);this.setState({availableStackComponents:e,stackComponentViewers:i})}registerKeyboardShortcuts(){this.removeTrashKeyObserver=this.application.keyboardService.addCommandHandler({command:L.jd,notTags:["INPUT","TEXTAREA"],notElementIds:[Ef._],onKeyDown:()=>{this.deleteNote(!1).catch(console.error)}})}render(){if(this.controller.dealloced)return null;if(this.state.showProtectedWarning||!this.application.isAuthorizedToRenderItem(this.note))return(0,e.jsx)(gf,{showAccountMenu:()=>this.application.showAccountMenu(),hasProtectionSources:this.application.hasProtectionSources(),onViewItem:this.authorizeAndDismissProtectedWarning,itemType:"note"});const n=!(0,t.Av)()||!this.state.editorFocused,i=this.note.noteType===r.NoteType.Super?"super":this.state.editorStateDidLoad&&!this.state.editorComponentViewer?"plain":this.state.editorComponentViewer?"component":"plain",o=this.state.conflictedNotes.length>0&&!this.state.readonly;return(0,e.jsxs)("div",{"aria-label":"Note",className:"section editor sn-component h-full md:max-h-full",ref:this.noteViewElementRef,children:[this.note&&(0,e.jsx)(Cf,{note:this.note,linkingController:this.application.linkingController,filesController:this.application.filesController,noteViewElement:this.noteViewElementRef.current}),this.state.readonly&&(0,e.jsxs)("div",{className:"bg-warning-faded flex items-center px-3.5 py-2 text-sm text-accessory-tint-3",children:[(0,e.jsx)(xn.Z,{type:"pencil-off",className:"mr-3"}),"You don't have permission to edit this note"]}),this.state.noteLocked&&(0,e.jsx)(Sf,{onClick:()=>this.application.notesController.setLockSelectedNotes(!this.state.noteLocked),noteLocked:this.state.noteLocked}),this.note&&(0,e.jsxs)("div",{id:"editor-title-bar",className:"content-title-bar section-title-bar z-editor-title-bar w-full bg-default pt-4",children:[(0,e.jsxs)("div",{className:(0,Q.classNames)("mb-2 flex justify-between md:mb-0 md:flex-nowrap md:gap-4 xl:items-center",o?"items-center":"items-start",n?"flex-wrap gap-2 ":"flex-nowrap gap-4"),children:[(0,e.jsxs)("div",{className:(0,Q.classNames)(this.state.noteLocked&&"locked","flex flex-grow items-center"),children:[(0,e.jsx)(ff,{}),(0,e.jsx)("div",{className:"title flex-grow overflow-auto",children:(0,e.jsx)("input",{className:"input text-lg",disabled:this.state.noteLocked||this.state.readonly,id:kl.N.NoteTitleEditor,onChange:this.onTitleChange,onFocus:e=>{e.target.select()},onKeyUp:this.onTitleEnter,spellCheck:!1,value:this.state.editorTitle,autoComplete:"off"})}),(0,e.jsx)(Df,{note:this.note,status:this.state.noteStatus,syncTakingTooLong:this.state.syncTakingTooLong,updateSavingIndicator:this.state.updateSavingIndicator})]}),o&&(0,e.jsxs)(Ln.Z,{id:kl.N.ConflictResolutionButton,className:"flex items-center",primary:!0,colorStyle:"warning",small:!0,onClick:this.toggleConflictResolutionModal,children:[(0,e.jsx)(xn.Z,{type:"merge",size:"small",className:"mr-2"}),this.state.conflictedNotes.length," ",(0,Q.pluralize)(this.state.conflictedNotes.length,"conflict","conflicts")]}),(0,e.jsxs)("div",{className:"note-view-options-buttons flex items-center gap-3",children:[!this.state.readonly&&n&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(mf,{linkingController:this.application.linkingController,onClick:this.triggerSyncOnAction,onClickPreprocessing:this.ensureNoteIsInsertedBeforeUIAction}),(0,e.jsx)(Af,{noteViewController:this.controller,onClick:this.triggerSyncOnAction,onClickPreprocessing:this.ensureNoteIsInsertedBeforeUIAction}),(0,e.jsx)(lf,{notesController:this.application.notesController,onClickPreprocessing:this.ensureNoteIsInsertedBeforeUIAction})]}),(0,e.jsx)(af,{notesController:this.application.notesController,onClick:this.triggerSyncOnAction,onClickPreprocessing:this.ensureNoteIsInsertedBeforeUIAction,onButtonBlur:()=>{this.setState({editorFocused:!1})}})]})]}),(0,e.jsx)("div",{className:"mb-1 mt-2.5 md:hidden",children:(0,e.jsx)(Tf,{item:this.note})}),(0,e.jsx)("div",{className:"hidden md:block",children:(0,e.jsx)(hd.Z,{item:this.note,linkingController:this.application.linkingController,readonly:this.state.readonly})})]}),(0,e.jsxs)("div",{id:kl.N.EditorContent,className:(0,Q.classNames)(kl.N.EditorContent,"z-editor-content overflow-auto sm:[&>*]:mx-[var(--editor-margin)] sm:[&>*]:max-w-[var(--editor-max-width)]"),style:{"--editor-margin":xf[this.state.editorLineWidth],"--editor-max-width":_f[this.state.editorLineWidth]},ref:this.editorContentRef,children:["component"===i&&this.state.editorComponentViewer&&(0,e.jsxs)("div",{className:"component-view relative flex-grow",children:[this.state.paneGestureEnabled&&(0,e.jsx)("div",{className:"absolute left-0 top-0 h-full w-[20px] md:hidden"}),(0,e.jsx)(ru,{componentViewer:this.state.editorComponentViewer,onLoad:this.onEditorComponentLoad,requestReload:this.editorComponentViewerRequestsReload,readonly:this.state.readonly},this.state.editorComponentViewer.identifier)]}),"plain"===i&&(0,e.jsx)(If,{application:this.application,spellcheck:this.state.spellcheck,ref:this.setPlainEditorRef,controller:this.controller,locked:this.state.noteLocked||!!this.state.readonly,onFocus:this.onEditorFocus,onBlur:this.onEditorBlur}),"super"===i&&(0,e.jsx)("div",{className:(0,Q.classNames)("blocks-editor w-full flex-grow overflow-hidden"),children:(0,e.jsx)(zc,{application:this.application,linkingController:this.application.linkingController,filesController:this.application.filesController,spellcheck:this.state.spellcheck,controller:this.controller,readonly:this.state.readonly,onFocus:this.onEditorFocus,onBlur:this.onEditorBlur},this.note.uuid)})]}),(0,e.jsxs)("div",{id:"editor-pane-component-stack",children:[this.state.availableStackComponents.length>0&&(0,e.jsx)("div",{id:"component-stack-menu-bar",className:"flex h-6 w-full items-center justify-between border-t border-solid border-border bg-contrast px-2 py-0 text-text",children:(0,e.jsx)("div",{className:"flex h-full",children:this.state.availableStackComponents.map((t=>{const n=this.application.componentManager.isComponentActive(t);return(0,e.jsxs)("div",{onClick:()=>{this.toggleStackComponent(t).catch(console.error)},className:"flex flex-grow cursor-pointer items-center justify-center [&:not(:first-child)]:ml-3",children:[(0,e.jsxs)("div",{className:"flex h-full items-center [&:not(:first-child)]:ml-2",children:[this.stackComponentExpanded(t)&&n&&(0,e.jsx)(wf,{style:"info"}),!this.stackComponentExpanded(t)&&(0,e.jsx)(wf,{style:"neutral"})]}),(0,e.jsx)("div",{className:"flex h-full items-center [&:not(:first-child)]:ml-2",children:(0,e.jsx)("div",{className:"whitespace-nowrap text-xs font-bold",children:t.name})})]},t.uuid)}))})}),(0,e.jsx)("div",{className:"sn-component",children:this.state.stackComponentViewers.map((t=>(0,e.jsx)("div",{className:"component-view component-stack-item",children:(0,e.jsx)(ru,{componentViewer:t},t.identifier)},t.identifier)))})]}),(0,e.jsx)(Fr,{isOpen:this.state.showConflictResolutionModal,close:this.toggleConflictResolutionModal,className:"md:h-full md:w-[70vw]",children:(0,e.jsx)(qf,{currentNote:this.note,conflictedNotes:this.state.conflictedNotes,close:this.toggleConflictResolutionModal})})]})}},Xf=class extends _n{constructor(e){super(e,e.application),this.state={showMultipleSelectedNotes:!1,showMultipleSelectedFiles:!1,controllers:[],selectedFile:void 0}}componentDidMount(){super.componentDidMount();const e=this.application.itemControllerGroup;this.removeChangeObserver=this.application.itemControllerGroup.addActiveControllerChangeObserver((()=>{const t=e.itemControllers;this.setState({controllers:t})})),this.autorun((()=>{this.application.notesController&&this.setState({showMultipleSelectedNotes:this.application.notesController.selectedNotesCount>1}),this.application.itemListController&&this.setState({showMultipleSelectedFiles:this.application.itemListController.selectedFilesCount>1})})),this.autorun((()=>{this.application.itemListController&&this.setState({selectedFile:this.application.itemListController.selectedFiles[0]})})),this.autorun((()=>{this.application.paneController&&this.setState({selectedPane:this.application.paneController.currentPane,isInMobileView:this.application.paneController.isInMobileView})}))}deinit(){var e;null===(e=this.removeChangeObserver)||void 0===e||e.call(this),this.removeChangeObserver=void 0,super.deinit()}render(){const t=!this.state.showMultipleSelectedNotes&&!this.state.showMultipleSelectedFiles,n=this.state.controllers.length>0;return(0,e.jsxs)(e.Fragment,{children:[this.state.showMultipleSelectedNotes&&(0,e.jsx)(df,{application:this.application}),this.state.showMultipleSelectedFiles&&(0,e.jsx)(pf,{itemListController:this.application.itemListController}),t&&n&&(0,e.jsx)(e.Fragment,{children:this.state.controllers.map((t=>t instanceof Bt?(0,e.jsx)(Jf,{application:this.application,controller:t},t.runtimeId):(0,e.jsx)(vf,{application:this.application,file:t.item},t.runtimeId)))})]})}},$f=(0,He.forwardRef)(((t,n)=>{let{application:r,className:i,id:o}=t;const{setPaneLayout:s}=(0,Zr.G)(),[a]=oc("right",(()=>{s(mt.h.ItemSelection)}));return(0,e.jsx)("div",{id:o,ref:(0,kr.l)([n,a]),className:"flex h-full flex-grow flex-col bg-default pt-safe-top ".concat(i),children:(0,e.jsx)(Xf,{className:i,application:r})})}));function eg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eg(Object(n),!0).forEach((function(t){ng(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ng(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const rg=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),n=Xd(),{isTabletOrMobile:i,isTablet:o,isMobile:s}=n,a=$d(n),l=(0,Zr.G)(),c=$d(l),[u,d]=(0,He.useState)([]),[h,p]=(0,He.useState)([]),[f,g]=(0,He.useState)([]),[m,y]=(0,He.useState)(t.getPreference(r.PrefKey.TagsPanelWidth,220)),[v,A]=(0,He.useState)(null),[b,w]=(0,He.useState)(t.getPreference(r.PrefKey.NotesPanelWidth,400)),[S,C]=(0,He.useState)(null),E=!i,[I,_]=(0,He.useState)(null),x=(0,et.ac)("(prefers-reduced-motion: reduce)"),P=s&&!x;(0,He.useEffect)((()=>{if(!P)return;const e=l.panes,t=null==c?void 0:c.panes;t?function(e,t){const n=t.slice(0,t.length-1);return n.length===e.length&&n.every(((t,n)=>t===e[n]))}(t,e)&&p([e[e.length-1]]):p([])}),[l.panes,null==c?void 0:c.panes,P]),(0,He.useEffect)((()=>{if(!P)return;const e=l.panes,t=null==c?void 0:c.panes;t?function(e,t){const n=e.slice(0,e.length-1);return n.length===t.length&&n.every(((e,n)=>e===t[n]))}(t,e)&&g([t[t.length-1]]):g([])}),[l.panes,null==c?void 0:c.panes,P]),(0,He.useEffect)((()=>{d(l.panes)}),[l.panes]),(0,He.useEffect)((()=>{h&&0!==(null==h?void 0:h.length)&&(h.length>1?console.warn("More than one pane pending entrance. This is not supported."):async function(e){V(R.Panes,"Animating pane entrance transition from offscreen to the right",e);const t=document.getElementById(e);if(!t)return;const n=t.animate([{transform:"translateX(100%)"},{transform:"translateX(0)"}],{duration:200,easing:"ease-in-out",fill:"both"});await n.finished,sc(t)}($e.S[h[0]]).then((()=>{p([])})))}),[h]),(0,He.useEffect)((()=>{f&&0!==(null==f?void 0:f.length)&&(f.length>1?console.warn("More than one pane pending exit. This is not supported."):async function(e){V(R.Panes,"Animating pane exit transition offscreen to the right",e);const t=document.getElementById(e);if(!t)return;const n=t.animate([{transform:"translateX(100%)"}],{duration:200,easing:"ease-in-out",fill:"both"});await n.finished}($e.S[f[0]]).then((()=>{g([])})))}),[f]),(0,He.useEffect)((()=>{const e=t.addEventObserver((async()=>{const e=t.getPreference(r.PrefKey.TagsPanelWidth,220);y(e)}),r.ApplicationEvent.PreferencesChanged);return()=>{e()}}),[t]);const k=(0,He.useCallback)((e=>{y(e)}),[]),B=(0,He.useCallback)((e=>{w(e)}),[]),O=(0,He.useCallback)((e=>{w(e)}),[]),N=(0,He.useCallback)(((e,n,r,i)=>{t.publishPanelDidResizeEvent(pt.xi,e,i)}),[t]),D=(0,He.useCallback)(((e,n,r,i)=>{t.publishPanelDidResizeEvent(pt.WB,e,i)}),[t]);(0,He.useEffect)((()=>{o&&!(null==a?void 0:a.isTablet)?l.selectedPane!==$e.n.Navigation&&l.removePane($e.n.Navigation):o||!(null==a?void 0:a.isTablet)||l.panes.includes($e.n.Navigation)||l.insertPaneAtIndex($e.n.Navigation,0)}),[o,l,a]);const j=[...u,...f];return V(R.Panes,"Rendering panes",j),(0,e.jsx)("div",{id:"app",className:"app ".concat(s?"w-full":"grid"),style:tg({},(()=>{const e=l.panes,t=e.length;if(s)return{};switch(t){case 1:return{gridTemplateColumns:"auto"};case 2:return l.focusModeEnabled?{gridTemplateColumns:"0 1fr"}:o?{gridTemplateColumns:"1fr 2fr"}:e[0]===$e.n.Navigation?{gridTemplateColumns:"".concat(m,"px auto")}:{gridTemplateColumns:"".concat(b,"px auto")};case 3:return l.focusModeEnabled?{gridTemplateColumns:"0 0 1fr"}:{gridTemplateColumns:"".concat(m,"px ").concat(b,"px 2fr")};default:return{}}})()),children:j.map(((n,o)=>{const a=null==h?void 0:h.includes(n),l=((e,t,n)=>{const r="app-pane app-pane-".concat(n+1," h-full content");return s?"absolute top-0 left-0 w-full flex flex-col ".concat(r," ").concat(t?"translate-x-[100%]":"translate-x-0 "):"flex flex-col relative overflow-hidden ".concat(r)})(0,null!=a&&a,o);return n===$e.n.Navigation?(0,e.jsx)(sf,{id:kl.N.NavigationColumn,ref:A,className:(0,r.classNames)(l,i?"w-full":""),application:t,children:E&&v&&(0,e.jsx)(Yp,{collapsable:!0,defaultWidth:m,hoverable:!0,left:0,minWidth:48,modifyElementWidth:!1,panel:v,resizeFinishCallback:N,side:Kp.Right,type:Hp.WidthOnly,width:m,widthEventCallback:k})},"navigation-pane"):n===$e.n.Items?(0,e.jsx)(Vp,{id:kl.N.ItemsColumn,className:l,ref:C,application:t,onPanelWidthLoad:O,children:E&&S&&(0,e.jsx)(Yp,{collapsable:!0,defaultWidth:400,hoverable:!0,left:0,minWidth:200,modifyElementWidth:!1,panel:S,resizeFinishCallback:D,side:Kp.Right,type:Hp.WidthOnly,width:b,widthEventCallback:B})},"content-list-view"):n===$e.n.Editor?(0,e.jsx)(As,{children:(0,e.jsx)($f,{id:kl.N.EditorColumn,ref:_,className:l,application:t})},"editor-pane"):void 0}))})})),ig=()=>(0,e.jsx)("div",{className:"z-modal flex h-30 w-full items-center bg-danger text-center text-info-contrast",children:(0,e.jsxs)("div",{className:"w-full text-center text-xl font-bold",children:["app.standardnotes.org is no longer maintained. Please switch to"," ",(0,e.jsx)("a",{className:"underline",href:"https://app.standardnotes.com",children:"app.standardnotes.com"})]})});var og=s(75126);function sg(t={}){const n=(0,Ii.M)(t);return(0,e.jsx)(og.fg,{value:n,children:t.children})}function ag(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ag(Object(n),!0).forEach((function(t){cg(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ag(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function cg(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ug={evernote:"bg-[#14cc45] text-[#000]",simplenote:"bg-[#3360cc] text-default","google-keep":"bg-[#fbbd00] text-[#000]",aegis:"bg-[#0d47a1] text-default",plaintext:"bg-default border border-border",html:"bg-accessory-tint-2",super:"bg-accessory-tint-1 text-accessory-tint-1"},dg={evernote:"evernote",simplenote:"simplenote","google-keep":"gkeep",aegis:"aegis",plaintext:"plain-text",html:"rich-text",super:"file-doc"},hg=t=>{let{errored:n}=t;return(0,e.jsxs)(sg,{children:[(0,e.jsx)(_i.p,{children:(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(xn.Z,{type:"warning",className:"flex-shrink-0 text-danger",size:"small"}),"Could not import ",n.length," ",(0,r.pluralize)(n.length,"item","items")," (click for details)"]})}),(0,e.jsx)(xi.k_,{className:"w-full overflow-hidden pl-5",children:n.map(((t,n)=>(0,e.jsxs)("div",{className:"flex w-full items-center gap-1 overflow-hidden",children:[(0,e.jsxs)("span",{children:[n+1,"."]}),(0,e.jsxs)("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap font-semibold",children:[t.name,":"]}),(0,e.jsx)("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:t.error.message})]},n)))})]})},pg=t=>{let{file:n}=t;if("finished"!==n.status)return null;const{notes:i,tags:o,files:s}=(e=>{let t=0,n=0,i=0;for(const o of e)o.content_type===r.ContentType.TYPES.Note?t++:o.content_type===r.ContentType.TYPES.Tag?n++:o.content_type===r.ContentType.TYPES.File&&i++;return{notes:t,tags:n,files:i}})(n.successful),a=[i>0?"".concat(i," ").concat((0,r.pluralize)(i,"note","notes")):"",o>0?"".concat(o," ").concat((0,r.pluralize)(o,"tag","tags")):"",s>0?"".concat(s," ").concat((0,r.pluralize)(s,"file","files")):""].filter(Boolean).join(", ");return(0,e.jsxs)(e.Fragment,{children:[n.successful.length>0&&(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(xn.Z,{type:"check-circle-filled",className:"flex-shrink-0 text-success",size:"small"}),(0,e.jsxs)("span",{children:[a," imported"]})]}),n.errored.length>0&&(0,e.jsx)(hg,{errored:n.errored})]})},fg=(0,Nn.Pi)((t=>{let{file:n,updateFile:i,removeFile:o,importer:s}=t;const[a,l]=(0,He.useState)(!1),[c,u]=(0,He.useState)(!1),d=(0,He.useCallback)((async e=>{e||u(!0),i(lg(lg({},n),{},{service:e,status:"pending"}))}),[n,i]);return(0,He.useEffect)((()=>{void 0===n.service&&(async()=>{l(!0);const e=await s.detectService(n.file);d(e),l(!1)})()}),[n,s,d]),(0,e.jsxs)("div",{className:(0,r.classNames)("flex gap-2 overflow-hidden px-2 py-2.5",null==n.service?"flex-col items-start md:flex-row md:items-center":"items-center"),children:[(0,e.jsxs)("div",{className:"mr-auto flex w-full items-center",children:[n.service&&(0,e.jsx)("div",{className:(0,r.classNames)("mr-4 rounded p-2",ug[n.service]),children:(0,e.jsx)(xn.Z,{type:dg[n.service],size:"medium"})}),(0,e.jsxs)("div",{className:"flex w-full flex-col overflow-hidden",children:[(0,e.jsx)("div",{children:n.file.name}),a?(0,e.jsx)("div",{className:"text-xs opacity-75",children:"Detecting service..."}):(0,e.jsxs)("div",{className:(0,r.classNames)("finished"!==n.status&&"line-clamp-3","w-full text-xs opacity-75"),children:["pending"===n.status&&n.service&&"Ready to import","pending"===n.status&&!n.service&&"Could not auto-detect service. Please select manually.","parsing"===n.status&&"Parsing...","importing"===n.status&&"Importing...","uploading-files"===n.status&&"Uploading and embedding files...","error"===n.status&&n.error.message,(0,e.jsx)(pg,{file:n})]})]})]}),"pending"===n.status&&(0,e.jsxs)("div",{className:"flex items-center",children:[c?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("form",{className:"flex items-center",onSubmit:e=>{e.preventDefault();const t=e.target.elements[0];d(t.value),u(!1)},children:[(0,e.jsxs)("select",{className:"mr-2 rounded border border-border bg-default px-2 py-1 text-sm",defaultValue:n.service?n.service:void 0,children:[(0,e.jsx)("option",{value:"evernote",children:"Evernote"}),(0,e.jsx)("option",{value:"simplenote",children:"Simplenote"}),(0,e.jsx)("option",{value:"google-keep",children:"Google Keep"}),(0,e.jsx)("option",{value:"aegis",children:"Aegis"}),(0,e.jsx)("option",{value:"plaintext",children:"Plaintext"}),(0,e.jsx)("option",{value:"html",children:"HTML"}),(0,e.jsx)("option",{value:"super",children:"Super"})]}),(0,e.jsx)("button",{"aria-label":"Choose service",type:"submit",className:"rounded border border-border bg-default p-1.5 hover:bg-contrast",children:(0,e.jsx)(xn.Z,{type:"check",size:"medium"})})]}),(0,e.jsx)("button",{"aria-label":"Cancel",className:"ml-2 rounded border border-border bg-default p-1.5 hover:bg-contrast",onClick:()=>{u(!1)},children:(0,e.jsx)(xn.Z,{type:"close",size:"medium"})})]}):(0,e.jsx)("button",{"aria-label":"Change service",className:"rounded border border-border bg-default p-1.5 hover:bg-contrast",onClick:()=>{u(!0)},children:(0,e.jsx)(xn.Z,{type:"settings",size:"medium"})}),(0,e.jsx)("button",{"aria-label":"Remove",className:"ml-2 rounded border border-border bg-default p-1.5 hover:bg-contrast",onClick:()=>{o(n.id)},children:(0,e.jsx)(xn.Z,{type:"trash",size:"medium"})})]}),"finished"===n.status&&n.successful.length>0&&0===n.errored.length&&(0,e.jsx)(xn.Z,{type:"check-circle-filled",className:"flex-shrink-0 text-success"}),"error"===n.status&&(0,e.jsx)(xn.Z,{type:"warning",className:"flex-shrink-0 text-danger"})]})})),gg=(0,Nn.Pi)((t=>{let{setFiles:n,selectFiles:i}=t;const o=(0,sr.I)();return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("button",{onClick:()=>i(),className:"flex min-h-[30vh] w-full flex-col items-center justify-center gap-2 rounded border-2 border-dashed border-info p-2 hover:border-4",onDragStart:e=>e.preventDefault(),onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault();const t=Array.from(e.dataTransfer.files);n(t)},children:[(0,e.jsx)("div",{className:"text-lg font-semibold",children:"Drag and drop files to auto-detect and import"}),(0,e.jsx)("div",{className:"text-sm",children:"Or click to open file picker"})]}),(0,e.jsx)("div",{className:"my-4 w-full text-center",children:"or import from:"}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[(0,e.jsxs)(Ln.Z,{className:"flex items-center !py-2",onClick:()=>i("evernote"),children:[(0,e.jsx)(xn.Z,{type:"evernote",className:"mr-2 text-[#14cc45]"}),"Evernote"]}),(0,e.jsxs)(Ln.Z,{className:"flex items-center !py-2",onClick:()=>i("google-keep"),children:[(0,e.jsx)(xn.Z,{type:"gkeep",className:"mr-2 text-[#fbbd00]"}),"Google Keep"]}),(0,e.jsxs)(Ln.Z,{className:"flex items-center !py-2",onClick:()=>i("simplenote"),children:[(0,e.jsx)(xn.Z,{type:"simplenote",className:"mr-2 text-[#3360cc]"}),"Simplenote"]}),(0,e.jsxs)(Ln.Z,{className:"flex items-center !py-2",onClick:()=>i("aegis"),children:[(0,e.jsx)(xn.Z,{type:"aegis",className:"mr-2 rounded bg-[#0d47a1] p-1 text-[#fff]",size:"normal"}),"Aegis"]}),(0,e.jsxs)(Ln.Z,{className:"flex items-center !py-2",onClick:()=>i("plaintext"),children:[(0,e.jsx)(xn.Z,{type:"plain-text",className:"mr-2 text-info"}),"Plaintext / Markdown"]}),(0,e.jsxs)(Ln.Z,{className:"flex items-center !py-2",onClick:()=>i("html"),children:[(0,e.jsx)(xn.Z,{type:"rich-text",className:"mr-2 text-accessory-tint-2"}),"HTML"]}),(0,e.jsxs)(Ln.Z,{className:"flex items-center !py-2",onClick:()=>{o.features.getFeatureStatus(r.NativeFeatureIdentifier.create(r.NativeFeatureIdentifier.TYPES.SuperEditor).getValue())===r.FeatureStatus.Entitled?i("super").catch(console.error):o.showPremiumModal(mp.Super)},children:[(0,e.jsx)(xn.Z,{type:"file-doc",className:"mr-2 text-accessory-tint-1"}),"Super (JSON)"]})]})]})})),mg=(0,Nn.Pi)((t=>{let{importModalController:n}=t;const i=(0,sr.I)(),{files:o,setFiles:s,addFiles:a,addImportsToTag:l,setAddImportsToTag:c,shouldCreateTag:u,setShouldCreateTag:d,existingTagForImports:h,setExistingTagForImports:p,updateFile:f,removeFile:g,parseAndImport:m,isVisible:y,close:v}=n,A=o.length>0&&o.every((e=>"pending"===e.status&&e.service)),b=o.length>0&&o.every((e=>"finished"===e.status||"error"===e.status)),w=(0,He.useMemo)((()=>[{label:"Import",type:"primary",onClick:m,hidden:!A,mobileSlot:"right",disabled:!A||!u&&!h},{label:b?"Close":"Cancel",type:"cancel",onClick:v,mobileSlot:"left"}]),[v,h,b,A,m,u]),S=(0,He.useCallback)((async e=>{const t=await co.Re.selectFiles();a(t,e)}),[a]);return(0,e.jsx)(Fr,{isOpen:y,close:v,children:(0,e.jsxs)(Gn,{title:"Import",close:v,actions:w,className:"flex flex-col",children:[(0,e.jsxs)("div",{className:"min-h-0 flex-grow overflow-y-auto px-4 py-4",children:[!o.length&&(0,e.jsx)(gg,{setFiles:s,selectFiles:S}),o.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"divide-y divide-border",children:o.map((t=>(0,e.jsx)(fg,{file:t,updateFile:f,removeFile:g,importer:i.importer},t.id)))}),!b&&(0,e.jsx)(Ln.Z,{className:"mt-4",onClick:()=>{S().catch(console.error)},small:!0,children:"Add files"})]})]}),o.length>0&&(0,e.jsxs)("div",{className:"flex flex-col gap-3 border-t border-border px-4 py-4 md:gap-2 md:py-3",children:[(0,e.jsx)(po.Z,{className:"flex items-center gap-2",checked:l,onChange:c,children:(0,e.jsx)("span",{className:"text-sm",children:"Add all imported notes to tag"})}),l&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("label",{className:"mt-1.5 flex items-center gap-2 text-sm",children:[(0,e.jsx)("input",{type:"radio",name:"import-tag",className:"h-6 w-6 md:h-4 md:w-4",checked:u,onChange:()=>{d(!0)}}),"Create new tag"]}),(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,e.jsx)("input",{type:"radio",name:"import-tag",className:"h-6 w-6 md:h-4 md:w-4",checked:!u,onChange:()=>{d(!1)}}),"Add to existing tag"]}),h&&(0,e.jsx)(ms.Z,{className:"m-1 mr-2",link:(0,un.X)(h,"linked"),unlinkItem:async()=>{p(void 0)},isBidirectional:!1,inlineFlex:!0})]}),!u&&(0,e.jsx)("div",{className:"ml-8 md:ml-6",children:(0,e.jsx)(gs.Z,{onSelection:e=>p(e),placeholder:"Select tag to add imported notes to...",contentTypes:[r.ContentType.TYPES.Tag]})})]})]})]})]})})})),yg=()=>{const t=(0,sr.I)(),[n,i]=(0,He.useState)(!1),[o,s]=(0,He.useState)((()=>{var e;return!!(null===(e=document.activeElement)||void 0===e?void 0:e.closest("#blocks-editor,#super-mobile-toolbar"))}));return(0,He.useEffect)((()=>t.addNativeMobileEventListener((e=>{e===r.ReactNativeToWebEvent.KeyboardWillShow?i(!0):e===r.ReactNativeToWebEvent.KeyboardWillHide&&i(!1)}))),[t]),(0,He.useEffect)((()=>{const e=()=>{var e;s(!!(null===(e=document.activeElement)||void 0===e?void 0:e.closest("#blocks-editor,#super-mobile-toolbar")))};return document.addEventListener("focusin",e),document.addEventListener("focusout",e),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",e)}}),[]),n?(0,e.jsx)("button",{className:(0,r.classNames)("absolute bottom-1.5 right-3 rounded-full border border-border bg-contrast p-2.5",o&&"hidden"),children:(0,e.jsx)(xn.Z,{type:"keyboard-close"})}):null},vg=t=>{let{className:n}=t;return(0,e.jsx)("div",{className:(0,r.classNames)("relative h-[2px] w-full bg-current","before:absolute before:-left-px before:top-1/2 before:h-0 before:w-0 before:-translate-y-1/2 before:border-b-[6px] before:border-r-[6px] before:border-t-[6px] before:border-current before:border-b-transparent before:border-t-transparent","after:absolute after:-right-px after:top-1/2 after:h-0 after:w-0 after:-translate-y-1/2 after:border-b-[6px] after:border-l-[6px] after:border-t-[6px] after:border-current after:border-b-transparent after:border-t-transparent",n)})},Ag=t=>{let{initialValue:n,handleChange:i,close:o,note:s}=t;const a=(0,et.ac)(et.Jj.sm),[l,c]=(0,He.useState)((()=>n)),[u,d]=(0,He.useState)(!1),h=(0,He.useMemo)((()=>[{label:"Narrow",value:r.EditorLineWidth.Narrow},{label:"Wide",value:r.EditorLineWidth.Wide},{label:"Dynamic",value:r.EditorLineWidth.Dynamic},{label:"Full width",value:r.EditorLineWidth.FullWidth}]),[]),p=(0,He.useCallback)((()=>{i(l,u),o()}),[o,i,u,l]),f=(0,He.useMemo)((()=>[{label:"Cancel",type:"cancel",onClick:o,mobileSlot:"left"},{label:"Done",type:"primary",onClick:p,mobileSlot:"right"}]),[p,o]),g=(0,e.jsx)("div",{className:"text-center text-sm text-passive-2",children:(0,e.jsxs)("div",{className:l!==r.EditorLineWidth.Dynamic?"hidden":"",children:[(0,e.jsx)("div",{className:"mb-2",children:xf[l]}),(0,e.jsx)(vg,{})]})});return(0,e.jsxs)(Gn,{title:"Set editor width",close:o,customHeader:(0,e.jsx)(e.Fragment,{}),customFooter:(0,e.jsx)(e.Fragment,{}),disableCustomHeader:a,actions:f,className:"flex min-h-[50vh] flex-col",children:[(0,e.jsx)("div",{className:"flex min-h-0 flex-grow flex-col overflow-hidden rounded bg-passive-5 p-4 pb-0",children:(0,e.jsxs)("div",{className:(0,r.classNames)("grid flex-grow grid-cols-[0fr_1fr_0fr] gap-3 rounded rounded-b-none bg-default px-2 pt-4 shadow-[0_1px_4px_rgba(0,0,0,0.12),0_2px_8px_rgba(0,0,0,0.04)] transition-all duration-200 md:px-4",l===r.EditorLineWidth.Narrow&&"md:grid-cols-[1fr_60%_1fr]",l===r.EditorLineWidth.Wide&&"md:grid-cols-[1fr_70%_1fr]",l===r.EditorLineWidth.Dynamic&&"md:grid-cols-[1fr_80%_1fr]",l===r.EditorLineWidth.FullWidth&&"md:grid-cols-[1fr_95%_1fr]"),children:[g,(0,e.jsxs)("div",{className:"flex flex-col text-info",children:[(0,e.jsx)("div",{className:"mb-2 text-center text-sm",children:l===r.EditorLineWidth.Narrow||l===r.EditorLineWidth.Wide?"Max. ".concat(_f[l]):_f[l]}),(0,e.jsx)(vg,{}),(0,e.jsx)("div",{className:"w-full flex-grow bg-[linear-gradient(transparent_50%,var(--sn-stylekit-info-color)_50%)] bg-[length:100%_2.5rem] bg-repeat-y opacity-10"})]}),g]})}),!!s&&(0,e.jsx)("div",{className:"border-t border-border bg-default px-4 py-2",children:(0,e.jsxs)("label",{className:"flex items-center gap-2",children:[(0,e.jsx)(po.Z,{checked:u,onChange:d}),"Set globally ",null!=s.editorWidth&&"(will not apply to current note)"]})}),(0,e.jsxs)(Fd,{className:"justify-center md:justify-between",children:[(0,e.jsx)(li.Z,{items:h,value:l,onChange:e=>c(e)}),(0,e.jsxs)("div",{className:"hidden items-center gap-2 md:flex",children:[(0,e.jsx)(Ln.Z,{onClick:o,children:"Cancel"}),(0,e.jsx)(Ln.Z,{onClick:p,primary:!0,children:"Apply"})]})]})]})},bg=(0,Nn.Pi)((()=>{const t=(0,sr.I)(),{notesController:n}=t,[i,o]=(0,He.useState)(!1),[s,a]=(0,He.useState)(!1),l=1!==n.selectedNotesCount||s?void 0:n.selectedNotes[0],c=l?n.getEditorWidthForNote(l):t.preferences.getLocalValue(r.LocalPrefKey.EditorLineWidth,r.PrefDefaults[r.LocalPrefKey.EditorLineWidth]),u=(0,He.useCallback)(((e,i)=>{l&&!i?n.setNoteEditorWidth(l,e).catch(console.error):t.preferences.setLocalValue(r.LocalPrefKey.EditorLineWidth,e)}),[t,l,n]),d=(0,He.useCallback)((()=>{o((e=>!e))}),[]);return(0,He.useEffect)((()=>t.keyboardService.addCommandHandler({command:L.Wu,category:"Current note",description:"Change editor width",onKeyDown:(e,t)=>{a(!("boolean"!=typeof t||!t)&&t),d()}})),[t,d]),(0,e.jsx)(Fr,{isOpen:i,close:d,className:"select-none md:min-w-[40vw]",children:(0,e.jsx)(Ag,{initialValue:c,handleChange:u,close:d,note:l})})})),wg=e=>e.reduce(((e,t)=>(e[t.category].push(t),e)),{"Current note":[],Formatting:[],"Super notes":[],"Notes list":[],General:[]}),Sg=t=>{let{item:n}=t;return(0,e.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2.5",children:[(0,e.jsx)("div",{children:n.description}),(0,e.jsx)(Hr.J,{className:"ml-auto",shortcut:n,small:!1,dimmed:!1})]})},Cg=(0,Nn.Pi)((t=>{let{keyboardService:n}=t;const[r,i]=(0,He.useState)(!1),[o,s]=(0,He.useState)((()=>wg(n.getRegisteredKeyboardShorcutHelpItems()))),a=(0,He.useCallback)((()=>{i(!1)}),[]);(0,He.useEffect)((()=>n.addCommandHandler({command:L.ZL,category:"General",description:"Toggle keyboard shortcuts help",onKeyDown:()=>{s(wg(n.getRegisteredKeyboardShorcutHelpItems())),i((e=>!e))}})),[n]);const l=(0,He.useMemo)((()=>[{label:"Cancel",onClick:a,type:"cancel",mobileSlot:"left"}]),[a]);return(0,e.jsx)(Fr,{isOpen:r,close:a,children:(0,e.jsx)(Gn,{title:"Keyboard shortcuts",close:a,actions:l,children:Object.entries(o).map((t=>{let[n,r]=t;return r.length>0&&(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"p-4 pb-0.5 pt-4 text-base font-semibold capitalize",children:n}),r.map(((t,n)=>(0,e.jsx)(Sg,{item:t},n)))]},n)}))})})})),Eg=(0,He.lazy)((()=>Promise.all([s.e(667),s.e(108)]).then(s.bind(s,33108)))),Ig=n=>{let{application:i,mainApplicationGroup:o}=n;const s=(0,t.t2)(),[a,l]=(0,He.useState)(!1),[c,u]=(0,He.useState)(!0),[d,h]=(0,He.useState)([]),p=(0,He.useRef)(null),f=(0,He.useRef)(null);(0,He.useEffect)((()=>{const e=i.desktopManager;e&&i.componentManager.setDesktopManager(e),i.prepareForLaunch({receiveChallenge:async e=>{const t=d.slice();t.push(e),h(t)}}).then((()=>{i.launch()})).catch(console.error)}),[i]);const g=(0,He.useCallback)((e=>{const t=d.slice();(0,r.removeFromArray)(t,e),h(t)}),[d]),m=(0,He.useCallback)((()=>{u(i.hasPasscode())}),[i]),y=(0,He.useCallback)((()=>{const e=i.routeService.getRoute();if(e.type!==L.Yt.Demo)return;const t=e.demoParams.token;if(!t||i.hasAccount())return;const n=i.status.addMessage("Preparing demo...");i.user.populateSessionFromDemoShareToken(t).then((()=>{i.status.removeMessage(n),i.hideAccountMenu()}))}),[i]),v=(0,He.useCallback)((()=>{l(!0),u(!1),y()}),[y]);(0,He.useEffect)((()=>{i.isStarted()&&m(),i.isLaunched()&&v();const e=i.addEventObserver((async e=>{e===r.ApplicationEvent.Started?m():e===r.ApplicationEvent.Launched?v():e===r.ApplicationEvent.LocalDatabaseReadError?f.current||(0,L.Ne)({text:"Unable to load local database. Please restart the app and try again."}).then((()=>{f.current=null})).catch(console.error):e===r.ApplicationEvent.LocalDatabaseWriteError?p.current||(p.current=(0,L.Ne)({text:"Unable to write to local database. Please restart the app and try again."}).then((()=>{p.current=null})).catch(console.error)):e===r.ApplicationEvent.SyncTooManyRequests&&(0,Y.fz)({type:Y.pC.Error,message:"Too many requests. Please try again later."})}));return()=>{e()}}),[i,v,m]),(0,He.useEffect)((()=>i.protections.addEventObserver((async e=>{e===Ne.Hh3.BiometricsSoftLockEngaged?u(!0):e===Ne.Hh3.BiometricsSoftLockDisengaged&&u(!1)}))),[i]),(0,He.useEffect)((()=>{const e=i.addWebEventObserver((async e=>{e!==r.WebAppEvent.WindowDidFocus&&e!==r.WebAppEvent.WindowDidBlur||await i.protections.isLocked()||i.sync.sync().catch(console.error)}));return()=>{e()}}),[i]);const A=(0,He.useMemo)((()=>!c&&a),[c,a]),b=(0,He.useCallback)((()=>d.map((t=>(0,e.jsx)("div",{className:"sk-modal",children:(0,e.jsx)(vc,{application:i,mainApplicationGroup:o,challenge:t,onDismiss:g},"".concat(t.id).concat(i.ephemeralIdentifier))},"".concat(t.id).concat(i.ephemeralIdentifier))))),[d,o,g,i]);if(!A)return(0,e.jsx)(sr.Z,{application:i,children:(0,e.jsx)(Kn.Z,{application:i,children:b()})});const w=i.routeService.getRoute();return w.type===L.Yt.AppViewRoute&&"extension"===w.appViewRouteParam?(0,e.jsx)(sr.Z,{application:i,children:(0,e.jsx)(Bn.Z,{service:i.keyboardService,children:(0,e.jsx)(Kn.Z,{application:i,children:(0,e.jsx)(Zr.Z,{paneController:i.paneController,children:(0,e.jsx)(Vr,{application:i,children:(0,e.jsx)(xc.Z,{controller:i.linkingController,children:(0,e.jsxs)(zd,{application:i,children:[(0,e.jsx)(Eg,{applicationGroup:o}),(0,e.jsx)(Y.Ix,{}),(0,e.jsx)(jd,{application:i}),b()]})})})})})})}):(0,e.jsx)(sr.Z,{application:i,children:(0,e.jsx)(Bn.Z,{service:i.keyboardService,children:(0,e.jsx)(Kn.Z,{application:i,children:(0,e.jsx)(Zr.Z,{paneController:i.paneController,children:(0,e.jsx)(Vr,{application:i,children:(0,e.jsx)(xc.Z,{controller:i.linkingController,children:(0,e.jsxs)("div",{className:s+" main-ui-view sn-component h-full",children:[(0,e.jsx)(zd,{application:i,children:(0,e.jsx)(rg,{})}),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ri,{application:i,applicationGroup:o}),(0,e.jsx)(zi,{application:i}),(0,e.jsx)(ac,{application:i}),(0,e.jsx)(Sd,{application:i})]}),b(),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Uu,{}),(0,e.jsx)(Ud,{navigationController:i.navigationController,featuresController:i.featuresController}),(0,e.jsx)(Md,{filesController:i.filesController,itemListController:i.itemListController}),(0,e.jsx)(Wu,{application:i}),(0,e.jsx)(_d,{applicationGroup:o,application:i}),(0,e.jsx)(Y.Ix,{}),(0,e.jsx)(jd,{application:i}),(0,e.jsx)(Ld,{application:i}),(0,e.jsx)(bg,{}),(0,e.jsx)(Jd,{application:i}),(0,e.jsx)(mg,{importModalController:i.importModalController}),(0,e.jsx)(Cg,{keyboardService:i.keyboardService})]}),i.routeService.isDotOrg&&(0,e.jsx)(ig,{}),(0,L.gn)()&&(0,e.jsx)(yg,{})]})})})})})})})},_g=(0,Nn.Pi)((t=>{let{application:n,children:r}=t;return n.dealloced?null:(0,e.jsx)(e.Fragment,{children:r})})),xg=t=>(0,e.jsx)("div",{className:"flex h-full w-full items-center justify-center bg-passive-5",role:"alert",children:(0,e.jsx)("div",{className:"challenge-modal shadow-overlay-light relative flex max-w-125 flex-col items-center rounded border border-solid border-border bg-default p-6",children:(0,e.jsx)("div",{className:"text-base lg:text-xs",children:t})})});class Pg extends He.Component{constructor(e){if(super(e),e.device.isDeviceDestroyed())return void(this.state={deviceDestroyed:!0});this.group=new In(e.server,e.device,e.websocketUrl),window.mainApplicationGroup=this.group,this.applicationObserverRemover=this.group.addEventObserver(((e,t)=>{if(e===r.ApplicationGroupEvent.PrimaryApplicationSet){const e=t;this.application=e.application,this.setState({activeApplication:this.application})}else if(e===r.ApplicationGroupEvent.DeviceWillRestart){const e=t;this.setState({dealloced:!0,deallocSource:e.source})}})),this.state={},this.group.initialize().catch(console.error);const n=(0,t.t2)();document.body.classList.contains(n)||document.body.classList.add(n),pt.G9&&document.body.classList.add("chromium")}deinit(){var e,t;this.application=void 0,null===(e=this.applicationObserverRemover)||void 0===e||e.call(this),this.applicationObserverRemover=void 0,null===(t=this.group)||void 0===t||t.deinit(),this.group=void 0,this.setState({dealloced:!0,activeApplication:void 0}),(0,this.props.onDestroy)()}render(){if(this.state.deviceDestroyed){const e="Secure memory has destroyed this application instance. ".concat((0,t.Z$)()?"Restart the app to continue.":"Close this browser tab and open a new one to continue.");return xg(e)}if(this.state.dealloced){const e=this.state.deallocSource===r.DeinitSource.Lock?"Locking workspace...":"Switching workspace...";return xg(e)}return this.group&&this.state.activeApplication&&!this.state.activeApplication.dealloced?(0,e.jsx)("div",{id:this.state.activeApplication.identifier,className:"h-full",children:(0,e.jsx)(_g,{application:this.state.activeApplication,children:(0,e.jsx)(Ig,{mainApplicationGroup:this.group,application:this.state.activeApplication},this.state.activeApplication.ephemeralIdentifier)})},this.state.activeApplication.ephemeralIdentifier):null}}const kg=Pg,Bg="items",Og="readwrite";class Ng{constructor(e,t){this.databaseName=e,this.alertService=t,this.locked=!0}deinit(){this.alertService=void 0,this.db=void 0}unlock(){this.locked=!1}static async getAllDatabaseNames(){if(window.indexedDB.databases)return(await window.indexedDB.databases()).map((e=>e.name)).filter((e=>e&&e.length>0))}static async deleteAll(e){if(null!=window.indexedDB.databases){const t=await this.getAllDatabaseNames();t&&(e=(0,r.uniqueArray)([...t,...e]))}for(const t of e){const e=new Ng(t);await e.clearAllPayloads(),e.deinit()}}async openDatabase(e){if(this.locked)throw Error("Attempting to open locked database");if(this.db)return this.db;const t=window.indexedDB.open(this.databaseName,1);return new Promise(((n,r)=>{t.onerror=e=>{const t=e.target;t.errorCode?this.showAlert("Offline database issue: "+t.errorCode):this.displayOfflineAlert(),r(new Error("Unable to open db"))},t.onblocked=e=>{r(Error("IndexedDB open request blocked"))},t.onsuccess=e=>{const t=e.target.result;t.onversionchange=()=>{t.close()},t.onerror=e=>{const t=null==e?void 0:e.target;throw Error("Database error: "+t.errorCode)},this.db=t,n(t)},t.onupgradeneeded=t=>{const n=t.target.result;n.onversionchange=()=>{n.close()};const r=n.createObjectStore(Bg,{keyPath:"uuid"});r.createIndex("uuid","uuid",{unique:!0}),r.transaction.oncomplete=()=>{1===n.version&&e&&e&&e()}}}))}async getAllPayloads(){const e=await this.openDatabase();return new Promise((t=>{const n=e.transaction(Bg).objectStore(Bg),r=[];n.openCursor().onsuccess=e=>{const n=e.target.result;n?(r.push(n.value),n.continue()):t(r)}}))}async getPayloadsForKeys(e){if(0===e.length)return[];const t=await this.openDatabase();return new Promise((n=>{const r=t.transaction(Bg).objectStore(Bg),i=[];let o=0;for(const t of e){const s=r.get(t);s.onsuccess=t=>{const r=t.target.result;r&&i.push(r),o++,o===e.length&&n(i)},s.onerror=()=>{o++,o===e.length&&n(i)}}}))}async getAllKeys(){const e=await this.openDatabase();return new Promise((t=>{const n=e.transaction(Bg).objectStore(Bg).getAllKeys();n.onsuccess=function(){const e=n.result.map((e=>(0,r.isString)(e)?e:JSON.stringify(e)));t(e)}}))}async savePayload(e){return this.savePayloads([e])}async savePayloads(e){if(0===e.length)return;const t=(await this.openDatabase()).transaction(Bg,Og);return new Promise(((n,r)=>{t.oncomplete=()=>{},t.onerror=e=>{const t=e.target;this.showGenericError(t.error)},t.onabort=e=>{const t=e.target.error;"QuotaExceededError"===t.name?this.showAlert("Unable to save changes locally because your device is out of space. Please free up some disk space and try again, otherwise, your data may end up in an inconsistent state."):this.showGenericError(t),r(t)};const i=t.objectStore(Bg);this.putItems(i,e).then(n).catch(console.error)}))}async putItems(e,t){await Promise.all(t.map((t=>new Promise((n=>{const r=e.put(t);r.onerror=n,r.onsuccess=n})))))}async deletePayload(e){const t=await this.openDatabase();return new Promise(((n,r)=>{const i=t.transaction(Bg,Og).objectStore(Bg).delete(e);i.onsuccess=()=>{n()},i.onerror=r}))}async clearAllPayloads(){const e=window.indexedDB.deleteDatabase(this.databaseName);return new Promise(((t,n)=>{e.onerror=()=>{n(Error("Error deleting database."))},e.onsuccess=()=>{this.db=void 0,t()},e.onblocked=e=>{this.showAlert("Your browser is blocking Standard Notes from deleting the local database. Make sure there are no other open windows of this app and try again. If the issue persists, please manually delete app data to sign out."),n(Error("Delete request blocked"))}}))}showAlert(e){this.alertService?this.alertService.alert(e).catch(console.error):window.alert(e)}showGenericError(e){const t="Unable to save changes locally due to an unknown system issue. "+"Issue Code: ".concat(e.code," Issue Name: ").concat(e.name,".");this.showAlert(t)}displayOfflineAlert(){this.showAlert("There was an issue loading your offline database. This could happen for two reasons:\n\n1. You're in a private window in your browser. We can't save your data without access to the local database. Please use a non-private window.\n\n2. You have two windows of the app open at the same time. Please close any other app instances and reload the page.")}}function Dg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function jg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Dg(Object(n),!0).forEach((function(t){Tg(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Tg(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Mg{constructor(e){this.appVersion=e,this.databases=[]}setApplication(e){const t=new Ng(e.identifier,e.alerts);this.databases.push(t)}removeApplication(e){const t=this.databaseForIdentifier(e.identifier);t&&(t.deinit(),this.databases=this.databases.filter((e=>e!==t)))}deinit(){for(const e of this.databases)e.deinit();this.databases=[]}async getJsonParsedRawStorageValue(e){const t=await this.getRawStorageValue(e);if(null!=t)try{return JSON.parse(t)}catch(e){return t}}databaseForIdentifier(e){return this.databases.find((t=>t.databaseName===e))}async clearAllDataFromDevice(e){return await this.clearRawKeychainValue(),await this.removeAllRawStorageValues(),await Ng.deleteAll(e),{killsApplication:!1}}async getRawStorageValue(e){const t=localStorage.getItem(e);if(null!=t)return t}async setRawStorageValue(e,t){localStorage.setItem(e,t)}async removeRawStorageValue(e){localStorage.removeItem(e)}async removeAllRawStorageValues(){localStorage.clear()}async removeRawStorageValuesForIdentifier(e){await this.removeRawStorageValue((0,r.namespacedKey)(e,r.RawStorageKey.SnjsVersion)),await this.removeRawStorageValue((0,r.namespacedKey)(e,r.RawStorageKey.StorageObject))}async openDatabase(e){return this.databaseForIdentifier(e).unlock(),new Promise(((t,n)=>{this.databaseForIdentifier(e).openDatabase((()=>{t({isNewDatabase:!0})})).then((()=>{t({isNewDatabase:!1})})).catch((e=>{n(e)}))}))}async getDatabaseLoadChunks(e,t){const n=await this.getAllDatabaseEntries(t),{itemsKeyPayloads:i,keySystemRootKeyPayloads:o,keySystemItemsKeyPayloads:s,contentTypePriorityPayloads:a,remainingPayloads:l}=(0,r.GetSortedPayloadsByPriority)(n,e),c={entries:i},u={entries:o},d={entries:s},h={entries:a},p=[];for(let t=0;t<l.length;t+=e.batchSize)p.push({entries:l.slice(t,t+e.batchSize)});return{fullEntries:{itemsKeys:c,keySystemRootKeys:u,keySystemItemsKeys:d,remainingChunks:[h,...p]},remainingChunksItemCount:a.length+l.length}}async getAllDatabaseEntries(e){return this.databaseForIdentifier(e).getAllPayloads()}getDatabaseEntries(e,t){return this.databaseForIdentifier(e).getPayloadsForKeys(t)}async saveDatabaseEntry(e,t){return this.databaseForIdentifier(t).savePayload(e)}async saveDatabaseEntries(e,t){return this.databaseForIdentifier(t).savePayloads(e)}async removeDatabaseEntry(e,t){return this.databaseForIdentifier(t).deletePayload(e)}async removeAllDatabaseEntries(e){return this.databaseForIdentifier(e).clearAllPayloads()}async getNamespacedKeychainValue(e){const t=await this.getKeychainValue();if(t)return t[e]}async setNamespacedKeychainValue(e,t){let n=await this.getKeychainValue();return n||(n={}),this.setKeychainValue(jg(jg({},n),{},{[t]:e}))}async clearNamespacedKeychainValue(e){const t=await this.getKeychainValue();if(t)return delete t[e],this.setKeychainValue(t)}setRawKeychainValue(e){return this.setKeychainValue(e)}openUrl(e){const t=window.open(e,"_blank");t&&t.focus()}async performSoftReset(){window.location.reload()}}const Fg="keychain",Rg="destroyed",Lg="true";class Qg extends Mg{constructor(){super(...arguments),this.environment=r.Environment.Web}async getKeychainValue(){const e=localStorage.getItem(Fg);return e?JSON.parse(e):{}}async setKeychainValue(e){localStorage.setItem(Fg,JSON.stringify(e))}async clearRawKeychainValue(){localStorage.removeItem(Fg)}async performHardReset(){const e=new URL(window.location.href);e.searchParams.append(Rg,Lg),window.location.replace(e.href)}isDeviceDestroyed(){return new URL(window.location.href).searchParams.get(Rg)===Lg}}var Ug=s(17029);const Vg=()=>{const[t,n]=(0,He.useState)(""),[r,i]=(0,He.useState)(null),[o,s]=(0,He.useState)(null),a="file://";(0,He.useEffect)((()=>{window.parent.postMessage({mountedAuthView:!0},a)}),[]),(0,He.useEffect)((()=>{const e=e=>{V(R.U2F,"U2F iframe received message",e),e.origin!==a?V(R.U2F,"Not setting username; origin does not match",e.origin,a):e.data.username&&(n(e.data.username),i(e.data.apiHost),s(e.source))};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}}),[]);const[l,c]=(0,He.useState)(""),[u,d]=(0,He.useState)(""),h=(0,He.useCallback)((async()=>{c(""),d("");try{if(!t||!o)throw new Error("No username provided");const e=await fetch("".concat(r,"/v1/authenticators/generate-authentication-options"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:t})}),n=await e.json();if(!n.data||!n.data.options)throw new Error("No options returned from server");c("Waiting for security key...");const i=await F(n.data.options);o.postMessage({assertionResponse:i},a),c("Authentication successful!")}catch(e){if(!e)return;d(JSON.stringify(e)),console.error(e)}}),[o,t,r]);return(0,e.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2",children:[(0,e.jsx)("div",{className:"mb-2 text-center",children:"Insert your hardware security key, then press the button below to authenticate."}),(0,e.jsx)(Ln.Z,{onClick:h,children:"Authenticate"}),(0,e.jsxs)("div",{className:"mt-2",children:[(0,e.jsx)("div",{children:l}),(0,e.jsx)("div",{className:"text-danger",children:u})]})]})};let Kg=0;const Hg=async function(n,i,o,s){let a;r.SNLog.onLog=console.log,r.SNLog.onError=console.error;const l=()=>{const e=document.getElementById(kl.N.RootId);a.unmount(),e.remove(),c()},c=()=>{const c=document.createElement("div");c.id=kl.N.RootId,c.className="h-full";const u=document.body.appendChild(c);a=(0,Ug.s)(u),(0,t.Hs)(),i.platform===r.Platform.Android&&document.documentElement.style.setProperty("--sn-stylekit-monospace-font",'"Roboto Mono", "Droid Sans Mono", monospace');const d=new L.mc(window.location.href);d.type!==L.Yt.AppViewRoute||"u2f"!==d.appViewRouteParam?(a.render((0,e.jsx)(kg,{server:n,device:i,enableUnfinished:o,websocketUrl:s,onDestroy:l},Kg++)),window.ReactNativeWebView&&window.ReactNativeWebView.postMessage("appLoaded")):a.render((0,e.jsx)(Vg,{}))};"complete"===document.readyState||"interactive"===document.readyState?c():window.addEventListener("DOMContentLoaded",(function e(){c(),window.removeEventListener("DOMContentLoaded",e)}))};n.Ab?setTimeout((()=>{const e=window.reactNativeDevice||new Qg(n.sU);window.isClipper&&(e.environment=r.Environment.Clipper),window.platform=(0,t.Xf)(e),Hg(window.defaultSyncServer,e,window.enabledUnfinishedFeatures,window.websocketUrl).catch(console.error)}),0):window.startApplication=Hg})()})();
          //# sourceMappingURL=app.js.map
          Evidence
          1732584193
          Solution

          Manually confirm that the timestamp data is not sensitive, and that the data cannot be aggregated to disclose exploitable patterns.

  6. Risk=Informational, Confidence=Medium (2)

    1. https://app.standardnotes.com (2)

      1. Modern Web Application (1)
        1. GET https://app.standardnotes.com/
          Alert tags
          Alert description

          The application appears to be a modern web application. If you need to explore it automatically then the Ajax Spider may well be more effective than the standard one.

          Other info

          No links have been found while there are scripts, which is an indication that this is a modern web application.

          Request
          Request line and header section (213 bytes)
          GET https://app.standardnotes.com/ HTTP/1.1
          host: app.standardnotes.com
          user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0
          pragma: no-cache
          cache-control: no-cache
          
          
          Request body (0 bytes)
          Response
          Status line and header section (1539 bytes)
          HTTP/1.1 200 OK
          Date: Thu, 24 Oct 2024 00:02:55 GMT
          Content-Type: text/html
          Connection: keep-alive
          x-amz-id-2: GaUMYQ5IgA37GmJLRpudnqLwju+3B7BBViiJYmnfDu3Uzg8a2Z6i3dafHKaXPujpjOvrS4LyMQ77rSzF4403Rg==
          x-amz-request-id: BZNBD81VXQW6H41X
          last-modified: Mon, 14 Oct 2024 13:10:00 GMT
          vary: Accept-Encoding
          vary: Origin
          x-frame-options: SAMEORIGIN
          referrer-policy: no-referrer-when-downgrade
          content-security-policy: default-src https: 'self'; base-uri 'self'; child-src * blob:; connect-src api.standardnotes.com sync.standardnotes.org files.standardnotes.com ws://sockets.standardnotes.com raw.githubusercontent.com listed.to blob:; font-src * data:; form-action 'self'; frame-ancestors * file:; frame-src * blob:; img-src 'self' * data: blob:; manifest-src 'self'; media-src 'self' blob: *.standardnotes.com; object-src 'self' blob: *.standardnotes.com; script-src 'self' 'sha256-r26E+iPOhx7KM7cKn4trOSoD8u5E7wL7wwJ8UrR+rGs=' 'wasm-unsafe-eval'; style-src * 'unsafe-hashes' 'sha256-jpJOxTrdc58x4woq2mVygDDIvjIAGNkLZ2yfx4ppdXo=' 'sha256-tbWZ4NP1341cpcrZVDn7B3o9bt/muXgduILAnC0Zbaw=';
          x-content-type-options: nosniff
          strict-transport-security: max-age=31536000; includeSubDomains; preload
          access-control-allow-origin: *
          x-cache: Hit from cloudfront
          via: 1.1 d6ada58e0613f9fa5d29f16dca3993b6.cloudfront.net (CloudFront)
          x-amz-cf-pop: ATL59-P3
          x-amz-cf-id: jTEifMyKROZB69N4vzmglVzEFlHLgrMxm7-X9f71biOyQnNYPkdl9Q==
          Age: 67929
          cf-cache-status: DYNAMIC
          Server: cloudflare
          CF-RAY: 8d75b3694b8ebd0f-ATL
          content-length: 2575
          
          
          Response body (2575 bytes)
          <!DOCTYPE html>
          <html>
            <head>
              <meta charset="utf-8"/>
              <meta content="IE=edge" http-equiv="X-UA-Compatible"/>
              <meta content="viewport-fit=cover, width=device-width, initial-scale=1" name="viewport"/>
          
              <link rel="canonical" href="https://app.standardnotes.com" />
          
              <link href="favicon/apple-touch-icon.png" rel="apple-touch-icon" sizes="180x180"></link>
              <link href="favicon/favicon-32x32.png" rel="icon" sizes="32x32" type="image/png"></link>
              <link href="favicon/favicon-16x16.png" rel="icon" sizes="16x16" type="image/png"></link>
              <link href="manifest.webmanifest" rel="manifest"></link>
          
              <link color="#5bbad5" href="favicon/safari-pinned-tab.svg" rel="mask-icon"></link>
              <meta name="theme-color" content="#ffffff">
          
              <meta content="Standard Notes" name="apple-mobile-web-app-title"/>
              <meta content="Standard Notes" name="application-name"/>
              <base href="/"></base>
          
              <title>Notes · Standard Notes</title>
              <meta name="description" content="Standard Notes is an easy-to-use encrypted note-taking app for digitalists and professionals. Capture your notes, documents, and life's work all in one place."/>
          
              <meta name="twitter:title" content="Standard Notes, an end-to-end encrypted notes app."/>
              <meta name="twitter:description" content="Standard Notes is an easy-to-use encrypted note-taking app for digitalists and professionals. Capture your notes, documents, and life's work all in one place."/>
              <meta name="twitter:site" content="@standardnotes"/>
              <meta name="twitter:card" content="summary"/>
          
              <meta name="og:title" content="Standard Notes, an end-to-end encrypted notes app."/>
              <meta name="og:description" content="Standard Notes is an easy-to-use encrypted note-taking app for digitalists and professionals. Capture your notes, documents, and life's work all in one place."/>
          
              <!-- CSP script-src hash: sha256-r26E+iPOhx7KM7cKn4trOSoD8u5E7wL7wwJ8UrR+rGs= -->
              <script>
                window.defaultSyncServer = "https://api.standardnotes.com";
                window.defaultFilesHost = "https://files.standardnotes.com";
                window.enabledUnfinishedFeatures = false;
                window.websocketUrl = "wss://sockets.standardnotes.com";
                window.purchaseUrl = "https://standardnotes.com/purchase";
                window.plansUrl = "https://standardnotes.com/plans";
                window.dashboardUrl = "https://standardnotes.com/dashboard";
              </script>
          
              <script src="./app.js" debug="false"></script>
              <link rel="stylesheet" media="all" href="./app.css" debug="false" />
            </head>
            <body>
            </body>
          </html>
          
          Evidence
          <script>
                window.defaultSyncServer = "https://api.standardnotes.com";
                window.defaultFilesHost = "https://files.standardnotes.com";
                window.enabledUnfinishedFeatures = false;
                window.websocketUrl = "wss://sockets.standardnotes.com";
                window.purchaseUrl = "https://standardnotes.com/purchase";
                window.plansUrl = "https://standardnotes.com/plans";
                window.dashboardUrl = "https://standardnotes.com/dashboard";
              </script>
          Solution

          This is an informational alert and so no changes are required.

      2. Retrieved from Cache (1)
        1. GET https://app.standardnotes.com/favicon/favicon-16x16.png
          Alert tags
          Alert description

          The content was retrieved from a shared cache. If the response data is sensitive, personal or user-specific, this may result in sensitive information being leaked. In some cases, this may even result in a user gaining complete control of the session of another user, depending on the configuration of the caching components in use in their environment. This is primarily an issue where caching servers such as "proxy" caches are configured on the local network. This configuration is typically found in corporate or educational environments, for instance.

          Request
          Request line and header section (279 bytes)
          GET https://app.standardnotes.com/favicon/favicon-16x16.png HTTP/1.1
          host: app.standardnotes.com
          user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0
          pragma: no-cache
          cache-control: no-cache
          referer: https://app.standardnotes.com/
          
          
          Request body (0 bytes)
          Response
          Status line and header section (1615 bytes)
          HTTP/1.1 200 OK
          Date: Thu, 24 Oct 2024 00:02:56 GMT
          Content-Type: image/png
          Content-Length: 557
          Connection: keep-alive
          x-amz-id-2: sIWTSx42wBqrIEpzln6DwKsh2M4hm0SKpzP5hW8MBqRvMAQ+cO3YB0+c/7WYBaTX6o9jTS6OLhs=
          x-amz-request-id: C1E2HWV4FPM52KE9
          last-modified: Sat, 22 Jun 2024 12:23:03 GMT
          etag: "087f2b8f132119b7295c29318d8023f4"
          vary: Accept-Encoding
          vary: Origin
          x-frame-options: SAMEORIGIN
          referrer-policy: no-referrer-when-downgrade
          content-security-policy: default-src https: 'self'; base-uri 'self'; child-src * blob:; connect-src api.standardnotes.com sync.standardnotes.org files.standardnotes.com ws://sockets.standardnotes.com raw.githubusercontent.com listed.to blob:; font-src * data:; form-action 'self'; frame-ancestors * file:; frame-src * blob:; img-src 'self' * data: blob:; manifest-src 'self'; media-src 'self' blob: *.standardnotes.com; object-src 'self' blob: *.standardnotes.com; script-src 'self' 'sha256-r26E+iPOhx7KM7cKn4trOSoD8u5E7wL7wwJ8UrR+rGs=' 'wasm-unsafe-eval'; style-src * 'unsafe-hashes' 'sha256-jpJOxTrdc58x4woq2mVygDDIvjIAGNkLZ2yfx4ppdXo=' 'sha256-tbWZ4NP1341cpcrZVDn7B3o9bt/muXgduILAnC0Zbaw=';
          x-content-type-options: nosniff
          strict-transport-security: max-age=31536000; includeSubDomains; preload
          access-control-allow-origin: *
          x-cache: Hit from cloudfront
          via: 1.1 d6ada58e0613f9fa5d29f16dca3993b6.cloudfront.net (CloudFront)
          x-amz-cf-pop: ATL59-P3
          x-amz-cf-id: -7qmKzGBgeeRPSBqy2E3v4T8uxVL9k5PHaNbB78lSdQJvJOfjhR1Yg==
          Age: 2068
          Cache-Control: max-age=14400
          CF-Cache-Status: HIT
          Accept-Ranges: bytes
          Server: cloudflare
          CF-RAY: 8d75b36ceac3b045-ATL
          
          
          Response body (557 bytes)
          ‰PNG
          
          
          IHDR(-SgAMA±üa cHRMz&€„ú€èu0ê`:˜pœºQ<EPLTEmÖmÖÿÿÿÿÿÿmÖlÖ!{ÚÜéùÜêùÿÿÿÿþþÿþýùùùõõõôôôûûûüüüþþþýýýöööúúú÷÷÷øøø& ÷stRNSÖþþÖêye×bKGDf|d	pHYsšœtIMEã:F!]IDATÓ]ÌÙ€ EQԊ0lðÿ?5-l¥ûñ¬S@õA
          ƒ2™°qýA"»},Q	΋Ü¢{qړ,ŽÊGªJ8¯†[ÈBÂû4µŽ· ©£ÁôÁÜ5	}äPy%tEXtdate:create2019-05-12T01:29:20+02:00{]úí%tEXtdate:modify2019-05-12T01:29:20+02:00
          BQWzTXtRaw profile type iptcxœãòqV((ÊOËÌIåR#.c#K“ D€4Ãd#³T ËØÔÈÄÌÄÄˀH J.êtòB5•IEND®B`‚
          Evidence
          Hit from cloudfront
          Solution

          Validate that the response does not contain sensitive, personal or user-specific information. If it does, consider the use of the following HTTP response headers, to limit, or prevent the content being stored and retrieved from the cache by another user:

          Cache-Control: no-cache, no-store, must-revalidate, private

          Pragma: no-cache

          Expires: 0

          This configuration directs both HTTP 1.0 and HTTP 1.1 compliant caching servers to not store the response, and to not retrieve the response (without validation) from the cache, in response to a similar request.

  7. Risk=Informational, Confidence=Low (2)

    1. https://app.standardnotes.com (2)

      1. Information Disclosure - Suspicious Comments (1)
        1. GET https://app.standardnotes.com/
          Alert tags
          Alert description

          The response appears to contain suspicious comments which may help an attacker. Note: Matches made within script blocks or files are against the entire content not only comments.

          Other info

          The following pattern was used: \bDEBUG\b and was detected in the element starting with: "<script src="./app.js" debug="false"></script>", see evidence field for the suspicious comment/snippet.

          Request
          Request line and header section (213 bytes)
          GET https://app.standardnotes.com/ HTTP/1.1
          host: app.standardnotes.com
          user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0
          pragma: no-cache
          cache-control: no-cache
          
          
          Request body (0 bytes)
          Response
          Status line and header section (1539 bytes)
          HTTP/1.1 200 OK
          Date: Thu, 24 Oct 2024 00:02:55 GMT
          Content-Type: text/html
          Connection: keep-alive
          x-amz-id-2: GaUMYQ5IgA37GmJLRpudnqLwju+3B7BBViiJYmnfDu3Uzg8a2Z6i3dafHKaXPujpjOvrS4LyMQ77rSzF4403Rg==
          x-amz-request-id: BZNBD81VXQW6H41X
          last-modified: Mon, 14 Oct 2024 13:10:00 GMT
          vary: Accept-Encoding
          vary: Origin
          x-frame-options: SAMEORIGIN
          referrer-policy: no-referrer-when-downgrade
          content-security-policy: default-src https: 'self'; base-uri 'self'; child-src * blob:; connect-src api.standardnotes.com sync.standardnotes.org files.standardnotes.com ws://sockets.standardnotes.com raw.githubusercontent.com listed.to blob:; font-src * data:; form-action 'self'; frame-ancestors * file:; frame-src * blob:; img-src 'self' * data: blob:; manifest-src 'self'; media-src 'self' blob: *.standardnotes.com; object-src 'self' blob: *.standardnotes.com; script-src 'self' 'sha256-r26E+iPOhx7KM7cKn4trOSoD8u5E7wL7wwJ8UrR+rGs=' 'wasm-unsafe-eval'; style-src * 'unsafe-hashes' 'sha256-jpJOxTrdc58x4woq2mVygDDIvjIAGNkLZ2yfx4ppdXo=' 'sha256-tbWZ4NP1341cpcrZVDn7B3o9bt/muXgduILAnC0Zbaw=';
          x-content-type-options: nosniff
          strict-transport-security: max-age=31536000; includeSubDomains; preload
          access-control-allow-origin: *
          x-cache: Hit from cloudfront
          via: 1.1 d6ada58e0613f9fa5d29f16dca3993b6.cloudfront.net (CloudFront)
          x-amz-cf-pop: ATL59-P3
          x-amz-cf-id: jTEifMyKROZB69N4vzmglVzEFlHLgrMxm7-X9f71biOyQnNYPkdl9Q==
          Age: 67929
          cf-cache-status: DYNAMIC
          Server: cloudflare
          CF-RAY: 8d75b3694b8ebd0f-ATL
          content-length: 2575
          
          
          Response body (2575 bytes)
          <!DOCTYPE html>
          <html>
            <head>
              <meta charset="utf-8"/>
              <meta content="IE=edge" http-equiv="X-UA-Compatible"/>
              <meta content="viewport-fit=cover, width=device-width, initial-scale=1" name="viewport"/>
          
              <link rel="canonical" href="https://app.standardnotes.com" />
          
              <link href="favicon/apple-touch-icon.png" rel="apple-touch-icon" sizes="180x180"></link>
              <link href="favicon/favicon-32x32.png" rel="icon" sizes="32x32" type="image/png"></link>
              <link href="favicon/favicon-16x16.png" rel="icon" sizes="16x16" type="image/png"></link>
              <link href="manifest.webmanifest" rel="manifest"></link>
          
              <link color="#5bbad5" href="favicon/safari-pinned-tab.svg" rel="mask-icon"></link>
              <meta name="theme-color" content="#ffffff">
          
              <meta content="Standard Notes" name="apple-mobile-web-app-title"/>
              <meta content="Standard Notes" name="application-name"/>
              <base href="/"></base>
          
              <title>Notes · Standard Notes</title>
              <meta name="description" content="Standard Notes is an easy-to-use encrypted note-taking app for digitalists and professionals. Capture your notes, documents, and life's work all in one place."/>
          
              <meta name="twitter:title" content="Standard Notes, an end-to-end encrypted notes app."/>
              <meta name="twitter:description" content="Standard Notes is an easy-to-use encrypted note-taking app for digitalists and professionals. Capture your notes, documents, and life's work all in one place."/>
              <meta name="twitter:site" content="@standardnotes"/>
              <meta name="twitter:card" content="summary"/>
          
              <meta name="og:title" content="Standard Notes, an end-to-end encrypted notes app."/>
              <meta name="og:description" content="Standard Notes is an easy-to-use encrypted note-taking app for digitalists and professionals. Capture your notes, documents, and life's work all in one place."/>
          
              <!-- CSP script-src hash: sha256-r26E+iPOhx7KM7cKn4trOSoD8u5E7wL7wwJ8UrR+rGs= -->
              <script>
                window.defaultSyncServer = "https://api.standardnotes.com";
                window.defaultFilesHost = "https://files.standardnotes.com";
                window.enabledUnfinishedFeatures = false;
                window.websocketUrl = "wss://sockets.standardnotes.com";
                window.purchaseUrl = "https://standardnotes.com/purchase";
                window.plansUrl = "https://standardnotes.com/plans";
                window.dashboardUrl = "https://standardnotes.com/dashboard";
              </script>
          
              <script src="./app.js" debug="false"></script>
              <link rel="stylesheet" media="all" href="./app.css" debug="false" />
            </head>
            <body>
            </body>
          </html>
          
          Evidence
          debug
          Solution

          Remove all comments that return information that may help an attacker and fix any underlying problems they refer to.

      2. Re-examine Cache-control Directives (1)
        1. GET https://app.standardnotes.com/manifest.webmanifest
          Alert tags
          Alert description

          The cache-control header has not been set properly or is missing, allowing the browser and proxies to cache content. For static assets like css, js, or image files this might be intended, however, the resources should be reviewed to ensure that no sensitive content will be cached.

          Request
          Request line and header section (274 bytes)
          GET https://app.standardnotes.com/manifest.webmanifest HTTP/1.1
          host: app.standardnotes.com
          user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0
          pragma: no-cache
          cache-control: no-cache
          referer: https://app.standardnotes.com/
          
          
          Request body (0 bytes)
          Response
          Status line and header section (1584 bytes)
          HTTP/1.1 200 OK
          Date: Thu, 24 Oct 2024 00:02:56 GMT
          Content-Type: application/manifest+json
          Content-Length: 809
          Connection: keep-alive
          x-amz-id-2: eKOSP7/iqdPRcG/zBGdFzvzUbKGspJgCxegDFwXJlsejEE8Vtp9cYTHFVlcahRxPBM8YafTkGCo=
          x-amz-request-id: 0FN61WGR9QMPKFR7
          last-modified: Mon, 14 Oct 2024 13:10:00 GMT
          etag: "f0bdabc1bb8b1896a7e9cc103208c575"
          vary: Accept-Encoding
          vary: Origin
          x-frame-options: SAMEORIGIN
          referrer-policy: no-referrer-when-downgrade
          content-security-policy: default-src https: 'self'; base-uri 'self'; child-src * blob:; connect-src api.standardnotes.com sync.standardnotes.org files.standardnotes.com ws://sockets.standardnotes.com raw.githubusercontent.com listed.to blob:; font-src * data:; form-action 'self'; frame-ancestors * file:; frame-src * blob:; img-src 'self' * data: blob:; manifest-src 'self'; media-src 'self' blob: *.standardnotes.com; object-src 'self' blob: *.standardnotes.com; script-src 'self' 'sha256-r26E+iPOhx7KM7cKn4trOSoD8u5E7wL7wwJ8UrR+rGs=' 'wasm-unsafe-eval'; style-src * 'unsafe-hashes' 'sha256-jpJOxTrdc58x4woq2mVygDDIvjIAGNkLZ2yfx4ppdXo=' 'sha256-tbWZ4NP1341cpcrZVDn7B3o9bt/muXgduILAnC0Zbaw=';
          x-content-type-options: nosniff
          strict-transport-security: max-age=31536000; includeSubDomains; preload
          access-control-allow-origin: *
          x-cache: Hit from cloudfront
          via: 1.1 bf3a9f862750f6da9d9a728ea7e7bf08.cloudfront.net (CloudFront)
          x-amz-cf-pop: ATL59-P3
          x-amz-cf-id: Hd5vYxN_U0Mp8KIo3tSh_loNhNDxZRSuuOALxQfYsqSB2_gj1ZvDWQ==
          Age: 61209
          cf-cache-status: DYNAMIC
          Server: cloudflare
          CF-RAY: 8d75b36cfc22adc9-ATL
          
          
          Response body (809 bytes)
          {
            "app": {
              "launch": {
                "urls": [
                  "https://app.standardnotes.com/"
                ],
                "web_url": "https://app.standardnotes.com",
                "container": "tab"
              }
            },
            "offline_enabled": true,
            "permissions": [],
            "requirements": {
              "3D": {
                "features": []
              }
            },
            "icons": [
              {
                "src": "favicon/android-chrome-192x192.png",
                "sizes": "192x192",
                "type": "image/png"
              },
              {
                "src": "favicon/android-chrome-512x512.png",
                "sizes": "512x512",
                "purpose": "any maskable",
                "type": "image/png"
              }
            ],
            "name": "Standard Notes",
            "description": "A Simple And Private Notes App",
            "version": "1.0",
            "manifest_version": 2,
            "theme_color": "#ffffff",
            "background_color": "#ffffff",
            "display": "standalone",
            "start_url": ".."
          }
          
          Parameter
          cache-control
          Solution

          For secure content, ensure the cache-control HTTP header is set with "no-cache, no-store, must-revalidate". If an asset should be cached consider setting the directives "public, max-age, immutable".

Appendix

Alert types

This section contains additional information on the types of alerts in the report.

  1. Cloud Metadata Potentially Exposed

    Source raised by an active scanner (Cloud Metadata Potentially Exposed)
    Reference
    1. https://www.nginx.com/blog/trust-no-one-perils-of-trusting-user-input/
  2. CSP: Wildcard Directive

    Source raised by a passive scanner (CSP)
    CWE ID 693
    WASC ID 15
    Reference
    1. https://www.w3.org/TR/CSP/
    2. https://caniuse.com/#search=content+security+policy
    3. https://content-security-policy.com/
    4. https://github.com/HtmlUnit/htmlunit-csp
    5. https://developers.google.com/web/fundamentals/security/csp#policy_applies_to_a_wide_variety_of_resources
  3. CSP: script-src unsafe-eval

    Source raised by a passive scanner (CSP)
    CWE ID 693
    WASC ID 15
    Reference
    1. https://www.w3.org/TR/CSP/
    2. https://caniuse.com/#search=content+security+policy
    3. https://content-security-policy.com/
    4. https://github.com/HtmlUnit/htmlunit-csp
    5. https://developers.google.com/web/fundamentals/security/csp#policy_applies_to_a_wide_variety_of_resources
  4. CSP: style-src unsafe-hashes

    Source raised by a passive scanner (CSP)
    CWE ID 693
    WASC ID 15
    Reference
    1. https://www.w3.org/TR/CSP3/#unsafe-hashes-usage
    2. https://content-security-policy.com/examples/allow-inline-style/
  5. Cross-Domain Misconfiguration

    Source raised by a passive scanner (Cross-Domain Misconfiguration)
    CWE ID 264
    WASC ID 14
    Reference
    1. https://vulncat.fortify.com/en/detail?id=desc.config.dotnet.html5_overly_permissive_cors_policy
  6. Private IP Disclosure

    Source raised by a passive scanner (Private IP Disclosure)
    CWE ID 200
    WASC ID 13
    Reference
    1. https://tools.ietf.org/html/rfc1918
  7. Server Leaks Information via "X-Powered-By" HTTP Response Header Field(s)

    Source raised by a passive scanner (Server Leaks Information via "X-Powered-By" HTTP Response Header Field(s))
    CWE ID 200
    WASC ID 13
    Reference
    1. https://owasp.org/www-project-web-security-testing-guide/v42/4-Web_Application_Security_Testing/01-Information_Gathering/08-Fingerprint_Web_Application_Framework
    2. https://www.troyhunt.com/2012/02/shhh-dont-let-your-response-headers.html
  8. Timestamp Disclosure - Unix

    Source raised by a passive scanner (Timestamp Disclosure)
    CWE ID 200
    WASC ID 13
    Reference
    1. https://cwe.mitre.org/data/definitions/200.html
  9. X-Content-Type-Options Header Missing

    Source raised by a passive scanner (X-Content-Type-Options Header Missing)
    CWE ID 693
    WASC ID 15
    Reference
    1. https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/compatibility/gg622941(v=vs.85)
    2. https://owasp.org/www-community/Security_Headers
  10. Information Disclosure - Suspicious Comments

    Source raised by a passive scanner (Information Disclosure - Suspicious Comments)
    CWE ID 200
    WASC ID 13
  11. Modern Web Application

    Source raised by a passive scanner (Modern Web Application)
  12. Re-examine Cache-control Directives

    Source raised by a passive scanner (Re-examine Cache-control Directives)
    CWE ID 525
    WASC ID 13
    Reference
    1. https://cheatsheetseries.owasp.org/cheatsheets/Session_Management_Cheat_Sheet.html#web-content-caching
    2. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
    3. https://grayduck.mn/2021/09/13/cache-control-recommendations/
  13. Retrieved from Cache

    Source raised by a passive scanner (Retrieved from Cache)
    Reference
    1. https://tools.ietf.org/html/rfc7234
    2. https://tools.ietf.org/html/rfc7231
    3. https://www.rfc-editor.org/rfc/rfc9110.html